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
35 .\" $FreeBSD: src/share/me/tmac.orig_me,v 1.2.6.1 2002/08/15 18:11:08 schweikh Exp $
36 .\" $DragonFly: src/share/me/tmac.orig_me,v 1.2 2003/06/17 04:37:01 dillon Exp $
40 .\"**********************************************************************
42 .\"* ****** - M E N R O F F / T R O F F M A C R O S ****** *
44 .\"* Produced for your edification and enjoyment by: *
46 .\"* Electronics Research Laboratory *
48 .\"* current address: *
49 .\"* Britton-Lee, Inc. *
50 .\"* 1919 Addison Street Suite 105 *
51 .\"* Berkeley, California 94704 *
53 .\"* VERSION 8.1 First Release: 11 Sept 1978 *
54 .\"* See file \*(||/revisions for revision history *
56 .\"* Documentation is available. *
58 .\"**********************************************************************
60 .\" Code on .de commands:
61 .\" *** a user interface macro.
62 .\" &&& a user interface macro which is redefined
63 .\" when used to be the real thing.
64 .\" $$$ a macro which may be redefined by the user
65 .\" to provide variant functions.
66 .\" --- an internal macro.
68 .\" library directory for sourced files:
69 .ds || /usr/old/lib/me
72 .if !\n(.V .tm You are using the wrong version of NROFF/TROFF!!
73 .if !\n(.V .tm This macro package works only on the version seven
74 .if !\n(.V .tm release of NROFF and TROFF.
78 .\"
\f *** INTERNAL GP MACROS ***
79 .de @C \" --- change ev's, taking info with us
98 .de @D \" --- determine display type (Indent, Left, Center)
112 .de @z \" --- end macro
113 .if \n@>1 .tm >> @z, .z=\\n(.z ?a=\\n(?a
116 . tm Line \\n(c. -- Unclosed block, footnote, or other diversion (\\n(.z)
121 . bp \" force out final table
123 .rm @b\" \" don't start another page
129 .de @I \" --- initialize processor
136 .\"
\f *** STANDARD HEADERS AND FOOTERS ***
137 .de he \" *** define header
145 . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
146 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
149 .de eh \" *** define even header
153 . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
155 .de oh \" *** define odd header
159 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
161 .de fo \" *** define footer
169 . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
170 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
173 .de ef \" *** define even foot
177 . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
179 .de of \" *** define odd footer
183 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
185 .de ep \" *** end page (must always be followed by a .bp)
193 .\"
\f *** INTERNAL HEADER AND FOOTER MACROS ***
195 .if \n@>1 .tm >> @h %=\\n% ?a=\\n(?a ?b=\\n(?b ?w=\\n(?w
196 .if (\\n(.i+\\n(.o)>=\\n(.l \
197 . tm Line \\n(c. -- Offset + indent exceeds line length
198 .if t .if (\\n(.l+\\n(.o)>7.75i \
199 . tm Line \\n(c. -- Offset + line length exceeds paper width
200 .\" initialize a pile of junk
201 .nr ?h \\n(?H \" transfer "next page" to "this page"
205 .if !"\\*(|4"" .rn |4 |0
206 .if !"\\*(|5"" .rn |5 |1
207 .if !"\\*(|6"" .rn |6 |2
208 .if !"\\*(|7"" .rn |7 |3
209 .nr _w 0 \" reset max footnote width
210 .nr ?W 0 \" no wide floats this page (yet)
212 .\" begin actual header stuff
215 .if t .@m \" output cut mark
217 . sp |\\n(hmu \" move to header position
218 .@t $h \" output header title
221 .sp |\\n(tmu \" move to top of text
223 .mk _k \" for columned output
224 .if \\n(?n .nm 1 \" restore line numbering if n1 mode
225 .nr $c 1 \" set first column
226 .if \n@>4 .tm -- @h >> .ns nl=\\n(nl %=\\n% _k=\\n(_k tm=\\n(tm
234 . @n \" begin the column
239 . de @m \" --- output cut mark (only on C/A/T-style)
247 .de @n \" --- new column or page
248 .if \n@>3 .tm >> @n nl=\\n(nl %=\\n% ?f=\\n(?f ?o=\\n(?o
251 .if (\\n(_w<=\\n($l)&(\\n(?W=0) \
253 . nr _b (\\n(ppu*\\n($ru)/2u \" compute fudge factor (must be < 1P)
254 . if \\n(_bu>((\\n(bmu-\\n(fmu-(\\n(tpu*\\n($ru))/2u) \
255 . nr _b (\\n(ppu*\\n($ru)-\n(.Vu
261 .nr _b +(\\n(ppu*\\n($ru) \" add 1 paragraph v in case of sweep past
262 .if \n@>2 .tm @n .p=\\n(.p bm=\\n(bm _b=\\n(_b _B=\\n(_B
263 .nr ?f 0 \" reset footnote flag
266 . (f _ \" reprocess footnotes which run off page
278 . |h \" output the table header
281 . mk #T \" for tbl commands
284 .if (\\n(?a)&((\\n($c<2):(\\n(?w=0)) \
286 . nr ?a 0 \" output floating keep
289 . mk _k \" don't overstrike wide keeps
293 .$H \" special column header macro
297 .if \n@>1 .tm >> @f %=\\n% nl=\\n(nl ?a=\\n(?a ?b=\\n(?b ?f=\\n(?f
298 .if \n@>2 .nr VL \\n(.pu-\\n(nlu
299 .if \n@>2 .tm @f bm=\\n(bm _B=\\n(_B _b=\\n(_b .p-nl=\\n(VL
303 . nr T. 1 \" for tbl commands (to output bottom line)
304 . T# 1 \" output the sides and bottom lines
312 . @k |b\" \" output bottom of page tables
315 . @o \" output footnote if present
317 . @c \" handle new column
323 .de @o \" --- output footnote
327 .if \n@>2 .tm @o last printed text = \\n(nl placing @r trap at -\\n(_B
331 .if \n@>2 .tm @o triggered @r (?o) = \\n(?o
334 . di \" just in case triggered @r
346 .de @c \" --- new column
347 .if \n@>2 .tm >> @c %=\\n%
354 .de @e \" --- end page
358 .sp |\\n(.pu-\\n(fmu-(\\n(tpu*\\n($ru) \" move to footer position
359 .@t $f \" output footer title
363 .de @t \" --- output header or footer title
366 . sz \\n(tp \" set header/footer type fonts, etc.
368 . lt \\n(_Lu \" make title span entire page
374 .de $h \" $$$ print header
378 . if e .ds |z "\\*(|0
379 . if o .ds |z "\\*(|1
381 .if !\(ts\\*(|z\(ts\(ts \
385 .de $f \" $$$ print footer
389 . if e .ds |z "\\*(|0
390 . if o .ds |z "\\*(|1
392 .if \(ts\\*(|z\(ts\(ts \
394 . if e .ds |z "\\*(|2
395 . if o .ds |z "\\*(|3
397 .if !\(ts\\*(|z\(ts\(ts \
401 .de @r \" --- reprocess overflow footnotes
402 .if \n@>3 .tm >> @r .z=\\n(.z ?f=\\n(?f ?a=\\n(?a ?b=\\n(?b _b=\\n(_b
403 .di |o \" save overflow footnote
408 .\"
\f *** COMMANDS WITH VARIANT DEFINITIONS ***
409 .rn bp @b \" --- begin page
410 .de bp \" *** begin new page (overrides columns)
411 .nr $c \\n($m \" force new page, not new column
419 . @h \" 'spring' the header trap
422 .wh 0 @h \" reset header
424 .rn ll xl \" *** special line length (local)
425 .de ll \" *** line length (global to environments)
429 .if (\\n($m<=1):(\\n($l>\\n(_L) \
432 .rn po @O \" --- local page offset
433 .de po \" *** page offset
437 .\"
\f *** MISCELLANEOUS ROFF COMMANDS ***
438 .de hx \" *** suppress headers and footers next page
441 .de ix \" *** indent, no break
444 .de bl \" *** contiguous blank lines
450 .de n1 \" *** line numbering 1
455 .de n2 \" *** line numbering 2
462 .de pa \" *** new page
465 .de ro \" *** roman page numbers
468 .de ar \" *** arabic page numbers
471 .de m1 \" *** position one space
474 .nr tm +\\n(hmu-\\n(_0u
477 .de m2 \" *** position two space
478 .nr tm \\n(hmu+\\n(tpp+\\$1v
480 .de m3 \" *** position three space
481 .nr bm \\n(fmu+\\n(tpp+\\$1v
483 .de m4 \" *** position four space
486 .nr bm +\\n(fmu-\\n(_0u
488 .de sk \" *** leave a blank page (next page)
490 . tm Line \\n(c. -- I cannot skip multiple pages
493 .\"
\f *** MISCELLANEOUS USER SUPPORT COMMANDS ***
494 .de re \" *** reset tabs (TROFF defines 15 stops default)
495 .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
498 .de re \" *** reset tabs (NROFF version)
499 .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
501 .de ba \" *** set base indent
505 . nr $i \\n(siu*\\n($0u
507 .de hl \" *** draw horizontal line
512 .\"
\f *** PARAGRAPHING ***
513 .de pp \" *** paragraph
516 .de lp \" *** left aligned paragraph
522 .de ip \" *** indented paragraph w/ optional tag
523 .if (\\n(ii>0)&(\\n(ii<1n) \
532 . ie \\w"\\$1">=\\n(_0 \
537 . el \&\\$1\h'|\\n(_0u'\c
541 .de np \" *** numbered paragraph
543 . nr $p 0 \" reset number after .bu
544 .nr $p +1 \" increment paragraph number
547 \0(\\n($p)\h'|\w'\0(000)\0'u'\c
549 .de bu \" *** bulleted paragraph
552 . ns \" don't space between .bu paragraphs
553 .nr $p 0-1 \" mark "bulleted paragraph" mode
558 .de @p \" --- initialize for paragraph
559 .@I \" initialize macro processor
560 .if "\\n(.z"|e" .tm Line \\n(c. -- Unmatched continued equation
572 .\"
\f *** SECTION HEADINGS ***
573 .de sh \" &&& section heading
576 .sh "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
579 .de $p \" $$$ print section heading
580 .if (\\n(si>0)&(\\n(.$>2) \
585 . sp \\n(ssu \" one of them is non-null
586 . ne \\n(.Lv+\\n(.Vu+\\n(psu+(\\n(spu*\\n($ru*\\n(.Lu)
588 . ti -(\\n(siu-\\n(sou)
595 . if \w"\\$2">0 \\$2.
596 . if \w"\\$1">0 \\$1\f1\ \ \&
603 .de uh \" *** unnumbered section heading
609 .\"
\f *** COLUMNED OUTPUT ***
610 .de 2c \" *** double columned output
613 . 1c \" revert to 1c if already 2c
619 . nr $s \\$1n \" param 1: column separation
620 .nr $l (\\n(.l-((\\n($m-1)*\\n($s))/\\n($m
625 .de 1c \" *** single columned output
629 .ll \\n(_Lu \" return to normal output
633 .de bc \" *** begin column
636 .\"
\f *** FLOATING TABLES AND NONFLOATING BLOCKS ***
637 .de (z \" &&& begin floating keep
643 .de )z \" &&& end floating keep
644 .tm Line \\n(c. -- unmatched .)z
646 .de (t \" XXX temp ref to (z
649 .de )t \" XXX temp ref to )t
652 .de (b \" *** begin block
658 .de )b \" *** end block
661 .if (\\n(bt=0):(\\n(.t<\\n(bt) \
662 . ne \\n(dnu \" make it all on one page
672 .sp \\n(bsu+\\n(.Lv-1v
674 .de @( \" --- begin keep
675 .if !"\\n(.z"" .tm Line \\n(c. -- Illegal nested keep \\n(.z
680 .de @M \" --- set modes for display
687 . fi \" set fill mode if "F" parameter
698 .de @) \" --- end keep
700 .if !"\\n(.z"|k" .tm Line \\n(c. -- Close of a keep which has never been opened
706 .de (c \" *** begin block centered text
707 .if "\\n(.z"|c" .tm Line \\n(c. -- Nested .(c requests
710 .de )c \" *** end block centered text
711 .if !"\\n(.z"|c" .tm Line \\n(c. -- Unmatched .)c
712 .br \" force out final line
714 .if \n@>4 .tm >> .)c .l=\\n(.l .i=\\n(.i $i=\\n($i dl=\\n(dl
717 .in (\\n(.lu-\\n(.iu-\\n(dlu)/2u
718 .if \n@>4 .tm -- .)c << .in .l=\\n(.l .i=\\n(.i dl=\\n(dl
727 .\"
\f *** BLOCK QUOTES (OR WHATEVER) AND LISTS ***
728 .de (q \" *** begin block quote
737 .de )q \" *** end block quote
740 .sp \\n(qsu+\\n(.Lv-1v
743 .de (l \" *** begin list
749 .de )l \" *** end list
752 .sp \\n(bsu+\\n(.Lv-1v
755 .\"
\f *** PREPROCESSOR SUPPORT ***
759 .de EQ \" &&& begin equation
768 .de TS \" &&& begin table
777 .de ]- \" &&& initialize reference
783 .de ]< \" &&& initialize reference
790 .if t .ds [. \s-2\v'-.4m'\f1
792 .if t .ds .] \v'.4m'\s+2\fP
800 .de IS \" *** start ideal picture
808 .de IE \" *** end ideal picture
815 .de PS \" *** start picture: $1=height, $2=width in units or inches
819 .in (\\n(.lu-\\n(g7u)/2u
824 .de PE \" *** end picture
833 .de GS \" *** start gremlin picture
834 .nr g7 (\\n(.lu-\\n(g1u)/2u
835 .if "\\$1"L" .nr g7 \\n(.iu
836 .if "\\$1"R" .nr g7 \\n(.lu-\\n(g1u
843 .de GE \" *** end gremlin picture
847 .de GF \" *** finish gremlin picture; stay at top
852 .\"
\f *** FONT AIDS ***
853 .de sz \" *** set point size and vertical spacing
855 .vs \\n(.su*\\n($ru \" default vs at pointsize + 20%
858 .de r \" *** enter roman font
862 .if \\n(.$ \&\\$1\f\\n(_F\\$2
865 .de i \" *** enter italic
869 .if \\n(.$ \&\\$1\f\\n(_F\\$2
872 .de b \" *** enter boldface (underline in NROFF)
876 .if \\n(.$ \&\\$1\f\\n(_F\\$2
879 .de rb \" *** enter real boldface (not underlined in NROFF)
883 .if \\n(.$ \&\\$1\f\\n(_F\\$2
886 .de u \" *** enter underlined word
889 .de q \" *** enter quoted word
890 \&\\*(lq\\$1\\*(rq\\$2
892 .de bi \" *** enter word in bold italics
894 .ie t \&\k~\\$1\h'|\\n~u+(\\w' 'u/4u)'\\$1\fP\\$2
897 .de bx \" *** enter boxed word
898 .ie \\n($T \&\f2\\$1\fP\\$2
899 .el \k~\(br\|\\$1\|\(br\l'|\\n~u\(rn'\l'|\\n~u\(ul'\^\\$2
901 .de sm \" *** print in smaller font
904 .de @F \" --- change font (8 -> underlined, 0 -> no change)
915 .\"
\f *** FOOTNOTING ***
916 .de (f \" &&& begin footnote
918 .so \\*(||/footnote.me
922 .de )f \" &&& end footnote
923 .tm Line \\n(c. -- unmatched .)f
925 .de $s \" $$$ footnote separator
930 .\"
\f *** DELAYED TEXT ***
931 .de (d \" &&& begin delayed text
933 .so \\*(||/deltext.me
937 .de )d \" &&& end delayed text
938 .tm Line \\n(c. -- unmatched .)d
940 .\"
\f *** INDEXES (TABLE OF CONTENTS) ***
941 .de (x \" &&& begin index
947 .de )x \" &&& end index entry
948 .tm Line \\n(c. -- unmatched .)x
950 .\"
\f *** STUFF FOR "STANDARD" PAPERS ***
951 .de th \" *** set "thesis" mode
955 .de +c \" *** begin chapter
956 .ep \" force out footnotes
959 . bp \" force out a table or more footnote
969 .in \\n($iu \" reset the indent
976 .de ++ \" *** declare chapter type
981 . nr _0 11 \" renumbered chapter
983 . nr _0 2 \" appendix
985 . nr _0 12 \" renumbered appendix
987 . nr _0 3 \" preliminary material
989 . nr _0 4 \" bibliographic material
991 . nr _0 5 \" abstract
993 . tm Line \\n(c. -- Bad mode to .++
1001 .if (\\n(_0=3):(\\n(_0=5) \
1002 . pn 1 \" must do before .ep
1003 .ep \" end page for correct page number types
1022 .if !\\n(_0=\\n(_M .if \\n(_M=3 \
1027 .de $c \" $$$ print chapter title
1033 .ie \\n(_M=1 CHAPTER\ \ \\n(ch
1034 .el .if \\n(_M=2 APPENDIX\ \ \\n(ch
1035 .if \w"\\$1" .sp 3-\\n(.L
1037 .if (\\n(_M<3):(\w"\\$1") \
1043 . $C Chapter \\n(ch "\\$1"
1045 . $C Appendix \\n(ch "\\$1"
1047 .de tp \" *** title page
1054 .de ac \" *** setup for ACM photo-ready paper
1060 .de lo \" *** pull in the set of local macros
1061 .\" all these macros should be named "*X", where X is any letter
1065 .de lh \" *** letterhead
1066 .so \\*(||/letterhead.me
1069 .if \n(mo=1 .ds mo January
1070 .if \n(mo=2 .ds mo February
1071 .if \n(mo=3 .ds mo March
1072 .if \n(mo=4 .ds mo April
1073 .if \n(mo=5 .ds mo May
1074 .if \n(mo=6 .ds mo June
1075 .if \n(mo=7 .ds mo July
1076 .if \n(mo=8 .ds mo August
1077 .if \n(mo=9 .ds mo September
1078 .if \n(mo=10 .ds mo October
1079 .if \n(mo=11 .ds mo November
1080 .if \n(mo=12 .ds mo December
1081 .if \n(dw=1 .ds dw Sunday
1082 .if \n(dw=2 .ds dw Monday
1083 .if \n(dw=3 .ds dw Tuesday
1084 .if \n(dw=4 .ds dw Wednesday
1085 .if \n(dw=5 .ds dw Thursday
1086 .if \n(dw=6 .ds dw Friday
1087 .if \n(dw=7 .ds dw Saturday
1088 .ds td \*(mo \n(dy, \n(yr+1900
1089 .\"
\f *** PARAMETRIC INITIALIZATIONS ***
1090 .if (1m<0.1i)&(\nx!=0) \
1091 . vs 9p \" for 12-pitch DTC terminals
1093 .nr $r \n(.v/\n(.s \" ratio of vs to ps for .sz request
1094 .nr $R \n($r \" ratio for displays & footnotes
1095 .nr hm 4v \" header margin
1096 .nr tm 7v \" top margin
1097 .nr bm 6v \" bottom margin
1098 .nr fm 3v \" footer margin
1099 .nr tf 3 \" title font: (real) Times Bold
1100 .nr tp 10 \" title point size
1102 .nr bi 4m \" indent for blocks
1103 .nr pi 5n \" indent for paragraphs
1104 .nr pf 1 \" normal text font
1105 .nr pp 10 \" normal text point size
1106 .nr qi 4n \" indent for quotes
1107 .nr qp -1 \" down one point
1108 .nr ii 5n \" indent for .ip's and .np's
1109 .nr $m 1 \" max number of columns
1110 .nr $s 4n \" column separation
1112 .\"
\f *** OTHER INITIALIZATION ***
1120 . ds [ \v'-0.4m'\x'-0.2m'\s-3
1122 . ds < \v'0.4m'\x'0.2m'\s-3
1140 . po -0.5i \" make ugly line on LHS on C/A/T typesetters
1151 .nr $b \nb \" figure the real font 8 font
1155 . if n .nr $b 2 \" italic
1156 . if t .nr $b 3 \" bold
1158 .nr ps 0.5v \" paragraph pre/post spacing
1162 .nr bs \n(ps \" block pre/post spacing
1163 .nr qs \n(ps \" quote pre/post spacing
1164 .nr zs 1v \" float-block pre/postspacing
1165 .nr xs 0.2v \" index prespacing
1166 .nr fs 0.2v \" footnote prespacing
1169 .if n .nr es 1v \" equation pre/postspacing
1171 .wh 0 @h \" set header
1172 .nr $l \n(.lu \" line length
1173 .nr _L \n(.lu \" line length of page
1174 .nr $c 1 \" current column number
1175 .nr $f 1 1 \" footnote number
1176 .ds * \*[1\*]\k*\" \" footnote "name"
1177 .nr $d 1 1 \" delayed text number
1178 .ds # [1]\k#\" \" delayed text "name"
1179 .nr _M 1 \" chapter mode is chapter
1180 .ds lq \&"\" \" left quote
1181 .ds rq \&"\" \" right quote
1187 .\" *** FOREIGN LETTERS AND SPECIAL CHARACTERS ***
1188 .de sc \" *** define special characters