5.15 Line Layout

The following drawing shows the dimensions that gtroff uses for placing a line of output onto the page. They are labeled with the request that manipulates each dimension.

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

These dimensions are:

po

Page offset—this is the leftmost position of text on the final output, defining the left margin.

in

Indentation—this is the distance from the left margin where text is printed.

ll

Line length—this is the distance from the left margin to right margin.

The right margin is not explicitly configured; the combination of page offset and line length provides the information necessary to derive it.

A simple demonstration:

.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.
Request: .po [offset]
Request: .po +offset
Request: .po -offset
Register: \n[.o]

Set page offset to offset (or increment or decrement its current value by offset). If invoked without an argument, the page offset is restored to the value before the previous po request. This request does not cause a break; the page offset in effect when an output line is broken prevails (see Manipulating Filling and Adjustment). The initial value is 1i and the default scaling unit is ‘m’. On terminal devices, the page offset is set to zero by a driver-specific macro file, tty.tmac. The current 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 (or increment or decrement the current value by indent). This request causes a break. Initially, there is no indentation.

If in is called without an argument, the indentation is reset to the previous value before the last call to in. The default scaling unit is ‘m’.

If a negative indentation value is specified (which is not allowed), gtroff emits a warning in category ‘range’ and sets the indentation to zero.

The effect of in is delayed until a partially collected line (if it exists) is output. A temporary indentation value is reset to zero also.

The current indentation (as set by in) can be found in the read-only register ‘.i’. 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 an increment or decrement value is specified, adjust the temporary indentation relative to the value set by the in request.

This request causes a break; its value is associated with the environment (see Environments). The default scaling unit is ‘m’. A call of ti without an argument is ignored.

If the total indentation value is negative (which is not allowed), gtroff emits a warning in category ‘range’ and sets the temporary indentation to zero. ‘Total indentation’ is either offset if specified as an absolute value, or the temporary plus normal indentation, if offset is given as a relative value.

The effect of ti is delayed until a partially collected line (if it exists) is output.

The read-only register .in is the indentation that applies to the current output line.

The difference between .i and .in is that the latter takes into account whether a partially collected line still uses the old indentation value or a temporary indentation value is active.

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

Set the line length to length (or increment or decrement the current value by length). Initially, the line length is set to 6.5i. The effect of ll is delayed until a partially collected line (if it exists) is output. The default scaling unit is ‘m’.

If ll is called without an argument, the line length is reset to the previous value before the last call to ll. If a negative line length is specified (which is not allowed), gtroff emits a warning in category ‘range’ and sets the line length to zero. The line length is associated with the environment (see Environments).

The current 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 current output line.

Similar 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 old line length value.