.sp
[distance] ¶Space downward by distance. Inside a diversion, any distance argument is ignored. Otherwise, a negative argument moves the drawing position up the page. This request causes a break. The default scaling unit is ‘v’. If distance is not specified, ‘1v’ is assumed.
You may wish to use the following macros to set the baseline of the next
output text at a given distance from the top or the bottom of the page.
We subtract one line height (\n[.v]
) because the |
operator moves to one vee below the page top (see Numeric Expressions).
.de y-from-top-down . sp |\\$1-\\n[.v]u .. . .de y-from-bot-up . sp |\\n[.p]u-\\$1-\\n[.v]u ..
A call to ‘.y-from-bot-up 10c’ means that the next text baseline will be at 10 cm from the bottom edge of the paper.
If a vertical position trap is sprung during execution of sp
, the
amount of vertical space after the trap is discarded.
.de xxx .. . .wh 0 xxx . .pl 5v foo .sp 2 bar .sp 50 baz ⇒ foo ⇒ ⇒ ⇒ bar ⇒ ⇒ baz
The amount of discarded space is available in the register
.trunc
.
To protect sp
against vertical position traps, use the vpt
request to disable them. See Vertical Position Traps.
.vpt 0 .sp -3 .vpt 1
.ls
[nnn] ¶\n[.L]
¶Output nnn−1 blank lines after each line of text. With
no argument, gtroff
uses the previous value before the last
ls
call.
.ls 2 \" This causes double-spaced output .ls 3 \" This causes triple-spaced output .ls \" Again double-spaced
The read-only register .L
contains the current line spacing
setting. The line spacing is associated with the environment
(see Environments).
See Changing the Type Size, for the requests vs
and pvs
as alternatives to ls
.
\x'
spacing'
¶\n[.a]
¶Sometimes, extra vertical spacing is needed only occasionally, for
instance to allow room for a tall construct like an inline equation.
The \x
escape sequence takes a delimited measurement (like
‘\x'3p'’); the default scaling unit is ‘v’. If the
measurement is positive, extra vertical space is inserted below the
current line; a negative measurement adds space above. If \x
is
used multiple times on the same output line, the maxima of the positive
and negative adjustments are used. The delimiter need not be a neutral
apostrophe; see Delimiters.
The .a
read-only register contains the most recent (non-negative)
extra vertical line space.
Use of \x
can be necessary in combination with the \b
escape sequence, as the following example shows.
This is a test of \[rs]b. .br This is a test of \[rs]b. .br This is a test of \b'xyz'\x'-1m'\x'1m'. .br This is a test of \[rs]b. .br This is a test of \[rs]b.
produces
This is a test of \b. This is a test of \b. x This is a test of y. z This is a test of \b. This is a test of \b.
.ns
¶.rs
¶\n[.ns]
¶Enable no-space mode. In this mode, spacing (either via sp
or via blank lines) is disabled. The bp
request to advance to
the next page is also disabled, except if it is accompanied by a page
number (see Page Control). This mode ends when actual text is
output or the rs
request is encountered, which ends no-space
mode. The read-only register .ns
is set to 1 as long as
no-space mode is active.
This request is useful for macros that conditionally insert vertical space before the text starts (for example, a paragraph macro could insert some space except when it is the first paragraph after a section header).