[GetFO Home Page] [TeXML Home Page] [Downloads]

TeXML: an XML vocabulary for TeX

Thesis of the talk at the First International conference of the open-source developers, Obninsk, Russia, 2004. Author: Oleg Paraschenko, Saint Petersburg.

Abstract. The paper describes one of the methods of publishing XML documents through LaTeX. We propose to use TeXML, an intermediate presentation of the TeX notation in an XML format.

The need for TeXML

TeXML[1] is an intermediate presentation of the TeX notation in an XML format. TeXML simplifies creation of printable versions of documents when following conditions are true:

There are several projects([2], [3], [4], [5]) that transform XML to LaTeX using XSLT. All these projects stuck into the problem that XSLT is very inefficient when result of an XSLT transformation is not XML.

This problem can be solved using an intermediate step. At first, XSLT efficiently transforms XML into the TeXML, and then a TeXML processor serializes TeXML into the TeX format.

Brief overview of TeXML

An example demonstrates basic constructions of TeXML:

 <cmd name="documentclass">
 <env name="document">
  Eto&nbsp;&mdash; primer.

A result of serialization:

Eto~\textemdash{} primer.

The main tasks of the serializer:

In addition to these essential transformations, TeXML provides also extended functionality.

TeXML benefits

A simple TeXML code

<group><cmd name="it" gr="0"/>\example</group>

corresponds to a TeX fragment

{\it \textbackslash{}example}

There are several projects that create LaTeX from XML using XSLT, for example: tbook[2], xsltml[3] , dblatex[4] , db2latex[5] . History of these projects demonstrates following problems when generating the TeX fragment:

These and some other problems do not appear when using TeXML.

Other versions of TeXML

During search for a solution for XML publishing through LaTeX I found that Douglas Lovell introduced[6] TeXML approach in the year 1999, and there was even an implementation in Java. This project, TeXMLatté[7], was abandoned a lot of years ago, but its specification survived. Our TeXML is heavely based on this specification.

There is also TeXMLapis[8], a Perl-processor of a subset of TeXML, but its functionality is limited.


  1. TeXML: an XML vocabulary for TeX http://getfo.org/texml/
  2. The tbook system for XML Authoring http://tbookdtd.sourceforge.net/
  3. XSLT MathML Library http://xsltml.sourceforge.net/
  4. DocBook to LaTeX/ConTeXt Publishing http://dblatex.sourceforge.net/
  5. DB2LaTeX XSL Stylesheets http://db2latex.sourceforge.net/
  6. Douglas Lovell, TeXML: Typesetting XML with TeX http://www.tug.org/TUG99-web/pdf/lovell.pdf
  7. TeXMLatté http://www.alphaworks.ibm.com/tech/texml
  8. TeXMLapis http://www.bluweb.com/us/chouser/proj/texmlapis/

Hosted by
SourceForge.net Logo
Developers' link: [TeXML SourceForge project area]