|
|
coherent
nroff Command nroff
Text-formatting language
nnrrooffff [_o_p_t_i_o_n ...] [_f_i_l_e ...]
nnrrooffff is the COHERENT text-formatter and text-formatting
language. By embedding commands within files of text, you can
instruct nnrrooffff to format text, create paragraphs, subheadings,
headers, footers, and in general perform all tasks required to
format text for the printed page or for screen display.
nnrrooffff is designed to be used with character-display terminals or
monospace printers. The related program ttrrooffff performs typeset-
quality formatting, suitable for printing on the Hewlett-Packard
LaserJet printer or any printer for which the PostScript language
has been implemented. ttrrooffff's formatting language is a superset
of that used by nnrrooffff. Text that you have encoded for formatting
by nnrrooffff will work with ttrrooffff, but the reverse is not always
true. See the Lexicon entry on ttrrooffff for information that
applies to ttrrooffff alone.
***** nroff Input *****
nnrrooffff processes each _f_i_l_e, or the standard input if none is
specified, and prints the formatted result on the standard
output. The input must contain formatting instructions as well
as the text to be processed.
Basic nnrrooffff commands provide for such things as setting line
length, page length, and page offset, generating vertical and
horizontal motions, indentation, filling and adjusting output
lines, and centering. The great flexibility of nnrrooffff lies in its
acceptance of user-defined macros to control almost all
formatting. For example, the formation of paragraphs, header and
footer areas, and footnotes must all be implemented by the user
via macros.
The following summarizes the commands and options that can be
used with nnrrooffff. Four types of commands and options are
described: (1) command line options; (2) nnrrooffff's basic commands
(also called _p_r_i_m_i_t_i_v_e_s); (3) escape sequences that can be used
with nnrrooffff; and (4) nnrrooffff's dedicated number registers, and what
information each one keeps.
***** Command-line Options *****
Command-line options may be listed in any order on the command
line. They are as follows:
-dd Debug: print each request before execution. This options is
extremely useful when you are writing new macros.
-ff _n_a_m_e
Write the temporary file in file _n_a_m_e.
COHERENT Lexicon Page 1
nroff Command nroff
-kk Keep: do not erase the temporary file.
-ii Read from the standard input after reading the given _f_i_l_e_s.
-mm_n_a_m_e
Include the macro file /uussrr/lliibb/ttmmaacc._n_a_m_e in the input
stream.
-nn_N Number the first page of output _N.
-rr_a_N Set number register _a to the value _N.
-xx Do not eject to the bottom of the last page when text ends.
Use this option when you wish to use nnrrooffff interactively.
It, too, is useful when debugging macros.
If the environmental variable NNRROOFFFF is set when nnrrooffff is invoked,
its contents are prefixed to list of command-line arguments.
This let you set commonly used options once in the environment,
rather than having to retype them for each invocation of nnrrooffff.
***** Primitives *****
The following gives the basic commands, or _p_r_i_m_i_t_i_v_e_s, that are
built into nnrrooffff. These primitives can be assembled into macros,
or can be written directly into the text of your document.
Commands may begin either with a period `.' or with an
apostrophe; the former causes a break (see .bbrr, below), the
latter does not.
.aabb _m_s_g
Abort: print _m_s_g on the standard error and abort processing.
.aadd [bbccllrr]
Enter adjust mode: that is, insert white space between words
to create right-justified output. bb adjusts for both
margins; this is the default. cc adjusts and centers on the
line. ll adjusts, flush with the left margin. rr adjusts,
flush with the right margin.
.aaff _R _X
Assign format _X to number register _R. The assigned format
may be one of the following:
11 Arabic numerals (default)
ii Lower-case Roman numerals
II Upper-case Roman numerals
aa Lower-case alphabetic characters
AA Upper-case alphabetic characters
.aamm _X_X
Append the following to macro _X_X. Used like .ddee, below.
COHERENT Lexicon Page 2
nroff Command nroff
.aass _X_X
Append the following to string _X_X. Used like .ddss, below.
.bbpp Begin a new page.
.bbrr Break; print any fraction of a line of text that is in the
input buffer before reading new text.
.cc22 _c
Set the no-break control character to _c. With no argument,
reset it to the default apostrophe.
.cccc _c
Set the normal control character to _c. With no argument,
reset it to the default period.
.ccee _N
Center _N lines of text (default, one).
.cchh _X_X _N
Change the location of the trap for macro _X_X to vertical
position _N on the page. Used like command .wwhh, below.
.ccoo _e_n_d_m_a_r_k
Copy input directly to the output until _e_n_d_m_a_r_k is seen. If
no _e_n_d_m_a_r_k is given, copy until another .ccoo is seen.
.ccuu Underline continuously.
.ddaa _X
Divert and append the following text into macro _X. A
diversion is ended by a .ddaa command that has no argument.
.ddee _X
Define macro _X. The macro definition is ended by a line that
contains only two periods ``..''.
.ddii _X
Divert the following text into macro _X. Diversion is ended
by a .ddii command that has no argument.
.ddss _X _v_a_l_u_e
Define string _X to have the given _v_a_l_u_e.
.eecc _c
Set the escape characer to _c. With no argument, reset it to
the default backslash character `\'.
.eell _a_c_t_i_o_n
Execute _a_c_t_i_o_n when the test in an .iiee command fails. This
command must be used with an .iiee command.
.eemm _X_X
Execute macro _X_X when processing is completed.
COHERENT Lexicon Page 3
nroff Command nroff
.eeoo Escape off: turn off special handling of all escape
sequences.
.eevv _N
Change the environment. When followed by 0, 1, 2, the
command _p_u_s_h_e_s that environment; when used without an
argument, the command _p_o_p_s the present environment and
returns to the previous environment.
.eexx Exit from nnrrooffff without further ado.
.ffii Enter fill mode.
.ffll Flush; same as .bbrr.
.fftt _X
Change the current font to _X. nnrrooffff recognizes RR, BB, and II,
for Roman, bold, and italic, respectively.
.iiee _c_o_n_d_i_t_i_o_n _a_c_t_i_o_n
This command tests to see if _c_o_n_d_i_t_i_o_n is true; if true, it
then executes _a_c_t_i_o_n; otherwise, it performs the action
introduced by an .eell primitive. This command must be used
with the .eell command.
.iiff _c_o_n_d_i_t_i_o_n _a_c_t_i_o_n
This command tests to see if _c_o_n_d_i_t_i_o_n is true; if so, then
_a_c_t_i_o_n is executed; otherwise, _a_c_t_i_o_n is ignored. The
command .iiff oo applies if the page number is odd, and the
command .iiff ee applies if the page number is even. The
command .iiff nn applies if the text is processed by nnrrooffff, and
the command .iiff tt applies if the text is processed by ttrrooffff.
The command .iiff ll applies in landscape mode. The command
.iiff pp applies to ttrrooffff PostScript mode. Note that the last
two conditions are unique to the COHERENT implementation of
nnrrooffff, and may not be portable to other implementations.
.iigg _X
Ignore all input until macro ._X is called; if no argument is
given, ignore input until two periods ``..''.
.iinn _N_X
Change the normal indentation to _N units of _X scale. _X can
be uu or ii, for _m_a_c_h_i_n_e _u_n_i_t_s or _i_n_c_h_e_s, respectively. If _N
is used without _X, nnrrooffff assumes the indentation to be given
in number of character-widths (in picas, or tenths of an
inch). Default indentation is zero.
.iitt _N _X_X
Set an input trap to execute macro _X_X after _N input lines
(not counting request lines).
.llcc _c
Set the leader dot character to _c. When nnrrooffff sees the
escape sequence \aa, it fills space to the next tab stop with
COHERENT Lexicon Page 4
nroff Command nroff
the leader dot character. llcc with no argument tells nnrrooffff
to use spaces to fill leaders.
.llll _N_X
Set the line length. Used like the .iinn command, above.
.llss _X
Leave spaces; insert _X vertical spaces after each line of
text. Default is zero.
.lltt _N_X
Length of title. Used like the .iinn command, above.
.nnaa Enter no-adjust mode. Line lengths are not changed.
.nnee _N_X
Confirm that at least _N portions of _X units of measure of
vertical space are needed before the next trap. If this
amount of space is not available, then move the text to the
top of the next page. _X can be ii or vv, for inches or
vertical spaces, respectively. This command is used in
display macros and in paragraph macros to help prevent
widows and orphans.
.nnff Enter no-fill mode; no right justification is performed,
although line lengths are changed to approximate uniform
line length.
.nnhh Turn off hyphenation. nnrrooffff hyphenates according to built-
in algorithms that are correct most of the time, but not
always.
.nnrr _X _N_1 _N_2
Set number register _X to value _N_1; set its default
increment/decrement to _N_2. For example, .nnrr XX 22 33 sets
number register XX to 2, and sets its default increment to 3.
.nnss No-space mode.
.nnxx _f_i_l_e
Terminate processing of the current input file and begin
processing _f_i_l_e instead.
.ppll _N_X
Set the page length to _N. The unit of measure _X can be VV or
ii, for vertical spaces (sixths of an inch) or inches,
respectively. The default unit of measure is vertical
spaces.
.ppnn _N
Set the page number to _N.
.ppoo _N_X
Set the default page offset to _N. The unit of measure _X can
be set to ii, for inches. The default unit of measure is
COHERENT Lexicon Page 5
nroff Command nroff
number of characters.
.rrbb _f_i_l_e
Read binary: read the given _f_i_l_e and copy it directly to the
output without processing.
.rrdd _p_r_o_m_p_t
Read an insertion from the standard input after issuing the
given _p_r_o_m_p_t.
.rrff _X_X _Y_Y
Rename font _X_X as _Y_Y.
.rrmm _X_X
Remove macro or string _X_X.
.rrnn _X_X _Y_Y
Change the name of a macro or string from _X_X to _Y_Y.
.rrrr _X
Remove register _X.
.rrss Restore normal space mode.
.ssoo _f_i_l_e
Open _f_i_l_e, read its contents, and process them. When the
end of _f_i_l_e is reached, resume processing the contents of
the present file.
.sspp [|]_N_X
Space down _N. The unit of measure _X can be ii, for inches,
with the default unit of measure being vertical spaces, or
sixths of an inch. The optional vertical bar `|' indicates
that _N is an absolute value; for example, .sspp |11.55ii means to
move to 1.5 inches below the top of the page, whereas .sspp
11.55ii means to move to 1.5 inches below the present position.
.ttaa _N_X ...
Set the tab to _N. The unit of measure _X can be set to ii, for
inches; the default unit of measure is number of characters,
or tenths of an inch. A tab setting, of course, is for an
absolute, not a relative, value. If more than one tab
setting is defined, the first defines the first tabulation
character on a text line, the second defines the second
tabulation character, etc. Any undefined tabulations are
thrown away.
.ttcc _X _N
Fill any unused space within a tabulation field with the
character _X. If the optional _N is present, it specifies a
width for the character; for example, .ttcc . .11ii fills tabs
with dots spaced one-tenth of an inch apart.
.ttii _N_X
Temporary indent; indent only the next line. Used like the
COHERENT Lexicon Page 6
nroff Command nroff
.iinn command, above.
.ttll '_l_e_f_t'_c_e_n_t_e_r'_r_i_g_h_t'
Set a three-part title, with _l_e_f_t being set flush left,
_c_e_n_t_e_r being centered on the line, and _r_i_g_h_t being set flush
right. Note the use of the apostrophes to separate the
fields; the apostrophes for an undefined field must still be
present, or a syntax error will be generated.
.ttmm _m_e_s_s_a_g_e
Print _m_e_s_s_a_g_e on the standard error device. This is often
used with .iiff or .iiee commands to indicate an error
condition.
.ttrr _x_y
Translate character _x to _y on output.
.uull _N
Underline the next _N lines.
.vvss _N_p
Reset the normal vertical spacing to _N points pp. One point
equals 1/72 of an inch; the default setting is 12 points, or
1/6 of an inch.
.wwhh _N_X _a_c_t_i_o_n
Set a trap to perform _a_c_t_i_o_n when point _N is reached on
every formatted page. If _N is negative, it is measured up
from the bottom of the page. The unit of measure _X may be ii
or vv, for inches or number of vertical lines, respectively;
the default unit of measure is vv.
***** Escape Sequences *****
The following lists nnrrooffff's escape sequences, or commands that
suspend or work around the normal operation of nnrrooffff. All escape
sequences are introduced by the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, normally the
backslash character `\'.
\(_x_x Print special character _x_x, as defined by a .ddcc request.
nnrrooffff reads default special character definitions from file
/uussrr/lliibb/rrooffff/nnrrooffff/ssppeecciiaallss.rr. For example, the escape
sequence \(<= prints the less-than-or-equal-to symbol <_.
\\ Print a backslash character. This can be used to print a
literal backslash character in the output text, or to defer
the interpretation of a macro or string from the time it is
processed to the time that it is called.
\- Print a minus sign.
\& Ignore what is normally a command string.
\$_N Call macro argument _N.
COHERENT Lexicon Page 7
nroff Command nroff
\'' Introduce a comment within your text. All text to the right
of this escape sequence will be ignored by nnrrooffff. This
sequence must read .\'' when used at the beginning of a
line.
\*_S Call string _S.
\*(_S_T
Call string _S_T.
\aa Fill the space to the next tab stop with leader dots
(normally `.').
\ee Print the escape character in the output text.
\ff_X Set font to _X; this can be either RR, II, BB, or PP, for Roman,
_i_t_a_l_i_c, bboolldd, or previous font, respectively.
\hh'[|]_N_X'
Move horizontally by _N units of _X. If _N is positive, move to
the right; if negative, move to the left. The unit of
measure _X may be ii, for inches; the default unit of measure
is character-widths. When the optional vertical bar `|' is
used, move to an absolute position on the line. For example
\hh'|11.55ii' moves to 1.5 inches to the right of the left
margin, whereas \hh'11.55ii' moves 1.5 inches to the right of
the current position.
\ll'_N_X'
Draw a horizontal line _N units of _X long. The unit of
measure _X may be ii, for inches; the default unit of measure
is character-widths.
\LL'_N_X'
Draw a vertical line; used like \ll, above.
\nn_X Read the value of number register _X.
\nn(_X_Y
Read the value of number register _X_Y.
\oo'_c_h_a_r_s'
Overstrike the given _c_h_a_r_s, centered on the widest.
\tt Print a tab.
\vv'_N_X'
Vertical motion; move _N units of _X vertically. If _N is
positive, move down; if negative, move up. The unit of
measure _X may be ii or vv, for inches or vertical spaces
(sixths of an inch), respectively. The default unit of
measure is vv.
\ww'_a_r_g_u_m_e_n_t'
Measure the width of _a_r_g_u_m_e_n_t. For example
COHERENT Lexicon Page 8
nroff Command nroff
\w'stuff and nonsense'
measures the width of the phrase ssttuuffff aanndd nnoonnsseennssee; or
\w'\$1'
measures the width of the first argument passed to a macro,
whatever that argument might happen to be. Therefore, the
command .iinn \ww'\$11' will indent a line by the width of
argument 1.
\XX_d_d Output the character with hexadecimal value _d_d, where _d_d are
two hexadecimal digits.
\zz_c Print character _c with zero width.
\<nneewwlliinnee>
Ignore this <nneewwlliinnee> character.
\{ Begin conditional commands; used after an .iiff, an .iiee, or an
.eell command.
\{\ Begin conditional commands, and ignore the following
carriage return.
\} End conditional commands.
***** Dedicated Number Registers *****
The following lists the number registers that are predefined in
nnrrooffff. You can read or reset these registers to suit the need of
any special formats that you wish to devise.
.$ Number of arguments in a call to a macro.
% Present page number.
ddyy Day of the month, as set by COHERENT.
.ii Present level of indentation.
.ll Present line length.
mmoo Month, as set by COHERENT.
.oo Present page offset.
.pp Page length.
yyrr Year, as set by COHERENT.
***** Printer Configuration *****
nnrrooffff reads several files in directory /uussrr/lliibb/rrooffff/nnrrooffff to
find printer-specific information. It reads special character
COHERENT Lexicon Page 9
nroff Command nroff
definitions from file ssppeecciiaallss.rr. If file ffoonnttss.rr exists, nnrrooffff
reads font information from it; nnrrooffff understands only Roman,
bold and italic fonts, but .rrff requests may define alternative
font names. If file .pprree exists, nnrrooffff copies it at the
beginning of the output. If file .ppoosstt exists, nnrrooffff copies it
at the end of the output. In landscape mode, nnrrooffff looks for
files .pprree_llaanndd and .ppoosstt_llaanndd instead. You can change these
files as desired to include printer-specific commands in nnrrooffff
output.
***** Miscellaneous *****
The -mmss macro package is kept in file /uussrr/lliibb/ttmmaacc.ss. The macros
in this package are more than sufficient for most ordinary text
processing. Beginners should work through this macro package
rather than trying to deal at once with the basic program.
The tutorial to nnrrooffff, which is included with this manual,
provides a detailed introduction to nnrrooffff. Error messages for
nnrrooffff appear in the appendix to this manual.
***** Files *****
/ttmmpp/rrooff* -- Temporary files
/uussrr/lliibb/ttmmaacc.* -- Standard macro packages
/uussrr/lliibb/rrooffff/nnrrooffff/ -- Support files directory
/uussrr/lliibb/rrooffff/nnrrooffff/.pprree -- Output prefix
/uussrr/lliibb/rrooffff/nnrrooffff/.pprree_llaanndd -- Output prefix, landscape mode
/uussrr/lliibb/rrooffff/nnrrooffff/.ppoosstt -- Output suffix
/uussrr/lliibb/rrooffff/nnrrooffff/.ppoosstt_llaanndd -- Output suffix, landscape mode
/uussrr/lliibb/rrooffff/nnrrooffff/ffoonnttss.rr -- Alternative font name definitions
/uussrr/lliibb/rrooffff/nnrrooffff/ssppeecciiaallss.rr -- Special character definitions
***** See Also *****
ccooll, ccoommmmaannddss, ddeerrooffff, mmaann, mmss, ttrrooffff
_n_r_o_f_f, _T_h_e _T_e_x_t-_F_o_r_m_a_t_t_i_n_g _L_a_n_g_u_a_g_e, tutorial
COHERENT Lexicon Page 10
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.