---
name: "weave"
section: "1"
platform: "linux"
package: "texlive-doc"
version: "2026.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/weave"
---

# weave(1)

translate a literate programming WEB to TeX

## NAME

weave - translate a literate programming WEB to TeX

## SYNOPSIS

**weave** \[**-p**\] \[**-x**\] *webfile*\[**.web**\] \[{*changefile*\[**.ch**\]\|**-**} \[*outfile*\[**.tex**\]\]\]

## DESCRIPTION

The **weave** program creates a TeX file for viewing a literate program written in WEB. It takes appropriate care of typographic details like page layout and the use of indentation, italics, boldface, etc., and it supplies extensive cross-index information that it gathers automatically.

The output TeX file name is formed by adding **.tex** to the root of the WEB file name or from the third argument. In this case you can specify '-' as an empty change file. These non-option command line arguments are handled in the same way as [**tangle**(1)](/tangle/1.md).

There are several macros that probably should be redefined by the programmer at the beginning of the WEB file. It is a good idea to set *\\title* to the name of the program. To output only those modules which are changed, one can say *\\let\\maybe=\\iffalse*, usually as the first change in the change file.

## OPTIONS

See [**tex**(1)](/tex/1.md) for details of command-line parsing.

- **-p**

  says to *\\input pwebmac.tex*, a variant on the default *webmac.tex* which is more suited for PDF output.

- **-x**

  says to omit the index, module name list, and table of contents pages. (A *CONTENTS.tex* file will still be written when the TeX file is processed, however, unless some macros in *webmac.tex* are redefined.)

The standard **-help** and **-version** options are also supported.

## ENVIRONMENT

The programs look for the input files using the environment variable WEBINPUTS. If it is not set, it uses the system default. See the Kpathsea manual at https://tug.org/kpathsea for the details of the searching.

## BUGS

The table of contents appears at the end of the output.

## FILES

- *$TEXMFMAIN/tex/plain/knuth-lib/webmac.tex*

  TeX macros used by **weave** output.

- *$TEXMFMAIN/tex/plain/pwebmac/pwebmac.tex*

  Alternative TeX macros used for PDF output.

- *CONTENTS.tex*

  Temporary file created by **weave** for the table of contents.

## SEE ALSO

[**tangle**(1)](/tangle/1.md) for references, authors, and other information.

Public discussion list and bug reports: https://lists.tug.org/tex-k
