12.3 Using the Requests: An OverviewFormatting is specified by embedding brief codes into the text source file. These codes act as directives to nroff and troff when they are invoked. 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:
.ce This text should be centered. There are two types of formatting codes:
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 atoms, and macros are like molecules. See Sections 13, 14, and 15 for more information on macros. 12.3.1 Common RequestsThe most commonly used requests are:
.ad .ds .ll .nr .sp .br .fi .na .po .ta .bp .ft .ne .ps .ti .ce .in .nf .so .vs .de .ls For example, a simple macro could be written as follows:
.ta 1.2i . \" Ps macro - show literal text display .de Ps \" Define a macro named "Ps" .sp .5 \" Space down half a line .in 1i \" Indent one inch .ta 10n +10n \" Set new tabstops .ps 8 \" Use 8-point type .vs 10 \" Use 10-point vertical spacing .ft CW \" Use constant width font .br \" Break line (.ne begins count on next line) .ne 3 \" Keep 3 lines together .nf \" No-fill mode (output lines as is) .. \" End macro definition 12.3.2 Specifying MeasurementsWith 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 below. Note that all measurements are internally converted to basic units (this conversion is shown in the last column). A basic unit is the smallest possible size on the printer device. The device resolution (e.g., 300 dots per inch), determines the size of a basic unit. In the following table, T specifies the current point size and R specifies the device resolution.
You can specify a scale indicator for any of the requests below,
except for
12.3.3 Requests That Cause a Line BreakMost requests can be interspersed with text without causing a line break in the output. The following requests cause a break:
.bp .ce .fi .in .sp .br .cf .fl .nf .ti
If you need to prevent these requests from causing a break,
begin them with the "no break" character (normally |
|