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:
PreScript
files do compile with LaTeX)
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
commandsThese commands required arguments.
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.
`$' 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 `+', `!', `|', `#', `='.
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.
The commands `\textbi' (for bold-italic) and `\textsy' (for symbol) do not exist in LaTeX. They should be defined in the preamble:
%%PreScript:skip \newcommand{\textbi}[1]{\textbf{\textit{#1}}} \newcommand{\textsy}[1]{#1} %%PreScript:piks
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
\begin{enumerate} \magicbf{1.}\item First line \magicbf{2.}\item Second line \end{enumerate}
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