![]() | Text Encoding Initiative |
PassiveTeX |
Home Notes on conformance to the XSL specification |
Summary
How does it work?PassiveTeX relies heavily on work by David Carlisle (his namespace-aware XML parser written in TeX, xmltex), and was developed from my JadeTeX macros for processing DSSSL via Jade. Taking the XML version of the TEI Lite guidelines (teiu5.xml, with DTD teixlite.dtd), we apply an XSL stylesheet (see my page of TEI style sheets), and run it through Mike Kay's Saxon XSL processor: java com.icl.saxon.StyleSheet -o teiu5.fo teiu5.xml tei.xsl(assuming you have saxon.jar and sax.jar on your CLASSPATH). This creates the new XML file teiu5.fo. We now run XMLTeX on this pdfxmltex teiu5.fowhich creates teiu5.pdf. Voila! Actually, we need to do pdfxmltex teiu5.foagain, to resolve page-number references in the table of contents. For a comparison with an HTML rendering of the same document (using XSL again), see teiu5.html on the TEI pages. InstallationThe PassiveTeX macros should be downloaded (as a ZIP file, passivetex.zip), unpacked, and installed in a TeX system (eg in texmf/tex/latex/passivetex) in the normal place where you put macros. Consult your local documentation or local expert if you do not know how to install a new package; on a web2c-based system, don't forget to run mktexlsr when you have the files in place, to update the file lookup table. What about that pdfxmltex command we saw in the last section? You don't have it on your system? You need to download xmltex from CTAN and install it in the your TeX system. It too is just a set of TeX macro packages. IMPORTANT NOTE. You need a copy of xmltex.tex latex than 2001/11/30. Now you can use xmltex on a file called (eg) teiu5.fo in one of two ways:
Do not worry, xmltex knows how to find the PassiveTeX macros as it needs them. You will likely need to increase TeX memory values (in the file texmf.cnf if you use a Web2c-based TeX); I use: main_memory = 2500000 param_size = 1500 stack_size = 1500 hash_extra = 50000 string_vacancies = 45000 pool_free = 47500 nest_size = 500 save_size = 10000 pool_size = 500000 max_strings = 55000 For reference, the PassiveTeX package consists of the following files:
NOTE: TeX has a limit on the length of line it can read, and some .fo files you generate may cause TeX to die with an message about increasing buf_size. If you get that, edit your texmf.cnf file, increase the size of buf_size (mine is 200000), and remake any format files. LaTeX package dependenciesThis setup assumes you have a decent modern TeX setup. The TeX Live 6 CD-ROM is what I use, and it is up to date (see http://www.tug.org/texlive/). Here is a list of the packages loaded in a typical run of PassiveTeX, with their version numbers where known:
LICENSECopyright 2003 Sebastian Rahtz/Oxford University (sebastian.rahtz@oucs.ox.ac.uk) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and any associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. ExtensionsPassiveTeX interprets MathML natively (elements must use the MathML namespace). I also support a bookmark element in the fotex namespace, used to make PDF bookmarks. Usage is like this: <xsl:template match="div2"> <xsl:apply-templates select="head"/> <fotex:bookmark xmlns:fotex="http://www.tug.org/fotex" fotex-bookmark-level="2" fotex-bookmark-label="{@id}"> <xsl:value-of select="head"/> </fotex:bookmark> </fo:block> </xsl:template> Notes on conformance to the XSL specificationThe following general limitations apply to most of the PassiveTeX implementation of XSL FO:
Most of the formatting objects are implemented more or less; the following are not implemented at all:
Properties needed for basic conformance
Properties needed for full conformance
Properties needed for extended conformance
Sample files
Concerns and problemsSome points to bear in mind
Things for LaTeX users to remember
Future directions
I will be very glad to discuss details with anyone. Contact me (Sebastian Rahtz) as sebastian.rahtz@oucs.ox.ac.uk |