ACC SHELL
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on July 5, 2010 by texi2html 1.82
texi2html was written by:
Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>General Purpose PostScript Generating Utility</title>
<meta name="description" content="General Purpose PostScript Generating Utility">
<meta name="keywords" content="General Purpose PostScript Generating Utility">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Introduction"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[ < ]</td>
<td valign="middle" align="left">[<a href="#Description" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[ << ]</td>
<td valign="middle" align="left">[ Up ]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Introduction-1"></a>
<h1 class="chapter">1. Introduction</h1>
<a name="index-First-Page"></a>
<p>This document describes GNU a2psversions may be found on the
<a href="http://www.inf.enst.fr/~demaille/a2ps">a2ps</a></p>
<p>We tried to make this document informative and pleasant. It tries to be
more than a plain reference guide, and intends to offer information
about the concepts or tools etc. that are related to printing
PostScript. This is why it is now that big: to offer you all the
information you might want, <strong>not</strong> because a2psdifficult to use. See section <a href="#Glossary">Glossary</a>, for technical words or even general
information.
</p>
<p>Please, send us emailcards <code>:)</code>. Whatever the comment is, or if you
just like a2ps@c, write to <a href="mailto:Miguel.Santana@st.com">Miguel Santana</a> and <a href="mailto:akim@freefriends.org">Akim Demaille</a>.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Description">1.1 Description</a></td><td> </td><td align="left" valign="top"> What a2ps is
</td></tr>
<tr><td align="left" valign="top"><a href="#Reporting-Bugs">1.2 Reporting Bugs</a></td><td> </td><td align="left" valign="top"> What to do when you face problems
</td></tr>
<tr><td align="left" valign="top"><a href="#a2ps-Mailing-List">1.3 a2ps</a></td><td> </td><td align="left" valign="top"> Getting news about a2ps
</td></tr>
<tr><td align="left" valign="top"><a href="#Helping-the-Development">1.4 Helping the Development</a></td><td> </td><td align="left" valign="top"> How to contribute
</td></tr>
</table>
<hr size="6">
<a name="Description"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Introduction" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Reporting-Bugs" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Description-1"></a>
<h2 class="section">1.1 Description</h2>
<p>a2ps</p>
<p>The format used is nice and compact: normally two pages on each physical
page, borders surrounding pages, headers with useful information (page
number, printing date, file name or supplied header), line numbering,
pretty-printing, symbol substitution etc. This is very useful for
making archive listings of programs or just to check your code in the
bus. Actually a2psprinted with a2ps</p>
<p>While at the origin its names was derived from “ASCII to PostScript”,
today we like to think of it as “Any to PostScript”. Indeed, a2pssupports <em>delegations</em>, i.e., you can safely use a2psPostScript, LaTeX, JPEG etc., even compressed.
</p>
<p>A short list of features of a2ps</p><ul class="toc">
<li>-
Customizable through various configuration files (see section <a href="#Configuration-Files">Configuration Files</a>)
</li><li>-
Powerful escapes to define the headers, table of contents etc. the way you want
(see section <a href="#Escapes">Escapes</a>);
</li><li>-
Variables to push even further the customizability in a comfortable
manner (see section <a href="#Your-Variables">Your Variables</a>);
</li><li>-
Open approach of encodings (see section <a href="#Encodings">Encodings</a>);
</li><li>-
Excellent support of the Latin 2, 3, 4, 5 and 6 encodings, thanks to
<code>Ogonkify</code> (see <a href="ogonkify.html#Top">(ogonkify)Top</a> section ‘Overview’ in <cite>Ogonkify manual</cite>),
written by Juliusz Chroboczek.
</li><li>-
Fully customizable output style: fonts, background and foreground
colors, line numbering style etc. (see section <a href="#Designing-PostScript-Prologues">Designing PostScript Prologues</a>).
</li><li>-
Possibility to delegate the processing of some files to other filters
(see section <a href="#Your-Delegations">Your Delegations</a>).
</li><li>-
Many contributions, e.g., pretty-print diffs, print reference cards of
programs, sanitize broken PostScript files, print Duplex on Simplex
printers etc. (see section <a href="#Contributions">Contributions</a>).
</li><li>-
And finally, the ability to pretty-print sources written in quite a
few various languages (see section <a href="#Pretty-Printing">Pretty Printing</a>).
</li></ul>
<hr size="6">
<a name="Reporting-Bugs"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Description" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#a2ps-Mailing-List" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Reporting-Bugs-1"></a>
<h2 class="section">1.2 Reporting Bugs</h2>
<a name="index-Bug"></a>
<p>We try hard to make a2psBut sometimes there can still be bad surprises, even after having
compiled and checked a2ps</p>
<p>You may encounter some of these problems yourself. In any case, please
never abandon without giving us a chance. We need information from
everybody so that mistakes get fixed as fast as possible.
</p>
<p>So, if you have a problem (configuration error, compilation error,
runtime error, documentation error or unclear), first check in the FAQ
(see section <a href="#FAQ">Frequently asked questions</a>), then on the page <a href="http://www.inf.enst.fr/~demaille/a2ps/bugs.html">but it appears that the version of a2psconsider upgrading.</a></p>
<p>If the problem persists, send us a mail (<a href="mailto:bug-a2ps@gnu.org">bug-a2ps@gnu.org</a>) which
subject is ‘<samp>a2ps <var>version</var>: <var>short-description</var></samp>’ and which
content mentions the name of your machine and OS, the version of
a2ps@c, every detail you have on your compiler, and as much traces as
possible (the error messages you get on the screen, or the output of
<code>make</code> when it fails etc.).
</p>
<p>Be sure to get a quick answer.
</p>
<hr size="6">
<a name="a2ps-Mailing-List"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Reporting-Bugs" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Helping-the-Development" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="a2ps-1"></a>
<h2 class="section">1.3 a2ps</h2>
<p>There is a mailing list in which are discussed various topics around
a2ps@c: <a href="mailto:a2ps@gnu.org">a2ps@gnu.org</a>. There are also announcements about
the version in alpha testing, requests for comments, new sheets, etc.
</p>
<p>To subscribe to the list, send a mail to <a href="mailto:a2ps-request@gnu.org">a2ps-request@gnu.org</a>,
with ‘<samp>subscribe</samp>’ in the body.
</p>
<p>Please, note that the mailing list is by no means a bug reporting
address: use <a href="mailto:bug-a2ps@gnu.org">bug-a2ps@gnu.org</a> instead.
</p>
<hr size="6">
<a name="Helping-the-Development"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#a2ps-Mailing-List" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Helping-the-Development-1"></a>
<h2 class="section">1.4 Helping the Development</h2>
<p>If you like a2psyou can do.
</p>
<dl compact="compact">
<dt> <em>Testing</em></dt>
<dd><p>You just can’t imagine how hard it is to make sure that the program that
works perfectly here will work on your machine. Actually, in general
the last weeks before a release are mostly dedicated to (Unix)
portability issues.
</p>
<p>So we <strong>need</strong> beta-testers! To be one is fairly simple: subscribe
to the mailing-list where the betas are announced and distributed.
</p>
</dd>
<dt> <em>Translation</em></dt>
<dd><p>The interface of a2psthe messages can be translated, without having to look at the code of
a2ps@c: you don’t need to be a programmer at all. All the details are
available on <a href="http://www.inf.enst.fr/~demaille/a2ps/po/">the a2ps translation page</a>.
</p>
</dd>
<dt> <em>Style Sheets</em></dt>
<dd><p>Since a2psshould be checked and improved. There are too many so that the authors
work on them. Therefore if you feel your favorite language is not
honored as it should be, improve the style sheet! (see section <a href="#Pretty-Printing">Pretty Printing</a> for details.)
</p>
</dd>
<dt> <em>Encodings</em></dt>
<dd><p>a2pstoday by a2ps@c, you can easily provide the support yourself.
Honestly, the trickiest part is to find correct <strong>free</strong> fonts that
support your mother tongue (see section <a href="#Encoding-Files">Encoding Files</a>, to know more).
</p>
</dd>
<dt> <em>Fonts</em></dt>
<dd><p>There are still some characters missing in Ogonkify. See
<a href="http://www.dcs.ed.ac.uk/home/jec/ogonkify/missing.html">the list of missing characters</a> and
<a href="http://www.dcs.ed.ac.uk/home/jec/ogonkify/">the Ogonkify home page</a> for details.
</p>
</dd>
<dt> <em>Documentation</em></dt>
<dd><p>If you feel something is missing or is unclear, send us your
contributions.
</p>
</dd>
<dt> <em>Porting</em></dt>
<dd><p>Porting a program to special architectures (MS-DOS, OS/2 etc.), or
building special packages (e.g., RPM) requires having an access to these
architectures. If you feel like maintaining such a port, tell us.
</p>
</dd>
<dt> <em>Features</em></dt>
<dd><p>Well, if you feel like doing something else, go ahead! But contact us,
because we have quite a big stack of things we want to do or have
started to do, and synchronizing might be useful.
</p></dd>
</dl>
<hr size="6">
<a name="User-Guide"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Helping-the-Development" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Purpose" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="User_0027s-Guide"></a>
<h1 class="chapter">2. User’s Guide</h1>
<p>This chapter is devoted to people who don’t know a2psgive a soft and smooth introduction to the most useful features. For a
reference manual, see <a href="#Invoking-a2ps">Invoking a2ps</a>. For the definition of some
words, see <a href="#Glossary">Glossary</a>, for questions you have, see <a href="#FAQ">Frequently asked questions</a>.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Purpose">2.1 Purpose</a></td><td> </td><td align="left" valign="top"> What a2ps is made for
</td></tr>
<tr><td align="left" valign="top"><a href="#How-to-print">2.2 How to print</a></td><td> </td><td align="left" valign="top"> The basis
</td></tr>
<tr><td align="left" valign="top"><a href="#Important-parameters">2.3 Important parameters</a></td><td> </td><td align="left" valign="top"> What needs to be set
</td></tr>
<tr><td align="left" valign="top"><a href="#Localizing">2.4 Localizing</a></td><td> </td><td align="left" valign="top"> How to have a2ps speaking your language
</td></tr>
<tr><td align="left" valign="top"><a href="#Interfacing">2.5 Interfacing with Other Programs</a></td><td> </td><td align="left" valign="top"> Using a2ps from common programs
</td></tr>
</table>
<hr size="6">
<a name="Purpose"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#User-Guide" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#How-to-print" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Purpose-1"></a>
<h2 class="section">2.1 Purpose</h2>
<p>a2psand makes a PostScript file out of it. Typically output is sent to
a printer.
</p>
<hr size="6">
<a name="How-to-print"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Purpose" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Basics-for-Printing" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="How-to-print-1"></a>
<h2 class="section">2.2 How to print</h2>
<p>To print a file ‘<tt>doc.txt</tt>’, just give it to a2ps@c: the default
setting should be the one you’d like:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">gargantua ~ $ a2ps doc.txt
[doc.txt (plain): 9 pages on 5 sheets]
[Total: 9 pages on 5 sheets] sent to the default printer
</pre></td></tr></table>
</td></tr></table>
<p>a2pstwo columns of text on a single face of the sheet. Indeed, by default
a2ps</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Basics-for-Printing">2.2.1 Basics for Printing</a></td><td> </td><td align="left" valign="top"> Printing text files
</td></tr>
<tr><td align="left" valign="top"><a href="#Special-Printers">2.2.2 Special Printers</a></td><td> </td><td align="left" valign="top"> Some useful fake printers
</td></tr>
<tr><td align="left" valign="top"><a href="#Using-Delegations">2.2.3 Using Delegations</a></td><td> </td><td align="left" valign="top"> Printing special files (PS, DVI etc.)
</td></tr>
<tr><td align="left" valign="top"><a href="#Printing-Duplex">2.2.4 Printing Duplex</a></td><td> </td><td align="left" valign="top"> Doing Fancy Things
</td></tr>
<tr><td align="left" valign="top"><a href="#Checking-the-Defaults">2.2.5 Checking the Defaults</a></td><td> </td><td align="left" valign="top"> Is it set the way you want?
</td></tr>
</table>
<hr size="6">
<a name="Basics-for-Printing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#How-to-print" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Special-Printers" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-to-print" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Basics-for-Printing-1"></a>
<h3 class="subsection">2.2.1 Basics for Printing</h3>
<p>Say you want to print the C file ‘<tt>bar.c</tt>’, and its header
‘<tt>foo.h</tt>’, on 4 virtual pages, and save it into the file
‘<tt>foobar.ps</tt>’. Just hit:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">gargantua $ a2ps foo.h bar.c -4 -o foobar.ps
[foo.h (C): 1 page on 1 sheet]
[bar.c (C): 3 pages on 1 sheet]
[Total: 4 pages on 2 sheets] saved into the file `foobar.ps'
</pre></td></tr></table>
</td></tr></table>
<p>The option ‘<samp>-4</samp>’ tells a2pstwo columns. The option ‘<samp>-o foobar.ps</samp>’ (which is the short version of
‘<samp>--output=foobar.ps</samp>’) specifies the output file. Long options
must always be separated by spaces, though short options with no
arguments may be grouped.
</p>
<p>Note too that the options may be specified before or after the files, it
does not matter.
</p>
<p>If you send ‘<tt>foobar.ps</tt>’ to a printer, you’ll discover that the
keywords were highlighted, that the strings and comments have a
different face. Indeed, a2ps(programming) language in which your file is written, it will try to make
it look nice and clear on the paper.
</p>
<p>But too bad: ‘<tt>foo.h</tt>’ is only one virtual page long, and
‘<tt>bar.c</tt>’ takes three. Moreover, the comments are essential in those
files. And even worse: the system’s default printer is out of ink.
Thanks god, precious options may help you:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">gargantua $ a2ps -4 -Av foo.h bar.c --prologue=gray -P lw
[foo.h (C): 1 page on 1 sheet]
[bar.c (C): 3 pages on 1 sheet]
[Total: 4 pages on 1 sheet] sent to the printer `lw'
</pre></td></tr></table>
</td></tr></table>
<p>Here the option ‘<samp>-A</samp>’ is a short cut for the option
‘<samp>--file-align</samp>’ which specifies how different files should be
separated. This option allows several symbolic arguments:
‘<samp>virtual</samp>’, ‘<samp>rank</samp>’, ‘<samp>page</samp>’, ‘<samp>sheet</samp>’ (See section <a href="#Sheet-Options">Sheet Options</a>, for more details). The value ‘<samp>virtual</samp>’ means not to
start each file on a different virtual pages.
</p>
<p>So to fill the page is asked by ‘<samp>--file-align=virtual</samp>’, or ‘<samp>-A
virtual</samp>’. But symbolic arguments can be abbreviated when there are no
ambiguity, so here, you can just use ‘<samp>-Av</samp>’.
</p>
<p>The option ‘<samp>-P lw</samp>’ means to print on the printer named ‘<samp>lw</samp>’,
and finally, the long option ‘<samp>--prologue</samp>’ requires the use one of
the alternative printing styles. There are other prologues (See section <a href="#Input-Options">Input Options</a>, option ‘<samp>--prologue</samp>’), and you can even design yours
(see section <a href="#Designing-PostScript-Prologues">Designing PostScript Prologues</a>).
</p>
<hr size="6">
<a name="Special-Printers"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Basics-for-Printing" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Using-Delegations" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-to-print" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Special-Printers-1"></a>
<h3 class="subsection">2.2.2 Special Printers</h3>
<a name="index-display"></a>
<a name="index-void"></a>
<a name="index-file"></a>
<p>There are three special printers pre-defined.
</p>
<p>The first one, <code>void</code>, sends the output to the trash.
Its main use is to see how many pages would have been used.
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">gargantua ~ $ a2ps -P void parsessh.c
[parsessh.c (C): 33 pages on 17 sheets]
[Total: 33 pages on 17 sheets] sent to the printer `void'
</pre></td></tr></table>
</td></tr></table>
<p>The second, <code>display</code> sends the output to <code>Ghostview</code>, so that
you can check the output without printing. Of course if you don’t have
<code>Ghostview</code>, it won’t work... And it is up to you to configure
another displaying application (see section <a href="#Your-Printers">Your Printers</a>).
</p>
<p>The last, <code>file</code> saves the output into a file named after the
file you printed (e.g., saves into ‘<tt>foo.ps</tt>’ when you print
‘<tt>foo.c</tt>’).
</p>
<hr size="6">
<a name="Using-Delegations"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Special-Printers" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Printing-Duplex" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-to-print" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Using-Delegations-1"></a>
<h3 class="subsection">2.2.3 Using Delegations</h3>
<p>a2psIn that case it delegates the task to other programs. What you should
retain from this, is, <em>forget that there are delegations</em>. Indeed,
the interface with the delegations has been designed so that you don’t
need to be aware that they exist to use them. Do as usual.
</p>
<p>As an example, if you need to print a PostScript file, just hit:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">gargantua ~ $ a2ps article.ps -d
[article.ps (ps, delegated to PsNup): 7 pages on 4 sheets]
[Total: 8 pages on 4 sheets] sent to the default printer
</pre></td></tr></table>
</td></tr></table>
<p>While honoring your defaults settings, a2pstwo virtual pages per physical page to <code>psnup</code>, a powerful filter
part of the famous <code>psutils</code> by Angus Duggan.
</p>
<p>Suppose now that you want to display a Texinfo file. Then, provided you
have all the programs a2ps</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">gargantua ~ $ a2ps a2ps.texi -P display
[a2ps.texi (texinfo, delegated to texi2dvi): 75 pages on 38 sheets]
[Total: 76 pages on 38 sheets] sent to the printer `display'
</pre></td></tr></table>
</td></tr></table>
<p>Once the read documentation, you know you want to print just pages
10 to 20, plus the cover. Just hit:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">gargantua ~ $ a2ps a2ps.texi --pages=1,10-20 -d
[a2ps.texi (texinfo, delegated to texi2dvi): 13 pages on 7 sheets]
[Total: 14 pages on 7 sheets] sent to the default printer
</pre></td></tr></table>
</td></tr></table>
<p>A final word: compressed files can be treated in the very same way:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">gargantua ~ $ a2ps a2ps.texi.gz -a1,10-20 -d
[a2ps.texi (compressed, delegated to Gzip-a2ps): 13 pages on 7 sheets]
[Total: 14 pages on 7 sheets] sent to the default printer
</pre></td></tr></table>
</td></tr></table>
<p>You should be aware that:
</p><ul class="toc">
<li>-
the option ‘<samp>-Z</samp>’ enables the delegations if they are not (see
‘<samp>--list=defaults</samp>’ for your settings);
</li><li>-
the set of delegations is customizable, to know the delegations your
a2ps</li></ul>
<hr size="6">
<a name="Printing-Duplex"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Using-Delegations" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Checking-the-Defaults" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-to-print" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Printing-Duplex-1"></a>
<h3 class="subsection">2.2.4 Printing Duplex</h3>
<p>If you still want to save more paper, and you are amongst the set of
happy users of Duplex printers, a2ps(See section <a href="#Glossary">Glossary</a>, for definitions). The option to specify Duplex
printing is ‘<samp>--sides=<var>mode</var></samp>’ (see section <a href="#PostScript-Options">PostScript Options</a>).
</p>
<p>Here is how to print the documentation in Duplex and send it to the
Duplex printer ‘<samp>margot</samp>’:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">quasimodo ~ a2ps/doc $ a2ps -s2 -Pmargot a2ps.texi
[a2ps.texi (texinfo, delegated to texi2dvi): 109 pages on 28 sheets]
[Total: 110 pages on 28 sheets] sent to the printer `margot'
</pre></td></tr></table>
</td></tr></table>
<p>This is also valid for several files.
</p>
<p>Actually, you can do something even more tricky: print a small book!
This is much more complicated than printing Duplex, because the pages
needs to be completely reorganized another way. This is precisely the
job of <code>psbook</code>, yet another PsUtil from Angus Duggan. But there
is a user option which encapsulates the magic sequence of options:
‘<samp>book</samp>’. Therefore, just run
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">quasimodo a2ps/doc $ a2ps -=book -Pmargot a2ps.texi
[a2ps.texi (texinfo, delegated to texi2dvi): 109 pages on 109 sheets]
[Total: 109 pages on 109 sheets] sent to the printer `margot'
</pre></td></tr></table>
</td></tr></table>
<p>and <i>voila‘ !</i>, a booklet printed on margot!
</p>
<p>We strongly discourage you to try with several files at once, because
the tools then easily get lost. And, after all, the result will be
exactly the same once you collated all the booklets together.
</p>
<p>Another limitation is that this does not work if it is not sent to a
printer. This kind of weird limitations will be solved in the future.
</p>
<hr size="6">
<a name="Checking-the-Defaults"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Printing-Duplex" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Important-parameters" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-to-print" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Checking-the-Defaults-1"></a>
<h3 class="subsection">2.2.5 Checking the Defaults</h3>
<p>If a2psthe default settings given by your system administrator. Checking
those default values is easy:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">~ % a2ps --list=defaults
Configuration status of a2ps 4.12a
==================================
Sheets:
-------
medium = A4, portrait
page layout = 1 x 1, rows first
borders = yes
file alignment = page
interior margin = 0
<em>More stuff deleted here</em>
Internals:
----------
verbosity level = 2
file command = /usr/bin/file -L
temporary directory = /tmp
library path =
/home/akim/.a2ps
/usr/share/a2ps/sheets
/usr/share/a2ps/ps
/usr/share/a2ps/encoding
/usr/share/a2ps/afm
/usr/share/ogonkify/afm
/usr/share/a2ps/ppd
/usr/share/a2ps/fonts
/usr/share/ogonkify/fonts
/usr/share/a2ps
</pre></td></tr></table>
</td></tr></table>
<p>Remember that the on-line help is always available. Moreover, if your
screen is small, you may <em>pipe</em> it into <code>more</code>. Just trust
this:
</p><table><tr><td> </td><td><pre class="example">a2ps --help | more
</pre></td></tr></table>
<hr size="6">
<a name="Important-parameters"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Checking-the-Defaults" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Localizing" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Important-parameters-1"></a>
<h2 class="section">2.3 Important parameters</h2>
<p>Many things are parameterizable in a2ps@c, but two things are just
essential to make sure everything goes right:
</p><dl compact="compact">
<dt> <strong>The paper</strong></dt>
<dd><p>Make sure that the paper a2ps(See section <a href="#Sheet-Options">Sheet Options</a>, option ‘<samp>--medium</samp>’).
</p>
</dd>
<dt> <strong>The encoding</strong></dt>
<dd><p>Make sure that the <em>encoding</em> a2psstandard alphabet in your country (See section <a href="#Input-Options">Input Options</a>, option
‘<samp>--encoding</samp>’).
</p></dd>
</dl>
<p>Both values may be checked with ‘<samp>a2ps --list=defaults</samp>’.
</p>
<hr size="6">
<a name="Localizing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Important-parameters" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Interfacing" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Localizing-1"></a>
<h2 class="section">2.4 Localizing</h2>
<p>a2psmother tongue. It uses three special features for non-English
languages:
</p><dl compact="compact">
<dt> <em>the tongue</em></dt>
<dd><p>i.e., the language used by the interface,
</p>
</dd>
<dt> <em>the date</em></dt>
<dd><p>i.e., the format and the words used in the language to specify a date.
</p></dd>
</dl>
<p>To enable these features, properly set your environment variable
<code>LANG</code> (see the documentation of your system, for instance
‘<samp>man locale</samp>’, ‘<samp>man environ</samp>’ etc.).
</p>
<p>The problem with this approach is that a lot more than just messages and
time information is affected: especially the way numbers are written
changes, what may cause problems with <code>awk</code> and such.
</p>
<p>So if you just want messages and time format to be localized, then
define:
</p><table><tr><td> </td><td><pre class="example">set LC_MESSAGES=fr ; export LC_MESSAGES
set LC_TIME=fr ; export LC_TIME
</pre></td></tr></table>
<hr size="6">
<a name="Interfacing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Localizing" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Interfacing-With-a-Mailer" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Interfacing-with-Other-Programs"></a>
<h2 class="section">2.5 Interfacing with Other Programs</h2>
<p>Here are some tips on how to use a2ps</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Interfacing-With-a-Mailer">2.5.1 Interfacing With a Mailer</a></td><td> </td><td align="left" valign="top"> Printing Mails or News
</td></tr>
<tr><td align="left" valign="top"><a href="#Netscape">2.5.2 Netscape</a></td><td> </td><td align="left" valign="top"> Interfacing with Netscape
</td></tr>
</table>
<hr size="6">
<a name="Interfacing-With-a-Mailer"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Interfacing" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Netscape" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Interfacing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Interfacing-With-a-Mailer-1"></a>
<h3 class="subsection">2.5.1 Interfacing With a Mailer</h3>
<p>When you print from a mailer (or a news reader), your mailer calls a tool,
say a2psa2psbetter results, make sure to tell a2psoption ‘<samp>mail</samp>’ (or ‘<samp>longmail</samp>’ for longer inputs) encapsulates most
typical tuning users want to print mails (for instance, don’t print all the
headers).
</p>
<p>Most specifically, if your mailer is:
</p><dl compact="compact">
<dt> <code>elm</code></dt>
<dd><a name="index-elm"></a>
<p>Once you are in elm, hit <kbd>o</kbd> to enter in the options edition menu,
hit <kbd>p</kbd> to edit the printer command, and enter ‘<samp>a2ps -=mail
%s -d</samp>’. The option ‘<samp>-d</samp>’ means to print on the default printer.
</p>
</dd>
<dt> <code>pine</code></dt>
<dd><a name="index-pine"></a>
<p><a href="mailto:jan@chrillesen.dk">Jan Chrillesen</a> suggests us how to use a2pswith the Pine mail-reader. Add the following to ‘<tt>.pinerc</tt>’
(of course you can put it in ‘<tt>pine.conf</tt>’ as well):
</p><table><tr><td> </td><td><pre class="example"># Your printer selection
printer=a2ps -=mail -d
# Special print command
personal-print-command=a2ps -=mail -d
</pre></td></tr></table>
</dd>
</dl>
<hr size="6">
<a name="Netscape"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Interfacing-With-a-Mailer" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Interfacing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Netscape-1"></a>
<h3 class="subsection">2.5.2 Netscape</h3>
<p>This is actually valid for any program that generates PostScript that
you want to post-process with a2ps@c. Use the following command:
</p><table><tr><td> </td><td><pre class="example">a2ps
</pre></td></tr></table>
<p>Not too hard, isn’t it?
</p>
<p>Nevertheless, this setting suppose your world is OK, your <code>file(1)</code>
detects correctly PostScript files, and your a2psdelegate. In case one one these conditions is not met, use:
</p><table><tr><td> </td><td><pre class="example">a2ps -ZEps
</pre></td></tr></table>
<p>Do not forget to tell Netscape whether your printer supports colors, and
the type of paper it uses.
</p>
<hr size="6">
<a name="Invoking-a2ps"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Netscape" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#User-Guide" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Invoking-a2ps-1"></a>
<h1 class="chapter">3. Invoking a2ps</h1>
<p>Calling a2ps</p><table><tr><td> </td><td><pre class="example">a2ps <var>Options...</var> <var>Files...</var>
</pre></td></tr></table>
<p>If no <var>Files...</var> are given, a2ps‘<samp>-</samp>’ appears in the <var>Files...</var>, it designates the standard input
too.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Options">3.1 Command line options</a></td><td> </td><td align="left" valign="top"></td></tr>
<tr><td align="left" valign="top"><a href="#Escapes">3.2 Escapes</a></td><td> </td><td align="left" valign="top"> Strings ready to use in the headers
</td></tr>
</table>
<hr size="6">
<a name="Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Tasks-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Command-line-options"></a>
<h2 class="section">3.1 Command line options</h2>
<a name="index-Command-line-options"></a>
<a name="index-Options"></a>
<p>To read the options and arguments that you give, a2ps<code>getopt</code>, hence:
</p>
<ul class="toc">
<li>-
the options (short with arguments or long) must be separated by spaces.
</li><li>-
the order between options and files does not matter: ‘<samp>a2ps -4m
main.c</samp>’ and ‘<samp>a2ps main.c -4m</samp>’ are identical.
</li><li>-
the order between options <strong>does matter</strong>, especially between
options that influence the same parameters. For instance ‘<samp>a2ps -1
-l132</samp>’ is not the same as ‘<samp>a2ps -l132 -1</samp>’ (the latter being
equivalent to ‘<samp>a2ps -1</samp>’).
</li><li>-
short options may be grouped together: ‘<samp>a2ps -4mg main.c -P printer</samp>’
</li><li>-
when there are no ambiguities, long options can be abbreviated, e.g.,
‘<samp>--pro</samp>’ will be understood as ‘<samp>--prologue</samp>’,
</li><li>-
‘<samp>--</samp>’ ends the options. Anything behind ‘<samp>--</samp>’ is considered to
be a file: ‘<samp>a2ps -- -2</samp>’ prints the file ‘<tt>-2</tt>’<a name="DOCF1" href="#FOOT1">(1)</a>.
</li></ul>
<p>Here after a <var>boolean</var> is considered as true (i.e. setting the
option on), if <var>boolean</var> is ‘<samp>yes</samp>’, or ‘<samp>1</samp>’; as false if it
equals ‘<samp>no</samp>’ or ‘<samp>0</samp>’; and raise an error otherwise. The
corresponding short option takes no arguments, but corresponds to a
positive answer.
</p>
<p>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.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Tasks-Options">3.1.1 Tasks Options</a></td><td> </td><td align="left" valign="top"> Exclusive options
</td></tr>
<tr><td align="left" valign="top"><a href="#Global-Options">3.1.2 Global Options</a></td><td> </td><td align="left" valign="top"> Settings involving the whole process
</td></tr>
<tr><td align="left" valign="top"><a href="#Sheet-Options">3.1.3 Sheet Options</a></td><td> </td><td align="left" valign="top"> Specify the layout on the sheet
</td></tr>
<tr><td align="left" valign="top"><a href="#Page-Options">3.1.4 Page Options</a></td><td> </td><td align="left" valign="top"> Specify the virtual pages
</td></tr>
<tr><td align="left" valign="top"><a href="#Headings-Options">3.1.5 Headings Options</a></td><td> </td><td align="left" valign="top"> Specify the headers you want
</td></tr>
<tr><td align="left" valign="top"><a href="#Input-Options">3.1.6 Input Options</a></td><td> </td><td align="left" valign="top"> How to process the input files
</td></tr>
<tr><td align="left" valign="top"><a href="#Pretty-Print-Options">3.1.7 Pretty Printing Options</a></td><td> </td><td align="left" valign="top"> Source files support
</td></tr>
<tr><td align="left" valign="top"><a href="#Output-Options">3.1.8 Output Options</a></td><td> </td><td align="left" valign="top"> What should be done of the output
</td></tr>
<tr><td align="left" valign="top"><a href="#PostScript-Options">3.1.9 PostScript Options</a></td><td> </td><td align="left" valign="top"> PostScript specific options
</td></tr>
</table>
<hr size="6">
<a name="Tasks-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Global-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Options" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Tasks-Options-1"></a>
<h3 class="subsection">3.1.1 Tasks Options</h3>
<p>Task options specify the task a2psit executes the task and exits successfully.
</p>
<dl>
<dt><a name="index-_002d"></a><u>Option:</u> <b>-</b><i><b>-</b>version</i></dt>
<dd><p>print version and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-1"></a><u>Option:</u> <b>-</b><i><b>-</b>help</i></dt>
<dd><p>Print a short help, and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-2"></a><u>Option:</u> <b>-</b><i><b>-</b>copyright</i></dt>
<dd><p>Display Copyright and copying conditions, and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-3"></a><u>Option:</u> <b>-</b><i><b>-</b>guess</i></dt>
<dd><p>Act like <code>file</code> does: display the (key of the) type of the
<var>Files</var>.
</p>
<p>For instance, on a <code>C</code> file, you expect it to answer ‘<samp>c</samp>’, and
upon a PostScript file, ‘<samp>ps</samp>’.
</p>
<p>This can be very useful on broken systems to understand why a file is
printed with a bad style sheet (see section <a href="#Style-Sheet-Files">Style Sheet Files</a>).
</p></dd></dl>
<dl>
<dt><a name="index-_002d-4"></a><u>Option:</u> <b>-</b><i><b>-</b>which</i></dt>
<dd><p>Look in the library for the files which names are given as arguments.
For instance:
</p>
<table class="cartouche" border="1"><tr><td>
<table><tr><td> </td><td><pre class="example">~ % a2ps --which bw.pro gray.pro
/usr/local/share/a2ps/ps/bw.pro
/usr/local/share/a2ps/ps/gray.pro
</pre></td></tr></table>
</td></tr></table>
<p>If there are several library files matching the name, only the first one
is reported: this allows to check which occurrence of a file is used by
a2ps@c.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-5"></a><u>Option:</u> <b>-</b><i><b>-</b>glob</i></dt>
<dd><p>Look in the library for the files which names match the patterns given
as arguments. For instance:
</p>
<table class="cartouche" border="1"><tr><td>
<table><tr><td> </td><td><pre class="example">~ % a2ps --glob 'g*.pro'
/usr/local/share/a2ps/ps/gray.pro
/usr/local/share/a2ps/ps/gray2.pro
</pre></td></tr></table>
</td></tr></table>
</dd></dl>
<dl>
<dt><a name="index-_002d-6"></a><u>Option:</u> <b>-</b><i><b>-</b>list=<var>topic</var></i></dt>
<dd><p>Display a report on a2ps@c’ status with respect to <var>topic</var>, and
exit successfully.
<var>topic</var> can be any non-ambiguous abbreviation of:
</p><dl compact="compact">
<dt> ‘<samp>defaults</samp>’</dt>
<dt> ‘<samp>options</samp>’</dt>
<dd><p>Give an extensive report on a2ps</p>
</dd>
<dt> ‘<samp>features</samp>’</dt>
<dd><p>Known media, encodings, languages, prologues, printers, variables,
delegations and user options are reported. In a word, anything that you
may define.
</p>
</dd>
<dt> ‘<samp>delegations</samp>’</dt>
<dd><p>Detailed list of the delegations. See section <a href="#Your-Delegations">Your Delegations</a>.
</p>
</dd>
<dt> ‘<samp>encodings</samp>’</dt>
<dd><p>Detailed list of known encodings. See section <a href="#Some-Encodings">Some Encodings</a>.
</p>
</dd>
<dt> ‘<samp>media</samp>’</dt>
<dd><p>Detailed list of known media. See section <a href="#Your-Media">Your Media</a>.
</p>
</dd>
<dt> ‘<samp>prologues</samp>’</dt>
<dd><p>Detailed list of PostScript prologues. See section <a href="#Designing-PostScript-Prologues">Designing PostScript Prologues</a>.
</p>
</dd>
<dt> ‘<samp>printers</samp>’</dt>
<dd><p>Detailed list of printers and named outputs. See section <a href="#Your-Printers">Your Printers</a>.
</p>
</dd>
<dt> ‘<samp>style-sheets</samp>’</dt>
<dd><p>Detailed list of the known style sheets. See section <a href="#Known-Style-Sheets">Known Style Sheets</a>.
</p>
</dd>
<dt> ‘<samp>user-options</samp>’</dt>
<dd><p>Detailed list of the user options. See section <a href="#Your-Shortcuts">Your Shortcuts</a>.
</p>
</dd>
<dt> ‘<samp>variables</samp>’</dt>
<dd><p>Detailed list of the variables. See section <a href="#Your-Variables">Your Variables</a>.
</p></dd>
</dl>
<p>There are also options meant for the maintainers only, presented for
sake of completeness.
</p><dl compact="compact">
<dt> ‘<samp>texinfo-style-sheets</samp>’</dt>
<dt> ‘<samp>ssh-texi</samp>’</dt>
<dd><p>Detailed list of known style sheets in Texinfo format. If the
<code>sheet</code> verbosity is set, report version numbers, requirements and
ancestors.
</p>
</dd>
<dt> ‘<samp>html-style-sheets</samp>’</dt>
<dt> ‘<samp>ssh-html</samp>’</dt>
<dd><p>Detailed list of the style sheets in <code>HTML</code> format.
</p>
</dd>
<dt> ‘<samp>texinfo-encodings</samp>’</dt>
<dt> ‘<samp>edf-texi</samp>’</dt>
<dd><p>Detailed list of encodings, in Texinfo format.
</p>
</dd>
<dt> ‘<samp>texinfo-prologues</samp>’</dt>
<dt> ‘<samp>pro-texi</samp>’</dt>
<dd><p>Detailed list of prologues, in Texinfo format.
</p>
</dd>
</dl>
</dd></dl>
<hr size="6">
<a name="Global-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Tasks-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Sheet-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Options" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Global-Options-1"></a>
<h3 class="subsection">3.1.2 Global Options</h3>
<p>These options are related to the interface between you and a2ps@c.
</p>
<dl>
<dt><a name="index-_002dq"></a><u>Option:</u> <b>-q</b></dt>
<dt><a name="index-_002d-7"></a><u>Option:</u> <b>-</b><i><b>-</b>quiet</i></dt>
<dt><a name="index-_002d_002dsilent"></a><u>Option:</u> <b>-<b>-</b>silent</b></dt>
<dd><p>be really quiet
</p></dd></dl>
<dl>
<dt><a name="index-_002dv"></a><u>Option:</u> <b>-v</b><i>[<var>level</var>]</i></dt>
<dt><a name="index-_002d-8"></a><u>Option:</u> <b>-</b><i><b>-</b>verbose[=<var>level</var>]</i></dt>
<dd><p>tell what we are doing. At
</p><ul class="toc">
<li>-
<var>level</var> = 0, report nothing,
</li><li>-
<var>level</var> = 1, a2ps
</li><li>-
<var>level</var> = 2 (default), it reports it for each file,
</li><li>-
above, it gives internal details.
</li></ul>
<p>There is also an interface made for the maintainer with finer grained
selection of the verbosity level. <var>level</var> is a list of tokens (non
ambiguous abbreviations are valid) separated by either ‘<samp>,</samp>’ or
‘<samp>+</samp>’. The tokens may be:
</p><dl compact="compact">
<dt> ‘<samp>configuration</samp>’</dt>
<dt> ‘<samp>options</samp>’</dt>
<dd><p>reading the configurations files and the options,
</p>
</dd>
<dt> ‘<samp>encodings</samp>’</dt>
<dd><p>the encodings,
</p>
</dd>
<dt> ‘<samp>expert</samp>’</dt>
<dd><p>more detailed information is provided: PPD listings is exhaustive,
</p>
</dd>
<dt> ‘<samp>files</samp>’</dt>
<dd><p>inputs and outputs,
</p>
</dd>
<dt> ‘<samp>fonts</samp>’</dt>
<dd><p>the fonts,
</p>
</dd>
<dt> ‘<samp>escapes</samp>’</dt>
<dt> ‘<samp>variables</samp>’</dt>
<dt> ‘<samp>meta-sequences</samp>’</dt>
<dd><p>the expansion of escapes and variables,
</p>
</dd>
<dt> ‘<samp>parsers</samp>’</dt>
<dd><p>any parsing process (style sheets, PPD files etc.),
</p>
</dd>
<dt> ‘<samp>pathwalk</samp>’</dt>
<dt> ‘<samp>pw</samp>’</dt>
<dd><p>the search for files,
</p>
</dd>
<dt> ‘<samp>ppd</samp>’</dt>
<dd><p>PPD processing,
</p>
</dd>
<dt> ‘<samp>sheets</samp>’</dt>
<dd><p>the style sheets,
</p>
</dd>
<dt> ‘<samp>stats</samp>’</dt>
<dd><p>statistics on some internal data structures,
</p>
</dd>
<dt> ‘<samp>tools</samp>’</dt>
<dd><p>launched programs or shell commands ; triggers the escape ‘<samp>?V</samp>’ on
(see section <a href="#Available-Escapes">Available Escapes</a>),
</p>
</dd>
<dt> ‘<samp>all</samp>’</dt>
<dd><p>all the messages.
</p></dd>
</dl>
<a name="index-A2PS_005fVERBOSITY"></a>
<p>When a2ps<code>A2PS_VERBOSITY</code>. If it is set, this defines the verbosity level
for the whole session (options ‘<samp>--verbose</samp>’, and ‘<samp>-q</samp>’ etc.
have then no influence). The valid values for <code>A2PS_VERBOSITY</code> are
exactly the valid arguments of the option ‘<samp>--verbose</samp>’. This helps
tracking down configuration problems that occur <em>before</em> a2pseven a chance to read the command line.
</p></dd></dl>
<dl>
<dt><a name="index-_002d_003d"></a><u>Option:</u> <b>-=</b><i><var>shortcut</var></i></dt>
<dt><a name="index-_002d-9"></a><u>Option:</u> <b>-</b><i><b>-</b>user-option=<var>shortcut</var></i></dt>
<dd><p>use the <var>shortcut</var> defined by the user. See section <a href="#Your-Shortcuts">Your Shortcuts</a>.
Shortcuts may be freely mixed with regular options and arguments.
</p>
<p>There are a few predefined user-options:
</p><dl compact="compact">
<dt> ‘<samp>lp</samp>’</dt>
<dd><p>emulates a line printer, i.e., turn off most ‘pretty’ features.
</p>
</dd>
<dt> ‘<samp>mail</samp>’</dt>
<dt> ‘<samp>longmail</samp>’</dt>
<dd><p>preferred options to print a mail or a news. ‘<samp>longmail</samp>’ prints more
text on a single sheet.
</p>
</dd>
<dt> ‘<samp>manual</samp>’</dt>
<dd><p>make the job be printed on the manually fed tray.
</p></dd>
</dl>
</dd></dl>
<dl>
<dt><a name="index-_002d-10"></a><u>Option:</u> <b>-</b><i><b>-</b>debug</i></dt>
<dd><p>enable debugging features. They are:
</p><ul class="toc">
<li>-
print the overall BoundingBox in PostScript;
</li><li>-
down load a PostScript debugger which helps understanding why a
printer may reject a file.
</li></ul>
</dd></dl>
<dl>
<dt><a name="index-_002dD"></a><u>Option:</u> <b>-D</b><i> <var>key</var>[=<var>value</var>]</i></dt>
<dt><a name="index-_002d-11"></a><u>Option:</u> <b>-</b><i><b>-</b>define=<var>key</var>[=<var>value</var>]</i></dt>
<dd><p>Without <var>value</var>, unset the variable <var>key</var>. Otherwise, set it to
<var>value</var>. See section <a href="#Your-Variables">Your Variables</a>, for more details. Note that
‘<samp>-Dfoo=</samp>’ gives <var>foo</var> an empty value, though ‘<samp>-Dfoo</samp>’ unsets
foo.
</p></dd></dl>
<hr size="6">
<a name="Sheet-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Global-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Page-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Options" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Sheet-Options-1"></a>
<h3 class="subsection">3.1.3 Sheet Options</h3>
<p>This options specify the general layout, how the sheet should be used.
</p>
<dl>
<dt><a name="index-_002dM"></a><u>Option:</u> <b>-M</b><i> <var>medium</var></i></dt>
<dt><a name="index-_002d-12"></a><u>Option:</u> <b>-</b><i><b>-</b>medium=<var>medium</var></i></dt>
<dd><a name="index-libpaper"></a>
<a name="index-paperconf"></a>
<p>use output medium <var>medium</var>. See the output of ‘<samp>a2ps
--list=media</samp>’ for the list of supported media. Typical values are
‘<samp>A3</samp>’, ‘<samp>A4</samp>’, ‘<samp>A5</samp>’, ‘<samp>B4</samp>’, ‘<samp>B5</samp>’, ‘<samp>Letter</samp>’,
‘<samp>Legal</samp>’.
</p>
<p>‘<samp>A4dj</samp>’, ‘<samp>Letterdj</samp>’ are also defined for Desk Jet owners, since
that printer needs bigger margins.
</p>
<p>The special <var>medium</var> ‘<samp>libpaper</samp>’ means that you want a2psask the library <code>libpaper</code> for the medium to use. This choice is
valid only if <code>libpaper</code> was available when a2psSee the man page of <code>paperconf</code> for more information.
</p></dd></dl>
<dl>
<dt><a name="index-_002dr"></a><u>Option:</u> <b>-r</b></dt>
<dt><a name="index-_002d-13"></a><u>Option:</u> <b>-</b><i><b>-</b>landscape</i></dt>
<dd><p>print in landscape mode
</p></dd></dl>
<dl>
<dt><a name="index-_002dR"></a><u>Option:</u> <b>-R</b></dt>
<dt><a name="index-_002d-14"></a><u>Option:</u> <b>-</b><i><b>-</b>portrait</i></dt>
<dd><p>print in portrait mode
</p></dd></dl>
<dl>
<dt><a name="index-_002d-15"></a><u>Option:</u> <b>-</b><i><b>-</b>columns=<var>num</var></i></dt>
<dd><p>specify the number of columns of virtual pages per physical page.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-16"></a><u>Option:</u> <b>-</b><i><b>-</b>rows=<var>num</var></i></dt>
<dd><p>specify the number of rows of virtual pages per physical page.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-17"></a><u>Option:</u> <b>-</b><i><b>-</b>major=<var>direction</var></i></dt>
<dd><p>specify whether the virtual pages should be first filled in rows
(<var>direction</var> = ‘<samp>rows</samp>’) or in columns (<var>direction</var> =
‘<samp>columns</samp>’).
</p></dd></dl>
<dl>
<dt><a name="index-_002d1"></a><u>Option:</u> <b>-1</b></dt>
<dd><p>1 x 1 portrait, 80 chars/line, major rows (i.e. alias for ‘<samp>--columns=1 --rows=1 --portrait --chars-per-line=80 --major=rows</samp>’).
</p></dd></dl>
<dl>
<dt><a name="index-_002d2"></a><u>Option:</u> <b>-2</b></dt>
<dd><p>2 x 1 landscape, 80 chars/line, major rows.
</p></dd></dl>
<dl>
<dt><a name="index-_002d3"></a><u>Option:</u> <b>-3</b></dt>
<dd><p>3 x 1 landscape, 80 chars/line, major rows.
</p></dd></dl>
<dl>
<dt><a name="index-_002d4"></a><u>Option:</u> <b>-4</b></dt>
<dd><p>2 x 2 portrait, 80 chars/line, major rows.
</p></dd></dl>
<dl>
<dt><a name="index-_002d5"></a><u>Option:</u> <b>-5</b></dt>
<dd><p>5 x 1 landscape, 80 chars/line, major rows.
</p></dd></dl>
<dl>
<dt><a name="index-_002d6"></a><u>Option:</u> <b>-6</b></dt>
<dd><p>3 x 2 landscape, 80 chars/line, major rows.
</p></dd></dl>
<dl>
<dt><a name="index-_002d7"></a><u>Option:</u> <b>-7</b></dt>
<dd><p>7 x 1 landscape, 80 chars/line, major rows.
</p></dd></dl>
<dl>
<dt><a name="index-_002d8"></a><u>Option:</u> <b>-8</b></dt>
<dd><p>4 x 2 landscape, 80 chars/line, major rows.
</p></dd></dl>
<dl>
<dt><a name="index-_002d9"></a><u>Option:</u> <b>-9</b></dt>
<dd><p>3 x 3 portrait, 80 chars/line, major rows.
</p></dd></dl>
<dl>
<dt><a name="index-_002dj"></a><u>Option:</u> <b>-j</b></dt>
<dt><a name="index-_002d-18"></a><u>Option:</u> <b>-</b><i><b>-</b>borders=<var>boolean</var></i></dt>
<dd><p>print borders around virtual pages.
</p></dd></dl>
<dl>
<dt><a name="index-_002dA"></a><u>Option:</u> <b>-A</b><i> <var>mode</var></i></dt>
<dt><a name="index-_002d-19"></a><u>Option:</u> <b>-</b><i><b>-</b>file-align=<var>mode</var></i></dt>
<dd><p>Align separate files according to <var>mode</var>. This option allows the
printing of more than one file on the same page. <var>mode</var> can be any
one of:
</p><dl compact="compact">
<dt> ‘<samp>virtual</samp>’</dt>
<dd><p>Each file starts on the next available virtual page (i.e., leave no
empty virtuals).
</p>
</dd>
<dt> ‘<samp>rank</samp>’</dt>
<dd><p>Each file starts at the beginning of the next row or column depending on
the ‘<samp>--major</samp>’ setting.
</p>
</dd>
<dt> ‘<samp>page</samp>’</dt>
<dd><p>Each file starts on a new page.
</p>
</dd>
<dt> ‘<samp>sheet</samp>’</dt>
<dd><p>Each file starts on a new sheet. In Simplex mode, this is the same as
‘<samp>page</samp>’, in Duplex mode, files always start on a front side.
</p>
</dd>
<dt> an integer <var>num</var></dt>
<dd><p>Each file starts on a page which is a multiple of <var>num</var> plus 1. For
instance, for ‘<samp>2</samp>’, the files must start on odd pages.
</p></dd>
</dl>
</dd></dl>
<dl>
<dt><a name="index-_002d-20"></a><u>Option:</u> <b>-</b><i><b>-</b>margin[=<var>num</var>]</i></dt>
<dd><p>Specify the size of the margin (<var>num</var> 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.
</p></dd></dl>
<hr size="6">
<a name="Page-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Sheet-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Headings-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Options" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Page-Options-1"></a>
<h3 class="subsection">3.1.4 Page Options</h3>
<p>This options are related to the content of the virtual pages.
</p>
<p>Please note that the options ‘<samp>-f</samp>’, ‘<samp>-L</samp>’, ‘<samp>-l</samp>’, ‘<samp>-m</samp>’,
and ‘<samp>-1</samp>’ .. ‘<samp>-9</samp>’ all have an influence on the font size. Only
the last one will win (i.e., ‘<samp>a2ps -L66 -l80</samp>’ is the same as
‘<samp>a2ps -l80</samp>’).
</p>
<dl>
<dt><a name="index-_002d-21"></a><u>Option:</u> <b>-</b><i><b>-</b>line-numbers[=<var>number</var>]</i></dt>
<dd><p>print the line numbers from <var>number</var> lines to <var>number</var> lines.
Default is ‘<samp>1</samp>’.
</p></dd></dl>
<dl>
<dt><a name="index-_002dC"></a><u>Option:</u> <b>-C</b></dt>
<dd><p>Alias for ‘<samp>--line-numbers=5</samp>’.
</p></dd></dl>
<dl>
<dt><a name="index-_002df"></a><u>Option:</u> <b>-f</b><i> <var>size</var>[<var>unit</var>]</i></dt>
<dt><a name="index-_002d-22"></a><u>Option:</u> <b>-</b><i><b>-</b>font-size=<var>size</var>[<var>unit</var>]</i></dt>
<dd><p>scale font to <var>size</var> for body text. <var>size</var> is a float number,
and <var>unit</var> can be ‘<samp>cm</samp>’ for centimeters, ‘<samp>points</samp>’ for
PostScript points, and ‘<samp>in</samp>’ for inches. Default unit in
‘<samp>points</samp>’.
</p>
<p>To change the fonts used, change the current prologue (see section <a href="#Designing-PostScript-Prologues">Designing PostScript Prologues</a>.
</p></dd></dl>
<dl>
<dt><a name="index-_002dl"></a><u>Option:</u> <b>-l</b><i> <var>num</var></i></dt>
<dt><a name="index-_002d-23"></a><u>Option:</u> <b>-</b><i><b>-</b>chars-per-line=<var>num</var></i></dt>
<dd><p>Set the font size so that <var>num</var> columns appear per virtual pages.
<var>num</var> is the real number of columns devoted to the body of the text,
i.e., no matter whether lines are numbered or not.
</p></dd></dl>
<dl>
<dt><a name="index-_002dL"></a><u>Option:</u> <b>-L</b><i> <var>num</var></i></dt>
<dt><a name="index-_002d-24"></a><u>Option:</u> <b>-</b><i><b>-</b>lines-per-page=<var>num</var></i></dt>
<dd><p>Set the font size so that <var>num</var> 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.
</p></dd></dl>
<dl>
<dt><a name="index-_002dm"></a><u>Option:</u> <b>-m</b></dt>
<dt><a name="index-_002d-25"></a><u>Option:</u> <b>-</b><i><b>-</b>catman</i></dt>
<dd><p>Understand UNIX manual <strong>output</strong> ie: 66 lines per page and
possible bolding and underlining sequences. The understanding of
bolding and underlining is there by default even if ‘<samp>--catman</samp>’ is
not specified. You may want to use the ‘<samp>ul</samp>’ prologue (See section <a href="#Input-Options">Input Options</a>, option ‘<samp>--prologue</samp>’) if you prefer underlining over
italics.
</p>
<p>If your file is actually a UNIX manual <em>input</em>, i.e., a roff file,
then depending whether you left a2psreadable version of the text described, or a pretty-printed version of
the describing file (see section <a href="#Your-Delegations">Your Delegations</a>).
</p></dd></dl>
<dl>
<dt><a name="index-_002dT"></a><u>Option:</u> <b>-T</b><i> <var>num</var></i></dt>
<dt><a name="index-_002d-26"></a><u>Option:</u> <b>-</b><i><b>-</b>tabsize=<var>num</var></i></dt>
<dd><p>set tabulator size to <var>num</var>. This option is ignored if
<code>--interpret=no</code> is given.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-27"></a><u>Option:</u> <b>-</b><i><b>-</b>non-printable-format=<var>format</var></i></dt>
<dd><p>specify how non-printable chars are printed. <var>format</var> can be
</p><dl compact="compact">
<dt> ‘<samp>caret</samp>’</dt>
<dd><p>Use classical Unix representation: ‘<samp>^A</samp>’, ‘<samp>M-^B</samp>’ etc.
</p>
</dd>
<dt> ‘<samp>space</samp>’</dt>
<dd><p>A space is written instead of the non-printable character.
</p>
</dd>
<dt> ‘<samp>question-mark</samp>’</dt>
<dd><p>A ‘<samp>?</samp>’ is written instead of the non-printable character.
</p>
</dd>
<dt> ‘<samp>octal</samp>’</dt>
<dd><p>For instance ‘<samp>\001</samp>’, ‘<samp>177</samp>’ etc.
</p>
</dd>
<dt> ‘<samp>hexa</samp>’</dt>
<dd><p>For instance ‘<samp>\x01</samp>’, ‘<samp>\xfe</samp>’ etc.
</p>
</dd>
<dt> ‘<samp>emacs</samp>’</dt>
<dd><p>For instance ‘<samp>C-h</samp>’, ‘<samp>M-C-c</samp>’ etc.
</p></dd>
</dl>
</dd></dl>
<hr size="6">
<a name="Headings-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Page-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Input-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Options" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Headings-Options-1"></a>
<h3 class="subsection">3.1.5 Headings Options</h3>
<a name="index-Headers"></a>
<p>These are the options through which you may define the information you
want to see all around the pages.
</p>
<p>All these options support <var>text</var> as an argument, which is composed
of plain strings and escapes. See section <a href="#Escapes">Escapes</a>, for details.
</p>
<dl>
<dt><a name="index-_002dB"></a><u>Option:</u> <b>-B</b></dt>
<dt><a name="index-_002d-28"></a><u>Option:</u> <b>-</b><i><b>-</b>no-header</i></dt>
<dd><p>no page headers at all.
</p></dd></dl>
<dl>
<dt><a name="index-_002db"></a><u>Option:</u> <b>-b</b><i>[<var>text</var>]</i></dt>
<dt><a name="index-_002d-29"></a><u>Option:</u> <b>-</b><i><b>-</b>header[=<var>text</var>]</i></dt>
<dd><p>set the page header
</p></dd></dl>
<dl>
<dt><a name="index-_002d-30"></a><u>Option:</u> <b>-</b><i><b>-</b>center-title[=<var>text</var>]</i></dt>
<dt><a name="index-_002d-31"></a><u>Option:</u> <b>-</b><i><b>-</b>left-title[=<var>text</var>]</i></dt>
<dt><a name="index-_002d-32"></a><u>Option:</u> <b>-</b><i><b>-</b>right-title[=<var>text</var>]</i></dt>
<dd><p>Set virtual page center, left and right titles to <var>text</var>.
</p></dd></dl>
<dl>
<dt><a name="index-_002du"></a><u>Option:</u> <b>-u</b><i>[<var>text</var>]</i></dt>
<dt><a name="index-_002d-33"></a><u>Option:</u> <b>-</b><i><b>-</b>underlay[=<var>text</var>]</i></dt>
<dd><a name="index-Under-lay"></a>
<a name="index-Water-mark"></a>
<p>use <var>text</var> as <em>under lay</em> (or <em>water mark</em>), i.e., in a
light gray, and under every page.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-34"></a><u>Option:</u> <b>-</b><i><b>-</b>left-footer[=<var>text</var>]</i></dt>
<dt><a name="index-_002d-35"></a><u>Option:</u> <b>-</b><i><b>-</b>footer[=<var>text</var>]</i></dt>
<dt><a name="index-_002d-36"></a><u>Option:</u> <b>-</b><i><b>-</b>right-footer[=<var>text</var>]</i></dt>
<dd><p>Set sheet footers to <var>text</var>.
</p></dd></dl>
<hr size="6">
<a name="Input-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Headings-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Print-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Options" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Input-Options-1"></a>
<h3 class="subsection">3.1.6 Input Options</h3>
<dl>
<dt><a name="index-_002da"></a><u>Option:</u> <b>-a</b><i>[<var>Page range</var>]</i></dt>
<dt><a name="index-_002d-37"></a><u>Option:</u> <b>-</b><i><b>-</b>pages[=<var>Page range</var>]</i></dt>
<dd><a name="index-Page-Range"></a>
<p>With no argument, print all the page, otherwise select the pages to
print. <var>Page range</var> is a list of interval, such as ‘<samp>-a1</samp>’:
print only the first page, ‘<samp>-a-3,4,6,10-</samp>’: print the first 3 pages,
page 4 and 6, and all the page after 10 (included). Giving ‘<samp>toc</samp>’
prints the table of content whatever its page number is.
</p>
<p>The pages referred to are the <em>input</em> pages, not the output pages,
that is, in ‘<samp>-2</samp>’, printing with ‘<samp>-a1</samp>’ will print the first
virtual page, i.e., you will get half the page filled.
</p>
<p>Note that page selection does work with the delegations (see section <a href="#Your-Delegations">Your Delegations</a>).
</p></dd></dl>
<dl>
<dt><a name="index-_002dc"></a><u>Option:</u> <b>-c</b></dt>
<dt><a name="index-_002d-38"></a><u>Option:</u> <b>-</b><i><b>-</b>truncate-lines=<var>boolean</var></i></dt>
<dd><p>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.
</p></dd></dl>
<dl>
<dt><a name="index-_002di"></a><u>Option:</u> <b>-i</b></dt>
<dt><a name="index-_002d-39"></a><u>Option:</u> <b>-</b><i><b>-</b>interpret=<var>boolean</var></i></dt>
<dd><p>interpret tab and ff chars. This means that ‘<samp>^L</samp>’ jumps to a new
(virtual) pages, ‘<samp>tab</samp>’ advances to the next tabulation.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-40"></a><u>Option:</u> <b>-</b><i><b>-</b>end-of-line=<var>type</var></i></dt>
<dd><p>Specify what sequence of characters denotes the end of line. <var>type</var>
can be:
</p><dl compact="compact">
<dt> <code>n</code></dt>
<dt> <code>unix</code></dt>
<dd><p>‘<samp>\n</samp>’.
</p>
</dd>
<dt> <code>r</code></dt>
<dt> <code>mac</code></dt>
<dd><p>‘<samp>\r</samp>’.
</p>
</dd>
<dt> <code>nr</code></dt>
<dd><p>‘<samp>\n\r</samp>’.
As far as we know, this type of end-of-line is not used.
</p>
</dd>
<dt> <code>pc</code></dt>
<dt> <code>rn</code></dt>
<dd><p>‘<samp>\r\n</samp>’. This is the type of end-of-line on MS-DOS.
</p>
</dd>
<dt> <code>any</code></dt>
<dt> <code>auto</code></dt>
<dd><p>Any of the previous cases. This last case prevents the bad surprises
with files from PC (trailing ‘<samp>^M</samp>’).
</p></dd>
</dl>
</dd></dl>
<dl>
<dt><a name="index-_002dX"></a><u>Option:</u> <b>-X</b><i> <var>key</var></i></dt>
<dt><a name="index-_002d-41"></a><u>Option:</u> <b>-</b><i><b>-</b>encoding=<var>key</var></i></dt>
<dd><a name="index-Encoding"></a>
<p>Use the input encoding identified by <var>key</var>. See section <a href="#Some-Encodings">Some Encodings</a>,
and the result of
‘<samp>a2ps --list=encodings</samp>’ to know what encodings are supported.
Typical values are ‘<samp>ASCII</samp>’, ‘<samp>latin1</samp>’... ‘<samp>latin6</samp>’,
‘<samp>iso<var>n</var></samp>’ etc.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-42"></a><u>Option:</u> <b>-</b><i><b>-</b>stdin=<var>filename</var></i></dt>
<dd><p>Give the name <var>filename</var> to the files read through the standard
input.
</p></dd></dl>
<dl>
<dt><a name="index-_002dt"></a><u>Option:</u> <b>-t</b><i> <var>name</var></i></dt>
<dt><a name="index-_002d-43"></a><u>Option:</u> <b>-</b><i><b>-</b>title=<var>name</var></i></dt>
<dd><p>Give the name <var>name</var> to the document. Escapes can be used
(see section <a href="#Escapes">Escapes</a>).
</p>
<p>This is used for instance in the name given to the document from within
the PostScript code (so that <code>Ghostview</code> and others can display a
file with its real title, instead of just the PostScript file name).
</p>
<p>It is <strong>not</strong> the name of the output. It is just a logical title.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-44"></a><u>Option:</u> <b>-</b><i><b>-</b>prologue=<var>prologue</var></i></dt>
<dd><a name="index-Prologue"></a>
<p>Use <var>prologue</var> as the PostScript prologue for a2ps@c.
<var>prologue</var> must be in a file named ‘<tt><var>prologue</var>.pro</tt>’, which
must be in a directory of your library path (see section <a href="#Library-Files">Library Files</a>).
Available prologues are:
</p><dl compact="compact">
<dt> ‘<samp>bold</samp>’</dt>
<dd><p>This style is meant to replace the old option <code>-b</code> of a2ps 4.3.
It is a copy of the black and white prologue, but in which all the fonts
are in Bold.
</p>
</dd>
<dt> ‘<samp>bw</samp>’</dt>
<dd><p>Style is plain: pure black and white, with standard fonts.
</p>
</dd>
<dt> ‘<samp>color</samp>’</dt>
<dd><p>Colors are used to highlight the keywords.
</p>
</dd>
<dt> ‘<samp>diff</samp>’</dt>
<dd><p>This style is meant to be used with the <code>udiff</code>, <code>wdiff</code>
style sheets, to underline the differences. New things are in bold
on a diff background, while removed sequences are in italic.
</p>
</dd>
<dt> ‘<samp>fixed</samp>’</dt>
<dd><p>This style uses exclusively fixed size fonts. You should use this style
if you want the tabulations to be properly printed.
</p>
<p>There are no means to use a fixed size Symbol font, therefore you should
not use the heavy highlighting style.
</p>
</dd>
<dt> ‘<samp>gray</samp>’</dt>
<dd><p>Gray background is used for comments and labels.
</p>
</dd>
<dt> ‘<samp>gray2</samp>’</dt>
<dd><p>Black background is used for comments and labels.
</p>
</dd>
<dt> ‘<samp>matrix</samp>’</dt>
<dd><p>The layout is the same as ‘<samp>bw</samp>’, but alternating gray and white lines.
There are two macros defining the behavior:
‘<samp>pro.matrix.cycle</samp>’ defines the length of the cycle (number of white
and gray lines). It defaults to 6.
‘<samp>pro.matrix.gray</samp>’ defines the number of gray lines. Default is 3.
</p>
</dd>
<dt> ‘<samp>ul</samp>’</dt>
<dd><p>This style uses bold faces and underlines, but never italics. This is
particularly meant for printing formatted man pages.
</p>
</dd>
</dl>
</dd></dl>
<dl>
<dt><a name="index-_002d-45"></a><u>Option:</u> <b>-</b><i><b>-</b>print-anyway=<var>boolean</var></i></dt>
<dd><p>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<code>file(1)</code> what it thinks of the type of the file. If <code>file(1)</code>
answers ‘<samp>data</samp>’, the file will also be considered as binary, hence
not printed.
</p></dd></dl>
<dl>
<dt><a name="index-_002dZ"></a><u>Option:</u> <b>-Z</b></dt>
<dt><a name="index-_002d-46"></a><u>Option:</u> <b>-</b><i><b>-</b>delegate=<var>boolean</var></i></dt>
<dd><p>Enable delegation of some files to delegated applications. If
delegating is on, then a2psbut will call an application which handles the file in another way. If
delegation is off, then a2ps</p>
<p>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.
</p>
<p>See <a href="#Your-Delegations">Your Delegations</a> for information on delegating, and option
‘<samp>--list=delegations</samp>’ for the applications your a2ps</p></dd></dl>
<dl>
<dt><a name="index-_002d-47"></a><u>Option:</u> <b>-</b><i><b>-</b>toc[=<var>format</var>]</i></dt>
<dd><p>Generate a Table of Contents, which <var>format</var> is an escape
(see section <a href="#Escapes">Escapes</a>) processed as a PreScript file (see section <a href="#PreScript">PreScript</a>). If
no <var>format</var> is given (i.e., you wrote ‘<samp>--toc</samp>’), use the default
table of contents shape (<code>#{toc}</code>). If the given format is empty
(i.e., you wrote ‘<samp>--toc=</samp>’), don’t issue the table of contents.
</p>
<p>Note that it is most useful to define a variable (see section <a href="#Your-Variables">Your Variables</a>), for instance, in a configuration file:
</p>
<table><tr><td> </td><td><pre class="example">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
</pre></td></tr></table>
<p>and to give that variable as argument to ‘<samp>--toc</samp>’: ‘<samp>a2ps
*.c --toc=#{toc.mine}</samp>’.
</p>
<p>Note too that you can generate only the table of content using
‘<samp>--pages</samp>’:
</p><table><tr><td> </td><td><pre class="example">a2ps *.c --toc -atoc
</pre></td></tr></table>
</dd></dl>
<hr size="6">
<a name="Pretty-Print-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Input-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Output-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Options" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Pretty-Printing-Options"></a>
<h3 class="subsection">3.1.7 Pretty Printing Options</h3>
<p>These options are related to the pretty printing features of a2ps@c.
</p>
<dl>
<dt><a name="index-_002d-48"></a><u>Option:</u> <b>-</b><i><b>-</b>highlight-level=<var>level</var></i></dt>
<dd><p>Specify the <var>level</var> of highlighting. <var>level</var> can be
</p><dl compact="compact">
<dt> ‘<samp>none</samp>’</dt>
<dd><p>no highlighting
</p>
</dd>
<dt> ‘<samp>normal</samp>’</dt>
<dd><p>regular highlighting
</p>
</dd>
<dt> ‘<samp>heavy</samp>’</dt>
<dd><p>even more highlighting.
</p></dd>
</dl>
<p>See the documentation of the style sheets (‘<samp>--list=style-sheets</samp>’)
for a description of ‘<samp>heavy</samp>’ highlighting.
</p></dd></dl>
<dl>
<dt><a name="index-_002dg"></a><u>Option:</u> <b>-g</b></dt>
<dd><p>Alias for ‘<samp>--highlight-level=heavy</samp>’.
</p></dd></dl>
<dl>
<dt><a name="index-_002dE"></a><u>Option:</u> <b>-E</b><i> [<var>language</var>]</i></dt>
<dt><a name="index-_002d-49"></a><u>Option:</u> <b>-</b><i><b>-</b>pretty-print[=<var>language</var>]</i></dt>
<dd><p>With no arguments, set automatic style selection on. Otherwise, set
style to <var>language</var>. Note that setting <var>language</var> to
‘<samp>plain</samp>’ turns off pretty-printing. See section <a href="#Known-Style-Sheets">Known Style Sheets</a>, and the
output of ‘<samp>--list=style-sheets</samp>’ for the available style sheets.
</p>
<p>If <var>language</var> is ‘<samp><var>key</var>.ssh</samp>’, then don’t look in the
library path, but use the file ‘<tt><var>key.ssh</var></tt>’. This is to ease
debugging non installed style sheets.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-50"></a><u>Option:</u> <b>-</b><i><b>-</b>strip-level=<var>num</var></i></dt>
<dd><p>Depending on the value of <var>num</var>:
</p><dl compact="compact">
<dt> ‘<samp>0</samp>’</dt>
<dd><p>everything is printed;
</p></dd>
<dt> ‘<samp>1</samp>’</dt>
<dd><p>regular comments are not printed
</p></dd>
<dt> ‘<samp>2</samp>’</dt>
<dd><p>strong comments are not printed
</p></dd>
<dt> ‘<samp>3</samp>’</dt>
<dd><p>no comment is printed.
</p></dd>
</dl>
<p>This option is valuable for instance in <code>java</code> in which case strong
comments are the so called documentation comments, or in <code>SDL</code> for
which some graphical editors pollutes the specification with internal
data as comments.
</p>
<p>Note that the current implementation is not satisfactory: some undesired
blank lines remain. This is planed to be fixed.
</p></dd></dl>
<hr size="6">
<a name="Output-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Pretty-Print-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Options" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Output-Options-1"></a>
<h3 class="subsection">3.1.8 Output Options</h3>
<p>These are the options to specify what you want to do out of what a2psproduces. Only a single destination is possible at a time, i.e., if
ever there are several options ‘<samp>-o</samp>’, ‘<samp>-P</samp>’ or ‘<samp>-d</samp>’, the
last one is honored.
</p>
<dl>
<dt><a name="index-_002do"></a><u>Option:</u> <b>-o</b><i> <var>file</var></i></dt>
<dt><a name="index-_002d-51"></a><u>Option:</u> <b>-</b><i><b>-</b>output=<var>file</var></i></dt>
<dd><p>leave output to file <var>file</var>. If <var>file</var> is ‘<samp>-</samp>’, leave
output to the standard output.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-52"></a><u>Option:</u> <b>-</b><i><b>-</b>version-control=<var>type</var></i></dt>
<dd><p>to avoid loosing a file, a2pswhen the output file already exists, is regular (that is, no backup is
done on special files such as ‘<tt>/dev/null</tt>’), and is writable (in
this case, disabling version control makes a2psas if version control was disabled: permission denied).
</p>
<p>The type of backups made can be set with the <code>VERSION_CONTROL</code>
environment variable, which can be overridden by this option. If
<code>VERSION_CONTROL</code> is not set and this option is not given, the
default backup type is ‘existing’. The value of the
<code>VERSION_CONTROL</code> environment variable and the argument to this
option are like the GNU <code>Emacs</code> ‘<samp>version-control</samp>’ variable;
they also recognize synonyms that are more descriptive. The valid
values are (unique abbreviations are accepted):
</p><dl compact="compact">
<dt> ‘<samp>none</samp>’</dt>
<dt> ‘<samp>off</samp>’</dt>
<dd><p>Never make backups (override existing files).
</p>
</dd>
<dt> ‘<samp>t</samp>’</dt>
<dt> ‘<samp>numbered</samp>’</dt>
<dd><p>Always make numbered backups.
</p>
</dd>
<dt> ‘<samp>nil</samp>’</dt>
<dt> ‘<samp>existing</samp>’</dt>
<dd><p>Make numbered backups of files that already have them, simple backups of
the others.
</p>
</dd>
<dt> ‘<samp>never</samp>’</dt>
<dt> ‘<samp>simple</samp>’</dt>
<dd><p>Always make simple backups.
</p></dd>
</dl>
</dd></dl>
<dl>
<dt><a name="index-_002d-53"></a><u>Option:</u> <b>-</b><i><b>-</b>suffix=<var>suffix</var></i></dt>
<dd><p>The suffix used for making simple backup files can be set with the
<code>SIMPLE_BACKUP_SUFFIX</code> environment variable, which can be
overridden by this option. If neither of those is given, the default is
‘<samp>~</samp>’, as it is in <code>Emacs</code>.
</p></dd></dl>
<dl>
<dt><a name="index-_002dP"></a><u>Option:</u> <b>-P</b><i> <var>name</var></i></dt>
<dt><a name="index-_002d-54"></a><u>Option:</u> <b>-</b><i><b>-</b>printer=<var>name</var></i></dt>
<dd><a name="index-lp_002eoptions"></a>
<p>send output to printer <var>name</var>. See item ‘<samp>Printer:</samp>’ and
‘<samp>Unknown printer:</samp>’ in <a href="#Your-Printers">Your Printers</a> and results of option
‘<samp>--list=defaults</samp>’ to see the bindings between printer names and
commands.
</p>
<p>It is possible to pass additional options to <code>lpr</code> or <code>lp</code> via
the variable ‘<samp>lp.options</samp>’, for more information see <a href="#Pass-Options-to-lpr">How Can I Pass Options to ‘<samp>lpr</samp>’</a>.
</p></dd></dl>
<dl>
<dt><a name="index-_002dd"></a><u>Option:</u> <b>-d</b></dt>
<dd><p>send output to the default printer. See item ‘<samp>DefaultPrinter:</samp>’ in
<a href="#Your-Printers">Your Printers</a>.
</p></dd></dl>
<hr size="6">
<a name="PostScript-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Output-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Escapes" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Options" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="PostScript-Options-1"></a>
<h3 class="subsection">3.1.9 PostScript Options</h3>
<p>The following options are related only to variations you want to produce
onto a PostScript output.
</p>
<dl>
<dt><a name="index-_002d-55"></a><u>Option:</u> <b>-</b><i><b>-</b>ppd[=<var>key</var>]</i></dt>
<dd><p>With no argument, set automatic PPD selection, otherwise set
the PPD to <var>key</var>.
FIXME: what to read.
</p></dd></dl>
<dl>
<dt><a name="index-_002dn"></a><u>Option:</u> <b>-n</b><i> <var>num</var></i></dt>
<dt><a name="index-_002d-56"></a><u>Option:</u> <b>-</b><i><b>-</b>copies=<var>num</var></i></dt>
<dd><p>print <var>num</var> copies of each page
</p></dd></dl>
<dl>
<dt><a name="index-_002ds"></a><u>Option:</u> <b>-s</b><i> <var>duplex-mode</var></i></dt>
<dt><a name="index-_002d-57"></a><u>Option:</u> <b>-</b><i><b>-</b>sides=<var>duplex-mode</var></i></dt>
<dd><a name="index-Duplex"></a>
<p>Specify the number of sheet sides, or, more generally, the Duplex mode
(see section <a href="#Glossary">Glossary</a>). The valid values for <var>duplex-mode</var> are:
</p><dl compact="compact">
<dt> ‘<samp>1</samp>’</dt>
<dt> ‘<samp>simplex</samp>’</dt>
<dd><p>One page per sheet.
</p>
</dd>
<dt> ‘<samp>2</samp>’</dt>
<dt> ‘<samp>duplex</samp>’</dt>
<dd><p>Two pages per sheet, DuplexNoTumble mode.
</p>
</dd>
<dt> ‘<samp>tumble</samp>’</dt>
<dd><p>Two pages per sheet, DuplexTumble mode.
</p></dd>
</dl>
<p>Not only does this option require Duplex from the printer, but it also
enables duplex features from a2pspages to back pages etc.).
</p></dd></dl>
<dl>
<dt><a name="index-_002dS"></a><u>Option:</u> <b>-S</b><i> <var>key</var>[:<var>value</var>]</i></dt>
<dt><a name="index-_002d-58"></a><u>Option:</u> <b>-</b><i><b>-</b>setpagedevice=<var>key</var>[:<var>value</var>]</i></dt>
<dd><a name="index-setpagedevice"></a>
<a name="index-Page-device"></a>
<p>Pass a page device definition to the generated PostScript output. If no
<var>value</var> is given, <var>key</var> is removed from the definitions.
Note that several ‘<samp>--setpagedevice</samp>’ can be accumulated.
</p>
<p>For example, command
</p>
<table><tr><td> </td><td><pre class="example">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
</pre></td></tr></table>
<p>prints file ‘<tt>report.pre</tt>’ in duplex (two sides) tumble (suitable for
landscape documents). This is also valid for delegated files:
</p><table><tr><td> </td><td><pre class="example">a2ps -SDuplex:true -STumble:true a2ps.texi
</pre></td></tr></table>
<p>Page device operators are implementation dependent but they are
standardized. See section <a href="#Page-Device-Options">Page Device Options</a>, for details.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-59"></a><u>Option:</u> <b>-</b><i><b>-</b>statusdict=<var>key</var>[:<var>value</var>]</i></dt>
<dt><a name="index-_002d-60"></a><u>Option:</u> <b>-</b><i><b>-</b>statusdict=<var>key</var>[::<var>value</var>]</i></dt>
<dd><a name="index-statusdict"></a>
<p>Pass a statusdict definition to the generated PostScript output.
<code>statusdict</code> operators and variables are implementation dependent;
see the documentation of your printer for details. See section <a href="#Statusdict-Options">Statusdict Options</a>, for details. Several ‘<samp>--statusdict</samp>’ can be accumulated.
</p>
<p>If no <var>value</var> is given, <var>key</var> is removed from the definitions.
</p>
<p>With a single colon, pass a call to an operator, for instance:
</p>
<table><tr><td> </td><td><pre class="example">a2ps --statusdict=setpapertray:1 quicksort.c
</pre></td></tr></table>
<p>prints file ‘<tt>quicksort.c</tt>’ by using paper from the paper tray 1
(assuming that printer supports paper tray selection).
</p>
<p>With two colons, define variable <var>key</var> to equal <var>value</var>. For
instance:
</p>
<table><tr><td> </td><td><pre class="example">a2ps --statusdict=papertray::1 quicksort.c
</pre></td></tr></table>
<p>produces
</p>
<table><tr><td> </td><td><pre class="example"> /papertray 1 def
</pre></td></tr></table>
<p>in the PostScript.
</p></dd></dl>
<dl>
<dt><a name="index-_002dk"></a><u>Option:</u> <b>-k</b></dt>
<dt><a name="index-_002d-61"></a><u>Option:</u> <b>-</b><i><b>-</b>page-prefeed</i></dt>
<dd><a name="index-Page-prefeed"></a>
<p>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.
</p>
<p>a2psprinters won’t fail.
</p></dd></dl>
<dl>
<dt><a name="index-_002dK"></a><u>Option:</u> <b>-K</b></dt>
<dt><a name="index-_002d-62"></a><u>Option:</u> <b>-</b><i><b>-</b>no-page-prefeed</i></dt>
<dd><p>disable page prefeeding.
</p></dd></dl>
<hr size="6">
<a name="Escapes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#PostScript-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Use-of-Escapes" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Escapes-1"></a>
<h2 class="section">3.2 Escapes</h2>
<a name="index-Escapes"></a>
<p>The escapes are some sequences of characters that will be replaced
by their values. They are very much like variables.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Use-of-Escapes">3.2.1 Use of Escapes</a></td><td> </td><td align="left" valign="top"> Where they are used
</td></tr>
<tr><td align="left" valign="top"><a href="#Structure-of-the-Escapes">3.2.2 General Structure of the Escapes</a></td><td> </td><td align="left" valign="top"> Their syntax
</td></tr>
<tr><td align="left" valign="top"><a href="#Available-Escapes">3.2.3 Available Escapes</a></td><td> </td><td align="left" valign="top"> Detailed list
</td></tr>
</table>
<hr size="6">
<a name="Use-of-Escapes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Escapes" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Structure-of-the-Escapes" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Escapes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Use-of-Escapes-1"></a>
<h3 class="subsection">3.2.1 Use of Escapes</h3>
<p>They are used in several places in a2ps@c:
</p><dl compact="compact">
<dt> <em>Page markers</em></dt>
<dd><p>Headers, footers, titles and the water mark (see section <a href="#Headings-Options">Headings Options</a>),
in general to print the name of file, page number etc. On a new sheet
a2psthen 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., ‘<samp>$l.</samp>’, ‘<samp>$l^</samp>’).
</p>
</dd>
<dt> <em>Named output</em></dt>
<dd><p>To specify the generic name of the file to produce, or how to access a
printer (see section <a href="#Your-Printers">Your Printers</a>).
</p>
</dd>
<dt> <em>Delegation</em></dt>
<dd><p>To specify the command associated to a delegation (see section <a href="#Your-Delegations">Your Delegations</a>).
</p>
</dd>
<dt> <em>Table of Content</em></dt>
<dd><p>To specify an index/table of content printed at the end of the job.
</p>
</dd>
<dt> <em>Variables in PostScript prologue</em></dt>
<dd><p>To allow the user to change some parameters to your prologues
(see section <a href="#Designing-PostScript-Prologues">Designing PostScript Prologues</a>).
</p></dd>
</dl>
<hr size="6">
<a name="Structure-of-the-Escapes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Use-of-Escapes" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Available-Escapes" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Escapes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="General-Structure-of-the-Escapes"></a>
<h3 class="subsection">3.2.2 General Structure of the Escapes</h3>
<p>All format directives can also be given in format
</p>
<p><var>escape</var> <var>width</var> <var>directive</var>
</p>
<p>where
</p><dl compact="compact">
<dt> <var>escape</var></dt>
<dd><p>In general
</p><dl compact="compact">
<dt> ‘<samp>%</samp>’</dt>
<dd><p>escapes are related to general information (e.g., the current
date, the user’s name etc.),
</p>
</dd>
<dt> ‘<samp>#</samp>’</dt>
<dd><p>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.),
</p>
</dd>
<dt> ‘<samp>$</samp>’</dt>
<dd><p>escapes are related to the current input file (e.g., its name,
its current page number etc.),
</p>
</dd>
<dt> ‘<samp>\</samp>’</dt>
<dd><p>introduces classical escaping, or quoting, sequences (e.g., ‘<samp>\n</samp>’, ‘<samp>\f</samp>’
etc.).
</p></dd>
</dl>
</dd>
<dt> <var>width</var></dt>
<dd><p>Specifies the width of the column to which the escape is printed.
There are three forms for <var>width</var>
</p><dl compact="compact">
<dt> ‘<samp>+<var>padding</var><var>integer</var></samp>’</dt>
<dd><p>the result of the expansion is prefixed by the character <var>padding</var>
so that the whole result is as long as <var>integer</var>. For instance
‘<samp>$+.10n</samp>’ with a file name ‘<samp>$n</samp>’=‘<tt>foo.c</tt>’ gives
‘<samp>.....foo.c</samp>’.
</p>
<p>If no <var>padding</var> is given, ‘<samp> </samp>’ (white space) is used.
</p>
</dd>
<dt> ‘<samp>-<var>padding</var><var>integer</var></samp>’</dt>
<dd><p>Idem as above, except that completion is done on the left: ‘<samp>$+.10n</samp>’
gives ‘<samp>foo.c.....</samp>’.
</p>
</dd>
<dt> ‘<samp><var>integer</var></samp>’</dt>
<dd><p>which is a short cut for ‘<samp>+<var>integer</var></samp>’. For example, escape
‘<samp>$5P</samp>’ will expand to something like ‘<samp> 12</samp>’.
</p>
</dd>
</dl>
</dd>
<dt> <var>directive</var></dt>
<dd><p>See section <a href="#Available-Escapes">Available Escapes</a>.
</p></dd>
</dl>
<hr size="6">
<a name="Available-Escapes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Structure-of-the-Escapes" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Escapes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Available-Escapes-1"></a>
<h3 class="subsection">3.2.3 Available Escapes</h3>
<p>Supported escapes are:
</p><dl compact="compact">
<dt> ‘<samp>\\</samp>’</dt>
<dd><p>character ‘<samp>\</samp>’
</p>
</dd>
<dt> ‘<samp>\%</samp>’</dt>
<dd><p>character ‘<samp>%</samp>’
</p>
</dd>
<dt> ‘<samp>\$</samp>’</dt>
<dd><p>character ‘<samp>$</samp>’
</p>
</dd>
<dt> ‘<samp>\#</samp>’</dt>
<dd><p>character ‘<samp>#</samp>’
</p>
</dd>
<dt> ‘<samp>#?<var>cond</var>|<var>if_true</var>|<var>if_false</var>|</samp>’</dt>
<dd><p>this may be used for conditional assignment. The separator (presented
here as ‘<samp>|</samp>’) may be any character. <var>if_true</var> and
<var>if_false</var> may be defined exactly the same way as regular headers,
included escapes and the ‘<samp>#?</samp>’ construct.
</p>
<p>The available tests are:
</p><dl compact="compact">
<dt> ‘<samp>#?1</samp>’</dt>
<dt> ‘<samp>#?2</samp>’</dt>
<dt> ‘<samp>#?3</samp>’</dt>
<dd><p>true if tag 1, 2 or 3 is not empty. See item ‘<samp>$t1</samp>’ for
explanation.
</p>
</dd>
<dt> ‘<samp>#?d</samp>’</dt>
<dd><p>true if Duplex printing is requested (‘<samp>-s2</samp>’).
</p>
</dd>
<dt> ‘<samp>#?j</samp>’</dt>
<dd><p>true if bordering is asked (‘<samp>-j</samp>’).
</p>
</dd>
<dt> ‘<samp>#?l</samp>’</dt>
<dd><p>true if printing in landscape mode.
</p>
</dd>
<dt> ‘<samp>#?o</samp>’</dt>
<dd><p>true if only one virtual page per page (i.e., ‘<samp>#v</samp>’ is 1).
</p>
</dd>
<dt> ‘<samp>#?p</samp>’</dt>
<dd><p>a page range has been specified (i.e., ‘<samp>#p</samp>’ is not empty).
</p>
</dd>
<dt> ‘<samp>#?q</samp>’</dt>
<dd><p>true if a2ps</p>
</dd>
<dt> ‘<samp>#?r</samp>’</dt>
<dd><p>true if major is rows (‘<samp>--major=rows</samp>’).
</p>
</dd>
<dt> ‘<samp>#?v</samp>’</dt>
<dd><p>true if printing on the back side of the sheet (verso).
</p>
</dd>
<dt> ‘<samp>#?V</samp>’</dt>
<dd><p>true if verbosity level includes the ‘<samp>tools</samp>’ flag (See section <a href="#Global-Options">Global Options</a>. option ‘<samp>--verbosity</samp>’).
</p></dd>
</dl>
</dd>
<dt> ‘<samp>#!<var>key</var>|<var>in</var>|<var>between</var>|</samp>’</dt>
<dd><p>Used for enumerations. The separator (presented here as ‘<samp>|</samp>’) may
be any character. <var>in</var> and <var>between</var> are escapes.
</p>
<p>The enumerations may be:
</p><dl compact="compact">
<dt> ‘<samp>#!$</samp>’</dt>
<dd><p>enumeration of the command line options. In this case <var>in</var> in never
used, but is replaced by the arguments.
</p>
</dd>
<dt> ‘<samp>#!f</samp>’</dt>
<dd><p>enumeration of the input files in the other they were given.
</p>
</dd>
<dt> ‘<samp>#!F</samp>’</dt>
<dd><p>enumeration of the input files in the alphabetical order of their names.
</p>
</dd>
<dt> ‘<samp>#!s</samp>’</dt>
<dd><p>enumeration of the files appearing in the current sheet.
</p>
</dd>
</dl>
<p>For instance, the escapes ‘<samp>The files printed were: #!f|$n|,
|.</samp>’ evaluated with input ‘<samp>a2ps NEWS main.c -o foo.ps</samp>’, gives
‘<samp>The files printed were: NEWS, main.c.</samp>’.
</p>
<p>As an exception, ‘<samp>#!</samp>’ escapes use the <var>width</var> as the
maximum number of objects to enumerate if it is positive, e.g.,
‘<samp>#10!f|$n|, |</samp>’ lists only the ten first file names. If <var>width</var>
is negative, then it does not enumerate the -<var>width</var> last objects
(e.g., ‘<samp>#-1!f|$n|, |</samp>’ lists all the files but the last).
</p>
</dd>
<dt> ‘<samp>${<var>var</var>}</samp>’</dt>
<dd><p>value of the environment variable <var>var</var> if defined, nothing
otherwise.
</p>
</dd>
<dt> ‘<samp>${<var>var</var>:-<var>word</var>}</samp>’</dt>
<dd><p>if the environment variable <var>var</var> is defined, then its value,
otherwise <var>word</var>.
</p>
</dd>
<dt> ‘<samp>${<var>var</var>:+<var>word</var>}</samp>’</dt>
<dd><p>if the environment variable <var>var</var> is defined, then <var>word</var>,
otherwise nothing.
</p>
</dd>
<dt> ‘<samp>$[<var>num</var>]</samp>’</dt>
<dd><p>value of the <var>num</var>th argument given on the command line. Note that
$[0] is the name under which a2ps</p>
</dd>
<dt> ‘<samp>#{<var>key</var>}</samp>’</dt>
<dd><p>expansion of the value of the variable <var>key</var> if defined, nothing
otherwise (see section <a href="#Your-Variables">Your Variables</a>)
</p>
</dd>
<dt> ‘<samp>#{<var>key</var>:-<var>word</var>}</samp>’</dt>
<dd><p>if the variable <var>var</var> is defined, then the expansion of its,
otherwise <var>word</var>.
</p>
</dd>
<dt> ‘<samp>#{<var>key</var>:+<var>word</var>}</samp>’</dt>
<dd><p>if the variable <var>var</var> is defined, then <var>word</var>, otherwise
nothing.
</p>
</dd>
<dt> ‘<samp>#.</samp>’</dt>
<dd><p>the extension corresponding to the current output language
(e.g. ‘<samp>ps</samp>’).
</p>
</dd>
<dt> ‘<samp>%*</samp>’</dt>
<dd><p>current time in 24-hour format with seconds ‘<samp>hh:mm:ss</samp>’
</p>
</dd>
<dt> ‘<samp>$*</samp>’</dt>
<dd><p>file modification time in 24-hour format with seconds ‘<samp>hh:mm:ss</samp>’
</p>
</dd>
<dt> ‘<samp>$#</samp>’</dt>
<dd><p>the sequence number of the current input file
</p>
</dd>
<dt> ‘<samp>%#</samp>’</dt>
<dd><p>the total number of files
</p>
</dd>
<dt> ‘<samp>%a</samp>’</dt>
<dd><p>the localized equivalent for ‘<samp>Printed by <var>User Name</var></samp>’.
<var>User Name</var> is obtained from the variable ‘<samp>user.name</samp>’
(see section <a href="#Predefined-Variables">Predefined Variables</a>).
</p>
</dd>
<dt> ‘<samp>%A</samp>’</dt>
<dd><p>the localized equivalent for ‘<samp>Printed by <var>User Name</var> from
<var>Host Name</var></samp>’. The variables ‘<samp>user.name</samp>’ and ‘<samp>user.host</samp>’
are used (see section <a href="#Predefined-Variables">Predefined Variables</a>).
</p>
</dd>
<dt> ‘<samp>%c</samp>’</dt>
<dd><p>trailing component of the current working directory
</p>
</dd>
<dt> ‘<samp>%C</samp>’</dt>
<dd><p>current time in ‘<samp>hh:mm:ss</samp>’ format
</p>
</dd>
<dt> ‘<samp>$C</samp>’</dt>
<dd><p>file modification time in ‘<samp>hh:mm:ss</samp>’ format
</p>
</dd>
<dt> ‘<samp>%d</samp>’</dt>
<dd><p>current working directory
</p>
</dd>
<dt> ‘<samp>$d</samp>’</dt>
<dd><p>directory part of the current file (‘<samp>.</samp>’ if the directory part is
empty).
</p>
</dd>
<dt> ‘<samp>%D</samp>’</dt>
<dd><p>current date in ‘<samp>yy-mm-dd</samp>’ format
</p>
</dd>
<dt> ‘<samp>$D</samp>’</dt>
<dd><p>file modification date in ‘<samp>yy-mm-dd</samp>’ format
</p>
</dd>
<dt> ‘<samp>%D{<var>string</var>}</samp>’</dt>
<dd><p>format current date according to <var>string</var> with the
<code>strftime(3)</code> function.
</p>
</dd>
<dt> ‘<samp>$D{<var>string</var>}</samp>’</dt>
<dd><p>format file’s last modification date according to <var>string</var> with the
<code>strftime(3)</code> function.
</p>
</dd>
<dt> ‘<samp>%e</samp>’</dt>
<dd><p>current date in localized short format (e.g., ‘<samp>Jul 4, 76</samp>’ in
English, or ‘<samp>14 Juil 89</samp>’ in French).
</p>
</dd>
<dt> ‘<samp>$e</samp>’</dt>
<dd><p>file modification date in localized short format.
</p>
</dd>
<dt> ‘<samp>%E</samp>’</dt>
<dd><p>current date in localized long format (e.g., ‘<samp>July 4, 76</samp>’ in
English, or ‘<samp>Samedi 14 Juillet 89</samp>’ in French).
</p>
</dd>
<dt> ‘<samp>$E</samp>’</dt>
<dd><p>file modification date in localized long format.
</p>
</dd>
<dt> ‘<samp>$f</samp>’</dt>
<dd><p>full file name (with directory and suffix).
</p>
</dd>
<dt> ‘<samp>\f</samp>’</dt>
<dd><p>character ‘<samp>\f</samp>’ (<code>form feed</code>).
</p>
</dd>
<dt> ‘<samp>#f0</samp>’</dt>
<dt> ‘<samp>#f9</samp>’</dt>
<dd><p>ten temporary file names. You can do anything you want with them, a2psremoves them at the end of the job. It is useful for the delegations
(see section <a href="#Your-Delegations">Your Delegations</a>) and for the printer commands (see section <a href="#Your-Printers">Your Printers</a>).
</p>
</dd>
<dt> ‘<samp>%F</samp>’</dt>
<dd><p>current date in ‘<samp>dd.mm.yyyy</samp>’ format.
</p>
</dd>
<dt> ‘<samp>$F</samp>’</dt>
<dd><p>file modification date in ‘<samp>dd.mm.yyyy</samp>’ format.
</p>
</dd>
<dt> ‘<samp>#h</samp>’</dt>
<dd><p>medium height in PostScript points
</p>
</dd>
<dt> ‘<samp>$l^</samp>’</dt>
<dd><p>top most line number of the current page
</p>
</dd>
<dt> ‘<samp>$l.</samp>’</dt>
<dd><p>current line number. To print the page number and the line interval in
the right title, use ‘<samp>--right-title="$q:$l^-$l."</samp>’.
</p>
</dd>
<dt> ‘<samp>$l#</samp>’</dt>
<dd><p>number of lines in the current file.
</p>
</dd>
<dt> ‘<samp>%m</samp>’</dt>
<dd><p>the host name up to the first ‘<samp>.</samp>’ character
</p>
</dd>
<dt> ‘<samp>%M</samp>’</dt>
<dd><p>the full host name
</p>
</dd>
<dt> ‘<samp>\n</samp>’</dt>
<dd><p>the character ‘<samp>\n</samp>’ (<code>new line</code>).
</p>
</dd>
<dt> ‘<samp>%n</samp>’</dt>
<dd><p>shortcut for the value of the variable ‘<samp>user.login</samp>’
(see section <a href="#Predefined-Variables">Predefined Variables</a>).
</p>
</dd>
<dt> ‘<samp>$n</samp>’</dt>
<dd><p>input file name without the directory part.
</p>
</dd>
<dt> ‘<samp>%N</samp>’</dt>
<dd><p>shortcut for the value of the variable ‘<samp>user.name</samp>’
(see section <a href="#Predefined-Variables">Predefined Variables</a>).
</p>
</dd>
<dt> ‘<samp>$N</samp>’</dt>
<dd><p>input file name without the directory, and without its suffix (e.g., on
‘<tt>foo.c</tt>’, it will produce ‘<samp>foo</samp>’).
</p>
</dd>
<dt> ‘<samp>#o</samp>’</dt>
<dd><p>name of the output, before substitution (i.e., argument of ‘<samp>-P</samp>’,
or of ‘<samp>-o</samp>’).
</p>
</dd>
<dt> ‘<samp>#O</samp>’</dt>
<dd><p>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 <a href="#Your-Printers">Your Printers</a>), the result of the evaluation. For instance, if the symbolic
printer ‘<samp>file</samp>’ is defined as ‘<samp>> $n.%.</samp>’, then ‘<samp>#O</samp>’ returns
‘<samp>foo.c.ps</samp>’ when printing ‘<tt>foo.c</tt>’ to PostScript. ‘<samp>#o</samp>’
would have returned ‘<samp>file</samp>’.
</p>
</dd>
<dt> ‘<samp>#p</samp>’</dt>
<dd><p>the range of the page to print from this page. For instance if the user
asked ‘<samp>--pages=1-10,15</samp>’, and the current page is 8, then ‘<samp>#p</samp>’
evaluates to ‘<samp>1-3,8</samp>’.
</p>
</dd>
<dt> ‘<samp>$p^</samp>’</dt>
<dd><p>number of the first page of this file appearing on the current sheet.
Note that ‘<samp>$p.</samp>’, evaluated at the end of sheet, is also the number
of the last page of this file appearing on this sheet.
</p>
</dd>
<dt> ‘<samp>$p-</samp>’</dt>
<dd><p>interval of the page number of the current file appearing on the current
sheet. It is the same as ‘<samp>$p^-$p.</samp>’, if ‘<samp>$p^</samp>’ and ‘<samp>$p.</samp>’
are different, otherwise it is equal to ‘<samp>$p.</samp>’.
</p>
</dd>
<dt> ‘<samp>%p.</samp>’</dt>
<dd><p>current page number
</p>
</dd>
<dt> ‘<samp>$p.</samp>’</dt>
<dd><p>page number for this file
</p>
</dd>
<dt> ‘<samp>%p#</samp>’</dt>
<dd><p>total number of pages printed
</p>
</dd>
<dt> ‘<samp>$p#</samp>’</dt>
<dd><p>number of pages of the current file
</p>
</dd>
<dt> ‘<samp>$p<</samp>’</dt>
<dd><p>number of the first page of the current file
</p>
</dd>
<dt> ‘<samp>$p></samp>’</dt>
<dd><p>number of the last page of the current file
</p>
</dd>
<dt> ‘<samp>%q</samp>’</dt>
<dd><p>localized equivalent for ‘<samp>Page %p.</samp>’
</p>
</dd>
<dt> ‘<samp>$q</samp>’</dt>
<dd><p>localized equivalent for ‘<samp>Page $p.</samp>’
</p>
</dd>
<dt> ‘<samp>%Q</samp>’</dt>
<dd><p>localized equivalent for ‘<samp>Page %p./%p#</samp>’
</p>
</dd>
<dt> ‘<samp>$Q</samp>’</dt>
<dd><p>localized equivalent for ‘<samp>Page $p./$p#</samp>’
</p>
</dd>
<dt> ‘<samp>$s<</samp>’</dt>
<dd><p>number of the first sheet of the current file
</p>
</dd>
<dt> ‘<samp>%s.</samp>’</dt>
<dd><p>current sheet number
</p>
</dd>
<dt> ‘<samp>$s.</samp>’</dt>
<dd><p>sheet number for the current file
</p>
</dd>
<dt> ‘<samp>$s></samp>’</dt>
<dd><p>number of the last sheet of the current file
</p>
</dd>
<dt> ‘<samp>%s#</samp>’</dt>
<dd><p>total number of sheets
</p>
</dd>
<dt> ‘<samp>$s#</samp>’</dt>
<dd><p>number of sheets of the current file
</p>
</dd>
<dt> ‘<samp>%t</samp>’</dt>
<dd><p>current time in 12-hour am/pm format
</p>
</dd>
<dt> ‘<samp>$t</samp>’</dt>
<dd><p>file modification time in 12-hour am/pm format
</p>
</dd>
<dt> ‘<samp>$t1</samp>’</dt>
<dt> ‘<samp>$t2</samp>’</dt>
<dt> ‘<samp>$t3</samp>’</dt>
<dd><p>Content of tag 1, 2 and 3. Tags are pieces of text a2psfiles, according to the style. For instance, in <code>mail-folder</code>
style, tag 1 is the title of the mail, and tag 2 its author.
</p>
</dd>
<dt> ‘<samp>%T</samp>’</dt>
<dd><p>current time in 24-hour format ‘<samp>hh:mm</samp>’
</p>
</dd>
<dt> ‘<samp>$T</samp>’</dt>
<dd><p>file modification time in 24-hour format ‘<samp>hh:mm</samp>’
</p>
</dd>
<dt> ‘<samp>#v</samp>’</dt>
<dd><p>number of virtual sheets
</p>
</dd>
<dt> ‘<samp>%V</samp>’</dt>
<dd><p>the version string of a2ps@c.
</p>
</dd>
<dt> ‘<samp>#w</samp>’</dt>
<dd><p>medium width in PostScript points
</p>
</dd>
<dt> ‘<samp>%W</samp>’</dt>
<dd><p>current date in ‘<samp>mm/dd/yy</samp>’ format
</p>
</dd>
<dt> ‘<samp>$W</samp>’</dt>
<dd><p>file modification date in ‘<samp>mm/dd/yy</samp>’ format
</p></dd>
</dl>
<hr size="6">
<a name="Configuration-Files"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Available-Escapes" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Including-Configuration-Files" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Invoking-a2ps" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Configuration-Files-1"></a>
<h1 class="chapter">4. Configuration Files</h1>
<a name="index-Configuration-Files"></a>
<a name="index-_002ea2ps"></a>
<a name="index-a2psrc"></a>
<a name="index-a2ps_002ecfg"></a>
<a name="index-a2ps_002dsite_002ecfg"></a>
<p>a2psorder, they are:
</p><ol>
<li>
<a name="index-A2PS_005fCONFIG"></a>
the system configuration file (usually ‘<tt>/usr/local/etc/a2ps.cfg</tt>’)
unless you have defined the environment variable ‘<samp>A2PS_CONFIG</samp>’, in
which case a2ps
</li><li>
the user’s home configuration file (‘<tt>$HOME/.a2ps/a2psrc</tt>’)
</li><li>
the local file (‘<tt>./.a2psrc</tt>’)
</li></ol>
<p>Because a2pslocal <code>lpr</code> command) and architecture independent information (such
as the type of your printers), users have found useful that
‘<tt>a2ps.cfg</tt>’ be dedicated to architecture dependent information. A
sub configuration file, ‘<tt>a2ps-site.cfg</tt>’ (see section <a href="#Including-Configuration-Files">Including Configuration Files</a>) is included from ‘<tt>a2ps.cfg</tt>’.
</p>
<p>The file ‘<tt>a2ps.cfg</tt>’ is updated when you update a2ps@c, while
‘<tt>a2ps-site.cfg</tt>’ is not, to preserve local definitions.
</p>
<p>In the configuration files, empty lines and lines starting with ‘<samp>#</samp>’
are comments.
</p>
<p>The other lines have all the following form:
</p><table><tr><td> </td><td><pre class="example"><var>Topic:</var> <var>Arguments</var>
</pre></td></tr></table>
<p>where <var>Topic:</var> is a keyword related to what you are customizing, and
<var>Arguments</var> the customization. <var>Arguments</var> may be spread on
several lines, provided that the last character of a line to continue is
a ‘<samp>\</samp>’.
</p>
<p>In the following sections, each <var>Topic:</var> is detailed.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Including-Configuration-Files">4.1 Including Configuration Files</a></td><td> </td><td align="left" valign="top"> Isolating site specific values
</td></tr>
<tr><td align="left" valign="top"><a href="#Your-Library-Path">4.2 Your Library Path</a></td><td> </td><td align="left" valign="top"> Setting the files search path
</td></tr>
<tr><td align="left" valign="top"><a href="#Your-Default-Options">4.3 Your Default Options</a></td><td> </td><td align="left" valign="top"> Default state of a2ps
</td></tr>
<tr><td align="left" valign="top"><a href="#Your-Media">4.4 Your Media</a></td><td> </td><td align="left" valign="top"> Sheets dimensions
</td></tr>
<tr><td align="left" valign="top"><a href="#Your-Printers">4.5 Your Printers</a></td><td> </td><td align="left" valign="top"> How to access the printers
</td></tr>
<tr><td align="left" valign="top"><a href="#Your-Shortcuts">4.6 Your Shortcuts</a></td><td> </td><td align="left" valign="top"> Your very own command line options
</td></tr>
<tr><td align="left" valign="top"><a href="#Your-PostScript-magic-number">4.7 Your PostScript magic number</a></td><td> </td><td align="left" valign="top"> Handling very old printers
</td></tr>
<tr><td align="left" valign="top"><a href="#Your-Page-Labels">4.8 Your Page Labels</a></td><td> </td><td align="left" valign="top"> Page names as in <code>Ghostview</code>
</td></tr>
<tr><td align="left" valign="top"><a href="#Your-Variables">4.9 Your Variables</a></td><td> </td><td align="left" valign="top"> Short cut for long sequences
</td></tr>
<tr><td align="left" valign="top"><a href="#Your-Delegations">4.10 Your Delegations</a></td><td> </td><td align="left" valign="top"> Delegating some files to other filters
</td></tr>
<tr><td align="left" valign="top"><a href="#Your-Internal-Details">4.11 Your Internal Details</a></td><td> </td><td align="left" valign="top"> Details you might want to tune
</td></tr>
</table>
<hr size="6">
<a name="Including-Configuration-Files"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Configuration-Files" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Library-Path" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Including-Configuration-Files-1"></a>
<h2 class="section">4.1 Including Configuration Files</h2>
<dl>
<dt><a name="index-Include_003a"></a><u>Configuration Setting:</u> <b>Include:</b><i> <var>file</var></i></dt>
<dd><a name="index-Include_003a-1"></a>
<p>Include (read) the configuration <var>file</var>. if <var>file</var> is a
relative path (i.e., it does not start with ‘<samp>/</samp>’), then it is
relatively to the current configuration file.
</p></dd></dl>
<p>This is especially useful for the site specific configuration file
‘<tt>etc/a2ps.cfg</tt>’: you may tune your printers etc. in a separate file
for easy upgrade of a2ps</p>
<hr size="6">
<a name="Your-Library-Path"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Including-Configuration-Files" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Default-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Your-Library-Path-1"></a>
<h2 class="section">4.2 Your Library Path</h2>
<p>To define the default library path, you can use:
</p>
<dl>
<dt><a name="index-LibraryPath_003a"></a><u>Configuration Setting:</u> <b>LibraryPath:</b><i> <var>path</var></i></dt>
<dd><a name="index-LibraryPath_003a-1"></a>
<p>Set the library path the <var>path</var>.
</p></dd></dl>
<dl>
<dt><a name="index-AppendLibraryPath_003a"></a><u>Configuration Setting:</u> <b>AppendLibraryPath:</b><i> <var>path</var></i></dt>
<dd><a name="index-AppendLibraryPath_003a-1"></a>
<p>Add <var>path</var> at the end of the current library path.
</p></dd></dl>
<dl>
<dt><a name="index-PrependLibraryPath_003a"></a><u>Configuration Setting:</u> <b>PrependLibraryPath:</b><i> <var>path</var></i></dt>
<dd><a name="index-PrependLibraryPath_003a-1"></a>
<p>Add <var>path</var> at the beginning of the current library path.
</p></dd></dl>
<p>Note that for users configuration files, it is better not to set the
library path, because the system’s configuration has certainly been
built to cope with your system’s peculiarities. Use
‘<samp>AppendLibraryPath:</samp>’ and ‘<samp>PrependLibraryPath:</samp>’.
</p>
<hr size="6">
<a name="Your-Default-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Your-Library-Path" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Media" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Your-Default-Options-1"></a>
<h2 class="section">4.3 Your Default Options</h2>
<dl>
<dt><a name="index-Options_003a"></a><u>Configuration Setting:</u> <b>Options:</b><i> <var>options+</var></i></dt>
<dd><a name="index-Options_003a-1"></a>
<p>Give a2pssequence of regular command line options (see section <a href="#Invoking-a2ps">Invoking a2ps</a>).
</p>
<p>It is the correct way to define the default behavior you expect from
a2ps@c. If for instance you want to use <code>Letter</code> as medium, then
use:
</p>
<table><tr><td> </td><td><pre class="example">Options: --medium=Letter
</pre></td></tr></table>
<p>It is exactly the same as always giving a2ps‘<samp>--medium=Letter</samp>’ at run time.
</p></dd></dl>
<p>The quoting mechanism is the same as that of a shell. For instance
</p><table><tr><td> </td><td><pre class="example">Options: --right-title="Page $p" --center-title="Hello World!"
Options: --title="arg 'Jack said \\\"hi\\\"' has double quotes"
</pre></td></tr></table>
<hr size="6">
<a name="Your-Media"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Your-Default-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Printers" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Your-Media-1"></a>
<h2 class="section">4.4 Your Media</h2>
<dl>
<dt><a name="index-Medium_003a"></a><u>Configuration Setting:</u> <b>Medium:</b><i> <var>name</var> <var>dimensions</var></i></dt>
<dd><a name="index-Medium_003a-1"></a>
<p>Define the medium <var>name</var> to have the <var>dimensions</var> (in PostScript
points, i.e., 1/72 of inch).
</p>
<p>There are two formats supported:
</p>
<dl compact="compact">
<dt> long</dt>
<dd><p>in which you must give both the size of the whole sheet, and the size of
the printable area:
</p><table><tr><td> </td><td><pre class="example"># A4 for Desk Jets
# <var>name</var> <var>w</var> <var>h</var> <var>llx</var> <var>lly</var> <var>urx</var> <var>ury</var>
Medium: A4dj 595 842 24 50 571 818
</pre></td></tr></table>
<p>where <var>w</var>x<var>h</var> are the dimension of the sheet, and the four other
stand for lower left x and y, upper right x and y.
</p>
</dd>
<dt> short</dt>
<dd><p>in which a surrounding margin of 24 points is used
</p><table><tr><td> </td><td><pre class="example"># A4
# <var>name</var> <var>w</var> <var>h</var>
Medium: A4 595 842
</pre></td></tr></table>
<p>is the same as
</p>
<table><tr><td> </td><td><pre class="example"># A4
# <var>name</var> <var>w</var> <var>h</var>
Medium: A4 595 842 24 24 571 818
</pre></td></tr></table>
</dd>
</dl>
</dd></dl>
<hr size="6">
<a name="Your-Printers"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Your-Media" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Shortcuts" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Your-Printers-1"></a>
<h2 class="section">4.5 Your Printers</h2>
<p>A general scheme is used, so that whatever the way you should address
the printers on your system, the interface is still the same. Actually,
the interface is so flexible, that you should understand ‘named destination’
when we write ‘printer’.
</p>
<dl>
<dt><a name="index-Printer_003a"></a><u>Configuration Setting:</u> <b>Printer:</b><i> <var>name</var> <var>PPD-key</var> <var>destination</var></i></dt>
<dt><a name="index-Printer_003a-1"></a><u>Configuration Setting:</u> <b>Printer:</b><i> <var>name</var> <var>destination</var></i></dt>
<dt><a name="index-Printer_003a-2"></a><u>Configuration Setting:</u> <b>Printer:</b><i> <var>name</var> <var>PPD-key</var></i></dt>
<dd><a name="index-Printer_003a-3"></a>
<p>Specify the destination of the output when the option ‘<samp>-P
<var>name</var></samp>’ is given. If <var>PPD-key</var> is given, declare the printer
<var>name</var> to be described by the PPD file ‘<tt><var>PPD-key</var>.ppd</tt>’. If
<var>destination</var> is not given, used that of the ‘<samp>UnknownPrinter:</samp>’.
</p>
<p>The <var>destination</var> must be of one of the following forms:
</p><dl compact="compact">
<dt> ‘<samp>| <var>command</var></samp>’</dt>
<dd><p>in which case the output is piped into <var>command</var>.
</p>
</dd>
<dt> ‘<samp>> <var>file</var></samp>’</dt>
<dd><p>in which case the output is saved into <var>file</var>.
</p></dd>
</dl>
</dd></dl>
<dl>
<dt><a name="index-UnknownPrinter_003a"></a><u>Configuration Setting:</u> <b>UnknownPrinter:</b><i> [<var>PPD-key</var>] <var>destination</var></i></dt>
<dd><a name="index-UnknownPrinter_003a-1"></a>
<p>Specify the destination of the output when when the option ‘<samp>-P <var>name</var></samp>’
is given, but there is no ‘<samp>Printer:</samp>’ entry for <var>name</var>.
</p></dd></dl>
<dl>
<dt><a name="index-DefaultPrinter_003a"></a><u>Configuration Setting:</u> <b>DefaultPrinter:</b><i> [<var>PPD-key</var>] <var>destination</var></i></dt>
<dd><a name="index-DefaultPrinter_003a-1"></a>
<p>Specify the destination of the output when when the option ‘<samp>-d</samp>’
(send to default output) is given.
</p></dd></dl>
<p>Escapes expansion is performed on <var>destination</var> (see section <a href="#Escapes">Escapes</a>).
Recall that ‘<samp>#o</samp>’ is evaluated to the destination
name, i.e., the argument given to ‘<samp>-P</samp>’.
</p>
<p>For instance
</p><table><tr><td> </td><td><pre class="example"># My Default Printer is called dominique
DefaultPrinter: | lp -d dominique
# `a2ps foo.c -P bar' will pipe into `lp -d bar'
UnknownPrinter: | lp -d #o
# `a2ps -P foo' saves into the file `foo'
Printer: foo > foo.ps
Printer: wc | wc
Printer: lw | lp -d printer-with-a-rather-big-name
# E.g. `a2ps foo.c bar.h -P file' will save into `foo.c.ps'
Printer: file > $n.#.
# E.g. `a2ps foo.c bar.h -P home' will save into `foo.ps'
# in user's home
Printer: home > ${HOME}/$N.#.
# Here we address a printer which is not PostScript
Printer: deskj | gs -q -sDEVICE=ljet3d -sOutputFile=- - \
| lpr -P laserwriter -h -l
</pre></td></tr></table>
<a name="index-Non-PostScript-printers"></a>
<p>MS-DOS users, and non-PostScript printer owners should take advantage in
getting good configuration of these entries.
</p>
<hr size="6">
<a name="Your-Shortcuts"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Your-Printers" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Your-PostScript-magic-number" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Your-Shortcuts-1"></a>
<h2 class="section">4.6 Your Shortcuts</h2>
<a name="index-_003a"></a>
<p>You can define some kind of ‘Macro Options’ which stand for a set of
options.
</p>
<dl>
<dt><a name="index-UserOption_003a"></a><u>Configuration Setting:</u> <b>UserOption:</b><i> <var>shortcut</var> <var>options...</var></i></dt>
<dd><a name="index-UserOption_003a-1"></a>
<p>Define the <var>shortcut</var> to be the list of <var>options...</var>. When a2psis called with ‘<samp>-=<var>shortcut</var></samp>’ (or
‘<samp>--user-option=<var>shortcut</var></samp>’), consider the list of
<var>options...</var>.
</p></dd></dl>
<p>Examples are
</p><table><tr><td> </td><td><pre class="example"># This emulates a line printer: no features at all
# call a2ps -=lp to use it
UserOption: lp -1m --pretty-print=plain -B --borders=no
# When printing mail, I want to use the right style sheet with strong
# highlight level, and stripping `useless' headers.
UserOption: mail -Email -g --strip=1
</pre></td></tr></table>
<hr size="6">
<a name="Your-PostScript-magic-number"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Your-Shortcuts" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Page-Labels" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Your-PostScript-magic-number-1"></a>
<h2 class="section">4.7 Your PostScript magic number</h2>
<a name="index-OutputFirstLine_003a"></a>
<a name="index-_0025_0021"></a>
<p>a2psAdobe said
</p><blockquote><p>Thou shalt start your PostScript DSC conformant files with
</p><table><tr><td> </td><td><pre class="example">%!PS-Adobe-3.0
</pre></td></tr></table>
</blockquote>
<p>The bad news is that some printers will reject this header. Then you
may change this header without any worry since the PostScript produced
by a2psare no PostScript printers that don’t understand these files..
</p>
<dl>
<dt><a name="index-OutputFirstLine_003a-1"></a><u>Configuration Setting:</u> <b>OutputFirstLine:</b><i> <var>magic-number</var></i></dt>
<dd><a name="index-OutputFirstLine_003a-2"></a>
<p>Specify the header of the produced PostScript file to be <var>magic-number</var>.
Typical values include ‘<samp>%!PS-Adobe-2.0</samp>’, or just ‘<samp>%!</samp>’.
</p></dd></dl>
<hr size="6">
<a name="Your-Page-Labels"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Your-PostScript-magic-number" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Variables" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Your-Page-Labels-1"></a>
<h2 class="section">4.8 Your Page Labels</h2>
<p>In the PostScript file is dropped information on where sheets begin and
end, so that post processing tools know where is the physical page 1, 2 etc.
With this information can be also stored a label, i.e., a human readable text
(typically the logical page numbers), which
is for instance what <code>Ghostview</code> shows as the list of page numbers.
</p>
<p>a2ps</p>
<dl>
<dt><a name="index-PageLabelFormat_003a"></a><u>Configuration Setting:</u> <b>PageLabelFormat:</b><i> <var>format</var></i></dt>
<dd><a name="index-PageLabelFormat_003a-1"></a>
<p>Specify the <var>format</var> to use to label the PostScript pages.
<var>format</var> can use Escapes (see section <a href="#Escapes">Escapes</a>). Two
variables are predefined for this: ‘<samp>#{pl.short}</samp>’ and
‘<samp>#{pl.long}</samp>’.
</p></dd></dl>
<hr size="6">
<a name="Your-Variables"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Your-Page-Labels" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Defining-Variables" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Your-Variables-1"></a>
<h2 class="section">4.9 Your Variables</h2>
<a name="index-Escape"></a>
<a name="index-Variable"></a>
<p>There are many places in a2psof extending things. It once became clear that <em>variables</em> where
needed in a2ps@c.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Defining-Variables">4.9.1 Defining Variables</a></td><td> </td><td align="left" valign="top"> Syntax and conventions
</td></tr>
<tr><td align="left" valign="top"><a href="#Predefined-Variables">4.9.2 Predefined Variables</a></td><td> </td><td align="left" valign="top"> Builtin variables
</td></tr>
</table>
<hr size="6">
<a name="Defining-Variables"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Your-Variables" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Predefined-Variables" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Variables" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Defining-Variables-1"></a>
<h3 class="subsection">4.9.1 Defining Variables</h3>
<dl>
<dt><a name="index-Variable_003a"></a><u>Configuration Setting:</u> <b>Variable:</b><i> <var>key</var> <var>value</var></i></dt>
<dd><a name="index-Variable_003a-1"></a>
<p>Define the escape ‘<samp>#{<var>key</var>}</samp>’ to be a short cut for
<var>value</var>. <var>key</var> must not have any character from ‘<samp>:(){}</samp>’.
</p></dd></dl>
<p>As as example, here is a variable for <code>psnup</code>, which encloses all
the option passing one would like. Delegations are then easier to
write:
</p><table><tr><td> </td><td><pre class="example">Variable: psnup psnup -#v -q #?j|-d|| #?r||-c| -w#w -h#h
</pre></td></tr></table>
<p>It is strongly suggested to follow a ‘<samp>.</samp>’ (dot) separated hierarchy,
starting with:
</p><dl compact="compact">
<dt> ‘<samp>del</samp>’</dt>
<dd><p>for variables that are related to delegations.
</p>
</dd>
<dt> ‘<samp>pro</samp>’</dt>
<dd><p>for variables used in prologues (see section <a href="#Designing-PostScript-Prologues">Designing PostScript Prologues</a>). Please, specify the name of the prologue (e.g.,
‘<samp>pro.matrix.gray</samp>’).
</p>
</dd>
<dt> ‘<samp>ps</samp>’</dt>
<dd><p>for variables related to PostScript matters, such as the page label
(which is associated to <code>ps.page_label</code>), the header etc.
</p>
</dd>
<dt> ‘<samp>pl</samp>’</dt>
<dd><p>for page label formats. See section <a href="#Your-Page-Labels">Your Page Labels</a>, the option
‘<samp>--page-label</samp>’ in <a href="#Input-Options">Input Options</a>.
</p>
</dd>
<dt> ‘<samp>toc</samp>’</dt>
<dd><p>for toc formats. See the option ‘<samp>--toc</samp>’ in <a href="#Input-Options">Input Options</a>.
</p>
</dd>
<dt> ‘<samp>user</samp>’</dt>
<dd><p>for user related information. See section <a href="#Predefined-Variables">Predefined Variables</a>.
</p></dd>
</dl>
<p>This naming convention has not fully stabilized. We apologize for the
inconvenience this might cause to users.
</p><hr size="6">
<a name="Predefined-Variables"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Defining-Variables" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Delegations" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Variables" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Predefined-Variables-1"></a>
<h3 class="subsection">4.9.2 Predefined Variables</h3>
<a name="index-Predefined-Variables"></a>
<a name="index-Variables_002c-predefined"></a>
<p>There are a few predefined variables. The fact that a2psat startup changes nothing to their status: they can be modified like
any other variable using <code>--define</code> (see section <a href="#Global-Options">Global Options</a>).
</p>
<p>In what follows, there are numbers (i) like this, or (ii) this. It
means that a2ps(non empty value), this is the value given to the variable. Otherwise
it tries solution (ii), etc. The rationale behind the order is usually
from user modifiable values (e.g. environment variables) through
system’s hard coded values (e.g., calls to <code>getpwuid</code>) and finally
arbitrary values.
</p>
<dl compact="compact">
<dt> ‘<samp>user.comments</samp>’</dt>
<dd><p>Comments on the user. Computed by (i) the system’s database (the part
of <code>pw_gecos</code> after the first ‘<samp>,</samp>’), (ii) not defined.
</p>
</dd>
<dt> ‘<samp>user.home</samp>’</dt>
<dd><p>The user’s home directory. Determined by (i) the environment variable
<code>HOME</code>, (ii) the system’s database (using <code>getpwuid</code>), (iii)
the empty string.
</p>
</dd>
<dt> ‘<samp>user.host</samp>’</dt>
<dd><p>The user’s host name. Assigned from (i) the system (<code>gethostname</code>
or <code>uname</code>), (ii) the empty string.
</p>
</dd>
<dt> ‘<samp>user.login</samp>’</dt>
<dd><p>The user’s login (e.g. ‘<samp>bgates</samp>’). Computed by (i) the environment
variable <code>LOGNAME</code>, (ii) the environment variable <code>USERNAME</code>,
(iii) the system’s database (using <code>getpwuid</code>), (iv) the translated
string ‘<samp>user</samp>’.
</p>
</dd>
<dt> ‘<samp>user.name</samp>’</dt>
<dd><p>The user’s name (e.g. ‘<samp>William Gates</samp>’). Computed by (i) the
system’s database (<code>pw_gecos</code> up to the first ‘<samp>,</samp>’), (ii)
capitalized value of the variable ‘<samp>user.login</samp>’ unless it was the
translated string ‘<samp>user</samp>’, (iii) the translated string ‘<samp>Unknown
User</samp>’.
</p>
</dd>
</dl>
<hr size="6">
<a name="Your-Delegations"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Predefined-Variables" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Defining-a-Delegation" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Your-Delegations-1"></a>
<h2 class="section">4.10 Your Delegations</h2>
<a name="index-Delegations"></a>
<p>There are some files you don’t really want a2pstypically page description files (e.g., PostScript files, <code>roff</code> files,
etc.). You can let a2psapplications. The behavior at run time depends upon the option
‘<samp>--delegate</samp>’ (see section <a href="#Input-Options">Input Options</a>).
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Defining-a-Delegation">4.10.1 Defining a Delegation</a></td><td> </td><td align="left" valign="top"> Syntax of the definitions of the delegations
</td></tr>
<tr><td align="left" valign="top"><a href="#Guide-Line-for-Delegations">4.10.2 Guide Line for Delegations</a></td><td> </td><td align="left" valign="top"> What should be respected
</td></tr>
<tr><td align="left" valign="top"><a href="#Predefined-Delegations">4.10.3 Predefined Delegations</a></td><td> </td><td align="left" valign="top"> Making the best use of these delegations
</td></tr>
</table>
<hr size="6">
<a name="Defining-a-Delegation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Your-Delegations" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Guide-Line-for-Delegations" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Delegations" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Defining-a-Delegation-1"></a>
<h3 class="subsection">4.10.1 Defining a Delegation</h3>
<dl>
<dt><a name="index-Delegation_003a"></a><u>Configuration Setting:</u> <b>Delegation:</b><i> <var>name</var> <var>in</var>:<var>out</var> <var>command</var></i></dt>
<dd><a name="index-Delegation_003a-1"></a>
<p>Define the delegation <var>name</var>. It is to be applied upon files of
type <var>in</var> when output type is <var>out</var><a name="DOCF2" href="#FOOT2">(2)</a> thanks to
<var>command</var>. Both <var>in</var> and <var>out</var> are a2psdefined in ‘<tt>sheets.map</tt>’ (see section <a href="#The-Entry-in-sheets_002emap">The Entry in ‘<tt>sheets.map</tt>’</a>).
</p></dd></dl>
<p><var>command</var> should produce the file on its standard output. Of course
escapes substitution is performed on <var>command</var> (see section <a href="#Escapes">Escapes</a>).
In particular, <var>command</var> should use the input file
‘<samp>$f</samp>’.
</p>
<table><tr><td> </td><td><pre class="example"># In general, people don't want to pretty-print PostScript files.
# Pass the PostScript files to psnup
Delegation: PsNup ps:ps \
psselect #?V||-q| -p#?p|#p|-| $f | \
psnup -#v -q #?j|-d|| #?r||-c| -w#w -h#h
</pre></td></tr></table>
<p>Advantage should be taken from the variables, to encapsulate the
peculiarities of the various programs.
</p><table><tr><td> </td><td><pre class="example"># Passes the options to psnup.
# The files (in and out) are to be given
Variable: psnup psnup -#v #?V||-q| #?j|-d|| #?r||-c| -w#w -h#h
# Passes to psselect for PS page selection
Variable: psselect psselect #?V||-q| -p#?p|#p|-|
# In general, people don't want to pretty-print PostScript files.
# Pass the PostScript files to psnup
Delegation: PsNup ps:ps #{psselect} $f | #{psnup}
</pre></td></tr></table>
<p>Temporary file names (‘<samp>#f0</samp>’ to ‘<samp>#f9</samp>’) are available for
complex commands.
</p><table><tr><td> </td><td><pre class="example"># Pass DVI files to dvips.
# A problem with dvips is that even on failure it dumps its prologue,
# hence it looks like a success (output is produced).
# To avoid that, we use an auxiliary file and a conditional call to
# psnup instead of piping.
Delegation: dvips dvi:ps #{dvips} $f -o #f0 && #{psnup} #f0
</pre></td></tr></table>
<hr size="6">
<a name="Guide-Line-for-Delegations"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Defining-a-Delegation" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Predefined-Delegations" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Delegations" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Guide-Line-for-Delegations-1"></a>
<h3 class="subsection">4.10.2 Guide Line for Delegations</h3>
<p>First of all, select carefully the applications you will use for the
delegations. If a filter is known to cause problems, try to avoid it in
delegations<a name="DOCF3" href="#FOOT3">(3)</a>. As a thumb rule, you should check that the PostScript
generating applications produce files that start by:
</p><table><tr><td> </td><td><pre class="example">%!PS-Adobe-3.0
</pre></td></tr></table>
<p>a2psin order to output correctly the page device definitions. It can happen
that your filters don’t output this section. In that case, you should
insert a call to <code>fixps</code> right after the PostScript generation:
</p><table><tr><td> </td><td><pre class="example">########## ROFF files
# Pass the roff files to groff. Ask grog how groff should be called.
# Use fixps to ensure there is a %%BeginSetup/%%EndSetup section.
Delegation: Groff roff:ps \
eval `grog -Tps '$f'` | fixps #?V!!-q! | #{d.psselect} | #{d.psnup}
</pre></td></tr></table>
<p>There are some services expected from the delegations. The delegations
you may write should honor:
</p><dl compact="compact">
<dt> the input file</dt>
<dd><p>available via the escape ‘<samp>$f</samp>’. You should be aware that there are
people who have great fun having spaces or dollars in their file names,
so you probably should always use ‘<samp>'$f'</samp>’. Some other variables are
affected. Yes, I know, we need a special mechanism for ‘<samp>'</samp>’ itself.
Well, we’ll see that later ‘<samp>;-)</samp>’.
</p>
</dd>
<dt> the medium</dt>
<dd><p>the dimension of the medium selected by the user are available through
‘<samp>#w</samp>’ and ‘<samp>#h</samp>’.
</p>
</dd>
<dt> the page layout</dt>
<dd><p>the number of virtual pages is ‘<samp>#v</samp>’.
</p>
</dd>
<dt> the page range</dt>
<dd><p>the page range (in a form ‘<samp>1-2,4-6,10-</samp>’ for instance) is available
by ‘<samp>#p</samp>’.
</p>
</dd>
<dt> the verbosity level</dt>
<dd><p>please, do not make your delegations verbose by default. The silent
mode should always be requested, unless ‘<samp>#?V</samp>’ is set (see the above
example with <code>groff</code>).
</p></dd>
</dl>
<p>If ever you need several commands, do not use ‘<samp>;</samp>’ to separate them,
since it may prevent detection of failure. Use ‘<samp>&&</samp>’ instead.
</p>
<p>The slogan "<em>the sooner, the better</em>" should be applied here: in
the processing chain, it is better to ask a service to the first
application that supports it. An example will make it clear: when
processing a <code>DVI</code> file, <code>dvips</code> knows better the page numbers
than <code>psselect</code> would. So a <code>DVI</code> to PostScript delegation
should ask the page selection (‘<samp>#p</samp>’) to <code>dvips</code>, instead of
using <code>psselect</code> later in the chain. An other obvious reason here
is plain efficiency (globally, less data is processed).
</p>
<hr size="6">
<a name="Predefined-Delegations"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Guide-Line-for-Delegations" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Internal-Details" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Your-Delegations" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Predefined-Delegations-1"></a>
<h3 class="subsection">4.10.3 Predefined Delegations</h3>
<p>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 ‘<tt>a2ps.cfg</tt>’. We just want to explain some choices,
and give hints on how to make the best use of these delegations.
</p>
<dl>
<dt><a name="index-dvips"></a><u>Delegation:</u> <b>dvips</b><i> (DVI to PostScript)</i></dt>
<dd><p>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, a2psis landscape by looking for the keyword ‘<samp>landscape</samp>’ in it, using
<code>strings(1)</code>:
</p><table><tr><td> </td><td><pre class="example">Delegation: dvips dvi:ps\
if strings $f | sed 3q | fgrep 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
</pre></td></tr></table>
<p>In order to have that rule work correctly, it is expected from the
TeX, or LaTeX file to include something like:
</p>
<table><tr><td> </td><td><pre class="example">\renewcommand{\printlandscape}{\special{landscape}}
\printlandscape
</pre></td></tr></table>
<p>in the preamble.
</p>
<p>We don’t use a pipe because dvips always outputs data (its prologue)
even if it fails, what prevents error detection.
</p></dd></dl>
<dl>
<dt><a name="index-LaTeX"></a><u>Delegation:</u> <b>LaTeX</b><i> (LaTeX to DVI)</i></dt>
<dd><p>We use a modern version of the shell script <code>texi2dvi</code>, from the
package <code>Texinfo</code>, which runs <code>makeindex</code>, <code>bibtex</code> and
<code>latex</code> as many times as needed. You should be aware that if the
file includes files from <strong>other</strong> directories, it may miss some
compilation steps. Other cases (most typical) are well handled.
</p></dd></dl>
<hr size="6">
<a name="Your-Internal-Details"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Predefined-Delegations" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Your-Internal-Details-1"></a>
<h2 class="section">4.11 Your Internal Details</h2>
<p>There are settings that only meant for a2psyourself.
</p>
<dl>
<dt><a name="index-FileCommand_003a"></a><u>Configuration Setting:</u> <b>FileCommand:</b><i> <var>command</var></i></dt>
<dd><a name="index-TemporaryDirectory_003a"></a>
<p>The command to run to call <code>file(1)</code> on a file. If possible, make
it follow the symbolic links.
</p></dd></dl>
<hr size="6">
<a name="Library-Files"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Your-Internal-Details" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Documentation-Format" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Configuration-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Library-Files-1"></a>
<h1 class="chapter">5. Library Files</h1>
<a name="index-Library-files"></a>
<p>To be general and to allow as much customization as possible, a2psavoids to hard code its knowledge (encodings, PostScript routines,
etc.), and tries to split it in various files. Hence it needs a path,
i.e., a list of directories, in which it may find the files it needs.
</p>
<p>The exact value of this library path is available by ‘<samp>a2ps
--list=defaults</samp>’. Typically its value is:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">gargantua ~ $ a2ps --list=defaults
Configuration status of a2ps 4.13
<em>More stuff deleted here</em>
Internals:
verbosity level = 2
file command = /usr/ucb/file -L
temporary directory =
library path =
/inf/soft/infthes/demaille/.a2ps
/usr/local/share/a2ps/sheets
/usr/local/share/a2ps/ps
/usr/local/share/a2ps/encoding
/usr/local/share/a2ps/afm
/usr/local/share/a2ps/printers
/usr/local/share/a2ps
</pre></td></tr></table>
</td></tr></table>
<p>You may change this default path through the configuration files
(see section <a href="#Your-Library-Path">Your Library Path</a>).
</p>
<p>If you plan to define yourself some files for a2ps@c, they should be in
one of those directories.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Documentation-Format">5.1 Documentation Format</a></td><td> </td><td align="left" valign="top"> Special tags to write a documentation
</td></tr>
<tr><td align="left" valign="top"><a href="#Map-Files">5.2 Map Files</a></td><td> </td><td align="left" valign="top"> Their general shape and rationale
</td></tr>
<tr><td align="left" valign="top"><a href="#Font-Files">5.3 Font Files</a></td><td> </td><td align="left" valign="top"> Using other fonts
</td></tr>
<tr><td align="left" valign="top"><a href="#Style-Sheet-Files">5.4 Style Sheet Files</a></td><td> </td><td align="left" valign="top"> Defining pretty printing rules
</td></tr>
</table>
<hr size="6">
<a name="Documentation-Format"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Library-Files" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Map-Files" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Documentation-Format-1"></a>
<h2 class="section">5.1 Documentation Format</h2>
<p>In various places a documentation can be given. Since some
parts of this document and of web pages are extracted from documentations,
some tags are needed to provide a better layout. The format is
a mixture made out of Texinfo like commands, but built so that
quick and easy processing can be made.
</p>
<p>These tags are:
</p><dl compact="compact">
<dt> ‘<samp>code(</samp>’<var>text</var>‘<samp>)code</samp>’</dt>
<dd><p>Typeset <var>text</var> like a piece of code. This should be used
for keys, variables, options etc. For instance the documentation
of the <code>bold</code> prologue mentions the <code>bw</code> prologue:
</p><table><tr><td> </td><td><pre class="example">Documentation
This style is meant to replace the old option
code(-b)code of a2ps 4.3. It is a copy of the
black and white prologue, but in which all the
fonts are in Bold.
EndDocumentation
</pre></td></tr></table>
</dd>
<dt> ‘<samp>href(</samp>’<var>link</var>‘<samp>)href(</samp>’<var>text</var>‘<samp>)href</samp>’</dt>
<dd><p>Specifies a hyper text <var>link</var> displayed as <var>text</var>.
</p>
</dd>
<dt> ‘<samp>@example</samp>’</dt>
<dt> ‘<samp>@end example</samp>’</dt>
<dd><p>They must be alone on the line. The text between these tags is
displayed in a code-like fonts. This should be used for including a
piece of code. For instance, in the documentation of the <code>gnuc</code>
style sheet:
</p><table><tr><td> </td><td><pre class="example">documentation is
"Declaration of functions are highlighted"
"emph(only)emph if you start the function name"
"in the first column, and it is followed by an"
"opening parenthesis. In other words, if you"
"write"
"@example"
"int main (void)"
"@end example"
"it won't work. Write:"
"@example"
"int"
"main (void)"
"@end example"
end documentation
</pre></td></tr></table>
</dd>
<dt> ‘<samp>@itemize</samp>’</dt>
<dt> ‘<samp>@item</samp>’ <var>text</var></dt>
<dt> ‘<samp>@end itemize</samp>’</dt>
<dd><p>Typeset a list of items. The opening and closing tags must be alone on
the line.
</p>
</dd>
</dl>
<hr size="6">
<a name="Map-Files"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Documentation-Format" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Font-Files" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Map-Files-1"></a>
<h2 class="section">5.2 Map Files</h2>
<a name="index-Map-files"></a>
<a name="index-_002emap"></a>
<p>Many things are defined through files. There is a general scheme to
associate an object to the files to use: map files. They are typically
used to:
</p><ul class="toc">
<li>-
resolve aliases. For instance the ISO-8859-1 encoding is also called
ISO Latin 1, or Latin 1 for short. The ‘<tt>encoding.map</tt>’ file will
map these three names to the same Encoding Description File.
</li><li>-
cope with broken files systems. For instance,
the-one-you-know-I-don’t-need-to-name cannot handle files named
‘<tt>Courier-BoldOblique.afm</tt>’: it is the same as
‘<tt>Courier-Bold.afm</tt>’. The ‘<tt>fonts.map</tt>’ file is here to associate
a font file name to a font name.
</li></ul>
<p>The syntax of these files is:
</p><ul class="toc">
<li>-
any empty line, or any line starting by a ‘<samp>#</samp>’ is a comment.
</li><li>-
a line with the format
<table><tr><td> </td><td><pre class="example"><code>***</code> <var>path</var>
</pre></td></tr></table>
<p>requests that the file designated by <var>path</var> be included at this
point.
</p>
</li><li>-
any other line has the format
<table><tr><td> </td><td><pre class="example"><var>key</var> <var>value</var>
</pre></td></tr></table>
<p>meaning that when looking for <var>key</var> (e.g., name of a font, an
encoding etc.), a2psencoding description file name etc.).
</p></li></ul>
<p>The map files used in a2ps</p><dl compact="compact">
<dt> ‘<tt>encoding.map</tt>’</dt>
<dd><p>Resolving encodings aliases.
</p>
</dd>
<dt> ‘<tt>fonts.map</tt>’</dt>
<dd><p>Mapping font names to font file names.
</p>
</dd>
<dt> ‘<tt>sheets.map</tt>’</dt>
<dd><p>Rules to decide what style sheet to use.
</p></dd>
</dl>
<hr size="6">
<a name="Font-Files"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Map-Files" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Fonts-Map-File" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Font-Files-1"></a>
<h2 class="section">5.3 Font Files</h2>
<p>Even when a PostScript printer knows the fonts you want to use, using
these fonts requires some description files.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Fonts-Map-File">5.3.1 Fonts Map File</a></td><td> </td><td align="left" valign="top"> Mapping a font name to a file name
</td></tr>
<tr><td align="left" valign="top"><a href="#Fonts-Description-Files">5.3.2 Fonts Description Files</a></td><td> </td><td align="left" valign="top"> Needed files to use a Font
</td></tr>
<tr><td align="left" valign="top"><a href="#Adding-More-Font-Support">5.3.3 Adding More Font Support</a></td><td> </td><td align="left" valign="top"> Using even more Fonts
</td></tr>
</table>
<hr size="6">
<a name="Fonts-Map-File"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Font-Files" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Fonts-Description-Files" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Font-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Fonts-Map-File-1"></a>
<h3 class="subsection">5.3.1 Fonts Map File</h3>
<p>See section <a href="#Map-Files">Map Files</a>, for a description of the map files. This file
associates the <var>font-key</var> to a <var>font</var> name. For instance:
</p><table><tr><td> </td><td><pre class="example">Courier pcrr
Courier-Bold pcrb
Courier-BoldOblique pcrbo
Courier-Oblique pcrro
</pre></td></tr></table>
<p>associates to font named <code>Courier</code>, the key <code>pcrr</code>. To be
recognized, the font name must be exact: <code>courier</code> and
<code>COURIER</code> are not admitted.
</p>
<hr size="6">
<a name="Fonts-Description-Files"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Fonts-Map-File" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Adding-More-Font-Support" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Font-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Fonts-Description-Files-1"></a>
<h3 class="subsection">5.3.2 Fonts Description Files</h3>
<p>There are two kinds of data a2ps</p><ul class="toc">
<li>-
<a name="index-_002eafm"></a>
<a name="index-AFM"></a>
the AFM file (‘<tt><var>font-key</var>.afm</tt>’), which describes the metrics
information corresponding to <var>font</var>;
</li><li>-
<a name="index-_002epfa"></a>
<a name="index-_002epfb"></a>
in the case <var>font</var> is not known from the printer, the PFA or PFB
file which is down loaded to the printer. These files are actually the
PostScript programs which execution produces the characters to be drawn
on the page, in this <var>font</var>.
</li></ul>
<hr size="6">
<a name="Adding-More-Font-Support"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Fonts-Description-Files" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheet-Files" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Font-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Adding-More-Font-Support-1"></a>
<h3 class="subsection">5.3.3 Adding More Font Support</h3>
<a name="index-make_005ffonts_005fmap_002esh"></a>
<p>a2psname of the files in which are stored the fonts (see section <a href="#Fonts-Map-File">Fonts Map File</a>). To this end, a very primitive but still useful shell script is
provided: <code>make_fonts_map.sh</code>.
</p>
<p>First, you need to find the directories which store the fonts you want
to use, and extend the library path so that a2psdirectories. For instance, add:
</p><table><tr><td> </td><td><pre class="example">AppendLibraryPath: /usr/local/share/ghostscript/fonts
</pre></td></tr></table>
<p>Then run <code>make_fonts_map.sh</code>. It should be located in the
‘<tt>afm/</tt>’ directory of the system’s a2ps‘<tt>/usr/local/share/a2ps/afm/make_fonts_map.sh</tt>’.
</p>
<p>This script asks a2pscollecting <code>AFM</code> files, and digging information in them.
</p>
<p>Once the script has finished, a file ‘<tt>fonts.map.new</tt>’ was created.
Check its integrity, and if it’s correct, either replace the old
‘<tt>fonts.map</tt>’ with it, or rename ‘<tt>fonts.map.new</tt>’ as
‘<tt>fonts.map</tt>’ and place it higher in the the library path (for
instance in your ‘<tt>~/.a2ps/</tt>’ directory).
</p>
<hr size="6">
<a name="Style-Sheet-Files"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Adding-More-Font-Support" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Style-Sheet-Files-1"></a>
<h2 class="section">5.4 Style Sheet Files</h2>
<a name="index-sheets_002emap"></a>
<p>The style sheets are defined in various files. See see section <a href="#Pretty-Printing">Pretty Printing</a> 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 (see section <a href="#Map-Files">Map Files</a>). This file is
‘<tt>sheets.map</tt>’.
</p>
<p>Its format is simple:
</p><table><tr><td> </td><td><pre class="example"><var>style-key</var>: <var>patterns</var>
</pre></td></tr></table>
<p>or
</p><table><tr><td> </td><td><pre class="example">include(<var>file</var>)
</pre></td></tr></table>
<p>The <var>patterns</var> need not be on separate lines. There are two kinds
of patterns:
</p><dl compact="compact">
<dt> /<var>pattern</var>/<var>flags</var></dt>
<dd><p>if the current file name matches <var>pattern</var>, then select style
<var>style-key</var> (i.e. file ‘<tt><var>style-key</var>.ssh</tt>’).
</p>
</dd>
<dt> <<var>pattern</var>><var>flags</var></dt>
<dd><p>if the result of a call to <code>file(1)</code> matches <var>pattern</var>, then
select style <var>style-key</var>.
</p></dd>
</dl>
<p>Currently <var>flags</var> can only be ‘<samp>i</samp>’, 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 <var>pattern</var>
as is, i.e., the <var>pattern</var> should itself be lower case.
</p>
<p>The special <var>style-key</var> ‘<samp>binary</samp>’ tells a2psthe file should not be printed, and will be ignored, unless option
‘<samp>--print-anyway</samp>’ is given.
</p>
<p>If a style name can’t be found, the plain style is used.
</p>
<p>The map file is read bottom up, so that the “last” match is honored.
</p>
<p>Two things are to retain from this:
</p><ol>
<li>
if the file is presented through <code>stdin</code>, then a2ps<code>file(1)</code>. However, unless you specify a fake file name with
‘<samp>--stdin</samp>’, pattern matching upon the name is turn off. In general
you can expect correct delegations, but almost never pretty printing.
</li><li>
if <code>file</code> is wrong on some files, a2psIn this case, do try option ‘<samp>--guess</samp>’, compare it with the output
of <code>file</code>, and if the culprit is <code>file</code>, go and complain to
your system administrator :-), or fix it by defining your own filename
pattern matching rules.
</li></ol>
<p>Consider the case of Texinfo files as an example (the language in which
this documentation is written). Files are usually named
‘<tt>foo.texi</tt>’, ‘<tt>bar.txi</tt>’, or even ‘<tt>baz.texinfo</tt>’.
<code>file(1)</code> is able to recognize Texinfo files:
</p>
<table class="cartouche" border="1"><tr><td>
<table><tr><td> </td><td><pre class="example">doc % file a2ps.texi
a2ps.texi: Texinfo source text
</pre></td></tr></table>
</td></tr></table>
<p>Therefore the sheets.map would look like:
</p>
<table><tr><td> </td><td><pre class="example"># Texinfo files
texinfo: /*.txi/ /*.texi/ /*.texinfo/
<Texinfo source*>
</pre></td></tr></table>
<hr size="6">
<a name="Encodings"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Style-Sheet-Files" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#What-is-an-Encoding" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Library-Files" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Encodings-1"></a>
<h1 class="chapter">6. Encodings</h1>
<p>a2psuse. This chapter presents what an encoding is, how the encodings
support is handled within a2ps@c, and some encodings it supports.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#What-is-an-Encoding">6.1 What is an Encoding</a></td><td> </td><td align="left" valign="top"> The concept of encoding explained
</td></tr>
<tr><td align="left" valign="top"><a href="#Encoding-Files">6.2 Encoding Files</a></td><td> </td><td align="left" valign="top"> How a2ps handles the encodings
</td></tr>
</table>
<hr size="6">
<a name="What-is-an-Encoding"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Encodings" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Encoding-Files" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Encodings" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="What-is-an-Encoding-1"></a>
<h2 class="section">6.1 What is an Encoding</h2>
<p>This section is actually taken from the web pages of
<a href="http://www.alis.com/">Alis Technologies inc.</a>
</p>
<p>Document encoding is the most important but also the most sensitive and
explosive topic in Internet internationalization. It is an essential
factor since most of the information distributed over the Internet is in
text format. But the history of the Internet is such that the
predominant - and in some cases the only possible - encoding is the very
limited ASCII, which can represent only a handful of languages, only
three of which are used to any great extent: English, Indonesian and
Swahili.
</p>
<p>All the other languages, spoken by more than 90% of the world’s
population, must fall back on other character sets. And there is a
plethora of them, created over the years to satisfy writing constraints
and constantly changing technological limitations. The ISO
international character set registry contains only a small fraction;
IBM’s character registry is over three centimeters thick; Microsoft and
Apple each have a bunch of their own, as do other software manufacturers
and editors.
</p>
<p>The problem is not that there are too few but rather too many choices,
at least whenever Internet standards allow them. And the surplus is a
real problem; if every Arabic user made his own choice among the three
dozen or so codes available for this language, there is little
likelihood that his "neighbor" would do the same and that they would
thus be able to understand each other. This example is rather extreme,
but it does illustrate the importance of standards in the area of
internationalization. For a group of users sharing the same language to
be able to communicate,
</p>
<ol>
<li>
the code used in the shared document must always be identified
(labeling)
</li><li>
they must agree on a small number of codes - only one, if possible
(standards);
</li><li>
their software must recognize and process all codes (versatility)
</li></ol>
<p>Certain character sets stand out either because of their status as an
official national or international standard, or simply because of their
widespread use.
</p>
<p>First off, there is the ISO 8859 standards series that standardize a
dozen character sets that are useful for a large number of languages
using the Latin, Cyrillic, Arabic, Greek and Hebrew alphabets. These
standards have a limited range of application (8 bits per character, a
maximum of 190 characters, no combining) but where they suffice (as they
do for 10 of the 20 most widely used languages), they should be used on
the Internet in preference to other codes. For all other languages,
national standards should preferably be chosen or, if none are
available, a well-known and widely-used code should be the second
choice.
</p>
<p>Even when we limit ourselves to the most widely used standards, the
overabundance remains considerable, and this significantly complicates
life for truly international software developers and users of several
languages, especially when such languages can only be represented by a
single code. It was to resolve this problem that both Unicode and the
ISO 10646 International standard were created. Two standards? Oh no!
Their designers soon realized the problem and were able to cooperate to
the extent of making the character set <em>repertoires</em> and coding
identical.
</p>
<p>ISO 10646 (and Unicode) contain over 30,000 characters capable of
representing most of the living languages within a single code. All of
these characters, except for the <em>Han</em> (Chinese characters also
used in Japanese and Korean), have a name. And there is still room to
encode the missing languages as soon as enough of the necessary research
is done. Unicode can be used to represent several languages, using
different alphabets, within the same electronic document.
</p>
<hr size="6">
<a name="Encoding-Files"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#What-is-an-Encoding" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Encoding-Map-File" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Encodings" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Encodings" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Encoding-Files-1"></a>
<h2 class="section">6.2 Encoding Files</h2>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Encoding-Map-File">6.2.1 Encoding Map File</a></td><td> </td><td align="left" valign="top"> Mapping an encoding name to a file name
</td></tr>
<tr><td align="left" valign="top"><a href="#Encoding-Description-Files">6.2.2 Encoding Description Files</a></td><td> </td><td align="left" valign="top"> Specifying an encoding
</td></tr>
<tr><td align="left" valign="top"><a href="#Some-Encodings">6.2.3 Some Encodings</a></td><td> </td><td align="left" valign="top"> Classical or standard encodings
</td></tr>
</table>
<p>The support of the encodings in a2psto say, adding, removing or changing anything in its support for an encoding
does not require programming, nor even being a programmer.
</p>
<p>See section <a href="#What-is-an-Encoding">What is an Encoding</a>, if you want to know more about this.
</p>
<hr size="6">
<a name="Encoding-Map-File"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Encoding-Files" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Encoding-Description-Files" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Encodings" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Encoding-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Encoding-Map-File-1"></a>
<h3 class="subsection">6.2.1 Encoding Map File</h3>
<p>See section <a href="#Map-Files">Map Files</a>, for a description of the map files.
</p>
<p>The meaningful lines of the ‘<tt>encoding.map</tt>’ file have the form:
</p><table><tr><td> </td><td><pre class="example"><var>alias</var> <var>key</var>
iso-8859-1 latin1
latin1 latin1
l1 latin1
</pre></td></tr></table>
<p>where
</p><dl compact="compact">
<dt> <var>alias</var></dt>
<dd><p>specifies any name under which the encoding may be used. It influences
the option ‘<samp>--encoding</samp>’, but also the encodings dynamically
required, as for instance in the <code>mail</code> style sheet (support for
MIME).
</p>
<p>When <var>encoding</var> is asked, the lower case version of <var>encoding</var>
must be equal to <var>alias</var>.
</p>
</dd>
<dt> <var>key</var></dt>
<dd><p>specifies the prefix of the file describing the encoding
(‘<tt><var>key</var>.edf</tt>’, <a href="#Encoding-Description-Files">Encoding Description Files</a>).
</p></dd>
</dl>
<hr size="6">
<a name="Encoding-Description-Files"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Encoding-Map-File" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Some-Encodings" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Encodings" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Encoding-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Encoding-Description-Files-1"></a>
<h3 class="subsection">6.2.2 Encoding Description Files</h3>
<a name="index-_002eedf"></a>
<a name="index-EDF"></a>
<p>The encoding description file describing the encoding <var>key</var> is named
‘<tt><var>key</var>.edf</tt>’. It is subject to the same rules as any other
a2ps</p><ul class="toc">
<li>-
please make the name portable: alpha-numerical, at most 8 characters,
</li><li>-
empty lines and lines starting by ‘<samp>#</samp>’ are ignored.
</li></ul>
<p>The entries are
</p><dl compact="compact">
<dt> ‘<samp>Name:</samp>’</dt>
<dd><p>Specifies the full name of the encoding. Please, try to use the
official name if there is one.
</p><table><tr><td> </td><td><pre class="example">Name: ISO-8859-1
</pre></td></tr></table>
</dd>
<dt> ‘<samp>Documentation/EndDocumentation</samp>’</dt>
<dd><p>Introduces the documentation on the encoding (see section <a href="#Documentation-Format">Documentation Format</a>).
Typical informations expected are
the other important names this encoding has, and the languages it covers.
</p><table><tr><td> </td><td><pre class="example">Documentation
Also known as ISO Latin 1, or Latin 1. It is a superset
of ASCII, and covers most West-European languages.
EndDocumentation
</pre></td></tr></table>
</dd>
<dt> ‘<samp>Substitute:</samp>’</dt>
<dd><p>Introduces a font substitution. The most common fonts (e.g.,
<code>Courier</code>, <code>Times-Roman</code>...) do not support many encodings
(for instance it does not support Latin 2). To avoid that Latin 2 users
have to replace everywhere calls to <code>Courier</code>, a2psspecify that whenever a font is called in an encoding, then another font
should be used.
</p>
<p>For instance in ‘<tt>iso2.edf</tt>’ one can read:
</p><table><tr><td> </td><td><pre class="example"><i># Fonts from Ogonkify offer full support of ISO Latin 2</i>
Substitute: Courier Courier-Ogonki
Substitute: Courier-Bold Courier-Bold-Ogonki
Substitute: Courier-BoldOblique Courier-BoldOblique-Ogonki
Substitute: Courier-Oblique Courier-Oblique-Ogonki
</pre></td></tr></table>
</dd>
<dt> ‘<samp>Default:</samp>’</dt>
<dd><p>Introduces the name of the font that should be used when
a font (not substituted as per the previous item) is called
but provides to poor a support of the encoding. The <code>Courier</code>
equivalent is the best choice.
</p><table><tr><td> </td><td><pre class="example">Default: Courier-Ogonki
</pre></td></tr></table>
</dd>
<dt> ‘<samp>Vector:</samp>’</dt>
<dd><p>Introduces the PostScript encoding vector, that is a list of the 256
PostScript names of the characters. Note that only the printable
characters are named in PostScript (e.g., ‘<samp>bell</samp>’ in ASCII
(<code>^G</code>) should not be named). The special name ‘<samp>.notdef</samp>’ is to
be used when the character is not printable.
</p>
<p><strong>Warning.</strong> Make sure to use real, official, PostScript names.
Using names such as ‘<samp>c123</samp>’ may be the sign you use unusual names.
On the other hand PostScript names such as ‘<samp>afii8879</samp>’ are common.
</p></dd>
</dl>
<hr size="6">
<a name="Some-Encodings"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Encoding-Description-Files" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Encodings" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Encoding-Files" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Some-Encodings-1"></a>
<h3 class="subsection">6.2.3 Some Encodings</h3>
<p>Most of the following information is a courtesy of
<a href="http://www.alis.com/">Alis Technologies inc.</a> and of
<a href="mailto:zcyborra@cs.tu-berlin.de">Roman Czyborra</a>’s page about
<a href="http://czyborra.com/charsets/">The ISO 8859 Alphabet Soup</a>.
See section <a href="#What-is-an-Encoding">What is an Encoding</a>, is an instructive presentation of the
encodings.
</p>
<p>The known encodings are:
</p><dl>
<dt><a name="index-ASCII"></a><u>Encoding:</u> <b>ASCII</b><i> (‘<tt>ascii.edf</tt>’)</i></dt>
<dd><p>US-ASCII.
</p></dd></dl>
<dl>
<dt><a name="index-HPRoman"></a><u>Encoding:</u> <b>HPRoman</b><i> (‘<tt>hp.edf</tt>’)</i></dt>
<dd><p>The 8 bits Roman encoding for HP.
</p></dd></dl>
<dl>
<dt><a name="index-IBM_002dCP437"></a><u>Encoding:</u> <b>IBM-CP437</b><i> (‘<tt>ibm-cp437.edf</tt>’)</i></dt>
<dd><p>This encoding is meant to be used for PC files with drawing lines.
</p></dd></dl>
<dl>
<dt><a name="index-IBM_002dCP850"></a><u>Encoding:</u> <b>IBM-CP850</b><i> (‘<tt>ibm-cp850.edf</tt>’)</i></dt>
<dd><p>Several characters may be missing, especially Greek letters and some
mathematical symbols.
</p></dd></dl>
<dl>
<dt><a name="index-ISO_002d8859_002d1"></a><u>Encoding:</u> <b>ISO-8859-1</b><i> (‘<tt>iso1.edf</tt>’)</i></dt>
<dd><p>The ISO-8859-1 character set, often simply referred to as Latin 1,
covers most West European languages, such as French, Spanish, Catalan,
Basque, Portuguese, Italian, Albanian, Rhaeto-Romanic, Dutch, German,
Danish, Swedish, Norwegian, Finnish, Faroese, Icelandic, Irish,
Scottish, and English, incidentally also Afrikaans and Swahili, thus
in effect also the entire American continent, Australia and the
southern two-thirds of Africa. The lack of the ligatures Dutch IJ,
French OE and ,,German“ quotation marks is considered tolerable.
</p>
<p>The lack of the new C=-resembling Euro currency symbol U+20AC has
opened the discussion of a new Latin0.
</p></dd></dl>
<dl>
<dt><a name="index-ISO_002d8859_002d2"></a><u>Encoding:</u> <b>ISO-8859-2</b><i> (‘<tt>iso2.edf</tt>’)</i></dt>
<dd><p>The Latin 2 character set supports the Slavic languages of Central
Europe which use the Latin alphabet. The ISO-8859-2 set is used for
the following languages: Czech, Croat, German, Hungarian, Polish,
Romanian, Slovak and Slovenian.
</p>
<p>Support is provided thanks to Ogonkify.
</p></dd></dl>
<dl>
<dt><a name="index-ISO_002d8859_002d3"></a><u>Encoding:</u> <b>ISO-8859-3</b><i> (‘<tt>iso3.edf</tt>’)</i></dt>
<dd><p>This character set is used for Esperanto, Galician, Maltese and Turkish.
</p>
<p>Support is provided thanks to Ogonkify.
</p></dd></dl>
<dl>
<dt><a name="index-ISO_002d8859_002d4"></a><u>Encoding:</u> <b>ISO-8859-4</b><i> (‘<tt>iso4.edf</tt>’)</i></dt>
<dd><p>Some letters were added to the ISO-8859-4 to support languages such as
Estonian, Latvian and Lithuanian. It is an incomplete precursor of the
Latin 6 set.
</p>
<p>Support is provided thanks to Ogonkify.
</p></dd></dl>
<dl>
<dt><a name="index-ISO_002d8859_002d5"></a><u>Encoding:</u> <b>ISO-8859-5</b><i> (‘<tt>iso5.edf</tt>’)</i></dt>
<dd><p>The ISO-8859-5 set is used for various forms of the Cyrillic
alphabet. It supports Bulgarian, Byelorussian, Macedonian, Serbian and
Ukrainian.
</p>
<p>The Cyrillic alphabet was created by St. Cyril in the 9th century from
the upper case letters of the Greek alphabet. The more ancient
Glagolithic (from the ancient Slav glagol, which means "word"), was
created for certain dialects from the lower case Greek letters. These
characters are still used by Dalmatian Catholics in their liturgical
books. The kings of France were sworn in at Reims using a Gospel in
Glagolithic characters attributed to St. Jerome.
</p>
<p>Note that Russians seem to prefer the KOI8-R character set to the ISO
set for computer purposes. KOI8-R is composed using the lower half
(the first 128 characters) of the corresponding American ASCII
character set.
</p></dd></dl>
<dl>
<dt><a name="index-ISO_002d8859_002d7"></a><u>Encoding:</u> <b>ISO-8859-7</b><i> (‘<tt>iso7.edf</tt>’)</i></dt>
<dd><p>ISO-8859-7 was formerly known as ELOT-928 or ECMA-118:1986. It is
meant for modern Greek.
</p></dd></dl>
<dl>
<dt><a name="index-ISO_002d8859_002d9"></a><u>Encoding:</u> <b>ISO-8859-9</b><i> (‘<tt>iso9.edf</tt>’)</i></dt>
<dd><p>The ISO 8859-9 set, or Latin 5, replaces the rarely used Icelandic
letters from Latin 1 with Turkish letters.
</p>
<p>Support is provided thanks to Ogonkify.
</p></dd></dl>
<dl>
<dt><a name="index-ISO_002d8859_002d10"></a><u>Encoding:</u> <b>ISO-8859-10</b><i> (‘<tt>iso10.edf</tt>’)</i></dt>
<dd><p>Latin 6 (or ISO-8859-10) adds the last letters from Greenlandic and
Lapp which were missing in Latin 4, and thereby covers all
Scandinavia.
</p>
<p>Support is provided thanks to Ogonkify.
</p></dd></dl>
<dl>
<dt><a name="index-ISO_002d8859_002d13"></a><u>Encoding:</u> <b>ISO-8859-13</b><i> (‘<tt>iso13.edf</tt>’)</i></dt>
<dd><p>Latin7 (ISO-8859-13) is going to cover the Baltic Rim and re-establish
the Latvian (lv) support lost in Latin6 and may introduce the local
quotation marks.
</p>
<p>Support is provided thanks to Ogonkify.
</p></dd></dl>
<dl>
<dt><a name="index-ISO_002d8859_002d15"></a><u>Encoding:</u> <b>ISO-8859-15</b><i> (‘<tt>iso15.edf</tt>’)</i></dt>
<dd><p>The new Latin9 nicknamed Latin0 aims to update Latin1 by replacing
some less needed symbols (some fractions and accents) with forgotten
French and Finnish letters and placing the U+20AC Euro sign in the
cell of the former international currency sign.
</p>
<p>Very few fonts yet offer the possibility to print the Euro sign.
</p></dd></dl>
<dl>
<dt><a name="index-KOI8"></a><u>Encoding:</u> <b>KOI8</b><i> (‘<tt>koi8.edf</tt>’)</i></dt>
<dd><p>KOI-8 (+Ëë) is a subset of ISO-IR-111 that can be used in Serbia, Belarus
etc.
</p></dd></dl>
<dl>
<dt><a name="index-MS_002dCP1250"></a><u>Encoding:</u> <b>MS-CP1250</b><i> (‘<tt>ms-cp1250.edf</tt>’)</i></dt>
<dd><p>Microsoft’s CP-1250 encoding (aka CeP).
</p></dd></dl>
<dl>
<dt><a name="index-Macintosh"></a><u>Encoding:</u> <b>Macintosh</b><i> (‘<tt>mac.edf</tt>’)</i></dt>
<dd><p>For the Macintosh encoding. The support is not sufficient, and a lot
of characters may be missing at the end of the job (especially Greek
letters).
</p></dd></dl>
<hr size="6">
<a name="Pretty-Printing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Some-Encodings" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Syntactic-limits" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Encodings" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Pretty-Printing-1"></a>
<h1 class="chapter">7. Pretty Printing</h1>
<a name="index-Pretty-printing"></a>
<a name="index-Symbol-conversion"></a>
<p>The main feature of a2psTwo different levels of pretty printing can be reached:
</p><ul class="toc">
<li>-
basic (normal highlight level) in which what you print is what you
wrote.
</li><li>-
string (heavy highlight level), in which in general, some keywords are
replaced by a Symbol character which best represents them. For
instance, in most languages ‘<samp><=</samp>’ and ‘<samp>>=</samp>’ will be replaced by
the corresponding single character from the font Symbol.
</li></ul>
<p>Note that the difference is up to the author of the style sheet.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Syntactic-limits">7.1 Syntactic limits</a></td><td> </td><td align="left" valign="top"> What can’t be done
</td></tr>
<tr><td align="left" valign="top"><a href="#Known-Style-Sheets">7.2 Known Style Sheets</a></td><td> </td><td align="left" valign="top"> Some supported languages
</td></tr>
<tr><td align="left" valign="top"><a href="#Type-Setting-Style-Sheets">7.3 Type Setting Style Sheets</a></td><td> </td><td align="left" valign="top"> a2ps as a tiny word processor
</td></tr>
<tr><td align="left" valign="top"><a href="#Faces">7.4 Faces</a></td><td> </td><td align="left" valign="top"> Encoding the look of pieces of text
</td></tr>
<tr><td align="left" valign="top"><a href="#Style-sheets-semantics">7.5 Style Sheets Semantics</a></td><td> </td><td align="left" valign="top"> What is to be defined
</td></tr>
<tr><td align="left" valign="top"><a href="#Style-Sheets-Implementation">7.6 Style Sheets Implementation</a></td><td> </td><td align="left" valign="top"> How they should be defined
</td></tr>
<tr><td align="left" valign="top"><a href="#A-tutorial-on-style-sheets">7.7 A Tutorial on Style Sheets</a></td><td> </td><td align="left" valign="top"> Step by step example
</td></tr>
</table>
<hr size="6">
<a name="Syntactic-limits"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Pretty-Printing" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Known-Style-Sheets" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Syntactic-limits-1"></a>
<h2 class="section">7.1 Syntactic limits</h2>
<p>a2pshandles lexical structures, i.e., if in your favorite language
</p><table><tr><td> </td><td><pre class="example">IF IF == THEN THEN THEN := ELSE ELSE ELSE := IF
</pre></td></tr></table>
<p>is legal, then a2psjust looks for some keywords, or some <em>sequences</em>.
</p>
<hr size="6">
<a name="Known-Style-Sheets"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Syntactic-limits" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Type-Setting-Style-Sheets" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Known-Style-Sheets-1"></a>
<h2 class="section">7.2 Known Style Sheets</h2>
<dl>
<dt><a name="index-68000"></a><u>Style Sheet:</u> <b>68000</b><i> (‘<tt>68000.ssh</tt>’)</i></dt>
<dd><p>Althought designed at the origin for the 68k’s assembler, this style
sheet seems to handle rather well other dialects.
</p></dd></dl>
<dl>
<dt><a name="index-a2ps-configuration-file"></a><u>Style Sheet:</u> <b>a2ps configuration file</b><i> (‘<tt>a2psrc.ssh</tt>’)</i></dt>
<dd><p>Meant to print files such as ‘<samp>a2ps.cfg</samp>’, or ‘<samp>.a2ps/a2psrc</samp>’, etc.
</p></dd></dl>
<dl>
<dt><a name="index-a2ps-style-sheet"></a><u>Style Sheet:</u> <b>a2ps style sheet</b><i> (‘<tt>ssh.ssh</tt>’)</i></dt>
<dd><p>Second level of highligthing (option ‘<samp>-g</samp>’)) substitutes the LaTeX symbols.
</p></dd></dl>
<dl>
<dt><a name="index-Ada"></a><u>Style Sheet:</u> <b>Ada</b><i> (‘<tt>ada.ssh</tt>’)</i></dt>
<dd><p>This style sheets cover Ada 95. If you feel the need for Ada 83,
you’ll have to design another style sheet.
</p></dd></dl>
<dl>
<dt><a name="index-ASN_002e1"></a><u>Style Sheet:</u> <b>ASN.1</b><i> (‘<tt>asn1.ssh</tt>’)</i></dt>
<dd><p>Written by Philippe Coucaud.
ASN.1 (Abstract Syntax Notation One) is used to define the protocol data
units (PDUs) of all application layer protocols to date.
</p></dd></dl>
<dl>
<dt><a name="index-Autoconf"></a><u>Style Sheet:</u> <b>Autoconf</b><i> (‘<tt>autoconf.ssh</tt>’)</i></dt>
<dd><p>Suitable for both <code>configure.in</code> and library <code>m4</code> files.
</p></dd></dl>
<dl>
<dt><a name="index-AWK"></a><u>Style Sheet:</u> <b>AWK</b><i> (‘<tt>awk.ssh</tt>’)</i></dt>
<dd><p>Written by Edward Arthur.
This style is devoted to the AWK pattern scanning and processing language.
It is supposed to support classic awk, nawk and gawk.
</p></dd></dl>
<dl>
<dt><a name="index-B"></a><u>Style Sheet:</u> <b>B</b><i> (‘<tt>b.ssh</tt>’)</i></dt>
<dd><p>Written by Philippe Coucaud.
B is a formal specification method mostly used to describe critical
systems. It is based on the mathematical sets theory.
</p></dd></dl>
<dl>
<dt><a name="index-BC"></a><u>Style Sheet:</u> <b>BC</b><i> (‘<tt>bc.ssh</tt>’)</i></dt>
<dd><p>bc is an arbitrary precision calculator language.
</p></dd></dl>
<dl>
<dt><a name="index-Bourne-Shell"></a><u>Style Sheet:</u> <b>Bourne Shell</b><i> (‘<tt>sh.ssh</tt>’)</i></dt>
<dd><p>Some classical program names, or builtin, are highlighted in the
second level of pretty-printing.
</p></dd></dl>
<dl>
<dt><a name="index-C"></a><u>Style Sheet:</u> <b>C</b><i> (‘<tt>c.ssh</tt>’)</i></dt>
<dd><p>This style does not highlight the function definitions.
Another style which highlights them, GNUish C, is provided (gnuc.ssh).
It works only if you respect some syntactic conventions.
</p></dd></dl>
<dl>
<dt><a name="index-C-Shell"></a><u>Style Sheet:</u> <b>C Shell</b><i> (‘<tt>csh.ssh</tt>’)</i></dt>
<dd><p>Written by Jim Diamond.
Some classical program names, and/or builtins, are highlighted in
the second level of pretty-printing.
</p></dd></dl>
<dl>
<dt><a name="index-C_002b_002b"></a><u>Style Sheet:</u> <b>C++</b><i> (‘<tt>cxx.ssh</tt>’)</i></dt>
<dd><p>Should handle all known variations of C++. Most declarations (classes
etc.) are not highlighted as they should be. Please, step forward!
</p></dd></dl>
<dl>
<dt><a name="index-CAML"></a><u>Style Sheet:</u> <b>CAML</b><i> (‘<tt>caml.ssh</tt>’)</i></dt>
<dd><p>This style is obsolete: use OCaml instead.
</p></dd></dl>
<dl>
<dt><a name="index-ChangeLog"></a><u>Style Sheet:</u> <b>ChangeLog</b><i> (‘<tt>chlog.ssh</tt>’)</i></dt>
<dd><p>This style covers the usual ChangeLog files.
</p></dd></dl>
<dl>
<dt><a name="index-Claire"></a><u>Style Sheet:</u> <b>Claire</b><i> (‘<tt>claire.ssh</tt>’)</i></dt>
<dd><p>Claire is a high-level functional and object-oriented language with
advanced rule processing capabilities. It is intended to allow the
programmer to express complex algorithms with fewer lines and in an
elegant and readable manner.
</p>
<p>To provide a high degree of expressivity, Claire uses:
</p><ul class="toc">
<li>-
A very rich type system including type intervals and second-order
types (with dual static/dynamic typing),
</li><li>-
Parametric classes and methods,
</li><li>-
An object-oriented logic with set extensions,
</li><li>-
Dynamic versioning that supports easy exploration of search spaces.
</li></ul>
<p>To achieve its goal of readability, Claire uses
</p><ul class="toc">
<li>-
set-based programming with an intuitive syntax,
</li><li>-
simple-minded object-oriented programming,
</li><li>-
truly polymorphic and parametric functional programming,
</li><li>-
a powerful-yet-readable extension of DATALOG to express logical conditions,
</li><li>-
an entity-relation approach with explicit relations, inverses,
unknown values and relational
</li><li>-
operations.
</li></ul>
<p>More information on claire can be found on
<a href="http://www.ens.fr/~laburthe/claire.html">claire home page</a>.
</p></dd></dl>
<dl>
<dt><a name="index-Common-Lisp"></a><u>Style Sheet:</u> <b>Common Lisp</b><i> (‘<tt>clisp.ssh</tt>’)</i></dt>
<dd><p>Written by Juliusz Chroboczek.
It is not very clear what should be considered as a ‘keyword’ in
Common Lisp. I like binders, control structures and declarations to
be highlighted, but not assignments.
</p>
<p>Names of defstructs are not highlighted because this would not work
with defstruct options.
</p></dd></dl>
<dl>
<dt><a name="index-Coq-Vernacular"></a><u>Style Sheet:</u> <b>Coq Vernacular</b><i> (‘<tt>coqv.ssh</tt>’)</i></dt>
<dd><p>This style is devoted to the Coq v 5.10 vernacular language.
</p></dd></dl>
<dl>
<dt><a name="index-CORBA-IDL"></a><u>Style Sheet:</u> <b>CORBA IDL</b><i> (‘<tt>cidl.ssh</tt>’)</i></dt>
<dd><p>Written by Bob Phillips.
A first attempt at a style sheet for OMG CORBA IDL.
I believe I captured all the keywords for CORBA 2.2 IDL.
I also stole code from gnuc.ssh to print the method names
in bold face. I’m not sure I quite like my own choices
for Keyword_strong and Keyword, so I’m looking for feedback.
Note that, as with gnuc.ssh, for a method name to be noted as such,
the left parenthesis associated with the argument list for the method
must appear on the same line as the method name.
</p></dd></dl>
<dl>
<dt><a name="index-CPP"></a><u>Style Sheet:</u> <b>CPP</b><i> (‘<tt>cpp.ssh</tt>’)</i></dt>
<dd><p>C traditional preprocessor handling, mostly meant to be inherited.
</p></dd></dl>
<dl>
<dt><a name="index-dc_005fshell"></a><u>Style Sheet:</u> <b>dc_shell</b><i> (‘<tt>dc_shell.ssh</tt>’)</i></dt>
<dd><p>Written by Philippe Le Van.
Synopsys Design Compiler is a synthesis tool used by
electronic companies for the design of their chips.
This sheet is very incomplete, we have a lot of keywords to
add, eventually options to highlight...
The Label_strong style is used for commands which change the design.
</p></dd></dl>
<dl>
<dt><a name="index-Eiffel"></a><u>Style Sheet:</u> <b>Eiffel</b><i> (‘<tt>eiffel.ssh</tt>’)</i></dt>
<dd><p>Eiffel is an object oriented language that also includes a
comprehensive approach to software construction: a method.
</p>
<p>The language itself is not just a programming language but also covers
analysis, design and implementation.
</p>
<p>Heavy highlight uses symbols to represent common math operators.
</p></dd></dl>
<dl>
<dt><a name="index-Emacs-Lisp"></a><u>Style Sheet:</u> <b>Emacs Lisp</b><i> (‘<tt>elisp.ssh</tt>’)</i></dt>
<dd><p>Written by Didier Verna.
This style sheet includes support for some extensions dumped with XEmacs.
</p></dd></dl>
<dl>
<dt><a name="index-Encapsulated-PostScript"></a><u>Style Sheet:</u> <b>Encapsulated PostScript</b><i> (‘<tt>eps.ssh</tt>’)</i></dt>
<dd><p>Illegal PostScript operators are highlighted as Errors.
</p></dd></dl>
<dl>
<dt><a name="index-Extended-Tcl"></a><u>Style Sheet:</u> <b>Extended Tcl</b><i> (‘<tt>tclx.ssh</tt>’)</i></dt>
<dd><p>Written by Phil Hollenback.
Extensions to plain Tcl.
</p></dd></dl>
<dl>
<dt><a name="index-Fortran"></a><u>Style Sheet:</u> <b>Fortran</b><i> (‘<tt>fortran.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou, Alexander Mai.
There are several Fortran dialects, depending whether, on the one
hand, you use Fortran 77 or Fortran 90/95, and, on the other hand,
Fixed form comments, or Free form comments.
</p>
<p>The style sheets <code>for77kwds</code> and <code>for90kwds</code> implements keywords only,
while the style sheets <code>for-fixed</code> and <code>for-free</code> implements comments
only.
</p>
<p>This style sheet tries to support any of the various flavors
(Fortran 77/90/95, fixed or free form). For more specific uses, you
should use either:
</p><ul class="toc">
<li>-
for77-fixed, for Fortran 77 fixed form,
</li><li>-
for77-free, for Fortran 77 free form,
</li><li>-
for90-fixed, for Fortran 90/95 fixed form,
</li><li>-
for90-free, for Fortran 90/95 free form.
</li></ul>
</dd></dl>
<dl>
<dt><a name="index-Fortran-77-Fixed"></a><u>Style Sheet:</u> <b>Fortran 77 Fixed</b><i> (‘<tt>for77-fixed.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou, Alexander Mai.
Dedicated to Fortran 77 in fixed form, i.e., comments are
lines starting with c, C, or *, and only those lines are comments.
</p></dd></dl>
<dl>
<dt><a name="index-Fortran-77-Free"></a><u>Style Sheet:</u> <b>Fortran 77 Free</b><i> (‘<tt>for77-free.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou, Alexander Mai.
Dedicated to Fortran 77 in free form, i.e., comments are introduced by !
anywhere on the line, and nothing else is a comment.
</p></dd></dl>
<dl>
<dt><a name="index-Fortran-77-Keywords"></a><u>Style Sheet:</u> <b>Fortran 77 Keywords</b><i> (‘<tt>for77kwds.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou, Alexander Mai.
This sheet implements only Fortran 77 keywords, and avoids implementing
comments support. This is to allow for implementation of either fixed
or free source form.
</p>
<p>See the documentation of the style sheet <code>fortran</code> for more details.
</p></dd></dl>
<dl>
<dt><a name="index-Fortran-90-Fixed"></a><u>Style Sheet:</u> <b>Fortran 90 Fixed</b><i> (‘<tt>for90-fixed.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou, Alexander Mai.
Dedicated to Fortran 90/95 in fixed form, i.e., comments are
lines starting with c, C, or *, and only those lines are comments.
</p></dd></dl>
<dl>
<dt><a name="index-Fortran-90-Free"></a><u>Style Sheet:</u> <b>Fortran 90 Free</b><i> (‘<tt>for90-free.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou, Alexander Mai.
Dedicated to Fortran 90/95 in free form, i.e., comments are introduced by !
anywhere on the line, and nothing else is a comment.
</p></dd></dl>
<dl>
<dt><a name="index-Fortran-90-Keywords"></a><u>Style Sheet:</u> <b>Fortran 90 Keywords</b><i> (‘<tt>for90kwds.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou, Alexander Mai.
This sheet implements the superset which Fortran 90 and Fortran 95 provide
over Fortran 77.
</p>
<p>See the documentation of the style sheet <code>fortran</code> for more details.
</p></dd></dl>
<dl>
<dt><a name="index-Fortran-Fixed"></a><u>Style Sheet:</u> <b>Fortran Fixed</b><i> (‘<tt>for-fixed.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou, Alexander Mai.
Implements comments of Fortran in fixed form, i.e., comments are
lines starting with c, C, or *, and only those lines are comments.
No other highlighting is done.
</p>
<p>See the documentation of the style sheet <code>fortran</code> for more details.
</p></dd></dl>
<dl>
<dt><a name="index-Fortran-Free"></a><u>Style Sheet:</u> <b>Fortran Free</b><i> (‘<tt>for-free.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou, Alexander Mai.
Dedicated to Fortran in free form, i.e., comments are introduced by !
anywhere on the line, and nothing else is a comment.
</p></dd></dl>
<dl>
<dt><a name="index-GNUish-C"></a><u>Style Sheet:</u> <b>GNUish C</b><i> (‘<tt>gnuc.ssh</tt>’)</i></dt>
<dd><p>Declaration of functions are highlighted <em>only</em> if you start
the function name in the first column, and it is followed by an
opening parenthesis. In other words, if you write
</p><table><tr><td> </td><td><pre class="example">int main (void)
</pre></td></tr></table>
<p>it won’t work. Write:
</p><table><tr><td> </td><td><pre class="example">int
main (void)
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><a name="index-GNUMakefile"></a><u>Style Sheet:</u> <b>GNUMakefile</b><i> (‘<tt>gmake.ssh</tt>’)</i></dt>
<dd><p>Written by Alexander Mai.
Special tokens of GNUmakefiles and non terminal declarations are highlighted.
</p></dd></dl>
<dl>
<dt><a name="index-Haskell"></a><u>Style Sheet:</u> <b>Haskell</b><i> (‘<tt>haskell.ssh</tt>’)</i></dt>
<dd><p>Written by Ilya Beylin.
Haskell: non-strict functional programming language
http::/www.haskell.org/
</p></dd></dl>
<dl>
<dt><a name="index-HTML"></a><u>Style Sheet:</u> <b>HTML</b><i> (‘<tt>html.ssh</tt>’)</i></dt>
<dd><p>Written by Wesley J. Chun.
This style is meant to pretty print HTML source files, not to simulate
its interpretation (i.e., ‘<samp><bold>foo</bold></samp>’ does not print ‘<samp>foo</samp>’
in bold). If you really meant to print the result of the HTML file
<em>interpreted</em>, then you should turn the delegations on, and make sure
‘<samp>a2ps</samp>’ has HTML delegations.
</p></dd></dl>
<dl>
<dt><a name="index-IDL"></a><u>Style Sheet:</u> <b>IDL</b><i> (‘<tt>idl.ssh</tt>’)</i></dt>
<dd><p>Written by Robert S. Mallozzi, Manfred Schwarb.
Style sheet for IDL 5.2 (Interactive Data Language).
Obsolete routines are not supported.
http://www.rsinc.com.
</p></dd></dl>
<dl>
<dt><a name="index-InstallShield-5"></a><u>Style Sheet:</u> <b>InstallShield 5</b><i> (‘<tt>is5rul.ssh</tt>’)</i></dt>
<dd><p>Written by Alex.
InstallShield5 _TM_ RUL script.
</p></dd></dl>
<dl>
<dt><a name="index-Java"></a><u>Style Sheet:</u> <b>Java</b><i> (‘<tt>java.ssh</tt>’)</i></dt>
<dd><p>Written by Steve Alexander.
Documentation comments are mapped to strong comments, and any other
comment is plain comment.
</p></dd></dl>
<dl>
<dt><a name="index-JavaScript"></a><u>Style Sheet:</u> <b>JavaScript</b><i> (‘<tt>js.ssh</tt>’)</i></dt>
<dd><p>Written by Scott Pakin.
Keywords used are everything listed in the Client-Side JavaScript
Reference 1.3, plus "undefined" (why isn’t that listed?) and
"prototype". I omitted the semi-standard a2ps optional operators for
equality, because JavaScript’s use of both strict- and non-strict equality
might ambiguate the output. Finally, regular expressions are formatted
like strings.
</p></dd></dl>
<dl>
<dt><a name="index-LACE"></a><u>Style Sheet:</u> <b>LACE</b><i> (‘<tt>lace.ssh</tt>’)</i></dt>
<dd><p>This is meant for the Eiffel equivalent of the Makefiles.
</p></dd></dl>
<dl>
<dt><a name="index-Lex"></a><u>Style Sheet:</u> <b>Lex</b><i> (‘<tt>lex.ssh</tt>’)</i></dt>
<dd><p>In addition to the C constructs, it highlights the declaration of
states, and some special ‘<samp>%</samp>’ commands.
</p></dd></dl>
<dl>
<dt><a name="index-Lout"></a><u>Style Sheet:</u> <b>Lout</b><i> (‘<tt>lout.ssh</tt>’)</i></dt>
<dd><p>Written by Jean-Baptiste Nivoit.
This is the style for Lout files.
</p></dd></dl>
<dl>
<dt><a name="index-Mail-Folder"></a><u>Style Sheet:</u> <b>Mail Folder</b><i> (‘<tt>mail.ssh</tt>’)</i></dt>
<dd><p>To use from elm and others, it is better to specify ‘<samp>-g -Email</samp>’,
since the file sent to printer is no longer truly a mail folder.
This style also suits to news. ‘<samp>--strip</samp>’ options are also useful
(they strip "useless" headers).
</p>
<p>Whenever the changes of encoding are clear, a2ps sets itself the
encoding for the parts concerned.
</p>
<p>Tag 1 is the subject, and Tag 2 the author of the mail/news.
</p>
<p>Note: This style sheet is _very_ difficult to write. Please don’t
report behavior you don’t like. Just send me improvements,
or write a Bison parser for mails.
</p></dd></dl>
<dl>
<dt><a name="index-Makefile"></a><u>Style Sheet:</u> <b>Makefile</b><i> (‘<tt>make.ssh</tt>’)</i></dt>
<dd><p>Special tokens, and non terminal declarations are highlighted.
</p></dd></dl>
<dl>
<dt><a name="index-Management-Information-Base"></a><u>Style Sheet:</u> <b>Management Information Base</b><i> (‘<tt>mib.ssh</tt>’)</i></dt>
<dd><p>Written by Kelly Wiles.
The MIB file is of ASN.1 syntax.
</p></dd></dl>
<dl>
<dt><a name="index-Maple"></a><u>Style Sheet:</u> <b>Maple</b><i> (‘<tt>maple.ssh</tt>’)</i></dt>
<dd><p>Written by Richard J Mathar.
Some classical program names, and/or builtins, are highlighted in
the second level of pretty-printing.
</p></dd></dl>
<dl>
<dt><a name="index-MATLAB-4"></a><u>Style Sheet:</u> <b>MATLAB 4</b><i> (‘<tt>matlab4.ssh</tt>’)</i></dt>
<dd><p>Written by Marco De la Cruz.
Note that comments in the code should have a space after the %.
</p></dd></dl>
<dl>
<dt><a name="index-Modula-2"></a><u>Style Sheet:</u> <b>Modula 2</b><i> (‘<tt>modula2.ssh</tt>’)</i></dt>
<dd><p>Written by Peter Bartke.
</p></dd></dl>
<dl>
<dt><a name="index-Modula-3"></a><u>Style Sheet:</u> <b>Modula 3</b><i> (‘<tt>modula3.ssh</tt>’)</i></dt>
<dd><p>Modula-3 is a member of the Pascal family of languages. Designed in
the late 1980s at Digital Equipment Corporation and Olivetti, Modula-3
corrects many of the deficiencies of Pascal and Modula-2 for practical
software engineering. In particular, Modula-3 keeps the simplicity of
type safety of the earlier languages, while providing new facilities
for exception handling, concurrency, object-oriented programming, and
automatic garbage collection. Modula-3 is both a practical
implementation language for large software projects and an excellent
teaching language.
</p>
<p>This sheet was designed based on <a href="http://www.research.digital.com/SRC/modula-3/html/home.html">Modula 3 home page</a>.
</p></dd></dl>
<dl>
<dt><a name="index-o2c"></a><u>Style Sheet:</u> <b>o2c</b><i> (‘<tt>o2c.ssh</tt>’)</i></dt>
</dl>
<dl>
<dt><a name="index-Oberon"></a><u>Style Sheet:</u> <b>Oberon</b><i> (‘<tt>oberon.ssh</tt>’)</i></dt>
<dd><p>Created by N. Wirth, Oberon is the successor of the Pascal and
Modula-2 family of programming languages. It was specifically designed
for systems programming, and was used to create the Oberon system in
cooperation with J. Gutknecht. A few years later, the Oberon language
was extended with additional object-oriented features to result in the
programming language Oberon-2.
</p>
<p>Implementation of the sheet based on <a href="http://www.math.tau.ac.il/~laden/Oberon.html">The Oberon Reference Site</a>.
</p></dd></dl>
<dl>
<dt><a name="index-Objective-C"></a><u>Style Sheet:</u> <b>Objective C</b><i> (‘<tt>objc.ssh</tt>’)</i></dt>
<dd><p>Written by Paul Shum.
</p></dd></dl>
<dl>
<dt><a name="index-OCaml"></a><u>Style Sheet:</u> <b>OCaml</b><i> (‘<tt>ocaml.ssh</tt>’)</i></dt>
<dd><p>Written by Markus Mott.
This style should also suit other versions of ML (caml light, SML etc.).
</p></dd></dl>
<dl>
<dt><a name="index-OCaml-Yacc"></a><u>Style Sheet:</u> <b>OCaml Yacc</b><i> (‘<tt>mly.ssh</tt>’)</i></dt>
<dd><p>Written by Jean-Baptiste Nivoit.
Should handle CAML Special Light parser files.
</p></dd></dl>
<dl>
<dt><a name="index-Octave"></a><u>Style Sheet:</u> <b>Octave</b><i> (‘<tt>octave.ssh</tt>’)</i></dt>
<dd><p>Written by C.P. Earls.
</p></dd></dl>
<dl>
<dt><a name="index-Oracle-parameter-file"></a><u>Style Sheet:</u> <b>Oracle parameter file</b><i> (‘<tt>initora.ssh</tt>’)</i></dt>
<dd><p>Written by Pierre Mareschal.
For init.ora parameter files.
</p></dd></dl>
<dl>
<dt><a name="index-Oracle-PL_002fSQL"></a><u>Style Sheet:</u> <b>Oracle PL/SQL</b><i> (‘<tt>plsql.ssh</tt>’)</i></dt>
<dd><p>Written by Pierre Mareschal.
This style is to be checked.
</p></dd></dl>
<dl>
<dt><a name="index-Oracle-SQL"></a><u>Style Sheet:</u> <b>Oracle SQL</b><i> (‘<tt>sql.ssh</tt>’)</i></dt>
<dd><p>Written by Pierre Mareschal.
a2ps-sql Pretty Printer Version 1.0.0 beta - 18-MAR-97
For comments, support for – /*..*/ and //.
This style is to be checked.
</p></dd></dl>
<dl>
<dt><a name="index-Oracle-SQL_002dPL_002fSQL_002dSQL_002aPlus"></a><u>Style Sheet:</u> <b>Oracle SQL-PL/SQL-SQL*Plus</b><i> (‘<tt>oracle.ssh</tt>’)</i></dt>
<dd><p>Written by Pierre Mareschal.
18-MAR-97
For comments, support for – /*..*/ and //.
This style is to be checked.
</p></dd></dl>
<dl>
<dt><a name="index-Pascal"></a><u>Style Sheet:</u> <b>Pascal</b><i> (‘<tt>pascal.ssh</tt>’)</i></dt>
<dd><p>The standard Pascal is covered by this style.
But some extension have been added too, hence modern Pascal programs
should be correctly handled.
Heavy highlighting maps mathematical symbols to their typographic
equivalents.
</p></dd></dl>
<dl>
<dt><a name="index-Perl"></a><u>Style Sheet:</u> <b>Perl</b><i> (‘<tt>perl.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou.
As most interpreted languages, Perl is very free on its syntax, what
leads to significant problems for a pretty printer. Please, be kind
with our try. Any improvement is most welcome.
</p></dd></dl>
<dl>
<dt><a name="index-PostScript"></a><u>Style Sheet:</u> <b>PostScript</b><i> (‘<tt>ps.ssh</tt>’)</i></dt>
<dd><p>Only some keywords are highlighted, because otherwise listings are quickly
becoming a big bold spot.
</p></dd></dl>
<dl>
<dt><a name="index-PostScript-Printer-Description"></a><u>Style Sheet:</u> <b>PostScript Printer Description</b><i> (‘<tt>ppd.ssh</tt>’)</i></dt>
<dd><p>Support for Adobe’s PPD files.
</p></dd></dl>
<dl>
<dt><a name="index-Pov_002dRay"></a><u>Style Sheet:</u> <b>Pov-Ray</b><i> (‘<tt>pov.ssh</tt>’)</i></dt>
<dd><p>Written by Jean-Baptiste Nivoit.
Should handle Persistence Of Vision input files.
</p></dd></dl>
<dl>
<dt><a name="index-PreScript"></a><u>Style Sheet:</u> <b>PreScript</b><i> (‘<tt>pre.ssh</tt>’)</i></dt>
<dd><p>This style defines commands in the canonic syntax of a2ps.
It is meant to be used either as an input language, and to
highlight the table of contents etc.
</p>
<p>It can be a good choice of destination language for people who
want to produce text to print (e.g. pretty-printing, automated
documentation etc.) but who definitely do not want to learn
PostScript, nor to require the use of LaTeX.
</p></dd></dl>
<dl>
<dt><a name="index-PreTeX"></a><u>Style Sheet:</u> <b>PreTeX</b><i> (‘<tt>pretex.ssh</tt>’)</i></dt>
<dd><p>This style sheets provides LaTeX-like commands to format text.
It is an alternative to the PreScript style sheet, in which formating
commands are specified in a more a2ps related syntax.
</p>
<p>It provides by the use of LaTeX like commands, a way to describe the
pages that this program should produce.
</p></dd></dl>
<dl>
<dt><a name="index-Prolog"></a><u>Style Sheet:</u> <b>Prolog</b><i> (‘<tt>prolog.ssh</tt>’)</i></dt>
<dd><p>Help is needed on this sheet.
</p></dd></dl>
<dl>
<dt><a name="index-Promela"></a><u>Style Sheet:</u> <b>Promela</b><i> (‘<tt>promela.ssh</tt>’)</i></dt>
<dd><p>There is no way for this program to highlight send and receive primitives.
</p></dd></dl>
<dl>
<dt><a name="index-Python"></a><u>Style Sheet:</u> <b>Python</b><i> (‘<tt>python.ssh</tt>’)</i></dt>
<dd><p>Python is an easy to learn, powerful programming language. It has
efficient high-level data structures and a simple but effective
approach to object-oriented programming. Python’s elegant syntax and
dynamic typing, together with its interpreted nature, make it an ideal
language for scripting and rapid application development in many areas
on most platforms.
</p>
<p>The Python interpreter and the extensive standard library are freely
available in source or binary form for all major platforms from the
<a href="http://www.python.org">Python web site</a>, and can be freely distributed.
</p>
<p>The same site also contains distributions of and pointers to many free
third party Python modules, programs and tools, and additional
documentation.
</p>
<p>The Python interpreter is easily extended with new functions and data
types implemented in C or C++ (or other languages callable from
C). Python is also suitable as an extension language for customizable
applications.
</p></dd></dl>
<dl>
<dt><a name="index-Reference-Card"></a><u>Style Sheet:</u> <b>Reference Card</b><i> (‘<tt>card.ssh</tt>’)</i></dt>
<dd><p>This style sheet is meant to process help messages generated by
Unix applications. It highlights the options (-short or –long),
and their arguments.
Normal use of this style sheet is through the shell script card
(part of the a2ps package), but a typical hand-driven use is:
</p><table><tr><td> </td><td><pre class="example">program --help | a2ps -Ecard
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><a name="index-REXX"></a><u>Style Sheet:</u> <b>REXX</b><i> (‘<tt>rexx.ssh</tt>’)</i></dt>
<dd><p>Written by Alexander Mai.
This style sheet supports REXX.
You can get information about REXX from the <a href="http://www.rexxla.org">REXX Language Association</a>.
</p></dd></dl>
<dl>
<dt><a name="index-Sather"></a><u>Style Sheet:</u> <b>Sather</b><i> (‘<tt>sather.ssh</tt>’)</i></dt>
<dd><p>Sather is an object oriented language designed to be simple,
efficient, safe, flexible and non-proprietary. One way of placing it
in the ‘space of languages’ is to say that it aims to be as efficient
as C, C++, or Fortran, as elegant as and safer than Eiffel, and
support higher-order functions and iteration abstraction as well as
Common Lisp, CLU or Scheme.
</p>
<p>Implementation of the sheet based on the <a href="http://www.icsi.berkeley.edu/~sather/index.html">Sather home page</a>.
</p>
<p>Heavy highlighting uses symbols for common mathematical operators.
</p></dd></dl>
<dl>
<dt><a name="index-Scheme"></a><u>Style Sheet:</u> <b>Scheme</b><i> (‘<tt>scheme.ssh</tt>’)</i></dt>
<dd><p>This style sheet is looking for a maintainer and/or comments.
</p></dd></dl>
<dl>
<dt><a name="index-SDL_002d88"></a><u>Style Sheet:</u> <b>SDL-88</b><i> (‘<tt>sdl88.ssh</tt>’)</i></dt>
<dd><p>Written by Jean-Philippe Cottin.
–strip-level=2 is very useful: it cancels the graphical information
left by graphic editors. Only the pure specification is then printed.
</p></dd></dl>
<dl>
<dt><a name="index-Sed"></a><u>Style Sheet:</u> <b>Sed</b><i> (‘<tt>sed.ssh</tt>’)</i></dt>
<dd><p>Comments and labels are highlighted. Other ideas are welcome!
A lot of work is still needed.
</p></dd></dl>
<dl>
<dt><a name="index-Shell"></a><u>Style Sheet:</u> <b>Shell</b><i> (‘<tt>shell.ssh</tt>’)</i></dt>
<dd><p>This style sheet is not meant to be used directly, but rather an as
ancestor for shell style sheets.
</p></dd></dl>
<dl>
<dt><a name="index-SQL-92"></a><u>Style Sheet:</u> <b>SQL 92</b><i> (‘<tt>sql92.ssh</tt>’)</i></dt>
<dd><p>Written by Pierre Mareschal.
18-MAR-97
This style is to be checked.
</p></dd></dl>
<dl>
<dt><a name="index-Standard-ML"></a><u>Style Sheet:</u> <b>Standard ML</b><i> (‘<tt>sml.ssh</tt>’)</i></dt>
<dd><p>Written by Franklin Chen, Daniel Wang.
This style sheet takes advantage of the Symbol font to replace many
ASCII operators with their natural graphical representation. This
is enabled only at heavy highlighting.
</p></dd></dl>
<dl>
<dt><a name="index-Symbols"></a><u>Style Sheet:</u> <b>Symbols</b><i> (‘<tt>symbols.ssh</tt>’)</i></dt>
<dd><p>This style sheet should be a precursor for any style sheet which
uses LaTeX like symbols.
</p></dd></dl>
<dl>
<dt><a name="index-TC-Shell"></a><u>Style Sheet:</u> <b>TC Shell</b><i> (‘<tt>tcsh.ssh</tt>’)</i></dt>
<dd><p>Written by Jim Diamond.
C shell with file name completion and command line editing.
</p></dd></dl>
<dl>
<dt><a name="index-TeX"></a><u>Style Sheet:</u> <b>TeX</b><i> (‘<tt>tex.ssh</tt>’)</i></dt>
<dd><p>Written by Denis Girou.
This is the style for (La)TeX files.
It’s mainly useful for people who develop (La)TeX packages.
With ‘<samp>-g</samp>’, common mathematical symbols are represented graphically.
</p></dd></dl>
<dl>
<dt><a name="index-Texinfo"></a><u>Style Sheet:</u> <b>Texinfo</b><i> (‘<tt>texinfo.ssh</tt>’)</i></dt>
<dd><p>Heavy highlighting prints the nodes on separate pages
which title is the name of the node.
</p></dd></dl>
<dl>
<dt><a name="index-TeXScript"></a><u>Style Sheet:</u> <b>TeXScript</b><i> (‘<tt>texscript.ssh</tt>’)</i></dt>
<dd><p>TeXScript is the new name of what used to be called PreScript.
New PreScript has pure a2ps names, PreTeX has pure TeX names,
and TeXScript mixes both.
</p></dd></dl>
<dl>
<dt><a name="index-Tiger"></a><u>Style Sheet:</u> <b>Tiger</b><i> (‘<tt>tiger.ssh</tt>’)</i></dt>
<dd><p>Tiger is a toy language that serves as example of the book
<a href="http://www.cs.princeton.edu/~appel/modern/">Modern Compiler Implementation</a>
by Andrew W. Appel.
</p></dd></dl>
<dl>
<dt><a name="index-tk"></a><u>Style Sheet:</u> <b>tk</b><i> (‘<tt>tk.ssh</tt>’)</i></dt>
<dd><p>Written by Larry W. Virden.
Since everything, or almost, is a string, what is printed is not
always what you would like.
</p></dd></dl>
<dl>
<dt><a name="index-Tool-Command-Language"></a><u>Style Sheet:</u> <b>Tool Command Language</b><i> (‘<tt>tcl.ssh</tt>’)</i></dt>
<dd><p>Written by Larry W. Virden.
Since everything, or almost, is a string, what is printed is not
always what you would like.
</p></dd></dl>
<dl>
<dt><a name="index-Unified-Diff"></a><u>Style Sheet:</u> <b>Unified Diff</b><i> (‘<tt>udiff.ssh</tt>’)</i></dt>
<dd><p>This style is meant to be used onto the output unidiffs, that is to say
output from ‘<samp>diff -u</samp>’.
</p>
<p>Typical use of this style is:
</p><table><tr><td> </td><td><pre class="example">diff -u old new | a2ps -Eudiff
</pre></td></tr></table>
<p>The prologue <code>diff</code> helps to highlight the differences
(‘<samp>a2ps -Ewdiff --prologue=diff</samp>’).
</p></dd></dl>
<dl>
<dt><a name="index-Unity"></a><u>Style Sheet:</u> <b>Unity</b><i> (‘<tt>unity.ssh</tt>’)</i></dt>
<dd><p>Written by Jean-Philippe Cottin.
The graphic conversion of the symbols (option ‘<samp>-g</samp>’) is nice.
</p></dd></dl>
<dl>
<dt><a name="index-VERILOG"></a><u>Style Sheet:</u> <b>VERILOG</b><i> (‘<tt>verilog.ssh</tt>’)</i></dt>
<dd><p>Written by Edward Arthur.
This style is devoted to the VERILOG hardware description language.
</p></dd></dl>
<dl>
<dt><a name="index-VHDL"></a><u>Style Sheet:</u> <b>VHDL</b><i> (‘<tt>vhdl.ssh</tt>’)</i></dt>
<dd><p>Written by Thomas Parmelan.
Non-textual operators are not highlighted.
Some logical operators are printed as graphical symbols
in the second level of pretty-printing.
</p></dd></dl>
<dl>
<dt><a name="index-Visual-Basic-for-Applications"></a><u>Style Sheet:</u> <b>Visual Basic for Applications</b><i> (‘<tt>vba.ssh</tt>’)</i></dt>
<dd><p>Written by Dirk Eddelbuettel.
</p></dd></dl>
<dl>
<dt><a name="index-Visual-Tcl"></a><u>Style Sheet:</u> <b>Visual Tcl</b><i> (‘<tt>vtcl.ssh</tt>’)</i></dt>
<dd><p>Written by Phil Hollenback.
All the Vtcl keywords that aren’t in Tcl or TclX.
</p></dd></dl>
<dl>
<dt><a name="index-VRML"></a><u>Style Sheet:</u> <b>VRML</b><i> (‘<tt>vrml.ssh</tt>’)</i></dt>
<dd><p>Written by Nadine Richard.
According to
<a href="http://vag.vrml.org/VRML2.0/FINAL/spec/part1/grammar.html">Grammar Definition Version 2.0 ISO/IEC CD 14772</a>.
</p></dd></dl>
<dl>
<dt><a name="index-wdiff"></a><u>Style Sheet:</u> <b>wdiff</b><i> (‘<tt>wdiff.ssh</tt>’)</i></dt>
<dd><p>This style is meant to be used onto the output of Franc,ois Pinard’s
program <code>wdiff</code>. <code>wdiff</code> is a utility that underlines the differences
of words between to files. Where <code>diff</code> make only the difference between
lines that have changed, <code>wdiff</code> reports words that have changed inside the lines.
</p>
<p>Typical use of this style is:
</p><table><tr><td> </td><td><pre class="example">wdiff old new | a2ps -Ewdiff
</pre></td></tr></table>
<p><code>wdiff</code> can be found in usual GNU repositories. The prologue <code>diff</code>
helps to highlight the differences (‘<samp>a2ps -Ewdiff --prologue=diff</samp>’).
</p></dd></dl>
<dl>
<dt><a name="index-XS"></a><u>Style Sheet:</u> <b>XS</b><i> (‘<tt>xs.ssh</tt>’)</i></dt>
<dd><p>Written by Kestutis Kupciunas.
This style covers Perl XS language.
</p></dd></dl>
<dl>
<dt><a name="index-Yacc"></a><u>Style Sheet:</u> <b>Yacc</b><i> (‘<tt>yacc.ssh</tt>’)</i></dt>
<dd><p>Special tokens, and non terminal declarations are highlighted.
</p></dd></dl>
<dl>
<dt><a name="index-Z-Shell"></a><u>Style Sheet:</u> <b>Z Shell</b><i> (‘<tt>zsh.ssh</tt>’)</i></dt>
<dd><p>Zsh is a UNIX command interpreter (shell) usable as an interactive
login shell and as a shell script command processor. Of the standard
shells, zsh most closely resembles ksh but includes many enhancements.
Zsh has comand line editing, builtin spelling correction, programmable
command completion, shell functions (with autoloading), a history
mechanism, and a host of other features.
</p>
<p>This style sheet highlights some classical program names and builtins
in the second level of pretty-printing.
</p></dd></dl>
<hr size="6">
<a name="Type-Setting-Style-Sheets"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Known-Style-Sheets" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Symbol" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Type-Setting-Style-Sheets-1"></a>
<h2 class="section">7.3 Type Setting Style Sheets</h2>
<p>This section presents a few style sheets that define page description
languages (compared to most other style sheet meant to pretty print
source files).
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Symbol">7.3.1 Symbol</a></td><td> </td><td align="left" valign="top"> Access to the glyphs of the Symbol font
</td></tr>
<tr><td align="left" valign="top"><a href="#PreScript">7.3.2 PreScript</a></td><td> </td><td align="left" valign="top"> Typesetting in an a2ps like syntax
</td></tr>
<tr><td align="left" valign="top"><a href="#PreTeX">7.3.3 PreTeX</a></td><td> </td><td align="left" valign="top"> Typesetting in a LaTeX like syntax
</td></tr>
<tr><td align="left" valign="top"><a href="#TeXScript">7.3.4 TeXScript</a></td><td> </td><td align="left" valign="top"> Typesetting in a mixture of both
</td></tr>
</table>
<hr size="6">
<a name="Symbol"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Type-Setting-Style-Sheets" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#PreScript" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Type-Setting-Style-Sheets" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Symbol-1"></a>
<h3 class="subsection">7.3.1 Symbol</h3>
<p>The style sheet <code>Symbol</code> introduces easy to type keywords to obtain
the special characters of the PostScript font <code>Symbol</code>. The
keywords are named to provide a LaTeX taste. These keywords are also
the names used when designing a style sheet, hence to get the full list,
see <a href="#A-Bit-of-Syntax">A Bit of Syntax</a>.
</p>
<p>If you want to know the correspondence, it is suggested to print the
style sheet file of <code>Symbol</code>:
</p><table><tr><td> </td><td><pre class="example">a2ps -g symbol.ssh
</pre></td></tr></table>
<hr size="6">
<a name="PreScript"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Symbol" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Syntax" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Type-Setting-Style-Sheets" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="PreScript-1"></a>
<h3 class="subsection">7.3.2 PreScript</h3>
<a name="index-PreScript-1"></a>
<p><code>PreScript</code> has been designed in conjunction with a2ps@c. Since
bold sequences, special characters etc. were implemented in a2ps@c, we
thought it would be good to allow direct access to those features:
<code>PreScript</code> became an input language for a2ps@c, where special
font treatments are specified in an <code>ssh</code> syntax (see section <a href="#Style-Sheets-Implementation">Style Sheets Implementation</a>).
</p>
<p>The main advantages for using <code>PreScript</code> are:
</p><ul class="toc">
<li>-
it is fairly simple,
</li><li>-
a2psevery UNIX platform.
</li></ul>
<p>It can be a good candidate for generation of PostScript output
(syntactic pretty-printers, generation of various reports etc.).
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Syntax">7.3.2.1 Syntax</a></td><td> </td><td align="left" valign="top"> Lexical specifications
</td></tr>
<tr><td align="left" valign="top"><a href="#PreScript-Commands">7.3.2.2 PreScript Commands</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#PreScript-examples">7.3.2.3 Examples</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr size="6">
<a name="Syntax"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#PreScript" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#PreScript-Commands" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PreScript" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Syntax-1"></a>
<h4 class="subsubsection">7.3.2.1 Syntax</h4>
<p>Every command name begins with a backslash (‘<samp>\</samp>’). If the command
uses an argument, it is given between curly braces with no spaces
between the command name and the argument.
</p>
<p>The main limit on <code>PreScript</code> is that no command can be used inside
another command. For instance the following line will be badly
interpreted by a2ps@c:
</p>
<table><tr><td> </td><td><pre class="example">\Keyword{Problems using \keyword{recursive \copyright} calls}
</pre></td></tr></table>
<p>The correct way to write this in <code>PreScript</code> is
</p>
<table><tr><td> </td><td><pre class="example">\Keyword{Problems using} \keyword{recursive} \copyright \Keyword{calls}.
</pre></td></tr></table>
<p>Everything from an unquoted % to the end of line is ignored
(comments).
</p>
<hr size="6">
<a name="PreScript-Commands"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Syntax" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#PreScript-examples" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PreScript" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="PreScript-Commands-1"></a>
<h4 class="subsubsection">7.3.2.2 PreScript Commands</h4>
<p>These commands required arguments.
</p>
<dl compact="compact">
<dt> ‘<samp>\keyword{<var>text</var>}</samp>’</dt>
<dt> ‘<samp>\Keyword{<var>text</var>}</samp>’</dt>
<dd><p>Highlight lightly/strongly the given <var>text</var>. Should be used only
for a couple of adjacent words.
</p>
</dd>
<dt> ‘<samp>\comment{<var>text</var>}</samp>’</dt>
<dt> ‘<samp>\Comment{<var>text</var>}</samp>’</dt>
<dd><p>The <var>text</var> is given a special face. The <var>text</var> may be removed
if option ‘<samp>--strip</samp>’ is used.
</p>
</dd>
<dt> ‘<samp>\label{<var>text</var>}</samp>’</dt>
<dt> ‘<samp>\Label{<var>text</var>}</samp>’</dt>
<dd><p><var>text</var> should be considered as a definition, or an important point
in the structure of the whole text.
</p>
</dd>
<dt> ‘<samp>\string{<var>text</var>}</samp>’</dt>
<dd><p>Write <var>text</var> with string’s face (e.g., in font Times).
</p>
</dd>
<dt> ‘<samp>\error{<var>text</var>}</samp>’</dt>
<dd><p>Write <var>text</var> with error’s face (generally a very different face, so
that you see immediately).
</p>
</dd>
<dt> ‘<samp>\symbol{<var>text</var>}</samp>’</dt>
<dd><p><var>text</var> is written in the PostScript symbol font. This feature is
not compatible with LaTeX. It is recommended, when possible, to use
the special keywords denoting symbols, which are compatible with
LaTeX (see section <a href="#Symbol">Symbol</a>).
</p>
</dd>
<dt> ‘<samp>\header{<var>text</var>}</samp>’</dt>
<dt> ‘<samp>\footer{<var>text</var>}</samp>’</dt>
<dd><p>Use <var>text</var> as header (footer) for the current page. If several
headers or footers are defined on the same page, the last one is taken
into account.
</p>
</dd>
<dt> ‘<samp>\encoding{<var>key</var>}</samp>’</dt>
<dd><p>Change dynamically the current encoding. After this command, the text is
printed using the encoding corresponding to <var>key</var>.
</p></dd>
</dl>
<hr size="6">
<a name="PreScript-examples"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#PreScript-Commands" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#PreTeX" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PreScript" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Examples"></a>
<h4 class="subsubsection">7.3.2.3 Examples</h4>
<p><code>PreScript</code> and a2psformating. For instance, on the ‘<tt>passwd</tt>’ file:
</p>
<table><tr><td> </td><td><pre class="smallexample">ypcat passwd |
awk -F: \
'{print "\Keyword{" $5 "} (" $1 ") \rightarrow\keyword{" $7 "}"}'\
| a2ps -Epre -P
</pre></td></tr></table>
<hr size="6">
<a name="PreTeX"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#PreScript-examples" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Special-characters" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Type-Setting-Style-Sheets" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="PreTeX-1"></a>
<h3 class="subsection">7.3.3 PreTeX</h3>
<p>The aim of the PreTeX style sheet is to provide something similar to
<code>PreScript</code>, but with a more LaTeX like syntax.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Special-characters">7.3.3.1 Special characters</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#PreTeX-Commands">7.3.3.2 PreTeX Commands</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Differences-with-LaTeX">7.3.3.3 Differences with LaTeX</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr size="6">
<a name="Special-characters"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#PreTeX" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#PreTeX-Commands" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PreTeX" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Special-characters-1"></a>
<h4 class="subsubsection">7.3.3.1 Special characters</h4>
<p>‘<samp>$</samp>’ is ignored in <code>PreTeX</code> for compatibility with LaTeX,
and ‘<samp>%</samp>’ introduces a comment. Hence they are the only symbols which
have to be quoted by a ‘<samp>\</samp>’. The following characters should also be
quoted to produce good LaTeX files, but are accepted by
<code>PreScript</code>: ‘<samp>_</samp>’, ‘<samp>&</samp>’, ‘<samp>#</samp>’.
</p>
<p>Note that <em>inside a command</em>, like <code>\textbf</code>, the quotation
mechanism does not work in <code>PreScript</code> (<code>\textrm{#$%}</code>
writes ‘<samp>#$%</samp>’) though LaTeX still requires quotation. Hence whenever
special characters or symbols are introduced, they should be at the
outer most level.
</p>
<hr size="6">
<a name="PreTeX-Commands"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Special-characters" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Differences-with-LaTeX" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PreTeX" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="PreTeX-Commands-1"></a>
<h4 class="subsubsection">7.3.3.2 PreTeX Commands</h4>
<p>These commands required arguments.
</p>
<dl compact="compact">
<dt> ‘<samp>\section{<var>Title</var>}</samp>’</dt>
<dt> ‘<samp>\subsection{<var>Title</var>}</samp>’</dt>
<dt> ‘<samp>\subsubsection{<var>Title</var>}.</samp>’</dt>
<dd><p>Used to specify the title of a section, subsection or subsubsection.
</p>
</dd>
<dt> ‘<samp>\textbf{<var>text</var>}</samp>’</dt>
<dt> ‘<samp>\textit{<var>text</var>}</samp>’</dt>
<dt> ‘<samp>\textbi{<var>text</var>}</samp>’</dt>
<dt> ‘<samp>\textrm{<var>text</var>}</samp>’</dt>
<dd><p>write <var>text</var> in bold, italic, bold-italic, Times. Default font is
Courier.
</p>
</dd>
<dt> ‘<samp>\textsy{<var>text</var>}</samp>’</dt>
<dd><p><var>text</var> is written in the PostScript symbol font. This feature is
not compatible with LaTeX. It is recommended, when possible, to use the
special keywords denoting symbols, which are compatible with LaTeX
(See the style sheet <code>Symbol</code>).
</p>
</dd>
<dt> ‘<samp>\header{<var>text</var>}</samp>’</dt>
<dt> ‘<samp>\footer{<var>text</var>}</samp>’</dt>
<dd><p>Use <var>text</var> as header (footer) for the current page. If several
headers or footers are defined on the same page, the last one is taken
into account.
</p>
</dd>
<dt> ‘<samp>\verb+<var>text</var>+</samp>’</dt>
<dd><p>Quote <var>text</var> so that no special sequence will be interpreted. In
‘<samp>\verb+<var>quoted string</var>+</samp>’ ‘<samp>+</samp>’ can be any symbol in
‘<samp>+</samp>’, ‘<samp>!</samp>’, ‘<samp>|</samp>’, ‘<samp>#</samp>’, ‘<samp>=</samp>’.
</p>
</dd>
<dt> ‘<samp>\begin{document}</samp>’</dt>
<dt> ‘<samp>\end{document}</samp>’</dt>
<dt> ‘<samp>\begin{itemize}</samp>’</dt>
<dt> ‘<samp>\end{itemize}</samp>’</dt>
<dt> ‘<samp>\begin{enumerate}</samp>’</dt>
<dt> ‘<samp>\end{enumerate}</samp>’</dt>
<dt> ‘<samp>\begin{description}</samp>’</dt>
<dt> ‘<samp>\end{description}</samp>’</dt>
<dd><p>These commands are legal in LaTeX but have no sense in PreTeX.
Hence there are simply ignored and not printed (if immediately followed
by an end-of-line).
</p></dd>
</dl>
<hr size="6">
<a name="Differences-with-LaTeX"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#PreTeX-Commands" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#TeXScript" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PreTeX" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Differences-with-LaTeX-1"></a>
<h4 class="subsubsection">7.3.3.3 Differences with LaTeX</h4>
<p>The following symbols, inherited from the style sheet <code>Symbol</code>, are
not supported by LaTeX:
</p>
<p>‘<samp>\Alpha</samp>’, ‘<samp>\apple</samp>’, ‘<samp>\Beta</samp>’, ‘<samp>\carriagereturn</samp>’,
‘<samp>\Chi</samp>’, ‘<samp>\Epsilon</samp>’, ‘<samp>\Eta</samp>’, ‘<samp>\florin</samp>’, ‘<samp>\Iota</samp>’,
‘<samp>\Kappa</samp>’, ‘<samp>\Mu</samp>’, ‘<samp>\Nu</samp>’, ‘<samp>\Omicron</samp>’, ‘<samp>\omicron</samp>’,
‘<samp>\radicalex</samp>’, ‘<samp>\register</samp>’, ‘<samp>\Rho</samp>’, ‘<samp>\suchthat</samp>’,
‘<samp>\Tau</samp>’, ‘<samp>\therefore</samp>’, ‘<samp>\trademark</samp>’, ‘<samp>\varUpsilon</samp>’,
‘<samp>\Zeta</samp>’.
</p>
<p>LaTeX is more demanding about special symbols. Most of them must be
in so-called math mode, which means that the command must be inside
‘<samp>$</samp>’ signs. For instance, though
</p><table><tr><td> </td><td><pre class="example">If \forall x \in E, x \in F then E \subseteq F.
</pre></td></tr></table>
<p>is perfectly legal in PreTeX, it should be written
</p><table><tr><td> </td><td><pre class="example">If $\forall x \in E, x \in F$ then $E \subseteq F$.
</pre></td></tr></table>
<p>for LaTeX. Since in PreTeX every ‘<samp>$</samp>’ is discarded (unless
quoted by a ‘<samp>\</samp>’), the second form is also admitted.
</p>
<hr size="6">
<a name="TeXScript"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Differences-with-LaTeX" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Faces" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Type-Setting-Style-Sheets" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="TeXScript-1"></a>
<h3 class="subsection">7.3.4 TeXScript</h3>
<p><code>TeXScript</code> is a replacement of the old version of
<code>PreScript</code>: it combines both the a2ps@c-like and the
LaTeX-like syntaxes through inheritance of both <code>PreScript</code> and
<code>PreTeX</code>.
</p>
<p>In addition it provides commands meant to ease processing of file for
a2ps</p>
<p>Everything between ‘<samp>%%TeXScript:skip</samp>’ and ‘<samp>%%TeXScript:piks</samp>’
will be ignored in <code>TeXScript</code>, so that there can be inserted
command definitions for LaTeX exclusively.
</p>
<p>The commands ‘<samp>\textbi</samp>’ (for bold-italic) and ‘<samp>\textsy</samp>’ (for
symbol) do not exist in LaTeX. They should be defined in the
preamble:
</p>
<table><tr><td> </td><td><pre class="example">%%TeXScript:skip
\newcommand{\textbi}[1]{\textbf{\textit{#1}}}
\newcommand{\textsy}[1]{#1}
%%TeXScript:piks
</pre></td></tr></table>
<p>There is no way in TeXScript to get an automatic numbering. There is
no equivalent to the LaTeX environment <code>enumerate</code>. But every
command beginning by <code>\text</code> is doubled by a command beginning by
‘<samp>\magic</samp>’. a2psHence, if one specifies that arguments of those functions should be
ignored in the preamble of the LaTeX document, the numbering is
emulated. For instance
</p><table><tr><td> </td><td><pre class="example">\begin{enumerate}
\magicbf{1.}\item First line
\magicbf{2.}\item Second line
\end{enumerate}
</pre></td></tr></table>
<p>will be treated the same way both in TeXScript and LaTeX.
</p>
<p>‘<samp>\header</samp>’ and ‘<samp>\footer</samp>’, are not understood by LaTeX.
</p>
<hr size="6">
<a name="Faces"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#TeXScript" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Style-sheets-semantics" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Faces-1"></a>
<h2 class="section">7.4 Faces</h2>
<a name="index-Face"></a>
<p>A <em>face</em> is an attribute given to a piece of text, which specifies
how it should look like. Since a2pssource files, the faces it uses are related to the syntactic entities
that can be encountered in a file.
</p>
<p>The faces a2ps</p><dl compact="compact">
<dt> ‘<samp>Plain</samp>’</dt>
<dd><p>This corresponds to the text body.
</p>
</dd>
<dt> ‘<samp>Keyword</samp>’</dt>
<dt> ‘<samp>Keyword_strong</samp>’</dt>
<dd><p>These are related to the keywords that may appear in a text.
</p>
</dd>
<dt> ‘<samp>Comment</samp>’</dt>
<dt> ‘<samp>Comment_strong</samp>’</dt>
<dd><p>These are related to comments in the text. Remember that comments
should be considered as non essential ("<em>Aaaeaaarg</em>" says the
programmer); indeed, the user might suppress the comments thanks (?) to
the option ‘<samp>--strip-level</samp>’. Hence, <strong>never</strong> use these faces
just because you think they look better on, say, strings.
</p>
</dd>
<dt> ‘<samp>Label</samp>’</dt>
<dt> ‘<samp>Label_strong</samp>’</dt>
<dd><p>These are used when a point of extreme importance, or a sectioning
point, is met. Typically, functions declarations etc.
</p>
</dd>
<dt> ‘<samp>String</samp>’</dt>
<dd><p>Used mainly for string and character literals.
</p>
</dd>
<dt> ‘<samp>Error</samp>’</dt>
<dd><p>Used to underline the presence of an error. For instance in
Encapsulated PostScript, some PostScript operators are forbidden: they
are underlined as errors.
</p></dd>
</dl>
<p>Actually, there is also the face ‘<samp>Symbol</samp>’, but this one is
particular: it is not legal changing its font.
</p>
<hr size="6">
<a name="Style-sheets-semantics"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Faces" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Name-and-key" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Style-Sheets-Semantics"></a>
<h2 class="section">7.5 Style Sheets Semantics</h2>
<a name="index-Style-sheet"></a>
<p>a2psone per language. In the following is described how the style sheets
are defined. You may skip this section if you don’t care how
a2ps</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Name-and-key">7.5.1 Name and key</a></td><td> </td><td align="left" valign="top"> Both names of a style sheet
</td></tr>
<tr><td align="left" valign="top"><a href="#Comments">7.5.2 Comments</a></td><td> </td><td align="left" valign="top"> Author name, version etc.
</td></tr>
<tr><td align="left" valign="top"><a href="#Alphabets">7.5.3 Alphabets</a></td><td> </td><td align="left" valign="top"> What words are legal
</td></tr>
<tr><td align="left" valign="top"><a href="#Case-sensitivity">7.5.4 Case sensitivity</a></td><td> </td><td align="left" valign="top"> Is BEGIN different of begin
</td></tr>
<tr><td align="left" valign="top"><a href="#P_002dRules">7.5.5 P-Rules</a></td><td> </td><td align="left" valign="top"> Pretty Printing Rules
</td></tr>
<tr><td align="left" valign="top"><a href="#Sequences">7.5.6 Sequences</a></td><td> </td><td align="left" valign="top"> Strings, comments etc.
</td></tr>
<tr><td align="left" valign="top"><a href="#Optional-entries">7.5.7 Optional entries</a></td><td> </td><td align="left" valign="top"> Second level of pretty printing
</td></tr>
</table>
<hr size="6">
<a name="Name-and-key"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Style-sheets-semantics" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Comments" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-sheets-semantics" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Name-and-key-1"></a>
<h3 class="subsection">7.5.1 Name and key</h3>
<a name="index-key"></a>
<a name="index-sheets_002emap-1"></a>
<p>Every style sheet has both a key, and a name. The name can be clean and
beautiful, with any character you might want. The key is in fact the
prefix part of the file name, and is alpha-numerical, lower case, and
less than 8 characters long.
</p>
<p>Anywhere a2psuses the key (in the ‘<tt>sheets.map</tt>’ file, with the option ‘<samp>-E</samp>’,
etc.).
</p>
<p>As an example, C++ is implemented in a file called ‘<tt>cxx.ssh</tt>’, in
which the name is declared to be ‘<samp>C++</samp>’.
</p>
<p>The rationale is that not every system accepts any character in the file
name (e.g., no ‘<samp>+</samp>’ in MS-DOS). Moreover, it allows to make
symbolic links on the ssh files (e.g., ‘<samp>ln -s cxx.ssh c++.ssh</samp>’
let’s you use ‘<samp>-E c++</samp>’).
</p>
<hr size="6">
<a name="Comments"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Name-and-key" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Alphabets" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-sheets-semantics" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Comments-1"></a>
<h3 class="subsection">7.5.2 Comments</h3>
<p>ssh files can include the name of its author, a version number, a
documentation note and a requirement on the version of a2ps@c. For
instance, if a style sheet requires a2psversion 4.9.5 will reject it.
</p>
<hr size="6">
<a name="Alphabets"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Comments" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Case-sensitivity" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-sheets-semantics" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Alphabets-1"></a>
<h3 class="subsection">7.5.3 Alphabets</h3>
<a name="index-Alphabets"></a>
<a name="index-Separator"></a>
<p>a2psespecially keywords. Hence it needs two alphabets: the first one
specifying by which letters an identifier can begin, and the second one
for the rest of the word. If you prefer, a keyword starts with a
character belonging to the first alphabet, and a character not
pertaining to the second is a separator.
</p>
<hr size="6">
<a name="Case-sensitivity"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Alphabets" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#P_002dRules" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-sheets-semantics" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Case-sensitivity-1"></a>
<h3 class="subsection">7.5.4 Case sensitivity</h3>
<p>If the style is case insensitive, then matching is case insensitive
(keywords, operators and sequences).
</p>
<hr size="6">
<a name="P_002dRules"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Case-sensitivity" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Sequences" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-sheets-semantics" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="P_002dRules-1"></a>
<h3 class="subsection">7.5.5 P-Rules</h3>
<a name="index-Keyword"></a>
<a name="index-Rule"></a>
<a name="index-P_002dRule"></a>
<a name="index-Operator"></a>
<p>A <em>P-rule</em> (Pretty printing rule), or <em>rule</em> for short, is a
structure which consists of two items:
</p><dl compact="compact">
<dt> <em>lhs</em></dt>
<dd><a name="index-lhs"></a>
</dd>
<dt> <em>left-hand side</em></dt>
<dd><p>its source string, with which the source file is compared;
</p>
</dd>
<dt> <em>rhs</em></dt>
<dd><a name="index-rhs"></a>
</dd>
<dt> <em>right hand side</em></dt>
<dd><p>a list of faced strings which will replace the text matched in the
pretty-printed output. A faced string is composed of
</p><ul class="toc">
<li>-
a string, or a reference to a part of the source string
(see <a href="regex.html#Back_002dreference-Operator">(regex)Back-reference Operator</a> section ‘Back-reference Operator’ in <cite>Regex manual</cite>)
</li><li>-
the face to use to print it
</li></ul>
</dd>
</dl>
<p>Just a short example: ‘<samp>(foo, bar, Keyword_strong)</samp>’ as a rule
means that every input occurrence of ‘<samp>foo</samp>’ will be replaced by
‘<samp>bar</samp>’, written with the <code>Keyword_strong</code> face.
</p>
<p>If the destination string is empty, then a2psstring. This is different from giving the source string as a
destination string if the case is different. An example will make it
fairly clear.
</p>
<p>Let <code>foobar</code> be a case insensitive style sheet including the
rules ‘<samp>(foo, "", Keyword)</samp>’ and ‘<samp>(bar, bar, Keyword)</samp>’. Then,
on the input ‘<samp>FOO BAR</samp>’, a2ps<code>Keyword</code>.
</p>
<p>a2pscomes from that some keywords are sensitive to the delimiters around
them (such as ‘<samp>unsigned</samp>’ and ‘<samp>int</samp>’ in <code>C</code>, which are
definitely not the same thing as ‘<samp>unsignedint</samp>’), and others not (in
<code>C</code>, ‘<samp>!=</samp>’ is "different from" both in ‘<samp>a != b</samp>’ and
‘<samp>a!=b</samp>’).
</p>
<p>The first ones are called <em>keywords</em> in a2psseconds are <em>operators</em>. Operators are matched anywhere they
appear, while keywords need to have separators around them
(see section <a href="#Alphabets">Alphabets</a>).
</p>
<p>Let us give a more complicated example: that of the <code>Yacc</code> rules.
A rule in <code>Yacc</code> is of the form:
</p><table><tr><td> </td><td><pre class="example">a_rule : part1 part2 ;
</pre></td></tr></table>
<p>Suppose you want to highlight these rules. To recognize them, you will
write a regular expression specifying that:
</p><ol>
<li>
it must start at the beginning of the line,
</li><li>
then there is string composed of symbols, which is what you want to
highlight,
</li><li>
and a colon, which can be preceded by blank characters.
</li></ol>
<p>The regexp you want is: ‘<samp>/^[a-zA-Z0-9_]*[\t ]*:/</samp>’. But with the
rule
</p><table><tr><td> </td><td><pre class="example">/^[a-zA-Z0-9_]*[\t ]*:/, "", Label_strong
</pre></td></tr></table>
<p>the blanks and the colon are highlighted too. Hence you need to
specify some parts in the regexp (see <a href="regex.html#Back_002dreference-Operator">(regex)Back-reference Operator</a> section ‘Back-reference Operator’ in <cite>Regex manual</cite>), and use a longer
list of destination strings. The correct rule is
</p><table><tr><td> </td><td><pre class="example">(/^([a-zA-Z0-9_]*)([\t ]*:)/, \1 Label_strong, \2 Plain)
</pre></td></tr></table>
<p>Since it is a bit painful to read, regexps can be spread upon several
lines. It is strongly suggested to break them by groups, and to
document the group:
</p><table><tr><td> </td><td><pre class="example">(/^([a-zA-Z0-9_]*)/ # \1. Name of the rule
/([\t ]*:)/ # \2. Trailing space and colon
\1 Label_strong, \2 Plain)
</pre></td></tr></table>
<hr size="6">
<a name="Sequences"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#P_002dRules" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Optional-entries" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-sheets-semantics" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Sequences-1"></a>
<h3 class="subsection">7.5.6 Sequences</h3>
<a name="index-Sequences"></a>
<a name="index-Markers"></a>
<p>A <em>sequence</em> is a string between two <em>markers</em>, along with a
list of exceptions. A marker is a fixed string. Typical examples are
comments, string (with usually ‘<samp>"</samp>’ as opening and closing markers,
and ‘<samp>\\</samp>’ and ‘<samp>\"</samp>’ as exceptions) etc. Three faces are used:
one for the initial marker, one for the core of the sequence, and a last
one for the final maker.
</p>
<hr size="6">
<a name="Optional-entries"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Sequences" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheets-Implementation" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-sheets-semantics" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Optional-entries-1"></a>
<h3 class="subsection">7.5.7 Optional entries</h3>
<a name="index-Optional-entries"></a>
<p>There are two levels of pretty-printing encoded in the style sheets. By
default, a2psoption ‘<samp>-g</samp>’ is specified, in which case, <em>heavy</em> highlighting
is invoked, i.e., optional keywords, operators and sequences are
considered.
</p>
<hr size="6">
<a name="Style-Sheets-Implementation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Optional-entries" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#A-Bit-of-Syntax" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Style-Sheets-Implementation-1"></a>
<h2 class="section">7.6 Style Sheets Implementation</h2>
<p>In the previous section (see section <a href="#Style-sheets-semantics">Style Sheets Semantics</a>) were explained
the various items needed to understand the machinery involved in pretty
printing. Here, their implementation, i.e., how to write a style sheet
file, is explained. The next section (see section <a href="#A-tutorial-on-style-sheets">A Tutorial on Style Sheets</a>), exposes a step by step simple example.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#A-Bit-of-Syntax">7.6.1 A Bit of Syntax</a></td><td> </td><td align="left" valign="top"> Lexical rules of the ssh language
</td></tr>
<tr><td align="left" valign="top"><a href="#Style-Sheet-Header">7.6.2 Style Sheet Header</a></td><td> </td><td align="left" valign="top"> Declaration of a style
</td></tr>
<tr><td align="left" valign="top"><a href="#Syntax-of-the-Words">7.6.3 Syntax of the Words</a></td><td> </td><td align="left" valign="top"> Classes of the Characters
</td></tr>
<tr><td align="left" valign="top"><a href="#Inheriting">7.6.4 Inheriting from Other Style Sheets</a></td><td> </td><td align="left" valign="top"> Extending existing style sheets
</td></tr>
<tr><td align="left" valign="top"><a href="#Syntax-for-the-P_002dRules">7.6.5 Syntax for the P-Rules</a></td><td> </td><td align="left" valign="top"> Atomic Pretty Printing rules
</td></tr>
<tr><td align="left" valign="top"><a href="#Declaring-keywords-and-operators">7.6.6 Declaring the keywords and the operators</a></td><td> </td><td align="left" valign="top"> Special Classes of Identifiers
</td></tr>
<tr><td align="left" valign="top"><a href="#Declaring-sequences">7.6.7 Declaring the sequences</a></td><td> </td><td align="left" valign="top"> Bordered Lexical Entities
</td></tr>
<tr><td align="left" valign="top"><a href="#Checking-a-Style-Sheet">7.6.8 Checking a Style Sheet</a></td><td> </td><td align="left" valign="top"> Ask a2ps to Check the Sheet
</td></tr>
</table>
<hr size="6">
<a name="A-Bit-of-Syntax"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Style-Sheets-Implementation" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheet-Header" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheets-Implementation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="A-Bit-of-Syntax-1"></a>
<h3 class="subsection">7.6.1 A Bit of Syntax</h3>
<p>Here are the lexical rules underlying the style sheet language:
</p><ul class="toc">
<li>-
the separators are white space, form feed, new line, and tab.
</li><li>-
‘<samp>#</samp>’ introduces a comment, ended at the end of the line.
</li><li>-
special characters are the separators, plus ‘<samp>#</samp>’, ‘<samp>"</samp>’,
‘<samp>,</samp>’, ‘<samp>(</samp>’, ‘<samp>)</samp>’, ‘<samp>+</samp>’ and ‘<samp>/</samp>’. Any other
character is a regular character.
</li><li>-
the list of the structuring keywords is
<blockquote><p><code>alphabet</code>, <code>alphabets</code>, <code>are</code>, <code>case</code>,
<code>documentation</code>, <code>end</code>, <code>exceptions</code>, <code>first</code>,
<code>in</code>, <code>insensitive</code>, <code>is</code>, <code>keywords</code>,
<code>operators</code>, <code>optional</code>, <code>second</code>, <code>sensitive</code>,
<code>sequences</code>, <code>style</code>
</p></blockquote>
</li><li>-
the list of the keywords designating faces is
<blockquote><p><code>Comment</code>, <code>Comment_strong</code>, <code>Encoding</code>, <code>Error</code>,
<code>Index1</code>, <code>Index2</code>, <code>Index3</code>, <code>Index4</code>,
<code>Invisible</code>, <code>Keyword</code>, <code>Keyword_strong</code>, <code>Label</code>,
<code>Label_strong</code>, <code>Plain</code>, <code>String</code>, <code>Symbol</code>,
<code>Tag1</code>, <code>Tag2</code>, <code>Tag3</code>, <code>Tag4</code>
</p></blockquote>
</li><li>-
the list of keywords designating special sequences is
<blockquote><p><code>C-char</code>, <code>C-string</code>
</p></blockquote>
</li><li>-
the list of keywords representing special characters is
<blockquote><p><code>---</code>, <code>\Alpha</code>, <code>\Beta</code>, <code>\Chi</code>, <code>\Delta</code>,
<code>\Downarrow</code>, <code>\Epsilon</code>, <code>\Eta</code>, <code>\Gamma</code>,
<code>\Im</code>, <code>\Iota</code>, <code>\Kappa</code>, <code>\Lambda</code>,
<code>\Leftarrow</code>, <code>\Leftrightarrow</code>, <code>\Mu</code>, <code>\Nu</code>,
<code>\Omega</code>, <code>\Omicron</code>, <code>\Phi</code>, <code>\Pi</code>, <code>\Psi</code>,
<code>\Re</code>, <code>\Rho</code>, <code>\Rightarrow</code>, <code>\Sigma</code>, <code>\Tau</code>,
<code>\Theta</code>, <code>\Uparrow</code>, <code>\Upsilon</code>, <code>\Xi</code>,
<code>\Zeta</code>, <code>\aleph</code>, <code>\alpha</code>, <code>\angle</code>,
<code>\approx</code>, <code>\beta</code>, <code>\bullet</code>,
<code>\cap</code>, <code>\carriagereturn</code>, <code>\cdot</code>, <code>\chi</code>,
<code>\circ</code>, <code>\clubsuit</code>, <code>\cong</code>, <code>\copyright</code>,
<code>\cup</code>, <code>\delta</code>, <code>\diamondsuit</code>, <code>\div</code>,
<code>\downarrow</code>, <code>\emptyset</code>, <code>\epsilon</code>, <code>\equiv</code>,
<code>\eta</code>, <code>\exists</code>, <code>\florin</code>, <code>\forall</code>,
<code>\gamma</code>, <code>\geq</code>, <code>\heartsuit</code>, <code>\in</code>,
<code>\infty</code>, <code>\int</code>, <code>\iota</code>, <code>\kappa</code>, <code>\lambda</code>,
<code>\langle</code>, <code>\lceil</code>, <code>\ldots</code>, <code>\leftarrow</code>,
<code>\leftrightarrow</code>, <code>\leq</code>, <code>\lfloor</code>, <code>\mu</code>,
<code>\nabla</code>, <code>\neq</code>, <code>\not</code>, <code>\not\in</code>,
<code>\not\subset</code>, <code>\nu</code>, <code>\omega</code>, <code>\omicron</code>,
<code>\oplus</code>, <code>\otimes</code>, <code>\partial</code>, <code>\perp</code>,
<code>\phi</code>, <code>\pi</code>, <code>\pm</code>, <code>\prime</code>, <code>\prod</code>,
<code>\propto</code>, <code>\psi</code>, <code>\radicalex</code>, <code>\rangle</code>,
<code>\rceil</code>, <code>\register</code>, <code>\rfloor</code>, <code>\rho</code>,
<code>\rightarrow</code>, <code>\sigma</code>, <code>\sim</code>, <code>\spadesuit</code>,
<code>\subset</code>, <code>\subseteq</code>, <code>\suchthat</code>, <code>\sum</code>,
<code>\supset</code>, <code>\supseteq</code>, <code>\surd</code>, <code>\tau</code>,
<code>\theta</code>, <code>\therefore</code>, <code>\times</code>, <code>\trademark</code>,
<code>\uparrow</code>, <code>\upsilon</code>, <code>\varUpsilon</code>,
<code>\varcopyright</code>, <code>\vardiamondsuit</code>, <code>\varphi</code>,
<code>\varpi</code>, <code>\varregister</code>, <code>\varsigma</code>, <code>\vartheta</code>,
<code>\vartrademark</code>, <code>\vee</code>, <code>\wedge</code>, <code>\wp</code>,
<code>\xi</code>, <code>\zeta</code>
</p></blockquote>
<p>It is a good idea to print the style sheet ‘<samp>symbols.ssh</samp>’ to see
them:
</p><table><tr><td> </td><td><pre class="example">a2ps symbols.ssh
</pre></td></tr></table>
</li><li>-
a string starts and finishes with ‘<samp>"</samp>’, and may contain anything.
Regular <code>C</code> escaping mechanism is used.
</li><li>-
a regular expression starts and finishes with ‘<samp>/</samp>’, and may contain
anything. Regular <code>C</code> escaping mechanism is used. Regexps can be
split in several parts, <i>a‘ la</i> C strings (i.e., ‘<samp>/part 1/ /part
2/</samp>’).
</li><li>-
any sequence of regular characters which is not a keyword, is a string
(consider this as a shortcut, avoiding extraneous ‘<samp>"</samp>’).
</li></ul>
<hr size="6">
<a name="Style-Sheet-Header"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#A-Bit-of-Syntax" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Syntax-of-the-Words" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheets-Implementation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Style-Sheet-Header-1"></a>
<h3 class="subsection">7.6.2 Style Sheet Header</h3>
<p>The definition of the name of the style sheet is:
</p><table><tr><td> </td><td><pre class="display"><code>style</code> <var>name</var> <code>is</code>
# body of the style sheet
<code>end</code> <code>style</code>
</pre></td></tr></table>
<p>The following constructions are optional:
</p><dl compact="compact">
<dt> <code>version</code></dt>
<dd><p>To define the version number of the style sheet
</p><table><tr><td> </td><td><pre class="example">version is <var>version-number</var>
</pre></td></tr></table>
</dd>
<dt> <code>written</code></dt>
<dd><p>To define the author(s).
</p><table><tr><td> </td><td><pre class="example">written by <var>authors</var>
</pre></td></tr></table>
<p>Giving your email is useful for bug reports about style sheets.
</p><table><tr><td> </td><td><pre class="example">written by "Some Body <Some.Body@some.whe.re>"
</pre></td></tr></table>
</dd>
<dt> <code>requires</code></dt>
<dd><p>To specify the version of a2pswhich requires a higher version number than its own.
</p><table><tr><td> </td><td><pre class="example">requires a2ps <var>a2ps-version-number</var>
</pre></td></tr></table>
</dd>
<dt> <code>documentation</code></dt>
<dd><p>To leave extra comments people should read.
</p><table><tr><td> </td><td><pre class="example">documentation is
<var>strings</var>
end documentation
</pre></td></tr></table>
<p><var>strings</var> may be a list of strings, without comas, in which case new
lines are automatically inserted between each item. See section <a href="#Documentation-Format">Documentation Format</a>, for details on the format.
</p>
<p>Please, write useful comments, not ‘<samp>This style is devoted to C
files</samp>’, since the name is here for that, nor ‘<samp>Report errors to
mail@me.somewhere</samp>’, since <code>written by</code> is there for that.
</p><table><tr><td> </td><td><pre class="example">documentation is
"Not all the keywords are used, to avoid too much"
"bolding. Heavy highlighting (code(-g)code), covers"
"the whole language."
end documentation
</pre></td></tr></table>
</dd>
</dl>
<hr size="6">
<a name="Syntax-of-the-Words"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Style-Sheet-Header" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Inheriting" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheets-Implementation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Syntax-of-the-Words-1"></a>
<h3 class="subsection">7.6.3 Syntax of the Words</h3>
<p>There are two things a2psand whether the style is case insensitive.
</p>
<dl compact="compact">
<dt> <code>alphabet</code></dt>
<dd><p>To define two different alphabets, use
</p><table><tr><td> </td><td><pre class="example">first alphabet is <var>string</var>
second alphabet is <var>string</var>
</pre></td></tr></table>
<p>If both are identical, you may use the shortcut
</p><table><tr><td> </td><td><pre class="example">alphabets are <var>string</var>
</pre></td></tr></table>
<p>The default alphabets are
</p><table><tr><td> </td><td><pre class="example">first alphabet is
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_"
second alphabet is
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_\
0123456789"
</pre></td></tr></table>
<p>Note that it is on purpose that no characters interval are used.
</p>
</dd>
<dt> <code>case</code></dt>
<dd><table><tr><td> </td><td><pre class="example">case insensitive # <i>e.g., C, C++ etc.</i>
case sensitive # <i>e.g., Perl, Sather, Java etc.</i>
</pre></td></tr></table>
<p>The default is <code>case insensitive</code>.
</p>
</dd>
</dl>
<hr size="6">
<a name="Inheriting"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Syntax-of-the-Words" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Syntax-for-the-P_002dRules" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheets-Implementation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Inheriting-from-Other-Style-Sheets"></a>
<h3 class="subsection">7.6.4 Inheriting from Other Style Sheets</h3>
<p>It is possible to extend an existing style. The syntax is:
</p><table><tr><td> </td><td><pre class="example">ancestors are
<var>ancestor_1</var>[, <var>ancestor_2</var>...]
end ancestors
</pre></td></tr></table>
<p>where <var>ancestor1</var> etc. are style sheet keys.
</p>
<p>For semantics, the rules are the following:
</p><ul class="toc">
<li>-
the ancestors are read in order;
</li><li>-
the definition of the current style is read last;
</li><li>-
it is always the last item read which wins (last defined alphabets, case
sensitivity, keywords, operators and sequences).
</li></ul>
<p>As an example, both <code>C++</code> and <code>Objective C</code> style sheets
extend the <code>C</code> style sheet:
</p>
<table><tr><td> </td><td><pre class="example">style "Objective C" is
#<i>[...]</i>
ancestors are
c
end ancestors
#<i>[...]</i>
end style
</pre></td></tr></table>
<p>To the biggest surprise of the author, mutually dependent style sheets
do work!
</p>
<hr size="6">
<a name="Syntax-for-the-P_002dRules"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Inheriting" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Declaring-keywords-and-operators" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheets-Implementation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Syntax-for-the-P_002dRules-1"></a>
<h3 class="subsection">7.6.5 Syntax for the P-Rules</h3>
<p>See section <a href="#P_002dRules">P-Rules</a>, for the definition of <em>P-rule</em>.
</p>
<p>Because of various short cuts, there are many ways to declare a rule:
</p><table><tr><td> </td><td><pre class="example"><var>rules</var> ::= <var>rule_1</var> ‘<samp>,</samp>’ <var>rule_2</var>...
<var>rule</var> ::= ‘<samp>(</samp>’ <var>lhs</var> <var>rhs</var> ‘<samp>)</samp>’
| <var>lhs</var> <var>srhs</var> ;
<var>lhs</var> ::= <var>string</var> | <var>regex</var> ;
<var>rhs</var> ::= <var>srhs</var> ‘<samp>,</samp>’ ...
<var>srhs</var> ::= <var>latex-keyword</var> | <var>expansion</var> <var>face</var>
<var>expansion</var> ::= <var>string</var> | ‘<samp>\</samp>’<var>num</var> | <nothing>;
<var>face</var> ::= <var>face-keyword</var> | <nothing>;
</pre></td></tr></table>
<p>The rules are the following:
</p><ul class="toc">
<li>-
<a name="index-Regular-expression"></a>
If the left-hand side (lhs) is a regular expression, then it is compiled
with the following syntax bits:
<table><tr><td> </td><td><pre class="example">#define RE_SYNTAX_A2PS \
(/* Allow char classes. */ \
RE_CHAR_CLASSES \
/* Be picky. */ \
| RE_CONTEXT_INVALID_OPS \
/* Allow intervals with `{' and `}', forbid invalid ranges. */\
| RE_INTERVALS | RE_NO_BK_BRACES | RE_NO_EMPTY_RANGES \
/* `(' and `)' are the grouping operators. */ \
| RE_NO_BK_PARENS \
/* `|' is the alternation. */ \
| RE_NO_BK_VBAR)
</pre></td></tr></table>
<p>Basically it means that all of the possible operators are used, and that
they are in non-backslashed form. For instance ‘<samp>(</samp>’ and ‘<samp>)</samp>’
stand for the group operator, while ‘<samp>\\(</samp>’ stands for the character
‘<samp>(</samp>’. See <a href="regex.html#Regular-Expression-Syntax">(regex)Regular Expression Syntax</a> section ‘Regular Expression Syntax’ in <cite>Regex manual</cite>, for a detailed description of the regular
expressions.
</p>
</li><li>-
If no <var>expansion</var> is specified, then the matched string is used.
For instance ‘<samp>(/fo*/, NULL, Keyword)</samp>’ applied on the source
‘<samp>fooooo</samp>’ produces ‘<samp>fooooo</samp>’ in <code>Keyword</code>.
</li><li>-
If no <var>face</var> is given, then
<ul class="toc">
<li>-
if the context defines the default face, then this face is used;
</li><li>-
if no default face is given, <code>PLAIN</code> is used.
</li></ul>
</li></ul>
<hr size="6">
<a name="Declaring-keywords-and-operators"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Syntax-for-the-P_002dRules" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Declaring-sequences" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheets-Implementation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Declaring-the-keywords-and-the-operators"></a>
<h3 class="subsection">7.6.6 Declaring the keywords and the operators</h3>
<p>Basically, keywords and operators are lists of rules. The syntax is:
</p><table><tr><td> </td><td><pre class="example">keywords are
<var>rules</var>
end keywords
</pre></td></tr></table>
<p>or
</p><table><tr><td> </td><td><pre class="example">keywords in <var>face-keyword</var> are
<var>rules</var>
end keywords
</pre></td></tr></table>
<p>in which case the default face is set to <var>face-keyword</var>.
</p>
<p>As an example:
</p><table><tr><td> </td><td><pre class="example">keywords in Keyword_strong are
/foo*/,
"bar" "BAR" Keyword,
-> \rightarrow
end keywords
</pre></td></tr></table>
<p>is valid.
</p>
<p>The syntax for the operators is the same, and both constructs can be
qualified with an <code>optional</code> flag, in which case they are taken
into account in the heavy highlighting mode (see section <a href="#Pretty-Print-Options">Pretty Printing Options</a>).
</p>
<p>This is an extract of the <code>C</code> style sheet:
</p><table><tr><td> </td><td><pre class="example">optional operators are
-> \rightarrow,
&& \wedge,
|| \vee,
!= \neq,
== \equiv,
# We need to protect these, so that <= is not replaced in <<=
<<=,
>>=,
<= \leq,
>= \geq,
! \not
end operators
</pre></td></tr></table>
<p>Note how ‘<samp><<=</samp>’ and ‘<samp>>>=</samp>’ are protected (there are defined to
be written as is when met in the source). This is to prevent the two
last characters of ‘<samp><<=</samp>’ from being converted into a ‘less or
equal’ sign.
</p>
<p>The order in which you define the elements of a category (but the
sequences) does not matter. But since a2psmay save time if the alphabetical <code>C</code>-order is more or less
followed.
</p>
<p>You should be aware that when declaring a keyword with a regular
expression as lhs, then a2psmatching only if there are no character of the first alphabet both just
before, and just after the string.
</p>
<p>In term of implementation, it means that
</p><table><tr><td> </td><td><pre class="example">keywords are
/foo|bar/
end keywords
</pre></td></tr></table>
<p>is exactly the same as
</p><table><tr><td> </td><td><pre class="example">operators are
/\\b(foo|bar)\\b/
end operators
</pre></td></tr></table>
<p>This can cause problems if you use anchors (e.g. <code>$</code>, or <code>^</code>)
in keywords: the matcher will be broken. In this particular case,
define your keywords as operators, taking care of the ‘<samp>\\b</samp>’ by
yourself.
</p>
<p>See <a href="regex.html#Match_002dword_002dboundary-Operator">(regex)Match-word-boundary Operator</a> section ‘Match-word-boundary Operator’ in <cite>Regex manual</cite>, for details on ‘<samp>\b</samp>’.
</p>
<hr size="6">
<a name="Declaring-sequences"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Declaring-keywords-and-operators" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Checking-a-Style-Sheet" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheets-Implementation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Declaring-the-sequences"></a>
<h3 class="subsection">7.6.7 Declaring the sequences</h3>
<p>Sequences admit several declarations too:
</p><table><tr><td> </td><td><pre class="example"><var>sequences</var> ::= sequences are
<var>sequence_1</var> ‘<samp>,</samp>’ <var>sequence_2</var>...
end sequences
<var>sequence</var> ::= <var>rule</var> <var>in_face</var> <var>close_opt</var> <var>exceptions_opt</var>
| <code>C-string</code>
| <code>C-char</code>
;
<var>close_opt</var> ::= <var>rule</var>
| closers are
<var>rules</var>
end closers
| <nothing>
;
<var>exceptions_opt</var> ::= exceptions are
<var>rules</var>
end exceptions
| <nothing>
;
</pre></td></tr></table>
<p>The rules are:
</p><ul class="toc">
<li>-
The default face is then <var>in_face</var>.
</li><li>-
If no closing rule is given, ‘<samp>"\n"</samp>’ (i.e., end-of-line) is used.
</li></ul>
<p>As a first example, here is the correct definition for a <code>C</code> string:
</p><table><tr><td> </td><td><pre class="example">sequences are
"\"" Plain String "\"" Plain
exceptions are
"\\\\", "\\\""
end exceptions
end sequences
</pre></td></tr></table>
<a name="index-C_002dstring"></a>
<a name="index-C_002dchar"></a>
<p>Since a great deal of languages uses this kind of constructs, you may
use <code>C-string</code> to mean exactly this, and <code>C-char</code> for
manifest characters defined the <code>C</code> way.
</p>
<p>The following example comes from ‘<tt>ssh.ssh</tt>’, the style sheet for
style sheet files, in which there are two kinds of pseudo-strings: the
strings (‘<samp>"example"</samp>’), and the regular expressions
(‘<samp>/example/</samp>’). We do not want the content of the pseudo-strings in
the face <code>String</code>.
</p>
<table><tr><td> </td><td><pre class="example">sequences are
# The comments
"#" Comment,
# The name of the style sheet
"style " Keyword_strong (Label + Index1) " is" Keyword_strong,
# Strings are exactly the C-strings, though we don't want to
# have them in the "string" face
"\"" Plain "\""
exceptions are
"\\\\", "\\\""
end exceptions,
# Regexps
"/" Plain "/"
exceptions are
"\\\\", "\\\/"
end exceptions
end sequences
</pre></td></tr></table>
<p>The order between sequences does matter. For instance in Java,
‘<samp>/**</samp>’ introduces strong comments, and ‘<samp>/*</samp>’ comments.
‘<samp>/**</samp>’ <em>must</em> be declared before ‘<samp>/*</samp>’, or it will be
hidden.
</p>
<p>There are actually some sequences that could have been implemented as
operators with a specific regular expression (that goes up to the
closer). Nevertheless be aware of a big difference: regular expression
are applied to a single line of the source file, hence, they cannot
match on several lines. For instance, the <code>C</code> comments,
</p><table><tr><td> </td><td><pre class="example">/*
* a comment
*/
</pre></td></tr></table>
<p>cannot be implemented with operators, though <code>C++</code> comments can:
</p><table><tr><td> </td><td><pre class="example">//
// a comment
//
</pre></td></tr></table>
<hr size="6">
<a name="Checking-a-Style-Sheet"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Declaring-sequences" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#A-tutorial-on-style-sheets" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Style-Sheets-Implementation" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Checking-a-Style-Sheet-1"></a>
<h3 class="subsection">7.6.8 Checking a Style Sheet</h3>
<p>Once your style sheet is written, you may want to let a2pssimple tests on it (e.g., checking there are no rules involving upper
case characters in a case insensitive style sheet, etc.). These tests
are performed when verbosity includes the style sheets.
</p>
<p>you may also want to use the special convention that when a style sheet
is required with a suffix, then a2pspath, but precisely from when you are.
</p>
<p>Suppose for instance you extended the ‘<tt>c.ssh</tt>’ style sheet, which is
in the current directory, and is said case insensitive. Run
</p><table><tr><td> </td><td><pre class="example">ubu $ a2ps foo.c -Ec.ssh -P void -v sheets
<i># Long output deleted</i>
Checking coherence of "C" (c.ssh)
a2ps: c.ssh:`FILE' uses upper case characters
a2ps: c.ssh:`NULL' uses upper case characters
"C" (c.ssh) is corrupted.
---------- End of Finalization of c.ssh
</pre></td></tr></table>
<p>Here, it is clear that <code>C</code> is not case insensitive.
</p>
<hr size="6">
<a name="A-tutorial-on-style-sheets"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Checking-a-Style-Sheet" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Example-and-syntax" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="A-Tutorial-on-Style-Sheets"></a>
<h2 class="section">7.7 A Tutorial on Style Sheets</h2>
<p>In this section a simple example of style sheet is entirely covered:
that of ‘<tt>ChangeLog</tt>’ files.
</p>
<p>‘<tt>ChangeLog</tt>’ files are some kind of memory of changes done to files,
so that various programmers can understand what happened to the sources.
This helps a lot, for instance, in guessing what recent changes may have
introduced new bugs.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Example-and-syntax">7.7.1 Example and syntax</a></td><td> </td><td align="left" valign="top"> ChangeLog files
</td></tr>
<tr><td align="left" valign="top"><a href="#Implementation">7.7.2 Implementation</a></td><td> </td><td align="left" valign="top"> Implementation of chlog.ssh
</td></tr>
<tr><td align="left" valign="top"><a href="#The-Entry-in-sheets_002emap">7.7.3 The Entry in ‘<tt>sheets.map</tt>’</a></td><td> </td><td align="left" valign="top"> Getting automatic style selection
</td></tr>
<tr><td align="left" valign="top"><a href="#More-Sophisticated-Rules">7.7.4 More Sophisticated Rules</a></td><td> </td><td align="left" valign="top"> Complex regular expressions
</td></tr>
<tr><td align="left" valign="top"><a href="#Distributed-Style-Sheets">7.7.5 Guide Line for Distributed Style Sheets</a></td><td> </td><td align="left" valign="top"> Additional Constraints
</td></tr>
</table>
<hr size="6">
<a name="Example-and-syntax"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#A-tutorial-on-style-sheets" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Implementation" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#A-tutorial-on-style-sheets" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Example-and-syntax-1"></a>
<h3 class="subsection">7.7.1 Example and syntax</h3>
<p>First of all, here is a sample of a ‘<tt>ChangeLog</tt>’ file, taken from
the ‘<tt>misc/</tt>’ directory of the original a2ps</p><table><tr><td> </td><td><pre class="example">Sun Apr 27 14:29:22 1997 Akim Demaille <demaille@inf.enst.fr>
* base.ps: Merged in color.ps, since now a lot is
common [added box and underline features].
Fri Apr 25 14:05:20 1997 Akim Demaille <demaille@inf.enst.fr>
* color.ps: Added box and underline routines.
Mon Mar 17 20:39:11 1997 Akim Demaille <demaille@gargantua.enst.fr>
* base.ps: Got rid of CourierBack and reencoded_backspace_font.
Now the C has to handle this by itself.
Sat Mar 1 19:12:22 1997 Akim Demaille <demaille@gargantua.enst.fr>
* *.enc: they build their own dictionaries, to ease multi
lingual documents.
</pre></td></tr></table>
<p>The syntax is really simple: A line specifying the author and the date
of the changes, then a list of changes, all of them starting with an
star followed by the name of the files concerned, then optionally
between parentheses the functions affected, and then some comments.
</p>
<hr size="6">
<a name="Implementation"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Example-and-syntax" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#The-Entry-in-sheets_002emap" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#A-tutorial-on-style-sheets" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Implementation-1"></a>
<h3 class="subsection">7.7.2 Implementation</h3>
<p>Quite naturally the style will be called <code>ChangeLog</code>, hence:
</p><table><tr><td> </td><td><pre class="example">style ChangeLog is
written by "Akim Demaille <demaille@inf.enst.fr>"
version is 1.0
requires a2ps 4.9.5
documentation is
"This is a tutorial style sheet.\n"
end documentation
...
end style
</pre></td></tr></table>
<p>A first interesting and easy entry is that of function names, between
‘<samp>(</samp>’ and ‘<samp>)</samp>’:
</p><table><tr><td> </td><td><pre class="example">sequences are
"(" Plain Label ")" Plain
end sequences
</pre></td></tr></table>
<p>A small problem that may occur is that there can be several functions
mentioned separated by commas, that we don’t want to highlight this way.
Commas, here, are exceptions. Since regular expressions are not yet
implemented in a2ps@c, there is a simple but stupid way to avoid that
white spaces are all considered as part of a function name, namely
defining two exceptions: one which captures a single comma, and a
second, capturing a comma and its trailing space.
</p>
<p>For the file names, the problem is a bit more delicate, since they may
end with ‘<samp>:</samp>’, or when starts the list of functions. Then, we
define two sequences, each one with one of the possible closers, the
exceptions being attached to the first one:
</p>
<table><tr><td> </td><td><pre class="example">sequences are
"* " Plain Label_strong ":" Plain
exceptions are
", " Plain, "," Plain
end exceptions,
"* " Plain Label_strong " " Plain
end sequences
</pre></td></tr></table>
<p>Finally, let us say that some words have a higher importance in the core
of text: those about removing or adding something.
</p><table><tr><td> </td><td><pre class="example">keywords in Keyword_strong are
add, added, remove, removed
end keywords
</pre></td></tr></table>
<p>Since they may appear in lower or upper, of mixed case, the style will
be defined as case insensitive.
</p>
<p>Finally, we end up with this style sheet file, in which an optional
highlighting of the mail address of the author is done. Saving the file
is last step. But do not forget that a style sheet has both a name as
nice as you may want (such as ‘<samp>Common Lisp</samp>’), and a key on which
there are strict rules: the prefix must be alpha-numerical, lower case,
with no more than 8 characters. Let’s chose ‘<tt>chlog.ssh</tt>’.
</p>
<table><tr><td> </td><td><pre class="example"># This is a tutorial on a2ps' style sheets
style ChangeLog is
written by "Akim Demaille <demaille@inf.enst.fr>"
version is 1.0
requires a2ps 4.9.5
documentation is
"Second level of high lighting covers emails."
end documentation
sequences are
"(" Plain Label ")" Plain
exceptions are
", " Plain, "," Plain
end exceptions,
"* " Plain Label_strong ":" Plain
exceptions are
", " Plain, "," Plain
end exceptions,
"* " Plain Label_strong " " Plain
end sequences
keywords in Keyword_strong are
add, added, remove, removed
end keywords
optional sequences are
< Plain Keyword > Plain
end sequences
end style
</pre></td></tr></table>
<p>As a last step, you may which to let a2psits syntax, and common errors:
</p><table><tr><td> </td><td><pre class="example">ubu $ a2ps -vsheet -E/tmp/chlog.ssh ChangeLog -P void
<i>Long output deleted</i>
Checking coherence of "ChangeLog" (/tmp/chlog.ssh)
"ChangeLog" (/tmp/chlog.ssh) is sane.
---------- End of Finalization of /tmp/chlog.ssh
</pre></td></tr></table>
<p>It’s all set, your style sheet is ready!
</p>
<hr size="6">
<a name="The-Entry-in-sheets_002emap"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Implementation" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#More-Sophisticated-Rules" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#A-tutorial-on-style-sheets" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="The-Entry-in-sheets_002emap-1"></a>
<h3 class="subsection">7.7.3 The Entry in ‘<tt>sheets.map</tt>’</h3>
<p>The last touch is to include the pattern rules about ‘<tt>ChangeLog</tt>’
files (which could appear as ‘<tt>ChangeLog.old</tt>’ etc.) in
‘<tt>sheets.map</tt>’:
</p><table><tr><td> </td><td><pre class="example"># ChangeLog files
chlog: /ChangeLog*/
</pre></td></tr></table>
<p>This won’t work... Well, not always. Not for instance if you print
‘<tt>misc/ChangeLog</tt>’. This is not a bug, but truly a feature, since
sometimes one gets more information about the type of a file from its
path, than from the file name.
</p>
<p>Here, to match the preceding path that may appear, just use ‘<samp>*</samp>’:
</p><table><tr><td> </td><td><pre class="example"># ChangeLog files
chlog: /*ChangeLog*/
</pre></td></tr></table>
<p>If you want to be more specific (‘<tt>FooChangeLog</tt>’ should not
match), use:
</p><table><tr><td> </td><td><pre class="example"># ChangeLog files
chlog: /ChangeLog*/ /*\/ChangeLog*/
</pre></td></tr></table>
<hr size="6">
<a name="More-Sophisticated-Rules"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#The-Entry-in-sheets_002emap" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Distributed-Style-Sheets" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#A-tutorial-on-style-sheets" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="More-Sophisticated-Rules-1"></a>
<h3 class="subsection">7.7.4 More Sophisticated Rules</h3>
<p>The example we have presented until now uses only basic features, and
does not take advantage of the regexp. In this section we should how
to write more evolved pretty printing rules.
</p>
<p>The target will be the lines like:
</p><table><tr><td> </td><td><pre class="example">Sun Apr 27 14:29:22 1997 Akim Demaille <demaille@inf.enst.fr>
Fri Apr 25 14:05:20 1997 Akim Demaille <demaille@inf.enst.fr>
</pre></td></tr></table>
<p>There are three fields: the date, the name, the mail. These lines all
start at the beginning of line. The last field is the easier to
recognize: is starts with a ‘<samp><</samp>’, and finishes with a ‘<samp>></samp>’. Its
rule is then ‘<samp>/<[^>]+>/</samp>’. It is now easier to specify the second:
it is composed only of words, at least one, separated by blanks, and is
followed by the mail: ‘<samp>/[[:alpha:]]+([ \t]+[[:alpha:]]+)*/</samp>’.
To concatenate the two, we introduce optional blanks, and we put each one
into a pair of ‘<samp>(</samp>’-‘<samp>)</samp>’ to make each one a recognizable
part:
</p><table><tr><td> </td><td><pre class="example">([[:alpha:]]+([ \t]+[[:alpha:]]+)*)
(.+)
(<[^>]+>)
</pre></td></tr></table>
<p>Now the first part is rather easy: it starts at the beginning of the
line, finishes with a digit. Once again, it is separated from the
following field by blanks. Split by groups (see <a href="regex.html#Grouping-Operators">(regex)Grouping Operators</a> section ‘Grouping Operators’ in <cite>Regex manual</cite>), we have:
</p><table><tr><td> </td><td><pre class="example">^
([^\t ].*[0-9])
([ \t]+)
([[:alpha:]]+([ \t]+[[:alpha:]]+)*)
(.+)
(<[^>]+>)
</pre></td></tr></table>
<p>Now the destination is composed of back references to those groups,
together with a face:
</p><table><tr><td> </td><td><pre class="example"># We want to highlight the date and the maintainer name
optional operators are
(/^([^\t ].*[0-9])/ # \1. The date
/([ \t]+)/ # \2. Spaces
/([[:alpha:]]+([ \t]+[[:alpha:]]+)*)/ # \3. Name
/(.+)/ # \5. space and <
/(<[^>]+)>/ # \6. email
\1 Keyword, \2 Plain, \3 Keyword_strong,
\5 Plain, \6 Keyword, > Plain)
end operators
</pre></td></tr></table>
<p>Notice the way regexps are split, to ease reading.
</p>
<hr size="6">
<a name="Distributed-Style-Sheets"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#More-Sophisticated-Rules" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#A-tutorial-on-style-sheets" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Guide-Line-for-Distributed-Style-Sheets"></a>
<h3 class="subsection">7.7.5 Guide Line for Distributed Style Sheets</h3>
<p>This section is meant for people who wish to contribute style sheets.
There is a couple of additional constraints, explained here.
</p>
<dl compact="compact">
<dt> <em>The Copyright</em></dt>
<dd><p>Please, do put a copyright in your file, the same as all other
distributed files have: it should include your name, but also the three
paragraphs stating the sheet is covered by the GPL. I won’t distribute
files without these paragraphs.
</p>
</dd>
<dt> <em>The Version</em></dt>
<dd><p>Do put a version number, so that people can track evolutions.
</p>
</dd>
<dt> <em>The Requirements</em></dt>
<dd><p>Make sure to include a requirement on the needed version of a2ps@c. If
you don’t know what to put, just put the version of the a2ps</p>
</dd>
<dt> <em>The Documentation</em></dt>
<dd><p>The documentation string is mandatory. Unless the language your style
sheet covers is widely known, please document a bit what the style sheet
is meant for. If there were choices you made, if there are special
behaviors, document them.
</p>
</dd>
<dt> <em>The ‘<tt>sheets.map</tt>’ Entries</em></dt>
<dd><p>Put in a comment on the ‘<tt>sheets.map</tt>’ lines that correspond to your
style sheet.
</p>
</dd>
<dt> <em>A Test File</em></dt>
<dd><p>It is better to give a test file, as small as possible, that contains
the most specific and/or most difficult contructs that your style sheet
supports. I need to be able to distribute this file, therefore, do not
put anything that is copyrighted.
</p></dd>
</dl>
<p>Finally, make sure your style sheet behaves well! (see section <a href="#Checking-a-Style-Sheet">Checking a Style Sheet</a>)
</p>
<hr size="6">
<a name="PostScript"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Distributed-Style-Sheets" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Good-and-Bad-PostScript" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Pretty-Printing" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="PostScript-1"></a>
<h1 class="chapter">8. PostScript</h1>
<p>This chapter is devoted to the information which is only relevant to
PostScript.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Good-and-Bad-PostScript">8.1 Foreword: Good and Bad PostScript</a></td><td> </td><td align="left" valign="top"> How to lose, how to win
</td></tr>
<tr><td align="left" valign="top"><a href="#Page-Device-Options">8.2 Page Device Options</a></td><td> </td><td align="left" valign="top"> Accessing some printers’ features
</td></tr>
<tr><td align="left" valign="top"><a href="#Statusdict-Options">8.3 Statusdict Options</a></td><td> </td><td align="left" valign="top"> Some other features
</td></tr>
<tr><td align="left" valign="top"><a href="#Colors-in-PostScript">8.4 Colors in PostScript</a></td><td> </td><td align="left" valign="top"> Specifying a color or a gray
</td></tr>
<tr><td align="left" valign="top"><a href="#a2ps-PostScript-Files">8.5 a2ps</a></td><td> </td><td align="left" valign="top"> Convention for PostScript library files
</td></tr>
<tr><td align="left" valign="top"><a href="#Designing-PostScript-Prologues">8.6 Designing PostScript Prologues</a></td><td> </td><td align="left" valign="top"> Make it look like what you want
</td></tr>
</table>
<hr size="6">
<a name="Good-and-Bad-PostScript"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#PostScript" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Page-Device-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#PostScript" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Foreword_003a-Good-and-Bad-PostScript"></a>
<h2 class="section">8.1 Foreword: Good and Bad PostScript</h2>
<a name="index-Optimize-for-Speed"></a>
<a name="index-Optimize-for-Portability"></a>
<a name="index-PostScript-Quality"></a>
<a name="index-DSC"></a>
<p>To read this section, the reader must understand what DSC are
(see section <a href="#Glossary">Glossary</a>).
</p>
<blockquote><p><i>Why are there good PostScript files, easy to post-process, and bad
files that none of my tools seem to understand? They print fine
though!</i>
</p></blockquote>
<p>Once you understood that PostScript is not a page description format
(like PDF is), you’ll have understood most of the problem. Let’s
imagine for a second that you are a word processor.
</p>
<p>The user asks you to print his/her 100 page document in PostScript. Up
to page 50, there are few different fonts used. Then, on pages 51 to
80, there are now many different heavy fonts.
</p>
<p>When/where will you download the fonts?
</p>
<p>The most typical choice, sometimes called <em>Optimize for Speed</em>, is,
once you arrived to page 51, to download those fonts <strong>once</strong> for
the rest of the document. The global processing chain will have worked
quite quickly: little effort from the software, same from the printer;
better yet: you can start sending the file to the printer even before it
is finished! The problem is that this is not DSC conformant, and it is
easy to understand why: if somebody wants to print only the page 60,
then s/he will lack the three fonts which were defined in page 51...
This document is not page independent.
</p>
<p>Another choice is to download the three fonts in <strong>each</strong> page
ranging from 51 to 80, that is the PostScript file contains 30 times the
definition of each font. It is easy for the application to do that, but
the file is getting real big, and the printer will have to interpret 30
times the same definitions of fonts. But it is DSC conformant! And you
can still send the file while you make it.
</p>
<p>Now you understand why
</p><blockquote><p><strong>Non DSC conformant files are not necessarily badly designed
files from broken applications.</strong>
</p></blockquote>
<p>They are files meant to be sent directly to the printer (they are still
perfect PostScript files after all!), they are not meant to be
post-processed. And the example clearly shows why they are
<strong>right</strong>.
</p>
<p>There is a third possibility, sometimes called <em>Optimize for
Portability</em>: downloading the three fonts in the prologue of the
document, i.e., the section before the first page where are given all
the common definitions of the whole file. This is a bit more
complicated to implement (the prologue, which is issued first though,
grows at the same time as you process the file), and cannot be sent
concurrently with the processing (you have to process the whole file to
design the prologue). This file is small (the fonts are downloaded once
only), and DSC conformant. Well, there are problems, of course... You
need to wait before sending the output, it can be costly for the
computer (which cannot transfer as it produces), and for the printer
(you’ve burnt quite a lot of RAM right since the beginning just to hold
fonts that won’t be used before page 51... This can be a real problem
for small printers).
</p>
<p>This is what a2ps</p>
<p>If should be clear that documents optimized for speed should never
escape the way between the computer and the printer: no post-processing
is possible.
</p>
<p>What you should remember is that some applications offer the possibility
to tune the PostScript output, and they can be praised for that.
Unfortunately, when these very same applications don’t automatically
switch to “Optimize for Portability” when you save the PostScript
file, and they can be criticized for that.
</p>
<p>So please, think of the people after you: if you create a PostScript
file meant to be exchanged, read, printed, etc; by other people: give
sane DSC conformant, optimized for portability files.
</p>
<hr size="6">
<a name="Page-Device-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Good-and-Bad-PostScript" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Statusdict-Options" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#PostScript" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Page-Device-Options-1"></a>
<h2 class="section">8.2 Page Device Options</h2>
<p>Page device is a PostScript level 2 feature that offers an uniform
interface to control the printer’s output device. a2pspage device options inside an if block so they have no effect in level 1
interpreters. Although all level 2 interpreters support page device,
they do not have to support all page device options. For example some
printers can print in duplex mode and some can not. Refer to the
documentation of your printer for supported options.
</p>
<p>Here are some usable page device options which can be selected with the
‘<samp>-S</samp>’ option (‘<samp>--setpagedevice</samp>’). For a complete listing, see
<cite>PostScript Language Reference Manual</cite> (section 4.11 Device Setup
in the second edition, or section 6, Device Control in the third
edition).
</p>
<dl compact="compact">
<dt> <code>Collate <var>boolean</var></code></dt>
<dd><p>how output is organized when printing multiple copies
</p>
</dd>
<dt> <code>Duplex <var>boolean</var></code></dt>
<dd><p>duplex (two side) printing
</p>
</dd>
<dt> <code>ManualFeed <var>boolean</var></code></dt>
<dd><p>manual feed paper tray
</p>
</dd>
<dt> <code>OutputFaceUp <var>boolean</var></code></dt>
<dd><p>print output ‘face up’ or ‘face down’
</p>
</dd>
<dt> <code>Tumble <var>boolean</var></code></dt>
<dd><p>how opposite sides are positioned in duplex printing
</p></dd>
</dl>
<hr size="6">
<a name="Statusdict-Options"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Page-Device-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Colors-in-PostScript" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#PostScript" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Statusdict-Options-1"></a>
<h2 class="section">8.3 Statusdict Options</h2>
<p>The <code>statusdict</code> is a special storage entity in PostScript (called
a <em>dictionary</em>), in which some variables and operators determine the
behavior of the printer. This is an historic horror that existed before
page device definitions were defined. They are even more printer
dependent, and are provided only for the people who don’t have a level
printer. In any case, refer to the documentation of your printer for
supported options.
</p>
<p>Here are some statusdict definitions in which you might be interested:
</p>
<dl compact="compact">
<dt> <code>manualfeed <var>boolean</var></code></dt>
<dd><p>Variable which determine that the manual fed paper tray will be used.
Use is ‘<samp>--statusdict=manualfeed::true</samp>’.
</p>
</dd>
<dt> <code>setmanualfeed <var>boolean</var></code></dt>
<dd><p>Idem as the previous point, but use is
‘<samp>--statusdict=setmanualfeed:true</samp>’.
</p>
</dd>
<dt> <code>setduplexmode <var>boolean</var></code></dt>
<dd><p>If <var>boolean</var>, then print Duplex. Use if
‘<samp>--statusdict=setduplexmode:true</samp>’.
</p></dd>
</dl>
<hr size="6">
<a name="Colors-in-PostScript"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Statusdict-Options" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#a2ps-PostScript-Files" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#PostScript" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Colors-in-PostScript-1"></a>
<h2 class="section">8.4 Colors in PostScript</h2>
<p>Nevertheless, here are some tips on how to design your PostScript
styles. It is strongly recommended to use ‘<tt>gray.pro</tt>’ or
‘<tt>color.pro</tt>’ as a template.
</p>
<p>There are two PostScript instructions you might want to use in your new
PostScript prologue:
</p><dl compact="compact">
<dt> <code>setgray</code></dt>
<dd><p>this instruction must be preceded by a number between 0 (black) and 1
(white). It defines the gray level used.
</p>
</dd>
<dt> <code>setrgbcolor</code></dt>
<dd><p>this instruction must be preceded by three numbers between 0 (0 %) and 1
(100%). Those three numbers are related to red, green and blue
proportions used to designate a color.
</p>
</dd>
</dl>
<p>a2psboth use an argument as in <code>setrgbcolor</code>. So if you wanted a gray
shade, just give three times the same ratio.
</p>
<hr size="6">
<a name="a2ps-PostScript-Files"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Colors-in-PostScript" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Designing-PostScript-Prologues" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#PostScript" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="a2ps"></a>
<h2 class="section">8.5 a2ps</h2>
<p>a2psas font files, and others are meant for a2ps only.
</p>
<p>All a2ps files have two parts, one being the comments, and the other
being the content, separated by the following line:
</p><table><tr><td> </td><td><pre class="example">% code follows this line
</pre></td></tr></table>
<hr size="6">
<a name="Designing-PostScript-Prologues"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#a2ps-PostScript-Files" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Definition-of-the-faces" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#PostScript" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#PostScript" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Designing-PostScript-Prologues-1"></a>
<h2 class="section">8.6 Designing PostScript Prologues</h2>
<p>It is pretty known that satisfying the various human tastes is an
NEXPTIME-hard problem, so a2psthrough the <em>prologue files</em>. But since the authors feel a little
small against NEXPTIME, they agreed on the fact that <strong>you</strong> are
the one who will design the look you like.
</p>
<p>Hence in this section, you will find what you need to know to be able to
customize a2ps</p>
<p>Basically, a2ps"meaning" in the text. a2ps</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Definition-of-the-faces">8.6.1 Definition of the faces</a></td><td> </td><td align="left" valign="top"> What goes in a characters style
</td></tr>
<tr><td align="left" valign="top"><a href="#Prologue-File-Format">8.6.2 Prologue File Format</a></td><td> </td><td align="left" valign="top"> Including documentation
</td></tr>
<tr><td align="left" valign="top"><a href="#A-prologue-example">8.6.3 A step by step example</a></td><td> </td><td align="left" valign="top"></td></tr>
</table>
<hr size="6">
<a name="Definition-of-the-faces"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Designing-PostScript-Prologues" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Prologue-File-Format" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#PostScript" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Designing-PostScript-Prologues" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Definition-of-the-faces-1"></a>
<h3 class="subsection">8.6.1 Definition of the faces</h3>
<p>There are three things that define a face:
</p><dl compact="compact">
<dt> <em>Its font</em></dt>
<dd><p>You should never call the font by yourself, because sometimes a2psdecide that another font would be better. This is what happens for
instance if a font does not support the encoding you use.
</p>
<p>Hence, never set the font by yourself, but ask a2psdone through a line:
</p><table><tr><td> </td><td><pre class="example">%Face: <var>face</var> <var>real-font-name</var> <var>size</var>
</pre></td></tr></table>
<p>This line tells a2ps<var>real-font-name</var>. It will replace this line by the correct
PostScript line to call the needed font, and will do everything needed
to set up the font.
</p>
<p>The size of the text body is <code>bfs</code>.
</p>
</dd>
<dt> <em>Its background color</em></dt>
<dd><p>There are two cases:
</p><ol>
<li>
You want a background color, then give the <em>RGB</em> (see section <a href="#Colors-in-PostScript">Colors in PostScript</a>) ratio and <code>true</code> to <code>BG</code>:
<table><tr><td> </td><td><pre class="example">0.8 0.8 0 true BG
</pre></td></tr></table>
</li><li>
You don’t want a background color, then call <code>BG</code> with
<code>false</code>:
<table><tr><td> </td><td><pre class="example">false BG
</pre></td></tr></table>
</li></ol>
</dd>
<dt> <em>Its foreground color</em></dt>
<dd><p>As <code>BG</code>, call <code>FG</code> with an <em>RGB</em> ratio:
</p><table><tr><td> </td><td><pre class="example">0 0.5 0 FG
</pre></td></tr></table>
</dd>
<dt> <em>Its underlining</em></dt>
<dd><p><code>UL</code> requires a boolean argument, depending whether you want
or not the current face to be underlined.
</p><table><tr><td> </td><td><pre class="example">true UL
</pre></td></tr></table>
</dd>
<dt> <em>Its boxing</em></dt>
<dd><p>Requiring a boolean, <code>BX</code> let’s a face have a box drawn around.
</p>
</dd>
</dl>
<hr size="6">
<a name="Prologue-File-Format"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Definition-of-the-faces" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#A-prologue-example" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#PostScript" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Designing-PostScript-Prologues" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Prologue-File-Format-1"></a>
<h3 class="subsection">8.6.2 Prologue File Format</h3>
<p>Prologue files for a2ps(reported with ‘<samp>--list-prologues</samp>’) can be included in the comment
part:
</p><table><tr><td> </td><td><pre class="example">Documentation
This prologue is the same as the prologue code(pb)code, but using
the bold version of the fonts.
EndDocumentation
% code follows this line
</pre></td></tr></table>
<p>See section <a href="#Documentation-Format">Documentation Format</a>, for more on the format.
</p>
<hr size="6">
<a name="A-prologue-example"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Prologue-File-Format" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#PostScript" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Designing-PostScript-Prologues" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="A-step-by-step-example"></a>
<h3 class="subsection">8.6.3 A step by step example</h3>
<p>We strongly suggest our readers not to start from scratch, but to copy
one of the available styles (see the result of ‘<samp>a2ps
--list=prologues</samp>’), to drop it in one of a2ps‘<samp>$HOME/.a2ps</samp>’, and to patch it until you like it.
</p>
<p>Here, we will start from ‘<tt>color.pro</tt>’, trying to give it a funky
look.
</p>
<p>Say you want the keywords to be in Helvetica, drawn in a flashy pink on
a light green. And strong keywords, in Times Bold Italic in brown on a
soft Hawaiian sea green (you are definitely a fine art <em>amateur</em>).
</p>
<p>Then you need to look for ‘<samp>k</samp>’ and ‘<samp>K</samp>’:
</p><table><tr><td> </td><td><pre class="example">/k {
false BG
0 0 0.9 FG
%Face: Keyword Courier bfs
Show
} bind def
/K {
false BG
0 0 0.8 FG
%Face: Keyword_strong Courier-Bold bfs
Show
} bind def
</pre></td></tr></table>
<p>and turn it into:
</p><table><tr><td> </td><td><pre class="example">/k {
0.2 1 0.2 true BG
1 0.2 1 FG
%Face: Keyword Helvetica bfs
Show
} bind def
/K {
0.4 0.2 0 true BG
0.5 1 1 FG
%Face: Keyword_strong Times-BoldItalic bfs
Show
} bind def
</pre></td></tr></table>
<p>Waouh! It looks great!
</p>
<p>A bit trickier: let change the way the line numbers are printed.
</p>
<p>First, let’s look for the font definition:
</p><table><tr><td> </td><td><pre class="example">%%BeginSetup
% The font for line numbering
/f# /Helvetica findfont bfs .6 mul scalefont def
%%EndSetup
</pre></td></tr></table>
<p>Let it be in Times, twice bigger than the body font.
</p><table><tr><td> </td><td><pre class="example">%%BeginSetup
% The font for line numbering
/f# /Times-Roman findfont bfs 2 mul scalefont def
%%EndSetup
</pre></td></tr></table>
<p>How about its foreground color?
</p><table><tr><td> </td><td><pre class="example">% Function print line number (<string> # -)
/# {
gsave
sx cw mul 2 div neg 0 rmoveto
f# setfont
0.8 0.1 0.1 FG
c-show
grestore
} bind def
</pre></td></tr></table>
<p>Let it be blue. Now you know the process: just put ‘<samp>0 0 1</samp>’ as
<code>FG</code> arguments.
</p>
<hr size="6">
<a name="Contributions"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#A-prologue-example" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#card" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#PostScript" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Contributions-1"></a>
<h1 class="chapter">9. Contributions</h1>
<p>This chapter documents the various shell scripts or other tools that are
distributed with the a2psreader should also look at the documentation of <code>Ogonkify</code>
(see <a href="ogonkify.html#Top">(ogonkify)Top</a> section ‘Overview’ in <cite>Ogonkify manual</cite>), written by Juliusz
Chroboczek.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#card">9.1 <code>card</code></a></td><td> </td><td align="left" valign="top"> Printing Reference Cards
</td></tr>
<tr><td align="left" valign="top"><a href="#fixps">9.2 <code>fixps</code></a></td><td> </td><td align="left" valign="top"> Fixing Some Ill Designed PostScript Files
</td></tr>
<tr><td align="left" valign="top"><a href="#fixnt">9.3 <code>fixnt</code></a></td><td> </td><td align="left" valign="top"> Fixing Microsoft NT PostScript Files
</td></tr>
<tr><td align="left" valign="top"><a href="#pdiff">9.4 <code>pdiff</code></a></td><td> </td><td align="left" valign="top"> Produce Pretty Comparison of Files
</td></tr>
<tr><td align="left" valign="top"><a href="#psmandup">9.5 <code>psmandup</code></a></td><td> </td><td align="left" valign="top"> Printing Duplex on Simplex Printers
</td></tr>
<tr><td align="left" valign="top"><a href="#psset">9.6 <code>psset</code></a></td><td> </td><td align="left" valign="top"> Inserting calls to setpagedevice
</td></tr>
</table>
<hr size="6">
<a name="card"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Contributions" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-card" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="card-1"></a>
<h2 class="section">9.1 <code>card</code></h2>
<p>Many users of a2pssummary of the options. In fact, something closely related to the
output of ‘<samp>a2ps --help</samp>’.
</p>
<p>The first version of this reference card was a PreScript file
(see section <a href="#PreScript">PreScript</a>) to be printed by a2ps@c. Very soon a much better
scheme was found: using a style sheet to pretty print directly the
output of ‘<samp>a2ps --help</samp>’! A first advantage is then that the
reference cards can be printed in the tongue you choose.
</p>
<p>A second was that this treatment could be applied to any application
supporting a ‘<samp>--help</samp>’-like option.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Invoking-card">9.1.1 Invoking <code>card</code></a></td><td> </td><td align="left" valign="top"> Command Line Interface
</td></tr>
<tr><td align="left" valign="top"><a href="#Caution-when-Using-card">9.1.2 Caution when Using <code>card</code></a></td><td> </td><td align="left" valign="top"> card runs commands
</td></tr>
</table>
<hr size="6">
<a name="Invoking-card"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#card" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Caution-when-Using-card" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#card" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Invoking-card-1"></a>
<h3 class="subsection">9.1.1 Invoking <code>card</code></h3>
<table><tr><td> </td><td><pre class="example">card [<var>options</var>] <var>applications</var> [-- <var>a2ps@c-options</var>]
</pre></td></tr></table>
<p><code>card</code> is a shell script which tries to guess how to get your
<var>applications</var>’ help message (typically by the options ‘<samp>--help</samp>’
or ‘<samp>-h</samp>’), and pretty prints it thanks to a2psthe environment variable ‘<samp>A2PS</samp>’ if it is set).
<var>a2ps@c-options</var> are passed to a2ps@c.
</p>
<p>Supported options are:
</p>
<dl>
<dt><a name="index-_002dh"></a><u>Option:</u> <b>-h</b></dt>
<dt><a name="index-_002d-63"></a><u>Option:</u> <b>-</b><i><b>-</b>help</i></dt>
<dd><p>print a short help message and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002dV"></a><u>Option:</u> <b>-V</b></dt>
<dt><a name="index-_002d-64"></a><u>Option:</u> <b>-</b><i><b>-</b>version</i></dt>
<dd><p>report the version and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002dq-1"></a><u>Option:</u> <b>-q</b></dt>
<dt><a name="index-_002d-65"></a><u>Option:</u> <b>-</b><i><b>-</b>quiet</i></dt>
<dt><a name="index-_002d-66"></a><u>Option:</u> <b>-</b><i><b>-</b>silent</i></dt>
<dd><p>Run silently.
</p></dd></dl>
<dl>
<dt><a name="index-_002dD-1"></a><u>Option:</u> <b>-D</b></dt>
<dt><a name="index-_002d-67"></a><u>Option:</u> <b>-</b><i><b>-</b>debug</i></dt>
<dd><p>enter in debug mode.
</p></dd></dl>
<dl>
<dt><a name="index-_002dl-1"></a><u>Option:</u> <b>-l</b><i> <var>language</var></i></dt>
<dt><a name="index-_002d-68"></a><u>Option:</u> <b>-</b><i><b>-</b>language=<var>language</var></i></dt>
<dd><p>specify the language in which the reference card should be printed.
<var>language</var> should be the symbol used by <code>LC_ALL</code> etc.
(such as ‘<samp>fr</samp>’, ‘<samp>it</samp>’ etc.).
</p>
<p>If the <var>applications</var> don’t support internationalization,
English will be used.
</p></dd></dl>
<dl>
<dt><a name="index-_002d-69"></a><u>Option:</u> <b>-</b><i><b>-</b>command=<var>command</var></i></dt>
<dd><p>Don’t try to guess the <var>applications</var>’ way to report their
help message, but rather use the call <var>command</var>.
A typical example is
</p><table><tr><td> </td><td><pre class="example">card --command="cc -flags"
</pre></td></tr></table>
</dd></dl>
<p>It is possible to give options to a2psspecifying them after ‘<samp>--</samp>’. For instance
</p><table><tr><td> </td><td><pre class="example">card gmake gtar --command="cc -flags" -- -Pdisplay
</pre></td></tr></table>
<p>builds the reference card of <code>GNU make</code>, <code>GNU tar</code> (automatic
detection of ‘<samp>--help</samp>’ support), and <code>cc</code> thanks to
‘<samp>-flags</samp>’.
</p>
<hr size="6">
<a name="Caution-when-Using-card"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Invoking-card" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#fixps" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#card" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Caution-when-Using-card-1"></a>
<h3 class="subsection">9.1.2 Caution when Using <code>card</code></h3>
<p>Remember that <code>card</code> runs the programs you give it, and the
commands you supplied. Hence if there is a silly programs that has a
weird behavior given the option ‘<samp>-h</samp>’ etc., beware of the result.
</p>
<p>It is even clearer using ‘<samp>--command</samp>’: avoid running ‘<samp>card
--command="rm -rf *"</samp>’, because the result will be exactly what you think
it will be!
</p>
<hr size="6">
<a name="fixps"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Caution-when-Using-card" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-fixps" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="fixps-1"></a>
<h2 class="section">9.2 <code>fixps</code></h2>
<p>The shell script <code>fixps</code> tries its best to fix common problems in
PostScript files that may prevent post processing. It makes heavy use
of the <code>psutils</code>. It is a good idea to use <code>fixps</code> in the
PostScript delegations.
</p>
<p>It first tries to make simple fixes, but some really broken files may
require a much deeper treatment. If <code>fixps</code> feels the need for
such a major surgery act, it may give up local changes and ask
<code>Ghostscript</code> for a global rewriting.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Invoking-fixps">9.2.1 Invoking <code>fixps</code></a></td><td> </td><td align="left" valign="top"> Command Line Interface
</td></tr>
</table>
<hr size="6">
<a name="Invoking-fixps"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#fixps" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#fixnt" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#fixps" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Invoking-fixps-1"></a>
<h3 class="subsection">9.2.1 Invoking <code>fixps</code></h3>
<table><tr><td> </td><td><pre class="example">fixps [<var>options</var>] [<var>file</var>]
</pre></td></tr></table>
<p>sanitize the PostScript <var>file</var> (or of the standard input if no
<var>file</var> is given, or if <var>file</var> is ‘<samp>-</samp>’).
</p>
<p>Supported options are:
</p>
<dl>
<dt><a name="index-_002dh-1"></a><u>Option:</u> <b>-h</b></dt>
<dt><a name="index-_002d-70"></a><u>Option:</u> <b>-</b><i><b>-</b>help</i></dt>
<dd><p>Print a short help message and a list of the fixes that are
performed. Exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002dV-1"></a><u>Option:</u> <b>-V</b></dt>
<dt><a name="index-_002d-71"></a><u>Option:</u> <b>-</b><i><b>-</b>version</i></dt>
<dd><p>report the version and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002dD-2"></a><u>Option:</u> <b>-D</b></dt>
<dt><a name="index-_002d-72"></a><u>Option:</u> <b>-</b><i><b>-</b>debug</i></dt>
<dd><p>enter in debug mode.
</p></dd></dl>
<dl>
<dt><a name="index-_002dq-2"></a><u>Option:</u> <b>-q</b></dt>
<dt><a name="index-_002d-73"></a><u>Option:</u> <b>-</b><i><b>-</b>quiet</i></dt>
<dt><a name="index-_002d-74"></a><u>Option:</u> <b>-</b><i><b>-</b>silent</i></dt>
<dd><p>Run silently.
</p></dd></dl>
<dl>
<dt><a name="index-_002do-1"></a><u>Option:</u> <b>-o</b><i> <var>file</var></i></dt>
<dt><a name="index-_002d-75"></a><u>Option:</u> <b>-</b><i><b>-</b>output=<var>file</var></i></dt>
<dd><p>specify the <var>file</var> in which is saved the output.
</p></dd></dl>
<dl>
<dt><a name="index-_002dn-1"></a><u>Option:</u> <b>-n</b></dt>
<dt><a name="index-_002d-76"></a><u>Option:</u> <b>-</b><i><b>-</b>no-fix</i></dt>
<dd><p>Don’t actually fix the <var>file</var> but still honor all of the other
options. In particular, ‘<samp>fixps -qn <var>file</var></samp>’ is equivalent to
‘<samp>cat <var>file</var></samp>’.
</p></dd></dl>
<dl>
<dt><a name="index-_002dc-1"></a><u>Option:</u> <b>-c</b></dt>
<dt><a name="index-_002d-77"></a><u>Option:</u> <b>-</b><i><b>-</b>check</i></dt>
<dt><a name="index-_002d-78"></a><u>Option:</u> <b>-</b><i><b>-</b>dry-run</i></dt>
<dd><p>Don’t actually fix the <var>file</var>: just report the diagnostics.
Contrary to the option ‘<samp>fixps -qc</samp>’ does absolutely nothing (while
it does take some time to do it nicely).
</p></dd></dl>
<dl>
<dt><a name="index-_002df-1"></a><u>Option:</u> <b>-f</b></dt>
<dt><a name="index-_002d-79"></a><u>Option:</u> <b>-</b><i><b>-</b>force</i></dt>
<dd><p>Ask <code>ghoscript</code> for a full rewrite of the <var>file</var>. The output
file is really sane, but can be much longer than the original. For this
reason and others, it is not always a good idea to make a full rewrite.
This option should be used only for files that give major problems.
</p></dd></dl>
<hr size="6">
<a name="fixnt"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Invoking-fixps" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-fixnt" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="fixnt-1"></a>
<h2 class="section">9.3 <code>fixnt</code></h2>
<p><code>fixnt</code> (see its
<a href="http://www.itsm.uni-stuttgart.de/~bauer/fixnt.html">http://www.itsm.uni-stuttgart.de/~bauer/fixnt.html</a>, home page) is
maintained by <a href="mailto:bauer@itsm.uni-stuttgart.de">Holger Bauer</a> and
<a href="mailto:rath@itsm.uni-stuttgart.de">Michael Rath</a>. It is meant to fix
the problems of the PostScript files generated by the Microsoft
PostScript driver under Windows NT (3.5 and 4.0).
</p>
<p><code>fixps</code> is aware of the cases where <code>fixnt</code> should be used,
hence you should not worry of when to use <code>fixnt</code>.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Invoking-fixnt">9.3.1 Invoking <code>fixnt</code></a></td><td> </td><td align="left" valign="top"> Command Line Interface
</td></tr>
</table>
<hr size="6">
<a name="Invoking-fixnt"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#fixnt" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#pdiff" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#fixnt" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Invoking-fixnt-1"></a>
<h3 class="subsection">9.3.1 Invoking <code>fixnt</code></h3>
<table><tr><td> </td><td><pre class="example">fixnt < ‘<samp>file.ps</samp>’
</pre></td></tr></table>
<p>sanitize the PostScript file <var>file.ps</var> and produce the result on
the standard output.
</p>
<hr size="6">
<a name="pdiff"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Invoking-fixnt" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-pdiff" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="pdiff-1"></a>
<h2 class="section">9.4 <code>pdiff</code></h2>
<p>The shell script <code>pdiff</code> aims to pretty print diffs between files.
It basically uses GNU <code>diff</code> (see <a href="diff.html#diff">(diff)diff</a> section ‘Overview’ in <cite>Comparing and Merging Files</cite>) or GNU <code>wdiff</code> (see <a href="wdiff.html#wdiff">(wdiff)wdiff</a> section ‘The word difference finder’ in <cite>GNU wdiff</cite>) to extract the diff, then calls
a2ps</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Invoking-pdiff">9.4.1 Invoking <code>pdiff</code></a></td><td> </td><td align="left" valign="top"> Command Line Interface
</td></tr>
</table>
<hr size="6">
<a name="Invoking-pdiff"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#pdiff" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#psmandup" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#pdiff" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Invoking-pdiff-1"></a>
<h3 class="subsection">9.4.1 Invoking <code>pdiff</code></h3>
<table><tr><td> </td><td><pre class="example">pdiff [<var>options</var>] <var>file-1</var> <var>file-2</var> [-- <var>a2ps@c-options</var>]
</pre></td></tr></table>
<p>make a pretty comparison between <var>file-1</var> and <var>file-2</var>.
<var>a2ps@c-options</var> are passed to a2ps@c.
</p>
<p>Supported options are:
</p>
<dl>
<dt><a name="index-_002dh-2"></a><u>Option:</u> <b>-h</b></dt>
<dt><a name="index-_002d-80"></a><u>Option:</u> <b>-</b><i><b>-</b>help</i></dt>
<dd><p>print a short help message and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002dV-2"></a><u>Option:</u> <b>-V</b></dt>
<dt><a name="index-_002d-81"></a><u>Option:</u> <b>-</b><i><b>-</b>version</i></dt>
<dd><p>report the version and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002dq-3"></a><u>Option:</u> <b>-q</b></dt>
<dt><a name="index-_002d-82"></a><u>Option:</u> <b>-</b><i><b>-</b>quiet</i></dt>
<dt><a name="index-_002d-83"></a><u>Option:</u> <b>-</b><i><b>-</b>silent</i></dt>
<dd><p>Run silently.
</p></dd></dl>
<dl>
<dt><a name="index-_002dD-3"></a><u>Option:</u> <b>-D</b></dt>
<dt><a name="index-_002d-84"></a><u>Option:</u> <b>-</b><i><b>-</b>debug</i></dt>
<dd><p>enter in debug mode.
</p></dd></dl>
<dl>
<dt><a name="index-_002dw"></a><u>Option:</u> <b>-w</b></dt>
<dt><a name="index-_002d-85"></a><u>Option:</u> <b>-</b><i><b>-</b>words</i></dt>
<dd><p>Look for words differences (default). White space differences are not
considered.
</p></dd></dl>
<dl>
<dt><a name="index-_002dl-2"></a><u>Option:</u> <b>-l</b></dt>
<dt><a name="index-_002d-86"></a><u>Option:</u> <b>-</b><i><b>-</b>lines</i></dt>
<dd><p>Look for lines differences.
</p></dd></dl>
<p>It is possible to give options to a2psspecifying them after ‘<samp>--</samp>’. For instance
</p><table><tr><td> </td><td><pre class="example">pdiff COPYING COPYING.LIB -- -1 -P display
</pre></td></tr></table>
<p>Compares the files ‘<tt>COPYING</tt>’ and ‘<tt>COPYING.LIB</tt>’, and prints it
on the printer <code>display</code> (usually <code>Ghostview</code> or <code>gv</code>).
</p>
<hr size="6">
<a name="psmandup"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Invoking-pdiff" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-psmandup" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="psmandup-1"></a>
<h2 class="section">9.5 <code>psmandup</code></h2>
<p>I personally hate to print documents of hundreds of pages on a single
sided printer. Too bad, here there are no Duplex printers. The idea is
then simply first to print the odd pages, then the even in reversed
order. To make sure one flips the page in the meanwhile, the second
half should be printed from the manual feed tray.
</p>
<p>Make a shell script that automates this, and you get <code>psmandup</code>.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Invoking-psmandup">9.5.1 Invoking <code>psmandup</code></a></td><td> </td><td align="left" valign="top"> Command Line Interface
</td></tr>
</table>
<hr size="6">
<a name="Invoking-psmandup"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#psmandup" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#psset" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#psmandup" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Invoking-psmandup-1"></a>
<h3 class="subsection">9.5.1 Invoking <code>psmandup</code></h3>
<table><tr><td> </td><td><pre class="example">psmandup [<var>options</var>] [<var>file</var>]
</pre></td></tr></table>
<p>produce a manual duplex version of the PostScript <var>file</var> (or of the
standard input if no <var>file</var> is given, or if <var>file</var> is
‘<samp>-</samp>’). Once the first half is printed, put the sheet stack in the
manual feed tray for the second half<a name="DOCF4" href="#FOOT4">(4)</a>.
</p>
<p>Be aware that there is a time out for manually fed jobs, usually short,
hence do not miss the moment when the printer asks for the stack. If
ever you missed that moment, see option ‘<samp>--back</samp>’ to recover the
second half.
</p>
<p>Supported options are:
</p>
<dl>
<dt><a name="index-_002dh-3"></a><u>Option:</u> <b>-h</b></dt>
<dt><a name="index-_002d-87"></a><u>Option:</u> <b>-</b><i><b>-</b>help</i></dt>
<dd><p>print a short help message and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002dV-3"></a><u>Option:</u> <b>-V</b></dt>
<dt><a name="index-_002d-88"></a><u>Option:</u> <b>-</b><i><b>-</b>version</i></dt>
<dd><p>report the version and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002dq-4"></a><u>Option:</u> <b>-q</b></dt>
<dt><a name="index-_002d-89"></a><u>Option:</u> <b>-</b><i><b>-</b>quiet</i></dt>
<dt><a name="index-_002d-90"></a><u>Option:</u> <b>-</b><i><b>-</b>silent</i></dt>
<dd><p>Run silently.
</p></dd></dl>
<dl>
<dt><a name="index-_002dD-4"></a><u>Option:</u> <b>-D</b></dt>
<dt><a name="index-_002d-91"></a><u>Option:</u> <b>-</b><i><b>-</b>debug</i></dt>
<dd><p>enter in debug mode.
</p></dd></dl>
<dl>
<dt><a name="index-_002do-2"></a><u>Option:</u> <b>-o</b><i> <var>file</var></i></dt>
<dt><a name="index-_002d-92"></a><u>Option:</u> <b>-</b><i><b>-</b>output=<var>file</var></i></dt>
<dd><p>specify the <var>file</var> in which is saved the output.
</p></dd></dl>
<dl>
<dt><a name="index-_002dn-2"></a><u>Option:</u> <b>-n</b></dt>
<dt><a name="index-_002d-93"></a><u>Option:</u> <b>-</b><i><b>-</b>no-fix</i></dt>
<dd><p><code>psmandup</code> will fail on ill designed PostScript (well, actually the
psutils will). To avoid this, by default the PostScript file is
sanitized by <code>fixps</code>.
</p>
<p>When given this option, don’t run <code>fixps</code>. This is meant to be
used when <code>fixps</code> has already been used higher in the processing
chain.
</p></dd></dl>
<dl>
<dt><a name="index-_002df-2"></a><u>Option:</u> <b>-f</b></dt>
<dt><a name="index-_002d-94"></a><u>Option:</u> <b>-</b><i><b>-</b>front</i></dt>
<dd><p>Output only the front pages, with no special PostScript feature request.
</p></dd></dl>
<dl>
<dt><a name="index-_002db-1"></a><u>Option:</u> <b>-b</b></dt>
<dt><a name="index-_002d-95"></a><u>Option:</u> <b>-</b><i><b>-</b>back</i></dt>
<dd><p>Output only the back pages, with a manual feed request.
</p>
<p>This option is especially useful when the manual feed time out expired
before you could insert back the stack in the manual feed tray.
</p></dd></dl>
<p><code>psmandup</code> assumes the printer is Level 2, and supports manual
feeding. The <var>file</var> should be reasonably sane, otherwise
<code>psmandup</code> fails miserably.
</p>
<p>Typical use is
</p><table><tr><td> </td><td><pre class="example">psmandup file.ps | lp
</pre></td></tr></table>
<p>or can be put into a2ps@c’ printer commands (see section <a href="#Your-Printers">Your Printers</a>).
</p>
<hr size="6">
<a name="psset"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Invoking-psmandup" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Invoking-psset" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Contributions" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="psset-1"></a>
<h2 class="section">9.6 <code>psset</code></h2>
<p>The shell script <code>psset</code> inserts calls to <code>setpagedevice</code> in a
PostScript file. This is useful for instance to add Tumble or Manual
feed request. Actually, <code>psmandup</code> uses <code>psset</code>.
</p>
<p>You should know nevertheless that a2ps<code>setpagedevice</code> by itself, i.e., you can run ‘<samp>a2ps
-SManualFeed foo</samp>’ to print ‘<tt>foo</tt>’ onto the manually fed tray, or run
‘<samp>a2ps -s2 foo</samp>’ to print Duplex. There are no need of <code>psset</code>
from a2ps@c.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Invoking-psset">9.6.1 Invoking <code>psset</code></a></td><td> </td><td align="left" valign="top"> Command Line Interface
</td></tr>
</table>
<hr size="6">
<a name="Invoking-psset"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#psset" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#psset" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Invoking-psset-1"></a>
<h3 class="subsection">9.6.1 Invoking <code>psset</code></h3>
<table><tr><td> </td><td><pre class="example">psset [<var>options</var>] [<var>file</var>]
</pre></td></tr></table>
<p>produce a version of the PostScript <var>file</var> (or of the standard input
if no <var>file</var> is given, or if <var>file</var> is ‘<samp>-</samp>’) that makes
protected calls to the PostScript operator <code>setpagedevice</code>.
Typical use is making <var>file</var> print duplex, or on the manual tray
etc.
</p>
<p>The call is protected so that the resulting file is safe, i.e., will
still be portable, even with requests such as ‘<samp>-Sfoo:bar</samp>’.
</p>
<p>It is safe to run <code>psset</code> with no feature requests. Depending upon
the option ‘<samp>--no-fix</samp>’, it is either equivalent to doing nothing, or
to running <code>fixps</code> (see section <a href="#fixps"><code>fixps</code></a>).
</p>
<p>Supported options are:
</p>
<dl>
<dt><a name="index-_002dh-4"></a><u>Option:</u> <b>-h</b></dt>
<dt><a name="index-_002d-96"></a><u>Option:</u> <b>-</b><i><b>-</b>help</i></dt>
<dd><p>Print a short help message and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002dV-4"></a><u>Option:</u> <b>-V</b></dt>
<dt><a name="index-_002d-97"></a><u>Option:</u> <b>-</b><i><b>-</b>version</i></dt>
<dd><p>report the version and exit successfully.
</p></dd></dl>
<dl>
<dt><a name="index-_002dD-5"></a><u>Option:</u> <b>-D</b></dt>
<dt><a name="index-_002d-98"></a><u>Option:</u> <b>-</b><i><b>-</b>debug</i></dt>
<dd><p>enter in debug mode.
</p></dd></dl>
<dl>
<dt><a name="index-_002dq-5"></a><u>Option:</u> <b>-q</b></dt>
<dt><a name="index-_002d-99"></a><u>Option:</u> <b>-</b><i><b>-</b>quiet</i></dt>
<dt><a name="index-_002d-100"></a><u>Option:</u> <b>-</b><i><b>-</b>silent</i></dt>
<dd><p>Run silently.
</p></dd></dl>
<dl>
<dt><a name="index-_002do-3"></a><u>Option:</u> <b>-o</b><i> <var>file</var></i></dt>
<dt><a name="index-_002d-101"></a><u>Option:</u> <b>-</b><i><b>-</b>output=<var>file</var></i></dt>
<dd><p>specify the <var>file</var> in which is saved the output.
</p></dd></dl>
<dl>
<dt><a name="index-_002dn-3"></a><u>Option:</u> <b>-n</b></dt>
<dt><a name="index-_002d-102"></a><u>Option:</u> <b>-</b><i><b>-</b>no-fix</i></dt>
<dd><p><code>psset</code> will fail on ill designed PostScript. Actually it is the
psutils that fail. To avoid this, by default the PostScript file is
sanitized by <code>fixps</code>.
</p>
<p>When given this option, don’t run <code>fixps</code>. This is meant to be
used when <code>fixps</code> has already been used higher in the processing
chain.
</p></dd></dl>
<dl>
<dt><a name="index-_002dS-1"></a><u>Option:</u> <b>-S</b><i> <var>key</var>:<var>value</var></i></dt>
<dt><a name="index-_002d-103"></a><u>Option:</u> <b>-</b><i><b>-</b>setpagedevice=<var>key</var>:<var>value</var></i></dt>
<dd><p>Insert a <code>setpagedevice</code> call setting <var>key</var> to <var>value</var>.
Multiple values accumulate. Lists of requests separated with ‘<samp>;</samp>’
are valid (e.g., ‘<samp>-SDuplex:true;Tumble:false</samp>’).
</p></dd></dl>
<dl>
<dt><a name="index-_002da-1"></a><u>Option:</u> <b>-a</b><i> <var>page</var></i></dt>
<dt><a name="index-_002d-104"></a><u>Option:</u> <b>-</b><i><b>-</b>at=<var>page</var></i></dt>
<dd><p>Specify the page where the <code>setpagedevice</code> call should be done.
The <var>page</var> 0, which is the default, corresponds to the ‘<samp>Setup</samp>’
section of the document. More precisely, the insertion is performed at
the end of the ‘<samp>Setup</samp>’ section, so that if there are multiple calls
to <code>psset</code> on the same document (which is of course, a bad idea),
the last call is winning.
</p>
<p>In a typical use you should not change the <var>page</var>.
</p></dd></dl>
<dl>
<dt><a name="index-_002dm-1"></a><u>Option:</u> <b>-m</b></dt>
<dt><a name="index-_002d-105"></a><u>Option:</u> <b>-</b><i><b>-</b>manualfeed</i></dt>
<dd><p>Alias for ‘<samp>-SManualFeed:true</samp>’, i.e., the request to print using the
manual feed tray.
</p></dd></dl>
<dl>
<dt><a name="index-_002ds-1"></a><u>Option:</u> <b>-s</b></dt>
<dt><a name="index-_002d-106"></a><u>Option:</u> <b>-</b><i><b>-</b>simplex</i></dt>
<dd><p>Alias for ‘<samp>-SDuplex:false</samp>’, i.e., force simplex printing.
</p></dd></dl>
<dl>
<dt><a name="index-_002dd-1"></a><u>Option:</u> <b>-d</b></dt>
<dt><a name="index-_002d-107"></a><u>Option:</u> <b>-</b><i><b>-</b>duplex</i></dt>
<dd><p>Alias for ‘<samp>-SDuplex:true;Tumble:false</samp>’, i.e., the request to print
in duplex mode, binding along the long edge of the paper.
</p></dd></dl>
<dl>
<dt><a name="index-_002dt-1"></a><u>Option:</u> <b>-t</b></dt>
<dt><a name="index-_002d-108"></a><u>Option:</u> <b>-</b><i><b>-</b>tumble</i></dt>
<dd><p>Alias for ‘<samp>-SDuplex:true;Tumble:true</samp>’, i.e., duplex printing
such that binding should happen on the short edge of the medium.
</p></dd></dl>
<hr size="6">
<a name="FAQ"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Invoking-psset" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Why-Does-_002e_002e_002e_003f" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Contributions" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Frequently-asked-questions"></a>
<h1 class="chapter">10. Frequently asked questions</h1>
<p>Please, before sending us mail, make sure the problem you have is not
known, and explained. Moreover, avoid using the mailing list for asking
question about the options, etc. It has been built for announces and
suggestions, not to contact the authors.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Why-Does-_002e_002e_002e_003f">10.1 Why Does...?</a></td><td> </td><td align="left" valign="top"> Questions on Error
</td></tr>
<tr><td align="left" valign="top"><a href="#How-Can-I-_002e_002e_002e_003f">10.2 How Can I ...?</a></td><td> </td><td align="left" valign="top"> a2ps’ How-To
</td></tr>
<tr><td align="left" valign="top"><a href="#Please-tell-me_002e_002e_002e">10.3 Please tell me...</a></td><td> </td><td align="left" valign="top"> Existential Questions on a2ps
</td></tr>
</table>
<hr size="6">
<a name="Why-Does-_002e_002e_002e_003f"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#FAQ" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#It-Prints-Nothing" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Why-Does_002e_002e_002e_003f"></a>
<h2 class="section">10.1 Why Does...?</h2>
<p>Error related questions.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#It-Prints-Nothing">10.1.1 Why Does it Print Nothing?</a></td><td> </td><td align="left" valign="top"> The printer issues nothing
</td></tr>
<tr><td align="left" valign="top"><a href="#It-Prints-in-Simplex">10.1.2 Why Does it Print in Simplex?</a></td><td> </td><td align="left" valign="top"> While I asked for Duplex
</td></tr>
<tr><td align="left" valign="top"><a href="#It-Prints-in-Duplex">10.1.3 Why Does it Print in Duplex?</a></td><td> </td><td align="left" valign="top"> While I asked for Simplex
</td></tr>
<tr><td align="left" valign="top"><a href="#It-Does-Not-Fit-on-the-Paper">10.1.4 Why Does it Not Fit on the Paper?</a></td><td> </td><td align="left" valign="top"> Some parts are missing
</td></tr>
<tr><td align="left" valign="top"><a href="#It-Prints-Junk">10.1.5 Why Does it Print Junk?</a></td><td> </td><td align="left" valign="top"> Random characters
</td></tr>
<tr><td align="left" valign="top"><a href="#It-Says-my-File-is-Binary">10.1.6 Why Does it Say my File is Binary?</a></td><td> </td><td align="left" valign="top"> And refuses to print it
</td></tr>
<tr><td align="left" valign="top"><a href="#It-Refuses-to-Change-the-Font-Size">10.1.7 Why Does it Refuse to Change the Font Size</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr size="6">
<a name="It-Prints-Nothing"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Why-Does-_002e_002e_002e_003f" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#It-Prints-in-Simplex" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Why-Does-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Why-Does-it-Print-Nothing_003f"></a>
<h3 class="subsection">10.1.1 Why Does it Print Nothing?</h3>
<blockquote><p>a2ps</p></blockquote>
<p>There are two ways that printing can fail: silently, or with a
diagnostic.
</p>
<p>First, <strong>check that the printer received what you sent</strong>. a2psmay correctly do its job, but have the printer queue fail to deliver the
job. In case of doubt, please check that the printer’s leds blink (or
whatever is its way to show that something is being processed).
</p>
<p>If the printer does receive the job, but prints nothing at all, check
that you did not give exotic options to an old printer (typically, avoid
printing on two sides on a printer that does not support it). Avoid
using ‘<samp>-S</samp>’, ‘<samp>--setpagedevice</samp>’ (see section <a href="#Page-Device-Options">Page Device Options</a>)
and ‘<samp>--statusdict</samp>’ (see section <a href="#Statusdict-Options">Statusdict Options</a>).
</p>
<p>If the trouble persists, please try again but with the option
‘<samp>--debug</samp>’ (a PostScript error handler is downloaded), and then send
us:
</p><ol>
<li>
the input file that gives problems
</li><li>
the output file created by a2ps
</li><li>
the error message that was printed.
</li></ol>
<hr size="6">
<a name="It-Prints-in-Simplex"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#It-Prints-Nothing" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#It-Prints-in-Duplex" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Why-Does-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Why-Does-it-Print-in-Simplex_003f"></a>
<h3 class="subsection">10.1.2 Why Does it Print in Simplex?</h3>
<blockquote><p><i>Though I ask a2psprinted Simplex.</i>
</p></blockquote>
<p>If your printer is too old, then a2pscode it needs when ‘<samp>-s2</samp>’ is specified. This is because your
printer uses an old and not standardized interface for special features.
</p>
<p>So you need to
</p><ol>
<li>
specify that you want Duplex mode: ‘<samp>-s2</samp>’,
</li><li>
remove by hand the standardized call to the Duplex feature:
‘<samp>-SDuplex</samp>’,
</li><li>
add the non standard call to Duplex. Try
‘<samp>--statusdict=setduplexmode:true</samp>’.
</li></ol>
<p>Since this is painful to hit, a User Option (see section <a href="#Your-Shortcuts">Your Shortcuts</a>)
should help.
</p>
<hr size="6">
<a name="It-Prints-in-Duplex"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#It-Prints-in-Simplex" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#It-Does-Not-Fit-on-the-Paper" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Why-Does-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Why-Does-it-Print-in-Duplex_003f"></a>
<h3 class="subsection">10.1.3 Why Does it Print in Duplex?</h3>
<blockquote><p><i>Though I ask a2psprinted Duplex.</i>
</p></blockquote>
<p>Actually when you require Simplex, a2psreasons. Hence, if your printer is defaulted to Duplex, the job will be
Duplexed. So you have to force a2ps‘<samp>-SDuplex:false</samp>’. The user options ‘<samp>-=s1</samp>’ and
‘<samp>-=simplex</samp>’ have names easier to remember.
</p>
<p>In the next version of a2psfixed in a user friendly way.
</p>
<hr size="6">
<a name="It-Does-Not-Fit-on-the-Paper"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#It-Prints-in-Duplex" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#It-Prints-Junk" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Why-Does-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Why-Does-it-Not-Fit-on-the-Paper_003f"></a>
<h3 class="subsection">10.1.4 Why Does it Not Fit on the Paper?</h3>
<blockquote><p><i>When I print text files with a2ps@c, it prints beyond the frame of
the paper.</i>
</p></blockquote>
<p>You are most probably printing with a bad medium, for instance using A4
paper within a2ps@c, while your printer uses Letter paper. Some jet
printers have a small printable area, and a2psboth case, read <a href="#Sheet-Options">Sheet Options</a>, option ‘<samp>--medium</samp>’ for more.
</p>
<hr size="6">
<a name="It-Prints-Junk"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#It-Does-Not-Fit-on-the-Paper" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#It-Says-my-File-is-Binary" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Why-Does-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Why-Does-it-Print-Junk_003f"></a>
<h3 class="subsection">10.1.5 Why Does it Print Junk?</h3>
<blockquote><p><i>What I get on the printer is long and incomprehensible. It does not
seem to correspond to what I wanted to print.</i>
</p></blockquote>
<p>You are probably printing a PostScript file or equivalent. Try to print
with ‘<samp>-Z</samp>’: a2psprogram that can help you (see section <a href="#Your-Delegations">Your Delegations</a>). In case of doubt,
don’t hesitate to save into a file, and check the content with
<code>Ghostview</code>, or equivalent:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">$ a2ps my_weird_file -Z -o mwf.ps
$ gv mwf.ps
</pre></td></tr></table>
</td></tr></table>
<p>If your a2psfake-printer:
</p><table><tr><td> </td><td><table class="cartouche" border="1"><tr><td>
<pre class="example">$ a2ps my_weird_file -Z -P display
</pre></td></tr></table>
</td></tr></table>
<p>If it is incorrect, ask for help around you.
</p>
<hr size="6">
<a name="It-Says-my-File-is-Binary"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#It-Prints-Junk" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#It-Refuses-to-Change-the-Font-Size" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Why-Does-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Why-Does-it-Say-my-File-is-Binary_003f"></a>
<h3 class="subsection">10.1.6 Why Does it Say my File is Binary?</h3>
<blockquote><p>a2ps</p></blockquote>
<p>There are several reasons that can cause a2psbinary:
</p><ul class="toc">
<li>-
there are many non printable characters in the file. Then you need to
use the option ‘<samp>--print-anyway</samp>’.
</li><li>-
the file is sane, composed of printable characters. Then it is very
likely that <code>file(1)</code> said the type of the file is ‘<samp>data</samp>’, in
which case a2ps<ul class="toc">
<li>-
specify the type of the file, for instance ‘<samp>-Eplain</samp>’;
</li><li>-
specify to print in any case, ‘<samp>--print-anyway</samp>’;
</li><li>-
remove the annoying rule from the system’s ‘<tt>sheets.map</tt>’:
<table><tr><td> </td><td><pre class="example">binary: <data*>
</pre></td></tr></table>
</li><li>-
insert in your own ‘<tt>~/.a2ps/sheets.map</tt>’ a rule that overrides that
of the system’s ‘<tt>sheets.map</tt>’:
<table><tr><td> </td><td><pre class="example"><i># Load the system's sheets.map</i>
include(/usr/local/share/a2ps/sheets/sheets.map)
<i># Override the rule for files with type `data' according to file(1)</i>
plain: <data*>
</pre></td></tr></table>
<p>But this is not very good, since then this rule is always the first
tested, which means that any file with type ‘<samp>data</samp>’ according to
<code>file(1)</code> will be printed in ‘<samp>plain</samp>’ style, even if the file
is called ‘<tt>foo.c</tt>’.
</p>
</li><li>-
if your files can be recognized, insert a new rule in a
‘<tt>sheets.map</tt>’, such as
<table><tr><td> </td><td><pre class="example"><i># file(1) says it's data, but it's pure text</i>
plain: /*.txx/
</pre></td></tr></table>
</li></ul>
</li></ul>
<hr size="6">
<a name="It-Refuses-to-Change-the-Font-Size"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#It-Says-my-File-is-Binary" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#How-Can-I-_002e_002e_002e_003f" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Why-Does-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Why-Does-it-Refuse-to-Change-the-Font-Size"></a>
<h3 class="subsection">10.1.7 Why Does it Refuse to Change the Font Size</h3>
<blockquote><p><em>a2ps (or ‘<samp>--lines-per-page</samp>’, or ‘<samp>--chars-per-line</samp>’).</em>
</p></blockquote>
<p>This is probably because you used ‘<samp>-1</samp>’..‘<samp>-9</samp>’ after the
‘<samp>--font-size</samp>’. This is wrong, because the options
‘<samp>-1</samp>’..‘<samp>-9</samp>’ set the font size (so that there are 80 characters
per lines), and many other things (See section <a href="#Page-Options">Page Options</a>, option
‘<samp>--font-size</samp>’).
</p>
<p>Hence ‘<samp>a2ps --font-size=12km -4</samp>’ is exactly the same thing as
‘<samp>a2ps -4</samp>’, but is different from ‘<samp>a2ps -4 --font-size=12km</samp>’.
Note that the ‘pure’ options (no side-effects) to specify the number of
virtual pages are ‘<samp>--columns</samp>’ and ‘<samp>--rows</samp>’.
</p>
<hr size="6">
<a name="How-Can-I-_002e_002e_002e_003f"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#It-Refuses-to-Change-the-Font-Size" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Leave-Room-for-Binding" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="How-Can-I-_002e_002e_002e_003f-1"></a>
<h2 class="section">10.2 How Can I ...?</h2>
<p>A mini how-to on a2ps@c.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Leave-Room-for-Binding">10.2.1 How Can I Leave Room for Binding?</a></td><td> </td><td align="left" valign="top"> Specifying Margins
</td></tr>
<tr><td align="left" valign="top"><a href="#Print-stdin">10.2.2 How Can I Print <code>stdin</code>?</a></td><td> </td><td align="left" valign="top"> Using a2ps in a pipe chain
</td></tr>
<tr><td align="left" valign="top"><a href="#Change-the-Fonts">10.2.3 How Can I Change the Fonts?</a></td><td> </td><td align="left" valign="top"> Tired of Courier?
</td></tr>
<tr><td align="left" valign="top"><a href="#The-Old-Option-_002db_003f">10.2.4 How Can I Simulate the Old Option ‘<samp>-b</samp>’?</a></td><td> </td><td align="left" valign="top"> Printing in Bold
</td></tr>
<tr><td align="left" valign="top"><a href="#Pass-Options-to-lpr">10.2.5 How Can I Pass Options to ‘<samp>lpr</samp>’</a></td><td> </td><td align="left" valign="top"> Disable the banner
</td></tr>
<tr><td align="left" valign="top"><a href="#Non-PostScript-Printers">10.2.6 How Can I Print on Non PostScript Printers?</a></td><td> </td><td align="left" valign="top"> Using GhostScript
</td></tr>
<tr><td align="left" valign="top"><a href="#Man-Pages-with-Underlines">10.2.7 How Can I Print Man Pages with Underlines</a></td><td> </td><td align="left" valign="top"> Now it Prints With Italics
</td></tr>
</table>
<hr size="6">
<a name="Leave-Room-for-Binding"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#How-Can-I-_002e_002e_002e_003f" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Print-stdin" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-Can-I-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="How-Can-I-Leave-Room-for-Binding_003f"></a>
<h3 class="subsection">10.2.1 How Can I Leave Room for Binding?</h3>
<p>The option ‘<samp>--margin[=<var>size</var>]</samp>’ is meant for this. See
<a href="#Sheet-Options">Sheet Options</a>.
</p>
<hr size="6">
<a name="Print-stdin"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Leave-Room-for-Binding" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Change-the-Fonts" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-Can-I-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="How-Can-I-Print-stdin_003f"></a>
<h3 class="subsection">10.2.2 How Can I Print <code>stdin</code>?</h3>
<p>a2ps‘<samp>-</samp>’ as file name. Automatic style selection is of course much
weaker: without the file name, a2psopinion (see section <a href="#Style-Sheet-Files">Style Sheet Files</a>). In general it means most
delegations are safe, but there will probably be no pretty-printing.
</p>
<p>‘<samp>You</samp>’ can supply a name to the standard input
(‘<samp>--stdin=<var>name</var></samp>’) with which it could guess the language.
</p>
<hr size="6">
<a name="Change-the-Fonts"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Print-stdin" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#The-Old-Option-_002db_003f" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-Can-I-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="How-Can-I-Change-the-Fonts_003f"></a>
<h3 class="subsection">10.2.3 How Can I Change the Fonts?</h3>
<p>See section <a href="#Designing-PostScript-Prologues">Designing PostScript Prologues</a>, for details. Make sure that all
the information a2ps</p>
<hr size="6">
<a name="The-Old-Option-_002db_003f"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Change-the-Fonts" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Pass-Options-to-lpr" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-Can-I-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="How-Can-I-Simulate-the-Old-Option-_002db_003f"></a>
<h3 class="subsection">10.2.4 How Can I Simulate the Old Option ‘<samp>-b</samp>’?</h3>
<p>By the past, a2psbold. Since now the fonts are defined by prologues (see section <a href="#Designing-PostScript-Prologues">Designing PostScript Prologues</a>) this option no longer makes sense. A replacement
prologue is provided: ‘<samp>bold</samp>’. To use it, give the option
‘<samp>--prologue=bold</samp>’.
</p>
<hr size="6">
<a name="Pass-Options-to-lpr"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#The-Old-Option-_002db_003f" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Non-PostScript-Printers" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-Can-I-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="How-Can-I-Pass-Options-to-lpr"></a>
<h3 class="subsection">10.2.5 How Can I Pass Options to ‘<samp>lpr</samp>’</h3>
<a name="index-banner"></a>
<a name="index-lp_002eoptions-1"></a>
<blockquote><p><i>How can I tell <code>a2ps</code> to ask <code>lpr</code> no to print the banner?</i>
</p>
<p><i>How can I pass specific options to <code>lp</code>?</i>
</p></blockquote>
<p>If your ‘<samp>Printer:</samp>’ fields in the configuration files were properly
filled (see section <a href="#Your-Printers">Your Printers</a>), you can use the variable
‘<samp>lp.options</samp>’ to pass options to <code>lpr</code> (or <code>lp</code>, depending
on your environment):
</p>
<table><tr><td> </td><td><pre class="example">a2ps -Dlp.options="-h -s" -P printer
</pre></td></tr></table>
<p>You can also define ‘<samp>lp.options</samp>’ once for all, See section <a href="#Defining-Variables">Defining Variables</a>.
</p>
<p>Finally, you can use ‘<samp>Printer:</samp>’ several times to reach a printer
with different <code>lpr</code> options.
</p>
<hr size="6">
<a name="Non-PostScript-Printers"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Pass-Options-to-lpr" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Man-Pages-with-Underlines" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-Can-I-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="How-Can-I-Print-on-Non-PostScript-Printers_003f"></a>
<h3 class="subsection">10.2.6 How Can I Print on Non PostScript Printers?</h3>
<blockquote><p><i>I use a2psnot PostScript. How can I do?</i>
</p></blockquote>
<p><code>Ghostscript</code> might be the tool you need (see section <a href="#Glossary">Glossary</a>). It
support conversion to many different non PostScript printers.
</p>
<p>Here are some tips on how to use a non PostScript printer. If somebody
feels like writing a more precise documentation, she really is welcome.
</p>
<p>Please refer to the <code>Ghostscript</code> documentation for a precise
description of the tuning you need.
</p>
<p>Basically, the first step you need is to achieve to call
<code>Ghostscript</code> in a pipe chain. In other words, try to find out the
right arguments <code>Ghostscript</code> needs in order to print with a
command like this:
</p><table><tr><td> </td><td><pre class="example">$ cat file.ps | gs <var>more arguments</var>
</pre></td></tr></table>
<p>In general it is the same command as for calling <code>Ghostscript</code> with
a filename, except that the file name to use is ‘<samp>-</samp>’:
</p><table><tr><td> </td><td><pre class="example">$ cat file.ps \
| gs -q -dNOPAUSE -sDEVICE=deskjet -sOutputFile=- - -c quit\
| lp -d<var>printer-name</var>
</pre></td></tr></table>
<p>Once it works, it is then easy to settle the right <code>Printer:</code> line
in your configuration file (see section <a href="#Your-Printers">Your Printers</a>). For instance:
</p><table><tr><td> </td><td><pre class="example">Printer: djet \
| gs -q -dNOPAUSE -sDEVICE=deskjet -sOutputFile=- - -c quit\
| lp -d djet
</pre></td></tr></table>
<p><a href="mailto:scancm@biobase.dk">Christian Mondrup</a> uses a2pswith a non PostScript printer. He uses:
</p><table><tr><td> </td><td><pre class="example">DefaultPrinter: | //c/gstools/gs5.10/Gswin32c.exe \
-Ic:\gstools\gs5.10;c:\gstools\gs5.10\fonts \
-sDEVICE=ljet4 -sPAPERSIZE=a4 -dNOPAUSE -r300 -dSAFER \
-sOutputFile="\\spool\HP LaserJet 5L (PCL)" \
-q - -c quit
</pre></td></tr></table>
<hr size="6">
<a name="Man-Pages-with-Underlines"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Non-PostScript-Printers" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Please-tell-me_002e_002e_002e" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#How-Can-I-_002e_002e_002e_003f" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="How-Can-I-Print-Man-Pages-with-Underlines"></a>
<h3 class="subsection">10.2.7 How Can I Print Man Pages with Underlines</h3>
<blockquote><p><i>By the past, when I printed a man page with a2ps@c, it used
underlines, but now it uses italics. I want underlines back!</i>
</p></blockquote>
<p>Use ‘<samp>a2ps --pro=ul</samp>’.
</p>
<hr size="6">
<a name="Please-tell-me_002e_002e_002e"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Man-Pages-with-Underlines" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Is-a2ps-Y2K-compliant_003f" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#FAQ" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Please-tell-me_002e_002e_002e-1"></a>
<h2 class="section">10.3 Please tell me...</h2>
<p>Wondering something?
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#Is-a2ps-Y2K-compliant_003f">10.3.1 Is a2ps</a></td><td> </td><td align="left" valign="top"> Printing dates in short format
</td></tr>
<tr><td align="left" valign="top"><a href="#The-Options-Have-Changed">10.3.2 Why Have the Options Changed?</a></td><td> </td><td align="left" valign="top"> Respect The Users
</td></tr>
<tr><td align="left" valign="top"><a href="#Why-not-using-yacc">10.3.3 Why not having used <code>yacc</code> and such</a></td><td> </td><td align="left" valign="top"> Why Using Style Sheets
</td></tr>
</table>
<hr size="6">
<a name="Is-a2ps-Y2K-compliant_003f"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Please-tell-me_002e_002e_002e" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#The-Options-Have-Changed" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Please-tell-me_002e_002e_002e" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Is-a2ps"></a>
<h3 class="subsection">10.3.1 Is a2ps</h3>
<p>The famous Y2K<a name="DOCF5" href="#FOOT5">(5)</a> problem...
</p>
<p>Yes, a2psmore recent than 4.10.3. The expansions of the following escapes were
broken (giving ‘<samp>100</samp>’ instead of ‘<samp>00</samp>’): ‘<samp>%D</samp>’, ‘<samp>%W</samp>’,
‘<samp>$D</samp>’, ‘<samp>$W</samp>’.
</p>
<p>Nevertheless, please note that if you required a two digit year, expect
to have ‘<samp>Jan 1st, 00</samp>’ someday. <strong>You</strong> are responsible of the
format you want for the date: See section <a href="#Escapes">Escapes</a>.
</p>
<hr size="6">
<a name="The-Options-Have-Changed"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Is-a2ps-Y2K-compliant_003f" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Why-not-using-yacc" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Please-tell-me_002e_002e_002e" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Why-Have-the-Options-Changed_003f"></a>
<h3 class="subsection">10.3.2 Why Have the Options Changed?</h3>
<blockquote><p><i>The options of this a2ps</i></p></blockquote>
<p>True. But the old scheme (up to version 4.6.1) prevented us from
offering more options. We <strong>had</strong> to drop it, and to fully
redesign the options handling.
</p>
<p>Since that profound change, we try to change as little as possible
between versions. Nevertheless, as the time passes, we discover that
some never used options should be renamed, or used for something else.
In these cases, compatibility code is left for a long time.
</p>
<p>Anywhere you put options but the command line (e.g., in a2psfiles or in shell scripts), <strong>avoid using short options</strong>, since short
options are much more likely to be changed (there are not so many, so it is
a precious resource). Since there are as many long options as one wants,
we can leave compatibility code with the long options.
</p>
<hr size="6">
<a name="Why-not-using-yacc"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#The-Options-Have-Changed" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Please-tell-me_002e_002e_002e" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Glossary" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Why-not-having-used-yacc-and-such"></a>
<h3 class="subsection">10.3.3 Why not having used <code>yacc</code> and such</h3>
<p>There are several reasons why we decided not to use grammars to parse
the files. Firstly it would have made the design of the style sheets
much more tricky, and today a2ps</p>
<p>Secondly, it limits the number of persons who could build a style sheet.
</p>
<p>Thirdly, we did not feel the need for such a powerful tool: handling the
keywords and the sequences is just what the users expect.
</p>
<p>Fourthly, any extension of a2ps</p>
<p>And last but not least, using a parser requires that the sources are
syntactic bug free, which is too strong a requirement.
</p>
<p>Nevertheless, <code>PreScript</code> gives the possibility to have on the one
hand a syntactic parser which would produce <code>PreScript</code> code, and
on the other hand, a2ps@c, which would make it PostScript. This schema
seems to us a good compromise. If it is still not enough for you, you
can use the library.
</p>
<hr size="6">
<a name="Glossary"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Why-not-using-yacc" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Genesis" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#FAQ" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Genesis" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Glossary-1"></a>
<h1 class="appendix">A. Glossary</h1>
<p>This section settles some terms used through out this document, and
provides the definitions of some terms you probably want to know about.
</p>
<dl compact="compact">
<dt> <em>Adobe</em></dt>
<dd><a name="index-Adobe"></a>
<p>Adobe is the firm who designed and owns the PostScript language.
The patent that printer manufacturers must pay to Adobe is the
main reason why PostScript printers are so expansive.
</p>
</dd>
<dt> <em>AFM file</em></dt>
<dd><a name="index-AFM-1"></a>
<p>AFM stands for Adobe Font Metrics. These files contain everything one
needs to know about a font: the width of the characters, the available
characters etc.
</p>
</dd>
<dt> <em>Charset</em></dt>
<dd><a name="index-Charset"></a>
</dd>
<dt> <em>Code Set</em></dt>
<dd><a name="index-Code-Set"></a>
<p>Cf. Encoding.
</p>
</dd>
<dt> <em>Delegate</em></dt>
<dd><a name="index-Delegate"></a>
<p>Another filter (application) which a2psThis feature is especially meant for page description files (see section <a href="#Your-Delegations">Your Delegations</a>).
</p>
</dd>
<dt> <em>DSC</em></dt>
<dd><a name="index-DSC-1"></a>
</dd>
<dt> <em>Document Structuring Conventions</em></dt>
<dd><a name="index-Document-Structuring-Conventions"></a>
<p>Because PostScript is a language, any file describing a document can
have an arbitrary complexity. To ease the post-processing of PostScript
files, the document should follow some conventions. Basically there are
two kinds of conventions to follow:
</p><dl compact="compact">
<dt> Page Independence</dt>
<dd><p>Special comments state where the pages begin and end. With these
comments (and the fact that the code describing a page starts and ends
somewhere, which is absolutely not necessary in PostScript), very simple
programs (such as <code>psnup</code>, <code>psselect</code> etc.) can post process
PostScript files.
</p>
</dd>
<dt> Requirements</dt>
<dd><p>Special features may be needed to run correctly the file. Some comments
specify what services are expected from the printer (e.g., fonts, duplex
printing, color etc.), and other what features are provided by the file
itself (e.g., fonts, procsets etc.), so that a print manager can decide
that a file cannot be printed on that printer, or that it is possible if
the file is slightly modified (e.g., adding a required font not known by
the printer) etc.
</p></dd>
</dl>
<p>The DSC are edited by Adobe. A document which respects them is said to
be <em>DSC conformant</em>.
</p>
<p>a2ps</p>
</dd>
<dt> <em>Duplex</em></dt>
<dt> <em>DuplexTumble</em></dt>
<dt> <em>DuplexNoTumble</em></dt>
<dd><a name="index-Duplex-1"></a>
<a name="index-DuplexTumble"></a>
<a name="index-DuplexNoTumble"></a>
<p>To print <em>Duplex</em> is to print double-sided. There are two ways to
print Duplex depending whether the second face is printed upside-down or
not:
</p><dl compact="compact">
<dt> <em>DuplexTumble</em></dt>
<dd><p>DuplexTumble is suitable when (if it were to be bound) the document
would be bound along the short edge (for instance when you are printing
booklets).
</p>
</dd>
<dt> <em>DuplexNoTumble</em></dt>
<dd><p>DuplexNoTumble corresponds to binding along the long edge of the medium.
A typical case is when printing one-up.
</p></dd>
</dl>
</dd>
<dt> <em>Encoding</em></dt>
<dd><a name="index-Encoding-1"></a>
<p>Association of human readable characters, and computers’ internal
numbered representation. In other words, they are the alphabets, which
are different according to your country/mother tongue. E.g.: ASCII,
Latin 1, corresponding to Western Europe etc.
</p>
<p>To know more about encodings, see <a href="#What-is-an-Encoding">What is an Encoding</a>.
</p>
</dd>
<dt> <em><code>Ghostscript</code></em></dt>
<dt> <em><code>gs</code></em></dt>
<dd><a name="index-Ghostscript"></a>
<a name="index-gs"></a>
<p><a href="http://www.cs.wisc.edu/~ghost/index.html"><code>Ghostscript</code></a>,
<code>gs</code> for short, is a full PostScript interpreter running under many
various systems (Unices, MS-DOS, Mac etc.). It comes with a large set
of output formats allowing many different applications:
</p><dl compact="compact">
<dt> <em>Displaying</em></dt>
<dd><p>It can be used either to view PostScript files (in general thanks to a
graphic interface such as <code>Ghostview</code> or <code>gv</code> ...).
</p>
</dd>
<dt> <em>Converting</em></dt>
<dd><p>To may useful languages/formats: PDF, rewriting in portable PostScript
or Encapsulated PS etc.
</p>
</dd>
<dt> <em>Translating</em></dt>
<dd><p>to a printer dedicated language, e.g., PCL. In particular, thanks to
<code>ghostscript</code>, you may print PostScript files on non PostScript
printers.
</p></dd>
</dl>
</dd>
<dt> <em>Face</em></dt>
<dd><a name="index-Face-1"></a>
<p>A virtual style given to some text. For instance, <em>Keyword</em>,
<em>Comment</em> are faces.
</p>
</dd>
<dt> <em>Headings</em></dt>
<dd><a name="index-Headings"></a>
<p>Everything that goes around the page and is not part of the text body.
Typically the title, footer etc.
</p>
</dd>
<dt> <em>Key</em></dt>
<dd><a name="index-Key"></a>
<p>Many objects used in a2ps@c, such as encodings, have both a key and a name.
The word <em>name</em> is used for a symbol, a label, which is only meant
to be nice to read by a human. For instance ‘<samp>ISO Latin 1</samp>’ is a name.
a2ps</p>
<p>A <em>key</em> is the identifier of a unique object. This is information
that a2psa2ps@c, use the key, not its name. For instance ‘<samp>latin1</samp>’ is the
unique identifier of the ‘<samp>ISO Latin 1</samp>’ encoding.
</p>
</dd>
<dt> <em>Logical page</em></dt>
<dd><a name="index-Logical-page"></a>
<p>Cf. Virtual page.
</p>
</dd>
<dt> <em>lhs</em></dt>
<dt> <em>left hand side</em></dt>
<dd><p>See <em>P-rule</em>.
</p>
</dd>
<dt> <em>Medium</em></dt>
<dd><a name="index-Medium"></a>
<p>Official name (by Adobe) given to the output physical support. In other
words, it means the description of a sheet, e.g., A4, Letter etc.
</p>
</dd>
<dt> <em>Name</em></dt>
<dd><p>See <em>Key</em>.
</p>
</dd>
<dt> <em>Page</em></dt>
<dd><a name="index-Page"></a>
<p>A single side of a sheet.
</p>
</dd>
<dt> <em>Page Description Language</em></dt>
<dd><a name="index-Page-Description-Language"></a>
<p>A language that describes some text (which may be enriched with
pointers, pictures etc.) and its layout. <code>HTML</code>, PostScript,
LaTeX, <code>roff</code> and others are such languages. A file written in
those languages is not made to be read as is by a human, but to be
transformed (or compiled) into a readable form.
</p>
</dd>
<dt> <em>PCL</em></dt>
<dd><a name="index-PCL"></a>
<p>FIXME:
</p>
</dd>
<dt> <em>PFA file</em></dt>
<dd><a name="index-PFA-file"></a>
<p>PostScript Font in ASCII format. This file can be directly down loaded
to provide support for another font.
</p>
</dd>
<dt> <em>PFB file</em></dt>
<dd><a name="index-PFB-file"></a>
<p>PostScript Font in Binary format. In PFA files there are long sequences
of hexadecimal digits. Here these digits are represented by their
value, hence compressing 2 characters in a PFA into 1 in the PFB. This
is the only advantage since a PFB file cannot be directly sent to
printer: it must first be decompressed (hence turned into a PFA file)
before being used.
</p>
</dd>
<dt> <em>PostScript</em></dt>
<dd><a name="index-PostScript-1"></a>
<p><em>PostScript</em> is a page description language designed for
<em>Raster output devices</em>. It is even more powerful than that:
unlike to <code>HTML</code>, or <code>roff</code>, but as TeX and LaTeX, it is
truly a programming language which main purpose is to draw (on sheets).
Most programs are a list of instructions that describes lines, shades of
gray, or text to draw on a page. This is the language that most
printers understand.
</p>
<p>Note that the fact that PostScript is a programming language is
responsible of both its success and its failure. It is a big win for
the PostScript programmer who can easily implement a lot of nice visual
effects. It is a big loss because the page descriptions can have an
arbitrary complexity, hence rendering can be really slow (remember the
first Laser you had, or even <code>Ghostscript</code>. <code>PDF</code> has been
invented by Adobe to remedy these problems).
</p>
<p>PostScript is a trademark of Adobe Systems Incorporated.
</p>
</dd>
<dt> <em>PPD file</em></dt>
<dd><a name="index-PPD-file"></a>
</dd>
<dt> <em>PostScript Printer Description file</em></dt>
<dd><p>These files report everything one needs to know about a printer: the known
fonts, the patches that should be down loaded, the available memory, the
trays, the way to ask it duplex printing, the supported media, etc.
</p>
<p>PostScript has pretended to be a device independent page description
language, and the PPD files are here to prove that
device independence was a failure.
</p>
</dd>
<dt> <em>ProcSet</em></dt>
<dd><a name="index-ProcSet"></a>
<p>Set of (PostScript) procedures.
</p>
</dd>
<dt> <em>Prologue</em></dt>
<dd><a name="index-Prologue-1"></a>
<p>PostScript being a language, a typical PostScript program (i.e. a
typical PostScript file) consists of two parts. The first part is
composed of resources, such as fonts, procsets, etc. and the second part
of calls to these procedures. The first part is called the
<em>prologue</em>, and the second, the <em>script</em>.
</p>
</dd>
<dt> <em>P-rule</em></dt>
<dd><a name="index-P_002drule"></a>
<p>Pretty printing rule. It is composed of a <em>left-hand side</em>,
(<em>lhs</em> for short), and a <em>right-hand side</em>, (<em>rhs</em>). The
lhs describes when the rule is triggered (i.e., the pattern of text to
match), and the rhs specifies the pretty printed output.
See section <a href="#P_002dRules">P-Rules</a>, for more semantical details, and see <a href="#Syntax-for-the-P_002dRules">Syntax for the P-Rules</a>, for implementation.
</p>
</dd>
<dt> <em><code>psutils</code></em></dt>
<dd><a name="index-psutils"></a>
<a name="index-Angus-Duggan"></a>
<p>The <a href="http://www.dcs.ed.ac.uk/home/ajcd/psutils/index.html"><em>psutils</em></a> is a set of tools for PostScript post processing written
by <a href="http://www.dcs.ed.ac.uk/home/ajcd/">Angus Duggan</a>. They let
you resize the frame into which the page is drawn, reorder or select
pages, put several pages onto a single sheet, etc. To allow the
<code>psutils</code> to run correctly, the PostScript files must be DSC
conformant, and the bad news is that many PostScript drivers produce
files which are not. For some common cases (e.g., Micro$oft tools),
Angus Duggan included in the package some tools (named <code>fix...ps</code>)
to fix typical problems. <code>fixps</code> is a collection of recipes on
when to run what <code>fix</code> tool.
</p>
</dd>
<dt> <em>Raster Image Processor</em></dt>
<dt> <em>RIP</em></dt>
<dd><p>The hardware and/or software that translates data from a high-level
language (e.g., PostScript) into dots or pixels in a printer or
image setter.
</p>
</dd>
<dt> <em>Raster Output Device</em></dt>
<dd><a name="index-Raster-Output-Device"></a>
<p>Behind these words is hidden the general class of devices which have
Pixels that can be addressed individually: Laser, Ink or Dot printers,
but also regular screens etc. It is typically opposed to the class of
devices which <em>plot</em>, i.e., have a pen that they move on the paper.
</p>
</dd>
<dt> <em>rhs</em></dt>
<dt> <em>right hand side</em></dt>
<dd><p>See <em>P-rule</em>.
</p>
</dd>
<dt> <em>RIP</em></dt>
<dd><p>See <em>Raster Image Processor</em>.
</p>
</dd>
<dt> <em>Script</em></dt>
<dd><a name="index-Script"></a>
<p>See <em>Prologue</em>.
</p>
</dd>
<dt> <em>Sheet</em></dt>
<dd><a name="index-Sheet"></a>
<p>The physical support of the printing: it may support one or two pages,
depending on your printing options.
</p>
</dd>
<dt> <em>Style sheet</em></dt>
<dd><a name="index-Style-sheet-1"></a>
<p>Set of rules used by a2psfile. In a2ps@c, each programming language which is supported
is defined via one style-sheet.
</p>
</dd>
<dt> <em>Tumble</em></dt>
<dd><a name="index-Tumble"></a>
<p>See <em>Duplex</em>.
</p>
</dd>
<dt> <em>Virtual page</em></dt>
<dd><a name="index-Virtual-page"></a>
<p>Area on a physical page in which a2psThere may be several virtual pages on a physical page. (“virtual page”
is the name recommended by Adobe).
</p>
</dd>
</dl>
<hr size="6">
<a name="Genesis"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Glossary" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#History" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Glossary" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Copying" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Genesis-1"></a>
<h1 class="appendix">B. Genesis</h1>
<p>Here are some words on a2ps</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#History">B.1 History</a></td><td> </td><td align="left" valign="top"> Where does it come from
</td></tr>
<tr><td align="left" valign="top"><a href="#Thanks">B.2 Thanks</a></td><td> </td><td align="left" valign="top"> People who really helped
</td></tr>
<tr><td align="left" valign="top"><a href="#Translators">B.3 Translators</a></td><td> </td><td align="left" valign="top"> People who brought support of your tongue
</td></tr>
</table>
<hr size="6">
<a name="History"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Genesis" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Thanks" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Genesis" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Genesis" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Copying" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="History-1"></a>
<h2 class="section">B.1 History</h2>
<p>The initial version was a shell program written by <a href="mailto:evan@csli">Evan Kirshenbaum</a>. It was very slow and contained many bugs.
</p>
<p>A new version was written in <code>C</code> by <a href="mailto:Miguel.Santana@st.com">Miguel Santana</a> to improve execution speed and portability. Many new
features and improvements have been added since this first version.
Many contributions (changes, fixes, ideas) were done by a2psorder to improve it.
</p>
<p>From the latest version from Miguel Santana (4.3), Emmanuel Briot
implemented bold faces for keywords in <code>Ada</code>, <code>C</code> and
<code>C++</code>.
</p>
<p>From that version, <a href="mailto:akim@freefriends.org">Akim Demaille</a>
generalized the pretty-printing capabilities, implemented more languages
support, and other features.
</p>
<hr size="6">
<a name="Thanks"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#History" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Translators" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Genesis" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Genesis" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Copying" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Thanks-1"></a>
<h2 class="section">B.2 Thanks</h2>
<p>Patrick Andries, from <a href="http://www.alis.com/">Alis Technologies inc.</a>
and Roman Czyborra (see his <a href="http://czyborra.com/">home page</a>),
provided us with important information on encodings. We strongly
recommend that you go and read these pages: there is a lot to learn.
</p>
<p>Juliusz Chroboczek worked a lot on the integration of the products of
Ogonkify (such as Latin 2 etc. fonts) in a2ps@c. Without his help, and
the time is devoted to both a2pswest-European people would still be unable to print easily texts written
in their mother tongue.
</p>
<p>Denis Girou brought a constant and valuable support through out the
genesis of pretty-printing a2ps@c. His comments on both the program
and the documentation are the origin of many pleasant features (such as
‘<samp>--prologue</samp>’).
</p>
<p>Alexander Mai provided us with invaluable help in the development. He
spotted several times subtle bugs in a2pskeeps a vigilant eye on portability issues, he checks and improves the
style sheets, and he maintains a port of a2ps</p>
<p>Graham Jenkins, with an extraordinary regularity, tortures a2psweird systems that nobody ever heard of ‘<samp>:)</samp>’. Graham is usually
the ultimate test: if he says I can release a2ps@c, I rest reassured
that, yes, this time it <strong>will</strong> compile! If a2pson your system, you should thank Graham too!
</p>
<p>Of course this list is not up to date, and never will. We would like to
thank everybody that helped us, talked to us, and even criticized us
with the intention to help us to improve a2ps@c. Of course it doesn’t
sound right, yes it sounds a little childish, but we can tell you: we
would <strong>never</strong> have the strength and the faith of building and
maintaining a2ps</p>
<p>While a2psis an adventure we live with other humans, and, boy, that’s a darn good
pleasure!
</p>
<hr size="6">
<a name="Translators"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Thanks" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Copying" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Genesis" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Genesis" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Copying" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Translators-1"></a>
<h2 class="section">B.3 Translators</h2>
<p>Some people worked on the translation of a2ps@c:
</p><ul class="toc">
<li>-
Daniele Ghiotti (Italian)
</li><li>-
Tomek Burdziak (Polish)
</li><li>-
<a href="mailto:mvaro@dlsi.ua.es">Miguel A. Varo</a> (Maintains Spanish and Catalan)
</li><li>-
<a href="mailto:mw@miwie.in-berlin.de">Michael Wiedmann</a> (Maintains German)
</li><li>-
<a href="mailto:ck@held.mind.de">Christian Kirsch</a> (German)
</li><li>-
<a href="mailto:bamse@gmx.de">Erwin Dieterich</a> (German)
</li><li>-
<a href="mailto:jec@dcs.ed.ac.uk">Juliusz Chroboczek</a> (Polish) He is also the author of <code>Ogonkify</code> (see <a href="ogonkify.html#Top">(ogonkify)Top</a> section ‘Overview’ in <cite>Ogonkify manual</cite>).
</li><li>-
<a href="mailto:Marcel.van.der.Laan@home.ict.nl">Marcel van der Laan</a> (Dutch)
</li><li>-
<a href="mailto:lorenzo@argon.roma2.infn.it">Lorenzo M. Catucci</a> (Maintains Italian)
</li><li>-
<a href="mailto:junker@jazz.snu.ac.kr">Choi Jun Ho</a> (Korean)
</li><li>-
<a href="mailto:uyar@cs.itu.edu.tr">Turgut Uyar</a> (Turkish)
</li><li>-
<a href="mailto:pavlovsk@ff.cuni.cz">Jiri Pavlovsky</a> (Maintains Czech)
</li><li>-
<a href="mailto:pnidv96@student.hv.se">Peter Nilsson</a> (Maintains Swedish)
</li><li>-
<a href="mailto:pmmm@camoes.rnl.ist.utl.pt">Pedro Miguel Marques Morais</a> (Maintains Portugese)
</li><li>-
<a href="mailto:voldemarus@geocities.com">Vladimir Vodolazkiy</a> (Russian) has a <a href="http://come.to/vodolaz">home page</a>.
</li><li>-
<a href="mailto:pjsm@students.fct.unl.pt">Paulo Matos</a> (Portugese)
</li><li>-
<a href="mailto:jonr@sdata.no">Jon Ross</a> (Maintains Norwegian)
</li><li>-
<a href="mailto:IgorF@ix.netcom.com">Igor Furlan</a> (Maintains Slovenian)
</li><li>-
<a href="mailto:qrczak@knm.org.pl">Marcin ’Qrczak’ Kowalczyk</a> (Polish)
</li><li>-
<a href="mailto:smoke@casema.net">Tijs van Bakel</a> (Maintains Dutch)
</li><li>-
<a href="mailto:dima@Chg.RU">Dmitry S. Sivachenko</a> (Maintains Russian)
</li></ul>
<hr size="6">
<a name="Copying"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Translators" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Genesis" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Copying-1"></a>
<h1 class="appendix">C. Copying</h1>
<a name="index-Copying"></a>
<p> The subroutines and source code in the a2ps"free"; this means that everyone is free to use them and free to
redistribute them on a free basis. The a2ps@c-related programs are
not in the public domain; they are copyrighted and there are
restrictions on their distribution, but these restrictions are designed
to permit everything that a good cooperating citizen would want to do.
What is not allowed is to try to prevent others from further sharing any
version of these programs that they might get from you.
</p>
<p> Specifically, we want to make sure that you have the right to give
away copies of the programs that relate to a2ps@c, that you receive
source code or else can get it if you want it, that you can change these
programs or use pieces of them in new free programs, and that you know
you can do these things.
</p>
<p> To make sure that everyone has such rights, we have to forbid you to
deprive anyone else of these rights. For example, if you distribute
copies of the a2ps@c-related code, you must give the recipients all
the rights that you have. You must make sure that they, too, receive or
can get the source code. And you must tell them their rights.
</p>
<p> Also, for our own protection, we must make certain that everyone
finds out that there is no warranty for the programs that relate to
a2ps@c. If these programs are modified by someone else and passed
on, we want their recipients to know that what they have is not what we
distributed, so that any problems introduced by others will not reflect
on our reputation.
</p>
<p> The precise conditions of the licenses for the programs currently
being distributed that relate to a2psPublic Licenses that accompany them.
</p>
<hr size="6">
<a name="Concept-Index"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Copying" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[ > ]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Copying" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Introduction" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[ >> ]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Concept-Index-1"></a>
<h1 class="unnumbered">Concept Index</h1>
<table><tr><th valign="top">Jump to: </th><td><a href="#Concept-Index-1_cp_symbol-1" class="summary-letter"><b>%</b></a>
<a href="#Concept-Index-1_cp_symbol-2" class="summary-letter"><b>.</b></a>
<a href="#Concept-Index-1_cp_symbol-3" class="summary-letter"><b>:</b></a>
<br>
<a href="#Concept-Index-1_cp_letter-A" class="summary-letter"><b>A</b></a>
<a href="#Concept-Index-1_cp_letter-B" class="summary-letter"><b>B</b></a>
<a href="#Concept-Index-1_cp_letter-C" class="summary-letter"><b>C</b></a>
<a href="#Concept-Index-1_cp_letter-D" class="summary-letter"><b>D</b></a>
<a href="#Concept-Index-1_cp_letter-E" class="summary-letter"><b>E</b></a>
<a href="#Concept-Index-1_cp_letter-F" class="summary-letter"><b>F</b></a>
<a href="#Concept-Index-1_cp_letter-G" class="summary-letter"><b>G</b></a>
<a href="#Concept-Index-1_cp_letter-H" class="summary-letter"><b>H</b></a>
<a href="#Concept-Index-1_cp_letter-I" class="summary-letter"><b>I</b></a>
<a href="#Concept-Index-1_cp_letter-K" class="summary-letter"><b>K</b></a>
<a href="#Concept-Index-1_cp_letter-L" class="summary-letter"><b>L</b></a>
<a href="#Concept-Index-1_cp_letter-M" class="summary-letter"><b>M</b></a>
<a href="#Concept-Index-1_cp_letter-N" class="summary-letter"><b>N</b></a>
<a href="#Concept-Index-1_cp_letter-O" class="summary-letter"><b>O</b></a>
<a href="#Concept-Index-1_cp_letter-P" class="summary-letter"><b>P</b></a>
<a href="#Concept-Index-1_cp_letter-R" class="summary-letter"><b>R</b></a>
<a href="#Concept-Index-1_cp_letter-S" class="summary-letter"><b>S</b></a>
<a href="#Concept-Index-1_cp_letter-T" class="summary-letter"><b>T</b></a>
<a href="#Concept-Index-1_cp_letter-U" class="summary-letter"><b>U</b></a>
<a href="#Concept-Index-1_cp_letter-V" class="summary-letter"><b>V</b></a>
<a href="#Concept-Index-1_cp_letter-W" class="summary-letter"><b>W</b></a>
</td></tr></table>
<table border="0" class="index-cp">
<tr><td></td><th align="left">Index Entry</th><th align="left"> Section</th></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_symbol-1">%</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_0025_0021">‘<samp>%!</samp>’</a></td><td valign="top"><a href="#Your-PostScript-magic-number">4.7 Your PostScript magic number</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_symbol-2">.</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002ea2ps">‘<tt>.a2ps</tt>’</a></td><td valign="top"><a href="#Configuration-Files">4. Configuration Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002eafm">.afm</a></td><td valign="top"><a href="#Fonts-Description-Files">5.3.2 Fonts Description Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002eedf">.edf</a></td><td valign="top"><a href="#Encoding-Description-Files">6.2.2 Encoding Description Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002emap">.map</a></td><td valign="top"><a href="#Map-Files">5.2 Map Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002epfa">.pfa</a></td><td valign="top"><a href="#Fonts-Description-Files">5.3.2 Fonts Description Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-_002epfb">.pfb</a></td><td valign="top"><a href="#Fonts-Description-Files">5.3.2 Fonts Description Files</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_symbol-3">:</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-_003a">‘<samp>:</samp>’</a></td><td valign="top"><a href="#Your-Shortcuts">4.6 Your Shortcuts</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-A">A</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-a2ps_002dsite_002ecfg">‘<tt>a2ps-site.cfg</tt>’</a></td><td valign="top"><a href="#Configuration-Files">4. Configuration Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-a2ps_002ecfg">‘<tt>a2ps.cfg</tt>’</a></td><td valign="top"><a href="#Configuration-Files">4. Configuration Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-a2psrc">‘<tt>a2psrc</tt>’</a></td><td valign="top"><a href="#Configuration-Files">4. Configuration Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-A2PS_005fCONFIG">‘<samp>A2PS_CONFIG</samp>’</a></td><td valign="top"><a href="#Configuration-Files">4. Configuration Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-A2PS_005fVERBOSITY"><code>A2PS_VERBOSITY</code></a></td><td valign="top"><a href="#Global-Options">3.1.2 Global Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Adobe">Adobe</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-AFM">AFM</a></td><td valign="top"><a href="#Fonts-Description-Files">5.3.2 Fonts Description Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-AFM-1">AFM</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Alphabets">Alphabets</a></td><td valign="top"><a href="#Alphabets">7.5.3 Alphabets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Angus-Duggan">Angus Duggan</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-AppendLibraryPath_003a-1">‘<samp>AppendLibraryPath:</samp>’</a></td><td valign="top"><a href="#Your-Library-Path">4.2 Your Library Path</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-B">B</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-banner">banner</a></td><td valign="top"><a href="#Pass-Options-to-lpr">10.2.5 How Can I Pass Options to ‘<samp>lpr</samp>’</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Bug">Bug</a></td><td valign="top"><a href="#Reporting-Bugs">1.2 Reporting Bugs</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-C">C</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-C_002dchar"><code>C-char</code></a></td><td valign="top"><a href="#Declaring-sequences">7.6.7 Declaring the sequences</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-C_002dstring"><code>C-string</code></a></td><td valign="top"><a href="#Declaring-sequences">7.6.7 Declaring the sequences</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Charset">Charset</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Code-Set">Code Set</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Command-line-options">Command line options</a></td><td valign="top"><a href="#Options">3.1 Command line options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Configuration-Files">Configuration Files</a></td><td valign="top"><a href="#Configuration-Files">4. Configuration Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Copying">Copying</a></td><td valign="top"><a href="#Copying">C. Copying</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-D">D</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-DefaultPrinter_003a-1">‘<samp>DefaultPrinter:</samp>’</a></td><td valign="top"><a href="#Your-Printers">4.5 Your Printers</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Delegate">Delegate</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Delegation_003a-1">‘<samp>Delegation:</samp>’</a></td><td valign="top"><a href="#Defining-a-Delegation">4.10.1 Defining a Delegation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Delegations">Delegations</a></td><td valign="top"><a href="#Your-Delegations">4.10 Your Delegations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-display"><code>display</code></a></td><td valign="top"><a href="#Special-Printers">2.2.2 Special Printers</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Document-Structuring-Conventions">Document Structuring Conventions</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DSC">DSC</a></td><td valign="top"><a href="#Good-and-Bad-PostScript">8.1 Foreword: Good and Bad PostScript</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DSC-1">DSC</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Duplex">Duplex</a></td><td valign="top"><a href="#PostScript-Options">3.1.9 PostScript Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Duplex-1">Duplex</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DuplexNoTumble">DuplexNoTumble</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-DuplexTumble">DuplexTumble</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-E">E</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-EDF">EDF</a></td><td valign="top"><a href="#Encoding-Description-Files">6.2.2 Encoding Description Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-elm"><code>elm</code></a></td><td valign="top"><a href="#Interfacing-With-a-Mailer">2.5.1 Interfacing With a Mailer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Encoding">Encoding</a></td><td valign="top"><a href="#Input-Options">3.1.6 Input Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Encoding-1">Encoding</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Escape">Escape</a></td><td valign="top"><a href="#Your-Variables">4.9 Your Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Escapes">Escapes</a></td><td valign="top"><a href="#Escapes">3.2 Escapes</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-F">F</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Face">Face</a></td><td valign="top"><a href="#Faces">7.4 Faces</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Face-1">Face</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-file"><code>file</code></a></td><td valign="top"><a href="#Special-Printers">2.2.2 Special Printers</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-First-Page">First Page</a></td><td valign="top"><a href="#Introduction">1. Introduction</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-G">G</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Ghostscript"><code>Ghostscript</code></a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-gs"><code>gs</code></a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-H">H</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Headers">Headers</a></td><td valign="top"><a href="#Headings-Options">3.1.5 Headings Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Headings">Headings</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-I">I</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Include_003a-1">‘<samp>Include:</samp>’</a></td><td valign="top"><a href="#Including-Configuration-Files">4.1 Including Configuration Files</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-K">K</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Key">Key</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-key">key</a></td><td valign="top"><a href="#Name-and-key">7.5.1 Name and key</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Keyword">Keyword</a></td><td valign="top"><a href="#P_002dRules">7.5.5 P-Rules</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-L">L</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-lhs">lhs</a></td><td valign="top"><a href="#P_002dRules">7.5.5 P-Rules</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-libpaper"><code>libpaper</code></a></td><td valign="top"><a href="#Sheet-Options">3.1.3 Sheet Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Library-files">Library files</a></td><td valign="top"><a href="#Library-Files">5. Library Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-LibraryPath_003a-1">‘<samp>LibraryPath:</samp>’</a></td><td valign="top"><a href="#Your-Library-Path">4.2 Your Library Path</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Logical-page">Logical page</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-M">M</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-make_005ffonts_005fmap_002esh"><code>make_fonts_map.sh</code></a></td><td valign="top"><a href="#Adding-More-Font-Support">5.3.3 Adding More Font Support</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Map-files">Map files</a></td><td valign="top"><a href="#Map-Files">5.2 Map Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Markers">Markers</a></td><td valign="top"><a href="#Sequences">7.5.6 Sequences</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Medium">Medium</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Medium_003a-1">‘<samp>Medium:</samp>’</a></td><td valign="top"><a href="#Your-Media">4.4 Your Media</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-N">N</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Non-PostScript-printers">Non PostScript printers</a></td><td valign="top"><a href="#Your-Printers">4.5 Your Printers</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-O">O</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Operator">Operator</a></td><td valign="top"><a href="#P_002dRules">7.5.5 P-Rules</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Optimize-for-Portability">Optimize for Portability</a></td><td valign="top"><a href="#Good-and-Bad-PostScript">8.1 Foreword: Good and Bad PostScript</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Optimize-for-Speed">Optimize for Speed</a></td><td valign="top"><a href="#Good-and-Bad-PostScript">8.1 Foreword: Good and Bad PostScript</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Optional-entries">Optional entries</a></td><td valign="top"><a href="#Optional-entries">7.5.7 Optional entries</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Options">Options</a></td><td valign="top"><a href="#Options">3.1 Command line options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Options_003a-1">‘<samp>Options:</samp>’</a></td><td valign="top"><a href="#Your-Default-Options">4.3 Your Default Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-OutputFirstLine_003a">‘<samp>OutputFirstLine:</samp>’</a></td><td valign="top"><a href="#Your-PostScript-magic-number">4.7 Your PostScript magic number</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-OutputFirstLine_003a-2">‘<samp>OutputFirstLine:</samp>’</a></td><td valign="top"><a href="#Your-PostScript-magic-number">4.7 Your PostScript magic number</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-P">P</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-P_002dRule">P-Rule</a></td><td valign="top"><a href="#P_002dRules">7.5.5 P-Rules</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-P_002drule">P-rule</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Page">Page</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Page-Description-Language">Page Description Language</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Page-device">Page device</a></td><td valign="top"><a href="#PostScript-Options">3.1.9 PostScript Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Page-prefeed">Page prefeed</a></td><td valign="top"><a href="#PostScript-Options">3.1.9 PostScript Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Page-Range">Page Range</a></td><td valign="top"><a href="#Input-Options">3.1.6 Input Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PageLabelFormat_003a-1">‘<samp>PageLabelFormat:</samp>’</a></td><td valign="top"><a href="#Your-Page-Labels">4.8 Your Page Labels</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-paperconf"><code>paperconf</code></a></td><td valign="top"><a href="#Sheet-Options">3.1.3 Sheet Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PCL">PCL</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PFA-file">PFA file</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PFB-file">PFB file</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-pine"><code>pine</code></a></td><td valign="top"><a href="#Interfacing-With-a-Mailer">2.5.1 Interfacing With a Mailer</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PostScript-1">PostScript</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PostScript-Quality">PostScript Quality</a></td><td valign="top"><a href="#Good-and-Bad-PostScript">8.1 Foreword: Good and Bad PostScript</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PPD-file">PPD file</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Predefined-Variables">Predefined Variables</a></td><td valign="top"><a href="#Predefined-Variables">4.9.2 Predefined Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PrependLibraryPath_003a-1">‘<samp>PrependLibraryPath:</samp>’</a></td><td valign="top"><a href="#Your-Library-Path">4.2 Your Library Path</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-PreScript-1"><code>PreScript</code></a></td><td valign="top"><a href="#PreScript">7.3.2 PreScript</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Pretty-printing">Pretty printing</a></td><td valign="top"><a href="#Pretty-Printing">7. Pretty Printing</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Printer_003a-3">‘<samp>Printer:</samp>’</a></td><td valign="top"><a href="#Your-Printers">4.5 Your Printers</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ProcSet">ProcSet</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Prologue">Prologue</a></td><td valign="top"><a href="#Input-Options">3.1.6 Input Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Prologue-1">Prologue</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-psutils"><code>psutils</code></a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-R">R</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Raster-Output-Device">Raster Output Device</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Regular-expression">Regular expression</a></td><td valign="top"><a href="#Syntax-for-the-P_002dRules">7.6.5 Syntax for the P-Rules</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-rhs">rhs</a></td><td valign="top"><a href="#P_002dRules">7.5.5 P-Rules</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Rule">Rule</a></td><td valign="top"><a href="#P_002dRules">7.5.5 P-Rules</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-S">S</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Script">Script</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Separator">Separator</a></td><td valign="top"><a href="#Alphabets">7.5.3 Alphabets</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Sequences">Sequences</a></td><td valign="top"><a href="#Sequences">7.5.6 Sequences</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-setpagedevice"><code>setpagedevice</code></a></td><td valign="top"><a href="#PostScript-Options">3.1.9 PostScript Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Sheet">Sheet</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sheets_002emap">‘<tt>sheets.map</tt>’</a></td><td valign="top"><a href="#Style-Sheet-Files">5.4 Style Sheet Files</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-sheets_002emap-1">‘<tt>sheets.map</tt>’</a></td><td valign="top"><a href="#Name-and-key">7.5.1 Name and key</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-statusdict"><code>statusdict</code></a></td><td valign="top"><a href="#PostScript-Options">3.1.9 PostScript Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Style-sheet">Style sheet</a></td><td valign="top"><a href="#Style-sheets-semantics">7.5 Style Sheets Semantics</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Style-sheet-1">Style sheet</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Symbol-conversion">Symbol conversion</a></td><td valign="top"><a href="#Pretty-Printing">7. Pretty Printing</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-T">T</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-TemporaryDirectory_003a">‘<samp>TemporaryDirectory:</samp>’</a></td><td valign="top"><a href="#Your-Internal-Details">4.11 Your Internal Details</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Tumble">Tumble</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-U">U</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Under-lay">Under lay</a></td><td valign="top"><a href="#Headings-Options">3.1.5 Headings Options</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UnknownPrinter_003a-1">‘<samp>UnknownPrinter:</samp>’</a></td><td valign="top"><a href="#Your-Printers">4.5 Your Printers</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-UserOption_003a-1">‘<samp>UserOption:</samp>’</a></td><td valign="top"><a href="#Your-Shortcuts">4.6 Your Shortcuts</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-V">V</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Variable">Variable</a></td><td valign="top"><a href="#Your-Variables">4.9 Your Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Variable_003a-1">‘<samp>Variable:</samp>’</a></td><td valign="top"><a href="#Defining-Variables">4.9.1 Defining Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Variables_002c-predefined">Variables, predefined</a></td><td valign="top"><a href="#Predefined-Variables">4.9.2 Predefined Variables</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-Virtual-page">Virtual page</a></td><td valign="top"><a href="#Glossary">A. Glossary</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-void"><code>void</code></a></td><td valign="top"><a href="#Special-Printers">2.2.2 Special Printers</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
<tr><th><a name="Concept-Index-1_cp_letter-W">W</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-Water-mark">Water mark</a></td><td valign="top"><a href="#Headings-Options">3.1.5 Headings Options</a></td></tr>
<tr><td colspan="3"> <hr></td></tr>
</table>
<table><tr><th valign="top">Jump to: </th><td><a href="#Concept-Index-1_cp_symbol-1" class="summary-letter"><b>%</b></a>
<a href="#Concept-Index-1_cp_symbol-2" class="summary-letter"><b>.</b></a>
<a href="#Concept-Index-1_cp_symbol-3" class="summary-letter"><b>:</b></a>
<br>
<a href="#Concept-Index-1_cp_letter-A" class="summary-letter"><b>A</b></a>
<a href="#Concept-Index-1_cp_letter-B" class="summary-letter"><b>B</b></a>
<a href="#Concept-Index-1_cp_letter-C" class="summary-letter"><b>C</b></a>
<a href="#Concept-Index-1_cp_letter-D" class="summary-letter"><b>D</b></a>
<a href="#Concept-Index-1_cp_letter-E" class="summary-letter"><b>E</b></a>
<a href="#Concept-Index-1_cp_letter-F" class="summary-letter"><b>F</b></a>
<a href="#Concept-Index-1_cp_letter-G" class="summary-letter"><b>G</b></a>
<a href="#Concept-Index-1_cp_letter-H" class="summary-letter"><b>H</b></a>
<a href="#Concept-Index-1_cp_letter-I" class="summary-letter"><b>I</b></a>
<a href="#Concept-Index-1_cp_letter-K" class="summary-letter"><b>K</b></a>
<a href="#Concept-Index-1_cp_letter-L" class="summary-letter"><b>L</b></a>
<a href="#Concept-Index-1_cp_letter-M" class="summary-letter"><b>M</b></a>
<a href="#Concept-Index-1_cp_letter-N" class="summary-letter"><b>N</b></a>
<a href="#Concept-Index-1_cp_letter-O" class="summary-letter"><b>O</b></a>
<a href="#Concept-Index-1_cp_letter-P" class="summary-letter"><b>P</b></a>
<a href="#Concept-Index-1_cp_letter-R" class="summary-letter"><b>R</b></a>
<a href="#Concept-Index-1_cp_letter-S" class="summary-letter"><b>S</b></a>
<a href="#Concept-Index-1_cp_letter-T" class="summary-letter"><b>T</b></a>
<a href="#Concept-Index-1_cp_letter-U" class="summary-letter"><b>U</b></a>
<a href="#Concept-Index-1_cp_letter-V" class="summary-letter"><b>V</b></a>
<a href="#Concept-Index-1_cp_letter-W" class="summary-letter"><b>W</b></a>
</td></tr></table>
<hr size="6">
<a name="SEC_Foot"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1>Footnotes</h1>
<h3><a name="FOOT1" href="#DOCF1">(1)</a></h3>
<p>A
classical Unix trick to make the difference between the option
‘<samp>-2</samp>’, and the file ‘<tt>-2</tt>’ is to type ‘<tt>./-2</tt>’.
</p><h3><a name="FOOT2" href="#DOCF2">(2)</a></h3>
<p>Current <code>a2ps</code>
only handles PostScript output, i.e. <var>out</var>=‘<samp>ps</samp>’
</p><h3><a name="FOOT3" href="#DOCF3">(3)</a></h3>
<p>Because hiding its use into <code>a2ps</code> just makes
it even more difficult to the users to know why it failed. Let them use
it by hand.
</p><h3><a name="FOOT4" href="#DOCF4">(4)</a></h3>
<p>Many people seem to ignore
that you can insert <strong>several</strong> sheets in the manual feed tray.
Try at least once, it will save you from hours spent feeding page per
page by hand!
</p><h3><a name="FOOT5" href="#DOCF5">(5)</a></h3>
<p>Year 2000.
</p><hr size="1">
<a name="SEC_Contents"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1>Table of Contents</h1>
<div class="contents">
<ul class="toc">
<li><a name="toc-Introduction-1" href="#Introduction">1. Introduction</a>
<ul class="toc">
<li><a name="toc-Description-1" href="#Description">1.1 Description</a></li>
<li><a name="toc-Reporting-Bugs-1" href="#Reporting-Bugs">1.2 Reporting Bugs</a></li>
<li><a name="toc-a2ps-1" href="#a2ps-Mailing-List">1.3 a2ps</a></li>
<li><a name="toc-Helping-the-Development-1" href="#Helping-the-Development">1.4 Helping the Development</a></li>
</ul></li>
<li><a name="toc-User_0027s-Guide" href="#User-Guide">2. User’s Guide</a>
<ul class="toc">
<li><a name="toc-Purpose-1" href="#Purpose">2.1 Purpose</a></li>
<li><a name="toc-How-to-print-1" href="#How-to-print">2.2 How to print</a>
<ul class="toc">
<li><a name="toc-Basics-for-Printing-1" href="#Basics-for-Printing">2.2.1 Basics for Printing</a></li>
<li><a name="toc-Special-Printers-1" href="#Special-Printers">2.2.2 Special Printers</a></li>
<li><a name="toc-Using-Delegations-1" href="#Using-Delegations">2.2.3 Using Delegations</a></li>
<li><a name="toc-Printing-Duplex-1" href="#Printing-Duplex">2.2.4 Printing Duplex</a></li>
<li><a name="toc-Checking-the-Defaults-1" href="#Checking-the-Defaults">2.2.5 Checking the Defaults</a></li>
</ul></li>
<li><a name="toc-Important-parameters-1" href="#Important-parameters">2.3 Important parameters</a></li>
<li><a name="toc-Localizing-1" href="#Localizing">2.4 Localizing</a></li>
<li><a name="toc-Interfacing-with-Other-Programs" href="#Interfacing">2.5 Interfacing with Other Programs</a>
<ul class="toc">
<li><a name="toc-Interfacing-With-a-Mailer-1" href="#Interfacing-With-a-Mailer">2.5.1 Interfacing With a Mailer</a></li>
<li><a name="toc-Netscape-1" href="#Netscape">2.5.2 Netscape</a></li>
</ul>
</li>
</ul></li>
<li><a name="toc-Invoking-a2ps-1" href="#Invoking-a2ps">3. Invoking a2ps</a>
<ul class="toc">
<li><a name="toc-Command-line-options" href="#Options">3.1 Command line options</a>
<ul class="toc">
<li><a name="toc-Tasks-Options-1" href="#Tasks-Options">3.1.1 Tasks Options</a></li>
<li><a name="toc-Global-Options-1" href="#Global-Options">3.1.2 Global Options</a></li>
<li><a name="toc-Sheet-Options-1" href="#Sheet-Options">3.1.3 Sheet Options</a></li>
<li><a name="toc-Page-Options-1" href="#Page-Options">3.1.4 Page Options</a></li>
<li><a name="toc-Headings-Options-1" href="#Headings-Options">3.1.5 Headings Options</a></li>
<li><a name="toc-Input-Options-1" href="#Input-Options">3.1.6 Input Options</a></li>
<li><a name="toc-Pretty-Printing-Options" href="#Pretty-Print-Options">3.1.7 Pretty Printing Options</a></li>
<li><a name="toc-Output-Options-1" href="#Output-Options">3.1.8 Output Options</a></li>
<li><a name="toc-PostScript-Options-1" href="#PostScript-Options">3.1.9 PostScript Options</a></li>
</ul></li>
<li><a name="toc-Escapes-1" href="#Escapes">3.2 Escapes</a>
<ul class="toc">
<li><a name="toc-Use-of-Escapes-1" href="#Use-of-Escapes">3.2.1 Use of Escapes</a></li>
<li><a name="toc-General-Structure-of-the-Escapes" href="#Structure-of-the-Escapes">3.2.2 General Structure of the Escapes</a></li>
<li><a name="toc-Available-Escapes-1" href="#Available-Escapes">3.2.3 Available Escapes</a></li>
</ul>
</li>
</ul></li>
<li><a name="toc-Configuration-Files-1" href="#Configuration-Files">4. Configuration Files</a>
<ul class="toc">
<li><a name="toc-Including-Configuration-Files-1" href="#Including-Configuration-Files">4.1 Including Configuration Files</a></li>
<li><a name="toc-Your-Library-Path-1" href="#Your-Library-Path">4.2 Your Library Path</a></li>
<li><a name="toc-Your-Default-Options-1" href="#Your-Default-Options">4.3 Your Default Options</a></li>
<li><a name="toc-Your-Media-1" href="#Your-Media">4.4 Your Media</a></li>
<li><a name="toc-Your-Printers-1" href="#Your-Printers">4.5 Your Printers</a></li>
<li><a name="toc-Your-Shortcuts-1" href="#Your-Shortcuts">4.6 Your Shortcuts</a></li>
<li><a name="toc-Your-PostScript-magic-number-1" href="#Your-PostScript-magic-number">4.7 Your PostScript magic number</a></li>
<li><a name="toc-Your-Page-Labels-1" href="#Your-Page-Labels">4.8 Your Page Labels</a></li>
<li><a name="toc-Your-Variables-1" href="#Your-Variables">4.9 Your Variables</a>
<ul class="toc">
<li><a name="toc-Defining-Variables-1" href="#Defining-Variables">4.9.1 Defining Variables</a></li>
<li><a name="toc-Predefined-Variables-1" href="#Predefined-Variables">4.9.2 Predefined Variables</a></li>
</ul></li>
<li><a name="toc-Your-Delegations-1" href="#Your-Delegations">4.10 Your Delegations</a>
<ul class="toc">
<li><a name="toc-Defining-a-Delegation-1" href="#Defining-a-Delegation">4.10.1 Defining a Delegation</a></li>
<li><a name="toc-Guide-Line-for-Delegations-1" href="#Guide-Line-for-Delegations">4.10.2 Guide Line for Delegations</a></li>
<li><a name="toc-Predefined-Delegations-1" href="#Predefined-Delegations">4.10.3 Predefined Delegations</a></li>
</ul></li>
<li><a name="toc-Your-Internal-Details-1" href="#Your-Internal-Details">4.11 Your Internal Details</a></li>
</ul></li>
<li><a name="toc-Library-Files-1" href="#Library-Files">5. Library Files</a>
<ul class="toc">
<li><a name="toc-Documentation-Format-1" href="#Documentation-Format">5.1 Documentation Format</a></li>
<li><a name="toc-Map-Files-1" href="#Map-Files">5.2 Map Files</a></li>
<li><a name="toc-Font-Files-1" href="#Font-Files">5.3 Font Files</a>
<ul class="toc">
<li><a name="toc-Fonts-Map-File-1" href="#Fonts-Map-File">5.3.1 Fonts Map File</a></li>
<li><a name="toc-Fonts-Description-Files-1" href="#Fonts-Description-Files">5.3.2 Fonts Description Files</a></li>
<li><a name="toc-Adding-More-Font-Support-1" href="#Adding-More-Font-Support">5.3.3 Adding More Font Support</a></li>
</ul></li>
<li><a name="toc-Style-Sheet-Files-1" href="#Style-Sheet-Files">5.4 Style Sheet Files</a></li>
</ul></li>
<li><a name="toc-Encodings-1" href="#Encodings">6. Encodings</a>
<ul class="toc">
<li><a name="toc-What-is-an-Encoding-1" href="#What-is-an-Encoding">6.1 What is an Encoding</a></li>
<li><a name="toc-Encoding-Files-1" href="#Encoding-Files">6.2 Encoding Files</a>
<ul class="toc">
<li><a name="toc-Encoding-Map-File-1" href="#Encoding-Map-File">6.2.1 Encoding Map File</a></li>
<li><a name="toc-Encoding-Description-Files-1" href="#Encoding-Description-Files">6.2.2 Encoding Description Files</a></li>
<li><a name="toc-Some-Encodings-1" href="#Some-Encodings">6.2.3 Some Encodings</a></li>
</ul>
</li>
</ul></li>
<li><a name="toc-Pretty-Printing-1" href="#Pretty-Printing">7. Pretty Printing</a>
<ul class="toc">
<li><a name="toc-Syntactic-limits-1" href="#Syntactic-limits">7.1 Syntactic limits</a></li>
<li><a name="toc-Known-Style-Sheets-1" href="#Known-Style-Sheets">7.2 Known Style Sheets</a></li>
<li><a name="toc-Type-Setting-Style-Sheets-1" href="#Type-Setting-Style-Sheets">7.3 Type Setting Style Sheets</a>
<ul class="toc">
<li><a name="toc-Symbol-1" href="#Symbol">7.3.1 Symbol</a></li>
<li><a name="toc-PreScript-1" href="#PreScript">7.3.2 PreScript</a>
<ul class="toc">
<li><a name="toc-Syntax-1" href="#Syntax">7.3.2.1 Syntax</a></li>
<li><a name="toc-PreScript-Commands-1" href="#PreScript-Commands">7.3.2.2 PreScript Commands</a></li>
<li><a name="toc-Examples" href="#PreScript-examples">7.3.2.3 Examples</a></li>
</ul></li>
<li><a name="toc-PreTeX-1" href="#PreTeX">7.3.3 PreTeX</a>
<ul class="toc">
<li><a name="toc-Special-characters-1" href="#Special-characters">7.3.3.1 Special characters</a></li>
<li><a name="toc-PreTeX-Commands-1" href="#PreTeX-Commands">7.3.3.2 PreTeX Commands</a></li>
<li><a name="toc-Differences-with-LaTeX-1" href="#Differences-with-LaTeX">7.3.3.3 Differences with LaTeX</a></li>
</ul></li>
<li><a name="toc-TeXScript-1" href="#TeXScript">7.3.4 TeXScript</a></li>
</ul></li>
<li><a name="toc-Faces-1" href="#Faces">7.4 Faces</a></li>
<li><a name="toc-Style-Sheets-Semantics" href="#Style-sheets-semantics">7.5 Style Sheets Semantics</a>
<ul class="toc">
<li><a name="toc-Name-and-key-1" href="#Name-and-key">7.5.1 Name and key</a></li>
<li><a name="toc-Comments-1" href="#Comments">7.5.2 Comments</a></li>
<li><a name="toc-Alphabets-1" href="#Alphabets">7.5.3 Alphabets</a></li>
<li><a name="toc-Case-sensitivity-1" href="#Case-sensitivity">7.5.4 Case sensitivity</a></li>
<li><a name="toc-P_002dRules-1" href="#P_002dRules">7.5.5 P-Rules</a></li>
<li><a name="toc-Sequences-1" href="#Sequences">7.5.6 Sequences</a></li>
<li><a name="toc-Optional-entries-1" href="#Optional-entries">7.5.7 Optional entries</a></li>
</ul></li>
<li><a name="toc-Style-Sheets-Implementation-1" href="#Style-Sheets-Implementation">7.6 Style Sheets Implementation</a>
<ul class="toc">
<li><a name="toc-A-Bit-of-Syntax-1" href="#A-Bit-of-Syntax">7.6.1 A Bit of Syntax</a></li>
<li><a name="toc-Style-Sheet-Header-1" href="#Style-Sheet-Header">7.6.2 Style Sheet Header</a></li>
<li><a name="toc-Syntax-of-the-Words-1" href="#Syntax-of-the-Words">7.6.3 Syntax of the Words</a></li>
<li><a name="toc-Inheriting-from-Other-Style-Sheets" href="#Inheriting">7.6.4 Inheriting from Other Style Sheets</a></li>
<li><a name="toc-Syntax-for-the-P_002dRules-1" href="#Syntax-for-the-P_002dRules">7.6.5 Syntax for the P-Rules</a></li>
<li><a name="toc-Declaring-the-keywords-and-the-operators" href="#Declaring-keywords-and-operators">7.6.6 Declaring the keywords and the operators</a></li>
<li><a name="toc-Declaring-the-sequences" href="#Declaring-sequences">7.6.7 Declaring the sequences</a></li>
<li><a name="toc-Checking-a-Style-Sheet-1" href="#Checking-a-Style-Sheet">7.6.8 Checking a Style Sheet</a></li>
</ul></li>
<li><a name="toc-A-Tutorial-on-Style-Sheets" href="#A-tutorial-on-style-sheets">7.7 A Tutorial on Style Sheets</a>
<ul class="toc">
<li><a name="toc-Example-and-syntax-1" href="#Example-and-syntax">7.7.1 Example and syntax</a></li>
<li><a name="toc-Implementation-1" href="#Implementation">7.7.2 Implementation</a></li>
<li><a name="toc-The-Entry-in-sheets_002emap-1" href="#The-Entry-in-sheets_002emap">7.7.3 The Entry in ‘<tt>sheets.map</tt>’</a></li>
<li><a name="toc-More-Sophisticated-Rules-1" href="#More-Sophisticated-Rules">7.7.4 More Sophisticated Rules</a></li>
<li><a name="toc-Guide-Line-for-Distributed-Style-Sheets" href="#Distributed-Style-Sheets">7.7.5 Guide Line for Distributed Style Sheets</a></li>
</ul>
</li>
</ul></li>
<li><a name="toc-PostScript-1" href="#PostScript">8. PostScript</a>
<ul class="toc">
<li><a name="toc-Foreword_003a-Good-and-Bad-PostScript" href="#Good-and-Bad-PostScript">8.1 Foreword: Good and Bad PostScript</a></li>
<li><a name="toc-Page-Device-Options-1" href="#Page-Device-Options">8.2 Page Device Options</a></li>
<li><a name="toc-Statusdict-Options-1" href="#Statusdict-Options">8.3 Statusdict Options</a></li>
<li><a name="toc-Colors-in-PostScript-1" href="#Colors-in-PostScript">8.4 Colors in PostScript</a></li>
<li><a name="toc-a2ps" href="#a2ps-PostScript-Files">8.5 a2ps</a></li>
<li><a name="toc-Designing-PostScript-Prologues-1" href="#Designing-PostScript-Prologues">8.6 Designing PostScript Prologues</a>
<ul class="toc">
<li><a name="toc-Definition-of-the-faces-1" href="#Definition-of-the-faces">8.6.1 Definition of the faces</a></li>
<li><a name="toc-Prologue-File-Format-1" href="#Prologue-File-Format">8.6.2 Prologue File Format</a></li>
<li><a name="toc-A-step-by-step-example" href="#A-prologue-example">8.6.3 A step by step example</a></li>
</ul>
</li>
</ul></li>
<li><a name="toc-Contributions-1" href="#Contributions">9. Contributions</a>
<ul class="toc">
<li><a name="toc-card-1" href="#card">9.1 <code>card</code></a>
<ul class="toc">
<li><a name="toc-Invoking-card-1" href="#Invoking-card">9.1.1 Invoking <code>card</code></a></li>
<li><a name="toc-Caution-when-Using-card-1" href="#Caution-when-Using-card">9.1.2 Caution when Using <code>card</code></a></li>
</ul></li>
<li><a name="toc-fixps-1" href="#fixps">9.2 <code>fixps</code></a>
<ul class="toc">
<li><a name="toc-Invoking-fixps-1" href="#Invoking-fixps">9.2.1 Invoking <code>fixps</code></a></li>
</ul></li>
<li><a name="toc-fixnt-1" href="#fixnt">9.3 <code>fixnt</code></a>
<ul class="toc">
<li><a name="toc-Invoking-fixnt-1" href="#Invoking-fixnt">9.3.1 Invoking <code>fixnt</code></a></li>
</ul></li>
<li><a name="toc-pdiff-1" href="#pdiff">9.4 <code>pdiff</code></a>
<ul class="toc">
<li><a name="toc-Invoking-pdiff-1" href="#Invoking-pdiff">9.4.1 Invoking <code>pdiff</code></a></li>
</ul></li>
<li><a name="toc-psmandup-1" href="#psmandup">9.5 <code>psmandup</code></a>
<ul class="toc">
<li><a name="toc-Invoking-psmandup-1" href="#Invoking-psmandup">9.5.1 Invoking <code>psmandup</code></a></li>
</ul></li>
<li><a name="toc-psset-1" href="#psset">9.6 <code>psset</code></a>
<ul class="toc">
<li><a name="toc-Invoking-psset-1" href="#Invoking-psset">9.6.1 Invoking <code>psset</code></a></li>
</ul>
</li>
</ul></li>
<li><a name="toc-Frequently-asked-questions" href="#FAQ">10. Frequently asked questions</a>
<ul class="toc">
<li><a name="toc-Why-Does_002e_002e_002e_003f" href="#Why-Does-_002e_002e_002e_003f">10.1 Why Does...?</a>
<ul class="toc">
<li><a name="toc-Why-Does-it-Print-Nothing_003f" href="#It-Prints-Nothing">10.1.1 Why Does it Print Nothing?</a></li>
<li><a name="toc-Why-Does-it-Print-in-Simplex_003f" href="#It-Prints-in-Simplex">10.1.2 Why Does it Print in Simplex?</a></li>
<li><a name="toc-Why-Does-it-Print-in-Duplex_003f" href="#It-Prints-in-Duplex">10.1.3 Why Does it Print in Duplex?</a></li>
<li><a name="toc-Why-Does-it-Not-Fit-on-the-Paper_003f" href="#It-Does-Not-Fit-on-the-Paper">10.1.4 Why Does it Not Fit on the Paper?</a></li>
<li><a name="toc-Why-Does-it-Print-Junk_003f" href="#It-Prints-Junk">10.1.5 Why Does it Print Junk?</a></li>
<li><a name="toc-Why-Does-it-Say-my-File-is-Binary_003f" href="#It-Says-my-File-is-Binary">10.1.6 Why Does it Say my File is Binary?</a></li>
<li><a name="toc-Why-Does-it-Refuse-to-Change-the-Font-Size" href="#It-Refuses-to-Change-the-Font-Size">10.1.7 Why Does it Refuse to Change the Font Size</a></li>
</ul></li>
<li><a name="toc-How-Can-I-_002e_002e_002e_003f-1" href="#How-Can-I-_002e_002e_002e_003f">10.2 How Can I ...?</a>
<ul class="toc">
<li><a name="toc-How-Can-I-Leave-Room-for-Binding_003f" href="#Leave-Room-for-Binding">10.2.1 How Can I Leave Room for Binding?</a></li>
<li><a name="toc-How-Can-I-Print-stdin_003f" href="#Print-stdin">10.2.2 How Can I Print <code>stdin</code>?</a></li>
<li><a name="toc-How-Can-I-Change-the-Fonts_003f" href="#Change-the-Fonts">10.2.3 How Can I Change the Fonts?</a></li>
<li><a name="toc-How-Can-I-Simulate-the-Old-Option-_002db_003f" href="#The-Old-Option-_002db_003f">10.2.4 How Can I Simulate the Old Option ‘<samp>-b</samp>’?</a></li>
<li><a name="toc-How-Can-I-Pass-Options-to-lpr" href="#Pass-Options-to-lpr">10.2.5 How Can I Pass Options to ‘<samp>lpr</samp>’</a></li>
<li><a name="toc-How-Can-I-Print-on-Non-PostScript-Printers_003f" href="#Non-PostScript-Printers">10.2.6 How Can I Print on Non PostScript Printers?</a></li>
<li><a name="toc-How-Can-I-Print-Man-Pages-with-Underlines" href="#Man-Pages-with-Underlines">10.2.7 How Can I Print Man Pages with Underlines</a></li>
</ul></li>
<li><a name="toc-Please-tell-me_002e_002e_002e-1" href="#Please-tell-me_002e_002e_002e">10.3 Please tell me...</a>
<ul class="toc">
<li><a name="toc-Is-a2ps" href="#Is-a2ps-Y2K-compliant_003f">10.3.1 Is a2ps</a></li>
<li><a name="toc-Why-Have-the-Options-Changed_003f" href="#The-Options-Have-Changed">10.3.2 Why Have the Options Changed?</a></li>
<li><a name="toc-Why-not-having-used-yacc-and-such" href="#Why-not-using-yacc">10.3.3 Why not having used <code>yacc</code> and such</a></li>
</ul>
</li>
</ul></li>
<li><a name="toc-Glossary-1" href="#Glossary">A. Glossary</a></li>
<li><a name="toc-Genesis-1" href="#Genesis">B. Genesis</a>
<ul class="toc">
<li><a name="toc-History-1" href="#History">B.1 History</a></li>
<li><a name="toc-Thanks-1" href="#Thanks">B.2 Thanks</a></li>
<li><a name="toc-Translators-1" href="#Translators">B.3 Translators</a></li>
</ul></li>
<li><a name="toc-Copying-1" href="#Copying">C. Copying</a></li>
<li><a name="toc-Concept-Index-1" href="#Concept-Index">Concept Index</a></li>
</ul>
</div>
<hr size="1">
<a name="SEC_About"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Introduction" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="#Concept-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1>About This Document</h1>
<p>
This document was generated by <em>Autobuild</em> on <em>July 5, 2010</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
</p>
<p>
The buttons in the navigation panels have the following meaning:
</p>
<table border="1">
<tr>
<th> Button </th>
<th> Name </th>
<th> Go to </th>
<th> From 1.2.3 go to</th>
</tr>
<tr>
<td align="center"> [ < ] </td>
<td align="center">Back</td>
<td>Previous section in reading order</td>
<td>1.2.2</td>
</tr>
<tr>
<td align="center"> [ > ] </td>
<td align="center">Forward</td>
<td>Next section in reading order</td>
<td>1.2.4</td>
</tr>
<tr>
<td align="center"> [ << ] </td>
<td align="center">FastBack</td>
<td>Beginning of this chapter or previous chapter</td>
<td>1</td>
</tr>
<tr>
<td align="center"> [ Up ] </td>
<td align="center">Up</td>
<td>Up section</td>
<td>1.2</td>
</tr>
<tr>
<td align="center"> [ >> ] </td>
<td align="center">FastForward</td>
<td>Next chapter</td>
<td>2</td>
</tr>
<tr>
<td align="center"> [Top] </td>
<td align="center">Top</td>
<td>Cover (top) of document</td>
<td> </td>
</tr>
<tr>
<td align="center"> [Contents] </td>
<td align="center">Contents</td>
<td>Table of contents</td>
<td> </td>
</tr>
<tr>
<td align="center"> [Index] </td>
<td align="center">Index</td>
<td>Index</td>
<td> </td>
</tr>
<tr>
<td align="center"> [ ? ] </td>
<td align="center">About</td>
<td>About (help)</td>
<td> </td>
</tr>
</table>
<p>
where the <strong> Example </strong> assumes that the current position is at <strong> Subsubsection One-Two-Three </strong> of a document of the following structure:
</p>
<ul>
<li> 1. Section One
<ul>
<li>1.1 Subsection One-One
<ul>
<li>...</li>
</ul>
</li>
<li>1.2 Subsection One-Two
<ul>
<li>1.2.1 Subsubsection One-Two-One</li>
<li>1.2.2 Subsubsection One-Two-Two</li>
<li>1.2.3 Subsubsection One-Two-Three
<strong><== Current Position </strong></li>
<li>1.2.4 Subsubsection One-Two-Four</li>
</ul>
</li>
<li>1.3 Subsection One-Three
<ul>
<li>...</li>
</ul>
</li>
<li>1.4 Subsection One-Four</li>
</ul>
</li>
</ul>
<hr size="1">
<p>
<font size="-1">
This document was generated by <em>Autobuild</em> on <em>July 5, 2010</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
</font>
<br>
</p>
</body>
</html>
ACC SHELL 2018