(a2ps.info)Available Escapes


Prev: Structure of the Escapes Up: Escapes
Enter node , (file) or (file)node

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 (Note:
          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 (Note: 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' (Note: Predefined
     Variables).

'%A'
     the localized equivalent for 'Printed by USER NAME from HOST NAME'.
     The variables 'user.name' and 'user.host' are used (Note:
     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 (Note: Your Delegations) and for the printer commands
     (Note: 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' (Note:
     Predefined Variables).

'$n'
     input file name without the directory part.

'%N'
     shortcut for the value of the variable 'user.name' (Note:
     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
     (Note: 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


automatically generated by info2www version 1.2.2.9