5.15 Line Layout

The following drawing shows the dimensions that GNU troff uses to arrange a line of output on the page. Each dimension is labeled with the name of the request that configures it.

     -->| in |<--
        |<-----------ll------------>|
   +----+----+----------------------+----+
   |    :    :                      :    |
   +----+----+----------------------+----+
-->| po |<--
   |<--------paper width---------------->|

The dimensions are defined as follows.

po The page offset is the leftmost position of running text.
in Indentation is the distance from the page offset at which text is set.
ll Line length is the maximum extent of unindented running text.

The page offset can be thought of as the “left margin”. The right margin is not explicitly configured; the combination of page offset and line length provides the information necessary to derive it.

.ll 3i
This is text without indentation.
The line length has been set to 3\~inches.
.in +.5i
.ll -.5i
Now the left and right margins are both increased.
.in
.ll
Calling .in and .ll without parameters restores
the previous values.
    ⇒ This  is text without indenta-
    ⇒ tion.   The  line  length  has
    ⇒ been set to 3 inches.
    ⇒      Now   the  left  and
    ⇒      right  margins   are
    ⇒      both increased.
    ⇒ Calling  .in  and  .ll without
    ⇒ parameters restores the previ-
    ⇒ ous values.

Requests exist to place line numbers and margin characters beyond the page margins; Miscellaneous.

Request: .po [offset]
Request: .po +offset
Request: .po -offset
Register: \n[.o]

Set page offset to offset; if offset is signed, adjust the page offset by its value. The default scaling unit is ‘m’. The default offset is 1i on typesetters and zero on terminals.

If offset is omitted, the page offset is reset to that before the previous invocation of po.

The page offset can be found in the read-only register ‘.o’. This request is incorrectly documented in the AT&T troff manual as using a default scaling unit of ‘v’.

.po 3i
\n[.o]
    ⇒ 720
.po -1i
\n[.o]
    ⇒ 480
.po
\n[.o]
    ⇒ 720
Request: .in [indent]
Request: .in +indent
Request: .in -indent
Register: \n[.i]

Set indentation to indent; if indent is signed, adjust the indentation by its value. The default scaling unit is ‘m’. Initially, there is no indentation. This request causes a break.

If indent is omitted, the indentation is reset to that before the previous invocation of in, and zero if there is none. If indent is negative, GNU troff emits a warning in category ‘range’ and sets the indentation to zero; a temporary indentation (see below) is reset to zero as well.

The effect of in is delayed until a partially collected line (if it exists) is output. In other words, it does not change a pending output line’s indentation.

The indentation (as set by in) can be found in the read-only register ‘.i’; it ignores temporary indentation (see below). The indentation is associated with the environment (see Environments).

Request: .ti offset
Request: .ti +offset
Request: .ti -offset
Register: \n[.in]

Temporarily indent the next output line by offset; if offset is signed, adjust the temporary indentation relative to the value set by the in request. The default scaling unit is ‘m’. This request causes a break.

Omitting offset causes a warning in category ‘missing’.

The effect of ti is delayed until a partially collected line (if it exists) is output. In other words, it does not change a pending output line’s indentation.

The read-only register .in reports the indentation that applies to the pending output line. The temporary indentation is associated with the environment (see Environments).

Request: .ll [length]
Request: .ll +length
Request: .ll -length
Register: \n[.l]
Register: \n[.ll]

Change (increase or decrease) the line length per the numeric expression length. The default scaling unit is ‘m’. If not otherwise configured (see see Paper Format), the default line length is 6.5i. If length is invalid, GNU troff emits a warning in category ‘number’ and ignores the request. If length is nonpositive, GNU troff emits a warning in category ‘range’ and sets the line length to the device’s horizontal motion quantum; recall Motion Quanta. The line length is associated with the environment (see Environments). If length is omitted, GNU troff restores the environment’s previous line length.

The effect of ll is delayed until a partially collected line (if it exists) is output. In other words, it does not change a pending output line’s length.

The line length as set by ll can be found in the read-only register ‘.l’. The read-only register .ll is the line length that applies to the pending output line.

Similarly to .i and .in, the difference between .l and .ll is that the latter takes into account whether a partially collected line still uses the previous length.