LaTeXML's primary output format is an XML representation of TeX's document model. A postprocessor can convert these XML documents into other structured formats. Common uses cases create HTML with mathematical formulas as images or XHTML, HTML5, and EPUB with formulas as MathML. Compared to other LaTeX-to-XML processors, LaTeXML aims to conserve the semantic structures of the LaTeX markup. This makes it a good basis for semantic services like . Conversion times range from 30 milliseconds for a single formula to minutes for book-size documents.
History
LaTeXML was started in the context of the Digital Library of Mathematical Functions at NIST, where LaTeX documents needed to be prepared for publication on the Web. The system has been under active development for over a decade, and has attracted a small, but dedicated community of developers and users centered on Bruce Miller, the original project author. The current released version is LaTeXML 0.8.4. It was released in June 2019, and development remains active on the .
LaTeXML was used to convert 90% of 530,000 documents from the arXiv to XML. As a result of this ongoing effort for enhancing coverage, LaTeXML supports a large range of LaTeX packages. The ACL 2014 conference used LaTeXML to convert submitted papers to XML. This followed existing work which has been trying to convert the ACL Anthology papers to high-quality semantic markup for further analysis. Since February, 2013, LaTeXML has been used as to render the web pages on the peer produced mathematics website, PlanetMath. Since July, 2015, it was adopted by Authorea for their advanced LaTeX support. In 2018, the second data release of the European Space Agency's Gaia project was realized via LaTeXML.
Implementation
The core of LaTeXML is a Perl reimplementation of TeX's parsing and digestion algorithm coupled with a customizable XML emitter. To conserve the semantic structures in the LaTeX markup, LaTeXML needs XML bindings for all LaTeX packages with high-level macro definitions. The LaTeXML distribution currently provides XML bindings for over 200 commonly used LaTeX packages such as AMSTeX, Babel and PGF/TikZ. The LaTeXML conversion consists of two stages:
the first one parses LaTeX and converts that into a LaTeX-near XML document type, and
the second transforms the XML into one of the standardized structured output formats.