PassiveTeX

Michel Goossens and Sebastian Rahtz were apparently not deterred by the challenges posed by xmltex. They’ve developed a library of TeX macros based on xmltex called PassiveTeX[11] that process XML documents that comply with the Formatting Objects (FO) schema[12].

Formatting Objects provides an XML vocabulary for formatting XML documents[13]. Unlike HTML, it has only presentational markup and compared to CSS, it contains also the complete content such as text, tables and images. The FO document is typically generated by XSLT and then passed to a FO formatter. The formatter renders the output format, most commonly this is a PDF. In the case of PassiveTeX, the FO formatter is TeX.

Figure 2. Passive TeX transformation

Passive TeX transformation

Here is an excerpt of the fotex.xmt from PassiveTeX. In this code snippet, a basic TeX document structure is associated with the root element of FO. A similarly named package fotex.sty is referenced which adds macros and configuration options to render the FO document.

\XMLelement{fo:root}
  {}
  {\documentclass{article}
   \usepackage{fotex}
   \begin{document}
   \pagestyle{empty}
   \FOSetHyphenation
   %\ignorewhitespace
   }
  {\end{document}}

Just as an aside, FO and TeX overlap in terms of functionality. With PassiveTeX, you could decide whether you want to use FO’s <fo:page‐number‐citation> to create a table of contents or LaTeX’s built‐in \tableofcontents macro. This applies to other elements such as counters, labels and other listings, too.

Compared to a pure xmltex approach, PassiveTeX has some benefits: You don’t have to care about configuring xmltex, you only need to create FO from your XML input e.g., with a programming language with proper XPath support. If you already have an FO‑based workflow, you can consider TeX as alternative to your existing FO formatter. A TeX‐based FO formatter should have clear advantages when it comes to mathematical equations.

PassiveTeX is an experimental approach and has never seen wide acceptance, neither in the XML nor in the TeX communities. We can speculate about the reasons for its marginal adoption, but it seems likely that PassiveTeX just inherited the problems of its xmltex and FO foundations. Some general disadvantages of xmltex are mentioned above. In the context of PassiveTeX, Goossens and Rahtz criticized that the biggest problem with using xmltex for PassiveTeX is that it is complicated to extend the package[14]. Like xmltex, FO remained a technology for a specific niche, considered complex to master and only adopted by users already acquainted with XML. In addition, many developers are reluctant to use technologies that are not part of their usual stack. In this sense, it may not very appealing to XML developers to use TeX as an FO formatter, while TeX developers might prefer xmltex over converting XML to FO.



[11] Michel Goossens and Sebastian Rahtz (2000): PassiveTEX. Available at https://ctan.org/pkg/passivetex (Accessed: May 30, 2023)

[12] W3C (2006) Extensible Stylesheet Language (XSL) Version 1.1. Formatting Objects. Available at https://www.w3.org/TR/xsl/#fo-section (Accessed: May 30, 2023)

[13] I’m not going to explain the vocabulary of Formatting Objects in any detail. For an introduction, please refer to: J. David Eisenberg (2001) Using XSL Formatting Objects. Available at https://www.xml.com/pub/a/2001/01/17/xsl-fo/index.html (Accessed May 30, 2023)

[14] Michel Goossens and Sebastian Rahtz (2000): PassiveTEX: From XML to PDF in TUGboat, Volume 21 (2000), No. 3—Proceedings of the 2000 Annual Meeting, p.224. Available at http://tug.org/TUGboat/tb21-3/tb68goos.pdf (Accessed: May 30, 2023)