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. Neither the name of the University nor the names of its contributors
14 .\" may be used to endorse or promote products derived from this software
15 .\" without specific prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" @(#)tmac.e 8.1 (Berkeley) 6/5/93
31 .\" $FreeBSD: src/share/me/tmac.orig_me,v 1.2.6.1 2002/08/15 18:11:08 schweikh Exp $
32 .\" $DragonFly: src/share/me/tmac.orig_me,v 1.2 2003/06/17 04:37:01 dillon Exp $
36 .\"**********************************************************************
38 .\"* ****** - M E N R O F F / T R O F F M A C R O S ****** *
40 .\"* Produced for your edification and enjoyment by: *
42 .\"* Electronics Research Laboratory *
44 .\"* current address: *
45 .\"* Britton-Lee, Inc. *
46 .\"* 1919 Addison Street Suite 105 *
47 .\"* Berkeley, California 94704 *
49 .\"* VERSION 8.1 First Release: 11 Sept 1978 *
50 .\"* See file \*(||/revisions for revision history *
52 .\"* Documentation is available. *
54 .\"**********************************************************************
56 .\" Code on .de commands:
57 .\" *** a user interface macro.
58 .\" &&& a user interface macro which is redefined
59 .\" when used to be the real thing.
60 .\" $$$ a macro which may be redefined by the user
61 .\" to provide variant functions.
62 .\" --- an internal macro.
64 .\" library directory for sourced files:
65 .ds || /usr/old/lib/me
68 .if !\n(.V .tm You are using the wrong version of NROFF/TROFF!!
69 .if !\n(.V .tm This macro package works only on the version seven
70 .if !\n(.V .tm release of NROFF and TROFF.
74 .\"
\f *** INTERNAL GP MACROS ***
75 .de @C \" --- change ev's, taking info with us
94 .de @D \" --- determine display type (Indent, Left, Center)
108 .de @z \" --- end macro
109 .if \n@>1 .tm >> @z, .z=\\n(.z ?a=\\n(?a
112 . tm Line \\n(c. -- Unclosed block, footnote, or other diversion (\\n(.z)
117 . bp \" force out final table
119 .rm @b\" \" don't start another page
125 .de @I \" --- initialize processor
132 .\"
\f *** STANDARD HEADERS AND FOOTERS ***
133 .de he \" *** define header
141 . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
142 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
145 .de eh \" *** define even header
149 . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
151 .de oh \" *** define odd header
155 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
157 .de fo \" *** define footer
165 . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
166 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
169 .de ef \" *** define even foot
173 . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
175 .de of \" *** define odd footer
179 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
181 .de ep \" *** end page (must always be followed by a .bp)
189 .\"
\f *** INTERNAL HEADER AND FOOTER MACROS ***
191 .if \n@>1 .tm >> @h %=\\n% ?a=\\n(?a ?b=\\n(?b ?w=\\n(?w
192 .if (\\n(.i+\\n(.o)>=\\n(.l \
193 . tm Line \\n(c. -- Offset + indent exceeds line length
194 .if t .if (\\n(.l+\\n(.o)>7.75i \
195 . tm Line \\n(c. -- Offset + line length exceeds paper width
196 .\" initialize a pile of junk
197 .nr ?h \\n(?H \" transfer "next page" to "this page"
201 .if !"\\*(|4"" .rn |4 |0
202 .if !"\\*(|5"" .rn |5 |1
203 .if !"\\*(|6"" .rn |6 |2
204 .if !"\\*(|7"" .rn |7 |3
205 .nr _w 0 \" reset max footnote width
206 .nr ?W 0 \" no wide floats this page (yet)
208 .\" begin actual header stuff
211 .if t .@m \" output cut mark
213 . sp |\\n(hmu \" move to header position
214 .@t $h \" output header title
217 .sp |\\n(tmu \" move to top of text
219 .mk _k \" for columned output
220 .if \\n(?n .nm 1 \" restore line numbering if n1 mode
221 .nr $c 1 \" set first column
222 .if \n@>4 .tm -- @h >> .ns nl=\\n(nl %=\\n% _k=\\n(_k tm=\\n(tm
230 . @n \" begin the column
235 . de @m \" --- output cut mark (only on C/A/T-style)
243 .de @n \" --- new column or page
244 .if \n@>3 .tm >> @n nl=\\n(nl %=\\n% ?f=\\n(?f ?o=\\n(?o
247 .if (\\n(_w<=\\n($l)&(\\n(?W=0) \
249 . nr _b (\\n(ppu*\\n($ru)/2u \" compute fudge factor (must be < 1P)
250 . if \\n(_bu>((\\n(bmu-\\n(fmu-(\\n(tpu*\\n($ru))/2u) \
251 . nr _b (\\n(ppu*\\n($ru)-\n(.Vu
257 .nr _b +(\\n(ppu*\\n($ru) \" add 1 paragraph v in case of sweep past
258 .if \n@>2 .tm @n .p=\\n(.p bm=\\n(bm _b=\\n(_b _B=\\n(_B
259 .nr ?f 0 \" reset footnote flag
262 . (f _ \" reprocess footnotes which run off page
274 . |h \" output the table header
277 . mk #T \" for tbl commands
280 .if (\\n(?a)&((\\n($c<2):(\\n(?w=0)) \
282 . nr ?a 0 \" output floating keep
285 . mk _k \" don't overstrike wide keeps
289 .$H \" special column header macro
293 .if \n@>1 .tm >> @f %=\\n% nl=\\n(nl ?a=\\n(?a ?b=\\n(?b ?f=\\n(?f
294 .if \n@>2 .nr VL \\n(.pu-\\n(nlu
295 .if \n@>2 .tm @f bm=\\n(bm _B=\\n(_B _b=\\n(_b .p-nl=\\n(VL
299 . nr T. 1 \" for tbl commands (to output bottom line)
300 . T# 1 \" output the sides and bottom lines
308 . @k |b\" \" output bottom of page tables
311 . @o \" output footnote if present
313 . @c \" handle new column
319 .de @o \" --- output footnote
323 .if \n@>2 .tm @o last printed text = \\n(nl placing @r trap at -\\n(_B
327 .if \n@>2 .tm @o triggered @r (?o) = \\n(?o
330 . di \" just in case triggered @r
342 .de @c \" --- new column
343 .if \n@>2 .tm >> @c %=\\n%
350 .de @e \" --- end page
354 .sp |\\n(.pu-\\n(fmu-(\\n(tpu*\\n($ru) \" move to footer position
355 .@t $f \" output footer title
359 .de @t \" --- output header or footer title
362 . sz \\n(tp \" set header/footer type fonts, etc.
364 . lt \\n(_Lu \" make title span entire page
370 .de $h \" $$$ print header
374 . if e .ds |z "\\*(|0
375 . if o .ds |z "\\*(|1
377 .if !\(ts\\*(|z\(ts\(ts \
381 .de $f \" $$$ print footer
385 . if e .ds |z "\\*(|0
386 . if o .ds |z "\\*(|1
388 .if \(ts\\*(|z\(ts\(ts \
390 . if e .ds |z "\\*(|2
391 . if o .ds |z "\\*(|3
393 .if !\(ts\\*(|z\(ts\(ts \
397 .de @r \" --- reprocess overflow footnotes
398 .if \n@>3 .tm >> @r .z=\\n(.z ?f=\\n(?f ?a=\\n(?a ?b=\\n(?b _b=\\n(_b
399 .di |o \" save overflow footnote
404 .\"
\f *** COMMANDS WITH VARIANT DEFINITIONS ***
405 .rn bp @b \" --- begin page
406 .de bp \" *** begin new page (overrides columns)
407 .nr $c \\n($m \" force new page, not new column
415 . @h \" 'spring' the header trap
418 .wh 0 @h \" reset header
420 .rn ll xl \" *** special line length (local)
421 .de ll \" *** line length (global to environments)
425 .if (\\n($m<=1):(\\n($l>\\n(_L) \
428 .rn po @O \" --- local page offset
429 .de po \" *** page offset
433 .\"
\f *** MISCELLANEOUS ROFF COMMANDS ***
434 .de hx \" *** suppress headers and footers next page
437 .de ix \" *** indent, no break
440 .de bl \" *** contiguous blank lines
446 .de n1 \" *** line numbering 1
451 .de n2 \" *** line numbering 2
458 .de pa \" *** new page
461 .de ro \" *** roman page numbers
464 .de ar \" *** arabic page numbers
467 .de m1 \" *** position one space
470 .nr tm +\\n(hmu-\\n(_0u
473 .de m2 \" *** position two space
474 .nr tm \\n(hmu+\\n(tpp+\\$1v
476 .de m3 \" *** position three space
477 .nr bm \\n(fmu+\\n(tpp+\\$1v
479 .de m4 \" *** position four space
482 .nr bm +\\n(fmu-\\n(_0u
484 .de sk \" *** leave a blank page (next page)
486 . tm Line \\n(c. -- I cannot skip multiple pages
489 .\"
\f *** MISCELLANEOUS USER SUPPORT COMMANDS ***
490 .de re \" *** reset tabs (TROFF defines 15 stops default)
491 .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
494 .de re \" *** reset tabs (NROFF version)
495 .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
497 .de ba \" *** set base indent
501 . nr $i \\n(siu*\\n($0u
503 .de hl \" *** draw horizontal line
508 .\"
\f *** PARAGRAPHING ***
509 .de pp \" *** paragraph
512 .de lp \" *** left aligned paragraph
518 .de ip \" *** indented paragraph w/ optional tag
519 .if (\\n(ii>0)&(\\n(ii<1n) \
528 . ie \\w"\\$1">=\\n(_0 \
533 . el \&\\$1\h'|\\n(_0u'\c
537 .de np \" *** numbered paragraph
539 . nr $p 0 \" reset number after .bu
540 .nr $p +1 \" increment paragraph number
543 \0(\\n($p)\h'|\w'\0(000)\0'u'\c
545 .de bu \" *** bulleted paragraph
548 . ns \" don't space between .bu paragraphs
549 .nr $p 0-1 \" mark "bulleted paragraph" mode
554 .de @p \" --- initialize for paragraph
555 .@I \" initialize macro processor
556 .if "\\n(.z"|e" .tm Line \\n(c. -- Unmatched continued equation
568 .\"
\f *** SECTION HEADINGS ***
569 .de sh \" &&& section heading
572 .sh "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
575 .de $p \" $$$ print section heading
576 .if (\\n(si>0)&(\\n(.$>2) \
581 . sp \\n(ssu \" one of them is non-null
582 . ne \\n(.Lv+\\n(.Vu+\\n(psu+(\\n(spu*\\n($ru*\\n(.Lu)
584 . ti -(\\n(siu-\\n(sou)
591 . if \w"\\$2">0 \\$2.
592 . if \w"\\$1">0 \\$1\f1\ \ \&
599 .de uh \" *** unnumbered section heading
605 .\"
\f *** COLUMNED OUTPUT ***
606 .de 2c \" *** double columned output
609 . 1c \" revert to 1c if already 2c
615 . nr $s \\$1n \" param 1: column separation
616 .nr $l (\\n(.l-((\\n($m-1)*\\n($s))/\\n($m
621 .de 1c \" *** single columned output
625 .ll \\n(_Lu \" return to normal output
629 .de bc \" *** begin column
632 .\"
\f *** FLOATING TABLES AND NONFLOATING BLOCKS ***
633 .de (z \" &&& begin floating keep
639 .de )z \" &&& end floating keep
640 .tm Line \\n(c. -- unmatched .)z
642 .de (t \" XXX temp ref to (z
645 .de )t \" XXX temp ref to )t
648 .de (b \" *** begin block
654 .de )b \" *** end block
657 .if (\\n(bt=0):(\\n(.t<\\n(bt) \
658 . ne \\n(dnu \" make it all on one page
668 .sp \\n(bsu+\\n(.Lv-1v
670 .de @( \" --- begin keep
671 .if !"\\n(.z"" .tm Line \\n(c. -- Illegal nested keep \\n(.z
676 .de @M \" --- set modes for display
683 . fi \" set fill mode if "F" parameter
694 .de @) \" --- end keep
696 .if !"\\n(.z"|k" .tm Line \\n(c. -- Close of a keep which has never been opened
702 .de (c \" *** begin block centered text
703 .if "\\n(.z"|c" .tm Line \\n(c. -- Nested .(c requests
706 .de )c \" *** end block centered text
707 .if !"\\n(.z"|c" .tm Line \\n(c. -- Unmatched .)c
708 .br \" force out final line
710 .if \n@>4 .tm >> .)c .l=\\n(.l .i=\\n(.i $i=\\n($i dl=\\n(dl
713 .in (\\n(.lu-\\n(.iu-\\n(dlu)/2u
714 .if \n@>4 .tm -- .)c << .in .l=\\n(.l .i=\\n(.i dl=\\n(dl
723 .\"
\f *** BLOCK QUOTES (OR WHATEVER) AND LISTS ***
724 .de (q \" *** begin block quote
733 .de )q \" *** end block quote
736 .sp \\n(qsu+\\n(.Lv-1v
739 .de (l \" *** begin list
745 .de )l \" *** end list
748 .sp \\n(bsu+\\n(.Lv-1v
751 .\"
\f *** PREPROCESSOR SUPPORT ***
755 .de EQ \" &&& begin equation
764 .de TS \" &&& begin table
773 .de ]- \" &&& initialize reference
779 .de ]< \" &&& initialize reference
786 .if t .ds [. \s-2\v'-.4m'\f1
788 .if t .ds .] \v'.4m'\s+2\fP
796 .de IS \" *** start ideal picture
804 .de IE \" *** end ideal picture
811 .de PS \" *** start picture: $1=height, $2=width in units or inches
815 .in (\\n(.lu-\\n(g7u)/2u
820 .de PE \" *** end picture
829 .de GS \" *** start gremlin picture
830 .nr g7 (\\n(.lu-\\n(g1u)/2u
831 .if "\\$1"L" .nr g7 \\n(.iu
832 .if "\\$1"R" .nr g7 \\n(.lu-\\n(g1u
839 .de GE \" *** end gremlin picture
843 .de GF \" *** finish gremlin picture; stay at top
848 .\"
\f *** FONT AIDS ***
849 .de sz \" *** set point size and vertical spacing
851 .vs \\n(.su*\\n($ru \" default vs at pointsize + 20%
854 .de r \" *** enter roman font
858 .if \\n(.$ \&\\$1\f\\n(_F\\$2
861 .de i \" *** enter italic
865 .if \\n(.$ \&\\$1\f\\n(_F\\$2
868 .de b \" *** enter boldface (underline in NROFF)
872 .if \\n(.$ \&\\$1\f\\n(_F\\$2
875 .de rb \" *** enter real boldface (not underlined in NROFF)
879 .if \\n(.$ \&\\$1\f\\n(_F\\$2
882 .de u \" *** enter underlined word
885 .de q \" *** enter quoted word
886 \&\\*(lq\\$1\\*(rq\\$2
888 .de bi \" *** enter word in bold italics
890 .ie t \&\k~\\$1\h'|\\n~u+(\\w' 'u/4u)'\\$1\fP\\$2
893 .de bx \" *** enter boxed word
894 .ie \\n($T \&\f2\\$1\fP\\$2
895 .el \k~\(br\|\\$1\|\(br\l'|\\n~u\(rn'\l'|\\n~u\(ul'\^\\$2
897 .de sm \" *** print in smaller font
900 .de @F \" --- change font (8 -> underlined, 0 -> no change)
911 .\"
\f *** FOOTNOTING ***
912 .de (f \" &&& begin footnote
914 .so \\*(||/footnote.me
918 .de )f \" &&& end footnote
919 .tm Line \\n(c. -- unmatched .)f
921 .de $s \" $$$ footnote separator
926 .\"
\f *** DELAYED TEXT ***
927 .de (d \" &&& begin delayed text
929 .so \\*(||/deltext.me
933 .de )d \" &&& end delayed text
934 .tm Line \\n(c. -- unmatched .)d
936 .\"
\f *** INDEXES (TABLE OF CONTENTS) ***
937 .de (x \" &&& begin index
943 .de )x \" &&& end index entry
944 .tm Line \\n(c. -- unmatched .)x
946 .\"
\f *** STUFF FOR "STANDARD" PAPERS ***
947 .de th \" *** set "thesis" mode
951 .de +c \" *** begin chapter
952 .ep \" force out footnotes
955 . bp \" force out a table or more footnote
965 .in \\n($iu \" reset the indent
972 .de ++ \" *** declare chapter type
977 . nr _0 11 \" renumbered chapter
979 . nr _0 2 \" appendix
981 . nr _0 12 \" renumbered appendix
983 . nr _0 3 \" preliminary material
985 . nr _0 4 \" bibliographic material
987 . nr _0 5 \" abstract
989 . tm Line \\n(c. -- Bad mode to .++
997 .if (\\n(_0=3):(\\n(_0=5) \
998 . pn 1 \" must do before .ep
999 .ep \" end page for correct page number types
1018 .if !\\n(_0=\\n(_M .if \\n(_M=3 \
1023 .de $c \" $$$ print chapter title
1029 .ie \\n(_M=1 CHAPTER\ \ \\n(ch
1030 .el .if \\n(_M=2 APPENDIX\ \ \\n(ch
1031 .if \w"\\$1" .sp 3-\\n(.L
1033 .if (\\n(_M<3):(\w"\\$1") \
1039 . $C Chapter \\n(ch "\\$1"
1041 . $C Appendix \\n(ch "\\$1"
1043 .de tp \" *** title page
1050 .de ac \" *** setup for ACM photo-ready paper
1056 .de lo \" *** pull in the set of local macros
1057 .\" all these macros should be named "*X", where X is any letter
1061 .de lh \" *** letterhead
1062 .so \\*(||/letterhead.me
1065 .if \n(mo=1 .ds mo January
1066 .if \n(mo=2 .ds mo February
1067 .if \n(mo=3 .ds mo March
1068 .if \n(mo=4 .ds mo April
1069 .if \n(mo=5 .ds mo May
1070 .if \n(mo=6 .ds mo June
1071 .if \n(mo=7 .ds mo July
1072 .if \n(mo=8 .ds mo August
1073 .if \n(mo=9 .ds mo September
1074 .if \n(mo=10 .ds mo October
1075 .if \n(mo=11 .ds mo November
1076 .if \n(mo=12 .ds mo December
1077 .if \n(dw=1 .ds dw Sunday
1078 .if \n(dw=2 .ds dw Monday
1079 .if \n(dw=3 .ds dw Tuesday
1080 .if \n(dw=4 .ds dw Wednesday
1081 .if \n(dw=5 .ds dw Thursday
1082 .if \n(dw=6 .ds dw Friday
1083 .if \n(dw=7 .ds dw Saturday
1084 .ds td \*(mo \n(dy, \n(yr+1900
1085 .\"
\f *** PARAMETRIC INITIALIZATIONS ***
1086 .if (1m<0.1i)&(\nx!=0) \
1087 . vs 9p \" for 12-pitch DTC terminals
1089 .nr $r \n(.v/\n(.s \" ratio of vs to ps for .sz request
1090 .nr $R \n($r \" ratio for displays & footnotes
1091 .nr hm 4v \" header margin
1092 .nr tm 7v \" top margin
1093 .nr bm 6v \" bottom margin
1094 .nr fm 3v \" footer margin
1095 .nr tf 3 \" title font: (real) Times Bold
1096 .nr tp 10 \" title point size
1098 .nr bi 4m \" indent for blocks
1099 .nr pi 5n \" indent for paragraphs
1100 .nr pf 1 \" normal text font
1101 .nr pp 10 \" normal text point size
1102 .nr qi 4n \" indent for quotes
1103 .nr qp -1 \" down one point
1104 .nr ii 5n \" indent for .ip's and .np's
1105 .nr $m 1 \" max number of columns
1106 .nr $s 4n \" column separation
1108 .\"
\f *** OTHER INITIALIZATION ***
1116 . ds [ \v'-0.4m'\x'-0.2m'\s-3
1118 . ds < \v'0.4m'\x'0.2m'\s-3
1136 . po -0.5i \" make ugly line on LHS on C/A/T typesetters
1147 .nr $b \nb \" figure the real font 8 font
1151 . if n .nr $b 2 \" italic
1152 . if t .nr $b 3 \" bold
1154 .nr ps 0.5v \" paragraph pre/post spacing
1158 .nr bs \n(ps \" block pre/post spacing
1159 .nr qs \n(ps \" quote pre/post spacing
1160 .nr zs 1v \" float-block pre/postspacing
1161 .nr xs 0.2v \" index prespacing
1162 .nr fs 0.2v \" footnote prespacing
1165 .if n .nr es 1v \" equation pre/postspacing
1167 .wh 0 @h \" set header
1168 .nr $l \n(.lu \" line length
1169 .nr _L \n(.lu \" line length of page
1170 .nr $c 1 \" current column number
1171 .nr $f 1 1 \" footnote number
1172 .ds * \*[1\*]\k*\" \" footnote "name"
1173 .nr $d 1 1 \" delayed text number
1174 .ds # [1]\k#\" \" delayed text "name"
1175 .nr _M 1 \" chapter mode is chapter
1176 .ds lq \&"\" \" left quote
1177 .ds rq \&"\" \" right quote
1183 .\" *** FOREIGN LETTERS AND SPECIAL CHARACTERS ***
1184 .de sc \" *** define special characters