I have MathML that I need to render in my LaTeX document. Is there a recommended way of doing so?

So far, from googling, I've found MathParser - a Java converter. But I was hoping there might be a better way to do it.

  • How elaborate are the MathML fragments that you need to render? It might be possible to write a simple converter if they only use a limited subset of MathML. – Bruno Le Floch Jan 24 '12 at 23:28
  • @BrunoLeFloch Are MathML and LaTeX similar enough to easily write a simple converter for? It may be complex fragments (data from a client) but it might still be manageable to write one. – mifrai Jan 25 '12 at 0:27
  • Is it content math or presentation mathml – Aditya Aug 26 '13 at 14:09

You can get TeX to parse the MathML, see for example xmltex, https://www.ctan.org/pkg/xmltex which comes with some mathml setup, however I wouldn't do it that way these days, I'd convert the MathML using XSLT, see for example pmml2tex which is available on github

| improve this answer | |
  • googlecode is down, but pmml2tex is available on github: github.com/davidcarlisle/web-xslt/tree/master/pmml2tex – ShreevatsaR Nov 9 '17 at 2:19
  • @ShreevatsaR I should probably search for all old googlecode links and update the answers, thanks. – David Carlisle Nov 9 '17 at 7:44
  • You should try ConTeXt ;) – Henri Menke Nov 9 '17 at 9:02
  • 1
    @HenriMenke I'd expect my xslt gets a closer approximation to my understanding of MathML than any other convertor:-) – David Carlisle Nov 9 '17 at 9:04
  • @DavidCarlisle I've successfully used your stylesheet (and some other tools available online) - and agree with the comment. – nam Sep 3 '19 at 22:02

I had the most success with xsltml: http://xsltml.sourceforge.net

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.