# man > ctwill(1)

---
type: CommandReference
command: ctwill
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `ctwill foo.w` — Produce TeX file `foo.tex` from CWEB source
- `ctwill foo.w bar.ch` — Apply change file `bar.ch`
- `ctwill foo.w - out.tex` — Override output file name without change file
- `ctwill +P foo.w` — Use proofmode (`\input ctproofmac.tex`)
- `ctwill --verbose foo.w` — Get original banner/progress messages
- `ctwill-refsort < foo.ref > foo.sref` — Alphabetize mini-index entries
- `ctwill-twinx foo.tex bar.tex > index.tex` — Compile master index for multiple programs
- `ctwill +lpdf foo.w` — Use `pdfctwimac.tex` for PDF output with hyperlinks

## Name

**ctwill**, **ctwill-refsort**, **ctwill-twinx** — translate CWEB to TeX with mini-indexes

## Synopsis

`ctwill` [_options_] _webfile_[.w] [{_changefile_[.ch]|-} [_outfile_[.tex]]]

`ctwill-refsort` < _indexfile_.ref > _indexfile_.sref

`ctwill-twinx` _outfile_.tex [_outfile_.tex ...] > index.tex

## Options

Options are processed left to right; `+` turns on, `-` turns off.

- `+b` — Print banner line on terminal
- `+h` — Print success message on completion
- `+p` — Print progress report messages
- `+q` / `-q` — Shortcut for `-bhp`; also `--quiet` (default)
- `+v` / `-v` — Shortcut for `+bhp`; also `--verbose`
- `-c` — Ignore temporary output irrespective of changes
- `-e` — Do not enclose C/C++ material in `\PB{...}`
- `-f` — Do not force a newline after every C/C++ statement
- `-i` — Suppress indentation of parameter declarations
- `-o` — Suppress separation of declarations and statements
- `-x` — Omit indices, section names, table of contents
- `+P` — `\input ctproofmac.tex` instead of `ctwimac.tex` (proofmode)
- `+lX` / `-lX` — Use macros for language _X_ (e.g., `+ld` for German, `+lpdf` for PDF with hyperlinks)
- `+s` — Print usage statistics
- `+t` — Treat `typename` in template like `typedef`
- `--help` — Display help message and exit
- `--version` — Output version information and exit

## Examples

The following commands illustrate typical workflow:

shell
# First pass: generate .tex and .ref files
ctwill foo.w

# Alphabetize mini-index references
ctwill-refsort < foo.ref > foo.sref

# Second pass (after re-TeXing with .sref)
ctwill foo.w

# Compile master index for multiple programs
ctwill-twinx prog1.tex prog2.tex > index.tex

# Use proofmode to check cross-references
ctwill +P foo.w

# Use PDF with active hyperlinks
ctwill +lpdf foo.w
## See Also

- [cweb(1)](https://www.chedong.com/phpMan.php/man/cweb/1/markdown) — The CWEB system
- [tex(1)](https://www.chedong.com/phpMan.php/man/tex/1/markdown) — TeX typesetting
- [cc(1)](https://www.chedong.com/phpMan.php/man/cc/1/markdown) — C/C++ compiler