762c8480dae35e7e84cc34791d2468f771b7c37e
[platform/upstream/groff.git] / contrib / mom / om.tmac
1 .\" -*- nroff -*-      om.tmac
2 .ig
3 Mom -- a typesetting/document-processing macro set for groff.
4
5 Copyright (C) 2002-2014  Free Software Foundation, Inc.
6  Written by Peter Schaffter <peter@schaffter.ca>
7  PDF integration contributed by Deri James <deri.james@chuzzlewit.co.uk>
8
9 This file is part of groff.
10
11 groff is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
15
16 groff is distributed in the hope that it will be useful, but WITHOUT ANY
17 WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19 for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
23
24 Version 2.1-c_1
25 ---------------
26 Antoine de St-ExupĂ©ry asserted that elegance in engineering is
27 achieved not when there is nothing left to add, but when there is
28 nothing left to take away.
29
30 By those standards, mom is a Rube Goldberg contraption.  She was
31 created over the years while groff, and my understanding of it,
32 changed and evolved.  However, I'm a firm believer in "if it ain't
33 broke, don't fix it."  Version 2.0 removes some of the redundancies
34 and cruft, but mom still needs some nip and tuck.
35
36 "<anything>" in the description of arguments that can be passed
37 to a macro means that any argument turns the feature off.
38
39 Thanks to everyone who has contributed suggestions and patches,
40 and to those whose GPL'd work has been plundered.  Special thanks
41 to Werner Lemberg (margin notes), Tadziu Hoffman (underlining),
42 Deri James (pdf integration), Robin Haberkorn (tbl integration, eqn
43 extentions, and float management).
44 ..
45 .\" %beginstrip%
46 \#
47 \# ====================================================================
48 \#
49 \# Check which version of groff is being run
50 .if (\n[.x]\n[.y] < 118) \
51 .   ab [mom]: You need GNU troff version 1.18 or higher to run this version of mom.
52 \# Check that GNU troff is being run
53 .if !\n[.g]=1 \
54 .   ab [mom]: The mom macros require that you be running GNU troff.
55 .if \n[.C] \
56 .   ab [mom]: The groff mom macros do not work in compatibility mode.
57 \# Add supplementary styles
58 .sty \n[.fp] UL      \"  Ultra Light
59 .sty \n[.fp] ULI     \"  Ultra Light Italic
60 .sty \n[.fp] ULCD    \"  Ultra Light Condensed
61 .sty \n[.fp] ULCDI   \"  Ultra Light Condensed Italic
62 .sty \n[.fp] ULEX    \"  Ultra Light Extended
63 .sty \n[.fp] ULEXI   \"  Ultra Light Extended Italic
64 \#
65 .sty \n[.fp] XL      \"  Extra Light
66 .sty \n[.fp] XLI     \"  Extra Light Italic
67 .sty \n[.fp] XLCD    \"  Extra Light Condensed
68 .sty \n[.fp] XLCDI   \"  Extra Light Condensed Italic
69 .sty \n[.fp] XLEX    \"  Extra Light Extended
70 .sty \n[.fp] XLEXI   \"  Extra Light Extended Italic
71 \#
72 .sty \n[.fp] TH      \"  Thin
73 .sty \n[.fp] THI     \"  Thin Italic
74 .sty \n[.fp] THCD    \"  Thin Condensed
75 .sty \n[.fp] THCDI   \"  Thin Condensed Italic
76 .sty \n[.fp] THEX    \"  Thin Extended
77 .sty \n[.fp] THEXI   \"  Thin Extended Italic
78 \#
79 .sty \n[.fp] L       \"  Light Roman
80 .sty \n[.fp] LI      \"  Light Italic
81 .sty \n[.fp] LCD     \"  Light Condensed
82 .sty \n[.fp] LCDI    \"  Light Condensed Italic
83 .sty \n[.fp] LEX     \"  Light Extended
84 .sty \n[.fp] LEXI    \"  Light Extended Italic
85 \#
86 .sty \n[.fp] BK      \"  Book Roman
87 .sty \n[.fp] BKI     \"  Book Italic
88 .sty \n[.fp] BKCD    \"  Book Condensed
89 .sty \n[.fp] BKCDI   \"  Book Condensed Italic
90 .sty \n[.fp] BKEX    \"  Book Extended
91 .sty \n[.fp] BKEXI   \"  Book Extended Italic
92 \#
93 .sty \n[.fp] CD      \"  Medium Condensed
94 .sty \n[.fp] CDI     \"  Medium Condensed Italic
95 .sty \n[.fp] EX      \"  Medium Extended
96 .sty \n[.fp] EXI     \"  Medium Extended Italic
97 \#
98 .sty \n[.fp] DB      \"  DemiBold Roman
99 .sty \n[.fp] DBI     \"  DemiBold Italic
100 .sty \n[.fp] DBCD    \"  DemiBold Condensed
101 .sty \n[.fp] DBCDI   \"  DemiBold Condensed Italic
102 .sty \n[.fp] DBEX    \"  DemiBold Extended
103 .sty \n[.fp] DBEXI   \"  DemiBold Extended Italic
104 \#
105 .sty \n[.fp] SB      \"  SemiBold Roman
106 .sty \n[.fp] SBI     \"  SemiBold Italic
107 .sty \n[.fp] SBCD    \"  SemiBold Condensed
108 .sty \n[.fp] SBCDI   \"  SemiBold Condensed Italic
109 .sty \n[.fp] SBEX    \"  SemiBold Extended
110 .sty \n[.fp] SBEXI   \"  SemiBold Extended Italic
111 \#
112 .sty \n[.fp] BCD     \"  Bold Condensed
113 .sty \n[.fp] BCDI    \"  Bold Condensed Italic
114 .sty \n[.fp] BEX     \"  Bold Extended
115 .sty \n[.fp] BEXI    \"  Bold Extended Italic
116 .sty \n[.fp] BO      \"  Bold Outline
117 \#
118 .sty \n[.fp] XB      \"  Extra Bold
119 .sty \n[.fp] XBI     \"  Extra Bold Italic
120 .sty \n[.fp] XBCD    \"  Extra Bold Condensed
121 .sty \n[.fp] XBCDI   \"  Extra Bold Condensed Italic
122 .sty \n[.fp] XBEX    \"  Extra Bold Extended
123 .sty \n[.fp] XBEXI   \"  Extra Bold Extended Italic
124 \#
125 .sty \n[.fp] UB      \"  Ultra Bold
126 .sty \n[.fp] UBI     \"  Ultra Bold Italic
127 .sty \n[.fp] UBCD    \"  Ultra Bold Condensed
128 .sty \n[.fp] UBCDI   \"  Ultra Bold Condensed Italic
129 .sty \n[.fp] UBEX    \"  Ultra Bold Extended
130 .sty \n[.fp] UBEXI   \"  Ultra Bold Extended Italic
131 \#
132 .sty \n[.fp] HV      \"  Heavy
133 .sty \n[.fp] HVI     \"  Heavy Italic
134 .sty \n[.fp] HVCD    \"  Heavy Condensed
135 .sty \n[.fp] HVCDI   \"  Heavy Condensed Italic
136 .sty \n[.fp] HVEX    \"  Heavy Extended
137 .sty \n[.fp] HVEXI   \"  Heavy Extended Italic
138 \#
139 .sty \n[.fp] BL      \"  Black
140 .sty \n[.fp] BLI     \"  Black Italic
141 .sty \n[.fp] BLCD    \"  Black Condensed
142 .sty \n[.fp] BLCDI   \"  Black Condensed Italic
143 .sty \n[.fp] BLEX    \"  Black Extended
144 .sty \n[.fp] BLEXI   \"  Black Extended Italic
145 .sty \n[.fp] BLO     \"  Black Outline
146 \#
147 .sty \n[.fp] XBL     \"  Extra Black
148 .sty \n[.fp] XBLI    \"  Extra Black Italic
149 .sty \n[.fp] XBLCD   \"  Extra Black
150 .sty \n[.fp] XBLCDI  \"  Extra Black
151 .sty \n[.fp] XBLEX   \"  Extra Black Italic
152 .sty \n[.fp] XBLEXI  \"  Extra Black Italic
153 \#
154 .sty \n[.fp] UBL     \"  Ultra Black
155 .sty \n[.fp] UBLI    \"  Ultra Black Italic
156 .sty \n[.fp] UBLCD   \"  Ultra Black Condensed
157 .sty \n[.fp] UBLCDI  \"  Ultra Black Condensed Italic
158 .sty \n[.fp] UBLEX   \"  Ultra Black Exteneded
159 .sty \n[.fp] UBLEXI  \"  Ultra Black Extended Italic
160 \#
161 .sty \n[.fp] SC      \"  Small Caps Roman
162 .sty \n[.fp] SCI     \"  Small Caps Italic
163 .sty \n[.fp] SCDB    \"  Small Caps Demibold
164 .sty \n[.fp] SCDBI   \"  Small Caps Demibold Italic
165 .sty \n[.fp] SCSB    \"  Small Caps Semibold
166 .sty \n[.fp] SCSBI   \"  Small Caps Semibold Italic
167 \#
168 \# Instruct grops to use square linecaps and joins.
169 \# This instruction is also executed in DO_B_MARGIN, NEWPAGE, and HEADER
170 \#
171 .if !n \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
172 \#
173 \# The following PostScript, provided by Tadziu Hoffmann, permits
174 \# no-fail underlining
175 \#
176 .de ul*ps
177 ps: def
178 grops begin
179 /decornone { grops begin /X { } def /Y { } def /y2 -1 def end } def
180 /decorline { grops begin u neg /uld exch def u /ulw exch def
181              /X { currentpoint /y0 exch def /x0 exch def } def
182              /Y { currentpoint /y1 exch def /x1 exch def
183                   drawline /x2 x1 def /y2 y1 def } def end } def
184 /drawline { gsave ulw setlinewidth 0 setlinecap x1 y1 uld sub moveto
185             y2 y0 eq { x2 y2 } { x0 y0 } ifelse uld sub lineto stroke
186             grestore } def
187 decornone
188 /uld 0 def
189 /ulw 0 def
190 /A { X show Y } def
191 /B { 0 SC 3 -1 roll X widthshow Y } def
192 /C { 0 exch X ashow Y } def
193 /D { 0 exch 0 SC 5 2 roll X awidthshow Y } def
194 /E { 0 rmoveto X show Y } def
195 /F { 0 rmoveto 0 SC 3 -1 roll X widthshow Y } def
196 /G { 0 rmoveto 0 exch X ashow Y } def
197 /H { 0 rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
198 /I { 0 exch rmoveto X show Y } def
199 /J { 0 exch rmoveto 0 SC 3 -1 roll X widthshow Y } def
200 /K { 0 exch rmoveto 0 exch X ashow Y } def
201 /L { 0 exch rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
202 /M { rmoveto X show Y } def
203 /N { rmoveto 0 SC 3 -1 roll X widthshow Y } def
204 /O { rmoveto 0 exch X ashow Y } def
205 /P { rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
206 /Q { moveto X show Y } def
207 /R { moveto 0 SC 3 -1 roll X widthshow Y } def
208 /S { moveto 0 exch X ashow Y } def
209 /T { moveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
210 end
211 ..
212 \#
213 .if !n \Y[ul*ps]
214 .if n .color 0
215 .nr TOC.RELOCATE 0 \" TOC.RELOCATE is off by default
216 .ds PDFHREF.TEXTCOL.DEFAULT 0.0 0.3 0.9
217 \#
218 \# ====================================================================
219 \#
220 \# TYPESETTING MACROS, STRINGS, AND ALIASES
221 \# ========================================
222 \#
223 \# +++ALIASES+++
224 \#
225 \# Alias .als as ALIAS, and .aln (number registers) as ALIASN
226 \#
227 .als      ALIAS           als
228 .als      ALIASN          aln
229 \#
230 \# ALIASES FOR GROFF REQUESTS
231 \# --------------------------
232 \#
233 .ALIAS    MAC             de
234 .ALIAS    BR              br
235 .ALIAS    SPREAD          brp
236 .ALIAS    ESC_CHAR        ec
237 .ALIAS    STRING          ds
238 .ALIAS    INCLUDE         so
239 \#
240 \# ALIASES FOR NUMBER REGISTERS
241 \# ----------------------------
242 \#
243 .ALIASN  #PT_SIZE        .ps    \"fractional point size in units
244 .ALIASN  #DIVER_DEPTH     dn    \"diversion depth
245 .ALIASN  #DIVER_WIDTH     dl    \"diversion width
246 .ALIASN  #TRAP_DISTANCE  .t     \"distance to next trap
247 .ALIASN  #LEAD           .v     \"line space
248 .ALIASN  #PAGE_LENGTH    .p     \"page length
249 .ALIASN  #NUM_ARGS       .$     \"number of arguments passed to a macro
250 .ALIASN  #INDENT         .i     \"value of current indent
251 \#
252 \# ====================================================================
253 \#
254 \# MISCELLANEOUS
255 \# =============
256 .nr #L_MARGIN \n[.o]  \" Tabs, etc require #L_MARGIN
257 .cflags 4 /\[en]      \" So slash and en-dashes get broken
258 \#
259 \# ====================================================================
260 \#
261 \# +++PAGE LAYOUT+++
262 \#
263 \# Macros that control the physical layout of the page: paper size
264 \# and margins.
265 \#
266 \# PAGE WIDTH
267 \# ----------
268 \# *Argument:
269 \#   <width of printer sheet>
270 \# *Function:
271 \#   Stores user supplied page width in register #PAGE_WIDTH.
272 \# *Notes:
273 \#   #PAGE_WIDTH is used to establish the default LL (and right margin).
274 \#   Requires unit of measure.
275 \#
276 .MAC PAGEWIDTH END
277 .    br
278 .    nr #PAGE_WIDTH \\$1
279 .    if !r#L_MARGIN .L_MARGIN \\n[.o]
280 .    if !r#R_MARGIN .R_MARGIN 1i
281 .    if '\\*[.T]'pdf' \X'papersize=\\n[#PAGE_WIDTH]z,\\n[#PAGE_LENGTH]z'\c
282 .END
283 \#
284 \# L_MARGIN
285 \# --------
286 \# *Argument:
287 \#   <offset from page left>
288 \# *Function:
289 \#   Stores user supplied page offset in register #L_MARGIN.
290 \#   Sets .po to user supplied offset.
291 \# *Notes:
292 \#   Requires unit of measure.
293 \#
294 .MAC L_MARGIN END
295 .    br
296 .    nr #L_MARGIN (\\$1)
297 .    po \\n[#L_MARGIN]u
298 .END
299 \#
300 \# R_MARGIN
301 \# --------
302 \# *Argument:
303 \#   <width of right margin>
304 \# *Function:
305 \#   Stores user supplied right margin in register #R_MARGIN.
306 \# *Notes:
307 \#   This is a pseudo-margin.  Right margin is actually a function of
308 \#   line length.  The macro calculates line length from the page offset
309 \#   and the value plugged into #R_MARGIN.
310 \#
311 \#   N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
312 \#
313 \#   Requires unit of measure.
314 \#
315 .MAC R_MARGIN END
316 .    br
317 .    nr #R_MARGIN (\\$1)
318 .    ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
319 .    ta \\n[.l]u
320 .    nr #L_LENGTH \\n[.l]
321 .END
322 \#
323 \# T_MARGIN
324 \# --------
325 \# *Argument:
326 \#   <distance to advance from top of page>
327 \# *Function:
328 \#   Stores the user supplied top margin in register #T_MARGIN.
329 \#   Advances user supplied depth from the top of the page.
330 \# *Notes:
331 \#   Requires unit of measure.
332 \#
333 .MAC T_MARGIN END
334 .    nr #T_MARGIN (\\$1)
335 .    nr #TOP 1
336 .    if !\\n[#DOCS] .sp |\\n[#T_MARGIN]u-1v
337 .    wh 0i DO_T_MARGIN
338 .END
339 \#
340 \# B_MARGIN
341 \# --------
342 \# *Argument:
343 \#   <space to leave at the bottom of the page>
344 \# *Function:
345 \#   Stores the user supplied bottom margin in register #B_MARGIN.
346 \# *Notes:
347 \#   Requires unit of measure.
348 \#
349 .MAC B_MARGIN END
350 .    br
351 .    nr #B_MARGIN (\\$1)
352 .    nr #ORIGINAL_B_MARGIN \\n[#B_MARGIN]
353 .    nr #B_MARGIN_SET 1
354 .    wh -\\n[#B_MARGIN]u DO_B_MARGIN
355 .END
356 \#
357 \# PAGE
358 \# ----
359 \# *Arguments:
360 \#   <pagewidth>  [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
361 \# *Function:
362 \#   Page set-up.  Collects arguments and passes them to the appropriate
363 \#   macros.
364 \# *Notes:
365 \#   All arguments after pagewidth are optional, but must appear
366 \#   in the order given above.  (User can fill in as much or as
367 \#   little as desired.)
368 \#
369 \#   All arguments require a unit of measure.
370 \#
371 .MAC PAGE END
372 .    br
373 .    PAGEWIDTH   \\$1
374 .    PAGELENGTH  \\$2
375 .    ie '\\$3''  .L_MARGIN \\n[.o]
376 .    el          .L_MARGIN \\$3
377 .    ie '\\$4''  .R_MARGIN 1i
378 .    el          .R_MARGIN \\$4
379 .    if !'\\$5'' .T_MARGIN \\$5
380 .    if !'\\$6'' .B_MARGIN \\$6
381 .END
382 \#
383 \# gropdf: pass pagelength to postprocessor; no need for -P-p
384 \#
385 .MAC PAGELENGTH END
386 .    pl \\$*
387 .    if '\\*[.T]'pdf' \X'papersize=\\n[#PAGE_WIDTH]z,\\n[#PAGE_LENGTH]z'\c
388 .END
389 \#
390 \# =====================================================================
391 \#
392 \# +++PAGE CONTROL+++
393 \#
394 \# Generic macros for breaking pages.
395 \#
396 \# DO_T_MARGIN
397 \# -----------
398 \# *Argument:
399 \#   <none>
400 \# *Function:
401 \#   Plants the top margin at the top of each page.
402 \# *Notes:
403 \#   The trap is set in .T_MARGIN or .PAGE
404 \#
405 .MAC DO_T_MARGIN END
406 .    ev T_MARGIN
407 .    nr #TOP 1
408 .    sp |\\n[#T_MARGIN]u-1v
409 .    ev
410 .    sp -\\n[#T_MARGIN_LEAD_ADJ]u
411 .END
412 \#
413 \# DO_B_MARGIN
414 \# -----------
415 \# *Argument:
416 \#   <none>
417 \# *Function:
418 \#   Plants the bottom margin at the bottom of each page.
419 \# *Notes:
420 \#   The trap is set in .B_MARGIN or .PAGE.
421 \#
422 .MAC DO_B_MARGIN END
423 .    nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000
424 '    bp
425 .    if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
426 .END
427 \#
428 \# NEWPAGE
429 \# -------
430 \# *Argument:
431 \#   <none>
432 \# *Function:
433 \#   Breaks to a new page.
434 \# *Notes:
435 \#   If a B_MARGIN has been set, processes that, otherwise, just
436 \#   breaks to a new page.
437 \#
438 .MAC NEWPAGE END
439 .    if \\n[.vpt]=0 .vpt
440 .    ie \\n[#NO_BREAK] \{\
441 '       br
442 .       rr #NO_BREAK
443 .    \}
444 .    el .br
445 .    nr #NEWPAGE 1
446 .    nr @TOP 1
447 .    ie \\n[#B_MARGIN_SET]=1 \{\
448 .       ie !\\n[#DOCS]=1 \{\
449 .          ev NP
450 .          DO_B_MARGIN
451 .          ev
452 .       \}
453 .       el \{\
454 .          if \\n[#COLUMNS]=1 .nr #COL_NUM \\n[#NUM_COLS]
455 .          ie !\\n[#FN_DEPTH] \{\
456 .             ch FN_OVERFLOW_TRAP
457 .             DO_FOOTER
458 .             wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
459 .          \}
460 .          el .DO_B_MARGIN
461 .       \}
462 .    \}
463 .    el 'bp
464 .END
465 \#
466 \# =====================================================================
467 \#
468 \# +++GENERAL STYLE MACROS+++
469 \#
470 \# LINE LENGTH
471 \# -----------
472 \# *Argument:
473 \#   <line length>
474 \# *Function:
475 \#   Stores user supplied line length in register #L_LENGTH.
476 \#   Sets .ll to #L_LENGTHu
477 \# *Notes:
478 \#   Requires unit of measure.
479 \#
480 .MAC LL END
481 .    nr #USER_SET_L_LENGTH 1
482 .    ll \\$1
483 .    nr #L_LENGTH \\n[.l]
484 .    ta \\n[.l]u
485 .END
486 \#
487 \# +++FAMILY AND FONT+++
488 \#
489 \# FALLBACK FONT
490 \# -------------
491 \# *Argument:
492 \#   <fallback font> [ ABORT | WARN ] | ABORT | WARN
493 \# *Function:
494 \#   Sets register #ABORT_FT_ERRORS to 1, or defines a fallback font
495 \#   called "dummy" at font position 0.
496 \# *Notes:
497 \#   Calls to non-existent families cause mom to continue processing
498 \#   files using the fallback font until a valid family is entered.
499 \#
500 \#   Calls to non-existent fonts generate warnings.  If ABORT is passed
501 \#   to FALLBACK_FONT, mom stops processing files after the warning.
502 \#   Otherwise, she continues to process files using the fallback font
503 \#   after the warning is issued.  The default fallback font is CR; the
504 \#   default for font warnings is to abort.
505 \#
506 .MAC FALLBACK_FONT END
507 .    if \\n[#NUM_ARGS]=1 \{\
508 .       if '\\$1'ABORT' .nr #ABORT_FT_ERRORS 1
509 .       if '\\$1'WARN' \
510 .          if r #ABORT_FT_ERRORS .nr #ABORT_FT_ERRORS 0
511 .       if !'\\$1'ABORT' \
512 .          if !'\\$1'WARN' .fp 0 dummy \\$1
513 .    \}
514 .    if \\n[#NUM_ARGS]=2 \{\
515 .       fp 0 dummy \\$1
516 .       if '\\$2'ABORT' .nr #ABORT_FT_ERRORS 1
517 .       if '\\$2'WARN'  .nr #ABORT_FT_ERRORS 0
518 .    \}
519 .END
520 \#
521 .FALLBACK_FONT CR ABORT
522 \#
523 \# FAMILY
524 \# ------
525 \# *Argument:
526 \#   <font family>
527 \# *Function:
528 \#   Stores user supplied font family in string $FAMILY.  Sets .fam
529 \#   to $FAMILY.
530 \#
531 .MAC FAMILY END
532 .    ds $FAMILY \\$1
533 .    if \\n[#PRINT_STYLE]=1 \{\
534 .       fam \\*[$TYPEWRITER_FAM]
535 .       return
536 .    \}
537 .    if \\n[#IGNORE] \{\
538 .       fam \\*[$TYPEWRITER_FAM]
539 .       return
540 .    \}
541 .    if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) .ds $SAVED_STYLE \\n[.sty]
542 .    ft 0
543 .    fam \\*[$FAMILY]
544 .    if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
545 .       ft \\*[$SAVED_STYLE]
546 .       if !F\\n[.fn] .ft 0
547 .    \}
548 .    ie \\n[#PRE_COLLATE]=1 .
549 .    el \{\
550 .       if \\n[#COLLATE]=1 \
551 .          if !r#START .ds $DOC_FAM \\*[$FAMILY]
552 .    \}
553 .END
554 \#
555 \# FONT
556 \# ----
557 \# *Argument:
558 \#   R | I | B | BI | <other style extension>
559 \# *Function:
560 \#  Stores user supplied font in $FONT and sets .ft to $FONT.
561 \#
562 .MAC FT END
563 .    ds $FONT \\$1
564 .    if \\n[#PRINT_STYLE]=1 \{\
565 .       ie '\\$1'I' \{\
566 .          if \\n[#UNDERLINE_ITALIC]=1 \{\
567 .             UNDERLINE
568 .             return
569 .          \}
570 .          if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
571 .             ds $FONT \\$1
572 .             ft \\*[$FONT]
573 .             return
574 .          \}
575 .       \}
576 .       el .UNDERLINE OFF
577 .       return
578 .    \}
579 .    ft 0
580 .    ft \\*[$FONT]
581 .    if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
582 .       if '\\n[.sty]'' \{\
583 .          if !F\\n[.fn] \{\
584 .             if !S\\*[$FONT] \{\
585 .                tm1 "[mom]: Font style "\\*[$FONT]" at line \\n[.c] has not been registered.
586 .                ie \\n[#ABORT_FT_ERRORS]=0 \
587 .                   tm1 "       Continuing to process using fallback font.
588 .                el .ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
589 .             \}
590 .             if \\n[.f]=0 \{\
591 .                tm1 "[mom]: Either font style "\\*[$FONT]" at line \\n[.c] does not exist in family "\\n[.fam]",
592 .                tm1 "       or family "\\n[.fam]" has not been installed.
593 .                ie \\n[#ABORT_FT_ERRORS]=0 \
594 .                   tm1 "       Continuing to process using fallback font.
595 .                el .ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
596 .             \}
597 .          \}
598 .       \}
599 .    \}
600 .END
601 \#
602 \# POINT SIZE
603 \# ----------
604 \# *Arguments:
605 \#   <point size of type>
606 \# *Function:
607 \#   Sets point size to user supplied value in scaled points.
608 \#   If #AUTO_LEAD is on, resets lead accordingly.
609 \# *Notes:
610 \#   Must NOT use a unit of measure.
611 \#
612 .MAC PT_SIZE END
613 .    if \\n[#PRINT_STYLE]=1 .return
614 .    if \\n[#IGNORE] .return
615 .    ps \\$1
616 .    nr #PT_SIZE_IN_UNITS \\n[.ps]
617 .    ie '\\$0'DOC_PT_SIZE' \{\
618 .       if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
619 .       br
620 .       nr #NEW_DOC_PT_SIZE \\n[.ps]
621 .       if \\n[#DOC_AUTOLEAD] \{\
622 .          ie !\\n[#DOC_AUTOLEAD_FACTOR] .nr #AUTOLEADING \\n[#DOC_AUTOLEAD]
623 .          el .nr #AUTOLEADING \\n[.ps]*\\n[#DOC_AUTOLEAD]/1000-\\n[.ps]
624 .          nr #DOC_LEAD \\n[.ps]+\\n[#AUTOLEADING]
625 .          nr #RESET_TRAPS 1
626 .       \}
627 .    \}
628 .    el .if \\n[#AUTO_LEAD] .vs \\n[.ps]u+\\n[#AUTOLEADING]u
629 .END
630 \#
631 \# SIZE (inline)
632 \# -------------
633 \# *Arguments:
634 \#   <point size of type>
635 \# *Function:
636 \#   Sets point size to user supplied value in scaled points.
637 \#   Intended to be called inline with \*[SIZE <n><unit>]
638 \# *Notes:
639 \#   Can be used with a unit of measure or not.
640 \#
641 .MAC SIZE END
642 \c
643 .ps \\$1
644 .END
645 \#
646 \# LEADING
647 \# -------
648 \# *Argument:
649 \#   <leading between lines of text>
650 \# *Function:
651 \#   Turns off #AUTOLEAD if it's on.
652 \#   Sets .vs to user supplied value.
653 \# *Notes:
654 \#   Does not require unit of measure.  LS automatically turns off AUTOLEAD.
655 \#
656 .MAC LS END
657 .    br
658 .    nr #OLD_LEAD \\n[.v]
659 .    if \\n[#PRINT_STYLE]=1 .return
660 .    if \\n[#IGNORE] .return
661 .    if \\n[#AUTO_LEAD] \{\
662 .       rr #AUTO_LEAD
663 .       rr #AUTOLEAD_VALUE
664 .       rr #AUTOLEADING
665 .    \}
666 .    vs \\$1
667 .    if \\n[.t]<\\n[.v] 'bp
668 .    if \\n[#TOP] \{\
669 .       nr #TOP_BASELINE_ADJ \\n[.v]-\\n[#OLD_LEAD]
670 .       sp -\\n[#TOP_BASELINE_ADJ]u
671 .       rr #TOP
672 .       rr #TOP_BASELINE_ADJ
673 .    \}
674 .END
675 \#
676 \# AUTOLEAD
677 \# --------
678 \# *Argument:
679 \#   <leading value to add to #PT_SIZE> [FACTOR]
680 \# *Function:
681 \#   Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
682 \#   Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
683 \#   All subsequent PT_SIZE requests reset the leading in the same way until
684 \#   AUTOLEAD is turned off.
685 \# *Notes:
686 \#   With the optional FACTOR argument, the current point size is
687 \#   multiplied by #AUTOLEAD_VALUE/1000 instead of the two being added
688 \#   together.
689 \#
690 .MAC AUTOLEAD END
691 .    if \\n[#PRINT_STYLE]=1 .return
692 .    if \\n[#IGNORE] .return
693 .    nr #AUTO_LEAD 1 \" autolead on or off
694 .    nr #OLD_LEAD \\n[.v]
695 .    nr #AUTOLEAD_VALUE (p;\\$1) \" arg x 1000
696 .    ie '\\$2'FACTOR' \{\
697 .       if !\\n[#DOCS] .nr #DOC_AUTOLEAD_FACTOR \\n[#AUTOLEAD_VALUE] \" save for DOC_PT_SIZE
698 .       nr #AUTOLEADING \\n[.ps]*\\n[#AUTOLEAD_VALUE]/1000-\\n[.ps]
699 .    \}
700 .    el .nr #AUTOLEADING \\n[#AUTOLEAD_VALUE]
701 .    vs \\n[.ps]u+\\n[#AUTOLEADING]u
702 .    if \\n[#TOP] \{\
703 .       nr #TOP_BASELINE_ADJ \\n[.v]-\\n[#OLD_LEAD]
704 .       sp -\\n[#TOP_BASELINE_ADJ]u
705 .       rr #TOP
706 .       rr #TOP_BASELINE_ADJ
707 .    \}
708 .END
709 \#
710 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
711 \# ------------------------------------------------
712 .ds ROM  \Ef[R]
713 .ds IT   \Ef[I]
714 .ds BD   \Ef[B]
715 .ds BDI  \Ef[BI]
716 .ds PREV \Ef[]
717 .ds S    \Es
718 \#
719 \# =====================================================================
720 \#
721 \# +++KERNING+++
722 \#
723 \# AUTOMATIC PAIRWISE KERNING
724 \# --------------------------
725 \# *Arguments:
726 \#   <none> | <anything>
727 \# *Function:
728 \#   Turns automatic pairwise kerning on or off.
729 \#
730 .MAC KERN END
731 .    ie '\\$1'' \{\
732 .       kern
733 .       nr #KERN 1
734 .    \}
735 .    el \{\
736 .       kern 0
737 .       nr #KERN 0
738 .    \}
739 .END
740 \#
741 \# INLINE KERNING AND HORIZONTAL MOVEMENT
742 \# --------------------------------------
743 \#
744 \# Inline kerning provides a simple way to adjust the amount of
745 \# space between any two letters.  It's predicated on a unit of
746 \# measure "U", which, by default, is 1/36 of the current point
747 \# size as returned by \n[.ps]; e.g., if the current point size is
748 \# 18, \n[.ps] returns 18000u, therefore U=500u.  Since U remains
749 \# proportional relative to the current point size, the amount of
750 \# kerning between two letters as expressed in Us remains visually
751 \# similar regardless of changes in point size.
752 \#
753 \# The default value for U may be changed or reset with the
754 \# KERN_UNIT macro.
755 \#
756 .MAC KERN_UNIT END
757 .    ie '\\$1'DEFAULT' .nr #KERN_UNIT 36
758 .    el .nr #KERN_UNIT \\$1
759 .END
760 \#
761 .nr #KERN_UNIT 36
762 .ds BU   \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
763 .ds FU   \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
764 \#
765 \# Initialize strings for pre-1.1.3c-style BU and FU
766 \#
767 .nr #LOOP 0 1
768 .while \n+[#LOOP]<37 \{\
769 .   ds BU\n[#LOOP]  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
770 .\}
771 \#
772 .nr #LOOP 0 1
773 .while \n+[#LOOP]<37 \{\
774 .   ds FU\n[#LOOP] \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
775 .\}
776 .rr #LOOP
777 \#
778 \# Horizontal movements
779 \# --------------------
780 \# BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
781 \# specified number of points.
782 \#
783 .ds BCK  \h'-\\$1'
784 .ds FWD  \h'\\$1'
785 \#
786 .ds BP.25    \h'-.25'
787 .ds BP.5     \h'-.5'
788 .ds BP.75    \h'-.75'
789 .ds BP1      \h'-1p'
790 .ds BP1.25   \h'-1.25p'
791 .ds BP1.5    \h'-1.5p'
792 .ds BP1.75   \h'-1.75p'
793 .ds BP2      \h'-2p'
794 .ds BP2.25   \h'-2.25p'
795 .ds BP2.5    \h'-2.5p'
796 .ds BP2.75   \h'-2.75p'
797 .ds BP3      \h'-3p'
798 .ds BP3.25   \h'-3.25p'
799 .ds BP3.5    \h'-3.5p'
800 .ds BP3.75   \h'-3.75p'
801 .ds BP4      \h'-4p'
802 .ds BP4.25   \h'-4.25p'
803 .ds BP4.5    \h'-4.5p'
804 .ds BP4.75   \h'-4.75p'
805 .ds BP5      \h'-5p'
806 .ds BP5.25   \h'-5.25p'
807 .ds BP5.5    \h'-5.5p'
808 .ds BP5.75   \h'-5.75p'
809 .ds BP6      \h'-6p'
810 .ds BP6.25   \h'-6.25p'
811 .ds BP6.5    \h'-6.5p'
812 .ds BP6.75   \h'-6.75p'
813 .ds BP7      \h'-7p'
814 .ds BP7.25   \h'-7.25p'
815 .ds BP7.5    \h'-7.5p'
816 .ds BP7.75   \h'-7.75p'
817 .ds BP8      \h'-8p'
818 .ds BP8.25   \h'-8.25p'
819 .ds BP8.5    \h'-8.5p'
820 .ds BP8.75   \h'-8.75p'
821 .ds BP9      \h'-9p'
822 .ds BP9.25   \h'-9.25p'
823 .ds BP9.5    \h'-9.5p'
824 .ds BP9.75   \h'-9.75p'
825 .ds BP10     \h'-10p'
826 .ds BP10.25  \h'-10.25p'
827 .ds BP10.5   \h'-10.5p'
828 .ds BP10.75  \h'-10.75p'
829 .ds BP11     \h'-11p'
830 .ds BP11.25  \h'-11.25p'
831 .ds BP11.5   \h'-11.5p'
832 .ds BP11.75  \h'-11.75p'
833 .ds BP12     \h'-12p'
834 .ds BP12.25  \h'-12.25p'
835 .ds BP12.5   \h'-12.5p'
836 .ds BP12.75  \h'-12.75p'
837 \#
838 .ds FP.25    \h'.25'
839 .ds FP.5     \h'.5'
840 .ds FP.75    \h'.75'
841 .ds FP1      \h'1p'
842 .ds FP1.25   \h'1.25p'
843 .ds FP1.5    \h'1.5p'
844 .ds FP1.75   \h'1.75p'
845 .ds FP2      \h'2p'
846 .ds FP2.25   \h'2.25p'
847 .ds FP2.5    \h'2.5p'
848 .ds FP2.75   \h'2.75p'
849 .ds FP3      \h'3p'
850 .ds FP3.25   \h'3.25p'
851 .ds FP3.5    \h'3.5p'
852 .ds FP3.75   \h'3.75p'
853 .ds FP4      \h'4p'
854 .ds FP4.25   \h'4.25p'
855 .ds FP4.5    \h'4.5p'
856 .ds FP4.75   \h'4.75p'
857 .ds FP5      \h'5p'
858 .ds FP5.25   \h'5.25p'
859 .ds FP5.5    \h'5.5p'
860 .ds FP5.75   \h'5.75p'
861 .ds FP6      \h'6p'
862 .ds FP6.25   \h'6.25p'
863 .ds FP6.5    \h'6.5p'
864 .ds FP6.75   \h'6.75p'
865 .ds FP7      \h'7p'
866 .ds FP7.25   \h'7.25p'
867 .ds FP7.5    \h'7.5p'
868 .ds FP7.75   \h'7.75p'
869 .ds FP8      \h'8p'
870 .ds FP8.25   \h'8.25p'
871 .ds FP8.5    \h'8.5p'
872 .ds FP8.75   \h'8.75p'
873 .ds FP9      \h'9p'
874 .ds FP9.25   \h'9.25p'
875 .ds FP9.5    \h'9.5p'
876 .ds FP9.75   \h'9.75p'
877 .ds FP10     \h'10p'
878 .ds FP10.25  \h'10.25p'
879 .ds FP10.5   \h'10.5p'
880 .ds FP10.75  \h'10.75p'
881 .ds FP11     \h'11p'
882 .ds FP11.25  \h'11.25p'
883 .ds FP11.5   \h'11.5p'
884 .ds FP11.75  \h'11.75p'
885 .ds FP12     \h'12p'
886 .ds FP12.25  \h'12.25p'
887 .ds FP12.5   \h'12.5p'
888 .ds FP12.75  \h'12.75p'
889 \#
890 \# WHOLE LINE (TRACK) KERNING
891 \# --------------------------
892 \# *Argument:
893 \#   <amount of track kerning>
894 \# *Function:
895 \#   Invokes .tkf (track kerning) for the current font with
896 \#   1 as both the upper and lower point size limits, so that
897 \#   the value entered by the user applies regardless of point
898 \#   size.  RW ("Reduce Whitespace") reduces the amount of space
899 \#   between all characters by an equal amount.  EW ("Extra
900 \#   Whitespace") increases the amount of space.
901 \# *Notes:
902 \#   Decimal values are acceptable.
903 \#
904 \# A value of 1 will produce an unacceptably tight or loose line
905 \# at most text point sizes; therefore, effective use of RW and
906 \# EW is in the fractional range below 1.
907 \#
908 \# \n[.f] holds the current font number, which is acceptable to .tkf.
909 \#
910 \# RW and EW must be reset to 0 to cancel their effect on subsequent
911 \# output lines.
912 \#
913 .MAC RW END
914 .    if \\n[#BR_AT_LINE_KERN] \{\
915 .       ie \\n[#JUSTIFY]=1 .brp
916 .       el .br
917 .    \}
918 .    rr #EW
919 .    rm $EW
920 .    nr #RW 1
921 .    ds $RW \\$1
922 .    tkf \\n[.f] 1 -\\$1 1 -\\$1
923 .END
924 \#
925 .MAC EW END
926 .    if \\n[#BR_AT_LINE_KERN] \{\
927 .       ie \\n[#JUSTIFY]=1 .brp
928 .       el .br
929 .    \}
930 .    rr #RW
931 .    rm $RW
932 .    nr #EW 1
933 .    ds $EW \\$1
934 .    tkf \\n[.f] 1 \\$1 1 \\$1
935 .END
936 \#
937 \# BREAK AT LINE KERN
938 \# ------------------
939 \# *Arguments:
940 \#   toggle
941 \# *Function:
942 \#   Enables/disables .br's before .RW and .EW
943 \# *Notes:
944 \#   Mostly, users will want .br's before any kind of line kerning, but
945 \#   there may be cases where they don't.  BR_AT_LINE_KERN is off by
946 \#   default and must be invoked explicitly.
947 \#
948 .MAC BR_AT_LINE_KERN END
949 .    ie '\\$1'' .nr #BR_AT_LINE_KERN  1
950 .    el .rr #BR_AT_LINE_KERN
951 .END
952 \#
953 \# =====================================================================
954 \#
955 \# +++HYPHENATION+++
956 \#
957 \# AUTO HYPHENATION
958 \# ----------------
959 \# *Arguments:
960 \#   <none> | <anything> | DEFAULT
961 \#                 or
962 \#   LINES <n> | MARGIN <n> | SPACE <n>
963 \# *Function:
964 \#   Turns auto hyphenation on or off, resets the hyphenation style
965 \#   to default, or permits the setting of various hyphenation
966 \#   parameters.
967 \# *Notes:
968 \#   HY, by itself, defaults to .hy 14, i.e. no hyphens after the
969 \#   first two or before the last two characters of a word, and no
970 \#   hyphenation of the last line prior to a trap (e.g., at the
971 \#   bottom of a page).
972 \#
973 \#   HY DEFAULT resets the hyphenation style to .hy 14 (see
974 \#   above) if that behaviour is desired after changes have been
975 \#   made to LINES, MARGIN, or SPACE.
976 \#
977 \#   HY LINES <n> sets the number of allowable consecutive hyphenated lines.
978 \#
979 \#   HY MARGIN <n> sets the amount of space (ipPcm) allowed at the end
980 \#   of a line in QUAD mode before hyphenation is tripped (e.g. if there's
981 \#   only 6 points left, groff won't try to hyphenate the next word).
982 \#
983 \#   HY SPACE sets the amount of extra interword space (ipPcm) that can
984 \#   be added in JUSTIFY mode to prevent a line from being hyphenated.
985 \#
986 .MAC HY END
987 .    ie '\\$1'' \{\
988 .       hy 14
989 .       if \\n[#LINES]  .hlm \\n[#LINES]
990 .       if \\n[#MARGIN] .hym \\n[#MARGIN]]
991 .       if \\n[#SPACE]  .hys \\n[#SPACE]
992 .       nr #HYPHENATE 1
993 .    \}
994 .    el \{\
995 .       if !'\\$1'LINES' \{\
996 .          nh
997 .          nr #HYPHENATE 0
998 .       \}
999 .       if !'\\$1'MARGIN' \{\
1000 .          nh
1001 .          nr #HYPHENATE 0
1002 .       \}
1003 .       if !'\\$1'SPACE' \{\
1004 .          nh
1005 .          nr #HYPHENATE 0
1006 .       \}
1007 .       if !'\\$1'DEFAULT' \{\
1008 .          nh
1009 .          nr #HYPHENATE 0
1010 .       \}
1011 .       if '\\$1'LINES'  \{\
1012 .          hlm \\$2
1013 .          nr #HY_LINES \\$2
1014 .       \}
1015 .       if '\\$1'MARGIN' \{\
1016 .          hym \\$2
1017 .          nr #HY_MARGIN \\$2
1018 .       \}
1019 .       if '\\$1'SPACE'  \{\
1020 .          hys \\$2
1021 .          nr #HY_SPACE \\$2
1022 .       \}
1023 .       if '\\$1'DEFAULT' \{\
1024 .          hlm -1
1025 .          hym 0
1026 .          hys 0
1027 .          rr #HY_LINES
1028 .          rr #HY_SPACE
1029 .          rr #HY_MARGIN
1030 .       \}
1031 .    \}
1032 .END
1033 \#
1034 \# HYPHENATION PARAMETERS
1035 \# ----------------------
1036 \# *Arguments:
1037 \#   <# of lines> | <size of margin> | <amount of interword space>
1038 \# *Function:
1039 \#   Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
1040 \#
1041 .MAC HY_SET END
1042 .    nr #HY_SET 1
1043 .    hlm \\$1
1044 .    hym \\$2
1045 .    hys \\$3
1046 .END
1047 \#
1048 \# =====================================================================
1049 \#
1050 \# +++VERTICAL SPACING+++
1051 \#
1052 \# ADVANCE LEAD
1053 \# ------------
1054 \# *Argument:
1055 \#   <user supplied lead to advance below current baseline>
1056 \# *Function:
1057 \#   Creates or modifies register #ALD.  Adds user supplied lead
1058 \#   below current baseline.
1059 \# *Notes:
1060 \#   Requires a unit of measure.
1061 \#
1062 .MAC ALD END
1063 .    br
1064 .    if \\n[nl]=0 .nr #TOP 1
1065 .    if '\\$0'ALD' \{\
1066 .       nr #ALD (\\$1)
1067 .       sp \\n[#ALD]u
1068 .    \}
1069 .    if '\\$0'ADD_SPACE' \{\
1070 .       vpt 0
1071 .       nr #ALD (\\$1)
1072 .       rs
1073 .       nop \&
1074 .       sp |\\n[#T_MARGIN]u-1v+\\n[#ALD]u
1075 .       rr @TOP
1076 .       nr #SPACE_ADDED 1
1077 .       vpt
1078 .    \}
1079 .    if '\\$0'SPACE' .sp \\$1
1080 .    if '\\$0'SP'    .sp \\$1
1081 .END
1082 \#
1083 \# REVERSE LEAD
1084 \# ------------
1085 \# *Argument:
1086 \#   <user supplied lead to reverse above current baseline>
1087 \# *Function:
1088 \#   Creates or modifies register #RLD.  Reverses user supplied
1089 \#   lead above current baseline.
1090 \# *Notes:
1091 \#   Requires a unit of measure.
1092 \#
1093 .MAC RLD END
1094 .    br
1095 .    nr #RLD (\\$1)
1096 .    sp -\\n[#RLD]u
1097 .END
1098 \#
1099 \# ALD/RLD STRINGS
1100 \# ---------------
1101 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding
1102 \# \*[RLD] forms have been left in for backward compatibility with
1103 \# documents created using mom-1.1.3c or earlier.  The preferred methods
1104 \# of advancing and reversing on the page inline are \*[UP <n><unit>]
1105 \# and \*[DOWN <n><unit>].
1106 \#
1107 .ds DOWN      \v'\\$1'
1108 .ds UP        \v'-\\$1'
1109 \#
1110 .ds ALD.25    \v'.25p'
1111 .ds ALD.5     \v'.5p'
1112 .ds ALD.75    \v'.75p'
1113 .ds ALD1      \v'1p'
1114 .ds ALD1.25   \v'1.25p'
1115 .ds ALD1.5    \v'1.5p'
1116 .ds ALD1.75   \v'1.75p'
1117 .ds ALD2      \v'2p'
1118 .ds ALD2.25   \v'2.25p'
1119 .ds ALD2.5    \v'2.5p'
1120 .ds ALD2.75   \v'2.75p'
1121 .ds ALD3      \v'3p'
1122 .ds ALD3.25   \v'3.25p'
1123 .ds ALD3.5    \v'3.5p'
1124 .ds ALD3.75   \v'3.75p'
1125 .ds ALD4      \v'4p'
1126 .ds ALD4.25   \v'4.25p'
1127 .ds ALD4.5    \v'4.5p'
1128 .ds ALD4.75   \v'4.75p'
1129 .ds ALD5      \v'5p'
1130 .ds ALD5.25   \v'5.25p'
1131 .ds ALD5.5    \v'5.5p'
1132 .ds ALD5.75   \v'5.75p'
1133 .ds ALD6      \v'6p'
1134 .ds ALD6.25   \v'6.25p'
1135 .ds ALD6.5    \v'6.5p'
1136 .ds ALD6.75   \v'6.75p'
1137 .ds ALD7      \v'7p'
1138 .ds ALD7.25   \v'7.25p'
1139 .ds ALD7.5    \v'7.5p'
1140 .ds ALD7.75   \v'7.75p'
1141 .ds ALD8      \v'8p'
1142 .ds ALD8.25   \v'8.25p'
1143 .ds ALD8.5    \v'8.5p'
1144 .ds ALD8.75   \v'8.75p'
1145 .ds ALD9      \v'9p'
1146 .ds ALD9.25   \v'9.25p'
1147 .ds ALD9.5    \v'9.5p'
1148 .ds ALD9.75   \v'9.75p'
1149 .ds ALD10     \v'10p'
1150 .ds ALD10.25  \v'10.25p'
1151 .ds ALD10.5   \v'10.5p'
1152 .ds ALD10.75  \v'10.75p'
1153 .ds ALD11     \v'11p'
1154 .ds ALD11.25  \v'11.25p'
1155 .ds ALD11.5   \v'11.5p'
1156 .ds ALD11.75  \v'11.75p'
1157 .ds ALD12     \v'12p'
1158 .ds ALD12.25  \v'12.5p'
1159 .ds ALD12.5   \v'12.5p'
1160 .ds ALD12.75  \v'12.75p'
1161 \#
1162 .ds RLD.25    \v'-.25p'
1163 .ds RLD.5     \v'-.5p'
1164 .ds RLD.75    \v'-.75p'
1165 .ds RLD1      \v'-1p'
1166 .ds RLD1.25   \v'-1.25p'
1167 .ds RLD1.5    \v'-1.5p'
1168 .ds RLD1.75   \v'-1.75p'
1169 .ds RLD2      \v'-2p'
1170 .ds RLD2.25   \v'-2.25p'
1171 .ds RLD2.5    \v'-2.5p'
1172 .ds RLD2.75   \v'-2.75p'
1173 .ds RLD3      \v'-3p'
1174 .ds RLD3.25   \v'-3.25p'
1175 .ds RLD3.5    \v'-3.5p'
1176 .ds RLD3.75   \v'-3.75p'
1177 .ds RLD4      \v'-4p'
1178 .ds RLD4.25   \v'-4.25p'
1179 .ds RLD4.5    \v'-4.5p'
1180 .ds RLD4.75   \v'-4.75p'
1181 .ds RLD5      \v'-5p'
1182 .ds RLD5.25   \v'-5.25p'
1183 .ds RLD5.5    \v'-5.5p'
1184 .ds RLD5.75   \v'-5.75p'
1185 .ds RLD6      \v'-6p'
1186 .ds RLD6.25   \v'-6.25p'
1187 .ds RLD6.5    \v'-6.5p'
1188 .ds RLD6.75   \v'-6.75p'
1189 .ds RLD7      \v'-7p'
1190 .ds RLD7.25   \v'-7.25p'
1191 .ds RLD7.5    \v'-7.5p'
1192 .ds RLD7.75   \v'-7.75p'
1193 .ds RLD8      \v'-8p'
1194 .ds RLD8.25   \v'-8.25p'
1195 .ds RLD8.5    \v'-8.5p'
1196 .ds RLD8.75   \v'-8.75p'
1197 .ds RLD9      \v'-9p'
1198 .ds RLD9.25   \v'-9.25p'
1199 .ds RLD9.5    \v'-9.5p'
1200 .ds RLD9.75   \v'-9.75p'
1201 .ds RLD10     \v'-10p'
1202 .ds RLD10.25  \v'-10.25p'
1203 .ds RLD10.5   \v'-10.5p'
1204 .ds RLD10.75  \v'-10.75p'
1205 .ds RLD11     \v'-11p'
1206 .ds RLD11.25  \v'-11.25p'
1207 .ds RLD11.5   \v'-11.5p'
1208 .ds RLD11.75  \v'-11.75p'
1209 .ds RLD12     \v'-12p'
1210 .ds RLD12.25  \v'-12.5p'
1211 .ds RLD12.5   \v'-12.5p'
1212 .ds RLD12.75  \v'-12.75p'
1213 \#
1214 \# =====================================================================
1215 \#
1216 \# +++REFINEMENTS+++
1217 \#
1218 \# AUTOMATIC LIGATURES
1219 \# -------------------
1220 \# *Arguments:
1221 \#   <none> | <anything>
1222 \# *Function:
1223 \#   Turns automatic ligature generation on or off.
1224 \# *Notes:
1225 \#   Ligatures may be supplied manually with \[fi], \[fl], etc.
1226 \#
1227 .MAC LIGATURES END
1228 .    ie '\\$1'' \{\
1229 .       lg
1230 .       nr #LIGATURES 1
1231 .    \}
1232 .    el \{\
1233 .       lg 0
1234 .       nr #LIGATURES 0
1235 .    \}
1236 .END
1237 \#
1238 \# SMARTQUOTES
1239 \# -----------
1240 \# *Arguments:
1241 \#   [ ,, ] | [ << ] | [ >> ] | <anything>
1242 \#   or
1243 \#   [ DA | DE | EN | ES | FR | IT | NL | NO | PT | SV ] | <anything>
1244 \# *Function:
1245 \#   Turns smartquotes on (optionally with a quoting style from the
1246 \#   argument list, or off).
1247 \#   If no quoting style is given, then EN (English) is used by default.
1248 \#   If no quoting style is given and smart quotes have been turned off
1249 \#   previously, the old quoting style will be restored.
1250 \# *Notes:
1251 \#   The " character is read outside the macro when mom is
1252 \#   processed.  The strings for open/close ($QUOTE<n>) are then
1253 \#   defined in the macro.
1254 \#
1255 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1256 .nr #SQ_ON 0
1257 \#
1258 .MAC SMARTQUOTES END
1259 .\" First " will be translated to $QUOTE0
1260 .    nr #OPEN_CLOSE 0
1261 .    if '\\$1'' \{\
1262 .       if !'\\*[$RESTORE_SQ]'' \{\
1263 .          SMARTQUOTES \\*[$RESTORE_SQ]
1264 .          return
1265 .       \}
1266 .\" Default smart quotes (English)
1267 .       ds $QUOTE0 \[lq]
1268 .       ds $QUOTE1 \[rq]
1269 .       ds $RESTORE_SQ EN
1270 .       nr #SQ_ON 1
1271 .       return
1272 .    \}
1273 .    if '\\$1',,' \{\
1274 .       ds $QUOTE0 \[Bq]
1275 .       ds $QUOTE1 \[lq]
1276 .       ds $RESTORE_SQ \\$1
1277 .       nr #SQ_ON 1
1278 .       return
1279 .    \}
1280 .    if '\\$1'<<' \{\
1281 .       ds $QUOTE0 \[Fo]
1282 .       ds $QUOTE1 \[Fc]
1283 .       ds $RESTORE_SQ \\$1
1284 .       nr #SQ_ON 1
1285 .       return
1286 .    \}
1287 .    if '\\$1'>>' \{\
1288 .       ds $QUOTE0 \[Fc]
1289 .       ds $QUOTE1 \[Fo]
1290 .       ds $RESTORE_SQ \\$1
1291 .       nr #SQ_ON 1
1292 .       return
1293 .    \}
1294 .    if '\\$1'DA' \{\
1295 .       ds $QUOTE0 \[Fc]
1296 .       ds $QUOTE1 \[Fo]
1297 .       ds $RESTORE_SQ \\$1
1298 .       nr #SQ_ON 1
1299 .       return
1300 .    \}
1301 .    if '\\$1'DE' \{\
1302 .       ds $QUOTE0 \[Bq]
1303 .       ds $QUOTE1 \[lq]
1304 .       ds $RESTORE_SQ \\$1
1305 .       nr #SQ_ON 1
1306 .       return
1307 .    \}
1308 .    if '\\$1'EN' \{\
1309 .       ds $QUOTE0 \[lq]
1310 .       ds $QUOTE1 \[rq]
1311 .       ds $RESTORE_SQ \\$1
1312 .       nr #SQ_ON 1
1313 .       return
1314 .    \}
1315 .    if '\\$1'ES' \{\
1316 .       ds $QUOTE0 \[lq]
1317 .       ds $QUOTE1 \[rq]
1318 .       ds $RESTORE_SQ \\$1
1319 .       nr #SQ_ON 1
1320 .       return
1321 .    \}
1322 .    if '\\$1'FR' \{\
1323 .       ds $QUOTE0 \[Fo]\|
1324 .       ds $QUOTE1 \|\[Fc]
1325 .       ds $RESTORE_SQ \\$1
1326 .       nr #SQ_ON 1
1327 .       return
1328 .    \}
1329 .    if '\\$1'IT' \{\
1330 .       ds $QUOTE0 \[Fo]\|
1331 .       ds $QUOTE1 \|\[Fc]
1332 .       ds $RESTORE_SQ \\$1
1333 .       nr #SQ_ON 1
1334 .       return
1335 .    \}
1336 .    if '\\$1'NL' \{\
1337 .       ds $QUOTE0 \[rq]
1338 .       ds $QUOTE1 \[rq]
1339 .       ds $RESTORE_SQ \\$1
1340 .       nr #SQ_ON 1
1341 .       return
1342 .    \}
1343 .    if '\\$1'NO' \{\
1344 .       ds $QUOTE0 \[Fo]
1345 .       ds $QUOTE1 \[Fc]
1346 .       ds $RESTORE_SQ \\$1
1347 .       nr #SQ_ON 1
1348 .       return
1349 .    \}
1350 .    if '\\$1'PT' \{\
1351 .       ds $QUOTE0 \[Fo]
1352 .       ds $QUOTE1 \[Fc]
1353 .       ds $RESTORE_SQ \\$1
1354 .       nr #SQ_ON 1
1355 .       return
1356 .    \}
1357 .    if '\\$1'SV' \{\
1358 .       ds $QUOTE0 \[Fc]
1359 .       ds $QUOTE1 \[Fc]
1360 .       ds $RESTORE_SQ \\$1
1361 .       nr #SQ_ON 1
1362 .       return
1363 .    \}
1364 .\" None of the above -> turn smartquotes off
1365 .    ds $QUOTE0 \[dq]
1366 .    ds $QUOTE1 \[dq]
1367 .    nr #SQ_ON 0
1368 .END
1369 \#
1370 .ds $QUOTE0 \[lq]
1371 .ds $QUOTE1 \[rq]
1372 \#
1373 \# Strings for foot and inch marks
1374 \#
1375 .ds FOOT \[fm]
1376 .ds INCH \[fm]\[fm]
1377 \#
1378 \# =====================================================================
1379 \#
1380 \# +++LINE BREAKS+++
1381 \#
1382 \# NO-SPACE BREAK
1383 \# --------------
1384 \# *Argument:
1385 \#   <none>
1386 \# *Function:
1387 \#   Breaks a line without advancing.
1388 \# *Notes:
1389 \#   EL is the mnemonic used on older, dedicated typesetting machines
1390 \#   to indicate "process the line, without advancing the galley
1391 \#   medium."  It stands for End Line.
1392 \#
1393 \#   The \c inline must be appended to the end of input lines when in
1394 \#   nofill mode; in fill modes, the \c inline must not be used.
1395 \#
1396 .MAC EL END
1397 .    TRAP OFF
1398 .    if \\n[#PSEUDO_FILL]=1 \&
1399 .    br
1400 .    sp -1v
1401 .    TRAP
1402 .END
1403 \#
1404 \# An inline escape to accomplish the same thing.
1405 \# Preferable, since it works with filled and non-filled copy and
1406 \# doesn't require the user to remember whether to use (or not use)
1407 \# \c.
1408 \#
1409 .ds B \h'|0'\R'#NO_ADVANCE 1'\c
1410 \#
1411 \# =====================================================================
1412 \#
1413 \# +++FILLING/QUADDING/JUSTIFYING+++
1414 \#
1415 \# JUSTIFY
1416 \# -------
1417 \# *Argument:
1418 \#   <none>
1419 \# *Function:
1420 \#   Turns fill on and sets .ad to b.
1421 \# *Notes:
1422 \#   Justifies text left and right.
1423 \#
1424 .MAC JUSTIFY END
1425 .    if \\n[#TAB_ACTIVE]=0 \{\
1426 .       nr #QUAD 1
1427 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1428 .    \}
1429 '    ce 0
1430 .    QUAD J
1431 .    if \\n[#PRINT_STYLE]=1 .QUAD L
1432 .    nr #PSEUDO_FILL 0
1433 .END
1434 \#
1435 \# QUAD
1436 \# ----
1437 \# *Arguments:
1438 \#   L | LEFT | R | RIGHT | C | CENTER/CENTRE
1439 \# *Function:
1440 \#   Turns fill on and sets .ad to l, r, or c.
1441 \# *Notes:
1442 \#   Terminology is a problem here.  Some people call quad left
1443 \#   left justified, flush left, or flush left/rag right (and the
1444 \#   reverse for quad right).  Quad center is sometimes called rag
1445 \#   both.  For our purposes, all "quad" modes mean that groff fill
1446 \#   mode is enabled.
1447 \#
1448 .MAC QUAD END
1449 .    ds $QUAD_VALUE \\$1
1450 .    if \\n[#TAB_ACTIVE]=0 \{\
1451 .       nr #QUAD 1
1452 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1453 .    \}
1454 '    ce 0
1455 '    fi
1456 .    if '\\*[$QUAD_VALUE]'L' \{\
1457 .       nr #JUSTIFY 0
1458 .       ad l
1459 .    \}
1460 .    if '\\*[$QUAD_VALUE]'LEFT' \{\
1461 .       nr #JUSTIFY 0
1462 .       ad l
1463 .    \}
1464 .    if '\\*[$QUAD_VALUE]'R' \{\
1465 .       nr #JUSTIFY 0
1466 .       ad r
1467 .    \}
1468 .    if '\\*[$QUAD_VALUE]'RIGHT' \{\
1469 .       nr #JUSTIFY 0
1470 .       ad r
1471 .    \}
1472 .    if '\\*[$QUAD_VALUE]'C' \{\
1473 .       nr #JUSTIFY 0
1474 .       ad c
1475 .    \}
1476 .    if '\\*[$QUAD_VALUE]'CENTER' \{\
1477 .       nr #JUSTIFY 0
1478 .       ad c
1479 .    \}
1480 .    if '\\*[$QUAD_VALUE]'CENTRE' \{\
1481 .       nr #JUSTIFY 0
1482 .       ad c
1483 .    \}
1484 .    if '\\*[$QUAD_VALUE]'J' \{\
1485 .       nr #JUSTIFY 1
1486 .       ad b
1487 .    \}
1488 .    if '\\*[$QUAD_VALUE]'JUSTIFY' \{\
1489 .       nr #JUSTIFY 1
1490 .       ad b
1491 .    \}
1492 .    nr #PSEUDO_FILL 0
1493 .END
1494 \#
1495 \# LEFT, RIGHT, AND CENTER
1496 \# -----------------------
1497 \# The purpose of these macros is to allow the user to enter lines
1498 \# of text that will be quadded LRC having to stick .BR or .br
1499 \# between lines.  For the sake of consistency, all three appear to
1500 \# behave similarly (from the point of view of the user), although
1501 \# the underlying primitives don't.  For this reason, LEFT, RIGHT,
1502 \# and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY to
1503 \# restore text to fill mode.
1504 \#
1505 \# LEFT
1506 \# ----
1507 \# *Argument:
1508 \#   <none>
1509 \# *Function:
1510 \#   Turns fill mode off.  Allows user to quad lines left without
1511 \#   requiring the .BR or .br macro.
1512 \# *Notes:
1513 \#   LEFT simply turns fill off.  Lines that exceed the current LL
1514 \#   will not be broken.  Note that this behaviour differs from the
1515 \#   RIGHT and CENTER macros.
1516 \#
1517 .MAC LEFT END
1518 .    if \\n[#TAB_ACTIVE]=0 \{\
1519 .       rr #QUAD
1520 .       ds $RESTORE_QUAD_VALUE LEFT
1521 .    \}
1522 .    ce 0
1523 .    nf
1524 .    nr #PSEUDO_FILL 1
1525 .\" Fix for a little conflict with DOCTYPE LETTER
1526 .    if '\\n[.z]'LETTERHEAD1' .rr #DATE_FIRST
1527 .END
1528 \#
1529 \# RIGHT
1530 \# -----
1531 \# *Argument:
1532 \#   <none>
1533 \# *Function:
1534 \#   Turns fill on.  Allows user to quad lines right without
1535 \#   requiring the .BR or .br macro.
1536 \# *Notes:
1537 \#   Lines that exceed the current LL will be broken, with the excess
1538 \#   text quadded right.
1539 \#
1540 .MAC RIGHT END
1541 .    if \\n[#TAB_ACTIVE]=0 \{\
1542 .       rr #QUAD
1543 .       ds $RESTORE_QUAD_VALUE RIGHT
1544 .    \}
1545 .    nf
1546 .    rj 100000
1547 .    nr #PSEUDO_FILL 1
1548 .END
1549 \#
1550 \# CENTER
1551 \# ------
1552 \# *Argument:
1553 \#   <none>
1554 \# *Function:
1555 \#   Turns fill on.  Allows user to center lines without
1556 \#   requiring the .BR or .br macro.
1557 \# *Notes:
1558 \#   Lines that exceed the current LL will be broken, with the excess
1559 \#   text centered.
1560 \#
1561 .MAC CENTER END
1562 .    if \\n[#TAB_ACTIVE]=0 \{\
1563 .       rr #QUAD
1564 .       ds $RESTORE_QUAD_VALUE CENTER
1565 .    \}
1566 .    nf
1567 .    ce 100000
1568 .    nr #PSEUDO_FILL 1
1569 .END
1570 \#
1571 \# =====================================================================
1572 \#
1573 \# +++TABS+++
1574 \#
1575 \# There are two different kinds of tabs: typesetting tabs and
1576 \# string tabs.
1577 \#
1578 \# Typesetting tabs are set with TAB_SET, which requires a tab number,
1579 \# an indent (offset) from the left margin and a length (optionally
1580 \# with a quad direction and an instruction to fill lines).  After tabs
1581 \# are set with TAB_SET, they are called with .TAB n, where "n"
1582 \# corresponds to the number passed to TAB_SET as a valid tab number.
1583 \#
1584 \# String tabs allow the user to mark off tab positions inline.  Tab
1585 \# indents and lengths are calculated from the beginning and end
1586 \# positions of the marks.  Up to 19 string tabs may be created,
1587 \# numbered 1-19.  Once created, they are called with .TAB n,
1588 \# just like typesetting tabs.
1589 \#
1590 \# Setting up string tabs is a two-step procedure.  First, the user
1591 \# enters an input line in which s/he wants to mark off string tabs.
1592 \# The beginning of a tab is marked with \*[STn], where "n" is
1593 \# the desired number of the tab.  The end of the the tab is marked
1594 \# with \*[STnX].  All ST's must have a matching STX.  String tabs
1595 \# may be nested.
1596 \#
1597 \# Next, the user invokes .ST n for every string tab defined, and
1598 \# optionally passes quad information to it.  That done, string tabs
1599 \# can be called just like typesetting tabs.
1600 \#
1601 \# Strings for string tab inlines
1602 \# ------------------------------
1603 \# Initialize string tab markers numbered 1 to 19.
1604 \#
1605 .nr #LOOP 0 1
1606 .while \n+[#LOOP]<20 \{\
1607 .   ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET]
1608 .\}
1609 \#
1610 .nr #LOOP 0 1
1611 .while \n+[#LOOP]<20 \{\
1612 .   ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK]
1613 .\}
1614 .rr #LOOP
1615 \#
1616 \# These are reserved ST numbers for internal use
1617 .ds ST100  \Ek[#ST100_OFFSET]
1618 .ds ST100X \Ek[#ST100_MARK]
1619 .ds ST101  \Ek[#ST101_OFFSET]
1620 .ds ST101X \Ek[#ST101_MARK]
1621 .ds ST102  \Ek[#ST102_OFFSET]
1622 .ds ST102X \Ek[#ST102_MARK]
1623 .ds ST103  \Ek[#ST103_OFFSET]
1624 .ds ST103X \Ek[#ST103_MARK]
1625 \#
1626 \# QUAD AND SET STRING TABS
1627 \# ------------------------
1628 \# *Arguments:
1629 \#   <stringtab number>  L | R | C | J  [QUAD]
1630 \# *Function:
1631 \#   Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1632 \#   tab based on the collected information.
1633 \# *Notes:
1634 \#   Like TAB_SET, ST invoked without a quad direction will default to LEFT.
1635 \#   If lines should be filled and quadded, use the optional argument QUAD.
1636 \#   N.B. -- indents *must* be turned off before setting string tabs
1637 \#   inside .PAD
1638 \#
1639 .MAC ST END
1640 .    ds $ST\\$1_QUAD_DIR \\$2
1641 .    if \\n[#NUM_ARGS]=3 .ds $ST\\$1_FILL QUAD
1642 .    nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1643 .    ie \\n[#IN_TAB] \
1644 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \
1645           \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1646 .    el \
1647 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \
1648           \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1649 .END
1650 \#
1651 \# TAB SET
1652 \# -------
1653 \# *Arguments:
1654 \#   <n>  ident(ipPcm)  length(ipPcm)  [L | R | C | J [QUAD]]
1655 \# *Function:
1656 \#   Creates macros TABn and TAB n, where "n" is any arbitrary number.
1657 \#   TABn is a typesetting tab (i.e. a tab defined as an indent
1658 \#   from the page left offset plus a line length.)
1659 \# *Notes:
1660 \#   n      = arbitrary digit to identify the tab
1661 \#   indent = indent from left margin; unit of measure required
1662 \#   length = length of tab (unit of measure required; can be
1663 \#            \w'<string>'u--if more than one word in string, surround
1664 \#            with double quotes "\w'<three word string>'"
1665 \#   LRCJ   = quad for tab (left, right, center, justified)
1666 \#            If option QUAD afterwards is not given, quad is line for line
1667 \#            (no fill mode), meaning that there's no need for .BR or .br
1668 \#            between lines.
1669 \#   QUAD   = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1670 \#            had been given).
1671 \#
1672 \#   N.B. -- indents *must* be turned off before setting tabs
1673 \#
1674 \# Tabs are not columnar in behaviour.  .TN and \*[TB+] permit
1675 \# bottom-line to bottom-line tab movement.
1676 \#
1677 \# When resetting tabs, .TQ must be invoked before .TAB_SET.
1678 \#
1679 \# Indents are turned off automatically whenever a new tab is called
1680 \# with TAB <n>.
1681 \#
1682 \# Generally, it's a good idea to make sure all indents are off
1683 \# before setting tabs.
1684 \#
1685 .MAC TAB_SET END
1686 .    br
1687 .    nr #TAB_NUMBER \\$1
1688 .    ds $CURRENT_TAB \\n[#TAB_NUMBER]
1689 .    nr #TAB_OFFSET (\\$2)
1690 .    nr #TAB_LENGTH (\\$3)
1691 .    MAC TAB\\n[#TAB_NUMBER]
1692 .        if !\\\\n[#TB+]=1 .br
1693 .        if \\\\n[#TB+]=1 \{\
1694 .           EL
1695 .           vpt 0
1696 .           rr #TB+
1697 .        \}
1698 .        in 0
1699 .        nr #TAB_ACTIVE 1
1700 .        nr #CURRENT_TAB \\n[#TAB_NUMBER]
1701 .        ds $CURRENT_TAB \\*[$CURRENT_TAB]
1702 .        nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1703 .        nr #ST_OFFSET \\n[#TAB_OFFSET]
1704 .        ie !'\\\\n[.z]'' \
1705 \!.         po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
1706 .        el \
1707 .           po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
1708 .        ll \\n[#TAB_LENGTH]u
1709 .        ta \En[.l]u
1710 .        ie '\\$5'QUAD' \{\
1711 .           if '\\$4'L' .QUAD L
1712 .           if '\\$4'R' .QUAD R
1713 .           if '\\$4'C' .QUAD C
1714 .           if '\\$4'J' .JUSTIFY
1715 .        \}
1716 .        el \{\
1717 .           if '\\$4''  .LEFT
1718 .           if '\\$4'L' .LEFT
1719 .           if '\\$4'R' .RIGHT
1720 .           if '\\$4'C' .CENTER
1721 .           if '\\$4'J' .JUSTIFY
1722 .        \}
1723 .        if \\\\n[#TN]=1 \{\
1724 .           TRAP
1725 .           rr #TN
1726 .        \}
1727 ..
1728 .    rr #TAB_ACTIVE
1729 .END
1730 \#
1731 \# TAB
1732 \# ---
1733 \# *Arguments:
1734 \#   <tab number to tab into>
1735 \# *Function:
1736 \#   Moves to tab number passed as an argument.
1737 \#
1738 .MAC TAB END
1739 .    ds $TAB_NUMBER \\$1
1740 .    TAB\\*[$TAB_NUMBER]
1741 .    nr #IN_TAB 1
1742 .END
1743 \#
1744 \# TAB NEXT
1745 \# --------
1746 \# *Argument:
1747 \#   <none>
1748 \# *Function:
1749 \#   Automagically moves to TAB<n+1> on the same line as the last
1750 \#   line of the previous tab.
1751 \# *Notes:
1752 \#   The \c inline must be appended to the end of input lines when in
1753 \#   nofill mode; in fill modes, the \c inline must not be used.
1754 \#
1755 .MAC TN END
1756 .    nr #TN 1
1757 .    TRAP OFF
1758 .    sp -1v
1759 .    nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1760 .    TAB\\n[#NEXT_TAB]
1761 .    TRAP
1762 .END
1763 \#
1764 \# An inline escape to accomplish the same thing.  Preferable, since
1765 \# it works with filled and non-filled copy and doesn't require the
1766 \# user to remember to use (or not use) the \c.
1767 \#
1768 .ds TB+ \
1769 "\c\R'#TB+ 1'\R'#TN 1'\R'#NEXT_TAB \\n[#CURRENT_TAB]+1'\\*[TAB\\n[#NEXT_TAB]]\c
1770 \#
1771 \# TAB QUIT
1772 \# --------
1773 \# *Argument:
1774 \#   <none>
1775 \# *Function:
1776 \#   Sets #TAB_ACTIVE to "0" (off).
1777 \#   Resets left margin to value in effect prior to tabs.
1778 \#   Resets line length to value in effect prior to tabs.
1779 \#   Checks #QUAD to see if we were in flush or quad mode
1780 \#   prior to tabs (0=off, 1=on).
1781 \#   Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1782 \#   in effect prior to tabs.
1783 \# *Notes:
1784 \#   TQ must precede setting new tabs to get the tabs' indents
1785 \#   measured from page left.  Otherwise, the tabs' indents are
1786 \#   measured from the left margin of the currently active tab.
1787 \#
1788 .MAC TQ END
1789 .    br
1790 .    rr #TAB_ACTIVE
1791 .    rr #IN_TAB
1792 .    nr #LOOP 0 1
1793 .    while \\n+[#LOOP]<20 \{\
1794 .       rm $ST\\n[#LOOP]_FILL
1795 .    \}
1796 .    rr #LOOP
1797 .    po \\n[#L_MARGIN]u
1798 .    ll \\n[#L_LENGTH]u
1799 .    ta \\n[.l]u
1800 .    ie \\n[#QUAD] \{\
1801 .       ie '\\*[$RESTORE_QUAD_VALUE]'J' .JUSTIFY
1802 .       el .QUAD \\*[$RESTORE_QUAD_VALUE]
1803 .    \}
1804 .    el \{\
1805 .       if '\\*[$RESTORE_QUAD_VALUE]'LEFT' .LEFT
1806 .       if '\\*[$RESTORE_QUAD_VALUE]'RIGHT' .RIGHT
1807 .       if '\\*[$RESTORE_QUAD_VALUE]'CENTER' .CENTER
1808 .    \}
1809 .END
1810 \#
1811 \# ====================================================================
1812 \#
1813 \# COLOR HANDLING
1814 \# ==============
1815 \#
1816 \# COLOR
1817 \# -----
1818 \# *Arguments:
1819 \#   <pre-defined NEWCOLOR or XCOLOR>
1820 \# *Function:
1821 \#   Allows the inline escape for setting color to be called
1822 \#   as a macro.
1823 \#
1824 .MAC COLOR END
1825 .    ie \\n[.u]=1 \{\
1826 \c
1827 \\*[\\$1]\c
1828 .    \}
1829 .    el \\*[\\$1]
1830 .END
1831 \#
1832 \# NEWCOLOR
1833 \# --------
1834 \# *Arguments:
1835 \#   <color name> [<color scheme>] <color definition>
1836 \# *Function:
1837 \#   Based on .defcolor, allows users to name and define colors using
1838 \#   one of the four color schemes rgb, cmy, cmyk and grey.  The new
1839 \#   color is then defined as a string so that it can be called inline
1840 \#   with \*[COLORNAME] or with .COLOR.
1841 \# *Notes:
1842 \#   With only two args, the default color scheme is rgb.
1843 \#
1844 \#   It is highly recommended that users define new colors as
1845 \#   all-cap strings, to differentiate them from x colors, which must
1846 \#   be in lower case.
1847 \#
1848 .MAC NEWCOLOR END
1849 .    if \\n[#NUM_ARGS]=2 .defcolor \\$1 rgb \\$2
1850 .    if \\n[#NUM_ARGS]=3 \{\
1851 .       if '\\$2'RGB' .ds $COLOR_SCHEME rgb
1852 .       if '\\$2'CYM' .ds $COLOR_SCHEME cym
1853 .       if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk
1854 .       if '\\$2'GRAY' .ds $COLOR_SCHEME gray
1855 .       if '\\$2'GREY' .ds $COLOR_SCHEME gray
1856 .       defcolor \\$1  \\*[$COLOR_SCHEME] \\$3
1857 .    \}
1858 .    ds \\$1 \\m[\\$1]
1859 .END
1860 \#
1861 \# XCOLOR
1862 \# ------
1863 \# *Arguments:
1864 \#   <x color name> [<alias>]
1865 \# *Function:
1866 \#   Defines a string of x color name (i.e. a predefined x
1867 \#   color).  If <alias> is given, creates a string of <alias name>
1868 \#   that references the x color name of the first argument.
1869 \# *Notes:
1870 \#   The color name must be a valid color name from rgb.txt, and
1871 \#   must be given entirely in lower case, all one word.
1872 \#
1873 .MAC XCOLOR END
1874 .    ds \\$1 \m[\\$1]
1875 .    if \\n[#NUM_ARGS]=2 \{\
1876 .       ds \\$2 \m[\\$1]
1877 .       ds $\\$2_FILL \\$1
1878 .       ds COLAL_\\$2 \\$1
1879 .    \}
1880 .END
1881 \#
1882 \# Pre-define xcolors black and white
1883 \#
1884 .ds black \m[black]
1885 .ds BLACK \m[black]
1886 .ds white \m[white]
1887 .ds WHITE \m[WHITE]
1888 \#
1889 \# =====================================================================
1890 \#
1891 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1892 \#
1893 \# UNDERLINE
1894 \# ---------
1895 \# *Arguments:
1896 \#   <none> | <anything>
1897 \# *Function:
1898 \#   Simulates typewriter-style underlining of italic passages.
1899 \# *Notes:
1900 \#   Defaults for rule weight and distance from baseline are below.
1901 \#   UNDERLINE_SPECS lets user change them
1902 \#
1903 .nr _w 500
1904 .nr _d 1250
1905 \#
1906 .MAC UNDERLINE_SPECS END
1907 .    ie \B'\\$1' .nr _w (u;\\$1)
1908 .    el \{\
1909 .       ie '\\$1'DEFAULT' .nr _w 500
1910 .       el \{\
1911 .          nr _w 500
1912 .          tm1 "[mom]: The first argument to \\$0 must be a numeric
1913 .          tm1 "       argument with a unit of measure appended, or DEFAULT.
1914 .          tm1 "       Setting underline weight to DEFAULT.
1915 .       \}
1916 .    \}
1917 .    shift
1918 .    ie \B'\\$1' .nr _d (u;\\$1)
1919 .    el \{\
1920 .       ie '\\$1'DEFAULT' .nr _d 1250
1921 .       el \{\
1922 .          nr _d 1250
1923 .          tm1 "[mom]: The second argument to \\$0 must be a numeric
1924 .          tm1 "       argument with a unit of measure appended, or DEFAULT.
1925 .          tm1 "       Setting underline distance from baseline to DEFAULT.
1926 .       \}
1927 .    \}
1928 .END
1929 \#
1930 .MAC UNDERLINE END
1931 \c
1932 .    ds $SAVED_SS_VAR \\*[$SS_VAR]
1933 .    ie '\\$1'' \{\
1934 .       nr #UNDERLINE_ON 1
1935 .       ss \\n[.ss] (\\n[.ss]-\\n[.ss])
1936 .       ie !n .nop \X'ps: exec \\n[_w] \\n[_d] decorline'\c
1937 .       el .ul 1000
1938 .    \}
1939 .    el \{\
1940 .       nr #UNDERLINE_ON 0
1941 .       SS \\*[$SAVED_SS_VAR]
1942 .       ie !n .nop \X'ps: exec decornone'\c
1943 .       el .ul 0
1944 .    \}
1945 .END
1946 \#
1947 \# UL/ULX
1948 \# ------
1949 \# *Arguments:
1950 \#   <none>
1951 \# *Function:
1952 \#   Simulates typewriter-style underlining of italic passages.
1953 \# *Notes:
1954 \#   Intended to be called with inline escapes \*[UL] (underline
1955 \#   on) and \*[ULX] (underline off).
1956 \#
1957 .MAC UL END
1958 \c
1959 .    ds $SAVED_SS_VAR \\*[$SS_VAR]
1960 .    ss \\n[.ss] (\\n[.ss]-\\n[.ss])
1961 .    ie !'\\n[.z]'' \{\
1962 \c
1963 .       ie !n \{\
1964 .          if !\\n[.k]=0 \?\h'-\w'\\n[.ss]'u'\?
1965 \?\R'#UNDERLINE_ON 1'\X'ps: exec \\n[_w] \\n[_d] decorline'\?\c
1966 .       \}
1967 .       el \{\
1968 \?\R'#UNDERLINE_ON 1'\?\c
1969 .          ul 1000
1970 .       \}
1971 .    \}
1972 .    el \{\
1973 .       ie !n \{\
1974 .          nr #UNDERLINE_ON 1
1975 .          nop \X'ps: exec \\n[_w] \\n[_d] decorline'\c
1976 .       \}
1977 .       el \{\
1978 \R'#UNDERLINE_ON 1'\c
1979 .          ul 1000
1980 .       \}
1981 .    \}
1982 .END
1983 \#
1984 .MAC ULX END
1985 \c
1986 .    SS \\*[$SAVED_SS_VAR]
1987 .    rm $SAVED_SS_VAR
1988 .    ie !'\\n[.z]'' \{\
1989 \c
1990 .       ie !n \{\
1991 \?\R'#UNDERLINE_ON 0'\X'ps: exec decornone'\?\c
1992 .       \}
1993 .       el \{\
1994 \?\R'#UNDERLINE_ON 0'\?\c
1995 .          ul 0
1996 .       \}
1997 .    \}
1998 .    el \{\
1999 .       ie !n \{\
2000 .          nr #UNDERLINE_ON 0
2001 .          nop \X'ps: exec decornone'\c
2002 .       \}
2003 .       el \{\
2004 .          nr #UNDERLINE_ON 0
2005 .          ul 0
2006 .       \}
2007 .    \}
2008 .END
2009 \#
2010 \# UNDERSCORE
2011 \# ----------
2012 \# *Arguments:
2013 \#   [<points below baseline>] "text"
2014 \# *Function:
2015 \#   Places an underscore 2 points under the string if no lead given,
2016 \#   otherwise places underscore under string by user specified amount.
2017 \# *Notes:
2018 \#   When using this macro, the string to be underscored must begin
2019 \#   with double-quotes ("), regardless of whether it's the sole
2020 \#   argument or the second.
2021 \#   E.g.:
2022 \#      .UNDERSCORE "Text to be underscored
2023 \#         or
2024 \#      .UNDERSCORE 2p "Text to be underscored
2025 \#
2026 \#   UNDERSCORE does not work across line breaks.  Each line of text
2027 \#   must be entered separately.  If the UNDERSCORE begins in the
2028 \#   middle of a line and crosses over a break, the portion before
2029 \#   the break and the portion afterwards must be entered
2030 \#   separately.
2031 \#
2032 .MAC UNDERSCORE END
2033 .    nr #SAVED_UNDERSCORE_WEIGHT     \\n[#UNDERSCORE_WEIGHT]
2034 .    nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ]
2035 .    ds $SAVED_UNDERSCORE_GAP        \\*[$UNDERSCORE_GAP]
2036 .    if \\n[#FROM_BIB_STRING]=1 \{\
2037 .       nr #UNDERSCORE_WEIGHT        \\n[#BIB_STRING_UNDERLINE_WEIGHT]
2038 .       nr #UNDERSCORE_WEIGHT_ADJ    \\n[#BIB_STRING_UNDERLINE_WEIGHT_ADJ]
2039 .       ds $UNDERSCORE_GAP           \\*[$BIB_STRING_UNDERLINE_GAP]
2040 .    \}
2041 .    if \\n[#FROM_COVER]=1 \{\
2042 .       nr #UNDERSCORE_WEIGHT        \\n[#COVER_UNDERLINE_WEIGHT]
2043 .       nr #UNDERSCORE_WEIGHT_ADJ    \\n[#COVER_UNDERLINE_WEIGHT_ADJ]
2044 .       ds $UNDERSCORE_GAP           \\*[$COVER_UNDERLINE_GAP]
2045 .    \}
2046 .    if \\n[#FROM_DOC_COVER]=1 \{\
2047 .       nr #UNDERSCORE_WEIGHT        \\n[#DOC_COVER_UNDERLINE_WEIGHT]
2048 .       nr #UNDERSCORE_WEIGHT_ADJ    \\n[#DOC_COVER_UNDERLINE_WEIGHT_ADJ]
2049 .       ds $UNDERSCORE_GAP           \\*[$DOC_COVER_UNDERLINE_GAP]
2050 .    \}
2051 .    if \\n[#FROM_DOCTYPE]=1 \{\
2052 .       nr #UNDERSCORE_WEIGHT        \\n[#DOCTYPE_UNDERLINE_WEIGHT]
2053 .       nr #UNDERSCORE_WEIGHT_ADJ    \\n[#DOCTYPE_UNDERLINE_WEIGHT_ADJ]
2054 .       ds $UNDERSCORE_GAP           \\*[$DOCTYPE_UNDERLINE_GAP]
2055 .    \}
2056 .    if \\n[#FROM_EN_STRING]=1 \{\
2057 .       nr #UNDERSCORE_WEIGHT        \\n[#EN_STRING_UNDERLINE_WEIGHT]
2058 .       nr #UNDERSCORE_WEIGHT_ADJ    \\n[#EN_STRING_UNDERLINE_WEIGHT_ADJ]
2059 .       ds $UNDERSCORE_GAP           \\*[$EN_STRING_UNDERLINE_GAP]
2060 .    \}
2061 .    if \\n[#FROM_EN_TITLE]=1 \{\
2062 .       nr #UNDERSCORE_WEIGHT        \\n[#EN_TITLE_UNDERLINE_WEIGHT]
2063 .       nr #UNDERSCORE_WEIGHT_ADJ    \\n[#EN_TITLE_UNDERLINE_WEIGHT_ADJ]
2064 .       ds $UNDERSCORE_GAP           \\*[$EN_TITLE_UNDERLINE_GAP]
2065 .    \}
2066 .    ie \\n[#NUM_ARGS]=1 \{\
2067 .       nr #TEXT_WIDTH \w'\\$1'
2068 \\$1\
2069 \D't \\n[#UNDERSCORE_WEIGHT]'\
2070 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2071 \v'+(\\*[$UNDERSCORE_GAP])+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2072 \D'l \\n[#TEXT_WIDTH]u 0'\
2073 \D't \\n[#RULE_WEIGHT]'\
2074 \h'-\\n[#RULE_WEIGHT]u'\
2075 \v'-(\\*[$UNDERSCORE_GAP])-\\n[#UNDERSCORE_WEIGHT_ADJ]u'
2076 .    \}
2077 .    el \{\
2078 .       nr #TEXT_WIDTH \w'\\$2'
2079 \\$2\
2080 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2081 \v'+(\\$1)+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2082 \D't \\n[#UNDERSCORE_WEIGHT]'\
2083 \D'l \\n[#TEXT_WIDTH]u 0'\
2084 \D't \\n[#RULE_WEIGHT]'\
2085 \h'-\\n[#RULE_WEIGHT]u'\
2086 \v'-(\\$1)-\\n[#UNDERSCORE_WEIGHT_ADJ]u'
2087 .    \}
2088 .    nr #UNDERSCORE_WEIGHT     \\n[#SAVED_UNDERSCORE_WEIGHT]
2089 .    nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ]
2090 .    ds $UNDERSCORE_GAP        \\*[$SAVED_UNDERSCORE_GAP]
2091 .    rr #SAVED_UNDERSCORE_WEIGHT
2092 .    rr #SAVED_UNDERSCORE_WEIGHT_ADJ
2093 .    rm $SAVED_UNDERSCORE_GAP
2094 .END
2095 \#
2096 \# DOUBLE UNDERSCORE
2097 \# -----------------
2098 \# *Arguments:
2099 \#   [points below baseline] [points distance between rules] "text"
2100 \# *Function:
2101 \#   Same as UNDERSCORE, except it produces a double underscore.  The default
2102 \#   distance between the rules is 2 points.
2103 \# *Notes:
2104 \#   The same double-quote requirement as UNDERSCORE.
2105 \#
2106 .MAC UNDERSCORE2 END
2107 .    nr #SAVED_UNDERSCORE_WEIGHT     \\n[#UNDERSCORE_WEIGHT]
2108 .    nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ]
2109 .    ds $SAVED_UNDERSCORE_GAP        \\*[$UNDERSCORE_GAP]
2110 .    ds $SAVED_RULE_GAP              \\*[$RULE_GAP]
2111 .    if \\n[#NUM_ARGS]=2 \{\
2112 .       ds $UNDERSCORE_GAP \\$1
2113 .    \}
2114 .    if \\n[#NUM_ARGS]=3 \{\
2115 .       ds $UNDERSCORE_GAP \\$1
2116 .       ds $RULE_GAP \\$2
2117 .    \}
2118 .    if \\n[#FROM_BIB_STRING] \{\
2119 .       nr #UNDERSCORE_WEIGHT        \\n[#BIB_STRING_UNDERLINE_WEIGHT]
2120 .       nr #UNDERSCORE_WEIGHT_ADJ    \\n[#BIB_STRING_UNDERLINE_WEIGHT_ADJ]
2121 .       ds $UNDERSCORE_GAP           \\*[$BIB_STRING_UNDERLINE_GAP]
2122 .       ds $RULE_GAP                 \\*[$BIB_STRING_RULE_GAP]
2123 .    \}
2124 .    if \\n[#FROM_EN_STRING] \{\
2125 .       nr #UNDERSCORE_WEIGHT        \\n[#EN_STRING_UNDERLINE_WEIGHT]
2126 .       nr #UNDERSCORE_WEIGHT_ADJ    \\n[#EN_STRING_UNDERLINE_WEIGHT_ADJ]
2127 .       ds $UNDERSCORE_GAP           \\*[$EN_STRING_UNDERLINE_GAP]
2128 .       ds $RULE_GAP                 \\*[$EN_STRING_RULE_GAP]
2129 .    \}
2130 .    if \\n[#NUM_ARGS]=1 \{\
2131 .       nr #TEXT_WIDTH \w'\\$1'
2132 \\$1\
2133 \D't \\n[#UNDERSCORE_WEIGHT]'\
2134 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2135 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2136 \D'l \\n[#TEXT_WIDTH]u 0'\
2137 \v'+\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\
2138 \h'-\\n[#TEXT_WIDTH]u'\
2139 \D'l \\n[#TEXT_WIDTH]u 0'\
2140 \D't \\n[#RULE_WEIGHT]'\
2141 \h'-\\n[#RULE_WEIGHT]u'\
2142 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2143 .    \}
2144 .    if \\n[#NUM_ARGS]=2 \{\
2145 .       nr #TEXT_WIDTH \w'\\$2'
2146 \\$2\
2147 \D't \\n[#UNDERSCORE_WEIGHT]'\
2148 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2149 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2150 \D'l \\n[#TEXT_WIDTH]u 0'\
2151 \v'+(\\*[$RULE_GAP])+\\n[#UNDERSCORE_WEIGHT]u'\
2152 \h'-\\n[#TEXT_WIDTH]u'\
2153 \D'l \\n[#TEXT_WIDTH]u 0'\
2154 \D't \\n[#RULE_WEIGHT]'\
2155 \h'-\\n[#RULE_WEIGHT]u'\
2156 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])+(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2157 .    \}
2158 .    if \\n[#NUM_ARGS]=3 \{\
2159 .       nr #TEXT_WIDTH \w'\\$3'
2160 \\$3\
2161 \D't \\n[#UNDERSCORE_WEIGHT]'\
2162 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2163 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2164 \D'l \\n[#TEXT_WIDTH]u 0'\
2165 \v'+\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\
2166 \h'-\\n[#TEXT_WIDTH]u'\
2167 \D'l \\n[#TEXT_WIDTH]u 0'\
2168 \D't \\n[#RULE_WEIGHT]'\
2169 \h'-\\n[#RULE_WEIGHT]u'\
2170 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2171 .    \}
2172 .    nr #UNDERSCORE_WEIGHT     \\n[#SAVED_UNDERSCORE_WEIGHT]
2173 .    nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ]
2174 .    ds $UNDERSCORE_GAP        \\*[$SAVED_UNDERSCORE_GAP]
2175 .    rr #SAVED_UNDERSCORE_WEIGHT
2176 .    rr #SAVED_UNDERSCORE_WEIGHT_ADJ
2177 .    rm $SAVED_UNDERSCORE_GAP
2178 .    rm $SAVED_RULE_GAP
2179 .END
2180 \#
2181 \# Default underscoring rule gaps
2182 \#
2183 .ds $BIB_STRING_UNDERLINE_GAP 2p
2184 .ds $BIB_STRING_RULE_GAP      2p
2185 .ds $COVER_UNDERLINE_GAP      2p
2186 .ds $DOC_COVER_UNDERLINE_GAP  2p
2187 .ds $DOCTYPE_UNDERLINE_GAP    2p
2188 .ds $EN_STRING_UNDERLINE_GAP  2p
2189 .ds $EN_STRING_RULE_GAP       2p
2190 .ds $EN_TITLE_UNDERLINE_GAP   2p
2191 .ds $RULE_GAP                 2p
2192 .ds $UNDERSCORE_GAP           2p
2193 \#
2194 \# SUPERSCRIPT
2195 \# -----------
2196 \# *Function:
2197 \#   Prints everything after inline invocation as superscript.
2198 \# *Notes:
2199 \#   \*[SUP] and \*[SUPX] turn superscript on and off respectively.
2200 \#   If running type is pseudo-condensed/expanded, invoke the superscript
2201 \#   strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
2202 \#   and \*[EXTSUPX] respectively.
2203 \#
2204 \# Default raise/lower amount
2205 .ds $SUP_RAISE \v'-.3m'
2206 .ds $SUP_LOWER \v'.3m'
2207 \#
2208 \# SUPERSCRIPT RAISE
2209 \# -----------------
2210 \# *Argument:
2211 \#   <amount to raise superscript>
2212 \# *Function:
2213 \#   Defines strings $SUP_RAISE and $SUP_LOWER for use with \*[SUP],
2214 \#   \*[CONDSUP] and \*[EXTSUP].
2215 \#
2216 .MAC SUPERSCRIPT_RAISE_AMOUNT END
2217 .    ds $SUP_RAISE_AMOUNT \\$1
2218 .    ds $SUP_RAISE \v'-\\*[$SUP_RAISE_AMOUNT]'
2219 .    ds $SUP_LOWER \v'\\*[$SUP_RAISE_AMOUNT]'
2220 .END
2221 \#
2222 .ds SUP \
2223 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2224 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2225 \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]
2226 \#
2227 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]
2228 \#
2229 .ds CONDSUP \
2230 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2231 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2232 \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
2233 \#
2234 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]\E*[COND]
2235 \#
2236 .ds EXTSUP \
2237 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2238 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2239 \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
2240 \#
2241 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]\E*[EXT]
2242 \#
2243 \# SLANT
2244 \# -----
2245 \#
2246 \# SETSLANT
2247 \# --------
2248 \# *Arguments:
2249 \#   <number of degrees> | RESET
2250 \# *Function:
2251 \#   Modifies register #DEGREES for use with \*[SLANT], or resets
2252 \#   it to the default.  Defines string \*[SLANTX]
2253 \# *Notes:
2254 \#   \*[SLANT] permits pseudo-italicizing of a font in cases where
2255 \#   no italic font exists in a particular family.
2256 \#
2257 \#   Default # of degrees is 15.
2258 \#
2259 \#   Do not use unit of measure with arg to SETSLANT.
2260 \#
2261 \#   It may be necessary to adjust the spacing on either side of
2262 \#   [SLANT] and [SLANTX].
2263 \#
2264 \#   In docs, SLANT carries over from para to para.
2265 \#
2266 .nr #DEGREES 15
2267 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2268 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2269 \#
2270 .MAC SETSLANT END
2271 .    ie '\\$1'RESET' \{\
2272 .       nr #DEGREES 15
2273 .       if \\n[#PRINT_STYLE]=1 \
2274 .          if \\n[#UNDERLINE_SLANT] .return
2275 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2276 .    \}
2277 .    el \{\
2278 .       nr #DEGREES \\$1
2279 .       if \\n[#PRINT_STYLE]=1 \
2280 .          if \\n[#UNDERLINE_SLANT] .return
2281 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2282 .    \}
2283 .    ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2284 .END
2285 \#
2286 \# BOLDER
2287 \# ------
2288 \#
2289 \# SETBOLDER
2290 \# ---------
2291 \# *Arguments:
2292 \#   <amount of emboldening> | RESET
2293 \# *Function:
2294 \#   Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
2295 \#   it to the default 700 units.
2296 \# *Notes:
2297 \#   \*[BOLDER] allows pseudo-emboldening of a font where no bold
2298 \#   font exists in a particular family.
2299 \#
2300 \#   Default for SETBOLDER is 700 units.  Do not use unit of measure
2301 \#   with arg to SETBOLDER.
2302 \#
2303 .nr #BOLDER_UNITS 700
2304 \#
2305 .MAC SETBOLDER END
2306 .    if \\n[#IGNORE]=1 .return
2307 .    ie '\\$1'RESET' .nr #BOLDER_UNITS 700
2308 .    el              .nr #BOLDER_UNITS \\$1
2309 .END
2310 \#
2311 .MAC BOLDER END
2312 \c
2313 .bd \\n[.f] \\n[#BOLDER_UNITS]
2314 .END
2315 \#
2316 .MAC BOLDERX END
2317 \c
2318 .bd \\n[.f]
2319 .END
2320 \#
2321 \# +++CONDENSE/EXTEND+++
2322 \#
2323 \# CONDENSE/EXTEND
2324 \# ---------------
2325 \# *Arguments:
2326 \#   <percentage to condense/expand type size>
2327 \# *Function:
2328 \#   Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
2329 \#   new point size (for character width) from arg, and defines string
2330 \#   COND or EXT, which set the type size to the new character width,
2331 \#   and sets the height of type to the value stored in CURRENT_PT_SIZE
2332 \# *Notes:
2333 \#   CONDENSE_OR_EXTEND is invoked from the aliases
2334 \#   CONDENSE and EXTEND.  CONDENSE implies <100, EXTEND
2335 \#   implies >100.  Do not use a percent sign in the argument.
2336 \#
2337 \#   There is no default setting for CONDENSE or EXTEND.
2338 \#   80 is a good approximation of condensed type, 120 is okay
2339 \#   for extended.
2340 \#
2341 \#   The value set by CONDENSE or EXTEND applies to all
2342 \#   subsequent \*[COND] or \*[EXT] escapes until a new value is set.
2343 \#
2344 \#  \*[COND] or \*[EXT] must be turned off before all changes of point
2345 \#  size, and reinvoked afterwards (if so desired).  This refers to
2346 \#  changes of point size via control lines AND via inlines.
2347 \#
2348 .MAC CONDENSE_OR_EXTEND END
2349 .    if '\\$0'CONDENSE' \{\
2350 .       ds $COND_PERCENT \\$1
2351 .       if \\n[#PRINT_STYLE]=1 \{\
2352 .          rm $COND_PERCENT
2353 .          ds $COND_PERCENT 100
2354 .       \}
2355 .       ds COND \
2356 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2357 \R'#CONDENSE 1'\
2358 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2359 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2360 .       ds COND_FOR_SUP \
2361 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2362 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2363 .    \}
2364 .    if '\\$0'EXTEND' \{\
2365 .       ds $EXT_PERCENT \\$1
2366 .       if \\n[#PRINT_STYLE]=1 \{\
2367 .          rm $EXT_PERCENT
2368 .          ds $EXT_PERCENT 100
2369 .       \}
2370 .       ds EXT \
2371 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2372 \R'#EXTEND 1'\
2373 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2374 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2375 .       ds EXT_FOR_SUP \
2376 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2377 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2378 .    \}
2379 .END
2380 \#
2381 .ds CONDX \
2382 \ER'#CONDENSE 0'\Es[0]\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2383 .ds EXTX  \
2384 \ER'#EXTEND   0'\Es[0]\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2385 \#
2386 \# +++PAD LINES+++ (insert space)
2387 \#
2388 \# PAD MARKER
2389 \# ----------
2390 \# *Arguments:
2391 \#   <character to use for marking pad points>
2392 \# *Function:
2393 \#   Defines string $PAD_MARKER, used in PAD
2394 \# *Notes:
2395 \#   $PAD_MARKER is normally # (the pound sign).
2396 \#
2397 .MAC PAD_MARKER END
2398 .    ds $PAD_MARKER \\$1
2399 .END
2400 \#
2401 \# PAD
2402 \# ---
2403 \# *Argments:
2404 \#   "<string of text with padding markers inserted>"
2405 \#   "<id of bookmark created by .PDF_BOOKMARK>"
2406 \# *Function:
2407 \#   Defines and redefines padding character (default=pound sign
2408 \#   unless padding character has been set with PAD_MARKER)
2409 \#   several times so that when the string is output at the end
2410 \#   of the macro, every # has been converted to an equal-sized
2411 \#   amount of padding (blank space) on a line.
2412 \# *Notes:
2413 \#   String tabs may be marked off during PAD.
2414 \#
2415 .MAC PAD END
2416 .    if \\n[.u]=1 .nr fill 1
2417 .    nf
2418 .    if !d$PAD_MARKER .ds $PAD_MARKER #
2419 .    char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2420 .    ds $FAMILY_FOR_PAD \\n[.fam]
2421 .\" .if !n .fp \\n[.fp] \\n[.sty]
2422 .    ds $FONT_FOR_PAD   \\n[.sty]
2423 .    nr #SIZE_FOR_PAD   \\n[.ps]
2424 .    ds $PAD_STRING \\$1
2425 .    as $PAD_STRING \Ekp
2426 .    di PAD_STRING
2427 .    fam \\*[$FAMILY_FOR_PAD]
2428 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2429 .    br
2430 .    di
2431 .    char \\*[$PAD_MARKER] \
2432 \R'#SPACE_TO_END \En[.l]-\En[p]'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2433 .    di PAD_STRING
2434 .    fam \\*[$FAMILY_FOR_PAD]
2435 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2436 .    br
2437 .    di
2438 .    char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2439 .    if \\n[#SILENT] .SILENT
2440 .    fam \\*[$FAMILY_FOR_PAD]
2441 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]
2442 .    ie '\\$2'' .nop \\*[$PAD_STRING]
2443 .    el \{\
2444 .       ie !'\\$2'NOBREAK' .pdfhref L -D "\\$2" -E -- \&\\*[$PAD_STRING]
2445 .       el .nop \\*[$PAD_STRING]
2446 .    \}
2447 .    if \\n[#SILENT] .SILENT OFF
2448 .    br
2449 .    if \\n[fill] \{\
2450 .       fi
2451 .       rr fill
2452 .    \}
2453 .    rr #PAD_COUNT
2454 .    rr #SPACE_TO_END
2455 .    rr #PAD_SPACE
2456 .    rm $PAD_STRING
2457 .    rm PAD_STRING
2458 .    rchar #
2459 .    if '\\$2'NOBREAK' \{\
2460 .       TRAP OFF
2461 .       EOL
2462 .       TRAP
2463 .    \}
2464 .END
2465 \#
2466 \# +++LEADERS+++
2467 \#
2468 \# The leader mechanism is primitive, but it works.  Basically, every
2469 \# macro in this set that includes a line length also sets a single
2470 \# groff tab stop at the right hand end of the line.  That way,
2471 \# whenever Ctrl-A is invoked (always at the end of an input line),
2472 \# leader of the correct length gets deposited.  Ctrl-A is accessed by
2473 \# the string LEADER (i.e. inline, as \*[LEADER]).  Leaders within tabs
2474 \# get their length from the tab line length.
2475 \#
2476 \# SET LEADER CHARACTER
2477 \# --------------------
2478 \# *Arguments:
2479 \#   <character to use whenever \*[LEADER] is invoked>
2480 \# *Function:
2481 \#   Set leader character.
2482 \#
2483 .MAC LEADER_CHARACTER END
2484 .    lc \\$1
2485 .END
2486 \#
2487 .ds LEADER \ 1
2488 \#
2489 \# +++DROP CAPS+++
2490 \#
2491 \# DROP CAP FAMILY
2492 \# ---------------
2493 \# *Argument:
2494 \#   <family of drop cap>
2495 \# *Function:
2496 \#   Creates or modifies string $DC_FAM.
2497 \#
2498 .MAC DROPCAP_FAMILY END
2499 .    ds $DC_FAM \\$1
2500 .END
2501 \#
2502 \# DROP CAP FONT
2503 \# -------------
2504 \# *Argument:
2505 \#   <font of drop cap>
2506 \# *Function:
2507 \#   Creates or modifies string $DC_FT.
2508 \#
2509 .MAC DROPCAP_FONT END
2510 .    ds $DC_FT \\$1
2511 .END
2512 \#
2513 \# DROPCAP COLOR
2514 \# -------------
2515 \# *Arguments:
2516 \#   <pre-defined XCOLOR or NEWCOLOR>
2517 \# *Function:
2518 \#   Defines string $DC_COLOR to argument.
2519 \# *Notes:
2520 \#   User must define an XCOLOR or NEWCOLOR before using
2521 \#   DC_COLOR.
2522 \#
2523 .MAC DROPCAP_COLOR END
2524 .    if \\n[#PRINT_STYLE]=1 .return
2525 .    nr #DC_COLOR 1
2526 .    ds $DC_COLOR \\$1
2527 .END
2528 \#
2529 \# DROP CAP GUTTER
2530 \# ---------------
2531 \# *Argument:
2532 \#   <width of gutter between drop cap and indented text>
2533 \# *Function:
2534 \#   Creates or modifies register #DC_GUT.
2535 \# *Notes:
2536 \#   Requires unit of measure.  Default is 3p.
2537 \#
2538 .MAC DROPCAP_GUTTER END
2539 .    nr #DC_GUT (\\$1)
2540 .END
2541 \#
2542 \# DROP CAP ADJUST
2543 \# ---------------
2544 \# *Argument:
2545 \#   <+|- # of points to in/decrease point size of drop cap letter>
2546 \# *Function:
2547 \#   Creates or modifies string $DC_ADJUST.
2548 \# *Notes:
2549 \#   Despite its best efforts, DROPCAP doesn't always get the point
2550 \#   size of the drop cap critically perfect.  DROPCAP_ADJUST lets
2551 \#   the user add or subtract points (or fractions of points) to
2552 \#   get the size right.
2553 \#
2554 \#   Requires the + or - sign.
2555 \#
2556 .MAC DROPCAP_ADJUST END
2557 .    ds $DC_ADJUST \\$1
2558 .END
2559 \#
2560 \# DROP CAP
2561 \# --------
2562 \# *Arguments:
2563 \#   <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2564 \# *Function:
2565 \#   Calculates point size of dropcap based on # of lines passed as
2566 \#   arg 2.  Sets indent for text based on dropcap width+gutter.
2567 \#   Advances and prints dropcap; reverses and prints indented text
2568 \#   to bottom of dropcap, then resets indent to left margin (plus
2569 \#   any indent that was in effect prior to invoking DROPCAP).
2570 \# *Notes:
2571 \#   Drop caps when using the doc processing macro PP only work with
2572 \#   initial paragraphs (i.e. at doc start, or after heads), only when
2573 \#   DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2574 \#   is TYPESET.  If these conditions aren't met, DROPCAPS is silently
2575 \#   ignored.
2576 \#
2577 \#   The COND or EXT argument are processed separately from all
2578 \#   other COND or EXT inlines or macros, hence passing COND or
2579 \#   EXT has no effect on running type.
2580 \#
2581 .MAC DROPCAP END
2582 .    if \\n[#IGNORE]=1 \{\
2583 .       PRINT \\$1\c
2584 .       return
2585 .    \}
2586 .    br
2587 .    if n \{\
2588 .       PRINT \\$1\c
2589 .       return
2590 .    \}
2591 .    if \\n[#DOCS] \{\
2592 .       if \\n[#PRINT_STYLE]=1 \{\
2593 .          PRINT \\$1\c
2594 .          return
2595 .       \}
2596 .       if \\n[#PRINT_STYLE]=2 \{\
2597 .          if \\n[#PP_STYLE]=2 \{\
2598 .             PRINT \\$1\c
2599 .             return
2600 .          \}
2601 .          if \\n[#PP]>1 \{\
2602 .             PRINT \\$1\c
2603 .             return
2604 .          \}
2605 .          ti 0
2606 .       \}
2607 .    \}
2608 .    ds $DROPCAP         \\$1
2609 .    nr #DC_LINES        \\$2-1
2610 .    if \\n[#CONDENSE]=1 \{\
2611 .       ds $RESTORE_COND \\*[$COND_PERCENT]
2612 \\*[CONDX]
2613 .       nr #CONDENSE_WAS_ON 1
2614 .    \}
2615 .    if \\n[#EXTEND]=1 \{\
2616 .       ds $RESTORE_EXT \\*[$EXT_PERCENT]
2617 \\*[EXTX]
2618 .       nr #EXTEND_WAS_ON 1
2619 .    \}
2620 .    if '\\$3'COND' .CONDENSE \\$4
2621 .    if '\\$3'EXT' .EXTEND \\$4
2622 .    if !r#DC_GUT .nr #DC_GUT (3p)
2623 .    ie \\n[#DOCS] .ds $RESTORE_FAM \\*[$DOC_FAM]
2624 .    el .ds $RESTORE_FAM \\n[.fam]
2625 .    ie \\n[#DOCS] .ds $RESTORE_FT  \\*[$PP_FT]
2626 .    el .ds $RESTORE_FT  \\*[$FONT]
2627 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2628 .    nr #RESTORE_INDENT  \\n[.i]
2629 .    SIZESPECS
2630 .    nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2631 .    ie !d$DC_FAM .FAM \\n[.fam]
2632 .    el .FAM \\*[$DC_FAM]
2633 .    ie !d$DC_FT .FT \\*[$FONT]
2634 .    el .FT \\*[$DC_FT]
2635 .    while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2636 .       ps \\n[#PT_SIZE]u+100u
2637 .       SIZESPECS
2638 .       nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2639 .    \}
2640 .    if d$DC_ADJUST .ps \\*[$DC_ADJUST]p
2641 .    nr #DC_LINES +1
2642 .    if \\n[#DC_LINES]v>\\n[.t] \{\
2643 .       nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1
2644 .       tm1 "[mom]: Dropcap at line \\n[.c] does not fit on page \\n[pgnum].
2645 .       tm1 "       Shifting paragraph to page \\n+[pgnum].
2646 .       bp
2647 .    \}
2648 .    ie \\n[#DC_COLOR]=1 \{\
2649 .       ie !'\\$3'' \{\
2650 .          ie '\\$3'COND' \
2651 .             PRINT \
2652 \\*[DOWN \\n[#DC_LINES]v]\
2653 \m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[]\\*[UP \\n[#DC_LINES]v]
2654 .          el \
2655 .             PRINT \
2656 \\*[DOWN \\n[#DC_LINES]v]\
2657 \m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[]\\*[UP \\n[#DC_LINES]v]
2658 .       \}
2659 .       el .PRINT \
2660 \\*[DOWN \\n[#DC_LINES]v]\
2661 \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[]\\*[UP \\n[#DC_LINES]v]
2662 .    \}
2663 .    el \{\
2664 .       ie !'\\$3'' \{\
2665 .          ie '\\$3'COND' \
2666 .             PRINT \
2667 \\*[DOWN \\n[#DC_LINES]v]\
2668 \\*[COND]\\*[$DROPCAP]\\*[CONDX]\\*[UP \\n[#DC_LINES]v]
2669 .          el \
2670 .             PRINT \
2671 \\*[DOWN \\n[#DC_LINES]v]\
2672 \\*[EXT]\\*[$DROPCAP]\\*[EXTX]\\*[UP \\n[#DC_LINES]v]
2673 .       \}
2674 .       el .PRINT \
2675 \\*[DOWN \\n[#DC_LINES]v]\
2676 \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[]\\*[UP \\n[#DC_LINES]v]
2677 .    \}
2678 .    if '\\$3'COND' \E*[COND]
2679 .    if '\\$3'EXT' \E*[EXT]
2680 .    ie \\n[.i] \{\
2681 .       vs 0
2682 .       br
2683 .       in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u
2684 .       vs
2685 .    \}
2686 .    el \{\
2687 .       vs 0
2688 .       br
2689 .       in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u
2690 .       vs
2691 .    \}
2692 .    if '\\$3'COND' \E*[CONDX]\c
2693 .    if '\\$3'EXT' \E*[EXTX]\c
2694 .    FAM \\*[$RESTORE_FAM]
2695 .    FT  \\*[$RESTORE_FT]
2696 .    ps \\n[#RESTORE_PT_SIZE]u
2697 .    if \\n[#CONDENSE_WAS_ON] \{\
2698 .       CONDENSE \\*[$RESTORE_COND]
2699 \\*[COND]\c
2700 .    \}
2701 .    if \\n[#EXTEND_WAS_ON] \{\
2702 .       EXTEND \\*[$RESTORE_EXT]
2703 \\*[EXT]\c
2704 .    \}
2705 .    ie \\n[.u] .wh \\n[.d]u+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF
2706 .    el .wh \\n[.d]u+\\n[#DC_HEIGHT]u DROPCAP_OFF
2707 .    rr #CONDENSE_WAS_ON
2708 .    rr #EXTEND_WAS_ON
2709 .    rm $DROPCAP
2710 .    rr #DC_LINES
2711 .    rm $RESTORE_COND
2712 .    rm $RESTORE_EXT
2713 .    rm $RESTORE_FAM
2714 .    rm $RESTORE_FT
2715 .    rr #RESTORE_PT_SIZE
2716 .    rr #RESTORE_INDENT
2717 .    rr #DC_HEIGHT
2718 .    rr #GET_DC_HEIGHT
2719 .    rr x
2720 .END
2721 \#
2722 .MAC DROPCAP_OFF END
2723 '    in \\n[#RESTORE_INDENT]u
2724 .    ch DROPCAP_OFF
2725 .END
2726 \#
2727 \# =====================================================================
2728 \#
2729 \# +++GRAPHICAL OBJECTS+++
2730 \#
2731 \# HORIZONTAL RULE - DRH
2732 \# ---------------------
2733 \# *Arguments:
2734 \#   <none> | <rule weight> <indent> <length> [ <color> ]
2735 \# *Function:
2736 \#   With no arg, draws a full measure rule.  With args, draws
2737 \#   described horizontal rule.
2738 \# *Notes:
2739 \#   Rules are drawn left-to-right, from the baseline down, and
2740 \#   return to their point of origin.  Color must be set in the
2741 \#   macro; otherwise the color will be black, regardless of current
2742 \#   .gcolor.  If no arg given, the rule weight is the one set by
2743 \#   RULE_WEIGHT.
2744 \#
2745 .MAC DRH END
2746 .    if \\n[.vpt]=1 \{\
2747 .       vpt 0
2748 .       nr #RESTORE_TRAP 1
2749 .    \}
2750 .    ie !\\n[#NO_ADVANCE]=1 .br
2751 .    el \{\
2752 .       sp -1v
2753 .       rr #NO_ADVANCE
2754 .    \}
2755 .    ie \\n[.u]=1 \{\
2756 .       nr #FILLED 1
2757 .       nr #FILL_MODE \\n[.j]
2758 .    \}
2759 .    el \{\
2760 .       nr #NOFILL 1
2761 .       if \\n[.ce]>0 .nr #NOFILL_MODE 3
2762 .       if \\n[.rj]>0 .nr #NOFILL_MODE 5
2763 .       ce 0
2764 .       rj 0
2765 .    \}
2766 .    nf
2767 .    ds $RL_WEIGHT \\$1
2768 .    ds $RL_INDENT \\$2
2769 .    ds $RL_LENGTH \\$3
2770 .    ie !'\\$4'' .ds $RL_COLOR  \\$4
2771 .    el          .ds $RL_COLOR default
2772 .    nr #SAVED_WEIGHT     \\n[#RULE_WEIGHT]
2773 .    nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
2774 .    di NULL
2775 .       if \\n[#NUM_ARGS]>=1 .RULE_WEIGHT \\*[$RL_WEIGHT]
2776 .    di
2777 .    gcolor \\*[$RL_COLOR]
2778 .    ie \\n[#NUM_ARGS]=0 \{\
2779 .       ie \\n[#INDENT_ACTIVE] \{\
2780 .          nr #RESTORE_L_LENGTH \\n[.l]
2781 .          if \\n[#INDENT_BOTH_ACTIVE] .ll \\n[.l]u-\\n[#BL_INDENT]u
2782 .          if \\n[#INDENT_LEFT_ACTIVE] .ll \\n[.l]u-\\n[#L_INDENT]u
2783 \D't \\n[#RULE_WEIGHT]'\
2784 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2785 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2786 \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\
2787 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2788 \D't \\n[#SAVED_RULE_WEIGHT]'
2789 .          ll \\n[#RESTORE_L_LENGTH]u
2790 .          rr #RESTORE_L_LENGTH
2791 .       \}
2792 .       el \{\
2793 \D't \\n[#RULE_WEIGHT]'\
2794 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2795 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2796 \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\
2797 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2798 \D't \\n[#SAVED_RULE_WEIGHT]'
2799 .       \}
2800 .    \}
2801 .    el \{\
2802 \D't \\n[#RULE_WEIGHT]'\
2803 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2804 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2805 \D'l \\*[$RL_LENGTH] 0'\
2806 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2807 \D't \\n[#SAVED_RULE_WEIGHT]'
2808 .    \}
2809 .    if \\n[#FILLED]=1 \{\
2810 .       if \\n[#FILL_MODE]=0 .QUAD LEFT
2811 .       if \\n[#FILL_MODE]=1 .JUSTIFY
2812 .       if \\n[#FILL_MODE]=3 .QUAD CENTER
2813 .       if \\n[#FILL_MODE]=5 .QUAD RIGHT
2814 .       rr #FILLED
2815 .    \}
2816 .    sp -1v
2817 .    if \\n[#NOFILL]=1 \{\
2818 .       if \\n[#NOFILL_MODE]=3 .CENTER
2819 .       if \\n[#NOFILL_MODE]=5 .RIGHT
2820 .    \}
2821 .    gcolor
2822 .    nr #RULE_WEIGHT     \\n[#SAVED_WEIGHT]
2823 .    nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
2824 .    rr #SAVED_WEIGHT
2825 .    rr #SAVED_WEIGHT_ADJ
2826 .    if \\n[#RESTORE_TRAP]=1 \{\
2827 .       vpt 1
2828 .       rr #RESTORE_TRAP
2829 .    \}
2830 .    if '\\n[.z]'FLOAT*DIV' \
2831 .       if !(\\n[.d]+\\n[#WEIGHT])<\\n[D-float] .nr D-float \\n[.d]+\\n[#WEIGHT]
2832 .END
2833 \#
2834 \# RULE
2835 \# ----
2836 \# *Argument:
2837 \#   <none>
2838 \# *Function:
2839 \#   Draws a rule the length of the current measure.
2840 \# *Notes:
2841 \#   A convenience macro.  DRH with no argument does the same thing.
2842 \#   Kept in for backward compatibility.
2843 \#
2844 .MAC RULE END
2845 .    if \\n[.u]=1 \{\
2846 .       nr fill 1
2847 .       ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2848 .       nf
2849 .    \}
2850 .    ie \\n[#INDENT_ACTIVE] \{\
2851 .       if \\n[#INDENT_BOTH_ACTIVE] .ll \\n[.l]u-\\n[#BL_INDENT]u
2852 .       if \\n[#INDENT_LEFT_ACTIVE] .ll \\n[.l]u-\\n[#L_INDENT]u
2853 .       PRINT \
2854 \D't \\n[#RULE_WEIGHT]'\v'\\n[#RULE_WEIGHT_ADJ]u'\
2855 \h'-\\n[#RULE_WEIGHT]u'\
2856 \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\h'|0'\c
2857 .       ll
2858 .       rr #RESTORE_L_LENGTH
2859 .    \}
2860 .    el \{\
2861 .       PRINT \
2862 \D't \\n[#RULE_WEIGHT]'\v'\\n[#RULE_WEIGHT_ADJ]u'\
2863 \h'-\\n[#RULE_WEIGHT]u'\
2864 \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\h'|0'\c
2865 .    \}
2866 .    if \\n[fill] \{\
2867 .       fi
2868 .       rr fill
2869 .       QUAD \\*[$CURRENT_QUAD]
2870 .       rm $CURRENT_QUAD
2871 .    \}
2872 .    EOL
2873 .END
2874 \#
2875 \# VERTICAL RULE - DRV
2876 \# -------------------
2877 \# *Arguments:
2878 \#   <rule weight> <indent> <depth> [ <color> ]
2879 \# *Function:
2880 \#   Draws described vertical rule.
2881 \# *Notes:
2882 \#   Rules are drawn left-to-right, from the baseline down, and
2883 \#   return to their point of origin.  Color must be set in the
2884 \#   macro; otherwise the color will be black, regardless of current
2885 \#   .gcolor.
2886 \#
2887 .MAC DRV END
2888 .    if \\n[.vpt]=1 \{\
2889 .       vpt 0
2890 .       nr #RESTORE_TRAP 1
2891 .    \}
2892 .    ie !\\n[#NO_ADVANCE]=1 .br
2893 .    el \{\
2894 .       sp -1v
2895 .       rr #NO_ADVANCE
2896 .    \}
2897 .    ie \\n[.u]=1 \{\
2898 .       nr #FILLED 1
2899 .       nr #FILL_MODE \\n[.j]
2900 .    \}
2901 .    el \{\
2902 .       nr #NOFILL 1
2903 .       if \\n[.ce]>0 .nr #NOFILL_MODE 3
2904 .       if \\n[.rj]>0 .nr #NOFILL_MODE 5
2905 .       ce 0
2906 .       rj 0
2907 .    \}
2908 .    nf
2909 .    ds $RL_WEIGHT \\$1
2910 .    ds $RL_INDENT \\$2
2911 .    ds $RL_DEPTH  \\$3
2912 .    ie !'\\$4'' \{\
2913 .       ds $RL_COLOR  \\$4
2914 .    \}
2915 .    el .ds $RL_COLOR default
2916 .    nr #SAVED_WEIGHT     \\n[#RULE_WEIGHT]
2917 .    nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
2918 .    RULE_WEIGHT \\*[$RL_WEIGHT]
2919 .    gcolor \\*[$RL_COLOR]
2920 \D't \\n[#RULE_WEIGHT]'\
2921 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT_ADJ]u'\
2922 \D'l 0 \\*[$RL_DEPTH]'\
2923 \D't \\n[#SAVED_RULE_WEIGHT]'
2924 .    if \\n[#FILLED]=1 \{\
2925 .       if \\n[#FILL_MODE]=0 .QUAD LEFT
2926 .       if \\n[#FILL_MODE]=1 .JUSTIFY
2927 .       if \\n[#FILL_MODE]=3 .QUAD CENTER
2928 .       if \\n[#FILL_MODE]=5 .QUAD RIGHT
2929 .       rr #FILLED
2930 .    \}
2931 .    sp -1v
2932 .    if \\n[#NOFILL]=1 \{\
2933 .       if \\n[#NOFILL_MODE]=3 .CENTER
2934 .       if \\n[#NOFILL_MODE]=5 .RIGHT
2935 .    \}
2936 .    gcolor
2937 .    nr #RULE_WEIGHT     \\n[#SAVED_WEIGHT]
2938 .    nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
2939 .    if \\n[#RESTORE_TRAP]=1 \{\
2940 .       vpt 1
2941 .       rr #RESTORE_TRAP
2942 .    \}
2943 .    if '\\n[.z]'FLOAT*DIV' \{\
2944 .       if !(\\n[.d]+\\*[$RL_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$RL_DEPTH]
2945 .    \}
2946 .END
2947 \#
2948 \# BOXES - DBX
2949 \# -----------
2950 \# *Arguments:
2951 \#   <rule weight | SOLID> <indent> <length> <depth> [ <color> ]
2952 \# *Function:
2953 \#   Draws described box.
2954 \# *Notes:
2955 \#   Boxes are drawn left-to-right, from the baseline down, and
2956 \#   return to their point of origin.  Box rules are drawn from the
2957 \#   perimeter inwards.  Color must be set in the macro; otherwise
2958 \#   the color will be black, regardless of current .gcolor.  If no
2959 \#   arg given, the rule weight is the one set by RULE_WEIGHT.
2960 \#
2961 .MAC DBX END
2962 .    if \\n[.vpt]=1 \{\
2963 .       vpt 0
2964 .       nr #RESTORE_TRAP 1
2965 .    \}
2966 .    ie !\\n[#NO_ADVANCE]=1 .br
2967 .    el \{\
2968 .       sp -1v
2969 .       rr #NO_ADVANCE
2970 .    \}
2971 .    ie \\n[.u]=1 \{\
2972 .       nr #FILLED 1
2973 .       nr #FILL_MODE \\n[.j]
2974 .    \}
2975 .    el \{\
2976 .       nr #NOFILL 1
2977 .       if \\n[.ce]>0 .nr #NOFILL_MODE 3
2978 .       if \\n[.rj]>0 .nr #NOFILL_MODE 5
2979 .       ce 0
2980 .       rj 0
2981 .    \}
2982 .    nf
2983 .    ie '\\$1'SOLID' .nr #BX_SOLID 1
2984 .    el              .ds $BX_WEIGHT \\$1
2985 .    ds $BX_INDENT \\$2
2986 .    ds $BX_WIDTH  \\$3
2987 .    ds $BX_DEPTH  \\$4
2988 .    ie !'\\$5'' \{\
2989 .       ie d$\\$5_FILL .ds $BX_COLOR \\*[$\\$5_FILL]
2990 .       el             .ds $BX_COLOR \\$5
2991 .    \}
2992 .    el .ds $BX_COLOR default
2993 .    nr #SAVED_WEIGHT     \\n[#RULE_WEIGHT]
2994 .    nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
2995 .    if !'\\$1'SOLID' .RULE_WEIGHT \\*[$BX_WEIGHT]
2996 .    ds $BX_INDENT \\*[$BX_INDENT]-\\n[#WEIGHT_ADJ]u
2997 .    ie \\n[#BX_SOLID]=1 \{\
2998 .       fcolor \\*[$BX_COLOR]
2999 \h'\\*[$BX_INDENT]'\
3000 \D'P \\*[$BX_WIDTH] 0 0 \\*[$BX_DEPTH] -\\*[$BX_WIDTH] 0 0 -\\*[$BX_DEPTH]'
3001 .       fcolor
3002 .       rr #BX_SOLID
3003 .    \}
3004 .    el \{\
3005 .       gcolor \\*[$BX_COLOR]
3006 \D't \\n[#RULE_WEIGHT]'\
3007 \h'\\*[$BX_INDENT]'\
3008 \v'\\n[#WEIGHT_ADJ]u'\
3009 \D'p \\*[$BX_WIDTH]-\\n[#RULE_WEIGHT]u 0 0 \\*[$BX_DEPTH]-\\n[#RULE_WEIGHT]u -\\*[$BX_WIDTH]+\\n[#RULE_WEIGHT]u 0 0 -\\*[$BX_DEPTH]+\\n[#RULE_WEIGHT]u'\
3010 \v'-\\n[#WEIGHT_ADJ]u'\
3011 \D't \\n[#SAVED_RULE_WEIGHT]'
3012 .       gcolor
3013 .    \}
3014 .    sp -1v
3015 .    if \\n[#FILLED]=1 \{\
3016 .       if \\n[#FILL_MODE]=0 .QUAD LEFT
3017 .       if \\n[#FILL_MODE]=1 .JUSTIFY
3018 .       if \\n[#FILL_MODE]=3 .QUAD CENTER
3019 .       if \\n[#FILL_MODE]=5 .QUAD RIGHT
3020 .       rr #FILLED
3021 .    \}
3022 .    if \\n[#NOFILL]=1 \{\
3023 .       if \\n[#NOFILL_MODE]=3 .CENTER
3024 .       if \\n[#NOFILL_MODE]=5 .RIGHT
3025 .    \}
3026 .    nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
3027 .    nr #WEIGHT_ADJ  \\n[#SAVED_WEIGHT_ADJ]
3028 .    rr #SAVED_WEIGHT
3029 .    rr #SAVED_WEIGHT_ADJ
3030 .    if \\n[#RESTORE_TRAP]=1 \{\
3031 .       vpt 1
3032 .       rr #RESTORE_TRAP
3033 .    \}
3034 .    if '\\n[.z]'FLOAT*DIV' \
3035 .       if !(\\n[.d]+\\*[$BX_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$BX_DEPTH]
3036 .END
3037 \#
3038 \# ELLIPSES - DCL
3039 \# --------------
3040 \# *Arguments:
3041 \#   <rule weight | SOLID> <indent> <width> <depth> [ <color> ]
3042 \# *Function:
3043 \#   Draws described ellipses.
3044 \# *Notes:
3045 \#   Ellipses (circles) are drawn left-to-right, from the baseline
3046 \#   down, and return to their point of origin.  Ellipse rules are
3047 \#   drawn from the perimeter inwards.  Color must be set in the
3048 \#   macro; otherwise the color will be black, regardless of current
3049 \#   .gcolor.  If no arg given, the rule weight is the one set by
3050 \#   RULE_WEIGHT.
3051 \#
3052 .MAC DCL END
3053 .    if \\n[.vpt]=1 \{\
3054 .       vpt 0
3055 .       nr #RESTORE_TRAP 1
3056 .    \}
3057 .    ie !\\n[#NO_ADVANCE]=1 .br
3058 .    el \{\
3059 .       sp -1v
3060 .       rr #NO_ADVANCE
3061 .    \}
3062 .    ie \\n[.u]=1 \{\
3063 .       nr #FILLED 1
3064 .       nr #FILL_MODE \\n[.j]
3065 .    \}
3066 .    el \{\
3067 .       nr #NOFILL 1
3068 .       if \\n[.ce]>0 .nr #NOFILL_MODE 3
3069 .       if \\n[.rj]>0 .nr #NOFILL_MODE 5
3070 .       ce 0
3071 .       rj 0
3072 .    \}
3073 .    nf
3074 .    ie '\\$1'SOLID' .nr #CL_SOLID 1
3075 .    el              .ds $CL_WEIGHT \\$1
3076 .    ds $CL_INDENT \\$2
3077 .    ds $CL_WIDTH  \\$3
3078 .    ds $CL_DEPTH  \\$4
3079 .    ie !'\\$5'' \{\
3080 .       ie d$\\$5_FILL .ds $CL_COLOR \\*[$\\$5_FILL]
3081 .       el             .ds $CL_COLOR \\$5
3082 .    \}
3083 .    el .ds $CL_COLOR default
3084 .    nr #SAVED_WEIGHT     \\n[#RULE_WEIGHT]
3085 .    nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3086 .    if !'\\$1'SOLID' .RULE_WEIGHT \\*[$CL_WEIGHT]
3087 .    ds $CL_INDENT \\*[$CL_INDENT]-\\n[#WEIGHT_ADJ]u
3088 .    ie \\n[#CL_SOLID]=1 \{\
3089 .       fcolor \\*[$CL_COLOR]
3090 \h'\\*[$CL_INDENT]'\
3091 \v'\\*[$CL_DEPTH]/2u'\
3092 \D'E \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\
3093 \v'-\\*[$CL_DEPTH]/2u'
3094 .       fcolor
3095 .       rr #CL_SOLID
3096 .    \}
3097 .    el \{\
3098 .       gcolor \\*[$CL_COLOR]
3099 \D't \\n[#RULE_WEIGHT]'\
3100 \h'\\*[$CL_INDENT]'\
3101 \v'\\*[$CL_DEPTH]/2u'\
3102 \D'e \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\
3103 \v'-(\\*[$CL_DEPTH]/2u)'\
3104 \D't \\n[#SAVED_RULE_WEIGHT]'
3105 .       gcolor
3106 .    \}
3107 .    sp -1v
3108 .    if \\n[#FILLED]=1 \{\
3109 .       if \\n[#FILL_MODE]=0 .QUAD LEFT
3110 .       if \\n[#FILL_MODE]=1 .JUSTIFY
3111 .       if \\n[#FILL_MODE]=3 .QUAD CENTER
3112 .       if \\n[#FILL_MODE]=5 .QUAD RIGHT
3113 .       rr #FILLED
3114 .    \}
3115 .    if \\n[#NOFILL]=1 \{\
3116 .       if \\n[#NOFILL_MODE]=3 .CENTER
3117 .       if \\n[#NOFILL_MODE]=5 .RIGHT
3118 .    \}
3119 .    nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
3120 .    nr #WEIGHT_ADJ  \\n[#SAVED_WEIGHT_ADJ]
3121 .    rr #SAVED_WEIGHT
3122 .    rr #SAVED_WEIGHT_ADJ
3123 .    if \\n[#RESTORE_TRAP]=1 \{\
3124 .       vpt 1
3125 .       rr #RESTORE_TRAP
3126 .    \}
3127 .    if '\\n[.z]'FLOAT*DIV' \
3128 .       if !(\\n[.d]+\\*[$CL_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$CL_DEPTH]
3129 .END
3130 \#
3131 \# RULE WEIGHT
3132 \# -----------
3133 \# *Argument:
3134 \#   <weight of rules in points>
3135 \# *Function:
3136 \#   Sets \D't <n>' to the correct number of machine units for the
3137 \#   argument given in points.
3138 \# *Notes:
3139 \#   Decimal fractions are allowed.  Rule weight must be < 100.
3140 \#
3141 .MAC RULE_WEIGHT END
3142 .    di NULL \" Diverted so there's no problem with breaks, spacing, etc.
3143 .       ds $ARG \\$1
3144 .       substring $ARG -1
3145 .       if !\B'\\*[$ARG]' \{\
3146 .          tm1 "[mom]: The argument to \\$0 must not have a unit of measure appended.
3147 .          ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
3148 .       \}
3149 .       length #STR_LENGTH \\$1
3150 .       ds $ARG \\$1
3151 .       substring $ARG 0 0
3152 .       ie '\\*[$ARG]'.' \{\
3153 .          ds $ARG \\$1
3154 .          substring $ARG 1 \\n[#STR_LENGTH]-1
3155 .          nr #WEIGHT \\*[$ARG]*100
3156 .          if (\\n[#WEIGHT]>=1000) \{\
3157 .              while (\\n[#WEIGHT]>=1000) \{\
3158 .                  nr #WEIGHT \\n[#WEIGHT]/10
3159 .              \}
3160 .          \}
3161 .       \}
3162 .       el \{\
3163 .          ds $ARG \\$1
3164 .          substring $ARG 1 1
3165 .          ie '\\*[$ARG]'.' \{\
3166 .             ds $LHS \\$1
3167 .             substring $LHS 0 0
3168 .             ds $RHS \\$1
3169 .             substring $RHS 2
3170 .             nr #WEIGHT \\*[$LHS]\\*[$RHS]*100
3171 .             if (\\n[#WEIGHT]>=10000) \{\
3172 .                while (\\n[#WEIGHT]>=10000) \{\
3173 .                   nr #WEIGHT \\n[#WEIGHT]/10
3174 .                \}
3175 .             \}
3176 .          \}
3177 .          el \{\
3178 .             ie \\n[#STR_LENGTH]<=2 .nr #WEIGHT \\$1*1000
3179 .             el \{\
3180 .                ds $ARG \\$1
3181 .                substring $ARG 2 2
3182 .                ie !'\\*[$ARG]'.' \{\
3183 .                   tm1 "[mom]: Invalid argument given to macro \\$0 at line \\n[.c].
3184 .                   tm1 "       Rule weight must be < 100 points.
3185 .                   tm1 "       Falling back to default weight .5 points.
3186 .                   nr #WEIGHT 500
3187 .                \}
3188 .                el \{\
3189 .                   ds $LHS \\$1
3190 .                   substring $LHS 0 1
3191 .                   ds $RHS \\$1
3192 .                   substring $RHS 3
3193 .                   nr #WEIGHT \\*[$LHS]\\*[$RHS]*1000
3194 .                   if (\\n[#WEIGHT]>=100000) \{\
3195 .                      while (\\n[#WEIGHT]>=100000) \{\
3196 .                         nr #WEIGHT \\n[#WEIGHT]/10
3197 .                      \}
3198 .                   \}
3199 .                \}
3200 .             \}
3201 .          \}
3202 .       \}
3203 .       nr #WEIGHT_ADJ \\n[#WEIGHT]/2
3204 .       if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT' \{\
3205 .          nr #BIB_STRING_UNDERLINE_WEIGHT     \\n[#WEIGHT]
3206 .          nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3207 .       \}
3208 .       if '\\$0'COVER_UNDERLINE_WEIGHT' \{\
3209 .          nr #COVER_UNDERLINE_WEIGHT     \\n[#WEIGHT]
3210 .          nr #COVER_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3211 .       \}
3212 .       if '\\$0'DOC_COVER_UNDERLINE_WEIGHT' \{\
3213 .          nr #DOC_COVER_UNDERLINE_WEIGHT     \\n[#WEIGHT]
3214 .          nr #DOC_COVER_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3215 .       \}
3216 .       if '\\$0'DOCTYPE_UNDERLINE_WEIGHT' \{\
3217 .          nr #DOCTYPE_UNDERLINE_WEIGHT     \\n[#WEIGHT]
3218 .          nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3219 .       \}
3220 .       if '\\$0'ENDNOTE_STRING_UNDERLINE_WEIGHT' \{\
3221 .          nr #EN_STRING_UNDERLINE_WEIGHT     \\n[#WEIGHT]
3222 .          nr #EN_STRING_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3223 .       \}
3224 .       if '\\$0'ENDNOTE_TITLE_UNDERLINE_WEIGHT' \{\
3225 .          nr #EN_TITLE_UNDERLINE_WEIGHT     \\n[#WEIGHT]
3226 .          nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3227 .       \}
3228 .       if '\\$0'FOOTER_RULE_WEIGHT' \{\
3229 .          nr #FOOTER_RULE_WEIGHT     \\n[#WEIGHT]
3230 .          nr #FOOTER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3231 .       \}
3232 .       if '\\$0'FOOTNOTE_RULE_WEIGHT' \{\
3233 .          nr #FN_RULE_WEIGHT     \\n[#WEIGHT]
3234 .          nr #FN_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3235 .       \}
3236 .       if '\\$0'HEADER_RULE_WEIGHT' \{\
3237 .          nr #HEADER_RULE_WEIGHT     \\n[#WEIGHT]
3238 .          nr #HEADER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3239 .       \}
3240 .       if '\\$0'RULE_WEIGHT' \{\
3241 .          nr #RULE_WEIGHT     \\n[#WEIGHT]
3242 .          nr #RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3243 .       \}
3244 .       if '\\$0'UNDERSCORE_WEIGHT' \{\
3245 .          nr #UNDERSCORE_WEIGHT     \\n[#WEIGHT]
3246 .          nr #UNDERSCORE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3247 .       \}
3248 .    di
3249 .END
3250 \#
3251 \# Aliases
3252 \# 
3253 .ALIAS BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT RULE_WEIGHT
3254 .ALIAS COVER_UNDERLINE_WEIGHT               RULE_WEIGHT
3255 .ALIAS DOC_COVER_UNDERLINE_WEIGHT           RULE_WEIGHT
3256 .ALIAS DOCTYPE_UNDERLINE_WEIGHT             RULE_WEIGHT
3257 .ALIAS ENDNOTE_STRING_UNDERLINE_WEIGHT      RULE_WEIGHT
3258 .ALIAS ENDNOTE_TITLE_UNDERLINE_WEIGHT       RULE_WEIGHT
3259 .ALIAS FOOTER_RULE_WEIGHT                   RULE_WEIGHT
3260 .ALIAS FOOTNOTE_RULE_WEIGHT                 RULE_WEIGHT
3261 .ALIAS HEADER_RULE_WEIGHT                   RULE_WEIGHT
3262 .ALIAS UNDERSCORE_WEIGHT                    RULE_WEIGHT
3263 \#
3264 \# Default rule weights
3265 \# ~~~~~~~~~~~~~~~~~~~~
3266 .nr #BIB_STRING_UNDERLINE_WEIGHT 500
3267 .nr #COVER_UNDERLINE_WEIGHT      500
3268 .nr #DOC_COVER_UNDERLINE_WEIGHT  500
3269 .nr #DOCTYPE_UNDERLINE_WEIGHT    500
3270 .nr #EN_STRING_UNDERLINE_WEIGHT  500
3271 .nr #EN_TITLE_UNDERLINE_WEIGHT   500
3272 .nr #FN_RULE_WEIGHT              500
3273 .nr #FOOTER_RULE_WEIGHT          500
3274 .nr #HEADER_RULE_WEIGHT          500
3275 .nr #RULE_WEIGHT                 500
3276 .nr #UNDERSCORE_WEIGHT           500
3277 \#
3278 .nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \n[#BIB_STRING_UNDERLINE_WEIGHT]/2
3279 .nr #COVER_UNDERLINE_WEIGHT_ADJ      \n[#DOCTYPE_UNDERLINE_WEIGHT]/2
3280 .nr #DOC_COVER_UNDERLINE_WEIGHT_ADJ  \n[#DOCTYPE_RULE_WEIGHT]/2
3281 .nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ    \n[#DOCTYPE_RULE_WEIGHT]/2
3282 .nr #EN_STRING_UNDERLINE_WEIGHT_ADJ  \n[#EN_STRING_UNDERLINE_WEIGHT]/2
3283 .nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ   \n[#EN_STRING_UNDERLINE_WEIGHT]/2
3284 .nr #FOOTER_RULE_WEIGHT_ADJ          \n[#FOOTER_RULE_WEIGHT]/2
3285 .nr #FN_RULE_WEIGHT_ADJ              \n[#FN_RULE_WEIGHT]/2
3286 .nr #HEADER_RULE_WEIGHT_ADJ          \n[#HEADER_RULE_WEIGHT]/2
3287 .nr #RULE_WEIGHT_ADJ                 \n[#RULE_WEIGHT]/2
3288 .nr #UNDERSCORE_WEIGHT_ADJ           \n[#UNDERSCORE_WEIGHT]/2
3289 \#
3290 \# Set default rule weight
3291 \#
3292 .di NULL
3293 \D't 500'
3294 .di
3295 \#
3296 \# =====================================================================
3297 \#
3298 \# +++WORD AND SENTENCE SPACING+++
3299 \#
3300 \# WORD SPACE CONTROL
3301 \# ------------------
3302 \# *Argument:
3303 \#   <+|->wordspace | DEFAULT
3304 \# *Function:
3305 \#   Increases or decreases interword space by user supplied amount.
3306 \#   If DEFAULT, value is set to 12 (groff default).
3307 \# *Notes:
3308 \#   $WS_CONSTANT is the groff default word space.
3309 \#   $WS_VAR is the user supplied amount by which to in/decrease word space.
3310 \#   $WS is a concatenation of WS_CONSTANT and WS_VAR.
3311 \#
3312 \#   \n[.sss] holds the current sentence space value.
3313 \#
3314 .MAC WS END
3315 .    ds $WS_CURR \\n[.ss]
3316 .    ds $WS_VAR  \\$1
3317 .    ie '\\$1'DEFAULT' .ss 12 \\n[.sss]
3318 .    el \{\
3319 .       ds $WS (\\*[$WS_CURR]\\*[$WS_VAR])
3320 .       ie \\n[.sss]=12 .ss \\*[$WS] 12
3321 .       el \{\
3322 .          ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
3323 .          SS \\*[$SS_VAR]
3324 .      \}
3325 .    \}
3326 .END
3327 \#
3328 \# SENTENCE SPACE CONTROL
3329 \# ----------------------
3330 \# *Argument:
3331 \#   <+-sentencespace> | 0 | DEFAULT
3332 \# *Function:
3333 \#   Increases or decreases sentence space by user supplied amount.
3334 \#   If 0, sentence spaces are ignored.  If DEFAULT, value is
3335 \#   set to 12 (groff default).
3336 \# *Notes:
3337 \#   Because the user supplied value requires a literal + or - sign,
3338 \#   the macro argument is stored in a string.
3339 \#
3340 \#   Sentence space applies only to input where sentences are separated
3341 \#   by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
3342 \#   Changing .SS when sentences are separated by only one space has
3343 \#   no effect on the space between sentences.
3344 \#
3345 \#   \n[.ss] holds the current wordspace value.
3346 \#   \n[.sss] holds the current sentence space value.
3347 \#
3348 .MAC SS END
3349 .    ds $SS_VAR \\$1
3350 .    ie '\\$1'0' .ss \\n[.ss] (\\n[.ss]-\\n[.ss])
3351 .    el \{\
3352 .       ie '\\$1'DEFAULT' .ss \\n[.ss]
3353 .       el                .ss \\n[.ss] (0\\*[$SS_VAR])
3354 .    \}
3355 .END
3356 \#
3357 \# =====================================================================
3358 \#
3359 \# INDENTS
3360 \# -------
3361 \#
3362 \# +++INDENT LEFT+++
3363 \#
3364 .MAC IL END
3365 .    if \\n[#INDENT_STYLE_BOTH] .IBX
3366 .    nr #INDENT_STYLE_LEFT  1
3367 .    nr #INDENT_ACTIVE      1
3368 .    nr #INDENT_LEFT_ACTIVE 1
3369 .    ie '\\$1'' \{\
3370 .       br
3371 .       in \\n[#L_INDENT]u
3372 .       ta \\n[.l]u-\\n[#L_INDENT]u
3373 .    \}
3374 .    el \{\
3375 .       br
3376 .       nr #L_INDENT +(\\$1)
3377 .       in \\n[#L_INDENT]u
3378 .       ta \\n[.l]u-\\n[#L_INDENT]u
3379 .    \}
3380 .    if \\n[#IN_ITEM] .nr #IN_ITEM_L_INDENT +(\\$1)
3381 .END
3382 \#
3383 \# +++INDENT RIGHT+++
3384 \#
3385 .MAC IR END
3386 .    if \\n[#INDENT_STYLE_BOTH] .IBX
3387 .    nr #INDENT_STYLE_RIGHT   1
3388 .    nr #INDENT_ACTIVE        1
3389 .    nr #INDENT_RIGHT_ACTIVE  1
3390 .    ie '\\$1'' \{\
3391 .       br
3392 .       ie \\n[#TAB_ACTIVE] \{\
3393 .          ll \\n[.l]u-\\n[#R_INDENT]u
3394 .          ta \\n[.l]u-\\n[#L_INDENT]u
3395 .       \}
3396 .       el \{\
3397 .          ll \\n[.l]u-\\n[#R_INDENT]u
3398 .          ta \\n[.l]u-\\n[#L_INDENT]u
3399 .       \}
3400 .    \}
3401 .    el \{\
3402 .       br
3403 .       nr #R_INDENT +(\\$1)
3404 .       ie \\n[#TAB_ACTIVE] \{\
3405 .          ll \\n[.l]u-\\n[#R_INDENT]u
3406 .          ta \\n[.l]u-\\n[#L_INDENT]u
3407 .       \}
3408 .       el \{\
3409 .          ll \\n[.l]u-\\n[#R_INDENT]u
3410 .          ta \\n[.l]u-\\n[#L_INDENT]u
3411 .       \}
3412 .    \}
3413 .END
3414 \#
3415 \# +++INDENT BOTH+++
3416 \#
3417 .MAC IB END
3418 .    if \\n[#INDENT_STYLE_LEFT] .ILX
3419 .    if \\n[#INDENT_STYLE_RIGHT] .IRX
3420 .    nr #INDENT_STYLE_BOTH  1
3421 .    nr #INDENT_ACTIVE      1
3422 .    nr #INDENT_BOTH_ACTIVE 1
3423 .    ie '\\$1'' \{\
3424 .       br
3425 .       in \\n[#BL_INDENT]u
3426 .       ie \\n[#TAB_ACTIVE] \{\
3427 .          ll \\n[.l]u-\\n[#BR_INDENT]u
3428 .          ta \\n[.l]u-\\n[#BR_INDENT]u
3429 .       \}
3430 .       el \{\
3431 .          ll \\n[.l]u-\\n[#BR_INDENT]u
3432 .          ta \\n[.l]u-\\n[#BR_INDENT]u
3433 .       \}
3434 .    \}
3435 .    el \{\
3436 .       br
3437 .       nr #BL_INDENT (\\n[#INDENT]+\\$1)
3438 .       ie \\n[#NUM_ARGS]=2 .nr #BR_INDENT +(\\$2)
3439 .       el .nr #BR_INDENT \\n[#BL_INDENT]
3440 .       ie \\n[#TAB_ACTIVE] \{\
3441 .          in \\n[#BL_INDENT]u
3442 .          ll \\n[.l]u-\\n[#BR_INDENT]u
3443 .          ta \\n[.l]u-\\n[#BL_INDENT]u
3444 .       \}
3445 .       el \{\
3446 .          in \\n[#BL_INDENT]u
3447 .          ll \\n[.l]u-\\n[#BR_INDENT]u
3448 .          ta \\n[.l]u-\\n[#BR_INDENT]u
3449 .       \}
3450 .    \}
3451 .END
3452 \#
3453 \# +++TEMPORARY INDENT+++
3454 \#
3455 .MAC TI END
3456 .    br
3457 .    ie '\\$1'' \{\
3458 .       ti \\n[#T_INDENT]u
3459 .       if \\n[#INDENT_LEFT_ACTIVE] .ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
3460 .       if \\n[#INDENT_BOTH_ACTIVE] .ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
3461 .    \}
3462 .    el \{\
3463 .       nr #T_INDENT (\\$1)
3464 .       ti \\n[#T_INDENT]u
3465 .    \}
3466 .END
3467 \#
3468 \# +++HANGING INDENT+++
3469 \#
3470 .MAC HI END
3471 .    ie '\\$1'' .ti -\\n[#HL_INDENT]u
3472 .    el \{\
3473 .       nr #HL_INDENT (\\$1)
3474 .       ti -\\n[#HL_INDENT]u
3475 .    \}
3476 .END
3477 \#
3478 \# +++INDENTS OFF+++
3479 \#
3480 .MAC ILX END
3481 .    ie \\n[#IN_ITEM] .nr #L_INDENT -\\n[#IN_ITEM_L_INDENT]
3482 .    el \{\
3483 .       br
3484 .       in 0
3485 .       rr #INDENT_LEFT_ACTIVE
3486 .    \}
3487 .    if '\\$1'CLEAR' \{\
3488 .       rr #L_INDENT
3489 .       rr #INDENT_STYLE_LEFT
3490 .    \}
3491 .END
3492 \#
3493 .MAC IRX END
3494 .    br
3495 .    rr #INDENT_RIGHT_ACTIVE
3496 .    ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3497 .    el \{\
3498 .       ie \\n[#COLUMNS] \{\
3499 .          ll \\n[#COL_L_LENGTH]u
3500 .          ta \\n[.l]u
3501 .       \}
3502 .       el \{\
3503 .          ll \\n[#L_LENGTH]u
3504 .          ta \\n[.l]u
3505 .       \}
3506 .    \}
3507 .    if '\\$1'CLEAR' \{\
3508 .       rr #R_INDENT
3509 .       rr #INDENT_STYLE_RIGHT
3510 .    \}
3511 .END
3512 \#
3513 .MAC IBX END
3514 .    br
3515 .    in 0
3516 .    rr #INDENT_BOTH_ACTIVE
3517 .    ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3518 .    el \{\
3519 .       ie \\n[#COLUMNS] \{\
3520 .          ll \\n[#COL_L_LENGTH]u
3521 .          ta \\n[.l]u
3522 .       \}
3523 .       el \{\
3524 .          ll \\n[#L_LENGTH]u
3525 .          ta \\n[.l]u
3526 .       \}
3527 .    \}
3528 .    if '\\$1'CLEAR' \{\
3529 .       rr #BL_INDENT
3530 .       rr #BR_INDENT
3531 .       rr #INDENT_STYLE_BOTH
3532 .    \}
3533 .END
3534 \#
3535 .MAC IX END
3536 .    if '\\$0'IX' \{\
3537 .       if !\\n[#IX_WARN] \{\
3538 .          tm1 "[mom]: Use of .IX is deprecated.  Use .IQ instead.
3539 .          tm1 "      .IX will continue to behave as before, but to
3540 .          tm1 "       avoid this message, please update your document.
3541 .          nr #IX_WARN 1
3542 .       \}
3543 .    \}
3544 .    br
3545 .    in 0
3546 .    rr #INDENT_LEFT_ACTIVE
3547 .    rr #INDENT_RIGHT_ACTIVE
3548 .    rr #INDENT_BOTH_ACTIVE
3549 .    if \\n[#INDENT_STYLE_RIGHT] \{\
3550 .       ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3551 .       el \{\
3552 .          ie \\n[#COLUMNS] \{\
3553 .             ll \\n[#COL_L_LENGTH]u
3554 .             ta \\n[.l]u
3555 .          \}
3556 .          el \{\
3557 .             ll \\n[#L_LENGTH]u
3558 .             ta \\n[.l]u
3559 .          \}
3560 .       \}
3561 .    \}
3562 .    if \\n[#INDENT_STYLE_BOTH] \{\
3563 .       ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3564 .       el \{\
3565 .          ie \\n[#COLUMNS] \{\
3566 .             ll \\n[#COL_L_LENGTH]u
3567 .             ta \\n[.l]u
3568 .          \}
3569 .          el \{\
3570 .             ll \\n[#L_LENGTH]u
3571 .             ta \\n[.l]u
3572 .          \}
3573 .       \}
3574 .    \}
3575 .    if '\\$1'CLEAR' \{\
3576 .       if \\n[#INDENT_STYLE_RIGHT] \{\
3577 .          ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3578 .          el \{\
3579 .             ie \\n[#COLUMNS] \{\
3580 .                ll \\n[#COL_L_LENGTH]u
3581 .                ta \\n[.l]u
3582 .             \}
3583 .             el \{\
3584 .                ll \\n[#L_LENGTH]u
3585 .                ta \\n[.l]u
3586 .             \}
3587 .          \}
3588 .       \}
3589 .       if \\n[#INDENT_STYLE_BOTH] \{\
3590 .          ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3591 .          el \{\
3592 .             ie \\n[#COLUMNS] \{\
3593 .                ll \\n[#COL_L_LENGTH]u
3594 .                ta \\n[.l]u
3595 .             \}
3596 .             el \{\
3597 .                ll \\n[#L_LENGTH]u
3598 .                ta \\n[.l]u
3599 .             \}
3600 .          \}
3601 .       \}
3602 .       rr #L_INDENT
3603 .       rr #R_INDENT
3604 .       rr #BL_INDENT
3605 .       rr #BR_INDENT
3606 .       rr #T_INDENT
3607 .       rr #H_INDENT
3608 .       rr #INDENT_STYLE_LEFT
3609 .       rr #INDENT_STYLE_RIGHT
3610 .       rr #INDENT_STYLE_BOTH
3611 .    \}
3612 .    rr #INDENT_ACTIVE
3613 .END
3614 \#
3615 \# =====================================================================
3616 \#
3617 \# +++MULTIPLE COLUMNS+++
3618 \#
3619 \# MULTIPLE COLUMNS ON
3620 \# -------------------
3621 \# *Arguments:
3622 \#   <none>
3623 \# *Function:
3624 \#   Marks the top of a column set
3625 \#
3626 .MAC MCO END
3627 .    mk c
3628 .END
3629 \#
3630 \# MULTIPLE COLUMN RETURN
3631 \# ----------------------
3632 \# *Arguments:
3633 \#   <none>
3634 \# *Function:
3635 \#   Returns to the top of a column set
3636 \#
3637 .MAC MCR END
3638 .    TRAP OFF
3639 .    sp |\\n[c]u
3640 .    TRAP
3641 .END
3642 \#
3643 \# MULTIPLE COLUMNS OFF
3644 \# --------------------
3645 \# *Arguments:
3646 \#   <none> | <lead to advance beneath bottom of deepest column>
3647 \# *Function:
3648 \#   Advances to the end of a column set
3649 \# *Notes:
3650 \#   With no argument, advances to the next baseline (at the current
3651 \#   leading value) beneath the longest column.  With an argument
3652 \#   (which requires a unit of measure), advances arg distance
3653 \#   beneath the baseline of the deepest column.  If the argument
3654 \#   is zero, advances to the baseline of the deepest column.
3655 \#
3656 .MAC MCX END
3657 .    TRAP OFF
3658 .    ie '\\$1'' \{\
3659 .       TQ
3660 .       sp |\\n[.h]u
3661 .    \}
3662 .    el \{\
3663 .       nr #MCX_ALD (\\$1)
3664 .       TQ
3665 .       ie \\n[#MCX_ALD]=0 .sp |\\n[.h]u-1v
3666 .       el .sp |\\n[.h]u+\\n[#MCX_ALD]u
3667 .       rr #MCX_ALD
3668 .    \}
3669 .    TRAP
3670 .END
3671 \#
3672 \# =====================================================================
3673 \#
3674 \# +++TYPESETTING SUPPORT MACROS+++
3675 \#
3676 \# TRAP
3677 \# ----
3678 \# *Arguments:
3679 \#   toggle
3680 \# *Function:
3681 \#   Enables/disables traps.
3682 \# *Notes:
3683 \#   EL and TN don't function as advertised on the last line before
3684 \#   a trap (when they break the preceding line, they spring the
3685 \#   trap, and groff won't back up to the line preceding the trap).
3686 \#   TRAP is a kludge to get EL and TN work properly on last lines.
3687 \#   The user simply enloses the offending lines in TRAP OFF/TRAP.
3688 \#
3689 .MAC TRAP END
3690 .    ie '\\$1'' .vpt 1
3691 .    el         .vpt 0
3692 .END
3693 \#
3694 \# SILENT
3695 \# ------
3696 \# *Arguments:
3697 \#   <none> | <anything>
3698 \# *Function:
3699 \#   Diverts text so that it doesn't print, or turns the function off.
3700 \# *Notes:
3701 \#   Useful for setting up autotabs where you don't want the line with
3702 \#   the tab marks to print.
3703 \#
3704 \#   Also aliased as COMMENT, in case user wants to input a batch of
3705 \#   text that doesn't print.
3706 \#
3707 .MAC SILENT END
3708 .    nr #SILENT 1
3709 .    if \\n[#QUAD] .br
3710 .    ie '\\$1'' .di NO_FLASH
3711 .    el \{\
3712 .       br
3713 .       di
3714 .       rm NO_FLASH
3715 .       rr #SILENT
3716 .    \}
3717 .END
3718 \#
3719 \# PRINT
3720 \# -----
3721 \# *Function:
3722 \#   Prints anything.  A macro that helps keep my code nicely indented.
3723 \#
3724 .MAC PRINT END
3725 .    nop \\$*
3726 .END
3727 \#
3728 \# CAPS
3729 \# ----
3730 \# *Arguments:
3731 \#   <none> | <anything>
3732 \# *Function:
3733 \#   Converts text to caps, or, if OFF, reverts to normal caps/lc.
3734 \# *Notes:
3735 \#   For inline control of capitalization style, use \*[UC] and
3736 \#   \*[LC].
3737 \#
3738 .MAC CAPS END
3739 .    ie '\\$1'' \{\
3740 .       tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
3741 .       tr \[`a]\[`A]
3742 .       tr \[^a]\[^A]
3743 .       tr \['a]\['A]
3744 .       tr \[:a]\[:A]
3745 .       tr \[oa]\[oA]
3746 .       tr \[~a]\[~A]
3747 .       tr \[ae]\[AE]
3748 .       tr \[`e]\[`E]
3749 .       tr \[^e]\[^E]
3750 .       tr \['e]\['E]
3751 .       tr \[:e]\[:E]
3752 .       tr \[`i]\[`I]
3753 .       tr \[^i]\[^I]
3754 .       tr \['i]\['I]
3755 .       tr \[:i]\[:I]
3756 .       tr \[`o]\[`O]
3757 .       tr \[^o]\[^O]
3758 .       tr \['o]\['O]
3759 .       tr \[:o]\[:O]
3760 .       tr \[~o]\[~O]
3761 .       tr \[/o]\[/O]
3762 .       tr \[`u]\[`U]
3763 .       tr \[^u]\[^U]
3764 .       tr \['u]\['U]
3765 .       tr \[:u]\[:U]
3766 .       tr \[,c]\[,C]
3767 .       tr \[-d]\[-D]
3768 .       tr \[~n]\[~N]
3769 .       tr \[Sd]\[-D]
3770 .       tr \[Tp]\[TP]
3771 .       tr \['y]\['Y]
3772 .       tr \[:y]\[:Y]
3773 .       nr #CAPS_ON 1
3774 .    \}
3775 .    el \{\
3776 .       tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
3777 .       tr \[`a]\[`a]
3778 .       tr \[^a]\[^a]
3779 .       tr \['a]\['a]
3780 .       tr \[:a]\[:a]
3781 .       tr \[oa]\[oa]
3782 .       tr \[~a]\[~a]
3783 .       tr \[ae]\[ae]
3784 .       tr \[`e]\[`e]
3785 .       tr \[^e]\[^e]
3786 .       tr \['e]\['e]
3787 .       tr \[:e]\[:e]
3788 .       tr \[`i]\[`i]
3789 .       tr \[^i]\[^i]
3790 .       tr \['i]\['i]
3791 .       tr \[:i]\[:i]
3792 .       tr \[`o]\[`o]
3793 .       tr \[^o]\[^o]
3794 .       tr \['o]\['o]
3795 .       tr \[:o]\[:o]
3796 .       tr \[~o]\[~o]
3797 .       tr \[/o]\[/o]
3798 .       tr \[`u]\[`u]
3799 .       tr \[^u]\[^u]
3800 .       tr \['u]\['u]
3801 .       tr \[:u]\[:u]
3802 .       tr \[,c]\[,c]
3803 .       tr \[Sd]\[Sd]
3804 .       tr \[~n]\[~n]
3805 .       tr \[Tp]\[Tp]
3806 .       tr \['y]\['y]
3807 .       tr \[:y]\[:y]
3808 .       rr #CAPS_ON
3809 .    \}
3810 .END
3811 \#
3812 .MAC UC END
3813 \c
3814 .    tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
3815 .    tr \[`a]\[`A]
3816 .    tr \[^a]\[^A]
3817 .    tr \['a]\['A]
3818 .    tr \[:a]\[:A]
3819 .    tr \[oa]\[oA]
3820 .    tr \[~a]\[~A]
3821 .    tr \[ae]\[AE]
3822 .    tr \[`e]\[`E]
3823 .    tr \[^e]\[^E]
3824 .    tr \['e]\['E]
3825 .    tr \[:e]\[:E]
3826 .    tr \[`i]\[`I]
3827 .    tr \[^i]\[^I]
3828 .    tr \['i]\['I]
3829 .    tr \[:i]\[:I]
3830 .    tr \[`o]\[`O]
3831 .    tr \[^o]\[^O]
3832 .    tr \['o]\['O]
3833 .    tr \[:o]\[:O]
3834 .    tr \[~o]\[~O]
3835 .    tr \[/o]\[/O]
3836 .    tr \[`u]\[`U]
3837 .    tr \[^u]\[^U]
3838 .    tr \['u]\['U]
3839 .    tr \[:u]\[:U]
3840 .    tr \[,c]\[,C]
3841 .    tr \[Sd]\[-D]
3842 .    tr \[~n]\[~N]
3843 .    tr \[Tp]\[TP]
3844 .    tr \['y]\['Y]
3845 .    tr \[:y]\[:Y]
3846 .    nr #CAPS_ON 1
3847 .END
3848 \#
3849 .MAC LC END
3850 \c
3851 .    tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
3852 .    tr \[`a]\[`a]
3853 .    tr \[^a]\[^a]
3854 .    tr \['a]\['a]
3855 .    tr \[:a]\[:a]
3856 .    tr \[oa]\[oa]
3857 .    tr \[~a]\[~a]
3858 .    tr \[ae]\[ae]
3859 .    tr \[`e]\[`e]
3860 .    tr \[^e]\[^e]
3861 .    tr \['e]\['e]
3862 .    tr \[:e]\[:e]
3863 .    tr \[`i]\[`i]
3864 .    tr \[^i]\[^i]
3865 .    tr \['i]\['i]
3866 .    tr \[:i]\[:i]
3867 .    tr \[`o]\[`o]
3868 .    tr \[^o]\[^o]
3869 .    tr \['o]\['o]
3870 .    tr \[:o]\[:o]
3871 .    tr \[~o]\[~o]
3872 .    tr \[/o]\[/o]
3873 .    tr \[`u]\[`u]
3874 .    tr \[^u]\[^u]
3875 .    tr \['u]\['u]
3876 .    tr \[:u]\[:u]
3877 .    tr \[,c]\[,c]
3878 .    tr \[Sd]\[Sd]
3879 .    tr \[~n]\[~n]
3880 .    tr \[Tp]\[Tp]
3881 .    tr \['y]\['y]
3882 .    tr \[:y]\[:y]
3883 .    rr #CAPS_ON
3884 .END
3885 \#
3886 \# SIZESPECS
3887 \# ---------
3888 \# Argument:
3889 \#   <none>
3890 \# Function:
3891 \#   Gets cap-height, x-height, and descender depth of the
3892 \#   current font at the current point size.
3893 \# *Notes:
3894 \#   The routine is diverted so it remains invisible to output.
3895 \#
3896 .MAC SIZESPECS END
3897 .    if '\\n[.z]'FLOAT*DIV' \
3898 .       if \\n[dn] .nr saved-dn \\n[dn]
3899 .    di TYPESIZE
3900 E\R'#CAP_HEIGHT \\n[.cht]'
3901 e\R'#X_HEIGHT \\n[.cht]'
3902 y\R'#DESCENDER \\n[.cdp]'
3903 .    br
3904 .    ds $CAP_HEIGHT \\n[#CAP_HEIGHT]u
3905 .    ds $X_HEIGHT \\n[#X_HEIGHT]u
3906 .    ds $DESCENDER \\n[#DESCENDER]u
3907 .    di
3908 .    if '\\n[.z]'FLOAT*DIV' \
3909 .       nr dn \\n[saved-dn]
3910 .END
3911 \#
3912 \# =====================================================================
3913 \#
3914 \# +++TYPESETTING ALIASES+++
3915 \#
3916 .ALIAS    ADD_SPACE       ALD
3917 .ALIAS    CENTRE          CENTER
3918 .ALIAS    COLOUR          COLOR
3919 .ALIAS    COMMENT         SILENT
3920 .ALIAS    CONDENSE        CONDENSE_OR_EXTEND
3921 .ALIAS    EXTEND          CONDENSE_OR_EXTEND
3922 .ALIAS    FAM             FAMILY
3923 .ALIAS    FONT            FT
3924 .ALIAS    HYPHENATE       HY
3925 .ALIAS    HYPHENATION     HY
3926 .ALIAS    HYSET           HY_SET
3927 .ALIAS    IBQ             IBX
3928 .ALIAS    ILQ             ILX
3929 .ALIAS    IQ              IX
3930 .ALIAS    IRQ             IRX
3931 .ALIAS    LIG             LIGATURES
3932 .ALIAS    NEWCOLOUR       NEWCOLOR
3933 .ALIAS    PADMARKER       PAD_MARKER
3934 .ALIAS    SP              ALD
3935 .ALIAS    SPACE           ALD
3936 .ALIAS    TABSET          TAB_SET
3937 .ALIAS    TB              TAB
3938 .ALIAS    UNDERSCORE_2    UNDERSCORE2
3939 .ALIAS    XCOLOUR         XCOLOR
3940 .ALIAS    PDF_LINK_COLOUR PDF_LINK_COLOR
3941 .ALIAS    AUTO_TOC_RELOCATE AUTO_RELOCATE_TOC
3942 \#
3943 \# ====================================================================
3944 \#
3945 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
3946 \# ===============================================
3947 \#
3948 \# DOC_MACRO_ERROR
3949 \# ----------
3950 \# *Arguments:
3951 \#   None.
3952 \# *Function:
3953 \#   Warning message if DOC_<PARAMETER> called before START.
3954 \#
3955 .MAC DOC_MACRO_ERROR END
3956 .    if '\\$1'DOC_L_MARGIN'    .ds $REPLACEMENT L_MARGIN
3957 .    if '\\$1'DOC_R_MARGIN'    .ds $REPLACEMENT R_MARGIN
3958 .    if '\\$1'DOC_LINE_LENGTH' .ds $REPLACEMENT LL
3959 .    if '\\$1'DOC_FAMILY'      .ds $REPLACEMENT "FAMILY or FAM
3960 .    if '\\$1'DOC_PT_SIZE'     .ds $REPLACEMENT PT_SIZE
3961 .    if '\\$1'DOC_LEAD'        .ds $REPLACEMENT LS
3962 .    if '\\$1'DOC_QUAD'        .ds $REPLACEMENT QUAD
3963 .    tm1 "[mom]: \\$1 at line \\n[.c] of '\\n[.F]' should not be used before START.
3964 .    tm1 "       Use \\*[$REPLACEMENT] instead.
3965 .    ab  Aborting.
3966 .END
3967 \#
3968 \# +++PAGE DIMENSIONS+++
3969 \#
3970 \# PAPER SIZE
3971 \# ----------
3972 \# *Arguments:
3973 \#   LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
3974 \# *Function:
3975 \#   Sets up dimensions for different paper sizes.
3976 \#
3977 .MAC PAPER END
3978 .    ds $PAPER \\$1
3979 .    if '\\*[$PAPER]'LETTER' \{\
3980 .       PAGEWIDTH  8.5i
3981 .       PAGELENGTH 11i
3982 .    \}
3983 .    if '\\*[$PAPER]'LEGAL' \{\
3984 .       PAGEWIDTH  8.5i
3985 .       PAGELENGTH 14i
3986 .    \}
3987 .    if '\\*[$PAPER]'STATEMENT' \{\
3988 .       PAGEWIDTH  5.5i
3989 .       PAGELENGTH 8.5i
3990 .    \}
3991 .    if '\\*[$PAPER]'TABLOID' \{\
3992 .       PAGEWIDTH  11i
3993 .       PAGELENGTH 17i
3994 .    \}
3995 .    if '\\*[$PAPER]'LEDGER' \{\
3996 .       PAGEWIDTH  17i
3997 .       PAGELENGTH 11i
3998 .    \}
3999 .    if '\\*[$PAPER]'FOLIO' \{\
4000 .       PAGEWIDTH  8.5i
4001 .       PAGELENGTH 13i
4002 .    \}
4003 .    if '\\*[$PAPER]'QUARTO' \{\
4004 .       PAGEWIDTH  610p
4005 .       PAGELENGTH 780p
4006 .    \}
4007 .    if '\\*[$PAPER]'10x14' \{\
4008 .       PAGEWIDTH  10i
4009 .       PAGELENGTH 14i
4010 .    \}
4011 .    if '\\*[$PAPER]'EXECUTIVE' \{\
4012 .       PAGEWIDTH  7.25i
4013 .       PAGELENGTH 10.5i
4014 .    \}
4015 .    if '\\*[$PAPER]'A3' \{\
4016 .       PAGEWIDTH  842p
4017 .       PAGELENGTH 1190p
4018 .    \}
4019 .    if '\\*[$PAPER]'A4' \{\
4020 .       PAGEWIDTH  595p
4021 .       PAGELENGTH 842p
4022 .    \}
4023 .    if '\\*[$PAPER]'A5' \{\
4024 .       PAGEWIDTH  421p
4025 .       PAGELENGTH 595p
4026 .    \}
4027 .    if '\\*[$PAPER]'B4' \{\
4028 .       PAGEWIDTH  709p
4029 .       PAGELENGTH 1002p
4030 .    \}
4031 .    if '\\*[$PAPER]'B5' \{\
4032 .       PAGEWIDTH  501p
4033 .       PAGELENGTH 709p
4034 .    \}
4035 .    if '\\$2'LANDSCAPE' \{\
4036 .       nr #PAGE_WIDTH_TMP \\n[#PAGE_WIDTH]
4037 .       PAGEWIDTH \\n[#PAGE_LENGTH]u
4038 .       PAGELENGTH \\n[#PAGE_WIDTH_TMP]u
4039 .    \}
4040 .    if !r#L_MARGIN .L_MARGIN \\n[.o]
4041 .    if !r#R_MARGIN .R_MARGIN 1i
4042 .END
4043 \#
4044 \# ====================================================================
4045 \#
4046 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
4047 \#
4048 \# PRINTSTYLE
4049 \# ----------
4050 \# *Arguments:
4051 \#   TYPESET | TYPEWRITE [SINGLESPACE]
4052 \# *Function:
4053 \#   Sets type specs for typewriter-style or typeset output.
4054 \# *Notes:
4055 \#   Number registers: TYPEWRITE=1, TYPESET=2.
4056 \#
4057 .MAC PRINTSTYLE END
4058 .    if !\\n[#COLLATE]=1 \{\
4059 .       if !d$PAPER .PAPER LETTER
4060 .       if '\\$1'TYPEWRITE' \{\
4061 .          nr #PRINT_STYLE 1
4062 .          if !\\n[#DOC_TYPE]=4 .L_MARGIN 6P
4063 .          if !\\n[#DOC_TYPE]=4 .R_MARGIN 6P
4064 .          ds $TYPEWRITER_FAM C
4065 .          ds $TYPEWRITER_PS  12
4066 .          TYPEWRITER
4067 .          color 0
4068 .          ie '\\$2'SINGLESPACE' \{\
4069 .             nr #SINGLE_SPACE 1
4070 .             vs 12
4071 .             ie \\n[#DOC_TYPE]=4 .nr #FOOTER_ADJ \\n[.v]
4072 .             el .nr #FOOTER_ADJ \\n[.v]*2
4073 .             nr #ORIGINAL_DOC_LEAD \\n[.v]
4074 .          \}
4075 .          el \{\
4076 .             if !\\n[#DOC_TYPE]=4 \{\
4077 .                vs 24
4078 .                nr #FOOTER_ADJ \\n[.v]/2
4079 .                nr #ORIGINAL_DOC_LEAD \\n[.v]
4080 .             \}
4081 .          \}
4082 .          QUAD    L
4083 .          HY      OFF
4084 .          SMARTQUOTES OFF
4085 .          if !\\n[#PP_INDENT] .nr #PP_INDENT 3P
4086 .          HDRFTR_RIGHT_CAPS
4087 .          nr #BOLDER_UNITS 0
4088 .          nr #CONDENSE 0
4089 .          nr #EXTEND 0
4090 .          if !\\n[#ITALIC_MEANS_ITALIC] .rm IT
4091 .          rm BD
4092 .          rm BDI
4093 .          if !\\n[#ITALIC_MEANS_ITALIC] .rm PREV
4094 .          if !\\n[#SLANT_MEANS_SLANT]   .UNDERLINE_SLANT
4095 .          if !\\n[#ITALIC_MEANS_ITALIC] .UNDERLINE_ITALIC
4096 .          if !\\n[#UNDERLINE_QUOTES]    .UNDERLINE_QUOTES
4097 .          nr #IGNORE_COLUMNS 1
4098 .          nr #RULE_WEIGHT 500
4099 .          char \[em] --
4100 .          tr `'
4101 .          tr \[lq]"
4102 .          tr \[rq]"
4103 .       \}
4104 .       if '\\$1'TYPESET' \{\
4105 .          nr #PRINT_STYLE 2
4106 .          if !\\n[#DOC_TYPE]=4 .L_MARGIN 6P
4107 .          if !\\n[#DOC_TYPE]=4 .R_MARGIN 6P
4108 .          FAMILY  T
4109 .          FT      R
4110 .          if !\\n[#DOC_TYPE]=4 .ps 12.5
4111 .          if !\\n[#DOC_TYPE]=4 .vs 16
4112 .\" In DEFAULTS, TRAPS is run with this leading, so we need a register to
4113 .\" hold it for use with the .sp in FOOTER
4114 .          nr #FOOTER_ADJ 12000
4115 .          JUSTIFY
4116 .          HY
4117 .          HY_SET 2 36p 1p
4118 .          KERN
4119 .          LIG
4120 .          SS 0
4121 .          SMARTQUOTES
4122 .          if !\\n[#PP_INDENT] \{\
4123 .             in 2m                 \"Set indent
4124 .             nr #PP_INDENT \\n[.i] \"Read into #PP_INDENT
4125 .             in 0                  \"Remove indent
4126 .          \}
4127 .          HDRFTR_RIGHT_CAPS
4128 .          rr #IGNORE_COLUMNS
4129 .       \}
4130 .\" Set up default style for nine levels of headings
4131 .       nr #HD_LEVEL 0 1 \" loop step
4132 .       nr #LOOP 9       \" loop count
4133 .       while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\
4134 .           HEADING_STYLE \\n[#HD_LEVEL] \
4135             FONT   B \
4136             SIZE  +0 \
4137             QUAD   L \
4138             COLOR  black
4139 .\"  Set up default style for nine levels of TOC headings
4140 .           TOC_ENTRY_STYLE \\n[#HD_LEVEL] \
4141             FONT   R \
4142             SIZE  +0 \
4143             COLOR  black
4144 .       \}
4145 .\" Set up decreasing sizes for headings levels 1 - 3, starting at +3
4146 .       nr #HD_LEVEL 0 1 \" loop step
4147 .       nr #LOOP 3       \" loop count
4148 .       nr #HD_SIZE 4 1
4149 .       while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\
4150 .          nr #HD_SIZE_CHANGE \\n-[#HD_SIZE]
4151 .          ds $HEAD_\\n[#HD_LEVEL]_SIZE +\\n[#HD_SIZE_CHANGE]
4152 .       \}
4153 .\" Set up TOC title style
4154 .       TOC_TITLE_STYLE FONT R SIZE +0 INDENT 0
4155 .\" Set up captions, labels, sources
4156 .       LABELS ALL FONT B AUTOLEAD 2
4157 .       LABELS EQN FONT R QUAD RIGHT
4158 .       CAPTIONS ALL AUTOLEAD 2
4159 .       CAPTIONS EQN QUAD CENTER
4160 .       SOURCES TBL AUTOLEAD 2
4161 .    \}
4162 .END
4163 \#
4164 \# PRINTSTYLE TYPEWRITE control.
4165 \#
4166 .MAC TYPEWRITER_FAMILY END
4167 .    ds $TYPEWRITER_FAM \\$1
4168 .END
4169 \#
4170 .ALIAS TYPEWRITER_FAM TYPEWRITER_FAMILY
4171 \#
4172 .MAC TYPEWRITER_SIZE END
4173 .    ds $TYPEWRITER_PS \\$1
4174 .END
4175 \#
4176 .MAC TYPEWRITER END
4177 .    fam \\*[$TYPEWRITER_FAM]
4178 .    ft  R
4179 .    ps  \\*[$TYPEWRITER_PS]
4180 .END
4181 \#
4182 \# ITALIC MEANS ITALIC
4183 \# -------------------
4184 \# *Argument:
4185 \#   <none>
4186 \# *Function:
4187 \#   Instructs TYPEWRITE to treat italics as italics, whether
4188 \#   invoked via control lines or inline.
4189 \# *Notes:
4190 \#   ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
4191 \#   hence invoking the one automatically turns off the other.
4192 \#
4193 .MAC ITALIC_MEANS_ITALIC END
4194 .    if \\n[#PRINT_STYLE]=1 \{\
4195 .       nr #ITALIC_MEANS_ITALIC 1
4196 .       rr #UNDERLINE_ITALIC
4197 .       rm ROM
4198 .       rm IT
4199 .       rm PREV
4200 .       ds ROM  \Ef[R]
4201 .       ds IT   \Ef[I]
4202 .       ds PREV \Ef[]
4203 .    \}
4204 .END
4205 \#
4206 \# UNDERLINE ITALIC
4207 \# ----------------
4208 \# *Argument:
4209 \#   <none>
4210 \# *Function:
4211 \#   Instructs TYPEWRITE to underline italics, whether invoked
4212 \#   via control lines or inline.
4213 \# *Notes:
4214 \#   UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
4215 \#   hence invoking the one automatically turns off the other.
4216 \#
4217 \#   UNDERLINE_ITALIC is the default for TYPEWRITE.
4218 \#
4219 .MAC UNDERLINE_ITALIC END
4220 .    if \\n[#PRINT_STYLE]=1 \{\
4221 .       nr #UNDERLINE_ITALIC 1
4222 .       rr #ITALIC_MEANS_ITALIC
4223 .       rm ROM
4224 .       rm IT
4225 .       rm PREV
4226 .       ds ROM  \E*[ULX]
4227 .       ds IT   \E*[UL]
4228 .       ds PREV \E*[ULX]
4229 .    \}
4230 .END
4231 \#
4232 \# UNDERLINE SLANT
4233 \# ---------------
4234 \# *Arguments:
4235 \#   <none> | <anything>
4236 \# *Function:
4237 \#   Instructs TYPEWRITE to underline occurrences of \*[SLANT], or
4238 \#   turns feature off.
4239 \# *Notes:
4240 \#   Users may want \*[SLANT] to mean slant in TYPEWRITE, although
4241 \#   most of the time, \*[SLANT] most likely means the user wanted
4242 \#   italic but didn't have it, ergo the need to tell TYPEWRITE to
4243 \#   treat \*[SLANT] as italic (i.e. underlined).
4244 \#
4245 \#   UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
4246 \#   hence invoking the one automatically turns off the other.
4247 \#
4248 \#   UNDERLINE_SLANT is the default for TYPEWRITE.
4249 \#
4250 .MAC UNDERLINE_SLANT END
4251 .    if \\n[#PRINT_STYLE]=1 \{\
4252 .       rr #SLANT_MEANS_SLANT
4253 .       nr #UNDERLINE_SLANT 1
4254 .       rm SLANT
4255 .       rm SLANTX
4256 .       ds SLANT  \ER'#SLANT_ON 1'\E*[UL]
4257 .       ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
4258 .    \}
4259 .END
4260 \#
4261 .MAC SLANT_MEANS_SLANT END
4262 .    if \\n[#PRINT_STYLE]=1 \{\
4263 .       rr #UNDERLINE_SLANT
4264 .       nr #SLANT_MEANS_SLANT 1
4265 .       rm SLANT
4266 .       rm SLANTX
4267 .       ds SLANT  \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
4268 .       ds SLANTX \ER'#SLANT_ON 0'\ES'0'
4269 .    \}
4270 .END
4271 \#
4272 .MAC IGNORE_COLUMNS END
4273 .    if \\n[#PRINT_STYLE]=1 .nr #NO_COLUMNS 1
4274 .END
4275 \#
4276 \# ====================================================================
4277 \#
4278 \# +++COPY STYLE -- DRAFT OR FINAL+++
4279 \#
4280 \# COPY STYLE
4281 \# ----------
4282 \# *Arguments:
4283 \#   DRAFT | FINAL
4284 \# *Function:
4285 \#   Sets registers that are used to determine what to put
4286 \#   in the default header, and how to number pages.
4287 \# *Notes:
4288 \#   DOCTYPE must come before COPYSTYLE.
4289 \#
4290 .MAC COPYSTYLE END
4291 .    ds $COPY_STYLE \\$1
4292 .    if '\\*[$COPY_STYLE]'DRAFT' \{\
4293 .       nr #COPY_STYLE 1
4294 .       if !d$DRAFT .DRAFT 1
4295 .    \}
4296 .    if '\\*[$COPY_STYLE]'FINAL' .nr #COPY_STYLE 2
4297 .    if !d$CHAPTER_STRING  .CHAPTER_STRING "Chapter"
4298 .    if !d$DRAFT_STRING    .DRAFT_STRING "Draft"
4299 .    if !d$REVISION_STRING .REVISION_STRING "Rev."
4300 .\" Default
4301 .    if \\n[#DOC_TYPE]=1 \{\
4302 .       ie \\n[#COPY_STYLE]=1 \{\
4303 .          ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4304 .          el .PAGENUM_STYLE roman
4305 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4306 .             ie \\n[#DRAFT_WITH_PAGENUM] .ds $HDRFTR_CENTER
4307 .             el \{\
4308 .                ie '\\*[$REVISION]'' \{\
4309 .                   ds $HDRFTR_CENTER \
4310                     \\*[$DRAFT_STRING]\\*[$DRAFT]
4311 .                \}
4312 .                el \{\
4313 .                   ds $HDRFTR_CENTER \
4314                     \\*[$DRAFT_STRING]\\*[$DRAFT], \
4315                     \\*[$REVISION_STRING] \\*[$REVISION]
4316 .                \}
4317 .             \}
4318 .          \}
4319 .       \}
4320 .       el \{\
4321 .          ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4322 .          el                         .PAGENUM_STYLE DIGIT
4323 .          if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM
4324 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4325 .             ds $HDRFTR_CENTER
4326 .             rr #USER_DEF_HDRFTR_CENTER
4327 .          \}
4328 .       \}
4329 .    \}
4330 .\" Chapter
4331 .    if \\n[#DOC_TYPE]=2 \{\
4332 .\" Copystyle DRAFT
4333 .       ie \\n[#COPY_STYLE]=1 \{\
4334 .          ie \\n[#PAGENUM_STYLE_SET] \
4335 .             PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4336 .          el \
4337 .             PAGENUM_STYLE roman
4338 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4339 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
4340 .                ie '\\*[$CHAPTER]'' \{\
4341 .                   ie !'\\*[$CHAPTER_TITLE_1]'' \
4342 .                       ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4343 .                   el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
4344 .                \}
4345 .                el \{\
4346 .                   ie !'\\*[$CHAPTER_TITLE_1]'' \
4347 .                       ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4348 .                   el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4349 .                \}
4350 .             \}
4351 .             el \{\
4352 .                ie '\\*[$REVISION]'' \{\
4353 .                   ie '\\*[$CHAPTER]'' \{\
4354 .                      ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4355 .                         ie '\\*[$DRAFT]'' \
4356 .                            ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4357 .                         el \{\
4358 .                            ds $HDRFTR_CENTER \
4359                              \\*[$CHAPTER_TITLE], \
4360                              \\*[$DRAFT_STRING]\\*[$DRAFT]
4361 .                         \}
4362 .                      \}
4363 .                      el \{\
4364 .                         ie '\\*[$DRAFT]'' \{\
4365 .                            ds $HDRFTR_CENTER \
4366                              \\*[$CHAPTER_STRING]
4367 .                         \}
4368 .                         el \{\
4369 .                            ds $HDRFTR_CENTER \
4370                              \\*[$CHAPTER_STRING], \
4371                              \\*[$DRAFT_STRING]\\*[$DRAFT]
4372 .                         \}
4373 .                      \}
4374 .                   \}
4375 .                   el \{\
4376 .                      ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4377 .                         ie '\\*[$DRAFT]'' \
4378 .                            ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4379 .                         el \{\
4380 .                            ds $HDRFTR_CENTER \
4381                              \\*[$CHAPTER_TITLE_1], \
4382                              \\*[$DRAFT_STRING]\\*[$DRAFT]
4383 .                         \}
4384 .                      \}
4385 .                      el \{\
4386 .                         ie '\\*[$DRAFT]'' \{\
4387 .                            ds $HDRFTR_CENTER \
4388                              \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4389 .                         \}
4390 .                         el \{\
4391 .                            ds $HDRFTR_CENTER \
4392                              \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4393                              \\*[$DRAFT_STRING]\\*[$DRAFT]
4394 .                         \}
4395 .                      \}
4396 .                   \}
4397 .                \}
4398 .                el \{\
4399 .                   ie '\\*[$CHAPTER]'' \{\
4400 .                      ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4401 .                         ie '\\*[$DRAFT]'' \{\
4402 .                            ds $HDRFTR_CENTER \
4403                              \\*[$CHAPTER_TITLE], \
4404                              \\*[$REVISION_STRING] \\*[$REVISION]
4405 .                         \}
4406 .                         el \{\
4407 .                            ds $HDRFTR_CENTER \
4408                              \\*[$CHAPTER_TITLE], \
4409                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
4410                              \\*[$REVISION_STRING] \\*[$REVISION]
4411 .                         \}
4412 .                      \}
4413 .                      el \{\
4414 .                         ie '\\*[$DRAFT]'' \{\
4415 .                            ds $HDRFTR_CENTER \
4416                              \\*[$CHAPTER_STRING], \
4417                              \\*[$REVISION_STRING] \\*[$REVISION]
4418 .                         \}
4419 .                         el \{\
4420 .                            ds $HDRFTR_CENTER \
4421                              \\*[$CHAPTER_STRING], \
4422                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
4423                              \\*[$REVISION_STRING] \\*[$REVISION]
4424 .                         \}
4425 .                      \}
4426 .                   \}
4427 .                   el \{\
4428 .                      ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4429 .                         ie '\\*[$DRAFT]'' \{\
4430 .                            ds $HDRFTR_CENTER \
4431                              \\*[$CHAPTER_TITLE], \
4432                              \\*[$REVISION_STRING] \\*[$REVISION]
4433 .                         \}
4434 .                         el \{\
4435 .                            ds $HDRFTR_CENTER \
4436                              \\*[$CHAPTER_TITLE], \
4437                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
4438                              \\*[$REVISION_STRING] \\*[$REVISION]
4439 .                         \}
4440 .                      \}
4441 .                      el \{\
4442 .                         ie '\\*[$DRAFT]'' \{\
4443 .                            ds $HDRFTR_CENTER \
4444                              \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4445                              \\*[$REVISION_STRING] \\*[$REVISION]
4446 .                         \}
4447 .                         el \{\
4448 .                            ds $HDRFTR_CENTER \
4449                              \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4450                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
4451                              \\*[$REVISION_STRING] \\*[$REVISION]
4452 .                         \}
4453 .                      \}
4454 .                   \}
4455 .                \}
4456 .             \}
4457 .          \}
4458 .       \}
4459 .\" Copystyle FINAL
4460 .       el \{\
4461 .          if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM
4462 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4463 .             ie \\n[#PAGENUM_STYLE_SET] \
4464 .                PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4465 .             el .PAGENUM_STYLE DIGIT
4466 .             ie '\\*[$CHAPTER]'' \{\
4467 .                ie !'\\*[$CHAPTER_TITLE_1]'' \
4468 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4469 .                el \
4470 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
4471 .             \}
4472 .             el \{\
4473 .                ie !'\\*[$CHAPTER_TITLE_1]'' \
4474 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4475 .                el \
4476 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4477 .             \}
4478 .          \}
4479 .       \}
4480 .    \}
4481 .\" Named
4482 .    if \\n[#DOC_TYPE]=3 \{\
4483 .       ie \\n[#COPY_STYLE]=1 \{\
4484 .          ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4485 .          el                         .PAGENUM_STYLE roman
4486 .          ie \\n[#DRAFT_WITH_PAGENUM] \
4487 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4488 .          el \{\
4489 .             if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4490 .                ie '\\*[$REVISION]'' \{\
4491 .                   ie '\\*[$DRAFT]'' \
4492 .                      ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4493 .                   el \{\
4494 .                      ds $HDRFTR_CENTER \
4495                        \\*[$DOC_TYPE], \
4496                        \\*[$DRAFT_STRING]\\*[$DRAFT]
4497 .                   \}
4498 .                \}
4499 .                el \{\
4500 .                   ie '\\*[$DRAFT]'' \{\
4501 .                      ds $HDRFTR_CENTER \
4502                        \\*[$DOC_TYPE], \
4503                        \\*[$REVISION_STRING] \\*[$REVISION]
4504 .                   \}
4505 .                   el \{\
4506 .                      ds $HDRFTR_CENTER \
4507                        \\*[$DOC_TYPE], \
4508                        \\*[$DRAFT_STRING]\\*[$DRAFT], \
4509                        \\*[$REVISION_STRING] \\*[$REVISION]
4510 .                   \}
4511 .                \}
4512 .             \}
4513 .          \}
4514 .       \}
4515 .       el \{\
4516 .          if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM
4517 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4518 .             ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4519 .             el .PAGENUM_STYLE DIGIT
4520 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4521 .          \}
4522 .       \}
4523 .    \}
4524 .END
4525 \#
4526 \# ====================================================================
4527 \#
4528 \# +++COLLECT DOC INFO -- STRINGS AND REGISTERS FOR REFERENCE MACROS+++
4529 \#
4530 \# *Arguments:
4531 \#   various string/register arguments
4532 \# *Function:
4533 \#   Collect information about documents.
4534 \#
4535 .MAC DOCTITLE END
4536 .    rr #DOCTITLE_NUM
4537 .    nr #DOCTITLE_NUM 0 1
4538 .    while \\n[#NUM_ARGS]>\\n[#DOCTITLE_NUM] \{\
4539 .       ds $DOC_TITLE_\\n+[#DOCTITLE_NUM] \\$\\n[#DOCTITLE_NUM]
4540 .    \}
4541 .    ds $DOC_TITLE \\$*
4542 .    PDF_TITLE \\*[$DOC_TITLE]
4543 .END
4544 \#
4545 .MAC TITLE END \"Document title
4546 .    ie \\n[#NUM_ARGS]=0 \{\
4547 .       if \\n[#TITLE_NUM] \{\
4548 .          nr #ITEM 0 1
4549 .          while \\n[#TITLE_NUM]>\\n[#ITEM] \{\
4550 .             rm $TITLE_\\n+[#ITEM]
4551 .          \}
4552 .          rr #TITLE_NUM
4553 .       \}
4554 .    \}
4555 .    el \{\
4556 .       nr #TITLE_NUM 0 1
4557 .       while \\n[#NUM_ARGS]>\\n[#TITLE_NUM] \{\
4558 .          ds $TITLE_\\n+[#TITLE_NUM] \\$\\n[#TITLE_NUM]
4559 .       \}
4560 .       ds $TITLE \\$*
4561 .    \}
4562 .END
4563 \#
4564 .MAC SUBTITLE END \"Document sub-title
4565 .    ie \\n[#NUM_ARGS]=0 \{\
4566 .       if \\n[#SUBTITLE_NUM] \{\
4567 .          nr #ITEM 0 1
4568 .          while \\n[#SUBTITLE_NUM]>\\n[#ITEM] \{\
4569 .             rm $SUBTITLE_\\n+[#ITEM]
4570 .          \}
4571 .          rr #SUBTITLE_NUM
4572 .          rm $SUBTITLE
4573 .       \}
4574 .    \}
4575 .    el \{\
4576 .       if '\\$1'DOC_COVER' \{\
4577 .          shift
4578 .          nr #SUBTITLE_DOC_COVER_NUM 0 1
4579 .          while \\n[#NUM_ARGS]>\\n[#SUBTITLE_DOC_COVER_NUM] \{\
4580 .              ds $SUBTITLE_DOC_COVER_\\n+[#SUBTITLE_DOC_COVER_NUM] \
4581 \\$\\n[#SUBTITLE_DOC_COVER_NUM]
4582 .          \}
4583 .          return
4584 .       \}
4585 .       if '\\$1'COVER' \{\
4586 .          shift
4587 .          nr #SUBTITLE_COVER_NUM 0 1
4588 .          while \\n[#NUM_ARGS]>\\n[#SUBTITLE_COVER_NUM] \{\
4589 .              ds $SUBTITLE_COVER_\\n+[#SUBTITLE_COVER_NUM] \
4590 \\$\\n[#SUBTITLE_COVER_NUM]
4591 .          \}
4592 .          return
4593 .       \}
4594 .       nr #SUBTITLE_NUM 0 1
4595 .       while \\n[#NUM_ARGS]>\\n[#SUBTITLE_NUM] \{\
4596 .          ds $SUBTITLE_\\n+[#SUBTITLE_NUM] \\$\\n[#SUBTITLE_NUM]
4597 .       \}
4598 .          ds $SUBTITLE \\$*
4599 .    \}
4600 .END
4601 \#
4602 .MAC CHAPTER END \"If document is a chapter, the chapter number
4603 .    nr #CHAPTER_CALLED 1
4604 .    ds $CHAPTER \\$1
4605 .    if r #CH_NUM \
4606 .       if \B'\\*[$CHAPTER]' .nr #CH_NUM \\*[$CHAPTER]
4607 .END
4608 \#
4609 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
4610 .    ie \\n[#NUM_ARGS]=0 \{\
4611 .       if \\n[#CHAPTER_TITLE_NUM] \{\
4612 .          nr #ITEM 0 1
4613 .          while \\n[#CHAPTER_TITLE_NUM]>\\n[#ITEM] \{\
4614 .             rm $CHAPTER_TITLE_\\n+[#ITEM]
4615 .          \}
4616 .          rr #CHAPTER_TITLE_NUM
4617 .          rm $CHAPTER_TITLE
4618 .       \}
4619 .    \}
4620 .    el \{\
4621 .       rr #CHAPTER_TITLE_NUM
4622 .       nr #CHAPTER_TITLE_NUM 0 1
4623 .       while \\n[#NUM_ARGS]>\\n[#CHAPTER_TITLE_NUM] \{\
4624 .          ds $CHAPTER_TITLE_\\n+[#CHAPTER_TITLE_NUM] \
4625 \\$\\n[#CHAPTER_TITLE_NUM]
4626 .       \}
4627 .       ds $CHAPTER_TITLE \\$*
4628 .    \}
4629 .END
4630 \#
4631 .MAC DRAFT END \"Draft number
4632 .    ie '\\$1'' .ds $DRAFT
4633 .    el .ds $DRAFT " \\$1
4634 .END
4635 \#
4636 .MAC REVISION END \"Revision number
4637 .    ds $REVISION \\$1
4638 .END
4639 \#
4640 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
4641 .    nr #DRAFT_WITH_PAGENUM 1
4642 .END
4643 \#
4644 .MAC AUTHOR END \"Author.  Enclose all args fully in double quotes.
4645 .    if '\\$1'DOC_COVER' \{\
4646 .       shift
4647 .       nr #AUTHOR_DOCCOVER_NUM 0 1
4648 .       while \\n[#NUM_ARGS]>\\n[#AUTHOR_DOCCOVER_NUM] \{\
4649 .           ds $AUTHOR_DOCCOVER_\\n+[#AUTHOR_DOCCOVER_NUM] \
4650 \\$\\n[#AUTHOR_DOCCOVER_NUM]
4651 .       \}
4652 .       return
4653 .    \}
4654 .    if '\\$1'COVER' \{\
4655 .       shift
4656 .       nr #AUTHOR_COVER_NUM 0 1
4657 .           while \\n[#NUM_ARGS]>\\n[#AUTHOR_COVER_NUM] \{\
4658 .              ds $AUTHOR_COVER_\\n+[#AUTHOR_COVER_NUM] \\$\\n[#AUTHOR_COVER_NUM]
4659 .           \}
4660 .       return
4661 .    \}
4662 .    nr #AUTHOR_NUM 0 1
4663 .    rm $AUTHORS
4664 .    while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
4665 .       ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
4666 .       as $AUTHORS \\*[$AUTHOR_\\n[#AUTHOR_NUM]], \"
4667 .    \}
4668 .    ds $AUTHOR \\*[$AUTHOR_1]
4669 .    substring $AUTHORS 0 -2
4670 .    ds PDF_AUTHORS \\*[$AUTHORS]
4671 .    pdfmomclean PDF_AUTHORS
4672 .    nop \!x X ps:exec [/Author (\\*[PDF_AUTHORS]) /DOCINFO pdfmark
4673 .END
4674 \#
4675 .ALIAS EDITOR AUTHOR
4676 \#
4677 .MAC COPYRIGHT END          \"For use on cover pages only
4678 .   ie \\n[#NUM_ARGS]=1 \{\
4679 .       ds $COPYRIGHT \[co]\\$1
4680 .       rm $COPYRIGHT_DOCCOVER
4681 .       rm $COPYRIGHT_COVER
4682 .    \}
4683 .    el \{\
4684 .       if '\\$1'DOC_COVER' .ds $COPYRIGHT_DOCCOVER \[co]\\$2
4685 .       if '\\$1'COVER'     .ds $COPYRIGHT_COVER \[co]\\$2
4686 .    \}
4687 .END
4688 \#
4689 .MAC MISC END \"For use on cover pages only; enclose all args in double quotes
4690 .    ie \\n[#NUM_ARGS]=0 \{\
4691 .       if \\n[#MISC_NUM] \{\
4692 .          nr #ITEM 0 1
4693 .          while \\n[#MISC_NUM]>\\n[#ITEM] \{\
4694 .             rm $MISC_\\n+[#ITEM]
4695 .          \}
4696 .          rr #MISC_NUM
4697 .          rr #NUM_MISCS
4698 .       \}
4699 .       if \\n[#MISC_DOC_COVER_NUM] \{\
4700 .          nr #ITEM 0 1
4701 .          while \\n[#MISC_DOC_COVER_NUM]>\\n[#ITEM] \{\
4702 .             rm $MISC_DOC_COVER_\\n+[#ITEM]
4703 .          \}
4704 .          rr #MISC_DOC_COVER_NUM
4705 .          rr #NUM_MISCS
4706 .       \}
4707 .       if \\n[#MISC_COVER_NUM] \{\
4708 .          nr #ITEM 0 1
4709 .          while \\n[#MISC_COVER_NUM]>\\n[#ITEM] \{\
4710 .             rm $MISC_COVER_\\n+[#ITEM]
4711 .          \}
4712 .          rr #MISC_COVER_NUM
4713 .          rr #NUM_MISCS
4714 .       \}
4715 .    \}
4716 .    el \{\
4717 .       if !'\\$1'DOC_COVER' \{\
4718 .         if !'\\$1'COVER' .nr #NEITHER 1
4719 .       \}
4720 .       if !'\\$1'COVER' \{\
4721 .          if !'\\$1'DOC_COVER' .nr #NEITHER 1
4722 .       \}
4723 .       if '\\$1'DOC_COVER' \{\
4724 .          shift
4725 .          nr #MISC_DOC_COVER_NUM 0 1
4726 .          while \\n[#NUM_ARGS]>\\n[#MISC_DOC_COVER_NUM] \{\
4727 .             ds $MISC_DOC_COVER_\\n+[#MISC_DOC_COVER_NUM] \
4728 \\$[\\n[#MISC_DOC_COVER_NUM]]
4729 .          \}
4730 .          nr #NUM_MISCS_DOCCOVER \\n[#NUM_ARGS]
4731 .       \}
4732 .       if '\\$1'COVER' \{\
4733 .          shift
4734 .          nr #MISC_COVER_NUM 0 1
4735 .          while \\n[#NUM_ARGS]>\\n[#MISC_COVER_NUM] \{\
4736 .             ds $MISC_COVER_\\n+[#MISC_COVER_NUM] \\$[\\n[#MISC_COVER_NUM]]
4737 .          \}
4738 .          nr #NUM_MISCS_COVER \\n[#NUM_ARGS]
4739 .       \}
4740 .       if \\n[#NEITHER]=1 \{\
4741 .          nr #MISC_NUM 0 1
4742 .          while \\n[#NUM_ARGS]>\\n[#MISC_NUM] \{\
4743 .             ds $MISC_\\n+[#MISC_NUM] \\$[\\n[#MISC_NUM]]
4744 .          \}
4745 .          nr #NUM_MISCS \\n[#NUM_ARGS]
4746 .          rr #NEITHER
4747 .       \}
4748 .   \}
4749 .END
4750 \#
4751 .MAC PAGENUMBER END \"Page # that appears on page one.
4752 .    nr #n%_AT_PAGENUM_SET \\n%
4753 .    nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
4754 .    rr #n%_AT_PAGENUM_SET
4755 .    nr #PAGE_NUM_SET 1
4756 .END
4757 \#
4758 \# ====================================================================
4759 \#
4760 \# +++TYPE OF DOCUMENT+++
4761 \#
4762 \# DOCUMENT TYPE
4763 \# -------------
4764 \# *Argument:
4765 \#   DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
4766 \# *Function:
4767 \#   Creates strings and sets registers for document types.
4768 \# *Notes:
4769 \#   Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
4770 \#
4771 .MAC DOCTYPE END
4772 .    if '\\$1'DEFAULT' .nr #DOC_TYPE 1
4773 .    if '\\$1'CHAPTER' .nr #DOC_TYPE 2
4774 .    if '\\$1'NAMED' \{\
4775 .       ds $DOC_TYPE \\$2
4776 .       nr #DOC_TYPE 3
4777 .    \}
4778 .    if '\\$1'LETTER' \{\
4779 .       nr #DOC_TYPE 4
4780 .       L_MARGIN 1.125i
4781 .       R_MARGIN 1.125i
4782 .       ps 12
4783 .       vs 13.5
4784 .       nr #FOOTER_ADJ \\n[.v]
4785 .       DOCHEADER OFF
4786 .       PARA_INDENT 3m
4787 .       INDENT_FIRST_PARAS
4788 .       PARA_SPACE
4789 .       ds $SUITE \En[#SUITE]
4790 .       HEADER_MARGIN 3P+6p
4791 .       HEADER_GAP 3P
4792 .       FOOTERS
4793 .       FOOTER_RULE OFF
4794 .       FOOTER_LEFT ""
4795 .       FOOTER_CENTER ""
4796 .       FOOTER_RIGHT_SIZE +0
4797 .       FOOTER_RIGHT "\&.../\E*[$SUITE]
4798 .       FOOTER_ON_FIRST_PAGE
4799 .       em ALL_DONE
4800 .    \}
4801 .END
4802 \#
4803 \# +++LETTER MACROS+++
4804 \#
4805 \# First, create a register to hold incrementing numbers to be
4806 \# appended to LETTERHEAD.
4807 \#
4808 .nr #FIELD 0 1
4809 \#
4810 \# DATE
4811 \# ----
4812 \# *Arguments:
4813 \#   <none>
4814 \# *Function:
4815 \#   Stores date (entered on the line after .DATE) in diversion
4816 \#   LETTERHEAD<n>
4817 \#
4818 .MAC DATE END
4819 .    if !'\\n[.z]'' .di
4820 .    di LETTERHEAD\\n+[#FIELD]
4821 .    ie \\n[#FIELD]=1 \{\
4822 .       nr #DATE_FIRST 1
4823 .       RIGHT
4824 .    \}
4825 .    el .LEFT
4826 .END
4827 \#
4828 \# TO
4829 \# --
4830 \# *Arguments:
4831 \#   <none>
4832 \# *Function:
4833 \#   Stores addressee address (entered on the line after .TO) in
4834 \#   diversion LETTERHEAD<n>
4835 \#
4836 .MAC TO END
4837 .    if !'\\n[.z]'' .di
4838 .    di LETTERHEAD\\n+[#FIELD]
4839 .    LEFT
4840 .END
4841 \#
4842 \# FROM
4843 \# ----
4844 \# *Arguments:
4845 \#   <none>
4846 \# *Function:
4847 \#   Stores addresser address (entered on the line after .FROM) in
4848 \#   diversion LETTERHEAD<n>
4849 \#
4850 .MAC FROM END
4851 .    if !'\\n[.z]'' .di
4852 .    di LETTERHEAD\\n+[#FIELD]
4853 .    LEFT
4854 .END
4855 \#
4856 \# GREETING
4857 \# --------
4858 \# *Arguments:
4859 \#   <none>
4860 \# *Function:
4861 \#   Stores greeting (entered on the line after .GREETING) in
4862 \#   diversion LETTERHEAD<n>
4863 \#
4864 .MAC GREETING END
4865 .    if !'\\n[.z]'' .di
4866 .    di LETTERHEAD\\n+[#FIELD]
4867 .    LEFT
4868 .END
4869 \#
4870 \# CLOSING
4871 \# -------
4872 \# *Arguments:
4873 \#   <closing string>
4874 \# *Function:
4875 \#   Stores greeting in diversion CLOSING.
4876 \#
4877 .MAC CLOSING END
4878 .    if '\\*[$SIG_SPACE]'' .ds $SIG_SPACE 3v
4879 .    ie ( (2v+\\*[$SIG_SPACE]) > \\n[.t] ) \{\
4880 .       ch HEADER
4881 .       ch FOOTER
4882 .       br
4883 .       tm1 "[mom]: Insufficient room for \\$0 and signature line.
4884 .       ab Aborting '\\n[.F]'.
4885 .    \}
4886 .    el .br
4887 .    nr #CLOSING 1
4888 .    di CLOSING_TEXT
4889 .END
4890 \#
4891 \# CLOSING INDENT
4892 \# --------------
4893 \# *Argument:
4894 \#   <amount to indent closing from left margin>
4895 \# *Function:
4896 \#   Defines string $CLOSE_INDENT for use in macro, ALL_DONE.
4897 \#
4898 .MAC CLOSING_INDENT END
4899 .    ds $CLOSE_INDENT \\$1
4900 .END
4901 \#
4902 \# SIGNATURE_SPACE
4903 \# ---------------
4904 \# *Argument:
4905 \#   <amount of space to leave for signature>
4906 \# *Function:
4907 \#   Defines string $SIG_SPACE for use in macro, ALL_DONE.
4908 \#
4909 .MAC SIGNATURE_SPACE END
4910 .    ds $SIG_SPACE \\$1
4911 .END
4912 \#
4913 \# NO SUITE
4914 \# --------
4915 \# *Arguments:
4916 \#   <none>
4917 \# *Function:
4918 \#   Redefines $FOOTER_RIGHT to blank so that a suite number doesn't
4919 \#   appear at the bottom of letter pages.
4920 \#
4921 .MAC NO_SUITE END
4922 .    FOOTER_RIGHT ""
4923 .END
4924 \#
4925 \# ====================================================================
4926 \#
4927 \# +++DEFAULTS+++
4928 \#
4929 \# TYPE-STYLE CONTROL MACROS
4930 \# -------------------------
4931 \# The control macros for family, font, size, quad and color are here
4932 \# grouped together.  Each (e.g. _FAMILY or _FONT) tests for a calling
4933 \# alias before performing the action(s) appropriate to the calling
4934 \# macro.  Defaults for all these guys are set in DEFAULTS, and listed
4935 \# in the "Control Macros" section of the documentation pertinent to
4936 \# the macro whose style is to be changed.
4937 \#
4938 .MAC _FAMILY END
4939 .    if '\\$0'AUTHOR_FAMILY' \
4940 .       ds $AUTHOR_FAM \\$1
4941 .    if '\\$0'BIBLIOGRAPHY_FAMILY' \
4942 .       ds $BIB_FAM \\$1
4943 .    if '\\$0'BIBLIOGRAPHY_STRING_FAMILY' \
4944 .       ds $BIB_STRING_FAM \\$1
4945 .    if '\\$0'BLOCKQUOTE_FAMILY' \
4946 .       ds $BQUOTE_FAM \\$1
4947 .    if '\\$0'CITATION_FAMILY' \
4948 .       ds $BQUOTE_FAM \\$1
4949 .    if '\\$0'CITE_FAMILY' \
4950 .       ds $BQUOTE_FAM \\$1
4951 .    if '\\$0'CHAPTER_TITLE_FAMILY' \
4952 .       ds $CHAPTER_TITLE_FAM \\$1
4953 .    if '\\$0'COVER_AUTHOR_FAMILY' \
4954 .       ds $COVER_AUTHOR_FAM \\$1
4955 .    if '\\$0'COVER_CHAPTER_TITLE_FAMILY' \
4956 .       ds $COVER_CHAPTER_TITLE_FAM \\$1
4957 .    if '\\$0'COVER_COPYRIGHT_FAMILY' \
4958 .       ds $COVER_COPYRIGHT_FAM \\$1
4959 .    if '\\$0'COVER_DOCTYPE_FAMILY' \
4960 .       ds $COVER_DOCTYPE_FAM \\$1
4961 .    if '\\$0'COVER_FAMILY' \
4962 .       ds $COVER_FAM \\$1
4963 .    if '\\$0'COVER_MISC_FAMILY' \
4964 .       ds $COVER_MISC_FAM \\$1
4965 .    if '\\$0'COVER_SUBTITLE_FAMILY' \
4966 .       ds $COVER_SUBTITLE_FAM \\$1
4967 .    if '\\$0'COVER_TITLE_FAMILY' \
4968 .       ds $COVER_TITLE_FAM \\$1
4969 .    if '\\$0'DOC_COVER_AUTHOR_FAMILY' \
4970 .       ds $DOC_COVER_AUTHOR_FAM \\$1
4971 .    if '\\$0'DOC_COVER_CHAPTER_TITLE_FAMILY' \
4972 .       ds $DOC_COVER_CHAPTER_TITLE_FAM \\$1
4973 .    if '\\$0'DOC_COVER_COPYRIGHT_FAMILY' \
4974 .       ds $DOC_COVER_COPYRIGHT_FAM \\$1
4975 .    if '\\$0'DOC_COVER_DOCTYPE_FAMILY' \
4976 .       ds $DOC_COVER_DOCTYPE_FAM \\$1
4977 .    if '\\$0'DOC_COVER_FAMILY' \
4978 .       ds $DOC_COVER_FAM \\$1
4979 .    if '\\$0'DOC_COVER_MISC_FAMILY' \
4980 .       ds $DOC_COVER_MISC_FAM \\$1
4981 .    if '\\$0'DOC_COVER_SUBTITLE_FAMILY' \
4982 .       ds $DOC_COVER_SUBTITLE_FAM \\$1
4983 .    if '\\$0'DOC_COVER_TITLE_FAMILY' \
4984 .       ds $DOC_COVER_TITLE_FAM \\$1
4985 .    if '\\$0'DOCHEADER_FAMILY' \
4986 .       ds $DOCHEADER_FAM \\$1
4987 .    if '\\$0'DOCTYPE_FAMILY' \
4988 .       ds $DOCTYPE_FAM \\$1
4989 .    if '\\$0'ENDNOTE_FAMILY' \
4990 .       ds $EN_FAM \\$1
4991 .    if '\\$0'ENDNOTE_NUMBER_FAMILY' \
4992 .       ds $EN_NUMBER_FAM \\$1
4993 .    if '\\$0'ENDNOTE_LINENUMBER_FAMILY' \
4994 .       ds $EN_LN_FAM \\$1
4995 .    if '\\$0'ENDNOTE_STRING_FAMILY' \
4996 .       ds $EN_STRING_FAM \\$1
4997 .    if '\\$0'ENDNOTE_TITLE_FAMILY' \
4998 .       ds $EN_TITLE_FAM \\$1
4999 .    if '\\$0'EPIGRAPH_FAMILY' \
5000 .       ds $EPI_FAM \\$1
5001 .    if '\\$0'FOOTNOTE_FAMILY' \
5002 .       ds $FN_FAM \\$1
5003 .    if '\\$0'HDRFTR_CENTER_FAMILY' \
5004 .       ds $HDRFTR_CENTER_FAM \\$1
5005 .    if '\\$0'HDRFTR_FAMILY' \{\
5006 .       ds $HDRFTR_FAM        \\$1
5007 .       ds $HDRFTR_LEFT_FAM   \\$1
5008 .       ds $HDRFTR_CENTER_FAM \\$1
5009 .       ds $HDRFTR_RIGHT_FAM  \\$1
5010 .    \}
5011 .    if '\\$0'HDRFTR_LEFT_FAMILY' \
5012 .       ds $HDRFTR_LEFT_FAM \\$1
5013 .    if '\\$0'HDRFTR_RIGHT_FAMILY' \
5014 .       ds $HDRFTR_RIGHT_FAM \\$1
5015 .    if '\\$0'LINENUMBER_FAMILY' \
5016 .       ds $LN_FAM \\$1
5017 .    if '\\$0'PAGENUM_FAMILY' \
5018 .       ds $PAGE_NUM_FAM \\$1
5019 .    if '\\$0'QUOTE_FAMILY' \
5020 .       ds $QUOTE_FAM \\$1
5021 .    if '\\$0'SUBTITLE_FAMILY' \
5022 .       ds $SUBTITLE_FAM \\$1
5023 .    if '\\$0'TITLE_FAMILY' \
5024 .       ds $TITLE_FAM \\$1
5025 .    if '\\$0'TOC_FAMILY' \
5026 .       ds $TOC_FAM \\$1
5027 .    if '\\$0'TOC_FAM' \
5028 .       ds $TOC_FAM \\$1
5029 .    if '\\$0'TOC_HEADER_FAMILY' \
5030 .       ds $TOC_HEADER_FAM \\$1
5031 .    if '\\$0'TOC_PN_FAMILY' \
5032 .       ds $TOC_PN_FAM \\$1
5033 .END
5034 \#
5035 .MAC _FONT END
5036 .    if '\\$0'AUTHOR_FONT' \
5037 .       ds $AUTHOR_FT \\$1
5038 .    if '\\$0'BIBLIOGRAPHY_FONT' \
5039 .       ds $BIB_FT \\$1
5040 .    if '\\$0'BIBLIOGRAPHY_STRING_FONT' \
5041 .       ds $BIB_STRING_FT \\$1
5042 .    if '\\$0'BLOCKQUOTE_FONT' \
5043 .       ds $BQUOTE_FT \\$1
5044 .    if '\\$0'CITATION_FONT' \
5045 .       ds $BQUOTE_FT \\$1
5046 .    if '\\$0'CITE_FONT' \
5047 .       ds $BQUOTE_FT \\$1
5048 .    if '\\$0'CHAPTER_TITLE_FONT' \
5049 .       ds $CHAPTER_TITLE_FT \\$1
5050 .    if '\\$0'COVER_AUTHOR_FONT' \
5051 .       ds $COVER_AUTHOR_FT \\$1
5052 .    if '\\$0'COVER_CHAPTER_TITLE_FONT' \
5053 .       ds $COVER_CHAPTER_TITLE_FT \\$1
5054 .    if '\\$0'COVER_COPYRIGHT_FONT' \
5055 .       ds $COVER_COPYRIGHT_FT \\$1
5056 .    if '\\$0'COVER_DOCTYPE_FONT' \
5057 .       ds $COVER_DOCTYPE_FT \\$1
5058 .    if '\\$0'COVER_MISC_FONT' \
5059 .       ds $COVER_MISC_FT \\$1
5060 .    if '\\$0'COVER_SUBTITLE_FONT' \
5061 .       ds $COVER_SUBTITLE_FT \\$1
5062 .    if '\\$0'COVER_TITLE_FONT' \
5063 .       ds $COVER_TITLE_FT \\$1
5064 .    if '\\$0'DOC_COVER_AUTHOR_FONT' \
5065 .       ds $DOC_COVER_AUTHOR_FT \\$1
5066 .    if '\\$0'DOC_COVER_CHAPTER_TITLE_FONT' \
5067 .       ds $DOC_COVER_CHAPTER_TITLE_FT \\$1
5068 .    if '\\$0'DOC_COVER_COPYRIGHT_FONT' \
5069 .       ds $DOC_COVER_COPYRIGHT_FT \\$1
5070 .    if '\\$0'DOC_COVER_DOCTYPE_FONT' \
5071 .       ds $DOC_COVER_DOCTYPE_FT \\$1
5072 .    if '\\$0'DOC_COVER_MISC_FONT' \
5073 .       ds $DOC_COVER_MISC_FT \\$1
5074 .    if '\\$0'DOC_COVER_SUBTITLE_FONT' \
5075 .       ds $DOC_COVER_SUBTITLE_FT \\$1
5076 .    if '\\$0'DOC_COVER_TITLE_FONT' \
5077 .       ds $DOC_COVER_TITLE_FT \\$1
5078 .    if '\\$0'DOCTYPE_FONT' \
5079 .       ds $DOCTYPE_FT \\$1
5080 .    if '\\$0'ENDNOTE_FONT' \
5081 .       ds $EN_FT \\$1
5082 .    if '\\$0'ENDNOTE_NUMBER_FONT' \
5083 .       ds $EN_NUMBER_FT \\$1
5084 .    if '\\$0'ENDNOTE_LINENUMBER_FONT' \
5085 .       ds $EN_LN_FT \\$1
5086 .    if '\\$0'ENDNOTE_STRING_FONT' \
5087 .       ds $EN_STRING_FT \\$1
5088 .    if '\\$0'ENDNOTE_TITLE_FONT' \
5089 .       ds $EN_TITLE_FT \\$1
5090 .    if '\\$0'EPIGRAPH_FONT' \
5091 .       ds $EPI_FT \\$1
5092 .    if '\\$0'FOOTNOTE_FONT' \
5093 .       ds $FN_FT \\$1
5094 .    if '\\$0'HDRFTR_CENTER_FONT' \
5095 .       ds $HDRFTR_CENTER_FT \\$1
5096 .    if '\\$0'HDRFTR_LEFT_FONT' \
5097 .       ds $HDRFTR_LEFT_FT \\$1
5098 .    if '\\$0'HDRFTR_RIGHT_FONT' \
5099 .       ds $HDRFTR_RIGHT_FT \\$1
5100 .    if '\\$0'LINENUMBER_FONT' \
5101 .       ds $LN_FT \\$1
5102 .    if '\\$0'PAGENUM_FONT' \
5103 .       ds $PAGE_NUM_FT \\$1
5104 .    if '\\$0'QUOTE_FONT' \
5105 .       ds $QUOTE_FT \\$1
5106 .    if '\\$0'SUBTITLE_FONT' \
5107 .       ds $SUBTITLE_FT \\$1
5108 .    if '\\$0'TITLE_FONT' \
5109 .       ds $TITLE_FT \\$1
5110 .    if '\\$0'TOC_HEADER_FONT' \
5111 .       ds $TOC_HEADER_FT \\$1
5112 .    if '\\$0'TOC_PN_FONT' \
5113 .       ds $TOC_PN_FT \\$1
5114 .END
5115 \#
5116 .MAC _SIZE END
5117 .    if '\\$0'AUTHOR_SIZE' \
5118 .       ds $AUTHOR_SIZE_CHANGE \\$1
5119 .    if '\\$0'BIBLIOGRAPHY_STRING_SIZE' \
5120 .       ds $BIB_STRING_SIZE_CHANGE \\$1
5121 .    if '\\$0'BLOCKQUOTE_SIZE' \
5122 .       ds $BQUOTE_SIZE_CHANGE \\$1
5123 .    if '\\$0'CITATION_SIZE' \
5124 .       ds $BQUOTE_SIZE_CHANGE \\$1
5125 .    if '\\$0'CITE_SIZE' \
5126 .       ds $BQUOTE_SIZE_CHANGE \\$1
5127 .    if '\\$0'CHAPTER_TITLE_SIZE' \
5128 .       ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
5129 .    if '\\$0'COVER_AUTHOR_SIZE' \
5130 .       ds $COVER_AUTHOR_SIZE_CHANGE \\$1
5131 .    if '\\$0'COVER_CHAPTER_TITLE_SIZE' \
5132 .       ds $COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
5133 .    if '\\$0'COVER_COPYRIGHT_SIZE' \
5134 .       ds $COVER_COPYRIGHT_SIZE_CHANGE \\$1
5135 .    if '\\$0'COVER_DOCTYPE_SIZE' \
5136 .       ds $COVER_DOCTYPE_SIZE_CHANGE \\$1
5137 .    if '\\$0'COVER_MISC_SIZE' \
5138 .       ds $COVER_MISC_SIZE_CHANGE \\$1
5139 .    if '\\$0'COVER_SUBTITLE_SIZE' \
5140 .       ds $COVER_SUBTITLE_SIZE_CHANGE \\$1
5141 .    if '\\$0'COVER_TITLE_SIZE' \
5142 .       ds $COVER_TITLE_SIZE_CHANGE \\$1
5143 .    if '\\$0'DOC_COVER_AUTHOR_SIZE' \
5144 .       ds $DOC_COVER_AUTHOR_SIZE_CHANGE \\$1
5145 .    if '\\$0'DOC_COVER_CHAPTER_TITLE_SIZE' \
5146 .       ds $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
5147 .    if '\\$0'DOC_COVER_COPYRIGHT_SIZE' \
5148 .       ds $DOC_COVER_COPYRIGHT_SIZE_CHANGE \\$1
5149 .    if '\\$0'DOC_COVER_DOCTYPE_SIZE' \
5150 .       ds $DOC_COVER_DOCTYPE_SIZE_CHANGE \\$1
5151 .    if '\\$0'DOC_COVER_MISC_SIZE' \
5152 .       ds $DOC_COVER_MISC_SIZE_CHANGE \\$1
5153 .    if '\\$0'DOC_COVER_SUBTITLE_SIZE' \
5154 .       ds $DOC_COVER_SUBTITLE_SIZE_CHANGE \\$1
5155 .    if '\\$0'DOC_COVER_TITLE_SIZE' \
5156 .       ds $DOC_COVER_TITLE_SIZE_CHANGE \\$1
5157 .    if '\\$0'DOCTYPE_SIZE' \
5158 .       ds $DOCTYPE_SIZE_CHANGE \\$1
5159 .    if '\\$0'ENDNOTE_NUMBER_SIZE' \
5160 .       ds $EN_NUMBER_SIZE_CHANGE \\$1
5161 .    if '\\$0'ENDNOTE_LINENUMBER_SIZE' \
5162 .       ds $EN_LN_SIZE_CHANGE \\$1
5163 .    if '\\$0'ENDNOTE_STRING_SIZE' \
5164 .       ds $EN_STRING_SIZE_CHANGE \\$1
5165 .    if '\\$0'ENDNOTE_TITLE_SIZE' \
5166 .       ds $EN_TITLE_SIZE_CHANGE \\$1
5167 .    if '\\$0'EPIGRAPH_SIZE' \
5168 .       ds $EPI_SIZE_CHANGE \\$1
5169 .    if '\\$0'FOOTNOTE_SIZE' \
5170 .       ds $FN_SIZE_CHANGE \\$1
5171 .    if '\\$0'HDRFTR_CENTER_SIZE' \
5172 .       ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
5173 .    if '\\$0'HDRFTR_LEFT_SIZE' \
5174 .       ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5175 .    if '\\$0'HDRFTR_RIGHT_SIZE' \
5176 .       ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
5177 .    if '\\$0'HDRFTR_SIZE' \
5178 .       ds $HDRFTR_SIZE_CHANGE \\$1
5179 .    if '\\$0'LINENUMBER_SIZE' \
5180 .       ds $LN_SIZE_CHANGE \\$1
5181 .    if '\\$0'PAGENUM_SIZE' \
5182 .       ds $PAGE_NUM_SIZE_CHANGE \\$1
5183 .    if '\\$0'QUOTE_SIZE' \
5184 .       ds $QUOTE_SIZE_CHANGE \\$1
5185 .    if '\\$0'SUBTITLE_SIZE' \
5186 .       ds $SUBTITLE_SIZE_CHANGE \\$1
5187 .    if '\\$0'TITLE_SIZE' \
5188 .       ds $TITLE_SIZE_CHANGE \\$1
5189 .    if '\\$0'TOC_HEADER_SIZE' \
5190 .       ds $TOC_HEADER_SIZE_CHANGE \\$1
5191 .    if '\\$0'TOC_PN_SIZE' \
5192 .       ds $TOC_PN_SIZE_CHANGE \\$1
5193 .END
5194 \#
5195 .MAC _COLOR END
5196 .    if \\n[#PRINT_STYLE]=1 .return
5197 .    if '\\$0'ATTRIBUTE_COLOR' \{\
5198 .       nr #ATTRIBUTE_COLOR 1
5199 .       ds $ATTRIBUTE_COLOR \\$1
5200 .    \}
5201 .    if '\\$0'AUTHOR_COLOR' \{\
5202 .       nr #AUTHOR_COLOR 1
5203 .       ds $AUTHOR_COLOR \\$1
5204 .    \}
5205 .    if '\\$0'BLOCKQUOTE_COLOR' \{\
5206 .       nr #BQUOTE_COLOR 1
5207 .       ds $BQUOTE_COLOR \\$1
5208 .    \}
5209 .    if '\\$0'CITATION_COLOR' \{\
5210 .       nr #BQUOTE_COLOR 1
5211 .       ds $BQUOTE_COLOR \\$1
5212 .    \}
5213 .    if '\\$0'CITE_COLOR' \{\
5214 .       nr #BQUOTE_COLOR 1
5215 .       ds $BQUOTE_COLOR \\$1
5216 .    \}
5217 .    if '\\$0'CHAPTER_TITLE_COLOR' \{\
5218 .       nr #CHAPTER_TITLE_COLOR 1
5219 .       ds $CHAPTER_TITLE_COLOR \\$1
5220 .    \}
5221 .    if '\\$0'CODE_COLOR' \{\
5222 .       nr #CODE_COLOR 1
5223 .       ds $CODE_COLOR \\$1
5224 .    \}
5225 .    if '\\$0'COVER_ATTRIBUTE_COLOR' \{\
5226 .       nr #COVER_ATTRIBUTE_COLOR 1
5227 .       ds $COVER_ATTRIBUTE_COLOR \\$1
5228 .    \}
5229 .    if '\\$0'COVER_AUTHOR_COLOR' \{\
5230 .       nr #COVER_AUTHOR_COLOR 1
5231 .       ds $COVER_AUTHOR_COLOR \\$1
5232 .    \}
5233 .    if '\\$0'COVER_CHAPTER_TITLE_COLOR' \{\
5234 .       nr #COVER_CHAPTER_TITLE_COLOR 1
5235 .       ds $COVER_CHAPTER_TITLE_COLOR \\$1
5236 .    \}
5237 .    if '\\$0'COVER_COLOR' \{\
5238 .       nr #COVER_COLOR 1
5239 .       ds $COVER_COLOR \\$1
5240 .    \}
5241 .    if '\\$0'COVER_COPYRIGHT_COLOR' \{\
5242 .       nr #COVER_COPYRIGHT_COLOR 1
5243 .       ds $COVER_COPYRIGHT_COLOR \\$1
5244 .    \}
5245 .    if '\\$0'COVER_MISC_COLOR' \{\
5246 .       nr #COVER_MISC_COLOR 1
5247 .       ds $COVER_MISC_COLOR \\$1
5248 .    \}
5249 .    if '\\$0'COVER_TITLE_COLOR' \{\
5250 .       nr #COVER_TITLE_COLOR 1
5251 .       ds $COVER_TITLE_COLOR \\$1
5252 .    \}
5253 .    if '\\$0'COVER_SUBTITLE_COLOR' \{\
5254 .       nr #COVER_SUBTITLE_COLOR 1
5255 .       ds $COVER_SUBTITLE_COLOR \\$1
5256 .    \}
5257 .    if '\\$0'COVER_DOCTYPE_COLOR' \{\
5258 .       nr #COVER_DOCTYPE_COLOR 1
5259 .       ds $COVER_DOCTYPE_COLOR \\$1
5260 .    \}
5261 .    if '\\$0'DOC_COVER_ATTRIBUTE_COLOR' \{\
5262 .       nr #DOC_COVER_ATTRIBUTE_COLOR 1
5263 .       ds $DOC_COVER_ATTRIBUTE_COLOR \\$1
5264 .    \}
5265 .    if '\\$0'DOC_COVER_AUTHOR_COLOR' \{\
5266 .       nr #DOC_COVER_AUTHOR_COLOR 1
5267 .       ds $DOC_COVER_AUTHOR_COLOR \\$1
5268 .    \}
5269 .    if '\\$0'DOC_COVER_CHAPTER_TITLE_COLOR' \{\
5270 .       nr #DOC_COVER_CHAPTER_TITLE_COLOR 1
5271 .       ds $DOC_COVER_CHAPTER_TITLE_COLOR \\$1
5272 .    \}
5273 .    if '\\$0'DOC_COVER_COLOR' \{\
5274 .       nr #DOC_COVER_COLOR 1
5275 .       ds $DOC_COVER_COLOR \\$1
5276 .    \}
5277 .    if '\\$0'DOC_COVER_COPYRIGHT_COLOR' \{\
5278 .       nr #DOC_COVER_COPYRIGHT_COLOR 1
5279 .       ds $DOC_COVER_COPYRIGHT_COLOR \\$1
5280 .    \}
5281 .    if '\\$0'DOC_COVER_MISC_COLOR' \{\
5282 .       nr #DOC_COVER_MISC_COLOR 1
5283 .       ds $DOC_COVER_MISC_COLOR \\$1
5284 .    \}
5285 .    if '\\$0'DOC_COVER_TITLE_COLOR' \{\
5286 .       nr #DOC_COVER_TITLE_COLOR 1
5287 .       ds $DOC_COVER_TITLE_COLOR \\$1
5288 .    \}
5289 .    if '\\$0'DOC_COVER_SUBTITLE_COLOR' \{\
5290 .       nr #DOC_COVER_SUBTITLE_COLOR 1
5291 .       ds $DOC_COVER_SUBTITLE_COLOR \\$1
5292 .    \}
5293 .    if '\\$0'DOC_COVER_DOCTYPE_COLOR' \{\
5294 .       nr #DOC_COVER_DOCTYPE_COLOR 1
5295 .       ds $DOC_COVER_DOCTYPE_COLOR \\$1
5296 .    \}
5297 .    if '\\$0'DOCHEADER_COLOR' \{\
5298 .       nr #DOCHEADER_COLOR 1
5299 .       ds $DOCHEADER_COLOR \\$1
5300 .    \}
5301 .    if '\\$0'DOCTYPE_COLOR' \{\
5302 .       nr #DOCTYPE_COLOR 1
5303 .       ds $DOCTYPE_COLOR \\$1
5304 .    \}
5305 .    if '\\$0'ENDNOTE_STRING_COLOR' \{\
5306 .       nr #ENDNOTE_STRING_COLOR 1
5307 .       ds $ENDNOTE_STRING_COLOR \\$1
5308 .    \}
5309 .    if '\\$0'EPIGRAPH_COLOR' \{\
5310 .       nr #EPI_COLOR 1
5311 .       ds $EPI_COLOR \\$1
5312 .    \}
5313 .    if '\\$0'FINIS_COLOR' \{\
5314 .       nr #FINIS_COLOR 1
5315 .       ds $FINIS_COLOR \\$1
5316 .    \}
5317 .    if '\\$0'FOOTNOTE_COLOR' \{\
5318 .       nr #FOOTNOTE_COLOR 1
5319 .       ds $FOOTNOTE_COLOR \\$1
5320 .    \}
5321 .    if '\\$0'HDRFTR_CENTER_COLOR' \{\
5322 .       nr #HDRFTR_CENTER_COLOR 1
5323 .       ds $HDRFTR_CENTER_COLOR \\$1
5324 .    \}
5325 .    if '\\$0'HDRFTR_COLOR' \{\
5326 .       nr #HDRFTR_COLOR 1
5327 .       ds $HDRFTR_COLOR \\$1
5328 .    \}
5329 .    if '\\$0'HDRFTR_LEFT_COLOR' \{\
5330 .       nr #HDRFTR_LEFT_COLOR 1
5331 .       ds $HDRFTR_LEFT_COLOR \\$1
5332 .    \}
5333 .    if '\\$0'HDRFTR_RIGHT_COLOR' \{\
5334 .       nr #HDRFTR_RIGHT_COLOR 1
5335 .       ds $HDRFTR_RIGHT_COLOR \\$1
5336 .    \}
5337 .    if '\\$0'HDRFTR_RULE_COLOR' \{\
5338 .       nr #HDRFTR_RULE_COLOR 1
5339 .       ds $HDRFTR_RULE_COLOR \\$1
5340 .    \}
5341 .    if '\\$0'LINEBREAK_COLOR' \{\
5342 .       nr #LINEBREAK_COLOR 1
5343 .       ds $LINEBREAK_COLOR \\$1
5344 .    \}
5345 .    if '\\$0'LINENUMBER_COLOR' \{\
5346 .       nr #LINENUMBER_COLOR 1
5347 .       ds $LN_COLOR \\$1
5348 .    \}
5349 .    if '\\$0'PAGENUM_COLOR' \{\
5350 .       nr #PAGE_NUM_COLOR 1
5351 .       ds $PAGENUM_COLOR \\$1
5352 .    \}
5353 .    if '\\$0'QUOTE_COLOR' \{\
5354 .       nr #QUOTE_COLOR 1
5355 .       ds $QUOTE_COLOR \\$1
5356 .    \}
5357 .    if '\\$0'SECTION_COLOR' \{\
5358 .       nr #LINEBREAK_COLOR 1
5359 .       ds $LINEBREAK_COLOR \\$1
5360 .    \}
5361 .    if '\\$0'SUBTITLE_COLOR' \{\
5362 .       nr #SUBTITLE_COLOR 1
5363 .       ds $SUBTITLE_COLOR \\$1
5364 .    \}
5365 .    if '\\$0'TITLE_COLOR' \{\
5366 .       nr #TITLE_COLOR 1
5367 .       ds $TITLE_COLOR \\$1
5368 .    \}
5369 .END
5370 \#
5371 .MAC _QUAD END
5372 .    if '\\$0'BIBLIOGRAPHY_QUAD' \{\
5373 .       ds $BIB_QUAD \\$1
5374 .       if '\\*[$BIB_QUAD]'R' \
5375 .ab \\$0 at line \\n[.c] must be set to either L or J.  Aborting \\n'[.F]'.
5376 .       if '\\*[$BIB_QUAD]'C' \
5377 .ab \\$0 at line \\n[.c] must be set to either L or J.  Aborting \\n'[.F]'.
5378 .    \}
5379 .    if '\\$0'BIBLIOGRAPHY_STRING_QUAD' \
5380 .       ds $BIB_STRING_QUAD \\$1
5381 .    if '\\$0'BLOCKQUOTE_QUAD' \
5382 .       ds $BQUOTE_QUAD \\$1
5383 .    if '\\$0'CITATION_QUAD' \
5384 .       ds $BQUOTE_QUAD \\$1
5385 .    if '\\$0'CITE_QUAD' \
5386 .       ds $BQUOTE_QUAD \\$1
5387 .    if '\\$0'COVER_COPYRIGHT_QUAD' \
5388 .       ds $COVER_COPYRIGHT_QUAD \\$1
5389 .    if '\\$0'COVER_MISC_QUAD' \
5390 .       ds $COVER_MISC_QUAD \\$1
5391 .    if '\\$0'COVER_QUAD' \
5392 .       ds $COVER_QUAD \\$1
5393 .    if '\\$0'DOC_COVER_COPYRIGHT_QUAD' \
5394 .       ds $DOC_COVER_COPYRIGHT_QUAD \\$1
5395 .    if '\\$0'DOC_COVER_MISC_QUAD' \
5396 .       ds $DOC_COVER_MISC_QUAD \\$1
5397 .    if '\\$0'DOC_COVER_QUAD' \
5398 .       ds $DOC_COVER_QUAD \\$1
5399 .    if '\\$0'DOCHEADER_QUAD' \
5400 .       ds $DOCHEADER_QUAD \\$1
5401 .    if '\\$0'DOC_QUAD' \{\
5402 .       if !\\n[DOCS] .DOC_MACRO_ERROR \\$0
5403 .        ds $DOC_QUAD \\$1
5404 .        QUAD \\*[$DOC_QUAD]
5405 .    \}
5406 .    if '\\$0'ENDNOTE_QUAD' \{\
5407 .       ds $EN_QUAD \\$1
5408 .       if '\\*[$EN_QUAD]'R' \
5409 .ab \\$0 at line \\n[.c] must be set to either L or J.  Aborting \\n'[.F]'.
5410 .       if '\\*[$EN_QUAD]'C' \
5411 .ab \\$0 at line \\n[.c] must be set to either L or J.  Aborting \\n'[.F]'.
5412 .    \}
5413 .    if '\\$0'ENDNOTE_STRING_QUAD' \
5414 .       ds $EN_STRING_QUAD \\$1
5415 .    if '\\$0'ENDNOTE_TITLE_QUAD' \
5416 .       ds $EN_TITLE_QUAD \\$1
5417 .    if '\\$0'EPIGRAPH_QUAD' \
5418 .       ds $EPI_QUAD \\$1
5419 .    if '\\$0'FOOTNOTE_QUAD' \
5420 .       ds $FN_QUAD \\$1
5421 .    if '\\$0'TOC_HEADER_QUAD' \
5422 .       ds $TOC_HEADER_QUAD \\$1
5423 .END
5424 \#
5425 \# DEFAULTS
5426 \# --------
5427 \# *Arguments:
5428 \#   <none>
5429 \# *Function:
5430 \#   Sets up defaults if no values are entered prior to START.
5431 \# *Notes:
5432 \#   The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
5433 \#   $REVISION_STRING are in the COPYSTYLE macro.
5434 \#
5435 .MAC DEFAULTS END
5436 .    if !d $PAPER .PAPER LETTER
5437 .    if !\\n[#DOC_TYPE] .DOCTYPE DEFAULT
5438 .    ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
5439 .    el \
5440 .       if !\\n[#COPY_STYLE]=1 .PAGENUM_STYLE DIGIT
5441 .    if !\\n[#COPY_STYLE] .COPYSTYLE FINAL
5442 .    if \\n[#DRAFT_WITH_PAGENUM] .COPYSTYLE \\*[$COPY_STYLE]
5443 .    if \\n[#DOC_TYPE]=4 \{\
5444 .       if !\\n[#USER_SET_L_LENGTH] \{\
5445 .          R_MARGIN \\n[#R_MARGIN]u
5446 .          rr #USER_SET_L_LENGTH
5447 .       \}
5448 .       if \\n[#PRINT_STYLE]=1 .PRINTSTYLE TYPEWRITE SINGLESPACE
5449 .    \}
5450 .    if \\n[#COPY_STYLE]=1 \{\
5451 .       COPYSTYLE DRAFT
5452 .       PAGENUMBER 1
5453 .    \}
5454 .    if !r #DOC_HEADER .DOCHEADER
5455 .    if !r #HEADERS_ON .HEADERS
5456 .    if !r #PAGINATE   .PAGINATE
5457 .\"
5458 .    if !r #HEADER_MARGIN .HEADER_MARGIN 4P+6p
5459 .    if !r #HEADER_GAP    .HEADER_GAP 3P
5460 .\"
5461 .    if \\n[#FOOTERS_ON] \{\
5462 .       HEADERS OFF
5463 .       ie \\n[#PAGINATE] \
5464 .          if \\n[#PAGE_NUM_POS_SET]=0 .PAGENUM_POS TOP CENTER
5465 .       el \
5466 .          if !\\n[#T_MARGIN] .T_MARGIN 6P
5467 .    \}
5468 .    if !\\n[#HEADERS_ON] \{\
5469 .       if !\\n[#FOOTERS_ON] \{\
5470 .          ie \\n[#PAGE_NUM_V_POS]=1 \{\
5471 .             HEADER_MARGIN \\n[#HEADER_MARGIN]
5472 .             HEADER_GAP \\n[#HEADER_GAP]
5473 .          \}
5474 .          el .if !r #T_MARGIN .T_MARGIN 6P
5475 .       \}
5476 .    \}
5477 .    if !r #T_MARGIN          .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP]
5478 .    if !r #DOCHEADER_ADVANCE .nr #DOCHEADER_ADVANCE \\n[#T_MARGIN]
5479 .    if !r #FOOTER_MARGIN     .FOOTER_MARGIN 3P
5480 .    if !r #FOOTER_GAP        .FOOTER_GAP 3P
5481 .    if !r #B_MARGIN          .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u
5482 .    if (\\n[#FOOTER_MARGIN]+\\n[.v]>=\\n[#B_MARGIN]) \{\
5483 .       tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
5484 .       tm1 "       No footers or bottom-of-page page numbers will be printed.
5485 .       tm1 "       Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
5486 .       tm1 "       If no footers or bottom-of-page page numbers are required,
5487 .       tm1 "       invoke .FOOTER_MARGIN 0 before .START
5488 .    \}
5489 .    if !r #HEADER_RULE_GAP .HEADER_RULE_GAP 4p
5490 .    if !r #FOOTER_RULE_GAP .FOOTER_RULE_GAP 4p
5491 .    if !r #HDRFTR_RULE     .HDRFTR_RULE
5492 .    if !r #PAGE_NUM_SET    .PAGENUMBER 1
5493 .\" Read in number registers and strings for type parameters
5494 .    nr #DOC_L_MARGIN \\n[#L_MARGIN]
5495 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
5496 .    nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
5497 .    if '\\*[$SAVED_DOC_FAM]'' \{\
5498 .       ds $DOC_FAM \\*[$FAMILY]
5499 .       rm $SAVED_DOC_FAM
5500 .    \}
5501 .    nr #DOC_PT_SIZE  \\n[#PT_SIZE]
5502 .\"
5503 .    if \\n[#TOC]          .nr #DOC_PT_SIZE \\n[#TOC_PS]
5504 .    if \\n[#ENDNOTES]     .nr #DOC_PT_SIZE \\n[#EN_PS]
5505 .    if \\n[#BIBLIOGRAPHY] .nr #DOC_PT_SIZE \\n[#BIB_PS]
5506 .\"
5507 .    nr #DOC_LEAD     \\n[.v]
5508 .    nr #DOC@LEAD     \\n[#DOC_LEAD]
5509 .    if \\n[#AUTO_LEAD] .nr #DOC_AUTOLEAD \\n[#AUTOLEAD_VALUE]
5510 .\" #SAVED_DOC_LEAD is set in COLLATE
5511 .    if \\n[#SAVED_DOC_LEAD] \{\
5512 .       if \
5513 (\\n[#TOC]=0):\
5514 (\\n[#LIST_OF_FIGURES]=0):\
5515 (\\n[#LIST_OF_TABLES]=0):\
5516 (\\n[#LIST_OF_EQUATIONS]=0) \
5517 .          if !\\n[#DOC_LEAD]=\\n[#SAVED_DOC_LEAD] .nr #RERUN_TRAPS 1
5518 .    \}
5519 .    ie \\n[#ADJ_DOC_LEAD]=1 .
5520 .    el \
5521 .       if !\\n[#DOC_LEAD_ADJUST_OFF] .DOC_LEAD_ADJUST
5522 .    ds $DOC_QUAD \\*[$QUAD_VALUE]
5523 .    if '\\*[$FONT]''   .FT R
5524 .    if '\\*[$PP_FT]''  .ds $PP_FT \\*[$FONT]
5525 .    if !'\\*[$PP_FT]'' .ds $PP_FT \\*[$FONT]
5526 .\" Counters
5527 .    nr #PP                0
5528 .    nr #FN_NUMBER         0 1
5529 .    nr #EN_NUMBER         0 1
5530 .    nr #FN_COUNT_FOR_COLS 0 1
5531 .    nr #DONE_ONCE         0 1
5532 .\" Enable shimming if user hasn't turned it off
5533 .    if \\n[#NO_SHIM]=2    .rr #NO_SHIM
5534 .\" General style defaults for both PRINTSTYLEs
5535 .    nr #PP_STYLE 1
5536 .    PARA_INDENT \\n[#PP_INDENT]u
5537 .    if !d $HDRFTR_FAM               .HDRFTR_FAMILY \\*[$DOC_FAM]
5538 .    if !d $HDRFTR_SIZE_CHANGE       .HDRFTR_SIZE +0
5539 .    if !d $PAGE_NUM_FAM             .PAGENUM_FAMILY \\*[$DOC_FAM]
5540 .    if !d $PAGE_NUM_FT              .PAGENUM_FONT R
5541 .    if !d $PAGE_NUM_SIZE_CHANGE     .PAGENUM_SIZE +0
5542 .    if !r #PAGE_NUM_POS_SET         .PAGENUM_POS BOTTOM CENTER
5543 .    ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
5544 .       if \\n[#PAGE_NUM_HYPHENS]=0  .PAGENUM_HYPHENS OFF
5545 .       if \\n[#PAGE_NUM_HYPHENS]=1  .PAGENUM_HYPHENS
5546 .    \}
5547 .    el .PAGENUM_HYPHENS
5548 .    if !r #HDRFTR_RIGHT_CAPS .HDRFTR_RIGHT_CAPS
5549 .    if \\n[#HDRFTR_RIGHT_CAPS]=0 \
5550 .       if !d $HDRFTR_RIGHT_SIZE_CHANGE .HDRFTR_RIGHT_SIZE +0
5551 .    if !d $FN_FAM        .FOOTNOTE_FAMILY \\*[$DOC_FAM]
5552 .    if !d $FN_FT         .FOOTNOTE_FONT R
5553 .    if !d $FN_QUAD       .FOOTNOTE_QUAD \\*[$DOC_QUAD]
5554 .    if !r #FN_RULE       .FOOTNOTE_RULE
5555 .    if !r #FN_MARKERS    .FOOTNOTE_MARKERS
5556 .    if \\n[#FN_MARKERS]=1 \{\
5557 .       if \\n[#FN_REF]=1 \
5558 .          if !\\n[#FN_MARKER_STYLE] .FOOTNOTE_MARKER_STYLE NUMBER
5559 .       if !\\n[#FN_MARKER_STYLE] .FOOTNOTE_MARKER_STYLE STAR
5560 .    \}
5561 .    if !r #EN_MARKER_STYLE     .ENDNOTE_MARKER_STYLE SUPERSCRIPT
5562 .    if !d $EN_PN_STYLE         .ENDNOTES_PAGENUM_STYLE digit
5563 .    if !d $EN_FAM              .ENDNOTE_FAMILY \\*[$DOC_FAM]
5564 .    if !d $EN_FT               .ENDNOTE_FONT R
5565 .    if !d $EN_QUAD             .ENDNOTE_QUAD \\*[$DOC_QUAD]
5566 .    if !d $EN_STRING           .ENDNOTE_STRING "Endnotes"
5567 .    if !d $EN_STRING_FAM       .ENDNOTE_STRING_FAMILY \\*[$EN_FAM]
5568 .    if !d $EN_STRING_QUAD      .ENDNOTE_STRING_QUAD CENTER
5569 .    if !r #EN_STRING_UNDERLINE .nr #EN_STRING_UNDERLINE 2
5570 .    if !r #EN_STRING_CAPS      .ENDNOTE_STRING_CAPS
5571 .    if !d $EN_TITLE \{\
5572 .       ie \\n[#DOC_TYPE]=2 \{\
5573 .          ie !'\\*[$CHAPTER_TITLE_1]'' \{\
5574 .             ie '\\*[$CHAPTER]'' .ENDNOTE_TITLE "\\*[$CHAPTER_TITLE]"
5575 .             el .ENDNOTE_TITLE \
5576 "\\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]"
5577 .          \}
5578 .             el \{\
5579 .                ie '\\*[$CHAPTER]'' .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]"
5580 .                el .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
5581 .             \}
5582 .          \}
5583 .       el .ENDNOTE_TITLE "\\*[$TITLE]"
5584 .    \}
5585 .    if !d $EN_TITLE_FAM          .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM]
5586 .    if !d $EN_TITLE_QUAD         .ENDNOTE_TITLE_QUAD LEFT
5587 .    if !r #EN_TITLE_UNDERLINE    .nr #EN_TITLE_UNDERLINE 1
5588 .    if !d $EN_NUMBER_FAM         .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM]
5589 .    if !d $EN_LN_FAM             .ENDNOTE_LINENUMBER_FAMILY \\*[$EN_FAM]
5590 .    if !r #EN_NUMBERS_ALIGN_LEFT \{\
5591 .       if !r #EN_NUMBERS_ALIGN_RIGHT \{\
5592 .          ie !\\n[#EN_MARKER_STYLE]=2 .ENDNOTE_NUMBERS_ALIGN RIGHT 2
5593 .          el .ENDNOTE_NUMBERS_ALIGN RIGHT 4
5594 .       \}
5595 .    \}
5596 .    if !r #EN_LN_GAP            .ENDNOTE_LINENUMBER_GAP 1m
5597 .    if !r #EN_ALLOWS_HEADERS    .ENDNOTES_ALLOWS_HEADERS
5598 .    if !d $BIB_PN_STYLE         .BIBLIOGRAPHY_PAGENUM_STYLE digit
5599 .    if !d $BIB_FAM              .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM]
5600 .    if !d $BIB_FT               .BIBLIOGRAPHY_FONT R
5601 .    if !d $BIB_QUAD             .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD]
5602 .    if !d $BIB_STRING           .BIBLIOGRAPHY_STRING "Bibliography"
5603 .    if !d $BIB_STRING_FAM       .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FAM]
5604 .    if !d $BIB_STRING_QUAD      .BIBLIOGRAPHY_STRING_QUAD CENTER
5605 .    if !r #BIB_STRING_UNDERLINE .nr #BIB_STRING_UNDERLINE 2
5606 .    if !r #BIB_STRING_CAPS      .BIBLIOGRAPHY_STRING_CAPS
5607 .    if !d $TOC_HEADER_STRING    .TOC_HEADER_STRING "Contents"
5608 .    if !d $TOC_HEADER_QUAD      .TOC_HEADER_QUAD LEFT
5609 .    if !d $TOC_PN_STYLE         .TOC_PAGENUM_STYLE roman
5610 .    if !r #TOC_PN_PADDING       .TOC_PADDING 3
5611 .\" Line numbering
5612 .    if !r #LN_GUTTER      .nr #LN_GUTTER 2
5613 .    if !r #Q_LN_GUTTER    .nr #Q_LN_GUTTER 2
5614 .    if !r #BQ_LN_GUTTER   .nr #BQ_LN_GUTTER 2
5615 .    if !d $LN_FAM         .ds $LN_FAM \\*[$DOC_FAM]
5616 .    if !d $LN_FT          .ds $LN_FT R
5617 .    if !d $LN_SIZE_CHANGE .ds $LN_SIZE_CHANGE +0
5618 .    if !d $LN_COLOR       .ds $LN_COLOR black
5619 .\" PDF link colour
5620 .    if !\\n[PDFHREF_COLOR_SET] .PDF_LINK_COLOR 0.0 0.3 0.9
5621 .\" PDF frame
5622 .    if !d pdf-img:frame-weight .ds pdf-img:frame-weight .5
5623 .    if !d pdf-img:frame-color  .ds pdf-img:frame-color  black
5624 .\" Captions, labels, sources
5625 .\" All at default doc specs except leading, which is autolead 2
5626 .   nr label-type-counter 0 1
5627 .   while \\n+[label-type-counter]<=4 \{\
5628 .      if \\n[label-type-counter]=1 .ds label-type eqn
5629 .      if \\n[label-type-counter]=2 .ds label-type pdf-img
5630 .      if \\n[label-type-counter]=3 .ds label-type pic
5631 .      if \\n[label-type-counter]=4 .ds label-type tbl
5632 .      nr spec-type-counter 0 1
5633 .      while \\n+[spec-type-counter]<=3 \{\
5634 .         if \\n[spec-type-counter]=1 .ds spec-type label
5635 .         if \\n[spec-type-counter]=2 .ds spec-type caption
5636 .         if \\n[spec-type-counter]=3 .ds spec-type source
5637 .         set-defaults
5638 .         set-inline-specs
5639 .      \}
5640 .   \}
5641 .\" String defaults for both PRINTSTYLEs
5642 .    ie \\n[#DOC_TYPE]=1 \{\
5643 .       ie '\\*[$DOC_TITLE]'' \{\
5644 .          if \\n[#USER_DEF_HDRFTR_LEFT]=0  .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5645 .          if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
5646 .       \}
5647 .       el \{\
5648 .          if \\n[#COPY_STYLE]=1             .DRAFT_WITH_PAGENUMBER
5649 .          if \\n[#USER_DEF_HDRFTR_LEFT]=0   .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5650 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 .ds $HDRFTR_CENTER \\*[$TITLE]
5651 .          if \\n[#USER_DEF_HDRFTR_RIGHT]=0  .ds $HDRFTR_RIGHT \\*[$DOC_TITLE]
5652 .       \}
5653 .    \}
5654 .    el \{\
5655 .       if \\n[#USER_DEF_HDRFTR_LEFT]=0  .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5656 .       if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
5657 .    \}
5658 .    if !d $ATTRIBUTE_STRING     .ds $ATTRIBUTE_STRING by
5659 .    if !d $FINIS_STRING         .FINIS_STRING "End"
5660 .    if !r #FINIS_STRING_CAPS    .nr #FINIS_STRING_CAPS 1
5661 .\" Covers
5662 .    if !r #DOC_COVERS_OFF           .nr #DOC_COVERS 1
5663 .    if !r #COVERS_OFF               .nr #COVERS 1
5664 .    if !d $COVER_COPYRIGHT_QUAD     .COVER_COPYRIGHT_QUAD R
5665 .    if !d $COVER_MISC_QUAD          .COVER_MISC_QUAD L
5666 .    if !d $DOC_COVER_COPYRIGHT_QUAD .DOC_COVER_COPYRIGHT_QUAD R
5667 .    if !d $DOC_COVER_MISC_QUAD      .DOC_COVER_MISC_QUAD L
5668 .    if !r #DOC_COVER_UNDERLINE      .DOC_COVER_UNDERLINE
5669 .    if !r #COVER_UNDERLINE          .COVER_UNDERLINE
5670 .\" Defaults for printstyle TYPEWRITE
5671 .    if \\n[#PRINT_STYLE]=1 \{\
5672 .       TYPEWRITER
5673 .       SS DEFAULT
5674 .       if \\n[#UNDERLINE_QUOTES]=1 .UNDERLINE_QUOTES
5675 .       if \\n[#UNDERLINE_QUOTES]=0 .UNDERLINE_QUOTES OFF
5676 .\" +Doctype underlining (if NAMED)
5677 .       if !r #DOCTYPE_UNDERLINE .nr #DOCTYPE_UNDERLINE 1
5678 .\" +Quotes and blockquotes
5679 .       if !r #Q_OFFSET_VALUE \{\
5680 .          if '\\*[$Q_OFFSET_VALUE]'' .QUOTE_INDENT 1
5681 .       \}
5682 .\" +Epigraphs
5683 .       if !r #EPI_OFFSET_VALUE \
5684 .          if '\\*[$EPI_OFFSET_VALUE]'' .EPIGRAPH_INDENT 2
5685 .\" +Linebreaks
5686 .       if !d $LINEBREAK_CHAR .LINEBREAK_CHAR * 3 2p
5687 .\" +Footnotes
5688 .       if !d $FN_SIZE_CHANGE    .FOOTNOTE_SIZE +0
5689 .       if !r #FN_RULE_LENGTH    .FOOTNOTE_RULE_LENGTH 2i
5690 .\" +Endnotes
5691 .       if !r #EN_PP_INDENT .ENDNOTE_PARA_INDENT \\n[#PP_INDENT]
5692 .\" +Footnotes
5693 .       if !r #FN_RULE_ADJ  .FOOTNOTE_RULE_ADJ 6p
5694 .\" +Slant stuff
5695 .       if !r #SLANT_MEANS_SLANT \{\
5696 .          ie \\n[#UNDERLINE_SLANT]=1 .UNDERLINE_SLANT
5697 .          el .UNDERLINE_SLANT OFF
5698 .       \}
5699 .    \}
5700 .\" Defaults for printstyle TYPESET
5701 .    if \\n[#PRINT_STYLE]=2 \{\
5702 .       if !d $DOCHEADER_LEAD_ADJ .DOCHEADER_LEAD +0
5703 .\" +Cover
5704 .       if !d $COVER_LEAD_ADJ .COVER_LEAD +0
5705 .       if !d $COVER_FAM      .COVER_FAMILY \\*[$DOC_FAM]
5706 .\" (title)
5707 .       if !d $COVER_TITLE_FAM \{\
5708 .          ie !d $COVER_FAM .COVER_TITLE_FAMILY \\*[$DOC_FAM]
5709 .          el .COVER_TITLE_FAMILY \\*[$COVER_FAM]
5710 .       \}
5711 .       if !d $COVER_TITLE_FT .COVER_TITLE_FONT B
5712 .       if !d $COVER_TITLE_SIZE_CHANGE .COVER_TITLE_SIZE +3.5
5713 .\" (chapter title)
5714 .       if !d $COVER_CHAPTER_TITLE_FAM \{\
5715 .          ie !d $COVER_FAM .COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM]
5716 .          el .COVER_CHAPTER_TITLE_FAMILY \\*[$COVER_FAM]
5717 .       \}
5718 .       if !d $COVER_CHAPTER_TITLE_FT .COVER_CHAPTER_TITLE_FONT BI
5719 .       if !d $COVER_CHAPTER_TITLE_SIZE_CHANGE .COVER_CHAPTER_TITLE_SIZE +4
5720 .\" (subtitle)
5721 .       if !d $COVER_SUBTITLE_FAM \{\
5722 .          ie !d $COVER_FAM .COVER_SUBTITLE_FAMILY \\*[$DOC_FAM]
5723 .          el .COVER_SUBTITLE_FAMILY \\*[$COVER_FAM]
5724 .       \}
5725 .       if !d $COVER_SUBTITLE_FT .COVER_SUBTITLE_FONT R
5726 .       if !d $COVER_SUBTITLE_SIZE_CHANGE .COVER_SUBTITLE_SIZE +0
5727 .\" (attribution and author[s])
5728 .       if !d $COVER_AUTHOR_FAM \{\
5729 .          ie !d $COVER_FAM .COVER_AUTHOR_FAMILY \\*[$DOC_FAM]
5730 .          el .COVER_AUTHOR_FAMILY \\*[$COVER_FAM]
5731 .       \}
5732 .       if !d $COVER_AUTHOR_FT .COVER_AUTHOR_FONT I
5733 .       if !d $COVER_AUTHOR_SIZE_CHANGE .COVER_AUTHOR_SIZE +0
5734 .\" (doctype if "named")
5735 .       if !d $COVER_DOCTYPE_FAM \{\
5736 .          ie !d $COVER_FAM .COVER_DOCTYPE_FAMILY \\*[$DOC_FAM]
5737 .          el .COVER_DOCTYPE_FAMILY \\*[$COVER_FAM]
5738 .       \}
5739 .       if !d $COVER_DOCTYPE_FT .COVER_DOCTYPE_FONT BI
5740 .       if !d $COVER_DOCTYPE_SIZE_CHANGE .COVER_DOCTYPE_SIZE +3
5741 .\" (copyright)
5742 .       if !d $COVER_COPYRIGHT_FAM \{\
5743 .          ie !d $COVER_FAM .COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM]
5744 .          el .COVER_COPYRIGHT_FAMILY \\*[$COVER_FAM]
5745 .       \}
5746 .       if !d $COVER_COPYRIGHT_FT .COVER_COPYRIGHT_FONT R
5747 .       if !d $COVER_COPYRIGHT_SIZE_CHANGE .COVER_COPYRIGHT_SIZE -2
5748 .\" (misc)
5749 .       if !d $COVER_MISC_FAM         .COVER_MISC_FAMILY \\*[$DOC_FAM]
5750 .       if !d $COVER_MISC_FT          .COVER_MISC_FONT R
5751 .       if !d $COVER_MISC_SIZE_CHANGE .COVER_MISC_SIZE -2
5752 .       if !r #COVER_MISC_AUTOLEAD    .COVER_MISC_AUTOLEAD 2
5753 .\" +Doc cover
5754 .       if !d $DOC_COVER_LEAD_ADJ .DOC_COVER_LEAD +0
5755 .       if !d $DOC_COVER_FAM      .DOC_COVER_FAMILY \\*[$DOC_FAM]
5756 .\" (title)
5757 .       if !d $DOC_COVER_TITLE_FAM \{\
5758 .          ie !d $DOC_COVER_FAM .DOC_COVER_TITLE_FAMILY \\*[$DOC_FAM]
5759 .          el .DOC_COVER_TITLE_FAMILY \\*[$DOC_COVER_FAM]
5760 .       \}
5761 .       if !d $DOC_COVER_TITLE_FT          .DOC_COVER_TITLE_FONT B
5762 .       if !d $DOC_COVER_TITLE_SIZE_CHANGE .DOC_COVER_TITLE_SIZE +3.5
5763 .\" (chapter title)
5764 .       if !d $DOC_COVER_CHAPTER_TITLE_FAM \{\
5765 .          ie !d $DOC_COVER_FAM .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM]
5766 .          el .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_COVER_FAM]
5767 .       \}
5768 .       if !d $DOC_COVER_CHAPTER_TITLE_FT .DOC_COVER_CHAPTER_TITLE_FONT BI
5769 .       if !d $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE .DOC_COVER_CHAPTER_TITLE_SIZE +4
5770 .\" (subtitle)
5771 .       if !d $DOC_COVER_SUBTITLE_FAM \{\
5772 .          ie !d $DOC_COVER_FAM .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_FAM]
5773 .          el .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_COVER_FAM]
5774 .       \}
5775 .       if !d $DOC_COVER_SUBTITLE_FT .DOC_COVER_SUBTITLE_FONT R
5776 .       if !d $DOC_COVER_SUBTITLE_SIZE_CHANGE .DOC_COVER_SUBTITLE_SIZE +0
5777 .\" (attribution and author[s])
5778 .       if !d $DOC_COVER_AUTHOR_FAM \{\
5779 .          ie !d $DOC_COVER_FAM .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_FAM]
5780 .          el .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_COVER_FAM]
5781 .       \}
5782 .       if !d $DOC_COVER_AUTHOR_FT .DOC_COVER_AUTHOR_FONT I
5783 .       if !d $DOC_COVER_AUTHOR_SIZE_CHANGE .DOC_COVER_AUTHOR_SIZE +0
5784 .\" (doctype if "named")
5785 .       if !d $DOC_COVER_DOCTYPE_FAM \{\
5786 .          ie !d $DOC_COVER_FAM .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_FAM]
5787 .          el .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_COVER_FAM]
5788 .       \}
5789 .       if !d $DOC_COVER_DOCTYPE_FT .DOC_COVER_DOCTYPE_FONT BI
5790 .       if !d $DOC_COVER_DOCTYPE_SIZE_CHANGE .DOC_COVER_DOCTYPE_SIZE +3
5791 .\" (copyright)
5792 .       if !d $DOC_COVER_COPYRIGHT_FAM \{\
5793 .          ie !d $DOC_COVER_FAM .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM]
5794 .          el .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_COVER_FAM]
5795 .       \}
5796 .       if !d $DOC_COVER_COPYRIGHT_FT .DOC_COVER_COPYRIGHT_FONT R
5797 .       if !d $DOC_COVER_COPYRIGHT_SIZE_CHANGE .DOC_COVER_COPYRIGHT_SIZE -2
5798 .\" (misc)
5799 .       if !d $DOC_COVER_MISC_FAM         .DOC_COVER_MISC_FAMILY \\*[$DOC_FAM]
5800 .       if !d $DOC_COVER_MISC_FT          .DOC_COVER_MISC_FONT R
5801 .       if !d $DOC_COVER_MISC_SIZE_CHANGE .DOC_COVER_MISC_SIZE -2
5802 .       if !r #DOC_COVER_MISC_AUTOLEAD    .DOC_COVER_MISC_AUTOLEAD 2
5803 .\" +Docheader
5804 .       if !d $DOCHEADER_FAM .DOCHEADER_FAMILY \\*[$DOC_FAM]
5805 .       if !d $TITLE_FAM \{\
5806 .          ie !d $DOCHEADER_FAM .TITLE_FAMILY \\*[$DOC_FAM]
5807 .          el .TITLE_FAMILY \\*[$DOCHEADER_FAM]
5808 .       \}
5809 .       if !d $TITLE_FT .TITLE_FONT B
5810 .       if !d $TITLE_SIZE_CHANGE \{\
5811 .          ie \\n[#DOC_TYPE]=2 .TITLE_SIZE +4
5812 .          el .TITLE_SIZE +3.5
5813 .       \}
5814 .       if !d $CHAPTER_TITLE_FAM \{\
5815 .          ie !d $DOCHEADER_FAM .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM]
5816 .          el .CHAPTER_TITLE_FAMILY \\*[$DOCHEADER_FAM]
5817 .       \}
5818 .       if !d $CHAPTER_TITLE_FT          .CHAPTER_TITLE_FONT BI
5819 .       if !d $CHAPTER_TITLE_SIZE_CHANGE .CHAPTER_TITLE_SIZE +4
5820 .       if !d $SUBTITLE_FAM \{\
5821 .          ie !d $DOCHEADER_FAM .SUBTITLE_FAMILY \\*[$DOC_FAM]
5822 .          el .SUBTITLE_FAMILY \\*[$DOCHEADER_FAM]
5823 .       \}
5824 .       if !d $SUBTITLE_FT          .SUBTITLE_FONT R
5825 .       if !d $SUBTITLE_SIZE_CHANGE .SUBTITLE_SIZE +0
5826 .       if !d $AUTHOR_FAM \{\
5827 .          ie !d $DOCHEADER_FAM .AUTHOR_FAMILY \\*[$DOC_FAM]
5828 .          el .AUTHOR_FAMILY \\*[$DOCHEADER_FAM]
5829 .       \}
5830 .       if !d $AUTHOR_FT          .AUTHOR_FONT I
5831 .       if !d $AUTHOR_SIZE_CHANGE .AUTHOR_SIZE +0
5832 .       if !d $DOCTYPE_FAM \{\
5833 .          ie !d $DOCHEADER_FAM .DOCTYPE_FAMILY \\*[$DOC_FAM]
5834 .          el .DOCTYPE_FAMILY \\*[$DOCHEADER_FAM]
5835 .       \}
5836 .       if !d $DOCTYPE_FT           .DOCTYPE_FONT BI
5837 .       if !d $DOCTYPE_SIZE_CHANGE  .DOCTYPE_SIZE +3
5838 .       if !r #DOCTYPE_UNDERLINE    .DOCTYPE_UNDERLINE
5839 .\" +Headers and footers
5840 .       if !d $HDRFTR_LEFT_FAM              .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM]
5841 .       if !d $HDRFTR_LEFT_FT               .HDRFTR_LEFT_FONT R
5842 .       if \\n[#HDRFTR_LEFT_CAPS] \
5843 .          if !d $HDRFTR_LEFT_SIZE_CHANGE   .HDRFTR_LEFT_SIZE -2
5844 .       if !d $HDRFTR_LEFT_SIZE_CHANGE      .HDRFTR_LEFT_SIZE -.5
5845 .       if !d $HDRFTR_CENTER_FAM            .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
5846 .       if !d $HDRFTR_CENTER_FT             .HDRFTR_CENTER_FONT I
5847 .       if \\n[#HDRFTR_CENTER_CAPS] \
5848 .          if !d $HDRFTR_CENTER_SIZE_CHANGE .HDRFTR_CENTER_SIZE -2
5849 .       if !d $HDRFTR_CENTER_SIZE_CHANGE    .HDRFTR_CENTER_SIZE -.5
5850 .       if !d $HDRFTR_RIGHT_FAM             .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]
5851 .       if !d $HDRFTR_RIGHT_FT              .HDRFTR_RIGHT_FONT R
5852 .       if \\n[#HDRFTR_RIGHT_CAPS] \
5853 .          if !d $HDRFTR_RIGHT_SIZE_CHANGE  .HDRFTR_RIGHT_SIZE -2
5854 .       if !d $HDRFTR_RIGHT_SIZE_CHANGE     .HDRFTR_RIGHT_SIZE -.5
5855 .\" +Quotes
5856 .       if !d $QUOTE_FAM         .QUOTE_FAMILY \\*[$DOC_FAM]
5857 .       if !d $QUOTE_FT          .QUOTE_FONT I
5858 .       if !d $QUOTE_SIZE_CHANGE .QUOTE_SIZE+0
5859 .       if !r #Q_OFFSET_VALUE \
5860 .          if '\\*[$Q_OFFSET_VALUE]'' .QUOTE_INDENT 3
5861 .\" +Blockquotes
5862 .\"  Note: the leading for quotes and blockquotes is set after .DEFAULTS in START
5863 .       if !d $BQUOTE_FAM         .BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
5864 .       if !d $BQUOTE_FT          .BLOCKQUOTE_FONT R
5865 .       if !d $BQUOTE_SIZE_CHANGE .BLOCKQUOTE_SIZE -1
5866 .       if !d $BQUOTE_QUAD        .BLOCKQUOTE_QUAD LEFT
5867 .\" +Epigraphs
5868 .       if !d $EPI_FAM         .EPIGRAPH_FAMILY \\*[$DOC_FAM]
5869 .       if !d $EPI_FT          .EPIGRAPH_FONT R
5870 .       if !d $EPI_SIZE_CHANGE .EPIGRAPH_SIZE -1.5
5871 .       if !r #EPI_AUTOLEAD    .EPIGRAPH_AUTOLEAD 2
5872 .       if !d $EPI_QUAD        .EPIGRAPH_QUAD \\*[$DOC_QUAD]
5873 .       if !r #EPI_OFFSET_VALUE \
5874 .          if '\\*[$EPI_OFFSET_VALUE]'' .EPIGRAPH_INDENT 3
5875 .\" +Linebreaks
5876 .       if !d $LINEBREAK_CHAR  .LINEBREAK_CHAR * 3 3p
5877 .       if !d $LINEBREAK_COLOR .LINEBREAK_COLOR black
5878 .\" +Footnotes
5879 .       if !r #FN_RULE_LENGTH .FOOTNOTE_RULE_LENGTH 4P
5880 .       if !r #FN_RULE_ADJ    .FOOTNOTE_RULE_ADJ 3p
5881 .       if !d $FN_SIZE_CHANGE .FOOTNOTE_SIZE -2
5882 .       if !r #FN_AUTOLEAD    .FOOTNOTE_AUTOLEAD 2
5883 .\" +Endnotes
5884 .       if !r #EN_PS                 .ENDNOTE_PT_SIZE (\\n[#DOC_PT_SIZE]u)
5885 .       if !d $EN_STRING_FT          .ENDNOTE_STRING_FONT B
5886 .       if !d $EN_STRING_SIZE_CHANGE .ENDNOTE_STRING_SIZE +1
5887 .       if !d $EN_TITLE_FT           .ENDNOTE_TITLE_FONT B
5888 .       if !d $EN_TITLE_SIZE_CHANGE  .ENDNOTE_TITLE_SIZE +0
5889 .       if !d $EN_NUMBER_FT          .ENDNOTE_NUMBER_FONT B
5890 .       if !d $EN_LN_FT              .ENDNOTE_LINENUMBER_FONT R
5891 .       if !d $EN_NUMBER_SIZE_CHANGE .ENDNOTE_NUMBER_SIZE +0
5892 .       if !d $EN_LN_SIZE_CHANGE     .ENDNOTE_LINENUMBER_SIZE +0
5893 .       if !r #EN_PP_INDENT          .ENDNOTE_PARA_INDENT 1.5m
5894 .       if !d $EN_SPACE              .ENDNOTE_SPACING 0
5895 .\" +Bibliography
5896 .       if !r #BIB_LIST               .BIBLIOGRAPHY_TYPE PLAIN
5897 .       if !r #BIB_PS                 .BIBLIOGRAPHY_PT_SIZE (\\n[#DOC_PT_SIZE]u)
5898 .       if !d $BIB_STRING_FT          .BIBLIOGRAPHY_STRING_FONT B
5899 .       if !d $BIB_STRING_SIZE_CHANGE .BIBLIOGRAPHY_STRING_SIZE +1
5900 .\" +Table of contents
5901 .       if !d $TOC_FAM                .TOC_FAMILY \\*[$DOC_FAM]
5902 .       if !r #TOC_PS                 .TOC_PT_SIZE (\\n[#DOC_PT_SIZE]u)
5903 .       if '\\*[$TOC_LEAD]''          .TOC_LEAD \\n[#DOC@LEAD]u ADJUST
5904 .       if !d $TOC_HEADER_FAM         .TOC_HEADER_FAMILY \\*[$TOC_FAM]
5905 .       if !d $TOC_HEADER_SIZE_CHANGE .TOC_HEADER_SIZE +4
5906 .       if !d $TOC_HEADER_FT          .TOC_HEADER_FONT B
5907 .       if !d $TOC_PN_FAM             .TOC_PN_FAMILY \\*[$TOC_FAM]
5908 .       if !d $TOC_PN_FT              .TOC_PN_FONT R
5909 .       if !d $TOC_PN_SIZE_CHANGE     .TOC_PN_SIZE +0
5910 .    \}
5911 .\" +Refer support
5912 .    if !r #EN_REF .nr #FN_REF 1
5913 .    if !d $REF_FN_INDENT \{\
5914 .       if \\n[#PRINT_STYLE]=1 .INDENT_REFS FOOTNOTE .5i
5915 .       if \\n[#PRINT_STYLE]=2 .INDENT_REFS FOOTNOTE 2m
5916 .    \}
5917 .    if !d $REF_EN_INDENT \{\
5918 .       if \\n[#PRINT_STYLE]=1 .INDENT_REFS ENDNOTE .5i
5919 .       if \\n[#PRINT_STYLE]=2 .INDENT_REFS ENDNOTE 2m
5920 .    \}
5921 .    if !d $REF_BIB_INDENT \{\
5922 .       if \\n[#PRINT_STYLE]=1 .INDENT_REFS BIBLIO .5i
5923 .       if \\n[#PRINT_STYLE]=2 .INDENT_REFS BIBLIO 2m
5924 .    \}
5925 .\" Define strings for idem entries
5926 .    if \\n[#PRINT_STYLE]=1 .char \[idem] \[hy]\[hy]\[hy]
5927 .    if \\n[#PRINT_STYLE]=2 .char \[idem] \v'-.3m'\l'3m'\v'.3m'
5928 .\" Adjust doc leading for PRINTSTYLE TYPESET
5929 .    if \\n[#PRINT_STYLE]=2 \
5930 .       if \\n[#ADJ_DOC_LEAD]=1 .DOC_LEAD_ADJUST
5931 .\" This diversion is to get a value for #FN_AUTOLEAD
5932 .    di NULL
5933 .       if \\n[#AUTO_LEAD] \{\
5934 .          nr #RESTORE_AUTO_LEAD 1
5935 .          nr #SAVED_AUTOLEAD_VALUE \\n[#AUTOLEAD_VALUE]
5936 .       \}
5937 .       ev NULL
5938 .       if \\n[#PRINT_STYLE]=1 \{\
5939 .          ps \\*[$TYPEWRITER_PS]
5940 .          ie \\n[#SINGLE_SPACE]=1 .vs \\n[#ORIGINAL_DOC_LEAD]u
5941 .          el .vs \\n[#ORIGINAL_DOC_LEAD]u/2u
5942 .       \}
5943 .       if \\n[#PRINT_STYLE]=2 \{\
5944 .          ps  \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
5945 .          vs \\n[.ps]u+\\n[#FN_AUTOLEAD]u
5946 .       \}
5947 .       nr #FN_LEAD \\n[#LEAD]
5948 .       ev
5949 .    di
5950 .    if \\n[#RESTORE_AUTO_LEAD] \{\
5951 .       nr #AUTO_LEAD 1
5952 .       nr #AUTOLEAD_VALUE  \\n[#SAVED_AUTOLEAD_VALUE]
5953 .    \}
5954 .    ie !\\n[#COLLATE] \{\
5955 .\" DOC_LEAD adjusted (or not) here
5956 .       TRAPS
5957 .       if \\n[#REMOVE_ADJ] .DOC_LEAD \\n[#DOC_LEAD]u-\\n[#DOC_LEAD_ADJ]u
5958 .\" Endnote, bibliography and toc leading
5959 .       nr #OK_PROCESS_LEAD 1
5960 .       nr #RESTORE_DOC_LEAD \\n[.v]
5961 .       nr #RESTORE_B_MARGIN \\n[#B_MARGIN]
5962 .       if \\n[#PRINT_STYLE]=1 \{\
5963 .          ie \\n[#SINGLE_SPACE] \{\
5964 .             ENDNOTE_LEAD      12 ADJUST
5965 .             BIBLIOGRAPHY_LEAD 12 ADJUST
5966 .          \}
5967 .          el \{\
5968 .             ie \\n[#EN_SINGLESPACE] .ENDNOTE_LEAD 12 ADJUST
5969 .             el .ENDNOTE_LEAD 24 ADJUST
5970 .             ie \\n[#BIB_SINGLESPACE] .BIBLIOGRAPHY_LEAD 12 ADJUST
5971 .             el .BIBLIOGRAPHY_LEAD 24 ADJUST
5972 .          \}
5973 .       \}
5974 .       if \\n[#PRINT_STYLE]=2 \{\
5975 .          ie !d $EN_LEAD  .ENDNOTE_LEAD \\n[#UNADJUSTED_DOC_LEAD]u ADJUST
5976 .          el .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD]
5977 .          ie !d $BIB_LEAD .BIBLIOGRAPHY_LEAD \\n[#UNADJUSTED_DOC_LEAD]u ADJUST
5978 .          el .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD]
5979 .          ie !d $TOC_LEAD .TOC_LEAD \\n[#UNADJUSTED_DOC_LEAD]u \\*[$ADJUST_TOC_LEAD]
5980 .          el .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD]
5981 .       \}
5982 .       ie !d $BIB_SPACE .BIBLIOGRAPHY_SPACING 0
5983 .       el \{\
5984 .          if \\n[#DEFER_BIB_SPACING]=1 \{\
5985 .             BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE]
5986 .             rr #DEFER_BIB_SPACING
5987 .          \}
5988 .       \}
5989 .       nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
5990 .       nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
5991 .       vs \\n[#DOC_LEAD]u
5992 .    \}
5993 .    el \{\
5994 .       if \\n[#COLLATE] \{\
5995 .          if !\\n[#PRINT_STYLE]=1 \{\
5996 .             if \\n[#RERUN_TRAPS] \{\
5997 .                TRAPS
5998 .                rr #RERUN_TRAPS
5999 .             \}
6000 .          \}
6001 .       \}
6002 .    \}
6003 .\" Set default heading and toc-entry family if not done already
6004 .    nr #HD_LEVEL 0 1 \" loop step
6005 .    nr #LOOP 9       \" loop count
6006 .    while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\
6007 .       if '\\*[$HEAD_\\n[#HD_LEVEL]_FAM]'' \
6008 .           ds $HEAD_\\n[#HD_LEVEL]_FAM \\*[$DOC_FAM]
6009 .       if '\\*[$HEAD_\\n[#HD_LEVEL]_BASELINE_ADJ]'' \
6010 .           ds $HEAD_\\n[#HD_LEVEL]_BASELINE_ADJ \\n[.v]/10
6011 .       if '\\*[$TOC_HEAD_\\n[#HD_LEVEL]_FAM]'' \
6012 .           ds $TOC_HEAD_\\n[#HD_LEVEL]_FAM \\*[$DOC_FAM]
6013 .    \}
6014 .    if '\\*[$TOC_TITLE_FAM]'' .ds $TOC_TITLE_FAM \\*[$DOC_FAM]
6015 .\" Re-run MNinit to capture strings and registers set in DEFAULTS.
6016 .    if !'\\*[$MN-arg1]'' \{\
6017 .       MNinit \
6018 \\*[$MN-arg1] \\*[$MN-arg2] \
6019 \\*[$MN-arg3] \\*[$MN-arg4] \
6020 \\*[$MN-arg5] \\*[$MN-arg6] \
6021 \\*[$MN-arg7] \\*[$MN-arg8] \
6022 \\*[$MN-arg9]
6023 .    \}
6024 .    if \\n[#PRINT_STYLE]=1 .nr #IGNORE 1
6025 .    if \\n[#AUTO_LEAD] \{\
6026 .       rr #AUTO_LEAD
6027 .       rr #AUTOLEAD_VALUE
6028 .    \}
6029 .END
6030 \#
6031 \# ====================================================================
6032 \#
6033 \# +++START THE DOCUMENT+++
6034 \#
6035 \# THE START MACRO
6036 \# ---------------
6037 \# *Arguments:
6038 \#   <none>
6039 \# *Function:
6040 \#   Reads in default document style parameters and any parameters
6041 \#   the user has changed before issuing START.
6042 \#   Using the information gathered in the opening macros,
6043 \#   prints appropriate title (or chapter #), subtitle, author
6044 \#   and document type (if appropriate).
6045 \# *Notes:
6046 \#   The .PRINT \& (zero-width character) is required to get the
6047 \#   subsequent .sp request to work as advertised.
6048 \#
6049 \#   The overall document line length, family, and point-size
6050 \#   are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
6051 \#   use in the HEADER and FOOTER macros.
6052 \#
6053 \#  First, define some strings for point sizes
6054 \#
6055 \# Doc cover
6056 \#
6057 .ds $DOC_COVER_AUTHOR_PT_SIZE \
6058     \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_AUTHOR_SIZE_CHANGE]
6059 .ds $DOC_COVER_CHAPTER_TITLE_PT_SIZE \
6060     \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE]
6061 .ds $DOC_COVER_COPYRIGHT_PT_SIZE \
6062     \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_COPYRIGHT_SIZE_CHANGE]
6063 .ds $DOC_COVER_DOCTYPE_PT_SIZE \
6064     \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_DOCTYPE_SIZE_CHANGE]
6065 .ds $DOC_COVER_MISC_PT_SIZE \
6066     \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_MISC_SIZE_CHANGE]
6067 .ds $DOC_COVER_SUBTITLE_PT_SIZE \
6068     \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_SUBTITLE_SIZE_CHANGE]
6069 .ds $DOC_COVER_TITLE_PT_SIZE \
6070     \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_TITLE_SIZE_CHANGE]
6071 \# Cover
6072 .ds $COVER_AUTHOR_PT_SIZE \
6073     \\n[#DOC_PT_SIZE]u\\*[$COVER_AUTHOR_SIZE_CHANGE]
6074 .ds $COVER_CHAPTER_TITLE_PT_SIZE \
6075     \\n[#DOC_PT_SIZE]u\\*[$COVER_CHAPTER_TITLE_SIZE_CHANGE]
6076 .ds $COVER_COPYRIGHT_PT_SIZE \
6077     \\n[#DOC_PT_SIZE]u\\*[$COVER_COPYRIGHT_SIZE_CHANGE]
6078 .ds $COVER_DOCTYPE_PT_SIZE \
6079     \\n[#DOC_PT_SIZE]u\\*[$COVER_DOCTYPE_SIZE_CHANGE]
6080 .ds $COVER_MISC_PT_SIZE \
6081     \\n[#DOC_PT_SIZE]u\\*[$COVER_MISC_SIZE_CHANGE]
6082 .ds $COVER_SUBTITLE_PT_SIZE \
6083     \\n[#DOC_PT_SIZE]u\\*[$COVER_SUBTITLE_SIZE_CHANGE]
6084 .ds $COVER_TITLE_PT_SIZE \
6085     \\n[#DOC_PT_SIZE]u\\*[$COVER_TITLE_SIZE_CHANGE]
6086 \# Docheader
6087 .ds $AUTHOR_PT_SIZE \
6088     \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
6089 .ds $CHAPTER_TITLE_PT_SIZE \
6090     \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
6091 .ds $COPYRIGHT_PT_SIZE \
6092     \\n[#DOC_PT_SIZE]u\\*[$COPYRIGHT_SIZE_CHANGE]
6093 .ds $DOCTYPE_PT_SIZE \
6094     \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
6095 .ds $SUBTITLE_PT_SIZE \
6096     \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
6097 .ds $TITLE_PT_SIZE \
6098     \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
6099 \#
6100 \# Next, some utility macros for various routines to prevent repetition
6101 \#
6102 .MAC DOC_HEADER_QUAD END
6103 .    if '\\$0'DOC_HEADER_QUAD' .ds $CALLING_MACRO DOCHEADER
6104 .    if '\\$0'COVER_H_POS'     .ds $CALLING_MACRO COVER
6105 .    if '\\$0'DOC_COVER_H_POS' .ds $CALLING_MACRO DOC_COVER
6106 .    ie !'\\*[$\\*[$CALLING_MACRO]_QUAD]'' \{\
6107 .       if '\\*[$\\*[$CALLING_MACRO]_QUAD]'L'      .LEFT
6108 .       if '\\*[$\\*[$CALLING_MACRO]_QUAD]'LEFT'   .LEFT
6109 .       if '\\*[$\\*[$CALLING_MACRO]_QUAD]'R'      .RIGHT
6110 .       if '\\*[$\\*[$CALLING_MACRO]_QUAD]'RIGHT'  .RIGHT
6111 .       if '\\*[$\\*[$CALLING_MACRO]_QUAD]'C'      .RIGHT
6112 .       if '\\*[$\\*[$CALLING_MACRO]_QUAD]'CENTER' .CENTER
6113 .       if '\\*[$\\*[$CALLING_MACRO]_QUAD]'CENTRE' .CENTER
6114 .    \}
6115 .    el .CENTER
6116 .END
6117 \#
6118 \# Aliases for DOC_HEADER_QUAD
6119 \#
6120 .ALIAS COVER_H_POS      DOC_HEADER_QUAD
6121 .ALIAS DOC_COVER_H_POS  DOC_HEADER_QUAD
6122 \#
6123 .MAC PRINT_AUTHORS END
6124 .    ie r#DOING_COVER \{\
6125 .       if \\n[#DOC_COVER]=1 \{\
6126 .          ie !'\\*[$AUTHOR_DOCCOVER_1]'' \{\
6127 .             nr #AUTHORS \\n[#AUTHOR_DOCCOVER_NUM]
6128 .             nr #NEXT_AUTHOR 0 1
6129 .             while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6130 .                ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \
6131 .                   PRINT \
6132 \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_DOCCOVER_\\n+[#NEXT_AUTHOR]]\m[]
6133 .                el .PRINT \\*[$AUTHOR_DOCCOVER_\\n+[#NEXT_AUTHOR]]
6134 .             \}
6135 .          \}
6136 .          el \{\
6137 .             nr #AUTHORS \\n[#AUTHOR_NUM]
6138 .             nr #NEXT_AUTHOR 0 1
6139 .             while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6140 .                ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \
6141 .                   PRINT \
6142 \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6143 .                el .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
6144 .             \}
6145 .          \}
6146 .          return
6147 .       \}
6148 .       if \\n[#COVER]=1 \{\
6149 .          ie !'\\*[$AUTHOR_COVER_1]'' \{\
6150 .             nr #AUTHORS \\n[#AUTHOR_COVER_NUM]
6151 .             nr #NEXT_AUTHOR 0 1
6152 .             while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6153 .                ie \\n[#COVER_AUTHOR_COLOR]=1 \
6154 .                   PRINT \
6155 \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_COVER_\\n+[#NEXT_AUTHOR]]\m[]
6156 .                el .PRINT \\*[$AUTHOR_COVER_\\n+[#NEXT_AUTHOR]]
6157 .             \}
6158 .          \}
6159 .          el \{\
6160 .             nr #AUTHORS \\n[#AUTHOR_NUM]
6161 .             nr #NEXT_AUTHOR 0 1
6162 .             while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6163 .                ie \\n[#COVER_AUTHOR_COLOR]=1 \
6164 .                   PRINT \
6165 \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6166 .                el .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
6167 .             \}
6168 .          \}
6169 .          return
6170 .       \}
6171 .    \}
6172 .    el \{\
6173 .       nr #AUTHORS \\n[#AUTHOR_NUM]
6174 .       nr #NEXT_AUTHOR 0 1
6175 .       while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6176 .          ie \\n[#AUTHOR_COLOR]=1 \
6177 .             PRINT \m[\\*[$AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6178 .          el .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
6179 .       \}
6180 .    \}
6181 .END
6182 \#
6183 .MAC DEFAULT_DOCHEADER END
6184 .    DOC_HEADER_QUAD
6185 .    if !'\\*[$TITLE_1]'' \{\
6186 .       FAMILY  \\*[$TITLE_FAM]
6187 .       FT      \\*[$TITLE_FT]
6188 .       ps \\*[$TITLE_PT_SIZE]
6189 .       vs      \\n[#DOCHEADER_LEAD]u
6190 .       nr #ARG_NUM 0 1
6191 .       while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6192 .          ie \\n[#TITLE_COLOR]=1 \
6193 .             PRINT "\m[\\*[$TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6194 .          el .PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6195 .       \}
6196 .    \}
6197 .    if !'\\*[$SUBTITLE_1]'' \{\
6198 .       FAMILY  \\*[$SUBTITLE_FAM]
6199 .       FT      \\*[$SUBTITLE_FT]
6200 .       ps \\*[$SUBTITLE_PT_SIZE]
6201 .       nr #ARG_NUM 0 1
6202 .       while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6203 .          ie \\n[#SUBTITLE_COLOR]=1 \
6204 .             PRINT "\m[\\*[$SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n[#ARG_NUM]]\m[]
6205 .          el .PRINT "\\*[$SUBTITLE_\\n[#ARG_NUM]]
6206 .       \}
6207 .    \}
6208 .    if !'\\*[$AUTHOR_1]'' \{\
6209 .       FAMILY  \\*[$AUTHOR_FAM]
6210 .       FT      \\*[$AUTHOR_FT]
6211 .       ps \\*[$AUTHOR_PT_SIZE]
6212 .       ie \\n[#ATTRIBUTE_COLOR]=1 \
6213 .          PRINT \&\m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
6214 .       el .PRINT \&\\*[$ATTRIBUTE_STRING]
6215 .       PRINT_AUTHORS
6216 .    \}
6217 .    FAMILY \\*[$DOC_FAM]
6218 .    FT R
6219 .END
6220 \#
6221 .MAC CHAPTER_DOCHEADER END
6222 .    DOC_HEADER_QUAD
6223 .    FAMILY  \\*[$TITLE_FAM]
6224 .    FT      \\*[$TITLE_FT]
6225 .    ps \\*[$TITLE_PT_SIZE]
6226 .    vs \\n[#DOCHEADER_LEAD]u
6227 .\" Chapter title only
6228 .    ie '\\*[$CHAPTER]'' \{\
6229 .       ie !'\\*[$CHAPTER_TITLE_1]'' \{\
6230 .          if \\n[#PRINT_STYLE]=2 \{\
6231 .             FAMILY  \\*[$CHAPTER_TITLE_FAM]
6232 .             FT      \\*[$CHAPTER_TITLE_FT]
6233 .             ps \\*[$CHAPTER_TITLE_PT_SIZE]
6234 .             vs \\n[#DOCHEADER_LEAD]u
6235 .          \}
6236 .          nr #ARG_NUM 0 1
6237 .          while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6238 .             ie \\n[#TITLE_COLOR]=1 \{\
6239 .                PRINT \
6240 \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6241 .             \}
6242 .             el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6243 .          \}
6244 .       \}
6245 .       el \{\
6246 .          ie \\n[#TITLE_COLOR]=1 \{\
6247 .             PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING]\m[]
6248 .          \}
6249 .          el .PRINT \\*[$CHAPTER_STRING]
6250 .       \}
6251 .    \}
6252 .\" Chapter string, possibly with a chapter title
6253 .    el \{\
6254 .       ie \\n[#TITLE_COLOR]=1 \{\
6255 .          PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6256 .       \}
6257 .       el .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6258 .       if !'\\*[$CHAPTER_TITLE_1]'' \{\
6259 .          if \\n[#PRINT_STYLE]=2 \{\
6260 .             FAMILY  \\*[$CHAPTER_TITLE_FAM]
6261 .             FT      \\*[$CHAPTER_TITLE_FT]
6262 .             ps \\*[$CHAPTER_TITLE_PT_SIZE]
6263 .             vs \\n[#DOCHEADER_LEAD]u
6264 .             ALD     \\n[.v]u/4u \" Put a little space before the chapter title
6265 .          \}
6266 .          nr #ARG_NUM 0 1
6267 .          while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6268 .             ie \\n[#CHAPTER_TITLE_COLOR]=1 \{\
6269 .                PRINT \
6270 \m[\\*[$CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6271 .             \}
6272 .             el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6273 .          \}
6274 .          RLD \\n[#DOC_LEAD]u    \" Just looks better this way
6275 .       \}
6276 .    \}
6277 .    FAMILY \\*[$DOC_FAM]
6278 .    FT R
6279 .END
6280 \#
6281 .MAC NAMED_DOCHEADER END
6282 .    DOC_HEADER_QUAD
6283 .    FAMILY  \\*[$TITLE_FAM]
6284 .    FT      \\*[$TITLE_FT]
6285 .    ps \\*[$TITLE_PT_SIZE]
6286 .    vs      \\n[#DOCHEADER_LEAD]u
6287 .    if !'\\*[$TITLE_1]'' \{\
6288 .       nr #ARG_NUM 0 1
6289 .       while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6290 .          ie \\n[#TITLE_COLOR]=1 \{\
6291 .             PRINT "\m[\\*[$TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6292 .          \}
6293 .          el .PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6294 .       \}
6295 .    \}
6296 .    if !'\\*[$SUBTITLE]'' \{\
6297 .       FAMILY  \\*[$SUBTITLE_FAM]
6298 .       FT      \\*[$SUBTITLE_FT]
6299 .       ps \\*[$SUBTITLE_PT_SIZE]
6300 .       nr #ARG_NUM 0 1
6301 .       while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6302 .          ie \\n[#SUBTITLE_COLOR]=1 \{\
6303 .             PRINT "\m[\\*[$SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n[#ARG_NUM]]\m[]
6304 .          \}
6305 .          el .PRINT "\\*[$SUBTITLE_\\n[#ARG_NUM]]
6306 .       \}
6307 .    \}
6308 .    if !'\\*[$AUTHOR_1]'' \{\
6309 .       FAMILY  \\*[$AUTHOR_FAM]
6310 .       FT      \\*[$AUTHOR_FT]
6311 .       ps \\*[$AUTHOR_PT_SIZE]
6312 .       ie \\n[#ATTRIBUTE_COLOR]=1 \{\
6313 .          PRINT \&\m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
6314 .       \}
6315 .       el .PRINT \&\\*[$ATTRIBUTE_STRING]
6316 .       PRINT_AUTHORS
6317 .    \}
6318 .    FAMILY  \\*[$DOCTYPE_FAM]
6319 .    FT      \\*[$DOCTYPE_FT]
6320 .    ps \\*[$DOCTYPE_PT_SIZE]
6321 .    vs \\n[#DOCHEADER_LEAD]u
6322 .    ALD     \\n[#DOCHEADER_LEAD]u
6323 .    nr #FROM_DOCTYPE 1
6324 .    if \\n[#DOCTYPE_COLOR]=1 .COLOR \\*[$DOCTYPE_COLOR]
6325 .    ie \\n[#DOCTYPE_UNDERLINE]=1 \
6326 .       UNDERSCORE \\*[$DOCTYPE_UNDERLINE_GAP] "\\*[$DOC_TYPE]"
6327 .    el .PRINT "\\*[$DOC_TYPE]"
6328 .    COLOR black
6329 .    FAMILY \\*[$DOC_FAM]
6330 .    FT R
6331 .    rr #FROM_DOCTYPE
6332 .END
6333 \#
6334 \# COVER PAGE
6335 \# ----------
6336 \# *Arguments:
6337 \#   TITLE | DOCTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE | COVERTITLE \
6338 \#   [ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC BLANKPAGE ]
6339 \# *Function:
6340 \#   Toggles the number register for each cover page element
6341 \#   passed as an argument.
6342 \# *Notes:
6343 \#   TITLE, DOCTITLE, CHAPTER, CHAPTER_TITLE or CHAPTER+TITLE must
6344 \#   be supplied.  After that, users may enter as many or as few of
6345 \#   the arguments as they like.  BLANKPAGE inserts a blank page
6346 \#   after the cover.
6347 \#
6348 \#   If called as DOC_COVER, performs the same operations, but
6349 \#   applies everything to a doc cover.
6350 \#
6351 .MAC COVER END
6352 .    ie '\\$0'DOC_COVER' \{\
6353 .       nr #DOC_COVER 1
6354 .       ds DOC_ DOC_
6355 .    \}
6356 .    el .nr #COVER 1
6357 .    nr #ARG_NUM 0 1
6358 .    nr #COVER_ITEM \\n[#NUM_ARGS]  \"loop count
6359 .    while \\n+[#ARG_NUM]<=\\n[#COVER_ITEM] \{\
6360 .       if '\\$1'TITLE' \{\
6361 .          nr #\\*[DOC_]COVER_TITLE 1
6362 .          shift
6363 .       \}
6364 .       if '\\$1'DOCTITLE' \{\
6365 .          nr #\\*[DOC_]COVER_TITLE 2
6366 .          shift
6367 .       \}
6368 .       if '\\$1'CHAPTER' \{\
6369 .          nr #\\*[DOC_]COVER_TITLE 3
6370 .          shift
6371 .       \}
6372 .       if '\\$1'CHAPTER_TITLE' \{\
6373 .          nr #\\*[DOC_]COVER_TITLE 4
6374 .          shift
6375 .       \}
6376 .       if '\\$1'CHAPTER+TITLE' \{\
6377 .          nr #\\*[DOC_]COVER_TITLE 5
6378 .          shift
6379 .       \}
6380 .       if '\\$1'\\*[DOC_]COVERTITLE' \{\
6381 .          nr #\\*[DOC_]COVER_TITLE 6
6382 .          shift
6383 .       \}
6384 .       if '\\$1'SUBTITLE' \{\
6385 .          nr #\\*[DOC_]COVER_SUBTITLE 1
6386 .          shift
6387 .       \}
6388 .       if '\\$1'AUTHOR' \{\
6389 .          nr #\\*[DOC_]COVER_AUTHOR 1
6390 .          shift
6391 .       \}
6392 .       if '\\$1'DOCTYPE' \{\
6393 .          nr #\\*[DOC_]COVER_DOCTYPE 1
6394 .          shift
6395 .       \}
6396 .       if '\\$1'COPYRIGHT' \{\
6397 .          nr #\\*[DOC_]COVER_COPYRIGHT 1
6398 .          shift
6399 .       \}
6400 .       if '\\$1'MISC' \{\
6401 .          nr #\\*[DOC_]COVER_MISC 1
6402 .          shift
6403 .       \}
6404 .       if '\\$1'PDF_OUTLINE_LABEL' \{\
6405 .          shift
6406 .          ds $PDF_\\*[DOC_]COVER_LABEL \\$1
6407 .          shift
6408 .       \}
6409 .       if '\\$1'BLANKPAGE' \{\
6410 .          nr #\\*[DOC_]COVER_BLANKPAGE 1
6411 .          shift
6412 .       \}
6413 .    \}
6414 .    if '\\$0'DOC_COVER' .rm DOC_
6415 .END
6416 \#
6417 .MAC COVERTITLE END
6418 .    ie '\\$0'DOC_COVERTITLE' \{\
6419 .       ie \\n[#NUM_ARGS]=0 \{\
6420 .          if \\n[#DOC_COVER_TITLE_NUM] \{\
6421 .             nr #ITEM 0 1
6422 .             while \\n[#DOC_COVER_TITLE_NUM]>\\n[#ITEM] \{\
6423 .                rm $DOC_COVER_TITLE_\\n+[#ITEM]
6424 .             \}
6425 .             rr #DOC_COVER_TITLE_NUM
6426 .             rm $DOC_COVER_TITLE
6427 .          \}
6428 .       \}
6429 .       el \{\
6430 .          nr #DOC_COVER_TITLE_NUM 0 1
6431 .          while \\n[#NUM_ARGS]>\\n[#DOC_COVER_TITLE_NUM] \{\
6432 .             ds \
6433 $DOC_COVER_TITLE_\\n+[#DOC_COVER_TITLE_NUM] \\$\\n[#DOC_COVER_TITLE_NUM]
6434 .          \}
6435 .          ds $DOC_COVER_TITLE \\$*
6436 .       \}
6437 .    \}
6438 .    el \{\
6439 .       ie \\n[#NUM_ARGS]=0 \{\
6440 .          if \\n[#COVER_TITLE_NUM] \{\
6441 .             nr #ITEM 0 1
6442 .             while \\n[#COVER_TITLE_NUM]>\\n[#ITEM] \{\
6443 .                rm $COVER_TITLE_\\n+[#ITEM]
6444 .             \}
6445 .             rr #COVER_TITLE_NUM
6446 .             rm $COVER_TITLE
6447 .          \}
6448 .       \}
6449 .       el \{\
6450 .          nr #COVER_TITLE_NUM 0 1
6451 .          while \\n[#NUM_ARGS]>\\n[#COVER_TITLE_NUM] \{\
6452 .             ds $COVER_TITLE_\\n+[#COVER_TITLE_NUM] \\$\\n[#COVER_TITLE_NUM]
6453 .          \}
6454 .          ds $COVER_TITLE \\$*
6455 .\" .          if \\n[#DOCTITLE_NUM]=0 .PDF_TITLE \\*[$COVER_TITLE]
6456 .       \}
6457 .    \}
6458 .END
6459 \#
6460 \# COVER PAGE LEADING
6461 \# ------------------
6462 \# *Arguments:
6463 \#   <+|- amount by which to in/decrease leading of cover/doc cover>
6464 \# *Function:
6465 \#   Stores user supplied lead in/decrease in string $COVER_LEAD_ADJ
6466 \#   or $DOC_COVER_LEAD_ADJ, depending on whether the macro was called
6467 \#   with an alias (DOC_COVER_LEAD).
6468 \# *Notes:
6469 \#   A unit of measure must be supplied.  Decimal fractions OK.
6470 \#   Default is +0, i.e. same as DOC_LEAD.
6471 \#
6472 .MAC COVER_LEAD END
6473 .    ie '\\$0'DOC_COVER_LEAD' .ds $DOC_COVER_LEAD_ADJ \\$1
6474 .    el .ds $COVER_LEAD_ADJ \\$1
6475 .END
6476 \#
6477 \# MISCs get treated similarly to QUOTEs and BLOCKQUOTEs with respect to
6478 \# leading
6479 \#
6480 .MAC MISC_AUTOLEAD END
6481 .    if '\\$0'DOC_COVER_MISC_AUTOLEAD' .nr #DOC_COVER_MISC_AUTOLEAD (p;\\$1)
6482 .    if '\\$0'COVER_MISC_AUTOLEAD'     .nr #COVER_MISC_AUTOLEAD (p;\\$1)
6483 .END
6484 \#
6485 .ALIAS DOC_COVER_MISC_AUTOLEAD  MISC_AUTOLEAD
6486 .ALIAS COVER_MISC_AUTOLEAD      MISC_AUTOLEAD
6487 \#
6488 \# COVER PAGE START POSITION
6489 \# -------------------------
6490 \# *Arguments:
6491 \#   <distance from page top at which to start cover/doc cover>
6492 \# *Function:
6493 \#   Stores user supplied lead in/decrease in #COVER_START_POS
6494 \#   or #DOC_COVER_START_POS, depending on whether the macro was
6495 \#   called by an alias (DOC_COVER_ADVANCE).
6496 \# *Notes:
6497 \#   A unit of measure must be supplied.  Decimal fractions OK.
6498 \#   If user doesn't invoke this macro, the default starting
6499 \#   position for both covers and doc covers is 1/3 of the way
6500 \#   down the page (setup in DO_COVER).
6501 \#
6502 .MAC COVER_ADVANCE END
6503 .    ie '\\$0'DOC_COVER_ADVANCE' .nr #DOC_COVER_START_POS (\\$1)
6504 .    el .nr #COVER_START_POS (\\$1)
6505 .END
6506 \#
6507 \# UNDERLINE CONTROL
6508 \# -----------------
6509 \# *Arguments:
6510 \#   [ DOUBLE ] [ <underline weight> [<underline gap>] ] | <none> | <anything>
6511 \# *Function:
6512 \#   Toggles underlining of the element indicated by the calling alias
6513 \#   on or off.  Uses #<element>_UNDERLINE_WEIGHT to set the weight,
6514 \#   and defines string $<element>_UNDERLINE_GAP.
6515 \# *Notes:
6516 \#   Calling aliases COVER_ and DOCCOVER_ only apply if DOCTYPE is
6517 \#   NAMED and the DOCTYPE arg is passed to COVER or DOC_COVER.
6518 \#
6519 .MAC _UNDERLINE END
6520 .    ie '\\$1'' \{\
6521 .       if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \
6522 .          nr #BIB_STRING_UNDERLINE 1
6523 .       if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \
6524 .          nr #BIB_STRING_UNDERLINE 1
6525 .       if '\\$0'COVER_UNDERLINE' \
6526 .          nr #COVER_UNDERLINE 1
6527 .       if '\\$0'DOC_COVER_UNDERLINE' \
6528 .          nr #DOC_COVER_UNDERLINE 1
6529 .       if '\\$0'DOCTYPE_UNDERLINE' \
6530 .          nr #DOCTYPE_UNDERLINE 1
6531 .       if '\\$0'ENDNOTE_STRING_UNDERLINE' \
6532 .          nr #EN_STRING_UNDERLINE 1
6533 .       if '\\$0'ENDNOTE_STRING_UNDERSCORE' \
6534 .          nr #EN_STRING_UNDERLINE 1
6535 .       if '\\$0'ENDNOTE_TITLE_UNDERLINE' \
6536 .          nr #EN_TITLE_UNDERLINE 1
6537 .       if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \
6538 .          nr #EN_TITLE_UNDERLINE 1
6539 .    \}
6540 .    el \{\
6541 .       ie \\n[#NUM_ARGS]=1 \{\
6542 .          ds $ARG \\$1
6543 .          substring $ARG -1
6544 .          ie \B'\\*[$ARG]' \{\
6545 .             if !\\n[#PRINT_STYLE]=1 \{\
6546 .                if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \
6547 .                   BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6548 .                if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \
6549 .                   BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6550 .                if '\\$0'COVER_UNDERLINE' \
6551 .                   COVER_UNDERLINE_WEIGHT \\$1
6552 .                if '\\$0'DOC_COVER_UNDERLINE' \
6553 .                   DOC_COVER_UNDERLINE_WEIGHT \\$1
6554 .                if '\\$0'DOCTYPE_UNDERLINE' \
6555 .                   DOCTYPE_UNDERLINE_WEIGHT \\$1
6556 .                if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\
6557 .                   ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6558 .                   nr #EN_STRING_UNDERLINE 1
6559 .                \}
6560 .                if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\
6561 .                   ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6562 .                   nr #EN_STRING_UNDERLINE 1
6563 .                \}
6564 .                if '\\$0'ENDNOTE_TITLE_UNDERLINE' \
6565 .                   ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6566 .                if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \
6567 .                   ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6568 .             \}
6569 .          \}
6570 .          el \{\
6571 .             if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{\
6572 .                ie '\\$1'DOUBLE' .nr #BIB_STRING_UNDERLINE 2
6573 .                el .nr #BIB_STRING_UNDERLINE 0
6574 .             \}
6575 .             if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{\
6576 .                ie '\\$1'DOUBLE' .nr #BIB_STRING_UNDERLINE 2
6577 .                el .nr #BIB_STRING_UNDERLINE 0
6578 .             \}
6579 .             if '\\$0'COVER_UNDERLINE'     .nr #COVER_UNDERLINE 0
6580 .             if '\\$0'DOC_COVER_UNDERLINE' .nr #DOC_COVER_UNDERLINE 0
6581 .             if '\\$0'DOCTYPE_UNDERLINE'   .nr #DOCTYPE_UNDERLINE 0
6582 .             if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\
6583 .                ie '\\$1'DOUBLE' .nr #EN_STRING_UNDERLINE 2
6584 .                el .nr #EN_STRING_UNDERLINE 0
6585 .             \}
6586 .             if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\
6587 .                ie '\\$1'DOUBLE' .nr #EN_STRING_UNDERLINE 2
6588 .                el .nr #EN_STRING_UNDERLINE 0
6589 .             \}
6590 .             if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{\
6591 .                ie '\\$1'DOUBLE' .nr #EN_TITLE_UNDERLINE 2
6592 .                el .nr #EN_TITLE_UNDERLINE 0
6593 .             \}
6594 .             if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{\
6595 .                ie '\\$1'DOUBLE' .nr #EN_TITLE_UNDERLINE 2
6596 .                el .nr #EN_TITLE_UNDERLINE 0
6597 .             \}
6598 .          \}
6599 .       \}
6600 .       el \{\
6601 .          if !\\n[#PRINT_STYLE]=1 \{\
6602 .             if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{\
6603 .                nr #BIB_STRING_UNDERLINE 1
6604 .                if '\\$1'DOUBLE' \{\
6605 .                   nr #BIB_STRING_UNDERLINE 2
6606 .                   shift
6607 .                \}
6608 .                BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6609 .                if !'\\$2'' \
6610 .                   ds $BIB_STRING_UNDERLINE_GAP \\$2
6611 .                if !'\\$3'' \
6612 .                   ds $BIB_STRING_RULE_GAP \\$3
6613 .             \}
6614 .             if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{\
6615 .                nr #BIB_STRING_UNDERLINE 1
6616 .                if '\\$1'DOUBLE' \{\
6617 .                   nr #BIB_STRING_UNDERLINE 2
6618 .                   shift
6619 .                \}
6620 .                BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6621 .                if !'\\$2'' .ds $BIB_STRING_UNDERLINE_GAP \\$2
6622 .                if !'\\$3'' .ds $BIB_STRING_RULE_GAP \\$3
6623 .             \}
6624 .             if '\\$0'COVER_UNDERLINE' \{\
6625 .                nr #COVER_UNDERLINE 1
6626 .                COVER_UNDERLINE_WEIGHT \\$1
6627 .                ds $COVER_UNDERLINE_GAP \\$2
6628 .             \}
6629 .             if '\\$0'DOC_COVER_UNDERLINE' \{\
6630 .                nr #DOC_COVER_UNDERLINE 1
6631 .                DOC_COVER_UNDERLINE_WEIGHT \\$1
6632 .                ds $DOC_COVER_UNDERLINE_GAP \\$2
6633 .             \}
6634 .             if '\\$0'DOCTYPE_UNDERLINE' \{\
6635 .                nr #DOCTYPE_UNDERLINE 1
6636 .                DOCTYPE_UNDERLINE_WEIGHT \\$1
6637 .                ds $DOCTYPE_UNDERLINE_GAP \\$2
6638 .             \}
6639 .\" ENDNOTE_STRING_UNDERLINE and ENDNOTE_STRING_UNDERSCORE are identical
6640 .\" _UNDERLINE left in for backward compatibility
6641 .             if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\
6642 .                nr #EN_STRING_UNDERLINE 1
6643 .                if '\\$1'DOUBLE' \{\
6644 .                   nr #EN_STRING_UNDERLINE 2
6645 .                   shift
6646 .                \}
6647 .                ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6648 .                if !'\\$2'' .ds $EN_STRING_UNDERLINE_GAP \\$2
6649 .                if !'\\$3'' .ds $EN_STRING_RULE_GAP \\$3
6650 .             \}
6651 .             if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\
6652 .                nr #EN_STRING_UNDERLINE 1
6653 .                if '\\$1'DOUBLE' \{\
6654 .                   nr #EN_STRING_UNDERLINE 2
6655 .                   shift
6656 .                \}
6657 .                ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6658 .                if !'\\$2'' .ds $EN_STRING_UNDERLINE_GAP \\$2
6659 .                if !'\\$3'' .ds $EN_STRING_RULE_GAP \\$3
6660 .             \}
6661 .\" ENDNOTE_TITLE_UNDERLINE and ENDNOTE_TITLE_UNDERSCORE are identical
6662 .\" _UNDERLINE left in for backward compatibility
6663 .             if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{\
6664 .                nr #EN_TITLE_UNDERLINE 1
6665 .                ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6666 .                ds $EN_TITLE_UNDERLINE_GAP \\$2
6667 .             \}
6668 .             if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{\
6669 .                nr #EN_TITLE_UNDERLINE 1
6670 .                ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6671 .                ds $EN_TITLE_UNDERLINE_GAP \\$2
6672 .             \}
6673 .          \}
6674 .       \}
6675 .    \}
6676 .END
6677 \#
6678 .ALIAS BIBLIOGRAPHY_STRING_UNDERSCORE _UNDERLINE
6679 .ALIAS BIBLIOGRAPHY_STRING_UNDERLINE  _UNDERLINE
6680 .ALIAS COVER_UNDERLINE                _UNDERLINE
6681 .ALIAS DOC_COVER_UNDERLINE            _UNDERLINE
6682 .ALIAS DOCTYPE_UNDERLINE              _UNDERLINE
6683 .ALIAS ENDNOTE_STRING_UNDERLINE       _UNDERLINE
6684 .ALIAS ENDNOTE_STRING_UNDERSCORE      _UNDERLINE
6685 .ALIAS ENDNOTE_TITLE_UNDERLINE        _UNDERLINE
6686 .ALIAS ENDNOTE_TITLE_UNDERSCORE       _UNDERLINE
6687 \#
6688 \# COVERS - WHETHER TO PRINT
6689 \# -------------------------
6690 \# *Arguments:
6691 \#   <none> | <anything>
6692 \# *Function:
6693 \#   Creates or removes registers #COVERS and #COVERS_OFF, checked for
6694 \#   in DEFAULTS (in START) prior to printing
6695 \#
6696 .MAC COVERS END
6697 .    ie '\\$0'DOC_COVERS' \{\
6698 .       ie '\\$1'' \{\
6699 .          rr #DOC_COVERS_OFF
6700 .          nr #DOC_COVERS 1
6701 .       \}
6702 .       el \{\
6703 .          rr #DOC_COVERS
6704 .          nr #DOC_COVERS_OFF 1
6705 .       \}
6706 .    \}
6707 .    el \{\
6708 .       ie '\\$1'' \{\
6709 .          rr #COVERS_OFF
6710 .          nr #COVERS 1
6711 .       \}
6712 .       el \{\
6713 .          rr #COVERS
6714 .          nr #COVERS_OFF 1
6715 .       \}
6716 .    \}
6717 .END
6718 \#
6719 \# COVER_COUNTS_PAGES
6720 \# ------------------
6721 \# *Arguments:
6722 \#   <none> | <anything>
6723 \# *Function:
6724 \#   Creates or removes registers #COVERS_COUNT or #DOCCOVERS_COUNT,
6725 \#   used in END_COVER to determine whether to increment the page
6726 \#   number silently when doc covers or covers are output.
6727 \#
6728 .MAC COVER_COUNTS_PAGES END
6729 .    if '\\$0'DOC_COVER_COUNTS_PAGES' \{\
6730 .       ie '\\$1'' .nr #DOCCOVERS_COUNT 1
6731 .       el .rr #DOCCOVERS_COUNT
6732 .       return
6733 .    \}
6734 .    if '\\$0'COVER_COUNTS_PAGES' \{\
6735 .       ie '\\$1'' .nr #COVERS_COUNT 1
6736 .       el .rr #COVERS_COUNT
6737 .       return
6738 .    \}
6739 .END
6740 \#
6741 .MAC DO_COVER END
6742 .    nr #DOING_COVER 1
6743 .    ev COVER
6744 .    evc 0
6745 .    TRAP OFF
6746 .    if \\n[#PAGINATE]=1 \{\
6747 .       nr #PAGINATION_WAS_ON 1
6748 .       rr #PAGINATE
6749 .    \}
6750 .    if \\n[#HEADERS_ON]=1 \{\
6751 .       nr #HEADERS_WERE_ON 1
6752 .       HEADERS OFF
6753 .    \}
6754 .    if \\n[#FOOTERS_ON]=1 \{\
6755 .       nr #FOOTERS_WERE_ON 1
6756 .       FOOTERS OFF
6757 .    \}
6758 .    if \\n[#COLUMNS]=1 \{\
6759 .       nr #COLUMNS_WERE_ON 1
6760 .       rr #COLUMNS
6761 .    \}
6762 .    ds PDF_BM
6763 .    ie '\\$0'DO_DOC_COVER' \{\
6764 .       ds  DOC_  DOC_
6765 .       nr #DOC_COVER_DONE 1
6766 .       if '\\*[$PDF_DOC_COVER_LABEL]'' \
6767 .          ds $PDF_DOC_COVER_LABEL Cover:
6768 .    \}
6769 .    el \{\
6770 .       if '\\*[$PDF_COVER_LABEL]'' .ds $PDF_COVER_LABEL Title Page:
6771 .    \}
6772 .    if !r#\\*[DOC_]COVER_START_POS \
6773 .       nr #\\*[DOC_]COVER_START_POS \\n[#PAGE_LENGTH]/3
6774 .    if \\n[#PRINT_STYLE]=1 \{\
6775 .       ie \\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u*2u
6776 .       el .vs \\n[#DOC_LEAD]u
6777 .    \}
6778 .    if \\n[#PRINT_STYLE]=2 \{\
6779 .       vs \\n[#DOC_LEAD]u\\*[$\\*[DOC_]COVER_LEAD_ADJ]
6780 .       nr #\\*[DOC_]COVER_LEAD \\n[#LEAD]
6781 .    \}
6782 .    if \\n[.ns] .rs
6783 .    if '\\$0'DO_COVER' \{\
6784 .       if \\n[TOC.RELOCATE]==5 \{\
6785 .          if !rTOC_BH .TOC_BEFORE_HERE
6786 .       \}
6787 .    \}
6788 .    if '\\$0'DO_DOC_COVER' \{\
6789 .       if \\n[TOC.RELOCATE]==3 \{\
6790 .          if !rTOC_BH .TOC_BEFORE_HERE
6791 .       \}
6792 .    \}
6793 .    RV_HARD_SET_MARGINS
6794 .    sp |\\n[#\\*[DOC_]COVER_START_POS]u-1v
6795 .    if \\n[#\\*[DOC_]COVER_COLOR]=1 \{\
6796 .       nf
6797 \m[\\*[$\\*[DOC_]COVER_COLOR]]
6798 .       EOL
6799 .    \}
6800 .    \\*[DOC_]COVER_H_POS
6801 .    fam \\*[$\\*[DOC_]COVER_TITLE_FAM]
6802 .    ft  \\*[$\\*[DOC_]COVER_TITLE_FT]
6803 .    ps  \\*[$\\*[DOC_]COVER_TITLE_PT_SIZE]
6804 .    ie \\n[#PRINT_STYLE]=1 \{\
6805 .       ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
6806 .       el \{ .vs \\n[#DOC_LEAD]u \}
6807 .    \}
6808 .    el .vs \\n[#\\*[DOC_]COVER_LEAD]u
6809 .    if \\n[#PRINT_STYLE]=1 .TYPEWRITER
6810 .    if \\n[#\\*[DOC_]COVER_TITLE] \{\
6811 .       nr PDFHREF.VIEW.LEADING.H \\n[PDFHREF.VIEW.LEADING]
6812 .       nr PDFHREF.VIEW.LEADING   \\n[nl]u-1v-1000u
6813 .    \}
6814 .    if \\n[#\\*[DOC_]COVER_TITLE]=1 \{\
6815 .       ie \\n[#PRINT_STYLE]=1 \{\
6816 .          CAPS
6817 .          nr #ARG_NUM 0 1
6818 .          while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6819 .             UNDERSCORE "\\*[$TITLE_\\n[#ARG_NUM]]"
6820 .             if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6821 .             as PDF_BM \\*[$TITLE_\\n[#ARG_NUM]]
6822 .          \}
6823 .          CAPS OFF
6824 .       \}
6825 .       el \{\
6826 .          nr #ARG_NUM 0 1
6827 .          while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6828 .             ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6829 .                PRINT \
6830 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6831 .             \}
6832 .             el \
6833 .                PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6834 .             if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6835 .             as PDF_BM \\*[$TITLE_\\n[#ARG_NUM]]
6836 .          \}
6837 .       \}
6838 .       PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
6839 .\" .          PDF_TITLE \\*[PDF_BM]
6840 .    \}
6841 .    if \\n[#\\*[DOC_]COVER_TITLE]=2 \{\
6842 .       ie \\n[#PRINT_STYLE]=1 \{\
6843 .          CAPS
6844 .          nr #ARG_NUM 0 1
6845 .          while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6846 .             UNDERSCORE "\\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]"
6847 .             if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6848 .             as PDF_BM \\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]
6849 .          \}
6850 .          CAPS OFF
6851 .       \}
6852 .       el \{\
6853 .          nr #ARG_NUM 0 1
6854 .          while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6855 .             ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6856 .                PRINT \
6857 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]\m[]
6858 .             \}
6859 .             el .PRINT \\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]
6860 .             if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6861 .             as PDF_BM \\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]
6862 .          \}
6863 .       \}
6864 .       PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
6865 .\" .          PDF_TITLE \\*[PDF_BM]
6866 .    \}
6867 .    if \\n[#\\*[DOC_]COVER_TITLE]=3 \{\
6868 .       ie \\n[#PRINT_STYLE]=1 \{\
6869 .          CAPS
6870 .          PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6871 .          CAPS OFF
6872 .       \}
6873 .       el \{\
6874 .          ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6875 .             PRINT \
6876 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6877 .          \}
6878 .          el .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6879 .       \}
6880 .       PDF_BOOKMARK 1 \
6881 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6882 .\" .          PDF_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6883 .    \}
6884 .    if \\n[#\\*[DOC_]COVER_TITLE]=4 \{\
6885 .       ie \\n[#PRINT_STYLE]=1 \{\
6886 .          CAPS
6887 .          nr #ARG_NUM 0 1
6888 .             ie \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u/2u
6889 .             el .vs \\n[#DOC_LEAD]u
6890 .             sp
6891 .          while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6892 .             UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
6893 .             if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6894 .             as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6895 .          \}
6896 .          CAPS OFF
6897 .          if \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u
6898 .       \}
6899 .       el \{\
6900 .          nr #ARG_NUM 0 1
6901 .          while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6902 .             ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6903 .                PRINT \
6904 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6905 .             \}
6906 .             el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6907 .             if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6908 .             as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6909 .          \}
6910 .       \}
6911 .       PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
6912 .\" .          PDF_TITLE \\*[PDF_BM]
6913 .    \}
6914 .    if \\n[#\\*[DOC_]COVER_TITLE]=5 \{\
6915 .       ie \\n[#PRINT_STYLE]=1 \{\
6916 .          CAPS
6917 .          PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6918 .          CAPS OFF
6919 .       \}
6920 .       el \{\
6921 .          ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6922 .             PRINT \
6923 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6924 .          \}
6925 .          el .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6926 .       \}
6927 .       if !'\\*[$CHAPTER_TITLE_1]'' \{\
6928 .          ie \\n[#PRINT_STYLE]=1 \{\
6929 .             ie \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u/2u
6930 .             el .vs \\n[#DOC_LEAD]u
6931 .             sp
6932 .             nr #ARG_NUM 0 1
6933 .             while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6934 .                UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
6935 .                if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6936 .                as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6937 .             \}
6938 .             if \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u
6939 .          \}
6940 .          el \{\
6941 .             fam \\*[$\\*[DOC_]COVER_CHAPTER_TITLE_FAM]
6942 .             ft  \\*[$\\*[DOC_]COVER_CHAPTER_TITLE_FT]
6943 .             ps  \\*[$\\*[DOC_]COVER_CHAPTER_TITLE_PT_SIZE]
6944 .             ALD \\n[.v]u/4u \"Put a little space before the chapter title
6945 .             nr #ARG_NUM 0 1
6946 .             while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6947 .                ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6948 .                   PRINT \
6949 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6950 .                \}
6951 .                el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6952 .                if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6953 .                as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6954 .             \}
6955 .          \}
6956 .       \}
6957 .       PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
6958 .\" .          PDF_TITLE \\*[PDF_BM]
6959 .    \}
6960 .    if \\n[#\\*[DOC_]COVER_TITLE]=6 \{\
6961 .       ie \\n[#PRINT_STYLE]=1 \{\
6962 .          CAPS
6963 .          nr #ARG_NUM 0 1
6964 .          while \\n[#\\*[DOC_]COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6965 .             UNDERSCORE "\\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]"
6966 .                if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6967 .                as PDF_BM \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]
6968 .          \}
6969 .          CAPS OFF
6970 .       \}
6971 .       el \{\
6972 .          nr #ARG_NUM 0 1
6973 .          while \\n[#\\*[DOC_]COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6974 .             ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6975 .                PRINT \
6976 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\
6977 \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]\m[]
6978 .             \}
6979 .             el .PRINT \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]
6980 .             if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6981 .             as PDF_BM \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]
6982 .          \}
6983 .       \}
6984 .       PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
6985 .\" .          PDF_TITLE \\*[PDF_BM]
6986 .    \}
6987 .    if \\n[#\\*[DOC_]COVER_TITLE] \{\
6988 .      nr PDFHREF.VIEW.LEADING \\n[PDFHREF.VIEW.LEADING.H]
6989 .      rr PDFHREF.VIEW.LEADING.H
6990 .    \}
6991 .    if !\\n[#DOC_TYPE]=2 \{\
6992 .       if \\n[#\\*[DOC_]COVER_SUBTITLE]=1 \{\
6993 .          fam \\*[$\\*[DOC_]COVER_SUBTITLE_FAM]
6994 .          ft  \\*[$\\*[DOC_]COVER_SUBTITLE_FT]
6995 .          ps  \\*[$\\*[DOC_]COVER_SUBTITLE_PT_SIZE]
6996 .          if \\n[#PRINT_STYLE]=1 \{\
6997 .             TYPEWRITER
6998 .             ie \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u/2u
6999 .             el .vs \\n[#DOC_LEAD]u
7000 .             sp
7001 .          \}
7002 .          if \\n[#\\*[DOC_]COVER]=1 \{\
7003 .             ie !'\\*[$SUBTITLE_\\*[DOC_]COVER_1]'' \{\
7004 .                nr #SUBTITLES \\n[#SUBTITLE_\\*[DOC_]COVER_NUM]
7005 .                nr #NEXT_SUBTITLE 0 1
7006 .                while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
7007 .                   ie \\n[#\\*[DOC_]COVER_SUBTITLE_COLOR]=1 \{\
7008 .                      PRINT \
7009 \m[\\*[$\\*[DOC_]COVER_SUBTITLE_COLOR]]\
7010 \\*[$SUBTITLE_\\*[DOC_]COVER_\\n+[#NEXT_SUBTITLE]]\m[]
7011 .                   \}
7012 .                   el .PRINT \
7013 \\*[$SUBTITLE_\\*[DOC_]COVER_\\n+[#NEXT_SUBTITLE]]
7014 .                \}
7015 .             \}
7016 .             el \{\
7017 .                nr #SUBTITLES \\n[#SUBTITLE_NUM]
7018 .                nr #NEXT_SUBTITLE 0 1
7019 .                while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
7020 .                   ie \\n[#\\*[DOC_]COVER_SUBTITLE_COLOR]=1 \{\
7021 .                      PRINT \
7022 \m[\\*[$\\*[DOC_]COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]]\m[]
7023 .                   \}
7024 .                   el .PRINT \\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]]
7025 .                \}
7026 .             \}
7027 .          \}
7028 .          if \\n[#PRINT_STYLE]=1 \{\
7029 .             if \\n[#SINGLE_SPACE]=0 .vs
7030 .          \}
7031 .       \}
7032 .       if \\n[#PRINT_STYLE]=1 \{\
7033 .          if !r#\\*[DOC_]COVER_SUBTITLE .sp
7034 .       \}
7035 .    \}
7036 .    if \\n[#\\*[DOC_]COVER_AUTHOR]=1 \{\
7037 .       fam \\*[$\\*[DOC_]COVER_AUTHOR_FAM]
7038 .       ft  \\*[$\\*[DOC_]COVER_AUTHOR_FT]
7039 .       ps  \\*[$\\*[DOC_]COVER_AUTHOR_PT_SIZE]
7040 .       if \\n[#PRINT_STYLE]=1 \{\
7041 .          TYPEWRITER
7042 .          ie \\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u
7043 .          el .vs \\n[#DOC_LEAD]u/2u
7044 .          sp
7045 .       \}
7046 .       ie d$ATTRIBUTE_STRING_DO_CCOVER \{\
7047 .          ie \\n[#\\*[DOC_]COVER_ATTRIBUTE_COLOR]=1 \{\
7048 .             PRINT \
7049 \&\m[\\*[$\\*[DOC_]COVER_ATTRIBUTE_COLOR]]\
7050 \\*[$ATTRIBUTE_STRING_\\*[DOC_]COVER]\m[]
7051 .          \}
7052 .          el .PRINT \&\\*[$ATTRIBUTE_STRING_\\*[DOC_]COVER]
7053 .       \}
7054 .       el \{\
7055 .          if d$ATTRIBUTE_STRING \{\
7056 .             ie \\n[#\\*[DOC_]COVER_ATTRIBUTE_COLOR]=1 \{\
7057 .                PRINT \
7058 \&\m[\\*[$\\*[DOC_]COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
7059 .             \}
7060 .             el .PRINT \&\\*[$ATTRIBUTE_STRING]
7061 .          \}
7062 .       \}
7063 .       PRINT_AUTHORS
7064 .    \}
7065 .    fam \\*[$\\*[DOC_]COVER_DOCTYPE_FAM]
7066 .    ft  \\*[$\\*[DOC_]COVER_DOCTYPE_FT]
7067 .    ps  \\*[$\\*[DOC_]COVER_DOCTYPE_PT_SIZE]
7068 .    sp
7069 .    if \\n[#DOC_TYPE]=3 \{\
7070 .       if \\n[#\\*[DOC_]COVER_DOCTYPE]=1 \{\
7071 .          ie \\n[#PRINT_STYLE]=1 \{\
7072 .             TYPEWRITER
7073 .             vs \\n[#DOC_LEAD]u
7074 .             UNDERSCORE2 "\\*[$DOC_TYPE]"
7075 .          \}
7076 .          el \{\
7077 .             nr #FROM_\\*[DOC_]COVER 1
7078 .             ie \\n[#\\*[DOC_]COVER_DOCTYPE_COLOR]=1 \{\
7079 .                COLOR \\*[$\\*[DOC_]COVER_DOCTYPE_COLOR]
7080 .                ie \\n[#\\*[DOC_]COVER_UNDERLINE]=1 \
7081 .                   UNDERSCORE \\*[$\\*[DOC_]COVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]"
7082 .                el .PRINT "\\*[$DOC_TYPE]"
7083 .             \}
7084 .             el \{\
7085 .                ie \\n[#\\*[DOC_]COVER_UNDERLINE]=1 \
7086 .                   UNDERSCORE \
7087 \\*[$\\*[DOC_]COVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]"
7088 .                el .PRINT "\\*[$DOC_TYPE]"
7089 .             \}
7090 .             rr #FROM_\\*[DOC_]COVER
7091 .          \}
7092 .       \}
7093 .    \}
7094 .    sp |\\n[#VISUAL_B_MARGIN]u
7095 .    ie \\n[#PRINT_STYLE]=1 \{\
7096 .       TYPEWRITER
7097 .       ie \\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u
7098 .       el .vs \\n[#DOC_LEAD]u/2u
7099 .       sp
7100 .    \}
7101 .    el \{\
7102 .       fam \\*[$\\*[DOC_]COVER_COPYRIGHT_FAM]
7103 .       ft  \\*[$\\*[DOC_]COVER_COPYRIGHT_FT]
7104 .       ps \\*[$\\*[DOC_]COVER_COPYRIGHT_PT_SIZE]
7105 .       vs \\n[.ps]u+\\n[#\\*[DOC_]COVER_MISC_AUTOLEAD]u
7106 .       nr #COPYRIGHT_V_ADJ \\n[#DOC_LEAD]-\\n[.v]
7107 .       sp \\n[#COPYRIGHT_V_ADJ]u
7108 .       rr #COPYRIGHT_V_ADJ
7109 .    \}
7110 .    if \\n[#\\*[DOC_]COVER_COPYRIGHT]=1 \{\
7111 .       if !'\\*[$COPYRIGHT_DOCCOVER]'' \{\
7112 .          ds $SAVED_COPYRIGHT \\*[$COPYRIGHT]
7113 .          ds $COPYRIGHT \\*[$COPYRIGHT_DOCCOVER]
7114 .       \}
7115 .       QUAD \\*[$\\*[DOC_]COVER_COPYRIGHT_QUAD]
7116 .       ie \\n[#\\*[DOC_]COVER_COPYRIGHT_COLOR]=1 \{\
7117 .          PRINT \m[\\*[$\\*[DOC_]COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
7118 .       \}
7119 .       el .PRINT \\*[$COPYRIGHT]
7120 .       if d$SAVED_COPYRIGHT .ds $COPYRIGHT \\*[$SAVED_COPYRIGHT]
7121 .    \}
7122 .    br
7123 .    if \\n[#\\*[DOC_]COVER_MISC]=1 \{\
7124 .       if \\n[#PRINT_STYLE]=2 \{\
7125 .          fam \\*[$\\*[DOC_]COVER_MISC_FAM]
7126 .          ft  \\*[$\\*[DOC_]COVER_MISC_FT]
7127 .          ps \\*[$\\*[DOC_]COVER_MISC_PT_SIZE]
7128 .       \}
7129 .       QUAD \\*[$\\*[DOC_]COVER_MISC_QUAD]
7130 .       ie !'\\*[$MISC_\\*[DOC_]COVER_1]'' \{\
7131 .          nr #MISCS \\n[#MISC_\\*[DOC_]COVER_NUM]
7132 .          nr #NEXT_MISC 0 1
7133 .          while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
7134 .             ie \\n[#\\*[DOC_]COVER_MISC_COLOR]=1 \{\
7135 .                da MISC_DIV
7136 .                PRINT \
7137 \m[\\*[$\\*[DOC_]COVER_MISC_COLOR]]\\*[$MISC_\\*[DOC_]COVER_\\n+[#NEXT_MISC]]\m[]
7138 .                br
7139 .                da
7140 .                rm $MISC_\\*[DOC_]COVER_\\n[#NEXT_MISC]
7141 .                rm $MISC_\\n[#NEXT_MISC]
7142 .             \}
7143 .             el \{\
7144 .                da MISC_DIV
7145 .                PRINT \\*[$MISC_\\*[DOC_]COVER_\\n+[#NEXT_MISC]]
7146 .                br
7147 .                da
7148 .                rm $MISC_\\*[DOC_]COVER_\\n[#NEXT_MISC]
7149 .                rm $MISC_\\n[#NEXT_MISC]
7150 .             \}
7151 .          \}
7152 .          rm $MISC_\\n+[#NEXT_MISC]
7153 .       \}
7154 .       el \{\
7155 .          nr #MISCS \\n[#MISC_NUM]
7156 .          nr #NEXT_MISC 0 1
7157 .          while (\\n[#MISCS]>=\\n+[#NEXT_MISC]) \{\
7158 .             ie \\n[#\\*[DOC_]COVER_MISC_COLOR]=1 \{\
7159 .                da MISC_DIV
7160 .                PRINT \
7161 \m[\\*[$\\*[DOC_]COVER_MISC_COLOR]]\\*[$MISC_\\n[#NEXT_MISC]]\m[]
7162 .                br
7163 .                da
7164 .             \}
7165 .             el \{\
7166 .                da MISC_DIV
7167 .                PRINT \\*[$MISC_\\n[#NEXT_MISC]]
7168 .                br
7169 .                da
7170 .             \}
7171 .             nr #MISC_DEPTH +\\n[dn]
7172 .          \}
7173 .       \}
7174 .       nr #MISC_DEPTH -\\n[#DOC_LEAD]
7175 .       sp |\\n[#VISUAL_B_MARGIN]u-\\n[#MISC_DEPTH]u
7176 .       nf
7177 .       MISC_DIV
7178 .       rm MISC_DIV
7179 .       rr #MISC_DEPTH
7180 .    \}
7181 .    if '\\$0'DO_COVER'     .nr #COVER_END 1
7182 .    if '\\$0'DO_DOC_COVER' .nr #DOC_COVER_END 1
7183 .    if \\n[TOC.RELOCATE]==1 \{\
7184 .       if !\\n[#COVER_BLANKPAGE] \
7185 .          if !rTOC_BH .TOC_AFTER_HERE
7186 .    \}
7187 .    if '\\$0'DO_COVER' \{\
7188 .       if \\n[TOC.RELOCATE]==6 \
7189 .          if !rTOC_BH .TOC_AFTER_HERE
7190 .    \}
7191 .    if '\\$0'DO_DOC_COVER' \{\
7192 .       if \\n[TOC.RELOCATE]==4 \
7193 .          if !rTOC_BH .TOC_AFTER_HERE
7194 .    \}
7195 .    if '\\$0'DO_DOC_COVER' .rm DOC_
7196 .    END_COVER
7197 .END
7198 \#
7199 \# Macro to terminate (doc)cover processing
7200 \#
7201 .MAC END_COVER END
7202 .    EOL
7203 .    TRAP
7204 .    NEWPAGE
7205 .    if \\n[#PAGINATION_WAS_ON]=1 .nr % +1
7206 .    if \\n[#DOC_COVER_END]=1 \{\
7207 .       ie \\n[#DOC_COVER_BLANKPAGE]=1 \{\
7208 .          if \\n[TOC.RELOCATE] \
7209 .             if !\\n[#TOC_BH] .TOC_AFTER_HERE
7210 .          NEWPAGE
7211 .          rr #DOC_COVER_BLANKPAGE
7212 .          if !\\n[#DOCCOVERS_COUNT]=1 .nr % -2
7213 .       \}
7214 .       el \
7215 .          if !\\n[#DOCCOVERS_COUNT]=1 .nr #PAGE_NUM_ADJ -1
7216 .       rr #DOC_COVER_END
7217 .    \}
7218 .    if \\n[#COVER_END]=1 \{\
7219 .       ie \\n[#COVER_BLANKPAGE]=1 \{\
7220 .          if \\n[TOC.RELOCATE] \
7221 .             if !\\n[TOC_BH] .TOC_AFTER_HERE
7222 .          NEWPAGE
7223 .          rr #COVER_BLANKPAGE
7224 .          if !\\n[#COVERS_COUNT]=1 .nr % -2
7225 .       \}
7226 .       el \
7227 .          if !\\n[#COVERS_COUNT]=1 .nr #PAGE_NUM_ADJ -1
7228 .       rr #COVER_END
7229 .    \}
7230 .    if !'\\n[.ev]'0' .ev
7231 .    if \\n[#PAGINATION_WAS_ON] \{\
7232 .       rr #PAGINATION_WAS_ON
7233 .       PAGINATE
7234 .       PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]-1
7235 .    \}
7236 .    if \\n[#HEADERS_WERE_ON] \{\
7237 .       rr #HEADERS_WERE_ON
7238 .       HEADERS
7239 .    \}
7240 .    if \\n[#FOOTERS_WERE_ON] \{\
7241 .       rr #FOOTERS_WERE_ON
7242 .       FOOTERS
7243 .    \}
7244 .    if \\n[#COLUMNS_WERE_ON]=1 \{\
7245 .       rr #COLUMNS_WERE_ON 1
7246 .       nr #COLUMNS 1
7247 .    \}
7248 .    rr #DOING_COVER
7249 .    if \\n[.ns] .nop \&
7250 .    if \\n[#RECTO_VERSO] .nr #RV_POST_COVER 1
7251 .END
7252 \#
7253 \# Macro to begin document processing
7254 \#
7255 .MAC START END
7256 .    nr #DOCS 1
7257 .    if \\n[TOC.RELOCATE]==2 \{\
7258 .       if !\\n[TOC_BH] .TOC_BEFORE_HERE
7259 .    \}
7260 .    if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
7261 .    if !\\n[#PRINT_STYLE] \{\
7262 .       PRINTSTYLE TYPEWRITE
7263 .       PRINT \&
7264 .       po 6P
7265 .       ll 39P
7266 .       ta \\n[.l]u
7267 .       sp |1i-1v
7268 .       CENTER
7269 .       PRINT "You neglected to enter a PRINTSTYLE"
7270 .       fl
7271 .       ab [mom]: PRINTSTYLE missing.  Aborting '\\n[.F]'.
7272 .    \}
7273 .    if \\n[#LINENUMBERS]=1 \{\
7274 .       nn
7275 .       NUMBER_LINES OFF
7276 .       nr #LINENUMBERS 2
7277 .    \}
7278 .    if \\n[#COLLATE] \{\
7279 .       COPYSTYLE \\*[$COPY_STYLE]
7280 .       nr #HEADERS_ON \\n[#HEADER_STATE]
7281 .       if \\n[#PAGE_NUM_V_POS]=1 .nr #PAGINATE \\n[#PAGINATION_STATE]
7282 .       PRINT \&
7283 .       if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
7284 .          PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
7285 .          rm $RESTORE_PAGENUM_STYLE
7286 .       \}
7287 .    \}
7288 .    DEFAULTS
7289 .    nr #PAGE_TOP \\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
7290 .    rr #RESET_TRAPS
7291 .    if !r#EN_Q_AUTOLEAD  .nr #EN_Q_LEAD \\n[#EN_LEAD]
7292 .    if !r#EN_BQ_AUTOLEAD .nr #EN_BQ_LEAD \\n[#EN_LEAD]
7293 .\"  TOC/recto-verso stuff
7294 .    if !r@L_MARGIN .nr @L_MARGIN \\n[#DOC_L_MARGIN]
7295 .    if !r@R_MARGIN .nr @R_MARGIN \\n[#DOC_R_MARGIN]
7296 .\" Covers and doc covers
7297 .    if \\n[#DOC_COVERS]=1 \{\
7298 .       if \\n[#DOC_COVER]=1 \{\
7299 .          DO_DOC_COVER
7300 .          rr #DOC_COVER
7301 .          rr #DOC_COVER_TITLE
7302 .          rr #DOC_COVER_SUBTITLE
7303 .          rr #DOC_COVER_AUTHOR
7304 .          rr #DOC_COVER_DOCTYPE
7305 .          rr #DOC_COVER_COPYRIGHT
7306 .          rr #DOC_COVER_MISC
7307 .       \}
7308 .    \}
7309 .    if \\n[#COVERS]=1 \{\
7310 .       if \\n[#COVER]=1 \{\
7311 .          DO_COVER
7312 .          rr #COVER
7313 .          rr #COVER_TITLE
7314 .          rr #COVER_SUBTITLE
7315 .          rr #COVER_AUTHOR
7316 .          rr #COVER_DOCTYPE
7317 .          rr #COVER_COPYRIGHT
7318 .          rr #COVER_MISC
7319 .       \}
7320 .    \}
7321 .    if !\\n[#TOC] .RV_HARD_SET_MARGINS
7322 .    if \\n[#COLUMNS] .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u
7323 .\" Collect TITLE for TOC.
7324 .    if !\\n[#TOC]=1 \{\
7325 .       nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7326 .       af #TOC_ENTRY_PN \\g[#PAGENUMBER]
7327 .       ie \\n[#USER_SET_TITLE_ITEM] \{\
7328 .          ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]
7329 .          rr #USER_SET_TITLE_ITEM
7330 .          rm $USER_SET_TITLE_ITEM
7331 .       \}
7332 .       el \{\
7333 .          ie \\n[#DOC_TYPE]=2 \{\
7334 .             ie '\\*[$CHAPTER_TITLE]'' \
7335 .                ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]
7336 .             el \{\
7337 .                ie '\\*[$CHAPTER]'' \
7338 .                   ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]
7339 .                el \
7340 .                   ds $TOC_TITLE_ITEM \
7341 \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]
7342 .             \}
7343 .          \}
7344 .          el \
7345 .             ds $TOC_TITLE_ITEM \\*[$TITLE]
7346 .       \}
7347 .       if \\n[#TOC_AUTHORS]=1 \{\
7348 .          ie '\\*[$TOC_AUTHORS]'' \
7349 .             as $TOC_TITLE_ITEM / \\*[$AUTHOR_1]
7350 .          el \{\
7351 .             as $TOC_TITLE_ITEM / \\*[$TOC_AUTHORS]
7352 .             rm $TOC_AUTHORS
7353 .          \}
7354 .       \}
7355 .       sp |\\n[#DOCHEADER_ADVANCE]u-\\n[#DOC_LEAD]u
7356 .       PDF_BOOKMARK 1 \\*[$TOC_TITLE_ITEM]
7357 .       as $TOC_TITLE_ITEM \|
7358 .       if \\n[#PREFIX_CH_NUM] \{\
7359 .          rn $TOC_TITLE_ITEM $TOC_TITLE_ITEM_OLD
7360 .          ds $TOC_CH_NUM \\n[#CH_NUM].\[toc-hd-num-spacer]
7361 .          ds $TOC_TITLE_ITEM \\*[$TOC_CH_NUM]\\*[$TOC_TITLE_ITEM_OLD]
7362 .          rm $TOC_TITLE_ITEM_OLD
7363 .       \}
7364 .       TITLE_TO_TOC
7365 .    \}
7366 .    if !\\n[#TOC] .nr #POST_TOP 1
7367 .\" End TITLE collection
7368 .    if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
7369 .       br
7370 .       sp |\\n[#HEADER_MARGIN]u
7371 .       PRINT_PAGE_NUMBER
7372 .    \}
7373 .    rr #COLLATE
7374 .    rr #PAGINATION_STATE
7375 .\" End collate stuff
7376 .    ie \\n[#DOC_HEADER]=0 \{\
7377 .       if \\n[.ns] .rs
7378 .       if \\n[#DOC_TYPE]=4 \
7379 .          if !'\\n[.z]'' .di
7380 .       nr #STORED_PP_INDENT \\n[#PP_INDENT]
7381 .       PARA_INDENT 0
7382 .       PP
7383 .       PARA_INDENT \\n[#STORED_PP_INDENT]u
7384 .       rr #STORED_PP_INDENT
7385 .       ie r#ADVANCE_FROM_TOP \{\
7386 .          br
7387 .          sp |\\n[#ADVANCE_FROM_TOP]u-1v
7388 .          if \\n[#ADJ_DOC_LEAD]=1 .SHIM
7389 .       \}
7390 .       el \{\
7391 .          br
7392 .          sp |\\n[#T_MARGIN]u-1v
7393 .       \}
7394 .       if \\n[#COLUMNS] \{\
7395 .          mk dc
7396 .          nr #COL_NUM 0 1
7397 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7398 .          nr #L_MARGIN \\n[.o]
7399 .          ll \\n[#COL_L_LENGTH]u
7400 .       \}
7401 .       nr #PP 0
7402 .    \}
7403 .    el \{\
7404 .       if \\n[#AUTO_LEAD] .nr #RESTORE_AUTO_LEAD 1
7405 .       if \\n[#PRINT_STYLE]=2 .vs \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ]
7406 .       if \\n[#RESTORE_AUTO_LEAD] \{\
7407 .          nr #AUTO_LEAD 1
7408 .          nr #AUTOLEAD_VALUE  \\n[#SAVED_AUTOLEAD_VALUE]
7409 .       \}
7410 .       nr #DOCHEADER_LEAD \\n[#LEAD]
7411 .\" Default doctype
7412 .       if \\n[#DOC_TYPE]=1 \{\
7413 .          if \\n[.ns] .rs
7414 .          ev DOCHEADER
7415 .          if \\n[#DOCHEADER_COLOR]=1 \{\
7416 .             nf
7417 \m[\\*[$DOCHEADER_COLOR]]
7418 .             EOL
7419 .          \}
7420 .          L_MARGIN \\n[#DOC_L_MARGIN]u
7421 .          LL       \\n[#DOC_L_LENGTH]u
7422 .          ta \\n[.l]u
7423 .          if \\n[#PRINT_STYLE]=1 \{\
7424 .             DOC_HEADER_QUAD
7425 .             TYPEWRITER
7426 .             if !\\n[#SINGLE_SPACE] \{\
7427 .                vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u)
7428 .                sp |\\n[#T_MARGIN]u-1v
7429 .             \}
7430 .             if !'\\*[$TITLE_1]'' \{\
7431 .                CAPS
7432 .                nr #ARG_NUM 0 1
7433 .                while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7434 .                   UNDERSCORE 3p "\\*[$TITLE_\\n[#ARG_NUM]]"
7435 .                \}
7436 .                CAPS OFF
7437 .             \}
7438 .             if !'\\*[$SUBTITLE]'' \{\
7439 .                sp
7440 .                nr #ARG_NUM 0 1
7441 .                while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7442 .                   UNDERSCORE 3p "\\*[$SUBTITLE_\\n[#ARG_NUM]]"
7443 .                \}
7444 .             \}
7445 .             if !'\\*[$AUTHOR_1]'' \{\
7446 .                sp
7447 .                PRINT \&\\*[$ATTRIBUTE_STRING]
7448 .                nr #AUTHORS \\n[#AUTHOR_NUM]
7449 .                nr #NEXT_AUTHOR 0 1
7450 .                if !\\n[#SINGLE_SPACE] .vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u)
7451 .                while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
7452 .                   PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
7453 .                \}
7454 .             \}
7455 .          \}
7456 .          if \\n[#PRINT_STYLE]=2 \{\
7457 .             DEFAULT_DOCHEADER
7458 .          \}
7459 .          ev
7460 .       \}
7461 .\" Chapter doctype
7462 .       if \\n[#DOC_TYPE]=2 \{\
7463 .          if \\n[.ns] .rs
7464 .          ev DOCHEADER
7465 .          if \\n[#DOCHEADER_COLOR]=1 \{\
7466 .             nf
7467 \m[\\*[$DOCHEADER_COLOR]]
7468 .             EOL
7469 .          \}
7470 .          L_MARGIN \\n[#DOC_L_MARGIN]u
7471 .          LL       \\n[#DOC_L_LENGTH]u
7472 .          ta \\n[.l]u
7473 .          if \\n[#PRINT_STYLE]=1 \{\
7474 .             CENTER
7475 .             TYPEWRITER
7476 .             if !\\n[#SINGLE_SPACE] \{\
7477 .                vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u)
7478 .                sp |\\n[#T_MARGIN]u-1v
7479 .             \}
7480 .             ie '\\*[$CHAPTER]'' \{\
7481 .                CAPS
7482 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
7483 .                   nr #ARG_NUM 0 1
7484 .                   while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7485 .                      UNDERSCORE 3p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7486 .                   \}
7487 .                \}
7488 .                el \{\
7489 .                   CAPS
7490 .                   UNDERSCORE 3p "\\*[$CHAPTER_STRING]"
7491 .                \}
7492 .                CAPS OFF
7493 .                RLD 1v
7494 .             \}
7495 .             el \{\
7496 .                CAPS
7497 .                PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
7498 .                CAPS OFF
7499 .                if !'\\*[$CHAPTER_TITLE]'' \{\
7500 .                   sp
7501 .                   nr #ARG_NUM 0 1
7502 .                   while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7503 .                      UNDERSCORE 3p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7504 .                   \}
7505 .                \}
7506 .                RLD 1v
7507 .             \}
7508 .             vs \\n[#DOC_LEAD]u
7509 .             if \\n[#SINGLE_SPACE] .sp 2
7510 .          \}
7511 .          if \\n[#PRINT_STYLE]=2 \{\
7512 .             CHAPTER_DOCHEADER
7513 .             di DOCHEADER_DIVERSION \" This diversion is only
7514 .             br                     \" necessary to find the depth of the
7515 .             CHAPTER_DOCHEADER      \" docheader
7516 .             br
7517 .             di
7518 .             nr #DOCHEADER_DEPTH \\n[dn]-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
7519 .                                                              \" in #DOCHEADER_DEPTH
7520 .             rm DOCHEADER_DIVERSION                           \" Removing the diversion macro
7521 .          \}
7522 .          ev
7523 .       \}
7524 .\" Named
7525 .       if \\n[#DOC_TYPE]=3 \{\
7526 .          if \\n[.ns] .rs
7527 .          ev DOCHEADER
7528 .          if \\n[#DOCHEADER_COLOR]=1 \{\
7529 .             nf
7530 \m[\\*[$DOCHEADER_COLOR]]
7531 .             EOL
7532 .          \}
7533 .          L_MARGIN \\n[#DOC_L_MARGIN]u
7534 .          LL       \\n[#DOC_L_LENGTH]u
7535 .          ta \\n[.l]u
7536 .          if \\n[#PRINT_STYLE]=1 \{\
7537 .             CENTER
7538 .             TYPEWRITER
7539 .             if !\\n[#SINGLE_SPACE] \{\
7540 .                vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u)
7541 .                sp |\\n[#T_MARGIN]u-1v
7542 .             \}
7543 .             if !'\\*[$TITLE_1]'' \{\
7544 .                CAPS
7545 .                nr #ARG_NUM 0 1
7546 .                while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7547 .                   UNDERSCORE 3p "\\*[$TITLE_\\n[#ARG_NUM]]"
7548 .                \}
7549 .                CAPS OFF
7550 .             \}
7551 .             if !'\\*[$SUBTITLE]'' \{\
7552 .                sp
7553 .                nr #ARG_NUM 0 1
7554 .                while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7555 .                   UNDERSCORE 3p "\\*[$SUBTITLE_\\n[#ARG_NUM]]"
7556 .                \}
7557 .             \}
7558 .             if !'\\*[$AUTHOR_1]'' \{\
7559 .                sp
7560 .                PRINT \&\\*[$ATTRIBUTE_STRING]
7561 .                nr #AUTHORS \\n[#AUTHOR_NUM]
7562 .                nr #NEXT_AUTHOR 0 1
7563 .                if !\\n[#SINGLE_SPACE] .vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u)
7564 .                while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
7565 .                   PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
7566 .                \}
7567 .             \}
7568 .             ie !\\n[#SINGLE_SPACE] .sp 2
7569 .             el .sp
7570 .             ie \\n[#DOCTYPE_UNDERLINE] \{\
7571 .             UNDERSCORE2 3p "\\*[$DOC_TYPE]"
7572 .             \}
7573 .             el \
7574 .                PRINT "\\*[$DOC_TYPE]"
7575 .             if \\n[#SINGLE_SPACE]=1 .sp
7576 .          \}
7577 .          if \\n[#PRINT_STYLE]=2 .NAMED_DOCHEADER
7578 .          ev
7579 .       \}
7580 .       if !\\n[#DOC_TYPE]=4 \{\
7581 .          if \\n[#PRINT_STYLE]=1 .sp
7582 .          if \\n[#PRINT_STYLE]=2 .sp \\n[#DOC_LEAD]u*2u
7583 .          if \\n[#COLUMNS] \{\
7584 .             nr #COL_NUM 0 1
7585 .             nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
7586 .             ie \\n[#RV_POST_COVER] \{\
7587 .                nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#DOC_L_MARGIN]
7588 .                po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
7589 .                nr #L_MARGIN \\n[.o]
7590 .                rr #RV_POST_COVER
7591 .             \}
7592 .             el \{\
7593 .                po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7594 .                nr #L_MARGIN \\n[.o]
7595 .             \}
7596 .             LL \\n[#COL_L_LENGTH]u
7597 .             ta \\n[.l]u
7598 .          \}
7599 .       \}
7600 .    \}
7601 .    vs \\n[#DOC_LEAD]u
7602 .    if \\n[#ADJ_DOC_LEAD]=1 \{\
7603 .       ie \\n[#ADVANCE_FROM_TOP]=0 \
7604 .          if \\n[#DOC_HEADER]=1 .SHIM
7605 .       el .rr #ADVANCE_FROM_TOP
7606 .    \}
7607 .    mk dc
7608 .    QUAD \\*[$DOC_QUAD]
7609 .    CLEANUP_DEFAULTS
7610 .    nr #START_FOR_FOOTERS 1
7611 .    if !\\n[#DOC_TYPE]=4 .em TERMINATE
7612 .    if \\n[#LINENUMBERS]=2 \{\
7613 .       NUMBER_LINES RESUME
7614 .       nr #LINENUMBERS 1
7615 .    \}
7616 .    if \\n[#RUN_ON]=1 \{\
7617 .       if \\n[#FN_MARKER_STYLE]=1 .RUNON_WARNING
7618 .       if \\n[#FN_MARKER_STYLE]=2 .RUNON_WARNING
7619 .    \}
7620 .END
7621 \#
7622 .MAC CLEANUP_DEFAULTS END
7623 .    nr #START 1
7624 .    if \\n[#DOC_HEADER]=1 .nr #DOC_HEADER 2
7625 .    rm $TOC_TITLE_ITEM
7626 .    rr #MISC_NUM
7627 .    rr #MISCS
7628 .    rr #NEXT_AUTHOR
7629 .    rr #NEXT_MISC
7630 .END
7631 \#
7632 \# ====================================================================
7633 \#
7634 \# +++MACROS TO CHANGE SOME DEFAULTS+++
7635 \#
7636 \# DOCUMENT HEADER
7637 \# ---------------
7638 \# *Argument:
7639 \#   <none> | <anything> [distance to advance from top of page]
7640 \# *Function:
7641 \#   Turns printing of document header on or off.  If a second
7642 \#   numeric argument with units of measure is given, advances that
7643 \#   distance from the top of the page without printing the document
7644 \#   header.
7645 \# *Notes:
7646 \#   Default is on.  If the 1st argument is <anything> (which turns
7647 \#   document headers off), the optional 2nd argument may be given
7648 \#   (with a unit of measure).
7649 \#
7650 .MAC DOCHEADER END
7651 .    ie '\\$1'' .nr #DOC_HEADER 1
7652 .    el \{\
7653 .       if !'\\$2'' .nr #ADVANCE_FROM_TOP (\\$2)
7654 .       nr #DOC_HEADER 0
7655 .    \}
7656 .END
7657 \#
7658 \# DOCUMENT HEADER LEADING
7659 \# -----------------------
7660 \# *Arguments:
7661 \#   <+|- amount by which to in/decrease leading of doc header>
7662 \# *Function:
7663 \#   Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
7664 \# *Notes:
7665 \#   A unit of measure must be supplied.  Decimal fractions OK.
7666 \#   Default is +0, i.e. same as DOC_LEAD.
7667 \#
7668 .MAC DOCHEADER_LEAD END
7669 .    ds $DOCHEADER_LEAD_ADJ \\$1
7670 .END
7671 \#
7672 \# DOCHEADER ADVANCE
7673 \# -----------------
7674 \# *Arguments:
7675 \#   <docheader start position>
7676 \# *Function:
7677 \#   Creates register #DOCHEADER_ADVANCE, used in START.
7678 \# *Notes:
7679 \#   Unit of measure required.
7680 \#   Default is same as T_MARGIN.
7681 \#
7682 .MAC DOCHEADER_ADVANCE END
7683 .    nr #DOCHEADER_ADVANCE \\$1
7684 .END
7685 \#
7686 \# DOCUMENT LEFT MARGIN
7687 \# --------------------
7688 \# *Argument:
7689 \#   <left margin of document>
7690 \# *Function:
7691 \#   Creates or modifies register #DOC_L_MARGIN.
7692 \# *Notes:
7693 \#   Affects everything on the page.
7694 \#
7695 .MAC DOC_LEFT_MARGIN END
7696 .    if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
7697 .    br
7698 .    nr #DOC_L_MARGIN (\\$1)
7699 .    L_MARGIN \\n[#DOC_L_MARGIN]u
7700 .END
7701 \#
7702 \# DOCUMENT RIGHT MARGIN
7703 \# ---------------------
7704 \# *Argument:
7705 \#   <right margin of document>
7706 \# *Function:
7707 \#   Creates or modifies register #DOC_R_MARGIN.
7708 \# *Notes:
7709 \#   Affects everything on the page.
7710 \#
7711 .MAC DOC_RIGHT_MARGIN END
7712 .    br
7713 .    nr #DOC_R_MARGIN (\\$1)
7714 .    R_MARGIN \\n[#DOC_R_MARGIN]
7715 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
7716 .END
7717 \#
7718 \# DOCUMENT LINE LENGTH
7719 \# --------------------
7720 \# *Argument:
7721 \#   <line length of document>
7722 \# *Function:
7723 \#   Creates or modifies register #DOC_L_LENGTH.
7724 \# *Notes:
7725 \#   Affects everything on the page.
7726 \#
7727 .MAC DOC_LINE_LENGTH END
7728 .    if !\\n[DOCS] .DOC_MACRO_ERROR \\$0
7729 .    br
7730 .    nr #DOC_L_LENGTH (\\$1)
7731 .    LL \\n[#DOC_L_LENGTH]u
7732 .    ta \\n[.l]u
7733 .END
7734 \#
7735 \# DOCUMENT FAMILY
7736 \# ---------------
7737 \# *Argument:
7738 \#   <family of running text>
7739 \# *Function:
7740 \#   Creates or modifies string $DOC_FAM.
7741 \# *Notes:
7742 \#   Affects everything except headers and footers.
7743 \#
7744 .MAC DOC_FAMILY END
7745 .    if !\\n[DOCS] .DOC_MACRO_ERROR \\$0
7746 .    br
7747 .    ds $DOC_FAM \\$1
7748 .    ds $FAMILY  \\*[$DOC_FAM]
7749 .    AUTHOR_FAMILY     \\*[$DOC_FAM]
7750 .    BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
7751 .    DOCHEADER_FAMILY  \\*[$DOC_FAM]
7752 .    DOCTYPE_FAMILY    \\*[$DOC_FAM]
7753 .    EPIGRAPH_FAMILY   \\*[$DOC_FAM]
7754 .    FOOTNOTE_FAMILY   \\*[$DOC_FAM]
7755 .    HDRFTR_FAMILY     \\*[$DOC_FAM]
7756 .    LINENUMBER_FAMILY \\*[$DOC_FAM]
7757 .    QUOTE_FAMILY      \\*[$DOC_FAM]
7758 .    SUBTITLE_FAMILY   \\*[$DOC_FAM]
7759 .    TITLE_FAMILY      \\*[$DOC_FAM]
7760 .END
7761 \#
7762 \# DOCUMENT POINT SIZE
7763 \# -------------------
7764 \# *Argument:
7765 \#   <point size of running text>
7766 \# *Function:
7767 \#   Creates or modifies register #DOC_PT_SIZE.
7768 \# *Notes:
7769 \#   DOC_PT_SIZE is the basis for calculating all type sizes in
7770 \#   a document.  Ignored if PRINTSTYLE TYPEWRITE.
7771 \#
7772 .ALIAS DOC_PT_SIZE PT_SIZE
7773 \#
7774 \# DOCUMENT LEAD
7775 \# -------------
7776 \# *Argument:
7777 \#   <lead (".vs") of running text> [ADJUST]
7778 \# *Function:
7779 \#   Creates or modifies register #DOC_LEAD.  If the optional
7780 \#   ADJUST argument is given, adjusts leading so that the last
7781 \#   line of text falls exactly on #B_MARGIN.
7782 \# *Notes:
7783 \#   DOC_LEAD is the basis for calculating all leading changes in
7784 \#   a document.  Default for TYPESET is 16; 24 for TYPEWRITE.
7785 \#
7786 \#   Because the visible bottom or footer margin of a page depends
7787 \#   on the overall document lead supplied by the register #DOC_LEAD,
7788 \#   DOC_LEAD, in the body of a document, should always be associated
7789 \#   with the start of a new page (in other words, just before or
7790 \#   just after a manual NEWPAGE).  Ignored if PRINTSTYLE TYPEWRITE.
7791 \#
7792 .MAC DOC_LEAD END
7793 .    if \\n[#IGNORE] .return
7794 .    if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
7795 .    br
7796 .    if '\\$0'DOC_LEAD' \{\
7797 .       vs \\$1
7798 .       rr #DOC_AUTOLEAD
7799 .       rr #DOC_AUTOLEAD_FACTOR
7800 .       nr #DOC_LEAD \\n[.v]
7801 .    \}
7802 .    nr #RESET_TRAPS 1
7803 .    if !\\n[#ADJ_DOC_LEAD] .nr #REMOVE_ADJ 1
7804 .    if !'\\$0'DOC_LEAD' \{\
7805 .       if '\\$0'EN_LEAD' .nr #DOC_LEAD \\n[#EN_LEAD]
7806 .       if '\\$0'BIB_LEAD' .nr #DOC_LEAD \\n[#BIB_LEAD]
7807 .       if '\\$0'TOC_LEAD' .nr #DOC_LEAD \\n[#TOC_LEAD]
7808 .       if '\\$2'ADJUST' .TRAPS
7809 .       rr #RESET_TRAPS
7810 .    \}
7811 .END
7812 \#
7813 \# ADJUST DOCUMENT LEAD
7814 \# --------------------
7815 \# *Arguments:
7816 \#   <none> | <anything>
7817 \# *Function:
7818 \#   Adjusts document lead so that the last line of text falls exactly
7819 \#   on #B_MARGIN.
7820 \#
7821 .MAC DOC_LEAD_ADJUST END
7822 .    ie '\\$1'' \{\
7823 .       nr #ADJ_DOC_LEAD 1
7824 .       rr #DOC_LEAD_ADJUST_OFF
7825 .    \}
7826 .    el \{\
7827 .       nr #ADJ_DOC_LEAD 0
7828 .       nr #DOC_LEAD_ADJUST_OFF 1
7829 .    \}
7830 .END
7831 \#
7832 \# SHIM
7833 \# ----
7834 \# *Argument:
7835 \#   None
7836 \# *Function:
7837 \#   Advances to the next "valid" baseline.
7838 \# *Notes:
7839 \#   If a user plays around with spacing in a doc (say, with ALD),
7840 \#   it isn't easy to get mom back on track so she can achieve
7841 \#   perfectly flush bottom margins.  Any time SHIM is used, it
7842 \#   ensures that the next output line falls on a valid baseline.
7843 \#
7844 \# First, a little convenience macro
7845 \#
7846 .MAC PROCESS_SHIM END
7847 .    while \\n+[#VALID_BASELINE]<\\n[#CURRENT_V_POS] \{\
7848 .
7849 .    \}
7850 .    nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
7851 .END
7852 \#
7853 \# And a macro to disable SHIM
7854 \#
7855 .MAC NO_SHIM END
7856 .    ie '\\$1'' .nr #NO_SHIM 1
7857 .    el .rr #NO_SHIM
7858 .END
7859 \#
7860 .nr #NO_SHIM 2 \" Restored to 1 in DEFAULTS.
7861 \#
7862 .MAC SHIM END
7863 .    ie \\n[#NO_SHIM] .return
7864 .    el \{\
7865 .       nr #VALID_BASELINE \\n[#T_MARGIN]-\\n[#DOC_LEAD] \\n[#DOC_LEAD]
7866 .       if !r#CURRENT_V_POS .nr #CURRENT_V_POS \\n[.d]
7867 .       ie \\n[#ADVANCE_FROM_TOP] \{\
7868 .          ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
7869 .             while \\n-[#VALID_BASELINE]>\\n[#CURRENT_V_POS] .
7870 .             nr #VALID_BASELINE +\\n[#DOC_LEAD]
7871 .             nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
7872 .          \}
7873 .          el .PROCESS_SHIM
7874 .       \}
7875 .       el .PROCESS_SHIM
7876 '       sp \\n[#SHIM]u
7877 .       rr #CURRENT_V_POS
7878 .    \}
7879 .END
7880 \#
7881 \# ====================================================================
7882 \#
7883 \# +++INTERNATIONALIZATION+++
7884 \#
7885 \# ATTRIBUTE STRING
7886 \# ----------------
7887 \# *Argument:
7888 \#   <what goes in the "by" slot before author in the document header>
7889 \# *Function:
7890 \#   Creates or modifies string $ATTRIBUTE_STRING.
7891 \# *Notes:
7892 \#   Default is "by".  A blank string ("") may be used if no
7893 \#   attribution is desired.  Blank line results.
7894 \#
7895 .MAC ATTRIBUTE_STRING END
7896 .    if !'\\$1'DOC_COVER' \
7897 .       if !'\\$1'COVER' .nr #NEITHER 1
7898 .    if !'\\$1'COVER' \
7899 .       if !'\\$1'DOC_COVER' .nr #NEITHER 1
7900 .    if '\\$1'DOC_COVER' \
7901 .       ds $ATTRIBUTE_STRING_DOC_COVER \\$2
7902 .    if '\\$1'COVER' \
7903 .       ds $ATTRIBUTE_STRING_COVER \\$2
7904 .    if \\n[#NEITHER]=1 \{\
7905 .       ds $ATTRIBUTE_STRING \\$1
7906 .       rr #NEITHER
7907 .    \}
7908 .END
7909 \#
7910 \# CHAPTER STRING
7911 \# --------------
7912 \# *Argument:
7913 \#   <what to print any time the word "chapter" is required>
7914 \# *Function:
7915 \#   Creates or modifies string $CHAPTER_STRING.
7916 \# *Notes:
7917 \#   Default is "chapter".
7918 \#
7919 .MAC CHAPTER_STRING END
7920 .    ds $CHAPTER_STRING \\$1
7921 .END
7922 \#
7923 \# DRAFT STRING
7924 \# ------------
7925 \# *Argument:
7926 \#   <what to print any time the word "draft" is required>
7927 \# *Function:
7928 \#   Creates or modifies string $DRAFT_STRING.
7929 \# *Notes:
7930 \#   Default is "draft".
7931 \#
7932 .MAC DRAFT_STRING END
7933 .    ds $DRAFT_STRING \\$1
7934 .END
7935 \#
7936 \# REVISION STRING
7937 \# ---------------
7938 \# *Argument:
7939 \#   <what to print any time the word "revision" is required>
7940 \# *Function:
7941 \#   Creates or modifies string $REVISION_STRING.
7942 \# *Notes:
7943 \#   Default is "revision".
7944 \#
7945 .MAC REVISION_STRING END
7946 .    ds $REVISION_STRING \\$1
7947 .END
7948 \#
7949 \# FINIS STRING
7950 \# ------------
7951 \# *Argument:
7952 \#   <what to print with the finis macro>
7953 \# *Function:
7954 \#   Creates or modifies string $FINIS_STRING.
7955 \# *Notes:
7956 \#   Default is "END".
7957 \#
7958 .MAC FINIS_STRING END
7959 .    ds $FINIS_STRING \\$1
7960 .END
7961 \#
7962 .MAC FINIS_STRING_CAPS END
7963 .    ie '\\$1'' .nr #FINIS_STRING_CAPS 1
7964 .    el .nr #FINIS_STRING_CAPS 0
7965 .END
7966 \#
7967 \# ====================================================================
7968 \#
7969 \# +++RECTO/VERSO+++
7970 \#
7971 \# RECTO_VERSO
7972 \# -----------
7973 \# *Arguments:
7974 \#   <none> | <anything>
7975 \# *Function:
7976 \#   Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages.  Also
7977 \#   switches page numbers left and right if either is chosen rather
7978 \#   than the default centered page numbers.  Switches left and right
7979 \#   margins if differing values have been entered.
7980 \# *Notes:
7981 \#   Default is OFF.
7982 \#
7983 .MAC RECTO_VERSO END
7984 .    ie '\\$1'' .nr #RECTO_VERSO 1
7985 .    el .nr #RECTO_VERSO 0
7986 .END
7987 \#
7988 \# FORCE RECTO
7989 \# -----------
7990 \# *Function:
7991 \#   Forces doccover and cover pages to recto
7992 \#
7993 .MAC RV_HARD_SET_MARGINS END
7994 .    DOC_LEFT_MARGIN  \\n[@L_MARGIN]u
7995 .    DOC_RIGHT_MARGIN \\n[@R_MARGIN]u
7996 .    po \\n[#DOC_L_MARGIN]u
7997 .    LL \\n[#DOC_L_LENGTH]u
7998 .END
7999 \#
8000 \# ====================================================================
8001 \#
8002 \# +++EPIGRAPHS+++
8003 \#
8004 \# EPIGRAPH INDENT
8005 \# ---------------
8006 \# *Argument:
8007 \#   <value by which to multiply PP_INDENT for block epigraphs>
8008 \# *Function:
8009 \#   Creates or modifies register #EPI_OFFSET_VALUE.
8010 \# *Notes:
8011 \#   Default is 2 for TYPEWRITE, 3 for TYPESET.
8012 \#
8013 .MAC EPIGRAPH_INDENT END
8014 .    rr #EPI_OFFSET_VALUE
8015 .    rm $EPI_OFFSET_VALUE
8016 .    ds $EVAL_EI_ARG \\$1
8017 .    substring $EVAL_EI_ARG -1
8018 .    ie \B'\\*[$EVAL_EI_ARG]' .nr #EPI_OFFSET_VALUE \\$1
8019 .    el .ds $EPI_OFFSET_VALUE \\$1
8020 .    rm $EVAL_EI_ARG
8021 .END
8022 \#
8023 \# EPIGRAPH AUTOLEAD
8024 \# -----------------
8025 \# *Argument:
8026 \#   <amount of lead to add to the epigraph ps for epigraph leading>
8027 \# *Function:
8028 \#   Creates or modifies register #EPI_AUTOLEAD.
8029 \# *Notes:
8030 \#   Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
8031 \#
8032 .MAC EPIGRAPH_AUTOLEAD END
8033 .    nr #EPI_AUTOLEAD (p;\\$1)
8034 .END
8035 \#
8036 \# EPIGRAPH
8037 \# --------
8038 \# *Arguments:
8039 \#   BLOCK | <anything>
8040 \# *Function:
8041 \#   Places an epigraph before the document's text, after the
8042 \#   document header, or after a HEAD.
8043 \# *Notes:
8044 \#   #EPIGRAPH 1 = centered; 2 = block
8045 \#
8046 \#   By default, epigraphs are centered, allowing the user
8047 \#   to input them on a line per line basis.  To change this
8048 \#   behaviour, the user can supply the argument BLOCK, which
8049 \#   will produce indented, filled text similar to BLOCKQUOTE.
8050 \#
8051 \#   If a block epigraph contains more than one para, ALL paras of
8052 \#   the epigraph must be preceded by PP.  Otherwise, PP is optional.
8053 \#
8054 .MAC EPIGRAPH END
8055 .    nr #PP_STYLE 2
8056 .    nr #Q_PP     0
8057 .    if \\n[#LINENUMBERS]=1 \{\
8058 .       NUMBER_LINES OFF
8059 .       nr #LINENUMBERS 2
8060 .    \}
8061 .    if \\n[#START] \{\
8062 .       if \\n[#PRINT_STYLE]=1 \
8063 .          if \\n[#AUTHOR_LINES]=1 .sp \\n[#DOC_LEAD]u
8064 .    \}
8065 .    ie '\\$1'' \{\
8066 .       nr #EPIGRAPH 1
8067 .       ev EPIGRAPH
8068 .       nr #IN_DIVER 1
8069 .       ll \\n[#L_LENGTH]u
8070 .       ta \\n[.l]u
8071 .       CHECK_INDENT
8072 .       if \\n[#COLUMNS] \{\
8073 .          ie \\n[#START] \{\
8074 .              ll \\n[#DOC_L_LENGTH]u
8075 .              ta \\n[.l]u
8076 .          \}
8077 .          el \{\
8078 .             ll \\n[#COL_L_LENGTH]u
8079 .             ta \\n[.l]u
8080 .          \}
8081 .       \}
8082 .       CENTER
8083 .       if \\n[#PRINT_STYLE]=1 \{\
8084 .          fam \\*[$TYPEWRITER_FAM]
8085 .          ft  R
8086 .          if '\\*[$EPI_FT]'I' .FT I
8087 .          ps  \\*[$TYPEWRITER_PS]
8088 .          ie \\n[#SINGLE_SPACE] .vs \\n[#DOC_LEAD]u
8089 .          el .vs \\n[#DOC_LEAD]u/2u
8090 .          nr #EPI_LEAD      \\n[#LEAD]
8091 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8092 .       \}
8093 .       if \\n[#PRINT_STYLE]=2 \{\
8094 .          FAMILY   \\*[$EPI_FAM]
8095 .          FT       \\*[$EPI_FT]
8096 .          ps  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
8097 .          if \\n[#EPI_COLOR]=1 \{\
8098 .             nf
8099 \m[\\*[$EPI_COLOR]]
8100 .             EOL
8101 .          \}
8102 .          vs \\n[.ps]u+\\n[#EPI_AUTOLEAD]u
8103 .          nr #EPI_LEAD      \\n[#LEAD]
8104 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8105 .       \}
8106 .       di EPI_TEXT
8107 .       nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
8108 .       HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
8109 .       hy 14
8110 .       nr #EPI_ACTIVE 1
8111 .    \}
8112 .    el \{\
8113 .       ie '\\$1'BLOCK' \{\
8114 .          nr #EPIGRAPH 2
8115 .          ev EPIGRAPH
8116 .          evc 0
8117 .          ie \\n[#START] \{\
8118 .             ie \\n[#COLUMNS] \{\
8119 .                ie r#EPI_OFFSET_VALUE \
8120 .                   ll \
8121 \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8122 .                el \
8123 .                   ll \
8124 \\n[#L_LENGTH_FOR_EPI]u-(\\*[$EPI_OFFSET_VALUE]u*2u)
8125 .                ta \\n[.l]u
8126 .             \}
8127 .             el \{\
8128 .                ie r#EPI_OFFSET_VALUE \
8129 .                   ll \
8130 \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8131 .                el \
8132 .                   ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8133 .                ta \\n[.l]u
8134 .             \}
8135 .          \}
8136 .          el \{\
8137 .             ie r#EPI_OFFSET_VALUE \
8138 .                ll \
8139 \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8140 .             el \
8141 .                ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8142 .             ta \\n[.l]u
8143 .             if \\n[#COLUMNS] \{\
8144 .                ie r#EPI_OFFSET_VALUE \
8145 .                   ll \
8146 \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8147 .                el \
8148 .                   ll \\n[#COL_L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8149 .                ta \\n[.l]u
8150 .             \}
8151 .             CHECK_INDENT
8152 .          \}
8153 .          if \\n[#PRINT_STYLE]=1 \{\
8154 .             fam \\*[$TYPEWRITER_FAM]
8155 .             ft  R
8156 .             if '\\*[$EPI_FT]'I' .FT I
8157 .             ps  \\*[$TYPEWRITER_PS]
8158 .             ie \\n[#SINGLE_SPACE] .vs \\n[#DOC_LEAD]u
8159 .             el .vs \\n[#DOC_LEAD]u/2u
8160 .             QUAD LEFT
8161 .             HY OFF
8162 .             nr #EPI_LEAD \\n[#LEAD]
8163 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8164 .             di EPI_TEXT
8165 .             nr #EPI_ACTIVE 1
8166 .          \}
8167 .          if \\n[#PRINT_STYLE]=2 \{\
8168 .             FAMILY   \\*[$EPI_FAM]
8169 .             FT       \\*[$EPI_FT]
8170 .             ps  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
8171 .             if \\n[#EPI_COLOR]=1 \{\
8172 .                nf
8173 \m[\\*[$EPI_COLOR]]
8174 .                EOL
8175 .             \}
8176 .             vs \\n[.ps]u+\\n[#EPI_AUTOLEAD]u
8177 .             QUAD     \\*[$EPI_QUAD]
8178 .             nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
8179 .             HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
8180 .             hy 14
8181 .             nr #EPI_LEAD \\n[#LEAD]
8182 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8183 .             di EPI_TEXT
8184 .             nr #EPI_ACTIVE 1
8185 .          \}
8186 .       \}
8187 .       el .DO_EPIGRAPH
8188 .    \}
8189 .END
8190 \#
8191 \# DO EPIGRAPH
8192 \# -----------
8193 \# *Arguments:
8194 \#   <none>
8195 \# *Function:
8196 \#   Ends diversion started in EPIGRAPH.  Makes spacing
8197 \#   adjustments to compensate for the difference between epigraph
8198 \#   leading and overall document leading, so that the bottom of
8199 \#   the pages remain flush.
8200 \# *Notes:
8201 \#   In addition to its usual place at the beginning of a
8202 \#   document, EPIGRAPH may also be used after HEAD.
8203 \#
8204 .MAC DO_EPIGRAPH END
8205 .    br
8206 .    di
8207 .    rr #IN_DIVER
8208 .    if \\n[#RESET_FN_COUNTERS]=2 \{\
8209 .       if !\\n[#FN_COUNT]=1 \{\
8210 .          if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
8211 .             DIVER_FN_2_POST
8212 .             rr #RESET_FN_COUNTERS
8213 .          \}
8214 .       \}
8215 .    \}
8216 .    nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
8217 .    nr #DONE_ONCE 0 1
8218 .    REMOVE_INDENT
8219 .    ev
8220 .    nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
8221 .    nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
8222 .    ie \\n[#START] \{\
8223 .       RLD \\n[#SHIM]u
8224 .       nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
8225 .       while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8226 .          nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8227 .       \}
8228 .       if \\n[#PRINT_STYLE]=1 \
8229 .          if !\\n[#SINGLE_SPACE]=1 .ALD \\n[#DOC_LEAD]u
8230 .       if \\n[#PRINT_STYLE]=2 \{\
8231 .          ie !\\n[#DOC_TYPE]=2 .RLD \\n[#DOC_LEAD]u
8232 .          el \{\
8233 .             ie '\\*[$CHAPTER_TITLE]'' .RLD \\n[#DOC_LEAD]u
8234 .             el .if '\\*[$CHAPTER]''   .RLD \\n[#DOC_LEAD]u
8235 .          \}
8236 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
8237 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
8238 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
8239 .             ALD \
8240 \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8241 .       \}
8242 .    \}
8243 .    el \{\
8244 .       ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
8245 .          nr #EPI_FITS 1
8246 .          nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
8247 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8248 .             nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8249 .          \}
8250 .          ie \\n[#PRINT_STYLE]=1 \{\
8251 .             if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \
8252 .                ALD \\n[#EPI_WHITESPACE]u/2u
8253 .          \}
8254 .          el \{\
8255 .             if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
8256 .                ALD \
8257 \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
8258 .             if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
8259 .                ALD \
8260 \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8261 .          \}
8262 .          if \\n[#DIVER_FN]=2 .rr #DIVER_FN
8263 .       \}
8264 .       el \{\
8265 .          nr #EPI_LINES_TO_TRAP 0 1
8266 .          while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\
8267 .             nr #LOOP 1
8268 .          \}
8269 .          nr #EPI_LINES_TO_TRAP -1
8270 .          nr #EPI_WHITESPACE \
8271 (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
8272 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8273 .             nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8274 .          \}
8275 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
8276 .             ALD \\n[#EPI_WHITESPACE]u
8277 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
8278 .             ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u
8279 .       \}
8280 .    \}
8281 .    if \\n[#EPIGRAPH]=1 \{\
8282 .       po \\n[#L_MARGIN]u
8283 .       if \\n[#COLUMNS] \{\
8284 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8285 .          nr #L_MARGIN \\n[.o]
8286 .       \}
8287 .    \}
8288 .    if \\n[#EPIGRAPH]=2 \{\
8289 .       ie \\n[#EPI_OFFSET_VALUE] \
8290 .          nr #EPI_OFFSET \
8291 \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
8292 .       el .nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
8293 .       if \\n[#COLUMNS] \{\
8294 .          ie r#EPI_OFFSET_VALUE \
8295 .             nr #EPI_OFFSET \
8296 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
8297 .          el .nr #EPI_OFFSET \
8298 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
8299 .       \}
8300 .       po \\n[#EPI_OFFSET]u
8301 .    \}
8302 .    nf
8303 .    EPI_TEXT
8304 .    br
8305 .    ie \\n[#START] \{\
8306 .       if \\n[#PRINT_STYLE]=1 .SHIM
8307 .       if \\n[#PRINT_STYLE]=2 \{\
8308 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
8309 .             ALD \\n[#EPI_WHITESPACE]u/2u
8310 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
8311 .             ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8312 .          SHIM
8313 .       \}
8314 .    \}
8315 .    el \{\
8316 .       rr #EPI_ACTIVE
8317 .       ie \\n[#EPI_FITS] \{\
8318 .          ie \\n[#FN_FOR_EPI] \{\
8319 .             nr #EPI_LINES_TO_END 1
8320 .             nr #EPI_WHITESPACE \
8321 (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
8322 .             while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8323 .                nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8324 .             \}
8325 .             ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
8326 .          \}
8327 .          el \{\
8328 .             ie \\n[#PRINT_STYLE]=1 \{\
8329 .                if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \
8330 .                   ALD \\n[#EPI_WHITESPACE]u
8331 .             \}
8332 .             el \{\
8333 .                if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
8334 .                   ALD \\n[#EPI_WHITESPACE]u/2u
8335 .                if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
8336 .                   ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8337 .             \}
8338 .          \}
8339 .       \}
8340 .       el \{\
8341 .          nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
8342 .          if \\n[#LOOP] .nr #EPI_LINES_TO_END +1
8343 .          rr #LOOP
8344 .          nr #EPI_WHITESPACE \
8345 (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
8346 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8347 .             nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8348 .          \}
8349 .          ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
8350 .          if \\n[#PRINT_STYLE]=1 \{\
8351 .             if !\\n[#SINGLE_SPACE] \{\
8352 .                nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
8353 .                ie \\n[#EPI_LINES_EVEN] .ALD .5v
8354 .                el .RLD .5v
8355 .                rr #EPI_LINES_EVEN
8356 .             \}
8357 .          \}
8358 .       \}
8359 .    \}
8360 .    nr #PP_STYLE 1
8361 .    rr #EPI_FITS
8362 .    ALD \\n[#DOC_LEAD]u
8363 .    QUAD \\*[$DOC_QUAD]
8364 .    po \\n[#L_MARGIN]u
8365 .    if \\n[#COLUMNS] \{\
8366 .       po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8367 .       nr #L_MARGIN \\n[.o]
8368 .    \}
8369 .    if \\n[#START] \{\
8370 .       if \\n[#COLUMNS] \{\
8371 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8372 .          nr #L_MARGIN \\n[.o]
8373 .          mk dc
8374 .       \}
8375 .    \}
8376 .    if \\n[#LINENUMBERS]=2 \{\
8377 .       NUMBER_LINES RESUME
8378 .       nr #LINENUMBERS 1
8379 .    \}
8380 .END
8381 \#
8382 \# ====================================================================
8383 \#
8384 \# +++FINIS MACRO+++
8385 \#
8386 \# FINIS
8387 \# -----
8388 \# *Arguments:
8389 \#   <none>
8390 \# *Function:
8391 \#   Deposits --END-- at the end of a document.
8392 \#
8393 .MAC FINIS END
8394 .    if !\\n[@TOP] \{\
8395 .       if \\n[.t]<=2v \{\
8396 .          tm1 "[mom]: '\\n[.F]': Insufficient room to print \\$0 on last page.
8397 .          return
8398 .       \}
8399 .    \}
8400 .    br
8401 .    ev FINIS
8402 .    evc 0
8403 .    if \\n[#TAB_ACTIVE] .TQ
8404 .    if \\n[#INDENT_ACTIVE] .IQ CLEAR
8405 .    nr #EM_ADJUST (1m/8)
8406 .    if \\n[#COLUMNS] \{\
8407 .       po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8408 .       nr #L_MARGIN \\n[.o]
8409 .    \}
8410 .    ALD \\n[#DOC_LEAD]u
8411 .    CENTER
8412 .    if \\n[#FINIS_STRING_CAPS]=1 .CAPS
8413 .    if \\n[#PRINT_STYLE]=1 .PRINT "--\\*[$FINIS_STRING]--
8414 .    if \\n[#PRINT_STYLE]=2 \{\
8415 .       ie \\n[#FINIS_COLOR] \
8416 .          PRINT \
8417 \m[\\*[$FINIS_COLOR]]\v'-\\n[#EM_ADJUST]u'\[em]\v'+\\n[#EM_ADJUST]u'\
8418 \\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\[em]\m[]\c
8419 .       el .PRINT \
8420 \v'-\\n[#EM_ADJUST]u'\[em]\v'+\\n[#EM_ADJUST]u'\
8421 \\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\[em]\m[]\c
8422 .    \}
8423 .    EL
8424 .    if \\n[#FINIS_STRING_CAPS]=1 .CAPS OFF
8425 .    ev
8426 .    pdfsync
8427 .END
8428 \#
8429 \# ====================================================================
8430 \#
8431 \# +++HEADERS/FOOTERS+++
8432 \#
8433 \# Define a string so that the current page number can be incorporated
8434 \# into the strings for hdrftr left, right, and center.  NOTE: This is
8435 \# not the same thing as using the shortform # in hdrftr strings.
8436 \#
8437 .ds PAGE# \En[#PAGENUMBER]
8438 \#
8439 .MAC RESTORE_SPACE END
8440 .   vpt 0
8441 .   rs
8442 .   nop \&
8443 .   sp -1
8444 .   ch RR_@TOP
8445 .   rr @TOP
8446 .   vpt
8447 .END
8448 \#
8449 \# HDRFTR RULE GAP
8450 \# ---------------
8451 \# *Argument:
8452 \#   <amount of space between header/footer and header/footer rule>
8453 \# *Function:
8454 \#   Creates or modifies register #HDRFTR_RULE_GAP to hold amount
8455 \#   of space between header/footer and header/footer rule.
8456 \# *Notes:
8457 \#   Default is 4p.
8458 \#
8459 .MAC HDRFTR_RULE_GAP END
8460 .    nr #HDRFTR_RULE_GAP (\\$1)
8461 .    if '\\$0'HEADER_RULE_GAP' \{\
8462 .       nr #HEADER_RULE_GAP \\n[#HDRFTR_RULE_GAP]
8463 .       if r #FOOTER_RULE_GAP .nr #FOOTER_RULE_GAP \\n[#FOOTER_RULE_GAP]
8464 .    \}
8465 .    if '\\$0'FOOTER_RULE_GAP' \{\
8466 .       nr #FOOTER_RULE_GAP \\n[#HDRFTR_RULE_GAP]
8467 .       if r #HEADER_RULE_GAP .nr #HEADER_RULE_GAP \\n[#HEADER_RULE_GAP]
8468 .    \}
8469 .END
8470 \#
8471 \# HDRFTR LEFT
8472 \# -----------
8473 \# *Argument:
8474 \#   <what to put in the left position of page header/footers>
8475 \# *Function:
8476 \#   Creates or modifies string $HDRFTR_LEFT.
8477 \#   Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
8478 \#   overrides the $HDRFTR_LEFT string created by default
8479 \#   in DEFAULTS.
8480 \# *Notes:
8481 \#   Especially useful if doc has more than one author, and a list
8482 \#   of authors by last name is desired in header/footers.
8483 \#   Default is author.
8484 \#
8485 \#   If the argument is the # character, simply prints the current
8486 \#   page number.
8487 \#
8488 \#   If the user wants to incorporate the page number into the string,
8489 \#   \*[PAGE#] must be used.  For example, if the user wants to put
8490 \#   an elipsis before the page number in the string, s/he should use
8491 \#   ...\*[PAGE#], not ...#
8492 \#
8493 .MAC HDRFTR_LEFT END
8494 .    nr #USER_DEF_HDRFTR_LEFT 1
8495 .    ds $HDRFTR_LEFT \\$1
8496 .END
8497 \#
8498 \# HDRFTR LEFT CAPS
8499 \# ----------------
8500 \# *Argument:
8501 \#   <none> | <anything>
8502 \# *Function:
8503 \#   Turns capitalisation of $HDRFTR_LEFT (typically, the author of
8504 \#   the document) on or off.
8505 \# *Notes:
8506 \#   Default is on.
8507 \#
8508 .MAC HDRFTR_LEFT_CAPS END
8509 .    ie '\\$1'' .nr #HDRFTR_LEFT_CAPS 1
8510 .    el \{\
8511 .       nr #HDRFTR_LEFT_CAPS 0
8512 .       ds $HDRFTR_LEFT_SIZE_CHANGE +0
8513 .    \}
8514 .END
8515 \#
8516 \# HDRFTR CENTER
8517 \# -------------
8518 \# *Argument:
8519 \#   <what to put in the centre position of page header/footers>
8520 \# *Function:
8521 \#   Creates or modifies string $HDRFTR_CENTER.
8522 \#   Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
8523 \#   overrides the $HDRFTR_CENTER string created by default
8524 \#   in COPYSTYLE.
8525 \# *Notes:
8526 \#   Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
8527 \#   CHAPTER, draft and revision number if COPYSTYLE DRAFT.
8528 \#
8529 \#   If the argument is the # character, simply prints the current
8530 \#   page number.
8531 \#
8532 \#   If the user wants to incorporate the page number into the string,
8533 \#   \*[PAGE#] must be used.  For example, if the user wants to put
8534 \#   an elipsis before the page number in the string, s/he should use
8535 \#   ...\*[PAGE#], not ...#
8536 \#
8537 .MAC HDRFTR_CENTER END
8538 .    nr #USER_DEF_HDRFTR_CENTER 1
8539 .    if '\\$0'FOOTER_CENTER' \{\
8540 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
8541 .       ds $HDRFTR_CENTER_NEW \\$1
8542 .    \}
8543 .    if '\\$0'FOOTER_CENTRE' \{\
8544 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
8545 .       ds $HDRFTR_CENTER_NEW \\$1
8546 .    \}
8547 .    ds $HDRFTR_CENTER \\$1
8548 .END
8549 \#
8550 \# HDRFTR CENTER CAPS
8551 \# ------------------
8552 \# *Argument:
8553 \#   <none> | <anything>
8554 \# *Function:
8555 \#   Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
8556 \#   the document) on or off.
8557 \# *Notes:
8558 \#   Default is on.
8559 \#
8560 .MAC HDRFTR_CENTER_CAPS END
8561 .    ie '\\$1'' .nr #HDRFTR_CENTER_CAPS 1
8562 .    el \{\
8563 .       nr #HDRFTR_CENTER_CAPS 0
8564 .       ds $HDRFTR_CENTER_SIZE_CHANGE +0
8565 .    \}
8566 .END
8567 \#
8568 \# HDRFTR CENTER PADDING
8569 \# ---------------------
8570 \# *Argument:
8571 \#   LEFT | RIGHT <amount of padding to put left or right of hdrftr
8572 \#   center string>
8573 \# *Function:
8574 \#   Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
8575 \#   #HDRFTR_CTR_PAD_RIGHT.
8576 \# *Notes:
8577 \#   By default, the HDRFTR_CENTER string is centered on the doc
8578 \#   line length.  Long titles or long author names can screw up
8579 \#   visual centering, or create overprints.  This macro allows the
8580 \#   user to pad the center string by the specified amount of space
8581 \#   to fix these problems.
8582 \#
8583 \#   A unit of measure is required.
8584 \#
8585 .MAC HDRFTR_CENTER_PAD END
8586 .    if '\\$1'LEFT'  .nr #HDRFTR_CTR_PAD_LEFT (\\$2)
8587 .    if '\\$1'RIGHT' .nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
8588 .END
8589 \#
8590 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
8591 \# --------------------------------
8592 \# *Argument:
8593 \#   <none>
8594 \# *Function:
8595 \#   Switches the padding side of hdrftr center padding.
8596 \# *Notes:
8597 \#   Required to keep spacing around hdrftr string constant
8598 \#   in recto/verso documents.
8599 \#
8600 .MAC SWITCH_HDRFTR_CENTER_PAD END
8601 .    nr #HDRFTR_CTR_PAD_TMP  \\n[#HDRFTR_CTR_PAD_LEFT]
8602 .    HDRFTR_CENTER_PAD LEFT  \\n[#HDRFTR_CTR_PAD_RIGHT]u
8603 .    HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
8604 .END
8605 \#
8606 \# HDRFTR RIGHT
8607 \# ------------
8608 \# *Argument:
8609 \#   <what to put in the right position of page header/footers>
8610 \# *Function:
8611 \#   Creates or modifies string $HDRFTR_RIGHT.
8612 \#   Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
8613 \#   overrides the $HDRFTR_RIGHT string created by default
8614 \#   in DEFAULTS.
8615 \# *Notes:
8616 \#   Default is document title.
8617 \#
8618 \#   If the argument is the # character, simply prints the current
8619 \#   page number.
8620 \#
8621 \#   If the user wants to incorporate the page number into the string,
8622 \#   \*[PAGE#] must be used.  For example, if the user wants to put
8623 \#   an elipsis before the page number in the string, s/he should use
8624 \#   ...\*[PAGE#], not ...#
8625 \#
8626 .MAC HDRFTR_RIGHT END
8627 .    nr #USER_DEF_HDRFTR_RIGHT 1
8628 .    ds $HDRFTR_RIGHT \\$1
8629 .END
8630 \#
8631 \# HDRFTR RIGHT CAPS
8632 \# -----------------
8633 \# *Argument:
8634 \#   <none> | <anything>
8635 \# *Function:
8636 \#   Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
8637 \#   the document) on or off.
8638 \# *Notes:
8639 \#   Default is on.
8640 \#
8641 .MAC HDRFTR_RIGHT_CAPS END
8642 .    ie '\\$1'' .nr #HDRFTR_RIGHT_CAPS 1
8643 .    el \{\
8644 .       nr #HDRFTR_RIGHT_CAPS 0
8645 .       ds $HDRFTR_RIGHT_SIZE_CHANGE +0
8646 .    \}
8647 .END
8648 \#
8649 \# HDRFTR RULE
8650 \# -----------
8651 \# *Arguments:
8652 \#   <none> | <anything>
8653 \# *Function:
8654 \#   If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
8655 \#   under the header/over the footer.  Otherwise, turns HDRFTR_RULE
8656 \#   on or off.
8657 \#
8658 .MAC HDRFTR_RULE END
8659 .    if r #HEADERS_ON \
8660 .       if \\n[#HEADERS_ON]=1 .nr #HDRFTR_RULE_GAP \\n[#HEADER_RULE_GAP]
8661 .    if r #FOOTERS_ON \
8662 .       if \\n[#FOOTERS_ON]=1 .nr #HDRFTR_RULE_GAP \\n[#FOOTER_RULE_GAP]
8663 .    if '\\$0'HDRFTR_RULE_INTERNAL' \{\
8664 .       ie \\n[#USERDEF_HDRFTR] \{\
8665 .          nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
8666 .          if \\n[#HEADERS_ON] \{\
8667 .             rt \\n[y]u
8668 .             ALD \\n[#HDRFTR_RULE_GAP]u
8669 .             nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT]
8670 .             nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ]
8671 .          \}
8672 .          if \\n[#FOOTERS_ON] \{\
8673 .             rt \\n[y]u
8674 .             RLD \
8675 \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u
8676 .             nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT]
8677 .             nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ]
8678 .          \}
8679 .          ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
8680 \m[\\*[$HDRFTR_RULE_COLOR]]\
8681 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8682 \h'|0'\
8683 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8684 \D'l \\n[#DOC_L_LENGTH]u 0'\
8685 \D't \\n[#RULE_WEIGHT]u'\
8686 \h'-\\n[#RULE_WEIGHT]u'\
8687 \m[]
8688 .          \}
8689 .          el \{\
8690 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8691 \h'|0'\
8692 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8693 \D'l \\n[#DOC_L_LENGTH]u 0'\
8694 \D't \\n[#RULE_WEIGHT]u'\
8695 \h'-\\n[#RULE_WEIGHT]u'
8696 .          \}
8697 .          br
8698 .       \}
8699 .       el \{\
8700 .          if \\n[#PRINT_STYLE]=1 .nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
8701 .          if \\n[#PRINT_STYLE]=2 \{\
8702 .             ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \
8703 .                nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
8704 .             el .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT]
8705 .             ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \
8706 .                nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
8707 .             el .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT]
8708 .          \}
8709 .          if \\n[#HEADERS_ON] \{\
8710 .             rt \\n[y]u
8711 .             ALD \\n[#HDRFTR_RULE_GAP]u
8712 .             nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT]
8713 .             nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ]
8714 .          \}
8715 .          if \\n[#FOOTERS_ON] \{\
8716 .             rt \\n[y]u
8717 .             RLD \
8718 \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u
8719 .             nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT]
8720 .             nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ]
8721 .          \}
8722 .          ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
8723 \m[\\*[$HDRFTR_RULE_COLOR]]\
8724 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8725 \h'|0'\
8726 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8727 \D'l \\n[#DOC_L_LENGTH]u 0'\
8728 \D't \\n[#RULE_WEIGHT]u'\
8729 \h'-\\n[#RULE_WEIGHT]u'\
8730 \m[]
8731 .          \}
8732 .          el \{\
8733 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8734 \h'|0'\
8735 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8736 \D'l \\n[#DOC_L_LENGTH]u 0'\
8737 \D't \\n[#RULE_WEIGHT]u'\
8738 \h'-\\n[#RULE_WEIGHT]u'
8739 .          \}
8740 .          br
8741 .       \}
8742 .    \}
8743 .    if '\\$0'HEADER_RULE' \{\
8744 .       ie '\\$1'' \{\
8745 .          nr #HEADER_RULE 1
8746 .          nr #HDRFTR_RULE 1
8747 .       \}
8748 .       el \{\
8749 .          nr #HEADER_RULE 0
8750 .          nr #HDRFTR_RULE 0
8751 .       \}
8752 .    \}
8753 .    if '\\$0'FOOTER_RULE' \{\
8754 .       ie '\\$1'' \{\
8755 .          nr #FOOTER_RULE 1
8756 .          nr #HDRFTR_RULE 1
8757 .       \}
8758 .       el \{\
8759 .          nr #FOOTER_RULE 0
8760 .          nr #HDRFTR_RULE 0
8761 .       \}
8762 .    \}
8763 .    if '\\$0'HDRFTR_RULE' \{\
8764 .       ie '\\$1'' .nr #HDRFTR_RULE 1
8765 .       el .nr #HDRFTR_RULE 0
8766 .    \}
8767 .END
8768 \#
8769 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
8770 \#
8771 \# HDRFTR PLAIN
8772 \# ------------
8773 \# *Arguments:
8774 \#   <none>
8775 \# *Function:
8776 \#   Sets the family, font, and point size of all strings in
8777 \#   header/footers to the same family and point size as running
8778 \#   text.  Font for the header/footer becomes roman throughout.
8779 \#
8780 .MAC HDRFTR_PLAIN END
8781 .    HDRFTR_FAMILY        \\*[$DOC_FAM]
8782 .    HDRFTR_PT_SIZE       \\n[#DOC_PT_SIZE]
8783 .    HDRFTR_LEFT_FAMILY   \\*[$DOC_FAM]
8784 .    HDRFTR_LEFT_FONT     R
8785 .    HDRFTR_LEFT_SIZE     +0
8786 .    HDRFTR_LEFT_CAPS     OFF
8787 .    HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
8788 .    HDRFTR_CENTER_FONT   R
8789 .    HDRFTR_CENTER_SIZE   +0
8790 .    HDRFTR_CENTER_CAPS   OFF
8791 .    HDRFTR_RIGHT_FAMILY  \\*[$DOC_FAM]
8792 .    HDRFTR_RIGHT_FONT    R
8793 .    HDRFTR_RIGHT_SIZE    +0
8794 .    HDRFTR_RIGHT_CAPS    OFF
8795 .END
8796 \#
8797 \# SWITCH HDRFTR
8798 \# -------------
8799 \# *Arguments:
8800 \#   <none> | <anything>
8801 \# *Function:
8802 \#   Creates or modifies register #SWITCH_HDRFTR, used to switch
8803 \#   default location of HDRFTR_LEFT and HDRFTR_RIGHT.
8804 \# *Notes:
8805 \#   Default is OFF.
8806 \#
8807 \# Typically, the author string appears at the left of header/footers,
8808 \# and the title string appears at the right.  This switches the
8809 \# location of the two.  Useful in conjunction with RECTO_VERSO to tweak
8810 \# switches on alternate pages to come out as the user wishes.  The
8811 \# assumption of RECTO_VERSO is that the first page of the document
8812 \# (recto) is odd, and even though it has no header/footer, if it did
8813 \# have one, it would print as AUTHOR...CENTER...TITLE (or whatever
8814 \# strings the user has supplied for HDRFTR_LEFT/RIGHT), meaning that
8815 \# the next page, which does have a header/footer, will come out as
8816 \# TITLE...CENTER...AUTHOR (or whatever strings the user has supplied
8817 \# for HDRFTR_LEFT/RIGHT).  SWITCH_HDRFTRS allows the user to get the
8818 \# desired string in the desired place on the desired recto/verso page.
8819 \#
8820 .MAC SWITCH_HDRFTR END
8821 .    ie '\\$1'' .nr #SWITCH_HDRFTR 1
8822 .    el .nr #SWITCH_HDRFTR 0
8823 .END
8824 \#
8825 \# USER DEFINED HDRFTR RECTO
8826 \# -------------------------
8827 \# *Arguments:
8828 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
8829 \# *Function:
8830 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
8831 \#   stores string in $USERDEF_HDRFTR_RECTO.
8832 \# *Notes:
8833 \#   For use when users don't want 3-part headers/footers, but rather
8834 \#   want to design their own headers/footers and need different
8835 \#   headers/footers on recto and verso pages.  Using just
8836 \#   HEADER_RECTO, even when recto/verso is not on, allows users to
8837 \#   design their own headers/footers for doc pages.
8838 \#
8839 .MAC HDRFTR_RECTO END
8840 .    nr #USERDEF_HDRFTR 1
8841 .    if '\\$1'L'      .nr #USERDEF_HDRFTR_RECTO_QUAD 1
8842 .    if '\\$1'LEFT'   .nr #USERDEF_HDRFTR_RECTO_QUAD 1
8843 .    if '\\$1'C'      .nr #USERDEF_HDRFTR_RECTO_QUAD 2
8844 .    if '\\$1'CENTER' .nr #USERDEF_HDRFTR_RECTO_QUAD 2
8845 .    if '\\$1'CENTRE' .nr #USERDEF_HDRFTR_RECTO_QUAD 2
8846 .    if '\\$1'R'      .nr #USERDEF_HDRFTR_RECTO_QUAD 3
8847 .    if '\\$1'RIGHT'  .nr #USERDEF_HDRFTR_RECTO_QUAD 3
8848 .    shift
8849 .    ie '\\$1'CAPS' \{\
8850 .       nr #HDRFTR_RECTO_CAPS 1
8851 .       ds $USERDEF_HDRFTR_RECTO \\$2
8852 .    \}
8853 .    el .ds $USERDEF_HDRFTR_RECTO \\$1
8854 .END
8855 \#
8856 \# USER DEFINED HDRFTR VERSO
8857 \# -------------------------
8858 \# *Arguments:
8859 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
8860 \# *Function:
8861 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
8862 \#   stores string in $USERDEF_HDRFTR_VERSO.
8863 \# *Notes:
8864 \#   For use when users don't want 3-part headers/footers, but rather
8865 \#   want to design their own headers/footers and need different
8866 \#   headers/footers on recto and verso pages.
8867 \#
8868 .MAC HDRFTR_VERSO END
8869 .    nr #USERDEF_HDRFTR 1
8870 .    if '\\$1'L'      .nr #USERDEF_HDRFTR_VERSO_QUAD 1
8871 .    if '\\$1'LEFT'   .nr #USERDEF_HDRFTR_VERSO_QUAD 1
8872 .    if '\\$1'C'      .nr #USERDEF_HDRFTR_VERSO_QUAD 2
8873 .    if '\\$1'CENTER' .nr #USERDEF_HDRFTR_VERSO_QUAD 2
8874 .    if '\\$1'CENTRE' .nr #USERDEF_HDRFTR_VERSO_QUAD 2
8875 .    if '\\$1'R'      .nr #USERDEF_HDRFTR_VERSO_QUAD 3
8876 .    if '\\$1'RIGHT'  .nr #USERDEF_HDRFTR_VERSO_QUAD 3
8877 .    shift
8878 .    ie '\\$1'CAPS' \{\
8879 .       nr #HDRFTR_VERSO_CAPS 1
8880 .       ds $USERDEF_HDRFTR_VERSO \\$2
8881 .    \}
8882 .    el .ds $USERDEF_HDRFTR_VERSO \\$1
8883 .END
8884 \#
8885 \# PRINT FOOTER ON FIRST PAGE
8886 \# --------------------------
8887 \# *Arguments:
8888 \#   <none> | <anything>
8889 \# *Function:
8890 \#   Toggles register #PRINT_FOOTER_ON_PAGE_1
8891 \# *Notes:
8892 \#   Lets user choose whether to print footer on first
8893 \#   page of doc.
8894 \#
8895 .MAC FOOTER_ON_FIRST_PAGE END
8896 .    ie '\\$1'' .nr #PRINT_FOOTER_ON_PAGE_1 1
8897 .    el .rr #PRINT_FOOTER_ON_PAGE_1
8898 .END
8899 \#
8900 \# PRINT PAGE NUMBER ON FIRST PAGE
8901 \# -------------------------------
8902 \# *Arguments:
8903 \#   <none> | <anything>
8904 \# *Function:
8905 \#   Toggles register #PRINT_PAGENUM_ON_PAGE_1
8906 \# *Notes:
8907 \#   Lets user choose whether to print page number on first
8908 \#   page of doc and after collate when footers are on or page numbering
8909 \#   has been user set at top of page.
8910 \#
8911 .MAC PAGENUM_ON_FIRST_PAGE END
8912 .    ie '\\$1'' .nr #PRINT_PAGENUM_ON_PAGE_1 1
8913 .    el .rr #PRINT_PAGENUM_ON_PAGE_1
8914 .END
8915 \#
8916 \# PRINT HEADER/FOOTER
8917 \# -------------------
8918 \# *Arguments:
8919 \#   <none>
8920 \# *Function:
8921 \#   Based on defaults or values entered by user, prints a
8922 \#   three-part title at either the top or the bottom of the page.
8923 \# *Notes:
8924 \#   Called from within either HEADER or FOOTER.
8925 \#
8926 .MAC PRINT_HDRFTR END
8927 .    if \\n[#DOC_TYPE]=4 .nr #SUITE \En[.pn]
8928 .    if \\n[#FOOTERS_ON] \{\
8929 .       if \\n[#START_FOR_FOOTERS] \{\
8930 .          rr #START_FOR_FOOTERS
8931 .          if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{\
8932 .             ie !\\n[#HDRFTR_BOTH] .return
8933 .             el \{\
8934 .                rr #FOOTERS_ON
8935 .                nr #HEADERS_ON 1
8936 .                ie \\n[#HEADER_RULE]=1 .HEADER_RULE
8937 .                el .HEADER_RULE OFF
8938 .                ie \\n[#HDRFTR_BOTH] .HEADER_VERSO \\*[$HDR_VERSO_QUAD] "\\*[$HDR_VERSO_STRING]"
8939 .                el .HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
8940 .                return
8941 .             \}
8942 .          \}
8943 .       \}
8944 .    \}
8945 .    if \\n[#USERDEF_HDRFTR] \{\
8946 .       PRINT_USERDEF_HDRFTR
8947 .       return
8948 .    \}
8949 .    if \\n[#SWITCH_HDRFTR] \{\
8950 .       ds $HDRFTR_TMP_SWITCH             \\*[$HDRFTR_LEFT]
8951 .       ds $HDRFTR_LEFT                   \\*[$HDRFTR_RIGHT]
8952 .       ds $HDRFTR_RIGHT                  \\*[$HDRFTR_TMP_SWITCH]
8953 .       ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
8954 .       ds $HDRFTR_LEFT_SIZE_CHANGE       \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
8955 .       ds $HDRFTR_RIGHT_SIZE_CHANGE      \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
8956 .       nr #HDRFTR_TMP_CAPS_SWITCH        \\n[#HDRFTR_LEFT_CAPS]
8957 .       nr #HDRFTR_LEFT_CAPS              \\n[#HDRFTR_RIGHT_CAPS]
8958 .       nr #HDRFTR_RIGHT_CAPS             \\n[#HDRFTR_TMP_CAPS_SWITCH]
8959 .       ds $HDRFTR_TMP_COLOR_SWITCH       \\*[$HDRFTR_LEFT_COLOR]
8960 .       ds $HDRFTR_LEFT_COLOR             \\*[$HDRFTR_RIGHT_COLOR]
8961 .       ds $HDRFTR_RIGHT_COLOR            \\*[$HDRFTR_TMP_COLOR_SWITCH]
8962 .       rr #HDRFTR_TMP_CAPS_SWITCH
8963 .       rm $HDRFTR_TMP_SWITCH
8964 .       rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
8965 .       rm $HDRFTR_TMP_COLOR_SWITCH
8966 .       nr #SWITCH_HDRFTR 0
8967 .    \}
8968 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
8969 .    if \\n[#ENDNOTES] .PAGENUM_STYLE \\*[$EN_PN_STYLE]
8970 .    if \\n[#PRINT_STYLE]=1 \{\
8971 .       if \\n[#FOOTERS_ON] \{\
8972 .          di NULL
8973 .          SIZESPECS
8974 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
8975 .          di
8976 .       \}
8977 .       if o .RIGHT
8978 .       if e .LEFT
8979 .       if \\n[#RECTO_VERSO]=0    .LEFT
8980 .       if \\n[#HDRFTR_LEFT_CAPS] .CAPS
8981 .       ie '\\*[$HDRFTR_LEFT]'#' .PRINT \\n[#PAGENUMBER]
8982 .       el \{\
8983 .          ie !'\\*[$HDRFTR_LEFT]'' .PRINT \\*[$HDRFTR_LEFT]
8984 .          el .PRINT \&
8985 .       \}
8986 .       if \\n[#HDRFTR_LEFT_CAPS]   .CAPS OFF
8987 .       CENTER
8988 .       if \\n[#HDRFTR_CENTER_CAPS] .CAPS
8989 .       rt \\n[y]u
8990 .       ie '\\*[$HDRFTR_CENTER]'#' .PRINT \
8991 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
8992 .       el \{\
8993 .          ie !'\\*[$HDRFTR_CENTER]'' .PRINT \
8994 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
8995 .          el .PRINT \&
8996 .       \}
8997 .       if \\n[#HDRFTR_CENTER_CAPS] .CAPS OFF
8998 .       if o .LEFT
8999 .       if e .RIGHT
9000 .       if \\n[#RECTO_VERSO]=0     .RIGHT
9001 .       if \\n[#HDRFTR_RIGHT_CAPS] .CAPS
9002 .       rt \\n[y]u
9003 .       ie '\\*[$HDRFTR_RIGHT]'#' .PRINT \\n[#PAGENUMBER]
9004 .       el \{\
9005 .          ie !'\\*[$HDRFTR_RIGHT]'' .PRINT \\*[$HDRFTR_RIGHT]
9006 .          el .PRINT \&
9007 .       \}
9008 .       if \\n[#HDRFTR_RIGHT_CAPS] .CAPS OFF
9009 .    \}
9010 .    if \\n[#PRINT_STYLE]=2 \{\
9011 .       if \\n[#HDRFTR_COLOR]=1 \{\
9012 .          nf
9013 \m[\\*[$HDRFTR_COLOR]]
9014 .       \}
9015 .       fam \\*[$HDRFTR_LEFT_FAM]
9016 .       ft  \\*[$HDRFTR_LEFT_FT]
9017 .       ps  \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
9018 .       if \\n[#FOOTERS_ON] \{\
9019 .          di NULL
9020 .          SIZESPECS
9021 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
9022 .          di
9023 .       \}
9024 .       if o .LEFT
9025 .       if e .RIGHT
9026 .       if \\n[#RECTO_VERSO]=0 .LEFT
9027 .       if \\n[#HDRFTR_LEFT_CAPS] .CAPS
9028 .       ie '\\*[$HDRFTR_LEFT]'#' \{\
9029 .          ie \\n[#HDRFTR_LEFT_COLOR]=1 \
9030 .             PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[]
9031 .          el \
9032 .             PRINT \\n[#PAGENUMBER]
9033 .       \}
9034 .       el \{\
9035 .          ie !'\\*[$HDRFTR_LEFT]'' \{\
9036 .             ie \\n[#HDRFTR_LEFT_COLOR]=1 \
9037 .                PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[]
9038 .             el \
9039 .                PRINT \\*[$HDRFTR_LEFT]
9040 .          \}
9041 .          el .nop \&
9042 .       \}
9043 .       if \\n[#HDRFTR_LEFT_CAPS] .CAPS OFF
9044 .       fam     \\*[$HDRFTR_CENTER_FAM]
9045 .       ft      \\*[$HDRFTR_CENTER_FT]
9046 .       ps      \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
9047 .       if \\n[#FOOTERS_ON] \{\
9048 .          di NULL
9049 .          SIZESPECS
9050 .          nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
9051 .          di
9052 .       \}
9053 .       CENTER
9054 .       if \\n[#HDRFTR_CENTER_CAPS] .CAPS
9055 .       rt \\n[y]u
9056 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
9057 .          ie \\n[#HDRFTR_CENTER_COLOR]=1 .PRINT \
9058 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\
9059 \\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
9060 .          el .PRINT \
9061 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
9062 .       \}
9063 .       el \{\
9064 .          ie !'\\*[$HDRFTR_CENTER]'' \{\
9065 .             ie \\n[#HDRFTR_CENTER_COLOR]=1 .PRINT \
9066 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\
9067 \\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
9068 .             el .PRINT \
9069 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
9070 .          \}
9071 .          el .PRINT \&
9072 .       \}
9073 .       if \\n[#HDRFTR_CENTER_CAPS] .CAPS OFF
9074 .       fam \\*[$HDRFTR_RIGHT_FAM]
9075 .       ft  \\*[$HDRFTR_RIGHT_FT]
9076 .       ps  \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
9077 .       if \\n[#FOOTERS_ON] \{\
9078 .          di NULL
9079 .          SIZESPECS
9080 .          nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
9081 .          di
9082 .       \}
9083 .       if o .RIGHT
9084 .       if e .LEFT
9085 .       if \\n[#RECTO_VERSO]=0 .RIGHT
9086 .       if \\n[#HDRFTR_RIGHT_CAPS] .CAPS
9087 .       rt \\n[y]u
9088 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
9089 .          ie \\n[#HDRFTR_RIGHT_COLOR]=1 \
9090 .             PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[]
9091 .          el \
9092 .             PRINT \\n[#PAGENUMBER]
9093 .       \}
9094 .       el \{\
9095 .          ie !'\\*[$HDRFTR_RIGHT]'' \{\
9096 .             ie \\n[#HDRFTR_RIGHT_COLOR]=1 \
9097 .                PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[]
9098 .             el \
9099 .                PRINT \\*[$HDRFTR_RIGHT]
9100 .          \}
9101 .          el .PRINT \&
9102 .       \}
9103 .       if \\n[#HDRFTR_RIGHT_CAPS] .CAPS OFF
9104 .    \}
9105 .    if \\n[#HDRFTR_RULE] .HDRFTR_RULE_INTERNAL
9106 .    br
9107 .END
9108 \#
9109 \# PRINT USER DEFINED HEADER/FOOTER
9110 \# --------------------------------
9111 \# *Arguments:
9112 \#   <none>
9113 \# *Function:
9114 \#   Based on defaults or values entered by user, prints a single part
9115 \#   (i.e. not 3-part) title at either the top or the bottom of the page.
9116 \# *Notes:
9117 \#   Called from within PRINT_HDRFTR.
9118 \#
9119 .MAC PRINT_USERDEF_HDRFTR END
9120 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
9121 .    fc ^ #
9122 .    if \\n[#PRINT_STYLE]=2 \{\
9123 .       fam \\*[$HDRFTR_FAM]
9124 .       ft  R
9125 .       ps \\n[#HDRFTR_PT_SIZE]u
9126 .       if \\n[#HDRFTR_COLOR]=1 \{\
9127 .          nf
9128 .          COLOR \\*[$HDRFTR_COLOR]
9129 .       \}
9130 .    \}
9131 .    ie \\n[#RECTO_VERSO] \{\
9132 .       if o \{\
9133 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT
9134 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER
9135 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT
9136 .          if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS
9137 .          if '\\n[.ev]'FOOTER' .vs 0
9138 .          PRINT \\*[$USERDEF_HDRFTR_RECTO]
9139 .          if '\\n[.ev]'FOOTER' .vs
9140 .          if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF
9141 .          EOL
9142 .          if \\n[#FOOTERS_ON] \{\
9143 .             di NULL
9144 .             SIZESPECS
9145 .             nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9146 .             di
9147 .          \}
9148 .       \}
9149 .       if e \{\
9150 .          ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
9151 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 .LEFT
9152 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 .CENTER
9153 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 .RIGHT
9154 .             if \\n[#HDRFTR_VERSO_CAPS]=1 .CAPS
9155 .             if '\\n[.ev]'FOOTER' .vs 0
9156 .             PRINT \\*[$USERDEF_HDRFTR_VERSO]
9157 .             if '\\n[.ev]'FOOTER' .vs
9158 .             if \\n[#HDRFTR_VERSO_CAPS]=1 .CAPS OFF
9159 .             EOL
9160 .             if \\n[#FOOTERS_ON] \{\
9161 .                di NULL
9162 .                SIZESPECS
9163 .                nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9164 .                di
9165 .             \}
9166 .          \}
9167 .          el \{\
9168 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT
9169 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER
9170 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT
9171 .             if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS
9172 .             if '\\n[.ev]'FOOTER' .vs 0
9173 .             PRINT \\*[$USERDEF_HDRFTR_RECTO]
9174 .             if '\\n[.ev]'FOOTER' .vs
9175 .             if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF
9176 .             EOL
9177 .             if \\n[#FOOTERS_ON] \{\
9178 .                di NULL
9179 .                SIZESPECS
9180 .                nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9181 .                di
9182 .             \}
9183 .          \}
9184 .       \}
9185 .    \}
9186 .    el \{\
9187 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT
9188 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER
9189 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT
9190 .       if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS
9191 .       if '\\n[.ev]'FOOTER' .vs 0
9192 .       PRINT \\*[$USERDEF_HDRFTR_RECTO]
9193 .       if '\\n[.ev]'FOOTER' .vs
9194 .       if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF
9195 .       EOL
9196 .       if \\n[#FOOTERS_ON] \{\
9197 .          di NULL
9198 .          SIZESPECS
9199 .          nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9200 .          di
9201 .       \}
9202 .    \}
9203 .    fc
9204 .    if \\n[#PRINT_STYLE]=2 \{\
9205 .       ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]]
9206 .       el \m[black]
9207 .    \}
9208 .    if \\n[#HDRFTR_RULE] \{\
9209 .       HDRFTR_RULE_INTERNAL
9210 .    \}
9211 .END
9212 \#
9213 \# +++HEADERS+++
9214 \#
9215 \# HEADERS (off or on)
9216 \# -------------------
9217 \# *Arguments:
9218 \#   <none> | <anything>
9219 \# *Function:
9220 \#   Turns headers at the top of the page off or on.
9221 \# *Notes:
9222 \#   Default is on.
9223 \#
9224 .MAC HEADERS END
9225 .    ie '\\$1'' .nr #HEADERS_ON 1
9226 .    el .nr #HEADERS_ON 0
9227 .END
9228 \#
9229 \# HEADER MARGIN
9230 \# -------------
9231 \# *Argument:
9232 \#   <amount of space between top of page and header>
9233 \# *Function:
9234 \#   Creates or modifies register #HEADER_MARGIN to hold amount
9235 \#   of space between top of page and header.
9236 \# *Notes:
9237 \#   Requires unit of measure.  Default is 4P+6p, measured top-of-page
9238 \#   to baseline.
9239 \#
9240 .MAC HEADER_MARGIN END
9241 .    nr #HEADER_MARGIN (\\$1)
9242 .END
9243 \#
9244 \# HEADER GAP
9245 \# ----------
9246 \# *Argument:
9247 \#   <amount of space between header and running text>
9248 \# *Function:
9249 \#   Creates or modifies register #HEADER_GAP to hold amount
9250 \#   of space between header and running text.
9251 \# *Notes:
9252 \#   Default is 1P+6p.
9253 \#
9254 .MAC HEADER_GAP END
9255 .    nr #HEADER_GAP (\\$1)
9256 .END
9257 \#
9258 \# HEADER
9259 \# ------
9260 \# *Arguments:
9261 \#   <none>
9262 \# *Function:
9263 \#   Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
9264 \# *Notes:
9265 \#   In order to convert the title string to caps in the header
9266 \#   (in the event that the user enters .TITLE in caps/lc), I've
9267 \#   used quad left, quad centre, and quad right to arrange the
9268 \#   three bits of the header, rather than .tl.  This allows the
9269 \#   use of the CAPS macro.  The downside is that I have to add
9270 \#   \\v'-(\\n[#LEAD]u*<n>) in order for -Tlatin1 output to align
9271 \#   the header/footer strings on the baseline.  The console output
9272 \#   still isn't brilliant, but at least it's comprehensible.
9273 \#
9274 .MAC HEADER END
9275 .    vpt 0
9276 .    if \\n[#NEW_DOC_PT_SIZE] .nr #DOC_PT_SIZE \\n[#NEW_DOC_PT_SIZE]
9277 .    rr #NEW_DOC_PT_SIZE
9278 .    if \\n[#RESET_TRAPS] \{\
9279 .       TRAPS
9280 .       if \\n[#REMOVE_ADJ] .nr #DOC_LEAD -\\n[#DOC_LEAD_ADJ]
9281 .    \}
9282 .    rr #REMOVE_ADJ
9283 .    rr #RESET_TRAPS
9284 .    MNtop
9285 .    rr #FROM_FOOTER
9286 .    nr #FROM_HEADER 1
9287 .    nr #LAST_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]
9288 .    if \\n[#FN_DEPTH] .PROCESS_FN_LEFTOVER
9289 .    rr #RULED
9290 .    if \\n[#RESET_FN_NUMBER] .nr #FN_NUMBER 0 1
9291 .    po \\n[#DOC_L_MARGIN]u
9292 .    if \\n[#RECTO_VERSO] \{\
9293 .          nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
9294 .          DOC_LEFT_MARGIN  \\n[#DOC_R_MARGIN]u
9295 .          if \\n[#CROPS] .DOC_LEFT_MARGIN  \\n[#DOC_R_MARGIN]u+\\n[cropmarks]u
9296 .          DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
9297 .          if \\n[#CROPS] .DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u-\\n[cropmarks]u
9298 .          SWITCH_HDRFTR_CENTER_PAD
9299 .       \}
9300 .    \}
9301 .    ev HEADER
9302 .    if \\n[#PAGE_NUM_V_POS]=1 .vs 0
9303 .    sp |\\n[#HEADER_MARGIN]u-1v
9304 .    mk y
9305 .    ll \\n[#DOC_L_LENGTH]u
9306 .    ta \\n[.l]u
9307 .    if \\n[#PRINT_STYLE]=1 \{\
9308 .       fam \\*[$TYPEWRITER_FAM]
9309 .       ft  R
9310 .       ps  \\*[$TYPEWRITER_PS]\\*[$HDRFTR_SIZE_CHANGE]
9311 .    \}
9312 .    if \\n[#PRINT_STYLE]=2 \{\
9313 .      fam \\*[$HDRFTR_FAM]
9314 .      ft  R
9315 .      ps  \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
9316 .    \}
9317 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
9318 .    if \\n[#CAPS_ON] \{\
9319 .       nr #CAPS_WAS_ON 1
9320 .       CAPS OFF
9321 .    \}
9322 .    if \\n[#PRINT_STYLE]=1 \{\
9323 .       if \\n[#ENDNOTES]=1 \{\
9324 .\" Single-spaced endotes have a different lead
9325 .          if \\n[#EN_SINGLESPACE] \{\
9326 .             nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
9327 .             nr #DOC_LEAD \\n[#EN_LEAD]u
9328 .          \}
9329 .       \}
9330 .    \}
9331 .    if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
9332 .    sp -1v
9333 .    ie \\n[#HEADERS_ON] .PRINT_HDRFTR
9334 .    el \{\
9335 .       if \\n[#PAGE_NUM_V_POS]=1 \{\
9336 .          if \\n[#PAGINATE] .PRINT_PAGE_NUMBER
9337 .       \}
9338 .    \}
9339 .    sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
9340 .    if \\n[#PRINT_STYLE]=1 \{\
9341 .       if \\n[#ENDNOTES]=1 \{\
9342 .          if \\n[#EN_SINGLESPACE] \{\
9343 .             nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
9344 .             rr #RESTORE_DOC_LEAD
9345 .          \}
9346 .       \}
9347 .    \}
9348 .    nr #PAGE_TOP \\n[nl]
9349 .    ev
9350 .    po \\n[#L_MARGIN]u
9351 .    if \\n[#RECTO_VERSO] .nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
9352 .    if \\n[#CAPS_WAS_ON] \{\
9353 .       CAPS
9354 .       rr #CAPS_WAS_ON
9355 .    \}
9356 .    if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9357 .    if \\n[#QUOTE] \{\
9358 .       ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9359 .       el \{\
9360 .          ie \\n[#Q_OFFSET_VALUE] .nr #Q_OFFSET \
9361 \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9362 .          el .nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9363 .          po \\n[#Q_OFFSET]u
9364 .       \}
9365 .       if \\n[#PRINT_STYLE]=2 .sp \\n[#Q_LEAD_DIFF]u
9366 .    \}
9367 .    if \\n[#EPIGRAPH] \{\
9368 .       ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9369 .       el \{\
9370 .          ie r#EPI_OFFSET_VALUE \
9371 .             nr #EPI_OFFSET \
9372 \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9373 .          el \
9374 .             nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9375 .          po \\n[#EPI_OFFSET]u
9376 .       \}
9377 .    \}
9378 .    ie \\n[#EPIGRAPH] \{\
9379 .       ie !\\n[#EPI_ACTIVE] \{\
9380 .          ns
9381 .          rr #EPI_ACTIVE
9382 .       \}
9383 .       el \{\
9384 .          ie \\n[#EPI_FITS] .ns
9385 .          el .sp \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u
9386 .       \}
9387 .    \}
9388 .    el .ns
9389 .    if \\n[#COLUMNS] \{\
9390 .       nr #FN_COUNT_FOR_COLS 0 1
9391 .       nr #L_MARGIN \\n[#DOC_L_MARGIN]
9392 .       if \\n[#RECTO_VERSO] .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u
9393 .       nr #COL_NUM 0 1
9394 .       mk dc
9395 .       po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
9396 .       nr #L_MARGIN \\n[.o]
9397 .       if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9398 .       ll \\n[#COL_L_LENGTH]u
9399 .       ta \\n[.l]u
9400 .       if \\n[#QUOTE] \{\
9401 .          ie \\n[#Q_OFFSET_VALUE] \
9402 .             po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
9403 .          el \
9404 .             po +\\*[$Q_OFFSET_VALUE]
9405 .       \}
9406 .       if \\n[#EPIGRAPH] \{\
9407 .          if \\n[#EPI_ACTIVE] \{\
9408 .             ie \\n[#EPI_FITS] .
9409 .             el .nr dc -\\n[#EPI_LEAD_DIFF]
9410 .          \}
9411 .          ie r#EPI_OFFSET_VALUE \{\
9412 .             po \
9413 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
9414 .          \}
9415 .          el .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+\\*[$EPI_OFFSET_VALUE]
9416 .       \}
9417 .    \}
9418 .    if \\n[#RESET_FN_COUNTERS]=1 \{\
9419 .       rr #RESET_FN_COUNTERS
9420 .       PROCESS_FN_IN_DIVER
9421 .       nr #FN_COUNT \\n[#SAVED_FN_COUNT] 1
9422 .       if \\n[#COLUMNS]=1 .nr #FN_COUNT_FOR_COLS \\n[#SAVED_FN_COUNT_FOR_COLS] 1
9423 .       ie \\n[#RESET_FN_NUMBER]=1 .nr #FN_NUMBER \\n[#SAVED_FN_NUMBER] 1
9424 .       el .nr #FN_NUMBER \\n[#FN_NUMBER] 1
9425 .       rm FN_IN_DIVER
9426 .       if dRUNON_FN_IN_DIVER .rm RUNON_FN_IN_DIVER
9427 .    \}
9428 .    rr #FROM_HEADER
9429 .    rr #DEFER_SPACE_ADDED
9430 .    if !\\n[#FN_DEPTH] .if r #DIVERTED .rr #DIVERTED
9431 .    if \\n[#MN_OVERFLOW_LEFT]=1 \{\
9432 .       MN LEFT
9433 .       nf
9434 .       MN_OVERFLOW_LEFT
9435 .       MN
9436 .    \}
9437 .    if \\n[#MN_OVERFLOW_RIGHT]=1 \{\
9438 .       MN RIGHT
9439 .       nf
9440 .       MN_OVERFLOW_RIGHT
9441 .       MN
9442 .    \}
9443 .    rm MN_OVERFLOW_LEFT
9444 .    rr #MN_OVERFLOW_LEFT
9445 .    rr #no-repeat-MN-left
9446 .    rm MN_OVERFLOW_RIGHT
9447 .    rr #MN_OVERFLOW_RIGHT
9448 .    rr #no-repeat-MN-right
9449 .    if \\n[#PRE_COLLATE]=1 .rr #PRE_COLLATE
9450 .    if \\n[#UNDERLINE_WAS_ON]=1 \{\
9451 .       vs 0
9452 .       ie !n \
9453 .          nop \R'#UNDERLINE_ON 1'\X'ps: exec \\n[_w] \\n[_d] decorline'
9454 .       el .ul 1000
9455 .       br
9456 .       ns
9457 .       rr #UNDERLINE_WAS_ON
9458 .    \}
9459 .    if \\n[#RESTORE_PAGINATION] \{\
9460 .       PAGINATE
9461 .       rr #RESTORE_PAGINATION
9462 .    \}
9463 .    ch RR_@TOP
9464 .    ie \\n[tbl*have-header] .rr @TOP
9465 .    el .wh \\n[nl]u+1u RR_@TOP
9466 .    ie \\n[defer] .PROCESS_FLOATS
9467 .    el \{\
9468 .       if \\n[tbl*have-caption] \{\
9469 .          RESTORE_SPACE
9470 .          ie \\n[#MLA] .sp \n[tbl*label-lead-diff]u
9471 .          el .sp \n[tbl*caption-lead-diff]u
9472 .       \}
9473 .    \}
9474 .\" So tables without TH that don't fit don't overprint first row
9475 .\" at top of page
9476 .    ie \\n[tbl*no-header] \{\
9477 .       rs
9478 .       nop \&
9479 .       vpt
9480 .       rr \\n[tbl*no-header]
9481 .       SHIM
9482 .    \}
9483 .    el .vpt
9484 .    if \\n[#NEWPAGE] .rr #NEWPAGE
9485 .    ie \\n[tbl*interrupted] \{\
9486 .       tbl*print-header
9487 .       rr tbl*interrupted
9488 .      \}
9489 .    el .tbl@top-hook
9490 .END
9491 \#
9492 \# ====================================================================
9493 \#
9494 \# +++FOOTERS+++
9495 \#
9496 \# FOOTERS (off or on)
9497 \# -------------------
9498 \# *Arguments:
9499 \#   <none> | <anything>
9500 \# *Function:
9501 \#   Turns footers at the bottom of the page off or on.
9502 \# *Notes:
9503 \#   Default is off.  If on, page numbers automatically go at
9504 \#   the top, centered, unless pagination has been turned off,
9505 \#   or the pagenumber position has been changed to left or right.
9506 \#
9507 .MAC FOOTERS END
9508 .    ie '\\$1'' \{\
9509 .       rr #HEADERS_ON
9510 .       nr #FOOTERS_ON 1
9511 .       PAGENUM_POS TOP CENTER
9512 .    \}
9513 .    el .nr #FOOTERS_ON 0
9514 .END
9515 \#
9516 \# FOOTER MARGIN
9517 \# -------------
9518 \# *Argument:
9519 \#   <footer margin>
9520 \# *Function:
9521 \#   Creates or modifies register #FOOTER_MARGIN which holds the
9522 \#   amount of space to leave between the page number and the bottom
9523 \#   of the page.
9524 \# *Notes:
9525 \#   Unit of measure required.  Default is 3P.
9526 \#
9527 .MAC FOOTER_MARGIN END
9528 .    ie \\n%>0 .nr #FOOTER_MARGIN (\\$1)
9529 .    el .
9530 .END
9531 \#
9532 \# FOOTER GAP
9533 \# ----------
9534 \# *Argument:
9535 \#   <distance from end of running text to page # or footer>
9536 \# *Function:
9537 \#   Creates or modifies register #FOOTER_GAP which holds the
9538 \#   amount of space to leave between running text and the page number.
9539 \# *Notes:
9540 \#   Requires unit of measure.  Default is 3P.  Measured baseline to
9541 \#   baseline.
9542 \#
9543 .MAC FOOTER_GAP END
9544 .    ie \\n%>0 .nr #FOOTER_GAP (\\$1)
9545 .    el .
9546 .END
9547 \#
9548 \# FOOTER
9549 \# ------
9550 \# *Arguments:
9551 \#   <none>
9552 \# *Function:
9553 \#   Places footer at bottom of page if #FOOTERS=1, otherwise
9554 \#   places page number at bottom of page (if #PAGINATE=1).
9555 \#   Page numbers are in arabic or roman according to COPYSTYLE.
9556 \#   DRAFT starts the document at page 1 regardless of PAGENUMBER.
9557 \#   FINAL respects PAGENUMBER.
9558 \#
9559 .MAC FOOTER END
9560 .    vpt 0
9561 .    rr #LB_4_HD
9562 .    rr #QUOTE_4_HD
9563 .    nr #SAVED_LEAD \\n[.v]
9564 .    ev PAGE_TRANSITION
9565 .    pdfmarksuspend
9566 .    ie !n .nop \X'ps: exec decornone'
9567 .    el .ul 0
9568 .    br
9569 .    if \\n[#UNDERLINE_ON]=1 .nr #UNDERLINE_WAS_ON 1
9570 .    if \\n[MN-left]>0 \{\
9571 .       if !\\n[#no-repeat-MN-left]=1 \{\
9572 .          MNbottom-left
9573 .          nr #no-repeat-MN-left 1
9574 .       \}
9575 .       if '\\n[.z]'MN_OVERFLOW_LEFT' \{\
9576 .          di
9577 .          nr #MN_OVERFLOW_LEFT 1
9578 .          rr #OVERFLOW_LEFT
9579 .       \}
9580 .    \}
9581 .    if \\n[MN-right]>0 \{\
9582 .       if (\\n[MN-right] > 0) \
9583 .          if !\\n[#no-repeat-MN-right]=1 .MNbottom-right
9584 .       if '\\n[.z]'MN_OVERFLOW_RIGHT' \{\
9585 .          di
9586 .          nr #MN_OVERFLOW_RIGHT 1
9587 .          rr #OVERFLOW_RIGHT
9588 .       \}
9589 .    \}
9590 \# Table bottom hook, draws the table borders in
9591 \# multipage boxed tables.
9592 .    tbl@bottom-hook
9593 .    ch MN_OVERFLOW_TRAP
9594 .    nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
9595 .    if !\\n[#FN_DEFER] \{\
9596 .       nr #DIVER_DEPTH 0
9597 .       if \\n[#FN_DEPTH] \{\
9598 .          if \\n[#DIVERTED]=3 .nr #FN_DEPTH +\\n[#VFP_DIFF]
9599 .          vpt 0
9600 .          sp \
9601 |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u-\\n[#DOC_LEAD]u)
9602 .          vpt 1
9603 .          po \\n[#DOC_L_MARGIN]u
9604 .          if \\n[#COLUMNS] \{\
9605 .             po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9606 .             nr #L_MARGIN \\n[.o]
9607 .             nr #FROM_FOOTER 1
9608 .          \}
9609 .          nf
9610 .          FOOTNOTES
9611 .          rm FOOTNOTES
9612 .          if d RUNON_FOOTNOTES    .rm RUNON_FOOTNOTES
9613 .          if \\n[#PRINT_STYLE]=1 .vs \\n[#SAVED_LEAD]u
9614 .          if \\n[#PRINT_STYLE]=2 .LS \\n[#SAVED_LEAD]u
9615 .          if '\\n[.z]'FN_OVERFLOW' \{\
9616 .              di
9617 .              nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
9618 .          \}
9619 .          nr #FN_COUNT_AT_FOOTER \\n[#FN_COUNT]
9620 .          nr #FN_COUNT 0
9621 .          if \\n[#COL_NEXT] \{\
9622 .             ie !\\n[#COL_NUM]=\\n[#NUM_COLS] .nr #COL_NUM \\n-[#COL_NUM]
9623 .             el .nr #COL_NUM \\n[#NUM_COLS] 1
9624 .          \}
9625 .       \}
9626 .       rr #DIVERTED
9627 .    \}
9628 .    nr @TOP 1
9629 .    ie \\n[#COLUMNS]=1 \{\
9630 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] .DO_FOOTER
9631 .       el \{\
9632 .          ie (\\n[#ENDNOTES]=1):(\\n[#BIBLIOGRAPHY]=1) \{\
9633 .             if \\n[#ENDNOTES] .sp |\\n[ec]u-\\n[#EN_LEAD]u
9634 .             if \\n[#BIBLIOGRAPHY] .sp |\\n[bc]u-\\n[#BIB_LEAD]u
9635 .          \}
9636 .          el \{\
9637 .            vs \\n[#SAVED_LEAD]u
9638 .            sp |\\n[dc]u
9639 .          \}
9640 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
9641 .          nr #L_MARGIN \\n[.o]
9642 .          if \\n[#FN_DEPTH] .PROCESS_FN_LEFTOVER
9643 .          vs \\n[#SAVED_LEAD]u
9644 .          if \\n[#PREV_FN_DEFERRED] .nr #PREV_FN_DEFERRED 2
9645 .          rr #RULED
9646 .          if !\\n[#EPIGRAPH] .rr #COL_NEXT
9647 .          if !\\n[#QUOTE] .rr #COL_NEXT
9648 .          if \\n[#RESET_FN_COUNTERS]=1 \{\
9649 .             rr #RESET_FN_COUNTERS
9650 .             PROCESS_FN_IN_DIVER
9651 .             LS \\n[#SAVED_LEAD]u
9652 .             nr #FN_COUNT \\n[#FN_COUNT] 1
9653 .             nr #FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] 1
9654 .             rm FN_IN_DIVER
9655 .             if dRUNON_FN_IN_DIVER .rm RUNON_FN_IN_DIVER
9656 .          \}
9657 .          rr #DEFER_SPACE_ADDED
9658 .          if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9659 .          if \\n[#QUOTE] \{\
9660 .             ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9661 .             el \{\
9662 .                ie \\n[#Q_OFFSET_VALUE] \
9663 .                   nr #Q_OFFSET \
9664 \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9665 .                el \
9666 .                   nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9667 .                if \\n[#COLUMNS] \{\
9668 .                   ie \\n[#Q_OFFSET_VALUE] .nr #Q_OFFSET \
9669 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9670 .                   el .nr #Q_OFFSET \
9671 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9672 .                \}
9673 .                po \\n[#Q_OFFSET]u
9674 .             \}
9675 .          \}
9676 .          if \\n[#EPIGRAPH] \{\
9677 .             ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9678 .             el \{\
9679 .                ie r#EPI_OFFSET_VALUE .nr #EPI_OFFSET \
9680 \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9681 .                el .nr #EPI_OFFSET \
9682 \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9683 .                if \\n[#COLUMNS] \{\
9684 .                   ie r#EPI_OFFSET_VALUE .nr #EPI_OFFSET \
9685 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9686 .                   el .nr #EPI_OFFSET \
9687 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9688 .                \}
9689 .                po \\n[#EPI_OFFSET]u
9690 .             \}
9691 .          \}
9692 .          ie \\n[#EPIGRAPH] \{\
9693 .             ie !\\n[#EPI_ACTIVE] \{\
9694 .                ns
9695 .                rr #EPI_ACTIVE
9696 .             \}
9697 .             el \{\
9698 .                sp |\\n[dc]u+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
9699 .                rr #EPI_ACTIVE
9700 .             \}
9701 .          \}
9702 .          el .ns
9703 .          ev
9704 .       \}
9705 .       ns
9706 .       rr #DIVERTED
9707 .       ch RR_@TOP
9708 .       wh \\n[nl]u+1u RR_@TOP
9709 .       if \\n[tbl*have-header] .tbl@bottom-hook
9710 .       if \\n[defer] .PROCESS_FLOATS
9711 .       ie \\n[tbl*no-header] \{\
9712 .          rs
9713 .          nop \&
9714 .          vpt
9715 .          rr \\n[tbl*no-header]
9716 .          SHIM
9717 .       \}
9718 .       el .vpt
9719 .       if \\n[tbl*interrupted] .tbl*print-header
9720 .       rr tbl*interrupted
9721 .    \}
9722 .    el .DO_FOOTER
9723 .    pdfmarkrestart
9724 .END
9725 \#
9726 \# PROCESS FOOTER
9727 \# --------------
9728 \# *Arguments:
9729 \#   <none>
9730 \# *Function:
9731 \#   Prints footer (page number, or 3-part footer).
9732 \#   Resets CAPS and UNDERLINE if they were on.
9733 \#
9734 .MAC DO_FOOTER END
9735 .\" Part of workaround for refer spitting out a blank page if the
9736 .\" last reference falls on the bottom line.
9737 .    if \\n[num*refs] \{\
9738 .       if \\n[ref*num]=\\n[num*refs] \{\
9739 .          rr num*refs
9740 .          nr ref*last 1
9741 .       \}
9742 .    \}
9743 .    PRINT_FOOTER
9744 .    if !\\n[ref*last] \{\
9745 .       ie \\n[defer]>0 \{\
9746 \c
9747 '       bp
9748 .       \}
9749 .       el 'bp
9750 .    \}
9751 .    if !'\\n[.ev]'0' .ev
9752 .    rr ref*last
9753 .    po \" Ensure reset to last value
9754 .END
9755 \#
9756 .MAC PRINT_FOOTER END
9757 .   br
9758 .\" Have to change position of FN_OVERFLOW_TRAP or it screws up the
9759 .\" placement of page numbers (or footers).  It's reset to its original
9760 .\" position at the end of the macro.
9761 .    if r #SAVED_FOOTER_POS .ch FOOTER \\n[#SAVED_FOOTER_POS]u
9762 .    rr #SAVED_FOOTER_POS
9763 .    ie (\\n[#FOOTER_MARGIN]+\\n[.v]>\\n[#B_MARGIN]) .nr #SKIP_FOOTER 1
9764 .    el \{\
9765 .       ev FOOTER
9766 .       vpt 0
9767 .       ie n \
9768 .          sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u
9769 .       el \
9770 .          sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-\\n[#FOOTER_ADJ]u
9771 .       mk y
9772 .    \}
9773 .    UNDERLINE OFF
9774 .    po \\n[#DOC_L_MARGIN]u
9775 .    ll \\n[#DOC_L_LENGTH]u
9776 .    ta \\n[.l]u
9777 .    if \\n[#PRINT_STYLE]=1 .TYPEWRITER
9778 .    if \\n[#PRINT_STYLE]=2 \{\
9779 .       fam  \\*[$HDRFTR_FAM]
9780 .       ft      R
9781 .       ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
9782 .    \}
9783 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
9784 .    if \\n[#CAPS_ON] \{\
9785 .       nr #CAPS_WAS_ON 1
9786 .       CAPS OFF
9787 .    \}
9788 .    ie \\n[#FOOTERS_ON] \{\
9789 .       if !\\n[#SKIP_FOOTER]=1 .PRINT_HDRFTR
9790 .    \}
9791 .    el \{\
9792 .       if \\n[#PAGINATE] \{\
9793 .          if \\n[#PAGE_NUM_V_POS]=2 \
9794 .             if !\\n[#SKIP_FOOTER]=1 .PRINT_PAGE_NUMBER
9795 .       \}
9796 .    \}
9797 .    rr #SKIP_FOOTER
9798 .    if \\n[#CAPS_WAS_ON] \{\
9799 .       CAPS
9800 .       rr #CAPS_WAS_ON
9801 .    \}
9802 .    ev
9803 .    vpt 1
9804 .END
9805 \#
9806 \# ====================================================================
9807 \#
9808 \# +++HEADERS AND FOOTERS+++
9809 \#
9810 \# HEADERS_AND_FOOTERS
9811 \# -------------------
9812 \# *Arguments:
9813 \#   HEADER_RECTO_QUAD \
9814 \#   HEADER_RECTO_STRING \
9815 \#   FOOTER_RECTO_QUAD \
9816 \#   FOOTER_RECTO_STRING \
9817 \#   HEADER_VERSO_QUAD \
9818 \#   HEADER_VERSO_STRING \
9819 \#   FOOTER_VERSO_QUAD \
9820 \#   FOOTER_VERSO_STRING
9821 \#   | <anything>
9822 \# *Function:
9823 \#   Allows having both headers and footers.  Sets register
9824 \#   #HDRFTR_BOTH to 1; collects HEADER/FOOTER_RECTO/VERSO
9825 \#   information; appends FOOTER_RECTO and FOOTER_VERSO to
9826 \#   START and turns off pagination; appends to macros
9827 \#   PRINT_USERDEF_HDRFTR and HEADER the necessary number
9828 \#   register manipulations and redefinitions of the
9829 \#   HEADER/FOOTER_RECTO/VERSO strings so that both
9830 \#   headers and footers get printed, with the appropriate
9831 \#   strings for each
9832 \# *Notes:
9833 \#   Works in conjunction with HDRFTR_RECTO and HDRFTR_VERSO (qqv.),
9834 \#   ergo all style changes must be done inline in the strings
9835 \#   passed as arguments.
9836 \#
9837 .MAC HEADERS_AND_FOOTERS END
9838 .    ie \\n[#NUM_ARGS]>1 \{\
9839 .    nr #HDRFTR_BOTH 1
9840 .    nr #FOOTERS_ON  1
9841 .    if !r#HEADER_RULE .nr #HEADER_RULE 1
9842 .    if !r#FOOTER_RULE .nr #FOOTER_RULE 1
9843 .    ds $HDR_RECTO_QUAD   \\$1
9844 .    ds $HDR_RECTO_STRING \\$2
9845 .    ds $FTR_RECTO_QUAD   \\$3
9846 .    ds $FTR_RECTO_STRING \\$4
9847 .    ds $HDR_VERSO_QUAD   \\$5
9848 .    ds $HDR_VERSO_STRING \\$6
9849 .    ds $FTR_VERSO_QUAD   \\$7
9850 .    ds $FTR_VERSO_STRING \\$8
9851 .am START DONE
9852 .   if \\\\n[#HDRFTR_BOTH]=1 \{\
9853 .      FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
9854 .      FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
9855 .      if \\\\n[#HEADER_RULE]=1 .HEADER_RULE
9856 .      ie \\\\n[#FOOTER_RULE]=1 .FOOTER_RULE
9857 .      el .FOOTER_RULE OFF
9858 .      if r #PAGINATE .rr #PAGINATE
9859 .      if r #PAGE_NUM_V_POS .rr #PAGE_NUM_V_POS
9860 .   \}
9861 .DONE
9862 .am PRINT_USERDEF_HDRFTR DONE
9863 .   if \\\\n[#HDRFTR_BOTH]=1 \{\
9864 .      if \\n[#FOOTERS_ON]=1 \{\
9865 .         if !\\\\n[#COLLATE]=1 \{\
9866 .            HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
9867 .            HEADER_VERSO \\*[$HDR_VERSO_QUAD] "\\*[$HDR_VERSO_STRING]"
9868 .            rr #FOOTERS_ON
9869 .            nr #HEADERS_ON 1
9870 .            ie \\\\n[#HEADER_RULE]=1 .HEADER_RULE
9871 .            el .HEADER_RULE OFF
9872 .         \}
9873 .      \}
9874 .      if \\n[#HEADERS_ON]=1 \{\
9875 .         FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
9876 .         FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
9877 .      \}
9878 .   \}
9879 .DONE
9880 .am HEADER DONE
9881 .   if \\\\n[#HDRFTR_BOTH]=1 \{\
9882 .      if r #START_FOR_FOOTERS .rr #START_FOR_FOOTERS
9883 .      rr #HEADERS_ON
9884 .      nr #FOOTERS_ON 1
9885 .      FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
9886 .      FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
9887 .      ie \\\\n[#FOOTER_RULE]=1 .FOOTER_RULE
9888 .      el .FOOTER_RULE OFF
9889 .   \}
9890 .DONE
9891 .    \}
9892 .    el \{\
9893 .       rr #HDRFTR_BOTH
9894 .       rr #USERDEF_HDRFTR
9895 .       rm $USERDEF_HDRFTR_RECTO
9896 .       rm $USERDEF_HDRFTR_VERSO
9897 .       FOOTERS OFF
9898 .       HEADERS
9899 .       if \\n[#COLLATE]=1 \{\
9900 .          nr #HEADER_STATE 1
9901 .          nr #PAGINATION_STATE 1
9902 .       \}
9903 .       PAGINATE
9904 .       PAGENUM_POS BOTTOM CENTER
9905 .       nr #HF_OFF 1
9906 .    \}
9907 .END
9908 \#
9909 \# ====================================================================
9910 \#
9911 \# +++HEADS+++
9912 \#
9913 .char \[hd-num-spacer]     \0
9914 .char \[parahead-spacer]   \~\~
9915 .char \[toc-hd-num-spacer] \h'\w'\[en]'u'
9916 .ds toc-word-space \ \" ie an unbreakable space
9917 \#
9918 \# HEADING
9919 \# -------
9920 \# *Arguments:
9921 \#   <heading level> [PARAHEAD] [NAMED <pdf-id>] <heading text>
9922 \# *Function:
9923 \#   Assigns a heading level to the heading text and prints heading
9924 \#   in the style set up for that level.  If PARAHEAD given, the
9925 \#   heading is attached to the body of the paragraph.  If NAMED
9926 \#   given, creates a target for pdf links.  Collects the heading
9927 \#   for the TOC and sets TOC indenting appropriate for the level.
9928 \# *Notes:
9929 \#   If PARAHEAD given, HEADING must come after PP.
9930 \#
9931 .MAC HEADING END
9932 .    if !\B'\\$1' \{\
9933 .       tm1 "[mom]: The first argument to \\$0 must be a numeric heading level.
9934 .       ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
9935 .    \}
9936 .    if r #QUOTE     .rr #QUOTE
9937 .    if r #END_QUOTE .rr #END_QUOTE
9938 .    if r #EPIGRAPH  .rr #EPIGRAPH
9939 .    vs \\n[#DOC_LEAD]u
9940 .    if \\$1<\\n[#LEVEL] \
9941 .       nr #ACTIVE_LEVELS \\n[#LEVEL] \" loop count for resetting numbering registers
9942 .    nr #LAST_LEVEL \\n[#LEVEL]       \" used during TOC collection, if SPACE_TOC_ITEMS
9943 .    nr #LEVEL \\$1                   \" reset #LEVEL to arg
9944 .    shift
9945 .    nr #ARG_NUM 0 1
9946 .    while \\n+[#ARG_NUM]<=2 \{\
9947 .      if '\\$1'NAMED' \{\
9948 .         ds PDF_NM "\\$1 \\$2
9949 .         shift 2 \" \\$1 is now heading text
9950 .      \}
9951 .      if '\\$1'PARAHEAD' \{\
9952 .         nr #PARAHEAD 1
9953 .         shift \" \\$1 is now NAMED, if we have it; otherwise heading text
9954 .      \}
9955 .    \}
9956 .\" Spacing
9957 .    if \\n[#Q_LEAD_DIFF_CHECK] .sp -1v
9958 .    ie \\n[#PARAHEAD] 'br
9959 .    el .br
9960 .    ie !\\n[#PARAHEAD] \{\
9961 .       if !\\n[@TOP] \{\
9962 .          nr #HEAD 1
9963 .          ie \\n[#HEAD_\\n[#LEVEL]_SPACE_AFTER] .ne \\n[#NUM_ARGS]+2
9964 .          el .ne \\n[#NUM_ARGS]+1
9965 .          vpt 0
9966 .          ie !\\n[#START] \
9967 .             if !\\n[#SPACE_ADDED] .if !\\n[#LINEBREAK] .sp
9968 .          el \{\
9969 .             ie !\\n[#PP] .rr #START
9970 .             el .sp
9971 .          \}
9972 .          if \\n[#EPIGRAPH] \
9973 .             if \\n[#SINGLE_SPACE] .sp
9974 .       \}
9975 .       if \\n[#PP_SPACE] \
9976 .          if \\n[#QUOTE_4_HD] .sp .5v
9977 .       if !\\n[#SPACE_ADDED] .SHIM
9978 .       if \\n[#SPACE_ADDED] .rr #SPACE_ADDED
9979 .    \}
9980 .    el \{\
9981 .       if \\n[#NUM_ARGS]>1 \{\
9982 .          tm1 "[mom]: Error at line \\n[.c], \\$0.
9983 .          tm1 "       PARAHEAD may not be given more than 1 line of text.
9984 .          ab  Aborting '\\n[.F]' at \\$0, line \\n[.c].
9985 .       \}
9986 .       vpt 0
9987 .       if !(\\n[#PRINT_STYLE]=1)&(\\n[#SINGLE_SPACE]=1) .sp -1v
9988 .       if \\n[#QUOTE_4_HD] \{\
9989 .          sp -1v
9990 .          if \\n[#PP_SPACE] \{\
9991 .             sp .5v
9992 .             SHIM
9993 .         \}
9994 .       \}
9995 .       if (\\n[#QUOTE_4_HD]=0)&(\\n[#LB_4_HD]=0)&(\\n[#START]=0) \
9996 .          if !\\n[#LB_4_PARAHEAD] .sp -1v
9997 .    \}
9998 .    ev HEADING
9999 .    evc 0
10000 .\" Style
10001 .    if \\n[#PRINT_STYLE]=2 \{\
10002 .       fam \\*[$HEAD_\\n[#LEVEL]_FAM]
10003 .       ft  \\*[$HEAD_\\n[#LEVEL]_FT]
10004 .       ps  \\n[#DOC_PT_SIZE]u+\\*[$HEAD_\\n[#LEVEL]_SIZE]
10005 .       nf
10006 .    \}
10007 .\" Numbering
10008 .    ds $TOC_HD_NUM_PREV \\*[$TOC_HD_NUM]
10009 .    rm $TOC_HD_NUM
10010 .    rm $PDF_HD_NUM
10011 .    ie \\n[#NUMBER_HEAD_\\n[#LEVEL]] \{\
10012 .       if \\n[#PREFIX_CH_NUM] .ds $HD_NUM \\n[#CH_NUM].
10013 .       nr #HEAD_\\n[#LEVEL]_NUM +1       \" incremented manually here; still auto-increments
10014 .\" Reset numbering registers for headings beneath current level
10015 .       nr @LEVEL \\n[#LEVEL] 1           \" loop step
10016 .       nr #LOOP \\n[#ACTIVE_LEVELS]      \" loop count
10017 .       while \\n+[@LEVEL]<=\\n[#LOOP] \
10018 .          if \\n[#HEAD_\\n[@LEVEL]_NUM] \
10019 .             nr #HEAD_\\n[@LEVEL]_NUM 0 1
10020 .\" Build numbering strings for body and toc
10021 .       nr @LEVEL 0 1                     \" loop step
10022 .       nr #LOOP \\n[#LEVEL]              \" loop count
10023 .       while \\n+[@LEVEL]<=\\n[#LOOP] \
10024 .          if \\n[#HEAD_\\n[@LEVEL]_NUM] \
10025 .             as $HD_NUM \\n[#HEAD_\\n[@LEVEL]_NUM].
10026 .       ie \\n[#TRUNC_TOC_HD_NUM] \
10027 .          ds $TOC_HD_NUM \\n[#HEAD_\\n[#LEVEL]_NUM].
10028 .       el .ds $TOC_HD_NUM \\*[$HD_NUM]
10029 .       if \\n[#LEVEL]=1 \
10030 .          ds $TOC_HD_NUM_PREV \\*[$TOC_HD_NUM]
10031 .       if \\n[#TOC_NO_HD_NUM] .rm $TOC_HD_NUM
10032 .       if !\\n[#HEAD_\\n[#LEVEL]_NUM]] .rm $TOC_HD_NUM
10033 .       as $HD_NUM \[hd-num-spacer]
10034 .       ds $PDF_HD_NUM \\*[$TOC_HD_NUM]
10035 .       if !'\\*[$TOC_HD_NUM]'' .as $TOC_HD_NUM \[toc-hd-num-spacer]
10036 .       if !'\\*[$PDF_HD_NUM]'' .as $PDF_HD_NUM " "
10037 .    \}
10038 .    el .nr @LEVEL \\n[#LEVEL] 1
10039 .\" TOC collection and formatting
10040 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
10041 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
10042 .    nr #ARG_NUM 0 1
10043 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10044 .       as $TOC_HEAD_\\n[#LEVEL]_ITEM "\\$[\\n+[#ARG_NUM]]
10045 .       if \\n[#NUM_ARGS]>\\n[#ARG_NUM] \
10046 .          as $TOC_HEAD_\\n[#LEVEL]_ITEM "\\*[toc-word-space]
10047 .    \}
10048 .    PDF_BOOKMARK \
10049         \\*[PDF_NM] \\n[#LEVEL]+1 \
10050         \\*[$PDF_HD_NUM] \\*[$TOC_HEAD_\\n[#LEVEL]_ITEM]
10051 .    rm PDF_NM
10052 .    rm $PDF_HD_NUM
10053 .    ev TOC_EV
10054 .    ie \\n[#PRINT_STYLE]=1 \{\
10055 .       fam \\*[$TYPEWRITER_FAM]
10056 .       ft  R
10057 .       ps  \\*[$TYPEWRITER_PS]
10058 .    \}
10059 .    el \{\
10060 .       FAMILY  \\*[$TOC_HEAD_\\n[#LEVEL]_FAM]
10061 .       FT      \\*[$TOC_HEAD_\\n[#LEVEL]_FT]
10062 .       ps \\n[#TOC_PS]u\\*[$TOC_HEAD_\\n[#LEVEL]_SIZE]
10063 .    \}
10064 .\" Indents for TOC heading levels.
10065 .\" First, numbered heads.  @LEVEL here is #LEVEL+1
10066 .    ie \\n[#NUMBER_HEAD_\\n[#LEVEL]] \{\
10067 .       ie !\\n[#TOC_NO_HD_NUM] \{\
10068 .          ie \\n[#TRUNC_TOC_HD_NUM] \{\
10069 .             if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \{\
10070 .                ie !\\n[#FROM_STYLE_\\n[@LEVEL]] \{\
10071 .                   ie !\\n[#NUMBER_HEAD_\\n[@LEVEL]] \
10072 .                      nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10073 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\w'\\*[$TOC_HD_NUM]'+1.5m
10074 .                   el \
10075 .                      nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10076 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\w'\\*[$TOC_HD_NUM]'
10077 .                \}
10078 .                el \
10079 .                   nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10080                       \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]
10081 .             \}
10082 .          \}
10083 .          el \{\
10084 .             if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \{\
10085 .                ie !\\n[#FROM_STYLE_\\n[@LEVEL]] \{\
10086 .                   ie \\n[#NUMBER_HEAD_\\n-[@LEVEL]] \{\
10087 .                      ie !\\n[#NUMBER_HEAD_\\n+[@LEVEL]] \
10088 .                         nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10089 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\w'\\*[$TOC_HD_NUM_PREV]'+1.5m
10090 .                      el \
10091 .                         nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10092 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\w'.\[toc-hd-num-spacer]'
10093 .                   \}
10094 .                   el \
10095 .                      nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10096 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\w'\\n[#TOC_HD_NUM].'
10097 .                   ie \\n[#LEVEL]=1 \
10098 .                      nr #TOC_HEAD_\\n+[@LEVEL]_INDENT +\w'\0'
10099 .                   el \{\
10100 .                      if !\\n[#NUMBER_HEAD_\\n[@LEVEL]] \{\
10101 .                         nr @LEVEL \\n+[@LEVEL] 1
10102 .                         nr #TOC_HEAD_\\n+[@LEVEL]_INDENT +\w'\0'
10103 .                      \}
10104 .                   \}
10105 .                \}
10106 .                el \
10107 .                   nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10108 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\\n[#TOC_HEAD_\\n+[@LEVEL]_INDENT]
10109 .             \}
10110 .             if \\n[#LEVEL]=1 \{\
10111 .                if \\n[#NUMBER_HEAD_\\n[@LEVEL]] \{\
10112 .                   if \\n[#PREFIX_CH_NUM] \
10113 .                      nr #TOC_HEAD_\\n[@LEVEL]_INDENT \w'\\*[$TOC_HD_NUM]'
10114 .                \}
10115 .             \}
10116 .          \}
10117 .       \}
10118 .       el \{\
10119 .          ie !\\n[#FROM_STYLE_\\n[@LEVEL]] \{\
10120 .             if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \
10121 .                nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10122                     \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+1.5m
10123 .          \}
10124 .          el \{\
10125 .             if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \
10126 .                nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10127 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\\n[#TOC_HEAD_\\n+[@LEVEL]_INDENT]
10128 .          \}
10129 .       \}
10130 .    \}
10131 .\" Non-numbered heads
10132 .    el \{\
10133 .       nr @LEVEL \\n[#LEVEL] 1
10134 .       ie \\n[#FROM_STYLE_\\n+[@LEVEL]] \{\    \" increments @LEVEL even if false
10135 .          if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \{\
10136 .             nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10137 \\n[#TOC_HEAD_\\n[#LEVEL]_INDENT]+\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT]
10138 .             if !\\n[#LEVEL]=\\n[#LAST_LEVEL] \{\
10139 .                if \\n[#NUMBER_HEAD_\\n[@LEVEL]] \
10140 .                   nr #TOC_HEAD_\\n[#LEVEL]_INDENT \
10141 \\n[#TOC_HEAD_\\n[@LEVEL]_INDENT]+\w'\\*[$TOC_HD_NUM_PREV]'
10142 .             \}
10143 .          \}
10144 .       \}
10145 .       el \{\
10146 .          nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10147               \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+1.5m
10148 .          if \\n[#LEVEL]=1 \{\
10149 .             if !\\n[#FROM_STYLE_1] \
10150 .                nr #TOC_HEAD_1_INDENT 0
10151 .          \}
10152 .       \}
10153 .    \}
10154 .    nr #TOC_HEAD_\\n[@LEVEL]_INDENT_SET 1
10155 .    HD_TO_TOC
10156 .    rm $TOC_HEAD_\\n[#LEVEL]_ITEM
10157 .\" Print heading
10158 .    if !\\n[#PARAHEAD] .\\*[$HEAD_\\n[#LEVEL]_QUAD]
10159 .    if \\n[#CAPS_ON] \{\
10160 .       CAPS OFF
10161 .       nr #CAPS_RESTORE 1
10162 .    \}
10163 .    if \\n[#HEAD_\\n[#LEVEL]_CAPS] \{\
10164 .       CAPS 
10165 .       nr #CAPS_OFF 1
10166 .    \}
10167 .    if !'\\*[$HEAD_\\n[#LEVEL]_COLOR]'' \
10168 .       COLOR \\*[$HEAD_\\n[#LEVEL]_COLOR]
10169 .    nop \X'ps: exec decornone'\c
10170 .    nr #ARG_NUM 0 1
10171 .    while \\n+[#ARG_NUM]<=\\n[#NUM_ARGS] \{\
10172 .       if \\n[#PARAHEAD] \
10173 .          nr #PP_TEXT_OFFSET \
10174               \w'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]'+\w'\[parahead-spacer]'
10175 .       if (\\n[#HEAD_\\n[#LEVEL]_UNDERSCORE]=0)&(\\n[#HEAD_\\n[#LEVEL]_UNDERSCORE2]=0) \{\
10176 .          ie \\n[#HD_NUM_INDENT] \{\
10177 .             if !'\\*[$HEAD_\\n[#LEVEL]_QUAD]'CENTER' \
10178 .                ti \\n[#HD_NUM_INDENT]u 
10179 .             PRINT \
10180 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\$[\\n[#ARG_NUM]]
10181 .             br
10182 .          \}
10183 .          el \{\
10184 .             ie !\\n[#PARAHEAD] \{\
10185 .                PRINT \
10186 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10187 .                br
10188 .             \}
10189 .             el \{\
10190 .                if (\\n[#PP]>0):(\\n[#INDENT_FIRST_PARAS]) \{\
10191 .                   if !\\n[#LB_4_PARAHEAD] \{\
10192 .                      if !\\n[#START] \{\
10193 .                         if \\n[#PP_ACTIVE] \{\
10194 .                            ie \\n[#PP]=1 .br
10195 .                            el \{\
10196 .                               nr #PP_TEXT_OFFSET +\\n[#PP_INDENT]
10197 .                               ti \\n[#PP_INDENT]u
10198 .                            \}
10199 .                         \}
10200 .                      \}
10201 .                   \}
10202 .                \}
10203 .                ie \\n[#PRINT_STYLE]=1 \
10204 .                   PRINT "\\*[UL]\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]\\*[ULX]
10205 .                el .PRINT "\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10206 .                rr #LB_4_PARAHEAD
10207 .                sp -1v
10208 .             \}
10209 .          \}
10210 .       \}
10211 .       if \\n[#HEAD_\\n[#LEVEL]_UNDERSCORE] \{\
10212 .          nr #SAVED_UL_WEIGHT \\n[#UNDERSCORE_WEIGHT]
10213 .          UNDERSCORE_WEIGHT \\*[$HEAD_\\n[#LEVEL]_UL_WEIGHT]
10214 .          ie \\n[#HD_NUM_INDENT] \{\
10215 .             if !'\\*[$HEAD_\\n[#LEVEL]_QUAD]'CENTER' \
10216 .                ti \\n[#HD_NUM_INDENT]u 
10217 .             UNDERSCORE \\*[$HEAD_\\n[#LEVEL]_UL_GAP] \
10218                 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\$[\\n[#ARG_NUM]]
10219 .             br
10220 .          \}
10221 .          el \{\
10222 .             ie !\\n[#PARAHEAD] \{\
10223 .                UNDERSCORE \\*[$HEAD_\\n[#LEVEL]_UL_GAP] \
10224 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10225 .                br
10226 .             \}
10227 .             el \{\
10228 .                if (\\n[#PP]>0):(\\n[#INDENT_FIRST_PARAS]) \{\
10229 .                   if !\\n[#LB_4_HD] \{\
10230 .                      if !\\n[#START] \{\
10231 .                         if \\n[#PP_ACTIVE] \{\
10232 .                   nr #PP_TEXT_OFFSET +\\n[#PP_INDENT]
10233 .                   if (\\n[#PRINT_STYLE]=1)&(\\n[#SINGLE_SPACE]=1) .sp -1v
10234 .                   ti \\n[#PP_INDENT]u
10235 .                         \}
10236 .                      \}
10237 .                   \}
10238 .                \}
10239 .                UNDERSCORE \\*[$HEAD_\\n[#LEVEL]_UL_GAP] \
10240                    "\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10241 .                sp -1v
10242 .             \}
10243 .          \}
10244 .          nr #UNDERSCORE_WEIGHT \\n[#SAVED_UL_WEIGHT]
10245 .       \}
10246 .       if \\n[#HEAD_\\n[#LEVEL]_UNDERSCORE2] \{\
10247 .          nr #SAVED_UL2_WEIGHT \\n[#UNDERSCORE_WEIGHT]
10248 .          UNDERSCORE_WEIGHT \\*[$HEAD_\\n[#LEVEL]_UL2_WEIGHT]
10249 .          ie \\n[#HD_NUM_INDENT] \{\
10250 .             if !'\\*[$HEAD_\\n[#LEVEL]_QUAD]'CENTER' \
10251 .                ti \\n[#HD_NUM_INDENT]u 
10252 .             UNDERSCORE2 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_1] \
10253                 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_2] \
10254                 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\$[\\n[#ARG_NUM]]
10255 .             br
10256 .          \}
10257 .          el \{\
10258 .             ie !\\n[#PARAHEAD] \{\
10259 .                UNDERSCORE2 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_1] \
10260                    \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_2] \
10261 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10262 .                br
10263 .             \}
10264 .             el \{\
10265 .                if (\\n[#PP]>0):(\\n[#INDENT_FIRST_PARAS]) \{\
10266 .                   if !\\n[#LB_4_HD] \{\
10267 .                      if !\\n[#START] \{\
10268 .                         if \\n[#PP_ACTIVE] \{\
10269 .                            nr #PP_TEXT_OFFSET +\\n[#PP_INDENT]
10270 .                            if (\\n[#PRINT_STYLE]=1)&(\\n[#SINGLE_SPACE]=1) \
10271 .                               sp -1v
10272 .                            ti \\n[#PP_INDENT]u
10273 .                         \}
10274 .                      \}
10275 .                   \}
10276 .                \}
10277 .                UNDERSCORE2 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_1] \
10278 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_2] "\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10279 .                sp -1v
10280 .             \}
10281 .          \}
10282 .          nr #UNDERSCORE_WEIGHT \\n[#SAVED_UL2_WEIGHT]
10283 .       \}
10284 .       if !\\n[#HD_NUM_INDENT] .nr #HD_NUM_INDENT \w'\\*[$HD_NUM]'
10285 .    \}
10286 .    if !\\n[#PARAHEAD] \{\
10287 .       if \\n[#HEAD_\\n[#LEVEL]_SPACE_AFTER] .sp
10288 .    \}
10289 .    if \\n[#CAPS_OFF] \{\
10290 .       CAPS OFF
10291 .       rr #CAPS_OFF
10292 .    \}
10293 .    if \\n[#CAPS_RESTORE] \{\
10294 .       CAPS
10295 .       rr #CAPS_RESTORE
10296 .    \}
10297 .    ev
10298 .    rm $HD_NUM
10299 .    rr #HD_NUM_INDENT
10300 .    if \\n[#PARAHEAD]   .ti \\n[#PP_TEXT_OFFSET]u
10301 .    if !\\n[#PARAHEAD]  .nr #PP 0
10302 .    rr #PARAHEAD
10303 .    if \\n[#LB_4_HD]    .rr #LB_4_HD
10304 .    if \\n[#QUOTE_4_HD] .rr #QUOTE_4_HD
10305 .    if \\n[@TOP] \{\
10306 .       ch RR_@TOP
10307 .       rr @TOP
10308 .       rs
10309 .       nop \&
10310 .       sp -1
10311 .    \}
10312 .    vpt
10313 .END
10314 \#
10315 \# HEADING_STYLE
10316 \# -------------
10317 \# *Arguments:
10318 \#   <level>
10319 \#   FAMILY <family>
10320 \#   FONT   <font>
10321 \#   SIZE   <+|-n>
10322 \#   COLOR  <color>
10323 \#   CAPS | NO_CAPS
10324 \#---when called as HEADING_STYLE, these are also available---
10325 \#   QUAD   <direction>
10326 \#   NUMBER | NO_NUMBER
10327 \#   SPACE_AFTER | NO_SPACE_AFTER
10328 \#   UNDERSCORE <weight> <gap> | UNDERSCORE2 <weight> <gap1> <gap2> 
10329 \#   NO_UNDERSCORE | NO_UNDERSCORE2
10330 \#   BASELINE_ADJUST
10331 \#---when called as TOC_ENTRY_STYLE this is also available---
10332 \#   INDENT
10333 \# *Function:
10334 \#   Sets up complete style parameters for HEADING <level>.  If
10335 \#   invoked as TOC_ENTRY_STYLE, sets up parameters for the
10336 \#   corresponding TOC entry at <level>.
10337 \# *Notes:
10338 \#   Arguments may be given in any order.  Any not given retain
10339 \#   their current values.  Defaults for an initial 9 levels of
10340 \#   heading are set up in PRINTSTYLE.
10341 \#
10342 \#   NUMBER indicates that hierarchic numbering of <level> should be
10343 \#   prepended to heading text.  If invoked as TOC_ENTRY_STYLE,
10344 \#   prepend numbering to TOC entries at <level> (only works if
10345 \#   NUMBER is given to the corresponding HEADING <level>).
10346 \#
10347 \#   INDENT refers to the indent for <level> in the TOC.  It is
10348 \#   measured from the left offset of the entry level above it
10349 \#   (including numbering, if present).  TOC entry levels beneath
10350 \#   <level> will have their indents adjusted accordingly.
10351 \#
10352 .MAC HEADING_STYLE END
10353 .    if !\B'\\$1' \{\
10354 .       tm1 "[mom]: The first argument to \\$0 must be a numeric heading level.
10355 .       ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10356 .    \}
10357 .    nr #LEVEL \\$1
10358 .    if \\n[#FROM_OLDSTYLE] .nr #LEVEL_\\n[#LEVEL]_SET 1
10359 .    shift
10360 .\" Prepend TOC_ to style strings if called as TOC_ENTRY_STYLE
10361 .    if '\\$0'TOC_ENTRY_STYLE' .ds $TOC TOC_
10362 .    nr #ARG_NUM 0 1
10363 .    nr #ATTRIB \\n[#NUM_ARGS]
10364 .    while \\n+[#ARG_NUM]<=\\n[#ATTRIB] \{\
10365 .       if '\\$1'UNDERSCORE' \{\
10366 .          nr #HEAD_\\n[#LEVEL]_UNDERSCORE 1
10367 .          shift
10368 .          if '\\$1'' \{\
10369 .             tm1 "[mom]: The UNDERSCORE argument to \\$0 requires a rule weight.
10370 .             ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10371 .          \}
10372 .          ds $HEAD_\\n[#LEVEL]_UL_WEIGHT \\$1
10373 .          shift
10374 .          if '\\$1'' \{\
10375 .             tm1 "[mom]: The UNDERSCORE argument to \\$0 requires a rule gap.
10376 .             ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10377 .          \}
10378 .          ds $HEAD_\\n[#LEVEL]_UL_GAP    \\$1
10379 .          shift
10380 .       \}
10381 .       if '\\$1'NO_UNDERSCORE' \{\
10382 .          rr #HEAD_\\n[#LEVEL]_UNDERSCORE
10383 .          shift
10384 .       \}
10385 .       if '\\$1'UNDERSCORE2' \{\
10386 .          nr #HEAD_\\n[#LEVEL]_UNDERSCORE2 1
10387 .          shift
10388 .          if '\\$1'' \{\
10389 .             tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires a rule weight.
10390 .             ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10391 .          \}
10392 .          ds $HEAD_\\n[#LEVEL]_UL2_WEIGHT \\$1
10393 .          shift
10394 .          if '\\$1'' \{\
10395 .             tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires a rule gap.
10396 .             ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10397 .          \}
10398 .          ds $HEAD_\\n[#LEVEL]_UL2_GAP_1  \\$1
10399 .          shift
10400 .          if '\\$1'' \{\
10401 .             tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires an inter-rule gap.
10402 .             ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10403 .          \}
10404 .          ds $HEAD_\\n[#LEVEL]_UL2_GAP_2  \\$1
10405 .          shift
10406 .       \}
10407 .       if '\\$1'NO_UNDERSCORE2' \{\
10408 .          rr #HEAD_\\n[#LEVEL]_UNDERSCORE2
10409 .       \}
10410 .       if '\\$1'SPACE_AFTER' \{\
10411 .          nr #HEAD_\\n[#LEVEL]_SPACE_AFTER 1
10412 .          shift
10413 .       \}
10414 .       if '\\$1'NO_SPACE_AFTER' \{\
10415 .          rr #HEAD_\\n[#LEVEL]_SPACE_AFTER
10416 .          shift
10417 .       \}
10418 .       if '\\$1'FAMILY' \{\
10419 .          shift
10420 .          ds $\\*[$TOC]HEAD_\\n[#LEVEL]_FAM  \\$1
10421 .          shift
10422 .       \}
10423 .       if '\\$1'FONT' \{\
10424 .          shift
10425 .          ds $\\*[$TOC]HEAD_\\n[#LEVEL]_FT   \\$1
10426 .          shift
10427 .       \}
10428 .       if '\\$1'SIZE' \{\
10429 .          shift
10430 .          ds $\\*[$TOC]HEAD_\\n[#LEVEL]_SIZE \\$1
10431 .          shift
10432 .       \}
10433 .       if '\\$1'QUAD' \{\
10434 .          shift
10435 .          if '\\$1'L'      .ds $HEAD_\\n[#LEVEL]_QUAD LEFT
10436 .          if '\\$1'LEFT'   .ds $HEAD_\\n[#LEVEL]_QUAD LEFT
10437 .          if '\\$1'C'      .ds $HEAD_\\n[#LEVEL]_QUAD CENTER
10438 .          if '\\$1'CENTRE' .ds $HEAD_\\n[#LEVEL]_QUAD CENTER
10439 .          if '\\$1'CENTER' .ds $HEAD_\\n[#LEVEL]_QUAD CENTER
10440 .          if '\\$1'R'      .ds $HEAD_\\n[#LEVEL]_QUAD RIGHT
10441 .          if '\\$1'RIGHT'  .ds $HEAD_\\n[#LEVEL]_QUAD RIGHT
10442 .          shift
10443 .       \}
10444 .       if '\\$1'COLOR' \{\
10445 .          shift
10446 .          ds $\\*[$TOC]HEAD_\\n[#LEVEL]_COLOR \\$1
10447 .          shift
10448 .       \}
10449 .       if '\\$1'BASELINE_ADJUST' \{\
10450 .          shift
10451 .          ds $HEAD_\\n[#LEVEL]_BASELINE_ADJ \\$1
10452 .          shift
10453 .       \}
10454 .       if '\\$1'CAPS' \{\
10455 .          nr #\\*[$TOC]HEAD_\\n[#LEVEL]_CAPS 1
10456 .          shift
10457 .       \}
10458 .       if '\\$1'NO_CAPS' \{\
10459 .          rr #HEAD_\\n[#LEVEL]_CAPS
10460 .          shift
10461 .       \}
10462 .       if '\\$1'NUMBER' \{\
10463 .          nr #NUMBER_HEAD_\\n[#LEVEL] 1
10464 .          nr #HEAD_\\n[#LEVEL]_NUM 0 1
10465 .          shift
10466 .       \}
10467 .       if '\\$1'NO_NUMBER' \{\
10468 .          rr #NUMBER_HEAD_\\n[#LEVEL]
10469 .          shift
10470 .       \}
10471 .       if '\\$1'INDENT' \{\
10472 .          shift
10473 .          nr #TOC_HEAD_\\n[#LEVEL]_INDENT \\$1
10474 .          nr #FROM_STYLE_\\n[#LEVEL] 1
10475 .          shift
10476 .       \}
10477 .    \}
10478 .    rr #LEVEL
10479 .    if d$TOC .rm $TOC
10480 .END
10481 \#
10482 .ALIAS TOC_ENTRY_STYLE HEADING_STYLE
10483 \#
10484 \# OLDSTYLE HEADINGS
10485 \# -----------------
10486 \# *Arguments:
10487 \#   None.
10488 \# *Function:
10489 \#   Called from HEAD, SUBHEAD, and SUBSUBHEAD, sets style
10490 \#   parameters for HEADINGs 1-3 to former mom defaults for those macros.
10491 \#   Any styles already assigned to those levels are retained.
10492 \#
10493 \#   Called by user with no argument, allows use of old style HEAD,
10494 \#   SUBHEAD, and SUBSUBHEAD without generating the deprecated msg.
10495 \# *Notes:
10496 \#   For backward compatibility, and to ease the transition to
10497 \#   the HEADING scheme for heads.
10498 \#
10499 \#   Paraheads must be set with .HEADING <level> PARAHEAD; attempts
10500 \#   to call PARAHEAD abort with an instructive message.
10501 \#
10502 .MAC OLDSTYLE_HEADINGS END
10503 .    if '\\$1'' .nr #SKIP_MSG 1
10504 .    nr #FROM_OLDSTYLE 1 \" Used in HEADING
10505 .    if \\n[#PRINT_STYLE]=1 \{\
10506 .       if !\\n[#LEVEL_1_SET] \{\
10507 .          HEADING_STYLE 1 \
10508              FONT R \
10509              SIZE +0 \
10510              QUAD C \
10511              CAPS \
10512              UNDERSCORE .5 2p \
10513              BASELINE_ADJUST 0 \
10514              SPACE_AFTER
10515 .            nr #OLDSTYLE_HD 1
10516 .            return
10517 .       \}
10518 .       if !\\n[#LEVEL_2_SET] \{\
10519 .          HEADING_STYLE 2 \
10520              FONT R \
10521              SIZE +0 \
10522              UNDERSCORE .5 2p \
10523              BASELINE_ADJUST \\n[.v]/8
10524 .            nr #OLDSTYLE_SH 1
10525 .            return
10526 .       \}
10527 .       if !\\n[#LEVEL_3_SET] \{\
10528 .          HEADING_STYLE 3 \
10529              FONT R \
10530              SIZE +0 \
10531              BASELINE_ADJUST \\n[.v]/8
10532 .            nr #OLDSTYLE_SSH 1
10533 .            return
10534 .       \}
10535 .    \}
10536 .    if \\n[#PRINT_STYLE]=2 \{\
10537 .       if !\\n[#LEVEL_1_SET] \{\
10538 .          HEADING_STYLE 1 \
10539              FAMILY \E*[$DOC_FAM] \
10540              FONT B \
10541              SIZE +1 \
10542              QUAD C \
10543              CAPS \
10544              UNDERSCORE .5 2p \
10545              BASELINE_ADJUST 0 \
10546              SPACE_AFTER
10547 .            nr #OLDSTYLE_HD 1
10548 .            return
10549 .       \}
10550 .       if !\\n[#LEVEL_2_SET] \{\
10551 .          HEADING_STYLE 2 \
10552              FAMILY \E*[$DOC_FAM] \
10553              FONT B \
10554              SIZE +.5 \
10555              BASELINE_ADJUST \\n[.v]/8
10556 .            nr #OLDSTYLE_SH 1
10557 .            return
10558 .       \}
10559 .       if !\\n[#LEVEL_3_SET] \{\
10560 .          HEADING_STYLE 3 \
10561              FAMILY \E*[$DOC_FAM] \
10562              FONT I \
10563              SIZE +.5 \
10564              BASELINE_ADJUST \\n[.v]/8
10565 .            nr #OLDSTYLE_SSH 1
10566 .            return
10567 .       \}
10568 .    \}
10569 .    rr #FROM_OLDSTYLE
10570 .END
10571 \#
10572 \# "Deprecated" message
10573 \#
10574 .MAC DEPRECATED END
10575 .    if !\\n[#SKIP_MSG] \{\
10576 .       tm1 "[mom]: Macro '\\$1' at line \\n[.c] is deprecated.
10577 .       tm1 "       Invoking HEADING \\$2 instead and assigning style defaults
10578 .       tm1 "          from former \\$1 as described in the documentation.
10579 .       tm1 "       If another style is desired, use HEADING_STYLE \\$2 to
10580 .       tm1 "          create it (see docs).
10581 .       tm1 "       Further warnings will not be emitted for \\$1.
10582 .       tm1 "       To avoid this message when using the deprecated HEAD,
10583 .       tm1 "          SUBHEAD, and SUBSUBHEAD macros, add '.OLDSTYLE_HEADINGS'
10584 .       tm1 "          after PRINTSTYLE before START.
10585 .       rm $MACRO
10586 .    \}
10587 .END
10588 \#
10589 \# Wrappers around old-style headings.
10590 \#
10591 .MAC HEAD END
10592 .    if !\\n[#OLDSTYLE_HD] \{\
10593 .       DEPRECATED HEAD 1
10594 .       OLDSTYLE_HEADINGS HEAD
10595 .    \}
10596 .    HEADING 1 \\$@
10597 .END
10598 \#
10599 .MAC SUBHEAD END
10600 .    if !\\n[#OLDSTYLE_SH] \{\
10601 .       DEPRECATED SUBHEAD 2
10602 .       OLDSTYLE_HEADINGS SUBHEAD
10603 .    \}
10604 .     HEADING 2 \\$@
10605 .END
10606 \#
10607 .MAC SUBSUBHEAD END
10608 .    if !\\n[#OLDSTYLE_SSH] \{\
10609 .       DEPRECATED SUBSUBHEAD 3
10610 .       OLDSTYLE_HEADINGS SUBSUBHEAD
10611 .    \}
10612 .    HEADING 3 \\$@
10613 .END
10614 \#
10615 .MAC PARAHEAD END
10616 .    tm1 "[mom]: \\$0 is no longer a valid macro.
10617 .    tm1 "       Use 'HEADING <level> PARAHEAD <text>' instead.
10618 .    tm1 "       You will probably want to invoke HEADING_STYLE to set
10619 .    tm1 "       the type parameters for the parahead.  See docs.
10620 .    ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10621 .END
10622 \#
10623 \# Wrapper macro for oldstyle NUMBER_HEADS, NUMBER_SUBHEADS...
10624 \#
10625 .MAC HEADING_NUMBERS END
10626 .    if '\\$0'NUMBER_PARAHEADS' \{\
10627 .       tm1 "[mom]: \\$0 is no longer a valid macro.
10628 .       tm1 "       Use 'HEADING_STYLE <level> NUMBER' instead.  See docs.
10629 .       ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10630 .       return
10631 .    \}
10632 .    if '\\$0'NUMBER_HEADS'       .nr level 1
10633 .    if '\\$0'NUMBER_SUBHEADS'    .nr level 2
10634 .    if '\\$0'NUMBER_SUBSUBHEADS' .nr level 3
10635 .    ds mom "[mom]:\"
10636 .    ie '\\$1'' .ds $PARAM NUMBER
10637 .    el \{\
10638 .       ds $PARAM NO_NUMBER
10639 .       ds $SWITCH " \\$1
10640 .    \}
10641 .    HEADING_STYLE \\n[level] \\*[$PARAM]
10642 .    if (\\n[#OLDSTYLE_HD]=1):(\\n[#OLDSTYLE_SH]=1):(\\n[#OLDSTYLE_SSH]=1) \{\
10643 .       tm1 "\\*[mom] OLDSTYLE_HEADINGS detected.
10644 .       ds mom "      \"
10645 .    \}
10646 .    tm1 "\\*[mom] Setting HEADING_STYLE \\n[level] to '\\*[$PARAM]' at '\\$0\\*[$SWITCH]', line \\n[.c].
10647 .    rm $PARAM
10648 .    rm $SWITCH
10649 .END
10650 \#
10651 .ALIAS NUMBER_HEADS       HEADING_NUMBERS
10652 .ALIAS NUMBER_SUBHEADS    HEADING_NUMBERS
10653 .ALIAS NUMBER_SUBSUBHEADS HEADING_NUMBERS
10654 .ALIAS NUMBER_PARAHEADS   HEADING_NUMBERS
10655 \#
10656 \# PREFIX CHAPTER NUMBERS TO HEADINGS/TOC ENTRIES
10657 \# ----------------------------------------------------------------
10658 \# *Arguments:
10659 \#   <none> | <chapter number> | <anything>
10660 \# *Function:
10661 \#   Toggles register #PREFIX_CH_NUM. Sets register #CH_NUM from
10662 \#   string $CHAPTER if $CHAPTER is a digit; if <chapter number> arg
10663 \#   given, sets #CH_NUM to arg.
10664 \# *Notes:
10665 \#   Default is OFF.
10666 \#
10667 .MAC PREFIX_CHAPTER_NUMBER END
10668 .    ie '\\$1'' \{\
10669 .       ie r#CH_NUM \{\
10670 .          nr #PREFIX_CH_NUM 1
10671 .          if \\n[#CHAPTER_CALLED] \{\
10672 .             ie \B'\\*[$CHAPTER]' .nr #CH_NUM \\*[$CHAPTER]
10673 .             el .PREFIX_CH_NUM_WARNING
10674 .             rr #CHAPTER_CALLED
10675 .          \}
10676 .       \}
10677 .       el \{\
10678 .          ie \B'\\*[$CHAPTER]' \{\
10679 .             nr #PREFIX_CH_NUM 1
10680 .             nr #CH_NUM \\*[$CHAPTER]
10681 .          \}
10682 .          el .PREFIX_CH_NUM_WARNING
10683 .       \}
10684 .    \}
10685 .    el \{\
10686 .       ie \B'\\$1' \{\
10687 .          nr #CH_NUM \\$1
10688 .          nr #PREFIX_CH_NUM 1
10689 .       \}
10690 .       el .rr #PREFIX_CH_NUM
10691 .    \}
10692 .END
10693 \#
10694 .MAC PREFIX_CH_NUM_WARNING END
10695 .    tm1 "[mom]: PREFIX_CHAPTER_NUMBER cannot determine a chapter number.
10696 .    tm1 "       Enter the current chapter number as a digit after
10697 .    tm1 "       PREFIX_CHAPTER_NUMBER.
10698 .    ab Aborting '\\n[.F]', line \\n[.c].
10699 .END
10700 \#
10701 \# ====================================================================
10702 \#
10703 \# +++LINE BREAKS+++
10704 \#
10705 \# LINEBREAK CHARACTER
10706 \# -------------------
10707 \# *Arguments:
10708 \#   [character] [iterations] [vertical adjustment]
10709 \# *Function:
10710 \#   Allows user to specify a line break character and the number
10711 \#   of times to repeat it horiontally.
10712 \# *Notes:
10713 \#   Without an argument, LINEBREAK_CHAR will deposit a blank line.
10714 \#
10715 \#   Vertical adjustment requires a unit of measure (most likely
10716 \#   "p"), and has to be preceded by +|-
10717 \#
10718 .MAC LINEBREAK_CHAR END
10719 .    nr #REPEAT 1
10720 .    ds $LINEBREAK_CHAR \\$1
10721 .    if !'\\$2'' .nr #LB_CHAR_ITERATIONS \\$2
10722 .    if !'\\$3'' .ds $LINEBREAK_CHAR_V_ADJ \\$3
10723 .    if '\\*[$LINEBREAK_CHAR_V_ADJ]'' .ds $LINEBREAK_CHAR_V_ADJ +0
10724 .    if \\n[#LB_CHAR_ITERATIONS] \{\
10725 .       while (\\n[#LB_CHAR_ITERATIONS]>\\n[#REPEAT]) \{\
10726 .          as $LINEBREAK_CHAR "\\ \\$1
10727 .          nr #REPEAT \\n[#REPEAT]+1
10728 .       \}
10729 .    \}
10730 .    rr #REPEAT
10731 .    rr #LB_CHAR_ITERATIONS
10732 .END
10733 \#
10734 \# LINE BREAK
10735 \# ----------
10736 \# *Arguments:
10737 \#   <none>
10738 \# *Function:
10739 \#   Deposits line break character.
10740 \# *Notes:
10741 \#   If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
10742 \#
10743 .MAC LINEBREAK END
10744 .    if r #Q_AT_TOP .rr #Q_AT_TOP
10745 .    ie  '\\*[$LINEBREAK_CHAR]'' .sp 2
10746 .    el \{\
10747 .       ie \\n[#END_QUOTE] .
10748 .       el .sp
10749 .       ev LINEBREAK
10750 .       evc 0
10751 .       CENTER
10752 .       PRINT \
10753 \m[\\*[$LINEBREAK_COLOR]]\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\
10754 \\*[$LINEBREAK_CHAR]\m[]
10755 .       sp
10756 .       ev
10757 .       QUAD \\*[$DOC_QUAD]
10758 .    \}
10759 .    nr #LINEBREAK 1
10760 .    if r #QUOTE .rr #QUOTE
10761 .    if r #END_QUOTE .rr #END_QUOTE
10762 .    nr #PP 0
10763 .    nr #LB_4_HD       1
10764 .    nr #LB_4_PARAHEAD 1
10765 .END
10766 \#
10767 \# ====================================================================
10768 \#
10769 \# +++PARAGRAPHS+++
10770 \#
10771 \# PARAGRAPH FONT
10772 \# --------------
10773 \# *Argument:
10774 \#   <font of running text>
10775 \# *Function:
10776 \#   Creates or modifies string $PP_FT.
10777 \# *Notes:
10778 \#   Affects all paragraphs.
10779 \#
10780 .MAC PP_FONT END
10781 .    if \\n[#PRINT_STYLE]=1 \{\
10782 .       ie \\n[#ITALIC_MEANS_ITALIC] .nop
10783 .       el .return
10784 .    \}
10785 .    if \\n[#COLLATE]=1 \
10786 .       if !'\\*[$SAVED_PP_FT]'' .rm $SAVED_PP_FT
10787 .    ds $PP_FT \\$1
10788 .    FT \\*[$PP_FT]
10789 .END
10790 \#
10791 \# PARAGRAPH INDENT
10792 \# ----------------
10793 \# *Argument:
10794 \#   <amount to indent paragraphs in running text (ipPcm)>
10795 \# *Function:
10796 \#   Allows user to change the default para indent.  The change will
10797 \#   affect the indent of QUOTEs and BLOCKQUOTEs as well.
10798 \# *Notes:
10799 \#   Default for printstyle TYPEWRITE is 1/2-inch.  Default for
10800 \#   printstyle TYPESET is 2 ems.  The defaults are set in
10801 \#   PRINTSTYLE, not DEFAULTS.
10802 \#
10803 .MAC PARA_INDENT END
10804 .    ie \B'\\$1' \{\
10805 .       nr #PP_INDENT (\\$1)
10806 .       nr #SAVED_PP_INDENT \\n[#PP_INDENT]
10807 .    \}
10808 .    el \{\
10809 .       ie '\\$1'' \{\
10810 .          nr #PP_INDENT \\n[#SAVED_PP_INDENT]
10811 .          rr #SAVED_PP_INDENT
10812 .       \}
10813 .       el \{\
10814 .          nr #SAVED_PP_INDENT \\n[#PP_INDENT]
10815 .          rr #PP_INDENT
10816 .       \}
10817 .    \}
10818 .END
10819 \#
10820 \# INDENT FIRST PARAGRAPHS
10821 \# -----------------------
10822 \# *Arguments:
10823 \#   <none> | <anything>
10824 \# *Function:
10825 \#   By default, the first para of a document, as well as the first
10826 \#   paras of blockquotes and block-style epigraphs are not indented.
10827 \#   When invoked, this macro will indent all paras.
10828 \# *Notes:
10829 \#   Default is OFF.
10830 \#
10831 .MAC INDENT_FIRST_PARAS END
10832 .    ie '\\$1'' .nr #INDENT_FIRST_PARAS 1
10833 .    el .rr #INDENT_FIRST_PARAS
10834 .END
10835 \#
10836 \# INTER-PARAGRAPH SPACING
10837 \# -----------------------
10838 \# *Arguments:
10839 \#   <none> | <anything>
10840 \# *Function:
10841 \#   Adds a line space between paragraphs in body text.  Block quotes
10842 \#   are unaffected.
10843 \# *Notes:
10844 \#   Default is OFF.  PARA_SPACE is not recommended for use with
10845 \#   PRINTSTYLE TYPEWRITE without SINGLESPACE.
10846 \#
10847 .MAC PARA_SPACE END
10848 .    ie '\\$1'' \{\
10849 .       nr #PP_SPACE 1
10850 .    \}
10851 .    el \{\
10852 .       ie \B'\\$1' \{\
10853 .          nr #PP_SPACE 1
10854 .          ds $PP_SPACE_AMOUNT \\$1
10855 .       \}
10856 .       el .rr #PP_SPACE
10857 .    \}
10858 .END
10859 \#
10860 \# PARAGRAPH
10861 \# ---------
10862 \# *Arguments:
10863 \#   <none>
10864 \# *Function:
10865 \#   Figures out what to do with paragraphs under differing conditions.
10866 \# *Notes:
10867 \#   Note the use of transparent line break (\!.br) to get
10868 \#   PP to work within blockquotes and epigraphs.
10869 \#
10870 \#   PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
10871 \#
10872 .MAC PP END
10873 .    if \\n[#DOC_TYPE]=4 \{\
10874 .       if !'\\n[.z]'' .di
10875 .       nr #TOTAL_FIELDS \\n[#FIELD]
10876 .       nr #FIELD        0 1
10877 .       nr #NUM_FIELDS   0 1
10878 .       if \\n[#TOTAL_FIELDS]>0 \{\
10879 .          while \\n+[#NUM_FIELDS]<=\\n[#TOTAL_FIELDS] \{\
10880 .             nf
10881 .             LETTERHEAD\\n+[#FIELD]
10882 .             QUAD \\*[$DOC_QUAD]
10883 .             ALD \\n[#DOC_LEAD]u
10884 .             if \\n[#DATE_FIRST]=1 .ALD \\n[#DOC_LEAD]u
10885 .             rr #DATE_FIRST
10886 .             rm LETTERHEAD\\n[#FIELD]
10887 .          \}
10888 .          rr #FIELD
10889 .          rr #NUM_FIELDS
10890 .          rr #TOTAL_FIELDS
10891 .       \}
10892 .    \}
10893 .    rr #PP_ACTIVE
10894 .    if r #Q_AT_TOP .rr #Q_AT_TOP
10895 .    if \\n[#PP_STYLE]=1 \{\
10896 .       if \\n[#ENDNOTE] \{\
10897 .          nr #RESET_PARA_SPACE \\n[#PP_SPACE]
10898 .          ie \\n[#EN_PP_SPACE] .PARA_SPACE
10899 .          el .PARA_SPACE OFF
10900 .       \}
10901 .       if !\\n[#ENDNOTE] .po \\n[#L_MARGIN]u
10902 .       if \\n[#COLUMNS] \{\
10903 .          if !\\n[#ENDNOTE] \{\
10904 .             po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
10905 .             nr #L_MARGIN \\n[.o]
10906 .          \}
10907 .       \}
10908 .       if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
10909 .       ie \\n[#PRINT_STYLE]=1 \{\
10910 .          TYPEWRITER
10911 .          ie \\n[#ENDNOTE] .vs \\n[#EN_LEAD]u
10912 .          el .vs \\n[#DOC_LEAD]u
10913 .          QUAD \\*[$DOC_QUAD]
10914 .          if \\n[#SLANT_ON] \{\
10915 .             if \\n[#UNDERLINE_SLANT] .UNDERLINE
10916 .          \}
10917 .          if '\\*[$PP_FT]'I' \
10918 .             if \\n[#ITALIC_MEANS_ITALIC] .FT I
10919 .       \}
10920 .       el \{\
10921 .          ie \\n[#ENDNOTE] \{\
10922 .             FAMILY  \\*[$EN_FAM]
10923 .             FT      \\*[$EN_FT]
10924 .             ps \\n[#EN_PS]u
10925 .             vs \\n[#EN_LEAD]u
10926 .             QUAD    \\*[$EN_QUAD]
10927 .          \}
10928 .          el \{\
10929 .             FAMILY  \\*[$DOC_FAM]
10930 .             if !'\\*[$SAVED_PP_FT]'' \{\
10931 .                ds $PP_FT \\*[$SAVED_PP_FT]
10932 .                rm $SAVED_PP_FT
10933 .             \}
10934 .             FT \\*[$PP_FT]
10935 .             ps \\n[#DOC_PT_SIZE]u
10936 .             vs      \\n[#DOC_LEAD]u
10937 .             QUAD    \\*[$DOC_QUAD]
10938 .          \}
10939 .       \}
10940 .       ie \\n[#PP]=0 \{\
10941 .          if \\n[#INDENT_FIRST_PARAS] \{\
10942 .             ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
10943 .             el .ti \\n[#PP_INDENT]u
10944 .             if '\\n[.z]'END_NOTES' \
10945 .                ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
10946 .          \}
10947 .          if r #END_QUOTE \{\
10948 .             if \\n[#END_QUOTE] \{\
10949 .                if !\\n[#LINEBREAK] \{\
10950 .                   ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
10951 .                   el .ti \\n[#PP_INDENT]u
10952 .                   if '\\n[.z]'END_NOTES' \
10953 .                      ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
10954 .                \}
10955 .             \}
10956 .          \}
10957 .       \}
10958 .       el \{\
10959 \#.          br
10960 .          if \\n[#PP_SPACE] \{\
10961 .             ie \\n[#END_QUOTE] \{\
10962 .                ie !'\\*[$PP_SPACE_AMOUNT]'' .ALD \\*[$PP_SPACE_AMOUNT]
10963 .                el .sp
10964 .                rr #END_QUOTE
10965 .                nr #NO_SPACE 1
10966 .                nr #BASELINE_MARK \\n[nl]
10967 .             \}
10968 .             el \{\
10969 .                if \\n[#NO_SPACE]=1 .rr #NO_SPACE
10970 .                if !\\n[nl]=\\n[#BASELINE_MARK] \{\
10971 .                ie !'\\*[$PP_SPACE_AMOUNT]'' .ALD \\*[$PP_SPACE_AMOUNT]
10972 .                el .sp
10973 .                   rr #BASELINE_MARK
10974 .                \}
10975 .             \}
10976 .          \}
10977 .          ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
10978 .          el .ti \\n[#PP_INDENT]u
10979 .          if '\\n[.z]'END_NOTES' \
10980 .             ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
10981 .       \}
10982 .       if r #START     .rr #START
10983 .       if r #QUOTE     .rr #QUOTE
10984 .       if r #END_QUOTE .rr #END_QUOTE
10985 .       if r #HEAD      .rr #HEAD
10986 .       if r #SUBHEAD   .rr #SUBHEAD
10987 .       if r #EPIGRAPH  .rr #EPIGRAPH
10988 .       if r #Q_FITS    .rr #Q_FITS
10989 .       if r #LINEBREAK .rr #LINEBREAK
10990 .       if \\n[#ENDNOTE] \{\
10991 .          ie \\n[#RESET_PARA_SPACE] .PARA_SPACE
10992 .          el .PARA_SPACE OFF
10993 .       \}
10994 .       if \\n[#CONDENSE] \{\
10995 \E*[COND]\c
10996 .       \}
10997 .       if \\n[#EXTEND]=1 \{\
10998 \E*[EXT]\c
10999 .       \}
11000 .       nr #PP +1
11001 .    \}
11002 .    if \\n[#PP_STYLE]=2 \{\
11003 \!.     br
11004 .       if \\n[#BROKEN_QUOTE] \{\
11005 .          ie \\n[nl]=\\n[#PAGE_TOP] .nr #Q_PP 1
11006 .          el .nr #Q_PP 0
11007 .          rr #BROKEN_QUOTE
11008 .       \}
11009 .       ie \\n[#Q_PP]=0 \{\
11010 .          if \\n[#INDENT_FIRST_PARAS] \
11011 .             ti \\n[#PP_INDENT]u/2u
11012 .          if \\n[#ENDNOTE] \{\
11013 .             ie \\n[#INDENT_FIRSTS] .ti \\n[#PP_INDENT]u/2u
11014 .             el .ti 0
11015 .          \}
11016 .       \}
11017 .       el \{\
11018 .          ti \\n[#PP_INDENT]u/2u
11019 .          if \\n[#PP_SPACE]=1 \{\
11020 .             ie !'\\*[$PP_SPACE_AMOUNT]'' .ALD \\*[$PP_SPACE_AMOUNT]
11021 .             el .sp
11022 .          \}
11023 .       \}
11024 .       if \\n[#CONDENSE] \{\
11025 \E*[COND]\c
11026 .       \}
11027 .       if \\n[#EXTEND]=1 \{\
11028 \E*[EXT]\c
11029 .       \}
11030 .    nr #Q_PP +1
11031 .    \}
11032 .\" This takes care of multi-paragraph dialogue, where each para
11033 .\" is introduced by an open quote whereas the previous para has
11034 .\" no close quote.
11035 .    if \\n[#OPEN_CLOSE]=1 .nr #OPEN_CLOSE 0
11036 .    nr #PP_ACTIVE 1
11037 .    UNDERLINE OFF
11038 .    if r #QUOTE_4_HD .rr #QUOTE_4_HD
11039 .    if r #LB_4_HD .rr #LB_4_HD
11040 .END
11041 \# ====================================================================
11042 \#
11043 \# +++QUOTES+++
11044 \#
11045 \# ---Line for line quotes, i.e. poetry or code snippets---
11046 \#
11047 \# UNDERLINE QUOTES
11048 \# ----------------
11049 \# *Arguments:
11050 \#   <none> | <anything>
11051 \# *Function:
11052 \#   Creates or modifies register #UNDERLINE_QUOTES (toggle).
11053 \#   If on, line for line quotes are underlined when printstyle
11054 \#   is TYPEWRITE.
11055 \# *Notes:
11056 \#   Default is ON for printstyle TYPEWRITE.
11057 \#
11058 .MAC UNDERLINE_QUOTES END
11059 .    ie '\\$1'' .nr #UNDERLINE_QUOTES 1
11060 .    el .rr #UNDERLINE_QUOTES
11061 .END
11062 \#
11063 \# QUOTE INDENT
11064 \# ------------
11065 \# *Argument:
11066 \#   <integer> | <integer with unit of measure appended>
11067 \# *Function:
11068 \#   Creates or modifies register #Q_OFFSET_VALUE or string
11069 \#   $Q_OFFSET_VALUE.
11070 \# *Notes:
11071 \#   If just an integer given, value by which to multiply PARA_INDENT
11072 \#   to get quote indent.  If integer with a unit of measure appended,
11073 \#   absolute value of quote indent.
11074 \#
11075 \#  Default is 3 for typeset; 2 for typewrite.
11076 \#
11077 .MAC QUOTE_INDENT END
11078 .    rr #Q_OFFSET_VALUE
11079 .    rm $Q_OFFSET_VALUE
11080 .    ds $EVAL_QI_ARG \\$1
11081 .    substring $EVAL_QI_ARG -1
11082 .    ie \B'\\*[$EVAL_QI_ARG]' .nr #Q_OFFSET_VALUE \\$1
11083 .    el .ds $Q_OFFSET_VALUE \\$1
11084 .    rm $EVAL_QI_ARG
11085 .END
11086 \#
11087 \# QUOTE_AUTOLEAD
11088 \# --------------
11089 \# *Arguments:
11090 \#   <autolead value>
11091 \# *Function:
11092 \#   Sets autolead for quotes and/or blockquotes.
11093 \#
11094 .MAC QUOTE_AUTOLEAD END
11095 .    rr #\\$0_DEFAULT
11096 .    if '\\$0'QUOTE_AUTOLEAD'              .nr #Q_AUTOLEAD (p;\\$1)
11097 .    if '\\$0'BLOCKQUOTE_AUTOLEAD'         .nr #BQ_AUTOLEAD (p;\\$1)
11098 .    if '\\$0'ENDNOTE_QUOTE_AUTOLEAD'      .nr #EN_Q_AUTOLEAD (p;\\$1)
11099 .    if '\\$0'ENDNOTE_BLOCKQUOTE_AUTOLEAD' .nr #EN_BQ_AUTOLEAD (p;\\$1)
11100 .END
11101 \#
11102 .ALIAS BLOCKQUOTE_AUTOLEAD         QUOTE_AUTOLEAD
11103 .ALIAS ENDNOTE_QUOTE_AUTOLEAD      QUOTE_AUTOLEAD
11104 .ALIAS ENDNOTE_BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
11105 \#
11106 \# ALWAYS FULLSPACE QUOTES
11107 \# -----------------------
11108 \# *Arguments:
11109 \#   <none> | <anything>
11110 \# *Function:
11111 \#   Toggles register #FULLSPACE_QUOTES.
11112 \# *Notes:
11113 \#   If user doesn't like the default 1/2 line space above and below
11114 \#   quotes, s/he can turn it off here.  Has no effect in TYPEWRITE.
11115 \#
11116 .MAC ALWAYS_FULLSPACE_QUOTES END
11117 .    if '\\$1'' .nr #FULLSPACE_QUOTES 1
11118 .    el .rr #FULLSPACE_QUOTES
11119 .END
11120 \#
11121 \# QUOTE
11122 \# -----
11123 \# *Arguments:
11124 \#   <none> | <anything>
11125 \# *Function:
11126 \#   Indents quoted text on a line for line basis, or turns QUOTE off.
11127 \# *Notes:
11128 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
11129 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
11130 \#   how much space to put before and after.
11131 \#
11132 \# QUOTE
11133 \# -----
11134 \# *Arguments:
11135 \#   <none> | <anything>
11136 \# *Function:
11137 \#   Indents quoted text on a line for line basis, or turns QUOTE off.
11138 \# *Notes:
11139 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
11140 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
11141 \#   how much space to put before and after.
11142 \#
11143 .MAC QUOTE END
11144 .    br
11145 .    if \\n[#PP]>0 .rr #START
11146 .    if \\n[#LINENUMBERS]=1 \{\
11147 .       nr #LINENUMBERS 2
11148 .       nr #NEXT_LN \\n[ln]
11149 .       nm
11150 .    \}
11151 .    ie '\\$1'' \{\
11152 .       ev QUOTE
11153 .       evc 0
11154 .       if \\n[#LINENUMBERS]=2 \{\
11155 .          if \\n[#SILENT_QUOTE_LN]=1 .nm \\n[#NEXT_LN] 1000 -4
11156 .       \}
11157 .       nr #IN_DIVER 1
11158 .       nr #QUOTE 1
11159 .       di P_QUOTE
11160 .       ie !'\\*[$Q_OFFSET_VALUE]'' .ll \\n[#L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11161 .       el .ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11162 .       ta \\n[.l]u
11163 .       if \\n[#COLUMNS] \{\
11164 .          ie \\n[#Q_OFFSET_VALUE] \
11165 .             ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
11166 .          el .ll \\n[#COL_L_LENGTH]u-\\*[$Q_OFFSET_VALUE]
11167 .          ta \\n[.l]u
11168 .       \}
11169 .       if \\n[#PRINT_STYLE]=1 \{\
11170 .          TYPEWRITER
11171 .          vs \\n[#DOC_LEAD]u
11172 .          LEFT
11173 .       \}
11174 .       if \\n[#PRINT_STYLE]=2 \{\
11175 .          FAMILY  \\*[$QUOTE_FAM]
11176 .          FT      \\*[$QUOTE_FT]
11177 .          ps \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
11178 .          ie !r #Q_AUTOLEAD .vs \\n[#DOC_LEAD]u
11179 .          el \{\
11180 .             vs \\n[.ps]u+\\n[#Q_AUTOLEAD]u
11181 .             nr #Q_LEAD \\n[.v]
11182 .          \}
11183 .          if \\n[#ENDNOTE] \{\
11184 .             ps \\n[#EN_PS]u\\*[$QUOTE_SIZE_CHANGE]
11185 .             ie !r #EN_Q_AUTOLEAD .vs \\n[#EN_Q_LEAD]u
11186 .             el \{\
11187 .                vs \\n[.ps]u+\n[#EN_Q_AUTOLEAD]u
11188 .                nr #EN_Q_LEAD \\n[.v]
11189 .             \}
11190 .          \}
11191 .          nr #Q_LEAD_REAL \\n[.v]
11192 .          LEFT
11193 .          if \\n[#QUOTE_COLOR]=1 \{\
11194 .             nf
11195 \m[\\*[$QUOTE_COLOR]]
11196 .             EOL
11197 .          \}
11198 .       \}
11199 .       if \\n[#LINENUMBERS]=2 \{\
11200 .          ie \\n[#QUOTE_LN]=1 \{\
11201 .             if '\\n[#Q_LN_GUTTER]'' .nr #Q_LN_GUTTER \\n[#LN_GUTTER]
11202 .             LN_PARAMS
11203 .             nm \\n[ln] "" \\n[#Q_LN_GUTTER] -3-\\n[#Q_LN_GUTTER]
11204 .             RESTORE_PARAMS
11205 .          \}
11206 .          el \{\
11207 .             if !\\n[#SILENT_QUOTE_LN] .NUMBER_LINES OFF
11208 .          \}
11209 .       \}
11210 .       nr #Q_TOP \\n[nl]
11211 .       if \\n[#PRINT_STYLE]=1 \
11212 .          if \\n[#UNDERLINE_QUOTES] .FT I
11213 .    \}
11214 .    el .DO_QUOTE
11215 .END
11216 \#
11217 \# CODE
11218 \# ----
11219 \# *Arguments:
11220 \#   <none> [ BR | BREAK | SPREAD ]
11221 \#    or
11222 \#   <anything> [ BR | BREAK | SPREAD ]
11223 \# *Function:
11224 \#   Takes care of administrivia associated with setting code snippets.
11225 \#
11226 .MAC CODE END
11227 \c
11228 .    if '\\$1'BR' \{\
11229 .       br
11230 .       nr #BREAK_OR_SPREAD 1
11231 .       shift
11232 .    \}
11233 .    if '\\$1'BREAK' \{\
11234 .       nr #BREAK_OR_SPREAD 1
11235 .       br
11236 .       shift
11237 .    \}
11238 .    if '\\$1'SPREAD' \{\
11239 .       nr #BREAK_OR_SPREAD 2
11240 .       brp
11241 .       shift
11242 .    \}
11243 .    ie '\\$1'' \{\
11244 .       ds $RESTORE_FAM \\n[.fam]
11245 .       ds $RESTORE_FT  \\n[.sty]
11246 .       ie \\n[#PRINT_STYLE]=1 \{\
11247 .          CODE_FAMILY C
11248 .          ie \\n[#CODE_FT]=1 .ft \\*[$CODE_FT]
11249 .          el \{\
11250 .             CODE_FONT R
11251 .             ft R
11252 .             char ' \[aq]
11253 .          \}
11254 .          if \\n[#UNDERLINE_QUOTES]=1 \{\
11255 .             nr #RESTORE_UNDERLINE 1
11256 .             UNDERLINE_QUOTES OFF
11257 .             FT \\*[$CODE_FT]
11258 .             char ' \[aq]
11259 .          \}
11260 .       \}
11261 .       el \{\
11262 .          ie \\n[#CODE_FAM]=1 .fam \\*[$CODE_FAM]
11263 .          el \{\
11264 .             CODE_FAMILY C
11265 .             fam \\*[$CODE_FAM]
11266 .          \}
11267 .          ie \\n[#CODE_FT]=1 .ft \\*[$CODE_FT]
11268 .          el \{\
11269 .             CODE_FONT R
11270 .             ft \\*[$CODE_FT]
11271 .          \}
11272 .          if \\n[#CODE_COLOR]=1 .COLOR \\*[$CODE_COLOR]
11273 .          char ' \[aq]
11274 .          if !\\n[#CODE_SIZE_ADJ]=0 .ps \\n[#PT_SIZE]u*\\n[#CODE_SIZE_ADJ]u/100u
11275 .          if \\n[#SQ_ON] \{\
11276 .             nr #SQ_WAS_ON 1
11277 .             SMARTQUOTES OFF
11278 .          \}
11279 .       \}
11280 .    \}
11281 .    el \{\
11282 .       fam \\*[#RESTORE_FAM]
11283 .       ft  \\*[#RESTORE_FT]
11284 .       rm $RESTORE_FAM
11285 .       rm $RESTORE_FT
11286 .       if !\\n[#CODE_SIZE_ADJ]=0 .ps
11287 .       char ' \[aq]
11288 .       if !'\\n[.z]'' \
11289 .          if \\n[#LINENUMBERS] .nn
11290 .       if \\n[#CODE_COLOR]=1 .gcolor
11291 .       if \\n[#RESTORE_UNDERLINE]=1 \{\
11292 .          rr #RESTORE_UNDERLINE
11293 .          UNDERLINE_QUOTES
11294 .       \}
11295 .       if \\n[#SQ_WAS_ON]=1 \{\
11296 .          rr #SQ_WAS_ON
11297 .          SMARTQUOTES
11298 .       \}
11299 .       if \\n[#QUOTE] .sp 1v
11300 .    \}
11301 .END
11302 \#
11303 \# CODE_FAMILY
11304 \# -----------
11305 \# *Arguments:
11306 \#   <family>
11307 \# *Function:
11308 \#   Creates register #CODE_FAM and string $CODE_FAM for use by CODE.
11309 \#
11310 .MAC CODE_FAMILY END
11311 .    nr #CODE_FAM 1
11312 .    ds $CODE_FAM \\$1
11313 .END
11314 \#
11315 \# CODE_FONT
11316 \# ---------
11317 \# *Arguments:
11318 \#   <font>
11319 \# *Function:
11320 \#   Creates register #CODE_FT and string $CODE_FT for use by CODE.
11321 \#
11322 .MAC CODE_FONT END
11323 .    nr #CODE_FT 1
11324 .    ds $CODE_FT \\$1
11325 .END
11326 \#
11327 \# CODE_SIZE
11328 \# ---------
11329 \# *Arguments:
11330 \#   <percentage to zoom code font>
11331 \# *Function:
11332 \#   Creates register #CODE_SIZE_ADJ, used in CODE to zoom the
11333 \#   CODE_FONT to a percentage of the current point size.
11334 \#
11335 .MAC CODE_SIZE END
11336 . nr #CODE_SIZE_ADJ \\$1
11337 .END
11338 \#
11339 \# ---Blockquotes---
11340 \#
11341 \# BLOCKQUOTE
11342 \# ----------
11343 \# *Arguments:
11344 \#   <none> | <anything>
11345 \# *Function:
11346 \#   Indents quoted text in fill mode and shortens line length
11347 \#   equivalently, or turns BLOCKQUOTE off.
11348 \# *Notes:
11349 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
11350 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
11351 \#   how much space to put before and after.
11352 \#
11353 \#   .PP after blockquote is optional if there's only one para,
11354 \#   but required if there's more than one.
11355 \#
11356 .MAC BLOCKQUOTE END
11357 .    br
11358 .    if \\n[#LINENUMBERS]=1 \{\
11359 .       nr #LINENUMBERS 2
11360 .       nr #NEXT_LN \\n[ln]
11361 .       nm
11362 .    \}
11363 .    ie '\\$1'' \{\
11364 .       ev BLOCKQUOTE
11365 .       evc 0
11366 .       nr #IN_DIVER 1
11367 .       nr #QUOTE    2
11368 .       nr #PP_STYLE 2
11369 .       nr #Q_PP     0
11370 .       di B_QUOTE
11371 .       ie !'\\*[$Q_OFFSET_VALUE]'' .ll \\n[#L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11372 .       el .ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11373 .       if \\n[#ENDNOTE] \{\
11374 .          if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
11375 .             ie r#Q_OFFSET_VALUE \
11376 .                ll \
11377 \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11378 .             el \
11379 .                ll \
11380 \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\*[$Q_OFFSET_VALUE]*2u)
11381 .          \}
11382 .          if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
11383 .             ie r#Q_OFFSET_VALUE \
11384 .                ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11385 .             el \
11386 .                ll \\n[#L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]u*2u)
11387 .          \}
11388 .       \}
11389 .       ta \\n[.l]u
11390 .       CHECK_INDENT
11391 .       if \\n[#COLUMNS] \{\
11392 .          ie r#Q_OFFSET_VALUE \
11393 .             ll \
11394 \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11395 .          el \
11396 .             ll \\n[#COL_L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11397 .          if \\n[#ENDNOTE] \{\
11398 .             if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
11399 .                ie r#Q_OFFSET_VALUE \
11400 .                   ll \
11401 \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11402 .                el \
11403 .                   ll \
11404 \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\*[$Q_OFFSET_VALUE]*2u)
11405 .             \}
11406 .             if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
11407 .                ie r#Q_OFFSET_VALUE \
11408 .                   ll \
11409 \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11410 .                el \
11411 .                   ll \\n[#COL_L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11412 .             \}
11413 .          \}
11414 .          ta \\n[.l]u
11415 .       \}
11416 .       if \\n[#PRINT_STYLE]=1 \{\
11417 .          TYPEWRITER
11418 .          vs \\n[#DOC_LEAD]u
11419 .          QUAD LEFT
11420 .          HY OFF
11421 .       \}
11422 .       if \\n[#PRINT_STYLE]=2 \{\
11423 .          FAMILY  \\*[$BQUOTE_FAM]
11424 .          FT      \\*[$BQUOTE_FT]
11425 .          ps \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
11426 .          ie !r #BQ_AUTOLEAD .vs \\n[#DOC_LEAD]u
11427 .          el \{\
11428 .             vs \\n[.ps]u+\\n[#BQ_AUTOLEAD]u
11429 .             nr #BQ_LEAD \\n[.v]
11430 .          \}
11431 .          if \\n[#ENDNOTE] \{\
11432 .             ps \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
11433 .             ie !r#EN_BQ_AUTOLEAD .vs \\n[#EN_BQ_LEAD]u
11434 .             el \{\
11435 .                vs \\n[.ps]u+\\n[#EN_BQ_AUTOLEAD]u
11436 .                nr #EN_BQ_LEAD \\n[.v]
11437 .             \}
11438 .          \}
11439 .          nr #Q_LEAD_REAL \\n[.v]
11440 .          if \\n[#BQUOTE_COLOR]=1 \{\
11441 .             nf
11442 \m[\\*[$BQUOTE_COLOR]]
11443 .             EOL
11444 .          \}
11445 .          QUAD \\*[$BQUOTE_QUAD]
11446 .          nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
11447 .          HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
11448 .          hy 14
11449 .       \}
11450 .       if \\n[#LINENUMBERS]=2 \{\
11451 .          ie \\n[#BQUOTE_LN]=1 \{\
11452 .             if '\\n[#BQ_LN_GUTTER]'' .nr #BQ_LN_GUTTER \\n[#LN_GUTTER]
11453 .             LN_PARAMS
11454 .             nm \\n[ln] "" \\n[#BQ_LN_GUTTER] -3-\\n[#BQ_LN_GUTTER]
11455 .             RESTORE_PARAMS
11456 .          \}
11457 .          el \
11458 .             if !\\n[#SILENT_BQUOTE_LN] .NUMBER_LINES OFF
11459 .       \}
11460 .       nr #Q_TOP \\n[nl]
11461 .       if \\n[#INDENT_FIRST_PARAS] \{\
11462 .          ie !\\n[#ENDNOTE] \{\
11463 .             if \\n[#PRINT_STYLE]=1 .ti \\n[#PP_INDENT]u/2u
11464 .             if \\n[#PRINT_STYLE]=2 .ti \\n[#PP_INDENT]u/2u
11465 .          \}
11466 .          el \{\
11467 .             if \\n[#INDENT_FIRSTS]=1 \{\
11468 .                if \\n[#PRINT_STYLE]=1 .ti \\n[#EN_PP_INDENT]u/2u
11469 .                if \\n[#PRINT_STYLE]=2 .ti \\n[#EN_PP_INDENT]u/2u
11470 .             \}
11471 .          \}
11472 .       \}
11473 .    \}
11474 .    el .DO_QUOTE
11475 .END
11476 \#
11477 \# DO QUOTE
11478 \# --------
11479 \# *Arguments:
11480 \#   <none>
11481 \# *Function:
11482 \#   Ends the diversion P_QUOTE or B_QUOTE.  Spaces them according to
11483 \#   PRINTSTYLE, whether there's inter-paragraph spacing, and page
11484 \#   position.  TYPEWRITE treats spacing the same way in all circumstance
11485 \#   (viz. an extra line space).  TYPESET puts in only half
11486 \#   line spaces if the entire quote plus 1 line of body under the quote
11487 \#   fits on the the page; otherwise it puts in a full extra blank
11488 \#   line.  (This is to ensure the page remains bottom aligned).
11489 \#
11490 .MAC DO_QUOTE END
11491 .    br
11492 .    if \\n[#DIVER_LN_OFF] \{\
11493 \!.     NUMBER_LINES OFF
11494 .       rr #DIVER_LN_OFF
11495 .    \}
11496 .    di
11497 .    rr #IN_DIVER
11498 .    if \\n[#RESET_FN_COUNTERS]=2 \{\
11499 .       if !\\n[#FN_COUNT]=1 \{\
11500 .          if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
11501 .             DIVER_FN_2_POST
11502 .             rr #RESET_FN_COUNTERS
11503 .          \}
11504 .       \}
11505 .    \}
11506 .    nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
11507 .    nr #DONE_ONCE 0 1
11508 .    REMOVE_INDENT
11509 .    ev
11510 .    nr #Q_DEPTH (\\n[#DIVER_DEPTH]-\\n[#Q_LEAD_REAL])
11511 .    nr #Q_LEAD_DIFF \\n[#LEAD]-\\n[#Q_LEAD_REAL]
11512 .    if !\\n[.v]=\\n[#Q_LEAD_REAL] \{\
11513 .       SILENT
11514 .       br
11515 .       nf
11516 .       nr #CURRENT_V_POS \
11517 \\n[nl]+\\n[#Q_LEAD_DIFF]+(\\n[#DIVER_DEPTH]-\\n[#Q_DEPTH_REAL])
11518 .       SHIM
11519 .       SILENT OFF
11520 .       nr #Q_SPACE_ADJ \\n[#SHIM]/2
11521 .       nr #TRAP \\n[.t]-1
11522 .    \}
11523 .    if \\n[#ENDNOTE] \{\
11524 .       nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
11525 .       ALWAYS_FULLSPACE_QUOTES
11526 .    \}
11527 .    if \\n[#PRINT_STYLE]=1 \{\
11528 .       if \\n[#START]=1 .
11529 .       if \\n[#START]=0 \
11530 .          if !\\n[#LINEBREAK] .ALD \\n[#DOC_LEAD]u
11531 .       if \\n[#HEAD] \
11532 .          if \\n[#HEAD]=1 .RLD \\n[#DOC_LEAD]u
11533 .    \}
11534 .    if \\n[#PRINT_STYLE]=2 \{\
11535 .       ie \\n[#PP_SPACE] \{\
11536 .          ie \\n[#HEAD] .
11537 .          el \{\
11538 .             ie \\n[#START] .
11539 .             el \{\
11540 .                ie \\n[#FULLSPACE_QUOTES] .ALD \\n[#DOC_LEAD]u
11541 .                el .ALD \\n[#DOC_LEAD]u/2u
11542 .             \}
11543 .          \}
11544 .       \}
11545 .       el \{\
11546 .          ie \\n[#Q_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
11547 .             ie ((\\n[#TRAP_DISTANCE]-1)-\\n[#Q_DEPTH])<\\n[#DOC_LEAD] \
11548 .                Q_NOFIT
11549 .             el \{\
11550 .                ie (\\n[#TRAP_DISTANCE]-\\n[#DOC_LEAD])<\\n[#DOC_LEAD] .Q_NOFIT
11551 .                el \{\
11552 .                   ie (\\n[#Q_DEPTH]+\\n[.v])=(\\n[#TRAP_DISTANCE]-1) .Q_NOFIT
11553 .                   el .Q_FITS
11554 .                \}
11555 .             \}
11556 .          \}
11557 .          el .Q_NOFIT
11558 .       \}
11559 .       if \\n[#LINEBREAK] \{\
11560 .          ie !\\n[@TOP] .RLD \\n[#DOC_LEAD]u
11561 .          el \{\
11562 .             nop
11563 .             sp |\\n[#T_MARGIN]u-\\n[#BQ_LEAD]u
11564 .          \}
11565 .       \}
11566 .    \}
11567 .    ie !'\\*[$Q_OFFSET_VALUE]'' .nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
11568 .    el \
11569 .       nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
11570 .    if \\n[#COLUMNS] \{\
11571 .       ie r#Q_OFFSET_VALUE \
11572 .          nr #Q_OFFSET \
11573 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
11574 .       el .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE]
11575 .    \}
11576 .    if !\\n[#ENDNOTE] \{\
11577 .       po \\n[#Q_OFFSET]u
11578 .       if '\\n[.z]'FLOAT*DIV' \!.po \\n[#Q_OFFSET]u
11579 .    \}
11580 .    if \\n[#ENDNOTE] \{\
11581 .       ie \\n[#Q_OFFSET_VALUE] .in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
11582 .       el .in +\\*[$Q_OFFSET_VALUE]
11583 .    \}
11584 .    ie \\n[#START]=1 \{\
11585 .       ie !\\n[#Q_LEAD_DIFF]<0 .ALD \\n[#Q_SPACE_ADJ]u
11586 .       el .RLD 0-\\n[#Q_LEAD_DIFF]u
11587 .    \}
11588 .    el \{\
11589 .       if \\n[#PRINT_STYLE]=2 \{\
11590 .           if !\\n[.v]=\\n[#Q_LEAD] .ALD \\n[#Q_SPACE_ADJ]u
11591 .       \}
11592 .    \}
11593 .    if \\n[#QUOTE]=1 \{\
11594 .       nf
11595 .       P_QUOTE
11596 .       br
11597 .       if !\\n[#START] .rr #QUOTE
11598 .    \}
11599 .    if \\n[#QUOTE]=2 \{\
11600 .       nf
11601 .       B_QUOTE
11602 .       br
11603 .    \}
11604 .    if \\n[#PRINT_STYLE]=1 \
11605 .       if !\\n[.v]=\\n[#DOC_LEAD] .SHIM
11606 .    if \\n[#PRINT_STYLE]=2 \{\
11607 .       ie \\n[#START] \{\
11608 .          ie \\n[#PP_SPACE] .
11609 .          el \{\
11610 .             ALD \\n[#DOC_LEAD]u
11611 .             SHIM
11612 .          \}
11613 .       \}
11614 .       el \{\
11615 .          ie \\n[#HEAD]=1 \{\
11616 .             ALD \\n[#DOC_LEAD]u
11617 .             SHIM
11618 .          \}
11619 .          el \{\
11620 .             ie \\n[#FULLSPACE_QUOTES] \{\
11621 .                ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u
11622 .                el .ALD \\n[#DOC_LEAD]u
11623 .             \}
11624 .             el .ALD (\\n[#DOC_LEAD]/2)u
11625 .             ie \\n[#Q_FITS] \{\
11626 .                ie (\\n[#Q_TOP]=\\n[#PAGE_TOP]):(\\n[@TOP]=1) \{\
11627 .                   nr #Q_AT_TOP 1
11628 .                   nr #DELAY_SHIM 1
11629 .                \}
11630 .                el \
11631 .                   if !\\n[.v]=\\n[#Q_LEAD_REAL] .SHIM
11632 .             \}
11633 .             el \{\
11634 .                SHIM
11635 .\" Make sure that Q_LEAD_DIFF is not added to the first line of
11636 .\" normal text at the top of any page following output of a quote
11637 .\" whose last line falls on B_MARGIN of the previous page.
11638 .                if \\n[#Q_LEAD_DIFF] \{\
11639 .                   if \\n[nl]=(\\n[#T_MARGIN]-\\n[#DOC_LEAD]+\\n[#Q_LEAD_DIFF]) \{\
11640 .                      PRINT \&
11641 .                      br
11642 .                      sp -1v-\\n[#Q_LEAD_DIFF]u
11643 .                      nr #Q_LEAD_DIFF_CHECK 1
11644 .                   \}
11645 .                \}
11646 .             \}
11647 .          \}
11648 .       \}
11649 .    \}
11650 .    rr #Q_SPACE_ADJ
11651 .    if \\n[#LINENUMBERS]=2 \{\
11652 .       nr #LINENUMBERS 1
11653 .       if !\\n[#ENDNOTE] \{\
11654 .          ie \\n[#RESTORE_LN_NUM]=1 \{\
11655 .             LN_PARAMS
11656 .             nm \\n[#NEXT_LN]
11657 .             RESTORE_PARAMS
11658 .          \}
11659 .          el \{\
11660 .             LN_PARAMS
11661 .             nm +0
11662 .             RESTORE_PARAMS
11663 .          \}
11664 .       \}
11665 .    \}
11666 .    if \\n[#ENDNOTE] .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING]
11667 .    if r #HEAD .rr #HEAD
11668 .    if r #EPIGRAPH .rr #EPIGRAPH
11669 .    rr #Q_PP
11670 .    rr #LINEBREAK
11671 .    nr #PP_STYLE  1
11672 .    nr #END_QUOTE 1
11673 .    if !\\n[#ENDNOTE] \{\
11674 .       po \\n[#L_MARGIN]u
11675 .       if '\\n[.z]'FLOAT*DIV' \!.po \\n[#L_MARGIN]u
11676 .    \}
11677 .    if \\n[#ENDNOTE]  .in \\n[#EN_TEXT_INDENT]u
11678 .    if \\n[#COLUMNS] \{\
11679 .       if !\\n[#ENDNOTE] \{\
11680 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
11681 .          nr #L_MARGIN \\n[.o]
11682 .       \}
11683 .       if \\n[#ENDNOTE] .in \\n[#EN_TEXT_INDENT]u
11684 .    \}
11685 .    ie !\\n[#ENDNOTE] .QUAD \\*[$DOC_QUAD]
11686 .    el .QUAD \\*[EN_QUAD]
11687 .    if r #DELAY_SHIM \{\
11688 .       SHIM
11689 .       rr #DELAY_SHIM
11690 .    \}
11691 .    if \\n[#PRINT_STYLE]=1 \
11692 .       if \\n[#UNDERLINE_QUOTES] .FT R
11693 .    nr #QUOTE_4_HD 1
11694 .END
11695 \#
11696 \# Utility macros for DO_QUOTE
11697 \# ---------------------------
11698 \#
11699 .MAC Q_FITS END
11700 .    nr #Q_FITS 1
11701 .    ie \\n[#HEAD]=1 .ALD \\n[#Q_LEAD_DIFF]u
11702 .    el \{\
11703 .       ie \\n[#START] .
11704 .       el \{\
11705 .          ie \\n[#FULLSPACE_QUOTES] \{\
11706 .             ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u
11707 .             el .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u
11708 .          \}
11709 .          el \{\
11710 .\" This seems to be the only way to get the baseline of quotes that
11711 .\" start at the top of the page to fall on the first line of the
11712 .\" grid (ie. on the first valid baseline of the page).
11713 .             ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
11714 .                if \\n[#QUOTE]=1 \{\
11715 .                   rn P_QUOTE Q_TEMP
11716 .                   di P_QUOTE
11717 .                   nf
11718 .                   vs \\n[#Q_LEAD]u
11719 .                   PRINT \&
11720 .                   sp -1v+\\n[#Q_LEAD_DIFF]u
11721 .                   Q_TEMP
11722 .                   di
11723 .                \}
11724 .                if \\n[#QUOTE]=2 \{\
11725 .                   rn B_QUOTE Q_TEMP
11726 .                   di B_QUOTE
11727 .                   nf
11728 .                   vs \\n[#BQ_LEAD]u
11729 .                   PRINT \&
11730 .                   sp -1v+\\n[#Q_LEAD_DIFF]u
11731 .                   Q_TEMP
11732 .                   di
11733 .                \}
11734 .                rm Q_TEMP
11735 .             \}
11736 .             el .ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_SPACE_ADJ]u
11737 .          \}
11738 .       \}
11739 .       if \\n[#DIVER_FN]=2 .rr #DIVER_FN
11740 .    \}
11741 .END
11742 \#
11743 .MAC Q_NOFIT END
11744 .    rr #Q_FITS
11745 .    ie r#HEAD \
11746 .       if \\n[#HEAD]=1 .
11747 .    el \{\
11748 .       if \\n[#Q_DEPTH]=0 \
11749 .          if \\n[.ns] .rs
11750 .       ie \\n[#FULLSPACE_QUOTES] \{\
11751 .          ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u
11752 .          el .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u
11753 .       \}
11754 .       el \{\
11755 .          ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]
11756 .          if \\n[@TOP] .rs
11757 .       \}
11758 .       nr #Q_PARTIAL_DEPTH 0 \\n[#Q_LEAD_REAL]
11759 .       while \\n+[#Q_PARTIAL_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
11760 .
11761 .       \}
11762 .       nr #Q_PARTIAL_DEPTH -\\n[#Q_LEAD_REAL]
11763 .       nr #Q_SPACE_ADJ \
11764 (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_PARTIAL_DEPTH]+\\n[#Q_LEAD_DIFF]u
11765 .       if \\n[#FN_COUNT]>0 .nr #Q_SPACE_ADJ (\\n[#Q_SPACE_ADJ] / 2u)
11766 .\" Hack to deal with the fact that even though the above routine
11767 .\" makes the bottom line of the quote fall exactly on the bottom
11768 .\" margin when traps are disabled, it refuses to do so when traps
11769 .\" are on.  The difference by which it's off is #Q_LEAD_DIFF
11770 .\" (the +\\n[#Q_LEAD_DIFF] at the end of the line, above).  Hack
11771 .\" solution: temporarily lower the FOOTER trap position.
11772 .       if !\\n[#Q_DEPTH]=0 \{\
11773 .          nr #SAVED_FOOTER_POS \\n[#VARIABLE_FOOTER_POS]
11774 .          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+.25v
11775 .       \}
11776 .    \}
11777 .END
11778 \#
11779 \# ====================================================================
11780 \#
11781 \# +++PAGINATION+++
11782 \#
11783 \# PAGINATE
11784 \# --------
11785 \# *Arguments:
11786 \#   <none> | <anything>
11787 \# *Function:
11788 \#   Turns page numbering off or on during document processing.
11789 \# *Notes:
11790 \#   Default is on.
11791 \#
11792 .MAC PAGINATE END
11793 .    ie '\\$1'' .nr #PAGINATE 1
11794 .    el \{\
11795 .      nr #PAGINATE 0
11796 .      if !\\n[#COLLATE] .rr #PAGE_NUM_V_POS
11797 .    \}
11798 .    if \\n[#HF_OFF]=1 \{\
11799 .       rr #PAGINATION_STATE
11800 .       rr #HF_OFF
11801 .    \}
11802 .END
11803 \#
11804 \# SUSPEND PAGINATION (before ENDNOTES)
11805 \# ------------------
11806 \# *Argument:
11807 \#   <none>
11808 \# *Function:
11809 \#   Creates register #SUSPEND_PAGINATION
11810 \# *Notes:
11811 \#   Useful only to suspend pagination before outputting endnotes.
11812 \#
11813 .MAC SUSPEND_PAGINATION END
11814 .    nr #SUSPEND_PAGINATION 1
11815 .END
11816 \#
11817 \# RESTORE PAGINATION (after ENDNOTES)
11818 \# ------------------
11819 \# *Argument:
11820 \#   <none>
11821 \# *Function:
11822 \#   Removes register #SUSPEND_PAGINATION.  Creates register
11823 \#   #DEFER_PAGINATION
11824 \# *Notes:
11825 \#   Useful only to restore pagination after outputting endnotes.
11826 \#
11827 .MAC RESTORE_PAGINATION END
11828 .    rr #SUSPEND_PAGINATION
11829 .    if \\n[#PAGE_NUM_V_POS]=1 .PAGINATE
11830 .    if \\n[#PAGE_NUM_V_POS]=2 .nr #DEFER_PAGINATION 1
11831 .END
11832 \#
11833 \# PAGE NUMBER FORMAT
11834 \# ------------------
11835 \# *Arguments:
11836 \#   DIGIT | ROMAN | roman | ALPHA | alpha
11837 \# *Function:
11838 \#   Assigns user entered format to #PAGENUMBER.
11839 \#
11840 .MAC PAGENUM_STYLE END
11841 .    nr #PAGENUM_STYLE_SET 1
11842 .    if '\\$1'DIGIT' \{\
11843 .       ds $PAGENUM_STYLE \\$1
11844 .       af #PAGENUMBER 1
11845 .    \}
11846 .    if '\\$1'ROMAN' \{\
11847 .       ds $PAGENUM_STYLE \\$1
11848 .       af #PAGENUMBER I
11849 .    \}
11850 .    if '\\$1'roman' \{\
11851 .       ds $PAGENUM_STYLE \\$1
11852 .       af #PAGENUMBER i
11853 .    \}
11854 .    if '\\$1'ALPHA' \{\
11855 .       ds $PAGENUM_STYLE \\$1
11856 .       af #PAGENUMBER A
11857 .    \}
11858 .    if '\\$1'alpha' \{\
11859 .       ds $PAGENUM_STYLE \\$1
11860 .       af #PAGENUMBER a
11861 .    \}
11862 .END
11863 \#
11864 \# HYPHENS AROUND PAGE NUMBERS
11865 \# ---------------------------
11866 \# *Arguments:
11867 \#   <none> | <anything>
11868 \# *Function:
11869 \#   Creates or modifies register #PAGE_NUM_HYPHENS.
11870 \#   Used to dis/enable hyphens on either side of page numbers.
11871 \# *Notes:
11872 \#   Default is on.
11873 \#
11874 .MAC PAGENUM_HYPHENS END
11875 .    nr #PAGE_NUM_HYPHENS_SET 1
11876 .    ie '\\$1'' .nr #PAGE_NUM_HYPHENS 1
11877 .    el .rr #PAGE_NUM_HYPHENS
11878 .END
11879 \#
11880 \# PAGENUMBER POSITION
11881 \# -------------------
11882 \# *Arguments:
11883 \#   TOP | BOTTOM  LEFT | CENTER | RIGHT
11884 \# *Function:
11885 \#   Creates or modifies various PAGE_NUM_H | V_POS registers.
11886 \#   Used to position page numbers.
11887 \# *Notes:
11888 \#   Default is center/bottom.
11889 \#
11890 .MAC PAGENUM_POS END
11891 .    nr #PAGE_NUM_POS_SET 1
11892 .    if '\\$1'TOP'    .nr #PAGE_NUM_V_POS 1
11893 .    if '\\$1'BOTTOM' .nr #PAGE_NUM_V_POS 2
11894 .    if '\\$2'LEFT'   .nr #PAGE_NUM_H_POS 1
11895 .    if '\\$2'CENTER' .nr #PAGE_NUM_H_POS 2
11896 .    if '\\$2'CENTRE' .nr #PAGE_NUM_H_POS 2
11897 .    if '\\$2'RIGHT'  .nr #PAGE_NUM_H_POS 3
11898 .END
11899 \#
11900 .MAC PN_WITH_HYPHENS END
11901 .    nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
11902 .    ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
11903 .    ds $PN_FOR_KN \\n[#PAGENUMBER]
11904 .\"  Check for initial or terminal 1's or 7's, and apply a little kerning
11905 .    substring $PN_FOR_KN 0 0 \" 1st digit
11906 .    if '\\*[$PN_FOR_KN]'1' .ds $PRE_HY_KN \*[BU3]
11907 .    if '\\*[$PN_FOR_KN]'7' .ds $PRE_HY_KN \*[BU3]
11908 .    ds $PN_FOR_KN \\n[#PAGENUMBER]
11909 .    substring $PN_FOR_KN -1 -1 \" last digit
11910 .    if '\\*[$PN_FOR_KN]'1' .ds $POST_HY_KN \*[BU3]
11911 .    if '\\*[$PN_FOR_KN]'7' .ds $POST_HY_KN \*[BU3]
11912 .    PRINT \
11913 \m[\\*[$PAGENUM_COLOR]]\
11914 \\*[$HYPHEN]\|\\*[$PRE_HY_KN]\\n[#PAGENUMBER]\\*[$POST_HY_KN]\|\\*[$HYPHEN]
11915 .    br
11916 .    rm $PRE_HY_KERN
11917 .    rm $POST_HY_KERN
11918 .END
11919 \#
11920 \# PRINT PAGE NUMBER
11921 \# -----------------
11922 \# *Arguments:
11923 \#   <none>
11924 \# *Function:
11925 \#   Prints page number if PAGINATE=1.
11926 \#
11927 .MAC PRINT_PAGE_NUMBER END
11928 .    ev PAGENUMBER
11929 .    nf
11930 .    po  \\n[#DOC_L_MARGIN]u
11931 .    ll  \\n[#DOC_L_LENGTH]u
11932 .    ta  \\n[.l]u
11933 .    fam \\*[$PAGE_NUM_FAM]
11934 .    ft  \\*[$PAGE_NUM_FT]
11935 .    ps  \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
11936 .    if  \\n[#PRINT_STYLE]=1 .TYPEWRITER
11937 .    if  \\n[#PAGE_NUM_V_POS]=1 .vs 0
11938 .    if o \{\
11939 .       ie \\n[#PAGE_NUM_H_POS]=1 .LEFT
11940 .       el .RIGHT
11941 .    \}
11942 .    if e \{\
11943 .       ie \\n[#PAGE_NUM_H_POS]=1 .RIGHT
11944 .       el .LEFT
11945 .    \}
11946 .    if \\n[#PAGE_NUM_H_POS]=2 .CENTER
11947 .    if \\n[#RECTO_VERSO]=0 \{\
11948 .       if \\n[#PAGE_NUM_H_POS]=1 .LEFT
11949 .       if \\n[#PAGE_NUM_H_POS]=2 .CENTER
11950 .       if \\n[#PAGE_NUM_H_POS]=3 .RIGHT
11951 .    \}
11952 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
11953 .    if \\n[#EN_FIRST_PAGE] \{\
11954 .       if \\n[#EN_FIRST_PN] .PAGENUMBER \\n[#EN_FIRST_PN]
11955 .       rr #EN_FIRST_PAGE
11956 .    \}
11957 .    if \\n[#BIB_FIRST_PAGE] \{\
11958 .       if \\n[#BIB_FIRST_PN] .PAGENUMBER \\n[#BIB_FIRST_PN]
11959 .       rr #BIB_FIRST_PAGE
11960 .    \}
11961 .    ie \\n[#DRAFT_WITH_PAGENUM] \{\
11962 .       ie '\\*[$REVISION]'' \
11963 .          PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT] / \\n[#PAGENUMBER]"
11964 .       el \{\
11965 .          ie '\\*[$DRAFT]'' \
11966 .             PRINT "\\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
11967 .          el \
11968 .             PRINT \
11969 "\\*[$DRAFT_STRING]\\*[$DRAFT], \\*[$REVISION_STRING] \\*[$REVISION] / \
11970 \\n[#PAGENUMBER]"
11971 .       \}
11972 .    \}
11973 .    el \{\
11974 .       ie \\n[#PAGE_NUM_HYPHENS] \{\
11975 .          if '\\*[$PAGENUM_STYLE]'DIGIT' \{\
11976 .             di NULL
11977 1\\R'#CAP_HEIGHT \\n[.cht]'
11978 .             di
11979 .             PN_WITH_HYPHENS
11980 .          \}
11981 .          if '\\*[$PAGENUM_STYLE]'ROMAN' \{\
11982 .             di NULL
11983 I\\R'#CAP_HEIGHT \\n[.cht]'
11984 .             di
11985 .             PN_WITH_HYPHENS
11986 .          \}
11987 .          if '\\*[$PAGENUM_STYLE]'ALPHA' \{\
11988 .             di NULL
11989 E\\R'#CAP_HEIGHT \\n[.cht]'
11990 .             di
11991 .             PN_WITH_HYPHENS
11992 .          \}
11993 .          if '\\*[$PAGENUM_STYLE]'roman' \
11994 .             PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
11995 .          if '\\*[$PAGENUM_STYLE]'alpha' \
11996 .             PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
11997 .       \}
11998 .       el .PRINT \m[\\*[$PAGENUM_COLOR]]\\n[#PAGENUMBER]
11999 .    \}
12000 .    ev
12001 .    nr #DIVER_DEPTH 0
12002 .END
12003 \#
12004 \# ====================================================================
12005 \#
12006 \# +++FOOTNOTES+++
12007 \#
12008 \# Mom's footnote handling is baroque, to say the least.  There are
12009 \# redundancies in a number of the macros involved, as well as some
12010 \# registers that probably don't get used anymore.  The baggage is left
12011 \# in in case some new footnote oddity/challenge gets thrown at her.
12012 \#
12013 \# The macros are heavily commented.
12014 \#
12015 \# FOOTNOTE AUTOLEAD
12016 \# -----------------
12017 \# *Arguments:
12018 \#   <autolead value for footnotes>
12019 \# *Function:
12020 \#   Creates or modifies register #FN_AUTOLEAD.
12021 \# *Notes:
12022 \#   Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
12023 \#
12024 .MAC FOOTNOTE_AUTOLEAD END
12025 .    nr #FN_AUTOLEAD (p;\\$1)
12026 .END
12027 \#
12028 \# FOOTNOTE MARKERS
12029 \# ----------------
12030 \# *Arguments:
12031 \#   <none> | <anything>
12032 \# *Function:
12033 \#   Turns generation of footnote markers on or off.
12034 \# *Notes:
12035 \#   Default is on.
12036 \#
12037 .MAC FOOTNOTE_MARKERS END
12038 .    ie '\\$1'' .nr #FN_MARKERS 1
12039 .    el .nr #FN_MARKERS 0
12040 .END
12041 \#
12042 \# FOOTNOTE MARKER STYLE
12043 \# ---------------------
12044 \# *Arguments:
12045 \#   STAR | NUMBER | LINE
12046 \# *Function:
12047 \#   Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
12048 \#   the style of footnote markers.
12049 \# *Notes:
12050 \#   1=STAR; 2=NUMBER; 3=LINE.  LINE means "use output line numbers".
12051 \#   Default is STAR.
12052 \#
12053 .MAC FOOTNOTE_MARKER_STYLE END
12054 .    if '\\$1'STAR' \{\
12055 .       if \\n[#FN_MARKER_STYLE]=3 \{\
12056 .          if !\\n[#NEWPAGE]=1 \{\
12057 .             tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is LINE.
12058 .             tm1 "       You cannot change footnote marker style without
12059 .             tm1 "       first breaking to a new page with NEWPAGE.
12060 .             tm1 "       Ignoring request FOOTNOTE_MARKER_STYLE STAR at line \\n[.c].
12061 .             return
12062 .          \}
12063 .       \}
12064 .       if \\n[#RUN_ON]=1 \{\
12065 .          tm1 "[mom]: FOOTNOTE_MARKER_STYLE STAR at line \\n[.c] is incompatible
12066 .          tm1 "       with RUN_ON footnotes.  Ignoring request.
12067 .          return
12068 .       \}
12069 .       nr #FN_MARKER_STYLE 1
12070 .       if \\n[#NEWPAGE]=1 .rr #NEWPAGE
12071 .       FOOTNOTE_MARKERS
12072 .    \}
12073 .    if '\\$1'NUMBER' \{\
12074 .       if \\n[#FN_MARKER_STYLE]=3 \{\
12075 .          if !\\n[#NEWPAGE]=1 \{\
12076 .             tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is NUMBER.
12077 .             tm1 "       You cannot change footnote marker style without
12078 .             tm1 "       first breaking to a new page with NEWPAGE.
12079 .             tm1 "       Ignoring request FOOTNOTE_MARKER_STYLE NUMBER at line \\n[.c].
12080 .             return
12081 .          \}
12082 .       \}
12083 .       if \\n[#RUN_ON]=1 \{\
12084 .          tm1 "[mom]: FOOTNOTE_MARKER_STYLE NUMBER at line \\n[.c] is incompatible
12085 .          tm1 "       with RUN_ON footnotes.  Ignoring request.
12086 .          return
12087 .       \}
12088 .       nr #FN_MARKER_STYLE 2
12089 .       shift
12090 .       if '\\$1'NO_SUPERSCRIPT' .nr #NO_SUPERSCRIPT 1
12091 .       if \\n[#NEWPAGE]=1 .rr #NEWPAGE
12092 .       FOOTNOTE_MARKERS
12093 .    \}
12094 .    if '\\$1'LINE' \{\
12095 .       nr #FN_MARKER_STYLE 3
12096 .       FOOTNOTE_MARKERS OFF
12097 .       if !\\n[#FN_LN_SEP] \
12098 .          if !\\n[#FN_LN_BRACKETS] .FOOTNOTE_LINENUMBER_BRACKETS SQUARE
12099 .    \}
12100 .END
12101 \#
12102 \# FOOTNOTE NUMBER PLACEHOLDERS
12103 \# ----------------------------
12104 \# *Argument:
12105 \#   <number of placeholders>
12106 \# *Function:
12107 \#   Sets register #FN_NUMBER_PLACEHOLDERS, used to establish whether to
12108 \#   right pad a footnote number (in the footnote itself, not body copy).
12109 \# *Notes:
12110 \#   No default is set for this; user must determine if, and where, it's
12111 \#   required
12112 \#
12113 .MAC FOOTNOTE_NUMBER_PLACEHOLDERS END
12114 .    nr #FN_NUMBER_PLACEHOLDERS \\$1
12115 .END
12116 \#
12117 \# FOOTNOTE LINENUMBER MARK
12118 \# ------------------------
12119 \# *Function:
12120 \#   This string, when called inline, stores the current output line
12121 \#   number in register #FN_MARK for use with FOOTNOTE.
12122 \#
12123 .ds FN_MARK \R'#FN_MARK \En[ln]'
12124 \#
12125 \# FOOTNOTE LINENUMBER SEPARATOR
12126 \# -----------------------------
12127 \# *Argument:
12128 \#   <user-defined separator>
12129 \# *Function:
12130 \#   Stores user-defined separator (for use then
12131 \#   FOOTNOTE_MARKER_STYLE is LINE) in string $FN_LN_SEP.  The
12132 \#   separator is intended to be used when the user wishes a
12133 \#   separator, rather than the choice of brackets offered by
12134 \#   FOOTNOTE_LINENUMBER_BRACKETS.
12135 \#
12136 .MAC FOOTNOTE_LINENUMBER_SEPARATOR END
12137 .    rr #FN_LN_BRACKETS
12138 .    nr #FN_LN_SEP 1
12139 .    ds $FN_LN_SEP "\\$1
12140 .END
12141 \#
12142 \# FOOTNOTE LINENUMBER BRACKETS
12143 \# ----------------------------
12144 \# *Argument:
12145 \#   PARENS | SQUARE | BRACES or ( | [ | {
12146 \# *Function:
12147 \#   Sets register #FN_LN_BRACKETS to 1, and creates strings
12148 \#   $FN_OPEN_BRACKET and $FN_CLOSE_BRACKET according to the given
12149 \#   argument.
12150 \#
12151 .MAC FOOTNOTE_LINENUMBER_BRACKETS END
12152 .    rr #FN_LN_SEP
12153 .    nr #FN_LN_BRACKETS 1
12154 .    if '\\$1'PARENS' \{\
12155 .       ds $FN_OPEN_BRACKET (
12156 .       ds $FN_CLOSE_BRACKET )
12157 .    \}
12158 .    if '\\$1'(' \{\
12159 .       ds $FN_OPEN_BRACKET (
12160 .       ds $FN_CLOSE_BRACKET )
12161 .    \}
12162 .    if '\\$1'SQUARE' \{\
12163 .       ds $FN_OPEN_BRACKET [
12164 .       ds $FN_CLOSE_BRACKET ]
12165 .    \}
12166 .    if '\\$1'[' \{\
12167 .       ds $FN_OPEN_BRACKET [
12168 .       ds $FN_CLOSE_BRACKET ]
12169 .    \}
12170 .    if '\\$1'BRACES' \{\
12171 .       ds $FN_OPEN_BRACKET {
12172 .       ds $FN_CLOSE_BRACKET }
12173 .    \}
12174 .    if '\\$1'{' \{\
12175 .       ds $FN_OPEN_BRACKET {
12176 .       ds $FN_CLOSE_BRACKET }
12177 .    \}
12178 .END
12179 \#
12180 \# RESET FOOTNOTE NUMBER
12181 \# ---------------------
12182 \# *Arguments:
12183 \#   <none> | PAGE
12184 \# *Function:
12185 \#   Resets register #FN_NUMBER to 1.  If argument is PAGE, creates
12186 \#   toggle #RESET_FN_NUMBER which is checked in HEADER.  If 1,
12187 \#   numbered footnotes on every page start at 1.
12188 \#
12189 .MAC RESET_FOOTNOTE_NUMBER END
12190 .    ie '\\$1'' .nr #FN_NUMBER 0 1
12191 .    el .nr #RESET_FN_NUMBER 1
12192 .END
12193 \#
12194 \# FOOTNOTE RULE LENGTH
12195 \# --------------------
12196 \# *Arguments:
12197 \#   <length of rule used to separate footnotes from running text>
12198 \# *Function:
12199 \#   Creates or modifies registers #FN_RULE_LENGTH.
12200 \# *Notes:
12201 \#   Requires unit of measure (iPpcm).
12202 \#   Default is 4P for both PRINTSTYLEs.
12203 \#
12204 .MAC FOOTNOTE_RULE_LENGTH END
12205 .    nr #FN_RULE_LENGTH (\\$1)
12206 .END
12207 \#
12208 \# FOOTNOTE_RULE_ADJ
12209 \# -----------------
12210 \# *Arguments:
12211 \#   <number of points to raise footnote rule from it's baseline position>
12212 \# *Function:
12213 \#   Creates or modifies register #FN_RULE_ADJ.
12214 \# *Notes:
12215 \#   Default is 3p for both TYPESTYLES.
12216 \#
12217 \#   Requires unit of measure.
12218 \#
12219 .MAC FOOTNOTE_RULE_ADJ END
12220 .    nr #FN_RULE_ADJ (\\$1)
12221 .END
12222 \#
12223 \# FOOTNOTE RULE
12224 \# -------------
12225 \# *Arguments:
12226 \#   <none> | <anything>
12227 \# *Function:
12228 \#   Turns printing of footnote separator rule on or off.  If invoked as
12229 \#   PRINT_FOOTNOTE_RULE, prints footnote separator rule.
12230 \# *Notes:
12231 \#   Default is on.
12232 \#
12233 \#   Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
12234 \#   if the footnote number (#FN_COUNT) is 1.
12235 \#
12236 .MAC FOOTNOTE_RULE END
12237 .    ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
12238 .       if \\n[#FN_RULE]=0 .RLD 1v
12239 .       RLD 1v
12240 .       LEFT
12241 \v'-\\n[#FN_RULE_ADJ]u-\\n[#FN_RULE_WEIGHT_ADJ]u'\
12242 \D't \\n[#FN_RULE_WEIGHT]'\
12243 \h'-\\n[#FN_RULE_WEIGHT]u'\
12244 \D'l \\n[#FN_RULE_LENGTH]u 0'\
12245 \v'+\\n[#FN_RULE_ADJ]u+\\n[#FN_RULE_WEIGHT_ADJ]u'
12246 \!.     ps \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
12247 .       QUAD \\*[$FN_QUAD]
12248 .    \}
12249 .    el \{\
12250 .       ie '\\$1'' .nr #FN_RULE 1
12251 .       el .nr #FN_RULE 0
12252 .    \}
12253 .END
12254 \#
12255 \# FOOTNOTE SPACING
12256 \# ----------------
12257 \# *Arguments:
12258 \#   <per item post footnote spacing> | <anything>
12259 \# *Function:
12260 \#   Enables printing of post footnote spacing.
12261 \# *Notes:
12262 \#   Default is no space.
12263 \#
12264 .MAC FOOTNOTE_SPACING END
12265 .    ie \B'\\$1' .ds $FN_SPACE \\$1
12266 .    el .rm $FN_SPACE
12267 .END
12268 \#
12269 \# RUN ON FOOTNOTES
12270 \# ----------------
12271 \# *Arguments:
12272 \#   <none> | <anything>
12273 \# *Function:
12274 \#   Toggles run-on footnotes on or off.
12275 \#
12276 .MAC FOOTNOTES_RUN_ON END
12277 .    ie '\\$1'' \{\
12278 .       if \\n[#FN_COUNT]>0 \{\
12279 .          tm1 "[mom]: Switching to run-on footnotes at line \\n[.c] will cause
12280 .          tm1 "       you to loose footnotes already formatted for this page.
12281 .          tm1 "       Ignoring request FOOTNOTES_RUN_ON.
12282 .          rr #RUN_ON
12283 .          return
12284 .       \}
12285 .       nr #RUN_ON 1
12286 .       if \\n[#FN_MARKER_STYLE]=1 .RUNON_WARNING
12287 .       if \\n[#FN_MARKER_STYLE]=2 .RUNON_WARNING
12288 .    \}
12289 .    el \{\
12290 .       if \\n[#FN_COUNT]>0 \{\
12291 .          if \\n[#RUN_ON]=1 \{\
12292 .             tm1 "[mom]: Switching off run-on footnotes at line \\n[.c] will cause
12293 .             tm1 "       you to loose footnotes already formatted for this page.
12294 .             tm1 "       Ignoring request FOOTNOTES_RUN_ON \\$1.
12295 .             return
12296 .          \}
12297 .       \}
12298 .       rr #RUN_ON
12299 .    \}
12300 .END
12301 \#
12302 .MAC RUNON_WARNING END
12303 .    if \\n[#FN_MARKER_STYLE]=1 \{\
12304 .       tm1 "[mom]: The footnote marker style active at line \\n[.c] is STAR,
12305 .       tm1 "       which is incompatible with run-on footnotes.  Please change
12306 .       tm1 "       the footnote marker style to LINE.  Continuing to process,
12307 .       tm1 "       but ignoring request FOOTNOTES_RUN_ON.
12308 .       rr #RUN_ON
12309 .    \}
12310 .    if \\n[#FN_MARKER_STYLE]=2 \{\
12311 .       tm1 "[mom]: The footnote marker style active at line \\n[.c] is NUMBER,
12312 .       tm1 "       which is incompatible with run-on footnotes.  Please change
12313 .       tm1 "       the footnote marker style to LINE.  Continuing to process,
12314 .       tm1 "       but ignoring request FOOTNOTES_RUN_ON.
12315 .       rr #RUN_ON
12316 .    \}
12317 .END
12318 \#
12319 \# FOOTNOTE
12320 \# --------
12321 \# *Arguments:
12322 \#   <none> | INDENT  L|LEFT|R|RIGHT|B|BOTH  <indent value> | <anything>
12323 \# *Function:
12324 \#   Begins collecting and diverting footnote text if no argument
12325 \#   given.  Otherwise, ends diversion FOOTNOTES, measures footnote
12326 \#   depth, and sets footnote trap.
12327 \# *Notes:
12328 \#   The input line preceding a footnote call MUST terminate with \c
12329 \#   or the footnote marker will be spaced away from the word it
12330 \#   should be joined to.
12331 \#
12332 \#   If FOOTNOTE is invoked with INDENT, the footnote will
12333 \#   be indented.  An indent style and an indent value must be given.
12334 \#   Subsequent footnotes will NOT be indented; INDENT must be given
12335 \#   for each footnote the user wants indented.
12336 \#
12337 .MAC FOOTNOTE END
12338 .    ie '\\$1'' \{\
12339 .       if \\n[#UNDERLINE_ON] \{\
12340 .          UNDERLINE OFF
12341 .          nr #UNDERLINE_WAS_ON_FN 1
12342 .       \}
12343 .       if \\n[#FN_MARKER_STYLE]=3 \{\
12344 .          if !\\n[#LINENUMBERS] \{\
12345 .             tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
12346 .             tm1 "       FOOTNOTE_MARKER_STYLE is LINE.
12347 .             ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
12348 .          \}
12349 .          if \\n[#FN_MARK]=0 .nr #FN_MARK \\n[ln]
12350 .          nr #FN_MARK_2 \\n[ln]
12351 .          if '\\n[.z]'P_QUOTE' \{\
12352 .             nr #FN_MARK -1
12353 .             nr #FN_MARK_2 -1
12354 .          \}
12355 .          if \\n[#IN_DIVER]=1 \{\
12356 .             if '\\n[.z]'P_QUOTE' \{\
12357 .                if !\\n[#QUOTE_LN]=1 \{\
12358 .                   if !\\n[#SILENT_QUOTE_LN]=1 \{\
12359 .                      tm1 "[mom]: You have requested a line-numbered footnote inside a
12360 .                      tm1 "       QUOTE at line \\n[.c], but line-numbering has not been enabled
12361 .                      tm1 "       for QUOTES.  Printing footnote with label "0".
12362 .                      rr #FN_MARK
12363 .                      rr #FN_MARK_2
12364 .                   \}
12365 .                \}
12366 .             \}
12367 .             if '\\n[.z]'B_QUOTE' \{\
12368 .                if !\\n[#BQUOTE_LN]=1 \{\
12369 .                   if !\\n[#SILENT_BQUOTE_LN]=1 \{\
12370 .                      tm1 "[mom]: You have requested a line-numbered footnote inside a
12371 .                      tm1 "       BLOCKQUOTE at line \\n[.c], but line-numbering has not been enabled
12372 .                      tm1 "       for BLOCKQUOTES.  Printing footnote with label "0".
12373 .                      rr #FN_MARK
12374 .                      rr #FN_MARK_2
12375 .                   \}
12376 .                \}
12377 .             \}
12378 .          \}
12379 .       \}
12380 .\" Begin processing footnotes that occur inside QUOTE, BLOCKQUOTE
12381 .\" or EPIGRAPH.
12382 .       if \\n[#IN_DIVER]=1 \{\
12383 .          nr #PAGE_POS \\n[nl]+\\n[.d]+\\n[#DOC_LEAD]
12384 .          nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS]-1)
12385 .          nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
12386 .\" Are we on a "defer" line?  If so, defer the text of the footnote.
12387 .          ie \\n[#SPACE_TO_FOOTER]<=\\n[#DOC_LEAD] \
12388 .             nr #DIVER_FN 2 \" treat like a normal deferred footnote
12389 .          el \
12390 .             nr #DIVER_FN 2 \" treat like a normal footnote
12391 .          if \\n[#PAGE_POS]>\\n[#FOOTER_POS] \
12392 .             nr #DIVER_FN 1 \" move this footnote
12393 .\" Test for situation where, because a final line of QUOTE, BLOCKQUOTE
12394 .\" or EPIGRAPH isn't yet adjusted at this point, the last word on the
12395 .\" line may *seem* to belong to the final line of the page, but will,
12396 .\" in fact, become the first word of the subsequent page.  In such
12397 .\" circumstances, we want the the footnote to be treated as a "moved"
12398 .\" diversion footnote.
12399 .          if \\n[.k]>\\n[.l] .nr #DIVER_FN 1
12400 .          if r #DIVER_FN \{\
12401 .             if !\\n[#DIVER_FN]=2 .\\n+[#DONE_ONCE]
12402 .\" A footnote inside a diversion will become the 1st footnote on the
12403 .\" following page/column.
12404 .             if \\n[#DIVER_FN]=1 .DIVER_FN_1_PRE
12405 .\" A footnote inside a diversion that should be treated like a
12406 .\" normal footnote (including defers.)
12407 .             if \\n[#DIVER_FN]=2 .DIVER_FN_2_PRE
12408 .          \}
12409 .          nr #SAVED_FN_COUNT \\n[#FN_COUNT]+1
12410 .          nr #SAVED_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]+1
12411 .       \}
12412 .\" End processing footnotes that occur inside QUOTE, BLOCKQUOTE or
12413 .\" EPIGRAPH.
12414 .\"
12415 .\" Test for situation where, because a final line of running text
12416 .\" isn't yet adjusted at this point, the last word on the line may
12417 .\" *seem* to belong to the final line of the page, but will, in
12418 .\" fact, become the first word of the subsequent page.  In such
12419 .\" circumstances, we want the footnote marker in running text to
12420 .\" be the correct one for the 1st footnote on the page.
12421 .       if \\n[.k]>\\n[.l] \{\
12422 .          if (\\n[nl]+\\n[#DOC_LEAD])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
12423 .             ie \\n[#COLUMNS]=1 \{\
12424 .                if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
12425 .                   if \\n[#FN_MARKER_STYLE]=1 .nr #FN_COUNT_FOR_COLS 0 1
12426 .                   if \\n[#FN_MARKER_STYLE]=2 \{\
12427 .                      if \\n[#RESET_FN_NUMBER] \{\
12428 .                         nr #FN_NUMBER 0 1
12429 .                         nr #NOT_YET_ADJUSTED 1
12430 .                      \}
12431 .                   \}
12432 .                \}
12433 .             \}
12434 .             el \{\
12435 .                if \\n[#FN_MARKER_STYLE]=1 .nr #FN_COUNT 0 1
12436 .                if \\n[#FN_MARKER_STYLE]=2 \{\
12437 .                   if \\n[#RESET_FN_NUMBER] \{\
12438 .                      nr #FN_NUMBER 0 1
12439 .                      nr #NOT_YET_ADJUSTED 1
12440 .                   \}
12441 .                \}
12442 .             \}
12443 .          \}
12444 .       \}
12445 .       if \\n[#FN_MARKERS] \{\
12446 .\" Housekeeping
12447 .          if \\n[#CONDENSE] \*[CONDX]\c
12448 .          if \\n[#EXTEND] \*[EXTX]\c
12449 .\" Add footnote markers to running text...
12450 .          if !\\n[#NO_FN_MARKER] \{\
12451 .\" ...but not if TERMINATE has not been called
12452 .             if !r#TERMINATE \{\
12453 .\" Marker style star/dagger/double-dagger
12454 .                if \\n[#FN_MARKER_STYLE]=1 \{\
12455 .\" Columnar docs either move col to col, or last col to next page.
12456 .\" They require their own special FN_COUNT because regular FN_COUNT
12457 .\" is used to figure out things like whether or not to put a rule
12458 .\" above footnotes (in addition to keeping track of the footnote
12459 .\" count in non-columnar docs).
12460 .                   ie \\n[#COLUMNS]=1 \{\
12461 .                      if \\n[#FN_COUNT_FOR_COLS]=0 .PRINT \*[BU2]*\c
12462 .                      if \\n[#FN_COUNT_FOR_COLS]=1 .PRINT \*[BU1]\[dg]\c
12463 .                      if \\n[#FN_COUNT_FOR_COLS]=2 .PRINT \[dd]\c
12464 .                      if \\n[#FN_COUNT_FOR_COLS]=3 .PRINT \*[BU2]**\c
12465 .                      if \\n[#FN_COUNT_FOR_COLS]=4 .PRINT \*[BU1]\[dg]\[dg]\c
12466 .                      if \\n[#FN_COUNT_FOR_COLS]=5 .PRINT \[dd]\[dd]\c
12467 .                      if \\n[#FN_COUNT_FOR_COLS]=6 .PRINT \*[BU2]***\c
12468 .                      if \\n[#FN_COUNT_FOR_COLS]=7 .PRINT \*[BU1]\[dg]\[dg]\[dg]\c
12469 .                      if \\n[#FN_COUNT_FOR_COLS]=8 .PRINT \[dd]\[dd]\[dd]\c
12470 .                      if \\n[#FN_COUNT_FOR_COLS]=9 .PRINT \*[BU2]****\c
12471 .                   \}
12472 .                   el \{\
12473 .                      if \\n[#FN_COUNT]=0 .PRINT \*[BU2]*\c
12474 .                      if \\n[#FN_COUNT]=1 .PRINT \*[BU1]\[dg]\c
12475 .                      if \\n[#FN_COUNT]=2 .PRINT \[dd]\c
12476 .                      if \\n[#FN_COUNT]=3 .PRINT \*[BU2]**\c
12477 .                      if \\n[#FN_COUNT]=4 .PRINT \*[BU1]\[dg]\[dg]\c
12478 .                      if \\n[#FN_COUNT]=5 .PRINT \[dd]\[dd]\c
12479 .                      if \\n[#FN_COUNT]=6 .PRINT \*[BU2]***\c
12480 .                      if \\n[#FN_COUNT]=7 .PRINT \*[BU1]\[dg]\[dg]\[dg]\c
12481 .                      if \\n[#FN_COUNT]=8 .PRINT \[dd]\[dd]\[dd]\c
12482 .                      if \\n[#FN_COUNT]=9 .PRINT \*[BU2]****\c
12483 .                   \}
12484 .                \}
12485 .\" Marker style superscript numbers
12486 .                if \\n[#FN_MARKER_STYLE]=2 \{\
12487 .                   if \\n[#PRINT_STYLE]=1 \
12488 .                      PRINT \
12489 "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#FN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
12490 .                   if \\n[#PRINT_STYLE]=2 \
12491 .                      PRINT \
12492 "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]\c"
12493 .                \}
12494 .             \}
12495 .          \}
12496 .       \}
12497 .\" More housekeeping
12498 .\"
12499 .\" #SPACE_REMAINING is the space left between where we are
12500 .\" on the page and the bottom margin.  It's used to determine whether
12501 .\" or not the footnote will overflow, and how many lines of
12502 .\" footnotes will fit on the page if some have to overflow.
12503 .       ie \\n[#DIVER_FN]=2 \
12504 .          nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-(\\n[#PAGE_POS])
12505 .       el \
12506 .          nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[nl]
12507 .       if \\n[#FROM_DIVERT_FN]=1 \{\
12508 .          nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]
12509 .          rr #FROM_DIVERT_FN
12510 .       \}
12511 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
12512 .       nr #PP_STYLE 2
12513 .       if \\n[#INDENT_FIRST_PARAS] .nr #INDENT_FIRSTS 1
12514 .       INDENT_FIRST_PARAS
12515 .\" Prepare FOOTNOTE to receive footnote text.
12516 .       ev FOOTNOTES
12517 .       ll \\n[#DOC_L_LENGTH]u
12518 .       ta \\n[.l]u
12519 .       if \\n[#COLUMNS]=1 \{\
12520 .          ll \\n[#COL_L_LENGTH]u
12521 .          ta \\n[.l]u
12522 .       \}
12523 .       if \\n[#FN_R_INDENT] \{\
12524 .          ll -\\n[#FN_R_INDENT]u
12525 .          ta \\n[.l]u
12526 .       \}
12527 .       if \\n[#FN_BR_INDENT] \{\
12528 .          ll -\\n[#FN_BR_INDENT]u
12529 .          ta \\n[.l]u
12530 .       \}
12531 .       FAMILY   \\*[$FN_FAM]
12532 .       FT       \\*[$FN_FT]
12533 .       ps  \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
12534 .       vs \\n[.ps]u+\\n[#FN_AUTOLEAD]u
12535 .       QUAD     \\*[$FN_QUAD]
12536 .       if \\n[#PRINT_STYLE]=1 \{\
12537 .          TYPEWRITER
12538 .          ie \\n[#SINGLE_SPACE] .vs \\n[#ORIGINAL_DOC_LEAD]u
12539 .          el .vs \\n[#ORIGINAL_DOC_LEAD]u/2u
12540 .          QUAD LEFT
12541 .          HY OFF
12542 .       \}
12543 .       nr #FN_LEAD \\n[#LEAD]
12544 .\" Begin diversion FOOTNOTES or FN_IN_DIVER
12545 .       ie r#COUNTERS_RESET \{\
12546 .          ie \\n[#DONE_ONCE]=1 \{\
12547 .             ie \\n[#RUN_ON] \{\
12548 .                di RUNON_FN_IN_DIVER
12549 .                nr #RUNON_FN_IN_DIVER 1
12550 .             \}
12551 .             el .di FN_IN_DIVER
12552 .          \}
12553 .          el \{\
12554 .             ie \\n[#RUN_ON] \{\
12555 .                da RUNON_FN_IN_DIVER
12556 .                nr #RUNON_FN_IN_DIVER 1
12557 .             \}
12558 .             el .da FN_IN_DIVER
12559 .          \}
12560 .       \\n+[#DONE_ONCE]
12561 .       \}
12562 .       el \{\
12563 .          ie \\n[#RUN_ON] \{\
12564 .             da RUNON_FOOTNOTES
12565 .             nr #RUNON_FOOTNOTES 1
12566 .          \}
12567 .          el .da FOOTNOTES
12568 .       \}
12569 .       if \\n[#FOOTNOTE_COLOR]=1 \{\
12570 .          TRAP OFF
12571 .          nf
12572 \m[\\*[$FOOTNOTE_COLOR]]
12573 .          EOL
12574 .          fi
12575 .          TRAP
12576 .       \}
12577 .       if \\n[#EPIGRAPH] .nr #FN_FOR_EPI 1
12578 .\" When a deferred footnote is also the 1st footnote on the page,
12579 .\" and when the page it's output on also has footnotes, some
12580 .\" whitespace is needed between the deferred footnote and the
12581 .\" first footnote belonging to the output page so that there's
12582 .\" no confusion when two stars (or two number 1s) appear in
12583 .\" footnotes...
12584 .       if \\n[#FN_DEFER_SPACE] \{\
12585 .\" ...but only add the extra space if TERMINATE has not been called
12586 .          if !r#TERMINATE \{\
12587 .\" ...and not if defer space has already been added
12588 .             if !\\n[#DEFER_SPACE_ADDED] \{\
12589 .\" ...and not if the footnote count the last time we checked for
12590 .\" a defer situation inside a diversion is greater than 1.
12591 .                if !\\n[#SAVED_DIVER_FN_COUNT]>1 \{\
12592 .                   if \\n[#FN_MARKER_STYLE]=1 .ALD 1v
12593 .                   if \\n[#RESET_FN_NUMBER] .ALD 1v
12594 .                   nr #DEFER_SPACE_ADDED 1
12595 .                \}
12596 .             \}
12597 .          \}
12598 .          rr #FN_DEFER_SPACE
12599 .          rr #SAVED_DIVER_FN_COUNT
12600 .       \}
12601 .       if \\n[#DIVERTED]=3 \{\
12602 .          if \\n[#FN_COUNT]>0 \{\
12603 \!.           RLD 1v
12604 .          \}
12605 .       \}
12606 .\" Add footnote rule (or, if no rule, some whitespace).
12607 .\" N.B.- this line increments #FN_COUNT each and every time FOOTNOTE
12608 .\" is run.
12609 .       if \\n+[#FN_COUNT]=1 \{\
12610 .\" If a footnote is called in a diversion, and the footnote has to
12611 .\" be moved, don't put in the rule now (it's taken care of when
12612 .\" FN_IN_DIVER is output into FOOTNOTE in PROCESS_FN_IN_DIVER).
12613 .          if !\\n[#DONT_RULE_ME]=1 \{\
12614 .             if !\\n[#FN_DEPTH] \{\
12615 .                if \\n[#PRINT_STYLE]=1 \{\
12616 .                   if !\\n[#RUN_ON] .sp \\n[#DOC_LEAD]u
12617 .                \}
12618 .                ie \\n[#FN_RULE]=1 \{\
12619 .                   if !\\n[#RUN_ON] \{\
12620 .                      if \\n[#SINGLE_SPACE] .sp \\n[#DOC_LEAD]u
12621 .                      PRINT_FOOTNOTE_RULE
12622 .                      if !'\\*[$FN_SPACE]'' .sp -\\*[$FN_SPACE]
12623 .                   \}
12624 .                \}
12625 .                el .sp 1v
12626 .                nr #RULED 1
12627 .             \}
12628 .          \}
12629 .       \}
12630 .       rr #DONT_RULE_ME
12631 .       ds $RESTORE_SS_VAR \\*[$SS_VAR]
12632 .       SS 0
12633 .\" Add footnote markers to footnote text...
12634 .       ie \\n[#FN_MARKERS] \{\
12635 .          if !'\\*[$FN_SPACE]'' \{\
12636 .             if \\n[#FN_COUNT]>0 .ALD \\*[$FN_SPACE]
12637 .          \}
12638 .          if !\\n[#NO_FN_MARKER] \{\
12639 .\" ...but not if TERMINATE has been called.
12640 .             if !r#TERMINATE \{\
12641 .                if \\n[#REF]=1 \{\
12642 .                   nr #REF_FN_INDENT (u;\\*[$REF_FN_INDENT])
12643 .                   ti \\n[#REF_FN_INDENT]u
12644 .                \}
12645 .                if \\n[#FN_MARKER_STYLE]=1 \{\
12646 .                   ie \\n[#COLUMNS]=1 \{\
12647 .                      \\n+[#FN_COUNT_FOR_COLS]
12648 .                      if \\n[#FN_COUNT_FOR_COLS]=1 .PRINT *\c
12649 .                      if \\n[#FN_COUNT_FOR_COLS]=2 .PRINT \[dg]\c
12650 .                      if \\n[#FN_COUNT_FOR_COLS]=3 .PRINT \[dd]\c
12651 .                      if \\n[#FN_COUNT_FOR_COLS]=4 .PRINT **\c
12652 .                      if \\n[#FN_COUNT_FOR_COLS]=5 .PRINT \[dg]\[dg]\c
12653 .                      if \\n[#FN_COUNT_FOR_COLS]=6 .PRINT \[dd]\[dd]\c
12654 .                      if \\n[#FN_COUNT_FOR_COLS]=7 .PRINT ***\c
12655 .                      if \\n[#FN_COUNT_FOR_COLS]=8 .PRINT \[dg]\[dg]\[dg]\c
12656 .                      if \\n[#FN_COUNT_FOR_COLS]=9 .PRINT \[dd]\[dd]\[dd]\c
12657 .                      if \\n[#FN_COUNT_FOR_COLS]=10 .PRINT ****\c
12658 .                   \}
12659 .                   el \{\
12660 .                      if \\n[#FN_COUNT]=1 .PRINT *\c
12661 .                      if \\n[#FN_COUNT]=2 .PRINT \[dg]\c
12662 .                      if \\n[#FN_COUNT]=3 .PRINT \[dd]\c
12663 .                      if \\n[#FN_COUNT]=4 .PRINT **\c
12664 .                      if \\n[#FN_COUNT]=5 .PRINT \[dg]\[dg]\c
12665 .                      if \\n[#FN_COUNT]=6 .PRINT \[dd]\[dd]\c
12666 .                      if \\n[#FN_COUNT]=7 .PRINT ***\c
12667 .                      if \\n[#FN_COUNT]=8 .PRINT \[dg]\[dg]\[dg]\c
12668 .                      if \\n[#FN_COUNT]=9 .PRINT \[dd]\[dd]\[dd]\c
12669 .                      if \\n[#FN_COUNT]=10 .PRINT ****\c
12670 .                   \}
12671 .                \}
12672 .                if \\n[#FN_MARKER_STYLE]=2 \{\
12673 .                   ds $FN_NUMBER \\n[#FN_NUMBER]
12674 .                   length #FN_NUMBER_LENGTH \\*[$FN_NUMBER]
12675 .                   if \\n[#COLUMNS]=1 \{\
12676 .                      \\n+[#FN_COUNT_FOR_COLS]
12677 .                   \}
12678 .                   if \\n[#NOT_YET_ADJUSTED]=1 \{\
12679 .                      nr #FN_NUMBER 1 1
12680 .                      rr #NOT_YET_ADJUSTED
12681 .                   \}
12682 .                   if \\n[#PRINT_STYLE]=1 \{\
12683 .                      ie \\n[#NO_SUPERSCRIPT] \{\
12684 .                         ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACEHOLDERS] \
12685 .                            PRINT "\0(\\n[#FN_NUMBER])\|\c"
12686 .                         el \
12687 .                            PRINT "(\\n[#FN_NUMBER])\|\c"
12688 .                      \}
12689 .                      el \{\
12690 .                         ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACEHOLDERS] \
12691 .                            PRINT \
12692 "\s-2\v'-\\n[.v]u/5u'\0\\n[#FN_NUMBER]\|\v'+\\n[.v]u/5u'\s+2\|\c"
12693 .                         el \
12694 .                            PRINT \
12695 "\s-2\v'-\\n[.v]u/5u'\\n[#FN_NUMBER]\|\v'+\\n[.v]u/5u'\s+2\|\c"
12696 .                      \}
12697 .                   \}
12698 .                   if \\n[#PRINT_STYLE]=2 \{\
12699 .                      ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACEHOLDERS] \
12700 .                         PRINT "\*[SUP]\0\\n[#FN_NUMBER]\*[SUPX]\*[FU 3]\c"
12701 .                      el \
12702 .                         PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\*[FU 3]\c"
12703 .                   \}
12704 .                \}
12705 .             \}
12706 .          \}
12707 .       \}
12708 .       el \{\
12709 .\" Line-numbered footnotes handling
12710 .          if \\n[#FN_MARKER_STYLE]=3 \{\
12711 .             if \\n[#FN_SPACE]>0 \{\
12712 .                if !\\n[#RUN_ON]=1 \
12713 .                   if \\n[#FN_COUNT]>0 .ALD \\n[#FN_SPACE]u
12714 .             \}
12715 .             if \\n[#REF]=1 \{\
12716 .                if !\\n[#RUN_ON]=1 \{\
12717 \!.                 ti +\\n[#REF_FN_INDENT]u
12718 .                \}
12719 .             \}
12720 .             ie \\n[#FN_LN_BRACKETS]=1 \{\
12721 .                ds $FN_LINENUMBER \v'-.085m'\\*[$FN_OPEN_BRACKET]\v'.085m'
12722 .                ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \
12723 .                   as $FN_LINENUMBER \
12724 \\n[#FN_MARK]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m'\h'.25m'
12725 .                el \
12726 .                   as $FN_LINENUMBER \
12727 \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\v'-.085m'\
12728 \\*[$FN_CLOSE_BRACKET]\v'.085m'\h'.25m'
12729 .             \}
12730 .             el \{\
12731 .                ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \
12732 .                   ds $FN_LINENUMBER \\n[#FN_MARK]\\*[$FN_LN_SEP]
12733 .                el \
12734 .                   ds $FN_LINENUMBER \
12735 \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\\*[$FN_LN_SEP]
12736 .                \}
12737 .             \}
12738 .             if !\\n[#NO_FN_MARKER] \
12739 .                PRINT \\*[$FN_LINENUMBER]\c
12740 .             rm $FN_LINENUMBER
12741 .             nr #FN_MARK 0
12742 .          \}
12743 .       \}
12744 .    \}
12745 .    el \{\
12746 .\" If INDENT arg is passed to FOOTNOTE, calculate the indent...
12747 .       ie '\\$1'INDENT' \{\
12748 .          ev FOOTNOTES
12749 .          if '\\$2'L' .in (\\$3)
12750 .          if '\\$2'LEFT' .in (\\$3)
12751 .          if '\\$2'R' .nr #FN_R_INDENT (\\$3)
12752 .          if '\\$2'RIGHT' .nr #FN_R_INDENT (\\$3)
12753 .          if '\\$2'B' \{\
12754 .             nr #FN_BL_INDENT (\\$3)
12755 .             ie '\\$4'' .nr #FN_BR_INDENT \\n[#FN_BL_INDENT]
12756 .             el .nr #FN_BR_INDENT (\\$4)
12757 .             in \\n[#FN_BL_INDENT]u
12758 .          \}
12759 .          if '\\$2'BOTH' \{\
12760 .             nr #FN_BL_INDENT (\\$3)
12761 .             ie '\\$4'' .nr #FN_BR_INDENT \\n[#FN_BL_INDENT]
12762 .             el .nr #FN_BR_INDENT (\\$4)
12763 .             in \\n[#FN_BL_INDENT]u
12764 .          \}
12765 .          ev
12766 .\" ...then re-run FOOTNOTE without an argument.
12767 .          FOOTNOTE
12768 .       \}
12769 .       el \{\
12770 .          br
12771 .\" Add "defer space" if the previously diverted footnote was the
12772 .\" 1st footnote proper to its page (i.e. it looks like a deferred
12773 .\" footnote but it's really an overflow).
12774 .          if \\n[#DIVERTED] \{\
12775 .             if \\n[#PREV_FN_DEFERRED]=1 \{\
12776 .                if \\n[#FN_MARKER_STYLE]=1 .ALD \\n[#FN_LEAD]u
12777 .                if \\n[#RESET_FN_NUMBER] .ALD \\n[#FN_LEAD]u
12778 .                nr #PREV_FN_DEFERRED 2
12779 .             \}
12780 .          \}
12781 .          if \\n[#REF]=1 \{\
12782 \!.           in
12783 .          \}
12784 .\" Terminate FOOTNOTES or FN_IN_DIVER diversion
12785 .          di
12786 .          HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
12787 .          hy 14
12788 .\" More housekeeping
12789 .\" Turn off indent possibly set by FOOTNOTE INDENT
12790 .          in 0
12791 .          ev
12792 .          if \\n[#UNDERLINE_WAS_ON_FN] \{\
12793 .             UNDERLINE
12794 .             rr #UNDERLINE_WAS_ON_FN
12795 .          \}
12796 .\" Restore sentence spacing
12797 .          if \\n[#PRINT_STYLE]=2 \{\
12798 .             if d $RESTORE_SS_VAR .SS \\*[$RESTORE_SS_VAR]
12799 .             rm $RESTORE_SS_VAR
12800 .          \}
12801 .          rr #FN_R_INDENT
12802 .          rr #FN_BR_INDENT
12803 .          nr #PP_STYLE \\n[#PP_STYLE_PREV]
12804 .          if !\\n[#INDENT_FIRSTS] .INDENT_FIRST_PARAS OFF
12805 .          rr #INDENT_FIRSTS
12806 .\" Calculate footnote depth, but not if #COUNTERS_RESET (created in
12807 .\" DIVER_FN_1_PRE) to instruct FOOTNOTES to skip this step for now
12808 .\" (it's taken care of when FN_IN_DIVER is output into FOOTNOTES in
12809 .\" PROCESS_FN_IN_DIVER).
12810 .          ie r#COUNTERS_RESET .rr #COUNTERS_RESET
12811 .          el \{\
12812 .             nr #GET_DEPTH 1
12813 .\" If the footnote is the 1st on the page and it falls too close
12814 .\" to the bottom margin, defer the footnote text to the next page...
12815 .             if (\\n[#SPACE_REMAINING]-1)<=(\\n[.v]) \{\
12816 .\" ...but not if PROCESS_FN_LEFTOVER has set #PREV_FN_DEFERRED to 1
12817 .                if !\\n[#PREV_FN_DEFERRED]=1 \{\
12818 .                   nr #FN_DEFER 1
12819 .                   nr #FN_DEPTH +\\n[#DIVER_DEPTH]
12820 .                   rr #GET_DEPTH
12821 .\" This is required so that the defer space clause can distinguish
12822 .\" a real #FN_COUNT=1 from one generated if FOOTNOTE is run inside
12823 .\" QUOTE, BLOCKQUOTE or EPIGRAPH
12824 .                   if \\n[#DIVER_FN]=2 \{\
12825 .                      nr #SAVED_DIVER_FN_COUNT \\n[#FN_COUNT]
12826 .                      rr #DIVER_FN
12827 .                   \}
12828 .                \}
12829 .             \}
12830 .\" Calculate the footnote depth.
12831 .             if \\n[#GET_DEPTH]=1 \{\
12832 .\" Save the previous footnote depth (for use when there will be
12833 .\" some overflowed footnote text).
12834 .                nr #SAVED_FN_DEPTH_1 \\n[#FN_DEPTH]
12835 .\" Add the depth of the current footnote to any already existent
12836 .\" footnotes.
12837 .                nr #FN_DEPTH +\\n[#DIVER_DEPTH]
12838 .\" Special handling for run-on footnotes
12839 .                if \\n[#RUN_ON]=1 \{\
12840 .                   if \\n[#RUNON_FOOTNOTES]   .unformat RUNON_FOOTNOTES
12841 .                   if \\n[#RUNON_FN_IN_DIVER] .unformat RUNON_FN_IN_DIVER
12842 .                   ev FOOTNOTES
12843 .\" Recreate FOOTNOTES with rule followed by text of unformatted
12844 .\" run-on footnotes.
12845 .                   di FOOTNOTES
12846 .                   ie \\n[#FN_RULE]=0 .RLD 1v
12847 .                   el \{\
12848 \v'-\\n[#FN_RULE_ADJ]u-\\n[#FN_RULE_WEIGHT_ADJ]u'\
12849 \D't \\n[#FN_RULE_WEIGHT]'\
12850 \h'-\\n[#FN_RULE_WEIGHT]u'\
12851 \D'l \\n[#FN_RULE_LENGTH]u 0'\
12852 \v'+\\n[#FN_RULE_ADJ]u+\\n[#FN_RULE_WEIGHT_ADJ]u'
12853 .                   \}
12854 .                   br
12855 .                   if \\n[#RUNON_FOOTNOTES] \{\
12856 .                      RUNON_FOOTNOTES
12857 .                      rr #RUNON_FOOTNOTES
12858 .                   \}
12859 .                   if \\n[#RUNON_FN_IN_DIVER] \{\
12860 .                      RUNON_FN_IN_DIVER
12861 .                      rr #RUNON_FN_IN_DIVER
12862 .                   \}
12863 .                   br
12864 .                   di
12865 .                   ev
12866 .                   nr #FN_DEPTH \\n[#DIVER_DEPTH]
12867 .                   nr #SAVED_VFP 0+\\n[#VARIABLE_FOOTER_POS]
12868 .                   nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
12869 .                \}
12870 .\" Save the new depth
12871 .                nr #SAVED_FN_DEPTH_2 \\n[#FN_DEPTH]
12872 .\" Signal that defer space should be added when PROCESS_FN_LEFTOVER
12873 .\" processes deferred footnotes.
12874 .                if \\n[#FN_DEFER] \{\
12875 .                   if \\n[#FN_COUNT]=2 \{\
12876 .                      ie \\n[#COLUMNS] \{\
12877 .                         if !\\n[#FROM_FOOTER] \{\
12878 .                            if \\n[#FN_DEFER]=1 .nr #FN_DEFER_SPACE 1
12879 .                            if \\n[#FN_COUNT_FOR_COLS]>=1 .rr #FN_DEFER_SPACE
12880 .                            if \\n[#FROM_HEADER] .nr #FN_DEFER_SPACE 1
12881 .                         \}
12882 .                      \}
12883 .                      el .nr #FN_DEFER_SPACE 1
12884 .                   \}
12885 .                   rr #FN_DEFER
12886 .                \}
12887 .\" If the depth of the whole footnote won't fit in the space
12888 .\" between where we are on the page and the bottom margin, calculate
12889 .\" how much of it will fit.
12890 .                if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
12891 .                   nr #FN_LINES 0 1
12892 .                   while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
12893 .                      nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
12894 .                   \}
12895 .                   nr #VFP_DIFF \\n[#FN_DEPTH]-\\n[#SAVED_FN_DEPTH_1]
12896 .                   nr #OVERFLOW 1
12897 .\" Very occasionally, #VFP_DIFF, on a 1st footnote that isn't to
12898 .\" be deferred, comes up with a depth equal to exactly 1 line
12899 .\" of footnotes, i.e. enough room to print the rule and nothing
12900 .\" else.  The following tests for such a condition, and rather than
12901 .\" attempting to treat the footnote as an overflow, it tells mom to
12902 .\" treat it as a special kind of deferred footnote (#FN_DEFER 2).
12903 .                   if \\n[#SAVED_FN_DEPTH_1]=0 \{\
12904 .                      if \\n[#FN_DEPTH]=\\n[#FN_LEAD] \{\
12905 .                         nr #FN_DEFER 2
12906 .                         nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_2]
12907 .                         rr #OVERFLOW
12908 .                      \}
12909 .                   \}
12910 .                \}
12911 .\" Calculate VFP based on whether the footnote overflows, or is to
12912 .\" be treated normally.
12913 .                ie \\n[#OVERFLOW]=1 \{\
12914 .                   if \\n[#RUN_ON] \{\
12915 .                      rr #VARIABLE_FOOTER_POS
12916 .                      nr #VARIABLE_FOOTER_POS \\n[#SAVED_VFP]
12917 .                   \}
12918 .                   ie \\n[#FN_COUNT]=1 \{\
12919 .                      ie \\n[#RULED]=1 \{\
12920 .                         ie \\n[#COLUMNS]=1 \{\
12921 .                            ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
12922 .                               ie \\n[#FROM_FOOTER] \{\
12923 .                                  ie \\n[#FN_COUNT_FOR_COLS]>1 \{\
12924 .                                     nr #FN_DEPTH -\\n[#FN_DEPTH]
12925 .                                     if \\n[#DIVERTED]=1 .nr #DIVERTED 3
12926 .                                     if !\\n[#PREV_FN_DEFERRED]=1 \
12927 .                                        nr #FN_DEPTH -\\n[#VFP_DIFF]
12928 .                                  \}
12929 .                                  el \{\
12930 .                                     nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
12931 .                                     if \\n[#DIVERTED]=1 .nr #DIVERTED 3
12932 .                                  \}
12933 .                               \}
12934 .                               el .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
12935 .                            \}
12936 .                            el .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
12937 .                         \}
12938 .                         el .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
12939 .                      \}
12940 .                      el \{\
12941 .                         nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
12942 .                         if \\n[#DIVERTED]=1 .nr #DIVERTED 3
12943 .                         if !\\n[#PREV_FN_DEFERRED]=1 \{\
12944 .                            ie \\n[#COLUMNS]=1 \{\
12945 .                               if !\\n[#FROM_FOOTER] .
12946 .                            \}
12947 .                            el .nr #FN_DEPTH -\\n[#VFP_DIFF]
12948 .                         \}
12949 .                         if \\n[#DIVERTED]=3 \{\
12950 .                            if !\\n[#PREV_FN_DEFERRED] \{\
12951 .                               if !\\n[#FROM_FOOTER] \{\
12952 .                                  if \\n[#FN_COUNT]=1 \{\
12953 .                                     if !\\n[#VFP_DIFF] \{\
12954 .                                        if \\n[#FN_MARKER_STYLE]=1 \{\
12955 .                                           da FOOTNOTES
12956 \!.                                            ALD \\n[#FN_LEAD]u
12957 .                                           di
12958 .                                        \}
12959 .                                        if \\n[#RESET_FN_NUMBER] \{\
12960 .                                           da FOOTNOTES
12961 \!.                                            ALD \\n[#FN_LEAD]u
12962 .                                           di
12963 .                                        \}
12964 .                                     \}
12965 .                                  \}
12966 .                               \}
12967 .                            \}
12968 .                         \}
12969 .                      \}
12970 .                      nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
12971 .                   \}
12972 .                   el \{\
12973 .                      nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
12974 .                      nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
12975 .                   \}
12976 .                   rr #OVERFLOW
12977 .                   rr #RULED
12978 .                \}
12979 .                el \{\
12980 .                   nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
12981 .                   if \\n[#PREV_FN_DEFERRED]=1 \{\
12982 .                      if \\n[#DIVERTED] \{\
12983 .                         if !\\n[#FN_DEPTH]=\\n[#SAVED_FN_DEPTH_1] \{\
12984 .                            nr #FN_DEPTH +\\n[#FN_LEAD]
12985 .                            nr #VARIABLE_FOOTER_POS -\\n[#FN_LEAD]
12986 .                            rr #PREV_FN_DEFERRED
12987 .                         \}
12988 .                      \}
12989 .                   \}
12990 .                   if \\n[#FN_COUNT]>1 \{\
12991 .                      nr #NO_BACK_UP 1
12992 .                      rr #DIVERTED
12993 .                      rr #RULED
12994 .                   \}
12995 .                \}
12996 .             \}
12997 .          \}
12998 .          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
12999 .\" If we have a footnote whose text has to be deferred to the next
13000 .\" page, reset the FOOTER trap to its original location.
13001 .          if \\n[#FN_DEFER] \{\
13002 .             nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
13003 .             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13004 .          \}
13005 .       \}
13006 .       nr #NO_FN_MARKER 0
13007 .    \}
13008 .    if \\n[#NUM_ARGS]=2 \{\
13009 .       if '\\$2'BREAK' .BR
13010 .       if '\\$2'BR' .BR
13011 .    \}
13012 .END
13013 \#
13014 \# Utility macros to manage footnotes that occur inside diversions
13015 \# ---------------------------------------------------------------
13016 \#
13017 \# There are some redundancies here; they're left in in case unforeseen
13018 \# footnote situations crop up in the future that might require
13019 \# manipulation of them.
13020 \#
13021 \# 1. Pre-footnote processing for footnotes in diversions
13022 \#
13023 \# a) A footnote inside a diversion will be moved entirely (marker
13024 \# in running text and text of footnote) to the next page/column.
13025 \#
13026 .MAC DIVER_FN_1_PRE END
13027 .    nr #RESET_FN_COUNTERS 1
13028 .    nr #COUNTERS_RESET 1
13029 .    if \\n[#DONE_ONCE]=1 \{\
13030 .       if \\n[#FN_DEFER] \{\
13031 .          if \\n[#SAVED_DIVER_FN_COUNT]=1 \{\
13032 .             ie \\n[#COLUMNS]=1 \
13033 .                if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_DEFER_SPACE 1
13034 .             el .nr #FN_DEFER_SPACE 1
13035 .          \}
13036 .       \}
13037 .       if \\n[#FN_MARKER_STYLE]=1 \{\
13038 .          if \\n[#FN_COUNT]>0 .nr #FN_COUNT 0 1
13039 .          if \\n[#COLUMNS]=1 \
13040 .             if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_COUNT_FOR_COLS 0 1
13041 .       \}
13042 .       if \\n[#FN_MARKER_STYLE]=2 \{\
13043 .          if \\n[#RESET_FN_NUMBER]=1 \{\
13044 .             ie \\n[#COLUMNS]=1 \
13045 .                if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_NUMBER 0 1
13046 .             el .nr #FN_NUMBER 0 1
13047 .          \}
13048 .       \}
13049 .    \}
13050 .END
13051 \#
13052 \# b) Treat as a normal footnote, including defers.
13053 \#
13054 .MAC DIVER_FN_2_PRE END
13055 .    nr #RESET_FN_COUNTERS 2
13056 .END
13057 \#
13058 \# 2. Post-footnote processing for footnotes in diversions
13059 \#
13060 \# Even when a footnote inside a diversion is treated as
13061 \# "normal," some manipulation of registers is required.  The
13062 \# macro is called in DO_QUOTE (i.e. at the termination of
13063 \# quotes and blockquotes) and in DO_EPIGRAPH.
13064 \#
13065 .MAC DIVER_FN_2_POST END
13066 .    if \\n[#DONE_ONCE]=1 \{\
13067 .       if \\n[#FN_MARKER_STYLE]=1 \{\
13068 .          if \\n[#FN_COUNT]=0 .nr #DONT_RULE_ME 1
13069 .          if \\n[#FN_COUNT]>0 .nr #FN_COUNT 0 1
13070 .          if \\n[#COLUMNS]=1 \{\
13071 .             if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_COUNT_FOR_COLS 0 1
13072 .             if !\\n[#COL_NUM]=\\n[#NUM_COLS] .
13073 .          \}
13074 .       \}
13075 .       if \\n[#FN_MARKER_STYLE]=2 \{\
13076 .          if \\n[#FN_COUNT]=0 .nr #DONT_RULE_ME 1
13077 .          if \\n[#FN_COUNT]>0 .nr #FN_COUNT 0 1
13078 .          if \\n[#RESET_FN_NUMBER]=1 \{\
13079 .             ie \\n[#COLUMNS]=1 \
13080 .                if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_NUMBER 0 1
13081 .             el .nr #FN_NUMBER 0 1
13082 .          \}
13083 .       \}
13084 .    \}
13085 .END
13086 \#
13087 \# The main macros that handle footnote processing.
13088 \# -----------------------------------------------
13089 \#
13090 \# FN_OVERFLOW_TRAP starts off "underneath" FOOTER, but is revealed
13091 \# as #VARIABLE_FOOTER_POSITION changes the position of FOOTER.
13092 \# FN_OVERFLOW_TRAP simply starts diversion FN_OVERFLOW to "catch"
13093 \# the overflow.  The diversion is ended in FOOTER, immediately after
13094 \# FOOTER outputs the diversion, FOOTNOTES, before PROCESS_FN_LEFTOVER
13095 \# is run (either in HEADER, or in FOOTER if moving col to col).
13096 \#
13097 .MAC FN_OVERFLOW_TRAP END
13098 .    if \\n[#FN_COUNT] \{\
13099 .       di FN_OVERFLOW
13100 .       ie !\\n[#NO_BACK_UP]=1 \{\
13101 .          if \\n[#PREV_FN_DEFERRED] \{\
13102 .             ie \\n[#COLUMNS]=1 \{\
13103 .                if \\n[#FROM_FOOTER] \{\
13104 .                   if \\n[#PREV_FN_DEFERRED] \{\
13105 .                      if !\\n[#COL_NUM]=\\n[#NUM_COLS] \
13106 .                      rr #PREV_FN_DEFERRED
13107 .                   \}
13108 .                \}
13109 .                if !\\n[#FROM_FOOTER] \{\
13110 .                   if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13111 .                      if !\\n[#LAST_FN_COUNT_FOR_COLS]>1 \{\
13112 \!.                       RLD \\n[#FN_LEAD]u
13113 .                      \}
13114 .                   \}
13115 .                \}
13116 .             \}
13117 .             el \{\
13118 \!.              RLD \\n[#FN_LEAD]u
13119 .             \}
13120 .          \}
13121 .       \}
13122 .       el \{\
13123 .          rr #NO_BACK_UP
13124 .          rr #PREV_FN_DEFERRED
13125 .       \}
13126 .    \}
13127 .\" When #FROM_DIVERT_FN is 1, it signals to FOOTNOTE, when run from
13128 .\" within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING to the total
13129 .\" area allowable for running text.
13130 \#.    nr #FROM_DIVERT_FN 1
13131 .END
13132 \#
13133 \# PROCESS_FN_LEFTOVER is called at the top of HEADER, and in
13134 \# FOOTER if we're moving from one column to the next (i.e. after
13135 \# outputting FOOTNOTES).  It checks for whether we have a "deferred
13136 \# footnote" situation, and resets counters and number registers
13137 \# accordingly.  Lastly, if we have some footnote overflow, it calls
13138 \# DIVERT_FN_OVERFLOW.
13139 \#
13140 .MAC PROCESS_FN_LEFTOVER END
13141 .    if \\n[#PREV_FN_DEFERRED]=2 \
13142 .       if \\n[#FN_COUNT_AT_FOOTER]>1 .rr #PREV_FN_DEFERRED
13143 .    ie !\\n[#FN_DEFER] \{\
13144 .       nr #FN_COUNT 0 1
13145 .       nr #FN_DEPTH 0
13146 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
13147 .    \}
13148 .    el \{\
13149 .       if \\n[#FN_DEFER]=1 .nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
13150 .       if \\n[#FN_DEFER]=2 \{\
13151 .          nr #FN_DEPTH 0
13152 .          nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
13153 .       \}
13154 .    \}
13155 .    nr #SPACE_REMAINING 0
13156 .    ch FOOTER -\\n[#B_MARGIN]u
13157 .    if \\n[#FN_DEFER] \{\
13158 .       nr #NO_FN_MARKER 1
13159 .       FOOTNOTE
13160 .       nf
13161 .       FOOTNOTE OFF
13162 .       ie \\n[#COLUMNS]=1 \{\
13163 .          if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13164 .             if !\\n[#FROM_FOOTER] \{\
13165 .                if \\n[#FN_COUNT_FOR_COLS]=1 .nr #PREV_FN_DEFERRED 1
13166 .             \}
13167 .          \}
13168 .       \}
13169 .       el .nr #PREV_FN_DEFERRED 1
13170 .    \}
13171 .    if !\\n[#FN_DEFER] \
13172 .       if \\n[#FN_OVERFLOW_DEPTH] .DIVERT_FN_LEFTOVER
13173 .    ie \\n[#COLUMNS]=1 \{\
13174 .       if \\n[#COL_NUM]>1 \
13175 .          if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_COUNT 0 1
13176 .    \}
13177 .    el .nr #FN_COUNT 0 1
13178 .    if \\n[#DIVER_FN]=2 .rr #DIVER_FN
13179 .    rr #FROM_DIVERT_FN
13180 .END
13181 \#
13182 \# DIVERT_FN_LEFTOVER is called in PROCESS_FN_LEFTOVER (at
13183 \# the top of HEADER, and in FOOTER if we're moving from one column
13184 \# to the next).
13185 \#
13186 .MAC DIVERT_FN_LEFTOVER END
13187 .    nr #NO_FN_MARKER 1
13188 .    nr #DIVERTED 1
13189 .    FOOTNOTE
13190 .    nf
13191 .    FN_OVERFLOW
13192 .    FOOTNOTE OFF
13193 .    if \\n[#PREV_FN_DEFERRED] \{\
13194 .       nr #FN_DEPTH -\\n[#FN_LEAD]
13195 .       nr #VARIABLE_FOOTER_POS +\\n[#FN_LEAD]
13196 .       ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13197 .       if \\n[#PREV_FN_DEFERRED]=2 \{\
13198 .          nr #PREV_FN_DEFERRED 1
13199 .          rr #DIVERTED
13200 .       \}
13201 .    \}
13202 .    rr #FN_OVERFLOW_DEPTH
13203 .END
13204 \#
13205 \# This is a special macro to deal with footnotes that are set inside
13206 \# diversions (QUOTE, BLOCKQUOTE and EPIGRAPH).  It's called in HEADER
13207 \# (and in FOOTER, if we're moving from column to column), and comes
13208 \# after PROCESS_FOOTNOTE_LEFTOVER in those two macros.
13209 \#
13210 .MAC PROCESS_FN_IN_DIVER END
13211 .    nr #SPACE_REMAINING 0
13212 .    ch FOOTER -\\n[#B_MARGIN]u
13213 .    nr #NO_FN_MARKER 1
13214 .    if !\\n[#RESET_FN_COUNTERS]=2 .rr #RESET_FN_COUNTERS
13215 .    FOOTNOTE
13216 .    if \\n[#FN_OVERFLOW_DEPTH] .nf
13217 .    ie dRUNON_FN_IN_DIVER \{\
13218 .       RUNON_FN_IN_DIVER
13219 .       rm RUNON_FN_IN_DIVER
13220 .    \}
13221 .    el \{\
13222 .       nf
13223 .       FN_IN_DIVER
13224 .    \}
13225 .    FOOTNOTE OFF
13226 .    rr #DIVER_FN
13227 .END
13228 \#
13229 \# ====================================================================
13230 \#
13231 \# +++ENDNOTES+++
13232 \#
13233 \# When endnotes are output, the spacing between the notes is always
13234 \# 1 extra linespace.  This can have bottom margin consequences.  If
13235 \# this doesn't bother you, don't worry about it.  If it does bother
13236 \# you, and you want to adjust the spacing between any two endnotes (as
13237 \# they're output), make the spacing adjustments (.ALD/.RLD) at the
13238 \# *end* of endnotes (i.e. just before .ENDNOTE OFF), not at the top.
13239 \#
13240 \# Endnotes must be output manually with .ENDNOTES. This allows user
13241 \# the flexibility to output endnotes at the end of each collated
13242 \# document, or to output them at the end of the entire document.
13243 \#
13244 \# Control macros
13245 \# --------------
13246 \#
13247 \# ENDNOTE POINT SIZE
13248 \# ------------------
13249 \# *Argument:
13250 \#   <base point size for endnotes>
13251 \# *Function:
13252 \#   Creates or modifies register #EN_PS.
13253 \# *Notes:
13254 \#   Default is same as running text in body of document.
13255 \#
13256 \#   This size control macro differs from other size control macros
13257 \#   in that it sets an absolute point size, not a relative one.  This
13258 \#   is because a) endnotes always appear separate from the body of
13259 \#   a document and therefore don't need to be relative to the body
13260 \#   of the document, and b) there are quite a few elements of the
13261 \#   endnotes page(s) that need to be relative to the base point size
13262 \#   of that page.  If the base endnote point size were relative to
13263 \#   the body of the document (i.e. a _SIZE macro taking a +|- value)
13264 \#   getting the rest of the endnote elements sized properly could
13265 \#   become very confusing.
13266 \#
13267 .MAC ENDNOTE_PT_SIZE END
13268 .    nr #EN_PS (p;\\$1)
13269 .END
13270 \#
13271 \# ENDNOTES, BIBLIOGRAPHY and TOC LEADING
13272 \# --------------------------------------
13273 \# *Argument:
13274 \#   <leading> [ ADJUST ]
13275 \# *Function:
13276 \#   Depending on the name by which it's called, creates or modifies
13277 \#   register #<type>_LEAD, where <type> is BIB, EN, or TOC.  Creates or removes
13278 \#   register #ADJ_<type>_LEAD.  Stores arguments in strings if BIB,
13279 \#   EN, or TOC leading are set before START.
13280 \# *Notes:
13281 \#   Default is same as doc lead for TYPESET, adjusted; 24 for TYPEWRITE.
13282 \#
13283 .MAC _LEAD END
13284 .    if '\\$0'BIBLIOGRAPHY_LEAD' .ds $SECTION BIB
13285 .    if '\\$0'ENDNOTE_LEAD' .ds $SECTION EN
13286 .    if '\\$0'TOC_LEAD' .ds $SECTION TOC
13287 .    ds $\\*[$SECTION]_LEAD \\$1
13288 .    ds $ADJUST_\\*[$SECTION]_LEAD \\$2
13289 .    if !\\n[#OK_PROCESS_LEAD] .return
13290 .    nr #\\*[$SECTION]_LEAD (p;\\$1)
13291 .    rr #ADJ_\\*[$SECTION]_LEAD
13292 .    als \\*[$SECTION]_LEAD DOC_LEAD
13293 .    if '\\$2'ADJUST' \{\
13294 .       nr #ORIG_DOC_LEAD \\n[#UNADJUSTED_DOC_LEAD]
13295 .       nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
13296 .       nr #ADJ_DOC_LEAD 1
13297 .       nr #ADJ_\\*[$SECTION]_LEAD 1
13298 .       nr #NO_TRAP_RESET 1
13299 .       \\*[$SECTION]_LEAD \\n[#\\*[$SECTION]_LEAD]u ADJUST
13300 .       nr #\\*[$SECTION]_LEAD \\n[#DOC_LEAD]
13301 .       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
13302 .       rr #NO_TRAP_RESET
13303 .       nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
13304 .       rr #ORIG_DOC_LEAD
13305 .    \}
13306 .END
13307 \#
13308 .ALIAS BIBLIOGRAPHY_LEAD _LEAD
13309 .ALIAS ENDNOTE_LEAD _LEAD
13310 .ALIAS TOC_LEAD _LEAD
13311 \#
13312 \# ENDNOTE SPACING
13313 \# ----------------
13314 \# *Arguments:
13315 \#   <per item endnote spacing> | <anything>
13316 \# *Function:
13317 \#   Enables space between endnotes items.
13318 \# *Notes:
13319 \#   Default is no space.
13320 \#
13321 .MAC ENDNOTE_SPACING END
13322 .    ie \B'\\$1' .ds $EN_SPACE \\$1
13323 .    el .rm $EN_SPACE
13324 .END
13325 \#
13326 \# ENDNOTES_HDRFTR_CENTER
13327 \# ----------------------
13328 \# *Argument:
13329 \#   toggle
13330 \# *Function:
13331 \#   Creates or removes toggle register #EN_HDRFTR_CENTER, used to
13332 \#   determine whether mom should print a/the hdrftr center string
13333 \#   on the endnotes page.  Primarily to enable/disable printing of the
13334 \#   chapter name in hdrftrs when DOCTYPE CHAPTER.
13335 \# *Notes:
13336 \#   Default is OFF
13337 \#
13338 .MAC ENDNOTES_HDRFTR_CENTER END
13339 .    ie '\\$1'' .nr #EN_HDRFTR_CENTER 1
13340 .    el .rr #EN_HDRFTR_CENTER
13341 .END
13342 \#
13343 \# ENDNOTE STRING
13344 \# --------------
13345 \# *Argument:
13346 \#   <title for endnotes page>
13347 \# *Function:
13348 \#   Creates or modifies string $EN_STRING.
13349 \# *Notes:
13350 \#   Default is "Endnotes"
13351 \#
13352 .MAC ENDNOTE_STRING END
13353 .    ds $EN_STRING \\$1
13354 .END
13355 \#
13356 .MAC ENDNOTE_STRING_ADVANCE END
13357 .    nr #EN_STRING_ADVANCE (\\$1)
13358 .END
13359 \#
13360 \# ENDNOTE STRING CAPS
13361 \# -------------------
13362 \# *Arguments:
13363 \#   <none> | <anything>
13364 \# *Function:
13365 \#   Turns capitalization of the endnotes pages title string
13366 \#   "Endnotes" on or off.
13367 \# *Notes:
13368 \#   Users may want the endnotes pages title string to be in caps,
13369 \#   but the toc entry for endnotes in lower case.  If the argument
13370 \#   to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
13371 \#   turned on, this is exactly what will happen.
13372 \#
13373 \#   Default is on.
13374 \#
13375 .MAC ENDNOTE_STRING_CAPS END
13376 .   ie '\\$1'' .nr #EN_STRING_CAPS 1
13377 .   el .nr #EN_STRING_CAPS 0
13378 .END
13379 \#
13380 \# ENDNOTE TITLE
13381 \# -------------
13382 \# *Argument:
13383 \#   <string that appears before the first endnote pertaining to any document>
13384 \# *Function:
13385 \#   Creates string $EN_TITLE.
13386 \# *Notes:
13387 \#   Default is the document title, or, if doc is a chapter, "Chapter #"
13388 \#
13389 .MAC ENDNOTE_TITLE END
13390 .    ds $EN_TITLE \\$1
13391 .END
13392 \#
13393 \# ENDNOTE MARKER STYLE
13394 \# --------------------
13395 \# *Arguments:
13396 \#   NUMBER | LINE | SUPERSCRIPT
13397 \# *Function:
13398 \#   Sets register #EN_MARKER_STYLE, used in ENDNOTE to determine
13399 \#   the style of endnote markers (labels).
13400 \# *Notes:
13401 \#   1=NUMBER; 2=LINE.  LINE means "use output line numbers".
13402 \#   Default is NUMBER.
13403 \#
13404 .MAC ENDNOTE_MARKER_STYLE END
13405 .    if '\\$1'NUMBER' .nr #EN_MARKER_STYLE 1
13406 .    if '\\$1'LINE' \{\
13407 .       nr #EN_MARKER_STYLE 2
13408 .       if !\\n[#EN_LN_SEP] \
13409 .          if !\\n[#EN_LN_BRACKETS] .ENDNOTE_LINENUMBER_BRACKETS SQUARE
13410 .    \}
13411 .    if '\\$1'SUPERSCRIPT' .nr #EN_MARKER_STYLE 3
13412 .END
13413 \#
13414 \# ENDNOTE LINENUMBER MARK
13415 \# -----------------------
13416 \# *Function:
13417 \#   This string, when called inline, stores the current output line
13418 \#   number in register #EN_MARK for use with ENDNOTE.
13419 \#
13420 .ds EN_MARK \R'#EN_MARK \En[ln]'
13421 \#
13422 \# ENDNOTE LINENUMBER SEPARATOR
13423 \# ----------------------------
13424 \# *Argument:
13425 \#   <user-defined separator>
13426 \# *Function:
13427 \#   Stores user-defined separator (for use then
13428 \#   ENDNOTE_MARKER_STYLE is LINE) in string $EN_LN_SEP.  The
13429 \#   separator is intended to be used when the user wishes a
13430 \#   separator, rather than the choice of brackets offered by
13431 \#   ENDNOTE_LINENUMBER_BRACKETS.
13432 \#
13433 .MAC ENDNOTE_LINENUMBER_SEPARATOR END
13434 .    rr #EN_LN_BRACKETS
13435 .    nr #EN_LN_SEP 1
13436 .    ds $EN_LN_SEP "\\$1
13437 .END
13438 \#
13439 \# ENDNOTE LINENUMBER BRACKETS
13440 \# ---------------------------
13441 \# *Argument:
13442 \#   PARENS | SQUARE | BRACES or ( | [ | {
13443 \# *Function:
13444 \#   Sets register #EN_LN_BRACKETS to 1, and creates strings
13445 \#   $EN_OPEN_BRACKET and $EN_CLOSE_BRACKET according to the given argument.
13446 \#
13447 .MAC ENDNOTE_LINENUMBER_BRACKETS END
13448 .    rr #EN_LN_SEP
13449 .    nr #EN_LN_BRACKETS 1
13450 .    if '\\$1'PARENS' \{\
13451 .       ds $EN_OPEN_BRACKET (
13452 .       ds $EN_CLOSE_BRACKET )
13453 .    \}
13454 .    if '\\$1'(' \{\
13455 .       ds $EN_OPEN_BRACKET (
13456 .       ds $EN_CLOSE_BRACKET )
13457 .    \}
13458 .    if '\\$1'SQUARE' \{\
13459 .       ds $EN_OPEN_BRACKET [
13460 .       ds $EN_CLOSE_BRACKET ]
13461 .    \}
13462 .    if '\\$1'[' \{\
13463 .       ds $EN_OPEN_BRACKET [
13464 .       ds $EN_CLOSE_BRACKET ]
13465 .    \}
13466 .    if '\\$1'BRACES' \{\
13467 .       ds $EN_OPEN_BRACKET {
13468 .       ds $EN_CLOSE_BRACKET }
13469 .    \}
13470 .    if '\\$1'{' \{\
13471 .       ds $EN_OPEN_BRACKET {
13472 .       ds $EN_CLOSE_BRACKET }
13473 .    \}
13474 .END
13475 \#
13476 \# ENDNOTE LINENUMBER GAP
13477 \# ----------------------
13478 \# *Argument:
13479 \#   <space between line-number labels and endnotes text>
13480 \# *Function:
13481 \#   Defines string $EN_LN_GAP, used during printing of line-number
13482 \#   labels in ENDNOTE.
13483 \#
13484 .MAC ENDNOTE_LINENUMBER_GAP END
13485 .    nr #EN_LN_GAP (u;\\$1)
13486 .END
13487 \#
13488 \# ENDNOTE NUMBERS ALIGNMENT
13489 \# -------------------------
13490 \# *Argument:
13491 \#   LEFT | RIGHT <max. number of digit placeholders that will appear in endnotes>
13492 \# *Function:
13493 \#   Creates registers for _LEFT or _RIGHT; creates register
13494 \#   #EN_NUMBER_PLACEHOLDERS.
13495 \# *Notes:
13496 \#   Default is for endnote numbers to be right aligned to 2 placeholders.
13497 \#
13498 .MAC ENDNOTE_NUMBERS_ALIGN END
13499 .    if '\\$1'LEFT' \{\
13500 .       rr #EN_NUMBERS_ALIGN_RIGHT
13501 .       nr #EN_NUMBERS_ALIGN_LEFT 1
13502 .    \}
13503 .    if '\\$1'RIGHT' \{\
13504 .       rr #EN_NUMBERS_ALIGN_LEFT
13505 .       nr #EN_NUMBERS_ALIGN_RIGHT 1
13506 .    \}
13507 .    nr #EN_NUMBER_PLACEHOLDERS \\$2
13508 .END
13509 \#
13510 \# ENDNOTE PARAGRAPH INDENT
13511 \# ------------------------
13512 \# *Argument:
13513 \#   <first line indent of paras subsequent to 1st in endnotes>
13514 \# *Function:
13515 \#   Creates register #EN_PP_INDENT for use in .PP.
13516 \# *Notes:
13517 \#   Requires a unit of measure.
13518 \#
13519 \#   Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
13520 \#
13521 .MAC ENDNOTE_PARA_INDENT END
13522 .    nr #EN_PP_INDENT (\\$1)
13523 .END
13524 \#
13525 \# TURN OFF COLUMN MODE FOR ENDNOTES
13526 \# ---------------------------------
13527 \# *Argument:
13528 \#   <none> | <anything>
13529 \# *Function:
13530 \#   Creates or removes register #EN_NO_COLS
13531 \# *Notes:
13532 \#   Allows user to tell mom not to set endnotes in columnar
13533 \#   documents in columns.  Default is to set endnotes in columns.
13534 \#
13535 .MAC ENDNOTES_NO_COLUMNS END
13536 .    ie '\\$1'' .nr #EN_NO_COLS 1
13537 .    el .rr #EN_NO_COLS
13538 .END
13539 \#
13540 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
13541 \# -------------------------------------------
13542 \# *Argument:
13543 \#   <none> | <anything>
13544 \# *Function:
13545 \#   Creates or removes register #EN_NO_FIRST_PN
13546 \# *Notes:
13547 \#   For use if FOOTERS are on.  Tells ENDNOTES not to put a page
13548 \#   number on the first endnotes page.  Some users may want this.
13549 \#   Default is to print a page number at the top of the first
13550 \#   endnotes page when footers are on.
13551 \#
13552 .MAC ENDNOTES_NO_FIRST_PAGENUM END
13553 .    ie '\\$1'' .nr #EN_NO_FIRST_PN 1
13554 .    el .rr #EN_NO_FIRST_PN
13555 .END
13556 \#
13557 \# PAGE HEADERS ON ENDNOTES PAGES
13558 \# ------------------------------
13559 \# *Argument:
13560 \#   <none> | ALL
13561 \# *Function:
13562 \#   Creates or removes register #EN_ALLOWS_HEADERS or
13563 \#   #EN_ALLOWS_HEADERS_ALL
13564 \# *Notes:
13565 \#   Whether ENDNOTES puts a page header at the top of endnotes
13566 \#   pages if page headers are used throughout the document.
13567 \#   Default is to insert the page headers, but not on the first
13568 \#   page.  If the optional argument ALL is given, ENDNOTES puts a
13569 \#   page header on the first page as well.
13570 \#
13571 .MAC ENDNOTES_ALLOWS_HEADERS END
13572 .    ie '\\$1'' .nr #EN_ALLOWS_HEADERS 1
13573 .    el \{\
13574 .       ie '\\$1'ALL' \{\
13575 .          nr #EN_ALLOWS_HEADERS 1
13576 .          nr #EN_ALLOWS_HEADERS_ALL 1
13577 .       \}
13578 .       el \{\
13579 .          nr #EN_ALLOWS_HEADERS 0
13580 .          nr #EN_ALLOWS_HEADERS_ALL 0
13581 .       \}
13582 .    \}
13583 .END
13584 \#
13585 \# ENDNOTES PAGES PAGE NUMBERING STYLE
13586 \# -----------------------------------
13587 \# *Argument:
13588 \#   DIGIT | ROMAN | roman | ALPHA | alpha
13589 \# *Function:
13590 \#   Creates or modifies $EN_PN_STYLE.
13591 \# *Notes:
13592 \#   Allows user to define what style should be used for endnotes
13593 \#   pages page numbering.  Arguments are the same as for
13594 \#   PAGENUM_STYLE.
13595 \#
13596 \#   Default is DIGIT.
13597 \#
13598 .MAC ENDNOTES_PAGENUM_STYLE END
13599 .    ds $EN_PN_STYLE \\$1
13600 .END
13601 \#
13602 \# FIRST PAGE NUMBER FOR ENDNOTES
13603 \# ------------------------------
13604 \# *Argument:
13605 \#   <page number that appears on page 1 of endnotes pages>
13606 \# *Function:
13607 \#   Creates or modifies string $EN_FIRST_PN
13608 \# *Notes:
13609 \#   To be used with caution, only if all endnotes
13610 \#   are to be output at once, i.e. not at the end of the separate
13611 \#   docs of a collated doc
13612 \#
13613 .MAC ENDNOTES_FIRST_PAGENUMBER END
13614 .    nr #EN_FIRST_PN \\$1
13615 .END
13616 \#
13617 \# SINGLESPACE ENDNOTES
13618 \# --------------------
13619 \# *Argument:
13620 \#   <none> | <anything>
13621 \# *Function:
13622 \#   Sets lead of endnotes pages in TYPEWRITE to 12 points,
13623 \#   adjusted.
13624 \# *Notes:
13625 \#   Default is to double-space endnotes pages.
13626 \#
13627 .MAC SINGLESPACE_ENDNOTES END
13628 .    if \\n[#PRINT_STYLE]=1 \{\
13629 .       ie \\n[#SINGLE_SPACE] \{\
13630 .          nr #EN_SINGLESPACE 1
13631 .          rr #IGNORE
13632 .          if \\n[#OK_PROCESS_LEAD] \{\
13633 .             ENDNOTE_LEAD 12 ADJUST
13634 .             nr #IGNORE 1
13635 .          \}
13636 .       \}
13637 .       el \{\
13638 .          ie '\\$1'' \{\
13639 .             nr #EN_SINGLESPACE 1
13640 .             rr #IGNORE
13641 .             if \\n[#OK_PROCESS_LEAD] \{\
13642 .                ENDNOTE_LEAD 12 ADJUST
13643 .                nr #IGNORE 1
13644 .             \}
13645 .          \}
13646 .          el \{\
13647 .             rr #EN_SINGLESPACE
13648 .             rr #IGNORE
13649 .             if \\n[#OK_PROCESS_LEAD] \{\
13650 .                ENDNOTE_LEAD 24 ADJUST
13651 .                nr #IGNORE 1
13652 .             \}
13653 .          \}
13654 .       \}
13655 .    \}
13656 .END
13657 \#
13658 \# ENDNOTE PARAGRAPH SPACE
13659 \# -----------------------
13660 \# *Argument:
13661 \#   toggle
13662 \# *Function:
13663 \#   Creates toggle register #EN_PP_SPACE for use in .PP.
13664 \# *Notes:
13665 \#   Like PARA_SPACE.  Default is not to space endnote paras.
13666 \#
13667 .MAC ENDNOTE_PARA_SPACE END
13668 .    ie '\\$1'' .nr #EN_PP_SPACE 1
13669 .    el .rr #EN_PP_SPACE
13670 .END
13671 \#
13672 \# ENDNOTE
13673 \# -------
13674 \# *Argument:
13675 \#   toggle
13676 \# *Function:
13677 \#   Places superscript endnote number in text, then collects and
13678 \#   processes endnote in diversion END_NOTES.
13679 \# *Notes:
13680 \#   \c must be appended to the word immediately preceding .ENDNOTE
13681 \#   when ENDNOTE_MARKER_STYLE is NUMBER.
13682 \#
13683 .MAC ENDNOTE END
13684 .    ie '\\$1'' \{\
13685 .       nr #ENDNOTE 1
13686 .       ie !\\n[#EN_MARKER_STYLE]=2 \{\
13687 .          if \\n[#CONDENSE] .nop \*[CONDX]\c
13688 .          if \\n[#EXTEND] .nop \*[EXTX]\c
13689 .             if \\n[#UNDERLINE_ON] \{\
13690 .                nr #UNDERLINE_WAS_ON 1
13691 .                UNDERLINE OFF
13692 .             \}
13693 .          if \\n[#PRINT_STYLE]=1 \{\
13694 .             if \\n[#SLANT_ON] \{\
13695 .                 nr #SLANT_WAS_ON 1
13696 .                 nop \*[SLANTX]\c
13697 .             \}
13698 .\" Vertical raise amount here is more than when the same string is printed in
13699 .\" the endnotes so bottom of number aligns with top of bowl.
13700 .             PRINT \
13701 "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
13702 .          \}
13703 .          if \\n[#PRINT_STYLE]=2 .PRINT \*[SUP]\\n+[#EN_NUMBER]\*[SUPX]\c
13704 .       \}
13705 .       el \{\
13706 .          ie r#EN_NUMBER .nr #EN_NUMBER \\n[#EN_NUMBER]+1
13707 .          el .nr #EN_NUMBER 1 1
13708 .          if !\\n[#LINENUMBERS] \{\
13709 .             tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
13710 .             tm1 "       ENDNOTE_MARKER_STYLE is LINE.
13711 .             ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
13712 .          \}
13713 .          if \\n[#EN_MARK]=0 .nr #EN_MARK \\n[ln]
13714 .          nr #EN_MARK_2 \\n[ln]
13715 .          if '\\n[.z]'P_QUOTE' \{\
13716 .             nr #EN_MARK -1
13717 .             nr #EN_MARK_2 -1
13718 .          \}
13719 .       \}
13720 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
13721 .       nr #PP_STYLE 1
13722 .       if \\n[#INDENT_FIRST_PARAS] .nr #INDENT_FIRSTS 1
13723 .       INDENT_FIRST_PARAS
13724 .       ev EN
13725 .       da END_NOTES
13726 .       LL \\n[#DOC_L_LENGTH]u
13727 .       ta \\n[.l]u
13728 .       if \\n[#COLUMNS] \{\
13729 .          ie \\n[#EN_NO_COLS] .LL \\n[#DOC_L_LENGTH]u
13730 .          el .LL \\n[#COL_L_LENGTH]u
13731 .          ta \\n[.l]u
13732 .       \}
13733 \!.     if \\\\n[.vpt]=0 .vpt
13734 \!.     ne 3
13735 .       vs \\n[#EN_LEAD]u
13736 .\" Print identifying doc title (eg Chapter n)
13737 .       if \\n[#EN_NUMBER]=1 \{\
13738 .          if \\n[#PRINT_STYLE]=1 .TYPEWRITER
13739 .          if \\n[#PRINT_STYLE]=2 \{\
13740 .             FAMILY  \\*[$EN_TITLE_FAM]
13741 .             FT      \\*[$EN_TITLE_FT]
13742 .             ps \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
13743 .          \}
13744 .          sp
13745 .          if !'\\*[$EN_TITLE]'' \{\
13746 .             if '\\*[$EN_TITLE_QUAD]'L'      .LEFT
13747 .             if '\\*[$EN_TITLE_QUAD]'LEFT'   .LEFT
13748 .             if '\\*[$EN_TITLE_QUAD]'C'      .CENTER
13749 .             if '\\*[$EN_TITLE_QUAD]'CENTER' .CENTER
13750 .             if '\\*[$EN_TITLE_QUAD]'CENTRE' .CENTER
13751 .             if '\\*[$EN_TITLE_QUAD]'R'      .RIGHT
13752 .             if '\\*[$EN_TITLE_QUAD]'RIGHT'  .RIGHT
13753 .             ie \\n[#EN_TITLE_UNDERLINE] \{\
13754 .                nr #FROM_EN_TITLE 1
13755 .                UNDERSCORE "\\*[$EN_TITLE]"
13756 .                rr #FROM_EN_TITLE
13757 .             \}
13758 .             el .PRINT "\\*[$EN_TITLE]"
13759 .          \}
13760 .       \}
13761 .\" Get indent from endnotes point size; convert string to reg in
13762 .\" case indent string is, e.g., m or n
13763 .       ps \\n[#EN_PS]u
13764 .       nr #REF_EN_INDENT (u;\\*[$REF_EN_INDENT])
13765 .       if \\n[#PRINT_STYLE]=1 \{\
13766 .          TYPEWRITER
13767 .          if \\n[#EN_NUMBER]=1 .sp
13768 .          if \\n[#EN_MARKER_STYLE]=3 .ps -2
13769 .       \}
13770 .       if \\n[#PRINT_STYLE]=2 \{\
13771 .          if \\n[#EN_NUMBER]=1 \
13772 .             if !'\\*[$EN_TITLE]'' .sp .5v
13773 .          if \\n[#EN_MARKER_STYLE]=1 \{\
13774 .             FAMILY  \\*[$EN_NUMBER_FAM]
13775 .             FT      \\*[$EN_NUMBER_FT]
13776 .             ps \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
13777 .          \}
13778 .          if \\n[#EN_MARKER_STYLE]=2 \{\
13779 .             FAMILY  \\*[$EN_LN_FAM]
13780 .             FT      \\*[$EN_LN_FT]
13781 .             ps \\n[#EN_PS]u\\*[$EN_LN_SIZE_CHANGE]
13782 .          \}
13783 .          if \\n[#EN_MARKER_STYLE]=3 \{\
13784 .             FAMILY  \\*[$EN_NUMBER_FAM]
13785 .             FT      \\*[$EN_NUMBER_FT]
13786 .             ps \\n[#PT_SIZE_IN_UNITS]u*6u/10u
13787 .          \}
13788 .       \}
13789 .\" Build string for line-numbered endnotes
13790 .       if \\n[#EN_MARKER_STYLE]=2 \{\
13791 .          ie \\n[#EN_LN_BRACKETS]=1 \{\
13792 .             ds $EN_LINENUMBER \v'-.085m'\\*[$EN_OPEN_BRACKET]\v'.085m'
13793 .             ie \\n[#EN_MARK_2]=\\n[#EN_MARK] .as $EN_LINENUMBER \
13794 \\n[#EN_MARK]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m'\"
13795 .             el .as $EN_LINENUMBER \
13796 \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\v'-.085m'\
13797 \\*[$EN_CLOSE_BRACKET]\v'.085m'\"
13798 .          \}
13799 .          el \{\
13800 .             ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \
13801 .                ds $EN_LINENUMBER \
13802 \\n[#EN_MARK]\\*[$EN_LN_SEP]
13803 .             el \
13804 .                ds $EN_LINENUMBER \
13805 \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\\*[$EN_LN_SEP]
13806 .          \}
13807 .          nr #EN_MARK 0
13808 .       \}
13809 .       vpt 0
13810 .       ie \\n[#EN_NUMBERS_ALIGN_RIGHT] .RIGHT
13811 .       el .LEFT
13812 .       if \\n[#EN_MARKER_STYLE]=1 \
13813 .          nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
13814 .       if \\n[#EN_MARKER_STYLE]=2 \{\
13815 .          ie \\n[#EN_LN_BRACKETS]=1 .nr #EN_NUMBER_L_LENGTH \
13816 (\w'\0'*(\\n[#EN_NUMBER_PLACEHOLDERS]*2))+\w'-[]'
13817 .          el .nr #EN_NUMBER_L_LENGTH \
13818 (\w'\0'*(\\n[#EN_NUMBER_PLACEHOLDERS]*2))+\w'-\\*[$EN_LN_SEP]'
13819 .          RIGHT
13820 .       \}
13821 .       if \\n[#EN_MARKER_STYLE]=3 \{\
13822 .          nr #EN_NUMBER_L_LENGTH \
13823 \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+.15m
13824 .          RIGHT
13825 .       \}
13826 .       ie \\n[#REF]=1 \
13827 .          ll \\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u
13828 .       el .ll \\n[#EN_NUMBER_L_LENGTH]u
13829 .       if \\n[#EN_MARKER_STYLE]=1 \{\
13830 .          if \\n[#REF]=1 .ti \\n[#REF_EN_INDENT]u
13831 .          nop \En[#EN_NUMBER].
13832 .       \}
13833 .       if \\n[#EN_MARKER_STYLE]=2 \{\
13834 .          nop \\*[$EN_LINENUMBER]
13835 .          rm $EN_LINENUMBER
13836 .       \}
13837 .       if \\n[#EN_MARKER_STYLE]=3 \{\
13838 .          ps \" Reset ps changed to get width of s-script numbers
13839 .          ie \\n[#PRINT_STYLE]=1 \{\
13840 .\" Vertical raise amount here is less than when the same string is printed in
13841 .\" the body of the text because number precedes a cap.
13842 .             nop \
13843 \s-2\v'-\\n[#DOC_LEAD]u/7u'\\n[#EN_NUMBER]\|\v'+\\n[#DOC_LEAD]u/7u'\s+2
13844 .          \}
13845 .          el .nop \E*[SUP]\\n[#EN_NUMBER]\E*[SUPX]\h'.15m'
13846 .       \}
13847 .       EOL
13848 .       ll
13849 .       nr #EN_FIGURE_SPACE \w'\0'
13850 .       if \\n[#EN_MARKER_STYLE]=1 \{\
13851 .          ie \\n[#REF]=1 .ti \
13852 \\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u+\\n[#EN_FIGURE_SPACE]u
13853 .          el .in \
13854 \\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_FIGURE_SPACE]u
13855 .       \}
13856 .       if \\n[#EN_MARKER_STYLE]=2 \{\
13857 .          ie \\n[#REF]=1 .ti \
13858 \\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u+\\n[#EN_LN_GAP]u
13859 .          el .ti \
13860 \\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_LN_GAP]u
13861 .       \}
13862 .       if \\n[#EN_MARKER_STYLE]=3 \{\
13863 .          ie \\n[#REF]=1 .ti \
13864 \\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u+\w'\|'u
13865 .          el .in \
13866 \\n[#EN_NUMBER_L_LENGTH]u
13867 .       \}
13868 .       nr #EN_TEXT_INDENT \\n[.i]
13869 .       QUAD \\*[$EN_QUAD]
13870 .       vpt 1
13871 .       if \\n[#PRINT_STYLE]=1 .TYPEWRITER
13872 .       if \\n[#PRINT_STYLE]=2 \{\
13873 .          FAMILY  \\*[$EN_FAM]
13874 .          FT      \\*[$EN_FT]
13875 .          ps \\n[#EN_PS]u
13876 .       \}
13877 .    \}
13878 .    el \{\
13879 \!.     ie \\n[#EN_NUMBER]=\\\\n[#LAST_EN] .vpt 0
13880 \!.     el .br
13881 .       if \\n[#PRINT_STYLE]=2 .sp \\*[$EN_SPACE]
13882 .       in 0
13883 .       if \\n[#EN_MARKER_STYLE]=2 \{\
13884 \!.        in 0
13885 .       \}
13886 .       da
13887 .\" Restore sentence spacing
13888 .       if \\n[#PRINT_STYLE]=2 \{\
13889 .          if d$RESTORE_SS_VAR .SS \\*[$RESTORE_SS_VAR]
13890 .          rm $RESTORE_SS_VAR
13891 .       \}
13892 .       ev
13893 .\" Restore lead -- need
13894 .       nr #PP_STYLE \\n[#PP_STYLE_PREV]
13895 .       if !\\n[#INDENT_FIRSTS] .INDENT_FIRST_PARAS OFF
13896 .       rr #INDENT_FIRSTS
13897 .       rr #ENDNOTE
13898 .       if \\n[#UNDERLINE_WAS_ON] \{\
13899 .          rr #UNDERLINE_WAS_ON
13900 .          UNDERLINE
13901 .       \}
13902 .       if \\n[#SLANT_WAS_ON] \{\
13903 .          rr #SLANT_WAS_ON
13904 \*[SLANT]\c
13905 .       \}
13906 .    \}
13907 .    if \\n[#NUM_ARGS]=2 \{\
13908 .       if '\\$2'BREAK' .BR
13909 .       if '\\$2'BR' .BR
13910 .    \}
13911 .END
13912 \#
13913 \# ENDNOTES
13914 \# --------
13915 \# *Arguments:
13916 \#   none
13917 \# *Function:
13918 \#   Sets new document leading from #EN_LEAD, breaks to a new page,
13919 \#   sets up an endnotes page based on registers and strings associated
13920 \#   with endnotes, then outputs diversion END_NOTES.
13921 \#
13922 .MAC ENDNOTES END
13923 .    if \\n[defer] .NEWPAGE
13924 .    nr #LAST_EN \\n[#EN_NUMBER]
13925 .    nr #ENDNOTES 1
13926 .    nr #EN_FIRST_PAGE 1
13927 .    nr #HEADER_STATE \\n[#HEADERS_ON]
13928 .    ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
13929 .    if \\n[#LINENUMBERS]=1 \{\
13930 .       NUMBER_LINES OFF
13931 .       nr #LINENUMBERS 2
13932 .    \}
13933 .    if \\n[#HEADERS_ON]=1 \
13934 .       if !\\n[#EN_ALLOWS_HEADERS_ALL] .HEADERS OFF
13935 .    if \\n[#HEADER_STATE]=1 \{\
13936 .       ie \\n[#EN_HDRFTR_CENTER]=1 .
13937 .       el .rm $HDRFTR_CENTER
13938 .    \}
13939 .    ie !\\n[#SUSPEND_PAGINATION] \{\
13940 .       if \\n[#PAGINATE]=1 \{\
13941 .          if \\n[#PAGE_NUM_V_POS]=1 \{\
13942 .             PAGENUM_STYLE \\*[$EN_PN_STYLE]
13943 .             if \\n[#EN_FIRST_PN] .PAGENUMBER \\n[#EN_FIRST_PN]-1
13944 .             if r #EN_NO_FIRST_PN .nr #PAGINATE 0
13945 .          \}
13946 .       \}
13947 .    \}
13948 .    el \{\
13949 .       ie \\n[#PAGE_NUM_V_POS]=2 .nr #PAGINATE 1
13950 .       el .nr #PAGINATE 0
13951 .    \}
13952 .    if \\n[#FOOTERS_ON]=1 \{\
13953 .       if !'\\*[$HDRFTR_CENTER_OLD]'' \
13954 .          ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
13955 .    \}
13956 .    NEWPAGE
13957 .    if \\n[#FOOTERS_ON]=1 \{\
13958 .       ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
13959 .       rm $HDRFTR_CENTER_OLD
13960 .       rm $HDRFTR_CENTER_NEW
13961 .    \}
13962 .    ie !\\n[#SUSPEND_PAGINATION] \{\
13963 .       if \\n[#PAGE_NUM_V_POS]=1 \{\
13964 .          if r #EN_NO_FIRST_PN \
13965 .             if \\n[#PAGINATION_STATE]=1 .nr #PAGINATE 1
13966 .       \}
13967 .    \}
13968 .    el \
13969 .       if \\n[#PAGE_NUM_V_POS]=2 .nr #PAGINATE 0
13970 .    rr #PAGINATION_STATE
13971 .    PAGENUM_STYLE \\*[$EN_PN_STYLE]
13972 .    if \\n[#EN_FIRST_PN] .PAGENUMBER \\n[#EN_FIRST_PN]
13973 .    if \\n[#HEADER_STATE]=1 \
13974 .       if \\n[#EN_ALLOWS_HEADERS] .HEADERS
13975 .\" Collect endnotes title string for TOC
13976 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
13977 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
13978 .    ds $TOC_TITLE_ITEM \\*[$EN_STRING]\|
13979 .    PDF_BOOKMARK 1 \\*[$EN_STRING]
13980 .    TITLE_TO_TOC
13981 .\" End collection of endnotes title string for TOC
13982 .\" Process endnotes
13983 .    if \\n[#PRINT_STYLE]=1 .vs \\n[#EN_LEAD]u
13984 .    if \\n[#PRINT_STYLE]=2 \{\
13985 .       if \\n[#EN_NO_COLS] \{\
13986 .          if \\n[#COLUMNS] .nr #COLUMNS_WERE_ON 1
13987 .          nr #COLUMNS 0
13988 .       \}
13989 .       nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
13990 .       ie \\n[#ADJ_EN_LEAD] .nr #DOC_LEAD \\n[#EN_LEAD]
13991 .       el .DOC_LEAD \\n[#EN_LEAD]u
13992 .    \}
13993 .    vpt 0
13994 .    ie r#EN_STRING_ADVANCE .sp |\\n[#EN_STRING_ADVANCE]u-1v
13995 .    el .sp |\\n[#T_MARGIN]u-1v
13996 .    vpt 1
13997 .    mk ec
13998 .    if \\n[#SLANT_ON] \{\
13999 \*[SLANTX]\c
14000 .    \}
14001 .    sp
14002 .    if !'\\*[$EN_STRING]'' \{\
14003 .       if \\n[#PRINT_STYLE]=1 \{\
14004 .          TYPEWRITER
14005 .          vs \\n[#EN_LEAD]u
14006 .       \}
14007 .       if \\n[#PRINT_STYLE]=2 \{\
14008 .          LL \\n[#DOC_L_LENGTH]u
14009 .          ta \\n[.l]u
14010 .          if \\n[#COLUMNS] \{\
14011 .             ie \\n[#EN_NO_COLS] .LL \\n[#DOC_L_LENGTH]u
14012 .             el .LL \\n[#COL_L_LENGTH]u
14013 .             ta \\n[.l]u
14014 .          \}
14015 .          FAMILY  \\*[$EN_STRING_FAM]
14016 .          FT      \\*[$EN_STRING_FT]
14017 .          ps \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
14018 .          vs      \\n[#EN_LEAD]u
14019 .          if \\n[#ENDNOTE_STRING_COLOR]=1 \{\
14020 .             COLOR \\*[$ENDNOTE_STRING_COLOR]
14021 .             EOL
14022 .          \}
14023 .       \}
14024 .       if '\\*[$EN_STRING_QUAD]'L'      .LEFT
14025 .       if '\\*[$EN_STRING_QUAD]'LEFT'   .LEFT
14026 .       if '\\*[$EN_STRING_QUAD]'C'      .CENTER
14027 .       if '\\*[$EN_STRING_QUAD]'CENTER' .CENTER
14028 .       if '\\*[$EN_STRING_QUAD]'CENTRE' .CENTER
14029 .       if '\\*[$EN_STRING_QUAD]'R'      .RIGHT
14030 .       if '\\*[$EN_STRING_QUAD]'RIGHT'  .RIGHT
14031 .       EOL
14032 .       if \\n[#EN_STRING_CAPS] .CAPS
14033 .       ie \\n[#EN_STRING_UNDERLINE] \{\
14034 .          nr #FROM_EN_STRING 1
14035 .          ie \\n[#EN_STRING_UNDERLINE]=2 \
14036 .             UNDERSCORE2 \\*[$EN_UNDERLINE_GAP] \\*[$EN_RULE_GAP] "\\*[$EN_STRING]"
14037 .          el .UNDERSCORE "\\*[$EN_STRING]"
14038 .          rr #FROM_EN_STRING
14039 .       \}
14040 .       el .PRINT "\\*[$EN_STRING]
14041 .    \}
14042 .    CAPS OFF
14043 .    if \\n[#PRINT_STYLE]=1 \{\
14044 .       ie \\n[#SINGLE_SPACE]=1 .sp
14045 .       el \{\
14046 .          ie \\n[#EN_SINGLESPACE]=1 .sp
14047 .          el .
14048 .       \}
14049 .    \}
14050 .    if \\n[#PRINT_STYLE]=2 .ALD \\n[#EN_LEAD]u
14051 .    QUAD \\*[$EN_QUAD]
14052 .    chop END_NOTES
14053 .    nf
14054 .    END_NOTES
14055 .    rm END_NOTES
14056 .    ps \\n[#DOC_PT_SIZE]u
14057 .    if \\n[#PRINT_STYLE]=1 .vs \\n[#DOC_LEAD]u
14058 .    if \\n[#PRINT_STYLE]=2 \{\
14059 .       ie \\n[#ADJ_EN_LEAD] \
14060 .          nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
14061 .       el .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
14062 .       rr #RESTORE_DOC_LEAD
14063 .    \}
14064 .    if \\n[#COLUMNS_WERE_ON] .nr #COLUMNS 1
14065 .    if \\n[#HEADER_STATE]=1 .HEADERS
14066 .    if \\n[#LINENUMBERS]=2 \{\
14067 .       NUMBER_LINES RESUME
14068 .       nr #LINENUMBERS 1
14069 .    \}
14070 .
14071 .    PRINT_FOOTER
14072 .    rr #ENDNOTES
14073 .END
14074 \#
14075 \# ====================================================================
14076 \#
14077 \# +++BIBLIOGRAPHY+++
14078 \#
14079 \# Mom treats bibliographies and endnotes very similarly.  The chief
14080 \# difference is that endnotes are collected and formatted inside a
14081 \# diversion, while bibliographies are built "by hand."  ENDNOTES sets
14082 \# up the endnotes page and outputs the formatted diversion.
14083 \# BIBLIOGRAPHY sets up the bibliography page, then awaits refer
14084 \# commands.
14085 \#
14086 \# All of the bibliography control macros have their exact
14087 \# counterparts in the endnotes control macros.  See, therefore,
14088 \# Arguments, Functions, and Notes in the Endnotes section.
14089 \#
14090 \# Bibliography control macros
14091 \#
14092 .MAC BIBLIOGRAPHY_PT_SIZE END
14093 .    nr #BIB_PS (p;\\$1)
14094 .END
14095 \#
14096 .MAC BIBLIOGRAPHY_HDRFTR_CENTER END
14097 .    ie '\\$1'' .nr #BIB_HDRFTR_CENTER 1
14098 .    el .rr #BIB_HDRFTR_CENTER
14099 .END
14100 \#
14101 .MAC BIBLIOGRAPHY_STRING END
14102 .    ds $BIB_STRING \\$1
14103 .END
14104 \#
14105 .MAC BIBLIOGRAPHY_STRING_ADVANCE END
14106 .    nr #BIB_STRING_ADVANCE (\\$1)
14107 .END
14108 \#
14109 .MAC BIBLIOGRAPHY_STRING_CAPS END
14110 .   ie '\\$1'' .nr #BIB_STRING_CAPS 1
14111 .   el .nr #BIB_STRING_CAPS 0
14112 .END
14113 \#
14114 .MAC BIBLIOGRAPHY_NO_COLUMNS END
14115 .    ie '\\$1'' .nr #BIB_NO_COLS 1
14116 .    el .rr #BIB_NO_COLS
14117 .END
14118 \#
14119 .MAC BIBLIOGRAPHY_NO_FIRST_PAGENUM END
14120 .    ie '\\$1'' .nr #BIB_NO_FIRST_PN 1
14121 .    el .rr #BIB_NO_FIRST_PN
14122 .END
14123 \#
14124 .MAC BIBLIOGRAPHY_ALLOWS_HEADERS END
14125 .    ie '\\$1'' .nr #BIB_ALLOWS_HEADERS 1
14126 .    el \{\
14127 .       ie '\\$1'ALL' \{\
14128 .          nr #BIB_ALLOWS_HEADERS 1
14129 .          nr #BIB_ALLOWS_HEADERS_ALL 1
14130 .       \}
14131 .       el \{\
14132 .          rr #BIB_ALLOWS_HEADERS
14133 .          rr #BIB_ALLOWS_HEADERS_ALL
14134 .       \}
14135 .    \}
14136 .END
14137 \#
14138 .MAC BIBLIOGRAPHY_PAGENUM_STYLE END
14139 .    ds $BIB_PN_STYLE \\$1
14140 .END
14141 \#
14142 .MAC BIBLIOGRAPHY_FIRST_PAGENUMBER END
14143 .    nr #BIB_FIRST_PN \\$1
14144 .END
14145 \#
14146 .MAC SINGLESPACE_BIBLIOGRAPHY END
14147 .    if \\n[#PRINT_STYLE]=1 \{\
14148 .       ie \\n[#SINGLE_SPACE] \{\
14149 .          nr #BIB_SINGLESPACE 1
14150 .          rr #IGNORE
14151 .          if \\n[#OK_PROCESS_LEAD] \{\
14152 .             BIBLIOGRAPHY_LEAD 12 ADJUST
14153 .             nr #IGNORE 1
14154 .          \}
14155 .       \}
14156 .       el \{\
14157 .          ie '\\$1'' \{\
14158 .             nr #BIB_SINGLESPACE 1
14159 .             rr #IGNORE
14160 .             if \\n[#OK_PROCESS_LEAD] \{\
14161 .                BIBLIOGRAPHY_LEAD 12 ADJUST
14162 .                nr #IGNORE 1
14163 .             \}
14164 .          \}
14165 .          el \{\
14166 .             rr #BIB_SINGLESPACE
14167 .             rr #IGNORE
14168 .             if \\n[#OK_PROCESS_LEAD] \{\
14169 .                BIBLIOGRAPHY_LEAD 24 ADJUST
14170 .                nr #IGNORE 1
14171 .             \}
14172 .          \}
14173 .       \}
14174 .    \}
14175 .END
14176 \#
14177 \# Style for outputting collected bibliographic references
14178 \# -------------------------------------------------------
14179 \# *Argument:
14180 \#   LIST | PLAIN [ <list separator> ] [ <list prefix> ]
14181 \# *Function:
14182 \#   Sets #BIB_LIST to 1 for numbered list style, 0 for plain output
14183 \# *Notes:
14184 \#   Technically, user is supposed to enter PLAIN if s/he wants an
14185 \#   unumbered bibliography, but the el clause says "any arg but
14186 \#   LIST means unumbered."  Effectively, any arg but LIST produces
14187 \#   a "plain" bibliographic list.
14188 \#
14189 \#   The 2nd and 3rd args have the same options as the 2nd arg to LIST.
14190 \#
14191 .MAC BIBLIOGRAPHY_TYPE END
14192 .    ie '\\$1'LIST' \{\
14193 .       nr #BIB_LIST 1
14194 .       ie '\\$2'' \{\
14195 .          if '\\*[$BIB_LIST_SEPARATOR]'' .ds $BIB_LIST_SEPARATOR .
14196 .       \}
14197 .       el .ds $BIB_LIST_SEPARATOR \\$2
14198 .       ie '\\$3'' .ds $BIB_LIST_PREFIX
14199 .       el .ds $BIB_LIST_PREFIX \\$3
14200 .    \}
14201 .    el .nr #BIB_LIST 0
14202 .END
14203 \#
14204 \# Spacing between items in bibliographies
14205 \# ---------------------------------------
14206 \# *Argument:
14207 \#   <amount of space>
14208 \# *Function:
14209 \#   Gets value for #BIB_SPACE in units.
14210 \# *Notes:
14211 \#   Requires a unit of measure.
14212 \#
14213 .MAC BIBLIOGRAPHY_SPACING END
14214 .    ds $BIB_SPACE \\$1
14215 .    if \\n[#BIB_LEAD]=0 \{\
14216 .       nr #DEFER_BIB_SPACING 1
14217 .       return
14218 .    \}
14219 .    ds $EVAL_BIB_SPACE \\*[$BIB_SPACE]
14220 .    substring $EVAL_BIB_SPACE -1
14221 .    ie '\\*[$EVAL_BIB_SPACE]'v' \{\
14222 .       substring $BIB_SPACE 0 0
14223 .       nr #BIB_SPACE \\n[#BIB_LEAD]*\\*[$BIB_SPACE]
14224 .    \}
14225 .    el .nr #BIB_SPACE (\\$1)
14226 .END
14227 \#
14228 \# Set up bibliography page
14229 \# ------------------------
14230 \# *Function:
14231 \#   Sets up a new page, with title, ready to accept the output
14232 \#   of refer's $LIST$ or .R1 bibliography .R2
14233 \# *Notes:
14234 \#   Bibliography pages are set up almost identically to endnotes pages.
14235 \#
14236 .MAC BIBLIOGRAPHY END
14237 .    ie '\\$1'' \{\
14238 .       rr #FN_REF
14239 .       rr #EN_REF
14240 .       nr #BIBLIOGRAPHY 1
14241 .       nr #BIB_FIRST_PAGE 1
14242 .       nr #HEADER_STATE \\n[#HEADERS_ON]
14243 .       ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
14244 .       if \\n[#LINENUMBERS]=1 \{\
14245 .          NUMBER_LINES OFF
14246 .          nr #LINENUMBERS 2
14247 .       \}
14248 .       if \\n[#HEADERS_ON]=1 \
14249 .          if !\\n[#BIB_ALLOWS_HEADERS_ALL] .HEADERS OFF
14250 .       if \\n[#HEADER_STATE]=1 \{\
14251 .          ie \\n[#BIB_HDRFTR_CENTER]=1 .
14252 .          el .rm $HDRFTR_CENTER
14253 .       \}
14254 .       ie !\\n[#SUSPEND_PAGINATION] \{\
14255 .          if \\n[#PAGINATE]=1 \{\
14256 .             if \\n[#PAGE_NUM_V_POS]=1 \{\
14257 .                PAGENUM_STYLE \\*[$BIB_PN_STYLE]
14258 .                if \\n[#BIB_FIRST_PN] .PAGENUMBER \\n[#BIB_FIRST_PN]-1
14259 .                if r #BIB_NO_FIRST_PN .nr #PAGINATE 0
14260 .             \}
14261 .          \}
14262 .       \}
14263 .       el \{\
14264 .          ie \\n[#PAGE_NUM_V_POS]=2 .nr #PAGINATE 1
14265 .          el .nr #PAGINATE 0
14266 .       \}
14267 .       if \\n[#FOOTERS_ON]=1 \{\
14268 .          if !'\\*[$HDRFTR_CENTER_OLD]'' \
14269 .             ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
14270 .       \}
14271 .       NEWPAGE
14272 .       if \\n[#FOOTERS_ON]=1 \{\
14273 .          ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
14274 .          rm $HDRFTR_CENTER_OLD
14275 .          rm $HDRFTR_CENTER_NEW
14276 .       \}
14277 .       ie !\\n[#SUSPEND_PAGINATION] \{\
14278 .          if \\n[#PAGE_NUM_V_POS]=1 \{\
14279 .             if r #BIB_NO_FIRST_PN \{\
14280 .                if \\n[#PAGINATION_STATE]=1 .nr #PAGINATE 1
14281 .             \}
14282 .          \}
14283 .       \}
14284 .       el \
14285 .          if \\n[#PAGE_NUM_V_POS]=2 .nr #PAGINATE 0
14286 .       rr #PAGINATION_STATE
14287 .       PAGENUM_STYLE \\*[$BIB_PN_STYLE]
14288 .       if \\n[#BIB_FIRST_PN] .PAGENUMBER \\n[#BIB_FIRST_PN]
14289 .       if \\n[#HEADER_STATE]=1 \
14290 .          if \\n[#BIB_ALLOWS_HEADERS] .HEADERS
14291 .\" Collect bibliography title string for TOC
14292 .       nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
14293 .       af #TOC_ENTRY_PN \\g[#PAGENUMBER]
14294 .       ds $TOC_TITLE_ITEM \\*[$BIB_STRING]\\|
14295 .       PDF_BOOKMARK 1 \\*[$BIB_STRING]
14296 .       TITLE_TO_TOC
14297 .\" End collection of bibliography title string for TOC
14298 .\" Process bibliography
14299 .       if \\n[#PRINT_STYLE]=1 .vs \\n[#BIB_LEAD]u
14300 .       if \\n[#PRINT_STYLE]=2 \{\
14301 .          if \\n[#BIB_NO_COLS] \{\
14302 .             if \\n[#COLUMNS] .nr #COLUMNS_WERE_ON 1
14303 .             nr #COLUMNS 0
14304 .          \}
14305 .          nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
14306 .          ie \\n[#ADJ_BIB_LEAD] .nr #DOC_LEAD \\n[#BIB_LEAD]
14307 .          el .DOC_LEAD \\n[#BIB_LEAD]u
14308 .       \}
14309 .       vpt 0
14310 .       ie r#BIB_STRING_ADVANCE .sp |\\n[#BIB_STRING_ADVANCE]u-1v
14311 .       el .sp |\\n[#T_MARGIN]u-1v
14312 .       vpt 1
14313 .       mk bc
14314 .       if \\n[#SLANT_ON] \{\
14315 \*[SLANTX]\c
14316 .       \}
14317 .       sp
14318 .       if !'\\*[$BIB_STRING]'' \{\
14319 .          if \\n[#PRINT_STYLE]=1 \{\
14320 .             TYPEWRITER
14321 .             vs \\n[#BIB_LEAD]u
14322 .          \}
14323 .          if \\n[#PRINT_STYLE]=2 \{\
14324 .             LL \\n[#DOC_L_LENGTH]u
14325 .             ta \\n[.l]u
14326 .             if \\n[#COLUMNS] \{\
14327 .                ie \\n[#BIB_NO_COLS] .LL \\n[#DOC_L_LENGTH]u
14328 .                el .LL \\n[#COL_L_LENGTH]u
14329 .                ta \\n[.l]u
14330 .             \}
14331 .             FAMILY  \\*[$BIB_STRING_FAM]
14332 .             FT      \\*[$BIB_STRING_FT]
14333 .             ps \\n[#BIB_PS]u\\*[$BIB_STRING_SIZE_CHANGE]
14334 .             vs      \\n[#BIB_LEAD]u
14335 .          \}
14336 .          if '\\*[$BIB_STRING_QUAD]'LEFT'   .LEFT
14337 .          if '\\*[$BIB_STRING_QUAD]'C'      .CENTER
14338 .          if '\\*[$BIB_STRING_QUAD]'CENTER' .CENTER
14339 .          if '\\*[$BIB_STRING_QUAD]'CENTRE' .CENTER
14340 .          if '\\*[$BIB_STRING_QUAD]'R'      .RIGHT
14341 .          if '\\*[$BIB_STRING_QUAD]'RIGHT'  .RIGHT
14342 .          EOL
14343 .          if \\n[#BIB_STRING_CAPS] .CAPS
14344 .          ie \\n[#BIB_STRING_UNDERLINE] \{\
14345 .             nr #FROM_BIB_STRING 1
14346 .             ie \\n[#BIB_STRING_UNDERLINE]=2 \
14347 .                UNDERSCORE2 "\\*[$BIB_STRING]"
14348 .             el .UNDERSCORE "\\*[$BIB_STRING]"
14349 .             rr #FROM_BIB_STRING
14350 .          \}
14351 .          el .PRINT "\\*[$BIB_STRING]"
14352 .       \}
14353 .       CAPS OFF
14354 .       FAMILY \\*[$BIB_FAMILY]
14355 .       FT \\*[$BIB_FT]
14356 .       ps -\\*[$BIB_STRING_SIZE_CHANGE]
14357 .       if \\n[#PRINT_STYLE]=1 \{\
14358 .          ie \\n[#SINGLE_SPACE]=1 .ALD \\n[#BIB_LEAD]*3u
14359 .          el \{\
14360 .             ie \\n[#BIB_SINGLESPACE]=1 .ALD \\n[#BIB_LEAD]u*3u
14361 .             el .ALD \\n[#BIB_LEAD]u
14362 .          \}
14363 .       \}
14364 .       if \\n[#PRINT_STYLE]=2 .ALD \\n[#BIB_LEAD]u*2u
14365 .       QUAD \\*[$BIB_QUAD]
14366 .       if \\n[#PRINT_STYLE]=1 \{\
14367 .          ie \\n[#SINGLE_SPACE]=1 .vs \\n[#BIB_LEAD]u
14368 .          el \{\
14369 .             ie \\n[#BIB_SINGLESPACE]=1 .vs \\n[#BIB_LEAD]u
14370 .             el .vs \\n[#BIB_LEAD]u
14371 .          \}
14372 .       \}
14373 .       if \\n[#PRINT_STYLE]=2 \{\
14374 .          ie \\n[#ADJ_BIB_LEAD] \
14375 .             nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
14376 .          el .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
14377 .          rr #RESTORE_DOC_LEAD
14378 .       \}
14379 .       if \\n[#COLUMNS_WERE_ON] .nr #COLUMNS 1
14380 .       if \\n[#HEADER_STATE]=1 .HEADERS
14381 .       if \\n[#LINENUMBERS]=2 \{\
14382 .          NUMBER_LINES RESUME
14383 .          nr #LINENUMBERS 1
14384 .       \}
14385 .       di BIB
14386 .    \}
14387 .    el \{\
14388 .       br
14389 .       di
14390 .\" Part of workaround for refer spitting out a blank page if the
14391 .\" last ref falls on the bottom line.
14392 .       nr num*refs \\n[ref*num*first-pass]
14393 .       nf
14394 .       chop BIB
14395 .       BIB
14396 .    \}
14397 .END
14398 \#
14399 \# ====================================================================
14400 \#
14401 \# +++TABLE OF CONTENTS+++
14402 \#
14403 \# Strings to allocate space for leaders and entry page numbers
14404 \#
14405 .ds $TOC_PN \\*[ST102]\F[\\*[$TOC_PN_FAM]]\f[\\*[$TOC_PN_FT]]\
14406 \s[\\n[#TOC_PS]u]^\\*[ST102X]\\*[ST103]\s[\\*[$TOC_PN_SIZE_CHANGE]]\
14407 \|\|\|\h'\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST103X]
14408 \#
14409 .ds $TOC_PN_TYPEWRITE \\*[ST102]^\\*[ST102X]\\*[ST103]\
14410 \h'\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST103X]
14411 \#
14412 \# TOC collector
14413 \#
14414 .MAC TO_TOC END
14415 .    if !'\\n[.ev]'TOC_EV' .ev TOC_EV
14416 .    nr #TOC_CH_NUM_INDENT \w'\\*[$TOC_CH_NUM]'
14417 .    da TOC_ENTRIES
14418 \!.  ie \\\\n[#SKIP_ENTRY]=1 \{\
14419 .     rr #SKIP_ENTRY
14420 \!.  \}
14421 \!.  el \{\
14422 .       br
14423 .       ie \\n[#PRINT_STYLE]=1 \{\
14424 \!.        fam \\*[$TYPEWRITER_FAM]
14425 \!.        ft  R
14426 \!.        ps \\*[$TYPEWRITER_PS]
14427 .          ds _TYPEWRITE _TYPEWRITE
14428 .       \}
14429 .       el \{\
14430 .          ie '\\$0'HD_TO_TOC' \{\
14431 \!.           ps \\n[#TOC_PS]u\\*[$TOC_HEAD_\\n[#LEVEL]_SIZE]
14432 .          \}
14433 .          el \{\
14434 \!.           FAMILY  \\*[$TOC_TITLE_FAM]
14435 \!.           FT      \\*[$TOC_TITLE_FT]
14436 \!.           ps \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE]
14437 .          \}
14438 .       \}
14439 .       if \\n[#PRINT_STYLE]=2 \{\
14440 .          rm _TYPEWRITE
14441 .          if \\n[#SPACE_TOC_ITEMS] \{\
14442 .             if \\n[#POST_TOP]=1 \{\
14443 .                ie !\\n[#LEVEL]=\\n[#LAST_LEVEL] \{\
14444 .                   ie \\n[#LEVEL]>\\n[#LAST_LEVEL] \!.sp .2v
14445 .                   el \!.sp .4v
14446 .                \}
14447 .                el \{\
14448 .                   if \\n[#COLLATED_DOC] \
14449 .                      if '\\$0'TITLE_TO_TOC' \!.sp .4v
14450 .                \}
14451 .             \}
14452 .          \}
14453 .       \}
14454 \!.     PAD_MARKER ^
14455 .       if !'\\$0'HD_TO_TOC' \{\
14456 \!.        if \\n[#TOC_TITLE_CAPS]=1 .CAPS
14457 .       \}
14458 .       if '\\$0'HD_TO_TOC' \{\
14459 .          nr #POST_TOP 1
14460 \!.        if \\n[#TOC_HEAD_\\n[#LEVEL]_CAPS]=1 .CAPS
14461 .       \}
14462 \!.     vpt 0
14463 .       ie '\\$0'HD_TO_TOC' \{\
14464 \!.        PAD \
14465 "\\f[\\*[$TOC_HEAD_\\n[#LEVEL]_FAM]\
14466 \\*[$TOC_HEAD_\\n[#LEVEL]_FT]]\
14467 \h'\\\\n[#TOC_INDENT_ADJ]u'\h'\\n[#TOC_HEAD_\\n[#LEVEL]_INDENT]u'\
14468 \\*[$TOC_HD_NUM]\\*[$TOC_HEAD_\\n[#LEVEL]_ITEM]\\*[$TOC_PN\\*[_TYPEWRITE]]" \
14469 "\\*[PDFBOOKMARK.NAME]"
14470 .       \}
14471 .       el \{\
14472 \!.        PAD \
14473 "\\f[\\*[$TOC_TITLE_FAM]\\*[$TOC_TITLE_FT]]\
14474 \h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN\\*[_TYPEWRITE]]" \
14475 "\\*[PDFBOOKMARK.NAME]"
14476 .       \}
14477 .       if '\\$0'HD_TO_TOC' \{\
14478 \!.        if \\n[#TOC_HEAD_\\n[#LEVEL]_CAPS]=1 .CAPS OFF
14479 .       \}
14480 .       if !'\\$0'HD_TO_TOC' \{\
14481 \!.        if \\n[#TOC_TITLE_CAPS]=1 .CAPS OFF
14482 .       \}
14483 \!.     PAD_MARKER #
14484 \!.     EOL
14485 \!.     ST 102 L
14486 \!.     ST 103 R
14487 .       if \\n[#PRINT_STYLE]=2 \{\
14488 \!.        FAMILY  \\*[$TOC_PN_FAM]
14489 \!.        FT      \\*[$TOC_PN_FT]
14490 \!.        ps \\n[#TOC_PS]u
14491 .       \}
14492 \!.     TAB 102
14493 \!.     PRINT \\*[LEADER]
14494 \!.     TN
14495 .       if \\n[#PRINT_STYLE]=2 \{\
14496 \!.        ps \\*[$TOC_PN_SIZE_CHANGE]u
14497 .       \}
14498 \!.     PRINT \\n[#TOC_ENTRY_PN]
14499 \!.     TQ
14500 \!.     vpt
14501 \!. \}
14502 .   da
14503 .   ev
14504 .END
14505 \#
14506 .ALIAS HD_TO_TOC  TO_TOC
14507 .ALIAS TITLE_TO_TOC TO_TOC
14508 \#
14509 \# Control macros for toc
14510 \# ----------------------
14511 \#
14512 \# TOC TITLE STYLE
14513 \# ---------------
14514 \# *Arguments:
14515 \#   FAMILY <family>
14516 \#   FONT   <font>
14517 \#   SIZE   <+|-n>
14518 \#   COLOR  <color>
14519 \#   CAPS
14520 \#   INDENT
14521 \# *Function:
14522 \#   Assigns complete style parameters to TITLEs (doc titles,
14523 \#   chapter titles, etc) in the TOC.
14524 \# *Notes:
14525 \#   TITLEs are not headings, therefore they require their own style
14526 \#   macro.  Otherwise, the same as TOC_ENTRY_STYLE.
14527 \#
14528 .MAC TOC_TITLE_STYLE END
14529 .    nr #ARG_NUM 0 1
14530 .    nr #ATTRIB \\n[#NUM_ARGS]
14531 .    while \\n+[#ARG_NUM]<=\\n[#ATTRIB] \{\
14532 .       if '\\$1'FAMILY' \{\
14533 .          shift
14534 .          ds $TOC_TITLE_FAM  \\$1
14535 .          shift
14536 .       \}
14537 .       if '\\$1'FONT' \{\
14538 .          shift
14539 .          ds $TOC_TITLE_FT   \\$1
14540 .          shift
14541 .       \}
14542 .       if '\\$1'SIZE' \{\
14543 .          shift
14544 .          ds $TOC_TITLE_SIZE \\$1
14545 .          shift
14546 .       \}
14547 .       if '\\$1'CAPS' \{\
14548 .          nr #TOC_TITLE_CAPS 1
14549 .          shift
14550 .       \}
14551 .       if '\\$1'NO_CAPS' \{\
14552 .          rr #TOC_TITLE_CAPS
14553 .          shift
14554 .       \}
14555 .       if '\\$1'INDENT' \{\
14556 .          shift
14557 .          nr #TOC_TITLE_INDENT \\$1
14558 .          shift
14559 .       \}
14560 .    \}
14561 .END
14562 \#
14563 \# TOC HEADER STRING
14564 \# -----------------
14565 \# *Argument:
14566 \#   <string for "doc header" of first toc page>
14567 \# *Function:
14568 \#   Creates or modifies string $TOC_HEADER_STRING
14569 \# *Notes:
14570 \#   Default is "Contents".
14571 \#
14572 .MAC TOC_HEADER_STRING END
14573 .    ds $TOC_HEADER_STRING \\$1
14574 .END
14575 \#
14576 \# TOC POINT SIZE
14577 \# --------------
14578 \# *Argument:
14579 \#   <base point size for toc pages>
14580 \# *Function:
14581 \#   Creates or modifies register #TOC_PS.
14582 \# *Notes:
14583 \#   This size control macro differs from other size control macros
14584 \#   in that it sets an absolute point size, not a relative one.
14585 \#   See notes for ENDNOTE_PT_SIZE for explanation.
14586 \#
14587 \#   No unit of measure required (points assumed).  Default is 12.5
14588 \#   for TYPESET.
14589 \#
14590 .MAC TOC_PT_SIZE END
14591 .    nr #TOC_PS (p;\\$1)
14592 .END
14593 \#
14594 \# TOC ENTRIES PAGE NUMBERS PADDING
14595 \# --------------------------------
14596 \# *Argument:
14597 \#   <number of placeholders for toc entries page numbers>
14598 \# *Function:
14599 \#   Creates or modifies register #TOC_PN_PADDING.
14600 \# *Notes:
14601 \#   "Placeholders" is the maximum number of digits in a page
14602 \#   number numeral.
14603 \#
14604 \#   Default is 3.
14605 \#
14606 .MAC TOC_PADDING END
14607 .    nr #TOC_PN_PADDING \\$1
14608 .END
14609 \#
14610 \# PAGINATE TOC
14611 \# ------------
14612 \# *Argument:
14613 \#   <none> | <anything>
14614 \# *Function:
14615 \#   Creates or removes register #PAGINATE_TOC.
14616 \# *Notes:
14617 \#   Default is to paginate toc.
14618 \#
14619 .MAC PAGINATE_TOC END
14620 .    ie '\\$1'' .nr #PAGINATE_TOC 1
14621 .    el .nr #PAGINATE_TOC 0
14622 .END
14623 \#
14624 .MAC TOC_FIRST_PAGENUM END
14625 .    nr #TOC_START_PAGENUM \\$1
14626 .END
14627 \#
14628 \# TOC PAGES PAGE-NUMBERING STYLE
14629 \# ------------------------------
14630 \# *Argument:
14631 \#   DIGIT | ROMAN | roman | ALPHA | alpha
14632 \# *Function:
14633 \#   Creates or modifies string $TOC_PN_STYLE
14634 \# *Notes:
14635 \#   Page numbering style for page numbers that appear in the
14636 \#   headers/footers of toc pages.  See notes for PAGENUM_STYLE.
14637 \#
14638 \#   Default is roman.
14639 \#
14640 .MAC TOC_PAGENUM_STYLE END
14641 .    ds $TOC_PN_STYLE \\$1
14642 .END
14643 \#
14644 \# TOC RECTO_VERSO SWITCH
14645 \# ----------------------
14646 \# *Argument:
14647 \#   <none> | <anything>
14648 \# *Function:
14649 \#   Creates or removes register #TOC_RV_SWITCH
14650 \# *Notes:
14651 \#   Allows switching of L/R margins if a doc is recto/verso and
14652 \#   the first toc page happens to fall the wrong way
14653 \#
14654 .MAC TOC_RV_SWITCH END
14655 .    ie '\\$1'' .nr #TOC_RV_SWITCH 1
14656 .    el .rr #TOC_RV_SWITCH
14657 .END
14658 \#
14659 \# TOC ENTRY SPACING
14660 \# -----------------
14661 \# *Arguments:
14662 \#   <none> | <anything>
14663 \# *Function:
14664 \#   Toggles whether a small amount of space is inserted between TOC
14665 \#   entries for greater legibility.
14666 \#
14667 .MAC SPACE_TOC_ITEMS END
14668 .    ie !'\\$1'' .rr #SPACE_TOC_ITEMS
14669 .    el .nr #SPACE_TOC_ITEMS 1
14670 .END
14671 \#
14672 \# NUMBERING OF TOC ENTRIES
14673 \# ------------------------
14674 \# *Arguments:
14675 \#   FULL | TRUNCATE | NONE
14676 \# *Function:
14677 \#   Determines how, or whether, to prepend heading numbers to TOC
14678 \#   entries.
14679 \# *Notes:
14680 \#   FULL means the complete numbering string (default).
14681 \#
14682 \#   TRUNCATE means prepend a single digit sufficient to identify
14683 \#   an entry's place in the numbering scheme with reference to the
14684 \#   level above it.  Thus, if a HEADING 1 is the second HEADING 1
14685 \#   and therefore numbered "2.", a HEADING 2 beneath it (in the TOC)
14686 \#   will have only "1." prepended to the entry; TOC indenting makes it
14687 \#   evident under which level the HEADING 2 belongs.
14688 \#
14689 \#   Note that TRUNCATE also removes chapter numbers, if
14690 \#   PREFIX_CHAPTER_NUMBER is on.
14691 \#
14692 .MAC TOC_ENTRY_NUMBERS END
14693 .    if '\\$1'TRUNCATE' .nr #TRUNC_TOC_HD_NUM 1
14694 .    if '\\$1'FULL'     .nr #TRUNC_TOC_HD_NUM 0
14695 .    if '\\$1'NONE'     .nr #TOC_NO_HD_NUM 1
14696 .END
14697 \#
14698 \# User defined TITLE entry string
14699 \#
14700 .MAC TOC_TITLE_ENTRY END
14701 .    nr #USER_SET_TITLE_ITEM 1
14702 .    ds $USER_SET_TITLE_ITEM \\$1
14703 .END
14704 \#
14705 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
14706 \# -----------------------------------------
14707 \# *Argument:
14708 \#   <none> | <name(s) of author(s) as they should appear in toc doc title entries>
14709 \# *Function:
14710 \#   Creates register #TOC_AUTHORS (to tell TOC to append authors
14711 \#   to toc doc title entries).  Optionally creates string
14712 \#   $TOC_AUTHORS.
14713 \# *Notes:
14714 \#   Normally, TOC does not append the author(s) to a toc doc title
14715 \#   entry.  This special macro instructs TOC to do so.
14716 \#
14717 \#   If user has multiple authors for each doc when collating,
14718 \#   TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
14719 \#   COLLATE and START in each doc.  Otherwise, mom prints only the
14720 \#   first author given to AUTHOR.
14721 \#
14722 .MAC TOC_APPENDS_AUTHOR END
14723 .    nr #TOC_AUTHORS 1
14724 .    if !'\\$1'' .ds $TOC_AUTHORS \\$1
14725 .END
14726 \#
14727 \# TABLE OF CONTENTS
14728 \# -----------------
14729 \# *Arguments:
14730 \#   none
14731 \# *Function:
14732 \#   Takes care of the administrivia of setting up the TOC as if
14733 \#   it's a collated doc, then outputs the formatted TOC_ENTRIES
14734 \#   diversion.
14735 \#
14736 .MAC TOC END
14737 .    char \[leader] " .
14738 .    LEADER_CHARACTER \[leader]
14739 .    ie \\n[#COLLATED_DOC] \{\
14740 .       nr #TOC_INDENT_ADJ 1.5m
14741 .       if \\n[#PREFIX_CH_NUM] .nr #TOC_INDENT_ADJ \\n[#TOC_CH_NUM_INDENT]
14742 .    \}
14743 .    el \{\
14744 .       nr #SKIP_ENTRY 1
14745 .       nr #TOC_INDENT_ADJ 0
14746 .    \}
14747 .    nr #TOC 1
14748 .    nr TOC.RELOCATE 0
14749 .    if \\n[#LINENUMBERS]=1 \{\
14750 .       NUMBER_LINES OFF
14751 .       nr #LINENUMBERS 2
14752 .    \}
14753 .    if !r #PAGINATE_TOC .PAGINATE_TOC
14754 .    nr #TOC_FIRST_PAGE 1
14755 .    if \\n[#FINIS] \{\
14756 .       if \\n[#FOOTERS_WERE_ON] \
14757 .          FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
14758 .    \}
14759 .    if \\n[#FOOTERS_ON]=1 \{\
14760 .       if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
14761 .       ie \\n[#PAGINATE_TOC]=1 .PAGINATE
14762 .       el .PAGINATION OFF
14763 .    \}
14764 .    if \\n[#FOOTERS_WERE_ON] .FOOTERS OFF  \" But have to turn FOOTERS off again so they don't print when FINIS was called
14765 .    rr #COLUMNS
14766 .    COLLATE
14767 .    if \\n[#PRINT_STYLE]=1 \{\
14768 .       if \\n[#SINGLE_SPACE] .vs 24
14769 .       DOC_LEAD_ADJUST
14770 .    \}
14771 .    if \\n[#PRINT_STYLE]=2 .vs \\n[#TOC_LEAD]u
14772 .    if \\n[#FINIS] \{\
14773 .       if \\n[#FOOTERS_WERE_ON] .FOOTERS  \" Finally, turn footers on if they were on
14774 .       rr #FOOTERS_WERE_ON
14775 .       if \\n[#PAGINATION_WAS_ON] \{\
14776 .          nr #PAGINATE 1
14777 .          rr #PAGINATION_WAS_ON
14778 .       \}
14779 .       rr #FINIS
14780 .    \}
14781 .    ie \\n[#PAGINATE_TOC]=1 .PAGINATE
14782 .    el .PAGINATION OFF
14783 .    ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
14784 .    rm $HDRFTR_CENTER_OLD
14785 .    rm $HDRFTR_CENTER_NEW
14786 .    rr #COLLATED_DOC
14787 .    DOCHEADER OFF \\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
14788 .    if !r #TOC_START_PAGENUM .nr #TOC_START_PAGENUM 1
14789 .       PAGENUMBER \\n[#TOC_START_PAGENUM]
14790 .    if \\n[#LINENUMBERS]=2 .nr #LINENUMBERS 3
14791 .    L_MARGIN   \\n[#DOC_L_MARGIN]u
14792 .    LL         \\n[#DOC_L_LENGTH]u
14793 .    HEADER_CENTER "\\*[$TOC_HEADER_STRING]
14794 .    if \\n[#SLANT_ON] .nop \\*[SLANTX]
14795 .    START
14796 .    PAGENUM_STYLE \\*[$TOC_PN_STYLE]
14797 .    PDF_BOOKMARK 1 \\*[$TOC_HEADER_STRING]
14798 .    if \\n[#PRINT_STYLE]=1 .TYPEWRITER
14799 .    if \\n[#PRINT_STYLE]=2 \{\
14800 .       FAMILY  \\*[$TOC_HEADER_FAM]
14801 .       FT      \\*[$TOC_HEADER_FT]
14802 .       ps \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
14803 .    \}
14804 .    ie \\n[#PRINT_STYLE]=1 \{\
14805 .       CAPS
14806 .       UNDERSCORE 3p "\\*[$TOC_HEADER_STRING]"
14807 .       CAPS      OFF
14808 .    \}
14809 .    el .PRINT \\*[$TOC_HEADER_STRING]
14810 .    sp
14811 .    nf
14812 .    TOC_ENTRIES
14813 .    rr #TOC
14814 .    if \\n[#LINENUMBERS]=3 \{\
14815 .       NUMBER_LINES RESUME
14816 .       nr #LINENUMBERS 1
14817 .       nn 1
14818 .    \}
14819 .    rr #TOC
14820 .    pdfsync
14821 .END
14822 \#
14823 \# ====================================================================
14824 \#
14825 \# +++COLUMNS+++
14826 \#
14827 \# COLUMNS
14828 \# -------
14829 \# *Arguments:
14830 \#   <number of columns>  <width of gutters>
14831 \# *Function:
14832 \#   Creates registers associated with setting docs in columns.
14833 \#   Calculates column line lengths and offsets
14834 \# *Notes:
14835 \#   COLUMNS, if used, s/b the last macro invoked before START.
14836 \#
14837 .MAC COLUMNS END
14838 .    if \\n[#IGNORE_COLUMNS]=1 .return
14839 .    nr #COLUMNS 1
14840 .    nr #NUM_COLS \\$1
14841 .    nr #GUTTER (\\$2)
14842 .    nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
14843 .    nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
14844 .    nr #COL_NUM 0 1
14845 .    while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
14846 .       nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
14847 .       nr #COL_TOTAL \\n+[#COL_TOTAL]
14848 .    \}
14849 .    if \\n[#NUM_COLS]=1 \
14850 .       if !\\n[#COLLATE]=1 .MN_INIT
14851 .    rr #COL_TOTAL
14852 .    rr #COL_NUM
14853 .END
14854 \#
14855 \# MARK COL V-POSITION AFTER DOCHEADER
14856 \# -----------------------------------
14857 \# *Arguments:
14858 \#   none
14859 \# *Function:
14860 \#   Sets 1st page dc register.
14861 \# *Notes:
14862 \#   Only required if manual spacing, positive or negative, precedes
14863 \#   start of columns on first page of doc.
14864 \#
14865 .MAC COL_MARK END
14866 .    mk dc
14867 .END
14868 \#
14869 \# NEXT COLUMN
14870 \# -----------
14871 \# *Arguments:
14872 \#   <none>
14873 \# *Function:
14874 \#   Breaks current column and moves to next column.
14875 \#   If current column is the last on the page, breaks
14876 \#   to a new page.
14877 \#
14878 .MAC COL_NEXT END
14879 .    if \\n[#COLUMNS] \{\
14880 .       nr #COL_NEXT 1
14881 .       ie '\\$0'COL_NEXT' .br
14882 .       el \{\
14883 .          brp
14884 .          RLD 1v
14885 .       \}
14886 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] .bp
14887 .       el .FOOTER
14888 .    \}
14889 .END
14890 \#
14891 \# ====================================================================
14892 \#
14893 \# +++LISTS+++
14894 \#
14895 \# LIST
14896 \# ----
14897 \# *Arguments:
14898 \#   [ BULLET | DASH | DIGIT | alpha | ALPHA | roman | ROMAN | USER ] \
14899 \#   [ <separator> | NONE ] [ <prefix> ] [ <anything> ]
14900 \# *Function:
14901 \#   Stores indent information in effect prior to invocation and
14902 \#   initializes a list with the supplied enumerator (and separator).
14903 \# *Notes:
14904 \#   Default enumerator is a bullet.
14905 \#
14906 \#   Enumerator *must* be supplied for every list that's to the
14907 \#   right of another list, every time, unless the default bullet is
14908 \#   desired.
14909 \#
14910 \#   <anything> moves back one list level intuitively, or exits lists
14911 \#   completely if the level in which it's invoked is the first.
14912 \#
14913 .MAC LIST END
14914 .    ds $1ST_LETTER \\$1
14915 .    if !'\\*[$1ST_LETTER]'' .substring $1ST_LETTER 0 0
14916 .    if '\\*[$1ST_LETTER]'r' .ds $1ST_LETTER R
14917 .    ie '\\*[$1ST_LETTER]'R' \{\
14918 .       ds $LAST_CHAR \\$1
14919 .       substring $LAST_CHAR -1
14920 .       if !\B'\\*[$LAST_CHAR]' \{\
14921 .          if !'\\$1'ROMAN' \{\
14922 .             LIST OFF
14923 .             return
14924 .          \}
14925 .          if !'\\$1'roman' \{\
14926 .             LIST OFF
14927 .             return
14928 .          \}
14929 .          tm1 "[mom]: You must append a number to the \\$1 argument to \\$0.
14930 .          tm1 "       The number should be the total number of items in this list.
14931 .          tm1 "       See the documentation.
14932 .          ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
14933 .       \}
14934 .       ds $ROMAN_WIDTH \\$1
14935 .          substring $ROMAN_WIDTH 1
14936 .       while !\B'\\*[$ROMAN_WIDTH]' \{\
14937 .          substring $ROMAN_WIDTH 1
14938 .       \}
14939 .       length #ROMAN_LENGTH \\*[$ROMAN_WIDTH]
14940 .       ds $LIST_ARG_1 \\$1
14941 .       substring $LIST_ARG_1 0 -(\\n[#ROMAN_LENGTH]+1)
14942 .    \}
14943 .    el .ds $LIST_ARG_1 \\$1
14944 .    if !r#DEPTH \{\
14945 .       nr #STORED_HL_INDENT \\n[#HL_INDENT]
14946 .       nr #STORED_T_INDENT  \\n[#T_INDENT]
14947 .       nr #CURRENT_L_LENGTH \\n[.l]
14948 .       nr #DEPTH 0 1
14949 .       if \\n[#INDENT_ACTIVE]=1 \{\
14950 .          if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
14951 .             nr #STORED_L_INDENT \\n[#L_INDENT]
14952 .             nr #RESTORE_PREV_INDENT 1
14953 .          \}
14954 .          if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
14955 .             nr #STORED_BL_INDENT \\n[#BL_INDENT]
14956 .             nr #STORED_BR_INDENT \\n[#BR_INDENT]
14957 .             IBX
14958 .             nr #ORIG_L_LENGTH \\n[.l]
14959 .             IB
14960 .             nr #RESTORE_PREV_INDENT 2
14961 .          \}
14962 .          if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
14963 .             nr #STORED_R_INDENT \\n[#R_INDENT]
14964 .             IRX
14965 .             nr #ORIG_L_LENGTH \\n[.l]
14966 .             IR
14967 .             nr #RESTORE_PREV_INDENT 3
14968 .             if \\n[#INDENT_LEFT_ACTIVE]=1 .nr #RESTORE_PREV_INDENT 4
14969 .          \}
14970 .       \}
14971 .    \}
14972 .    if \\n[#NUM_ARGS]=0 \{\
14973 .       nr #ARGS_TO_LIST 1 \" So default behaves as if LIST BULLET
14974 .       ds $ENUMERATOR\\n+[#DEPTH] \[bu]
14975 .       ds $ENUMERATOR_TYPE\\n[#DEPTH] other
14976 .       ds $SEPARATOR
14977 .    \}
14978 .    if \\n[#NUM_ARGS]>0 \{\
14979 .       rr #ARGS_TO_LIST \" Clear this before processing arg 1.
14980 .       if '\\*[$LIST_ARG_1]'DASH' \{\
14981 .          nr #ARGS_TO_LIST 1
14982 .          ds $ENUMERATOR\\n+[#DEPTH] \[en]
14983 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] other
14984 .          ds $SEPARATOR\\n[#DEPTH]
14985 .       \}
14986 .       if '\\*[$LIST_ARG_1]'BULLET' \{\
14987 .          nr #ARGS_TO_LIST 1
14988 .          ds $ENUMERATOR\\n+[#DEPTH] \[bu]
14989 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] other
14990 .          ds $SEPARATOR\\n[#DEPTH]
14991 .       \}
14992 .       if '\\*[$LIST_ARG_1]'DIGIT' \{\
14993 .          nr #ARGS_TO_LIST 1
14994 .          nr #ENUMERATOR\\n+[#DEPTH] 0 1
14995 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] register
14996 .          ds $SEPARATOR\\n[#DEPTH] .
14997 .          ds $PREFIX\\n[#DEPTH]
14998 .          if \\n[#NUM_ARGS]>=2 \{\
14999 .             ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15000 .             el .ds $SEPARATOR\\n[#DEPTH] \\$2
15001 .             if \\n[#NUM_ARGS]=3 .ds $PREFIX\\n[#DEPTH] \\$3
15002 .          \}
15003 .       \}
15004 .       if '\\*[$LIST_ARG_1]'alpha' \{\
15005 .          nr #ARGS_TO_LIST 1
15006 .          nr #ENUMERATOR\\n+[#DEPTH] 0 1
15007 .          af #ENUMERATOR\\n[#DEPTH] a
15008 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] register
15009 .          ds $SEPARATOR\\n[#DEPTH] )
15010 .          ds $PREFIX\\n[#DEPTH]
15011 .          if \\n[#NUM_ARGS]>=2 \{\
15012 .             ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15013 .             el .ds $SEPARATOR\\n[#DEPTH] \\$2
15014 .             if \\n[#NUM_ARGS]=3 .ds $PREFIX\\n[#DEPTH] \\$3
15015 .          \}
15016 .       \}
15017 .       if '\\*[$LIST_ARG_1]'ALPHA' \{\
15018 .          nr #ARGS_TO_LIST 1
15019 .          nr #ENUMERATOR\\n+[#DEPTH] 0 1
15020 .          af #ENUMERATOR\\n[#DEPTH] A
15021 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] register
15022 .          ds $SEPARATOR\\n[#DEPTH] )
15023 .          ds $PREFIX\\n[#DEPTH]
15024 .          if \\n[#NUM_ARGS]>=2 \{\
15025 .             ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15026 .             el .ds $SEPARATOR\\n[#DEPTH] \\$2
15027 .             if \\n[#NUM_ARGS]=3 \{\
15028 .                ds $PREFIX\\n[#DEPTH] \\$3
15029 .             \}
15030 .          \}
15031 .       \}
15032 .       if '\\*[$1ST_LETTER]'R' \{\
15033 .          nr #ARGS_TO_LIST 1
15034 .          nr #ENUMERATOR\\n+[#DEPTH] 0 1
15035 .          if '\\*[$LIST_ARG_1]'roman' .af #ENUMERATOR\\n[#DEPTH] i
15036 .          if '\\*[$LIST_ARG_1]'ROMAN' .af #ENUMERATOR\\n[#DEPTH] I
15037 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] roman
15038 .          ds $SEPARATOR\\n[#DEPTH] )
15039 .          ds $PREFIX\\n[#DEPTH]
15040 .          if \\n[#NUM_ARGS]>=2 \{\
15041 .             ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15042 .             el .ds $SEPARATOR\\n[#DEPTH] \\$2
15043 .             if \\n[#NUM_ARGS]=3 .ds $PREFIX\\n[#DEPTH] \\$3
15044 .          \}
15045 .       \}
15046 .       if '\\*[$LIST_ARG_1]'USER' \{\
15047 .          nr #ARGS_TO_LIST 1
15048 .          ds $ENUMERATOR\\n+[#DEPTH] \\$2
15049 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] other
15050 .          ds $SEPARATOR\\n[#DEPTH]
15051 .          ds $PREFIX\\n[#DEPTH]
15052 .       \}
15053 .       if \\n[#NUM_ARGS]=1 \{\
15054 .          if !r#ARGS_TO_LIST \{\
15055 .             ie \\n[#DEPTH]=1 \{\
15056 .                ie \\n[#NEXT_DEPTH_BACK]=0 \{\
15057 .                   SET_LIST_INDENT
15058 .                   if \\n[#QUIT]=1 \{\
15059 .                      QUIT_LISTS
15060 .                      return
15061 .                   \}
15062 .                   return
15063 .                \}
15064 .                el \{\
15065 .                   QUIT_LISTS
15066 .                   return
15067 .                \}
15068 .             \}
15069 .             el \{\
15070 .                SET_LIST_INDENT
15071 .                return
15072 .             \}
15073 .          \}
15074 .       \}
15075 .    \}
15076 .    nr #TOTAL_LISTS \\n[#DEPTH]
15077 .    if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
15078 .       nr #LIST_INDENT\\n[#DEPTH] \
15079 \w'\\*[$PREFIX\\n[#DEPTH]]m\\*[$SEPARATOR\\n[#DEPTH]]\ '
15080 .       if '\\*[$LIST_ARG_1]'ALPHA' nr #LIST_INDENT\\n[#DEPTH] \
15081 \w'\\*[$PREFIX\\n[#DEPTH]]M\\*[$SEPARATOR\\n[#DEPTH]]\ '
15082 .    \}
15083 .    if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \
15084 .       GET_ROMAN_INDENT
15085 .    if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \
15086 .       nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$ENUMERATOR\\n[#DEPTH]]\0'
15087 .    ll \\n[#CURRENT_L_LENGTH]u
15088 .    ie \\n[#DEPTH]=1 \{\
15089 .       ie \\n[#INDENT_ACTIVE]=1 \{\
15090 .          if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
15091 .             nr #L_INDENT \\n[#L_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
15092 .             nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15093 .             nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
15094 .          \}
15095 .          if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
15096 .             nr #L_INDENT \\n[#BL_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
15097 .             nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15098 .             nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
15099 .          \}
15100 .          if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
15101 .             ie \\n[#INDENT_LEFT_ACTIVE]=1 \{\
15102 .             \" Don't do anything; we already have a left indent
15103 .             \}
15104 .             el \{\
15105 .                nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15106 .                nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15107 .             \}
15108 .          \}
15109 .       \}
15110 .       el \{\
15111 .          nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15112 .          nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15113 .       \}
15114 .    \}
15115 .    el \{\
15116 .       nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15117 .       nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15118 .    \}
15119 .END
15120 \#
15121 \# ITEM
15122 \# ----
15123 \# *Arguments:
15124 \#   none
15125 \# *Function:
15126 \#   Prints enumerator for a given list depth and prepares mom to
15127 \#   receive the text of an item.
15128 \#
15129 .MAC ITEM END
15130 .    if !r#DEPTH .return
15131 .    if \\n[#LINENUMBERS]=1 \{\
15132 .       NUMBER_LINES OFF
15133 .       nr #LINENUMBERS 2
15134 .    \}
15135 .    if \\n[#KERN]=1 \{\
15136 .       nr #KERN_WAS_ON 1
15137 .       KERN OFF
15138 .    \}
15139 .    rr #IN_ITEM
15140 .    IL
15141 .    nr #IN_ITEM 1
15142 .    ll \\n[#CURRENT_L_LENGTH]u \" Set ll again because IL turns IB off.
15143 .    TRAP OFF
15144 .    HI \\n[#HL_INDENT\\n[#DEPTH]]u
15145 .    if '\\*[$SEPARATOR\\n[#DEPTH]]')' .nr #SEP_TYPE 1
15146 .    if '\\*[$SEPARATOR\\n[#DEPTH]]']' .nr #SEP_TYPE 1
15147 .    if '\\*[$SEPARATOR\\n[#DEPTH]]'}' .nr #SEP_TYPE 1
15148 .    ie \\n[#IN_BIB_LIST]=1 \{\
15149 .       ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
15150 .          ie \\n[#SEP_TYPE]=1 .PRINT \
15151 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\
15152 \\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15153 .          el .PRINT \
15154 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15155 .       \}
15156 .       el \{\
15157 .          ie \\n[#SEP_TYPE]=1 .PRINT \
15158 \h'-\w'\0'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\
15159 \\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15160 .          el .PRINT \
15161 \h'-\w'\0'u'\
15162 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15163 .       \}
15164 .    \}
15165 .    el \{\
15166 .       ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
15167 .\" DIGIT
15168 .          ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
15169 .             ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
15170 .                ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
15171 .                   ie \\n[#SEP_TYPE]=1 .PRINT \
15172 \0\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
15173 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15174 .                   el .PRINT \
15175 \0\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15176 .                \}
15177 .                el \{\
15178 .                   ie \\n[#SEP_TYPE]=1 .PRINT \
15179 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
15180 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15181 .                   el .PRINT \
15182 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15183 .                \}
15184 .             \}
15185 .             el \{\
15186 .                ie \\n[#SEP_TYPE]=1 .PRINT \
15187 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
15188 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15189 .                el .PRINT \
15190 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15191 .             \}
15192 .          \}
15193 .          el \{\
15194 .\" ALPHA
15195 .             ie '\\g[#ENUMERATOR\\n[#DEPTH]]'A' \{\
15196 .                ie \\n[#SEP_TYPE]=1 .PRINT \
15197 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
15198 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15199 .                el .PRINT \
15200 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15201 .             \}
15202 .\" alpha
15203 .             el .PRINT \
15204 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15205 .          \}
15206 .       \}
15207 .       if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
15208 .          ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
15209 .\" ROMAN I, padded
15210 .             ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
15211 .                ie \\n[#SEP_TYPE]=1 .PRINT \
15212 \h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\
15213 \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\0'u'\
15214 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n[#ENUMERATOR\\n[#DEPTH]]\
15215 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15216 .                el .PRINT \
15217 \h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\
15218 \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\
15219 \0'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\
15220 \\*[$SEPARATOR\\n[#DEPTH]]
15221 .             \}
15222 .\" roman i, padded
15223 .             el .PRINT \
15224 \h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\
15225 \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\0'u'\
15226 \\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15227 .          \}
15228 .\" No pad
15229 .          el \{\
15230 .\" ROMAN I, no pad
15231 .             ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
15232 .                ie \\n[#SEP_TYPE]=1 .PRINT \
15233 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
15234 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15235 .                el .PRINT \
15236 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15237 .             \}
15238 .\" roman i, no pad
15239 .             el .PRINT \
15240 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15241 .          \}
15242 .       \}
15243 .       if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \
15244 .          PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15245 .    \}
15246 .    rr #SEP_TYPE
15247 .    EOL
15248 .    if \\n[#REF]=1 \{\
15249 .       IL +\\n[#REF_BIB_INDENT]u
15250 .       ti \\n[#L_INDENT]u-\\n[#REF_BIB_INDENT]u
15251 .    \}
15252 .    TRAP
15253 .    if \\n[#KERN_WAS_ON]=1 \{\
15254 .       KERN
15255 .       rr #KERN_WAS_ON
15256 .    \}
15257 .    if \\n[#LINENUMBERS]=2 \{\
15258 .       NUMBER_LINES RESUME
15259 .       nr #LINENUMBERS 1
15260 .    \}
15261 .END
15262 \#
15263 \# A utility macro that determines the space to reserve for
15264 \# roman numeral enumerated lists.  Limit is 20 roman numerals
15265 \# per list.  If this isn't enough, the user can add to the
15266 \# macro.
15267 \#
15268 .MAC GET_ROMAN_INDENT END
15269 .    if '\\*[$LIST_ARG_1]'roman' \{\
15270 .       if '\\*[$ROMAN_WIDTH]'1' \{\
15271 .          ds $ROMAN_WIDTH\\n[#DEPTH] 1
15272 .          nr #LIST_INDENT\\n[#DEPTH] \
15273 \w'\\*[$PREFIX\\n[#DEPTH]]i\\*[$SEPARATOR\\n[#DEPTH]]\0'
15274 .       \}
15275 .       if '\\*[$ROMAN_WIDTH]'2' \{\
15276 .          ds $ROMAN_WIDTH\\n[#DEPTH] 2
15277 .          nr #LIST_INDENT\\n[#DEPTH] \
15278 \w'\\*[$PREFIX\\n[#DEPTH]]ii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15279 .       \}
15280 .       if '\\*[$ROMAN_WIDTH]'3' \{\
15281 .          ds $ROMAN_WIDTH\\n[#DEPTH] 3
15282 .          nr #LIST_INDENT\\n[#DEPTH] \
15283 \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15284 .       \}
15285 .       if '\\*[$ROMAN_WIDTH]'4' \{\
15286 .          ds $ROMAN_WIDTH\\n[#DEPTH] 4
15287 .          nr #LIST_INDENT\\n[#DEPTH] \
15288 \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15289 .       \}
15290 .       if '\\*[$ROMAN_WIDTH]'5' \{\
15291 .          ds $ROMAN_WIDTH\\n[#DEPTH] 5
15292 .          nr #LIST_INDENT\\n[#DEPTH] \
15293 \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15294 .       \}
15295 .       if '\\*[$ROMAN_WIDTH]'6' \{\
15296 .          ds $ROMAN_WIDTH\\n[#DEPTH] 6
15297 .          nr #LIST_INDENT\\n[#DEPTH] \
15298 \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15299 .       \}
15300 .       if '\\*[$ROMAN_WIDTH]'7' \{\
15301 .          ds $ROMAN_WIDTH\\n[#DEPTH] 7
15302 .          nr #LIST_INDENT\\n[#DEPTH] \
15303 \w'\\*[$PREFIX\\n[#DEPTH]]vii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15304 .       \}
15305 .       if '\\*[$ROMAN_WIDTH]'8' \{\
15306 .          ds $ROMAN_WIDTH\\n[#DEPTH] 8
15307 .          nr #LIST_INDENT\\n[#DEPTH] \
15308 \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15309 .       \}
15310 .       if '\\*[$ROMAN_WIDTH]'9' \{\
15311 .          ds $ROMAN_WIDTH\\n[#DEPTH] 9
15312 .          nr #LIST_INDENT\\n[#DEPTH] \
15313 \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15314 .       \}
15315 .       if '\\*[$ROMAN_WIDTH]'10' \{\
15316 .          ds $ROMAN_WIDTH\\n[#DEPTH] 10
15317 .          nr #LIST_INDENT\\n[#DEPTH] \
15318 \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15319 .       \}
15320 .       if '\\*[$ROMAN_WIDTH]'11' \{\
15321 .          ds $ROMAN_WIDTH\\n[#DEPTH] 11
15322 .          nr #LIST_INDENT\\n[#DEPTH] \
15323 \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15324 .       \}
15325 .       if '\\*[$ROMAN_WIDTH]'12' \{\
15326 .          ds $ROMAN_WIDTH\\n[#DEPTH] 12
15327 .          nr #LIST_INDENT\\n[#DEPTH] \
15328 \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15329 .       \}
15330 .       if '\\*[$ROMAN_WIDTH]'13' \{\
15331 .          ds $ROMAN_WIDTH\\n[#DEPTH] 13
15332 .          nr #LIST_INDENT\\n[#DEPTH] \
15333 \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15334 .       \}
15335 .       if '\\*[$ROMAN_WIDTH]'14' \{\
15336 .          ds $ROMAN_WIDTH\\n[#DEPTH] 14
15337 .          nr #LIST_INDENT\\n[#DEPTH] \
15338 \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15339 .       \}
15340 .       if '\\*[$ROMAN_WIDTH]'15' \{\
15341 .          ds $ROMAN_WIDTH\\n[#DEPTH] 15
15342 .          nr #LIST_INDENT\\n[#DEPTH] \
15343 \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15344 .       \}
15345 .       if '\\*[$ROMAN_WIDTH]'16' \{\
15346 .          ds $ROMAN_WIDTH\\n[#DEPTH] 16
15347 .          nr #LIST_INDENT\\n[#DEPTH] \
15348 \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15349 .       \}
15350 .       if '\\*[$ROMAN_WIDTH]'17' \{\
15351 .          ds $ROMAN_WIDTH\\n[#DEPTH] 17
15352 .          nr #LIST_INDENT\\n[#DEPTH] \
15353 \w'\\*[$PREFIX\\n[#DEPTH]]xvii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15354 .       \}
15355 .       if '\\*[$ROMAN_WIDTH]'18' \{\
15356 .          ds $ROMAN_WIDTH\\n[#DEPTH] 18
15357 .          nr #LIST_INDENT\\n[#DEPTH] \
15358 \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15359 .       \}
15360 .       if '\\*[$ROMAN_WIDTH]'19' \{\
15361 .          ds $ROMAN_WIDTH\\n[#DEPTH] 19
15362 .          nr #LIST_INDENT\\n[#DEPTH] \
15363 \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15364 .       \}
15365 .       if '\\*[$ROMAN_WIDTH]'20' \{\
15366 .          ds $ROMAN_WIDTH\\n[#DEPTH] 20
15367 .          nr #LIST_INDENT\\n[#DEPTH] \
15368 \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15369 .       \}
15370 .    \}
15371 .    if '\\*[$LIST_ARG_1]'ROMAN' \{\
15372 .       if '\\*[$ROMAN_WIDTH]'1' \{\
15373 .          ds $ROMAN_WIDTH\\n[#DEPTH] 1
15374 .          nr #LIST_INDENT\\n[#DEPTH] \
15375 \w'\\*[$PREFIX\\n[#DEPTH]]I\\*[$SEPARATOR\\n[#DEPTH]]\0'
15376 .       \}
15377 .       if '\\*[$ROMAN_WIDTH]'2' \{\
15378 .          ds $ROMAN_WIDTH\\n[#DEPTH] 2
15379 .          nr #LIST_INDENT\\n[#DEPTH] \
15380 \w'\\*[$PREFIX\\n[#DEPTH]]II\\*[$SEPARATOR\\n[#DEPTH]]\0'
15381 .       \}
15382 .       if '\\*[$ROMAN_WIDTH]'3' \{\
15383 .          ds $ROMAN_WIDTH\\n[#DEPTH] 3
15384 .          nr #LIST_INDENT\\n[#DEPTH] \
15385 \w'\\*[$PREFIX\\n[#DEPTH]]III\\*[$SEPARATOR\\n[#DEPTH]]\0'
15386 .       \}
15387 .       if '\\*[$ROMAN_WIDTH]'4' \{\
15388 .          ds $ROMAN_WIDTH\\n[#DEPTH] 4
15389 .          nr #LIST_INDENT\\n[#DEPTH] \
15390 \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15391 .       \}
15392 .       if '\\*[$ROMAN_WIDTH]'5' \{\
15393 .          ds $ROMAN_WIDTH\\n[#DEPTH] 5
15394 .          nr #LIST_INDENT\\n[#DEPTH] \
15395 \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15396 .       \}
15397 .       if '\\*[$ROMAN_WIDTH]'6' \{\
15398 .          ds $ROMAN_WIDTH\\n[#DEPTH] 6
15399 .          nr #LIST_INDENT\\n[#DEPTH] \
15400 \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15401 .       \}
15402 .       if '\\*[$ROMAN_WIDTH]'7' \{\
15403 .          ds $ROMAN_WIDTH\\n[#DEPTH] 7
15404 .          nr #LIST_INDENT\\n[#DEPTH] \
15405 \w'\\*[$PREFIX\\n[#DEPTH]]VII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15406 .       \}
15407 .       if '\\*[$ROMAN_WIDTH]'8' \{\
15408 .          ds $ROMAN_WIDTH\\n[#DEPTH] 8
15409 .          nr #LIST_INDENT\\n[#DEPTH] \
15410 \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15411 .       \}
15412 .       if '\\*[$ROMAN_WIDTH]'9' \{\
15413 .          ds $ROMAN_WIDTH\\n[#DEPTH] 9
15414 .          nr #LIST_INDENT\\n[#DEPTH] \
15415 \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15416 .       \}
15417 .       if '\\*[$ROMAN_WIDTH]'10' \{\
15418 .          ds $ROMAN_WIDTH\\n[#DEPTH] 10
15419 .          nr #LIST_INDENT\\n[#DEPTH] \
15420 \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15421 .       \}
15422 .       if '\\*[$ROMAN_WIDTH]'11' \{\
15423 .          ds $ROMAN_WIDTH\\n[#DEPTH] 11
15424 .          nr #LIST_INDENT\\n[#DEPTH] \
15425 \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15426 .       \}
15427 .       if '\\*[$ROMAN_WIDTH]'12' \{\
15428 .          ds $ROMAN_WIDTH\\n[#DEPTH] 12
15429 .          nr #LIST_INDENT\\n[#DEPTH] \
15430 \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15431 .       \}
15432 .       if '\\*[$ROMAN_WIDTH]'13' \{\
15433 .          ds $ROMAN_WIDTH\\n[#DEPTH] 13
15434 .          nr #LIST_INDENT\\n[#DEPTH] \
15435 \w'\\*[$PREFIX\\n[#DEPTH]]XIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15436 .       \}
15437 .       if '\\*[$ROMAN_WIDTH]'14' \{\
15438 .          ds $ROMAN_WIDTH\\n[#DEPTH] 14
15439 .          nr #LIST_INDENT\\n[#DEPTH] \
15440 \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15441 .       \}
15442 .       if '\\*[$ROMAN_WIDTH]'15' \{\
15443 .          ds $ROMAN_WIDTH\\n[#DEPTH] 15
15444 .          nr #LIST_INDENT\\n[#DEPTH] \
15445 \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15446 .       \}
15447 .       if '\\*[$ROMAN_WIDTH]'16' \{\
15448 .          ds $ROMAN_WIDTH\\n[#DEPTH] 16
15449 .          nr #LIST_INDENT\\n[#DEPTH] \
15450 \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15451 .       \}
15452 .       if '\\*[$ROMAN_WIDTH]'17' \{\
15453 .          ds $ROMAN_WIDTH\\n[#DEPTH] 17
15454 .          nr #LIST_INDENT\\n[#DEPTH] \
15455 \w'\\*[$PREFIX\\n[#DEPTH]]XVII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15456 .       \}
15457 .       if '\\*[$ROMAN_WIDTH]'18' \{\
15458 .          ds $ROMAN_WIDTH\\n[#DEPTH] 18
15459 .          nr #LIST_INDENT\\n[#DEPTH] \
15460 \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15461 .       \}
15462 .       if '\\*[$ROMAN_WIDTH]'19' \{\
15463 .          ds $ROMAN_WIDTH\\n[#DEPTH] 19
15464 .          nr #LIST_INDENT\\n[#DEPTH] \
15465 \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15466 .       \}
15467 .       if '\\*[$ROMAN_WIDTH]'20' \{\
15468 .          ds $ROMAN_WIDTH\\n[#DEPTH] 20
15469 .          nr #LIST_INDENT\\n[#DEPTH] \
15470 \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15471 .       \}
15472 .    \}
15473 .END
15474 \#
15475 \# SHIFT LIST
15476 \# ----------
15477 \# *Arguments:
15478 \#   <amount by which to indent a list to the right>
15479 \# *Function:
15480 \#   Adds the value of the arg to the current list's indent.
15481 \# *Notes:
15482 \#   Requires a unit of measure.
15483 \#
15484 .MAC SHIFT_LIST END
15485 .    nr #SHIFT_LIST\\n[#DEPTH] (\\$1)
15486 .    nr #L_INDENT +\\n[#SHIFT_LIST\\n[#DEPTH]]
15487 .END
15488 \#
15489 \# PAD LIST DIGITS
15490 \# ---------------
15491 \# *Arguments:
15492 \#   [ LEFT ]
15493 \# *Function:
15494 \#   Adds a figure space to a list's hanging and left indent.  If
15495 \#   LEFT is given, sets reg. #PAD_LIST_DIGITS to 1 for use in ITEM.
15496 \#
15497 .MAC PAD_LIST_DIGITS END
15498 .    if '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
15499 .       nr #LIST_INDENT\\n[#DEPTH] +\\w'\\0'
15500 .       nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#LIST_INDENT\\n-[#DEPTH]]
15501 .       nr #HL_INDENT\\n+[#DEPTH] +\\w'\\n[#ENUMERATOR\\n[#DEPTH]]'
15502 .       if '\\$1'LEFT' .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1
15503 .    \}
15504 .    if '\\g[#ENUMERATOR\\n[#DEPTH]]'i' \
15505 .       if '\\$1'LEFT' .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1
15506 .    if '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \
15507 .       if '\\$1'LEFT' .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1
15508 .END
15509 \#
15510 \# RESET LIST
15511 \# ----------
15512 \# *Arguments:
15513 \#   none
15514 \# *Function:
15515 \#   Resets register enumerators to 1 or a.
15516 \#
15517 .MAC RESET_LIST END
15518 .    ie '\\$1'' .nr #ENUMERATOR\\n[#DEPTH] 0 1
15519 .    el .nr #ENUMERATOR\\n[#DEPTH] \\$1-1 1
15520 .END
15521 \#
15522 \# QUIT LISTS
15523 \# ----------
15524 \# *Arguments:
15525 \#   none
15526 \# *Function:
15527 \#   Exits lists cleanly and restores any indents that were in
15528 \#   effect prior to LIST.
15529 \#
15530 .MAC QUIT_LISTS END
15531 .   IQ CLEAR
15532 .   nr #HL_INDENT \\n[#STORED_HL_INDENT]
15533 .   nr #T_INDENT  \\n[#STORED_T_INDENT]
15534 .   rr #STORED_HL_INDENT
15535 .   if \\n[#RESTORE_PREV_INDENT]=1 \{\
15536 .      nr #L_INDENT  \\n[#STORED_L_INDENT]
15537 .      IL
15538 .      rr #STORED_L_INDENT
15539 .   \}
15540 .   if \\n[#RESTORE_PREV_INDENT]=2 \{\
15541 .      nr #BL_INDENT \\n[#STORED_BL_INDENT]
15542 .      nr #BR_INDENT \\n[#STORED_BR_INDENT]
15543 .      ll \\n[#ORIG_L_LENGTH]u
15544 .      IB
15545 .      rr #STORED_BL_INDENT
15546 .      rr #STORED_BR_INDENT
15547 .   \}
15548 .   if \\n[#RESTORE_PREV_INDENT]=3 \{\
15549 .      nr #R_INDENT \\n[#STORED_R_INDENT]
15550 .      ll \\n[#ORIG_L_LENGTH]u
15551 .      IR
15552 .      rr #STORED_R_INDENT
15553 .   \}
15554 .   if \\n[#RESTORE_PREV_INDENT]=4 \{\
15555 .      nr #R_INDENT \\n[#STORED_R_INDENT]
15556 .      nr #L_INDENT \\n[#STORED_L_INDENT]
15557 .      ll \\n[#ORIG_L_LENGTH]u
15558 .      IR
15559 .      IL
15560 .      rr #STORED_R_INDENT
15561 .      rr #STORED_L_INDENT
15562 .   \}
15563 .\" Clean up after exiting last depth of list
15564 .   nr #REMOVE 0 1
15565 .   while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\
15566 .      rr #LIST_INDENT\\n[#REMOVE]
15567 .      rr #ENUMERATOR\\n[#REMOVE]
15568 .      rm $ENUMERATOR\\n[#REMOVE]
15569 .      rm $SEPARATOR\\n[#REMOVE]
15570 .      rm $ENUMERATOR_TYPE\\n[#REMOVE]
15571 .      rr #PAD_LIST_DIGITS\\n[#REMOVE]
15572 .   \}
15573 .   rr #REMOVE
15574 .   rr #TOTAL_LISTS
15575 .   rr #QUIT
15576 .   rr #DEPTH
15577 .   rr #NEXT_DEPTH_BACK
15578 .   rr #RESTORE_PREV_INDENT
15579 .   rr #ORIG_L_LENGTH
15580 .   rr #CURRENT_L_LENGTH
15581 .   rr #IN_ITEM
15582 .   rr #IN_ITEM_L_INDENT
15583 .END
15584 \#
15585 \# SET LIST INDENT
15586 \# ---------------
15587 \# *Arguments:
15588 \#   none
15589 \# *Function:
15590 \#   Restores indent of prev. list in nested lists.  Also sets the
15591 \#   #QUIT register if an invocation of LIST OFF applies to the first
15592 \#   level of list.
15593 \#
15594 .MAC SET_LIST_INDENT END
15595 .    nr #NEXT_DEPTH_BACK \\n[#DEPTH]-1
15596 .    if \\n[#NEXT_DEPTH_BACK]=0 \{\
15597 .       nr #QUIT 1
15598 .       return
15599 .    \}
15600 .    nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#SHIFT_LIST\\n[#DEPTH]]
15601 .    nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]]
15602 .END
15603 \#
15604 \# ====================================================================
15605 \#
15606 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
15607 \#
15608 \# COLLATE
15609 \# -------
15610 \# *Arguments:
15611 \#   <none>
15612 \# *Function:
15613 \#   Turns headers off (if on) and saves header state, sets register
15614 \#   #COLLATE to 1 (toggle), and breaks to a new page.
15615 \# *Notes:
15616 \#   COLLATE exists primarily to allow putting multiple chapters in
15617 \#   a single file, although it can be used for any document type.  After
15618 \#   COLLATE, any of the macros that normally precede START may be
15619 \#   used, and should behave as expected.
15620 \#
15621 \#   N.B.--the START macro must be used after every COLLATE
15622 \#
15623 .MAC COLLATE END
15624 .    if \\n[defer] \
15625 .       DO_FOOTER
15626 .    EOL
15627 .    nr #COLLATED_DOC 1
15628 .    if ( (\\n[.t]-1) <= \\n[.v] ) .nr #NO_BREAK 1
15629 .    ds $SAVED_DOC_FAM \\*[$DOC_FAM]
15630 .    ds $SAVED_PP_FT   \\*[$PP_FT]
15631 .    nr #COLLATE 1
15632 .    nr #PRE_COLLATE 1
15633 .    nr #HEADER_STATE \\n[#HEADERS_ON]
15634 .    nr #POST_TOP 1
15635 .    nr #ARG_NUM 0 1
15636 .    nr #LOOP \\n[#ACTIVE_LEVELS]      \" loop count                                   
15637 .    nr #HEAD_1_NUM 0 1
15638 .    nr eqn*label-width     (\\n[eqn*label-num] >? \\n[eqn*label-width])
15639 .    nr pdf-img*label-width (\\n[pdf-img*label-num] >? \\n[pdf-img*label-width])
15640 .    nr pic*label-width     (\\n[pic*label-num] >? \\n[pic*label-width])
15641 .    nr tbl*label-width     (\\n[tbl*label-num] >? \\n[tbl*label-width])
15642 .    nr fig*label-width     (\\n[pdf-img*label-width] >? \\n[pic*label-width])
15643 .    if \\n[eqn*label-with-chapter]=1     .nr eqn*label-num     0 1
15644 .    if \\n[pdf-img*label-with-chapter]=1 .nr pdf-img*label-num 0 1
15645 .    if \\n[pic*label-with-chapter]=1     .nr pic*label-num     0 1
15646 .    if \\n[tbl*label-with-chapter]=1     .nr tbl*label-num     0 1
15647 .    if (\\n[defer]=0)&(\\n[float*defer]=0) .HEADERS OFF
15648 .    if \\n[#DOC_HEADER]=2 .nr #DOC_HEADER 1
15649 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
15650 .       nr #PAGINATION_STATE \\n[#PAGINATE]
15651 .       PAGINATION OFF
15652 .    \}
15653 .    IQ CLEAR
15654 .    TQ
15655 .    LL \\n[#DOC_L_LENGTH]u
15656 .    QUAD \\*[$DOC_QUAD]
15657 .    nr #SAVED_DOC_LEAD \\n[#DOC_LEAD]
15658 .    vs \\n[#DOC_LEAD]u
15659 \*[SLANTX]
15660 \*[CONDX]
15661 \*[EXTX]
15662 .    if \\n[#TOC] \{\
15663 .       if \\n[TOC_BH]=1 .pdfswitchtopage before MOM:TOC
15664 .       if \\n[TOC_BH]=2 .pdfswitchtopage after MOM:TOC
15665 .    \}
15666 .    if !\\n[#NO_NEWPAGE] .NEWPAGE
15667 .    rr #NO_NEWPAGE
15668 .    ch RR_@TOP
15669 .    rr @TOP
15670 .    if \\n[.ns] \{\
15671 .      rs
15672 .      nop \&
15673 .    \}
15674 .    if '\\n[.ev]'PAGE_TRANSITION' .ev
15675 .    if \\n[#DEFER_PAGINATION] .PAGINATE
15676 .    if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
15677 .       PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
15678 .       rm $RESTORE_PAGENUM_STYLE
15679 .    \}
15680 .    if \\n[#CH_NUM] \
15681 .       if \\n[#TOC]=0 .nr #CH_NUM +1
15682 .    rm $EN_TITLE
15683 .    COVERTITLE
15684 .    DOCCOVERTITLE
15685 .    MISC
15686 .    TITLE
15687 .    SUBTITLE
15688 .    CHAPTER
15689 .    CHAPTER_TITLE
15690 .    rr #PAGENUM_STYLE_SET
15691 .    rr #DOC_COVER
15692 .    rr #COVER
15693 .    rr #LAST_LEVEL
15694 .    rr #LEVEL
15695 .    if \\n[#RESTORE_PN_V_POS] \{\
15696 .       nr #PAGE_NUM_V_POS \\n[#RESTORE_PN_V_POS]
15697 .       rr #RESTORE_PN_V_POS
15698 .    \}
15699 .END
15700 \#
15701 \# NUMBER_LINES
15702 \# ------------
15703 \# *Arguments:
15704 \#   <starting line number> [ <increment> [ <gutter> ] ]
15705 \#   or
15706 \#   <anything> | RESUME
15707 \# *Function:
15708 \#   Begin, suspend/turn off, or resume numbering of output lines.
15709 \#
15710 .MAC NUMBER_LINES END
15711 .    br
15712 .    if \\n[#QUOTE] \{\
15713 .       if \\n[#QUOTE]=1 .ds macro QUOTE
15714 .       if \\n[#QUOTE]=2 .ds macro BLOCKQUOTE
15715 .       tm1 "[mom]: \\$0 at line \\n[.c] may not be used inside \\*[macro].
15716 .       tm1 "       Please set NUMBER_LINES before \\*[macro], followed by
15717 .       tm1 "       NUMBER_\\*[macro]_LINES.
15718 .       ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
15719 .    \}
15720 .    if '\\n[.z]'EPI_TEXT' .return
15721 .    if '\\$1'' \{\
15722 .       tm1 "[mom]: NUMBER_LINES at line \\n[.c] has no argument.
15723 .       tm1 "       Most likely, you have forgotten to give it a starting line number.
15724 .       ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
15725 .    \}
15726 .    if !\\n[#LINENUMBERS]=2 .nr #LINENUMBERS 1
15727 .\" Test whether the first arg is a digit.
15728 .    if \B'\\$1' \{\
15729 .       nr #LN \\$1
15730 .       ds $LN_NUM \\$1
15731 .       if !'\\n[.z]'' .nr #RESTORE_LN_NUM 1
15732 .       ie '\\$2'' \
15733 .          if '\\*[$LN_INC]'' .ds $LN_INC 1
15734 .       el .ds $LN_INC \\$2
15735 .       ie '\\$3'' \
15736 .          if !\\n[#LN_GUTTER] .nr #LN_GUTTER 2
15737 .       el .nr #LN_GUTTER \\$3
15738 .    \}
15739 .    ie !\\n[#LN] \{\
15740 .\" In other words, the first arg was not a digit.
15741 .       rr #LN
15742 .       ie '\\$1'RESUME' \{\
15743 .          LN_PARAMS
15744 .          nm \\*[$LN_NUM]
15745 .          RESTORE_PARAMS
15746 .       \}
15747 .       el \{\
15748 .          nm
15749 .\" register ln is still set and may confuse preprocessors like tbl
15750 .\" still, resuming line numbering must be possible, so save ln in $LN_NUM
15751 .          ds $LN_NUM \\n[ln]
15752 .          if !\\n[#QUOTE] .nr ln 0
15753 .          if !\\n[#LINENUMBERS]=2 .rr #LINENUMBERS
15754 .       \}
15755 .    \}
15756 .    el \{\
15757 .       LN_PARAMS
15758 .       nm \\*[$LN_NUM] \\*[$LN_INC] \\n[#LN_GUTTER] -3-\\n[#LN_GUTTER]
15759 .       RESTORE_PARAMS
15760 .       if !'\\n[.z]'' .nr #DIVER_LN_OFF 1
15761 .    \}
15762 .    rr #LN
15763 .END
15764 \#
15765 \# LINENUMBER STYLE PARAMETERS
15766 \# ---------------------------
15767 \# *Arguments:
15768 \#   none
15769 \# *Function:
15770 \#   LN_PARAMS sets parameters for line numbers.
15771 \#   RESTORE_PARAMS restores them after internal calls to .nm
15772 \#
15773 .MAC LN_PARAMS END
15774 .    ie d$LN_FAM .fam \\*[$LN_FAM]
15775 .    el .fam \\n[.fam]
15776 .    ie d$LN_FT .ft \\*[$LN_FT]
15777 .    el .ft \\n[.sty]
15778 .    ie d$LN_SIZE_CHANGE .ps \\*[$LN_SIZE_CHANGE]
15779 .    el .ps \\n[.s]
15780 .    ie d$LN_COLOR .gcolor \\*[$LN_COLOR]
15781 .    el .gcolor \\n[.m]
15782 .END
15783 \#
15784 .MAC RESTORE_PARAMS END
15785 .    fam
15786 .    ft
15787 .    ps
15788 .    gcolor
15789 .END
15790 \#
15791 \# NUMBER QUOTE AND BLOCKQUOTE LINES AS PART OF RUNNING TEXT
15792 \# ---------------------------------------------------------
15793 \# *Argument:
15794 \#   <gutter> | <anything>
15795 \# *Function:
15796 \#   Sets #(B)QUOTE_LN to 1 if no argument, or a single numeric
15797 \#   argument, is given; otherwise, turns (BLOCK)QUOTE linenumbering
15798 \#   off.
15799 \# *Notes:
15800 \#   #(B)QUOTE is checked for in QUOTE and BLOCKQUOTE.
15801 \#   The single numeric argument allows establishing a different gutter from
15802 \#   the one used for line numbers in running text.
15803 \#
15804 .MAC NUMBER_QUOTE_LINES END
15805 .    ie \\n[#NUM_ARGS]=0 .nr #QUOTE_LN 1
15806 .    el \{\
15807 .       ie \B'\\$1' \{\
15808 .          nr #QUOTE_LN 1
15809 .          nr #Q_LN_GUTTER \\$1
15810 .       \}
15811 .       el \{\
15812 .          ie '\\$1'SILENT' .nr #SILENT_QUOTE_LN 1
15813 .          el \{\
15814 .             rr #QUOTE_LN
15815 .             rr #SILENT_QUOTE_LN
15816 .          \}
15817 .       \}
15818 .    \}
15819 .END
15820 \#
15821 .MAC NUMBER_BLOCKQUOTE_LINES END
15822 .    ie \\n[#NUM_ARGS]=0 .nr #BQUOTE_LN 1
15823 .    el \{\
15824 .       ie \B'\\$1' \{\
15825 .          nr #BQUOTE_LN 1
15826 .          nr #BQ_LN_GUTTER \\$1
15827 .       \}
15828 .       el \{\
15829 .          ie '\\$1'SILENT' .nr #SILENT_BQUOTE_LN 1
15830 .          el \{\
15831 .             rr #BQUOTE_LN
15832 .             rr #SILENT_BQUOTE_LN
15833 .          \}
15834 .       \}
15835 .    \}
15836 .END
15837 \#
15838 \# OUTPUT BLANK PAGES
15839 \# ------------------
15840 \# *Argument:
15841 \#   <number of blank pages to output> [ DIVIDER [ NULL ] ]
15842 \# *Function:
15843 \#   Outputs blank pages.
15844 \# *Notes:
15845 \#   If recto/verso, each page is recto/verso, even if there's
15846 \#   nothing on it.
15847 \#
15848 \#   The 1st argument to BLANKPAGE is non-optional.  DIVIDER is for
15849 \#   blank pages before endnotes, bibliographies, tocs, new chapters.
15850 \#
15851 .MAC BLANKPAGE END
15852 .    nr #HOW_MANY \\$1
15853 .    nr #PAGES 0 1
15854 .    if \\n[#LINENUMBERS] \{\
15855 .       nr #LINENUMBERS_WERE_ON 1
15856 .       NUMBER_LINES OFF
15857 .    \}
15858 .    while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
15859 .       if \\n[#HEADERS_ON]=1 \{\
15860 .          nr #HEADERS_WERE_ON 1
15861 .          HEADERS OFF
15862 .       \}
15863 .       if \\n[#PAGE_NUM_V_POS]=1 \{\
15864 .          if \\n[#PAGINATE]=1 .nr #PAGINATE_WAS_ON 1
15865 .          PAGINATION OFF
15866 .       \}
15867 .       NEWPAGE
15868 .       PRINT \&
15869 .       if \\n[#FOOTERS_ON]=1 \{\
15870 .          nr #FOOTERS_WERE_ON 1
15871 .          FOOTERS OFF
15872 .       \}
15873 .       if \\n[#PAGE_NUM_V_POS]=2 \{\
15874 .          if \\n[#PAGINATE]=1 .nr #PAGINATE_WAS_ON 1
15875 .             nr #RESTORE_PN_V_POS \\n[#PAGE_NUM_V_POS]
15876 .          PAGINATION OFF
15877 .       \}
15878 .       if \\n[#HEADERS_WERE_ON] .HEADERS
15879 .       if \\n[#PAGE_NUM_V_POS]=1 \
15880 .          if \\n[#PAGINATE_WAS_ON] .PAGINATE
15881 .    \}
15882 .    shift
15883 .    ie '\\$1'DIVIDER' \{\
15884 .       if \\n[#FOOTERS_WERE_ON] .FOOTERS
15885 .       if \\n[#RESTORE_PN_V_POS]=2 \{\
15886 .          if \\n[#PAGINATE_WAS_ON] .nr #RESTORE_PAGINATION 1
15887 .       \}
15888 .       shift
15889 .       if '\\$1'NULL' .nr #PAGE_NUM_ADJ -\\n[#HOW_MANY]
15890 .    \}
15891 .    el \{\
15892 .       if '\\$1'' \{\
15893 .          NEWPAGE
15894 .          if \\n[#FOOTERS_WERE_ON] .FOOTERS
15895 .          if \\n[#PAGE_NUM_V_POS]=2 \
15896 .             if \\n[#PAGINATE_WAS_ON] .PAGINATE
15897 .       \}
15898 .       if '\\$1'NULL' \{\
15899 .          NEWPAGE
15900 .          if \\n[#FOOTERS_WERE_ON] .FOOTERS
15901 .          if \\n[#PAGE_NUM_V_POS]=2 \
15902 .             if \\n[#PAGINATE_WAS_ON] .PAGINATE
15903 .       \}
15904 .    \}
15905 .    if \\n[#PAGINATE]=1 \
15906 .       if '\\$1'NULL' .nr #PAGE_NUM_ADJ -\\n[#HOW_MANY]
15907 .    if \\n[#LINENUMBERS_WERE_ON] .NUMBER_LINES RESUME
15908 .    rr #HOW_MANY
15909 .    rr #HEADERS_WERE_ON
15910 .    rr #FOOTERS_WERE_ON
15911 .    rr #PAGINATE_WAS_ON
15912 .END
15913 \#
15914 \# FLOATS
15915 \# ------
15916 \#
15917 .am PSPIC \" Need to do this for PSPIC inside a float
15918 .  vpt 0
15919 \h'(\\n[ps-offset]u + \\n[ps-deswid]u)'
15920 .  sp -1
15921 .  vpt 1
15922 ..
15923 \#
15924 .MAC PROCESS_FLOATS END
15925 .    if (\\n[float*defer]>0):(\\n[defer]=0) \{\
15926 .        if !\\n[tbl*no-top-hook] .tbl@top-hook
15927 .        rr tbl*no-top-hook
15928 .    \}
15929 .    if \\n[defer] \{\
15930 .       ev protect
15931 .       evc FLOAT
15932 .       nf
15933 .       rs
15934 .       nop \&
15935 .       sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
15936 .       if '\\*[float*type:1]'boxed-tbl' \{\
15937 .          ch RR_@TOP
15938 .          if (\\n[.t] >= 1)&(\\n[float-depth:1] > \\n[.t]) \
15939 .             tbl*float-warning
15940 .          if \\n[#MLA] .sp \\n[tbl*label-lead-diff]u
15941 .          if (\\n[tbl*have-caption]=1)&(\\n[tbl*caption-after-label]=0) \
15942 .             sp \\n[tbl*caption-lead-diff]u
15943 .          if \\n[tbl*caption-after-label] .sp 1n+(\\n[tbl*caption-lead-diff]u*2u)
15944 .       \}
15945 .       if \\n[float*pic] \{\
15946 .          if (\\n[pic*have-caption]=1)&(\\n[pic*caption-after-label]=0) \{\
15947 .             ie \\n[#COLUMNS] \{\
15948 .                sp |\\n[dc]u-.5v
15949 .             \}
15950 .             el \
15951 .                sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u-.5v
15952 .          \}
15953 .          rr pic*caption-lead-diff
15954 .          rr pic*top-lead-diff
15955 .          rr float*pic
15956 .       \}
15957 .       if \\n[float*img] \{\
15958 .             ie \\n[#COLUMNS] \
15959 .                sp |\\n[dc]u
15960 .             el \
15961 .                sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
15962 .       \}
15963 .       nr defer-count \\n[defer]
15964 .       nr loop-count  0 1
15965 .       nr new-defer   0 1
15966 .       while \\n+[loop-count]<=\\n[defer-count] \{\
15967 .          nr tbl*no-top-hook 1
15968 .          if \\n[defer] .rnn defer float*defer \" So '.if \n[defer]' is skipped during float output
15969 .          vpt
15970 .          ch RR_@TOP
15971 .          rr @TOP
15972 .          if \\n[pdf-img*have-caption] \{\
15973 .             if !\\n[pdf-img*caption-after-label] .sp -.5v
15974 .          \}
15975 .          rr pdf-img*have-caption
15976 .          rr pic*have-caption
15977 .          if '\\*[float*type:\\n[loop-count]]'table' \{\
15978 .             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
15979 .             ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_LEAD]u
15980 .          \}
15981 .          ie !\\n[float-span:\\n[loop-count]] \{\
15982 .             ie ((\\n[float-depth:\\n[loop-count]]-\\n[.v])>\\n[.t]):(\\n[D-float:\\n[loop-count]]>\\n[.t]) \{\
15983 .\" Insufficient space, defer to next page
15984 .                rn FLOAT*DIV:\\n[loop-count] NEW*FLOAT*DIV:\\n+[new-defer]
15985 .                rnn float-depth:\\n[loop-count] new-float-depth:\\n[new-defer]
15986 .                rnn D-float:\\n[loop-count] new-D-float:\\n[new-defer]
15987 .             \}
15988 .             el \{\
15989 .                output-float
15990 .             \}
15991 .          \}
15992 .          el \{\
15993 .             rr tbl*no-top-hook
15994 .             output-float
15995 .          \}
15996 .       \}
15997 .       rm FLOAT*DIV:\\n[loop-count]
15998 .       rr float-depth:\\n[loop-count]
15999 .       rm tbl*header-div:\\n[loop-count]
16000 .       rm float*type:\\n[loop-count]
16001 .\" FLOAT arrays are empty now
16002 .\" Rename new arrays (FLOATs deferred to next page) to proper names
16003 .       nr loop-count 0 1
16004 .       rnn new-defer defer
16005 .       while \\n+[loop-count]<=\\n[defer] \{\
16006 .          rn NEW*FLOAT*DIV:\\n[loop-count] FLOAT*DIV:\\n[loop-count]
16007 .          rnn new-float-depth:\\n[loop-count] float-depth:\\n[loop-count]
16008 .          rnn new-D-float:\\n[loop-count] D-float:\\n[loop-count]
16009 .       \}
16010 .       rr float*defer
16011 .       ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
16012 .       ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
16013 .       ev
16014 .       SHIM
16015 .       if \\n[#SHIM]>(\\n[#DOC_LEAD]-(\\n[#DOC_LEAD]/4)) 'sp -\\n[#DOC_LEAD]u
16016 .       nr tbl*have-header 0
16017 .       rr loop-count
16018 .       rr defer-count
16019 .       rr float*before-shim
16020 .       rr float*after-shim
16021 .       rm float-adj
16022 .       rm float-adj:top
16023 .       rm float-adj:bottom
16024 .       if \\n[#NEWPAGE] \{\
16025 .          vpt
16026 '          bp
16027 .          rr #NEWPAGE
16028 .       \}
16029 .    \}
16030 .    rr float*img
16031 .    rr float*eqn
16032 .    rr float*tbl
16033 .    rr float*pic
16034 .END
16035 \#
16036 .MAC output-float END
16037 .    vpt 0
16038 .    nop \&
16039 .    sp -1
16040 .    if \\n[no-top-space] \{\
16041 .       ie !\\n[#COLUMNS] \{\
16042 .          sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
16043 .          ns
16044 .       \}
16045 .       el .sp |\\n[dc]u
16046 .       if \\n[float*tbl] \{\
16047 .          rs
16048 .          if \\n[tbl*caption-top-lead-diff] \{\
16049 .             sp \\n[tbl*caption-top-lead-diff]u
16050 .             rr tbl*caption-top-lead-diff
16051 .          \}
16052 .          rr float*tbl
16053 .       \}
16054 .    \}
16055 .    if \\n[float*pic] \{\
16056 .       nr pic*top-space-adj \\n[#DOC_LEAD]-\\n[pic@text-lead]
16057 .       if (\\n[pic*have-caption]=0):(\\n[pic*caption-after-label]=1) \{\
16058 .          sp \\n[pic*top-space-adj]u
16059 .       \}
16060 .       if \\n[#COLUMNS] \{\
16061 .          if !'\\*[pic*space-adj]'' .sp \\*[pic*space-adj]
16062 .       \}
16063 .       rr float*pic
16064 .    \}
16065 .    if \\n[float*eqn] \{\
16066 .       sp -.5v
16067 .       rr float*eqn
16068 .    \}
16069 .    FLOAT*DIV:\\n[loop-count]
16070 .    if \\n[no-top-space] \{\
16071 .       rs
16072 .       nop \&
16073 .       sp -1
16074 .       rr no-top-space
16075 .    \}
16076 .    if \\n[#COLUMNS] \
16077 .       if !'\\*[pic*space-adj]'' .sp -\\*[pic*space-adj]
16078 .    rm pic*space-adj
16079 .    if \\n[D-float:\\n[loop-count]] \{\
16080 .       sp \
16081 -\\n[float-depth:\\n[loop-count]]u+\\n[D-float:\\n[loop-count]]u+\\n[#DOC_LEAD]u
16082 .       rr D-float:\\n[loop-count]
16083 .    \}
16084 .END
16085 \#
16086 \# FLOAT
16087 \# -----
16088 \# *Arguments:
16089 \#   [ ADJUST +|-<amount> ] [ FORCE] [ SPAN] [ NO_SHIM] | <anything>
16090 \# *Function:
16091 \#   Captures input in a diversion, which is output immediately if
16092 \#   there's room on the page; otherwise outputs diversion at top of
16093 \#   next page.
16094 \# *Notes:
16095 \#   ADJUST allows for raising or lowering the contents of
16096 \#   the diversion within the space allotted.  FORCE breaks to
16097 \#   a new page immediately.
16098 \#
16099 .MAC FLOAT END
16100 .\"  Case where upcoming .br breaks to a new page, causing a defered float
16101 .\"  to be output by HEADER and the defer register to be cleared.
16102 .    nr pagenum \\n%+\\n[#PAGE_NUM_ADJ]
16103 .    br
16104 .\" Clear .ns when a single line of running text precededs float
16105 .\" at the top of the page.
16106 .    if \\n[nl]=\\n[#PAGE_TOP] \{\
16107 .       vpt 0
16108 .       sp -1v
16109 .       sp
16110 .       ch RR_@TOP
16111 .       rr @TOP
16112 .       vpt
16113 .    \}
16114 .    if \\n[#NUM_ARGS]>0 \{\
16115 .    nr loop-count 0 1
16116 .    nr loop-counter \\n[#NUM_ARGS]
16117 .       while \\n+[loop-count]<=\\n[loop-counter] \{\
16118 .          if '\\$1'FORCE' \{\
16119 .             nr #FORCE 1
16120 .             shift
16121 .          \}
16122 .          if '\\$1'SPAN' \{\
16123 .              nr float-span 1
16124 .              shift
16125 .          \}
16126 .          if '\\$1'ADJUST' \{\
16127 .             shift
16128 .             ds float-adj \\$1
16129 .             shift
16130 .          \}
16131 .          if '\\$1'NO_SHIM' \{\
16132 .             nr float*no-shim 1
16133 .             shift
16134 .          \}
16135 .       \}
16136 .    \}
16137 .    ie '\\$1'' \{\
16138 .       ev FLOAT
16139 .       evc 0
16140 .       nf
16141 .       di FLOAT*DIV
16142 .    \}
16143 .    el \{\
16144 .       br
16145 .       di
16146 .       if \\n[float*table] \
16147 .          if !\\n[tbl*have-header] .ev
16148 .       ev
16149 .       if \\n[tbl*boxed] \{\
16150 .          ie !\\n[#MLA] \{\
16151 .             ie (\\n[tbl@label]=1):(\\n[tbl@source]=1) .nr dn -.65v
16152 .             el .nr dn +.65v
16153 .          \}
16154 .          el \{\
16155 .             if !\\n[tbl@source] .nr dn -1.65v
16156 .          \}
16157 .       \}
16158 .       if (\\n[dn]>\\n[.t]):(\\n[D-float]>\\n[.t]) \{\
16159 .          ie \\n[@TOP] \
16160 .             if \\n[tbl*boxed] .rs
16161 .          el \{\
16162 .             if !\\n[defer] .nr defer 0 1
16163 .             rn FLOAT*DIV FLOAT*DIV:\\n+[defer]
16164 .             if \\n[float-span] \
16165 .                if !\\n[tbl*boxed] .rnn float-span float-span:\\n[defer]
16166 .             if \\n[float*tbl] \{\
16167 .                if \\n[defer]=1 .nr no-top-space 1
16168 .                ie \\n[tbl*boxed] \{\
16169 .                   ds float*type:\\n[defer] boxed-tbl
16170 .                   rr float-span
16171 .                \}
16172 .                el .ds float*type:\\n[defer] table
16173 .                if \\n[tbl*center] .nr float*tbl-center:\\n[defer] 1
16174 .                rn tbl*header-div tbl*header-div:\\n[defer]
16175 .                rr tbl*center
16176 .             \}
16177 .             if \\n[float*eqn] \{\
16178 .                if \\n[defer]=1 .nr no-top-space 1
16179 .                ds float*type:\\n[defer] eqn
16180 .             \}
16181 .             if \\n[float*pic] \{\
16182 .                ds float*type:\\n[defer] pic
16183 .             \}
16184 .             if \\n[float*img] \{\
16185 .                ds float*type:\\n[defer] img
16186 .             \}
16187 .             if \\n[D-float] .nr D-float:\\n[defer] \\n[D-float]
16188 .             nr float-depth:\\n[defer] \\n[dn]
16189 .             if \\n[#FORCE] \{\
16190 .                bp
16191 .                rr #FORCE
16192 .             \}
16193 .             return \" output div after header
16194 .          \}
16195 .       \}
16196 .       if !'\\*[float-adj]'' .sp \\*[float-adj]
16197 .       if \\n[.u] .nr fill 1
16198 .       if \\n[@TOP] \{\
16199 .          nr no-adjust 1
16200 .          rr @TOP
16201 .       \}
16202 .       nf
16203 .       if \\n[float*tbl] \
16204 .          if (\\n[#MLA]=1)&(\\n[tbl@source]=0) \
16205 .             chop FLOAT*DIV
16206 .          if \\n[nl]=\\n[#PAGE_TOP] \{\
16207 .             if \\n[tbl*have-caption] \{\
16208 .                ie !\\n[#MLA] .sp \\n[tbl*caption-lead-diff]u
16209 .                el \{\
16210 .                ch RR_@TOP
16211 .                sp \\n[tbl*label-lead-diff]u-.5v
16212 .             \}
16213 .          \}
16214 .       \}
16215 .       FLOAT*DIV
16216 .       if \\n[float*tbl] \{\
16217 .          ie \\n[tbl*boxed] \{\
16218 .             if \\n[dn]=\\n[bx-tbl-depth] .sp .35v
16219 .             if \\n[tbl*plain-boxed] .sp .5v
16220 .             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
16221 .             ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
16222 .             rr tbl*boxed
16223 .             rr bx-tbl-depth
16224 .          \}
16225 .          el \{\
16226 .             if '\\*[tbl*label]'' \
16227 .                if \\n[tbl*autolabel]=0 .sp
16228 .          \}
16229 .          rr float*tbl
16230 .          rr tbl*center
16231 .          rm tbl*header-div
16232 .          rr tbl*have-caption
16233 .          rr tbl*have-label
16234 .          rr tbl*have-source
16235 .          rm tbl*caption
16236 .          rm tbl*label
16237 .          rm tbl*source
16238 .       \}
16239 .       if \\n[D-float] \
16240 .          sp -\\n[dn]u+\\n[#DOC_LEAD]u+\\n[D-float]u
16241 .       if \\n[fill] \{\
16242 .          fi
16243 .          rr fill
16244 .       \}
16245 .       rm FLOAT*DIV
16246 .       if !'\\*[float-adj]'' \
16247 .          if !\\n[no-adjust] .sp -\\*[float-adj]
16248 .          if !\\n[float*no-shim] .SHIM
16249 .       rm float-adj
16250 .       rm no-adjust
16251 .       rm float-adj:top
16252 .       rm float-adj:bottom
16253 .       rr D-float
16254 .       rr float*no-shim
16255 .       rr #FORCE
16256 .    \}
16257 .END
16258 \#
16259 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
16260 \# ---------------------------------------
16261 \# *Arguments:
16262 \#   <none>
16263 \# *Function:
16264 \#   Sets header/footer/footnotes/etc... traps.
16265 \#
16266 \#   Calculates the number of lines that actually fit on a
16267 \#   page based on #B_MARGIN and resets page bottom trap to coincide
16268 \#   with the depth of that number of lines, or, if #ADJ_DOC_LEAD=1,
16269 \#   adjusts #DOC_LEAD so that the last line of text on a page falls
16270 \#   exactly on #B_MARGIN.
16271 \#
16272 .MAC RR_@TOP END \" Trap-invoked after first line of text on a new page
16273 .    rr @TOP
16274 .    if \\n[.ns] \{\
16275 .       vpt 0
16276 .       rs
16277 .       if \\n[.u] .nr fill 1
16278 .       nf
16279 .       nop \&
16280 .       sp -1
16281 .       if \\n[fill] .fi
16282 .    \}
16283 .    if \\n[.vpt]=0 .vpt
16284 .END
16285 \#
16286 .MAC TRAPS END
16287 .    if !\\n[#UNADJUSTED_DOC_LEAD]  .nr #UNADJUSTED_DOC_LEAD \\n[#DOC@LEAD]
16288 .\" Remove all header/footer traps
16289 .    if !\\n[#NO_TRAP_RESET] \{\
16290 .       ch DO_T_MARGIN
16291 .       ch DO_B_MARGIN
16292 .       ch HEADER
16293 .       ch FOOTER
16294 .       ch FN_OVERFLOW_TRAP
16295 .\" Plant header trap
16296 .       wh 0 HEADER
16297 .    \}
16298 .\" Adjust lead so last line of text falls on B_MARGIN
16299 .       nr #LINES_PER_PAGE 0 1
16300 .       nr #DOC_LEAD_ADJ 0 1
16301 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#ORIGINAL_B_MARGIN]-\\n[#DOC_LEAD]
16302 .\" Get the number of unadjusted lines that fit on the page; always a
16303 .\" bit short of the bottom margin
16304 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
16305 .
16306 .       \}
16307 .       nr #LINES_PER_PAGE -1
16308 .\" Add machine units, 1 at a time, increasing the leading until the
16309 .\" new leading fills the page properly
16310 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<=\\n[#DEPTH_TO_B_MARGIN] \{\
16311 .
16312 .       \}
16313 .       DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
16314 .\" The "visual" bottom margin is what \n[nl] would report on the
16315 .\" last line before the FOOTER trap is sprung
16316 .       nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD])
16317 .\" Get the difference between #B_MARGIN and #VISUAL_B_MARGIN
16318 .       nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
16319 .\" Set #B_MARGIN to 1 machine unit lower on the page than #VISUAL_B_MARGIN
16320 .       nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
16321 .\" Set the FN_OVERFLOW_TRAP position
16322 .       nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]-\\n[#FN_LEAD]
16323 .       if \\n[#PRINT_STYLE]=1 .nr #FN_OVERFLOW_TRAP_POS \\n[#ORIGINAL_B_MARGIN]u
16324 .\" Set footer and footnote overflow traps
16325 .    if !\\n[#NO_TRAP_RESET] \{\
16326 .       nr #FN_COUNT 0 1
16327 .       nr #SPACE_REMAINING 0
16328 .       nr #FN_DEPTH 0
16329 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
16330 .       wh \\n[.p]u FOOTER
16331 .       wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
16332 .       ch FOOTER -\\n[#B_MARGIN]u
16333 .    \}
16334 .END
16335 \#
16336 \# CHECK INDENT
16337 \# ------------
16338 \# *Arguments:
16339 \#   <none>
16340 \# *Function:
16341 \#   Adds left, right, or both indent values to document elements
16342 \#   like heads and subheads that are processed in environments.
16343 \#
16344 .MAC CHECK_INDENT END
16345 .    if \\n[#INDENT_LEFT_ACTIVE] \{\
16346 .       in \\n[#L_INDENT]u
16347 .       if \\n[#QUOTE] \{\
16348 .          in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
16349 .          ll -\\n[#L_INDENT]u
16350 .          ta \\n[.l]u
16351 .       \}
16352 .       if \\n[#EPIGRAPH] \{\
16353 .          in -\\n[#L_INDENT]u
16354 .          ll -\\n[#L_INDENT]u
16355 .          ta \\n[.l]u
16356 .       \}
16357 .    \}
16358 .    if \\n[#INDENT_RIGHT_ACTIVE] \{\
16359 .       ll -\\n[#R_INDENT]u
16360 .       ta \\n[.l]u
16361 .    \}
16362 .    if \\n[#INDENT_BOTH_ACTIVE] \{\
16363 .       in \\n[#BL_INDENT]u
16364 .       ll -\\n[#BR_INDENT]u
16365 .       ta \\n[.l]u
16366 .       if \\n[#QUOTE] \{\
16367 .          in -\\n[#BL_INDENT]u
16368 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
16369 .             ll -\\n[#BR_INDENT]u
16370 .             ta \\n[.l]u
16371 .          \}
16372 .          el \{\
16373 .             ll -(\\n[#BR_INDENT]u/2u)
16374 .             ta \\n[.l]u
16375 .          \}
16376 .       \}
16377 .       if \\n[#EPIGRAPH] \{\
16378 .          in -\\n[#BL_INDENT]u
16379 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
16380 .             ll -\\n[#BR_INDENT]u
16381 .             ta \\n[.l]u
16382 .          \}
16383 .          el \{\
16384 .             ll -(\\n[#BR_INDENT]u/2u)
16385 .             ta \\n[.l]u
16386 .          \}
16387 .       \}
16388 .    \}
16389 .END
16390 \#
16391 \# REMOVE INDENT
16392 \# -------------
16393 \# *Arguments:
16394 \#   <none>
16395 \# *Function:
16396 \#   Removes left, right, or both indent values from document elements
16397 \#   like heads and subheads that are processed in environments.
16398 \#
16399 .MAC REMOVE_INDENT END
16400 .    in 0
16401 .    ll \\n[#L_LENGTH]u
16402 .    ta \\n[.l]u
16403 .END
16404 \#
16405 \# This .em (for all DOC_TYPEs, except 4 [LETTER]) ensures that
16406 \# deferred footnotes that happen on the 2nd to last page get
16407 \# output.
16408 \#
16409 .MAC TERMINATE END
16410 .    ie \\n[#FN_DEPTH] \{\
16411 .       ie \\n[#FN_DEFER] \{\
16412 .          br
16413 .          nr #TERMINATE 1
16414 .          FOOTNOTE
16415 .          nf
16416 .          FOOTNOTE OFF
16417 .       \}
16418 .       el \{\
16419 .          br
16420 .          ch FN_OVERFLOW_TRAP
16421 .          DO_FOOTER
16422 .       \}
16423 .    \}
16424 .    el \{\
16425 .       ch FN_OVERFLOW_TRAP
16426 .       DO_FOOTER
16427 .    \}
16428 .END
16429 \#
16430 \# END MACRO FOR LETTERS
16431 \# ---------------------
16432 \# *Arguments:
16433 \#   none
16434 \# *Function:
16435 \#   The .em macro executed at the end of letters.  Turns footers
16436 \#   and pagination off, terminates and outputs diversion CLOSING
16437 \#   (indented with the author's name underneath).
16438 \#
16439 .MAC ALL_DONE END
16440 .    ch FOOTER
16441 .    ch HEADER
16442 .    br
16443 .    if \\n[#DOC_TYPE]=4 \{\
16444 .       if !'\\n[.z]'' \{\
16445 .          br
16446 .          ALD \\*[$SIG_SPACE]
16447 .          di
16448 .       \}
16449 .       IQ CLEAR
16450 .       TQ
16451 .       LEFT
16452 .       ie !'\\*[$CLOSE_INDENT]'' .IL \\*[$CLOSE_INDENT]
16453 .       el .IL \\n[#DOC_L_LENGTH]u/2u
16454 .       SP
16455 .       if \\n[#CLOSING] \{\
16456 .          CLOSING_TEXT
16457 .          br
16458 .       \}
16459 .       PRINT \\*[$AUTHOR_1]
16460 .    \}
16461 .END
16462 \#
16463 \# Set up a default papersize of US letter
16464 \#
16465 .PAPER LETTER
16466 \#
16467 \# ====================================================================
16468 \#
16469 \# +++DOCUMENT PROCESSING ALIASES+++
16470 \#
16471 \# Aliases to make life easier for users: synonyms, short forms
16472 \# and alternate spellings.
16473 \#
16474 .ALIAS   BREAK_BLOCKQUOTE    BREAK_QUOTE
16475 .ALIAS   BREAK_CITATION      BREAK_QUOTE
16476 .ALIAS   BREAK_CITE          BREAK_QUOTE
16477 .ALIAS   BLOCKQUOTE_INDENT   QUOTE_INDENT
16478 .ALIAS   CITATION            BLOCKQUOTE
16479 .ALIAS   CITATION_FAMILY     BLOCKQUOTE_FAMILY
16480 .ALIAS   CITATION_FONT       BLOCKQUOTE_FONT
16481 .ALIAS   CITATION_SIZE       BLOCKQUOTE_SIZE
16482 .ALIAS   CITATION_COLOR      BLOCKQUOTE_COLOR
16483 .ALIAS   CITATION_QUAD       BLOCKQUOTE_QUAD
16484 .ALIAS   CITE                BLOCKQUOTE
16485 .ALIAS   CITE_FAMILY         BLOCKQUOTE_FAMILY
16486 .ALIAS   CITE_FONT           BLOCKQUOTE_FONT
16487 .ALIAS   CITE_SIZE           BLOCKQUOTE_SIZE
16488 .ALIAS   CITE_COLOR          BLOCKQUOTE_COLOR
16489 .ALIAS   CITE_QUAD           BLOCKQUOTE_QUAD
16490 .ALIAS   DOC_R_MARGIN        DOC_RIGHT_MARGIN
16491 .ALIAS   DOC_L_MARGIN        DOC_LEFT_MARGIN
16492 .ALIAS   DOC_L_LENGTH        DOC_LINE_LENGTH
16493 .ALIAS   DOC_RMARGIN         DOC_RIGHT_MARGIN
16494 .ALIAS   DOC_LMARGIN         DOC_LEFT_MARGIN
16495 .ALIAS   DOC_LLENGTH         DOC_LINE_LENGTH
16496 .ALIAS   DOC_FAM             DOC_FAMILY
16497 .ALIAS   DOC_LS              DOC_LEAD
16498 .ALIAS   DOC_PS              DOC_PT_SIZE
16499 .ALIAS   FILL                QUAD
16500 .ALIAS   PAGENUM             PAGENUMBER
16501 .ALIAS   PAGINATION          PAGINATE
16502 .ALIAS   PP_FT               PP_FONT
16503 .ALIAS   REF_INDENT          INDENT_REFS
16504 .ALIAS   TOC_PS              TOC_PT_SIZE
16505 \#
16506 \# HEADER and FOOTER macros
16507 \# ------------------------
16508 \# Because the type-style of headers and footers are managed
16509 \# identically, and the type-style macros (_<type parameter>) all
16510 \# require the correct name of the calling macro, it's necessary
16511 \# to create HEADER_ and FOOTER_ macros here.  They're basically
16512 \# aliases of HDRFTR_, but required because you can't alias an
16513 \# alias.
16514 \#
16515 .MAC FOOTER_CENTER_COLOR END
16516 .    HDRFTR_CENTER_COLOR \\$1
16517 .END
16518 \#
16519 .MAC FOOTER_CENTER_COLOUR END
16520 .    HDRFTR_CENTER_COLOR \\$1
16521 .END
16522 \#
16523 .MAC FOOTER_CENTER_FAM END
16524 .    HDRFTR_CENTER_FAMILY \\$1
16525 .END
16526 \#
16527 .MAC FOOTER_CENTER_FAMILY END
16528 .    HDRFTR_CENTER_FAMILY \\$1
16529 .END
16530 \#
16531 .MAC FOOTER_CENTER_FONT END
16532 .    HDRFTR_CENTER_FONT \\$1
16533 .END
16534 \#
16535 .MAC FOOTER_CENTER_FT END
16536 .    HDRFTR_CENTER_FONT \\$1
16537 .END
16538 \#
16539 .MAC FOOTER_CENTER_PS END
16540 .    HDRFTR_CENTER_SIZE \\$1
16541 .END
16542 \#
16543 .MAC FOOTER_CENTER_SIZE END
16544 .    HDRFTR_CENTER_SIZE \\$1
16545 .END
16546 \#
16547 .MAC FOOTER_CENTRE_CAPS END
16548 .    HDRFTR_CENTER_CAPS \\$1
16549 .END
16550 \#
16551 .MAC FOOTER_CENTRE_COLOR END
16552 .    HDRFTR_CENTRE_COLOR \\$1
16553 .END
16554 \#
16555 .MAC FOOTER_CENTRE_COLOUR END
16556 .    HDRFTR_CENTRE_COLOR \\$1
16557 .END
16558 \#
16559 .MAC FOOTER_CENTRE_FAM END
16560 .    HDRFTR_CENTER_FAMILY \\$1
16561 .END
16562 \#
16563 .MAC FOOTER_CENTRE_FAMILY END
16564 .    HDRFTR_CENTER_FAMILY \\$1
16565 .END
16566 \#
16567 .MAC FOOTER_CENTRE_FONT END
16568 .    HDRFTR_CENTER_FONT \\$1
16569 .END
16570 \#
16571 .MAC FOOTER_CENTRE_FT END
16572 .    HDRFTR_CENTER_FONT \\$1
16573 .END
16574 \#
16575 .MAC FOOTER_CENTRE_PS END
16576 .    HDRFTR_CENTER_SIZE \\$1
16577 .END
16578 \#
16579 .MAC FOOTER_CENTRE_SIZE END
16580 .    HDRFTR_CENTER_SIZE \\$1
16581 .END
16582 \#
16583 .MAC FOOTER_COLOR END
16584 .    HDRFTR_COLOR \\$1
16585 .END
16586 \#
16587 .MAC FOOTER_COLOUR END
16588 .    HDRFTR_COLOR \\$1
16589 .END
16590 \#
16591 .MAC FOOTER_FAM END
16592 .    HDRFTR_FAMILY \\$1
16593 .END
16594 \#
16595 .MAC FOOTER_FAMILY END
16596 .    HDRFTR_FAMILY \\$1
16597 .END
16598 \#
16599 .MAC FOOTER_LEFT_COLOR END
16600 .    HDRFTR_LEFT_COLOR \\$1
16601 .END
16602 \#
16603 .MAC FOOTER_LEFT_COLOUR END
16604 .    HDRFTR_LEFT_COLOR \\$1
16605 .END
16606 \#
16607 .MAC FOOTER_LEFT_FAM END
16608 .    HDRFTR_LEFT_FAMILY \\$1
16609 .END
16610 \#
16611 .MAC FOOTER_LEFT_FAMILY END
16612 .    HDRFTR_LEFT_FAMILY \\$1
16613 .END
16614 \#
16615 .MAC FOOTER_LEFT_FONT END
16616 .    HDRFTR_LEFT_FONT \\$1
16617 .END
16618 \#
16619 .MAC FOOTER_LEFT_FT END
16620 .    HDRFTR_LEFT_FONT \\$1
16621 .END
16622 \#
16623 .MAC FOOTER_LEFT_PS END
16624 .    HDRFTR_LEFT_SIZE \\$1
16625 .END
16626 \#
16627 .MAC FOOTER_LEFT_SIZE END
16628 .    HDRFTR_LEFT_SIZE \\$1
16629 .END
16630 \#
16631 .MAC FOOTER_RIGHT_COLOR END
16632 .    HDRFTR_RIGHT_COLOR \\$1
16633 .END
16634 \#
16635 .MAC FOOTER_RIGHT_COLOUR END
16636 .    HDRFTR_RIGHT_COLOR \\$1
16637 .END
16638 \#
16639 .MAC FOOTER_RIGHT_FAM END
16640 .    HDRFTR_RIGHT_FAMILY \\$1
16641 .END
16642 \#
16643 .MAC FOOTER_RIGHT_FAMILY END
16644 .    HDRFTR_RIGHT_FAMILY \\$1
16645 .END
16646 \#
16647 .MAC FOOTER_RIGHT_FONT END
16648 .    HDRFTR_RIGHT_FONT \\$1
16649 .END
16650 \#
16651 .MAC FOOTER_RIGHT_FT END
16652 .    HDRFTR_RIGHT_FONT \\$1
16653 .END
16654 \#
16655 .MAC FOOTER_RIGHT_PS END
16656 .    HDRFTR_RIGHT_SIZE \\$1
16657 .END
16658 \#
16659 .MAC FOOTER_RIGHT_SIZE END
16660 .    HDRFTR_RIGHT_SIZE \\$1
16661 .END
16662 \#
16663 .MAC FOOTER_RULE_COLOR END
16664 .    HDRFTR_RULE_COLOR \\$1
16665 .END
16666 \#
16667 .MAC FOOTER_SIZE END
16668 .    HDRFTR_SIZE \\$1
16669 .END
16670 \#
16671 .MAC HEADER_CENTER_COLOR END
16672 .    HDRFTR_CENTER_COLOR \\$1
16673 .END
16674 \#
16675 .MAC HEADER_CENTER_COLOUR END
16676 .    HDRFTR_CENTER_COLOR \\$1
16677 .END
16678 \#
16679 .MAC HEADER_CENTER_FAM END
16680 .    HDRFTR_CENTER_FAMILY \\$1
16681 .END
16682 \#
16683 .MAC HEADER_CENTER_FAMILY END
16684 .    HDRFTR_CENTER_FAMILY \\$1
16685 .END
16686 \#
16687 .MAC HEADER_CENTER_FONT END
16688 .    HDRFTR_CENTER_FONT \\$1
16689 .END
16690 \#
16691 .MAC HEADER_CENTER_FT END
16692 .    HDRFTR_CENTER_FONT \\$1
16693 .END
16694 \#
16695 .MAC HEADER_CENTER_PS END
16696 .    HDRFTR_CENTER_SIZE \\$1
16697 .END
16698 \#
16699 .MAC HEADER_CENTER_SIZE END
16700 .    HDRFTR_CENTER_SIZE \\$1
16701 .END
16702 \#
16703 .MAC HEADER_CENTRE_COLOR END
16704 .    HDRFTR_CENTRE_COLOR \\$1
16705 .END
16706 \#
16707 .MAC HEADER_CENTRE_COLOUR END
16708 .    HDRFTR_CENTRE_COLOR \\$1
16709 .END
16710 \#
16711 .MAC HEADER_CENTRE_FAM END
16712 .    HDRFTR_CENTER_FAMILY \\$1
16713 .END
16714 \#
16715 .MAC HEADER_CENTRE_FAMILY END
16716 .    HDRFTR_CENTER_FAMILY \\$1
16717 .END
16718 \#
16719 .MAC HEADER_CENTRE_FONT END
16720 .    HDRFTR_CENTER_FONT \\$1
16721 .END
16722 \#
16723 .MAC HEADER_CENTRE_FT END
16724 .    HDRFTR_CENTER_FONT \\$1
16725 .END
16726 \#
16727 .MAC HEADER_CENTRE_PS END
16728 .    HDRFTR_CENTER_SIZE \\$1
16729 .END
16730 \#
16731 .MAC HEADER_CENTRE_SIZE END
16732 .    HDRFTR_CENTER_SIZE \\$1
16733 .END
16734 \#
16735 .MAC HEADER_COLOR END
16736 .    HDRFTR_COLOR \\$1
16737 .END
16738 \#
16739 .MAC HEADER_COLOUR END
16740 .    HDRFTR_COLOR \\$1
16741 .END
16742 \#
16743 .MAC HEADER_FAM END
16744 .    HDRFTR_FAMILY \\$1
16745 .END
16746 \#
16747 .MAC HEADER_FAMILY END
16748 .    HDRFTR_FAMILY \\$1
16749 .END
16750 \#
16751 .MAC HEADER_LEFT_COLOR END
16752 .    HDRFTR_LEFT_COLOR \\$1
16753 .END
16754 \#
16755 .MAC HEADER_LEFT_COLOUR END
16756 .    HDRFTR_LEFT_COLOR \\$1
16757 .END
16758 \#
16759 .MAC HEADER_LEFT_FAM END
16760 .    HDRFTR_LEFT_FAMILY \\$1
16761 .END
16762 \#
16763 .MAC HEADER_LEFT_FAMILY END
16764 .    HDRFTR_LEFT_FAMILY \\$1
16765 .END
16766 \#
16767 .MAC HEADER_LEFT_FONT END
16768 .    HDRFTR_LEFT_FONT \\$1
16769 .END
16770 \#
16771 .MAC HEADER_LEFT_FT END
16772 .    HDRFTR_LEFT_FONT \\$1
16773 .END
16774 \#
16775 .MAC HEADER_LEFT_PS END
16776 .    HDRFTR_LEFT_SIZE \\$1
16777 .END
16778 \#
16779 .MAC HEADER_LEFT_SIZE END
16780 .    HDRFTR_LEFT_SIZE \\$1
16781 .END
16782 \#
16783 .MAC HEADER_RIGHT_COLOR END
16784 .    HDRFTR_RIGHT_COLOR \\$1
16785 .END
16786 \#
16787 .MAC HEADER_RIGHT_COLOUR END
16788 .    HDRFTR_RIGHT_COLOR \\$1
16789 .END
16790 \#
16791 .MAC HEADER_RIGHT_FAM END
16792 .    HDRFTR_RIGHT_FAMILY \\$1
16793 .END
16794 \#
16795 .MAC HEADER_RIGHT_FAMILY END
16796 .    HDRFTR_RIGHT_FAMILY \\$1
16797 .END
16798 \#
16799 .MAC HEADER_RIGHT_FONT END
16800 .    HDRFTR_RIGHT_FONT \\$1
16801 .END
16802 \#
16803 .MAC HEADER_RIGHT_FT END
16804 .    HDRFTR_RIGHT_FONT \\$1
16805 .END
16806 \#
16807 .MAC HEADER_RIGHT_PS END
16808 .    HDRFTR_RIGHT_SIZE \\$1
16809 .END
16810 \#
16811 .MAC HEADER_RIGHT_SIZE END
16812 .    HDRFTR_RIGHT_SIZE \\$1
16813 .END
16814 \#
16815 .MAC HEADER_RULE_COLOR END
16816 .    HDRFTR_RULE_COLOR \\$1
16817 .END
16818 \#
16819 .MAC HEADER_SIZE END
16820 .    HDRFTR_SIZE \\$1
16821 .END
16822 \#
16823 \# HEADER and FOOTER aliases for HDRFTR macros.
16824 \#
16825 .ALIAS   BIBLIOGRAPHY_FOOTER_CENTER    BIBLIOGRAPHY_HDRFTR_CENTER
16826 .ALIAS   BIBLIOGRAPHY_FOOTER_CENTRE    BIBLIOGRAPHY_HDRFTR_CENTRE
16827 .ALIAS   BIBLIOGRAPHY_HEADER_CENTER    BIBLIOGRAPHY_HDRFTR_CENTER
16828 .ALIAS   BIBLIOGRAPHY_HEADER_CENTRE    BIBLIOGRAPHY_HDRFTR_CENTRE
16829 .ALIAS   ENDNOTES_FOOTER_CENTER    ENDNOTES_HDRFTR_CENTER
16830 .ALIAS   ENDNOTES_FOOTER_CENTRE    ENDNOTES_HDRFTR_CENTRE
16831 .ALIAS   ENDNOTES_HEADER_CENTER    ENDNOTES_HDRFTR_CENTER
16832 .ALIAS   ENDNOTES_HEADER_CENTRE    ENDNOTES_HDRFTR_CENTRE
16833 .ALIAS   FOOTER_CENTER_CAPS        HDRFTR_CENTER_CAPS
16834 .ALIAS   FOOTER_CENTER             HDRFTR_CENTER
16835 .ALIAS   FOOTER_CENTER_PAD         HDRFTR_CENTER_PAD
16836 .ALIAS   FOOTER_CENTRE             HDRFTR_CENTER
16837 .ALIAS   FOOTER_CENTRE_PAD         HDRFTR_CENTER_PAD
16838 .ALIAS   FOOTER_LEFT_CAPS          HDRFTR_LEFT_CAPS
16839 .ALIAS   FOOTER_LEFT               HDRFTR_LEFT
16840 .ALIAS   FOOTER_PLAIN              HDRFTR_PLAIN
16841 .ALIAS   FOOTER_RECTO              HDRFTR_RECTO
16842 .ALIAS   FOOTER_RIGHT_CAPS         HDRFTR_RIGHT_CAPS
16843 .ALIAS   FOOTER_RIGHT              HDRFTR_RIGHT
16844 .ALIAS   FOOTER_RULE_GAP           HDRFTR_RULE_GAP
16845 .ALIAS   FOOTER_RULE               HDRFTR_RULE
16846 .ALIAS   FOOTER_VERSO              HDRFTR_VERSO
16847 .ALIAS   HEADER_CENTER_CAPS        HDRFTR_CENTER_CAPS
16848 .ALIAS   HEADER_CENTER             HDRFTR_CENTER
16849 .ALIAS   HEADER_CENTER_PAD         HDRFTR_CENTER_PAD
16850 .ALIAS   HEADER_CENTRE_CAPS        HDRFTR_CENTER_CAPS
16851 .ALIAS   HEADER_CENTRE             HDRFTR_CENTER
16852 .ALIAS   HEADER_CENTRE_PAD         HDRFTR_CENTER_PAD
16853 .ALIAS   HEADER_LEFT_CAPS          HDRFTR_LEFT_CAPS
16854 .ALIAS   HEADER_LEFT               HDRFTR_LEFT
16855 .ALIAS   HEADER_PLAIN              HDRFTR_PLAIN
16856 .ALIAS   HEADER_RECTO              HDRFTR_RECTO
16857 .ALIAS   HEADER_RIGHT_CAPS         HDRFTR_RIGHT_CAPS
16858 .ALIAS   HEADER_RIGHT              HDRFTR_RIGHT
16859 .ALIAS   HEADER_RULE_GAP           HDRFTR_RULE_GAP
16860 .ALIAS   HEADER_RULE               HDRFTR_RULE
16861 .ALIAS   HEADER_VERSO              HDRFTR_VERSO
16862 .ALIAS   SWITCH_FOOTERS            SWITCH_HDRFTR
16863 .ALIAS   SWITCH_HEADERS            SWITCH_HDRFTR
16864 \#
16865 \# Type-style aliases
16866 \#
16867 .ALIAS   AUTHOR_FAMILY                    _FAMILY
16868 .ALIAS   BIBLIOGRAPHY_FAMILY              _FAMILY
16869 .ALIAS   BIBLIOGRAPHY_STRING_FAMILY       _FAMILY
16870 .ALIAS   BLOCKQUOTE_FAMILY                _FAMILY
16871 .ALIAS   CHAPTER_TITLE_FAMILY             _FAMILY
16872 .ALIAS   COVER_AUTHOR_FAMILY              _FAMILY
16873 .ALIAS   COVER_CHAPTER_TITLE_FAMILY       _FAMILY
16874 .ALIAS   COVER_COPYRIGHT_FAMILY           _FAMILY
16875 .ALIAS   COVER_DOCTYPE_FAMILY             _FAMILY
16876 .ALIAS   COVER_FAMILY                     _FAMILY
16877 .ALIAS   COVER_MISC_FAMILY                _FAMILY
16878 .ALIAS   COVER_SUBTITLE_FAMILY            _FAMILY
16879 .ALIAS   COVER_TITLE_FAMILY               _FAMILY
16880 .ALIAS   DOC_COVER_AUTHOR_FAMILY          _FAMILY
16881 .ALIAS   DOC_COVER_CHAPTER_TITLE_FAMILY   _FAMILY
16882 .ALIAS   DOC_COVER_COPYRIGHT_FAMILY       _FAMILY
16883 .ALIAS   DOC_COVER_DOCTYPE_FAMILY         _FAMILY
16884 .ALIAS   DOC_COVER_FAMILY                 _FAMILY
16885 .ALIAS   DOC_COVER_MISC_FAMILY            _FAMILY
16886 .ALIAS   DOC_COVER_SUBTITLE_FAMILY        _FAMILY
16887 .ALIAS   DOC_COVER_TITLE_FAMILY           _FAMILY
16888 .ALIAS   DOCHEADER_FAMILY                 _FAMILY
16889 .ALIAS   DOCTYPE_FAMILY                   _FAMILY
16890 .ALIAS   ENDNOTE_FAMILY                   _FAMILY
16891 .ALIAS   ENDNOTE_NUMBER_FAMILY            _FAMILY
16892 .ALIAS   ENDNOTE_LINENUMBER_FAMILY        _FAMILY
16893 .ALIAS   ENDNOTE_STRING_FAMILY            _FAMILY
16894 .ALIAS   ENDNOTE_TITLE_FAMILY             _FAMILY
16895 .ALIAS   EPIGRAPH_FAMILY                  _FAMILY
16896 .ALIAS   FOOTNOTE_FAMILY                  _FAMILY
16897 .ALIAS   HDRFTR_CENTER_FAMILY             _FAMILY
16898 .ALIAS   HDRFTR_FAMILY                    _FAMILY
16899 .ALIAS   HDRFTR_LEFT_FAMILY               _FAMILY
16900 .ALIAS   HDRFTR_RIGHT_FAMILY              _FAMILY
16901 .ALIAS   LINENUMBER_FAMILY                _FAMILY
16902 .ALIAS   PAGENUM_FAMILY                   _FAMILY
16903 .ALIAS   QUOTE_FAMILY                     _FAMILY
16904 .ALIAS   SUBTITLE_FAMILY                  _FAMILY
16905 .ALIAS   TITLE_FAMILY                     _FAMILY
16906 .ALIAS   TOC_FAM                          _FAMILY
16907 .ALIAS   TOC_FAMILY                       _FAMILY
16908 .ALIAS   TOC_HEADER_FAMILY                _FAMILY
16909 .ALIAS   TOC_PN_FAMILY                    _FAMILY
16910 \#
16911 .ALIAS   AUTHOR_FONT                    _FONT
16912 .ALIAS   BIBLIOGRAPHY_STRING_FONT       _FONT
16913 .ALIAS   BIBLIOGRAPHY_FONT              _FONT
16914 .ALIAS   BLOCKQUOTE_FONT                _FONT
16915 .ALIAS   CHAPTER_TITLE_FONT             _FONT
16916 .ALIAS   COVER_AUTHOR_FONT              _FONT
16917 .ALIAS   COVER_CHAPTER_TITLE_FONT       _FONT
16918 .ALIAS   COVER_COPYRIGHT_FONT           _FONT
16919 .ALIAS   COVER_DOCTYPE_FONT             _FONT
16920 .ALIAS   COVER_MISC_FONT                _FONT
16921 .ALIAS   COVER_SUBTITLE_FONT            _FONT
16922 .ALIAS   COVER_TITLE_FONT               _FONT
16923 .ALIAS   DOC_COVER_AUTHOR_FONT          _FONT
16924 .ALIAS   DOC_COVER_CHAPTER_TITLE_FONT   _FONT
16925 .ALIAS   DOC_COVER_COPYRIGHT_FONT       _FONT
16926 .ALIAS   DOC_COVER_DOCTYPE_FONT         _FONT
16927 .ALIAS   DOC_COVER_MISC_FONT            _FONT
16928 .ALIAS   DOC_COVER_SUBTITLE_FONT        _FONT
16929 .ALIAS   DOC_COVER_TITLE_FONT           _FONT
16930 .ALIAS   DOCTYPE_FONT                   _FONT
16931 .ALIAS   ENDNOTE_FONT                   _FONT
16932 .ALIAS   ENDNOTE_NUMBER_FONT            _FONT
16933 .ALIAS   ENDNOTE_LINENUMBER_FONT        _FONT
16934 .ALIAS   ENDNOTE_STRING_FONT            _FONT
16935 .ALIAS   ENDNOTE_TITLE_FONT             _FONT
16936 .ALIAS   EPIGRAPH_FONT                  _FONT
16937 .ALIAS   FOOTNOTE_FONT                  _FONT
16938 .ALIAS   HDRFTR_CENTER_FONT             _FONT
16939 .ALIAS   HDRFTR_LEFT_FONT               _FONT
16940 .ALIAS   HDRFTR_RIGHT_FONT              _FONT
16941 .ALIAS   LINENUMBER_FONT                _FONT
16942 .ALIAS   PAGENUM_FONT                   _FONT
16943 .ALIAS   QUOTE_FONT                     _FONT
16944 .ALIAS   SUBTITLE_FONT                  _FONT
16945 .ALIAS   TITLE_FONT                     _FONT
16946 .ALIAS   TOC_HEADER_FONT                _FONT
16947 .ALIAS   TOC_PN_FONT                    _FONT
16948 \#
16949 .ALIAS   AUTHOR_SIZE                    _SIZE
16950 .ALIAS   BIBLIOGRAPHY_STRING_SIZE       _SIZE
16951 .ALIAS   BLOCKQUOTE_SIZE                _SIZE
16952 .ALIAS   CHAPTER_TITLE_SIZE             _SIZE
16953 .ALIAS   COVER_AUTHOR_SIZE              _SIZE
16954 .ALIAS   COVER_CHAPTER_TITLE_SIZE       _SIZE
16955 .ALIAS   COVER_COPYRIGHT_SIZE           _SIZE
16956 .ALIAS   COVER_DOCTYPE_SIZE             _SIZE
16957 .ALIAS   COVER_MISC_SIZE                _SIZE
16958 .ALIAS   COVER_SUBTITLE_SIZE            _SIZE
16959 .ALIAS   COVER_TITLE_SIZE               _SIZE
16960 .ALIAS   DOC_COVER_AUTHOR_SIZE          _SIZE
16961 .ALIAS   DOC_COVER_CHAPTER_TITLE_SIZE   _SIZE
16962 .ALIAS   DOC_COVER_COPYRIGHT_SIZE       _SIZE
16963 .ALIAS   DOC_COVER_DOCTYPE_SIZE         _SIZE
16964 .ALIAS   DOC_COVER_MISC_SIZE            _SIZE
16965 .ALIAS   DOC_COVER_SUBTITLE_SIZE        _SIZE
16966 .ALIAS   DOC_COVER_TITLE_SIZE           _SIZE
16967 .ALIAS   DOCTYPE_SIZE                   _SIZE
16968 .ALIAS   ENDNOTE_NUMBER_SIZE            _SIZE
16969 .ALIAS   ENDNOTE_LINENUMBER_SIZE        _SIZE
16970 .ALIAS   ENDNOTE_STRING_SIZE            _SIZE
16971 .ALIAS   ENDNOTE_TITLE_SIZE             _SIZE
16972 .ALIAS   EPIGRAPH_SIZE                  _SIZE
16973 .ALIAS   FOOTNOTE_SIZE                  _SIZE
16974 .ALIAS   HDRFTR_CENTER_SIZE             _SIZE
16975 .ALIAS   HDRFTR_LEFT_SIZE               _SIZE
16976 .ALIAS   HDRFTR_RIGHT_SIZE              _SIZE
16977 .ALIAS   HDRFTR_SIZE                    _SIZE
16978 .ALIAS   LINENUMBER_SIZE                _SIZE
16979 .ALIAS   PAGENUM_SIZE                   _SIZE
16980 .ALIAS   QUOTE_SIZE                     _SIZE
16981 .ALIAS   SUBTITLE_SIZE                  _SIZE
16982 .ALIAS   TITLE_SIZE                     _SIZE
16983 .ALIAS   TOC_HEADER_SIZE                _SIZE
16984 .ALIAS   TOC_PN_SIZE                    _SIZE
16985 \#
16986 .ALIAS   ATTRIBUTE_COLOR                 _COLOR
16987 .ALIAS   AUTHOR_COLOR                    _COLOR
16988 .ALIAS   BLOCKQUOTE_COLOR                _COLOR
16989 .ALIAS   CHAPTER_TITLE_COLOR             _COLOR
16990 .ALIAS   CODE_COLOR                      _COLOR
16991 .ALIAS   COVER_ATTRIBUTE_COLOR           _COLOR
16992 .ALIAS   COVER_AUTHOR_COLOR              _COLOR
16993 .ALIAS   COVER_CHAPTER_TITLE_COLOR       _COLOR
16994 .ALIAS   COVER_COLOR                     _COLOR
16995 .ALIAS   COVER_COPYRIGHT_COLOR           _COLOR
16996 .ALIAS   COVER_DOCTYPE_COLOR             _COLOR
16997 .ALIAS   COVER_MISC_COLOR                _COLOR
16998 .ALIAS   COVER_SUBTITLE_COLOR            _COLOR
16999 .ALIAS   COVER_TITLE_COLOR               _COLOR
17000 .ALIAS   DOC_COVER_ATTRIBUTE_COLOR       _COLOR
17001 .ALIAS   DOC_COVER_AUTHOR_COLOR          _COLOR
17002 .ALIAS   DOC_COVER_CHAPTER_TITLE_COLOR   _COLOR
17003 .ALIAS   DOC_COVER_COLOR                 _COLOR
17004 .ALIAS   DOC_COVER_COPYRIGHT_COLOR       _COLOR
17005 .ALIAS   DOC_COVER_DOCTYPE_COLOR         _COLOR
17006 .ALIAS   DOC_COVER_MISC_COLOR            _COLOR
17007 .ALIAS   DOC_COVER_SUBTITLE_COLOR        _COLOR
17008 .ALIAS   DOC_COVER_TITLE_COLOR           _COLOR
17009 .ALIAS   DOCHEADER_COLOR                 _COLOR
17010 .ALIAS   DOCTYPE_COLOR                   _COLOR
17011 .ALIAS   ENDNOTE_STRING_COLOR            _COLOR
17012 .ALIAS   EPIGRAPH_COLOR                  _COLOR
17013 .ALIAS   FINIS_COLOR                     _COLOR
17014 .ALIAS   FOOTNOTE_COLOR                  _COLOR
17015 .ALIAS   HDRFTR_CENTER_COLOR             _COLOR
17016 .ALIAS   HDRFTR_COLOR                    _COLOR
17017 .ALIAS   HDRFTR_LEFT_COLOR               _COLOR
17018 .ALIAS   HDRFTR_RIGHT_COLOR              _COLOR
17019 .ALIAS   HDRFTR_RULE_COLOR               _COLOR
17020 .ALIAS   LINEBREAK_COLOR                 _COLOR
17021 .ALIAS   LINENUMBER_COLOR                _COLOR
17022 .ALIAS   PAGENUM_COLOR                   _COLOR
17023 .ALIAS   QUOTE_COLOR                     _COLOR
17024 .ALIAS   SECTION_COLOR                   _COLOR
17025 .ALIAS   SUBTITLE_COLOR                  _COLOR
17026 .ALIAS   TITLE_COLOR                     _COLOR
17027 \#
17028 .ALIAS   BIBLIOGRAPHY_QUAD          _QUAD
17029 .ALIAS   BIBLIOGRAPHY_STRING_QUAD   _QUAD
17030 .ALIAS   BLOCKQUOTE_QUAD            _QUAD
17031 .ALIAS   COVER_COPYRIGHT_QUAD       _QUAD
17032 .ALIAS   COVER_MISC_QUAD            _QUAD
17033 .ALIAS   COVER_QUAD                 _QUAD
17034 .ALIAS   DOC_COVER_COPYRIGHT_QUAD   _QUAD
17035 .ALIAS   DOC_COVER_MISC_QUAD        _QUAD
17036 .ALIAS   DOC_COVER_QUAD             _QUAD
17037 .ALIAS   DOCHEADER_QUAD             _QUAD
17038 .ALIAS   DOC_QUAD                   _QUAD
17039 .ALIAS   ENDNOTE_QUAD               _QUAD
17040 .ALIAS   ENDNOTE_STRING_QUAD        _QUAD
17041 .ALIAS   ENDNOTE_TITLE_QUAD         _QUAD
17042 .ALIAS   EPIGRAPH_QUAD              _QUAD
17043 .ALIAS   FOOTNOTE_QUAD              _QUAD
17044 .ALIAS   TOC_HEADER_QUAD            _QUAD
17045 \#
17046 \# Support aliases
17047 \#
17048 .ALIAS   COL_BREAK               COL_NEXT
17049 .ALIAS   DOC_COVER_ADVANCE       COVER_ADVANCE
17050 .ALIAS   DOC_COVER               COVER
17051 .ALIAS   DOC_COVER_COUNTS_PAGES  COVER_COUNTS_PAGES
17052 .ALIAS   DOC_COVERS              COVERS
17053 .ALIAS   DOC_COVER_LEAD          COVER_LEAD
17054 .ALIAS   DOC_COVERTITLE          COVERTITLE
17055 .ALIAS   DO_DOC_COVER            DO_COVER
17056 .ALIAS   PRINT_FOOTNOTE_RULE     FOOTNOTE_RULE
17057 \#
17058 \# Miscellaneous aliases
17059 .ALIAS   SECTION        LINEBREAK
17060 .ALIAS   SECTION_CHAR   LINEBREAK_CHAR
17061 \#
17062 \# Miscellaneous macros to take care of backward compatibility
17063 \# -----------------------------------------------------------
17064 \#
17065 \# As of 1.1.9, EL and TN got changed to make TRAP...TRAP OFF
17066 \# unnecessary for users.  However, I used both macros extensively
17067 \# throughout this file (in conjunction with TRAP...TRAP OFF).
17068 \# EOL is the old EL; used only in om.tmac.
17069 \#
17070 .MAC EOL END
17071 .    if \\n[.vpt] \{\
17072 .       vpt 0
17073 .       nr #RESTORE_TRAP 1
17074 .    \}
17075 .    br
17076 .    sp -1v
17077 .    if \\n[#RESTORE_TRAP] \{\
17078 .       vpt
17079 .       rr #RESTORE_TRAP
17080 .    \}
17081 .END
17082 \#
17083 \#
17084 \# PREPROCESSOR SUPPORT
17085 \# ====================
17086 \#
17087 \# Utility macros--label and caption styles, lists collector, lists
17088 \# generator.
17089 \#
17090 .nr lists*target 0 1
17091 .
17092 .MAC get-label-type END
17093 .    if \\n[all]=1 .ds label-type eqn
17094 .    if \\n[all]=2 .ds label-type pdf-img
17095 .    if \\n[all]=3 .ds label-type pic
17096 .    if \\n[all]=4 .ds label-type tbl
17097 .END
17098 \#
17099 .MAC set-defaults END
17100 .    if '\\*[\\*[label-type]*\\*[spec-type]-family]'' \
17101 .       ds \\*[label-type]*\\*[spec-type]-family \\*[$DOC_FAM]\"
17102 .    if '\\*[\\*[label-type]*\\*[spec-type]-font]'' \
17103 .       ds \\*[label-type]*\\*[spec-type]-font R\"
17104 .    if '\\*[\\*[label-type]*\\*[spec-type]-size-change]'' \
17105 .       ds \\*[label-type]*\\*[spec-type]-size-change +0\"
17106 .    if !r \\*[label-type]*\\*[spec-type]-autolead \
17107 .       nr \\*[label-type]*\\*[spec-type]-autolead 2
17108 .    if '\\*[\\*[label-type]*\\*[spec-type]-color]'' \
17109 .       ds \\*[label-type]*\\*[spec-type]-color black\"
17110 .    if '\\*[\\*[label-type]*\\*[spec-type]-quad]'' \{\
17111 .       ie '\\*[label-type]'eqn' \{\
17112 .          if '\\*[spec-type]'caption' \
17113 .             ds \\*[label-type]*\\*[spec-type]-quad C\"
17114 .       \}
17115 .       el .ds \\*[label-type]*\\*[spec-type]-quad L\"
17116 .    \}
17117 .    if '\\n[\\*[label-type]*\\*[spec-type]-quad-on-ll]'' \
17118 .       nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
17119 .    if '\\*[spec-type]'caption' \{\
17120 .       nr default-left 1
17121 .    \}
17122 .END
17123 \#
17124 .MAC set-inline-specs END
17125 .    ds \\*[label-type]*\\*[spec-type]-specs \
17126 \f[\\*[\\*[label-type]*\\*[spec-type]-family]\\*[\\*[label-type]*\\*[spec-type]-font]]\
17127 \s[\\*[\\*[label-type]*\\*[spec-type]-size-change]]\
17128 \m[\\*[\\*[label-type]*\\*[spec-type]-color]]
17129 .END
17130 \#
17131 \# Line lengths, indents, and quads for captions and labels.
17132 \# Aliased for eqn, pic, pdf-image, and tbl.
17133 \#
17134 .MAC SET_QUAD END
17135 .    ds label-type \\$0
17136 .    substring label-type 0 2
17137 .    if '\\*[label-type]'PDF'  .ds label-type pdf-img
17138 .    if '\\*[label-type]'TBL'  .ds label-type tbl
17139 .    if '\\*[label-type]'PIC'  .ds label-type pic
17140 .    if '\\*[label-type]'EQN'  .ds label-type eqn
17141 .    ds spec-type \\$0
17142 .    substring spec-type -6 -10
17143 .    if '\\*[spec-type]'PTION' .ds spec-type caption
17144 .    if '\\*[spec-type]'LABEL' .ds spec-type label
17145 .    if '\\*[spec-type]'OURCE' .ds spec-type source
17146 .    QUAD \\$1
17147 .    ds \\*[label-type]*\\*[spec-type]-quad \\$1
17148 .    substring \\*[label-type]*\\*[spec-type]-quad 0 0
17149 .    if '\\*[label-type]'pdf-img' \{\
17150 .       if '\\*[\\*[label-type]*\\*[spec-type]-quad]'L' \{\
17151 .          if !\\n[pdf-img*\\*[spec-type]-quad-on-ll] \{\
17152 .             ie !'\\*[pdf-img:pos]'-R' \
17153 .                ll \\n[pdf-img:ind]u+\\n[pdf-img:width]u+\\n[pdf-img:frame-inset]u
17154 .             el .ll -\\n[ind-pre-img]u
17155 .             if '\\*[pdf-img:pos]'-C' \
17156 .                in \\n[pdf-img:ind]u-\\n[pdf-img:frame-inset]u
17157 .             if '\\*[pdf-img:pos]'-R' \
17158 .                in \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u))
17159 .             if '\\*[pdf-img:pos]'-I' \
17160 .                in \\n[pdf-img:ind]u
17161 .          \}
17162 .       \}
17163 .       if '\\*[\\*[label-type]*\\*[spec-type]-quad]'C' \{\
17164 .          if !\\n[pdf-img*\\*[spec-type]-quad-on-ll] \{\
17165 .             if '\\*[pdf-img:pos]'-L' \
17166 .                ll \\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)
17167 .             if '\\*[pdf-img:pos]'-C' \{\
17168 .                ll (\\n[ll-pre-img]u-\\n[pdf-img:width]u/2u+(\\n[pdf-img:frame-inset]u))+\\n[pdf-img:width]u
17169 .                in \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u))
17170 .             \}
17171 .             if '\\*[pdf-img:pos]'-R' \{\
17172 .                ll -\\n[ind-pre-img]u
17173 .                in \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u))
17174 .             \}
17175 .             if '\\*[pdf-img:pos]'-I' \{\
17176 .                ll \\n[pdf-img:ind]u+\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)
17177 .                in \\n[pdf-img:ind]u
17178 .             \}
17179 .          \}
17180 .       \}
17181 .       if '\\*[\\*[label-type]*\\*[spec-type]-quad]'R' \{\
17182 .          if !\\n[pdf-img*\\*[spec-type]-quad-on-ll] \{\
17183 .             if '\\*[pdf-img:pos]'-L' \
17184 .                ll \\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u]
17185 .             if '\\*[pdf-img:pos]'-C' \{\
17186 .                ll (\\n[.l]u-\\n[ind-pre-img]u-\\n[pdf-img:width]u/2u)+\\n[pdf-img:width]u+\\n[pdf-img:frame-inset]u
17187 .                in \\n[pdf-img:ind]u
17188 .             \}
17189 .             if '\\*[pdf-img:pos]'-R' \{\
17190 .                ll -\\n[ind-pre-img]u
17191 .                in \\n[.l]u-\\n[pdf-img:width]u
17192 .             \}
17193 .             if '\\*[pdf-img:pos]'-I' \{\
17194 .                ll \\n[pdf-img:ind]u+\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)
17195 .                in \\n[pdf-img:ind]u
17196 .             \}   
17197 .          \}
17198 .       \}
17199 .    \}
17200 .    if '\\*[label-type]'pic' \{\
17201 .       if !\\n[pic*\\*[spec-type]-quad-on-ll] \{\
17202 .          ie \\n[pic*left] .ll \\n[pic*div-width]u
17203 .          el \{\
17204 .             ll \\n[pic*div-width]u
17205 \!.           in \\n[ll-pre-pic]u-\\n[pic*div-width]u/2u
17206 .          \}
17207 .       \}
17208 .    \}
17209 .    if '\\*[label-type]'tbl' \{\
17210 .       if !\\n[tbl*\\*[spec-type]-quad-on-ll] \{\
17211 .          ie \\n[tbl*center] \{\
17212 .             ie '\\*[spec-type]'label' \{\
17213 .                ll \\n[ll-pre-tbl]u-\\n[TW]u/2u+\\n[TW]u
17214 \!.                in \\n[ll-pre-tbl]u-\\n[TW]u/2u
17215 .             \}
17216 .             el \{\
17217 .                ll \\n[TW]u
17218 \!.              in \\n[ll-pre-tbl]u-\\n[TW]u/2u
17219 .             \}
17220 .          \}
17221 .          el .ll \\n[TW]u
17222 .       \}
17223 .    \}
17224 .END
17225 \#
17226 .ALIAS TBL*SET_CAPTION_QUAD     SET_QUAD
17227 .ALIAS TBL*SET_LABEL_QUAD       SET_QUAD
17228 .ALIAS TBL*SET_SOURCE_QUAD      SET_QUAD
17229 .ALIAS PDF_IMG*SET_CAPTION_QUAD SET_QUAD
17230 .ALIAS PDF_IMG*SET_LABEL_QUAD   SET_QUAD
17231 .ALIAS PIC*SET_CAPTION_QUAD     SET_QUAD
17232 .ALIAS PIC*SET_LABEL_QUAD       SET_QUAD
17233 \#
17234 .MAC style END
17235 .    ds label-type \\$0
17236 .    substring label-type 0 2
17237 .    if '\\*[label-type]'img' .ds label-type pdf-img
17238 .    if '\\*[label-type]'tbl' .ds label-type tbl
17239 .    if '\\*[label-type]'pic' .ds label-type pic
17240 .    ds spec-type \\$0
17241 .    substring spec-type 4 6
17242 .    if '\\*[spec-type]'cap' .ds spec-type caption
17243 .    if '\\*[spec-type]'lab' .ds spec-type label
17244 .    if '\\*[spec-type]'sou' .ds spec-type source
17245 .    fam \\*[\\*[label-type]*\\*[spec-type]-family]
17246 .    ft \\*[\\*[label-type]*\\*[spec-type]-font]
17247 .    ps \\n[#DOC_PT_SIZE]u\\*[\\*[label-type]*\\*[spec-type]-size-change]
17248 .    gcolor \\*[\\*[label-type]*\\*[spec-type]-color]
17249 .END
17250 \#
17251 .ALIAS tbl*caption-style style
17252 .ALIAS tbl*label-style   style
17253 .ALIAS tbl*source-style  style
17254 .ALIAS img*caption-style style
17255 .ALIAS img*label-style   style
17256 .ALIAS img*source-style  style
17257 .ALIAS pic*caption-style style
17258 .ALIAS pic*label-style   style
17259 .ALIAS pic*source-style  style
17260 \#
17261 \# User style macros
17262 \#
17263 \# TYPE SPECS FOR LABELS, CAPTIONS, AND SOURCES
17264 \# --------------------------------------------
17265 \#  Aliased as CAPTIONS and LABELS for eqn, pic, tbl, and pdf images.
17266 \# *Arguments:
17267 \#   EQN | IMG | PIC | TBL \
17268 \#   Remaining arguments are optional
17269 \#   FAMILY fam \
17270 \#   FONT   sty \
17271 \#   SIZE   +|-size \
17272 \#   QUAD   LEFT | CENTRE | RIGHT [ ON_LL ] \
17273 \#   COLOR  color \
17274 \#   AUTOLEAD n \
17275 \#   ADJUST   +|-n
17276 \# *Function:
17277 \#   Sets type specs for captions, labels, and sources according to
17278 \#   calling alias name
17279 \# *Notes:
17280 \#   SIZE is relative to running text.
17281 \#   QUAD optional arg says quad on full line length rather than
17282 \#    pdf-img or pre-processor output.  
17283 \#
17284 .MAC CAPTION_LABEL_SPECS END
17285 .    if '\\$0'CAPTIONS' .ds spec-type caption
17286 .    if '\\$0'LABELS'   .ds spec-type label
17287 .    if '\\$0'SOURCES'  .ds spec-type source
17288 .    if '\\$1'EQN' .ds label-type eqn
17289 .    if '\\$1'IMG' .ds label-type pdf-img
17290 .    if '\\$1'PIC' .ds label-type pic
17291 .    if '\\$1'TBL' .ds label-type tbl
17292 .    if '\\$1'ALL' .nr all 1
17293 .    shift
17294 .    nr loop-counter \\n[#NUM_ARGS]
17295 .    nr loop-count 0 1
17296 .    while \\n+[loop-count]<=\\n[loop-counter] \{\
17297 .       if '\\$1'FAMILY' \{\
17298 .          shift
17299 .          ie r all \{\
17300 .             nr all 0 1
17301 .             while \\n+[all]<=4 \{\
17302 .                 get-label-type
17303 .                 ds \\*[label-type]*\\*[spec-type]-family \\$1
17304 .             \}
17305 .          \}
17306 .          el .ds \\*[label-type]*\\*[spec-type]-family \\$1
17307 .          if \\n[#PRINT_STYLE]=1 \
17308 .             ds \\*[label-type]*\\*[spec-type]-family \\*[$TYPEWRITER_FAM]
17309 .          shift
17310 .       \}
17311 .       if '\\$1'FONT' \{\
17312 .          shift
17313 .          ie r all \{\
17314 .             nr all 0 1
17315 .             while \\n+[all]<=4 \{\
17316 .                 get-label-type
17317 .                 ds \\*[label-type]*\\*[spec-type]-font \\$1
17318 .             \}
17319 .          \}
17320 .          el .ds \\*[label-type]*\\*[spec-type]-font \\$1
17321 .          if \\n[#PRINT_STYLE]=1 \
17322 .             ds \\*[label-type]*\\*[spec-type]-font R
17323 .          shift
17324 .       \}
17325 .       if '\\$1'SIZE' \{\
17326 .          shift
17327 .          ie r all \{\
17328 .             nr all 0 1
17329 .             while \\n+[all]<=4 \{\
17330 .                 get-label-type
17331 .                 ds \\*[label-type]*\\*[spec-type]-size-change \\$1
17332 .             \}
17333 .          \}
17334 .          el .ds \\*[label-type]*\\*[spec-type]-size-change \\$1
17335 .          if \\n[#PRINT_STYLE]=1 \
17336 .             ds \\*[label-type]*\\*[spec-type]-size-change +0
17337 .          shift
17338 .       \}
17339 .       if '\\$1'AUTOLEAD' \{\
17340 .          shift
17341 .          ie r all \{\
17342 .             nr all 0 1
17343 .             while \\n+[all]<=4 \{\
17344 .                 get-label-type
17345 .                 nr \\*[label-type]*\\*[spec-type]-autolead (p;\\$1)
17346 .             \}
17347 .          \}
17348 .          el .nr \\*[label-type]*\\*[spec-type]-autolead (p;\\$1)
17349 .          shift
17350 .       \}
17351 .       if '\\$1'QUAD' \{\
17352 .          shift
17353 .          ie r all \{\
17354 .             nr all 0 1
17355 .             while \\n+[all]<=4 \{\
17356 .                 get-label-type
17357 .                 ds \\*[label-type]*\\*[spec-type]-quad \\$1
17358 .                 substring \\*[label-type]*\\*[spec-type]-quad 0 0
17359 .             \}
17360 .          \}
17361 .          el \{\
17362 .             ds \\*[label-type]*\\*[spec-type]-quad \\$1
17363 .             substring \\*[label-type]*\\*[spec-type]-quad 0 0
17364 .             if \\n[\\*[label-type]*\\*[spec-type]-quad-on-ll] \
17365 .                rr \\*[label-type]*\\*[spec-type]-quad-on-ll 
17366 .          \}
17367 .          shift
17368 .          if '\\$1'ON_LL' \{\
17369 .             nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
17370 .             shift
17371 .          \}
17372 .       \}
17373 .       if '\\$1'COLOR' \{\
17374 .          shift
17375 .          ie r all \{\
17376 .             nr all 0 1
17377 .             while \\n+[all]<=4 \{\
17378 .                 get-label-type
17379 .                 ds \\*[label-type]*\\*[spec-type]-color \\$1
17380 .             \}
17381 .          \}
17382 .          el .ds \\*[label-type]*\\*[spec-type]-color \\$1
17383 .          if \\n[#PRINT_STYLE]=1 \
17384 .             ds \\*[label-type]*\\*[spec-type]-color black
17385 .          shift
17386 .       \}
17387 .       if '\\$1'ADJUST' \{\
17388 .          shift
17389 .          ie r all \{\
17390 .             nr all 0 1
17391 .             while \\n+[all]<=4 \{\
17392 .                 get-label-type
17393 .                 ds \\*[label-type]*\\*[spec-type]-space \\$1
17394 .             \}
17395 .          \}
17396 .          el .ds \\*[label-type]*\\*[spec-type]-space \\$1
17397 .          if \\n[#PRINT_STYLE]=1 \
17398 .             ds \\*[label-type]*\\*[spec-type]-space +0
17399 .          shift
17400 .       \}
17401 .    \}
17402 .    ie r all \{\
17403 .       nr all 0 1
17404 .       while \\n+[all]<=4 \{\
17405 .          get-label-type
17406 .          set-defaults
17407 .          set-inline-specs
17408 .       \}
17409 .    \}
17410 .    el \{\
17411 .       set-defaults
17412 .       set-inline-specs
17413 .    \}
17414 .    ds revert-specs \f[]\s[0]\m[]
17415 .    rr all
17416 .END
17417 \#
17418 .ALIAS CAPTIONS CAPTION_LABEL_SPECS
17419 .ALIAS LABELS   CAPTION_LABEL_SPECS
17420 .ALIAS SOURCES  CAPTION_LABEL_SPECS
17421 \#
17422 \# CAPTION_AFTER_LABEL
17423 \# -------------------
17424 \# *Arguments:
17425 \#   <none> | <anything>
17426 \# *Function:
17427 \#   Sets register indicating non-MLA captions should come after labels.
17428 \#
17429 .MAC CAPTION_AFTER_LABEL END
17430 .    if '\\$1'IMG' .ds type pdf-img
17431 .    if '\\$1'PIC' .ds type pic
17432 .    if '\\$1'TBL' .ds type tbl
17433 .    if !\\n[#MLA] \{\
17434 .       nr \\*[type]*caption-after-label 1
17435 .       if '\\$1'ALL' \{\
17436 .          if '\\$1'IMG' .nr pdf-img*caption-after-label 1
17437 .          if '\\$1'TBL' .nr tbl*caption-after-label 1
17438 .          if '\\$1'PIC' .nr pic*caption-after-label 1
17439 .       \}
17440 .       if !'\\$2'' \{\
17441 .          ie !'\\$1'ALL' .rr \\*[type]*caption-after-label
17442 .          el \{\
17443 .             rr pdf-img*caption-after-label
17444 .             rr tbl*caption-after-label
17445 .             rr pic*caption-after-label
17446 .          \}
17447 .       \}
17448 .    \}
17449 .END
17450 \#
17451 \# AUTOLABELLING
17452 \# -------------
17453 \# *Argument:
17454 \#   [ PREFIX <prefix> SUFFIX <suffix> ] | <anything>
17455 \# *Function:
17456 \#   Turns label autonumbering on of off; optionally lets user set
17457 \#   prefix and suffix for labels.
17458 \# *Notes:
17459 \#   Aliased for images (pdf), tbl, pic, and eqn.
17460 \#
17461 .MAC AUTOLABEL END
17462 .    if '\\$0'AUTOLABEL_EQUATIONS' .ds label-type eqn
17463 .    if '\\$0'AUTOLABEL_IMAGES'    .ds label-type pdf-img
17464 .    if '\\$0'AUTOLABEL_PIC'       .ds label-type pic
17465 .    if '\\$0'AUTOLABEL_TABLES'    .ds label-type tbl
17466 .    if !'\\$1'' \{\
17467 .       ds \\*[label-type]-label-args \\$1
17468 .       substring \\*[label-type]-label-args -1 -3
17469 .    \}
17470 .    if '\\*[\\*[label-type]-label-args]'FIX' .nr \\*[label-type]-label-args 1
17471 .    if '\\*[\\*[label-type]-label-args]'TER' .nr \\*[label-type]-label-args 1
17472 .    if !\\n[\\*[label-type]*label-num] \
17473 .       nr \\*[label-type]*label-num 0 1
17474 .    if '\\*[label-type]'pdf-img' .nr fig*label-num 0 1
17475 .    if '\\*[label-type]'pic'     .nr fig*label-num 0 1
17476 .    nr \\*[label-type]*autolabel 1
17477 .    nr loop-counter 0 1
17478 .    nr loop-count \\n[#NUM_ARGS]
17479 .    while \\n+[loop-counter]<=\\n[loop-count] \{\
17480 .       if '\\$1'PREFIX' \{\
17481 .          ds \\*[label-type]*label-prfx \\$2
17482 .          nr \\*[label-type]*label-prfx-set 1
17483 .          shift 2
17484 .       \}
17485 .       if '\\$1'SUFFIX' \{\
17486 .          ds \\*[label-type]*label-sffx \\$2
17487 .          nr \\*[label-type]*label-sffx-set 1
17488 .          shift 2
17489 .       \}
17490 .       if '\\$1'PREFIX_CHAPTER' \{\
17491 .          nr \\*[label-type]*label-with-chapter 1
17492 .          ie !'\\$2'' \{\
17493 .             ie \B'\\$2' .nr #CH_NUM \\$2
17494 .             el .autolabel@error
17495 .          \}
17496 .          el \{\
17497 .             ie \\n[#CHAPTER_CALLED] \
17498 .                ie \B'\\*[$CHAPTER]' .nr #CH_NUM \\*[$CHAPTER]
17499 .                el .autolabel@error \\$0
17500 .             el .autolabel@error \\$0
17501 .          \}
17502 .          shift 2
17503 .       \}
17504 .    \}
17505 .    if '\\*[\\*[label-type]*label-prfx]'' \{\
17506 .       if '\\*[label-type]'eqn' \
17507 .          if !\\n[\\*[label-type]*label-prfx-set] \
17508 .             ds \\*[label-type]*label-prfx (\"
17509 .       if '\\*[label-type]'pic' \
17510 .          if !\\n[\\*[label-type]*label-prfx-set] \
17511 .             ds \\*[label-type]*label-prfx Fig. \"
17512 .       if '\\*[label-type]'pdf-img' \
17513 .          if !\\n[\\*[label-type]*label-prfx-set] \
17514 .             ds \\*[label-type]*label-prfx Fig. \"
17515 .       if '\\*[label-type]'tbl' \
17516 .          if !\\n[\\*[label-type]*label-prfx-set] \
17517 .             ds \\*[label-type]*label-prfx Table \"
17518 .    \}
17519 .    if '\\*[\\*[label-type]*label-sffx]'' \{\
17520 .       if '\\*[label-type]'eqn' \
17521 .          if !\\n[\\*[label-type]*label-sffx-set] \
17522 .             ds \\*[label-type]*label-sffx )\"
17523 .       if '\\*[label-type]'pic' \
17524 .          if !\\n[\\*[label-type]*label-sffx-set] \
17525 .             ds \\*[label-type]*label-sffx .\"
17526 .       if '\\*[label-type]'pdf-img' \
17527 .          if !\\n[\\*[label-type]*label-sffx-set] \
17528 .             ds \\*[label-type]*label-sffx .\"
17529 .       if '\\*[label-type]'tbl' \
17530 .          if !\\n[\\*[label-type]*label-sffx-set] \
17531 .             ds \\*[label-type]*label-sffx .\"
17532 .    \}
17533 .    ie \\n[args]>0 \{\
17534 .       if \\n[\\*[label-type]*label-prfx-set]+\\n[\\*[label-type]*label-sffx-set]=1 \{\
17535 .          ie (\\n[\\*[label-type]*label-prfx-set]=1)&(\\n[\\*[label-type]*label-sffx-set]=0) \
17536 .             ds missing-arg SUFFIX
17537 .          el .ds missing-arg PREFIX
17538 .          tm1 "[mom]: You must supply a \\*[missing-arg] argument to \\$0.
17539 .          tm1 "       If you wish the \\*[missing-arg] to be blank, use \\*[missing-arg] "".
17540 .          ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
17541 .       \}
17542 .       if !\\n[\\*[label-type]-label-args] \{\
17543 .          rr \\*[label-type]*autolabel
17544 .          rr \\*[label-type]*label-prfx-set
17545 .          rr \\*[label-type]*label-suffx-set
17546 .          rr \\*[label-type]-label-args
17547 .       \}
17548 .    \}
17549 .    rr \\*[label-type]-label-args
17550 .END
17551 \#
17552 .ALIAS AUTOLABEL_EQUATIONS AUTOLABEL
17553 .ALIAS AUTOLABEL_IMAGES    AUTOLABEL
17554 .ALIAS AUTOLABEL_PIC       AUTOLABEL
17555 .ALIAS AUTOLABEL_TABLES    AUTOLABEL
17556 \#
17557 .MAC autolabel@error END
17558 .    tm1 "[mom]: \\$1 cannot determine a chapter number.
17559 .    tm1 "       Enter the current chapter number as a digit after the
17560 .    tm1 "       PREFIX_CHAPTER argument at line \\n[.c].
17561 .    ab Aborting '\\n[.F]', line \\n[.c]. 
17562 .END
17563 \#
17564 \# MLA STYLE
17565 \# ---------
17566 \# *Argument:
17567 \#   <none> | <anything>
17568 \# *Function:
17569 \#   Sets or removes register #MLA.
17570 \# *Notes:
17571 \#   MLA formatting differs from other styles wrt caption and
17572 \#   label placement.
17573 \#
17574 .MAC MLA END
17575 .    ie '\\$1'' \{\
17576 .       nr #MLA 1
17577 .       nr pdf-img*caption-after-label 1
17578 .       nr pic*caption-after-label 1
17579 .       rr tbl*caption-after-label
17580 .    \}
17581 .    el \{\
17582 .       rr #MLA
17583 .    \}
17584 .END
17585 \#
17586 .MAC mla@error END
17587 .    tm1 "[mom]: MLA style enabled, but \\$1 has no corresponding \\$2.
17588 .    ab Aborting '\\$3' at \\$4, line \\$5.
17589 .END
17590 \#
17591 \# LISTS_OF
17592 \# --------
17593 \# *Aliases:
17594 \#   LIST_OF_EQUATIONS
17595 \#   LIST_OF_FIGURES
17596 \#   LIST_OF_TABLES
17597 \# *Arguments:
17598 \#   TITLE_STRING <string> START_PAGENUM <pagenumber>
17599 \# *Function:
17600 \#   Generates lists-of based on calling alias.
17601 \# *Notes:
17602 \#   Called at end of file.
17603 \#   If after TOC, and TOC is being auto-relocated, lists are also
17604 \#   relocated.  If called before, lists are output at end of file.
17605 \#
17606 .MAC LISTS_OF END
17607 .    ds $LIST_TYPE \\$0
17608 .    substring $LIST_TYPE -1 -4
17609 .    if '\\*[$LIST_TYPE]'URES' \{\
17610 .       ds $LIST_TYPE FIGURES
17611 .       ds \\*[$LIST_TYPE]_TITLE_STRING "List of Figures
17612 .    \}
17613 .    if '\\*[$LIST_TYPE]'BLES' \{\
17614 .       ds $LIST_TYPE TABLES
17615 .       ds \\*[$LIST_TYPE]_TITLE_STRING "List of Tables
17616 .    \}
17617 .    if '\\*[$LIST_TYPE]'IONS' \{\
17618 .       ds $LIST_TYPE EQUATIONS
17619 .       ds \\*[$LIST_TYPE]_TITLE_STRING "List of Equations
17620 .    \}
17621 .    nr #LIST_OF_\\*[$LIST_TYPE] 1
17622 .    nr loop-count 0 1
17623 .    nr loop-counter \\n[#NUM_ARGS]
17624 .    while \\n+[loop-count]<=\\n[loop-counter] \{\
17625 .       if '\\$1'TITLE_STRING' \{\
17626 .          ds \\*[$LIST_TYPE]_TITLE_STRING \\$2
17627 .          shift 2
17628 .       \}
17629 .       if '\\$1'START_PAGENUM' \{\
17630 .          nr #\\*[$LIST_TYPE]_START_PAGENUM \\$2
17631 .          shift 2
17632 .       \}
17633 .    \}
17634 .    char \[leader] " .
17635 .    LEADER_CHARACTER \[leader]
17636 .    if \\n[#LINENUMBERS]=1 \{\
17637 .       NUMBER_LINES OFF
17638 .       nr #LINENUMBERS 2
17639 .    \}
17640 .    if \\n[#FINIS] \{\
17641 .       if \\n[#FOOTERS_WERE_ON] \
17642 .          FOOTERS
17643 .    \}
17644 .    if \\n[#FOOTERS_ON]=1 \{\
17645 .       if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
17646 .       ie \\n[#LISTS_NO_PAGENUM]=1 .PAGINATION off
17647 .       el .PAGINATE
17648 .    \}
17649 .    if \\n[#FOOTERS_WERE_ON] .FOOTERS OFF
17650 .    rr #COLUMNS
17651 .    COLLATE
17652 .    if \\n[#PRINT_STYLE]=1 \{\
17653 .       if \\n[#SINGLE_SPACE] .LS 24
17654 .       DOC_LEAD_ADJUST
17655 .    \}
17656 .    if \\n[#FINIS] \{\
17657 .       if \\n[#FOOTERS_WERE_ON] .FOOTERS
17658 .       rr #FOOTERS_WERE_ON
17659 .       if \\n[#PAGINATION_WAS_ON] \{\
17660 .          nr #PAGINATE 1
17661 .          rr #PAGINATION_WAS_ON
17662 .       \}
17663 .       rr #FINIS
17664 .    \}
17665 .    ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
17666 .    rm $HDRFTR_CENTER_OLD
17667 .    rm $HDRFTR_CENTER_NEW
17668 .    rr #COLLATED_DOC
17669 .    DOCTYPE DEFAULT
17670 .    DOCHEADER
17671 .    TITLE "\\*[\\*[$LIST_TYPE]_TITLE_STRING]
17672 .    AUTHOR ""
17673 .    L_MARGIN \\n[#DOC_L_MARGIN]u
17674 .    LL       \\n[#DOC_L_LENGTH]u
17675 .    if '\\*[$LISTS_FAM]'' \
17676 .       ds $LISTS_FAM \\*[$TOC_FAM]
17677 .    if '\\*[$LISTS_FT]'' \
17678 .       ds $LISTS_FT \\*[$TOC_TITLE_FT]
17679 .    if !\\n[#LISTS_PS] \
17680 .       nr #LISTS_PS \\n[#TOC_PS]
17681 .    ps \\n[#LISTS_PS]u
17682 .    if !\\n[#LISTS_LEAD] \
17683 .       nr #LISTS_LEAD \\n[#TOC_LEAD]
17684 .    if \\n[#PRINT_STYLE]=2 \{\
17685 .       ie \\n[#LISTS_LEAD_ADJUST]=1 \{\
17686 .          vs \\n[#LISTS_LEAD]u
17687 .          DOC_LEAD_ADJUST
17688 .       \}
17689 .       el \{\
17690 .          vs \\n[#LISTS_LEAD]u
17691 .          DOC_LEAD_ADJUST OFF
17692 .       \}
17693 .    \}
17694 .    ie !'\\*[$LISTS_TITLE_QUAD]'' \
17695 .       DOCHEADER_QUAD \\*[$LISTS_TITLE_QUAD]
17696 .    el .DOCHEADER_QUAD \\*[$TOC_HEADER_QUAD]
17697 .    if '\\*[$LISTS_TITLE_QUAD]'' \
17698 .       ds $LISTS_TITLE_QUAD \\*[$TOC_HEADER_QUAD]
17699 .    if !'\\*[$LISTS_TITLE_FAM]'' \
17700 .       TITLE_FAMILY \\*[$LISTS_TITLE_FAM]
17701 .    if !'\\*[$LISTS_TITLE_FT]'' \
17702 .       TITLE_FONT  \\*[$LISTS_TITLE_FT]
17703 .    if !'\\*[$LISTS_TITLE_SIZE]'' \
17704 .       TITLE_SIZE \\*[$LISTS_TITLE_SIZE]
17705 .    if !'\\*[$LISTS_TITLE_COLOR]'' \
17706 .       TITLE_COLOR \\*[$LISTS_TITLE_COLOR]
17707 .    if '\\*[$LISTS_PN_FAM]'' \
17708 .       ds $LISTS_PN_FAM \\*[$TOC_PN_FAM]
17709 .    if '\\*[$LISTS_PN_FT]'' \
17710 .       ds $LISTS_PN_FT \\*[$TOC_PN_FT]
17711 .    if '\\*[$LISTS_PN_SIZE_CHANGE]'' \
17712 .       ds $LISTS_PN_SIZE_CHANGE \\*[$TOC_PN_SIZE_CHANGE]
17713 .    if !\\n[#EQN_PN_PADDING] \
17714 .       nr #EQN_PN_PADDING \\n[#TOC_PN_PADDING]
17715 .    if !\\n[#FIG_PN_PADDING] \
17716 .       nr #FIG_PN_PADDING \\n[#TOC_PN_PADDING]
17717 .    if !\\n[#TBL_PN_PADDING] \
17718 .       nr #TBL_PN_PADDING \\n[#TOC_PN_PADDING]
17719 .    ie '\\*[$LISTS_PAGENUM_STYLE]'' \
17720 .       PAGENUM_STYLE \\*[$TOC_PAGENUM_STYLE]
17721 .    el \
17722 .       PAGENUM_STYLE \\*[$LISTS_PAGENUM_STYLE]
17723 .    if r #\\*[$LIST_TYPE]_START_PAGENUM  \
17724 .       PAGENUMBER \\n[#\\*[$LIST_TYPE]_START_PAGENUM]
17725 .    if r #LISTS_NO_PAGENUM .PAGINATION off
17726 .    HEADER_LEFT "\\*[$HDRFTR_LEFT]
17727 .    HEADER_RIGHT "\\*[$HDRFTR_RIGHT]
17728 .    HEADER_CENTER "\\*[\\*[$LIST_TYPE]_TITLE_STRING]
17729 .    if \\n[#LINENUMBERS]=2 .nr #LINENUMBERS 3
17730 .\" Get num placeholders for ch. num and label num.
17731 .    if \\n[\\*[list-type]*autolabel] \{\
17732 .       if \\n[#CH_NUM]<1000 .nr chapno-width 3
17733 .       if \\n[#CH_NUM]<100  .nr chapno-width 2
17734 .       if \\n[#CH_NUM]<10   .nr chapno-width 1
17735 .       if \\n[\\*[list-type]*label-width]<1000 .nr label-width 3
17736 .       if \\n[\\*[list-type]*label-width]<100  .nr label-width 2
17737 .       if \\n[\\*[list-type]*label-width]<10   .nr label-width 1
17738 .\" Calculate width of label-num tab
17739 .       nr label-width \w'\0'*(\\n[chapno-width]+\\n[label-width])+\w'.'
17740 .    \}
17741 .    if \\n[#SLANT_ON] .nop \\*[SLANTX]
17742 .    if \\n[#COLUMNS]=1 .nr #COLUMNS 0
17743 .    START
17744 .    if \\n[#PRINT_STYLE]=2 .sp -1
17745 .    if '\\*[$LIST_TYPE]'FIGURES'   .LIST_OF_FIG
17746 .    if '\\*[$LIST_TYPE]'TABLES'    .LIST_OF_TBL
17747 .    if '\\*[$LIST_TYPE]'EQUATIONS' .LIST_OF_EQN
17748 .    if \\n[#LINENUMBERS]=3 \{\
17749 .       NUMBER_LINES RESUME
17750 .       nr #LINENUMBERS 1
17751 .       nn 1
17752 .    \}
17753 .    pdfsync
17754 .END
17755 .\"
17756 .ALIAS LIST_OF_EQUATIONS LISTS_OF
17757 .ALIAS LIST_OF_FIGURES   LISTS_OF
17758 .ALIAS LIST_OF_TABLES    LISTS_OF
17759 \#
17760 \# LISTS-OF STYLE
17761 \# --------------
17762 \# *Arguments:
17763 \#   FAMILY        fam  /
17764 \#   FONT          sty /
17765 \#   PT_SIZE       size /
17766 \#   LEAD          leading [ADJUST] /
17767 \#   TITLE_FAMILY  fam /
17768 \#   TITLE_FONT    sty /
17769 \#   TITLE_SIZE    +|-size /
17770 \#   TITLE_QUAD    LEFT | CENTER | RIGHT /
17771 \#   TITLE_COLOR   color /
17772 \#   NO_PAGINATION /
17773 \#   PAGENUM_STYLE format /
17774 \#   PN_FAMILY     fam /
17775 \#   PN_FONT       sty /
17776 \#   PN_SIZE       +|-size /
17777 \#   PN_PADDING    n
17778 \# *Function:
17779 \#   Allows setting of all style parameters for lists-of.
17780 \# *Notes:
17781 \#   Assumption is that lists-of will all have the same style.
17782 \#   TOC style is used if LISTS_STYLE is omitted.
17783 \#
17784 .MAC LISTS_STYLE END
17785 .    nr loop-count 0 1
17786 .    nr loop-counter \\n[#NUM_ARGS]
17787 .    while \\n+[loop-count]<=\\n[loop-counter] \{\
17788 .       if '\\$1'FAMILY' \{\
17789 .          ds $LISTS_FAM \\$2
17790 .          shift 2
17791 .       \}
17792 .       if '\\$1'FONT' \{\
17793 .          ds $LISTS_FT \\$2
17794 .          shift 2
17795 .       \}
17796 .       if '\\$1'TITLE_FAMILY' \{\
17797 .          ds $LISTS_TITLE_FAM \\$2
17798 .          shift 2
17799 .       \}
17800 .       if '\\$1'TITLE_FONT' \{\
17801 .          ds $LISTS_TITLE_FT \\$2
17802 .          shift 2
17803 .       \}
17804 .       if '\\$1'TITLE_SIZE' \{\
17805 .          ds $LISTS_TITLE_SIZE \\$2
17806 .          shift 2
17807 .       \}
17808 .       if '\\$1'TITLE_QUAD' \{\
17809 .          ds $LISTS_TITLE_QUAD \\$2
17810 .          shift 2
17811 .       \}
17812 .       if '\\$1'TITLE_COLOR' \{\
17813 .          ds $LISTS_TITLE_COLOR \\$2
17814 .          shift 2
17815 .       \}
17816 .       if '\\$1'PT_SIZE' \{\
17817 .          nr #LISTS_PS (p;\\$2)
17818 .          shift 2
17819 .       \}
17820 .       if '\\$1'LEAD' \{\
17821 .          nr #LISTS_LEAD (p;\\$2)
17822 .          ie !'\\$3'ADJUST' \{\
17823 .             nr #LISTS_LEAD_ADJUST 0
17824 .             shift 2
17825 .          \}
17826 .          el \{\
17827 .             nr #LISTS_LEAD_ADJUST 1
17828 .             shift 3
17829 .          \}
17830 .       \}
17831 .       if '\\$1'NO_PAGINATION' \{\
17832 .          nr #LISTS_NO_PAGENUM 1
17833 .          shift 1
17834 .       \}
17835 .       if '\\$1'PAGENUM_STYLE' \{\
17836 .          ds $LISTS_PAGENUM_STYLE \\$2
17837 .          shift 2
17838 .       \}
17839 .       if '\\$1'PN_FAMILY' \{\
17840 .          ds $LISTS_PN_FAM \\$2
17841 .          shift 2
17842 .       \}
17843 .       if '\\$1'PN_FONT' \{\
17844 .          ds $LISTS_PN_FT \\$2
17845 .          shift 2
17846 .       \}
17847 .       if '\\$1'PN_SIZE' \{\
17848 .          ds $LISTS_PN_SIZE_CHANGE \\$2
17849 .          shift 2
17850 .       \}
17851 .       if '\\$1'EQN_PN_PADDING' \{\
17852 .          nr #EQN_PN_PADDING \\$2
17853 .          shift 2
17854 .       \}
17855 .       if '\\$1'FIG_PN_PADDING' \{\
17856 .          nr #FIG_PN_PADDING \\$2
17857 .          shift 2
17858 .       \}
17859 .       if '\\$1'TBL_PN_PADDING' \{\
17860 .          nr #TBL_PN_PADDING \\$2
17861 .          shift 2
17862 .       \}
17863 .    \}
17864 .END
17865 \#
17866 \# Lists-of collector
17867 \# Strings to allocate space for leaders and entry page numbers
17868 \#
17869 .ds $LISTS_PN \\*[ST102]\F[\\*[$LISTS_PN_FAM]]\f[\\*[$LISTS_PN_FT]]\
17870 \s[\\n[#LISTS_PS]u]^\\*[ST102X]\\*[ST103]\s[\\\\*[$LISTS_PN_SIZE_CHANGE]]\
17871 \|\|\|\h'\w'0'u*\\\\n[#LISTS_PN_PADDING]u'\\*[ST103X]
17872 \#
17873 .ds $LISTS_PN_TYPEWRITE \\*[ST102]^\\*[ST102X]\\*[ST103]\|\
17874 \h'\w'0'u*\\\\n[#LISTS_PN_PADDING]u'\\*[ST103X]
17875 \#
17876 .MAC LISTS_COLLECTOR END
17877 .    if '\\$0'TO_EQUATIONS' \{\
17878 .       ds list-type eqn
17879 .       da LIST_OF_EQN
17880 \!.       nr #LISTS_PN_PADDING \\\\n[#EQN_PN_PADDING]
17881 .       nr label-width \w'\\$1'
17882 .    \}
17883 .    if '\\$0'TO_FIGURES' \{\
17884 .       ds list-type fig
17885 .       da LIST_OF_FIG
17886 \!.       nr #LISTS_PN_PADDING \\\\n[#FIG_PN_PADDING]
17887 .       nr label-width \w'\\$1'
17888 .    \}
17889 .    if '\\$0'TO_TABLES' \{\
17890 .       ds list-type tbl
17891 .       da LIST_OF_TBL
17892 \!.       nr #LISTS_PN_PADDING \\\\n[#TBL_PN_PADDING]
17893 .       nr label-width \w'\\$1'
17894 .    \}
17895 .    br
17896 .    nr #LISTS_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
17897 .    ie \\n[#PRINT_STYLE]=1 \{\
17898 \!.     fam \\*[$TYPEWRITER_FAM]
17899 \!.     ft  R
17900 \!.     ps \\*[$TYPEWRITER_PS]
17901 .       ds _TYPEWRITE _TYPEWRITE
17902 .    \}
17903 .    el \{\
17904 \!.     FAMILY \\\\*[$LISTS_FAM]
17905 \!.     FONT \\\\*[$LISTS_FT]
17906 \!.     ps \\\\n[#LISTS_PS]u
17907 .    \}
17908 .    if \\n[#PRINT_STYLE]=2 .rm _TYPEWRITE
17909 \!.  PAD_MARKER ^
17910 \!.  vpt 0
17911 \!.  PAD \
17912 "\\*[ST100]\h'\\n[label-width]u'\\*[ST100X]\0\\*[ST101]\h'\w'\\$2'u'\\*[ST101X]\\\\*[$LISTS_PN\\*[_TYPEWRITE]]" \
17913 "\\*[PDFBOOKMARK.NAME]"
17914 \!.  PAD_MARKER #
17915 \!.  EOL
17916 .    ie !\\n[\\*[label-type]*autolabel] \
17917 \!.     ST 100 L
17918 .    el \
17919 \!.     ST 100 R
17920 \!.  ST 101 L
17921 \!.  ST 102 L
17922 \!.  ST 103 R
17923 .    if \\n[#PRINT_STYLE]=2 \{\
17924 \!.     FAMILY  \\\\*[$LISTS_FAM]
17925 \!.     FT      \\\\*[$LISTS_FT]
17926 \!.     ps \\\\n[#LISTS_PS]u
17927 .    \}
17928 \!.  TAB 100
17929 \!.  PDF_LINK \\*[list-type]:\\n[lists*target] "\\$1"
17930 \!.  TN
17931 \!.  PDF_LINK \\*[list-type]:\\n[lists*target] "\\$2"
17932 \!.  TN
17933 \!.  PRINT \\*[LEADER]
17934 \!.  TN
17935 .    if \\n[#PRINT_STYLE]=2 \{\
17936 \!.     FAMILY  \\\\*[$LISTS_PN_FAM]
17937 \!.     FT      \\\\*[$LISTS_PN_FT]
17938 \!.     ps \\\\*[$LISTS_PN_SIZE_CHANGE]u
17939 .    \}
17940 \!.  PRINT \\n[#LISTS_ENTRY_PN]
17941 \!.  TQ
17942 \!.  vpt
17943 .    da
17944 .END
17945 \#
17946 .ALIAS TO_EQUATIONS LISTS_COLLECTOR
17947 .ALIAS TO_FIGURES   LISTS_COLLECTOR
17948 .ALIAS TO_TABLES    LISTS_COLLECTOR
17949 \#
17950 \# ***tbl***
17951 \#
17952 \# Support for multipage tables with headers borrowed from ms and
17953 \# mommified by Robin Haberkorn <robin.haberkorn@googlemail.com>
17954 \# with extensions by Peter Schaffter.
17955 \#
17956 .nr tbl*have-header 0
17957 .ds T&
17958 \#
17959 .MAC TS END
17960 .    di NULL \" Set rule weight for boxed tables
17961 \D't 500'
17962 .    di
17963 .    br
17964 .    if !\\n[@TOP] \
17965 .       if \\n[.t]=1 .sp \\n[.t]u
17966 .    rr tbl*have-header
17967 .    rr float*tbl
17968 .    if '\\n[.z]'FLOAT*DIV' .nr float*tbl 1
17969 .    if !'\\n[.z]'FLOAT*DIV' \{\
17970 .       if \\n[.t]=1 \{\
17971 .          if !\\n[@TOP] \{\
17972 .             if \\n[#COL_NUM]=\\n[#NUM_COLS] \
17973 .                NEWPAGE
17974 .          \}
17975 .       \}
17976 .    \}
17977 .    rr tbl*boxed
17978 .    rm tbl*label
17979 .    rm tbl*caption
17980 .    nr loop-count 0 1
17981 .    nr loop-counter \\n[#NUM_ARGS]
17982 .    while \\n+[loop-count]<=\\n[loop-counter] \{\
17983 .       if '\\$1'H' \{\
17984 .          nr tbl*have-header 1
17985 .          shift
17986 .          if \\n[#NUM_ARGS]=0 .nr tbl*plain 1
17987 .       \}
17988 .       if '\\$1'BOXED' \{\
17989 .          nr tbl*boxed 1
17990 .          shift
17991 .       \}
17992 .       if '\\$1'CENTER' \{\
17993 .          nr tbl*center 1
17994 .          shift
17995 .       \}
17996 .       if '\\$1'NEEDS' \{\
17997 .          nr tbl*needs \\$2
17998 .          shift 2
17999 .       \}
18000 .       if '\\$1'NO_SHIM' \{\
18001 .          nr tbl*no-shim 1
18002 .          shift
18003 .       \}
18004 .       if '\\$1'ADJUST' \{\
18005 .          ds tbl*space-adj \\$2
18006 .          shift 2
18007 .       \}
18008 .       if '\\$1'CAPTION' \{\
18009 .          nr tbl*have-caption 1
18010 .          ds tbl*caption \\$2
18011 .          shift 2
18012 .       \}
18013 .       if '\\$1'SHORT_CAPTION' \{\
18014 .          ds tbl*caption-short \\$2
18015 .          shift 2
18016 .       \}
18017 .       if '\\$1'LABEL' \{\
18018 .          nr tbl*have-label 1
18019 .          ds tbl*label \\$2
18020 .          ds label-type tbl
18021 .          shift 2
18022 .       \}
18023 .    \}
18024 .    if \\n[tbl*boxed]=1 \{\
18025 .       if (\\n[tbl*have-label]=0)&(\\n[tbl*have-caption]=0)&\
18026 (\\n[tbl*autolabel]=0)&(\\n[tbl*have-source]=0) \
18027 .       nr tbl*plain-boxed 1
18028 .    \}
18029 .    if !\\n[tbl*needs] .nr tbl*needs 1
18030 .    if !\\n[tbl*have-header] .nr tbl*no-header 1
18031 .    ds tbl*label-sffx-tmp \\*[tbl*label-sffx]
18032 .    substring tbl*label-sffx-tmp -1
18033 .    if '\\*[tbl*label-sffx-tmp]'.' \
18034 .       if (\\n[tbl*caption-after-label]=0):(\\n[#MLA]=1) .chop tbl*label-sffx
18035 .    if \\n[tbl*caption-after-label] \{\
18036 .       if !'\\*[tbl*label-sffx]'' \
18037 .          if '\\*[tbl*caption]'' .chop tbl*label-sffx
18038 .    \}
18039 .    ie \\n[@TOP] \{\
18040 .       if !'\\n[.z]'FLOAT*DIV' \{\
18041 .          vpt 0
18042 .          rr @TOP
18043 .          ch RR_@TOP
18044 .          rs
18045 .          nop \&
18046 .          if \\n[#COLUMNS] \
18047 .             if !'\\*[tbl*space-adj]'' \
18048 .                sp \\*[tbl*space-adj]-1v
18049 .          nr tbl*boxed 2
18050 .          vpt
18051 .       \}
18052 .    \}
18053 .    el \
18054 .       if !'\\*[tbl*space-adj]'' .sp \\*[tbl*space-adj]u
18055 .    if !\\n[#MLA] \{\
18056 .      if (\\n[tbl*have-caption]=0):(\\n[tbl*caption-after-label]=1) \{\
18057 .         ie !'\\n[.z]'FLOAT*DIV' \{\
18058 .            sp .5v
18059 .            if \\n[tbl*boxed] .sp .25v
18060 .         \}
18061 .         el .sp 1n
18062 .      \}
18063 .    \}
18064 .    if '\\n[.z]'FLOAT*DIV' \{\
18065 .       if \\n[defer]>0 .sp .5v
18066 .    \}
18067 .    ds ev-current   \\n[.ev]
18068 .    nr ll-pre-tbl   \\n[.l]
18069 .    nr lead-pre-tbl \\n[.v]
18070 .    nr ind-pre-tbl  \\n[.i]
18071 .    ll \\n[.l]u-\\n[.i]u
18072 .    if (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \
18073 .       nr tbl*caption-lead-diff-adj 1
18074 .    if \\n[#MLA] \
18075 .       if \\n[tbl*have-label]+\\n[tbl*have-caption]=0 \
18076 .          sp .5v
18077 .    if \\n[tbl*boxed]=2 \{\
18078 .       if \\n[#MLA]=0 \
18079 .          if (\\n[tbl*caption-after-label]=1):(\\n[tbl*have-caption]=0) \
18080 .             sp 1n
18081 .    \}
18082 .    if \\n[tbl*have-header] \{\
18083 .       ev table-header
18084 .       evc \\*[ev-current]
18085 .       di tbl*header-div
18086 .       if !\\n[float-span] \!.in 0
18087 .    \}
18088 .END
18089 \#
18090 .MAC TH END
18091 .    ie '\\n[.z]'tbl*header-div' \{\
18092 .       nr T. 0
18093 .       T#
18094 .       di
18095 .       ev
18096 .       PDF_TARGET tbl:\\n+[lists*target]
18097 .       if !'\\n[.z]'FLOAT*DIV' \{\
18098 .          ie !\\n[tbl*boxed] \{\
18099 .             nr th*needs (u;\\n[dn]+\\n[tbl*needs]v)
18100 .             if \\n[th*needs]>\\n[.t] \{\
18101 .                ne \\n[dn]u+\\n[tbl*needs]
18102 .                nr tbl@needs 1
18103 .             \}
18104 .          \}
18105 .          el \{\
18106 .             nr th*needs (u;\\n[dn]+2p+\\n[tbl*needs]v)
18107 .             if \\n[th*needs]>\\n[.t] \{\
18108 .                ne \\n[dn]u+2p+\\n[tbl*needs]
18109 .                if \\n[#COLUMNS] \
18110 .                   if !\\n[#COL_NUM]=\\n[#NUM_COLS] .nr tbl*no-top-hook 1
18111 .                nr tbl@needs 1
18112 .             \}
18113 .          \}
18114 .          if \\n[defer] .nr tbl*interrupted 1
18115 .       \}
18116 .       ie (\\n[dn]-\\n[.v])>\\n[.t] \{\
18117 .          if !\\n[@TOP] .@error ridiculously long table header
18118 .          if \\n[tbl@needs] \{\
18119 .             if \\n[tbl*boxed] \{\
18120 .                rs
18121 .                nop \&
18122 .                sp -1n
18123 .             \}
18124 .             rr tbl@needs
18125 .          \}
18126 .          if \\n[tbl*have-caption] .TBL*CAPTION
18127 .          tbl*print-header
18128 .       \}
18129 .       el \{\
18130 .          nr tbl*header-ht \\n[dn]
18131 .          if \\n[tbl@needs] \{\
18132 .             if \\n[tbl*boxed] \{\
18133 .                rs
18134 .                nop \&
18135 .                sp -1n
18136 .             \}
18137 .             rr tbl@needs
18138 .          \}
18139 .          if \\n[tbl*have-caption] .TBL*CAPTION
18140 .          vs
18141 .          tbl*print-header
18142 .       \}
18143 .    \}
18144 .    el \{\
18145 .       if \\n[tbl*have-caption] \{\
18146 .          TBL*CAPTION
18147 .          nr skip-th-warning 1
18148 .       \}
18149 .       if !\\n[skip-th-warning] .@error .TH without .TS H
18150 .       rr skip-th-warning
18151 .    \}
18152 .\" When centering a boxed table inside a float, .T# won't place
18153 .\" vertical rules in the correct horizontal position unless .ll is
18154 .\" given a nominal value (can be anything) and an indent is set
18155 .\" manually.
18156 .    if '\\n[.z]'FLOAT*DIV' \{\
18157 .       if \\n[tbl*center] \{\
18158 .          nr float*ll \\n[.l]
18159 .          ll 0
18160 .          in \\n[float*ll]u-\\n[TW]u/2u
18161 .       \}
18162 .    \}
18163 .END
18164 \#
18165 .MAC TE END
18166 .    ev tbl*end \" Needed because of .ad changes
18167 .    evc \\*[ev-current] 
18168 .    nh
18169 .    nf
18170 .    rr tbl*no-header
18171 .    if !'\\n[.z]'FLOAT*DIV' \{\
18172 .       ie \\n[.t]<(\\n[.v]+(\\n[.v]/2u)) \{\
18173 .          rm tbl*header-div
18174 .          nr tbl*no-top-hook 1
18175 .          nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
18176 .          tm1 "[mom]: '\\n[.F]', macro \\$0, line \\n[.c]:
18177 .          tm1 "        Insufficient room for label, caption, and/or source after
18178 .          tm1 "        table on page \\n[pgnum].  Omitting, but continuing to process.
18179 .          NEWPAGE
18180 .          nr tbl*skip-source 1
18181 .          nr tbl*skip-label 1
18182 .          ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
18183 .       \}
18184 .       el \{\
18185 .          ch FOOTER 0+\\n[pre-tbl-vfp]u
18186 .          ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
18187 .       \}
18188 .    \}
18189 .    if !'\\$1'' \{\
18190 .       if '\\$1'SOURCE' \{\
18191 .          nr tbl*have-source 1
18192 .          shift
18193 .       \}
18194 .    \}
18195 .    if !\\n[#MLA] \{\
18196 .       if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1):(\\n[tbl*caption-after-label]=1) \{\
18197 .          ev label
18198 .          evc tbl*end
18199 .          ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
18200 .          el \{\
18201 .             tbl*label-style
18202 .             vs \\n[.ps]u+\\n[tbl*label-autolead]u
18203 .          \}
18204 .          SIZESPECS
18205 .          if \\n[tbl*label-with-chapter] \
18206 .             ds chapno \\n[#CH_NUM].
18207 .          TBL*SET_LABEL_QUAD \\*[tbl*label-quad]
18208 .          di tbl*label-div
18209 \!.        in -\\n[ind-pre-tbl]u
18210 .          ie \\n[tbl*boxed] .sp \\n[#CAP_HEIGHT]u
18211 .          el .sp \\n[#DOC_LEAD]u/4u
18212 .          if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1) \{\
18213 .             if !'\\*[tbl*label-space]'' .sp \\*[tbl*label-space]
18214 .             ie \\n[tbl*autolabel] \{\
18215 .                ie !\\n[tbl*caption-after-label] .nop \
18216 \\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]
18217 .                el \{\
18218 .                   nop \\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]\|
18219 .                   tbl*caption-style
18220 .                   vs \\n[.ps]u+\\n[tbl*caption-autolead]u
18221 .                   ds tbl*caption " \\*[tbl*caption]
18222 .                   nop \\*[tbl*caption]
18223 .                \}
18224 .             \}
18225 .             el \{\
18226 .                if !'\\*[tbl*label]'' \{\
18227 .                   ie !\\n[tbl*caption-after-label] .nop \\*[tbl*label]
18228 .                   el \{\
18229 .                      nop \\*[tbl*label]\ \|\c
18230 .                      tbl*caption-style
18231 .                      vs \\n[.ps]u+\\n[tbl*caption-autolead]u
18232 .                      ds tbl*caption " \\*[tbl*caption]
18233 .                      nop \\*[tbl*caption]
18234 .                   \}
18235 .                \}
18236 .             \}
18237 .             if \\n[tbl*autolabel] \
18238 .                ds tbl*label \\*[chapno]\\n[tbl*label-num]
18239 .             br
18240 .          \}
18241 .          di
18242 .          ev
18243 .          nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
18244 .          ie !'\\n[.z]'FLOAT*DIV' \{\
18245 .             ie \\n[dn]>\\n[.t] \{\
18246 .                tm1 "[mom]: '\\n[.F]', macro \\$0, line \\n[.c]:
18247 .                tm1 "        Insufficient room for label, caption, and/or source after
18248 .                tm1 "        table on page \\n[pgnum].  Omitting, but continuing to process.
18249 .                if d tbl*header-div .rm tbl*header-div
18250 .                rr tbl*caption-top-lead-diff
18251 .                rr tbl*have-header
18252 .                nr tbl*skip-source 1
18253 .                nr tbl*skip-label 1
18254 .                NEWPAGE
18255 .             \}
18256 .             el .print-label
18257 .          \}
18258 .          el .print-label
18259 .       \}
18260 .    \}
18261 .    if !'\\*[tbl*caption-short]'' .ds short -short
18262 .    ie !'\\*[tbl*label]'' \
18263 .       TO_TABLES "\\*[tbl*label]" "\\*[tbl*caption\\*[short]]"
18264 .    el .TO_TABLES "\\*[tbl*caption]\\*[short]]"
18265 .    if !\\n[tbl*skip-source] \{\
18266 .       if \\n[tbl*have-source] \{\
18267 .          ds tbl*source \\$1
18268 .          SIZESPECS
18269 .          ev source
18270 .          nh
18271 .          ie \\n[#PRINT_STYLE]=1 \{\
18272 .             TYPEWRITER
18273 .             sp
18274 .          \}
18275 .          el \{\
18276 .             tbl*source-style
18277 .             vs \\n[.ps]u+\\n[tbl*source-autolead]u
18278 .          \}
18279 .          di tbl*source-div
18280 .          TBL*SET_SOURCE_QUAD \\*[tbl*source-quad]
18281 .          if \\n[#MLA] \{\
18282 .             if '\\*[tbl*source-quad]'L' \{\
18283 .                in \\n[ind-pre-tbl]u+\\n[tmp-ind]u
18284 .                ti -\\n[tmp-ind]u
18285 .             \}
18286 .          \}
18287 .          if (\\n[tbl*have-label]=0)&(\\n[#MLA]=0) \
18288 .             if !\\n[tbl*autolabel] .sp \\n[#CAP_HEIGHT]u
18289 .          if \\n[#MLA] \
18290 .             sp \\n[#CAP_HEIGHT]u
18291 .          if !'\\*[tbl*source-space]'' .sp \\*[tbl*source-space]
18292 .          nop \\*[tbl*source]
18293 .          br
18294 .          if \\n[#MLA] .in
18295 .          di
18296 .          nf
18297 .          tbl*source-div
18298 .          ev
18299 .       \}
18300 .    \}
18301 .    if '\\n[.z]'FLOAT*DIV' .nr bx-tbl-depth \\n[.d]-1v
18302 .    if '\\n[.z]'tbl*header-div' \{\
18303 .       @error .TS with 'H' flag but no corresponding .TH
18304 .       ab Aborting.
18305 .    \}
18306 .    ev
18307 .    if !\\n[tbl*plain] \{\
18308 .       ie \\n[tbl*plain-boxed] .sp 1
18309 .       el .sp .5v
18310 .    \}
18311 .    ll \\n[ll-pre-tbl]u
18312 .    if !'\\*[tbl*space-adj]'' .sp -\\*[tbl*space-adj]u
18313 .    if !\\n[tbl*no-shim] .SHIM
18314 .    TBL*CLEANUP
18315 .END
18316 \#
18317 \# Utility macros for tbl
18318 \#
18319 .MAC TBL*CAPTION END
18320 .    if \\n[tbl*have-caption] \{\
18321 .       vs \\n[.ps]u+\\n[tbl*caption-autolead]u
18322 .       nr tbl*caption-lead-diff \\n[lead-pre-tbl]-\\n[.v]
18323 .       nr tbl*caption-top-lead-diff \\n[tbl*caption-lead-diff]
18324 .       ie !\\n[#MLA] \{\
18325 .          if !\\n[tbl*caption-after-label] \{\
18326 .             ie !'\\n[.z]'FLOAT*DIV' \{\
18327 .                ie (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \{\
18328 .                   ie \\n[#COLUMNS] .sp |\\n[dc]u
18329 .                   el .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
18330 .                   sp \\n[tbl*caption-lead-diff]u
18331 .                \}
18332 .                el .sp .5v
18333 .             \}
18334 .             el .sp .5v
18335 .          \}
18336 .          ev caption
18337 .          evc \\*[ev-current]
18338 .          nh
18339 .       \}
18340 .       el \{\
18341 .          if !\\n[tbl*autolabel] \{\
18342 .             ie !\\n[tbl*have-label] \
18343 .                mla@error caption label \\n[.F] \\$0 \\n[.c]
18344 .             el .ev label
18345 .          \}
18346 .       \}
18347 .       ie \\n[#PRINT_STYLE]=1 .nr tmp-ind 2m
18348 .       el .nr tmp-ind 1.25m
18349 .       ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
18350 .       el \{\
18351 .          if !\\n[#MLA] \{\
18352 .             tbl*caption-style
18353 .             nr lead-current \\n[.v]
18354 .          \}
18355 .       \}
18356 .       ie !\\n[#MLA] \{\
18357 .          ie !\\n[tbl*caption-after-label] \{\
18358 .             di tbl*caption-div
18359 \!.           in -\\n[ind-pre-tbl]u
18360 .             TBL*SET_CAPTION_QUAD \\*[tbl*caption-quad]
18361 .             nop \\*[tbl*caption]
18362 .             br
18363 .             di
18364 .             if !'\\n[.z]'FLOAT*DIV' \{\
18365 .                nr caption-needs 2
18366 .                if (\\n[dn]+(\\n[#DOC_LEAD]*(\\n[tbl*needs]*2)))>\\n[.t] \{\
18367 .                   nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1
18368 .                   ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
18369 .                      tm1 "[mom]: Table with caption at line \\n[.c] does not fit on page \\n[pgnum].
18370 .                      tm1 "       Shifting table to page \\n+[pgnum].
18371 .                      rr tbl*no-header
18372 .                      NEWPAGE
18373 .                   \}
18374 .                   el \{\
18375 .                      sp \\n[.t]u
18376 .                      sp |\\n[#PAGE_TOP]u+\\n[tbl*caption-lead-diff]u
18377 .                   \}
18378 .                \}
18379 .             \}
18380 .             if \\n[.u] .nr fill 1
18381 .             nf
18382 .             if \\n[.ns] .RESTORE_SPACE
18383 .             tbl*caption-div
18384 .             if \\n[#PRINT_STYLE]=1 .sp .5v
18385 .             if !'\\*[tbl*caption-space]'' \
18386 .                sp \\*[tbl*caption-space]
18387 .             if \\n[tbl*caption-lead-diff-adj] \{\
18388 .                sp -\\n[tbl*caption-lead-diff]u
18389 .                rr tbl*label-lead-diff-adj
18390 .             \}
18391 .             if \\n[fill] .fi
18392 .             rr fill
18393 .          \}
18394 .          el \{\
18395 .             if (\\n[tbl*have-label]=0) \{\
18396 .                if !\\n[tbl*autolabel] \{\
18397 .                   tm1 "[mom]: CAPTION_AFTER_LABEL enabled, but no label given
18398 .                   tm1 "       for table at line \\n[.c].
18399 .                   tm1 "       Skipping caption but continuing to process.
18400 .                \}
18401 .             \}
18402 .          \}
18403 .       \}
18404 .       el \{\
18405 .          if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1) \{\
18406 .             ie !\\n[tbl*have-caption] \
18407 .                mla@error label caption \\n[.F] \\$0 \\n[.c]
18408 .             el \{\
18409 .                ie !'\\n[.z]'FLOAT*DIV' \{\
18410 .                   ie (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \{\
18411 .                      ie !\\n[#COLUMNS] .sp |\\n[#PAGE_TOP]u+\\n[tbl*caption-lead-diff]u
18412 .                      el .sp |\\n[dc]u+\\n[tbl*caption-lead-diff]u
18413 .                   \}
18414 .                   el .sp .5v
18415 .                \}
18416 .                el .sp .5v
18417 .             \}
18418 .             ev label
18419 .             evc \\*[ev-current]
18420 .             nh
18421 .             ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
18422 .             el \{\
18423 .                tbl*label-style
18424 .                vs \\n[.ps]u+\\n[tbl*label-autolead]u
18425 .                nr tbl*label-lead-diff \\n[lead-pre-tbl]-\\n[.v]
18426 .             \}
18427 .             if \\n[tbl*label-with-chapter] \
18428 .                ds chapno \\n[#CH_NUM].
18429 .             TBL*SET_LABEL_QUAD \\*[tbl*label-quad]
18430 .             di tbl*mla-label-caption
18431 .             ie '\\*[tbl*label-quad]'L' \{\
18432 \!.              in -\\n[ind-pre-tbl]u
18433 \!.              in \\n[tmp-ind]u
18434 \!.              ti -\\n[tmp-ind]u
18435 .             \}
18436 .             el \{\
18437 .                if \\n[tbl*label-quad-on-ll] \{\
18438 .                   if '\\n[tbl*label-quad]'L' \
18439 \!.                 in
18440 .                \}
18441 .             \}
18442 .             ie \\n[tbl*autolabel] \
18443 .                nop \
18444 \\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]
18445 .             el .if !'\\*[tbl*label]'' .nop \\*[tbl*label]
18446 .             if \\n[tbl*autolabel] \
18447 .                ds tbl*label \\*[chapno]\\n[tbl*label-num]
18448 .             br
18449 .             di
18450 .          \}
18451 .          da tbl*mla-label-caption
18452 .          ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
18453 .          el .tbl*caption-style
18454 .          if '\\*[tbl*caption-quad]'L' \{\
18455 \!.           ti -\\n[tmp-ind]u
18456 \!.           fi
18457 .          \}
18458 .          nop \\*[tbl*caption]
18459 .          br
18460 \!.        in
18461 .          da
18462 .       \}
18463 .       if !'\\n[.z]'FLOAT*DIV' \{\
18464 .          ie \\n[#MLA] .nr caption-needs 3
18465 .          el .nr caption-needs 2
18466 .          if (\\n[dn]+(\\n[#DOC_LEAD]*(\\n[tbl*needs]+\\n[caption-needs])))>\\n[.t] \{\
18467 .             nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1
18468 .             ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
18469 .                tm1 "[mom]: Table with caption at line \\n[.c] does not fit on page \\n[pgnum].
18470 .                tm1 "       Shifting table to page \\n+[pgnum].
18471 .                rr tbl*no-header
18472 .                if \\n[defer] .nr skip-th-warning 1
18473 .                NEWPAGE
18474 .             \}
18475 .             el \{\
18476 .                nr tbl*no-top-hook 1
18477 .                sp \\n[.t]u
18478 .                if (\\n[tbl*caption-after-label]=1):(\\n[tbl*plain]) \
18479 .                   sp 1n-2p
18480 .             \}
18481 .          \}
18482 .       \}
18483 .       nf
18484 .       if (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \
18485 .          nr tbl*label-lead-diff-adj 1
18486 .       ie (\\n[.t]>1)&(\\n[@TOP]=0) \{\
18487 .          sp \\n[tbl*label-lead-diff]u
18488 .       \}
18489 .       el \{\
18490 .          if \\n[.t]=1 .sp \\n[.t]u
18491 .          ie \\n[#COL_NUM]>1 \
18492 .             ie (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \
18493 .                sp |\\n[dc]u+\\n[tbl*label-lead-diff]u
18494 .             el .sp .5v
18495 .       \}
18496 .       tbl*mla-label-caption
18497 .       ie \\n[#PRINT_STYLE]=1 .sp .5v
18498 .       el .sp .5n
18499 .       if \\n[tbl*label-lead-diff-adj] \{\
18500 .          sp -\\n[tbl*label-lead-diff]u
18501 .          rr tbl*label-lead-diff-adj
18502 .       \}
18503 .       br
18504 .       if !'\\*[tbl*caption-space]'' .sp \\*[tbl*caption-space]
18505 .    \}
18506 .    if !'\\n[.ev]'0' .ev
18507 .END
18508 \#
18509 .MAC TBL*CLEANUP END
18510 .    if !'\\n[.z]'FLOAT*DIV' \{\
18511 .       rr tbl*center
18512 .       rm tbl*header-div
18513 .       rr tbl*caption-top-lead-diff
18514 .    \}
18515 .    rr tbl*have-header
18516 .    if !'\\n[.z]'FLOAT*DIV' \{\
18517 .       rr tbl*have-caption
18518 .       rr tbl*have-label
18519 .    \}
18520 .    rr tbl*label-warning
18521 .    rr tbl*no-shim
18522 .    rr tbl*skip-source
18523 .    if !'\\n[.z]'FLOAT*DIV' \{\
18524 .       rm short
18525 .       rm tbl*caption
18526 .       rm tbl*caption-short
18527 .       rm tbl*label
18528 .    \}
18529 .    rm tbl*space-adj
18530 .    rnn tbl*have-label tbl@label
18531 .    rnn tbl*have-source tbl@source
18532 .    rr tbl*have-label
18533 .    rr tbl*plain
18534 .    if '\\*[tbl*label-sffx-tmp]'.' .ds tbl*label-sffx .
18535 .END
18536 \#
18537 .MAC print-label END
18538 .    if \\n[.u] .nr fill 1
18539 .    nf
18540 .    if !\\n[tbl*skip-label] \{\
18541 .       tbl*label-div
18542 .    \}
18543 .    if \\n[fill] .fi
18544 .    rr fill
18545 .END
18546 \#
18547 .MAC tbl@top-hook END
18548 .    if \\n[tbl*have-header] \{\
18549 .       nf
18550 .       rr @TOP
18551 .       ch RR_@TOP
18552 .       ev top-hook
18553 .       evc 0
18554 .       rs
18555 .       nop \&
18556 .       ie !\\n[tbl*boxed] .sp -1
18557 .       el .sp -1n
18558 .       tbl*print-header
18559 .       ev
18560 .    \}
18561 .END
18562 \#
18563 .MAC tbl*print-header END
18564 .    if \\n[.u]=1 \{\
18565 .       nf
18566 .       nr fill 1
18567 .    \}
18568 .    if \\n[#COL_NUM]>1 \
18569 .       sp 2p
18570 .    ie d tbl*header-div:\\n[loop-count] \
18571 .       tbl*header-div:\\n[loop-count]
18572 .    el .tbl*header-div
18573 .    if '\\n[.z]'FLOAT*DIV' \
18574 .       if \\n[tbl*center] .ce 1000
18575 .    mk #T
18576 .    if !'\\n[.z]'FLOAT*DIV' \{\
18577 .       nr pre-tbl-vfp 0+\\n[#VARIABLE_FOOTER_POS]
18578 .       ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
18579 .       ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_LEAD]u
18580 .    \}
18581 .END
18582 \#
18583 .MAC tbl@bottom-hook END
18584 .       if \\n[.ns] .rs
18585 .       rr #DIVERTED
18586 .       rr @TOP
18587 .       ch RR_@TOP
18588 .END
18589 \#
18590 .MAC tbl*float-warning END
18591 .    tm1 "[mom]: Table in FLOAT, output page \\n[#PAGENUMBER], exceeds page vertical limits.
18592 .    tm1 "       Multipage boxed tables cannot be contained within floats.
18593 .    ab Aborting '\\n[.F]'.
18594 .END
18595 \#
18596 .MAC ds@need END \" Move vertically until there is enough space for \$1
18597 .    if '\\n(.z'' \{\
18598 .       while \\n[.t]<=(\\$1)&(\\n[nl]>\\n[#PAGE_TOP]) \{\
18599 .          rs
18600 '          sp \\n[.t]u
18601 .       \}
18602 .    \}
18603 .END
18604 \#
18605 \# ***eqn***
18606 \#
18607 \# EQ/EN macros borrowed from ms, mommified by Robin Haberkorn
18608 \# <robin.haberkorn@googlemail.com>, expanded by Peter Schaffter.
18609 \#
18610 \# EQ [ -L | -C | -I <indent> ] [label]
18611 \# EN [ CONT | CONTINUED | ... ]
18612 \#
18613 \# Equations are centered by default, but can be left-justified
18614 \# (EQ -L), explicitly centered, or indented (EQ -I).
18615 \#
18616 \# Each eqn block for multi-line equations aligned with 'mark' and
18617 \# 'lineup' should be terminated by passing 'CONT' or 'CONTINUED'
18618 \# or '...' to EN.
18619 \#
18620 \# Note that geqn mark and lineup work correctly in centered equations.
18621 \#
18622 .MAC EQ END
18623 .    if \\n[eqn*copy-in]=1 \{\
18624 .       if !\\n[eqn-linenum] .nr eqn-linenum \\n[.c]
18625 .       if !\\n[pgnum] .nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
18626 .       br
18627 .       if \\n[.u] .nr fill 1
18628 .       rr float*eqn
18629 .       if '\\n[.z]'FLOAT*DIV' .nr float*eqn 1
18630 .       nr eqn*restore-adj \\n[.j]
18631 .       if !\\n[continued] \{\
18632 .          PDF_TARGET eqn:\\n+[lists*target]
18633 .          rr eqn*type
18634 .          nr loop-counter \\n[#NUM_ARGS]
18635 .          nr loop-count 0 1
18636 .          while \\n+[loop-count]<=\\n[loop-counter] \{\
18637 .             if '\\$1'-L' \{\
18638 .                nr eqn*left 1
18639 .                nr eqn*type 1
18640 .                shift
18641 .             \}
18642 .             if '\\$1'-I' \{\
18643 .                nr eqn*ind  1
18644 .                nr eqn*type 2
18645 .                shift
18646 .                ds DI \\$1
18647 .                ds DI@cont \\*[DI]
18648 .                shift
18649 .             \}
18650 .             if '\\$1'-C' \{\
18651 .                nr eqn*center 1
18652 .                nr eqn*type   3
18653 .                shift
18654 .             \}
18655 .             if '\\$1'ADJUST' \{\
18656 .                ds eqn*space-adj \\$2
18657 .                shift 2
18658 .             \}
18659 .             if '\\$1'NO_SHIM' \{\
18660 .                nr eqn*no-shim 1
18661 .                shift 1
18662 .             \}
18663 .             if '\\$1'LABEL' \{\
18664 .                ds eqn*label \\$2
18665 .                ds label-type eqn
18666 .                shift 2
18667 .             \}
18668 .             if '\\$1'SHIFT_LABEL' \{\
18669 .                ds eqn*shift-label \\$2
18670 .                shift 2
18671 .             \}
18672 .             if '\\$1'CAPTION' \{\
18673 .                ds eqn*caption \\$2
18674 .                shift 2
18675 .             \}
18676 .             if '\\$1'SHORT_CAPTION' \{\
18677 .                ds eqn*caption-short \\$2
18678 .                shift 2
18679 .             \}
18680 .          \}
18681 .       \}
18682 .       if '\\*[eqn*shift-label]'' .ds eqn*shift-label 0
18683 .       if !\\n[eqn*type] \{\
18684 .          nr eqn*center 1
18685 .          nr eqn*type   3
18686 .          shift
18687 .       \}
18688 .       if !'\\*[eqn*caption]'' \{\
18689 .          if '\\*[caption-quad]'L' \{\
18690 .             if \\n[default-left] .ds caption-quad R
18691 .             rr default-left
18692 .          \}
18693 .       \}
18694 .       if \\n[continued] \{\
18695 .          rm continued
18696 .          rr continued
18697 .       \}
18698 .       if \\n[eqn@left*cont] .nr eqn*type 1
18699 .       if \\n[eqn@ind*cont]  \{\
18700 .           nr eqn*type 2
18701 .           ds DI \\*[DI@cont]
18702 .       \}
18703 .    \}
18704 .    if \\n[eqn@center*cont] .nr eqn*type 3
18705 .    ev EQN
18706 .    evc 0
18707 .    di eqn*div
18708 .    in 0
18709 .    nf
18710 .END
18711 \#
18712 .MAC EN END
18713 .    if !'\\n(.z'eqn*div' \{\
18714 .       @error mismatched EN
18715 .       return
18716 .    \}
18717 .    br
18718 .    di
18719 .    ev
18720 .    if !'\\*[eqn*label]''   .nr eqn*have-label   1
18721 .    if !'\\*[eqn*caption]'' .nr eqn*have-caption 1
18722 .    if !'\\$1'' \{\
18723 .       ie '\\$1'...' .ds continued CONT
18724 .       el .ds continued \\$1
18725 .       substring continued 0 3
18726 .       ie '\\*[continued]'CONT' \{\
18727 .          nr continued 1
18728 .          rm continued
18729 .          if \\n[eqn*ind]    .nr eqn@ind*cont    1
18730 .          if \\n[eqn*left]   .nr eqn@left*cont   1
18731 .          if \\n[eqn*center] .nr eqn@center*cont 1
18732 .       \}
18733 .       el \{\
18734 .          tm1 "[mom]: Invalid argument \\$1 to \\$0.
18735 .          tm1 "       Must be 'CONTINUED', 'CONT', or '...'
18736 .          ab Aborting '\\n[.F]' at line \\n[.c].
18737 .       \}
18738 .    \}
18739 .    if \\n[dl]:\\n[eqn*have-label] \{\
18740 .       ds eqn*tabs \\n[.tabs]
18741 .       if \\n[eqn*label-with-chapter] \
18742 .          ds chapno \\n[#CH_NUM].
18743 .       nf
18744 .       ie \\n[dl] \{\
18745 .          if !'\\n[.z]'FLOAT*DIV' \{\
18746 .             ie \\n[eqn*have-caption] .ne \\n[dn]u-\\n[.V]
18747 .             el .ne \\n[dn]u-1v-\\n[.V]
18748 .          \}
18749 .          chop eqn*div
18750 .          if '\\*[DD]'' \{\
18751 .             ds DD .5v
18752 .             if !\\n[@TOP] \{\
18753 .                sp \\*[DD]
18754 .                if !'\\*[eqn*space-adj]'' .sp \\*[eqn*space-adj]u
18755 .             \}
18756 .          \}
18757 .          if \\n[cutaround] .ll \\n[eqn*cutaround-width]u
18758 .          ie \\n[eqn*type]=1 \{\
18759 .             ta (u;\\n[.l]-\\n[.i])R
18760 .             ie \\n[continued] .nop \\*[eqn*div]
18761 .             el \{\
18762 .                ie \\n[eqn*autolabel] \
18763 .nop \
18764 \\*[eqn*div]\
18765 \\*[eqn*label-specs]\
18766 \t\v'+\\*[eqn*shift-label]'\
18767 \\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
18768 \v'-\\*[eqn*shift-label]'\
18769 \\*[revert-specs]
18770 .                el \
18771 .nop \
18772 \\*[eqn*div]\
18773 \\*[eqn*label-specs]\
18774 \t\v'+\\*[eqn*shift-label]'\
18775 \\*[eqn*label]\
18776 \v'-\\*[eqn*shift-label]'\
18777 \\*[revert-specs]
18778 .             \}
18779 .             if \\n[eqn-cutaround] .ll
18780 .             if !\\n[continued] \{\
18781 .                if \\n[eqn*have-caption] \
18782 .                   ADD_CAPTION
18783 .             \}
18784 .          \}
18785 .          el \{\
18786 .             ie \\n[eqn*type]=2 \{\
18787 .                ie '\\*[eqn*label-quad]'L' \{\
18788 .                   ta \\*[DI]
18789 .                   ie \\n[continued] .nop \t\\*[eqn*div]
18790 .                   el \{\
18791 .                      ie \\n[eqn*autolabel] \
18792 .nop \
18793 \\*[eqn*label-specs]\
18794 \v'+\\*[eqn*shift-label]'\
18795 \\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
18796 \v'-\\*[eqn*shift-label]'\
18797 \t\\*[eqn*div]\
18798 \\*[revert-specs]
18799 .                      el \
18800 .nop \
18801 \\*[eqn*label-specs]\
18802 \v'+\\*[eqn*shift-label]'\
18803 \\*[eqn*label]\
18804 \v'-\\*[eqn*shift-label]'\
18805 \\*[revert-specs]\
18806 \t\\*[eqn*div]
18807 .                   \}
18808 .                \}
18809 .                el \{\
18810 .                   ta \\*[DI] (u;\\n[.l]-\\n[.i])R
18811 .                   ie \\n[continued] .nop \t\\*[eqn*div]
18812 .                   el \{\
18813 .                      ie \\n[eqn*autolabel] \
18814 .nop \
18815 \t\\*[eqn*div]\
18816 \\*[eqn*label-specs]\
18817 \t\v'+\\*[eqn*shift-label]'\
18818 \\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
18819 \v'-\\*[eqn*shift-label]'\
18820 \\*[revert-specs]
18821 .                      el \
18822 .nop \
18823 \t\\*[eqn*div]\
18824 \\*[eqn*label-specs]\
18825 \t\v'+\\*[eqn*shift-label]'\
18826 \\*[eqn*label]\
18827 \v'-\\*[eqn*shift-label]'\
18828 \\*[revert-specs]
18829 .                   \}
18830 .                \}
18831 .                if !\\n[continued] \{\
18832 .                   if \\n[eqn*have-caption] \
18833 .                      ADD_CAPTION
18834 .                \}
18835 .             \}
18836 .             el \{\
18837 .                ie '\\*[eqn*label-quad]'L' \{\
18838 .                   ta (u;\\n[.l]-\\n[.i]/2)C
18839 .                   ie \\n[continued] .nop \t\\*[eqn*div]
18840 .                   el \{\
18841 .                      ie \\n[eqn*autolabel] \
18842 .nop \
18843 \\*[eqn*label-specs]\
18844 \v'+\\*[eqn*shift-label]'\
18845 \\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
18846 \v'-\\*[eqn*shift-label]'\
18847 \t\\*[eqn*div]\
18848 \\*[revert-specs]
18849 .                      el \
18850 .nop \
18851 \\*[eqn*label-specs]\
18852 \v'+\\*[eqn*shift-label]'\
18853 \\*[eqn*label]\
18854 \v'-\\*[eqn*shift-label]'\
18855 \\*[revert-specs]\
18856 \t\\*[eqn*div]
18857 .                   \}
18858 .                \}
18859 .                el \{\
18860 .                   ta (u;\\n[.l]-\\n[.i]/2)C (u;\\n[.l]-\\n[.i])R
18861 .                   ie \\n[continued] .nop \t\\*[eqn*div]
18862 .                   el \{\
18863 .                      ie \\n[eqn*autolabel] \
18864 .nop \
18865 \t\\*[eqn*div]\
18866 \\*[eqn*label-specs]\
18867 \t\v'+\\*[eqn*shift-label]'\
18868 \\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
18869 \v'-\\*[eqn*shift-label]'\
18870 \\*[revert-specs]
18871 .                      el \
18872 .nop \
18873 \t\\*[eqn*div]\
18874 \\*[eqn*label-specs]\
18875 \t\v'+\\*[eqn*shift-label]'\
18876 \\*[eqn*label]\
18877 \v'-\\*[eqn*shift-label]'\
18878 \\*[revert-specs]
18879 .                   \}
18880 .                \}
18881 .                if !\\n[continued] \{\
18882 .                   if \\n[eqn*have-caption] \
18883 .                      ADD_CAPTION
18884 .                \}
18885 .             \}
18886 .          \}
18887 .       \}
18888 .       el \{\
18889 .          ta (u;\\n[.l]-\\n[.i])R
18890 .nop \
18891 \\*[eqn*label-specs]\
18892 \t\v'+\\*[eqn*shift-label]'\
18893 \t\\*[eqn*label]\
18894 \v'-\\*[eqn*shift-label]'\
18895 \\*[revert-specs]
18896 .       \}
18897 .       ta \\*[eqn*tabs]
18898 .\" if continuing (ie is a multi-line equation), don't space and SHIM
18899 .       if !\\n[continued] \{\
18900 .          sp \\*[DD]
18901 .          if !'\\*[eqn*space-adj]'' .sp -\\*[eqn*space-adj]u
18902 .          if !'\\n[.z]'FLOAT*DIV' \{\
18903 .             if !\\n[eqn*no-shim] .SHIM
18904 .          \}
18905 .          if !'\\*[eqn*caption-short]'' .ds short -short
18906 .          if \\n[eqn*autolabel] \
18907 .             ds eqn*label \\*[chapno]\\n[eqn*label-num]
18908 .          ie !'\\*[eqn*label]'' \
18909 .             TO_EQUATIONS "\\*[eqn*label]" "\\*[eqn*caption\\*[short]]"
18910 .          el .TO_EQUATIONS "\\*[eqn*caption\\*[short]]"
18911 .          rm DD
18912 .          rm eqn*caption
18913 .          rm eqn*caption-short
18914 .          rm eqn*label
18915 .          rm short
18916 .          rr eqn*copy-in
18917 .       \}
18918 .       rm DI@cont
18919 .       rr eqn*center
18920 .       rr eqn@center*cont
18921 .       rr eqn*have-label
18922 .       rr eqn*ind
18923 .       rr eqn@ind*cont
18924 .       rr eqn*left
18925 .       rr eqn@left*cont
18926 .       if !\\n[eqn-cutaround] .rm eqn*space-adj
18927 .    \}
18928 .    nr eqn*copy-in 1
18929 .    if \\n[fill] .fi
18930 .    ad \\n[eqn*restore-adj]
18931 .    rr fill
18932 .END
18933 \#
18934 .MAC ADD_CAPTION END
18935 .    ie \\n[.t]<\\n[.v] \{\
18936 .       if !'\\n[.z]'FLOAT*DIV' \{\
18937 .          if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
18938 .             tm1 "[mom]: '\\n[.F]', macro EQ, line \\n[eqn-linenum]: Insufficient room for
18939 .             tm1 "        equation caption on page \\n[pgnum].
18940 .             tm1 "        Skipping caption, but continuing to process.
18941 .             if !\\n[@TOP] \{\
18942 .                if \\n[#COL_NUM]=\\n[#NUM_COLS] \
18943 .                   NEWPAGE
18944 .             \}
18945 .             rr eqn-linenum
18946 .             rr pgnum
18947 .          \}
18948 .       \}
18949 .    \}
18950 .    el \{\
18951 .       if \\n[#PRINT_STYLE]=2 \{\
18952 .          ps \\*[eqn*caption-size-change]
18953 .          nr lead-curr \\n[.v]
18954 .          sp .5v
18955 .          vs \\n[.ps]u+\\n[eqn*caption-autolead]u
18956 .          nr eqn*caption-lead-diff \\n[lead-curr]-\\n[.v]
18957 .          sp \\n[eqn*caption-lead-diff]u
18958 .          ps
18959 .          if !'\\*[eqn*caption-space]'' \
18960 .             sp \\*[eqn*caption-space]
18961 .       \}
18962 .       if '\\*[eqn*caption-quad]'L' \{\
18963 .          fi
18964 .          ad l
18965 .          nop \
18966 \\*[eqn*caption-specs]\
18967 \\*[eqn*caption]\
18968 \\*[revert-specs]
18969 .          nf
18970 .       \}
18971 .       if '\\*[eqn*caption-quad]'C' \{\
18972 .          fi
18973 .          ad c
18974 .          nop \
18975 \\*[eqn*caption-specs]\
18976 \\*[eqn*caption]\
18977 \\*[revert-specs]
18978 .          nf
18979 .       \}
18980 .       if '\\*[eqn*caption-quad]'R' \{\
18981 .          fi
18982 .          ad r
18983 .          nop \
18984 \\*[eqn*caption-specs]\
18985 \\*[eqn*caption]\
18986 \\*[revert-specs]
18987 .          nf
18988 .       \}
18989 .       if !'\\*[eqn*caption-space]'' \
18990 .          sp -\\*[eqn*caption-space]
18991 .       vs
18992 .    \}
18993 .END
18994 \#
18995 \# ***pic***
18996 \#
18997 .MAC have-adjust END
18998 .    nr #ARGS  0 1
18999 .    nr #COUNT \\n[#NUM_ARGS]
19000 .    while \\n+[#ARGS]<=\\n[#COUNT] \{\
19001 .       if '\\$1'ADJUST' \{\
19002 .          ds pic*space-adj \\$2
19003 .          break
19004 .       \}
19005 .       shift
19006 .    \}
19007 .END
19008 \#
19009 \# User settable text style for pic
19010 \#
19011 \# PIC_TEXT_STYLE
19012 \# --------------
19013 \# *Argument:
19014 \#   <offset from page left>
19015 \# *Function:
19016 \#   Stores user supplied page offset in register #L_MARGIN.
19017 \#   Sets .po to user supplied offset.
19018 \# *Notes:
19019 \#   Requires unit of measure.
19020 \#
19021 .MAC PIC_TEXT_STYLE END
19022 .    nr #ARGS  0 1
19023 .    nr #COUNT \\n[#NUM_ARGS]
19024 .    while \\n+[#ARGS]<=\\n[#COUNT] \{\
19025 .       if '\\$1'FAMILY' \{\
19026 .          shift
19027 .          ds pic*text-family \\$1
19028 .          shift
19029 .       \}
19030 .       if '\\$1'FONT' \{\
19031 .          shift
19032 .          ds pic*text-font \\$1
19033 .          shift
19034 .       \}
19035 .       if '\\$1'SIZE' \{\
19036 .          shift
19037 .          ds pic*text-size-change \\$1
19038 .          shift
19039 .       \}
19040 .       if '\\$1'AUTOLEAD' \{\
19041 .          shift
19042 .          nr pic*text-autolead \\$1
19043 .          shift
19044 .       \}
19045 .    \}
19046 .END
19047 \#
19048 \# Main macros
19049 \#
19050 .MAC PS END
19051 .    br
19052 .    have-adjust \\$@ \" Adjusting is handled by FLOAT
19053 .    ds ev-current \\n[.ev]
19054 .    rr float*pic
19055 .    if !'\\n[.z]'FLOAT*DIV' .FLOAT ADJUST \\*[pic*space-adj]
19056 .    PDF_TARGET fig:\\n+[lists*target]
19057 .    nr float*pic 1
19058 .    nr ind-pre-pic  \\n[.i]
19059 .    nr ll-pre-pic   \\n[.l]
19060 .    nr lead-pre-pic \\n[.v]
19061 .    if \\n[#MLA] .sp .5v
19062 .    in 0
19063 .    ev PIC
19064 .    evc \\n[ev-current]
19065 .    nf
19066 .    ie \\n[#NUM_ARGS]<2 .@error bad arguments to PS (not preprocessed with pic?)
19067 .    el \{\
19068 .       if \B'\\$1' \{\
19069 .          ie !\B'\\$2' .ds pic*scale-width \\$1
19070 .          el .ds pic*scale-width \\$2
19071 .       \}
19072 .    \}
19073 . \" This is a bit confusing. pic is decorated with 2 args (width
19074 . \" and height), which are read during pre-processing but have to be
19075 . \" ignored when parsing args during main processing.  We shift pic's
19076 . \" args out of the way, then pop them off the arg stack because
19077 . \" they're not needed during macro processing.
19078 .    while \B'\\$1' .shift
19079 .    nr loop-counter \\n[#NUM_ARGS]
19080 .    nr loop-count 0 1
19081 .    while \\n+[loop-count]<=\\n[loop-counter] \{\
19082 .       if '\\$1'NO_SHIM' \{\
19083 .          nr float*no-shim 1
19084 .          shift 1
19085 .       \}
19086 .       if '\\$1'LEFT' \{\
19087 .          nr pic*left 1
19088 .          shift 1
19089 .       \}
19090 .       if '\\$1'CAPTION' \{\
19091 .          nr pic*have-caption 1
19092 .          ds pic*caption \\$2
19093 .          shift 2
19094 .       \}
19095 .       if '\\$1'SHORT_CAPTION' \{\
19096 .          ds pic*caption-short \\$2
19097 .          shift 2
19098 .       \}
19099 .       if '\\$1'LABEL' \{\
19100 .          nr pic*have-label 1
19101 .          ds pic*label \\$2
19102 .          ds label-type pic
19103 .          shift 2
19104 .       \}
19105 .    \}
19106 .    ds pic*label-sffx-tmp \\*[pic*label-sffx]
19107 .    substring pic*label-sffx-tmp -1
19108 .    if '\\*[pic*label-sffx-tmp]'.' \
19109 .       if \\n[pic*caption-after-label]=0 .chop pic*label-sffx
19110 .    if \\n[#MLA] \{\
19111 .       if (\\n[pic*have-label]=1):(\\n[pic*autolabel]=1) \{\
19112 .          if !\\n[pic*have-caption] \
19113 .             mla@error label caption \\n[.F] \\$0 \\n[.c]
19114 .       \}
19115 .       if \\n[pic*have-caption] \{\
19116 .          if !\\n[pic*have-label] \{\
19117 .             if !\\n[pic*autolabel] \
19118 .                mla@error caption label \\n[.F] \\$0 \\n[.c]
19119 .          \}
19120 .       \}
19121 .    \}
19122 .    if !'\\*[pic*text-family]'' \
19123 .       fam \\*[pic*text-family]
19124 .    if !'\\*[pic*text-font]'' \
19125 .       ft \\*[pic*text-font]
19126 .    if !'\\*[pic*text-size-change]'' \
19127 .       ps \\n[#DOC_PT_SIZE]u\\*[pic*text-size-change]
19128 .    nr lead-current \\n[.v]
19129 .    ie \\n[pic*text-autolead] \
19130 .       vs \\n[.ps]u+(\\n[pic*text-autolead]u*1000u)
19131 .    el .vs \\n[.ps]u
19132 .    nr pic@text-lead \\n[.v]
19133 .    nr pic@text-size \\n[.ps]
19134 .    if !'\\*[pic*text-color]'' .gcolor \\*[pic*text-color]
19135 .    if \\n[@TOP] \{\
19136 .       RESTORE_SPACE
19137 .       nr pic*top-lead-adj 1
19138 .    \}
19139 .    nr pic*top-lead-diff \\n[lead-pre-pic]u-\\n[.v]u
19140 .    if (\\n[pic*have-caption]=0):(\\n[pic*caption-after-label]=1) \{\
19141 .       ie \\n[pic*top-lead-adj] \{\
19142 .          sp \\n[pic*top-lead-diff]u
19143 .          rr pic*top-lead-adj
19144 .       \}
19145 .       el .if (\\n[pic*caption-after-label]=0):(\\n[#MLA]=0) .sp \\n[lead-pre-pic]u/2u
19146 .    \}
19147 .    di pic*div
19148 .END
19149 \#
19150 .MAC PE END
19151 .    di
19152 .    nr pic*div-width \\n[dl]
19153 .    if \\n[@TOP] \{\
19154 .       RESTORE_SPACE
19155 .    \}
19156 .    sp \\n[lead-pre-pic]u/2u
19157 .    if (\\n[pic*have-caption]=1)&(\\n[pic*caption-after-label]=0) \{\
19158 .       sp .5v
19159 .       ev caption
19160 .       evc \\*[ev-current]
19161 .       nh
19162 .       ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
19163 .       el \{\
19164 .          pic*caption-style
19165 .          nr lead-current \\n[.v]
19166 .          vs \\n[.ps]u+\\n[pic*caption-autolead]u
19167 .          nr pic*caption-lead-diff \\n[lead-current]-\\n[.v]
19168 .          in \\n[ind-pre-pic]u
19169 .       \}
19170 .       PIC*SET_CAPTION_QUAD \\*[pic*caption-quad]
19171 .       if \\n[@TOP] .RESTORE_SPACE
19172 \!.     in -\\n[ind-pre-pic]u
19173 .       sp \\n[pic*caption-lead-diff]u
19174 \!.     if \\\\n[.ns] .rs
19175 .       nop \\*[pic*caption]
19176 .       if \\n[#PRINT_STYLE]=1 .sp .5v
19177 .       if !'\\*[pic*caption-space]'' \
19178 .          sp \\*[pic*caption-space]
19179 .       br
19180 .       ev
19181 .    \}
19182 .    if !\\n[pic*left] .in \\n[ll-pre-pic]u-\\n[pic*div-width]u/2u
19183 .    pic*div
19184 .    sp
19185 .    if (\\n[pic*have-label]=1):(\\n[pic*autolabel]=1):(\\n[pic*caption-after-label]=1) \{\
19186 .       nr lead-pre-label \\n[.v]
19187 .       ev label
19188 .       evc \\*[ev-current]
19189 .       ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
19190 .       el \{\
19191 .          pic*label-style
19192 .          nr lead-current \\n[.v]
19193 .          vs \\n[.ps]u+\\n[pic*label-autolead]u
19194 .          in \\n[ind-pre-pic]u
19195 .          sp \\n[lead-current]u-\\n[.v]u
19196 .       \}
19197 .       if \\n[pic*label-with-chapter] \
19198 .          ds chapno \\n[#CH_NUM].
19199 .       PIC*SET_LABEL_QUAD \\*[pic*label-quad]
19200 \!.     in -\\n[ind-pre-pic]u
19201 .       sp \\n[lead-pre-label]u-\\n[.v]u
19202 .       if !'\\*[pic*label-space]'' .sp \\*[pic*label-space]
19203 .       if \\n[#PRINT_STYLE]=1 .sp .5v
19204 .       ie \\n[pic*autolabel] \
19205 .         nop \
19206 \\*[pic*label-prfx]\\*[chapno]\\n+[fig*label-num]\\*[pic*label-sffx]\|
19207 .       el .if !'\\*[pic*label]'' .nop \\*[pic*label]
19208 .       if \\n[pic*autolabel] \
19209 .          ds pic*label \\*[chapno]\\n[fig*label-num]
19210 .       fam
19211 .       ft
19212 .       ps
19213 .       gcolor
19214 .       ie !\\n[pic*caption-after-label] .br
19215 .       el \{\
19216 .          if !'\\*[pic*caption]'' .nop \
19217 \\*[pic*caption-specs]\\*[pic*caption]\\*[revert-specs]
19218 .          br
19219 .       \}
19220 .       ev
19221 .       in 0
19222 .    \}
19223 .    ev
19224 .    sp .5v
19225 .    FLOAT off
19226 .    in \\n[ind-pre-pic]u
19227 .    if !'\\*[pic*caption-short]'' .ds short -short
19228 .    ie !'\\*[pic*label]'' \
19229 .       TO_FIGURES "\\*[pic*label]" "\\*[pic*caption\\*[short]]"
19230 .    el .TO_FIGURES "\\*[pic*caption\\*[short]]"
19231 .    rm pic*caption
19232 .    rm pic*label
19233 .    rm pic*left
19234 .    rm short
19235 .    if !\\n[cutaround] .rm pic*space-adj
19236 .    if !\\n[defer] .rr pic*have-caption
19237 .    rr pic*have-label
19238 .    rr float*pic
19239 .    if '\\*[pic*label-sffx-tmp]'.' .ds pic*label-sffx .
19240 .END
19241 \#
19242 \# ***refer***
19243 \#
19244 \# Footnote references
19245 \# -------------------
19246 \# *Function:
19247 \#   Instruct REF to put references in footnotes.
19248 \#
19249 .MAC FOOTNOTE_REFS END
19250 .    ie !'\\$1'' .rr #FN_REF
19251 .    el \{\
19252 .       if r #EN_REF .rr #EN_REF
19253 .       nr #FN_REF 1
19254 .    \}
19255 .    REF_STYLE NOTE
19256 .END
19257 \#
19258 \# Endnote references
19259 \# ------------------
19260 \# *Function:
19261 \#   Instruct REF to collect references for endnotes output.
19262 \#
19263 .MAC ENDNOTE_REFS END
19264 .    ie !'\\$1'' .rr #EN_REF
19265 .    el \{\
19266 .       if r #FN_REF .rr #FN_REF
19267 .       nr #EN_REF 1
19268 .       if !r#EN_MARKER_STYLE .ENDNOTE_MARKER_STYLE SUPERSCRIPT
19269 .    \}
19270 .    REF_STYLE NOTE
19271 .END
19272 \#
19273 \# Prepare mom for a reference
19274 \# ---------------------------
19275 \# *Argument:
19276 \#   <none> | INDENT  L|LEFT|R|RIGHT|B|BOTH  <indent value>
19277 \# *Function:
19278 \#   Calls FOOTNOTE or ENDNOTE, depending on whether #REF_FN or
19279 \#   #REF_EN is set to 1.
19280 \# *Notes:
19281 \#   For convenience, REF is a toggle.
19282 \#
19283 \#   REF optionally takes the same arguments as FOOTNOTE, allowing
19284 \#   users to indent references that go in footnotes when footnote
19285 \#   indenting is required.  FOOTNOTE_REFS must be on for this.
19286 \#
19287 .MAC REF END
19288 .    ie \\n[#FN_REF]+\\n[#EN_REF]=0 \{\
19289 .       if !\\n[#REF_WARNING]=1 \{\
19290 .          tm1 "[mom]: Before REF at line \\n[.c], neither FOOTNOTE_REFS nor ENDNOTE_REFS
19291 .          tm1 "       has been selected.  If "sort" and "accumulate" are in your refer
19292 .          tm1 "       commands, references will be collected for later output with $LIST$.
19293 .          tm1 "       Otherwise, they will disappear.
19294 .          nr #REF_WARNING 1
19295 .       \}
19296 .    \}
19297 .    el \{\
19298 .       ie \\n[#REF]=1 \{\
19299 .          if \\n[#FN_REF]=1 .FOOTNOTE OFF
19300 .          if \\n[#EN_REF]=1 .ENDNOTE OFF
19301 .          rr #REF
19302 .       \}
19303 .       el \{\
19304 .          rr #REF_WARNING
19305 .          nr #REF 1
19306 .          if \\n[#FN_REF]=1 .FOOTNOTE \\$1 \\$2 \\$3
19307 .          if \\n[#EN_REF]=1 .ENDNOTE
19308 .       \}
19309 .    \}
19310 .END
19311 \#
19312 \# Embedded references in text (with brackets)
19313 \# -------------------------------------------
19314 \#
19315 .MAC REF_BRACKETS_NOTICE END
19316 .    tm1 "[mom]: \\$1 has been removed from mom.  See the mom documentation 'refer.html'
19317 .    tm1 "       for instructions on parenthetical insertions of references into text.
19318 .    ie '\\$1'REF_STYLE' .tm1 "       Continuing to process '\\n[.F]' from line \\n[.c].
19319 .    el .ab Aborting '\\n[.F]' at \\$1, line \\n[.c].
19320 .END
19321 \#
19322 .MAC REF_BRACKETS_START END
19323 .    REF_BRACKETS_NOTICE \\$0
19324 .END
19325 \#
19326 .MAC REF_BRACKETS_END END
19327 .    REF_BRACKETS_NOTICE \\$0
19328 .END
19329 \#
19330 \# These four pairs of aliases allow users to embed references in
19331 \# text and have them surrounded by (), [], {} or <>.
19332 \#
19333 .ALIAS REF( REF_BRACKETS_START
19334 .ALIAS REF) REF_BRACKETS_END
19335 \#
19336 .ALIAS REF[ REF_BRACKETS_START
19337 .ALIAS REF] REF_BRACKETS_END
19338 \#
19339 .ALIAS REF{ REF_BRACKETS_START
19340 .ALIAS REF} REF_BRACKETS_END
19341 \#
19342 .ALIAS REF< REF_BRACKETS_START
19343 .ALIAS REF> REF_BRACKETS_END
19344 \#
19345 .MAC REF_STYLE END
19346 .    REF_BRACKETS_NOTICE \\$0
19347 .END
19348 \#
19349 \# Refer indenting
19350 \# ---------------
19351 \# *Argument:
19352 \#   FOOTNOTE | ENDNOTE | BIBLIO <indent for 2nd and subsequent lines of discrete reference entries>
19353 \# *Function:
19354 \#   Sets registers #REF_FN_INDENT, #REF_EN_INDENT or #REF_BIB_INDENT.
19355 \# *Notes:
19356 \#   Indent value requires a unit of measure.  If refs are going
19357 \#   into footnotes or endnotes, first lines get indented; if going
19358 \#   into a bibliography, second lines get indented
19359 \#
19360 .MAC INDENT_REFS END
19361 .    if '\\$1'FOOTNOTE' .ds $REF_FN_INDENT  \\$2
19362 .    if '\\$1'ENDNOTE'  .ds $REF_EN_INDENT  \\$2
19363 .    if '\\$1'BIBLIO'   .ds $REF_BIB_INDENT \\$2
19364 .END
19365 \#
19366 \# Hyphenation of references
19367 \# -------------------------
19368 \# *Argument:
19369 \#   <none> | <anything>
19370 \# *Function:
19371 \#   Sets register #REF_HY
19372 \#
19373 .MAC HYPHENATE_REFS END
19374 .    ie '\\$1'' .nr #REF_HY 1
19375 .    el \{\
19376 .       if r #REF_HY .rr #REF_HY
19377 .    \}
19378 .END
19379 \#
19380 \# The remainder of the definitions in this section are modified
19381 \# versions of the definitions found in the refer module of s.tmac.
19382 \#
19383 .de @error
19384 .tm [mom]: '\\n[.F]', line \\n[.c]: \\$*
19385 ..
19386 \#
19387 \# Underlining unavoidably turns off sentence spacing.
19388 \#
19389 .de ref*restore-ss
19390 \c
19391 .SS \\*[$SAVED_SS_VAR]
19392 .if '\\n[.z]'END_NOTES' \{\
19393 \c
19394 \E*[PREV]\c
19395 .\}
19396 ..
19397 \# The following strings define the order of entries for different
19398 \# types of references.  Each letter in the string refers to a database
19399 \# field (A for author, T1/T2 for article and book titles, etc).
19400 \#
19401 .de ref*specs
19402 .if \\n[#PRINT_STYLE]=1 \{\
19403 .   char '     \[aq]
19404 .   char \[oq] \[aq]
19405 .\}
19406 .\" Internet site - type 0
19407 .ds ref*spec!0 i Q A m p T2 s o D c a u n
19408 .\" Journal article - type 1
19409 .ds ref*spec!1 i Q A m p T2 q O J V S N D P n
19410 .\" Book - type 2
19411 .ds ref*spec!2 i Q A m p T1 q b d l r E S e V O C I D P t n
19412 .\" Article within book - type 3
19413 .ds ref*spec!3 i Q A m p T2 B b d l r E S e V O C I D P t n
19414 .\" Tech report - type 4
19415 .ds ref*spec!4 i Q A m p T1 R G O C I D P n
19416 .\" Magazine or newspaper article - type 5
19417 .ds ref*spec!5 i Q A m p T2 O M V S N D P n
19418 ..
19419 \#
19420 \# Refer's "1st" macro.  Since it is possible to define database
19421 \# fields using any single letter, we remove all possible string
19422 \# definitions of the form [X and [x.  Also, reset ref*spec!<n>
19423 \# strings to their defaults.
19424 \#
19425 .de ]-
19426 .ref*specs
19427 .rm [A [B [C [D [E [F [G [H [I [J [K [L [M \
19428     [N [O [P [Q [R [S [T [U [V [W [X [Y [Z \
19429     [a [b [c [d [e [f [g [h [i [j [k [l [m \
19430     [n [o [p [q [r [s [t [u [v [w [x [y [z
19431 .if r [e .rr [e \" [e persists if %e field is last
19432 .rr ref*type
19433 .rm ref*string
19434 ..
19435 \#
19436 \# Refer's "2nd" macro; builds up a reference with ref*build, and
19437 \# prints it with ref*print.
19438 \#
19439 .de ][
19440 .nr ref*type \\$1
19441 .if \\n[ref*type]=0 \{\
19442 .   ie d [C \{\
19443 .      if !d [I \{\
19444 .         nr pre-1900 1 \" If pre-1900, MLA allows excluding publisher
19445 .         nr ref*type 2
19446 .      \}
19447 .   \}
19448 .   el .nr ref*type 2
19449 .   if d [q .nr ref*type 2
19450 .\}
19451 .if \\n[ref*type]=3 \{\
19452 .   if !'\\*([R'' \{\
19453 .      nr ref*type 4
19454 .      ds ref*spec!4 i Q A m p T2 B R O C I D P n
19455 .   \}
19456 .   if !'\\*([G'' \{\
19457 .      nr ref*type 4
19458 .      ds ref*spec!4 i A m p T2 B G O C I D P O n
19459 .   \}
19460 .\}
19461 .if r [T \{\
19462 .   als [T1 [T
19463 .   als [T2 [T
19464 .\}
19465 .ie d ref*spec!\\n[ref*type] .ref*build \\*[ref*spec!\\n[ref*type]]
19466 .el \{\
19467 .   @error unknown reference type `\\n[ref*type]'
19468 .   ref*build \\*[ref*spec!0]
19469 .\}
19470 .if !\\n[.hy]=0 \{\
19471 .nr #RESTORE_HY \\n[.hy]
19472 .if !r#REF_HY .nh
19473 .\}
19474 .ref*print
19475 .if !\\n[#RESTORE_HY]=0 .hy \\n[#RESTORE_HY]
19476 .rr #RESTORE_HY
19477 .rm ref*string
19478 .rm [F [T1 [T2
19479 ..
19480 \#
19481 \# Refer's "3rd" macros, which set up and terminate the output
19482 \# of collected references
19483 \#
19484 .de ]<
19485 .als ref*print ref*end-print
19486 .nr #REF 1
19487 .if \\n[#BIB_LIST]=1 \{\
19488 .   nr #IN_BIB_LIST 1
19489 .   LIST DIGIT \\*[$BIB_LIST_SEPARATOR] \\*[$BIB_LIST_PREFIX]
19490 .\}
19491 ..
19492 \#
19493 .de ]>
19494 .LIST OFF
19495 .rr #REF
19496 .rr #IN_BIB_LIST
19497 .als ref*print ref*normal-print
19498 ..
19499 \#
19500 \# Output
19501 \# ------
19502 \#
19503 \# Output normal, non-collected refs
19504 \#
19505 .de ref*normal-print
19506 .nr #CURRENT_HY \\n[.hy]
19507 \\*[ref*string]
19508 ..
19509 \#
19510 \# Output collected refs
19511 \#
19512 .de ref*end-print
19513 .\" 10 is arbitrary
19514 .nn 10
19515 .nr #REF_BIB_INDENT (u;\\*[$REF_BIB_INDENT])
19516 .ie \\n[#BIB_LIST]=0 \{\
19517 .   in +\\n[#REF_BIB_INDENT]u
19518 .   ti -\\n[#REF_BIB_INDENT]u
19519 .\}
19520 .el .ITEM
19521 .\" Part of workaround for refer spitting out a blank page if the
19522 .\" last ref falls on the bottom line.
19523 \\*[ref*string]\R'ref*num*first-pass +1'\?\R'ref*num +1'\?
19524 .sp \\n[#BIB_SPACE]u
19525 .ie \\n[#BIB_LIST]=0 .in
19526 .el .IL -\\n[#REF_BIB_INDENT]u
19527 .nn 0
19528 ..
19529 \#
19530 .als ref*print ref*normal-print
19531 \#
19532 \# Build up the ref*string
19533 \#
19534 \# Correct MLA "typewritten" style (printstyle TYPEWRITE) demands
19535 \# two spaces after each period.  The spaces are hardwired into the
19536 \# string definitions (ref*add-<x>), so we have to make sure that there
19537 \# aren't two spaces when the printstyle is TYPESET.  Since I find that
19538 \# references look a bit crowded with 0 sentence space, I've bumped it
19539 \# up to +4.  User's sentence spacing is reset in FOOTNOTES and ENDNOTES.
19540 \#
19541 .de ref*build
19542 .if \\n[#PRINT_STYLE]=2 \{\
19543 .   ds $RESTORE_SS_VAR \\*[$SS_VAR]
19544 .   SS +8
19545 .\}
19546 .rm ref*string
19547 .while \\n[.$] \{\
19548 .   if d [\\$1 \{\
19549 .      ie d ref*add-\\$1 .ref*add-\\$1
19550 .      el .ref*add-dflt \\$1
19551 .   \}
19552 .   shift
19553 .\}
19554 .\" now add a final period
19555 .ie d ref*string \{\
19556 .   if !\\n[ref*suppress-period] .as ref*string .
19557 .   if d ref*post-punct \{\
19558 .      as ref*string "\\*[ref*post-punct]
19559 .      rm ref*post-punct
19560 .   \}
19561 .\}
19562 .el .ds ref*string
19563 ..
19564 \#
19565 \# The following macros determine how entries are formatted WRT
19566 \# punctuation, type style, additional strings, etc.
19567 \#
19568 \# o First argument is the database field letter.
19569 \# o Second argument is the punctuation character to use to separate this
19570 \#   field from the previous field.
19571 \# o Third argument is a string with which to prefix this field.
19572 \# o Fourth argument is a string with which to postfix this field.
19573 \# o Fifth argument is a string to add after the punctuation character
19574 \#   supplied by the next field.
19575 \#
19576 \# %A Author(s)
19577 .de ref*add-A
19578 .ds eval*[A \\*([A
19579 .substring eval*[A -1
19580 .if '\\*[eval*[A]'.' \{\
19581 .   if !'\\*[$REF_STYLE]'NOTE' .chop [A
19582 .\}
19583 .\" Per MLA, NOTE should not use idem, therefore if %i contains other than
19584 .\" idem (eg. ed., trans.), transpose it to after author's name
19585 .ie '\\*[$REF_STYLE]'NOTE' \{\
19586 .   ie !'\\*[idem]'' .ref*field A "" "" ", \\*[idem]"
19587 .   el .ref*field A
19588 .   rm idem
19589 .el .ref*field A
19590 .\}
19591 .if \\n([A .nr ref*suppress-period 1
19592 ..
19593 \# %i Idem.  BIBLIO: In all instances, removes %A field and replaces
19594 \# it with a dash; if %i field contains other than the word, idem,
19595 \# appends it to the dash
19596 .de ref*add-i
19597 .ie '\\*[$REF_STYLE]'NOTE' \{\
19598 .   ie '\\*([i'idem' .rm [i
19599 .   el .ds idem \\*([i
19600 .\}
19601 .el \{\
19602 .   ie '\\*([i'idem' \{\
19603 .      rm [A
19604 .      rm [i
19605 .      ref*field i "" \[idem] "" " "
19606 .   \}
19607 .   el \{\
19608 .      ds eval*[i \\*([i
19609 .      substring eval*[i -1
19610 .      if '\\*[eval*[i]'.' \{\
19611 .         chop [i
19612 .         ds idem \\*([i
19613 .      \}
19614 .      rm [i
19615 .      rm [A
19616 .      ref*field i "" \[idem] ", \\*[idem]" " "
19617 .   \}
19618 .\}
19619 ..
19620 \# %m Multiple authors (et al.)
19621 .de ref*add-m
19622 .if !'\\*[$REF_STYLE]'NOTE' \{\
19623 .   ds eval*[m \\*([m
19624 .   substring eval*[m -1
19625 .   if '\\*[eval*[m]'.' .chop [m
19626 .\}
19627 .ref*field m ,
19628 ..
19629 \# %p Post-author string (eg. Preface, Foreword, etc)
19630 .de ref*add-p
19631 .\" Convert first letter to uppercase, per MLA, if BIBLIO
19632 .if '\\*[$REF_STYLE]'BIBLIO' \{\
19633 .   ds initial*cap \\*([p
19634 .   substring initial*cap 0 0
19635 .   ds [p*string \\*([p
19636 .   substring [p*string 1
19637 .   ds [p \E*[UC]\\*[initial*cap]\E*[LC]\\*[[p*string]
19638 .\}
19639 .ie '\\*[$REF_STYLE]'NOTE' .ref*field p ,
19640 .el .ref*field p . " "
19641 ..
19642 \# %Q Author(s) when author is not a person
19643 .de ref*add-Q
19644 .ie '\\*[$REF_STYLE]'NOTE' .ref*field Q
19645 .el .ref*field Q
19646 ..
19647 \# %T Title (generic)
19648 .de ref*add-T1
19649 .ie '\\*[$REF_STYLE]'NOTE' .ref*field T , \E*[IT] \E*[ref*restore-ss]
19650 .el \{\
19651 .   ie !'\\*([A'' .ref*field T . " \E*[IT]" \E*[ref*restore-ss]
19652 .   el \{\
19653 .      ie !'\\*([Q'' .ref*field T . " \E*[IT]" \E*[ref*restore-ss]
19654 .      el .ref*field T . \E*[IT] \E*[ref*restore-ss]
19655 .   \}
19656 .\}
19657 .if \\n([T .nr ref*suppress-period \\n([T
19658 .
19659 ..
19660 \# %T Title of a chapter or article
19661 .de ref*add-T2
19662 .ie '\\*[$REF_STYLE]'NOTE' \{\
19663 .   ref*field T , \[lq] "" \[rq]
19664 .\}
19665 .el \{\
19666 .   ie '\\*([A'' \{\
19667 .      ref*field T . \[lq] "" \[rq]
19668 .      if !'\\*([Q''.ref*field T . " \[lq]" "" \[rq]
19669 .   \}
19670 .   el .ref*field T . " \[lq]" "" \[rq]
19671 .\}
19672 .if \\n([T .nr ref*suppress-period \\n([T
19673 ..
19674 \# %B Book title (when citing an article from a book)
19675 .de ref*add-B
19676 .ie '\\*[$REF_STYLE]'NOTE' \{\
19677 .   ie \\n([T .ref*field B "" \E*[IT] \E*[ref*restore-ss]
19678 .   el .ref*field B , \E*[IT] \E*[ref*restore-ss]
19679 .\}
19680 .el \{\
19681 .   ie \\n([T .ref*field B "" ".\E*[IT]" \E*[ref*restore-ss]
19682 .   el .ref*field B . " \E*[IT]" \E*[ref*restore-ss]
19683 .\}
19684 \# refer doesn't set reg [T to 1 for these book titles, so we do it here
19685 .ds eval*[B \\*([B
19686 .substring eval*[B -1
19687 .rr [T
19688 .if '\\*[eval*[B]'!' .nr [T 1
19689 .if '\\*[eval*[B]'?' .nr [T 1
19690 .rm eval*[B
19691 ..
19692 \# %q Titles that must go in quotes (e.g. an unpublished dissertation)
19693 .de ref*add-q
19694 .ie '\\*[$REF_STYLE]'NOTE' .ref*field q , \[lq] "" \[rq]
19695 .el \{\
19696 .   ie !'\\*([A'' .ref*field q . " \[lq]" "" \[rq]
19697 .   el \{\
19698 .      ie !'\\*([Q'' .ref*field q . " \[lq]" "" \[rq]
19699 .      el .ref*field q . \[lq] "" \[rq]
19700 .   \}
19701 .\}
19702 ..
19703 \# %R Report number for technical reports
19704 .de ref*add-R
19705 .ref*field R . " "
19706 ..
19707 \# %J Journal name
19708 .de ref*add-J
19709 .ie '\\*[$REF_STYLE]'NOTE' \{\
19710 .   ie \\n([T .ref*field J "" "\E*[IT]" \E*[ref*restore-ss]
19711 .   el .ref*field J , "\E*[IT]" \E*[ref*restore-ss]
19712 .\}
19713 .el \{\
19714 .   ie \\n([T .ref*field J "" " \E*[IT]" \E*[ref*restore-ss]
19715 .   el .ref*field J . " \E*[IT]" \E*[ref*restore-ss]
19716 .\}
19717 ..
19718 \# %M Magazine or newspaper name
19719 .de ref*add-M
19720 .ie '\\*[$REF_STYLE]'NOTE' \{\
19721 .   ie \\n([T .ref*field M "" "\E*[IT]" \E*[ref*restore-ss]
19722 .   el .ref*field M , "\E*[IT]" \E*[ref*restore-ss]
19723 .\}
19724 .el \{\
19725 .   ie \\n([T .ref*field M "" " \E*[IT]" \E*[ref*restore-ss]
19726 .   el .ref*field M . " \E*[IT]" \E*[ref*restore-ss]
19727 .\}
19728 ..
19729 \# %E Editor(s)
19730 .de ref*add-E
19731 .ds eval*[E \\*([E
19732 .substring eval*[E -1
19733 .if '\\*[eval*[E]'.' \{\
19734 .   if !\\n[#FN_REF]+\\n[#EN_REF] .chop [E
19735 .   rm eval*[E
19736 .\}
19737 .\" Workaround for join-authors also joining editors.  MLA style
19738 .\" requires a comma after first editor only if there are more than
19739 .\" two, whereas join-authors always puts a comma after the first if
19740 .\" there's more than one.
19741 .rm eval*[E
19742 .nr position 1 1
19743 .nr counter 1 1
19744 .while !'\\*[eval*[E]',' \{\
19745 .   ds eval*[E \\*([E
19746 .   substring eval*[E \\n+[position] \\n[position]
19747 .   if \\n+[counter]>30 .break \" 30 is abitrary
19748 .\}
19749 .\" Check for " and"
19750 .if '\\*[eval*[E]',' \{\
19751 .   ds eval*[E \\*([E
19752 .   nr and-check \\n[position]+4
19753 .   substring eval*[E \\n+[position] \\n[and-check]
19754 .\}
19755 .if '\\*[eval*[E]' and' \{\
19756 .   nr counter 1 1
19757 .   nr start-range -1 1
19758 .   nr end-range 3 1
19759 .   while !'\\*[eval*[E]', and' \{\
19760 .      ds eval*[E \\*([E
19761 .      substring eval*[E \\n+[start-range] \\n+[end-range]
19762 .      if \\n+[counter]>50 .break \" just in case; 50 is arbitrary
19763 .   \}
19764 .   if '\\*[eval*[E]', and' \{\
19765 .      length len*[E \\*([E
19766 .      nr rhs \\n[len*[E]-\\n[start-range]
19767 .      ds lhs \\*([E
19768 .      ds rhs \\*([E
19769 .      substring lhs 0 \\n[start-range]-1
19770 .      substring rhs -(\\n[rhs]-1)
19771 .      ds [E \\*[lhs]\\*[rhs]
19772 .   \}
19773 .   rm lhs
19774 .   rm rhs
19775 .   rr and-check
19776 .   rr counter
19777 .   rr start-range
19778 .   rr end-range
19779 .   rr len*[E
19780 .\}
19781 .\" End workaround
19782 .ie !\\n[ref*type]=0 \{\
19783 .   ie \\n([E>0 \{\
19784 .      ie '\\*[$REF_STYLE]'NOTE' \{\
19785 .         ie \\n([T .ref*field E "" "ed. "
19786 .         el .ref*field E , "ed. "
19787 .      \}
19788 .      el \{\
19789 .         ie \\n([T .ref*field E "" " Eds. "
19790 .         el .ref*field E . " Eds. "
19791 .      \}
19792 .   \}
19793 .   el \{\
19794 .      ie '\\*[$REF_STYLE]'NOTE' \{\
19795 .         ie \\n([T .ref*field E "" "ed. "
19796 .         el .ref*field E , "ed. "
19797 .      \}
19798 .      el \{\
19799 .         ie \\n([T .ref*field E "" " Ed. "
19800 .         el .ref*field E . " Ed. "
19801 .      \}
19802 .   \}
19803 .\}
19804 .el \{\
19805 .   ie \\n([T .ref*field E "" " "
19806 .   el .ref*field E . " "
19807 .\}
19808 .rr [T
19809 .rr [E
19810 ..
19811 \# %e Edition
19812 .de ref*add-e
19813 .ie \\n([T .ref*field e "" "" " ed."
19814 .el \{\
19815 .   ie '\\*[$REF_STYLE]'NOTE' .ref*field e , "" " ed."
19816 .   el .ref*field e . " " " ed."
19817 .\}
19818 .nr ref*suppress-period 1
19819 .nr [e 1
19820 .rr [T
19821 ..
19822 \# %V Volume (of a journal, or series of books); for journals, %N may be preferable
19823 .de ref*add-V
19824 .if \\n[ref*type]=1 \{\
19825 .   ref*field V
19826 .\}
19827 .if \\n[ref*type]=2 \{\
19828 .   ie '\\*[$REF_STYLE]'NOTE' .ref*field V , "vol. "
19829 .   el \{\
19830 .      ie \\n([T .ref*field V "" " Vol. "
19831 .      el .ref*field V . " Vol. "
19832 .   \}
19833 .\}
19834 .if \\n[ref*type]=3 \{\
19835 .   ie \\n([T .ref*field V "" " "
19836 .   el .ref*field V . " "
19837 .\}
19838 .rr [T
19839 ..
19840 \# %N Journal number
19841 .de ref*add-N
19842 .ref*field N
19843 ..
19844 \# %S Series (books or journals)
19845 .de ref*add-S
19846 .if \\n[ref*type]=1 \{\
19847 .   ref*field S
19848 .\}
19849 .if \\n[ref*type]=2 \{\
19850 .   ie '\\*[$REF_STYLE]'NOTE' \{\
19851 .      ie \\n([T .ref*field S
19852 .      el .ref*field S ,
19853 .   \}
19854 .   el \{\
19855 .      ie \\n([T .ref*field S "" " "
19856 .      el .ref*field S . " "
19857 .   \}
19858 .\}
19859 .if \\n[ref*type]=3 \{\
19860 .   ie \\n([T .ref*field S "" " "
19861 .   el .ref*field S . " "
19862 .\}
19863 .rr [T
19864 \# refer doesn't set reg [T to 1 for series titles, so we do it here
19865 .ds eval*[S \\*([S
19866 .substring eval*[S -1
19867 .if '\\*[eval*[S]'!' .nr [T 1
19868 .if '\\*[eval*[S]'?' .nr [T 1
19869 .rm eval*[S
19870 ..
19871 \# %C City
19872 .de ref*add-C
19873 .ie '\\*[$REF_STYLE]'NOTE' \{\
19874 .   ie r [d \{\
19875 .      ref*field C
19876 .      rr [d
19877 .   \}
19878 .   el \{\
19879 .      ref*field C "" \*[FU 2](
19880 .   \}
19881 .   if \\n([T .nr ref*suppress-period \\n([T
19882 .\}
19883 .el \{\
19884 .   ie \\n([T .ref*field C "" " "
19885 .   el \{\
19886 .      ie r [e .ref*field C "" " "
19887 .      el .ref*field C . " "
19888 .   \}
19889 .\}
19890 .rr [T
19891 .rr [e
19892 ..
19893 \# %I Publisher (I stands for Issuer)
19894 .de ref*add-I
19895 .ie '\\*[$REF_STYLE]'NOTE' \{\
19896 .   ie !'\\*([C'' .ref*field I :
19897 .   el .ref*field I "" (
19898 .\}
19899 .el \{\
19900 .   ie !'\\*([C'' .ref*field I :
19901 .   el \{\
19902 .      ie \\n([T .ref*field I "" " "
19903 .      el .ref*field I . " "
19904 .   \}
19905 .\}
19906 .rr [T
19907 ..
19908 \# %D Date of publication
19909 .de ref*add-D
19910 .if \\n[ref*type]=0 \{\
19911 .   ie '\\*[$REF_STYLE]'NOTE' .ref*field D ,
19912 .   el .ref*field D . " "
19913 .\}
19914 .if \\n[ref*type]=1 \{\
19915 .   ref*field D "" "(" ")"
19916 .\}
19917 .if \\n[ref*type]=2 \{\
19918 .   ie '\\*[$REF_STYLE]'NOTE' .ref*field D , "" )
19919 .   el .ref*field D ,
19920 .\}
19921 .if \\n[ref*type]=3 \{\
19922 .   ie !'\\*([C'' \{\
19923 .      ie '\\*[$REF_STYLE]'NOTE' .ref*field D , "" )
19924 .      el .ref*field D ,
19925 .   \}
19926 .   el \{\
19927 .      if '\\*([I'' \{\
19928 .         ds eval*[D \\*([D
19929 .         substring eval*[D 0 -4
19930 .         ie '\\*[eval*[D]'1' .ds kern \*[BU3]
19931 .         el .ds kern \*[BU2]
19932 .         ie \\n[#PRINT_STYLE]=2 \{\
19933 .           if '\\*[$REF_STYLE]'NOTE' .ref*field D "" (\\*[kern] )
19934 .         \}
19935 .         el .ref*field D
19936 .      \}
19937 .      rm eval*[D
19938 .      rm kern
19939 .   \}
19940 .\}
19941 .if \\n[ref*type]=4 .ref*field D ,
19942 .if \\n[ref*type]=5 .ref*field D
19943 .ds eval*[D \\*([D
19944 .substring eval*[D -1
19945 .if '\\*[eval*[D]'.' .nr ref*suppress-period 1
19946 ..
19947 \# %P Page number(s)
19948 .de ref*add-P
19949 .if \\n[ref*type]=5 .nr ref*type 1
19950 .ie '\\*[$REF_STYLE]'NOTE' \{\
19951 .   ie \\n[ref*type]=1 .ref*field P : "" .
19952 .   el .ref*field P "" "\|"
19953 .   if \\n[ref*type]=1 .nr ref*suppress-period 1
19954 .\}
19955 .el \{\
19956 .   ie \\n[ref*type]=1 .ref*field P \|:
19957 .   el \{\
19958 .      ie d [n .ref*field P . \| .
19959 .      el .ref*field P . " "
19960 .   \}
19961 .\}
19962 ..
19963 \# %G Gov't. ordering number
19964 .de ref*add-G
19965 .ie '\\*[$REF_STYLE]'NOTE' ref*field G ,
19966 .el .ref*field G . " "
19967 ..
19968 \# %O Other (info that goes after %T [or %B] but is hard to categorize; eg a dissertation)
19969 .de ref*add-O
19970 .ds eval*[O \\*([O
19971 .substring eval*[O -1
19972 .if '\\*[eval*[O]'.' .nr [O 1
19973 .ds initial*cap \\*([O
19974 .substring initial*cap 0 0
19975 .ds [O*string \\*([O
19976 .substring [O*string 1
19977 .if '\\*[$REF_STYLE]'BIBLIO' \{\
19978 .   ds [O \E*[UC]\\*[initial*cap]\E*[LC]\\*[[O*string]
19979 .\}
19980 .ie '\\*[$REF_STYLE]'NOTE' .ref*field O ,
19981 .el \{\
19982 .   if \\n([O=1 .chop [O
19983 .   ie r [e .ref*field O "" " "
19984 .   el \{\
19985 .      ie !d [A .ref*field O
19986 .      el .ref*field O . " "
19987 .   \}
19988 .\}
19989 .rr [O
19990 .rr [e
19991 ..
19992 \# %n Annotations (after ref)
19993 .de ref*add-n
19994 .ds eval*[n \\*([n
19995 .substring eval*[n -1
19996 .if '\\*[eval*[n]'.' .chop [n
19997 .if '\\*[eval*[n]'?' .nr [n 1
19998 .if '\\*[eval*[n]'!' .nr [n 1
19999 .ie '\\*[$REF_STYLE]'NOTE' .ref*field n ,
20000 .el \{\
20001 .   ie !'\\*([P'' .ref*field n "" " "
20002 .   el .ref*field n . " "
20003 .\}
20004 .if r [n .nr ref*suppress-period 1
20005 .rr [n
20006 ..
20007 \#
20008 .de ref*add-dflt
20009 .ref*field \\$1 ,
20010 ..
20011 \#
20012 \# Book reprints
20013 \# -------------
20014 \# %d date of publication (the orignal date of publication)
20015 .de ref*add-d
20016 .ie '\\*[$REF_STYLE]'NOTE' \{\
20017 .   ref*field d "" ( ;
20018 .   nr [d 1
20019 .\}
20020 .el \{\
20021 .   ie \\n([T .ref*field d "" " "
20022 .   el .ref*field d . " "
20023 .\}
20024 .rr [T
20025 ..
20026 \# %b main author when citing from a preface, introduction, foreword
20027 \# or afterword
20028 .de ref*add-b
20029 .ie '\\*[$REF_STYLE]'NOTE' \{\
20030 .   ie \\n([T .ref*field b "" "by"
20031 .   el .ref*field b , "by "
20032 .\}
20033 .el \{\
20034 .   ie \\n([T .ref*field b "" " By "
20035 .   el .ref*field b . " By "
20036 .\}
20037 .rr [T
20038 ..
20039 \# %t title, if different from original title (the T field, which s/b
20040 \# the original title)
20041 .de ref*add-t
20042 .ie '\\*[$REF_STYLE]'NOTE' .ref*field t , "rpt. of \E*[IT] " \E*[ref*restore-ss]
20043 .el \{\
20044 .   ie \\n([T .ref*field t "" " Rpt. of \E*[IT] " \E*[ref*restore-ss]
20045 .   el .ref*field t . " Rpt. of \E*[IT] " \E*[ref*restore-ss]
20046 .\}
20047 .rr [T
20048 ..
20049 \#
20050 \# Translated works
20051 \# ----------------
20052 \# %l Trans(l)ator
20053 .de ref*add-l
20054 .ie '\\*[$REF_STYLE]'NOTE' \{\
20055 .   ie \\n([T .ref*field l "" "trans. "
20056 .   el .ref*field l , "trans. "
20057 .\}
20058 .el \{\
20059 .   ie \\n([T .ref*field l "" " Trans. "
20060 .   el .ref*field l . " Trans. "
20061 .\}
20062 .rr [T
20063 ..
20064 \# %r Translato(r) and edito(r)
20065 .de ref*add-r
20066 .ie '\\*[$REF_STYLE]'NOTE' .ref*field r , "trans. and ed. "
20067 .el \{\
20068 .   ie \\n([T .ref*field r "" " Trans. and ed. "
20069 .   el .ref*field r . " Trans. and ed. "
20070 .\}
20071 .rr [T
20072 ..
20073 \#
20074 \# Internet
20075 \# --------
20076 \# %s Site name
20077 .de ref*add-s
20078 .ie '\\*[$REF_STYLE]'NOTE' .ref*field s , \E*[IT] \E*[ref*restore-ss]
20079 .el \{\
20080 .ie \\n([s .ref*field s "" ".\E*[IT]" \E*[ref*restore-ss]
20081 .el .ref*field s . " \E*[IT]" \E*[ref*restore-ss]
20082 .\}
20083 .\" refer doesn't set reg [T to 1 for these titles, so we do it here
20084 .if !'\\*[$REF_STYLE]'NOTE' \{\
20085 .   ds eval*[s \\*([s
20086 .   substring eval*[s -1
20087 .   rr [T
20088 .   if '\\*[eval*[s]'.' .nr [T 1
20089 .   if '\\*[eval*[s]'!' .nr [T 1
20090 .   if '\\*[eval*[s]'?' .nr [T 1
20091 .   rm eval*[s
20092 .\}
20093 ..
20094 \# %c content of site (ie. Web, Online posting, etc)
20095 .de ref*add-c
20096 .ie '\\*[$REF_STYLE]'NOTE' .ref*field c ,
20097 .el \{\
20098 .   ie \\n([T .ref*field c "" " "
20099 .   el .ref*field c . " "
20100 .\}
20101 .rr [T
20102 ..
20103 \# %o organization, group or sponsor of site
20104 .de ref*add-o
20105 .ie '\\*[$REF_STYLE]'NOTE' .ref*field o ,
20106 .el \{\
20107 .   ie \\n([T .ref*field o "" " "
20108 .   el .ref*field o . " "
20109 .\}
20110 .rr [T
20111 ..
20112 \# %a access date, i.e. the date you read it
20113 .de ref*add-a
20114 .ie '\\*[$REF_STYLE]'NOTE' .ref*field a ,
20115 .el \{\
20116 .   ie \\n([T .ref*field a "" " "
20117 .   el .ref*field a . " "
20118 .\}
20119 .rr [T
20120 ..
20121 \# %u URL
20122 .de ref*add-u
20123 .ref*field u "" < >
20124 .rr [T
20125 ..
20126 .de ref*add-z
20127 .ref*field z
20128 ..
20129 \#
20130 \# Build up reference string from ref*add-<x> macros.
20131 \#
20132 \# First, a string to ensure next field's font is reset to roman
20133 \# (TYPESET) or non-underlined (TYPEWRITE)
20134 \#
20135 .ie !n .ds ref*roman \f[R]\X'ps: exec decornone'\?\R'#UNDERLINE_ON 0'\?
20136 .el .ds ref*roman \f[R]\?\R'#UNDERLINE_ON 0'\?
20137 \#
20138 .de ref*field
20139 .if d ref*string \{\
20140 .   ie d ref*post-punct \{\
20141 .      as ref*string "\\$2\\*[ref*post-punct] \"
20142 .      rm ref*post-punct
20143 .   \}
20144 .   el .as ref*string "\\$2 \"
20145 .\}
20146 .as ref*string "\\$3\\*([\\$1\\$4\E*[ref*roman]
20147 .if \\n[.$]>4 .ds ref*post-punct "\\$5\E*[ref*roman]
20148 .nr ref*suppress-period 0
20149 ..
20150 \#
20151 \# MARGIN NOTES
20152 \# ------------
20153 \#
20154 \# Wrapper for MNinit.
20155 \#
20156 .MAC MN_INIT END
20157 .    if \B'\\$2' \{\
20158 .       tm1 "[mom]: 1.x-style \\$0 detected, but you are using v2.x.
20159 .       tm1 "       v2.x requires flags before arguments to \\$0.
20160 .       tm1 "       Please read docelement.html#mn-init and update your file.
20161 .       ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
20162 .    \}
20163 .    nr #ARGS  0 1
20164 .    nr #COUNT 9
20165 .    while \\n+[#ARGS]<=\\n[#COUNT] \{\
20166 .      ds $MN-arg\\n[#ARGS] @
20167 .    \}
20168 .    nr #FLAG 0 1
20169 .    nr #COUNT \\n[#NUM_ARGS]
20170 .    while \\n+[#FLAG]<=\\n[#COUNT] \{\
20171 .       if '\\$1'RAGGED' \{\
20172 .          ds $MN-arg1 \\$1
20173 .       shift
20174 .       \}
20175 .       if '\\$1'SYMMETRIC' \{\
20176 .          ds $MN-arg1 \\$1
20177 .          shift
20178 .       \}
20179 .       if '\\$1'L_WIDTH' \{\
20180 .          shift
20181 .          ds $MN-arg2 \\$1
20182 .          shift
20183 .       \}
20184 .       if '\\$1'R_WIDTH' \{\
20185 .          shift
20186 .          ds $MN-arg3 \\$1
20187 .          shift
20188 .       \}
20189 .       if '\\$1'GUTTER' \{\
20190 .          shift
20191 .          ds $MN-arg4 \\$1
20192 .          shift
20193 .       \}
20194 .       if '\\$1'FONTSTYLE' \{\
20195 .          shift
20196 .          ds $MN-arg5 \\$1
20197 .          shift
20198 .       \}
20199 .       if '\\$1'SIZE' \{\
20200 .          shift
20201 .          ds $MN-arg6 \\$1
20202 .          shift
20203 .       \}
20204 .       if '\\$1'LEAD' \{\
20205 .          shift
20206 .          ds $MN-arg7 \\$1
20207 .          shift
20208 .       \}
20209 .       if '\\$1'COLOR' \{\
20210 .          shift
20211 .          ds $MN-arg8 \\$1
20212 .          shift
20213 .       \}
20214 .       if '\\$1'HY' \{\
20215 .          shift
20216 .          ds $MN-arg9 \\$1
20217 .          shift
20218 .       \}
20219 .    \}
20220 .    if '\\*[$MN-arg5]'@' .ds $MN-arg5 \E*[$DOC_FAM]R
20221 .    MNinit \
20222 \\*[$MN-arg1] \\*[$MN-arg2] \
20223 \\*[$MN-arg3] \\*[$MN-arg4] \
20224 \\*[$MN-arg5] \\*[$MN-arg6] \
20225 \\*[$MN-arg7] \\*[$MN-arg8] \
20226 \\*[$MN-arg9]
20227 .END
20228 \#
20229 .MAC MN_OVERFLOW_TRAP END
20230 .    if \\n[#OVERFLOW_LEFT]=1 \{\
20231 .       nr #no-repeat-MN-left 1
20232 .       di MN_OVERFLOW_LEFT
20233 .    \}
20234 .    if \\n[#OVERFLOW_RIGHT]=1 \{\
20235 .       nr #no-repeat-MN-right 1
20236 .       di MN_OVERFLOW_RIGHT
20237 .    \}
20238 .    rr #OVERFLOW_LEFT
20239 .    rr #OVERFLOW_RIGHT
20240 .END
20241 \#
20242 \# The remainder of the margin notes macros and routines are adapted
20243 \# from Werner Lemberg's MN.tmac.
20244 \#
20245 \# MNinit
20246 \# ------
20247 \# Usage:
20248 \# MNinit [ragged|symmetric] \
20249 \#        left-width right-width separation \
20250 \#        font fontsize vertical-spacing \
20251 \#        color hyphenation-flags
20252 \#
20253 \# Initialize margin notes.  Empty arguments (denoted with "") set
20254 \# default values.  If the first argument is the string `ragged',
20255 \# left and right margin notes are printed ragged-right.  If it is
20256 \# `symmetric', left margin notes are printed ragged-left and right
20257 \# margin notes ragged-right.  If omitted, margin notes are left
20258 \# and right adjusted.
20259 \#
20260 .de MNinit
20261 .  nr #MNinit 1
20262 .  ds MN-left-ad b\"
20263 .  ds MN-right-ad b\"
20264 .  if '\\$1'@' .shift
20265 .  if '\\$1'RAGGED' \{\
20266 .    ds MN-left-ad l\"
20267 .    ds MN-right-ad l\"
20268 .    shift
20269 .  \}
20270 .  if '\\$1'SYMMETRIC' \{\
20271 .    ds MN-left-ad r\"
20272 .    ds MN-right-ad l\"
20273 .    shift
20274 .  \}
20275 .  ie \B'\\$3' .nr MN-sep (n;\\$3)
20276 .  el .nr MN-sep 1m
20277 .  if ((\\n[.o] - \\n[MN-sep]) < 1n) \
20278 .    ab MN: Left margin too small (<1n) for requested margin notes separation.
20279 .  ie \B'\\$1' \{\
20280 .    nr MN-left-width (n;\\$1)
20281 .    nr MN-left-start (\\n[.o] - \\n[MN-sep] - \\n[MN-left-width])
20282 .  \}
20283 .  el \{\
20284 .    nr MN-left-width (\\n[.o] - \\n[MN-sep])
20285 .    nr MN-left-start 0
20286 .  \}
20287 .  if (\\n[MN-left-start] < 0) \
20288 .    ab MN: Left margin too small for requested margin notes settings.
20289 .  if (\\n[MN-left-width] < 1n) \
20290 .    ab MN: Left margin notes width too small (<1n).
20291 .  ie \B'\\$2' \{\
20292 .    nr MN-right-width (n;\\$2)
20293 .    nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
20294 .    if \\n[#COLUMNS]=1 \{\
20295 .      if !\\n[#NUM_COLS]=1 \{\
20296 .        nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
20297 .      \}
20298 .    \}
20299 .  \}
20300 .  el \{\
20301 .    nr MN-right-width \\n[MN-left-width]
20302 .    nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
20303 .    if \\n[#COLUMNS]=1 \{\
20304 .      if !\\n[#NUM_COLS]=1 \{\
20305 .        nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
20306 .      \}
20307 .    \}
20308 .  \}
20309 .  ie \A'\\$4' \{\
20310 .    ds MN-font \\$4\"
20311 .    if \\n[#PRINT_STYLE]=1 .ds MN-font CR
20312 .  \}
20313 .  el \{\
20314 .    ds MN-font \\*[$PP_FT]
20315 .    if \\n[#PRINT_STYLE]=1 .ds MN-font CR
20316 .  \}
20317 .  ie \B'\\$5' \{\
20318 .    ps \\$5
20319 .    nr MN-size \\n[.ps]
20320 .    ps
20321 .    if \\n[#PRINT_STYLE]=1 \{\
20322 .       ps \\*[$TYPEWRITER_PS]
20323 .       nr MN-size \\n[.ps]
20324 .       ps
20325 .    \}
20326 .  \}
20327 .  el \
20328 .    nr MN-size \\n[#DOC_PT_SIZE]
20329 .  ie \B'\\$6' \{\
20330 '    vs \\$6
20331 .    nr MN-spacing \\n[.v]
20332 '    vs
20333 .    if \\n[#PRINT_STYLE]=1 \
20334 .       nr MN-spacing \\n[#DOC_LEAD]
20335 .  \}
20336 .  el .nr MN-spacing \\n[#DOC_LEAD]
20337 .  ie \A'\\$7' \
20338 .    if !\\n[#PRINT_STYLE]=1 .ds MN-color \\$7\"
20339 .  el \
20340 .    if !\\n[#PRINT_STYLE]=1 .ds MN-color
20341 .  ie \B'\\$8' .nr MN-hy \\$8
20342 .  el .nr MN-hy \\n[.hy]
20343 .  ev MNbottom-left-env
20344 .  if \A'\\*[MN-font]' .ft \\*[MN-font]
20345 .  if \\n[MN-size] .ps \\n[MN-size]u
20346 .  if \\n[MN-spacing] .vs \\n[MN-spacing]u
20347 .  ll \\n[MN-left-width]u
20348 .  ad \\*[MN-left-ad]
20349 .  hy \\n[MN-hy]
20350 '  in 0
20351 .  nop \m[\\*[MN-color]]\c
20352 .  ev
20353 .  ev MNbottom-right-env
20354 .  if \A'\\*[MN-font]' .ft \\*[MN-font]
20355 .  if \\n[MN-size] .ps \\n[MN-size]u
20356 .  if \\n[MN-spacing] .vs \\n[MN-spacing]u
20357 .  ll \\n[MN-right-width]u
20358 .  ad \\*[MN-right-ad]
20359 .  hy \\n[MN-hy]
20360 '  in 0
20361 .  nop \m[\\*[MN-color]]\c
20362 .  ev
20363 .  nr MN-active 0
20364 ..
20365 \# MN
20366 \# --
20367 \# Usage:
20368 \#
20369 \#   MN LEFT|RIGHT
20370 \#   margin note text
20371 \#   MN
20372 \#
20373 \# With a parameter, start a margin note, otherwise end a margin note.
20374 \# If the parameter is the string `left', define a left margin note,
20375 \# otherwise define a right margin note.
20376 \#
20377 .de MN
20378 .ds MN-dir \\$1
20379 .if !'\\$1'LEFT' \{\
20380 .  if !'\\$1'RIGHT' \{\
20381 .    MN_QUIT
20382 .    return
20383 .  \}
20384 .\}
20385 .if \\n[#COLUMNS]=1 \{\
20386 .  if \\n[#NUM_COLS]>2 \{\
20387 .    tm [mom]: Macro MN: More than two columns.  Ignoring margin notes.
20388 .    return
20389 .  \}
20390 .  if !\\n[#NUM_COLS]=1 \{\
20391 .    ie \\n[#COL_NUM]=1 .ds MN-dir LEFT
20392 .    el .ds MN-dir RIGHT
20393 .  \}
20394 .\}
20395 .  if !\\n[#MNinit]=1 \{\
20396 .    tm [mom]: Macro MN: You must set parameters with MN_INIT before using MN.
20397 .    ab Aborting '\\n[.F]' at MN, line \\n[.c].
20398 .  \}
20399 .  ie !'\\$1'' \{\
20400 .    if \\n[MN-active] \{\
20401 .      tm [mom]: Macro MN: Can't handle nested margin notes, line \\n[.c].
20402 .      return
20403 .    \}
20404 .    nr MN-active 1
20405 .    ev MN-env
20406 .    ie '\\*[MN-dir]'LEFT' \{\
20407 .      nr MN-left +1
20408 .      ds MN-curr l-\\n[MN-left]\"
20409 .      evc MNbottom-left-env
20410 .    \}
20411 .    el \{\
20412 .      nr MN-right +1
20413 .      ds MN-curr r-\\n[MN-right]\"
20414 .      evc MNbottom-right-env
20415 .    \}
20416 .    mk MN-mk-\\*[MN-curr]
20417 .    di MN-div-\\*[MN-curr]
20418 .  \}
20419 .  el .MN_QUIT
20420 ..
20421 \#
20422 \# MN_QUIT
20423 \# -------
20424 \# Utility macro to handle .MN OFF | QUIT | X etc
20425 \#
20426 .de MN_QUIT
20427 .   if \\n[MN-active] \{\
20428 .      br
20429 .      di
20430 .      nr MN-div-\\*[MN-curr]-depth \\n[dn]
20431 .      ev
20432 .   \}
20433 .   nr MN-active 0
20434 ..
20435 \#
20436 \# MNtop
20437 \# -----
20438 \# Resets these registers (called in HEADER)
20439 .de MNtop
20440 .  nr MN-left 0
20441 .  nr MN-right 0
20442 .  nr MN-active 0
20443 .  rr MN-shifted
20444 .  ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
20445 ..
20446 \#
20447 \# MNbottom-left
20448 \# -------------
20449 \# The "left" half of Werner's original MNbottom.
20450 \#
20451 .de MNbottom-left
20452 .  nr MN-curr 0
20453 .  nr MN-last-pos 0
20454 .  nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
20455 .  vpt 0
20456 .  mk MN-curr-pos
20457 .  if \\n[MN-active] \{\
20458 .    di
20459 .    tm [mom]: Macro MN: Margin note finished by new page.  Ignored.
20460 .  \}
20461 .  po \\n[MN-left-start]u
20462 .  ev MNbottom-left-env
20463 .  nr #P \\n%+\\n[#PAGE_NUM_ADJ]
20464 .  while (\\n[MN-curr] < \\n[MN-left]) \{\
20465 .    nr MN-curr +1
20466 .    ie (\\n[MN-last-pos] < \\n[MN-mk-l-\\n[MN-curr]]) \
20467 .      sp |\\n[MN-mk-l-\\n[MN-curr]]u+\\n[MN-lead-adj]u
20468 .    el \{\
20469 .      nr MN-shifted 1
20470 .      sp 1v
20471 .      SHIM
20472 .      if \\n[#SHIM]>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
20473 .      tm \
20474 [mom]: Macro MN: Warning: Left margin note #\\n[MN-curr] on page \\n[#P] shifted down.
20475 .    \}
20476 .\" If last margin note doesn't fit
20477 .    if ( (\\n[nl]+\\n[MN-div-l-\\n[MN-curr]-depth]) > (\\n[.p]+\\n[#VARIABLE_FOOTER_POS]-1) ) \{\
20478 .      if \\n[MN-shifted]=1 \{\
20479 .        sp -(1v+\\n[#SHIM]u)
20480 .        rm MN-div-l-\\n[MN-curr]
20481 .        tm1 "[mom]: No room to start left margin note #\\n[MN-curr] on page \\n[#P].
20482 .        tm1 "       Ignoring margin note.
20483 .        rr MN-shifted
20484 .      \}
20485 .      nr #no-repeat-MN-left 1
20486 .      nr #OVERFLOW_LEFT 1
20487 .      ie \\n[#FN_COUNT]=0 \{\
20488 .        ch FOOTER \\n[.p]u
20489 .        wh \\n[#VARIABLE_FOOTER_POS]u+\\n[MN-lead-adj]u+1u MN_OVERFLOW_TRAP
20490 .      \}
20491 .      el \
20492 .        wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
20493 .      vpt 1
20494 .    \}
20495 .    nf
20496 .    MN-div-l-\\n[MN-curr]
20497 .    fi
20498 .    br
20499 .    nr MN-last-pos \\n[nl]
20500 .  \}
20501 .  ev
20502 .  po
20503 .  if !\\n[#no-repeat-MN-left]=1 \
20504 .     if \\n[MN-right]=0 .vpt 1
20505 ..
20506 \#
20507 \# MNbottom-right
20508 \# --------------
20509 \# The "right" half of Werner's original MNbottom.
20510 \#
20511 .de MNbottom-right
20512 .   nr MN-curr 0
20513 .   nr MN-last-pos 0
20514 .   nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
20515 .   vpt 0
20516 .   po \\n[MN-right-start]u
20517 .   ev MNbottom-right-env
20518 .   nr #P \\n%+\\n[#PAGE_NUM_ADJ]
20519 .   while (\\n[MN-curr] < \\n[MN-right]) \{\
20520 .      nr MN-curr +1
20521 .      ie (\\n[MN-last-pos] < \\n[MN-mk-r-\\n[MN-curr]]) \
20522 .         sp |\\n[MN-mk-r-\\n[MN-curr]]u+\\n[MN-lead-adj]u
20523 .      el \{\
20524 .         nr MN-shifted 1
20525 .         sp 1v
20526 .         SHIM
20527 .         if \\n[#SHIM]>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
20528 .         tm [mom]: \
20529 Macro MN: Warning: Right margin note #\\n[MN-curr] on page \\n[#P] shifted down.
20530 .      \}
20531 .\" If last margin note doesn't fit
20532 .      if ( (\\n[nl]+\\n[MN-div-r-\\n[MN-curr]-depth]) > (\\n[.p]+\\n[#VARIABLE_FOOTER_POS]-1) ) \{\
20533 .         if \\n[MN-shifted]=1 \{\
20534 .            sp -(1v+\\n[#SHIM]u)
20535 .            rm MN-div-r-\\n[MN-curr]
20536 .            tm1 \
20537 [mom]: No room to start right margin note #\\n[MN-curr] on page \\n[#P] on page \\n[#P].
20538 .            tm1 "       Ignoring margin note.
20539 .            rr MN-shifted
20540 .         \}
20541 .         nr #no-repeat-MN-right 1
20542 .         nr #OVERFLOW_RIGHT 1
20543 .         ie \\n[#FN_COUNT]=0 \{\
20544 .            ch FOOTER \\n[.p]u
20545 .            wh \\n[#VARIABLE_FOOTER_POS]u+\\n[MN-lead-adj]u+1u MN_OVERFLOW_TRAP
20546 .         \}
20547 .         el \
20548 .            wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
20549 .         vpt 1
20550 .      \}
20551 .      nf
20552 .      MN-div-r-\\n[MN-curr]
20553 .      fi
20554 .      br
20555 .      nr MN-last-pos \\n[nl]
20556 .   \}
20557 .   ev
20558 .   po
20559 .   if !\\n[#no-repeat-MN-right]=1 .vpt 1
20560 ..
20561 \#
20562 \# PDF SUPPORT
20563 \# ===========
20564 \#
20565 \# Initial setup
20566 \#
20567 .nr CURRENT_LEVEL 0
20568 .nr VIRTUAL_LEVEL 0
20569 .nr #PDF_BOOKMARKS 1
20570 .nr #PDF_BOOKMARKS_OPEN 1
20571 .pdfview /PageMode /UseOutlines
20572 \#
20573 \# TOC_BEFORE_HERE
20574 \# ---------------
20575 \#
20576 \# Call this and the TOC will be placed preceding this page
20577 \#
20578 .MAC TOC_BEFORE_HERE END
20579 .    nr TOC_BH 1
20580 .    pdfpagename MOM:TOC
20581 .END
20582 \#
20583 \# TOC_AFTER_HERE
20584 \# ---------------
20585 \#
20586 \# Call this and the TOC will be placed after this page
20587 \#
20588 .MAC TOC_AFTER_HERE END
20589 .    nr TOC_BH 2
20590 .    pdfpagename MOM:TOC
20591 .END
20592 \#
20593 \# PDF_LINK_COLOR
20594 \# -----------------
20595 \#
20596 \# Arguments:-
20597 \#   <name defined by previous call to XCOLOR or NEWCOLOR> or
20598 \#   <red> <green> <blue> all 0.0 -> 1.0
20599 \# Notes
20600 \#   Should be called before START but can also be called at any time to change colour
20601 \#   The colour assigned at the end of the document is used for all links in the TOC
20602 \#
20603 .MAC PDF_LINK_COLOR END
20604 .    ie \\n[.$]==3 \{\
20605 .       ds PDFHREF.COLOUR \\$*
20606 .       if !(\B'\\$1' & \B'\\$2' & \B'\\$3') \{\
20607 .          tm1 "[mom]: All three arguments to \\$0 at line \\n[.c] must be decimal.
20608 .          tm1 "       Continuing to process using default link color.
20609 .          ds PDFHREF.COLOUR 0.0 0.3 0.9
20610 .       \}
20611 .       defcolor pdf:href.colour rgb \\*[PDFHREF.COLOUR]
20612 .       ds PDFHREF.TEXT.COLOUR pdf:href.colour
20613 .    \}
20614 .    el \{\
20615 .       ie \\n[.$]==0 \{\
20616 .          if dPDFHREF.TEXTCOL.DEFAULT \
20617 .             PDF_LINK_COLOR \\*[PDFHREF.TEXTCOL.DEFAULT]
20618 .       \}
20619 .       el \{\
20620 .          ds ARG_1 \\$1
20621 .          substring ARG_1 0 0
20622 .          ie '\\*[ARG_1]'#' \{\
20623 .             defcolor pdf:href.colour rgb \\$1
20624 .             ds PDFHREF.TEXT.COLOUR pdf:href.colour
20625 .          \}
20626 .          el \{\
20627 .             ie dCOLAL_\\$1 .ds PDFHREF.TEXT.COLOUR \\*[COLAL_\\$1]
20628 .             el .ds PDFHREF.TEXT.COLOUR \\$1
20629 .          \}
20630 .       \}
20631 .    \}
20632 .    if !\\n[PDFHREF_COLOR_SET]=1 \{\
20633 .       nr PDFHREF_COLOR_SET 1
20634 .    \}
20635 .END
20636 \#
20637 \# AUTO_RELOCATE_TOC
20638 \# -----------------
20639 \#
20640 \# Call before START to have TOC automatically relocated to after the
20641 \# DOC COVER (if there is one) or the COVER if there isn't
20642 \#
20643 .MAC AUTO_RELOCATE_TOC END
20644 .    if '\\$1''                .nr TOC.RELOCATE 1
20645 .    if '\\$1'TOP'             .nr TOC.RELOCATE 2
20646 .    if '\\$1'BEFORE_DOCCOVER' .nr TOC.RELOCATE 3 \" Same as TOP unless no DOCCOVER
20647 .    if '\\$1'AFTER_DOCCOVER'  .nr TOC.RELOCATE 4
20648 .    if '\\$1'BEFORE_COVER'    .nr TOC.RELOCATE 5
20649 .    if '\\$1'AFTER_COVER'     .nr TOC.RELOCATE 6
20650 .END
20651 \#
20652 \# PDF_BOOKMARK
20653 \# ------------
20654 \# *Argument:
20655 \#   Hierarchy Level
20656 \#   Bookmark Text
20657 \# *Function:
20658 \#   Creates a bookmark using the given text
20659 \#   The level controls the hierarchy of the bookmarks
20660 \# *Notes
20661 \#   Bookmarks can be turned off (will not be added to document outline) by calling
20662 \#   "PDF_BOOKMARKS NO" and turned on with "PDF_BOOKMARKS".
20663 \#
20664 \#   Bookmarks can be open or closed by calling PDF_BOOKMARKS_OPEN
20665 \#
20666 .MAC PDF_BOOKMARK END
20667 .    if \\n[#PDF_BOOKMARKS] \{\
20668 .       ie '\\$1'NAMED' \{\
20669 .          ds PDF_NM -T \\$2
20670 .          ds PDF_NM2 \\$2
20671 .          shift 2
20672 .       \}
20673 .       el .ds PDF_NM
20674 .       nr LEVEL_REQ \\$1
20675 .       shift
20676 .       ie \\n[LEVEL_REQ]>\\n[VIRTUAL_LEVEL] \{\
20677 .          nr VIRTUAL_LEVEL \\n[LEVEL_REQ]
20678 .          nr LEVEL_REQ \\n[CURRENT_LEVEL]+1
20679 .       \}
20680 .       el \{\
20681 .          ie \\n[LEVEL_REQ]<\\n[VIRTUAL_LEVEL] \{\
20682 .             nr VIRTUAL_DIFF \\n[VIRTUAL_LEVEL]-\\n[LEVEL_REQ]
20683 .             nr VIRTUAL_LEVEL \\n[LEVEL_REQ]
20684 .             nr LEVEL_REQ (\\n[CURRENT_LEVEL]-\\n[VIRTUAL_DIFF])>?1
20685 .          \}
20686 .          el .nr LEVEL_REQ \\n[CURRENT_LEVEL]
20687 .       \}
20688 .       ds PDF_TX \\$*
20689 .       pdfmomclean PDF_TX
20690 .\" .   ev protect
20691 .       nr PDF_LEV (\\n[LEVEL_REQ]*\\n[#PDF_BOOKMARKS_OPEN])
20692 .       ie '\\*[.T]'ps' \{\
20693 .           if !'\\*[PDF_NM]'' \{\
20694 .              pdfhref M -N \\*[PDF_NM2] -- \\*[PDF_TX]
20695 .              if !dpdf:href.map .tm gropdf-info:href \\*[PDF_NM2] \\*[PDF_TX]
20696 .           \}
20697 .           pdfbookmark \\n[PDF_LEV] \\*[PDF_TX]
20698 .       \}
20699 .       el .pdfbookmark \\*[PDF_NM] \\n[PDF_LEV] \\$*
20700 .\" .   ev
20701 .       nr CURRENT_LEVEL \\n[LEVEL_REQ]
20702 .       rr LEVEL_REQ
20703 .       rr PDF_LEV
20704 .       rr VIRTUAL_DIFF
20705 .       rm PDF_NM
20706 .    \}
20707 .END
20708 \#
20709 \# PDF_TITLE
20710 \# ---------
20711 \# *Argument:
20712 \#   Title Text
20713 \# *Function
20714 \#   Set the PDF title (this is often used by PDF readers to title the main window)
20715 \#
20716 .MAC PDF_TITLE END
20717 .    ds pdftitle \\$*
20718 .    pdfmomclean pdftitle
20719 .    nop \!x X ps:exec [/Title (\\*[pdftitle]) /DOCINFO pdfmark
20720 .END
20721 \#
20722 \# PDF_BOOKMARKS
20723 \# -------------
20724 \# *Argument:
20725 \#   <nothing> | <anything>
20726 \# *Function:
20727 \#   With no parameter turns on outline bookmarks
20728 \#   With any parameter turns off outline bookmarks
20729 \#
20730 .MAC PDF_BOOKMARKS END
20731 .    ie '\\$1'' .nr #PDF_BOOKMARKS 1
20732 .    el .nr #PDF_BOOKMARKS 0
20733 .END
20734 \#
20735 \# PDF_BOOKMARKS_OPEN
20736 \# ------------------
20737 \# *Argument:
20738 \#   <number> | <nothing> | <text>
20739 \# *Function:
20740 \#   If arg is numeric all Bookmark levels > arg are closed
20741 \#   If arg is empty all bookmarks are open
20742 \#   If arg is any text then any following bookmarks are closed
20743 \#
20744 .MAC PDF_BOOKMARKS_OPEN END
20745 .    ie \B'\\$1' \{\
20746 .       nr PDFOUTLINE.FOLDLEVEL \\$1
20747 .       nr #PDF_BOOKMARKS_OPEN 1
20748 .    \}
20749 .    el .if '\\*[.T]'pdf' \{\
20750 .       nr PDFOUTLINE.FOLDLEVEL 10000
20751 .       ie '\\$1'' .nr #PDF_BOOKMARKS_OPEN 1
20752 .       el .nr #PDF_BOOKMARKS_OPEN 0-1
20753 .    \}
20754 .END
20755 \#
20756 \# PDF_LINK
20757 \# --------
20758 \# *Arguments:
20759 \#    $1 = named link
20760 \#    [PREFIX text] : text to prefix link
20761 \#    [SUFFIX text] : text after link
20762 \#    text
20763 \#
20764 \# *Notes
20765 \#    Text is output as a hotspot link to named destination.
20766 \#    If text has final '*' it is replaced with the text associated with the link
20767 \#
20768 .MAC PDF_LINK END
20769 .    ds PDF_NM \\$1
20770 .    shift
20771 .    ie '\\$1'PREFIX' \{\
20772 .       ds PDF_PRE -P "\&\\$2"
20773 .       shift 2
20774 .    \}
20775 .    el .ds PDF_PRE
20776 .    ie '\\$1'SUFFIX' \{\
20777 .       ds PDF_POST -A "\\$2"
20778 .       shift 2
20779 .    \}
20780 .    el .ds PDF_POST
20781 .    ds PDF_AST_Q
20782 .    ds PDF_TXT \&\\$1
20783 .    ds PDF_AST \\*[PDF_TXT]
20784 .    substring PDF_AST -1 -1
20785 .    if '\\*[PDF_AST]'+' \{\
20786 .       ds PDF_AST *
20787 .       ds PDF_AST_Q ""
20788 .    \}
20789 .    if '\\*[PDF_AST]'*' \{\
20790 .        chop PDF_TXT
20791 .        ie '\\*[.T]'pdf' \{\
20792 .           ie d pdf:look(\\*[PDF_NM]) \
20793 .               as PDF_TXT \&\\*[PDF_AST_Q]\\*[pdf:look(\\*[PDF_NM])]\\*[PDF_AST_Q]
20794 .           el \{\
20795 .               as PDF_TXT Unknown
20796 .               if !rPDF_UNKNOWN .tm \
20797 \\n[.F]:\\n[.c]: forward reference detected (please run using 'pdfmom')
20798 .               nr PDF_UNKNOWN 1
20799 .           \}
20800 .        \}
20801 .        el \{\
20802 .            ie d pdf:href(\\*[PDF_NM]).info \
20803 .               as PDF_TXT \&\\*[PDF_AST_Q]\\*[pdf:href(\\*[PDF_NM]).info]\\*[PDF_AST_Q]
20804 .            el .as PDF_TXT Unknown
20805 .       \}
20806 .    \}
20807 .    pdfhref L \\*[PDF_PRE] \\*[PDF_POST] -D \\*[PDF_NM] -- \\*[PDF_TXT]
20808 .    rm PDF_NM
20809 .    rm PDF_PRE
20810 .    rm PDF_POST
20811 .    rm PDF_TXT
20812 .    rm PDF_AST
20813 .    rm PDF_AST_Q
20814 .END
20815 \#
20816 .MAC PDF_WWW_LINK END
20817 .    ds PDF_NM \\$1
20818 .    shift
20819 .    ie '\\$1'PREFIX' \{\
20820 .       ds PDF_PRE -P "\\$2"
20821 .       shift 2
20822 .    \}
20823 .    el .ds PDF_PRE
20824 .    ie '\\$1'SUFFIX' \{\
20825 .       ds PDF_POST -A "\\$2"
20826 .       shift 2
20827 .    \}
20828 .    el .ds PDF_POST
20829 .    ds PDF_AST_Q
20830 .    ds PDF_TXT \\$1
20831 .    ie !'\\*[PDF_TXT]'' \{\
20832 .       ds PDF_AST \\*[PDF_TXT]
20833 .       substring PDF_AST -1 -1
20834 .       if '\\*[PDF_AST]'+' \{\
20835 .          ds PDF_AST *
20836 .          ds PDF_AST_Q ""
20837 .       \}
20838 .       if '\\*[PDF_AST]'*' \{\
20839 .          chop PDF_TXT
20840 .          as PDF_TXT \&\\*[PDF_AST_Q]\\*[PDF_NM]\\*[PDF_AST_Q]
20841 .       \}
20842 .    \}
20843 .    el .ds PDF_TXT \\*[PDF_NM]
20844 .    pdfhref W -D "\\*[PDF_NM]" \\*[PDF_PRE] \\*[PDF_POST] -- \\*[PDF_TXT]
20845 .    rm PDF_NM
20846 .    rm PDF_PRE
20847 .    rm PDF_POST
20848 .    rm PDF_TXT
20849 .    rm PDF_AST PDF_AST_Q
20850 .END
20851 \#
20852 .MAC PDF_TARGET END
20853 .    ds ARG_1 \\$1
20854 .    shift
20855 .    pdfhref M -N \\*[ARG_1] -- \\$*
20856 .    if '\\*[.T]'ps' .if !dpdf:href.map .tm gropdf-info:href \\*[ARG_1] \\$*
20857 .END
20858 \#
20859 \# PDF_IMAGE
20860 \# ---------
20861 \# *Arguments:
20862 \#   [ -L -| -R | -C | -I <indent> ] \
20863 \#     <image file> <width> <height> \
20864 \#     [ SCALE <factor> ] [ ADJUST +|-<vertical shift> ]
20865 \# *Function:
20866 \#   Allows embedding of PDF images with the same arguments as PSPIC
20867 \#   plus SCALE and ADJUST options.
20868 \# *Notes:
20869 \#   <image file> <width> <height> are required.
20870 \#
20871 .MAC PDF_IMAGE END
20872 .    rr float*img
20873 .    if !'\\n[.z]'FLOAT*DIV' .FLOAT
20874 .    nr float*img 1
20875 .    ds ev-current \\n[.ev]
20876 .    ev IMG
20877 .    evc \\*[ev-current]
20878 .    if \\n[#HYPHENATE] .nh
20879 .    nr ind-pre-img \\n[.i]
20880 .    nr ll-pre-img  \\n[.l]
20881 .    in 0
20882 .    ds pos:tmp \\$1
20883 .    substring pos:tmp 0 0
20884 .    ie !'\\*[pos:tmp]'-' .ds pdf-img:pos -C
20885 .    el \{\
20886 .       ds pdf-img:pos \\$1
20887 .       shift
20888 .    \}
20889 .    if '\\*[pdf-img:pos]'-I' \{\
20890 .       nr pdf-img:ind \\$1
20891 .       shift
20892 .    \}
20893 .    ds pdf-img:file \\$1
20894 .    ds pdf-img@file \\$1
20895 .    substring pdf-img@file -1 -3
20896 .    if !'\\*[pdf-img@file]'pdf' \{\
20897 .       tm1 "[mom]: Image file '\\*[pdf-img:file]' at line \\n[.c] not found, or not a PDF image.
20898 .       ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
20899 .    \}
20900 .    nr pdf-img:width \\$2
20901 .    nr pdf-img:depth \\$3
20902 .    shift 3
20903 .    nr loop-counter \\n[#NUM_ARGS]
20904 .    nr loop-count 0 1
20905 .    while \\n+[loop-count]<=\\n[loop-counter] \{\
20906 .       if '\\$1'SCALE' \{\
20907 .          shift
20908 .          nr pdf-img:scale \\$1
20909 .          shift
20910 .          nr pdf-img:width \\n[pdf-img:width]*\\n[pdf-img:scale]/100
20911 .          nr pdf-img:depth \\n[pdf-img:depth]*\\n[pdf-img:scale]/100
20912 .       \}
20913 .       if '\\$1'ADJUST' \{\
20914 .         shift
20915 .         ds pdf-img:adj \\$1
20916 .         shift
20917 .       \}
20918 .       if '\\$1'FRAME' \{\
20919 .          nr pdf-img:frame 1
20920 .          if !r pdf-img:frame-inset .nr pdf-img:frame-inset 6p
20921 .          shift
20922 .       \}
20923 .       if '\\$1'CAPTION' \{\
20924 .          nr pdf-img*have-caption 1
20925 .          ds pdf-img*caption \\$2
20926 .          shift 2
20927 .       \}
20928 .       if '\\$1'SHORT_CAPTION' \{\
20929 .          ds pdf-img*caption-short \\$2
20930 .          shift 2
20931 .       \}
20932 .       if '\\$1'LABEL' \{\
20933 .          nr pdf-img*have-label 1
20934 .          ds pdf-img*label \\$2
20935 .          ds label-type pdf-img
20936 .          shift 2
20937 .       \}
20938 .       if '\\$1'NO_SHIM' \{\
20939 .          nr float*no-shim 1
20940 .       \}
20941 .    \}
20942 .    ds pdf-img*label-sffx-tmp \\*[pdf-img*label-sffx]
20943 .    substring pdf-img*label-sffx-tmp -1
20944 .    if '\\*[pdf-img*label-sffx-tmp]'.' \
20945 .       if \\n[pdf-img*caption-after-label]=0 .chop pdf-img*label-sffx
20946 .    PDF_TARGET fig:\\n+[lists*target]
20947 .    if '\\*[pdf-img:pos]'-C' \
20948 .       nr pdf-img:ind (\\n[.ll]-\\n[ind-pre-img]-\\n[pdf-img:width])/2
20949 .    if '\\*[pdf-img:pos]'-R' \{\
20950 .       nr pdf-img:ind \\n[.ll]-\\n[pdf-img:width]-\\n[ind-pre-img]
20951 .    \}
20952 .    di PDF*IMAGE
20953 .    if \\n[@TOP] \{\
20954 .       ch RR_@TOP
20955 .       rs
20956 .       nop \&
20957 .       sp -1v
20958 .    \}
20959 .    if \\n[pdf-img*have-caption] \{\
20960 .       if !\\n[pdf-img*autolabel] \{\
20961 .          if !\\n[pdf-img*have-label] \{\
20962 .             if \\n[#MLA] \
20963 .                mla@error caption label \\n[.F] \\$0 \\n[.c]
20964 .          \}
20965 .       \}
20966 .       if !\\n[pdf-img*caption-after-label] \{\
20967 .          if !\\n[@TOP] .sp .5v
20968 .          nr lead-pre-caption \\n[.v]
20969 .          ev caption
20970 .          evc IMG
20971 .          ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
20972 .          el \{\
20973 .             img*caption-style
20974 .             vs \\n[.ps]u+\\n[pdf-img*caption-autolead]u
20975 .          \}
20976 .          PDF_IMG*SET_CAPTION_QUAD \\*[pdf-img*caption-quad]
20977 .          sp \\n[lead-pre-caption]u-\\n[.v]u
20978 .          nop \\*[pdf-img*caption]
20979 .          br
20980 .          if !'\\*[pdf-img*caption-space]'' .sp \\*[pdf-img*caption-space]
20981 .          ev
20982 .          in 0
20983 .          sp -.5v
20984 .       \}
20985 .    \}
20986 .    nf
20987 .    if \\n[pdf-img:frame] \{\
20988 .       nr frame-width \\n[pdf-img:width]+(\\n[pdf-img:frame-inset]*2)
20989 .       nr frame-depth \\n[pdf-img:depth]+(\\n[pdf-img:frame-inset]*2)
20990 .       if '\\*[pdf-img:pos]'-L' \{\
20991 .          nr pdf-img:ind \\n[pdf-img:frame-inset]
20992 .          nr pdf-img:dbx-ind 0
20993 .       \}
20994 .       if '\\*[pdf-img:pos]'-C' \{\
20995 .          nr pdf-img:dbx-ind \
20996 \\n[.ll]-\\n[ind-pre-img]-\\n[pdf-img:width]/2-\\n[pdf-img:frame-inset]
20997 .       \}
20998 .       if '\\*[pdf-img:pos]'-R' \{\
20999 .          nr pdf-img:ind -\\n[pdf-img:frame-inset]
21000 .          nr pdf-img:dbx-ind \
21001 \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)+\\n[ind-pre-img]u)
21002 .       \}
21003 .       if '\\*[pdf-img:pos]'-I' \{\
21004 .          nr pdf-img:ind +\\n[pdf-img:frame-inset]
21005 .          nr pdf-img:dbx-ind \\n[pdf-img:ind]-\\n[pdf-img:frame-inset]
21006 .       \}
21007 .       DBX \\*[pdf-img:frame-weight] \
21008             \\n[pdf-img:dbx-ind]u \
21009             \\n[frame-width]u \
21010             \\n[frame-depth]u \
21011             \\*[pdf-img:frame-color]
21012 .       sp \\n[pdf-img:frame-inset]u
21013 .       nr pdf-img:ind -\\n[pdf-img:frame-inset]
21014 .    \}
21015 .    ti \\n[pdf-img:ind]u+\\n[pdf-img:frame-inset]u
21016 .    nop \X'pdf: pdfpic \\*[pdf-img:file] -L \\n[pdf-img:width]z \\n[pdf-img:depth]z'
21017 .    if '\\*[pdf-img:pos]'-C' .nr pdf-img:ind +\\n[pdf-img:frame-inset]
21018 .    sp \\n[pdf-img:depth]u
21019 .    if \\n[pdf-img:frame] .sp \\n[pdf-img:frame-inset]u
21020 .    if (\\n[pdf-img*have-label]=1):(\\n[pdf-img*autolabel]=1):(\\n[pdf-img*caption-after-label]=1) \{\
21021 .       if \\n[#MLA] \{\
21022 .          if (\\n[pdf-img*have-label]=1):(\\n[pdf-img*autolabel]=1) \{\
21023 .             if !\\n[pdf-img*have-caption] \
21024 .                mla@error label caption \\n[.F] \\$0 \\n[.c]
21025 .          \}
21026 .       \}
21027 .       nr lead-pre-label \\n[.v]
21028 .       ev label
21029 .       evc IMG
21030 .       ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
21031 .       el \{\
21032 .          img*label-style
21033 .          vs \\n[.ps]u+\\n[pdf-img*label-autolead]u
21034 .       \}
21035 .       if \\n[pdf-img*label-with-chapter] \
21036 .          ds chapno \\n[#CH_NUM].
21037 .       PDF_IMG*SET_LABEL_QUAD \\*[pdf-img*label-quad]
21038 .       sp \\n[lead-pre-label]u-\\n[.v]u
21039 .       if !'\\*[pdf-img*label-space]'' .sp \\*[pdf-img*label-space]
21040 .       ie \\n[pdf-img*autolabel] \
21041 .          nop \
21042 \\*[pdf-img*label-prfx]\\*[chapno]\\n+[fig*label-num]\\*[pdf-img*label-sffx]\|
21043 .       el .if !'\\*[pdf-img*label]'' .nop \\*[pdf-img*label]
21044 .       if \\n[pdf-img*autolabel] \
21045 .          ds pdf-img*label \\*[chapno]\\n[fig*label-num]
21046 .       fam
21047 .       ft
21048 .       ps
21049 .       gcolor
21050 .       if !'\\*[pdf-img*caption]'' \{\
21051 .          if \\n[pdf-img*caption-after-label] \{\
21052 .             ds pdf-img*caption " \\*[pdf-img*caption]
21053 .             nop \\*[pdf-img*caption-specs]\\*[pdf-img*caption]\\*[revert-specs]
21054 .          \}
21055 .       \}
21056 .       sp .5v
21057 .       ev
21058 .       in 0
21059 .    \}
21060 \!.  in
21061 .    di
21062 .    nf
21063 .    vpt 0
21064 .    if !'\\*[pdf-img:adj]'' \{\
21065 .       if \\n[@TOP] \
21066 .          if \\n[#COLUMNS]>1 \
21067 \!.           rs
21068 \!.     sp \\*[pdf-img:adj]
21069 .    \}
21070 .    PDF*IMAGE
21071 .    if !'\\*[pdf-img:adj]'' \
21072 .       if !\\n[@TOP] \!.sp -\\*[pdf-img:adj]
21073 .    vpt
21074 .    ev
21075 .    FLOAT off
21076 .    nr dl \\n[pdf-img:width]
21077 .    if !'\\*[pdf-img*caption-short]'' .ds short -short
21078 .    ie !'\\*[pdf-img*label]'' \
21079 .       TO_FIGURES "\\*[pdf-img*label]" "\\*[pdf-img*caption\\*[short]]"
21080 .    el .TO_FIGURES "\\*[pdf-img*caption\\*[short]]"
21081 .    PDF_IMAGE_CLEAN 
21082 .END
21083 \#
21084 \# PDF_IMAGE_FRAME
21085 \# ---------------
21086 \# *Arguments:
21087 \#   [ <inset> ] [ <rule weight> ] [ <color> ]
21088 \# *Function:
21089 \#   Sets parameters for pdf image frames.
21090 \# *Notes:
21091 \#   Defaults are '6p' '.5' 'black'.  Arguments to be left at default
21092 \#   must be entered as "".
21093 \#
21094 .MAC PDF_IMAGE_FRAME END
21095 .    if !'\\$1''\{\
21096 .       ds frame-arg \\$1
21097 .       substring frame-arg -1
21098 .       ie \B'\\*[frame-arg]' \{\
21099 .          tm1 "[mom]: \\$0 inset argument at line \\n[.c]
21100 .          tm1 "       of '\\n[.F]' requires a unit of measure.
21101 .          tm1 "       Default 6 point inset will be used instead.
21102 .       \}
21103 .       el .nr pdf-img:frame-inset \\$1
21104 .    \}
21105 .    shift
21106 .    if !'\\$1'' \{\
21107 .       ds frame-arg \\$1
21108 .       substring frame-arg -1
21109 .       ie \B'\\*[frame-arg]' \{\
21110 .          ds pdf-img:frame-weight \\$1
21111 .          shift
21112 .       \}
21113 .       el \{\
21114 .          ds frame-arg \\$1
21115 .          substring frame-arg -1 
21116 .          length arg-len \\*[frame-arg]
21117 .          if \\n[arg-len]=1 \{\
21118 .             tm1 "[mom]: \\$0 rule weight argument at line \\n[.c]
21119 .             tm1 "       of '\\n[.F]' must not have a unit of measure appended.
21120 .             tm1 "       Default .5 rule weight will be used instead.
21121 .             shift
21122 .          \}
21123 .       \}
21124 .    \}
21125 .    if !'\\$1'' \{\
21126 .       ie m \\$1 .ds pdf-img:frame-color \\$1
21127 .       el \{\
21128 .          tm1 "[mom]: \\$0 color argument '\\$1' at line \\n[.c]
21129 .          tm1 "       of '\\n[.F]' is not a valid color.
21130 .          tm1 "       Default black will be used instead.
21131 .       \}
21132 .    \}
21133 .END
21134 \#
21135 .MAC PDF_IMAGE_CLEAN END
21136 .    rm PDF*IMAGE
21137 .    rm pdf-img:adj
21138 .    rm pdf-img*caption
21139 .    rm pdf-img*caption-short
21140 .    rm pdf-img*caption-space
21141 .    rm pdf-img:file
21142 .    rm pdf-img*label
21143 .    rm pdf-img*label-space
21144 .    rm pdf-img:pos
21145 .    rm short
21146 .    rr ind-pre-img
21147 .    rr pdf-img:depth
21148 .    rr pdf-img:float
21149 .    rr pdf-img:frame
21150 .    rr pdf-img:ind
21151 .    rr pdf-img:no-shim
21152 .    rr pdf-img:scale
21153 .\" Cutarounds not yet implemented
21154 .    if !\\n[defer] \
21155 .       if !\\n[cutaround] \
21156 .          rr pdf-img*have-caption
21157 .    if !\\n[cutaround] \{\
21158 .       rr pdf-img:frame-inset
21159 .       rr pdf-img:width
21160 .    \}
21161 .    if '\\*[pdf-img*label-sffx-tmp]'.' .ds pdf-img*label-sffx .
21162 .END
21163 \#
21164 .de pdfmomclean
21165 .   ie '\\n[.z]'' \{\
21166 .      ds pdfcleaned \\$*
21167 .      ev pdfcln
21168 .      tr \[em]-
21169 .      nf
21170 .      box pdf:clean
21171 .      nop \\*[\\*[pdfcleaned]]
21172 .      fl
21173 .      box
21174 .      chop pdf:clean
21175 .      asciify pdf:clean
21176 .      ev
21177 .      ds \\*[pdfcleaned] "\\*[pdf:clean]
21178 .      rm pdf:clean
21179 .      tr \[em]\[em]
21180 .    \}
21181 .    el .nop \!.pdfmomclean \\$@
21182 ..
21183 \# vim: ft=groff: encoding=latin1: fileencoding=latin1: nomodified: