gui-widgets.nvim icon indicating copy to clipboard operation
gui-widgets.nvim copied to clipboard

Error parsing math in markdown

Open Eloitor opened this issue 3 years ago • 8 comments

Steps to reproduce:

fvim test.md

write this is a test $x^2$ and press esc.

image

Eloitor avatar Aug 10 '22 11:08 Eloitor

No repro here: image

Most probably a neovim version issue. ui_watched is a bleeding edge thing.

yatli avatar Aug 10 '22 12:08 yatli

Thank you, I'm on version 0.7.2, from the void-linux repo. I'll try to build it from the master branch instead.

By the way, the output looks very nice

Eloitor avatar Aug 10 '22 12:08 Eloitor

I've compiled it, but the latex preview is not showing... do I need to run some command?

Eloitor avatar Aug 10 '22 12:08 Eloitor

You may need to make some edits and return to normal mode to trigger the updates. One caveat is that the math equation is first sent to an online rendering service... So that might also be an issue if the rendered image could not be retrieved. Could you first check if other stuff (like ## Titles) work?

yatli avatar Aug 10 '22 13:08 yatli

Note, I also see that underdashes are not rendering correctly in your screenshot. Try play with FVimFontLineHeight '+1.0'

yatli avatar Aug 10 '22 13:08 yatli

I needed to manually run :setfiletype markdown. Now it is working! :)

By the way the images of math equations generated on a title need some scaling. (I don't know how to scale the fonts in a GUI to test if the image scales with the text)

I'd like if this plugin had an option to use an offline renderer, for example https://github.com/mneri/pnglatex or https://github.com/MaT1g3R/pnglatex. I'm willing to help with this if you are interested.

Eloitor avatar Aug 10 '22 14:08 Eloitor

I needed to manually run :setfiletype markdown. Now it is working! :)

Good catch. I had to do the same because I later installed vimwiki, but not sure why you need to do it too. What's your default ft for markdown?

By the way the images of math equations generated on a title need some scaling. (I don't know how to scale the fonts in a GUI to test if the image scales with the text)

I'd like if this plugin had an option to use an offline renderer, for example https://github.com/mneri/pnglatex or https://github.com/MaT1g3R/pnglatex. I'm willing to help with this if you are interested.

I've been thinking about using an offline renderer (it's been there for Emacs for decades already!) but this plugin has been in the demo state for a long time.

Improvements to markdown rendering will be a good start.

Also see: https://github.com/yatli/gui-widgets.nvim/issues/1

yatli avatar Aug 10 '22 21:08 yatli

I finally know why I needed to manually run :setfiletype markdown. The master branch of nvim breaks my current configuration based on astronvim. I don't know what I'll do with it.

I'll try to help with what I can.

Eloitor avatar Aug 11 '22 19:08 Eloitor