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
37 .\"**********************************************************************
39 .\"* ****** - M E N R O F F / T R O F F M A C R O S ****** *
41 .\"* Produced for your edification and enjoyment by: *
43 .\"* Electronics Research Laboratory *
45 .\"* current address: *
46 .\"* Britton-Lee, Inc. *
47 .\"* 1919 Addison Street Suite 105 *
48 .\"* Berkeley, California 94704 *
50 .\"* VERSION 8.1 First Release: 11 Sept 1978 *
51 .\"* See file \*(||/revisions for revision history *
53 .\"* Documentation is available. *
55 .\"**********************************************************************
57 .\" Code on .de commands:
58 .\" *** a user interface macro.
59 .\" &&& a user interface macro which is redefined
60 .\" when used to be the real thing.
61 .\" $$$ a macro which may be redefined by the user
62 .\" to provide variant functions.
63 .\" --- an internal macro.
65 .\" library directory for sourced files:
66 .ds || /usr/old/lib/me
69 .if !\n(.V .tm You are using the wrong version of NROFF/TROFF!!
70 .if !\n(.V .tm This macro package works only on the version seven
71 .if !\n(.V .tm release of NROFF and TROFF.
75 .\"
\f *** INTERNAL GP MACROS ***
76 .de @C \" --- change ev's, taking info with us
95 .de @D \" --- determine display type (Indent, Left, Center)
109 .de @z \" --- end macro
110 .if \n@>1 .tm >> @z, .z=\\n(.z ?a=\\n(?a
113 . tm Line \\n(c. -- Unclosed block, footnote, or other diversion (\\n(.z)
118 . bp \" force out final table
120 .rm @b\" \" don't start another page
126 .de @I \" --- initialize processor
133 .\"
\f *** STANDARD HEADERS AND FOOTERS ***
134 .de he \" *** define header
142 . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
143 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
146 .de eh \" *** define even header
150 . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
152 .de oh \" *** define odd header
156 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
158 .de fo \" *** define footer
166 . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
167 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
170 .de ef \" *** define even foot
174 . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
176 .de of \" *** define odd footer
180 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
182 .de ep \" *** end page (must always be followed by a .bp)
190 .\"
\f *** INTERNAL HEADER AND FOOTER MACROS ***
192 .if \n@>1 .tm >> @h %=\\n% ?a=\\n(?a ?b=\\n(?b ?w=\\n(?w
193 .if (\\n(.i+\\n(.o)>=\\n(.l \
194 . tm Line \\n(c. -- Offset + indent exceeds line length
195 .if t .if (\\n(.l+\\n(.o)>7.75i \
196 . tm Line \\n(c. -- Offset + line length exceeds paper width
197 .\" initialize a pile of junk
198 .nr ?h \\n(?H \" transfer "next page" to "this page"
202 .if !"\\*(|4"" .rn |4 |0
203 .if !"\\*(|5"" .rn |5 |1
204 .if !"\\*(|6"" .rn |6 |2
205 .if !"\\*(|7"" .rn |7 |3
206 .nr _w 0 \" reset max footnote width
207 .nr ?W 0 \" no wide floats this page (yet)
209 .\" begin actual header stuff
212 .if t .@m \" output cut mark
214 . sp |\\n(hmu \" move to header position
215 .@t $h \" output header title
218 .sp |\\n(tmu \" move to top of text
220 .mk _k \" for columned output
221 .if \\n(?n .nm 1 \" restore line numbering if n1 mode
222 .nr $c 1 \" set first column
223 .if \n@>4 .tm -- @h >> .ns nl=\\n(nl %=\\n% _k=\\n(_k tm=\\n(tm
231 . @n \" begin the column
236 . de @m \" --- output cut mark (only on C/A/T-style)
244 .de @n \" --- new column or page
245 .if \n@>3 .tm >> @n nl=\\n(nl %=\\n% ?f=\\n(?f ?o=\\n(?o
248 .if (\\n(_w<=\\n($l)&(\\n(?W=0) \
250 . nr _b (\\n(ppu*\\n($ru)/2u \" compute fudge factor (must be < 1P)
251 . if \\n(_bu>((\\n(bmu-\\n(fmu-(\\n(tpu*\\n($ru))/2u) \
252 . nr _b (\\n(ppu*\\n($ru)-\n(.Vu
258 .nr _b +(\\n(ppu*\\n($ru) \" add 1 paragraph v in case of sweep past
259 .if \n@>2 .tm @n .p=\\n(.p bm=\\n(bm _b=\\n(_b _B=\\n(_B
260 .nr ?f 0 \" reset footnote flag
263 . (f _ \" reprocess footnotes which run off page
275 . |h \" output the table header
278 . mk #T \" for tbl commands
281 .if (\\n(?a)&((\\n($c<2):(\\n(?w=0)) \
283 . nr ?a 0 \" output floating keep
286 . mk _k \" don't overstrike wide keeps
290 .$H \" special column header macro
294 .if \n@>1 .tm >> @f %=\\n% nl=\\n(nl ?a=\\n(?a ?b=\\n(?b ?f=\\n(?f
295 .if \n@>2 .nr VL \\n(.pu-\\n(nlu
296 .if \n@>2 .tm @f bm=\\n(bm _B=\\n(_B _b=\\n(_b .p-nl=\\n(VL
300 . nr T. 1 \" for tbl commands (to output bottom line)
301 . T# 1 \" output the sides and bottom lines
309 . @k |b\" \" output bottom of page tables
312 . @o \" output footnote if present
314 . @c \" handle new column
320 .de @o \" --- output footnote
324 .if \n@>2 .tm @o last printed text = \\n(nl placing @r trap at -\\n(_B
328 .if \n@>2 .tm @o triggered @r (?o) = \\n(?o
331 . di \" just in case triggered @r
343 .de @c \" --- new column
344 .if \n@>2 .tm >> @c %=\\n%
351 .de @e \" --- end page
355 .sp |\\n(.pu-\\n(fmu-(\\n(tpu*\\n($ru) \" move to footer position
356 .@t $f \" output footer title
360 .de @t \" --- output header or footer title
363 . sz \\n(tp \" set header/footer type fonts, etc.
365 . lt \\n(_Lu \" make title span entire page
371 .de $h \" $$$ print header
375 . if e .ds |z "\\*(|0
376 . if o .ds |z "\\*(|1
378 .if !\(ts\\*(|z\(ts\(ts \
382 .de $f \" $$$ print footer
386 . if e .ds |z "\\*(|0
387 . if o .ds |z "\\*(|1
389 .if \(ts\\*(|z\(ts\(ts \
391 . if e .ds |z "\\*(|2
392 . if o .ds |z "\\*(|3
394 .if !\(ts\\*(|z\(ts\(ts \
398 .de @r \" --- reprocess overflow footnotes
399 .if \n@>3 .tm >> @r .z=\\n(.z ?f=\\n(?f ?a=\\n(?a ?b=\\n(?b _b=\\n(_b
400 .di |o \" save overflow footnote
405 .\"
\f *** COMMANDS WITH VARIANT DEFINITIONS ***
406 .rn bp @b \" --- begin page
407 .de bp \" *** begin new page (overrides columns)
408 .nr $c \\n($m \" force new page, not new column
416 . @h \" 'spring' the header trap
419 .wh 0 @h \" reset header
421 .rn ll xl \" *** special line length (local)
422 .de ll \" *** line length (global to environments)
426 .if (\\n($m<=1):(\\n($l>\\n(_L) \
429 .rn po @O \" --- local page offset
430 .de po \" *** page offset
434 .\"
\f *** MISCELLANEOUS ROFF COMMANDS ***
435 .de hx \" *** suppress headers and footers next page
438 .de ix \" *** indent, no break
441 .de bl \" *** contiguous blank lines
447 .de n1 \" *** line numbering 1
452 .de n2 \" *** line numbering 2
459 .de pa \" *** new page
462 .de ro \" *** roman page numbers
465 .de ar \" *** arabic page numbers
468 .de m1 \" *** position one space
471 .nr tm +\\n(hmu-\\n(_0u
474 .de m2 \" *** position two space
475 .nr tm \\n(hmu+\\n(tpp+\\$1v
477 .de m3 \" *** position three space
478 .nr bm \\n(fmu+\\n(tpp+\\$1v
480 .de m4 \" *** position four space
483 .nr bm +\\n(fmu-\\n(_0u
485 .de sk \" *** leave a blank page (next page)
487 . tm Line \\n(c. -- I cannot skip multiple pages
490 .\"
\f *** MISCELLANEOUS USER SUPPORT COMMANDS ***
491 .de re \" *** reset tabs (TROFF defines 15 stops default)
492 .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
495 .de re \" *** reset tabs (NROFF version)
496 .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
498 .de ba \" *** set base indent
502 . nr $i \\n(siu*\\n($0u
504 .de hl \" *** draw horizontal line
509 .\"
\f *** PARAGRAPHING ***
510 .de pp \" *** paragraph
513 .de lp \" *** left aligned paragraph
519 .de ip \" *** indented paragraph w/ optional tag
520 .if (\\n(ii>0)&(\\n(ii<1n) \
529 . ie \\w"\\$1">=\\n(_0 \
534 . el \&\\$1\h'|\\n(_0u'\c
538 .de np \" *** numbered paragraph
540 . nr $p 0 \" reset number after .bu
541 .nr $p +1 \" increment paragraph number
544 \0(\\n($p)\h'|\w'\0(000)\0'u'\c
546 .de bu \" *** bulleted paragraph
549 . ns \" don't space between .bu paragraphs
550 .nr $p 0-1 \" mark "bulleted paragraph" mode
555 .de @p \" --- initialize for paragraph
556 .@I \" initialize macro processor
557 .if "\\n(.z"|e" .tm Line \\n(c. -- Unmatched continued equation
569 .\"
\f *** SECTION HEADINGS ***
570 .de sh \" &&& section heading
573 .sh "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
576 .de $p \" $$$ print section heading
577 .if (\\n(si>0)&(\\n(.$>2) \
582 . sp \\n(ssu \" one of them is non-null
583 . ne \\n(.Lv+\\n(.Vu+\\n(psu+(\\n(spu*\\n($ru*\\n(.Lu)
585 . ti -(\\n(siu-\\n(sou)
592 . if \w"\\$2">0 \\$2.
593 . if \w"\\$1">0 \\$1\f1\ \ \&
600 .de uh \" *** unnumbered section heading
606 .\"
\f *** COLUMNNED OUTPUT ***
607 .de 2c \" *** double columned output
610 . 1c \" revert to 1c if already 2c
616 . nr $s \\$1n \" param 1: column seperation
617 .nr $l (\\n(.l-((\\n($m-1)*\\n($s))/\\n($m
622 .de 1c \" *** single columned output
626 .ll \\n(_Lu \" return to normal output
630 .de bc \" *** begin column
633 .\"
\f *** FLOATING TABLES AND NONFLOATING BLOCKS ***
634 .de (z \" &&& begin floating keep
640 .de )z \" &&& end floating keep
641 .tm Line \\n(c. -- unmatched .)z
643 .de (t \" XXX temp ref to (z
646 .de )t \" XXX temp ref to )t
649 .de (b \" *** begin block
655 .de )b \" *** end block
658 .if (\\n(bt=0):(\\n(.t<\\n(bt) \
659 . ne \\n(dnu \" make it all on one page
669 .sp \\n(bsu+\\n(.Lv-1v
671 .de @( \" --- begin keep
672 .if !"\\n(.z"" .tm Line \\n(c. -- Illegal nested keep \\n(.z
677 .de @M \" --- set modes for display
684 . fi \" set fill mode if "F" parameter
695 .de @) \" --- end keep
697 .if !"\\n(.z"|k" .tm Line \\n(c. -- Close of a keep which has never been opened
703 .de (c \" *** begin block centered text
704 .if "\\n(.z"|c" .tm Line \\n(c. -- Nested .(c requests
707 .de )c \" *** end block centered text
708 .if !"\\n(.z"|c" .tm Line \\n(c. -- Unmatched .)c
709 .br \" force out final line
711 .if \n@>4 .tm >> .)c .l=\\n(.l .i=\\n(.i $i=\\n($i dl=\\n(dl
714 .in (\\n(.lu-\\n(.iu-\\n(dlu)/2u
715 .if \n@>4 .tm -- .)c << .in .l=\\n(.l .i=\\n(.i dl=\\n(dl
724 .\"
\f *** BLOCK QUOTES (OR WHATEVER) AND LISTS ***
725 .de (q \" *** begin block quote
734 .de )q \" *** end block quote
737 .sp \\n(qsu+\\n(.Lv-1v
740 .de (l \" *** begin list
746 .de )l \" *** end list
749 .sp \\n(bsu+\\n(.Lv-1v
752 .\"
\f *** PREPROCESSOR SUPPORT ***
756 .de EQ \" &&& begin equation
765 .de TS \" &&& begin table
774 .de ]- \" &&& initialize reference
780 .de ]< \" &&& initialize reference
787 .if t .ds [. \s-2\v'-.4m'\f1
789 .if t .ds .] \v'.4m'\s+2\fP
797 .de IS \" *** start ideal picture
805 .de IE \" *** end ideal picture
812 .de PS \" *** start picture: $1=height, $2=width in units or inches
816 .in (\\n(.lu-\\n(g7u)/2u
821 .de PE \" *** end picture
830 .de GS \" *** start gremlin picture
831 .nr g7 (\\n(.lu-\\n(g1u)/2u
832 .if "\\$1"L" .nr g7 \\n(.iu
833 .if "\\$1"R" .nr g7 \\n(.lu-\\n(g1u
840 .de GE \" *** end gremlin picture
844 .de GF \" *** finish gremlin picture; stay at top
849 .\"
\f *** FONT AIDS ***
850 .de sz \" *** set point size and vertical spacing
852 .vs \\n(.su*\\n($ru \" default vs at pointsize + 20%
855 .de r \" *** enter roman font
859 .if \\n(.$ \&\\$1\f\\n(_F\\$2
862 .de i \" *** enter italic
866 .if \\n(.$ \&\\$1\f\\n(_F\\$2
869 .de b \" *** enter boldface (underline in NROFF)
873 .if \\n(.$ \&\\$1\f\\n(_F\\$2
876 .de rb \" *** enter real boldface (not underlined in NROFF)
880 .if \\n(.$ \&\\$1\f\\n(_F\\$2
883 .de u \" *** enter underlined word
886 .de q \" *** enter quoted word
887 \&\\*(lq\\$1\\*(rq\\$2
889 .de bi \" *** enter word in bold italics
891 .ie t \&\k~\\$1\h'|\\n~u+(\\w' 'u/4u)'\\$1\fP\\$2
894 .de bx \" *** enter boxed word
895 .ie \\n($T \&\f2\\$1\fP\\$2
896 .el \k~\(br\|\\$1\|\(br\l'|\\n~u\(rn'\l'|\\n~u\(ul'\^\\$2
898 .de sm \" *** print in smaller font
901 .de @F \" --- change font (8 -> underlined, 0 -> no change)
912 .\"
\f *** FOOTNOTING ***
913 .de (f \" &&& begin footnote
915 .so \\*(||/footnote.me
919 .de )f \" &&& end footnote
920 .tm Line \\n(c. -- unmatched .)f
922 .de $s \" $$$ footnote separator
927 .\"
\f *** DELAYED TEXT ***
928 .de (d \" &&& begin delayed text
930 .so \\*(||/deltext.me
934 .de )d \" &&& end delayed text
935 .tm Line \\n(c. -- unmatched .)d
937 .\"
\f *** INDEXES (TABLE OF CONTENTS) ***
938 .de (x \" &&& begin index
944 .de )x \" &&& end index entry
945 .tm Line \\n(c. -- unmatched .)x
947 .\"
\f *** STUFF FOR "STANDARD" PAPERS ***
948 .de th \" *** set "thesis" mode
952 .de +c \" *** begin chapter
953 .ep \" force out footnotes
956 . bp \" force out a table or more footnote
966 .in \\n($iu \" reset the indent
973 .de ++ \" *** declare chapter type
978 . nr _0 11 \" renumbered chapter
980 . nr _0 2 \" appendix
982 . nr _0 12 \" renumbered appendix
984 . nr _0 3 \" preliminary material
986 . nr _0 4 \" bibliographic material
988 . nr _0 5 \" abstract
990 . tm Line \\n(c. -- Bad mode to .++
998 .if (\\n(_0=3):(\\n(_0=5) \
999 . pn 1 \" must do before .ep
1000 .ep \" end page for correct page number types
1019 .if !\\n(_0=\\n(_M .if \\n(_M=3 \
1024 .de $c \" $$$ print chapter title
1030 .ie \\n(_M=1 CHAPTER\ \ \\n(ch
1031 .el .if \\n(_M=2 APPENDIX\ \ \\n(ch
1032 .if \w"\\$1" .sp 3-\\n(.L
1034 .if (\\n(_M<3):(\w"\\$1") \
1040 . $C Chapter \\n(ch "\\$1"
1042 . $C Appendix \\n(ch "\\$1"
1044 .de tp \" *** title page
1051 .de ac \" *** setup for ACM photo-ready paper
1057 .de lo \" *** pull in the set of local macros
1058 .\" all these macros should be named "*X", where X is any letter
1062 .de lh \" *** letterhead
1063 .so \\*(||/letterhead.me
1066 .if \n(mo=1 .ds mo January
1067 .if \n(mo=2 .ds mo February
1068 .if \n(mo=3 .ds mo March
1069 .if \n(mo=4 .ds mo April
1070 .if \n(mo=5 .ds mo May
1071 .if \n(mo=6 .ds mo June
1072 .if \n(mo=7 .ds mo July
1073 .if \n(mo=8 .ds mo August
1074 .if \n(mo=9 .ds mo September
1075 .if \n(mo=10 .ds mo October
1076 .if \n(mo=11 .ds mo November
1077 .if \n(mo=12 .ds mo December
1078 .if \n(dw=1 .ds dw Sunday
1079 .if \n(dw=2 .ds dw Monday
1080 .if \n(dw=3 .ds dw Tuesday
1081 .if \n(dw=4 .ds dw Wednesday
1082 .if \n(dw=5 .ds dw Thursday
1083 .if \n(dw=6 .ds dw Friday
1084 .if \n(dw=7 .ds dw Saturday
1085 .ds td \*(mo \n(dy, 19\n(yr
1086 .\"
\f *** PARAMETRIC INITIALIZATIONS ***
1087 .if (1m<0.1i)&(\nx!=0) \
1088 . vs 9p \" for 12-pitch DTC terminals
1090 .nr $r \n(.v/\n(.s \" ratio of vs to ps for .sz request
1091 .nr $R \n($r \" ratio for displays & footnotes
1092 .nr hm 4v \" header margin
1093 .nr tm 7v \" top margin
1094 .nr bm 6v \" bottom margin
1095 .nr fm 3v \" footer margin
1096 .nr tf 3 \" title font: (real) Times Bold
1097 .nr tp 10 \" title point size
1099 .nr bi 4m \" indent for blocks
1100 .nr pi 5n \" indent for paragraphs
1101 .nr pf 1 \" normal text font
1102 .nr pp 10 \" normal text point size
1103 .nr qi 4n \" indent for quotes
1104 .nr qp -1 \" down one point
1105 .nr ii 5n \" indent for .ip's and .np's
1106 .nr $m 1 \" max number of columns
1107 .nr $s 4n \" column separation
1109 .\"
\f *** OTHER INITIALIZATION ***
1117 . ds [ \v'-0.4m'\x'-0.2m'\s-3
1119 . ds < \v'0.4m'\x'0.2m'\s-3
1137 . po -0.5i \" make ugly line on LHS on C/A/T typesetters
1148 .nr $b \nb \" figure the real font 8 font
1152 . if n .nr $b 2 \" italic
1153 . if t .nr $b 3 \" bold
1155 .nr ps 0.5v \" paragraph pre/post spacing
1159 .nr bs \n(ps \" block pre/post spacing
1160 .nr qs \n(ps \" quote pre/post spacing
1161 .nr zs 1v \" float-block pre/postspacing
1162 .nr xs 0.2v \" index prespacing
1163 .nr fs 0.2v \" footnote prespacing
1166 .if n .nr es 1v \" equation pre/postspacing
1168 .wh 0 @h \" set header
1169 .nr $l \n(.lu \" line length
1170 .nr _L \n(.lu \" line length of page
1171 .nr $c 1 \" current column number
1172 .nr $f 1 1 \" footnote number
1173 .ds * \*[1\*]\k*\" \" footnote "name"
1174 .nr $d 1 1 \" delayed text number
1175 .ds # [1]\k#\" \" delayed text "name"
1176 .nr _M 1 \" chapter mode is chapter
1177 .ds lq \&"\" \" left quote
1178 .ds rq \&"\" \" right quote
1184 .\" *** FOREIGN LETTERS AND SPECIAL CHARACTERS ***
1185 .de sc \" *** define special characters