@pack reads several files before the command line options. In the order, they are:
In these 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 customization. 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.
Options: --right-title='Page $p'is wrong. Write
Options: '--right-title=Page $p'
Promela
programmers use the suffix `pr' for their
files, though @pack hard codes `pr' to SDL
. To override
this rule, use:
Pattern: *.pr promelaThe same problem occurs with Objective C and Octave/Matlab.
A general scheme is used, so that whatever the way you should address the printers on your system, the interface is still the same.
Printer:
entry.
The destination must be of one of the following forms:
DefaultPrinter: | lp -d dominique UnknownPrinter: | lp -d %s Printer: foo > foo.ps Printer: wc | wc Printer: lw | lp -d printer-with-a-rather-big-name # Here we address a printer which is not PostScript Printer: deskj | gs -q -sDEVICE=ljet3d -sOutputFile=- - \ | lpr -P flr2 -h -lMS-DOS users, and non-PostScript printer owners should take advantage in getting good configuration of these entries.
@pack produces full DSC compliant PostScript which is something that only PS wizards may understand(1). Adobe said
Thou shalt start you PostScript DSC compliant files with%!PS-Adobe-3.0
The bad news is that some printers will reject this header. Then you may change this header without any worry since the PostScript produced by @pack is also 100% PostScript level 1(2). For instance:
OutputFirstLine: magic-number
where magic-number is `%!PS-Adobe-2.0', or just `%!'.
It is pretty known that satisfying the various human tastes is an NEXPTIME-hard problem, so @pack offers ways to customize its output through the prologue files. But since the authors feel a little small against NEXPTIME, they agreed on the fact that you are the one who will design the look you like.
Hence in this section, you will find what you need to know to be able to customize a2ps output.
Basically, @pack uses faces which are associated to their "meanning" in the text. @pack let's you change the way the faces look.
@pack uses 7 faces:
Actually, there is also the face `Symbol', but this one is particular: it is not legal changing its font.
There are three things that define a face:
%Face: face real-font-name
setfont
, preceded by the short font name:
short-font-name setfont
true
to BG
:
0.8 0.8 0 true BG
BG
with
false
:
false BG
BG
, call FG
with an RGB ratio:
0 0.5 0 FG
UL
requires a boolean argument, depending whether you want
or not the current face to be underlined.
true UL
BX
let's a face have a box drawn around.
Nevertheless, here are some tips on how to design your PostScript styles. It is strongly recommended to use `gray.pro' or `color.pro' as a template.
There are two PostScript instructions you might want to use in your new PostScript prologue:
setgray
setrgbcolor
@pack uses two upper 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.
We strongly suggest our readers not to start from scratch, but to copy one of the available styles (see the result of `a2ps --list-features'), to drop it in one of @pack directories (say `$HOME/.a2psrc', and to patch it until you like it.
Here, we will start from `color.pro', trying to give it a funky look.
Say you want the keywords to be in Helvetica, drawn in a flashy pink on a light green. And strong keywords, in Times Bold Italic in brown on a soft Hawaïan sea green (you are definitely a fine art amateur).
Then you need to look for `k' and `K':
%Face: Keyword Courier /k { false BG 0 0 0.9 FG fc setfont Show } bind def %Face: Keyword_strong Courier-Bold /K { false BG 0 0 0.8 FG fcb setfont Show } bind def
and turn it into:
%Face: Keyword Helvetica /k { 0.2 1 0.2 true BG 1 0.2 1 FG fh setfont Show } bind def %Face: Keyword_strong Times_boldItalic /K { 0.4 0.2 0 true BG 0.5 1 1 FG fte setfont Show } bind def
Waouh! It looks great!
A bit trickier: let change the way the line numbers are printed.
First, let's look for the font definition:
%%BeginSetup % The font for line numbering /f# /Helvetica findfont bfs .6 mul scalefont def %%EndSetup
Let it be in Times, twice bigger than the body font.
%%BeginSetup % The font for line numbering /f# /Times findfont bfs 2 mul scalefont def %%EndSetup
How about its foreground color?
% Function print line number (<string> # -) /# { gsave sx cw mul 2 div neg 0 rmoveto f# setfont 0.8 0.1 0.1 FG c-show grestore } bind def
Let it be blue. Now you know the process: just put `0 0 1' as
FG
arguments.