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