Girish Mahajan (Editor)

LaTeXML

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

LaTeXML converts LaTeX documents to XML, HTML and EPUB.

Contents

Workflow

LaTeXML's primary output format is an XML representation of (La)TeX's document model. A postprocessor can convert these XML documents into other formats such as 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 Math search.

Conversion times range from 30 milliseconds for a single formula (in the LaTeXML daemon) 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 main LaTeXML developer.

The current released version is LaTeXML 0.8.2. It was released in July 2016, but development has been active on the public repository since then.

LaTeXML was used to convert 90% (60% without errors) of 530,000 documents from the arXiv to XML. As a result of this effort, 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.

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 the LaTeX packages. The LaTeXML distribution currently provides XML bindings for over 200 commonly used LaTeX packages such as AMSTeX, Babel or PGF/TikZ (which only has experimental support). Additional (incomplete but useful) bindings have been supplied by the community.

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 (post-processing) creates from that one of the output formats XHTML, HTML5, HTML with images, EPUB.
  • LaTeXML 0.8 added daemon functionality which enabled multiple conversions and easy embedding into web services.

    References

    LaTeXML Wikipedia