PRESCRIPT(4)

NAME
prescript - LaTeX-like language for Postscript generation

DESCRIPTION
prescript has been designed in conjunction with a2ps. a2ps is an ASCII to PostScript converter with the ability to pretty print sources for different languages. Hence, bold sequences, special characters etc. were implemented in a2ps. To allow the direct access to those features, prescript became an input language for a2ps, were special font treatments are specified in a LaTeX-like syntax.

The main advantages for using prescript are: it is very simple, it is LaTeX compatible (that is, correctly written prescript files do compile with LaTeX); 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 (syntactical pretty-printers, generation of various reports etc.).

SYNTAX
Every command name begins by 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 a2ps:
\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).

  Structure commands

\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}
    text is written in bold, italic, bold-italic, and in times.

\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.

  Special symbols
There is a big menagerie of symbols. To get its list, it is suggested to print a2ps's report about prescript using the command line:
a2ps -Wprescript | a2ps -kprescript The reader should be aware that LaTeX is more exigent about the 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 symbol 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 (\texrm{#$%} writes #$%) though LaTeX still requires quotation. Hence whenever special characters or symbols are introduced, they should be at the outer most level.

  Quotation
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):

    \begin{document} \end{document} \begin{itemize} \end{itemize} \begin{enumerate} \end{enumerate} \begin{description} \end{description}

Everything between
%%prescript:skip
and
%%prescript:piks
will be ignored in prescript, so that there can lay 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:
%%prescript:skip
\newcommand{\textbi}[1]{\textbf{\it #1}}
\newcommand{\textsy}[1]{#1}
%%prescript:piks There is no way in prescript to get an automatic numbering. There are no equivalent to the LaTeX environment enumerate. But every command beginning by \text is doubled by a command beginning by \magic. a2ps behave the same way on both families of command. Hence, if one specifies that arguments of that 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. Some symbols are available in prescript but not in LaTeX:

    \alex \Alpha \apple \Beta \carriagereturn \Chi \Epsilon \Eta \florin \Iota \Kappa \Mu \Nu \Omicron \omicron \radic \register \Rho \suchthat \Tau \therefore \trademark \varUpsilon \Zeta

A good example of a LaTeX preamble to get LaTeX compile prescript files is given by the report of a2ps.

EXAMPLES
prescript and a2ps 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 -kpre -t -P

SEE ALSO
me(7), ms(7), tex(1), latex(1), a2ps(1), troff(1), nroff(1).

AUTHOR
Akim Demaille (demaille@inf.enst.fr).