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