guillefix
guillefix

Reputation: 379

LaTex math to ASCIImath conversion

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?

Upvotes: 6

Views: 3871

Answers (1)

Mottie
Mottie

Reputation: 86413

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.

Upvotes: 1

Related Questions