Conceptual Overview
This section provides a brief overview of how to prepare input for nroff and troff. It presents the following topics:
Requests and macros
Common requests
Specifying measurements
Requests that cause a line break
Embedded formatting controls
Requests and macros
Formatting is specified by embedding brief codes (called requests) into the text source file. These codes act as directives to nroff and troff when they run. For example, to center a line of text, type the following code in a file:
.ce
This text should be centered.When formatted, the output appears centered:
This text should be centered.
There are two types of formatting codes:
Requests, which provide the most elementary instructions
Macros, which are predefined combinations of requests
Requests, also known as primitives, allow direct control of almost any feature of page layout and formatting. Macros combine requests to create a total effect. In a sense, requests are like statements, and macros are like functions.
All nroff/troff requests are two-letter lowercase names. Macros are usually upper- or mixed-case names. GNU troff removes the two-character restriction on the length of names.
Specifying measurements
With some requests, the numeric argument can be followed by a scale indicator that specifies a unit of measurement. The valid indicators and their meanings are listed in the following table. Note that all measurements are internally converted to basic units (this conversion is shown in the last column). A basic ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access