As mentioned above,
the command
.pssets the point size.
One point is 1/72 inch,
so 6-point characters are at most 1/12 inch high,
and 36-point characters are ½ inch.
There are 15 point sizes, listed below.
6 point: Pack my box with five dozen liquor jugs.
7 point: Pack my box with five dozen liquor jugs.
8 point: Pack my box with five dozen liquor jugs.
9 point: Pack my box with five dozen liquor jugs.
10 point: Pack my box with five dozen liquor
11 point: Pack my box with five dozen
12 point: Pack my box with five dozen
14 point: Pack my box with five
16 point 18 point 20 point
22 24 28 36
If the number after .psis not one of these legal sizes, it is rounded up to the next valid value, with a maximum of 36. If no number follows .pstroff reverts to the previous size, whatever it was. troff begins with point size 10, which is usually fine. This document is in 9 point.
The point size can also be changed in the middle of a line
or even a word
with the in-line command
\sTo produce
UNIX runs on a PDP-11/45
type
\s8UNIX\s10 runs on a \s8PDP-\s1011/45
As above,
\sshould be followed by a legal point size,
except that
\s0causes the size to revert to
its previous value.
Notice that
\s1011can be understood correctly as `size 10, followed by an 11', if the size is legal,
but not otherwise.
Be cautious with similar constructions.
Relative size changes are also legal and useful:
\s-2UNIX\s+2
temporarily decreases the size, whatever it is, by two points, then
restores it.
Relative size changes have the advantage that the size difference
is independent of the starting size of the document.
The amount of the relative change is restricted
to a single digit.
The other parameter that determines what the type looks like
is the spacing between lines,
which is set independently of the point size.
Vertical spacing is measured from the bottom of one line to
the bottom of the next.
The command to control vertical spacing is
.vsFor running text, it is usually best to set the vertical spacing
about 20% bigger than the character size.
For example, so far in this document, we have used
``9 on 11'', that is,
^ps 9
^vs 11p
If we changed to
^ps 9
^vs 9p
the running text would look like this.
After a few lines, you will agree it looks a little cramped.
The right vertical spacing is partly a matter of taste, depending on how
much text you want to squeeze into a given space,
and partly a matter of traditional printing style.
By default,
troff
uses 10 on 12.
Point size and vertical spacing make a substantial difference in the amount of text per square inch. This is 12 on 14.
Point size and vertical spacing make a substantial difference in the amount of text per square inch. For example, 10 on 12 uses about twice as much space as 7 on 8. This is 6 on 7, which is even smaller. It packs a lot more words per line, but you can go blind trying to read it.
When used without arguments, .psand .vsrevert to the previous size and vertical spacing respectively.
The command
.spis used to get extra vertical space.
Unadorned,
it gives you one extra blank line (one
.vswhatever that has been set to).
Typically, that's more or less than you want,
so
.spcan be followed by
information about how much space you want _
^sp 2i
means `two inches of vertical space'.
^sp 2p
means `two points of vertical space';
and
^sp 2
means `two vertical spaces' _ two of whatever
.vsis set to
(this can also be made explicit with
.sp 2vtroff
also understands decimal fractions in most places,
so
^sp 1.5i
is a space of 1.5 inches.
These same scale factors can be used after
.vsto define line spacing, and in fact after most commands
that deal with physical dimensions.
It should be noted that all size numbers are converted internally to `machine units', which are 1/432 inch (1/6 point). For most purposes, this is enough resolution that you don't have to worry about the accuracy of the representation. The situation is not quite so good vertically, where resolution is 1/144 inch (1/2 point).