|
|
1.1 root 1:
2:
3: nroff Command nroff
4:
5:
6:
7:
8: Text-formatting language
9:
10: nnrrooffff [_o_p_t_i_o_n ...] [_f_i_l_e ...]
11:
12: nnrrooffff is the COHERENT text-formatter and text-formatting
13: language. By embedding commands within files of text, you can
14: instruct nnrrooffff to format text, create paragraphs, subheadings,
15: headers, footers, and in general perform all tasks required to
16: format text for the printed page or for screen display.
17:
18: nnrrooffff is designed to be used with character-display terminals or
19: monospace printers. The related program ttrrooffff performs typeset-
20: quality formatting, suitable for printing on the Hewlett-Packard
21: LaserJet printer or any printer for which the PostScript language
22: has been implemented. ttrrooffff's formatting language is a superset
23: of that used by nnrrooffff. Text that you have encoded for formatting
24: by nnrrooffff will work with ttrrooffff, but the reverse is not always
25: true. See the Lexicon entry on ttrrooffff for information that
26: applies to ttrrooffff alone.
27:
28: ***** nroff Input *****
29:
30: nnrrooffff processes each _f_i_l_e, or the standard input if none is
31: specified, and prints the formatted result on the standard
32: output. The input must contain formatting instructions as well
33: as the text to be processed.
34:
35: Basic nnrrooffff commands provide for such things as setting line
36: length, page length, and page offset, generating vertical and
37: horizontal motions, indentation, filling and adjusting output
38: lines, and centering. The great flexibility of nnrrooffff lies in its
39: acceptance of user-defined macros to control almost all
40: formatting. For example, the formation of paragraphs, header and
41: footer areas, and footnotes must all be implemented by the user
42: via macros.
43:
44: The following summarizes the commands and options that can be
45: used with nnrrooffff. Four types of commands and options are
46: described: (1) command line options; (2) nnrrooffff's basic commands
47: (also called _p_r_i_m_i_t_i_v_e_s); (3) escape sequences that can be used
48: with nnrrooffff; and (4) nnrrooffff's dedicated number registers, and what
49: information each one keeps.
50:
51: ***** Command-line Options *****
52:
53: Command-line options may be listed in any order on the command
54: line. They are as follows:
55:
56: -dd Debug: print each request before execution. This options is
57: extremely useful when you are writing new macros.
58:
59: -ff _n_a_m_e
60: Write the temporary file in file _n_a_m_e.
61:
62:
63:
64: COHERENT Lexicon Page 1
65:
66:
67:
68:
69: nroff Command nroff
70:
71:
72:
73: -kk Keep: do not erase the temporary file.
74:
75: -ii Read from the standard input after reading the given _f_i_l_e_s.
76:
77: -mm_n_a_m_e
78: Include the macro file /uussrr/lliibb/ttmmaacc._n_a_m_e in the input
79: stream.
80:
81: -nn_N Number the first page of output _N.
82:
83: -rr_a_N Set number register _a to the value _N.
84:
85: -xx Do not eject to the bottom of the last page when text ends.
86: Use this option when you wish to use nnrrooffff interactively.
87: It, too, is useful when debugging macros.
88:
89: If the environmental variable NNRROOFFFF is set when nnrrooffff is invoked,
90: its contents are prefixed to list of command-line arguments.
91: This let you set commonly used options once in the environment,
92: rather than having to retype them for each invocation of nnrrooffff.
93:
94: ***** Primitives *****
95:
96: The following gives the basic commands, or _p_r_i_m_i_t_i_v_e_s, that are
97: built into nnrrooffff. These primitives can be assembled into macros,
98: or can be written directly into the text of your document.
99: Commands may begin either with a period `.' or with an
100: apostrophe; the former causes a break (see .bbrr, below), the
101: latter does not.
102:
103: .aabb _m_s_g
104: Abort: print _m_s_g on the standard error and abort processing.
105:
106: .aadd [bbccllrr]
107: Enter adjust mode: that is, insert white space between words
108: to create right-justified output. bb adjusts for both
109: margins; this is the default. cc adjusts and centers on the
110: line. ll adjusts, flush with the left margin. rr adjusts,
111: flush with the right margin.
112:
113: .aaff _R _X
114: Assign format _X to number register _R. The assigned format
115: may be one of the following:
116:
117: 11 Arabic numerals (default)
118: ii Lower-case Roman numerals
119: II Upper-case Roman numerals
120: aa Lower-case alphabetic characters
121: AA Upper-case alphabetic characters
122:
123:
124: .aamm _X_X
125: Append the following to macro _X_X. Used like .ddee, below.
126:
127:
128:
129:
130: COHERENT Lexicon Page 2
131:
132:
133:
134:
135: nroff Command nroff
136:
137:
138:
139: .aass _X_X
140: Append the following to string _X_X. Used like .ddss, below.
141:
142: .bbpp Begin a new page.
143:
144: .bbrr Break; print any fraction of a line of text that is in the
145: input buffer before reading new text.
146:
147: .cc22 _c
148: Set the no-break control character to _c. With no argument,
149: reset it to the default apostrophe.
150:
151: .cccc _c
152: Set the normal control character to _c. With no argument,
153: reset it to the default period.
154:
155: .ccee _N
156: Center _N lines of text (default, one).
157:
158: .cchh _X_X _N
159: Change the location of the trap for macro _X_X to vertical
160: position _N on the page. Used like command .wwhh, below.
161:
162: .ccoo _e_n_d_m_a_r_k
163: Copy input directly to the output until _e_n_d_m_a_r_k is seen. If
164: no _e_n_d_m_a_r_k is given, copy until another .ccoo is seen.
165:
166: .ccuu Underline continuously.
167:
168: .ddaa _X
169: Divert and append the following text into macro _X. A
170: diversion is ended by a .ddaa command that has no argument.
171:
172: .ddee _X
173: Define macro _X. The macro definition is ended by a line that
174: contains only two periods ``..''.
175:
176: .ddii _X
177: Divert the following text into macro _X. Diversion is ended
178: by a .ddii command that has no argument.
179:
180: .ddss _X _v_a_l_u_e
181: Define string _X to have the given _v_a_l_u_e.
182:
183: .eecc _c
184: Set the escape characer to _c. With no argument, reset it to
185: the default backslash character `\'.
186:
187: .eell _a_c_t_i_o_n
188: Execute _a_c_t_i_o_n when the test in an .iiee command fails. This
189: command must be used with an .iiee command.
190:
191: .eemm _X_X
192: Execute macro _X_X when processing is completed.
193:
194:
195:
196: COHERENT Lexicon Page 3
197:
198:
199:
200:
201: nroff Command nroff
202:
203:
204:
205: .eeoo Escape off: turn off special handling of all escape
206: sequences.
207:
208: .eevv _N
209: Change the environment. When followed by 0, 1, 2, the
210: command _p_u_s_h_e_s that environment; when used without an
211: argument, the command _p_o_p_s the present environment and
212: returns to the previous environment.
213:
214: .eexx Exit from nnrrooffff without further ado.
215:
216: .ffii Enter fill mode.
217:
218: .ffll Flush; same as .bbrr.
219:
220: .fftt _X
221: Change the current font to _X. nnrrooffff recognizes RR, BB, and II,
222: for Roman, bold, and italic, respectively.
223:
224: .iiee _c_o_n_d_i_t_i_o_n _a_c_t_i_o_n
225: This command tests to see if _c_o_n_d_i_t_i_o_n is true; if true, it
226: then executes _a_c_t_i_o_n; otherwise, it performs the action
227: introduced by an .eell primitive. This command must be used
228: with the .eell command.
229:
230: .iiff _c_o_n_d_i_t_i_o_n _a_c_t_i_o_n
231: This command tests to see if _c_o_n_d_i_t_i_o_n is true; if so, then
232: _a_c_t_i_o_n is executed; otherwise, _a_c_t_i_o_n is ignored. The
233: command .iiff oo applies if the page number is odd, and the
234: command .iiff ee applies if the page number is even. The
235: command .iiff nn applies if the text is processed by nnrrooffff, and
236: the command .iiff tt applies if the text is processed by ttrrooffff.
237: The command .iiff ll applies in landscape mode. The command
238: .iiff pp applies to ttrrooffff PostScript mode. Note that the last
239: two conditions are unique to the COHERENT implementation of
240: nnrrooffff, and may not be portable to other implementations.
241:
242: .iigg _X
243: Ignore all input until macro ._X is called; if no argument is
244: given, ignore input until two periods ``..''.
245:
246: .iinn _N_X
247: Change the normal indentation to _N units of _X scale. _X can
248: 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
249: is used without _X, nnrrooffff assumes the indentation to be given
250: in number of character-widths (in picas, or tenths of an
251: inch). Default indentation is zero.
252:
253: .iitt _N _X_X
254: Set an input trap to execute macro _X_X after _N input lines
255: (not counting request lines).
256:
257: .llcc _c
258: Set the leader dot character to _c. When nnrrooffff sees the
259: escape sequence \aa, it fills space to the next tab stop with
260:
261:
262: COHERENT Lexicon Page 4
263:
264:
265:
266:
267: nroff Command nroff
268:
269:
270:
271: the leader dot character. llcc with no argument tells nnrrooffff
272: to use spaces to fill leaders.
273:
274: .llll _N_X
275: Set the line length. Used like the .iinn command, above.
276:
277: .llss _X
278: Leave spaces; insert _X vertical spaces after each line of
279: text. Default is zero.
280:
281: .lltt _N_X
282: Length of title. Used like the .iinn command, above.
283:
284: .nnaa Enter no-adjust mode. Line lengths are not changed.
285:
286: .nnee _N_X
287: Confirm that at least _N portions of _X units of measure of
288: vertical space are needed before the next trap. If this
289: amount of space is not available, then move the text to the
290: top of the next page. _X can be ii or vv, for inches or
291: vertical spaces, respectively. This command is used in
292: display macros and in paragraph macros to help prevent
293: widows and orphans.
294:
295: .nnff Enter no-fill mode; no right justification is performed,
296: although line lengths are changed to approximate uniform
297: line length.
298:
299: .nnhh Turn off hyphenation. nnrrooffff hyphenates according to built-
300: in algorithms that are correct most of the time, but not
301: always.
302:
303: .nnrr _X _N_1 _N_2
304: Set number register _X to value _N_1; set its default
305: increment/decrement to _N_2. For example, .nnrr XX 22 33 sets
306: number register XX to 2, and sets its default increment to 3.
307:
308: .nnss No-space mode.
309:
310: .nnxx _f_i_l_e
311: Terminate processing of the current input file and begin
312: processing _f_i_l_e instead.
313:
314: .ppll _N_X
315: Set the page length to _N. The unit of measure _X can be VV or
316: ii, for vertical spaces (sixths of an inch) or inches,
317: respectively. The default unit of measure is vertical
318: spaces.
319:
320: .ppnn _N
321: Set the page number to _N.
322:
323: .ppoo _N_X
324: Set the default page offset to _N. The unit of measure _X can
325: be set to ii, for inches. The default unit of measure is
326:
327:
328: COHERENT Lexicon Page 5
329:
330:
331:
332:
333: nroff Command nroff
334:
335:
336:
337: number of characters.
338:
339: .rrbb _f_i_l_e
340: Read binary: read the given _f_i_l_e and copy it directly to the
341: output without processing.
342:
343: .rrdd _p_r_o_m_p_t
344: Read an insertion from the standard input after issuing the
345: given _p_r_o_m_p_t.
346:
347: .rrff _X_X _Y_Y
348: Rename font _X_X as _Y_Y.
349:
350: .rrmm _X_X
351: Remove macro or string _X_X.
352:
353: .rrnn _X_X _Y_Y
354: Change the name of a macro or string from _X_X to _Y_Y.
355:
356: .rrrr _X
357: Remove register _X.
358:
359: .rrss Restore normal space mode.
360:
361: .ssoo _f_i_l_e
362: Open _f_i_l_e, read its contents, and process them. When the
363: end of _f_i_l_e is reached, resume processing the contents of
364: the present file.
365:
366: .sspp [|]_N_X
367: Space down _N. The unit of measure _X can be ii, for inches,
368: with the default unit of measure being vertical spaces, or
369: sixths of an inch. The optional vertical bar `|' indicates
370: that _N is an absolute value; for example, .sspp |11.55ii means to
371: move to 1.5 inches below the top of the page, whereas .sspp
372: 11.55ii means to move to 1.5 inches below the present position.
373:
374: .ttaa _N_X ...
375: Set the tab to _N. The unit of measure _X can be set to ii, for
376: inches; the default unit of measure is number of characters,
377: or tenths of an inch. A tab setting, of course, is for an
378: absolute, not a relative, value. If more than one tab
379: setting is defined, the first defines the first tabulation
380: character on a text line, the second defines the second
381: tabulation character, etc. Any undefined tabulations are
382: thrown away.
383:
384: .ttcc _X _N
385: Fill any unused space within a tabulation field with the
386: character _X. If the optional _N is present, it specifies a
387: width for the character; for example, .ttcc . .11ii fills tabs
388: with dots spaced one-tenth of an inch apart.
389:
390: .ttii _N_X
391: Temporary indent; indent only the next line. Used like the
392:
393:
394: COHERENT Lexicon Page 6
395:
396:
397:
398:
399: nroff Command nroff
400:
401:
402:
403: .iinn command, above.
404:
405: .ttll '_l_e_f_t'_c_e_n_t_e_r'_r_i_g_h_t'
406: Set a three-part title, with _l_e_f_t being set flush left,
407: _c_e_n_t_e_r being centered on the line, and _r_i_g_h_t being set flush
408: right. Note the use of the apostrophes to separate the
409: fields; the apostrophes for an undefined field must still be
410: present, or a syntax error will be generated.
411:
412: .ttmm _m_e_s_s_a_g_e
413: Print _m_e_s_s_a_g_e on the standard error device. This is often
414: used with .iiff or .iiee commands to indicate an error
415: condition.
416:
417: .ttrr _x_y
418: Translate character _x to _y on output.
419:
420: .uull _N
421: Underline the next _N lines.
422:
423: .vvss _N_p
424: Reset the normal vertical spacing to _N points pp. One point
425: equals 1/72 of an inch; the default setting is 12 points, or
426: 1/6 of an inch.
427:
428: .wwhh _N_X _a_c_t_i_o_n
429: Set a trap to perform _a_c_t_i_o_n when point _N is reached on
430: every formatted page. If _N is negative, it is measured up
431: from the bottom of the page. The unit of measure _X may be ii
432: or vv, for inches or number of vertical lines, respectively;
433: the default unit of measure is vv.
434:
435: ***** Escape Sequences *****
436:
437: The following lists nnrrooffff's escape sequences, or commands that
438: suspend or work around the normal operation of nnrrooffff. All escape
439: sequences are introduced by the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, normally the
440: backslash character `\'.
441:
442: \(_x_x Print special character _x_x, as defined by a .ddcc request.
443: nnrrooffff reads default special character definitions from file
444: /uussrr/lliibb/rrooffff/nnrrooffff/ssppeecciiaallss.rr. For example, the escape
445: sequence \(<= prints the less-than-or-equal-to symbol <_.
446:
447: \\ Print a backslash character. This can be used to print a
448: literal backslash character in the output text, or to defer
449: the interpretation of a macro or string from the time it is
450: processed to the time that it is called.
451:
452: \- Print a minus sign.
453:
454: \& Ignore what is normally a command string.
455:
456: \$_N Call macro argument _N.
457:
458:
459:
460: COHERENT Lexicon Page 7
461:
462:
463:
464:
465: nroff Command nroff
466:
467:
468:
469: \'' Introduce a comment within your text. All text to the right
470: of this escape sequence will be ignored by nnrrooffff. This
471: sequence must read .\'' when used at the beginning of a
472: line.
473:
474: \*_S Call string _S.
475:
476: \*(_S_T
477: Call string _S_T.
478:
479: \aa Fill the space to the next tab stop with leader dots
480: (normally `.').
481:
482: \ee Print the escape character in the output text.
483:
484: \ff_X Set font to _X; this can be either RR, II, BB, or PP, for Roman,
485: _i_t_a_l_i_c, bboolldd, or previous font, respectively.
486:
487: \hh'[|]_N_X'
488: Move horizontally by _N units of _X. If _N is positive, move to
489: the right; if negative, move to the left. The unit of
490: measure _X may be ii, for inches; the default unit of measure
491: is character-widths. When the optional vertical bar `|' is
492: used, move to an absolute position on the line. For example
493: \hh'|11.55ii' moves to 1.5 inches to the right of the left
494: margin, whereas \hh'11.55ii' moves 1.5 inches to the right of
495: the current position.
496:
497: \ll'_N_X'
498: Draw a horizontal line _N units of _X long. The unit of
499: measure _X may be ii, for inches; the default unit of measure
500: is character-widths.
501:
502: \LL'_N_X'
503: Draw a vertical line; used like \ll, above.
504:
505: \nn_X Read the value of number register _X.
506:
507: \nn(_X_Y
508: Read the value of number register _X_Y.
509:
510: \oo'_c_h_a_r_s'
511: Overstrike the given _c_h_a_r_s, centered on the widest.
512:
513: \tt Print a tab.
514:
515: \vv'_N_X'
516: Vertical motion; move _N units of _X vertically. If _N is
517: positive, move down; if negative, move up. The unit of
518: measure _X may be ii or vv, for inches or vertical spaces
519: (sixths of an inch), respectively. The default unit of
520: measure is vv.
521:
522: \ww'_a_r_g_u_m_e_n_t'
523: Measure the width of _a_r_g_u_m_e_n_t. For example
524:
525:
526: COHERENT Lexicon Page 8
527:
528:
529:
530:
531: nroff Command nroff
532:
533:
534:
535: \w'stuff and nonsense'
536:
537: measures the width of the phrase ssttuuffff aanndd nnoonnsseennssee; or
538:
539: \w'\$1'
540:
541: measures the width of the first argument passed to a macro,
542: whatever that argument might happen to be. Therefore, the
543: command .iinn \ww'\$11' will indent a line by the width of
544: argument 1.
545:
546: \XX_d_d Output the character with hexadecimal value _d_d, where _d_d are
547: two hexadecimal digits.
548:
549: \zz_c Print character _c with zero width.
550:
551: \<nneewwlliinnee>
552: Ignore this <nneewwlliinnee> character.
553:
554: \{ Begin conditional commands; used after an .iiff, an .iiee, or an
555: .eell command.
556:
557: \{\ Begin conditional commands, and ignore the following
558: carriage return.
559:
560: \} End conditional commands.
561:
562: ***** Dedicated Number Registers *****
563:
564: The following lists the number registers that are predefined in
565: nnrrooffff. You can read or reset these registers to suit the need of
566: any special formats that you wish to devise.
567:
568: .$ Number of arguments in a call to a macro.
569:
570: % Present page number.
571:
572: ddyy Day of the month, as set by COHERENT.
573:
574: .ii Present level of indentation.
575:
576: .ll Present line length.
577:
578: mmoo Month, as set by COHERENT.
579:
580: .oo Present page offset.
581:
582: .pp Page length.
583:
584: yyrr Year, as set by COHERENT.
585:
586: ***** Printer Configuration *****
587:
588: nnrrooffff reads several files in directory /uussrr/lliibb/rrooffff/nnrrooffff to
589: find printer-specific information. It reads special character
590:
591:
592: COHERENT Lexicon Page 9
593:
594:
595:
596:
597: nroff Command nroff
598:
599:
600:
601: definitions from file ssppeecciiaallss.rr. If file ffoonnttss.rr exists, nnrrooffff
602: reads font information from it; nnrrooffff understands only Roman,
603: bold and italic fonts, but .rrff requests may define alternative
604: font names. If file .pprree exists, nnrrooffff copies it at the
605: beginning of the output. If file .ppoosstt exists, nnrrooffff copies it
606: at the end of the output. In landscape mode, nnrrooffff looks for
607: files .pprree_llaanndd and .ppoosstt_llaanndd instead. You can change these
608: files as desired to include printer-specific commands in nnrrooffff
609: output.
610:
611: ***** Miscellaneous *****
612:
613: The -mmss macro package is kept in file /uussrr/lliibb/ttmmaacc.ss. The macros
614: in this package are more than sufficient for most ordinary text
615: processing. Beginners should work through this macro package
616: rather than trying to deal at once with the basic program.
617:
618: The tutorial to nnrrooffff, which is included with this manual,
619: provides a detailed introduction to nnrrooffff. Error messages for
620: nnrrooffff appear in the appendix to this manual.
621:
622: ***** Files *****
623:
624: /ttmmpp/rrooff* -- Temporary files
625: /uussrr/lliibb/ttmmaacc.* -- Standard macro packages
626: /uussrr/lliibb/rrooffff/nnrrooffff/ -- Support files directory
627: /uussrr/lliibb/rrooffff/nnrrooffff/.pprree -- Output prefix
628: /uussrr/lliibb/rrooffff/nnrrooffff/.pprree_llaanndd -- Output prefix, landscape mode
629: /uussrr/lliibb/rrooffff/nnrrooffff/.ppoosstt -- Output suffix
630: /uussrr/lliibb/rrooffff/nnrrooffff/.ppoosstt_llaanndd -- Output suffix, landscape mode
631: /uussrr/lliibb/rrooffff/nnrrooffff/ffoonnttss.rr -- Alternative font name definitions
632: /uussrr/lliibb/rrooffff/nnrrooffff/ssppeecciiaallss.rr -- Special character definitions
633:
634: ***** See Also *****
635:
636: ccooll, ccoommmmaannddss, ddeerrooffff, mmaann, mmss, ttrrooffff
637: _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
638:
639:
640:
641:
642:
643:
644:
645:
646:
647:
648:
649:
650:
651:
652:
653:
654:
655:
656:
657:
658: COHERENT Lexicon Page 10
659:
660:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.