yatli / gui-widgets.nvim

44 stars 1 forks source link

Error parsing math in markdown #2

Open Eloitor opened 2 years ago

Eloitor commented 2 years ago

Steps to reproduce:

fvim test.md

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

image

yatli commented 2 years ago

No repro here: image

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

Eloitor commented 2 years ago

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 commented 2 years ago

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

yatli commented 2 years ago

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 commented 2 years ago

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

Eloitor commented 2 years ago

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.

yatli commented 2 years ago

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

Eloitor commented 2 years ago

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.