


      OCW(1)                        (DWB)                        OCW(1)



      NAME
           ocw, checkcw - prepare constant-width text for troff

      SYNTAX
           cw [ -lxx ] [ -rxx ] [ -fn ] [ -t ] [ +t ] [ -d ] [ files ]

           checkcw [ -lxx ] [ -rxx ] files

      DESCRIPTION
           Ocw is a preprocessor for otroff (see nroff(1)) input files
           that contain text to be typeset in the constant-width (CW)
           font.  This preprocessor is not necessary for users of the
           device-independent troff(1), nor is it compatible with it.

           Text typeset with the CW font resembles the output of
           terminals and of line printers.  This font is used to
           typeset examples of programs and of computer output in user
           manuals, programming texts, etc.  (An earlier version of
           this font was used in typesetting The C Programming Language
           by B. W. Kernighan and D. M. Ritchie.) It has been designed
           to be quite distinctive (but not overly obtrusive) when used
           together with the Times Roman font.

           Because the CW font contains a ``non-standard'' set of
           characters and because text typeset with it requires
           different character and inter-word spacing than is used for
           ``standard'' fonts, documents that use the CW font must be
           preprocessed by ocw.

           The CW font contains the 94 printing ASCII characters:

                abcdefghijklmnopqrstuvwxyz
                ABCDEFGHIJKLMNOPQRSTUVWXYZ
                0123456789
                !$ &()`'*+@.,/:;= ?[]|-_^~"<>{}#\

           plus eight non-ASCII characters represented by four-
           character otroff names (in some cases attaching these names
           to ``non-standard'' graphics):

                Character      Symbol    Troff name
                Cents sign          /    \(ct
                EBCDIC ``not'' sign _    \(no
                Left arrow          <-   \(<-
                Right arrow         ->   \(->
                Down arrow          v    \(da
                Vertical single quote    '    \(fm
                Control-shift indicator  -    \(dg
                Visible space indicator  []   \(sq
                Hyphen              -    \(hy

           The hyphen is a synonym for the unadorned minus sign (-).



      Page 1                                          (73 A2 02MT REV1)






      OCW(1)                        (DWB)                        OCW(1)



           Certain versions of ocw recognize two additional names:
           \(ua for an up arrow and \(lh for a diagonal left-up (home)
           arrow.

           Ocw recognizes five request lines, as well as user-defined
           delimiters.  The request lines look like otroff(1) macro
           requests, and are copied in their entirety by ocw onto its
           output; thus, they can be defined by the user as otroff
           macros; in fact, the .CW and .CN macros should be so defined
           (see HINTS below).  The five requests are:

           .CW  Start of text to be set in the CW font; .CW causes a
                break; it can take precisely the same options, in
                precisely the same format, as are available on the ocw
                command line.

           .CN  End of text to be set in the CW font; .CN causes a
                break; it can take the same options as are available on
                the ocw command line.

           .CD  Change delimiters and/or settings of other options;
                takes the same options as are available on the ocw
                command line.

           .CP arg1 arg2 arg3 ... argn
                All the arguments (which are delimited like otroff
                macro arguments) are concatenated, with the odd-
                numbered arguments set in the CW font and the even-
                numbered ones in the prevailing font.

           .PC arg1 arg2 arg3 ... argn
                Same as .CP, except that the even-numbered arguments
                are set in the CW font and the odd-numbered ones in the
                prevailing font.

           The .CW and .CN requests are meant to bracket text (e.g., a
           program fragment) that is to be typeset in the CW font ``as
           is.''Normally, ocw operates in the transparent mode.  In
           that mode, except for the .CD request and the nine special
           four-character names listed in the table above, every
           character between .CW and .CN request lines stands for
           itself.  In particular, ocw arranges for periods (.) and
           apostrophes (') at the beginning of lines, and backslashes
           (\) everywhere to be ``hidden'' from otroff.  The
           transparent mode can be turned off (see below), in which
           case normal otroff rules apply; in particular, lines that
           begin with . and ' are passed through untouched (except if
           they contain delimiters-see below).  In either case, ocw
           hides the effect of the font changes generated by the .CW
           and .CN requests; ocw also defeats all ligatures in the CW
           font.




      Page 2                                          (73 A2 02MT REV1)






      OCW(1)                        (DWB)                        OCW(1)



           The only purpose of the .CD request is to allow the changing
           of various options other than just at the beginning of a
           document.

           The user can also define delimiters.  The left and right
           delimiters perform the same function as the .CW/.CN
           requests; they are meant, however, to enclose CW ``words''
           or ``phrases'' in running text (see example under BUGS
           below).  Ocw treats text between delimiters in the same
           manner as text enclosed by .CW/.CN pairs, except that, for
           aesthetic reasons, spaces and backspaces inside .CW/.CN
           pairs have the same width as other CW characters, while
           spaces and backspaces between delimiters are half as wide,
           so they have the same width as spaces in the prevailing text
           (but are not adjustable).  Font changes due to delimiters
           are not hidden.

           Delimiters have no special meaning inside .CW/.CN pairs.

           The options are:

           -lxx The one- or two-character string xx becomes the left
                delimiter; if xx is omitted, the left delimiter becomes
                undefined, which it is initially.

           -rxx Same for the right delimiter.  The left and right
                delimiters may (but need not) be different.

           -fn  The CW font is mounted in font position n; acceptable
                values for n are 1, 2, and 3 (default is 3, replacing
                the bold font).  This option is only useful at the
                beginning of a document.

           -t   Turn transparent mode off.

           +t   Turn transparent mode on (this is the initial default).

           -d   Print current option settings on file descriptor 2 in
                the form of otroff comment lines.  This option is meant
                for debugging.

           Ocw reads the standard input when no files are specified (or
           when - is specified as the last argument), so it can be used
           as a filter.  Typical usage is:

                ocw files | otroff ...

           Checkcw checks that left and right delimiters, as well as
           the .CW/.CN pairs, are properly balanced.  It prints out all
           offending lines.





      Page 3                                          (73 A2 02MT REV1)






      OCW(1)                        (DWB)                        OCW(1)



      HINTS
           Typical definitions of the .CW and .CN macros meant to be
           used with the mm(5) macro package:

                .de CW
                .DS I
                .ps 9
                .vs 10.5p
                .ta 16m/3u 32m/3u 48m/3u 64m/3u 80m/3u 96m/3u ...
                ..
                .de CN
                .ta .5i 1i 1.5i 2i 2.5i 3i ...
                .vs
                .ps
                .DE
                ..

           At the very least, the .CW macro should invoke the otroff
           no-fill (.nf) mode.  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 displayed definitions of .CW and .CN above
           are one point smaller than the running text on this page).
           The CW font is sized so that, when it is set in 9-point,
           there are 12 characters per inch.

           Documents that contain CW text may also contain tables
           and/or equations.  When used, the order of preprocessing
           should be:  ocw, tbl, and eqn.  Usually, the tables
           contained in such documents will not contain any CW text,
           although it is possible to have elements of the table set in
           the CW font; care must be taken that tbl(1) format
           information not be modified by ocw.  Equations can not be
           successfully set in the CW font.

           In the CW font, overstriking is most easily accomplished
           with backspaces:  letting \(<- represent a backspace,d\(<-
           \(<-\(dg yields-.  (Because backspaces are half as wide
           between delimiters as inside .CW/.CN pairs (see above), two
           backspaces are required for each overstrike between
           delimiters.)

      FILES
           /usr/lib/font/ftCW  CW font-width table

      SEE ALSO
           eqn(1), nroff(1), tbl(1), mm(5), mv(5).

      WARNINGS
           To print text preprocessed by ocw the typesetter must be
           equipped with the CW font.



      Page 4                                          (73 A2 02MT REV1)






      OCW(1)                        (DWB)                        OCW(1)



      BUGS
           Do not use periods (.), backslashes ( \ ), or double quotes
           (") as delimiters, or as arguments to .CP and .PC.  Certain
           CW characters don't concatenate gracefully with certain
           Times Roman characters, e.g., a CW ampersand (&) followed by
           a Times Roman comma(,); in such cases, judicious use of
           otroff half- and quarter-spaces (\| and \^) is beneficial,
           e.g., one should use _&_\^, (rather than just plain _&_,) to
           obtain &, (assuming that _ is used for both delimiters).
           Nroff already produces constant-width output, so don't use
           CW with nroff.  The output of CW is hard to read.












































      Page 5                                          (73 A2 02MT REV1)



