shime / livedown

Live Markdown previews for your favorite editor.
MIT License
765 stars 51 forks source link

Added support for KaTeX rendering using markdown-it-katex #38

Open erobl opened 6 years ago

erobl commented 6 years ago

Solves issue #15 with KaTeX rendering. I figured it's lightweight enough to leave as a default option, but I can also hide it behind a flag if it's necessary.

shime commented 6 years ago

Looks good to me. Maybe we could include this - what are your thoughts, @niftylettuce?

rcgalbo commented 6 years ago

What is the status of this? Would be very useful for my markdown documents!

erobl commented 6 years ago

I've been using it for a while on my own build, and there's some bugs with the rendering. I can't find what's wrong with it.

shime commented 6 years ago

@erobl what kind of bugs? Did you report it to markdown-it-katex maintainers?

erobl commented 6 years ago

No, the main problem is that I'm not sure if I'm missing a font or a style, perhaps the style that's included in the project is conflicting with the spacing on the equations? Multiline equations aren't rendering properly: image

The equations render fine on their demo, so it's probably my fault.

Edit: It seems to be related with this issue. I downgraded the KaTeX CSS and it's working now. I'll be uploading the new commit soon.

samkimhis commented 6 years ago

The commits by @erobl work beautifully on my system (macOS, vim) for rendering equations and appear to be much faster than the MathJax workaround (https://github.com/suan/vim-instant-markdown/issues/67). Could you close this pull request? I think a lot of people will benefit from this feature.

sulibo commented 5 years ago

It will be nice if this pull request can be merged.

ysftaha commented 5 years ago

Is @shime dead?

hcgatewood commented 5 years ago

Xpost from another thread: Until this gets resolved/pulled, feel free to check out my fork which includes automatic handling of KaTeX equations @hcgatewood/livedown. Installation via npm install -g git+https://github.com/hcgatewood/livedown.