Merge from vendor branch OPENSSL:
[dragonfly.git] / contrib / groff / contrib / mm / m.tmac
1 .\"  
2 .de @revision
3 .ds RE \\$2
4 ..
5 .\"
6 .\" $Id: m.tmac,v 2.15 2002/08/07 23:23:34 wlemb Exp $
7 .@revision $Revision: 2.15 $
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)
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*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.])
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
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 .\" check if there are any bottom block
1273 .if d pg*block-div .pg@block
1274 .\"
1275 .\" print the footer and eject new page
1276 .ev pg*tl-ev
1277 .pg@set-env
1278 .\" user defined end-of-page macro
1279 .ie d EOP .EOP
1280 .el \{\
1281 .       ie o .tl \\*[pg*odd-footer]
1282 .       el .tl \\*[pg*even-footer]
1283 .       ie (\\n[%]=1)&(\\n[N]=1) .tl \\*[pg*header]
1284 .       el .tl \\*[pg*footer]
1285 .       tl ''\\*[Pg_type!\\n[@copy_type]]''
1286 .\}
1287 .ev
1288 .\" be sure that floating displays and footnotes will be
1289 .\" printed at the end of the document.
1290 .ie (\\n[df*fnr]>=\\n[df*o-fnr]):\\n[ft*exist] \{\
1291 .       ev ne
1292 '       bp
1293 .       ev
1294 .\}
1295 .el 'bp
1296 ..
1297 .\"-------------------------
1298 .\"
1299 .\" Initialize the title environment
1300 .de pg@set-env
1301 'na
1302 'nh
1303 'in 0
1304 'ti 0
1305 .ie \\n[Pgps] \{\
1306 .       ps \\n[@ps]u
1307 .       vs \\n[@vs]u
1308 .\}
1309 .el \{\
1310 .       ps \\n[pg*ps]u
1311 .       vs \\n[pg*vs]u
1312 .\}
1313 .lt \\n[@ll]u
1314 ..
1315 .\"-------------------------
1316 .de PH
1317 .ds pg*header "\\$1
1318 .pg@set-new-size
1319 ..
1320 .de PF
1321 .ds pg*footer "\\$1
1322 .pg@set-new-size
1323 ..
1324 .de OH
1325 .ds pg*odd-header "\\$1
1326 .pg@set-new-size
1327 ..
1328 .de EH
1329 .ds pg*even-header "\\$1
1330 .pg@set-new-size
1331 ..
1332 .de OF
1333 .ds pg*odd-footer "\\$1
1334 .pg@set-new-size
1335 ..
1336 .de EF
1337 .ds pg*even-footer "\\$1
1338 .pg@set-new-size
1339 ..
1340 .de pg@clear-hd
1341 .ds pg*even-header
1342 .ds pg*odd-header
1343 .ds pg*header
1344 ..
1345 .de pg@clear-ft
1346 .ds pg*even-footer
1347 .ds pg*odd-footer
1348 .ds pg*footer
1349 ..
1350 .de pg@set-new-size
1351 .nr pg*ps \\n[@ps]
1352 .nr pg*vs \\n[@vs]
1353 .pg@move-trap
1354 ..
1355 .\"-------------------------
1356 .\" end of page processing
1357 .de pg@footnotes
1358 .\".debug footnotes
1359 .\" output footnotes. set trap for block
1360 .\"
1361 ..
1362 .\"-------------------------
1363 .\" print bottom block
1364 .de pg@block
1365 .ev pg*block-ev
1366 'nf
1367 'in 0
1368 .ll 100i
1369 .pg*block-div
1370 .br
1371 .ev
1372 ..
1373 .\"-------------------------
1374 .\" define bottom block
1375 .de BS
1376 .misc@ev-keep pg*block-ev
1377 .init@reset
1378 .br
1379 .di pg*block-div
1380 ..
1381 .\"-------------------------
1382 .de BE
1383 .br
1384 .di
1385 .nr pg*block-size \\n[dn]u
1386 .ev
1387 .pg@move-trap
1388 ..
1389 .\"-------------------------
1390 .\" print out all pending text
1391 .de pg@end-of-text
1392 .if \\n[D]>2 .tm ---------- End of text processing ----------------
1393 .df@eot-print
1394 .ref@eot-print
1395 ..
1396 .\"-------------------------
1397 .\" set top and bottom margins 
1398 .\" -T  sets pg*footer-size and pg*header-size instead
1399 .de VM
1400 .ie '\\$1'-T' \{\
1401 .       shift
1402 .       if \\n[.$]=0 \{\
1403 .               nr pg*footer-size 5v
1404 .               nr pg*header-size 7v
1405 .       \}
1406 .       if \\n[.$]>0 .nr pg*header-size (v;\\$1)
1407 .       if \\n[.$]>1 .nr pg*footer-size (v;\\$2)
1408 .\}
1409 .el \{\
1410 .       if \\n[.$]=0 \{\
1411 .               nr pg*extra-footer-size 0
1412 .               nr pg*extra-header-size 0
1413 .       \}
1414 .       if \\n[.$]>0 .nr pg*extra-header-size (v;\\$1)
1415 .       if \\n[.$]>1 .nr pg*extra-footer-size (v;\\$2)
1416 .       if \\n[D]>2 \{\
1417 .               tm extra top \\n[pg*extra-footer-size]
1418 .               tm extra bottom \\n[pg*extra-header-size]
1419 .       \}
1420 .\}
1421 .pg@move-trap
1422 ..
1423 .\"---------------------
1424 .\" multicolumn output. 
1425 .de pg@set-po
1426 .if \\n[pg*cols-per-page]>1 \{\
1427 .       ll \\n[pg*column-size]u
1428 .\}
1429 ..
1430 .de pg@inc-po
1431 .if \\n[pg*cols-per-page]>1 \{\
1432 .       ie \\n+[pg*cur-column]>=\\n[pg*cols-per-page] \{\
1433 .               nr pg*cur-column 0 1
1434 .               nr pg*cur-po \\n[@po]u
1435 .               po \\n[@po]u
1436 .               ll \\n[@ll]u
1437 .       \}
1438 .       el \{\
1439 .               nr pg*cur-po +(\\n[pg*column-size]u+\\n[pg*column-sep]u)
1440 .               po \\n[pg*cur-po]u
1441 '               sp |\\n[pg*head-mark]u
1442 .               tbl@top-hook
1443 .       \}
1444 .\}
1445 ..
1446 .\" An argument disables the page-break.
1447 .de 1C
1448 .br
1449 .if \\n[pg*cols-per-page]<=1 .@error "1C: multicolumn mode not active"
1450 .nr pg*cols-per-page 1
1451 .nr pg*column-sep 0
1452 .nr pg*column-size \\n[@ll]
1453 .nr pg*ncol-i \\n[pg*cur-column]\"      temp variable
1454 .nr pg*cur-column 0 1
1455 .nr pg*cur-po \\n[@po]u
1456 .PGFORM
1457 .ie !'\\$1'1' .SK
1458 .el \{\
1459 .       if d ft*div \{\
1460 .               if \\n[pg*ncol-i]>0 \{\
1461 .                       @warning 1C: footnotes will be messy
1462 .               \}
1463 .       \}
1464 .       if \\n[pg*last-ncol]>0 \{\
1465 .               sp |\\n[pg*last-ncol]u
1466 .               nr pg*last-ncol 0
1467 .       \}
1468 .\}
1469 ..
1470 .de 2C
1471 .br
1472 .nr pg*head-mark \\n[nl]u
1473 .if \\n[pg*cols-per-page]>1 .@error "2C: multicolumn mode already active"
1474 .nr pg*cols-per-page 2
1475 .nr pg*column-sep \\n[@ll]/15
1476 .nr pg*column-size (\\n[@ll]u*7)/15
1477 .nr pg*cur-column 0 1
1478 .nr pg*cur-po \\n[@po]u
1479 .ll \\n[pg*column-size]u
1480 .\" .lt \\n[pg*column-size]u
1481 ..
1482 .\" MC column-size [ column-separation ]
1483 .de MC
1484 .br
1485 .nr pg*head-mark \\n[nl]u
1486 .if \\n[pg*cols-per-page]>1 .@error "MC: multicolumn mode already active"
1487 .ie ''\\$1' .nr pg*column-size \\n[.l]
1488 .el .nr pg*column-size (n;\\$1)
1489 .ie ''\\$2' .nr pg*column-sep \\n[pg*column-size]/15
1490 .el .nr pg*column-sep (n;\\$2)
1491 .\"
1492 .\" calculate the number of columns/page
1493 .nr pg*cols-per-page 0
1494 .nr pg*i \\n[pg*column-size]
1495 .while \\n[pg*i]<=\\n[.l] \{\
1496 .       nr pg*cols-per-page \\n[pg*cols-per-page]+1
1497 .       nr pg*i \\n[pg*i]+\\n[pg*column-sep]+\\n[pg*column-size]
1498 .\}
1499 .nr pg*cur-column 0 1
1500 .nr pg*cur-po \\n[@po]u
1501 .ll \\n[pg*column-size]u
1502 .\" .lt \\n[pg*column-size]u
1503 ..
1504 .\" begin a new column
1505 .de NCOL
1506 .br
1507 .if \\n[nl]>\\n[pg*last-ncol] .nr pg*last-ncol \\n[nl]
1508 .pg@footer
1509 ..
1510 .\" skip pages
1511 .de SK
1512 .br
1513 .bp
1514 .nr pg*i 0 1
1515 .\" force new page by writing something invisible.
1516 .while \\n+[pg*i]<=(0\\$1) \{\
1517 \&
1518 .       bp
1519 .\}
1520 ..
1521 .\"-------------------------------
1522 .\" MULB width1 space1 width2 space2 width3 space3 ...
1523 .de MULB
1524 .br
1525 .nr pg*i 0 1
1526 .nr pg*mul-x 0 1
1527 .nr pg*mul-ind 0
1528 .nr pg*mul-last 0
1529 .while \\n[.$] \{\
1530 .       nr pg*mul!\\n+[pg*i] (n;0\\$1)
1531 .       nr pg*muls!\\n[pg*i] (n;0\\$2)
1532 .       shift 2
1533 .\}
1534 .nr pg*mul-max-col \\n[pg*i]
1535 .ds pg*mul-fam \\n[.fam]
1536 .nr pg*mul-font \\n[.f]
1537 .ev pg*mul-ev
1538 .ps \\n[@ps]u
1539 .vs \\n[@vs]u
1540 .fam \\*[pg*mul-fam]
1541 .ft \\n[pg*mul-font]
1542 .fi
1543 .hy 14
1544 .di pg*mul-div
1545 .MULN
1546 ..
1547 .\"-----------
1548 .de MULN
1549 .if \\n[pg*mul-x]>=\\n[pg*mul-max-col] .@error "MULN: Undefined columnwidth"
1550 .br
1551 .if \\n[.d]>\\n[pg*mul-last] .nr pg*mul-last \\n[.d]
1552 .rt +0
1553 .in \\n[pg*mul-ind]u
1554 .ll (u;\\n[.i]+\\n[pg*mul!\\n+[pg*mul-x]])u
1555 .nr pg*mul-ind +(u;\\n[pg*mul!\\n[pg*mul-x]]+\\n[pg*muls!\\n[pg*mul-x]])
1556 ..
1557 .\"-----------
1558 .\" MULE
1559 .de MULE
1560 .br
1561 .if \\n[.d]>\\n[pg*mul-last] .nr pg*mul-last \\n[.d]
1562 .di
1563 .ev
1564 .ne \\n[pg*mul-last]u
1565 .nf
1566 .mk
1567 .pg*mul-div
1568 .rt
1569 .sp \\n[pg*mul-last]u
1570 .fi
1571 ..
1572 .\"-----------
1573 .de OP
1574 .br
1575 .ie o .if !\\n[pg*head-mark]=\\n[nl] \{\
1576 .       bp +1
1577 .       bp +1
1578 .\}
1579 .el .bp
1580 ..
1581 .\"########### module footnotes ###################
1582 .nr ft*note-size 0
1583 .nr ft*busy 0
1584 .nr ft*nr 0 1
1585 .nr ft*wide 0
1586 .nr ft*hyphen 0\"       hyphenation value
1587 .nr ft*adjust 1\"       >0 if adjust true
1588 .nr ft*indent 1\"       >0 if text indent true (not imp. $$$)
1589 .nr ft*just 0\" 0=left justification, 1=right (not imp. $$$)
1590 .nr ft*exist 0\"        not zero if there are any footnotes to be printed
1591 .nr ft*clear-at-header 0\" >0 if footnotes should be reset at first level head.
1592 .\"
1593 .ds F \v'-.4m'\s-3\\n+[ft*nr]\s0\v'.4m'
1594 .\"
1595 .\"-----------------
1596 .\" init footnote environment
1597 .de ft@init
1598 .\" indentcontrol not implemented $$$
1599 .\" label justification not implemented $$$
1600 'in 0
1601 'fi
1602 .ie \\n[ft*adjust] 'ad
1603 .el 'na
1604 .ie \\n[ft*hyphen] 'hy 14
1605 .el 'hy 0
1606 .ll \\n[@cur-ll]u
1607 .lt \\n[@cur-ll]u
1608 .ps (p;\\n[@ps]u-2)
1609 .vs (p;\\n[@vs]u-1)
1610 ..
1611 .\"-----------------
1612 .\" set footnote format
1613 .\" no support for two column processing (yet). $$$
1614 .de FD
1615 .if \\n[.$]=0 .@error "FD: bad arg \\$1"
1616 .ie \\n[.$]=2 .nr ft*clear-at-header 1
1617 .el .nr ft*clear-at-header 0
1618 .\"
1619 .if !'\\$1'' \{\
1620 .       ie \\$1>11 .nr ft*format 0
1621 .       el .nr ft*format \\$1
1622 .       \"
1623 .       nr ft*hyphen (\\n[ft*format]%2)*14
1624 .       nr ft*format \\n[ft*format]/2
1625 .       \"
1626 .       nr ft*adjust 1-(\\n[ft*format]%2)
1627 .       nr ft*format \\n[ft*format]/2
1628 .       \"
1629 .       nr ft*indent 1-(\\n[ft*format]%2)
1630 .       nr ft*format \\n[ft*format]/2
1631 .       \"
1632 .       nr ft*just \\n[ft*format]%2
1633 .\}
1634 ..
1635 .\"---------------
1636 .\" Footnote and display width control $$$
1637 .de WC
1638 .nr ft*i 0 1
1639 .while \\n+[ft*i]<=\\n[.$] \{\
1640 .       ds ft*x \\$[\\n[ft*i]]
1641 .       if '\\*[ft*x]'N' \{\
1642 .               nr ft*wide 0
1643 .               nr ft*first-fn 0
1644 .               nr ds*wide 0
1645 .               nr ds*float-break 1
1646 .       \}
1647 .       if '\\*[ft*x]'-WF' .nr ft*wide 0
1648 .       if '\\*[ft*x]'WF' .nr ft*wide 1
1649 .       if '\\*[ft*x]'-FF' .nr ft*first-fn 0
1650 .       if '\\*[ft*x]'FF' .nr ft*first-fn 1
1651 .       if '\\*[ft*x]'-WD' \{\
1652 .               nr ds*wide 0
1653 .               if r ft*df-save \{\
1654 .                       nr Df \\n[ft*df-save]
1655 .                       rm ft*df-save 
1656 .               \}
1657 .       \}
1658 .       if '\\*[ft*x]'WD' \{\
1659 .               nr ds*wide 1
1660 .               nr ft*df-save \\n[Df]
1661 .               nr Df 4
1662 .       \}
1663 .       if '\\*[ft*x]'-FB' .nr ds*float-break 0
1664 .       if '\\*[ft*x]'FB' .nr ds*float-break 1
1665 .       if \\n[D]>1 .tm WC WF=\\n[ft*wide] WD=\\n[ds*wide]
1666 .\}
1667 ..
1668 .\"-----------------
1669 .\" begin footnote
1670 .\" Change environment, switch to diversion and print the foot-note mark.
1671 .de FS
1672 .if \\n[ft*busy] .@error "FS: missing FE"
1673 .nr ft*busy 1
1674 .ev ft*ev
1675 .ft@init
1676 .if !\\n[ft*wide] .pg@set-po
1677 .di ft*tmp-div
1678 .nr ft*space (u;\\n[Fs]*\\n[Lsp])
1679 .sp \\n[ft*space]u
1680 .\" print mark
1681 .ie \\n[.$] .ds ft*mark \\$1
1682 .el .ds ft*mark \\n[ft*nr].
1683 \\*[ft*mark]
1684 .in +.75c
1685 .sp -1
1686 .nr ft*exist 1
1687 ..
1688 .\"-----------------
1689 .\" init footnote diversion
1690 .de ft@init-footnote
1691 .di ft*div
1692 \l'20n'
1693 .br
1694 .di
1695 .nr ft*note-size \\n[dn]
1696 ..
1697 .\"-----------------
1698 .\" end footnote
1699 .\" End the diversion, back to previous environment, and adjust
1700 .\" the trap to the new foot-note size.
1701 .de FE
1702 .nr ft*busy 0
1703 .br
1704 .di
1705 'in 0
1706 'nf
1707 .if \\n[@pl]u<\\n[dn]u .@error "FE: too big footnote"
1708 .if !d ft*div .nr dn +1v
1709 .if \\n[D]>3 .tm FE: foot-trap=\\n[pg*foot-trap] .d=\\n[.d] dn=\\n[dn]
1710 .ie (\\n[pg*foot-trap]u-\\n[.d]u)<\\n[dn]u \{\
1711 .       da ft*next-div
1712 .       ft*tmp-div
1713 .       br
1714 .       di
1715 .\}
1716 .el \{\
1717 .       if !d ft*div .ft@init-footnote
1718 .       da ft*div
1719 .       ft*tmp-div
1720 .       di
1721 .       nr ft*note-size +\\n[dn]
1722 .\}
1723 .rm ft*tmp-div
1724 .ev
1725 .pg@move-trap
1726 ..
1727 .\"-----------------
1728 .\" print footnotes, see pg@footer
1729 .de ft@print
1730 .ev ft*print-ev
1731 'nf
1732 'in 0
1733 .ll 100i
1734 .ft*div
1735 .br
1736 .ev
1737 .rm ft*div
1738 .nr ft*note-size 0
1739 .pg@move-trap
1740 ..
1741 .\"-----------------
1742 .\" check if any pending footnotes, see pg@header
1743 .de ft@check-old
1744 .if d ft*next-div \{\
1745 .       ev ft*ev
1746 .       ft@init
1747 .       ft@init-footnote
1748 .       nf
1749 .       in 0
1750 .       da ft*div
1751 .       ft*next-div
1752 .       di
1753 .       nr ft*note-size +\\n[dn]
1754 .       rm ft*next-div
1755 .       ev
1756 .       nr ft*exist 0
1757 .       pg@move-trap
1758 .\}
1759 ..
1760 .\"########### module display ###################
1761 .nr ds*wide 0\"         >0 if wide displays wanted
1762 .nr df*fnr 0 1\"        floating display counter
1763 .nr df*o-fnr 1\"        floating display counter, already printed
1764 .nr ds*snr 0 1\"        static display counter
1765 .nr ds*lvl 0 1\"        display level
1766 .nr ds*float-busy 0\"   >0 if printing float
1767 .nr df*float 0          >0 if previous display was floating
1768 .\"--------------------------------------------
1769 .de DE
1770 .ie \\n[df*float] .df@end \\$@
1771 .el .ds@end \\$@
1772 ..
1773 .\"--------------------------------------------
1774 .\" floating display start
1775 .\" nested DF/DE is not allowed.
1776 .de DF
1777 .if \\n[df*float] .@error "DF:nested floating is not allowed. Use DS."
1778 .ds@set-format \\$@
1779 .\"
1780 .nr df*old-ll \\n[.l]
1781 .nr ds*ftmp \\n[.f]
1782 .misc@ev-keep df*ev
1783 .ft \\n[ds*ftmp]
1784 .\"
1785 .init@reset
1786 .di df*div
1787 'in 0
1788 .\"
1789 .ds@set-new-ev \\n[df*old-ll]
1790 .SP \\n[Lsp]u
1791 .nr df*float 1
1792 ..
1793 .\"--------------------------------------------
1794 .de df@end
1795 .br
1796 .SP \\n[Lsp]u
1797 .di
1798 .nr df*width!\\n+[df*fnr] \\n[dl]
1799 .nr df*height!\\n[df*fnr] \\n[dn]
1800 .nr df*wide!\\n[df*fnr] \\n[ds*wide]
1801 .nr df*format!\\n[df*fnr] \\n[ds*format]
1802 .ev
1803 .if \\n[D]>2 .tm DF:fnr=\\n[df*fnr] w=\\n[dl] h=\\n[dn] wide=\\n[ds*wide] \
1804  form=\\n[ds*format]
1805 .\"     move div to the floating display list
1806 .rn df*div df*fdiv!\\n[df*fnr]
1807 .\"
1808 .nr par@ind-flag 0
1809 .\" print float if queue is empty and the display fits into
1810 .\" the current page
1811 .if ((\\n[df*fnr]>=\\n[df*o-fnr])&(\\n[dn]<\\n[.t])) .df@print-float 1
1812 .nr df*float 0
1813 ..
1814 .\"-------------
1815 .\" called by end-of-text
1816 .de df@eot-print
1817 .br
1818 .if \\n[df*o-fnr]<=\\n[df*fnr] \{\
1819 .       if \\n[D]>2 .tm Print remaining displays.
1820 .\" still some floats left, make non-empty environment
1821 .       misc@ev-keep ne
1822 .       init@reset
1823 \c
1824 .       df@print-float 3
1825 .       ev
1826 .\}
1827 ..
1828 .\"---------------
1829 .\" print according to Df and De.
1830 .\" .df@print-float type
1831 .\"     type    called from
1832 .\"     1       .DE
1833 .\"     2       end of section
1834 .\"     3       end of document
1835 .\"     4       beginning of new page
1836 .\"
1837 .de df@print-float
1838 .if \\n[Df]>5 .@error "Df=\\n[Df], max value is 5"
1839 .if !\\n[ds*float-busy] \{\
1840 .       nr ds*float-busy 1
1841 .\" at .DE
1842 .       if \\n[D]>3 .tm print-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1843 .       \" Df = 1 or 5
1844 .       if (\\$1=1)&((\\n[Df]=1):(\\n[Df]=5)) \{\
1845 .               if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
1846 .                       \" Print only new displays.
1847 .                       if \\n[df*o-fnr]=\\n[df*fnr] \{\
1848 .                               br
1849 .                               ds@print-one-float
1850 .                       \}
1851 .               \}
1852 .       \}
1853 .       \" Df = 3
1854 .       if (\\$1=1)&(\\n[Df]=3) \{\
1855 .               if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
1856 .                       br
1857 .                       ds@print-one-float
1858 .               \}
1859 .       \}
1860 .\" print all if Df<2 and end of section
1861 .       if (\\$1=2)&(\\n[Sectp]>0)&(\\n[Df]<2) \{\
1862 .               br
1863 .               ds@print-all-floats
1864 .       \}
1865 .\" print all if end of document. Where should they go instead?
1866 .       if \\$1=3 \{\
1867 .               br
1868 .               ds@print-all-floats
1869 .\}
1870 .\" new page
1871 .       if (\\$1=4)&(\\n[Df]>1) \{\
1872 .               if \\n[Df]=2 .ds@print-one-float
1873 .               if \\n[Df]=3 .ds@print-one-float
1874 .               if \\n[Df]>3 \{\
1875 .                       ie \\n[De] .ds@print-all-floats
1876 .                       el .ds@print-this-page
1877 .               \}
1878 .       \}
1879 .       nr ds*float-busy 0
1880 .\}
1881 ..
1882 .\"---------------
1883 .\" DF out
1884 .\" print a floating diversion
1885 .de ds@output-float
1886 .nr df*old-ll \\n[.l]
1887 .nr df*old-in \\n[.i]
1888 .ev ds*fev
1889 .nf
1890 .nr df*i \\n[df*o-fnr]
1891 .nr df*f \\n[df*format!\\n[df*i]]
1892 .\"
1893 .in \\n[df*old-in]u
1894 .if \\n[df*f]=1 'in +\\n[Si]n
1895 .if \\n[df*f]>=2 'in 0
1896 .if \\n[df*f]=2 'ce 9999
1897 .if \\n[df*f]=3 'in (u;(\\n[.l]-\\n[df*width!\\n[df*i]])/2)
1898 .if \\n[df*f]=4 'rj 9999
1899 .if \\n[df*f]=5 'in (u;\\n[.l]-\\n[df*width!\\n[df*i]])
1900 .\"
1901 .\"
1902 .df*fdiv!\\n[df*o-fnr]
1903 .\"
1904 .if \\n[df*f]=2 'ce 0
1905 .if \\n[df*f]=4 'rj 0
1906 .ev
1907 .rm df*fdiv!\\n[df*i]
1908 .rm df*height!\\n[df*i]
1909 .rm df*format!\\n[df*i]
1910 .if \\n[df*wide!\\n[df*i]] .nr pg*head-mark \\n[nl]u
1911 .nr df*o-fnr +1
1912 ..
1913 .\"---------------
1914 .\" print one floating display if there is one.
1915 .de ds@print-one-float
1916 .if \\n[df*o-fnr]<=\\n[df*fnr] \{\
1917 .       if \\n[D]>3 .tm print-one-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1918 .       if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
1919 .       ds@output-float
1920 .       if \\n[De] .pg@next-page
1921 .\}
1922 ..
1923 .\"---------------
1924 .\" print all queued floats.
1925 .\" if De>0 do a page eject between the floats.
1926 .de ds@print-all-floats
1927 .while \\n[df*o-fnr]<=\\n[df*fnr] \{\
1928 .       if \\n[D]>3 .tm print-all-floats: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1929 .       if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
1930 .       br
1931 \c
1932 .       ds@output-float
1933 .       if \\n[De] .pg@next-page
1934 .\}
1935 ..
1936 .\"---------------
1937 .\" print as many floats as will fit on the current page
1938 .de ds@print-this-page
1939 .while \\n[df*o-fnr]<=\\n[df*fnr] \{\
1940 .       if \\n[D]>3 .tm print-this-page: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
1941 .       if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .break
1942 .       ds@output-float
1943 .\}
1944 ..
1945 .\"---------------------------------------------------
1946 .\" get format of the display
1947 .de ds@set-format
1948 .ie \\n[.$] \{\
1949 .       ie r ds*format!\\$1 .nr ds*format \\n[ds*format!\\$1]
1950 .       el .@error "DS/DF:wrong format:\\$1"
1951 .\}
1952 .el .nr ds*format 0
1953 .if \\n[D]>2 .tm set format=\\n[ds*format]
1954 .\" fill or not to fill, that is the...
1955 .nr ds*fill 0
1956 .ie \\n[.$]>1 \{\
1957 .       ie r ds*fill!\\$2 .nr ds*fill \\n[ds*fill!\\$2]
1958 .       el .@error "\\*[ds*type]:wrong fill:\\$2"
1959 .\}
1960 .if \\n[D]>2 .tm set fill=\\n[ds*fill]
1961 .nr ds*rindent 0
1962 .if \\n[.$]>2 .nr ds*rindent \\$3
1963 .if \\n[D]>2 .tm set indent=\\n[ds*rindent]
1964 ..
1965 .\"-----------------------------
1966 .\" .ds@set-new-ev previous-line-length
1967 .de ds@set-new-ev
1968 .ll \\$1u
1969 .lt \\$1u
1970 .if \\n[ds*rindent] \{\
1971 .       ll -\\n[ds*rindent]n
1972 .       lt -\\n[ds*rindent]n
1973 .\}
1974 .if \\n[ds*wide] \{\
1975 .       ll \\n[@ll]u
1976 .       lt \\n[@ll]u
1977 .\}
1978 .\"
1979 .ie \\n[ds*fill] 'fi
1980 .el 'nf
1981 ..
1982 .\"--------------------------------------------------------
1983 .nr ds*format 0\"       dummy value for .En/.EQ
1984 .nr ds*format! 0\"      no indent
1985 .nr ds*format!0 0\"     no indent
1986 .nr ds*format!L 0\"     no indent
1987 .nr ds*format!I 1\"     indent
1988 .nr ds*format!1 1\"     indent
1989 .nr ds*format!C 2\"     center each line
1990 .nr ds*format!2 2\"     center each line
1991 .nr ds*format!CB 3\"    center as block
1992 .nr ds*format!3 3\"     center as block
1993 .nr ds*format!R 4\"     right justify each line
1994 .nr ds*format!4 4\"     right justify each line
1995 .nr ds*format!RB 5\"    right justify as block
1996 .nr ds*format!5 5\"     right justify as block
1997 .\"---------------
1998 .nr ds*fill! 0\"        no fill
1999 .nr ds*fill!N 0\"       no fill
2000 .nr ds*fill!0 0\"       no fill
2001 .nr ds*fill!F 1\"       fill on
2002 .nr ds*fill!1 1\"       fill on
2003 .\"--------------------------------------------
2004 .\" static display start
2005 .\" nested DS/DE is allowed. No limit on depth.
2006 .de DS
2007 .br
2008 .nr XXX \\n[nl]
2009 .nr ds*lvl +1
2010 .ds@set-format \\$@
2011 .\"
2012 .nr ds*old-ll \\n[.l]
2013 .nr ds*old-in \\n[.i]
2014 .misc@push ds-ll \\n[.l]
2015 .misc@push ds-form \\n[ds*format]
2016 .nr ds*i \\n[.i]
2017 .nr ds*ftmp \\n[.f]
2018 .misc@ev-keep ds*ev!\\n+[ds*snr]
2019 .ft \\n[ds*ftmp]
2020 .\"
2021 .init@reset
2022 .\" indent in a diversion doesn't seem like a good idea.
2023 'in 0
2024 .di ds*div!\\n[ds*snr]
2025 .\"
2026 .ds@set-new-ev \\n[ds*old-ll]
2027 .nr df*float 0
2028 ..
2029 .\"--------------------------------------------
2030 .de ds@end
2031 .if \\n-[ds*lvl]<0 .@error "DE: no corresponding DS"
2032 .br
2033 .di
2034 .\" **********
2035 .nr ds*width \\n[dl]
2036 .nr ds*height \\n[dn]
2037 .misc@pop-nr ds-ll ds*old-ll
2038 .misc@pop-nr ds-form ds*format
2039 .\"
2040 .\" **********
2041 'nf
2042 .\" calculate needed space
2043 .nr ds*need \\n[ds*height]
2044 .nr ds*i \\n[pg*foot-trap]-\\n[pg*header-size]u-\\n[pg*extra-header-size]u
2045 .if (\\n[ds*height]>\\n[ds*i])&(\\n[.t]<(\\n[ds*i]/2)) .nr ds*need \\n[.t]u+1v
2046 .if (\\n[ds*height]<\\n[ds*i])&(\\n[.t]<(\\n[ds*height])) .nr ds*need \\n[.t]u+1v
2047 .\"     Eject page if display will fit one page and
2048 .\"     there are less than half of the page left.
2049 .if \\n[ds*need] .ne \\n[ds*need]u
2050 .\"
2051 .\" check if pending equation label
2052 .eq@check \\n[ds*need]
2053 'in \\n[ds*old-in]u
2054 .if \\n[ds*format]=1 'in \\n[ds*old-in]u+\\n[Si]n
2055 .if \\n[ds*format]>=2 'in 0
2056 .if \\n[ds*format]=2 'ce 9999
2057 .if \\n[ds*format]=3 'in (u;(\\n[.l]-\\n[ds*width])/2)
2058 .if \\n[ds*format]=4 'rj 9999
2059 .if \\n[ds*format]=5 'in (u;\\n[.l]-\\n[ds*width])
2060 .\" **********
2061 .\"
2062 .\"     Print static display
2063 .nr ds*i \\n[Lsp]
2064 .if r Dsp .nr ds*i \\n[Dsp]
2065 .\"
2066 .if \\n[Ds] .sp \\n[ds*i]u
2067 .ds*div!\\n[ds*snr]
2068 .if \\n[Ds] .sp \\n[ds*i]u
2069 .\"
2070 .if \\n[ds*format]=2 'ce 0
2071 .if \\n[ds*format]=4 'rj 0
2072 .rm ds*div!\\n[ds*snr]
2073 .nr ds*snr -1
2074 .nr par@ind-flag 0
2075 .ev
2076 ..
2077 .\"########### module list ###################
2078 .\" .LI text-indent mark-indent pad type [mark [LI-space [LB-space] ] ]
2079 .\"
2080 .nr li*tind 0
2081 .nr li*mind 0
2082 .nr li*pad 0
2083 .nr li*type 0
2084 .ds li*mark 0
2085 .nr li*li-spc 0
2086 .nr li*lvl 0 1
2087 .aln :g li*lvl
2088 .nr li*cur-vpos 0
2089 .\"--------------------------
2090 .\"     the major list-begin macro.
2091 .\"     If type == -1 a 'break' will occur.
2092 .de LB
2093 .if \\n[.$]<4 .@error "LB: not enough arguments, min 4"
2094 .misc@push cind \\n[.i]
2095 .misc@push tind \\n[li*tind]
2096 .misc@push mind \\n[li*mind]
2097 .misc@push pad \\n[li*pad]
2098 .misc@push type \\n[li*type]
2099 .misc@push li-spc \\n[li*li-spc]
2100 .ds li*mark-list!\\n[li*lvl] \\*[li*mark]
2101 .nr li*lvl +1
2102 .\"
2103 .nr li*tind (n;0\\$1)\"                 text-indent
2104 .nr li*mind (n;0\\$2)\"                 mark-indent
2105 .nr li*pad (n;0\\$3)\"                  pad
2106 .nr li*type 0\\$4\"                     type
2107 .ds li*mark \\$5\"                      mark
2108 .ie !'\\$6'' .nr li*li-spc \\$6\"       LI-space
2109 .el .nr li*li-spc 1
2110 .ie !'\\$7'' .nr li*lb-spc \\$7\"       LB-space
2111 .el .nr li*lb-spc 0
2112 .\" init listcounter
2113 .nr li*cnt!\\n[li*lvl] 0 1
2114 .\" assign format
2115 .af li*cnt!\\n[li*lvl] 1
2116 .if \\n[li*type] .if !'\\*[li*mark]'' .af li*cnt!\\n[li*lvl] \\*[li*mark]
2117 .\"
2118 .if \\n[li*lb-spc] .SP (u;\\n[li*lb-spc]*\\n[Lsp])
2119 .in +\\n[li*tind]u
2120 ..
2121 .\"---------------
2122 .de LI
2123 .if \\n[li*lvl]<1 .@error "LI:no lists active"
2124 .if \\n[li*li-spc]&(\\n[Ls]>=\\n[li*lvl]) .SP (u;\\n[li*li-spc]*\\n[Lsp])
2125 .ne 2v
2126 .\"
2127 .ds li*c-mark \\*[li*mark]
2128 .nr li*cnt!\\n[li*lvl] +1
2129 .if \\n[li*type]=1 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]].
2130 .if \\n[li*type]=2 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]])
2131 .if \\n[li*type]=3 .ds li*c-mark (\\n[li*cnt!\\n[li*lvl]])
2132 .if \\n[li*type]=4 .ds li*c-mark [\\n[li*cnt!\\n[li*lvl]]]
2133 .if \\n[li*type]=5 .ds li*c-mark <\\n[li*cnt!\\n[li*lvl]]>
2134 .if \\n[li*type]=6 .ds li*c-mark {\\n[li*cnt!\\n[li*lvl]]}
2135 .if \\n[.$]=1 .ds li*c-mark \\$1
2136 .ie \\n[.$]=2 \{\
2137 .       ie (\\$2=2):(\\n[Limsp]=0) .ds li*c-mark \\$1\\*[li*c-mark]
2138 .       el .ds li*c-mark \\$1\ \\*[li*c-mark]
2139 .\}
2140 .\"
2141 .\" determine where the text begins
2142 .nr li*text-begin \\n[li*tind]>?\w@\\*[li*c-mark]\ @
2143 .nr x \w@\\*[li*c-mark]\ @
2144 .\"
2145 .\" determine where the mark begin
2146 .ie !\\n[li*pad] .nr li*in \\n[li*mind]
2147 .el .nr li*in \\n[li*text-begin]-\\n[li*pad]-\w@\\*[li*c-mark]@
2148 .if !\\n[li*in] .nr li*in 0
2149 .\"
2150 .ti -\\n[li*tind]u
2151 .\" no indentation if hanging indent
2152 .if (\w@\\*[li*c-mark]@=0)&((\\n[.$]=0):(\w@\\$1@=0)) .nr li*text-begin 0
2153 \Z'\&\h'\\n[li*in]u'\\*[li*c-mark]'\h'\\n[li*text-begin]u'\&\c
2154 .if \\n[li*type]=-1 .br
2155 ..
2156 .\"
2157 .\"-------------
2158 .de li@pop
2159 .nr li*lvl -1
2160 .misc@pop-nr cind li*tmp
2161 .in \\n[li*tmp]u
2162 .misc@pop-nr tind li*tind
2163 .misc@pop-nr mind li*mind
2164 .misc@pop-nr pad li*pad
2165 .misc@pop-nr type li*type
2166 .misc@pop-nr li-spc li*li-spc
2167 .ds li*mark \\*[li*mark-list!\\n[li*lvl]]
2168 ..
2169 .de LE
2170 .if \\n[li*lvl]<1 .@error "LE:mismatched"
2171 .li@pop
2172 .if '\\$1'1' .SP \\n[Lsp]u
2173 ..
2174 .\"-------------
2175 .\"     list status clear.
2176 .\"     terminate all lists to level i
2177 .de LC
2178 .ie \\n[.$]<1 .nr li*i 0
2179 .el .nr li*i \\$1
2180 .if \\n[li*i]>\\n[li*lvl] .@error "LC: incorrect argument: \\n[li*i] (too big)"
2181 .while \\n[li*lvl]>\\n[li*i] .li@pop
2182 .nr par@ind-flag 0
2183 ..
2184 .\"-------------
2185 .de AL
2186 .if \\n[.$]>3 .@error "AL: too many arguments"
2187 .if \\n[D]>2 .tm AL $*
2188 .ie \\n[.$]<=1 .LB \\n[Li] 0 2 1 "\\$1"
2189 .el \{\
2190 .       ie \\n[.$]=2 .LB 0\\$2 0 2 1 "\\$1"
2191 .       el \{\
2192 .               ie !'\\$2'' .LB \\$2 0 2 1 "\\$1" 0 1
2193 .               el .LB \\n[Li] 0 2 1 "\\$1" 0 1
2194 .       \}
2195 .\}
2196 ..
2197 .de ML
2198 .if \\n[.$]>3 .@error "ML: too many arguments"
2199 .if \\n[D]>2 .tm ML $*
2200 .nr li*ml-width \w@\\$1@u+1n
2201 .if \\n[.$]<2 .LB \\n[li*ml-width]u 0 1 0 "\\$1"
2202 .if \\n[.$]=2 .LB 0\\$2 0 1 0 "\\$1"
2203 .if \\n[.$]=3 \{\
2204 .       ie '\\$2'' .LB \\n[li*ml-width]u 0 1 0 "\\$1" 0 1
2205 .       el .LB \\n[Li] 0 1 0 "\\$1" 0 1
2206 .\}
2207 ..
2208 .de VL
2209 .if \\n[D]>2 .tm VL $*
2210 .if \\n[.$]>3 .@error "VL: too many arguments"
2211 .if \\n[.$]<1 .@error "VL: missing text-indent"
2212 .ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 0
2213 .el .LB 0\\$1 0\\$2 0 0 \& 0 1
2214 ..
2215 .\"     Bullet (for .BL)
2216 .de BL
2217 .if \\n[D]>2 .tm BL $*
2218 .ds BU \s-2\(bu\s0
2219 .if \\n[.$]>2 .@error "BL: too many arguments"
2220 .if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \\*[BU]
2221 .if \\n[.$]=1 .LB 0\\$1 0 1 0 \\*[BU]
2222 .if \\n[.$]=2 \{\
2223 .       ie '\\$1'' .LB \\n[Pi] 0 1 0 \\*[BU] 0 1
2224 .       el .LB 0\\$1 0 1 0 \\*[BU] 0 1
2225 .\}
2226 ..
2227 .de DL
2228 .if \\n[D]>2 .tm DL $*
2229 .if \\n[.$]>2 .@error "DL: too many arguments"
2230 .if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \(em
2231 .if \\n[.$]=1 .LB 0\\$1 0 1 0 \(em
2232 .if \\n[.$]=2 \{\
2233 .       ie '\\$1'' .LB \\n[Pi] 0 1 0 \(em 0 1
2234 .       el .LB 0\\$1 0 1 0 \(em 0 1
2235 .\}
2236 ..
2237 .de RL
2238 .if \\n[D]>2 .tm RL $*
2239 .if \\n[.$]>2 .@error "RL: too many arguments"
2240 .if \\n[.$]<1 .LB 6 0 2 4
2241 .if \\n[.$]=1 .LB 0\\$1 0 2 4
2242 .if \\n[.$]=2 \{\
2243 .       ie '\\$1'' .LB 6 0 2 4 1 0 1
2244 .       el .LB 0\\$1 0 2 4 1 0 1
2245 .\}
2246 ..
2247 .\" Broken Variable List. As .VL but text begin on the next line
2248 .de BVL
2249 .if \\n[D]>2 .tm BVL $*
2250 .if \\n[.$]>3 .@error "BVL: too many arguments"
2251 .if \\n[.$]<1 .@error "BVL: missing text-indent"
2252 .ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 -1
2253 .el .LB 0\\$1 0\\$2 0 -1 \& 0 1
2254 ..
2255 .\" ####### module tbl #######################################
2256 .\" This module is copied from groff_ms and modified for mgm.
2257 .\" Yes, it does not resemble the original anymore :-).
2258 .\" Don't know if I missed something important.
2259 .\" Groff_ms is written by James Clark.
2260 .nr tbl*have-header 0
2261 .nr tbl*header-written 0
2262 .de TS
2263 .br
2264 .if ''\\n[.z]' .SP
2265 .if '\\$1'H' .di tbl*header-div
2266 ..
2267 .de tbl@top-hook
2268 .if \\n[tbl*have-header] \{\
2269 .       ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl@print-header
2270 .       el .sp \\n[.t]u
2271 .\}
2272 ..
2273 .de tbl@bottom-hook
2274 .if \\n[tbl*have-header] \{\
2275 .       nr T. 1
2276 .\" draw bottom and side lines of boxed tables.
2277 .       T#
2278 .\}
2279 .nr tbl*header-written 0
2280 ..
2281 .de tbl@print-header
2282 .ev tbl*ev
2283 'nf
2284 .tbl*header-div
2285 .ev
2286 .mk #T
2287 .nr tbl*header-written 1
2288 ..
2289 .de TH
2290 .ie '\\n[.z]'tbl*header-div' \{\
2291 .       nr T. 0
2292 .       T#
2293 .       br
2294 .       di
2295 .       nr tbl*header-ht \\n[dn]
2296 .       ne \\n[dn]u+1v
2297 .       nr tbl*have-header 1
2298 .       ie '\\$1'N' .if !\\n[tbl*header-written] .tbl@print-header
2299 .       el .tbl@print-header
2300 .\}
2301 .el .@error ".TH without .TS H"
2302 ..
2303 .de TE
2304 .ie '\\n(.z'tbl*header-div' .@error ".TS H but no .TH before .TE"
2305 .el \{\
2306 .       nr tbl*have-header 0
2307 .\}
2308 .\" reset tabs
2309 .TAB
2310 ..
2311 .de T&
2312 ..
2313 .\" ####### module pic #######################################
2314 .de PS
2315 .nr pic*in 0
2316 .br
2317 .SP .5
2318 .ie \\n[.$]<2 .@error "PS: bad arguments. Probably not processed with pic."
2319 .el \{\
2320 .       if !\\n[ds*lvl] .ne (u;\\$1)+1v
2321 .\" should be contained between .DS/.DE
2322 .if r ds*format \{\
2323 .               if \\n[ds*lvl]&((\\n[ds*format]=2):(\\n[ds*format]=3)) \{\
2324 .                       nr pic*in \\n[.i]
2325 .\" .           in +(u;\\n[.l]-\\n[.i]-\\$2/2)
2326 .               \}
2327 .       \}
2328 .\}
2329 ..
2330 .de PE
2331 .init@reset
2332 .SP .5
2333 ..
2334 .\" ####### module eq #######################################
2335 .\" 
2336 .nr eq*number 0 1
2337 .ds eq*label
2338 .de EQ
2339 .ds eq*label "\\$1
2340 ..
2341 .de eq@check
2342 .if !'\\*[eq*label]'' \{\
2343 .       mk
2344 .       \" space down to middle of equation
2345 '       sp (u;\\$1/2)
2346 .       ie (\\n[Eq]%2) \{\
2347 .               \"      label to the left
2348 \h'|0'\\*[eq*label]
2349 .       \}
2350 .       el \{\
2351 .               \"      label to the right
2352 \h'|\\n[.l]u'\\*[eq*label]
2353 .       \}
2354 .       rt
2355 .\}
2356 .ds eq*label
2357 ..
2358 .de EN
2359 ..
2360 .\"########### module toc ###################
2361 .\" table of contents
2362 .nr toc*slevel 1
2363 .nr toc*spacing \n[Lsp]u
2364 .nr toc*tlevel 2
2365 .nr toc*tab 0
2366 .\"-----------
2367 .\" Table of contents with friends (module lix)
2368 .de TC
2369 .br
2370 .\" print any pending displays and references
2371 .df@print-float 3
2372 .if \\n[ref*flag] .RP 0 1
2373 .\"
2374 .if \w@\\$1@>0 .nr toc*slevel \\$1
2375 .if \w@\\$2@>0 .nr toc*spacing (u;\\$2*\\n[Lsp])
2376 .if \w@\\$3@>0 .nr toc*tlevel \\$3
2377 .if \w@\\$4@>0 .nr toc*tab \\$4
2378 .if \\n[pg*cols-per-page]>1 .1C
2379 .ds H1txt \\*[Licon]
2380 .ds Tcst co
2381 .pg@clear-hd
2382 .EF ""
2383 .OF ""
2384 .pg@next-page
2385 .\"-------------
2386 .if d Ci .toc@read-Ci \\*[Ci]
2387 .nf
2388 .in 0
2389 .ie \\n[Oc] .hd@set-page 1
2390 .el \{\
2391 .       nr toc*pn 1 1
2392 .       af toc*pn i
2393 .       aln ;g toc*pn
2394 .       PF "''\\\\\\\\n[toc*pn]''"
2395 .       am pg@header
2396 .               nr toc*pn +1
2397 \\..
2398 .\}
2399 .nr toc*i 4 1
2400 .while \\n+[toc*i]<10 \{\
2401 .       if !'\\$\\n[toc*i]'' \{\
2402 .               ce
2403 \\$\\n[toc*i]
2404 .               br
2405 .       \}
2406 .\}
2407 .if \\n[.$]<=4 .if d TX .TX
2408 .ie d TY .if \\n[.$]<=4 .TY
2409 .el \{\
2410 .       ce
2411 \\*[Licon]
2412 .       br
2413 .       SP 3
2414 .\}
2415 .if d toc*list .toc*list
2416 .br
2417 .\" print LIST OF XXX
2418 .if d lix*dsfg .lix@print-ds fg FG "\\*[Lf]" \\n[.$]
2419 .if d lix*dstb .lix@print-ds tb TB "\\*[Lt]" \\n[.$]
2420 .if d lix*dsec .lix@print-ds ec EC "\\*[Le]" \\n[.$]
2421 .if d lix*dsex .lix@print-ds ex EX "\\*[Lx]" \\n[.$]
2422 ..
2423 .\"-----------
2424 .\" .toc@read-Ci lev1 lev2 lev3 lev4 ... lev7
2425 .de toc@read-Ci
2426 .nr toc*i 0 1
2427 .while \\n+[toc*i]<8 \{\
2428 .       nr toc*hl!\\n[toc*i] \\$\\n[toc*i]
2429 .\}
2430 ..
2431 .\"-----------
2432 .de toc@entry
2433 .ie \\n[Sectp] \{\
2434 .       toc@save \\$1 "\\*[hd*mark]" "\\$2" \\*[hd*sect-pg]
2435 .\}
2436 .el .toc@save \\$1 "\\*[hd*mark]" "\\$2" \\n[%]
2437 ..
2438 .als )E toc@entry
2439 .\"-----------
2440 .de toc@save
2441 .\" collect maxsize of mark if string Ci don't exist.
2442 .if !d Ci \{\
2443 .       if !r toc*hl!\\$1 .nr toc*hl!\\$1 0
2444 .       if \\n[toc*hl!\\$1]<=\w@\\$2@ \{\
2445 .               nr toc*hl!\\$1 \w@\\$2@u
2446 .       \}
2447 .\}
2448 .am toc*list
2449 .\" .toc@set level headernumber text pagenr
2450 .toc@set \\$1 "\\$2" "\\$3" \\$4
2451 \\..
2452 ..
2453 .\"-----------
2454 .\" level mark text pagenumber
2455 .de toc@set
2456 .if \\$1<=\\n[toc*slevel] .SP \\n[toc*spacing]u
2457 .na
2458 .fi
2459 .nr toc*ind 0
2460 .nr toc*i 0 1
2461 .ie d Ci \{\
2462 .       nr toc*ind +\\n[toc*hl!\\$1]u
2463 .\}
2464 .el \{\
2465 .       while \\n+[toc*i]<\\$1 \{\
2466 .               nr toc*ind +\\n[toc*hl!\\n[toc*i]]u
2467 .       \}
2468 .\}
2469 .nr toc*text \\n[toc*ind]u+\\n[toc*hl!\\$1]u
2470 .in \\n[toc*text]u
2471 .ti -\\n[toc*hl!\\$1]u
2472 .\"
2473 .\" length of headernum space
2474 .nr toc*i \\n[toc*hl!\\$1]-\w@\\$2@
2475 .\"
2476 .ll \\n[@ll]u-\w@\\$4@u-2m
2477 .ne 2v
2478 .\" ragged right ---------------------------------
2479 .ie \\$1>\\n[toc*tlevel] \{\
2480 \\$2
2481 .       sp -1
2482 \\$3\ \ \ \\$4
2483 .       br
2484 .\}
2485 .el \{\
2486 .       \" unnumbered heading --------------------
2487 .       ie '\\$2'' \{\
2488 .               in \\n[toc*ind]u
2489 \\$3\h'1m'
2490 .       \}
2491 .       \" normal heading ------------------------
2492 .       el \{\
2493 \\$2
2494 .               sp -1
2495 \\$3\h'1m'
2496 .       \}
2497 .       ll \\n[@ll]u
2498 .       sp -1
2499 .       nr toc*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$4@)-1m
2500 \h'|\\n[.n]u'\l'\\n[toc*sep]u.'\h'1m'\\$4
2501 .\}
2502 .ll \\n[@ll]u
2503 ..
2504 .\"########################### module lix ############################
2505 .\" LIST OF figures, tables, exhibits and equations 
2506 .nr lix*fg-nr 0 1
2507 .nr lix*tb-nr 0 1
2508 .nr lix*ec-nr 0 1
2509 .nr lix*ex-nr 0 1
2510 .aln Fg lix*fg-nr
2511 .aln Tb lix*tb-nr
2512 .aln Ec lix*ec-nr
2513 .aln Ex lix*ex-nr
2514 .\"------------
2515 .de FG
2516 .lix@print-line fg Lf \\n+[lix*fg-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2517 ..
2518 .de TB
2519 .lix@print-line tb Lt \\n+[lix*tb-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2520 ..
2521 .de EC
2522 .lix@print-line ec Le \\n+[lix*ec-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2523 ..
2524 .de EX
2525 .lix@print-line ex Lx \\n+[lix*ex-nr] "\\$1" "\\$2" "\\$3" "\\$4"
2526 ..
2527 .\"------------
2528 .\" print line with 'figure' in the text
2529 .\" type stringvar number text override flag refname
2530 .de lix@print-line
2531 .ds lix*text "\\$4
2532 .\"
2533 .ie \\n[Sectf] .ds lix*numb \\n[H1]-\\$3
2534 .el .ds lix*numb \\$3
2535 .\"
2536 .ie !\\n[Of] .ds lix*ds-form .\ \ \"
2537 .el .ds lix*ds-form "\ \(em\ \"
2538 .nr lix*in \\n[.i]
2539 .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\*[lix*ds-form]
2540 .if !'\\$5'' \{\
2541 .       if !0\\$6 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*numb]\\*[lix*ds-form]
2542 .       if 0\\$6=1 .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\$5\\*[lix*ds-form]
2543 .       if 0\\$6=2 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*ds-form]
2544 .\}
2545 .\" print line if not between DS/DE
2546 .ie \\n[ds*lvl]<1&\\n[df*float]=0 \{\
2547 .       lix@print-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
2548 .\}
2549 .el \{\
2550 .       lix@embedded-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
2551 .\}
2552 .\"
2553 ..
2554 .\"-----------
2555 .\" label text type stringvar refname
2556 .de lix@print-text
2557 .ie \\n[Sectp] .ds lix*pgnr \\*[hd*sect-pg]
2558 .el .ds lix*pgnr \\n[%]
2559 .SP \\n[Lsp]u
2560 .misc@ev-keep lix
2561 .init@reset
2562 .br
2563 .ie (\w@\\$1\\$2@)>(\\n[.l]-\\n[.i]) \{\
2564 .       in +\w@\\$1@u
2565 .       ti 0
2566 .\}
2567 .el .ce 1
2568 \fB\\$1\fP\\$2
2569 .br
2570 .ev
2571 .\" save line for LIST OF XXX, wth is the width of the label
2572 .if !r lix*wth\\$3 .nr lix*wth\\$3 0
2573 .\" find the maximum width
2574 .if \w@\\*[lix*label]@>\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
2575 .if \\n[\\$4] .lix@ds-save \\$3 \\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
2576 .\" save reference to the figure
2577 .if !'\\$5'' .SETR \\$5 \\*[lix*numb]
2578 ..
2579 .\" hide printout until diversion is evaluated
2580 .de lix@embedded-text
2581 \!.ie \\\\n[Sectp] .ds lix*pgnr \\\\*[hd*sect-pg]
2582 \!.el .ds lix*pgnr \\\\n[%]
2583 \!.SP \\\\n[Lsp]u
2584 \!.misc@ev-keep lix
2585 \!.ll \\n[.l]u
2586 \!.init@reset
2587 \!.fi
2588 \!.ie (\w@\\$1\\$2@)>(\\\\n[.l]-\\\\n[.i]) \{\
2589 .       in +\w@\\$1@u
2590 \!.     ti 0
2591 \!\fB\\$1\fP\\$2
2592 \!.\}
2593 \!.el \{\
2594 .       ce 1
2595 \!\fB\\$1\fP\\$2
2596 \!.\}
2597 \!.br
2598 \!.ev
2599 .\" save line for LIST OF XXX, wth is the width of the label
2600 \!.if !r lix*wth\\$3 .nr lix*wth\\$3 0
2601 .\" find the maximum width
2602 \!.if \w@\\*[lix*label]@>\\\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
2603 \!.if \\\\n[\\$4] .lix@ds-save \\$3 \\\\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
2604 .\" save reference to the figure
2605 \!.if !'\\$5'' .SETR \\$5 \\*[lix*numb]
2606 ..
2607 .\"------------
2608 .\" print complete list of XXXX
2609 .de lix@print-ds
2610 .\" arg: fg,tb,ec,ex text
2611 .ds H1txt \\$3
2612 .ds Tcst \\$1
2613 .if !\\n[Cp] .pg@next-page
2614 .\" print LIST OF XXXX
2615 .\" execute user-defined macros
2616 .if \\$4<=4 .if d TX\\$2 .TX\\$2
2617 .ie d TY\\$2 .if \\$4<=4 .TY\\$2
2618 .el \{\
2619 .       ce
2620 \\$3
2621 .       SP 3
2622 .\}
2623 .in \\n[lix*wth\\$1]u
2624 .fi
2625 .lix*ds\\$1
2626 ..
2627 .\"------------
2628 .\" save line of list in macro
2629 .de lix@ds-save
2630 .\" type pagenumber text
2631 .am lix*ds\\$1
2632 .lix@dsln \\$1 \\$2 "\\$3" "\\$4" \\$5
2633 \\..
2634 ..
2635 .\"------------
2636 .\" print appended macro
2637 .\" lix@dsln type pagenumber text headernr
2638 .de lix@dsln
2639 .nr lix*i \\n[lix*wth\\$1]-\w@\\$4@
2640 .ne 4v
2641 .ll \\n[@ll]u-\w@\\$4@u-\w@\\$2@u-2m
2642 .ti -\\n[lix*wth\\$1]u
2643 \\$4
2644 .sp -1
2645 \\$3\h'1m'
2646 .sp -1
2647 .ll
2648 .nr lix*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$2@)-1m
2649 \h'|\\n[.n]u'\l'\\n[lix*sep]u.'\h'1m'\\$2
2650 .SP \\n[toc*spacing]u
2651 ..
2652 .\"########################### module fnt ############################
2653 .\" some font macros.
2654 .de R
2655 .ft R
2656 .ul 0
2657 ..
2658 .\"-----------
2659 .de fnt@switch
2660 .ul 0
2661 .ds fnt*tmp
2662 .nr fnt*prev \\n[.f]
2663 .nr fnt*i 2 1
2664 .while \\n+[fnt*i]<=\\n[.$] \{\
2665 .       if \\n[fnt*i]>3 .as fnt*tmp \,
2666 .       ie (\\n[fnt*i]%2)=1 .as fnt*tmp \\$1\\$[\\n[fnt*i]]
2667 .       el .as fnt*tmp \\$2\\$[\\n[fnt*i]]
2668 .       if \\n[fnt*i]<\\n[.$] .as fnt*tmp \/
2669 .\}
2670 \&\\*[fnt*tmp]\f[\\n[fnt*prev]]
2671 ..
2672 .\"-----------
2673 .de B
2674 .ie \\n[.$] .fnt@switch \fB \f[\\n[.f]] \\$@
2675 .el .ft B
2676 ..
2677 .de I
2678 .ie \\n[.$] .fnt@switch \fI \f[\\n[.f]] \\$@
2679 .el .ft I
2680 ..
2681 .de IB
2682 .if \\n[.$] .fnt@switch \fI \fB \\$@
2683 ..
2684 .de BI
2685 .if \\n[.$] .fnt@switch \fB \fI \\$@
2686 ..
2687 .de IR
2688 .if \\n[.$] .fnt@switch \fI \fR \\$@
2689 ..
2690 .de RI
2691 .if \\n[.$] .fnt@switch \fR \fI \\$@
2692 ..
2693 .de RB
2694 .if \\n[.$] .fnt@switch \fR \fB \\$@
2695 ..
2696 .de BR
2697 .if \\n[.$] .fnt@switch \fB \fR \\$@
2698 ..
2699 .\"########################### module box ############################
2700 .\" draw a box around some text. Text will be kept on the same page.
2701 .\"
2702 .nr box*ll 0
2703 .\" .B1 and .B2 works like .DS
2704 .de B1
2705 .if \\n[box*ll] .@error "B1: missing B2"
2706 .nr box*ll \\n[.l]
2707 .nr box*ind \\n[.i]
2708 .nr box*hyp \\n[.hy]
2709 .nr box*wid \\n[.l]-\\n[.i]
2710 .\"
2711 .\" jump to new environment.
2712 .ev box*ev
2713 .di box*div
2714 .ps \\n[@ps]u
2715 .vs \\n[@vs]u
2716 .in 1n
2717 .ll (u;\\n[box*wid]-1n)
2718 .hy \\n[.hy]
2719 ..
2720 .de B2
2721 .if !\\n[box*ll] .@error "B2: missing B1"
2722 .br
2723 .di
2724 .nr box*height \\n[dn]
2725 .ne \\n[dn]u+1v
2726 .ll \\n[box*ll]u
2727 .in \\n[box*ind]u
2728 .nr box*y-pos \\n[.d]u
2729 .nf
2730 .box*div
2731 .fi
2732 \v'-1v+.25m'\
2733 \D'l \\n[box*wid]u 0'\
2734 \D'l 0 -\\n[box*height]u'\
2735 \D'l -\\n[box*wid]u 0'\
2736 \D'l 0 \\n[box*height]u'
2737 .br
2738 .sp -1
2739 .ev
2740 .sp .20v
2741 .in \\n[box*ind]u
2742 .ll \\n[box*ll]u
2743 .rm box*div
2744 .nr box*ll 0
2745 ..
2746 .\"########################### module ref ############################
2747 .nr ref*nr 0 1
2748 .aln :R ref*nr
2749 .nr ref*nr-width 5n
2750 .nr ref*flag 0          \" for end-of-text
2751 .ds Rf \v'-.4m'\s-3[\\n+[ref*nr]]\s0\v'.4m'
2752 .\"
2753 .\" start reference
2754 .\"------------
2755 .de RS
2756 .if !''\\$1' .ds \\$1 \v'-.4m'\s-3[\\n[ref*nr]]\s0\v'.4m'
2757 .nr ref*flag 1
2758 .am ref*mac
2759 .ref@start-print \\n[ref*nr]
2760 \\..
2761 .eo
2762 .am ref*mac RF
2763 ..
2764 .\"------------
2765 .de RF
2766 .ec
2767 .am ref*mac
2768 .ref@stop-print
2769 \\..
2770 ..
2771 .\"------------
2772 .de ref@start-print
2773 .di ref*div
2774 .in \\n[ref*nr-width]u
2775 .ti -(\w@\\$1.@u+1n)
2776 \\$1.
2777 .sp -1
2778 ..
2779 .de ref@stop-print
2780 .br
2781 .di
2782 .ne \\n[dn]u
2783 .ev ref*ev2
2784 .nf
2785 .ref*div
2786 .ev
2787 .rm ref*div
2788 .if \\n[Ls] .SP \\n[Lsp]u
2789 ..
2790 .\"-----------
2791 .de RP
2792 .if !d ref*mac .@error "RP: No references!"
2793 .nr ref*i 0\\$2
2794 .if \\n[ref*i]<2 .SK
2795 .SP 2
2796 .ref@print-refs
2797 .if 0\\$1<1 .nr ref*nr 0 1
2798 .if ((\\n[ref*i]=0):(\\n[ref*i]=2)) .SK
2799 ..
2800 .\"-----------
2801 .\" called by end-of-text!
2802 .de ref@eot-print
2803 .\".if \\n[ref*flag] \{
2804 .if d ref*mac \{\
2805 .       if \\n[D]>2 .tm Print references, called by eot
2806 .       nr ref*flag 0
2807 .       br
2808 .       misc@ev-keep ne
2809 .       init@reset
2810 \c
2811 '       bp
2812 .       ev
2813 .       ref@print-refs
2814 .\}
2815 ..
2816 .\"-----------
2817 .\" prints the references
2818 .de ref@print-refs
2819 .toc@save 1 "" "\\*[Rp]" \\n[%]
2820 .ce
2821 \fI\\*[Rp]\fP
2822 .sp
2823 .nr ref*ll \\n[.l]
2824 .misc@ev-keep ref*ev
2825 .ll \\n[ref*ll]u
2826 .in 0
2827 .ref*mac
2828 .in
2829 .rm ref*mac
2830 .ev
2831 .nr ref*flag 0 1
2832 ..
2833 .\"########################### module app ############################
2834 .\" 
2835 .nr app*nr 0 1
2836 .af app*nr A
2837 .nr app*dnr 0 1
2838 .nr app*flag 0
2839 .\"------------
2840 .\" .APP name text
2841 .\" name == "" -> autonumber
2842 .de APP
2843 .\" .if \\n[.$]<2 .@error "APP: too few arguments"
2844 .app@set-ind "\\$1"
2845 .\"
2846 .ds Tcst ap
2847 .ds Apptxt \\$2
2848 .\"
2849 .ie \\n[Aph] .app@header \\*[app*ind] "\\$2"
2850 .el .bp
2851 .app@index "\\*[app*ind]" "\\$2"
2852 ..
2853 .\"------------
2854 .\" .APPSK name pages text
2855 .\" name == "" -> autonumber
2856 .de APPSK
2857 .if \\n[.$]<2 .@error "APPSK: too few arguments"
2858 .app@set-ind "\\$1"
2859 .\"
2860 .ds Tcst ap
2861 .ds Apptxt \\$3
2862 .\"
2863 .ie \\n[Aph] .app@header \\*[app*ind] "\\$3"
2864 .el .bp
2865 .app@index "\\*[app*ind]" "\\$3"
2866 .pn +\\$2
2867 ..
2868 .\"------------
2869 .de app@set-ind
2870 .ie \w@\\$1@ .ds app*ind \\$1
2871 .el \{\
2872 .       if !\\n[app*flag] \{\
2873 .               nr H1 0 1
2874 .               af H1 A
2875 .               af H1h A
2876 .               nr app*flag 1
2877 .       \}
2878 .       ds app*ind \\n+[app*nr]
2879 .       nr H1 \\n+[app*dnr]
2880 .       nr H1h \\n[app*dnr] 
2881 .\}
2882 .\"     clear lower counters
2883 .nr app*i 1 1
2884 .while \\n+[app*i]<8 .nr H\\n[app*i] 0 1
2885 ..
2886 .\"------------
2887 .de app@index
2888 .toc@save 1 "" "\\*[App] \\$1: \\$2" \\n[%]
2889 ..
2890 .\"------------
2891 .\" app@heaer name text
2892 .de app@header
2893 .bp
2894 .SP (u;\\n[Lsp]*4)
2895 .ce 1
2896 \s+4\fB\\*[App]\ \\$1\fP\s0
2897 .SP (u;\\n[Lsp]*2)
2898 .if \w@\\$2@<\\n[.l] .ce 1
2899 \fB\s+2\\$2\s0\fP
2900 .SP (u;\\n[Lsp]*4)
2901 ..
2902 .als APPX app@header
2903 .\"########################### module cov ############################
2904 .\" title stored in diversion cov*title
2905 .\" abstract stored in diversion cov*abstract
2906 .\"     arg to abstract stored in cov*abs-arg
2907 .\"     indent stored in cov*abs-ind
2908 .\" number of authors stored in cov*au
2909 .\" author(s) stored in cov*au!x!y
2910 .\" author(s) title stored in cov*at!x!y
2911 .\"     x is the author-index [1-cov*au], y is the argument-index [1-9].
2912 .\" author(s) firm stored in cov*firm
2913 .\" new date (if .ND exists) is stored in cov*new-date
2914 .\"
2915 .\"
2916 .ds cov*abs-name ABSTRACT
2917 .\"
2918 .nr cov*au 0
2919 .de TL
2920 .rm IA IE WA WE LO LT
2921 .if \\n[.$]>0 .ds cov*title-charge-case \\$1
2922 .if \\n[.$]>1 .ds cov*title-file-case \\$2
2923 .pg@disable-top-trap
2924 .eo
2925 .de cov*title AU
2926 ..
2927 .\"-------------------
2928 .de cov@title-end
2929 .ec
2930 ..
2931 .\"-------------------
2932 .\" .AU name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]
2933 .de AU
2934 .cov@title-end
2935 .pg@disable-top-trap
2936 .nr cov*au +1
2937 .nr cov*i 0 1
2938 .ds cov*au!\\n[cov*au]!1
2939 .while \\n[.$]>=\\n+[cov*i] \{\
2940 .       ds cov*au!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
2941 .\}
2942 .if (\\n[.$]>=3)&(\w@\\$3@) \{\
2943 .       if d cov*location-\\$3] \{\
2944 .               ds cov*au!3!\\n[cov*au] \\*[cov*location-\\$3]
2945 .       \}
2946 .\}
2947 ..
2948 .\"-------------------
2949 .\" .AT title1 [title2 [... [title9] ]]]]
2950 .\" Well, thats all that COVEND look for.
2951 .\" Must appear directly after .AU
2952 .de AT
2953 .if \\n[.$]<1 .@error "AT: no arguments"
2954 .nr cov*i 0 1
2955 .while \\n[.$]>=\\n+[cov*i] \{\
2956 .       ds cov*at!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
2957 .\}
2958 ..
2959 .\"-------------------
2960 .de AF
2961 .cov@title-end
2962 .ds cov*firm \\$1
2963 ..
2964 .de AST
2965 .ds cov*abs-name \\$1
2966 ..
2967 .de AS
2968 .pg@disable-top-trap
2969 .if d cov*abstract .@error "AS: only one abstract allowed"
2970 .if !''\\n[.z]' .@error "AS: no diversion allowed (previous .AS?)"
2971 .nr cov*abs-arg 0\\$1
2972 .nr cov*abs-ind (n;0\\$2)
2973 .de cov*abstract AE
2974 ..
2975 .de AE
2976 ..
2977 .\" fixed for 2000, now uses \n[year].
2978 .de ISODATE
2979 .       \" support for ISO-date
2980 .       nr cov*mm \\n[mo]
2981 .       nr cov*dd \\n[dy]
2982 .       af cov*mm 01
2983 .       af cov*dd 01
2984 .       ie '0'\\$1' \{\
2985 .               ds cov*new-date \\*[MO\\n[mo]] \\n[dy], \\n[year]
2986 .       \}
2987 .       el \{\
2988 .               ds cov*new-date \\n[year]-\\n[cov*mm]-\\n[cov*dd]
2989 .       \}
2990 ..
2991 .ISODATE 0
2992 .als DT cov*new-date
2993 .de ND
2994 .ds cov*new-date \\$1
2995 ..
2996 .\" switch to ISO-date if register Iso exist: YYYY-MM-DD
2997 .if r Iso .ISODATE 1
2998 .\"-------------------
2999 .\" save technical numbers.
3000 .de TM
3001 .nr cov*i 0 1
3002 .while \\n[.$]>=\\n+[cov*i] .ds cov*mt-tm!\\n[cov*i] \\$[\\n[cov*i]]
3003 .nr cov*mt-tm-max \\n[.$]
3004 ..
3005 .\"-----------------------
3006 .\" cover sheet
3007 .\" the file must have the following last lines (somewhere):
3008 .\" .pg@enable-top-trap
3009 .\" .bp 1
3010 .\" .pg@enable-trap
3011 .ds cov*mt-file!0 0.MT
3012 .ds cov*mt-file!1 0.MT
3013 .ds cov*mt-file!2 0.MT
3014 .ds cov*mt-file!3 0.MT
3015 .ds cov*mt-file!4 4.MT
3016 .ds cov*mt-file!5 5.MT
3017 .ds cov*mt-file!6 0.MT
3018 .\"------------
3019 .de MT
3020 .ie \\n[.$] \{\
3021 .       ie d cov*mt-file!\\$1 .ds cov*mt-type \\$1
3022 .       el .ds cov*mt-type 6
3023 .\}
3024 .el .ds cov*mt-type 1
3025 .ds cov*mt-addresse "\\$2
3026 .ds cov*mt-type-text "\\$1
3027 .ie d @language .ds cov*str mm/\\*[@language]_
3028 .el .ds cov*str mm/
3029 .mso \\*[cov*str]\\*[cov*mt-file!\\*[cov*mt-type]]
3030 ..
3031 .de COVER
3032 .ie !\\n[.$] .ds cov*cov-type ms
3033 .el .ds cov*cov-type \\$1
3034 .pg@disable-top-trap
3035 .ie d @language .ds cov*str mm/\\*[@language]_\\*[cov*cov-type].cov
3036 .el .ds cov*str mm/\\*[cov*cov-type].cov
3037 .mso \\*[cov*str]
3038 ..
3039 .\"########################### module qrf ############################
3040 .\" forward and backward reference thru special files.
3041 .\"
3042 .\" check if stderr-method is wanted
3043 .\" This was needed when I discovered that groff was considered unsafe
3044 .\" and groff -U didn't work. It's a workaround like the original
3045 .\" index method, but not in my view elegant enough.
3046 .\"
3047 .\" init reference system
3048 .de INITR
3049 .ds qrf*file \\$1.qrf
3050 .nr qrf*pass 2
3051 .if \\n[D]>1 .tm INITR: source \\*[qrf*file]
3052 .ie \\n[Ref] \{\
3053 .       tm .\\\\" Rfilename: \\*[qrf*file]
3054 .\}
3055 .el 'so  \\*[qrf*file]
3056 ..
3057 .\"---------------
3058 .\" set a reference.
3059 .de SETR
3060 .if \\n[.$]<1 .@error "SETR:reference name missing"
3061 .if !r qrf*pass .tm "SETR: No .INITR in this file"
3062 .if \\n[Ref] \{\
3063 .       ds qrf*name qrf*ref-\\$1
3064 .       if \\n[D]>2 .tm SETR: ref \\*[qrf*name]=\\*[hd*mark],\\n[%]
3065 .       \" heading-number
3066 .       ds \\*[qrf*name]-hn \\*[hd*mark]
3067 .       \" page-number
3068 .       ds \\*[qrf*name]-pn \\n[%]
3069 .       \"
3070 .       if \\n[Ref] \{\
3071 .               tm .ds \\*[qrf*name]-hn \\*[hd*mark]
3072 .               tm .ds \\*[qrf*name]-pn \\n[%]
3073 .               if !'\\$2'' .tm .ds \\*[qrf*name]-xx \\$2
3074 .       \}
3075 .\}
3076 ..
3077 .\"---------------
3078 .\" get misc-string
3079 .\" If two arg -> set var. arg to misc-string.
3080 .de GETST
3081 .if \\n[.$]<1 .@error "GETST:reference name missing"
3082 .if !r qrf*pass .tm "GETST: No .INITR in this file"
3083 .ds qrf*name qrf*ref-\\$1
3084 .       if d \\*[qrf*name]-xx \{\
3085 .               ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-xx]
3086 .               el \\*[\\*[qrf*name]-xx]\c
3087 .       \}
3088 .\}
3089 ..
3090 .\"---------------
3091 .\" get header-number
3092 .\" If two arg -> set var. arg to header-number.
3093 .de GETHN
3094 .if \\n[.$]<1 .@error "GETHN:reference name missing"
3095 .if !r qrf*pass .tm "GETHN: No .INITR in this file"
3096 .ds qrf*name qrf*ref-\\$1
3097 .if d \\*[qrf*name]-hn \{\
3098 .       ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-hn]
3099 .       el \\*[\\*[qrf*name]-hn]\c
3100 .\}
3101 ..
3102 .\"---------------
3103 .\" get page-number
3104 .\" If two arg -> set var. arg to page-number.
3105 .de GETPN
3106 .if \\n[.$]<1 .@error "GETPN:reference name missing"
3107 .if !r qrf*pass .tm "GETPN: No .INITR in this file"
3108 .ds qrf*name qrf*ref-\\$1
3109 .if d \\*[qrf*name]-pn \{\
3110 .       ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-pn]
3111 .       el \\*[\\*[qrf*name]-pn]\c
3112 .\}
3113 ..
3114 .\"----------
3115 .de GETR
3116 .if \\n[.$]<1 .@error "GETR:reference name missing"
3117 .ie !r qrf*pass \{\
3118 .       tm "GETR: No .INITR in this file"
3119 .\}
3120 .el \{\
3121 .       GETHN \\$1 Qrfh
3122 .       GETPN \\$1 Qrfp
3123 \\*[Qrf]
3124 .\}
3125 ..
3126 .\"########################### module ind ############################
3127 .\" Support for mgs-style indexing, borrowed from mgs.
3128 .de IX
3129 .       tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[%]
3130 ..
3131 .\"--------------------
3132 .\" Another type of index system
3133 .\" INITI type filename [macro]
3134 .de INITI
3135 .if \\n[.$]<1 .@error "INITI:type missing"
3136 .\" ignore if INITI has already been used
3137 .if \\n[.$]>1 \{\
3138 .       if d ind*file .@error "INITI:file already set"
3139 .       ds ind*file \\$2.ind
3140 .       if \\n[D]>1 .tm INITI: source \\*[ind*file]
3141 .\}
3142 .if !d ind*file .@error "INITI:file not specified"
3143 .ds ind*type \\$1
3144 .if \\n[Ref] \{\
3145 .       if \\n[.$]>2 .tm .\\\\" Imacro: \\$3
3146 .\}
3147 ..
3148 .\"---------------
3149 .de IND
3150 .if !d ind*file .@error "IND: No active INITI"
3151 .if \\n[D]>1 .tm IND: type=\\*[ind*type]
3152 .ds ind*ref
3153 .if '\\*[ind*type]'N' .ds ind*ref \\n[%]
3154 .if '\\*[ind*type]'H' .ds ind*ref \\*[hd*mark]
3155 .if '\\*[ind*type]'B' .ds ind*ref \\*[hd*mark]\t\\n[%]
3156 .if '\\*[ind*ref]'' .@error "IND:wrong index type: \\*[ind*ref]"
3157 .\"
3158 .ds ind*line \\$1
3159 .while \\n[.$]>0 \{\
3160 .       shift
3161 .       as ind*line \t\\$1
3162 .\}
3163 .as ind*line \\*[ind*ref]
3164 .if \\n[Ref] .tm .\\\\" IND \\*[ind*line]
3165 ..
3166 .\" print index
3167 .de INDP
3168 .ie \\n[Ref] .tm .\\\\" Index: \\*[ind*file]
3169 .el \{\
3170 .       if !\\n[Cp] .pg@next-page
3171 .       \" print INDEX
3172 .       \" execute user-defined macros
3173 .       if d TXIND .TXIND
3174 .       ie d TYIND .TYIND
3175 .       el \{\
3176 .               SK
3177 .               ce
3178 \\*[Index]
3179 .               SP 3
3180 .               2C
3181 .               nf
3182 .       \}
3183 '       so  \\*[ind*file]
3184 .       ie d TZIND .TZIND
3185 .       el \{\
3186 .               fi
3187 .               1C
3188 .       \}
3189 .\}
3190 .rm ind*file
3191 ..
3192 .\"########################### module let ############################
3193 .\" Letter macros
3194 .\"------------------------
3195 .\" Formal closing
3196 .de FC
3197 .df@print-float 3
3198 .ie \\n[.$] .ds let*i \\$1
3199 .el .ds let*i \\*[Letfc]
3200 .ie d let*type .let@fc_\\*[let*type] "\\*[let*i]" \\$@
3201 .el .let@mt-closing "\\*[let*i]" \\$@
3202 ..
3203 .\"-------
3204 .de let@mt-closing
3205 .ne 5v
3206 .in (u;\\n[.l]/2)
3207 .sp
3208 \\$1
3209 .in
3210 ..
3211 .\"------------------------
3212 .\" Signature line
3213 .de SG
3214 .ie d let*type .let*lt-sign \\$@
3215 .el .let*mt-sign \\$@
3216 ..
3217 .\"------------------------
3218 .de let*lt-sign
3219 .if !d let@sg_\\*[let*type] .@error "SG: letter type \\*[let*type] undefined"
3220 .df@print-float 3
3221 .nr let*i 0 1
3222 .nr let*j 0
3223 .while \\n+[let*i]<=\\n[let*wa-n] \{\
3224 .if \\n[let*i]=\\n[let*wa-n] .nr let*j 1
3225 .let@sg_\\*[let*type] "\\*[let*wa-name!\\n[let*i]]" "\\*[let*wa-title!\\n[let*i]]" \\n[let*i] \\n[let*j] \\$@
3226 .\}
3227 ..
3228 .\"------------------------
3229 .\" Memorandum signature
3230 .de let*mt-sign
3231 .df@print-float 3
3232 .ne \\n[cov*au]u*4v
3233 .ie \\n[.$]>1 .nr let*k 1
3234 .el .nr let*k \\n[cov*au]
3235 .ds let*tmp \\*[cov*au!\\n[let*k]!3]-\\*[cov*au!\\n[let*k]!4]-
3236 .nr let*i 0 1
3237 .while \\n+[let*i]<=\\n[cov*au] \{\
3238 .       if \\n[let*i]>1 .as let*tmp /
3239 .       as let*tmp \\*[cov*au!\\n[let*k]!2]
3240 .\}
3241 .if !''\\$1' .as let*tmp -\\$1
3242 .in (u;\\n[.l]/2)
3243 .nf
3244 .nr let*i 0 1
3245 .while \\n+[let*i]<=\\n[cov*au] \{\
3246 .       SP 3v
3247 .       if \\n[let*i]=\\n[let*k] \{\
3248 \Z'\h'-(u;\\n[.l]/2)'\\*[let*tmp]'\c
3249 .       \}
3250 \\*[cov*au!\\n[let*i]!1]
3251 .\}
3252 .fi
3253 .in
3254 ..
3255 .\"------------------------
3256 .\" Approval signature
3257 .de AV
3258 .ne 6v
3259 .nf
3260 .sp
3261 .ie \\n[.$]<2 \\*[Letapp]
3262 .el .sp
3263 .sp 2
3264 .ie n ______________________________      ______________
3265 .el \D'l 25m 0'\h'4m'\D'l 12m 0'
3266 \Z'\\$1'\h'29m'\f[\\*[@sdf_font]]\\*[Letdate]\fP
3267 .fi
3268 ..
3269 .\"------------------------
3270 .\" Letter signature
3271 .de AVL
3272 .ne 6v
3273 .nf
3274 .sp 3
3275 .ie n ______________________________
3276 .el \D'l 25m 0'
3277 \Z'\\$1'
3278 .fi
3279 ..
3280 .\"------------------------
3281 .\" Letter type
3282 .\" let@header is called from the header. It is supposed
3283 .\" to remove the alias itself.
3284 .de LT
3285 .rm AF AS AE AT AU CS OK TL MT
3286 .ds let*type BL
3287 .nr Pi 5
3288 .nr Pt 0
3289 .if !''\\$1' .ds let*type \\$1
3290 .if !d let@head_\\*[let*type] .@error "LT: unknown letter type \\$1"
3291 .shift
3292 .als let@header let@head_\\*[let*type]
3293 .let@init_\\*[let*type] \\$@
3294 .if \n[D]>1 .tm Letter type \\*[let*type]
3295 ..
3296 .\"-----------
3297 .\" Blocked letter
3298 .de let@init_BL
3299 ..
3300 .de let@head_BL
3301 .rm let@header
3302 .let@print-head 1
3303 ..
3304 .de let@sg_BL
3305 .ne 5v
3306 .nf
3307 .in (u;\\n[.l]/2)
3308 .sp 3v
3309 \\$1
3310 \\$2
3311 .in
3312 .if \\$4 .sp
3313 .if \w'\\$5'&\\$4 \\$5
3314 .fi
3315 ..
3316 .als let@fc_BL let@mt-closing
3317 .\"-----------
3318 .\" Semiblocked letter
3319 .de let@init_SB
3320 .nr Pt 1
3321 ..
3322 .de let@head_SB
3323 .rm let@header
3324 .let@print-head 1
3325 ..
3326 .als let@sg_SB let@sg_BL
3327 .als let@fc_SB let@mt-closing
3328 .\"-----------
3329 .\" Full-blocked letter
3330 .de let@init_FB
3331 ..
3332 .de let@head_FB
3333 .rm let@header
3334 .let@print-head
3335 ..
3336 .de let@sg_FB
3337 .ne 5v
3338 .nf
3339 .sp 3v
3340 \\$1
3341 \\$2
3342 .if \\$4 .sp
3343 .if \w'\\$5'&\\$4 \\$5
3344 .fi
3345 ..
3346 .de let@fc_FB
3347 .ne 5v
3348 .sp
3349 \\$1
3350 ..
3351 .\"-----------
3352 .\" Simplified letter
3353 .de let@init_SP
3354 ..
3355 .de let@head_SP
3356 .rm let@header
3357 .let@print-head
3358 ..
3359 .de let@sg_SP
3360 .nf
3361 .if \\$3=1 .sp
3362 .sp
3363 .misc@toupper "\\$1, \\$2"
3364 .if \\$4 .sp
3365 .if \w'\\$5'&\\$4 \\$5
3366 .fi
3367 ..
3368 .de let@fc_SP
3369 .sp 2
3370 ..
3371 .\"--------------------------------------
3372 .\" Print the letter-head
3373 .de let@print-head
3374 .nf
3375 .sp |11
3376 .if '1'\\$1' .in (u;\\n[.l]/2)
3377 .\" ---- WA
3378 .ie d let@wa-div .let@wa-div
3379 .el .sp 3
3380 .\" ---- datum
3381 \\*[cov*new-date]
3382 .sp
3383 .if '1'\\$1' .if !d let*lo-CN .if !d let*lo-RN .sp 2
3384 .\" ---- Confidential
3385 .if d let*lo-CN \{\
3386 .       ti 0
3387 .       ie !''\\*[let*lo-CN]' \\*[let*lo-CN]
3388 .       el \\*[LetCN]
3389 .       sp
3390 .\}
3391 .\" ---- Reference
3392 .if d let*lo-RN \{\
3393 \\*[LetRN] \\*[let*lo-RN]
3394 .       sp
3395 .\}
3396 .\" ---- IA
3397 .sp
3398 .in 0
3399 .nr let*i 0 1
3400 .while \\n+[let*i]<=\\n[let*ia-n] \{\
3401 \\*[let*ia-name!\\n[let*i]]
3402 \\*[let*ia-title!\\n[let*i]]
3403 .\}
3404 .if d let@ia-div .let@ia-div
3405 .\" ---- Attention
3406 .if d let*lo-AT \{\
3407 .       sp
3408 \\*[LetAT] \\*[let*lo-AT]
3409 .\}
3410 .\" ---- Salutation
3411 .if !'\\*[let*type]'SP' .if d let*lo-SA \{\
3412 .       sp
3413 .       ti 0
3414 .       ie !''\\*[let*lo-SA]' \\*[let*lo-SA]
3415 .       el \\*[LetSA]
3416 .\}
3417 .\" ---- Subject
3418 .if d let*lo-SJ \{\
3419 .       ie '\\*[let*type]'SP' \{\
3420 .               sp 2
3421 .               misc@toupper \\*[let*lo-SJ]
3422 .               sp
3423 .       \}
3424 .       el \{\
3425 .               sp
3426 .               if '\\*[let*type]'SB' .ti +5m
3427 \\*[LetSJ] \f[\\*[@sdf_font]]\\*[let*lo-SJ]\fP
3428 .       \}
3429 .\}
3430 ..
3431 .\"-------------------
3432 .\" .IA [name [title]]
3433 .nr let*ia-n 0 1
3434 .de IA
3435 .if \\n[.$] .ds let*ia-name!\\n+[let*ia-n] \\$1
3436 .if \\n[.$]>1 .ds let*ia-title!\\n[let*ia-n] \\$2
3437 .ev let@ev
3438 .init@reset
3439 'nf
3440 .di let@ia-div
3441 .eo
3442 ..
3443 .de IE
3444 .di
3445 .ec
3446 .ev
3447 ..
3448 .\"-------------------
3449 .\" .WA [name [title]]
3450 .nr let*wa-n 0 1
3451 .de WA
3452 .if \\n[.$] .ds let*wa-name!\\n+[let*wa-n] \\$1
3453 .if \\n[.$]>1 .ds let*wa-title!\\n[let*wa-n] \\$2
3454 .ev let@ev
3455 .init@reset
3456 'nf
3457 .di let@wa-div
3458 .it \\n[Letwam] let@wa-drain
3459 .eo
3460 ..
3461 .\"------
3462 .de let@wa-drain
3463 .it
3464 .di
3465 .di let@wa-junk
3466 ..
3467 .\"------
3468 .de WE
3469 .it
3470 .ec
3471 .di
3472 .ev
3473 .if d let@wa-junk .rm let@wa-junk
3474 ..
3475 .\"-------------------
3476 .\" Copy to
3477 .de NS
3478 .sp
3479 .ie !''\\$2' .ds let*str \\$1
3480 .el \{\
3481 .       ie \\n[.$]>0 \{\
3482 .               ie !\w'\\$1' .ds let*str \\*[Letns!\\*[Letnsdef]]
3483 .               el \{\
3484 .                       ie d Letns!\\$1 .ds let*str \\*[Letns!\\$1]
3485 .                       el .ds let*str \\*[Letns!copy](\\$1)\\*[Letns!to]
3486 .               \}
3487 .       \}
3488 .       el .ds let*str \\*[Letns!\\*[Letnsdef]]
3489 .\}
3490 .ne 2
3491 .nf
3492 \\*[let*str]
3493 ..
3494 .de NE
3495 .fi
3496 ..
3497 .\"-------------------
3498 .\" Letter options
3499 .de LO
3500 .rm AF AS AE AT AU CS OK TL MT
3501 .if ''\\$1' .@error "LO: missing option"
3502 .if !d Let\\$1 .@error "LO: unknown option (\\$1)"
3503 .ds let*lo-\\$1 \\$2
3504 .if \n[D]>1 .tm Letter option \\$1 \\$2
3505 ..
3506 .\"--------------------
3507 .\" Start with a clean slate
3508 .init@reset