SVGMath formats MathML 2.0 expressions as SVG 1.1 images.
SVGMath is written in pure Python, with neither extension modules nor external dependencies. It runs on any platform where a modern Python environment (version 2.4 or higher) is available. It can be used either as a command-line script for batch-mode file conversion, or as a component to process MathML data in other Python applications.
SVGMath is an open-source project, released under MIT license.
The latest version of SVGMath is available from the SourceForge project page.
Here is a couple of complexity tests from W3C MathML Test Suite, rendered by SVGMath.
Please note that SVG image may not display correctly on all systems: it relies
on availability of the same fonts that were used to create it. As a reference,
I include the PDF rendering of the SVG with all fonts embedded, generated by
RenderX XEP.
| Test | MathML Source | SVG by SVGMath | |
|---|---|---|---|
| complex1 | complex1.mml | complex1.svg | complex1.pdf |
| complex2 | complex2.mml | complex2.svg | complex2.pdf |
Please send your comments, bug reports, and enhancement requests
to the author, Nikolai Grigoriev <svgmath AT grigoriev.ru>.
As of version 0.3, SVGMath covers most of the Presentation MathML. The following constructions are supported:
mi, mn, mo, mtext, ms, mspace
math, mrow, mstyle, mfrac, msqrt, mroot,
mfenced, mphantom, mpadded, merror, menclose
msub, msup, msubsup,
munder, mover, munderover, mmultiscripts
mtable, mtr, mtd
The following elements and features are not supported:
mglyph element - ignored;symmetric attribute on mo element - ignored;mlabeledtr element - treated as mtr, first child ignored;malignmark and maligngroup elements, groupalign attribute;maction: fallback implemented as described in the spec.