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