To get around the limited font selection offered by TeX, for the toolbase the author selected XSL-FO, the Extensible Stylesheet Language, Formatting Objects. This is a W3 standard; refer to the specification. Here is an excellent resource for approaching this huge standard:
Pawson, Dave. XSL-FO: Making XML look good in print. O'Reilly, 2002, ISBN 0-596-00355-2.
.fo file generated by this
program must be converted to PDF format in a separate step.
Here at the New Mexico Tech Computer Center we use XEP
This is not a free application, but we get it free as an
educational institution, in return for which they render a
small yellow tab, crediting RenderX, at the top left
corner of the first page of each generated document.
There is a free open-source alternative, fop from the Apache Software Foundation. It works for the files we generate, but the fonts are intensely ugly. In particular, the author considers Courier, the monospace font used by fop, to be one of the ugliest fonts ever created.
To generate the actual XSL-FO file, we use a combination of two levels of Python XML tools.
The overall layout of the file is managed by the module
fohelpers.py: XSL-FO helper
functions for Python.
fohelpers module is built on top of
etbuilder module described in Python XML processing with
Generation of any XSL-FO constructs beyond those from
fohelpers is done by direct calls to
For notes on the visual design of the report, see Section 5.1, “Visual design of the report”.
Because the author is a heavy user of the Python programming language, in which indentation is a significant part of the syntax, it is vital that the generated output clearly show the amount of indentation on each line. Consequently, a thin vertical rule will appear at the left side of each column, to serve as a visual reference point for indentation.
A conflicting requirement is that lines too long for the column will wrap (as opposed to being cropped). We use the term overflow lines to refer to the second and successive lines that display the parts of the input line that would not fit on the first output line.
Again because indentation is important, we want the overflow lines to look different. In particular, overflow lines must be indented a significant amount so that it is easier for the reader to perceive the indentation structure of the non-overflow lines.
Indentation of overflow lines is not sufficient: the reader must be able to tell that they are overflow lines and not just ordinary lines that happen to be indented. The solution is to display a light gray color for the indentation of overflow lines.