.MH "Spacing and Page Control"
.#
.SH "Line Spacing"
'Fmt' usually produces single-spaced output, but this
can be changed, without a break, using the
'line-spacing' command
.be
 [bf .ls] N
.ee
The parameter N specifies how many lines on the page
a single line of text will use; for double spacing, N
would be two.  If N is omitted, the default (single) spacing
is reinstated.
.pp
Blank lines may be produced  with the 'space' command
.be
 [bf .sp] N
.ee
The parameter N is the number of blank lines to produce; if omitted,
a value of one is assumed.  The [bf sp]
command first causes a break; this not only causes a partially filled
line to be output, but
if the current line spacing is more than one,
the break will cause the extra blank lines to be output as well.
Then the blank lines generated by [bf sp] are output.
Thus, if output is being double-spaced and the command
.be
 [bf .sp] 3
.ee
is given, four blank lines will be generated: one from the
double-spacing that is in effect, and three from the [bf sp] command.
If the value of N calls
for more blank lines than there are remaining on the current
page, any extra ones are discarded. This ensures that, normally,
each page begins at the same distance from the
top of the paper.
.#
.SH "Page Division"
'Fmt' automatically divides its output into pages, leaving adequate
room at the top and bottom of each page for running headings and
footings.
There are several commands that facilitate the control
of page divisions when the normal behavior is inadequate.
.pp
The 'begin-page' command
.be
 [bf .bp] [cu +]N
.ee
causes a break and a skip to the top of the next page.
If a parameter is given, it serves to alter the page number and so it
must be numeric with an optional plus or minus sign.
If the parameter is omitted, the page number is incremented
by one.  If the command occurs at the top of a page before
any text has been printed on it, the command is ignored, except
perhaps to set the page number.  This is to prevent the random
occurrence of blank pages.
.pp
The optionally signed numeric parameter is a form of parameter
used by many formatting commands.  When the sign is omitted,
it indicates an absolute value to be used; when the sign is
present, it indicates an amount to be added to or subtracted
from the current value.
.pp
The page number may be set independently of the 'begin-page'
command with the 'page-number' command
.be
 [bf .pn] [cu +]N
.ee
The next page after the current one, when and if it occurs,
will be numbered [cu +]N.  No break is caused.
.pp
The length of each page produced by 'fmt' is normally 66 lines.
This is standard for eleven inch paper printed at six lines
per inch.  However, if non-standard paper is used,
the printed length of the page may easily be changed with the
'page-length' command
.be
 [bf .pl] [cu +]N
.ee
which will set the length of the page to [cu +]N lines without
causing a break.
.pp
[cc]mc |
It is possible skip an arbitrary number of pages in a controlled fashion.
To do this, use the 'page-skip' command
.be
 [bf .ps] <max> <modulus>
.ee
<Max> is the maximum number of pages plus one that 'fmt' will skip.
<Modulus> is the number which 'fmt' uses modulo the next output
page number to count skipping pages.
It works as follows: 'Fmt' sees the [bf .ps]
command.  It computes the page number of the current page plus one,
and then takes the remainder of that number divided by the <modulus>,
and saves it.
'Fmt' skips pages, adding one to this saved value.
As long as this value is [ul less than] <max>, it continues to skip
pages.  For instance, if the current page is 15, and you issue a
.be
 [bf .ps] 3 5
.ee
command, 'fmt' would compute ( (15 + 1) mod 5), yielding
(16 mod 5), which is one (16 divided by 5 is 3, with 1 left over).
It will then skip two pages, since it started with one, then
skipped one, which is two. This is still less than three, so
it skips one more page, yielding three, which is not less
than three, so it stops.
It is really quite simple.
For instance, to skip to the next even page, use
.be
 [bf .ps] 2 2
.ee
and to skip to the next odd page, use
.be
 [bf .ps] 1 2
.ee
This feature is particularly useful for writing macros which aid with
large documents. For example, it may be necessary that a chapter
always start on an odd numbered page. So the 'begin chapter' macro
would have a '[bf .ps] 1 2' as one of its lines.  (See later for
more details on how to write macros.)
.pp
[cc]mc
Finally, if it is necessary  to be sure of having
enough room on a page, say for  a figure or a graph,
use the 'need' command
.be
 [bf .ne] N
.ee
'Fmt' will cause a break, check  if there are N lines left on
the current page and, if so, will do nothing more.  Otherwise,
it will skip to the top of the next page
where there should be  adequate room.
.#
.SH "'No-space' Mode"
'No-space' mode is a feature that assists in preventing
unwanted blank lines from appearing, usually at the top of
a page.  When in effect, certain commands that cause
blank lines to be generated, such as [bf bp], [bf ne] and [bf sp], are
suppressed.  For the most part, 'no-space' mode is managed automatically;
it is turned on automatically at the top of each page before
the first text has appeared, and turned off again automatically
when a line of output is generated. This accounts
for the suppression of [bf bp] commands at the top of a page
and the discarding of excess blank lines in [bf sp] commands.
.pp
.ne 4
'No-space' mode may be turned on explicitly with the 'no-space'
command
.be
 [bf .ns]
.ee
and turned off explicitly with the 'restore-spacing'
command
.be
 [bf .rs]
.ee
Neither command causes a break.
.#
.BT 23 "Summary - Spacing and Page Control"
?RQ  ".bp  [cu +]N"  N=1  next  yes
Begin a new page.
?RQ  ".ls N"  N=1  N=1  yes
Set line spacing.
?RQ  ".ne N"  -  N=1  yes
Express a need for N contiguous lines.
?RQ  .ns  on  -  no
Turn on 'no-space' mode.
?RQ  ".pl [cu +]N"  N=66  N=66  no
Set page length.
?RQ  ".pn [cu +]N"  N=1  ignored  no
Set page number.
[cc]mc |
?RQ  ".ps N M"  N=M=0  N=M=0  yes
Skip pages while (page number mod M) is less than N.
[cc]mc
?RQ  .rs  -  -  no
Turn off 'no-space' mode.
?RQ  ".sp N"  -  N=1  yes
Put out N blank lines.
?ET
.########################################################################
