tangle - Man Page
translate WEB to Pascal
Synopsis
tangle [options] webfile[.web] [{changefile[.ch]|-} [outfile[.p]]]
Description
This manual page is not meant to be exhaustive. The complete documentation for this version of T E X can be found in the info file or manual Web2C: A TeX implementation.
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 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.
The WEB language 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 T E X and Pascal. WEB also provides a relatively simple, although adequate, macro facility that permits a Pascal program to be written in small easily-understood modules.
The command line should have one, two or three names on it. The first is taken as the WEB file (and .web is added if there is no extension). If there is second 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 WEB system documentation.
If there is a third name, it is the Pascal output file (and .p is added if there is no extension). In this case you can specify an empty change file with '-' as the second argument. Otherwise the name of the Pascal file is formed by adding .p to the root of the WEB file name.
An optional second output file is a string pool file, whose name is formed by adding .pool to the root of the Pascal file name.
Options
This version of tangle understands the following options. Note that some of these options may render the output unsuitable for processing by a Pascal compiler.
- --help
Print help message and exit.
- --length number
Compare only the first number characters of identifiers when checking for collisions. The default is 32, the original tangle used 7.
- --loose
When checking for collisions between identifiers, honor the settings of the --lowercase, --mixedcase, --uppercase, and --underline options. This is the default.
- --lowercase
Convert all identifiers to lowercase.
- --mixedcase
Retain the case of identifiers. This is the default.
- --strict
When checking for collisions between identifiers, strip underlines and convert all identifiers to uppercase first.
- --underline
Retain underlines (also known as underscores) in identifiers.
- --uppercase
Convert all identifiers to uppercase. This is the behaviour of the original tangle.
- --version
Print version information and exit.
Environment
The environment variable WEBINPUTS is used to search for the input files, or the system default if WEBINPUTS is not set. See tex(1) for the details of the searching.
See Also
pc(1), pxp(1) (for formatting tangle output when debugging), tex(1).
Donald E. Knuth, The WEB System of Structured Documentation.
Donald E. Knuth, Literate Programming, Computer Journal 27, 97-111, 1984.
Wayne Sewell, Weaving a Program, Van Nostrand Reinhold, 1989, ISBN 0-442-31946-0.
Donald E. Knuth, TEX: The Program (Volume B of Computers and Typesetting), Addison-Wesley, 1986, ISBN 0-201-13437-3.
Donald E. Knuth, Metafont: The Program (Volume D of Computers and Typesetting), Addison-Wesley, 1986, ISBN 0-201-13438-1.
These last two are by far the largest extant examples of WEB programs.
There is an active Internet electronic mail discussion list on the subject of literate programming; send a subscription request to litprog-request@shsu.edu to join.
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 originally ported to Unix at Stanford by Howard Trickey, and at Cornell by Pavel Curtis.
Referenced By
mft(1), pooltype(1), twill(1), weave(1).
The man page otangle(1) is an alias of tangle(1).