Closed AlejandroGomezFrieiro closed 5 months ago
What OS are you running? I haven't done any testing with windows, so just checking that first.
pylatexenc
should come with an executable called latex2text
which is what this plugin uses to do the translation. Does running latex2text
on the command line work for you?
Using Ubuntu, lates2text worked as expected on both CLI and as a command within nvim (:!latex2text
)
Hmm, could be a few things.
I've added some debug statements to the plugin to help figure out whats going on.
Can you update the plugin so that you have this recent commit: https://github.com/MeanderingProgrammer/markdown.nvim/commit/7aedbde39ab236d27096a8f8846235af050dbd7f
Set the log_level
of this plugin to debug
:
require('render-markdown').setup({
log_level = 'debug',
})
Then create a markdown file with the following contents:
# Inline Formula
$\sqrt{3x-1}+(1+x)^2$
# Block Formula
$$
f(x,y) = x + \sqrt{y}
f(x,y) = \sqrt{y} + \frac{x^2}{4y}
$$
Open it such that this plugin renders the contents, the headings should at least work.
Then copy & paste the contents of the log file here. The log file should be located at: ~/.local/state/nvim/render-markdown.log
.
I have the same problem, I test it on both archlinux and windows 11, just latex not render, everything else work alright. I have installed Pylatexenc
, and latex2text
can work in cmd and nvim cmd :!latex2text -c ...
, here is the screenshot:
and here is the log:
Based on the logs above it appears you do not have the latex tree sitter parser installed. Please TSInstall it and let me know if it works.
Based on the logs above it appears you do not have the latex tree sitter parser installed. Please TSInstall it and let me know if it works.
♥️ It works! I thought about this reason, then I thought markdown parser should support latex, so I didn't try it, maybe you could add this in readme.
Same, I had the texlab LSP installed so I though it would be sufficient
After running :TSInstallFromGrammar latex
to set it up, it runs as expected. I recommend adding instructions for this to the README
Ah, that makes sense, should have been more clear of the requirements.
I've updated the README as well as the health check to make debugging this easier in the future: https://github.com/MeanderingProgrammer/markdown.nvim/commit/a2788a8c711539d9425a96e413a26b67eba60131.
Thanks for the feedback!
I installed pylatexenc using pipx such that it's available globally, but math mode rendering is not working.
I tested copying the markdown file kn the demo folder, and everything looks the same except for the math mode.
Other tests I did to no avail: