groff before CVS: release 1.05
[s-roff.git] / macros / tmac.e
blob4b77d2383e7199af27f65f00559d12136881529d
1 .\" @(#)tmac.e 2.31 (Berkeley) 5/21/88
2 .\" Modified by James Clark for use with groff.
3 .\"
4 .\" Copyright (c) 1988 Regents of the University of California.
5 .\" All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms are permitted
8 .\" provided that this notice is preserved and that due credit is given
9 .\" to the University of California at Berkeley. The name of the University
10 .\" may not be used to endorse or promote products derived from this
11 .\" software without specific prior written permission. This software
12 .\" is provided ``as is'' without express or implied warranty.
13 .\" %beginstrip%
14 .\"
15 .\"**********************************************************************
16 .\"* *
17 .\"* ****** - M E N R O F F / T R O F F M A C R O S ****** *
18 .\"* *
19 .\"* Produced for your edification and enjoyment by: *
20 .\"* Eric Allman *
21 .\"* Electronics Research Laboratory *
22 .\"* U.C. Berkeley. *
23 .\"* current address: *
24 .\"* Britton-Lee, Inc. *
25 .\"* 1919 Addison Street Suite 105 *
26 .\"* Berkeley, California 94704 *
27 .\"* *
28 .\"* VERSION 2.31 First Release: 11 Sept 1978 *
29 .\"* *
30 .\"* Documentation is available. *
31 .\"* *
32 .\"**********************************************************************
33 .\"
34 .\" Code on .de commands:
35 .\" *** a user interface macro.
36 .\" &&& a user interface macro which is redefined
37 .\" when used to be the real thing.
38 .\" $$$ a macro which may be redefined by the user
39 .\" to provide variant functions.
40 .\" --- an internal macro.
41 .\"
42 .if \n(pf \
43 . nx /dev/null
44 .\" *** INTERNAL GP MACROS ***
45 .de @C \" --- change ev's, taking info with us
46 .nr _S \\n(.s
47 .nr _V \\n(.v
48 .nr _F \\n(.f
49 .if \n(.g \
50 \{\
51 . nr _C \\n(.C
52 . cp 0
53 . ds _A \\n[.fam]
54 .\}
55 .nr _I \\n(.i
56 .ev \\$1
57 .ps \\n(_S
58 .vs \\n(_Vu
59 .ft \\n(_F
60 .if \n(.g \
61 \{\
62 . fam \\*(_A
63 . cp \\n(_C
64 .\}
65 'in \\n(_Iu
66 .xl \\n($lu
67 .lt \\n($lu
68 .rr _S
69 .rr _V
70 .rr _F
71 .rr _I
72 .ls 1
73 'ce 0
75 .de @D \" --- determine display type (Indent, Left, Center)
76 .ds |p "\\$3
77 .nr _d \\$1
78 .ie "\\$2"C" \
79 . nr _d 1
80 .el .ie "\\$2"L" \
81 . nr _d 2
82 .el .ie "\\$2"I" \
83 . nr _d 3
84 .el .ie "\\$2"M" \
85 . nr _d 4
86 .el \
87 . ds |p "\\$2
89 .de @z \" --- end macro
90 .if \n@>1 .tm >> @z, .z=\\n(.z ?a=\\n(?a
91 .if !"\\n(.z"" \
92 \{\
93 . tm Line \\n(c. -- Unclosed block, footnote, or other diversion (\\n(.z)
94 . di
95 . ex
96 .\}
97 .if \\n(?a \
98 . bp \" force out final table
99 .rm bp
100 .rm @b\" \" don't start another page
101 .wh -1p @m
103 .if \n@>1 .tm << @z
105 .\" *** STANDARD HEADERS AND FOOTERS ***
106 .de he \" *** define header
107 .ie !\\n(.$ \
109 . rm |4
110 . rm |5
112 .el \
114 . ds |4 "\\$*
115 . ds |5 "\\$*
118 .de eh \" *** define even header
119 .ie !\\n(.$ \
120 . rm |4
121 .el \
122 . ds |4 "\\$*
124 .de oh \" *** define odd header
125 .ie !\\n(.$ \
126 . rm |5
127 .el \
128 . ds |5 "\\$*
130 .de fo \" *** define footer
131 .ie !\\n(.$ \
133 . rm |6
134 . rm |7
136 .el \
138 . ds |6 "\\$*
139 . ds |7 "\\$*
142 .de ef \" *** define even foot
143 .ie !\\n(.$ \
144 . rm |6
145 .el \
146 . ds |6 "\\$*
148 .de of \" *** define odd footer
149 .ie !\\n(.$ \
150 . rm |7
151 .el \
152 . ds |7 "\\$*
154 .de ep \" *** end page (must always be followed by a .bp)
155 .if \\n(nl>0 \
157 . wh 0
158 . rs
159 . @b
162 .\" *** INTERNAL HEADER AND FOOTER MACROS ***
163 .de @h \" --- header
164 .if \n@>1 .tm >> @h %=\\n% ?a=\\n(?a ?b=\\n(?b ?w=\\n(?w
165 .if (\\n(.i+\\n(.o)>=\\n(.l \
166 . tm Line \\n(c. -- Offset + indent exceeds line length
167 .\" initialize a pile of junk
168 .nr ?h \\n(?H \" transfer "next page" to "this page"
169 .rr ?H
170 .nr ?c \\n(?C
171 .rr ?C
172 .rn |4 |0
173 .rn |5 |1
174 .rn |6 |2
175 .rn |7 |3
176 .nr _w 0 \" reset max footnote width
177 .nr ?W 0 \" no wide floats this page (yet)
178 .nr ?I 1
179 .\" begin actual header stuff
180 .ev 2
182 .@m \" output cut mark
183 .if \\n(hm>0 \
184 . sp |\\n(hmu \" move to header position
185 .@t $h \" output header title
186 .if \\n(tm<=0 \
187 . nr tm \n(.Vu
188 .sp |\\n(tmu \" move to top of text
190 .mk _k \" for columned output
191 .if \\n(?n .nm 1 \" restore line numbering if n1 mode
192 .nr $c 1 \" set first column
193 .if \n@>4 .tm -- @h >> .ns nl=\\n(nl %=\\n% _k=\\n(_k tm=\\n(tm
194 .ie \\n(?s \
196 . rr ?s
197 . rs
198 ' @b
200 .el \
201 . @n \" begin the column
202 .if \n@>2 .tm << @h
204 .if \nv=2 \
206 . de @m \" --- output cut mark (only on C/A/T-style)
207 . @O 0
208 . lt 7.5i
209 . tl '\(rn''\(rn'
210 . @O
211 . lt
214 .de @n \" --- new column or page
215 .if \n@>3 .tm >> @n nl=\\n(nl %=\\n% ?f=\\n(?f ?o=\\n(?o
216 .if \\n(bm<=0 \
217 . nr bm \\n(.Vu
218 .if (\\n(_w<=\\n($l)&(\\n(?W=0) \
220 . nr _b (\\n(ppp*\\n($ru)/200u \" compute fudge factor (must be < 1P)
221 . if \\n(_bu>((\\n(bmu-\\n(fmu-((\\n(tpp*\\n($ru)/100u))/2u) \
222 . nr _b (\\n(ppp*\\n($ru)/100u-\n(.Vu
223 . nr _b +\\n(bmu
225 .nr _B \\n(_bu
226 .ch @f
227 .wh -\\n(_bu @f
228 .nr _b +(\\n(ppp*\\n($ru)/100u \" add 1 paragraph v in case of sweep past
229 .if \n@>2 .tm @n .p=\\n(.p bm=\\n(bm _b=\\n(_b _B=\\n(_B
230 .nr ?f 0 \" reset footnote flag
231 .if \\n(?o \
233 . (f _ \" reprocess footnotes which run off page
234 . nf
235 . |o
236 . fi
237 . )f
238 . rm |o
240 .nr ?o 0
241 .if \\n(?T \
243 . nr _i \\n(.i
244 . in \\n($iu
245 . |h \" output the table header
246 . in \\n(_iu
247 . rr _i
248 . mk #T \" for tbl commands
249 . ns
251 .if (\\n(?a)&((\\n($c<2):(\\n(?w=0)) \
253 . nr ?a 0 \" output floating keep
254 . @k |t
255 . if \\n(?w \
256 . mk _k \" don't overstrike wide keeps
257 . nr ?w 0
260 .$H \" special column header macro
263 .de @f \" --- footer
264 .if \n@>1 .tm >> @f %=\\n% nl=\\n(nl ?a=\\n(?a ?b=\\n(?b ?f=\\n(?f
265 .if \n@>2 .nr VL \\n(.pu-\\n(nlu
266 .if \n@>2 .tm @f bm=\\n(bm _B=\\n(_B _b=\\n(_b .p-nl=\\n(VL
268 .if \\n(?T \
270 . nr T. 1 \" for tbl commands (to output bottom line)
271 . T# 1 \" output the sides and bottom lines
272 . br
274 .ev 2
275 .ce 0
276 .if \\n(?b \
278 . nr ?b 0
279 . @k |b\" \" output bottom of page tables
281 .if \\n(?f \
282 . @o \" output footnote if present
283 .ie \\n($c<\\n($m \
284 . @c \" handle new column
285 .el \
286 . @e \" new page
288 .if \n@>2 .tm << @f
290 .de @o \" --- output footnote
292 .ls 1
293 .in 0
294 .if \n@>2 .tm @o last printed text = \\n(nl placing @r trap at -\\n(_B
295 .wh -\\n(_Bu @r
298 .if \n@>2 .tm @o triggered @r (?o) = \\n(?o
299 .if \\n(?o \
301 . di \" just in case triggered @r
302 . if \\n(dn=0 \
304 . rm |o
305 . nr ?o 0
306 . \}
307 . nr dn \\n(_D
308 . rr _D
310 .rm |f
311 .ch @r
313 .de @c \" --- new column
314 .if \n@>2 .tm >> @c %=\\n%
316 .sp |\\n(_ku
317 .@O +\\n($lu+\\n($su
318 .nr $c +1
321 .de @e \" --- end page
322 .if \n@>2 .tm >> @e
323 .@O \\n(_ou
325 .sp |\\n(.pu-\\n(fmu-((\\n(tpp*\\n($ru)/100u) \" move to footer position
326 .@t $f \" output footer title
327 .nr ?h 0
330 .de @t \" --- output header or footer title
331 .if !\\n(?h \
333 . sz \\n(tp \" set header/footer type fonts, etc.
334 . @F \\n(tf
335 . lt \\n(_Lu \" make title span entire page
336 . nf
337 . \\$1
338 . br
341 .de $h \" $$$ print header
342 .rm |z
343 .if !\\n(?c \
345 . if e .ds |z "\\*(|0
346 . if o .ds |z "\\*(|1
348 .if !\(ts\\*(|z\(ts\(ts \
349 ' tl \\*(|z
350 .rm |z
352 .de $f \" $$$ print footer
353 .rm |z
354 .if \\n(?c \
356 . if e .ds |z "\\*(|0
357 . if o .ds |z "\\*(|1
359 .if \(ts\\*(|z\(ts\(ts \
361 . if e .ds |z "\\*(|2
362 . if o .ds |z "\\*(|3
364 .if !\(ts\\*(|z\(ts\(ts \
365 ' tl \\*(|z
366 .rm |z
368 .de @r \" --- reprocess overflow footnotes
369 .if \n@>3 .tm >> @r .z=\\n(.z ?f=\\n(?f ?a=\\n(?a ?b=\\n(?b _b=\\n(_b
370 .di |o \" save overflow footnote
371 .nr ?o 1
372 .nr _D \\n(dn
375 .\" *** COMMANDS WITH VARIANT DEFINITIONS ***
376 .rn bp @b \" --- begin page
377 .de bp \" *** begin new page (overrides columns)
378 .nr $c \\n($m \" force new page, not new column
379 .ie \\n(nl>0 \
380 . @b \\$1
381 .el \
383 . if \\n(.$>0 \
384 . pn \\$1
385 . if \\n(?I \
386 . @h \" 'spring' the header trap
389 .wh 0 @h \" reset header
391 .rn ll xl \" *** special line length (local)
392 .de ll \" *** line length (global to environments)
393 .xl \\$1
394 .lt \\$1
395 .nr $l \\n(.l
396 .if (\\n($m<=1):(\\n($l>\\n(_L) \
397 . nr _L \\n(.l
399 .rn po @O \" --- local page offset
400 .de po \" *** page offset
401 .@O \\$1
402 .nr _o \\n(.o
404 .\" *** MISCELLANEOUS ROFF COMMANDS ***
405 .de hx \" *** suppress headers and footers next page
406 .nr ?H 1
408 .de ix \" *** indent, no break
409 'in \\$1
411 .de bl \" *** contiguous blank lines
413 .ne \\$1
415 .sp \\$1
417 .de n1 \" *** line numbering 1
418 .nm 1
419 .xl -\w'0000'u
420 .nr ?n 1
422 .de n2 \" *** line numbering 2
423 .nm \\$1
424 .ie \\n(.$ \
425 . xl -\w'0000'u
426 .el \
427 . xl \\n($lu
429 .de pa \" *** new page
430 .bp \\$1
432 .de ro \" *** roman page numbers
433 .af % i
435 .de ar \" *** arabic page numbers
436 .af % 1
438 .de m1 \" *** position one space
439 .nr _0 \\n(hmu
440 .nr hm \\$1v
441 .nr tm +\\n(hmu-\\n(_0u
442 .rr _0
444 .de m2 \" *** position two space
445 .nr tm \\n(hmu+\\n(tpp+\\$1v
447 .de m3 \" *** position three space
448 .nr bm \\n(fmu+\\n(tpp+\\$1v
450 .de m4 \" *** position four space
451 .nr _0 \\n(fmu
452 .nr fm \\$1v
453 .nr bm +\\n(fmu-\\n(_0u
455 .de sk \" *** leave a blank page (next page)
456 .if \\n(.$>0 \
457 . tm Line \\n(c. -- I cannot skip multiple pages
458 .nr ?s 1
460 .\" *** MISCELLANEOUS USER SUPPORT COMMANDS ***
461 .de re \" *** reset tabs (TROFF defines 15 stops default)
462 .ta T 0.5i
464 .de ba \" *** set base indent
465 .ie \\n(.$ \
466 . nr $i \\$1n
467 .el \
468 . nr $i \\n(siu*\\n($0u
470 .de hl \" *** draw horizontal line
472 \l'\\n(.lu-\\n(.iu'
475 .\" *** PARAGRAPHING ***
476 .de pp \" *** paragraph
477 .lp \\n(piu
479 .de lp \" *** left aligned paragraph
481 .if \\n(.$ \
482 . ti +\\$1
483 .nr $p 0 1
485 .de ip \" *** indented paragraph w/ optional tag
486 .if (\\n(ii>0)&(\\n(ii<1n) \
487 . nr ii \\n(iin
488 .nr _0 \\n(ii
489 .if \\n(.$>1 \
490 . nr _0 \\$2n
491 .@p \\n(_0u
492 .if \\w"\\$1" \
494 . ti -\\n(_0u
495 . ie \\w"\\$1">=\\n(_0 \
497 \&\\$1
498 . br
499 . \}
500 . el \&\\$1\h'|\\n(_0u'\c
502 .rr _0
504 .de np \" *** numbered paragraph
505 .if \\n($p<0 \
506 . nr $p 0 \" reset number after .bu
507 .nr $p +1 \" increment paragraph number
508 .@p \w'\0(000)\0'u
509 .ti -\w'\0(000)\0'u
510 \0(\\n($p)\h'|\w'\0(000)\0'u'\c
512 .de bu \" *** bulleted paragraph
514 .if \\n($p<0 \
515 . ns \" don't space between .bu paragraphs
516 .nr $p 0-1 \" mark "bulleted paragraph" mode
517 .@p \w'\0\(bu\0'u
518 .ti -\w'\0\(bu\0'u
519 \0\(bu\0\c
521 .de @p \" --- initialize for paragraph
522 .if "\\n(.z"|e" .tm Line \\n(c. -- Unmatched continued equation
523 .in \\n($iu+\\n(pou
524 .if \\n(.$ \
525 . in +\\$1n
526 .ce 0
528 .@F \\n(pf
529 .sz \\n(pp
530 .sp \\n(psu
531 .ne \\n(.Lv+\\n(.Vu
534 .\" *** SECTION HEADINGS ***
535 .de sh \" *** section heading
537 .if (\\n(si>0)&(\\n(si<1n) \
538 . nr si \\n(sin
539 .ce 0
540 .@d "\\$1" +1 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
541 .if !"\\$2"_" \
543 . ds |n \&\\$2
544 . $p "\\*(|n" "\\*($n" \\n($0
545 . $0 "\\*(|n" "\\*($n" \\n($0
546 . rm |n
548 .nr $p 0 1 \" reset .np count
550 .de @d \" --- change section depth
551 .if !""\\$1" \
552 . nr $0 \\$1
553 .if \\n($0&(\\n(.$>1) \
554 . nr $\\n($0 \\$2
555 .ds $n \&\"
556 .ie \\n($0>=1 \
558 . if '\\n($1'0' \
559 . nr $1 1
560 . if (\\n(.$>=3) .if !"\\$3"-" \
561 . nr $1 \\$3
562 . as $n \\n($1
564 .el \
565 . nr $1 0
566 .ie \\n($0>=2 \
568 . if '\\n($2'0' \
569 . nr $2 1
570 . if (\\n(.$>=4) .if !"\\$4"-" \
571 . nr $2 \\$4
572 . as $n .\\n($2
574 .el \
575 . nr $2 0
576 .ie \\n($0>=3 \
578 . if '\\n($3'0' \
579 . nr $3 1
580 . if (\\n(.$>=5) .if !"\\$5"-" \
581 . nr $3 \\$5
582 . as $n .\\n($3
584 .el \
585 . nr $3 0
586 .ie \\n($0>=4 \
588 . if '\\n($4'0' \
589 . nr $4 1
590 . if (\\n(.$>=6) .if !"\\$6"-" \
591 . nr $4 \\$6
592 . as $n .\\n($4
594 .el \
595 . nr $4 0
596 .ie \\n($0>=5 \
598 . if '\\n($5'0' \
599 . nr $5 1
600 . if (\\n(.$>=7) .if !"\\$7"-" \
601 . nr $5 \\$7
602 . as $n .\\n($5
604 .el \
605 . nr $5 0
606 .ie \\n($0>=6 \
608 . if '\\n($6'0' \
609 . nr $6 1
610 . if (\\n(.$>=8) .if !"\\$8"-" \
611 . nr $6 \\$8
612 . as $n .\\n($6
614 .el \
615 . nr $6 0
617 .de sx \" *** heading up, no increment (2.1.1 -> 2.1)
618 .ce 0
619 .ul 0
620 .nr _0 \\n($0-1
621 .if \\n(.$ .nr _0 +1
622 .if \\n(.$ .nr _0 \\$1
623 .@d \\n(_0
624 .rr _0
625 .$p "" "" \\n($0
626 .nr $p 0 1 \" reset .np count
628 .de uh \" *** unnumbered section heading
629 .$p "\\$1"
630 .$0 "\\$1"
632 .de $p \" $$$ print section heading
633 .if (\\n(si>0)&(\\n(.$>2) \
634 . nr $i \\$3*\\n(si
635 .in \\n($iu
636 .ie !"\\$1\\$2"" \
638 . sp \\n(ssu \" one of them is non-null
639 . ne \\n(.Lv+\\n(.Vu+\\n(psu+((\\n(spp*\\n($ru*\\n(.Lu)/100u)
640 . ie \\n(.$>2 \
641 . ti -(\\n(siu-\\n(sou)
642 . el \
643 . ti +\\n(sou
644 . @F \\n(sf
645 . sz \\n(sp
646 . if \\$3>0 \
647 . $\\$3
648 . if \w"\\$2">0 \\$2.
649 . if \w"\\$1">0 \\$1\f1\ \ \&
651 .el \
652 . sp \\n(psu
653 .@F \\n(pf
654 .sz \\n(pp
656 .\" *** COLUMNNED OUTPUT ***
657 .de 2c \" *** double columned output
659 .if \\n($m>1 \
660 . 1c \" revert to 1c if already 2c
661 .nr $c 1
662 .nr $m 2
663 .if \\n(.$>1 \
664 . nr $m \\$2
665 .if \\n(.$>0 \
666 . nr $s \\$1n \" param 1: column seperation
667 .nr $l (\\n(.l-((\\n($m-1)*\\n($s))/\\n($m
668 .xl \\n($lu
669 .mk _k
672 .de 1c \" *** single columned output
674 .nr $c 1
675 .nr $m 1
676 .ll \\n(_Lu \" return to normal output
677 .sp |\\n(.hu
678 .@O \\n(_ou
680 .de bc \" *** begin column
681 .sp 24i
683 .\" *** FLOATING TABLES AND NONFLOATING BLOCKS ***
684 .de (z \" *** begin floating keep
685 .if \n@>4 .tm >> (z, .z=\n(.z
686 .@D 4 \\$1 \\$2
688 .nr ?T 0
690 .de )z \" *** end floating keep
691 .if \n@>4 .tm >> )z, .z=\n(.z
692 .sp \\n(zsu
694 .if \n@>4 .tm -- )z << @), .z=\n(.z
695 .rr _0
696 .if !\\n(?b \
697 . nr dn +(\\n(ppp*\\n($ru)/200u+\\n(zsu
698 .nr dl -\n(.H \" fudge factor necessary to make it work
699 .ie ((\\n(dn+\n(.V)>=\\n(.t):(\\n(?a):((\\n(dl>\\n($l)&(\\n($c>1)) \
701 . nr ?a 1
702 . if (\\n(dl>\\n($l)&(\\n($m>1) \
703 . nr ?w 1 \" mark wider than one column (top)
704 . ds |x |t
706 .el \
708 . nr ?b 1
709 . if (\\n(dl>\\n($l)&(\\n($m>1) \
710 . nr ?W 1 \" mark wider than one column (bottom)
711 . nr _b +\\n(dnu
712 . ch @f -\\n(_bu
713 . ds |x |b
715 .da \\*(|x \" copy to save macro
717 .ls 1
718 .nr ?k 1
719 .if \n@>4 .tm -- )z >> \\*(|x
720 \!.if \\\\n(nl>(\\\\n(tm+2v) .ne \\n(dnu-\\n(zsu
721 .|k\" \" and the body
723 .if \n@>4 .tm -- )z << \\*(|x, .z=\\n(.z
724 .nr ?k 0
725 .rm |k\" \" remove the temp macro
727 .in 0
728 .ls 1
729 .xl \\n($lu
731 .if \n@>4 .tm << )z, .z=\\n(.z
733 .de @k \" --- output floating keep
734 .if \n@>4 .tm >> @k, $1=\\$1, .z=\\n(.z
735 .ev 1
737 .ls 1
738 .in 0
739 .sp \\n(zsu
740 .\\$1
743 .rm \\$1
745 .nr ?T 0
747 .de (t \" XXX temp ref to (z
748 .(z \\$1 \\$2
750 .de )t \" XXX temp ref to )t
751 .)z \\$1 \\$2
753 .de (b \" *** begin block
755 .@D 3 \\$1 \\$2
756 .sp \\n(bsu
759 .de )b \" *** end block
762 .if (\\n(bt=0):(\\n(.t<\\n(bt) \
763 . ne \\n(dnu \" make it all on one page
764 .ls 1
769 .in 0
770 .xl \\n($lu
772 .rm |k
773 .sp \\n(bsu+\\n(.Lv-1v
775 .de @( \" --- begin keep
776 .if !"\\n(.z"" .tm Line \\n(c. -- Illegal nested keep \\n(.z
778 .di |k
779 \!'rs
781 .de @M \" --- set modes for display
782 .nr ?k 1
783 .@C 1
784 .@F \\n(df
785 .vs \\n(.sp*\\n($Ru/100u
787 .if "\\*(|p"F" \
788 . fi \" set fill mode if "F" parameter
789 .if \\n(_d=4 \
790 . in 0
791 .if \\n(_d=3 \
793 . in +\\n(biu
794 . xl -\\n(biu
796 .if \\n(_d=1 \
797 . ce 10000
799 .de @) \" --- end keep
801 .if !"\\n(.z"|k" .tm Line \\n(c. -- Close of a keep which has never been opened
802 .nr ?k 0
804 .in 0
805 .ce 0
807 .de (c \" *** begin block centered text
808 .if "\\n(.z"|c" .tm Line \\n(c. -- Nested .(c requests
809 .di |c
811 .de )c \" *** end block centered text
812 .if !"\\n(.z"|c" .tm Line \\n(c. -- Unmatched .)c
813 .br \" force out final line
815 .if \n@>4 .tm >> .)c .l=\\n(.l .i=\\n(.i $i=\\n($i dl=\\n(dl
816 .ev 1
817 .ls 1
818 .in (\\n(.lu-\\n(.iu-\\n(dlu)/2u
819 .if \n@>4 .tm -- .)c << .in .l=\\n(.l .i=\\n(.i dl=\\n(dl
826 .rm |c
828 .\" *** BLOCK QUOTES (OR WHATEVER) AND LISTS ***
829 .de (q \" *** begin block quote
831 .@C 1
833 .sp \\n(qsu
834 .in +\\n(qiu
835 .xl -\\n(qiu
836 .sz \\n(qp
838 .de )q \" *** end block quote
841 .sp \\n(qsu+\\n(.Lv-1v
842 .nr ?k 0
844 .de (l \" *** begin list
846 .sp \\n(bsu
847 .@D 3 \\$1 \\$2
850 .de )l \" *** end list
853 .sp \\n(bsu+\\n(.Lv-1v
854 .nr ?k 0
856 .\" *** PREPROCESSOR SUPPORT ***
858 .\" EQN
860 .de EQ \" *** equation start
862 .if !\\n(?e \
864 . if "\\n(.z"|e" .tm Line \\n(c. -- Nested .EQ request
865 . @D 1 "\\$1" "\\$2"
866 . @C 2
867 . di |e
869 .ls 1
870 .in 0
873 .de EN \" *** equation end
875 .ie "\\$1"C" \
877 . nr ?e 1
878 . sp \\n(esu
880 .el \
882 . nr ?e 0
883 . di
884 . if \\n(dn \
885 . @q \" actual equation output
886 . rm |e
887 . ev
890 .de @q \" --- equation output
891 .nr _Q \\n(dnu
893 .sp \\n(esu \" output rest of preceeding text
894 .@C 2 \" .ev 2 may be jumbled from header
895 .ie \\n(_d=1 \
896 . in (\\n(.lu+\\n($iu-\\n(dlu)/2u
897 .el .ie \\n(_d=2 \
898 . in \\n($iu
899 .el .ie \\n(_d=3 \
900 . in \\n(biu+\\n($iu
901 .el .if \\n(_d=4 \
902 . in 0
903 .if !"\\n(.z"" \!.ne \\n(_Qu
904 .ne \\n(_Qu+\n(.Vu \" keep it on one page
905 .mk _q
906 .if \n@>1 .tm --@e: _Q=\\n(_Q _q=\\n(_q nl=\\n(nl |p=\\*(|p
907 .if !"\\*(|p"" \
909 . rs
910 . sp (\\n(_Qu-\\n(.vu)/2u
911 . tl """\\*(|p"
912 . rt \\n(_qu
915 .sp |\\n(_qu+\\n(_Qu
916 .sp \\n(esu+\\n(.Lv-1v
917 .rr _q
918 .rr _Q
921 .\" TBL
923 .de TS \" *** table start
924 .sp \\n(bsu
925 .@C 1
926 .fi \" drop into fill mode for text boxes
927 .if "\\$1"H" \
929 . di |h \" save header part
930 . nr ?T 1
932 .ls 1
933 .ch @f -(\\n(_bu+1v) \" set pseudo-trap for bottom line
934 .if \\n(.p-\\n(_b-1v<=\\n(nl \
935 . ch @f \\n(nlu+\n(.Vu
937 .de TH \" *** end header part of table
938 .nr T. 0
939 .T# 0
941 .nr _i \\n(.i
942 .in 0
943 .|h \" put in the initial header
944 .in \\n(_iu
945 .rr _i
946 .mk #T
948 .de TE \" *** table end
949 .nr ?T 0
950 .ch @f -\\n(_bu \" reset pseudo-trap
951 .if \\n(.p-\\n(_b<=\\n(nl \
952 . ch @f \\n(nlu+\n(.Vu
954 .sp \\n(bsu+\\n(.Lv-1v
958 .\" REFER
960 .de ][ \" *** refer output
961 .if \\$1>5 .tm Bad arg to []
962 .[\\$1
964 .de [0 \" --- other
966 .ip "\\*([F.\0"
967 .if !"\\*([A"" \\*([A,
968 .if !"\\*([T"" \\f2\\*([T\\f1\c
969 .if !"\\*([T"" .if !"\\*([O"" ,\
970 .ie !"\\*([O"" \\*([O
971 .el .if !"\\*([T"" \&.
972 .if !"\\*([D"" \\*([D.
976 .de [1 \" --- journal article
978 .ip "\\*([F.\0"
979 \\*([A,
980 .if !"\\*([T"" \\*(lq\\*([T,\\*(rq
981 .if "\\*([V"" \\f2\\*([J\\f1,
982 .if !"\\*([V"" \\f2\\*([J\\f1
983 .if !"\\*([V"" \\f3\\*([V\\f1\c
984 .if !"\\*([N"" (\\*([N)\c
985 .if !"\\*([P"" \
987 . ie \\n([P>0 \ pp.\&
988 . el \ p.\&
989 \\*([P
991 .if !"\\*([I"" .if "\\*([R"" \\*([I,
992 (\\*([D).
993 .if !"\\*([O"" \\*([O
996 .de [2 \" --- book
998 .ip "\\*([F.\0"
999 \\*([A, \\f2\\*([T,\\f1
1000 \\*([I\c
1001 .if !"\\*([C"" , \\*([C\c
1002 (\\*([D).
1003 .if !"\\*([G"" Gov't. ordering no. \\*([G
1004 .if !"\\*([O"" \\*([O
1007 .de [3 \" --- article in book
1009 .ip "\\*([F.\0"
1010 \\*([A, \\*(lq\\*([T,\\*(rq
1011 .if !"\\*([P"" pp. \\*([P
1012 in \\f2\\*([B\\f1, \c
1013 .if !"\\*([E"" ed. \\*([E,\c
1014 .if !"\\*([I"" \\*([I\c
1015 .if !"\\*([C"" , \\*([C\c
1016 (\\*([D).
1017 .if !"\\*([O"" \\*([O
1020 .de [4 \" --- report
1022 .ip "\\*([F.\0"
1023 \\*([A, \\*(lq\\*([T,\\*(rq
1024 \\*([R\c
1025 .if !"\\*([G"" \& (\\*([G)\c
1026 .if !"\\*([I"" , \\*([I\c
1027 .if !"\\*([C"" , \\*([C\c
1028 (\\*([D).
1029 .if !"\\*([O"" \\*([O
1032 .de [5 \" --- tm style
1034 .ip "\\*([F.\0"
1035 \\*([A, \\f2\\*([T\\f1,
1036 .ie \\n(TN \\*([M.
1037 .el Bell Laboratories internal memorandum (\\*([D).
1040 .de ]<
1041 .$p References
1043 .rm (f )f
1045 .de ]>
1048 .de ]-
1049 .rm [V [P [A [T [N [C [B [O [R [I [E [D
1051 .ie \n(.V<1v \
1053 . ds [. \s-2\v'-.4m'\f1
1054 . ds .] \v'.4m'\s+2\fP
1056 .el \
1058 . ds [. " [
1059 . ds .] ]
1062 .\" IDEAL
1064 .de IS \" *** start ideal picture
1065 .nr g7 \\n(.u
1066 .ls 1
1068 .de IF
1069 .if \\n(g7 .fi
1072 .de IE \" *** end ideal picture
1073 .if \\n(g7 .fi
1077 .\" PIC
1079 .de PS \" *** start picture: $1=height, $2=width in units or inches
1080 .sp 0.3
1081 .nr g7 \\$2
1082 .in (\\n(.lu-\\n(g7u)/2u
1083 .ne \\$1u
1084 .nr g7 \\n(.u
1085 .ls 1
1087 .de PE \" *** end picture
1090 .if \\n(g7 .fi
1091 .sp .6
1094 .\" GREMLIN
1096 .de GS \" *** start gremlin picture
1097 .nr g7 (\\n(.lu-\\n(g1u)/2u
1098 .if "\\$1"L" .nr g7 \\n(.iu
1099 .if "\\$1"R" .nr g7 \\n(.lu-\\n(g1u
1100 .in \\n(g7u
1101 .nr g7 \\n(.u
1102 .ls 1
1104 .ne \\n(g2u
1106 .de GE \" *** end gremlin picture
1108 .sp .6
1110 .de GF \" *** finish gremlin picture; stay at top
1113 .if \\n(g7 .fi
1115 .\" *** FONT AIDS ***
1116 .de sz \" *** set point size and vertical spacing
1117 .ps \\$1
1118 .vs \\n(.sp*\\n($ru/100u \" default vs at pointsize + 20%
1120 .de @E \" --- store in _F argument to \f for restoring font
1121 .ie \\n(.f<10 \
1122 . ds _F \\n(.f
1123 .el \
1125 . ie \\n(.f<100&\n(.g \
1126 . ds _F (\\n(.f
1127 . el \
1128 . ds _F P
1131 .de r \" *** enter roman font
1133 .ft 1
1134 .if \\n(.$ \&\\$1\f\\*(_F\\$2
1136 .de i \" *** enter italic
1138 .ft 2
1139 .if \\n(.$ \&\\$1\f\\*(_F\\$2
1141 .de b \" *** enter boldface
1143 .ft 3
1144 .if \\n(.$ \&\\$1\f\\*(_F\\$2
1146 .de rb \" *** enter real boldface
1148 .ft 3
1149 .if \\n(.$ \&\\$1\f\\*(_F\\$2
1151 .de bi \" *** enter bold italic
1153 .ft 4
1154 .if \\n(.$ \&\\$1\f\\*(_F\\$2
1156 .de u \" *** enter underlined word
1157 \&\\$1\l'|0\(ul'\\$2
1159 .de q \" *** enter quoted word
1160 \&\\*(lq\\$1\\*(rq\\$2
1162 .de bx \" *** enter boxed word
1163 \k~\(br\|\\$1\|\(br\l'|\\n~u\(rn'\l'|\\n~u\(ul'\^\\$2
1165 .de sm \" *** print in smaller font
1166 \s-1\\$1\\s0\\$2
1168 .de @F \" --- change font (0 -> no change)
1169 .nr ~ \\$1
1170 .if \\n~>0 \
1171 . ft \\n~
1172 .rr ~
1174 .\" *** FOOTNOTING ***
1175 .de (f \" *** begin footnote
1177 .if "\\n(.z"|f" .tm Line \\n(c. -- Illegal footnote nesting
1178 .ie "\\n(.z"" \
1180 . nr _D \\n(dn
1181 . nr _0 1v+\\n(nlu
1182 . ev 2
1183 . da |f
1184 . in 0
1185 . xl \\n($lu-\\n(fuu
1186 . @F \\n(ff
1187 . sz \\n(fp
1188 . vs \\n(.sp*\\n($Ru/100u
1189 . if !\\n(?f \
1191 . nr _b +1v \" allow space for $s
1192 . $s
1193 . \}
1194 . br
1195 . if \\n(.p-\\n(_b-\\n(_0-\\n(.h-1v-\\n(fs<0 \
1197 . da\" \" won't fit on page at all
1198 . bc
1199 . if !\\n(?f \
1200 . rm |f
1201 . da |f
1202 .\" next five lines could be dropped if headers had their own environment
1203 . in 0 \" reset everything from .bc
1204 . xl \\n($lu-\\n(fuu
1205 . @F \\n(ff
1206 . sz \\n(fp
1207 . vs \\n(.sp*\\n($Ru/100u
1208 . if !\\n(?f \
1209 . $s
1210 . br
1211 . \}
1212 . rr _0
1213 . sp \\n(fsu
1214 . nr ?f 1
1215 . fi
1216 . if !"\\$1"_" \
1217 . ti \\n(fiu
1218 . if \n@>2 .tm << (f $f=\\n($f
1220 .el \
1222 . ev 2
1223 \!.(f \\$1
1226 .de )f \" *** end footnote
1227 .ie "\\n(.z"|f" \
1229 . if \\n* \
1230 . nr $f +1
1231 . ds * \\*{\\n($f\\*}\k*
1232 . rr *
1233 . in 0
1234 . da
1235 . ev
1236 . if \\n(_w<\\n(dl \
1237 . nr _w \\n(dl \" compute maximum fn width
1238 . nr _b +\\n(dn
1239 . ch @f -\\n(_bu
1240 . if \\n(.p-\\n(_b<=\\n(nl \
1241 . ch @f \\n(nlu+\n(.Vu
1242 . nr dn \\n(_D
1243 . rr _D
1245 .el \
1247 . br
1248 \!.)f
1249 . ev
1252 .if \n(ff<=0 \
1253 . nr ff 1 \" footnote font: Times Roman
1254 .if \n(fp<=0 \
1255 . nr fp 8 \" footnote pointsize
1256 .de $s \" $$$ footnote separator
1257 \l'2i'
1259 .\" *** DELAYED TEXT ***
1260 .de (d \" *** begin delayed text
1261 .am |d )d
1262 .sp \\n(bsu
1264 .de )d \" *** end delayed text
1265 .if \\n# \
1266 . nr $d +1
1267 .ds # [\\n($d]\k#
1268 .rr #
1270 .de pd \" *** print delayed text
1272 .rm |d
1273 .nr $d 1 1
1274 .ds # [1]\k#
1276 .\" *** INDEXES (TABLE OF CONTENTS) ***
1277 .nr _x 0 1
1278 .af _x a
1279 .de (x \" *** begin index entry
1280 .if \n@>4 .tm >> (x, .z=\\n(.z
1281 .ds |X x
1282 .if \\n(.$>0 \
1283 . ds |X \\$1
1284 .ie "\\n(.z"" \
1285 . nr _z 0
1286 .el \
1287 . nr _z 1
1288 .@\\n(_z
1290 .de @0 \" --- finish (x if no current diversion
1291 .am %\\*(|X )x
1292 .sp \\n(xsu
1293 .ti -\\n(piu
1295 .de @1 \" --- finish (x if current diversion
1296 .if "\\n(_x"z" .nr _x 0
1297 .de =\\n+(_x )x
1299 .de )x \" *** end index entry
1300 .if \n@>4 .tm >> )x, .z=\\n(.z
1301 .ie "\\n(.z"" \
1303 . ds |x \\n%
1304 . if \\n(.$>0 \
1305 . ds |x \\$1
1306 . if "\\*(|x"_" \
1307 . ig ..
1308 . am %\\*(|X ..
1309 . if \w"\\$2">(\\n(.l-\\n(.i-\\n(.k) \
1310 . ti +\\n(xuu
1311 \\\\a\\\\t\\$2\\*(|x
1313 . rm |x
1314 . rm |X
1316 .el \
1318 \!.(x \\*(|X
1319 \!\\\\*(=\\n(_x\\\\
1320 \!.)x \\$1 \\$2
1321 \!.rm =\\n(_x
1324 .de xp \" *** print the index
1326 .@C 2
1327 .ls 1
1328 .vs \\n(.sp*\\n($Ru/100u
1330 .in +\\n(piu
1331 .ds |X x
1332 .if \\n(.$>0 \
1333 . ds |X \\$1
1334 .xl -(\\n(xuu+\w'...'u)
1335 .di |x
1336 .%\\*(|X
1339 .rm %\\*(|X
1340 .xl \\n($lu
1341 .rm |X
1344 .in 0
1345 .ta \\n(.lu-\\n(xuuR \\n(.luR
1349 .rm |x
1351 .de +c \" *** begin chapter
1352 .ep \" force out footnotes
1353 .if \\n(?o:\\n(?a \
1355 . bp \" force out a table or more footnote
1356 . rs
1357 . ep
1359 .nr ?C 1
1360 .nr $f 1 1
1361 .ds * \\*{1\\*}\k*
1362 .if \\n(?R \
1363 . pn 1
1365 .in \\n($iu \" reset the indent
1367 .ie \\n(.$ \
1368 . $c "\\$1"
1369 .el \
1370 . sp 3
1372 .de ++ \" *** declare chapter type
1373 .nr _0 0
1374 .if "\\$1"C" \
1375 . nr _0 1 \" chapter
1376 .if "\\$1"RC" \
1377 . nr _0 11 \" renumbered chapter
1378 .if "\\$1"A" \
1379 . nr _0 2 \" appendix
1380 .if "\\$1"RA" \
1381 . nr _0 12 \" renumbered appendix
1382 .if "\\$1"P" \
1383 . nr _0 3 \" preliminary material
1384 .if "\\$1"B" \
1385 . nr _0 4 \" bibliographic material
1386 .if "\\$1"AB" \
1387 . nr _0 5 \" abstract
1388 .if \\n(_0=0 \
1389 . tm Line \\n(c. -- Bad mode to .++
1390 .nr ?R 0
1391 .if \\n(_0>10 \
1393 . nr ?R 1
1394 . nr _0 -10
1396 .nr ch 0 1
1397 .if (\\n(_0=3):(\\n(_0=5) \
1398 . pn 1 \" must do before .ep
1399 .ep \" end page for correct page number types
1400 .if \\n(_0=1 \
1402 . af ch 1
1403 . af % 1
1405 .if \\n(_0=2 \
1407 . af ch A
1408 . af % 1
1410 .if \\n(_0=3 \
1411 . af % i
1412 .if \\n(_0=4 \
1413 . af % 1
1414 .if \\n(_0=5 \
1415 . af % 1
1416 .if \\n(.$>1 \
1417 . he \\$2
1418 .if !\\n(_0=\\n(_M .if \\n(_M=3 \
1419 . pn 1
1420 .nr _M \\n(_0
1421 .rr _0
1423 .de $c \" $$$ print chapter title
1424 .sz 12
1425 .ft 3
1426 .ce 1000
1427 .if \\n(_M<3 \
1428 . nr ch +1
1429 .ie \\n(_M=1 CHAPTER\ \ \\n(ch
1430 .el .if \\n(_M=2 APPENDIX\ \ \\n(ch
1431 .if \w"\\$1" .sp 3-\\n(.L
1432 .if \w"\\$1" \\$1
1433 .if (\\n(_M<3):(\w"\\$1") \
1434 . sp 4-\\n(.L
1435 .ce 0
1438 .ie \\n(_M=1 \
1439 . $C Chapter \\n(ch "\\$1"
1440 .el .if \\n(_M=2 \
1441 . $C Appendix \\n(ch "\\$1"
1443 .de tp \" *** title page
1448 .pn \\n%
1450 .\" *** DATES ***
1451 .if \n(mo=1 .ds mo January
1452 .if \n(mo=2 .ds mo February
1453 .if \n(mo=3 .ds mo March
1454 .if \n(mo=4 .ds mo April
1455 .if \n(mo=5 .ds mo May
1456 .if \n(mo=6 .ds mo June
1457 .if \n(mo=7 .ds mo July
1458 .if \n(mo=8 .ds mo August
1459 .if \n(mo=9 .ds mo September
1460 .if \n(mo=10 .ds mo October
1461 .if \n(mo=11 .ds mo November
1462 .if \n(mo=12 .ds mo December
1463 .if \n(dw=1 .ds dw Sunday
1464 .if \n(dw=2 .ds dw Monday
1465 .if \n(dw=3 .ds dw Tuesday
1466 .if \n(dw=4 .ds dw Wednesday
1467 .if \n(dw=5 .ds dw Thursday
1468 .if \n(dw=6 .ds dw Friday
1469 .if \n(dw=7 .ds dw Saturday
1470 .ds td \*(mo \n(dy, 19\n(yr
1471 .\" *** PARAMETRIC INITIALIZATIONS ***
1472 .rr x
1473 .nr $r \n(.v*100+\n(.sp-1u/\n(.sp \" ratio of vs to ps for .sz request
1474 .nr $R \n($r \" ratio for displays & footnotes
1475 .nr hm 4v \" header margin
1476 .nr tm 7v \" top margin
1477 .nr bm 6v \" bottom margin
1478 .nr fm 3v \" footer margin
1479 .nr tf 3 \" title font: (real) Times Bold
1480 .nr tp 10 \" title point size
1481 .hy 14
1482 .nr bi 4m \" indent for blocks
1483 .nr pi 5n \" indent for paragraphs
1484 .nr pf 1 \" normal text font
1485 .nr pp 10 \" normal text point size
1486 .nr qi 4n \" indent for quotes
1487 .nr qp -1 \" down one point
1488 .nr ii 5n \" indent for .ip's and .np's
1489 .nr $m 1 \" max number of columns
1490 .nr $s 4n \" column separation
1491 .nr sf 3 \" section font -- Times Bold
1492 .nr sp 10 \" section title pointsize
1493 .nr ss 12p \" section prespacing
1494 .nr si 0 \" section indent
1495 .\" *** OTHER INITIALIZATION ***
1496 .ds { \v'-0.4m'\x'-0.2m'\s-3
1497 .ds } \s0\v'0.4m'
1498 .ds < \v'0.4m'\x'0.2m'\s-3
1499 .ds > \s0\v'-0.4m'
1500 .ds - \(em
1501 .nr fi 0.3i
1502 .nr _o \n(.o
1503 .nr $b 3 \" bold
1504 .nr ps 0.35v
1505 .if \n(ps<\n(.V .nr ps \n(.V
1506 .nr bs \n(ps \" block pre/post spacing
1507 .nr qs \n(ps \" quote pre/post spacing
1508 .nr zs 1v \" float-block pre/postspacing
1509 .nr xs 0.2v \" index prespacing
1510 .nr xu 0.5i \" index undent
1511 .nr fs 0.2v \" footnote prespacing
1512 .nr es 0.5v \" equation pre/postspacing
1513 .if \n(es<\n(.V .nr es \n(.V
1514 .wh 0 @h \" set header
1515 .nr $l \n(.lu \" line length
1516 .nr _L \n(.lu \" line length of page
1517 .nr $c 1 \" current column number
1518 .nr $f 1 1 \" footnote number
1519 .ds * \*{1\*}\k*\" \" footnote "name"
1520 .nr $d 1 1 \" delayed text number
1521 .ds # [1]\k#\" \" delayed text "name"
1522 .nr _M 1 \" chapter mode is chapter
1523 .ds lq \(lq\" \" left quote
1524 .ds rq \(rq\" \" right quote
1525 .em @z
1526 .\" *** FOREIGN LETTERS AND SPECIAL CHARACTERS ***
1527 .ds #h ((1u-(\\\\n(.fu%2u))*0.13m)
1528 .ds #v 0.6m
1529 .\" \" accents
1530 .ds ' \k_\h'-(\\n(.wu*8/10-\*(#h)'\(aa\h'|\\n_u'
1531 .ds ` \k_\h'-(\\n(.wu*7/10-\*(#h)'\(ga\h'|\\n_u'
1532 .\" \" umlaut
1533 .ds : \k_\h'-(\\n(.wu*8/10-\*(#h+0.1m)'\v'-\*(#v'\z.\h'0.2m'.\h'|\\n_u'\v'\*(#v'
1534 .\" \" circumflex and tilde
1535 .ds ^ \k_\h'-(\\n(.wu-\*(#h-0.05m)'^\h'|\\n_u'
1536 .ds ~ \k_\h'-(\\n(.wu-\*(#h-0.05m)'~\h'|\\n_u'
1537 .\" \" cedilla and czech
1538 .ds , \k_\h'-(\\n(.wu)'\*(#[,\h'|\\n_u'
1539 .ds v \k_\h'-(\\n(.wu*9/10-\*(#h)'\v'-\*(#v'\s-4v\s0\v'\*(#v'\h'|\\n_u'
1540 .\" \" Norwegian A or angstrom
1541 .ds o \k_\h'-(\\n(.wu+\w'\(de'u-\*(#h)/2u'\v'-0.4n'\z\(de\v'0.4n'\h'|\\n_u'
1542 .\" \" there exists, for all
1543 .ds qe \s-2\v'0.45m'\z\(em\v'-0.625m'\z\(em\v'-0.625m'\(em\v'0.8m'\s0\h'-0.1m'\v'-0.05m'\(br\v'0.05m'\h'0.1m'
1544 .ds qa \z\e\h'0.35m'\z\(sl\h'-0.33m'\v'-0.3m'\s-4\(em\s0\v'0.3m'\h'0.15m'
1545 .rm #h #v
1546 .ll 6.0i
1547 .lt 6.0i
1548 .de @S
1549 .tm The \\$1 macro has been removed from this version of the -me macros.
1551 .de lo
1552 .@S lo
1554 .de th
1555 .@S th
1557 .de ac
1558 .@S ac