TANGLE(1)
π TANGLE(1) β the manual page, bestie edition β¨
okay so this is the tangle page from the General Commands Manual, and honestly? it's giving legendary. sit down, grab a strawberry drink π, we're learning literate programming.
πΈ NAME πΈ
tangle, otangle β translate a literate programming WEB to Pascal. yes that's the whole vibe. π
π¦ SYNOPSIS π¦
tangle [options] webfile[.web] [{changefile[.ch]|-} [outfile[.p]]]
β¨ DESCRIPTION β¨
So tangle takes a WEB literate programming source document and converts it into a Pascal program. That's it. That's the job. π
And like, besides feeding the Pascal output straight into a Pascal compiler, these days the Pascal output is often translated to C instead β that's literally how the TeX family of programs gets compiled in TeX Live. iconic behavior fr fr.
The WEB language lets you make one single document containing everything you need to produce both a compilable Pascal program and a well-formatted document describing the program in as much detail as the writer could ever want. no cap. But heads up: the user of WEB must be familiar with both TeX and Pascal (iykyk). WEB also gives you a relatively simple β though adequate β macro facility that lets a Pascal program be written in small modules, in an arbitrary order. chaos, but make it structured π .
The command line should have one, two or three filenames on it. The first one is taken as the WEB file, and .web gets added if there's no extension. π«Ά
If a second filename is given, it's taken as a change file, and .ch gets added if there's no extension. The change file overrides parts of the WEB file, as described in the WEB system documentation. If there's no second filename, there's no change file. periodt.
If a third filename is given, it's taken as the Pascal output file, and .p gets added if there's no extension. Wanna specify an output file with no change? Use - for the second argument β that means an empty change file, and listen, it is not stdin, bestie, do not come for me π. If no third filename is given, the name of the Pascal file is formed by adding .p to the root of the WEB file name.
The output file gets packed into lines of 72 characters or less, and the only concession to readability is terminating lines at semicolons when that can be done conveniently. minimal effort, maximum slay.
If the WEB program uses the built-in string handling feature (double-quoted strings), then a second output file appears: a string pool file, whose name is always formed by adding .pool to the root of the Pascal file name. π§
Now, the otangle variant supports a larger character range. It was written for the Omega project β the first TeX supporting Unicode β which is now provided as the aleph(1) descendant program. ancestral queen energy π
π OPTIONS π
See tex(1) for details of command-line parsing.
β οΈ Some of these options may render the output unsuitable for processing by a Pascal compiler. be brave, but be aware.
--helpβ Print help message and exit. the classic.--length numberβ Compare only the first number characters of identifiers when checking for collisions. The default is32; the original tangle used7. glow-up tbh.--looseβ When checking for collisions between identifiers, honor the settings of the--lowercase,--mixedcase,--uppercase, and--underlineoptions. This is the default. chill vibes.--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. no mercy π€--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.
And then the plot twist: otangle supports only the --help and --version options. that's it, that's the whole menu for that one π
π ENVIRONMENT π
These programs look for the input files using the environment variable WEBINPUTS. If it's not set, it uses the system default. See the Kpathsea manual at https://tug.org/kpathsea for the details of the searching β the receipts are all there, bestie π
π SEE ALSO π
- Donald E. Knuth, The WEB System of Structured Documentation.
https://mirrors.ctan.org/info/knuth-pdf/web/webman.pdf - Donald E. Knuth, LiterateProgramming, CSLI Lecture Notes, no. 27.
https://www-cs-faculty.stanford.edu/~knuth/lp.html - Donald E. Knuth, TeX: The Program (Volume B of Computers & Typesetting).
- Donald E. Knuth, Metafont: The Program (Volume D of Computers & Typesetting).
These latter two are by far the largest extant examples of WEB programs. like, absolutely massive. respect the grind. π₯
- Literate programming topic on CTAN:
https://ctan.org/topic/litprog - Package page on CTAN:
https://ctan.org/pkg/tangle - Section in the Web2c manual:
https://tug.org/texinfohtml/web2c.html#tangle-invocation - Typeset source code for all the original Stanford WEB programs:
https://ctan.org/pkg/knuth-pdf
π AUTHORS π
WEB was designed by Donald E. Knuth, based on an earlier system called DOC (implemented by Ignacio Zabala), inspired by considerable earlier work β notably Pierre-Arnoul de Marneffe's concept of "holon programming" (https://github.com/holon-scribe/holon-programming). the lore is deep πβ¨
The updates for Omega were written by John Plaice and Yannis Haralambous.
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.
Public discussion list and bug reports: https://lists.tug.org/tex-k
and that's the whole page, bestie!! π«Ά this one ships as Web2C 2026, dated 25 January 2026 β so like, shoutout to the entire Web2C 2026 era for keeping tangle alive and thriving. go write something literate. you ate. π
π¦ where this page comes from
- alpine 3.24: texmf-dist-binextra-doc 2026.0-r0 Β· LPPL-1.0 AND LPPL-1.1 AND LPPL-1.2 AND LPPL-1.3a AND LPPL-1.3c AND GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms