TWILL(1)
π TWILL(1) β okay bestie, let's talk β¨
So this is the General Commands Manual page for TWILL(1), and honestly? It's giving "niche but iconic." Sit down, grab a boba, and let me tell you about twill. π§
πΈ NAME πΈ
twill, twill-refsort β translate a literate programming WEB to TeX with mini-indexes. No cap, that's literally the whole job description. π
β¨ SYNOPSIS β¨
twill [-x] webfile[.web] [{changefile[.ch]|-} [outfile[.tex]]]
twill-refsort < reffile.ref > sreffile.sref
Look at those two little lines. They're small but they're doing the most. π«Ά
π¦ DESCRIPTION π¦
Okay so. The twill program is used to create a TeX file for viewing a literate program written in WEB. That's the vibe. The output TeX file name is formed by adding .tex to the root of the file name β like, it's not gonna invent a whole new name for itself, it's just gonna slap .tex on the end. Periodt.
twill is like weave(1), but it also supplies cross-reference information in the form of mini-indexes for each spread of pages, for identifiers used on that spread, and a master index at the end that it gathers automatically. So it's weave's cooler sibling who actually keeps track of where everything is. π
Now here's the part where I need you to listen, bestie, because this is the classic "read the instructions" moment:
You need to run twill twice β once to prime the pump and once to get decent answers. Moreover, you must run the output twice through TeX. Yes. Twice. Both things. Twice. π
Let's walk it through for a program foo.web:
- After a first
tex fooyou will have output that looks like final pages except that the entries of mini-indexes will not be alphabetized. Not broken! Just not sorted yet. Chill. - The first run produces an auxiliary file named
foo.ref. - Run
twill-refsort <foo.ref >foo.srefand then anothertex foowill produce alphabetized output. Slay. π
π OPTIONS π
Okay, the options section is short and sweet and honestly kind of a "see also" situation:
That's it. That's the section. Go read those two, they've got you. π
π ENVIRONMENT π
- The environment variable
WEBINPUTSis used to search for the input files. If it is not set, it uses the system default. See the Kpathsea manual athttps://tug.org/kpathseafor the details of the searching.
So like β if it can't find your files, check WEBINPUTS first. iykyk. π₯
π BUGS π
- The table of contents file,
CONTENTS.tex, is generated but ignored (unless macros intwimac-web.texare redefined).
Not me generating a file just to ignore it π β it's there, it exists, it's doing nothing, and it's fine. Just know that if you want CONTENTS.tex to actually do something, you gotta redefine macros in twimac-web.tex. Otherwise it's decorative. π
π FILES π
$TEXMFMAIN/tex/plain/cweb/cwebbin/twimac-web.texβ TeX macros used bytwilloutput.
That's the file that makes the magic happen. Go look at it if you're curious. π
β SEE ALSO β
tangle(1)for references, authors, and other information about WEB in general.- Donald E. Knuth, Mini-indexes for literate programs, Software-Concepts and Tools, 15(1):2-11, 1994.
https://arxiv.org/abs/cs/9401102 - CTWILL program source, section 287:
https://mirror.ctan.org/info/knuth-pdf/cweb/ctwill.pdfβ and just so you know, not all features described there are available in the oldertwillsystem, but you will get the gist. π - Public discussion list and bug reports:
https://lists.tug.org/tex-k
And that's the whole page, bestie. Written by the Web2C crew, Web2C 2026 edition, dated 3 February 2026 β so it's got that fresh-off-the-press energy, fr fr. Go sort your refs and run your TeX twice. I believe in you. π«Άπ
π¦ 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-1017 on : a language model's rewrite of the original, under its terms