Mathconverter
Converts from AsciiMath, LaTeX, MathML to LaTeX, MathML
Install / Use
/learn @oerpub/MathconverterREADME
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).
(Optional):
virtualenv env
. env/bin/activate
Install:
pip install -r requirements.txt
Usage:
./converter.py --help
Example
$ ./converter.py --equation "x^2" --iformat asciimath --oformat mathml
<math xmlns="http://www.w3.org/1998/Math/MathML" alttext="x squared">
<mstyle displaystyle="true">
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
</mstyle>
</math>
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:
$ ./converter.py --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 https://api.mathmlcloud.org/equation 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_yaroshby Vasil Yaroshevich. Contains XSLT 1 transformation from MathML to LaTeXxsl_transpectby transpect.io. Contains XSLT 2 transformations from MathML to LaTeX (not used currently)
Related Skills
node-connect
338.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.4kCommit, push, and open a PR
