Previous: , Up: Your Delegations   [Contents][Index]


4.10.3 Predefined Delegations

The purpose of this section is not to document all the predefined delegations, for this you should read the comments in the system configuration file a2ps.cfg. We just want to explain some choices, and give hints on how to make the best use of these delegations.

Delegation: dvips (DVI to PostScript)

There is a problem when you use a naive implementation of this delegation: landscape jobs are not recognized, and therefore n-upping generally fails miserably. Therefore, a2ps tries to guess if the file is landscape by looking for the keyword ‘landscape’ in it, using strings(1):

Delegation: dvips dvi:ps\
 if strings $f | sed 3q | grep -F landscape > /dev/null 2>&1; then \
   #{d.dvips} -T#hpt,#wpt $f -o #f0 && #?o|cat|#{d.psnup} -r| #f0;\
 else \
   #{d.dvips} $f -o #f0 && #{d.psnup} #f0; \
 fi

In order to have that rule work correctly, it is expected from the TeX, or LaTeX file to include something like:

\renewcommand{\printlandscape}{\special{landscape}}
\printlandscape

in the preamble.

We don’t use a pipe because dvips always outputs data (its prologue) even if it fails, what prevents error detection.

Delegation: LaTeX (LaTeX to DVI)

We use a modern version of the shell script texi2dvi, from the package Texinfo, which runs makeindex, bibtex and latex as many times as needed. You should be aware that if the file includes files from other directories, it may miss some compilation steps. Other cases (most typical) are well handled.