LaTex math to ASCIImath conversion

3.5k Views Asked by At

I have a javascript web application, and want to convert between strings of LaTeX math and strings of ASCIImath. It seems that MathJax could be able to do that, but I'm not to sure, what would be the best way.

Would it be easier to write a transpiler of my own (I don't know much about parsing, etc..)? Does anyone know if a library exists for this?

1

There are 1 best solutions below

3
On

It appears that Mathjax supports the processing of ASCII math, and includes a few preprocessing options.

Although you shouldn't need to convert between the two file types, if you look at the ASCIIMath GitHub repo, you'll see that they have two files:

  • ASCIIMathML.js - JavaScript functions to convert ASCII math notation and (some) LaTeX to Presentation MathML.
  • LaTeXMathML.js - JavaScript functions to convert (most simple) LaTeX math notation to Presentation MathML.