Scheme\TeX{} provides simple support for literate programming in any
dialect of Lisp. Originally created for use with Scheme, it defines a
new source file format which may be used to produce \LaTeX{} input or
Lisp code.
Scheme\TeX{} source lines are divided into text and code. Lines of code
start with a line beginning with ``('', and continue until the line
containing the matching ``)''. The remaining lines are text lines,
and they are treated as comments.
When producing a \LaTeX{} document, both the text lines and the code
lines are copied into the document source file, but the code lines are
surrounded by a pair of formatting commands (\verb-\begin{astyped}-
and \verb-\end{astyped}-). This \LaTeX{} environment formats the code
as written, in typewriter font. A Lisp comment within a code line is
formatted in an \verb-\mbox- in Roman font. A Scheme\TeX{} style
command should include the \verb-astyped- style option, so that the
\verb-astyped- environment is available. An example:
\begin{center}
\verb-\documentstyle[astyped]{article}-
\end{center}
Scheme\TeX{} was designed under the constraint that code lines must be
unmodified Lisp code, and text lines must be unmodified \LaTeX{} code.
Text editors with support for Lisp and \LaTeX{}, such as Emacs, may be
used for Scheme\TeX{} code much as they are used for Lisp code and
\LaTeX{} code.
Some users prefer not modifying the \verb-LOAD- function in their Lisp
system. To support those users, the rule that text lines must be
unmodified \LaTeX{} code has been relaxed. Text lines that begin with
``;'' are copied without the initial ``;''.
\newpage{}
\section*{Usage under Unix}
The extension for Scheme\TeX{} files is ``\verb;.st;''. For T, the
file \verb;st.t; contains two programs used to obtain code from an
``\verb;.st;'' file. The T expression
\begin{center}
\verb;(LOAD-ST; {\it filespec environment\/}{\tt )}
\end{center}
loads a Scheme\TeX{} file by creating a T source file if no T source
file exists which is younger than the Scheme\TeX{} file. The T source
file is then loaded using the usual \verb;LOAD; procedure.
\verb;COMPILE-ST; is like \verb;LOAD-ST; except it compiles the file
instead of loading it.
A \LaTeX{} file is produced from a file with the ``\verb;.st;''
extension using the Unix shell command
\begin{center}
{\tt st} {\it file-name}
\end{center}
It will produce a file with the ``\verb;.tex;'' extension. The
obvious make file is in Figure~\ref{makefile}.
\begin{figure}
\begin{verbatim}
SUFFIXES: .dvi .tex .st