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


PreScript has been designed in conjunction with @pack{}. Since bold sequences, special characters etc. were implemented in @pack{}, we thought it would be good to allow direct access to those features: PreScript became an input language for @pack{}, where special font treatments are specified in a LaTeX-like syntax.

The main advantages for using PreScript are:

It can be a good candidate for generation of PostScript output (syntactic pretty-printers, generation of various reports etc.).


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, though it is perfectly legal in LaTeX, the following line will be badly interpreted by @pack{}:

\textbf{Problems using \textit{PreScript} instead of \LaTeX}

The correct way to write this in PreScript is

\textbf{Problems using} \textbi{PreScript} \textbf{instead of} \LaTeX.

Everything from an unquoted % to the end of line is ignored (comments).

PreScript commands

Structure commands

These commands required arguments.

Used to specify the title of a section, subsection or subsubsection.
write text in bold, italic, bold-italic, Times. Default font is Courier. These instructions are said to be hard-coded. They may be removed in a future definition of PreScript. The following instructions are prefered.
Highlight lightly/strongly the given text. Should be used only for a couple of adjacent words.
The text is given a special face. The text may be removed if option `--strip' is used.
text should be considered as a definition, or an important point in the structure of the whole text.
Write text with string's face (i.e. font Times).
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 section Printed symbols).
Use text as header (footer) for the current page. At run time, to override the defined headers and footers by these dynamic headers, the option `--dynamic-header' must be set. If several headers or footers are defined on the same page, the last one is taken into account.

Printed symbols

There is a big menagerie of symbols. To get a list, it is suggested to print @pack{}'s report about PreScript using the command line:

a2ps --report=PreScript | a2ps -EPreScript

The reader should be aware that LaTeX is more demanding about special symbols. Most of them must be in so-called math mode, which means that the command must be inside $ signs. For instance, though

If \forall x \in E, x \in F then E \subseteq F.

is perfectly legal in PreScript, it should be written

If $\forall x \in E, x \in F$ then $E \subseteq F$.

for LaTeX. Since in PreScript every `$' is discarded (unless quoted by a `\'), the second form is also admitted.

Special characters

`$' is ignored in PreScript for compatibility with LaTeX, and `%' introduces a comment. Hence they are the only symbols which have to be quoted by a `\'. The following characters should also be quoted to produce good LaTeX files, but are accepted by PreScript: `_', `&', `#'.

Note that inside a command, like \textbf, the quotation mechanism does not work in PreScript (\textrm{#$%} writes `#$%') though LaTeX still requires quotation. Hence whenever special characters or symbols are introduced, they should be at the outer most level.


There is a general mechanism to avoid special sequences from being interpreted: the commands `\verb+quoted string+', where `+' can be any symbol in `+', `!', `|', `#', `='.

Differences with LaTeX

LaTeX commands ignored in PreScript

Some LaTeX commands have no equivalent in PreScript, but are simply skipped at compilation time (if immediately followed by an end-of-line):

Everything between `%%PreScript:skip' and `%%PreScript:piks' will be ignored in PreScript, so that there can be inserted command definitions for LaTeX exclusively.

Commands available in PreScript but not in LaTeX

The commands `\textbi' (for bold-italic) and `\textsy' (for symbol) do not exist in LaTeX. They should be defined in the preamble:


There is no way in PreScript to 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'. @pack 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

\magicbf{1.}\item First line
\magicbf{2.}\item Second line

will be treated the same way both in PreScript and LaTeX.

`header' and `\footer', are not understood by LaTeX.

Some symbols are available in PreScript but not in LaTeX:

`\Alpha', `\apple', `\Beta', `\carriagereturn', `\Chi', `\Epsilon', `\Eta', `\florin', `\Iota', `\Kappa', `\Mu', `\Nu', `\Omicron', `\omicron', `\radicalex', `\register', `\Rho', `\suchthat', `\Tau', `\therefore', `\trademark', `\varUpsilon', `\Zeta'.

A good example of a LaTeX preamble to get LaTeX to compile PreScript files is given by the report of @pack{}.


PreScript and @pack can be used for one-the-fly formating. For instance, on the `passwd' file:

ypcat passwd |
 awk -F: \
   '{print "\textbf{" $5 "} (" $1 ") \rightarrow\textit{" $7 "}"}'\
 | a2ps -Epre -P

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