Next: , Previous: , Up: Concepts   [Contents][Index]


2.1 The FWEB processors: FWEAVE and FTANGLE

Following Knuth’s original design, FWEB consists of two processors, FTANGLE and FWEAVE. Both operate on a single source file, say test.web. FTANGLE produces compilable code, say test.c, whereas FWEAVE produces a TeX file, test.tex, that can (in principle) be processed with either TeX or LaTeX. (If a file test.tex already exists, FWEAVE will ask for confirmation before overwriting it if it does not think that the file was created by a previous run of FWEAVE.)

The output file produced by FTANGLE is not intended for human eyes (or for editors!); it is for compiling only. All changes to the code should be made to the web file, since changes made directly to the output file would be overwritten the next time the web source is tangled. In an attempt to discourage messing with FTANGLE’s output file, all unnecessary spaces are deliberately removed.

A common way of integrating FWEB into ones program development is to do all compilations through a make file, into which one puts an extra dependency line that explains how to produce the compilable output file from the web source. For example,

test.c: test.web
        ftangle test

test.o: test.c
        gcc -c test test.c

With this approach, one is not so tempted to edit test.c.

FWEB development is now based on LaTeX; Plain TeX is no longer supported. For detailed descriptions of the LaTeX support, see LaTeX.