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.
--points=SIZE
-l LEADING Inter-line spacing in points, as a float; default is one greater than the effective SIZE.
--leading=LEADING
-t TABSIZE Number of columns per tab stop; default 4.
--tabs=TABSIZE
-c COLUMNS For multi-column display, this is the number of columns; default is 2 for --landscape, 1 for --portrait.
--cols=COLUMNS
-o OUTFILE Output XSL-FO file. Default is klarn.fo in the current directory.
--out=OUTFILE
-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.
--break=BREAK
-L Specifies landscape orientation; default.
--landscape
-P Specifies portrait orientation; default is landscape.
--portrait
-1 Format for single-sided printing.
--simplex
-2 Format for double-sided printing; this is the default.
--duplex
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 selflist.fo
    
  • 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 all-ascii.fo
    
  • xml-sample.pdf demonstrates the treatment of long lines. Options:

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