I was wondering if there are ways to convert MathJax
output to MathML
.
I read through several articles that saying MathJax
supports MathML
. I can also see the option 'Show MathML
' when I right click the MathJax
formulas. My question is, can I get the MathML
output to the webpage from MathJax
? I am not familiar with MathJax
and I am not sure how it works. Any resources or tutorial pages would have been nice!
I have written some code check it out: First include "https://code.jquery.com/jquery-1.11.2.min.js" and "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
};
Usage :
The MathJax documentation on configuring MathJax is probably the place to start reading. You can configure the output jax per browser.
A word of caution. There's a reason why MathJax does not use to MathML output on any browser right now: browser support isn't quite there yet. (This will change as browsers catch up and MathJax can start to leverage their native support.) So make sure your content actually renders ok.
@Peter, I think the OP may be asking how to get a MathML string from MathJax, rather than how to insert the MathML tags into the page directly. So perhaps the discussion on the MathJax forums that describes how to use toMathML will do the trick.
The basic idea is to get the element jax (using
MathJax.Hub.getAllJax
) for the math you want to convert, then to call itstoMathML
method. But you need to use some care for this, astoMathML
can operate asynchronously. The link above goes through the details.EDIT: The MathJax-node project allows you to do this from the command line, so you might want to check that out as well.