cw, checkcw
PURPOSE
Prepares constant-width text for troff.
SYNOPSIS
cw [ -lxx ] [ -rxx ] [ -fn ] [ -t ] [ +t ] [ -d ] [ files ]
checkcw [ -lxx ] [ -rxx ] files
DESCRIPTION
The cw command preprocesses troff files containing text
to be typeset in the constant-width (CW) font. cw reads
standard input if you do not specify a file or if you
specify a -. (minus) as one of the input file names. It
writes its output to standard output.
Since the text that is typeset by cw resembles the output
of line printers and work stations, it can be used to
typeset examples of programs and computer output in user
manuals and programming texts. It has been designed to
be distinctive when used with the Times Roman font.
Because the CW font contains a "nonstandard" set of char-
acters and because text typeset with it requires dif-
ferent character and interword spacing than is used for
"standard fonts," you must use cw to preprocess documents
that use the CW font.
The CW font contains the 94 printing ASCII characters:
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
!$%&()`'*+@.,/:;=?[]|-_^~"<>{}#\
plus eight non-ASCII characters represented by four-
character troff strings (in some cases attaching these
strings to "nonstandard" graphics):
The cw command recognizes five request lines, as well as
user-defined delimiters. The request lines look like
troff macro requests. cw copies them in their entirety
onto the output. Thus, you can define them as troff
macros; in fact, the .CW and .CN macros should be so
defined. The five requests are:
.CW Marks the start of text to be set in
the CW font. This request causes a
break. It can take the same flags
(in the same format) as those avail-
able on the cw command line.
.CN Marks the end of text to be set in
the CW font. This request causes a
break. It can take the same flags
(in the same format) as those avail-
able on the cw command line.
.CD Changes the delimiters and/or set-
tings of other flags. It can take
the same flags (in the same format)
as those available on the cw command
line. The purpose of this request is
to allow the changing of flags other
than at the beginning of a document.
.CP argument-list Concatenates all the arguments
(delimited like troff macro argu-
ments), with the odd-numbered argu-
ments set in the CW font and the
even-numbered ones in the prevailing
font.
.PC argument-list Acts the same as .CP, except the
even-numbered (rather than odd-
numbered) arguments are set in CW
font.
The .CW and .CN requests should bracket text that is to
be typeset in the CW font "as is." Normally, cw operates
in the transparent mode. In that mode, every character
between .CW and .CN request lines represents itself,
except for the .CD request and the special four-character
names listed previously. In particular, cw arranges for
all periods (.) and apostrophes (') at the beginning of
lines, and all backslashes (\) and ligatures (fi, ff, and
so on) to be hidden from troff. The transparent mode can
be turned off by using the -t flag, in which case normal
troff rules apply. In either case, cw hides from the
user the effect of the font changes generated by the .CW
and .CN requests.
You can also use the -l and -r flags to define delimiters
with the same function as the .CW and .CN requests. They
are meant to enclose words or phrases that are to be set
in CW font in the running text. cw treats text between
delimiters as it does text bracketed by .CW/.CN pairs,
with one exception. Spaces within .CW/.CN pairs have the
same width as other CW characters, while spaces within
delimited text are half as wide, so they have the same
width as spaces in the prevailing text. Delimiters have
no special meaning inside .CW/.CN pairs.
The checkcw command checks that left and right delim-
iters, and the .CW/.CN pairs are properly balanced. It
prints out all lines in the section with the unmatched
delimiters.
Notes:
1. It is unwise to use . (period) or \ (backslash) as
delimiter characters.
2. Certain CW characters do not combine well with
certain Times Roman characters, for example, the
spacing between a CW "&" (ampersand) followed by a
Times Roman comma (,). In such cases, using troff
half-and quarter-space requests can help.
3. The troff code produced by cw is difficult to read.
4. The mm and mv macro packages contain definitions of
.CW and .CN macros that are adequate for most use.
If you define your own, make sure that the .CW macro
invokes the troff no-fill (.nf) mode, and the .CN
macro restores the fill mode (.fi), if appropriate.
5. When set in running text, the CW font is meant to be
set in the same point size as the rest of the text.
In displayed matter, on the other hand, it can often
be profitably set one point smaller than the pre-
vailing point size. The CW font is sized so that,
when it is set in 9-point, there are 12 characters
per inch.
6. Documents that contain CW text may also contain
tables and equations. If this is the case, the order
of preprocessing must be cw, tbl, and eqn. Usually,
the tables will not contain any CW text, although it
is possible to have elements in the table set in the
CW font. Care must be taken that cw does not modify
the tbl format information. Attempts to set
equations in the CW font are not likely to be
pleasing or successful.
7. In the CW font, overstriking is most easily accom-
plished with backspaces. Because spaces (and there-
fore backspaces) are half as wide between delimiters
as inside .CW/.CN pairs, two backspaces are required
for each overstrike between delimiters.
FLAGS
-d Displays the current flag settings on the
standard error output in the form of troff
comment lines. This flag is meant for debug-
ging.
-ffont Replaces font with the cw font (default=3,
replacing the bold font). -f5 is commonly
used for formatters that allow more than four
simultaneous fonts.
This flag is useful only on the command line.
-ldelim Sets the left delimiter as the one-or two-
character string delim The left delimiter is
undefined by default.
-rdelim Set the right delimiter as delim The right
delimiter is undefined by default. The left
and right delimiters may (but need not) be
different.
-t Turns the transparent mode off.
+t Turns the transparent mode on (this is the
default).
FILES
/usr/lib/font/ftCW CW font-width table.
RELATED INFORMATION
The following commands: "eqn, neqn, checkeq," "mmt,
checkmm," "tbl," and "troff."
The mm and mv miscellaneous facilities in AIX Operating
System Technical Reference.