Research V7 development
[unix-history] / usr / doc / trofftut / tt02
CommitLineData
54b544da
BK
1.NH
2Point Sizes; Line Spacing
3.PP
4As mentioned above,
5the command
6.BD .ps
7sets the point size.
8One point is 1/72 inch,
9so 6-point characters are at most 1/12 inch high,
10and 36-point characters are \(12 inch.
11There are 15 point sizes, listed below.
12.P1 1
13.ps 6
146 point: Pack my box with five dozen liquor jugs.
15.ps 7
16.vs 8p
177 point: Pack my box with five dozen liquor jugs.
18.vs 9p
19.ps 8
208 point: Pack my box with five dozen liquor jugs.
21.vs 10p
22.ps 9
239 point: Pack my box with five dozen liquor jugs.
24.vs 11p
25.ps 10
2610 point: Pack my box with five dozen liquor
27.vs 12p
28.ps 11
2911 point: Pack my box with five dozen
30.vs 14p
31.ps 12
3212 point: Pack my box with five dozen
33.vs 16p
34.ps 14
3514 point: Pack my box with five
36.vs 24p
37\s1616 point\s18 18 point\s20 20 point
38.vs 40p
39\s2222\s24 24\s28 28\s36 36
40.ps 10
41.vs 12p
42.P2
43.PP
44If the number after
45.BD .ps
46is not one of these
47legal sizes,
48it is rounded up to the next valid value,
49with a maximum of 36.
50If no number follows
51.BD .ps ,
52.UL troff
53reverts to the previous size, whatever it was.
54.UL troff
55begins with point size 10,
56which is usually fine.
57This document is in 9 point.
58.PP
59The point size can also be changed in the middle of a line
60or even a word
61with the in-line command
62.BD \es .
63To produce
64.P1
65\s8UNIX\s10 runs on a \s8PDP-\s1011/45
66.P2
67type
68.P1
69\es8UNIX\es10 runs on a \es8PDP-\es1011/45
70.P2
71As above,
72.BD \es
73should be followed by a legal point size,
74except that
75.BD \es0
76causes the size to revert to
77its previous value.
78Notice that
79.BD \es1011
80can be understood correctly as `size 10, followed by an 11', if the size is legal,
81but not otherwise.
82Be cautious with similar constructions.
83.PP
84Relative size changes are also legal and useful:
85.P1
86\es\-2UNIX\es+2
87.P2
88temporarily decreases the size, whatever it is, by two points, then
89restores it.
90Relative size changes have the advantage that the size difference
91is independent of the starting size of the document.
92The amount of the relative change is restricted
93to a single digit.
94.WS
95.PP
96The other parameter that determines what the type looks like
97is the spacing between lines,
98which is set independently of the point size.
99Vertical spacing is measured from the bottom of one line to
100the bottom of the next.
101The command to control vertical spacing is
102.BD .vs .
103For running text, it is usually best to set the vertical spacing
104about 20% bigger than the character size.
105For example, so far in this document, we have used
106``9 on 11'', that is,
107.P1
108^ps 9
109^vs 11p
110.P2
111If we changed to
112.P1
113^ps 9
114^vs 9p
115.P2
116.vs 9p
117.ne 3
118the running text would look like this.
119After a few lines, you will agree it looks a little cramped.
120The right vertical spacing is partly a matter of taste, depending on how
121much text you want to squeeze into a given space,
122and partly a matter of traditional printing style.
123By default,
124.UL troff
125uses 10 on 12.
126.PP
127.vs 14p
128.ps 12
129Point size and vertical spacing make a substantial difference in the amount of text
130per square inch.
131This is 12 on 14.
132.ne 2
133.PP
134.ne 2
135.ps 6
136.vs 7p
137Point size and vertical spacing make a substantial difference in the amount of text
138per square inch.
139For example,
14010 on 12 uses about twice as much space as 7 on 8.
141This is 6 on 7, which is even smaller.
142It packs a lot more words per line,
143but you can go blind trying to read it.
144.PP
145When used without arguments,
146.BD .ps
147and
148.BD .vs
149revert to the previous size and vertical spacing
150respectively.
151.WS
152.PP
153The command
154.BD .sp
155is used to get extra vertical space.
156Unadorned,
157it gives you one extra blank line (one
158.BD .vs ,
159whatever that has been set to).
160Typically, that's more or less than you want,
161so
162.BD .sp
163can be followed by
164information about how much space you want _
165.P1
166^sp 2i
167.P2
168means `two inches of vertical space'.
169.P1
170^sp 2p
171.P2
172means `two points of vertical space';
173and
174.P1
175^sp 2
176.P2
177means `two vertical spaces' _ two of whatever
178.BD .vs
179is set to
180(this can also be made explicit with
181.BD .sp\ 2v );
182.UL troff
183also understands decimal fractions in most places,
184so
185.P1
186^sp 1.5i
187.P2
188is a space of 1.5 inches.
189These same scale factors can be used after
190.BD .vs
191to define line spacing, and in fact after most commands
192that deal with physical dimensions.
193.PP
194It should be noted that all size numbers are converted internally
195to `machine units', which are 1/432 inch
196(1/6 point).
197For most purposes, this is enough resolution
198that you don't have to worry about the accuracy of the representation.
199The situation is not quite so good vertically,
200where resolution is 1/144 inch
201(1/2 point).