Commit | Line | Data |
---|---|---|
8340f87c BJ |
1 | .SC "Size and Font Changes" |
2 | .PP | |
3 | By default, equations are set in 10-point type (the same size as this guide), | |
4 | with standard mathematical conventions | |
5 | to determine what characters are in roman and what in italic. | |
6 | Although | |
7 | .UC EQN | |
8 | makes a valiant attempt to use | |
9 | esthetically pleasing sizes and fonts, | |
10 | it is not perfect. | |
11 | To change sizes and fonts, use | |
12 | .ul | |
13 | size n | |
14 | and | |
15 | .ul | |
16 | roman, italic, | |
17 | .ul | |
18 | bold | |
19 | and | |
20 | .ul | |
21 | fat. | |
22 | Like | |
23 | .ul | |
24 | sub | |
25 | and | |
26 | .ul | |
27 | sup, | |
28 | size | |
29 | and font changes affect only the thing that follows | |
30 | them, and revert to the normal situation | |
31 | at the end of it. Thus | |
32 | .P1 | |
33 | bold x y | |
34 | .P2 | |
35 | is | |
36 | .EQ | |
37 | bold x y | |
38 | .EN | |
39 | and | |
40 | .P1 | |
41 | size 14 bold x = y + | |
42 | size 14 {alpha + beta} | |
43 | .P2 | |
44 | gives | |
45 | .EQ | |
46 | size 14 bold x = y + | |
47 | size 14 {alpha + beta} | |
48 | .EN | |
49 | As always, you can use braces if you want to affect something | |
50 | more complicated than a single letter. | |
51 | For example, you can change the size of an entire equation by | |
52 | .P1 | |
53 | size 12 { ... } | |
54 | .P2 | |
55 | .PP | |
56 | Legal sizes which may follow | |
57 | .ul | |
58 | size | |
59 | are | |
60 | 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 36. | |
61 | You can also change the size | |
62 | .ul | |
63 | by | |
64 | a given amount; | |
65 | for example, you can say | |
66 | .ul | |
67 | size~+2 | |
68 | to make the size two points bigger, | |
69 | or | |
70 | .ul | |
71 | size~\(mi3 | |
72 | to make it three points smaller. | |
73 | This has the advantage that you don't have | |
74 | to know what the current size is. | |
75 | .PP | |
76 | If you are using fonts other than roman, italic and bold, | |
77 | you can say | |
78 | .ul | |
79 | font X | |
80 | where | |
81 | .ul | |
82 | X | |
83 | is a one character | |
84 | .UC TROFF | |
85 | name or number for the font. | |
86 | Since | |
87 | .UC EQN | |
88 | is tuned for roman, italic and bold, | |
89 | other fonts may not give quite as good an appearance. | |
90 | .PP | |
91 | The | |
92 | .ul | |
93 | fat | |
94 | operation takes the current font and widens it by overstriking: | |
95 | .ul | |
96 | fat\ grad | |
97 | is | |
98 | $fat grad$ and | |
99 | .ul | |
100 | fat {x sub i} | |
101 | is | |
102 | $fat {x sub i}$. | |
103 | .PP | |
104 | If an entire document is to be in a non-standard size | |
105 | or font, it is a severe nuisance | |
106 | to have to write out a size and font change for each | |
107 | equation. | |
108 | Accordingly, you can set a ``global'' size or font | |
109 | which thereafter affects all equations. | |
110 | At the beginning of any equation, you might say, for instance, | |
111 | .P1 | |
112 | ^EQ | |
113 | gsize 16 | |
114 | gfont R | |
115 | ... | |
116 | ^EN | |
117 | .P2 | |
118 | to set the size to 16 and the font to roman thereafter. | |
119 | In place of R, you can use any of the | |
120 | .UC TROFF | |
121 | font names. | |
122 | The size after | |
123 | .ul | |
124 | gsize | |
125 | can be a relative change with + or \(mi. | |
126 | .PP | |
127 | Generally, | |
128 | .ul | |
129 | gsize | |
130 | and | |
131 | .ul | |
132 | gfont | |
133 | will appear at the beginning of a document | |
134 | but they can also appear | |
135 | thoughout a document: the global font and size | |
136 | can be changed as often as needed. | |
137 | For example, in a footnote\(dd | |
138 | .FS | |
139 | \(ddLike this one, in which we have a | |
140 | $gsize -2$few random | |
141 | expressions like $x sub i$ and $pi sup 2$. | |
142 | The sizes for these were set by the command | |
143 | .ul | |
144 | gsize~\(mi2. | |
145 | .FE $gsize +2$ | |
146 | you will typically want the size of equations to match | |
147 | the size of the footnote text, which is two points smaller | |
148 | than the main text. | |
149 | Don't forget to reset the global size | |
150 | at the end of the footnote. | |
151 | .SC "Diacritical Marks" | |
152 | .PP | |
153 | To get funny marks on top of letters, | |
154 | there are several words: | |
155 | .P1 | |
156 | .tr ^^ | |
157 | .tr ~~ | |
158 | .ta 1i | |
159 | x dot $x dot$ | |
160 | x dotdot $x dotdot$ | |
161 | x hat $x hat$ | |
162 | x tilde $x tilde$ | |
163 | x vec $x vec$ | |
164 | x dyad $x dyad$ | |
165 | x bar $x bar$ | |
166 | x under $x under$ | |
167 | .P2 | |
168 | The diacritical mark is placed at the right height. | |
169 | The | |
170 | .ul | |
171 | bar | |
172 | and | |
173 | .ul | |
174 | under | |
175 | are made the right length for the entire construct, | |
176 | as in $x+y+z bar$; | |
177 | other marks are centered. | |
178 | .SC "Quoted Text" | |
179 | .PP | |
180 | Any input entirely within quotes (\|"..."\|) | |
181 | is not subject to any of the font changes and spacing | |
182 | adjustments normally done by the equation setter. | |
183 | This provides a way to do your own spacing and adjusting if needed: | |
184 | .P1 | |
185 | italic "sin(x)" + sin (x) | |
186 | .P2 | |
187 | is | |
188 | .EQ | |
189 | italic "sin(x)" + sin (x) | |
190 | .EN | |
191 | .PP | |
192 | Quotes are also used to get braces and other | |
193 | .UC EQN | |
194 | keywords printed: | |
195 | .P1 | |
196 | "{ size alpha }" | |
197 | .P2 | |
198 | is | |
199 | .EQ | |
200 | "{ size alpha }" | |
201 | .EN | |
202 | and | |
203 | .P1 | |
204 | roman "{ size alpha }" | |
205 | .P2 | |
206 | is | |
207 | .EQ | |
208 | roman "{ size alpha }" | |
209 | .EN | |
210 | .PP | |
211 | The construction "" is often used as a place-holder | |
212 | when grammatically | |
213 | .UC EQN | |
214 | needs something, but you don't actually want anything in your output. | |
215 | For example, to make | |
216 | $"" sup 2 roman He$, | |
217 | you can't just type | |
218 | .ul | |
219 | sup 2 roman He | |
220 | because a | |
221 | .ul | |
222 | sup | |
223 | has to be a superscript | |
224 | .ul | |
225 | on | |
226 | something. | |
227 | Thus you must say | |
228 | .P1 | |
229 | "" sup 2 roman He | |
230 | .P2 | |
231 | .PP | |
232 | To get a literal quote | |
233 | use ``\\"''. | |
234 | .UC TROFF | |
235 | characters like | |
236 | .ul | |
237 | \e(bs | |
238 | can appear unquoted, but more complicated things like | |
239 | horizontal and vertical motions with | |
240 | .ul | |
241 | \eh | |
242 | and | |
243 | .ul | |
244 | \ev | |
245 | should | |
246 | always | |
247 | be quoted. | |
248 | (If you've never heard of | |
249 | .ul | |
250 | \\h | |
251 | and | |
252 | .ul | |
253 | \\v, | |
254 | ignore this section.) | |
255 | .SC "Lining Up Equations" | |
256 | .PP | |
257 | Sometimes it's necessary to line up a series of equations | |
258 | at some horizontal position, often at an equals sign. | |
259 | This is done with two operations called | |
260 | .ul | |
261 | mark | |
262 | and | |
263 | .ul | |
264 | lineup. | |
265 | .PP | |
266 | The word | |
267 | .ul | |
268 | mark | |
269 | may appear once at any place in an equation. | |
270 | It remembers the horizontal position where it appeared. | |
271 | Successive equations can contain one occurrence of the word | |
272 | .ul | |
273 | lineup. | |
274 | The place where | |
275 | .ul | |
276 | lineup | |
277 | appears is made to line up | |
278 | with the place marked by the previous | |
279 | .ul | |
280 | mark | |
281 | if at all possible. | |
282 | Thus, for example, | |
283 | you can say | |
284 | .P1 | |
285 | ^EQ I | |
286 | x+y mark = z | |
287 | ^EN | |
288 | ^EQ I | |
289 | x lineup = 1 | |
290 | ^EN | |
291 | .P2 | |
292 | to produce | |
293 | .EQ I | |
294 | x+y mark = z | |
295 | .EN | |
296 | .EQ I | |
297 | x lineup = 1 | |
298 | .EN | |
299 | For reasons too complicated to talk about, | |
300 | when you use | |
301 | .UC EQN | |
302 | and | |
303 | `\(mims', | |
304 | use either | |
305 | .UC .EQ\ I | |
306 | or | |
307 | .UC .EQ\ L . | |
308 | mark | |
309 | and | |
310 | .ul | |
311 | lineup | |
312 | don't work with centered equations. | |
313 | Also bear in mind that | |
314 | .ul | |
315 | mark | |
316 | doesn't look ahead; | |
317 | .P1 | |
318 | x mark =1 | |
319 | ... | |
320 | x+y lineup =z | |
321 | .P2 | |
322 | isn't going to work, because there isn't room | |
323 | for the | |
324 | .ul | |
325 | x+y | |
326 | part after the | |
327 | .ul | |
328 | mark | |
329 | remembers where the | |
330 | .ul | |
331 | x | |
332 | is. | |
333 | .SC "Big Brackets, Etc." | |
334 | .PP | |
335 | .tr ~ | |
336 | To get big brackets [~], | |
337 | braces {~}, parentheses (~), and bars |~| | |
338 | around things, use the | |
339 | .ul | |
340 | left | |
341 | and | |
342 | .ul | |
343 | right | |
344 | commands: | |
345 | .tr ~~ | |
346 | .P1 | |
347 | left { a over b + 1 right } | |
348 | ~=~ left ( c over d right ) | |
349 | + left [ e right ] | |
350 | .P2 | |
351 | is | |
352 | .EQ | |
353 | left { a over b + 1 right } ~=~ left ( c over d right ) + left [ e right ] | |
354 | .EN | |
355 | The resulting brackets are made big enough to cover whatever they enclose. | |
356 | Other characters can be used besides these, | |
357 | but the are not likely to look very good. | |
358 | One exception is the | |
359 | .ul | |
360 | floor | |
361 | and | |
362 | .ul | |
363 | ceiling | |
364 | characters: | |
365 | .P1 | |
366 | left floor x over y right floor | |
367 | <= left ceiling a over b right ceiling | |
368 | .P2 | |
369 | produces | |
370 | .EQ | |
371 | left floor x over y right floor | |
372 | <= left ceiling a over b right ceiling | |
373 | .EN | |
374 | .PP | |
375 | Several warnings about brackets are in order. | |
376 | First, braces are typically bigger than brackets and parentheses, | |
377 | because they are made up of three, five, seven, etc., pieces, | |
378 | while brackets can be made up of two, three, etc. | |
379 | Second, big left and right parentheses often look poor, | |
380 | because the character set is poorly designed. | |
381 | .PP | |
382 | The | |
383 | .ul | |
384 | right | |
385 | part may be omitted: | |
386 | a ``left something'' need not have a | |
387 | corresponding | |
388 | ``right | |
389 | something''. | |
390 | If the | |
391 | .ul | |
392 | right | |
393 | part is omitted, | |
394 | put braces around the thing you want the left bracket | |
395 | to encompass. | |
396 | Otherwise, the resulting brackets may be too large. | |
397 | .PP | |
398 | If you want to omit the | |
399 | .ul | |
400 | left | |
401 | part, things are more complicated, | |
402 | because technically you can't have a | |
403 | .ul | |
404 | right | |
405 | without a corresponding | |
406 | .ul | |
407 | left. | |
408 | Instead you have to say | |
409 | .P1 | |
410 | left "" ..... right ) | |
411 | .P2 | |
412 | for example. | |
413 | The | |
414 | .ul | |
415 | left "" | |
416 | means a ``left nothing''. | |
417 | This satisfies the rules without hurting your output. | |
418 | .SC "Piles" | |
419 | .PP | |
420 | There is a general facility for making vertical piles | |
421 | of things; it comes in several flavors. | |
422 | For example: | |
423 | .P1 | |
424 | .tr ~~ | |
425 | A ~=~ left [ | |
426 | pile { a above b above c } | |
427 | ~~ pile { x above y above z } | |
428 | right ] | |
429 | .P2 | |
430 | will make | |
431 | .EQ | |
432 | A ~=~ left [ | |
433 | pile { a above b above c } ~~ pile { x above y above z } | |
434 | right ] | |
435 | .EN | |
436 | The elements of the pile (there can be as many as you want) | |
437 | are centered one above another, at the right height for | |
438 | most purposes. | |
439 | The keyword | |
440 | .ul | |
441 | above | |
442 | is used to separate the pieces; | |
443 | braces are used around the entire list. | |
444 | The elements of a pile can be as complicated as needed, even containing more piles. | |
445 | .PP | |
446 | Three other forms of pile exist: | |
447 | .ul | |
448 | lpile | |
449 | makes a pile with the elements left-justified; | |
450 | .ul | |
451 | rpile | |
452 | makes a right-justified pile; | |
453 | and | |
454 | .ul | |
455 | cpile | |
456 | makes a centered pile, just like | |
457 | .ul | |
458 | pile. | |
459 | The vertical spacing between the pieces | |
460 | is somewhat larger for | |
461 | .ul | |
462 | l-, | |
463 | .ul | |
464 | r- | |
465 | and | |
466 | .ul | |
467 | cpiles | |
468 | than it is for ordinary piles. | |
469 | .P1 2 | |
470 | roman sign (x)~=~ | |
471 | left { | |
472 | lpile {1 above 0 above -1} | |
473 | ~~ lpile | |
474 | {if~x>0 above if~x=0 above if~x<0} | |
475 | .P2 | |
476 | makes | |
477 | .EQ | |
478 | roman sign (x)~=~ | |
479 | left { | |
480 | lpile {1 above 0 above -1} | |
481 | ~~ lpile | |
482 | {if~x>0 above if~x=0 above if~x<0} | |
483 | .EN | |
484 | Notice the left brace | |
485 | without a matching right one. | |
486 | .SC Matrices | |
487 | .PP | |
488 | It is also possible to make matrices. | |
489 | For example, to make | |
490 | a neat array like | |
491 | .EQ | |
492 | matrix { | |
493 | ccol { x sub i above y sub i } | |
494 | ccol { x sup 2 above y sup 2 } | |
495 | } | |
496 | .EN | |
497 | you have to type | |
498 | .P1 | |
499 | matrix { | |
500 | ccol { x sub i above y sub i } | |
501 | ccol { x sup 2 above y sup 2 } | |
502 | } | |
503 | .P2 | |
504 | This produces a matrix with | |
505 | two centered columns. | |
506 | The elements of the columns are then listed just as for a pile, | |
507 | each element separated by the word | |
508 | .ul | |
509 | above. | |
510 | You can also use | |
511 | .ul | |
512 | lcol | |
513 | or | |
514 | .ul | |
515 | rcol | |
516 | to left or right adjust columns. | |
517 | Each column can be separately adjusted, | |
518 | and there can be as many columns as you like. | |
519 | .PP | |
520 | The reason for using a matrix instead of two adjacent piles, by the way, | |
521 | is that if the elements of the piles don't all have the same height, | |
522 | they won't line up properly. | |
523 | A matrix forces them to line up, | |
524 | because it looks at the entire structure before deciding what | |
525 | spacing to use. | |
526 | .PP | |
527 | A word of warning about matrices _ | |
528 | .ul | |
529 | each column must have the same number of elements in it. | |
530 | The world will end if you get this wrong. |