-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Feature: pylatexenc as latex renderer #271
Comments
I was originally going to slap it in and call it a day but,
I am still skeptical about using it(pylatexenc) as I generally prefer not replying on external tools. But if there's more people who need that then I have no problem adding support.
I have no issues adding feature parity. But I don't know which commands are used commonly and what they look like (I have never used So, unless somebody can point to what commands should be added I can't do much on my own. You can also add your own command previews like so(this is for local quad = { condition = function (item)
--- Only show preview --- If \quad receives
--- a single argument.
return #item.args == 1;
end,
on_command = { --- Hide \quad part.
conceal = ""
},
on_args = {
{
on_before = function (item)
--- Hide {
return {
end_col = item.range[2] + 1,
conceal = "",
virt_text_pos = "inline",
virt_text = { { " " } }
};
end,
--- Change the position of the `after`
--- extmark.
--- Needed to hide }
after_offset = function (range)
return { range[1], range[2], range[3], range[4] - 1 };
end,
on_after = function (item)
--- Hide }
return {
end_col = item.range[4],
conceal = ""
};
end
}
}
};
require("markview").setup({
latex = {
commands = {
["quad"] = quad
}
}
}); |
Thanks for the example, I don't think I found it in the docs for the latex section. About the commands, I'm not a latex expert either, but I would check out the ones I mentioned and possibly all the math related ones (like logic operators), text boxes and the environments like aligns and equations. Additionally, can I ask for more examples about how to modify the ^n and _n rendering? I like the idea, but I found the colours and size to be off for my case |
There's an entire section just for LaTeX commands
You unfortunately can't. There's no way to render subscript & superscript text. The plugin just uses symbols that look-alike. So, depending on the font they would look off. I will add an option to only use |
I am indeed stupid, thanks for the patience. We can close the issue I assume, then |
You can now do See wiki |
🔖 Feature description:
Hello,
coming from MeanderingProgrammer/render-markdown.nvim, I personally appreciate more the features supported by pylatexenc (like & to align fixed points in multi-line equations, support of \quad \frac \mbox ...).
📂 Possible solutions:
This said, I do actually prefer your solution for ^n and _n, so what I am really asking for is either feature parity or the possibility to switch to pylatexenc (with the output replacing the line as the native solution)
🧾 Feature reference:
MeanderingProgrammer/render-markdown.nvim
The text was updated successfully, but these errors were encountered: