3 Copyright (C) 1991-2018 Free Software Foundation, Inc.
4 mgm is written by Jörgen Hägg <jh@axis.com>
6 mgm is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 mgm is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 Please submit bug reports with examples at
20 http://savannah.gnu.org/bugs/?group=groff.
22 Naming convention stolen from mgs.
23 Local names module*name
24 Extern names module@name
28 .if !\n(.g .ab These mm macros require groff.
30 .if \n(.C .ab The groff mm macros do not work in compatibility mode.
31 .if (\n[.warn] == 65543) .warn
33 .\" ######## init #######
34 .\" Contents level [0:14], contents saved if heading level <= Cl
36 .\" Eject page between LIST OF XXXX if Cp == 0
40 .\" Eject after floating display is output [0:1]
42 .\" Floating keep output [0;5]
44 .\" space before and after display if == 1 [0:1]
48 .\" Equation label adjust 0=left, 1=right
50 .\" Bullet string (for .BL)
52 .el .ds BU \s-2\(bu\s0
58 .\" H1-H7 heading counters
73 .\" Heading break level [0:14]
75 .\" heading centering level, [0:14]
78 .ds HF 2 2 2 2 2 2 2 2 2 2 2 2 2 2
79 .\" heading temp. indent [0:2]
80 .\" 0 -> 0 indent, left margin
81 .\" 1 -> indent to right , like .P 1
82 .\" 2 -> indent to line up with text part of preceding heading
85 .ds HP 0 0 0 0 0 0 0 0 0 0 0 0 0 0
86 .\" heading space level [0:14]
88 .\" heading numbering type
89 .\" 0 -> multiple (1.1.1 ...)
92 .\" Unnumbered heading level
94 .\" hyphenation in body
95 .\" 0 -> no hyphenation
96 .\" 1 -> hyphenation 14 on
98 .\" text for toc, selfexplanatory. Look in the new variable section
99 .ds Lf LIST OF FIGURES
101 .ds Lt LIST OF TABLES
103 .ds Lx LIST OF EXHIBITS
105 .ds Le LIST OF EQUATIONS
107 .\" List indent, used by .AL
109 .\" List space, if listlevel > Ls then no spacing will occur around lists.
111 .\" Numbering style [0:5]
113 .\" numbered paragraphs
114 .\" 0 == not numbered
115 .\" 1 == numbered in first level headings.
117 .\" Format of figure,table,exhibit,equation titles.
120 .\" Table of contents page numbering style
122 .\" Page-number, normally same as %.
126 .\" paragraph spacing
129 .\" 0 == left-justified
131 .\" 2 == indented .P except after .H, .DE or .LE.
135 .\" Reference page eject status
140 .\" Current state of TOC, empty outside TC, inside
141 .\" it will be set to co,fg,tb,ec,ex or ap.
146 .\"---------------------------------------------
147 .\" Internal global variables
149 .\" This is for cover macro .MT
153 .if r C .nr @copy_type \n[C]
154 .\" >0 if Subject/Date/From should be bold, roman otherwise
155 .ie n .ds @sdf_font R
157 .if \n[@copy_type]=4 \{\
165 . ie \n[E] .ds @sdf_font B
169 .\" Current pointsize and vertical space, always in points.
176 .if \n[D]>1 .tm @ps=\n[@ps], @vs=\n[@vs]
177 .if \n[D]>3 .tm INIT: l:\n[.l] p:\n[.p] o:\n[.o]
205 .\" non-zero if escape mechanism is turned off. Used by VERBON/OFF
207 .\"---------------------------------------------
212 .\" print appendixheader, 0 == don't
215 .\" Current appendix text
217 .\" Controls the space before and after static displays if defined.
218 .\" Lsp is used otherwise
221 .\" Add a dot after level one heading number if >0
224 .\" header prespace level. If level <= Hps, then two lines will be printed
225 .\" before the header instead of one.
228 .\" These variables controls the number of lines preceding .H.
229 .\" Hps1 is the number of lines when level > Hps
233 .\" Hps2 is the number of lines when level <= Hps
237 .\" Hss is the number of lines (Lsp) after the header.
240 .\" H1txt will be updated by .H and .HU, containing the heading text.
241 .\" Will also be updated in table of contents & friends
245 .\" header text for the index
247 .\" command to sort the index
251 .if !r Idxf .nr Idxf 0
252 .\" Change these in the national configuration file
258 .\" Flag for space between mark and prefix 1==space, 0==no space
259 .\" Can also be controlled by using '.LI mark 2'
262 .\" Lsp controls the height of an empty line. Normally 0.5v
263 .\" Normally used for nroff compatibility.
279 .ds Qrf See chapter \\*[Qrfh], page \\*[Qrfp].
281 .\" header- and footer-size will only change to the current
285 .\" section-page if Sectp > 0
287 .if (\n[N]=3):(\n[N]=5) \{\
291 .\" section-figure if Sectf > 0
293 .if \n[N]=5 .nr Sectf 1
295 .\" argument to .nm in .VERBON.
297 .\" indent for VERBON
301 .\" Formal closing (.FC)
302 .ds Letfc Yours very truly,
306 .\" Approval date-string
309 .ds LetCN CONFIDENTIAL\" Confidential default
310 .ds LetSA To Whom It May Concern:\" Salutation default
311 .ds LetAT ATTENTION:\" Attention string
312 .ds LetSJ SUBJECT:\" Subject string
313 .ds LetRN In reference to:\" Reference string
317 .ds Letns!copy Copy \" space!
320 .ds Letns!1 Copy (with att.\&) to
321 .ds Letns!2 Copy (without att.\&) to
326 .ds Letns!7 Under separate cover
327 .ds Letns!8 Letter to
328 .ds Letns!9 Memorandum to
329 .ds Letns!10 Copy (with atts.\&) to
330 .ds Letns!11 Copy (without atts.\&) to
331 .ds Letns!12 Abstract Only to
332 .ds Letns!13 Complete Memorandum to
335 .\" Text printed below the footer. Controlled by @copy_type (C).
337 .ds Pg_type!1 OFFICIAL FILE COPY
338 .ds Pg_type!2 DATE FILE COPY
339 .ds Pg_type!3 D\ R\ A\ F\ T
340 .ds Pg_type!4 D\ R\ A\ F\ T
341 .\" Max lines in return address
343 .\"--------------------------
344 .\" test for mgm macro. This can be used if the text must test
345 .\" what macros is used.
348 .\" Due to security problems with groff I had to rewrite
349 .\" the reference system. It's not as elegant as before, you
350 .\" have to run groff with '-z -rRef=1' and put stderr into the filename
353 .\" Output references to stderr if non-zero
359 .\"---------------------------------------------
360 .\" set local variables.
361 .ie d @country .mso mm/\*[@country]_locale
363 .\"---------------------------------------------
364 .if \n[D] .tm Groff mm, version \*[RE].
365 .\" ####### module init ######
368 .ie \\n[misc@adjust] 'ad
378 'tm WARNING:(\\n[.F]) input line \\n[.c]:\\$*
379 .if \\n[D] .backtrace
382 'tm ******************
383 'tm ERROR:(\\n[.F]) input line \\n[.c]:\\$*
384 .if \\n[D] .backtrace
385 'tm ******************
386 .ab "Input aborted, syntax error"
389 .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
392 .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
395 .\" ####### module debug #################################
397 'tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s],\\n[.ps] \
398 in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
403 'tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s] in=\\n[.i]\
404 ad=\\n[.j] fi=\\n[.u] pl=\\n[.p] page=\\n[%] .o=\\n[.o]
405 'tm _______ .d=\\n[.d] .f=\\n[.f] .h=\\n[.h] .k=\\n[.k] .n=\\n[.n]\
406 .p=\\n[.p] .t=\\n[.t] .z=\\n[.z] nl=\\n[nl] dn=\\n[dn] n=\\n[debug*n]
408 .\" ####### module par #################################
409 .nr par@ind-flag 1 \" indent on following P if Pt=2
416 .nr par*num-count 0 1
418 .\" reset numbered paragraphs, arg1 = headerlevel
420 .if \\$1<3 .nr par*num-count 0
421 .if (\\$1=1)&(\\n[Np]=1) .nr par*number 0
426 .\" skip P if previous heading
428 . tm Paragraph nl=\\n[nl], last=\\n[hd*last-pos]
429 . tm Paragraph .k=\\n[.k], hsize=\\n[hd*last-hsize]
431 .if !((\\n[nl]=\\n[hd*last-pos])&(\\n[hd*last-hsize]=\\n[.k])) \{\
432 . if \\n[D]>2 .tm Paragraph set ind-flag=1
434 . \" any collected unprinted text?
437 .if \\n[Np] \\n[H1].\\n+[par*number]\ \ \c
441 .\" skip P if previous heading
443 . tm Paragraph nl=\\n[nl], last=\\n[hd*last-pos]
444 . tm Paragraph .k=\\n[.k], hsize=\\n[hd*last-hsize]
446 .if !((\\n[nl]=\\n[hd*last-pos])&(\\n[hd*last-hsize]=\\n[.k])) \{\
447 . if \\n[D]>2 .tm Paragraph set ind-flag=1
451 \\n[H2].\\n+[par*number2]\ \ \c
456 .SP (u;\\n[Ps]*\\n[Lsp])
458 . if \\$1=1 .ti +\\n[Pi]n
461 . if \\n[Pt]=1 .ti +\\n[Pi]n
462 . if (\\n[Pt]=2)&\\n[par@ind-flag] .ti +\\n[Pi]n
465 .\" ####### module line #######################################
468 .if !r line*lp\\n[.z] .nr line*lp\\n[.z] 0
469 .if !r line*ac\\n[.z] .nr line*ac\\n[.z] 0
470 .ie \\n[.$] .nr line*temp (v;\\$1)
473 .ie \\n[line*lp\\n[.z]]=\\n[.d] \{\
474 . \" go here if no output since the last .SP
475 . nr line*output \\n[line*temp]-\\n[line*ac\\n[.z]]
476 . if \\n[line*output]<0 .nr line*output 0
477 . nr line*ac\\n[.z] +\\n[line*output]
480 . nr line*ac\\n[.z] \\n[line*temp]
481 . nr line*output \\n[line*temp]
482 . \" no extra space in the beginning of a page
483 . if (\\n[.d]<0):(\\n[pg*head-mark]=\\n[.d]) .nr line*output 0
485 .if \\n[line*output] .sp \\n[line*output]u
486 .nr line*lp\\n[.z] \\n[.d]
488 .\" ######## module misc ###############
492 . if \\$1-1 .@error "SA: bad arg: \\$1"
493 . nr misc@adjust 0\\$1
495 .ie \\n[misc@adjust] 'ad
499 .\" switch environment, keep all important settings.
507 .\" .misc@push stackname value
509 .ie d misc*st-\\$1 .ds misc*st-\\$1 \\$2 \\*[misc*st-\\$1]
510 .el .ds misc*st-\\$1 \\$2
513 .\" .misc@pop stackname
514 .\" value returned in the string misc*pop
516 .misc@pop-set misc*st-\\$1 \\*[misc*st-\\$1]
520 .ds misc*st-name \\$1
522 .if \\n[.$]<1 .@error "stack \\*[misc*st-name] empty"
525 .ds \\*[misc*st-name] \\$*
528 .\" .misc@pop-nr stackname varname
531 .nr \\$2 0\\*[misc*pop]
534 .\" .misc@pop-ds stackname varname
537 .ds \\$2 \\*[misc*pop]
545 .\" .PGFORM linelength [ pagelength [ pageoffset [1]]]
547 .\" Break here to avoid problems with new linesetting of the previous line.
548 .\" Hope this doesn't break anything else :-)
549 .\" Don't break if arg_4 is a '1'.
550 .if \\n[D]>2 .tm PGFORM: \\$*
552 .if \\n[D]>3 .tm PGFORM: IN l:\\n[.l] p:\\n[.p] o:\\n[.o]
556 . nr @cur-ll \\n[@ll]
575 .if \\n[D]>3 .tm PGFORM: OUT l:\\n[.l] p:\\n[.p] o:\\n[.o]
576 .if \\n[D]>2 .tm PGFORM: ll=\\n[@ll], pl=\\n[@pl], po=\\n[@po]
585 .\" .MOVE y [[x] linelength]
586 .\" move to line y, indent to x
588 .if !\\n[.$] .@error "MOVE y [x]: no arguments"
593 .ie \\n[.$]>2 .nr pg*i (n;\\$3)
595 . ie \\n[.$]>1 .nr pg*i (n;\\n[@ll]u-\\$2)
596 . el .nr pg*i \\n[@ll]u
598 .\" move to X-pos, if any
599 .if !''\\$2' .po \\$2
605 .if !\\n[.$] .@error "SM: no arguments"
606 .if \\n[.$]=1 \s-1\\$1\s0
607 .if \\n[.$]=2 \s-1\\$1\s0\\$2
608 .if \\n[.$]=3 \\$1\s-1\\$2\s0\\$3
611 .nr misc*S-ps \n[@ps]
612 .nr misc*S-vs \n[@vs]
613 .nr misc*S-ps1 \n[@ps]
614 .nr misc*S-vs1 \n[@vs]
623 . ie \\n[.$]=1 .ds misc*b D
625 . ie \w@\\$2@=0 .ds misc*b C
628 . ie \w@\\$1@=0 .ds misc*a C
633 .if !'\\*[misc*a]'C' \{\
634 . ie '\\*[misc*a]'P' .ps \\n[misc*S-ps]u
636 . ie '\\*[misc*a]'D' .ps \\n[S]
638 . if \\n[D]>2 .tm S: .ps \\*[misc*a]
642 .\" set vertical spacing
643 .if !'\\*[misc*b]'C' \{\
644 . ie '\\*[misc*b]'P' .vs \\n[misc*S-vs]u
646 . ie '\\*[misc*b]'D' .vs \\n[.ps]s+2p
648 . if \\n[D]>2 .tm S: .vs \\*[misc*b]
658 . tmc "S(\\$*): ma:\\*[misc*a], mb:\\*[misc*b]
659 . tm1 " => ps:\\n[.s]p (\\n[@psu]u), vs:\\n[@vsp]p (\\n[@vs]u) (res:\\n[@res])
661 .nr misc*S-ps \\n[misc*S-ps1]
662 .nr misc*S-vs \\n[misc*S-vs1]
663 .nr misc*S-ps1 \\n[@ps]
664 .nr misc*S-vs1 \\n[@vs]
688 . ds \\$3 "\\*[misc*rd]
692 .if !''\\$2' .rn misc*rd \\$2
696 .\" VERBON [flag [pointsize [font]]]
700 .\" 1 add an empty line before verbose text
701 .\" 2 add an empty line after verbose text
702 .\" 3 numbered lines (controlled by the string Verbnm)
703 .\" 4 indent text by the numbervariable Verbin.
707 .if (0\\n[misc*verb]%4)/2 .SP \\n[Lsp]u
708 .misc@ev-keep misc*verb-ev
710 .if (0\\n[misc*verb]%16)/8 .nm \\*[Verbnm]
711 .ie !'\\$3'' .ft \\$3
720 .if (0\\n[misc*verb]%32)/16 .in +\\n[Verbin]u
721 .if 0\\n[misc*verb]%2 \{\
723 . nr @verbose-flag 1 \" tell pageheader to set ec/eo
729 .if (0\\n[misc*verb]%8)/4 .SP \\n[Lsp]u
730 .if (0\\n[misc*verb]%16)/8 .nm
731 .if (0\\n[misc*verb]%32)/16 .in
735 .\" Wrapper to cancel the side effect of .tag + .br generating
736 .\" unwanted vertical space.
738 .\" This macro is currently used solely to give information to the
739 .\" HTML postprocessor. If for PostScript or PDF output macro .H
740 .\" had been followed by .DS both .H post-space and .DS pre-space
741 .\" had been output because of this macro. So it is now enabled
742 .\" only when postprocessor tags are required.
743 .if '\*[.T]'html' \{\
744 .\" retain temporary indentation and horizontal position
745 .if !(\\n[.in]-\\n[.i]=0) .nr misc*ti \\n[.in]
761 .\" ######## module pict #################
767 .\" I assume that the number variable pict*id is the same
768 .\" between two runs.
790 . nr pict*ind (m;\\$2)
804 . nr pict*width (i;\\$1)
808 . nr pict*height (i;\\$1)
812 .\" let mmroff know the filename and id
814 . tm .\\\\" PIC id \\n[pict*id]
815 . tm .\\\\" PIC file \\*[pict*f]
817 .\" these are defined by mmroff in the second pass
818 .if d pict*file!\\n[pict*id] \{\
819 . ds pict*f \\*[pict*file!\\n[pict*id]]
820 . nr pict*llx \\n[pict*llx!\\n[pict*id]]
821 . nr pict*lly \\n[pict*lly!\\n[pict*id]]
822 . nr pict*urx \\n[pict*urx!\\n[pict*id]]
823 . nr pict*ury \\n[pict*ury!\\n[pict*id]]
825 . nr pict*w (p;\\n[pict*urx]-\\n[pict*llx])
826 . if \\n[pict*w]<0 .nr pict*w 0-\\n[pict*w]
827 . nr pict*h (p;\\n[pict*ury]-\\n[pict*lly])
828 . if \\n[pict*h]<0 .nr pict*h 0-\\n[pict*h]
829 . if \\n[pict*width]>0 \{\
830 . nr pict*rs (u;1000*\\n[pict*width]/\\n[pict*w])
831 . nr pict*w (u;\\n[pict*w]*\\n[pict*rs]/1000)
832 . nr pict*h (u;\\n[pict*h]*\\n[pict*rs]/1000)
834 . if \\n[pict*height]>0 \{\
835 . nr pict*rs (u;1000*\\n[pict*height]/\\n[pict*h])
836 . nr pict*h (u;\\n[pict*h]*\\n[pict*rs]/1000)
838 . if '0'\\n[pict*mode]' \{\
839 . nr pict*in \\n[.i]u
841 . if '1'\\n[pict*mode]' \{\
842 . nr pict*in (u;\\n[.l]-\\n[.i]-\\n[pict*w])
844 . if '2'\\n[pict*mode]' \{\
845 . nr pict*in \\n[pict*ind]u
847 . if '3'\\n[pict*mode]' \{\
848 . nr pict*in (u;(\\n[.l]-\\n[.i]-\\n[pict*w])/2)
851 . if \\n[pict*h]>0 .ds pict*h \\n[pict*h]
855 . \" these lines are copied and modified from pspic.tmac.
856 . \" Originally written by James Clark
858 . ie \\n[pict*box]>0 \{\
859 \v'-1v'\h'\\n[pict*in]u'\
860 \Z'\D'p 0 \\n[pict*h]u \\n[pict*w]u 0 0 -\\n[pict*h]u''\
861 \v'\\n[pict*h]u'\X'ps: import \\*[pict*f] \
862 \\n[pict*llx] \\n[pict*lly] \
863 \\n[pict*urx] \\n[pict*ury] \
864 \\n[pict*w] \\n[pict*h]'
867 \v'-1v'\h'\\n[pict*in]u'\
869 \Z'\D'p 0 \\n[pict*h]u \\n[pict*w]u 0 0 -\\n[pict*h]u''\
871 \v'\\n[pict*h]u'\X'ps: import \\*[pict*f] \
872 \\n[pict*llx] \\n[pict*lly] \
873 \\n[pict*urx] \\n[pict*ury] \
874 \\n[pict*w] \\n[pict*h]'
883 .if \\n[.$]<2 .@error "EPIC: Not enough arguments"
884 .nr pict*adj 0 \" centered
886 . shift 1 \" left adjust
892 .ds pict*name "External picture
893 .if !''$3' .ds pict*name \\$3
897 .if !\\n[pict*adj] .nr pict*ind (u;(\\n[.l]-\\n[.i]-\\n[pict*w])/2)
900 \D'l \\n[pict*w]u 0'\
901 \D'l 0 -\\n[pict*h]u'\
902 \D'l -\\n[pict*w]u 0'\
903 \D'l 0 \\n[pict*h]u'\
904 \v'-(u;\\n[pict*h]/2)'\
905 \h'(u;(\\n[pict*w]-\w'\\*[pict*name]'/2))'\\*[pict*name]
910 .\" ######## module acc #################
912 .\" accents. These are copied from mgs, written by James Clark.
914 .ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
915 \h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
918 .ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
926 .acc@under-def , \(ac
927 .\" ######## module uni #################
928 .\" unimplemented macros
930 'tm "OK: not implemented"
933 'tm "PM: not implemented"
935 .\" ######## module hd #################
936 .\" support for usermacro
937 .nr hd*h1-page 1 \" last page-number for level 1 header.
948 .\" .hd@split variable index name val1 val2 ...
950 .if \\$2>(\\n[.$]-3) .@error "\\$3 must have at least \\$2 values (\\*[\\$3]).
952 .ds \\$1 \\$[\\n[hd*sp-tmp]]
959 .if !r hd*cur-bline .nr hd*cur-bline \\n[nl]
961 .df@print-float 2\" $$$ could be wrong...
962 .\" terminate all lists
967 .if !\\n[hd*level] .nr hd*level \\n[Hu]
969 .\" clear lower counters
971 .while \\n+[hd*i]<15 .if \\n[hd*level]<\\n[hd*i] .nr H\\n[hd*i] 0 1
973 .\" save last text for use in TP
974 .if \\n[hd*level]=1 .ds H1txt \\$2\\$3
976 .\" This is a little fix to be able to get correct H1 heading number
977 .\" in page headers. Special attention was needed when other formats are used.
979 . ds hd*format \\g[H1]
982 . af H1 \\*[hd*format]
984 .el .nr H1h \\n[H1] 1
985 .if \\n[hd*level]=1 .nr H1h +1
987 .\" Check if it's time for new page. Only if text has
989 .if \\n[Ej]&(\\n[Ej]>=\\n[hd*level])&(\\n[nl]>\\n[hd*cur-bline]) .pg@next-page
991 .\" increment current counter
992 .nr H\\n[hd*level] +1
994 .\" update pagenumber if section-page is used
995 .if (\\n[hd*level]=1)&(\\n[Sectp]>0) .hd@set-page 1
997 .\" hd*mark is the text written to the left of the header.
1000 .if \\n[hd*level]>1 .as hd*mark \\n[H2]
1003 .while \\n+[hd*i]<15 .if \\n[hd*level]>(\\n[hd*i]-1) .as hd*mark .\\n[H\\n[hd*i]]
1004 .if \\n[Ht] .ds hd*mark \\n[H\\n[hd*level]].
1006 .\" special case, no dot after level one heading if not H1dot true
1007 .if (\\n[hd*level]=1)&(\\n[H1dot]=0) .ds hd*mark \\n[H1]
1009 .ds hd-mark-trimmed \\*[hd*mark]\" save hd-mark w/o spaces for references
1010 .as hd*mark \ \ \" add spaces between mark and heading
1011 .if !\\n[hd*arg1] .ds hd*mark\" no mark for unnumbered
1013 .if \\n[D]>1 .tm At header \\*[hd*mark] "\\$2"
1014 .nr hd*htype 0 \" hd*htype = check break and space
1015 . \" 0 = run-in, 1 = break only, 2 = space
1016 .if \\n[hd*level]<=\\n[Hb] .nr hd*htype 1
1017 .if \\n[hd*level]<=\\n[Hs] .nr hd*htype 2
1018 . \" two spaces if hd*htype == 0
1019 .ie (\\n[hd*htype]=0)&(\w@\\$2@) .ds hd*suf-space " \"
1020 .el .ds hd*suf-space
1021 .nr hd*need 2v \" hd*need = header need space
1022 .\"---------- user macro HX ------------
1023 .\" User exit macro to override numbering.
1024 .\" May change hd*mark (}0), hd*suf-space (}2) and hd*need (;3)
1025 .\" Can also change Hps1/2.
1026 .if d HX .HX \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
1027 .\"--------------------------------------
1029 .ie \\n[hd*level]<=\\n[Hps] .SP (u;\\n[Hps2])
1030 .el .SP (u;\\n[Hps1])
1032 .par@reset-num \\n[hd*level]\" reset numbered paragraph
1033 .\" start diversion to measure size of header
1035 \\*[hd*mark]\\$2\\$3\\*[hd*suf-space]
1039 .if \\n[hd*htype] .na \" no adjust if run-in
1040 .if \\n[hd*htype]<2 .nr hd*need +\\n[Lsp]u \" add some extra space
1041 .ne \\n[hd*need]u+\\n[dn]u+.5p-1v \" this is the needed space for a header
1043 .\" size and font calculations
1044 .hd@split hd*font \\n[hd*level] HF \\*[HF]\" get font for this level
1045 .ft \\*[hd*font]\" set new font
1046 .hd@split hd*new-ps \\n[hd*level] HP \\*[HP]\" get point size
1047 .ie (\\*[hd*new-ps]=0):(\w@\\*[hd*new-ps]@=0) \{\
1048 . if \\n[hd*htype] \{\
1049 . if '\\*[hd*font]'3' \{\
1053 . if '\\*[hd*font]'B' \{\
1061 . vs \\*[hd*new-ps]+2
1064 .\"---------- user macro HY -------------
1065 .\" user macro to reset indents
1066 .if d HY .HY \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
1067 .\" HTML: mark beginning of heading
1068 .misc@tag NH \\n[hd*level]
1069 .\"--------------------------------------
1070 .nr hd*mark-size \w@\\*[hd*mark]@
1071 .if (\\n[hd*level]<=\\n[Hc])&\\n[hd*htype] .ce\" center if level<=Hc
1073 .\" finally, output the header
1075 .\" and the rest of the header
1076 .ie \\n[hd*htype] \{\
1080 .el \\$2\\$3\\*[hd*suf-space]\&\c
1082 .\" restore pointsize and vertical size.
1086 .\" table of contents
1087 .if (\\n[hd*level]<=\\n[Cl])&\w@\\$2@ .toc@entry \\n[hd*level] "\\$2"
1088 .\" set adjust to previous value
1090 .\" do break or space
1091 .if \\n[hd*htype] .br
1092 .if \\n[hd*htype]>1 .SP (u;\\n[Lsp]*\\n[Hss])
1093 .if \\n[hd*htype] \{\
1094 . \" indent if Hi=1 and Pt=1
1095 . if (\\n[Hi]=1)&(\\n[Pt]=1) .ti +\\n[Pi]n
1096 . \" indent size of mark if Hi=2
1097 . if \\n[hd*htype]&(\\n[Hi]>1) .ti +\\n[hd*mark-size]u
1099 .nr par@ind-flag 0 \" no indent on .P if Pt=2
1101 .\" check if it is time to reset footnotes
1102 .if (\\n[hd*level]=1)&\\n[ft*clear-at-header] .nr ft*nr 0 1
1104 .\" check if it is time to reset indexes
1105 .if (\\n[hd*level]=1)&\\n[Sectf] \{\
1111 .\"---------- user macro HZ ----------
1112 .if d HZ .HZ \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
1113 .nr hd*last-pos \\n[nl]
1114 .nr hd*last-hsize \\n[.k]
1116 .\" HTML: end of heading
1122 .while \\n+[hd*i]<15 .af H\\n[hd*i] \\$[\\n[hd*i]] 1
1124 .\"----------------------
1125 .\" set page-nr, called from header
1129 .ie \\n[.$]>0 .nr P \\$1
1131 .\" Set section-page-string
1132 .ds hd*sect-pg \\n[H1]-\\n[P]
1133 .if \\n[Sectp]>1 .if '\\n[H1]'0' .ds hd*sect-pg "
1135 .\"########### module pg ####################
1136 .\" set end of text trap
1140 .ds pg*header ''- \\nP -''
1142 .if \n[N]=4 .ds pg*header ''''
1143 .if (\n[N]=3):(\n[N]=5) \{\
1145 . ds pg*footer ''\\*[hd*sect-pg]''
1153 .nr pg*foot-margin 0
1155 .nr pg*footer-size 5v\" 1v+footer+even/odd footer+2v
1156 .nr pg*header-size 7v\" 3v+header+even/odd header+2v
1157 .nr pg*extra-footer-size 0
1158 .nr pg*extra-header-size 0
1161 .nr pg*cols-per-page 1
1162 .nr pg*cur-po \n[@po]
1167 .\"-------------------------
1168 .\" footer TRAPS: set, enable and disable
1170 .nr pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u+\\n[pg*extra-footer-size]u)
1172 .if \\n[D]>2 .tm pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u+\\n[pg*extra-footer-size]u) = \\n[pg*foot-trap]
1174 .\" last-pos points to the position of the footer and bottom
1175 .\" block below foot-notes.
1176 .nr pg*last-pos \\n[@pl]u-(\\n[pg*block-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u+\\n[pg*extra-footer-size]u)
1177 .if \\n[D]>2 .tm pg*last-pos \\n[@pl]u-(\\n[pg*block-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]u+\\n[pg*extra-footer-size]u) = \\n[pg*last-pos]
1180 .\" Disable in HTML mode
1181 .if !'\*[.T]'html' \{\
1182 .wh \\n[pg*foot-trap]u pg@footer
1183 .if \\n[D]>2 .tm pg@enable-trap .t=\\n[.t] nl=\\n[nl]
1190 .\" move to new trap (if changed).
1196 .de pg@enable-top-trap
1197 .\" set trap for pageheader.
1198 .nr pg*top-enabled 1
1200 .de pg@disable-top-trap
1201 .\" remove trap for pageheader.
1202 .nr pg*top-enabled 0
1204 .\" no header on the next page
1206 .nr pg*top-enabled (-1)
1208 .\" set first trap for pagefooter
1212 .\"-------------------------
1213 .\" stop output and begin on next page. Fix footnotes and all that.
1216 .ne 999i \" activate trap
1219 .\"-------------------------
1220 .\" support for PX, TP and EOP.
1222 .als }e pg*even-header
1223 .als }o pg*odd-header
1225 .als TPeh pg*even-header
1226 .als TPoh pg*odd-header
1229 .als }f pg*even-footer
1230 .als }p pg*odd-footer
1232 .als EOPef pg*even-footer
1233 .als EOPof pg*odd-footer
1234 .\"------------------------------------------------------------
1237 .\" Disable in HTML mode
1238 .if !'\*[.T]'html' \{\
1239 .if \\n[D]>1 .tm Page# \\n[%] (\\n[.F]:\\n[c.])
1240 .\" check if Hy has been changed
1244 .tl '<pagenr\ \\n[%]>'''
1246 .\" assign current page-number to P
1249 .nr line*lp\\n[.z] 0
1250 .nr line*ac\\n[.z] 0
1252 .\" suppress pageheader if pagenumber == 1 and N == [124]
1253 .if \\n[pg*top-enabled] \{\
1255 .\". pg@disable-top-trap
1256 . if \\n[pg*extra-header-size] 'sp \\n[pg*extra-header-size]u
1257 . if \\n[pg*top-margin] 'sp \\n[pg*top-margin]u
1260 . ie d let@header .let@header
1265 . ds hd*format \\g[P]
1267 . ie ((\\n[P]=1)&((\\n[N]=1):(\\n[N]=2))) .sp
1268 . el .tl \\*[pg*header]
1269 . af P \\*[hd*format]
1270 . ie o .tl \\*[pg*odd-header]
1271 . el .tl \\*[pg*even-header]
1282 . \" check for pending footnotes
1285 . \" back to normal text processing
1287 . \" mark for multicolumn
1288 . nr pg*head-mark \\n[nl]u
1289 . \" reset NCOL pointer at each new page.
1291 . \" set multicolumn
1294 . \" print floating displays
1299 .if \\n[pg*top-enabled]<0 .nr pg*top-enabled 1
1300 .nr hd*cur-bline \\n[nl] \" .H needs to know if output has occurred
1303 .\"---------------------------------------------------------
1307 .if \\n[D]>2 .tm Footer# \\n[%] (\\n[.F]:\\n[c.]) nl=\\n[nl]
1311 .\" increment pageoffset for MC
1312 .\" move to the exact start of footer.
1313 'sp |\\n[pg*foot-trap]u+1v
1315 .if \\n[D]>3 .tm FOOTER after .sp, nl=\\n[nl]
1317 .if d ft*div .ft@print
1320 .if !\\n[pg*cur-column] .pg@print-footer
1324 .if \\n[@verbose-flag] .eo \" to help VERBON/VERBOFF
1326 .\"-------------------------
1328 .\" jump to the position just below the foot-notes.
1329 'sp |\\n[pg*last-pos]u+1v
1330 .if \\n[D]>3 .tm print-footer nl=\\n[nl]
1331 .\" check if there are any bottom block
1332 .if d pg*block-div .pg@block
1334 .\" print the footer and eject new page
1338 .\" user defined end-of-page macro
1341 . ie o .tl \\*[pg*odd-footer]
1342 . el .tl \\*[pg*even-footer]
1343 . ds hd*format \\g[P]
1345 . ie (\\n[P]=1)&(\\n[N]=1) .tl \\*[pg*header]
1346 . el .tl \\*[pg*footer]
1347 . af P \\*[hd*format]
1348 . tl ''\\*[Pg_type!\\n[@copy_type]]''
1352 .\" be sure that floating displays and footnotes will be
1353 .\" printed at the end of the document.
1354 .ie (\\n[df*fnr]>=\\n[df*o-fnr]):\\n[ft*exist] \{\
1361 .\"-------------------------
1363 .\" Initialize the title environment
1380 .\"-------------------------
1390 .ds pg*odd-header "\\$1
1394 .ds pg*even-header "\\$1
1398 .ds pg*odd-footer "\\$1
1402 .ds pg*even-footer "\\$1
1420 .\"-------------------------
1421 .\" end of page processing
1424 .\" output footnotes. set trap for block
1427 .\"-------------------------
1428 .\" print bottom block
1438 .\"-------------------------
1439 .\" define bottom block
1441 .misc@ev-keep pg*block-ev
1446 .\"-------------------------
1450 .nr pg*block-size \\n[dn]u
1454 .\"-------------------------
1455 .\" print out all pending text
1457 .if \\n[D]>2 .tm ---------- End of text processing ----------------
1461 .\"-------------------------
1462 .\" set top and bottom margins
1463 .\" -T sets pg*footer-size and pg*header-size instead
1468 . nr pg*footer-size 5v
1469 . nr pg*header-size 7v
1471 . if \\n[.$]>0 .nr pg*header-size (v;\\$1)
1472 . if \\n[.$]>1 .nr pg*footer-size (v;\\$2)
1476 . nr pg*extra-footer-size 0
1477 . nr pg*extra-header-size 0
1479 . if \\n[.$]>0 .nr pg*extra-header-size (v;\\$1)
1480 . if \\n[.$]>1 .nr pg*extra-footer-size (v;\\$2)
1482 . tm extra top \\n[pg*extra-footer-size]
1483 . tm extra bottom \\n[pg*extra-header-size]
1488 .\"---------------------
1489 .\" multicolumn output.
1491 .if \\n[pg*cols-per-page]>1 \{\
1492 . ll \\n[pg*column-size]u
1496 .if \\n[pg*cols-per-page]>1 \{\
1497 . ie \\n+[pg*cur-column]>=\\n[pg*cols-per-page] \{\
1498 . nr pg*cur-column 0 1
1499 . nr pg*cur-po \\n[@po]u
1504 . nr pg*cur-po +(\\n[pg*column-size]u+\\n[pg*column-sep]u)
1505 . po \\n[pg*cur-po]u
1506 ' sp |\\n[pg*head-mark]u
1511 .\" An argument disables the page-break.
1514 .if \\n[pg*cols-per-page]<=1 .@error "1C: multicolumn mode not active"
1515 .nr pg*cols-per-page 1
1517 .nr pg*column-size \\n[@ll]
1518 .nr pg*ncol-i \\n[pg*cur-column]\" temp variable
1519 .nr pg*cur-column 0 1
1520 .nr pg*cur-po \\n[@po]u
1525 . if \\n[pg*ncol-i]>0 \{\
1526 . @warning 1C: footnotes will be messy
1529 . if \\n[pg*last-ncol]>0 \{\
1530 . sp |\\n[pg*last-ncol]u
1537 .nr pg*head-mark \\n[nl]u
1538 .if \\n[pg*cols-per-page]>1 .@error "2C: multicolumn mode already active"
1539 .nr pg*cols-per-page 2
1540 .nr pg*column-sep \\n[@ll]/15
1541 .nr pg*column-size (\\n[@ll]u*7)/15
1542 .nr pg*cur-column 0 1
1543 .nr pg*cur-po \\n[@po]u
1544 .ll \\n[pg*column-size]u
1545 .\" .lt \\n[pg*column-size]u
1547 .\" MC column-size [ column-separation ]
1550 .nr pg*head-mark \\n[nl]u
1551 .if \\n[pg*cols-per-page]>1 .@error "MC: multicolumn mode already active"
1552 .ie ''\\$1' .nr pg*column-size \\n[.l]
1553 .el .nr pg*column-size (n;\\$1)
1554 .ie ''\\$2' .nr pg*column-sep \\n[pg*column-size]/15
1555 .el .nr pg*column-sep (n;\\$2)
1557 .\" calculate the number of columns/page
1558 .nr pg*cols-per-page 0
1559 .nr pg*i \\n[pg*column-size]
1560 .while \\n[pg*i]<=\\n[.l] \{\
1561 . nr pg*cols-per-page \\n[pg*cols-per-page]+1
1562 . nr pg*i \\n[pg*i]+\\n[pg*column-sep]+\\n[pg*column-size]
1564 .nr pg*cur-column 0 1
1565 .nr pg*cur-po \\n[@po]u
1566 .ll \\n[pg*column-size]u
1567 .\" .lt \\n[pg*column-size]u
1569 .\" begin a new column
1572 .if \\n[nl]>\\n[pg*last-ncol] .nr pg*last-ncol \\n[nl]
1580 .\" force new page by writing something invisible.
1581 .while \\n+[pg*i]<=(0\\$1) \{\
1586 .\"-------------------------------
1587 .\" MULB width1 space1 width2 space2 width3 space3 ...
1595 . nr pg*mul!\\n+[pg*i] (n;0\\$1)
1596 . nr pg*muls!\\n[pg*i] (n;0\\$2)
1599 .nr pg*mul-max-col \\n[pg*i]
1600 .ds pg*mul-fam \\n[.fam]
1601 .nr pg*mul-font \\n[.f]
1605 .fam \\*[pg*mul-fam]
1606 .ft \\n[pg*mul-font]
1614 .if \\n[pg*mul-x]>=\\n[pg*mul-max-col] .@error "MULN: Undefined columnwidth"
1616 .if \\n[.d]>\\n[pg*mul-last] .nr pg*mul-last \\n[.d]
1618 .in \\n[pg*mul-ind]u
1619 .ll (u;\\n[.i]+\\n[pg*mul!\\n+[pg*mul-x]])u
1620 .nr pg*mul-ind +(u;\\n[pg*mul!\\n[pg*mul-x]]+\\n[pg*muls!\\n[pg*mul-x]])
1626 .if \\n[.d]>\\n[pg*mul-last] .nr pg*mul-last \\n[.d]
1629 .ne \\n[pg*mul-last]u
1634 .sp \\n[pg*mul-last]u
1640 .ie o .if !\\n[pg*head-mark]=\\n[nl] \{\
1646 .\"########### module footnotes ###################
1651 .nr ft*hyphen 0\" hyphenation value
1652 .nr ft*adjust 1\" >0 if adjust true
1653 .nr ft*indent 1\" >0 if text indent true (not imp. $$$)
1654 .nr ft*just 0\" 0=left justification, 1=right (not imp. $$$)
1655 .nr ft*exist 0\" not zero if there are any footnotes to be printed
1656 .nr ft*clear-at-header 0\" >0 if footnotes should be reset at first level head.
1658 .ds F \v'-.4m'\s-3\\n+[ft*nr]\s0\v'.4m'
1660 .\"-----------------
1661 .\" init footnote environment
1663 .\" indentcontrol not implemented $$$
1664 .\" label justification not implemented $$$
1667 .ie \\n[ft*adjust] 'ad
1669 .ie \\n[ft*hyphen] 'hy 6
1676 .\"-----------------
1677 .\" set footnote format
1678 .\" no support for two column processing (yet). $$$
1680 .if \\n[.$]=0 .@error "FD: bad arg \\$1"
1681 .ie \\n[.$]=2 .nr ft*clear-at-header 1
1682 .el .nr ft*clear-at-header 0
1685 . ie \\$1>11 .nr ft*format 0
1686 . el .nr ft*format \\$1
1688 . nr ft*hyphen (\\n[ft*format]%2)*6
1689 . nr ft*format \\n[ft*format]/2
1691 . nr ft*adjust 1-(\\n[ft*format]%2)
1692 . nr ft*format \\n[ft*format]/2
1694 . nr ft*indent 1-(\\n[ft*format]%2)
1695 . nr ft*format \\n[ft*format]/2
1697 . nr ft*just \\n[ft*format]%2
1701 .\" Footnote and display width control $$$
1704 .while \\n+[ft*i]<=\\n[.$] \{\
1705 . ds ft*x \\$[\\n[ft*i]]
1706 . if '\\*[ft*x]'N' \{\
1710 . nr ds*float-break 1
1712 . if '\\*[ft*x]'-WF' .nr ft*wide 0
1713 . if '\\*[ft*x]'WF' .nr ft*wide 1
1714 . if '\\*[ft*x]'-FF' .nr ft*first-fn 0
1715 . if '\\*[ft*x]'FF' .nr ft*first-fn 1
1716 . if '\\*[ft*x]'-WD' \{\
1718 . if r ft*df-save \{\
1719 . nr Df \\n[ft*df-save]
1723 . if '\\*[ft*x]'WD' \{\
1725 . nr ft*df-save \\n[Df]
1728 . if '\\*[ft*x]'-FB' .nr ds*float-break 0
1729 . if '\\*[ft*x]'FB' .nr ds*float-break 1
1730 . if \\n[D]>1 .tm WC WF=\\n[ft*wide] WD=\\n[ds*wide]
1733 .\"-----------------
1735 .\" Change environment, switch to diversion and print the foot-note mark.
1737 .if \\n[ft*busy] .@error "FS: missing FE"
1741 .if !\\n[ft*wide] .pg@set-po
1743 .nr ft*space (u;\\n[Fs]*\\n[Lsp])
1746 .ie \\n[.$] .ds ft*mark \\$1
1747 .el .ds ft*mark \\n[ft*nr].
1753 .\"-----------------
1754 .\" init footnote diversion
1755 .de ft@init-footnote
1760 .nr ft*note-size \\n[dn]
1762 .\"-----------------
1764 .\" End the diversion, back to previous environment, and adjust
1765 .\" the trap to the new foot-note size.
1772 .if \\n[@pl]u<\\n[dn]u .@error "FE: too big footnote"
1773 .if !d ft*div .nr dn +1v
1774 .if \\n[D]>3 .tm FE: foot-trap=\\n[pg*foot-trap] .d=\\n[.d] dn=\\n[dn]
1775 .ie (\\n[pg*foot-trap]u-\\n[.d]u)<\\n[dn]u \{\
1782 . if !d ft*div .ft@init-footnote
1786 . nr ft*note-size +\\n[dn]
1792 .\"-----------------
1793 .\" print footnotes, see pg@footer
1806 .\"-----------------
1807 .\" check if any pending footnotes, see pg@header
1809 .if d ft*next-div \{\
1818 . nr ft*note-size +\\n[dn]
1825 .\"########### module display ###################
1826 .nr ds*wide 0\" >0 if wide displays wanted
1827 .nr df*fnr 0 1\" floating display counter
1828 .nr df*o-fnr 1\" floating display counter, already printed
1829 .nr ds*snr 0 1\" static display counter
1830 .nr ds*lvl 0 1\" display level
1831 .nr ds*float-busy 0\" >0 if printing float
1832 .nr df*float 0\" >0 if previous display was floating
1833 .\"--------------------------------------------
1835 .ie \\n[df*float] .df@end \\$@
1838 .\"--------------------------------------------
1839 .\" floating display start
1840 .\" nested DF/DE is not allowed.
1842 .if \\n[df*float] .@error "DF:nested floating is not allowed. Use DS."
1845 .nr df*old-ll \\n[.l]
1854 .ds@set-new-ev \\n[df*old-ll]
1858 .\"--------------------------------------------
1863 .nr df*width!\\n+[df*fnr] \\n[dl]
1864 .nr df*height!\\n[df*fnr] \\n[dn]
1865 .nr df*wide!\\n[df*fnr] \\n[ds*wide]
1866 .nr df*format!\\n[df*fnr] \\n[ds*format]
1868 .if \\n[D]>2 .tm DF:fnr=\\n[df*fnr] w=\\n[dl] h=\\n[dn] wide=\\n[ds*wide] \
1870 .\" move div to the floating display list
1871 .rn df*div df*fdiv!\\n[df*fnr]
1874 .\" print float if queue is empty and the display fits into
1875 .\" the current page
1876 .if ((\\n[df*fnr]>=\\n[df*o-fnr])&(\\n[dn]<\\n[.t])) .df@print-float 1
1880 .\" called by end-of-text
1883 .if \\n[df*o-fnr]<=\\n[df*fnr] \{\
1884 . if \\n[D]>2 .tm Print remaining displays.
1885 .\" still some floats left, make non-empty environment
1894 .\" print according to Df and De.
1895 .\" .df@print-float type
1896 .\" type called from
1898 .\" 2 end of section
1899 .\" 3 end of document
1900 .\" 4 beginning of new page
1903 .if \\n[Df]>5 .@error "Df=\\n[Df], max value is 5"
1904 .if !\\n[ds*float-busy] \{\
1905 . nr ds*float-busy 1
1907 . if \\n[D]>3 .tm print-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1909 . if (\\$1=1)&((\\n[Df]=1):(\\n[Df]=5)) \{\
1910 . if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
1911 . \" Print only new displays.
1912 . if \\n[df*o-fnr]=\\n[df*fnr] \{\
1914 . ds@print-one-float
1919 . if (\\$1=1)&(\\n[Df]=3) \{\
1920 . if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
1922 . ds@print-one-float
1925 .\" print all if Df<2 and end of section
1926 . if (\\$1=2)&(\\n[Sectp]>0)&(\\n[Df]<2) \{\
1928 . ds@print-all-floats
1930 .\" print all if end of document. Where should they go instead?
1933 . ds@print-all-floats
1936 . if (\\$1=4)&(\\n[Df]>1) \{\
1937 . if \\n[Df]=2 .ds@print-one-float
1938 . if \\n[Df]=3 .ds@print-one-float
1940 . ie \\n[De] .ds@print-all-floats
1941 . el .ds@print-this-page
1944 . nr ds*float-busy 0
1949 .\" print a floating diversion
1951 .nr df*old-ll \\n[.l]
1952 .nr df*old-in \\n[.i]
1955 .nr df*i \\n[df*o-fnr]
1956 .nr df*f \\n[df*format!\\n[df*i]]
1959 .if \\n[df*f]=1 'in +\\n[Si]n
1960 .if \\n[df*f]>=2 'in 0
1961 .if \\n[df*f]=2 'ce 9999
1962 .if \\n[df*f]=3 'in (u;(\\n[.l]-\\n[df*width!\\n[df*i]])/2)
1963 .if \\n[df*f]=4 'rj 9999
1964 .if \\n[df*f]=5 'in (u;\\n[.l]-\\n[df*width!\\n[df*i]])
1967 .df*fdiv!\\n[df*o-fnr]
1969 .if \\n[df*f]=2 'ce 0
1970 .if \\n[df*f]=4 'rj 0
1972 .rm df*fdiv!\\n[df*i]
1973 .rm df*height!\\n[df*i]
1974 .rm df*format!\\n[df*i]
1975 .if \\n[df*wide!\\n[df*i]] .nr pg*head-mark \\n[nl]u
1979 .\" print one floating display if there is one.
1980 .de ds@print-one-float
1981 .if \\n[df*o-fnr]<=\\n[df*fnr] \{\
1982 . if \\n[D]>3 .tm print-one-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1983 . if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
1985 . if \\n[De] .pg@next-page
1989 .\" print all queued floats.
1990 .\" if De>0 do a page eject between the floats.
1991 .de ds@print-all-floats
1992 .while \\n[df*o-fnr]<=\\n[df*fnr] \{\
1993 . if \\n[D]>3 .tm print-all-floats: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1994 . if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
1998 . if \\n[De] .pg@next-page
2002 .\" print as many floats as will fit on the current page
2003 .de ds@print-this-page
2004 .while \\n[df*o-fnr]<=\\n[df*fnr] \{\
2005 . if \\n[D]>3 .tm print-this-page: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
2006 . if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .break
2010 .\"---------------------------------------------------
2011 .\" get format of the display
2014 . ie r ds*format!\\$1 .nr ds*format \\n[ds*format!\\$1]
2015 . el .@error "DS/DF:wrong format:\\$1"
2018 .if \\n[D]>2 .tm set format=\\n[ds*format]
2019 .\" fill or not to fill, that is the...
2022 . ie r ds*fill!\\$2 .nr ds*fill \\n[ds*fill!\\$2]
2023 . el .@error "\\*[ds*type]:wrong fill:\\$2"
2025 .if \\n[D]>2 .tm set fill=\\n[ds*fill]
2027 .if \\n[.$]>2 .nr ds*rindent \\$3
2028 .if \\n[D]>2 .tm set indent=\\n[ds*rindent]
2030 .\"-----------------------------
2031 .\" .ds@set-new-ev previous-line-length
2035 .if \\n[ds*rindent] \{\
2036 . ll -\\n[ds*rindent]n
2037 . lt -\\n[ds*rindent]n
2039 .if \\n[ds*wide] \{\
2044 .ie \\n[ds*fill] 'fi
2047 .\"--------------------------------------------------------
2048 .nr ds*format 0\" dummy value for .En/.EQ
2049 .nr ds*format! 0\" no indent
2050 .nr ds*format!0 0\" no indent
2051 .nr ds*format!L 0\" no indent
2052 .nr ds*format!I 1\" indent
2053 .nr ds*format!1 1\" indent
2054 .nr ds*format!C 2\" center each line
2055 .nr ds*format!2 2\" center each line
2056 .nr ds*format!CB 3\" center as block
2057 .nr ds*format!3 3\" center as block
2058 .nr ds*format!R 4\" right justify each line
2059 .nr ds*format!4 4\" right justify each line
2060 .nr ds*format!RB 5\" right justify as block
2061 .nr ds*format!5 5\" right justify as block
2063 .nr ds*fill! 0\" no fill
2064 .nr ds*fill!N 0\" no fill
2065 .nr ds*fill!0 0\" no fill
2066 .nr ds*fill!F 1\" fill on
2067 .nr ds*fill!1 1\" fill on
2068 .\"--------------------------------------------
2069 .\" static display start
2070 .\" nested DS/DE is allowed. No limit on depth.
2077 .nr ds*old-ll \\n[.l]
2078 .nr ds*old-in \\n[.i]
2079 .misc@push ds-in \\n[ds*old-in] \" Saving indent and line length of
2080 .misc@push ds-ll \\n[ds*old-ll] \" the text outside the display.
2081 .misc@push ds-form \\n[ds*format]
2084 .misc@ev-keep ds*ev!\\n+[ds*snr]
2088 .\" indent in a diversion doesn't seem like a good idea.
2090 .di ds*div!\\n[ds*snr]
2092 .nr ds*div-ll \\n[ds*old-ll]
2093 .if \\n[ds*format]=1 .nr ds*div-ll -\\n(Sin
2094 .ds@set-new-ev \\n[ds*div-ll]
2097 .\"--------------------------------------------
2099 .if \\n-[ds*lvl]<0 .@error "DE: no corresponding DS"
2103 .nr ds*width \\n[dl]
2104 .nr ds*height \\n[dn]
2105 .misc@pop-nr ds-ll ds*old-ll \" Restore indent and
2106 .misc@pop-nr ds-in ds*old-in \" line length
2107 .misc@pop-nr ds-form ds*format
2111 .\" calculate needed space
2112 .nr ds*need \\n[ds*height]
2113 .nr ds*i \\n[pg*foot-trap]-\\n[pg*header-size]u-\\n[pg*extra-header-size]u
2114 .if (\\n[ds*height]>\\n[ds*i])&(\\n[.t]<(\\n[ds*i]/2)) .nr ds*need \\n[.t]u+1v
2115 .if (\\n[ds*height]<\\n[ds*i])&(\\n[.t]<(\\n[ds*height])) .nr ds*need \\n[.t]u+1v
2116 .\" Eject page if display will fit one page and
2117 .\" there are less than half of the page left.
2118 .if \\n[ds*need] .ne \\n[ds*need]u
2120 .\" Print static display
2122 .if r Dsp .nr ds*i \\n[Dsp]
2124 .if \\n[Ds] .SP \\n[ds*i]u \" Space before display
2125 .\" check if pending equation label
2126 .eq@check \\n[ds*need]
2128 .if \\n[ds*format]=1 'in \\n[ds*old-in]u+\\n[Si]n
2129 .if \\n[ds*format]>=2 'in 0
2130 .if \\n[ds*format]=2 'ce 9999
2131 .if \\n[ds*format]=3 'in (u;(\\n[.l]-\\n[ds*width])/2)
2132 .if \\n[ds*format]=4 'rj 9999
2133 .if \\n[ds*format]=5 'in (u;\\n[.l]-\\n[ds*width])
2137 .if \\n[Ds] .SP \\n[ds*i]u \" Space after display
2139 .if \\n[ds*format]=2 'ce 0
2140 .if \\n[ds*format]=4 'rj 0
2141 .rm ds*div!\\n[ds*snr]
2146 .\"########### module list ###################
2147 .\" .LI text-indent mark-indent pad type [mark [LI-space [LB-space] ] ]
2158 .\"--------------------------
2159 .\" the major list-begin macro.
2160 .\" If type == -1 a 'break' will occur.
2162 .if \\n[.$]<4 .@error "LB: not enough arguments, min 4"
2163 .misc@push cind \\n[.i]
2164 .misc@push tind \\n[li*tind]
2165 .misc@push mind \\n[li*mind]
2166 .misc@push pad \\n[li*pad]
2167 .misc@push type \\n[li*type]
2168 .misc@push li-spc \\n[li*li-spc]
2169 .ds li*mark-list!\\n[li*lvl] \\*[li*mark]
2172 .nr li*tind (n;0\\$1)\" text-indent
2173 .nr li*mind (n;0\\$2)\" mark-indent
2174 .nr li*pad (n;0\\$3)\" pad
2175 .nr li*type 0\\$4\" type
2176 .ds li*mark \\$5\" mark
2177 .ie !'\\$6'' .nr li*li-spc \\$6\" LI-space
2179 .ie !'\\$7'' .nr li*lb-spc \\$7\" LB-space
2181 .\" init listcounter
2182 .nr li*cnt!\\n[li*lvl] 0 1
2184 .af li*cnt!\\n[li*lvl] 1
2185 .if \\n[li*type] .if !'\\*[li*mark]'' .af li*cnt!\\n[li*lvl] \\*[li*mark]
2187 .if \\n[li*lb-spc] .SP (u;\\n[li*lb-spc]*\\n[Lsp])
2192 .if \\n[li*lvl]<1 .@error "LI:no lists active"
2193 .if \\n[li*li-spc]&(\\n[Ls]>=\\n[li*lvl]) .SP (u;\\n[li*li-spc]*\\n[Lsp])
2196 .ds li*c-mark \\*[li*mark]
2197 .nr li*cnt!\\n[li*lvl] +1
2198 .if \\n[li*type]=1 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]].
2199 .if \\n[li*type]=2 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]])
2200 .if \\n[li*type]=3 .ds li*c-mark (\\n[li*cnt!\\n[li*lvl]])
2201 .if \\n[li*type]=4 .ds li*c-mark [\\n[li*cnt!\\n[li*lvl]]]
2202 .if \\n[li*type]=5 .ds li*c-mark <\\n[li*cnt!\\n[li*lvl]]>
2203 .if \\n[li*type]=6 .ds li*c-mark {\\n[li*cnt!\\n[li*lvl]]}
2204 .if \\n[.$]=1 .ds li*c-mark \\$1
2206 . ie (\\$2=2):(\\n[Limsp]=0) .ds li*c-mark \\$1\\*[li*c-mark]
2207 . el .ds li*c-mark \\$1\ \\*[li*c-mark]
2210 .\" determine where the text begins
2211 .nr li*text-begin \\n[li*tind]>?\w@\\*[li*c-mark]\ @
2213 .\" determine where the mark begin
2214 .ie !\\n[li*pad] .nr li*in \\n[li*mind]
2215 .el .nr li*in \\n[li*text-begin]-\\n[li*pad]-\w@\\*[li*c-mark]@
2216 .if !\\n[li*in] .nr li*in 0
2219 .\" no indentation if hanging indent
2220 .if (\w@\\*[li*c-mark]@=0)&((\\n[.$]=0):(\w@\\$1@=0)) .nr li*text-begin 0
2221 \Z'\&\h'\\n[li*in]u'\\*[li*c-mark]'\h'\\n[li*text-begin]u'\&\c
2222 .if \\n[li*type]=-1 .br
2228 .misc@pop-nr cind li*tmp
2230 .misc@pop-nr tind li*tind
2231 .misc@pop-nr mind li*mind
2232 .misc@pop-nr pad li*pad
2233 .misc@pop-nr type li*type
2234 .misc@pop-nr li-spc li*li-spc
2235 .ds li*mark \\*[li*mark-list!\\n[li*lvl]]
2238 .if \\n[li*lvl]<1 .@error "LE:mismatched"
2240 .if '\\$1'1' .SP \\n[Lsp]u
2243 .\" list status clear.
2244 .\" terminate all lists to level i
2246 .ie \\n[.$]<1 .nr li*i 0
2248 .if \\n[li*i]>\\n[li*lvl] .@error "LC: incorrect argument: \\n[li*i] (too big)"
2249 .while \\n[li*lvl]>\\n[li*i] .li@pop
2254 .if \\n[.$]>3 .@error "AL: too many arguments"
2255 .if \\n[D]>2 .tm AL $*
2256 .ie \\n[.$]<=1 .LB \\n[Li] 0 2 1 "\\$1"
2258 . ie \\n[.$]=2 .LB 0\\$2 0 2 1 "\\$1"
2260 . ie !'\\$2'' .LB \\$2 0 2 1 "\\$1" 0 1
2261 . el .LB \\n[Li] 0 2 1 "\\$1" 0 1
2266 .if \\n[.$]>3 .@error "ML: too many arguments"
2267 .if \\n[D]>2 .tm ML $*
2268 .nr li*ml-width \w@\\$1@u+1n
2269 .if \\n[.$]<2 .LB \\n[li*ml-width]u 0 1 0 "\\$1"
2270 .if \\n[.$]=2 .LB 0\\$2 0 1 0 "\\$1"
2272 . ie '\\$2'' .LB \\n[li*ml-width]u 0 1 0 "\\$1" 0 1
2273 . el .LB \\n[Li] 0 1 0 "\\$1" 0 1
2277 .if \\n[D]>2 .tm VL $*
2278 .if \\n[.$]>3 .@error "VL: too many arguments"
2279 .if \\n[.$]<1 .@error "VL: missing text-indent"
2280 .ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 0
2281 .el .LB 0\\$1 0\\$2 0 0 \& 0 1
2284 .if \\n[D]>2 .tm BL $*
2285 .if \\n[.$]>2 .@error "BL: too many arguments"
2286 .if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \\*[BU]
2287 .if \\n[.$]=1 .LB 0\\$1 0 1 0 \\*[BU]
2289 . ie '\\$1'' .LB \\n[Pi] 0 1 0 \\*[BU] 0 1
2290 . el .LB 0\\$1 0 1 0 \\*[BU] 0 1
2294 .if \\n[D]>2 .tm DL $*
2295 .if \\n[.$]>2 .@error "DL: too many arguments"
2296 .if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \(em
2297 .if \\n[.$]=1 .LB 0\\$1 0 1 0 \(em
2299 . ie '\\$1'' .LB \\n[Pi] 0 1 0 \(em 0 1
2300 . el .LB 0\\$1 0 1 0 \(em 0 1
2304 .if \\n[D]>2 .tm RL $*
2305 .if \\n[.$]>2 .@error "RL: too many arguments"
2306 .if \\n[.$]<1 .LB 6 0 2 4
2307 .if \\n[.$]=1 .LB 0\\$1 0 2 4
2309 . ie '\\$1'' .LB 6 0 2 4 1 0 1
2310 . el .LB 0\\$1 0 2 4 1 0 1
2313 .\" Broken Variable List. As .VL but text begin on the next line
2315 .if \\n[D]>2 .tm BVL $*
2316 .if \\n[.$]>3 .@error "BVL: too many arguments"
2317 .if \\n[.$]<1 .@error "BVL: missing text-indent"
2318 .ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 -1
2319 .el .LB 0\\$1 0\\$2 0 -1 \& 0 1
2321 .\" ####### module tbl #######################################
2322 .\" This module is copied from groff_ms and modified for mgm.
2323 .\" Yes, it does not resemble the original anymore :-).
2324 .\" Don't know if I missed something important.
2325 .\" Groff_ms is written by James Clark.
2326 .nr tbl*have-header 0
2327 .nr tbl*header-written 0
2331 .if '\\$1'H' .di tbl*header-div
2334 .if \\n[tbl*have-header] \{\
2335 . ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl@print-header
2340 .if \\n[tbl*have-header] \{\
2342 .\" draw bottom and side lines of boxed tables.
2345 .nr tbl*header-written 0
2347 .de tbl@print-header
2353 .nr tbl*header-written 1
2356 .ie '\\n[.z]'tbl*header-div' \{\
2361 . nr tbl*header-ht \\n[dn]
2363 . nr tbl*have-header 1
2364 . ie '\\$1'N' .if !\\n[tbl*header-written] .tbl@print-header
2365 . el .tbl@print-header
2367 .el .@error ".TH without .TS H"
2370 .ie '\\n(.z'tbl*header-div' .@error ".TS H but no .TH before .TE"
2372 . nr tbl*have-header 0
2379 .\" ####### module pic #######################################
2384 .ie \\n[.$]<2 .@error "PS: bad arguments. Probably not processed with pic."
2386 . if !\\n[ds*lvl] .ne (u;\\$1)+1v
2387 .\" should be contained between .DS/.DE
2389 . if \\n[ds*lvl]&((\\n[ds*format]=2):(\\n[ds*format]=3)) \{\
2391 .\" . in +(u;\\n[.l]-\\n[.i]-\\$2/2)
2400 .\" ####### module eq #######################################
2408 .if !'\\*[eq*label]'' \{\
2410 . \" space down to middle of equation
2411 ' sp (u;(\\$1-1v)/2)
2412 . ie (\\n[Eq]%2) \{\
2413 . \" label to the left
2417 . \" label to the right
2418 \h'|\\n[.l]u-\w'\\*[eq*label]'u'\\*[eq*label]
2426 .\"########### module toc ###################
2427 .\" table of contents
2429 .nr toc*spacing \n[Lsp]u
2433 .\" Table of contents with friends (module lix)
2436 .\" print any pending displays and references
2438 .if \\n[ref*flag] .RP 0 1
2440 .if \w@\\$1@>0 .nr toc*slevel \\$1
2441 .if \w@\\$2@>0 .nr toc*spacing (u;\\$2*\\n[Lsp])
2442 .if \w@\\$3@>0 .nr toc*tlevel \\$3
2443 .if \w@\\$4@>0 .nr toc*tab \\$4
2444 .if \\n[pg*cols-per-page]>1 .1C
2445 .ds H1txt \\*[Licon]
2452 .if d Ci .toc@read-Ci \\*[Ci]
2455 .ie \\n[Oc] .hd@set-page 1
2460 . PF "''\\\\\\\\n[toc*pn]''"
2466 .while \\n+[toc*i]<10 \{\
2467 . if !'\\$\\n[toc*i]'' \{\
2473 .if \\n[.$]<=4 .if d TX .TX
2474 .ie d TY .if \\n[.$]<=4 .TY
2481 .if d toc*list .toc*list
2483 .\" print LIST OF XXX
2484 .if d lix*dsfg .lix@print-ds fg FG "\\*[Lf]" \\n[.$]
2485 .if d lix*dstb .lix@print-ds tb TB "\\*[Lt]" \\n[.$]
2486 .if d lix*dsec .lix@print-ds ec EC "\\*[Le]" \\n[.$]
2487 .if d lix*dsex .lix@print-ds ex EX "\\*[Lx]" \\n[.$]
2490 .\" .toc@read-Ci lev1 lev2 lev3 lev4 ... lev7
2493 .while \\n+[toc*i]<15 \{\
2494 . nr toc*hl!\\n[toc*i] \\$[\\n[toc*i]]
2500 . toc@save \\$1 "\\*[hd*mark]" "\\$2" \\*[hd*sect-pg]
2502 .el .toc@save \\$1 "\\*[hd*mark]" "\\$2" \\n[P]
2507 .\" collect maxsize of mark if string Ci don't exist.
2509 . if !r toc*hl!\\$1 .nr toc*hl!\\$1 0
2510 . if \\n[toc*hl!\\$1]<=\w@\\$2@ \{\
2511 . nr toc*hl!\\$1 \w@\\$2@u
2515 .\" .toc@set level headernumber text pagenumber
2516 .toc@set \\$1 "\\$2" "\\$3" \\$4
2520 .\" level mark text pagenumber
2522 .if \\$1<=\\n[toc*slevel] .SP \\n[toc*spacing]u
2528 . nr toc*ind +\\n[toc*hl!\\$1]u
2531 . while \\n+[toc*i]<\\$1 \{\
2532 . nr toc*ind +\\n[toc*hl!\\n[toc*i]]u
2535 .nr toc*text \\n[toc*ind]u+\\n[toc*hl!\\$1]u
2537 .ti -\\n[toc*hl!\\$1]u
2539 .\" length of headernumber space
2540 .nr toc*i \\n[toc*hl!\\$1]-\w@\\$2@
2542 .ll \\n[@ll]u-\w@\\$4@u-2m
2544 .\" ragged right ---------------------------------
2545 .ie \\$1>\\n[toc*tlevel] \{\
2552 . \" unnumbered heading --------------------
2557 . \" normal heading ------------------------
2565 . nr toc*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$4@)-1m
2566 \h'|\\n[.n]u'\l'\\n[toc*sep]u.'\h'1m'\\$4
2570 .\"########################### module lix ############################
2571 .\" LIST OF figures, tables, exhibits and equations
2582 .lix@print-line fg Lf \\n+[lix*fg-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2585 .lix@print-line tb Lt \\n+[lix*tb-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2588 .lix@print-line ec Le \\n+[lix*ec-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2591 .lix@print-line ex Lx \\n+[lix*ex-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2594 .\" print line with 'figure' in the text
2595 .\" type stringvar number text override flag refname
2599 .ie \\n[Sectf] .ds lix*numb \\n[H1]-\\$3
2600 .el .ds lix*numb \\$3
2602 .ie !\\n[Of] .ds lix*ds-form .\ \ \"
2603 .el .ds lix*ds-form "\ \(em\ \"
2605 .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\*[lix*ds-form]
2607 . if !0\\$6 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*numb]\\*[lix*ds-form]
2608 . if 0\\$6=1 .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\$5\\*[lix*ds-form]
2609 . if 0\\$6=2 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*ds-form]
2611 .\" print line if not between DS/DE
2612 .ie (\\n[ds*lvl]<1)&(\\n[df*float]=0) \{\
2613 . lix@print-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
2616 . lix@embedded-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
2621 .\" label text type stringvar refname
2623 .ie \\n[Sectp] .ds lix*pgnr \\*[hd*sect-pg]
2624 .el .ds lix*pgnr \\n[%]
2629 .ie (\w@\\$1\\$2@)>(\\n[.l]-\\n[.i]) \{\
2637 .\" save line for LIST OF XXX, wth is the width of the label
2638 .if !r lix*wth\\$3 .nr lix*wth\\$3 0
2639 .\" find the maximum width
2640 .if \w@\\*[lix*label]@>\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
2641 .if \\n[\\$4] .lix@ds-save \\$3 \\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
2642 .\" save reference to the figure
2643 .if !'\\$5'' .SETR \\$5 \\*[lix*numb]
2645 .\" hide printout until diversion is evaluated
2646 .de lix@embedded-text
2647 \!.ie \\\\n[Sectp] .ds lix*pgnr \\\\*[hd*sect-pg]
2648 \!.el .ds lix*pgnr \\\\n[%]
2654 \!.ie (\w@\\$1\\$2@)>(\\\\n[.l]-\\\\n[.i]) \{\
2665 .\" save line for LIST OF XXX, wth is the width of the label
2666 \!.if !r lix*wth\\$3 .nr lix*wth\\$3 0
2667 .\" find the maximum width
2668 \!.if \w@\\*[lix*label]@>\\\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
2669 \!.if \\\\n[\\$4] .lix@ds-save \\$3 \\\\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
2670 .\" save reference to the figure
2671 \!.if !'\\$5'' .SETR \\$5 \\*[lix*numb]
2674 .\" print complete list of XXXX
2676 .\" arg: fg,tb,ec,ex text
2679 .if !\\n[Cp] .pg@next-page
2680 .\" print LIST OF XXXX
2681 .\" execute user-defined macros
2682 .if \\$4<=4 .if d TX\\$2 .TX\\$2
2683 .ie d TY\\$2 .if \\$4<=4 .TY\\$2
2689 .in \\n[lix*wth\\$1]u
2694 .\" save line of list in macro
2696 .\" type pagenumber text
2698 .lix@dsln \\$1 \\$2 "\\$3" "\\$4" \\$5
2702 .\" print appended macro
2703 .\" lix@dsln type pagenumber text headernumber
2705 .nr lix*i \\n[lix*wth\\$1]-\w@\\$4@
2707 .ll \\n[@ll]u-\w@\\$4@u-\w@\\$2@u-2m
2708 .ti -\\n[lix*wth\\$1]u
2714 .nr lix*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$2@)-1m
2715 \h'|\\n[.n]u'\l'\\n[lix*sep]u.'\h'1m'\\$2
2716 .SP \\n[toc*spacing]u
2718 .\"########################### module fnt ############################
2719 .\" some font macros.
2728 .nr fnt*prev \\n[.f]
2730 .while \\n+[fnt*i]<=\\n[.$] \{\
2731 . if \\n[fnt*i]>3 .as fnt*tmp \,
2732 . ie (\\n[fnt*i]%2)=1 .as fnt*tmp \\$1\\$[\\n[fnt*i]]
2733 . el .as fnt*tmp \\$2\\$[\\n[fnt*i]]
2734 . if \\n[fnt*i]<\\n[.$] .as fnt*tmp \/
2736 \&\\*[fnt*tmp]\f[\\n[fnt*prev]]
2740 .ie \\n[.$] .fnt@switch \f3 \f[\\n[.f]] \\$@
2744 .ie \\n[.$] .fnt@switch \f2 \f[\\n[.f]] \\$@
2748 .if \\n[.$] .fnt@switch \f2 \f3 \\$@
2751 .if \\n[.$] .fnt@switch \f3 \f2 \\$@
2754 .if \\n[.$] .fnt@switch \f2 \f1 \\$@
2757 .if \\n[.$] .fnt@switch \f1 \f2 \\$@
2760 .if \\n[.$] .fnt@switch \f1 \f3 \\$@
2763 .if \\n[.$] .fnt@switch \f3 \f1 \\$@
2765 .\"########################### module box ############################
2766 .\" draw a box around some text. Text will be kept on the same page.
2769 .\" .B1 and .B2 works like .DS
2771 .if \\n[box*ll] .@error "B1: missing B2"
2774 .nr box*hyp \\n[.hy]
2775 .nr box*wid \\n[.l]-\\n[.i]
2777 .\" jump to new environment.
2783 .ll (u;\\n[box*wid]-1n)
2787 .if !\\n[box*ll] .@error "B2: missing B1"
2790 .nr box*height \\n[dn]
2794 .nr box*y-pos \\n[.d]u
2799 \D'l \\n[box*wid]u 0'\
2800 \D'l 0 -\\n[box*height]u'\
2801 \D'l -\\n[box*wid]u 0'\
2802 \D'l 0 \\n[box*height]u'
2812 .\"########################### module ref ############################
2817 .nr ref*flag 0 \" for end-of-text
2818 .ds Rf \v'-.4m'\s-3[\\n+[ref*nr]]\s0\v'.4m'
2823 .if !''\\$1' .ds \\$1 \v'-.4m'\s-3[\\n[ref*nr]]\s0\v'.4m'
2826 .ref@start-print \\n[ref*nr].
2841 .in \\n[ref*nr-width]u
2855 .if \\n[Ls] .SP \\n[Lsp]u
2859 .if !d ref*mac .@error "RP: No references!"
2860 .ie !''\\$2' .nr ref*i 0\\$2
2861 .el .nr ref*i \\n[Rpe]
2862 .if \\n[ref*i]<2 .SK
2865 .if 0\\$1<1 .nr ref*nr 0 1
2866 .if ((\\n[ref*i]=0):(\\n[ref*i]=2)) .SK
2869 .\" called by end-of-text!
2871 .\".if \\n[ref*flag] \{\
2873 . if \\n[D]>2 .tm Print references, called by eot
2885 .\" prints the references
2887 .toc@save 1 "" "\\*[Rp]" \\n[%]
2892 .misc@ev-keep ref*ev
2901 .\"########################### module app ############################
2909 .\" name == "" -> autonumber
2911 .\" .if \\n[.$]<2 .@error "APP: too few arguments"
2917 .ie \\n[Aph] .app@header \\*[app*ind] "\\$2"
2919 .app@index "\\*[app*ind]" "\\$2"
2922 .\" .APPSK name pages text
2923 .\" name == "" -> autonumber
2925 .if \\n[.$]<2 .@error "APPSK: too few arguments"
2931 .ie \\n[Aph] .app@header \\*[app*ind] "\\$3"
2933 .app@index "\\*[app*ind]" "\\$3"
2938 .ie \w@\\$1@ .ds app*ind \\$1
2940 . if !\\n[app*flag] \{\
2946 . ds app*ind \\n+[app*nr]
2947 . nr H1 \\n+[app*dnr]
2948 . nr H1h \\n[app*dnr]
2950 .\" clear lower counters
2952 .while \\n+[app*i]<15 .nr H\\n[app*i] 0 1
2956 .toc@save 1 "" "\\*[App] \\$1: \\$2" \\n[%]
2959 .\" app@header name text
2964 \s+4\f3\\*[App]\ \\$1\fP\s0
2966 .if \w@\\$2@<\\n[.l] .ce 1
2970 .als APPX app@header
2971 .\"########################### module cov ############################
2972 .\" title stored in diversion cov*title
2973 .\" abstract stored in diversion cov*abstract
2974 .\" arg to abstract stored in cov*abs-arg
2975 .\" indent stored in cov*abs-ind
2976 .\" number of authors stored in cov*au
2977 .\" author(s) stored in cov*au!x!y
2978 .\" author(s) title stored in cov*at!x!y
2979 .\" x is the author-index [1-cov*au], y is the argument-index [1-9].
2980 .\" author(s) firm stored in cov*firm
2981 .\" new date (if .ND exists) is stored in cov*new-date
2984 .ds cov*abs-name ABSTRACT
2988 .rm IA IE WA WE LO LT
2989 .if \\n[.$]>0 .ds cov*title-charge-case \\$1
2990 .if \\n[.$]>1 .ds cov*title-file-case \\$2
2991 .pg@disable-top-trap
2995 .\"-------------------
2999 .\"-------------------
3000 .\" .AU name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]
3003 .pg@disable-top-trap
3006 .ds cov*au!\\n[cov*au]!1
3007 .while \\n[.$]>=\\n+[cov*i] \{\
3008 . ds cov*au!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
3010 .if (\\n[.$]>=3)&(\w@\\$3@) \{\
3011 . if d cov*location-\\$3] \{\
3012 . ds cov*au!3!\\n[cov*au] \\*[cov*location-\\$3]
3016 .\"-------------------
3017 .\" .AT title1 [title2 [... [title9] ]]]]
3018 .\" Well, thats all that COVEND look for.
3019 .\" Must appear directly after .AU
3021 .if \\n[.$]<1 .@error "AT: no arguments"
3023 .while \\n[.$]>=\\n+[cov*i] \{\
3024 . ds cov*at!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
3027 .\"-------------------
3030 .if !''\\$1' .ds cov*firm \\$1
3033 .ds cov*abs-name \\$1
3036 .pg@disable-top-trap
3037 .if d cov*abstract .@error "AS: only one abstract allowed"
3038 .if !''\\n[.z]' .@error "AS: no diversion allowed (previous .AS?)"
3039 .nr cov*abs-arg 0\\$1
3040 .nr cov*abs-ind (n;0\\$2)
3045 .\" fixed for 2000, now uses \n[year].
3047 . \" support for ISO-date
3053 . ds cov*new-date \\*[MO\\n[mo]] \\n[dy], \\n[year]
3056 . ds cov*new-date \\n[year]-\\n[cov*mm]-\\n[cov*dd]
3060 .als DT cov*new-date
3062 .ds cov*new-date \\$1
3064 .\" switch to ISO-date if register Iso exist: YYYY-MM-DD
3065 .if r Iso .ISODATE 1
3066 .\"-------------------
3067 .\" save technical numbers.
3070 .while \\n[.$]>=\\n+[cov*i] .ds cov*mt-tm!\\n[cov*i] \\$[\\n[cov*i]]
3071 .nr cov*mt-tm-max \\n[.$]
3073 .\"-----------------------
3075 .\" the file must have the following last lines (somewhere):
3076 .\" .pg@enable-top-trap
3079 .ds cov*mt-file!0 0.MT
3080 .ds cov*mt-file!1 0.MT
3081 .ds cov*mt-file!2 0.MT
3082 .ds cov*mt-file!3 0.MT
3083 .ds cov*mt-file!4 4.MT
3084 .ds cov*mt-file!5 5.MT
3085 .ds cov*mt-file!6 0.MT
3089 . ie d cov*mt-file!\\$1 .ds cov*mt-type \\$1
3090 . el .ds cov*mt-type 6
3092 .el .ds cov*mt-type 1
3093 .ds cov*mt-addresse "\\$2
3094 .ds cov*mt-type-text "\\$1
3095 .ie d @country .ds cov*str mm/\\*[@country]_
3097 .mso \\*[cov*str]\\*[cov*mt-file!\\*[cov*mt-type]]
3100 .ie !\\n[.$] .ds cov*cov-type ms
3101 .el .ds cov*cov-type \\$1
3102 .pg@disable-top-trap
3103 .ie d @country .ds cov*str mm/\\*[@country]_\\*[cov*cov-type].cov
3104 .el .ds cov*str mm/\\*[cov*cov-type].cov
3107 .\"########################### module qrf ############################
3108 .\" forward and backward reference thru special files.
3110 .\" check if stderr-method is wanted
3111 .\" This was needed when I discovered that groff was considered unsafe
3112 .\" and groff -U didn't work. It's a workaround like the original
3113 .\" index method, but not in my view elegant enough.
3115 .\" init reference system
3117 .ds qrf*file \\$1.qrf
3119 .if \\n[D]>1 .tm INITR: source \\*[qrf*file]
3121 . tm .\\\\" Rfilename: \\*[qrf*file]
3123 .el 'so \\*[qrf*file]
3126 .\" set a reference.
3128 .if \\n[.$]<1 .@error "SETR:reference name missing"
3129 .if !r qrf*pass .tm "SETR: No .INITR in this file"
3131 . ds qrf*name qrf*ref-\\$1
3132 . if \\n[D]>2 .tm SETR: ref \\*[qrf*name]=\\*[hd-mark-trimmed],\\n[%]
3134 . ds \\*[qrf*name]-hn \\*[hd-mark-trimmed]
3136 . ds \\*[qrf*name]-pn \\n[%]
3139 . tm .ds \\*[qrf*name]-hn \\*[hd-mark-trimmed]
3140 . tm .ds \\*[qrf*name]-pn \\n[%]
3141 . if !'\\$2'' .tm .ds \\*[qrf*name]-xx \\$2
3147 .\" If two arg -> set var. arg to misc-string.
3149 .if \\n[.$]<1 .@error "GETST:reference name missing"
3150 .if !r qrf*pass .tm "GETST: No .INITR in this file"
3151 .ds qrf*name qrf*ref-\\$1
3152 . if d \\*[qrf*name]-xx \{\
3153 . ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-xx]
3154 . el \\*[\\*[qrf*name]-xx]\c
3159 .\" get header-number
3160 .\" If two arg -> set var. arg to header-number.
3162 .if \\n[.$]<1 .@error "GETHN:reference name missing"
3163 .if !r qrf*pass .tm "GETHN: No .INITR in this file"
3164 .ds qrf*name qrf*ref-\\$1
3165 .if d \\*[qrf*name]-hn \{\
3166 . ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-hn]
3167 . el \\*[\\*[qrf*name]-hn]\c
3172 .\" If two arg -> set var. arg to page-number.
3174 .if \\n[.$]<1 .@error "GETPN:reference name missing"
3175 .if !r qrf*pass .tm "GETPN: No .INITR in this file"
3176 .ds qrf*name qrf*ref-\\$1
3177 .if d \\*[qrf*name]-pn \{\
3178 . ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-pn]
3179 . el \\*[\\*[qrf*name]-pn]\c
3184 .if \\n[.$]<1 .@error "GETR:reference name missing"
3186 . tm "GETR: No .INITR in this file"
3194 .\"########################### module ind ############################
3195 .\" Support for mgs-style indexing, borrowed from mgs.
3197 . tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[%]
3199 .\"--------------------
3200 .\" Another type of index system
3201 .\" INITI type filename [macro]
3203 .if \\n[.$]<1 .@error "INITI:type missing"
3204 .\" ignore if INITI has already been used
3206 . if d ind*file .@error "INITI:file already set"
3207 . ds ind*file \\$2.ind
3208 . if \\n[D]>1 .tm INITI: source \\*[ind*file]
3210 .if !d ind*file .@error "INITI:file not specified"
3213 . if \\n[.$]>2 .tm .\\\\" Imacro: \\$3
3218 .if !d ind*file .@error "IND: No active INITI"
3219 .if \\n[D]>1 .tm IND: type=\\*[ind*type]
3221 .if '\\*[ind*type]'N' .ds ind*ref \\n[%]
3222 .if '\\*[ind*type]'H' .ds ind*ref \\*[hd*mark]
3223 .if '\\*[ind*type]'B' .ds ind*ref \\*[hd*mark]\t\\n[%]
3224 .if '\\*[ind*ref]'' .@error "IND:wrong index type: \\*[ind*ref]"
3227 .while \\n[.$]>0 \{\
3229 . as ind*line \t\\$1
3231 .as ind*line \\*[ind*ref]
3232 .if \\n[Ref] .tm .\\\\" IND \\*[ind*line]
3236 .ie \\n[Ref] .tm .\\\\" Index: \\*[ind*file]
3238 . if !\\n[Cp] .pg@next-page
3240 . \" execute user-defined macros
3260 .\"########################### module let ############################
3262 .\"------------------------
3266 .ie \\n[.$] .ds let*i \\$1
3267 .el .ds let*i \\*[Letfc]
3268 .ie d let*type .let@fc_\\*[let*type] "\\*[let*i]" \\$@
3269 .el .let@mt-closing "\\*[let*i]" \\$@
3279 .\"------------------------
3282 .ie d let*type .let*lt-sign \\$@
3283 .el .let*mt-sign \\$@
3285 .\"------------------------
3287 .if !d let@sg_\\*[let*type] .@error "SG: letter type \\*[let*type] undefined"
3291 .while \\n+[let*i]<=\\n[let*wa-n] \{\
3292 .if \\n[let*i]=\\n[let*wa-n] .nr let*j 1
3293 .let@sg_\\*[let*type] "\\*[let*wa-name!\\n[let*i]]" "\\*[let*wa-title!\\n[let*i]]" \\n[let*i] \\n[let*j] \\$@
3296 .\"------------------------
3297 .\" Memorandum signature
3301 .ie \\n[.$]>1 .nr let*k 1
3302 .el .nr let*k \\n[cov*au]
3303 .ds let*tmp \\*[cov*au!\\n[let*k]!3]-\\*[cov*au!\\n[let*k]!4]-
3305 .while \\n+[let*i]<=\\n[cov*au] \{\
3306 . if \\n[let*i]>1 .as let*tmp /
3307 . as let*tmp \\*[cov*au!\\n[let*k]!2]
3309 .if !''\\$1' .as let*tmp -\\$1
3313 .while \\n+[let*i]<=\\n[cov*au] \{\
3315 . if \\n[let*i]=\\n[let*k] \{\
3316 \Z'\h'-(u;\\n[.l]/2)'\\*[let*tmp]'\c
3318 \\*[cov*au!\\n[let*i]!1]
3323 .\"------------------------
3324 .\" Approval signature
3329 .ie \\n[.$]<2 \\*[Letapp]
3332 .ie n ______________________________ ______________
3333 .el \D'l 25m 0'\h'4m'\D'l 12m 0'
3334 \Z'\\$1'\h'29m'\f[\\*[@sdf_font]]\\*[Letdate]\fP
3337 .\"------------------------
3338 .\" Letter signature
3343 .ie n ______________________________
3348 .\"------------------------
3350 .\" let@header is called from the header. It is supposed
3351 .\" to remove the alias itself.
3353 .rm AF AS AE AT AU CS OK TL MT
3357 .if !''\\$1' .ds let*type \\$1
3358 .if !d let@head_\\*[let*type] .@error "LT: unknown letter type \\$1"
3360 .als let@header let@head_\\*[let*type]
3361 .let@init_\\*[let*type] \\$@
3362 .if \n[D]>1 .tm Letter type \\*[let*type]
3381 .if \w'\\$5'&\\$4 \\$5
3384 .als let@fc_BL let@mt-closing
3386 .\" Semiblocked letter
3394 .als let@sg_SB let@sg_BL
3395 .als let@fc_SB let@mt-closing
3397 .\" Full-blocked letter
3411 .if \w'\\$5'&\\$4 \\$5
3420 .\" Simplified letter
3431 .misc@toupper "\\$1, \\$2"
3433 .if \w'\\$5'&\\$4 \\$5
3439 .\"--------------------------------------
3440 .\" Print the letter-head
3444 .if '1'\\$1' .in (u;\\n[.l]/2)
3446 .ie d let@wa-div .let@wa-div
3451 .if '1'\\$1' .if !d let*lo-CN .if !d let*lo-RN .sp 2
3452 .\" ---- Confidential
3455 . ie !''\\*[let*lo-CN]' \\*[let*lo-CN]
3461 \\*[LetRN] \\*[let*lo-RN]
3468 .while \\n+[let*i]<=\\n[let*ia-n] \{\
3469 \\*[let*ia-name!\\n[let*i]]
3470 \\*[let*ia-title!\\n[let*i]]
3472 .if d let@ia-div .let@ia-div
3476 \\*[LetAT] \\*[let*lo-AT]
3479 .if !'\\*[let*type]'SP' .if d let*lo-SA \{\
3482 . ie !''\\*[let*lo-SA]' \\*[let*lo-SA]
3487 . ie '\\*[let*type]'SP' \{\
3489 . misc@toupper \\*[let*lo-SJ]
3494 . if '\\*[let*type]'SB' .ti +5m
3495 \\*[LetSJ] \f[\\*[@sdf_font]]\\*[let*lo-SJ]\fP
3499 .\"-------------------
3500 .\" .IA [name [title]]
3503 .if \\n[.$] .ds let*ia-name!\\n+[let*ia-n] \\$1
3504 .if \\n[.$]>1 .ds let*ia-title!\\n[let*ia-n] \\$2
3516 .\"-------------------
3517 .\" .WA [name [title]]
3520 .if \\n[.$] .ds let*wa-name!\\n+[let*wa-n] \\$1
3521 .if \\n[.$]>1 .ds let*wa-title!\\n[let*wa-n] \\$2
3526 .it \\n[Letwam] let@wa-drain
3541 .if d let@wa-junk .rm let@wa-junk
3543 .\"-------------------
3547 .ie !''\\$2' .ds let*str \\$1
3550 . ie !\w'\\$1' .ds let*str \\*[Letns!\\*[Letnsdef]]
3552 . ie d Letns!\\$1 .ds let*str \\*[Letns!\\$1]
3553 . el .ds let*str \\*[Letns!copy](\\$1)\\*[Letns!to]
3556 . el .ds let*str \\*[Letns!\\*[Letnsdef]]
3565 .\"-------------------
3568 .rm AF AS AE AT AU CS OK TL MT
3569 .if ''\\$1' .@error "LO: missing option"
3570 .if !d Let\\$1 .@error "LO: unknown option (\\$1)"
3571 .ds let*lo-\\$1 \\$2
3572 .if \n[D]>1 .tm Letter option \\$1 \\$2
3574 .\"--------------------
3575 .\" Start with a clean slate
3578 .\" ====================================================================
3580 .\" ====================================================================
3582 .\" Local Variables:
3586 .\" vim: set filetype=groff textwidth=72: