WEB(1L)

NAME
tangle, weave - translate WEB to Pascal and/or TeX

SYNOPSIS
tangle webfile[.web] [changefile[.ch]]
weave [ -x ] webfile[.web] [changefile[.ch]]

DESCRIPTION
The tangle program converts a WEB source document into a Pascal program that may be compiled in the usual way with the on-line Pascal compiler (e.g., pc(1)). The output file is all in lower case and packed into lines of 72 characters or less, with the only concession to readability being the termination of lines at semicolons when this can be done conveniently.

WEB is a new language that Don Knuth has created, which allows you to prepare a single document containing all the information that is needed both to produce a compilable Pascal program and to produce a well-formatted document describing the program in as much detail as the writer may desire. The user of WEB must be familiar with both TeX and Pascal.

WEB provides a relatively simple, although adequate, macro facility that permits a Pascal program to be written in small easily-understood modules. The tangle program assembles these modules into a usable Pascal program.

The command line should have either one or two names on it. The first is taken as the WEB file (and .web is added if there is no extension). If there is another name, it is a change file (and .ch is added if there is no extension). The change file overrides parts of the WEB file, as described in the documentation.

The output files are a Pascal file and a string pool file, whose names are formed by adding .p and .pool respectively to the root of the WEB file name.

The weave program is used to create a TeX file for viewing the WEB program. It takes appropriate care of typographic details like page layout and the use of indentation, italics, boldface, etc.,and it supplies extensive cross-index information that it gathers automatically. The command line arguments are the same as for tangle except for the options. The -x option says to omit the index, module name list, and table of contents pages. (A CONTENTS.tex file will still be written, however, unless some default macros are redefined.)

The output TeX file name is formed by using .tex as the extension of the WEB file name.

There are several macros in webmac.tex that probably should be redefined by the user at the beginning of the WEB file. It is a good idea to set \title to the name of the program. And, to cause output of only changed modules, one can say \let\maybe=\iffalse (usually as the first change in the change file).

FILES
/home/tex/dist/lib/webmac.tex TeX macros used by weave output.

SEE ALSO
The WEB System of Structured Documentation and
Literate Programming by D.E. Knuth.
Weaving a Program by Wayne Sewell
tex(1), pc(1)
pxp(1) (for formatting tangle output when debugging)
pooltype(1) (for symbolic listing of the pool file)
TeX: The Program
METAFONT: The Program are by far the largest extant examples of WEB programs.

AUTHORS
WEB was designed by Donald E. Knuth, based on an earlier system called DOC (implemented by Ignacio Zabala). The tangle and weave programs are themselves written in WEB. The system was ported to Unix at Stanford by Howard Trickey, and at Cornell by Pavel Curtis. This version combines their work.