GNU A2ps, Version 4.14: Akim Demaille Miguel Santana
GNU A2ps, Version 4.14: Akim Demaille Miguel Santana
GNU A2ps, Version 4.14: Akim Demaille Miguel Santana
14
General Purpose PostScript Generating Utility
Edition 4.14, 2 May 2007
Akim Demaille
Miguel Santana
Copyright
c 1988-1993 Miguel Santana
Copyright
c 1995-2000 Akim Demaille, Miguel Santana Copyright
c 2007 Akim Demaille,
Miguel Santana and Masayuki Hatta
Permission is granted to make and distribute verbatim copies of this manual provided the copy-
right notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the condi-
tions for verbatim copying, provided that the entire resulting derived work is distributed under
the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language,
under the above conditions for modified versions, except that this permission notice may be
stated in a translation approved by the Free Software Foundation.
i
Short Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 User’s Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Invoking a2ps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5 Library Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6 Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7 Pretty Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
8 PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
9 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
10 Frequently asked questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
A Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
B Genesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
C Copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Concept Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
ii
Table of Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Reporting Bugs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 a2ps Mailing Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Helping the Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 User’s Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 How to print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1 Basics for Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.2 Special Printers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.3 Using Delegations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.4 Printing Duplex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.5 Checking the Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Important parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Localizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5 Interfacing with Other Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5.1 Interfacing With a Mailer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5.2 Netscape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 Invoking a2ps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1 Command line options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.1 Tasks Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.2 Global Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.3 Sheet Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.4 Page Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1.5 Headings Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.6 Input Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.7 Pretty Printing Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.1.8 Output Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.1.9 PostScript Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2 Escapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2.1 Use of Escapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2.2 General Structure of the Escapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.2.3 Available Escapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4 Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.1 Including Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2 Your Library Path. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.3 Your Default Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.4 Your Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5 Your Printers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.6 Your Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.7 Your PostScript magic number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.8 Your Page Labels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.9 Your Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.9.1 Defining Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
iii
5 Library Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.1 Documentation Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2 Map Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.3 Font Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.3.1 Fonts Map File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.3.2 Fonts Description Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.3.3 Adding More Font Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.4 Style Sheet Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6 Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.1 What is an Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.2 Encoding Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.2.1 Encoding Map File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.2.2 Encoding Description Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.2.3 Some Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
7 Pretty Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.1 Syntactic limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.2 Known Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.3 Type Setting Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.3.1 Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.3.2 PreScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.3.2.1 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.3.2.2 PreScript Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
7.3.2.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
7.3.3 PreTEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
7.3.3.1 Special characters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
7.3.3.2 PreTEXCommands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
7.3.3.3 Differences with LaTEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
7.3.4 TEXScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.4 Faces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.5 Style Sheets Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.5.1 Name and key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.5.2 Comments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.5.3 Alphabets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.5.4 Case sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.5.5 P-Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.5.6 Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.5.7 Optional entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.6 Style Sheets Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.6.1 A Bit of Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.6.2 Style Sheet Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
7.6.3 Syntax of the Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
7.6.4 Inheriting from Other Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
7.6.5 Syntax for the P-Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
7.6.6 Declaring the keywords and the operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
iv
8 PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
8.1 Foreword: Good and Bad PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
8.2 Page Device Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
8.3 Statusdict Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
8.4 Colors in PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
8.5 a2ps PostScript Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
8.6 Designing PostScript Prologues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
8.6.1 Definition of the faces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
8.6.2 Prologue File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
8.6.3 A step by step example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
9 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
9.1 card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
9.1.1 Invoking card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
9.1.2 Caution when Using card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9.2 fixps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9.2.1 Invoking fixps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9.3 fixnt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
9.3.1 Invoking fixnt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
9.4 pdiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
9.4.1 Invoking pdiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
9.5 psmandup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
9.5.1 Invoking psmandup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
9.6 psset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
9.6.1 Invoking psset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Appendix A Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Appendix B Genesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
B.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
B.2 Thanks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
B.3 Translators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Appendix C Copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Concept Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Chapter 1: Introduction 1
1 Introduction
This document describes GNU a2ps version 4.14. The latest versions may be found on the a2ps
home page1 . We plan to update the GNU a2ps home page2 in the near future, in which case
the latter will be a better source of information.
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, not because a2ps is difficult to use. See Appendix A [Glossary], page 87, for technical
words or even general information.
Please, send us emailcards :). Whatever the comment is, or if you just like a2ps, write to
Miguel Santana and Akim Demaille. But never write to either of us for asking questions, or to
report bugs. Chances are very high never to receive an answer, as we receive too many messages.
See Section 1.3 [a2ps Mailing Lists], page 2, for information on the mailing lists.
1.1 Description
a2ps formats files for printing on a PostScript printer.
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 a2ps is
kind of bootstrapped: its sources are frequently printed with a2ps :).
While at the origin its names was derived from “ASCII to PostScript”, today we like to think
of it as “Any to PostScript”. Indeed, a2ps supports delegations, i.e., you can safely use a2ps to
print DVI, PostScript, LaTeX, JPEG etc., even compressed.
A short list of features of a2ps might look like this:
− Customizable through various configuration files (see Chapter 4 [Configuration Files],
page 27)
− Powerful escapes to define the headers, table of contents etc. the way you want (see
Section 3.2 [Escapes], page 21);
− Variables to push even further the customizability in a comfortable manner (see Section 4.9
[Your Variables], page 30);
− Open approach of encodings (see Chapter 6 [Encodings], page 39);
− Excellent support of the Latin 2, 3, 4, 5 and 6 encodings, thanks to Ogonkify (see Section
“Overview” in Ogonkify manual), written by Juliusz Chroboczek.
− Fully customizable output style: fonts, background and foreground colors, line numbering
style etc. (see Section 8.6 [Designing PostScript Prologues], page 73).
− Possibility to delegate the processing of some files to other filters (see Section 4.10 [Your
Delegations], page 31).
− Many contributions, e.g., pretty-print diffs, print reference cards of programs, sanitize bro-
ken PostScript files, print Duplex on Simplex printers etc. (see Chapter 9 [Contributions],
page 76).
− And finally, the ability to pretty-print sources written in quite a few various languages (see
Chapter 7 [Pretty Printing], page 44).
1
http://www.gnu.org/software/a2ps/
2
http://www.gnu.org/software/a2ps/
Chapter 1: Introduction 2
9
http://www.gnu.org/software/a2ps//po/
10
http://www.dcs.ed.ac.uk/home/jec/ogonkify/missing.html
11
http://www.dcs.ed.ac.uk/home/jec/ogonkify/
Chapter 2: User’s Guide 4
2 User’s Guide
This chapter is devoted to people who don’t know a2ps yet: we try to give a soft and smooth
introduction to the most useful features. For a reference manual, see Chapter 3 [Invoking a2ps],
page 9. For the definition of some words, see Appendix A [Glossary], page 87, for questions you
have, see Chapter 10 [FAQ], page 82.
2.1 Purpose
a2ps is a program that takes a text file (i.e., human readable), and makes a PostScript file out
of it. Typically output is sent to a printer.
Here the option ‘-A’ is a short cut for the option ‘--file-align’ which specifies how different
files should be separated. This option allows several symbolic arguments: ‘virtual’, ‘rank’,
‘page’, ‘sheet’ (See Section 3.1.3 [Sheet Options], page 12, for more details). The value ‘virtual’
means not to start each file on a different virtual pages.
So to fill the page is asked by ‘--file-align=virtual’, or ‘-A virtual’. But symbolic
arguments can be abbreviated when there are no ambiguity, so here, you can just use ‘-Av’.
The option ‘-P lw’ means to print on the printer named ‘lw’, and finally, the long option
‘--prologue’ requires the use one of the alternative printing styles. There are other prologues
(See Section 3.1.6 [Input Options], page 15, option ‘--prologue’), and you can even design yours
(see Section 8.6 [Designing PostScript Prologues], page 73).
A final word: compressed files can be treated in the very same way:
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
2.4 Localizing
a2ps provides some Native Language Support, that is speaking your mother tongue. It uses
three special features for non-English languages:
the tongue i.e., the language used by the interface,
the date i.e., the format and the words used in the language to specify a date.
To enable these features, properly set your environment variable LANG (see the documentation
of your system, for instance ‘man locale’, ‘man environ’ etc.).
Chapter 2: User’s Guide 8
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 awk
and such.
So if you just want messages and time format to be localized, then define:
set LC_MESSAGES=fr ; export LC_MESSAGES
set LC_TIME=fr ; export LC_TIME
2.5.2 Netscape
This is actually valid for any program that generates PostScript that you want to post-process
with a2ps. Use the following command:
a2ps
Not too hard, isn’t it?
Nevertheless, this setting suppose your world is OK, your file(1) detects correctly Post-
Script files, and your a2ps is configured to delegate. In case one one these conditions is not met,
use:
a2ps -ZEps
Do not forget to tell Netscape whether your printer supports colors, and the type of paper it
uses.
Chapter 3: Invoking a2ps 9
3 Invoking a2ps
Calling a2ps is fairly simple:
a2ps Options... Files...
If no Files... are given, a2ps prints its standard input. If ‘-’ appears in the Files..., it
designates the standard input too.
Here after a boolean is considered as true (i.e. setting the option on), if boolean is ‘yes’, or
‘1’; as false if it equals ‘no’ or ‘0’; and raise an error otherwise. The corresponding short option
takes no arguments, but corresponds to a positive answer.
When an argument is presented between square brackets, it means that it is optional. Op-
tional arguments to short option must never be separated from the option.
--version [Option]
print version and exit successfully.
--help [Option]
Print a short help, and exit successfully.
--copyright [Option]
Display Copyright and copying conditions, and exit successfully.
--guess [Option]
Act like file does: display the (key of the) type of the Files.
For instance, on a C file, you expect it to answer ‘c’, and upon a PostScript file, ‘ps’.
This can be very useful on broken systems to understand why a file is printed with a bad
style sheet (see Section 5.4 [Style Sheet Files], page 37).
1
A classical Unix trick to make the difference between the option ‘-2’, and the file ‘-2’ is to type ‘./-2’.
Chapter 3: Invoking a2ps 10
--which [Option]
Look in the library for the files which names are given as arguments. For instance:
~ % a2ps --which bw.pro gray.pro
/usr/local/share/a2ps/ps/bw.pro
/usr/local/share/a2ps/ps/gray.pro
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.
--glob [Option]
Look in the library for the files which names match the patterns given as arguments. For
instance:
~ % a2ps --glob ’g*.pro’
/usr/local/share/a2ps/ps/gray.pro
/usr/local/share/a2ps/ps/gray2.pro
--list=topic [Option]
Display a report on a2ps’ status with respect to topic, and exit successfully. topic can be
any non-ambiguous abbreviation of:
‘defaults’
‘options’ Give an extensive report on a2ps configuration and installation.
‘features’
Known media, encodings, languages, prologues, printers, variables, delegations
and user options are reported. In a word, anything that you may define.
‘delegations’
Detailed list of the delegations. See Section 4.10 [Your Delegations], page 31.
‘encodings’
Detailed list of known encodings. See Section 6.2.3 [Some Encodings], page 41.
‘media’ Detailed list of known media. See Section 4.4 [Your Media], page 28.
‘prologues’
Detailed list of PostScript prologues. See Section 8.6 [Designing PostScript Pro-
logues], page 73.
‘printers’
Detailed list of printers and named outputs. See Section 4.5 [Your Printers],
page 28.
‘style-sheets’
Detailed list of the known style sheets. See Section 7.2 [Known Style Sheets],
page 44.
‘user-options’
Detailed list of the user options. See Section 4.6 [Your Shortcuts], page 29.
‘variables’
Detailed list of the variables. See Section 4.9 [Your Variables], page 30.
There are also options meant for the maintainers only, presented for sake of completeness.
Chapter 3: Invoking a2ps 11
‘texinfo-style-sheets’
‘ssh-texi’
Detailed list of known style sheets in Texinfo format. If the sheet verbosity is
set, report version numbers, requirements and ancestors.
‘html-style-sheets’
‘ssh-html’
Detailed list of the style sheets in HTML format.
‘texinfo-encodings’
‘edf-texi’
Detailed list of encodings, in Texinfo format.
‘texinfo-prologues’
‘pro-texi’
Detailed list of prologues, in Texinfo format.
-q [Option]
--quiet [Option]
--silent [Option]
be really quiet
-v[level ] [Option]
--verbose[=level ] [Option]
tell what we are doing. At
− level = 0, report nothing,
− level = 1, a2ps just prints the total number of pages printed,
− level = 2 (default), it reports it for each file,
− above, it gives internal details.
There is also an interface made for the maintainer with finer grained selection of the verbosity
level. level is a list of tokens (non ambiguous abbreviations are valid) separated by either ‘,’
or ‘+’. The tokens may be:
‘configuration’
‘options’ reading the configurations files and the options,
‘encodings’
the encodings,
‘expert’ more detailed information is provided: PPD listings is exhaustive,
‘files’ inputs and outputs,
‘fonts’ the fonts,
‘escapes’
‘variables’
‘meta-sequences’
the expansion of escapes and variables,
‘parsers’ any parsing process (style sheets, PPD files etc.),
‘pathwalk’
‘pw’ the search for files,
Chapter 3: Invoking a2ps 12
-=shortcut [Option]
--user-option=shortcut [Option]
use the shortcut defined by the user. See Section 4.6 [Your Shortcuts], page 29. Shortcuts
may be freely mixed with regular options and arguments.
There are a few predefined user-options:
‘lp’ emulates a line printer, i.e., turn off most ‘pretty’ features.
‘mail’
‘longmail’
preferred options to print a mail or a news. ‘longmail’ prints more text on a
single sheet.
‘manual’ make the job be printed on the manually fed tray.
--debug [Option]
enable debugging features. They are:
− print the overall BoundingBox in PostScript;
− down load a PostScript debugger which helps understanding why a printer may reject a
file.
-M medium [Option]
--medium=medium [Option]
use output medium medium. See the output of ‘a2ps --list=media’ for the list of supported
media. Typical values are ‘A3’, ‘A4’, ‘A5’, ‘B4’, ‘B5’, ‘Letter’, ‘Legal’.
‘A4dj’, ‘Letterdj’ are also defined for Desk Jet owners, since that printer needs bigger
margins.
The special medium ‘libpaper’ means that you want a2ps to ask the library libpaper for
the medium to use. This choice is valid only if libpaper was available when a2ps was
configured. See the man page of paperconf for more information.
Chapter 3: Invoking a2ps 13
-r [Option]
--landscape [Option]
print in landscape mode
-R [Option]
--portrait [Option]
print in portrait mode
--columns=num [Option]
specify the number of columns of virtual pages per physical page.
--rows=num [Option]
specify the number of rows of virtual pages per physical page.
--major=direction [Option]
specify whether the virtual pages should be first filled in rows (direction = ‘rows’) or in
columns (direction = ‘columns’).
-1 [Option]
1 x 1 portrait, 80 chars/line, major rows (i.e. alias for ‘--columns=1 --rows=1 --portrait
--chars-per-line=80 --major=rows’).
-2 [Option]
2 x 1 landscape, 80 chars/line, major rows.
-3 [Option]
3 x 1 landscape, 80 chars/line, major rows.
-4 [Option]
2 x 2 portrait, 80 chars/line, major rows.
-5 [Option]
5 x 1 landscape, 80 chars/line, major rows.
-6 [Option]
3 x 2 landscape, 80 chars/line, major rows.
-7 [Option]
7 x 1 landscape, 80 chars/line, major rows.
-8 [Option]
4 x 2 landscape, 80 chars/line, major rows.
-9 [Option]
3 x 3 portrait, 80 chars/line, major rows.
-j [Option]
--borders=boolean [Option]
print borders around virtual pages.
-A mode [Option]
--file-align=mode [Option]
Align separate files according to mode. This option allows the printing of more than one file
on the same page. mode can be any one of:
‘virtual’ Each file starts on the next available virtual page (i.e., leave no empty virtuals).
Chapter 3: Invoking a2ps 14
‘rank’ Each file starts at the beginning of the next row or column depending on the
‘--major’ setting.
‘page’ Each file starts on a new page.
‘sheet’ Each file starts on a new sheet. In Simplex mode, this is the same as ‘page’, in
Duplex mode, files always start on a front side.
an integer num
Each file starts on a page which is a multiple of num plus 1. For instance, for
‘2’, the files must start on odd pages.
--margin[=num ] [Option]
Specify the size of the margin (num PostScript points, or 12 points without arguments) to
leave in the inside (i.e. left for the front side page, and right for the back side). This is
intended to ease the binding.
-T num [Option]
--tabsize=num [Option]
set tabulator size to num. This option is ignored if --interpret=no is given.
--non-printable-format=format [Option]
specify how non-printable chars are printed. format can be
‘caret’ Use classical Unix representation: ‘^A’, ‘M-^B’ etc.
‘space’ A space is written instead of the non-printable character.
‘question-mark’
A ‘?’ is written instead of the non-printable character.
‘octal’ For instance ‘\001’, ‘177’ etc.
‘hexa’ For instance ‘\x01’, ‘\xfe’ etc.
‘emacs’ For instance ‘C-h’, ‘M-C-c’ etc.
-B [Option]
--no-header [Option]
no page headers at all.
-b[text ] [Option]
--header[=text ] [Option]
set the page header
--center-title[=text ] [Option]
--left-title[=text ] [Option]
--right-title[=text ] [Option]
Set virtual page center, left and right titles to text.
-u[text ] [Option]
--underlay[=text ] [Option]
use text as under lay (or water mark), i.e., in a light gray, and under every page.
--left-footer[=text ] [Option]
--footer[=text ] [Option]
--right-footer[=text ] [Option]
Set sheet footers to text.
The pages referred to are the input pages, not the output pages, that is, in ‘-2’, printing with
‘-a1’ will print the first virtual page, i.e., you will get half the page filled.
Note that page selection does work with the delegations (see Section 4.10 [Your Delegations],
page 31).
-c [Option]
--truncate-lines=boolean [Option]
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.
-i [Option]
--interpret=boolean [Option]
interpret tab and ff chars. This means that ‘^L’ jumps to a new (virtual) pages, ‘tab’ advances
to the next tabulation.
--end-of-line=type [Option]
Specify what sequence of characters denotes the end of line. type can be:
n
unix ‘\n’.
r
mac ‘\r’.
nr ‘\n\r’. As far as we know, this type of end-of-line is not used.
pc
rn ‘\r\n’. This is the type of end-of-line on MS-DOS.
any
auto Any of the previous cases. This last case prevents the bad surprises with files
from PC (trailing ‘^M’).
-X key [Option]
--encoding=key [Option]
Use the input encoding identified by key. See Section 6.2.3 [Some Encodings], page 41,
and the result of ‘a2ps --list=encodings’ to know what encodings are supported. Typical
values are ‘ASCII’, ‘latin1’... ‘latin6’, ‘ison ’ etc.
--stdin=filename [Option]
Give the name filename to the files read through the standard input.
-t name [Option]
--title=name [Option]
Give the name name to the document. Escapes can be used (see Section 3.2 [Escapes],
page 21).
This is used for instance in the name given to the document from within the PostScript
code (so that Ghostview and others can display a file with its real title, instead of just the
PostScript file name).
It is not the name of the output. It is just a logical title.
--prologue=prologue [Option]
Use prologue as the PostScript prologue for a2ps. prologue must be in a file named
‘prologue.pro’, which must be in a directory of your library path (see Chapter 5 [Library
Files], page 35). Available prologues are:
Chapter 3: Invoking a2ps 17
‘bold’ This style is meant to replace the old option -b of a2ps 4.3. It is a copy of the
black and white prologue, but in which all the fonts are in Bold.
‘bw’ Style is plain: pure black and white, with standard fonts.
‘color’ Colors are used to highlight the keywords.
‘diff’ This style is meant to be used with the udiff, wdiff style sheets, to underline
the differences. New things are in bold on a diff background, while removed
sequences are in italic.
‘diffcolor’
Colors are used to highlight the keywords (for diffs).
‘fixed’ This style uses exclusively fixed size fonts. You should use this style if you want
the tabulations to be properly printed.
There are no means to use a fixed size Symbol font, therefore you should not use
the heavy highlighting style.
‘gray’ Gray background is used for comments and labels.
‘gray2’ Black background is used for comments and labels.
‘matrix’ The layout is the same as ‘bw’, but alternating gray and white lines. There are
two macros defining the behavior: ‘pro.matrix.cycle’ defines the length of the
cycle (number of white and gray lines). It defaults to 6. ‘pro.matrix.gray’
defines the number of gray lines. Default is 3.
‘ul’ This style uses bold faces and underlines, but never italics. This is particularly
meant for printing formatted man pages.
--print-anyway=boolean [Option]
force binary printing. By default, the whole print job is stopped as soon as a binary file is
detected. To detect such a file we make use of a very simple heuristic: if the first sheet of
the file contains more than 40% of non-printing characters, it’s a binary file. a2ps also asks
file(1) what it thinks of the type of the file. If file(1) answers ‘data’, the file will also be
considered as binary, hence not printed.
-Z [Option]
--delegate=boolean [Option]
Enable delegation of some files to delegated applications. If delegating is on, then a2ps will
not process the file by itself, but will call an application which handles the file in another
way. If delegation is off, then a2ps will process every file itself.
Typically most people don’t want to pretty-print a PostScript source file, but want to print
what describes that file. Then set the delegations on.
See Section 4.10 [Your Delegations], page 31 for information on delegating, and option
‘--list=delegations’ for the applications your a2ps knows.
--toc[=format ] [Option]
Generate a Table of Contents, which format is an escape (see Section 3.2 [Escapes], page 21)
processed as a PreScript file (see Section 7.3.2 [PreScript], page 54). If no format is given
(i.e., you wrote ‘--toc’), use the default table of contents shape (#{toc}). If the given format
is empty (i.e., you wrote ‘--toc=’), don’t issue the table of contents.
Note that it is most useful to define a variable (see Section 4.9 [Your Variables], page 30), for
instance, in a configuration file:
Chapter 3: Invoking a2ps 18
Variable: toc.mine \
\\Keyword{Table of Content}\n\
#-1!f\
|$2# \\keyword{$-.20n} sheets $3s< to $3s> ($2s#) \
pages $3p<-$3p> $4l# lines\n||\
\\Keyword{End of toc}\n
and to give that variable as argument to ‘--toc’: ‘a2ps *.c --toc=#{toc.mine}’.
Note too that you can generate only the table of content using ‘--pages’:
a2ps *.c --toc -atoc
--highlight-level=level [Option]
Specify the level of highlighting. level can be
‘none’ no highlighting
‘normal’ regular highlighting
‘heavy’ even more highlighting.
-g [Option]
Alias for ‘--highlight-level=heavy’.
-E[language ] [Option]
--pretty-print[=language ] [Option]
With no arguments, set automatic style selection on. Otherwise, set style to language. Note
that setting language to ‘plain’ turns off pretty-printing. See Section 7.2 [Known Style
Sheets], page 44, and the output of ‘--list=style-sheets’ for the available style sheets.
If language is ‘key.ssh’, then don’t look in the library path, but use the file ‘key.ssh ’. This
is to ease debugging non installed style sheets.
--strip-level=num [Option]
Depending on the value of num:
This option is valuable for instance in java in which case strong comments are the so called
documentation comments, or in SDL for which some graphical editors pollutes the specification
with internal data as comments.
Note that the current implementation is not satisfactory: some undesired blank lines remain.
This is planed to be fixed.
Chapter 3: Invoking a2ps 19
-o file [Option]
--output=file [Option]
leave output to file file. If file is ‘-’, leave output to the standard output.
--version-control=type [Option]
to avoid loosing a file, a2ps offers backup services. This is enabled when the output file
already exists, is regular (that is, no backup is done on special files such as ‘/dev/null’),
and is writable (in this case, disabling version control makes a2ps fail the very same way as
if version control was disabled: permission denied).
The type of backups made can be set with the VERSION_CONTROL environment variable, which
can be overridden by this option. If VERSION_CONTROL is not set and this option is not given,
the default backup type is ‘existing’. The value of the VERSION_CONTROL environment variable
and the argument to this option are like the GNU Emacs ‘version-control’ variable; they
also recognize synonyms that are more descriptive. The valid values are (unique abbreviations
are accepted):
‘none’
‘off’ Never make backups (override existing files).
‘t’
‘numbered’
Always make numbered backups.
‘nil’
‘existing’
Make numbered backups of files that already have them, simple backups of the
others.
‘never’
‘simple’ Always make simple backups.
--suffix=suffix [Option]
The suffix used for making simple backup files can be set with the SIMPLE_BACKUP_SUFFIX
environment variable, which can be overridden by this option. If neither of those is given,
the default is ‘~’, as it is in Emacs.
-P name [Option]
--printer=name [Option]
send output to printer name. See item ‘Printer:’ and ‘Unknown printer:’ in Section 4.5
[Your Printers], page 28 and results of option ‘--list=defaults’ to see the bindings between
printer names and commands.
It is possible to pass additional options to lpr or lp via the variable ‘lp.options’, for more
information see Section 10.2.5 [Pass Options to lpr], page 84.
-d [Option]
send output to the default printer. See item ‘DefaultPrinter:’ in Section 4.5 [Your Printers],
page 28.
Chapter 3: Invoking a2ps 20
-k [Option]
--page-prefeed [Option]
enable page prefeeding. It consists in positioning the sheet in the printing area while the
PostScript is interpreted (instead of waiting the end of the interpretation of the page before
pushing the sheet). It can lead to an significant speed up of the printing.
a2ps quotes the access to that feature, so that non supporting printers won’t fail.
-K [Option]
--no-page-prefeed [Option]
disable page prefeeding.
3.2 Escapes
The escapes are some sequences of characters that will be replaced by their values. They are
very much like variables.
‘#’ escapes are related to the output (e.g., the output file name) or to the
options you gave (e.g., the number of virtual pages etc.), or to special
constructions (e.g., enumerations of the files, or tests etc.),
‘$’ escapes are related to the current input file (e.g., its name, its current
page number etc.),
‘\’ introduces classical escaping, or quoting, sequences (e.g., ‘\n’, ‘\f’ etc.).
width Specifies the width of the column to which the escape is printed. There are three
forms for width
‘+padding integer ’
the result of the expansion is prefixed by the character padding so that
the whole result is as long as integer. For instance ‘$+.10n’ with a file
name ‘$n’=‘foo.c’ gives ‘.....foo.c’.
If no padding is given, ‘ ’ (white space) is used.
‘-padding integer ’
Idem as above, except that completion is done on the left: ‘$+.10n’
gives ‘foo.c.....’.
‘integer ’ which is a short cut for ‘+integer ’. For example, escape ‘$5P’ will
expand to something like ‘ 12’.
directive See Section 3.2.3 [Available Escapes], page 22.
‘#?V’ true if verbosity level includes the ‘tools’ flag (See Section 3.1.2 [Global
Options], page 11. option ‘--verbosity’).
‘#!key |in |between |’
Used for enumerations. The separator (presented here as ‘|’) may be any character.
in and between are escapes.
The enumerations may be:
‘#!$’ enumeration of the command line options. In this case in in never used,
but is replaced by the arguments.
‘#!f’ enumeration of the input files in the other they were given.
‘#!F’ enumeration of the input files in the alphabetical order of their names.
‘#!s’ enumeration of the files appearing in the current sheet.
For instance, the escapes ‘The files printed were: #!f|$n|, |.’ evaluated with
input ‘a2ps NEWS main.c -o foo.ps’, gives ‘The files printed were: NEWS,
main.c.’.
As an exception, ‘#!’ escapes use the width as the maximum number of objects to
enumerate if it is positive, e.g., ‘#10!f|$n|, |’ lists only the ten first file names.
If width is negative, then it does not enumerate the -width last objects (e.g.,
‘#-1!f|$n|, |’ lists all the files but the last).
‘${var }’ value of the environment variable var if defined, nothing otherwise.
‘${var :-word }’
if the environment variable var is defined, then its value, otherwise word.
‘${var :+word }’
if the environment variable var is defined, then word, otherwise nothing.
‘$[num ]’ value of the numth argument given on the command line. Note that $[0] is the name
under which a2ps has been called.
‘#{key }’ expansion of the value of the variable key if defined, nothing otherwise (see
Section 4.9 [Your Variables], page 30)
‘#{key :-word }’
if the variable var is defined, then the expansion of its, otherwise word.
‘#{key :+word }’
if the variable var is defined, then word, otherwise nothing.
‘#.’ the extension corresponding to the current output language (e.g. ‘ps’).
‘%*’ current time in 24-hour format with seconds ‘hh:mm:ss’
‘$*’ file modification time in 24-hour format with seconds ‘hh:mm:ss’
‘$#’ the sequence number of the current input file
‘%#’ the total number of files
‘%a’ the localized equivalent for ‘Printed by User Name ’. User Name is obtained from
the variable ‘user.name’ (see Section 4.9.2 [Predefined Variables], page 31).
‘%A’ the localized equivalent for ‘Printed by User Name from Host Name ’. The variables
‘user.name’ and ‘user.host’ are used (see Section 4.9.2 [Predefined Variables],
page 31).
‘%c’ trailing component of the current working directory
Chapter 3: Invoking a2ps 24
‘#o’ name of the output, before substitution (i.e., argument of ‘-P’, or of ‘-o’).
‘#O’ name of the output, after substitution. If output goes to a file, then the name of the
file. If the output is a symbolic printer (see Section 4.5 [Your Printers], page 28),
the result of the evaluation. For instance, if the symbolic printer ‘file’ is defined
as ‘> $n.%.’, then ‘#O’ returns ‘foo.c.ps’ when printing ‘foo.c’ to PostScript. ‘#o’
would have returned ‘file’.
‘#p’ the range of the page to print from this page. For instance if the user asked
‘--pages=1-10,15’, and the current page is 8, then ‘#p’ evaluates to ‘1-3,8’.
‘$p^’ number of the first page of this file appearing on the current sheet. Note that ‘$p.’,
evaluated at the end of sheet, is also the number of the last page of this file appearing
on this sheet.
‘$p-’ interval of the page number of the current file appearing on the current sheet. It is
the same as ‘$p^-$p.’, if ‘$p^’ and ‘$p.’ are different, otherwise it is equal to ‘$p.’.
‘%p.’ current page number
‘$p.’ page number for this file
‘%p#’ total number of pages printed
‘$p#’ number of pages of the current file
‘$p<’ number of the first page of the current file
‘$p>’ number of the last page of the current file
‘%q’ localized equivalent for ‘Page %p.’
‘$q’ localized equivalent for ‘Page $p.’
‘%Q’ localized equivalent for ‘Page %p./%p#’
‘$Q’ localized equivalent for ‘Page $p./$p#’
‘$s<’ number of the first sheet of the current file
‘%s.’ current sheet number
‘$s.’ sheet number for the current file
‘$s>’ number of the last sheet of the current file
‘%s#’ total number of sheets
‘$s#’ number of sheets of the current file
‘%t’ current time in 12-hour am/pm format
‘$t’ file modification time in 12-hour am/pm format
‘$t1’
‘$t2’
‘$t3’ Content of tag 1, 2 and 3. Tags are pieces of text a2ps fetches in the files, according
to the style. For instance, in mail-folder style, tag 1 is the title of the mail, and
tag 2 its author.
‘%T’ current time in 24-hour format ‘hh:mm’
‘$T’ file modification time in 24-hour format ‘hh:mm’
‘#v’ number of virtual sheets
‘%V’ the version string of a2ps.
Chapter 3: Invoking a2ps 26
4 Configuration Files
a2ps reads several files before the command line options. In the order, they are:
1. the system configuration file (usually ‘/usr/local/etc/a2ps.cfg’) unless you have defined
the environment variable ‘A2PS_CONFIG’, in which case a2ps reads the file it points to;
2. the user’s home configuration file (‘$HOME/.a2ps/a2psrc’)
3. the local file (‘./.a2psrc’)
Because a2ps needs architecture dependent information (such as the local lpr command)
and architecture independent information (such as the type of your printers), users have found
useful that ‘a2ps.cfg’ be dedicated to architecture dependent information. A sub configuration
file, ‘a2ps-site.cfg’ (see Section 4.1 [Including Configuration Files], page 27) is included from
‘a2ps.cfg’.
The file ‘a2ps.cfg’ is updated when you update a2ps, while ‘a2ps-site.cfg’ is not, to
preserve local definitions.
In the configuration files, empty lines and lines starting with ‘#’ are comments.
The other lines have all the following form:
Topic: Arguments
where Topic: is a keyword related to what you are customizing, and Arguments the customiza-
tion. Arguments may be spread on several lines, provided that the last character of a line to
continue is a ‘\’.
In the following sections, each Topic: is detailed.
This is especially useful for the site specific configuration file ‘etc/a2ps.cfg’: you may tune
your printers etc. in a separate file for easy upgrade of a2ps (and hence of its configuration
files).
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
‘AppendLibraryPath:’ and ‘PrependLibraryPath:’.
Chapter 4: Configuration Files 28
Escapes expansion is performed on destination (see Section 3.2 [Escapes], page 21). Recall
that ‘#o’ is evaluated to the destination name, i.e., the argument given to ‘-P’.
For instance
# My Default Printer is called dominique
DefaultPrinter: | lp -d dominique
Examples are
# 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
Chapter 4: Configuration Files 30
As as example, here is a variable for psnup, which encloses all the option passing one would
like. Delegations are then easier to write:
Variable: psnup psnup -#v -q #?j|-d|| #?r||-c| -w#w -h#h
It is strongly suggested to follow a ‘.’ (dot) separated hierarchy, starting with:
‘del’ for variables that are related to delegations.
‘pro’ for variables used in prologues (see Section 8.6 [Designing PostScript Prologues],
page 73). Please, specify the name of the prologue (e.g., ‘pro.matrix.gray’).
‘ps’ for variables related to PostScript matters, such as the page label (which is associated
to ps.page_label), the header etc.
‘pl’ for page label formats. See Section 4.8 [Your Page Labels], page 30, the option
‘--page-label’ in Section 3.1.6 [Input Options], page 15.
‘toc’ for toc formats. See the option ‘--toc’ in Section 3.1.6 [Input Options], page 15.
1
That is to say, there are no PostScript printers that don’t understand these files.
Chapter 4: Configuration Files 31
‘user’ for user related information. See Section 4.9.2 [Predefined Variables], page 31.
This naming convention has not fully stabilized. We apologize for the inconvenience this
might cause to users.
command should produce the file on its standard output. Of course escapes substitution is
performed on command (see Section 3.2 [Escapes], page 21). In particular, command should
use the input file ‘$f’.
2
Current a2ps only handles PostScript output, i.e. out=‘ps’
Chapter 4: Configuration Files 32
3
Because hiding its use into a2ps just makes it even more difficult to the users to know why it failed. Let them
use it by hand.
Chapter 4: Configuration Files 33
the medium
the dimension of the medium selected by the user are available through ‘#w’ and
‘#h’.
the page layout
the number of virtual pages is ‘#v’.
the page range
the page range (in a form ‘1-2,4-6,10-’ for instance) is available by ‘#p’.
the verbosity level
please, do not make your delegations verbose by default. The silent mode should
always be requested, unless ‘#?V’ is set (see the above example with groff).
If ever you need several commands, do not use ‘;’ to separate them, since it may prevent
detection of failure. Use ‘&&’ instead.
The slogan "the sooner, the better " 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 DVI file, dvips knows better the page numbers than psselect would. So
a DVI to PostScript delegation should ask the page selection (‘#p’) to dvips, instead of using
psselect later in the chain. An other obvious reason here is plain efficiency (globally, less data
is processed).
5 Library Files
To be general and to allow as much customization as possible, a2ps avoids 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.
The exact value of this library path is available by ‘a2ps --list=defaults’. Typically its
value is:
gargantua ~ $ a2ps --list=defaults
Configuration status of a2ps 4.14
More stuff deleted here
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
You may change this default path through the configuration files (see Section 4.2 [Your
Library Path], page 27).
If you plan to define yourself some files for a2ps, they should be in one of those directories.
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
‘@itemize’
‘@item’ text
‘@end itemize’
Typeset a list of items. The opening and closing tags must be alone on the line.
/pattern/flags
if the current file name matches pattern, then select style style-key (i.e. file ‘style-
key.ssh’).
<pattern>flags
if the result of a call to file(1) matches pattern, then select style style-key.
Currently flags can only be ‘i’, standing for an insentive match. Please note that the matching
is not truly case insensitive: rather, a lower case version of the string is compared to the pattern
as is, i.e., the pattern should itself be lower case.
The special style-key ‘binary’ tells a2ps to consider that the file should not be printed, and
will be ignored, unless option ‘--print-anyway’ is given.
If a style name can’t be found, the plain style is used.
The map file is read bottom up, so that the “last” match is honored.
Two things are to retain from this:
1. if the file is presented through stdin, then a2ps will run file(1). However, unless you
specify a fake file name with ‘--stdin’, pattern matching upon the name is turn off. In
general you can expect correct delegations, but almost never pretty printing.
2. if file is wrong on some files, a2ps may use bad style sheets. In this case, do try option
‘--guess’, compare it with the output of file, and if the culprit is file, go and complain
to your system administrator :-), or fix it by defining your own filename pattern matching
rules.
Consider the case of Texinfo files as an example (the language in which this documentation
is written). Files are usually named ‘foo.texi’, ‘bar.txi’, or even ‘baz.texinfo’. file(1) is
able to recognize Texinfo files:
doc % file a2ps.texi
a2ps.texi: Texinfo source text
Therefore the sheets.map would look like:
# Texinfo files
texinfo: /*.txi/ /*.texi/ /*.texinfo/
<Texinfo source*>
Chapter 6: Encodings 39
6 Encodings
a2ps is trying to support the various usual encodings that its users use. This chapter presents
what an encoding is, how the encodings support is handled within a2ps, and some encodings it
supports.
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.
allows to specify that whenever a font is called in an encoding, then another font
should be used.
For instance in ‘iso2.edf’ one can read:
# Fonts from Ogonkify offer full support of ISO Latin 2
Substitute: Courier Courier-Ogonki
Substitute: Courier-Bold Courier-Bold-Ogonki
Substitute: Courier-BoldOblique Courier-BoldOblique-Ogonki
Substitute: Courier-Oblique Courier-Oblique-Ogonki
‘Default:’
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 Courier equivalent is the best choice.
Default: Courier-Ogonki
‘Vector:’ 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., ‘bell’ in ASCII (^G) should not be named). The special name ‘.notdef’ is to
be used when the character is not printable.
Warning. Make sure to use real, official, PostScript names. Using names such as
‘c123’ may be the sign you use unusual names. On the other hand PostScript names
such as ‘afii8879’ are common.
7 Pretty Printing
The main feature of a2ps is its pretty-printing capabilities. Two different levels of pretty printing
can be reached:
− basic (normal highlight level) in which what you print is what you wrote.
− 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 ‘<=’ and ‘>=’ will be
replaced by the corresponding single character from the font Symbol.
Note that the difference is up to the author of the style sheet.
1
http://www.ens.fr/~laburthe/claire.html
Chapter 7: Pretty Printing 46
7.3.1 Symbol
The style sheet Symbol introduces easy to type keywords to obtain the special characters of the
PostScript font Symbol. 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 Section 7.6.1
[A Bit of Syntax], page 60.
If you want to know the correspondence, it is suggested to print the style sheet file of Symbol:
a2ps -g symbol.ssh
7.3.2 PreScript
PreScript has been designed in conjunction with a2ps. Since bold sequences, special characters
etc. were implemented in a2ps, we thought it would be good to allow direct access to those
features: PreScript became an input language for a2ps, where special font treatments are
specified in an ssh syntax (see Section 7.6 [Style Sheets Implementation], page 60).
The main advantages for using PreScript are:
− it is fairly simple,
− a2ps is small and easy to install, hence it is available on every UNIX platform.
It can be a good candidate for generation of PostScript output (syntactic pretty-printers,
generation of various reports etc.).
7.3.2.1 Syntax
Every command name begins with a backslash (‘\’). If the command uses an argument, it is
given between curly braces with no spaces between the command name and the argument.
The main limit on PreScript is that no command can be used inside another command. For
instance the following line will be badly interpreted by a2ps:
\Keyword{Problems using \keyword{recursive \copyright} calls}
The correct way to write this in PreScript is
\Keyword{Problems using} \keyword{recursive} \copyright \Keyword{calls}.
Everything from an unquoted % to the end of line is ignored (comments).
Chapter 7: Pretty Printing 55
7.3.2.3 Examples
PreScript and a2ps can be used for one-the-fly formating. For instance, on the ‘passwd’ file:
ypcat passwd |
awk -F: \
’{print "\Keyword{" $5 "} (" $1 ") \rightarrow\keyword{" $7 "}"}’\
| a2ps -Epre -P
7.3.3 PreTEX
The aim of the PreTEX style sheet is to provide something similar to PreScript, but with a
more LaTEX like syntax.
7.3.3.2 PreTEXCommands
These commands required arguments.
‘\section{Title }’
‘\subsection{Title }’
‘\subsubsection{Title }.’
Used to specify the title of a section, subsection or subsubsection.
‘\textbf{text }’
‘\textit{text }’
‘\textbi{text }’
‘\textrm{text }’
write text in bold, italic, bold-italic, Times. Default font is Courier.
‘\textsy{text }’
text 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 Symbol).
‘\header{text }’
‘\footer{text }’
Use text 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.
‘\verb+text +’
Quote text so that no special sequence will be interpreted. In ‘\verb+quoted
string +’ ‘+’ can be any symbol in ‘+’, ‘!’, ‘|’, ‘#’, ‘=’.
‘\begin{document}’
‘\end{document}’
‘\begin{itemize}’
‘\end{itemize}’
‘\begin{enumerate}’
‘\end{enumerate}’
‘\begin{description}’
‘\end{description}’
These commands are legal in LaTEXbut have no sense in PreTEX. Hence there are
simply ignored and not printed (if immediately followed by an end-of-line).
7.3.4 TEXScript
TEXScript is a replacement of the old version of PreScript: it combines both the a2ps-like and
the LaTEX-like syntaxes through inheritance of both PreScript and PreTEX.
In addition it provides commands meant to ease processing of file for a2ps by LaTEX.
Everything between ‘%%TeXScript:skip’ and ‘%%TeXScript:piks’ will be ignored in
TEXScript, so that there can be inserted command definitions for LaTEX exclusively.
The commands ‘\textbi’ (for bold-italic) and ‘\textsy’ (for symbol) do not exist in LaTEX.
They should be defined in the preamble:
%%TeXScript:skip
\newcommand{\textbi}[1]{\textbf{\textit{#1}}}
\newcommand{\textsy}[1]{#1}
%%TeXScript:piks
There is no way in TEXScriptto get an automatic numbering. There is no equivalent to
the LaTEX environment enumerate. But every command beginning by \text is doubled by a
command beginning by ‘\magic’. a2ps behaves the same way on both families of commands.
Hence, if one specifies that arguments of those functions should be ignored in the preamble of
the LaTEX document, the numbering is emulated. For instance
\begin{enumerate}
\magicbf{1.}\item First line
\magicbf{2.}\item Second line
\end{enumerate}
will be treated the same way both in TEXScriptand LaTEX.
‘\header’ and ‘\footer’, are not understood by LaTEX.
7.4 Faces
A face is an attribute given to a piece of text, which specifies how it should look like. Since a2ps
is devoted to pretty-printing source files, the faces it uses are related to the syntactic entities
that can be encountered in a file.
The faces a2ps uses are:
‘Plain’ This corresponds to the text body.
‘Keyword’
‘Keyword_strong’
These are related to the keywords that may appear in a text.
‘Comment’
‘Comment_strong’
These are related to comments in the text. Remember that comments should be
considered as non essential ("Aaaeaaarg" says the programmer); indeed, the user
might suppress the comments thanks (?) to the option ‘--strip-level’. Hence,
never use these faces just because you think they look better on, say, strings.
‘Label’
‘Label_strong’
These are used when a point of extreme importance, or a sectioning point, is met.
Typically, functions declarations etc.
‘String’ Used mainly for string and character literals.
‘Error’ Used to underline the presence of an error. For instance in Encapsulated PostScript,
some PostScript operators are forbidden: they are underlined as errors.
Chapter 7: Pretty Printing 58
Actually, there is also the face ‘Symbol’, but this one is particular: it is not legal changing
its font.
7.5.2 Comments
ssh files can include the name of its author, a version number, a documentation note and a
requirement on the version of a2ps. For instance, if a style sheet requires a2ps version 4.9.6,
then a2ps version 4.9.5 will reject it.
7.5.3 Alphabets
a2ps needs to know the beginning and the end of a word, especially 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.
7.5.5 P-Rules
A P-rule (Pretty printing rule), or rule for short, is a structure which consists of two items:
lhs
left-hand side
its source string, with which the source file is compared;
rhs
right hand side
a list of faced strings which will replace the text matched in the pretty-printed
output. A faced string is composed of
− a string, or a reference to a part of the source string (see Section “Back-reference
Operator” in Regex manual)
− the face to use to print it
Chapter 7: Pretty Printing 59
Just a short example: ‘(foo, bar, Keyword_strong)’ as a rule means that every input
occurrence of ‘foo’ will be replaced by ‘bar’, written with the Keyword_strong face.
If the destination string is empty, then a2ps will use the source string. This is different from
giving the source string as a destination string if the case is different. An example will make it
fairly clear.
Let foobar be a case insensitive style sheet including the rules ‘(foo, "", Keyword)’ and
‘(bar, bar, Keyword)’. Then, on the input ‘FOO BAR’, a2ps will produce ‘FOO bar’ in Keyword.
a2ps implements two different ways to match a string. The difference comes from that some
keywords are sensitive to the delimiters around them (such as ‘unsigned’ and ‘int’ in C, which
are definitely not the same thing as ‘unsignedint’), and others not (in C, ‘!=’ is "different from"
both in ‘a != b’ and ‘a!=b’).
The first ones are called keywords in a2ps jargon, and the seconds are operators. Operators
are matched anywhere they appear, while keywords need to have separators around them (see
Section 7.5.3 [Alphabets], page 58).
Let us give a more complicated example: that of the Yacc rules. A rule in Yacc is of the
form:
a_rule : part1 part2 ;
Suppose you want to highlight these rules. To recognize them, you will write a regular
expression specifying that:
1. it must start at the beginning of the line,
2. then there is string composed of symbols, which is what you want to highlight,
3. and a colon, which can be preceded by blank characters.
The regexp you want is: ‘/^[a-zA-Z0-9_]*[\t ]*:/’. But with the rule
/^[a-zA-Z0-9_]*[\t ]*:/, "", Label_strong
the blanks and the colon are highlighted too. Hence you need to specify some parts in the regexp
(see Section “Back-reference Operator” in Regex manual), and use a longer list of destination
strings. The correct rule is
(/^([a-zA-Z0-9_]*)([\t ]*:)/, \1 Label_strong, \2 Plain)
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:
(/^([a-zA-Z0-9_]*)/ # \1. Name of the rule
/([\t ]*:)/ # \2. Trailing space and colon
\1 Label_strong, \2 Plain)
7.5.6 Sequences
A sequence is a string between two markers, along with a list of exceptions. A marker is a fixed
string. Typical examples are comments, string (with usually ‘"’ as opening and closing markers,
and ‘\\’ and ‘\"’ 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.
− any sequence of regular characters which is not a keyword, is a string (consider this as a
shortcut, avoiding extraneous ‘"’).
second alphabet is
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_\
0123456789"
Note that it is on purpose that no characters interval are used.
case
case insensitive # e.g., C, C++ etc.
case sensitive # e.g., Perl, Sather, Java etc.
The default is case insensitive.
/* 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)
Basically it means that all of the possible operators are used, and that they are in non-
backslashed form. For instance ‘(’ and ‘)’ stand for the group operator, while ‘\\(’ stands
for the character ‘(’. See Section “Regular Expression Syntax” in Regex manual, for a
detailed description of the regular expressions.
− If no expansion is specified, then the matched string is used. For instance ‘(/fo*/, NULL,
Keyword)’ applied on the source ‘fooooo’ produces ‘fooooo’ in Keyword.
− If no face is given, then
− if the context defines the default face, then this face is used;
− if no default face is given, PLAIN is used.
<= \leq,
>= \geq,
! \not
end operators
Note how ‘<<=’ and ‘>>=’ are protected (there are defined to be written as is when met in
the source). This is to prevent the two last characters of ‘<<=’ from being converted into a ‘less
or equal’ sign.
The order in which you define the elements of a category (but the sequences) does not matter.
But since a2ps sorts them at run time, it may save time if the alphabetical C-order is more or
less followed.
You should be aware that when declaring a keyword with a regular expression as lhs, then
a2ps automatically makes this expression matching only if there are no character of the first
alphabet both just before, and just after the string.
In term of implementation, it means that
keywords are
/foo|bar/
end keywords
is exactly the same as
operators are
/\\b(foo|bar)\\b/
end operators
This can cause problems if you use anchors (e.g. $, or ^) in keywords: the matcher will be
broken. In this particular case, define your keywords as operators, taking care of the ‘\\b’ by
yourself.
See Section “Match-word-boundary Operator” in Regex manual, for details on ‘\b’.
sequences are
"\"" Plain String "\"" Plain
exceptions are
"\\\\", "\\\""
end exceptions
end sequences
Since a great deal of languages uses this kind of constructs, you may use C-string to mean
exactly this, and C-char for manifest characters defined the C way.
The following example comes from ‘ssh.ssh’, the style sheet for style sheet files, in which
there are two kinds of pseudo-strings: the strings (‘"example"’), and the regular expressions
(‘/example/’). We do not want the content of the pseudo-strings in the face String.
sequences are
# The comments
"#" Comment,
# Regexps
"/" Plain "/"
exceptions are
"\\\\", "\\\/"
end exceptions
end sequences
The order between sequences does matter. For instance in Java, ‘/**’ introduces strong
comments, and ‘/*’ comments. ‘/**’ must be declared before ‘/*’, or it will be hidden.
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 C comments,
/*
* a comment
*/
//
// a comment
//
Chapter 7: Pretty Printing 66
7.7.2 Implementation
Quite naturally the style will be called ChangeLog, hence:
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
A first interesting and easy entry is that of function names, between ‘(’ and ‘)’:
sequences are
"(" Plain Label ")" Plain
end sequences
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, 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.
For the file names, the problem is a bit more delicate, since they may end with ‘:’, 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:
sequences are
"* " Plain Label_strong ":" Plain
exceptions are
", " Plain, "," Plain
end exceptions,
"* " Plain Label_strong " " Plain
end sequences
Finally, let us say that some words have a higher importance in the core of text: those about
removing or adding something.
keywords in Keyword_strong are
add, added, remove, removed
end keywords
Since they may appear in lower or upper, of mixed case, the style will be defined as case
insensitive.
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 ‘Common Lisp’), 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 ‘chlog.ssh’.
# 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
Chapter 7: Pretty Printing 68
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
The Requirements
Make sure to include a requirement on the needed version of a2ps. If you don’t
know what to put, just put the version of the a2ps you run.
The Documentation
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.
The ‘sheets.map’ Entries
Put in a comment on the ‘sheets.map’ lines that correspond to your style sheet.
A Test File
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.
Finally, make sure your style sheet behaves well! (see Section 7.6.8 [Checking a Style Sheet],
page 66)
Chapter 8: PostScript 71
8 PostScript
This chapter is devoted to the information which is only relevant to PostScript.
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.
setrgbcolor
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.
a2ps uses two higher level procedures, BG and FG, but both use an argument as in
setrgbcolor. So if you wanted a gray shade, just give three times the same ratio.
Its underlining
UL requires a boolean argument, depending whether you want or not the current
face to be underlined.
true UL
Its boxing Requiring a boolean, BX let’s a face have a box drawn around.
/K {
false BG
0 0 0.8 FG
%Face: Keyword_strong Courier-Bold bfs
Show
} bind def
and turn it into:
/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
Chapter 8: PostScript 75
9 Contributions
This chapter documents the various shell scripts or other tools that are distributed with the
a2ps package, but are not a2ps itself. The reader should also look at the documentation of
Ogonkify (see Section “Overview” in Ogonkify manual), written by Juliusz Chroboczek.
9.1 card
Many users of a2ps have asked for a reference card, presenting a summary of the options. In
fact, something closely related to the output of ‘a2ps --help’.
The first version of this reference card was a PreScript file (see Section 7.3.2 [PreScript],
page 54) to be printed by a2ps. Very soon a much better scheme was found: using a style sheet
to pretty print directly the output of ‘a2ps --help’! A first advantage is then that the reference
cards can be printed in the tongue you choose.
A second was that this treatment could be applied to any application supporting a ‘--help’-
like option.
-h [Option]
--help [Option]
print a short help message and exit successfully.
-V [Option]
--version [Option]
report the version and exit successfully.
-q [Option]
--quiet [Option]
--silent [Option]
Run silently.
-D [Option]
--debug [Option]
enter in debug mode.
-l language [Option]
--language=language [Option]
specify the language in which the reference card should be printed. language should be the
symbol used by LC_ALL etc. (such as ‘fr’, ‘it’ etc.).
If the applications don’t support internationalization, English will be used.
--command=command [Option]
Don’t try to guess the applications’ way to report their help message, but rather use the call
command. A typical example is
card --command="cc -flags"
Chapter 9: Contributions 77
It is possible to give options to a2ps (see Section 3.1 [Options], page 9) by specifying them
after ‘--’. For instance
card gmake gtar --command="cc -flags" -- -Pdisplay
builds the reference card of GNU make, GNU tar (automatic detection of ‘--help’ support), and
cc thanks to ‘-flags’.
9.2 fixps
The shell script fixps tries its best to fix common problems in PostScript files that may prevent
post processing. It makes heavy use of the psutils. It is a good idea to use fixps in the
PostScript delegations.
It first tries to make simple fixes, but some really broken files may require a much deeper
treatment. If fixps feels the need for such a major surgery act, it may give up local changes
and ask Ghostscript for a global rewriting.
-h [Option]
--help [Option]
Print a short help message and a list of the fixes that are performed. Exit successfully.
-V [Option]
--version [Option]
report the version and exit successfully.
-D [Option]
--debug [Option]
enter in debug mode.
-q [Option]
--quiet [Option]
--silent [Option]
Run silently.
-o file [Option]
--output=file [Option]
specify the file in which is saved the output.
-n [Option]
--no-fix [Option]
Don’t actually fix the file but still honor all of the other options. In particular, ‘fixps -qn
file ’ is equivalent to ‘cat file ’.
Chapter 9: Contributions 78
-c [Option]
--check [Option]
--dry-run [Option]
Don’t actually fix the file: just report the diagnostics. Contrary to the option ‘fixps -qc’
does absolutely nothing (while it does take some time to do it nicely).
-f [Option]
--force [Option]
Ask ghoscript for a full rewrite of the file. 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.
9.3 fixnt
fixnt (see its1 home page) is maintained by Holger Bauer and Michael Rath. 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).
fixps is aware of the cases where fixnt should be used, hence you should not worry of when
to use fixnt.
9.4 pdiff
The shell script pdiff aims to pretty print diffs between files. It basically uses GNU diff (see
Section “Overview” in Comparing and Merging Files) or GNU wdiff (see Section “The word
difference finder” in GNU wdiff ) to extract the diff, then calls a2ps with the correct settings to
get a nice, printed contextual diff.
-w [Option]
--words [Option]
Look for words differences (default). White space differences are not considered.
-l [Option]
--lines [Option]
Look for lines differences.
It is possible to give options to a2ps (see Section 3.1 [Options], page 9) by specifying them
after ‘--’. For instance
pdiff COPYING COPYING.LIB -- -1 -P display
Compares the files ‘COPYING’ and ‘COPYING.LIB’, and prints it on the printer display (usually
Ghostview or gv).
9.5 psmandup
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.
Make a shell script that automates this, and you get psmandup.
-n [Option]
--no-fix [Option]
psmandup will fail on ill designed PostScript (well, actually the psutils will). To avoid this,
by default the PostScript file is sanitized by fixps.
When given this option, don’t run fixps. This is meant to be used when fixps has already
been used higher in the processing chain.
-f [Option]
--front [Option]
Output only the front pages, with no special PostScript feature request.
-b [Option]
--back [Option]
Output only the back pages, with a manual feed request.
This option is especially useful when the manual feed time out expired before you could insert
back the stack in the manual feed tray.
psmandup assumes the printer is Level 2, and supports manual feeding. The file should be
reasonably sane, otherwise psmandup fails miserably.
Typical use is
psmandup file.ps | lp
or can be put into a2ps’ printer commands (see Section 4.5 [Your Printers], page 28).
9.6 psset
The shell script psset inserts calls to setpagedevice in a PostScript file. This is useful for
instance to add Tumble or Manual feed request. Actually, psmandup uses psset.
You should know nevertheless that a2ps is able to make the calls to setpagedevice by itself,
i.e., you can run ‘a2ps -SManualFeed foo’ to print ‘foo’ onto the manually fed tray, or run ‘a2ps
-s2 foo’ to print Duplex. There are no need of psset from a2ps.
-q [Option]
--quiet [Option]
--silent [Option]
Run silently.
-o file [Option]
--output=file [Option]
specify the file in which is saved the output.
-n [Option]
--no-fix [Option]
psset will fail on ill designed PostScript. Actually it is the psutils that fail. To avoid this,
by default the PostScript file is sanitized by fixps.
When given this option, don’t run fixps. This is meant to be used when fixps has already
been used higher in the processing chain.
-a page [Option]
--at=page [Option]
Specify the page where the setpagedevice call should be done. The page 0, which is the
default, corresponds to the ‘Setup’ section of the document. More precisely, the insertion is
performed at the end of the ‘Setup’ section, so that if there are multiple calls to psset on
the same document (which is of course, a bad idea), the last call is winning.
In a typical use you should not change the page.
-m [Option]
--manualfeed [Option]
Alias for ‘-SManualFeed:true’, i.e., the request to print using the manual feed tray.
-s [Option]
--simplex [Option]
Alias for ‘-SDuplex:false’, i.e., force simplex printing.
-d [Option]
--duplex [Option]
Alias for ‘-SDuplex:true;Tumble:false’, i.e., the request to print in duplex mode, binding
along the long edge of the paper.
-t [Option]
--tumble [Option]
Alias for ‘-SDuplex:true;Tumble:true’, i.e., duplex printing such that binding should hap-
pen on the short edge of the medium.
Chapter 10: Frequently asked questions 82
# Override the rule for files with type ‘data’ according to file(1)
plain: <data*>
But this is not very good, since then this rule is always the first tested, which means
that any file with type ‘data’ according to file(1) will be printed in ‘plain’ style,
even if the file is called ‘foo.c’.
− if your files can be recognized, insert a new rule in a ‘sheets.map’, such as
Chapter 10: Frequently asked questions 84
Appendix A Glossary
This section settles some terms used through out this document, and provides the definitions of
some terms you probably want to know about.
Adobe 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.
AFM file 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.
Charset
Code Set Cf. Encoding.
Delegate Another filter (application) which a2ps may call to process some files. This feature
is especially meant for page description files (see Section 4.10 [Your Delegations],
page 31).
DSC
Document Structuring Conventions
Because PostScript is a language, any file describing a document can have an ar-
bitrary complexity. To ease the post-processing of PostScript files, the document
should follow some conventions. Basically there are two kinds of conventions to
follow:
Page Independence
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 psnup, psselect etc.) can post process PostScript
files.
Requirements
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.
The DSC are edited by Adobe. A document which respects them is said to be DSC
conformant.
a2ps follows all the DSC.
Duplex
DuplexTumble
DuplexNoTumble
To print Duplex is to print double-sided. There are two ways to print Duplex
depending whether the second face is printed upside-down or not:
DuplexTumble
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).
Appendix A: Glossary 88
DuplexNoTumble
DuplexNoTumble corresponds to binding along the long edge of the
medium. A typical case is when printing one-up.
Encoding Association of human readable characters, and computers’ internal numbered rep-
resentation. 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.
To know more about encodings, see Section 6.1 [What is an Encoding], page 39.
Ghostscript
gs Ghostscript1 , gs 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:
Displaying
It can be used either to view PostScript files (in general thanks to a
graphic interface such as Ghostview or gv ...).
Converting
To may useful languages/formats: PDF, rewriting in portable Post-
Script or Encapsulated PS etc.
Translating
to a printer dedicated language, e.g., PCL. In particular, thanks to
ghostscript, you may print PostScript files on non PostScript printers.
Face A virtual style given to some text. For instance, Keyword, Comment are faces.
Headings Everything that goes around the page and is not part of the text body. Typically
the title, footer etc.
Key Many objects used in a2ps, such as encodings, have both a key and a name. The
word name is used for a symbol, a label, which is only meant to be nice to read by
a human. For instance ‘ISO Latin 1’ is a name. a2ps never uses a name, but the
key.
A key is the identifier of a unique object. This is information that a2ps processes,
hence, whenever you need to specify an object to a2ps, use the key, not its name.
For instance ‘latin1’ is the unique identifier of the ‘ISO Latin 1’ encoding.
Logical page
Cf. Virtual page.
lhs
left hand side
See P-rule.
Medium 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.
Name See Key.
Page A single side of a sheet.
Page Description Language
A language that describes some text (which may be enriched with pointers, pictures
etc.) and its layout. HTML, PostScript, LaTEX, roff 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.
1
http://www.cs.wisc.edu/~ghost/index.html
Appendix A: Glossary 89
PCL FIXME:
PFA file PostScript Font in ASCII format. This file can be directly down loaded to provide
support for another font.
PFB file PostScript Font in Binary format. In PFA files there are long sequences of hexadec-
imal 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.
PostScript PostScript is a page description language designed for Raster output devices. It is
even more powerful than that: unlike to HTML, or roff, 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.
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 Ghostscript. PDF has been invented by
Adobe to remedy these problems).
PostScript is a trademark of Adobe Systems Incorporated.
PPD file
PostScript Printer Description file
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.
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.
ProcSet Set of (PostScript) procedures.
Prologue 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 prologue, and the second, the script.
P-rule Pretty printing rule. It is composed of a left-hand side, (lhs for short), and a right-
hand side, (rhs). 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 7.5.5
[P-Rules], page 58, for more semantical details, and see Section 7.6.5 [Syntax for the
P-Rules], page 62, for implementation.
psutils The psutils 2 is a set of tools for PostScript post processing written by Angus Dug-
gan3 . 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 psutils to run cor-
rectly, 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., Mi-
cro$oft tools), Angus Duggan included in the package some tools (named fix...ps)
to fix typical problems. fixps is a collection of recipes on when to run what fix
tool.
2
http://www.dcs.ed.ac.uk/home/ajcd/psutils/index.html
3
http://www.dcs.ed.ac.uk/home/ajcd/
Appendix A: Glossary 90
Appendix B Genesis
Here are some words on a2ps and its history.
B.1 History
The initial version was a shell program written by Evan Kirshenbaum. It was very slow and
contained many bugs.
A new version was written in C by Miguel Santana to improve execution speed and porta-
bility. Many new features and improvements have been added since this first version. Many
contributions (changes, fixes, ideas) were done by a2ps users in order to improve it.
From the latest version from Miguel Santana (4.3), Emmanuel Briot implemented bold faces
for keywords in Ada, C and C++.
From that version, Akim Demaille generalized the pretty-printing capabilities, implemented
more languages support, and other features.
B.2 Thanks
Patrick Andries, from Alis Technologies inc.1 and Roman Czyborra (see his home page2 ),
provided us with important information on encodings. We strongly recommend that you go and
read these pages: there is a lot to learn.
Juliusz Chroboczek worked a lot on the integration of the products of Ogonkify (such as
Latin 2 etc. fonts) in a2ps. Without his help, and the time is devoted to both a2ps and
ogonkify, many non west-European people would still be unable to print easily texts written
in their mother tongue.
Denis Girou brought a constant and valuable support through out the genesis of pretty-
printing a2ps. His comments on both the program and the documentation are the origin of
many pleasant features (such as ‘--prologue’).
Alexander Mai provided us with invaluable help in the development. He spotted several
times subtle bugs in a2ps and the contributions, he keeps a vigilant eye on portability issues,
he checks and improves the style sheets, and he maintains a port of a2ps for OS/2.
Graham Jenkins, with an extraordinary regularity, tortures a2ps on weird systems that
nobody ever heard of ‘:)’. Graham is usually the ultimate test: if he says I can release a2ps,
I rest reassured that, yes, this time it will compile! If a2ps works today on your system, you
should thank Graham too!
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.
Of course it doesn’t sound right, yes it sounds a little childish, but we can tell you: we would
never have the strength and the faith of building and maintaining a2ps without the support of
all these guys.
While a2ps is finally just a couple of bits on a hard disk, to us it is an adventure we live with
other humans, and, boy, that’s a darn good pleasure!
B.3 Translators
Some people worked on the translation of a2ps:
− Daniele Ghiotti (Italian)
− Tomek Burdziak (Polish)
1
http://www.alis.com/
2
http://czyborra.com/
Appendix B: Genesis 92
3
http://come.to/vodolaz
Appendix C: Copying 93
Appendix C Copying
The subroutines and source code in the a2ps package are "free"; this means that everyone is
free to use them and free to redistribute them on a free basis. The a2ps-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.
Specifically, we want to make sure that you have the right to give away copies of the programs
that relate to a2ps, 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.
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-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.
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. 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.
The precise conditions of the licenses for the programs currently being distributed that relate
to a2ps are found in the General Public Licenses that accompany them.
Concept Index 94
Concept Index
% elm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
‘%!’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16, 88
Escape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Escapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
.
‘.a2ps’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
.afm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 F
.edf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Face. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57, 88
.map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
.pfa . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 First Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
.pfb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
G
: Ghostscript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
‘:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 gs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
A H
‘a2ps-site.cfg’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
‘a2ps.cfg’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
‘A2PS_CONFIG’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
A2PS_VERBOSITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
‘a2psrc’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 I
Adobe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
AFM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37, 87 ‘Include:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Alphabets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Angus Duggan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
‘AppendLibraryPath:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
K
key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
B Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
banner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Bug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
L
lhs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
C libpaper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
C-char . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Library files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
C-string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 ‘LibraryPath:’. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Charset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Logical page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Code Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Command line options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 M
Copying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 make_fonts_map.sh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Map files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Markers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
D Medium. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
‘DefaultPrinter:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 ‘Medium:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Delegate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
‘Delegation:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Delegations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
N
display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Non PostScript printers . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Document Structuring Conventions . . . . . . . . . . . . . . . 87
DSC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71, 87
Duplex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20, 87 O
DuplexNoTumble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
DuplexTumble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Optimize for Portability . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Optimize for Speed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Optional entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
E Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
EDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 ‘Options:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Concept Index 95
‘OutputFirstLine:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 S
Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Separator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
P Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
P-rule. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 setpagedevice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
P-Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 ‘sheets.map’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37, 58
Page Description Language . . . . . . . . . . . . . . . . . . . . . . . 88 statusdict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Page device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Style sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58, 90
Page prefeed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Symbol conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Page Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
‘PageLabelFormat:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
paperconf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
PCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
T
PFA file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 ‘TemporaryDirectory:’ . . . . . . . . . . . . . . . . . . . . . . . . . . 34
PFB file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Tumble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
pine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
PostScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
PostScript Quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 U
PPD file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Under lay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Predefined Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 ‘UnknownPrinter:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
‘PrependLibraryPath:’ . . . . . . . . . . . . . . . . . . . . . . . . . . 27 ‘UserOption:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
PreScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Pretty printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
‘Printer:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 V
ProcSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Prologue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16, 89 Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
psutils. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 ‘Variable:’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Variables, predefined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Virtual page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
R void . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Raster Output Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Regular expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
rhs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 W
Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Water mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15