livedown icon indicating copy to clipboard operation
livedown copied to clipboard

How to use MathJax or other rendering engine?

Open oplatek opened this issue 9 years ago • 7 comments

When using MathJax via <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default"></script> the equations are not rerendered.

Do you have any recommendation for that?

The problem can be seen in this example: https://raw.githubusercontent.com/oplatek/lxmls-toolkit/lecture_notes/lecture_notes/7-16-01morning-session.md

oplatek avatar Jul 16 '15 13:07 oplatek

I would also really love to be able to integrate MathJax.

xanderdunn avatar Aug 03 '15 21:08 xanderdunn

What's the problem here? Would you like livedown to support an option for rendering math expressions out of the box?

Something like

livedown start --math example.md

shime avatar Oct 10 '15 13:10 shime

@shime Sure, something like that would be great. It seems MathJax rendering doesn't work at all right now. Adding the usual MathJax JavaScript boilerplate like @oplatek mentioned doesn't do the trick in live down. Thanks!

xanderdunn avatar Oct 11 '15 02:10 xanderdunn

For me it does™.

What browser are you using? Could you inspect the output in the console, maybe there's some errors being reported there...

Any additional info would help. Thanks!

shime avatar Oct 11 '15 11:10 shime

@shime I created minimal "broken" example where MathJax is not rerendered.

The source code is here: https://gist.github.com/oplatek/94c87c24e039686bf2af

The only time when it is rendered correctly is when you open the webpage with e.g. when you type :LivedownPreview in Vim.

After that the image is correctly rendered only: https://www.dropbox.com/s/21smieh0dcxoxwh/Screenshot%202015-10-11%2007.50.26.png?dl=0 However if I type anything else in the document, the equation is not rerendered. https://www.dropbox.com/s/5as794nmiwtsx9q/Screenshot%202015-10-11%2007.51.43.png?dl=0

oplatek avatar Oct 11 '15 14:10 oplatek

Similar question, does this work with mermaid flowchart diagrams?

paynito avatar Sep 29 '16 11:09 paynito

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.

hcgatewood avatar Mar 05 '19 23:03 hcgatewood