CTWILL(1) General Commands Manual CTWILL(1) 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 DESCRIPTION The ctwill program converts a CWEB source document into a TeX file that may be formatted and printed in the usual way. 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. CWEB allows you to prepare a single document containing all the information that is needed both to produce a compilable C/C++ program and to produce a well-formatted document de- scribing the program in as much detail as the writer may desire. The user of CWEB ought to be familiar with TeX as well as C/C++. USAGE The command line should have one, two, or three names on it. The first is taken as the CWEB input file (and .w is added if there is no extension). If there is a second name, it is a change file (and .ch is added if there is no extension). The change file overrides parts of the CWEB file, as described in the documentation. If there is a third name, it overrides the default name of the output file, which is ordinarily the same as the name of the input file (but on the current directory) with the extension .tex. If you just want to change the output file name, but don't have a change file to apply, you can use `-' as the second argument. ctwill is exactly like cweave except that it produces much better documentation, for which you must work much harder. You should run ctwill twice, once to prime the pump and once to get decent answers. Moreover, you must run the output twice through TeX. After tex foo you will have output that looks like final pages except that the entries of mini-indexes won't be alphabetized. The first run produces a weird file called foo.ref. Say ctwill-refsort < foo.ref > foo.sref and then another tex foo will produce alphabetized output. The ctwill-twinx program compiles a master index for a set of related programs that have been processed by ctwill (not by cweave, mind you!). The individual programs should de- fine their names with a line of the form \def\title{NAME}. For your convenience, ctwill- twinx grabs the first "word" in \title and turns it into uppercase form. You should adapt file twinx-startup.tex for the first page of the master index. The mini-indexes list identifiers that are used but not defined on each two-page spread. At the end of each section, ctwill gives TeX a list of identifiers used in that section and information about where they are defined. The current meaning of every identifier is initially \uninitialized. Then ctwill reads the .aux file for your job, if any. Before reading the .aux file, ctwill actually looks for a file called system.bux, which will be read if present. And after foo.aux, a third possibility is foo.bux. The general convention is to put definitions of system procedures such as printf into system.bux, and to put definitions found in specifically foo-ish header files into foo.bux. Like the .aux files, .bux files should contain only @$ specifications. The meaning specified by @$...@> generally has four components: an identifier (followed by space), a program name (enclosed in braces), a section number (followed by space), and a TeX part. A special proofmode is provided so that you can check ctwill's conclusions about cross- references. Run ctwill with the flag +P, and TeX will produce a specially formatted docu- ment (without mini-indexes) in which you can check that your specifications are correct. More details how to use ctwill can be found in the first sections of its source code, re- spectively the change file cweav-twill.ch applicable to the cweave.w source. A complete example with all bells and whistles is described in Mini-Indexes for Literate Programs, pages 225-245 of Knuth's Digital Typography. DIFFERENCES TO ORIGINAL CTWILL The present incarnation of ctwill and its utilities tries hard to be a drop-in replacement for the original package. There are, however, a few differences worth noting: o This version is based on the most recent version of CWEB (4.4). o In TeX Live the utility programs are prefixed with ctwill- and the macro files with ct for technical reasons. o Options --help, --quiet, --verbose, --version, and flags -c, -i, -o, and +lX are new in CWEBbin and TeX Live. o Option +lX is accompanied by example wrapper files for ctwimac.tex and ctproofmac.tex with translated captions for German (+ld). o Option +lX is also accompanied by an extended pdfctwimac.tex for production of PDF out- put with active hyperlinks (+lpdf). o ctwill in TeX Live operates silently by default; use the --verbose option to get the original behavior. o File lookup with the environment variable CWEBINPUTS is extended to permit several, colon-separated, paths; see ENVIRONMENT below. o If properly configured, the main program ctwill is localized with the "GNU gettext util- ities". OPTIONS Options on the command line may be either turned off with `-' (if they are on by default) or turned on with `+' (if they are off by default). In fact, the options are processed from left to right, so a sequence like --verbose -h will only show the banner line (+b) and the progress report (+p), but leave out the happy message (-h). o +b: print banner line on terminal o +h: print success message on completion o +p: print progress report messages o +q/-q: shortcut for -bhp; also --quiet (default) o +v/-v: shortcut for +bhp; also --verbose o -c: ignore temporary output irrespective of changes o -e: do not enclose C/C++ material in \PB{...} o -f: do not force a newline after every C/C++ statement in output o -i: suppress indentation of parameter declarations o -o: suppress separation of declarations and statements o -x: omit indices, section names, table of contents o +P: \input ctproofmac.tex instead of ctwimac.tex o +lX/-lX: use macros for language X as of X{ctwimac|ctproofmac}.tex o +s: print usage statistics o +t: treat typename in a template like typedef o --help: display help message and exit o --version: output version information and exit ENVIRONMENT The environment variable CWEBINPUTS is used to search for the input files, or the system default if CWEBINPUTS is not set. See tex(1) for the details of the searching. To avoid conflicts with other programs that also use the CWEBINPUTS environment, you can be more specific and use CWEBINPUTS_cweb for special requirements in CWEB. If prepared for NLS support, ctwill like ctangle and cweave uses the environment variable TEXMFLOCALEDIR to configure the parent directory where the "GNU gettext utilities" search for translation catalogs. These variables are preconfigured in TeX Live's texmf.cnf. FILES The location of the files mentioned below varies from system to system. Use the kpsewhich utility to find their locations. o ctwimac.tex: The default TeX macros \input in the first line of the output file. o ctproofmac.tex: If ctwill is invoked with the +P option, it will change the first line of the output file to \input ctproofmac.tex. In both cases you can request some prefix X with the +lX option, e.g., +ld will \input dctwimac.tex and +Pld will \input dctproofmac.tex. A special application is the use of option +lpdf that will \input pdfctwimac.tex for production of PDF output with active hy- perlinks. o webfile.bux: Reference definitions to resolve from other modules. o system.bux: Reference definitions to resolve from C/C++ standard library header files like <stdio.h>. Other auxiliary files with references are created automatically by ctwill and the actual index files are created by TeX. o cwebman.tex: The CWEB user manual, available in PDF from CTAN (https://ctan.org/pkg/cweb). SEE ALSO o The CWEB System of Structured Documentation: by Donald E. Knuth and Silvio Levy (hard- copy version of cwebman.tex and the source code listings of common.w, ctangle.w, and cweave.w). o Digital Typography: by D. E. Knuth. o Literate Programming: by D. E. Knuth. o Weaving a Program: by Wayne Sewell. cweb(1), tex(1), cc(1) AUTHORS Don Knuth wrote ctwill based on cweave by Silvio Levy and Knuth. Contemporary development on https://github.com/ascherer/cwebbin. Web2c 2022/dev June 6, 2021 CTWILL(1)
Generated by $Id: phpMan.php,v 4.55 2007/09/05 04:42:51 chedong Exp $ Author: Che Dong
On Apache
Under GNU General Public License
2024-12-12 20:02 @3.145.61.202 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)