Skip to content
Converts from AsciiMath, LaTeX, MathML to LaTeX, MathML
XSLT Python
Branch: master
Clone or download
Latest commit 2bddc39 Jun 20, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
xsl_transpect commit new xsl files Nov 18, 2016
xsl_yarosh add xsl files from Vasil Yaroshevich Nov 18, 2016
.gitignore first commit Nov 18, 2016
LICENSE add MIT license Nov 21, 2016 fix typo in readme Jun 20, 2017 make runnable Nov 18, 2016
requirements.txt asciimath, latex, mathml works now Nov 18, 2016

Converter for AsciiMath, LaTeX & MathML equations

Converts from AsciiMath, LaTeX, MathML to LaTeX, MathML

utilizes MathMLCloud (for MathML output) and XSL transforms (for LaTeX output).


virtualenv env
. env/bin/activate


pip install -r requirements.txt


./ --help


$ ./ --equation "x^2" --iformat asciimath --oformat mathml

<math xmlns="" alttext="x squared">
  <mstyle displaystyle="true">

Known issues

Don't use bash shell confusing/specific signs like e.g. $$ or " in the commandline or escape them properly. If you're unsure how to do that, run the command without --equation like this:

$ ./ --iformat asciimath --oformat mathml

it will prompt you for the equation that way.

Background information

For generating MathML it is using the public reachable MathMLCloud on which is utilizing a Node.js server version of Mathjax for generating output.

LaTeX is generated by XSLTs from MathML input.

A special case is the AsciiMath to LaTeX conversion. On the first step it generates MathML from MathMLCloud and then uses the XSLTs to generate LaTeX out of it.

MathML to LaTeX XSLTs available in this repo:

  • xsl_yarosh by Vasil Yaroshevich. Contains XSLT 1 transformation from MathML to LaTeX
  • xsl_transpect by Contains XSLT 2 transformations from MathML to LaTeX (not used currently)
You can’t perform that action at this time.