[6-6] Formatting code in LaTeX (WEB and other literate programming tools)

SLaTeX is a R4RS-compliant Scheme program that allows you to write
program code "as is" in your LaTeX or TeX source.  It is particularly
geared to the programming languages Scheme and Common Lisp, and has
been tested in Chez Scheme, Common Lisp, MIT C Scheme, Elk, Scheme->C,
SCM and UMB Scheme on Unix; and MIT C Scheme and SCM on MSDOS.  The
formatting of the code includes assigning appropriate fonts to the
various tokens in the code (keywords, variables, constants, data), at
the same time retaining the proper indentation when going to the
non-monospace (non-typewriter) provided by TeX.  SLaTeX comes with two
databases that recognize the standard keywords/variables/constants of
Scheme and Common Lisp respectively.  These can be modified by the
user using easy TeX commands.  In addition, the user can inform SLaTeX
to typeset arbitrary identifiers as specially suited TeX expressions
(i.e., beyond just fonting them).  The code-typesetting program SLaTeX
is available by anonymous ftp from 
   cs.rice.edu:/public/dorai/slatex23.tar.gz
Send bug reports to dorai@cs.rice.edu.

SchemeWEB provides simple support for literate programming in Lisp.
SchemeWEB version 2.0 is a Unix filter that allows you to generate
both Lisp and LaTeX code from one source file.  The generated LaTeX
code formats Lisp programs in typewriter font obeying the spacing in
the source file.  Comments can include arbitrary LaTeX commands.
SchemeWEB was originally developed for the Scheme dialect of Lisp, but
it can easily be used with most other dialects.  Version 2.0 is
available in the Scheme Repository as
   cs.indiana.edu:/pub/scheme-repository/new/schemeweb.sh
or in the Comprehensive TeX Archive Network (CTAN) in the directory
   ftp.shsu.edu:/tex-archive/web/schemeweb 

LiSP2TeX is a system that allows easy insertions of Scheme, or Lisp,
code towards TeX files. The originality of LiSP2TeX is that it
extracts Scheme definitions from the files where they appear and wraps
them appropriately within TeX macros for insertion into the
documentation file. LiSP2TeX decorrelates writing documentation from
programming: it is therefore possible to separately develop programs
and documentations and to merge them at the end to produce up to date
final documents. LiSP2TeX also has some pretty-printing capabilities
to produce denotations full of greek letters. It is available by
anonymous ftp from ftp.inria.fr:/INRIA/Projects/icsla/.

See also ftp.cs.cmu.edu:/user/ai/lang/lisp/code/tools/user_man/.

The Literate Programming FAQ lists a number of alternatives, both
language-independent and Lisp-specific. The Literate Programming FAQ
is posted once a quarter to the comp.literate.programming newsgroup
and is available by anonymous ftp from rtfm.mit.edu. A copy may also be
requested by sending an email message to fileserv@shsu.edu
   sendme litprog.faq
in the body of the message.
Go Back Up

Go To Previous

Go To Next