[Tex/LaTex] converting Mathml to LaTeX in python programming

mathmlpython

I am writing one educational software right now. It's kind of online test for school students. I add up the questions using my editor, I need the math functionality therefore I need to use this editor, other editors are very simple and not that smart and powerful like this editor.

But , The editor gives me output into Mathml, now this Mathml also includes style tags along with the main text. Therefore I do not find it feasible to store into the databases. Therefore I am trying to convert the Mathml to LaTeX.

As I am developing the project in Python Django, So I need a Python Library that can do the conversion for me. I have searched many libraries but they just convert the text to Mathml or convert the text to LaTeX. If anyone know about this please let me know.

If anyone has a different solution to convert the Mathml to LaTeX. Please help me out.

Best Answer

The xslt at https://github.com/davidcarlisle/web-xslt/tree/master/pmml2tex makes a reasonable job of making tex from mathml for print It is used to generate many of the sample images in the MathML spec, and the PDF version of the spec, which is generated via latex.

However it isn't really designed to generate archival or editable latex so the tex markup it generates is a mess.

Still it might give you are start, although to be honest the reasons for needing latex rather than mathml were not that clear.