(a2ps.info)Style Sheet Files


Prev: Font Files Up: Library Files
Enter node , (file) or (file)node

5.4 Style Sheet Files
=====================

The style sheets are defined in various files.  See Note: Pretty
Printing for the structure of these files.  As for most other
features, there is main file, a road map, which defines in which
condition a style sheet should be used (Note: Map Files).  This file
is 'sheets.map'.

   Its format is simple:
     STYLE-KEY: PATTERNS

or
     include(FILE)

   The PATTERNS need not be on separate lines.  There are two kinds of
patterns:
/PATTERN/FLAGS
     if the current file name matches PATTERN, then select style
     STYLE-KEY (i.e.  file 'STYLE-KEY.ssh').

<PATTERN>FLAGS
     if the result of a call to 'file(1)' matches PATTERN, then select
     style STYLE-KEY.

   Currently FLAGS can only be 'i', standing for an insentive match.
Please note that the matching is not truly case insensitive: rather, a
lower case version of the string is compared to the PATTERN as is, i.e.,
the PATTERN should itself be lower case.

   The special STYLE-KEY 'binary' tells a2ps to consider that the file
should not be printed, and will be ignored, unless option
'--print-anyway' is given.

   If a style name can't be found, the plain style is used.

   The map file is read bottom up, so that the "last" match is honored.

   Two things are to retain from this:
  1. if the file is presented through 'stdin', then a2ps will run
     'file(1)'.  However, unless you specify a fake file name with
     '--stdin', pattern matching upon the name is turn off.  In general
     you can expect correct delegations, but almost never pretty
     printing.

  2. if 'file' is wrong on some files, a2ps may use bad style sheets.
     In this case, do try option '--guess', compare it with the output
     of 'file', and if the culprit is 'file', go and complain to your
     system administrator :-), or fix it by defining your own filename
     pattern matching rules.

   Consider the case of Texinfo files as an example (the language in
which this documentation is written).  Files are usually named
'foo.texi', 'bar.txi', or even 'baz.texinfo'.  'file(1)' is able to
recognize Texinfo files:

     doc % file a2ps.texi
     a2ps.texi: Texinfo source text

Therefore the sheets.map would look like:

     # Texinfo files
     texinfo:  /*.txi/  /*.texi/  /*.texinfo/
               <Texinfo source*>


automatically generated by info2www version 1.2.2.9