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