4 Using ProgDoc in two-column mode

Starting with version 1.3, ProgDoc can be used in the LATEX two-column or multicolumn mode. However some restrictions apply in these modes which will be discussed here. We will switch now to two-column mode by using the multicols environment with the command \begin{ multicols}{ 2}:

Notice: The following part of this section is typeset in two-column mode in the original form of this document. Refer to the PDF or Postscript formats of this document in order to see the original version.

First of all, there is no two-column support when using the deprecated useLongtable option, because the longtable environment doesn't work in the two-column mode.

Otherwise, the two-column mode set with the twocolumn option of the documentclass command or inside the document with the \twocolumn command is supported as well as the two- or multicolumn mode of the multicols environment (see [multicol]), however with some minor differences.

Notice: The following listing was highlighted using pdlsthighlight as highlighter, which is not supported by LaTeX2HTML. That's why the HTML version of the listing will be printed in plain text. Refer to the PDF or Postscript formats of this document in order to see the original version.

Listing 2: A short Python example
#
# QuickSort and Greatest Common Divisor
# Author: Michael Neumann
#
<see Listing 3>
<see Listing 4>
print "Hello World" 
print quicksort([5,99,2,45,12,234,29,0])

Because of incompatibilities between the multicols environment and the afterpage package, the caption ``Listing x: ... (continued)'' on subsequent columns or pages is not supported for listings inside the multicols environment (as can be seen in Listing 2 to 4 which are printed inside a multicols environment). If in twocolumn mode, columns are treated like pages for the caption mechanism of ProgDoc (see section C for an example printed in twocolumn mode). Therefore the ``Listing x: ... (continued)'' captions are repeated on the top of each new column the listings spans on, just as if it was a new page.

Volker Simonis 2003-03-05