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, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, 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.
39 .tm \\n(.F:\\n(.c: macro error: \\$*
42 .tm \\n(.F:\\n(.c: macro warning: \\$*
45 .ab \\n(.F:\\n(.c: fatal macro error: \\$*
48 .@error sorry, \\$0 not implemented
51 .als TM @not-implemented
52 .als CT @not-implemented
56 .if !rPO .nr PO \\n(.o
57 .\" a non-empty environment
65 .ds REFERENCES References
67 .ds TOC Table of Contents
80 .ds MO \E*[MONTH\n[mo]]
81 .ds DY \n[dy] \*[MO] \n[year]
83 .if \\n[.$] .ds DY "\\$*
86 .if \\n[.$] .ds DY "\\$*
91 .tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[PN]
93 .\" print an error message and then try to recover
95 .@error \\$@ (recovering)
98 . \"@warning automatically terminating diversion \\n(.z
99 . ie d @div-end!\\n(.z .@div-end!\\n(.z
100 . el .*div-end-default
102 . \" ensure that we don't loop forever
103 . if \\n[*pop-count]>20 .@fatal recovery failed
105 .while !'\\n[.ev]'0' .ev
117 .\" ****************************
118 .\" ******** module cov ********
119 .\" ****************************
120 .\" Cover sheet and first page.
121 .de cov*err-not-after-first-page
122 .@error \\$0 is not allowed after the first page has started
124 .de cov*err-not-before-tl
125 .@error \\$0 is not allowed before TL
127 .de cov*err-not-again
128 .@error \\$0 is not allowed more than once
130 .de cov*err-not-after-ab
131 .@error \\$0 is not allowed after first AB, LP, PP, IP, SH or NH
133 .als AU cov*err-not-before-tl
134 .als AI cov*err-not-before-tl
135 .als AB cov*err-not-before-tl
136 .de cov*first-page-init
137 .rm cov*first-page-init
139 .als RP cov*err-not-after-first-page
141 .ie \\n[cov*rp-format] \{\
152 .CHECK-FOOTER-AND-KEEP
154 .wh 0 cov*first-page-init
155 .\" This handles the case where FS occurs before TL or LP.
162 .\" released paper format
165 .if \\n[.$] .if '\\$1'no' .nr cov*rp-no 1
171 .als TL cov*err-not-again
191 .di cov*au-div!\\n[cov*n-au]
194 .ie (\\n[PS] >= 1000) \
195 . ps (\\n[PS]z / 1000u)
205 .ie !\\n[cov*n-au] .@error AI before AU
207 . di cov*ai-div!\\n[cov*n-au]
210 . ie (\\n[PS] >= 1000) \
211 . ps (\\n[PS]z / 1000u)
237 .als cov*ab-init @nop
255 .als AB cov*err-not-after-ab
268 . als cov*tl-au-print @nop
274 . if '\*(.T'html' \{\
288 . als cov*tl-au-print @nop
296 . als AE cov*err-not-again
299 . ie '\\n(.z'cov*ab-div' \{\
300 . als AE cov*err-not-again
303 .\" nr cov*ab-height \\n[dn]
308 . el .@error AE without AB
311 .de @div-end!cov*ab-div
317 . ie \\n[cov*rp-format] .cov*rp-print
318 . el .cov*draft-print
321 . if \\n[cov*rp-format] \{\
322 . @warning RP format but no TL
326 . CHECK-FOOTER-AND-KEEP
332 .nr cov*page-length \\n[.p]
337 . if !'\*(.T'html' . nf
344 .if \\n[cov*fn-height] \{\
345 . sp |(u;\\n[cov*page-length]-\\n[FM]\
346 -\\n[cov*fn-height]-\\n[fn@sep-dist]>?\\n[nl])
351 . ie \\n[cov*rp-no] .rm cov*fn-div
353 . rn cov*fn-div fn@overflow-div
354 . nr fn@have-overflow 1
359 .CHECK-FOOTER-AND-KEEP
360 .\" If anything was printed below where the footer line is normally printed,
361 .\" then that's an overflow.
362 .if -\\n[FM]/2+1v+\\n[cov*page-length]<\\n[nl] .@error cover sheet overflow
363 .pl \\n[cov*page-length]u
365 .if !\\n[cov*rp-no] .cov*tl-au-print
390 .while \\n[cov*i]<=\\n[cov*n-au] \{\
391 . ie '\*(.T'html' .br
392 . el .sp \\n[cov*sp]u
393 . cov*au-div!\\n[cov*i]
394 . ie d cov*ai-div!\\n[cov*i] \{\
396 . cov*ai-div!\\n[cov*i]
406 .\" start of footnote on cover
408 .if \\n[cov*in-fn] \{\
416 .if !\\n[cov*fn-height] .ns
417 .ie \\n[.$] .FP "\\$1" no
420 .de @div-end!cov*fn-div
423 .\" end of footnote on cover
425 .ie '\\n(.z'cov*fn-div' \{\
430 . nr cov*fn-height +\\n[dn]
432 .el .@error FE without matching FS
434 .\" ***************************
435 .\" ******** module pg ********
436 .\" ***************************
437 .\" Page-level formatting.
438 .\" > 0 if we have a footnote on the current page
450 .ds pg*OH '\E*[LH]'\E*[CH]'\E*[RH]'
451 .ds pg*EH '\E*[LH]'\E*[CH]'\E*[RH]'
452 .ds pg*OF '\E*[LF]'\E*[CF]'\E*[RF]'
453 .ds pg*EF '\E*[LF]'\E*[CF]'\E*[RF]'
461 .ie \\n%=1 .if \\n[pg*P1] .tl \\*[pg*OH]
463 . ie o .tl \\*[pg*OH]
473 .ie r bell_localisms \{\
479 .wh -\n[FM]u pg@bottom
480 .wh -\n[FM]u/2u pg*footer
484 .if !'\\n(.z'' .error-recover MC while diversion open
486 .ie \\n[pg@ncols]>1 .pg@super-eject
488 . \" flush out any floating keeps
489 . while \\n[kp@tail]>\\n[kp@head] \{\
495 . nr pg@colw \\n[LL]*7/15
496 . nr pg*gutw \\n[LL]-(2*\\n[pg@colw])
500 . nr pg@colw (n;\\$1)<?\\n[LL]
501 . ie \\n[.$]<2 .nr pg*gutw \\n[MINGW]
502 . el .nr pg*gutw (n;\\$2)
503 . nr pg@ncols \\n[LL]-\\n[pg@colw]/(\\n[pg@colw]+\\n[pg*gutw])+1
504 . ie \\n[pg@ncols]>1 \
505 . nr pg*gutw \\n[LL]-(\\n[pg@ncols]*\\n[pg@colw])/(\\n[pg@ncols]-1)
508 .DEVTAG ".mc \\n[pg@ncols] \\n[pg@colw] \\n[pg*gutw]"
512 .nr pg@fn-colw \\n[pg@colw]*5/6
521 .\" top of page macro
523 .ch pg*footer -\\n[FM]u/2u
526 .nr pg@fn-bottom-margin 0
540 .\" Handle footnote overflow before floating keeps, because the keep
541 .\" might contain an embedded footnote.
549 .\" move pg@bottom and pg*footer out of the way
550 .ch pg@bottom \\n[.p]u*2u
551 .ch pg*footer \\n[.p]u*2u
556 .if \\n[pg@fn-flag] .fn@bottom-hook
558 .ie \\n[pg*col-num]<\\n[pg@ncols] .pg*end-col
562 'sp |\\n[pg*col-top]u
563 .po (u;\\n[PO]+(\\n[pg@colw]+\\n[pg*gutw]*\\n[pg*col-num]))
564 .\"po +(u;\\n[pg@colw]+\\n[pg*gutw])
569 .\" Make sure we don't exit if there are still floats or footnotes left-over.
570 .ie \\n[kp@head]<\\n[kp@tail]:\\n[fn@have-overflow] \{\
571 . \" Switching environments ensures that we don't get an unnecessary
572 . \" blank line at the top of the page.
578 . \" If the text has ended and there are no more footnotes or keeps, exit.
579 . if \\n[pg@text-ended] .ex
580 . if r pg*next-number \{\
581 . pn \\n[pg*next-number]
583 . if d pg*next-format \{\
584 . af PN \\*[pg*next-format]
591 .\" pg@begin number format
594 . nr pg*next-number (;\\$1)
595 . ie \\n[.$]>1 .ds pg*next-format \\$2
596 . el .rm pg*next-format
598 .el .rr pg*next-number
601 .\" print the footer line
608 .\" flush out any keeps or footnotes
611 .if !'\\n(.z'' .@error-recover diversion open while ejecting page
612 .\" Make sure we stay in the end macro while there is still footnote overflow
613 .\" left, or floating keeps.
614 .while \\n[kp@tail]>\\n[kp@head]:\\n[pg@fn-flag] \{\
627 .\" ***************************
628 .\" ******** module fn ********
629 .\" ***************************
633 .\" Round it vertically
635 .nr fn@sep-dist \n[.v]
639 .ds * \E*[par@sup-start]\En+[fn*text-num]\E*[par@sup-end]
643 .ie \\n[.$] .fn*do-FS "\\$1" no
645 . ie \\n[fn*text-num]>\\n[fn*note-num] .fn*do-FS \\n+[fn*note-num]
649 .\" Second argument of `no' means don't embellish the first argument.
651 .if \\n[fn*open] .@error-recover nested FS
654 . \" Ensure that the first line of the footnote is on the same page
655 . \" as the reference. I think this is minimal.
659 . ie \\n[pg@fn-flag] .nr fn*need +\\n[fn:PD]
660 . el .nr fn*need +\\n[fn@sep-dist]
661 . ne \\n[fn*need]u+\\n[.V]u>?0
671 .ie !\\n[fn*open] .@error FE without FS
679 .nr fn@have-overflow 0
680 .\" called at the top of each column
683 .nr fn*page-bottom-pos 0-\\n[FM]-\\n[pg@fn-bottom-margin]
684 .ch pg@bottom \\n[fn*page-bottom-pos]u
685 .if \\n[fn@have-overflow] \{\
686 . nr fn@have-overflow 0
694 .\" This is called at the bottom of the column if pg@fn-flag is set.
697 .nr fn@have-overflow 0
698 .nr fn@bottom-pos \\n[.p]-\\n[FM]-\\n[pg@fn-bottom-margin]+\\n[.v]
700 .nr fn@bottom-pos -\\n[.v]
702 .ie \\n[nl]+\\n[fn@sep-dist]+\n[.V]>\\n[fn@bottom-pos] \{\
703 . rn fn@div fn@overflow-div
704 . nr fn@have-overflow 1
707 . if \\n[pg@ncols]>1 \
708 . if \\n[fn*max-width]>\\n[pg@fn-colw] \
709 . nr pg@fn-bottom-margin \\n[.p]-\\n[FM]-\\n[nl]+1v
710 . wh \\n[fn@bottom-pos]u fn*catch-overflow
716 . if '\\n(.z'fn@overflow-div' \{\
718 . nr fn@have-overflow \\n[dn]>0
720 . ch fn*catch-overflow
723 .de fn*catch-overflow
729 .if '\\n[.ev]'fn' .ev
733 .als @div-end!fn*embed-div @div-end!fn@div
737 . if !\\n[pg@fn-flag] .ns
742 .ie '\\n(.z'fn@div' \{\
744 . nr fn*page-bottom-pos -\\n[dn]
745 . nr fn*max-width \\n[fn*max-width]>?\\n[dl]
746 . if !\\n[pg@fn-flag] .nr fn*page-bottom-pos -\\n[fn@sep-dist]
748 . nr fn*page-bottom-pos \\n[nl]-\\n[.p]+\n[.V]>?\\n[fn*page-bottom-pos]
749 . ch pg@bottom \\n[fn*page-bottom-pos]u
752 . ie '\\n(.z'fn*embed-div' \{\
754 . rn fn*embed-div fn*embed-div!\\n[fn*embed-count]
755 \!. fn*embed-start \\n[fn*embed-count]
757 ' sp (u;\\n[dn]+\\n[fn@sep-dist]+\\n[.V])
759 . nr fn*embed-count +1
763 . @error-recover unclosed diversion within footnote
772 . rm fn*embed-div!\\$1
778 \!. fn*embed-start \\$1
783 .ie '\\n(.z'fn*null' \{\
789 .\" It's important that fn@print-sep use up exactly fn@sep-dist vertical space.
793 .vs \\n[fn@sep-dist]u
798 .\" ***************************
799 .\" ******** module kp ********
800 .\" ***************************
807 .if !'\\n(.z'' .@error-recover KF while open diversion
814 .ie '\\n(.z'kp*div' .kp*end
816 . ie '\\n(.z'kp*fdiv' .kp*fend
817 . el .@error KE without KS or KF
827 .ie '\\n(.z'' .ds@need \\$1
830 .\" end non-floating keep
843 .\" end floating keep
848 .ie \\n[.t]-(\\n[.k]>0*1v)>\\n[dn] \{\
856 . rn kp*fdiv kp*div!\\n[kp@tail]
857 . nr kp*ht!\\n[kp@tail] 0\\n[dn]
861 .\" top of page processing for KF
864 .if !\\n[kp*doing-top] \{\
871 .\" If the first keep won't fit, only force it out if we haven't had a footnote
872 .\" and we're at the top of the page.
873 .nr kp*force \\n[pg@fn-flag]=0&(\\n[nl]<=\\n[pg@header-bottom])
875 .while \\n[kp@tail]>\\n[kp@head]&\\n[kp*fits] \{\
876 . ie \\n[.t]>\\n[kp*ht!\\n[kp@head]]:\\n[kp*force] \{\
878 . \" It's important to advance kp@head before bringing
879 . \" back the keep, so that if the last line of the
880 . \" last keep springs the bottom of page trap, a new
881 . \" page will not be started unnecessarily.
882 . rn kp*div!\\n[kp@head] kp*temp
892 .\" ***************************
893 .\" ******** module ds ********
894 .\" ***************************
895 .\" Displays and non-floating keeps.
897 .ds*end!\\n[\\n[.ev]:ds-type]
898 .nr \\n[.ev]:ds-type 0
901 .if \\n[\\n[.ev]:ds-type] \{\
902 . @error automatically terminating display
907 .ie \\n[\\n[.ev]:ds-type] .DE
911 .@error DE without DS, ID, CD, LD or BD
915 .nr \\n[.ev]:ds-type 1
922 .ie \\n[.$] .in +(n;\\$1)
937 .als ds*end!1 ds*common-end
940 .nr \\n[.ev]:ds-type 2
945 .ie '\\n(.z'ds*div' \{\
948 . in (u;\\n[.l]-\\n[dl]/2>?0)
953 .el .@error-recover mismatched DE
960 . nr \\n[.ev]:ds-type 4
969 . ie '\\$1'I' .ID \\$2
974 . nr \\n[.ev]:ds-type 3
979 . while \\n[.t]<=(\\$1)&(\\n[nl]>\\n[pg@header-bottom]) \{\
987 .ie '\\n(.z'ds*div' \{\
996 .el .@error-recover mismatched DE
999 .ie '\\n(.z'ds*div' \{\
1003 . in (u;\\n[.l]-\\n[dl]/2>?0)
1009 .el .@error-recover mismatched DE
1011 .\" ****************************
1012 .\" ******** module par ********
1013 .\" ****************************
1014 .\" Paragraph-level formatting.
1015 .\" Load time initialization.
1017 .\" PS and VS might have been set on the command-line
1021 .\" don't set LT so that it can be defaulted from LL
1022 .ie rLT .lt \\n[LT]u
1024 .ie (\\n[PS] >= 1000) \
1025 . ps (\\n[PS]z / 1000u)
1028 .\" don't set VS so that it can be defaulted from PS
1030 . ie (\\n[VS] >= 1000) \
1031 . par*vs "(\\n[VS]p / 1000u)"
1036 . ie (\\n[PS] >= 1000) \
1037 . par*vs "((\\n[PS]p / 1000u) + 2p)"
1039 . par*vs "(\\n[PS] + 2)"
1041 .if dFAM .fam \\*[FAM]
1045 .CHECK-FOOTER-AND-KEEP
1048 .\" If it's too big to be in points, treat it as units.
1049 .ie (p;\\$1)>=40p .vs (u;\\$1)
1053 .nr 0:li (u;\\n[LL]/12)
1060 .aln \\n[.ev]:MCLL LL
1062 .aln \\n[.ev]:MCLT LT
1068 .\" happens when the first page begins
1070 .if !rLT .nr LT \\n[LL]
1071 .if !rFL .nr FL \\n[LL]*5/6
1073 . ie (\\n[PS] >= 1000) \
1074 . nr VS (\\n[PS] + 2000)
1076 . nr VS (\\n[PS] + 2)
1080 . ie (\\n[PS] >= 1000) \
1081 . nr FPS (\\n[PS] - 2000)
1083 . nr FPS (\\n[PS] - 2)
1086 . ie (\\n[FPS] >= 1000) \
1087 . nr FVS (\\n[FPS] + 2000)
1089 . nr FVS (\\n[FPS] + 2)
1091 .\" don't change environment 0
1093 .ie (\\n[PS] >= 1000) \
1094 . ps (\\n[PS]z / 1000u)
1099 .ie (\\n[VS] >= 1000) \
1100 . par*vs "(\\n[VS]p / 1000u)"
1103 .if !rPD .nr PD .3v>?\n(.V
1104 .if !rDD .nr DD .5v>?\n(.V
1106 .if !rFPD .nr FPD \\n[PD]/2
1108 .if !dFAM .ds FAM \\n[.fam]
1130 .aln fn:MCLL pg@fn-colw
1131 .aln fn:MCLT pg@fn-colw
1137 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1140 .nr \\n[.ev]:ds-type 0
1145 .if \\n[need_eo_tl]>0 .DEVTAG-EO-TL
1147 .if \\n[need_eo_h]>0 .DEVTAG-EO-H
1153 .ie \\n[pg@ncols]>1 \{\
1154 . ll (u;\\n[\\n[.ev]:MCLL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1155 . lt \\n[\\n[.ev]:MCLT]u
1158 . ll (u;\\n[\\n[.ev]:LL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1159 . lt \\n[\\n[.ev]:LT]u
1161 .in (u;\\n[\\n[.ev]:li]+\\n[\\n[.ev]:pli])
1164 .ie (\\n[\\n[.ev]:PS] >= 1000) \
1165 . ps (\\n[\\n[.ev]:PS]z / 1000u)
1167 . ps \\n[\\n[.ev]:PS]
1168 .ie (\\n[\\n[.ev]:VS] >= 1000) \
1169 . par*vs "(\\n[\\n[.ev]:VS]p / 1000u)"
1171 . par*vs \\n[\\n[.ev]:VS]
1181 .\" This can be redefined by the user.
1185 .\" \n[PORPHANS] sets number of initial lines of any paragraph,
1186 .\" which must be kept together, without any included page break.
1187 .\" Initialise to reproduce original behaviour; user may adjust it.
1188 .if !rPORPHANS .nr PORPHANS 1
1192 .nr \\n[.ev]:pli \\$1
1193 .nr \\n[.ev]:pri \\$2
1195 .sp \\n[\\n[.ev]:PD]u
1196 .ne \\n[PORPHANS]v+\\n(.Vu
1206 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1210 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1211 .if !'\*(.T'html' .ti +\\n[\\n[.ev]:ai]u
1214 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1215 .par*start \\n[QI] \\n[QI]
1218 .par*start \\n[\\n[.ev]:PI] 0
1219 .ti -\\n[\\n[.ev]:PI]u
1222 .if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
1223 .par*start \\n[\\n[.ev]:ai] 0
1225 . \" Divert the label so as to freeze any spaces.
1232 . ti -\\n[\\n[.ev]:ai]u
1233 . ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \{\
1235 \\*[par*label]\h'|\\n[\\n[.ev]:ai]u'\c
1247 .\" We don't want margin characters to be attached when we divert
1248 .\" the tag. Since there's no way to save and restore the current
1249 .\" margin character, we have to switch to a new environment, taking
1250 .\" what we need of the old environment with us.
1251 .de par*push-tag-env
1252 .nr par*saved-font \\n[.f]
1253 .nr par*saved-size \\n[.s]z
1254 .nr par*saved-ss \\n[.ss]
1255 .ds par*saved-fam \\n[.fam]
1259 .ft \\n[par*saved-font]
1260 .ps \\n[par*saved-size]u
1261 .ss \\n[par*saved-ss]
1262 .fam \\*[par*saved-fam]
1269 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1270 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1271 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1272 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1273 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1275 .nr \\n[.ev]:li +\\n[\\n[.ev]:ai]
1276 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1281 .ie \\n[\\n[.ev]:il] \{\
1283 . nr \\n[.ev]:ai \\n[\\n[.ev]:ai!\\n[\\n[.ev]:il]]
1284 . nr \\n[.ev]:li \\n[\\n[.ev]:li!\\n[\\n[.ev]:il]]
1285 . nr \\n[.ev]:ri \\n[\\n[.ev]:ri!\\n[\\n[.ev]:il]]
1286 . nr \\n[.ev]:pli \\n[\\n[.ev]:pli!\\n[\\n[.ev]:il]]
1287 . nr \\n[.ev]:pri \\n[\\n[.ev]:pri!\\n[\\n[.ev]:il]]
1289 .el .@error unbalanced \\$0
1294 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1295 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1296 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1297 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1298 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1300 .nr \\n[.ev]:li +\\n[QI]
1301 .nr \\n[.ev]:ri +\\n[QI]
1302 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1306 .\" start boxed text
1313 .nr par*box-in \\n[.in]
1314 .\" remember what 1n is, just in case the point size changes
1319 .ti \\n[par*box-in]u+1n
1321 .de @div-end!par*box-div
1325 .\" Postpone the drawing of the box until we're in the top-level diversion,
1326 .\" in case there's a footnote inside the box.
1328 .ie '\\n(.z'par*box-div' \{\
1330 . if \n[.V]>.25m .sp
1332 . if \n[.V]>.25m .sp
1338 . nr \\n[.ev]:ri -\\n[par*box-n]
1339 . nr \\n[.ev]:li -\\n[par*box-n]
1340 . in -\\n[par*box-n]u
1341 . ll +\\n[par*box-n]u
1342 . lt +\\n[par*box-n]u
1343 . par*box-draw \\n[.i]u \\n[.l]u-(\\n[.H]u==1n*1n)
1345 .el .@error B2 without B1
1348 .de par*box-mark-top
1353 .el \!.par*box-mark-top
1357 . nr par*box-in \\n[.i]
1358 . nr par*box-ll \\n[.l]
1359 . nr par*box-vpt \\n[.vpt]
1360 . nr par*box-ad \\n[.j]
1366 \D'l (u;\\n[.l]-\\n[.i]) 0'\
1367 \D'l 0 |\\n[par*box-top]u'\
1368 \D'l -(u;\\n[.l]-\\n[.i]) 0'\
1369 \D'l 0 -|\\n[par*box-top]u'
1372 . in \\n[par*box-in]u
1373 . ll \\n[par*box-ll]u
1374 . vpt \\n[par*box-vpt]
1375 . ad \\n[par*box-ad]
1377 .el \!.par*box-draw \\$1 \\$2
1379 .\" \n[HORPHANS] sets how many lines of the following paragraph must be
1380 .\" kept together, with a preceding section header. Initialise it,
1381 .\" to reproduce original behaviour; user may change it.
1382 .if !rHORPHANS .nr HORPHANS 1
1384 .\" \n[GROWPS] and \n[PSINCR] cause auto-increment of header point size.
1385 .\" Initialise them, so they have no effect, unless explicitly set by the user.
1386 .if !rGROWPS .nr GROWPS 0
1387 .if !rPSINCR .nr PSINCR 1p
1391 .\" Keep the heading and the first few lines of the next paragraph together.
1392 .\" (\n[HORPHANS] defines "first few" -- default = 1; user may redefine it).
1393 .nr sh*minvs \\n[HORPHANS]v
1394 .if \\n[sh*psincr]<0 .nr sh*psincr 0
1395 .ie \\n(VS<1000 .par*vs \\n(VSp+\\n[sh*psincr]u
1396 .el .par*vs \\n(VSp/1000u+\\n[sh*psincr]u
1397 .ne 2v+\\n[sh*minvs]u+\\n[\\n[.ev]:PD]u+\\n(.Vu
1398 .\" Adjust point size for heading text, as specified by \n[GROWPS] and \n[PSINCR].
1399 .ie \\n(PS<1000 .ps \\n(PS+\\n[sh*psincr]u
1400 .el .ps \\n(PSz/1000u+\\n[sh*psincr]u
1405 .\" Standard ms implementation does not expect an argument,
1406 .\" but allow ".SH n" to make heading point size match ".NH n",
1407 .\" for same "n", when \n[GROWPS] and \n[PSINCR] are set.
1409 . if 0\\$1>0 .nr sh*psincr (\\n[GROWPS]-0\\$1)*\\n[PSINCR]
1412 . if '\*(.T'html' .nr need_eo_h 1
1414 .\" TL, AU, and AI are aliased to these in cov*ab-init.
1436 .\" In paragraph macros.
1438 .ie (\\n[\\n[.ev]:PS] >= 1000) \
1439 . ps (\\n[\\n[.ev]:PS]z / 1000u)
1441 . ps \\n[\\n[.ev]:PS]
1452 .\" par*define-font-macro macro font
1453 .de par*define-font-macro
1456 . nr par*prev-font \En[.f]
1457 \&\E$3\f[\\$2]\E$1\f[\En[par*prev-font]]\E$2
1462 .par*define-font-macro B B
1463 .par*define-font-macro I I
1464 .par*define-font-macro BI BI
1465 .par*define-font-macro CW CR
1466 .\" underline a word
1468 \Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m'\\$2
1472 .nr par*bxw \w'\\$1'+.4m
1473 \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''\
1477 .\" The first time UX is used, put a registered mark after it.
1480 \s[\\n[.s]*8u/10u]UNIX\s0\\$1\\*[par*ux-rg]
1483 .ds par@sup-start \v'-.9m\s'\En[.s]*7u/10u'+.7m'
1484 .als { par@sup-start
1485 .ds par@sup-end \v'-.7m\s0+.9m'
1487 .\" footnote paragraphs
1488 .\" FF is the footnote format
1490 .\" This can be redefined. It gets a second argument of `no' if the first
1491 .\" argument was supplied by the user, rather than automatically.
1494 .if !d par*fp!\\n[FF] \{\
1495 . @error unknown footnote format `\\n[FF]'
1498 .ie '\\$2'no' .par*fp!\\n[FF]-no "\\$1"
1499 .el .par*fp!\\n[FF] "\\$1"
1503 \&\\*[par@sup-start]\\$1\\*[par@sup-end]\ \c
1526 .@IP "\\$1." (u;\\n[\\n[.ev]:PI]*2)
1529 .@IP "\\$1" (u;\\n[\\n[.ev]:PI]*2)
1531 .\" ***************************
1532 .\" ******** module nh ********
1533 .\" ***************************
1534 .\" Numbered headings.
1535 .\" nh*hl is the level of the last heading
1537 .\" SN-DOT and SN-NO-DOT represent the section number of
1538 .\" the current heading, with and without a terminating dot.
1541 .\" SN-STYLE sets the statement numbering style used in headings
1542 .\" (either SN-DOT or SN-NO-DOT); for backward compatibility with
1543 .\" earlier ms versions, the default is SN-DOT
1544 .als SN-STYLE SN-DOT
1545 .\" Also for backward compatibility, let SN represent SN-DOT.
1547 .\" numbered heading
1554 . nr H\\n[nh*hl] 0\\$1
1557 . if !\\n[nh*hl] \{\
1560 . @error missing arguments to .NH S
1564 . nr nh*ohl \\n[nh*hl]
1567 . ie \\n[nh*hl]<=0 \{\
1572 . if \\n[nh*hl]-\\n[nh*ohl]>1 \
1573 . @warning .NH \\n[nh*ohl] followed by .NH \\n[nh*hl]
1577 . while \\n[nh*hl]>\\n[nh*ohl] \{\
1583 .ds SN-NO-DOT \\n(H1
1585 .while \\n[nh*i]<\\n[nh*hl] \{\
1587 . as SN-NO-DOT .\\n[H\\n[nh*i]]
1589 .ds SN-DOT \\*[SN-NO-DOT].
1590 .nr sh*psincr (\\n[GROWPS]-\\n[nh*hl])*\\n[PSINCR]
1593 . if '\*(.T'html' .nr need_eo_h 1
1596 .\" ****************************
1597 .\" ******** module toc ********
1598 .\" ****************************
1599 .\" Table of contents generation.
1603 .ie \\n[.$] .XA "\\$1"
1606 .de @div-end!toc*div
1610 .ie '\\n(.z'toc*div' \{\
1611 . if d toc*num .toc*end-entry
1613 . ie '\\$1'no' .ds toc*num
1614 . el .ds toc*num "\\$1
1616 . el .ds toc*num \\n[PN]
1623 .el .@error XA without XS
1626 .ie '\\n(.z'toc*div' \{\
1627 . if d toc*num .toc*end-entry
1631 .el .@error XE without XS
1642 . ie (\\n[PS] >= 1000) \
1643 . ps ((\\n[PS]z / 1000u) + 2z)
1652 .char \[toc*leader-char] .\h'1m'
1653 .lc \[toc*leader-char]
1654 .ta (u;\\n[.l]-\\n[.i]-\w'000') (u;\\n[.l]-\\n[.i])R
1659 .\" print the table of contents on page i
1665 .\" ****************************
1666 .\" ******** module eqn ********
1667 .\" ****************************
1676 .ie '\\$1'L' .nr eqn*type 0
1678 . ie '\\$1'I' .nr eqn*type 1
1681 . if !'\\$1'C' .ds eqn*num "\\$1
1686 .if \\n[eqn*type]=0 .HTML-IMAGE-LEFT
1687 .if \\n[eqn*type]=1 \{\
1688 . if '\*(.T'html' .RS
1691 .if \\n[eqn*type]=2 .HTML-IMAGE
1694 .de @div-end!eqn*div
1697 .\" Note that geqn mark and lineup work correctly in centered equations.
1699 .ie !'\\n(.z'eqn*div' .@error-recover mismatched EN
1704 . if !'\\*[eqn*num]'' .nr eqn*have-num 1
1705 . ie \\n[dl]:\\n[eqn*have-num] \{\
1708 . ds eqn*tabs \\n[.tabs]
1711 .\" --fixme-- this really should not be necessary
1712 .\" and indicates that there is extra space creeping into
1713 .\" an equation when ps4html is enabled..
1714 . ie r ps4html .ds@need \\n[dn]u-1v+\n[.V]u+1i
1715 . el .ds@need \\n[dn]u-1v+\n[.V]u
1717 . ie \\n[eqn*type]=0 \{\
1718 . ta (u;\\n[.l]-\\n[.i])R
1719 \\*[eqn*div]\t\\*[eqn*num]
1722 . ie \\n[eqn*type]=1 .ta \\n[DI]u \
1723 (u;\\n[.l]-\\n[.i])R
1724 . el .ta (u;\\n[.l]-\\n[.i]/2)C \
1725 (u;\\n[.l]-\\n[.i])R
1726 \t\\*[eqn*div]\t\\*[eqn*num]
1730 . ta (u;\\n[.l]-\\n[.i])R
1733 .\". if !'\*(.T'html' .sp \\n[DD]u
1738 .\" must terminate empty equations in html and ps4html as they contain
1739 .\" the HTML-IMAGE-END suppression nodes
1740 . if \\n[dl] .chop eqn*div
1741 . if '\*(.T'html' \\*[eqn*div]
1742 . if r ps4html \\*[eqn*div]
1744 . if !'\*(.T'html' .fi
1745 . if \\n[eqn*type]=0 .HTML-IMAGE-END
1746 . if \\n[eqn*type]=1 \{\
1748 . if '\*(.T'html' .RE
1750 . if \\n[eqn*type]=2 .HTML-IMAGE-END
1753 .\" ****************************
1754 .\" ******** module tbl ********
1755 .\" ****************************
1757 .nr tbl*have-header 0
1758 .\" This gets called if TS occurs before the first paragraph.
1761 .\" cov*ab-init aliases TS to @TS
1766 .if '\\$1'H' .di tbl*header-div
1770 .if \\n[tbl*have-header] \{\
1771 . ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl*print-header
1775 .de tbl*print-header
1782 .ie '\\n[.z]'tbl*header-div' \{\
1787 . ie \\n[dn]+\\n[FM]+\\n[HM]+2v>=\\n[.p] \{\
1788 . @error ridiculously long table header
1793 . nr tbl*header-ht \\n[dn]
1794 . ds@need \\n[dn]u+1v
1796 . nr tbl*have-header 1
1799 .el .@error-recover .TH without .TS H
1801 .de @div-end!tbl*header-div
1806 .ie '\\n(.z'tbl*header-div' .@error-recover .TS H but no .TH before .TE
1808 . nr tbl*have-header 0
1809 . if !'\*(.T'html' .sp \\n[DD]u
1816 .if \\n[tbl*have-header] \{\
1823 .\" ****************************
1824 .\" ******** module pic ********
1825 .\" ****************************
1831 .ie \\n[.$]<2 .@error bad arguments to PS (not preprocessed with pic?)
1833 . ds@need (u;\\$1)+1v
1834 . in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)
1843 .\" ****************************
1844 .\" ******** module ref ********
1845 .\" ****************************
1848 .rm [A [B [C [D [E [G [I [J [N [O [P [Q [R [S [T [V
1852 .ds ref*spec!0 Q A T1 S V N P I C D O
1854 .ds ref*spec!1 Q A T2 J S V N P I C D O
1856 .ds ref*spec!2 Q A T1 S V P I C D O
1857 .\" Article within book
1858 .ds ref*spec!3 Q A T2 B E S V P I C D O
1860 .ds ref*spec!4 Q A T2 R G P I C D O
1867 .ie d ref*spec!\\$1 .ref*build \\*[ref*spec!\\$1]
1869 . @error unknown reference type `\\$1'
1870 . ref*build \\*[ref*spec!0]
1876 .\" start of reference number
1877 .ds [. \E*[par@sup-start]
1878 .\" end of reference number
1879 .ds .] \E*[par@sup-end]
1880 .\" period before reference
1882 .\" period after reference
1884 .\" comma before reference
1886 .\" comma after reference
1888 .\" start collected references
1890 .als ref*print ref*end-print
1895 .\" end collected references
1898 .als ref*print ref*normal-print
1900 .de ref*normal-print
1901 .ie d [F .FS "\\*([.\\*([F\\*(.]"
1907 .ie d [F .IP "\\*([F."
1911 .als ref*print ref*normal-print
1913 .rm ref*string ref*post-punct
1914 .nr ref*suppress-period 1
1917 . ie d ref*add-\\$1 .ref*add-\\$1
1918 . el .ref*add-dflt \\$1
1922 .\" now add a final period
1923 .ie d ref*string \{\
1924 . if !\\n[ref*suppress-period] .as ref*string .
1925 . if d ref*post-punct \{\
1926 . as ref*string "\\*[ref*post-punct]
1933 .ref*field T , " " "\fI" "" "\fP"
1934 .if r [T .nr ref*suppress-period \\n([T
1937 .ref*field T , " " "\\*Q" "" "\\*U"
1938 .if r [T .nr ref*suppress-period \\n([T
1941 .ie \\n([P>0 .ref*field P , " " "pp. "
1942 .el .ref*field P , " " "p. "
1945 .ref*field J , " " \fI "" \fP
1948 .ref*field D "" " " ( )
1951 .ref*field E , " " "ed. "
1954 .ref*field G "" " " ( )
1957 .ref*field B "" " " "in \fI" "" \fP
1961 .ie r [O .nr ref*suppress-period \\n([O
1962 .el .nr ref*suppress-period 1
1966 .if r [A .nr ref*suppress-period \\n([A
1969 .ref*field V "" " " \fB \fR
1972 .ref*field N "" ( "" ")"
1975 .ref*field \\$1 , " "
1977 .\" First argument is the field letter.
1978 .\" Second argument is the punctuation character to use to separate this field
1979 .\" from the previous field.
1980 .\" Third argument is a string to insert after the punctuation character of
1981 .\" the previous field (normally a space)
1982 .\" Fourth argument is a string with which to prefix this field.
1983 .\" Fifth argument is a string with which to postfix this field.
1984 .\" Sixth argument is a string to add after the punctuation character supplied
1985 .\" by the next field.
1987 .if d ref*string \{\
1988 . ie d ref*post-punct \{\
1989 . as ref*string "\\$2\\*[ref*post-punct]\\$3\"
1992 . el .as ref*string "\\$2\\$3\"
1994 .as ref*string "\\$4\\*([\\$1\\$5
1995 .if \\n[.$]>5 .ds ref*post-punct "\\$6
1996 .nr ref*suppress-period 0
1998 .\" ****************************
1999 .\" ******** module acc ********
2000 .\" ****************************
2001 .\" Accents and special characters.
2006 .\" The idea of this definition is for the top of the 3 to be at the x-height.
2007 .if !c\[yogh] .char \[yogh] \Z'\v'\w'x'*0-\En[rst]u'\s[\En[.s]*8u/10u]\
2008 \v'\w'3'*0+\En[rst]u'3\s0'\h'\w'\s[\En[.s]*8u/10u]3'u'
2011 .ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
2012 \h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
2015 .ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
2018 .ds \\$1 \Z'\h'(u;-\En[.w]-\w'\\$2'/2)'\
2019 \v'(u;\En[.cdp]-\En[.cht]+\En[rst]+\En[rsb]/2)'\\$2'
2022 .ds \\$1 \Z'\h'(u;\w'x'-\w'\\$2'/2)'\\$2'
2024 .acc*prefix-def ' \'
2025 .acc*prefix-def ` \`
2027 .acc*prefix-def , \(ac
2028 .acc*prefix-def : \(ad
2030 .\" improved accent marks
2036 .acc*over-def : \(ad
2037 .acc*over-def v \(ah
2038 .acc*over-def _ \(a-
2039 .acc*over-def o \(ao
2040 .acc*under-def , \(ac
2041 .acc*under-def . \s[\En[.s]*8u/10u]\v'.2m'.\v'-.2m'\s0
2042 .acc*under-def hook \(ho
2044 .char \[hooko] o\E*[hook]
2047 .ds D- \(-D\" Icelandic uppercase eth
2048 .ds d- \(Sd\" Icelandic lowercase eth
2049 .ds Th \(TP\" Icelandic uppercase thorn
2050 .ds th \(Tp\" Icelandic lowercase thorn
2051 .ds 8 \(ss\" German double s
2052 .ds Ae \(AE\" AE ligature
2053 .ds ae \(ae\" ae ligature
2054 .ds Oe \(OE\" OE ligature
2055 .ds oe \(oe\" oe ligature
2056 .ds ? \(r?\" upside down ?
2057 .ds ! \(r!\" upside down !
2059 .de CHECK-FOOTER-AND-KEEP
2060 .\" it might be better to als FS -> B1 and FE -> B2
2061 .\" however this produced wierd results, so I've moved back to a more reliable
2062 .\" but less interesting solution --fixme--
2063 . if '\*(.T'html' \{\
2091 .\" ****************************
2092 .\" ******** module bell ********
2093 .\" ****************************
2094 .\" Emulate Bell Labs localisms. Note, (a) they're not documented, and
2095 .\" (b) the .P1 and .UC macros collide with different ones in Berkeley ms.
2096 .\" We hack around this by conditionalizing the behavior of P1; UC was
2097 .\" not defined by groff and will be a no-op if called Berkeley style
2098 .\" with no arguments, so there is no problem with hijacking it here.
2100 .\" What's done here is sufficient to give back the Guide to EQN (1976) its
2101 .\" section headings and restore some text that had gone missing as macro
2102 .\" arguments; no warranty express or implied is given as to how well the
2103 .\" typographic details these produce match the original Bell Labs macros.
2105 .\" P1 is now defined in module pg.
2107 .nr bell_localisms 1
2112 .if r bell_localisms \f(CW\\$*\fP
2115 .if r bell_localisms \{\
2120 .\" Make sure that no blank lines creep in at the end of this file.