]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/groff/contrib/mm/m.tmac
This commit was generated by cvs2svn to compensate for changes in r128671,
[FreeBSD/FreeBSD.git] / contrib / groff / contrib / mm / m.tmac
1 .\"  
2 .de @revision
3 .ds RE \\$2
4 ..
5 .\"
6 .\" $Id: m.tmac,v 2.18 2003/04/02 04:44:59 jhaegg Exp $
7 .@revision $Revision: 2.18 $
8 .ig
9
10 Copyright (C) 1991-2000 Free Software Foundation, Inc.
11 mgm is written by Jörgen Hägg <jh@axis.com>
12
13 mgm is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free
15 Software Foundation; either version 2, or (at your option) any later
16 version.
17
18 mgm is distributed in the hope that it will be useful, but WITHOUT ANY
19 WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License along
24 with groff; see the file COPYING.  If not, write to the Free Software
25 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
26
27 Please send bugreports with examples to jh@axis.com.
28
29 Naming convention stolen from mgs.
30 Local names     module*name
31 Extern names    module@name
32 Env.var         environ:name
33 Index           array!index
34 ..
35 .if !\n(.g .ab These mm macros require groff.
36 .do if d PH .nx
37 .if \n(.C .ab The groff mm macros do not work in compatibility mode.
38 .if (\n[.warn] == 65543) .warn
39 .\" ######## init #######
40 .\"     Contents level [0:7], contents saved if heading level <= Cl
41 .nr Cl 2
42 .\"     Eject page between LIST OF XXXX if Cp == 0
43 .nr Cp 0
44 .\"     Debugflag
45 .if !r D .nr D 0
46 .\"     Eject after floating display is output [0:1]
47 .nr De 0
48 .\"     Floating keep output [0;5]
49 .nr Df 5
50 .\"     space before and after display if == 1 [0:1]
51 .nr Ds 1
52 .\"     Eject page
53 .nr Ej 0
54 .\"     Equation label adjust 0=left, 1=right
55 .nr Eq 0
56 .\"     Em dash string
57 .ie n .ds EM " --
58 .el .ds EM \(em
59 .\"     Footnote spacing
60 .nr Fs 1
61 .\"     H1-H7   heading counters
62 .nr H1 0 1
63 .nr H2 0 1
64 .nr H3 0 1
65 .nr H4 0 1
66 .nr H5 0 1
67 .nr H6 0 1
68 .nr H7 0 1
69 .\"     Heading break level [0:7]
70 .nr Hb 2
71 .\"     heading centering level, [0:7]
72 .nr Hc 0
73 .\"     header format
74 .ds HF 2 2 2 2 2 2 2
75 .\"     heading temp. indent [0:2]
76 .\"     0 -> 0 indent, left margin
77 .\"     1 -> indent to right , like .P 1
78 .\"     2 -> indent to line up with text part of preceding heading
79 .nr Hi 1
80 .\"     header pointsize
81 .ds HP 0 0 0 0 0 0 0
82 .\"     heading space level [0:7]
83 .nr Hs 2
84 .\"     heading numbering type
85 .\"     0 -> multiple (1.1.1 ...)
86 .\"     1 -> single
87 .nr Ht 0
88 .\"     Unnumbered heading level
89 .nr Hu 2
90 .\"     hyphenation in body
91 .\"     0 -> no hyphenation
92 .\"     1 -> hyphenation 14 on
93 .nr Hy 0
94 .\"     text for toc, selfexplanatory. Look in the new variable section
95 .ds Lf LIST OF FIGURES
96 .nr Lf 1
97 .ds Lt LIST OF TABLES
98 .nr Lt 1
99 .ds Lx LIST OF EXHIBITS
100 .nr Lx 1
101 .ds Le LIST OF EQUATIONS
102 .nr Le 0
103 .\"     List indent, used by .AL
104 .nr Li 6
105 .\"     List space, if listlevel > Ls then no spacing will occur around lists.
106 .nr Ls 99
107 .\"     Numbering style [0:5]
108 .if !r N .nr N 0
109 .\"     numbered paragraphs
110 .\"     0 == not numbered
111 .\"     1 == numbered in first level headings.
112 .nr Np 0
113 .\"     Format of figure,table,exhibit,equation titles.
114 .\"     0= ". ", 1=" - "
115 .nr Of 0
116 .\"     Table of contents page numbering style
117 .nr Oc 0
118 .\"     Page-number, normally same as %.
119 .nr P 0
120 .\"     paragraph indent
121 .nr Pi 5
122 .\"     paragraph spacing
123 .nr Ps 1
124 .\"     paragraph type
125 .\"     0 == left-justified
126 .\"     1 == indented .P
127 .\"     2 == indented .P except after .H, .DE or .LE.
128 .nr Pt 0
129 .\"     Reference title
130 .ds Rp REFERENCES
131 .\"     Display indent
132 .nr Si 5
133 .\"
134 .\" Current state of TOC, empty outside TC, inside
135 .\" it will be set to co,fg,tb,ec,ex or ap.
136 .ds Tcst
137 .\"
138 .ds Tm \(tm
139 .\"
140 .\"---------------------------------------------
141 .\"     Internal global variables
142 .\"
143 .\" This is for cover macro .MT
144 .\" .ds @language
145 .\"
146 .nr @copy_type 0
147 .if r C .nr @copy_type \n[C]
148 .\" >0 if Subject/Date/From should be bold, roman otherwise
149 .ie n .ds @sdf_font R
150 .el .ds @sdf_font B
151 .if \n[@copy_type]=4 \{\
152 .       ls 2
153 .       nr Pi 10
154 .       nr Pt 1
155 .\}
156 .\"
157 .\"
158 .if r E \{\
159 .       ie \n[E] .ds @sdf_font B
160 .       el .ds @sdf_font R
161 .\}
162 .\"
163 .\"     Current pointsize and vertical space, always in points.
164 .if !r S .nr S 10
165 .ps \n[S]
166 .vs \n[S]+2
167 .\"
168 .nr @ps \n[.ps]
169 .nr @vs \n[.v]
170 .if \n[D]>1 .tm @ps=\n[@ps], @vs=\n[@vs]
171 .if \n[D]>3 .tm INIT: l:\n[.l] p:\n[.p] o:\n[.o]
172 .\"
173 .\"     Page length
174 .if r L \{\
175 .       ie n .pl \n[L]u
176 .       el .pl \n[L]u
177 .\}
178 .nr @pl \n[.p]
179 .\"
180 .\"     page width
181 .ie r W \{\
182 .       ie n .ll \n[W]u
183 .       el .ll \n[W]u
184 .\}
185 .el .ll 6i
186 .nr @ll \n[.l]
187 .nr @cur-ll \n[@ll]
188 .lt \n[@ll]u
189 .\"
190 .\"     page offset
191 .ie r O .po \n[O]u
192 .el \{\
193 .       ie n .po .75i
194 .       el .po .963i
195 .\}
196 .\"
197 .nr @po \n[.o]
198 .\"
199 .\" non-zero if escape mechanism is turned off. Used by VERBON/OFF
200 .nr @verbose-flag 0
201 .\"---------------------------------------------
202 .\"     New variables
203 .\"
204 .\" Appendix name
205 .ds App APPENDIX
206 .\" print appendixheader, 0 == don't
207 .nr Aph 1
208 .\"
209 .\" Current appendix text
210 .ds Apptext
211 .\" Controls the space before and after static displays if defined.
212 .\" Lsp is used otherwise
213 .\" .nr Dsp 1v
214 .\"
215 .\" Add a dot after level one heading number if >0
216 .nr H1dot 1
217 .\"
218 .\" header prespace level. If level <= Hps, then two lines will be printed
219 .\" before the header instead of one.
220 .nr Hps 1
221 .\"
222 .\" These variables controls the number of lines preceding .H.
223 .\" Hps1 is the number of lines when level > Hps
224 .nr Hps1 0.5v
225 .if n .nr Hps1 1v
226 .\"
227 .\" Hps2 is the number of lines when level <= Hps
228 .nr Hps2 1v
229 .if n .nr Hps2 2v
230 .\"
231 .\" Hss is the number of lines (Lsp) after the header.
232 .nr Hss 1
233 .\"
234 .\" H1txt will be updated by .H and .HU, containing the heading text.
235 .\" Will also be updated in table of contents & friends
236 .\"
237 .ds H1txt
238 .\"
239 .\" header text for the index
240 .ds Index INDEX
241 .\" command to sort the index
242 .ds Indcmd sort
243 .\"
244 .\" flag for mkindex
245 .if !r Idxf .nr Idxf 0
246 .\"     Change these in the national configuration file
247 .ds Lifg Figure
248 .ds Litb TABLE
249 .ds Liex Exhibit
250 .ds Liec Equation
251 .ds Licon CONTENTS
252 .\" Flag for space between mark and prefix 1==space, 0==no space
253 .\" Can also be controlled by using '.LI mark 2'
254 .nr Limsp 1
255 .\"
256 .\" Lsp controls the height of an empty line. Normally 0.5v
257 .\" Normally used for nroff compatibility.
258 .nr Lsp 0.5v
259 .if n .nr Lsp 1v
260 .ds MO1 January
261 .ds MO2 February
262 .ds MO3 March
263 .ds MO4 April
264 .ds MO5 May
265 .ds MO6 June
266 .ds MO7 July
267 .ds MO8 August
268 .ds MO9 September
269 .ds MO10 October
270 .ds MO11 November
271 .ds MO12 December
272 .\" for GETR
273 .ds Qrf See chapter \\*[Qrfh], page \\*[Qrfp].
274 .\"
275 .\" header- and footer-size will only change to the current
276 .\" if Pgps is > 0.
277 .nr Pgps 1
278 .\"
279 .\" section-page if Sectp > 0
280 .nr Sectp 0
281 .if (\n[N]=3):(\n[N]=5) \{\
282 .       nr Sectp 1
283 .       nr Ej 1
284 .\}
285 .\" section-figure if Sectf > 0
286 .nr Sectf 0
287 .if \n[N]=5 .nr Sectf 1
288 .\"
289 .\" argument to .nm in .VERBON.
290 .ds Verbnm "1
291 .\" indent for VERBON
292 .nr Verbin 5n
293 .\"
294 .\" Letter section
295 .\" Formal closing (.FC)
296 .ds Letfc Yours very truly,
297 .\"
298 .\" Approval line
299 .ds Letapp APPROVED:
300 .\" Approval date-string
301 .ds Letdate Date
302 .\"
303 .ds LetCN CONFIDENTIAL\"                Confidential default
304 .ds LetSA To Whom It May Concern:\"     Salutation default
305 .ds LetAT ATTENTION:\"                  Attention string
306 .ds LetSJ SUBJECT:\"                    Subject string
307 .ds LetRN In reference to:\"            Reference string
308 .\"
309 .\" Copy to (.NS)
310 .ds Letnsdef 0
311 .ds Letns!copy Copy \" space!
312 .ds Letns!to " to
313 .ds Letns!0 Copy to
314 .ds Letns!1 Copy (with att.) to
315 .ds Letns!2 Copy (without att.) to
316 .ds Letns!3 Att.
317 .ds Letns!4 Atts.
318 .ds Letns!5 Enc.
319 .ds Letns!6 Encs.
320 .ds Letns!7 Under separate cover
321 .ds Letns!8 Letter to
322 .ds Letns!9 Memorandum to
323 .ds Letns!10 Copy (with atts.) to
324 .ds Letns!11 Copy (without atts.) to
325 .ds Letns!12 Abstract Only to
326 .ds Letns!13 Complete Memorandum to
327 .ds Letns!14 CC:
328 .\"
329 .\" Text printed below the footer. Controlled by @copy_type (C).
330 .ds Pg_type!0
331 .ds Pg_type!1 OFFICIAL FILE COPY 
332 .ds Pg_type!2 DATE FILE COPY
333 .ds Pg_type!3 D\ R\ A\ F\ T
334 .ds Pg_type!4 D\ R\ A\ F\ T
335 .\" Max lines in return address
336 .nr Letwam 14
337 .\"--------------------------
338 .\"     test for mgm macro. This can be used if the text must test
339 .\"     what macros is used.
340 .nr .mgm 1
341 .\"
342 .\" Due to security problems with groff I had to rewrite
343 .\" the reference system. It's not as elegant as before, you
344 .\" have to run groff with '-z -rRef=1' and put stderr into the filename
345 .\" for .INITR
346 .\"
347 .\" Output references to stderr if non-zero
348 .ie !r Ref \{\
349 .       nr Ref 0
350 .\}
351 .el .warn 0
352 .\"
353 .\"---------------------------------------------
354 .\" set local variables.
355 .ie d @language .mso mm/\*[@language]_locale
356 .el .mso mm/locale
357 .\"---------------------------------------------
358 .if \n[D] .tm Groff mm, version \*[RE].
359 .\" ####### module init ######
360 .\"     reset all things
361 .de init@reset
362 .ie \\n[misc@adjust] 'ad
363 .el 'na
364 .ie \\n[Hy] 'hy 14
365 .el 'nh
366 'in 0
367 'ti 0
368 .ps \\n[@ps]u
369 .vs \\n[@vs]u
370 ..
371 .de @warning
372 'tm WARNING:(\\n[.F]) input line \\n[.c]:\\$*
373 .if \\n[D] .backtrace
374 ..
375 .de @error
376 'tm ******************
377 'tm ERROR:(\\n[.F]) input line \\n[.c]:\\$*
378 .if \\n[D] .backtrace
379 'tm ******************
380 .ab "Input aborted, syntax error"
381 ..
382 .de misc@toupper
383 .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
384 .br
385 \\$1
386 .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
387 .br
388 ..
389 .\" ####### module debug #################################
390 .de debug
391 'tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s],\\n[.ps] \
392 in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
393 ..
394 .de debug-all
395 .nr debug*n 1n
396 .nr debug*m 1m
397 'tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s] in=\\n[.i]\
398  ad=\\n[.j] fi=\\n[.u] pl=\\n[.p] page=\\n[%] .o=\\n[.o]
399 'tm _______ .d=\\n[.d] .f=\\n[.f] .h=\\n[.h] .k=\\n[.k] .n=\\n[.n]\
400  .p=\\n[.p] .t=\\n[.t] .z=\\n[.z] nl=\\n[nl] dn=\\n[dn] n=\\n[debug*n]
401 ..
402 .\" ####### module par #################################
403 .nr par@ind-flag 1      \" indent on following P if Pt=2
404 .nr hd*last-pos -1
405 .nr hd*last-hsize -1
406 .nr par*number 0 1
407 .af par*number 01
408 .nr par*number2 0 1
409 .af par*number2 01
410 .nr par*num-count 0 1
411 .af par*num-count 01
412 .\"     reset numbered paragraphs, arg1 = headerlevel
413 .de par@reset-num
414 .if \\$1<3 .nr par*num-count 0
415 .if (\\$1=1)&(\\n[Np]=1) .nr par*number 0
416 ..
417 .\"------------
418 .\" paragraph
419 .de P
420 .\"     skip P if previous heading
421 .if \\n[D]>2 \{\
422 .       tm Paragraph nl=\\n[nl], last=\\n[hd*last-pos]
423 .       tm Paragraph .k=\\n[.k], hsize=\\n[hd*last-hsize]
424 .\}
425 .if !((\\n[nl]=\\n[hd*last-pos]):(\\n[hd*last-hsize]=\\n[.k])) \{\
426 .       if \\n[D]>2 .tm Paragraph set ind-flag=1
427 .       nr par@ind-flag 1
428 .\}
429 .\" any collected unprinted text?
430 .par@doit \\$*
431 .if \\n[Np] \\n[H1].\\n+[par*number]\ \ \c
432 ..
433 .\"------------
434 .de nP
435 .\"     skip P if previous heading
436 .if \\n[D]>2 \{\
437 .       tm Paragraph nl=\\n[nl], last=\\n[hd*last-pos]
438 .       tm Paragraph .k=\\n[.k], hsize=\\n[hd*last-hsize]
439 .\}
440 .if !((\\n[nl]=\\n[hd*last-pos]):(\\n[hd*last-hsize]=\\n[.k])) \{\
441 .       if \\n[D]>2 .tm Paragraph set ind-flag=1
442 .       nr par@ind-flag 1
443 .\}
444 .par@doit \\$*
445 \\n[H2].\\n+[par*number2]\ \ \c
446 .nr par@ind-flag 1
447 ..
448 .\"------------
449 .de par@doit
450 .SP (u;\\n[Ps]*\\n[Lsp])
451 .ie  \\n[.$] \{\
452 .       if \\$1=1 .ti +\\n[Pi]n
453 .\}
454 .el \{\
455 .       if \\n[Pt]=1 .ti +\\n[Pi]n
456 .       if (\\n[Pt]=2)&\\n[par@ind-flag] .ti +\\n[Pi]n
457 .\}
458 ..
459 .\" ####### module line #######################################
460 .de SP
461 .br
462 .if !r line*lp\\n[.z] .nr line*lp\\n[.z] 0
463 .if !r line*ac\\n[.z] .nr line*ac\\n[.z] 0
464 .ie \\n[.$] .nr line*temp (v;\\$1)
465 .el .nr line*temp 1v
466 .\"
467 .ie \\n[line*lp\\n[.z]]=\\n[.d] \{\
468 .       \" go here if no output since the last .SP
469 .       nr line*output \\n[line*temp]-\\n[line*ac\\n[.z]]
470 .       if \\n[line*output]<0 .nr line*output 0
471 .       nr line*ac\\n[.z] +\\n[line*output]
472 .\}
473 .el \{\
474 .       nr line*ac\\n[.z] \\n[line*temp]
475 .       nr line*output \\n[line*temp]
476 .       \" no extra space in the beginning of a page
477 .       if (\\n[.d]<0):(\\n[pg*head-mark]=\\n[.d]) .nr line*output 0
478 .\}
479 .if \\n[line*output] .sp \\n[line*output]u
480 .nr line*lp\\n[.z] \\n[.d]
481 ..
482 .\" ######## module misc ###############
483 .nr misc@adjust 14
484 .de SA
485 .if \\n[.$] \{\
486 .       if \\$1-1 .@error "SA: bad arg: \\$1"
487 .       nr misc@adjust 0\\$1
488 .\}
489 .ie \\n[misc@adjust] 'ad
490 .el 'na
491 ..
492 .\"-------------
493 .\" switch environment, keep all important settings.
494 .de misc@ev-keep
495 .nr misc*ll \\n[.l]
496 .ev \\$1
497 .ll \\n[misc*ll]u
498 .lt \\n[misc*ll]u
499 ..
500 .\"-------------
501 .\" .misc@push stackname value
502 .de misc@push
503 .ie d misc*st-\\$1 .ds misc*st-\\$1 \\$2 \\*[misc*st-\\$1]
504 .el .ds misc*st-\\$1 \\$2
505 ..
506 .\"-------------
507 .\" .misc@pop stackname
508 .\" value returned in the string misc*pop
509 .de misc@pop
510 .misc@pop-set misc*st-\\$1 \\*[misc*st-\\$1]
511 ..
512 .\"-------------
513 .de misc@pop-set
514 .ds misc*st-name \\$1
515 .shift
516 .if \\n[.$]<1 .@error "stack \\*[misc*st-name] empty"
517 .ds misc*pop \\$1
518 .shift
519 .ds \\*[misc*st-name] \\$*
520 ..
521 .\"-------------
522 .\" .misc@pop-nr stackname varname
523 .de misc@pop-nr
524 .misc@pop \\$1
525 .nr \\$2 \\*[misc*pop]
526 ..
527 .\"-------------
528 .\" .misc@pop-ds stackname varname
529 .de misc@pop-ds
530 .misc@pop \\$1
531 .ds \\$2 \\*[misc*pop]
532 ..
533 .\"-----------
534 .\" reset tabs
535 .de TAB
536 .ta T 5n
537 ..
538 .\"-------------
539 .\" .PGFORM linelength [ pagelength [ pageoffset [1]]]
540 .de PGFORM
541 .\" Break here to avoid problems with new linesetting of the previous line.
542 .\" Hope this doesn't break anything else :-)
543 .\" Don't break if arg_4 is a '1'.
544 .if \\n[D]>2 .tm PGFORM: \\$*
545 .if ''\\$4' .br
546 .if \\n[D]>3 .tm PGFORM: IN l:\\n[.l] p:\\n[.p] o:\\n[.o]
547 .ie !''\\$1' \{\
548 .       ll \\$1
549 .       nr @ll \\n[.l]
550 .       nr @cur-ll \\n[@ll]
551 .       lt \\n[@ll]u
552 .\}
553 .el \{\
554 .       ll \\n[@ll]u
555 .       lt \\n[@ll]u
556 .\}
557 .\"
558 .ie !''\\$2' \{\
559 .       pl \\$2
560 .       nr @pl \\n[.p]
561 .\}
562 .el .pl \\n[@pl]u
563 .\"
564 .ie !''\\$3' \{\
565 .       po \\$3
566 .       nr @po \\n[.o]
567 .\}
568 .el .po \\n[@po]u
569 .if \\n[D]>3 .tm PGFORM: OUT l:\\n[.l] p:\\n[.p] o:\\n[.o]
570 .if \\n[D]>2 .tm PGFORM: ll=\\n[@ll], pl=\\n[@pl], po=\\n[@po]
571 'in 0
572 .pg@move-trap
573 .if \\n[D]>2 \{\
574 .       tm Traps:
575 .       ptr
576 .\}
577 ..
578 .\"-------------
579 .\" .MOVE y [[x] linelength]
580 .\" move to line y, indent to x
581 .de MOVE
582 .if !\\n[.$] .@error "MOVE y [x]: no arguments"
583 .if \\n[nl]<0 \c
584 .\" move to Y-pos
585 .sp |(v;\\$1)
586 .\" calc linelength
587 .ie \\n[.$]>2 .nr pg*i (n;\\$3)
588 .el \{\
589 .       ie \\n[.$]>1 .nr pg*i (n;\\n[@ll]u-\\$2)
590 .       el .nr pg*i \\n[@ll]u
591 .\}
592 .\" move to X-pos, if any
593 .if !''\\$2' .po \\$2
594 .\" set linelength
595 .ll \\n[pg*i]u
596 ..
597 .\"-------------
598 .de SM
599 .if !\\n[.$] .@error "SM: no arguments"
600 .if \\n[.$]=1 \s-1\\$1\s0
601 .if \\n[.$]=2 \s-1\\$1\s0\\$2
602 .if \\n[.$]=3 \\$1\s-1\\$2\s0\\$3
603 ..
604 .\"-------------
605 .nr misc*S-ps \n[@ps]
606 .nr misc*S-vs \n[@vs]
607 .nr misc*S-ps1 \n[@ps]
608 .nr misc*S-vs1 \n[@vs]
609 .ds misc*a
610 .ds misc*b
611 .de S
612 .ie !\\n[.$] \{\
613 .       ds misc*a P
614 .       ds misc*b P
615 .\}
616 .el \{\
617 .       ie \\n[.$]=1 .ds misc*b D
618 .       el \{\
619 .               ie \w@\\$2@=0 .ds misc*b C
620 .               el .ds misc*b \\$2
621 .       \}
622 .       ie \w@\\$1@=0 .ds misc*a C
623 .       el .ds misc*a \\$1
624 .\}
625 .\"
626 .\" set point size
627 .if !'\\*[misc*a]'C' \{\
628 .       ie '\\*[misc*a]'P' .ps \\n[misc*S-ps]u
629 .       el \{\
630 .               ie '\\*[misc*a]'D' .ps \\n[S]
631 .               el .ps \\*[misc*a]
632 .               if \\n[D]>2 .tm S: .ps \\*[misc*a]
633 .       \}
634 .\}
635 .\"
636 .\" set vertical spacing
637 .if !'\\*[misc*b]'C' \{\
638 .       ie '\\*[misc*b]'P' .vs \\n[misc*S-vs]u
639 .       el \{\
640 .               ie '\\*[misc*b]'D' .vs \\n[.ps]u+2p
641 .               el .vs \\*[misc*b]
642 .               if \\n[D]>2 .tm S: .vs \\*[misc*b]
643 .       \}
644 .\}
645 .nr @ps \\n[.ps]
646 .nr @vs \\n[.v]
647 .\"
648 .if \\n[D]>1 .tm S(\\$*): ma:\\*[misc*a], mb:\\*[misc*b] => ps:\\n[@ps]u, vs:\\n[@vs]u
649 .nr misc*S-ps \\n[misc*S-ps1]
650 .nr misc*S-vs \\n[misc*S-vs1]
651 .nr misc*S-ps1 \\n[@ps]
652 .nr misc*S-vs1 \\n[@vs]
653 .pg@move-trap
654 ..
655 .\"------------
656 .de HC
657 .ev 0
658 .hc \\$1
659 .ev
660 .ev 1
661 .hc \\$1
662 .ev
663 .ev 2
664 .hc \\$1
665 .ev
666 ..
667 .\"------------
668 .de RD
669 .di misc*rd
670 'fl
671 .rd \\$1\t
672 .br
673 .di
674 .ie !''\\$3' \{\
675 .       di misc*rd2
676 .       ds \\$3 "\\*[misc*rd]
677 .       br
678 .       di
679 .\}
680 .if !''\\$2' .rn misc*rd \\$2
681 .rm misc*rd misc*rd2
682 ..
683 .\"------------
684 .\" VERBON [flag [pointsize [font]]]
685 .\"     flag
686 .\"     bit     function
687 .\"     0       escape on
688 .\"     1       add an empty line before verbose text
689 .\"     2       add an empty line after verbose text
690 .\"     3       numbered lines (controlled by the string Verbnm)
691 .\"     4       indent text by the numbervariable Verbin.
692 .de VERBON
693 .br
694 .nr misc*verb 0\\$1
695 .if (0\\n[misc*verb]%4)/2 .SP \\n[Lsp]u
696 .misc@ev-keep misc*verb-ev
697 .nf
698 .if (0\\n[misc*verb]%16)/8 .nm \\*[Verbnm]
699 .ie !'\\$3'' .ft \\$3
700 .el .ft CR
701 .ie 0\\$2 \{\
702 .       ss \\$2
703 .       ps \\$2
704 .       vs \\$2
705 .\}
706 .el .ss 12
707 .ta T 8u*\w@n@u
708 .if (0\\n[misc*verb]%32)/16 .in +\\n[Verbin]u
709 .if 0\\n[misc*verb]%2 \{\
710 .       eo
711 .       nr @verbose-flag 1              \" tell pageheader to set ec/eo
712 .\}
713 ..
714 .de VERBOFF
715 .ec
716 .br
717 .if (0\\n[misc*verb]%8)/4 .SP \\n[Lsp]u
718 .if (0\\n[misc*verb]%16)/8 .nm
719 .if (0\\n[misc*verb]%32)/16 .in
720 .ev
721 .nr @verbose-flag 0
722 ..
723 .\" ######## module pict #################
724 .nr pict*width 0
725 .nr pict*height 0
726 .nr pict*mode 0
727 .nr pict*ind 0
728 .nr pict*id 0 1
729 .\" I assume that the number variable pict*id is the same
730 .\" between two runs.
731 .de PIC
732 .br
733 .nr pict*ind 0
734 .nr pict*box 0
735 .while \\n[.$]>0 \{\
736 .       if '-B'\\$1' \{\
737 .               nr pict*box 1
738 .               shift
739 .               continue
740 .       \}
741 .       if '-L'\\$1' \{\
742 .               nr pict*mode 0
743 .               shift
744 .               continue
745 .       \}
746 .       if '-R'\\$1' \{\
747 .               nr pict*mode 1
748 .               shift
749 .               continue
750 .       \}
751 .       if '-I'\\$1' \{\
752 .               nr pict*ind (m;\\$2)
753 .               nr pict*mode 2
754 .               shift 2
755 .               continue
756 .       \}
757 .       if '-C'\\$1' \{\
758 .               nr pict*mode 3
759 .               shift
760 .               continue
761 .       \}
762 .       ds pict*f \\$1
763 .       nr pict*id +1
764 .       shift
765 .       if \\n[.$]>0 \{\
766 .               nr pict*width (i;\\$1)
767 .               shift
768 .       \}
769 .       if \\n[.$]>0 \{\
770 .               nr pict*height (i;\\$1)
771 .               shift
772 .       \}
773 .\}
774 .\" let mmroff know the filename and id
775 .if \\n[Ref]>0 \{\
776 .       tm .\\\\" PIC id \\n[pict*id]
777 .       tm .\\\\" PIC file \\*[pict*f]
778 .\}
779 .\" these are defined by mmroff in the second pass
780 .if d pict*file!\\n[pict*id] \{\
781 .       ds pict*f \\*[pict*file!\\n[pict*id]]
782 .       nr pict*llx \\n[pict*llx!\\n[pict*id]]
783 .       nr pict*lly \\n[pict*lly!\\n[pict*id]]
784 .       nr pict*urx \\n[pict*urx!\\n[pict*id]]
785 .       nr pict*ury \\n[pict*ury!\\n[pict*id]]
786 .       \"
787 .       nr pict*w (p;\\n[pict*urx]-\\n[pict*llx])
788 .       if \\n[pict*w]<0 .nr pict*w 0-\\n[pict*w]
789 .       nr pict*h (p;\\n[pict*ury]-\\n[pict*lly])
790 .       if \\n[pict*h]<0 .nr pict*h 0-\\n[pict*h]
791 .       if \\n[pict*width]>0 \{\
792 .               nr pict*rs (u;1000*\\n[pict*width]/\\n[pict*w])
793 .               nr pict*w (u;\\n[pict*w]*\\n[pict*rs]/1000)
794 .               nr pict*h (u;\\n[pict*h]*\\n[pict*rs]/1000)
795 .       \}
796 .       if \\n[pict*height]>0 \{\
797 .               nr pict*rs (u;1000*\\n[pict*height]/\\n[pict*h])
798 .               nr pict*h (u;\\n[pict*h]*\\n[pict*rs]/1000)
799 .       \}
800 .       if '0'\\n[pict*mode]' \{\
801 .               nr pict*in \\n[.i]u
802 .       \}
803 .       if '1'\\n[pict*mode]' \{\
804 .               nr pict*in (u;\\n[.l]-\\n[.i]-\\n[pict*w])
805 .       \}
806 .       if '2'\\n[pict*mode]' \{\
807 .               nr pict*in \\n[pict*ind]u
808 .       \}
809 .       if '3'\\n[pict*mode]' \{\
810 .               nr pict*in (u;(\\n[.l]-\\n[.i]-\\n[pict*w])/2)
811 .       \}
812 .       ds pict*h "
813 .       if \\n[pict*h]>0 .ds pict*h \\n[pict*h]
814 .       \"
815 .       ne \\n[pict*h]u-1v
816 .       \"
817 .       \" these lines are copied and modified from tmac.pspic.
818 .       \" Originally written by James Clark
819 .       br
820 .       ie \\n[pict*box]>0 \{\
821 \v'-1v'\h'\\n[pict*in]u'\
822 \Z'\D'p 0 \\n[pict*h]u \\n[pict*w]u 0 0 -\\n[pict*h]u''\
823 \v'\\n[pict*h]u'\X'ps: import \\*[pict*f] \
824 \\n[pict*llx] \\n[pict*lly] \
825 \\n[pict*urx] \\n[pict*ury] \
826 \\n[pict*w] \\n[pict*h]'
827 .\}
828 .       el \{\
829 \v'-1v'\h'\\n[pict*in]u'\
830 \X'ps: invis'\
831 \Z'\D'p 0 \\n[pict*h]u \\n[pict*w]u 0 0 -\\n[pict*h]u''\
832 \X'ps: endinvis'\
833 \v'\\n[pict*h]u'\X'ps: import \\*[pict*f] \
834 \\n[pict*llx] \\n[pict*lly] \
835 \\n[pict*urx] \\n[pict*ury] \
836 \\n[pict*w] \\n[pict*h]'
837 .       \}
838 .       br
839 .       sp \\n[pict*h]u-1v
840 .\}
841 ..
842 .\" external picture
843 .\" -L  left adjust
844 .de EPIC
845 .if \\n[.$]<2 .@error "EPIC: Not enough arguments"
846 .nr pict*adj 0          \" centered
847 .if '\\$1'-L' \{\
848 .       shift 1         \" left adjust
849 .       nr pict*adj 1
850 .\}
851 .if \\n[nl]<0 \&
852 .nr pict*w \\$1
853 .nr pict*h \\$2
854 .ds pict*name "External picture
855 .if !''$3' .ds pict*name \\$3
856 .ne \\n[pict*h]u
857 .sp \\n[pict*h]u-1v
858 .nr pict*ind 0
859 .if !\\n[pict*adj] .nr pict*ind (u;(\\n[.l]-\\n[.i]-\\n[pict*w])/2)
860 .mk
861 .in +\\n[pict*ind]u
862 \D'l \\n[pict*w]u 0'\
863 \D'l 0 -\\n[pict*h]u'\
864 \D'l -\\n[pict*w]u 0'\
865 \D'l 0 \\n[pict*h]u'\
866 \v'-(u;\\n[pict*h]/2)'\
867 \h'(u;(\\n[pict*w]-\w'\\*[pict*name]'/2))'\\*[pict*name]
868 .in
869 .rt
870 .sp 1v
871 ..
872 .\" ######## module acc #################
873 .\"-----------
874 .\" accents. These are copied from mgs, written by James Clark.
875 .de acc@over-def
876 .ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
877 \h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
878 ..
879 .de acc@under-def
880 .ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
881 ..
882 .acc@over-def ` \`
883 .acc@over-def ' \'
884 .acc@over-def ^ ^
885 .acc@over-def ~ ~
886 .acc@over-def : \(ad
887 .acc@over-def ; \(ad
888 .acc@under-def , \(ac
889 .\" ######## module uni #################
890 .\" unimplemented macros
891 .de OK
892 'tm "OK: not implemented"
893 ..
894 .de PM
895 'tm "PM: not implemented"
896 ..
897 .\" ######## module hd #################
898 .\" support for usermacro
899 .nr hd*h1-page 1        \" last page-number for level 1 header.
900 .nr hd*htype 0
901 .ds hd*sect-pg
902 .ds hd*mark
903 .ds hd*suf-space
904 .nr hd*need 0
905 .aln ;0 hd*htype
906 .als }0 hd*mark
907 .als }2 hd*suf-space
908 .aln ;3 hd*need
909 .\"-------------
910 .\" .hd@split varable index name val1 val2 ...
911 .de hd@split
912 .if \\$2>(\\n[.$]-3) .@error "\\$3 must have at least \\$2 values (\\*[\\$3]).
913 .nr hd*sp-tmp \\$2+3
914 .ds \\$1 \\$[\\n[hd*sp-tmp]]
915 ..
916 .de HU
917 .H 0 "\\$1"
918 ..
919 .\"-------------
920 .de H
921 .if !r hd*cur-bline .nr hd*cur-bline \\n[nl]
922 .br
923 .df@print-float 2\"     $$$ could be wrong...
924 .\" terminate all lists
925 .LC
926 .init@reset
927 .nr hd*level 0\\$1
928 .nr hd*arg1 0\\$1
929 .if !\\n[hd*level] .nr hd*level \\n[Hu]
930 .\"
931 .\"     clear lower counters
932 .nr hd*i 1 1
933 .while \\n+[hd*i]<8 .if \\n[hd*level]<\\n[hd*i] .nr H\\n[hd*i] 0 1
934 .\"
935 .\" save last text for use in TP
936 .if \\n[hd*level]=1 .ds H1txt \\$2\\$3
937 .\"
938 .\" This is a little fix to be able to get correct H1 heading number
939 .\" in page headers. Special attention was needed when other formats are used.
940 .ie !''\\g[H1]' \{\
941 .       ds hd*format \\g[H1]
942 .       af H1 0
943 .       nr H1h \\n[H1] 1
944 .       af H1 \\*[hd*format]
945 .\}
946 .el .nr H1h \\n[H1] 1
947 .if \\n[hd*level]=1 .nr H1h +1
948 .\"
949 .\"     Check if it's time for new page. Only if text has
950 .\"     appeared before.
951 .if \\n[Ej]&(\\n[Ej]>=\\n[hd*level])&(\\n[nl]>\\n[hd*cur-bline]) .pg@next-page
952 .\"
953 .\" increment current counter
954 .nr H\\n[hd*level] +1
955 .\"
956 .\" update pagenumber if section-page is used
957 .if (\\n[hd*level]=1)&(\\n[Sectp]>0) .hd@set-page 1
958 .\"
959 .\" hd*mark is the text written to the left of the header.
960 .ds hd*mark \\n[H1].
961 .\"
962 .if \\n[hd*level]>1 .as hd*mark \\n[H2]
963 .\"
964 .nr hd*i 2 1
965 .while \\n+[hd*i]<8 .if \\n[hd*level]>(\\n[hd*i]-1) .as hd*mark .\\n[H\\n[hd*i]]
966 .if \\n[Ht] .ds hd*mark \\n[H\\n[hd*level]].
967 .\"
968 .\" special case, no dot after level one heading if not H1dot true
969 .if (\\n[hd*level]=1)&(\\n[H1dot]=0) .ds hd*mark \\n[H1]
970 .\"
971 .as hd*mark \ \ \"                      add spaces between mark and heading
972 .if !\\n[hd*arg1] .ds hd*mark\"         no mark for unnumbered
973 .\"
974 .if \\n[D]>1 .tm At header \\*[hd*mark] "\\$2"
975 .nr hd*htype 0                          \" hd*htype = check break and space
976 .                                       \" 0 = run-in, 1 = break only, 2 = space
977 .if \\n[hd*level]<=\\n[Hb] .nr hd*htype 1
978 .if \\n[hd*level]<=\\n[Hs] .nr hd*htype 2
979 .                                       \" two spaces if hd*htype == 0
980 .ie (\\n[hd*htype]=0)&(\w@\\$2@) .ds hd*suf-space "  \"
981 .el .ds hd*suf-space
982 .nr hd*need 2v                          \" hd*need = header need space
983 .\"---------- user macro HX ------------
984 .\" User exit macro to override numbering.
985 .\" May change hd*mark (}0), hd*suf-space (}2) and hd*need (;3)
986 .\" Can also change Hps1/2.
987 .if d HX .HX \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
988 .\"-------------------------------------- 
989 .\" pre-space
990 .ie \\n[hd*level]<=\\n[Hps] .SP (u;\\n[Hps2])
991 .el .SP (u;\\n[Hps1])
992 .\"
993 .par@reset-num \\n[hd*level]\"                  reset numbered paragraph
994 .\" start diversion to measure size of header
995 .di hd*div
996 \\*[hd*mark]\\$2\\$3\\*[hd*suf-space]
997 .br
998 .di
999 .rm hd*div
1000 .if \\n[hd*htype] .na \"                no adjust if run-in
1001 .if \\n[hd*htype]<2 .nr hd*need +\\n[Lsp]u \"   add some extra space
1002 .ne \\n[hd*need]u+\\n[dn]u+.5p-1v \"    this is the needed space for a header
1003 .\"
1004 .\" size and font calculations
1005 .hd@split hd*font \\n[hd*level] HF \\*[HF]\"    get font for this level
1006 .ft \\*[hd*font]\"                      set new font
1007 .hd@split hd*new-ps \\n[hd*level] HP \\*[HP]\"  get point size
1008 .ie (\\*[hd*new-ps]=0):(\w@\\*[hd*new-ps]@=0) \{\
1009 .       if \\n[hd*htype] \{\
1010 .               if '\\*[hd*font]'3' \{\
1011 .                       ps -1
1012 .                       vs -1
1013 .               \}
1014 .               if '\\*[hd*font]'B' \{\
1015 .                       ps -1
1016 .                       vs -1
1017 .               \}
1018 .       \}
1019 .\}
1020 .el \{\
1021 .       ps \\*[hd*new-ps]
1022 .       vs \\*[hd*new-ps]+2
1023 .\}
1024 .\"
1025 .\"---------- user macro HY ------------- 
1026 .\"     user macro to reset indents
1027 .if d HY .HY \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
1028 .\"-------------------------------------- 
1029 .nr hd*mark-size \w@\\*[hd*mark]@
1030 .if (\\n[hd*level]<=\\n[Hc])&\\n[hd*htype] .ce\" center if level<=Hc
1031 .\"
1032 .\"     finally, output the header
1033 \\*[hd*mark]\&\c
1034 .\"     and the rest of the header
1035 .ie \\n[hd*htype] \{\
1036 \\$2\\$3
1037 .       br
1038 .\}
1039 .el \\$2\\$3\\*[hd*suf-space]\&\c
1040 .ft 1
1041 .\" restore pointsize and vertical size.
1042 .ps \\n[@ps]u
1043 .vs \\n[@vs]u
1044 .\"
1045 .\" table of contents
1046 .if (\\n[hd*level]<=\\n[Cl])&\w@\\$2@ .toc@entry \\n[hd*level] "\\$2"
1047 .\"     set adjust to previous value
1048 .SA
1049 .\"     do break or space
1050 .if \\n[hd*htype] .br
1051 .if \\n[hd*htype]>1 .SP (u;\\n[Lsp]*\\n[Hss])
1052 .if \\n[hd*htype] \{\
1053 .       \"      indent if Hi=1 and Pt=1
1054 .       if (\\n[Hi]=1)&(\\n[Pt]=1) .ti +\\n[Pi]n
1055 .       \"      indent size of mark if Hi=2
1056 .       if \\n[hd*htype]&(\\n[Hi]>1) .ti +\\n[hd*mark-size]u
1057 .\}
1058 .nr par@ind-flag 0                      \" no indent on .P if Pt=2
1059 .\"
1060 .\"     check if it is time to reset footnotes
1061 .if (\\n[hd*level]=1)&\\n[ft*clear-at-header] .nr ft*nr 0 1
1062 .\"
1063 .\"     check if it is time to reset indexes
1064 .if (\\n[hd*level]=1)&\\n[Sectf] \{\
1065 .       nr lix*fg-nr 0 1
1066 .       nr lix*tb-nr 0 1
1067 .       nr lix*ec-nr 0 1
1068 .       nr lix*ex-nr 0 1
1069 .\}
1070 .\"---------- user macro HZ ----------
1071 .if d HZ .HZ \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
1072 .nr hd*last-pos \\n[nl]
1073 .nr hd*last-hsize \\n[.k]
1074 .nr par@ind-flag 0
1075 ..
1076 .\"--------
1077 .de HM
1078 .nr hd*i 0 1
1079 .while \\n+[hd*i]<8 .af H\\n[hd*i] \\$[\\n[hd*i]] 1
1080 ..
1081 .\"----------------------
1082 .\" set page-nr, called from header 
1083 .\" 
1084 .de hd@set-page
1085 .\"
1086 .ie \\n[.$]>0 .nr P \\$1
1087 .el .nr P +1
1088 .\" Set section-page-string
1089 .ds hd*sect-pg \\n[H1]-\\n[P]
1090 .if \\n[Sectp]>1 .if '\\n[H1]'0' .ds hd*sect-pg "
1091 ..
1092 .\"########### module pg ####################
1093 .\" set end of text trap
1094 .wh 0 pg@header
1095 .em pg@end-of-text
1096 .\"
1097 .ds pg*header ''- \\nP -''
1098 .ds pg*footer
1099 .if \n[N]=4 .ds pg*header ''''
1100 .if (\n[N]=3):(\n[N]=5) \{\
1101 .       ds pg*header ''''
1102 .       ds pg*footer ''\\*[hd*sect-pg]''
1103 .\}
1104 .ds pg*even-footer
1105 .ds pg*odd-footer
1106 .ds pg*even-header
1107 .ds pg*odd-header
1108 .\"
1109 .nr pg*top-margin 0
1110 .nr pg*foot-margin 0
1111 .nr pg*block-size 0
1112 .nr pg*footer-size 5v\"                  1v+footer+even/odd footer+2v
1113 .nr pg*header-size 7v\"                  3v+header+even/odd header+2v
1114 .nr pg*extra-footer-size 0
1115 .nr pg*extra-header-size 0
1116 .nr ft*note-size 0
1117 .nr pg*cur-column 0
1118 .nr pg*cols-per-page 1
1119 .nr pg*cur-po \n[@po]
1120 .nr pg*head-mark 0
1121 .\"
1122 .nr pg*ps \n[@ps]
1123 .nr pg*vs \n[@vs]
1124 .\"-------------------------
1125 .\" footer TRAPS: set, enable and disable
1126 .de pg@set-new-trap
1127 .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)
1128 .\"
1129 .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]
1130 .\"
1131 .\" last-pos points to the position of the footer and bottom 
1132 .\" block below foot-notes.
1133 .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)
1134 .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]
1135 ..
1136 .de pg@enable-trap
1137 .wh \\n[pg*foot-trap]u pg@footer
1138 .if \\n[D]>2 .tm pg@enable-trap .t=\\n[.t] nl=\\n[nl]
1139 .if \\n[D]>2 .ptr
1140 ..
1141 .de pg@disable-trap
1142 .ch pg@footer
1143 ..
1144 .\" move to new trap (if changed).
1145 .de pg@move-trap
1146 .pg@disable-trap
1147 .pg@set-new-trap
1148 .pg@enable-trap
1149 ..
1150 .de pg@enable-top-trap
1151 .\" set trap for pageheader.
1152 .nr pg*top-enabled 1
1153 ..
1154 .de pg@disable-top-trap
1155 .\" remove trap for pageheader.
1156 .nr pg*top-enabled 0
1157 ..
1158 .\" no header on the next page
1159 .de PGNH
1160 .nr pg*top-enabled (-1)
1161 ..
1162 .\" set first trap for pagefooter
1163 .pg@enable-top-trap
1164 .pg@set-new-trap
1165 .pg@enable-trap
1166 .\"-------------------------
1167 .\" stop output and begin on next page. Fix footnotes and all that.
1168 .de pg@next-page
1169 .\".debug next-page
1170 .ne 999i                \" activate trap
1171 .\" .pg@footer
1172 ..
1173 .\"-------------------------
1174 .\" support for PX, TP and EOP.
1175 .als }t pg*header
1176 .als }e pg*even-header
1177 .als }o pg*odd-header
1178 .als TPh pg*header
1179 .als TPeh pg*even-header
1180 .als TPoh pg*odd-header
1181 .\"
1182 .als EOPf pg*footer
1183 .als EOPef pg*even-footer
1184 .als EOPof pg*odd-footer
1185 .\"------------------------------------------------------------
1186 .\" HEADER
1187 .de pg@header
1188 .if \\n[D]>1 .tm Page# \\n[%] (\\n[.F]:\\n[c.])
1189 .if \\n[Idxf] \{\
1190 .tl '<pagenr\ \\n[%]>'''
1191 .\}
1192 .\" assign current page-number to P
1193 .hd@set-page
1194 .\" reset spacing
1195 .nr line*lp\\n[.z] 0
1196 .nr line*ac\\n[.z] 0
1197 .\"
1198 .\" suppress pageheader if pagenumber == 1 and N == [124]
1199 .if \\n[pg*top-enabled] \{\
1200 .\"     must be fixed!!
1201 .\".    pg@disable-top-trap
1202 .       if \\n[pg*extra-header-size] 'sp \\n[pg*extra-header-size]u
1203 .       if \\n[pg*top-margin] 'sp \\n[pg*top-margin]u
1204 .       ev pg*tl-ev
1205 .       pg@set-env
1206 .       ie d let@header .let@header
1207 .       el \{\
1208 .               ie d TP .TP
1209 .               el \{\
1210 '                       sp 3
1211 .                       ie ((\\n[%]=1)&((\\n[N]=1):(\\n[N]=2))) .sp
1212 .                       el .tl \\*[pg*header]
1213 .                       ie o .tl \\*[pg*odd-header]
1214 .                       el .tl \\*[pg*even-header]
1215 '                       sp 2
1216 .               \}
1217 .       \}
1218 .       ev
1219 .       \" why no-space??
1220 .       if d PX \{\
1221 .               ns
1222 .               PX
1223 .               rs
1224 .       \}
1225 .       \" check for pending footnotes 
1226 .       ft@check-old
1227 .       \"
1228 .       \" back to normal text processing
1229 .       pg@enable-trap
1230 .       \" mark for multicolumn
1231 .       nr pg*head-mark \\n[nl]u
1232 .       \" reset NCOL pointer at each new page.
1233 .       nr pg*last-ncol 0
1234 .       \" set multicolumn
1235 .       \" 
1236 .       pg@set-po
1237 .       \" print floating displays
1238 .       df@print-float 4
1239 .       tbl@top-hook
1240 .       ns
1241 .\}
1242 .if \\n[pg*top-enabled]<0 .nr pg*top-enabled 1
1243 .nr hd*cur-bline \\n[nl]        \" .H needs to know if output has occured
1244 ..
1245 .\"---------------------------------------------------------
1246 .\" FOOTER
1247 .de pg@footer
1248 .ec
1249 .if \\n[D]>2 .tm Footer# \\n[%] (\\n[.F]:\\n[c.]) nl=\\n[nl]
1250 .pg@disable-trap
1251 .\".debug footer
1252 .tbl@bottom-hook
1253 .\" increment pageoffset for MC
1254 .\" move to the exact start of footer.
1255 'sp |\\n[pg*foot-trap]u+1v
1256 .\"
1257 .if \\n[D]>3 .tm FOOTER after .sp, nl=\\n[nl]
1258 .\" print footnotes
1259 .if d ft*div .ft@print
1260 .\"
1261 .pg@inc-po
1262 .if !\\n[pg*cur-column] .pg@print-footer
1263 .\" next column
1264 .pg@set-po
1265 .pg@enable-trap
1266 .if \\n[@verbose-flag] .eo              \" to help VERBON/VERBOFF
1267 ..
1268 .\"-------------------------
1269 .de pg@print-footer
1270 .\" jump to the position just below the foot-notes.
1271 'sp |\\n[pg*last-pos]u+1v
1272 .if \\n[D]>3 .tm print-footer nl=\\n[nl]
1273 .\" check if there are any bottom block
1274 .if d pg*block-div .pg@block
1275 .\"
1276 .\" print the footer and eject new page
1277 .ev pg*tl-ev
1278 .pg@set-env
1279 .\" user defined end-of-page macro
1280 .ie d EOP .EOP
1281 .el \{\
1282 .       ie o .tl \\*[pg*odd-footer]
1283 .       el .tl \\*[pg*even-footer]
1284 .       ie (\\n[%]=1)&(\\n[N]=1) .tl \\*[pg*header]
1285 .       el .tl \\*[pg*footer]
1286 .       tl ''\\*[Pg_type!\\n[@copy_type]]''
1287 .\}
1288 .ev
1289 .\" be sure that floating displays and footnotes will be
1290 .\" printed at the end of the document.
1291 .ie (\\n[df*fnr]>=\\n[df*o-fnr]):\\n[ft*exist] \{\
1292 .       ev ne
1293 '       bp
1294 .       ev
1295 .\}
1296 .el 'bp
1297 ..
1298 .\"-------------------------
1299 .\"
1300 .\" Initialize the title environment
1301 .de pg@set-env
1302 'na
1303 'nh
1304 'in 0
1305 'ti 0
1306 .ie \\n[Pgps] \{\
1307 .       ps \\n[@ps]u
1308 .       vs \\n[@vs]u
1309 .\}
1310 .el \{\
1311 .       ps \\n[pg*ps]u
1312 .       vs \\n[pg*vs]u
1313 .\}
1314 .lt \\n[@ll]u
1315 .ll \\n[@ll]u
1316 ..
1317 .\"-------------------------
1318 .de PH
1319 .ds pg*header "\\$1
1320 .pg@set-new-size
1321 ..
1322 .de PF
1323 .ds pg*footer "\\$1
1324 .pg@set-new-size
1325 ..
1326 .de OH
1327 .ds pg*odd-header "\\$1
1328 .pg@set-new-size
1329 ..
1330 .de EH
1331 .ds pg*even-header "\\$1
1332 .pg@set-new-size
1333 ..
1334 .de OF
1335 .ds pg*odd-footer "\\$1
1336 .pg@set-new-size
1337 ..
1338 .de EF
1339 .ds pg*even-footer "\\$1
1340 .pg@set-new-size
1341 ..
1342 .de pg@clear-hd
1343 .ds pg*even-header
1344 .ds pg*odd-header
1345 .ds pg*header
1346 ..
1347 .de pg@clear-ft
1348 .ds pg*even-footer
1349 .ds pg*odd-footer
1350 .ds pg*footer
1351 ..
1352 .de pg@set-new-size
1353 .nr pg*ps \\n[@ps]
1354 .nr pg*vs \\n[@vs]
1355 .pg@move-trap
1356 ..
1357 .\"-------------------------
1358 .\" end of page processing
1359 .de pg@footnotes
1360 .\".debug footnotes
1361 .\" output footnotes. set trap for block
1362 .\"
1363 ..
1364 .\"-------------------------
1365 .\" print bottom block
1366 .de pg@block
1367 .ev pg*block-ev
1368 'nf
1369 'in 0
1370 .ll 100i
1371 .pg*block-div
1372 .br
1373 .ev
1374 ..
1375 .\"-------------------------
1376 .\" define bottom block
1377 .de BS
1378 .misc@ev-keep pg*block-ev
1379 .init@reset
1380 .br
1381 .di pg*block-div
1382 ..
1383 .\"-------------------------
1384 .de BE
1385 .br
1386 .di
1387 .nr pg*block-size \\n[dn]u
1388 .ev
1389 .pg@move-trap
1390 ..
1391 .\"-------------------------
1392 .\" print out all pending text
1393 .de pg@end-of-text
1394 .if \\n[D]>2 .tm ---------- End of text processing ----------------
1395 .df@eot-print
1396 .ref@eot-print
1397 ..
1398 .\"-------------------------
1399 .\" set top and bottom margins 
1400 .\" -T  sets pg*footer-size and pg*header-size instead
1401 .de VM
1402 .ie '\\$1'-T' \{\
1403 .       shift
1404 .       if \\n[.$]=0 \{\
1405 .               nr pg*footer-size 5v
1406 .               nr pg*header-size 7v
1407 .       \}
1408 .       if \\n[.$]>0 .nr pg*header-size (v;\\$1)
1409 .       if \\n[.$]>1 .nr pg*footer-size (v;\\$2)
1410 .\}
1411 .el \{\
1412 .       if \\n[.$]=0 \{\
1413 .               nr pg*extra-footer-size 0
1414 .               nr pg*extra-header-size 0
1415 .       \}
1416 .       if \\n[.$]>0 .nr pg*extra-header-size (v;\\$1)
1417 .       if \\n[.$]>1 .nr pg*extra-footer-size (v;\\$2)
1418 .       if \\n[D]>2 \{\
1419 .               tm extra top \\n[pg*extra-footer-size]
1420 .               tm extra bottom \\n[pg*extra-header-size]
1421 .       \}
1422 .\}
1423 .pg@move-trap
1424 ..
1425 .\"---------------------
1426 .\" multicolumn output. 
1427 .de pg@set-po
1428 .if \\n[pg*cols-per-page]>1 \{\
1429 .       ll \\n[pg*column-size]u
1430 .\}
1431 ..
1432 .de pg@inc-po
1433 .if \\n[pg*cols-per-page]>1 \{\
1434 .       ie \\n+[pg*cur-column]>=\\n[pg*cols-per-page] \{\
1435 .               nr pg*cur-column 0 1
1436 .               nr pg*cur-po \\n[@po]u
1437 .               po \\n[@po]u
1438 .               ll \\n[@ll]u
1439 .       \}
1440 .       el \{\
1441 .               nr pg*cur-po +(\\n[pg*column-size]u+\\n[pg*column-sep]u)
1442 .               po \\n[pg*cur-po]u
1443 '               sp |\\n[pg*head-mark]u
1444 .               tbl@top-hook
1445 .       \}
1446 .\}
1447 ..
1448 .\" An argument disables the page-break.
1449 .de 1C
1450 .br
1451 .if \\n[pg*cols-per-page]<=1 .@error "1C: multicolumn mode not active"
1452 .nr pg*cols-per-page 1
1453 .nr pg*column-sep 0
1454 .nr pg*column-size \\n[@ll]
1455 .nr pg*ncol-i \\n[pg*cur-column]\"      temp variable
1456 .nr pg*cur-column 0 1
1457 .nr pg*cur-po \\n[@po]u
1458 .PGFORM
1459 .ie !'\\$1'1' .SK
1460 .el \{\
1461 .       if d ft*div \{\
1462 .               if \\n[pg*ncol-i]>0 \{\
1463 .                       @warning 1C: footnotes will be messy
1464 .               \}
1465 .       \}
1466 .       if \\n[pg*last-ncol]>0 \{\
1467 .               sp |\\n[pg*last-ncol]u
1468 .               nr pg*last-ncol 0
1469 .       \}
1470 .\}
1471 ..
1472 .de 2C
1473 .br
1474 .nr pg*head-mark \\n[nl]u
1475 .if \\n[pg*cols-per-page]>1 .@error "2C: multicolumn mode already active"
1476 .nr pg*cols-per-page 2
1477 .nr pg*column-sep \\n[@ll]/15
1478 .nr pg*column-size (\\n[@ll]u*7)/15
1479 .nr pg*cur-column 0 1
1480 .nr pg*cur-po \\n[@po]u
1481 .ll \\n[pg*column-size]u
1482 .\" .lt \\n[pg*column-size]u
1483 ..
1484 .\" MC column-size [ column-separation ]
1485 .de MC
1486 .br
1487 .nr pg*head-mark \\n[nl]u
1488 .if \\n[pg*cols-per-page]>1 .@error "MC: multicolumn mode already active"
1489 .ie ''\\$1' .nr pg*column-size \\n[.l]
1490 .el .nr pg*column-size (n;\\$1)
1491 .ie ''\\$2' .nr pg*column-sep \\n[pg*column-size]/15
1492 .el .nr pg*column-sep (n;\\$2)
1493 .\"
1494 .\" calculate the number of columns/page
1495 .nr pg*cols-per-page 0
1496 .nr pg*i \\n[pg*column-size]
1497 .while \\n[pg*i]<=\\n[.l] \{\
1498 .       nr pg*cols-per-page \\n[pg*cols-per-page]+1
1499 .       nr pg*i \\n[pg*i]+\\n[pg*column-sep]+\\n[pg*column-size]
1500 .\}
1501 .nr pg*cur-column 0 1
1502 .nr pg*cur-po \\n[@po]u
1503 .ll \\n[pg*column-size]u
1504 .\" .lt \\n[pg*column-size]u
1505 ..
1506 .\" begin a new column
1507 .de NCOL
1508 .br
1509 .if \\n[nl]>\\n[pg*last-ncol] .nr pg*last-ncol \\n[nl]
1510 .pg@footer
1511 ..
1512 .\" skip pages
1513 .de SK
1514 .br
1515 .bp
1516 .nr pg*i 0 1
1517 .\" force new page by writing something invisible.
1518 .while \\n+[pg*i]<=(0\\$1) \{\
1519 \&
1520 .       bp
1521 .\}
1522 ..
1523 .\"-------------------------------
1524 .\" MULB width1 space1 width2 space2 width3 space3 ...
1525 .de MULB
1526 .br
1527 .nr pg*i 0 1
1528 .nr pg*mul-x 0 1
1529 .nr pg*mul-ind 0
1530 .nr pg*mul-last 0
1531 .while \\n[.$] \{\
1532 .       nr pg*mul!\\n+[pg*i] (n;0\\$1)
1533 .       nr pg*muls!\\n[pg*i] (n;0\\$2)
1534 .       shift 2
1535 .\}
1536 .nr pg*mul-max-col \\n[pg*i]
1537 .ds pg*mul-fam \\n[.fam]
1538 .nr pg*mul-font \\n[.f]
1539 .ev pg*mul-ev
1540 .ps \\n[@ps]u
1541 .vs \\n[@vs]u
1542 .fam \\*[pg*mul-fam]
1543 .ft \\n[pg*mul-font]
1544 .fi
1545 .hy 14
1546 .di pg*mul-div
1547 .MULN
1548 ..
1549 .\"-----------
1550 .de MULN
1551 .if \\n[pg*mul-x]>=\\n[pg*mul-max-col] .@error "MULN: Undefined columnwidth"
1552 .br
1553 .if \\n[.d]>\\n[pg*mul-last] .nr pg*mul-last \\n[.d]
1554 .rt +0
1555 .in \\n[pg*mul-ind]u
1556 .ll (u;\\n[.i]+\\n[pg*mul!\\n+[pg*mul-x]])u
1557 .nr pg*mul-ind +(u;\\n[pg*mul!\\n[pg*mul-x]]+\\n[pg*muls!\\n[pg*mul-x]])
1558 ..
1559 .\"-----------
1560 .\" MULE
1561 .de MULE
1562 .br
1563 .if \\n[.d]>\\n[pg*mul-last] .nr pg*mul-last \\n[.d]
1564 .di
1565 .ev
1566 .ne \\n[pg*mul-last]u
1567 .nf
1568 .mk
1569 .pg*mul-div
1570 .rt
1571 .sp \\n[pg*mul-last]u
1572 .fi
1573 ..
1574 .\"-----------
1575 .de OP
1576 .br
1577 .ie o .if !\\n[pg*head-mark]=\\n[nl] \{\
1578 .       bp +1
1579 .       bp +1
1580 .\}
1581 .el .bp
1582 ..
1583 .\"########### module footnotes ###################
1584 .nr ft*note-size 0
1585 .nr ft*busy 0
1586 .nr ft*nr 0 1
1587 .nr ft*wide 0
1588 .nr ft*hyphen 0\"       hyphenation value
1589 .nr ft*adjust 1\"       >0 if adjust true
1590 .nr ft*indent 1\"       >0 if text indent true (not imp. $$$)
1591 .nr ft*just 0\" 0=left justification, 1=right (not imp. $$$)
1592 .nr ft*exist 0\"        not zero if there are any footnotes to be printed
1593 .nr ft*clear-at-header 0\" >0 if footnotes should be reset at first level head.
1594 .\"
1595 .ds F \v'-.4m'\s-3\\n+[ft*nr]\s0\v'.4m'
1596 .\"
1597 .\"-----------------
1598 .\" init footnote environment
1599 .de ft@init
1600 .\" indentcontrol not implemented $$$
1601 .\" label justification not implemented $$$
1602 'in 0
1603 'fi
1604 .ie \\n[ft*adjust] 'ad
1605 .el 'na
1606 .ie \\n[ft*hyphen] 'hy 14
1607 .el 'hy 0
1608 .ll \\n[@cur-ll]u
1609 .lt \\n[@cur-ll]u
1610 .ps (p;\\n[@ps]u-2)
1611 .vs (p;\\n[@vs]u-1)
1612 ..
1613 .\"-----------------
1614 .\" set footnote format
1615 .\" no support for two column processing (yet). $$$
1616 .de FD
1617 .if \\n[.$]=0 .@error "FD: bad arg \\$1"
1618 .ie \\n[.$]=2 .nr ft*clear-at-header 1
1619 .el .nr ft*clear-at-header 0
1620 .\"
1621 .if !'\\$1'' \{\
1622 .       ie \\$1>11 .nr ft*format 0
1623 .       el .nr ft*format \\$1
1624 .       \"
1625 .       nr ft*hyphen (\\n[ft*format]%2)*14
1626 .       nr ft*format \\n[ft*format]/2
1627 .       \"
1628 .       nr ft*adjust 1-(\\n[ft*format]%2)
1629 .       nr ft*format \\n[ft*format]/2
1630 .       \"
1631 .       nr ft*indent 1-(\\n[ft*format]%2)
1632 .       nr ft*format \\n[ft*format]/2
1633 .       \"
1634 .       nr ft*just \\n[ft*format]%2
1635 .\}
1636 ..
1637 .\"---------------
1638 .\" Footnote and display width control $$$
1639 .de WC
1640 .nr ft*i 0 1
1641 .while \\n+[ft*i]<=\\n[.$] \{\
1642 .       ds ft*x \\$[\\n[ft*i]]
1643 .       if '\\*[ft*x]'N' \{\
1644 .               nr ft*wide 0
1645 .               nr ft*first-fn 0
1646 .               nr ds*wide 0
1647 .               nr ds*float-break 1
1648 .       \}
1649 .       if '\\*[ft*x]'-WF' .nr ft*wide 0
1650 .       if '\\*[ft*x]'WF' .nr ft*wide 1
1651 .       if '\\*[ft*x]'-FF' .nr ft*first-fn 0
1652 .       if '\\*[ft*x]'FF' .nr ft*first-fn 1
1653 .       if '\\*[ft*x]'-WD' \{\
1654 .               nr ds*wide 0
1655 .               if r ft*df-save \{\
1656 .                       nr Df \\n[ft*df-save]
1657 .                       rm ft*df-save 
1658 .               \}
1659 .       \}
1660 .       if '\\*[ft*x]'WD' \{\
1661 .               nr ds*wide 1
1662 .               nr ft*df-save \\n[Df]
1663 .               nr Df 4
1664 .       \}
1665 .       if '\\*[ft*x]'-FB' .nr ds*float-break 0
1666 .       if '\\*[ft*x]'FB' .nr ds*float-break 1
1667 .       if \\n[D]>1 .tm WC WF=\\n[ft*wide] WD=\\n[ds*wide]
1668 .\}
1669 ..
1670 .\"-----------------
1671 .\" begin footnote
1672 .\" Change environment, switch to diversion and print the foot-note mark.
1673 .de FS
1674 .if \\n[ft*busy] .@error "FS: missing FE"
1675 .nr ft*busy 1
1676 .ev ft*ev
1677 .ft@init
1678 .if !\\n[ft*wide] .pg@set-po
1679 .di ft*tmp-div
1680 .nr ft*space (u;\\n[Fs]*\\n[Lsp])
1681 .sp \\n[ft*space]u
1682 .\" print mark
1683 .ie \\n[.$] .ds ft*mark \\$1
1684 .el .ds ft*mark \\n[ft*nr].
1685 \\*[ft*mark]
1686 .in +.75c
1687 .sp -1
1688 .nr ft*exist 1
1689 ..
1690 .\"-----------------
1691 .\" init footnote diversion
1692 .de ft@init-footnote
1693 .di ft*div
1694 \l'20n'
1695 .br
1696 .di
1697 .nr ft*note-size \\n[dn]
1698 ..
1699 .\"-----------------
1700 .\" end footnote
1701 .\" End the diversion, back to previous environment, and adjust
1702 .\" the trap to the new foot-note size.
1703 .de FE
1704 .nr ft*busy 0
1705 .br
1706 .di
1707 'in 0
1708 'nf
1709 .if \\n[@pl]u<\\n[dn]u .@error "FE: too big footnote"
1710 .if !d ft*div .nr dn +1v
1711 .if \\n[D]>3 .tm FE: foot-trap=\\n[pg*foot-trap] .d=\\n[.d] dn=\\n[dn]
1712 .ie (\\n[pg*foot-trap]u-\\n[.d]u)<\\n[dn]u \{\
1713 .       da ft*next-div
1714 .       ft*tmp-div
1715 .       br
1716 .       di
1717 .\}
1718 .el \{\
1719 .       if !d ft*div .ft@init-footnote
1720 .       da ft*div
1721 .       ft*tmp-div
1722 .       di
1723 .       nr ft*note-size +\\n[dn]
1724 .\}
1725 .rm ft*tmp-div
1726 .ev
1727 .pg@move-trap
1728 ..
1729 .\"-----------------
1730 .\" print footnotes, see pg@footer
1731 .de ft@print
1732 .ev ft*print-ev
1733 'nf
1734 'in 0
1735 .ll 100i
1736 .ft*div
1737 .br
1738 .ev
1739 .rm ft*div
1740 .nr ft*note-size 0
1741 .pg@move-trap
1742 ..
1743 .\"-----------------
1744 .\" check if any pending footnotes, see pg@header
1745 .de ft@check-old
1746 .if d ft*next-div \{\
1747 .       ev ft*ev
1748 .       ft@init
1749 .       ft@init-footnote
1750 .       nf
1751 .       in 0
1752 .       da ft*div
1753 .       ft*next-div
1754 .       di
1755 .       nr ft*note-size +\\n[dn]
1756 .       rm ft*next-div
1757 .       ev
1758 .       nr ft*exist 0
1759 .       pg@move-trap
1760 .\}
1761 ..
1762 .\"########### module display ###################
1763 .nr ds*wide 0\"         >0 if wide displays wanted
1764 .nr df*fnr 0 1\"        floating display counter
1765 .nr df*o-fnr 1\"        floating display counter, already printed
1766 .nr ds*snr 0 1\"        static display counter
1767 .nr ds*lvl 0 1\"        display level
1768 .nr ds*float-busy 0\"   >0 if printing float
1769 .nr df*float 0          >0 if previous display was floating
1770 .\"--------------------------------------------
1771 .de DE
1772 .ie \\n[df*float] .df@end \\$@
1773 .el .ds@end \\$@
1774 ..
1775 .\"--------------------------------------------
1776 .\" floating display start
1777 .\" nested DF/DE is not allowed.
1778 .de DF
1779 .if \\n[df*float] .@error "DF:nested floating is not allowed. Use DS."
1780 .ds@set-format \\$@
1781 .\"
1782 .nr df*old-ll \\n[.l]
1783 .nr ds*ftmp \\n[.f]
1784 .misc@ev-keep df*ev
1785 .ft \\n[ds*ftmp]
1786 .\"
1787 .init@reset
1788 .di df*div
1789 'in 0
1790 .\"
1791 .ds@set-new-ev \\n[df*old-ll]
1792 .SP \\n[Lsp]u
1793 .nr df*float 1
1794 ..
1795 .\"--------------------------------------------
1796 .de df@end
1797 .br
1798 .SP \\n[Lsp]u
1799 .di
1800 .nr df*width!\\n+[df*fnr] \\n[dl]
1801 .nr df*height!\\n[df*fnr] \\n[dn]
1802 .nr df*wide!\\n[df*fnr] \\n[ds*wide]
1803 .nr df*format!\\n[df*fnr] \\n[ds*format]
1804 .ev
1805 .if \\n[D]>2 .tm DF:fnr=\\n[df*fnr] w=\\n[dl] h=\\n[dn] wide=\\n[ds*wide] \
1806  form=\\n[ds*format]
1807 .\"     move div to the floating display list
1808 .rn df*div df*fdiv!\\n[df*fnr]
1809 .\"
1810 .nr par@ind-flag 0
1811 .\" print float if queue is empty and the display fits into
1812 .\" the current page
1813 .if ((\\n[df*fnr]>=\\n[df*o-fnr])&(\\n[dn]<\\n[.t])) .df@print-float 1
1814 .nr df*float 0
1815 ..
1816 .\"-------------
1817 .\" called by end-of-text
1818 .de df@eot-print
1819 .br
1820 .if \\n[df*o-fnr]<=\\n[df*fnr] \{\
1821 .       if \\n[D]>2 .tm Print remaining displays.
1822 .\" still some floats left, make non-empty environment
1823 .       misc@ev-keep ne
1824 .       init@reset
1825 \c
1826 .       df@print-float 3
1827 .       ev
1828 .\}
1829 ..
1830 .\"---------------
1831 .\" print according to Df and De.
1832 .\" .df@print-float type
1833 .\"     type    called from
1834 .\"     1       .DE
1835 .\"     2       end of section
1836 .\"     3       end of document
1837 .\"     4       beginning of new page
1838 .\"
1839 .de df@print-float
1840 .if \\n[Df]>5 .@error "Df=\\n[Df], max value is 5"
1841 .if !\\n[ds*float-busy] \{\
1842 .       nr ds*float-busy 1
1843 .\" at .DE
1844 .       if \\n[D]>3 .tm print-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1845 .       \" Df = 1 or 5
1846 .       if (\\$1=1)&((\\n[Df]=1):(\\n[Df]=5)) \{\
1847 .               if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
1848 .                       \" Print only new displays.
1849 .                       if \\n[df*o-fnr]=\\n[df*fnr] \{\
1850 .                               br
1851 .                               ds@print-one-float
1852 .                       \}
1853 .               \}
1854 .       \}
1855 .       \" Df = 3
1856 .       if (\\$1=1)&(\\n[Df]=3) \{\
1857 .               if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
1858 .                       br
1859 .                       ds@print-one-float
1860 .               \}
1861 .       \}
1862 .\" print all if Df<2 and end of section
1863 .       if (\\$1=2)&(\\n[Sectp]>0)&(\\n[Df]<2) \{\
1864 .               br
1865 .               ds@print-all-floats
1866 .       \}
1867 .\" print all if end of document. Where should they go instead?
1868 .       if \\$1=3 \{\
1869 .               br
1870 .               ds@print-all-floats
1871 .\}
1872 .\" new page
1873 .       if (\\$1=4)&(\\n[Df]>1) \{\
1874 .               if \\n[Df]=2 .ds@print-one-float
1875 .               if \\n[Df]=3 .ds@print-one-float
1876 .               if \\n[Df]>3 \{\
1877 .                       ie \\n[De] .ds@print-all-floats
1878 .                       el .ds@print-this-page
1879 .               \}
1880 .       \}
1881 .       nr ds*float-busy 0
1882 .\}
1883 ..
1884 .\"---------------
1885 .\" DF out
1886 .\" print a floating diversion
1887 .de ds@output-float
1888 .nr df*old-ll \\n[.l]
1889 .nr df*old-in \\n[.i]
1890 .ev ds*fev
1891 .nf
1892 .nr df*i \\n[df*o-fnr]
1893 .nr df*f \\n[df*format!\\n[df*i]]
1894 .\"
1895 .in \\n[df*old-in]u
1896 .if \\n[df*f]=1 'in +\\n[Si]n
1897 .if \\n[df*f]>=2 'in 0
1898 .if \\n[df*f]=2 'ce 9999
1899 .if \\n[df*f]=3 'in (u;(\\n[.l]-\\n[df*width!\\n[df*i]])/2)
1900 .if \\n[df*f]=4 'rj 9999
1901 .if \\n[df*f]=5 'in (u;\\n[.l]-\\n[df*width!\\n[df*i]])
1902 .\"
1903 .\"
1904 .df*fdiv!\\n[df*o-fnr]
1905 .\"
1906 .if \\n[df*f]=2 'ce 0
1907 .if \\n[df*f]=4 'rj 0
1908 .ev
1909 .rm df*fdiv!\\n[df*i]
1910 .rm df*height!\\n[df*i]
1911 .rm df*format!\\n[df*i]
1912 .if \\n[df*wide!\\n[df*i]] .nr pg*head-mark \\n[nl]u
1913 .nr df*o-fnr +1
1914 ..
1915 .\"---------------
1916 .\" print one floating display if there is one.
1917 .de ds@print-one-float
1918 .if \\n[df*o-fnr]<=\\n[df*fnr] \{\
1919 .       if \\n[D]>3 .tm print-one-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1920 .       if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
1921 .       ds@output-float
1922 .       if \\n[De] .pg@next-page
1923 .\}
1924 ..
1925 .\"---------------
1926 .\" print all queued floats.
1927 .\" if De>0 do a page eject between the floats.
1928 .de ds@print-all-floats
1929 .while \\n[df*o-fnr]<=\\n[df*fnr] \{\
1930 .       if \\n[D]>3 .tm print-all-floats: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1931 .       if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
1932 .       br
1933 \c
1934 .       ds@output-float
1935 .       if \\n[De] .pg@next-page
1936 .\}
1937 ..
1938 .\"---------------
1939 .\" print as many floats as will fit on the current page
1940 .de ds@print-this-page
1941 .while \\n[df*o-fnr]<=\\n[df*fnr] \{\
1942 .       if \\n[D]>3 .tm print-this-page: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1943 .       if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .break
1944 .       ds@output-float
1945 .\}
1946 ..
1947 .\"---------------------------------------------------
1948 .\" get format of the display
1949 .de ds@set-format
1950 .ie \\n[.$] \{\
1951 .       ie r ds*format!\\$1 .nr ds*format \\n[ds*format!\\$1]
1952 .       el .@error "DS/DF:wrong format:\\$1"
1953 .\}
1954 .el .nr ds*format 0
1955 .if \\n[D]>2 .tm set format=\\n[ds*format]
1956 .\" fill or not to fill, that is the...
1957 .nr ds*fill 0
1958 .ie \\n[.$]>1 \{\
1959 .       ie r ds*fill!\\$2 .nr ds*fill \\n[ds*fill!\\$2]
1960 .       el .@error "\\*[ds*type]:wrong fill:\\$2"
1961 .\}
1962 .if \\n[D]>2 .tm set fill=\\n[ds*fill]
1963 .nr ds*rindent 0
1964 .if \\n[.$]>2 .nr ds*rindent \\$3
1965 .if \\n[D]>2 .tm set indent=\\n[ds*rindent]
1966 ..
1967 .\"-----------------------------
1968 .\" .ds@set-new-ev previous-line-length
1969 .de ds@set-new-ev
1970 .ll \\$1u
1971 .lt \\$1u
1972 .if \\n[ds*rindent] \{\
1973 .       ll -\\n[ds*rindent]n
1974 .       lt -\\n[ds*rindent]n
1975 .\}
1976 .if \\n[ds*wide] \{\
1977 .       ll \\n[@ll]u
1978 .       lt \\n[@ll]u
1979 .\}
1980 .\"
1981 .ie \\n[ds*fill] 'fi
1982 .el 'nf
1983 ..
1984 .\"--------------------------------------------------------
1985 .nr ds*format 0\"       dummy value for .En/.EQ
1986 .nr ds*format! 0\"      no indent
1987 .nr ds*format!0 0\"     no indent
1988 .nr ds*format!L 0\"     no indent
1989 .nr ds*format!I 1\"     indent
1990 .nr ds*format!1 1\"     indent
1991 .nr ds*format!C 2\"     center each line
1992 .nr ds*format!2 2\"     center each line
1993 .nr ds*format!CB 3\"    center as block
1994 .nr ds*format!3 3\"     center as block
1995 .nr ds*format!R 4\"     right justify each line
1996 .nr ds*format!4 4\"     right justify each line
1997 .nr ds*format!RB 5\"    right justify as block
1998 .nr ds*format!5 5\"     right justify as block
1999 .\"---------------
2000 .nr ds*fill! 0\"        no fill
2001 .nr ds*fill!N 0\"       no fill
2002 .nr ds*fill!0 0\"       no fill
2003 .nr ds*fill!F 1\"       fill on
2004 .nr ds*fill!1 1\"       fill on
2005 .\"--------------------------------------------
2006 .\" static display start
2007 .\" nested DS/DE is allowed. No limit on depth.
2008 .de DS
2009 .br
2010 .nr XXX \\n[nl]
2011 .nr ds*lvl +1
2012 .ds@set-format \\$@
2013 .\"
2014 .nr ds*old-ll \\n[.l]
2015 .nr ds*old-in \\n[.i]
2016 .misc@push ds-ll \\n[.l]
2017 .misc@push ds-form \\n[ds*format]
2018 .nr ds*i \\n[.i]
2019 .nr ds*ftmp \\n[.f]
2020 .misc@ev-keep ds*ev!\\n+[ds*snr]
2021 .ft \\n[ds*ftmp]
2022 .\"
2023 .init@reset
2024 .\" indent in a diversion doesn't seem like a good idea.
2025 'in 0
2026 .di ds*div!\\n[ds*snr]
2027 .\"
2028 .ds@set-new-ev \\n[ds*old-ll]
2029 .nr df*float 0
2030 ..
2031 .\"--------------------------------------------
2032 .de ds@end
2033 .if \\n-[ds*lvl]<0 .@error "DE: no corresponding DS"
2034 .br
2035 .di
2036 .\" **********
2037 .nr ds*width \\n[dl]
2038 .nr ds*height \\n[dn]
2039 .misc@pop-nr ds-ll ds*old-ll
2040 .misc@pop-nr ds-form ds*format
2041 .\"
2042 .\" **********
2043 'nf
2044 .\" calculate needed space
2045 .nr ds*need \\n[ds*height]
2046 .nr ds*i \\n[pg*foot-trap]-\\n[pg*header-size]u-\\n[pg*extra-header-size]u
2047 .if (\\n[ds*height]>\\n[ds*i])&(\\n[.t]<(\\n[ds*i]/2)) .nr ds*need \\n[.t]u+1v
2048 .if (\\n[ds*height]<\\n[ds*i])&(\\n[.t]<(\\n[ds*height])) .nr ds*need \\n[.t]u+1v
2049 .\"     Eject page if display will fit one page and
2050 .\"     there are less than half of the page left.
2051 .if \\n[ds*need] .ne \\n[ds*need]u
2052 .\"
2053 .\" check if pending equation label
2054 .eq@check \\n[ds*need]
2055 'in \\n[ds*old-in]u
2056 .if \\n[ds*format]=1 'in \\n[ds*old-in]u+\\n[Si]n
2057 .if \\n[ds*format]>=2 'in 0
2058 .if \\n[ds*format]=2 'ce 9999
2059 .if \\n[ds*format]=3 'in (u;(\\n[.l]-\\n[ds*width])/2)
2060 .if \\n[ds*format]=4 'rj 9999
2061 .if \\n[ds*format]=5 'in (u;\\n[.l]-\\n[ds*width])
2062 .\" **********
2063 .\"
2064 .\"     Print static display
2065 .nr ds*i \\n[Lsp]
2066 .if r Dsp .nr ds*i \\n[Dsp]
2067 .\"
2068 .if \\n[Ds] .sp \\n[ds*i]u
2069 .ds*div!\\n[ds*snr]
2070 .if \\n[Ds] .sp \\n[ds*i]u
2071 .\"
2072 .if \\n[ds*format]=2 'ce 0
2073 .if \\n[ds*format]=4 'rj 0
2074 .rm ds*div!\\n[ds*snr]
2075 .nr ds*snr -1
2076 .nr par@ind-flag 0
2077 .ev
2078 ..
2079 .\"########### module list ###################
2080 .\" .LI text-indent mark-indent pad type [mark [LI-space [LB-space] ] ]
2081 .\"
2082 .nr li*tind 0
2083 .nr li*mind 0
2084 .nr li*pad 0
2085 .nr li*type 0
2086 .ds li*mark 0
2087 .nr li*li-spc 0
2088 .nr li*lvl 0 1
2089 .aln :g li*lvl
2090 .nr li*cur-vpos 0
2091 .\"--------------------------
2092 .\"     the major list-begin macro.
2093 .\"     If type == -1 a 'break' will occur.
2094 .de LB
2095 .if \\n[.$]<4 .@error "LB: not enough arguments, min 4"
2096 .misc@push cind \\n[.i]
2097 .misc@push tind \\n[li*tind]
2098 .misc@push mind \\n[li*mind]
2099 .misc@push pad \\n[li*pad]
2100 .misc@push type \\n[li*type]
2101 .misc@push li-spc \\n[li*li-spc]
2102 .ds li*mark-list!\\n[li*lvl] \\*[li*mark]
2103 .nr li*lvl +1
2104 .\"
2105 .nr li*tind (n;0\\$1)\"                 text-indent
2106 .nr li*mind (n;0\\$2)\"                 mark-indent
2107 .nr li*pad (n;0\\$3)\"                  pad
2108 .nr li*type 0\\$4\"                     type
2109 .ds li*mark \\$5\"                      mark
2110 .ie !'\\$6'' .nr li*li-spc \\$6\"       LI-space
2111 .el .nr li*li-spc 1
2112 .ie !'\\$7'' .nr li*lb-spc \\$7\"       LB-space
2113 .el .nr li*lb-spc 0
2114 .\" init listcounter
2115 .nr li*cnt!\\n[li*lvl] 0 1
2116 .\" assign format
2117 .af li*cnt!\\n[li*lvl] 1
2118 .if \\n[li*type] .if !'\\*[li*mark]'' .af li*cnt!\\n[li*lvl] \\*[li*mark]
2119 .\"
2120 .if \\n[li*lb-spc] .SP (u;\\n[li*lb-spc]*\\n[Lsp])
2121 .in +\\n[li*tind]u
2122 ..
2123 .\"---------------
2124 .de LI
2125 .if \\n[li*lvl]<1 .@error "LI:no lists active"
2126 .if \\n[li*li-spc]&(\\n[Ls]>=\\n[li*lvl]) .SP (u;\\n[li*li-spc]*\\n[Lsp])
2127 .ne 2v
2128 .\"
2129 .ds li*c-mark \\*[li*mark]
2130 .nr li*cnt!\\n[li*lvl] +1
2131 .if \\n[li*type]=1 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]].
2132 .if \\n[li*type]=2 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]])
2133 .if \\n[li*type]=3 .ds li*c-mark (\\n[li*cnt!\\n[li*lvl]])
2134 .if \\n[li*type]=4 .ds li*c-mark [\\n[li*cnt!\\n[li*lvl]]]
2135 .if \\n[li*type]=5 .ds li*c-mark <\\n[li*cnt!\\n[li*lvl]]>
2136 .if \\n[li*type]=6 .ds li*c-mark {\\n[li*cnt!\\n[li*lvl]]}
2137 .if \\n[.$]=1 .ds li*c-mark \\$1
2138 .ie \\n[.$]=2 \{\
2139 .       ie (\\$2=2):(\\n[Limsp]=0) .ds li*c-mark \\$1\\*[li*c-mark]
2140 .       el .ds li*c-mark \\$1\ \\*[li*c-mark]
2141 .\}
2142 .\"
2143 .\" determine where the text begins
2144 .nr li*text-begin \\n[li*tind]>?\w@\\*[li*c-mark]\ @
2145 .nr x \w@\\*[li*c-mark]\ @
2146 .\"
2147 .\" determine where the mark begin
2148 .ie !\\n[li*pad] .nr li*in \\n[li*mind]
2149 .el .nr li*in \\n[li*text-begin]-\\n[li*pad]-\w@\\*[li*c-mark]@
2150 .if !\\n[li*in] .nr li*in 0
2151 .\"
2152 .ti -\\n[li*tind]u
2153 .\" no indentation if hanging indent
2154 .if (\w@\\*[li*c-mark]@=0)&((\\n[.$]=0):(\w@\\$1@=0)) .nr li*text-begin 0
2155 \Z'\&\h'\\n[li*in]u'\\*[li*c-mark]'\h'\\n[li*text-begin]u'\&\c
2156 .if \\n[li*type]=-1 .br
2157 ..
2158 .\"
2159 .\"-------------
2160 .de li@pop
2161 .nr li*lvl -1
2162 .misc@pop-nr cind li*tmp
2163 .in \\n[li*tmp]u
2164 .misc@pop-nr tind li*tind
2165 .misc@pop-nr mind li*mind
2166 .misc@pop-nr pad li*pad
2167 .misc@pop-nr type li*type
2168 .misc@pop-nr li-spc li*li-spc
2169 .ds li*mark \\*[li*mark-list!\\n[li*lvl]]
2170 ..
2171 .de LE
2172 .if \\n[li*lvl]<1 .@error "LE:mismatched"
2173 .li@pop
2174 .if '\\$1'1' .SP \\n[Lsp]u
2175 ..
2176 .\"-------------
2177 .\"     list status clear.
2178 .\"     terminate all lists to level i
2179 .de LC
2180 .ie \\n[.$]<1 .nr li*i 0
2181 .el .nr li*i \\$1
2182 .if \\n[li*i]>\\n[li*lvl] .@error "LC: incorrect argument: \\n[li*i] (too big)"
2183 .while \\n[li*lvl]>\\n[li*i] .li@pop
2184 .nr par@ind-flag 0
2185 ..
2186 .\"-------------
2187 .de AL
2188 .if \\n[.$]>3 .@error "AL: too many arguments"
2189 .if \\n[D]>2 .tm AL $*
2190 .ie \\n[.$]<=1 .LB \\n[Li] 0 2 1 "\\$1"
2191 .el \{\
2192 .       ie \\n[.$]=2 .LB 0\\$2 0 2 1 "\\$1"
2193 .       el \{\
2194 .               ie !'\\$2'' .LB \\$2 0 2 1 "\\$1" 0 1
2195 .               el .LB \\n[Li] 0 2 1 "\\$1" 0 1
2196 .       \}
2197 .\}
2198 ..
2199 .de ML
2200 .if \\n[.$]>3 .@error "ML: too many arguments"
2201 .if \\n[D]>2 .tm ML $*
2202 .nr li*ml-width \w@\\$1@u+1n
2203 .if \\n[.$]<2 .LB \\n[li*ml-width]u 0 1 0 "\\$1"
2204 .if \\n[.$]=2 .LB 0\\$2 0 1 0 "\\$1"
2205 .if \\n[.$]=3 \{\
2206 .       ie '\\$2'' .LB \\n[li*ml-width]u 0 1 0 "\\$1" 0 1
2207 .       el .LB \\n[Li] 0 1 0 "\\$1" 0 1
2208 .\}
2209 ..
2210 .de VL
2211 .if \\n[D]>2 .tm VL $*
2212 .if \\n[.$]>3 .@error "VL: too many arguments"
2213 .if \\n[.$]<1 .@error "VL: missing text-indent"
2214 .ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 0
2215 .el .LB 0\\$1 0\\$2 0 0 \& 0 1
2216 ..
2217 .\"     Bullet (for .BL)
2218 .de BL
2219 .if \\n[D]>2 .tm BL $*
2220 .ds BU \s-2\(bu\s0
2221 .if \\n[.$]>2 .@error "BL: too many arguments"
2222 .if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \\*[BU]
2223 .if \\n[.$]=1 .LB 0\\$1 0 1 0 \\*[BU]
2224 .if \\n[.$]=2 \{\
2225 .       ie '\\$1'' .LB \\n[Pi] 0 1 0 \\*[BU] 0 1
2226 .       el .LB 0\\$1 0 1 0 \\*[BU] 0 1
2227 .\}
2228 ..
2229 .de DL
2230 .if \\n[D]>2 .tm DL $*
2231 .if \\n[.$]>2 .@error "DL: too many arguments"
2232 .if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \(em
2233 .if \\n[.$]=1 .LB 0\\$1 0 1 0 \(em
2234 .if \\n[.$]=2 \{\
2235 .       ie '\\$1'' .LB \\n[Pi] 0 1 0 \(em 0 1
2236 .       el .LB 0\\$1 0 1 0 \(em 0 1
2237 .\}
2238 ..
2239 .de RL
2240 .if \\n[D]>2 .tm RL $*
2241 .if \\n[.$]>2 .@error "RL: too many arguments"
2242 .if \\n[.$]<1 .LB 6 0 2 4
2243 .if \\n[.$]=1 .LB 0\\$1 0 2 4
2244 .if \\n[.$]=2 \{\
2245 .       ie '\\$1'' .LB 6 0 2 4 1 0 1
2246 .       el .LB 0\\$1 0 2 4 1 0 1
2247 .\}
2248 ..
2249 .\" Broken Variable List. As .VL but text begin on the next line
2250 .de BVL
2251 .if \\n[D]>2 .tm BVL $*
2252 .if \\n[.$]>3 .@error "BVL: too many arguments"
2253 .if \\n[.$]<1 .@error "BVL: missing text-indent"
2254 .ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 -1
2255 .el .LB 0\\$1 0\\$2 0 -1 \& 0 1
2256 ..
2257 .\" ####### module tbl #######################################
2258 .\" This module is copied from groff_ms and modified for mgm.
2259 .\" Yes, it does not resemble the original anymore :-).
2260 .\" Don't know if I missed something important.
2261 .\" Groff_ms is written by James Clark.
2262 .nr tbl*have-header 0
2263 .nr tbl*header-written 0
2264 .de TS
2265 .br
2266 .if ''\\n[.z]' .SP
2267 .if '\\$1'H' .di tbl*header-div
2268 ..
2269 .de tbl@top-hook
2270 .if \\n[tbl*have-header] \{\
2271 .       ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl@print-header
2272 .       el .sp \\n[.t]u
2273 .\}
2274 ..
2275 .de tbl@bottom-hook
2276 .if \\n[tbl*have-header] \{\
2277 .       nr T. 1
2278 .\" draw bottom and side lines of boxed tables.
2279 .       T#
2280 .\}
2281 .nr tbl*header-written 0
2282 ..
2283 .de tbl@print-header
2284 .ev tbl*ev
2285 'nf
2286 .tbl*header-div
2287 .ev
2288 .mk #T
2289 .nr tbl*header-written 1
2290 ..
2291 .de TH
2292 .ie '\\n[.z]'tbl*header-div' \{\
2293 .       nr T. 0
2294 .       T#
2295 .       br
2296 .       di
2297 .       nr tbl*header-ht \\n[dn]
2298 .       ne \\n[dn]u+1v
2299 .       nr tbl*have-header 1
2300 .       ie '\\$1'N' .if !\\n[tbl*header-written] .tbl@print-header
2301 .       el .tbl@print-header
2302 .\}
2303 .el .@error ".TH without .TS H"
2304 ..
2305 .de TE
2306 .ie '\\n(.z'tbl*header-div' .@error ".TS H but no .TH before .TE"
2307 .el \{\
2308 .       nr tbl*have-header 0
2309 .\}
2310 .\" reset tabs
2311 .TAB
2312 ..
2313 .de T&
2314 ..
2315 .\" ####### module pic #######################################
2316 .de PS
2317 .nr pic*in 0
2318 .br
2319 .SP .5
2320 .ie \\n[.$]<2 .@error "PS: bad arguments. Probably not processed with pic."
2321 .el \{\
2322 .       if !\\n[ds*lvl] .ne (u;\\$1)+1v
2323 .\" should be contained between .DS/.DE
2324 .if r ds*format \{\
2325 .               if \\n[ds*lvl]&((\\n[ds*format]=2):(\\n[ds*format]=3)) \{\
2326 .                       nr pic*in \\n[.i]
2327 .\" .           in +(u;\\n[.l]-\\n[.i]-\\$2/2)
2328 .               \}
2329 .       \}
2330 .\}
2331 ..
2332 .de PE
2333 .init@reset
2334 .SP .5
2335 ..
2336 .\" ####### module eq #######################################
2337 .\" 
2338 .nr eq*number 0 1
2339 .ds eq*label
2340 .de EQ
2341 .ds eq*label "\\$1
2342 ..
2343 .de eq@check
2344 .if !'\\*[eq*label]'' \{\
2345 .       mk
2346 .       \" space down to middle of equation
2347 '       sp (u;\\$1/2)
2348 .       ie (\\n[Eq]%2) \{\
2349 .               \"      label to the left
2350 \h'|0'\\*[eq*label]
2351 .       \}
2352 .       el \{\
2353 .               \"      label to the right
2354 \h'|\\n[.l]u'\\*[eq*label]
2355 .       \}
2356 .       rt
2357 .\}
2358 .ds eq*label
2359 ..
2360 .de EN
2361 ..
2362 .\"########### module toc ###################
2363 .\" table of contents
2364 .nr toc*slevel 1
2365 .nr toc*spacing \n[Lsp]u
2366 .nr toc*tlevel 2
2367 .nr toc*tab 0
2368 .\"-----------
2369 .\" Table of contents with friends (module lix)
2370 .de TC
2371 .br
2372 .\" print any pending displays and references
2373 .df@print-float 3
2374 .if \\n[ref*flag] .RP 0 1
2375 .\"
2376 .if \w@\\$1@>0 .nr toc*slevel \\$1
2377 .if \w@\\$2@>0 .nr toc*spacing (u;\\$2*\\n[Lsp])
2378 .if \w@\\$3@>0 .nr toc*tlevel \\$3
2379 .if \w@\\$4@>0 .nr toc*tab \\$4
2380 .if \\n[pg*cols-per-page]>1 .1C
2381 .ds H1txt \\*[Licon]
2382 .ds Tcst co
2383 .pg@clear-hd
2384 .EF ""
2385 .OF ""
2386 .pg@next-page
2387 .\"-------------
2388 .if d Ci .toc@read-Ci \\*[Ci]
2389 .nf
2390 .in 0
2391 .ie \\n[Oc] .hd@set-page 1
2392 .el \{\
2393 .       nr toc*pn 1 1
2394 .       af toc*pn i
2395 .       aln ;g toc*pn
2396 .       PF "''\\\\\\\\n[toc*pn]''"
2397 .       am pg@header
2398 .               nr toc*pn +1
2399 \\..
2400 .\}
2401 .nr toc*i 4 1
2402 .while \\n+[toc*i]<10 \{\
2403 .       if !'\\$\\n[toc*i]'' \{\
2404 .               ce
2405 \\$\\n[toc*i]
2406 .               br
2407 .       \}
2408 .\}
2409 .if \\n[.$]<=4 .if d TX .TX
2410 .ie d TY .if \\n[.$]<=4 .TY
2411 .el \{\
2412 .       ce
2413 \\*[Licon]
2414 .       br
2415 .       SP 3
2416 .\}
2417 .if d toc*list .toc*list
2418 .br
2419 .\" print LIST OF XXX
2420 .if d lix*dsfg .lix@print-ds fg FG "\\*[Lf]" \\n[.$]
2421 .if d lix*dstb .lix@print-ds tb TB "\\*[Lt]" \\n[.$]
2422 .if d lix*dsec .lix@print-ds ec EC "\\*[Le]" \\n[.$]
2423 .if d lix*dsex .lix@print-ds ex EX "\\*[Lx]" \\n[.$]
2424 ..
2425 .\"-----------
2426 .\" .toc@read-Ci lev1 lev2 lev3 lev4 ... lev7
2427 .de toc@read-Ci
2428 .nr toc*i 0 1
2429 .while \\n+[toc*i]<8 \{\
2430 .       nr toc*hl!\\n[toc*i] \\$\\n[toc*i]
2431 .\}
2432 ..
2433 .\"-----------
2434 .de toc@entry
2435 .ie \\n[Sectp] \{\
2436 .       toc@save \\$1 "\\*[hd*mark]" "\\$2" \\*[hd*sect-pg]
2437 .\}
2438 .el .toc@save \\$1 "\\*[hd*mark]" "\\$2" \\n[%]
2439 ..
2440 .als )E toc@entry
2441 .\"-----------
2442 .de toc@save
2443 .\" collect maxsize of mark if string Ci don't exist.
2444 .if !d Ci \{\
2445 .       if !r toc*hl!\\$1 .nr toc*hl!\\$1 0
2446 .       if \\n[toc*hl!\\$1]<=\w@\\$2@ \{\
2447 .               nr toc*hl!\\$1 \w@\\$2@u
2448 .       \}
2449 .\}
2450 .am toc*list
2451 .\" .toc@set level headernumber text pagenr
2452 .toc@set \\$1 "\\$2" "\\$3" \\$4
2453 \\..
2454 ..
2455 .\"-----------
2456 .\" level mark text pagenumber
2457 .de toc@set
2458 .if \\$1<=\\n[toc*slevel] .SP \\n[toc*spacing]u
2459 .na
2460 .fi
2461 .nr toc*ind 0
2462 .nr toc*i 0 1
2463 .ie d Ci \{\
2464 .       nr toc*ind +\\n[toc*hl!\\$1]u
2465 .\}
2466 .el \{\
2467 .       while \\n+[toc*i]<\\$1 \{\
2468 .               nr toc*ind +\\n[toc*hl!\\n[toc*i]]u
2469 .       \}
2470 .\}
2471 .nr toc*text \\n[toc*ind]u+\\n[toc*hl!\\$1]u
2472 .in \\n[toc*text]u
2473 .ti -\\n[toc*hl!\\$1]u
2474 .\"
2475 .\" length of headernum space
2476 .nr toc*i \\n[toc*hl!\\$1]-\w@\\$2@
2477 .\"
2478 .ll \\n[@ll]u-\w@\\$4@u-2m
2479 .ne 2v
2480 .\" ragged right ---------------------------------
2481 .ie \\$1>\\n[toc*tlevel] \{\
2482 \\$2
2483 .       sp -1
2484 \\$3\ \ \ \\$4
2485 .       br
2486 .\}
2487 .el \{\
2488 .       \" unnumbered heading --------------------
2489 .       ie '\\$2'' \{\
2490 .               in \\n[toc*ind]u
2491 \\$3\h'1m'
2492 .       \}
2493 .       \" normal heading ------------------------
2494 .       el \{\
2495 \\$2
2496 .               sp -1
2497 \\$3\h'1m'
2498 .       \}
2499 .       ll \\n[@ll]u
2500 .       sp -1
2501 .       nr toc*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$4@)-1m
2502 \h'|\\n[.n]u'\l'\\n[toc*sep]u.'\h'1m'\\$4
2503 .\}
2504 .ll \\n[@ll]u
2505 ..
2506 .\"########################### module lix ############################
2507 .\" LIST OF figures, tables, exhibits and equations 
2508 .nr lix*fg-nr 0 1
2509 .nr lix*tb-nr 0 1
2510 .nr lix*ec-nr 0 1
2511 .nr lix*ex-nr 0 1
2512 .aln Fg lix*fg-nr
2513 .aln Tb lix*tb-nr
2514 .aln Ec lix*ec-nr
2515 .aln Ex lix*ex-nr
2516 .\"------------
2517 .de FG
2518 .lix@print-line fg Lf \\n+[lix*fg-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2519 ..
2520 .de TB
2521 .lix@print-line tb Lt \\n+[lix*tb-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2522 ..
2523 .de EC
2524 .lix@print-line ec Le \\n+[lix*ec-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2525 ..
2526 .de EX
2527 .lix@print-line ex Lx \\n+[lix*ex-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2528 ..
2529 .\"------------
2530 .\" print line with 'figure' in the text
2531 .\" type stringvar number text override flag refname
2532 .de lix@print-line
2533 .ds lix*text "\\$4
2534 .\"
2535 .ie \\n[Sectf] .ds lix*numb \\n[H1]-\\$3
2536 .el .ds lix*numb \\$3
2537 .\"
2538 .ie !\\n[Of] .ds lix*ds-form .\ \ \"
2539 .el .ds lix*ds-form "\ \(em\ \"
2540 .nr lix*in \\n[.i]
2541 .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\*[lix*ds-form]
2542 .if !'\\$5'' \{\
2543 .       if !0\\$6 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*numb]\\*[lix*ds-form]
2544 .       if 0\\$6=1 .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\$5\\*[lix*ds-form]
2545 .       if 0\\$6=2 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*ds-form]
2546 .\}
2547 .\" print line if not between DS/DE
2548 .ie \\n[ds*lvl]<1&\\n[df*float]=0 \{\
2549 .       lix@print-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
2550 .\}
2551 .el \{\
2552 .       lix@embedded-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
2553 .\}
2554 .\"
2555 ..
2556 .\"-----------
2557 .\" label text type stringvar refname
2558 .de lix@print-text
2559 .ie \\n[Sectp] .ds lix*pgnr \\*[hd*sect-pg]
2560 .el .ds lix*pgnr \\n[%]
2561 .SP \\n[Lsp]u
2562 .misc@ev-keep lix
2563 .init@reset
2564 .br
2565 .ie (\w@\\$1\\$2@)>(\\n[.l]-\\n[.i]) \{\
2566 .       in +\w@\\$1@u
2567 .       ti 0
2568 .\}
2569 .el .ce 1
2570 \fB\\$1\fP\\$2
2571 .br
2572 .ev
2573 .\" save line for LIST OF XXX, wth is the width of the label
2574 .if !r lix*wth\\$3 .nr lix*wth\\$3 0
2575 .\" find the maximum width
2576 .if \w@\\*[lix*label]@>\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
2577 .if \\n[\\$4] .lix@ds-save \\$3 \\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
2578 .\" save reference to the figure
2579 .if !'\\$5'' .SETR \\$5 \\*[lix*numb]
2580 ..
2581 .\" hide printout until diversion is evaluated
2582 .de lix@embedded-text
2583 \!.ie \\\\n[Sectp] .ds lix*pgnr \\\\*[hd*sect-pg]
2584 \!.el .ds lix*pgnr \\\\n[%]
2585 \!.SP \\\\n[Lsp]u
2586 \!.misc@ev-keep lix
2587 \!.ll \\n[.l]u
2588 \!.init@reset
2589 \!.fi
2590 \!.ie (\w@\\$1\\$2@)>(\\\\n[.l]-\\\\n[.i]) \{\
2591 .       in +\w@\\$1@u
2592 \!.     ti 0
2593 \!\fB\\$1\fP\\$2
2594 \!.\}
2595 \!.el \{\
2596 .       ce 1
2597 \!\fB\\$1\fP\\$2
2598 \!.\}
2599 \!.br
2600 \!.ev
2601 .\" save line for LIST OF XXX, wth is the width of the label
2602 \!.if !r lix*wth\\$3 .nr lix*wth\\$3 0
2603 .\" find the maximum width
2604 \!.if \w@\\*[lix*label]@>\\\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
2605 \!.if \\\\n[\\$4] .lix@ds-save \\$3 \\\\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
2606 .\" save reference to the figure
2607 \!.if !'\\$5'' .SETR \\$5 \\*[lix*numb]
2608 ..
2609 .\"------------
2610 .\" print complete list of XXXX
2611 .de lix@print-ds
2612 .\" arg: fg,tb,ec,ex text
2613 .ds H1txt \\$3
2614 .ds Tcst \\$1
2615 .if !\\n[Cp] .pg@next-page
2616 .\" print LIST OF XXXX
2617 .\" execute user-defined macros
2618 .if \\$4<=4 .if d TX\\$2 .TX\\$2
2619 .ie d TY\\$2 .if \\$4<=4 .TY\\$2
2620 .el \{\
2621 .       ce
2622 \\$3
2623 .       SP 3
2624 .\}
2625 .in \\n[lix*wth\\$1]u
2626 .fi
2627 .lix*ds\\$1
2628 ..
2629 .\"------------
2630 .\" save line of list in macro
2631 .de lix@ds-save
2632 .\" type pagenumber text
2633 .am lix*ds\\$1
2634 .lix@dsln \\$1 \\$2 "\\$3" "\\$4" \\$5
2635 \\..
2636 ..
2637 .\"------------
2638 .\" print appended macro
2639 .\" lix@dsln type pagenumber text headernr
2640 .de lix@dsln
2641 .nr lix*i \\n[lix*wth\\$1]-\w@\\$4@
2642 .ne 4v
2643 .ll \\n[@ll]u-\w@\\$4@u-\w@\\$2@u-2m
2644 .ti -\\n[lix*wth\\$1]u
2645 \\$4
2646 .sp -1
2647 \\$3\h'1m'
2648 .sp -1
2649 .ll
2650 .nr lix*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$2@)-1m
2651 \h'|\\n[.n]u'\l'\\n[lix*sep]u.'\h'1m'\\$2
2652 .SP \\n[toc*spacing]u
2653 ..
2654 .\"########################### module fnt ############################
2655 .\" some font macros.
2656 .de R
2657 .ft R
2658 .ul 0
2659 ..
2660 .\"-----------
2661 .de fnt@switch
2662 .ul 0
2663 .ds fnt*tmp
2664 .nr fnt*prev \\n[.f]
2665 .nr fnt*i 2 1
2666 .while \\n+[fnt*i]<=\\n[.$] \{\
2667 .       if \\n[fnt*i]>3 .as fnt*tmp \,
2668 .       ie (\\n[fnt*i]%2)=1 .as fnt*tmp \\$1\\$[\\n[fnt*i]]
2669 .       el .as fnt*tmp \\$2\\$[\\n[fnt*i]]
2670 .       if \\n[fnt*i]<\\n[.$] .as fnt*tmp \/
2671 .\}
2672 \&\\*[fnt*tmp]\f[\\n[fnt*prev]]
2673 ..
2674 .\"-----------
2675 .de B
2676 .ie \\n[.$] .fnt@switch \fB \f[\\n[.f]] \\$@
2677 .el .ft B
2678 ..
2679 .de I
2680 .ie \\n[.$] .fnt@switch \fI \f[\\n[.f]] \\$@
2681 .el .ft I
2682 ..
2683 .de IB
2684 .if \\n[.$] .fnt@switch \fI \fB \\$@
2685 ..
2686 .de BI
2687 .if \\n[.$] .fnt@switch \fB \fI \\$@
2688 ..
2689 .de IR
2690 .if \\n[.$] .fnt@switch \fI \fR \\$@
2691 ..
2692 .de RI
2693 .if \\n[.$] .fnt@switch \fR \fI \\$@
2694 ..
2695 .de RB
2696 .if \\n[.$] .fnt@switch \fR \fB \\$@
2697 ..
2698 .de BR
2699 .if \\n[.$] .fnt@switch \fB \fR \\$@
2700 ..
2701 .\"########################### module box ############################
2702 .\" draw a box around some text. Text will be kept on the same page.
2703 .\"
2704 .nr box*ll 0
2705 .\" .B1 and .B2 works like .DS
2706 .de B1
2707 .if \\n[box*ll] .@error "B1: missing B2"
2708 .nr box*ll \\n[.l]
2709 .nr box*ind \\n[.i]
2710 .nr box*hyp \\n[.hy]
2711 .nr box*wid \\n[.l]-\\n[.i]
2712 .\"
2713 .\" jump to new environment.
2714 .ev box*ev
2715 .di box*div
2716 .ps \\n[@ps]u
2717 .vs \\n[@vs]u
2718 .in 1n
2719 .ll (u;\\n[box*wid]-1n)
2720 .hy \\n[.hy]
2721 ..
2722 .de B2
2723 .if !\\n[box*ll] .@error "B2: missing B1"
2724 .br
2725 .di
2726 .nr box*height \\n[dn]
2727 .ne \\n[dn]u+1v
2728 .ll \\n[box*ll]u
2729 .in \\n[box*ind]u
2730 .nr box*y-pos \\n[.d]u
2731 .nf
2732 .box*div
2733 .fi
2734 \v'-1v+.25m'\
2735 \D'l \\n[box*wid]u 0'\
2736 \D'l 0 -\\n[box*height]u'\
2737 \D'l -\\n[box*wid]u 0'\
2738 \D'l 0 \\n[box*height]u'
2739 .br
2740 .sp -1
2741 .ev
2742 .sp .20v
2743 .in \\n[box*ind]u
2744 .ll \\n[box*ll]u
2745 .rm box*div
2746 .nr box*ll 0
2747 ..
2748 .\"########################### module ref ############################
2749 .nr ref*nr 0 1
2750 .aln :R ref*nr
2751 .nr ref*nr-width 5n
2752 .nr ref*flag 0          \" for end-of-text
2753 .ds Rf \v'-.4m'\s-3[\\n+[ref*nr]]\s0\v'.4m'
2754 .\"
2755 .\" start reference
2756 .\"------------
2757 .de RS
2758 .if !''\\$1' .ds \\$1 \v'-.4m'\s-3[\\n[ref*nr]]\s0\v'.4m'
2759 .nr ref*flag 1
2760 .am ref*mac
2761 .ref@start-print \\n[ref*nr]
2762 \\..
2763 .eo
2764 .am ref*mac RF
2765 ..
2766 .\"------------
2767 .de RF
2768 .ec
2769 .am ref*mac
2770 .ref@stop-print
2771 \\..
2772 ..
2773 .\"------------
2774 .de ref@start-print
2775 .di ref*div
2776 .in \\n[ref*nr-width]u
2777 .ti -(\w@\\$1.@u+1n)
2778 \\$1.
2779 .sp -1
2780 ..
2781 .de ref@stop-print
2782 .br
2783 .di
2784 .ne \\n[dn]u
2785 .ev ref*ev2
2786 .nf
2787 .ref*div
2788 .ev
2789 .rm ref*div
2790 .if \\n[Ls] .SP \\n[Lsp]u
2791 ..
2792 .\"-----------
2793 .de RP
2794 .if !d ref*mac .@error "RP: No references!"
2795 .nr ref*i 0\\$2
2796 .if \\n[ref*i]<2 .SK
2797 .SP 2
2798 .ref@print-refs
2799 .if 0\\$1<1 .nr ref*nr 0 1
2800 .if ((\\n[ref*i]=0):(\\n[ref*i]=2)) .SK
2801 ..
2802 .\"-----------
2803 .\" called by end-of-text!
2804 .de ref@eot-print
2805 .\".if \\n[ref*flag] \{
2806 .if d ref*mac \{\
2807 .       if \\n[D]>2 .tm Print references, called by eot
2808 .       nr ref*flag 0
2809 .       br
2810 .       misc@ev-keep ne
2811 .       init@reset
2812 \c
2813 '       bp
2814 .       ev
2815 .       ref@print-refs
2816 .\}
2817 ..
2818 .\"-----------
2819 .\" prints the references
2820 .de ref@print-refs
2821 .toc@save 1 "" "\\*[Rp]" \\n[%]
2822 .ce
2823 \fI\\*[Rp]\fP
2824 .sp
2825 .nr ref*ll \\n[.l]
2826 .misc@ev-keep ref*ev
2827 .ll \\n[ref*ll]u
2828 .in 0
2829 .ref*mac
2830 .in
2831 .rm ref*mac
2832 .ev
2833 .nr ref*flag 0 1
2834 ..
2835 .\"########################### module app ############################
2836 .\" 
2837 .nr app*nr 0 1
2838 .af app*nr A
2839 .nr app*dnr 0 1
2840 .nr app*flag 0
2841 .\"------------
2842 .\" .APP name text
2843 .\" name == "" -> autonumber
2844 .de APP
2845 .\" .if \\n[.$]<2 .@error "APP: too few arguments"
2846 .app@set-ind "\\$1"
2847 .\"
2848 .ds Tcst ap
2849 .ds Apptxt \\$2
2850 .\"
2851 .ie \\n[Aph] .app@header \\*[app*ind] "\\$2"
2852 .el .bp
2853 .app@index "\\*[app*ind]" "\\$2"
2854 ..
2855 .\"------------
2856 .\" .APPSK name pages text
2857 .\" name == "" -> autonumber
2858 .de APPSK
2859 .if \\n[.$]<2 .@error "APPSK: too few arguments"
2860 .app@set-ind "\\$1"
2861 .\"
2862 .ds Tcst ap
2863 .ds Apptxt \\$3
2864 .\"
2865 .ie \\n[Aph] .app@header \\*[app*ind] "\\$3"
2866 .el .bp
2867 .app@index "\\*[app*ind]" "\\$3"
2868 .pn +\\$2
2869 ..
2870 .\"------------
2871 .de app@set-ind
2872 .ie \w@\\$1@ .ds app*ind \\$1
2873 .el \{\
2874 .       if !\\n[app*flag] \{\
2875 .               nr H1 0 1
2876 .               af H1 A
2877 .               af H1h A
2878 .               nr app*flag 1
2879 .       \}
2880 .       ds app*ind \\n+[app*nr]
2881 .       nr H1 \\n+[app*dnr]
2882 .       nr H1h \\n[app*dnr] 
2883 .\}
2884 .\"     clear lower counters
2885 .nr app*i 1 1
2886 .while \\n+[app*i]<8 .nr H\\n[app*i] 0 1
2887 ..
2888 .\"------------
2889 .de app@index
2890 .toc@save 1 "" "\\*[App] \\$1: \\$2" \\n[%]
2891 ..
2892 .\"------------
2893 .\" app@heaer name text
2894 .de app@header
2895 .bp
2896 .SP (u;\\n[Lsp]*4)
2897 .ce 1
2898 \s+4\fB\\*[App]\ \\$1\fP\s0
2899 .SP (u;\\n[Lsp]*2)
2900 .if \w@\\$2@<\\n[.l] .ce 1
2901 \fB\s+2\\$2\s0\fP
2902 .SP (u;\\n[Lsp]*4)
2903 ..
2904 .als APPX app@header
2905 .\"########################### module cov ############################
2906 .\" title stored in diversion cov*title
2907 .\" abstract stored in diversion cov*abstract
2908 .\"     arg to abstract stored in cov*abs-arg
2909 .\"     indent stored in cov*abs-ind
2910 .\" number of authors stored in cov*au
2911 .\" author(s) stored in cov*au!x!y
2912 .\" author(s) title stored in cov*at!x!y
2913 .\"     x is the author-index [1-cov*au], y is the argument-index [1-9].
2914 .\" author(s) firm stored in cov*firm
2915 .\" new date (if .ND exists) is stored in cov*new-date
2916 .\"
2917 .\"
2918 .ds cov*abs-name ABSTRACT
2919 .\"
2920 .nr cov*au 0
2921 .de TL
2922 .rm IA IE WA WE LO LT
2923 .if \\n[.$]>0 .ds cov*title-charge-case \\$1
2924 .if \\n[.$]>1 .ds cov*title-file-case \\$2
2925 .pg@disable-top-trap
2926 .eo
2927 .de cov*title AU
2928 ..
2929 .\"-------------------
2930 .de cov@title-end
2931 .ec
2932 ..
2933 .\"-------------------
2934 .\" .AU name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]
2935 .de AU
2936 .cov@title-end
2937 .pg@disable-top-trap
2938 .nr cov*au +1
2939 .nr cov*i 0 1
2940 .ds cov*au!\\n[cov*au]!1
2941 .while \\n[.$]>=\\n+[cov*i] \{\
2942 .       ds cov*au!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
2943 .\}
2944 .if (\\n[.$]>=3)&(\w@\\$3@) \{\
2945 .       if d cov*location-\\$3] \{\
2946 .               ds cov*au!3!\\n[cov*au] \\*[cov*location-\\$3]
2947 .       \}
2948 .\}
2949 ..
2950 .\"-------------------
2951 .\" .AT title1 [title2 [... [title9] ]]]]
2952 .\" Well, thats all that COVEND look for.
2953 .\" Must appear directly after .AU
2954 .de AT
2955 .if \\n[.$]<1 .@error "AT: no arguments"
2956 .nr cov*i 0 1
2957 .while \\n[.$]>=\\n+[cov*i] \{\
2958 .       ds cov*at!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
2959 .\}
2960 ..
2961 .\"-------------------
2962 .de AF
2963 .cov@title-end
2964 .if !''\\$1' .ds cov*firm \\$1
2965 ..
2966 .de AST
2967 .ds cov*abs-name \\$1
2968 ..
2969 .de AS
2970 .pg@disable-top-trap
2971 .if d cov*abstract .@error "AS: only one abstract allowed"
2972 .if !''\\n[.z]' .@error "AS: no diversion allowed (previous .AS?)"
2973 .nr cov*abs-arg 0\\$1
2974 .nr cov*abs-ind (n;0\\$2)
2975 .de cov*abstract AE
2976 ..
2977 .de AE
2978 ..
2979 .\" fixed for 2000, now uses \n[year].
2980 .de ISODATE
2981 .       \" support for ISO-date
2982 .       nr cov*mm \\n[mo]
2983 .       nr cov*dd \\n[dy]
2984 .       af cov*mm 01
2985 .       af cov*dd 01
2986 .       ie '0'\\$1' \{\
2987 .               ds cov*new-date \\*[MO\\n[mo]] \\n[dy], \\n[year]
2988 .       \}
2989 .       el \{\
2990 .               ds cov*new-date \\n[year]-\\n[cov*mm]-\\n[cov*dd]
2991 .       \}
2992 ..
2993 .ISODATE 0
2994 .als DT cov*new-date
2995 .de ND
2996 .ds cov*new-date \\$1
2997 ..
2998 .\" switch to ISO-date if register Iso exist: YYYY-MM-DD
2999 .if r Iso .ISODATE 1
3000 .\"-------------------
3001 .\" save technical numbers.
3002 .de TM
3003 .nr cov*i 0 1
3004 .while \\n[.$]>=\\n+[cov*i] .ds cov*mt-tm!\\n[cov*i] \\$[\\n[cov*i]]
3005 .nr cov*mt-tm-max \\n[.$]
3006 ..
3007 .\"-----------------------
3008 .\" cover sheet
3009 .\" the file must have the following last lines (somewhere):
3010 .\" .pg@enable-top-trap
3011 .\" .bp 1
3012 .\" .pg@enable-trap
3013 .ds cov*mt-file!0 0.MT
3014 .ds cov*mt-file!1 0.MT
3015 .ds cov*mt-file!2 0.MT
3016 .ds cov*mt-file!3 0.MT
3017 .ds cov*mt-file!4 4.MT
3018 .ds cov*mt-file!5 5.MT
3019 .ds cov*mt-file!6 0.MT
3020 .\"------------
3021 .de MT
3022 .ie \\n[.$] \{\
3023 .       ie d cov*mt-file!\\$1 .ds cov*mt-type \\$1
3024 .       el .ds cov*mt-type 6
3025 .\}
3026 .el .ds cov*mt-type 1
3027 .ds cov*mt-addresse "\\$2
3028 .ds cov*mt-type-text "\\$1
3029 .ie d @language .ds cov*str mm/\\*[@language]_
3030 .el .ds cov*str mm/
3031 .mso \\*[cov*str]\\*[cov*mt-file!\\*[cov*mt-type]]
3032 ..
3033 .de COVER
3034 .ie !\\n[.$] .ds cov*cov-type ms
3035 .el .ds cov*cov-type \\$1
3036 .pg@disable-top-trap
3037 .ie d @language .ds cov*str mm/\\*[@language]_\\*[cov*cov-type].cov
3038 .el .ds cov*str mm/\\*[cov*cov-type].cov
3039 .mso \\*[cov*str]
3040 ..
3041 .\"########################### module qrf ############################
3042 .\" forward and backward reference thru special files.
3043 .\"
3044 .\" check if stderr-method is wanted
3045 .\" This was needed when I discovered that groff was considered unsafe
3046 .\" and groff -U didn't work. It's a workaround like the original
3047 .\" index method, but not in my view elegant enough.
3048 .\"
3049 .\" init reference system
3050 .de INITR
3051 .ds qrf*file \\$1.qrf
3052 .nr qrf*pass 2
3053 .if \\n[D]>1 .tm INITR: source \\*[qrf*file]
3054 .ie \\n[Ref] \{\
3055 .       tm .\\\\" Rfilename: \\*[qrf*file]
3056 .\}
3057 .el 'so  \\*[qrf*file]
3058 ..
3059 .\"---------------
3060 .\" set a reference.
3061 .de SETR
3062 .if \\n[.$]<1 .@error "SETR:reference name missing"
3063 .if !r qrf*pass .tm "SETR: No .INITR in this file"
3064 .if \\n[Ref] \{\
3065 .       ds qrf*name qrf*ref-\\$1
3066 .       if \\n[D]>2 .tm SETR: ref \\*[qrf*name]=\\*[hd*mark],\\n[%]
3067 .       \" heading-number
3068 .       ds \\*[qrf*name]-hn \\*[hd*mark]
3069 .       \" page-number
3070 .       ds \\*[qrf*name]-pn \\n[%]
3071 .       \"
3072 .       if \\n[Ref] \{\
3073 .               tm .ds \\*[qrf*name]-hn \\*[hd*mark]
3074 .               tm .ds \\*[qrf*name]-pn \\n[%]
3075 .               if !'\\$2'' .tm .ds \\*[qrf*name]-xx \\$2
3076 .       \}
3077 .\}
3078 ..
3079 .\"---------------
3080 .\" get misc-string
3081 .\" If two arg -> set var. arg to misc-string.
3082 .de GETST
3083 .if \\n[.$]<1 .@error "GETST:reference name missing"
3084 .if !r qrf*pass .tm "GETST: No .INITR in this file"
3085 .ds qrf*name qrf*ref-\\$1
3086 .       if d \\*[qrf*name]-xx \{\
3087 .               ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-xx]
3088 .               el \\*[\\*[qrf*name]-xx]\c
3089 .       \}
3090 .\}
3091 ..
3092 .\"---------------
3093 .\" get header-number
3094 .\" If two arg -> set var. arg to header-number.
3095 .de GETHN
3096 .if \\n[.$]<1 .@error "GETHN:reference name missing"
3097 .if !r qrf*pass .tm "GETHN: No .INITR in this file"
3098 .ds qrf*name qrf*ref-\\$1
3099 .if d \\*[qrf*name]-hn \{\
3100 .       ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-hn]
3101 .       el \\*[\\*[qrf*name]-hn]\c
3102 .\}
3103 ..
3104 .\"---------------
3105 .\" get page-number
3106 .\" If two arg -> set var. arg to page-number.
3107 .de GETPN
3108 .if \\n[.$]<1 .@error "GETPN:reference name missing"
3109 .if !r qrf*pass .tm "GETPN: No .INITR in this file"
3110 .ds qrf*name qrf*ref-\\$1
3111 .if d \\*[qrf*name]-pn \{\
3112 .       ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-pn]
3113 .       el \\*[\\*[qrf*name]-pn]\c
3114 .\}
3115 ..
3116 .\"----------
3117 .de GETR
3118 .if \\n[.$]<1 .@error "GETR:reference name missing"
3119 .ie !r qrf*pass \{\
3120 .       tm "GETR: No .INITR in this file"
3121 .\}
3122 .el \{\
3123 .       GETHN \\$1 Qrfh
3124 .       GETPN \\$1 Qrfp
3125 \\*[Qrf]
3126 .\}
3127 ..
3128 .\"########################### module ind ############################
3129 .\" Support for mgs-style indexing, borrowed from mgs.
3130 .de IX
3131 .       tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[%]
3132 ..
3133 .\"--------------------
3134 .\" Another type of index system
3135 .\" INITI type filename [macro]
3136 .de INITI
3137 .if \\n[.$]<1 .@error "INITI:type missing"
3138 .\" ignore if INITI has already been used
3139 .if \\n[.$]>1 \{\
3140 .       if d ind*file .@error "INITI:file already set"
3141 .       ds ind*file \\$2.ind
3142 .       if \\n[D]>1 .tm INITI: source \\*[ind*file]
3143 .\}
3144 .if !d ind*file .@error "INITI:file not specified"
3145 .ds ind*type \\$1
3146 .if \\n[Ref] \{\
3147 .       if \\n[.$]>2 .tm .\\\\" Imacro: \\$3
3148 .\}
3149 ..
3150 .\"---------------
3151 .de IND
3152 .if !d ind*file .@error "IND: No active INITI"
3153 .if \\n[D]>1 .tm IND: type=\\*[ind*type]
3154 .ds ind*ref
3155 .if '\\*[ind*type]'N' .ds ind*ref \\n[%]
3156 .if '\\*[ind*type]'H' .ds ind*ref \\*[hd*mark]
3157 .if '\\*[ind*type]'B' .ds ind*ref \\*[hd*mark]\t\\n[%]
3158 .if '\\*[ind*ref]'' .@error "IND:wrong index type: \\*[ind*ref]"
3159 .\"
3160 .ds ind*line \\$1
3161 .while \\n[.$]>0 \{\
3162 .       shift
3163 .       as ind*line \t\\$1
3164 .\}
3165 .as ind*line \\*[ind*ref]
3166 .if \\n[Ref] .tm .\\\\" IND \\*[ind*line]
3167 ..
3168 .\" print index
3169 .de INDP
3170 .ie \\n[Ref] .tm .\\\\" Index: \\*[ind*file]
3171 .el \{\
3172 .       if !\\n[Cp] .pg@next-page
3173 .       \" print INDEX
3174 .       \" execute user-defined macros
3175 .       if d TXIND .TXIND
3176 .       ie d TYIND .TYIND
3177 .       el \{\
3178 .               SK
3179 .               ce
3180 \\*[Index]
3181 .               SP 3
3182 .               2C
3183 .               nf
3184 .       \}
3185 '       so  \\*[ind*file]
3186 .       ie d TZIND .TZIND
3187 .       el \{\
3188 .               fi
3189 .               1C
3190 .       \}
3191 .\}
3192 .rm ind*file
3193 ..
3194 .\"########################### module let ############################
3195 .\" Letter macros
3196 .\"------------------------
3197 .\" Formal closing
3198 .de FC
3199 .df@print-float 3
3200 .ie \\n[.$] .ds let*i \\$1
3201 .el .ds let*i \\*[Letfc]
3202 .ie d let*type .let@fc_\\*[let*type] "\\*[let*i]" \\$@
3203 .el .let@mt-closing "\\*[let*i]" \\$@
3204 ..
3205 .\"-------
3206 .de let@mt-closing
3207 .ne 5v
3208 .in (u;\\n[.l]/2)
3209 .sp
3210 \\$1
3211 .in
3212 ..
3213 .\"------------------------
3214 .\" Signature line
3215 .de SG
3216 .ie d let*type .let*lt-sign \\$@
3217 .el .let*mt-sign \\$@
3218 ..
3219 .\"------------------------
3220 .de let*lt-sign
3221 .if !d let@sg_\\*[let*type] .@error "SG: letter type \\*[let*type] undefined"
3222 .df@print-float 3
3223 .nr let*i 0 1
3224 .nr let*j 0
3225 .while \\n+[let*i]<=\\n[let*wa-n] \{\
3226 .if \\n[let*i]=\\n[let*wa-n] .nr let*j 1
3227 .let@sg_\\*[let*type] "\\*[let*wa-name!\\n[let*i]]" "\\*[let*wa-title!\\n[let*i]]" \\n[let*i] \\n[let*j] \\$@
3228 .\}
3229 ..
3230 .\"------------------------
3231 .\" Memorandum signature
3232 .de let*mt-sign
3233 .df@print-float 3
3234 .ne \\n[cov*au]u*4v
3235 .ie \\n[.$]>1 .nr let*k 1
3236 .el .nr let*k \\n[cov*au]
3237 .ds let*tmp \\*[cov*au!\\n[let*k]!3]-\\*[cov*au!\\n[let*k]!4]-
3238 .nr let*i 0 1
3239 .while \\n+[let*i]<=\\n[cov*au] \{\
3240 .       if \\n[let*i]>1 .as let*tmp /
3241 .       as let*tmp \\*[cov*au!\\n[let*k]!2]
3242 .\}
3243 .if !''\\$1' .as let*tmp -\\$1
3244 .in (u;\\n[.l]/2)
3245 .nf
3246 .nr let*i 0 1
3247 .while \\n+[let*i]<=\\n[cov*au] \{\
3248 .       SP 3v
3249 .       if \\n[let*i]=\\n[let*k] \{\
3250 \Z'\h'-(u;\\n[.l]/2)'\\*[let*tmp]'\c
3251 .       \}
3252 \\*[cov*au!\\n[let*i]!1]
3253 .\}
3254 .fi
3255 .in
3256 ..
3257 .\"------------------------
3258 .\" Approval signature
3259 .de AV
3260 .ne 6v
3261 .nf
3262 .sp
3263 .ie \\n[.$]<2 \\*[Letapp]
3264 .el .sp
3265 .sp 2
3266 .ie n ______________________________      ______________
3267 .el \D'l 25m 0'\h'4m'\D'l 12m 0'
3268 \Z'\\$1'\h'29m'\f[\\*[@sdf_font]]\\*[Letdate]\fP
3269 .fi
3270 ..
3271 .\"------------------------
3272 .\" Letter signature
3273 .de AVL
3274 .ne 6v
3275 .nf
3276 .sp 3
3277 .ie n ______________________________
3278 .el \D'l 25m 0'
3279 \Z'\\$1'
3280 .fi
3281 ..
3282 .\"------------------------
3283 .\" Letter type
3284 .\" let@header is called from the header. It is supposed
3285 .\" to remove the alias itself.
3286 .de LT
3287 .rm AF AS AE AT AU CS OK TL MT
3288 .ds let*type BL
3289 .nr Pi 5
3290 .nr Pt 0
3291 .if !''\\$1' .ds let*type \\$1
3292 .if !d let@head_\\*[let*type] .@error "LT: unknown letter type \\$1"
3293 .shift
3294 .als let@header let@head_\\*[let*type]
3295 .let@init_\\*[let*type] \\$@
3296 .if \n[D]>1 .tm Letter type \\*[let*type]
3297 ..
3298 .\"-----------
3299 .\" Blocked letter
3300 .de let@init_BL
3301 ..
3302 .de let@head_BL
3303 .rm let@header
3304 .let@print-head 1
3305 ..
3306 .de let@sg_BL
3307 .ne 5v
3308 .nf
3309 .in (u;\\n[.l]/2)
3310 .sp 3v
3311 \\$1
3312 \\$2
3313 .in
3314 .if \\$4 .sp
3315 .if \w'\\$5'&\\$4 \\$5
3316 .fi
3317 ..
3318 .als let@fc_BL let@mt-closing
3319 .\"-----------
3320 .\" Semiblocked letter
3321 .de let@init_SB
3322 .nr Pt 1
3323 ..
3324 .de let@head_SB
3325 .rm let@header
3326 .let@print-head 1
3327 ..
3328 .als let@sg_SB let@sg_BL
3329 .als let@fc_SB let@mt-closing
3330 .\"-----------
3331 .\" Full-blocked letter
3332 .de let@init_FB
3333 ..
3334 .de let@head_FB
3335 .rm let@header
3336 .let@print-head
3337 ..
3338 .de let@sg_FB
3339 .ne 5v
3340 .nf
3341 .sp 3v
3342 \\$1
3343 \\$2
3344 .if \\$4 .sp
3345 .if \w'\\$5'&\\$4 \\$5
3346 .fi
3347 ..
3348 .de let@fc_FB
3349 .ne 5v
3350 .sp
3351 \\$1
3352 ..
3353 .\"-----------
3354 .\" Simplified letter
3355 .de let@init_SP
3356 ..
3357 .de let@head_SP
3358 .rm let@header
3359 .let@print-head
3360 ..
3361 .de let@sg_SP
3362 .nf
3363 .if \\$3=1 .sp
3364 .sp
3365 .misc@toupper "\\$1, \\$2"
3366 .if \\$4 .sp
3367 .if \w'\\$5'&\\$4 \\$5
3368 .fi
3369 ..
3370 .de let@fc_SP
3371 .sp 2
3372 ..
3373 .\"--------------------------------------
3374 .\" Print the letter-head
3375 .de let@print-head
3376 .nf
3377 .sp |11
3378 .if '1'\\$1' .in (u;\\n[.l]/2)
3379 .\" ---- WA
3380 .ie d let@wa-div .let@wa-div
3381 .el .sp 3
3382 .\" ---- datum
3383 \\*[cov*new-date]
3384 .sp
3385 .if '1'\\$1' .if !d let*lo-CN .if !d let*lo-RN .sp 2
3386 .\" ---- Confidential
3387 .if d let*lo-CN \{\
3388 .       ti 0
3389 .       ie !''\\*[let*lo-CN]' \\*[let*lo-CN]
3390 .       el \\*[LetCN]
3391 .       sp
3392 .\}
3393 .\" ---- Reference
3394 .if d let*lo-RN \{\
3395 \\*[LetRN] \\*[let*lo-RN]
3396 .       sp
3397 .\}
3398 .\" ---- IA
3399 .sp
3400 .in 0
3401 .nr let*i 0 1
3402 .while \\n+[let*i]<=\\n[let*ia-n] \{\
3403 \\*[let*ia-name!\\n[let*i]]
3404 \\*[let*ia-title!\\n[let*i]]
3405 .\}
3406 .if d let@ia-div .let@ia-div
3407 .\" ---- Attention
3408 .if d let*lo-AT \{\
3409 .       sp
3410 \\*[LetAT] \\*[let*lo-AT]
3411 .\}
3412 .\" ---- Salutation
3413 .if !'\\*[let*type]'SP' .if d let*lo-SA \{\
3414 .       sp
3415 .       ti 0
3416 .       ie !''\\*[let*lo-SA]' \\*[let*lo-SA]
3417 .       el \\*[LetSA]
3418 .\}
3419 .\" ---- Subject
3420 .if d let*lo-SJ \{\
3421 .       ie '\\*[let*type]'SP' \{\
3422 .               sp 2
3423 .               misc@toupper \\*[let*lo-SJ]
3424 .               sp
3425 .       \}
3426 .       el \{\
3427 .               sp
3428 .               if '\\*[let*type]'SB' .ti +5m
3429 \\*[LetSJ] \f[\\*[@sdf_font]]\\*[let*lo-SJ]\fP
3430 .       \}
3431 .\}
3432 ..
3433 .\"-------------------
3434 .\" .IA [name [title]]
3435 .nr let*ia-n 0 1
3436 .de IA
3437 .if \\n[.$] .ds let*ia-name!\\n+[let*ia-n] \\$1
3438 .if \\n[.$]>1 .ds let*ia-title!\\n[let*ia-n] \\$2
3439 .ev let@ev
3440 .init@reset
3441 'nf
3442 .di let@ia-div
3443 .eo
3444 ..
3445 .de IE
3446 .di
3447 .ec
3448 .ev
3449 ..
3450 .\"-------------------
3451 .\" .WA [name [title]]
3452 .nr let*wa-n 0 1
3453 .de WA
3454 .if \\n[.$] .ds let*wa-name!\\n+[let*wa-n] \\$1
3455 .if \\n[.$]>1 .ds let*wa-title!\\n[let*wa-n] \\$2
3456 .ev let@ev
3457 .init@reset
3458 'nf
3459 .di let@wa-div
3460 .it \\n[Letwam] let@wa-drain
3461 .eo
3462 ..
3463 .\"------
3464 .de let@wa-drain
3465 .it
3466 .di
3467 .di let@wa-junk
3468 ..
3469 .\"------
3470 .de WE
3471 .it
3472 .ec
3473 .di
3474 .ev
3475 .if d let@wa-junk .rm let@wa-junk
3476 ..
3477 .\"-------------------
3478 .\" Copy to
3479 .de NS
3480 .sp
3481 .ie !''\\$2' .ds let*str \\$1
3482 .el \{\
3483 .       ie \\n[.$]>0 \{\
3484 .               ie !\w'\\$1' .ds let*str \\*[Letns!\\*[Letnsdef]]
3485 .               el \{\
3486 .                       ie d Letns!\\$1 .ds let*str \\*[Letns!\\$1]
3487 .                       el .ds let*str \\*[Letns!copy](\\$1)\\*[Letns!to]
3488 .               \}
3489 .       \}
3490 .       el .ds let*str \\*[Letns!\\*[Letnsdef]]
3491 .\}
3492 .ne 2
3493 .nf
3494 \\*[let*str]
3495 ..
3496 .de NE
3497 .fi
3498 ..
3499 .\"-------------------
3500 .\" Letter options
3501 .de LO
3502 .rm AF AS AE AT AU CS OK TL MT
3503 .if ''\\$1' .@error "LO: missing option"
3504 .if !d Let\\$1 .@error "LO: unknown option (\\$1)"
3505 .ds let*lo-\\$1 \\$2
3506 .if \n[D]>1 .tm Letter option \\$1 \\$2
3507 ..
3508 .\"--------------------
3509 .\" Start with a clean slate
3510 .init@reset