5.17 Page Layout

The formatter permits configuration of the page length and page number.

Request: .pl [length]
Request: .pl +length
Request: .pl -length
Register: \n[.p]

Change (increase or decrease) the page length per the numeric expression length. The default scaling unit is ‘v’. A negative length is valid, but an uncommon application: it prevents page location traps from being sprung,70 and each output line is placed on a new page. If length is invalid, GNU troff emits a warning in category ‘number’. If length is absent or invalid, ‘11i’ is assumed.

The read-only register ‘.p’ interpolates the current page length.

Request: .pn num
Request: .pn +num
Request: .pn -num
Register: \n[.pn]

Change (increase or decrease) the page number of the next page per the numeric expression num. If num is invalid, GNU troff emits a warning in category ‘number’ and ignores the request. Without an argument, pn is ignored.

The read-only register .pn interpolates num if set by pn on the current page, or the current page number plus 1.

The formatter offers special support for typesetting headers and footers, collectively termed titles. Titles have an independent line length, and their placement on the page is not restricted.

Request: .tl 'left'center'right'

Format an output line as a title consisting of left, center, and right, each aligned accordingly. The delimiter need not be a neutral apostrophe: tl accepts the same delimiters as most escape sequences; see Delimiters. If not used as the delimiter, any page number character character is replaced with the current page number; the default is ‘%’; see the the pc request below. Without an argument, tl is ignored. tl writes the title line immediately, ignoring any partially collected line.

It is not an error to omit delimiters after the first. For example, ‘.tl /Thesis is interpreted as ‘.tl /Thesis///: it sets a title line comprising only the left-aligned word ‘Thesis’.

Request: .lt [length]
Request: .lt +length
Request: .lt -length
Register: \n[.lt]

Change (increase or decrease) the line length used by titles per the numeric expression length. The default scaling unit is ‘m’. If length is negative, GNU emits a warning in category ‘range’ and treats length as ‘0’. If length is invalid, GNU troff emits a warning in category ‘number’ and ignores the request. The formatter’s default title length is ‘6.5i’. With no argument, the title length is restored to the previous value. The title length is is associated with the environment (see Environments).

The read-only register ‘.lt’ interpolates the title line length.

Request: .pc [char]

Set the page number character to char. With no argument, the page number character is disabled. pc does not affect the register %.

The following example exercises title features.

.lt 50n
This is my partially collected
.tl 'Isomers 2023'%'Dextrose Edition'
line.
    ⇒ Isomers 2023             1        Dextrose Edition
    ⇒ This is my partially collected line.

We most often see titles used in page header and footer traps. See Traps.