6 Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc.
7 Written by James Clark (jjc@jclark.com)
9 This file is part of groff.
11 groff is free software; you can redistribute it and/or modify it under
12 the terms of the GNU General Public License as published by the Free
13 Software Foundation; either version 2, or (at your option) any later
16 groff is distributed in the hope that it will be useful, but WITHOUT ANY
17 WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License along
22 with groff; see the file COPYING. If not, write to the Free Software
23 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 .if !\n(.g .ab These ms macros require groff.
27 . ab The groff ms macros do not work in compatibility mode.
28 .\" Enable warnings (only if none are given on the command line).
29 .\" You can delete this if you want.
30 .if (\n[.warn] == 65543) .warn
31 .\" See if already loaded.
35 .tm \\n(.F:\\n(.c: macro error: \\$*
38 .tm \\n(.F:\\n(.c: macro warning: \\$*
41 .ab \\n(.F:\\n(.c: fatal macro error: \\$*
44 .@error sorry, \\$0 not implemented
47 .als TM @not-implemented
48 .als CT @not-implemented
53 .\" a non-empty environment
61 .ds REFERENCES References
63 .ds TOC Table of Contents
76 .ds MO \\*[MONTH\n[mo]]
77 .ds DY \n[dy] \*[MO] \n[year]
79 .if \\n[.$] .ds DY "\\$*
82 .if \\n[.$] .ds DY "\\$*
87 .tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[PN]
89 .\" print an error message and then try to recover
91 .@error \\$@ (recovering)
94 . \"@warning automatically terminating diversion \\n(.z
95 . ie d @div-end!\\n(.z .@div-end!\\n(.z
96 . el .*div-end-default
98 . \" ensure that we don't loop forever
99 . if \\n[*pop-count]>20 .@fatal recovery failed
101 .while !'\\n[.ev]'0' .ev
113 .\" ****************************
114 .\" ******** module cov ********
115 .\" ****************************
116 .\" Cover sheet and first page.
117 .de cov*err-not-after-first-page
118 .@error \\$0 is not allowed after the first page has started
120 .de cov*err-not-before-tl
121 .@error \\$0 is not allowed before TL
123 .de cov*err-not-again
124 .@error \\$0 is not allowed more than once
126 .de cov*err-not-after-ab
127 .@error \\$0 is not allowed after first AB, LP, PP, IP, SH or NH
129 .als AU cov*err-not-before-tl
130 .als AI cov*err-not-before-tl
131 .als AB cov*err-not-before-tl
132 .de cov*first-page-init
133 .rm cov*first-page-init
135 .als RP cov*err-not-after-first-page
137 .ie \\n[cov*rp-format] \{\
148 .CHECK-FOOTER-AND-KEEP
150 .wh 0 cov*first-page-init
151 .\" This handles the case where FS occurs before TL or LP.
158 .\" released paper format
161 .if \\n[.$] .if '\\$1'no' .nr cov*rp-no 1
166 .als TL cov*err-not-again
170 .if !'\*(.T'html' .di cov*tl-div
186 .di cov*au-div!\\n[cov*n-au]
192 .if !'\*(.T'html' .par@reset
197 .ie !\\n[cov*n-au] .@error AI before AU
199 . di cov*ai-div!\\n[cov*n-au]
226 .als cov*ab-init @nop
244 .als AB cov*err-not-after-ab
255 .if !'\*(.T'html' .di cov*ab-div
269 . als cov*tl-au-print @nop
277 . als AE cov*err-not-again
280 . ie '\\n(.z'cov*ab-div' \{\
281 . als AE cov*err-not-again
284 .\" nr cov*ab-height \\n[dn]
289 . el .@error AE without AB
292 .de @div-end!cov*ab-div
298 . ie \\n[cov*rp-format] .cov*rp-print
299 . el .cov*draft-print
302 . if \\n[cov*rp-format] \{\
303 . @warning RP format but no TL
307 . CHECK-FOOTER-AND-KEEP
313 .nr cov*page-length \\n[.p]
318 . if !'\*(.T'html' . nf
325 .if \\n[cov*fn-height] \{\
326 . sp |(u;\\n[cov*page-length]-\\n[FM]\
327 -\\n[cov*fn-height]-\\n[fn@sep-dist]>?\\n[nl])
332 . ie \\n[cov*rp-no] .rm cov*fn-div
334 . rn cov*fn-div fn@overflow-div
335 . nr fn@have-overflow 1
340 .CHECK-FOOTER-AND-KEEP
341 .\" If anything was printed below where the footer line is normally printed,
342 .\" then that's an overflow.
343 .if -\\n[FM]/2+1v+\\n[cov*page-length]<\\n[nl] .@error cover sheet overflow
344 .pl \\n[cov*page-length]u
346 .if !\\n[cov*rp-no] .cov*tl-au-print
365 .if d cov*tl-div .cov*tl-div
368 .while \\n[cov*i]<=\\n[cov*n-au] \{\
370 . cov*au-div!\\n[cov*i]
371 . ie d cov*ai-div!\\n[cov*i] \{\
373 . cov*ai-div!\\n[cov*i]
383 .\" start of footnote on cover
385 .if \\n[cov*in-fn] \{\
393 .if !\\n[cov*fn-height] .ns
394 .ie \\n[.$] .FP "\\$1" no
397 .de @div-end!cov*fn-div
400 .\" end of footnote on cover
402 .ie '\\n(.z'cov*fn-div' \{\
407 . nr cov*fn-height +\\n[dn]
409 .el .@error FE without matching FS
411 .\" ***************************
412 .\" ******** module pg ********
413 .\" ***************************
414 .\" Page-level formatting.
415 .\" > 0 if we have a footnote on the current page
427 .ds pg*OH '\\*[LH]'\\*[CH]'\\*[RH]'
428 .ds pg*EH '\\*[LH]'\\*[CH]'\\*[RH]'
429 .ds pg*OF '\\*[LF]'\\*[CF]'\\*[RF]'
430 .ds pg*EF '\\*[LF]'\\*[CF]'\\*[RF]'
438 .ie \\n%=1 .if \\n[pg*P1] .tl \\*[pg*OH]
440 . ie o .tl \\*[pg*OH]
452 .wh -\n[FM]u pg@bottom
453 .wh -\n[FM]u/2u pg*footer
457 .if !'\\n(.z'' .error-recover MC while diversion open
459 .ie \\n[pg@ncols]>1 .pg@super-eject
461 . \" flush out any floating keeps
462 . while \\n[kp@tail]>\\n[kp@head] \{\
468 . nr pg@colw \\n[LL]*7/15
469 . nr pg*gutw \\n[LL]-(2*\\n[pg@colw])
473 . nr pg@colw (n;\\$1)<?\\n[LL]
474 . ie \\n[.$]<2 .nr pg*gutw \\n[MINGW]
475 . el .nr pg*gutw (n;\\$2)
476 . nr pg@ncols \\n[LL]-\\n[pg@colw]/(\\n[pg@colw]+\\n[pg*gutw])+1
477 . ie \\n[pg@ncols]>1 \
478 . nr pg*gutw \\n[LL]-(\\n[pg@ncols]*\\n[pg@colw])/(\\n[pg@ncols]-1)
481 .HTML-TAG ".mc \\n[pg@ncols] \\n[pg@colw] \\n[pg*gutw]"
485 .nr pg@fn-colw \\n[pg@colw]*5/6
494 .\" top of page macro
496 .ch pg*footer -\\n[FM]u/2u
499 .nr pg@fn-bottom-margin 0
500 .nr pg*saved-po \\n[PO]
514 .\" Handle footnote overflow before floating keeps, because the keep
515 .\" might contain an embedded footnote.
523 .\" move pg@bottom and pg*footer out of the way
524 .ch pg@bottom \\n[.p]u*2u
525 .ch pg*footer \\n[.p]u*2u
530 .if \\n[pg@fn-flag] .fn@bottom-hook
532 .ie \\n[pg*col-num]<\\n[pg@ncols] .pg*end-col
536 'sp |\\n[pg*col-top]u
537 .po (u;\\n[pg*saved-po]+(\\n[pg@colw]+\\n[pg*gutw]*\\n[pg*col-num]))
538 .\"po +(u;\\n[pg@colw]+\\n[pg*gutw])
542 .po \\n[pg*saved-po]u
543 .\" Make sure we don't exit if there are still floats or footnotes left-over.
544 .ie \\n[kp@head]<\\n[kp@tail]:\\n[fn@have-overflow] \{\
545 . \" Switching environments ensures that we don't get an unnecessary
546 . \" blank line at the top of the page.
552 . \" If the text has ended and there are no more footnotes or keeps, exit.
553 . if \\n[pg@text-ended] .ex
554 . if r pg*next-number \{\
555 . pn \\n[pg*next-number]
557 . if d pg*next-format \{\
558 . af PN \\*[pg*next-format]
565 .\" pg@begin number format
568 . nr pg*next-number (;\\$1)
569 . ie \\n[.$]>1 .ds pg*next-format \\$2
570 . el .rm pg*next-format
572 .el .rr pg*next-number
575 .\" print the footer line
582 .\" flush out any keeps or footnotes
585 .if !'\\n(.z'' .@error-recover diversion open while ejecting page
586 .\" Make sure we stay in the end macro while there is still footnote overflow
587 .\" left, or floating keeps.
588 .while \\n[kp@tail]>\\n[kp@head]:\\n[pg@fn-flag] \{\
601 .\" ***************************
602 .\" ******** module fn ********
603 .\" ***************************
607 .\" Round it vertically
609 .nr fn@sep-dist \n[.v]
613 .ds * \\*[par@sup-start]\En+[fn*text-num]\\*[par@sup-end]
617 .ie \\n[.$] .fn*do-FS "\\$1" no
619 . ie \\n[fn*text-num]>\\n[fn*note-num] .fn*do-FS \\n+[fn*note-num]
623 .\" Second argument of `no' means don't embellish the first argument.
625 .if \\n[fn*open] .@error-recover nested FS
628 . \" Ensure that the first line of the footnote is on the same page
629 . \" as the reference. I think this is minimal.
633 . ie \\n[pg@fn-flag] .nr fn*need +\\n[fn:PD]
634 . el .nr fn*need +\\n[fn@sep-dist]
635 . ne \\n[fn*need]u+\\n[.V]u>?0
645 .ie !\\n[fn*open] .@error FE without FS
653 .nr fn@have-overflow 0
654 .\" called at the top of each column
657 .nr fn*page-bottom-pos 0-\\n[FM]-\\n[pg@fn-bottom-margin]
658 .ch pg@bottom \\n[fn*page-bottom-pos]u
659 .if \\n[fn@have-overflow] \{\
660 . nr fn@have-overflow 0
668 .\" This is called at the bottom of the column if pg@fn-flag is set.
671 .nr fn@have-overflow 0
672 .nr fn@bottom-pos \\n[.p]-\\n[FM]-\\n[pg@fn-bottom-margin]+\\n[.v]
674 .nr fn@bottom-pos -\\n[.v]
676 .ie \\n[nl]+\\n[fn@sep-dist]+\n[.V]>\\n[fn@bottom-pos] \{\
677 . rn fn@div fn@overflow-div
678 . nr fn@have-overflow 1
681 . if \\n[pg@ncols]>1 \
682 . if \\n[fn*max-width]>\\n[pg@fn-colw] \
683 . nr pg@fn-bottom-margin \\n[.p]-\\n[FM]-\\n[nl]+1v
684 . wh \\n[fn@bottom-pos]u fn*catch-overflow
690 . if '\\n(.z'fn@overflow-div' \{\
692 . nr fn@have-overflow \\n[dn]>0
694 . ch fn*catch-overflow
697 .de fn*catch-overflow
703 .if '\\n[.ev]'fn' .ev
707 .als @div-end!fn*embed-div @div-end!fn@div
711 . if !\\n[pg@fn-flag] .ns
716 .ie '\\n(.z'fn@div' \{\
718 . nr fn*page-bottom-pos -\\n[dn]
719 . nr fn*max-width \\n[fn*max-width]>?\\n[dl]
720 . if !\\n[pg@fn-flag] .nr fn*page-bottom-pos -\\n[fn@sep-dist]
722 . nr fn*page-bottom-pos \\n[nl]-\\n[.p]+\n[.V]>?\\n[fn*page-bottom-pos]
723 . ch pg@bottom \\n[fn*page-bottom-pos]u
726 . ie '\\n(.z'fn*embed-div' \{\
728 . rn fn*embed-div fn*embed-div!\\n[fn*embed-count]
729 \!. fn*embed-start \\n[fn*embed-count]
731 ' sp (u;\\n[dn]+\\n[fn@sep-dist]+\\n[.V])
733 . nr fn*embed-count +1
737 . @error-recover unclosed diversion within footnote
746 . rm fn*embed-div!\\$1
752 \!. fn*embed-start \\$1
757 .ie '\\n(.z'fn*null' \{\
763 .\" It's important that fn@print-sep use up exactly fn@sep-dist vertical space.
767 .vs \\n[fn@sep-dist]u
772 .\" ***************************
773 .\" ******** module kp ********
774 .\" ***************************
781 .if !'\\n(.z'' .@error-recover KF while open diversion
788 .ie '\\n(.z'kp*div' .kp*end
790 . ie '\\n(.z'kp*fdiv' .kp*fend
791 . el .@error KE without KS or KF
801 .ie '\\n(.z'' .ds@need \\$1
804 .\" end non-floating keep
817 .\" end floating keep
822 .ie \\n[.t]-(\\n[.k]>0*1v)>\\n[dn] \{\
830 . rn kp*fdiv kp*div!\\n[kp@tail]
831 . nr kp*ht!\\n[kp@tail] 0\\n[dn]
835 .\" top of page processing for KF
838 .if !\\n[kp*doing-top] \{\
845 .\" If the first keep won't fit, only force it out if we haven't had a footnote
846 .\" and we're at the top of the page.
847 .nr kp*force \\n[pg@fn-flag]=0&(\\n[nl]<=\\n[pg@header-bottom])
849 .while \\n[kp@tail]>\\n[kp@head]&\\n[kp*fits] \{\
850 . ie \\n[.t]>\\n[kp*ht!\\n[kp@head]]:\\n[kp*force] \{\
852 . \" It's important to advance kp@head before bringing
853 . \" back the keep, so that if the last line of the
854 . \" last keep springs the bottom of page trap, a new
855 . \" page will not be started unnecessarily.
856 . rn kp*div!\\n[kp@head] kp*temp
866 .\" ***************************
867 .\" ******** module ds ********
868 .\" ***************************
869 .\" Displays and non-floating keeps.
871 .ds*end!\\n[\\n[.ev]:ds-type]
872 .nr \\n[.ev]:ds-type 0
875 .if \\n[\\n[.ev]:ds-type] \{\
876 . @error automatically terminating display
881 .ie \\n[\\n[.ev]:ds-type] .DE
885 .@error DE without DS, ID, CD, LD or BD
889 .nr \\n[.ev]:ds-type 1
896 .ie \\n[.$] .in +(n;\\$1)
911 .als ds*end!1 ds*common-end
914 .nr \\n[.ev]:ds-type 2
919 .ie '\\n(.z'ds*div' \{\
922 . in (u;\\n[.l]-\\n[dl]/2>?0)
927 .el .@error-recover mismatched DE
934 . nr \\n[.ev]:ds-type 4
943 . ie '\\$1'I' .ID \\$2
948 . nr \\n[.ev]:ds-type 3
953 . while \\n[.t]<=(\\$1)&(\\n[nl]>\\n[pg@header-bottom]) \{\
961 .ie '\\n(.z'ds*div' \{\
970 .el .@error-recover mismatched DE
973 .ie '\\n(.z'ds*div' \{\
977 . in (u;\\n[.l]-\\n[dl]/2>?0)
983 .el .@error-recover mismatched DE
985 .\" ****************************
986 .\" ******** module par ********
987 .\" ****************************
988 .\" Paragraph-level formatting.
989 .\" Load time initialization.
991 .\" PS and VS might have been set on the command-line
995 .\" don't set LT so that it can be defaulted from LL
999 .\" don't set VS so that it can be defaulted from PS
1000 .ie rVS .par*vs \\n[VS]
1001 .el .par*vs \\n[PS]+2
1002 .if dFAM .fam \\*[FAM]
1006 .CHECK-FOOTER-AND-KEEP
1009 .\" If it's too big to be in points, treat it as units.
1010 .ie (p;\\$1)>=40p .vs (u;\\$1)
1014 .nr 0:li (u;\\n[LL]/12)
1021 .aln \\n[.ev]:MCLL LL
1023 .aln \\n[.ev]:MCLT LT
1029 .\" happens when the first page begins
1031 .if !rLT .nr LT \\n[LL]
1032 .if !rFL .nr FL \\n[LL]*5/6
1033 .if !rVS .nr VS \\n[PS]+2
1035 .if !rFPS .nr FPS \\n[PS]-2
1036 .if !rFVS .nr FVS \\n[FPS]+2
1037 .\" don't change environment 0
1043 .if !rPD .nr PD .3v>?\n(.V
1044 .if !rDD .nr DD .5v>?\n(.V
1046 .if !rFPD .nr FPD \\n[PD]/2
1048 .if !dFAM .ds FAM \\n[.fam]
1070 .aln fn:MCLL pg@fn-colw
1071 .aln fn:MCLT pg@fn-colw
1077 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1080 .nr \\n[.ev]:ds-type 0
1089 .ie \\n[pg@ncols]>1 \{\
1090 . ll (u;\\n[\\n[.ev]:MCLL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1091 . lt \\n[\\n[.ev]:MCLT]u
1094 . ll (u;\\n[\\n[.ev]:LL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1095 . lt \\n[\\n[.ev]:LT]u
1097 .in (u;\\n[\\n[.ev]:li]+\\n[\\n[.ev]:pli])
1100 .ps \\n[\\n[.ev]:PS]
1101 .par*vs \\n[\\n[.ev]:VS]
1111 .\" This can be redefined by the user.
1117 .nr \\n[.ev]:pli \\$1
1118 .nr \\n[.ev]:pri \\$2
1120 .sp \\n[\\n[.ev]:PD]u
1131 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1135 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1136 .if !'\*(.T'html' .ti +\\n[\\n[.ev]:ai]u
1139 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1140 .par*start \\n[QI] \\n[QI]
1143 .par*start \\n[\\n[.ev]:PI] 0
1144 .ti -\\n[\\n[.ev]:PI]u
1147 .if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
1148 .par*start \\n[\\n[.ev]:ai] 0
1150 . \" Divert the label so as to freeze any spaces.
1157 . ie '\*(.T'html' \{\
1158 . if \\n[dl]+1n<=\\n[\\n[.ev]:ai] .HTML-TAG ".ip"
1164 . ti -\\n[\\n[.ev]:ai]u
1165 . ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \\*[par*label]\h'|\\n[\\n[.ev]:ai]u'\c
1174 .\" We don't want margin characters to be attached when we divert
1175 .\" the tag. Since there's no way to save and restore the current
1176 .\" margin character, we have to switch to a new environment, taking
1177 .\" what we need of the old environment with us.
1178 .de par*push-tag-env
1179 .nr par*saved-font \\n[.f]
1180 .nr par*saved-size \\n[.s]z
1181 .nr par*saved-ss \\n[.ss]
1182 .ds par*saved-fam \\n[.fam]
1186 .ft \\n[par*saved-font]
1187 .ps \\n[par*saved-size]u
1188 .ss \\n[par*saved-ss]
1189 .fam \\*[par*saved-fam]
1196 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1197 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1198 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1199 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1200 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1202 .nr \\n[.ev]:li +\\n[\\n[.ev]:ai]
1203 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1208 .ie \\n[\\n[.ev]:il] \{\
1210 . nr \\n[.ev]:ai \\n[\\n[.ev]:ai!\\n[\\n[.ev]:il]]
1211 . nr \\n[.ev]:li \\n[\\n[.ev]:li!\\n[\\n[.ev]:il]]
1212 . nr \\n[.ev]:ri \\n[\\n[.ev]:ri!\\n[\\n[.ev]:il]]
1213 . nr \\n[.ev]:pli \\n[\\n[.ev]:pli!\\n[\\n[.ev]:il]]
1214 . nr \\n[.ev]:pri \\n[\\n[.ev]:pri!\\n[\\n[.ev]:il]]
1216 .el .@error unbalanced \\$0
1221 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1222 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1223 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1224 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1225 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1227 .nr \\n[.ev]:li +\\n[QI]
1228 .nr \\n[.ev]:ri +\\n[QI]
1229 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1233 .\" start boxed text
1240 .nr par*box-in \\n[.in]
1241 .\" remember what 1n is, just in case the point size changes
1246 .ti \\n[par*box-in]u+1n
1248 .de @div-end!par*box-div
1252 .\" Postpone the drawing of the box until we're in the top-level diversion,
1253 .\" in case there's a footnote inside the box.
1255 .ie '\\n(.z'par*box-div' \{\
1257 . if \n[.V]>.25m .sp
1259 . if \n[.V]>.25m .sp
1265 . nr \\n[.ev]:ri -\\n[par*box-n]
1266 . nr \\n[.ev]:li -\\n[par*box-n]
1267 . in -\\n[par*box-n]u
1268 . ll +\\n[par*box-n]u
1269 . lt +\\n[par*box-n]u
1270 . par*box-draw \\n[.i]u \\n[.l]u-(\\n[.H]u==1n*1n)
1272 .el .@error B2 without B1
1275 .de par*box-mark-top
1280 .el \!.par*box-mark-top
1284 . nr par*box-in \\n[.i]
1285 . nr par*box-ll \\n[.l]
1286 . nr par*box-vpt \\n[.vpt]
1287 . nr par*box-ad \\n[.j]
1293 \D'l (u;\\n[.l]-\\n[.i]) 0'\
1294 \D'l 0 |\\n[par*box-top]u'\
1295 \D'l -(u;\\n[.l]-\\n[.i]) 0'\
1296 \D'l 0 -|\\n[par*box-top]u'
1299 . in \\n[par*box-in]u
1300 . ll \\n[par*box-ll]u
1301 . vpt \\n[par*box-vpt]
1302 . ad \\n[par*box-ad]
1304 .el \!.par*box-draw \\$1 \\$2
1308 .\" Keep together the heading and the first two lines of the next paragraph.
1309 .ne 3v+\\n[\\n[.ev]:PD]u+\\n(.Vu
1314 .\" TL, AU, and AI are aliased to these in cov*ab-init.
1335 .\" In paragraph macros.
1337 .ps \\n[\\n[.ev]:PS]
1348 .\" par*define-font-macro macro font
1349 .de par*define-font-macro
1352 . nr par*prev-font \\\\n[.f]
1353 \&\\\\$3\f[\\$2]\\\\$1\f[\\\\n[par*prev-font]]\\\\$2
1358 .par*define-font-macro B B
1359 .par*define-font-macro I I
1360 .par*define-font-macro BI BI
1361 .par*define-font-macro CW CR
1362 .\" underline a word
1364 \Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m'\\$2
1368 .nr par*bxw \w'\\$1'+.4m
1369 \Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
1373 .\" The first time UX is used, put a registered mark after it.
1376 \s[\\n[.s]*8u/10u]UNIX\s0\\$1\\*[par*ux-rg]
1379 .ds par@sup-start \v'-.9m\s'\En[.s]*7u/10u'+.7m'
1380 .als { par@sup-start
1381 .ds par@sup-end \v'-.7m\s0+.9m'
1383 .\" footnote paragraphs
1384 .\" FF is the footnote format
1386 .\" This can be redefined. It gets a second argument of `no' if the first
1387 .\" argument was supplied by the user, rather than automatically.
1390 .if !d par*fp!\\n[FF] \{\
1391 . @error unknown footnote format `\\n[FF]'
1394 .ie '\\$2'no' .par*fp!\\n[FF]-no "\\$1"
1395 .el .par*fp!\\n[FF] "\\$1"
1399 \&\\*[par@sup-start]\\$1\\*[par@sup-end]\ \c
1422 .@IP "\\$1." (u;\\n[\\n[.ev]:PI]*2)
1425 .@IP "\\$1" (u;\\n[\\n[.ev]:PI]*2)
1427 .\" ***************************
1428 .\" ******** module nh ********
1429 .\" ***************************
1430 .\" Numbered headings.
1431 .\" nh*hl is the level of the last heading
1433 .\" numbered heading
1435 .HTML-TAG ".NH \\$1"
1441 . nr H\\n[nh*hl] 0\\$1
1444 . if !\\n[nh*hl] \{\
1447 . @error missing arguments to .NH S
1451 . nr nh*ohl \\n[nh*hl]
1454 . ie \\n[nh*hl]<=0 \{\
1459 . if \\n[nh*hl]-\\n[nh*ohl]>1 \
1460 . @warning .NH \\n[nh*ohl] followed by .NH \\n[nh*hl]
1464 . while \\n[nh*hl]>\\n[nh*ohl] \{\
1472 .while \\n[nh*i]<\\n[nh*hl] \{\
1474 . as SN \\n[H\\n[nh*i]].
1479 .\" ****************************
1480 .\" ******** module toc ********
1481 .\" ****************************
1482 .\" Table of contents generation.
1486 .ie \\n[.$] .XA "\\$1"
1489 .de @div-end!toc*div
1493 .ie '\\n(.z'toc*div' \{\
1494 . if d toc*num .toc*end-entry
1496 . ie '\\$1'no' .ds toc*num
1497 . el .ds toc*num "\\$1
1499 . el .ds toc*num \\n[PN]
1506 .el .@error XA without XS
1509 .ie '\\n(.z'toc*div' \{\
1510 . if d toc*num .toc*end-entry
1514 .el .@error XS without XE
1532 .char \[toc*leader-char] .\h'1m'
1533 .lc \[toc*leader-char]
1534 .ta (u;\\n[.l]-\\n[.i]-\w'000') (u;\\n[.l]-\\n[.i])R
1539 .\" print the table of contents on page i
1545 .\" ****************************
1546 .\" ******** module eqn ********
1547 .\" ****************************
1556 .ie '\\$1'L' .nr eqn*type 0
1558 . ie '\\$1'I' .nr eqn*type 1
1561 . if !'\\$1'C' .ds eqn*num "\\$1
1568 .de @div-end!eqn*div
1571 .\" Note that geqn mark and lineup work correctly in centered equations.
1573 .ie !'\\n(.z'eqn*div' .@error-recover mismatched EN
1578 . if !'\\*[eqn*num]'' .nr eqn*have-num 1
1579 . if \\n[dl]:\\n[eqn*have-num] \{\
1582 . ds eqn*tabs \\n[.tabs]
1585 . ds@need \\n[dn]u-1v+\n[.V]u
1587 . ie \\n[eqn*type]=0 \{\
1588 . ta (u;\\n[.l]-\\n[.i])R
1589 \\*[eqn*div]\t\\*[eqn*num]
1592 . ie \\n[eqn*type]=1 .ta \\n[DI]u \
1593 (u;\\n[.l]-\\n[.i])R
1594 . el .ta (u;\\n[.l]-\\n[.i]/2)C \
1595 (u;\\n[.l]-\\n[.i])R
1596 \t\\*[eqn*div]\t\\*[eqn*num]
1600 . ta (u;\\n[.l]-\\n[.i])R
1609 .\" ****************************
1610 .\" ******** module tbl ********
1611 .\" ****************************
1613 .nr tbl*have-header 0
1614 .\" This gets called if TS occurs before the first paragraph.
1617 .\" cov*ab-init aliases TS to @TS
1622 .if '\\$1'H' .di tbl*header-div
1625 .if \\n[tbl*have-header] \{\
1626 . ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl*print-header
1630 .de tbl*print-header
1637 .ie '\\n[.z]'tbl*header-div' \{\
1642 . ie \\n[dn]+\\n[FM]+\\n[HM]+2v>=\\n[.p] \{\
1643 . @error ridiculously long table header
1648 . nr tbl*header-ht \\n[dn]
1649 . ds@need \\n[dn]u+1v
1651 . nr tbl*have-header 1
1654 .el .@error-recover .TH without .TS H
1656 .de @div-end!tbl*header-div
1661 .ie '\\n(.z'tbl*header-div' .@error-recover .TS H but no .TH before .TE
1663 . nr tbl*have-header 0
1670 .if \\n[tbl*have-header] \{\
1677 .\" ****************************
1678 .\" ******** module pic ********
1679 .\" ****************************
1685 .ie \\n[.$]<2 .@error bad arguments to PS (not preprocessed with pic?)
1687 . ds@need (u;\\$1)+1v
1688 . in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)
1695 .\" ****************************
1696 .\" ******** module ref ********
1697 .\" ****************************
1700 .rm [A [B [C [D [E [G [I [J [N [O [P [Q [R [S [T [V
1704 .ds ref*spec!0 Q A T1 S V N P I C D O
1706 .ds ref*spec!1 Q A T2 J S V N P I C D O
1708 .ds ref*spec!2 Q A T1 S V P I C D O
1709 .\" Article within book
1710 .ds ref*spec!3 Q A T2 B E S V P I C D O
1712 .ds ref*spec!4 Q A T2 R G P I C D O
1719 .ie d ref*spec!\\$1 .ref*build \\*[ref*spec!\\$1]
1721 . @error unknown reference type `\\$1'
1722 . ref*build \\*[ref*spec!0]
1728 .\" start of reference number
1729 .ds [. \\*[par@sup-start]
1730 .\" end of reference number
1731 .ds .] \\*[par@sup-end]
1732 .\" period before reference
1734 .\" period after reference
1736 .\" comma before reference
1738 .\" comma after reference
1740 .\" start collected references
1742 .als ref*print ref*end-print
1747 .\" end collected references
1750 .als ref*print ref*normal-print
1752 .de ref*normal-print
1753 .ie d [F .FS "\\*([.\\*([F\\*(.]"
1759 .ie d [F .IP "\\*([F."
1763 .als ref*print ref*normal-print
1765 .rm ref*string ref*post-punct
1766 .nr ref*suppress-period 1
1769 . ie d ref*add-\\$1 .ref*add-\\$1
1770 . el .ref*add-dflt \\$1
1774 .\" now add a final period
1775 .ie d ref*string \{\
1776 . if !\\n[ref*suppress-period] .as ref*string .
1777 . if d ref*post-punct \{\
1778 . as ref*string "\\*[ref*post-punct]
1785 .ref*field T , "\fI" "" "\fP"
1786 .if r [T .nr ref*suppress-period \\n([T
1789 .ref*field T , "\\*Q" "" "\\*U"
1790 .if r [T .nr ref*suppress-period \\n([T
1793 .ie \\n([P>0 .ref*field P , "pp. "
1794 .el .ref*field P , "p. "
1797 .ref*field J , \fI "" \fP
1803 .ref*field E , "ed. "
1809 .ref*field B "" "in \fI" "" \fP
1813 .ie r [O .nr ref*suppress-period \\n([O
1814 .el .nr ref*suppress-period 1
1818 .if r [A .nr ref*suppress-period \\n([A
1823 .\" First argument is the field letter.
1824 .\" Second argument is the punctuation character to use to separate this field
1825 .\" from the previous field.
1826 .\" Third argument is a string with which to prefix this field.
1827 .\" Fourth argument is a string with which to postfix this field.
1828 .\" Fifth argument is a string to add after the punctuation character supplied
1829 .\" by the next field.
1831 .if d ref*string \{\
1832 . ie d ref*post-punct \{\
1833 . as ref*string "\\$2\\*[ref*post-punct] \"
1836 . el .as ref*string "\\$2 \"
1838 .as ref*string "\\$3\\*([\\$1\\$4
1839 .if \\n[.$]>4 .ds ref*post-punct "\\$5
1840 .nr ref*suppress-period 0
1842 .\" ****************************
1843 .\" ******** module acc ********
1844 .\" ****************************
1845 .\" Accents and special characters.
1850 .\" The idea of this definition is for the top of the 3 to be at the x-height.
1851 .if !c\[yogh] .char \[yogh] \Z'\v'\w'x'*0-\En[rst]u'\s[\En[.s]*8u/10u]\
1852 \v'\w'3'*0+\En[rst]u'3\s0'\h'\w'\s[\En[.s]*8u/10u]3'u'
1855 .ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
1856 \h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
1859 .ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
1862 .ds \\$1 \Z'\h'(u;-\En[.w]-\w'\\$2'/2)'\
1863 \v'(u;\En[.cdp]-\En[.cht]+\En[rst]+\En[rsb]/2)'\\$2'
1866 .ds \\$1 \Z'\h'(u;\w'x'-\w'\\$2'/2)'\\$2'
1868 .acc*prefix-def ' \'
1869 .acc*prefix-def ` \`
1871 .acc*prefix-def , \(ac
1872 .acc*prefix-def : \(ad
1874 .\" improved accent marks
1880 .acc*over-def : \(ad
1881 .acc*over-def v \(ah
1882 .acc*over-def _ \(a-
1883 .acc*over-def o \(ao
1884 .acc*under-def , \(ac
1885 .acc*under-def . \s[\En[.s]*8u/10u]\v'.2m'.\v'-.2m'\s0
1886 .acc*under-def hook \(ho
1888 .char \[hooko] o\\\\*[hook]
1891 .ds D- \(-D\" Icelandic uppercase eth
1892 .ds d- \(Sd\" Icelandic lowercase eth
1893 .ds Th \(TP\" Icelandic uppercase thorn
1894 .ds th \(Tp\" Icelandic lowercase thorn
1895 .ds 8 \(ss\" German double s
1896 .ds Ae \(AE\" AE ligature
1897 .ds ae \(ae\" ae ligature
1898 .ds Oe \(OE\" OE ligature
1899 .ds oe \(oe\" oe ligature
1900 .ds ? \(r?\" upside down ?
1901 .ds ! \(r!\" upside down !
1903 .de CHECK-FOOTER-AND-KEEP
1904 .\" it might be better to als FS -> B1 and FE -> B2
1905 .\" however this produced wierd results, so I've moved back to a more reliable
1906 .\" but less interesting solution --fixme--
1907 . if '\*(.T'html' \{\
1935 .\" Make sure that no blank lines creep in at the end of this file.