Go to the first, previous, next, last section, table of contents.

3 Invoking a2ps

Calling a2ps is fairly simple:

a2ps Options... Files...

If no Files... are given, a2ps prints its standard input. If `-' appears in the Files..., it designates the standard input too.

3.1 Command line options

To read the options and arguments that you give, a2ps uses GNU getopt, hence:

Here after a boolean is considered as true (i.e. setting the option on), if boolean is `yes', or `1'; as false if it equals `no' or `0'; and raise an error otherwise. The corresponding short option takes no arguments, but corresponds to a positive answer.

When an argument is presented between square brackets, it means that it is optional. Optional arguments to short option must never be separated from the option.

3.1.1 Tasks Options

Task options specify the task a2ps will perform. It will not print, it executes the task and exits successfully.

Option: -V
Option: --version
print version and exit successfully.

Option: -h
Option: --help
Print a short help, and exit successfully.

Option: --copyright
Display Copyright and copying conditions, and exit successfully.

Option: --guess
Act like file does: display the (key of the) type of the Files.

For instance, on a C file, you expect it to answer `c', and upon a PostScript file, `ps'.

This can be very useful on broken systems to understand why a file is printed with a bad style sheet (see section 5.4 Style Sheet Files).

Option: --list=topic
Display a report on a2ps' status with respect to topic, and exit successfully. topic can be any non-ambiguous abbreviation of:
`defaults'
`options'
Give an extensive report on a2ps configuration and installation.
`features'
Known media, encodings, languages, prologues, printers, variables, delegations and user options are reported. In a word, anything that you may define.
`delegations'
Detailed list of the delegations. See section 4.10 Your Delegations.
`encodings'
Detailed list of known encodings. See section 6.2.3 Some Encodings.
`variables'
Detailed list of the variables. See section 4.9 Your Variables.
`media'
Detailed list of known media. See section 4.4 Your Media.
`prologues'
Detailed list of PostScript prologues. See section 8.6 Designing PostScript Prologues.
`printers'
Detailed list of printers and named outputs. See section 4.5 Your Printers.
`style-sheets'
Detailed list of the known style sheets. See section 7.2 Known Style Sheets.
`user-options'
Detailed list of the user options. See section 4.6 Your Shortcuts.

There are also options meant for the maintainers only, presented for sake of completeness.

`texinfo-style-sheets'
`ssh-texi'
Detailed list of known style sheets in Texinfo format. If the sheet verbosity is set, report version numbers, requirements and ancestors.
`html-style-sheets'
`ssh-html'
Detailed list of the style sheets in HTML format.
`texinfo-encodings'
`edf-texi'
Detailed list of encodings, in Texinfo format.
`texinfo-prologues'
`pro-texi'
Detailed list of prologues, in Texinfo format.

3.1.2 Global Options

These options are related to the interface between you and a2ps.

Option: -q
Option: --quiet
Option: --silent
be really quiet

Option: -v[level]
Option: --verbose[=level]
tell what we are doing. At

There is also an interface made for the maintainer with finer grained selection of the verbosity level. level is a list of tokens (non ambiguous abbreviations are valid) separated by either `,' or `+'. The tokens may be:

`configuration'
`options'
reading the configurations files and the options,
`encodings'
the encodings,
`expert'
more detailed information is provided: PPD listings is exhaustive,
`files'
inputs and outputs,
`fonts'
the fonts,
`escapes'
`meta-sequences'
the expansion of escapes,
`parsers'
any parsing process (style sheets, PPD files etc.),
`pathwalk'
`pw'
the search for files,
`ppd'
PPD processing,
`sheets'
the style sheets,
`stats'
statistics on some internal data structures,
`tools'
launched programs or shell commands ; triggers the escape `?V' on (see section 3.2.3 Available Escapes),
`all'
all the messages.

When a2ps is launched it consults the environment variable A2PS_VERBOSITY. If it is set, this defines the verbosity level for the whole session (options `--verbose', and `-q' etc. have then no influence). The valid values for A2PS_VERBOSITY are exactly the valid arguments of the option `--verbose'. This helps tracking down configuration problems that occur before a2ps had even a chance to read the command line.

Option: -=shortcut
Option: --user-option=shortcut
use the shortcut defined by the user. See section 4.6 Your Shortcuts. Shortcuts may be freely mixed with regular options and arguments.

There are a few predefined user-options:

`lp'
emulates a line printer, i.e., turn off most `pretty' features.
`mail'
`longmail'
prefered options to print a mail or a news. `longmail' prints more text on a single sheet.
`manual'
make the job be printed on the manually fed tray.

Option: --debug
enable debugging features. They are:

Option: -D key[=value]
Option: --define=key[=value]
Without value, unset the variable key. Otherwise, set it to value. See section 4.9 Your Variables, for more details. Note that `-Dfoo=' gives foo an empty value, though `-Dfoo' unsets foo.

3.1.3 Sheet Options

This options specify the general layout, how the sheet should be used.

Option: -M medium
Option: --medium=medium
use output medium medium. See the output of `a2ps --list=media' for the list of supported media. Typical values are `A3', `A4', `A5', `B4', `B5', `Letter', `Legal'.

`A4dj', `Letterdj' are also defined for Desk Jet owners, since that printer needs bigger margins.

The special medium `libpaper' means that you want a2ps to ask the library libpaper for the medium to use. This choice is valid only if libpaper was available when a2ps was configured. See the man page of paperconf for more information.

Option: -r
Option: --landscape
print in landscape mode

Option: -R
Option: --portrait
print in portrait mode

Option: --columns=num
specify the number of columns of virtual pages per physical page.

Option: --rows=num
specify the number of rows of virtual pages per physical page.

Option: --major=direction
specify whether the virtual pages should be first filled in rows (direction = `rows') or in columns (direction = `columns').

Option: -1
1 x 1 portrait, 80 chars/line, major rows (i.e. alias for `--columns=1 --rows=1 --portrait --chars-per-line=80 --major=rows').

Option: -2
2 x 1 landscape, 80 chars/line, major rows.

Option: -3
3 x 1 landscape, 80 chars/line, major rows.

Option: -4
2 x 2 portrait, 80 chars/line, major rows.

Option: -5
5 x 1 landscape, 80 chars/line, major rows.

Option: -6
3 x 2 landscape, 80 chars/line, major rows.

Option: -7
7 x 1 landscape, 80 chars/line, major rows.

Option: -8
4 x 2 landscape, 80 chars/line, major rows.

Option: -9
3 x 3 portrait, 80 chars/line, major rows.

Option: -j
Option: --borders=boolean
print borders around virtual pages.

Option: -A mode
Option: --file-align=mode
Align separate files according to mode. This option allows the printing of more than one file on the same page. mode can be any one of:
`virtual'
Each file starts on the next available virtual page (i.e., leave no empty virtuals).
`rank'
Each file starts at the beginning of the next row or column depending on the `--major' setting.
`page'
Each file starts on a new page.
`sheet'
Each file starts on a new sheet. In Simplex mode, this is the same as `page', in Duplex mode, files always start on a front side.
an integer num
Each file starts on a page which is a multiple of num plus 1. For instance, for `2', the files must start on odd pages.

Option: --margin[=num]
Specify the size of the margin (num PostScript points, or 12 points without arguments) to leave in the inside (i.e. left for the front side page, and right for the back side). This is intended to ease the binding.

3.1.4 Page Options

This options are related to the content of the virtual pages.

Please note that the options `-f', `-L', `-l', `-m', and `-1' .. `-9' all have an influence on the font size. Only the last one will win (i.e., `a2ps -L66 -l80' is the same as `a2ps -l80').

Option: --line-numbers[=number]
print the line numbers from number lines to number lines. Default is `1'.

Option: -C
Alias for `--line-numbers=5'.

Option: -f size[unit]
Option: --font-size=size[unit]
scale font to size for body text. size is a float number, and unit can be `cm' for centimeters, `points' for PostScript points, and `in' for inches. Default unit in `points'.

To change the fonts used, change the current prologue (see section 8.6 Designing PostScript Prologues.

Option: -l num
Option: --chars-per-line=num
Set the font size so that num columns appear per virtual pages. num is the real number of columns devoted to the body of the text, i.e., no matter whether lines are numbered or not.

Option: -L num
Option: --lines-per-page=num
Set the font size so that num lines appear per virtual pages. This is useful for printing preformatted documents which have a fixed number of lines per page. The minimum number of lines per page is set at 40 and maximum is at 160. If a number less than 40 is supplied, scaling will be turned off.

Option: -m
Option: --catman
Understand UNIX manual output ie: 66 lines per page and possible bolding and underlining sequences. The understanding of bolding and underlining is there by default even if `--catman' is not specified.

If your file is actually a UNIX manual input, i.e., a roff file, then depending whether you left a2ps delegate or not, you will get a readable version of the text described, or a pretty-printed version of the describing file (see section 4.10 Your Delegations).

Option: -T num
Option: --tabsize=num
set tabulator size to num. This option is ignored if --interpret=no is given.

Option: --non-printable-format=format
specify how non-printable chars are printed. format can be
`caret'
Use classical Unix representation: `^A', `M-^B' etc.
`space'
A space is written instead of the non-printable character.
`question-mark'
A `?' is written instead of the non-printable character.
`octal'
For instance `\001', `177' etc.
`hexa'
For instance `\x01', `\xfe' etc.
`emacs'
For instance `C-h', `M-C-c' etc.

3.1.5 Headings Options

These are the options through which you may define the information you want to see all around the pages.

All these options support text as an argument, which is composed of plain strings and escapes. See section 3.2 Escapes, for details.

Option: -B
Option: --no-header
no page headers at all.

Option: -b[text]
Option: --header[=text]
set the page header

Option: --center-title[=text]
Option: --left-title[=text]
Option: --right-title[=text]
Set virtual page center, left and right titles to text.

Option: -u[text]
Option: --underlay[=text]
use text as under lay (or water mark), i.e., in a light gray, and under every page.

Option: --left-footer[=text]
Option: --footer[=text]
Option: --right-footer[=text]
Set sheet footers to text.

3.1.6 Input Options

Option: -a[Page range]
Option: --pages[=Page range]
With no argument, print all the page, otherwise select the pages to print. Page range is a list of interval, such as `-a1': print only the first page, `-a-3,4,6,10-': print the first 3 pages, page 4 and 6, and all the page after 10 (included). Giving `toc' prints the table of content whatever its page number is.

The pages referred to are the input pages, not the output pages, that is, in `-2', printing with `-a1' will print the first virtual page, i.e., you will get half the page filled.

Note that page selection does work with the delegations (see section 4.10 Your Delegations).

Option: -c
Option: --truncate-lines=boolean
Cut lines too large to be printed inside the borders. The maximum line size depends on format and font size used and whether line numbering is enabled.

Option: -i
Option: --interpret=boolean
interpret tab and ff chars. This means that `^L' jumps to a new (virtual) pages, `tab' advances to the next tabulation.

Option: --end-of-line=type
Specify what sequence of characters denotes the end of line. type can be:
n
unix
`\n'.
r
mac
`\r'.
nr
`\n\r'. As far as we know, this type of end-of-line is not used.
pc
rn
`\r\n'. This is the type of end-of-line on MS-DOS.
any
auto
Any of the previous cases. This last case prevents the bad surprises with files from PC (trailing `^M').

Option: -X key
Option: --encoding=key
Use the input encoding identified by key. See section 6.2.3 Some Encodings, and the result of `a2ps --list=encodings' to know what encodings are supported. Typical values are `ASCII', `latin1'... `latin6', `ison' etc.

Option: --stdin=filename
Give the name filename to the files read through the standard input.

Option: -t name
Option: --title=name
Give the name name to the document. Escapes can be used (see section 3.2 Escapes).

This is used for instance in the name given to the document from within the PostScript code (so that Ghostview and others can display a file with its real title, instead of just the PostScript file name).

It is not the name of the output. It is just a logical title.

Option: --prologue=prologue
Use prologue as the PostScript prologue for a2ps. prologue must be in a file named `prologue.pro', which must be in a directory of your library path (see section 5 Library Files). Available prologues are:
`bold'
This style is meant to replace the old option -b of a2ps 4.3. It is a copy of the black and white prologue, but in which all the fonts are in Bold.
`bw'
Style is plain: pure black and white, with standard fonts.
`color'
Colors are used to highlight the keywords.
`diff'
This style is meant to be used with the udiff, wdiff style sheets, to underline the differences. New things are in bold on a diff background, while removed sequences are in italic.
`gray'
Gray background is used for comments and labels.
`gray2'
Black background is used for comments and labels.
`matrix'
The layout is the same as `bw', but alternating gray and white lines. There are two macros defining the behavior: `pro.matrix.cycle' defines the length of the cycle (number of white and gray lines). It defaults to 6. `pro.matrix.gray' defines the number of gray lines. Default is 3.

Option: --print-anyway=boolean
force binary printing. By default, the whole print job is stopped as soon as a binary file is detected. To detect such a file we make use of a very simple heuristic: if the first sheet of the file contains more than 40% of non-printing characters, it's a binary file. a2ps also asks file(1) what it thinks of the type of the file. If file(1) answers `data', the file will also be considered as binary, hence not printed.

Option: -Z
Option: --delegate=boolean
Enable delegation of some files to delegated applications. If delegating is on, then a2ps will not process the file by itself, but will call an application which handles the file in another way. If delegation is off, then a2ps will process every file itself.

Typically most people don't want to pretty-print a PostScript source file, but want to print what describes that file. Then set the delegations on.

See section 4.10 Your Delegations for information on delegating, and option `--list=delegations' for the applications your a2ps knows.

Option: --toc[=format]
Generate a Table of Contents, which format is an escape (see section 3.2 Escapes) processed as a PreScript file (see section 7.3.2 PreScript). If no format is given (i.e., you wrote `--toc'), use the default table of contents shape (#{toc}). If the given format is empty (i.e., you wrote `--toc='), don't issue the table of contents.

Note that it is most useful to define a variable (see section 4.9 Your Variables), for instance, in a configuration file:

Variable: toc.mine \
\\Keyword{Table of Content}\n\
#-1!f\
|$2# \\keyword{$-.20n} sheets $3s< to $3s> ($2s#) \
pages $3p<-$3p> $4l# lines\n||\
\\Keyword{End of toc}\n

and to give that variable as argument to `--toc': `a2ps *.c --toc=#{toc.mine}'.

Note too that you can generate only the table of content using `--pages':

a2ps *.c --toc -atoc

3.1.7 Pretty Printing Options

These options are related to the pretty printing features of a2ps.

Option: --highlight-level=level
Specify the level of highlighting. level can be
`none'
no highlighting
`normal'
regular highlighting
`heavy'
even more highlighting.

See the documentation of the style sheets (`--list=style-sheets') for a description of `heavy' highlighting.

Option: -g
Alias for `--highlight-level=heavy'.

Option: -E [language]
Option: --pretty-print[=language]
With no arguments, set automatic style selection on. Otherwise, set style to language. Note that setting language to `plain' turns off pretty-printing. See section 7.2 Known Style Sheets, and the output of `--list=style-sheets' for the available style sheets.

If language is `key.ssh', then don't look in the library path, but use the file `key.ssh'. This is to ease debugging non installed style sheets.

Option: --strip-level=num
Depending on the value of num:
`0'
everything is printed;
`1'
regular comments are not printed
`2'
strong comments are not printed
`3'
no comment is printed.

This option is valuable for instance in java in which case strong comments are the so called documentation comments, or in SDL for which some graphical editors pollutes the specification with internal data as comments.

Note that the current implementation is not satisfactory: some undesired blank lines remain. This is planed to be fixed.

3.1.8 Output Options

These are the options to specify what you want to do out of what a2ps produces. Only a single destination is possible at a time, i.e., if ever there are several options `-o', `-P' or `-d', the last one is honored.

Option: -o file
Option: --output=file
leave output to file file. If file is `-', leave output to the standard output.

Option: --version-control=type
to avoid loosing a file, a2ps offers backup services. This is enabled when the output file already exists, is regular (that is, no backup is done on special files such as `/dev/null'), and is writable (in this case, disabling version control makes a2ps fail the very same way as if version control was disabled: permission denied).

The type of backups made can be set with the VERSION_CONTROL environment variable, which can be overridden by this option. If VERSION_CONTROL is not set and this option is not given, the default backup type is `existing'. The value of the VERSION_CONTROL environment variable and the argument to this option are like the GNU Emacs `version-control' variable; they also recognize synonyms that are more descriptive. The valid values are (unique abbreviations are accepted):

`none'
`off'
Never make backups (override existing files).
`t'
`numbered'
Always make numbered backups.
`nil'
`existing'
Make numbered backups of files that already have them, simple backups of the others.
`never'
`simple'
Always make simple backups.

Option: --suffix=suffix
The suffix used for making simple backup files can be set with the SIMPLE_BACKUP_SUFFIX environment variable, which can be overridden by this option. If neither of those is given, the default is `~', as it is in Emacs.

Option: -P name
Option: --printer=name
send output to printer name. See item `Printer:' and `Unknown printer:' in section 4.5 Your Printers and results of option `--list=defaults' to see the bindings between printer names and commands.

Option: -d
send output to the default printer. See item `DefaultPrinter:' in section 4.5 Your Printers.

3.1.9 PostScript Options

The following options are related only to variations you want to produce onto a PostScript output.

Option: --ppd[=key]
With no argument, set automatic PPD selection, otherwise set the PPD to key. FIXME: what to read.

Option: -n num
Option: --copies=num
print num copies of each page

Option: -s duplex-mode
Option: --sides=duplex-mode
Specify the number of sheet sides, or, more generally, the Duplex mode (see section A Glossary). The valid values for duplex-mode are:
`1'
`simplex'
One page per sheet.
`2'
`duplex'
Two pages per sheet, DuplexNoTumble mode.
`tumble'
Two pages per sheet, DuplexTumble mode.

Not only does this option require Duplex from the printer, but it also enables duplex features from a2ps (e.g., the margin changes from front pages to back pages etc.).

Option: -S key[:value]
Option: --setpagedevice=key[:value]
Pass a page device definition to the generated PostScript output. If no value is given, key is removed from the definitions. Note that several `--setpagedevice' can be accumulated.

For example, command

ubu $ a2ps -SDuplex:true -STumble:true NEWS
[NEWS (plain): 15 pages on 8 sheets]
[Total: 15 pages on 8 sheets] sent to the default printer

prints file `report.pre' in duplex (two sides) tumble (suitable for landscape documents). This is also valid for delegated files:

a2ps -SDuplex:true -STumble:true a2ps.texi

Page device operators are implementation dependent but they are standardized. See section 8.2 Page Device Options, for details.

Option: --statusdict=key[:value]
Option: --statusdict=key[::value]
Pass a statusdict definition to the generated PostScript output. statusdict operators and variables are implementation dependent; see the documentation of your printer for details. See section 8.3 Statusdict Options, for details. Several `--statusdict' can be accumulated.

If no value is given, key is removed from the definitions.

With a single colon, pass a call to an operator, for instance:

a2ps --statusdict=setpapertray:1 quicksort.c

prints file `quicksort.c' by using paper from the paper tray 1 (assuming that printer supports paper tray selection).

With two colons, define variable key to equal value. For instance:

a2ps --statusdict=papertray::1 quicksort.c

produces

  /papertray 1 def

in the PostScript.

Option: -k
Option: --page-prefeed
enable page prefeeding. It consists in positioning the sheet in the printing area while the PostScript is interpreted (instead of waiting the end of the interpretation of the page before pushing the sheet). It can lead to an significant speed up of the printing.

a2ps quotes the access to that feature, so that non supporting printers won't fail.

Option: -K
Option: --no-page-prefeed
disable page prefeeding.

3.2 Escapes

The escapes are some sequences of characters that will be replaced by their values. They are very much like variables.

3.2.1 Use of Escapes

They are used in several places in a2ps:

Page markers
Headers, footers, titles and the water mark (see section 3.1.5 Headings Options), in general to print the name of file, page number etc. On a new sheet a2ps first draws the water mark, then the content of the first page, then the frame of the first page, (ditto with the others), and finally the sheet header and footers. This order must be taken into account for some escapes (e.g., `$l.', `$l^').
Named output
To specify the generic name of the file to produce, or how to access a printer (see section 4.5 Your Printers).
Delegation
To specify the command associated to a delegation (see section 4.10 Your Delegations).
Table of Content
To specify an index/table of content printed at the end of the job.
Variables in PostScript prologue
To allow the user to change some parameters to your prologues (see section 8.6 Designing PostScript Prologues).

3.2.2 General Structure of the Escapes

All format directives can also be given in format

escape width directive

where

escape
In general
`%'
escapes are related to general information (e.g., the current date, the user's name etc.),
`#'
escapes are related to the output (e.g., the output file name) or to the options you gave (e.g., the number of virtual pages etc.), or to special constructions (e.g., enumerations of the files, or tests etc.),
`$'
escapes are related to the current input file (e.g., its name, its current page number etc.),
`\'
introduces classical escaping, or quoting, sequences (e.g., `\n', `\f' etc.).
width
Specifies the width of the column to which the escape is printed. There are three forms for width
`+paddinginteger'
the result of the expansion is prefixed by the character padding so that the whole result is as long as integer. For instance `$+.10n' with a file name `$n'=`foo.c' gives `.....foo.c'. If no padding is given, ` ' (white space) is used.
`-paddinginteger'
Idem as above, except that completion is done on the left: `$+.10n' gives `foo.c.....'.
`integer'
which is a short cut for `+integer'. For example, escape `$5P' will expand to something like `   12'.
directive
See section 3.2.3 Available Escapes.

3.2.3 Available Escapes

Supported escapes are:

`\\'
character `\'
`\%'
character `%'
`\$'
character `$'
`\#'
character `#'
`#?cond|if_true|if_false|'
this may be used for conditional assignment. The separator (presented here as `|') may be any character. if_true and if_false may be defined exactly the same way as regular headers, included escapes and the `#?' construct. The available tests are:
`#?1'
`#?2'
`#?3'
true if tag 1, 2 or 3 is not empty. See item `$t1' for explanation.
`#?d'
true if Duplex printing is requested (`-s2').
`#?j'
true if bordering is asked (`-j').
`#?l'
true if printing in landscape mode.
`#?o'
true if only one virtual page per page (i.e., `#v' is 1).
`#?p'
a page range has been specified (i.e., `#p' is not empty).
`#?q'
true if a2ps is in quiet mode.
`#?r'
true if major is rows (`--major=rows').
`#?v'
true if printing on the back side of the sheet (verso).
`#?V'
true if verbosity level includes the `tools' flag (See section 3.1.2 Global Options. option `--verbosity').
`#!key|in|between|'
Used for enumerations. The separator (presented here as `|') may be any character. in and between are escapes. The enumerations may be:
`#!$'
enumeration of the command line options. In this case in in never used, but is replaced by the arguments.
`#!f'
enumeration of the input files in the other they were given.
`#!F'
enumeration of the input files in the alphabetical order of their names.
`#!s'
enumeration of the files appearing in the current sheet.
For instance, the escapes `The files printed were: #!f|$n|, |.' evaluated with input `a2ps NEWS main.c -o foo.ps', gives `The files printed were: NEWS, main.c.'. As an exception, `#!' escapes use the width as the maximum number of objects to enumerate if it is positive, e.g., `#10!f|$n|, |' lists only the ten first file names. If width is negative, then it does not enumerate the -width last objects (e.g., `#-1!f|$n|, |' lists all the files but the last).
`${var}'
value of the environment variable var if defined, nothing otherwise.
`${var:-word}'
if the environment variable var is defined, then its value, otherwise word.
`${var:+word}'
if the environment variable var is defined, then word, otherwise nothing.
`$[num]'
value of the numth argument given on the command line. Note that $[0] is the name under which a2ps has been called.
`#{key}'
expansion of the value of the variable key if defined, nothing otherwise (see section 4.9 Your Variables)
`#{key:-word}'
if the variable var is defined, then the expansion of its, otherwise word.
`#{key:+word}'
if the variable var is defined, then word, otherwise nothing.
`#.'
the extension corresponding to the current output language (e.g. `ps').
`%*'
current time in 24-hour format with seconds `hh:mm:ss'
`$*'
file modification time in 24-hour format with seconds `hh:mm:ss'
`$#'
the sequence number of the current input file
`%#'
the total number of files
`%a'
the localized equivalent for `Printed by User Name'. User Name is obtained from the variable `user.name' (see section 4.9.2 Predefined Variables).
`%A'
the localized equivalent for `Printed by User Name from Host Name'. The variables `user.name' and `user.host' are used (see section 4.9.2 Predefined Variables).
`%c'
trailing component of the current working directory
`%C'
current time in `hh:mm:ss' format
`$C'
file modification time in `hh:mm:ss' format
`%d'
current working directory
`$d'
directory part of the current file (`.' if the directory part is empty).
`%D'
current date in `yy-mm-dd' format
`$D'
file modification date in `yy-mm-dd' format
`%D{string}'
format current date according to string with the strftime(3) function.
`$D{string}'
format file's last modification date according to string with the strftime(3) function.
`%e'
current date in localized short format (e.g., `Jul 4, 76' in English, or `14 Juil 89' in French).
`$e'
file modification date in localized short format.
`%E'
current date in localized long format (e.g., `July 4, 76' in English, or `Samedi 14 Juillet 89' in French).
`$E'
file modification date in localized long format.
`$f'
full file name (with directory and suffix).
`\f'
character `\f' (form feed).
`#f0'
`#f9'
ten temporary file names. You can do anything you want with them, a2ps removes them at the end of the job. It is useful for the delegations (see section 4.10 Your Delegations) and for the printer commands (see section 4.5 Your Printers).
`%F'
current date in `dd.mm.yyyy' format.
`$F'
file modification date in `dd.mm.yyyy' format.
`#h'
medium height in PostScript points
`$l^'
top most line number of the current page
`$l.'
current line number. To print the page number and the line interval in the right title, use `--right-title="$q:$l^-$l."'.
`$l#'
number of lines in the current file.
`%m'
the host name up to the first `.' character
`%M'
the full host name
`\n'
the character `\n' (new line).
`%n'
shortcut for the value of the variable `user.login' (see section 4.9.2 Predefined Variables).
`$n'
input file name without the directory part.
`%N'
shortcut for the value of the variable `user.name' (see section 4.9.2 Predefined Variables).
`$N'
input file name without the directory, and without its suffix (e.g., on `foo.c', it will produce `foo').
`#o'
name of the output, before substitution (i.e., argument of `-P', or of `-o').
`#O'
name of the output, after substitution. If output goes to a file, then the name of the file. If the output is a symbolic printer (see section 4.5 Your Printers), the result of the evaluation. For instance, if the symbolic printer `file' is defined as `> $n.%.', then `#O' returns `foo.c.ps' when printing `foo.c' to PostScript. `#o' would have returned `file'.
`#p'
the range of the page to print from this page. For instance if the user asked `--pages=1-10,15', and the current page is 8, then `#p' evaluates to `1-3,8'.
`$p^'
number of the first page of this file appearing on the current sheet. Note that `$p.', evaluated at the end of sheet, is also the number of the last page of this file appearing on this sheet.
`$p-'
interval of the page number of the current file appearing on the current sheet. It is the same as `$p^-$p.', if `$p^' and `$p.' are different, otherwise it is equal to `$p.'.
`%p.'
current page number
`$p.'
page number for this file
`%p#'
total number of pages printed
`$p#'
number of pages of the current file
`$p<'
number of the first page of the current file
`$p>'
number of the last page of the current file
`%q'
localized equivalent for `Page %p.'
`$q'
localized equivalent for `Page $p.'
`%Q'
localized equivalent for `Page %p./%p#'
`$Q'
localized equivalent for `Page $p./$p#'
`$s<'
number of the first sheet of the current file
`%s.'
current sheet number
`$s.'
sheet number for the current file
`$s>'
number of the last sheet of the current file
`%s#'
total number of sheets
`$s#'
number of sheets of the current file
`%t'
current time in 12-hour am/pm format
`$t'
file modification time in 12-hour am/pm format
`$t1'
`$t2'
`$t3'
Content of tag 1, 2 and 3. Tags are pieces of text a2ps fetches in the files, according to the style. For instance, in mail-folder style, tag 1 is the title of the mail, and tag 2 its author.
`%T'
current time in 24-hour format `hh:mm'
`$T'
file modification time in 24-hour format `hh:mm'
`#v'
number of virtual sheets
`%V'
the version string of a2ps.
`#w'
medium width in PostScript points
`%W'
current date in `mm/dd/yy' format
`$W'
file modification date in `mm/dd/yy' format

3.3 Exit status

The following exit values are returned:

`0'
a2ps terminated normally.
`1'
an error occured.
`2'
bad argument was given.
`3'
unknown language was given.

Go to the first, previous, next, last section, table of contents.