Previous: General Structure of the Escapes, Up: Escapes [Contents][Index]
Supported escapes are:
character ‘\’
character ‘%’
character ‘$’
character ‘#’
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:
true if tag 1, 2 or 3 is not empty. See item ‘$t1’ for explanation.
true if Duplex printing is requested (‘-s2’).
true if bordering is asked (‘-j’).
true if printing in landscape mode.
true if only one virtual page per page (i.e., ‘#v’ is 1).
a page range has been specified (i.e., ‘#p’ is not empty).
true if a2ps is in quiet mode.
true if major is rows (‘--major=rows’).
true if printing on the back side of the sheet (verso).
true if verbosity level includes the ‘tools’ flag (See Global Options. option ‘--verbosity’).
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.
enumeration of the input files in the other they were given.
enumeration of the input files in the alphabetical order of their names.
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).
value of the environment variable var if defined, nothing otherwise.
if the environment variable var is defined, then its value, otherwise word.
if the environment variable var is defined, then word, otherwise nothing.
value of the numth argument given on the command line. Note that $[0] is the name under which a2ps has been called.
expansion of the value of the variable key if defined, nothing otherwise (see Your Variables)
if the variable var is defined, then the expansion of its, otherwise 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
the localized equivalent for ‘Printed by User Name’. User Name is obtained from the variable ‘user.name’ (see Predefined Variables).
the localized equivalent for ‘Printed by User Name from Host Name’. The variables ‘user.name’ and ‘user.host’ are used (see Predefined Variables).
trailing component of the current working directory
current time in ‘hh:mm:ss’ format
file modification time in ‘hh:mm:ss’ format
current working directory
directory part of the current file (‘.’ if the directory part is empty).
current date in ‘yy-mm-dd’ format
file modification date in ‘yy-mm-dd’ format
format current date according to string with the
strftime(3)
function.
format file’s last modification date according to string with the
strftime(3)
function.
current date in localized short format (e.g., ‘Jul 4, 76’ in English, or ‘14 Juil 89’ in French).
file modification date in localized short format.
current date in localized long format (e.g., ‘July 4, 76’ in English, or ‘Samedi 14 Juillet 89’ in French).
file modification date in localized long format.
full file name (with directory and suffix).
character ‘\f’ (form feed
).
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 Your Delegations) and for the printer commands (see Your Printers).
current date in ‘dd.mm.yyyy’ format.
file modification date in ‘dd.mm.yyyy’ format.
medium height in PostScript points
top most line number of the current page
current line number. To print the page number and the line interval in the right title, use ‘--right-title="$q:$l^-$l."’.
number of lines in the current file.
the host name up to the first ‘.’ character
the full host name
the character ‘\n’ (new line
).
shortcut for the value of the variable ‘user.login’ (see Predefined Variables).
input file name without the directory part.
shortcut for the value of the variable ‘user.name’ (see Predefined Variables).
input file name without the directory, and without its suffix (e.g., on foo.c, it will produce ‘foo’).
name of the output, before substitution (i.e., argument of ‘-P’, or of ‘-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 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’.
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’.
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.
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.’.
current page number
page number for this file
total number of pages printed
number of pages of the current file
number of the first page of the current file
number of the last page of the current file
localized equivalent for ‘Page %p.’
localized equivalent for ‘Page $p.’
localized equivalent for ‘Page %p./%p#’
localized equivalent for ‘Page $p./$p#’
number of the first sheet of the current file
current sheet number
sheet number for the current file
number of the last sheet of the current file
total number of sheets
number of sheets of the current file
current time in 12-hour am/pm format
file modification time in 12-hour am/pm format
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.
current time in 24-hour format ‘hh:mm’
file modification time in 24-hour format ‘hh:mm’
number of virtual sheets
the version string of a2ps.
medium width in PostScript points
current date in ‘mm/dd/yy’ format
file modification date in ‘mm/dd/yy’ format
Previous: General Structure of the Escapes, Up: Escapes [Contents][Index]