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.
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.
An example demonstrates basic constructions of TeXML:
<TeXML> <cmd name="documentclass"> <opt>a4paper</opt> <parm>minimal</parm> </cmd> <env name="document"> Eto — primer. </env> </TeXML>
A result of serialization:
\begin{verbatim}
\documentclass[a4paper]{minimal}
\begin{document}
Eto~\textemdash{} primer.
\end{document}
The main tasks of the serializer:
In addition to these essential transformations, TeXML provides also extended functionality.
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.
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.