* Imakefile replaced with Imakefile.in
[s-roff.git] / tmac / tmac.s
blob6770b0dfb02a288187e75e621296c452c7b9bb7b
1 .\" -*- nroff -*-
2 .ig
3 Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
4 Written by James Clark (jjc@jclark.com)
6 This file is part of groff.
8 groff is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
11 version.
13 groff is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
18 You should have received a copy of the GNU General Public License along
19 with groff; see the file COPYING. If not, write to the Free Software
20 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 .if !\n(.g .ab These ms macros require groff.
23 .if \n(.C \
24 . ab The groff ms macros do not work in compatibility mode.
25 .\" Enable warnings. You can delete this if you want.
26 .warn
27 .\" See if already loaded.
28 .if r GS .nx
29 .nr GS 1
30 .de @error
31 .tm \\n(.F:\\n(.c: macro error: \\$*
33 .de @warning
34 .tm \\n(.F:\\n(.c: macro warning: \\$*
36 .de @fatal
37 .ab \\n(.F:\\n(.c: fatal macro error: \\$*
39 .de @not-implemented
40 .@error sorry, \\$0 not implemented
41 .als \\$0 @nop
43 .als TM @not-implemented
44 .als CT @not-implemented
45 .de @nop
47 .de @init
48 .nr PO \\n(.o
49 .\" a non-empty environment
50 .ev ne
52 .ev
53 .ev nf
54 'nf
55 .ev
57 .ds REFERENCES References
58 .ds ABSTRACT ABSTRACT
59 .ds TOC Table of Contents
60 .ds MONTH1 January
61 .ds MONTH2 February
62 .ds MONTH3 March
63 .ds MONTH4 April
64 .ds MONTH5 May
65 .ds MONTH6 June
66 .ds MONTH7 July
67 .ds MONTH8 August
68 .ds MONTH9 September
69 .ds MONTH10 October
70 .ds MONTH11 November
71 .ds MONTH12 December
72 .ds MO \\*[MONTH\n[mo]]
73 .ds DY \n[dy] \*[MO] \n[year]
74 .de ND
75 .if \\n[.$] .ds DY "\\$*
77 .de DA
78 .if \\n[.$] .ds DY "\\$*
79 .ds CF \\*[DY]
81 .\" indexing
82 .de IX
83 .tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[PN]
85 .\" print an error message and then try to recover
86 .de @error-recover
87 .@error \\$@ (recovering)
88 .nr *pop-count 0
89 .while !'\\n(.z'' \{\
90 . \"@warning automatically terminating diversion \\n(.z
91 . ie d @div-end!\\n(.z .@div-end!\\n(.z
92 . el .*div-end-default
93 . nr *pop-count +1
94 . \" ensure that we don't loop forever
95 . if \\n[*pop-count]>20 .@fatal recovery failed
96 .\}
97 .while !'\\n[.ev]'0' .ev
98 .par@reset-env
99 .par@reset
101 .de *div-end-default
102 .ds *last-div \\n(.z
105 .ev nf
106 .\\*[*last-div]
109 .\" ****************************
110 .\" ******** module cov ********
111 .\" ****************************
112 .\" Cover sheet and first page.
113 .de cov*err-not-after-first-page
114 .@error \\$0 is not allowed after the first page has started
116 .de cov*err-not-before-tl
117 .@error \\$0 is not allowed before TL
119 .de cov*err-not-again
120 .@error \\$0 is not allowed more than once
122 .de cov*err-not-after-ab
123 .@error \\$0 is not allowed after first AB, LP, PP, IP, SH or NH
125 .als AU cov*err-not-before-tl
126 .als AI cov*err-not-before-tl
127 .als AB cov*err-not-before-tl
128 .de cov*first-page-init
129 .rm cov*first-page-init
130 .par@init
131 .als RP cov*err-not-after-first-page
132 .@init
133 .ie \\n[cov*rp-format] \{\
134 . pg@cs-top
135 . als FS cov*FS
136 . als FE cov*FE
138 .el \{\
139 . pg@top
140 . als FS @FS
141 . als FE @FE
143 .wh 0 pg@top
145 .wh 0 cov*first-page-init
146 .\" This handles the case where FS occurs before TL or LP.
147 .de FS
149 \\*[FS]\\
151 .nr cov*rp-format 0
152 .nr cov*rp-no 0
153 .\" released paper format
154 .de RP
155 .nr cov*rp-format 1
156 .if \\n[.$] .if '\\$1'no' .nr cov*rp-no 1
157 .pn 0
159 .de TL
161 .als TL cov*err-not-again
162 .rn @AB AB
163 .rn @AU AU
164 .rn @AI AI
165 .di cov*tl-div
166 .par@reset
167 .ft B
168 .ps +2
169 .vs +3p
170 .ll (u;\\n[LL]*5/6)
171 .nr cov*n-au 0
173 .de @AU
174 .par@reset
175 .if !'\\n(.z'' \{\
176 . br
177 . di
179 .nr cov*n-au +1
180 .di cov*au-div!\\n[cov*n-au]
182 .ft I
183 .ps \\n[PS]
185 .de @AI
186 .par@reset
187 .if !'\\n(.z'' \{\
188 . br
189 . di
191 .ie !\\n[cov*n-au] .@error AI before AU
192 .el \{\
193 . di cov*ai-div!\\n[cov*n-au]
194 . nf
195 . ft R
196 . ps \\n[PS]
199 .de LP
200 .if !'\\n[.z]'' \{\
201 . br
202 . di
205 .cov*ab-init
206 .cov*print
207 \\*[\\$0]\\
209 .als IP LP
210 .als PP LP
211 .als XP LP
212 .als QP LP
213 .als RS LP
214 .als NH LP
215 .als SH LP
216 .als MC LP
217 .als RT LP
218 .als XS LP
219 .de cov*ab-init
220 .als cov*ab-init @nop
221 .als LP @LP
222 .als IP @IP
223 .als PP @PP
224 .als XP @XP
225 .als RT @RT
226 .als XS @XS
227 .als SH @SH
228 .als NH @NH
229 .als QP @QP
230 .als RS @RS
231 .als RE @RE
232 .als QS @QS
233 .als QE @QE
234 .als MC @MC
235 .als EQ @EQ
236 .als EN @EN
237 .als TS @TS
238 .als AB cov*err-not-after-ab
239 .als AU par@AU
240 .als AI par@AI
241 .als TL par@TL
243 .de @AB
244 .if !'\\n(.z'' \{\
245 . br
246 . di
248 .cov*ab-init
249 .di cov*ab-div
250 .par@ab-indent
251 .par@reset
252 .if !'\\$1'no' \{\
253 . ft I
254 . ce 1
255 \\*[ABSTRACT]
256 . sp
257 . ft R
260 .@PP
262 .de AE
263 .ie '\\n(.z'cov*ab-div' \{\
264 . als AE cov*err-not-again
265 . br
266 . di
267 .\" nr cov*ab-height \\n[dn]
268 . par@reset-env
269 . par@reset
270 . cov*print
272 .el .@error AE without AB
274 .de @div-end!cov*ab-div
277 .de cov*print
278 .als cov*print @nop
279 .ie d cov*tl-div \{\
280 . ie \\n[cov*rp-format] .cov*rp-print
281 . el .cov*draft-print
283 .el \{\
284 . if \\n[cov*rp-format] \{\
285 . @warning RP format but no TL
286 . bp 1
287 . als FS @FS
288 . als FE @FE
289 . \}
290 . br
293 .de cov*rp-print
294 .nr cov*page-length \\n[.p]
295 .pl 1000i
296 .cov*tl-au-print
297 .sp 3
298 .if d cov*ab-div \{\
299 . nf
300 . cov*ab-div
302 .sp 3
303 .par@reset
304 \\*[DY]
306 .if \\n[cov*fn-height] \{\
307 . sp |(u;\\n[cov*page-length]-\\n[FM]\
308 -\\n[cov*fn-height]-\\n[fn@sep-dist]>?\\n[nl])
309 . fn@print-sep
310 . ev nf
311 . cov*fn-div
312 . ev
313 . ie \\n[cov*rp-no] .rm cov*fn-div
314 . el \{\
315 . rn cov*fn-div fn@overflow-div
316 . nr fn@have-overflow 1
317 . \}
319 .als FS @FS
320 .als FE @FE
321 .\" If anything was printed below where the footer line is normally printed,
322 .\" then that's an overflow.
323 .if -\\n[FM]/2+1v+\\n[cov*page-length]<\\n[nl] .@error cover sheet overflow
324 .pl \\n[cov*page-length]u
325 .bp 1
326 .if !\\n[cov*rp-no] .cov*tl-au-print
328 .sp 1
330 .de cov*draft-print
331 .cov*tl-au-print
332 .if d cov*ab-div \{\
333 . nf
334 . sp 2
335 . cov*ab-div
337 .sp 1
339 .de cov*tl-au-print
340 .par@reset
343 .sp 3
344 .ce 9999
345 .cov*tl-div
346 .nr cov*i 1
347 .nr cov*sp 1v
348 .while \\n[cov*i]<=\\n[cov*n-au] \{\
349 . sp \\n[cov*sp]u
350 . cov*au-div!\\n[cov*i]
351 . ie d cov*ai-div!\\n[cov*i] \{\
352 . sp .5v
353 . cov*ai-div!\\n[cov*i]
354 . nr cov*sp 1v
355 . \}
356 . el .nr cov*sp .5v
357 . nr cov*i +1
359 .ce 0
361 .nr cov*fn-height 0
362 .nr cov*in-fn 0
363 .\" start of footnote on cover
364 .de cov*FS
365 .if \\n[cov*in-fn] \{\
366 . @error nested FS
367 . FE
369 .nr cov*in-fn 1
370 .ev fn
371 .par@reset-env
372 .da cov*fn-div
373 .if !\\n[cov*fn-height] .ns
374 .ie \\n[.$] .FP "\\$1" no
375 .el .@LP
377 .de @div-end!cov*fn-div
378 .cov*FE
380 .\" end of footnote on cover
381 .de cov*FE
382 .ie '\\n(.z'cov*fn-div' \{\
383 . br
384 . ev
385 . di
386 . nr cov*in-fn 0
387 . nr cov*fn-height +\\n[dn]
389 .el .@error FE without matching FS
391 .\" ***************************
392 .\" ******** module pg ********
393 .\" ***************************
394 .\" Page-level formatting.
395 .\" > 0 if we have a footnote on the current page
396 .nr pg@fn-flag 0
397 .nr pg@colw 0
398 .nr pg@fn-colw 0
399 .nr HM 1i
400 .nr FM 1i
401 .ds LF
402 .ds CF
403 .ds RF
404 .ds LH
405 .ds CH -\\n[PN]-
406 .ds RH
407 .ds pg*OH '\\*[LH]'\\*[CH]'\\*[RH]'
408 .ds pg*EH '\\*[LH]'\\*[CH]'\\*[RH]'
409 .ds pg*OF '\\*[LF]'\\*[CF]'\\*[RF]'
410 .ds pg*EF '\\*[LF]'\\*[CF]'\\*[RF]'
411 .de OH
412 .ds pg*\\$0 "\\$*
414 .als EH OH
415 .als OF OH
416 .als EF OH
417 .de PT
418 .ie \\n%=1 .if \\n[pg*P1] .tl \\*[pg*OH]
419 .el \{\
420 . ie o .tl \\*[pg*OH]
421 . el .tl \\*[pg*EH]
424 .de BT
425 .ie o .tl \\*[pg*OF]
426 .el .tl \\*[pg*EF]
428 .nr pg*P1 0
429 .de P1
430 .nr pg*P1 1
432 .wh -\n[FM]u pg@bottom
433 .wh -\n[FM]u/2u pg*footer
434 .nr MINGW 2n
435 .nr pg@ncols 1
436 .de @MC
437 .if !'\\n(.z'' .error-recover MC while diversion open
439 .ie \\n[pg@ncols]>1 .pg@super-eject
440 .el \{\
441 . \" flush out any floating keeps
442 . while \\n[kp@tail]>\\n[kp@head] \{\
443 . rs
444 . bp
445 . \}
447 .ie !\\n(.$ \{\
448 . nr pg@colw \\n[LL]*7/15
449 . nr pg*gutw \\n[LL]-(2*\\n[pg@colw])
450 . nr pg@ncols 2
452 .el \{\
453 . nr pg@colw (n;\\$1)<?\\n[LL]
454 . ie \\n[.$]<2 .nr pg*gutw \\n[MINGW]
455 . el .nr pg*gutw (n;\\$2)
456 . nr pg@ncols \\n[LL]-\\n[pg@colw]/(\\n[pg@colw]+\\n[pg*gutw])+1
457 . ie \\n[pg@ncols]>1 \
458 . nr pg*gutw \\n[LL]-(\\n[pg@ncols]*\\n[pg@colw])/(\\n[pg@ncols]-1)
459 . el .nr pg*gutw 0
461 .mk pg*col-top
463 .nr pg*col-num 0
464 .nr pg@fn-colw \\n[pg@colw]*5/6
465 .par@reset
467 .de 2C
470 .de 1C
471 .MC \\n[LL]u
473 .\" top of page macro
474 .de pg@top
475 .ch pg*footer -\\n[FM]u/2u
476 .nr PN \\n%
477 .nr pg*col-num 0
478 .nr pg@fn-bottom-margin 0
479 .nr pg*saved-po \\n[PO]
480 .po \\n[PO]u
481 .ev h
482 .par@reset
483 .sp (u;\\n[HM]/2)
485 .sp |\\n[HM]u
486 .if d HD .HD
487 .mk pg@header-bottom
489 .mk pg*col-top
490 .pg*start-col
492 .de pg*start-col
493 .\" Handle footnote overflow before floating keeps, because the keep
494 .\" might contain an embedded footnote.
495 .fn@top-hook
496 .kp@top-hook
497 .tbl@top-hook
500 .de pg@cs-top
501 .sp \\n[HM]u
502 .\" move pg@bottom and pg*footer out of the way
503 .ch pg@bottom \\n[.p]u*2u
504 .ch pg*footer \\n[.p]u*2u
507 .de pg@bottom
508 .tbl@bottom-hook
509 .if \\n[pg@fn-flag] .fn@bottom-hook
510 .nr pg*col-num +1
511 .ie \\n[pg*col-num]<\\n[pg@ncols] .pg*end-col
512 .el .pg*end-page
514 .de pg*end-col
515 'sp |\\n[pg*col-top]u
516 .po (u;\\n[pg*saved-po]+(\\n[pg@colw]+\\n[pg*gutw]*\\n[pg*col-num]))
517 .\"po +(u;\\n[pg@colw]+\\n[pg*gutw])
518 .pg*start-col
520 .de pg*end-page
521 .po \\n[pg*saved-po]u
522 .\" Make sure we don't exit if there are still floats or footnotes left-over.
523 .ie \\n[kp@head]<\\n[kp@tail]:\\n[fn@have-overflow] \{\
524 . \" Switching environments ensures that we don't get an unnecessary
525 . \" blank line at the top of the page.
526 . ev ne
527 ' bp
528 . ev
530 .el \{\
531 . \" If the text has ended and there are no more footnotes or keeps, exit.
532 . if \\n[pg@text-ended] .ex
533 . if r pg*next-number \{\
534 . pn \\n[pg*next-number]
535 . rr pg*next-number
536 . if d pg*next-format \{\
537 . af PN \\*[pg*next-format]
538 . rm pg*next-format
539 . \}
540 . \}
541 ' bp
544 .\" pg@begin number format
545 .de pg@begin
546 .ie \\n[.$]>0 \{\
547 . nr pg*next-number (;\\$1)
548 . ie \\n[.$]>1 .ds pg*next-format \\$2
549 . el .rm pg*next-format
551 .el .rr pg*next-number
552 .pg@super-eject
554 .\" print the footer line
555 .de pg*footer
556 .ev h
557 .par@reset
561 .\" flush out any keeps or footnotes
562 .de pg@super-eject
564 .if !'\\n(.z'' .@error-recover diversion open while ejecting page
565 .\" Make sure we stay in the end macro while there is still footnote overflow
566 .\" left, or floating keeps.
567 .while \\n[kp@tail]>\\n[kp@head]:\\n[pg@fn-flag] \{\
568 . rs
569 . bp
573 .nr pg@text-ended 0
574 .de pg@end-text
576 .nr pg@text-ended 1
577 .pg@super-eject
579 .em pg@end-text
580 .\" ***************************
581 .\" ******** module fn ********
582 .\" ***************************
583 .\" Footnotes.
584 .nr fn@sep-dist 8p
585 .ev fn
586 .\" Round it vertically
587 .vs \n[fn@sep-dist]u
588 .nr fn@sep-dist \n[.v]
590 .nr fn*text-num 0 1
591 .nr fn*note-num 0 1
592 .ds * \\*[par@sup-start]\En+[fn*text-num]\\*[par@sup-end]
593 .nr fn*open 0
594 .\" normal FS
595 .de @FS
596 .ie \\n[.$] .fn*do-FS "\\$1" no
597 .el \{\
598 . ie \\n[fn*text-num]>\\n[fn*note-num] .fn*do-FS \\n+[fn*note-num]
599 . el .fn*do-FS
602 .\" Second argument of `no' means don't embellish the first argument.
603 .de fn*do-FS
604 .if \\n[fn*open] .@error-recover nested FS
605 .nr fn*open 1
606 .if \\n[.u] \{\
607 . \" Ensure that the first line of the footnote is on the same page
608 . \" as the reference. I think this is minimal.
609 . ev fn
610 . nr fn*need 1v
611 . ev
612 . ie \\n[pg@fn-flag] .nr fn*need +\\n[fn:PD]
613 . el .nr fn*need +\\n[fn@sep-dist]
614 . ne \\n[fn*need]u+\\n[.V]u>?0
616 .ev fn
617 .par@reset-env
618 .fn*start-div
619 .par@reset
620 .ie \\n[.$] .FP \\$@
621 .el .@LP
623 .de @FE
624 .ie !\\n[fn*open] .@error FE without FS
625 .el \{\
626 . nr fn*open 0
627 . br
628 . ev
629 . fn*end-div
632 .nr fn@have-overflow 0
633 .\" called at the top of each column
634 .de fn@top-hook
635 .nr fn*max-width 0
636 .nr fn*page-bottom-pos 0-\\n[FM]-\\n[pg@fn-bottom-margin]
637 .ch pg@bottom \\n[fn*page-bottom-pos]u
638 .if \\n[fn@have-overflow] \{\
639 . nr fn@have-overflow 0
640 . fn*start-div
641 . ev nf
642 . fn@overflow-div
643 . ev
644 . fn*end-div
647 .\" This is called at the bottom of the column if pg@fn-flag is set.
648 .de fn@bottom-hook
649 .nr pg@fn-flag 0
650 .nr fn@have-overflow 0
651 .nr fn@bottom-pos \\n[.p]-\\n[FM]-\\n[pg@fn-bottom-margin]+\\n[.v]
652 .ev fn
653 .nr fn@bottom-pos -\\n[.v]
655 .ie \\n[nl]+\\n[fn@sep-dist]+\n[.V]>\\n[fn@bottom-pos] \{\
656 . rn fn@div fn@overflow-div
657 . nr fn@have-overflow 1
659 .el \{\
660 . if \\n[pg@ncols]>1 \
661 . if \\n[fn*max-width]>\\n[pg@fn-colw] \
662 . nr pg@fn-bottom-margin \\n[.p]-\\n[FM]-\\n[nl]+1v
663 . wh \\n[fn@bottom-pos]u fn*catch-overflow
664 . fn@print-sep
665 . ev nf
666 . fn@div
667 . rm fn@div
668 . ev
669 . if '\\n(.z'fn@overflow-div' \{\
670 . di
671 . nr fn@have-overflow \\n[dn]>0
672 . \}
673 . ch fn*catch-overflow
676 .de fn*catch-overflow
677 .di fn@overflow-div
679 .nr fn*embed-count 0
680 .de @div-end!fn@div
682 .if '\\n[.ev]'fn' .ev
683 .fn*end-div
684 .nr fn*open 0
686 .als @div-end!fn*embed-div @div-end!fn@div
687 .de fn*start-div
688 .ie '\\n(.z'' \{\
689 . da fn@div
690 . if !\\n[pg@fn-flag] .ns
692 .el .di fn*embed-div
694 .de fn*end-div
695 .ie '\\n(.z'fn@div' \{\
696 . di
697 . nr fn*page-bottom-pos -\\n[dn]
698 . nr fn*max-width \\n[fn*max-width]>?\\n[dl]
699 . if !\\n[pg@fn-flag] .nr fn*page-bottom-pos -\\n[fn@sep-dist]
700 . nr pg@fn-flag 1
701 . nr fn*page-bottom-pos \\n[nl]-\\n[.p]+\n[.V]>?\\n[fn*page-bottom-pos]
702 . ch pg@bottom \\n[fn*page-bottom-pos]u
704 .el \{\
705 . ie '\\n(.z'fn*embed-div' \{\
706 . di
707 . rn fn*embed-div fn*embed-div!\\n[fn*embed-count]
708 \!. fn*embed-start \\n[fn*embed-count]
709 . rs
710 ' sp (u;\\n[dn]+\\n[fn@sep-dist]+\\n[.V])
711 \!. fn*embed-end
712 . nr fn*embed-count +1
713 . \}
714 . el \{\
715 . ev fn
716 . @error-recover unclosed diversion within footnote
717 . \}
720 .de fn*embed-start
721 .ie '\\n(.z'' \{\
722 . fn*start-div
723 . ev nf
724 . fn*embed-div!\\$1
725 . rm fn*embed-div!\\$1
726 . ev
727 . fn*end-div
728 . di fn*null
730 .el \{\
731 \!. fn*embed-start \\$1
732 . rs
735 .de fn*embed-end
736 .ie '\\n(.z'fn*null' \{\
737 . di
738 . rm fn*null
740 .el \!.fn*embed-end
742 .\" It's important that fn@print-sep use up exactly fn@sep-dist vertical space.
743 .de fn@print-sep
744 .ev fn
745 .in 0
746 .vs \\n[fn@sep-dist]u
747 \D'l 1i 0'
751 .\" ***************************
752 .\" ******** module kp ********
753 .\" ***************************
754 .\" Keeps.
755 .de KS
757 .di kp*div
759 .de KF
760 .if !'\\n(.z'' .@error-recover KF while open diversion
761 .di kp*fdiv
762 .ev k
763 .par@reset-env
764 .par@reset
766 .de KE
767 .ie '\\n(.z'kp*div' .kp*end
768 .el \{\
769 . ie '\\n(.z'kp*fdiv' .kp*fend
770 . el .@error KE without KS or KF
773 .de @div-end!kp*div
774 .kp*end
776 .de @div-end!kp*fdiv
777 .kp*fend
779 .de kp*need
780 .ie '\\n(.z'' .ds@need \\$1
781 .el \!.kp*need \\$1
783 .\" end non-floating keep
784 .de kp*end
787 .kp*need \\n[dn]
788 .ev nf
789 .kp*div
791 .rm kp*div
793 .\" Floating keeps.
794 .nr kp@head 0
795 .nr kp@tail 0
796 .\" end floating keep
797 .de kp*fend
801 .ie \\n[.t]-(\\n[.k]>0*1v)>\\n[dn] \{\
802 . br
803 . ev nf
804 . kp*fdiv
805 . rm kp*fdiv
806 . ev
808 .el \{\
809 . rn kp*fdiv kp*div!\\n[kp@tail]
810 . nr kp*ht!\\n[kp@tail] 0\\n[dn]
811 . nr kp@tail +1
814 .\" top of page processing for KF
815 .nr kp*doing-top 0
816 .de kp@top-hook
817 .if !\\n[kp*doing-top] \{\
818 . nr kp*doing-top 1
819 . kp*do-top
820 . nr kp*doing-top 0
823 .de kp*do-top
824 .\" If the first keep won't fit, only force it out if we haven't had a footnote
825 .\" and we're at the top of the page.
826 .nr kp*force \\n[pg@fn-flag]=0&(\\n[nl]<=\\n[pg@header-bottom])
827 .nr kp*fits 1
828 .while \\n[kp@tail]>\\n[kp@head]&\\n[kp*fits] \{\
829 . ie \\n[.t]>\\n[kp*ht!\\n[kp@head]]:\\n[kp*force] \{\
830 . nr kp*force 0
831 . \" It's important to advance kp@head before bringing
832 . \" back the keep, so that if the last line of the
833 . \" last keep springs the bottom of page trap, a new
834 . \" page will not be started unnecessarily.
835 . rn kp*div!\\n[kp@head] kp*temp
836 . nr kp@head +1
837 . ev nf
838 . kp*temp
839 . ev
840 . rm kp*temp
841 . \}
842 . el .nr kp*fits 0
845 .\" ***************************
846 .\" ******** module ds ********
847 .\" ***************************
848 .\" Displays and non-floating keeps.
849 .de DE
850 .ds*end!\\n[\\n[.ev]:ds-type]
851 .nr \\n[.ev]:ds-type 0
853 .de ds@auto-end
854 .if \\n[\\n[.ev]:ds-type] \{\
855 . @error automatically terminating display
856 . DE
859 .de @div-end!ds*div
860 .ie \\n[\\n[.ev]:ds-type] .DE
861 .el .ds*end!2
863 .de ds*end!0
864 .@error DE without DS, ID, CD, LD or BD
866 .de LD
868 .nr \\n[.ev]:ds-type 1
869 .par@reset
871 .sp \\n[DD]u
873 .de ID
875 .ie \\n[.$] .in +(n;\\$1)
876 .el .in +\\n[DI]u
878 .de CD
880 .ce 9999
882 .de RD
884 .rj 9999
886 .de ds*common-end
887 .par@reset
888 .sp \\n[DD]u
890 .als ds*end!1 ds*common-end
891 .de BD
893 .nr \\n[.ev]:ds-type 2
894 .di ds*div
896 .de ds*end!2
898 .ie '\\n(.z'ds*div' \{\
899 . di
900 . nf
901 . in (u;\\n[.l]-\\n[dl]/2)
902 . ds*div
903 . rm ds*div
904 . ds*common-end
906 .el .@error-recover mismatched DE
908 .de DS
910 .di ds*div
911 .ie '\\$1'B' \{\
912 . LD
913 . nr \\n[.ev]:ds-type 4
915 .el \{\
916 . ie '\\$1'L' .LD
917 . el \{\
918 . ie '\\$1'C' .CD
919 . el \{\
920 . ie '\\$1'R' .RD
921 . el \{\
922 . ie '\\$1'I' .ID \\$2
923 . el .ID \\$1
924 . \}
925 . \}
926 . \}
927 . nr \\n[.ev]:ds-type 3
930 .de ds@need
931 .if '\\n(.z'' \{\
932 . while \\n[.t]<=(\\$1)&(\\n[nl]>\\n[pg@header-bottom]) \{\
933 . rs
934 ' sp \\n[.t]u
935 . \}
938 .de ds*end!3
940 .ie '\\n(.z'ds*div' \{\
941 . di
942 . ds@need \\n[dn]
943 . ev nf
944 . ds*div
945 . ev
946 . rm ds*div
947 . ds*common-end
949 .el .@error-recover mismatched DE
951 .de ds*end!4
952 .ie '\\n(.z'ds*div' \{\
953 . br
954 . di
955 . nf
956 . in (u;\\n[.l]-\\n[dl]/2)
957 . ds@need \\n[dn]
958 . ds*div
959 . rm ds*div
960 . ds*common-end
962 .el .@error-recover mismatched DE
964 .\" ****************************
965 .\" ******** module par ********
966 .\" ****************************
967 .\" Paragraph-level formatting.
968 .\" Load time initialization.
969 .de par@load-init
970 .\" PS and VS might have been set on the command-line
971 .if !rPS .nr PS 10
972 .if !rLL .nr LL 6i
973 .ll \\n[LL]u
974 .\" don't set LT so that it can be defaulted from LL
975 .ie rLT .lt \\n[LT]u
976 .el .lt \\n[LL]u
977 .ps \\n[PS]
978 .\" don't set VS so that it can be defaulted from PS
979 .ie rVS .par*vs \\n[VS]
980 .el .par*vs \\n[PS]+2
981 .if dFAM .fam \\*[FAM]
982 .if !rHY .nr HY 14
983 .hy \\n[HY]
986 .de par*vs
987 .\" If it's too big to be in points, treat it as units.
988 .ie (p;\\$1)>=40p .vs (u;\\$1)
989 .el .vs (p;\\$1)
991 .de par@ab-indent
992 .nr 0:li (u;\\n[LL]/12)
993 .nr 0:ri \\n[0:li]
995 .de par*env-init
996 .aln \\n[.ev]:PS PS
997 .aln \\n[.ev]:VS VS
998 .aln \\n[.ev]:LL LL
999 .aln \\n[.ev]:MCLL LL
1000 .aln \\n[.ev]:LT LT
1001 .aln \\n[.ev]:MCLT LT
1002 .aln \\n[.ev]:PI PI
1003 .aln \\n[.ev]:PD PD
1004 .ad \\n[par*adj]
1005 .par@reset-env
1007 .\" happens when the first page begins
1008 .de par@init
1009 .if !rLT .nr LT \\n[LL]
1010 .if !rFL .nr FL \\n[LL]*5/6
1011 .if !rVS .nr VS \\n[PS]+2
1012 .if !rDI .nr DI .5i
1013 .if !rFPS .nr FPS \\n[PS]-2
1014 .if !rFVS .nr FVS \\n[FPS]+2
1015 .\" don't change environment 0
1016 .ev h
1017 .ps \\n[PS]
1018 .if !rQI .nr QI 5n
1019 .if !rPI .nr PI 5n
1020 .par*vs \\n[VS]
1021 .if !rPD .nr PD .3v>?\n(.V
1022 .if !rDD .nr DD .5v>?\n(.V
1023 .if !rFI .nr FI 2n
1024 .if !rFPD .nr FPD \\n[PD]/2
1026 .if !dFAM .ds FAM \\n[.fam]
1027 .nr par*adj \\n[.j]
1028 .par*env-init
1029 .ev h
1030 .par*env-init
1032 .ev fn
1033 .par*env-init
1035 .ev k
1036 .par*env-init
1038 .aln 0:MCLL pg@colw
1039 .aln 0:MCLT pg@colw
1040 .aln k:MCLL pg@colw
1041 .aln k:MCLT pg@colw
1042 .aln fn:PS FPS
1043 .aln fn:VS FVS
1044 .aln fn:LL FL
1045 .aln fn:LT FL
1046 .aln fn:PI FI
1047 .aln fn:PD FPD
1048 .aln fn:MCLL pg@fn-colw
1049 .aln fn:MCLT pg@fn-colw
1051 .de par@reset-env
1052 .nr \\n[.ev]:il 0
1053 .nr \\n[.ev]:li 0
1054 .nr \\n[.ev]:ri 0
1055 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1056 .nr \\n[.ev]:pli 0
1057 .nr \\n[.ev]:pri 0
1058 .nr \\n[.ev]:ds-type 0
1060 .\" par@reset
1061 .de par@reset
1063 .ce 0
1064 .rj 0
1065 .ul 0
1067 .ie \\n[pg@ncols]>1 \{\
1068 . ll (u;\\n[\\n[.ev]:MCLL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1069 . lt \\n[\\n[.ev]:MCLT]u
1071 .el \{\
1072 . ll (u;\\n[\\n[.ev]:LL]-\\n[\\n[.ev]:ri]-\\n[\\n[.ev]:pri])
1073 . lt \\n[\\n[.ev]:LT]u
1075 .in (u;\\n[\\n[.ev]:li]+\\n[\\n[.ev]:pli])
1076 .ft 1
1077 .fam \\*[FAM]
1078 .ps \\n[\\n[.ev]:PS]
1079 .par*vs \\n[\\n[.ev]:VS]
1080 .ls 1
1082 .hy \\n[HY]
1084 .de @RT
1085 .nr \\n[.ev]:pli 0
1086 .nr \\n[.ev]:pri 0
1087 .par@reset
1089 .\" This can be redefined by the user.
1090 .de TA
1091 .ta T 5n
1093 .de par*start
1094 .ds@auto-end
1095 .nr \\n[.ev]:pli \\$1
1096 .nr \\n[.ev]:pri \\$2
1097 .par@reset
1098 .sp \\n[\\n[.ev]:PD]u
1099 .ne 1v+\\n(.Vu
1101 .de par@finish
1102 .nr \\n[.ev]:pli 0
1103 .nr \\n[.ev]:pri 0
1104 .par@reset
1106 .\" normal LP
1107 .de @LP
1108 .par*start 0 0
1109 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1111 .de @PP
1112 .par*start 0 0
1113 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1114 .ti +\\n[\\n[.ev]:ai]u
1116 .de @QP
1117 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1118 .par*start \\n[QI] \\n[QI]
1120 .de @XP
1121 .par*start \\n[\\n[.ev]:PI] 0
1122 .ti -\\n[\\n[.ev]:PI]u
1124 .de @IP
1125 .if \\n[.$]>1 .nr \\n[.ev]:ai (n;\\$2)
1126 .par*start \\n[\\n[.ev]:ai] 0
1127 .if !'\\$1'' \{\
1128 . \" Divert the label so as to freeze any spaces.
1129 . di par*label
1130 . par*push-tag-env
1131 \&\\$1
1132 . par*pop-tag-env
1133 . di
1134 . chop par*label
1135 . ti -\\n[\\n[.ev]:ai]u
1136 . ie \\n[dl]+1n<=\\n[\\n[.ev]:ai] \\*[par*label]\h'|\\n[\\n[.ev]:ai]u'\c
1137 . el \{\
1138 \\*[par*label]
1139 . br
1140 . \}
1141 . rm par*label
1144 .\" We don't want margin characters to be attached when we divert
1145 .\" the tag. Since there's no way to save and restore the current
1146 .\" margin character, we have to switch to a new environment, taking
1147 .\" what we need of the old environment with us.
1148 .de par*push-tag-env
1149 .nr par*saved-font \\n[.f]
1150 .nr par*saved-size \\n[.s]z
1151 .nr par*saved-ss \\n[.ss]
1152 .ds par*saved-fam \\n[.fam]
1153 .ev par
1156 .ft \\n[par*saved-font]
1157 .ps \\n[par*saved-size]u
1158 .ss \\n[par*saved-ss]
1159 .fam \\*[par*saved-fam]
1161 .de par*pop-tag-env
1164 .de @RS
1166 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1167 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1168 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1169 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1170 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1171 .nr \\n[.ev]:il +1
1172 .nr \\n[.ev]:li +\\n[\\n[.ev]:ai]
1173 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1174 .par@reset
1176 .de @RE
1178 .ie \\n[\\n[.ev]:il] \{\
1179 . nr \\n[.ev]:il -1
1180 . nr \\n[.ev]:ai \\n[\\n[.ev]:ai!\\n[\\n[.ev]:il]]
1181 . nr \\n[.ev]:li \\n[\\n[.ev]:li!\\n[\\n[.ev]:il]]
1182 . nr \\n[.ev]:ri \\n[\\n[.ev]:ri!\\n[\\n[.ev]:il]]
1183 . nr \\n[.ev]:pli \\n[\\n[.ev]:pli!\\n[\\n[.ev]:il]]
1184 . nr \\n[.ev]:pri \\n[\\n[.ev]:pri!\\n[\\n[.ev]:il]]
1186 .el .@error unbalanced \\$0
1187 .par@reset
1189 .de @QS
1191 .nr \\n[.ev]:li!\\n[\\n[.ev]:il] \\n[\\n[.ev]:li]
1192 .nr \\n[.ev]:ri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ri]
1193 .nr \\n[.ev]:ai!\\n[\\n[.ev]:il] \\n[\\n[.ev]:ai]
1194 .nr \\n[.ev]:pli!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pli]
1195 .nr \\n[.ev]:pri!\\n[\\n[.ev]:il] \\n[\\n[.ev]:pri]
1196 .nr \\n[.ev]:il +1
1197 .nr \\n[.ev]:li +\\n[QI]
1198 .nr \\n[.ev]:ri +\\n[QI]
1199 .nr \\n[.ev]:ai \\n[\\n[.ev]:PI]
1200 .par@reset
1202 .als @QE @RE
1203 .\" start boxed text
1204 .de B1
1206 .di par*box-div
1207 .nr \\n[.ev]:li +1n
1208 .nr \\n[.ev]:ri +1n
1209 .nr par*box-in \\n[.in]
1210 .\" remember what 1n is, just in case the point size changes
1211 .nr par*box-n 1n
1212 .in +1n
1213 .ll -1n
1214 .lt -1n
1215 .ti \\n[par*box-in]u+1n
1217 .de @div-end!par*box-div
1220 .\" end boxed text
1221 .\" Postpone the drawing of the box until we're in the top-level diversion,
1222 .\" in case there's a footnote inside the box.
1223 .de B2
1224 .ie '\\n(.z'par*box-div' \{\
1225 . br
1226 . if \n[.V]>.25m .sp
1227 . di
1228 . if \n[.V]>.25m .sp
1229 . ds@need \\n[dn]
1230 . par*box-mark-top
1231 . ev nf
1232 . par*box-div
1233 . ev
1234 . nr \\n[.ev]:ri -\\n[par*box-n]
1235 . nr \\n[.ev]:li -\\n[par*box-n]
1236 . in -\\n[par*box-n]u
1237 . ll +\\n[par*box-n]u
1238 . lt +\\n[par*box-n]u
1239 . par*box-draw \\n[.i]u \\n[.l]u-(\\n[.H]u==1n*1n)
1241 .el .@error B2 without B1
1243 .de par*box-mark-top
1244 .ie '\\n[.z]'' \{\
1245 . rs
1246 . mk par*box-top
1248 .el \!.par*box-mark-top
1250 .de par*box-draw
1251 .ie '\\n[.z]'' \{\
1252 . nr par*box-in \\n[.i]
1253 . nr par*box-ll \\n[.l]
1254 . nr par*box-vpt \\n[.vpt]
1255 . nr par*box-ad \\n[.j]
1256 . ad l
1257 . vpt 0
1258 . in \\$1
1259 . ll \\$2
1260 \v'-1v+.25m'\
1261 \D'l (u;\\n[.l]-\\n[.i]) 0'\
1262 \D'l 0 |\\n[par*box-top]u'\
1263 \D'l -(u;\\n[.l]-\\n[.i]) 0'\
1264 \D'l 0 -|\\n[par*box-top]u'
1265 . br
1266 . sp -1
1267 . in \\n[par*box-in]u
1268 . ll \\n[par*box-ll]u
1269 . vpt \\n[par*box-vpt]
1270 . ad \\n[par*box-ad]
1272 .el \!.par*box-draw \\$1 \\$2
1274 .de @SH
1275 .par@finish
1276 .\" Keep together the heading and the first two lines of the next paragraph.
1277 .ne 3v+\\n[\\n[.ev]:PD]u+\\n(.Vu
1278 .sp 1
1279 .ft B
1281 .\" TL, AU, and AI are aliased to these in cov*ab-init.
1282 .de par@TL
1283 .par@finish
1284 .sp 1
1285 .ft B
1286 .ps +2
1287 .vs +3p
1288 .ce 9999
1290 .de par@AU
1291 .par@finish
1292 .sp 1
1293 .ft I
1294 .ce 9999
1296 .de par@AI
1297 .par@finish
1298 .sp .5
1299 .ce 9999
1301 .\" In paragraph macros.
1302 .de NL
1303 .ps \\n[\\n[.ev]:PS]
1305 .de SM
1306 .ps -2
1308 .de LG
1309 .ps +2
1311 .de R
1312 .ft R
1314 .\" par*define-font-macro macro font
1315 .de par*define-font-macro
1316 .de \\$1
1317 .ie \\\\n[.$] \{\
1318 . nr par*prev-font \\\\n[.f]
1319 \&\\\\$3\f[\\$2]\\\\$1\f[\\\\n[par*prev-font]]\\\\$2
1321 .el .ft \\$2
1322 \\..
1324 .par*define-font-macro B B
1325 .par*define-font-macro I I
1326 .par*define-font-macro BI BI
1327 .par*define-font-macro CW CR
1328 .\" underline a word
1329 .de UL
1330 \Z'\\$1'\v'.25m'\D'l \w'\\$1'u 0'\v'-.25m'\\$2
1332 .\" box a word
1333 .de BX
1334 .nr par*bxw \w'\\$1'+.4m
1335 \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''\
1336 \Z'\h'.2m'\\$1'\
1337 \h'\\n[par*bxw]u'
1339 .\" The first time UX is used, put a registered mark after it.
1340 .ds par*ux-rg \(rg
1341 .de UX
1342 \s[\\n[.s]*8u/10u]UNIX\s0\\$1\\*[par*ux-rg]
1343 .ds par*ux-rg
1345 .ds par@sup-start \v'-.9m\s'\En[.s]*7u/10u'+.7m'
1346 .als { par@sup-start
1347 .ds par@sup-end \v'-.7m\s0+.9m'
1348 .als } par@sup-end
1349 .\" footnote paragraphs
1350 .\" FF is the footnote format
1351 .nr FF 0
1352 .\" This can be redefined. It gets a second argument of `no' if the first
1353 .\" argument was supplied by the user, rather than automatically.
1354 .de FP
1356 .if !d par*fp!\\n[FF] \{\
1357 . @error unknown footnote format `\\n[FF]'
1358 . nr FF 0
1360 .ie '\\$2'no' .par*fp!\\n[FF]-no "\\$1"
1361 .el .par*fp!\\n[FF] "\\$1"
1363 .de par*fp!0
1364 .@PP
1365 \&\\*[par@sup-start]\\$1\\*[par@sup-end]\ \c
1367 .de par*fp!0-no
1368 .@PP
1369 \&\\$1\ \c
1371 .de par*fp!1
1372 .@PP
1373 \&\\$1.\ \c
1375 .de par*fp!1-no
1376 .@PP
1377 \&\\$1\ \c
1379 .de par*fp!2
1380 .@LP
1381 \&\\$1.\ \c
1383 .de par*fp!2-no
1384 .@LP
1385 \&\\$1\ \c
1387 .de par*fp!3
1388 .@IP "\\$1." (u;\\n[\\n[.ev]:PI]*2)
1390 .de par*fp!3-no
1391 .@IP "\\$1" (u;\\n[\\n[.ev]:PI]*2)
1393 .\" ***************************
1394 .\" ******** module nh ********
1395 .\" ***************************
1396 .\" Numbered headings.
1397 .\" nh*hl is the level of the last heading
1398 .nr nh*hl 0
1399 .\" numbered heading
1400 .de @NH
1401 .ie '\\$1'S' \{\
1402 . shift
1403 . nr nh*hl 0
1404 . while \\n[.$] \{\
1405 . nr nh*hl +1
1406 . nr H\\n[nh*hl] 0\\$1
1407 . shift
1408 . \}
1409 . if !\\n[nh*hl] \{\
1410 . nr H1 1
1411 . nr nh*hl 1
1412 . @error missing arguments to .NH S
1413 . \}
1415 .el \{\
1416 . nr nh*ohl \\n[nh*hl]
1417 . ie \\n[.$] \{\
1418 . nr nh*hl 0\\$1
1419 . ie \\n[nh*hl]<=0 \{\
1420 . nr nh*ohl 0
1421 . nr nh*hl 1
1422 . \}
1423 . el \{\
1424 . if \\n[nh*hl]-\\n[nh*ohl]>1 \
1425 . @warning .NH \\n[nh*ohl] followed by .NH \\n[nh*hl]
1426 . \}
1427 . \}
1428 . el .nr nh*hl 1
1429 . while \\n[nh*hl]>\\n[nh*ohl] \{\
1430 . nr nh*ohl +1
1431 . nr H\\n[nh*ohl] 0
1432 . \}
1433 . nr H\\n[nh*hl] +1
1435 .ds SN
1436 .nr nh*i 0
1437 .while \\n[nh*i]<\\n[nh*hl] \{\
1438 . nr nh*i +1
1439 . as SN \\n[H\\n[nh*i]].
1442 \\*[SN]
1444 .\" ****************************
1445 .\" ******** module toc ********
1446 .\" ****************************
1447 .\" Table of contents generation.
1448 .de @XS
1449 .da toc*div
1450 .ev h
1451 .ie \\n[.$] .XA "\\$1"
1452 .el .XA
1454 .de @div-end!toc*div
1457 .de XA
1458 .ie '\\n(.z'toc*div' \{\
1459 . if d toc*num .toc*end-entry
1460 . ie \\n[.$] \{\
1461 . ie '\\$1'no' .ds toc*num
1462 . el .ds toc*num "\\$1
1463 . \}
1464 . el .ds toc*num \\n[PN]
1465 . br
1466 . par@reset
1467 . na
1468 . ll -8n
1469 . in (n;0\\$2)
1471 .el .@error XA without XS
1473 .de XE
1474 .ie '\\n(.z'toc*div' \{\
1475 . if d toc*num .toc*end-entry
1476 . ev
1477 . di
1479 .el .@error XS without XE
1481 .de toc*end-entry
1482 \\a\\t\\*[toc*num]
1484 .rm toc*num
1486 .de PX
1488 .if !'\\$1'no' \{\
1489 . ce 1
1490 . ps \\n[PS]+2
1491 . ft B
1492 \\*[TOC]
1493 . ft
1494 . ps
1497 .char \[toc*leader-char] .\h'1m'
1498 .lc \[toc*leader-char]
1499 .ta (u;\\n[.l]-\\n[.i]-\w'000') (u;\\n[.l]-\\n[.i])R
1500 .sp 2
1501 .toc*div
1502 .par@reset
1504 .\" print the table of contents on page i
1505 .de TC
1507 .pg@begin 1 i
1508 .PX \\$1
1510 .\" ****************************
1511 .\" ******** module eqn ********
1512 .\" ****************************
1513 .\" Eqn support.
1514 .de EQ
1516 .de EN
1518 .de @EQ
1520 .ds eqn*num "\\$2
1521 .ie '\\$1'L' .nr eqn*type 0
1522 .el \{\
1523 . ie '\\$1'I' .nr eqn*type 1
1524 . el \{\
1525 . nr eqn*type 2
1526 . if !'\\$1'C' .ds eqn*num "\\$1
1527 . \}
1529 .di eqn*div
1530 .in 0
1533 .de @div-end!eqn*div
1534 .@EN
1536 .\" Note that geqn mark and lineup work correctly in centered equations.
1537 .de @EN
1538 .ie !'\\n(.z'eqn*div' .@error-recover mismatched EN
1539 .el \{\
1540 . br
1541 . di
1542 . nr eqn*have-num 0
1543 . if !'\\*[eqn*num]'' .nr eqn*have-num 1
1544 . if \\n[dl]:\\n[eqn*have-num] \{\
1545 . sp \\n[DD]u
1546 . par@reset
1547 . ds eqn*tabs \\n[.tabs]
1548 . nf
1549 . ie \\n[dl] \{\
1550 . ds@need \\n[dn]u-1v+\n[.V]u
1551 . chop eqn*div
1552 . ie \\n[eqn*type]=0 \{\
1553 . ta (u;\\n[.l]-\\n[.i])R
1554 \\*[eqn*div]\t\\*[eqn*num]
1555 . \}
1556 . el \{\
1557 . ie \\n[eqn*type]=1 .ta \\n[DI]u \
1558 (u;\\n[.l]-\\n[.i])R
1559 . el .ta (u;\\n[.l]-\\n[.i]/2)C \
1560 (u;\\n[.l]-\\n[.i])R
1561 \t\\*[eqn*div]\t\\*[eqn*num]
1562 . \}
1563 . \}
1564 . el \{\
1565 . ta (u;\\n[.l]-\\n[.i])R
1566 \t\\*[eqn*num]
1567 . \}
1568 . sp \\n[DD]u
1569 . ta \\*[eqn*tabs]
1570 . \}
1571 . fi
1574 .\" ****************************
1575 .\" ******** module tbl ********
1576 .\" ****************************
1577 .\" Tbl support.
1578 .nr tbl*have-header 0
1579 .\" This gets called if TS occurs before the first paragraph.
1580 .de TS
1582 .\" cov*ab-init aliases TS to @TS
1583 \\*[TS]\\
1585 .de @TS
1586 .sp \\n[DD]u
1587 .if '\\$1'H' .di tbl*header-div
1589 .de tbl@top-hook
1590 .if \\n[tbl*have-header] \{\
1591 . ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl*print-header
1592 . el .sp \\n[.t]u
1595 .de tbl*print-header
1596 .ev nf
1597 .tbl*header-div
1599 .mk #T
1601 .de TH
1602 .ie '\\n[.z]'tbl*header-div' \{\
1603 . nr T. 0
1604 . T#
1605 . br
1606 . di
1607 . ie \\n[dn]+\\n[FM]+\\n[HM]+2v>=\\n[.p] \{\
1608 . @error ridiculously long table header
1609 . ds@need \\n[dn]
1610 . tbl*print-header
1611 . \}
1612 . el \{\
1613 . nr tbl*header-ht \\n[dn]
1614 . ds@need \\n[dn]u+1v
1615 . tbl*print-header
1616 . nr tbl*have-header 1
1617 . \}
1619 .el .@error-recover .TH without .TS H
1621 .de @div-end!tbl*header-div
1625 .de TE
1626 .ie '\\n(.z'tbl*header-div' .@error-recover .TS H but no .TH before .TE
1627 .el \{\
1628 . nr tbl*have-header 0
1629 . sp \\n[DD]u
1631 .\" reset tabs
1634 .de tbl@bottom-hook
1635 .if \\n[tbl*have-header] \{\
1636 . nr T. 1
1637 . T#
1640 .de T&
1642 .\" ****************************
1643 .\" ******** module pic ********
1644 .\" ****************************
1645 .\" Pic support.
1646 .\" PS height width
1647 .de PS
1649 .sp \\n[DD]u
1650 .ie \\n[.$]<2 .@error bad arguments to PS (not preprocessed with pic?)
1651 .el \{\
1652 . ds@need (u;\\$1)+1v
1653 . in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)
1656 .de PE
1657 .par@reset
1658 .sp \\n[DD]u+.5m
1660 .\" ****************************
1661 .\" ******** module ref ********
1662 .\" ****************************
1663 .\" Refer support.
1664 .de ]-
1665 .rm [A [B [C [D [E [G [I [J [N [O [P [Q [R [S [T [V
1666 .rm ref*string
1668 .\" Other
1669 .ds ref*spec!0 Q A T1 S V N P I C D O
1670 .\" Journal article
1671 .ds ref*spec!1 Q A T2 J S V N P I C D O
1672 .\" Book
1673 .ds ref*spec!2 Q A T1 S V P I C D O
1674 .\" Article within book
1675 .ds ref*spec!3 Q A T2 B E S V P I C D O
1676 .\" Tech report
1677 .ds ref*spec!4 Q A T2 R G P I C D O
1678 .\" ][ type
1679 .de ][
1680 .if r [T \{\
1681 . als [T1 [T
1682 . als [T2 [T
1684 .ie d ref*spec!\\$1 .ref*build \\*[ref*spec!\\$1]
1685 .el \{\
1686 . @error unknown reference type `\\$1'
1687 . ref*build \\*[ref*spec!0]
1689 .ref*print
1690 .rm ref*string
1691 .rm [F [T1 [T2
1693 .\" start of reference number
1694 .ds [. \\*[par@sup-start]
1695 .\" end of reference number
1696 .ds .] \\*[par@sup-end]
1697 .\" period before reference
1698 .ds <. .
1699 .\" period after reference
1700 .ds >. \" empty
1701 .\" comma before reference
1702 .ds <, ,
1703 .\" comma after reference
1704 .ds >, \" empty
1705 .\" start collected references
1706 .de ]<
1707 .als ref*print ref*end-print
1709 \&\\*[REFERENCES]
1710 .par@reset
1712 .\" end collected references
1713 .de ]>
1714 .par@finish
1715 .als ref*print ref*normal-print
1717 .de ref*normal-print
1718 .ie d [F .FS "\\*([.\\*([F\\*(.]"
1719 .el .FS \&
1720 \\*[ref*string]
1723 .de ref*end-print
1724 .ie d [F .IP "\\*([F."
1725 .el .XP
1726 \\*[ref*string]
1728 .als ref*print ref*normal-print
1729 .de ref*build
1730 .rm ref*string ref*post-punct
1731 .nr ref*suppress-period 1
1732 .while \\n[.$] \{\
1733 . if d [\\$1 \{\
1734 . ie d ref*add-\\$1 .ref*add-\\$1
1735 . el .ref*add-dflt \\$1
1736 . \}
1737 . shift
1739 .\" now add a final period
1740 .ie d ref*string \{\
1741 . if !\\n[ref*suppress-period] .as ref*string .
1742 . if d ref*post-punct \{\
1743 . as ref*string "\\*[ref*post-punct]
1744 . rm ref*post-punct
1745 . \}
1747 .el .ds ref*string
1749 .de ref*add-T1
1750 .ref*field T , "\fI" "" "\fP"
1751 .if r [T .nr ref*suppress-period \\n([T
1753 .de ref*add-T2
1754 .ref*field T , "\\*Q" "" "\\*U"
1755 .if r [T .nr ref*suppress-period \\n([T
1757 .de ref*add-P
1758 .ie \\n([P>0 .ref*field P , "pp. "
1759 .el .ref*field P , "p. "
1761 .de ref*add-J
1762 .ref*field J , \fI "" \fP
1764 .de ref*add-D
1765 .ref*field D "" ( )
1767 .de ref*add-E
1768 .ref*field E , "ed. "
1770 .de ref*add-G
1771 .ref*field G "" ( )
1773 .de ref*add-B
1774 .ref*field B "" "in \fI" "" \fP
1776 .de ref*add-O
1777 .ref*field O .
1778 .ie r [O .nr ref*suppress-period \\n([O
1779 .el .nr ref*suppress-period 1
1781 .de ref*add-A
1782 .ref*field A ,
1783 .if r [A .nr ref*suppress-period \\n([A
1785 .de ref*add-dflt
1786 .ref*field \\$1 ,
1788 .\" First argument is the field letter.
1789 .\" Second argument is the punctuation character to use to separate this field
1790 .\" from the previous field.
1791 .\" Third argument is a string with which to prefix this field.
1792 .\" Fourth argument is a string with which to postfix this field.
1793 .\" Fifth argument is a string to add after the punctuation character supplied
1794 .\" by the next field.
1795 .de ref*field
1796 .if d ref*string \{\
1797 . ie d ref*post-punct \{\
1798 . as ref*string "\\$2\\*[ref*post-punct] \"
1799 . rm ref*post-punct
1800 . \}
1801 . el .as ref*string "\\$2 \"
1803 .as ref*string "\\$3\\*([\\$1\\$4
1804 .if \\n[.$]>4 .ds ref*post-punct "\\$5
1805 .nr ref*suppress-period 0
1807 .\" ****************************
1808 .\" ******** module acc ********
1809 .\" ****************************
1810 .\" Accents and special characters.
1811 .ds Q \(lq
1812 .ds U \(rq
1813 .ds - \(em
1814 .\" Characters
1815 .\" The idea of this definition is for the top of the 3 to be at the x-height.
1816 .if !c\[yogh] .char \[yogh] \Z'\v'\w'x'*0-\En[rst]u'\s[\En[.s]*8u/10u]\
1817 \v'\w'3'*0+\En[rst]u'3\s0'\h'\w'\s[\En[.s]*8u/10u]3'u'
1818 .\" Accents
1819 .de acc*over-def
1820 .ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
1821 \h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
1823 .de acc*under-def
1824 .ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
1826 .de acc*slash-def
1827 .ds \\$1 \Z'\h'(u;-\En[.w]-\w'\\$2'/2)'\
1828 \v'(u;\En[.cdp]-\En[.cht]+\En[rst]+\En[rsb]/2)'\\$2'
1830 .de acc*prefix-def
1831 .ds \\$1 \Z'\h'(u;\w'x'-\w'\\$2'/2)'\\$2'
1833 .acc*prefix-def ' \'
1834 .acc*prefix-def ` \`
1835 .acc*prefix-def ^ ^
1836 .acc*prefix-def , \(ac
1837 .acc*prefix-def : \(ad
1838 .acc*prefix-def ~ ~
1839 .\" improved accent marks
1840 .de AM
1841 .acc*over-def ' \'
1842 .acc*over-def ` \`
1843 .acc*over-def ^ ^
1844 .acc*over-def ~ ~
1845 .acc*over-def : \(ad
1846 .acc*over-def v \(ah
1847 .acc*over-def _ \(a-
1848 .acc*over-def o \(ao
1849 .acc*under-def , \(ac
1850 .acc*under-def . \s[\En[.s]*8u/10u]\v'.2m'.\v'-.2m'\s0
1851 .acc*under-def hook \(ho
1852 .acc*slash-def / /
1853 .char \[hooko] o\\\\*[hook]
1854 .ds q \[hooko]
1855 .ds 3 \[yogh]
1856 .ds D- \(-D\" Icelandic uppercase eth
1857 .ds d- \(Sd\" Icelandic lowercase eth
1858 .ds Th \(TP\" Icelandic uppercase thorn
1859 .ds th \(Tp\" Icelandic lowercase thorn
1860 .ds 8 \(ss\" German double s
1861 .ds Ae \(AE\" AE ligature
1862 .ds ae \(ae\" ae ligature
1863 .ds Oe \(OE\" OE ligature
1864 .ds oe \(oe\" oe ligature
1865 .ds ? \(r?\" upside down ?
1866 .ds ! \(r!\" upside down !
1868 .par@load-init
1869 .\" Make sure that no blank lines creep in at the end of this file.