Prepares constant-width text for the troff command.
cw [ +t | -t ] [ -d ] [ -f Font ] [ -l Delimiter ] [ -r Delimiter ] [ File ... ]
checkcw [ -l Delimiter ] [ -r Delimiter ] [ File ... ]
The cw command preprocesses any specified troff files containing English-language 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 sign) as one of the input file names. The cw command writes to standard output.
Because output resulting from this command resembles the output of line printers and workstations, use this command to typeset examples of programs and computer output for user manuals and programming text. The cw command produces distinctive output when used with the Times Roman font.
The CW font contains a nonstandard set of characters. Any text typeset with this font requires different character and interword spacing from that used for standard fonts. Therefore, you must use the cw command to preprocess documents that use the CW font.
The CW font contains the following 94 ASCII printing characters:
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 !$%&()`'*+@.,/:;=?[]|-_^~"<>{}#\
This font also contains 11 non-ASCII characters represented by 4-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. The cw command copies them in their entirety onto the output. Thus, you can define the requests as troff macros; in fact, the .CW and .CN macros should be so defined. The five requests are:
The .CW and .CN requests should bracket text that is to be typeset as is, using the CW font. 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 4-character names listed previously. In particular, the cw command causes all . (periods) and ' (apostrophes) at the beginning of lines, and all \ (backslashes) and ligatures (such as fi and ff), to be hidden from the troff command. 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. These requests are meant to enclose words or phrases that are 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 as well as the .CW/.CN pairs are properly balanced. It prints out all lines in the selection with the unmatched delimiters.
Notes:
- The . (period) or \ (backslash)delimiter characters should not be used.
- 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.
- The troff code produced by the cw command is difficult to read.
- The mm macro package and mv macro package contain definitions of .CW and .CN macros that are adequate for most users. If you define your own macros, make sure that the .CW macro starts the troff no-fill (.nf) mode, and the .CN macro restores the fill mode (.fi), if appropriate.
- 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 1 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 column inch.
- Documents that contain CW text can also contain tables and equations. In this case, the order of preprocessing must be the cw command, tbl command, and eqn command. Usually, the tables do not contain CW text, although it is possible to have elements in the table set in the CW font. Ensure that the cw command does not modify the tbl command format information. Attempts to set equations in the CW font are usually unsuccessful.
- 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.
- Some devices such as the IBM 3816 Pageprinter do not have a CW font. You receive a troff can't open /usr/lib/font/devNAME/CW.out message for these devices. The troff command uses the font in font position 3 as the CW font.
Note: This flag is useful only on the command line.
The eqn command, mmt command, tbl command, troff command.
The mm macro package, mv macro package.