6

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.

3
  • 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. Jan 24, 2012 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, 2012 at 0:27
  • Is it content math or presentation mathml
    – Aditya
    Aug 26, 2013 at 14:09

2 Answers 2

10

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

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

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

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.