tangle - translate WEB to Pascal


tangle [ options ] webfile[.web][ changefile[.ch]]


This manual page is not meant to be exhaustive. The complete documentation for this version of \*(TX can be found in the info file or manual "Web2C: A TeX implementation" .


tangle program converts a \*(WB source document into a Pascal program that may be compiled in the usual way with the on-line Pascal compiler (e.g.,

R 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 \*(WB 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 \*(WB must be familiar with both \*(TX and Pascal. \*(WB 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 either one or two names on it. The first is taken as the \*(WB file (and .webis added if there is no extension). If there is another name, it is a change file (and .chis added if there is no extension). The change file overrides parts of the \*(WB file, as described in the \*(WB system documentation.

The output files are a Pascal file and a string pool file, whose names are formed by adding .pand .poolrespectively to the root of the \*(WB file name.


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.


    .rb Print help message and exit.

  • --length  number
        .rb Compare only the first numbercharacters of identifiers when checking for collisions. The default is 32, the original

tangle used 7.


    .rb When checking for collisions between identifiers, honor the settings of the

R --lowercase ,

R --mixedcase ,

R --uppercase , and

--underline options. This is the default.


    .rb Convert all identifiers to lowercase.


    .rb Retain the case of identifiers. This is the default.


    .rb When checking for collisions between identifiers, strip underlines and convert all identifiers to uppercase first.


    .rb Retain underlines (also known as underscores) in identifiers.


    .rb Convert all identifiers to uppercase. This is the behaviour of the original

R tangle .


    .rb Print version information and exit.


R pc (1),

R pxp (1) (for formatting

tangle output when debugging),

R tex (1).

Donald E. Knuth, "The \*(WB System of Structured Documentation" .

Donald E. Knuth, "Literate Programming" , Computer Journal

R 27 , 97-111, 1984.

Wayne Sewell, "Weaving a Program" , Van Nostrand Reinhold, 1989, ISBN 0-442-31946-0.

Donald E. Knuth, "\*(OX: The Program"(Volume B of "Computers and Typesetting" ), Addison-Wesley, 1986, ISBN 0-201-13437-3.

Donald E. Knuth, "\*(MF: 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 \*(WB programs.

There is an active Internet electronic mail discussion list on the subject of literate programming; send a subscription request to DEBUTINLINE FININLINEto join.


\*(WB 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 \*(WB. The system was originally ported to Unix at Stanford by Howard Trickey, and at Cornell by Pavel Curtis.