xref: /original-bsd/share/me/tmac.orig_me (revision d4efd688)
.nr _0 \n(.c Copyright (c) 1988 The Regents of the University of California.
All rights reserved.

%sccs.include.redist.roff%

@(#)tmac.orig_me 2.37 (Berkeley) 10/26/91

%beginstrip%

**********************************************************************
* *
* ****** - M E N R O F F / T R O F F M A C R O S ****** *
* *
* Produced for your edification and enjoyment by: *
* Eric Allman *
* Electronics Research Laboratory *
* U.C. Berkeley. *
* current address: *
* Britton-Lee, Inc. *
* 1919 Addison Street Suite 105 *
* Berkeley, California 94704 *
* *
* VERSION 2.37 First Release: 11 Sept 1978 *
* See file \*(||/revisions for revision history *
* *
* Documentation is available. *
* *
**********************************************************************

Code on .de commands:
*** a user interface macro.
&&& a user interface macro which is redefined
when used to be the real thing.
$$$ a macro which may be redefined by the user
to provide variant functions.
--- an internal macro.

library directory for sourced files:

. nx \*(||/null.me *** INTERNAL GP MACROS ***
.nr _S \\n(.s .nr _V \\n(.v .nr _F \\n(.f .nr _I \\n(.i .ev \\$1 .vs \\n(_Vu 'in \\n(_Iu .xl \\n($lu .lt \\n($lu .rr _S .rr _V .rr _F .rr _I .ls 1 'ce 0 .. .nr _d \\$1 . nr _d 1 . nr _d 2 . nr _d 3 . nr _d 4 . ds |p "\\$2 .. \{\ . tm Line \\n(c. -- Unclosed block, footnote, or other diversion (\\n(.z) . di . ex .\} . bp \" force out final table . wh -1p @m

.. .. *** STANDARD HEADERS AND FOOTERS ***
\{\ . rm |4 . rm |5 .\} \{\ . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .\} .. . rm |4 . ds |4 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. . rm |5 . ds |5 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. \{\ . rm |6 . rm |7 .\} \{\ . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .\} .. . rm |6 . ds |6 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. . rm |7 . ds |7 "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 .. \{\ . wh 0 . rs . @b .\} .. *** INTERNAL HEADER AND FOOTER MACROS ***
. tm Line \\n(c. -- Offset + indent exceeds line length . tm Line \\n(c. -- Offset + line length exceeds paper width initialize a pile of junk
.nr ?h \\n(?H \" transfer "next page" to "this page" .rr ?H .nr ?c \\n(?C .rr ?C .nr _w 0 \" reset max footnote width .nr ?W 0 \" no wide floats this page (yet) .nr ?I 1 begin actual header stuff
.ev 2 .rs . sp |\\n(hmu \" move to header position .@t $h \" output header title . nr tm \n(.Vu .ev

_k \" for columned output .nr $c 1 \" set first column \{\ . rr ?s . rs ' @b .\} . @n \" begin the column .. \{\ . de @m \" --- output cut mark (only on C/A/T-style) . @O 0 . lt 7.5i . tl '\(rn''\(rn' . @O . lt .. .\} . nr bm \\n(.Vu \{\ . nr _b (\\n(ppu*\\n($ru)/2u \" compute fudge factor (must be < 1P) . if \\n(_bu>((\\n(bmu-\\n(fmu-(\\n(tpu*\\n($ru))/2u) \ . nr _b (\\n(ppu*\\n($ru)-\n(.Vu . nr _b +\\n(bmu .\} .nr _B \\n(_bu .ch @f .wh -\\n(_bu @f .nr _b +(\\n(ppu*\\n($ru) \" add 1 paragraph v in case of sweep past .nr ?f 0 \" reset footnote flag \{\ . (f _ \" reprocess footnotes which run off page . nf . |o . fi . )f . rm |o .\} .nr ?o 0 \{\ . nr _i \\n(.i . in \\n($iu . |h \" output the table header . in \\n(_iu . rr _i . mk #T \" for tbl commands . ns .\} \{\ . nr ?a 0 \" output floating keep . @k |t . if \\n(?w \ . mk _k \" don't overstrike wide keeps . nr ?w 0 .\} .os .$H \" special column header macro .ns .. .ec \{\ . nr T. 1 \" for tbl commands (to output bottom line) . T# 1 \" output the sides and bottom lines . br .\} .ev 2

0 \{\ . nr ?b 0 . @k |b\" \" output bottom of page tables .\} . @o \" output footnote if present . @c \" handle new column . @e \" new page .ev ..

.ls 1
.wh -\\n(_Bu @r
.|f
\{\ . di \" just in case triggered @r . if \\n(dn=0 \ \{\ . rm |o . nr ?o 0 . \} . nr dn \\n(_D . rr _D .\} .ch @r .. .rs .@O +\\n($lu+\\n($su .nr $c +1 .@n .. .@O \\n(_ou .rs .@t $f \" output footer title .nr ?h 0 .bp .. \{\ . sz \\n(tp \" set header/footer type fonts, etc. . @F \\n(tf . lt \\n(_Lu \" make title span entire page . nf . \\$1 . br .\} .. \{\ . if e .ds |z "\\*(|0 . if o .ds |z "\\*(|1 .\} ' tl \\*(|z .. \{\ . if e .ds |z "\\*(|0 . if o .ds |z "\\*(|1 .\} \{\ . if e .ds |z "\\*(|2 . if o .ds |z "\\*(|3 .\} ' tl \\*(|z .. .di |o \" save overflow footnote .nr ?o 1 .nr _D \\n(dn .ns .. *** COMMANDS WITH VARIANT DEFINITIONS ***
.rn bp @b \" --- begin page .nr $c \\n($m \" force new page, not new column . @b \\$1 \{\ . if \\n(.$>0 \ . pn \\$1 . if \\n(?I \ . @h \" 'spring' the header trap .\}

.wh 0 @h \" reset header .. .rn ll xl \" *** special line length (local) .xl \\$1 .lt \\$1 .nr $l \\n(.l . nr _L \\n(.l .. .rn po @O \" --- local page offset .@O \\$1 .nr _o \\n(.o .. *** MISCELLANEOUS ROFF COMMANDS ***
.nr ?H 1 .. 'in \\$1 ..

.rs .. .nm 1 .xl -\w'0000'u .nr ?n 1 .. .nm \\$1 . xl -\w'0000'u . xl \\n($lu .. .bp \\$1 .. .af % i .. .af % 1 .. .nr _0 \\n(hmu .nr hm \\$1v .nr tm +\\n(hmu-\\n(_0u .rr _0 .. .nr tm \\n(hmu+\\n(tpp+\\$1v .. .nr bm \\n(fmu+\\n(tpp+\\$1v .. .nr _0 \\n(fmu .nr fm \\$1v .nr bm +\\n(fmu-\\n(_0u .. . tm Line \\n(c. -- I cannot skip multiple pages .nr ?s 1 .. *** MISCELLANEOUS USER SUPPORT COMMANDS ***
.. .. . nr $i \\$1n . nr $i \\n(siu*\\n($0u ..

\l'\\n(.lu-\\n(.iu' .. *** PARAGRAPHING ***
.lp \\n(piu .. .@p . ti +\\$1 .nr $p 0 1 .. . nr ii \\n(iin .nr _0 \\n(ii . nr _0 \\$2n .@p \\n(_0u \{\ . ti -\\n(_0u . ie \\w"\\$1">=\\n(_0 \ \{\ \\$1 . br . \} . el \\$1\h'|\\n(_0u'\c .\} .rr _0 .. . nr $p 0 \" reset number after .bu .nr $p +1 \" increment paragraph number .@p \w'\0(000)\0'u \0(\\n($p)\h'|\w'\0(000)\0'u'\c ..

. ns \" don't space between .bu paragraphs .nr $p 0-1 \" mark "bulleted paragraph" mode .@p \w'\0\(bu\0'u \0\(bu\0\c .. .@I \" initialize macro processor . in +\\$1n

0

.@F \\n(pf .sz \\n(pp .ns .. *** SECTION HEADINGS ***
.rn sh @T .so \\*(||/sh.me .sh "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 .. . nr $i \\$3*\\n(si \{\ . sp \\n(ssu \" one of them is non-null . ne \\n(.Lv+\\n(.Vu+\\n(psu+(\\n(spu*\\n($ru*\\n(.Lu) . ie \\n(.$>2 \ . ti -(\\n(siu-\\n(sou) . el \ . ti +\\n(sou . @F \\n(sf . sz \\n(sp . if \\$3>0 \ . $\\$3 . if \w"\\$2">0 \\$2. . if \w"\\$1">0 \\$1\f1 \& .\} . sp \\n(psu .@F \\n(pf .sz \\n(pp .. .rn uh @T .so \\*(||/sh.me .uh "\\$1" .. *** COLUMNNED OUTPUT ***

. 1c \" revert to 1c if already 2c .nr $c 1 .nr $m 2 . nr $m \\$2 . nr $s \\$1n \" param 1: column seperation .nr $l (\\n(.l-((\\n($m-1)*\\n($s))/\\n($m .xl \\n($lu

_k .ns ..

.nr $c 1 .nr $m 1 .@O \\n(_ou .. .. *** FLOATING TABLES AND NONFLOATING BLOCKS ***
.rn (z @V .so \\*(||/float.me .(z \\$1 \\$2 .. .tm Line \\n(c. -- unmatched .)z .. .(z \\$1 \\$2 .. .)z \\$1 \\$2 ..

.@D 3 \\$1 \\$2 .@( ..

.@) . ne \\n(dnu \" make it all on one page .ls 1

.|k
.ec
.xl \\n($lu .ev .. .@M .di |k \!'rs .. .nr ?k 1 .@C 1 .@F \\n(df .vs \\n(.su*\\n($Ru
. fi \" set fill mode if "F" parameter
. in 0
\{\
. in +\\n(biu
. xl -\\n(biu
.\}
. ce 10000
..

.nr ?k 0 .di

0 .. .di |c ..

\" force out final line .di .ev 1 .ls 1

.|c
.ec
.ls
.ev
..
 *** BLOCK QUOTES (OR WHATEVER) AND LISTS ***

.@C 1

.xl -\\n(qiu .sz \\n(qp ..

.ev .nr ?k 0 ..

.@D 3 \\$1 \\$2 .@M ..

.ev .nr ?k 0 .. *** PREPROCESSOR SUPPORT ***

EQN

.rn EQ @T .so \\*(||/eqn.me ..
TBL

.rn TS @W .so \\*(||/tbl.me

.\"
.\" REFER
.\"
.rn ]- @]
.so \\*(||/refer.me
.]-
..
.rn ]< @]
.so \\*(||/refer.me
.]<
..
.\"
.\" IDEAL
.\"
.nr g7 \\n(.u
.ls 1
..
.ls
..
.ls
..
.\"
.\" PIC
.\"
. sp 0.3
.nr g7 \\$2
.nr g7 \\n(.u
.ls 1
..
.ls
..
.\"
.\" GREMLIN
.\"
.nr g7 (\\n(.lu-\\n(g1u)/2u
.nr g7 \\n(.u
.ls 1
..
.GF
..
.ls
..
.\" *** FONT AIDS ***
.vs \\n(.su*\\n($ru \" default vs at pointsize + 20%
.bd S B \\n(.su/3u
..
.nr _F \\n(.f
.ul 0
.rr _F
..
.nr _F \\n(.f
.ul 0
.rr _F
..
.nr _F \\n(.f
.ul 0
.rr _F
..
.nr _F \\n(.f
.ul 0
.rr _F
..
\\$1\l'|0\(ul'\\$2
..
\\*(lq\\$1\\*(rq\\$2
..
..
..
\s-1\\$1\\s0\\$2
..
.nr ~ \\$1
\{\
. ul 0
. if \\n~=8 \
. nr ~ \\n($b
. ft \\n~
.\}
.rr ~
..
.\" *** FOOTNOTING ***
.rn (f @U
.so \\*(||/footnote.me
.(f \\$1 \\$2
..
.tm Line \\n(c. -- unmatched .)f
..
\l'2i'
. sp 0.3
..
.\" *** DELAYED TEXT ***
.rn (d @U
.so \\*(||/deltext.me
.(d \\$1 \\$2
..
.tm Line \\n(c. -- unmatched .)d
..
.\" *** INDEXES (TABLE OF CONTENTS) ***
.rn (x @U
.so \\*(||/index.me
.(x \\$1 \\$2
..
.tm Line \\n(c. -- unmatched .)x
..
.\" *** STUFF FOR "STANDARD" PAPERS ***
.so \\*(||/thesis.me
..
.ep \" force out footnotes
\{\
. bp \" force out a table or more footnote
. rs
. ep
.\}
.nr ?C 1
.nr $f 1 1
. pn 1
.bp
.rs
. $c "\\$1"
. sp 3
..
.nr _0 0
. nr _0 1 \" chapter
. nr _0 11 \" renumbered chapter
. nr _0 2 \" appendix
. nr _0 12 \" renumbered appendix
. nr _0 3 \" preliminary material
. nr _0 4 \" bibliographic material
. nr _0 5 \" abstract
. tm Line \\n(c. -- Bad mode to .++
.nr ?R 0
.\{
. nr ?R 1
. nr _0 -10
.\}
.nr ch 0 1
. pn 1 \" must do before .ep
.ep \" end page for correct page number types
\{\
. af ch 1
. af % 1
.\}
\{\
. af ch A
. af % 1
.\}
. af % i
. af % 1
. af % 1
. he \\$2
. pn 1
.nr _M \\n(_0
.rr _0
..
.sz 12

1000

. nr ch +1
. sp 4-\\n(.L

0

.sz
. $C Chapter \\n(ch "\\$1"
. $C Appendix \\n(ch "\\$1"
..
.hx
.bp

.rs
..
.rn ac @T
.so \\*(||/acm.me
.ac "\\$1" "\\$2"
..
.\" all these macros should be named "*X", where X is any letter
.so \\*(||/local.me
..
.so \\*(||/letterhead.me
..
.\" *** DATES ***
.\" *** PARAMETRIC INITIALIZATIONS ***
. vs 9p \" for 12-pitch DTC terminals
.rr x
.nr $r \n(.v/\n(.s \" ratio of vs to ps for .sz request
.nr $R \n($r \" ratio for displays & footnotes
.nr hm 4v \" header margin
.nr tm 7v \" top margin
.nr bm 6v \" bottom margin
.nr fm 3v \" footer margin
.nr tf 3 \" title font: (real) Times Bold
.nr tp 10 \" title point size
.nr bi 4m \" indent for blocks
.nr pi 5n \" indent for paragraphs
.nr pf 1 \" normal text font
.nr pp 10 \" normal text point size
.nr qi 4n \" indent for quotes
.nr qp -1 \" down one point
.nr ii 5n \" indent for .ip's and .np's
.nr $m 1 \" max number of columns
.nr $s 4n \" column separation
.bd S B 3
.\" *** OTHER INITIALIZATION ***
\{\
. ds [ \v'-0.4m'\x'-0.2m'\s-3
. ds ] \s0\v'0.4m'
. ds < \v'0.4m'\x'0.2m'\s-3
. ds > \s0\v'-0.4m'
. ds - \(em
. nr fi 0.3i
.\}
\{\
. nr fi 3n
.\}
.nr _o \n(.o
. nr $T 2
. nr $T 1
\{\
. nr $T 0
. po -0.5i \" make ugly line on LHS on C/A/T typesetters
.\}
\{\
. if \n($T=1 \
. po 0
. ds [ [
. ds ] ]
. ds < <
. ds > >
.\}
.nr $b \nb \" figure the real font 8 font
.rr b
\{\
. if n .nr $b 2 \" italic
. if t .nr $b 3 \" bold
.\}
.nr ps 0.5v \" paragraph pre/post spacing
. nr ps 1v
.nr bs \n(ps \" block pre/post spacing
.nr qs \n(ps \" quote pre/post spacing
.nr zs 1v \" float-block pre/postspacing
.nr xs 0.2v \" index prespacing
.nr fs 0.2v \" footnote prespacing
. nr fs 0
.wh 0 @h \" set header
.nr $l \n(.lu \" line length
.nr _L \n(.lu \" line length of page
.nr $c 1 \" current column number
.nr $f 1 1 \" footnote number
.nr $d 1 1 \" delayed text number
.nr _M 1 \" chapter mode is chapter
. ds lq ``
. ds rq ''
.em @z
.\" *** FOREIGN LETTERS AND SPECIAL CHARACTERS ***
.so \\*(||/chars.me
..
.lt 6.0i