nroff Command

Purpose

Formats text for printing on typewriter-like devices and line printers.

Syntax

nroff [ -e ] [ -h ] [ -i ] [ -q ] [ -z ] [ -o List ] [ -n Number ] [ -s Number ] [ -r ANumber ] [ -u Number ] [ -T Name ] [ -man ] [ -me ] [ -mm ] [ -mptx ] [ -ms ] [ File ... | - ]

Description

The nroff command reads one or more files for printing on typewriter-like devices and line printers. If no file is specified or the - (minus sign) flag is specified as the last parameter, standard input is read by default. The File variable specifies files to be printed on a typewriter-like device by the nroff command. The default is standard input.

The col command may be required to postprocess nroff command output in certain cases.

Flags

Item Description
-e Produces equally spaced words in adjusted lines, using the full resolution of a particular terminal.
-h Uses output tabs during horizontal spacing to speed output and reduce the output character count. Tab settings are assumed to be every eight nominal character widths.
-i Reads standard input after reading all specified files.
-man Selects the man macro processing package.
-me Selects the me macro processing package.
-mm Selects the mm macro processing package.
-mptx Selects the mptx macro processing package.
-ms Selects the ms macro processing package.
-n Number Assigns the specified number to the first printed page.
-o List Prints only those pages specified by the List variable, which consists of a comma-separated list of page numbers and ranges, as follows:
  • A range of Start-Stop means print pages Start through Stop. For example, 9-15 prints pages 9 through 15.
  • An initial -Stop means print from the beginning to page Stop.
  • A final Start- means print from page Start to the end.
  • A combination of page numbers and ranges prints the specified pages. For example, -3, 6-8,10,12- prints the beginning through page 3, pages 6 through 8, page 10, and page 12 to the end.

    Note: When the -oList flag is used in a pipeline (as with one or more of the eqn or tbl commands) you may receive a broken pipe message if the last page in the document is not specified in the List parameter. This broken pipe message is not an indication of any problem and can be ignored.

-q Calls the simultaneous input/output mode of the .rd request.
-r ANumber Sets register A to the specified number. The value specified by the A variable must have a one-character ASCII name.
-s Number Stops every specified number of pages (the default is 1). The nroff command halts every specified number of pages to allow paper loading or changing, then resumes upon receipt of a linefeed or new-line character. This flag does not work in pipelines (for example, with the mm command). When the nroff command halts between pages, an ASCII BEL character is sent to the workstation.
-T Name Prepares the output for the specified printing device. Typewriter-like devices and line printers use the following Name variables for international extended character sets, as well as English-language character sets, digits, and symbols:
hplj
Hewlett-Packard LaserJet II and other models in the same series of printers.
ibm3812
3812 Pageprinter II.
ibm3816
3816 Pageprinter.
ibm4019
4019 LaserPrinter.

Note: The 4019 and the HP Laser Jet II printer both have nonprintable areas at the top and bottom of a page. If a file is targeted for these printers, be sure to define top and bottom margins (for example, by formatting with the -mm flag) so that all output can be positioned within the printable page.

37
Teletype Model 37 terminal (default) for terminal viewing only. This device does not support extended characters that are inputted by the \[N] form. Inputting Extended Single-Byte Characters provides more information.
lp
Generic name for printers that can underline and tab. All text sent to the lp value using reverse linefeeds (for example, text that includes tables) must be processed with the col command. This device does not support extended characters that are inputted by the \[N] form. Inputting Extended Single-Byte Characters provides more information.
ppds
Generic name for printers that support the personal printer data streams such as the Quietwriter III, Quickwriter, and Proprinters.
ibm5575
5575 Kanji Printer.
ibm5577
5577 Kanji Printer.

Note: For completeness of the text formatting system, the following devices are shipped as is from the AT&T Distribution center. No support is provided for these tables.

-T Name (Continued)
2631
Hewlett-Packard 2631 printer in regular mode.
2631-c
Hewlett-Packard 2631 printer in compressed mode.
2631-e
Hewlett-Packard 2631 printer in expanded mode.
300
DASI-300 printer.
300-12
DASI-300 terminal set to 12 characters per inch.
382
DTC-382.
4000a
Trendata 4000a terminal (4000A).
450
DASI-450 (Diablo Hyterm) printer.
450-12
DASI-450 terminal set to 12 characters per inch.
832
Anderson Jacobson 832 terminal.
8510
C.ITOH printer.
tn300
GE Terminet 300 terminal.
X
Printers equipped with a TX print train.
300s
DASI-300s printer (300S).
300s-12
DASI-300s printer set to 12 characters per inch (300S-12).
-u Number Sets the bold factor (number of character overstrokes) for the third font position (bold) to the specified number, or to 0 if the Number variable is missing.
-z Prints only messages generated by .tm (workstation message) requests.

Note: See the Macro Packages for Formatting Tools in the troff command for information about the macros.

- Forces input to be read from standard input.

Files

Item Description
/usr/share/lib/tmac/tmac.* Contains pointers to standard macro files.
/usr/share/lib/macros/* Contains standard macro files.
/usr/share/lib/nterm/* Contains the terminal driving tables for the nroff command.
/usr/share/lib/pub/terminals Contains a list of supported terminals.