cw, checkcw(1,C) AIX Commands Reference cw, checkcw(1,C)
-------------------------------------------------------------------------------
cw, checkcw
PURPOSE
Prepares constant-width text for troff files.
SYNTAX
+-- +t --+ +--- -f3 ----+ +------------------------+ +--------+
cw ---| one of |---| +--------+ |---| |---| |---|
| +----+ | +-| -d |-+ +- -l delim -- -r delim -+ +- file -+
+-| +t |-+ ^| -ffont || ^ |
| -t | |+--------+| +------+
+----+ +----------+
+------------------------+
checkcw ---| |-- file --|
+- -l delim -- -r delim -+ ^ |
+------+
Note: This command does not have MBCS support.
DESCRIPTION
The cw command preprocesses troff files containing text to be typeset in the
constant-width (CW) font. The cw command 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 the cw command 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 characters and because text
typeset with it requires different character and inter-word spacing than is
used for "standard fonts", you must use the cw command to preprocess documents
that use the CW font.
The CW font contains the 94 printing ASCII characters:
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
!$%&()`'*+@.,/:;=?[]|-_^~"<>{}#\
Processed November 8, 1990 cw, checkcw(1,C) 1
cw, checkcw(1,C) AIX Commands Reference cw, checkcw(1,C)
plus eight non-ASCII characters represented by four-character troff strings (in
some cases attaching these strings to "nonstandard" graphics).
+---------------------------------+
|Figure 3. Non-ASCII Characters |
| in CW Font |
+---------------+-------+---------+
|Character | Symbol| Troff |
| | | Name |
+---------------+-------+---------+
|"Cents" sign | = | \(ct |
+---------------+-------+---------+
|EBCDIC "not" | ^ | \(no |
|sign | | |
+---------------+-------+---------+
|Left arrow | <- | \(<- |
+---------------+-------+---------+
|Right arrow | -> | \(-> |
+---------------+-------+---------+
|Down arrow | v | \(da |
+---------------+-------+---------+
|Vertical | ' | \(fm |
|single quote | | |
+---------------+-------+---------+
|Control-shift | | \(dg |
|sign | | |
+---------------+-------+---------+
|Visible space | | \(sq |
|sign | | |
+---------------+-------+---------+
|Hyphen | - | \(hy |
+---------------+-------+---------+
|Up arrow | ^ | \(ua |
+---------------+-------+---------+
|Home arrow | | \(lh |
+---------------+-------+---------+
The cw command recognizes five request lines, as well as user-defined
delimiters. The request lines look like troff macro requests. The cw command
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 available 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 available on the cw command
line.
Processed November 8, 1990 cw, checkcw(1,C) 2
cw, checkcw(1,C) AIX Commands Reference cw, checkcw(1,C)
.CD Changes the delimiters and/or settings 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
arguments), with the odd-numbered arguments set in the CW
font and the even-numbered ones in the prevailing font.
.PC argument-list Acts the same as the .CP request, 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, the cw command 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, the cw command 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, the cw command 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. The cw command
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 delimiters 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 the cw command 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
Processed November 8, 1990 cw, checkcw(1,C) 3
cw, checkcw(1,C) AIX Commands Reference cw, checkcw(1,C)
.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 prevailing 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
the cw command 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 accomplished with backspaces.
Because spaces (and therefore 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 debugging.
-ffont Replaces font with the cw font (default=3, replacing the bold
font). The -f5 flag 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
See the following commands: "eqn, neqn, checkeq," "mmt, mant, mvt," "tbl,"
and "troff."
Processed November 8, 1990 cw, checkcw(1,C) 4
cw, checkcw(1,C) AIX Commands Reference cw, checkcw(1,C)
See the mm and mv miscellaneous facilities in AIX Operating System Technical
Reference.
Processed November 8, 1990 cw, checkcw(1,C) 5