Thesis of the talk at the First International Conference of Open-Source Developers, Obninsk, Russia, 2004. Author: Oleg Parashchenko, 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 TeX notation in an XML format.
TeXML[1] is an intermediate presentation of TeX notation in an XML format. TeXML simplifies creation of printable versions of documents when the following conditions are true:
There are several projects([2], [3], [4], [5]) that transform XML to LaTeX using XSLT. All of these projects have the same problem: XSLT is very inefficient when the result of an XSLT transformation is not XML.
This problem can be solved using an intermediate step. First, XSLT efficiently transforms XML into TeXML, and then a TeXML processor turns TeXML into the TeX format.
An example to demonstrate the basic syntax of TeXML:
<TeXML>
<cmd name="documentclass">
<opt>a4paper</opt>
<parm>minimal</parm>
</cmd>
<env name="document">
Eto — primer.
</env>
</TeXML>
The results after processing:
\documentclass[a4paper]{minimal}
\begin{document}
Eto~\textemdash{} primer.
\end{document}
The main tasks of the processor:
In addition to these essential transformations, TeXML also provides 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]. Usage of these projects demonstrates the following problems when generating the TeX fragment:
These and some other problems do not appear when using TeXML.
During my search for a solution for XML publishing through LaTeX, I found that Douglas Lovell introduced[6] the TeXML approach in the year 1999, and there was even an implementation in Java. This project, TeXMLatté[7], was abandoned some time 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.