6 Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002
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
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
167 .als TL cov*err-not-again
171 .if !'\*(.T'html' .di cov*tl-div
187 .di cov*au-div!\\n[cov*n-au]
193 .if !'\*(.T'html' .par@reset
198 .ie !\\n[cov*n-au] .@error AI before AU
200 . di cov*ai-div!\\n[cov*n-au]
227 .als cov*ab-init @nop
245 .als AB cov*err-not-after-ab
256 .if !'\*(.T'html' .di cov*ab-div
270 . als cov*tl-au-print @nop
278 . als AE cov*err-not-again
281 . ie '\\n(.z'cov*ab-div' \{\
282 . als AE cov*err-not-again
285 .\" nr cov*ab-height \\n[dn]
290 . el .@error AE without AB
293 .de @div-end!cov*ab-div
299 . ie \\n[cov*rp-format] .cov*rp-print
300 . el .cov*draft-print
303 . if \\n[cov*rp-format] \{\
304 . @warning RP format but no TL
308 . CHECK-FOOTER-AND-KEEP
314 .nr cov*page-length \\n[.p]
319 . if !'\*(.T'html' . nf
326 .if \\n[cov*fn-height] \{\
327 . sp |(u;\\n[cov*page-length]-\\n[FM]\
328 -\\n[cov*fn-height]-\\n[fn@sep-dist]>?\\n[nl])
333 . ie \\n[cov*rp-no] .rm cov*fn-div
335 . rn cov*fn-div fn@overflow-div
336 . nr fn@have-overflow 1
341 .CHECK-FOOTER-AND-KEEP
342 .\" If anything was printed below where the footer line is normally printed,
343 .\" then that's an overflow.
344 .if -\\n[FM]/2+1v+\\n[cov*page-length]<\\n[nl] .@error cover sheet overflow
345 .pl \\n[cov*page-length]u
347 .if !\\n[cov*rp-no] .cov*tl-au-print
366 .if d cov*tl-div .cov*tl-div
369 .while \\n[cov*i]<=\\n[cov*n-au] \{\
371 . cov*au-div!\\n[cov*i]
372 . ie d cov*ai-div!\\n[cov*i] \{\
374 . cov*ai-div!\\n[cov*i]
384 .\" start of footnote on cover
386 .if \\n[cov*in-fn] \{\
394 .if !\\n[cov*fn-height] .ns
395 .ie \\n[.$] .FP "\\$1" no
398 .de @div-end!cov*fn-div
401 .\" end of footnote on cover
403 .ie '\\n(.z'cov*fn-div' \{\
408 . nr cov*fn-height +\\n[dn]
410 .el .@error FE without matching FS
412 .\" ***************************
413 .\" ******** module pg ********
414 .\" ***************************
415 .\" Page-level formatting.
416 .\" > 0 if we have a footnote on the current page
428 .ds pg*OH '\\*[LH]'\\*[CH]'\\*[RH]'
429 .ds pg*EH '\\*[LH]'\\*[CH]'\\*[RH]'
430 .ds pg*OF '\\*[LF]'\\*[CF]'\\*[RF]'
431 .ds pg*EF '\\*[LF]'\\*[CF]'\\*[RF]'
439 .ie \\n%=1 .if \\n[pg*P1] .tl \\*[pg*OH]
441 . ie o .tl \\*[pg*OH]
453 .wh -\n[FM]u pg@bottom
454 .wh -\n[FM]u/2u pg*footer
458 .if !'\\n(.z'' .error-recover MC while diversion open
460 .ie \\n[pg@ncols]>1 .pg@super-eject
462 . \" flush out any floating keeps
463 . while \\n[kp@tail]>\\n[kp@head] \{\
469 . nr pg@colw \\n[LL]*7/15
470 . nr pg*gutw \\n[LL]-(2*\\n[pg@colw])
474 . nr pg@colw (n;\\$1)<?\\n[LL]
475 . ie \\n[.$]<2 .nr pg*gutw \\n[MINGW]
476 . el .nr pg*gutw (n;\\$2)
477 . nr pg@ncols \\n[LL]-\\n[pg@colw]/(\\n[pg@colw]+\\n[pg*gutw])+1
478 . ie \\n[pg@ncols]>1 \
479 . nr pg*gutw \\n[LL]-(\\n[pg@ncols]*\\n[pg@colw])/(\\n[pg@ncols]-1)
482 .HTML-TAG ".mc \\n[pg@ncols] \\n[pg@colw] \\n[pg*gutw]"
486 .nr pg@fn-colw \\n[pg@colw]*5/6
495 .\" top of page macro
497 .ch pg*footer -\\n[FM]u/2u
500 .nr pg@fn-bottom-margin 0
501 .nr pg*saved-po \\n[PO]
515 .\" Handle footnote overflow before floating keeps, because the keep
516 .\" might contain an embedded footnote.
524 .\" move pg@bottom and pg*footer out of the way
525 .ch pg@bottom \\n[.p]u*2u
526 .ch pg*footer \\n[.p]u*2u
531 .if \\n[pg@fn-flag] .fn@bottom-hook
533 .ie \\n[pg*col-num]<\\n[pg@ncols] .pg*end-col
537 'sp |\\n[pg*col-top]u
538 .po (u;\\n[pg*saved-po]+(\\n[pg@colw]+\\n[pg*gutw]*\\n[pg*col-num]))
539 .\"po +(u;\\n[pg@colw]+\\n[pg*gutw])
543 .po \\n[pg*saved-po]u
544 .\" Make sure we don't exit if there are still floats or footnotes left-over.
545 .ie \\n[kp@head]<\\n[kp@tail]:\\n[fn@have-overflow] \{\
546 . \" Switching environments ensures that we don't get an unnecessary
547 . \" blank line at the top of the page.
553 . \" If the text has ended and there are no more footnotes or keeps, exit.
554 . if \\n[pg@text-ended] .ex
555 . if r pg*next-number \{\
556 . pn \\n[pg*next-number]
558 . if d pg*next-format \{\
559 . af PN \\*[pg*next-format]
566 .\" pg@begin number format
569 . nr pg*next-number (;\\$1)
570 . ie \\n[.$]>1 .ds pg*next-format \\$2
571 . el .rm pg*next-format
573 .el .rr pg*next-number
576 .\" print the footer line
583 .\" flush out any keeps or footnotes
586 .if !'\\n(.z'' .@error-recover diversion open while ejecting page
587 .\" Make sure we stay in the end macro while there is still footnote overflow
588 .\" left, or floating keeps.
589 .while \\n[kp@tail]>\\n[kp@head]:\\n[pg@fn-flag] \{\
602 .\" ***************************
603 .\" ******** module fn ********
604 .\" ***************************
608 .\" Round it vertically
610 .nr fn@sep-dist \n[.v]
614 .ds * \\*[par@sup-start]\En+[fn*text-num]\\*[par@sup-end]
618 .ie \\n[.$] .fn*do-FS "\\$1" no
620 . ie \\n[fn*text-num]>\\n[fn*note-num] .fn*do-FS \\n+[fn*note-num]
624 .\" Second argument of `no' means don't embellish the first argument.
626 .if \\n[fn*open] .@error-recover nested FS
629 . \" Ensure that the first line of the footnote is on the same page
630 . \" as the reference. I think this is minimal.
634 . ie \\n[pg@fn-flag] .nr fn*need +\\n[fn:PD]
635 . el .nr fn*need +\\n[fn@sep-dist]
636 . ne \\n[fn*need]u+\\n[.V]u>?0
646 .ie !\\n[fn*open] .@error FE without FS
654 .nr fn@have-overflow 0
655 .\" called at the top of each column
658 .nr fn*page-bottom-pos 0-\\n[FM]-\\n[pg@fn-bottom-margin]
659 .ch pg@bottom \\n[fn*page-bottom-pos]u
660 .if \\n[fn@have-overflow] \{\
661 . nr fn@have-overflow 0
669 .\" This is called at the bottom of the column if pg@fn-flag is set.
672 .nr fn@have-overflow 0
673 .nr fn@bottom-pos \\n[.p]-\\n[FM]-\\n[pg@fn-bottom-margin]+\\n[.v]
675 .nr fn@bottom-pos -\\n[.v]
677 .ie \\n[nl]+\\n[fn@sep-dist]+\n[.V]>\\n[fn@bottom-pos] \{\
678 . rn fn@div fn@overflow-div
679 . nr fn@have-overflow 1
682 . if \\n[pg@ncols]>1 \
683 . if \\n[fn*max-width]>\\n[pg@fn-colw] \
684 . nr pg@fn-bottom-margin \\n[.p]-\\n[FM]-\\n[nl]+1v
685 . wh \\n[fn@bottom-pos]u fn*catch-overflow
691 . if '\\n(.z'fn@overflow-div' \{\
693 . nr fn@have-overflow \\n[dn]>0
695 . ch fn*catch-overflow
698 .de fn*catch-overflow
704 .if '\\n[.ev]'fn' .ev
708 .als @div-end!fn*embed-div @div-end!fn@div
712 . if !\\n[pg@fn-flag] .ns
717 .ie '\\n(.z'fn@div' \{\
719 . nr fn*page-bottom-pos -\\n[dn]
720 . nr fn*max-width \\n[fn*max-width]>?\\n[dl]
721 . if !\\n[pg@fn-flag] .nr fn*page-bottom-pos -\\n[fn@sep-dist]
723 . nr fn*page-bottom-pos \\n[nl]-\\n[.p]+\n[.V]>?\\n[fn*page-bottom-pos]
724 . ch pg@bottom \\n[fn*page-bottom-pos]u
727 . ie '\\n(.z'fn*embed-div' \{\
729 . rn fn*embed-div fn*embed-div!\\n[fn*embed-count]
730 \!. fn*embed-start \\n[fn*embed-count]
732 ' sp (u;\\n[dn]+\\n[fn@sep-dist]+\\n[.V])
734 . nr fn*embed-count +1
738 . @error-recover unclosed diversion within footnote
747 . rm fn*embed-div!\\$1
753 \!. fn*embed-start \\$1
758 .ie '\\n(.z'fn*null' \{\
764 .\" It's important that fn@print-sep use up exactly fn@sep-dist vertical space.
768 .vs \\n[fn@sep-dist]u
773 .\" ***************************
774 .\" ******** module kp ********
775 .\" ***************************
782 .if !'\\n(.z'' .@error-recover KF while open diversion
789 .ie '\\n(.z'kp*div' .kp*end
791 . ie '\\n(.z'kp*fdiv' .kp*fend
792 . el .@error KE without KS or KF
802 .ie '\\n(.z'' .ds@need \\$1
805 .\" end non-floating keep
818 .\" end floating keep
823 .ie \\n[.t]-(\\n[.k]>0*1v)>\\n[dn] \{\
831 . rn kp*fdiv kp*div!\\n[kp@tail]
832 . nr kp*ht!\\n[kp@tail] 0\\n[dn]
836 .\" top of page processing for KF
839 .if !\\n[kp*doing-top] \{\
846 .\" If the first keep won't fit, only force it out if we haven't had a footnote
847 .\" and we're at the top of the page.
848 .nr kp*force \\n[pg@fn-flag]=0&(\\n[nl]<=\\n[pg@header-bottom])
850 .while \\n[kp@tail]>\\n[kp@head]&\\n[kp*fits] \{\
851 . ie \\n[.t]>\\n[kp*ht!\\n[kp@head]]:\\n[kp*force] \{\
853 . \" It's important to advance kp@head before bringing
854 . \" back the keep, so that if the last line of the
855 . \" last keep springs the bottom of page trap, a new
856 . \" page will not be started unnecessarily.
857 . rn kp*div!\\n[kp@head] kp*temp
867 .\" ***************************
868 .\" ******** module ds ********
869 .\" ***************************
870 .\" Displays and non-floating keeps.
872 .ds*end!\\n[\\n[.ev]:ds-type]
873 .nr \\n[.ev]:ds-type 0
877 .if \\n[\\n[.ev]:ds-type] \{\
878 . @error automatically terminating display
883 .ie \\n[\\n[.ev]:ds-type] .DE
887 .@error DE without DS, ID, CD, LD or BD
891 .nr \\n[.ev]:ds-type 1
898 .ie \\n[.$] .in +(n;\\$1)
913 .als ds*end!1 ds*common-end
916 .nr \\n[.ev]:ds-type 2
921 .ie '\\n(.z'ds*div' \{\
924 . in (u;\\n[.l]-\\n[dl]/2>?0)
929 .el .@error-recover mismatched DE
936 . nr \\n[.ev]:ds-type 4
945 . ie '\\$1'I' .ID \\$2
950 . nr \\n[.ev]:ds-type 3
956 . while \\n[.t]<=(\\$1)&(\\n[nl]>\\n[pg@header-bottom]) \{\
964 .ie '\\n(.z'ds*div' \{\
973 .el .@error-recover mismatched DE
976 .ie '\\n(.z'ds*div' \{\
980 . in (u;\\n[.l]-\\n[dl]/2>?0)
986 .el .@error-recover mismatched DE
988 .\" ****************************
989 .\" ******** module par ********
990 .\" ****************************
991 .\" Paragraph-level formatting.
992 .\" Load time initialization.
994 .\" PS and VS might have been set on the command-line
998 .\" don't set LT so that it can be defaulted from LL
1002 .\" don't set VS so that it can be defaulted from PS
1003 .ie rVS .par*vs \\n[VS]
1004 .el .par*vs \\n[PS]+2
1005 .if dFAM .fam \\*[FAM]
1009 .CHECK-FOOTER-AND-KEEP
1012 .\" If it's too big to be in points, treat it as units.
1013 .ie (p;\\$1)>=40p .vs (u;\\$1)
1017 .nr 0:li (u;\\n[LL]/12)
1024 .aln \\n[.ev]:MCLL LL
1026 .aln \\n[.ev]:MCLT LT
1032 .\" happens when the first page begins
1034 .if !rLT .nr LT \\n[LL]
1035 .if !rFL .nr FL \\n[LL]*5/6
1036 .if !rVS .nr VS \\n[PS]+2
1038 .if !rFPS .nr FPS \\n[PS]-2
1039 .if !rFVS .nr FVS \\n[FPS]+2
1040 .\" don't change environment 0
1046 .if !rPD .nr PD .3v>?\n(.V
1047 .if !rDD .nr DD .5v>?\n(.V
1049 .if !rFPD .nr FPD \\n[PD]/2
1051 .if !dFAM .ds FAM \\n[.fam]
1073 .aln fn:MCLL pg@fn-colw
1074 .aln fn:MCLT pg@fn-colw
1080 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1083 .nr \\n[.ev]:ds-type 0
1092 .ie \\n[pg@ncols]>1 \{\
1093 . ll (u;\\n[\\n[.ev]:MCLL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1094 . lt \\n[\\n[.ev]:MCLT]u
1097 . ll (u;\\n[\\n[.ev]:LL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1098 . lt \\n[\\n[.ev]:LT]u
1100 .in (u;\\n[\\n[.ev]:li]+\\n[\\n[.ev]:pli])
1103 .ps \\n[\\n[.ev]:PS]
1104 .par*vs \\n[\\n[.ev]:VS]
1114 .\" This can be redefined by the user.
1120 .nr \\n[.ev]:pli \\$1
1121 .nr \\n[.ev]:pri \\$2
1123 .sp \\n[\\n[.ev]:PD]u
1134 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1138 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1139 .if !'\*(.T'html' .ti +\\n[\\n[.ev]:ai]u
1142 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1143 .par*start \\n[QI] \\n[QI]
1146 .par*start \\n[\\n[.ev]:PI] 0
1147 .ti -\\n[\\n[.ev]:PI]u
1150 .if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
1151 .par*start \\n[\\n[.ev]:ai] 0
1153 . \" Divert the label so as to freeze any spaces.
1160 . ti -\\n[\\n[.ev]:ai]u
1161 . ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \\*[par*label]\h'|\\n[\\n[.ev]:ai]u'\c
1170 .if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
1171 .par*start \\n[\\n[.ev]:ai] 0
1173 . \" Divert the label so as to freeze any spaces.
1180 . ti -\\n[\\n[.ev]:ai]u
1181 . ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \{\
1182 . HTML-TAG-NS ".col 1"
1183 \\$1\h'|\\n[\\n[.ev]:ai]u'\c
1184 . HTML-TAG-NS ".col 2"
1193 .\" We don't want margin characters to be attached when we divert
1194 .\" the tag. Since there's no way to save and restore the current
1195 .\" margin character, we have to switch to a new environment, taking
1196 .\" what we need of the old environment with us.
1197 .de par*push-tag-env
1198 .nr par*saved-font \\n[.f]
1199 .nr par*saved-size \\n[.s]z
1200 .nr par*saved-ss \\n[.ss]
1201 .ds par*saved-fam \\n[.fam]
1205 .ft \\n[par*saved-font]
1206 .ps \\n[par*saved-size]u
1207 .ss \\n[par*saved-ss]
1208 .fam \\*[par*saved-fam]
1215 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1216 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1217 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1218 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1219 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1221 .nr \\n[.ev]:li +\\n[\\n[.ev]:ai]
1222 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1227 .ie \\n[\\n[.ev]:il] \{\
1229 . nr \\n[.ev]:ai \\n[\\n[.ev]:ai!\\n[\\n[.ev]:il]]
1230 . nr \\n[.ev]:li \\n[\\n[.ev]:li!\\n[\\n[.ev]:il]]
1231 . nr \\n[.ev]:ri \\n[\\n[.ev]:ri!\\n[\\n[.ev]:il]]
1232 . nr \\n[.ev]:pli \\n[\\n[.ev]:pli!\\n[\\n[.ev]:il]]
1233 . nr \\n[.ev]:pri \\n[\\n[.ev]:pri!\\n[\\n[.ev]:il]]
1235 .el .@error unbalanced \\$0
1240 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1241 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1242 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1243 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1244 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1246 .nr \\n[.ev]:li +\\n[QI]
1247 .nr \\n[.ev]:ri +\\n[QI]
1248 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1252 .\" start boxed text
1259 .nr par*box-in \\n[.in]
1260 .\" remember what 1n is, just in case the point size changes
1265 .ti \\n[par*box-in]u+1n
1267 .de @div-end!par*box-div
1271 .\" Postpone the drawing of the box until we're in the top-level diversion,
1272 .\" in case there's a footnote inside the box.
1274 .ie '\\n(.z'par*box-div' \{\
1276 . if \n[.V]>.25m .sp
1278 . if \n[.V]>.25m .sp
1284 . nr \\n[.ev]:ri -\\n[par*box-n]
1285 . nr \\n[.ev]:li -\\n[par*box-n]
1286 . in -\\n[par*box-n]u
1287 . ll +\\n[par*box-n]u
1288 . lt +\\n[par*box-n]u
1289 . par*box-draw \\n[.i]u \\n[.l]u-(\\n[.H]u==1n*1n)
1291 .el .@error B2 without B1
1294 .de par*box-mark-top
1299 .el \!.par*box-mark-top
1303 . nr par*box-in \\n[.i]
1304 . nr par*box-ll \\n[.l]
1305 . nr par*box-vpt \\n[.vpt]
1306 . nr par*box-ad \\n[.j]
1312 \D'l (u;\\n[.l]-\\n[.i]) 0'\
1313 \D'l 0 |\\n[par*box-top]u'\
1314 \D'l -(u;\\n[.l]-\\n[.i]) 0'\
1315 \D'l 0 -|\\n[par*box-top]u'
1318 . in \\n[par*box-in]u
1319 . ll \\n[par*box-ll]u
1320 . vpt \\n[par*box-vpt]
1321 . ad \\n[par*box-ad]
1323 .el \!.par*box-draw \\$1 \\$2
1327 .\" Keep together the heading and the first two lines of the next paragraph.
1328 .ne 3v+\\n[\\n[.ev]:PD]u+\\n(.Vu
1333 .\" TL, AU, and AI are aliased to these in cov*ab-init.
1354 .\" In paragraph macros.
1356 .ps \\n[\\n[.ev]:PS]
1367 .\" par*define-font-macro macro font
1368 .de par*define-font-macro
1371 . nr par*prev-font \\\\n[.f]
1372 \&\\\\$3\f[\\$2]\\\\$1\f[\\\\n[par*prev-font]]\\\\$2
1377 .par*define-font-macro B B
1378 .par*define-font-macro I I
1379 .par*define-font-macro BI BI
1380 .par*define-font-macro CW CR
1381 .\" underline a word
1383 \Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m'\\$2
1387 .nr par*bxw \w'\\$1'+.4m
1388 \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''\
1392 .\" The first time UX is used, put a registered mark after it.
1395 \s[\\n[.s]*8u/10u]UNIX\s0\\$1\\*[par*ux-rg]
1398 .ds par@sup-start \v'-.9m\s'\En[.s]*7u/10u'+.7m'
1399 .als { par@sup-start
1400 .ds par@sup-end \v'-.7m\s0+.9m'
1402 .\" footnote paragraphs
1403 .\" FF is the footnote format
1405 .\" This can be redefined. It gets a second argument of `no' if the first
1406 .\" argument was supplied by the user, rather than automatically.
1409 .if !d par*fp!\\n[FF] \{\
1410 . @error unknown footnote format `\\n[FF]'
1413 .ie '\\$2'no' .par*fp!\\n[FF]-no "\\$1"
1414 .el .par*fp!\\n[FF] "\\$1"
1418 \&\\*[par@sup-start]\\$1\\*[par@sup-end]\ \c
1441 .@IP "\\$1." (u;\\n[\\n[.ev]:PI]*2)
1444 .@IP "\\$1" (u;\\n[\\n[.ev]:PI]*2)
1446 .\" ***************************
1447 .\" ******** module nh ********
1448 .\" ***************************
1449 .\" Numbered headings.
1450 .\" nh*hl is the level of the last heading
1452 .\" numbered heading
1454 .HTML-TAG ".NH \\$1"
1460 . nr H\\n[nh*hl] 0\\$1
1463 . if !\\n[nh*hl] \{\
1466 . @error missing arguments to .NH S
1470 . nr nh*ohl \\n[nh*hl]
1473 . ie \\n[nh*hl]<=0 \{\
1478 . if \\n[nh*hl]-\\n[nh*ohl]>1 \
1479 . @warning .NH \\n[nh*ohl] followed by .NH \\n[nh*hl]
1483 . while \\n[nh*hl]>\\n[nh*ohl] \{\
1491 .while \\n[nh*i]<\\n[nh*hl] \{\
1493 . as SN \\n[H\\n[nh*i]].
1498 .\" ****************************
1499 .\" ******** module toc ********
1500 .\" ****************************
1501 .\" Table of contents generation.
1505 .ie \\n[.$] .XA "\\$1"
1508 .de @div-end!toc*div
1512 .ie '\\n(.z'toc*div' \{\
1513 . if d toc*num .toc*end-entry
1515 . ie '\\$1'no' .ds toc*num
1516 . el .ds toc*num "\\$1
1518 . el .ds toc*num \\n[PN]
1525 .el .@error XA without XS
1528 .ie '\\n(.z'toc*div' \{\
1529 . if d toc*num .toc*end-entry
1533 .el .@error XS without XE
1551 .char \[toc*leader-char] .\h'1m'
1552 .lc \[toc*leader-char]
1553 .ta (u;\\n[.l]-\\n[.i]-\w'000') (u;\\n[.l]-\\n[.i])R
1558 .\" print the table of contents on page i
1564 .\" ****************************
1565 .\" ******** module eqn ********
1566 .\" ****************************
1575 .ie '\\$1'L' .nr eqn*type 0
1577 . ie '\\$1'I' .nr eqn*type 1
1580 . if !'\\$1'C' .ds eqn*num "\\$1
1585 .if \\n[eqn*type]=0 .HTML-IMAGE-LEFT
1586 .if \\n[eqn*type]=1 \{\
1587 . if '\*(.T'html' .RS
1590 .if \\n[eqn*type]=2 .HTML-IMAGE
1591 .if !'\*(.T'html' .nf
1593 .de @div-end!eqn*div
1596 .\" Note that geqn mark and lineup work correctly in centered equations.
1598 .ie !'\\n(.z'eqn*div' .@error-recover mismatched EN
1603 . if !'\\*[eqn*num]'' .nr eqn*have-num 1
1604 . ie \\n[dl]:\\n[eqn*have-num] \{\
1605 . if !'\*(.T'html' .sp \\n[DD]u
1607 . ds eqn*tabs \\n[.tabs]
1610 .\" --fixme-- this really should not be necessary
1611 .\" and indicates that there is extra space creeping into
1612 .\" an equation when ps4html is enabled..
1613 . ie r ps4html .ds@need \\n[dn]u-1v+\n[.V]u+1i
1614 . el .ds@need \\n[dn]u-1v+\n[.V]u
1616 . ie \\n[eqn*type]=0 \{\
1617 . ta (u;\\n[.l]-\\n[.i])R
1618 \\*[eqn*div]\t\\*[eqn*num]
1621 . ie \\n[eqn*type]=1 .ta \\n[DI]u \
1622 (u;\\n[.l]-\\n[.i])R
1623 . el .ta (u;\\n[.l]-\\n[.i]/2)C \
1624 (u;\\n[.l]-\\n[.i])R
1625 \t\\*[eqn*div]\t\\*[eqn*num]
1629 . ta (u;\\n[.l]-\\n[.i])R
1632 . if !'\*(.T'html' .sp \\n[DD]u
1636 .\" must terminate empty equations in html and ps4html as they contain
1637 .\" the HTML-IMAGE-END suppression nodes
1638 . if \\n[dl] .chop eqn*div
1639 . if '\*(.T'html' \\*[eqn*div]
1640 . if r ps4html \\*[eqn*div]
1642 . if !'\*(.T'html' .fi
1643 . if \\n[eqn*type]=0 .HTML-IMAGE-END
1644 . if \\n[eqn*type]=1 \{\
1646 . if '\*(.T'html' .RE
1648 . if \\n[eqn*type]=2 .HTML-IMAGE-END
1651 .\" ****************************
1652 .\" ******** module tbl ********
1653 .\" ****************************
1655 .nr tbl*have-header 0
1656 .\" This gets called if TS occurs before the first paragraph.
1659 .\" cov*ab-init aliases TS to @TS
1664 .\" .if !'\*(.T'html' .sp \\n[DD]u
1665 .if '\\$1'H' .di tbl*header-div
1669 .if \\n[tbl*have-header] \{\
1670 . ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl*print-header
1674 .de tbl*print-header
1681 .ie '\\n[.z]'tbl*header-div' \{\
1686 . ie \\n[dn]+\\n[FM]+\\n[HM]+2v>=\\n[.p] \{\
1687 . @error ridiculously long table header
1692 . nr tbl*header-ht \\n[dn]
1693 . ds@need \\n[dn]u+1v
1695 . nr tbl*have-header 1
1698 .el .@error-recover .TH without .TS H
1700 .de @div-end!tbl*header-div
1705 .ie '\\n(.z'tbl*header-div' .@error-recover .TS H but no .TH before .TE
1707 . nr tbl*have-header 0
1708 . if !'\*(.T'html' .sp \\n[DD]u
1715 .if \\n[tbl*have-header] \{\
1722 .\" ****************************
1723 .\" ******** module pic ********
1724 .\" ****************************
1730 .ie \\n[.$]<2 .@error bad arguments to PS (not preprocessed with pic?)
1732 . ds@need (u;\\$1)+1v
1733 . in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)
1742 .\" ****************************
1743 .\" ******** module ref ********
1744 .\" ****************************
1747 .rm [A [B [C [D [E [G [I [J [N [O [P [Q [R [S [T [V
1751 .ds ref*spec!0 Q A T1 S V N P I C D O
1753 .ds ref*spec!1 Q A T2 J S V N P I C D O
1755 .ds ref*spec!2 Q A T1 S V P I C D O
1756 .\" Article within book
1757 .ds ref*spec!3 Q A T2 B E S V P I C D O
1759 .ds ref*spec!4 Q A T2 R G P I C D O
1766 .ie d ref*spec!\\$1 .ref*build \\*[ref*spec!\\$1]
1768 . @error unknown reference type `\\$1'
1769 . ref*build \\*[ref*spec!0]
1775 .\" start of reference number
1776 .ds [. \\*[par@sup-start]
1777 .\" end of reference number
1778 .ds .] \\*[par@sup-end]
1779 .\" period before reference
1781 .\" period after reference
1783 .\" comma before reference
1785 .\" comma after reference
1787 .\" start collected references
1789 .als ref*print ref*end-print
1794 .\" end collected references
1797 .als ref*print ref*normal-print
1799 .de ref*normal-print
1800 .ie d [F .FS "\\*([.\\*([F\\*(.]"
1806 .ie d [F .IP "\\*([F."
1810 .als ref*print ref*normal-print
1812 .rm ref*string ref*post-punct
1813 .nr ref*suppress-period 1
1816 . ie d ref*add-\\$1 .ref*add-\\$1
1817 . el .ref*add-dflt \\$1
1821 .\" now add a final period
1822 .ie d ref*string \{\
1823 . if !\\n[ref*suppress-period] .as ref*string .
1824 . if d ref*post-punct \{\
1825 . as ref*string "\\*[ref*post-punct]
1832 .ref*field T , "\fI" "" "\fP"
1833 .if r [T .nr ref*suppress-period \\n([T
1836 .ref*field T , "\\*Q" "" "\\*U"
1837 .if r [T .nr ref*suppress-period \\n([T
1840 .ie \\n([P>0 .ref*field P , "pp. "
1841 .el .ref*field P , "p. "
1844 .ref*field J , \fI "" \fP
1850 .ref*field E , "ed. "
1856 .ref*field B "" "in \fI" "" \fP
1860 .ie r [O .nr ref*suppress-period \\n([O
1861 .el .nr ref*suppress-period 1
1865 .if r [A .nr ref*suppress-period \\n([A
1870 .\" First argument is the field letter.
1871 .\" Second argument is the punctuation character to use to separate this field
1872 .\" from the previous field.
1873 .\" Third argument is a string with which to prefix this field.
1874 .\" Fourth argument is a string with which to postfix this field.
1875 .\" Fifth argument is a string to add after the punctuation character supplied
1876 .\" by the next field.
1878 .if d ref*string \{\
1879 . ie d ref*post-punct \{\
1880 . as ref*string "\\$2\\*[ref*post-punct] \"
1883 . el .as ref*string "\\$2 \"
1885 .as ref*string "\\$3\\*([\\$1\\$4
1886 .if \\n[.$]>4 .ds ref*post-punct "\\$5
1887 .nr ref*suppress-period 0
1889 .\" ****************************
1890 .\" ******** module acc ********
1891 .\" ****************************
1892 .\" Accents and special characters.
1897 .\" The idea of this definition is for the top of the 3 to be at the x-height.
1898 .if !c\[yogh] .char \[yogh] \Z'\v'\w'x'*0-\En[rst]u'\s[\En[.s]*8u/10u]\
1899 \v'\w'3'*0+\En[rst]u'3\s0'\h'\w'\s[\En[.s]*8u/10u]3'u'
1902 .ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
1903 \h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
1906 .ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
1909 .ds \\$1 \Z'\h'(u;-\En[.w]-\w'\\$2'/2)'\
1910 \v'(u;\En[.cdp]-\En[.cht]+\En[rst]+\En[rsb]/2)'\\$2'
1913 .ds \\$1 \Z'\h'(u;\w'x'-\w'\\$2'/2)'\\$2'
1915 .acc*prefix-def ' \'
1916 .acc*prefix-def ` \`
1918 .acc*prefix-def , \(ac
1919 .acc*prefix-def : \(ad
1921 .\" improved accent marks
1927 .acc*over-def : \(ad
1928 .acc*over-def v \(ah
1929 .acc*over-def _ \(a-
1930 .acc*over-def o \(ao
1931 .acc*under-def , \(ac
1932 .acc*under-def . \s[\En[.s]*8u/10u]\v'.2m'.\v'-.2m'\s0
1933 .acc*under-def hook \(ho
1935 .char \[hooko] o\\\\*[hook]
1938 .ds D- \(-D\" Icelandic uppercase eth
1939 .ds d- \(Sd\" Icelandic lowercase eth
1940 .ds Th \(TP\" Icelandic uppercase thorn
1941 .ds th \(Tp\" Icelandic lowercase thorn
1942 .ds 8 \(ss\" German double s
1943 .ds Ae \(AE\" AE ligature
1944 .ds ae \(ae\" ae ligature
1945 .ds Oe \(OE\" OE ligature
1946 .ds oe \(oe\" oe ligature
1947 .ds ? \(r?\" upside down ?
1948 .ds ! \(r!\" upside down !
1950 .de CHECK-FOOTER-AND-KEEP
1951 .\" it might be better to als FS -> B1 and FE -> B2
1952 .\" however this produced wierd results, so I've moved back to a more reliable
1953 .\" but less interesting solution --fixme--
1954 . if '\*(.T'html' \{\
1982 .if '\*(.T'html' \{\
1986 .\" Make sure that no blank lines creep in at the end of this file.