2 .\" Copyright (c) 1988, 1993
3 .\" The Regents of the University of California. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\" must display the following acknowledgement:
15 .\" This product includes software developed by the University of
16 .\" California, Berkeley and its contributors.
17 .\" 4. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" @(#)tmac.e 8.1 (Berkeley) 6/5/93
39 .\"**********************************************************************
41 .\"* ****** - M E N R O F F / T R O F F M A C R O S ****** *
43 .\"* Produced for your edification and enjoyment by: *
45 .\"* Electronics Research Laboratory *
47 .\"* current address: *
48 .\"* Britton-Lee, Inc. *
49 .\"* 1919 Addison Street Suite 105 *
50 .\"* Berkeley, California 94704 *
52 .\"* VERSION 8.1 First Release: 11 Sept 1978 *
53 .\"* See file \*(||/revisions for revision history *
55 .\"* Documentation is available. *
57 .\"**********************************************************************
59 .\" Code on .de commands:
60 .\" *** a user interface macro.
61 .\" &&& a user interface macro which is redefined
62 .\" when used to be the real thing.
63 .\" $$$ a macro which may be redefined by the user
64 .\" to provide variant functions.
65 .\" --- an internal macro.
67 .\" library directory for sourced files:
68 .ds || /usr/old/lib/me
71 .if !\n(.V .tm You are using the wrong version of NROFF/TROFF!!
72 .if !\n(.V .tm This macro package works only on the version seven
73 .if !\n(.V .tm release of NROFF and TROFF.
77 .\"
\f *** INTERNAL GP MACROS ***
78 .de @C \" --- change ev's, taking info with us
97 .de @D \" --- determine display type (Indent, Left, Center)
111 .de @z \" --- end macro
112 .if \n@>1 .tm >> @z, .z=\\n(.z ?a=\\n(?a
115 . tm Line \\n(c. -- Unclosed block, footnote, or other diversion (\\n(.z)
120 . bp \" force out final table
122 .rm @b\" \" don't start another page
128 .de @I \" --- initialize processor
135 .\"
\f *** STANDARD HEADERS AND FOOTERS ***
136 .de he \" *** define header
144 . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
145 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
148 .de eh \" *** define even header
152 . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
154 .de oh \" *** define odd header
158 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
160 .de fo \" *** define footer
168 . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
169 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
172 .de ef \" *** define even foot
176 . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
178 .de of \" *** define odd footer
182 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
184 .de ep \" *** end page (must always be followed by a .bp)
192 .\"
\f *** INTERNAL HEADER AND FOOTER MACROS ***
194 .if \n@>1 .tm >> @h %=\\n% ?a=\\n(?a ?b=\\n(?b ?w=\\n(?w
195 .if (\\n(.i+\\n(.o)>=\\n(.l \
196 . tm Line \\n(c. -- Offset + indent exceeds line length
197 .if t .if (\\n(.l+\\n(.o)>7.75i \
198 . tm Line \\n(c. -- Offset + line length exceeds paper width
199 .\" initialize a pile of junk
200 .nr ?h \\n(?H \" transfer "next page" to "this page"
204 .if !"\\*(|4"" .rn |4 |0
205 .if !"\\*(|5"" .rn |5 |1
206 .if !"\\*(|6"" .rn |6 |2
207 .if !"\\*(|7"" .rn |7 |3
208 .nr _w 0 \" reset max footnote width
209 .nr ?W 0 \" no wide floats this page (yet)
211 .\" begin actual header stuff
214 .if t .@m \" output cut mark
216 . sp |\\n(hmu \" move to header position
217 .@t $h \" output header title
220 .sp |\\n(tmu \" move to top of text
222 .mk _k \" for columned output
223 .if \\n(?n .nm 1 \" restore line numbering if n1 mode
224 .nr $c 1 \" set first column
225 .if \n@>4 .tm -- @h >> .ns nl=\\n(nl %=\\n% _k=\\n(_k tm=\\n(tm
233 . @n \" begin the column
238 . de @m \" --- output cut mark (only on C/A/T-style)
246 .de @n \" --- new column or page
247 .if \n@>3 .tm >> @n nl=\\n(nl %=\\n% ?f=\\n(?f ?o=\\n(?o
250 .if (\\n(_w<=\\n($l)&(\\n(?W=0) \
252 . nr _b (\\n(ppu*\\n($ru)/2u \" compute fudge factor (must be < 1P)
253 . if \\n(_bu>((\\n(bmu-\\n(fmu-(\\n(tpu*\\n($ru))/2u) \
254 . nr _b (\\n(ppu*\\n($ru)-\n(.Vu
260 .nr _b +(\\n(ppu*\\n($ru) \" add 1 paragraph v in case of sweep past
261 .if \n@>2 .tm @n .p=\\n(.p bm=\\n(bm _b=\\n(_b _B=\\n(_B
262 .nr ?f 0 \" reset footnote flag
265 . (f _ \" reprocess footnotes which run off page
277 . |h \" output the table header
280 . mk #T \" for tbl commands
283 .if (\\n(?a)&((\\n($c<2):(\\n(?w=0)) \
285 . nr ?a 0 \" output floating keep
288 . mk _k \" don't overstrike wide keeps
292 .$H \" special column header macro
296 .if \n@>1 .tm >> @f %=\\n% nl=\\n(nl ?a=\\n(?a ?b=\\n(?b ?f=\\n(?f
297 .if \n@>2 .nr VL \\n(.pu-\\n(nlu
298 .if \n@>2 .tm @f bm=\\n(bm _B=\\n(_B _b=\\n(_b .p-nl=\\n(VL
302 . nr T. 1 \" for tbl commands (to output bottom line)
303 . T# 1 \" output the sides and bottom lines
311 . @k |b\" \" output bottom of page tables
314 . @o \" output footnote if present
316 . @c \" handle new column
322 .de @o \" --- output footnote
326 .if \n@>2 .tm @o last printed text = \\n(nl placing @r trap at -\\n(_B
330 .if \n@>2 .tm @o triggered @r (?o) = \\n(?o
333 . di \" just in case triggered @r
345 .de @c \" --- new column
346 .if \n@>2 .tm >> @c %=\\n%
353 .de @e \" --- end page
357 .sp |\\n(.pu-\\n(fmu-(\\n(tpu*\\n($ru) \" move to footer position
358 .@t $f \" output footer title
362 .de @t \" --- output header or footer title
365 . sz \\n(tp \" set header/footer type fonts, etc.
367 . lt \\n(_Lu \" make title span entire page
373 .de $h \" $$$ print header
377 . if e .ds |z "\\*(|0
378 . if o .ds |z "\\*(|1
380 .if !\(ts\\*(|z\(ts\(ts \
384 .de $f \" $$$ print footer
388 . if e .ds |z "\\*(|0
389 . if o .ds |z "\\*(|1
391 .if \(ts\\*(|z\(ts\(ts \
393 . if e .ds |z "\\*(|2
394 . if o .ds |z "\\*(|3
396 .if !\(ts\\*(|z\(ts\(ts \
400 .de @r \" --- reprocess overflow footnotes
401 .if \n@>3 .tm >> @r .z=\\n(.z ?f=\\n(?f ?a=\\n(?a ?b=\\n(?b _b=\\n(_b
402 .di |o \" save overflow footnote
407 .\"
\f *** COMMANDS WITH VARIANT DEFINITIONS ***
408 .rn bp @b \" --- begin page
409 .de bp \" *** begin new page (overrides columns)
410 .nr $c \\n($m \" force new page, not new column
418 . @h \" 'spring' the header trap
421 .wh 0 @h \" reset header
423 .rn ll xl \" *** special line length (local)
424 .de ll \" *** line length (global to environments)
428 .if (\\n($m<=1):(\\n($l>\\n(_L) \
431 .rn po @O \" --- local page offset
432 .de po \" *** page offset
436 .\"
\f *** MISCELLANEOUS ROFF COMMANDS ***
437 .de hx \" *** suppress headers and footers next page
440 .de ix \" *** indent, no break
443 .de bl \" *** contiguous blank lines
449 .de n1 \" *** line numbering 1
454 .de n2 \" *** line numbering 2
461 .de pa \" *** new page
464 .de ro \" *** roman page numbers
467 .de ar \" *** arabic page numbers
470 .de m1 \" *** position one space
473 .nr tm +\\n(hmu-\\n(_0u
476 .de m2 \" *** position two space
477 .nr tm \\n(hmu+\\n(tpp+\\$1v
479 .de m3 \" *** position three space
480 .nr bm \\n(fmu+\\n(tpp+\\$1v
482 .de m4 \" *** position four space
485 .nr bm +\\n(fmu-\\n(_0u
487 .de sk \" *** leave a blank page (next page)
489 . tm Line \\n(c. -- I cannot skip multiple pages
492 .\"
\f *** MISCELLANEOUS USER SUPPORT COMMANDS ***
493 .de re \" *** reset tabs (TROFF defines 15 stops default)
494 .ta 0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i +0.5i
497 .de re \" *** reset tabs (NROFF version)
498 .ta 0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i +0.8i
500 .de ba \" *** set base indent
504 . nr $i \\n(siu*\\n($0u
506 .de hl \" *** draw horizontal line
511 .\"
\f *** PARAGRAPHING ***
512 .de pp \" *** paragraph
515 .de lp \" *** left aligned paragraph
521 .de ip \" *** indented paragraph w/ optional tag
522 .if (\\n(ii>0)&(\\n(ii<1n) \
531 . ie \\w"\\$1">=\\n(_0 \
536 . el \&\\$1\h'|\\n(_0u'\c
540 .de np \" *** numbered paragraph
542 . nr $p 0 \" reset number after .bu
543 .nr $p +1 \" increment paragraph number
546 \0(\\n($p)\h'|\w'\0(000)\0'u'\c
548 .de bu \" *** bulleted paragraph
551 . ns \" don't space between .bu paragraphs
552 .nr $p 0-1 \" mark "bulleted paragraph" mode
557 .de @p \" --- initialize for paragraph
558 .@I \" initialize macro processor
559 .if "\\n(.z"|e" .tm Line \\n(c. -- Unmatched continued equation
571 .\"
\f *** SECTION HEADINGS ***
572 .de sh \" &&& section heading
575 .sh "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
578 .de $p \" $$$ print section heading
579 .if (\\n(si>0)&(\\n(.$>2) \
584 . sp \\n(ssu \" one of them is non-null
585 . ne \\n(.Lv+\\n(.Vu+\\n(psu+(\\n(spu*\\n($ru*\\n(.Lu)
587 . ti -(\\n(siu-\\n(sou)
594 . if \w"\\$2">0 \\$2.
595 . if \w"\\$1">0 \\$1\f1\ \ \&
602 .de uh \" *** unnumbered section heading
608 .\"
\f *** COLUMNED OUTPUT ***
609 .de 2c \" *** double columned output
612 . 1c \" revert to 1c if already 2c
618 . nr $s \\$1n \" param 1: column separation
619 .nr $l (\\n(.l-((\\n($m-1)*\\n($s))/\\n($m
624 .de 1c \" *** single columned output
628 .ll \\n(_Lu \" return to normal output
632 .de bc \" *** begin column
635 .\"
\f *** FLOATING TABLES AND NONFLOATING BLOCKS ***
636 .de (z \" &&& begin floating keep
642 .de )z \" &&& end floating keep
643 .tm Line \\n(c. -- unmatched .)z
645 .de (t \" XXX temp ref to (z
648 .de )t \" XXX temp ref to )t
651 .de (b \" *** begin block
657 .de )b \" *** end block
660 .if (\\n(bt=0):(\\n(.t<\\n(bt) \
661 . ne \\n(dnu \" make it all on one page
671 .sp \\n(bsu+\\n(.Lv-1v
673 .de @( \" --- begin keep
674 .if !"\\n(.z"" .tm Line \\n(c. -- Illegal nested keep \\n(.z
679 .de @M \" --- set modes for display
686 . fi \" set fill mode if "F" parameter
697 .de @) \" --- end keep
699 .if !"\\n(.z"|k" .tm Line \\n(c. -- Close of a keep which has never been opened
705 .de (c \" *** begin block centered text
706 .if "\\n(.z"|c" .tm Line \\n(c. -- Nested .(c requests
709 .de )c \" *** end block centered text
710 .if !"\\n(.z"|c" .tm Line \\n(c. -- Unmatched .)c
711 .br \" force out final line
713 .if \n@>4 .tm >> .)c .l=\\n(.l .i=\\n(.i $i=\\n($i dl=\\n(dl
716 .in (\\n(.lu-\\n(.iu-\\n(dlu)/2u
717 .if \n@>4 .tm -- .)c << .in .l=\\n(.l .i=\\n(.i dl=\\n(dl
726 .\"
\f *** BLOCK QUOTES (OR WHATEVER) AND LISTS ***
727 .de (q \" *** begin block quote
736 .de )q \" *** end block quote
739 .sp \\n(qsu+\\n(.Lv-1v
742 .de (l \" *** begin list
748 .de )l \" *** end list
751 .sp \\n(bsu+\\n(.Lv-1v
754 .\"
\f *** PREPROCESSOR SUPPORT ***
758 .de EQ \" &&& begin equation
767 .de TS \" &&& begin table
776 .de ]- \" &&& initialize reference
782 .de ]< \" &&& initialize reference
789 .if t .ds [. \s-2\v'-.4m'\f1
791 .if t .ds .] \v'.4m'\s+2\fP
799 .de IS \" *** start ideal picture
807 .de IE \" *** end ideal picture
814 .de PS \" *** start picture: $1=height, $2=width in units or inches
818 .in (\\n(.lu-\\n(g7u)/2u
823 .de PE \" *** end picture
832 .de GS \" *** start gremlin picture
833 .nr g7 (\\n(.lu-\\n(g1u)/2u
834 .if "\\$1"L" .nr g7 \\n(.iu
835 .if "\\$1"R" .nr g7 \\n(.lu-\\n(g1u
842 .de GE \" *** end gremlin picture
846 .de GF \" *** finish gremlin picture; stay at top
851 .\"
\f *** FONT AIDS ***
852 .de sz \" *** set point size and vertical spacing
854 .vs \\n(.su*\\n($ru \" default vs at pointsize + 20%
857 .de r \" *** enter roman font
861 .if \\n(.$ \&\\$1\f\\n(_F\\$2
864 .de i \" *** enter italic
868 .if \\n(.$ \&\\$1\f\\n(_F\\$2
871 .de b \" *** enter boldface (underline in NROFF)
875 .if \\n(.$ \&\\$1\f\\n(_F\\$2
878 .de rb \" *** enter real boldface (not underlined in NROFF)
882 .if \\n(.$ \&\\$1\f\\n(_F\\$2
885 .de u \" *** enter underlined word
888 .de q \" *** enter quoted word
889 \&\\*(lq\\$1\\*(rq\\$2
891 .de bi \" *** enter word in bold italics
893 .ie t \&\k~\\$1\h'|\\n~u+(\\w' 'u/4u)'\\$1\fP\\$2
896 .de bx \" *** enter boxed word
897 .ie \\n($T \&\f2\\$1\fP\\$2
898 .el \k~\(br\|\\$1\|\(br\l'|\\n~u\(rn'\l'|\\n~u\(ul'\^\\$2
900 .de sm \" *** print in smaller font
903 .de @F \" --- change font (8 -> underlined, 0 -> no change)
914 .\"
\f *** FOOTNOTING ***
915 .de (f \" &&& begin footnote
917 .so \\*(||/footnote.me
921 .de )f \" &&& end footnote
922 .tm Line \\n(c. -- unmatched .)f
924 .de $s \" $$$ footnote separator
929 .\"
\f *** DELAYED TEXT ***
930 .de (d \" &&& begin delayed text
932 .so \\*(||/deltext.me
936 .de )d \" &&& end delayed text
937 .tm Line \\n(c. -- unmatched .)d
939 .\"
\f *** INDEXES (TABLE OF CONTENTS) ***
940 .de (x \" &&& begin index
946 .de )x \" &&& end index entry
947 .tm Line \\n(c. -- unmatched .)x
949 .\"
\f *** STUFF FOR "STANDARD" PAPERS ***
950 .de th \" *** set "thesis" mode
954 .de +c \" *** begin chapter
955 .ep \" force out footnotes
958 . bp \" force out a table or more footnote
968 .in \\n($iu \" reset the indent
975 .de ++ \" *** declare chapter type
980 . nr _0 11 \" renumbered chapter
982 . nr _0 2 \" appendix
984 . nr _0 12 \" renumbered appendix
986 . nr _0 3 \" preliminary material
988 . nr _0 4 \" bibliographic material
990 . nr _0 5 \" abstract
992 . tm Line \\n(c. -- Bad mode to .++
1000 .if (\\n(_0=3):(\\n(_0=5) \
1001 . pn 1 \" must do before .ep
1002 .ep \" end page for correct page number types
1021 .if !\\n(_0=\\n(_M .if \\n(_M=3 \
1026 .de $c \" $$$ print chapter title
1032 .ie \\n(_M=1 CHAPTER\ \ \\n(ch
1033 .el .if \\n(_M=2 APPENDIX\ \ \\n(ch
1034 .if \w"\\$1" .sp 3-\\n(.L
1036 .if (\\n(_M<3):(\w"\\$1") \
1042 . $C Chapter \\n(ch "\\$1"
1044 . $C Appendix \\n(ch "\\$1"
1046 .de tp \" *** title page
1053 .de ac \" *** setup for ACM photo-ready paper
1059 .de lo \" *** pull in the set of local macros
1060 .\" all these macros should be named "*X", where X is any letter
1064 .de lh \" *** letterhead
1065 .so \\*(||/letterhead.me
1068 .if \n(mo=1 .ds mo January
1069 .if \n(mo=2 .ds mo February
1070 .if \n(mo=3 .ds mo March
1071 .if \n(mo=4 .ds mo April
1072 .if \n(mo=5 .ds mo May
1073 .if \n(mo=6 .ds mo June
1074 .if \n(mo=7 .ds mo July
1075 .if \n(mo=8 .ds mo August
1076 .if \n(mo=9 .ds mo September
1077 .if \n(mo=10 .ds mo October
1078 .if \n(mo=11 .ds mo November
1079 .if \n(mo=12 .ds mo December
1080 .if \n(dw=1 .ds dw Sunday
1081 .if \n(dw=2 .ds dw Monday
1082 .if \n(dw=3 .ds dw Tuesday
1083 .if \n(dw=4 .ds dw Wednesday
1084 .if \n(dw=5 .ds dw Thursday
1085 .if \n(dw=6 .ds dw Friday
1086 .if \n(dw=7 .ds dw Saturday
1087 .ds td \*(mo \n(dy, \n(yr+1900
1088 .\"
\f *** PARAMETRIC INITIALIZATIONS ***
1089 .if (1m<0.1i)&(\nx!=0) \
1090 . vs 9p \" for 12-pitch DTC terminals
1092 .nr $r \n(.v/\n(.s \" ratio of vs to ps for .sz request
1093 .nr $R \n($r \" ratio for displays & footnotes
1094 .nr hm 4v \" header margin
1095 .nr tm 7v \" top margin
1096 .nr bm 6v \" bottom margin
1097 .nr fm 3v \" footer margin
1098 .nr tf 3 \" title font: (real) Times Bold
1099 .nr tp 10 \" title point size
1101 .nr bi 4m \" indent for blocks
1102 .nr pi 5n \" indent for paragraphs
1103 .nr pf 1 \" normal text font
1104 .nr pp 10 \" normal text point size
1105 .nr qi 4n \" indent for quotes
1106 .nr qp -1 \" down one point
1107 .nr ii 5n \" indent for .ip's and .np's
1108 .nr $m 1 \" max number of columns
1109 .nr $s 4n \" column separation
1111 .\"
\f *** OTHER INITIALIZATION ***
1119 . ds [ \v'-0.4m'\x'-0.2m'\s-3
1121 . ds < \v'0.4m'\x'0.2m'\s-3
1139 . po -0.5i \" make ugly line on LHS on C/A/T typesetters
1150 .nr $b \nb \" figure the real font 8 font
1154 . if n .nr $b 2 \" italic
1155 . if t .nr $b 3 \" bold
1157 .nr ps 0.5v \" paragraph pre/post spacing
1161 .nr bs \n(ps \" block pre/post spacing
1162 .nr qs \n(ps \" quote pre/post spacing
1163 .nr zs 1v \" float-block pre/postspacing
1164 .nr xs 0.2v \" index prespacing
1165 .nr fs 0.2v \" footnote prespacing
1168 .if n .nr es 1v \" equation pre/postspacing
1170 .wh 0 @h \" set header
1171 .nr $l \n(.lu \" line length
1172 .nr _L \n(.lu \" line length of page
1173 .nr $c 1 \" current column number
1174 .nr $f 1 1 \" footnote number
1175 .ds * \*[1\*]\k*\" \" footnote "name"
1176 .nr $d 1 1 \" delayed text number
1177 .ds # [1]\k#\" \" delayed text "name"
1178 .nr _M 1 \" chapter mode is chapter
1179 .ds lq \&"\" \" left quote
1180 .ds rq \&"\" \" right quote
1186 .\" *** FOREIGN LETTERS AND SPECIAL CHARACTERS ***
1187 .de sc \" *** define special characters