6 Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004
7 Free Software Foundation, Inc.
8 Written by James Clark (jjc@jclark.com)
10 This file is part of groff.
12 groff is free software; you can redistribute it and/or modify it under
13 the terms of the GNU General Public License as published by the Free
14 Software Foundation; either version 2, or (at your option) any later
17 groff is distributed in the hope that it will be useful, but WITHOUT ANY
18 WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 You should have received a copy of the GNU General Public License along
23 with groff; see the file COPYING. If not, write to the Free Software
24 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 .if !\n(.g .ab These ms macros require groff.
28 . ab The groff ms macros do not work in compatibility mode.
29 .\" Enable warnings (only if none are given on the command line).
30 .\" You can delete this if you want.
31 .if (\n[.warn] == 65543) .warn
32 .\" See if already loaded.
36 .tm \\n(.F:\\n(.c: macro error: \\$*
39 .tm \\n(.F:\\n(.c: macro warning: \\$*
42 .ab \\n(.F:\\n(.c: fatal macro error: \\$*
45 .@error sorry, \\$0 not implemented
48 .als TM @not-implemented
49 .als CT @not-implemented
53 .if !rPO .nr PO \\n(.o
54 .\" a non-empty environment
62 .ds REFERENCES References
64 .ds TOC Table of Contents
77 .ds MO \\*[MONTH\n[mo]]
78 .ds DY \n[dy] \*[MO] \n[year]
80 .if \\n[.$] .ds DY "\\$*
83 .if \\n[.$] .ds DY "\\$*
88 .tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[PN]
90 .\" print an error message and then try to recover
92 .@error \\$@ (recovering)
95 . \"@warning automatically terminating diversion \\n(.z
96 . ie d @div-end!\\n(.z .@div-end!\\n(.z
97 . el .*div-end-default
99 . \" ensure that we don't loop forever
100 . if \\n[*pop-count]>20 .@fatal recovery failed
102 .while !'\\n[.ev]'0' .ev
114 .\" ****************************
115 .\" ******** module cov ********
116 .\" ****************************
117 .\" Cover sheet and first page.
118 .de cov*err-not-after-first-page
119 .@error \\$0 is not allowed after the first page has started
121 .de cov*err-not-before-tl
122 .@error \\$0 is not allowed before TL
124 .de cov*err-not-again
125 .@error \\$0 is not allowed more than once
127 .de cov*err-not-after-ab
128 .@error \\$0 is not allowed after first AB, LP, PP, IP, SH or NH
130 .als AU cov*err-not-before-tl
131 .als AI cov*err-not-before-tl
132 .als AB cov*err-not-before-tl
133 .de cov*first-page-init
134 .rm cov*first-page-init
136 .als RP cov*err-not-after-first-page
138 .ie \\n[cov*rp-format] \{\
149 .CHECK-FOOTER-AND-KEEP
151 .wh 0 cov*first-page-init
152 .\" This handles the case where FS occurs before TL or LP.
159 .\" released paper format
162 .if \\n[.$] .if '\\$1'no' .nr cov*rp-no 1
168 .als TL cov*err-not-again
172 .if !'\*(.T'html' .di cov*tl-div
188 .di cov*au-div!\\n[cov*n-au]
194 .if !'\*(.T'html' .par@reset
199 .ie !\\n[cov*n-au] .@error AI before AU
201 . di cov*ai-div!\\n[cov*n-au]
228 .als cov*ab-init @nop
246 .als AB cov*err-not-after-ab
257 .if !'\*(.T'html' .di cov*ab-div
271 . als cov*tl-au-print @nop
279 . als AE cov*err-not-again
282 . ie '\\n(.z'cov*ab-div' \{\
283 . als AE cov*err-not-again
286 .\" nr cov*ab-height \\n[dn]
291 . el .@error AE without AB
294 .de @div-end!cov*ab-div
300 . ie \\n[cov*rp-format] .cov*rp-print
301 . el .cov*draft-print
304 . if \\n[cov*rp-format] \{\
305 . @warning RP format but no TL
309 . CHECK-FOOTER-AND-KEEP
315 .nr cov*page-length \\n[.p]
320 . if !'\*(.T'html' . nf
327 .if \\n[cov*fn-height] \{\
328 . sp |(u;\\n[cov*page-length]-\\n[FM]\
329 -\\n[cov*fn-height]-\\n[fn@sep-dist]>?\\n[nl])
334 . ie \\n[cov*rp-no] .rm cov*fn-div
336 . rn cov*fn-div fn@overflow-div
337 . nr fn@have-overflow 1
342 .CHECK-FOOTER-AND-KEEP
343 .\" If anything was printed below where the footer line is normally printed,
344 .\" then that's an overflow.
345 .if -\\n[FM]/2+1v+\\n[cov*page-length]<\\n[nl] .@error cover sheet overflow
346 .pl \\n[cov*page-length]u
348 .if !\\n[cov*rp-no] .cov*tl-au-print
367 .if d cov*tl-div .cov*tl-div
370 .while \\n[cov*i]<=\\n[cov*n-au] \{\
372 . cov*au-div!\\n[cov*i]
373 . ie d cov*ai-div!\\n[cov*i] \{\
375 . cov*ai-div!\\n[cov*i]
385 .\" start of footnote on cover
387 .if \\n[cov*in-fn] \{\
395 .if !\\n[cov*fn-height] .ns
396 .ie \\n[.$] .FP "\\$1" no
399 .de @div-end!cov*fn-div
402 .\" end of footnote on cover
404 .ie '\\n(.z'cov*fn-div' \{\
409 . nr cov*fn-height +\\n[dn]
411 .el .@error FE without matching FS
413 .\" ***************************
414 .\" ******** module pg ********
415 .\" ***************************
416 .\" Page-level formatting.
417 .\" > 0 if we have a footnote on the current page
429 .ds pg*OH '\\*[LH]'\\*[CH]'\\*[RH]'
430 .ds pg*EH '\\*[LH]'\\*[CH]'\\*[RH]'
431 .ds pg*OF '\\*[LF]'\\*[CF]'\\*[RF]'
432 .ds pg*EF '\\*[LF]'\\*[CF]'\\*[RF]'
440 .ie \\n%=1 .if \\n[pg*P1] .tl \\*[pg*OH]
442 . ie o .tl \\*[pg*OH]
454 .wh -\n[FM]u pg@bottom
455 .wh -\n[FM]u/2u pg*footer
459 .if !'\\n(.z'' .error-recover MC while diversion open
461 .ie \\n[pg@ncols]>1 .pg@super-eject
463 . \" flush out any floating keeps
464 . while \\n[kp@tail]>\\n[kp@head] \{\
470 . nr pg@colw \\n[LL]*7/15
471 . nr pg*gutw \\n[LL]-(2*\\n[pg@colw])
475 . nr pg@colw (n;\\$1)<?\\n[LL]
476 . ie \\n[.$]<2 .nr pg*gutw \\n[MINGW]
477 . el .nr pg*gutw (n;\\$2)
478 . nr pg@ncols \\n[LL]-\\n[pg@colw]/(\\n[pg@colw]+\\n[pg*gutw])+1
479 . ie \\n[pg@ncols]>1 \
480 . nr pg*gutw \\n[LL]-(\\n[pg@ncols]*\\n[pg@colw])/(\\n[pg@ncols]-1)
483 .HTML-TAG ".mc \\n[pg@ncols] \\n[pg@colw] \\n[pg*gutw]"
487 .nr pg@fn-colw \\n[pg@colw]*5/6
496 .\" top of page macro
498 .ch pg*footer -\\n[FM]u/2u
501 .nr pg@fn-bottom-margin 0
502 .nr pg*saved-po \\n[PO]
516 .\" Handle footnote overflow before floating keeps, because the keep
517 .\" might contain an embedded footnote.
525 .\" move pg@bottom and pg*footer out of the way
526 .ch pg@bottom \\n[.p]u*2u
527 .ch pg*footer \\n[.p]u*2u
532 .if \\n[pg@fn-flag] .fn@bottom-hook
534 .ie \\n[pg*col-num]<\\n[pg@ncols] .pg*end-col
538 'sp |\\n[pg*col-top]u
539 .po (u;\\n[pg*saved-po]+(\\n[pg@colw]+\\n[pg*gutw]*\\n[pg*col-num]))
540 .\"po +(u;\\n[pg@colw]+\\n[pg*gutw])
544 .po \\n[pg*saved-po]u
545 .\" Make sure we don't exit if there are still floats or footnotes left-over.
546 .ie \\n[kp@head]<\\n[kp@tail]:\\n[fn@have-overflow] \{\
547 . \" Switching environments ensures that we don't get an unnecessary
548 . \" blank line at the top of the page.
554 . \" If the text has ended and there are no more footnotes or keeps, exit.
555 . if \\n[pg@text-ended] .ex
556 . if r pg*next-number \{\
557 . pn \\n[pg*next-number]
559 . if d pg*next-format \{\
560 . af PN \\*[pg*next-format]
567 .\" pg@begin number format
570 . nr pg*next-number (;\\$1)
571 . ie \\n[.$]>1 .ds pg*next-format \\$2
572 . el .rm pg*next-format
574 .el .rr pg*next-number
577 .\" print the footer line
584 .\" flush out any keeps or footnotes
587 .if !'\\n(.z'' .@error-recover diversion open while ejecting page
588 .\" Make sure we stay in the end macro while there is still footnote overflow
589 .\" left, or floating keeps.
590 .while \\n[kp@tail]>\\n[kp@head]:\\n[pg@fn-flag] \{\
603 .\" ***************************
604 .\" ******** module fn ********
605 .\" ***************************
609 .\" Round it vertically
611 .nr fn@sep-dist \n[.v]
615 .ds * \\*[par@sup-start]\En+[fn*text-num]\\*[par@sup-end]
619 .ie \\n[.$] .fn*do-FS "\\$1" no
621 . ie \\n[fn*text-num]>\\n[fn*note-num] .fn*do-FS \\n+[fn*note-num]
625 .\" Second argument of `no' means don't embellish the first argument.
627 .if \\n[fn*open] .@error-recover nested FS
630 . \" Ensure that the first line of the footnote is on the same page
631 . \" as the reference. I think this is minimal.
635 . ie \\n[pg@fn-flag] .nr fn*need +\\n[fn:PD]
636 . el .nr fn*need +\\n[fn@sep-dist]
637 . ne \\n[fn*need]u+\\n[.V]u>?0
647 .ie !\\n[fn*open] .@error FE without FS
655 .nr fn@have-overflow 0
656 .\" called at the top of each column
659 .nr fn*page-bottom-pos 0-\\n[FM]-\\n[pg@fn-bottom-margin]
660 .ch pg@bottom \\n[fn*page-bottom-pos]u
661 .if \\n[fn@have-overflow] \{\
662 . nr fn@have-overflow 0
670 .\" This is called at the bottom of the column if pg@fn-flag is set.
673 .nr fn@have-overflow 0
674 .nr fn@bottom-pos \\n[.p]-\\n[FM]-\\n[pg@fn-bottom-margin]+\\n[.v]
676 .nr fn@bottom-pos -\\n[.v]
678 .ie \\n[nl]+\\n[fn@sep-dist]+\n[.V]>\\n[fn@bottom-pos] \{\
679 . rn fn@div fn@overflow-div
680 . nr fn@have-overflow 1
683 . if \\n[pg@ncols]>1 \
684 . if \\n[fn*max-width]>\\n[pg@fn-colw] \
685 . nr pg@fn-bottom-margin \\n[.p]-\\n[FM]-\\n[nl]+1v
686 . wh \\n[fn@bottom-pos]u fn*catch-overflow
692 . if '\\n(.z'fn@overflow-div' \{\
694 . nr fn@have-overflow \\n[dn]>0
696 . ch fn*catch-overflow
699 .de fn*catch-overflow
705 .if '\\n[.ev]'fn' .ev
709 .als @div-end!fn*embed-div @div-end!fn@div
713 . if !\\n[pg@fn-flag] .ns
718 .ie '\\n(.z'fn@div' \{\
720 . nr fn*page-bottom-pos -\\n[dn]
721 . nr fn*max-width \\n[fn*max-width]>?\\n[dl]
722 . if !\\n[pg@fn-flag] .nr fn*page-bottom-pos -\\n[fn@sep-dist]
724 . nr fn*page-bottom-pos \\n[nl]-\\n[.p]+\n[.V]>?\\n[fn*page-bottom-pos]
725 . ch pg@bottom \\n[fn*page-bottom-pos]u
728 . ie '\\n(.z'fn*embed-div' \{\
730 . rn fn*embed-div fn*embed-div!\\n[fn*embed-count]
731 \!. fn*embed-start \\n[fn*embed-count]
733 ' sp (u;\\n[dn]+\\n[fn@sep-dist]+\\n[.V])
735 . nr fn*embed-count +1
739 . @error-recover unclosed diversion within footnote
748 . rm fn*embed-div!\\$1
754 \!. fn*embed-start \\$1
759 .ie '\\n(.z'fn*null' \{\
765 .\" It's important that fn@print-sep use up exactly fn@sep-dist vertical space.
769 .vs \\n[fn@sep-dist]u
774 .\" ***************************
775 .\" ******** module kp ********
776 .\" ***************************
783 .if !'\\n(.z'' .@error-recover KF while open diversion
790 .ie '\\n(.z'kp*div' .kp*end
792 . ie '\\n(.z'kp*fdiv' .kp*fend
793 . el .@error KE without KS or KF
803 .ie '\\n(.z'' .ds@need \\$1
806 .\" end non-floating keep
819 .\" end floating keep
824 .ie \\n[.t]-(\\n[.k]>0*1v)>\\n[dn] \{\
832 . rn kp*fdiv kp*div!\\n[kp@tail]
833 . nr kp*ht!\\n[kp@tail] 0\\n[dn]
837 .\" top of page processing for KF
840 .if !\\n[kp*doing-top] \{\
847 .\" If the first keep won't fit, only force it out if we haven't had a footnote
848 .\" and we're at the top of the page.
849 .nr kp*force \\n[pg@fn-flag]=0&(\\n[nl]<=\\n[pg@header-bottom])
851 .while \\n[kp@tail]>\\n[kp@head]&\\n[kp*fits] \{\
852 . ie \\n[.t]>\\n[kp*ht!\\n[kp@head]]:\\n[kp*force] \{\
854 . \" It's important to advance kp@head before bringing
855 . \" back the keep, so that if the last line of the
856 . \" last keep springs the bottom of page trap, a new
857 . \" page will not be started unnecessarily.
858 . rn kp*div!\\n[kp@head] kp*temp
868 .\" ***************************
869 .\" ******** module ds ********
870 .\" ***************************
871 .\" Displays and non-floating keeps.
873 .ds*end!\\n[\\n[.ev]:ds-type]
874 .nr \\n[.ev]:ds-type 0
878 .if \\n[\\n[.ev]:ds-type] \{\
879 . @error automatically terminating display
884 .ie \\n[\\n[.ev]:ds-type] .DE
888 .@error DE without DS, ID, CD, LD or BD
892 .nr \\n[.ev]:ds-type 1
899 .ie \\n[.$] .in +(n;\\$1)
914 .als ds*end!1 ds*common-end
917 .nr \\n[.ev]:ds-type 2
922 .ie '\\n(.z'ds*div' \{\
925 . in (u;\\n[.l]-\\n[dl]/2>?0)
930 .el .@error-recover mismatched DE
937 . nr \\n[.ev]:ds-type 4
946 . ie '\\$1'I' .ID \\$2
951 . nr \\n[.ev]:ds-type 3
957 . while \\n[.t]<=(\\$1)&(\\n[nl]>\\n[pg@header-bottom]) \{\
965 .ie '\\n(.z'ds*div' \{\
974 .el .@error-recover mismatched DE
977 .ie '\\n(.z'ds*div' \{\
981 . in (u;\\n[.l]-\\n[dl]/2>?0)
987 .el .@error-recover mismatched DE
989 .\" ****************************
990 .\" ******** module par ********
991 .\" ****************************
992 .\" Paragraph-level formatting.
993 .\" Load time initialization.
995 .\" PS and VS might have been set on the command-line
999 .\" don't set LT so that it can be defaulted from LL
1000 .ie rLT .lt \\n[LT]u
1003 .\" don't set VS so that it can be defaulted from PS
1004 .ie rVS .par*vs \\n[VS]
1005 .el .par*vs \\n[PS]+2
1006 .if dFAM .fam \\*[FAM]
1010 .CHECK-FOOTER-AND-KEEP
1013 .\" If it's too big to be in points, treat it as units.
1014 .ie (p;\\$1)>=40p .vs (u;\\$1)
1018 .nr 0:li (u;\\n[LL]/12)
1025 .aln \\n[.ev]:MCLL LL
1027 .aln \\n[.ev]:MCLT LT
1033 .\" happens when the first page begins
1035 .if !rLT .nr LT \\n[LL]
1036 .if !rFL .nr FL \\n[LL]*5/6
1037 .if !rVS .nr VS \\n[PS]+2
1039 .if !rFPS .nr FPS \\n[PS]-2
1040 .if !rFVS .nr FVS \\n[FPS]+2
1041 .\" don't change environment 0
1047 .if !rPD .nr PD .3v>?\n(.V
1048 .if !rDD .nr DD .5v>?\n(.V
1050 .if !rFPD .nr FPD \\n[PD]/2
1052 .if !dFAM .ds FAM \\n[.fam]
1074 .aln fn:MCLL pg@fn-colw
1075 .aln fn:MCLT pg@fn-colw
1081 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1084 .nr \\n[.ev]:ds-type 0
1093 .ie \\n[pg@ncols]>1 \{\
1094 . ll (u;\\n[\\n[.ev]:MCLL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1095 . lt \\n[\\n[.ev]:MCLT]u
1098 . ll (u;\\n[\\n[.ev]:LL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1099 . lt \\n[\\n[.ev]:LT]u
1101 .in (u;\\n[\\n[.ev]:li]+\\n[\\n[.ev]:pli])
1104 .ps \\n[\\n[.ev]:PS]
1105 .par*vs \\n[\\n[.ev]:VS]
1115 .\" This can be redefined by the user.
1121 .nr \\n[.ev]:pli \\$1
1122 .nr \\n[.ev]:pri \\$2
1124 .sp \\n[\\n[.ev]:PD]u
1135 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1139 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1140 .if !'\*(.T'html' .ti +\\n[\\n[.ev]:ai]u
1143 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1144 .par*start \\n[QI] \\n[QI]
1147 .par*start \\n[\\n[.ev]:PI] 0
1148 .ti -\\n[\\n[.ev]:PI]u
1151 .if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
1152 .par*start \\n[\\n[.ev]:ai] 0
1154 . \" Divert the label so as to freeze any spaces.
1161 . ti -\\n[\\n[.ev]:ai]u
1162 . ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \\*[par*label]\h'|\\n[\\n[.ev]:ai]u'\c
1171 .if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
1172 .par*start \\n[\\n[.ev]:ai] 0
1174 . \" Divert the label so as to freeze any spaces.
1181 . ti -\\n[\\n[.ev]:ai]u
1182 . ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \{\
1183 . HTML-TAG-NS ".col 1"
1184 \\$1\h'|\\n[\\n[.ev]:ai]u'\c
1185 . HTML-TAG-NS ".col 2"
1194 .\" We don't want margin characters to be attached when we divert
1195 .\" the tag. Since there's no way to save and restore the current
1196 .\" margin character, we have to switch to a new environment, taking
1197 .\" what we need of the old environment with us.
1198 .de par*push-tag-env
1199 .nr par*saved-font \\n[.f]
1200 .nr par*saved-size \\n[.s]z
1201 .nr par*saved-ss \\n[.ss]
1202 .ds par*saved-fam \\n[.fam]
1206 .ft \\n[par*saved-font]
1207 .ps \\n[par*saved-size]u
1208 .ss \\n[par*saved-ss]
1209 .fam \\*[par*saved-fam]
1216 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1217 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1218 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1219 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1220 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1222 .nr \\n[.ev]:li +\\n[\\n[.ev]:ai]
1223 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1228 .ie \\n[\\n[.ev]:il] \{\
1230 . nr \\n[.ev]:ai \\n[\\n[.ev]:ai!\\n[\\n[.ev]:il]]
1231 . nr \\n[.ev]:li \\n[\\n[.ev]:li!\\n[\\n[.ev]:il]]
1232 . nr \\n[.ev]:ri \\n[\\n[.ev]:ri!\\n[\\n[.ev]:il]]
1233 . nr \\n[.ev]:pli \\n[\\n[.ev]:pli!\\n[\\n[.ev]:il]]
1234 . nr \\n[.ev]:pri \\n[\\n[.ev]:pri!\\n[\\n[.ev]:il]]
1236 .el .@error unbalanced \\$0
1241 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1242 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1243 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1244 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1245 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1247 .nr \\n[.ev]:li +\\n[QI]
1248 .nr \\n[.ev]:ri +\\n[QI]
1249 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1253 .\" start boxed text
1260 .nr par*box-in \\n[.in]
1261 .\" remember what 1n is, just in case the point size changes
1266 .ti \\n[par*box-in]u+1n
1268 .de @div-end!par*box-div
1272 .\" Postpone the drawing of the box until we're in the top-level diversion,
1273 .\" in case there's a footnote inside the box.
1275 .ie '\\n(.z'par*box-div' \{\
1277 . if \n[.V]>.25m .sp
1279 . if \n[.V]>.25m .sp
1285 . nr \\n[.ev]:ri -\\n[par*box-n]
1286 . nr \\n[.ev]:li -\\n[par*box-n]
1287 . in -\\n[par*box-n]u
1288 . ll +\\n[par*box-n]u
1289 . lt +\\n[par*box-n]u
1290 . par*box-draw \\n[.i]u \\n[.l]u-(\\n[.H]u==1n*1n)
1292 .el .@error B2 without B1
1295 .de par*box-mark-top
1300 .el \!.par*box-mark-top
1304 . nr par*box-in \\n[.i]
1305 . nr par*box-ll \\n[.l]
1306 . nr par*box-vpt \\n[.vpt]
1307 . nr par*box-ad \\n[.j]
1313 \D'l (u;\\n[.l]-\\n[.i]) 0'\
1314 \D'l 0 |\\n[par*box-top]u'\
1315 \D'l -(u;\\n[.l]-\\n[.i]) 0'\
1316 \D'l 0 -|\\n[par*box-top]u'
1319 . in \\n[par*box-in]u
1320 . ll \\n[par*box-ll]u
1321 . vpt \\n[par*box-vpt]
1322 . ad \\n[par*box-ad]
1324 .el \!.par*box-draw \\$1 \\$2
1328 .\" Keep together the heading and the first two lines of the next paragraph.
1329 .ne 3v+\\n[\\n[.ev]:PD]u+\\n(.Vu
1337 .\" TL, AU, and AI are aliased to these in cov*ab-init.
1358 .\" In paragraph macros.
1360 .ps \\n[\\n[.ev]:PS]
1371 .\" par*define-font-macro macro font
1372 .de par*define-font-macro
1375 . nr par*prev-font \\\\n[.f]
1376 \&\\\\$3\f[\\$2]\\\\$1\f[\\\\n[par*prev-font]]\\\\$2
1381 .par*define-font-macro B B
1382 .par*define-font-macro I I
1383 .par*define-font-macro BI BI
1384 .par*define-font-macro CW CR
1385 .\" underline a word
1387 \Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m'\\$2
1391 .nr par*bxw \w'\\$1'+.4m
1392 \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''\
1396 .\" The first time UX is used, put a registered mark after it.
1399 \s[\\n[.s]*8u/10u]UNIX\s0\\$1\\*[par*ux-rg]
1402 .ds par@sup-start \v'-.9m\s'\En[.s]*7u/10u'+.7m'
1403 .als { par@sup-start
1404 .ds par@sup-end \v'-.7m\s0+.9m'
1406 .\" footnote paragraphs
1407 .\" FF is the footnote format
1409 .\" This can be redefined. It gets a second argument of `no' if the first
1410 .\" argument was supplied by the user, rather than automatically.
1413 .if !d par*fp!\\n[FF] \{\
1414 . @error unknown footnote format `\\n[FF]'
1417 .ie '\\$2'no' .par*fp!\\n[FF]-no "\\$1"
1418 .el .par*fp!\\n[FF] "\\$1"
1422 \&\\*[par@sup-start]\\$1\\*[par@sup-end]\ \c
1445 .@IP "\\$1." (u;\\n[\\n[.ev]:PI]*2)
1448 .@IP "\\$1" (u;\\n[\\n[.ev]:PI]*2)
1450 .\" ***************************
1451 .\" ******** module nh ********
1452 .\" ***************************
1453 .\" Numbered headings.
1454 .\" nh*hl is the level of the last heading
1456 .\" numbered heading
1463 . nr H\\n[nh*hl] 0\\$1
1466 . if !\\n[nh*hl] \{\
1469 . @error missing arguments to .NH S
1473 . nr nh*ohl \\n[nh*hl]
1476 . ie \\n[nh*hl]<=0 \{\
1481 . if \\n[nh*hl]-\\n[nh*ohl]>1 \
1482 . @warning .NH \\n[nh*ohl] followed by .NH \\n[nh*hl]
1486 . while \\n[nh*hl]>\\n[nh*ohl] \{\
1494 .while \\n[nh*i]<\\n[nh*hl] \{\
1496 . as SN \\n[H\\n[nh*i]].
1499 .HTML-TAG ".NH \\$1"
1502 .\" ****************************
1503 .\" ******** module toc ********
1504 .\" ****************************
1505 .\" Table of contents generation.
1509 .ie \\n[.$] .XA "\\$1"
1512 .de @div-end!toc*div
1516 .ie '\\n(.z'toc*div' \{\
1517 . if d toc*num .toc*end-entry
1519 . ie '\\$1'no' .ds toc*num
1520 . el .ds toc*num "\\$1
1522 . el .ds toc*num \\n[PN]
1529 .el .@error XA without XS
1532 .ie '\\n(.z'toc*div' \{\
1533 . if d toc*num .toc*end-entry
1537 .el .@error XE without XS
1555 .char \[toc*leader-char] .\h'1m'
1556 .lc \[toc*leader-char]
1557 .ta (u;\\n[.l]-\\n[.i]-\w'000') (u;\\n[.l]-\\n[.i])R
1562 .\" print the table of contents on page i
1568 .\" ****************************
1569 .\" ******** module eqn ********
1570 .\" ****************************
1579 .ie '\\$1'L' .nr eqn*type 0
1581 . ie '\\$1'I' .nr eqn*type 1
1584 . if !'\\$1'C' .ds eqn*num "\\$1
1589 .if \\n[eqn*type]=0 .HTML-IMAGE-LEFT
1590 .if \\n[eqn*type]=1 \{\
1591 . if '\*(.T'html' .RS
1594 .if \\n[eqn*type]=2 .HTML-IMAGE
1595 .if !'\*(.T'html' .nf
1597 .de @div-end!eqn*div
1600 .\" Note that geqn mark and lineup work correctly in centered equations.
1602 .ie !'\\n(.z'eqn*div' .@error-recover mismatched EN
1607 . if !'\\*[eqn*num]'' .nr eqn*have-num 1
1608 . ie \\n[dl]:\\n[eqn*have-num] \{\
1609 . if !'\*(.T'html' .sp \\n[DD]u
1611 . ds eqn*tabs \\n[.tabs]
1614 .\" --fixme-- this really should not be necessary
1615 .\" and indicates that there is extra space creeping into
1616 .\" an equation when ps4html is enabled..
1617 . ie r ps4html .ds@need \\n[dn]u-1v+\n[.V]u+1i
1618 . el .ds@need \\n[dn]u-1v+\n[.V]u
1620 . ie \\n[eqn*type]=0 \{\
1621 . ta (u;\\n[.l]-\\n[.i])R
1622 \\*[eqn*div]\t\\*[eqn*num]
1625 . ie \\n[eqn*type]=1 .ta \\n[DI]u \
1626 (u;\\n[.l]-\\n[.i])R
1627 . el .ta (u;\\n[.l]-\\n[.i]/2)C \
1628 (u;\\n[.l]-\\n[.i])R
1629 \t\\*[eqn*div]\t\\*[eqn*num]
1633 . ta (u;\\n[.l]-\\n[.i])R
1636 . if !'\*(.T'html' .sp \\n[DD]u
1640 .\" must terminate empty equations in html and ps4html as they contain
1641 .\" the HTML-IMAGE-END suppression nodes
1642 . if \\n[dl] .chop eqn*div
1643 . if '\*(.T'html' \\*[eqn*div]
1644 . if r ps4html \\*[eqn*div]
1646 . if !'\*(.T'html' .fi
1647 . if \\n[eqn*type]=0 .HTML-IMAGE-END
1648 . if \\n[eqn*type]=1 \{\
1650 . if '\*(.T'html' .RE
1652 . if \\n[eqn*type]=2 .HTML-IMAGE-END
1655 .\" ****************************
1656 .\" ******** module tbl ********
1657 .\" ****************************
1659 .nr tbl*have-header 0
1660 .\" This gets called if TS occurs before the first paragraph.
1663 .\" cov*ab-init aliases TS to @TS
1668 .\" .if !'\*(.T'html' .sp \\n[DD]u
1669 .if '\\$1'H' .di tbl*header-div
1673 .if \\n[tbl*have-header] \{\
1674 . ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl*print-header
1678 .de tbl*print-header
1685 .ie '\\n[.z]'tbl*header-div' \{\
1690 . ie \\n[dn]+\\n[FM]+\\n[HM]+2v>=\\n[.p] \{\
1691 . @error ridiculously long table header
1696 . nr tbl*header-ht \\n[dn]
1697 . ds@need \\n[dn]u+1v
1699 . nr tbl*have-header 1
1702 .el .@error-recover .TH without .TS H
1704 .de @div-end!tbl*header-div
1709 .ie '\\n(.z'tbl*header-div' .@error-recover .TS H but no .TH before .TE
1711 . nr tbl*have-header 0
1712 . if !'\*(.T'html' .sp \\n[DD]u
1719 .if \\n[tbl*have-header] \{\
1726 .\" ****************************
1727 .\" ******** module pic ********
1728 .\" ****************************
1734 .ie \\n[.$]<2 .@error bad arguments to PS (not preprocessed with pic?)
1736 . ds@need (u;\\$1)+1v
1737 . in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)
1746 .\" ****************************
1747 .\" ******** module ref ********
1748 .\" ****************************
1751 .rm [A [B [C [D [E [G [I [J [N [O [P [Q [R [S [T [V
1755 .ds ref*spec!0 Q A T1 S V N P I C D O
1757 .ds ref*spec!1 Q A T2 J S V N P I C D O
1759 .ds ref*spec!2 Q A T1 S V P I C D O
1760 .\" Article within book
1761 .ds ref*spec!3 Q A T2 B E S V P I C D O
1763 .ds ref*spec!4 Q A T2 R G P I C D O
1770 .ie d ref*spec!\\$1 .ref*build \\*[ref*spec!\\$1]
1772 . @error unknown reference type `\\$1'
1773 . ref*build \\*[ref*spec!0]
1779 .\" start of reference number
1780 .ds [. \\*[par@sup-start]
1781 .\" end of reference number
1782 .ds .] \\*[par@sup-end]
1783 .\" period before reference
1785 .\" period after reference
1787 .\" comma before reference
1789 .\" comma after reference
1791 .\" start collected references
1793 .als ref*print ref*end-print
1798 .\" end collected references
1801 .als ref*print ref*normal-print
1803 .de ref*normal-print
1804 .ie d [F .FS "\\*([.\\*([F\\*(.]"
1810 .ie d [F .IP "\\*([F."
1814 .als ref*print ref*normal-print
1816 .rm ref*string ref*post-punct
1817 .nr ref*suppress-period 1
1820 . ie d ref*add-\\$1 .ref*add-\\$1
1821 . el .ref*add-dflt \\$1
1825 .\" now add a final period
1826 .ie d ref*string \{\
1827 . if !\\n[ref*suppress-period] .as ref*string .
1828 . if d ref*post-punct \{\
1829 . as ref*string "\\*[ref*post-punct]
1836 .ref*field T , "\fI" "" "\fP"
1837 .if r [T .nr ref*suppress-period \\n([T
1840 .ref*field T , "\\*Q" "" "\\*U"
1841 .if r [T .nr ref*suppress-period \\n([T
1844 .ie \\n([P>0 .ref*field P , "pp. "
1845 .el .ref*field P , "p. "
1848 .ref*field J , \fI "" \fP
1854 .ref*field E , "ed. "
1860 .ref*field B "" "in \fI" "" \fP
1864 .ie r [O .nr ref*suppress-period \\n([O
1865 .el .nr ref*suppress-period 1
1869 .if r [A .nr ref*suppress-period \\n([A
1874 .\" First argument is the field letter.
1875 .\" Second argument is the punctuation character to use to separate this field
1876 .\" from the previous field.
1877 .\" Third argument is a string with which to prefix this field.
1878 .\" Fourth argument is a string with which to postfix this field.
1879 .\" Fifth argument is a string to add after the punctuation character supplied
1880 .\" by the next field.
1882 .if d ref*string \{\
1883 . ie d ref*post-punct \{\
1884 . as ref*string "\\$2\\*[ref*post-punct] \"
1887 . el .as ref*string "\\$2 \"
1889 .as ref*string "\\$3\\*([\\$1\\$4
1890 .if \\n[.$]>4 .ds ref*post-punct "\\$5
1891 .nr ref*suppress-period 0
1893 .\" ****************************
1894 .\" ******** module acc ********
1895 .\" ****************************
1896 .\" Accents and special characters.
1901 .\" The idea of this definition is for the top of the 3 to be at the x-height.
1902 .if !c\[yogh] .char \[yogh] \Z'\v'\w'x'*0-\En[rst]u'\s[\En[.s]*8u/10u]\
1903 \v'\w'3'*0+\En[rst]u'3\s0'\h'\w'\s[\En[.s]*8u/10u]3'u'
1906 .ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
1907 \h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
1910 .ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
1913 .ds \\$1 \Z'\h'(u;-\En[.w]-\w'\\$2'/2)'\
1914 \v'(u;\En[.cdp]-\En[.cht]+\En[rst]+\En[rsb]/2)'\\$2'
1917 .ds \\$1 \Z'\h'(u;\w'x'-\w'\\$2'/2)'\\$2'
1919 .acc*prefix-def ' \'
1920 .acc*prefix-def ` \`
1922 .acc*prefix-def , \(ac
1923 .acc*prefix-def : \(ad
1925 .\" improved accent marks
1931 .acc*over-def : \(ad
1932 .acc*over-def v \(ah
1933 .acc*over-def _ \(a-
1934 .acc*over-def o \(ao
1935 .acc*under-def , \(ac
1936 .acc*under-def . \s[\En[.s]*8u/10u]\v'.2m'.\v'-.2m'\s0
1937 .acc*under-def hook \(ho
1939 .char \[hooko] o\\\\*[hook]
1942 .ds D- \(-D\" Icelandic uppercase eth
1943 .ds d- \(Sd\" Icelandic lowercase eth
1944 .ds Th \(TP\" Icelandic uppercase thorn
1945 .ds th \(Tp\" Icelandic lowercase thorn
1946 .ds 8 \(ss\" German double s
1947 .ds Ae \(AE\" AE ligature
1948 .ds ae \(ae\" ae ligature
1949 .ds Oe \(OE\" OE ligature
1950 .ds oe \(oe\" oe ligature
1951 .ds ? \(r?\" upside down ?
1952 .ds ! \(r!\" upside down !
1954 .de CHECK-FOOTER-AND-KEEP
1955 .\" it might be better to als FS -> B1 and FE -> B2
1956 .\" however this produced wierd results, so I've moved back to a more reliable
1957 .\" but less interesting solution --fixme--
1958 . if '\*(.T'html' \{\
1986 .if '\*(.T'html' \{\
1990 .\" Make sure that no blank lines creep in at the end of this file.