Next / Previous / Contents / Shipman's homepage

5. Design notes for listext2

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.

The .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 from RenderX. 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.

For notes on the visual design of the report, see Section 5.1, “Visual design of the report”.

For a discussion of the XSL-FO constructs necessary to implement the visual design, see Section 5.2, “XSL-FO design: General page layout” and Section 5.3, “XSL-FO design: Line formatting”.

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.