This section is condensed from the material on troff from the third edition of this book. It covers features available in all versions of nroff and troff, and focuses on those features necessary for writing manual pages.
nroff and troff are invoked from the command line as follows:
files] troff [
Although both formatters support a plethora of options, the following two are the most important for everyday use.
Prepend a macro file to input
files. Historically, one of
name were the locations of the macros for
name. Solaris uses
name. GNU troff uses something like
.tmac. The actual location and
filename(s) vary among different Unix systems.
Prepare output designed for printer or typesetter name. For device names, see your specific documentation or a local expert. GNU troff provides both PostScript and TEX DVI output.
Format a manual page for printing using groff:
groff -man /usr/share/man/man1/awk.1 | lpr
This section provides a brief overview of how to prepare input for nroff and troff. It presents the following topics:
Requests and macros
Requests that cause a line break
Embedded formatting controls
Formatting is specified by embedding brief codes (called requests) into the text source file. These ...