Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recall or restart MathJax?

I need MathJax to recheck again all my page.

I mean when the page is created it does all great. But I need to call it after window.onload to reparse the page, as its contents have changed in the meantime.

How would I do such a thing?

like image 826
Rella Avatar asked Mar 04 '11 23:03

Rella


People also ask

How can I download MathJax?

Release versions of MathJax are available in archive files from the MathJax GitHub page. The current version is available via the “clone or download” button, or you can use the “releases” tab to download an archive for an older version. Consult the change log for what's new in version 2.7. To install MathJax v1.

Is MathJax open source?

MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all modern browsers.


1 Answers

See http://docs.mathjax.org/en/latest/advanced/typeset.html:

If you are writing a dynamic web page where content containing mathematics may appear after MathJax has already typeset the rest of the page, then you will need to tell MathJax to look for mathematics in the page again when that new content is produced. To do that, you need to use the MathJax.Hub.Typeset() method. This will cause the preprocessors (if any were loaded) to run over the page again, and then MathJax will look for unprocessed mathematics on the page and typeset it, leaving unchanged any math that has already been typeset.

You should not simply call this method directly, however. [You should instead] queue the typeset action, [using this] command:

MathJax.Hub.Queue(["Typeset",MathJax.Hub]);

Demo here: http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic.html

like image 189
thirtydot Avatar answered Sep 23 '22 10:09

thirtydot