Go to the first, previous, next, last section, table of contents.

User Guide

This chapter is devoted to people who don't know yet @pack{}: we try to give a soft and smooth introduction to the most useful features. For a reference manual, see section Invocation.


@pack is a program that takes an ASCII file (i.e., human readable), and makes a PostScript file out of it. PostScript is a page description language, in other words, it is programming language, in which 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.

How to print

To print a file `doc.txt', just give it to @pack{}: the default setting should be the one you'd like:

a2ps doc.txt

@pack sent the file `doc.txt' to the default printer, writing two columns of text on a single face of the sheet. Indeed, by default @pack does as if you had given the option `-2', standing for two virtual pages.

Say now that you want to print the C file `bar.c', and its header `foo.h', on 4 virtual pages, and save it into the file `foobar.ps'. Just hit:

a2ps foo.h bar.c -4ofoobar.ps

The option `-4' tells @pack to make four virtual pages: two rows by two columns. The option `-o' (which is the short version of `--output=foobar.ps') specifies the output file. Since the option `-4' does not have arguments, it can be grouped behind the same `-' as the one for `-o'. The other way round would fail, producing a file `foobar.ps4'.

Note too that the options may be before or after the files, it does not matter.

If you send `foobar.ps' to a printer, you'll discover that the keywords were highlighted, that the strings and comments have a different face. Indeed, @pack is a pretty-printer: if ever it knows the (programming) language in which your file is written, it will try to make it nice looking on the paper.

But too bad: `foo.h' is only one virtual page long, and `bar.c' takes three. Moreover, the comments are essential in those files. And even worse: the system's default printer is out of ink. Thanks god, precious options may help you:

a2ps -A4 foo.h bar.c --prologue=gray -P lw

Here `-A' is used to specify that you Allow @pack to put several files on the same sheet, `-P lw' means to print on the printer named `lw', and finally, the long option `--prologue' asked to use one of the alternative printing styles of @pack{}. There are other available prologues (see option `--prologue' in section Input), and you can even design yours (see section Designing prologues).

If @pack did not have the behavior expected, this may be because of the default settings given by your system administrator. Checking those default values is easy:

gargantua ~ $ a2ps --list-options
General information on a2ps:
  version             = 4.7.20
  library path        = /inf/soft/infthes/demaille/share/a2ps
  verbosity level     = 0
  default paper         = A4
  layout per page       = 2 x 1 (portrait)
  borders               = yes
  compact mode          = yes
  inside margin         = 0
More stuff deleted here

Remember that the on line help is always available. Moreover, if your screen is small, you may pipe it into more. Just trust this:

a2ps --help | more

Important parameters

Many things are parametrizable in @pack{}, but two things are just essential to make sure everything goes right:

The paper
Make sure that the paper @pack uses is the same as your printer (See section Sheets, option `--media').
The encoding
Make sure that the encoding @pack uses is the same as the standard alphabet in your country (See section Input, option `--encoding').

Both values may be checked with `a2ps --list-options'.


@pack provides some Native Language Support, that is speaking your mother tongue. It uses two special features wrt non-English languages: on the one hand, the interface between you and it, and on the other hand, the format of the dates and times.

To use these features, you may set your environment variable LANG to the standard code representing your language:


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 which awk and such.

So if you just want messages and time format to be localized, then define:

set LC_TIME=fr
export LC_TIME

Note that the `make install' must have been done in order to have NLS support.

Interfacing with other programs

Here are some tips on how to use @pack with other programs.


Once you are in elm, hit o to enter in the options edition menu, hit p to edit the printer command, and enter `a2ps -2gEmail %s'. The option `-g' is given because there are some special escapes that @pack understands, and replaces with the correct character.


Jan Chrillesen @email{jan@chrillesen.dk} suggests us how to use @pack with the Pine mail-reader. Add the following to `.pinerc' (ofcourse you can put it in `pine.conf' as well):

# Your printer selection
printer=a2ps -Email -R -1 -P Your-printer

# Special print command if it isn't one of the standard printers
personal-print-command=a2ps -Email -R -1 -P Your-printer

Go to the first, previous, next, last section, table of contents.