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