Commit | Line | Data |
---|---|---|
24ca2f82 KB |
1 | .\" Copyright (c) 1986 The Regents of the University of California. |
2 | .\" All rights reserved. | |
a58a933a | 3 | .\" |
ff262511 | 4 | .\" %sccs.include.redist.roff% |
a58a933a | 5 | .\" |
ff262511 | 6 | .\" @(#)intro.me 6.5 (Berkeley) %G% |
24ca2f82 KB |
7 | .\" |
8 | .UC 7 | |
6ee1589a EA |
9 | .ll 6.5i |
10 | .lt 6.5i | |
11 | .pn 0 | |
d8e2fa6e | 12 | .ds MO 2.27\" version of -me to which this applies |
56e023ca | 13 | .nr si 3n |
6ee1589a EA |
14 | \".he 'USING NROFF AND \-ME''%' |
15 | .eh 'USD:22-%''Writing Papers with NROFF using \-me' | |
16 | .oh 'Writing Papers with NROFF using \-me''USD:22-%' | |
56e023ca EA |
17 | .ds U \s-1UNIX\s0 |
18 | .ds N \s-1NROFF\s0 | |
19 | .ds T \s-1TROFF\s0 | |
20 | .+c | |
21 | .(l C | |
22 | .sz 14 | |
6ee1589a | 23 | .b "Writing Papers with NROFF using \-me" |
56e023ca EA |
24 | .sz |
25 | .sp 2 | |
26 | .ul | |
6ee1589a EA |
27 | Eric P. Allman* |
28 | .(f | |
29 | *Author's current address: | |
30 | Britton Lee, Inc., | |
31 | 1919 Addison Suite 105, | |
32 | Berkeley, California 94704. | |
33 | .)f | |
56e023ca | 34 | .sp |
6ee1589a | 35 | Project INGRES |
56e023ca EA |
36 | Electronics Research Laboratory |
37 | University of California, Berkeley | |
38 | Berkeley, California 94720 | |
39 | .)l | |
40 | .sp 4 | |
41 | .pp | |
42 | This document describes | |
43 | the text processing facilities | |
44 | available on the \*U\(dg | |
45 | .(f | |
6ee1589a EA |
46 | \(dg\*U is a trademark |
47 | of AT&T Bell Laboratories | |
56e023ca EA |
48 | .)f |
49 | operating system | |
50 | via \*N\(dg and the | |
51 | \-me | |
52 | macro package. | |
53 | It is assumed | |
54 | that the reader | |
55 | already is generally familiar | |
56 | with the \*U operating system | |
57 | and a text editor | |
58 | such as | |
59 | .b ex . | |
60 | This is intended to be a casual introduction, | |
61 | and | |
62 | as such not all material is covered. | |
63 | In particular, | |
64 | many variations and additional features | |
65 | of the \-me macro package | |
66 | are not explained. | |
67 | For a complete discussion of this | |
68 | and other issues, | |
69 | see | |
70 | .ul | |
71 | The \-me Reference Manual | |
72 | and | |
73 | .ul | |
74 | The \*N/\*T Reference Manual. | |
75 | .pp | |
76 | \*N, a computer program | |
77 | that runs on the \*U operating system, | |
78 | reads an input file | |
79 | prepared by the user | |
80 | and outputs a formatted paper | |
81 | suitable for publication or framing. | |
82 | The input consists of | |
83 | .i text , | |
84 | or words to be printed, | |
85 | and | |
86 | .i requests , | |
87 | which give instructions | |
88 | to the \*N program | |
89 | telling how to format the printed copy. | |
90 | .pp | |
91 | Section 1 | |
92 | describes the basics | |
93 | of text processing. | |
94 | Section 2 | |
95 | describes the basic requests. | |
96 | Section 3 | |
97 | introduces displays. | |
98 | Annotations, | |
99 | such as footnotes, | |
100 | are handled in | |
101 | section 4. | |
102 | The more complex requests | |
103 | which are not discussed in section 2 | |
104 | are covered in section 5. | |
105 | Finally, | |
106 | section 6 | |
107 | discusses things you will need | |
108 | to know | |
109 | if you want to typeset documents. | |
110 | If you are a novice, | |
111 | you probably won't want to read beyond section 4 | |
112 | until you have tried some of the basic features out. | |
113 | .pp | |
114 | When you have your raw text ready, | |
115 | call the \*N formatter by typing | |
116 | as a request to the \*U shell: | |
117 | .(b | |
118 | nroff \-me \-T\c | |
119 | .i "type files" | |
120 | .)b | |
121 | where | |
122 | .i type | |
123 | describes the type of terminal | |
124 | you are outputting to. | |
125 | Common values are | |
126 | .b dtc | |
127 | for a DTC 300s | |
128 | (daisy-wheel type) | |
129 | printer and | |
130 | .b lpr | |
131 | for the line printer. | |
132 | If the | |
133 | .b \-T | |
134 | flag is omitted, | |
135 | a | |
136 | .q "lowest common denominator" | |
137 | terminal is assumed; | |
138 | this is good for previewing output | |
139 | on most terminals. | |
140 | A complete description of options | |
141 | to the \*N command can be found in | |
142 | .ul | |
143 | The \*N/\*T Reference Manual. | |
144 | .pp | |
145 | The word | |
146 | .i argument | |
147 | is used in this manual | |
148 | to mean a word or number | |
149 | which appears on the same line | |
150 | as a request | |
151 | which modifies the meaning | |
152 | of that request. | |
153 | For example, | |
154 | the request | |
155 | .(b | |
156 | \&.sp | |
157 | .)b | |
158 | spaces one line, | |
159 | but | |
160 | .(b | |
161 | \&.sp 4 | |
162 | .)b | |
163 | spaces four lines. | |
164 | The number | |
165 | .b 4 | |
166 | is an | |
167 | .i argument | |
168 | to the | |
169 | .b .sp | |
170 | request | |
171 | which says to space four lines | |
172 | instead of one. | |
173 | Arguments are separated from the request | |
174 | and from each other | |
175 | by spaces. | |
176 | .sh 1 "Basics of Text Processing" | |
177 | .pp | |
178 | The primary function | |
179 | of \*N | |
180 | is to | |
181 | .i collect | |
182 | words from input lines, | |
183 | .i fill | |
184 | output lines with those words, | |
185 | .i justify | |
186 | the right hand margin by inserting extra spaces | |
187 | in the line, | |
188 | and output the result. | |
189 | For example, | |
190 | the input: | |
191 | .(b | |
192 | Now is the time | |
193 | for all good men | |
194 | to come to the aid | |
195 | of their party. | |
196 | Four score and seven | |
197 | years ago,... | |
198 | .)b | |
199 | will be read, | |
200 | packed onto output lines, | |
201 | and justified | |
202 | to produce: | |
203 | .(b F | |
204 | Now is the time | |
205 | for all good men | |
206 | to come to the aid | |
207 | of their party. | |
208 | Four score and seven | |
209 | years ago,... | |
210 | .)b | |
211 | Sometimes you may want to start a new output line | |
212 | even though the line you are on | |
213 | is not yet full; | |
214 | for example, | |
215 | at the end of a paragraph. | |
216 | To do this | |
217 | you can cause a | |
218 | .i break , | |
219 | which | |
220 | starts a new output line. | |
221 | Some requests | |
222 | cause a break automatically, | |
223 | as do blank input lines | |
224 | and input lines beginning with a space. | |
225 | .pp | |
226 | Not all input lines | |
227 | are text to be formatted. | |
228 | Some of the input lines | |
229 | are | |
230 | .i requests | |
231 | which describe | |
232 | how to format the text. | |
233 | Requests always have a period | |
234 | or an apostrophe | |
235 | (\c | |
236 | .q "\|\(aa\|" ) | |
237 | as the first character | |
238 | of the input line. | |
239 | .pp | |
240 | The text formatter | |
241 | also does more complex things, | |
242 | such as automatically numbering pages, | |
243 | skipping over page folds, | |
244 | putting footnotes in the correct place, | |
245 | and so forth. | |
246 | .pp | |
247 | I can offer you a few hints | |
248 | for preparing text | |
249 | for input to \*N. | |
250 | First, | |
251 | keep the input lines short. | |
252 | Short input lines are easier to edit, | |
253 | and \*N will pack words onto longer lines | |
254 | for you anyhow. | |
255 | In keeping with this, | |
256 | it is helpful | |
257 | to begin a new line | |
258 | after every period, | |
259 | comma, | |
260 | or phrase, | |
261 | since common corrections | |
262 | are to add or delete sentences | |
263 | or phrases. | |
264 | Second, | |
265 | do not put spaces at the end of lines, | |
266 | since this can sometimes confuse the \*N | |
267 | processor. | |
268 | Third, | |
269 | do not hyphenate words at the end of lines | |
270 | (except words that should have hyphens in them, | |
271 | such as | |
272 | .q mother-in-law ); | |
273 | \*N is smart enough to hyphenate words | |
274 | for you as needed, | |
275 | but is not smart enough | |
276 | to take hyphens out | |
277 | and join a word back together. | |
278 | Also, | |
279 | words such as | |
280 | .q mother-in-law | |
281 | should not be broken | |
282 | over a line, | |
283 | since then you will get a space | |
284 | where not wanted, | |
285 | such as | |
286 | .tr @- | |
287 | .nh | |
288 | .q "mother@\ in@law" . | |
289 | .br | |
290 | .tr @@ | |
291 | .hy 14 | |
292 | .sh 1 "Basic Requests" | |
293 | .sh 2 "Paragraphs" | |
294 | .pp | |
295 | Paragraphs are begun | |
296 | by using the | |
297 | .b .pp | |
298 | request. | |
299 | For example, | |
300 | the input: | |
301 | .(b | |
302 | \&.pp | |
303 | Now is the time for all good men | |
304 | to come to the aid of their party. | |
305 | Four score and seven years ago,... | |
306 | .)b | |
307 | produces a blank line | |
308 | followed by an indented first line. | |
309 | The result is: | |
310 | .(b F | |
311 | .ti +\n(piu | |
312 | Now is the time for all good men | |
313 | to come to the aid of their party. | |
314 | Four score and seven years ago,... | |
315 | .)b | |
316 | .pp | |
317 | Notice that the sentences | |
318 | of the paragraphs | |
319 | .i "must not" | |
320 | begin with a space, | |
321 | since blank lines | |
6ee1589a | 322 | and lines beginning with spaces |
56e023ca EA |
323 | cause a break. |
324 | For example, | |
325 | if I had typed: | |
326 | .(b | |
327 | \&.pp | |
328 | Now is the time for all good men | |
329 | to come to the aid of their party. | |
330 | Four score and seven years ago,... | |
331 | .)b | |
332 | The output would be: | |
333 | .(b F | |
334 | .ti +\n(piu | |
335 | Now is the time for all good men | |
336 | to come to the aid of their party. | |
337 | Four score and seven years ago,... | |
338 | .)b | |
339 | A new line begins after the word | |
340 | .q men | |
341 | because the second line began with a space character. | |
342 | .pp | |
343 | There are many | |
344 | fancier | |
345 | types of paragraphs, | |
346 | which will be described later. | |
347 | .sh 2 "Headers and Footers" | |
348 | .pp | |
349 | Arbitrary headers and footers | |
350 | can be put | |
351 | at the top and bottom | |
352 | of every page. | |
353 | Two requests | |
354 | of the form | |
355 | .b .he \ \c | |
356 | .i title | |
357 | and | |
358 | .b .fo \ \c | |
359 | .i title | |
360 | define the titles to put at the head and the foot | |
361 | of every page, | |
362 | respectively. | |
363 | The titles are called | |
364 | .i three-part | |
365 | titles, | |
366 | that is, | |
367 | there is a left-justified part, | |
368 | a centered part, | |
369 | and a right-justified part. | |
370 | To separate these three parts | |
371 | the first character of | |
372 | .i title | |
373 | (whatever it may be) | |
374 | is used as a delimiter. | |
375 | Any character may be used, | |
376 | but | |
377 | backslash | |
378 | and double quote marks | |
379 | should be avoided. | |
380 | The percent sign | |
381 | is replaced by the current page number | |
382 | whenever found in the title. | |
383 | For example, | |
384 | the input: | |
385 | .(b | |
386 | \&.he \(aa\(aa%\(aa\(aa | |
387 | \&.fo \(aaJane Jones\(aa\(aaMy Book\(aa | |
388 | .)b | |
389 | results in the page number | |
390 | centered at the top | |
391 | of each page, | |
392 | .q "Jane Jones" | |
393 | in the lower left corner, | |
394 | and | |
395 | .q "My Book" | |
396 | in the lower right corner. | |
397 | .sh 2 "Double Spacing" | |
398 | .pp | |
399 | .ls 2 | |
400 | \*N will double space output text automatically if you | |
401 | use the request | |
402 | .b ".ls\ 2" , | |
403 | as is done in this section. | |
404 | You can revert to single spaced mode | |
405 | by typing | |
406 | .b ".ls\ 1" . | |
407 | .ls 1 | |
408 | .sh 2 "Page Layout" | |
409 | .pp | |
410 | A number of requests allow | |
411 | you to change the way the printed copy looks, | |
412 | sometimes called the | |
413 | .i layout | |
414 | of the output page. | |
415 | Most of these requests adjust the placing | |
416 | of | |
417 | .q "white space" | |
418 | (blank lines or spaces). | |
419 | In these explanations, | |
420 | characters in italics | |
421 | should be replaced with values you wish to use; | |
422 | bold characters | |
423 | represent characters which should actually be typed. | |
424 | .pp | |
425 | The | |
426 | .b .bp | |
427 | request | |
428 | starts a new page. | |
429 | .pp | |
430 | The request | |
431 | .b .sp \ \c | |
432 | .i N | |
433 | leaves | |
434 | .i N | |
435 | lines of blank space. | |
436 | .i N | |
437 | can be omitted | |
438 | (meaning skip a single line) | |
439 | or can be of the form | |
440 | .i N \^\c | |
441 | .b i | |
442 | (for | |
443 | .i N | |
444 | inches) | |
445 | or | |
446 | .i N \^\c | |
447 | .b c | |
448 | (for | |
449 | .i N | |
450 | centimeters). | |
451 | For example, the input: | |
452 | .(b | |
453 | \&.sp 1.5i | |
454 | My thoughts on the subject | |
455 | \&.sp | |
456 | .)b | |
457 | leaves one and a half inches of space, | |
458 | followed by the line | |
459 | .q "My thoughts on the subject" , | |
460 | followed by a single blank line. | |
461 | .pp | |
462 | The | |
463 | .b .in \ \c | |
464 | .i +N | |
465 | request | |
466 | changes the amount of white space | |
467 | on the left of the page | |
468 | (the | |
469 | .i indent ). | |
470 | The argument | |
471 | .i N | |
472 | can be of the form | |
473 | .b + \c | |
474 | .i N | |
475 | (meaning leave | |
476 | .i N | |
477 | spaces more than you are already leaving), | |
478 | .b \- \c | |
479 | .i N | |
480 | (meaning leave less than you do now), | |
481 | or just | |
482 | .i N | |
483 | (meaning leave exactly | |
484 | .i N | |
485 | spaces). | |
486 | .i N | |
487 | can be of the form | |
488 | .i N \^\c | |
489 | .b i | |
490 | or | |
491 | .i N \^\c | |
492 | .b c | |
493 | also. | |
494 | For example, | |
495 | the input: | |
496 | .(b | |
497 | initial text | |
498 | \&.in 5 | |
499 | some text | |
500 | \&.in +1i | |
501 | more text | |
502 | \&.in \-2c | |
503 | final text | |
504 | .)b | |
505 | produces | |
506 | .q "some text" | |
507 | indented exactly five spaces | |
508 | from the left margin, | |
509 | .q "more text" | |
510 | indented five spaces | |
511 | plus one inch | |
512 | from the left margin | |
513 | (fifteen spaces | |
514 | on a pica typewriter), | |
515 | and | |
516 | .q "final text" | |
517 | indented five spaces | |
518 | plus one inch | |
519 | minus two centimeters | |
520 | from the margin. | |
521 | That is, | |
522 | the output is: | |
523 | .(b | |
524 | initial text | |
525 | .in +5 | |
526 | some text | |
527 | .in +1i | |
528 | more text | |
529 | .in -2c | |
530 | final text | |
531 | .)b | |
532 | .pp | |
533 | The | |
534 | .b .ti \ \c | |
535 | .i +N | |
536 | (temporary indent) | |
537 | request is used like | |
538 | .b .in \ \c | |
539 | .i +N | |
540 | when the indent | |
541 | should apply to one line only, | |
542 | after which it should revert | |
543 | to the previous indent. | |
544 | For example, | |
545 | the input: | |
546 | .(b | |
547 | \&.in 1i | |
548 | \&.ti 0 | |
549 | Ware, James R. The Best of Confucius, | |
550 | Halcyon House, 1950. | |
551 | An excellent book containing translations of | |
552 | most of Confucius\(aa most delightful sayings. | |
553 | A definite must for anyone interested in the early foundations | |
554 | of Chinese philosophy. | |
555 | .)b | |
556 | produces: | |
557 | .in 1i+\n($iu | |
558 | .ti \n($iu | |
559 | Ware, James R. The Best of Confucius, | |
560 | Halcyon House, 1950. | |
561 | An excellent book containing translations of | |
562 | most of Confucius' most delightful sayings. | |
563 | A definite must for anyone interested in the early foundations | |
564 | of Chinese philosophy. | |
565 | .pp | |
566 | Text lines can be centered | |
567 | by using the | |
568 | .b .ce | |
569 | request. | |
570 | The line after the | |
571 | .b .ce | |
572 | is centered | |
573 | (horizontally) | |
574 | on the page. | |
575 | To center more than one line, | |
576 | use | |
577 | .b .ce \ \c | |
578 | .i N | |
579 | (where | |
580 | .i N | |
581 | is the number of lines to center), | |
582 | followed by the | |
583 | .i N | |
584 | lines. | |
585 | If you want to center many lines | |
586 | but don't want to count them, | |
587 | type: | |
588 | .(b | |
589 | \&.ce 1000 | |
590 | lines to center | |
591 | \&.ce 0 | |
592 | .)b | |
593 | The | |
594 | .b ".ce\ 0" | |
595 | request tells \*N to center zero more lines, | |
596 | in other words, | |
597 | stop centering. | |
598 | .pp | |
599 | All of these requests | |
600 | cause a break; | |
601 | that is, | |
602 | they always start | |
603 | a new line. | |
604 | If you want to start a new line | |
605 | without performing any other action, | |
606 | use | |
607 | .b .br . | |
608 | .sh 2 "Underlining" | |
609 | .pp | |
610 | Text can be underlined | |
611 | using the | |
612 | .b .ul | |
613 | request. | |
614 | The | |
615 | .b .ul | |
616 | request | |
617 | causes the next input line | |
618 | to be underlined when output. | |
619 | You can underline multiple lines | |
620 | by stating a count of | |
621 | .i input | |
622 | lines to underline, | |
623 | followed by those lines | |
624 | (as with the | |
625 | .b .ce | |
626 | request). | |
627 | For example, | |
628 | the input: | |
629 | .(b | |
630 | \&.ul 2 | |
631 | Notice that these two input lines | |
632 | are underlined. | |
633 | .)b | |
634 | will underline those eight words in \*N. | |
635 | (In \*T they will be set in italics.) | |
636 | .sh 1 "Displays" | |
637 | .pp | |
638 | Displays are sections of text | |
639 | to be set off | |
640 | from the body of the paper. | |
641 | Major quotes, | |
642 | tables, | |
643 | and figures | |
644 | are types of displays, | |
645 | as are all the examples | |
646 | used in this document. | |
647 | All displays | |
648 | except centered blocks | |
649 | are output | |
650 | single spaced. | |
651 | .sh 2 "Major Quotes" | |
652 | .pp | |
653 | Major quotes | |
654 | are quotes which are several lines long, | |
655 | and hence are set in from the rest | |
656 | of the text | |
657 | without quote marks | |
658 | around them. | |
659 | These can be generated | |
6ee1589a | 660 | using the commands |
56e023ca EA |
661 | .b .(q |
662 | and | |
663 | .b .)q | |
664 | to surround the quote. | |
665 | For example, | |
666 | the input: | |
667 | .(b | |
668 | As Weizenbaum points out: | |
669 | \&.(q | |
670 | It is said that to explain is to explain away. | |
671 | This maxim is nowhere so well fulfilled | |
672 | as in the areas of computer programming,... | |
673 | \&.)q | |
674 | .)b | |
675 | generates as output: | |
676 | .lp | |
677 | As Weizenbaum points out: | |
678 | .(q | |
679 | It is said that to explain is to explain away. | |
680 | This maxim is nowhere so well fulfilled | |
681 | as in the areas of computer programming,... | |
682 | .)q | |
683 | .sh 2 "Lists" | |
684 | .pp | |
685 | A | |
686 | .i list | |
687 | is an indented, | |
688 | single spaced, | |
689 | unfilled display. | |
690 | Lists should be used | |
691 | when the material to be printed | |
692 | should not be filled and justified | |
693 | like normal text, | |
694 | such as columns of figures | |
695 | or the examples used in this paper. | |
696 | Lists are surrounded | |
697 | by the requests | |
698 | .b .(l | |
699 | and | |
700 | .b .)l . | |
701 | For example, | |
702 | type: | |
703 | .(b | |
704 | Alternatives to avoid deadlock are: | |
705 | \&.(l | |
706 | Lock in a specified order | |
707 | Detect deadlock and back out one process | |
708 | Lock all resources needed before proceeding | |
709 | \&.)l | |
710 | .)b | |
711 | will produce: | |
712 | .br | |
713 | Alternatives to avoid deadlock are: | |
714 | .(l | |
715 | Lock in a specified order | |
716 | Detect deadlock and back out one process | |
717 | Lock all resources needed before proceeding | |
718 | .)l | |
719 | .sh 2 "Keeps" | |
720 | .pp | |
721 | A | |
722 | .i keep | |
723 | is a display of lines | |
724 | which are kept on a single page | |
725 | if possible. | |
726 | An example of where you would use a keep | |
727 | might be a diagram. | |
728 | Keeps differ from lists | |
729 | in that lists may be broken | |
730 | over a page boundary | |
731 | whereas keeps will not. | |
732 | .pp | |
733 | Blocks are the basic kind of keep. | |
734 | They begin with the request | |
735 | .b .(b | |
736 | and end with the request | |
737 | .b .)b . | |
738 | If there is not room on the current page | |
739 | for everything in the block, | |
740 | a new page is begun. | |
741 | This has the unpleasant effect | |
742 | of leaving blank space | |
743 | at the bottom of the page. | |
744 | When this is not appropriate, | |
745 | you can use the alternative, | |
746 | called | |
747 | .i "floating keeps" . | |
748 | .pp | |
749 | .i "Floating keeps" | |
750 | move relative to the text. | |
751 | Hence, | |
752 | they are good for things | |
753 | which will be referred to | |
754 | by name, | |
755 | such as | |
756 | .q "See figure 3" . | |
757 | A floating keep will appear | |
758 | at the bottom of the current page | |
759 | if it will fit; | |
760 | otherwise, | |
761 | it will appear at the top | |
762 | of the next page. | |
763 | Floating keeps begin with the line | |
764 | .b .(z | |
765 | and end with the line | |
766 | .b .)z . | |
767 | For an example of a floating keep, | |
768 | see figure 1. | |
769 | .(z | |
770 | .in 1i | |
771 | .xl -1i | |
772 | .hl | |
773 | \&.(z | |
774 | \&.hl | |
775 | Text of keep to be floated. | |
776 | \&.sp | |
777 | \&.ce | |
778 | Figure 1. Example of a Floating Keep. | |
779 | \&.hl | |
780 | \&.)z | |
781 | .sp | |
782 | .ce | |
783 | Figure 1. Example of a Floating Keep. | |
784 | .hl | |
785 | .)z | |
786 | The | |
787 | .b .hl | |
788 | request is used | |
789 | to draw a horizontal line | |
790 | so that the figure | |
791 | stands out from the text. | |
792 | .sh 2 "Fancier Displays" | |
793 | .pp | |
794 | Keeps and lists are normally collected in | |
795 | .i nofill | |
796 | mode, | |
797 | so that they are good for tables and such. | |
798 | If you want a display | |
799 | in fill mode | |
800 | (for text), | |
801 | type | |
802 | .b ".(l\ F" | |
803 | (Throughout this section, | |
804 | comments applied to | |
805 | .b .(l | |
806 | also apply to | |
807 | .b .(b | |
808 | and | |
809 | .b .(z ). | |
810 | This kind of display | |
811 | will be indented from both margins. | |
812 | For example, | |
813 | the input: | |
814 | .(b | |
815 | \&.(l F | |
816 | And now boys and girls, | |
817 | a newer, bigger, better toy than ever before! | |
818 | Be the first on your block to have your own computer! | |
819 | Yes kids, you too can have one of these modern | |
820 | data processing devices. | |
821 | You too can produce beautifully formatted papers | |
822 | without even batting an eye! | |
823 | \&.)l | |
824 | .)b | |
825 | will be output as: | |
826 | .(b F | |
827 | And now boys and girls, | |
828 | a newer, bigger, better toy than ever before! | |
829 | Be the first on your block to have your own computer! | |
830 | Yes kids, you too can have one of these modern | |
831 | data processing devices. | |
832 | You too can produce beautifully formatted papers | |
833 | without even batting an eye! | |
834 | .)b | |
835 | .pp | |
836 | Lists and blocks are also normally indented | |
837 | (floating keeps are normally left justified). | |
838 | To get a left-justified list, | |
839 | type | |
840 | .b ".(l\ L" . | |
841 | To get a list centered | |
842 | line-for-line, | |
843 | type | |
844 | .b ".(l C" . | |
845 | For example, | |
846 | to get a filled, | |
847 | left justified list, enter: | |
848 | .(b | |
849 | \&.(l L F | |
850 | text of block | |
851 | \&.)l | |
852 | .)b | |
853 | The input: | |
854 | .(b | |
855 | \&.(l | |
856 | first line of unfilled display | |
857 | more lines | |
858 | \&.)l | |
859 | .)b | |
860 | produces the indented text: | |
861 | .(b | |
862 | first line of unfilled display | |
863 | more lines | |
864 | .)b | |
865 | Typing the character | |
866 | .b L | |
867 | after the | |
868 | .b .(l | |
869 | request produces the left justified result: | |
870 | .(b L | |
871 | first line of unfilled display | |
872 | more lines | |
873 | .)b | |
874 | Using | |
875 | .b C | |
876 | instead of | |
877 | .b L | |
878 | produces the line-at-a-time centered output: | |
879 | .(b C | |
880 | first line of unfilled display | |
881 | more lines | |
882 | .)b | |
883 | .pp | |
884 | Sometimes it may be | |
885 | that you want to center several lines | |
886 | as a group, | |
887 | rather than centering them | |
888 | one line at a time. | |
889 | To do this | |
890 | use centered blocks, | |
891 | which are surrounded by the requests | |
892 | .b .(c | |
893 | and | |
894 | .b .)c . | |
895 | All the lines are centered as a unit, | |
896 | such that the longest line is centered | |
897 | and the rest are | |
898 | lined up around that line. | |
899 | Notice that lines | |
900 | do not move | |
901 | relative to each other | |
902 | using centered blocks, | |
903 | whereas they do | |
904 | using the | |
905 | .b C | |
906 | argument to keeps. | |
907 | .pp | |
908 | Centered blocks are | |
909 | .i not | |
910 | keeps, | |
911 | and may be used | |
912 | in conjunction | |
913 | with keeps. | |
914 | For example, | |
915 | to center a group of lines | |
916 | as a unit | |
917 | and keep them | |
918 | on one page, | |
919 | use: | |
920 | .(b | |
921 | \&.(b L | |
922 | \&.(c | |
923 | first line of unfilled display | |
924 | more lines | |
925 | \&.)c | |
926 | \&.)b | |
927 | .)b | |
928 | to produce: | |
929 | .(b L | |
930 | .(c | |
931 | first line of unfilled display | |
932 | more lines | |
933 | .)c | |
934 | .)b | |
935 | If the block requests | |
936 | (\c | |
937 | .b .(b | |
938 | and | |
939 | .b .)b ) | |
940 | had been omitted | |
941 | the result would have been the same, | |
942 | but with no guarantee | |
943 | that the lines of the centered block | |
944 | would have all been on one page. | |
945 | Note the use of the | |
946 | .b L | |
947 | argument to | |
948 | .b .(b ; | |
949 | this causes the centered block | |
950 | to center within the entire line | |
951 | rather than within the line | |
952 | minus the indent. | |
953 | Also, | |
954 | the center requests | |
955 | must | |
956 | be nested | |
957 | .i inside | |
958 | the keep requests. | |
959 | .sh 1 "Annotations" | |
960 | .pp | |
961 | There are a number of requests | |
962 | to save text | |
963 | for later printing. | |
964 | .i Footnotes | |
965 | are printed at the bottom of the current page. | |
966 | .i "Delayed text" | |
967 | is intended to be a variant form | |
968 | of footnote; | |
969 | the text is printed only | |
970 | when explicitly called for, | |
971 | such as at the end of each chapter. | |
972 | .i Indexes | |
973 | are a type of delayed text | |
974 | having a tag | |
975 | (usually the page number) | |
976 | attached to each entry | |
977 | after a row of dots. | |
978 | Indexes are also saved | |
979 | until called for explicitly. | |
980 | .sh 2 "Footnotes" | |
981 | .pp | |
982 | Footnotes begin with the request | |
983 | .b .(f | |
984 | and end with the request | |
985 | .b .)f . | |
986 | The current footnote number is maintained | |
987 | automatically, | |
988 | and can be used by typing \e**, | |
989 | to produce a footnote number\**. | |
990 | .(f | |
991 | \**Like this. | |
992 | .)f | |
993 | The number is automatically incremented | |
994 | after every footnote. | |
995 | For example, | |
996 | the input: | |
997 | .(b | |
998 | \&.(q | |
999 | A man who is not upright | |
1000 | and at the same time is presumptuous; | |
1001 | one who is not diligent and at the same time is ignorant; | |
1002 | one who is untruthful and at the same time is incompetent; | |
1003 | such men I do not count among acquaintances.\e** | |
1004 | \&.(f | |
1005 | \e**James R. Ware, | |
1006 | \&.ul | |
1007 | The Best of Confucius, | |
1008 | Halcyon House, 1950. | |
1009 | Page 77. | |
1010 | \&.)f | |
1011 | \&.)q | |
1012 | .)b | |
1013 | generates the result: | |
1014 | .(q | |
1015 | A man who is not upright | |
1016 | and at the same time is presumptuous; | |
1017 | one who is not diligent and at the same time is ignorant; | |
1018 | one who is untruthful and at the same time is incompetent; | |
1019 | such men I do not count among acquaintances.\** | |
1020 | .(f | |
1021 | \**James R. Ware, | |
1022 | .ul | |
1023 | The Best of Confucius, | |
1024 | Halcyon House, 1950. | |
1025 | Page 77. | |
1026 | .)f | |
1027 | .)q | |
1028 | It is important | |
1029 | that the footnote | |
1030 | appears | |
1031 | .i inside | |
1032 | the quote, | |
1033 | so that you can be sure | |
1034 | that the footnote | |
1035 | will appear | |
1036 | on the same page | |
1037 | as the quote. | |
1038 | .sh 2 "Delayed Text" | |
1039 | .pp | |
1040 | Delayed text | |
1041 | is very similar to a footnote | |
1042 | except that it is printed | |
1043 | when called for explicitly. | |
1044 | This allows a list of | |
1045 | references to | |
1046 | appear | |
1047 | (for example) | |
1048 | at the end of each chapter, | |
1049 | as is the convention in some disciplines. | |
1050 | Use | |
1051 | .b \e*# | |
1052 | on delayed text | |
1053 | instead of | |
1054 | .b \e** | |
1055 | as on footnotes. | |
1056 | .pp | |
1057 | If you are using delayed text | |
1058 | as your standard reference mechanism, | |
1059 | you can still use footnotes, | |
1060 | except that you may want to reference them | |
1061 | with special characters* | |
1062 | .(f | |
1063 | *Such as an asterisk. | |
1064 | .)f | |
1065 | rather than numbers. | |
1066 | .sh 2 "Indexes" | |
1067 | .pp | |
1068 | An | |
1069 | .q index | |
1070 | (actually more like a table of contents, | |
1071 | since the entries are not sorted alphabetically) | |
1072 | resembles delayed text, | |
1073 | in that it is saved until called for. | |
1074 | However, | |
1075 | each entry has the page number | |
1076 | (or some other tag) | |
1077 | appended to the last line | |
1078 | of the index entry | |
1079 | after a row of dots. | |
1080 | .pp | |
1081 | Index entries begin with the request | |
1082 | .b .(x | |
1083 | and end with | |
1084 | .b .)x . | |
1085 | The | |
1086 | .b .)x | |
1087 | request may have a argument, | |
1088 | which is the value to print | |
1089 | as the | |
1090 | .q "page number" . | |
1091 | It defaults to the current page number. | |
1092 | If the page number given is an underscore | |
1093 | (\c | |
1094 | .q _ ) | |
1095 | no page number | |
1096 | or line of dots | |
1097 | is printed at all. | |
1098 | To get the line of dots | |
1099 | without a page number, | |
1100 | type | |
1101 | .b ".)x """"" , | |
1102 | which specifies an explicitly null page number. | |
1103 | .pp | |
1104 | The | |
1105 | .b .xp | |
1106 | request prints the index. | |
1107 | .pp | |
1108 | For example, | |
1109 | the input: | |
1110 | .(b | |
1111 | \&.(x | |
1112 | Sealing wax | |
1113 | \&.)x | |
1114 | \&.(x | |
1115 | Cabbages and kings | |
1116 | \&.)x _ | |
1117 | \&.(x | |
1118 | Why the sea is boiling hot | |
1119 | \&.)x 2.5a | |
1120 | \&.(x | |
1121 | Whether pigs have wings | |
1122 | \&.)x "" | |
1123 | \&.(x | |
1124 | This is a terribly long index entry, such as might be used | |
1125 | for a list of illustrations, tables, or figures; I expect it to | |
1126 | take at least two lines. | |
1127 | \&.)x | |
1128 | \&.xp | |
1129 | .)b | |
1130 | generates: | |
1131 | .(x | |
1132 | Sealing wax | |
1133 | .)x | |
1134 | .(x | |
1135 | Cabbages and kings | |
1136 | .)x _ | |
1137 | .(x | |
1138 | Why the sea is boiling hot | |
1139 | .)x 2.5a | |
1140 | .(x | |
1141 | Whether pigs have wings | |
1142 | .)x "" | |
1143 | .(x | |
1144 | This is a terribly long index entry, such as might be used | |
1145 | for a list of illustrations, tables, or figures; I expect it to | |
1146 | take at least two lines. | |
1147 | .)x | |
1148 | .xp | |
1149 | .pp | |
1150 | The | |
1151 | .b .(x | |
1152 | request may have a single character | |
1153 | argument, | |
1154 | specifying the | |
1155 | .q name | |
1156 | of the index; | |
1157 | the normal index is | |
1158 | .b x . | |
1159 | Thus, | |
1160 | several | |
6ee1589a | 1161 | .q indices |
56e023ca EA |
1162 | may be maintained simultaneously |
1163 | (such as a list of tables, table of contents, etc.). | |
1164 | .pp | |
1165 | Notice that the index must be printed | |
1166 | at the | |
1167 | .i end | |
1168 | of the paper, | |
1169 | rather than at the beginning | |
1170 | where it will probably appear | |
1171 | (as a table of contents); | |
1172 | the pages may have to be physically rearranged | |
1173 | after printing. | |
1174 | .sh 1 "Fancier Features" | |
1175 | .pp | |
1176 | A large number of fancier requests | |
1177 | exist, | |
1178 | notably requests to provide other sorts of paragraphs, | |
1179 | numbered sections of the form | |
1180 | .b 1.2.3 | |
1181 | (such as used in this document), | |
1182 | and multicolumn output. | |
1183 | .sh 2 "More Paragraphs" | |
1184 | .pp | |
1185 | Paragraphs generally start with | |
1186 | a blank line | |
1187 | and with the first line | |
1188 | indented. | |
1189 | It is possible to get | |
1190 | left-justified block-style paragraphs | |
1191 | by using | |
1192 | .b .lp | |
1193 | instead of | |
1194 | .b .pp , | |
1195 | as demonstrated by the next paragraph. | |
1196 | .lp | |
1197 | Sometimes you want to use paragraphs | |
1198 | that have the | |
1199 | .i body | |
1200 | indented, | |
1201 | and the first line | |
1202 | exdented | |
1203 | (opposite of indented) | |
1204 | with a label. | |
1205 | This can be done with the | |
1206 | .b .ip | |
1207 | request. | |
1208 | A word specified on the same line as | |
1209 | .b .ip | |
1210 | is printed in the margin, | |
1211 | and the body is lined up | |
1212 | at a prespecified position | |
1213 | (normally five spaces). | |
1214 | For example, | |
1215 | the input: | |
1216 | .(b | |
1217 | \&.ip one | |
1218 | This is the first paragraph. | |
1219 | Notice how the first line | |
1220 | of the resulting paragraph lines up | |
1221 | with the other lines in the paragraph. | |
1222 | \&.ip two | |
1223 | And here we are at the second paragraph already. | |
1224 | You may notice that the argument to \c | |
1225 | .b .ip | |
1226 | appears | |
1227 | in the margin. | |
1228 | \&.lp | |
1229 | We can continue text... | |
1230 | .)b | |
1231 | produces as output: | |
1232 | .ip one | |
1233 | This is the first paragraph. | |
1234 | Notice how the first line of the resulting paragraph lines up | |
1235 | with the other lines in the paragraph. | |
1236 | .ip two | |
1237 | And here we are at the second paragraph already. | |
1238 | You may notice that the argument to | |
1239 | .b .ip | |
1240 | appears | |
1241 | in the margin. | |
1242 | .lp | |
1243 | We can continue text without starting a new indented | |
1244 | paragraph | |
1245 | by using the | |
1246 | .b .lp | |
1247 | request. | |
1248 | .pp | |
1249 | If you have spaces in the label of a | |
1250 | .b .ip | |
1251 | request, | |
1252 | you must use an | |
1253 | .q "unpaddable space" | |
1254 | instead of a regular space. | |
1255 | This is typed as a backslash character | |
1256 | (\c | |
1257 | .q \e ) | |
1258 | followed by a space. | |
1259 | For example, | |
1260 | to print the label | |
1261 | .q "Part 1" , | |
1262 | enter: | |
1263 | .(b | |
1264 | \&.ip "Part\e 1" | |
1265 | .)b | |
1266 | .pp | |
1267 | If a label of an indented paragraph | |
1268 | (that is, the argument to | |
1269 | .b .ip ) | |
1270 | is longer than the space allocated for the label, | |
1271 | .b .ip | |
1272 | will begin a new line after the label. | |
1273 | For example, | |
1274 | the input: | |
1275 | .(b | |
1276 | \&.ip longlabel | |
1277 | This paragraph had a long label. | |
1278 | The first character of text on the first line | |
1279 | will not line up with the text on second and subsequent lines, | |
1280 | although they will line up with each other. | |
1281 | .)b | |
1282 | will produce: | |
1283 | .ip longlabel | |
1284 | This paragraph had a long label. | |
1285 | The first character of text on the first line | |
1286 | will not line up with the text on second and subsequent lines, | |
1287 | although they will line up with each other. | |
1288 | .pp | |
1289 | It is possible to change the size of the label | |
1290 | by using a second argument | |
1291 | which is the size of the label. | |
1292 | For example, | |
1293 | the above example could be done correctly | |
1294 | by saying: | |
1295 | .(b | |
1296 | \&.ip longlabel 10 | |
1297 | .)b | |
1298 | which will make the paragraph indent | |
1299 | 10 spaces for this paragraph only. | |
1300 | If you have many paragraphs to indent | |
1301 | all the same amount, | |
1302 | use the | |
1303 | .i "number register" | |
1304 | .b ii . | |
1305 | For example, to leave one inch of space | |
1306 | for the label, | |
1307 | type: | |
1308 | .(b | |
1309 | \&.nr ii 1i | |
1310 | .)b | |
1311 | somewhere before the first call to | |
1312 | .b .ip . | |
1313 | Refer to the reference manual | |
1314 | for more information. | |
1315 | .pp | |
1316 | If | |
1317 | .b .ip | |
1318 | is used | |
1319 | with no argument at all | |
1320 | no hanging tag will be printed. | |
1321 | For example, | |
1322 | the input: | |
1323 | .(b | |
1324 | \&.ip [a] | |
1325 | This is the first paragraph of the example. | |
1326 | We have seen this sort of example before. | |
1327 | \&.ip | |
1328 | This paragraph is lined up with the previous paragraph, | |
1329 | but it has no tag in the margin. | |
1330 | .)b | |
1331 | produces as output: | |
1332 | .ip [a] | |
1333 | This is the first paragraph of the example. | |
1334 | We have seen this sort of example before. | |
1335 | .ip | |
1336 | This paragraph is lined up with the previous paragraph, | |
1337 | but it has no tag in the margin. | |
1338 | .pp | |
1339 | A special case of | |
1340 | .b .ip | |
1341 | is | |
1342 | .b .np , | |
1343 | which automatically | |
1344 | numbers paragraphs sequentially from 1. | |
1345 | The numbering is reset at the next | |
1346 | .b .pp , | |
1347 | .b .lp , | |
1348 | or | |
1349 | .b .sh | |
1350 | (to be described in the next section) | |
1351 | request. | |
1352 | For example, | |
1353 | the input: | |
1354 | .(b | |
1355 | \&.np | |
1356 | This is the first point. | |
1357 | \&.np | |
1358 | This is the second point. | |
1359 | Points are just regular paragraphs | |
1360 | which are given sequence numbers automatically | |
1361 | by the .np request. | |
1362 | \&.pp | |
1363 | This paragraph will reset numbering by .np. | |
1364 | \&.np | |
1365 | For example, | |
1366 | we have reverted to numbering from one now. | |
1367 | .)b | |
1368 | generates: | |
1369 | .np | |
1370 | This is the first point. | |
1371 | .np | |
1372 | This is the second point. | |
1373 | Points are just regular paragraphs | |
1374 | which are given sequence numbers automatically | |
1375 | by the .np request. | |
1376 | .pp | |
1377 | This paragraph will reset numbering by .np. | |
1378 | .np | |
1379 | For example, | |
1380 | we have reverted to numbering from one now. | |
6ee1589a EA |
1381 | .pp |
1382 | The | |
1383 | .b .bu | |
1384 | request gives lists of this sort that are identified with | |
1385 | bullets rather than numbers. | |
1386 | The paragraphs are also crunched together. | |
1387 | For example, | |
1388 | the input: | |
1389 | .(b | |
1390 | \&.bu | |
1391 | \&One egg yolk | |
1392 | \&.bu | |
1393 | \&One tablespoon cream or top milk | |
1394 | \&.bu | |
1395 | \&Salt, cayenne, and lemon juice to taste | |
1396 | \&.bu | |
1397 | \&A generous two tablespoonfuls of butter | |
1398 | .)b | |
1399 | produces\**: | |
1400 | .(f | |
1401 | \**By the way, | |
1402 | if you put the first three ingredients in a a heavy, deep pan | |
1403 | and whisk the ingredients madly over a medium flame | |
1404 | (never taking your hand off the handle of the pot) | |
1405 | until the mixture reaches the consistency of custard | |
1406 | (just a minute or two), | |
1407 | then mix in the butter off-heat, | |
1408 | you will have a wonderful Hollandaise sauce. | |
1409 | .)f | |
1410 | .bu | |
1411 | One egg yolk | |
1412 | .bu | |
1413 | One tablespoon cream or top milk | |
1414 | .bu | |
1415 | Salt, cayenne, and lemon juice to taste | |
1416 | .bu | |
1417 | A generous two tablespoonfuls of butter | |
56e023ca EA |
1418 | .sh 2 "Section Headings" |
1419 | .pp | |
1420 | Section numbers | |
1421 | (such as the ones used in this document) | |
1422 | can be automatically generated | |
1423 | using the | |
1424 | .b .sh | |
1425 | request. | |
1426 | You must tell | |
1427 | .b .sh | |
1428 | the | |
1429 | .i depth | |
1430 | of the section number | |
1431 | and a section title. | |
1432 | The depth | |
1433 | specifies how many numbers | |
1434 | are to appear | |
1435 | (separated by decimal points) | |
1436 | in the section number. | |
1437 | For example, | |
1438 | the section number | |
1439 | .b 4.2.5 | |
1440 | has a depth of three. | |
1441 | .pp | |
1442 | Section numbers | |
1443 | are incremented | |
1444 | in a fairly intuitive fashion. | |
1445 | If you add a number | |
1446 | (increase the depth), | |
1447 | the new number starts out | |
1448 | at one. | |
1449 | If you subtract section numbers | |
1450 | (or keep the same number) | |
1451 | the final number is incremented. | |
1452 | For example, | |
1453 | the input: | |
1454 | .(b | |
1455 | \&.sh 1 "The Preprocessor" | |
1456 | \&.sh 2 "Basic Concepts" | |
1457 | \&.sh 2 "Control Inputs" | |
1458 | \&.sh 3 | |
1459 | \&.sh 3 | |
1460 | \&.sh 1 "Code Generation" | |
1461 | \&.sh 3 | |
1462 | .)b | |
1463 | produces as output the result: | |
1464 | .(b | |
1465 | .b | |
1466 | 1. The Preprocessor | |
1467 | 1.1. Basic Concepts | |
1468 | 1.2. Control Inputs | |
1469 | 1.2.1. | |
1470 | 1.2.2. | |
1471 | 2. Code Generation | |
1472 | 2.1.1. | |
1473 | .)b | |
1474 | .pp | |
1475 | You can specify the section number to begin | |
1476 | by placing the section number after the section title, | |
1477 | using spaces instead of dots. | |
1478 | For example, | |
1479 | the request: | |
1480 | .(b | |
1481 | \&.sh 3 "Another section" 7 3 4 | |
1482 | .)b | |
1483 | will begin the section numbered | |
1484 | .b 7.3.4 ; | |
1485 | all subsequent | |
1486 | .b .sh | |
1487 | requests will number relative to this number. | |
1488 | .pp | |
1489 | There are more complex features | |
1490 | which will cause each section to be indented | |
1491 | proportionally to the depth of the section. | |
1492 | For example, if you enter: | |
1493 | .(b | |
1494 | \&.nr si \c | |
1495 | .i N | |
1496 | .)b | |
1497 | each section will be indented by an amount | |
1498 | .i N . | |
1499 | .i N | |
1500 | must have a scaling factor attached, | |
1501 | that is, it must be of the form | |
1502 | .i Nx , | |
1503 | where | |
1504 | .i x | |
1505 | is a character telling what units | |
1506 | .i N | |
1507 | is in. | |
1508 | Common values for | |
1509 | .i x | |
1510 | are | |
1511 | .b i | |
1512 | for inches, | |
1513 | .b c | |
1514 | for centimeters, | |
1515 | and | |
1516 | .b n | |
1517 | for | |
1518 | .i ens | |
1519 | (the width of a single character). | |
1520 | For example, | |
1521 | to indent each section | |
1522 | one-half inch, | |
1523 | type: | |
1524 | .(b | |
1525 | \&.nr si 0.5i | |
1526 | .)b | |
1527 | After this, | |
1528 | sections will be indented by | |
1529 | one-half inch | |
1530 | per level of depth in the section number. | |
1531 | For example, | |
1532 | this document was produced | |
1533 | using the request | |
1534 | .(b | |
1535 | \&.nr si 3n | |
1536 | .)b | |
1537 | at the beginning of the input file, | |
1538 | giving three spaces of indent | |
1539 | per section depth. | |
1540 | .pp | |
1541 | Section headers without automatically generated numbers | |
1542 | can be done using: | |
1543 | .(b | |
1544 | \&.uh "Title" | |
1545 | .)b | |
1546 | which will do a section heading, | |
1547 | but will put no number on the section. | |
1548 | .sh 2 "Parts of the Basic Paper" | |
1549 | .pp | |
1550 | There are some requests | |
1551 | which assist in setting up | |
1552 | papers. | |
1553 | The | |
1554 | .b .tp | |
1555 | request | |
1556 | initializes for a title page. | |
1557 | There are no headers or footers | |
1558 | on a title page, | |
1559 | and unlike other pages | |
1560 | you can space down | |
1561 | and leave blank space | |
1562 | at the top. | |
1563 | For example, | |
1564 | a typical title page might appear as: | |
1565 | .(b | |
1566 | \&.tp | |
1567 | \&.sp 2i | |
1568 | \&.(l C | |
1569 | THE GROWTH OF TOENAILS | |
1570 | IN UPPER PRIMATES | |
1571 | \&.sp | |
1572 | by | |
1573 | \&.sp | |
1574 | Frank N. Furter | |
1575 | \&.)l | |
1576 | \&.bp | |
1577 | .)b | |
1578 | .pp | |
1579 | The request | |
1580 | .b .th | |
1581 | sets up the environment | |
1582 | of the \*N processor | |
1583 | to do a thesis, | |
1584 | using the rules established at Berkeley. | |
1585 | It defines the correct headers and footers | |
1586 | (a page number in the upper right hand corner only), | |
1587 | sets the margins correctly, | |
1588 | and double spaces. | |
1589 | .pp | |
1590 | The | |
1591 | .b .+c \ \c | |
1592 | .i T | |
1593 | request can be used | |
1594 | to start chapters. | |
1595 | Each chapter is automatically numbered | |
1596 | from one, | |
1597 | and a heading is printed at the top of each chapter | |
1598 | with the chapter number | |
1599 | and the chapter name | |
1600 | .i T . | |
1601 | For example, | |
1602 | to begin a chapter called | |
1603 | .q Conclusions , | |
1604 | use the request: | |
1605 | .(b | |
1606 | \&.+c "CONCLUSIONS" | |
1607 | .)b | |
1608 | which will produce, | |
1609 | on a new page, | |
1610 | the lines | |
1611 | .(b C | |
1612 | CHAPTER 5 | |
1613 | CONCLUSIONS | |
1614 | .)b | |
1615 | with appropriate spacing for a thesis. | |
1616 | Also, the header is moved to the foot of the page | |
1617 | on the first page of a chapter. | |
1618 | Although the | |
1619 | .b .+c | |
1620 | request was not designed to work only with the | |
1621 | .b .th | |
1622 | request, | |
1623 | it is tuned for the format acceptable | |
1624 | for a PhD thesis | |
1625 | at Berkeley. | |
1626 | .pp | |
1627 | If the | |
1628 | title parameter | |
1629 | .i T | |
1630 | is omitted from the | |
1631 | .b .+c | |
1632 | request, | |
1633 | the result is a chapter with no heading. | |
1634 | This can also be used at the beginning | |
1635 | of a paper; | |
1636 | for example, | |
1637 | .b .+c | |
1638 | was used to generate page one | |
1639 | of this document. | |
1640 | .pp | |
1641 | Although | |
1642 | papers traditionally have the abstract, | |
1643 | table of contents, | |
1644 | and so forth at the front of the paper, | |
1645 | it is more convenient to format | |
1646 | and print them last | |
1647 | when using \*N. | |
1648 | This is so that index entries | |
1649 | can be collected and then printed | |
1650 | for the table of contents | |
1651 | (or whatever). | |
1652 | At the end of the paper, | |
1653 | issue the | |
1654 | .b ".++ P" | |
1655 | request, | |
1656 | which begins the preliminary part | |
1657 | of the paper. | |
1658 | After issuing this request, | |
1659 | the | |
1660 | .b .+c | |
1661 | request will begin a preliminary section | |
1662 | of the paper. | |
1663 | Most notably, | |
1664 | this prints the page number | |
1665 | restarted from one | |
1666 | in lower case Roman numbers. | |
1667 | .b .+c | |
1668 | may be used repeatedly | |
1669 | to begin different parts of the | |
1670 | front material | |
1671 | for example, | |
1672 | the abstract, | |
1673 | the table of contents, | |
1674 | acknowledgments, | |
1675 | list of illustrations, | |
1676 | etc. | |
1677 | The request | |
1678 | .b ".++ B" | |
1679 | may also be used | |
1680 | to begin the bibliographic section | |
1681 | at the end of the paper. | |
1682 | For example, | |
1683 | the paper might appear | |
1684 | as outlined in figure 2. | |
1685 | (In this figure, | |
1686 | comments begin with the sequence | |
1687 | .b \e" .) | |
1688 | .(z | |
1689 | .hl | |
1690 | .if t .in 0.5i | |
1691 | .if t .ta 2i | |
1692 | .if n .ta 3i | |
1693 | \&.th \e" set for thesis mode | |
1694 | \&.fo \(aa\(aaDRAFT\(aa\(aa \e" define footer for each page | |
1695 | \&.tp \e" begin title page | |
1696 | \&.(l C \e" center a large block | |
1697 | THE GROWTH OF TOENAILS | |
1698 | IN UPPER PRIMATES | |
1699 | \&.sp | |
1700 | by | |
1701 | \&.sp | |
1702 | Frank Furter | |
1703 | \&.)l \e" end centered part | |
1704 | \&.+c INTRODUCTION \e" begin chapter named "INTRODUCTION" | |
1705 | \&.(x t \e" make an entry into index `t' | |
1706 | Introduction | |
1707 | \&.)x \e" end of index entry | |
1708 | text of chapter one | |
1709 | \&.+c "NEXT CHAPTER" \e" begin another chapter | |
1710 | \&.(x t \e" enter into index `t' again | |
1711 | Next Chapter | |
1712 | \&.)x | |
1713 | text of chapter two | |
1714 | \&.+c CONCLUSIONS | |
1715 | \&.(x t | |
1716 | Conclusions | |
1717 | \&.)x | |
1718 | text of chapter three | |
1719 | \&.++ B \e" begin bibliographic information | |
1720 | \&.+c BIBLIOGRAPHY \e" begin another `chapter' | |
1721 | \&.(x t | |
1722 | Bibliography | |
1723 | \&.)x | |
1724 | text of bibliography | |
1725 | \&.++ P \e" begin preliminary material | |
1726 | \&.+c "TABLE OF CONTENTS" | |
1727 | \&.xp t \e" print index `t' collected above | |
1728 | \&.+c PREFACE \e" begin another preliminary section | |
1729 | text of preface | |
1730 | .sp 2 | |
1731 | .in 0 | |
1732 | .ce | |
1733 | Figure 2. Outline of a Sample Paper | |
1734 | .hl | |
1735 | .)z | |
1736 | .sh 2 "Equations and Tables" | |
1737 | .pp | |
1738 | Two special \*U programs exist | |
1739 | to format special types of material. | |
1740 | .b Eqn | |
1741 | and | |
1742 | .b neqn | |
1743 | set equations | |
1744 | for the phototypesetter | |
1745 | and \*N respectively. | |
1746 | .b Tbl | |
1747 | arranges to print | |
1748 | extremely pretty tables | |
1749 | in a variety of formats. | |
1750 | This document will only describe | |
1751 | the embellishments | |
1752 | to the standard features; | |
1753 | consult the reference manuals | |
1754 | for those processors | |
1755 | for a description of their use. | |
1756 | .pp | |
1757 | The | |
1758 | .b eqn | |
1759 | and | |
1760 | .b neqn | |
1761 | programs are described fully | |
1762 | in the document | |
1763 | .ul | |
6ee1589a | 1764 | Typesetting Mathematics \- User's Guide |
56e023ca EA |
1765 | by Brian W. Kernighan |
1766 | and Lorinda L. Cherry. | |
1767 | Equations are centered, | |
1768 | and are kept on one page. | |
1769 | They are introduced by the | |
1770 | .b .EQ | |
1771 | request and terminated by the | |
1772 | .b .EN | |
1773 | request. | |
1774 | .pp | |
1775 | The | |
1776 | .b .EQ | |
1777 | request may take an | |
1778 | equation number as an | |
1779 | optional argument, | |
1780 | which is printed vertically centered | |
1781 | on the right hand side | |
1782 | of the equation. | |
1783 | If the equation becomes too long | |
1784 | it should be split | |
1785 | between two lines. | |
1786 | To do this, type: | |
1787 | .(b | |
1788 | \&.EQ (eq 34) | |
1789 | text of equation 34 | |
1790 | \&.EN C | |
1791 | \&.EQ | |
1792 | continuation of equation 34 | |
1793 | \&.EN | |
1794 | .)b | |
1795 | The | |
1796 | .b C | |
1797 | on the | |
1798 | .b .EN | |
1799 | request | |
1800 | specifies that the equation | |
1801 | will be continued. | |
1802 | .pp | |
1803 | The | |
1804 | .b tbl | |
1805 | program produces tables. | |
1806 | It is fully described | |
1807 | (including numerous examples) | |
1808 | in the document | |
1809 | .ul | |
1810 | Tbl \- A Program to Format Tables | |
1811 | by M. E. Lesk. | |
1812 | Tables begin with the | |
1813 | .b .TS | |
1814 | request | |
1815 | and end with the | |
1816 | .b .TE | |
1817 | request. | |
1818 | Tables are normally kept on a single page. | |
1819 | If you have a table which is too big | |
1820 | to fit on a single page, | |
1821 | so that you know it will extend | |
1822 | to several pages, | |
1823 | begin the table with the request | |
1824 | .b ".TS\ H" | |
1825 | and put the request | |
1826 | .b .TH | |
1827 | after the part of the table | |
1828 | which you want | |
1829 | duplicated at the top of every page | |
1830 | that the table is printed on. | |
1831 | For example, a table definition | |
1832 | for a long table might look like: | |
1833 | .ds TA \|\h'.4n'\v'-.2n'\s-4\zT\s0\v'.2n'\h'-.4n'\(ci\| | |
1834 | .if n .ds TA \ \o'-T'\ \" | |
1835 | .(b | |
1836 | \&.TS H | |
1837 | c s s | |
1838 | n n n. | |
1839 | THE TABLE TITLE | |
1840 | \&.TH | |
1841 | text of the table | |
1842 | \&.TE | |
1843 | .)b | |
1844 | .pp | |
1845 | .sh 2 "Two Column Output" | |
1846 | .pp | |
1847 | You can get two column output | |
1848 | automatically | |
1849 | by using the request | |
1850 | .b .2c . | |
1851 | This causes everything after it | |
1852 | to be output in two-column form. | |
1853 | The request | |
1854 | .b .bc | |
1855 | will start a new column; | |
1856 | it differs from | |
1857 | .b .bp | |
1858 | in that | |
1859 | .b .bp | |
1860 | may leave a totally blank column | |
1861 | when it starts a new page. | |
1862 | To revert to single column output, | |
1863 | use | |
1864 | .b .1c . | |
1865 | .sh 2 "Defining Macros" | |
1866 | .pp | |
1867 | A | |
1868 | .i macro | |
1869 | is a collection of requests and text | |
1870 | which may be used | |
1871 | by stating a simple request. | |
1872 | Macros begin with the line | |
1873 | .b ".de" \ \c | |
1874 | .i xx | |
1875 | (where | |
1876 | .i xx | |
1877 | is the name of the macro to be defined) | |
1878 | and end with the line consisting of two dots. | |
1879 | After defining the macro, | |
1880 | stating the line | |
1881 | .b . \c | |
1882 | .i xx | |
1883 | is the same as stating all the other lines. | |
1884 | For example, | |
1885 | to define a macro | |
1886 | that spaces 3 lines | |
1887 | and then centers the next input line, | |
1888 | enter: | |
1889 | .(b | |
1890 | \&.de SS | |
1891 | \&.sp 3 | |
1892 | \&.ce | |
1893 | \&.. | |
1894 | .)b | |
1895 | and use it by typing: | |
1896 | .(b | |
1897 | \&.SS | |
1898 | \&Title Line | |
1899 | (beginning of text) | |
1900 | .)b | |
1901 | .pp | |
1902 | Macro names may be one or two characters. | |
1903 | In order to avoid conflicts | |
1904 | with names in \-me, | |
1905 | always use upper case letters as names. | |
1906 | The only names to avoid are | |
1907 | .b TS , | |
1908 | .b TH , | |
1909 | .b TE , | |
1910 | .b EQ , | |
1911 | and | |
1912 | .b EN . | |
1913 | .sh 2 "Annotations Inside Keeps" | |
1914 | .pp | |
1915 | Sometimes you may want to put | |
1916 | a footnote | |
1917 | or index entry inside a keep. | |
1918 | For example, | |
1919 | if you want to maintain a | |
1920 | .q "list of figures" | |
1921 | you will want to do something like: | |
1922 | .(b | |
1923 | \&.(z | |
1924 | \&.(c | |
1925 | text of figure | |
1926 | \&.)c | |
1927 | \&.ce | |
1928 | Figure 5. | |
1929 | \&.(x f | |
1930 | Figure 5 | |
1931 | \&.)x | |
1932 | \&.)z | |
1933 | .)b | |
1934 | which you may hope | |
1935 | will give you a figure | |
1936 | with a label | |
1937 | and an entry in the index | |
1938 | .b f | |
1939 | (presumably a list of figures index). | |
1940 | Unfortunately, | |
1941 | the | |
1942 | index entry | |
1943 | is read and interpreted | |
1944 | when the keep is read, | |
1945 | not when it is printed, | |
1946 | so the page number in the index is likely to be wrong. | |
1947 | The solution is to use the magic string | |
1948 | .b \e! | |
1949 | at the beginning of all the lines dealing with the index. | |
1950 | In other words, | |
1951 | you should use: | |
1952 | .(b | |
1953 | \&.(z | |
1954 | \&.(c | |
1955 | Text of figure | |
1956 | \&.)c | |
1957 | \&.ce | |
1958 | Figure 5. | |
1959 | \e!.(x f | |
1960 | \e!Figure 5 | |
1961 | \e!.)x | |
1962 | \&.)z | |
1963 | .)b | |
1964 | which will defer the processing of the index | |
1965 | until the figure is output. | |
1966 | This will guarantee | |
1967 | that the page number in the index | |
1968 | is correct. | |
1969 | The same comments apply | |
1970 | to | |
1971 | blocks | |
1972 | (with | |
1973 | .b .(b | |
1974 | and | |
1975 | .b .)b ) | |
1976 | as well. | |
1977 | .sh 1 "\*T and the Photosetter" | |
1978 | .pp | |
1979 | With a little care, | |
1980 | you can prepare | |
1981 | documents that | |
1982 | will print nicely | |
1983 | on either a regular terminal | |
1984 | or when phototypeset | |
1985 | using the \*T formatting program. | |
1986 | .sh 2 "Fonts" | |
1987 | .pp | |
1988 | A | |
1989 | .i font | |
1990 | is a style of type. | |
1991 | There are three fonts | |
1992 | that are available simultaneously, | |
1993 | Times Roman, | |
1994 | Times Italic, | |
1995 | and Times Bold, | |
1996 | plus the special math font. | |
1997 | The normal font is Roman. | |
1998 | Text which would be underlined in \*N | |
1999 | with the | |
2000 | .b .ul | |
2001 | request | |
2002 | is set in italics | |
2003 | in \*T. | |
2004 | .pp | |
2005 | There are ways of switching between fonts. | |
2006 | The requests | |
2007 | .b .r , | |
2008 | .b .i , | |
2009 | and | |
2010 | .b .b | |
2011 | switch to Roman, | |
2012 | italic, | |
2013 | and bold fonts respectively. | |
2014 | You can set a single word | |
2015 | in some font | |
2016 | by typing (for example): | |
2017 | .(b | |
2018 | \&.i word | |
2019 | .)b | |
2020 | which will set | |
2021 | .i word | |
2022 | in italics | |
2023 | but does not affect the surrounding text. | |
2024 | In \*N, | |
2025 | italic and bold text | |
2026 | is underlined. | |
2027 | .pp | |
2028 | Notice that if you are setting more than one word | |
2029 | in whatever font, | |
2030 | you must surround that word with double quote marks | |
2031 | (`\|"\|') | |
2032 | so that it will appear to the \*N processor as a single word. | |
2033 | The quote marks will not appear in the formatted text. | |
2034 | If you do want a quote mark to appear, | |
2035 | you should quote the entire string | |
2036 | (even if a single word), | |
2037 | and use | |
2038 | .i two | |
2039 | quote marks where you want one to appear. | |
2040 | For example, | |
2041 | if you want to produce the text: | |
2042 | .(b | |
2043 | .i """Master Control\|""" | |
2044 | .)b | |
2045 | in italics, you must type: | |
2046 | .(b | |
2047 | \&.i """Master Control\e|""" | |
2048 | .)b | |
2049 | The | |
2050 | .b \e| | |
2051 | produces a very narrow space | |
2052 | so that the | |
2053 | .q l | |
2054 | does not overlap the quote sign in \*T, | |
2055 | like this: | |
2056 | .(b | |
2057 | .i """Master Control""" | |
2058 | .)b | |
2059 | .pp | |
2060 | There are also several | |
2061 | .q pseudo-fonts | |
2062 | available. | |
2063 | The input: | |
2064 | .(b | |
2065 | \&.(b | |
2066 | \&.u underlined | |
2067 | \&.bi "bold italics" | |
2068 | \&.bx "words in a box" | |
2069 | \&.)b | |
2070 | .)b | |
2071 | generates | |
2072 | .(b | |
2073 | .u underlined | |
2074 | .bi "bold italics" | |
2075 | .bx "words in a box" | |
2076 | .)b | |
2077 | In \*N these all just underline | |
2078 | the text. | |
2079 | Notice that pseudo font requests | |
2080 | set only the single parameter in the pseudo font; | |
2081 | ordinary font requests will begin setting all text | |
2082 | in the special font | |
2083 | if you do not provide a parameter. | |
2084 | No more than one word | |
2085 | should appear | |
2086 | with these three font requests | |
2087 | in the middle of lines. | |
2088 | This is because | |
2089 | of the way \*T justifies text. | |
2090 | For example, | |
2091 | if you were to issue the requests: | |
2092 | .(b | |
2093 | \&.bi "some bold italics" | |
2094 | and | |
2095 | \&.bx "words in a box" | |
2096 | .)b | |
2097 | in the middle of a line | |
2098 | \*T would produce | |
2099 | .bi "some bold italics" | |
2100 | and | |
2101 | .bx "words in a box" ,\c | |
2102 | .if t \p | |
2103 | .if n \& \" | |
2104 | .if t which I think you will agree does not look good. | |
2105 | .if n which would look really lousy in \*T. | |
2106 | .pp | |
2107 | The second parameter | |
2108 | of all font requests | |
2109 | is set in the original font. | |
2110 | For example, | |
2111 | the font request: | |
2112 | .(b | |
2113 | \&.b bold face | |
2114 | .)b | |
2115 | generates | |
2116 | .q bold | |
2117 | in bold font, | |
2118 | but sets | |
2119 | .q face | |
2120 | in the font of the surrounding text, | |
2121 | resulting in: | |
2122 | .(b | |
2123 | .b bold face. | |
2124 | .)b | |
2125 | To set the two words | |
2126 | .b bold | |
2127 | and | |
2128 | .b face | |
2129 | both in | |
2130 | .b "bold face" , | |
2131 | type: | |
2132 | .(b | |
2133 | \&.b "bold face" | |
2134 | .)b | |
2135 | .pp | |
2136 | You can mix fonts in a word by using the | |
2137 | special sequence | |
2138 | .b \ec | |
2139 | at the end of a line | |
2140 | to indicate | |
2141 | .q "continue text processing" ; | |
2142 | this allows input lines | |
2143 | to be joined together | |
6ee1589a | 2144 | without a space between them. |
56e023ca EA |
2145 | For example, the input: |
2146 | .(b | |
2147 | \&.u under \ec | |
2148 | \&.i italics | |
2149 | .)b | |
2150 | generates | |
2151 | .u under \c | |
2152 | .i italics , | |
2153 | but if we had typed: | |
2154 | .(b | |
2155 | \&.u under | |
2156 | \&.i italics | |
2157 | .)b | |
2158 | the result would have been | |
2159 | .u under | |
2160 | .i italics | |
2161 | as two words. | |
2162 | .sh 2 "Point Sizes" | |
2163 | .pp | |
2164 | The phototypesetter | |
2165 | supports different sizes of type, | |
2166 | measured in points. | |
2167 | The default point size | |
2168 | is 10 points | |
2169 | for most text, | |
2170 | 8 points for footnotes. | |
2171 | To change the pointsize, | |
2172 | type: | |
2173 | .(b | |
2174 | \&.sz \c | |
2175 | .i +N | |
2176 | .)b | |
2177 | where | |
2178 | .i N | |
2179 | is the size wanted in points. | |
2180 | The | |
2181 | .i "vertical spacing" | |
2182 | (distance between the bottom of most letters | |
2183 | (the | |
2184 | .i baseline ) | |
2185 | between adjacent lines) | |
2186 | is set to be proportional | |
2187 | to the type size. | |
2188 | .pp | |
6ee1589a EA |
2189 | These pointsize changes are |
2190 | .i temporary !!! | |
2191 | For example, | |
2192 | to reset the pointsize of basic text to twelve point, use: | |
2193 | .(b | |
2194 | \&.nr pp 12 | |
2195 | \&.nr sp 12 | |
2196 | \&.nr tp 12 | |
2197 | .)b | |
2198 | to reset the default pointsize of | |
2199 | paragraphs, | |
2200 | section headers, | |
2201 | and titles respectively. | |
2202 | If you only want to set the names of sections in a larger pointsize, | |
2203 | use: | |
2204 | .(b | |
2205 | \&.nr sp 11 | |
2206 | .)b | |
2207 | alone \*- this sets section titles | |
2208 | (e.g., | |
2209 | .b "Point Sizes" | |
2210 | above) | |
2211 | in a larger font than the default. | |
2212 | .pp | |
2213 | A single word or phrase can be set in a smaller pointsize | |
2214 | than the surrounding text | |
2215 | using the | |
2216 | .b .sm | |
2217 | request. | |
2218 | This is especially convenient for words that are all capitals, | |
2219 | due to the optical illusion that makes them look even larger | |
2220 | than they actually are. | |
2221 | For example: | |
2222 | .(b | |
2223 | \&.sm UNIX | |
2224 | .)b | |
2225 | prints as | |
2226 | .sm UNIX | |
2227 | rather than | |
2228 | UNIX. | |
2229 | .pp | |
56e023ca EA |
2230 | Warning: |
2231 | changing point sizes | |
2232 | on the phototypesetter | |
2233 | is a slow mechanical operation. | |
6ee1589a | 2234 | On laser printers it may require loading new fonts. |
56e023ca EA |
2235 | Size changes |
2236 | should be considered carefully. | |
2237 | .sh 2 "Quotes" | |
2238 | .pp | |
2239 | It is conventional when using | |
2240 | the typesetter to | |
2241 | use pairs of grave and acute accents | |
2242 | to generate double quotes, | |
2243 | rather than the | |
2244 | double quote character | |
2245 | (`\|"\|'). | |
2246 | This is because it looks better | |
2247 | to use grave and acute accents; | |
2248 | for example, compare | |
2249 | "quote" to | |
2250 | ``quote''. | |
2251 | .pp | |
2252 | In order to make quotes compatible | |
2253 | between the typesetter and terminals, | |
2254 | you may use the sequences | |
2255 | .b \e*(lq | |
2256 | and | |
2257 | .b \e*(rq | |
2258 | to stand for the left and right quote | |
2259 | respectively. | |
2260 | These both appear as | |
2261 | .b """" | |
2262 | on most terminals, | |
2263 | but are typeset as | |
2264 | .b `` | |
2265 | and | |
2266 | .b '' | |
2267 | respectively. | |
2268 | For example, | |
2269 | use: | |
2270 | .(b | |
2271 | \e*(lqSome things aren\(aat true | |
2272 | even if they did happen.\e*(rq | |
2273 | .)b | |
2274 | to generate the result: | |
2275 | .(b | |
2276 | .q "Some things aren't true even if they did happen." | |
2277 | .)b | |
2278 | As a shorthand, | |
2279 | the special font request: | |
2280 | .(b | |
2281 | \&.q "quoted text" | |
2282 | .)b | |
2283 | will generate | |
2284 | .q "quoted text" . | |
2285 | Notice that you must surround | |
2286 | the material to be quoted | |
2287 | with double quote marks | |
2288 | if it is more than one word. | |
2289 | .sh 0 | |
2290 | .sp 1i | |
2291 | .b Acknowledgments | |
2292 | .pp | |
2293 | I would like to thank | |
2294 | Bob Epstein, | |
2295 | Bill Joy, | |
2296 | and Larry Rowe | |
2297 | for having the courage | |
2298 | to use the \-me macros | |
2299 | to produce non-trivial papers | |
2300 | during the development stages; | |
2301 | Ricki Blau, | |
2302 | Pamela Humphrey, | |
2303 | and Jim Joyce | |
2304 | for their help with the documentation phase; | |
6ee1589a EA |
2305 | peter kessler |
2306 | for numerous complaints years after I was | |
2307 | .q done | |
2308 | with this project, | |
2309 | most accompanied by fixes | |
2310 | (hence forcing me to fix several small bugs); | |
56e023ca EA |
2311 | and the plethora of people who have contributed ideas |
2312 | and have given support for the project. | |
2313 | .sp 1i | |
2314 | This document was | |
2315 | .if n \*N'ed | |
2316 | .if t \*T'ed | |
2317 | on \*(td | |
2318 | and applies to version | |
6ee1589a | 2319 | \*(MO |
56e023ca | 2320 | of the \-me macros. |