Next: , Previous: , Up: gtroff Reference   [Contents][Index]


5.13 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.

A simple demonstration:

.ll 3i
This is text without indentation.
The line length has been set to 3\~inch.
.in +.5i
.ll -.5i
Now the left and right margins are both increased.
.in
.ll
Calling .in and .ll without parameters restore
the previous values.

Result:

This  is text without indenta-
tion.   The  line  length  has
been set to 3 inch.
     Now   the  left  and
     right  margins   are
     both increased.
Calling  .in  and  .ll without
parameters restore the  previ-
ous values.
Request: .po [offset]
Request: .po +offset
Request: .po -offset
Register: \n[.o]

Set horizontal page offset to offset (or increment or decrement the current value by offset). Note that this request does not cause a break, so changing the page offset in the middle of text being filled may not yield the expected result. The initial value is 1i. For TTY output devices, it is set to 0 in the startup file troffrc; the default scaling indicator is ‘m’ (and not ‘v’ as incorrectly documented in the original UNIX troff manual).

The current page offset can be found in the read-only number register ‘.o’.

If po is called without an argument, the page offset is reset to the previous value before the last call to po.

.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 indicator is ‘m’.

The indentation is associated with the current environment (see Environments).

If a negative indentation value is specified (which is not allowed), gtroff emits a warning of type ‘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 number register ‘.i’.

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 current environment (see Environments). The default scaling indicator 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 of type ‘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 number 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 indicator 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 of type ‘range’ and sets the line length to zero.

The line length is associated with the current environment (see Environments).

The current line length (as set by ll) can be found in the read-only number register ‘.l’. The read-only number 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.


Next: , Previous: , Up: gtroff Reference   [Contents][Index]