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
876 .if \\n[\\n[.ev]:ds-type] \{\
877 . @error automatically terminating display
882 .ie \\n[\\n[.ev]:ds-type] .DE
886 .@error DE without DS, ID, CD, LD or BD
890 .nr \\n[.ev]:ds-type 1
897 .ie \\n[.$] .in +(n;\\$1)
912 .als ds*end!1 ds*common-end
915 .nr \\n[.ev]:ds-type 2
920 .ie '\\n(.z'ds*div' \{\
923 . in (u;\\n[.l]-\\n[dl]/2>?0)
928 .el .@error-recover mismatched DE
935 . nr \\n[.ev]:ds-type 4
944 . ie '\\$1'I' .ID \\$2
949 . nr \\n[.ev]:ds-type 3
954 . while \\n[.t]<=(\\$1)&(\\n[nl]>\\n[pg@header-bottom]) \{\
962 .ie '\\n(.z'ds*div' \{\
971 .el .@error-recover mismatched DE
974 .ie '\\n(.z'ds*div' \{\
978 . in (u;\\n[.l]-\\n[dl]/2>?0)
984 .el .@error-recover mismatched DE
986 .\" ****************************
987 .\" ******** module par ********
988 .\" ****************************
989 .\" Paragraph-level formatting.
990 .\" Load time initialization.
992 .\" PS and VS might have been set on the command-line
996 .\" don't set LT so that it can be defaulted from LL
1000 .\" don't set VS so that it can be defaulted from PS
1001 .ie rVS .par*vs \\n[VS]
1002 .el .par*vs \\n[PS]+2
1003 .if dFAM .fam \\*[FAM]
1007 .CHECK-FOOTER-AND-KEEP
1010 .\" If it's too big to be in points, treat it as units.
1011 .ie (p;\\$1)>=40p .vs (u;\\$1)
1015 .nr 0:li (u;\\n[LL]/12)
1022 .aln \\n[.ev]:MCLL LL
1024 .aln \\n[.ev]:MCLT LT
1030 .\" happens when the first page begins
1032 .if !rLT .nr LT \\n[LL]
1033 .if !rFL .nr FL \\n[LL]*5/6
1034 .if !rVS .nr VS \\n[PS]+2
1036 .if !rFPS .nr FPS \\n[PS]-2
1037 .if !rFVS .nr FVS \\n[FPS]+2
1038 .\" don't change environment 0
1044 .if !rPD .nr PD .3v>?\n(.V
1045 .if !rDD .nr DD .5v>?\n(.V
1047 .if !rFPD .nr FPD \\n[PD]/2
1049 .if !dFAM .ds FAM \\n[.fam]
1071 .aln fn:MCLL pg@fn-colw
1072 .aln fn:MCLT pg@fn-colw
1078 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1081 .nr \\n[.ev]:ds-type 0
1090 .ie \\n[pg@ncols]>1 \{\
1091 . ll (u;\\n[\\n[.ev]:MCLL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1092 . lt \\n[\\n[.ev]:MCLT]u
1095 . ll (u;\\n[\\n[.ev]:LL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1096 . lt \\n[\\n[.ev]:LT]u
1098 .in (u;\\n[\\n[.ev]:li]+\\n[\\n[.ev]:pli])
1101 .ps \\n[\\n[.ev]:PS]
1102 .par*vs \\n[\\n[.ev]:VS]
1112 .\" This can be redefined by the user.
1118 .nr \\n[.ev]:pli \\$1
1119 .nr \\n[.ev]:pri \\$2
1121 .sp \\n[\\n[.ev]:PD]u
1132 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1136 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1137 .if !'\*(.T'html' .ti +\\n[\\n[.ev]:ai]u
1140 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1141 .par*start \\n[QI] \\n[QI]
1144 .par*start \\n[\\n[.ev]:PI] 0
1145 .ti -\\n[\\n[.ev]:PI]u
1148 .if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
1149 .par*start \\n[\\n[.ev]:ai] 0
1151 . \" Divert the label so as to freeze any spaces.
1158 . ti -\\n[\\n[.ev]:ai]u
1159 . ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \\*[par*label]\h'|\\n[\\n[.ev]:ai]u'\c
1168 .if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
1169 .par*start \\n[\\n[.ev]:ai] 0
1171 . \" Divert the label so as to freeze any spaces.
1178 . ti -\\n[\\n[.ev]:ai]u
1179 . ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \{\
1180 . HTML-TAG-NS ".col 1"
1181 \\$1\h'|\\n[\\n[.ev]:ai]u'\c
1182 . HTML-TAG-NS ".col 2"
1191 .\" We don't want margin characters to be attached when we divert
1192 .\" the tag. Since there's no way to save and restore the current
1193 .\" margin character, we have to switch to a new environment, taking
1194 .\" what we need of the old environment with us.
1195 .de par*push-tag-env
1196 .nr par*saved-font \\n[.f]
1197 .nr par*saved-size \\n[.s]z
1198 .nr par*saved-ss \\n[.ss]
1199 .ds par*saved-fam \\n[.fam]
1203 .ft \\n[par*saved-font]
1204 .ps \\n[par*saved-size]u
1205 .ss \\n[par*saved-ss]
1206 .fam \\*[par*saved-fam]
1213 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1214 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1215 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1216 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1217 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1219 .nr \\n[.ev]:li +\\n[\\n[.ev]:ai]
1220 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1225 .ie \\n[\\n[.ev]:il] \{\
1227 . nr \\n[.ev]:ai \\n[\\n[.ev]:ai!\\n[\\n[.ev]:il]]
1228 . nr \\n[.ev]:li \\n[\\n[.ev]:li!\\n[\\n[.ev]:il]]
1229 . nr \\n[.ev]:ri \\n[\\n[.ev]:ri!\\n[\\n[.ev]:il]]
1230 . nr \\n[.ev]:pli \\n[\\n[.ev]:pli!\\n[\\n[.ev]:il]]
1231 . nr \\n[.ev]:pri \\n[\\n[.ev]:pri!\\n[\\n[.ev]:il]]
1233 .el .@error unbalanced \\$0
1238 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1239 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1240 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1241 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1242 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1244 .nr \\n[.ev]:li +\\n[QI]
1245 .nr \\n[.ev]:ri +\\n[QI]
1246 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1250 .\" start boxed text
1257 .nr par*box-in \\n[.in]
1258 .\" remember what 1n is, just in case the point size changes
1263 .ti \\n[par*box-in]u+1n
1265 .de @div-end!par*box-div
1269 .\" Postpone the drawing of the box until we're in the top-level diversion,
1270 .\" in case there's a footnote inside the box.
1272 .ie '\\n(.z'par*box-div' \{\
1274 . if \n[.V]>.25m .sp
1276 . if \n[.V]>.25m .sp
1282 . nr \\n[.ev]:ri -\\n[par*box-n]
1283 . nr \\n[.ev]:li -\\n[par*box-n]
1284 . in -\\n[par*box-n]u
1285 . ll +\\n[par*box-n]u
1286 . lt +\\n[par*box-n]u
1287 . par*box-draw \\n[.i]u \\n[.l]u-(\\n[.H]u==1n*1n)
1289 .el .@error B2 without B1
1292 .de par*box-mark-top
1297 .el \!.par*box-mark-top
1301 . nr par*box-in \\n[.i]
1302 . nr par*box-ll \\n[.l]
1303 . nr par*box-vpt \\n[.vpt]
1304 . nr par*box-ad \\n[.j]
1310 \D'l (u;\\n[.l]-\\n[.i]) 0'\
1311 \D'l 0 |\\n[par*box-top]u'\
1312 \D'l -(u;\\n[.l]-\\n[.i]) 0'\
1313 \D'l 0 -|\\n[par*box-top]u'
1316 . in \\n[par*box-in]u
1317 . ll \\n[par*box-ll]u
1318 . vpt \\n[par*box-vpt]
1319 . ad \\n[par*box-ad]
1321 .el \!.par*box-draw \\$1 \\$2
1325 .\" Keep together the heading and the first two lines of the next paragraph.
1326 .ne 3v+\\n[\\n[.ev]:PD]u+\\n(.Vu
1331 .\" TL, AU, and AI are aliased to these in cov*ab-init.
1352 .\" In paragraph macros.
1354 .ps \\n[\\n[.ev]:PS]
1365 .\" par*define-font-macro macro font
1366 .de par*define-font-macro
1369 . nr par*prev-font \\\\n[.f]
1370 \&\\\\$3\f[\\$2]\\\\$1\f[\\\\n[par*prev-font]]\\\\$2
1375 .par*define-font-macro B B
1376 .par*define-font-macro I I
1377 .par*define-font-macro BI BI
1378 .par*define-font-macro CW CR
1379 .\" underline a word
1381 \Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m'\\$2
1385 .nr par*bxw \w'\\$1'+.4m
1386 \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''\
1390 .\" The first time UX is used, put a registered mark after it.
1393 \s[\\n[.s]*8u/10u]UNIX\s0\\$1\\*[par*ux-rg]
1396 .ds par@sup-start \v'-.9m\s'\En[.s]*7u/10u'+.7m'
1397 .als { par@sup-start
1398 .ds par@sup-end \v'-.7m\s0+.9m'
1400 .\" footnote paragraphs
1401 .\" FF is the footnote format
1403 .\" This can be redefined. It gets a second argument of `no' if the first
1404 .\" argument was supplied by the user, rather than automatically.
1407 .if !d par*fp!\\n[FF] \{\
1408 . @error unknown footnote format `\\n[FF]'
1411 .ie '\\$2'no' .par*fp!\\n[FF]-no "\\$1"
1412 .el .par*fp!\\n[FF] "\\$1"
1416 \&\\*[par@sup-start]\\$1\\*[par@sup-end]\ \c
1439 .@IP "\\$1." (u;\\n[\\n[.ev]:PI]*2)
1442 .@IP "\\$1" (u;\\n[\\n[.ev]:PI]*2)
1444 .\" ***************************
1445 .\" ******** module nh ********
1446 .\" ***************************
1447 .\" Numbered headings.
1448 .\" nh*hl is the level of the last heading
1450 .\" numbered heading
1452 .HTML-TAG ".NH \\$1"
1458 . nr H\\n[nh*hl] 0\\$1
1461 . if !\\n[nh*hl] \{\
1464 . @error missing arguments to .NH S
1468 . nr nh*ohl \\n[nh*hl]
1471 . ie \\n[nh*hl]<=0 \{\
1476 . if \\n[nh*hl]-\\n[nh*ohl]>1 \
1477 . @warning .NH \\n[nh*ohl] followed by .NH \\n[nh*hl]
1481 . while \\n[nh*hl]>\\n[nh*ohl] \{\
1489 .while \\n[nh*i]<\\n[nh*hl] \{\
1491 . as SN \\n[H\\n[nh*i]].
1496 .\" ****************************
1497 .\" ******** module toc ********
1498 .\" ****************************
1499 .\" Table of contents generation.
1503 .ie \\n[.$] .XA "\\$1"
1506 .de @div-end!toc*div
1510 .ie '\\n(.z'toc*div' \{\
1511 . if d toc*num .toc*end-entry
1513 . ie '\\$1'no' .ds toc*num
1514 . el .ds toc*num "\\$1
1516 . el .ds toc*num \\n[PN]
1523 .el .@error XA without XS
1526 .ie '\\n(.z'toc*div' \{\
1527 . if d toc*num .toc*end-entry
1531 .el .@error XS without XE
1549 .char \[toc*leader-char] .\h'1m'
1550 .lc \[toc*leader-char]
1551 .ta (u;\\n[.l]-\\n[.i]-\w'000') (u;\\n[.l]-\\n[.i])R
1556 .\" print the table of contents on page i
1562 .\" ****************************
1563 .\" ******** module eqn ********
1564 .\" ****************************
1573 .ie '\\$1'L' .nr eqn*type 0
1575 . ie '\\$1'I' .nr eqn*type 1
1578 . if !'\\$1'C' .ds eqn*num "\\$1
1583 .if \\n[eqn*type]=0 .HTML-IMAGE-LEFT
1584 .if \\n[eqn*type]=1 \{\
1585 . if '\*(.T'html' .RS
1588 .if \\n[eqn*type]=2 .HTML-IMAGE
1589 .if !'\*(.T'html' .nf
1591 .de @div-end!eqn*div
1594 .\" Note that geqn mark and lineup work correctly in centered equations.
1596 .ie !'\\n(.z'eqn*div' .@error-recover mismatched EN
1601 . if !'\\*[eqn*num]'' .nr eqn*have-num 1
1602 . ie \\n[dl]:\\n[eqn*have-num] \{\
1603 . if !'\*(.T'html' .sp \\n[DD]u
1605 . ds eqn*tabs \\n[.tabs]
1608 .\" --fixme-- this really should not be necessary
1609 .\" and indicates that there is extra space creeping into
1610 .\" an equation when ps4html is enabled..
1611 . ie r ps4html .ds@need \\n[dn]u-1v+\n[.V]u+1i
1612 . el .ds@need \\n[dn]u-1v+\n[.V]u
1614 . ie \\n[eqn*type]=0 \{\
1615 . ta (u;\\n[.l]-\\n[.i])R
1616 \\*[eqn*div]\t\\*[eqn*num]
1619 . ie \\n[eqn*type]=1 .ta \\n[DI]u \
1620 (u;\\n[.l]-\\n[.i])R
1621 . el .ta (u;\\n[.l]-\\n[.i]/2)C \
1622 (u;\\n[.l]-\\n[.i])R
1623 \t\\*[eqn*div]\t\\*[eqn*num]
1627 . ta (u;\\n[.l]-\\n[.i])R
1630 . if !'\*(.T'html' .sp \\n[DD]u
1634 .\" must terminate empty equations in html and ps4html as they contain
1635 .\" the HTML-IMAGE-END suppression nodes
1636 . if \\n[dl] .chop eqn*div
1637 . if '\*(.T'html' \\*[eqn*div]
1638 . if r ps4html \\*[eqn*div]
1640 . if !'\*(.T'html' .fi
1641 . if \\n[eqn*type]=0 .HTML-IMAGE-END
1642 . if \\n[eqn*type]=1 \{\
1644 . if '\*(.T'html' .RE
1646 . if \\n[eqn*type]=2 .HTML-IMAGE-END
1649 .\" ****************************
1650 .\" ******** module tbl ********
1651 .\" ****************************
1653 .nr tbl*have-header 0
1654 .\" This gets called if TS occurs before the first paragraph.
1657 .\" cov*ab-init aliases TS to @TS
1662 .\" .if !'\*(.T'html' .sp \\n[DD]u
1663 .if '\\$1'H' .di tbl*header-div
1667 .if \\n[tbl*have-header] \{\
1668 . ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl*print-header
1672 .de tbl*print-header
1679 .ie '\\n[.z]'tbl*header-div' \{\
1684 . ie \\n[dn]+\\n[FM]+\\n[HM]+2v>=\\n[.p] \{\
1685 . @error ridiculously long table header
1690 . nr tbl*header-ht \\n[dn]
1691 . ds@need \\n[dn]u+1v
1693 . nr tbl*have-header 1
1696 .el .@error-recover .TH without .TS H
1698 .de @div-end!tbl*header-div
1703 .ie '\\n(.z'tbl*header-div' .@error-recover .TS H but no .TH before .TE
1705 . nr tbl*have-header 0
1706 . if !'\*(.T'html' .sp \\n[DD]u
1713 .if \\n[tbl*have-header] \{\
1720 .\" ****************************
1721 .\" ******** module pic ********
1722 .\" ****************************
1728 .ie \\n[.$]<2 .@error bad arguments to PS (not preprocessed with pic?)
1730 . ds@need (u;\\$1)+1v
1731 . in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)
1740 .\" ****************************
1741 .\" ******** module ref ********
1742 .\" ****************************
1745 .rm [A [B [C [D [E [G [I [J [N [O [P [Q [R [S [T [V
1749 .ds ref*spec!0 Q A T1 S V N P I C D O
1751 .ds ref*spec!1 Q A T2 J S V N P I C D O
1753 .ds ref*spec!2 Q A T1 S V P I C D O
1754 .\" Article within book
1755 .ds ref*spec!3 Q A T2 B E S V P I C D O
1757 .ds ref*spec!4 Q A T2 R G P I C D O
1764 .ie d ref*spec!\\$1 .ref*build \\*[ref*spec!\\$1]
1766 . @error unknown reference type `\\$1'
1767 . ref*build \\*[ref*spec!0]
1773 .\" start of reference number
1774 .ds [. \\*[par@sup-start]
1775 .\" end of reference number
1776 .ds .] \\*[par@sup-end]
1777 .\" period before reference
1779 .\" period after reference
1781 .\" comma before reference
1783 .\" comma after reference
1785 .\" start collected references
1787 .als ref*print ref*end-print
1792 .\" end collected references
1795 .als ref*print ref*normal-print
1797 .de ref*normal-print
1798 .ie d [F .FS "\\*([.\\*([F\\*(.]"
1804 .ie d [F .IP "\\*([F."
1808 .als ref*print ref*normal-print
1810 .rm ref*string ref*post-punct
1811 .nr ref*suppress-period 1
1814 . ie d ref*add-\\$1 .ref*add-\\$1
1815 . el .ref*add-dflt \\$1
1819 .\" now add a final period
1820 .ie d ref*string \{\
1821 . if !\\n[ref*suppress-period] .as ref*string .
1822 . if d ref*post-punct \{\
1823 . as ref*string "\\*[ref*post-punct]
1830 .ref*field T , "\fI" "" "\fP"
1831 .if r [T .nr ref*suppress-period \\n([T
1834 .ref*field T , "\\*Q" "" "\\*U"
1835 .if r [T .nr ref*suppress-period \\n([T
1838 .ie \\n([P>0 .ref*field P , "pp. "
1839 .el .ref*field P , "p. "
1842 .ref*field J , \fI "" \fP
1848 .ref*field E , "ed. "
1854 .ref*field B "" "in \fI" "" \fP
1858 .ie r [O .nr ref*suppress-period \\n([O
1859 .el .nr ref*suppress-period 1
1863 .if r [A .nr ref*suppress-period \\n([A
1868 .\" First argument is the field letter.
1869 .\" Second argument is the punctuation character to use to separate this field
1870 .\" from the previous field.
1871 .\" Third argument is a string with which to prefix this field.
1872 .\" Fourth argument is a string with which to postfix this field.
1873 .\" Fifth argument is a string to add after the punctuation character supplied
1874 .\" by the next field.
1876 .if d ref*string \{\
1877 . ie d ref*post-punct \{\
1878 . as ref*string "\\$2\\*[ref*post-punct] \"
1881 . el .as ref*string "\\$2 \"
1883 .as ref*string "\\$3\\*([\\$1\\$4
1884 .if \\n[.$]>4 .ds ref*post-punct "\\$5
1885 .nr ref*suppress-period 0
1887 .\" ****************************
1888 .\" ******** module acc ********
1889 .\" ****************************
1890 .\" Accents and special characters.
1895 .\" The idea of this definition is for the top of the 3 to be at the x-height.
1896 .if !c\[yogh] .char \[yogh] \Z'\v'\w'x'*0-\En[rst]u'\s[\En[.s]*8u/10u]\
1897 \v'\w'3'*0+\En[rst]u'3\s0'\h'\w'\s[\En[.s]*8u/10u]3'u'
1900 .ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
1901 \h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
1904 .ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
1907 .ds \\$1 \Z'\h'(u;-\En[.w]-\w'\\$2'/2)'\
1908 \v'(u;\En[.cdp]-\En[.cht]+\En[rst]+\En[rsb]/2)'\\$2'
1911 .ds \\$1 \Z'\h'(u;\w'x'-\w'\\$2'/2)'\\$2'
1913 .acc*prefix-def ' \'
1914 .acc*prefix-def ` \`
1916 .acc*prefix-def , \(ac
1917 .acc*prefix-def : \(ad
1919 .\" improved accent marks
1925 .acc*over-def : \(ad
1926 .acc*over-def v \(ah
1927 .acc*over-def _ \(a-
1928 .acc*over-def o \(ao
1929 .acc*under-def , \(ac
1930 .acc*under-def . \s[\En[.s]*8u/10u]\v'.2m'.\v'-.2m'\s0
1931 .acc*under-def hook \(ho
1933 .char \[hooko] o\\\\*[hook]
1936 .ds D- \(-D\" Icelandic uppercase eth
1937 .ds d- \(Sd\" Icelandic lowercase eth
1938 .ds Th \(TP\" Icelandic uppercase thorn
1939 .ds th \(Tp\" Icelandic lowercase thorn
1940 .ds 8 \(ss\" German double s
1941 .ds Ae \(AE\" AE ligature
1942 .ds ae \(ae\" ae ligature
1943 .ds Oe \(OE\" OE ligature
1944 .ds oe \(oe\" oe ligature
1945 .ds ? \(r?\" upside down ?
1946 .ds ! \(r!\" upside down !
1948 .de CHECK-FOOTER-AND-KEEP
1949 .\" it might be better to als FS -> B1 and FE -> B2
1950 .\" however this produced wierd results, so I've moved back to a more reliable
1951 .\" but less interesting solution --fixme--
1952 . if '\*(.T'html' \{\
1980 .if '\*(.T'html' \{\
1984 .\" Make sure that no blank lines creep in at the end of this file.