Next / Previous / Contents / Shipman's homepage

3. Operation of the listext2 script

Output will be for U.S. letter paper, 8.5″×11″. Here are the command line options available for listext2, where each FILE is one input file to be listed.

listext2 [option ...] FILE

Options include:

-p SIZE Font size in points, as a float; default 9.
-l LEADING Inter-line spacing in points, as a float; default is one greater than the effective SIZE.
-t TABSIZE Number of columns per tab stop; default 4.
-c COLUMNS For multi-column display, this is the number of columns; default is 2 for --landscape, 1 for --portrait.
-o OUTFILE Output XSL-FO file. Default is in the current directory.
-b BREAK Specifies a break string. Text between two lines that start with this string are kept together within the column if possible. The default break string is an ASCII FF (form feed) character.
-L Specifies landscape orientation; default.
-P Specifies portrait orientation; default is landscape.
-1 Format for single-sided printing.
-2 Format for double-sided printing; this is the default.
FILE Path name of the input file.

3.1. Output examples

Here are some examples of PDF files generated by this script.

  • selflist.pdf is a presentation of the listext2 script in landscape mode, two columns, and illustrating the --break option. The author uses comment lines starting with “# - -” to demarcate major sections of his Python code, and this listing shows how the --break option keeps these sections together when possible.

    Options here:

    listext2  -b'# - -' listext -o
  • tinyself.pdf is also the listext2 script, but in an extreme paper-saving format: 5-point type in three columns.

  • all-ascii.pdf demonstrates the display of unprintable characters. The input file all-ascii contains every one of the possible 256 ASCII characters in ascending order by code. Options here:

    listext2 -p 12 -l 14 -P -c 1 all-ascii -o
  • xml-sample.pdf demonstrates the treatment of long lines. Options:

    listext2 -P -c 1 -p 9 -l 10 -o xml-sample.xml