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