Fix kldstat option.
[dragonfly.git] / contrib / groff-1.19 / contrib / mom / om.tmac
1 .\" om.tmac
2 .ig
3 Mom -- a typesetting/document-processing macro set for groff.
4
5 Copyright (C) 2002, 2003 Free Software Foundation, Inc.
6      Written by Peter Schaffter (peter@faustus.dyn.ca)
7
8 This file is part of groff.
9
10 groff is free software; you can redistribute it and/or modify it under
11 the terms of the GNU General Public License as published by the Free
12 Software Foundation; either version 2, or (at your option) any later
13 version.
14
15 groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18 for more details.
19
20 You should have received a copy of the GNU General Public License along
21 with groff; see the file COPYING.  If not, write to the Free Software
22 Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
24 Version 1.3-a
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
33 ain't broke, don't fix it," so I'm leaving any major clean-up
34 of redundancies and whatnot for a rainy day.
35
36 Inasmuch as possible, macros that turn a feature on or off follow
37 a similar style.  Invoking the macro without an argument turns
38 the feature on.  Invoking it with any other argument turns it off.
39 Use of the argument OFF is recommended, but not required; users
40 may find other conventions preferable (e.g. NO, X, END, QUIT, etc.).
41
42 "<anything>" in the description of arguments that can be passed
43 to a macro means that any argument turns the feature off.
44 ..
45 \#
46 \# ====================================================================
47 \#
48 \# Check which version of groff is being run
49 .if (\n[.x]\n[.y] < 118) \
50 .  ab You need GNU troff version 1.18 or higher to run this version of mom.
51 \# Check that GNU troff is being run
52 .if !\n[.g]=1 \
53 .  ab The mom macros require that you be running GNU troff.
54 .if \n(.C \
55 .   ab The groff mom macros do not work in compatibility mode.
56 \# Add supplementary styles
57 .sty \n[.fp] L       \"  Light Roman
58 .sty \n[.fp] LI      \"  Light Italic
59 .sty \n[.fp] LCD     \"  Light Condensed Roman
60 .sty \n[.fp] LCDI    \"  Light Condensed Italic
61 .sty \n[.fp] LEX     \"  Light Extended Roman
62 .sty \n[.fp] LEXI    \"  Light Extended Italic
63 .sty \n[.fp] CD      \"  Medium/Book Condensed Roman
64 .sty \n[.fp] CDI     \"  Medium/Book Condensed Italic
65 .sty \n[.fp] EX      \"  Medium/Book Extended Roman
66 .sty \n[.fp] EXI     \"  Medium/Book Extended Italic
67 .sty \n[.fp] DB      \"  DemiBold Roman
68 .sty \n[.fp] DBI     \"  DemiBold Italic
69 .sty \n[.fp] BCD     \"  Bold Condensed Roman
70 .sty \n[.fp] BCDI    \"  Bold Condensed Italic
71 .sty \n[.fp] BEX     \"  Bold Extended Roman
72 .sty \n[.fp] BEXI    \"  Bold Extended Italic
73 .sty \n[.fp] HV      \"  Heavy Roman
74 .sty \n[.fp] HVI     \"  Heavy Italic
75 .sty \n[.fp] HVCD    \"  Heavy Condensed Roman
76 .sty \n[.fp] HVCDI   \"  Heavy Condensed Italic
77 .sty \n[.fp] HVEX    \"  Heavy Extended Roman
78 .sty \n[.fp] HVEXI   \"  Heavy Extended Italic
79 .sty \n[.fp] BL      \"  Black Roman
80 .sty \n[.fp] BLI     \"  Black Italic
81 .sty \n[.fp] BLCD    \"  Black Condensed Roman
82 .sty \n[.fp] BLCDI   \"  Black Condensed Italic
83 .sty \n[.fp] BLEX    \"  Black Extended Roman
84 .sty \n[.fp] BLEXI   \"  Black Extended Italic
85 .sty \n[.fp] UBL     \"  Ultra-Black Roman
86 .sty \n[.fp] UBLI    \"  Ultra-Black Italic
87 \#
88 \# ====================================================================
89 \#
90 \# TYPESETTING MACROS, STRINGS, AND ALIASES
91 \# ========================================
92 \#
93 \# +++ALIASES+++
94 \#
95 \# Alias .als as ALIAS, and .aln (number registers) as ALIASN
96 \#
97 .als      ALIAS           als
98 .als      ALIASN          aln
99 \#
100 \#
101 \# ALIASES FOR GROFF REQUESTS
102 \# --------------------------
103 \#
104 .ALIAS    MAC             de
105 .ALIAS    BR              br
106 .ALIAS    SP              sp
107 .ALIAS    PAGELENGTH      pl
108 .ALIAS    SPREAD          brp
109 .ALIAS    ESC_CHAR        ec
110 .ALIAS    STRING          ds
111 \#
112 \# ALIASES FOR NUMBER REGISTERS
113 \# ----------------------------
114 \#
115 .ALIASN  #PT_SIZE        .ps    \"fractional point size in units
116 .ALIASN  #DIVER_DEPTH     dn    \"diversion depth
117 .ALIASN  #DIVER_WIDTH     dl    \"diversion width
118 .ALIASN  #TRAP_DISTANCE  .t     \"distance to next trap
119 .ALIASN  #LEAD           .v     \"line space (.vs, not .ls)
120 .ALIASN  #PAGE_LENGTH    .p     \"page length
121 .ALIASN  #NUM_ARGS       .$     \"number of arguments passed to a macro
122 .ALIASN  #INDENT         .i     \"value of current indent
123 \#
124 \# ====================================================================
125 \#
126 \# MISCELLANEOUS
127 \# =============
128 .nr #L_MARGIN \n(.o  \" Tabs, etc require #L_MARGIN
129 .cflags 4 /\(en      \" So slash and en-dashes get broken
130 .warn 8192
131 \#
132 .ig
133 About the warn level
134 --------------------
135
136 There's a lot of testing for the presence of number registers and
137 strings in this macro file.  Many of the registers and strings
138 pop into and out of existence on the fly.  For convenience, I
139 often use
140
141     .if \\n[whatever]    and    .if !\\n[whatever]
142
143 to test "if the register exists and is (not) empty."  Groff,
144 encountering such tests when called with the -ww options, emits
145
146     warning: number register whatever not defined.
147
148 Groff also warns about strings similarly tested for.
149
150 The warn level, above, is high in order to shut off those
151 warnings.  If you're futzing in this file and need more verbose
152 warnings, either comment out ".warn 8192" or set the warnlevel
153 to the one you need (but be ready for lots of what I've just
154 described).
155 ..
156 \#
157 \# ====================================================================
158 \#
159 \# +++PAGE LAYOUT+++
160 \#
161 \# Macros that control the physical layout of the page: paper size
162 \# and margins.
163 \#
164 \# PAGE WIDTH
165 \# ----------
166 \# *Argument:
167 \#   <width of printer sheet>
168 \# *Function:
169 \#   Stores user supplied page width in register #PAGE_WIDTH.
170 \# *Notes:
171 \#   #PAGE_WIDTH is used to establish the default LL (and right margin).
172 \#   Requires unit of measure.
173 \#
174 .MAC PAGEWIDTH END
175 .    br
176 .    nr #PAGE_WIDTH \\$1
177 .    if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
178 .    if !r#R_MARGIN \{ .R_MARGIN 1i \}
179 .END
180 \#
181 \#
182 \# L_MARGIN
183 \# --------
184 \# *Argument:
185 \#   <offset from page left>
186 \# *Function:
187 \#   Stores user supplied page offset in register #L_MARGIN.
188 \#   Sets .po to user supplied offset.
189 \# *Notes:
190 \#   Requires unit of measure.
191 \#
192 .MAC L_MARGIN END
193 .    br
194 .    nr #L_MARGIN (\\$1)
195 .    po \\n[#L_MARGIN]u
196 .END
197 \#
198 \#
199 \# R_MARGIN
200 \# --------
201 \# *Argument:
202 \#   <width of right margin>
203 \# *Function:
204 \#   Stores user supplied right margin in register #R_MARGIN.
205 \# *Notes:
206 \#   This is a pseudo-margin.  Right margin is actually a function of
207 \#   line length.  The macro calculates line length from the page offset
208 \#   and the value plugged into #R_MARGIN.
209 \#
210 \#   N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
211 \#
212 \#   Requires unit of measure.
213 \#
214 .MAC R_MARGIN END
215 .    br
216 .    nr #R_MARGIN (\\$1)
217 .    ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
218 .    ta \\n(.lu
219 .    nr #L_LENGTH \\n(.l
220 .END
221 \#
222 \#
223 \# T_MARGIN
224 \# --------
225 \# *Argument:
226 \#   <distance to advance from top of page>
227 \# *Function:
228 \#   Stores the user supplied top margin in register #T_MARGIN.
229 \#   Advances user supplied depth from the top of the page.
230 \# *Notes:
231 \#   Requires unit of measure.
232 \#
233 .MAC T_MARGIN END
234 .    nr #T_MARGIN (\\$1)
235 .    nr #TOP 1
236 .    if !\\n[#DOCS] \{\
237 .       sp |\\n[#T_MARGIN]u-1v
238 .    \}
239 .    wh 0i DO_T_MARGIN
240 .END
241 \#
242 \#
243 \# B_MARGIN
244 \# --------
245 \# *Argument:
246 \#   <space to leave at the bottom of the page>
247 \# *Function:
248 \#   Stores the user supplied bottom margin in register #B_MARGIN.
249 \# *Notes:
250 \#   Requires unit of measure.
251 \#
252 .MAC B_MARGIN END
253 .    br
254 .    nr #B_MARGIN (\\$1)
255 .    nr #ORIGINAL_B_MARGIN \\n[#B_MARGIN]
256 .    nr #B_MARGIN_SET 1
257 .    wh -\\n[#B_MARGIN]u DO_B_MARGIN
258 .END
259 \#
260 \#
261 \# PAGE
262 \# ----
263 \# *Arguments:
264 \#   <pagewidth>  [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
265 \# *Function:
266 \#   Page set-up.  Collects arguments and passes them to the appropriate
267 \#   macros.
268 \# *Notes:
269 \#   All arguments after pagewidth are optional, but must appear
270 \#   in the order given above.  (User can fill in as much or as
271 \#   little as desired.)
272 \#
273 \#   All arguments require a unit of measure.
274 \#
275 .MAC PAGE END
276 .    br
277 .    PAGEWIDTH   \\$1
278 .    PAGELENGTH  \\$2
279 .    ie '\\$3''  \{ .L_MARGIN \\n(.o  \}
280 .    el          \{ .L_MARGIN \\$3    \}
281 .    ie '\\$4''  \{ .R_MARGIN 1i      \}
282 .    el          \{ .R_MARGIN \\$4    \}
283 .    if !'\\$5'' \{ .T_MARGIN \\$5    \}
284 .    if !'\\$6'' \{ .B_MARGIN \\$6    \}
285 .END
286 \#
287 \# =====================================================================
288 \#
289 \# +++PAGE CONTROL+++
290 \#
291 \# Generic macros for breaking pages.
292 \#
293 \# DO_T_MARGIN
294 \# -----------
295 \# *Argument:
296 \#   <none>
297 \# *Function:
298 \#   Plants the top margin at the top of each page.
299 \# *Notes:
300 \#   The trap is set in .T_MARGIN or .PAGE
301 \#
302 .MAC DO_T_MARGIN END
303 .    ev T_MARGIN
304 .    nr #TOP 1
305 .    sp |\\n[#T_MARGIN]u-1v
306 .    ev
307 .    sp -\\n[#T_MARGIN_LEAD_ADJ]u
308 .END
309 \#
310 \#
311 \# DO_B_MARGIN
312 \# -----------
313 \# *Argument:
314 \#   <none>
315 \# *Function:
316 \#   Plants the bottom margin at the bottom of each page.
317 \# *Notes:
318 \#   The trap is set in .B_MARGIN or .PAGE.
319 \#
320 .MAC DO_B_MARGIN END
321 .    nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000
322 .    ev B_MARGIN
323 .    bp
324 .    ev
325 .END
326 \#
327 \#
328 \# NEWPAGE
329 \# -------
330 \# *Argument:
331 \#   <none>
332 \# *Function:
333 \#   Breaks to a new page.
334 \# *Notes:
335 \#   If a B_MARGIN has been set, processes that, otherwise, just
336 \#   breaks to a new page.
337 \#
338 .MAC NEWPAGE END
339 .    br
340 .    nr #NEWPAGE 1
341 .    ie \\n[#B_MARGIN_SET]=1 \{\
342 .       ie !\\n[#DOCS]=1 \{\
343 .          ev NP
344 .          bp
345 .          ev
346 .       \}
347 .       el \{\
348 .          if \\n[#COLUMNS]=1 \{ .nr #COL_NUM \\n[#NUM_COLS] \}
349 .          ie !\\n[#FN_DEPTH] \{\
350 .             ch FN_OVERFLOW_TRAP
351 .             DO_B_MARGIN
352 .             wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
353 .          \}
354 .          el \{\
355 .             DO_B_MARGIN
356 .          \}
357 .       \}
358 .    \}
359 .    el \{\
360 .       DO_B_MARGIN
361 .    \}
362 .END
363 \#
364 \# =====================================================================
365 \#
366 \# +++GENERAL STYLE MACROS+++
367 \#
368 \# Macros that are likely to appear together to define general
369 \# type style: line length, family, font, point size, and line
370 \# spacing.
371 \#
372 \# LINE LENGTH
373 \# -----------
374 \# *Argument:
375 \#   <line length>
376 \# *Function:
377 \#   Stores user supplied line length in register #L_LENGTH.
378 \#   Sets .ll to #L_LENGTHu
379 \# *Notes:
380 \#   Requires unit of measure.
381 \#
382 .MAC LL END
383 .    nr #USER_SET_L_LENGTH 1
384 .    ll \\$1
385 .    nr #L_LENGTH \\n(.l
386 .    ta \\n(.lu
387 .END
388 \#
389 \#
390 \# +++FAMILY AND FONT+++
391 \#
392 \# FALLBACK FONT
393 \# -------------
394 \# *Argument:
395 \#   <fallback font> [ ABORT | WARN ] | ABORT | WARN
396 \# *Function:
397 \#   Sets register #ABORT_FT_ERRORS to 1, or defines a fallback font
398 \#   called "dummy" at font position 0.
399 \# *Notes:
400 \#   Calls to non-existent families cause mom to continue processing
401 \#   files using the fallback font until a valid family is entered.
402 \#
403 \#   Calls to non-existent fonts generate warnings.  If ABORT is passed
404 \#   to FALLBACK_FONT, mom stops processing files after the warning.
405 \#   Otherwise, she continues to process files using the fallback font
406 \#   after the warning is issued.  The default fallback font is CR; the
407 \#   default for font warnings is to abort.
408 \#
409 .MAC FALLBACK_FONT END
410 .    if \\n[#NUM_ARGS]=1 \{\
411 .       if '\\$1'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
412 .       if '\\$1'WARN' \{\
413 .          if r#ABORT_FT_ERRORS \{ .nr #ABORT_FT_ERRORS 0 \}
414 .       \}
415 .       if !'\\$1'ABORT' \{\
416 .          if !'\\$1'WARN' \{\
417 .             fp 0 dummy \\$1
418 .          \}
419 .       \}
420 .    \}
421 .    if \\n[#NUM_ARGS]=2 \{\
422 .       fp 0 dummy \\$1
423 .       if '\\$2'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
424 .       if '\\$2'WARN'  \{ .nr #ABORT_FT_ERRORS 0 \}
425 .    \}
426 .END
427 \#
428 .FALLBACK_FONT CR ABORT
429 \#
430 \# FAMILY
431 \# ------
432 \# *Argument:
433 \#   <font family>
434 \# *Function:
435 \#   Stores user supplied font family in string $FAMILY.  Sets .fam
436 \#   to $FAMILY.
437 \#
438 .MAC FAMILY END
439 .    if \\n[#PRINT_STYLE]=1 \{\
440 .       fam C
441 .       return
442 .    \}
443 .    if \\n[#IGNORE] \{\
444 .       fam C
445 .       return
446 .    \}
447 .    if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
448 .       ds $SAVED_STYLE \\n[.sty]
449 .    \}
450 .    ds $FAMILY \\$1
451 .    ft 0
452 .    fam \\*[$FAMILY]
453 .    if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
454 .       ft \\*[$SAVED_STYLE]
455 .       if !F\\n[.fn] \{\
456 .          ft 0
457 .       \}
458 .    \}
459 .    if \\n[#COLLATE]=1 \{\
460 .       if !r#START \{ .DOC_FAM \\*[$FAMILY] \}
461 .    \}
462 .END
463 \#
464 \#
465 \# FONT
466 \# ----
467 \# *Argument:
468 \#   R | I | B | BI | <other style extension>
469 \# *Function:
470 \#  Stores user supplied font in $FONT and sets .ft to $FONT.
471 \#
472 .MAC FT END
473 .    if \\n[#PRINT_STYLE]=1 \{\
474 .       ie '\\$1'I' \{\
475 .          if \\n[#UNDERLINE_ITALIC]=1 \{\
476 .             UNDERLINE
477 .             return
478 .          \}
479 .          if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
480 .             ds $FONT \\$1
481 .             ft \\*[$FONT]
482 .             return
483 .          \}
484 .       \}
485 .       el \{ .UNDERLINE OFF \}
486 .       return
487 .    \}
488 .    ds $FONT \\$1
489 .    ft 0
490 .    ft \\*[$FONT]
491 .    if if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
492 .       if '\\n[.sty]'' \{\
493 .          if !F\\n[.fn] \{\
494 .             if !S\\*[$FONT] \{\
495 .                tm1 "[mom]: Font style "\\*[$FONT]" at line \\n(.c has not been registered.
496 .                ie \\n[#ABORT_FT_ERRORS]=0 \{\
497 .                   tm1 "       Continuing to process using fallback font.
498 .                \}
499 .                el .ab Aborting.
500 .             \}
501 .             if \\n[.f]=0 \{\
502 .                tm1 "[mom]: Either font style "\\*[$FONT]" at line \\n(.c does not exist in family "\\n[.fam]",
503 .                tm1 "       or family "\\n[.fam]" has not been installed in font/devps.
504 .                ie \\n[#ABORT_FT_ERRORS]=0 \{\
505 .                   tm1 "       Continuing to process using fallback font.
506 .                \}
507 .                el .ab Aborting.
508 .             \}
509 .          \}
510 .       \}
511 .    \}
512 .END
513 \#
514 \#
515 \# POINT SIZE
516 \# ----------
517 \# *Arguments:
518 \#   <point size of type>
519 \# *Function:
520 \#   Sets point size to user supplied value in scaled points.
521 \#   If #AUTO_LEAD is on, sets .vs to #AUTOLEAD_VALUE+#PT_SIZE.
522 \# *Notes:
523 \#   Must NOT use a unit of measure.
524 \#
525 .MAC PT_SIZE END
526 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
527 .    if \\n[#IGNORE]        \{ .return \}
528 .    nr #PT_SIZE_SET 1
529 .    ps \\$1
530 .    if \\n[#AUTO_LEAD] \{\
531 .       ie \\n[#AUTOLEAD_FACTOR] \{ .vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u \}
532 .       el \{ .vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u \}
533 .    \}
534 .    nr #PT_SIZE_IN_UNITS \\n[.ps]
535 .END
536 \#
537 \#
538 \# SIZE (inline)
539 \# -------------
540 \# *Arguments:
541 \#   <point size of type>
542 \# *Function:
543 \#   Sets point size to user supplied value in scaled points.
544 \#   Intended to be called inline with \*[SIZE <n><unit>]
545 \# *Notes:
546 \#   Can be used with a unit of measure or not.
547 \#
548 .MAC SIZE END
549 \c
550 .ps \\$1
551 .END
552 \#
553 \#
554 \# LEADING
555 \# -------
556 \# *Argument:
557 \#   <leading between lines of text>
558 \# *Function:
559 \#   Turns off #AUTOLEAD if it's on.
560 \#   Sets .vs to user supplied value.
561 \# *Notes:
562 \#   Does not require unit of measure.  LS automatically turns off AUTOLEAD.
563 \#
564 .MAC LS END
565 .    br
566 .    nr #OLD_LEAD \\n(.v
567 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
568 .    if \\n[#IGNORE]        \{ .return \}
569 .    if \\n[#AUTO_LEAD] \{\
570 .       rr #AUTO_LEAD
571 .       rr #AUTOLEAD_FACTOR
572 .    \}
573 .    vs \\$1
574 .    if \\n[#TOP] \{\
575 .       nr #TOP_BASELINE_ADJ \\n(.v-\\n[#OLD_LEAD]
576 .       sp -\\n[#TOP_BASELINE_ADJ]u
577 .       rr #TOP
578 .       rr #TOP_BASELINE_ADJ
579 .    \}
580 .END
581 \#
582 .MAC RESET_LEAD END
583 '    vs
584 .    ch RESET_LEAD
585 .END
586 \#
587 \#
588 \# AUTOLEAD
589 \# --------
590 \# *Argument:
591 \#   <leading value to add to #PT_SIZE> [FACTOR]
592 \# *Function:
593 \#   Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
594 \#   Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
595 \#   All subsequent PT_SIZE requests reset the leading in the same way until
596 \#   AUTOLEAD is turned off.
597 \# *Notes:
598 \#   With the optional FACTOR argument, the current point size is
599 \#   multiplied by #AUTOLEAD_VALUE instead of the two being added
600 \#   together.
601 \#
602 .MAC AUTOLEAD END
603 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
604 .    if \\n[#IGNORE]        \{ .return \}
605 .    nr #AUTO_LEAD 1
606 .    nr #OLD_LEAD \\n(.v
607 .    nr #AUTOLEAD_VALUE (p;\\$1)
608 .    ie \\n[#NUM_ARGS]=2 \{\
609 .       if '\\$2'FACTOR' \{\
610 .          nr #AUTOLEAD_FACTOR 1
611 .          vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u
612 .       \}
613 .    \}
614 .    el \{\
615 .       vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u
616 .    \}
617 .    if \\n[#TOP] \{\
618 .       nr #TOP_BASELINE_ADJ \\n(.v-\\n[#OLD_LEAD]
619 .       sp -\\n[#TOP_BASELINE_ADJ]u
620 .       rr #TOP
621 .       rr #TOP_BASELINE_ADJ
622 .    \}
623 .END
624 \#
625 \#
626 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
627 \# ------------------------------------------------
628 .ds ROM  \EfR
629 .ds IT   \EfI
630 .ds BD   \EfB
631 .ds BDI  \Ef(BI
632 .ds PREV \EfP
633 .ds S    \Es
634 \#
635 \# =====================================================================
636 \#
637 \# +++KERNING+++
638 \#
639 \# AUTOMATIC PAIRWISE KERNING
640 \# --------------------------
641 \# *Arguments:
642 \#   <none> | <anything>
643 \# *Function:
644 \#   Turns automatic pairwise kerning on or off.
645 \#
646 .MAC KERN END
647 .    ie '\\$1'' \{\
648 .       kern
649 .       nr #KERN 1
650 .    \}
651 .    el \{\
652 .       kern 0
653 .       nr #KERN 0
654 .    \}
655 .END
656 \#
657 \#
658 .ig
659 INLINE KERNING AND HORIZONTAL MOVEMENT
660 --------------------------------------
661 Kerning
662
663 Inline kerning provides a simple method for users to adjust the
664 amount of space between any two letters.  It's predicated on a
665 unit of measure "U", which is 1/36 of the current point size as
666 returned by \n[.ps].  E.g., if the current point size is 18,
667 \n[.ps] returns 18000u, therefore U=500u.  Since U remains
668 proportional relative to the current point size, the amount
669 of kerning between two letters as expressed in Us remains
670 visually similar regardless of changes in point size.
671
672 N.B.--the amount of inline kerning supplied by \*[BU<n>] or
673 \*[FU<n>] is added to or subtracted from any kerning that already
674 takes place between two characters when automatic kerning is
675 turned on.
676
677 In groff v. 1.17.2, it was not possible to pass arguments to macros that
678 were called with inline escapes, nor thence to evaluate conditional
679 expressions.  Consequently, each pseudo-escape \[BU<n>] had to be defined
680 separately with ".char".
681
682 As of v. 1.18, one can pass arguments to inline strings/macros,
683 hence it is now possible to do \*[BU n] where n, inline, is the desired
684 number of kern units.  The original .char definitions have been left in
685 for backward compatibility with documents created prior to mom-1.1.3c.
686 ..
687 \#
688 .nr #KERN_UNIT 36
689 .ds BU   \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
690 .ds FU   \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
691 \#
692 \# Initialize strings for pre-1.1.3c-style BU and FU
693 \#
694 .nr #LOOP 0 1
695 .while \n+[#LOOP]<37 \{\
696 .   ds BU\n[#LOOP]  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
697 .\}
698 \#
699 .nr #LOOP 0 1
700 .while \n+[#LOOP]<37 \{\
701 .   ds FU\n[#LOOP]  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
702 .\}
703 .rr #LOOP
704 \#
705 .ig
706 Horizontal movements
707
708 BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
709 specified number of points.
710 Left in for backward compatibility with mom-1.1.3c, the
711 preferred methods for inline horizontal movements are now
712 \*[BCK <n><unit>] and \*[FWD <n><unit>].
713 ..
714 \#
715 .ds BCK  \h'-\\$1'
716 .ds FWD  \h'\\$1'
717 \#
718 .ds BP.25    \h'-.25'
719 .ds BP.5     \h'-.5'
720 .ds BP.75    \h'-.75'
721 .ds BP1      \h'-1p'
722 .ds BP1.25   \h'-1.25p'
723 .ds BP1.5    \h'-1.5p'
724 .ds BP1.75   \h'-1.75p'
725 .ds BP2      \h'-2p'
726 .ds BP2.25   \h'-2.25p'
727 .ds BP2.5    \h'-2.5p'
728 .ds BP2.75   \h'-2.75p'
729 .ds BP3      \h'-3p'
730 .ds BP3.25   \h'-3.25p'
731 .ds BP3.5    \h'-3.5p'
732 .ds BP3.75   \h'-3.75p'
733 .ds BP4      \h'-4p'
734 .ds BP4.25   \h'-4.25p'
735 .ds BP4.5    \h'-4.5p'
736 .ds BP4.75   \h'-4.75p'
737 .ds BP5      \h'-5p'
738 .ds BP5.25   \h'-5.25p'
739 .ds BP5.5    \h'-5.5p'
740 .ds BP5.75   \h'-5.75p'
741 .ds BP6      \h'-6p'
742 .ds BP6.25   \h'-6.25p'
743 .ds BP6.5    \h'-6.5p'
744 .ds BP6.75   \h'-6.75p'
745 .ds BP7      \h'-7p'
746 .ds BP7.25   \h'-7.25p'
747 .ds BP7.5    \h'-7.5p'
748 .ds BP7.75   \h'-7.75p'
749 .ds BP8      \h'-8p'
750 .ds BP8.25   \h'-8.25p'
751 .ds BP8.5    \h'-8.5p'
752 .ds BP8.75   \h'-8.75p'
753 .ds BP9      \h'-9p'
754 .ds BP9.25   \h'-9.25p'
755 .ds BP9.5    \h'-9.5p'
756 .ds BP9.75   \h'-9.75p'
757 .ds BP10     \h'-10p'
758 .ds BP10.25  \h'-10.25p'
759 .ds BP10.5   \h'-10.5p'
760 .ds BP10.75  \h'-10.75p'
761 .ds BP11     \h'-11p'
762 .ds BP11.25  \h'-11.25p'
763 .ds BP11.5   \h'-11.5p'
764 .ds BP11.75  \h'-11.75p'
765 .ds BP12     \h'-12p'
766 .ds BP12.25  \h'-12.25p'
767 .ds BP12.5   \h'-12.5p'
768 .ds BP12.75  \h'-12.75p'
769 \#
770 .ds FP.25    \h'.25'
771 .ds FP.5     \h'.5'
772 .ds FP.75    \h'.75'
773 .ds FP1      \h'1p'
774 .ds FP1.25   \h'1.25p'
775 .ds FP1.5    \h'1.5p'
776 .ds FP1.75   \h'1.75p'
777 .ds FP2      \h'2p'
778 .ds FP2.25   \h'2.25p'
779 .ds FP2.5    \h'2.5p'
780 .ds FP2.75   \h'2.75p'
781 .ds FP3      \h'3p'
782 .ds FP3.25   \h'3.25p'
783 .ds FP3.5    \h'3.5p'
784 .ds FP3.75   \h'3.75p'
785 .ds FP4      \h'4p'
786 .ds FP4.25   \h'4.25p'
787 .ds FP4.5    \h'4.5p'
788 .ds FP4.75   \h'4.75p'
789 .ds FP5      \h'5p'
790 .ds FP5.25   \h'5.25p'
791 .ds FP5.5    \h'5.5p'
792 .ds FP5.75   \h'5.75p'
793 .ds FP6      \h'6p'
794 .ds FP6.25   \h'6.25p'
795 .ds FP6.5    \h'6.5p'
796 .ds FP6.75   \h'6.75p'
797 .ds FP7      \h'7p'
798 .ds FP7.25   \h'7.25p'
799 .ds FP7.5    \h'7.5p'
800 .ds FP7.75   \h'7.75p'
801 .ds FP8      \h'8p'
802 .ds FP8.25   \h'8.25p'
803 .ds FP8.5    \h'8.5p'
804 .ds FP8.75   \h'8.75p'
805 .ds FP9      \h'9p'
806 .ds FP9.25   \h'9.25p'
807 .ds FP9.5    \h'9.5p'
808 .ds FP9.75   \h'9.75p'
809 .ds FP10     \h'10p'
810 .ds FP10.25  \h'10.25p'
811 .ds FP10.5   \h'10.5p'
812 .ds FP10.75  \h'10.75p'
813 .ds FP11     \h'11p'
814 .ds FP11.25  \h'11.25p'
815 .ds FP11.5   \h'11.5p'
816 .ds FP11.75  \h'11.75p'
817 .ds FP12     \h'12p'
818 .ds FP12.25  \h'12.25p'
819 .ds FP12.5   \h'12.5p'
820 .ds FP12.75  \h'12.75p'
821 \#
822 \#
823 \# WHOLE LINE KERNING (RW and EW)
824 \# -----------------------------
825 \#
826 .ig
827 The line kerning macros are special instances of track kerning,
828 used where a complete line needs to be tightened (or relaxed) in
829 order to accomodate or remove one or two more characters
830 than the default justification permits.
831 ..
832 \#
833 \# *Argument:
834 \#   <amount of overall "kerning" (letter spacing) to apply to the line>
835 \# *Function:
836 \#   Invokes .tkf (track kerning) for the current font with
837 \#   1 as both the upper and lower point size limits, so that
838 \#   the value entered by the user applies regardless of point
839 \#   size.  RW ("Reduce Whitespace") reduces the amount of space
840 \#   between all characters by an equal amount.  EW ("Extra
841 \#   Whitespace") increases the amount of space.
842 \# *Notes:
843 \#   Decimal values are acceptable.
844 \#
845 .ig
846 The groff documentation is a tad confusing about what unit of
847 measure is used in track kerning, only that the width of each
848 character is increased or decreased by the amount(s) passed as
849 arguments to .tkf, and something about linear function of point
850 size.  In fact, with the way I've put this macro together, it
851 doesn't matter.  All the user needs to know is that a value of
852 one will produce an unacceptably tight or loose line at most text
853 point sizes; therefore, effective use of RW and EW is in the
854 fractional range below 1 (e.g. .25, .5).  Given that RW and EW
855 are for massaging type, a certain amount of experimentation and
856 previewing is expected and necessary.
857
858 \n(.f holds the current font number, which is acceptable to .tkf.
859
860 RW and EW must be reset to 0 to cancel their effect on subsequent
861 output lines.
862 ..
863 \#
864 .MAC RW END
865 .    if \\n[#BR_AT_LINE_KERN] \{\
866 .       ie \\n[#JUSTIFY]=1 \{ .brp \}
867 .       el \{ .br \}
868 .    \}
869 .    tkf \\n(.f 1 -\\$1 1 -\\$1
870 .END
871 \#
872 \#
873 .MAC EW END
874 .    if \\n[#BR_AT_LINE_KERN] \{\
875 .       ie \\n[#JUSTIFY]=1 \{ .brp \}
876 .       el \{ .br \}
877 .    \}
878 .    tkf \\n(.f 1 \\$1 1 \\$1
879 .END
880 \#
881 \#
882 \# BREAK AT LINE KERN
883 \# ------------------
884 \# *Arguments:
885 \#   toggle
886 \# *Function:
887 \#   Enables/disables .br's before .RW and .EW
888 \# *Notes:
889 \#   Mostly, users will want .br's before any kind of line kerning, but
890 \#   there may be cases where they don't.  BR_BEFORE_LINE_KERN is off by
891 \#   default and must be invoked explicitly.
892 \#
893 .MAC BR_AT_LINE_KERN END
894 .    ie '\\$1'' \{ .nr #BR_AT_LINE_KERN  1 \}
895 .    el         \{ .rr #BR_AT_LINE_KERN \}
896 .END
897 \#
898 \# =====================================================================
899 \#
900 \# +++HYPHENATION+++
901 \#
902 \# AUTO HYPHENATION
903 \# ----------------
904 \# *Arguments:
905 \#   <none> | <anything> | DEFAULT
906 \#                 or
907 \#   LINES <n> | MARGIN <n> | SPACE <n>
908 \# *Function:
909 \#   Turns auto hyphenation on or off, resets the hyphenation style
910 \#   to default, or permits the setting of various hyphenation
911 \#   parameters.
912 \# *Notes:
913 \#   HY, by itself, defaults to .hy 14, i.e. no hyphens after the
914 \#   first two or before the last two characters of a word, and no
915 \#   hyphenation of the last line prior to a trap (e.g., at the
916 \#   bottom of a page).
917 \#
918 \#   HY DEFAULT resets the hyphenation style to .hy 14 (see
919 \#   above) if that behaviour is desired after changes have been
920 \#   made to LINES, MARGIN, or SPACE.
921 \#
922 \#   HY LINES <n> sets the number of allowable consecutive hyphenated lines.
923 \#
924 \#   HY MARGIN <n> sets the amount of space (ipPcm) allowed at the end
925 \#   of a line in QUAD mode before hyphenation is tripped (e.g. if there's
926 \#   only 6 points left, groff won't try to hyphenate the next word).
927 \#
928 \#   HY SPACE sets the amount of extra interword space (ipPcm) that can
929 \#   be added in JUSTIFY mode to prevent a line from being hyphenated.
930 \#
931 .MAC HY END
932 .    ie '\\$1'' \{\
933 .       hy 14
934 .       nr #HYPHENATE 1
935 .    \}
936 .    el \{\
937 .       if !'\\$1'LINES'  \{\
938 .          nh
939 .          nr #HYPHENATE 0
940 .       \}
941 .       if !'\\$1'MARGIN' \{\
942 .          nh
943 .          nr #HYPHENATE 0
944 .       \}
945 .       if !'\\$1'SPACE'  \{\
946 .          nh
947 .          nr #HYPHENATE 0
948 .       \}
949 .       if !'\\$1'DEFAULT'  \{\
950 .          nh
951 .          nr #HYPHENATE 0
952 .       \}
953 .       if '\\$1'LINES'   \{ .hlm \\$2 \}
954 .       if '\\$1'MARGIN'  \{ .hym \\$2 \}
955 .       if '\\$1'SPACE'   \{ .hys \\$2 \}
956 .       if '\\$1'DEFAULT' \{\
957 .          hlm -1
958 .          hym 0
959 .          hys 0
960 .       \}
961 .    \}
962 .END
963 \#
964 \#
965 \# HYPHENATION PARAMETERS
966 \# ----------------------
967 \# *Arguments:
968 \#   <# of lines> | <size of margin> | <amount of interword space>
969 \# *Function:
970 \#   Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
971 \#
972 .MAC HY_SET END
973 .    nr #HY_SET 1
974 .    hlm \\$1
975 .    hym \\$2
976 .    hys \\$3
977 .END
978 \#
979 \# =====================================================================
980 \#
981 \# +++VERTICAL SPACING+++
982 \#
983 \# ADVANCE LEAD
984 \# ------------
985 \# *Argument:
986 \#   <user supplied lead to advance below current baseline>
987 \# *Function:
988 \#   Creates or modifies register #ALD.  Adds user supplied lead
989 \#   below current baseline.
990 \# *Notes:
991 \#   Requires a unit of measure.
992 \#
993 .MAC ALD END
994 .    if \\n(nl=0 \{ .nr #TOP 1 \}
995 .    if '\\$0'ALD' \{\
996 .       nr #ALD (\\$1)
997 .       sp \\n[#ALD]u
998 .    \}
999 .    if '\\$0'ADD_SPACE' \{\
1000 .       nr #ALD (\\$1)
1001 .       rs
1002 .       sp \\n[#ALD]u
1003 .    \}
1004 .    if '\\$0'SPACE' \{\
1005 .       sp \\$1u
1006 .    \}
1007 .    if '\\$0'SP' \{\
1008 .       sp \\$1u
1009 .    \}
1010 .END
1011 \#
1012 \#
1013 \# REVERSE LEAD
1014 \# ------------
1015 \# *Argument:
1016 \#   <user supplied lead to reverse above current baseline>
1017 \# *Function:
1018 \#   Creates or modifies register #RLD.  Reverses user supplied
1019 \#   lead above current baseline.
1020 \# *Notes:
1021 \#   Requires a unit of measure.
1022 \#
1023 .MAC RLD END
1024 .    nr #RLD (\\$1)
1025 .    sp -\\n[#RLD]u
1026 .END
1027 \#
1028 \# ALD/RLD STRINGS
1029 \# ---------------
1030 .ig
1031 The strings \*[ALD.25]...\*[ALD12.75] and their corresponding
1032 \*[RLD] forms have been left in for backward compatibility with
1033 documents created using mom-1.1.3c or earlier.  The prefered methods
1034 of advancing and reversing on the page inline are \*[UP <n><unit>]
1035 and \*[DOWN <n><unit>].
1036 ..
1037 \#
1038 .ds DOWN      \v'\\$1'
1039 .ds UP        \v'-\\$1'
1040 \#
1041 .ds ALD.25    \v'.25p'
1042 .ds ALD.5     \v'.5p'
1043 .ds ALD.75    \v'.75p'
1044 .ds ALD1      \v'1p'
1045 .ds ALD1.25   \v'1.25p'
1046 .ds ALD1.5    \v'1.5p'
1047 .ds ALD1.75   \v'1.75p'
1048 .ds ALD2      \v'2p'
1049 .ds ALD2.25   \v'2.25p'
1050 .ds ALD2.5    \v'2.5p'
1051 .ds ALD2.75   \v'2.75p'
1052 .ds ALD3      \v'3p'
1053 .ds ALD3.25   \v'3.25p'
1054 .ds ALD3.5    \v'3.5p'
1055 .ds ALD3.75   \v'3.75p'
1056 .ds ALD4      \v'4p'
1057 .ds ALD4.25   \v'4.25p'
1058 .ds ALD4.5    \v'4.5p'
1059 .ds ALD4.75   \v'4.75p'
1060 .ds ALD5      \v'5p'
1061 .ds ALD5.25   \v'5.25p'
1062 .ds ALD5.5    \v'5.5p'
1063 .ds ALD5.75   \v'5.75p'
1064 .ds ALD6      \v'6p'
1065 .ds ALD6.25   \v'6.25p'
1066 .ds ALD6.5    \v'6.5p'
1067 .ds ALD6.75   \v'6.75p'
1068 .ds ALD7      \v'7p'
1069 .ds ALD7.25   \v'7.25p'
1070 .ds ALD7.5    \v'7.5p'
1071 .ds ALD7.75   \v'7.75p'
1072 .ds ALD8      \v'8p'
1073 .ds ALD8.25   \v'8.25p'
1074 .ds ALD8.5    \v'8.5p'
1075 .ds ALD8.75   \v'8.75p'
1076 .ds ALD9      \v'9p'
1077 .ds ALD9.25   \v'9.25p'
1078 .ds ALD9.5    \v'9.5p'
1079 .ds ALD9.75   \v'9.75p'
1080 .ds ALD10     \v'10p'
1081 .ds ALD10.25  \v'10.25p'
1082 .ds ALD10.5   \v'10.5p'
1083 .ds ALD10.75  \v'10.75p'
1084 .ds ALD11     \v'11p'
1085 .ds ALD11.25  \v'11.25p'
1086 .ds ALD11.5   \v'11.5p'
1087 .ds ALD11.75  \v'11.75p'
1088 .ds ALD12     \v'12p'
1089 .ds ALD12.25  \v'12.5p'
1090 .ds ALD12.5   \v'12.5p'
1091 .ds ALD12.75  \v'12.75p'
1092 \#
1093 .ds RLD.25    \v'-.25p'
1094 .ds RLD.5     \v'-.5p'
1095 .ds RLD.75    \v'-.75p'
1096 .ds RLD1      \v'-1p'
1097 .ds RLD1.25   \v'-1.25p'
1098 .ds RLD1.5    \v'-1.5p'
1099 .ds RLD1.75   \v'-1.75p'
1100 .ds RLD2      \v'-2p'
1101 .ds RLD2.25   \v'-2.25p'
1102 .ds RLD2.5    \v'-2.5p'
1103 .ds RLD2.75   \v'-2.75p'
1104 .ds RLD3      \v'-3p'
1105 .ds RLD3.25   \v'-3.25p'
1106 .ds RLD3.5    \v'-3.5p'
1107 .ds RLD3.75   \v'-3.75p'
1108 .ds RLD4      \v'-4p'
1109 .ds RLD4.25   \v'-4.25p'
1110 .ds RLD4.5    \v'-4.5p'
1111 .ds RLD4.75   \v'-4.75p'
1112 .ds RLD5      \v'-5p'
1113 .ds RLD5.25   \v'-5.25p'
1114 .ds RLD5.5    \v'-5.5p'
1115 .ds RLD5.75   \v'-5.75p'
1116 .ds RLD6      \v'-6p'
1117 .ds RLD6.25   \v'-6.25p'
1118 .ds RLD6.5    \v'-6.5p'
1119 .ds RLD6.75   \v'-6.75p'
1120 .ds RLD7      \v'-7p'
1121 .ds RLD7.25   \v'-7.25p'
1122 .ds RLD7.5    \v'-7.5p'
1123 .ds RLD7.75   \v'-7.75p'
1124 .ds RLD8      \v'-8p'
1125 .ds RLD8.25   \v'-8.25p'
1126 .ds RLD8.5    \v'-8.5p'
1127 .ds RLD8.75   \v'-8.75p'
1128 .ds RLD9      \v'-9p'
1129 .ds RLD9.25   \v'-9.25p'
1130 .ds RLD9.5    \v'-9.5p'
1131 .ds RLD9.75   \v'-9.75p'
1132 .ds RLD10     \v'-10p'
1133 .ds RLD10.25  \v'-10.25p'
1134 .ds RLD10.5   \v'-10.5p'
1135 .ds RLD10.75  \v'-10.75p'
1136 .ds RLD11     \v'-11p'
1137 .ds RLD11.25  \v'-11.25p'
1138 .ds RLD11.5   \v'-11.5p'
1139 .ds RLD11.75  \v'-11.75p'
1140 .ds RLD12     \v'-12p'
1141 .ds RLD12.25  \v'-12.5p'
1142 .ds RLD12.5   \v'-12.5p'
1143 .ds RLD12.75  \v'-12.75p'
1144 \#
1145 \# =====================================================================
1146 \#
1147 \# +++REFINEMENTS+++
1148 \#
1149 \# AUTOMATIC LIGATURES
1150 \# -------------------
1151 \# *Arguments:
1152 \#   <none> | <anything>
1153 \# *Function:
1154 \#   Turns automatic ligature generation on or off.
1155 \# *Notes:
1156 \#   Ligatures may be supplied manually with \(fi, \(fl, etc.
1157 \#
1158 .MAC LIGATURES END
1159 .    ie '\\$1'' \{\
1160 .       lg
1161 .       nr #LIGATURES 1
1162 .    \}
1163 .    el \{\
1164 .       lg 0
1165 .       nr #LIGATURES 0
1166 .    \}
1167 .END
1168 \#
1169 \#
1170 \# SMARTQUOTES
1171 \# -----------
1172 \# *Arguments:
1173 \#   [ ,, ] | [ << ] | [ >> ] | <anything>
1174 \#   or
1175 \#   [ DA | DE | ES | FR | IT | NL | NO | PT | SV ] | <anything>
1176 \# *Function:
1177 \#   Turns smartquotes on (optionally with a quoting style from the
1178 \#   argument list, or off).
1179 \# *Notes:
1180 \#   The " character is read outside the macro when mom is
1181 \#   processed.  The strings for open/close ($QUOTE<n>) are then
1182 \#   defined in the macro.
1183 \#
1184 \#   (Note to myself: code for " is \N'34'.)
1185 \#
1186 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1187 \#
1188 .MAC SMARTQUOTES END
1189 .    rr #ARGS_TO_SQ
1190 .    ie '\\$1'' \{\
1191 .       nr #OPEN_CLOSE 0
1192 .       ds $QUOTE0 \\[lq]
1193 .       ds $QUOTE1 \\[rq]
1194 .    \}
1195 .    el \{\
1196 .       if '\\$1',,' \{\
1197 .          nr #ARGS_TO_SQ 1
1198 .          ds $QUOTE0 \\[Bq]
1199 .          ds $QUOTE1 \\[lq]
1200 .       \}
1201 .       if '\\$1'<<' \{\
1202 .          nr #ARGS_TO_SQ 1
1203 .          ds $QUOTE0 \\[Fo]
1204 .          ds $QUOTE1 \\[Fc]
1205 .       \}
1206 .       if '\\$1'>>' \{\
1207 .          nr #ARGS_TO_SQ 1
1208 .          ds $QUOTE0 \\[Fc]
1209 .          ds $QUOTE1 \\[Fo]
1210 .       \}
1211 .       if '\\$1'DA' \{\
1212 .          nr #ARGS_TO_SQ 1
1213 .          ds $QUOTE0 \\[Fc]
1214 .          ds $QUOTE1 \\[Fo]
1215 .       \}
1216 .       if '\\$1'DE' \{\
1217 .          nr #ARGS_TO_SQ 1
1218 .          ds $QUOTE0 \\[Bq]
1219 .          ds $QUOTE1 \\[lq]
1220 .       \}
1221 .       if '\\$1'ES' \{\
1222 .          nr #ARGS_TO_SQ 1
1223 .          ds $QUOTE0 \\[lq]
1224 .          ds $QUOTE1 \\[rq]
1225 .       \}
1226 .       if '\\$1'FR' \{\
1227 .          nr #ARGS_TO_SQ 1
1228 .          ds $QUOTE0 \\[Fo]\\|
1229 .          ds $QUOTE1 \\|\\[Fc]
1230 .       \}
1231 .       if '\\$1'IT' \{\
1232 .          nr #ARGS_TO_SQ 1
1233 .          ds $QUOTE0 \\[Fo]\\|
1234 .          ds $QUOTE1 \\|\\[Fc]
1235 .       \}
1236 .       if '\\$1'NL' \{\
1237 .          nr #ARGS_TO_SQ 1
1238 .          ds $QUOTE0 \\[rq]
1239 .          ds $QUOTE1 \\[rq]
1240 .       \}
1241 .       if '\\$1'NO' \{\
1242 .          nr #ARGS_TO_SQ 1
1243 .          ds $QUOTE0 \\[Fo]
1244 .          ds $QUOTE1 \\[Fc]
1245 .       \}
1246 .       if '\\$1'PT' \{\
1247 .          nr #ARGS_TO_SQ 1
1248 .          ds $QUOTE0 \\[Fo]
1249 .          ds $QUOTE1 \\[Fc]
1250 .       \}
1251 .       if '\\$1'SV' \{\
1252 .          nr #ARGS_TO_SQ 1
1253 .          ds $QUOTE0 \\[Fc]
1254 .          ds $QUOTE1 \\[Fc]
1255 .       \}
1256 .       if !r#ARGS_TO_SQ \{\
1257 .          ds $QUOTE0 \\[dq]
1258 .          ds $QUOTE1 \\[dq]
1259 .       \}
1260 .    \}
1261 .END
1262 \#
1263 .ds $QUOTE0 \[dq]
1264 .ds $QUOTE1 \[dq]
1265 \#
1266 \# Strings for foot and inch marks
1267 \#
1268 .ds FOOT \(fm
1269 .ds INCH \(fm\(fm
1270 \#
1271 \# =====================================================================
1272 \#
1273 \# +++LINE BREAKS+++
1274 \#
1275 \# NO-SPACE BREAK
1276 \# --------------
1277 \# *Argument:
1278 \#   <none>
1279 \# *Function:
1280 \#   Breaks a line without advancing.
1281 \# *Notes:
1282 \#   EL is the mnemonic used on older, dedicated typesetting machines
1283 \#   to indicate "process the line, without advancing the galley
1284 \#   medium."  It stands for End Line.
1285 \#
1286 \#   The \c inline must be appended to the end of input lines when in
1287 \#   nofill mode; in fill modes, the \c inline must not be used.
1288 \#
1289 .MAC EL END
1290 .    TRAP OFF
1291 .    if \\n[#PSEUDO_FILL]=1 \&
1292 .    br
1293 .    sp -1v
1294 .    TRAP
1295 .END
1296 \#
1297 \# An inline escape to accomplish the same thing.  Actually
1298 \# preferable, since it works with filled and non-filled copy and
1299 \# doesn't require the user to remember to use (or not use) the \c.
1300 \#
1301 .ds B \h'|0'\c
1302 \#
1303 \# =====================================================================
1304 \#
1305 \# +++FILLING/QUADDING/JUSTIFYING+++
1306 \#
1307 \# JUSTIFY
1308 \# -------
1309 \# *Argument:
1310 \#   <none>
1311 \# *Function:
1312 \#   Turns fill on and sets .ad to b.
1313 \# *Notes:
1314 \#   Justifies text left and right.
1315 \#
1316 .MAC JUSTIFY END
1317 .    if \\n[#TAB_ACTIVE]=0 \{\
1318 .       nr #QUAD 1
1319 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1320 .    \}
1321 '    ce 0
1322 .    QUAD J
1323 .    if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1324 .    nr #PSEUDO_FILL 0
1325 .END
1326 \#
1327 \#
1328 \# QUAD
1329 \# ----
1330 \# *Arguments:
1331 \#   L | LEFT | R | RIGHT | C | CENTER/CENTRE
1332 \# *Function:
1333 \#   Turns fill on and sets .ad to l, r, or c.
1334 \# *Notes:
1335 \#   Terminology is a problem here.  Some people call quad left
1336 \#   left justified, flush left, or flush left/rag right (and the
1337 \#   reverse for quad right).  Quad center is sometimes called rag
1338 \#   both.  For our purposes, all "quad" modes mean that groff fill
1339 \#   mode is enabled.
1340 \#
1341 .MAC QUAD END
1342 .    ds $QUAD_VALUE \\$1
1343 .    if \\n[#TAB_ACTIVE]=0 \{\
1344 .       nr #QUAD 1
1345 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1346 .    \}
1347 '    ce 0
1348 '    fi
1349 .    if '\\*[$QUAD_VALUE]'L'       \{\
1350 .       nr #JUSTIFY 0
1351 .       ad l
1352 .    \}
1353 .    if '\\*[$QUAD_VALUE]'LEFT'    \{\
1354 .       nr #JUSTIFY 0
1355 .       ad l
1356 .    \}
1357 .    if '\\*[$QUAD_VALUE]'R'       \{\
1358 .       nr #JUSTIFY 0
1359 .       ad r
1360 .    \}
1361 .    if '\\*[$QUAD_VALUE]'RIGHT'   \{\
1362 .       nr #JUSTIFY 0
1363 .       ad r
1364 .    \}
1365 .    if '\\*[$QUAD_VALUE]'C'       \{\
1366 .       nr #JUSTIFY 0
1367 .       ad c
1368 .    \}
1369 .    if '\\*[$QUAD_VALUE]'CENTER'  \{\
1370 .       nr #JUSTIFY 0
1371 .       ad c
1372 .    \}
1373 .    if '\\*[$QUAD_VALUE]'CENTRE'  \{\
1374 .       nr #JUSTIFY 0
1375 .       ad c
1376 .    \}
1377 .    if '\\*[$QUAD_VALUE]'J'       \{\
1378 .       nr #JUSTIFY 1
1379 .       ad b
1380 .    \}
1381 .    if '\\*[$QUAD_VALUE]'JUSTIFY' \{\
1382 .       nr #JUSTIFY 1
1383 .       ad b
1384 .    \}
1385 .    nr #PSEUDO_FILL 0
1386 .END
1387 \#
1388 \#
1389 \# LEFT, RIGHT, AND CENTER
1390 \# -----------------------
1391 \#
1392 .ig
1393 The purpose of these macros is to allow the user to enter lines of
1394 text that will be quadded LRC *without* the user having to enter .BR
1395 or .br between lines.  For the sake of consistency, all three appear
1396 to behave similarly (from the point of view of the user), although
1397 the underlying primitives don't.  For this reason, LEFT, RIGHT, and
1398 CENTER must be followed by .QUAD [L R C J] or .JUSTIFY to restore
1399 text to groff fill mode.
1400 ..
1401 \#
1402 \# LEFT
1403 \# ----
1404 \# *Argument:
1405 \#   <none>
1406 \# *Function:
1407 \#   Turns fill mode off.  Allows user to quad lines left without
1408 \#   requiring the .BR or .br macro.
1409 \# *Notes:
1410 \#   LEFT simply turns fill off.  Lines that exceed the current LL will
1411 \#   not be broken, just continued (indefinitely) until a return is
1412 \#   encountered.  Note that this behaviour differs from the RIGHT and
1413 \#   CENTER macros.
1414 \#
1415 .MAC LEFT END
1416 .    if \\n[#TAB_ACTIVE]=0 \{\
1417 .       rr #QUAD
1418 .       ds $RESTORE_QUAD_VALUE LEFT
1419 .    \}
1420 .    ce 0
1421 .    nf
1422 .    nr #PSEUDO_FILL 1
1423 .\" Fix for a little conflict with DOCTYPE LETTER 
1424 .    if '\\n(.z'LETTERHEAD1' \{ .rr #DATE_FIRST \}
1425 .END
1426 \#
1427 \#
1428 \# RIGHT
1429 \# -----
1430 \# *Argument:
1431 \#   <none>
1432 \# *Function:
1433 \#   Turns fill on.  Allows user to quad lines right without
1434 \#   requiring the .BR or .br macro.
1435 \# *Notes:
1436 \#   Lines that exceed the current LL will be broken, with the excess
1437 \#   text quadded right.
1438 \#
1439 .MAC RIGHT END
1440 .    if \\n[#TAB_ACTIVE]=0 \{\
1441 .       rr #QUAD
1442 .       ds $RESTORE_QUAD_VALUE RIGHT
1443 .    \}
1444 .    fi
1445 .    rj 100000
1446 .    nr #PSEUDO_FILL 1
1447 .END
1448 \#
1449 \#
1450 \# CENTER
1451 \# ------
1452 \# *Argument:
1453 \#   <none>
1454 \# *Function:
1455 \#   Turns fill on.  Allows user to center lines without
1456 \#   requiring the .BR or .br macro.
1457 \# *Notes:
1458 \#   Lines that exceed the current LL will be broken, with the excess
1459 \#   text centered.
1460 \#
1461 .MAC CENTER END
1462 .    if \\n[#TAB_ACTIVE]=0 \{\
1463 .       rr #QUAD
1464 .       ds $RESTORE_QUAD_VALUE CENTER
1465 .    \}
1466 .    fi
1467 .    ce 100000
1468 .    nr #PSEUDO_FILL 1
1469 .END
1470 \#
1471 \# =====================================================================
1472 \#
1473 \# +++TABS+++
1474 \#
1475 .ig
1476 There are two different kinds of tabs available: typesetting tabs
1477 and string tabs.
1478
1479 Typesetting tabs are set with TAB_SET, which requires a tab number,
1480 an indent (offset) from the left margin and a length (optionally
1481 with a quad direction and an instruction to fill lines).  After tabs
1482 are set with TAB_SET, they are called with .TAB n, where "n"
1483 corresponds to the number passed to TAB_SET as a valid tab number.
1484
1485 String tabs allow the user to mark off tab positions inline.  Tab
1486 indents and lengths are calculated from the beginning and end
1487 positions of the marks.  Up to 19 string tabs may be created,
1488 numbered 1-19.  Once created, they are called with .TAB n,
1489 just like typesetting tabs.
1490
1491 Setting up string tabs is a two-step procedure.  First, the user
1492 enters an input line in which s/he wants to mark off string tabs.
1493 The beginning of a tab is marked with \*[STn], where "n" is
1494 the desired number of the tab.  The end of the the tab is marked
1495 with \*[STnX].  All ST's must have a matching STX.  String tabs
1496 may be nested.
1497
1498 Next, the user invokes .ST n for every string tab defined, and
1499 optionally passes quad information to it.  That done, string tabs
1500 can be called just like typesetting tabs.
1501
1502 String tabs don't preview properly with gxditview.  Use gv instead.
1503 ..
1504 \#
1505 \# Strings for string tab inlines
1506 \# ------------------------------
1507 \#
1508 \# Initialize string tab markers numbered 1 to 19.
1509 \#
1510 .nr #LOOP 0 1
1511 .while \n+[#LOOP]<20 \{\
1512 .   ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET]
1513 .\}
1514 \#
1515 .nr #LOOP 0 1
1516 .while \n+[#LOOP]<20 \{\
1517 .   ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK]
1518 .\}
1519 .rr #LOOP
1520 \#
1521 \#
1522 \# These are reserved ST numbers for internal use
1523 .ds ST100  \Ek[#ST100_OFFSET]
1524 .ds ST100X \Ek[#ST100_MARK]
1525 .ds ST101  \Ek[#ST101_OFFSET]
1526 .ds ST101X \Ek[#ST101_MARK]
1527 \#
1528 \#
1529 \# QUAD AND SET STRING TABS
1530 \# ------------------------
1531 \# *Arguments:
1532 \#   <stringtab number>  L | R | C | J  [QUAD]
1533 \# *Function:
1534 \#   Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1535 \#   tab based on the collected information.
1536 \# *Notes:
1537 \#   Like TAB_SET, ST invoked without a quad direction will default to LEFT.
1538 \#   If lines should be filled and quadded, use the optional argument QUAD.
1539 \#   N.B. -- indents *must* be turned off before setting string tabs
1540 \#   inside .PAD
1541 \#
1542 .MAC ST END
1543 .    ds $ST\\$1_QUAD_DIR \\$2
1544 .    if \\n[#NUM_ARGS]=3 \{\
1545 .       ds $ST\\$1_FILL QUAD
1546 .    \}
1547 .    nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1548 .    ie \\n[#IN_TAB] \{\
1549 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1550 .    \}
1551 .    el \{\
1552 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1553 .    \}
1554 .END
1555 \#
1556 \#
1557 \# TAB SET
1558 \# -------
1559 \# *Arguments:
1560 \#   <n>  ident(ipPcm)  length(ipPcm)  [L | R | C | J [QUAD]]
1561 \# *Function:
1562 \#   Creates macros TABn and TAB n, where "n" is any arbitrary number.
1563 \#   TABn is a typesetting tab (i.e. a tab defined as an indent
1564 \#   from the page left offset plus a line length.)
1565 \# *Notes:
1566 \#   n      = arbitrary digit to identify the tab
1567 \#   indent = indent from left margin; unit of measure required
1568 \#   length = length of tab (unit of measure required; can be
1569 \#            \w'<string>'u--if more than one word in string, surround
1570 \#            with double quotes "\w'<three word string>'"
1571 \#   LRCJ   = quad for tab (left, right, center, justified)
1572 \#            If option QUAD afterwards is not given, quad is line for line
1573 \#            (no fill mode), meaning that there's no need for .BR or .br
1574 \#            between lines.
1575 \#   QUAD   = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1576 \#            had been given).
1577 \#
1578 \#   N.B. -- indents *must* be turned off before setting tabs
1579 \#
1580 .ig
1581 Examples:
1582 --------
1583
1584 .TAB_SET 1 2P+6p 12P C
1585
1586 means "create a tab numbered 1 that starts 2 picas and 6 points from
1587 the left margin, is 12 picas long, and centre each input line."
1588
1589 .TAB_SET 1 2P+6P 12P C QUAD
1590
1591 means exactly the same thing, except that input lines are joined and
1592 the area delimted by the tab filled with centered text.
1593
1594 TAB n can be called at any time after being set.
1595
1596 Tabs are NOT columnar in behaviour.  If the text inside a
1597 tab runs to several lines, when you call the next tab a break
1598 occurs, meaning that the new tab starts one line below the last
1599 line in the previous tab.  For columnar behaviour, you must
1600 use the multi-column macros in addition to tabs.
1601
1602 If you want tabs to line up bottom-line to bottom-line (most likely
1603 single line tabs), use .TN (provided the tabs are numbered sequentially).
1604 Otherwise, you must use .EL then .TAB <n> if you want them to align.
1605
1606 If you want to reset tabs, you must use .TQ before .TAB_SET.
1607
1608 Note that indents are turned off automatically whenever a new
1609 tab is called with TAB <n>.
1610
1611 Tabs themselves are user-invoked using the TAB macro with a numeric
1612 argument, e.g. TAB 1.
1613
1614 Generally, in order not to get confused, it's a good idea
1615 to make sure all indents are off before setting tabs.
1616 ..
1617 \#
1618 .MAC TAB_SET END
1619 .    br
1620 .    nr #TAB_NUMBER \\$1
1621 .    ds $CURRENT_TAB \\n[#TAB_NUMBER]
1622 .    nr #TAB_OFFSET (\\$2)
1623 .    nr #TAB_LENGTH (\\$3)
1624 .    MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1625 .        if !\\\\n[#TB+]=1 \{ .br \}
1626 .        if \\\\n[#TB+]=1 \{\
1627 .           EL
1628 .           vpt 0
1629 .           rr #TB+
1630 .        \}
1631 .        in 0
1632 .        nr #TAB_ACTIVE 1
1633 .        nr #CURRENT_TAB \\n[#TAB_NUMBER]
1634 .        ds $CURRENT_TAB \\*[$CURRENT_TAB]
1635 .        nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1636 .        nr #ST_OFFSET \\n[#TAB_OFFSET]
1637 .        po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
1638 .        ll \\n[#TAB_LENGTH]u
1639 .        ta \En(.lu
1640 .        ie '\\$5'QUAD' \{\
1641 .           if '\\$4'L' \{ .QUAD L  \}
1642 .           if '\\$4'R' \{ .QUAD R  \}
1643 .           if '\\$4'C' \{ .QUAD C  \}
1644 .           if '\\$4'J' \{ .JUSTIFY \}
1645 .        \}
1646 .        el \{\
1647 .           if '\\$4''  \{ .LEFT    \}
1648 .           if '\\$4'L' \{ .LEFT    \}
1649 .           if '\\$4'R' \{ .RIGHT   \}
1650 .           if '\\$4'C' \{ .CENTER  \}
1651 .           if '\\$4'J' \{ .JUSTIFY \}
1652 .        \}
1653 .        if \\\\n[#TN]=1 \{\
1654 .           TRAP
1655 .           rr #TN
1656 .        \}
1657 .DONE
1658 .    rr #TAB_ACTIVE
1659 .END
1660 \#
1661 \#
1662 \# TAB
1663 \# ---
1664 \# *Arguments:
1665 \#   <tab number to tab into>
1666 \# *Function:
1667 \#   Moves to tab number passed as an argument.
1668 \#
1669 .MAC TAB END
1670 .    ds $TAB_NUMBER \\$1
1671 .    TAB\\*[$TAB_NUMBER]
1672 .    nr #IN_TAB 1
1673 .END
1674 \#
1675 \#
1676 \# TAB NEXT
1677 \# --------
1678 \# *Argument:
1679 \#   <none>
1680 \# *Function:
1681 \#   Automagically moves to TAB<n+1> on the same line as the last
1682 \#   line of the previous tab.
1683 \# *Notes:
1684 \#   The \c inline must be appended to the end of input lines when in
1685 \#   nofill mode; in fill modes, the \c inline must not be used.
1686 \#
1687 .MAC TN END
1688 .    nr #TN 1
1689 .    TRAP OFF
1690 .    sp -1v
1691 .    nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1692 .    TAB\\n[#NEXT_TAB]
1693 .    TRAP
1694 .END
1695 \#
1696 \# An inline escape to accomplish the same thing.  Actually
1697 \# preferable, since it works with filled and non-filled copy and
1698 \# doesn't require the user to remember to use (or not use) the \c.
1699 \#
1700 .ds TB+ "\c\\R'#TB+ 1'\\R'#TN 1'\\R'#NEXT_TAB \\n[#CURRENT_TAB]+1'\\*[TAB\\n[#NEXT_TAB]]\c
1701 \#
1702 \# TAB QUIT
1703 \# --------
1704 \# *Argument:
1705 \#   <none>
1706 \# *Function:
1707 \#   Sets #TAB_ACTIVE to "0" (off).
1708 \#   Resets left margin to value in effect prior to tabs.
1709 \#   Resets line length to value in effect prior to tabs.
1710 \#   Checks #QUAD to see if we were in flush or quad mode
1711 \#   prior to tabs (0=off, 1=on).
1712 \#   Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1713 \#   in effect prior to tabs.
1714 \# *Notes:
1715 \#   TQ *must* come before setting any new tabs if you want the
1716 \#   tabs' indents measured from page left.  Otherwise, the tabs'
1717 \#   indents are measured from the left margin of the tab you're
1718 \#   currently in.
1719 \#
1720 .MAC TQ END
1721 .    br
1722 .    rr #TAB_ACTIVE
1723 .    rr #IN_TAB
1724 .    po \\n[#L_MARGIN]u
1725 .    ll \\n[#L_LENGTH]u
1726 .    ta \\n(.lu
1727 .    ie \\n[#QUAD] \{\
1728 .       ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1729 .       el                              \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1730 .    \}
1731 .    el \{\
1732 .       if '\\*[$RESTORE_QUAD_VALUE]'LEFT'   \{ .LEFT \}
1733 .       if '\\*[$RESTORE_QUAD_VALUE]'RIGHT'  \{ .RIGHT \}
1734 .       if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1735 .    \}
1736 .END
1737 \#
1738 \# ====================================================================
1739 \#
1740 \# COLOR HANDLING
1741 \# ==============
1742 \#
1743 \# COLOR
1744 \# -----
1745 \# *Arguments:
1746 \#   <pre-defined NEWCOLOR or XCOLOR>
1747 \# *Function:
1748 \#   Allows the inline escape for setting color to be called
1749 \#   as a macro.
1750 \#
1751 .MAC COLOR END
1752 .ie \\n(.u=1 \{\
1753 \c
1754 \\*[\\$1]\c
1755 .\}
1756 .el \{ \\*[\\$1] \}
1757 .END
1758 \#
1759 \#
1760 \# NEWCOLOR
1761 \# --------
1762 \# *Arguments:
1763 \#   <color name> [<color scheme>] <color definition>
1764 \# *Function:
1765 \#   Based on .defcolor, allows users to name and define colors using
1766 \#   one of the four color schemes rgb, cmy, cmyk and grey.  The new
1767 \#   color is then defined as a string so that it can be called inline
1768 \#   with \*[COLORNAME] or with .COLOR.
1769 \# *Notes:
1770 \#   With only two args, the default color scheme is rgb.
1771 \#
1772 \#   It is highly recommended that users define new colors as
1773 \#   all-cap strings, to differentiate them from x colors, which must
1774 \#   be in lower case.
1775 \#
1776 .MAC NEWCOLOR END
1777 .    if \\n[#NUM_ARGS]=2 \{\
1778 .       defcolor \\$1 rgb \\$2
1779 .    \}
1780 .    if \\n[#NUM_ARGS]=3 \{\
1781 .       if '\\$2'RGB'  .ds $COLOR_SCHEME rgb
1782 .       if '\\$2'CYM'  .ds $COLOR_SCHEME cym
1783 .       if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk
1784 .       if '\\$2'GRAY' .ds $COLOR_SCHEME gray
1785 .       if '\\$2'GREY' .ds $COLOR_SCHEME gray
1786 .       defcolor \\$1  \\*[$COLOR_SCHEME] \\$3
1787 .    \}
1788 .    ds \\$1 \\m[\\$1]
1789 .END
1790 \#
1791 \#
1792 \# XCOLOR
1793 \# ------
1794 \# *Arguments:
1795 \#   <x color name> [<alias>]
1796 \# *Function:
1797 \#   Defines a string of x color name (i.e. a predefined x
1798 \#   color).  If <alias> is given, creates a string of <alias name>
1799 \#   that references the x color name of the first argument.
1800 \# *Notes:
1801 \#   The color name must be a legal color name from rgb.txt, and
1802 \#   must be given entirely in lower case, all one word.
1803 \#
1804 .MAC XCOLOR END
1805 .    ds \\$1 \m[\\$1]
1806 .    if \\n[#NUM_ARGS]=2 .ds \\$2 \m[\\$1]
1807 .END
1808 \#
1809 \# Pre-define xcolors black and white
1810 \#
1811 .ds black \m[black]
1812 .ds BLACK \m[black]
1813 .ds white \m[white]
1814 .ds WHITE \m[WHITE]
1815 \#
1816 \# =====================================================================
1817 \#
1818 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1819 \#
1820 \# UNDERLINE
1821 \# ---------
1822 \# *Arguments:
1823 \#   <none> | <anything>
1824 \# *Function:
1825 \#   When on, underlines all letters, words, and digits in a passage,
1826 \#   ignoring punctuation and spaces.
1827 \# *Notes:
1828 \#   Only for use when the font family is COURIER, to simulate
1829 \#   typewriter-style underlining of italic  passages.
1830 \#
1831 .MAC UNDERLINE END
1832 .    ie '\\$1'' \{\
1833 .       nr #UNDERLINE_ON 1
1834 .       char A _\bA
1835 .       char B _\bB
1836 .       char C _\bC
1837 .       char D _\bD
1838 .       char E _\bE
1839 .       char F _\bF
1840 .       char G _\bG
1841 .       char H _\bH
1842 .       char I _\bI
1843 .       char J _\bJ
1844 .       char K _\bK
1845 .       char L _\bL
1846 .       char M _\bM
1847 .       char N _\bN
1848 .       char O _\bO
1849 .       char P _\bP
1850 .       char Q _\bQ
1851 .       char R _\bR
1852 .       char S _\bS
1853 .       char T _\bT
1854 .       char U _\bU
1855 .       char V _\bV
1856 .       char W _\bW
1857 .       char X _\bX
1858 .       char Y _\bY
1859 .       char Z _\bZ
1860 .       char \[`A] _\b\[`A]
1861 .       char \[^A] _\b\[^A]
1862 .       char \['A] _\b\['A]
1863 .       char \[:A] _\b\[:A]
1864 .       char \[oA] _\b\[oA]
1865 .       char \[~A] _\b\[~A]
1866 .       char \[AE] _\b\[AE]
1867 .       char \[`E] _\b\[`E]
1868 .       char \[^E] _\b\[^E]
1869 .       char \['E] _\b\['E]
1870 .       char \[:E] _\b\[:E]
1871 .       char \[`I] _\b\[`I]
1872 .       char \[^I] _\b\[^I]
1873 .       char \['I] _\b\['I]
1874 .       char \[:I] _\b\[:I]
1875 .       char \[`O] _\b\[`O]
1876 .       char \[^O] _\b\[^O]
1877 .       char \['O] _\b\['O]
1878 .       char \[:O] _\b\[:O]
1879 .       char \[~O] _\b\[~O]
1880 .       char \[/O] _\b\[/O]
1881 .       char \[`U] _\b\[`U]
1882 .       char \[^U] _\b\[^U]
1883 .       char \['U] _\b\['U]
1884 .       char \[:U] _\b\[:U]
1885 .       char \[,C] _\b\[,C]
1886 .       char \[-D] _\b\[-D]
1887 .       char \[~N] _\b\[~N]
1888 .       char \[TP] _\b\[TP]
1889 .       char \['Y] _\b\['Y]
1890 .       char \[:Y] _\b\[:Y]
1891 .       char a _\ba
1892 .       char b _\bb
1893 .       char c _\bc
1894 .       char d _\bd
1895 .       char e _\be
1896 .       char f _\bf
1897 .       char g _\bg
1898 .       char h _\bh
1899 .       char i _\bi
1900 .       char j _\bj
1901 .       char k _\bk
1902 .       char l _\bl
1903 .       char m _\bm
1904 .       char n _\bn
1905 .       char o _\bo
1906 .       char p _\bp
1907 .       char q _\bq
1908 .       char r _\br
1909 .       char s _\bs
1910 .       char t _\bt
1911 .       char u _\bu
1912 .       char v _\bv
1913 .       char w _\bw
1914 .       char x _\bx
1915 .       char y _\by
1916 .       char z _\bz
1917 .       char \[`a] _\b\[`a]
1918 .       char \[^a] _\b\[^a]
1919 .       char \['a] _\b\['a]
1920 .       char \[:a] _\b\[:a]
1921 .       char \[oa] _\b\[oa]
1922 .       char \[~a] _\b\[~a]
1923 .       char \[ae] _\b\[ae]
1924 .       char \[`e] _\b\[`e]
1925 .       char \[^e] _\b\[^e]
1926 .       char \['e] _\b\['e]
1927 .       char \[:e] _\b\[:e]
1928 .       char \[`i] _\b\[`i]
1929 .       char \[^i] _\b\[^i]
1930 .       char \['i] _\b\['i]
1931 .       char \[:i] _\b\[:i]
1932 .       char \[`o] _\b\[`o]
1933 .       char \[^o] _\b\[^o]
1934 .       char \['o] _\b\['o]
1935 .       char \[:o] _\b\[:o]
1936 .       char \[~o] _\b\[~o]
1937 .       char \[/o] _\b\[/o]
1938 .       char \[`u] _\b\[`u]
1939 .       char \[^u] _\b\[^u]
1940 .       char \['u] _\b\['u]
1941 .       char \[:u] _\b\[:u]
1942 .       char \[,c] _\b\[,c]
1943 .       char \[Sd] _\b\[Sd]
1944 .       char \[~n] _\b\[~n]
1945 .       char \[Tp] _\b\[Tp]
1946 .       char \['y] _\b\['y]
1947 .       char \[:y] _\b\[:y]
1948 .       char \[ss] _\b\[ss]
1949 .       char ' _\b'
1950 .       char 1 _\b1
1951 .       char 2 _\b2
1952 .       char 3 _\b3
1953 .       char 4 _\b4
1954 .       char 5 _\b5
1955 .       char 6 _\b6
1956 .       char 7 _\b7
1957 .       char 8 _\b8
1958 .       char 9 _\b9
1959 .       char 0 _\b0
1960 .    \}
1961 .    el \{\
1962 .       nr #UNDERLINE_ON 0
1963 .       rchar A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
1964         a b c d e f g h i j k l m n o p q r s t u v w x y z \
1965         \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1966         \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1967         \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1968         \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1969         \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1970         \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1971         ' 1 2 3 4 5 6 7 8 9 0
1972 .    \}
1973 .END
1974 \#
1975 \#
1976 \# UL/ULX
1977 \# ------
1978 \# *Arguments:
1979 \#   <none>
1980 \# *Function:
1981 \#   Underscores all letters, words, and digits in a passage,
1982 \#   ignoring punctuation and spaces.
1983 \# *Notes:
1984 \#   Intended to be called with inline escapes \*[UL] (underline
1985 \#   on) and \*[ULX] (underline off).  Only works when the font family
1986 \#   is COURIER, to simulate typewriter-style underlining of italic
1987 \#   passages.
1988 \#
1989 .MAC UL END
1990 \c\R'#UNDERLINE_ON 1'
1991 .       char A _\bA
1992 .       char B _\bB
1993 .       char C _\bC
1994 .       char D _\bD
1995 .       char E _\bE
1996 .       char F _\bF
1997 .       char G _\bG
1998 .       char H _\bH
1999 .       char I _\bI
2000 .       char J _\bJ
2001 .       char K _\bK
2002 .       char L _\bL
2003 .       char M _\bM
2004 .       char N _\bN
2005 .       char O _\bO
2006 .       char P _\bP
2007 .       char Q _\bQ
2008 .       char R _\bR
2009 .       char S _\bS
2010 .       char T _\bT
2011 .       char U _\bU
2012 .       char V _\bV
2013 .       char W _\bW
2014 .       char X _\bX
2015 .       char Y _\bY
2016 .       char Z _\bZ
2017 .       char \[`A] _\b\[`A]
2018 .       char \[^A] _\b\[^A]
2019 .       char \['A] _\b\['A]
2020 .       char \[:A] _\b\[:A]
2021 .       char \[oA] _\b\[oA]
2022 .       char \[~A] _\b\[~A]
2023 .       char \[AE] _\b\[AE]
2024 .       char \[`E] _\b\[`E]
2025 .       char \[^E] _\b\[^E]
2026 .       char \['E] _\b\['E]
2027 .       char \[:E] _\b\[:E]
2028 .       char \[`I] _\b\[`I]
2029 .       char \[^I] _\b\[^I]
2030 .       char \['I] _\b\['I]
2031 .       char \[:I] _\b\[:I]
2032 .       char \[`O] _\b\[`O]
2033 .       char \[^O] _\b\[^O]
2034 .       char \['O] _\b\['O]
2035 .       char \[:O] _\b\[:O]
2036 .       char \[~O] _\b\[~O]
2037 .       char \[/O] _\b\[/O]
2038 .       char \[`U] _\b\[`U]
2039 .       char \[^U] _\b\[^U]
2040 .       char \['U] _\b\['U]
2041 .       char \[:U] _\b\[:U]
2042 .       char \[,C] _\b\[,C]
2043 .       char \[-D] _\b\[-D]
2044 .       char \[~N] _\b\[~N]
2045 .       char \[TP] _\b\[TP]
2046 .       char \['Y] _\b\['Y]
2047 .       char \[:Y] _\b\[:Y]
2048 .       char a _\ba
2049 .       char b _\bb
2050 .       char c _\bc
2051 .       char d _\bd
2052 .       char e _\be
2053 .       char f _\bf
2054 .       char g _\bg
2055 .       char h _\bh
2056 .       char i _\bi
2057 .       char j _\bj
2058 .       char k _\bk
2059 .       char l _\bl
2060 .       char m _\bm
2061 .       char n _\bn
2062 .       char o _\bo
2063 .       char p _\bp
2064 .       char q _\bq
2065 .       char r _\br
2066 .       char s _\bs
2067 .       char t _\bt
2068 .       char u _\bu
2069 .       char v _\bv
2070 .       char w _\bw
2071 .       char x _\bx
2072 .       char y _\by
2073 .       char z _\bz
2074 .       char \[`a] _\b\[`a]
2075 .       char \[^a] _\b\[^a]
2076 .       char \['a] _\b\['a]
2077 .       char \[:a] _\b\[:a]
2078 .       char \[oa] _\b\[oa]
2079 .       char \[~a] _\b\[~a]
2080 .       char \[ae] _\b\[ae]
2081 .       char \[`e] _\b\[`e]
2082 .       char \[^e] _\b\[^e]
2083 .       char \['e] _\b\['e]
2084 .       char \[:e] _\b\[:e]
2085 .       char \[`i] _\b\[`i]
2086 .       char \[^i] _\b\[^i]
2087 .       char \['i] _\b\['i]
2088 .       char \[:i] _\b\[:i]
2089 .       char \[`o] _\b\[`o]
2090 .       char \[^o] _\b\[^o]
2091 .       char \['o] _\b\['o]
2092 .       char \[:o] _\b\[:o]
2093 .       char \[~o] _\b\[~o]
2094 .       char \[/o] _\b\[/o]
2095 .       char \[`u] _\b\[`u]
2096 .       char \[^u] _\b\[^u]
2097 .       char \['u] _\b\['u]
2098 .       char \[:u] _\b\[:u]
2099 .       char \[,c] _\b\[,c]
2100 .       char \[Sd] _\b\[Sd]
2101 .       char \[~n] _\b\[~n]
2102 .       char \[Tp] _\b\[Tp]
2103 .       char \['y] _\b\['y]
2104 .       char \[:y] _\b\[:y]
2105 .       char \[ss] _\b\[ss]
2106 .       char ' _\b'
2107 .       char 1 _\b1
2108 .       char 2 _\b2
2109 .       char 3 _\b3
2110 .       char 4 _\b4
2111 .       char 5 _\b5
2112 .       char 6 _\b6
2113 .       char 7 _\b7
2114 .       char 8 _\b8
2115 .       char 9 _\b9
2116 .       char 0 _\b0
2117 .END
2118 \#
2119 \#
2120 .MAC ULX END
2121 \c\R'#UNDERLINE_ON 0'
2122 .    rchar A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
2123      a b c d e f g h i j k l m n o p q r s t u v w x y z \
2124      \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
2125      \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
2126      \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
2127      \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
2128      \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
2129      \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
2130      ' 1 2 3 4 5 6 7 8 9 0
2131 .END
2132 \#
2133 \#
2134 \# UNDERSCORE
2135 \# ----------
2136 \# *Arguments:
2137 \#   [points below baseline] "text"
2138 \# *Function:
2139 \#   Places an underscore 2 points under the string if no lead given,
2140 \#   otherwise places underscore under string by user specified amount.
2141 \# *Notes:
2142 \#   When using this macro, the string to be underscored must begin
2143 \#   with double-quotes ("), regardless of whether it's the sole
2144 \#   argument or the second.
2145 \#   E.g.:
2146 \#      .UNDERSCORE "Text to be underscored
2147 \#         or
2148 \#      .UNDERSCORE 2p "Text to be underscored
2149 \#
2150 \#   All text is underscored (including punctuation and spaces).
2151 \#   This is the primary difference between UNDERLINE and UNDERSCORE,
2152 \#   aside from the fact the UNDERLINE only works with Courier.
2153 \#
2154 \#   UNDERSCORE does not work across line breaks.  Each line of
2155 \#   text must be entered separately with UNDERSCORE.  If the
2156 \#   UNDERSCORE begins in the middle of a line and crosses over a
2157 \#   break, the portion before the break must be entered in its own
2158 \#   UNDERSCORE, as must the portion that comes after the break.
2159 \#
2160 .MAC UNDERSCORE END
2161 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2162 .    ie \\n[#NUM_ARGS]=1 \{ \\$1\\s(12\\v'+2p'\\l'|0'\\v'-2p'\\s[\\n[#RESTORE_PT_SIZE]u] \}
2163 .    el                  \{ \\$2\\s(12\\v'+(\\$1)'\\l'|0'\\v'-(\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u] \}
2164 .    rr #RESTORE_PT_SIZE
2165 .END
2166 \#
2167 \#
2168 \# DOUBLE UNDERSCORE
2169 \# -----------------
2170 \# *Arguments:
2171 \#   [points below baseline] [points distance between rules] "text"
2172 \# *Function:
2173 \#   Same as UNDERSCORE, except it produces a double underscore.  The default
2174 \#   distance between the rules is 2 points.
2175 \# *Notes:
2176 \#   The same double-quote requirement as UNDERSCORE.
2177 \#
2178 .MAC UNDERSCORE2 END
2179 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2180 .    if \\n[#NUM_ARGS]=1 \{\
2181 .       PRINT \\$1\\s(12\\v'+2p'\\l'|0'\\v'+2p'\\l'|0'\\v'-4p'\\s[\\n[#RESTORE_PT_SIZE]u]
2182 .    \}
2183 .    if \\n[#NUM_ARGS]=2 \{\
2184 .       PRINT \\$2\\s(12\\v'+\\$1'\\l'|0'\\v'+2p'\\l'|0'\\v'-(2p+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
2185 .    \}
2186 .    if \\n[#NUM_ARGS]=3 \{\
2187 .       PRINT \\$3\\s(12\\v'+\\$1'\\l'|0'\\v'+\\$2'\\l'|0'\\v'-(\\$2+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
2188 .    \}
2189 .    rr #RESTORE_PT_SIZE
2190 .END
2191 \#
2192 \#
2193 \# SUPERSCRIPT INLINES
2194 \# -------------------
2195 \# *Function:
2196 \#   Prints everything after invocation as superscript.
2197 \# *Notes:
2198 \#   \*[SUP] and \*[SUPX] turn superscript on and off respectively.
2199 \#   If running type is pseudo-condensed/expanded, invoke the superscript
2200 \#   strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
2201 \#   and \*[EXTSUPX] respectively.
2202 \#
2203 .ds SUP \
2204 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2205 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2206 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.26m'\s[\En[#SUP_PT_SIZE]u]
2207 \#
2208 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.26m'
2209 \#
2210 .ds CONDSUP \
2211 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2212 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2213 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
2214 \#
2215 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
2216 \#
2217 .ds EXTSUP \
2218 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2219 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2220 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
2221 \#
2222 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
2223 \#
2224 \#
2225 \# SLANT
2226 \# -----
2227 \#
2228 \# SETSLANT
2229 \# --------
2230 \# *Arguments:
2231 \#   <number of degrees> | RESET
2232 \# *Function:
2233 \#   Modifies register #DEGREES for use with \*[SLANT], or resets
2234 \#   it to the default.  Defines string \*[SLANTX]
2235 \# *Notes:
2236 \#   \*[SLANT] permits pseudo-italicizing of a font in cases where
2237 \#   no italic font exists in a particular family.
2238 \#
2239 \#   Default # of degrees is 15.
2240 \#
2241 \#   Do not use unit of measure with arg to SETSLANT.
2242 \#
2243 \#   It may be necessary to adjust the spacing on either side of
2244 \#   [SLANT] and [SLANTX].
2245 \#
2246 \#   In docs, SLANT carries over from para to para.
2247 \#
2248 .nr #DEGREES 15
2249 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2250 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2251 \#
2252 .MAC SETSLANT END
2253 .    ie '\\$1'RESET' \{\
2254 .       nr #DEGREES 15
2255 .       if \\n[#PRINT_STYLE]=1 \{\
2256 .          if \\n[#UNDERLINE_SLANT] \{ .return \}
2257 .       \}
2258 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2259 .    \}
2260 .    el \{\
2261 .       nr #DEGREES \\$1
2262 .       if \\n[#PRINT_STYLE]=1 \{\
2263 .          if \\n[#UNDERLINE_SLANT] \{ .return \}
2264 .       \}
2265 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2266 .    \}
2267 .    ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2268 .END
2269 \#
2270 \#
2271 \# BOLDER
2272 \# ------
2273 \#
2274 \# SETBOLDER
2275 \# ---------
2276 \# *Arguments:
2277 \#   <amount of emboldening> | RESET
2278 \# *Function:
2279 \#   Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
2280 \#   it to the default 700 units.
2281 \# *Notes:
2282 \#   \*[BOLDER] allows pseudo-emboldening of a font where no bold
2283 \#   font exists in a particular family.
2284 \#
2285 \#   Default for SETBOLDER is 700 units.  Do not use unit of measure
2286 \#   with arg to SETBOLDER.
2287 \#
2288 .nr #BOLDER_UNITS 700
2289 \#
2290 .MAC SETBOLDER END
2291 .    if \\n[#IGNORE]=1 \{ .return \}
2292 .    ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
2293 .    el \{ .nr #BOLDER_UNITS \\$1 \}
2294 .END
2295 \#
2296 \#
2297 .MAC BOLDER END
2298 \c
2299 .bd \\n(.f \\n[#BOLDER_UNITS]
2300 .END
2301 \#
2302 \#
2303 .MAC BOLDERX END
2304 \c
2305 .bd \\n(.f
2306 .END
2307 \#
2308 \# +++CONDENSE/EXTEND+++
2309 \#
2310 \# CONDENSE/EXTEND
2311 \# ---------------
2312 \# *Arguments:
2313 \#   <percentage to condense/expand type size>
2314 \# *Function:
2315 \#   Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
2316 \#   new point size (for character width) from arg, and defines string
2317 \#   COND or EXT, which set the type size to the new character width,
2318 \#   and sets the height of type to the value stored in CURRENT_PT_SIZE
2319 \# *Notes:
2320 \#   CONDENSE_OR_EXTEND is invoked from the aliases
2321 \#   CONDENSE and EXTEND.  CONDENSE implies <100, EXTEND
2322 \#   implies >100.  Do not use a percent sign in the argument.
2323 \#
2324 \#   There is no default setting for CONDENSE or EXTEND.
2325 \#   80 is a good approximation of condensed type, 120 is okay
2326 \#   for extended.
2327 \#
2328 \#   The value set by CONDENSE or EXTEND applies to all
2329 \#   subsequent \*[COND] or \*[EXT] escapes until a new value is set.
2330 \#
2331 \#  \*[COND] or \*[EXT] must be turned off before all changes of point
2332 \#  size and reinvoked afterwards (if so desired).  This refers to
2333 \#  changes of point size via control lines AND with via inlines.
2334 \#
2335 .MAC CONDENSE_OR_EXTEND END
2336 .    if '\\$0'CONDENSE' \{\
2337 .       ds $COND_PERCENT \\$1
2338 .       if \\n[#PRINT_STYLE]=1 \{\
2339 .          rm $COND_PERCENT
2340 .          ds $COND_PERCENT 100
2341 .       \}
2342 .       ds COND \
2343 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2344 \R'#CONDENSE 1'\
2345 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2346 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2347 .       ds COND_FOR_SUP \
2348 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2349 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2350 .    \}
2351 .    if '\\$0'EXTEND' \{\
2352 .       ds $EXT_PERCENT \\$1
2353 .       if \\n[#PRINT_STYLE]=1 \{\
2354 .          rm $EXT_PERCENT
2355 .          ds $EXT_PERCENT 100
2356 .       \}
2357 .       ds EXT \
2358 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2359 \R'#EXTEND 1'\
2360 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2361 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2362 .       ds EXT_FOR_SUP \
2363 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2364 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2365 .    \}
2366 .END
2367 \#
2368 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2369 .ds EXTX  \ER'#EXTEND   0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2370 \#
2371 \#
2372 \# +++PAD LINES+++ (insert space)
2373 \#
2374 \# PAD MARKER
2375 \# ----------
2376 \# *Arguments:
2377 \#   <character to use for marking pad points>
2378 \# *Function:
2379 \#   Defines string $PAD_MARKER, used in PAD
2380 \# *Notes:
2381 \#   $PAD_MARKER is normally # (the pound sign).
2382 \#
2383 .MAC PAD_MARKER END
2384 .    ds $PAD_MARKER \\$1
2385 .END
2386 \#
2387 \#
2388 \# PAD
2389 \# ---
2390 \# *Argments:
2391 \#   "<string of text with padding markers inserted>"
2392 \# *Function:
2393 \#   Defines and redefines padding character (default=pound sign
2394 \#   unless padding character has been set with PAD_MARKER)
2395 \#   several times so that when the string is output at the end
2396 \#   of the macro, every # has been converted to an equal-sized
2397 \#   amount of padding (blank space) on a line. # is equivalent to
2398 \#   CompuGraphic's old <IS>.
2399 \# *Notes:
2400 \#   String tabs may be marked off during PAD.
2401 \#
2402 .MAC PAD END
2403 .    if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2404 .    nf
2405 .    if !d$PAD_MARKER .ds $PAD_MARKER #
2406 .    char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2407 .    ds $FAMILY_FOR_PAD \\n[.fam]
2408 \#.    fp \\n[.fp] \\*[$FONT]
2409 .    fp \\n[.fp] \\n[.sty]
2410 .    ds $FONT_FOR_PAD   \\*[$FONT]
2411 .    nr #SIZE_FOR_PAD   \\n[.ps]
2412 .    ds $PAD_STRING \\$1
2413 .    as $PAD_STRING \Ekp
2414 .    di PAD_STRING
2415 .    fam \\*[$FAMILY_FOR_PAD]
2416 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2417 .    br
2418 .    di
2419 .    char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2420 .    di PAD_STRING
2421 .    fam \\*[$FAMILY_FOR_PAD]
2422 \\f]\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2423 .    br
2424 .    di
2425 .    char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2426 .    ie \\n[#SILENT] \{\
2427 .       SILENT
2428 .       fam \\*[$FAMILY_FOR_PAD]
2429 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2430 .       br
2431 .       SILENT OFF
2432 .    \}
2433 .    el \{\
2434 .       fam \\*[$FAMILY_FOR_PAD]
2435 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2436 .       br
2437 .    \}
2438 .    if \\n[#FILL_MODE]=1 \{\
2439 .       fi
2440 .       rr #FILL_MODE
2441 .    \}
2442 .    rr #PAD_COUNT
2443 .    rr #SPACE_TO_END
2444 .    rr #PAD_SPACE
2445 .    rm $PAD_STRING
2446 .    rm PAD_STRING
2447 .    rchar #
2448 .    if '\\$2'NOBREAK' \{\
2449 .       TRAP OFF
2450 .       EOL
2451 .       TRAP
2452 .    \}
2453 .END
2454 \#
2455 \#
2456 \# +++LEADERS+++
2457 \#
2458 .ig
2459 The leader mechanism is primitive, but it works.  Basically, every
2460 macro in this set that includes a line length also sets a single
2461 groff tab stop at the right hand end of the line.  That way,
2462 whenever Ctrl-A is invoked (always at the end of an input line),
2463 leader of the correct length gets deposited.  Ctrl-A is accessed by
2464 the string LEADER (i.e. inline, as \*[LEADER]).  Leaders within tabs
2465 get their length from the tab line length.
2466 ..
2467 \#
2468 \# SET LEADER CHARACTER
2469 \# --------------------
2470 \# *Arguments:
2471 \#   <character to use whenever \*[LEADER] is invoked>
2472 \# *Function:
2473 \#   Set leader character.
2474 \#
2475 .MAC LEADER_CHARACTER END
2476 .    lc \\$1
2477 .END
2478 \#
2479 .ds LEADER \ 1
2480 \#
2481 \# +++DROP CAPS+++
2482 \#
2483 \# DROP CAP FAMILY
2484 \# ---------------
2485 \# *Argument:
2486 \#   <family of drop cap>
2487 \# *Function:
2488 \#   Creates or modifies string $DC_FAM.
2489 \#
2490 .MAC DROPCAP_FAMILY END
2491 .    ds $DC_FAM \\$1
2492 .END
2493 \#
2494 \#
2495 \# DROP CAP FONT
2496 \# -------------
2497 \# *Argument:
2498 \#   <font of drop cap>
2499 \# *Function:
2500 \#   Creates or modifies string $DC_FT.
2501 \#
2502 .MAC DROPCAP_FONT END
2503 .    ds $DC_FT \\$1
2504 .END
2505 \#
2506 \#
2507 \# DROPCAP COLOR
2508 \# -------------
2509 \# *Arguments:
2510 \#   <pre-defined XCOLOR or NEWCOLOR>
2511 \# *Function:
2512 \#   Defines string $DC_COLOR to argument.
2513 \# *Notes:
2514 \#   User must define an XCOLOR or NEWCOLOR before using
2515 \#   DC_COLOR.
2516 \#
2517 .MAC DROPCAP_COLOR END
2518 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
2519 .    nr #DC_COLOR 1
2520 .    ds $DC_COLOR \\$1
2521 .END
2522 \#
2523 \#
2524 \# DROP CAP GUTTER
2525 \# ---------------
2526 \# *Argument:
2527 \#   <width of gutter between drop cap and indented text>
2528 \# *Function:
2529 \#   Creates or modifies register #DC_GUT.
2530 \# *Notes:
2531 \#   Requires unit of measure.  Default is 3p.
2532 \#
2533 .MAC DROPCAP_GUTTER END
2534 .    nr #DC_GUT (\\$1)
2535 .END
2536 \#
2537 \#
2538 \# DROP CAP ADJUST
2539 \# ---------------
2540 \# *Argument:
2541 \#   <+|- # of points to in/decrease point size of drop cap letter>
2542 \# *Function:
2543 \#   Creates or modifies string $DC_ADJUST.
2544 \# *Notes:
2545 \#   Despite its best efforts, DROPCAP doesn't always get the point
2546 \#   size of the drop cap critically perfect.  DROPCAP_ADJUST lets
2547 \#   the user add or subtract points (or fractions of points) to
2548 \#   get the size right.
2549 \#
2550 \#   Requires the + or - sign.
2551 \#
2552 .MAC DROPCAP_ADJUST END
2553 .    ds $DC_ADJUST \\$1
2554 .END
2555 \#
2556 \#
2557 \# DROP CAP
2558 \# --------
2559 \# *Arguments:
2560 \#   <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2561 \# *Function:
2562 \#   Calculates point size of dropcap based on # of lines passed as
2563 \#   arg 2.  Sets indent for text based on dropcap width+gutter.
2564 \#   Advances and prints dropcap; reverses and prints indented text
2565 \#   to bottom of dropcap, then resets indent to left margin (plus
2566 \#   any indent that was in effect prior to invoking DROPCAP).
2567 \# *Notes:
2568 \#   Drop caps put a strain on on resource-challenged systems.
2569 \#
2570 \#   Drop caps when using the doc processing macro PP only work with
2571 \#   initial paragraphs (i.e. at doc start, or after heads), only when
2572 \#   DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2573 \#   is TYPESET.  If these conditions aren't met, DROPCAPS is silently
2574 \#   ignored.
2575 \#
2576 \#   The COND or EXT argument are processed separately from all
2577 \#   other COND or EXT inlines or macros, hence passing COND or
2578 \#   EXT has no effect on running type.
2579 \#
2580 .MAC DROPCAP END
2581 .    if #IGNORE \{ .return \}
2582 .    br
2583 .    if \\n[#DOCS] \{\
2584 .       if \\n[#PRINT_STYLE]=1 \{ .return \}
2585 .       if \\n[#PRINT_STYLE]=2 \{\
2586 .          if \\n[#PP_STYLE]=2 \{ .return \}
2587 .          if \\n[#PP]>1 \{ .return \}
2588 .          ti 0
2589 .       \}
2590 .    \}
2591 .    ds $DROPCAP         \\$1
2592 .    nr #DC_LINES        \\$2-1
2593 .    if \\n[#CONDENSE]=1 \{\
2594 .       ds $RESTORE_COND \\*[$COND_PERCENT]
2595 \\*[CONDX]
2596 .       nr #CONDENSE_WAS_ON 1
2597 .    \}
2598 .    if \\n[#EXTEND]=1 \{\
2599 .       ds $RESTORE_EXT \\*[$EXT_PERCENT]
2600 \\*[EXTX]
2601 .       nr #EXTEND_WAS_ON 1
2602 .    \}
2603 .    if '\\$3'COND'      \{ .CONDENSE \\$4 \}
2604 .    if '\\$3'EXT'       \{ .EXTEND \\$4 \}
2605 .    if !r#DC_GUT        \{ .nr #DC_GUT (3p) \}
2606 .    ds $RESTORE_FAM     \\n[.fam]
2607 .    ds $RESTORE_FT      \\*[$FONT]
2608 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2609 .    nr #RESTORE_INDENT  \\n(.i
2610 .    SIZESPECS
2611 .    nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2612 .    ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2613 .    el \{ .FAM \\*[$DC_FAM] \}
2614 .    ie !d$DC_FT \{ .FT \\*[$FONT] \}
2615 .    el \{ .FT \\*[$DC_FT] \}
2616 .    while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2617 .       ps \\n[#PT_SIZE]u+100u
2618 .       SIZESPECS
2619 .       nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2620 .\}
2621 .    if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2622 .    mk x
2623 .    sp \\n[#DC_LINES]v
2624 .    ie \\n[#DC_COLOR]=1 \{\
2625 .       ie !'\\$3'' \{\
2626 .          ie '\\$3'COND' \{ .PRINT \m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[] \}
2627 .          el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[] \}
2628 .       \}
2629 .       el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2630 .    \}
2631 .    el \{\
2632 .       ie !'\\$3'' \{\
2633 .          ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2634 .          el \{ .PRINT \\*[EXT]\\*[$DROPCAP]\\*[EXTX] \}
2635 .       \}
2636 .       el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2637 .    \}
2638 .    if '\\$3'COND' \{ \E*[COND] \}
2639 .    if '\\$3'EXT'  \{ \E*[EXT]  \}
2640 .    ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2641 .    el        \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2642 .    if '\\$3'COND' \{ \E*[CONDX]\c \}
2643 .    if '\\$3'EXT'  \{ \E*[EXTX]\c \}
2644 .    rt \\nxu
2645 .    FAM \\*[$RESTORE_FAM]
2646 .    FT  \\*[$RESTORE_FT]
2647 .    ps \\n[#RESTORE_PT_SIZE]u
2648 .    if \\n[#CONDENSE_WAS_ON] \{\
2649 .       CONDENSE \\*[$RESTORE_COND]
2650 \\*[COND]\c
2651 .    \}
2652 .    if \\n[#EXTEND_WAS_ON] \{\
2653 .       EXTEND \\*[$RESTORE_EXT]
2654 \\*[EXT]\c
2655 .    \}
2656 .    ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2657 .    el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2658 .    rr #CONDENSE_WAS_ON
2659 .    rr #EXTEND_WAS_ON
2660 .    rm $DROPCAP
2661 .    rr #DC_LINES
2662 .    rm $RESTORE_COND
2663 .    rm $RESTORE_EXT
2664 .    rm $RESTORE_FAM
2665 .    rm $RESTORE_FT
2666 .    rr #RESTORE_PT_SIZE
2667 .    rr #RESTORE_INDENT
2668 .    rr #DC_HEIGHT
2669 .    rr #GET_DC_HEIGHT
2670 .    rr x
2671 .END
2672 \#
2673 .MAC DROPCAP_OFF END
2674 '    in \\n[#RESTORE_INDENT]u
2675 .END
2676 \#
2677 \#
2678 \# RULE
2679 \# ----
2680 \# *Argument:
2681 \#   <none>
2682 \# *Function:
2683 \#   Draws a rule the length of the current measure.
2684 \# *Notes:
2685 \#
2686 .MAC RULE END
2687 \c
2688 .    EL
2689 .    if \\n(.u=1 \{\
2690 .       nr #FILL_WAS_ON 1
2691 .       ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2692 .       nf
2693 .    \}
2694 .    ie \\n[#INDENT_ACTIVE] \{\
2695 .       nr #RESTORE_L_LENGTH \\n(.l
2696 .       if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2697 .       if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2698 .       PRINT \El'\En(.lu'\c
2699 .       ll \\n[#RESTORE_L_LENGTH]u
2700 .       rr #RESTORE_L_LENGTH
2701 .    \}
2702 .    el \{\
2703 .       PRINT \El'\En(.lu'\c
2704 .    \}
2705 .    if r#FILL_WAS_ON \{\
2706 .       fi
2707 .       rr #FILL_WAS_ON
2708 .       QUAD \\*[$CURRENT_QUAD]
2709 .       rm $CURRENT_QUAD
2710 .    \}
2711 .    EL
2712 .END
2713 \#
2714 \# =====================================================================
2715 \#
2716 \# +++WORD AND SENTENCE SPACING+++
2717 \#
2718 \# WORD SPACE CONTROL
2719 \# ------------------
2720 \# *Argument:
2721 \#   <+|->wordspace | DEFAULT
2722 \# *Function:
2723 \#   Increases or decreases interword space by user supplied amount.
2724 \#   If DEFAULT, value is set to 12 (groff default).
2725 \# *Notes:
2726 \#   $WS_CONSTANT is the groff default word space.
2727 \#   $WS_VAR is the user supplied amount by which to in/decrease word space.
2728 \#   $WS is a concatenation of WS_CONSTANT and WS_VAR.
2729 \#
2730 \#   Because the user supplied value requires a literal + or - sign,
2731 \#   the macro argument is stored in a string.
2732 \#
2733 \#   \n[.sss] holds the current sentence space value.
2734 \#
2735 .MAC WS END
2736 .    ds $WS_CONSTANT 12
2737 .    ds $WS_VAR \\$1
2738 .    ie '\\$1'DEFAULT' .ds $WS_VAR +0
2739 .    el                .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR])
2740 .    ie \\n[.sss]=12   \{ .ss \\*[$WS] 12 \}
2741 .    el \{\
2742 .       ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
2743 .       SS \\*[$SS_VAR]
2744 .    \}
2745 .END
2746 \#
2747 \#
2748 \# SENTENCE SPACE CONTROL
2749 \# ----------------------
2750 \# *Argument:
2751 \#   <+-sentencespace> | 0 | DEFAULT
2752 \# *Function:
2753 \#   Increases or decreases sentence space by user supplied amount.
2754 \#   If 0, sentence spaces are ignored.  If DEFAULT, value is
2755 \#   set to 12 (groff default).
2756 \# *Notes:
2757 \#   Because the user supplied value requires a literal + or - sign,
2758 \#   the macro argument is stored in a string.
2759 \#
2760 \#   Sentence space applies only to input where sentences are separated
2761 \#   by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
2762 \#   Changing .SS when sentences are separated by only one space has
2763 \#   no effect on the space between sentences.
2764 \#
2765 \#   \n[.ss] holds the current wordspace value.
2766 \#   \n[.sss] holds the current sentence space value.
2767 \#
2768 .MAC SS END
2769 .    ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
2770 .    el \{\
2771 .       ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
2772 .       el \{\
2773 .          ds $SS_VAR \\$1
2774 .          ss \\n[.ss] (0\\*[$SS_VAR])
2775 .       \}
2776 .    \}
2777 .END
2778 \#
2779 \#
2780 \# =====================================================================
2781 \#
2782 \# +++INDENTS+++
2783 \#
2784 .ig
2785 There are five styles of indents: left, right, both, temporary,
2786 and hanging.  Each is set/invoked with a different macro.
2787 Indent macros begin with the letter "I", hence .IL means "indent left,"
2788 .IR means "indent right," and so on.
2789
2790 The first time any of the indent macros is used, it requires an
2791 argument--the size of the indent (with a unit of measure).  The
2792 size may also be entered using the \w escape--very useful
2793 for numbered lists using HI.  The unit of measure is required.
2794 Subsequent invocations don't require the argument; the indent
2795 measure remains the same until it's changed by invoking the macro
2796 with an argument again.
2797
2798 If no indents are in effect, the arguments passed to indent macros are
2799 measured from the left and right margins of the page.  If a left indent
2800 or a right indent is already in effect, the arguments passed to
2801 the indent macros are calculated from the current values; in other words,
2802 the arguments are additive.  If you quit an indent and later return
2803 to it, its value will be the value last in effect, unless you pass
2804 it an argument.  If you do pass an argument, it is added to the last
2805 value in effect, unless you cleared the indent with one of
2806 .I<LRB>X/Q macros.
2807
2808 Example
2809 -------
2810
2811 .IL 2P
2812 ...some text...
2813 .IL 2P
2814 ...some text...
2815 .IQ
2816 ...some text...
2817 .IL
2818 ...some text...
2819
2820 The first .IL 2P indents text 2P from the left margin.  The second
2821 .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
2822 .IQ turns the indent off.  The last .IL (which has no argument)
2823 takes its value from the total of all arguments passed to .IL (in
2824 this case, 2P and 2P), therefore it indents 2P+2P from the left
2825 margin, i.e. 4P.  If you wanted the last .IL to indent just 2P,
2826 you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
2827 the last .IL the argument 2P.
2828
2829 To reverse the sense of an indent added to an indent, you may use
2830 negative values.
2831
2832 Indents can be turned off individually with ILX, IRX, and IBX.
2833 LEFT and RIGHT indents may be combined and manipulated
2834 separately, (e.g. you can have an IL of 2P and an IR of 4P
2835 operative at the same time, and then change, say, the IL to
2836 4P--thereby left indenting 6P--while the IR remains at 4P.
2837
2838 IB automatically turns off IL and IR.  They have to be reinvoked
2839 again when needed. IL and IR automatically turn IB off; it, too,
2840 has to be reinvoked with needed.
2841
2842 All indents can be turned off at once with IQ.  The ILX, IRX, IBX,
2843 and IQ macros simply turn the indents off; the values stored in
2844 the respective indent macros (IL, IR, IB) remain in effect.  If
2845 the user wishes to clear the values, the I<LRB>X macros should be
2846 invoked with the single argument CLEAR.  IQ CLEAR clears out
2847 the values stored for all indent styles.
2848
2849 Indents *must* be turned off before settting string tabs
2850 inside PAD.  Generally, in order not to get confused, it's a
2851 good idea to turn all indents off before setting any tabs.
2852
2853 TI and HI are special cases.  There's no need to turn them off,
2854 since they affect only one line--the first after their
2855 invocation.  Like the other indent styles, the first time
2856 they're invoked, they require a value in iPpcm; each subsequent
2857 invocation without an argument will use the same value.  To
2858 change the value, simply pass a new value.  Values for TI and HI
2859 are *not* additive.
2860
2861 HI presupposes that you already have a left or both indent on.
2862 HI will never hang a line outside the left margin of a document
2863 or column.  In other words, you must have IL or IB on before you
2864 can use HI.
2865 ..
2866 \#
2867 \# INDENT LEFT
2868 \# -----------
2869 \#
2870 .MAC IL END
2871 .    if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2872 .    nr #INDENT_STYLE_LEFT  1
2873 .    nr #INDENT_ACTIVE      1
2874 .    nr #INDENT_LEFT_ACTIVE 1
2875 .    ie '\\$1'' \{\
2876 .       br
2877 .       in \\n[#L_INDENT]u
2878 .       ta \\n(.lu-\\n[#L_INDENT]u
2879 .    \}
2880 .    el \{\
2881 .       br
2882 .       nr #L_INDENT +(\\$1)
2883 .       in \\n[#L_INDENT]u
2884 .       ta \\n(.lu-\\n[#L_INDENT]u
2885 .    \}
2886 .END
2887 \#
2888 \#
2889 \# +++INDENT RIGHT+++
2890 \#
2891 .MAC IR END
2892 .    if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2893 .    nr #INDENT_STYLE_RIGHT   1
2894 .    nr #INDENT_ACTIVE        1
2895 .    nr #INDENT_RIGHT_ACTIVE 1
2896 .    ie '\\$1'' \{\
2897 .       br
2898 .       ie \\n[#TAB_ACTIVE] \{\
2899 .          ll \\n(.lu-\\n[#R_INDENT]u
2900 .          ta \\n(.lu-\\n[#L_INDENT]u
2901 .       \}
2902 .       el \{\
2903 .          ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2904 .          ta \\n(.lu-\\n[#L_INDENT]u
2905 .       \}
2906 .    \}
2907 .    el \{\
2908 .       br
2909 .       nr #R_INDENT +(\\$1)
2910 .       ie \\n[#TAB_ACTIVE] \{\
2911 .          ll \\n(.lu-\\n[#R_INDENT]u
2912 .          ta \\n(.lu-\\n[#L_INDENT]u
2913 .       \}
2914 .       el \{\
2915 .          ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2916 .          ta \\n(.lu-\\n[#L_INDENT]u
2917 .       \}
2918 .    \}
2919 .END
2920 \#
2921 \#
2922 \# +++INDENT BOTH+++
2923 \#
2924 .MAC IB END
2925 .    if \\n[#INDENT_STYLE_LEFT]  \{ .ILX \}
2926 .    if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
2927 .    nr #INDENT_STYLE_BOTH  1
2928 .    nr #INDENT_ACTIVE      1
2929 .    nr #INDENT_BOTH_ACTIVE 1
2930 .    ie '\\$1'' \{\
2931 .       br
2932 .       in \\n[#BL_INDENT]u
2933 .       ie \\n[#TAB_ACTIVE] \{\
2934 .          ll \\n(.lu-\\n[#BR_INDENT]u
2935 .          ta \\n(.lu-\\n[#BR_INDENT]u
2936 .       \}
2937 .       el \{\
2938 .          ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2939 .          ta \\n(.lu-\\n[#BR_INDENT]u
2940 .       \}
2941 .    \}
2942 .    el \{\
2943 .       br
2944 .       nr #BL_INDENT (\\n[#INDENT]+\\$1)
2945 .       ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
2946 .       el                  \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
2947 .       ie \\n[#TAB_ACTIVE] \{\
2948 .          in \\n[#BL_INDENT]u
2949 .          ll \\n(.lu-\\n[#BR_INDENT]u
2950 .          ta \\n(.lu-\\n[#BL_INDENT]u
2951 .       \}
2952 .       el \{\
2953 .          in \\n[#BL_INDENT]u
2954 .          ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2955 .          ta \\n(.lu-\\n[#BR_INDENT]u
2956 .       \}
2957 .    \}
2958 .END
2959 \#
2960 \#
2961 \# +++TEMPORARY INDENT+++
2962 \#
2963 .MAC TI END
2964 .    br
2965 .    ie '\\$1'' \{\
2966 .       ti \\n[#T_INDENT]u
2967 .       if \\n[#INDENT_LEFT_ACTIVE] \{\
2968 .          ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
2969 .       \}
2970 .       if \\n[#INDENT_BOTH_ACTIVE] \{\
2971 .          ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
2972 .       \}
2973 .    \}
2974 .    el \{\
2975 .       nr #T_INDENT (\\$1)
2976 .       ti \\n[#T_INDENT]u
2977 .    \}
2978 .END
2979 \#
2980 \#
2981 \# +++HANGING INDENT+++
2982 \#
2983 .MAC HI END
2984 .    ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
2985 .    el \{\
2986 .       nr #HL_INDENT (\\$1)
2987 .       ti -\\n[#HL_INDENT]u
2988 .    \}
2989 .END
2990 \#
2991 \#
2992 \# +++INDENTS OFF+++
2993 \#
2994 .MAC ILX END
2995 .    br
2996 .    in 0
2997 .    rr #INDENT_LEFT_ACTIVE
2998 .    if '\\$1'CLEAR' \{\
2999 .       rr #L_INDENT
3000 .       rr #INDENT_STYLE_LEFT
3001 .    \}
3002 .END
3003 \#
3004 \#
3005 .MAC IRX END
3006 .    br
3007 .    rr #INDENT_RIGHT_ACTIVE
3008 .    ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3009 .    el \{\
3010 .       ie \\n[#COLUMNS] \{\
3011 .          ll \\n[#COL_L_LENGTH]u
3012 .          ta \\n(.lu
3013 .       \}
3014 .       el \{\
3015 .          ll \\n[#L_LENGTH]u
3016 .          ta \\n(.lu
3017 .       \}
3018 .    \}
3019 .    if '\\$1'CLEAR' \{\
3020 .       rr #R_INDENT
3021 .       rr #INDENT_STYLE_RIGHT
3022 .    \}
3023 .END
3024 \#
3025 \#
3026 .MAC IBX END
3027 .    br
3028 .    in 0
3029 .    rr #INDENT_BOTH_ACTIVE
3030 .    ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3031 .    el \{\
3032 .       ie \\n[#COLUMNS] \{\
3033 .          ll \\n[#COL_L_LENGTH]u
3034 .          ta \\n(.lu
3035 .       \}
3036 .       el \{\
3037 .          ll \\n[#L_LENGTH]u
3038 .          ta \\n(.lu
3039 .       \}
3040 .    \}
3041 .    if '\\$1'CLEAR' \{\
3042 .       rr #BL_INDENT
3043 .       rr #BR_INDENT
3044 .       rr #INDENT_STYLE_BOTH
3045 .    \}
3046 .END
3047 \#
3048 \#
3049 .MAC IX END
3050 .    if '\\$0'IX' \{\
3051 .       if !\\n[#IX_WARN] \{\
3052 .          tm1 "[mom]: Use of .IX is now deprecated.  Use .IQ instead.
3053 .          tm1 "      .IX will continue to behave as before, but to
3054 .          tm1 "       avoid this message, please update your document.
3055 .          nr #IX_WARN 1
3056 .       \}
3057 .    \}
3058 .    br
3059 .    in 0
3060 .    rr #INDENT_LEFT_ACTIVE
3061 .    rr #INDENT_RIGHT_ACTIVE
3062 .    rr #INDENT_BOTH_ACTIVE
3063 .    if \\n[#INDENT_STYLE_RIGHT] \{\
3064 .       ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3065 .       el \{\
3066 .          ie \\n[#COLUMNS] \{\
3067 .             ll \\n[#COL_L_LENGTH]u
3068 .             ta \\n(.lu
3069 .          \}
3070 .          el \{\
3071 .             ll \\n[#L_LENGTH]u
3072 .             ta \\n(.lu
3073 .          \}
3074 .       \}
3075 .    \}
3076 .    if \\n[#INDENT_STYLE_BOTH] \{\
3077 .       ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3078 .       el \{\
3079 .          ie \\n[#COLUMNS] \{\
3080 .             ll \\n[#COL_L_LENGTH]u
3081 .             ta \\n(.lu
3082 .          \}
3083 .          el \{\
3084 .             ll \\n[#L_LENGTH]u
3085 .             ta \\n(.lu
3086 .          \}
3087 .       \}
3088 .    \}
3089 .    if '\\$1'CLEAR' \{\
3090 .       if \\n[#INDENT_STYLE_RIGHT] \{\
3091 .          ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3092 .          el \{\
3093 .             ie \\n[#COLUMNS] \{\
3094 .                ll \\n[#COL_L_LENGTH]u
3095 .                ta \\n(.lu
3096 .             \}
3097 .             el \{\
3098 .                ll \\n[#L_LENGTH]u
3099 .                ta \\n(.lu
3100 .             \}
3101 .          \}
3102 .       \}
3103 .       if \\n[#INDENT_STYLE_BOTH] \{\
3104 .          ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3105 .          el \{\
3106 .             ie \\n[#COLUMNS] \{\
3107 .                ll \\n[#COL_L_LENGTH]u
3108 .                ta \\n(.lu
3109 .             \}
3110 .             el \{\
3111 .                ll \\n[#L_LENGTH]u
3112 .                ta \\n(.lu
3113 .             \}
3114 .          \}
3115 .       \}
3116 .       rr #L_INDENT
3117 .       rr #R_INDENT
3118 .       rr #BL_INDENT
3119 .       rr #BR_INDENT
3120 .       rr #T_INDENT
3121 .       rr #H_INDENT
3122 .       rr #INDENT_STYLE_LEFT
3123 .       rr #INDENT_STYLE_RIGHT
3124 .       rr #INDENT_STYLE_BOTH
3125 .    \}
3126 .    rr #INDENT_ACTIVE
3127 .END
3128 \#
3129 \# =====================================================================
3130 \#
3131 \# +++MULTIPLE COLUMNS+++
3132 \#
3133 \# MULTIPLE COLUMNS ON
3134 \# -------------------
3135 \# *Arguments:
3136 \#   <none>
3137 \# *Function:
3138 \#   Marks the top of a column set
3139 \#
3140 .MAC MCO END
3141 .mk c
3142 .END
3143 \#
3144 \# MULTIPLE COLUMN RETURN
3145 \# ----------------------
3146 \# *Arguments:
3147 \#   <none>
3148 \# *Function:
3149 \#   Returns to the top of a column set
3150 \#
3151 .MAC MCR END
3152 .    TRAP OFF
3153 .    sp |\\ncu
3154 .    TRAP
3155 .END
3156 \#
3157 \# MULTIPLE COLUMNS OFF
3158 \# --------------------
3159 \# *Arguments:
3160 \#   <none> | <lead to advance beneath bottom of deepest column>
3161 \# *Function:
3162 \#   Advances to the end of a column set
3163 \# *Notes:
3164 \#   With no argument, advances to the next baseline (at the current
3165 \#   leading value) beneath the longest column.  With an argument
3166 \#   (which requires a unit of measure), advances arg distance
3167 \#   beneath the baseline of the deepest column.  If the argument
3168 \#   is zero, advances to the baseline of the deepest column.
3169 \#
3170 .MAC MCX END
3171 .    ie '\\$1'' \{\
3172 .       TQ
3173 .       sp |\\n(.hu
3174 .    \}
3175 .    el \{\
3176 .       nr #MCX_ALD (\\$1)
3177 .       TQ
3178 .       ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
3179 .       el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
3180 .       rr #MCX_ALD
3181 .    \}
3182 .END
3183 \#
3184 \# =====================================================================
3185 \#
3186 \# +++TYPESETTING SUPPORT MACROS+++
3187 \#
3188 \# TRAP
3189 \# ----
3190 \# *Arguments:
3191 \#   toggle
3192 \# *Function:
3193 \#   Enables/disables traps.
3194 \# *Notes:
3195 \#   EL and TN don't function as advertised on the last line before
3196 \#   a trap (when they break the preceding line, they spring the
3197 \#   trap, and groff won't back up to the line preceding the trap).
3198 \#   TRAP is a kludge to get EL and TN work properly on last lines.
3199 \#   The user simply enloses the offending lines in TRAP OFF/TRAP.
3200 \#
3201 .MAC TRAP END
3202 .    ie '\\$1'' \{ .vpt 1 \}
3203 .    el \{ .vpt 0 \}
3204 .END
3205 \#
3206 \#
3207 \# SILENT
3208 \# ------
3209 \# *Arguments:
3210 \#   <none> | <anything>
3211 \# *Function:
3212 \#   Diverts text so that it doesn't print, or turns the function off.
3213 \# *Notes:
3214 \#   Useful for setting up autotabs where you don't want the line with
3215 \#   the tab marks to print.
3216 \#
3217 \#   Also aliased as COMMENT, in case user wants to input a batch of
3218 \#   text that doesn't print.
3219 \#
3220 .MAC SILENT END
3221 .    nr #SILENT 1
3222 .    if \\n[#QUAD] \{ .br \}
3223 .    ie '\\$1'' \{ .di NO_FLASH \}
3224 .    el \{\
3225 .       br
3226 .       di
3227 .       rm NO_FLASH
3228 .       rr #SILENT
3229 .    \}
3230 .END
3231 \#
3232 \#
3233 \# PRINT
3234 \# -----
3235 \# *Function:
3236 \#   Prints anything.  A macro that helps keep my code nicely indented.
3237 \#
3238 .MAC PRINT END
3239 .    nop \\$*
3240 .END
3241 \#
3242 \#
3243 \# CAPS
3244 \# ----
3245 \# *Arguments:
3246 \#   <none> | <anything>
3247 \# *Function:
3248 \#   Converts text to caps, or, if OFF, reverts to normal caps/lc.
3249 \#
3250 .MAC CAPS END
3251 .    ie '\\$1'' \{\
3252 .       tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
3253 .       tr Ă \[`A]
3254 .       tr Ă˘\[^A]
3255 .       tr Ăˇ\['A]
3256 .       tr Ă¤\[:A]
3257 .       tr ĂĄ\[oA]
3258 .       tr ĂŁ\[~A]
3259 .       tr Ă¦\[AE]
3260 .       tr Ă¨\[`E]
3261 .       tr ĂŞ\[^E]
3262 .       tr Ă©\['E]
3263 .       tr Ă«\[:E]
3264 .       tr Ă¬\[`I]
3265 .       tr Ă®\[^I]
3266 .       tr Ă­\['I]
3267 .       tr ĂŻ\[:I]
3268 .       tr Ă˛\[`O]
3269 .       tr Ă´\[^O]
3270 .       tr Ăł\['O]
3271 .       tr Ă¶\[:O]
3272 .       tr Ăµ\[~O]
3273 .       tr Ă¸\[/O]
3274 .       tr Ăą\[`U]
3275 .       tr Ă»\[^U]
3276 .       tr Ăş\['U]
3277 .       tr ĂĽ\[:U]
3278 .       tr Ă§\[,C]
3279 .       tr Ă°\[-D]
3280 .       tr Ă±\[~N]
3281 .       tr Ăľ\[TP]
3282 .       tr Ă˝\['Y]
3283 .       tr Ăż\[:Y]
3284 .       nr #CAPS_ON 1
3285 .    \}
3286 .    el \{\
3287 .       tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
3288 .       tr Ă \[`a]
3289 .       tr Ă˘\[^a]
3290 .       tr Ăˇ\['a]
3291 .       tr Ă¤\[:a]
3292 .       tr ĂĄ\[oa]
3293 .       tr ĂŁ\[~a]
3294 .       tr Ă¦\[ae]
3295 .       tr Ă¨\[`e]
3296 .       tr ĂŞ\[^e]
3297 .       tr Ă©\['e]
3298 .       tr Ă«\[:e]
3299 .       tr Ă¬\[`i]
3300 .       tr Ă®\[^i]
3301 .       tr Ă­\['i]
3302 .       tr ĂŻ\[:i]
3303 .       tr Ă˛\[`o]
3304 .       tr Ă´\[^o]
3305 .       tr Ăł\['o]
3306 .       tr Ă¶\[:o]
3307 .       tr Ăµ\[~o]
3308 .       tr Ă¸\[/o]
3309 .       tr Ăą\[`u]
3310 .       tr Ă»\[^u]
3311 .       tr Ăş\['u]
3312 .       tr ĂĽ\[:u]
3313 .       tr Ă§\[,c]
3314 .       tr Ă°\[Sd]
3315 .       tr Ă±\[~n]
3316 .       tr Ăľ\[Tp]
3317 .       tr Ă˝\['y]
3318 .       tr Ăż\[:y]
3319 .       rr #CAPS_ON
3320 .    \}
3321 .END
3322 \#
3323 \# SIZESPECS
3324 \# ---------
3325 \# Argument:
3326 \#   <none>
3327 \# Function:
3328 \#   Gets cap-height, x-height, and descender depth of the
3329 \#   current font at the current point size.
3330 \# *Notes:
3331 \#   The routine is diverted so it remains invisible to output.
3332 \#
3333 .MAC SIZESPECS END
3334 .    di TYPESIZE
3335 E\\R'#CAP_HEIGHT \\n[.cht]'
3336 e\\R'#X_HEIGHT \\n[.cht]'
3337 y\\R'#DESCENDER \\n[.cdp]'
3338 .    br
3339 .    di
3340 .END
3341 \#
3342 \# =====================================================================
3343 \#
3344 \# +++TYPESETTING ALIASES+++
3345 \#
3346 .ALIAS    ADD_SPACE       ALD
3347 .ALIAS    CENTRE          CENTER
3348 .ALIAS    COLOUR          COLOR
3349 .ALIAS    COMMENT         SILENT
3350 .ALIAS    CONDENSE        CONDENSE_OR_EXTEND
3351 .ALIAS    EXTEND          CONDENSE_OR_EXTEND
3352 .ALIAS    FAM             FAMILY
3353 .ALIAS    HYPHENATE       HY
3354 .ALIAS    HYPHENATION     HY
3355 .ALIAS    HYSET           HY_SET
3356 .ALIAS    IBQ             IBX
3357 .ALIAS    ILQ             ILX
3358 .ALIAS    IQ              IX
3359 .ALIAS    IRQ             IRX
3360 .ALIAS    LIG             LIGATURES
3361 .ALIAS    NEWCOLOUR       NEWCOLOR
3362 .ALIAS    PADMARKER       PAD_MARKER
3363 .ALIAS    SP              ALD
3364 .ALIAS    SPACE           ALD
3365 .ALIAS    TABSET          TAB_SET
3366 .ALIAS    TB              TAB
3367 .ALIAS    UNDERSCORE_2    UNDERSCORE2
3368 .ALIAS    XCOLOUR         XCOLOR
3369 \#
3370 \#
3371 \# ====================================================================
3372 \#
3373 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
3374 \# ===============================================
3375 \#
3376 \# +++PAGE DIMENSIONS+++
3377 \#
3378 \# PAPER SIZE
3379 \# ----------
3380 \# *Arguments:
3381 \#   LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
3382 \# *Function:
3383 \#   Sets up dimensions for different paper sizes.
3384 \#
3385 .MAC PAPER END
3386 .    ds $PAPER \\$1
3387 .    if '\\*[$PAPER]'LETTER' \{\
3388 .       PAGEWIDTH  8.5i
3389 .       PAGELENGTH 11i
3390 .    \}
3391 .    if '\\*[$PAPER]'LEGAL' \{\
3392 .       PAGEWIDTH  8.5i
3393 .       PAGELENGTH 14i
3394 .    \}
3395 .    if '\\*[$PAPER]'STATEMENT' \{\
3396 .       PAGEWIDTH  5.5i
3397 .       PAGELENGTH 8.5i
3398 .    \}
3399 .    if '\\*[$PAPER]'TABLOID' \{\
3400 .       PAGEWIDTH  11i
3401 .       PAGELENGTH 17i
3402 .    \}
3403 .    if '\\*[$PAPER]'LEDGER' \{\
3404 .       PAGEWIDTH  17i
3405 .       PAGELENGTH 11i
3406 .    \}
3407 .    if '\\*[$PAPER]'FOLIO' \{\
3408 .       PAGEWIDTH  8.5i
3409 .       PAGELENGTH 13i
3410 .    \}
3411 .    if '\\*[$PAPER]'QUARTO' \{\
3412 .       PAGEWIDTH  610p
3413 .       PAGELENGTH 780p
3414 .    \}
3415 .    if '\\*[$PAPER]'10x14' \{\
3416 .       PAGEWIDTH  10i
3417 .       PAGELENGTH 14i
3418 .    \}
3419 .    if '\\*[$PAPER]'EXECUTIVE' \{\
3420 .       PAGEWIDTH  7.25i
3421 .       PAGELENGTH 10.5i
3422 .    \}
3423 .    if '\\*[$PAPER]'A3' \{\
3424 .       PAGEWIDTH  842p
3425 .       PAGELENGTH 1190p
3426 .    \}
3427 .    if '\\*[$PAPER]'A4' \{\
3428 .       PAGEWIDTH  595p
3429 .       PAGELENGTH 842p
3430 .    \}
3431 .    if '\\*[$PAPER]'A5' \{\
3432 .       PAGEWIDTH  421p
3433 .       PAGELENGTH 595p
3434 .    \}
3435 .    if '\\*[$PAPER]'B4' \{\
3436 .       PAGEWIDTH  709p
3437 .       PAGELENGTH 1002p
3438 .    \}
3439 .    if '\\*[$PAPER]'B5' \{\
3440 .       PAGEWIDTH  501p
3441 .       PAGELENGTH 709p
3442 .    \}
3443 .    if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
3444 .    if !r#R_MARGIN \{ .R_MARGIN 1i \}
3445 .END
3446 \#
3447 \#
3448 \# ====================================================================
3449 \#
3450 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
3451 \#
3452 \# PRINTSTYLE
3453 \# ----------
3454 \# *Arguments:
3455 \#   TYPESET | TYPEWRITE [SINGLESPACE]
3456 \# *Function:
3457 \#   Sets type specs for typewriter-style or typeset output.
3458 \# *Notes:
3459 \#   Number registers: TYPEWRITE=1, TYPESET=2.
3460 \#
3461 .MAC PRINTSTYLE END
3462 .    if !\\n[#COLLATE]=1 \{\
3463 .       if !d$PAPER \{ .PAPER LETTER \}
3464 .       if '\\$1'TYPEWRITE' \{\
3465 .          nr #PRINT_STYLE 1
3466 .          if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3467 .          if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3468 .          TYPEWRITER
3469 .          color 0
3470 .          ie '\\$2'SINGLESPACE' \{\
3471 .             nr #SINGLE_SPACE 1
3472 .             vs 12
3473 .             nr #ORIGINAL_DOC_LEAD \\n(.v
3474 .          \}
3475 .          el \{\
3476 .             vs 24
3477 .             nr #ORIGINAL_DOC_LEAD \\n(.v
3478 .          \}
3479 .          QUAD    L
3480 .          HY      OFF
3481 .          SMARTQUOTES OFF
3482 .          if !\\n[#PP_INDENT] \{\
3483 .             in 3P                 \"Set indent
3484 .             nr #PP_INDENT \\n(.i  \"Read into #PP_INDENT
3485 .             in 0                  \"Remove indent
3486 .          \}
3487 .          HDRFTR_RIGHT_CAPS
3488 .          nr #BOLDER_UNITS 0
3489 .          nr #CONDENSE 0
3490 .          nr #EXTEND 0
3491 .          rm IT
3492 .          rm BD
3493 .          rm BDI
3494 .          rm PREV
3495 .          UNDERLINE_SLANT
3496 .          UNDERLINE_ITALIC
3497 .          UNDERLINE_QUOTES
3498 .          nr #IGNORE_COLUMNS 1
3499 .          char \(em --
3500 .          tr `'
3501 .       \}
3502 .       if '\\$1'TYPESET' \{\
3503 .          nr #PRINT_STYLE 2
3504 .          if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3505 .          if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3506 .          FAMILY  T
3507 .          FT      R
3508 .          if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
3509 .          if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
3510 .          JUSTIFY
3511 .          HY
3512 .          HY_SET 2 36p 1p
3513 .          KERN
3514 .          LIG
3515 .          SS 0
3516 .          SMARTQUOTES
3517 .          if !\\n[#PP_INDENT] \{\
3518 .             in 2m                 \"Set indent
3519 .             nr #PP_INDENT \\n(.i  \"Read into #PP_INDENT
3520 .             in 0                  \"Remove indent
3521 .          \}
3522 .          HDRFTR_RIGHT_CAPS
3523 .          rr #IGNORE_COLUMNS
3524 .       \}
3525 .    \}
3526 .END
3527 \#
3528 \#
3529 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
3530 \#
3531 \# First, a little utility macro.
3532 \#
3533 .MAC TYPEWRITER END
3534 .    fam C
3535 .    ft  R
3536 .    ps  12
3537 .END
3538 \#
3539 \#
3540 \# ITALIC MEANS ITALIC
3541 \# -------------------
3542 \# *Argument:
3543 \#   <none>
3544 \# *Function:
3545 \#   Instructs TYPEWRITE to treat italics as italics, whether
3546 \#   invoked via control lines or inline.
3547 \# *Notes:
3548 \#   ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
3549 \#   hence invoking the one automatically turns off the other.
3550 \#
3551 .MAC ITALIC_MEANS_ITALIC END
3552 .    if \\n[#PRINT_STYLE]=1 \{\
3553 .       nr #ITALIC_MEANS_ITALIC 1
3554 .       rr #UNDERLINE_ITALIC
3555 .       rm ROM
3556 .       rm IT
3557 .       rm PREV
3558 .       ds ROM  \EfR
3559 .       ds IT   \EfI
3560 .       ds PREV \EfR
3561 .    \}
3562 .END
3563 \#
3564 \#
3565 \# UNDERLINE ITALIC
3566 \# ----------------
3567 \# *Argument:
3568 \#   <none>
3569 \# *Function:
3570 \#   Instructs TYPEWRITE to underline italics, whether invoked
3571 \#   via control lines or inline.
3572 \# *Notes:
3573 \#   UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
3574 \#   hence invoking the one automatically turns off the other.
3575 \#
3576 \#   UNDERLINE_ITALIC is the default for TYPEWRITE.
3577 \#
3578 .MAC UNDERLINE_ITALIC END
3579 .    if \\n[#PRINT_STYLE]=1 \{\
3580 .       nr #UNDERLINE_ITALIC 1
3581 .       rr #ITALIC_MEANS_ITALIC
3582 .       rm ROM
3583 .       rm IT
3584 .       rm PREV
3585 .       ds ROM  \E*[ULX]
3586 .       ds IT   \E*[UL]
3587 .       ds PREV \E*[ULX]
3588 .    \}
3589 .END
3590 \#
3591 \#
3592 \# UNDERLINE SLANT
3593 \# ---------------
3594 \# *Arguments:
3595 \#   <none> | <anything>
3596 \# *Function:
3597 \#   Instructs TYPEWRITE to underline occurences of \*[SLANT], or
3598 \#   turns feature off.
3599 \# *Notes:
3600 \#   Users may want \*[SLANT] to mean slant in TYPEWRITE, although
3601 \#   most of the time, \*[SLANT] most likely means the user wanted
3602 \#   italic but didn't have it, ergo the need to tell TYPEWRITE to
3603 \#   treat \*[SLANT] as italic (i.e. underlined).
3604 \#
3605 \#   UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
3606 \#   hence invoking the one automatically turns off the other.
3607 \#
3608 \#   UNDERLINE_SLANT is the default for TYPEWRITE.
3609 \#
3610 .MAC UNDERLINE_SLANT END
3611 .    if \\n[#PRINT_STYLE]=1 \{\
3612 .       rr #SLANT_MEANS_SLANT
3613 .       nr #UNDERLINE_SLANT 1
3614 .       rm SLANT
3615 .       rm SLANTX
3616 .       ds SLANT  \ER'#SLANT_ON 1'\E*[UL]
3617 .       ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
3618 .    \}
3619 .END
3620 \#
3621 \#
3622 .MAC SLANT_MEANS_SLANT END
3623 .    if \\n[#PRINT_STYLE]=1 \{\
3624 .       rr #UNDERLINE_SLANT
3625 .       nr #SLANT_MEANS_SLANT 1
3626 .       rm SLANT
3627 .       rm SLANTX
3628 .       ds SLANT  \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
3629 .       ds SLANTX \ER'#SLANT_ON 0'\ES'0'
3630 .    \}
3631 .END
3632 \#
3633 \#
3634 .MAC IGNORE_COLUMNS END
3635 .    if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
3636 .END
3637 \#
3638 \#
3639 \# ====================================================================
3640 \#
3641 \# +++COPY STYLE -- DRAFT OR FINAL+++
3642 \#
3643 \# COPY STYLE
3644 \# ----------
3645 \# *Arguments:
3646 \#   DRAFT | FINAL
3647 \# *Function:
3648 \#   Sets registers that are used to determine what to put
3649 \#   in the default header, and how to number pages.
3650 \# *Notes:
3651 \#   DOCTYPE must come before COPYSTYLE.
3652 \#
3653 .MAC COPYSTYLE END
3654 .    ds $COPY_STYLE \\$1
3655 .    if '\\*[$COPY_STYLE]'DRAFT' \{\
3656 .       nr #COPY_STYLE 1
3657 .       if !d$DRAFT \{ .DRAFT 1 \}
3658 .    \}
3659 .    if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2         \}
3660 .    if !d$CHAPTER_STRING        \{ .CHAPTER_STRING "Chapter" \}
3661 .    if !d$DRAFT_STRING          \{ .DRAFT_STRING "Draft"     \}
3662 .    if !d$REVISION_STRING       \{ .REVISION_STRING "Rev."   \}
3663 .\" Default
3664 .    if \\n[#DOC_TYPE]=1 \{\
3665 .       ie \\n[#COPY_STYLE]=1 \{\
3666 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3667 .          el \{ .PAGENUM_STYLE roman \}
3668 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3669 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
3670 .                ds $HDRFTR_CENTER
3671 .             \}
3672 .             el \{\
3673 .                ie '\\*[$REVISION]'' \{\
3674 .                   ds $HDRFTR_CENTER \
3675                     \\*[$DRAFT_STRING]\\*[$DRAFT]
3676 .                \}
3677 .                el \{\
3678 .                   ds $HDRFTR_CENTER \
3679                     \\*[$DRAFT_STRING]\\*[$DRAFT], \
3680                     \\*[$REVISION_STRING] \\*[$REVISION]
3681 .                \}
3682 .             \}
3683 .          \}
3684 .       \}
3685 .       el \{\
3686 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3687 .          el \{ .PAGENUM_STYLE DIGIT \}
3688 .          if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
3689 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3690 .             ds $HDRFTR_CENTER
3691 .             rr #USER_DEF_HDRFTR_CENTER
3692 .          \}
3693 .       \}
3694 .    \}
3695 .\" Chapter
3696 .    if \\n[#DOC_TYPE]=2 \{\
3697 .\" Copystyle DRAFT
3698 .       ie \\n[#COPY_STYLE]=1 \{\
3699 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3700 .          el \{ .PAGENUM_STYLE roman \}
3701 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3702 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
3703 .                ie '\\*[$CHAPTER]'' \{\
3704 .                   ie !'\\*[$CHAPTER_TITLE]'' \{\
3705 .                      ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3706 .                   \}
3707 .                   el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
3708 .                \}
3709 .                el \{\
3710 .                   ie !'\\*[$CHAPTER_TITLE]'' \{\
3711 .                      ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3712 .                   \}
3713 .                   el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3714 .                \}
3715 .             \}
3716 .             el \{\
3717 .                ie '\\*[$REVISION]'' \{\
3718 .                   ie '\\*[$CHAPTER]'' \{\
3719 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3720 .                         ie '\\*[$DRAFT]'' \{\
3721 .                            ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3722 .                         \}
3723 .                         el \{\
3724 .                            ds $HDRFTR_CENTER \
3725                              \\*[$CHAPTER_TITLE], \
3726                              \\*[$DRAFT_STRING]\\*[$DRAFT]
3727 .                         \}
3728 .                      \}
3729 .                      el \{\
3730 .                         ie '\\*[$DRAFT]'' \{\
3731 .                            ds $HDRFTR_CENTER \
3732                              \\*[$CHAPTER_STRING]
3733 .                         \}
3734 .                         el \{\
3735 .                            ds $HDRFTR_CENTER \
3736                              \\*[$CHAPTER_STRING], \
3737                              \\*[$DRAFT_STRING]\\*[$DRAFT]
3738 .                         \}
3739 .                      \}
3740 .                   \}
3741 .                   el \{\
3742 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3743 .                         ie '\\*[$DRAFT]'' \{\
3744 .                            ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3745 .                         \}
3746 .                         el \{\
3747 .                            ds $HDRFTR_CENTER \
3748                              \\*[$CHAPTER_TITLE], \
3749                              \\*[$DRAFT_STRING]\\*[$DRAFT]
3750 .                         \}
3751 .                      \}
3752 .                      el \{\
3753 .                         ie '\\*[$DRAFT]'' \{\
3754 .                            ds $HDRFTR_CENTER \
3755                              \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3756 .                         \}
3757 .                         el \{\
3758 .                            ds $HDRFTR_CENTER \
3759                              \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3760                              \\*[$DRAFT_STRING]\\*[$DRAFT]
3761 .                         \}
3762 .                      \}
3763 .                   \}
3764 .                \}
3765 .                el \{\
3766 .                   ie '\\*[$CHAPTER]'' \{\
3767 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3768 .                         ie '\\*[$DRAFT]'' \{\
3769 .                            ds $HDRFTR_CENTER \
3770                              \\*[$CHAPTER_TITLE], \
3771                              \\*[$REVISION_STRING] \\*[$REVISION] 
3772 .                         \}
3773 .                         el \{\
3774 .                            ds $HDRFTR_CENTER \
3775                              \\*[$CHAPTER_TITLE], \
3776                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
3777                              \\*[$REVISION_STRING] \\*[$REVISION] 
3778 .                         \}
3779 .                      \}
3780 .                      el \{\
3781 .                         ie '\\*[$DRAFT]'' \{\
3782 .                            ds $HDRFTR_CENTER \
3783                              \\*[$CHAPTER_STRING], \
3784                              \\*[$REVISION_STRING] \\*[$REVISION] 
3785 .                         \}
3786 .                         el \{\
3787 .                            ds $HDRFTR_CENTER \
3788                              \\*[$CHAPTER_STRING], \
3789                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
3790                              \\*[$REVISION_STRING] \\*[$REVISION] 
3791 .                         \}
3792 .                      \}
3793 .                   \}
3794 .                   el \{\
3795 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3796 .                         ie '\\*[$DRAFT]'' \{\
3797 .                            ds $HDRFTR_CENTER \
3798                              \\*[$CHAPTER_TITLE], \
3799                              \\*[$REVISION_STRING] \\*[$REVISION] 
3800 .                         \}
3801 .                         el \{\
3802 .                            ds $HDRFTR_CENTER \
3803                              \\*[$CHAPTER_TITLE], \
3804                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
3805                              \\*[$REVISION_STRING] \\*[$REVISION] 
3806 .                         \}
3807 .                      \}
3808 .                      el \{\
3809 .                         ie '\\*[$DRAFT]'' \{\
3810 .                            ds $HDRFTR_CENTER \
3811                              \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3812                              \\*[$REVISION_STRING] \\*[$REVISION] 
3813 .                         \}
3814 .                         el \{\
3815 .                            ds $HDRFTR_CENTER \
3816                              \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3817                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
3818                              \\*[$REVISION_STRING] \\*[$REVISION] 
3819 .                         \}
3820 .                      \}
3821 .                   \}
3822 .                \}
3823 .             \}
3824 .          \}
3825 .       \}
3826 .\" Copystyle FINAL
3827 .       el \{\
3828 .          if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
3829 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3830 .             ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3831 .             el \{ .PAGENUM_STYLE DIGIT \}
3832 .             ie '\\*[$CHAPTER]'' \{\
3833 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
3834 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3835 .                \}
3836 .                el \{\
3837 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
3838 .                \}
3839 .             \}
3840 .             el \{\
3841 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
3842 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3843 .                \}
3844 .                el \{\
3845 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3846 .                \}
3847 .             \}
3848 .          \}
3849 .       \}
3850 .    \}
3851 .\" Named
3852 .    if \\n[#DOC_TYPE]=3 \{\
3853 .       ie \\n[#COPY_STYLE]=1 \{\
3854 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3855 .          el \{ .PAGENUM_STYLE roman \}
3856 .          ie \\n[#DRAFT_WITH_PAGENUM] \{\
3857 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3858 .          \}
3859 .          el \{\
3860 .             if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3861 .                ie '\\*[$REVISION]'' \{\
3862 .                   ie '\\*[$DRAFT]'' \{\
3863 .                      ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3864 .                   \}
3865 .                   el \{\
3866 .                      ds $HDRFTR_CENTER \
3867                        \\*[$DOC_TYPE], \
3868                        \\*[$DRAFT_STRING]\\*[$DRAFT]
3869 .                   \}
3870 .                \}
3871 .                el \{\
3872 .                   ie '\\*[$DRAFT]'' \{\
3873 .                      ds $HDRFTR_CENTER \
3874                        \\*[$DOC_TYPE], \
3875                        \\*[$REVISION_STRING] \\*[$REVISION]
3876 .                   \}
3877 .                   el \{\
3878 .                      ds $HDRFTR_CENTER \
3879                        \\*[$DOC_TYPE], \
3880                        \\*[$DRAFT_STRING]\\*[$DRAFT], \
3881                        \\*[$REVISION_STRING] \\*[$REVISION]
3882 .                   \}
3883 .                \}
3884 .             \}
3885 .          \}
3886 .       \}
3887 .       el \{\
3888 .          if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
3889 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3890 .             ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3891 .             el \{ .PAGENUM_STYLE DIGIT \}
3892 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3893 .          \}
3894 .       \}
3895 .    \}
3896 .END
3897 \#
3898 \# ====================================================================
3899 \#
3900 \# +++COLLECT DOC INFO -- STRINGS AND REGISTERS FOR REFERENCE MACROS+++
3901 \#
3902 \# *Arguments:
3903 \#   various string/register arguments
3904 \# *Function:
3905 \#   Collect information about documents.
3906 \#
3907 \#
3908 .MAC DOCTITLE END
3909 .    ds $DOC_TITLE \\$1
3910 .END
3911 \#
3912 .MAC TITLE END \"Document title
3913 .    ds $TITLE \\$1
3914 .END
3915 \#
3916 \#
3917 .MAC SUBTITLE END \"Document sub-title
3918 .    ds $SUBTITLE \\$1
3919 .END
3920 \#
3921 \#
3922 .MAC CHAPTER END \"If document is a chapter, the chapter number
3923 .    ds $CHAPTER \\$1
3924 .END
3925 \#
3926 \#
3927 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
3928 .    ds $CHAPTER_TITLE \\$1
3929 .END
3930 \#
3931 \#
3932 .MAC DRAFT END \"Draft number
3933 .    ie '\\$1'' .ds $DRAFT 
3934 .    el         .ds $DRAFT " \\$1
3935 .END
3936 \#
3937 \#
3938 .MAC REVISION END \"Revision number
3939 .    ds $REVISION \\$1
3940 .END
3941 \#
3942 \#
3943 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
3944 .    nr #DRAFT_WITH_PAGENUM 1
3945 .END
3946 \#
3947 \#
3948 .MAC AUTHOR END \"Author.  Enclose all args fully in double quotes.
3949 .    nr #AUTHOR_NUM -1 1
3950 .    while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
3951 .       ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
3952 .\}
3953 .    nr #NUM_AUTHORS \\n[#NUM_ARGS]%2 \"Use mod 2 to test if odd or even # of authors
3954 .    ie \\n[#NUM_AUTHORS]=1 \{ .nr #AUTHOR_LINES 0  \}
3955 .    el \{ .nr #AUTHOR_LINES 1 \}
3956 .END
3957 \#
3958 \#
3959 .MAC COPYRIGHT END \"For use on cover page only
3960 .   ds $COPYRIGHT \[co]\\$1
3961 .END
3962 \#
3963 \#
3964 .MAC MISC END \"For use on cover page only; enclose all args in double quotes
3965 .    nr #MISC_NUM -1 1
3966 .    while \\n[#NUM_ARGS]>\\n[#MISC_NUM] \{\
3967 .       ds $MISC_\\n+[#MISC_NUM] \\$\\n[#MISC_NUM]
3968 .\}
3969 .    nr #NUM_MISCS \\n[#NUM_ARGS]
3970 .END
3971 \#
3972 \#
3973 .MAC PAGENUMBER END \"Page # that appears on page one.
3974 .    nr #n%_AT_PAGENUM_SET \\n%
3975 .    nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
3976 .    rr #n%_AT_PAGENUM_SET
3977 .    nr #PAGE_NUM_SET 1
3978 .END
3979 \#
3980 \# ====================================================================
3981 \#
3982 \# +++TYPE OF DOCUMENT+++
3983 \#
3984 \# DOCUMENT TYPE
3985 \# -------------
3986 \# *Argument:
3987 \#   DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
3988 \# *Function:
3989 \#   Creates strings and sets registers for document types.
3990 \# *Notes:
3991 \#   Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
3992 \#
3993 .MAC DOCTYPE END
3994 .    if '\\$1'DEFAULT' \{\
3995 .       nr #DOC_TYPE 1
3996 .    \}
3997 .    if '\\$1'CHAPTER' \{\
3998 .       nr #DOC_TYPE 2
3999 .    \}
4000 .    if '\\$1'NAMED' \{\
4001 .       ds $DOC_TYPE \\$2
4002 .       nr #DOC_TYPE 3
4003 .    \}
4004 .    if '\\$1'LETTER' \{\
4005 .       nr #DOC_TYPE 4
4006 .       L_MARGIN 1.125i
4007 .       R_MARGIN 1.125i
4008 .       PT_SIZE 12
4009 .       LS 13.5
4010 .       DOCHEADER OFF
4011 .       PARA_INDENT 3m
4012 .       INDENT_FIRST_PARAS
4013 .       PARA_SPACE
4014 .       ds $SUITE \En[#SUITE]
4015 .       HEADER_MARGIN 3P+6p
4016 .       HEADER_GAP 3P
4017 .       FOOTERS
4018 .       FOOTER_RULE OFF
4019 .       FOOTER_LEFT ""
4020 .       FOOTER_CENTER ""
4021 .       FOOTER_RIGHT_SIZE +0
4022 .       FOOTER_RIGHT "\&.../\E*[$SUITE]
4023 .       FOOTER_ON_FIRST_PAGE
4024 .       em ALL_DONE
4025 .    \}
4026 .END
4027 \#
4028 \# +++LETTER MACROS+++
4029 \#
4030 \# First, create a register to hold incrementing numbers to be
4031 \# appended to LETTERHEAD.
4032 \#
4033 .nr #FIELD 0 1
4034 \#
4035 \# DATE
4036 \# ----
4037 \# *Arguments:
4038 \#   <none>
4039 \# *Function:
4040 \#   Stores date (entered on the line after .DATE) in diversion
4041 \#   LETTERHEAD<n>
4042 \#
4043 .MAC DATE END
4044 .    if !'\\n(.z'' \{ .di \}
4045 .    di LETTERHEAD\\n+[#FIELD]
4046 .    ie \\n[#FIELD]=1 \{\
4047 .       nr #DATE_FIRST 1
4048 .       RIGHT
4049 .    \}
4050 .    el \{\
4051 .       LEFT
4052 .    \}
4053 .END
4054 \#
4055 \#
4056 \# TO
4057 \# --
4058 \# *Arguments:
4059 \#   <none>
4060 \# *Function:
4061 \#   Stores addressee address (entered on the line after .TO) in
4062 \#   diversion LETTERHEAD<n>
4063 \#
4064 .MAC TO END
4065 .    if !'\\n(.z'' \{ .di \}
4066 .    di LETTERHEAD\\n+[#FIELD]
4067 .    LEFT
4068 .END
4069 \#
4070 \#
4071 \# FROM
4072 \# ----
4073 \# *Arguments:
4074 \#   <none>
4075 \# *Function:
4076 \#   Stores addresser address (entered on the line after .FROM) in
4077 \#   diversion LETTERHEAD<n>
4078 \#
4079 .MAC FROM END
4080 .    if !'\\n(.z'' \{ .di \}
4081 .    di LETTERHEAD\\n+[#FIELD]
4082 .    LEFT
4083 .END
4084 \#
4085 \#
4086 \# GREETING
4087 \# --------
4088 \# *Arguments:
4089 \#   <none>
4090 \# *Function:
4091 \#   Stores greeting (entered on the line after .GREETING) in
4092 \#   diversion LETTERHEAD<n>
4093 \#
4094 .MAC GREETING END
4095 .    if !'\\n(.z'' \{ .di \}
4096 .    di LETTERHEAD\\n+[#FIELD]
4097 .    LEFT
4098 .END
4099 \#
4100 \#
4101 \# CLOSING
4102 \# -------
4103 \# *Arguments:
4104 \#   <closing string>
4105 \# *Function:
4106 \#   Stores greeting in diversion CLOSING.
4107 \#
4108 .MAC CLOSING END
4109 .    br
4110 .    nr #CLOSING 1
4111 .    di CLOSING
4112 .    LEFT
4113 .END
4114 \#
4115 \#
4116 \# NO SUITE
4117 \# --------
4118 \# *Arguments:
4119 \#   <none>
4120 \# *Function:
4121 \#   Redefines $FOOTER_RIGHT to blank so that a suite number doesn't
4122 \#   appear at the bottom of letter pages.
4123 \#
4124 .MAC NO_SUITE END
4125 .    FOOTER_RIGHT ""
4126 .END
4127 \#
4128 \# ====================================================================
4129 \#
4130 \# +++DEFAULTS+++
4131 \#
4132 \# TYPE-STYLE CONTROL MACROS
4133 \# -------------------------
4134 \#
4135 .ig
4136 The control macros for family, font, size, quad and color are here
4137 grouped together.  Each (e.g. _FAMILY or _FONT) tests for a calling
4138 alias before performing the action(s) appropriate to the calling
4139 macro.  Defaults for all these guys are set in DEFAULTS, and listed
4140 in the "Control Macros" section of the documentation pertinent to
4141 the macro whose style is to be changed.
4142 ..
4143 \#
4144 .MAC _FAMILY END
4145 .    if '\\$0'AUTHOR_FAMILY'                  .ds $AUTHOR_FAM \\$1
4146 .    if '\\$0'BIBLIOGRAPHY_FAMILY'            .ds $BIB_FAM \\$1
4147 .    if '\\$0'BIBLIOGRAPHY_STRING_FAMILY'     .ds $BIB_STRING_FAM \\$1
4148 .    if '\\$0'BLOCKQUOTE_FAMILY'              .ds $BQUOTE_FAM \\$1
4149 .    if '\\$0'CITATION_FAMILY'                .ds $BQUOTE_FAM \\$1
4150 .    if '\\$0'CITE_FAMILY'                    .ds $BQUOTE_FAM \\$1
4151 .    if '\\$0'CHAPTER_TITLE_FAMILY'           .ds $CHAPTER_TITLE_FAM \\$1
4152 .    if '\\$0'COVER_AUTHOR_FAMILY'            .ds $COVER_AUTHOR_FAM \\$1
4153 .    if '\\$0'COVER_CHAPTER_TITLE_FAMILY'     .ds $COVER_CHAPTER_TITLE_FAM \\$1
4154 .    if '\\$0'COVER_COPYRIGHT_FAMILY'         .ds $COVER_COPYRIGHT_FAM \\$1
4155 .    if '\\$0'COVER_DOCTYPE_FAMILY'           .ds $COVER_DOCTYPE_FAM \\$1
4156 .    if '\\$0'COVER_FAMILY'                   .ds $COVER_FAM \\$1
4157 .    if '\\$0'COVER_SUBTITLE_FAMILY'          .ds $COVER_SUBTITLE_FAM \\$1
4158 .    if '\\$0'COVER_TITLE_FAMILY'             .ds $COVER_TITLE_FAM \\$1
4159 .    if '\\$0'DOC_COVER_AUTHOR_FAMILY'        .ds $DOC_COVER_AUTHOR_FAM \\$1
4160 .    if '\\$0'DOC_COVER_CHAPTER_TITLE_FAMILY' .ds $DOC_COVER_CHAPTER_TITLE_FAM \\$1
4161 .    if '\\$0'DOC_COVER_COPYRIGHT_FAMILY'     .ds $DOC_COVER_COPYRIGHT_FAM \\$1
4162 .    if '\\$0'DOC_COVER_DOCTYPE_FAMILY'       .ds $DOC_COVER_DOCTYPE_FAM \\$1
4163 .    if '\\$0'DOC_COVER_FAMILY'               .ds $DOC_COVER_FAM \\$1
4164 .    if '\\$0'DOC_COVER_SUBTITLE_FAMILY'      .ds $DOC_COVER_SUBTITLE_FAM \\$1
4165 .    if '\\$0'DOC_COVER_TITLE_FAMILY'         .ds $DOC_COVER_TITLE_FAM \\$1
4166 .    if '\\$0'DOCHEADER_FAMILY'               .ds $DOCHEADER_FAM \\$1
4167 .    if '\\$0'DOCTYPE_FAMILY'                 .ds $DOCTYPE_FAM \\$1
4168 .    if '\\$0'ENDNOTE_FAMILY'                 .ds $EN_FAM \\$1
4169 .    if '\\$0'ENDNOTE_NUMBER_FAMILY'          .ds $EN_NUMBER_FAM \\$1
4170 .    if '\\$0'ENDNOTE_LINENUMBER_FAMILY'      .ds $EN_LN_FAM \\$1
4171 .    if '\\$0'ENDNOTE_STRING_FAMILY'          .ds $EN_STRING_FAM \\$1
4172 .    if '\\$0'ENDNOTE_TITLE_FAMILY'           .ds $EN_TITLE_FAM \\$1
4173 .    if '\\$0'EPIGRAPH_FAMILY'                .ds $EPI_FAM \\$1
4174 .    if '\\$0'FOOTNOTE_FAMILY'                .ds $FN_FAM \\$1
4175 .    if '\\$0'HDRFTR_CENTER_FAMILY'           .ds $HDRFTR_CENTER_FAM \\$1
4176 .    if '\\$0'HDRFTR_FAMILY' \{\
4177 .       ds $HDRFTR_FAM        \\$1
4178 .       ds $HDRFTR_LEFT_FAM   \\$1
4179 .       ds $HDRFTR_CENTER_FAM \\$1
4180 .       ds $HDRFTR_RIGHT_FAM  \\$1
4181 .    \}
4182 .    if '\\$0'HDRFTR_LEFT_FAMILY'             .ds $HDRFTR_LEFT_FAM \\$1
4183 .    if '\\$0'HDRFTR_RIGHT_FAMILY'            .ds $HDRFTR_RIGHT_FAM \\$1
4184 .    if '\\$0'HEAD_FAMILY'                    .ds $HEAD_FAM \\$1
4185 .    if '\\$0'PAGENUM_FAMILY'                 .ds $PAGE_NUM_FAM \\$1
4186 .    if '\\$0'PARAHEAD_FAMILY'                .ds $PH_FAM \\$1
4187 .    if '\\$0'QUOTE_FAMILY'                   .ds $QUOTE_FAM \\$1
4188 .    if '\\$0'SUBHEAD_FAMILY'                 .ds $SH_FAM \\$1
4189 .    if '\\$0'SUBTITLE_FAMILY'                .ds $SUBTITLE_FAM \\$1
4190 .    if '\\$0'TITLE_FAMILY'                   .ds $TITLE_FAM \\$1
4191 .    if '\\$0'TOC_FAMILY'                     .ds $TOC_FAM \\$1
4192 .    if '\\$0'TOC_FAM'                        .ds $TOC_FAM \\$1
4193 .    if '\\$0'TOC_HEADER_FAMILY'              .ds $TOC_HEADER_FAM \\$1
4194 .    if '\\$0'TOC_HEAD_FAMILY'                .ds $TOC_HEAD_FAM \\$1
4195 .    if '\\$0'TOC_PARAHEAD_FAMILY'            .ds $TOC_PH_FAM \\$1
4196 .    if '\\$0'TOC_PN_FAMILY'                  .ds $TOC_PN_FAM \\$1
4197 .    if '\\$0'TOC_SUBHEAD_FAMILY'             .ds $TOC_SH_FAM \\$1
4198 .    if '\\$0'TOC_TITLE_FAMILY'               .ds $TOC_TITLE_FAM \\$1
4199 .END
4200 \#
4201 \#
4202 .MAC _FONT END
4203 .    if '\\$0'AUTHOR_FONT'                  .ds $AUTHOR_FT \\$1
4204 .    if '\\$0'BIBLIOGRAPHY_FONT'            .ds $BIB_FT \\$1
4205 .    if '\\$0'BIBLIOGRAPHY_STRING_FONT'     .ds $BIB_STRING_FT \\$1
4206 .    if '\\$0'BLOCKQUOTE_FONT'              .ds $BQUOTE_FT \\$1
4207 .    if '\\$0'CITATION_FONT'                .ds $BQUOTE_FT \\$1
4208 .    if '\\$0'CITE_FONT'                    .ds $BQUOTE_FT \\$1
4209 .    if '\\$0'CHAPTER_TITLE_FONT'           .ds $CHAPTER_TITLE_FT \\$1
4210 .    if '\\$0'COVER_AUTHOR_FONT'            .ds $COVER_AUTHOR_FT \\$1
4211 .    if '\\$0'COVER_CHAPTER_TITLE_FONT'     .ds $COVER_CHAPTER_TITLE_FT \\$1
4212 .    if '\\$0'COVER_COPYRIGHT_FONT'         .ds $COVER_COPYRIGHT_FT \\$1
4213 .    if '\\$0'COVER_DOCTYPE_FONT'           .ds $COVER_DOCTYPE_FT \\$1
4214 .    if '\\$0'COVER_SUBTITLE_FONT'          .ds $COVER_SUBTITLE_FT \\$1
4215 .    if '\\$0'COVER_TITLE_FONT'             .ds $COVER_TITLE_FT \\$1
4216 .    if '\\$0'DOC_COVER_AUTHOR_FONT'        .ds $DOC_COVER_AUTHOR_FT \\$1
4217 .    if '\\$0'DOC_COVER_CHAPTER_TITLE_FONT' .ds $DOC_COVER_CHAPTER_TITLE_FT \\$1
4218 .    if '\\$0'DOC_COVER_COPYRIGHT_FONT'     .ds $DOC_COVER_COPYRIGHT_FT \\$1
4219 .    if '\\$0'DOC_COVER_DOCTYPE_FONT'       .ds $DOC_COVER_DOCTYPE_FT \\$1
4220 .    if '\\$0'DOC_COVER_SUBTITLE_FONT'      .ds $DOC_COVER_SUBTITLE_FT \\$1
4221 .    if '\\$0'DOC_COVER_TITLE_FONT'         .ds $DOC_COVER_TITLE_FT \\$1
4222 .    if '\\$0'DOCTYPE_FONT'                 .ds $DOCTYPE_FT \\$1
4223 .    if '\\$0'ENDNOTE_FONT'                 .ds $EN_FT \\$1
4224 .    if '\\$0'ENDNOTE_NUMBER_FONT'          .ds $EN_NUMBER_FT \\$1
4225 .    if '\\$0'ENDNOTE_LINENUMBER_FONT'      .ds $EN_LN_FT \\$1
4226 .    if '\\$0'ENDNOTE_STRING_FONT'          .ds $EN_STRING_FT \\$1
4227 .    if '\\$0'ENDNOTE_TITLE_FONT'           .ds $EN_TITLE_FT \\$1
4228 .    if '\\$0'EPIGRAPH_FONT'                .ds $EPI_FT \\$1
4229 .    if '\\$0'FOOTNOTE_FONT'                .ds $FN_FT \\$1
4230 .    if '\\$0'HDRFTR_CENTER_FONT'           .ds $HDRFTR_CENTER_FT \\$1
4231 .    if '\\$0'HDRFTR_LEFT_FONT'             .ds $HDRFTR_LEFT_FT \\$1
4232 .    if '\\$0'HDRFTR_RIGHT_FONT'            .ds $HDRFTR_RIGHT_FT \\$1
4233 .    if '\\$0'HEAD_FONT'                    .ds $HEAD_FT \\$1
4234 .    if '\\$0'PAGENUM_FONT'                 .ds $PAGE_NUM_FT \\$1
4235 .    if '\\$0'PARAHEAD_FONT'                .ds $PH_FT \\$1
4236 .    if '\\$0'QUOTE_FONT'                   .ds $QUOTE_FT \\$1
4237 .    if '\\$0'SUBHEAD_FONT'                 .ds $SH_FT \\$1
4238 .    if '\\$0'SUBTITLE_FONT'                .ds $SUBTITLE_FT \\$1
4239 .    if '\\$0'TITLE_FONT'                   .ds $TITLE_FT \\$1
4240 .    if '\\$0'TOC_HEADER_FONT'              .ds $TOC_HEADER_FT \\$1
4241 .    if '\\$0'TOC_HEAD_FONT'                .ds $TOC_HEAD_FT \\$1
4242 .    if '\\$0'TOC_PARAHEAD_FONT'            .ds $TOC_PH_FT \\$1
4243 .    if '\\$0'TOC_PN_FONT'                  .ds $TOC_PN_FT \\$1
4244 .    if '\\$0'TOC_SUBHEAD_FONT'             .ds $TOC_SH_FT \\$1
4245 .    if '\\$0'TOC_TITLE_FONT'               .ds $TOC_TITLE_FT \\$1
4246 .END
4247 \#
4248 \#
4249 .MAC _SIZE END
4250 .    if '\\$0'AUTHOR_SIZE'                  .ds $AUTHOR_SIZE_CHANGE \\$1
4251 .    if '\\$0'BIBLIOGRAPHY_STRING_SIZE'     .ds $BIB_STRING_SIZE_CHANGE \\$1
4252 .    if '\\$0'BLOCKQUOTE_SIZE'              .ds $BQUOTE_SIZE_CHANGE \\$1
4253 .    if '\\$0'CITATION_SIZE'                .ds $BQUOTE_SIZE_CHANGE \\$1
4254 .    if '\\$0'CITE_SIZE'                    .ds $BQUOTE_SIZE_CHANGE \\$1
4255 .    if '\\$0'CHAPTER_TITLE_SIZE'           .ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
4256 .    if '\\$0'COVER_AUTHOR_SIZE'            .ds $COVER_AUTHOR_SIZE_CHANGE \\$1
4257 .    if '\\$0'COVER_CHAPTER_TITLE_SIZE'     .ds $COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
4258 .    if '\\$0'COVER_COPYRIGHT_SIZE'         .ds $COVER_COPYRIGHT_SIZE_CHANGE \\$1
4259 .    if '\\$0'COVER_DOCTYPE_SIZE'           .ds $COVER_DOCTYPE_SIZE_CHANGE \\$1
4260 .    if '\\$0'COVER_SUBTITLE_SIZE'          .ds $COVER_SUBTITLE_SIZE_CHANGE \\$1
4261 .    if '\\$0'COVER_TITLE_SIZE'             .ds $COVER_TITLE_SIZE_CHANGE \\$1
4262 .    if '\\$0'DOC_COVER_AUTHOR_SIZE'        .ds $DOC_COVER_AUTHOR_SIZE_CHANGE \\$1
4263 .    if '\\$0'DOC_COVER_CHAPTER_TITLE_SIZE' .ds $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
4264 .    if '\\$0'DOC_COVER_COPYRIGHT_SIZE'     .ds $DOC_COVER_COPYRIGHT_SIZE_CHANGE \\$1
4265 .    if '\\$0'DOC_COVER_DOCTYPE_SIZE'       .ds $DOC_COVER_DOCTYPE_SIZE_CHANGE \\$1
4266 .    if '\\$0'DOC_COVER_SUBTITLE_SIZE'      .ds $DOC_COVER_SUBTITLE_SIZE_CHANGE \\$1
4267 .    if '\\$0'DOC_COVER_TITLE_SIZE'         .ds $DOC_COVER_TITLE_SIZE_CHANGE \\$1
4268 .    if '\\$0'DOCTYPE_SIZE'                 .ds $DOCTYPE_SIZE_CHANGE \\$1
4269 .    if '\\$0'ENDNOTE_NUMBER_SIZE'          .ds $EN_NUMBER_SIZE_CHANGE \\$1
4270 .    if '\\$0'ENDNOTE_LINENUMBER_SIZE'      .ds $EN_LN_SIZE_CHANGE \\$1
4271 .    if '\\$0'ENDNOTE_STRING_SIZE'          .ds $EN_STRING_SIZE_CHANGE \\$1
4272 .    if '\\$0'ENDNOTE_TITLE_SIZE'           .ds $EN_TITLE_SIZE_CHANGE \\$1 
4273 .    if '\\$0'EPIGRAPH_SIZE'                .ds $EPI_SIZE_CHANGE \\$1
4274 .    if '\\$0'FOOTNOTE_SIZE'                .ds $FN_SIZE_CHANGE \\$1
4275 .    if '\\$0'HDRFTR_CENTER_SIZE'           .ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
4276 .    if '\\$0'HDRFTR_LEFT_SIZE'             .ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
4277 .    if '\\$0'HDRFTR_RIGHT_SIZE'            .ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
4278 .    if '\\$0'HDRFTR_SIZE'                  .ds $HDRFTR_SIZE_CHANGE \\$1
4279 .    if '\\$0'HEAD_SIZE'                    .ds $HEAD_SIZE_CHANGE \\$1
4280 .    if '\\$0'PAGENUM_SIZE'                 .ds $PAGE_NUM_SIZE_CHANGE \\$1
4281 .    if '\\$0'PARAHEAD_SIZE'                .ds $PH_SIZE_CHANGE \\$1
4282 .    if '\\$0'QUOTE_SIZE'                   .ds $QUOTE_SIZE_CHANGE \\$1
4283 .    if '\\$0'SUBHEAD_SIZE'                 .ds $SH_SIZE_CHANGE \\$1
4284 .    if '\\$0'SUBTITLE_SIZE'                .ds $SUBTITLE_SIZE_CHANGE \\$1
4285 .    if '\\$0'TITLE_SIZE'                   .ds $TITLE_SIZE_CHANGE \\$1
4286 .    if '\\$0'TOC_HEADER_SIZE'              .ds $TOC_HEADER_SIZE_CHANGE \\$1
4287 .    if '\\$0'TOC_HEAD_SIZE'                .ds $TOC_HEAD_SIZE_CHANGE \\$1
4288 .    if '\\$0'TOC_PARAHEAD_SIZE'            .ds $TOC_PH_SIZE_CHANGE \\$1
4289 .    if '\\$0'TOC_PN_SIZE'                  .ds $TOC_PN_SIZE_CHANGE \\$1
4290 .    if '\\$0'TOC_SUBHEAD_SIZE'             .ds $TOC_SH_SIZE_CHANGE \\$1
4291 .    if '\\$0'TOC_TITLE_SIZE'               .ds $TOC_TITLE_SIZE_CHANGE \\$1
4292 .END
4293 \#
4294 \#
4295 .MAC _COLOR END
4296 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
4297 .    if '\\$0'ATTRIBUTE_COLOR' \{\
4298 .       nr #ATTRIBUTE_COLOR 1
4299 .       ds $ATTRIBUTE_COLOR \\$1
4300 .    \}
4301 .    if '\\$0'AUTHOR_COLOR' \{\
4302 .       nr #AUTHOR_COLOR 1
4303 .       ds $AUTHOR_COLOR \\$1
4304 .    \}
4305 .    if '\\$0'BLOCKQUOTE_COLOR' \{\
4306 .       nr #BQUOTE_COLOR 1
4307 .       ds $BQUOTE_COLOR \\$1
4308 .    \}
4309 .    if '\\$0'CITATION_COLOR' \{\
4310 .       nr #BQUOTE_COLOR 1
4311 .       ds $BQUOTE_COLOR \\$1
4312 .    \}
4313 .    if '\\$0'CITE_COLOR' \{\
4314 .       nr #BQUOTE_COLOR 1
4315 .       ds $BQUOTE_COLOR \\$1
4316 .    \}
4317 .    if '\\$0'CHAPTER_TITLE_COLOR' \{\
4318 .       nr #CHAPTER_TITLE_COLOR 1
4319 .       ds $CHAPTER_TITLE_COLOR \\$1
4320 .    \}
4321 .    if '\\$0'COVER_ATTRIBUTE_COLOR' \{\
4322 .       nr #COVER_ATTRIBUTE_COLOR 1
4323 .       ds $COVER_ATTRIBUTE_COLOR \\$1
4324 .    \}
4325 .    if '\\$0'COVER_AUTHOR_COLOR' \{\
4326 .       nr #COVER_AUTHOR_COLOR 1
4327 .       ds $COVER_AUTHOR_COLOR \\$1
4328 .    \}
4329 .    if '\\$0'COVER_CHAPTER_TITLE_COLOR' \{\
4330 .       nr #COVER_CHAPTER_TITLE_COLOR 1
4331 .       ds $COVER_CHAPTER_TITLE_COLOR \\$1
4332 .    \}
4333 .    if '\\$0'COVER_COLOR' \{\
4334 .       nr #COVER_COLOR 1
4335 .       ds $COVER_COLOR \\$1
4336 .    \}
4337 .    if '\\$0'COVER_COPYRIGHT_COLOR' \{\
4338 .       nr #COVER_COPYRIGHT_COLOR 1
4339 .       ds $COVER_COPYRIGHT_COLOR \\$1
4340 .    \}
4341 .    if '\\$0'COVER_MISC_COLOR' \{\
4342 .       nr #COVER_MISC_COLOR 1
4343 .       ds $COVER_MISC_COLOR \\$1
4344 .    \}
4345 .    if '\\$0'COVER_TITLE_COLOR' \{\
4346 .       nr #COVER_TITLE_COLOR 1
4347 .       ds $COVER_TITLE_COLOR \\$1
4348 .    \}
4349 .    if '\\$0'COVER_SUBTITLE_COLOR' \{\
4350 .       nr #COVER_SUBTITLE_COLOR 1
4351 .       ds $COVER_SUBTITLE_COLOR \\$1
4352 .    \}
4353 .    if '\\$0'COVER_DOCTYPE_COLOR' \{\
4354 .       nr #COVER_DOCTYPE_COLOR 1
4355 .       ds $COVER_DOCTYPE_COLOR \\$1
4356 .    \}
4357 .    if '\\$0'DOC_COVER_ATTRIBUTE_COLOR' \{\
4358 .       nr #DOC_COVER_ATTRIBUTE_COLOR 1
4359 .       ds $DOC_COVER_ATTRIBUTE_COLOR \\$1
4360 .    \}
4361 .    if '\\$0'DOC_COVER_AUTHOR_COLOR' \{\
4362 .       nr #DOC_COVER_AUTHOR_COLOR 1
4363 .       ds $DOC_COVER_AUTHOR_COLOR \\$1
4364 .    \}
4365 .    if '\\$0'DOC_COVER_CHAPTER_TITLE_COLOR' \{\
4366 .       nr #DOC_COVER_CHAPTER_TITLE_COLOR 1
4367 .       ds $DOC_COVER_CHAPTER_TITLE_COLOR \\$1
4368 .    \}
4369 .    if '\\$0'DOC_COVER_COLOR' \{\
4370 .       nr #DOC_COVER_COLOR 1
4371 .       ds $DOC_COVER_COLOR \\$1
4372 .    \}
4373 .    if '\\$0'DOC_COVER_COPYRIGHT_COLOR' \{\
4374 .       nr #DOC_COVER_COPYRIGHT_COLOR 1
4375 .       ds $DOC_COVER_COPYRIGHT_COLOR \\$1
4376 .    \}
4377 .    if '\\$0'DOC_COVER_MISC_COLOR' \{\
4378 .       nr #DOC_COVER_MISC_COLOR 1
4379 .       ds $DOC_COVER_MISC_COLOR \\$1
4380 .    \}
4381 .    if '\\$0'DOC_COVER_TITLE_COLOR' \{\
4382 .       nr #DOC_COVER_TITLE_COLOR 1
4383 .       ds $DOC_COVER_TITLE_COLOR \\$1
4384 .    \}
4385 .    if '\\$0'DOC_COVER_SUBTITLE_COLOR' \{\
4386 .       nr #DOC_COVER_SUBTITLE_COLOR 1
4387 .       ds $DOC_COVER_SUBTITLE_COLOR \\$1
4388 .    \}
4389 .    if '\\$0'DOC_COVER_DOCTYPE_COLOR' \{\
4390 .       nr #DOC_COVER_DOCTYPE_COLOR 1
4391 .       ds $DOC_COVER_DOCTYPE_COLOR \\$1
4392 .    \}
4393 .    if '\\$0'DOCHEADER_COLOR' \{\
4394 .       nr #DOCHEADER_COLOR 1
4395 .       ds $DOCHEADER_COLOR \\$1
4396 .    \}
4397 .    if '\\$0'DOCTYPE_COLOR' \{\
4398 .       nr #DOCTYPE_COLOR 1
4399 .       ds $DOCTYPE_COLOR \\$1
4400 .    \}
4401 .    if '\\$0'EPIGRAPH_COLOR' \{\
4402 .       nr #EPI_COLOR 1
4403 .       ds $EPI_COLOR \\$1
4404 .    \}
4405 .    if '\\$0'FINIS_COLOR' \{\
4406 .       nr #FINIS_COLOR 1
4407 .       ds $FINIS_COLOR \\$1
4408 .    \}
4409 .    if '\\$0'FOOTNOTE_COLOR' \{\
4410 .       nr #FOOTNOTE_COLOR 1
4411 .       ds $FOOTNOTE_COLOR \\$1
4412 .    \}
4413 .    if '\\$0'HDRFTR_CENTER_COLOR' \{\
4414 .       nr #HDRFTR_CENTER_COLOR 1
4415 .       ds $HDRFTR_CENTER_COLOR \\$1
4416 .    \}
4417 .    if '\\$0'HDRFTR_COLOR' \{\
4418 .       nr #HDRFTR_COLOR 1
4419 .       ds $HDRFTR_COLOR \\$1
4420 .    \}
4421 .    if '\\$0'HDRFTR_LEFT_COLOR' \{\
4422 .       nr #HDRFTR_LEFT_COLOR 1
4423 .       ds $HDRFTR_LEFT_COLOR \\$1
4424 .    \}
4425 .    if '\\$0'HDRFTR_RIGHT_COLOR' \{\
4426 .       nr #HDRFTR_RIGHT_COLOR 1
4427 .       ds $HDRFTR_RIGHT_COLOR \\$1
4428 .    \}
4429 .    if '\\$0'HDRFTR_RULE_COLOR' \{\
4430 .       nr #HDRFTR_RULE_COLOR 1
4431 .       ds $HDRFTR_RULE_COLOR \\$1
4432 .    \}
4433 .    if '\\$0'HEAD_COLOR' \{\
4434 .       nr #HEAD_COLOR 1
4435 .       ds $HEAD_COLOR \\$1
4436 .    \}
4437 .    if '\\$0'LINEBREAK_COLOR' \{\
4438 .       nr #LINEBREAK_COLOR 1
4439 .       ds $LINEBREAK_COLOR \\$1
4440 .    \}
4441 .    if '\\$0'PAGENUM_COLOR' \{\
4442 .       nr #PAGE_NUM_COLOR 1
4443 .       ds $PAGENUM_COLOR \\$1
4444 .    \}
4445 .    if '\\$0'PARAHEAD_COLOR' \{\
4446 .       nr #PH_COLOR 1
4447 .       ds $PH_COLOR \\$1
4448 .    \}
4449 .    if '\\$0'QUOTE_COLOR' \{\
4450 .       nr #QUOTE_COLOR 1
4451 .       ds $QUOTE_COLOR \\$1
4452 .    \}
4453 .    if '\\$0'SUBHEAD_COLOR' \{\
4454 .       nr #SH_COLOR 1
4455 .       ds $SH_COLOR \\$1
4456 .    \}
4457 .    if '\\$0'SUBTITLE_COLOR' \{\
4458 .       nr #SUBTITLE_COLOR 1
4459 .       ds $SUBTITLE_COLOR \\$1
4460 .    \}
4461 .    if '\\$0'TITLE_COLOR' \{\
4462 .       nr #TITLE_COLOR 1
4463 .       ds $TITLE_COLOR \\$1
4464 .    \}
4465 .END
4466 \#
4467 \#
4468 .MAC _QUAD END
4469 .    if '\\$0'BIBLIOGRAPHY_QUAD' \{\
4470 .       ds $BIB_QUAD \\$1
4471 .       if '\\*[$BIB_QUAD]'R' .ab Fatal error: \\$0 must be set to either L or J
4472 .       if '\\*[$BIB_QUAD]'C' .ab Fatal error: \\$0 must be set to either L or J
4473 .    \}
4474 .    if '\\$0'BIBLIOGRAPHY_STRING_QUAD' .ds $BIB_STRING_QUAD \\$1
4475 .    if '\\$0'BLOCKQUOTE_QUAD'          .ds $BQUOTE_QUAD \\$1
4476 .    if '\\$0'CITATION_QUAD'            .ds $BQUOTE_QUAD \\$1
4477 .    if '\\$0'CITE_QUAD'                .ds $BQUOTE_QUAD \\$1
4478 .    if '\\$0'COVER_COPYRIGHT_QUAD'     .ds $COVER_COPYRIGHT_QUAD \\$1
4479 .    if '\\$0'COVER_MISC_QUAD'          .ds $COVER_MISC_QUAD \\$1
4480 .    if '\\$0'DOC_COVER_COPYRIGHT_QUAD' .ds $DOC_COVER_COPYRIGHT_QUAD \\$1
4481 .    if '\\$0'DOC_COVER_MISC_QUAD'      .ds $DOC_COVER_MISC_QUAD \\$1
4482 .    if '\\$0'DOC_QUAD' \{\
4483 .        ds $DOC_QUAD \\$1
4484 .        QUAD \\*[$DOC_QUAD]
4485 .    \}
4486 .    if '\\$0'ENDNOTE_QUAD' \{\
4487 .       ds $EN_QUAD \\$1
4488 .       if '\\*[$EN_QUAD]'R' .ab Fatal error: \\$0 must be set to either L or J
4489 .       if '\\*[$EN_QUAD]'C' .ab Fatal error: \\$0 must be set to either L or J
4490 .    \}
4491 .    if '\\$0'ENDNOTE_STRING_QUAD'      .ds $EN_STRING_QUAD \\$1
4492 .    if '\\$0'ENDNOTE_TITLE_QUAD'       .ds $EN_TITLE_QUAD \\$1
4493 .    if '\\$0'EPIGRAPH_QUAD'            .ds $EPI_QUAD \\$1
4494 .    if '\\$0'FOOTNOTE_QUAD'            .ds $FN_QUAD \\$1
4495 .    if '\\$0'HEAD_QUAD'                .ds $HEAD_QUAD \\$1
4496 .    if '\\$0'SUBHEAD_QUAD'             .ds $SH_QUAD \\$1
4497 .    if '\\$0'TOC_HEADER_QUAD'          .ds $TOC_HEADER_QUAD \\$1
4498 .END
4499 \#
4500 \#
4501 \# DEFAULTS
4502 \# --------
4503 \# *Arguments:
4504 \#   <none>
4505 \# *Function:
4506 \#   Sets up defaults if no values are entered prior to START.
4507 \# *Notes:
4508 \#   The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
4509 \#   $REVISION_STRING are in the COPYSTYLE macro.
4510 \#
4511 .MAC DEFAULTS END
4512 .    if !d$PAPER \{ .PAPER LETTER \}
4513 .    if !\\n[#DOC_TYPE]   \{ .DOCTYPE DEFAULT \}
4514 .    ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4515 .    el \{\
4516 .       if !\\n[#COPY_STYLE]=1 \{ .PAGENUM_STYLE DIGIT \}
4517 .    \}
4518 .    if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
4519 .    if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
4520 .    if \\n[#DOC_TYPE]=4 \{\
4521 .       if !\\n[#USER_SET_L_LENGTH] \{\
4522 .          R_MARGIN \\n[#R_MARGIN]u
4523 .          rr #USER_SET_L_LENGTH
4524 .       \}
4525 .       if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
4526 .    \}
4527 .    if \\n[#COPY_STYLE]=1 \{\
4528 .       COPYSTYLE DRAFT
4529 .       PAGENUMBER 1
4530 .    \}
4531 .    if !r#DOC_HEADER \{ .DOCHEADER  \}
4532 .    if !r#HEADERS_ON \{ .HEADERS    \}
4533 .    if !r#PAGINATE   \{ .PAGINATE   \}
4534 .    if \\n[#FOOTERS_ON] \{\
4535 .       HEADERS OFF
4536 .       if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
4537 .    \}
4538 .    if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
4539 .    if !r#HEADER_GAP    \{ .HEADER_GAP    3P    \}
4540 .    if \\n[#FOOTERS_ON] \{\
4541 .       if \\n[#PAGINATE]=0 \{\
4542 .          if !r#T_MARGIN \{ .T_MARGIN 6P \}
4543 .       \}
4544 .    \}
4545 .    if \\n[#HEADERS_ON]=0    \{\
4546 .       if \\n[#FOOTERS_ON]=0 \{\
4547 .          if !r#T_MARGIN \{ .T_MARGIN 6P \}
4548 .       \}
4549 .    \}
4550 .    if !r#T_MARGIN          \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
4551 .    if !r#DOCHEADER_ADVANCE \{ .nr #DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
4552 .    if !r#FOOTER_MARGIN     \{ .FOOTER_MARGIN 3P \}
4553 .    if !r#FOOTER_GAP        \{ .FOOTER_GAP    3P \}
4554 .    if !r#B_MARGIN          \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
4555 .    if (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
4556 .       tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
4557 .       tm1 "       No footers or bottom-of-page page numbers will be printed.
4558 .       tm1 "       Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
4559 .       tm1 "       If no footers or bottom-of-page page numbers are required,
4560 .       tm1 "       type in .FOOTER_MARGIN 0 before .START
4561 .    \}
4562 .    if !r#HDRFTR_RULE_GAP   \{\
4563 .       if \\n[#HEADERS_ON]  \{ .HDRFTR_RULE_GAP 4p \}
4564 .       if \\n[#FOOTERS_ON]  \{ .HDRFTR_RULE_GAP 4p \}
4565 .    \}
4566 .    if !r#HDRFTR_RULE       \{ .HDRFTR_RULE        \}
4567 .    if !r#PAGE_NUM_SET      \{ .PAGENUMBER 1       \}
4568 .\" Read in number registers and strings for type parameters
4569 .    nr #DOC_L_MARGIN \\n[#L_MARGIN]
4570 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
4571 .    nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
4572 .    ds $DOC_FAM      \\*[$FAMILY]
4573 .    nr #DOC_PT_SIZE  \\n[#PT_SIZE]
4574 .    nr #DOC_LEAD     \\n[#LEAD]
4575 .\" #SAVED_DOC_LEAD is set in COLLATE
4576 .    if r#SAVED_DOC_LEAD \{\
4577 .       if !\\n[#DOC_LEAD]=\\n[#SAVED_DOC_LEAD] \{ .nr #RERUN_TRAPS 1 \}
4578 .    \}
4579 .    ie \\n[#ADJ_DOC_LEAD]=1 \{ . \}
4580 .    el \{\
4581 .       if !\\n[#DOC_LEAD_ADJUST_OFF] \{\
4582 .          DOC_LEAD_ADJUST
4583 .       \}
4584 .    \}
4585 .    ds $DOC_QUAD     \\*[$QUAD_VALUE]
4586 .    ds $PP_FT        \\*[$FONT]
4587 .\" Counters
4588 .    nr #PP 0
4589 .    nr #FN_NUMBER 0 1
4590 .    nr #EN_NUMBER 0 1
4591 .    nr #FN_COUNT_FOR_COLS 0 1
4592 .    nr #DONE_ONCE 0 1
4593 .    RESET_HEAD_NUMBER
4594 .    RESET_SUBHEAD_NUMBER
4595 .    RESET_PARAHEAD_NUMBER
4596 .\" General style defaults for both PRINTSTYLEs
4597 .    nr #PP_STYLE 1
4598 .    PARA_INDENT \\n[#PP_INDENT]u
4599 .    if !d$HDRFTR_FAM           \{ .HDRFTR_FAMILY  \\*[$DOC_FAM] \}
4600 .    if !d$HDRFTR_SIZE_CHANGE   \{ .HDRFTR_SIZE    +0            \}
4601 .    if !d$PAGE_NUM_FAM         \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
4602 .    if !d$PAGE_NUM_FT          \{ .PAGENUM_FONT   R             \}
4603 .    if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE   +0            \}
4604 .    if !r#PAGE_NUM_POS_SET     \{ .PAGENUM_POS BOTTOM CENTER    \}
4605 .    ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
4606 .       if \\n[#PAGE_NUM_HYPHENS]=0  \{ .PAGENUM_HYPHENS OFF \}
4607 .       if \\n[#PAGE_NUM_HYPHENS]=1  \{ .PAGENUM_HYPHENS     \}
4608 .    \}
4609 .    el \{ .PAGENUM_HYPHENS \}
4610 .    if !d$HEAD_QUAD         \{ .HEAD_QUAD CENTER  \}
4611 .    if !r#HEAD_CAPS         \{ .HEAD_CAPS         \}
4612 .    if !r#HEAD_UNDERLINE    \{ .HEAD_UNDERLINE    \}
4613 .    if !d$SH_QUAD           \{ .SUBHEAD_QUAD LEFT \}
4614 .    if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
4615 .    if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
4616 .       if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
4617 .    \}
4618 .    if !d$FN_FAM               \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM]      \}
4619 .    if !d$FN_FT                \{ .FOOTNOTE_FONT R                    \}
4620 .    if !d$FN_QUAD              \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD]       \}
4621 .    if !r#FN_RULE              \{ .FOOTNOTE_RULE                      \}
4622 .    if !r#FN_MARKERS           \{ .FOOTNOTE_MARKERS                   \}
4623 .    if !\\n[#FN_MARKER_STYLE]  \{ .FOOTNOTE_MARKER_STYLE STAR         \}
4624 .    if !\\n[#EN_MARKER_STYLE]  \{ .ENDNOTE_MARKER_STYLE NUMBER        \}
4625 .    if !d$EN_PN_STYLE          \{ .ENDNOTES_PAGENUM_STYLE digit       \}
4626 .    if !d$EN_FAM               \{ .ENDNOTE_FAMILY \\*[$DOC_FAM]       \}
4627 .    if !d$EN_FT                \{ .ENDNOTE_FONT R                     \}
4628 .    if !d$EN_QUAD              \{ .ENDNOTE_QUAD \\*[$DOC_QUAD]        \}
4629 .    if !d$EN_STRING            \{ .ENDNOTE_STRING "Endnotes"          \}
4630 .    if !d$EN_STRING_FAM        \{ .ENDNOTE_STRING_FAMILY \\*[$EN_FAM] \}
4631 .    if !d$EN_STRING_QUAD       \{ .ENDNOTE_STRING_QUAD CENTER         \}
4632 .    if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2        \}
4633 .    if !r#EN_STRING_CAPS       \{ .ENDNOTE_STRING_CAPS                \}
4634 .    if !d$EN_TITLE \{\
4635 .       ie \\n[#DOC_TYPE]=2 \{\
4636 .          ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
4637 .          el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"    \}
4638 .       \}
4639 .       el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
4640 .    \}
4641 .    if !d$EN_TITLE_FAM          \{ .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM]  \}
4642 .    if !d$EN_TITLE_QUAD         \{ .ENDNOTE_TITLE_QUAD LEFT            \}
4643 .    if !r#EN_TITLE_UNDERSCORE   \{ .ENDNOTE_TITLE_UNDERSCORE           \}
4644 .    if !d$EN_NUMBER_FAM         \{ .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] \}
4645 .    if !r#EN_NUMBERS_ALIGN_LEFT \{\
4646 .       if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2  \}
4647 .    \}
4648 .    if !d$EN_LN_GAP             \{ .ENDNOTE_LINENUMBER_GAP 1.5n              \}
4649 .    if !d$BIB_PN_STYLE          \{ .BIBLIOGRAPHY_PAGENUM_STYLE digit         \}
4650 .    if !d$BIB_FAM               \{ .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM]        \}
4651 .    if !d$BIB_FT                \{ .BIBLIOGRAPHY_FONT R                      \}
4652 .    if !d$BIB_QUAD              \{ .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD]         \}
4653 .    if !d$BIB_STRING            \{ .BIBLIOGRAPHY_STRING "Bibliography"       \}
4654 .    if !d$BIB_STRING_FAM        \{ .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FAM] \}
4655 .    if !d$BIB_STRING_QUAD       \{ .BIBLIOGRAPHY_STRING_QUAD CENTER          \}
4656 .    if !r#BIB_STRING_UNDERSCORE \{ .BIBLIOGRAPHY_STRING_UNDERSCORE 2         \}
4657 .    if !r#BIB_STRING_CAPS       \{ .BIBLIOGRAPHY_STRING_CAPS                 \}
4658 .    if !d$TOC_HEADER_STRING     \{ .TOC_HEADER_STRING "Contents"  \}
4659 .    if !d$TOC_HEADER_QUAD       \{ .TOC_HEADER_QUAD LEFT          \}
4660 .    if !d$TOC_PN_STYLE          \{ .TOC_PAGENUM_STYLE roman       \}
4661 .    if !r#TOC_PN_PADDING        \{ .TOC_PADDING   3               \}
4662 .    if !r#TOC_TITLE_INDENT      \{ .TOC_TITLE_INDENT    0         \}
4663 .    if !r#TOC_HEAD_INDENT       \{ .TOC_HEAD_INDENT     18p       \}
4664 .    if !r#TOC_SH_INDENT         \{ .TOC_SUBHEAD_INDENT  30p       \}
4665 .    if !r#TOC_PH_INDENT         \{ .TOC_PARAHEAD_INDENT 42p       \}
4666 .\" String defaults for both PRINTSTYLEs
4667 .    ie \\n[#DOC_TYPE]=1 \{\
4668 .       ie '\\*[$DOC_TITLE]'' \{\
4669 .          if \\n[#USER_DEF_HDRFTR_LEFT]=0  .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
4670 .          rr #USER_DEF_HDRFTR_LEFT
4671 .          if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
4672 .          rr #USER_DEF_HDRFTR_RIGHT
4673 .       \}
4674 .       el \{\
4675 .          if \\n[#COPY_STYLE]=1 \{ .DRAFT_WITH_PAGENUMBER \}
4676 .          if \\n[#USER_DEF_HDRFTR_LEFT]=0   .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
4677 .          rr #USER_DEF_HDRFTR_LEFT
4678 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 .ds $HDRFTR_CENTER \\*[$TITLE]
4679 .          rr #USER_DEF_HDRFTR_CENTER
4680 .          if \\n[#USER_DEF_HDRFTR_RIGHT]=0  .ds $HDRFTR_RIGHT \\*[$DOC_TITLE]
4681 .          rr #USER_DEF_HDRFTR_RIGHT
4682 .       \}
4683 .    \}
4684 .    el \{\
4685 .       if \\n[#USER_DEF_HDRFTR_LEFT]=0  .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
4686 .       rr #USER_DEF_HDRFTR_LEFT
4687 .       if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
4688 .       rr #USER_DEF_HDRFTR_RIGHT
4689 .    \}
4690 .    if !d$ATTRIBUTE_STRING         \{ .ATTRIBUTE_STRING "by" \}
4691 .    if !d$FINIS_STRING             \{ .FINIS_STRING "END"    \}
4692 .\" Covers
4693 .    if !r#DOC_COVERS_OFF           \{ .nr #DOC_COVERS 1           \}
4694 .    if !r#COVERS_OFF               \{ .nr #COVERS 1               \}
4695 .    if !d$COVER_COPYRIGHT_QUAD     \{ .COVER_COPYRIGHT_QUAD R     \}
4696 .    if !d$COVER_MISC_QUAD          \{ .COVER_MISC_QUAD L          \}
4697 .    if !d$DOC_COVER_COPYRIGHT_QUAD \{ .DOC_COVER_COPYRIGHT_QUAD R \}
4698 .    if !d$DOC_COVER_MISC_QUAD      \{ .DOC_COVER_MISC_QUAD L      \}
4699 .\" Defaults for printstyle TYPEWRITE
4700 .    if \\n[#PRINT_STYLE]=1 \{\
4701 .       if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES         \}
4702 .       if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF     \}
4703 .\" +Quotes and blockquotes
4704 .       if !r#Q_OFFSET_VALUE        \{ .QUOTE_INDENT      2      \}
4705 .\" +Epigraphs
4706 .       if !r#EPI_OFFSET_VALUE      \{ .EPIGRAPH_INDENT   2      \}
4707 .\" +Linebreaks
4708 .       if !d$LINEBREAK_CHAR        \{ .LINEBREAK_CHAR    * 3 2p \}
4709 .\" +Footnotes
4710 .       if !d$FN_SIZE_CHANGE        \{ .FOOTNOTE_SIZE     +0     \}
4711 .       if !r#FN_RULE_LENGTH        \{ .FOOTNOTE_RULE_LENGTH 2i  \}
4712 .\" +Paragraph heads
4713 .       if !r#PH_INDENT    \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
4714 .\" +Endnotes
4715 .       if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
4716 .\" +Footnotes
4717 .       if !r#FN_RULE_ADJ           \{ .FOOTNOTE_RULE_ADJ  6p    \}
4718 .\" +Slant stuff
4719 .       if !r#SLANT_MEANS_SLANT \{\
4720 .          ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
4721 .          el \{ .UNDERLINE_SLANT OFF \}
4722 .       \}
4723 .    \}
4724 .\" Defaults for printstyle TYPESET
4725 .    if \\n[#PRINT_STYLE]=2 \{\
4726 .       if !d$DOCHEADER_LEAD_ADJ \{\
4727 .          ie !'\\*[$CHAPTER_TITLE]'' \{\
4728 .             ie !'\\*[$CHAPTER_STRING]'' \{\
4729 .                DOCHEADER_LEAD +4
4730 .             \}
4731 .             el \{ .DOCHEADER_LEAD +0 \}
4732 .          \}
4733 .          el \{ .DOCHEADER_LEAD +0 \}
4734 .       \}
4735 .\" +Cover
4736 .       if !d$COVER_LEAD_ADJ \{ .COVER_LEAD +0 \}
4737 .       if !d$COVER_FAM \{ .COVER_FAMILY \\*[$DOC_FAM] \}
4738 .\" (title)
4739 .       if !d$COVER_TITLE_FAM \{\
4740 .          ie !d$COVER_FAM \{ .COVER_TITLE_FAMILY \\*[$DOC_FAM] \}
4741 .          el            \{ .COVER_TITLE_FAMILY \\*[$COVER_FAM] \}
4742 .       \}
4743 .       if !d$COVER_TITLE_FT          \{ .COVER_TITLE_FONT B    \}
4744 .       if !d$COVER_TITLE_SIZE_CHANGE \{ .COVER_TITLE_SIZE +3.5 \}
4745 .\" (chapter title)
4746 .       if !d$COVER_CHAPTER_TITLE_FAM \{\
4747 .          ie !d$COVER_FAM \{ .COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
4748 .          el            \{ .COVER_CHAPTER_TITLE_FAMILY \\*[$COVER_FAM] \}
4749 .       \}
4750 .       if !d$COVER_CHAPTER_TITLE_FT          \{ .COVER_CHAPTER_TITLE_FONT BI \}
4751 .       if !d$COVER_CHAPTER_TITLE_SIZE_CHANGE \{ .COVER_CHAPTER_TITLE_SIZE +4 \}
4752 .\" (subtitle)
4753 .       if !d$COVER_SUBTITLE_FAM \{\
4754 .          ie !d$COVER_FAM \{ .COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] \}
4755 .          el            \{ .COVER_SUBTITLE_FAMILY \\*[$COVER_FAM] \}
4756 .       \}
4757 .       if !d$COVER_SUBTITLE_FT          \{ .COVER_SUBTITLE_FONT R  \}
4758 .       if !d$COVER_SUBTITLE_SIZE_CHANGE \{ .COVER_SUBTITLE_SIZE +0 \}
4759 .\" (attribution and author[s])
4760 .       if !d$COVER_AUTHOR_FAM \{\
4761 .          ie !d$COVER_FAM \{ .COVER_AUTHOR_FAMILY \\*[$DOC_FAM] \}
4762 .          el      \{ .COVER_AUTHOR_FAMILY \\*[$COVER_FAM] \}
4763 .       \}
4764 .       if !d$COVER_AUTHOR_FT          \{ .COVER_AUTHOR_FONT I  \}
4765 .       if !d$COVER_AUTHOR_SIZE_CHANGE \{ .COVER_AUTHOR_SIZE +0 \}
4766 .\" (doctype if "named")
4767 .       if !d$COVER_DOCTYPE_FAM \{\
4768 .          ie !d$COVER_FAM \{ .COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] \}
4769 .          el            \{ .COVER_DOCTYPE_FAMILY \\*[$COVER_FAM] \}
4770 .       \}
4771 .       if !d$COVER_DOCTYPE_FT          \{ .COVER_DOCTYPE_FONT BI \}
4772 .       if !d$COVER_DOCTYPE_SIZE_CHANGE \{ .COVER_DOCTYPE_SIZE +3 \}
4773 .\" (copyright)
4774 .       if !d$COVER_COPYRIGHT_FAM \{\
4775 .          ie !d$COVER_FAM \{ .COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] \}
4776 .          el            \{ .COVER_COPYRIGHT_FAMILY \\*[$COVER_FAM] \}
4777 .       \}
4778 .       if !d$COVER_COPYRIGHT_FT          \{ .COVER_COPYRIGHT_FONT R  \}
4779 .       if !d$COVER_COPYRIGHT_SIZE_CHANGE \{ .COVER_COPYRIGHT_SIZE -2 \}
4780 .\" +Doc cover
4781 .       if !d$DOC_COVER_LEAD_ADJ \{ .DOC_COVER_LEAD +0 \}
4782 .       if !d$DOC_COVER_FAM \{ .DOC_COVER_FAMILY \\*[$DOC_FAM] \}
4783 .\" (title)
4784 .       if !d$DOC_COVER_TITLE_FAM \{\
4785 .          ie !d$DOC_COVER_FAM \{ .DOC_COVER_TITLE_FAMILY \\*[$DOC_FAM] \}
4786 .          el            \{ .DOC_COVER_TITLE_FAMILY \\*[$DOC_COVER_FAM] \}
4787 .       \}
4788 .       if !d$DOC_COVER_TITLE_FT          \{ .DOC_COVER_TITLE_FONT B    \}
4789 .       if !d$DOC_COVER_TITLE_SIZE_CHANGE \{ .DOC_COVER_TITLE_SIZE +3.5 \}
4790 .\" (chapter title)
4791 .       if !d$DOC_COVER_CHAPTER_TITLE_FAM \{\
4792 .          ie !d$DOC_COVER_FAM \{ .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
4793 .          el            \{ .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_COVER_FAM] \}
4794 .       \}
4795 .       if !d$DOC_COVER_CHAPTER_TITLE_FT          \{ .DOC_COVER_CHAPTER_TITLE_FONT BI \}
4796 .       if !d$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \{ .DOC_COVER_CHAPTER_TITLE_SIZE +4 \}
4797 .\" (subtitle)
4798 .       if !d$DOC_COVER_SUBTITLE_FAM \{\
4799 .          ie !d$DOC_COVER_FAM \{ .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] \}
4800 .          el            \{ .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_COVER_FAM] \}
4801 .       \}
4802 .       if !d$DOC_COVER_SUBTITLE_FT          \{ .DOC_COVER_SUBTITLE_FONT R  \}
4803 .       if !d$DOC_COVER_SUBTITLE_SIZE_CHANGE \{ .DOC_COVER_SUBTITLE_SIZE +0 \}
4804 .\" (attribution and author[s])
4805 .       if !d$DOC_COVER_AUTHOR_FAM \{\
4806 .          ie !d$DOC_COVER_FAM \{ .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_FAM] \}
4807 .          el            \{ .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_COVER_FAM] \}
4808 .       \}
4809 .       if !d$DOC_COVER_AUTHOR_FT          \{ .DOC_COVER_AUTHOR_FONT I  \}
4810 .       if !d$DOC_COVER_AUTHOR_SIZE_CHANGE \{ .DOC_COVER_AUTHOR_SIZE +0 \}
4811 .\" (doctype if "named")
4812 .       if !d$DOC_COVER_DOCTYPE_FAM \{\
4813 .          ie !d$DOC_COVER_FAM \{ .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] \}
4814 .          el            \{ .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_COVER_FAM] \}
4815 .       \}
4816 .       if !d$DOC_COVER_DOCTYPE_FT          \{ .DOC_COVER_DOCTYPE_FONT BI \}
4817 .       if !d$DOC_COVER_DOCTYPE_SIZE_CHANGE \{ .DOC_COVER_DOCTYPE_SIZE +3 \}
4818 .\" (copyright)
4819 .       if !d$DOC_COVER_COPYRIGHT_FAM \{\
4820 .          ie !d$DOC_COVER_FAM \{ .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] \}
4821 .          el            \{ .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_COVER_FAM] \}
4822 .       \}
4823 .       if !d$DOC_COVER_COPYRIGHT_FT          \{ .DOC_COVER_COPYRIGHT_FONT R  \}
4824 .       if !d$DOC_COVER_COPYRIGHT_SIZE_CHANGE \{ .DOC_COVER_COPYRIGHT_SIZE -2 \}
4825 .\" +Docheader
4826 .       if !d$DOCHEADER_FAM \{ .DOCHEADER_FAMILY \\*[$DOC_FAM] \}
4827 .       if !d$TITLE_FAM \{\
4828 .          ie !d$DOCHEADER_FAM \{ .TITLE_FAMILY \\*[$DOC_FAM]       \}
4829 .          el                  \{ .TITLE_FAMILY \\*[$DOCHEADER_FAM] \}
4830 .       \}
4831 .       if !d$TITLE_FT \{ .TITLE_FONT B \}
4832 .       if !d$TITLE_SIZE_CHANGE \{\
4833 .          ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
4834 .          el \{ .TITLE_SIZE +3.5 \}
4835 .       \}
4836 .       if !d$CHAPTER_TITLE_FAM \{\
4837 .          ie !d$DOCHEADER_FAM \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM]       \}
4838 .          el                  \{ .CHAPTER_TITLE_FAMILY \\*[$DOCHEADER_FAM] \}
4839 .       \}
4840 .       if !d$CHAPTER_TITLE_FT          \{ .CHAPTER_TITLE_FONT   BI \}
4841 .       if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE  +4  \}
4842 .       if !d$SUBTITLE_FAM \{\
4843 .          ie !d$DOCHEADER_FAM \{ .SUBTITLE_FAMILY \\*[$DOC_FAM]       \}
4844 .          el                  \{ .SUBTITLE_FAMILY \\*[$DOCHEADER_FAM] \}
4845 .       \}
4846 .       if !d$SUBTITLE_FT          \{ .SUBTITLE_FONT      R  \}
4847 .       if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE     +0  \}
4848 .       if !d$AUTHOR_FAM \{\
4849 .          ie !d$DOCHEADER_FAM \{ .AUTHOR_FAMILY \\*[$DOC_FAM]       \}
4850 .          el                  \{ .AUTHOR_FAMILY \\*[$DOCHEADER_FAM] \}
4851 .       \}
4852 .       if !d$AUTHOR_FT          \{ .AUTHOR_FONT  I \}
4853 .       if !d$AUTHOR_SIZE_CHANGE \{ .AUTHOR_SIZE +0 \}
4854 .       if !d$DOCTYPE_FAM \{\
4855 .          ie !d$DOCHEADER_FAM \{ .DOCTYPE_FAMILY \\*[$DOC_FAM]       \}
4856 .          el                  \{ .DOCTYPE_FAMILY \\*[$DOCHEADER_FAM] \}
4857 .       \}
4858 .       if !d$DOCTYPE_FT           \{ .DOCTYPE_FONT       BI \}
4859 .       if !d$DOCTYPE_SIZE_CHANGE  \{ .DOCTYPE_SIZE       +3 \}
4860 .\" +Headers and footers
4861 .       if !d$HDRFTR_LEFT_FAM      \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
4862 .       if !d$HDRFTR_LEFT_FT       \{ .HDRFTR_LEFT_FONT R               \}
4863 .       if \\n[#HDRFTR_LEFT_CAPS]  \{\
4864 .          if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE  -2 \}
4865 .       \}
4866 .       if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE     -.5           \}
4867 .       if !d$HDRFTR_CENTER_FAM       \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
4868 .       if !d$HDRFTR_CENTER_FT        \{ .HDRFTR_CENTER_FONT   I             \}
4869 .       if \\n[#HDRFTR_CENTER_CAPS] \{\
4870 .          if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
4871 .       \}
4872 .       if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5            \}
4873 .       if !d$HDRFTR_RIGHT_FAM          \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] \}
4874 .       if !d$HDRFTR_RIGHT_FT           \{ .HDRFTR_RIGHT_FONT   R             \}
4875 .       if \\n[#HDRFTR_RIGHT_CAPS] \{\
4876 .          if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
4877 .       \}
4878 .       if !d$HDRFTR_RIGHT_SIZE_CHANGE  \{ .HDRFTR_RIGHT_SIZE  -.5              \}
4879 .\" +Heads
4880 .       if !d$HEAD_FAM                  \{ .HEAD_FAMILY        \\*[$DOC_FAM]    \}
4881 .       if !d$HEAD_FT                   \{ .HEAD_FONT          B                \}
4882 .       if !d$HEAD_SIZE_CHANGE          \{ .HEAD_SIZE          +1               \}
4883 .       if !r#HEAD_SPACE                \{ .HEAD_SPACE                          \}
4884 .\" +Subheads
4885 .       if !d$SH_FAM                    \{ .SUBHEAD_FAMILY     \\*[$DOC_FAM]    \}
4886 .       if !d$SH_FT                     \{ .SUBHEAD_FONT       B                \}
4887 .       if !d$SH_SIZE_CHANGE            \{ .SUBHEAD_SIZE       +.5              \}
4888 .\" +Paragraph heads
4889 .       if !d$PH_FAM                    \{ .PARAHEAD_FAMILY    \\*[$DOC_FAM]    \}
4890 .       if !d$PH_FT                     \{ .PARAHEAD_FONT      BI               \}
4891 .       if !d$PH_SIZE_CHANGE            \{ .PARAHEAD_SIZE      -.25             \}
4892 .       if !r#PH_INDENT                 \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
4893 .\" +Quotes
4894 .       if !d$QUOTE_FAM                 \{ .QUOTE_FAMILY       \\*[$DOC_FAM]    \}
4895 .       if !d$QUOTE_FT                  \{ .QUOTE_FONT         I                \}
4896 .       if !d$QUOTE_SIZE_CHANGE         \{ .QUOTE_SIZE         +0               \}
4897 .       if !r#Q_OFFSET_VALUE            \{ .QUOTE_INDENT       3                \}
4898 .\" +Blockquotes
4899 .\"  Note: the leading for quotes and blockquotes is set after .DEFAULTS in START
4900 .       if !d$BQUOTE_FAM                \{ .BLOCKQUOTE_FAMILY  \\*[$DOC_FAM]    \}
4901 .       if !d$BQUOTE_FT                 \{ .BLOCKQUOTE_FONT    R                \}
4902 .       if !d$BQUOTE_SIZE_CHANGE        \{ .BLOCKQUOTE_SIZE    -1               \}
4903 .       if !d$BQUOTE_QUAD               \{ .BLOCKQUOTE_QUAD    LEFT             \}
4904 .\" +Epigraphs
4905 .       if !d$EPI_FAM                   \{ .EPIGRAPH_FAMILY    \\*[$DOC_FAM]    \}
4906 .       if !d$EPI_FT                    \{ .EPIGRAPH_FONT      R                \}
4907 .       if !d$EPI_SIZE_CHANGE           \{ .EPIGRAPH_SIZE      -1.5             \}
4908 .       if !r#EPI_AUTOLEAD              \{ .EPIGRAPH_AUTOLEAD  2                \}
4909 .       if !d$EPI_QUAD                  \{ .EPIGRAPH_QUAD      \\*[$DOC_QUAD]   \}
4910 .       if !r#EPI_OFFSET_VALUE          \{ .EPIGRAPH_INDENT    3                \}
4911 .\" +Linebreaks
4912 .       if !d$LINEBREAK_CHAR            \{ .LINEBREAK_CHAR     * 3 3p           \}
4913 .\" +Footnotes
4914 .       if !r#FN_RULE_LENGTH            \{ .FOOTNOTE_RULE_LENGTH 4P             \}
4915 .       if !r#FN_RULE_ADJ               \{ .FOOTNOTE_RULE_ADJ  3p               \}
4916 .       if !d$FN_SIZE_CHANGE            \{ .FOOTNOTE_SIZE      -2               \}
4917 .       if !r#FN_AUTOLEAD               \{ .FOOTNOTE_AUTOLEAD  2                \}
4918 .\" +Endnotes
4919 .       if !r#EN_PS                     \{ .ENDNOTE_PT_SIZE \\n[#DOC_PT_SIZE]u  \}
4920 .       if !d$EN_STRING_FT              \{ .ENDNOTE_STRING_FONT B               \}
4921 .       if !d$EN_STRING_SIZE_CHANGE     \{ .ENDNOTE_STRING_SIZE +1              \}
4922 .       if !d$EN_TITLE_FT               \{ .ENDNOTE_TITLE_FONT  B               \}
4923 .       if !d$EN_TITLE_SIZE_CHANGE      \{ .ENDNOTE_TITLE_SIZE  +0              \}
4924 .       if !d$EN_NUMBER_FT              \{ .ENDNOTE_NUMBER_FONT B               \}
4925 .       if !d$EN_NUMBER_SIZE_CHANGE     \{ .ENDNOTE_NUMBER_SIZE +0              \}
4926 .       if !r#EN_PP_INDENT              \{ .ENDNOTE_PARA_INDENT 1.5m            \}
4927 .\" +Bibliography
4928 .       if !r#BIB_LIST                  \{ .BIBLIOGRAPHY_TYPE LIST .                \}
4929 .       if !r#BIB_PS                    \{ .BIBLIOGRAPHY_PT_SIZE \\n[#DOC_PT_SIZE]u \}
4930 .       if !d$BIB_STRING_FT             \{ .BIBLIOGRAPHY_STRING_FONT B              \}
4931 .       if !d$BIB_STRING_SIZE_CHANGE    \{ .BIBLIOGRAPHY_STRING_SIZE +1             \}
4932 .\" +Table of contents
4933 .       if !d$TOC_FAM                   \{ .TOC_FAMILY  \\*[$DOC_FAM]           \}
4934 .       if !r#TOC_PS                    \{ .TOC_PT_SIZE \\n[#DOC_PT_SIZE]u      \}
4935 .       if !r#TOC_LEAD                  \{ .TOC_LEAD    \\n[#DOC_LEAD]u ADJUST  \}
4936 .       if !d$TOC_HEADER_FAM            \{ .TOC_HEADER_FAMILY \\*[$TOC_FAM]     \}
4937 .       if !d$TOC_HEADER_SIZE_CHANGE    \{ .TOC_HEADER_SIZE +4                  \}
4938 .       if !d$TOC_HEADER_FT             \{ .TOC_HEADER_FONT  B                  \}
4939 .       if !d$TOC_TITLE_FAM             \{ .TOC_TITLE_FAMILY \\*[$TOC_FAM]      \}
4940 .       if !d$TOC_PN_FAM                \{ .TOC_PN_FAMILY    \\*[$TOC_FAM]      \}
4941 .       if !d$TOC_HEAD_FAM              \{ .TOC_HEAD_FAMILY  \\*[$TOC_FAM]      \}
4942 .       if !d$TOC_SH_FAM                \{ .TOC_SUBHEAD_FAMILY  \\*[$TOC_FAM]   \}
4943 .       if !d$TOC_PH_FAM                \{ .TOC_PARAHEAD_FAMILY \\*[$TOC_FAM]   \}
4944 .       if !d$TOC_TITLE_FT              \{ .TOC_TITLE_FONT    BI                \}
4945 .       if !d$TOC_PN_FT                 \{ .TOC_PN_FONT       R                 \}
4946 .       if !d$TOC_HEAD_FT               \{ .TOC_HEAD_FONT     B                 \}
4947 .       if !d$TOC_SH_FT                 \{ .TOC_SUBHEAD_FONT  R                 \}
4948 .       if !d$TOC_PH_FT                 \{ .TOC_PARAHEAD_FONT I                 \}
4949 .       if !d$TOC_TITLE_SIZE_CHANGE     \{ .TOC_TITLE_SIZE    +.5               \}
4950 .       if !d$TOC_PN_SIZE_CHANGE        \{ .TOC_PN_SIZE       +0                \}
4951 .       if !d$TOC_HEAD_SIZE_CHANGE      \{ .TOC_HEAD_SIZE     +.5               \}
4952 .       if !d$TOC_SH_SIZE_CHANGE        \{ .TOC_SUBHEAD_SIZE  +0                \}
4953 .       if !d$TOC_PH_SIZE_CHANGE        \{ .TOC_PARAHEAD_SIZE +0                \}
4954 .    \}
4955 .\" +Refer support
4956 .    if !r#ENDNOTE_REFS \{ .nr #FN_REFS 1 \} 
4957 .    if '\\*[$REF_FN_INDENT]'' \{\
4958 .       if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS FOOTNOTE 2m   \}
4959 .       if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS FOOTNOTE 1.5m \}
4960 .    \}
4961 .    if '\\*[$REF_EN_INDENT]'' \{\
4962 .       if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS ENDNOTE 2m   \}
4963 .       if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS ENDNOTE 1.5m \}
4964 .    \}
4965 .    if '\\*[$REF_BIB_INDENT]'' \{\
4966 .       if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS BIBLIO 2m    \}
4967 .       if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS BIBLIO 1.5m  :\}
4968 .    \}
4969 .\" Adjust doc leading for PRINTSTYLE TYPESET
4970 .    if \\n[#PRINT_STYLE]=2 \{\
4971 .       ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
4972 .       el \{ . \}
4973 .    \}
4974 .\" This diversion is to get a value for #FN_AUTOLEAD
4975 .    di NULL
4976 .       ev NULL
4977 .       if \\n[#PRINT_STYLE]=1 \{\
4978 .          ps 12
4979 .          ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
4980 .          el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
4981 .       \}
4982 .       if \\n[#PRINT_STYLE]=2 \{\
4983 .          PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
4984 .          AUTOLEAD \\n[#FN_AUTOLEAD]
4985 .       \}
4986 .       nr #FN_LEAD \\n[#LEAD]
4987 .       if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u \}
4988 .       ev
4989 .    di
4990 .    ie !\\n[#COLLATE] \{\
4991 .\" DOC_LEAD adjusted (or not) here
4992 .       TRAPS
4993 .       rr #DOC_LEAD_ADJUST_OFF
4994 .\" Endnote, bibliography and toc leading
4995 .       nr #OK_PROCESS_LEAD 1
4996 .       nr #RESTORE_DOC_LEAD \\n(.v
4997 .       nr #RESTORE_B_MARGIN \\n[#B_MARGIN]
4998 .       if \\n[#PRINT_STYLE]=1 \{\
4999 .          ie \\n[#SINGLE_SPACE] \{\
5000 .             ENDNOTE_LEAD 12 ADJUST
5001 .             BIBLIOGRAPHY_LEAD 12 ADJUST
5002 .          \}
5003 .          el \{\
5004 .             ie \\n[#EN_SINGLESPACE] \{ .ENDNOTE_LEAD 12 ADJUST \}
5005 .             el \{ .ENDNOTE_LEAD 24 ADJUST \}
5006 .             ie \\n[#BIB_SINGLESPACE] \{ .BIBLIOGRAPHY_LEAD 12 ADJUST \}
5007 .             el \{ .BIBLIOGRAPHY_LEAD 24 ADJUST \}
5008 .          \}
5009 .       \}
5010 .       if \\n[#PRINT_STYLE]=2 \{\
5011 .          ie !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
5012 .          el \{ .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] \}
5013 .          ie !d$BIB_LEAD \{ .BIBLIOGRAPHY_LEAD 14 ADJUST \}
5014 .          el \{ .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD] \}
5015 .          ie !d$TOC_LEAD \{ .TOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
5016 .          el \{ .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] \}
5017 .          rm $ADJUST_EN_LEAD
5018 .          rm $ADJUST_BIB_LEAD
5019 .          rm $ADJUST_TOC_LEAD
5020 .       \}
5021 .       ie !d$BIB_SPACE \{ .BIBLIOGRAPHY_SPACING 1v \}
5022 .       el \{\
5023 .          if \\n[#DEFER_BIB_SPACING]=1 \{\
5024 .             BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE]
5025 .             rr #DEFER_BIB_SPACING
5026 .          \}
5027 .       \}
5028 .       DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
5029 .       nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
5030 .    \}
5031 .    el \{\
5032 .       if \\n[#COLLATE] \{\
5033 .          if !\\n[#PRINT_STYLE]=1 \{\
5034 .             if \\n[#RERUN_TRAPS] \{ .TRAPS \}
5035 .          \}
5036 .       \}
5037 .    \}
5038 .    if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
5039 .END
5040 \#
5041 \# ====================================================================
5042 \#
5043 \# +++START THE DOCUMENT+++
5044 \#
5045 \# THE START MACRO
5046 \# ---------------
5047 \# *Arguments:
5048 \#   <none>
5049 \# *Function:
5050 \#   Reads in default document style parameters and any parameter
5051 \#   the user has changed before issuing START.
5052 \#   Using the information gathered in the opening macros,
5053 \#   prints appropriate title (or chapter #), subtitle, author
5054 \#   and document type (if appropriate).
5055 \# *Notes:
5056 \#   The .PRINT \& (zero-width character) is required to get the
5057 \#   subsequent .sp request to work as advertised.
5058 \#
5059 \#   The overall document line length, family, and point-size
5060 \#   are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
5061 \#   use in the HEADER and FOOTER macros.
5062 \#
5063 \#  First, define some strings for point sizes
5064 \#
5065 \# Doc cover
5066 .ds $DOC_COVER_AUTHOR_PT_SIZE        \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_AUTHOR_SIZE_CHANGE]
5067 .ds $DOC_COVER_CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE]
5068 .ds $DOC_COVER_COPYRIGHT_PT_SIZE     \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_COPYRIGHT_SIZE_CHANGE]
5069 .ds $DOC_COVER_DOCTYPE_PT_SIZE       \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_DOCTYPE_SIZE_CHANGE]
5070 .ds $DOC_COVER_SUBTITLE_PT_SIZE      \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_SUBTITLE_SIZE_CHANGE]
5071 .ds $DOC_COVER_TITLE_PT_SIZE         \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_TITLE_SIZE_CHANGE]
5072 \# Cover
5073 .ds $COVER_AUTHOR_PT_SIZE        \\n[#DOC_PT_SIZE]u\\*[$COVER_AUTHOR_SIZE_CHANGE]
5074 .ds $COVER_CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_CHAPTER_TITLE_SIZE_CHANGE]
5075 .ds $COVER_COPYRIGHT_PT_SIZE     \\n[#DOC_PT_SIZE]u\\*[$COVER_COPYRIGHT_SIZE_CHANGE]
5076 .ds $COVER_DOCTYPE_PT_SIZE       \\n[#DOC_PT_SIZE]u\\*[$COVER_DOCTYPE_SIZE_CHANGE]
5077 .ds $COVER_SUBTITLE_PT_SIZE      \\n[#DOC_PT_SIZE]u\\*[$COVER_SUBTITLE_SIZE_CHANGE]
5078 .ds $COVER_TITLE_PT_SIZE         \\n[#DOC_PT_SIZE]u\\*[$COVER_TITLE_SIZE_CHANGE]
5079 \# Docheader
5080 .ds $AUTHOR_PT_SIZE         \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
5081 .ds $CHAPTER_TITLE_PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
5082 .ds $COPYRIGHT_PT_SIZE      \\n[#DOC_PT_SIZE]u\\*[$COPYRIGHT_SIZE_CHANGE]
5083 .ds $DOCTYPE_PT_SIZE        \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
5084 .ds $SUBTITLE_PT_SIZE       \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
5085 .ds $TITLE_PT_SIZE          \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
5086 \#
5087 \# Next, some utility macros for various routines to prevent repetition
5088 \#
5089 .MAC PRINT_AUTHORS END
5090 .    nr #AUTHORS \\n[#AUTHOR_NUM]
5091 .    nr #NEXT_AUTHOR 0 1
5092 .    ie r#DOING_COVER \{\
5093 .       if \\n[#COVER]=1 \{\
5094 .          while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
5095 .             ie \\n[#COVER_AUTHOR_COLOR]=1 \{\
5096 .                PRINT \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
5097 .             \}
5098 .             el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
5099 .\}
5100 .       \}
5101 .       if \\n[#DOC_COVER]=1 \{\
5102 .          while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
5103 .             ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \{\
5104 .                PRINT \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
5105 .             \}
5106 .             el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
5107 .\}
5108 .       \}
5109 .    \}
5110 .    el \{\
5111 .       while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
5112 .          ie \\n[#AUTHOR_COLOR]=1 \{\
5113 .             PRINT \m[\\*[$AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
5114 .          \}
5115 .          el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
5116 .\}
5117 .    \}
5118 .END
5119 \#
5120 .MAC DEFAULT_DOCHEADER END
5121 .    CENTER
5122 .    FAMILY  \\*[$TITLE_FAM]
5123 .    FT      \\*[$TITLE_FT]
5124 .    PT_SIZE \\*[$TITLE_PT_SIZE]
5125 .    LS      \\n[#DOCHEADER_LEAD]u
5126 .    ie \\n[#TITLE_COLOR]=1 \{\
5127 .       PRINT \m[\\*[$TITLE_COLOR]]\\*[$TITLE]\m[]
5128 .    \}
5129 .    el \{ .PRINT \\*[$TITLE] \}
5130 .    if !'\\*[$SUBTITLE]'' \{\
5131 .       FAMILY  \\*[$SUBTITLE_FAM]
5132 .       FT      \\*[$SUBTITLE_FT]
5133 .       PT_SIZE \\*[$SUBTITLE_PT_SIZE]
5134 .       ie \\n[#SUBTITLE_COLOR]=1 \{\
5135 .          PRINT \m[\\*[$SUBTITLE_COLOR]]\\*[$TITLE]\m[]
5136 .       \}
5137 .       el \{ .PRINT \\*[$SUBTITLE] \}
5138 .    \}
5139 .    if !'\\*[$AUTHOR_1]'' \{\
5140 .       FAMILY  \\*[$AUTHOR_FAM]
5141 .       FT      \\*[$AUTHOR_FT]
5142 .       PT_SIZE \\*[$AUTHOR_PT_SIZE]
5143 .       if !'\\*[$ATTRIBUTE_STRING]'' \{\
5144 .          ie \\n[#ATTRIBUTE_COLOR]=1 \{\
5145 .             PRINT \m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
5146 .          \}
5147 .          el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
5148 .       \}
5149 .       PRINT_AUTHORS
5150 .    \}
5151 .END
5152 \#
5153 \#
5154 .MAC CHAPTER_DOCHEADER END
5155 .    CENTER
5156 .    FAMILY  \\*[$TITLE_FAM]
5157 .    FT      \\*[$TITLE_FT]
5158 .    PT_SIZE \\*[$TITLE_PT_SIZE]
5159 .    LS      \\n[#DOCHEADER_LEAD]u
5160 .\" Chapter title only
5161 .    ie '\\*[$CHAPTER]'' \{\
5162 .       ie !'\\*[$CHAPTER_TITLE]'' \{\
5163 .          if \\n[#PRINT_STYLE]=2 \{\
5164 .             FAMILY  \\*[$CHAPTER_TITLE_FAM]
5165 .             FT      \\*[$CHAPTER_TITLE_FT]
5166 .             PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
5167 .             LS      \\n[#DOCHEADER_LEAD]u
5168 .          \}
5169 .          ie \\n[#TITLE_COLOR]=1 \{\
5170 .             PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5171 .          \}
5172 .          el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5173 .       \}
5174 .       el \{\
5175 .          ie \\n[#TITLE_COLOR]=1 \{\
5176 .             PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING]\m[]
5177 .          \}
5178 .          el \{ .PRINT \\*[$CHAPTER_STRING] \}
5179 .       \}
5180 .    \}
5181 .\" Chapter string, possibly with a chapter title
5182 .    el \{\
5183 .       ie \\n[#TITLE_COLOR]=1 \{\
5184 .          PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
5185 .       \}
5186 .       el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
5187 .       if !'\\*[$CHAPTER_TITLE]'' \{\
5188 .          if \\n[#PRINT_STYLE]=1 \{ .PRINT \\*[$CHAPTER_TITLE] \}
5189 .          if \\n[#PRINT_STYLE]=2 \{\
5190 .             FAMILY  \\*[$CHAPTER_TITLE_FAM]
5191 .             FT      \\*[$CHAPTER_TITLE_FT]
5192 .             PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
5193 .             LS      \\n[#DOCHEADER_LEAD]u
5194 .             ie \\n[#CHAPTER_TITLE_COLOR]=1 \{\
5195 .                PRINT \m[\\*[$CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5196 .             \}
5197 .             el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5198 .             RLD \\n[#DOC_LEAD]u \" Just looks better this way
5199 .          \}
5200 .       \}
5201 .    \}
5202 .END
5203 \#
5204 \#
5205 .MAC NAMED_DOCHEADER END
5206 .    CENTER
5207 .    FAMILY  \\*[$TITLE_FAM]
5208 .    FT      \\*[$TITLE_FT]
5209 .    PT_SIZE \\*[$TITLE_PT_SIZE]
5210 .    LS      \\n[#DOCHEADER_LEAD]u
5211 .    ie \\n[#TITLE_COLOR]=1 \{\
5212 .       PRINT \m[\\*[$TITLE_COLOR]]\\*[$TITLE]\m[]
5213 .    \}
5214 .    el \{ .PRINT \\*[$TITLE] \}
5215 .    if !'\\*[$SUBTITLE]'' \{\
5216 .       FAMILY  \\*[$SUBTITLE_FAM]
5217 .       FT      \\*[$SUBTITLE_FT]
5218 .       PT_SIZE \\*[$SUBTITLE_PT_SIZE]
5219 .       ie \\n[#SUBTITLE_COLOR]=1 \{\
5220 .          PRINT \m[\\*[$SUBTITLE_COLOR]]\\*[$TITLE]\m[]
5221 .       \}
5222 .       el \{ .PRINT \\*[$SUBTITLE] \}
5223 .    \}
5224 .    if !'\\*[$AUTHOR_1]'' \{\
5225 .       FAMILY  \\*[$AUTHOR_FAM]
5226 .       FT      \\*[$AUTHOR_FT]
5227 .       PT_SIZE \\*[$AUTHOR_PT_SIZE]
5228 .       if !'\\*[$ATTRIBUTE_STRING]'' \{\
5229 .          ie \\n[#ATTRIBUTE_COLOR]=1 \{\
5230 .             PRINT \m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
5231 .          \}
5232 .          el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
5233 .       \}
5234 .       PRINT_AUTHORS
5235 .    \}
5236 .    FAMILY  \\*[$DOCTYPE_FAM]
5237 .    FT      \\*[$DOCTYPE_FT]
5238 .    PT_SIZE \\*[$DOCTYPE_PT_SIZE]
5239 .    LS      \\n[#DOCHEADER_LEAD]u
5240 .    ALD     \\n[#DOCHEADER_LEAD]u
5241 .    ie \\n[#DOCTYPE_COLOR]=1 \{\
5242 .       COLOR \\*[$DOCTYPE_COLOR]
5243 .       UNDERSCORE "\\*[$DOC_TYPE]
5244 .    \}
5245 .    el .UNDERSCORE "\\*[$DOC_TYPE]
5246 .END
5247 \#
5248 \#
5249 \# COVER PAGE
5250 \# ----------
5251 \# *Arguments:
5252 \#   TITLE | DOCTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE | COVERTITLE ...
5253 \#   ... [ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC ]
5254 \# *Function:
5255 \#   Toggles the number register for each cover page element
5256 \#   passed as an argument.
5257 \# *Notes:
5258 \#   TITLE, DOCTITLE, CHAPTER, CHAPTER_TITLE or CHAPTER+TITLE must
5259 \#   be supplied.  After that, users may enter as many or as few of
5260 \#   the arguments as they like; however, the arguments must appear
5261 \#   in the order given above.
5262 \#
5263 \#   If called as DOC_COVER, performs the same operations, but
5264 \#   applies everything to a doc cover.
5265 \#
5266 .MAC COVER END
5267 .    ie '\\$0'DOC_COVER' \{\
5268 .       nr #DOC_COVER 1
5269 .       if '\\$1'TITLE'         \{ .nr #DOC_COVER_TITLE     1 \}
5270 .       if '\\$1'DOCTITLE'      \{ .nr #DOC_COVER_TITLE     2 \}
5271 .       if '\\$1'CHAPTER'       \{ .nr #DOC_COVER_TITLE     3 \}
5272 .       if '\\$1'CHAPTER_TITLE' \{ .nr #DOC_COVER_TITLE     4 \}
5273 .       if '\\$1'CHAPTER+TITLE' \{ .nr #DOC_COVER_TITLE     5 \}
5274 .       if '\\$1'COVERTITLE'    \{ .nr #DOC_COVER_TITLE     6 \}
5275 .       if '\\$2'SUBTITLE'      \{ .nr #DOC_COVER_SUBTITLE  1 \}
5276 .       if '\\$2'AUTHOR'        \{ .nr #DOC_COVER_AUTHOR    1 \}
5277 .       if '\\$2'DOCTYPE'       \{ .nr #DOC_COVER_DOCTYPE   1 \}
5278 .       if '\\$2'COPYRIGHT'     \{ .nr #DOC_COVER_COPYRIGHT 1 \}
5279 .       if '\\$2'MISC'          \{ .nr #DOC_COVER_MISC      1 \}
5280 .       if '\\$3'AUTHOR'        \{ .nr #DOC_COVER_AUTHOR    1 \}
5281 .       if '\\$3'DOCTYPE'       \{ .nr #DOC_COVER_DOCTYPE   1 \}
5282 .       if '\\$3'COPYRIGHT'     \{ .nr #DOC_COVER_COPYRIGHT 1 \}
5283 .       if '\\$3'MISC'          \{ .nr #DOC_COVER_MISC      1 \}
5284 .       if '\\$4'DOCTYPE'       \{ .nr #DOC_COVER_DOCTYPE   1 \}
5285 .       if '\\$4'COPYRIGHT'     \{ .nr #DOC_COVER_COPYRIGHT 1 \}
5286 .       if '\\$4'MISC'          \{ .nr #DOC_COVER_MISC      1 \}
5287 .       if '\\$5'COPYRIGHT'     \{ .nr #DOC_COVER_COPYRIGHT 1 \}
5288 .       if '\\$5'MISC'          \{ .nr #DOC_COVER_MISC      1 \}
5289 .       if '\\$6'MISC'          \{ .nr #DOC_COVER_MISC      1 \}
5290 .    \}
5291 .    el \{\
5292 .       nr #COVER 1
5293 .       if '\\$1'TITLE'         \{ .nr #COVER_TITLE     1 \}
5294 .       if '\\$1'DOCTITLE'      \{ .nr #COVER_TITLE     2 \}
5295 .       if '\\$1'CHAPTER'       \{ .nr #COVER_TITLE     3 \}
5296 .       if '\\$1'CHAPTER_TITLE' \{ .nr #COVER_TITLE     4 \}
5297 .       if '\\$1'CHAPTER+TITLE' \{ .nr #COVER_TITLE     5 \}
5298 .       if '\\$1'COVERTITLE'    \{ .nr #COVER_TITLE     6 \}
5299 .       if '\\$2'SUBTITLE'      \{ .nr #COVER_SUBTITLE  1 \}
5300 .       if '\\$2'AUTHOR'        \{ .nr #COVER_AUTHOR    1 \}
5301 .       if '\\$2'DOCTYPE'       \{ .nr #COVER_DOCTYPE   1 \}
5302 .       if '\\$2'COPYRIGHT'     \{ .nr #COVER_COPYRIGHT 1 \}
5303 .       if '\\$2'MISC'          \{ .nr #COVER_MISC      1 \}
5304 .       if '\\$3'AUTHOR'        \{ .nr #COVER_AUTHOR    1 \}
5305 .       if '\\$3'DOCTYPE'       \{ .nr #COVER_DOCTYPE   1 \}
5306 .       if '\\$3'COPYRIGHT'     \{ .nr #COVER_COPYRIGHT 1 \}
5307 .       if '\\$3'MISC'          \{ .nr #COVER_MISC      1 \}
5308 .       if '\\$4'DOCTYPE'       \{ .nr #COVER_DOCTYPE   1 \}
5309 .       if '\\$4'COPYRIGHT'     \{ .nr #COVER_COPYRIGHT 1 \}
5310 .       if '\\$4'MISC'          \{ .nr #COVER_MISC      1 \}
5311 .       if '\\$5'COPYRIGHT'     \{ .nr #COVER_COPYRIGHT 1 \}
5312 .       if '\\$5'MISC'          \{ .nr #COVER_MISC      1 \}
5313 .       if '\\$6'MISC'          \{ .nr #COVER_MISC      1 \}
5314 .    \}
5315 .END
5316 \#
5317 \#
5318 .MAC COVERTITLE END
5319 .    ie '\\$0'DOC_COVERTITLE' .ds $DOC_COVER_TITLE \\$1
5320 .    el .ds $COVER_TITLE \\$1
5321 .END
5322 \#
5323 \#
5324 \# COVER PAGE LEADING
5325 \# ------------------
5326 \# *Arguments:
5327 \#   <+|- amount by which to in/decrease leading of cover/doc cover>
5328 \# *Function:
5329 \#   Stores user supplied lead in/decrease in string $COVER_LEAD_ADJ
5330 \#   or $DOC_COVER_LEAD_ADJ, depending on whether the macro was called
5331 \#   with an alias (DOC_COVER_LEAD).
5332 \# *Notes:
5333 \#   A unit of measure must be supplied.  Decimal fractions OK.
5334 \#   Default is +0, i.e. same as DOC_LEAD.
5335 \#
5336 .MAC COVER_LEAD END
5337 .    ie '\\$0'DOC_COVER_LEAD' \{\
5338 .       ds $DOC_COVER_LEAD_ADJ \\$1
5339 .    \}
5340 .    el \{\
5341 .       ds $COVER_LEAD_ADJ \\$1
5342 .    \}
5343 .END
5344 \#
5345 \#
5346 \# COVER PAGE START POSITION
5347 \# -------------------------
5348 \# *Arguments:
5349 \#   <distance from page top at which to start cover/doc cover>
5350 \# *Function:
5351 \#   Stores user supplied lead in/decrease in #COVER_START_POS
5352 \#   or #DOC_COVER_START_POS, depending on whether the macro was
5353 \#   called by an alias (DOC_COVER_ADVANCE).
5354 \# *Notes:
5355 \#   A unit of measure must be supplied.  Decimal fractions OK.
5356 \#   If user doesn't invoke this macro, the default starting
5357 \#   position for both covers and doc covers is 1/3 of the way
5358 \#   down the page (setup in DO_COVER).
5359 \#
5360 .MAC COVER_ADVANCE END
5361 .    ie '\\$0'DOC_COVER_ADVANCE' \{\
5362 .       nr #DOC_COVER_START_POS (\\$1)
5363 .    \}
5364 .    el \{\
5365 .       nr #COVER_START_POS (\\$1)
5366 .    \}
5367 .END
5368 \#
5369 \#
5370 \# COVERS - WHETHER TO PRINT
5371 \# -------------------------
5372 \# *Arguments:
5373 \#   <none> | <anything>
5374 \# *Function:
5375 \#   Creates or removes registers #COVERS and #COVERS_OFF, checked for
5376 \#   in DEFAULTS (in START) prior to printing
5377 \#
5378 .MAC COVERS END
5379 .    ie '\\$0'DOC_COVERS' \{\
5380 .       ie '\\$1'' \{\
5381 .          rr #DOC_COVERS_OFF
5382 .          nr #DOC_COVERS 1
5383 .       \}
5384 .       el \{\
5385 .          rr #DOC_COVERS
5386 .          nr #DOC_COVERS_OFF 1
5387 .       \}
5388 .    \}
5389 .    el \{\
5390 .       ie '\\$1'' \{\
5391 .          rr #COVERS_OFF
5392 .          nr #COVERS 1
5393 .       \}
5394 .       el \{\
5395 .          rr #COVERS
5396 .          nr #COVERS_OFF 1
5397 .       \}
5398 .    \}
5399 .END
5400 \#
5401 \#
5402 .MAC DO_COVER END
5403 .    nr #DOING_COVER 1
5404 .    ev COVER
5405 .    evc 0
5406 .    TRAP OFF
5407 .    if \\n[#PAGINATE]=1 \{\
5408 .       nr #PAGINATION_WAS_ON 1
5409 .       rr #PAGINATE
5410 .    \}
5411 .    if \\n[#HEADERS_ON]=1 \{\
5412 .       nr #HEADERS_WERE_ON 1
5413 .       HEADERS OFF
5414 .    \}
5415 .    if \\n[#FOOTERS_ON]=1 \{\
5416 .       nr #FOOTERS_WERE_ON 1
5417 .       FOOTERS OFF
5418 .    \}
5419 .    if \\n[#COLUMNS]=1 \{\
5420 .       nr #COLUMNS_WERE_ON 1
5421 .       rr #COLUMNS
5422 .    \}
5423 .\" Doc cover
5424 .    ie '\\$0'DO_DOC_COVER' \{\
5425 .       if !r#DOC_COVER_START_POS \{\
5426 .          nr #DOC_COVER_START_POS \\n[#PAGE_LENGTH]/3
5427 .       \}
5428 .       if \\n[#PRINT_STYLE]=1 \{\
5429 .          ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
5430 .          el \{ .vs \\n[#DOC_LEAD]u \}
5431 .       \}
5432 .       if \\n[#PRINT_STYLE]=2 \{\
5433 .          LS \\n[#DOC_LEAD]u\\*[$DOC_COVER_LEAD_ADJ]
5434 .          nr #DOC_COVER_LEAD \\n[#LEAD]
5435 .       \}
5436 .       PRINT \&
5437 .       sp |\\n[#DOC_COVER_START_POS]u-1v
5438 .       if \\n[#DOC_COVER_COLOR]=1 \{\
5439 .          nf
5440 \m[\\*[$DOC_COVER_COLOR]]
5441 .          EOL
5442 .       \}
5443 .       CENTER
5444 .       FAMILY  \\*[$DOC_COVER_TITLE_FAM]
5445 .       FT      \\*[$DOC_COVER_TITLE_FT]
5446 .       PT_SIZE \\*[$DOC_COVER_TITLE_PT_SIZE]
5447 .       LS      \\n[#DOC_COVER_LEAD]u
5448 .       if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
5449 .       if \\n[#DOC_COVER_TITLE]=1 \{\
5450 .          ie \\n[#PRINT_STYLE]=1 \{\
5451 .             CAPS
5452 .             UNDERSCORE "\\*[$TITLE]"
5453 .             CAPS OFF
5454 .          \}
5455 .          el \{\
5456 .             ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5457 .                PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$TITLE]\m[]
5458 .             \}
5459 .             el \{ .PRINT \\*[$TITLE] \}
5460 .          \}
5461 .       \}
5462 .       if \\n[#DOC_COVER_TITLE]=2 \{\
5463 .          ie \\n[#PRINT_STYLE]=1 \{\
5464 .             CAPS
5465 .             UNDERSCORE "\\*[$DOC_TITLE]"
5466 .             CAPS OFF
5467 .          \}
5468 .          el \{\
5469 .             ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5470 .                PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_TITLE]\m[]
5471 .             \}
5472 .             el \{ .PRINT \\*[$DOC_TITLE] \}
5473 .          \}
5474 .       \}
5475 .       if \\n[#DOC_COVER_TITLE]=3 \{\
5476 .          ie \\n[#PRINT_STYLE]=1 \{\
5477 .             CAPS
5478 .             PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
5479 .             CAPS OFF
5480 .          \}
5481 .          el \{\
5482 .             ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5483 .                PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
5484 .             \}
5485 .             el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
5486 .          \}
5487 .       \}
5488 .       if \\n[#DOC_COVER_TITLE]=4 \{\
5489 .          ie \\n[#PRINT_STYLE]=1 \{\
5490 .             CAPS
5491 .             UNDERSCORE "\\*[$CHAPTER_TITLE]"
5492 .             CAPS OFF
5493 .          \}
5494 .          el \{\
5495 .             ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5496 .                PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5497 .             \}
5498 .             el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5499 .          \}
5500 .       \}
5501 .       if \\n[#DOC_COVER_TITLE]=5 \{\
5502 .          ie \\n[#PRINT_STYLE]=1 \{\
5503 .             CAPS
5504 .             PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
5505 .             CAPS OFF
5506 .          \}
5507 .          el \{\
5508 .             ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5509 .                PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
5510 .             \}
5511 .             el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
5512 .          \}
5513 .          if !'\\*[$CHAPTER_TITLE]'' \{\
5514 .             ie \\n[#PRINT_STYLE]=1 \{\
5515 .                UNDERSCORE "\\*[$CHAPTER_TITLE]"
5516 .             \}
5517 .             el \{\
5518 .                FAMILY  \\*[$DOC_COVER_CHAPTER_TITLE_FAM]
5519 .                FT      \\*[$DOC_COVER_CHAPTER_TITLE_FT]
5520 .                PT_SIZE \\*[$DOC_COVER_CHAPTER_TITLE_PT_SIZE]
5521 .                ie \\n[#DOC_COVER_CHAPTER_TITLE_COLOR]=1 \{\
5522 .                   PRINT \m[\\*[$DOC_COVER_CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5523 .                \}
5524 .                el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5525 .             \}
5526 .          \}
5527 .       \}
5528 .       if \\n[#DOC_COVER_TITLE]=6 \{\
5529 .          ie \\n[#PRINT_STYLE]=1 \{\
5530 .             CAPS
5531 .             UNDERSCORE "\\*[$DOC_COVER_TITLE]"
5532 .             CAPS OFF
5533 .          \}
5534 .          el \{\
5535 .             ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5536 .                PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_COVER_TITLE]\m[]
5537 .             \}
5538 .             el \{ .PRINT \\*[$DOC_COVER_TITLE] \}
5539 .          \}
5540 .       \}
5541 .       if \\n[#DOC_COVER_SUBTITLE]=1 \{\
5542 .          FAMILY  \\*[$DOC_COVER_SUBTITLE_FAM]
5543 .          FT      \\*[$DOC_COVER_SUBTITLE_FT]
5544 .          PT_SIZE \\*[$DOC_COVER_SUBTITLE_PT_SIZE]
5545 .          if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
5546 .          ie \\n[#DOC_COVER_SUBTITLE_COLOR]=1 \{\
5547 .             PRINT \m[\\*[$DOC_COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE]\m[]
5548 .          \}
5549 .          el \{ .PRINT \\*[$SUBTITLE] \}
5550 .       \}
5551 .       if \\n[#PRINT_STYLE]=1 \{\
5552 .          if !r#DOC_COVER_SUBTITLE \{ .SP \}
5553 .       \}
5554 .       if \\n[#DOC_COVER_AUTHOR]=1 \{\
5555 .          FAMILY  \\*[$DOC_COVER_AUTHOR_FAM]
5556 .          FT      \\*[$DOC_COVER_AUTHOR_FT]
5557 .          PT_SIZE \\*[$DOC_COVER_AUTHOR_PT_SIZE]
5558 .          if \\n[#PRINT_STYLE]=1 \{\
5559 .             TYPEWRITER
5560 .             vs \\n[#DOC_LEAD]u/2u
5561 .          \}
5562 .          if !'\\*[$ATTRIBUTE_STRING]'' \{\
5563 .             ie \\n[#DOC_COVER_ATTRIBUTE_COLOR]=1 \{\
5564 .                PRINT \m[\\*[$DOC_COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
5565 .             \}
5566 .             el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
5567 .          \}
5568 .          PRINT_AUTHORS
5569 .       \}
5570 .       FAMILY  \\*[$DOC_COVER_DOCTYPE_FAM]
5571 .       FT      \\*[$DOC_COVER_DOCTYPE_FT]
5572 .       PT_SIZE \\*[$DOC_COVER_DOCTYPE_PT_SIZE]
5573 .       SP
5574 .       if \\n[#DOC_COVER_DOCTYPE]=1 \{\
5575 .          ie \\n[#PRINT_STYLE]=1 \{\
5576 .             TYPEWRITER
5577 .             vs \\n[#DOC_LEAD]u
5578 .             UNDERSCORE2 "\\*[$DOC_TYPE]
5579 .          \}
5580 .          el \{\
5581 .             ie \\n[#DOC_COVER_DOCTYPE_COLOR]=1 \{\
5582 .                COLOR \\*[$DOC_COVER_DOCTYPE_COLOR]
5583 .                UNDERSCORE "\\*[$DOC_TYPE]
5584 .             \}
5585 .             el .UNDERSCORE "\\*[$DOC_TYPE]
5586 .          \}
5587 .       \}
5588 .       sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
5589 .       ie \\n[#PRINT_STYLE]=1 \{\
5590 .          TYPEWRITER
5591 .          ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
5592 .          el \{ .vs \\n[#DOC_LEAD]u/2u \}
5593 .       \}
5594 .       el \{\
5595 .          FAMILY  \\*[$DOC_COVER_COPYRIGHT_FAM]
5596 .          FT      \\*[$DOC_COVER_COPYRIGHT_FT]
5597 .          AUTOLEAD 2
5598 .          PT_SIZE \\*[$DOC_COVER_COPYRIGHT_PT_SIZE]
5599 .       \}
5600 .       if \\n[#DOC_COVER_COPYRIGHT]=1 \{\
5601 .          QUAD \\*[$DOC_COVER_COPYRIGHT_QUAD]
5602 .          ie \\n[#DOC_COVER_COPYRIGHT_COLOR]=1 \{\
5603 .             PRINT \m[\\*[$DOC_COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
5604 .          \}
5605 .          el \{ .PRINT \\*[$COPYRIGHT] \}
5606 .       \}
5607 .       sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
5608 .       if \\n[#DOC_COVER_MISC]=1 \{\
5609 .          QUAD \\*[$DOC_COVER_MISC_QUAD]
5610 .          nr #MISCS \\n[#MISC_NUM]
5611 .          sp -\\n[#MISCS]+1
5612 .          nr #NEXT_MISC 0 1
5613 .          while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
5614 .             ie \\n[#DOC_COVER_MISC_COLOR]=1 \{\
5615 .                PRINT \m[\\*[$DOC_COVER_MISC_COLOR]]\\*[$MISC_\\n+[#NEXT_MISC]]\m[]
5616 .                br
5617 .             \}
5618 .             el \{\
5619 .                PRINT \\*[$MISC_\\n+[#NEXT_MISC]]
5620 .                br
5621 .             \}
5622 .\}
5623 .       \}
5624 .    \}
5625 .\" Cover
5626 .    el \{\
5627 .       if !r#COVER_START_POS \{\
5628 .          nr #COVER_START_POS \\n[#PAGE_LENGTH]/3
5629 .       \}
5630 .       if \\n[#PRINT_STYLE]=1 \{\
5631 .          ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
5632 .          el \{ .vs \\n[#DOC_LEAD]u \}
5633 .       \}
5634 .       if \\n[#PRINT_STYLE]=2 \{\
5635 .          LS \\n[#DOC_LEAD]u\\*[$COVER_LEAD_ADJ]
5636 .          nr #COVER_LEAD \\n[#LEAD]
5637 .       \}
5638 .       PRINT \&
5639 .       sp |\\n[#COVER_START_POS]u-1v
5640 .       if \\n[#COVER_COLOR]=1 \{\
5641 .          nf
5642 \m[\\*[$COVER_COLOR]]
5643 .          EOL
5644 .       \}
5645 .       CENTER
5646 .       FAMILY  \\*[$COVER_TITLE_FAM]
5647 .       FT      \\*[$COVER_TITLE_FT]
5648 .       PT_SIZE \\*[$COVER_TITLE_PT_SIZE]
5649 .       LS      \\n[#COVER_LEAD]u
5650 .       if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
5651 .       if \\n[#COVER_TITLE]=1 \{\
5652 .          ie \\n[#PRINT_STYLE]=1 \{\
5653 .             CAPS
5654 .             UNDERSCORE "\\*[$TITLE]"
5655 .             CAPS OFF
5656 .          \}
5657 .          el \{\
5658 .             ie \\n[#COVER_TITLE_COLOR]=1 \{\
5659 .                PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$TITLE]\m[]
5660 .             \}
5661 .             el \{ .PRINT \\*[$TITLE] \}
5662 .          \}
5663 .       \}
5664 .       if \\n[#COVER_TITLE]=2 \{\
5665 .          ie \\n[#PRINT_STYLE]=1 \{\
5666 .             CAPS
5667 .             UNDERSCORE "\\*[$DOC_TITLE]"
5668 .             CAPS OFF
5669 .          \}
5670 .          el \{\
5671 .             ie \\n[#COVER_TITLE_COLOR]=1 \{\
5672 .                PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$DOC_TITLE]\m[]
5673 .             \}
5674 .             el \{ .PRINT \\*[$DOC_TITLE] \}
5675 .          \}
5676 .       \}
5677 .       if \\n[#COVER_TITLE]=3 \{\
5678 .          ie \\n[#PRINT_STYLE]=1 \{\
5679 .             CAPS
5680 .             PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
5681 .             CAPS OFF
5682 .          \}
5683 .          el \{\
5684 .             ie \\n[#COVER_TITLE_COLOR]=1 \{\
5685 .                PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
5686 .             \}
5687 .             el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
5688 .          \}
5689 .       \}
5690 .       if \\n[#COVER_TITLE]=4 \{\
5691 .          ie \\n[#PRINT_STYLE]=1 \{\
5692 .             CAPS
5693 .             UNDERSCORE "\\*[$CHAPTER_TITLE]"
5694 .             CAPS OFF
5695 .          \}
5696 .          el \{\
5697 .             ie \\n[#COVER_TITLE_COLOR]=1 \{\
5698 .                PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5699 .             \}
5700 .             el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5701 .          \}
5702 .       \}
5703 .       if \\n[#COVER_TITLE]=5 \{\
5704 .          ie \\n[#PRINT_STYLE]=1 \{\
5705 .             CAPS
5706 .             PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
5707 .             CAPS OFF
5708 .          \}
5709 .          el \{\
5710 .             ie \\n[#COVER_TITLE_COLOR]=1 \{\
5711 .                PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
5712 .             \}
5713 .             el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
5714 .          \}
5715 .          if !'\\*[$CHAPTER_TITLE]'' \{\
5716 .             ie \\n[#PRINT_STYLE]=1 \{\
5717 .                UNDERSCORE "\\*[$CHAPTER_TITLE]"
5718 .             \}
5719 .             el \{\
5720 .                FAMILY  \\*[$COVER_CHAPTER_TITLE_FAM]
5721 .                FT      \\*[$COVER_CHAPTER_TITLE_FT]
5722 .                PT_SIZE \\*[$COVER_CHAPTER_TITLE_PT_SIZE]
5723 .                ie \\n[#COVER_CHAPTER_TITLE_COLOR]=1 \{\
5724 .                   PRINT \m[\\*[$COVER_CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5725 .                \}
5726 .                el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5727 .             \}
5728 .          \}
5729 .       \}
5730 .       if \\n[#COVER_TITLE]=6 \{\
5731 .          ie \\n[#PRINT_STYLE]=1 \{\
5732 .             CAPS
5733 .             UNDERSCORE "\\*[$COVER_TITLE]"
5734 .             CAPS OFF
5735 .          \}
5736 .          el \{\
5737 .             ie \\n[#COVER_TITLE_COLOR]=1 \{\
5738 .                PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$COVER_TITLE]\m[]
5739 .             \}
5740 .             el \{ .PRINT \\*[$COVER_TITLE] \}
5741 .          \}
5742 .       \}
5743 .       if \\n[#COVER_SUBTITLE]=1 \{\
5744 .          FAMILY  \\*[$COVER_SUBTITLE_FAM]
5745 .          FT      \\*[$COVER_SUBTITLE_FT]
5746 .          PT_SIZE \\*[$COVER_SUBTITLE_PT_SIZE]
5747 .          if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
5748 .          ie \\n[#COVER_SUBTITLE_COLOR]=1 \{\
5749 .             PRINT \m[\\*[$COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE]\m[]
5750 .          \}
5751 .          el \{ .PRINT \\*[$SUBTITLE] \}
5752 .       \}
5753 .       if \\n[#PRINT_STYLE]=1 \{\
5754 .          if !r#COVER_SUBTITLE \{ .SP \}
5755 .       \}
5756 .       if \\n[#COVER_AUTHOR]=1 \{\
5757 .          FAMILY  \\*[$COVER_AUTHOR_FAM]
5758 .          FT      \\*[$COVER_AUTHOR_FT]
5759 .          PT_SIZE \\*[$COVER_AUTHOR_PT_SIZE]
5760 .          if \\n[#PRINT_STYLE]=1 \{\
5761 .             TYPEWRITER
5762 .             vs \\n[#DOC_LEAD]u/2u
5763 .          \}
5764 .          if !'\\*[$ATTRIBUTE_STRING]'' \{\
5765 .             ie \\n[#COVER_ATTRIBUTE_COLOR]=1 \{\
5766 .                PRINT \m[\\*[$COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
5767 .             \}
5768 .             el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
5769 .          \}
5770 .          PRINT_AUTHORS
5771 .       \}
5772 .       FAMILY  \\*[$COVER_DOCTYPE_FAM]
5773 .       FT      \\*[$COVER_DOCTYPE_FT]
5774 .       PT_SIZE \\*[$COVER_DOCTYPE_PT_SIZE]
5775 .       SP
5776 .       if \\n[#COVER_DOCTYPE]=1 \{\
5777 .          ie \\n[#PRINT_STYLE]=1 \{\
5778 .             TYPEWRITER
5779 .             vs \\n[#DOC_LEAD]u
5780 .             UNDERSCORE2 "\\*[$DOC_TYPE]
5781 .          \}
5782 .          el \{\
5783 .             ie \\n[#COVER_DOCTYPE_COLOR]=1 \{\
5784 .                COLOR \\*[$COVER_DOCTYPE_COLOR]
5785 .                UNDERSCORE "\\*[$DOC_TYPE]
5786 .             \}
5787 .             el .UNDERSCORE "\\*[$DOC_TYPE]
5788 .          \}
5789 .       \}
5790 .       sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
5791 .       ie \\n[#PRINT_STYLE]=1 \{\
5792 .          TYPEWRITER
5793 .          ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
5794 .          el \{ .vs \\n[#DOC_LEAD]u/2u \}
5795 .       \}
5796 .       el \{\
5797 .          FAMILY  \\*[$COVER_COPYRIGHT_FAM]
5798 .          FT      \\*[$COVER_COPYRIGHT_FT]
5799 .          AUTOLEAD 2
5800 .          PT_SIZE \\*[$COVER_COPYRIGHT_PT_SIZE]
5801 .       \}
5802 .       if \\n[#COVER_COPYRIGHT]=1 \{\
5803 .          QUAD \\*[$COVER_COPYRIGHT_QUAD]
5804 .          ie \\n[#COVER_COPYRIGHT_COLOR]=1 \{\
5805 .             PRINT \m[\\*[$COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
5806 .          \}
5807 .          el \{ .PRINT \\*[$COPYRIGHT] \}
5808 .       \}
5809 .       sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
5810 .       if \\n[#COVER_MISC]=1 \{\
5811 .          QUAD \\*[$COVER_MISC_QUAD]
5812 .          nr #MISCS \\n[#MISC_NUM]
5813 .          sp -\\n[#MISCS]+1
5814 .          nr #NEXT_MISC 0 1
5815 .          while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
5816 .             ie \\n[#COVER_MISC_COLOR]=1 \{\
5817 .                PRINT \m[\\*[$COVER_MISC_COLOR]]\\*[$MISC_\\n+[#NEXT_MISC]]\m[]
5818 .                br
5819 .             \}
5820 .             el \{\
5821 .                PRINT \\*[$MISC_\\n+[#NEXT_MISC]]
5822 .                br
5823 .             \}
5824 .\}
5825 .       \}
5826 .    \}
5827 .    EOL
5828 .    TRAP
5829 .    NEWPAGE
5830 .    ev
5831 .    if \\n[#PAGINATION_WAS_ON] \{\
5832 .       rr #PAGINATION_WAS_ON
5833 .       PAGINATE
5834 .       PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]-1
5835 .    \}
5836 .    if \\n[#HEADERS_WERE_ON] \{\
5837 .       rr #HEADERS_WERE_ON
5838 .       HEADERS
5839 .    \}
5840 .    if \\n[#FOOTERS_WERE_ON] \{\
5841 .       rr #FOOTERS_WERE_ON
5842 .       FOOTERS
5843 .    \}
5844 .    if \\n[#COLUMNS_WERE_ON]=1 \{\
5845 .       rr #COLUMNS_WERE_ON 1
5846 .       nr #COLUMNS 1
5847 .    \}
5848 .    rr #DOING_COVER
5849 .END
5850 \#
5851 \#
5852 .MAC START END
5853 .    if !\\n[#PRINT_STYLE] \{\
5854 .       PRINTSTYLE TYPEWRITE
5855 .       PRINT \&
5856 .       po 6P
5857 .       ll 39P
5858 .       ta \\n(.lu
5859 .       sp |1i-1v
5860 .       CENTER
5861 .       PRINT "You neglected to enter a PRINTSTYLE"
5862 .       fl
5863 .       ab PRINTSTYLE missing
5864 .    \}
5865 .    nr #DOCS 1
5866 .    if \\n[#LINENUMBERS]=1 \{\
5867 .       NUMBER_LINES OFF
5868 .       nr #LINENUMBERS 2
5869 .    \}
5870 .    if \\n[#COLLATE] \{\
5871 .       COPYSTYLE \\*[$COPY_STYLE]
5872 .       nr #HEADERS_ON \\n[#HEADER_STATE]
5873 .       if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
5874 .       sp |\\n[#HEADER_MARGIN]u
5875 .       PRINT \&
5876 .       if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
5877 .          PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
5878 .          rm $RESTORE_PAGENUM_STYLE
5879 .       \}
5880 .    \}
5881 .    DEFAULTS
5882 .\" Quote and blockquote default leads are the same as #DOC_LEAD, so
5883 .\" they have to be set after DEFAULTS (where DOC_LEAD is finalized)
5884 .    if !r#Q_AUTOLEAD     \{ .nr #Q_LEAD \\n[#DOC_LEAD]    \}
5885 .    if !r#BQ_AUTOLEAD    \{ .nr #BQ_LEAD \\n[#DOC_LEAD]   \}
5886 .    if !r#EN_Q_AUTOLEAD  \{ .nr #EN_Q_LEAD \\n[#EN_LEAD]  \}
5887 .    if !r#EN_BQ_AUTOLEAD \{ .nr #EN_BQ_LEAD \\n[#EN_LEAD] \}
5888 .\" Covers and doc covers
5889 .    if \\n[#DOC_COVERS]=1 \{\
5890 .       if \\n[#DOC_COVER]=1 \{\
5891 .          DO_DOC_COVER
5892 .          rr #DOC_COVER
5893 .          rr #DOC_COVER_TITLE
5894 .          rr #DOC_COVER_SUBTITLE
5895 .          rr #DOC_COVER_AUTHOR
5896 .          rr #DOC_COVER_DOCTYPE
5897 .          rr #DOC_COVER_COPYRIGHT
5898 .          rr #DOC_COVER_MISC
5899 .       \}
5900 .    \}
5901 .    if \\n[#COVERS]=1 \{\
5902 .       if \\n[#COVER]=1 \{\
5903 .          DO_COVER
5904 .          rr #COVER
5905 .          rr #COVER_TITLE
5906 .          rr #COVER_SUBTITLE
5907 .          rr #COVER_AUTHOR
5908 .          rr #COVER_DOCTYPE
5909 .          rr #COVER_COPYRIGHT
5910 .          rr #COVER_MISC
5911 .       \}
5912 .    \}
5913 .\" Collate related stuff
5914 .    ie \\n[#COLLATED_DOC]=1 \{\
5915 .\" Collect TITLE for TOC.
5916 .       nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
5917 .       af #TOC_ENTRY_PN \\g[#PAGENUMBER]
5918 .       ie \\n[#USER_SET_TITLE_ITEM] \{\
5919 .          ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]\\|
5920 .          rr #USER_SET_TITLE_ITEM
5921 .          rm $USER_SET_TITLE_ITEM
5922 .       \}
5923 .       el \{\
5924 .          ie \\n[#DOC_TYPE]=2 \{\
5925 .             ie '\\*[$CHAPTER_TITLE]'' \{\
5926 .                ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
5927 .             \}
5928 .             el \{\
5929 .                ie '\\*[$CHAPTER]'' \{\
5930 .                   ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]\\|
5931 .                \}
5932 .                el \{\
5933 .                   ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
5934 .                \}
5935 .             \}
5936 .          \}
5937 .          el \{\
5938 .             ds $TOC_TITLE_ITEM \\*[$TITLE]\\|
5939 .          \}
5940 .       \}
5941 .       if \\n[#TOC_AUTHORS]=1 \{\
5942 .          ie '\\*[$TOC_AUTHORS]'' \{\
5943 .             as $TOC_TITLE_ITEM /\\|\\*[$AUTHOR_1]\\|
5944 .          \}
5945 .          el \{\
5946 .             as $TOC_TITLE_ITEM /\\|\\*[$TOC_AUTHORS]\\|
5947 .             rm $TOC_AUTHORS
5948 .          \}
5949 .       \}
5950 .\" Note the use of \!, which transparently embeds the macros used
5951 .\" in the TOC_ENTRIES diversion.  The elements they control must be
5952 .\" processed literally when the diversion is output.
5953 .       ev TOC_EV
5954 .       da TOC_ENTRIES
5955 .       if \\n[#PRINT_STYLE]=1 \{\
5956 \!.        fam C
5957 \!.        ft  R
5958 \!.        ps  12
5959 .       \}
5960 .       if \\n[#PRINT_STYLE]=2 \{\
5961 \!.        FAMILY  \\*[$TOC_TITLE_FAM]
5962 \!.        FT      \\*[$TOC_TITLE_FT]
5963 \!.        PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
5964 .       \}
5965 \!.     TRAP OFF
5966 .       ie \\n[#PRINT_STYLE]=1 \{\
5967 \!.        PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
5968 .       \}
5969 .       el \{\
5970 \!.        PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
5971 .       \}
5972 \!.    EOL
5973 \!.    ST 100 L
5974 \!.    ST 101 R
5975 .      if \\n[#PRINT_STYLE]=2 \{\
5976 \!.       FAMILY  \\*[$TOC_PN_FAM]
5977 \!.       FT      \\*[$TOC_PN_FT]
5978 \!.       PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
5979 .      \}
5980 \!.    TAB 100
5981 \!.    PRINT \\*[LEADER]
5982 \!.    TN
5983 \!.    TRAP
5984 \!.    PRINT \\n[#TOC_ENTRY_PN]
5985 \!.    TQ
5986 .      di       
5987 .      ev
5988 .    \}
5989 .    el \{\
5990 .       nr #FIRST_DOC_TITLE_PN \\n%+\\n[#PAGE_NUM_ADJ]
5991 .       af #FIRST_DOC_TITLE_PN \\g[#PAGENUMBER]
5992 .       nr #FIRST_DOC_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
5993 .    \}
5994 .\" End TITLE collection
5995 .    if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
5996 .       sp |\\n[#HEADER_MARGIN]u
5997 .       PRINT_PAGE_NUMBER
5998 .    \}
5999 .    rr #COLLATE
6000 .    rr #PAGINATION_STATE
6001 .\" End collate stuff
6002 .    ie \\n[#DOC_HEADER]=0 \{\
6003 .       PRINT \&
6004 .       if \\n[#DOC_TYPE]=4 \{\
6005 .          if !'\\n(.z'' \{ .di \}
6006 .       \}
6007 .       nr #STORED_PP_INDENT \\n[#PP_INDENT]
6008 .       PARA_INDENT 0
6009 .       PP
6010 .       PARA_INDENT \\n[#STORED_PP_INDENT]u
6011 .       rr #STORED_PP_INDENT
6012 .       ie r#ADVANCE_FROM_TOP \{\
6013 .          sp |\\n[#ADVANCE_FROM_TOP]u-1v
6014 .          if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
6015 .       \}
6016 .       el \{ .sp |\\n[#T_MARGIN]u-1v \}
6017 .       if \\n[#COLUMNS] \{\
6018 .          mk dc
6019 .          nr #COL_NUM 0 1
6020 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6021 .          nr #L_MARGIN \\n(.o
6022 .          ll \\n[#COL_L_LENGTH]u
6023 .       \}
6024 .       nr #PP 0
6025 .       rr #DOC_HEADER
6026 .       if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \}
6027 .    \}
6028 .    el \{\
6029 .       if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ] \}
6030 .       nr #DOCHEADER_LEAD \\n[#LEAD]
6031 .\" Default
6032 .       if \\n[#DOC_TYPE]=1 \{\
6033 .          PRINT \&
6034 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
6035 .          ev DOCHEADER
6036 .          if \\n[#DOCHEADER_COLOR]=1 \{\
6037 .             nf
6038 \m[\\*[$DOCHEADER_COLOR]]
6039 .             EOL
6040 .          \}
6041 .          L_MARGIN \\n[#DOC_L_MARGIN]u
6042 .          LL       \\n[#DOC_L_LENGTH]u
6043 .          ta \\n(.lu
6044 .          if \\n[#PRINT_STYLE]=1 \{\
6045 .             CENTER
6046 .             TYPEWRITER
6047 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
6048 .             el \{ .vs \\n[#DOC_LEAD]u \}
6049 .             CAPS
6050 .             if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
6051 .             CAPS OFF
6052 .             if !'\\*[$SUBTITLE]'' \{\
6053 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
6054 .                el \{ .vs \\n[#DOC_LEAD]u \}
6055 .             PRINT \\*[$SUBTITLE]
6056 .             \}
6057 .             if '\\*[$SUBTITLE]'' \{\
6058 .                ALD \\n[#DOC_LEAD]u
6059 .             \}
6060 .             ie !'\\*[$AUTHOR_1]'' \{\
6061 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
6062 .                el \{ .vs \\n[#DOC_LEAD]u/2u \}
6063 .                if !d$SUBTITLE \{\
6064 .                   ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6065 .                   el \{ .ALD \\n[#DOC_LEAD]u*2u \}
6066 .                \}
6067 .                PRINT \\*[$ATTRIBUTE_STRING]
6068 .                nr #AUTHORS \\n[#AUTHOR_NUM]
6069 .                nr #NEXT_AUTHOR 0 1
6070 .                while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6071 .                   PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
6072 .\}
6073 .                if \\n[#AUTHOR_LINES]=1 \{\
6074 .                    ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
6075 .                    el \{ .ALD \\n[#DOC_LEAD]u/2u \}
6076 .                \}
6077 .             \}
6078 .             el \{\
6079 .                ie !d$SUBTITLE \{\
6080 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
6081 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
6082 .                \}
6083 .                el \{\
6084 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
6085 .                   el \{ .ALD \\n[#DOC_LEAD]u \}
6086 .                \}
6087 .             \}
6088 .          \}
6089 .          if \\n[#PRINT_STYLE]=2 \{\
6090 .             DEFAULT_DOCHEADER
6091 .             di DOCHEADER_DIVERSION \" This diversion is only
6092 .             br                     \" necessary to find the depth of the
6093 .             DEFAULT_DOCHEADER      \" docheader
6094 .             br
6095 .             di
6096 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
6097 .                                                             \"in #DOCHEADER_DEPTH
6098 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
6099 .          \}
6100 .          ev
6101 .       \}
6102 .\" Chapter
6103 .       if \\n[#DOC_TYPE]=2 \{\
6104 .          PRINT \&
6105 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
6106 .          ev DOCHEADER
6107 .          if \\n[#DOCHEADER_COLOR]=1 \{\
6108 .             nf
6109 \m[\\*[$DOCHEADER_COLOR]]
6110 .             EOL
6111 .          \}
6112 .          L_MARGIN \\n[#DOC_L_MARGIN]u
6113 .          LL       \\n[#DOC_L_LENGTH]u
6114 .          ta \\n(.lu
6115 .          if \\n[#PRINT_STYLE]=1 \{\
6116 .             CENTER
6117 .             TYPEWRITER
6118 .             vs \\n[#DOC_LEAD]u
6119 .             ie '\\*[$CHAPTER]'' \{\
6120 .                CAPS
6121 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
6122 .                   PRINT \\*[$CHAPTER_TITLE]
6123 .                \}
6124 .                el \{\
6125 .                   CAPS
6126 .                   PRINT \\*[$CHAPTER_STRING]
6127 .                \}
6128 .                CAPS OFF
6129 .             \}
6130 .             el \{\
6131 .                CAPS
6132 .                PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6133 .                CAPS OFF
6134 .                if !'\\*[$CHAPTER_TITLE]'' \{\
6135 .                   if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6136 .                   UNDERSCORE "\\*[$CHAPTER_TITLE]
6137 .                \}
6138 .             \}
6139 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6140 .          \}
6141 .          if \\n[#PRINT_STYLE]=2 \{\
6142 .             CHAPTER_DOCHEADER
6143 .             di DOCHEADER_DIVERSION \" This diversion is only
6144 .             br                     \" necessary to find the depth of the
6145 .             CHAPTER_DOCHEADER      \" docheader
6146 .             br
6147 .             di
6148 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
6149 .                                                             \" in #DOCHEADER_DEPTH
6150 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
6151 .          \}
6152 .          ev
6153 .       \}
6154 .\" Named
6155 .       if \\n[#DOC_TYPE]=3 \{\
6156 .          PRINT \&
6157 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
6158 .          ev DOCHEADER
6159 .          if \\n[#DOCHEADER_COLOR]=1 \{\
6160 .             nf
6161 \m[\\*[$DOCHEADER_COLOR]]
6162 .             EOL
6163 .          \}
6164 .          L_MARGIN \\n[#DOC_L_MARGIN]u
6165 .          LL       \\n[#DOC_L_LENGTH]u
6166 .          ta \\n(.lu
6167 .          if \\n[#PRINT_STYLE]=1 \{\
6168 .             CENTER
6169 .             TYPEWRITER
6170 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
6171 .             el \{ .vs \\n[#DOC_LEAD]u \}
6172 .             CAPS
6173 .             if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
6174 .             CAPS OFF
6175 .             if !'\\*[$SUBTITLE]'' \{\
6176 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
6177 .                el \{ .vs \\n[#DOC_LEAD]u \}
6178 .                PRINT \\*[$SUBTITLE]
6179 .             \}
6180 .             if '\\*[$SUBTITLE]'' \{\
6181 .                ALD \\n[#DOC_LEAD]u
6182 .             \}
6183 .             ie !'\\*[$AUTHOR_1]'' \{\
6184 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
6185 .                el \{ .vs \\n[#DOC_LEAD]u/2u \}
6186 .                if !d$SUBTITLE \{\
6187 .                   ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6188 .                   el \{ .ALD \\n[#DOC_LEAD]u*2u \}
6189 .                \}
6190 .                PRINT \\*[$ATTRIBUTE_STRING]
6191 .                nr #AUTHORS \\n[#AUTHOR_NUM]
6192 .                nr #NEXT_AUTHOR 0 1
6193 .                while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6194 .                   PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
6195 .\}
6196 .                if \\n[#AUTHOR_LINES]=1 \{\
6197 .                    ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
6198 .                    el \{ .ALD \\n[#DOC_LEAD]u/2u \}
6199 .                 \}
6200 .             vs  \\n[#DOC_LEAD]u
6201 .             \}
6202 .             el \{\
6203 .                ie !d$SUBTITLE \{\
6204 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
6205 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
6206 .                \}
6207 .                el \{\
6208 .                   ie \\n[#SINGLE_SPACE] \{ . \}
6209 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
6210 .                \}
6211 .             \}
6212 .             ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
6213 .             el \{ .ALD \\n[#DOC_LEAD]u \}
6214 .             UNDERSCORE2 "\\*[$DOC_TYPE]
6215 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6216 .          \}
6217 .          if \\n[#PRINT_STYLE]=2 \{\
6218 .             NAMED_DOCHEADER
6219 .             di DOCHEADER_DIVERSION \" This diversion is only
6220 .             br                     \" necessary to find the depth of the
6221 .             NAMED_DOCHEADER        \" docheader
6222 .             br
6223 .             di
6224 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
6225 .                                                             \"in #DOCHEADER_DEPTH
6226 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
6227 .          \}
6228 .          ev
6229 .       \}
6230 .       if !\\n[#DOC_TYPE]=4 \{\
6231 .          if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
6232 .          nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD]
6233 .          ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]-\\n[#DOCHEADER_SPACE_ADJ] \}
6234 .          el \{ .nr #DOCHEADER_EXTRA_SPACE 0 \}
6235 .          if \\n[#PRINT_STYLE]=2 \{ .ALD (\\n[#DOC_LEAD]u*2u)+\\n[#DOCHEADER_EXTRA_SPACE]u \}
6236 .          if \\n[#COLUMNS] \{\
6237 .             nr #COL_NUM 0 1
6238 .             nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
6239 .             po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6240 .             nr #L_MARGIN \\n(.o
6241 .             LL \\n[#COL_L_LENGTH]u
6242 .             ta \\n(.lu
6243 .             mk dc
6244 .          \}
6245 .       \}
6246 .    \}
6247 .    LS \\n[#DOC_LEAD]u
6248 .    if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
6249 .    QUAD \\*[$DOC_QUAD]
6250 .    CLEANUP_DEFAULTS
6251 .    nr #START_FOR_FOOTERS 1
6252 .    if \\n[#COLLATED_DOC]=1 \{\
6253 .       if !\\n[MNinit_DEFERRED]=1 \{\
6254 .          MN_INIT rerun
6255 .       \}
6256 .    \}
6257 .    if \\n[#MNinit_DEFERRED]=1 \{\
6258 .       rr #MNinit_DEFERRED
6259 .       nr #START_FOR_MNinit 1
6260 .       MN_INIT \\*[$MN-arg1] \\*[$MN-arg2] \\*[$MN-arg3] \\*[$MN-arg4] \\*[$MN-arg5] \\*[$MN-arg6] \\*[$MN-arg7] \\*[$MN-arg8] \\*[$MN-arg9]
6261 .    \}
6262 .    nr #START_FOR_MNinit 2
6263 .    if !\\n[#DOC_TYPE]=4 \{ .em TERMINATE \}
6264 .    if \\n[#LINENUMBERS]=2 \{\
6265 .       NUMBER_LINES RESUME
6266 .       nr #LINENUMBERS 1
6267 .    \}
6268 .    if \\n[#RUN_ON]=1 \{\
6269 .       if \\n[#FN_MARKER_STYLE]=1 \{ .RUNON_WARNING \}
6270 .       if \\n[#FN_MARKER_STYLE]=2 \{ .RUNON_WARNING \}
6271 .    \}
6272 .END
6273 \#
6274 .MAC CLEANUP_DEFAULTS END
6275 .    nr #START 1
6276 .\" Family strings for docheader
6277 .    rm $AUTHOR_FAM
6278 .    rm $CHAPTER_TITLE_FAM
6279 .    rm $DOCTYPE_FAM
6280 .    rm $SUBTITLE_FAM
6281 .    rm $TITLE_FAM
6282 .\" Family strings for cover
6283 .    rm $COVER_AUTHOR_FAM
6284 .    rm $COVER_CHAPTER_TITLE_FAM
6285 .    rm $COVER_COPYRIGHT_FAM
6286 .    rm $COVER_DOCTYPE_FAM
6287 .    rm $COVER_LEAD_ADJ
6288 .    rm $COVER_SUBTITLE_FAM
6289 .    rm $COVER_TITLE_FAM
6290 .\" Family strings for doc cover
6291 .    rm $DOC_COVER_AUTHOR_FAM
6292 .    rm $DOC_COVER_CHAPTER_TITLE_FAM
6293 .    rm $DOC_COVER_COPYRIGHT_FAM
6294 .    rm $DOC_COVER_DOCTYPE_FAM
6295 .    rm $DOC_COVER_LEAD_ADJ
6296 .    rm $DOC_COVER_SUBTITLE_FAM
6297 .    rm $DOC_COVER_TITLE_FAM
6298 .\" Quad args to copyright and misc
6299 .    rm $COVER_COPYRIGHT_QUAD
6300 .    rm $COVER_MISC_QUAD
6301 .    rm $DOC_COVER_COPYRIGHT_QUAD
6302 .    rm $DOC_COVER_MISC_QUAD
6303 .\" Miscellaneous strings
6304 .    rm $TOC_TITLE_ITEM
6305 .    rm $DOCHEADER_LEAD_ADJ
6306 .\" Various registers
6307 .    rr #ADJ_DOC_LEAD
6308 .    rr #ADVANCE_FROM_TOP
6309 .    rr #AUTHOR_NUM
6310 .    rr #AUTHORS
6311 .    rr #COVER_LEAD
6312 .    rr #DEPTH_1
6313 .    rr #DEPTH_2
6314 .    rr #DOC_COVER_LEAD
6315 .    rr #DOCHEADER_ADVANCE
6316 .    rr #DOCHEADER_EXTRA_SPACE
6317 .    rr #DOCHEADER_LEAD
6318 .    rr #DOCHEADER_SPACE_ADJ
6319 .    rr #MISC_NUM
6320 .    rr #MISCS
6321 .    rr #NEXT_AUTHOR
6322 .    rr #NEXT_MISC
6323 .    rr #NUM_AUTHORS
6324 .END
6325 \#
6326 \# ====================================================================
6327 \#
6328 \# +++MACROS TO CHANGE SOME DEFAULTS+++
6329 \#
6330 \# DOCUMENT HEADER
6331 \# ---------------
6332 \# *Argument:
6333 \#   <none> | <anything> [distance to advance from top of page]
6334 \# *Function:
6335 \#   Turns printing of document header on or off.  If a second argument
6336 \#   in units of measure is given, advances that distance from the
6337 \#   top of the page without printing the document header.
6338 \# *Notes:
6339 \#   Default is on.  If the 1st argument is <anything> (which turns
6340 \#   document headers off), the optional 2nd argument may be given
6341 \#   (with a unit of measure).
6342 \#
6343 .MAC DOCHEADER END
6344 .    ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
6345 .    el \{\
6346 .       if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
6347 .       nr #DOC_HEADER 0
6348 .    \}
6349 .END
6350 \#
6351 \#
6352 \# DOCUMENT HEADER LEADING
6353 \# -----------------------
6354 \# *Arguments:
6355 \#   <+|- amount by which to in/decrease leading of doc header>
6356 \# *Function:
6357 \#   Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
6358 \# *Notes:
6359 \#   A unit of measure must be supplied.  Decimal fractions OK.
6360 \#   Default is +0, i.e. same as DOC_LEAD.
6361 \#
6362 .MAC DOCHEADER_LEAD END
6363 .    ds $DOCHEADER_LEAD_ADJ \\$1
6364 .END
6365 \#
6366 \#
6367 \# DOCHEADER ADVANCE
6368 \# -----------------
6369 \# *Arguments:
6370 \#   <docheader start position>
6371 \# *Function:
6372 \#   Creates register #DOCHEADER_ADVANCE, used in START.
6373 \# *Notes:
6374 \#   Unit of measure required.
6375 \#   Default is same as T_MARGIN.
6376 \#
6377 .MAC DOCHEADER_ADVANCE END
6378 .    nr #DOCHEADER_ADVANCE (\\$1)
6379 .END
6380 \#
6381 \#
6382 \# DOCUMENT LEFT MARGIN
6383 \# --------------------
6384 \# *Argument:
6385 \#   <left margin of document>
6386 \# *Function:
6387 \#   Creates or modifies register #DOC_L_MARGIN.
6388 \# *Notes:
6389 \#   Affects EVERYTHING on the page.
6390 \#
6391 .MAC DOC_LEFT_MARGIN END
6392 .    br
6393 .    nr #DOC_L_MARGIN (\\$1)
6394 .    L_MARGIN \\n[#DOC_L_MARGIN]u
6395 .END
6396 \#
6397 \#
6398 \# DOCUMENT RIGHT MARGIN
6399 \# ---------------------
6400 \# *Argument:
6401 \#   <right margin of document>
6402 \# *Function:
6403 \#   Creates or modifies register #DOC_R_MARGIN.
6404 \# *Notes:
6405 \#   Affects EVERYTHING on the page.
6406 \#
6407 .MAC DOC_RIGHT_MARGIN END
6408 .    br
6409 .    nr #DOC_R_MARGIN (\\$1)
6410 .    R_MARGIN \\n[#DOC_R_MARGIN]
6411 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
6412 .END
6413 \#
6414 \#
6415 \# DOCUMENT LINE LENGTH
6416 \# --------------------
6417 \# *Argument:
6418 \#   <line length of document>
6419 \# *Function:
6420 \#   Creates or modifies string $DOC_L_LENGTH.
6421 \# *Notes:
6422 \#   Affects EVERYTHING on the page.
6423 \#
6424 .MAC DOC_LINE_LENGTH END
6425 .    br
6426 .    nr #DOC_L_LENGTH (\\$1)
6427 .    LL \\n[#DOC_L_LENGTH]u
6428 .    ta \\n(.lu
6429 .END
6430 \#
6431 \#
6432 \# DOCUMENT FAMILY
6433 \# ---------------
6434 \# *Argument:
6435 \#   <family of running text>
6436 \# *Function:
6437 \#   Creates or modifies string $DOC_FAM.
6438 \# *Notes:
6439 \#   Affects everything EXCEPT headers and footers.
6440 \#
6441 .MAC DOC_FAMILY END
6442 .    br
6443 .    ds $DOC_FAM       \\$1
6444 .    ds $FAMILY        \\*[$DOC_FAM]
6445 .    TITLE_FAMILY      \\*[$DOC_FAM]
6446 .    SUBTITLE_FAMILY   \\*[$DOC_FAM]
6447 .    AUTHOR_FAMILY     \\*[$DOC_FAM]
6448 .    DOCTYPE_FAMILY    \\*[$DOC_FAM]
6449 .    HEAD_FAMILY       \\*[$DOC_FAM]
6450 .    SUBHEAD_FAMILY    \\*[$DOC_FAM]
6451 .    QUOTE_FAMILY      \\*[$DOC_FAM]
6452 .    BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
6453 .    EPIGRAPH_FAMILY   \\*[$DOC_FAM]
6454 .    HDRFTR_FAMILY     \\*[$DOC_FAM]
6455 .    FOOTNOTE_FAMILY   \\*[$DOC_FAM]
6456 .END
6457 \#
6458 \#
6459 \# DOCUMENT POINT SIZE
6460 \# -------------------
6461 \# *Argument:
6462 \#   <point size of running text>
6463 \# *Function:
6464 \#   Creates or modifies register #DOC_PT_SIZE.
6465 \# *Notes:
6466 \#   DOC_PT_SIZE is the basis for calculating all type sizes in
6467 \#   a document.
6468 \#
6469 .MAC DOC_PT_SIZE END
6470 .    if \\n[#IGNORE] \{ .return \}
6471 .    br
6472 .    PT_SIZE \\$1
6473 .    nr #DOC_PT_SIZE \\n[#PT_SIZE]
6474 .END
6475 \#
6476 \#
6477 \# DOCUMENT LEAD
6478 \# -------------
6479 \# *Argument:
6480 \#   <lead (".vs") of running text> [ADJUST]
6481 \# *Function:
6482 \#   Creates or modifies register #DOC_LEAD.  If the optional
6483 \#   ADJUST argument is given, adjusts leading so that the last
6484 \#   line of text falls exactly on #B_MARGIN.
6485 \# *Notes:
6486 \#   DOC_LEAD is the basis for calculating all leading changes in
6487 \#   a document.  Default for TYPESET is 16; 24 for TYPEWRITE.
6488 \#
6489 \#   Because the visible bottom or footer margin of a page depends
6490 \#   on the overall document lead supplied by the register #DOC_LEAD,
6491 \#   DOC_LEAD, in the body of a document, should always be associated
6492 \#   with the start of a new page (in other words, just before or
6493 \#   just after a manual NEWPAGE).
6494 \#
6495 .MAC DOC_LEAD END
6496 .    if \\n[#IGNORE] \{ .return \}
6497 .    br
6498 .    vs \\$1
6499 .    nr #DOC_LEAD \\n[#LEAD]
6500 .    if '\\$2'ADJUST' \{ .TRAPS \}
6501 .END
6502 \#
6503 \#
6504 \# ADJUST DOCUMENT LEAD
6505 \# --------------------
6506 \# *Arguments:
6507 \#   <none> | <anything>
6508 \# *Function:
6509 \#   Adjusts document lead so that the last line of text falls exactly
6510 \#   on #B_MARGIN.
6511 \#
6512 .MAC DOC_LEAD_ADJUST END
6513 .    ie '\\$1'' \{\
6514 .       nr #ADJ_DOC_LEAD 1
6515 .    \}
6516 .    el \{\
6517 .       nr #ADJ_DOC_LEAD 0
6518 .       nr #DOC_LEAD_ADJUST_OFF 1
6519 .    \}
6520 .END
6521 \#
6522 \#
6523 \# SHIM
6524 \# ----
6525 \# *Argument:
6526 \#   None
6527 \# *Function:
6528 \#   Advances to the next "legal" baseline.
6529 \# *Notes:
6530 \#   If a user plays around with spacing in a doc (say, with ALD),
6531 \#   it isn't easy to get mom back on track so she can achieve
6532 \#   perfectly flush bottom margins.  Any time SHIM is used, it
6533 \#   ensures that the next output line falls on a legal baseline.
6534 \#
6535 \# First, a little convenience macro
6536 \#
6537 .MAC PROCESS_SHIM END
6538 .    while \\n+[#LEGAL_BASELINE]<\\n[#CURRENT_V_POS] \{\
6539 .
6540 .\}
6541 .    nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
6542 .END
6543 \#
6544 \#
6545 .MAC SHIM END
6546 .    nr #LEGAL_BASELINE \\n[#T_MARGIN]-1v \\n[#DOC_LEAD]
6547 .    if !r#CURRENT_V_POS \{ .nr #CURRENT_V_POS \\n(.d \}
6548 .    ie r#ADVANCE_FROM_TOP \{\
6549 .       ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
6550 .          while \\n-[#LEGAL_BASELINE]>\\n[#CURRENT_V_POS] \{\
6551 .
6552 .\}
6553 .          nr #LEGAL_BASELINE +\\n[#DOC_LEAD]
6554 .          nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
6555 .       \}
6556 .       el \{\
6557 .          PROCESS_SHIM
6558 .       \}
6559 .    \}
6560 .    el \{\
6561 .       PROCESS_SHIM
6562 .    \}
6563 .    ALD \\n[#SHIM]u
6564 .    rr #CURRENT_V_POS
6565 .END
6566 \#
6567 \#
6568 \#
6569 \# ====================================================================
6570 \#
6571 \# +++INTERNATIONALIZATION+++
6572 \#
6573 \# ATTRIBUTE STRING
6574 \# ----------------
6575 \# *Argument:
6576 \#   <what goes in the "by" slot before author in the document header>
6577 \# *Function:
6578 \#   Creates or modifies string $ATTRIBUTE_STRING.
6579 \# *Notes:
6580 \#   Default is "by".  A blank string ("") may be used if no
6581 \#   attribution is desired.
6582 \#
6583 .MAC ATTRIBUTE_STRING END
6584 .    ds $ATTRIBUTE_STRING \\$1
6585 .END
6586 \#
6587 \#
6588 \# CHAPTER STRING
6589 \# --------------
6590 \# *Argument:
6591 \#   <what to print any time the word "chapter" is required>
6592 \# *Function:
6593 \#   Creates or modifies string $CHAPTER_STRING.
6594 \# *Notes:
6595 \#   Default is "chapter".
6596 \#
6597 .MAC CHAPTER_STRING END
6598 .    ds $CHAPTER_STRING \\$1
6599 .END
6600 \#
6601 \#
6602 \# DRAFT STRING
6603 \# ------------
6604 \# *Argument:
6605 \#   <what to print any time the word "draft" is required>
6606 \# *Function:
6607 \#   Creates or modifies string $DRAFT_STRING.
6608 \# *Notes:
6609 \#   Default is "draft".
6610 \#
6611 .MAC DRAFT_STRING END
6612 .    ds $DRAFT_STRING \\$1
6613 .END
6614 \#
6615 \#
6616 \# REVISION STRING
6617 \# ---------------
6618 \# *Argument:
6619 \#   <what to print any time the word "revision" is required>
6620 \# *Function:
6621 \#   Creates or modifies string $REVISION_STRING.
6622 \# *Notes:
6623 \#   Default is "revision".
6624 \#
6625 .MAC REVISION_STRING END
6626 .    ds $REVISION_STRING \\$1
6627 .END
6628 \#
6629 \#
6630 \# FINIS STRING
6631 \# ------------
6632 \# *Argument:
6633 \#   <what to print with the finis macro>
6634 \# *Function:
6635 \#   Creates or modifies string $FINIS_STRING.
6636 \# *Notes:
6637 \#   Default is "END".
6638 \#
6639 .MAC FINIS_STRING END
6640 .    nr #FINIS 1
6641 .    CAPS
6642 .    ds $FINIS_STRING \\$1
6643 .    CAPS OFF
6644 .END
6645 \#
6646 \#
6647 \# ====================================================================
6648 \#
6649 \# +++RECTO/VERSO+++
6650 \#
6651 \# RECTO_VERSO
6652 \# -----------
6653 \# *Arguments:
6654 \#   <none> | <anything>
6655 \# *Function:
6656 \#   Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages.  Also
6657 \#   switches page numbers left and right if either is chosen rather
6658 \#   than the default centered page numbers.  Switches left and right
6659 \#   margins if differing values have been entered.
6660 \# *Notes:
6661 \#   Default is OFF.
6662 \#
6663 .MAC RECTO_VERSO END
6664 .    ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
6665 .    el \{ .nr #RECTO_VERSO 0 \}
6666 .END
6667 \#
6668 \# ====================================================================
6669 \#
6670 \# +++EPIGRAPHS+++
6671 \#
6672 \# EPIGRAPH INDENT
6673 \# ---------------
6674 \# *Argument:
6675 \#   <value by which to multiply PP_INDENT for block epigraphs>
6676 \# *Function:
6677 \#   Creates or modifies register #EPI_OFFSET_VALUE.
6678 \# *Notes:
6679 \#   Default is 2 for TYPEWRITE, 3 for TYPESET.
6680 \#
6681 .MAC EPIGRAPH_INDENT END
6682 .    nr #EPI_OFFSET_VALUE \\$1
6683 .END
6684 \#
6685 \#
6686 \# EPIGRAPH AUTOLEAD
6687 \# -----------------
6688 \# *Argument:
6689 \#   <amount of lead to add to the epigraph ps for epigraph leading>
6690 \# *Function:
6691 \#   Creates or modifies register #EPI_AUTOLEAD.
6692 \# *Notes:
6693 \#   Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
6694 \#
6695 .MAC EPIGRAPH_AUTOLEAD END
6696 .    nr #EPI_AUTOLEAD \\$1
6697 .END
6698 \#
6699 \#
6700 \# EPIGRAPH
6701 \# --------
6702 \# *Arguments:
6703 \#   BLOCK | <anything>
6704 \# *Function:
6705 \#   Places an epigraph before the document's text, after the
6706 \#   document header, or after a HEAD.
6707 \# *Notes:
6708 \#   #EPIGRAPH 1 = centered; 2 = block
6709 \#
6710 \#   By default, epigraphs are centered, allowing the user
6711 \#   to input them on a line per line basis.  To change this
6712 \#   behaviour, the user can supply the argument BLOCK, which
6713 \#   will produce indented, filled text similar to BLOCKQUOTE.
6714 \#
6715 \#   If a block epigraph contains more than one para, ALL paras of
6716 \#   the epigraph must be preceded by PP.  Otherwise, PP is optional.
6717 \#
6718 .MAC EPIGRAPH END
6719 .    nr #PP_STYLE 2
6720 .    nr #Q_PP     0
6721 .    if \\n[#LINENUMBERS]=1 \{\
6722 .       NUMBER_LINES OFF
6723 .       nr #LINENUMBERS 2
6724 .    \}
6725 .    if \\n[#START] \{\
6726 .       if \\n[#PRINT_STYLE]=1 \{\
6727 .          if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
6728 .       \}
6729 .    \}
6730 .    ie '\\$1'' \{\
6731 .       nr #EPIGRAPH 1
6732 .       ev EPIGRAPH
6733 .       nr #IN_DIVER 1
6734 .       ll \\n[#L_LENGTH]u
6735 .       ta \\n(.lu
6736 .       CHECK_INDENT
6737 .       if \\n[#COLUMNS] \{\
6738 .          ie \\n[#START] \{\
6739 .              ll \\n[#DOC_L_LENGTH]u
6740 .              ta \\n(.lu
6741 .          \}
6742 .          el \{\
6743 .             ll \\n[#COL_L_LENGTH]u
6744 .             ta \\n(.lu
6745 .          \}
6746 .       \}
6747 .       CENTER
6748 .       if \\n[#PRINT_STYLE]=1 \{\
6749 .          fam C
6750 .          ft  R
6751 .          if '\\*[$EPI_FT]'I' \{\
6752 .             FT I
6753 .          \}
6754 .          ps  12
6755 .          ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
6756 .          el \{ .vs  \\n[#DOC_LEAD]u/2u \}
6757 .          nr #EPI_LEAD      \\n[#LEAD]
6758 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
6759 .       \}
6760 .       if \\n[#PRINT_STYLE]=2 \{\
6761 .          FAMILY   \\*[$EPI_FAM]
6762 .          FT       \\*[$EPI_FT]
6763 .          PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
6764 .          if \\n[#EPI_COLOR]=1 \{\
6765 .             nf
6766 \m[\\*[$EPI_COLOR]]
6767 .             EOL
6768 .          \}
6769 .          AUTOLEAD \\n[#EPI_AUTOLEAD]
6770 .          nr #EPI_LEAD      \\n[#LEAD]
6771 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
6772 .       \}
6773 .       di EPI_TEXT
6774 .       nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
6775 .       HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
6776 .       hy 14
6777 .       nr #EPI_ACTIVE 1
6778 .    \}
6779 .    el \{\
6780 .       ie '\\$1'BLOCK' \{\
6781 .          nr #EPIGRAPH 2
6782 .          ev EPIGRAPH
6783 .          ie \\n[#START] \{\
6784 .             ie \\n[#COLUMNS] \{\
6785 .                ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
6786 .                ta \\n(.lu
6787 .             \}
6788 .             el \{\
6789 .                ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
6790 .                ta \\n(.lu
6791 .             \}
6792 .          \}
6793 .          el \{\
6794 .             ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
6795 .             ta \\n(.lu
6796 .             if \\n[#COLUMNS] \{\
6797 .                ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
6798 .                ta \\n(.lu
6799 .             \}
6800 .             CHECK_INDENT
6801 .          \}
6802 .          if \\n[#PRINT_STYLE]=1 \{\
6803 .             fam C
6804 .             ft  R
6805 .             if '\\*[$EPI_FT]'I' \{\
6806 .                FT I
6807 .             \}
6808 .             ps  12
6809 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
6810 .             el \{ .vs  \\n[#DOC_LEAD]u/2u \}
6811 .             QUAD LEFT
6812 .             HY OFF
6813 .             nr #EPI_LEAD \\n[#LEAD]
6814 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
6815 .             di EPI_TEXT
6816 .             nr #EPI_ACTIVE 1
6817 .          \}
6818 .          if \\n[#PRINT_STYLE]=2 \{\
6819 .             FAMILY   \\*[$EPI_FAM]
6820 .             FT       \\*[$EPI_FT]
6821 .             PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
6822 .          if \\n[#EPI_COLOR]=1 \{\
6823 .             nf
6824 \m[\\*[$EPI_COLOR]]
6825 .             EOL
6826 .          \}
6827 .             AUTOLEAD \\n[#EPI_AUTOLEAD]
6828 .             QUAD     \\*[$EPI_QUAD]
6829 .             nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
6830 .             HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
6831 .             hy 14
6832 .             nr #EPI_LEAD \\n[#LEAD]
6833 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
6834 .             di EPI_TEXT
6835 .             nr #EPI_ACTIVE 1
6836 .          \}
6837 .       \}
6838 .       el \{\
6839 .          DO_EPIGRAPH
6840 .       \}
6841 .    \}
6842 .END
6843 \#
6844 \#
6845 \# DO EPIGRAPH
6846 \# -----------
6847 \# *Arguments:
6848 \#   <none>
6849 \# *Function:
6850 \#   Ends diversion started in EPIGRAPH.  Makes spacing
6851 \#   adjustments to compensate for the difference between epigraph
6852 \#   leading and overall document leading, so that the bottom of
6853 \#   the pages remain flush.
6854 \# *Notes:
6855 \#   In addition to its usual place at the beginning of a
6856 \#   document, EPIGRAPH may also be used after HEAD.
6857 \#
6858 .MAC DO_EPIGRAPH END
6859 .    br
6860 .    di
6861 .    rr #IN_DIVER
6862 .    if \\n[#RESET_FN_COUNTERS]=2 \{\
6863 .       if !\\n[#FN_COUNT]=1 \{\
6864 .          if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
6865 .             DIVER_FN_2_POST
6866 .             rr #RESET_FN_COUNTERS
6867 .          \}
6868 .       \}
6869 .    \}
6870 .    nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
6871 .    nr #DONE_ONCE 0 1
6872 .    REMOVE_INDENT
6873 .    ev
6874 .    nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
6875 .    nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
6876 .    ie \\n[#START] \{\
6877 .       RLD \\n[#SHIM]u
6878 .       nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
6879 .       while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6880 .             nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
6881 .\}
6882 .       if \\n[#PRINT_STYLE]=2 \{\
6883 .          RLD \\n[#DOC_LEAD]u
6884 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
6885 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
6886 .          \}
6887 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6888 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
6889 .          \}
6890 .       \}
6891 .    \}
6892 .    el \{\
6893 .       ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
6894 .          nr #EPI_FITS 1
6895 .          nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
6896 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6897 .                nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
6898 .\}
6899 .          ie \\n[#PRINT_STYLE]=1 \{\
6900 .             if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
6901 .          \}
6902 .          el \{\
6903 .             if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
6904 .                ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
6905 .             \}
6906 .             if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6907 .                ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
6908 .             \}
6909 .          \}
6910 .          if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
6911 .       \}
6912 .       el \{\
6913 .          nr #EPI_LINES_TO_TRAP 0 1
6914 .          while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\
6915 .                nr #LOOP 1
6916 .\}
6917 .          nr #EPI_LINES_TO_TRAP -1
6918 .          nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
6919 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6920 .                nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
6921 .\}
6922 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
6923 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
6924 .      \}
6925 .    \}
6926 .    if \\n[#EPIGRAPH]=1 \{\
6927 .       po \\n[#L_MARGIN]u
6928 .       if \\n[#COLUMNS] \{\
6929 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
6930 .          nr #L_MARGIN \\n(.o
6931 .       \}
6932 .    \}
6933 .    if \\n[#EPIGRAPH]=2 \{\
6934 .       nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6935 .       if \\n[#COLUMNS] \{\
6936 .          nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6937 .       \}
6938 .       po \\n[#EPI_OFFSET]u
6939 .    \}
6940 .    nf
6941 .    EPI_TEXT
6942 .    br
6943 .    ie \\n[#START] \{\
6944 .       if \\n[#PRINT_STYLE]=1 \{\
6945 .          ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6946 .          el \{\
6947 .             ie \\n[#EPI_LINES]%2=1 \{ .ALD \\n[#DOC_LEAD]u \}
6948 .             el \{ .ALD \\n[#DOC_LEAD]u/2u \}
6949 .          \}
6950 .          SHIM
6951 .       \}
6952 .       if \\n[#PRINT_STYLE]=2 \{\
6953 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
6954 .             ALD \\n[#EPI_WHITESPACE]u/2u
6955 .          \}
6956 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6957 .             ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
6958 .          \}
6959 .          SHIM
6960 .       \}
6961 .    \}
6962 .    el \{\
6963 .       rr #EPI_ACTIVE
6964 .       ie \\n[#EPI_FITS] \{\
6965 .          ie \\n[#FN_FOR_EPI] \{\
6966 .             nr #EPI_LINES_TO_END 1
6967 .             nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
6968 .             while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6969 .                   nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
6970 .\}
6971 .             ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
6972 .          \}
6973 .          el \{\
6974 .             ie \\n[#PRINT_STYLE]=1 \{\
6975 .                if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
6976 .             \}
6977 .             el \{\
6978 .                if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
6979 .                   ALD \\n[#EPI_WHITESPACE]u/2u
6980 .                \}
6981 .                if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6982 .                   ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
6983 .                \}
6984 .             \}
6985 .          \}
6986 .       \}
6987 .       el \{\
6988 .          nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
6989 .          if \\n[#LOOP] \{ .nr #EPI_LINES_TO_END +1 \}
6990 .          rr #LOOP
6991 .          nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
6992 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6993 .                nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
6994 .\}
6995 .          ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
6996 .          if \\n[#PRINT_STYLE]=1 \{\
6997 .             if !\\n[#SINGLE_SPACE] \{\
6998 .                nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
6999 .                ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
7000 .                el \{ .RLD .5v \}
7001 .                rr #EPI_LINES_EVEN
7002 .             \}
7003 .          \}
7004 .       \}
7005 .    \}
7006 .    nr #PP_STYLE 1
7007 .    rr #EPI_FITS
7008 .    ALD \\n[#DOC_LEAD]u
7009 .    QUAD \\*[$DOC_QUAD]
7010 .    po \\n[#L_MARGIN]u
7011 .    if \\n[#COLUMNS] \{\
7012 .       po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
7013 .       nr #L_MARGIN \\n(.o
7014 .    \}
7015 .    if \\n[#START] \{\
7016 .       if \\n[#COLUMNS] \{\
7017 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
7018 .          nr #L_MARGIN \\n(.o
7019 .          mk dc
7020 .       \}
7021 .    \}
7022 .    if \\n[#LINENUMBERS]=2 \{\
7023 .       NUMBER_LINES RESUME
7024 .       nr #LINENUMBERS 1
7025 .    \}
7026 .END
7027 \#
7028 \# ====================================================================
7029 \#
7030 \# +++FINIS MACRO+++
7031 \#
7032 \# FINIS
7033 \# -----
7034 \# *Arguments:
7035 \#   <none>
7036 \# *Function:
7037 \#   Deposits --END-- at the end of a document.
7038 \#
7039 .MAC FINIS END
7040 .    br
7041 .    ev FINIS
7042 .    evc 0
7043 .    if \\n[#TAB_ACTIVE] \{ .TQ \}
7044 .    if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
7045 .    nr #EM_ADJUST (1m/8)
7046 .    if \\n[#COLUMNS] \{\
7047 .       po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
7048 .       nr #L_MARGIN \\n(.o
7049 .    \}
7050 .    ALD \\n[#DOC_LEAD]u
7051 .    CENTER
7052 .    if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
7053 .    if \\n[#PRINT_STYLE]=2 \{\
7054 .       ie \\n[#FINIS_COLOR] \{\
7055 .          PRINT "\m[\\*[$FINIS_COLOR]]\v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em\m[]
7056 .       \}
7057 .       el \{ .PRINT \v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em\m[] \}
7058 .    \}
7059 .    ev
7060 .END
7061 \#
7062 \# ====================================================================
7063 \#
7064 \# +++HEADERS/FOOTERS+++
7065 \#
7066 \# Define a string so that the current page number can be incorporated
7067 \# into the strings for hdrftr left, right, and center.  NOTE: This is
7068 \# not the same thing as using the shortform # in hdrftr strings.
7069 \#
7070 .ds PAGE# \En[#PAGENUMBER]
7071 \#
7072 \#
7073 \# HDRFTR RULE GAP
7074 \# ---------------
7075 \# *Argument:
7076 \#   <amount of space between header/footer and header/footer rule>
7077 \# *Function:
7078 \#   Creates or modifies register #HDRFTR_RULE_GAP to hold amount
7079 \#   of space between header/footer and header/footer rule.
7080 \# *Notes:
7081 \#   Default is 4p.
7082 \#
7083 .MAC HDRFTR_RULE_GAP END
7084 .    nr #HDRFTR_RULE_GAP (\\$1)
7085 .END
7086 \#
7087 \#
7088 \# HDRFTR LEFT
7089 \# -----------
7090 \# *Argument:
7091 \#   <what to put in the left position of page header/footers>
7092 \# *Function:
7093 \#   Creates or modifies string $HDRFTR_LEFT.
7094 \#   Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
7095 \#   overrides the $HDRFTR_LEFT string created by default
7096 \#   in DEFAULTS.
7097 \# *Notes:
7098 \#   Especially useful if doc has more than one author, and a list
7099 \#   of authors by last name is desired in header/footers.
7100 \#   Default is author.
7101 \#
7102 \#   If the argument is the # character, simply prints the current
7103 \#   page number.
7104 \#
7105 \#   If the user wants to *incorporate* the page number into the string,
7106 \#   \*[PAGE#] must be used.  For example, if the user wants to put
7107 \#   an elipsis before the page number in the string, s/he should use
7108 \#   ...\*[PAGE#], not ...#
7109 \#
7110 .MAC HDRFTR_LEFT END
7111 .    nr #USER_DEF_HDRFTR_LEFT 1
7112 .    ds $HDRFTR_LEFT \\$1
7113 .END
7114 \#
7115 \#
7116 \# HDRFTR LEFT CAPS
7117 \# ----------------
7118 \# *Argument:
7119 \#   <none> | <anything>
7120 \# *Function:
7121 \#   Turns capitalisation of $HDRFTR_LEFT (typically, the author of
7122 \#   the document) on or off.
7123 \# *Notes:
7124 \#   Default is on.
7125 \#
7126 .MAC HDRFTR_LEFT_CAPS END
7127 .    ie '\\$1'' \{\
7128 .        nr #HDRFTR_LEFT_CAPS 1
7129 .    \}
7130 .    el \{\
7131 .       nr #HDRFTR_LEFT_CAPS 0
7132 .       ds $HDRFTR_LEFT_SIZE_CHANGE +0
7133 .    \}
7134 .END
7135 \#
7136 \#
7137 \# HDRFTR CENTER
7138 \# -------------
7139 \# *Argument:
7140 \#   <what to put in the centre position of page header/footers>
7141 \# *Function:
7142 \#   Creates or modifies string $HDRFTR_CENTER.
7143 \#   Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
7144 \#   overrides the $HDRFTR_CENTER string created by default
7145 \#   in COPYSTYLE.
7146 \# *Notes:
7147 \#   Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
7148 \#   CHAPTER, draft and revision number if COPYSTYLE DRAFT.
7149 \#
7150 \#   If the argument is the # character, simply prints the current
7151 \#   page number.
7152 \#
7153 \#   If the user wants to *incorporate* the page number into the string,
7154 \#   \*[PAGE#] must be used.  For example, if the user wants to put
7155 \#   an elipsis before the page number in the string, s/he should use
7156 \#   ...\*[PAGE#], not ...#
7157 \#
7158 .MAC HDRFTR_CENTER END
7159 .    nr #USER_DEF_HDRFTR_CENTER 1
7160 .    if '\\$0'FOOTER_CENTER' \{\
7161 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
7162 .       ds $HDRFTR_CENTER_NEW \\$1
7163 .    \}
7164 .    if '\\$0'FOOTER_CENTRE' \{\
7165 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
7166 .       ds $HDRFTR_CENTER_NEW \\$1
7167 .    \}
7168 .    ds $HDRFTR_CENTER \\$1
7169 .END
7170 \#
7171 \#
7172 \# HDRFTR CENTER CAPS
7173 \# ------------------
7174 \# *Argument:
7175 \#   <none> | <anything>
7176 \# *Function:
7177 \#   Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
7178 \#   the document) on or off.
7179 \# *Notes:
7180 \#   Default is on.
7181 \#
7182 .MAC HDRFTR_CENTER_CAPS END
7183 .    ie '\\$1'' \{\
7184 .       nr #HDRFTR_CENTER_CAPS 1
7185 .    \}
7186 .    el \{\
7187 .       nr #HDRFTR_CENTER_CAPS 0
7188 .       ds $HDRFTR_CENTER_SIZE_CHANGE +0
7189 .    \}
7190 .END
7191 \#
7192 \#
7193 \# HDRFTR CENTER PADDING
7194 \# ---------------------
7195 \# *Argument:
7196 \#   LEFT | RIGHT <amount of padding to put left or right of hdrftr
7197 \#   center string>
7198 \# *Function:
7199 \#   Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
7200 \#   #HDRFTR_CTR_PAD_RIGHT.
7201 \# *Notes:
7202 \#   By default, the HDRFTR_CENTER string is centered on the doc
7203 \#   line length.  Long titles or long author names can screw up
7204 \#   visual centering, or create overprints.  This macro allows the
7205 \#   user to pad the center string by the specified amount of space
7206 \#   to fix these problems.  Use only one of LEFT or RIGHT.
7207 \#
7208 \#   A unit of measure is required.
7209 \#
7210 .MAC HDRFTR_CENTER_PAD END
7211 .    if '\\$1'LEFT' \{\
7212 .       nr #HDRFTR_CTR_PAD_LEFT (\\$2)
7213 .    \}
7214 .    if '\\$1'RIGHT' \{\
7215 .       nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
7216 .    \}
7217 .END
7218 \#
7219 \#
7220 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
7221 \# --------------------------------
7222 \# *Argument:
7223 \#   <none>
7224 \# *Function:
7225 \#   Switches the padding side of hdrftr center padding.
7226 \# *Notes:
7227 \#   Required to keep spacing around hdrftr string constant
7228 \#   in recto/verso documents.
7229 \#
7230 .MAC SWITCH_HDRFTR_CENTER_PAD END
7231 .    nr #HDRFTR_CTR_PAD_TMP  \\n[#HDRFTR_CTR_PAD_LEFT]
7232 .    HDRFTR_CENTER_PAD LEFT  \\n[#HDRFTR_CTR_PAD_RIGHT]u
7233 .    HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
7234 .END
7235 \#
7236 \#
7237 \# HDRFTR RIGHT
7238 \# ------------
7239 \# *Argument:
7240 \#   <what to put in the right position of page header/footers>
7241 \# *Function:
7242 \#   Creates or modifies string $HDRFTR_RIGHT.
7243 \#   Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
7244 \#   overrides the $HDRFTR_RIGHT string created by default
7245 \#   in DEFAULTS.
7246 \# *Notes:
7247 \#   Default is document title.
7248 \#
7249 \#   If the argument is the # character, simply prints the current
7250 \#   page number.
7251 \#
7252 \#   If the user wants to *incorporate* the page number into the string,
7253 \#   \*[PAGE#] must be used.  For example, if the user wants to put
7254 \#   an elipsis before the page number in the string, s/he should use
7255 \#   ...\*[PAGE#], not ...#
7256 \#
7257 .MAC HDRFTR_RIGHT END
7258 .    nr #USER_DEF_HDRFTR_RIGHT 1
7259 .    ds $HDRFTR_RIGHT \\$1
7260 .END
7261 \#
7262 \#
7263 \# HDRFTR RIGHT CAPS
7264 \# -----------------
7265 \# *Argument:
7266 \#   <none> | <anything>
7267 \# *Function:
7268 \#   Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
7269 \#   the document) on or off.
7270 \# *Notes:
7271 \#   Default is on.
7272 \#
7273 .MAC HDRFTR_RIGHT_CAPS END
7274 .    ie '\\$1'' \{\
7275 .       nr #HDRFTR_RIGHT_CAPS 1
7276 .    \}
7277 .    el \{\
7278 .       nr #HDRFTR_RIGHT_CAPS 0
7279 .       ds $HDRFTR_RIGHT_SIZE_CHANGE +0
7280 .    \}
7281 .END
7282 \#
7283 \#
7284 \# HDRFTR RULE
7285 \# -----------
7286 \# *Arguments:
7287 \#   <none> | <anything>
7288 \# *Function:
7289 \#   If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
7290 \#   under the header/over the footer.  Otherwise, turns HDRFTR_RULE
7291 \#    on or off.
7292 \#
7293 .MAC HDRFTR_RULE END   \"To print rule under header/over footer.
7294 .    ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
7295 .       ie \\n[#USERDEF_HDRFTR] \{\
7296 .          nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
7297 .          ps 12
7298 .          if \\n[#HEADERS_ON] \{\
7299 .             rt \\nyu
7300 .             ALD \\n[#HDRFTR_RULE_GAP]u
7301 .          \}
7302 .          if \\n[#FOOTERS_ON] \{\
7303 .              rt \\nyu
7304 .              RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
7305 .          \}
7306 .          ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
7307 .             PRINT \m[\\*[$HDRFTR_RULE_COLOR]]\\l'\\n[#DOC_L_LENGTH]u'\m[]
7308 .          \}
7309 .          el \{\
7310 .             PRINT \\l'\\n[#DOC_L_LENGTH]u'
7311 .          \}
7312 .          br
7313 .       \}
7314 .       el \{\
7315 .          if \\n[#PRINT_STYLE]=1 \{\
7316 .             nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
7317 .          \}
7318 .          if \\n[#PRINT_STYLE]=2 \{\
7319 .             ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
7320 .                nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
7321 .             \}
7322 .             el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
7323 .             ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
7324 .                nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
7325 .             \}
7326 .             el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
7327 .          \}
7328 .          ps 12
7329 .          if \\n[#HEADERS_ON] \{\
7330 .             rt \\nyu
7331 .             ALD \\n[#HDRFTR_RULE_GAP]u
7332 .          \}
7333 .          if \\n[#FOOTERS_ON] \{\
7334 .             rt \\nyu
7335 .             RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
7336 .          \}
7337 .          ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
7338 .             PRINT \m[\\*[$HDRFTR_RULE_COLOR]]\\l'\\n[#DOC_L_LENGTH]u'\m[]
7339 .          \}
7340 .          el \{\
7341 .             PRINT \\l'\\n[#DOC_L_LENGTH]u'
7342 .          \}
7343 .          br
7344 .       \}
7345 .    \}
7346 .    el \{\
7347 .       ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
7348 .       el \{ .nr #HDRFTR_RULE 0 \}
7349 .    \}
7350 .END
7351 \#
7352 \#
7353 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
7354 \#
7355 \#
7356 \# HDRFTR PLAIN
7357 \# ------------
7358 \# *Arguments:
7359 \#   <none>
7360 \# *Function:
7361 \#   Sets the family, font, and point size of all strings in
7362 \#   header/footers to the same family and point size as running
7363 \#   text.  Font for the header/footer becomes roman throughout.
7364 \#
7365 .MAC HDRFTR_PLAIN END
7366 .    HDRFTR_FAMILY        \\*[$DOC_FAM]
7367 .    HDRFTR_PT_SIZE       \\n[#DOC_PT_SIZE]
7368 .    HDRFTR_LEFT_FAMILY   \\*[$DOC_FAM]
7369 .    HDRFTR_LEFT_FONT     R
7370 .    HDRFTR_LEFT_SIZE     +0
7371 .    HDRFTR_LEFT_CAPS     OFF
7372 .    HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
7373 .    HDRFTR_CENTER_FONT   R
7374 .    HDRFTR_CENTER_SIZE   +0
7375 .    HDRFTR_CENTER_CAPS   OFF
7376 .    HDRFTR_RIGHT_FAMILY  \\*[$DOC_FAM]
7377 .    HDRFTR_RIGHT_FONT    R
7378 .    HDRFTR_RIGHT_SIZE    +0
7379 .    HDRFTR_RIGHT_CAPS    OFF
7380 .END
7381 \#
7382 \#
7383 \# SWITCH HDRFTR
7384 \# -------------
7385 \# *Arguments:
7386 \#   <none> | <anything>
7387 \# *Function:
7388 \#   Creates or modifies register #SWITCH_HDRFTR, used to switch
7389 \#   default location of HDRFTR_LEFT and HDRFTR_RIGHT.
7390 \# *Notes:
7391 \#
7392 .ig
7393 Typically, the author string appears at the left of header/footers,
7394 and the title string appears at the right.  This switches the
7395 location of the two.  Useful in conjuction with RECTO_VERSO to tweak
7396 switches on alternate pages to come out as the user wishes.  The
7397 assumption of RECTO_VERSO is that the first page of the document
7398 (recto) is odd, and even though it has no header/footer, if it did
7399 have one, it would print as AUTHOR...CENTER...TITLE (or whatever
7400 strings the user has supplied for HDRFTR_LEFT/RIGHT), meaning that
7401 the next page, which does have a header/footer, will come out as
7402 TITLE...CENTER...AUTHOR (or whatever strings the user has supplied
7403 for HDRFTR_LEFT/RIGHT).  SWITCH_HDRFTRS allows the user to get the
7404 desired string in the desired place on the desired recto/verso page.
7405
7406 Default is OFF.
7407 ..
7408 \#
7409 .MAC SWITCH_HDRFTR END
7410 .    ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
7411 .    el \{ .nr #SWITCH_HDRFTR 0 \}
7412 .END
7413 \#
7414 \#
7415 \# USER DEFINED HDRFTR RECTO
7416 \# -------------------------
7417 \# *Arguments:
7418 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
7419 \# *Function:
7420 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
7421 \#   stores string in $USERDEF_HDRFTR_RECTO.
7422 \# *Notes:
7423 \#   For use when users don't want 3-part headers/footers, but rather
7424 \#   want to design their own headers/footers and need different
7425 \#   headers/footers on recto and verso pages.  Using just
7426 \#   HEADER_RECTO, even when recto/verso is not on, allows users to
7427 \#   design their own headers/footers for doc pages.
7428 \#
7429 .MAC HDRFTR_RECTO END
7430 .    nr #USERDEF_HDRFTR 1
7431 .    if '\\$1'L'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
7432 .    if '\\$1'LEFT'   \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
7433 .    if '\\$1'C'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
7434 .    if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
7435 .    if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
7436 .    if '\\$1'R'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
7437 .    if '\\$1'RIGHT'  \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
7438 .    ds $USERDEF_HDRFTR_RECTO \\$2
7439 .END
7440 \#
7441 \#
7442 \# USER DEFINED HDRFTR VERSO
7443 \# -------------------------
7444 \# *Arguments:
7445 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
7446 \# *Function:
7447 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
7448 \#   stores string in $USERDEF_HDRFTR_VERSO.
7449 \# *Notes:
7450 \#   For use when users don't want 3-part headers/footers, but rather
7451 \#   want to design their own headers/footers and need different
7452 \#   headers/footers on recto and verso pages.
7453 \#
7454 .MAC HDRFTR_VERSO END
7455 .    nr #USERDEF_HDRFTR 1
7456 .    if '\\$1'L'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
7457 .    if '\\$1'LEFT'   \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
7458 .    if '\\$1'C'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
7459 .    if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
7460 .    if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
7461 .    if '\\$1'R'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
7462 .    if '\\$1'RIGHT'  \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
7463 .    ds $USERDEF_HDRFTR_VERSO \\$2
7464 .END
7465 \#
7466 \#
7467 \# PRINT FOOTER ON FIRST PAGE
7468 \# --------------------------
7469 \# *Arguments:
7470 \#   <none> | <anything>
7471 \# *Function:
7472 \#   Toggles register #PRINT_FOOTER_ON_PAGE_1
7473 \# *Notes:
7474 \#   Lets user choose whether to print footer on first
7475 \#   page of doc.
7476 \#
7477 .MAC FOOTER_ON_FIRST_PAGE END
7478 .    ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
7479 .    el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
7480 .END
7481 \#
7482 \#
7483 \# PRINT PAGE NUMBER ON FIRST PAGE
7484 \# -------------------------------
7485 \# *Arguments:
7486 \#   <none> | <anything>
7487 \# *Function:
7488 \#   Toggles register #PRINT_PAGENUM_ON_PAGE_1
7489 \# *Notes:
7490 \#   Lets user choose whether to print page number on first
7491 \#   page of doc and after collate when footers are on or page numbering
7492 \#   has been user set at top of page.
7493 \#
7494 .MAC PAGENUM_ON_FIRST_PAGE END
7495 .    ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
7496 .    el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
7497 .END
7498 \#
7499 \#
7500 \# PRINT HEADER/FOOTER
7501 \# -------------------
7502 \# *Arguments:
7503 \#   <none>
7504 \# *Function:
7505 \#   Based on defaults or values entered by user, prints a
7506 \#   three-part title at either the top or the bottom of the page.
7507 \# *Notes:
7508 \#   Called from within either HEADER or FOOTER.
7509 \#
7510 .MAC PRINT_HDRFTR END
7511 .    if \\n[#DOC_TYPE]=4 \{\
7512 .       nr #SUITE \En[.pn]
7513 .    \}
7514 .    if \\n[#FOOTERS_ON] \{\
7515 .       if \\n[#START_FOR_FOOTERS] \{\
7516 .          rr #START_FOR_FOOTERS
7517 .          if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{ .return \}
7518 .       \}
7519 .    \}
7520 .    if \\n[#USERDEF_HDRFTR] \{\
7521 .       PRINT_USERDEF_HDRFTR
7522 .       return
7523 .    \}
7524 .    if \\n[#SWITCH_HDRFTR] \{\
7525 .       ds $HDRFTR_TMP_SWITCH             \\*[$HDRFTR_LEFT]
7526 .       ds $HDRFTR_LEFT                   \\*[$HDRFTR_RIGHT]
7527 .       ds $HDRFTR_RIGHT                  \\*[$HDRFTR_TMP_SWITCH]
7528 .       ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
7529 .       ds $HDRFTR_LEFT_SIZE_CHANGE       \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
7530 .       ds $HDRFTR_RIGHT_SIZE_CHANGE      \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
7531 .       nr #HDRFTR_TMP_CAPS_SWITCH        \\n[#HDRFTR_LEFT_CAPS]
7532 .       nr #HDRFTR_LEFT_CAPS              \\n[#HDRFTR_RIGHT_CAPS]
7533 .       nr #HDRFTR_RIGHT_CAPS             \\n[#HDRFTR_TMP_CAPS_SWITCH]
7534 .       ds $HDRFTR_TMP_COLOR_SWITCH       \\*[$HDRFTR_LEFT_COLOR]
7535 .       ds $HDRFTR_LEFT_COLOR             \\*[$HDRFTR_RIGHT_COLOR]
7536 .       ds $HDRFTR_RIGHT_COLOR            \\*[$HDRFTR_TMP_COLOR_SWITCH]
7537 .       rr #HDRFTR_TMP_CAPS_SWITCH
7538 .       rm $HDRFTR_TMP_SWITCH
7539 .       rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
7540 .       rm $HDRFTR_TMP_COLOR_SWITCH
7541 .       nr #SWITCH_HDRFTR 0
7542 .    \}
7543 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
7544 .    if \\n[#ENDNOTES] \{ .PAGENUM_STYLE \\*[$EN_PN_STYLE] \}
7545 .    if \\n[#PRINT_STYLE]=1 \{\
7546 .       if \\n[#FOOTERS_ON] \{\
7547 .          di NULL
7548 .          SIZESPECS
7549 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
7550 .          di
7551 .       \}
7552 .       if o                        \{ .RIGHT \}
7553 .       if e                        \{ .LEFT  \}
7554 .       if \\n[#RECTO_VERSO]=0      \{ .LEFT  \}
7555 .       if \\n[#HDRFTR_LEFT_CAPS]   \{ .CAPS  \}
7556 .       ie '\\*[$HDRFTR_LEFT]'#' \{\
7557 .           PRINT \\n[#PAGENUMBER]
7558 .       \}
7559 .       el \{\
7560 .          ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
7561 .          el \{ .PRINT \& \}
7562 .       \}
7563 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
7564 .       CENTER
7565 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
7566 .       rt \\nyu
7567 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
7568 .           PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
7569 .       \}
7570 .       el \{\
7571 .          ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
7572 .          el \{ .PRINT \& \}
7573 .       \}
7574 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
7575 .       if o                       \{ .LEFT  \}
7576 .       if e                       \{ .RIGHT \}
7577 .       if \\n[#RECTO_VERSO]=0     \{ .RIGHT \}
7578 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS  \}
7579 .       rt \\nyu
7580 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
7581 .           PRINT \\n[#PAGENUMBER]
7582 .       \}
7583 .       el \{\
7584 .          ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \\*[$HDRFTR_RIGHT] \}
7585 .          el \{ .PRINT \& \}
7586 .       \}
7587 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
7588 .    \}
7589 .    if \\n[#PRINT_STYLE]=2 \{\
7590 .       if \\n[#HDRFTR_COLOR]=1 \{\
7591 .          nf
7592 \m[\\*[$HDRFTR_COLOR]]
7593 .          EOL
7594 .       \}
7595 .       fam     \\*[$HDRFTR_LEFT_FAM]
7596 .       ft      \\*[$HDRFTR_LEFT_FT]
7597 .       ps      \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
7598 .       vs      12
7599 .       if \\n[#FOOTERS_ON] \{\
7600 .          di NULL
7601 .          SIZESPECS
7602 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
7603 .          di
7604 .       \}
7605 .       if o                      \{ .LEFT  \}
7606 .       if e                      \{ .RIGHT \}
7607 .       if \\n[#RECTO_VERSO]=0    \{ .LEFT  \}
7608 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS  \}
7609 .       ie '\\*[$HDRFTR_LEFT]'#' \{\
7610 .          ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
7611 .             PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[]
7612 .          \}
7613 .          el \{\
7614 .             PRINT \\n[#PAGENUMBER]
7615 .          \}
7616 .       \}
7617 .       el \{\
7618 .          ie !'\\*[$HDRFTR_LEFT]'' \{\
7619 .             ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
7620 .                 PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[]
7621 .             \}
7622 .             el \{\
7623 .                 PRINT \\*[$HDRFTR_LEFT]
7624 .             \}
7625 .          \}
7626 .          el \{ .PRINT \& \}
7627 .       \}
7628 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
7629 .       fam     \\*[$HDRFTR_CENTER_FAM]
7630 .       ft      \\*[$HDRFTR_CENTER_FT]
7631 .       ps      \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
7632 .       vs      12
7633 .       if \\n[#FOOTERS_ON] \{\
7634 .          di NULL
7635 .          SIZESPECS
7636 .          nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
7637 .          di
7638 .       \}
7639 .       CENTER
7640 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
7641 .       rt \\nyu
7642 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
7643 .           ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
7644 .              PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
7645 .           \}
7646 .           el \{\
7647 .              PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
7648 .           \}
7649 .       \}
7650 .       el \{\
7651 .          ie !'\\*[$HDRFTR_CENTER]'' \{\
7652 .             ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
7653 .                PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
7654 .             \}
7655 .             el \{\
7656 .                PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
7657 .             \}
7658 .          \}
7659 .          el \{ .PRINT \& \}
7660 .       \}
7661 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
7662 .       fam     \\*[$HDRFTR_RIGHT_FAM]
7663 .       ft      \\*[$HDRFTR_RIGHT_FT]
7664 .       ps      \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
7665 .       vs      12
7666 .       if \\n[#FOOTERS_ON] \{\
7667 .          di NULL
7668 .          SIZESPECS
7669 .          nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
7670 .          di
7671 .       \}
7672 .       if o                       \{ .RIGHT \}
7673 .       if e                       \{ .LEFT  \}
7674 .       if \\n[#RECTO_VERSO]=0     \{ .RIGHT \}
7675 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS  \}
7676 .       rt \\nyu
7677 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
7678 .          ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
7679 .             PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[]
7680 .          \}
7681 .          el \{\
7682 .             PRINT \\n[#PAGENUMBER]
7683 .          \}
7684 .       \}
7685 .       el \{\
7686 .          ie !'\\*[$HDRFTR_RIGHT]'' \{\
7687 .             ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
7688 .                PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[]
7689 .             \}
7690 .             el \{\
7691 .                PRINT \\*[$HDRFTR_RIGHT]
7692 .             \}
7693 .          \}
7694 .          el \{ .PRINT \& \}
7695 .       \}
7696 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
7697 .    \}
7698 .    if \\n[#HDRFTR_RULE] \{\
7699 .       HDRFTR_RULE_INTERNAL
7700 .    \}
7701 .    br
7702 .END
7703 \#
7704 \#
7705 \# PRINT USER DEFINED HEADER/FOOTER
7706 \# --------------------------------
7707 \# *Arguments:
7708 \#   <none>
7709 \# *Function:
7710 \#   Based on defaults or values entered by user, prints a single part
7711 \#   (i.e. not 3-part) title at either the top or the bottom of the page.
7712 \# *Notes:
7713 \#   Called from within PRINT_HDRFTR.
7714 \#
7715 .MAC PRINT_USERDEF_HDRFTR END
7716 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
7717 .    fc ^ #
7718 .    if \\n[#PRINT_STYLE]=2 \{\
7719 .       FAMILY  \\*[$HDRFTR_FAM]
7720 .       FT      R
7721 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u
7722 .       if \\n[#HDRFTR_COLOR]=1 \{\
7723 .          nf
7724 .          COLOR \\*[$HDRFTR_COLOR]
7725 .       \}
7726 .    \}
7727 .    ie \\n[#RECTO_VERSO] \{\
7728 .       if o \{\
7729 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
7730 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
7731 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
7732 .          PRINT \\*[$USERDEF_HDRFTR_RECTO]
7733 .          EOL
7734 .          if \\n[#FOOTERS_ON] \{\
7735 .             di NULL
7736 .             SIZESPECS
7737 .             nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
7738 .             di
7739 .          \}
7740 .       \}
7741 .       if e \{\
7742 .          ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
7743 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT   \}
7744 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
7745 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT  \}
7746 .             PRINT \\*[$USERDEF_HDRFTR_VERSO]
7747 .             EOL
7748 .             if \\n[#FOOTERS_ON] \{\
7749 .                di NULL
7750 .                SIZESPECS
7751 .                nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
7752 .                di
7753 .             \}
7754 .          \}
7755 .          el \{\
7756 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
7757 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
7758 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
7759 .             PRINT \\*[$USERDEF_HDRFTR_RECTO]
7760 .             EOL
7761 .             if \\n[#FOOTERS_ON] \{\
7762 .                di NULL
7763 .                SIZESPECS
7764 .                nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
7765 .                di
7766 .             \}
7767 .          \}
7768 .       \}
7769 .    \}
7770 .    el \{\
7771 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
7772 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
7773 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
7774 .       PRINT \\*[$USERDEF_HDRFTR_RECTO]
7775 .       EOL
7776 .       if \\n[#FOOTERS_ON] \{\
7777 .          di NULL
7778 .          SIZESPECS
7779 .          nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
7780 .          di
7781 .       \}
7782 .    \}
7783 .    fc
7784 .    if \\n[#PRINT_STYLE]=2 \{\
7785 .       ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]]
7786 .       el \m[black]
7787 .    \}
7788 .    if \\n[#HDRFTR_RULE] \{\
7789 .       HDRFTR_RULE_INTERNAL
7790 .    \}
7791 .END
7792 \#
7793 \#
7794 \# +++HEADERS+++
7795 \#
7796 \# HEADERS (off or on)
7797 \# -------------------
7798 \# *Arguments:
7799 \#   <none> | <anything>
7800 \# *Function:
7801 \#   Turns headers at the top of the page off or on.
7802 \# *Notes:
7803 \#   Default is on.
7804 \#
7805 .MAC HEADERS END
7806 .    ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
7807 .    el \{ .nr #HEADERS_ON 0 \}
7808 .END
7809 \#
7810 \#
7811 \# HEADER MARGIN
7812 \# -------------
7813 \# *Argument:
7814 \#   <amount of space between top of page and header>
7815 \# *Function:
7816 \#   Creates or modifies register #HEADER_MARGIN to hold amount
7817 \#   of space between top of page and header.
7818 \# *Notes:
7819 \#   Requires unit of measure.  Default is 4P+6p, measured top-of-page
7820 \#   to baseline.
7821 \#
7822 .MAC HEADER_MARGIN END
7823 .    nr #HEADER_MARGIN (\\$1)
7824 .END
7825 \#
7826 \#
7827 \# HEADER GAP
7828 \# ----------
7829 \# *Argument:
7830 \#   <amount of space between header and running text>
7831 \# *Function:
7832 \#   Creates or modifies register #HEADER_GAP to hold amount
7833 \#   of space between header and running text.
7834 \# *Notes:
7835 \#   Default is 1P+6p.
7836 \#
7837 .MAC HEADER_GAP END
7838 .    nr #HEADER_GAP (\\$1)
7839 .END
7840 \#
7841 \#
7842 \# HEADER
7843 \# ------
7844 \# *Arguments:
7845 \#   <none>
7846 \# *Function:
7847 \#   Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
7848 \# *Notes:
7849 \#   In order to convert the title string to caps in the header (in the
7850 \#   event that the user enters .TITLE in caps/lc), I've used
7851 \#   quad left, quad centre, and quad right to arrange the three bits
7852 \#   of the header, rather than .tl.  This allows the use of the CAPS macro.
7853 \#   The downside is that I have to add \\v'-(\\n[#LEAD]u*<n>) in order
7854 \#   for -Tlatin1 output to align the header/footer strings on the baseline.
7855 \#   The console output still isn't brilliant, but at least it's
7856 \#   comprehensible.
7857 \#
7858 .MAC HEADER END
7859 .    MNtop
7860 .    rr #FROM_FOOTER
7861 .    nr #FROM_HEADER 1
7862 .    nr #LAST_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]
7863 .    if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
7864 .    rr #RULED
7865 .    if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
7866 .    po \\n[#DOC_L_MARGIN]u
7867 .    if \\n[#RECTO_VERSO] \{\
7868 .       if !\\n[#TOC_RV_SWITCH] \{\
7869 .          nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
7870 .          DOC_LEFT_MARGIN  \\n[#DOC_R_MARGIN]u
7871 .          DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
7872 .          SWITCH_HDRFTR_CENTER_PAD
7873 .       \}
7874 .       rr #TOC_RV_SWITCH
7875 .    \}
7876 .    ev HEADER
7877 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
7878 .    sp |\\n[#HEADER_MARGIN]u-1v
7879 .    mk y
7880 .    ll \\n[#DOC_L_LENGTH]u
7881 .    ta \\n(.lu
7882 .    if \\n[#PRINT_STYLE]=1 \{\
7883 .       fam C
7884 .       ft  R
7885 .       ps  12\\*[$HDRFTR_SIZE_CHANGE]
7886 .    \}
7887 .    if \\n[#PRINT_STYLE]=2 \{\
7888 .      fam \\*[$HDRFTR_FAM]
7889 .      ft  R
7890 .      ps  \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
7891 .      vs  12
7892 .    \}
7893 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
7894 .    if \\n[#CAPS_ON] \{\
7895 .       nr #CAPS_WAS_ON 1
7896 .       CAPS OFF
7897 .    \}
7898 .    if \\n[#UNDERLINE_ON] \{\
7899 .       nr #UNDERLINE_WAS_ON 1
7900 .       UNDERLINE OFF
7901 .    \}
7902 .    if \\n[#PRINT_STYLE]=1 \{\
7903 .       if \\n[#ENDNOTES]=1 \{\
7904 .\" Single-spaced endotes have a different lead
7905 .          if \\n[#EN_SINGLESPACE] \{\
7906 .             nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
7907 .             nr #DOC_LEAD \\n[#EN_LEAD]u
7908 .          \}
7909 .       \}
7910 .    \}
7911 .    ie \\n[#HEADERS_ON] \{\
7912 .       PRINT_HDRFTR
7913 .       sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
7914 .    \}
7915 .    el \{\
7916 .       ie \\n[#PAGE_NUM_V_POS]=1 \{\
7917 .          ie \\n[#PAGINATE] \{\
7918 .             PRINT_PAGE_NUMBER
7919 .             sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
7920 .          \}
7921 .          el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
7922 .       \}
7923 .       el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
7924 .    \}
7925 .    if \\n[#PRINT_STYLE]=1 \{\
7926 .       if \\n[#ENDNOTES]=1 \{\
7927 .          if \\n[#EN_SINGLESPACE] \{\
7928 .             nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
7929 .             rr #RESTORE_DOC_LEAD
7930 .          \}
7931 .       \}
7932 .    \}
7933 .    nr #PAGE_TOP \\n(nl
7934 .    ev
7935 .    po \\n[#L_MARGIN]u
7936 .    if \\n[#RECTO_VERSO] \{\
7937 .       nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
7938 .    \}
7939 .    if \\n[#CAPS_WAS_ON] \{\
7940 .       CAPS
7941 .       rr #CAPS_WAS_ON
7942 .    \}
7943 .    if \\n[#UNDERLINE_WAS_ON] \{\
7944 .       UNDERLINE
7945 .       rr #UNDERLINE_WAS_ON
7946 .    \}
7947 .    if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7948 .    if \\n[#QUOTE] \{\
7949 .       ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7950 .       el \{\
7951 .          nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
7952 .          po \\n[#Q_OFFSET]u
7953 .       \}
7954 .       ALD \\n[#Q_LEAD_DIFF]u
7955 .    \}
7956 .    if \\n[#EPIGRAPH] \{\
7957 .       ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7958 .       el \{\
7959 .          nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
7960 .          po \\n[#EPI_OFFSET]u
7961 .       \}
7962 .    \}
7963 .    ie \\n[#EPIGRAPH] \{\
7964 .       ie !\\n[#EPI_ACTIVE] \{\
7965 .          ns
7966 .          rr #EPI_ACTIVE
7967 .       \}
7968 .       el \{\
7969 .          ie \\n[#EPI_FITS] \{ .ns \}
7970 .          el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
7971 .       \}
7972 .    \}
7973 .    el \{ .ns \}
7974 .    ns
7975 .    if \\n[#COLUMNS] \{\
7976 .       nr #FN_COUNT_FOR_COLS 0 1
7977 .       nr #L_MARGIN \\n[#DOC_L_MARGIN]
7978 .       if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
7979 .       nr #COL_NUM 0 1
7980 .       mk dc
7981 .       po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7982 .       nr #L_MARGIN \\n(.o
7983 .       if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7984 .       ll \\n[#COL_L_LENGTH]u
7985 .       ta \\n(.lu
7986 .       if \\n[#QUOTE] \{\
7987 .          po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7988 .       \}
7989 .       if \\n[#EPIGRAPH] \{\
7990 .          if \\n[#EPI_ACTIVE] \{\
7991 .             ie \\n[#EPI_FITS] \{ . \}
7992 .             el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
7993 .          \}
7994 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
7995 .       \}
7996 .    \}
7997 .    if \\n[#RESET_FN_COUNTERS]=1 \{\
7998 .       rr #RESET_FN_COUNTERS
7999 .       PROCESS_FN_IN_DIVER
8000 .       nr #FN_COUNT \\n[#SAVED_FN_COUNT] 1
8001 .       if \\n[#COLUMNS]=1 \{ .nr #FN_COUNT_FOR_COLS \\n[#SAVED_FN_COUNT_FOR_COLS] 1 \}
8002 .       ie \\n[#RESET_FN_NUMBER]=1 \{ .nr #FN_NUMBER \\n[#SAVED_FN_NUMBER] 1 \}
8003 .       el \{ .nr #FN_NUMBER \\n[#FN_NUMBER] 1 \}
8004 .       rm FN_IN_DIVER
8005 .       if dRUNON_FN_IN_DIVER \{ .rm RUNON_FN_IN_DIVER \}
8006 .    \}
8007 .    if \\n[#PRINT_STYLE]=1 \{\
8008 .       if \\n[#SLANT_ON] \{\
8009 .          if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
8010 .       \}
8011 .    \}
8012 .    rr #FROM_HEADER
8013 .    rr #DEFER_SPACE_ADDED
8014 .    if !\\n[#FN_DEPTH] \{\
8015 .       if r#DIVERTED \{ .rr #DIVERTED \}
8016 .    \}
8017 .    if \\n[#MN_OVERFLOW_LEFT]=1 \{\
8018 .       MN LEFT
8019 .       nf
8020 .       MN_OVERFLOW_LEFT
8021 .       MN
8022 .    \}
8023 .    if \\n[#MN_OVERFLOW_RIGHT]=1 \{\
8024 .       MN RIGHT
8025 .       nf
8026 .       MN_OVERFLOW_RIGHT
8027 .       MN
8028 .    \}
8029 .    rm MN_OVERFLOW_LEFT
8030 .    rr #MN_OVERFLOW_LEFT
8031 .    rr #no-repeat-MN-left
8032 .    rm MN_OVERFLOW_RIGHT
8033 .    rr #MN_OVERFLOW_RIGHT
8034 .    rr #no-repeat-MN-right
8035 .END
8036 \#
8037 \# ====================================================================
8038 \#
8039 \# +++FOOTERS+++
8040 \#
8041 \# FOOTERS (off or on)
8042 \# -------------------
8043 \# *Arguments:
8044 \#   <none> | <anything>
8045 \# *Function:
8046 \#   Turns footers at the bottom of the page off or on.
8047 \# *Notes:
8048 \#   Default is off.  If on, page numbers automatically go at
8049 \#   the top, centered, unless pagination has been turned off,
8050 \#   or the pagenumber position has been changed to left or right.
8051 \#
8052 .MAC FOOTERS END
8053 .    ie '\\$1''   \{\
8054 .       nr #FOOTERS_ON 1
8055 .       PAGE_NUM_POS TOP CENTER
8056 .    \}
8057 .    el \{ .nr #FOOTERS_ON 0 \}
8058 .END
8059 \#
8060 \#
8061 \# FOOTER MARGIN
8062 \# -------------
8063 \# *Argument:
8064 \#   <footer margin>
8065 \# *Function:
8066 \#   Creates or modifies register #FOOTER_MARGIN which holds the
8067 \#   amount of space to leave between the page number and the bottom
8068 \#   of the page.
8069 \# *Notes:
8070 \#   Unit of measure required.  Default is 3P.
8071 \#
8072 .MAC FOOTER_MARGIN END
8073 .    ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
8074 .    el \{ . \}
8075 .END
8076 \#
8077 \#
8078 \# FOOTER GAP
8079 \# ----------
8080 \# *Argument:
8081 \#   <distance from end of running text to page # or footer>
8082 \# *Function:
8083 \#   Creates or modifies register #FOOTER_GAP which holds the
8084 \#   amount of space to leave between running text and the page number.
8085 \# *Notes:
8086 \#   Requires unit of measure.  Default is 3P.  Measured baseline to
8087 \#   baseline.
8088 \#
8089 .MAC FOOTER_GAP END
8090 .    ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
8091 .    el \{ . \}
8092 .END
8093 \#
8094 \#
8095 \# FOOTER
8096 \# ------
8097 \# *Arguments:
8098 \#   <none>
8099 \# *Function:
8100 \#   Places footer at bottom of page if #FOOTERS=1, otherwise
8101 \#   places page number at bottom of page (if #PAGINATE=1).
8102 \#   Page numbers are in arabic or roman according to COPYSTYLE.
8103 \#   DRAFT starts the document at page 1 regardless of PAGENUMBER.
8104 \#   FINAL respects PAGENUMBER.
8105 \#
8106 .MAC FOOTER END
8107 .    ev PAGE_TRANSITION
8108 .    if \\n[MN-left]>0 \{\
8109 .       if !\\n[#no-repeat-MN-left]=1 \{\
8110 .          MNbottom-left
8111 .          nr #no-repeat-MN-left 1
8112 .       \}
8113 .       if '\\n(.z'MN_OVERFLOW_LEFT' \{\
8114 .          di
8115 .          nr #MN_OVERFLOW_LEFT 1
8116 .          rr #OVERFLOW_LEFT
8117 .       \}
8118 .    \}
8119 .    if \\n[MN-right]>0 \{\
8120 .       if (\\n[MN-right] > 0) \{\
8121 .          if !\\n[#no-repeat-MN-right]=1 \{\
8122 .             MNbottom-right
8123 .          \}
8124 .       \}
8125 .       if '\\n(.z'MN_OVERFLOW_RIGHT' \{\
8126 .          di
8127 .          nr #MN_OVERFLOW_RIGHT 1
8128 .          rr #OVERFLOW_RIGHT
8129 .       \}
8130 .    \}
8131 .    ch MN_OVERFLOW_TRAP
8132 .    nr #SAVED_LEAD \\n(.v
8133 .    nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
8134 .    if !\\n[#FN_DEFER] \{\
8135 .       nr #DIVER_DEPTH 0
8136 .       if \\n[#FN_DEPTH] \{\
8137 .          if \\n[#DIVERTED]=3 \{ .nr #FN_DEPTH +\\n[#VFP_DIFF] \}
8138 .          vpt 0
8139 .          sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u-\\n[#DOC_LEAD]u)
8140 .          vpt 1
8141 .          po \\n[#DOC_L_MARGIN]u
8142 .          if \\n[#COLUMNS] \{\
8143 .             po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8144 .             nr #L_MARGIN \\n(.o
8145 .             nr #FROM_FOOTER 1
8146 .          \}
8147 .          nf
8148 .          FOOTNOTES
8149 .          rm FOOTNOTES
8150 .          if dRUNON_FOOTNOTES \{ .rm RUNON_FOOTNOTES \}
8151 .          if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#SAVED_LEAD]u \}
8152 .          if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#SAVED_LEAD]u \}
8153 .          if '\\n(.z'FN_OVERFLOW' \{\
8154 .              di
8155 .              nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
8156 .          \}
8157 .          nr #FN_COUNT_AT_FOOTER \\n[#FN_COUNT]
8158 .          nr #FN_COUNT 0
8159 .          if \\n[#COL_NEXT] \{\
8160 .             ie !\\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
8161 .             el \{ .nr #COL_NUM \\n[#NUM_COLS] 1 \}
8162 .          \}
8163 .       \}
8164 .       rr #DIVERTED
8165 .    \}
8166 .    ie \\n[#COLUMNS]=1 \{\
8167 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
8168 .       el \{\
8169 .          ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
8170 .          el \{ .sp |\\n(dcu \}
8171 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
8172 .          nr #L_MARGIN \\n(.o
8173 .          if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
8174 .          LS \\n[#SAVED_LEAD]u
8175 .          if \\n[#PREV_FN_DEFERRED] \{\
8176 .             nr #PREV_FN_DEFERRED 2
8177 .          \}
8178 .          rr #RULED
8179 .          if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
8180 .          if !\\n[#QUOTE]    \{ .rr #COL_NEXT \}
8181 .          if \\n[#RESET_FN_COUNTERS]=1 \{\
8182 .             rr #RESET_FN_COUNTERS
8183 .             PROCESS_FN_IN_DIVER
8184 .             LS \\n[#SAVED_LEAD]u
8185 .             nr #FN_COUNT \\n[#FN_COUNT] 1
8186 .             nr #FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] 1
8187 .             rm FN_IN_DIVER
8188 .             if dRUNON_FN_IN_DIVER \{ .rm RUNON_FN_IN_DIVER \}
8189 .          \}
8190 .          rr #DEFER_SPACE_ADDED
8191 .          if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
8192 .          if \\n[#QUOTE] \{\
8193 .             ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
8194 .             el \{\
8195 .                nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8196 .                if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
8197 .                po \\n[#Q_OFFSET]u
8198 .             \}
8199 .          \}
8200 .          if \\n[#EPIGRAPH] \{\
8201 .             ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
8202 .             el \{\
8203 .                nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
8204 .                if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
8205 .                po \\n[#EPI_OFFSET]u
8206 .             \}
8207 .          \}
8208 .          ie \\n[#EPIGRAPH] \{\
8209 .             ie !\\n[#EPI_ACTIVE] \{\
8210 .                ns
8211 .                rr #EPI_ACTIVE
8212 .             \}
8213 .             el \{\
8214 .                sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
8215 .                rr #EPI_ACTIVE
8216 .             \}
8217 .          \}
8218 .          el \{ .ns \}
8219 .          ev
8220 .       \}
8221 .       ns
8222 .       rr #DIVERTED
8223 .    \}
8224 .    el \{ .DO_FOOTER \}
8225 .END
8226 \#
8227 \#
8228 \# PROCESS FOOTER
8229 \# --------------
8230 \# *Arguments:
8231 \#   <none>
8232 \# *Function:
8233 \#   Prints footer (page number, or 3-part footer).
8234 \#   Resets CAPS and UNDERLINE if they were on.
8235 \#
8236 .MAC DO_FOOTER END
8237 .\" Have to change position of FN_OVERFLOW_TRAP or it screws up the
8238 .\" placement of page numbers (or footers).  It's reset to its original
8239 .\" position at the end of the macro.
8240 .    if r#SAVED_FOOTER_POS \{ .ch FOOTER \\n[#SAVED_FOOTER_POS]u \}
8241 .    rr #SAVED_FOOTER_POS
8242 .    ie (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
8243 .       nr #SKIP_FOOTER 1
8244 .    \}
8245 .    el \{\
8246 .       vpt 0
8247 .       sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
8248 .       mk y
8249 .       vpt 1
8250 .    \}
8251 .    ev FOOTER
8252 .    po \\n[#DOC_L_MARGIN]u
8253 .    ll \\n[#DOC_L_LENGTH]u
8254 .    ta \\n(.lu
8255 .    FAMILY  \\*[$HDRFTR_FAM]
8256 .    FT      R
8257 .    PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
8258 .    if \\n[#PRINT_STYLE]=1 \{\
8259 .       TYPEWRITER
8260 .    \}
8261 .    LS \\n[#SAVED_LEAD]u
8262 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
8263 .    if \\n[#CAPS_ON] \{\
8264 .       nr #CAPS_WAS_ON 1
8265 .       CAPS OFF
8266 .    \}
8267 .    if \\n[#UNDERLINE_ON] \{\
8268 .       nr #UNDERLINE_WAS_ON 1
8269 .       UNDERLINE OFF
8270 .    \}
8271 .    ie \\n[#FOOTERS_ON] \{\
8272 .       if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_HDRFTR \}
8273 .    \}
8274 .    el \{\
8275 .       if \\n[#PAGINATE] \{\
8276 .          if \\n[#PAGE_NUM_V_POS]=2 \{\
8277 .             if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_PAGE_NUMBER \}
8278 .          \}
8279 .       \}
8280 .    \}
8281 .    rr #SKIP_FOOTER
8282 .    if \\n[#CAPS_WAS_ON] \{\
8283 .       CAPS
8284 .       rr #CAPS_WAS_ON
8285 .    \}
8286 .    if \\n[#UNDERLINE_WAS_ON] \{\
8287 .       UNDERLINE
8288 .       rr #UNDERLINE_WAS_ON
8289 .    \}
8290 .    ev
8291 .    rr #SAVED_LEAD
8292 .    bp
8293 .\" This ev pops the PAGE_TRANSITION environment still active at the
8294 .\" end of HEADER
8295 .    ev
8296 .END
8297 \#
8298 \# ====================================================================
8299 \#
8300 \# +++HEADS+++
8301 \#
8302 \# ---Head numbers---
8303 \#
8304 \# NUMBER HEADS
8305 \# ------------
8306 \# *Arguments:
8307 \#   <none> | <anything>
8308 \# *Function:
8309 \#   Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
8310 \# *Notes:
8311 \#   Default is OFF.
8312 \#
8313 .MAC NUMBER_HEADS END
8314 .    ie '\\$1'' \{\
8315 .       nr #NUMBER_HEAD 1
8316 .       if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
8317 .    \}
8318 .    el \{ .rr #NUMBER_HEAD \}
8319 .END
8320 \#
8321 \#
8322 \# RESET HEAD NUMBER
8323 \# -----------------
8324 \# *Arguments:
8325 \#   <none> | <desired head number>
8326 \# *Function:
8327 \#   Resets incrementing register #HEAD_NUM to 1 or, if there's
8328 \#   an argument, to user supplied number.
8329 \# *Notes:
8330 \#   Also resets subhead and parahead numbers.  If this is not
8331 \#   desired, subhead and parahead numbers may be reset individually.
8332 \#
8333 .MAC RESET_HEAD_NUMBER END
8334 .    ie '\\$1'' \{\
8335 .       nr #HEAD_NUM 0 1
8336 .       nr #SH_NUM   0 1
8337 .       nr #PH_NUM   0 1
8338 .    \}
8339 .    el \{\
8340 .       nr #HEAD_NUM \\$1-1 1
8341 .       nr #SH_NUM   0 1
8342 .       nr #PH_NUM   0 1
8343 .    \}
8344 .END
8345 \#
8346 \#
8347 \# NUMBER SUBHEADS
8348 \# ---------------
8349 \# *Arguments:
8350 \#   <none> | <anything>
8351 \# *Function:
8352 \#   Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
8353 \# *Notes:
8354 \#   Default is OFF.
8355 \#
8356 .MAC NUMBER_SUBHEADS END
8357 .    ie '\\$1'' \{\
8358 .       nr #NUMBER_SH 1
8359 .       if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
8360 .    \}
8361 .    el \{ .rr #NUMBER_SH \}
8362 .END
8363 \#
8364 \#
8365 \# RESET SUBHEAD NUMBER
8366 \# --------------------
8367 \# *Arguments:
8368 \#   <none> | <desired subhead number>
8369 \# *Function:
8370 \#   Resets incrementing register #SH_NUM to 1 or, if there's
8371 \#   an argument, to user supplied number.
8372 \# *Notes:
8373 \#   When the subhead number is reset, it resets the parahead number as
8374 \#   well.  If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
8375 \#   allows the user to set the parahead number to whatever s/he desires.
8376 \#
8377 .MAC RESET_SUBHEAD_NUMBER END
8378 .    ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
8379 .    el \{\
8380 .       nr #SH_NUM \\$1-1 1
8381 .       nr #PH_NUM 0 1
8382 .       \}
8383 .END
8384 \#
8385 \#
8386 \# NUMBER PARAHEADS
8387 \# ----------------
8388 \# *Arguments:
8389 \#   <none> | <anything>
8390 \# *Function:
8391 \#   Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
8392 \# *Notes:
8393 \#   Default is OFF.
8394 \#
8395 .MAC NUMBER_PARAHEADS END
8396 .    ie '\\$1'' \{\
8397 .       nr #NUMBER_PH 1
8398 .       if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
8399 .    \}
8400 .    el \{ .rr #NUMBER_PH \}
8401 .END
8402 \#
8403 \#
8404 \# RESET PARAHEAD NUMBER
8405 \# ---------------------
8406 \# *Arguments:
8407 \#   <none> | <desired parahead number>
8408 \# *Function:
8409 \#   Resets incrementing register #PH_NUM to 1 or, if there's
8410 \#   an argument, to user supplied number.
8411 \# *Notes:
8412 \#   Resetting the parahead number resets the parahead number
8413 \#   only.
8414 \#
8415 .MAC RESET_PARAHEAD_NUMBER END
8416 .    ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
8417 .    el \{ nr #SH_NUM \\$1-1 1 \}
8418 .END
8419 \#
8420 \#
8421 \# ---Main heads---
8422 \#
8423 \# HEAD CAPS
8424 \# ---------
8425 \# *Arguments:
8426 \#   <none> | <anything>
8427 \# *Function:
8428 \#   Creates or modifies register #HEAD_CAPS.
8429 \# *Notes:
8430 \#   Default is on.
8431 \#
8432 .MAC HEAD_CAPS END
8433 .    ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
8434 .    el \{ .nr #HEAD_CAPS 0 \}
8435 .END
8436 \#
8437 \#
8438 \# HEAD SPACE
8439 \# ----------
8440 \# *Arguments:
8441 \#   <none> | <anything>
8442 \# *Function:
8443 \#   Creates register #HEAD_SPACE, which toggles whether the space
8444 \#   before heads is 1 extra line space ("off") or 2 ("on").  Used only
8445 \#   in PRINTSTYLE TYPESET.
8446 \# *Notes:
8447 \#   Default is on.
8448 \#
8449 .MAC HEAD_SPACE END
8450 .    ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
8451 .    el \{ .nr #HEAD_SPACE 0 \}
8452 .END
8453 \#
8454 \#
8455 \# HEAD UNDERLINE
8456 \# --------------
8457 \# *Arguments:
8458 \#   <none> | <anything>
8459 \# *Function:
8460 \#   Creates or modifies register #HEAD_UNDERLINE.
8461 \# *Notes:
8462 \#   Default is on.
8463 \#
8464 .MAC HEAD_UNDERLINE END
8465 .    ie '\\$1'' \{ .nr #HEAD_UNDERLINE 1 \}
8466 .    el \{ .nr #HEAD_UNDERLINE 0 \}
8467 .END
8468 \#
8469 \#
8470 \# MAIN HEAD
8471 \# ---------
8472 \# *Arguments:
8473 \#   "text of main head" ["text of main head"] ...
8474 \# *Function:
8475 \#   In TYPEWRITE, prints main heads centered, all caps, underlined.
8476 \#   In TYPESET, prints bold main heads 1 point larger than running
8477 \#   text, all caps, underlined.
8478 \# *Notes:
8479 \#   The HEAD macro requires that double-quotes (") surround
8480 \#   each line of text.
8481 \#
8482 .MAC HEAD END
8483 .    br
8484 .\" Collect head for TOC.
8485 .    nr #ARG_NUM 0 1
8486 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
8487 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
8488 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8489 .       ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
8490 .          as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\\|
8491 .       \}
8492 .       el \{\
8493 .\" Note that in the .as lines, below, \ at the end has a literal
8494 .\" space after it.
8495 .          ie \\n[#NUMBER_HEAD] \{\
8496 .             ie \\n[#ARG_NUM]=0 \{\
8497 .                as $TOC_HEAD_ITEM \\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\ 
8498 .                nr #HEAD_NUM \\n-[#HEAD_NUM]
8499 .             \}
8500 .             el \{\
8501 .                as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ 
8502 .             \}
8503 .          \}
8504 .          el \{\
8505 .             as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ 
8506 .          \}
8507 .       \}
8508 .\}
8509 .\" Note the use of \!, which transparently embeds the macros used
8510 .\" in the TOC_ENTRIES diversion.  The elements they control must be
8511 .\" processed literally when the diversion is output.
8512 .    ev TOC_EV
8513 .    da TOC_ENTRIES
8514 .    if \\n[#PRINT_STYLE]=1 \{\
8515 \!.     fam C
8516 \!.     ft  R
8517 \!.     ps  12
8518 .    \}
8519 .    if \\n[#PRINT_STYLE]=2 \{\
8520 \!.     FAMILY  \\*[$TOC_HEAD_FAM]
8521 \!.     FT      \\*[$TOC_HEAD_FT]
8522 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
8523 .    \}
8524 \!.  TRAP OFF
8525 .    ie \\n[#PRINT_STYLE]=1 \{\
8526 \!.     PAD "\\h'2m'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN_TYPEWRITE]"
8527 .    \}
8528 .    el \{\
8529 \!.     PAD "\\h'\\n[#TOC_HEAD_INDENT]u'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN]"
8530 .    \}
8531 \!.  EOL
8532 \!.  ST 100 L
8533 \!.  ST 101 R
8534 .    if \\n[#PRINT_STYLE]=2 \{\
8535 \!.     FAMILY  \\*[$TOC_PN_FAM]
8536 \!.     FT      \\*[$TOC_PN_FT]
8537 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
8538 .    \}
8539 \!.  TAB 100
8540 \!.  PRINT \\*[LEADER]
8541 \!.  TN
8542 \!.  TRAP
8543 \!.  PRINT \\n[#TOC_ENTRY_PN]
8544 \!.  TQ
8545 .    di       
8546 .    ev
8547 .\" End collection of head for TOC
8548 .\" Process head
8549 .    nr #HEAD 1
8550 .    ev HEAD
8551 .    ll \\n[#L_LENGTH]u
8552 .    ta \\n(.lu
8553 .    if \\n[#COLUMNS] \{\
8554 .       ll \\n[#COL_L_LENGTH]u
8555 .       ta \\n(.lu
8556 .    \}
8557 .    CHECK_INDENT
8558 .    QUAD \\*[$HEAD_QUAD]
8559 .    if \\n[#PRINT_STYLE]=1 \{\
8560 .       TYPEWRITER
8561 .       vs  \\n[#DOC_LEAD]u
8562 .       UNDERLINE OFF
8563 .    \}
8564 .    if \\n[#PRINT_STYLE]=2 \{\
8565 .       FAMILY  \\*[$HEAD_FAM]
8566 .       FT      \\*[$HEAD_FT]
8567 .       PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
8568 .       LS      \\n[#DOC_LEAD]u
8569 .    \}
8570 .    if r#QUOTE             \{ .rr #QUOTE \}
8571 .    if r#EPIGRAPH          \{ .rr #EPIGRAPH \}
8572 .    if \\n[#PRINT_STYLE]=1 \{ .ne \\n[#NUM_ARGS]+2 \}
8573 .    if \\n[#PRINT_STYLE]=2 \{\
8574 .       ie \\n[#HEAD_SPACE] \{ .ne \\n[#NUM_ARGS]+3 \}
8575 .       el \{ .ne \\n[#NUM_ARGS]+2 \}
8576 .    \}
8577 .    ie \\n[#START] \{\
8578 .       if \\n[#DOC_HEADER]=0 \{ .RLD 1v \}
8579 .    \}
8580 .    el \{\
8581 .       if \\n[#PRINT_STYLE]=1 \{\
8582 .          if !\\n[#LINEBREAK] \{\
8583 .             ALD \\n[#DOC_LEAD]u
8584 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
8585 .          \}
8586 .       \}
8587 .       if \\n[#PRINT_STYLE]=2 \{\
8588 .          ie \\n[#PP_SPACE] \{\
8589 .             ie \\n[#END_QUOTE] \{ . \}
8590 .             el \{\
8591 .                if !\\n[#LINEBREAK] \{\
8592 .                   if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
8593 .                \}
8594 .             \}
8595 .          \}
8596 .          el \{\
8597 .             ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
8598 .             el \{ .ALD \\n[#DOC_LEAD]u \}
8599 .          \}
8600 .          if \\n[#END_QUOTE] \{\
8601 .             if !\\n[#Q_FITS] \{\
8602 .                RLD \\n[#DOC_LEAD]u
8603 .                if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
8604 .             \}
8605 .             if \\n[#Q_AT_TOP] \{\
8606 .                RLD \\n[#DOC_LEAD]u
8607 .                if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
8608 .             \}
8609 .          \}
8610 .          if \\n[#LINEBREAK] \{\
8611 .             if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
8612 .          \}
8613 .       \}
8614 .    \}
8615 .\" Print head
8616 .    nr #ARG_NUM 0 1
8617 .    if \\n[#HEAD_CAPS] \{ .CAPS \}
8618 .    if \\n[#PRINT_STYLE]=2 \{\
8619 .       if \\n[#HEAD_COLOR]=1 \{\
8620 .          TRAP OFF
8621 .          COLOR \\*[$HEAD_COLOR]
8622 .          EOL
8623 .          TRAP
8624 .       \}
8625 .    \}
8626 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8627 .       ie \\n[#NUMBER_HEAD] \{\
8628 .          ie \\n[#ARG_NUM]=0 \{\
8629 .             br
8630 .             ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
8631 .             el \{ .UNDERSCORE "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
8632 .             br
8633 .          \}
8634 .          el \{\
8635 .             br
8636 .             ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
8637 .             el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
8638 .             br
8639 .          \}
8640 .       \}
8641 .       el \{\
8642 .          br
8643 .          ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
8644 .          el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
8645 .          br
8646 .       \}
8647 .\}
8648 .    REMOVE_INDENT
8649 .    CAPS OFF
8650 .    ev
8651 .    ALD \\n[#DOC_LEAD]u
8652 .    RESET_SUBHEAD_NUMBER
8653 .    RESET_PARAHEAD_NUMBER
8654 .    if r#START      \{ .rr #START     \}
8655 .    if r#EPIGRAPH   \{ .rr #EPIGRAPH  \}
8656 .    if r#QUOTE      \{ .rr #QUOTE     \}
8657 .    if r#Q_FITS     \{ .rr #Q_FITS    \}
8658 .    if r#END_QUOTE  \{ .rr #END_QUOTE \}
8659 .    if r#LINEBREAK  \{ .rr #LINEBREAK \}
8660 .    if r#Q_AT_TOP   \{ .rr #Q_AT_TOP  \}
8661 .    if r#PP_ACTIVE  \{ .rr #PP_ACTIVE \}
8662 .    rr #ARG_NUM
8663 .    rm $TOC_HEAD_ITEM
8664 .    nr #PP 0
8665 .END
8666 \#
8667 \#
8668 \# ---Subheads---
8669 \#
8670 \# SUBHEAD
8671 \# -------
8672 \# *Arguments:
8673 \#   "text of subhead" ["text of subhead"] ...
8674 \# *Function:
8675 \#   In TYPEWRITE, prints subheads underlined.
8676 \#   In TYPESET, prints subheads bold, .5 points larger than running
8677 \#   text.
8678 \#   In both styles, a line space precedes the subhead, and a small
8679 \#   amount of lead comes after.
8680 \# *Notes:
8681 \#   As with the HEAD macro, double-quotes (") must surround
8682 \#   each line of text.
8683 \#
8684 .MAC SUBHEAD END
8685 .    br
8686 .\" Collect subhead for TOC.
8687 .    nr #ARG_NUM 0 1
8688 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
8689 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8690 .       ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
8691 .          as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\\|
8692 .       \}
8693 .       el \{\
8694 .\" Note that in the .as lines, below, \ at the end has a literal
8695 .\" space after it.
8696 .          ie \\n[#NUMBER_SH] \{\
8697 .             ie \\n[#ARG_NUM]=0 \{\
8698 .                as $TOC_SH_ITEM \\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]\ 
8699 .                nr #SH_NUM \\n-[#SH_NUM]
8700 .             \}
8701 .             el \{\
8702 .                as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ 
8703 .             \}
8704 .          \}
8705 .          el \{\
8706 .             as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ 
8707 .          \}
8708 .       \}
8709 .\}
8710 .\" Note the use of \!, which transparently embeds the macros used
8711 .\" in the TOC_ENTRIES diversion.  The elements they control must be
8712 .\" processed literally when the diversion is output.
8713 .    ev TOC_EV
8714 .    da TOC_ENTRIES
8715 .    if \\n[#PRINT_STYLE]=1 \{\
8716 \!.     fam C
8717 \!.     ft  R
8718 \!.     ps  12
8719 .    \}
8720 .    if \\n[#PRINT_STYLE]=2 \{\
8721 \!.     FAMILY  \\*[$TOC_SH_FAM]
8722 \!.     FT      \\*[$TOC_SH_FT]
8723 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
8724 .    \}
8725 \!.  TRAP OFF
8726 .    ie \\n[#PRINT_STYLE]=1 \{\
8727 \!.     PAD "\\h'4m'\\*[$TOC_SH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
8728 .    \}
8729 .    el \{\
8730 \!.     PAD "\\h'\\n[#TOC_SH_INDENT]u'\\*[$TOC_SH_ITEM]\\*[$TOC_PN]"
8731 .    \}
8732 \!.  EOL
8733 \!.  ST 100 L
8734 \!.  ST 101 R
8735 .    if \\n[#PRINT_STYLE]=2 \{\
8736 \!.     FAMILY  \\*[$TOC_PN_FAM]
8737 \!.     FT      \\*[$TOC_PN_FT]
8738 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
8739 .    \}
8740 \!.  TAB 100
8741 \!.  PRINT \\*[LEADER]
8742 \!.  TN
8743 \!.  TRAP
8744 \!.  PRINT \\n[#TOC_ENTRY_PN]
8745 \!.  TQ
8746 .    di       
8747 .    ev
8748 .\" End collection of head for TOC
8749 .\" Process subhead
8750 .    nr #ARG_NUM 0 1
8751 .    if r#QUOTE    \{ .rr #QUOTE    \}
8752 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
8753 .    ev SUBHEAD
8754 .    ll \\n[#L_LENGTH]u
8755 .    ta \\n(.lu
8756 .    if \\n[#COLUMNS] \{\
8757 .       ll \\n[#COL_L_LENGTH]u
8758 .       ta \\n(.lu
8759 .    \}
8760 .    CHECK_INDENT
8761 .    if \\n[#PRINT_STYLE]=1 \{\
8762 .       TYPEWRITER
8763 .       vs  \\n[#DOC_LEAD]u
8764 .       QUAD   \\*[$SH_QUAD]
8765 .       UNDERLINE OFF
8766 .    \}
8767 .    if \\n[#PRINT_STYLE]=2 \{\
8768 .       FAMILY  \\*[$SH_FAM]
8769 .       FT      \\*[$SH_FT]
8770 .       PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
8771 .       LS      \\n[#DOC_LEAD]u
8772 .       QUAD    \\*[$SH_QUAD]
8773 .    \}
8774 .    if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
8775 .    if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
8776 .    ie \\n[#START] \{ .RLD 1v \}
8777 .    el \{\
8778 .       ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]*(\\n[#NUM_ARGS]+1)) ) \{\
8779 .          ie \\n[#COLUMNS] \{ .COL_NEXT \}
8780 .          el \{ .bp \}
8781 .       \}
8782 .       el \{\
8783 .          ie \\n[#HEAD]=1 \{ . \}
8784 .          el \{\
8785 .             if \\n[#PRINT_STYLE]=1 \{\
8786 .                if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8787 .             \}
8788 .             if \\n[#PRINT_STYLE]=2 \{\
8789 .                ie \\n[#PP_SPACE]=1 \{\
8790 .                   ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8791 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
8792 .                \}
8793 .                el \{\
8794 .                   if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8795 .                \}
8796 .             \}
8797 .          \}
8798 .       \}
8799 .    \}
8800 .\" Print subhead
8801 .    if \\n[#PRINT_STYLE]=1 \{\
8802 .       while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8803 .          ie \\n[#NUMBER_SH] \{\
8804 .             ie \\n[#ARG_NUM]=0 \{\
8805 .                ie \\n[#NUMBER_HEAD] \{\
8806 .                   br
8807 .                   UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
8808 .                   br
8809 .                \}
8810 .                el \{\
8811 .                   br
8812 .                   UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
8813 .                   br
8814 .                \}
8815 .             \}
8816 .             el \{\
8817 .                br
8818 .                ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
8819 .                el \{ .UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
8820 .                br
8821 .             \}
8822 .          \}
8823 .          el \{\
8824 .             br
8825 .             UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
8826 .             br
8827 .          \}
8828 .\}
8829 .    \}
8830 .    if \\n[#PRINT_STYLE]=1 \{\
8831 .       if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
8832 .    \}
8833 .    if \\n[#PRINT_STYLE]=2 \{\
8834 .       if \\n[#SH_COLOR]=1 \{ .COLOR \\*[$SH_COLOR] \}
8835 .       ie \\n[#PP_SPACE]=0 \{\
8836 .          while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8837 .             ie \\n[#NUMBER_SH] \{\
8838 .                ie \\n[#ARG_NUM]=0 \{\
8839 .                   ie \\n[#NUMBER_HEAD] \{\
8840 .                      br
8841 .                      PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
8842 .                      br
8843 .                   \}
8844 .                   el \{\
8845 .                      br
8846 .                      PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
8847 .                      br
8848 .                   \}
8849 .                \}
8850 .                el \{\
8851 .                   br
8852 .                   PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
8853 .                   br
8854 .                \}
8855 .             \}
8856 .             el \{\
8857 .                br
8858 .                PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
8859 .                br
8860 .             \}
8861 .\}
8862 .       \}
8863 .       el \{\
8864 .          ALD \\n[#DOC_LEAD]u
8865 .          if \\n[#HEAD]=1      \{ .RLD \\n[#DOC_LEAD]u \}
8866 .          if \\n[#END_QUOTE]   \{ .RLD \\n[#DOC_LEAD]u \}
8867 .          if \\n[#EPIGRAPH]    \{ .RLD \\n[#DOC_LEAD]u \}
8868 .          while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8869 .             PRINT "\\$[\\n+[#ARG_NUM]]
8870 .\}
8871 .          ALD \\n[#DOC_LEAD]u
8872 .       \}
8873 .    \}
8874 .    REMOVE_INDENT
8875 .    ev
8876 .    RESET_PARAHEAD_NUMBER
8877 .    if r#START     \{ .rr #START     \}
8878 .    if r#EPIGRAPH  \{ .rr #EPIGRAPH  \}
8879 .    if r#Q_FITS    \{ .rr #Q_FITS    \}
8880 .    if r#END_QUOTE \{ .rr #END_QUOTE \}
8881 .    if r#LINEBREAK \{ .rr #LINEBREAK \}
8882 .    rm $TOC_SH_ITEM
8883 .    nr #PP 0
8884 .    nr #HEAD 2
8885 .END
8886 \#
8887 \# ---Paragraph heads---
8888 \#
8889 \# PARAHEAD INDENT
8890 \# ---------------
8891 \# *Argument:
8892 \#   <size of indent>
8893 \# *Function:
8894 \#   Creates or modifies register #PH_INDENT.
8895 \# *Notes:
8896 \#   Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
8897 \#
8898 .MAC PARAHEAD_INDENT END
8899 .    nr #PH_INDENT (\\$1)
8900 .END
8901 \#
8902 \#
8903 \# PARAHEAD
8904 \# --------
8905 \# *Arguments:
8906 \#   "<para head>"
8907 \# *Function:
8908 \#   Deposits a paragraph head at the start and into the body of a
8909 \#   paragraph.
8910 \# *Notes:
8911 \#   PARAHEAD *must* come after PP.
8912 \#
8913 .MAC PARAHEAD END
8914 .\" Collect parahead for TOC.
8915 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
8916 .    ie \\n[#NUMBER_PH] \{\
8917 .       ds $TOC_PH_ITEM \\n+[#PH_NUM].\0\\$1\\|
8918 .       nr #PH_NUM \\n-[#PH_NUM]
8919 .    \}
8920 .    el \{\
8921 .       ds $TOC_PH_ITEM \\$1\\|
8922 .    \}
8923 .    ev TOC_EV
8924 .    da TOC_ENTRIES
8925 .    if \\n[#PRINT_STYLE]=1 \{\
8926 \!.       fam C
8927 \!.       ft  R
8928 \!.       ps  12
8929 .    \}
8930 .    if \\n[#PRINT_STYLE]=2 \{\
8931 \!.     FAMILY  \\*[$TOC_PH_FAM]
8932 \!.     FT      \\*[$TOC_PH_FT]
8933 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PH_SIZE_CHANGE]
8934 .    \}
8935 \!.  TRAP OFF
8936 .    ie \\n[#PRINT_STYLE]=1 \{\
8937 \!.     PAD "\\h'6m'\\*[$TOC_PH_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
8938 .    \}
8939 .    el \{\
8940 \!.     PAD "\\h'\\n[#TOC_PH_INDENT]u'\\*[$TOC_PH_ITEM]\\*[$TOC_PN]"
8941 .    \}
8942 \!.  EOL
8943 \!.  ST 100 L
8944 \!.  ST 101 R
8945 .    if \\n[#PRINT_STYLE]=2 \{\
8946 \!.     FAMILY  \\*[$TOC_PN_FAM]
8947 \!.     FT      \\*[$TOC_PN_FT]
8948 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
8949 .    \}
8950 \!.  TAB 100
8951 \!.  PRINT \\*[LEADER]
8952 \!.  TN
8953 \!.  TRAP
8954 \!.  PRINT \\n[#TOC_ENTRY_PN]
8955 \!.  TQ
8956 .    di       
8957 .    ev
8958 .\" End collection of parahead for TOC
8959 .\" Process parahead
8960 .    if \\n[#SLANT_ON] \{\
8961 .       nr #SLANT_WAS_ON 1
8962 \E*[SLANTX]
8963 .    \}
8964 .    ie \\n[#PP]=1 \{\
8965 .       if \\n[#INDENT_FIRST_PARAS] \{\
8966 .          ti \\n[#PH_INDENT]u
8967 .       \}
8968 .    \}
8969 .    el \{ .ti \\n[#PH_INDENT]u \}
8970 .    if \\n[#PRINT_STYLE]=1 \{\
8971 .       TYPEWRITER
8972 .       UNDERLINE OFF
8973 .       ie \\n[#NUMBER_PH] \{\
8974 .          if \\n[#NUMBER_HEAD] \{\
8975 .             ie \\n[#NUMBER_SH] \{\
8976 .                UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
8977 \0
8978 .             \}
8979 .             el \{\
8980 .                UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1
8981 \0
8982 .             \}
8983 .          \}
8984 .          ie \\n[#NUMBER_SH] \{\
8985 .             if !\\n[#NUMBERED] \{\
8986 .                UNDERSCORE "\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1
8987 \0
8988 .             \}
8989 .          \}
8990 .          el \{\
8991 .             if !\\n[#NUMBERED] \{\
8992 .                UNDERSCORE "\\n+[#PH_NUM].\\ \\$1
8993 \0
8994 .             \}
8995 .          \}
8996 .       \}
8997 .       el \{\
8998 .          UNDERSCORE "\\$1
8999 \0
9000 .       \}
9001 .       if \\n[#SLANT_WAS_ON] \{\
9002 .          if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
9003 .          if \\n[#SLANT_MEANS_SLANT] \{\
9004 \E*[SLANT]\c
9005 .          \}
9006 .          rr #SLANT_WAS_ON
9007 .       \}
9008 .    \}
9009 .    if \\n[#PRINT_STYLE]=2 \{\
9010 .       FAM     \\*[$PH_FAM]
9011 .       FT      \\*[$PH_FT]
9012 .       PT_SIZE \\*[$PH_SIZE_CHANGE]
9013 .       if \\n[#PH_COLOR]=1 \{ .COLOR \\*[$PH_COLOR] \}
9014 .          ie \\n[#NUMBER_PH] \{\
9015 .             if \\n[#NUMBER_HEAD] \{\
9016 .                ie \\n[#NUMBER_SH] \{\
9017 .                   PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
9018 .                \}
9019 .                el \{\
9020 .                   PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
9021 .                \}
9022 .             \}
9023 .             ie \\n[#NUMBER_SH] \{\
9024 .                if !\\n[#NUMBERED] \{\
9025 .                   PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
9026 .                \}
9027 .             \}
9028 .             el \{\
9029 .                if !\\n[#NUMBERED] \{\
9030 .                   PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
9031 .                \}
9032 .             \}
9033 .          \}
9034 .          el \{\
9035 .             PRINT "\\$1\h'.6m'\c"
9036 .          \}
9037 .       \}
9038 .    FAMILY  \\*[$DOC_FAM]
9039 .    FT      \\*[$PP_FT]
9040 .    PT_SIZE \\n[#DOC_PT_SIZE]u
9041 .    if \\n[#PH_COLOR]=1 \m[]\c
9042 .    if \\n[#SLANT_WAS_ON] \{\
9043 .       rr #SLANT_WAS_ON
9044 \E*[SLANT]\c
9045 .    \}
9046 .    rr #NUMBERED
9047 .    rm $TOC_PH_ITEM
9048 .END
9049 \#
9050 \#
9051 \# ====================================================================
9052 \#
9053 \# +++LINE BREAKS+++
9054 \#
9055 \# LINEBREAK CHARACTER
9056 \# -------------------
9057 \# *Arguments:
9058 \#   [character] [iterations] [vertical adjustment]
9059 \# *Function:
9060 \#   Allows user to specify a line break character and the number
9061 \#   of times to repeat it horiontally.
9062 \# *Notes:
9063 \#   Without an argument, LINEBREAK_CHAR will deposit a blank line.
9064 \#
9065 \#   Vertical adjustment requires a unit of measure (most likely
9066 \#   "p"), and has to be preceded by +|-
9067 \#
9068 .MAC LINEBREAK_CHAR END
9069 .    nr #REPEAT 1
9070 .    ds $LINEBREAK_CHAR \\$1
9071 .    ds $LINEBREAK_CHAR_V_ADJ \\$3
9072 .    if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
9073 .       ds $LINEBREAK_CHAR_V_ADJ +0
9074 .    \}
9075 .    while \\$2>\\n[#REPEAT] \{\
9076 .       as $LINEBREAK_CHAR "\\ \\$1
9077 .       nr #REPEAT \\n[#REPEAT]+1
9078 .\}
9079 .   rr #REPEAT
9080 .END
9081 \#
9082 \#
9083 \# LINE BREAK
9084 \# ----------
9085 \# *Arguments:
9086 \#   <none>
9087 \# *Function:
9088 \#   Deposits line break character.
9089 \# *Notes:
9090 \#   If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
9091 \#
9092 .MAC LINEBREAK END
9093 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
9094 .    po \\n[#DOC_L_MARGIN]u
9095 .    ie  '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
9096 .    el \{\
9097 .       if \\n[#PRINT_STYLE]=1 \{\
9098 .          ie \\n[#END_QUOTE] \{ . \}
9099 .          el \{ .ALD \\n[#DOC_LEAD]u \}
9100 .       \}
9101 .       if \\n[#PRINT_STYLE]=2 \{\
9102 .          ie \\n[#END_QUOTE] \{ . \}
9103 .          el \{ .ALD \\n[#DOC_LEAD]u \}
9104 .       \}
9105 .       ev LINEBREAK
9106 .       evc 0
9107 .       CENTER
9108 .       PRINT \m[\\*[$LINEBREAK_COLOR]]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\m[]
9109 .       if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
9110 .       if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
9111 .       ev
9112 .       QUAD \\*[$DOC_QUAD]
9113 .    \}
9114 .    nr #LINEBREAK 1
9115 .    if r#QUOTE     \{ .rr #QUOTE     \}
9116 .    if r#END_QUOTE \{ .rr #END_QUOTE \}
9117 .    nr #PP 0
9118 .END
9119 \#
9120 \# ====================================================================
9121 \#
9122 \# +++PARAGRAPHS+++
9123 \#
9124 \# PARAGRAPH FONT
9125 \# --------------
9126 \# *Argument:
9127 \#   <font of running text>
9128 \# *Function:
9129 \#   Creates or modifies string $PP_FT.
9130 \# *Notes:
9131 \#   Affects all paragraphs.
9132 \#
9133 .MAC PP_FONT END
9134 .    if \\n[#IGNORE] \{ .return \}
9135 .    br
9136 .    ds $PP_FT \\$1
9137 .    FT \\*[$PP_FT]
9138 .END
9139 \#
9140 \#
9141 \# PARAGRAPH INDENT
9142 \# ----------------
9143 \# *Argument:
9144 \#   <amount to indent paragraphs in running text (ipPcm)>
9145 \# *Function:
9146 \#   Allows user to change the default para indent.  The change will
9147 \#   affect the indent of QUOTEs and BLOCKQUOTEs as well.
9148 \# *Notes:
9149 \#   Default for printstyle TYPEWRITE is 1/2-inch.  Default for
9150 \#   printstyle TYPESET is 2 ems.  The defaults are set in
9151 \#   PRINTSTYLE, not DEFAULTS.
9152 \#
9153 .MAC PARA_INDENT END
9154 .    nr #PP_INDENT (\\$1)
9155 .END
9156 \#
9157 \#
9158 \# INDENT FIRST PARAGRAPHS
9159 \# -----------------------
9160 \# *Arguments:
9161 \#   <none> | <anything>
9162 \# *Function:
9163 \#   By default, the first para of a document, as well as the first
9164 \#   paras of blockquotes and block-style epigraphs are not indented.
9165 \#   When invoked, this macro will indent all paras.
9166 \# *Notes:
9167 \#   Default is OFF.
9168 \#
9169 .MAC INDENT_FIRST_PARAS END
9170 .    ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
9171 .    el \{ .rr #INDENT_FIRST_PARAS   \}
9172 .END
9173 \#
9174 \#
9175 \# INTER-PARAGRAPH SPACING
9176 \# -----------------------
9177 \# *Arguments:
9178 \#   <none> | <anything>
9179 \# *Function:
9180 \#   Adds a line space between paragraphs in body text.  Block quotes
9181 \#   are unaffected.
9182 \# *Notes:
9183 \#   Default is OFF.  PARA_SPACE ON is not recommended for use
9184 \#   with PRINTSTYLE TYPEWRITE.
9185 \#
9186 .MAC PARA_SPACE END
9187 .    ie '\\$1'' \{ .nr #PP_SPACE 1 \}
9188 .    el \{ .rr #PP_SPACE   \}
9189 .END
9190 \#
9191 \#
9192 \# PARAGRAPH
9193 \# ---------
9194 \# *Arguments:
9195 \#   <none>
9196 \# *Function:
9197 \#   Figures out what to do with paragraphs under differing conditions.
9198 \# *Notes:
9199 \#   For the time being, there's no automatic widow/orphan control.
9200 \#   Controlling them isn't just a matter of establishing an arbitrary
9201 \#   number of lines needed for a para, since groff doesn't then
9202 \#   handle single line paragraphs gracefully.  Usually, the whole
9203 \#   page needs to be tweaked.
9204 \#
9205 \#   Note the use of transparent line break (\!.br) to get
9206 \#   PP to work within blockquotes and epigraphs.
9207 \#
9208 \#   PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
9209 \#
9210 .MAC PP END
9211 .    br
9212 .    if \\n[#DOC_TYPE]=4 \{\
9213 .       if !'\\n(.z'' \{ .di \}
9214 .       nr #TOTAL_FIELDS \\n[#FIELD]
9215 .       nr #FIELD        0 1
9216 .       nr #NUM_FIELDS   0 1
9217 .       if \\n[#TOTAL_FIELDS]>0 \{\
9218 .          while \\n+[#NUM_FIELDS]<=\\n[#TOTAL_FIELDS] \{\
9219 .             nf
9220 .             LETTERHEAD\\n+[#FIELD]
9221 .             QUAD \\*[$DOC_QUAD]
9222 .             ALD \\n[#DOC_LEAD]u
9223 .             if \\n[#DATE_FIRST]=1 \{ .ALD \\n[#DOC_LEAD]u \}
9224 .             rr #DATE_FIRST
9225 .             rm LETTERHEAD\\n[#FIELD]
9226 .\}
9227 .          rr #FIELD
9228 .          rr #NUM_FIELDS
9229 .          rr #TOTAL_FIELDS
9230 .       \}
9231 .    \}
9232 .    rr #PP_ACTIVE
9233 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
9234 .    if \\n[#PP_STYLE]=1 \{\
9235 .       if \\n[#ENDNOTE] \{\
9236 .          nr #RESET_PARA_SPACE \\n[#PP_SPACE]
9237 .          ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
9238 .          el \{ .PARA_SPACE OFF \}
9239 .       \}
9240 .       br
9241 .       if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
9242 .       if \\n[#COLUMNS] \{\
9243 .          if !\\n[#ENDNOTE] \{\
9244 .             po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9245 .             nr #L_MARGIN \\n(.o
9246 .          \}
9247 .       \}
9248 .       if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9249 .       ie \\n[#PRINT_STYLE]=1 \{\
9250 .          TYPEWRITER
9251 .          ie \\n[#ENDNOTE] \{ .vs \\n[#EN_LEAD]u \}
9252 .          el \{ .vs \\n[#DOC_LEAD]u \}
9253 .          QUAD \\*[$DOC_QUAD]
9254 .          UNDERLINE OFF
9255 .          if \\n[#SLANT_ON] \{\
9256 .             if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
9257 .          \}
9258 .       \}
9259 .       el \{\
9260 .          ie \\n[#ENDNOTE] \{\
9261 .             FAMILY  \\*[$EN_FAM]
9262 .             FT      \\*[$EN_FT]
9263 .             PT_SIZE \\n[#EN_PS]u
9264 .             vs      \\n[#EN_LEAD]u
9265 .             QUAD    \\*[$EN_QUAD]
9266 .          \}
9267 .          el \{\
9268 .             FAMILY  \\*[$DOC_FAM]
9269 .             FT      \\*[$PP_FT]
9270 .             PT_SIZE \\n[#DOC_PT_SIZE]u
9271 .             LS      \\n[#DOC_LEAD]u
9272 .             QUAD    \\*[$DOC_QUAD]
9273 .          \}
9274 .       \}
9275 .       ie \\n[#PP]=0 \{\
9276 .          if \\n[#INDENT_FIRST_PARAS] \{\
9277 .             ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
9278 .             el \{ .ti \\n[#PP_INDENT]u \}
9279 .             if '\\n(.z'END_NOTES' \{\
9280 .                ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
9281 .             \}
9282 .          \}
9283 .          if r#END_QUOTE \{\
9284 .             if \\n[#END_QUOTE] \{\
9285 .                if !\\n[#LINEBREAK] \{\
9286 .                   ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
9287 .                   el \{ .ti \\n[#PP_INDENT]u \}
9288 .                   if '\\n(.z'END_NOTES' \{\
9289 .                      ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
9290 .                   \}
9291 .                \}
9292 .             \}
9293 .          \}
9294 .       \}
9295 .       el \{\
9296 .          br
9297 .          if \\n[#PP_SPACE] \{\
9298 .             if \\n[#PRINT_STYLE]=2 \{\
9299 .                ie \\n[#END_QUOTE] \{\
9300 .                   ALD \\n[#DOC_LEAD]u
9301 .                   rr #END_QUOTE
9302 .                   nr #NO_SPACE 1
9303 .                   nr #BASELINE_MARK \\n(nl
9304 .                \}
9305 .                el \{\
9306 .                   if \\n[#NO_SPACE]=1 \{\
9307 .                      rr #NO_SPACE
9308 .                   \}
9309 .                   if !\\n(nl=\\n[#BASELINE_MARK] \{\
9310 .                      ALD \\n[#DOC_LEAD]u
9311 .                      rr #BASELINE_MARK
9312 .                   \}
9313 .                \}
9314 .             \}
9315 .          \}
9316 .          ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
9317 .          el \{ .ti \\n[#PP_INDENT]u \}
9318 .          if '\\n(.z'END_NOTES' \{\
9319 .             ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
9320 .          \}
9321 .       \}
9322 .       if r#START     \{ .rr #START     \}
9323 .       if r#QUOTE     \{ .rr #QUOTE     \}
9324 .       if r#END_QUOTE \{ .rr #END_QUOTE \}
9325 .       if r#HEAD      \{ .rr #HEAD      \}
9326 .       if r#EPIGRAPH  \{ .rr #EPIGRAPH  \}
9327 .       if r#Q_FITS    \{ .rr #Q_FITS    \}
9328 .       if r#LINEBREAK \{ .rr #LINEBREAK \}
9329 .       if \\n[#ENDNOTE] \{\
9330 .          ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
9331 .          el \{ .PARA_SPACE OFF \}
9332 .       \}
9333 .       if \\n[#CONDENSE] \{\
9334 \E*[COND]\c
9335 .       \}
9336 .       if \\n[#EXTEND]=1 \{\
9337 \E*[EXT]\c
9338 .       \}
9339 .       nr #PP +1
9340 .    \}
9341 .    if \\n[#PP_STYLE]=2 \{\
9342 \!.     br
9343 .       if \\n[#BROKEN_QUOTE] \{\
9344 .          ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
9345 .          el \{ .nr #Q_PP 0 \}
9346 .          rr #BROKEN_QUOTE
9347 .       \}
9348 .       ie \\n[#Q_PP]=0 \{\
9349 .          if \\n[#INDENT_FIRST_PARAS] \{\
9350 .             ti \\n[#PP_INDENT]u/2u
9351 .          \}
9352 .          if \\n[#ENDNOTE] \{\
9353 .             ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
9354 .             el \{ .ti 0 \}
9355 .          \}
9356 .       \}
9357 .       el \{\
9358 .          ti \\n[#PP_INDENT]u/2u
9359 .       \}
9360 .       if \\n[#CONDENSE] \{\
9361 \E*[COND]\c
9362 .       \}
9363 .       if \\n[#EXTEND]=1 \{\
9364 \E*[EXT]\c
9365 .       \}
9366 .    nr #Q_PP +1
9367 .    \}
9368 .    nr #PP_ACTIVE 1
9369 .END
9370 \#
9371 \# ====================================================================
9372 \#
9373 \# +++QUOTES+++
9374 \#
9375 \# ---Line for line quotes, i.e. poetry or code snippets---
9376 \#
9377 \# UNDERLINE QUOTES
9378 \# ----------------
9379 \# *Arguments:
9380 \#   <none> | <anything>
9381 \# *Function:
9382 \#   Creates or modifies register #UNDERLINE_QUOTES (toggle).
9383 \#   If on, line for line quotes are underlined when printstyle
9384 \#   is TYPEWRITE.
9385 \# *Notes:
9386 \#   Default is ON for printstyle TYPEWRITE.
9387 \#
9388 .MAC UNDERLINE_QUOTES END
9389 .    ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
9390 .    el \{ .rr #UNDERLINE_QUOTES   \}
9391 .END
9392 \#
9393 \#
9394 \# QUOTE INDENT
9395 \# ------------
9396 \# *Argument:
9397 \#   <value by which to multiply PP_INDENT for indented quoted text>
9398 \# *Function:
9399 \#   Creates or modifies register #Q_OFFSET_VALUE.
9400 \# *Notes:
9401 \#   Default is 3 for typeset; 2 for typewrite
9402 \#
9403 .MAC QUOTE_INDENT END
9404 .    nr #Q_OFFSET_VALUE \\$1
9405 .END
9406 \#
9407 \#
9408 \# QUOTE_AUTOLEAD
9409 \# --------------
9410 \# *Arguments:
9411 \#   <autolead value>
9412 \# *Function:
9413 \#   Sets autolead for quotes and/or blockquotes.
9414 \#
9415 .MAC QUOTE_AUTOLEAD END
9416 .    if '\\$0'QUOTE_AUTOLEAD'      \{ .nr #Q_AUTOLEAD \\$1 \}
9417 .    if '\\$0'BLOCKQUOTE_AUTOLEAD' \{ .nr #BQ_AUTOLEAD \\$1 \}
9418 .    if '\\$0'ENDNOTE_QUOTE_AUTOLEAD'      \{ .nr #EN_Q_AUTOLEAD \\$1 \}
9419 .    if '\\$0'ENDNOTE_BLOCKQUOTE_AUTOLEAD' \{ .nr #EN_BQ_AUTOLEAD \\$1 \}
9420 .END
9421 \#
9422 .ALIAS BLOCKQUOTE_AUTOLEAD         QUOTE_AUTOLEAD
9423 .ALIAS ENDNOTE_QUOTE_AUTOLEAD      QUOTE_AUTOLEAD
9424 .ALIAS ENDNOTE_BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
9425 \#
9426 \# ALWAYS FULLSPACE QUOTES
9427 \# -----------------------
9428 \# *Arguments:
9429 \#   <none> | <anything>
9430 \# *Function:
9431 \#   Toggles register #FULLSPACE_QUOTES.
9432 \# *Notes:
9433 \#   If user doesn't like the default 1/2 line space above and below
9434 \#   quotes, s/he can turn it off here.  Has no effect in TYPEWRITE.
9435 \#
9436 .MAC ALWAYS_FULLSPACE_QUOTES END
9437 .    if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
9438 .    el \{ .rr #FULLSPACE_QUOTES \}
9439 .END
9440 \#
9441 \#
9442 \# QUOTE
9443 \# -----
9444 \# *Arguments:
9445 \#   <none> | <anything>
9446 \# *Function:
9447 \#   Indents quoted text on a line for line basis, or turns QUOTE off.
9448 \# *Notes:
9449 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
9450 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
9451 \#   how much space to put before and after.
9452 \#
9453 .MAC QUOTE END
9454 .    br
9455 .    if \\n[#LINENUMBERS]=1 \{\
9456 .       nr #LINENUMBERS 2
9457 .       nr #NEXT_LN \\n(ln
9458 .       nm
9459 .    \}
9460 .    ie '\\$1'' \{\
9461 .       ev QUOTE
9462 .       if \\n[#LINENUMBERS]=2 \{\
9463 .          if \\n[#SILENT_QUOTE_LN]=1 \{ .nm \\n[#NEXT_LN] 1000 -4 \}
9464 .       \}
9465 .       nr #IN_DIVER 1
9466 .       nr #QUOTE 1
9467 .       di P_QUOTE
9468 .       ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
9469 .       if \\n[#LINENUMBERS]=2 \{\
9470 .          if \\n[#QUOTE_LN]=1 \{\
9471 .             nm \\n(ln "" \\*[$Q_LN_GUTTER] -3-\\*[$Q_LN_GUTTER]
9472 .          \}
9473 .       \}
9474 .       ta \\n(.lu
9475 .       if \\n[#COLUMNS] \{\
9476 .          ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
9477 .          ta \\n(.lu
9478 .       \}
9479 .       if \\n[#PRINT_STYLE]=1 \{\
9480 .          TYPEWRITER
9481 .          vs \\n[#DOC_LEAD]u
9482 .          LEFT
9483 .       \}
9484 .       if \\n[#PRINT_STYLE]=2 \{\
9485 .          FAMILY  \\*[$QUOTE_FAM]
9486 .          FT      \\*[$QUOTE_FT]
9487 .          PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
9488 .          ie !r#Q_AUTOLEAD  \{ .LS \\n[#Q_LEAD]u \}
9489 .          el \{\
9490 .             AUTOLEAD \\n[#Q_AUTOLEAD]
9491 .             nr #Q_LEAD \\n(.v
9492 .          \}
9493 .          if \\n[#ENDNOTE] \{\
9494 .             PT_SIZE \\n[#EN_PS]u\\*[$QUOTE_SIZE_CHANGE]
9495 .             ie !r#EN_Q_AUTOLEAD  \{ .LS \\n[#EN_Q_LEAD]u \}
9496 .             el \{\
9497 .                AUTOLEAD \\n[#EN_Q_AUTOLEAD]
9498 .                nr #EN_Q_LEAD \\n(.v
9499 .             \}
9500 .          \}
9501 .          nr #Q_LEAD_REAL \\n(.v
9502 .          LEFT
9503 .          if \\n[#QUOTE_COLOR]=1 \{\
9504 .             nf
9505 \m[\\*[$QUOTE_COLOR]]
9506 .             EOL
9507 .          \}
9508 .       \}
9509 .       if \\n[#LINENUMBERS]=2 \{\
9510 .          ie \\n[#QUOTE_LN]=1 \{\
9511 .             if '\\*[$Q_LN_GUTTER]'' .ds $Q_LN_GUTTER \\*[$LN_GUTTER]
9512 .             nm \\n(ln "" \\*[$Q_LN_GUTTER] -3-\\*[$Q_LN_GUTTER]
9513 .          \}
9514 .          el \{\
9515 .             if !\\n[#SILENT_QUOTE_LN] \{ .NUMBER_LINES OFF \}
9516 .          \}
9517 .       \}
9518 .       nr #Q_TOP \\n(nl
9519 .       if \\n[#PRINT_STYLE]=1 \{\
9520 .          if \\n[#UNDERLINE_QUOTES] \{\
9521 .               FT I
9522 .          \}
9523 .       \}
9524 .    \}
9525 .    el \{ .DO_QUOTE \}
9526 .END
9527 \#
9528 \# ---Blockquotes---
9529 \#
9530 \# BLOCKQUOTE
9531 \# ----------
9532 \# *Arguments:
9533 \#   <none> | <anything>
9534 \# *Function:
9535 \#   Indents quoted text in fill mode and shortens line length
9536 \#   equivalently, or turns BLOCKQUOTE off.
9537 \# *Notes:
9538 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
9539 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
9540 \#   how much space to put before and after.
9541 \#
9542 \#   .PP after blockquote is optional if there's only one para,
9543 \#   but REQUIRED if there's more than one.
9544 \#
9545 .MAC BLOCKQUOTE END
9546 .    br
9547 .    if \\n[#LINENUMBERS]=1 \{\
9548 .       nr #LINENUMBERS 2
9549 .       nr #NEXT_LN \\n(ln
9550 .       nm
9551 .    \}
9552 .    ie '\\$1'' \{\
9553 .       ev BLOCKQUOTE
9554 .       if \\n[#LINENUMBERS]=2 \{\
9555 .          if \\n[#SILENT_BQUOTE_LN]=1 \{ .nm \\n[#NEXT_LN] 1000 -4 \}
9556 .       \}
9557 .       nr #IN_DIVER 1
9558 .       nr #QUOTE    2
9559 .       nr #PP_STYLE 2
9560 .       nr #Q_PP     0
9561 .       di B_QUOTE
9562 .       ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9563 .       if \\n[#ENDNOTE] \{\
9564 .          if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
9565 .             ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9566 .          \}
9567 .          if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
9568 .             ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9569 .          \}
9570 .       \}
9571 .       ta \\n(.lu
9572 .       CHECK_INDENT
9573 .       if \\n[#COLUMNS] \{\
9574 .          ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9575 .          if \\n[#ENDNOTE] \{\
9576 .             if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
9577 .                ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9578 .             \}
9579 .             if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
9580 .                ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9581 .             \}
9582 .          \}
9583 .          ta \\n(.lu
9584 .       \}
9585 .       if \\n[#PRINT_STYLE]=1 \{\
9586 .          TYPEWRITER
9587 .          vs \\n[#DOC_LEAD]u
9588 .          QUAD LEFT
9589 .          HY OFF
9590 .       \}
9591 .       if \\n[#PRINT_STYLE]=2 \{\
9592 .          FAMILY  \\*[$BQUOTE_FAM]
9593 .          FT      \\*[$BQUOTE_FT]
9594 .          PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
9595 .          ie !\\n[#BQ_AUTOLEAD] \{ .LS \\n[#BQ_LEAD]u \}
9596 .          el \{\
9597 .             AUTOLEAD \\n[#BQ_AUTOLEAD]
9598 .             nr #BQ_LEAD \\n(.v
9599 .          \}
9600 .          if \\n[#ENDNOTE] \{\
9601 .             PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
9602 .             ie !r#EN_BQ_AUTOLEAD  \{ .LS \\n[#EN_BQ_LEAD]u \}
9603 .             el \{\
9604 .                AUTOLEAD \\n[#EN_BQ_AUTOLEAD]
9605 .                nr #EN_BQ_LEAD \\n(.v
9606 .             \}
9607 .          \}
9608 .          nr #Q_LEAD_REAL \\n(.v
9609 .          if \\n[#BQUOTE_COLOR]=1 \{\
9610 .             nf
9611 \m[\\*[$BQUOTE_COLOR]]
9612 .             EOL
9613 .          \}
9614 .          QUAD \\*[$BQUOTE_QUAD]
9615 .          nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
9616 .          HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
9617 .          hy 14
9618 .       \}
9619 .       if \\n[#LINENUMBERS]=2 \{\
9620 .          ie \\n[#BQUOTE_LN]=1 \{\
9621 .             if '\\*[$BQ_LN_GUTTER]'' .ds $BQ_LN_GUTTER \\*[$LN_GUTTER]
9622 .             nm \\n(ln "" \\*[$BQ_LN_GUTTER] -3-\\*[$BQ_LN_GUTTER]
9623 .          \}
9624 .          el \{\
9625 .             if !\\n[#SILENT_BQUOTE_LN] \{ .NUMBER_LINES OFF \}
9626 .          \}
9627 .       \}
9628 .       nr #Q_TOP \\n(nl
9629 .       if \\n[#INDENT_FIRST_PARAS] \{\
9630 .          ie !\\n[#ENDNOTE] \{\
9631 .             if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
9632 .             if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
9633 .          \}
9634 .          el \{\
9635 .             if \\n[#INDENT_FIRSTS]=1 \{\
9636 .                if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
9637 .                if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
9638 .             \}
9639 .          \}
9640 .       \}
9641 .    \}
9642 .    el \{ .DO_QUOTE \}
9643 .END
9644 \#
9645 \#
9646 \# DO QUOTE
9647 \# --------
9648 \# *Arguments:
9649 \#   <none>
9650 \# *Function:
9651 \#   Ends the diversion P_QUOTE or B_QUOTE.  Spaces them according to
9652 \#   PRINTSTYLE, whether there's inter-paragraph spacing, and page
9653 \#   position.  TYPEWRITE treats spacing the same way in all circumstance
9654 \#   (viz. an extra line space).  TYPESET puts in only half
9655 \#   line spaces if the entire quote plus 1 line of body under the quote
9656 \#   fits on the the page; otherwise it puts in a full extra blank
9657 \#   line.  (This is to ensure the page remains bottom aligned).
9658 \#
9659 .MAC DO_QUOTE END
9660 .    br
9661 .    if \\n[#DIVER_LN_OFF] \{\
9662 \!.     NUMBER_LINES OFF
9663 .       rr #DIVER_LN_OFF
9664 .    \}
9665 .    di
9666 .    rr #IN_DIVER
9667 .    if \\n[#RESET_FN_COUNTERS]=2 \{\
9668 .       if !\\n[#FN_COUNT]=1 \{\
9669 .          if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
9670 .             DIVER_FN_2_POST
9671 .             rr #RESET_FN_COUNTERS
9672 .          \}
9673 .       \}
9674 .    \}
9675 .    nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
9676 .    nr #DONE_ONCE 0 1
9677 .    REMOVE_INDENT
9678 .    ev
9679 .    nr #Q_DEPTH (\\n[#DIVER_DEPTH]-\\n[#Q_LEAD_REAL])+\\n[#LEAD]
9680 .    nr #Q_LEAD_DIFF \\n[#LEAD]-\\n[#Q_LEAD_REAL]
9681 .    SILENT
9682 .    br
9683 .    nf
9684 .    nr #CURRENT_V_POS \\n(nl+\\n[#Q_LEAD_DIFF]+(\\n[#DIVER_DEPTH]-\\n[#Q_DEPTH_REAL])
9685 .    SHIM
9686 .    SILENT OFF
9687 .    nr #Q_SPACE_ADJ \\n[#SHIM]/2
9688 .    nr #TRAP \\n(.t-1
9689 .    if \\n[#ENDNOTE] \{\
9690 .       nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
9691 .       ALWAYS_FULLSPACE_QUOTES
9692 .    \}
9693 .    if \\n[#PRINT_STYLE]=1 \{\
9694 .       if \\n[#START]=1 \{ . \}
9695 .       if \\n[#START]=0 \{\
9696 .          if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
9697 .       \}
9698 .       if \\n[#HEAD] \{\
9699 .          if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
9700 .       \}
9701 .    \}
9702 .    if \\n[#PRINT_STYLE]=2 \{\
9703 .       ie \\n[#PP_SPACE] \{\
9704 .          ie \\n[#HEAD]>0 \{ . \}
9705 .          el \{\
9706 .             ie \\n[#START] \{ . \}
9707 .             el \{ .ALD \\n[#DOC_LEAD]u \}
9708 .          \}
9709 .       \}
9710 .       el \{\
9711 .          ie \\n[#Q_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
9712 .             ie (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_DEPTH]<\\n[#DOC_LEAD] \{\
9713 .                Q_NOFIT
9714 .             \}
9715 .             el \{\
9716 .                Q_FITS
9717 .             \}
9718 .          \}
9719 .          el \{\
9720 .             Q_NOFIT
9721 .          \}
9722 .       \}
9723 .    \}
9724 .    nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9725 .    if \\n[#COLUMNS] \{\
9726 .       nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9727 .    \}
9728 .    if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
9729 .    if \\n[#ENDNOTE] \{\
9730 .       in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
9731 .    \}
9732 .    ie \\n[#START]=1 \{\
9733 .       ie !\\n[#Q_LEAD_DIFF]<0 \{ .ALD \\n[#Q_SPACE_ADJ]u \}
9734 .       el \{ .RLD 0-\\n[#Q_LEAD_DIFF]u \}
9735 .    \}
9736 .    el \{\
9737 .       ALD \\n[#Q_SPACE_ADJ]u
9738 .    \}
9739 .    if \\n[#QUOTE]=1 \{\
9740 .       nf
9741 .       P_QUOTE
9742 .       if !\\n[#START] \{ .rr #QUOTE \}
9743 .    \}
9744 .    if \\n[#QUOTE]=2 \{\
9745 .       nf
9746 .       B_QUOTE
9747 .    \}
9748 .    if \\n[#PRINT_STYLE]=1 \{\
9749 .       ALD \\n[#DOC_LEAD]u
9750 .    \}
9751 .    if \\n[#PRINT_STYLE]=2 \{\
9752 .       ie \\n[#START] \{\
9753 .          ie \\n[#PP_SPACE] \{\
9754 .
9755 .          \}
9756 .          el \{\
9757 .             ALD \\n[#DOC_LEAD]u
9758 .             SHIM
9759 .          \}
9760 .       \}
9761 .       el \{\
9762 .          ie \\n[#PP_SPACE] \{ . \}
9763 .          el \{\
9764 .             ie \\n[#HEAD]=1 \{\
9765 .                ALD \\n[#DOC_LEAD]u
9766 .                SHIM
9767 .             \}
9768 .             el \{\
9769 .                ie \\n[#FULLSPACE_QUOTES] \{\
9770 .                   ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
9771 .                   el \{ .ALD \\n[#DOC_LEAD]u \}
9772 .                \}
9773 .                el \{ .ALD (\\n[#DOC_LEAD]u/2u) \}
9774 .                ie \\n[#Q_FITS] \{\
9775 .                   ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
9776 .                      nr #Q_AT_TOP 1
9777 .                      nr #DELAY_SHIM 1
9778 .                   \}
9779 .                   el \{ .SHIM \}
9780 .                \}
9781 .                el \{\
9782 .                   SHIM
9783 .\" Make sure that Q_LEAD_DIFF is not added to the first line of
9784 .\" normal text at the top of any page following output of a quote
9785 .\" whose last line falls on B_MARGIN of the previous page.
9786 .                   if \\n(nl=(\\n[#T_MARGIN]-\\n[#DOC_LEAD]+\\n[#Q_LEAD_DIFF]) \{\
9787 .                      PRINT \&
9788 .                      br
9789 .                      sp -1v-\\n[#Q_LEAD_DIFF]u
9790 .                   \}
9791 .                \}
9792 .             \}
9793 .          \}
9794 .       \}
9795 .    \}
9796 .    if \\n[#LINENUMBERS]=2 \{\
9797 .       nr #LINENUMBERS 1
9798 .       ie \\n[#RESTORE_LN_NUM]=1 \{ .nm \\n[#NEXT_LN] \}
9799 .       el \{ .nm +0 \}
9800 .    \}
9801 .    if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
9802 .    if r#HEAD        \{ .rr #HEAD     \}
9803 .    if r#EPIGRAPH    \{ .rr #EPIGRAPH \}
9804 .    rr #Q_PP
9805 .    rr #LINEBREAK
9806 .    nr #PP_STYLE  1
9807 .    nr #END_QUOTE 1
9808 .    if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
9809 .    if \\n[#ENDNOTE] \{\
9810 .       in \\n[#EN_TEXT_INDENT]u
9811 .    \}
9812 .    if \\n[#COLUMNS] \{\
9813 .       if !\\n[#ENDNOTE] \{\
9814 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9815 .          nr #L_MARGIN \\n(.o
9816 .       \}
9817 .       if \\n[#ENDNOTE] \{\
9818 .          in \\n[#EN_TEXT_INDENT]u
9819 .       \}
9820 .    \}
9821 .    ie !\\n[#ENDNOTE] \{\
9822 .       nr #RESET_PP_INDENT \\n[#PP_INDENT]
9823 .       PARA_INDENT 0
9824 .       PP
9825 .       PARA_INDENT \\n[#RESET_PP_INDENT]u
9826 .       QUAD \\*[$DOC_QUAD]
9827 .    \}
9828 .    el \{\
9829 .       nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
9830 .       ENDNOTE_PARA_INDENT 0
9831 .       PP
9832 .       ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
9833 .       QUAD \\*[EN_QUAD]
9834 .    \}
9835 .    if r#DELAY_SHIM \{\
9836 .       SHIM
9837 .       rr #DELAY_SHIM
9838 .    \}
9839 .END
9840 \#
9841 \#
9842 \# Utility macros for DO_QUOTE
9843 \# ---------------------------
9844 \#
9845 .MAC Q_FITS END
9846 .    nr #Q_FITS 1
9847 .    ie \\n[#HEAD]=1 \{\
9848 .       ALD \\n[#Q_LEAD_DIFF]u
9849 .    \}
9850 .    el \{\
9851 .       ie \\n[#START] \{ . \}
9852 .       el \{\
9853 .          ie \\n[#FULLSPACE_QUOTES] \{\
9854 .             ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
9855 .             el \{ .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
9856 .          \}
9857 .          el \{\
9858 .\" This seems to be the only way to get the baseline of quotes that start
9859 .\" at the top of the page to fall on the first line of the "grid" (i.e on
9860 .\" the first legal baseline of the page).
9861 .             ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
9862 .                if \\n[#QUOTE]=1 \{\
9863 .                   rn P_QUOTE Q_TEMP
9864 .                   di P_QUOTE
9865 .                   vs \\n[#Q_LEAD]u
9866 .                   PRINT \&
9867 .                   sp -1v+\\n[#Q_LEAD_DIFF]u
9868 .                   Q_TEMP
9869 .                   di
9870 .                \}
9871 .                if \\n[#QUOTE]=2 \{\
9872 .                   rn B_QUOTE Q_TEMP
9873 .                   di B_QUOTE
9874 .                   vs \\n[#BQ_LEAD]u
9875 .                   PRINT \&
9876 .                   sp -1v+\\n[#Q_LEAD_DIFF]u
9877 .                   Q_TEMP
9878 .                   di
9879 .                \}
9880 .                rm Q_TEMP
9881 .             \}
9882 .             el \{\
9883 .                ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_LEAD_DIFF]u
9884 .             \}
9885 .          \}
9886 .       \}
9887 .       if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
9888 .    \}
9889 .END
9890 \#
9891 .MAC Q_NOFIT END
9892 .    rr #Q_FITS
9893 .    ie r#HEAD \{\
9894 .       if \\n[#HEAD]=1 \{ . \}
9895 .    \}
9896 .    el \{\
9897 .       ie \\n[#FULLSPACE_QUOTES] \{\
9898 .          ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
9899 .          el \{ .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
9900 .       \}
9901 .       el \{ .ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_LEAD_DIFF]u \}
9902 .       nr #Q_PARTIAL_DEPTH 0 \\n[#Q_LEAD_REAL]
9903 .       while \\n+[#Q_PARTIAL_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
9904 .
9905 .\}
9906 .       nr #Q_PARTIAL_DEPTH -\\n[#Q_LEAD_REAL]
9907 .       nr #Q_SPACE_ADJ (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_PARTIAL_DEPTH]+\\n[#Q_LEAD_DIFF]u
9908 .\" Hack to deal with the fact that even though the above routine
9909 .\" makes the bottom line of the quote fall exactly on the bottom
9910 .\" margin when traps are disabled, it refuses to do so when traps
9911 .\" are on.  The difference by which it's off is #Q_LEAD_DIFF
9912 .\" (the +\\n[#Q_LEAD_DIFF] at the end of the line, above).  Hack
9913 .\" solution: temporarily lower the FOOTER trap position.
9914 .       nr #SAVED_FOOTER_POS \\n[#VARIABLE_FOOTER_POS]
9915 .       ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+.25v
9916 .    \}
9917 .END
9918 \#
9919 \# ====================================================================
9920 \#
9921 \# BREAK QUOTE
9922 \# -----------
9923 \# *Arguments:
9924 \#   <none>
9925 \# *Function:
9926 \#   Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
9927 \#   page, and reinvokes BLOCKQUOTE.
9928 \# *Notes:
9929 \#   Because quotes go into a diversion before they're output,
9930 \#   footnotes in quotes that cross pages behave erratically.  The footnote
9931 \#   isn't processed until the diversion ends, hence the footnote
9932 \#   marker in the quote isn't always correct for the new page (it's
9933 \#   picked up from the old one).  BREAK_QUOTE is a workaround for
9934 \#   this problem.
9935 \#
9936 .MAC BREAK_QUOTE END
9937 .    br
9938 .    di
9939 .    nr #BROKEN_QUOTE 1
9940 .    REMOVE_INDENT
9941 .    ev
9942 .    nr #Q_DEPTH \\n[#DIVER_DEPTH]+\\n[#LEAD]
9943 .    if \\n[#PRINT_STYLE]=1 \{\
9944 .       if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
9945 .       if \\n[#HEAD] \{\
9946 .          if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
9947 .       \}
9948 .    \}
9949 .    if \\n[#PRINT_STYLE]=2 \{\
9950 .       ie \\n[#PP_SPACE] \{\
9951 .          ie \\n[#HEAD]=1 \{ . \}
9952 .          el \{\
9953 .             if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
9954 .          \}
9955 .       \}
9956 .       el \{\
9957 .          rr #Q_FITS
9958 .          ie r#HEAD \{\
9959 .             if \\n[#HEAD]=1 \{ . \}
9960 .          \}
9961 .          el \{ .ALD \\n[#DOC_LEAD]u \}
9962 .       \}
9963 .    \}
9964 .    nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9965 .    if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
9966 .    po \\n[#Q_OFFSET]u
9967 .    if \\n[#QUOTE]=1 \{\
9968 .       nf
9969 .       P_QUOTE
9970 .    \}
9971 .    if \\n[#QUOTE]=2 \{\
9972 .       nf
9973 .       B_QUOTE
9974 .    \}
9975 .    if r#HEAD     \{ .rr #HEAD     \}
9976 .    if r#EPIGRAPH \{ .rr #EPIGRAPH \}
9977 .    rr #Q_PP
9978 .    rr #LINEBREAK
9979 .    nr #PP_STYLE  1
9980 .    nr #END_QUOTE 1
9981 .    if \\n[#PRINT_STYLE]=1 \{\
9982 .       if \\n[#UNDERLINE_QUOTES] \{\
9983 .          UNDERLINE OFF
9984 .       \}
9985 .    \}
9986 .    po \\n[#L_MARGIN]u
9987 .    if \\n[#COLUMNS] \{\
9988 .       po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9989 .       nr #L_MARGIN \\n(.o
9990 .    \}
9991 .    QUAD \\*[$DOC_QUAD]
9992 .    sp |\\n[#PAGE_LENGTH]u  \" To trip footer/header
9993 .    BLOCKQUOTE
9994 .END
9995 \#
9996 \# ====================================================================
9997 \#
9998 \# +++PAGINATION+++
9999 \#
10000 \# PAGINATE
10001 \# --------
10002 \# *Arguments:
10003 \#   <none> | <anything>
10004 \# *Function:
10005 \#   Turns page numbering off or on during document processing.
10006 \# *Notes:
10007 \#   Default is on.
10008 \#
10009 .MAC PAGINATE END
10010 .    ie '\\$1'' \{ .nr #PAGINATE 1 \}
10011 .    el \{ .nr #PAGINATE 0 \}
10012 .END
10013 \#
10014 \#
10015 \# SUSPEND PAGINATION (before ENDNOTES)
10016 \# ------------------
10017 \# *Argument:
10018 \#   <none>
10019 \# *Function:
10020 \#   Creates register #SUSPEND_PAGINATION
10021 \# *Notes:
10022 \#   Useful only to suspend pagination before outputting endnotes.
10023 \#
10024 .MAC SUSPEND_PAGINATION END
10025 .    nr #SUSPEND_PAGINATION 1
10026 .END
10027 \#
10028 \# RESTORE PAGINATION (after ENDNOTES)
10029 \# ------------------
10030 \# *Argument:
10031 \#   <none>
10032 \# *Function:
10033 \#   Removes register #SUSPEND_PAGINATION.  Creates register
10034 \#   #DEFER_PAGINATION
10035 \# *Notes:
10036 \#   Useful only to restore pagination after outputting endnotes.
10037 \#
10038 .MAC RESTORE_PAGINATION END
10039 .    rr #SUSPEND_PAGINATION
10040 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .PAGINATE \}
10041 .    if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #DEFER_PAGINATION 1 \}
10042 .END
10043 \#
10044 \#
10045 \# PAGE NUMBER FORMAT
10046 \# ------------------
10047 \# *Arguments:
10048 \#   DIGIT | ROMAN | roman | ALPHA | alpha
10049 \# *Function:
10050 \#   Assigns user entered format to #PAGENUMBER.
10051 \#
10052 .MAC PAGENUM_STYLE END
10053 .    nr #PAGENUM_STYLE_SET 1
10054 .    if '\\$1'DIGIT'  \{\
10055 .       ds $PAGENUM_STYLE \\$1
10056 .       af #PAGENUMBER 1
10057 .    \}
10058 .    if '\\$1'ROMAN'  \{\
10059 .       ds $PAGENUM_STYLE \\$1
10060 .       af #PAGENUMBER I
10061 .    \}
10062 .    if '\\$1'roman'  \{\
10063 .       ds $PAGENUM_STYLE \\$1
10064 .       af #PAGENUMBER i
10065 .    \}
10066 .    if '\\$1'ALPHA'  \{\
10067 .       ds $PAGENUM_STYLE \\$1
10068 .       af #PAGENUMBER A
10069 .    \}
10070 .    if '\\$1'alpha'  \{\
10071 .       ds $PAGENUM_STYLE \\$1
10072 .       af #PAGENUMBER a
10073 .    \}
10074 .END
10075 \#
10076 \#
10077 \# HYPHENS AROUND PAGE NUMBERS
10078 \# ---------------------------
10079 \# *Arguments:
10080 \#   <none> | <anything>
10081 \# *Function:
10082 \#   Creates or modifies register #PAGE_NUM_HYPHENS.
10083 \#   Used to dis/enable hyphens on either side of page numbers.
10084 \# *Notes:
10085 \#   Default is on.
10086 \#
10087 .MAC PAGENUM_HYPHENS END
10088 .    nr #PAGE_NUM_HYPHENS_SET 1
10089 .    ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
10090 .    el \{ .rr #PAGE_NUM_HYPHENS   \}
10091 .END
10092 \#
10093 \#
10094 \# PAGENUMBER POSITION
10095 \# -------------------
10096 \# *Arguments:
10097 \#   TOP | BOTTOM  LEFT | CENTER | RIGHT
10098 \# *Function:
10099 \#   Creates or modifies various PAGE_NUM_H | V_POS registers.
10100 \#   Used to position page numbers.
10101 \# *Notes:
10102 \#   Default is center/bottom.
10103 \#
10104 .MAC PAGENUM_POS END
10105 .    nr #PAGE_NUM_POS_SET 1
10106 .    if '\\$1'TOP'    \{ .nr #PAGE_NUM_V_POS 1 \}
10107 .    if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
10108 .    if '\\$2'LEFT'   \{ .nr #PAGE_NUM_H_POS 1 \}
10109 .    if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
10110 .    if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
10111 .    if '\\$2'RIGHT'  \{ .nr #PAGE_NUM_H_POS 3 \}
10112 .END
10113 \#
10114 \#
10115 .MAC PN_WITH_HYPHENS END
10116 .    nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
10117 .    ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
10118 .    PRINT \m[\\*[$PAGENUM_COLOR]]\\*[$HYPHEN]\|\\n[#PAGENUMBER]\|\\*[$HYPHEN]
10119 .br
10120 .END
10121 \#
10122 \#
10123 \# PRINT PAGE NUMBER
10124 \# -----------------
10125 \# *Arguments:
10126 \#   <none>
10127 \# *Function:
10128 \#   Prints page number if PAGINATE=1.
10129 \#
10130 .MAC PRINT_PAGE_NUMBER END
10131 .    ev PAGENUMBER
10132 .    nf
10133 .    na
10134 .    po \\n[#DOC_L_MARGIN]u
10135 .    ll \\n[#DOC_L_LENGTH]u
10136 .    ta \\n(.lu
10137 .    FAMILY  \\*[$PAGE_NUM_FAM]
10138 .    FT      \\*[$PAGE_NUM_FT]
10139 .    PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
10140 .    if \\n[#PRINT_STYLE]=1 \{\
10141 .       TYPEWRITER
10142 .    \}
10143 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
10144 .    if o \{\
10145 .       ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT  \}
10146 .       el                        \{ .RIGHT \}
10147 .    \}
10148 .    if e \{\
10149 .       ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT  \}
10150 .       el                        \{ .LEFT   \}
10151 .    \}
10152 .    if \\n[#PAGE_NUM_H_POS]=2    \{ .CENTER \}
10153 .    if \\n[#RECTO_VERSO]=0 \{\
10154 .       if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT   \}
10155 .       if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
10156 .       if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT  \}
10157 .    \}
10158 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
10159 .    if \\n[#EN_FIRST_PAGE] \{\
10160 .       if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
10161 .       rr #EN_FIRST_PAGE
10162 .    \}
10163 .    if \\n[#BIB_FIRST_PAGE] \{\
10164 .       if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN] \}
10165 .       rr #BIB_FIRST_PAGE
10166 .    \}
10167 .    if \\n[#TOC_FIRST_PAGE] \{\
10168 .       PAGENUMBER 1
10169 .       rr #TOC_FIRST_PAGE
10170 .    \}
10171 .    ie \\n[#DRAFT_WITH_PAGENUM] \{\
10172 .       ie '\\*[$REVISION]'' \{\
10173 .          PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT] / \\n[#PAGENUMBER]"
10174 .       \}
10175 .       el \{\
10176 .          ie '\\*[$DRAFT]'' \{\
10177 .             PRINT "\\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
10178 .          \}
10179 .          el \{\
10180 .             PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT], \\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
10181 .          \}
10182 .       \}
10183 .    \}
10184 .    el \{\
10185 .       ie \\n[#PAGE_NUM_HYPHENS] \{\
10186 .          if '\\*[$PAGENUM_STYLE]'DIGIT' \{\
10187 .             di NULL
10188 1\\R'#CAP_HEIGHT \\n[.cht]'
10189 .             di
10190 .             PN_WITH_HYPHENS
10191 .          \}
10192 .          if '\\*[$PAGENUM_STYLE]'ROMAN' \{\
10193 .             di NULL
10194 I\\R'#CAP_HEIGHT \\n[.cht]'
10195 .             di
10196 .             PN_WITH_HYPHENS
10197 .          \}
10198 .          if '\\*[$PAGENUM_STYLE]'ALPHA' \{\
10199 .             di NULL
10200 E\\R'#CAP_HEIGHT \\n[.cht]'
10201 .             di
10202 .             PN_WITH_HYPHENS
10203 .          \}
10204 .          if '\\*[$PAGENUM_STYLE]'roman' \{\
10205 .             PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
10206 .          \}
10207 .          if '\\*[$PAGENUM_STYLE]'alpha' \{\
10208 .             PRINT "\m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-"
10209 .          \}
10210 .       \}
10211 .       el \{ .PRINT "\m[\\*[$PAGENUM_COLOR]]\\n[#PAGENUMBER]" \}
10212 .    \}
10213 .    ev
10214 .END
10215 \#
10216 \# ====================================================================
10217 \#
10218 \# +++FOOTNOTES+++
10219 \#
10220 .ig
10221 Mom's footnote handling is baroque, to say the least.  There are
10222 redundancies in a number of the macros involved, as well as some
10223 registers that probably don't get used anymore.  The baggage is left
10224 in in case some new footnote oddity/challenge gets thrown my way.
10225
10226 The macros are heavily commented.
10227 ..
10228 \#
10229 \# FOOTNOTE AUTOLEAD
10230 \# -----------------
10231 \# *Arguments:
10232 \#   <autolead value for footnotes>
10233 \# *Function:
10234 \#   Creates or modifies register #FN_AUTOLEAD.
10235 \# *Notes:
10236 \#   Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
10237 \#
10238 .MAC FOOTNOTE_AUTOLEAD END
10239 .    nr #FN_AUTOLEAD \\$1
10240 .END
10241 \#
10242 \#
10243 \# FOOTNOTE MARKERS
10244 \# ----------------
10245 \# *Arguments:
10246 \#   <none> | <anything>
10247 \# *Function:
10248 \#   Turns generation of footnote markers on or off.
10249 \# *Notes:
10250 \#   Default is on.
10251 \#
10252 .MAC FOOTNOTE_MARKERS END
10253 .    ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
10254 .    el \{ .nr #FN_MARKERS 0 \}
10255 .END
10256 \#
10257 \#
10258 \# FOOTNOTE MARKER STYLE
10259 \# ---------------------
10260 \# *Arguments:
10261 \#   STAR | NUMBER | LINE
10262 \# *Function:
10263 \#   Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
10264 \#   the style of footnote markers.
10265 \# *Notes:
10266 \#   1=STAR; 2=NUMBER; 3=LINE.  LINE means "use output line numbers".
10267 \#   Default is STAR.
10268 \#
10269 .MAC FOOTNOTE_MARKER_STYLE END
10270 .    if '\\$1'STAR' \{\
10271 .       if \\n[#FN_MARKER_STYLE]=3 \{\
10272 .          if !\\n[#NEWPAGE]=1 \{\
10273 .             tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is LINE.  
10274 .             tm1 "       You cannot change footnote marker style without
10275 .             tm1 "       first breaking to a new page with NEWPAGE.
10276 .             tm1 "       Ignoring request FOOTNOTE_MARKER_STYLE STAR at line \\n(.c.
10277 .             return
10278 .          \}
10279 .       \}
10280 .       if \\n[#RUN_ON]=1 \{\
10281 .          tm1 "[mom]: FOOTNOTE_MARKER_STYLE STAR at line \\n(.c is incompatible
10282 .          tm1 "       with RUN_ON footnotes.  Ignoring request.
10283 .          return
10284 .       \}
10285 .       nr #FN_MARKER_STYLE 1
10286 .       if \\n[#NEWPAGE]=1 \{ .rr #NEWPAGE \}
10287 .       FOOTNOTE_MARKERS
10288 .    \}
10289 .    if '\\$1'NUMBER' \{\
10290 .       if \\n[#FN_MARKER_STYLE]=3 \{\
10291 .          if !\\n[#NEWPAGE]=1 \{\
10292 .             tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is NUMBER.  
10293 .             tm1 "       You cannot change footnote marker style without
10294 .             tm1 "       first breaking to a new page with NEWPAGE.
10295 .             tm1 "       Ignoring request FOOTNOTE_MARKER_STYLE NUMBER at line \\n(.c.
10296 .             return
10297 .          \}
10298 .       \}
10299 .       if \\n[#RUN_ON]=1 \{\
10300 .          tm1 "[mom]: FOOTNOTE_MARKER_STYLE NUMBER at line \\n(.c is incompatible
10301 .          tm1 "       with RUN_ON footnotes.  Ignoring request.
10302 .          return
10303 .       \}
10304 .       nr #FN_MARKER_STYLE 2
10305 .       if \\n[#NEWPAGE]=1 \{ .rr #NEWPAGE \}
10306 .       FOOTNOTE_MARKERS
10307 .    \}
10308 .    if '\\$1'LINE' \{\
10309 .       nr #FN_MARKER_STYLE 3
10310 .       FOOTNOTE_MARKERS OFF
10311 .       if !\\n[#FN_LN_SEP] \{\
10312 .          if !\\n[#FN_LN_BRACKETS] \{ .FOOTNOTE_LINENUMBER_BRACKETS SQUARE \}
10313 .       \}
10314 .    \}
10315 .END
10316 \#
10317 \#
10318 \# FOOTNOTE LINENUMBER MARK
10319 \# ------------------------
10320 \# *Function:
10321 \#   This string, when called inline, stores the current output line
10322 \#   number in register #FN_MARK for use with FOOTNOTE.
10323 \#
10324 .ds FN-MARK \R'#FN_MARK \En(ln'
10325 \#
10326 \#
10327 \# FOOTNOTE LINENUMBER SEPARATOR
10328 \# -----------------------------
10329 \# *Argument:
10330 \#   <user-defined separator>
10331 \# *Function:
10332 \#   Stores user-defined separator (for use then
10333 \#   FOOTNOTE_MARKER_STYLE is LINE) in string $FN_LN_SEP.  The
10334 \#   separator is intended to be used when the user wishes a
10335 \#   separator, rather than the choice of brackets offered by
10336 \#   FOOTNOTE_LINENUMBER_BRACKETS.
10337 \#
10338 .MAC FOOTNOTE_LINENUMBER_SEPARATOR END
10339 .    rr #FN_LN_BRACKETS
10340 .    nr #FN_LN_SEP 1
10341 .    ds $FN_LN_SEP "\\$1
10342 .END
10343 \#
10344 \#
10345 \# FOOTNOTE LINENUMBER BRACKETS
10346 \# ----------------------------
10347 \# *Argument:
10348 \#   PARENS | SQUARE | BRACES or ( | [ | {
10349 \# *Function:
10350 \#   Sets register #FN_LN_BRACKETS to 1, and creates strings
10351 \#   $FN_OPEN_BRACKET and $FN_CLOSE_BRACKET according to the given
10352 \#   argument.
10353 \#
10354 .MAC FOOTNOTE_LINENUMBER_BRACKETS END
10355 .    rr #FN_LN_SEP
10356 .    nr #FN_LN_BRACKETS 1
10357 .    if '\\$1'PARENS' \{\
10358 .       ds $FN_OPEN_BRACKET (
10359 .       ds $FN_CLOSE_BRACKET )
10360 .    \}
10361 .    if '\\$1'(' \{\
10362 .       ds $FN_OPEN_BRACKET (
10363 .       ds $FN_CLOSE_BRACKET )
10364 .    \}
10365 .    if '\\$1'SQUARE' \{\
10366 .       ds $FN_OPEN_BRACKET [
10367 .       ds $FN_CLOSE_BRACKET ]
10368 .    \}
10369 .    if '\\$1'[' \{\
10370 .       ds $FN_OPEN_BRACKET [
10371 .       ds $FN_CLOSE_BRACKET ]
10372 .    \}
10373 .    if '\\$1'BRACES' \{\
10374 .       ds $FN_OPEN_BRACKET {
10375 .       ds $FN_CLOSE_BRACKET }
10376 .    \}
10377 .    if '\\$1'{' \{\
10378 .       ds $FN_OPEN_BRACKET {
10379 .       ds $FN_CLOSE_BRACKET }
10380 .    \}
10381 .END
10382 \#
10383 \#   
10384 \# RESET FOOTNOTE NUMBER
10385 \# ---------------------
10386 \# *Arguments:
10387 \#   <none> | PAGE
10388 \# *Function:
10389 \#   Resets register #FN_NUMBER to 1.  If argument is PAGE, creates
10390 \#   toggle #RESET_FN_NUMBER which is checked in HEADER.  If 1,
10391 \#   numbered footnotes on every page start at 1.
10392 \#
10393 .MAC RESET_FOOTNOTE_NUMBER END
10394 .    ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
10395 .    el \{ .nr #RESET_FN_NUMBER 1 \}
10396 .END
10397 \#
10398 \#
10399 \# FOOTNOTE RULE LENGTH
10400 \# --------------------
10401 \# *Arguments:
10402 \#   <length of rule used to separate footnotes from running text>
10403 \# *Function:
10404 \#   Creates or modifies registers #FN_RULE_LENGTH.
10405 \# *Notes:
10406 \#   Requires unit of measure (iPpcm).
10407 \#   Default is 4P for both PRINTSTYLEs.
10408 \#
10409 .MAC FOOTNOTE_RULE_LENGTH END
10410 .    nr #FN_RULE_LENGTH (\\$1)
10411 .END
10412 \#
10413 \#
10414 \# FOOTNOTE_RULE_ADJ
10415 \# -----------------
10416 \# *Arguments:
10417 \#   <number of points to raise footnote rule from it's baseline position>
10418 \# *Function:
10419 \#   Creates or modifies register #FN_RULE_ADJ.
10420 \# *Notes:
10421 \#   Default is 3p for both TYPESTYLES.
10422 \#
10423 \#   Requires unit of measure.
10424 \#
10425 .MAC FOOTNOTE_RULE_ADJ END
10426 .    nr #FN_RULE_ADJ (\\$1)
10427 .END
10428 \#
10429 \#
10430 \# FOOTNOTE RULE
10431 \# -------------
10432 \# *Arguments:
10433 \#   <none> | <anything>
10434 \# *Function:
10435 \#   Turns printing of footnote separator rule on or off.  If invoked as
10436 \#   PRINT_FOOTNOTE_RULE, prints footnote separator rule.
10437 \# *Notes:
10438 \#   Default is on.
10439 \#
10440 \#   Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
10441 \#   if the footnote number (#FN_COUNT) is 1.
10442 \#
10443 .MAC FOOTNOTE_RULE END
10444 .    ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
10445 .       if \\n[#FN_RULE]=0 \{ .RLD 1v \}
10446 \!.     PT_SIZE 12
10447 .       RLD 1v
10448 .       LEFT
10449 .       PRINT \v'-\\n[#FN_RULE_ADJ]u'\l'\\n[#FN_RULE_LENGTH]u'\v'+\\n[#FN_RULE_ADJ]u'
10450 \!.     PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
10451 .       QUAD \\*[$FN_QUAD]
10452 .    \}
10453 .    el \{\
10454 .       ie '\\$1'' \{ .nr #FN_RULE 1 \}
10455 .       el \{ .nr #FN_RULE 0 \}
10456 .    \}
10457 .END
10458 \#
10459 \#
10460 \# FOOTNOTE SPACING
10461 \# ----------------
10462 \# *Arguments:
10463 \#   <per item post footnote spacing> | <anything>
10464 \# *Function:
10465 \#   Enables printing of post footnote spacing.
10466 \# *Notes:
10467 \#   Default is no space.
10468 \#
10469 .MAC FOOTNOTE_SPACING END
10470 .    ie \B'\\$1' \{ .nr #FN_SPACE (\\$1) \}
10471 .    el \{ .nr #FN_SPACE 0 \}
10472 .END
10473 \#
10474 \#
10475 \# RUN ON FOOTNOTES
10476 \# ----------------
10477 \# *Arguments:
10478 \#   <none> | <anything>
10479 \# *Function:
10480 \#   Toggles run-on footnotes on or off.
10481 \#
10482 .MAC FOOTNOTES_RUN_ON END
10483 .    ie '\\$1'' \{\
10484 .       if \\n[#FN_COUNT]>0 \{\
10485 .          tm1 "[mom]: Switching to run-on footnotes at line \\n(.c will cause
10486 .          tm1 "       you to loose footnotes already formatted for this page.
10487 .          tm1 "       Ignoring request FOOTNOTES_RUN_ON.
10488 .          rr #RUN_ON
10489 .          return
10490 .       \}
10491 .       nr #RUN_ON 1
10492 .       if \\n[#FN_MARKER_STYLE]=1 \{ .RUNON_WARNING \}
10493 .       if \\n[#FN_MARKER_STYLE]=2 \{ .RUNON_WARNING \}
10494 .    \}
10495 .    el \{\
10496 .       if \\n[#FN_COUNT]>0 \{\
10497 .          if \\n[#RUN_ON]=1 \{\
10498 .             tm1 "[mom]: Switching off run-on footnotes at line \\n(.c will cause
10499 .             tm1 "       you to loose footnotes already formatted for this page.
10500 .             tm1 "       Ignoring request FOOTNOTES_RUN_ON \\$1.
10501 .             return
10502 .          \}
10503 .       \}
10504 .       rr #RUN_ON
10505 .    \}
10506 .END
10507 \#
10508 \#
10509 .MAC RUNON_WARNING END
10510 .    if \\n[#FN_MARKER_STYLE]=1 \{\
10511 .       tm1 "[mom]: The footnote marker style active at line \\n(.c is STAR,
10512 .       tm1 "       which is incompatible with run-on footnotes.  Please change
10513 .       tm1 "       the footnote marker style to LINE.  Continuing to process,
10514 .       tm1 "       but ignoring request FOOTNOTES_RUN_ON.
10515 .       rr #RUN_ON
10516 .    \}
10517 .    if \\n[#FN_MARKER_STYLE]=2 \{\
10518 .       tm1 "[mom]: The footnote marker style active at line \\n(.c is NUMBER,
10519 .       tm1 "       which is incompatible with run-on footnotes.  Please change
10520 .       tm1 "       the footnote marker style to LINE.  Continuing to process,
10521 .       tm1 "       but ignoring request FOOTNOTES_RUN_ON.
10522 .       rr #RUN_ON
10523 .    \}
10524 .END
10525 \#
10526 \# FOOTNOTE
10527 \# --------
10528 \# *Arguments:
10529 \#   <none> | INDENT  L|LEFT|R|RIGHT|B|BOTH  <indent value> | <anything>
10530 \# *Function:
10531 \#   Begins collecting and diverting footnote text if no argument
10532 \#   given.  Otherwise, ends diversion FOOTNOTES, measures footnote
10533 \#   depth, and sets footnote trap.
10534 \# *Notes:
10535 \#   The input line preceding a footnote call MUST terminate with \c
10536 \#   or the footnote marker will be spaced away from the word it
10537 \#   should be joined to.
10538 \#
10539 \#   If FOOTNOTE is invoked with INDENT, the footnote will
10540 \#   be indented.  An indent style and an indent value must be given.
10541 \#   Subsequent footnotes will NOT be indented; INDENT must be given
10542 \#   for each footnote the user wants indented.
10543 \#
10544 .MAC FOOTNOTE END
10545 .    if !\\n(.u \{ .nr #ADD_BREAK 1 \}
10546 .    ie '\\$1'' \{\
10547 .       if \\n[#FN_MARKER_STYLE]=3 \{\
10548 .          if !\\n[#LINENUMBERS] \{\
10549 .             tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
10550 .             tm1 "       FOOTNOTE_MARKER_STYLE is LINE.
10551 .             ab Aborting on FOOTNOTE at line \\n(.c.
10552 .          \}
10553 .          if \\n[#FN_MARK]=0 \{ .nr #FN_MARK \\n(ln \}
10554 .          nr #FN_MARK_2 \\n(ln
10555 .          if '\\n(.z'P_QUOTE' \{\
10556 .             nr #FN_MARK -1
10557 .             nr #FN_MARK_2 -1
10558 .          \}
10559 .          if \\n[#IN_DIVER]=1 \{\
10560 .             if '\\n(.z'P_QUOTE' \{\
10561 .                if !\\n[#QUOTE_LN]=1 \{\
10562 .                   if !\\n[#SILENT_QUOTE_LN]=1 \{\
10563 .                      tm1 "[mom]: You have requested a line-numbered footnote inside a
10564 .                      tm1 "       QUOTE at line \\n(.c, but line-numbering has not been enabled
10565 .                      tm1 "       for QUOTES.  Printing footnote with label "0".
10566 .                      rr #FN_MARK
10567 .                      rr #FN_MARK_2
10568 .                   \}
10569 .                \}
10570 .             \}
10571 .             if '\\n(.z'B_QUOTE' \{\
10572 .                if !\\n[#BQUOTE_LN]=1 \{\
10573 .                   if !\\n[#SILENT_BQUOTE_LN]=1 \{\
10574 .                      tm1 "[mom]: You have requested a line-numbered footnote inside a
10575 .                      tm1 "       BLOCKQUOTE at line \\n(.c, but line-numbering has not been enabled
10576 .                      tm1 "       for BLOCKQUOTES.  Printing footnote with label "0".
10577 .                      rr #FN_MARK
10578 .                      rr #FN_MARK_2
10579 .                   \}
10580 .                \}
10581 .             \}
10582 .          \}
10583 .       \}
10584 .\" Begin processing footnotes that occur inside QUOTE, BLOCKQUOTE
10585 .\" or EPIGRAPH.
10586 .       if \\n[#IN_DIVER]=1 \{\
10587 .          nr #PAGE_POS \\n(nl+\\n(.d+\\n[#DOC_LEAD]
10588 .          nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS]-1)
10589 .          nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
10590 .\" Are we on a "defer" line?  If so, defer the text of the footnote.
10591 .          ie \\n[#SPACE_TO_FOOTER]=\\n[#DOC_LEAD]:\\n[#SPACE_TO_FOOTER]=0 \{\
10592 .             nr #DIVER_FN 2 \" treat like a normal deferred footnote
10593 .          \}
10594 .          el \{\
10595 .             nr #DIVER_FN 2 \" treat like a normal footnote
10596 .          \}
10597 .          if \\n[#PAGE_POS]>\\n[#FOOTER_POS] \{\
10598 .             nr #DIVER_FN 1 \" move this footnote
10599 .          \}
10600 .\" Test for situation where, because a final line of QUOTE, BLOCKQUOTE
10601 .\" or EPIGRAPH isn't yet adjusted at this point, the last word on the
10602 .\" line may *seem* to belong to the final line of the page, but will,
10603 .\" in fact, become the first word of the subsequent page.  In such
10604 .\" circumstances, we want the the footnote to be treated as a "moved"
10605 .\" diversion footnote.
10606 .          if \\n(.k>\\n(.l \{ .nr #DIVER_FN 1 \}
10607 .          if r#DIVER_FN \{\
10608 .             if !\\n[#DIVER_FN]=2 \{ .\\n+[#DONE_ONCE] \}
10609 .\" A footnote inside a diversion will become the 1st footnote on the
10610 .\" following page/column.
10611 .             if \\n[#DIVER_FN]=1 \{ .DIVER_FN_1_PRE \}
10612 .\" A footnote inside a diversion that should be treated like a
10613 .\" normal footnote (including defers.)
10614 .             if \\n[#DIVER_FN]=2 \{ .DIVER_FN_2_PRE \}
10615 .          \}
10616 .          nr #SAVED_FN_COUNT \\n[#FN_COUNT]+1
10617 .          nr #SAVED_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]+1
10618 .       \}
10619 .\" End processing footnotes that occur inside QUOTE, BLOCKQUOTE or
10620 .\" EPIGRAPH.
10621 .\"
10622 .\" Test for situation where, because a final line of running text
10623 .\" isn't yet adjusted at this point, the last word on the line may
10624 .\" *seem* to belong to the final line of the page, but will, in
10625 .\" fact, become the first word of the subsequent page.  In such
10626 .\" circumstances, we want the the footnote marker in running text to
10627 .\" be the correct one for the 1st footnote on the page.
10628 .       if \\n(.k>\\n(.l \{\
10629 .          if (\\n(nl+\\n[#DOC_LEAD])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
10630 .             ie \\n[#COLUMNS]=1 \{\
10631 .                if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
10632 .                   if \\n[#FN_MARKER_STYLE]=1 \{\
10633 .                      nr #FN_COUNT_FOR_COLS 0 1
10634 .                   \}
10635 .                   if \\n[#FN_MARKER_STYLE]=2 \{\
10636 .                      if \\n[#RESET_FN_NUMBER] \{\
10637 .                         nr #FN_NUMBER 0 1
10638 .                         nr #NOT_YET_ADJUSTED 1
10639 .                      \}
10640 .                   \}
10641 .                \}
10642 .             \}
10643 .             el \{\
10644 .                if \\n[#FN_MARKER_STYLE]=1 \{\
10645 .                   nr #FN_COUNT 0 1
10646 .                \}
10647 .                if \\n[#FN_MARKER_STYLE]=2 \{\
10648 .                   if \\n[#RESET_FN_NUMBER] \{\
10649 .                      nr #FN_NUMBER 0 1
10650 .                      nr #NOT_YET_ADJUSTED 1
10651 .                   \}
10652 .                \}
10653 .             \}
10654 .          \}
10655 .       \}
10656 .       if \\n[#FN_MARKERS] \{\
10657 .\" Housekeeping
10658 .          if \\n[#CONDENSE] \{ \*[CONDX]\c \}
10659 .          if \\n[#EXTEND]   \{ \*[EXTX]\c  \}
10660 .          if \\n[#PRINT_STYLE]=1 \{\
10661 .             if \\n[#UNDERLINE_ON] \{\
10662 .                nr #UNDERLINE_WAS_ON 1
10663 .                UNDERLINE OFF
10664 .             \}
10665 .          \}
10666 .\" Add footnote markers to running text...
10667 .          if !\\n[#NO_FN_MARKER] \{\
10668 .\" ...but not if TERMINATE has not been called
10669 .             if !r#TERMINATE \{\
10670 .\" Marker style star/dagger/double-dagger
10671 .                if \\n[#FN_MARKER_STYLE]=1 \{\
10672 .\" Columnar docs either move col to col, or last col to next page.
10673 .\" They require their own special FN_COUNT because regular FN_COUNT
10674 .\" is used to figure out things like whether or not to put a rule
10675 .\" above footnotes (in addition to keeping track of the footnote
10676 .\" count in non-columnar docs).
10677 .                   ie \\n[#COLUMNS]=1 \{\
10678 .                      if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU2]*\c            \}
10679 .                      if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU1]\(dg\c         \}
10680 .                      if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dd\c                \}
10681 .                      if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU2]**\c           \}
10682 .                      if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU1]\(dg\(dg\c     \}
10683 .                      if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dd\(dd\c            \}
10684 .                      if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU2]***\c          \}
10685 .                      if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg\c \}
10686 .                      if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dd\(dd\(dd\c        \}
10687 .                      if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU2]****\c         \}
10688 .                   \}
10689 .                   el \{\
10690 .                      if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU2]*\c            \}
10691 .                      if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU1]\(dg\c         \}
10692 .                      if \\n[#FN_COUNT]=2 \{ .PRINT \(dd\c                \}
10693 .                      if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU2]**\c           \}
10694 .                      if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU1]\(dg\(dg\c     \}
10695 .                      if \\n[#FN_COUNT]=5 \{ .PRINT \(dd\(dd\c            \}
10696 .                      if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU2]***\c          \}
10697 .                      if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg\c \}
10698 .                      if \\n[#FN_COUNT]=8 \{ .PRINT \(dd\(dd\(dd\c        \}
10699 .                      if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU2]****\c         \}
10700 .                   \}
10701 .                \}
10702 .\" Marker style superscript numbers
10703 .                if \\n[#FN_MARKER_STYLE]=2 \{\
10704 .                   if \\n[#PRINT_STYLE]=1 \{ .PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#FN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c" \}
10705 .                   if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]\c" \}
10706 .                \}
10707 .             \}
10708 .          \}
10709 .       \}
10710 .\" More housekeeping
10711 .\"
10712 .\" #SPACE_REMAINING is the space left between where we are
10713 .\" on the page and the bottom margin.  It's used to determine whether
10714 .\" or not the footnote will overflow, and how many lines of
10715 .\" footnotes will fit on the page if some have to overflow.
10716 .       ie \\n[#DIVER_FN]=2 \{\
10717 .          nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-(\\n[#PAGE_POS])
10718 .       \}
10719 .       el \{\
10720 .          nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n(nl
10721 .       \}
10722 .       if \\n[#FROM_DIVERT_FN]=1 \{\
10723 .          nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]
10724 .          rr #FROM_DIVERT_FN
10725 .       \}
10726 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
10727 .       nr #PP_STYLE 2
10728 .       if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
10729 .       INDENT_FIRST_PARAS
10730 .\" Prepare FOOTNOTE to receive footnote text.
10731 .       ev FOOTNOTES
10732 .       ll \\n[#DOC_L_LENGTH]u
10733 .       ta \\n(.lu
10734 .       if \\n[#COLUMNS]=1 \{\
10735 .          ll \\n[#COL_L_LENGTH]u
10736 .          ta \\n(.lu
10737 .       \}
10738 .       if \\n[#FN_R_INDENT]  \{\
10739 .          ll -\\n[#FN_R_INDENT]u
10740 .          ta \\n(.lu
10741 .       \}
10742 .       if \\n[#FN_BR_INDENT] \{\
10743 .          ll -\\n[#FN_BR_INDENT]u
10744 .          ta \\n(.lu
10745 .       \}
10746 .       FAMILY   \\*[$FN_FAM]
10747 .       FT       \\*[$FN_FT]
10748 .       PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
10749 .       AUTOLEAD \\n[#FN_AUTOLEAD]
10750 .       QUAD     \\*[$FN_QUAD]
10751 .       if \\n[#PRINT_STYLE]=1 \{\
10752 .          TYPEWRITER
10753 .          ie \\n[#SINGLE_SPACE] \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
10754 .          el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
10755 .          QUAD LEFT
10756 .          HY OFF
10757 .       \}
10758 .       nr #FN_LEAD \\n[#LEAD]
10759 .\" Begin diversion FOOTNOTES or FN_IN_DIVER
10760 .       ie r#COUNTERS_RESET \{\
10761 .          ie \\n[#DONE_ONCE]=1 \{\
10762 .             ie \\n[#RUN_ON] \{\
10763 .                di RUNON_FN_IN_DIVER
10764 .                nr #RUNON_FN_IN_DIVER 1
10765 .             \}
10766 .             el \{ .di FN_IN_DIVER \}
10767 .          \}
10768 .          el \{\
10769 .             ie \\n[#RUN_ON] \{\
10770 .                da RUNON_FN_IN_DIVER
10771 .                nr #RUNON_FN_IN_DIVER 1
10772 .             \}
10773 .             el \{ .da FN_IN_DIVER \}
10774 .          \}
10775 .       \\n+[#DONE_ONCE]
10776 .       \}
10777 .       el \{\
10778 .          ie \\n[#RUN_ON] \{\
10779 .             da RUNON_FOOTNOTES
10780 .             nr #RUNON_FOOTNOTES 1
10781 .          \}
10782 .          el \{ .da FOOTNOTES \}
10783 .       \}
10784 .       if \\n[#FOOTNOTE_COLOR]=1 \{\
10785 .          TRAP OFF
10786 .          nf
10787 \m[\\*[$FOOTNOTE_COLOR]]
10788 .          EOL
10789 .          fi
10790 .          TRAP
10791 .       \}
10792 .       if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
10793 .\" When a deferred footnote is also the 1st footnote on the page,
10794 .\" and when the page it's output on also has footnotes, some
10795 .\" whitespace is needed between the deferred footnote and the
10796 .\" first footnote belonging to the output page so that there's
10797 .\" no confusion when two stars (or two number 1s) appear in
10798 .\" footnotes...
10799 .       if \\n[#FN_DEFER_SPACE] \{\
10800 .\" ...but only add the extra space if TERMINATE has not been called
10801 .          if !r#TERMINATE \{\
10802 .\" ...and not if defer space has already been added
10803 .             if !\\n[#DEFER_SPACE_ADDED] \{\
10804 .\" ...and not if the footnote count the last time we checked for
10805 .\" a defer situation inside a diversion is greater than 1.
10806 .                if !\\n[#SAVED_DIVER_FN_COUNT]>1 \{\
10807 .                   if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
10808 .                   if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
10809 .                   nr #DEFER_SPACE_ADDED 1
10810 .                \}
10811 .             \}
10812 .          \}
10813 .          rr #FN_DEFER_SPACE
10814 .          rr #SAVED_DIVER_FN_COUNT
10815 .       \}
10816 .       if \\n[#DIVERTED]=3 \{\
10817 .          if \\n[#FN_COUNT]>0 \{\
10818 \!.           RLD 1v
10819 .          \}
10820 .       \}
10821 .\" Add footnote rule (or, if no rule, some whitespace).
10822 .\" N.B.- this line increments #FN_COUNT each and every time FOOTNOTE
10823 .\" is run.
10824 .       if \\n+[#FN_COUNT]=1 \{\
10825 .\" If a footnote is called in a diversion, and the footnote has to
10826 .\" be moved, don't put in the rule now (it's taken care of when
10827 .\" FN_IN_DIVER is output into FOOTNOTE in PROCESS_FN_IN_DIVER).
10828 .          if !\\n[#DONT_RULE_ME]=1 \{\
10829 .             if !\\n[#FN_DEPTH] \{\
10830 .                if \\n[#PRINT_STYLE]=1 \{\
10831 .                   if !\\n[#RUN_ON] \{ .ALD \\n[#DOC_LEAD]u \}
10832 .                \}
10833 .                ie \\n[#FN_RULE]=1 \{\
10834 .                   if !\\n[#RUN_ON] \{ .PRINT_FOOTNOTE_RULE \}
10835 .                \}
10836 .                el \{ .ALD 1v \}
10837 .                nr #RULED 1
10838 .             \}
10839 .          \}
10840 .       \}
10841 .       rr #DONT_RULE_ME
10842 .\" Add footnote markers to footnote text...
10843 .       ie \\n[#FN_MARKERS] \{\
10844 .          if \\n[#FN_SPACE]>0 \{\
10845 .             if \\n[#FN_COUNT]>0 \{\
10846 .                ALD \\n[#FN_SPACE]u
10847 .             \}
10848 .          \}
10849 .          if !\\n[#NO_FN_MARKER] \{\
10850 .\" ...but not if TERMINATE has been called.
10851 .             if !r#TERMINATE \{\
10852 .                if \\n[#REF]=1 \{\
10853 \!.                 in +\\*[$REF_FN_INDENT]
10854 \!.                 ti -\\*[$REF_FN_INDENT]
10855 .                \}
10856 .                if \\n[#FN_MARKER_STYLE]=1 \{\
10857 .                   ie \\n[#COLUMNS]=1 \{\
10858 .                      \\n+[#FN_COUNT_FOR_COLS]
10859 .                      if \\n[#FN_COUNT_FOR_COLS]=1  \{ .PRINT *\c            \}
10860 .                      if \\n[#FN_COUNT_FOR_COLS]=2  \{ .PRINT \(dg\c         \}
10861 .                      if \\n[#FN_COUNT_FOR_COLS]=3  \{ .PRINT \(dd\c         \}
10862 .                      if \\n[#FN_COUNT_FOR_COLS]=4  \{ .PRINT **\c           \}
10863 .                      if \\n[#FN_COUNT_FOR_COLS]=5  \{ .PRINT \(dg\(dg\c     \}
10864 .                      if \\n[#FN_COUNT_FOR_COLS]=6  \{ .PRINT \(dd\(dd\c     \}
10865 .                      if \\n[#FN_COUNT_FOR_COLS]=7  \{ .PRINT ***\c          \}
10866 .                      if \\n[#FN_COUNT_FOR_COLS]=8  \{ .PRINT \(dg\(dg\(dg\c \}
10867 .                      if \\n[#FN_COUNT_FOR_COLS]=9  \{ .PRINT \(dd\(dd\(dd\c \}
10868 .                      if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT ****\c         \}
10869 .                   \}
10870 .                   el \{\
10871 .                      if \\n[#FN_COUNT]=1  \{ .PRINT *\c            \}
10872 .                      if \\n[#FN_COUNT]=2  \{ .PRINT \(dg\c         \}
10873 .                      if \\n[#FN_COUNT]=3  \{ .PRINT \(dd\c         \}
10874 .                      if \\n[#FN_COUNT]=4  \{ .PRINT **\c           \}
10875 .                      if \\n[#FN_COUNT]=5  \{ .PRINT \(dg\(dg\c     \}
10876 .                      if \\n[#FN_COUNT]=6  \{ .PRINT \(dd\(dd\c     \}
10877 .                      if \\n[#FN_COUNT]=7  \{ .PRINT ***\c          \}
10878 .                      if \\n[#FN_COUNT]=8  \{ .PRINT \(dg\(dg\(dg\c \}
10879 .                      if \\n[#FN_COUNT]=9  \{ .PRINT \(dd\(dd\(dd\c \}
10880 .                      if \\n[#FN_COUNT]=10 \{ .PRINT ****\c         \}
10881 .                   \}
10882 .                \}
10883 .                if \\n[#FN_MARKER_STYLE]=2 \{\
10884 .                   if \\n[#COLUMNS]=1 \{\
10885 .                      \\n+[#FN_COUNT_FOR_COLS]
10886 .                   \}
10887 .                   if \\n[#NOT_YET_ADJUSTED]=1 \{\
10888 .                      nr #FN_NUMBER 1 1
10889 .                      rr #NOT_YET_ADJUSTED
10890 .                   \}
10891 .                   if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
10892 .                   if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\*[FU 2]\c" \}
10893 .                \}
10894 .             \}
10895 .          \}
10896 .       \}
10897 .       el \{\
10898 .\" Line-numbered footnotes handling
10899 .          if \\n[#FN_MARKER_STYLE]=3 \{\
10900 .             if \\n[#FN_SPACE]>0 \{\
10901 .                if !\\n[#RUN_ON]=1 \{\
10902 .                   if \\n[#FN_COUNT]>0 \{\
10903 .                      ALD \\n[#FN_SPACE]u
10904 .                   \}
10905 .                \}
10906 .             \}
10907 .             if \\n[#REF]=1 \{\
10908 .                if !\\n[#RUN_ON]=1 \{\
10909 \!.                 in +\\*[$REF_FN_INDENT]
10910 \!.                 ti -\\*[$REF_FN_INDENT]
10911 .                \}
10912 .             \}
10913 .             ie \\n[#FN_LN_BRACKETS]=1 \{\
10914 .                ds $FN_LINENUMBER \v'-.085m'\\*[$FN_OPEN_BRACKET]\v'.085m'
10915 .                ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \{\
10916 .                   as $FN_LINENUMBER \\n[#FN_MARK]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m' \"
10917 .                \}
10918 .                el \{\
10919 .                   as $FN_LINENUMBER \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m' \"
10920 .                \}
10921 .             \}
10922 .             el \{\
10923 .                ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \{\
10924 .                   ds $FN_LINENUMBER \\n[#FN_MARK]\\*[$FN_LN_SEP]
10925 .                \}
10926 .                el \{\
10927 .                   ds $FN_LINENUMBER \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\\*[$FN_LN_SEP]
10928 .                \}
10929 .             \}
10930 .             if !\\n[#NO_FN_MARKER] \{\
10931 .                PRINT \\*[$FN_LINENUMBER]\c
10932 .             \}
10933 .             rm $FN_LINENUMBER
10934 .             nr #FN_MARK 0
10935 .          \}
10936 .       \}
10937 .    \}
10938 .\" If INDENT arg is passed to FOOTNOTE, calculate the indent...
10939 .    el \{\
10940 .       ie '\\$1'INDENT' \{\
10941 .          ev FOOTNOTES
10942 .          if '\\$2'L'     \{ .in (\\$3)  \}
10943 .          if '\\$2'LEFT'  \{ .in (\\$3)  \}
10944 .          if '\\$2'R'     \{ .nr #FN_R_INDENT (\\$3) \}
10945 .          if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
10946 .          if '\\$2'B' \{\
10947 .             nr #FN_BL_INDENT (\\$3)
10948 .             ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
10949 .             el \{ .nr #FN_BR_INDENT (\\$4) \}
10950 .             in \\n[#FN_BL_INDENT]u
10951 .          \}
10952 .          if '\\$2'BOTH' \{\
10953 .             nr #FN_BL_INDENT (\\$3)
10954 .             ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
10955 .             el \{ .nr #FN_BR_INDENT (\\$4) \}
10956 .             in \\n[#FN_BL_INDENT]u
10957 .          \}
10958 .          ev
10959 .\" ...then re-run FOOTNOTE without an argument.
10960 .          FOOTNOTE
10961 .       \}
10962 .       el \{\
10963 .          br
10964 .\" Add "defer space" if the previously diverted footnote was the
10965 .\" 1st footnote proper to its page (i.e. it looks like a deferred
10966 .\" footnote but it's really an overflow).
10967 .          if \\n[#DIVERTED] \{\
10968 .             if \\n[#PREV_FN_DEFERRED]=1 \{\
10969 .                if \\n[#FN_MARKER_STYLE]=1 \{ .ALD \\n[#FN_LEAD]u \}
10970 .                if \\n[#RESET_FN_NUMBER] \{ .ALD \\n[#FN_LEAD]u \}
10971 .                nr #PREV_FN_DEFERRED 2
10972 .             \}
10973 .          \}
10974 .          if \\n[#REF]=1 \{\
10975 \!.           in 
10976 .          \}
10977 .\" Terminate FOOTNOTES or FN_IN_DIVER diversion
10978 .          di
10979 .          HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
10980 .          hy 14
10981 .\" More housekeeping
10982 .\" Turn off indent possibly set by FOOTNOTE INDENT
10983 .          in 0
10984 .\" Restore sentence spacing
10985 .       if \\n[#PRINT_STYLE]=2 \{\
10986 .          if d$RESTORE_SS_VAR \{ .SS \\*[$RESTORE_SS_VAR] \}
10987 .          rm $RESTORE_SS_VAR
10988 .       \}
10989 .          if \\n[#PRINT_STYLE]=1 \{\
10990 .             if \\n[#UNDERLINE_WAS_ON] \{\
10991 .                UNDERLINE
10992 .                rr #UNDERLINE_WAS_ON
10993 .             \}
10994 .          \}
10995 .          ev
10996 .          rr #FN_R_INDENT
10997 .          rr #FN_BR_INDENT
10998 .          nr #PP_STYLE \\n[#PP_STYLE_PREV]
10999 .          if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
11000 .          rr #INDENT_FIRSTS
11001 .\" Calculate footnote depth, but not if #COUNTERS_RESET (created in
11002 .\" DIVER_FN_1_PRE) to instruct FOOTNOTES to skip this step for now
11003 .\" (it's taken care of when FN_IN_DIVER is output into FOOTNOTES in
11004 .\" PROCESS_FN_IN_DIVER).
11005 .          ie r#COUNTERS_RESET \{\
11006 .             rr #COUNTERS_RESET
11007 .          \}
11008 .          el \{\
11009 .             nr #GET_DEPTH 1
11010 .\" If the footnote is the 1st on the page and it falls too close
11011 .\" to the bottom margin, defer the footnote text to the next page...
11012 .             if (\\n[#SPACE_REMAINING]-1)<=(\\n[#DOC_LEAD]) \{\
11013 .\" ...but not if PROCESS_FN_LEFTOVER has set #PREV_FN_DEFERRED to 1
11014 .                if !\\n[#PREV_FN_DEFERRED]=1 \{\
11015 .                   nr #FN_DEFER 1
11016 .                   nr #FN_DEPTH +\\n[#DIVER_DEPTH]
11017 .                   rr #GET_DEPTH
11018 .\" This is required so that the defer space clause can distinguish
11019 .\" a real #FN_COUNT=1 from one generated if FOOTNOTE is run inside
11020 .\" QUOTE, BLOCKQUOTE or EPIGRAPH
11021 .                   if \\n[#DIVER_FN]=2 \{\
11022 .                      nr #SAVED_DIVER_FN_COUNT \\n[#FN_COUNT]
11023 .                      rr #DIVER_FN
11024 .                   \}
11025 .                \}
11026 .             \}
11027 .\" Calculate the footnote depth.
11028 .             if \\n[#GET_DEPTH]=1 \{\
11029 .\" Save the previous footnote depth (for use when there will be
11030 .\" some overflowed footnote text).
11031 .                nr #SAVED_FN_DEPTH_1 \\n[#FN_DEPTH]
11032 .\" Add the depth of the current footnote to any already existent
11033 .\" footnotes.
11034 .                nr #FN_DEPTH +\\n[#DIVER_DEPTH]
11035 .\" Special handling for run-on footnotes
11036 .                if \\n[#RUN_ON]=1 \{\
11037 .                   if \\n[#RUNON_FOOTNOTES] \{\
11038 .                      unformat RUNON_FOOTNOTES
11039 .                   \}
11040 .                   if \\n[#RUNON_FN_IN_DIVER] \{\
11041 .                      unformat RUNON_FN_IN_DIVER
11042 .                   \}
11043 .                   ev FOOTNOTES
11044 .\" Recreate FOOTNOTES with rule followed by text of unformatted
11045 .\" run-on footnotes.
11046 .                   di FOOTNOTES
11047 .                   ie \\n[#FN_RULE]=0 \{ .RLD 1v \}
11048 .                   el \{\
11049 .                      PRINT \v'-\\n[#FN_RULE_ADJ]u'\l'\\n[#FN_RULE_LENGTH]u'\v'+\\n[#FN_RULE_ADJ]u'
11050 .                   \}
11051 .                   br
11052 .                   if \\n[#RUNON_FOOTNOTES] \{\
11053 .                      RUNON_FOOTNOTES
11054 .                      rr #RUNON_FOOTNOTES
11055 .                   \}
11056 .                   if \\n[#RUNON_FN_IN_DIVER] \{\
11057 .                      RUNON_FN_IN_DIVER
11058 .                      rr #RUNON_FN_IN_DIVER
11059 .                   \}
11060 .                   br
11061 .                   di
11062 .                   ev
11063 .                   nr #FN_DEPTH \\n[#DIVER_DEPTH]
11064 .                   nr #SAVED_VFP 0+\\n[#VARIABLE_FOOTER_POS]
11065 .                   nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
11066 .                \}
11067 .\" Save the new depth
11068 .                nr #SAVED_FN_DEPTH_2 \\n[#FN_DEPTH]
11069 .\" Signal that defer space should be added when PROCESS_FN_LEFTOVER
11070 .\" processes deferred footnotes.
11071 .                if \\n[#FN_DEFER] \{\
11072 .                   if \\n[#FN_COUNT]=2 \{\
11073 .                      ie \\n[#COLUMNS] \{\
11074 .                         if !\\n[#FROM_FOOTER] \{\
11075 .                            if \\n[#FN_DEFER]=1 \{ .nr #FN_DEFER_SPACE 1 \}
11076 .                            if \\n[#FN_COUNT_FOR_COLS]>=1 \{ .rr #FN_DEFER_SPACE \}
11077 .                            if \\n[#FROM_HEADER] \{ .nr #FN_DEFER_SPACE 1 \}
11078 .                         \}
11079 .                      \}
11080 .                      el \{\
11081 .                         nr #FN_DEFER_SPACE 1
11082 .                      \}
11083 .                   \}
11084 .                   rr #FN_DEFER
11085 .                \}
11086 .\" If the depth of the whole footnote won't fit in the space
11087 .\" between where we are on the page and the bottom margin, calculate
11088 .\" how much of it will fit.
11089 .                if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
11090 .                   nr #FN_LINES 0 1
11091 .                   while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
11092 .                      nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
11093 .\}
11094 .                   nr #VFP_DIFF \\n[#FN_DEPTH]-\\n[#SAVED_FN_DEPTH_1]
11095 .                   nr #OVERFLOW 1
11096 .\" Very occasionally, #VFP_DIFF, on a 1st footnote that isn't to
11097 .\" be deferred, comes up with a depth equal to exactly 1 line
11098 .\" of footnotes, i.e. enough room to print the rule and nothing
11099 .\" else.  The following tests for such a condition, and rather than
11100 .\" attempting to treat the footnote as an overflow, it tells mom to
11101 .\" treat it as a special kind of deferred footnote (#FN_DEFER 2).
11102 .                   if \\n[#SAVED_FN_DEPTH_1]=0 \{\
11103 .                      if \\n[#FN_DEPTH]=\\n[#FN_LEAD] \{\
11104 .                         nr #FN_DEFER 2
11105 .                         nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_2]
11106 .                         rr #OVERFLOW
11107 .                      \}
11108 .                   \}
11109 .                \}
11110 .\" Calculate VFP based on whether the footnote overflows, or is to
11111 .\" be treated normally.
11112 .                ie \\n[#OVERFLOW]=1 \{\
11113 .                   if \\n[#RUN_ON] \{\
11114 .                      rr #VARIABLE_FOOTER_POS
11115 .                      nr #VARIABLE_FOOTER_POS \\n[#SAVED_VFP]
11116 .                   \}
11117 .                   ie \\n[#FN_COUNT]=1 \{\
11118 .                      ie \\n[#RULED]=1 \{\
11119 .                         ie \\n[#COLUMNS]=1 \{\
11120 .                            ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11121 .                               ie \\n[#FROM_FOOTER] \{\
11122 .                                  ie \\n[#FN_COUNT_FOR_COLS]>1 \{\
11123 .                                     nr #FN_DEPTH -\\n[#FN_DEPTH]
11124 .                                     if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
11125 .                                     if !\\n[#PREV_FN_DEFERRED]=1 \{\
11126 .                                        nr #FN_DEPTH -\\n[#VFP_DIFF]
11127 .                                     \}
11128 .                                  \}
11129 .                                  el \{\
11130 .                                     nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
11131 .                                     if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
11132 .                                  \}
11133 .                               \}
11134 .                               el \{\
11135 .                                  nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
11136 .                               \}
11137 .                            \}
11138 .                            el \{\
11139 .                               nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
11140 .                            \}
11141 .                         \}
11142 .                         el \{ .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]) \}
11143 .                      \}
11144 .                      el \{\
11145 .                         nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
11146 .                         if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
11147 .                         if !\\n[#PREV_FN_DEFERRED]=1 \{\
11148 .                            ie \\n[#COLUMNS]=1 \{\
11149 .                               if !\\n[#FROM_FOOTER] \{\
11150 .
11151 .                               \}
11152 .                            \}
11153 .                            el \{\
11154 .                               nr #FN_DEPTH -\\n[#VFP_DIFF]
11155 .                            \}
11156 .                         \}
11157 .                         if \\n[#DIVERTED]=3 \{\
11158 .                            if !\\n[#PREV_FN_DEFERRED] \{\
11159 .                               if !\\n[#FROM_FOOTER] \{\
11160 .                                  if \\n[#FN_COUNT]=1 \{\
11161 .                                     if !\\n[#VFP_DIFF] \{\
11162 .                                        if \\n[#FN_MARKER_STYLE]=1 \{\
11163 .                                           da FOOTNOTES
11164 \!.                                            ALD \\n[#FN_LEAD]u
11165 .                                           di
11166 .                                        \}
11167 .                                        if \\n[#RESET_FN_NUMBER] \{\
11168 .                                           da FOOTNOTES
11169 \!.                                            ALD \\n[#FN_LEAD]u
11170 .                                           di
11171 .                                        \}
11172 .                                     \}
11173 .                                  \}
11174 .                               \}
11175 .                            \}
11176 .                         \}
11177 .                      \}
11178 .                      nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
11179 .                      nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
11180 .                   \}
11181 .                   el \{\
11182 .                      nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
11183 .                      nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
11184 .                   \}
11185 .                   rr #OVERFLOW
11186 .                   rr #RULED
11187 .                \}
11188 .                el \{\
11189 .                   nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
11190 .                   if \\n[#PREV_FN_DEFERRED]=1 \{\
11191 .                      if \\n[#DIVERTED] \{\
11192 .                         if !\\n[#FN_DEPTH]=\\n[#SAVED_FN_DEPTH_1] \{\
11193 .                            nr #FN_DEPTH +\\n[#FN_LEAD]
11194 .                            nr #VARIABLE_FOOTER_POS -\\n[#FN_LEAD] 
11195 .                            rr #PREV_FN_DEFERRED
11196 .                         \}
11197 .                      \}
11198 .                   \}
11199 .                   if \\n[#FN_COUNT]>1 \{\
11200 .                      nr #NO_BACK_UP 1
11201 .                      rr #DIVERTED
11202 .                      rr #RULED
11203 .                   \}
11204 .                \}
11205 .             \}
11206 .          \}
11207 .          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
11208 .\" See VFP_CHECK for an explanation of the next lines.
11209 .\" The trap has to be removed, prior to setting it, each time
11210 .\" FOOTNOTE is run.
11211 .          if \\n[#PRINT_STYLE]=2 \{\
11212 .             ch VFP_CHECK
11213 .             wh \\n[#VARIABLE_FOOTER_POS]u-\\n[#DOC_LEAD]u VFP_CHECK
11214 .          \}
11215 .\" If we have a footnote whose text has to be deferred to the next
11216 .\" page, reset the FOOTER trap to its original location.
11217 .          if \\n[#FN_DEFER] \{\
11218 .             nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
11219 .             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
11220 .          \}
11221 .       \}
11222 .       nr #NO_FN_MARKER 0
11223 .    \}
11224 .    if \\n[#ADD_BREAK] \{\
11225 .       br
11226 .       rr #ADD_BREAK
11227 .    \}
11228 .END
11229 \#
11230 \# Utility macros to manage footnotes that occur inside diversions
11231 \# ---------------------------------------------------------------
11232 \#
11233 .ig
11234 There are some redundancies here; they're left in in case unforeseen
11235 footnote situations crop up in the future that might require
11236 manipulation of them.
11237 ..
11238 \#
11239 \# 1. Pre-footnote processing for footnotes in diversions
11240 \#
11241 \# a) A footnote inside a diversion will be moved entirely (marker
11242 \# in running text and text of footnote) to the next page/column.
11243 \# 
11244 .MAC DIVER_FN_1_PRE END
11245 .    nr #RESET_FN_COUNTERS 1
11246 .    nr #COUNTERS_RESET 1
11247 .    if \\n[#DONE_ONCE]=1 \{\
11248 .       if \\n[#FN_DEFER] \{\
11249 .          if \\n[#SAVED_DIVER_FN_COUNT]=1 \{\
11250 .             ie \\n[#COLUMNS]=1 \{\
11251 .                if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_DEFER_SPACE 1 \}
11252 .             \}
11253 .             el \{\
11254 .                nr #FN_DEFER_SPACE 1
11255 .             \}
11256 .          \}
11257 .       \}
11258 .       if \\n[#FN_MARKER_STYLE]=1 \{\
11259 .          if \\n[#FN_COUNT]>0 \{ .nr #FN_COUNT 0 1 \}
11260 .          if \\n[#COLUMNS]=1 \{\
11261 .             if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11262 .                nr #FN_COUNT_FOR_COLS 0 1
11263 .             \}
11264 .          \}
11265 .       \}
11266 .       if \\n[#FN_MARKER_STYLE]=2 \{\
11267 .          if \\n[#RESET_FN_NUMBER]=1 \{\
11268 .             ie \\n[#COLUMNS]=1 \{\
11269 .                if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
11270 .             \}
11271 .             el \{\
11272 .                nr #FN_NUMBER 0 1
11273 .             \}
11274 .          \}
11275 .       \}
11276 .    \}
11277 .END
11278 \#
11279 \# b) Treat as a normal footnote, including defers.
11280 \#
11281 .MAC DIVER_FN_2_PRE END
11282 .    nr #RESET_FN_COUNTERS 2
11283 .END
11284 \#
11285 \# 2. Post-footnote processing for footnotes in diversions
11286 \#
11287 \# Even when a footnote inside a diversion is treated as
11288 \# "normal," some manipulation of registers is required.  The
11289 \# macro is called in DO_QUOTE (i.e. at the termination of
11290 \# quotes and blockquotes) and in DO_EPIGRAPH.
11291 \#
11292 .MAC DIVER_FN_2_POST END
11293 .    if \\n[#DONE_ONCE]=1 \{\
11294 .       if \\n[#FN_MARKER_STYLE]=1 \{\
11295 .          if \\n[#FN_COUNT]=0 \{\
11296 .             nr #DONT_RULE_ME 1
11297 .          \}
11298 .          if \\n[#FN_COUNT]>0 \{\
11299 .             nr #FN_COUNT 0 1
11300 .          \}
11301 .          if \\n[#COLUMNS]=1 \{\
11302 .             if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT_FOR_COLS 0 1 \}
11303 .             if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11304 .             \}
11305 .          \}
11306 .       \}
11307 .       if \\n[#FN_MARKER_STYLE]=2 \{\
11308 .          if \\n[#FN_COUNT]=0 \{\
11309 .             nr #DONT_RULE_ME 1
11310 .          \}
11311 .          if \\n[#FN_COUNT]>0 \{\
11312 .             nr #FN_COUNT 0 1
11313 .          \}
11314 .          if \\n[#RESET_FN_NUMBER]=1 \{\
11315 .             ie \\n[#COLUMNS]=1 \{\
11316 .                if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
11317 .             \}
11318 .             el \{\
11319 .                nr #FN_NUMBER 0 1
11320 .             \}
11321 .          \}
11322 .       \}
11323 .    \}
11324 .END
11325 \#
11326 \# The main macros that handle footnote processing.
11327 \# -----------------------------------------------
11328 \#
11329 .ig
11330 Sometimes, #VARIABLE_FOOTER_POS sets FOOTER at a location that gives
11331 the impression another line of running text could fit on the page.
11332 VFP_CHECK is always set to the line just above the one where FOOTER
11333 will be sprung, and checks for this condition.  If it exists, FOOTER
11334 is set one line lower on the page, thus squeezing in an extra line
11335 of running text.  This is a judgment call on my part, but seems to
11336 work well.  If there are problems (e.g. footnotes really do look
11337 jammed), the user should probably adjust FOOTNOTE_AUTOLEAD and/or
11338 FOOTNOTE_RULE_ADJ.
11339
11340 The macro has to be run in its own environment, otherwise the first
11341 word of the last line before the footnotes gets chopped.
11342 ..
11343 \#
11344 .MAC VFP_CHECK END
11345 .    ev VFP_CHECK
11346 .\" The trap also has to be removed each time VFP_CHECK is run
11347 .    if \\n[#PRINT_STYLE]=2 \{\
11348 .       ch VFP_CHECK
11349 .       SIZESPECS
11350 .       ie !\\n[#IN_DIVER] \{ .nr #PAGE_POS \\n(nl \}
11351 .       el \{ .nr #PAGE_POS \\n(nl+\\n(.d+(\\n[#DOC_LEAD]) \}
11352 .       nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS])
11353 .       nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
11354 .       nr #FN_GAP \\n[#SPACE_TO_FOOTER]%\\n[#DOC_LEAD]
11355 .       if !\\n[#FN_GAP]<0 \{\
11356 .          if \\n[#FN_GAP]<\\n[#DOC_LEAD] \{\
11357 .             ie (\\n[#PAGE_POS]+(\\n[#FN_DEPTH]+\\n[#FN_GAP]))>(\\n[#VISUAL_B_MARGIN]) \{\
11358 .                nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
11359 .             \}
11360 .             el \{\
11361 .                ie \\n[#DOC_LEAD]-\\n[#FN_GAP]<\\n[#DESCENDER] \{\
11362 .                   nr #VARIABLE_FOOTER_POS +\\n[#DOC_LEAD]
11363 .                   ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
11364 .                \}
11365 .                el \{\
11366 .                   nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
11367 .                \}
11368 .             \}
11369 .          \}
11370 .       \}
11371 .    \}
11372 .    ev
11373 .END
11374 \#
11375 .ig
11376 FN_OVERFLOW_TRAP starts off "underneath" FOOTER, but is revealed
11377 as #VARIABLE_FOOTER_POSITION changes the position of FOOTER.
11378 FN_OVERFLOW_TRAP simply starts diversion FN_OVERFLOW to "catch"
11379 the overflow.  The diversion is ended in FOOTER, immediately after
11380 FOOTER outputs the diversion, FOOTNOTES, before PROCESS_FN_LEFTOVER
11381 is run (either in HEADER, or in FOOTER if moving col to col).
11382 ..
11383 \#
11384 .MAC FN_OVERFLOW_TRAP END 
11385 .    if \\n[#FN_COUNT] \{\
11386 .       di FN_OVERFLOW
11387 .       ie !\\n[#NO_BACK_UP]=1 \{\
11388 .          if \\n[#PREV_FN_DEFERRED] \{\
11389 .             ie \\n[#COLUMNS]=1 \{\
11390 .                if \\n[#FROM_FOOTER] \{\
11391 .                   if \\n[#PREV_FN_DEFERRED] \{\
11392 .                      if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11393 .                      rr #PREV_FN_DEFERRED
11394 .                      \}
11395 .                   \}
11396 .                \}
11397 .                if !\\n[#FROM_FOOTER] \{\
11398 .                   if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11399 .                      if !\\n[#LAST_FN_COUNT_FOR_COLS]>1 \{\
11400 \!.                       RLD \\n[#FN_LEAD]u
11401 .                      \}
11402 .                   \}
11403 .                \}
11404 .             \}
11405 .             el \{\
11406 \!.              RLD \\n[#FN_LEAD]u
11407 .             \}
11408 .          \}
11409 .       \}
11410 .       el \{\
11411 .          rr #NO_BACK_UP
11412 .          rr #PREV_FN_DEFERRED
11413 .       \}
11414 .    \}
11415 .\" When #FROM_DIVERT_FN is 1, it signals to FOOTNOTE, when run from
11416 .\" within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING to the total
11417 .\" area allowable for running text.
11418 .    nr #FROM_DIVERT_FN 1
11419 .END
11420 \#
11421 .ig
11422 PROCESS_FN_LEFTOVER is called at the top of HEADER, and in
11423 FOOTER if we're moving from one column to the next (i.e. after
11424 outputting FOOTNOTES).  It checks for whether we have a "deferred
11425 footnote" situation, and resets counters and number registers
11426 accordingly.  Lastly, if we have some footnote overflow, it calls
11427 DIVERT_FN_OVERFLOW.
11428 ..
11429 \#
11430 .MAC PROCESS_FN_LEFTOVER END
11431 .    if \\n[#PREV_FN_DEFERRED]=2 \{\
11432 .       if \\n[#FN_COUNT_AT_FOOTER]>1 \{ .rr #PREV_FN_DEFERRED \}
11433 .    \}
11434 .    if !\\n[#FN_DEFER] \{\
11435 .       nr #FN_COUNT 0 1
11436 .       nr #FN_DEPTH 0
11437 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
11438 .    \}
11439 .    if r#FN_DEFER \{\
11440 .       if \\n[#FN_DEFER]=1 \{\
11441 .          nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
11442 .       \}
11443 .       if \\n[#FN_DEFER]=2 \{\
11444 .          nr #FN_DEPTH 0
11445 .          nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
11446 .       \}
11447 .    \}
11448 .    nr #SPACE_REMAINING 0
11449 .    ch FOOTER -\\n[#B_MARGIN]u
11450 .    if \\n[#FN_DEFER] \{\
11451 .       nr #NO_FN_MARKER 1
11452 .       FOOTNOTE
11453 .       nf
11454 .       FOOTNOTE OFF
11455 .       ie \\n[#COLUMNS]=1 \{\
11456 .          if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11457 .             if !\\n[#FROM_FOOTER] \{\
11458 .                if \\n[#FN_COUNT_FOR_COLS]=1 \{ .nr #PREV_FN_DEFERRED 1 \}
11459 .             \}
11460 .          \}
11461 .       \}
11462 .       el \{ .nr #PREV_FN_DEFERRED 1 \}
11463 .    \}
11464 .    if !\\n[#FN_DEFER] \{\
11465 .       if \\n[#FN_OVERFLOW_DEPTH] \{\
11466 .          DIVERT_FN_LEFTOVER
11467 .       \}
11468 .    \}
11469 .    ie \\n[#COLUMNS]=1 \{\
11470 .       if \\n[#COL_NUM]>1 \{\
11471 .          if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT 0 1 \}
11472 .       \}
11473 .    \}
11474 .    el \{ .nr #FN_COUNT 0 1 \}
11475 .    if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
11476 .    rr #FROM_DIVERT_FN
11477 .END
11478 \#
11479 .ig
11480 DIVERT_FN_LEFTOVER is called in PROCESS_FN_LEFTOVER (at
11481 the top of HEADER, and in FOOTER if we're moving from one column
11482 to the next).
11483 ..
11484 \#
11485 .MAC DIVERT_FN_LEFTOVER END
11486 .    nr #NO_FN_MARKER 1
11487 .    nr #DIVERTED 1
11488 .    FOOTNOTE
11489 .    nf
11490 .    FN_OVERFLOW
11491 .    FOOTNOTE OFF
11492 .    if \\n[#PREV_FN_DEFERRED] \{\
11493 .       nr #FN_DEPTH -\\n[#FN_LEAD]
11494 .       nr #VARIABLE_FOOTER_POS +\\n[#FN_LEAD]  
11495 .       ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
11496 .       if \\n[#PREV_FN_DEFERRED]=2 \{\
11497 .          nr #PREV_FN_DEFERRED 1
11498 .          rr #DIVERTED
11499 .       \}
11500 .    \}
11501 .    rr #FN_OVERFLOW_DEPTH
11502 .END
11503 \#
11504 .ig
11505 This is a special macro to deal with footnotes that are set inside
11506 diversions (QUOTE, BLOCKQUOTE and EPIGRAPH).  It's called in HEADER
11507 (and in FOOTER, if we're moving from column to column), and comes
11508 after PROCESS_FOOTNOTE_LEFTOVER in those two macros.
11509 ..
11510 \#
11511 .MAC PROCESS_FN_IN_DIVER END
11512 .    nr #SPACE_REMAINING 0
11513 .    ch FOOTER -\\n[#B_MARGIN]u
11514 .    nr #NO_FN_MARKER 1
11515 .    if !\\n[#RESET_FN_COUNTERS]=2 \{\
11516 .       rr #RESET_FN_COUNTERS
11517 .    \}
11518 .    FOOTNOTE
11519 .    if \\n[#FN_OVERFLOW_DEPTH] \{ .nf \}
11520 .    ie dRUNON_FN_IN_DIVER \{\
11521 .       RUNON_FN_IN_DIVER
11522 .       rm RUNON_FN_IN_DIVER
11523 .    \}
11524 .    el \{\
11525 .       nf
11526 .       FN_IN_DIVER
11527 .    \}
11528 .    FOOTNOTE OFF
11529 .    rr #DIVER_FN
11530 .END
11531 \#
11532 \# ====================================================================
11533 \#
11534 \# +++ENDNOTES+++
11535 \#
11536 .ig
11537 When endnotes are output, the spacing between the notes is always
11538 1 extra linespace.  This can have bottom margin consequences.  If
11539 this doesn't bother you, don't worry about it.  If it does bother
11540 you, and you want to adjust the spacing between any two endnotes (as
11541 they're output), make the spacing adjustments (.ALD/.RLD) at the
11542 *end* of endnotes (i.e. just before .ENDNOTE OFF), not at the top.
11543
11544 Endnotes must be output manually with .ENDNOTES. This allows user
11545 the flexibility to output endnotes at the end of each collated
11546 document, or to output them at the end of the entire document.
11547 ..
11548 \#
11549 \# Control macros
11550 \#
11551 \# ENDNOTE POINT SIZE
11552 \# ------------------
11553 \# *Argument:
11554 \#   <base point size for endnotes>
11555 \# *Function:
11556 \#   Creates or modifies register #EN_PS.
11557 \# *Notes:
11558 \#   Default is same as running text in body of document.
11559 \#
11560 \#   This size control macro differs from other size control macros
11561 \#   in that it sets an absolute point size, not a relative one.  This
11562 \#   is because a) endnotes always appear separate from the body of
11563 \#   a document and therefore don't need to be relative to the body
11564 \#   of the document, and b) there are quite a few elements of the
11565 \#   endnotes page(s) that need to be relative to the base point size
11566 \#   of that page.  If the base endnote point size were relative to
11567 \#   the body of the document (i.e. a _SIZE macro taking a +|- value)
11568 \#   getting the rest of the endnote elements sized properly could
11569 \#   become very confusing.
11570 \#
11571 .MAC ENDNOTE_PT_SIZE END
11572 .    nr #EN_PS (p;\\$1)
11573 .END
11574 \#
11575 \#
11576 \# ENDNOTE LEAD
11577 \# ------------
11578 \# *Argument:
11579 \#   <base leading to use in endnotes> [ ADJUST ]
11580 \# *Function:
11581 \#   Creates or modifies register #EN_LEAD.  Creates or removes
11582 \#   register #ADJ_EN_LEAD.  Stores arguments in strings if ENDNOTE_LEAD
11583 \#   set before START.
11584 \# *Notes:
11585 \#   Default is 14 points for TYPESET, adjusted; 24 for TYPEWRITE.
11586 \#
11587 .MAC ENDNOTE_LEAD END
11588 .    if !\\n[#OK_PROCESS_LEAD] \{\
11589 .       ds $EN_LEAD \\$1
11590 .       if !'\\$2'' \{\
11591 .           ds $ADJUST_EN_LEAD \\$2
11592 .       \}
11593 .       return
11594 .    \}
11595 .    rr #ADJ_EN_LEAD
11596 .    nr #EN_LEAD (p;\\$1)
11597 .    if '\\$2'ADJUST' \{\
11598 .       nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
11599 .       nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
11600 .       nr #ADJ_DOC_LEAD 1
11601 .       nr #ADJ_EN_LEAD 1
11602 .       nr #NO_TRAP_RESET 1
11603 .       DOC_LEAD \\n[#EN_LEAD]u ADJUST
11604 .       nr #EN_LEAD \\n[#DOC_LEAD]
11605 .       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
11606 .       rr #NO_TRAP_RESET
11607 .       nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
11608 .       rr #ORIG_DOC_LEAD
11609 .    \}
11610 .END
11611 \#
11612 \#
11613 \# ENDNOTES_HDRFTR_CENTER
11614 \# ----------------------
11615 \# *Argument:
11616 \#   toggle
11617 \# *Function:
11618 \#   Creates or removes toggle register #EN_HDRFTR_CENTER, used to
11619 \#   determine whether mom should print a/the hdrftr center string
11620 \#   on the endnotes page.  Primarily to enable/disable printing of the
11621 \#   chapter name in hdrftrs when DOCTYPE CHAPTER.
11622 \# *Notes:
11623 \#   Default is OFF
11624 \#
11625 .MAC ENDNOTES_HDRFTR_CENTER END
11626 .    ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
11627 .    el         \{ .rr #EN_HDRFTR_CENTER   \}
11628 .END
11629 \#
11630 \#
11631 \# ENDNOTE STRING 
11632 \# --------------
11633 \# *Argument:
11634 \#   <title for endnotes page>
11635 \# *Function:
11636 \#   Creates or modifies string $EN_STRING.
11637 \# *Notes:
11638 \#   Default is "Endnotes"
11639 \#
11640 .MAC ENDNOTE_STRING END
11641 .    ds $EN_STRING \\$1
11642 .END
11643 \#
11644 \#
11645 \# ENDNOTE STRING UNDERSCORE
11646 \# -------------------------
11647 \# *Arguments:
11648 \#   toggle | 2
11649 \# *Function:
11650 \#   Turns underscoring of endnote main title on or off.  If the argument
11651 \#   is the digit "2", turns on double-underscoring.
11652 \# *Notes:
11653 \#   Default is double-underscored.
11654 \#
11655 .MAC ENDNOTE_STRING_UNDERSCORE END
11656 .    ie '\\$1'' \{ .nr #EN_STRING_UNDERSCORE 1 \}
11657 .    el \{\
11658 .       ie '\\$1'2' \{ .nr #EN_STRING_UNDERSCORE 2 \}
11659 .       el \{ .nr #EN_STRING_UNDERSCORE 0 \}
11660 .    \}
11661 .END
11662 \#
11663 \#
11664 \# ENDNOTE STRING CAPS
11665 \# -------------------
11666 \# *Arguments:
11667 \#   <none> | <anything>
11668 \# *Function:
11669 \#   Turns capitalization of the endnotes pages title string
11670 \#   "Endnotes" on or off.
11671 \# *Notes:
11672 \#   Users may want the endnotes pages title string to be in caps,
11673 \#   but the toc entry for endnotes in lower case.  If the argument
11674 \#   to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
11675 \#   turned on, this is exactly what will happen.
11676 \#
11677 \#   Default is on.
11678 \#
11679 .MAC ENDNOTE_STRING_CAPS END
11680 .   ie '\\$1'' \{ .nr #EN_STRING_CAPS 1 \}
11681 .   el \{ .rr #EN_STRING_CAPS \}
11682 .END
11683 \#
11684 \#
11685 \# ENDNOTE TITLE
11686 \# -------------
11687 \# *Argument:
11688 \#   <string that appears before the first endnote pertaining to any document>
11689 \# *Function:
11690 \#   Creates string $EN_TITLE_STRING.
11691 \# *Notes:
11692 \#   Default is the document title, or, if doc is a chapter, "Chapter #"
11693 \#
11694 .MAC ENDNOTE_TITLE END
11695 .    ds $EN_TITLE \\$1
11696 .END
11697 \#
11698 \#
11699 .MAC ENDNOTE_TITLE_SPACE END
11700 .    nr #EN_TITLE_SPACE (\\$1)
11701 .END
11702 \#
11703 \#
11704 \# ENDNOTE TITLE UNDERSCORE
11705 \# ------------------------
11706 \# *Argument:
11707 \#   toggle
11708 \# *Function:
11709 \#   Creates or removes register #EN_TITLE_UNDERSCORE.
11710 \# *Notes:
11711 \#   Default is to underscore the endnote titles.
11712 \#
11713 .MAC ENDNOTE_TITLE_UNDERSCORE END
11714 .    ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
11715 .    el \{ .rr #EN_TITLE_UNDERSCORE \}
11716 .END
11717 \#
11718 \#
11719 \# ENDNOTE MARKER STYLE
11720 \# --------------------
11721 \# *Arguments:
11722 \#   NUMBER | LINE
11723 \# *Function:
11724 \#   Sets register #EN_MARKER_STYLE, used in ENDNOTE to determine
11725 \#   the style of endnote markers (labels).
11726 \# *Notes:
11727 \#   1=NUMBER; 2=LINE.  LINE means "use output line numbers".
11728 \#   Default is NUMBER.
11729 \#
11730 .MAC ENDNOTE_MARKER_STYLE END
11731 .    if '\\$1'NUMBER' \{\
11732 .       nr #EN_MARKER_STYLE 1
11733 .    \}
11734 .    if '\\$1'LINE' \{\
11735 .       nr #EN_MARKER_STYLE 2
11736 .       if !\\n[#EN_LN_SEP] \{\
11737 .          if !\\n[#EN_LN_BRACKETS] \{ .ENDNOTE_LINENUMBER_BRACKETS SQUARE \}
11738 .       \}
11739 .    \}
11740 .END
11741 \#
11742 \#
11743 \# ENDNOTE LINENUMBER MARK
11744 \# -----------------------
11745 \# *Function:
11746 \#   This string, when called inline, stores the current output line
11747 \#   number in register #EN_MARK for use with ENDNOTE.
11748 \#
11749 .ds EN-MARK \R'#EN_MARK \En(ln'
11750 \#
11751 \#
11752 \# ENDNOTE LINENUMBER SEPARATOR
11753 \# ----------------------------
11754 \# *Argument:
11755 \#   <user-defined separator>
11756 \# *Function:
11757 \#   Stores user-defined separator (for use then
11758 \#   ENDNOTE_MARKER_STYLE is LINE) in string $EN_LN_SEP.  The
11759 \#   separator is intended to be used when the user wishes a
11760 \#   separator, rather than the choice of brackets offered by
11761 \#   ENDNOTE_LINENUMBER_BRACKETS.
11762 \#
11763 .MAC ENDNOTE_LINENUMBER_SEPARATOR END
11764 .    rr #EN_LN_BRACKETS
11765 .    nr #EN_LN_SEP 1
11766 .    ds $EN_LN_SEP "\\$1
11767 .END
11768 \#
11769 \#
11770 \# ENDNOTE LINENUMBER BRACKETS
11771 \# ---------------------------
11772 \# *Argument:
11773 \#   PARENS | SQUARE | BRACES or ( | [ | {
11774 \# *Function:
11775 \#   Sets register #EN_LN_BRACKETS to 1, and creates strings
11776 \#   $EN_OPEN_BRACKET and $EN_CLOSE_BRACKET according to the given argument.
11777 \#
11778 .MAC ENDNOTE_LINENUMBER_BRACKETS END
11779 .    rr #EN_LN_SEP
11780 .    nr #EN_LN_BRACKETS 1
11781 .    if '\\$1'PARENS' \{\
11782 .       ds $EN_OPEN_BRACKET (
11783 .       ds $EN_CLOSE_BRACKET )
11784 .    \}
11785 .    if '\\$1'(' \{\
11786 .       ds $EN_OPEN_BRACKET (
11787 .       ds $EN_CLOSE_BRACKET )
11788 .    \}
11789 .    if '\\$1'SQUARE' \{\
11790 .       ds $EN_OPEN_BRACKET [
11791 .       ds $EN_CLOSE_BRACKET ]
11792 .    \}
11793 .    if '\\$1'[' \{\
11794 .       ds $EN_OPEN_BRACKET [
11795 .       ds $EN_CLOSE_BRACKET ]
11796 .    \}
11797 .    if '\\$1'BRACES' \{\
11798 .       ds $EN_OPEN_BRACKET {
11799 .       ds $EN_CLOSE_BRACKET }
11800 .    \}
11801 .    if '\\$1'{' \{\
11802 .       ds $EN_OPEN_BRACKET {
11803 .       ds $EN_CLOSE_BRACKET }
11804 .    \}
11805 .END
11806 \#
11807 \#
11808 \# ENDNOTE LINENUMBER GAP
11809 \# ----------------------
11810 \# *Argument:
11811 \#   <space between line-number labels and endnotes text>
11812 \# *Function:
11813 \#   Defines string $EN_LN_GAP, used during printing of line-number
11814 \#   labels in ENDNOTE.
11815 \#
11816 .MAC ENDNOTE_LINENUMBER_GAP END
11817 .    ds $EN_LN_GAP \\$1
11818 .END
11819 \#
11820 \#   
11821 \# ENDNOTE NUMBERS ALIGN RIGHT
11822 \# ---------------------------
11823 \# *Argument:
11824 \#   <max. number of digit placeholders that will appear in endnotes>
11825 \# *Function:
11826 \#   Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
11827 \#   #EN_NUMBER_PLACEHOLDERS.
11828 \# *Notes:
11829 \#   Default is for footnote numbers to be right aligned to 2 placeholders.
11830 \#
11831 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
11832 .    rr #EN_NUMBERS_ALIGN_LEFT
11833 .    nr #EN_NUMBERS_ALIGN_RIGHT 1
11834 .    nr #EN_NUMBER_PLACEHOLDERS \\$1
11835 .END
11836 \#
11837 \#
11838 \# ENDNOTE NUMBERS ALIGN LEFT
11839 \# --------------------------
11840 \# *Argument:
11841 \#   none
11842 \# *Function:
11843 \#   Toggles register #EN_NUMBERS_ALIGN_LEFT on.
11844 \# *Notes:
11845 \#   Default is for footnote numbers to be right aligned to 2 placeholders
11846 \#   (i.e. not left aligned).
11847 \#
11848 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
11849 .    rr #EN_NUMBERS_ALIGN_RIGHT
11850 .    nr #EN_NUMBERS_ALIGN_LEFT 1
11851 .END
11852 \#
11853 \#
11854 \# ENDNOTE PARAGRAPH INDENT
11855 \# ------------------------
11856 \# *Argument:
11857 \#   <first line indent of paras subsequent to 1st in endnotes>
11858 \# *Function:
11859 \#   Creates register #EN_PP_INDENT for use in .PP.
11860 \# *Notes:
11861 \#   Requires a unit of measure.
11862 \#
11863 \#   Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
11864 \#
11865 .MAC ENDNOTE_PARA_INDENT END
11866 .    nr #EN_PP_INDENT (\\$1)
11867 .END
11868 \#
11869 \#
11870 \# TURN OFF COLUMN MODE FOR ENDNOTES
11871 \# ---------------------------------
11872 \# *Argument:
11873 \#   <none> | <anything>
11874 \# *Function:
11875 \#   Creates or removes register #EN_NO_COLS
11876 \# *Notes:
11877 \#   Allows user to tell mom not to set endnotes in columnar
11878 \#   documents in columns.  Default is to set endnotes in columns.
11879 \#
11880 .MAC ENDNOTES_NO_COLUMNS END
11881 .    ie '\\$1'' \{ .nr #EN_NO_COLS 1 \}
11882 .    el \{ .rr #EN_NO_COLS \}
11883 .END
11884 \#
11885 \#
11886 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
11887 \# -------------------------------------------
11888 \# *Argument:
11889 \#   <none> | <anything>
11890 \# *Function:
11891 \#   Creates or removes register #EN_NO_FIRST_PN
11892 \# *Notes:
11893 \#   For use if FOOTERS are on.  Tells ENDNOTES not to put a page
11894 \#   number on the first endnotes page.  Some users may want this.
11895 \#   Default is to print a page number at the top of the first
11896 \#   endnotes page when footers are on.
11897 \#
11898 .MAC ENDNOTES_NO_FIRST_PAGENUM END
11899 .    ie '\\$1'' \{ .nr #EN_NO_FIRST_PN 1 \}
11900 .    el \{ .rr #EN_NO_FIRST_PN \}
11901 .END
11902 \#
11903 \#
11904 \# PAGE HEADERS ON ENDNOTES PAGES
11905 \# ------------------------------
11906 \# *Argument:
11907 \#   <none> | ALL
11908 \# *Function:
11909 \#   Creates or removes register #EN_ALLOWS_HEADERS or
11910 \#   #EN_ALLOWS_HEADERS_ALL
11911 \# *Notes:
11912 \#   Whether ENDNOTES puts a page header at the top of endnotes
11913 \#   pages if page headers are used throughout the document.
11914 \#   Default is to insert the page headers, but not on the first
11915 \#   page.  If the optional argument ALL is given, ENDNOTES puts a
11916 \#   page header on the first page as well.
11917 \#
11918 .MAC ENDNOTES_ALLOWS_HEADERS END
11919 .    ie '\\$1'' \{ .nr #EN_ALLOWS_HEADERS 1 \}
11920 .    el \{\
11921 .       ie '\\$1'ALL' \{\
11922 .          nr #EN_ALLOWS_HEADERS 1
11923 .          nr #EN_ALLOWS_HEADERS_ALL 1
11924 .       \}
11925 .       el \{\
11926 .          rr #EN_ALLOWS_HEADERS
11927 .          rr #EN_ALLOWS_HEADERS_ALL
11928 .       \}
11929 .    \}
11930 .END
11931 \#
11932 \#
11933 \# ENDNOTES PAGES PAGE NUMBERING STYLE
11934 \# -----------------------------------
11935 \# *Argument:
11936 \#   DIGIT | ROMAN | roman | ALPHA | alpha
11937 \# *Function:
11938 \#   Creates or modifies $EN_PN_STYLE.
11939 \# *Notes:
11940 \#   Allows user to define what style should be used for endnotes
11941 \#   pages page numbering.  Arguments are the same as for
11942 \#   PAGENUM_STYLE.
11943 \#
11944 \#   Default is DIGIT.
11945 \#
11946 .MAC ENDNOTES_PAGENUM_STYLE END
11947 .    ds $EN_PN_STYLE \\$1
11948 .END
11949 \#
11950 \#
11951 \# FIRST PAGE NUMBER FOR ENDNOTES
11952 \# ------------------------------
11953 \# *Argument:
11954 \#   <page number that appears on page 1 of endnotes pages>
11955 \# *Function:
11956 \#   Creates or modifies string $EN_FIRST_PN
11957 \# *Notes:
11958 \#   To be used with caution, only if all endnotes
11959 \#   are to be output at once, i.e. not at the end of the separate
11960 \#   docs of a collated doc
11961 \#
11962 .MAC ENDNOTES_FIRST_PAGENUMBER END
11963 .    nr #EN_FIRST_PN \\$1
11964 .END
11965 \#
11966 \# SINGLESPACE ENDNOTES
11967 \# --------------------
11968 \# *Argument:
11969 \#   <none> | <anything>
11970 \# *Function:
11971 \#   Sets lead of endnotes pages in TYPEWRITE to 12 points,
11972 \#   adjusted.
11973 \# *Notes:
11974 \#   Default is to double-space endnotes pages.
11975 \#
11976 .MAC SINGLESPACE_ENDNOTES END
11977 .    if \\n[#PRINT_STYLE]=1 \{\
11978 .       ie \\n[#SINGLE_SPACE] \{\
11979 .          nr #EN_SINGLESPACE 1
11980 .          rr #IGNORE
11981 .          if \\n[#OK_PROCESS_LEAD] \{\
11982 .             ENDNOTE_LEAD 12 ADJUST
11983 .             nr #IGNORE 1
11984 .          \}
11985 .       \}
11986 .       el \{\
11987 .          ie '\\$1'' \{\
11988 .             nr #EN_SINGLESPACE 1
11989 .             rr #IGNORE
11990 .             if \\n[#OK_PROCESS_LEAD] \{\
11991 .                ENDNOTE_LEAD 12 ADJUST
11992 .                nr #IGNORE 1
11993 .             \}
11994 .          \}
11995 .          el \{\
11996 .             rr #EN_SINGLESPACE
11997 .             rr #IGNORE
11998 .             if \\n[#OK_PROCESS_LEAD] \{\
11999 .                ENDNOTE_LEAD 24 ADJUST
12000 .                nr #IGNORE 1
12001 .             \}
12002 .          \}
12003 .       \}
12004 .    \}
12005 .END
12006 \#
12007 \#
12008 \# ENDNOTE PARAGRAPH SPACE
12009 \# -----------------------
12010 \# *Argument:
12011 \#   toggle
12012 \# *Function:
12013 \#   Creates toggle register #EN_PP_SPACE for use in .PP.
12014 \# *Notes:
12015 \#   Like PARA_SPACE.  Default is not to space endnote paras.
12016 \#
12017 .MAC ENDNOTE_PARA_SPACE END
12018 .    ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
12019 .    el \{ .rr #EN_PP_SPACE \}
12020 .END
12021 \#
12022 \#
12023 \# ENDNOTE
12024 \# -------
12025 \# *Argument:
12026 \#   toggle
12027 \# *Function:
12028 \#   Places superscript endnote number in text, then collects and
12029 \#   processes endnote in diversion END_NOTES.
12030 \# *Notes:
12031 \#   \c must be appended to the word immediately preceding .ENDNOTE
12032 \#   when ENDNOTE_MARKER_STYLE is NUMBER.
12033 \#
12034 .MAC ENDNOTE END
12035 .    if !\\n(.u \{ .nr #ADD_BREAK 1 \}
12036 .    ie '\\$1'' \{\
12037 .       nr #ENDNOTE 1
12038 .       if \\n[#EN_MARKER_STYLE]=1 \{\
12039 .          if \\n[#CONDENSE] \{ \*[CONDX]\c \}
12040 .          if \\n[#EXTEND]   \{ \*[EXTX]\c  \}
12041 .          if \\n[#PRINT_STYLE]=1 \{\
12042 .             if \\n[#UNDERLINE_ON] \{\
12043 .                nr #UNDERLINE_WAS_ON 1
12044 .                UNDERLINE OFF
12045 .             \}
12046 .             if \\n[#SLANT_ON] \{\
12047 .                 nr #SLANT_WAS_ON 1
12048 \*[SLANTX]\c
12049 .             \}
12050 .             PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
12051 .          \}
12052 .          if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]\c" \}
12053 .       \}
12054 .       if \\n[#EN_MARKER_STYLE]=2 \{\
12055 .          if !\\n[#LINENUMBERS] \{\
12056 .             tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
12057 .             tm1 "       ENDNOTE_MARKER_STYLE is LINE.
12058 .             ab Aborting on ENDNOTE at line \\n(.c.
12059 .          \}
12060 .          if \\n[#EN_MARK]=0 \{ .nr #EN_MARK \\n(ln \}
12061 .          nr #EN_MARK_2 \\n(ln
12062 .          if '\\n(.z'P_QUOTE' \{\
12063 .             nr #EN_MARK -1
12064 .             nr #EN_MARK_2 -1
12065 .          \}
12066 .       \}
12067 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
12068 .       nr #PP_STYLE 1
12069 .       if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
12070 .       INDENT_FIRST_PARAS
12071 .       ev EN
12072 .       da END_NOTES
12073 .       LL \\n[#DOC_L_LENGTH]u
12074 .       ta \\n(.lu
12075 .       if \\n[#COLUMNS] \{\
12076 .          ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
12077 .          el \{ .LL \\n[#COL_L_LENGTH]u \}
12078 .          ta \\n(.lu
12079 .       \}
12080 .       vs \\n[#EN_LEAD]u
12081 .       if \\n[#EN_NUMBER]=1 \{\
12082 \!.        ne 3
12083 .          if \\n[#PRINT_STYLE]=1 \{\
12084 .             TYPEWRITER
12085 .          \}
12086 .          if \\n[#PRINT_STYLE]=2 \{\
12087 .             FAMILY  \\*[$EN_TITLE_FAM]
12088 .             FT      \\*[$EN_TITLE_FT]
12089 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
12090 .          \}
12091 .          sp
12092 .          if !'\\*[$EN_TITLE]'' \{\
12093 .             if '\\*[$EN_TITLE_QUAD]'L'      \{ .LEFT   \}
12094 .             if '\\*[$EN_TITLE_QUAD]'LEFT'   \{ .LEFT   \}
12095 .             if '\\*[$EN_TITLE_QUAD]'C'      \{ .CENTER \}
12096 .             if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
12097 .             if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
12098 .             if '\\*[$EN_TITLE_QUAD]'R'      \{ .RIGHT  \}
12099 .             if '\\*[$EN_TITLE_QUAD]'RIGHT'  \{ .RIGHT  \}
12100 .             ie \\n[#EN_TITLE_UNDERSCORE] \{\
12101 .                UNDERSCORE "\\*[$EN_TITLE]
12102 .             \}
12103 .             el \{\
12104 .                PRINT "\\*[$EN_TITLE]
12105 .             \}
12106 .          \}
12107 .       \}
12108 .       ie \\n[#EN_NUMBER]=1 \{\
12109 .          if !'\\*[$EN_TITLE]'' \{ .sp \}
12110 .       \}
12111 .       el \{ .sp \}
12112 .       if \\n[#PRINT_STYLE]=1 \{\
12113 .          TYPEWRITER
12114 .       \}
12115 .       if \\n[#PRINT_STYLE]=2 \{\
12116 .          if \\n[#EN_MARKER_STYLE]=1 \{\
12117 .             FAMILY  \\*[$EN_NUMBER_FAM]
12118 .             FT      \\*[$EN_NUMBER_FT]
12119 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
12120 .          \}
12121 .          if \\n[#EN_MARKER_STYLE]=2 \{\
12122 .             FAMILY  \\*[$EN_LN_FAM]
12123 .             FT      \\*[$EN_LN_FT]
12124 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_LN_SIZE_CHANGE]
12125 .          \}
12126 .       \}
12127 .       if \\n[#EN_MARKER_STYLE]=2 \{\
12128 .          ENDNOTE_NUMBERS_ALIGN_LEFT
12129 .          ie \\n[#EN_LN_BRACKETS]=1 \{\
12130 .             ds $EN_LINENUMBER \v'-.085m'\\*[$EN_OPEN_BRACKET]\v'.085m'
12131 .             ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \{\
12132 .                as $EN_LINENUMBER \\n[#EN_MARK]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m' \"
12133 .             \}
12134 .             el \{\
12135 .                as $EN_LINENUMBER \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m' \"
12136 .             \}
12137 .          \}
12138 .          el \{\
12139 .             ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \{\
12140 .                ds $EN_LINENUMBER \\n[#EN_MARK]\\*[$EN_LN_SEP]
12141 .             \}
12142 .             el \{\
12143 .                ds $EN_LINENUMBER \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\\*[$EN_LN_SEP]
12144 .             \}
12145 .          \}
12146 .          nr #EN_MARK 0
12147 .       \}
12148 \!.     TRAP OFF
12149 .       nr #RESET_L_LENGTH \\n(.l
12150 .       ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
12151 .          nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
12152 .          RIGHT
12153 .       \}
12154 .       el \{\
12155 .          nr #EN_NUMBER_L_LENGTH \w'\En[#EN_NUMBER].\0'
12156 .          LEFT
12157 .       \}
12158 .       if \\n[#EN_MARKER_STYLE]=2 \{\
12159 .          if !\\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
12160 .             nr #EN_NUMBER_L_LENGTH \w'\\*[$EN_LINENUMBER]'+\\*[$EN_LN_GAP]
12161 .             LEFT
12162 .          \}
12163 .       \}
12164 .       ll \\n[#EN_NUMBER_L_LENGTH]u
12165 .       if \\n[#EN_MARKER_STYLE]=1 \{\
12166 \En[#EN_NUMBER].
12167 .       \}
12168 .       if \\n[#EN_MARKER_STYLE]=2 \{\
12169 \\*[$EN_LINENUMBER]
12170 .          rm $EN_LINENUMBER
12171 .       \}
12172 .       EOL
12173 .       ll \\n[#RESET_L_LENGTH]u
12174 .       nr #EN_FIGURE_SPACE \w'\0.'
12175 .       ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
12176 .          in \\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_FIGURE_SPACE]u
12177 .       \}
12178 .       el \{\
12179 .          ti \\n[#EN_NUMBER_L_LENGTH]u
12180 .       \}
12181 .       nr #EN_TEXT_INDENT \\n(.i
12182 .       QUAD \\*[$EN_QUAD]
12183 \!.     TRAP
12184 .       if \\n[#PRINT_STYLE]=1 \{\
12185 .          TYPEWRITER
12186 .       \}
12187 .       if \\n[#PRINT_STYLE]=2 \{\
12188 .          FAMILY  \\*[$EN_FAM]
12189 .          FT      \\*[$EN_FT]
12190 .          PT_SIZE \\n[#EN_PS]u
12191 .       \}
12192 .       if \\n[#REF]=1 \{\
12193 .          ie !\\n[#EN_MARKER_STYLE]=2 \{\
12194 .             if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
12195 .                in \\*[$REF_EN_INDENT]
12196 .                ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u)
12197 .             \}
12198 .             if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
12199 .                in \\*[$REF_EN_INDENT]
12200 .                ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u-\\n[#EN_FIGURE_SPACE]u)
12201 .             \}
12202 .          \}
12203 .          el \{\
12204 .             if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
12205 .                in \\*[$REF_EN_INDENT]
12206 .                ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u)
12207 .             \}
12208 .          \}
12209 .       \}
12210 .    \}
12211 .    el \{\
12212 .       br
12213 .          in 0
12214 .       if \\n[#EN_MARKER_STYLE]=2 \{\
12215 \!.        in 0
12216 .       \}
12217 .       di
12218 .\" Restore sentence spacing
12219 .       if \\n[#PRINT_STYLE]=2 \{\
12220 .          if d$RESTORE_SS_VAR \{ .SS \\*[$RESTORE_SS_VAR] \}
12221 .          rm $RESTORE_SS_VAR
12222 .       \}
12223 .       ev
12224 .       nr #PP_STYLE \\n[#PP_STYLE_PREV]
12225 .       if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
12226 .       rr #INDENT_FIRSTS
12227 .       rr #ENDNOTE
12228 .       if \\n[#PRINT_STYLE]=1 \{\
12229 .          if \\n[#UNDERLINE_WAS_ON] \{\
12230 .             rr #UNDERLINE_WAS_ON
12231 .             UNDERLINE
12232 .          \}
12233 .       \}
12234 .       if \\n[#SLANT_WAS_ON] \{\
12235 .          rr #SLANT_WAS_ON
12236 \*[SLANT]\c
12237 .       \}
12238 .    \}
12239 .    if \\n[#ADD_BREAK] \{\
12240 .       br
12241 .       rr #ADD_BREAK
12242 .    \}
12243 .END
12244 \#
12245 \#
12246 \# ENDNOTES
12247 \# --------
12248 \# *Arguments:
12249 \#   none
12250 \# *Function:
12251 \#   Sets new document leading from #EN_LEAD, breaks to a new page,
12252 \#   sets up an endnotes page based on registers and strings associated
12253 \#   with endnotes, then outputs diversion END_NOTES.
12254 \#
12255 .MAC ENDNOTES END
12256 .    nr #ENDNOTES 1
12257 .    nr #EN_FIRST_PAGE 1
12258 .    nr #HEADER_STATE \\n[#HEADERS_ON]
12259 .    ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
12260 .    if \\n[#LINENUMBERS]=1 \{\
12261 .       NUMBER_LINES OFF
12262 .       nr #LINENUMBERS 2
12263 .    \}
12264 .    if \\n[#HEADERS_ON]=1 \{\
12265 .       if !\\n[#EN_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
12266 .    \}
12267 .    if \\n[#HEADER_STATE]=1 \{\
12268 .       ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
12269 .       el \{ .rm $HDRFTR_CENTER  \}
12270 .    \}
12271 .    ie !\\n[#SUSPEND_PAGINATION] \{\
12272 .       if \\n[#PAGINATE]=1 \{\
12273 .          if \\n[#PAGE_NUM_V_POS]=1 \{\
12274 .             PAGENUM_STYLE \\*[$EN_PN_STYLE]
12275 .             if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN]-1 \}
12276 .             if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
12277 .          \}
12278 .       \}
12279 .    \}
12280 .    el \{\
12281 .       ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
12282 .       el \{ .nr #PAGINATE 0 \}
12283 .    \}
12284 .    if \\n[#FOOTERS_ON]=1 \{\
12285 .       if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
12286 .    \}
12287 .    NEWPAGE
12288 .    if \\n[#FOOTERS_ON]=1 \{\
12289 .       ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
12290 .       rm $HDRFTR_CENTER_OLD
12291 .       rm $HDRFTR_CENTER_NEW
12292 .    \}
12293 .    ie !\\n[#SUSPEND_PAGINATION] \{\
12294 .       if \\n[#PAGE_NUM_V_POS]=1 \{\
12295 .          if r#EN_NO_FIRST_PN \{\
12296 .             if \\n[#PAGINATION_STATE]=1 \{\
12297 .                nr #PAGINATE 1
12298 .             \}
12299 .          \}
12300 .       \}
12301 .    \}
12302 .    el \{\
12303 .       if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
12304 .    \}
12305 .    rr #PAGINATION_STATE
12306 .    PAGENUM_STYLE \\*[$EN_PN_STYLE]
12307 .    if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
12308 .    if \\n[#HEADER_STATE]=1 \{\
12309 .       if \\n[#EN_ALLOWS_HEADERS] \{ .HEADERS \}
12310 .    \}
12311 .\" Collect endnotes title string for TOC
12312 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
12313 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
12314 .    ds $TOC_TITLE_ITEM \\*[$EN_STRING]\\|
12315 .    ev TOC_EV
12316 .    da TOC_ENTRIES
12317 .    if \\n[#PRINT_STYLE]=1 \{\
12318 .       TYPEWRITER
12319 .    \}
12320 .    if \\n[#PRINT_STYLE]=2 \{\
12321 \!.     FAMILY  \\*[$TOC_TITLE_FAM]
12322 \!.     FT      \\*[$TOC_TITLE_FT]
12323 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
12324 .    \}
12325 \!.  TRAP OFF
12326 .    ie \\n[#PRINT_STYLE]=1 \{\
12327 \!.     PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
12328 .    \}
12329 .    el \{\
12330 \!.     PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
12331 .    \}
12332 \!.  EOL
12333 \!.  ST 100 L
12334 \!.  ST 101 R
12335 .    if \\n[#PRINT_STYLE]=2 \{\
12336 \!.     FAMILY  \\*[$TOC_PN_FAM]
12337 \!.     FT      \\*[$TOC_PN_FT]
12338 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
12339 .    \}
12340 \!.  TAB 100
12341 \!.  PRINT \\*[LEADER]
12342 \!.  TN
12343 \!.  TRAP
12344 \!.  PRINT \\n[#TOC_ENTRY_PN]
12345 \!.  TQ
12346 .    di       
12347 .    ev
12348 .\" End collection of endnotes title string for TOC
12349 .\" Process endnotes
12350 .    if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#EN_LEAD]u \}
12351 .    if \\n[#PRINT_STYLE]=2 \{\
12352 .       if \\n[#EN_NO_COLS] \{\
12353 .          if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
12354 .          nr #COLUMNS 0
12355 .       \}
12356 .       nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
12357 .       ie \\n[#ADJ_EN_LEAD] \{\
12358 .          nr #DOC_LEAD \\n[#EN_LEAD]
12359 .       \}
12360 .       el \{ .DOC_LEAD \\n[#EN_LEAD]u \}
12361 .    \}
12362 .    PRINT \&
12363 .    ie r#EN_TITLE_SPACE \{ .sp |\\n[#EN_TITLE_SPACE]u \}
12364 .    el \{ .sp |\\n[#T_MARGIN]u \}
12365 .    mk ec
12366 .    if \\n[#SLANT_ON] \{\
12367 \*[SLANTX]\c
12368 .    \}
12369 .    ev ENDNOTES
12370 .    if !'\\*[$EN_STRING]'' \{\
12371 .       if \\n[#PRINT_STYLE]=1 \{\
12372 .          TYPEWRITER
12373 .          vs \\n[#EN_LEAD]u
12374 .       \}
12375 .       if \\n[#PRINT_STYLE]=2 \{\
12376 .          LL \\n[#DOC_L_LENGTH]u
12377 .          ta \\n(.lu
12378 .          if \\n[#COLUMNS] \{\
12379 .             ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
12380 .             el \{ .LL \\n[#COL_L_LENGTH]u \}
12381 .             ta \\n(.lu
12382 .          \}
12383 .          FAMILY  \\*[$EN_STRING_FAM]
12384 .          FT      \\*[$EN_STRING_FT]
12385 .          PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
12386 .          vs      \\n[#EN_LEAD]u
12387 .       \}
12388 .       if '\\*[$EN_STRING_QUAD]'L'      \{ .LEFT   \}
12389 .       if '\\*[$EN_STRING_QUAD]'LEFT'   \{ .LEFT   \}
12390 .       if '\\*[$EN_STRING_QUAD]'C'      \{ .CENTER \}
12391 .       if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
12392 .       if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
12393 .       if '\\*[$EN_STRING_QUAD]'R'      \{ .RIGHT  \}
12394 .       if '\\*[$EN_STRING_QUAD]'RIGHT'  \{ .RIGHT  \}
12395 .       EOL
12396 .       if \\n[#EN_STRING_CAPS] \{ .CAPS \}
12397 .       ie \\n[#EN_STRING_UNDERSCORE] \{\
12398 .          ie \\n[#EN_STRING_UNDERSCORE]=2 \{\
12399 .             UNDERSCORE2 "\\*[$EN_STRING]
12400 .          \}
12401 .          el \{\
12402 .             UNDERSCORE "\\*[$EN_STRING]
12403 .          \}
12404 .       \}
12405 .       el \{\
12406 .          PRINT "\\*[$EN_STRING]
12407 .       \}
12408 .    \}
12409 .    CAPS OFF
12410 .    if \\n[#PRINT_STYLE]=1 \{\
12411 .       ie \\n[#SINGLE_SPACE]=1 \{\
12412 .          ALD \\n[#EN_LEAD]u*2u
12413 .       \}
12414 .       el \{\
12415 .          ie \\n[#EN_SINGLESPACE]=1 \{\
12416 .              ALD \\n[#EN_LEAD]u*2
12417 .          \}
12418 .          el \{\
12419 .
12420 .          \}
12421 .       \}
12422 .    \}
12423 .    if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#EN_LEAD]u \}
12424 .    QUAD \\*[$EN_QUAD]
12425 .    nf
12426 .    END_NOTES
12427 .    br
12428 .    ev
12429 .    rm END_NOTES
12430 .    if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#DOC_LEAD]u \}
12431 .    if \\n[#PRINT_STYLE]=2 \{\
12432 .       ie \\n[#ADJ_EN_LEAD] \{\
12433 .          nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
12434 .       \}
12435 .       el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
12436 .       rr #RESTORE_DOC_LEAD
12437 .    \}
12438 .    if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
12439 .    if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
12440 .    if \\n[#LINENUMBERS]=2 \{\
12441 .       NUMBER_LINES RESUME
12442 .       nr #LINENUMBERS 1
12443 .    \}
12444 .    rr #ENDNOTES
12445 .END
12446 \#
12447 \# ====================================================================
12448 \#
12449 \# +++BIBLIOGRAPHY+++
12450 \#
12451 .ig
12452 Mom treats bibliographies and endnotes very similarly.  The chief
12453 difference is that endnotes are collected and formatted inside a
12454 diversion, while bibliographies are built "by hand."  ENDNOTES sets
12455 up the endnotes page and outputs the formatted diversion.
12456 BIBLIOGRAPHY sets up the bibliography page, then awaits refer
12457 commands.
12458
12459 All of the bibliography control macros have their exact
12460 counterparts in the endnotes control macros.  It was tempting to do
12461 fancy stuff with aliases to avoid the repetition, but for reasons
12462 of my own sanity, and for the benefit of anyone wanting to play
12463 around with the bibliography control macros, I decided to keep them
12464 separate.
12465
12466 Because the bibliography control macros all have endnotes
12467 equivalents, refer to the appropriate, similar endnote macro for
12468 Arguments, Function and Notes.
12469 ..
12470 \# Bibliography control macros
12471 \#
12472 .MAC BIBLIOGRAPHY_PT_SIZE END
12473 .    nr #BIB_PS (p;\\$1)
12474 .END
12475 \#
12476 .MAC BIBLIOGRAPHY_LEAD END
12477 .    if !\\n[#OK_PROCESS_LEAD] \{\
12478 .       ds $BIB_LEAD \\$1
12479 .       if !'\\$2'' \{\
12480 .           ds $ADJUST_BIB_LEAD \\$2
12481 .       \}
12482 .       return
12483 .    \}
12484 .    rr #ADJ_BIB_LEAD
12485 .    nr #BIB_LEAD (p;\\$1)
12486 .    if '\\$2'ADJUST' \{\
12487 .       nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
12488 .       nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
12489 .       nr #ADJ_DOC_LEAD 1
12490 .       nr #ADJ_BIB_LEAD 1
12491 .       nr #NO_TRAP_RESET 1
12492 .       DOC_LEAD \\n[#BIB_LEAD]u ADJUST
12493 .       nr #BIB_LEAD \\n[#DOC_LEAD]
12494 .       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
12495 .       rr #NO_TRAP_RESET
12496 .       nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
12497 .       rr #ORIG_DOC_LEAD
12498 .    \}
12499 .END
12500 \#
12501 .MAC BIBLIOGRAPHY_HDRFTR_CENTER END
12502 .    ie '\\$1'' \{ .nr #BIB_HDRFTR_CENTER 1 \}
12503 .    el         \{ .rr #BIB_HDRFTR_CENTER   \}
12504 .END
12505 \#
12506 .MAC BIBLIOGRAPHY_STRING END
12507 .    ds $BIB_STRING \\$1
12508 .END
12509 \#
12510 .MAC BIBLIOGRAPHY_STRING_UNDERSCORE END
12511 .    ie '\\$1'' \{ .nr #BIB_STRING_UNDERSCORE 1 \}
12512 .    el \{\
12513 .       ie '\\$1'2' \{ .nr #BIB_STRING_UNDERSCORE 2 \}
12514 .       el \{ .nr #BIB_STRING_UNDERSCORE 0 \}
12515 .    \}
12516 .END
12517 \#
12518 .MAC BIBLIOGRAPHY_STRING_CAPS END
12519 .   ie '\\$1'' \{ .nr #BIB_STRING_CAPS 1 \}
12520 .   el \{ .rr #BIB_STRING_CAPS \}
12521 .END
12522 \#
12523 .MAC BIBLIOGRAPHY_NO_COLUMNS END
12524 .    ie '\\$1'' \{ .nr #BIB_NO_COLS 1 \}
12525 .    el \{ .rr #BIB_NO_COLS \}
12526 .END
12527 \#
12528 .MAC BIBLIOGRAPHY_NO_FIRST_PAGENUM END
12529 .    ie '\\$1'' \{ .nr #BIB_NO_FIRST_PN 1 \}
12530 .    el \{ .rr #BIB_NO_FIRST_PN \}
12531 .END
12532 \#
12533 .MAC BIBLIOGRAPHY_ALLOWS_HEADERS END
12534 .    ie '\\$1'' \{ .nr #BIB_ALLOWS_HEADERS 1 \}
12535 .    el \{\
12536 .       ie '\\$1'ALL' \{\
12537 .          nr #BIB_ALLOWS_HEADERS 1
12538 .          nr #BIB_ALLOWS_HEADERS_ALL 1
12539 .       \}
12540 .       el \{\
12541 .          rr #BIB_ALLOWS_HEADERS
12542 .          rr #BIB_ALLOWS_HEADERS_ALL
12543 .       \}
12544 .    \}
12545 .END
12546 \#
12547 .MAC BIBLIOGRAPHY_PAGENUM_STYLE END
12548 .    ds $BIB_PN_STYLE \\$1
12549 .END
12550 \#
12551 .MAC BIBLIOGRAPHY_FIRST_PAGENUMBER END
12552 .    nr #BIB_FIRST_PN \\$1
12553 .END
12554 \#
12555 .MAC SINGLESPACE_BIBLIOGRAPHY END
12556 .    if \\n[#PRINT_STYLE]=1 \{\
12557 .       ie \\n[#SINGLE_SPACE] \{\
12558 .          nr #BIB_SINGLESPACE 1
12559 .          rr #IGNORE
12560 .          if \\n[#OK_PROCESS_LEAD] \{\
12561 .             BIBLIOGRAPHY_LEAD 12 ADJUST
12562 .             nr #IGNORE 1
12563 .          \}
12564 .       \}
12565 .       el \{\
12566 .          ie '\\$1'' \{\
12567 .             nr #BIB_SINGLESPACE 1
12568 .             rr #IGNORE
12569 .             if \\n[#OK_PROCESS_LEAD] \{\
12570 .                BIBLIOGRAPHY_LEAD 12 ADJUST
12571 .                nr #IGNORE 1
12572 .             \}
12573 .          \}
12574 .          el \{\
12575 .             rr #BIB_SINGLESPACE
12576 .             rr #IGNORE
12577 .             if \\n[#OK_PROCESS_LEAD] \{\
12578 .                BIBLIOGRAPHY_LEAD 24 ADJUST
12579 .                nr #IGNORE 1
12580 .             \}
12581 .          \}
12582 .       \}
12583 .    \}
12584 .END
12585 \#
12586 \#
12587 \# Style for outputting collected bibliographic references
12588 \# -------------------------------------------------------
12589 \# *Argument:
12590 \#   LIST | PLAIN [ <list separator> ] [ <list prefix> ]
12591 \# *Function:
12592 \#   Sets #BIB_LIST to 1 for numbered list style, 0 for plain output
12593 \# *Notes:
12594 \#   Technically, user is supposed to enter PLAIN if s/he wants an
12595 \#   unumbered bibliography, but the el clause says "any arg but
12596 \#   LIST means unumbered."  Effectively, any arg but LIST produces
12597 \#   a "plain" bibliographic list.
12598 \#
12599 \#   The 2nd and 3rd args have the same options as the 2nd arg to LIST.
12600 \#
12601 .MAC BIBLIOGRAPHY_TYPE END
12602 .    ie '\\$1'LIST' \{\
12603 .       nr #BIB_LIST 1
12604 .       ie '\\$2'' \{\
12605 .          if '\\*[$BIB_LIST_SEPARATOR]'' .ds $BIB_LIST_SEPARATOR .
12606 .       \}
12607 .       el .ds $BIB_LIST_SEPARATOR \\$2
12608 .       ie '\\$3'' .ds $BIB_LIST_PREFIX
12609 .       el .ds $BIB_LIST_PREFIX \\$3
12610 .    \}
12611 .    el \{ .nr #BIB_LIST 0 \}
12612 .END
12613 \#
12614 \# Spacing between items in bibliographies
12615 \# ---------------------------------------
12616 \# *Argument:
12617 \#   <amount of space>
12618 \# *Function:
12619 \#   Gets value for #BIB_SPACE in units.
12620 \# *Notes:
12621 \#   Requires a unit of measure.
12622 \#
12623 .MAC BIBLIOGRAPHY_SPACING END
12624 .    ds $BIB_SPACE \\$1
12625 .    if \\n[#BIB_LEAD]=0 \{\
12626 .       nr #DEFER_BIB_SPACING 1
12627 .       return
12628 .    \}
12629 .    ds $EVAL_BIB_SPACE \\*[$BIB_SPACE]
12630 .    substring $EVAL_BIB_SPACE -1
12631 .    ie '\\*[$EVAL_BIB_SPACE]'v' \{\
12632 .       substring $BIB_SPACE 0 0
12633 .       nr #BIB_SPACE \\n[#BIB_LEAD]*\\*[$BIB_SPACE]
12634 .    \}
12635 .    el \{\
12636 .       nr #BIB_SPACE (\\$1)
12637 .    \}
12638 .END
12639 \#
12640 \# Set up bibliography page
12641 \# ------------------------
12642 \# *Function:
12643 \#   Sets up a new page, with title, ready to accept the output
12644 \#   of refer's $LIST$ or .R1 bibliography .R2
12645 \# *Notes:
12646 \#   Bibliography pages are set up almost identically to endnotes pages.
12647 \#
12648 .MAC BIBLIOGRAPHY END
12649 .    nr #BIBLIOGRAPHY 1
12650 .    nr #BIB_FIRST_PAGE 1
12651 .    nr #HEADER_STATE \\n[#HEADERS_ON]
12652 .    ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
12653 .    if \\n[#LINENUMBERS]=1 \{\
12654 .       NUMBER_LINES OFF
12655 .       nr #LINENUMBERS 2
12656 .    \}
12657 .    if \\n[#HEADERS_ON]=1 \{\
12658 .       if !\\n[#BIB_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
12659 .    \}
12660 .    if \\n[#HEADER_STATE]=1 \{\
12661 .       ie \\n[#BIB_HDRFTR_CENTER]=1 \{ . \}
12662 .       el \{ .rm $HDRFTR_CENTER  \}
12663 .    \}
12664 .    ie !\\n[#SUSPEND_PAGINATION] \{\
12665 .       if \\n[#PAGINATE]=1 \{\
12666 .          if \\n[#PAGE_NUM_V_POS]=1 \{\
12667 .             PAGENUM_STYLE \\*[$BIB_PN_STYLE]
12668 .             if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN]-1 \}
12669 .             if r#BIB_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
12670 .          \}
12671 .       \}
12672 .    \}
12673 .    el \{\
12674 .       ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
12675 .       el \{ .nr #PAGINATE 0 \}
12676 .    \}
12677 .    if \\n[#FOOTERS_ON]=1 \{\
12678 .       if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
12679 .    \}
12680 .    NEWPAGE
12681 .    if \\n[#FOOTERS_ON]=1 \{\
12682 .       ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
12683 .       rm $HDRFTR_CENTER_OLD
12684 .       rm $HDRFTR_CENTER_NEW
12685 .    \}
12686 .    ie !\\n[#SUSPEND_PAGINATION] \{\
12687 .       if \\n[#PAGE_NUM_V_POS]=1 \{\
12688 .          if r#BIB_NO_FIRST_PN \{\
12689 .             if \\n[#PAGINATION_STATE]=1 \{\
12690 .                nr #PAGINATE 1
12691 .             \}
12692 .          \}
12693 .       \}
12694 .    \}
12695 .    el \{\
12696 .       if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
12697 .    \}
12698 .    rr #PAGINATION_STATE
12699 .    PAGENUM_STYLE \\*[$BIB_PN_STYLE]
12700 .    if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN] \}
12701 .    if \\n[#HEADER_STATE]=1 \{\
12702 .       if \\n[#BIB_ALLOWS_HEADERS] \{ .HEADERS \}
12703 .    \}
12704 .\" Collect bibliography title string for TOC
12705 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
12706 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
12707 .    ds $TOC_TITLE_ITEM \\*[$BIB_STRING]\\|
12708 .    ev TOC_EV
12709 .    da TOC_ENTRIES
12710 .    if \\n[#PRINT_STYLE]=1 \{\
12711 .       TYPEWRITER
12712 .    \}
12713 .    if \\n[#PRINT_STYLE]=2 \{\
12714 \!.     FAMILY  \\*[$TOC_TITLE_FAM]
12715 \!.     FT      \\*[$TOC_TITLE_FT]
12716 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
12717 .    \}
12718 \!.  TRAP OFF
12719 .    ie \\n[#PRINT_STYLE]=1 \{\
12720 \!.     PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
12721 .    \}
12722 .    el \{\
12723 \!.     PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
12724 .    \}
12725 \!.  EOL
12726 \!.  ST 100 L
12727 \!.  ST 101 R
12728 .    if \\n[#PRINT_STYLE]=2 \{\
12729 \!.     FAMILY  \\*[$TOC_PN_FAM]
12730 \!.     FT      \\*[$TOC_PN_FT]
12731 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
12732 .    \}
12733 \!.  TAB 100
12734 \!.  PRINT \\*[LEADER]
12735 \!.  TN
12736 \!.  TRAP
12737 \!.  PRINT \\n[#TOC_ENTRY_PN]
12738 \!.  TQ
12739 .    di       
12740 .    ev
12741 .\" End collection of bibliography title string for TOC
12742 .\" Process bibliography
12743 .    if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#BIB_LEAD]u \}
12744 .    if \\n[#PRINT_STYLE]=2 \{\
12745 .       if \\n[#BIB_NO_COLS] \{\
12746 .          if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
12747 .          nr #COLUMNS 0
12748 .       \}
12749 .       nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
12750 .       ie \\n[#ADJ_BIB_LEAD] \{\
12751 .          nr #DOC_LEAD \\n[#BIB_LEAD]
12752 .       \}
12753 .       el \{ .DOC_LEAD \\n[#BIB_LEAD]u \}
12754 .    \}
12755 .    PRINT \&
12756 .    ie r#BIB_TITLE_SPACE \{ .sp |\\n[#BIB_TITLE_SPACE]u \}
12757 .    el \{ .sp |\\n[#T_MARGIN]u \}
12758 .    mk ec
12759 .    if \\n[#SLANT_ON] \{\
12760 \*[SLANTX]\c
12761 .    \}
12762 .    if !'\\*[$BIB_STRING]'' \{\
12763 .       if \\n[#PRINT_STYLE]=1 \{\
12764 .          TYPEWRITER
12765 .          vs \\n[#BIB_LEAD]u
12766 .       \}
12767 .       if \\n[#PRINT_STYLE]=2 \{\
12768 .          LL \\n[#DOC_L_LENGTH]u
12769 .          ta \\n(.lu
12770 .          if \\n[#COLUMNS] \{\
12771 .             ie \\n[#BIB_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
12772 .             el \{ .LL \\n[#COL_L_LENGTH]u \}
12773 .             ta \\n(.lu
12774 .          \}
12775 .          FAMILY  \\*[$BIB_STRING_FAM]
12776 .          FT      \\*[$BIB_STRING_FT]
12777 .          PT_SIZE \\n[#BIB_PS]u\\*[$BIB_STRING_SIZE_CHANGE]
12778 .          vs      \\n[#BIB_LEAD]u
12779 .       \}
12780 .       if '\\*[$BIB_STRING_QUAD]'L'      \{ .LEFT   \}
12781 .       if '\\*[$BIB_STRING_QUAD]'LEFT'   \{ .LEFT   \}
12782 .       if '\\*[$EN_STRING_QUAD]'C'       \{ .CENTER \}
12783 .       if '\\*[$BIB_STRING_QUAD]'CENTER' \{ .CENTER \}
12784 .       if '\\*[$BIB_STRING_QUAD]'CENTRE' \{ .CENTER \}
12785 .       if '\\*[$BIB_STRING_QUAD]'R'      \{ .RIGHT  \}
12786 .       if '\\*[$BIB_STRING_QUAD]'RIGHT'  \{ .RIGHT  \}
12787 .       EOL
12788 .       if \\n[#BIB_STRING_CAPS] \{ .CAPS \}
12789 .       ie \\n[#BIB_STRING_UNDERSCORE] \{\
12790 .          ie \\n[#BIB_STRING_UNDERSCORE]=2 \{\
12791 .             UNDERSCORE2 "\\*[$BIB_STRING]
12792 .          \}
12793 .          el \{\
12794 .             UNDERSCORE "\\*[$BIB_STRING]
12795 .          \}
12796 .       \}
12797 .       el \{\
12798 .          PRINT "\\*[$BIB_STRING]
12799 .       \}
12800 .    \}
12801 .    CAPS OFF
12802 .    FAMILY \\*[$BIB_FAMILY]
12803 .    FT \\*[$BIB_FT]
12804 .    PT_SIZE -\\*[$BIB_STRING_SIZE_CHANGE]
12805 .    if \\n[#PRINT_STYLE]=1 \{\
12806 .       ie \\n[#SINGLE_SPACE]=1 \{\
12807 .          ALD \\n[#BIB_LEAD]*3u
12808 .       \}
12809 .       el \{\
12810 .          ie \\n[#BIB_SINGLESPACE]=1 \{\
12811 .             ALD \\n[#BIB_LEAD]u*3u
12812 .          \}
12813 .          el \{\
12814 .             ALD \\n[#BIB_LEAD]u
12815 .          \}
12816 .       \}
12817 .    \}
12818 .    if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#BIB_LEAD]u*2u \}
12819 .    QUAD \\*[$BIB_QUAD]
12820 .    if \\n[#PRINT_STYLE]=1 \{\
12821 .       ie \\n[#SINGLE_SPACE]=1 \{\
12822 .          vs \\n[#BIB_LEAD]u
12823 .       \}
12824 .       el \{\
12825 .          ie \\n[#BIB_SINGLESPACE]=1 \{\
12826 .             vs \\n[#BIB_LEAD]u
12827 .          \}
12828 .          el \{\
12829 .             vs \\n[#BIB_LEAD]u
12830 .          \}
12831 .       \}
12832 .    \}
12833 .    if \\n[#PRINT_STYLE]=2 \{\
12834 .       ie \\n[#ADJ_BIB_LEAD] \{\
12835 .          nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
12836 .       \}
12837 .       el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
12838 .       rr #RESTORE_DOC_LEAD
12839 .    \}
12840 .    if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
12841 .    if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
12842 .    rr #BIBLIOGRAPHY
12843 .    if \\n[#LINENUMBERS]=2 \{\
12844 .       NUMBER_LINES RESUME
12845 .       nr #LINENUMBERS 1
12846 .    \}
12847 .END
12848 \#
12849 \# ====================================================================
12850 \#
12851 \# +++TABLE OF CONTENTS+++
12852 \#
12853 \# Strings to allocate space for leaders and entry page numbers
12854 \#
12855 .ds $TOC_PN \\*[ST100]\\F[\\*[$TOC_PN_FAM]]\\f[\\*[$TOC_PN_FT]]\\s[\\n[#TOC_PS]u]#\\*[ST100X]\\*[ST101]\\s[\\*[$TOC_PN_SIZE_CHANGE]]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\*[ST101X]
12856 .ds $TOC_PN_TYPEWRITE \\*[ST100]#\\*[ST100X]\\*[ST101]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST101X]
12857 \#
12858 \# TOC ENTRIES PAGE NUMBERS PADDING
12859 \# --------------------------------
12860 \# *Argument:
12861 \#   <number of placeholders for toc entries page numbers>
12862 \# *Function:
12863 \#   Creates or modifies register #TOC_PN_PADDING.
12864 \# *Notes:
12865 \#   "Placeholders" is the maximum number of digits in a page
12866 \#   number numeral.
12867 \#
12868 \#   Default is 3.
12869 \#
12870 .MAC TOC_PADDING END
12871 .    nr #TOC_PN_PADDING \\$1
12872 .END
12873 \#
12874 \#
12875 \# PAGINATE TOC
12876 \# ------------
12877 \# *Argument:
12878 \#   <none> | <anything>
12879 \# *Function:
12880 \#   Creates or removes register #PAGINATE_TOC.
12881 \# *Notes:
12882 \#   Default is to paginate toc.
12883 \#
12884 .MAC PAGINATE_TOC END
12885 .    ie '\\$1'' \{ .nr #PAGINATE_TOC 1 \}
12886 .    el \{ .nr #PAGINATE_TOC 0 \}
12887 .END
12888 \#
12889 \#
12890 \# TOC POINT SIZE
12891 \# --------------
12892 \# *Argument:
12893 \#   <base point size for toc pages>
12894 \# *Function:
12895 \#   Creates or modifies register #TOC_PS.
12896 \# *Notes:
12897 \#   This size control macro differs from other size control macros
12898 \#   in that it sets an absolute point size, not a relative one.
12899 \#   See notes for ENDNOTE_PT_SIZE for explanation.  No unit of
12900 \#   measure required.
12901 \#
12902 \#   No unit of measure required (points assumed).  Default is 11.5
12903 \#   for TYPESET.
12904 \#
12905 .MAC TOC_PT_SIZE END
12906 .    nr #TOC_PS (p;\\$1)
12907 .END
12908 \#
12909 \#
12910 \# TOC LEADING
12911 \# -----------
12912 \# *Argument:
12913 \#   <leading for toc pages> [ADJUST]
12914 \# *Function:
12915 \#   Creates or modifies register #TOC_LEAD. If optional ADJUST
12916 \#   given, adjusts lead to fill page.  If #OK_PROCESS_LEAD doesn't
12917 \#   exist, stores arguments for when it's okay to run the macro.
12918 \# *Notes:
12919 \#   No unit of measure required (points assumed).
12920 \#
12921 \#   Default is same as DOC_LEAD.
12922 \#
12923 .MAC TOC_LEAD END
12924 .    if !\\n[#OK_PROCESS_LEAD] \{\
12925 .       ds $TOC_LEAD \\$1
12926 .       if !'\\$2'' \{\
12927 .           ds $ADJUST_TOC_LEAD \\$2
12928 .       \}
12929 .       return
12930 .    \}
12931 .    rr #ADJ_TOC_LEAD
12932 .    nr #TOC_LEAD (p;\\$1)
12933 .    if '\\$2'ADJUST' \{\
12934 .       nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
12935 .       nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
12936 .       nr #ADJ_DOC_LEAD 1
12937 .       nr #ADJ_TOC_LEAD 1
12938 .       nr #NO_TRAP_RESET 1
12939 .       DOC_LEAD \\n[#TOC_LEAD]u ADJUST
12940 .       nr #TOC_LEAD \\n[#DOC_LEAD]
12941 .       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
12942 .       rr #NO_TRAP_RESET
12943 .       nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
12944 .       rr #ORIG_DOC_LEAD
12945 .    \}
12946 .END
12947 \#
12948 \#
12949 \# TOC PAGES PAGE-NUMBERING STYLE
12950 \# ------------------------------
12951 \# *Argument:
12952 \#   DIGIT | ROMAN | roman | ALPHA | alpha
12953 \# *Function:
12954 \#   Creates or modifies string $TOC_PN_STYLE
12955 \# *Notes:
12956 \#   Page numbering style for page numbers that appear in the
12957 \#   headers/footers of toc pages.  See notes for PAGENUM_STYLE.  
12958 \#
12959 \#   Default is roman.
12960 \#
12961 .MAC TOC_PAGENUM_STYLE END
12962 .    ds $TOC_PN_STYLE \\$1
12963 .END
12964 \#
12965 \#
12966 \# TOC RECTO_VERSO SWITCH
12967 \# ----------------------
12968 \# *Argument:
12969 \#   <none> | <anything>
12970 \# *Function:
12971 \#   Creates or removes register #TOC_RV_SWITCH
12972 \# *Notes:
12973 \#   Allows switching of L/R margins if a doc is recto/verso and
12974 \#   the first toc page happens to fall the wrong way
12975 \#
12976 .MAC TOC_RV_SWITCH END
12977 .    ie '\\$1'' \{ .nr #TOC_RV_SWITCH 1 \}
12978 .    el \{ .rr #TOC_RV_SWITCH \}
12979 .END
12980 \#
12981 \# - for TOC "doc header" (i.e. "Contents")
12982 \#
12983 \# TOC HEADER STRING
12984 \# -----------------
12985 \# *Argument:
12986 \#   <string for "doc header" of first toc page>
12987 \# *Function:
12988 \#   Creates or modifies string $TOC_HEADER_STRING
12989 \# *Notes:
12990 \#   Default is "Contents".
12991 \#
12992 .MAC TOC_HEADER_STRING END
12993 .    ds $TOC_HEADER_STRING \\$1
12994 .END
12995 \#
12996 \# - for TOC entries page number numerals
12997 \#
12998 \# Control macros for toc doc titles, heads, subheads and paraheads 
12999 \# ----------------------------------------------------------------
13000 \#
13001 \# All these control macros behave the same way, setting the family,
13002 \# font, point size and indent from the left margin of the different
13003 \# kinds of entries that can appear in the toc.  The way they
13004 \# operate is identical to all other _FAMILY, _FONT and _SIZE
13005 \# control macros.  _INDENT takes an absolute value.
13006 \# TOC_APPENDS_AUTHORS is unique in this section.
13007 \# 
13008 \# - for title entries
13009 \#
13010 .MAC TOC_TITLE_INDENT END
13011 .    nr #TOC_TITLE_INDENT (\\$1)
13012 .END
13013 \#
13014 \#
13015 .MAC TOC_TITLE_ENTRY END
13016 .    nr #USER_SET_TITLE_ITEM 1
13017 .    ds $USER_SET_TITLE_ITEM \\$1
13018 .END
13019 \#
13020 \#
13021 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
13022 \# -----------------------------------------
13023 \# *Argument:
13024 \#   <none> | <name(s) of author(s) as they should appear in toc doc title entries>
13025 \# *Function:
13026 \#   Creates register #TOC_AUTHORS (to tell TOC to append authors
13027 \#   to toc doc title entries).  Optionally creates string
13028 \#   $TOC_AUTHORS.
13029 \# *Notes:
13030 \#   Normally, TOC does not append the author(s) to a toc doc title
13031 \#   entry.  This special macro instructs TOC to do so.
13032 \#
13033 \#   If user has multiple authors for each doc when collating,
13034 \#   TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
13035 \#   COLLATE and START in each doc.  Otherwise, mom prints only the
13036 \#   first author given to AUTHOR.
13037 \#
13038 .MAC TOC_APPENDS_AUTHOR END
13039 .    nr #TOC_AUTHORS 1
13040 .    if !'\\$1'' \{\
13041 .       ds $TOC_AUTHORS \\$1
13042 .    \}
13043 .END
13044 \#
13045 \# - for head entries
13046 \#
13047 .MAC TOC_HEAD_INDENT END
13048 .    nr #TOC_HEAD_INDENT (\\$1)
13049 .END
13050 \#
13051 \# - for subhead entries
13052 \#
13053 .MAC TOC_SUBHEAD_INDENT END
13054 .    nr #TOC_SH_INDENT (\\$1)
13055 .END
13056 \#
13057 \# - for parahead entries
13058 \#
13059 .MAC TOC_PARAHEAD_INDENT END
13060 .    nr #TOC_PH_INDENT (\\$1)
13061 .END
13062 \#
13063 \#
13064 .MAC TOC END
13065 .    if \\n[#LINENUMBERS]=1 \{\
13066 .       NUMBER_LINES OFF
13067 .       nr #LINENUMBERS 2
13068 .    \}
13069 .    if !r#PAGINATE_TOC \{ .PAGINATE_TOC \}
13070 .    nr #TOC_FIRST_PAGE 1
13071 .    if \\n[#FINIS] \{\
13072 .       if \\n[#FOOTERS_WERE_ON] \{\
13073 .          FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
13074 .       \}
13075 .    \}
13076 .    if \\n[#FOOTERS_ON]=1 \{\
13077 .       if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
13078 .       ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
13079 .       el \{ .PAGINATION OFF \}
13080 .    \}
13081 .    if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS OFF \} \" But have to turn FOOTERS off again so they don't print when FINIS was called
13082 .    COLLATE
13083 .    if \\n[#FINIS] \{\
13084 .       if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \} \" Finally, turn footers on if they were on
13085 .       rr #FOOTERS_WERE_ON
13086 .       if \\n[#PAGINATION_WAS_ON] \{\
13087 .          nr #PAGINATE 1
13088 .          rr #PAGINATION_WAS_ON
13089 .       \}
13090 .       rr #FINIS
13091 .    \}
13092 .    ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
13093 .    el \{ .PAGINATION OFF \}
13094 .    if \\n[#FOOTERS_ON]=1 \{\
13095 .       ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
13096 .       rm $HDRFTR_CENTER_OLD
13097 .       rm $HDRFTR_CENTER_NEW
13098 .    \}
13099 .    rr #COLLATED_DOC
13100 .    DOCHEADER OFF
13101 .    PAGENUMBER 1
13102 .    if \\n[#PRINT_STYLE]=1 \{\
13103 .       rr #IGNORE
13104 .       DOC_LEAD 24 ADJUST
13105 .       nr #IGNORE 1
13106 .    \}
13107 .    if \\n[#LINENUMBERS]=2 \{ .nr #LINENUMBERS 3 \}
13108 .    START
13109 .    PP
13110 .    nr #COLUMNS 0
13111 .    if \\n[#PRINT_STYLE]=2 \{\
13112 .       ie r#ADJ_TOC_LEAD \{\
13113 .          nr #NO_TRAP_RESET 1
13114 .          DOC_LEAD \\n[#TOC_LEAD]u ADJUST
13115 .          rr #NO_TRAP_RESET
13116 .       \}
13117 .       el \{ .DOC_LEAD \\n[#TOC_LEAD]u \}
13118 .    \}
13119 .    sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
13120 .    if \\n[#SLANT_ON] \{\
13121 \*[SLANTX]\c
13122 .    \}
13123 .    DOC_LINE_LENGTH \\n[#DOC_L_LENGTH]u
13124 .    QUAD \\*[$TOC_HEADER_QUAD]
13125 .    PAGENUM_STYLE \\*[$TOC_PN_STYLE]
13126 .    if \\n[#PRINT_STYLE]=1 \{\
13127 .       TYPEWRITER
13128 .    \}
13129 .    if \\n[#PRINT_STYLE]=2 \{\
13130 .       FAMILY  \\*[$TOC_HEADER_FAM]
13131 .       FT      \\*[$TOC_HEADER_FT]
13132 .       PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
13133 .    \}
13134 .    ie \\n[#PRINT_STYLE]=1 \{\
13135 .       CAPS
13136 .       UNDERLINE
13137 .       PRINT "\\*[$TOC_HEADER_STRING]"
13138 .       UNDERLINE OFF
13139 .       CAPS      OFF
13140 .    \}
13141 .    el \{\
13142 .       PRINT "\\*[$TOC_HEADER_STRING]"
13143 .    \}
13144 .    LEFT
13145 .    SP
13146 .\" In collated docs, this bit inserts the first doc's title
13147 .\" underneath the TOC header, before the TOC_ENTRIES diversion
13148 .\" gets output.
13149 .    nf
13150 .    if d$FIRST_DOC_TITLE \{\
13151 .    nr #RESTORE_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
13152 .    TOC_PADDING \\n[#FIRST_DOC_TOC_PN_PADDING]
13153 .       if \\n[#PRINT_STYLE]=2 \{\
13154 .          FAMILY  \\*[$TOC_TITLE_FAM]
13155 .          FT      \\*[$TOC_TITLE_FT]
13156 .          PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
13157 .       \}
13158 .       ie \\n[#PRINT_STYLE]=1 \{\
13159 .          PAD "\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN_TYPEWRITE]" 
13160 .       \}
13161 .       el \{\
13162 .          PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN]"
13163 .       \}
13164 .       EOL
13165 .       ST 100 L
13166 .       ST 101 R
13167 .       if \\n[#PRINT_STYLE]=2 \{\
13168 .          FAMILY  \\*[$TOC_PN_FAM]
13169 .          FT      \\*[$TOC_PN_FT]
13170 .          PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
13171 .       \}
13172 .       TAB 100
13173 .       PRINT \\*[LEADER]
13174 .       TN
13175 .       PRINT \\n[#FIRST_DOC_TITLE_PN]
13176 .       TQ
13177 .    \}
13178 .    TOC_PADDING \\n[#RESTORE_TOC_PN_PADDING]
13179 .    nf
13180 .    TOC_ENTRIES
13181 .    br
13182 .    rr #TOC
13183 .    if \\n[#LINENUMBERS]=3 \{\
13184 .       NUMBER_LINES RESUME
13185 .       nr #LINENUMBERS 1
13186 .       nn 1
13187 .    \}
13188 .END
13189 \#
13190 \# ====================================================================
13191 \#
13192 \# +++COLUMNS+++
13193 \#
13194 \# COLUMNS
13195 \# -------
13196 \# *Arguments:
13197 \#   <number of columns>  <width of gutters>
13198 \# *Function:
13199 \#   Creates registers associated with setting docs in columns.
13200 \#   Calculates column line lengths and offsets
13201 \# *Notes:
13202 \#   COLUMNS, if used, s/b the last macro invoked before START.
13203 \#
13204 .MAC COLUMNS END
13205 .    if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
13206 .    nr #COLUMNS 1
13207 .    nr #NUM_COLS \\$1
13208 .    nr #GUTTER (\\$2)
13209 .    nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
13210 .    nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
13211 .    nr #COL_NUM 0 1
13212 .    while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13213 .       nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
13214 .       nr #COL_TOTAL \\n+[#COL_TOTAL]
13215 .\}
13216 .    if \\n[#NUM_COLS]=1 \{\
13217 .       if !\\n[#COLLATE]=1 \{ .MN_INIT \}
13218 .    \}
13219 .    rr #COL_TOTAL
13220 .    rr #COL_NUM
13221 .END
13222 \#
13223 \#
13224 \# NEXT COLUMN
13225 \# -----------
13226 \# *Arguments:
13227 \#   <none>
13228 \# *Function:
13229 \#   Breaks current column and moves to next column.
13230 \#   If current column is the last on the page, breaks
13231 \#   to a new page.
13232 \#
13233 .MAC COL_NEXT END
13234 .    if \\n[#COLUMNS] \{\
13235 .       nr #COL_NEXT 1
13236 .       ie '\\$0'COL_NEXT' \{ .br  \}
13237 .       el \{\
13238 .          brp
13239 .          RLD 1v
13240 .       \}
13241 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13242 .          bp
13243 .       \}
13244 .       el \{ .FOOTER \}
13245 .    \}
13246 .END
13247 \#
13248 \# ====================================================================
13249 \#
13250 \# +++LISTS+++
13251 \#
13252 \# LIST
13253 \# ----
13254 \# *Arguments:
13255 \#   [ BULLET | DASH | DIGIT | alpha | ALPHA | roman | ROMAN | USER ] [ <separator> | NONE ] [ <prefix> ] [ <anything> ]
13256 \# *Function:
13257 \#   Stores indent information in effect prior to invocation and
13258 \#   initializes a list with the supplied enumerator (and separator).
13259 \# *Notes:
13260 \#   Default enumerator is a bullet.
13261 \#
13262 \#   Enumerator *must* be supplied for every list that's to the
13263 \#   right of another list, every time, unless the default bullet is
13264 \#   desired.
13265 \#
13266 \#   <anything> moves back one list level intuitively, or exits lists
13267 \#   completely if the level in which it's invoked is the first.
13268 \#
13269 .MAC LIST END
13270 .    ds $1ST_LETTER \\$1
13271 .    substring $1ST_LETTER 0 0
13272 .    if '\\*[$1ST_LETTER]'r' .ds $1ST_LETTER R
13273 .    ie '\\*[$1ST_LETTER]'R' \{\
13274 .       ds $LAST_CHAR \\$1
13275 .       substring $LAST_CHAR -1
13276 .       if !\B'\\*[$LAST_CHAR]' \{\
13277 .          tm1 "[mom]: You must append a number to the \\$1 argument to LIST at line \\n(.c.
13278 .          tm1 "       The number should be the total number of items in this list.
13279 .          tm1 "       See the documentation.
13280 .          ab Aborting LIST
13281 .       \}
13282 .       ds $ROMAN_WIDTH \\$1
13283 .          substring $ROMAN_WIDTH 1
13284 .       while !\B'\\*[$ROMAN_WIDTH]' \{\
13285 .          substring $ROMAN_WIDTH 1
13286 .\}
13287 .       length #ROMAN_LENGTH \\*[$ROMAN_WIDTH]
13288 .       ds $LIST_ARG_1 \\$1
13289 .       substring $LIST_ARG_1 0 -(\\n[#ROMAN_LENGTH]+1)
13290 .    \}
13291 .    el \{\
13292 .       ds $LIST_ARG_1 \\$1
13293 .    \}
13294 .    if !r#DEPTH \{\
13295 .       nr #STORED_HL_INDENT \\n[#HL_INDENT]
13296 .       nr #STORED_T_INDENT  \\n[#T_INDENT]
13297 .       nr #CURRENT_L_LENGTH \\n(.l
13298 .       nr #DEPTH 0 1
13299 .       if \\n[#INDENT_ACTIVE]=1 \{\
13300 .          if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
13301 .             nr #STORED_L_INDENT \\n[#L_INDENT]
13302 .             nr #RESTORE_PREV_INDENT 1
13303 .          \}
13304 .          if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
13305 .             nr #STORED_BL_INDENT \\n[#BL_INDENT]
13306 .             nr #STORED_BR_INDENT \\n[#BR_INDENT]
13307 .             IBX
13308 .             nr #ORIG_L_LENGTH \\n(.l
13309 .             IB
13310 .             nr #RESTORE_PREV_INDENT 2
13311 .          \}
13312 .          if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
13313 .             nr #STORED_R_INDENT \\n[#R_INDENT]
13314 .             IRX
13315 .             nr #ORIG_L_LENGTH \\n(.l
13316 .             IR
13317 .             nr #RESTORE_PREV_INDENT 3
13318 .             if \\n[#INDENT_LEFT_ACTIVE]=1 \{ .nr #RESTORE_PREV_INDENT 4 \}
13319 .          \}
13320 .       \}
13321 .    \}
13322 .    if \\n[#NUM_ARGS]=0 \{\
13323 .       nr #ARGS_TO_LIST 1 \" So default behaves as if LIST BULLET
13324 .       ds $ENUMERATOR\\n+[#DEPTH] \(bu
13325 .       ds $ENUMERATOR_TYPE\\n[#DEPTH] other
13326 .       ds $SEPARATOR
13327 .    \}
13328 .    if \\n[#NUM_ARGS]>0 \{\
13329 .       rr #ARGS_TO_LIST \" Clear this before processing arg 1.
13330 .       if '\\*[$LIST_ARG_1]'DASH'   \{\
13331 .          nr #ARGS_TO_LIST 1
13332 .          ds $ENUMERATOR\\n+[#DEPTH] \(en
13333 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] other
13334 .          ds $SEPARATOR\\n[#DEPTH]
13335 .       \}
13336 .       if '\\*[$LIST_ARG_1]'BULLET' \{\
13337 .          nr #ARGS_TO_LIST 1
13338 .          ds $ENUMERATOR\\n+[#DEPTH] \(bu
13339 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] other
13340 .          ds $SEPARATOR\\n[#DEPTH]
13341 .       \}
13342 .       if '\\*[$LIST_ARG_1]'DIGIT'  \{\
13343 .          nr #ARGS_TO_LIST 1
13344 .          nr #ENUMERATOR\\n+[#DEPTH] 0 1
13345 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] register
13346 .          ds $SEPARATOR\\n[#DEPTH] .
13347 .          ds $PREFIX\\n[#DEPTH]
13348 .          if \\n[#NUM_ARGS]>=2 \{\
13349 .             ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
13350 .             el             .ds $SEPARATOR\\n[#DEPTH] \\$2
13351 .             if \\n[#NUM_ARGS]=3 \{\
13352 .                ds $PREFIX\\n[#DEPTH] \\$3
13353 .             \}
13354 .          \}
13355 .       \}
13356 .       if '\\*[$LIST_ARG_1]'alpha'  \{\
13357 .          nr #ARGS_TO_LIST 1
13358 .          nr #ENUMERATOR\\n+[#DEPTH] 0 1
13359 .          af #ENUMERATOR\\n[#DEPTH] a
13360 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] register
13361 .          ds $SEPARATOR\\n[#DEPTH] )
13362 .          ds $PREFIX\\n[#DEPTH]
13363 .          if \\n[#NUM_ARGS]>=2 \{\
13364 .             ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
13365 .             el             .ds $SEPARATOR\\n[#DEPTH] \\$2
13366 .             if \\n[#NUM_ARGS]=3 \{\
13367 .                ds $PREFIX\\n[#DEPTH] \\$3
13368 .             \}
13369 .          \}
13370 .       \}
13371 .       if '\\*[$LIST_ARG_1]'ALPHA'  \{\
13372 .          nr #ARGS_TO_LIST 1
13373 .          nr #ENUMERATOR\\n+[#DEPTH] 0 1
13374 .          af #ENUMERATOR\\n[#DEPTH] A
13375 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] register
13376 .          ds $SEPARATOR\\n[#DEPTH] )
13377 .          ds $PREFIX\\n[#DEPTH]
13378 .          if \\n[#NUM_ARGS]>=2 \{\
13379 .             ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
13380 .             el             .ds $SEPARATOR\\n[#DEPTH] \\$2
13381 .             if \\n[#NUM_ARGS]=3 \{\
13382 .                ds $PREFIX\\n[#DEPTH] \\$3
13383 .             \}
13384 .          \}
13385 .       \}
13386 .       if '\\*[$1ST_LETTER]'R'  \{\
13387 .          nr #ARGS_TO_LIST 1
13388 .          nr #ENUMERATOR\\n+[#DEPTH] 0 1
13389 .          if '\\*[$LIST_ARG_1]'roman' \{\
13390 .             af #ENUMERATOR\\n[#DEPTH] i
13391 .          \}
13392 .          if '\\*[$LIST_ARG_1]'ROMAN' \{\
13393 .             af #ENUMERATOR\\n[#DEPTH] I
13394 .          \}
13395 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] roman
13396 .          ds $SEPARATOR\\n[#DEPTH] )
13397 .          ds $PREFIX\\n[#DEPTH]
13398 .          if \\n[#NUM_ARGS]>=2 \{\
13399 .             ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
13400 .             el             .ds $SEPARATOR\\n[#DEPTH] \\$2
13401 .             if \\n[#NUM_ARGS]=3 \{\
13402 .                ds $PREFIX\\n[#DEPTH] \\$3
13403 .             \}
13404 .          \}
13405 .       \}
13406 .       if '\\*[$LIST_ARG_1]'USER'   \{\
13407 .          nr #ARGS_TO_LIST 1
13408 .          ds $ENUMERATOR\\n+[#DEPTH] \\$2
13409 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] other
13410 .          ds $SEPARATOR\\n[#DEPTH]
13411 .          ds $PREFIX\\n[#DEPTH]
13412 .       \}
13413 .       if \\n[#NUM_ARGS]=1 \{\
13414 .          if !r#ARGS_TO_LIST \{\
13415 .             ie \\n[#DEPTH]=1 \{\
13416 .                ie \\n[#NEXT_DEPTH_BACK]=0 \{\
13417 .                   SET_LIST_INDENT
13418 .                   if \\n[#QUIT]=1 \{\
13419 .                      QUIT_LISTS
13420 .                      return
13421 .                   \}
13422 .                   return
13423 .                \}
13424 .                el \{\
13425 .                   QUIT_LISTS
13426 .                   return
13427 .                \} 
13428 .             \}
13429 .             el \{\
13430 .                SET_LIST_INDENT
13431 .                return
13432 .             \}
13433 .          \}
13434 .       \}
13435 .    \}
13436 .    nr #TOTAL_LISTS \\n[#DEPTH]
13437 .    if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
13438 .       nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]m\\*[$SEPARATOR\\n[#DEPTH]]\ '
13439 .       if '\\*[$LIST_ARG_1]'ALPHA'\{\
13440 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]M\\*[$SEPARATOR\\n[#DEPTH]]\ '
13441 .       \}
13442 .    \}
13443 .    if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
13444 .       GET_ROMAN_INDENT
13445 .    \}
13446 .    if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \{\
13447 .       nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$ENUMERATOR\\n[#DEPTH]]\0'
13448 .    \}
13449 .    LL \\n[#CURRENT_L_LENGTH]u
13450 .    ie \\n[#DEPTH]=1 \{\
13451 .       ie \\n[#INDENT_ACTIVE]=1 \{\
13452 .          if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
13453 .             nr #L_INDENT \\n[#L_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
13454 .             nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
13455 .             nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
13456 .          \}
13457 .          if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
13458 .             nr #L_INDENT \\n[#BL_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
13459 .             nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
13460 .             nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
13461 .          \}
13462 .          if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
13463 .             ie \\n[#INDENT_LEFT_ACTIVE]=1 \{\
13464 .             \" Don't do anything; we already have a left indent
13465 .             \}
13466 .             el \{\
13467 .                nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
13468 .                nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
13469 .             \}
13470 .          \}
13471 .       \}
13472 .       el \{\
13473 .          nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
13474 .          nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
13475 .       \}
13476 .    \}
13477 .    el \{\
13478 .       nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
13479 .       nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
13480 .    \}
13481 .END
13482 \#
13483 \#
13484 \# ITEM
13485 \# ----
13486 \# *Arguments:
13487 \#   none
13488 \# *Function:
13489 \#   Prints enumerator for a given list depth and prepares mom to
13490 \#   receive the text of an item.
13491 \#
13492 .MAC ITEM END
13493 .    if \\n[#LINENUMBERS]=1 \{\
13494 .       NUMBER_LINES OFF
13495 .       nr #LINENUMBERS 2
13496 .    \}
13497 .    if \\n[#KERN]=1 \{\
13498 .       nr #KERN_WAS_ON 1
13499 .       KERN OFF
13500 .    \}
13501 .    IL 
13502 .    ll \\n[#CURRENT_L_LENGTH]u \" Set ll again because IL turns IB off.
13503 .    TRAP OFF
13504 .    HI \\n[#HL_INDENT\\n[#DEPTH]]u
13505 .    if '\\*[$SEPARATOR\\n[#DEPTH]]')' \{ .nr #SEP_TYPE 1 \}
13506 .    if '\\*[$SEPARATOR\\n[#DEPTH]]']' \{ .nr #SEP_TYPE 1 \}
13507 .    if '\\*[$SEPARATOR\\n[#DEPTH]]'}' \{ .nr #SEP_TYPE 1 \}
13508 .    ie \\n[#IN_BIB_LIST]=1 \{\
13509 .       ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
13510 .          ie \\n[#SEP_TYPE]=1 \{\
13511 .             PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13512 .          \}
13513 .          el \{\
13514 .             PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13515 .          \}
13516 .       \}
13517 .       el \{\
13518 .          ie \\n[#SEP_TYPE]=1 \{\
13519 .             PRINT \h'-\w'\0'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13520 .          \}
13521 .          el \{\
13522 .             PRINT \h'-\w'\0'u'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13523 .          \}
13524 .       \}
13525 .    \}
13526 .    el \{\
13527 .       ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
13528 .\" DIGIT
13529 .          ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
13530 .             ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
13531 .                ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
13532 .                   ie \\n[#SEP_TYPE]=1 \{\
13533 .                      PRINT \0\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13534 .                   \}
13535 .                   el \{\
13536 .                      PRINT \0\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13537 .                   \}
13538 .                \}
13539 .                el \{\
13540 .                   ie \\n[#SEP_TYPE]=1 \{\
13541 .                      PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13542 .                   \}
13543 .                   el \{\
13544 .                      PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13545 .                   \}
13546 .                \}
13547 .             \}
13548 .             el \{\
13549 .                ie \\n[#SEP_TYPE]=1 \{\
13550 .                   PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13551 .                \}
13552 .                el \{\
13553 .                   PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13554 .                \}
13555 .             \}
13556 .          \}
13557 .          el \{\
13558 .\" ALPHA
13559 .             ie '\\g[#ENUMERATOR\\n[#DEPTH]]'A' \{\
13560 .                ie \\n[#SEP_TYPE]=1 \{\
13561 .                   PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13562 .                \}
13563 .                el \{\
13564 .                   PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13565 .                \}
13566 .             \}
13567 .\" alpha
13568 .             el \{\
13569 .                PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13570 .             \}
13571 .          \}
13572 .       \}
13573 .    \}
13574 .    el \{\
13575 .       if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
13576 .          ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
13577 .\" ROMAN I, padded
13578 .             ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
13579 .                ie \\n[#SEP_TYPE]=1 \{\
13580 .                   PRINT "\h'\\n[#LIST_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\n[#SEPARATOR\\n[#DEPTH]]\ 'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13581 .                \}
13582 .                el \{\
13583 .                   PRINT "\h'\\n[#LIST_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\n[#SEPARATOR\\n[#DEPTH]]\ 'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13584 .                \}
13585 .             \}
13586 .\" roman i, padded
13587 .             el \{\
13588 .                PRINT "\h'\\n[#LIST_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\n[#SEPARATOR\\n[#DEPTH]]\ 'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13589 .             \}
13590 .          \}
13591 .\" No pad
13592 .          el \{\
13593 .\" ROMAN I, no pad
13594 .             ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
13595 .                ie \\n[#SEP_TYPE]=1 \{\
13596 .                   PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13597 .                \}
13598 .                el \{\
13599 .                   PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13600 .                \}
13601 .             \}
13602 .\" roman i, no pad
13603 .             el \{\
13604 .                PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13605 .             \}
13606 .          \}
13607 .       \}
13608 .       if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \{\
13609 .          PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13610 .       \}
13611 .    \}
13612 .    rr #SEP_TYPE
13613 .    EOL
13614 .    if \\n[#REF]=1 \{\
13615 .       IL +\\*[$REF_BIB_INDENT]
13616 .       ti \\n[#L_INDENT]u-\\*[$REF_BIB_INDENT]
13617 .    \}
13618 .    TRAP
13619 .    if \\n[#KERN_WAS_ON]=1 \{\
13620 .       KERN
13621 .       rr #KERN_WAS_ON
13622 .    \}
13623 .    if \\n[#LINENUMBERS]=2 \{\
13624 .       NUMBER_LINES RESUME
13625 .       nr #LINENUMBERS 1
13626 .    \}
13627 .END
13628 \#
13629 \# A utility macro that determines the space to reserve for
13630 \# roman numeral enumerated lists.  Limit is 20 roman numerals
13631 \# per list.  If this isn't enough, the user can add to the
13632 \# macro.
13633 \#
13634 .MAC GET_ROMAN_INDENT END
13635 .    if '\\*[$LIST_ARG_1]'roman' \{\
13636 .       if '\\*[$ROMAN_WIDTH]'1'  \{\
13637 .          ds $ROMAN_WIDTH\\n[#DEPTH] 1
13638 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]i\\*[$SEPARATOR\\n[#DEPTH]]\0'
13639 .       \}
13640 .       if '\\*[$ROMAN_WIDTH]'2'  \{\
13641 .          ds $ROMAN_WIDTH\\n[#DEPTH] 2
13642 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]ii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13643 .       \}
13644 .       if '\\*[$ROMAN_WIDTH]'3'  \{\
13645 .          ds $ROMAN_WIDTH\\n[#DEPTH] 3
13646 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13647 .       \}
13648 .       if '\\*[$ROMAN_WIDTH]'4'  \{\
13649 .          ds $ROMAN_WIDTH\\n[#DEPTH] 4
13650 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13651 .       \}
13652 .       if '\\*[$ROMAN_WIDTH]'5'  \{\
13653 .          ds $ROMAN_WIDTH\\n[#DEPTH] 5
13654 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13655 .       \}
13656 .       if '\\*[$ROMAN_WIDTH]'6'  \{\
13657 .          ds $ROMAN_WIDTH\\n[#DEPTH] 6
13658 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13659 .       \}
13660 .       if '\\*[$ROMAN_WIDTH]'7'  \{\
13661 .          ds $ROMAN_WIDTH\\n[#DEPTH] 7
13662 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]vii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13663 .       \}
13664 .       if '\\*[$ROMAN_WIDTH]'8'  \{\
13665 .          ds $ROMAN_WIDTH\\n[#DEPTH] 8
13666 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13667 .       \}
13668 .       if '\\*[$ROMAN_WIDTH]'9'  \{\
13669 .          ds $ROMAN_WIDTH\\n[#DEPTH] 9
13670 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13671 .       \}
13672 .       if '\\*[$ROMAN_WIDTH]'10'  \{\
13673 .          ds $ROMAN_WIDTH\\n[#DEPTH] 10
13674 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13675 .       \}
13676 .       if '\\*[$ROMAN_WIDTH]'11'  \{\
13677 .          ds $ROMAN_WIDTH\\n[#DEPTH] 11
13678 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13679 .       \}
13680 .       if '\\*[$ROMAN_WIDTH]'12'  \{\
13681 .          ds $ROMAN_WIDTH\\n[#DEPTH] 12
13682 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13683 .       \}
13684 .       if '\\*[$ROMAN_WIDTH]'13'  \{\
13685 .          ds $ROMAN_WIDTH\\n[#DEPTH] 13
13686 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13687 .       \}
13688 .       if '\\*[$ROMAN_WIDTH]'14'  \{\
13689 .          ds $ROMAN_WIDTH\\n[#DEPTH] 14
13690 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13691 .       \}
13692 .       if '\\*[$ROMAN_WIDTH]'15'  \{\
13693 .          ds $ROMAN_WIDTH\\n[#DEPTH] 15
13694 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13695 .       \}
13696 .       if '\\*[$ROMAN_WIDTH]'16'  \{\
13697 .          ds $ROMAN_WIDTH\\n[#DEPTH] 16
13698 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13699 .       \}
13700 .       if '\\*[$ROMAN_WIDTH]'17'  \{\
13701 .          ds $ROMAN_WIDTH\\n[#DEPTH] 17
13702 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xvii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13703 .       \}
13704 .       if '\\*[$ROMAN_WIDTH]'18'  \{\
13705 .          ds $ROMAN_WIDTH\\n[#DEPTH] 18
13706 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13707 .       \}
13708 .       if '\\*[$ROMAN_WIDTH]'19'  \{\
13709 .          ds $ROMAN_WIDTH\\n[#DEPTH] 19
13710 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13711 .       \}
13712 .       if '\\*[$ROMAN_WIDTH]'20'  \{\
13713 .          ds $ROMAN_WIDTH\\n[#DEPTH] 20
13714 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13715 .       \}
13716 .    \}
13717 .    if '\\*[$LIST_ARG_1]'ROMAN' \{\
13718 .       if '\\*[$ROMAN_WIDTH]'1'  \{\
13719 .          ds $ROMAN_WIDTH\\n[#DEPTH] 1
13720 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]I\\*[$SEPARATOR\\n[#DEPTH]]\0'
13721 .       \}
13722 .       if '\\*[$ROMAN_WIDTH]'2'  \{\
13723 .          ds $ROMAN_WIDTH\\n[#DEPTH] 2
13724 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]II\\*[$SEPARATOR\\n[#DEPTH]]\0'
13725 .       \}
13726 .       if '\\*[$ROMAN_WIDTH]'3'  \{\
13727 .          ds $ROMAN_WIDTH\\n[#DEPTH] 3
13728 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]III\\*[$SEPARATOR\\n[#DEPTH]]\0'
13729 .       \}
13730 .       if '\\*[$ROMAN_WIDTH]'4'  \{\
13731 .          ds $ROMAN_WIDTH\\n[#DEPTH] 4
13732 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13733 .       \}
13734 .       if '\\*[$ROMAN_WIDTH]'5'  \{\
13735 .          ds $ROMAN_WIDTH\\n[#DEPTH] 5
13736 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13737 .       \}
13738 .       if '\\*[$ROMAN_WIDTH]'6'  \{\
13739 .          ds $ROMAN_WIDTH\\n[#DEPTH] 6
13740 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13741 .       \}
13742 .       if '\\*[$ROMAN_WIDTH]'7'  \{\
13743 .          ds $ROMAN_WIDTH\\n[#DEPTH] 7
13744 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13745 .       \}
13746 .       if '\\*[$ROMAN_WIDTH]'8'  \{\
13747 .          ds $ROMAN_WIDTH\\n[#DEPTH] 8
13748 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13749 .       \}
13750 .       if '\\*[$ROMAN_WIDTH]'9'  \{\
13751 .          ds $ROMAN_WIDTH\\n[#DEPTH] 9
13752 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13753 .       \}
13754 .       if '\\*[$ROMAN_WIDTH]'10'  \{\
13755 .          ds $ROMAN_WIDTH\\n[#DEPTH] 10
13756 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13757 .       \}
13758 .       if '\\*[$ROMAN_WIDTH]'11'  \{\
13759 .          ds $ROMAN_WIDTH\\n[#DEPTH] 11
13760 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13761 .       \}
13762 .       if '\\*[$ROMAN_WIDTH]'12'  \{\
13763 .          ds $ROMAN_WIDTH\\n[#DEPTH] 12
13764 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13765 .       \}
13766 .       if '\\*[$ROMAN_WIDTH]'13'  \{\
13767 .          ds $ROMAN_WIDTH\\n[#DEPTH] 13
13768 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13769 .       \}
13770 .       if '\\*[$ROMAN_WIDTH]'14'  \{\
13771 .          ds $ROMAN_WIDTH\\n[#DEPTH] 14
13772 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13773 .       \}
13774 .       if '\\*[$ROMAN_WIDTH]'15'  \{\
13775 .          ds $ROMAN_WIDTH\\n[#DEPTH] 15
13776 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13777 .       \}
13778 .       if '\\*[$ROMAN_WIDTH]'16'  \{\
13779 .          ds $ROMAN_WIDTH\\n[#DEPTH] 16
13780 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13781 .       \}
13782 .       if '\\*[$ROMAN_WIDTH]'17'  \{\
13783 .          ds $ROMAN_WIDTH\\n[#DEPTH] 17
13784 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13785 .       \}
13786 .       if '\\*[$ROMAN_WIDTH]'18'  \{\
13787 .          ds $ROMAN_WIDTH\\n[#DEPTH] 18
13788 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13789 .       \}
13790 .       if '\\*[$ROMAN_WIDTH]'19'  \{\
13791 .          ds $ROMAN_WIDTH\\n[#DEPTH] 19
13792 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13793 .       \}
13794 .       if '\\*[$ROMAN_WIDTH]'20'  \{\
13795 .          ds $ROMAN_WIDTH\\n[#DEPTH] 20
13796 .          nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13797 .       \}
13798 .    \}
13799 .END
13800 \#
13801 \# SHIFT LIST
13802 \# ----------
13803 \# *Arguments:
13804 \#   <amount by which to indent a list to the right>
13805 \# *Function:
13806 \#   Adds the value of the arg to the current list's indent.
13807 \# *Notes:
13808 \#   Requires a unit of measure.
13809 \#
13810 .MAC SHIFT_LIST END
13811 .    ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
13812 .       nr #SHIFT_LIST\\n[#DEPTH] (\\$1)
13813 .       nr #LIST_INDENT\\n[#DEPTH] \\n(.i+\\n[#L_INDENT]+\\n[#SHIFT_LIST\\n[#DEPTH]]
13814 .       nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]
13815 .    \}
13816 .    el \{\
13817 .       nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]+(\\$1)
13818 .       nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]
13819 .    \}
13820 .END
13821 \#
13822 \#
13823 \# PAD LIST DIGITS
13824 \# ---------------
13825 \# *Arguments:
13826 \#   [ LEFT ]
13827 \# *Function:
13828 \#   Adds a figure space to a list's hanging and left indent.  If
13829 \#   LEFT is given, sets reg. #PAD_LIST_DIGITS to 1 for use in ITEM.
13830 \#
13831 .MAC PAD_LIST_DIGITS END
13832 .    if '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
13833 .       nr #LIST_INDENT\\n[#DEPTH] +\\w'\\0'
13834 .       nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#LIST_INDENT\\n-[#DEPTH]]
13835 .       nr #HL_INDENT\\n+[#DEPTH] +\\w'\\n[#ENUMERATOR\\n[#DEPTH]]'
13836 .       if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
13837 .    \}
13838 .    if '\\g[#ENUMERATOR\\n[#DEPTH]]'i' \{\
13839 .       if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
13840 .    \}
13841 .    if '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
13842 .       if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
13843 .    \}
13844 .END
13845 \#
13846 \#
13847 \# RESET LIST
13848 \# ----------
13849 \# *Arguments:
13850 \#   none
13851 \# *Function:
13852 \#   Resets register enumerators to 1 or a.
13853 \#
13854 .MAC RESET_LIST END
13855 .    ie '\\$1'' \{ .nr #ENUMERATOR\\n[#DEPTH] 0 1 \}
13856 .    el \{ .nr #ENUMERATOR\\n[#DEPTH] \\$1-1 1 \}
13857 .END
13858 \#
13859 \#
13860 \# QUIT LISTS
13861 \# ----------
13862 \# *Arguments:
13863 \#   none
13864 \# *Function:
13865 \#   Exits lists cleanly and restores any indents that were in
13866 \#   effect prior to LIST.
13867 \#
13868 .MAC QUIT_LISTS END
13869 .   IQ CLEAR
13870 .   nr #HL_INDENT \\n[#STORED_HL_INDENT]
13871 .   nr #T_INDENT  \\n[#STORED_T_INDENT]
13872 .   rr #STORED_HL_INDENT
13873 .   if \\n[#RESTORE_PREV_INDENT]=1 \{\
13874 .      nr #L_INDENT  \\n[#STORED_L_INDENT]
13875 .      IL
13876 .      rr #STORED_L_INDENT
13877 .   \}
13878 .   if \\n[#RESTORE_PREV_INDENT]=2 \{\
13879 .      nr #BL_INDENT \\n[#STORED_BL_INDENT]
13880 .      nr #BR_INDENT \\n[#STORED_BR_INDENT]
13881 .      LL \\n[#ORIG_L_LENGTH]u
13882 .      IB
13883 .      rr #STORED_BL_INDENT
13884 .      rr #STORED_BR_INDENT
13885 .   \}
13886 .   if \\n[#RESTORE_PREV_INDENT]=3 \{\
13887 .      nr #R_INDENT \\n[#STORED_R_INDENT]
13888 .      LL \\n[#ORIG_L_LENGTH]u
13889 .      IR
13890 .      rr #STORED_R_INDENT
13891 .   \}
13892 .   if \\n[#RESTORE_PREV_INDENT]=4 \{\
13893 .      nr #R_INDENT \\n[#STORED_R_INDENT]
13894 .      nr #L_INDENT \\n[#STORED_L_INDENT]
13895 .      LL \\n[#ORIG_L_LENGTH]u
13896 .      IR
13897 .      IL
13898 .      rr #STORED_R_INDENT
13899 .      rr #STORED_L_INDENT
13900 .   \}
13901 .\" Clean up after exiting last depth of list
13902 .   nr #REMOVE 0 1
13903 .   while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\
13904 .      rr #LIST_INDENT\\n[#REMOVE]
13905 .      rr #ENUMERATOR\\n[#REMOVE]
13906 .      rm $ENUMERATOR\\n[#REMOVE]
13907 .      rr #SEPARATOR\\n[#REMOVE]
13908 .      rm $ENUMERATOR_TYPE\\n[#REMOVE]
13909 .      rr #PAD_LIST_DIGITS\\n[#REMOVE]
13910 .\}
13911 .   rr #REMOVE
13912 .   rr #TOTAL_LISTS
13913 .   rr #QUIT
13914 .   rr #DEPTH
13915 .   rr #NEXT_DEPTH_BACK
13916 .   rr #RESTORE_PREV_INDENT
13917 .   rr #ORIG_L_LENGTH
13918 .   rr #CURRENT_L_LENGTH
13919 .END
13920 \#
13921 \#
13922 \# SET LIST INDENT
13923 \# ---------------
13924 \# *Arguments:
13925 \#   none
13926 \# *Function:
13927 \#   Restores indent of prev. list in nested lists.  Also sets the
13928 \#   #QUIT register if an invocation of LIST OFF applies to the first
13929 \#   level of list.
13930 \#
13931 .MAC SET_LIST_INDENT END
13932 .    nr #NEXT_DEPTH_BACK \\n[#DEPTH]-1
13933 .    if \\n[#NEXT_DEPTH_BACK]=0 \{\
13934 .       nr #QUIT 1
13935 .       return
13936 .    \}
13937 .    nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]]
13938 .    nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]]
13939 .END
13940 \#
13941 \# ====================================================================
13942 \#
13943 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
13944 \#
13945 \# COLLATE
13946 \# -------
13947 \# *Arguments:
13948 \#   <none>
13949 \# *Function:
13950 \#   Turns headers off (if on) and saves header state, sets register
13951 \#   #COLLATE to 1 (toggle), and breaks to a new page.
13952 \# *Notes:
13953 \#   COLLATE exists primarily to allow putting multiple chapters in
13954 \#   a single file, although it can be used for any document type.  After
13955 \#   COLLATE, any of the macros that normally precede START may be
13956 \#   used, and should behave as expected.
13957 \#
13958 \#   N.B.--the START macro *must* be used after COLLATE (and any other
13959 \#   macros that alter mom's behaviour).
13960 \#
13961 .MAC COLLATE END
13962 .    nr #COLLATE 1
13963 .    nr #HEADER_STATE \\n[#HEADERS_ON]
13964 .    HEADERS OFF
13965 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
13966 .       nr #PAGINATION_STATE \\n[#PAGINATE]
13967 .       PAGINATION OFF
13968 .    \}
13969 .    IQ CLEAR
13970 .    TQ
13971 .\" Collect first doc's title for TOC
13972 .    if \\n[#COLLATED_DOC]=0 \{\
13973 .       ie \\n[#USER_SET_TITLE_ITEM] \{\
13974 .          ds $FIRST_DOC_TITLE \\*[$USER_SET_TITLE_ITEM]\\|
13975 .          rr #USER_SET_TITLE_ITEM
13976 .          rm $USER_SET_TITLE_ITEM
13977 .       \}
13978 .       el \{\
13979 .          ie \\n[#DOC_TYPE]=2 \{\
13980 .             ie '\\*[$CHAPTER_TITLE]'' \{\
13981 .                ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
13982 .             \}
13983 .             el \{\
13984 .                ie '\\*[$CHAPTER]'' \{\
13985 .                   ds $FIRST_DOC_TITLE \\*[$CHAPTER_TITLE]\\|
13986 .                \}
13987 .                el \{\
13988 .                   ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
13989 .                \}
13990 .             \}
13991 .          \}
13992 .          el \{\
13993 .             ds $FIRST_DOC_TITLE \\*[$TITLE]\\|
13994 .          \}
13995 .       \}
13996 .       if \\n[#TOC_AUTHORS]=1 \{\
13997 .          ie '\\*[$TOC_AUTHORS]'' \{\
13998 .             as $FIRST_DOC_TITLE /\\|\\*[$AUTHOR_1]\\|
13999 .          \}
14000 .          el \{\
14001 .             as $FIRST_DOC_TITLE /\\|\\*[$TOC_AUTHORS]\\|
14002 .             rm $TOC_AUTHORS
14003 .          \}
14004 .       \}
14005 .       nr #COLLATED_DOC 1
14006 .    \}
14007 .\" End title collection for TOC
14008 .    LL \\n[#DOC_L_LENGTH]u
14009 .    QUAD $DOC_QUAD
14010 .    nr #SAVED_DOC_LEAD \\n[#DOC_LEAD]
14011 .    LS \\n[#DOC_LEAD]u
14012 \*[SLANTX]
14013 \*[CONDX]
14014 \*[EXTX]
14015 '    NEWPAGE
14016 .    if \\n[#DEFER_PAGINATION] \{ .PAGINATE \}
14017 .    if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
14018 .       PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
14019 .       rm $RESTORE_PAGENUM_STYLE
14020 .    \}
14021 .    rm $EN_TITLE
14022 .    rr #PAGENUM_STYLE_SET
14023 .END
14024 \#
14025 \#
14026 \# NUMBER_LINES
14027 \# ------------
14028 \# *Arguments:
14029 \#   <starting line number> [ <increment> [ <gutter> ] ]
14030 \#   or
14031 \#   <anything> | RESUME
14032 \# *Function:
14033 \#   Begin, suspend/turn off, or resume numbering of output lines.
14034 \#
14035 .MAC NUMBER_LINES END
14036 .    br
14037 .    if '\\n(.z'EPI_TEXT' \{ .return \}
14038 .    if '\\$1'' \{\
14039 .       tm1 "[mom]: NUMBER_LINES at line \\n(.c has no argument.
14040 .       tm1 "       Most likely, you have forgotten to give it a starting line number.
14041 .       ab Aborting on NUMBER_LINES.
14042 .    \}
14043 .    if !\\n[#LINENUMBERS]=2 \{ .nr #LINENUMBERS 1 \}
14044 .\" Test whether the first arg is a digit.
14045 .    if \B'\\$1' \{\
14046 .       nr #LN \\$1
14047 .       ds $LN_NUM \\$1
14048 .       if !'\\n(.z'' \{ .nr #RESTORE_LN_NUM 1 \}
14049 .       ie '\\$2'' \{\
14050 .          if '\\*[$LN_INC]'' .ds $LN_INC 1
14051 .       \}
14052 .       el .ds $LN_INC \\$2
14053 .       ie '\\$3'' \{\
14054 .          if '\\*[$LN_GUTTER]'' .ds $LN_GUTTER 2
14055 .       \}
14056 .       el .ds $LN_GUTTER \\$3
14057 .    \}
14058 .    ie !\\n[#LN] \{\
14059 .\" In other words, the first arg was not a digit.
14060 .       rr #LN
14061 .       ie '\\$1'RESUME' \{\
14062 .          nm +0
14063 .       \}
14064 .       el \{\
14065 .          nm
14066 .          if !\\n[#LINENUMBERS]=2 \{ .rr #LINENUMBERS \}
14067 .       \}
14068 .    \}
14069 .    el \{\
14070 .       nm \\*[$LN_NUM] \\*[$LN_INC] \\*[$LN_GUTTER] -3-\\*[$LN_GUTTER]
14071 .       if !'\\n(.z'' \{ .nr #DIVER_LN_OFF 1 \}
14072 .    \}
14073 .    rr #LN
14074 .END
14075 \#
14076 \#
14077 \# NUMBER QUOTE AND BLOCKQUOTE LINES AS PART OF RUNNING TEXT
14078 \# ---------------------------------------------------------
14079 \# *Argument:
14080 \#   <gutter> | <anything>
14081 \# *Function:
14082 \#   Sets #(B)QUOTE_LN to 1 if no argument, or a single numeric
14083 \#   argument, is given; otherwise, turns (BLOCK)QUOTE linenumbering
14084 \#   off.
14085 \# *Notes:
14086 \#   #(B)QUOTE is checked for in QUOTE and BLOCKQUOTE.
14087 \#   The single numeric argument allows establishing a different gutter from
14088 \#   the one used for line numbers in running text.
14089 \#
14090 .MAC NUMBER_QUOTE_LINES END
14091 .    ie \\n[#NUM_ARGS]=0 \{ .nr #QUOTE_LN 1 \}
14092 .    el \{\
14093 .       ie \B'\\$1' \{\
14094 .          nr #QUOTE_LN 1
14095 .          ds $Q_LN_GUTTER \\$1
14096 .       \}
14097 .       el \{\
14098 .          ie '\\$1'SILENT' \{ .nr #SILENT_QUOTE_LN 1 \}
14099 .          el \{\
14100 .             rr #QUOTE_LN
14101 .             rr #SILENT_QUOTE_LN
14102 .          \}
14103 .       \}
14104 .    \}
14105 .END
14106 \#
14107 \#
14108 .MAC NUMBER_BLOCKQUOTE_LINES END
14109 .    ie \\n[#NUM_ARGS]=0 \{ .nr #BQUOTE_LN 1 \}
14110 .    el \{\
14111 .       ie \B'\\$1' \{\
14112 .          nr #BQUOTE_LN 1
14113 .          ds $BQ_LN_GUTTER \\$1
14114 .       \}
14115 .       el \{\
14116 .          ie '\\$1'SILENT' \{ .nr #SILENT_BQUOTE_LN 1 \}
14117 .          el \{\
14118 .             rr #BQUOTE_LN
14119 .             rr #SILENT_BQUOTE_LN
14120 .          \}
14121 .       \}
14122 .    \}
14123 .END
14124 \#
14125 \# OUTPUT BLANK PAGES
14126 \# ------------------
14127 \# *Argument:
14128 \#   <number of blank pages to output>
14129 \# *Function:
14130 \#   Outputs blank pages.
14131 \# *Notes:
14132 \#   If recto/verso, each page is recto/verso, even if there's
14133 \#   nothing on it.
14134 \#
14135 \#   The argument to BLANKPAGE is non-optional.
14136 \#
14137 .MAC BLANKPAGE END
14138 .    nr #HOW_MANY \\$1
14139 .    nr #PAGES 0 1
14140 .    while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
14141 .       if \\n[#HEADERS_ON]=1 \{\
14142 .          nr #HEADERS_WERE_ON 1
14143 .          HEADERS OFF
14144 .       \}
14145 .       if \\n[#PAGE_NUM_V_POS]=1 \{\
14146 .          if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
14147 .          PAGINATION OFF
14148 .       \}
14149 .       NEWPAGE
14150 .       PRINT \&
14151 .       if \\n[#FOOTERS_ON]=1 \{\
14152 .          nr #FOOTERS_WERE_ON 1
14153 .          FOOTERS OFF
14154 .       \}
14155 .       if \\n[#PAGE_NUM_V_POS]=2 \{\
14156 .          if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
14157 .          PAGINATION OFF
14158 .       \}
14159 .       if \\n[#HEADERS_WERE_ON] \{ .HEADERS \}
14160 .       if \\n[#PAGE_NUM_V_POS]=1 \{\
14161 .          if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
14162 .       \}
14163 .\}
14164 .    NEWPAGE
14165 .    if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \}
14166 .    if \\n[#PAGE_NUM_V_POS]=2 \{\
14167 .       if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
14168 .    \}
14169 .    rr #HEADERS_WERE_ON
14170 .    rr #FOOTERS_WERE_ON
14171 .    rr #PAGINATE_WAS_ON
14172 .END
14173 \#
14174 \#
14175 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
14176 \# ---------------------------------------
14177 \# *Arguments:
14178 \#   <none>
14179 \# *Function:
14180 \#   Sets header/footer/footnotes/etc... traps.
14181 \#
14182 \#   Calculates the number of lines that actually fit on a
14183 \#   page based on #B_MARGIN and resets page bottom trap to coincide
14184 \#   with the depth of that number of lines, or, if #ADJ_DOC_LEAD=1,
14185 \#   adjusts #DOC_LEAD so that the last line of text on a page falls
14186 \#   exactly on #B_MARGIN.
14187 \#
14188 .MAC TRAPS END
14189 .\" Remove all header/footer traps
14190 .    if !\\n[#NO_TRAP_RESET] \{\
14191 .       ch DO_T_MARGIN
14192 .       ch DO_B_MARGIN
14193 .       ch HEADER
14194 .       ch FOOTER
14195 .       ch FN_OVERFLOW_TRAP
14196 .\" Plant header trap
14197 .       wh 0 HEADER
14198 .    \}
14199 .\" Adjust lead so last line of text falls on B_MARGIN,...
14200 .    ie \\n[#ADJ_DOC_LEAD]=1 \{\
14201 .       nr #LINES_PER_PAGE 0 1
14202 .       nr #DOC_LEAD_ADJ 0 1
14203 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#ORIGINAL_B_MARGIN]-1v
14204 .\" Get the number of unadjusted lines that fit on the page; always a
14205 .\" bit short of the bottom margin
14206 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
14207 .
14208 .\}
14209 .       nr #LINES_PER_PAGE -1
14210 .\" Add machine units, 1 at a time, increasing the leading until the 
14211 .\" new leading fills the page properly
14212 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
14213 .
14214 .\}
14215 .       DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
14216 .\" The "visual" bottom margin is what \n(nl would report on the
14217 .\" last line before the FOOTER trap is sprung
14218 .       nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD])
14219 .\" Get the difference between #B_MARGIN and #VISUAL_B_MARGIN
14220 .       nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
14221 .\" Set #B_MARGIN to 1 machine unit lower on the page than #VISUAL_B_MARGIN
14222 .       nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
14223 .\" Set the FN_OVERFLOW_TRAP position
14224 .       nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
14225 .       if \\n[#PRINT_STYLE]=1 .nr #FN_OVERFLOW_TRAP_POS \\n[#ORIGINAL_B_MARGIN]u
14226 .    \}
14227 .\" ...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
14228 .\" on the page.
14229 .    el \{\
14230 .       nr #LINES_PER_PAGE 0 1
14231 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
14232 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
14233 .
14234 .\}
14235 .       nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD]-1v)
14236 .       nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
14237 .       nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
14238 .       nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
14239 .    \}
14240 .\" Set footer and footnote overflow traps
14241 .    if !\\n[#NO_TRAP_RESET] \{\
14242 .       nr #FN_COUNT 0 1
14243 .       nr #SPACE_REMAINING 0
14244 .       nr #FN_DEPTH 0
14245 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
14246 .       wh 20i FOOTER
14247 .       wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
14248 .       ch FOOTER -\\n[#B_MARGIN]u
14249 .    \}
14250 .END
14251 \#
14252 \#
14253 \# CHECK INDENT
14254 \# ------------
14255 \# *Arguments:
14256 \#   <none>
14257 \# *Function:
14258 \#   Adds left, right, or both indent values to document elements
14259 \#   like heads and subheads that are processed in environments.
14260 \#
14261 .MAC CHECK_INDENT END
14262 .    if \\n[#INDENT_LEFT_ACTIVE] \{\
14263 .       in \\n[#L_INDENT]u
14264 .       if \\n[#QUOTE] \{\
14265 .          in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
14266 .          ll -\\n[#L_INDENT]u
14267 .          ta \\n(.lu
14268 .       \}
14269 .       if \\n[#EPIGRAPH] \{\
14270 .          in -\\n[#L_INDENT]u
14271 .          ll -\\n[#L_INDENT]u
14272 .          ta \\n(.lu
14273 .       \}
14274 .    \}
14275 .    if \\n[#INDENT_RIGHT_ACTIVE] \{\
14276 .       ll -\\n[#R_INDENT]u
14277 .       ta \\n(.lu
14278 .    \}
14279 .    if \\n[#INDENT_BOTH_ACTIVE] \{\
14280 .       in \\n[#BL_INDENT]u
14281 .       ll -\\n[#BR_INDENT]u
14282 .       ta \\n(.lu
14283 .       if \\n[#QUOTE] \{\
14284 .          in -\\n[#BL_INDENT]u
14285 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
14286 .             ll -\\n[#BR_INDENT]u
14287 .             ta \\n(.lu
14288 .          \}
14289 .          el \{\
14290 .             ll -(\\n[#BR_INDENT]u/2u)
14291 .             ta \\n(.lu
14292 .          \}
14293 .       \}
14294 .       if \\n[#EPIGRAPH] \{\
14295 .          in -\\n[#BL_INDENT]u
14296 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
14297 .             ll -\\n[#BR_INDENT]u
14298 .             ta \\n(.lu
14299 .          \}
14300 .          el \{\
14301 .             ll -(\\n[#BR_INDENT]u/2u)
14302 .             ta \\n(.lu
14303 .          \}
14304 .       \}
14305 .    \}
14306 .END
14307 \#
14308 \#
14309 \# REMOVE INDENT
14310 \# -------------
14311 \# *Arguments:
14312 \#   <none>
14313 \# *Function:
14314 \#   Removes left, right, or both indent values from document elements
14315 \#   like heads and subheads that are processed in environments.
14316 \#
14317 .MAC REMOVE_INDENT END
14318 .    in 0
14319 .    ll \\n[#L_LENGTH]u
14320 .    ta \\n(.lu
14321 .END
14322 \#
14323 \#
14324 \# This .em (for all DOC_TYPEs except 4 [LETTER]) ensures that
14325 \# deferred footnotes that happen on the 2nd to last page get
14326 \# output.
14327 \#
14328 .MAC TERMINATE END
14329 .    ie \\n[#FN_DEPTH] \{\
14330 .       ie \\n[#FN_DEFER] \{\
14331 .          br
14332 .          nr #TERMINATE 1
14333 .          FOOTNOTE
14334 .          nf
14335 .          FOOTNOTE OFF
14336 .       \}
14337 .       el \{\
14338 .          br
14339 .          ch FN_OVERFLOW_TRAP
14340 .          DO_B_MARGIN
14341 .       \}
14342 .    \}
14343 .    el \{\
14344 .       br
14345 .       ch FN_OVERFLOW_TRAP
14346 .       DO_B_MARGIN
14347 .    \}
14348 .END
14349 \#
14350 \# END MACRO FOR LETTERS
14351 \# ---------------------
14352 \# *Arguments:
14353 \#   none
14354 \# *Function:
14355 \#   The .em macro executed at the end of letters.  Turns footers
14356 \#   and pagination off, terminates and outputs diversion CLOSING
14357 \#   (indented with the author's name underneath).
14358 \#
14359 .MAC ALL_DONE END
14360 .    br
14361 .    FOOTERS OFF
14362 .    PAGINATION OFF
14363 .    if \\n[#DOC_TYPE]=4 \{\
14364 .       br
14365 .       if !'\\n(.z'' \{ .di \}
14366 .       IQ CLEAR
14367 .       TQ
14368 .       TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
14369 .       ALD \\n[#DOC_LEAD]u*2u
14370 .       TAB 1
14371 .       if \\n[#CLOSING] \{\
14372 .          nf
14373 .          CLOSING
14374 .       \}
14375 .       ALD \\n[#DOC_LEAD]u*3u
14376 .       PRINT \\*[$AUTHOR_1]
14377 .    \}
14378 .    DO_FOOTER
14379 .END
14380 \#
14381 \# Set up a default papersize of US letter
14382 \#
14383 .PAPER LETTER
14384 \#
14385 \# ====================================================================
14386 \#
14387 \# +++DOCUMENT PROCESSING ALIASES+++
14388 \#
14389 \# Aliases to make life easier for users: synonyms, short forms
14390 \# and alternate spellings.
14391 \#
14392 .ALIAS   BREAK_BLOCKQUOTE    BREAK_QUOTE
14393 .ALIAS   BREAK_CITATION      BREAK_QUOTE
14394 .ALIAS   BREAK_CITE          BREAK_QUOTE
14395 .ALIAS   BLOCKQUOTE_INDENT   QUOTE_INDENT
14396 .ALIAS   CITATION            BLOCKQUOTE
14397 .ALIAS   CITATION_FAMILY     BLOCKQUOTE_FAMILY
14398 .ALIAS   CITATION_FONT       BLOCKQUOTE_FONT
14399 .ALIAS   CITATION_SIZE       BLOCKQUOTE_SIZE
14400 .ALIAS   CITATION_COLOR      BLOCKQUOTE_COLOR
14401 .ALIAS   CITATION_QUAD       BLOCKQUOTE_QUAD
14402 .ALIAS   CITE                BLOCKQUOTE
14403 .ALIAS   CITE_FAMILY         BLOCKQUOTE_FAMILY
14404 .ALIAS   CITE_FONT           BLOCKQUOTE_FONT
14405 .ALIAS   CITE_SIZE           BLOCKQUOTE_SIZE
14406 .ALIAS   CITE_COLOR          BLOCKQUOTE_COLOR
14407 .ALIAS   CITE_QUAD           BLOCKQUOTE_QUAD
14408 .ALIAS   DOC_R_MARGIN        DOC_RIGHT_MARGIN
14409 .ALIAS   DOC_L_MARGIN        DOC_LEFT_MARGIN
14410 .ALIAS   DOC_L_LENGTH        DOC_LINE_LENGTH
14411 .ALIAS   DOC_RMARGIN         DOC_RIGHT_MARGIN
14412 .ALIAS   DOC_LMARGIN         DOC_LEFT_MARGIN
14413 .ALIAS   DOC_LLENGTH         DOC_LINE_LENGTH
14414 .ALIAS   DOC_FAM             DOC_FAMILY
14415 .ALIAS   DOC_LS              DOC_LEAD
14416 .ALIAS   DOC_PS              DOC_PT_SIZE
14417 .ALIAS   FILL                QUAD
14418 .ALIAS   PAGENUM             PAGENUMBER
14419 .ALIAS   PAGINATION          PAGINATE
14420 .ALIAS   PP_FT               PP_FONT
14421 .ALIAS   REF_INDENT          INDENT_REFS
14422 .ALIAS   TOC_PS              TOC_PT_SIZE
14423 \#
14424 \# HEADER and FOOTER macros
14425 \# ------------------------
14426 \# Because the type-style of headers and footers are managed
14427 \# identically, and the type-style macros (_<type parameter>) all
14428 \# require the correct name of the calling macro, it's necessary
14429 \# to create HEADER_ and FOOTER_ macros here.  They're basically
14430 \# "aliases" of HDRFTR_, but required because you can't alias an
14431 \# alias.
14432 \#
14433 .MAC FOOTER_CENTER_COLOR END
14434 .    HDRFTR_CENTER_COLOR \\$1
14435 .END
14436 \#
14437 .MAC FOOTER_CENTER_COLOUR END
14438 .    HDRFTR_CENTER_COLOR \\$1
14439 .END
14440 \#
14441 .MAC FOOTER_CENTER_FAM END
14442 .    HDRFTR_CENTER_FAMILY \\$1
14443 .END
14444 \#
14445 .MAC FOOTER_CENTER_FAMILY END
14446 .    HDRFTR_CENTER_FAMILY \\$1
14447 .END
14448 \#
14449 .MAC FOOTER_CENTER_FONT END
14450 .    HDRFTR_CENTER_FONT \\$1
14451 .END
14452 \#
14453 .MAC FOOTER_CENTER_FT END
14454 .    HDRFTR_CENTER_FONT \\$1
14455 .END
14456 \#
14457 .MAC FOOTER_CENTER_PS END
14458 .    HDRFTR_CENTER_SIZE \\$1
14459 .END
14460 \#
14461 .MAC FOOTER_CENTER_SIZE END
14462 .    HDRFTR_CENTER_SIZE \\$1
14463 .END
14464 \#
14465 .MAC FOOTER_CENTRE_CAPS END
14466 .    HDRFTR_CENTER_CAPS \\$1
14467 .END
14468 \#
14469 .MAC FOOTER_CENTRE_COLOR END
14470 .    HDRFTR_CENTRE_COLOR \\$1
14471 .END
14472 \#
14473 .MAC FOOTER_CENTRE_COLOUR END
14474 .    HDRFTR_CENTRE_COLOR \\$1
14475 .END
14476 \#
14477 .MAC FOOTER_CENTRE_FAM END
14478 .    HDRFTR_CENTER_FAMILY \\$1
14479 .END
14480 \#
14481 .MAC FOOTER_CENTRE_FAMILY END
14482 .    HDRFTR_CENTER_FAMILY \\$1
14483 .END
14484 \#
14485 .MAC FOOTER_CENTRE_FONT END
14486 .    HDRFTR_CENTER_FONT \\$1
14487 .END
14488 \#
14489 .MAC FOOTER_CENTRE_FT END
14490 .    HDRFTR_CENTER_FONT \\$1
14491 .END
14492 \#
14493 .MAC FOOTER_CENTRE_PS END
14494 .    HDRFTR_CENTER_SIZE \\$1
14495 .END
14496 \#
14497 .MAC FOOTER_CENTRE_SIZE END
14498 .    HDRFTR_CENTER_SIZE \\$1
14499 .END
14500 \#
14501 .MAC FOOTER_COLOR END
14502 .    HDRFTR_COLOR \\$1
14503 .END
14504 \#
14505 .MAC FOOTER_COLOUR END
14506 .    HDRFTR_COLOR \\$1
14507 .END
14508 \#
14509 .MAC FOOTER_FAM END
14510 .    HDRFTR_FAMILY \\$1
14511 .END
14512 \#
14513 .MAC FOOTER_FAMILY END
14514 .    HDRFTR_FAMILY \\$1
14515 .END
14516 \#
14517 .MAC FOOTER_LEFT_COLOR END
14518 .    HDRFTR_LEFT_COLOR \\$1
14519 .END
14520 \#
14521 .MAC FOOTER_LEFT_COLOUR END
14522 .    HDRFTR_LEFT_COLOR \\$1
14523 .END
14524 \#
14525 .MAC FOOTER_LEFT_FAM END
14526 .    HDRFTR_LEFT_FAMILY \\$1
14527 .END
14528 \#
14529 .MAC FOOTER_LEFT_FAMILY END
14530 .    HDRFTR_LEFT_FAMILY \\$1
14531 .END
14532 \#
14533 .MAC FOOTER_LEFT_FONT END
14534 .    HDRFTR_LEFT_FONT \\$1
14535 .END
14536 \#
14537 .MAC FOOTER_LEFT_FT END
14538 .    HDRFTR_LEFT_FONT \\$1
14539 .END
14540 \#
14541 .MAC FOOTER_LEFT_PS END
14542 .    HDRFTR_LEFT_SIZE \\$1
14543 .END
14544 \#
14545 .MAC FOOTER_LEFT_SIZE END
14546 .    HDRFTR_LEFT_SIZE \\$1
14547 .END
14548 \#
14549 .MAC FOOTER_RIGHT_COLOR END
14550 .    HDRFTR_RIGHT_COLOR \\$1
14551 .END
14552 \#
14553 .MAC FOOTER_RIGHT_COLOUR END
14554 .    HDRFTR_RIGHT_COLOR \\$1
14555 .END
14556 \#
14557 .MAC FOOTER_RIGHT_FAM END
14558 .    HDRFTR_RIGHT_FAMILY \\$1
14559 .END
14560 \#
14561 .MAC FOOTER_RIGHT_FAMILY END
14562 .    HDRFTR_RIGHT_FAMILY \\$1
14563 .END
14564 \#
14565 .MAC FOOTER_RIGHT_FONT END
14566 .    HDRFTR_RIGHT_FONT \\$1
14567 .END
14568 \#
14569 .MAC FOOTER_RIGHT_FT END
14570 .    HDRFTR_RIGHT_FONT \\$1
14571 .END
14572 \#
14573 .MAC FOOTER_RIGHT_PS END
14574 .    HDRFTR_RIGHT_SIZE \\$1
14575 .END
14576 \#
14577 .MAC FOOTER_RIGHT_SIZE END
14578 .    HDRFTR_RIGHT_SIZE \\$1
14579 .END
14580 \#
14581 .MAC FOOTER_RULE_COLOR END
14582 .    HDRFTR_RULE_COLOR \\$1
14583 .END
14584 \#
14585 .MAC FOOTER_SIZE END
14586 .    HDRFTR_SIZE \\$1
14587 .END
14588 \#
14589 .MAC HEADER_CENTER_COLOR END
14590 .    HDRFTR_CENTER_COLOR \\$1
14591 .END
14592 \#
14593 .MAC HEADER_CENTER_COLOUR END
14594 .    HDRFTR_CENTER_COLOR \\$1
14595 .END
14596 \#
14597 .MAC HEADER_CENTER_FAM END
14598 .    HDRFTR_CENTER_FAMILY \\$1
14599 .END
14600 \#
14601 .MAC HEADER_CENTER_FAMILY END
14602 .    HDRFTR_CENTER_FAMILY \\$1
14603 .END
14604 \#
14605 .MAC HEADER_CENTER_FONT END
14606 .    HDRFTR_CENTER_FONT \\$1
14607 .END
14608 \#
14609 .MAC HEADER_CENTER_FT END
14610 .    HDRFTR_CENTER_FONT \\$1
14611 .END
14612 \#
14613 .MAC HEADER_CENTER_PS END
14614 .    HDRFTR_CENTER_SIZE \\$1
14615 .END
14616 \#
14617 .MAC HEADER_CENTER_SIZE END
14618 .    HDRFTR_CENTER_SIZE \\$1
14619 .END
14620 \#
14621 .MAC HEADER_CENTRE_COLOR END
14622 .    HDRFTR_CENTRE_COLOR \\$1
14623 .END
14624 \#
14625 .MAC HEADER_CENTRE_COLOUR END
14626 .    HDRFTR_CENTRE_COLOR \\$1
14627 .END
14628 \#
14629 .MAC HEADER_CENTRE_FAM END
14630 .    HDRFTR_CENTER_FAMILY \\$1
14631 .END
14632 \#
14633 .MAC HEADER_CENTRE_FAMILY END
14634 .    HDRFTR_CENTER_FAMILY \\$1
14635 .END
14636 \#
14637 .MAC HEADER_CENTRE_FONT END
14638 .    HDRFTR_CENTER_FONT \\$1
14639 .END
14640 \#
14641 .MAC HEADER_CENTRE_FT END
14642 .    HDRFTR_CENTER_FONT \\$1
14643 .END
14644 \#
14645 .MAC HEADER_CENTRE_PS END
14646 .    HDRFTR_CENTER_SIZE \\$1
14647 .END
14648 \#
14649 .MAC HEADER_CENTRE_SIZE END
14650 .    HDRFTR_CENTER_SIZE \\$1
14651 .END
14652 \#
14653 .MAC HEADER_COLOR END
14654 .    HDRFTR_COLOR \\$1
14655 .END
14656 \#
14657 .MAC HEADER_COLOUR END
14658 .    HDRFTR_COLOR \\$1
14659 .END
14660 \#
14661 .MAC HEADER_FAM END
14662 .    HDRFTR_FAMILY \\$1
14663 .END
14664 \#
14665 .MAC HEADER_FAMILY END
14666 .    HDRFTR_FAMILY \\$1
14667 .END
14668 \#
14669 .MAC HEADER_LEFT_COLOR END
14670 .    HDRFTR_LEFT_COLOR \\$1
14671 .END
14672 \#
14673 .MAC HEADER_LEFT_COLOUR END
14674 .    HDRFTR_LEFT_COLOR \\$1
14675 .END
14676 \#
14677 .MAC HEADER_LEFT_FAM END
14678 .    HDRFTR_LEFT_FAMILY \\$1
14679 .END
14680 \#
14681 .MAC HEADER_LEFT_FAMILY END
14682 .    HDRFTR_LEFT_FAMILY \\$1
14683 .END
14684 \#
14685 .MAC HEADER_LEFT_FONT END
14686 .    HDRFTR_LEFT_FONT \\$1
14687 .END
14688 \#
14689 .MAC HEADER_LEFT_FT END
14690 .    HDRFTR_LEFT_FONT \\$1
14691 .END
14692 \#
14693 .MAC HEADER_LEFT_PS END
14694 .    HDRFTR_LEFT_SIZE \\$1
14695 .END
14696 \#
14697 .MAC HEADER_LEFT_SIZE END
14698 .    HDRFTR_LEFT_SIZE \\$1
14699 .END
14700 \#
14701 .MAC HEADER_RIGHT_COLOR END
14702 .    HDRFTR_RIGHT_COLOR \\$1
14703 .END
14704 \#
14705 .MAC HEADER_RIGHT_COLOUR END
14706 .    HDRFTR_RIGHT_COLOR \\$1
14707 .END
14708 \#
14709 .MAC HEADER_RIGHT_FAM END
14710 .    HDRFTR_RIGHT_FAMILY \\$1
14711 .END
14712 \#
14713 .MAC HEADER_RIGHT_FAMILY END
14714 .    HDRFTR_RIGHT_FAMILY \\$1
14715 .END
14716 \#
14717 .MAC HEADER_RIGHT_FONT END
14718 .    HDRFTR_RIGHT_FONT \\$1
14719 .END
14720 \#
14721 .MAC HEADER_RIGHT_FT END
14722 .    HDRFTR_RIGHT_FONT \\$1
14723 .END
14724 \#
14725 .MAC HEADER_RIGHT_PS END
14726 .    HDRFTR_RIGHT_SIZE \\$1
14727 .END
14728 \#
14729 .MAC HEADER_RIGHT_SIZE END
14730 .    HDRFTR_RIGHT_SIZE \\$1
14731 .END
14732 \#
14733 .MAC HEADER_RULE_COLOR END
14734 .    HDRFTR_RULE_COLOR \\$1
14735 .END
14736 \#
14737 .MAC HEADER_SIZE END
14738 .    HDRFTR_SIZE \\$1
14739 .END
14740 \#
14741 \# HEADER and FOOTER aliases for HDRFTR macros.
14742 \#
14743 .ALIAS   BIBLIOGRAPHY_FOOTER_CENTER    BIBLIOGRAPHY_HDRFTR_CENTER
14744 .ALIAS   BIBLIOGRAPHY_FOOTER_CENTRE    BIBLIOGRAPHY_HDRFTR_CENTRE
14745 .ALIAS   BIBLIOGRAPHY_HEADER_CENTER    BIBLIOGRAPHY_HDRFTR_CENTER
14746 .ALIAS   BIBLIOGRAPHY_HEADER_CENTRE    BIBLIOGRAPHY_HDRFTR_CENTRE
14747 .ALIAS   ENDNOTES_FOOTER_CENTER    ENDNOTES_HDRFTR_CENTER
14748 .ALIAS   ENDNOTES_FOOTER_CENTRE    ENDNOTES_HDRFTR_CENTRE
14749 .ALIAS   ENDNOTES_HEADER_CENTER    ENDNOTES_HDRFTR_CENTER
14750 .ALIAS   ENDNOTES_HEADER_CENTRE    ENDNOTES_HDRFTR_CENTRE
14751 .ALIAS   FOOTER_CENTER_CAPS        HDRFTR_CENTER_CAPS
14752 .ALIAS   FOOTER_CENTER             HDRFTR_CENTER
14753 .ALIAS   FOOTER_CENTER_PAD         HDRFTR_CENTER_PAD
14754 .ALIAS   FOOTER_CENTRE             HDRFTR_CENTER
14755 .ALIAS   FOOTER_CENTRE_PAD         HDRFTR_CENTER_PAD
14756 .ALIAS   FOOTER_LEFT_CAPS          HDRFTR_LEFT_CAPS
14757 .ALIAS   FOOTER_LEFT               HDRFTR_LEFT
14758 .ALIAS   FOOTER_PLAIN              HDRFTR_PLAIN
14759 .ALIAS   FOOTER_RECTO              HDRFTR_RECTO
14760 .ALIAS   FOOTER_RIGHT_CAPS         HDRFTR_RIGHT_CAPS
14761 .ALIAS   FOOTER_RIGHT              HDRFTR_RIGHT
14762 .ALIAS   FOOTER_RULE_GAP           HDRFTR_RULE_GAP
14763 .ALIAS   FOOTER_RULE               HDRFTR_RULE
14764 .ALIAS   FOOTER_VERSO              HDRFTR_VERSO
14765 .ALIAS   HEADER_CENTER_CAPS        HDRFTR_CENTER_CAPS
14766 .ALIAS   HEADER_CENTER             HDRFTR_CENTER
14767 .ALIAS   HEADER_CENTER_PAD         HDRFTR_CENTER_PAD
14768 .ALIAS   HEADER_CENTRE_CAPS        HDRFTR_CENTER_CAPS
14769 .ALIAS   HEADER_CENTRE             HDRFTR_CENTER
14770 .ALIAS   HEADER_CENTRE_PAD         HDRFTR_CENTER_PAD
14771 .ALIAS   HEADER_LEFT_CAPS          HDRFTR_LEFT_CAPS
14772 .ALIAS   HEADER_LEFT               HDRFTR_LEFT
14773 .ALIAS   HEADER_PLAIN              HDRFTR_PLAIN
14774 .ALIAS   HEADER_RECTO              HDRFTR_RECTO
14775 .ALIAS   HEADER_RIGHT_CAPS         HDRFTR_RIGHT_CAPS
14776 .ALIAS   HEADER_RIGHT              HDRFTR_RIGHT
14777 .ALIAS   HEADER_RULE_GAP           HDRFTR_RULE_GAP
14778 .ALIAS   HEADER_RULE               HDRFTR_RULE
14779 .ALIAS   HEADER_VERSO              HDRFTR_VERSO
14780 .ALIAS   SWITCH_FOOTERS            SWITCH_HDRFTR
14781 .ALIAS   SWITCH_HEADERS            SWITCH_HDRFTR
14782 \#
14783 \# Type-style aliases
14784 \#
14785 .ALIAS   AUTHOR_FAMILY                    _FAMILY
14786 .ALIAS   BIBLIOGRAPHY_FAMILY              _FAMILY
14787 .ALIAS   BIBLIOGRAPHY_STRING_FAMILY       _FAMILY
14788 .ALIAS   BLOCKQUOTE_FAMILY                _FAMILY
14789 .ALIAS   CHAPTER_TITLE_FAMILY             _FAMILY
14790 .ALIAS   COVER_AUTHOR_FAMILY              _FAMILY
14791 .ALIAS   COVER_CHAPTER_TITLE_FAMILY       _FAMILY
14792 .ALIAS   COVER_COPYRIGHT_FAMILY           _FAMILY
14793 .ALIAS   COVER_DOCTYPE_FAMILY             _FAMILY
14794 .ALIAS   COVER_FAMILY                     _FAMILY
14795 .ALIAS   COVER_SUBTITLE_FAMILY            _FAMILY
14796 .ALIAS   COVER_TITLE_FAMILY               _FAMILY
14797 .ALIAS   DOC_COVER_AUTHOR_FAMILY          _FAMILY
14798 .ALIAS   DOC_COVER_CHAPTER_TITLE_FAMILY   _FAMILY
14799 .ALIAS   DOC_COVER_COPYRIGHT_FAMILY       _FAMILY
14800 .ALIAS   DOC_COVER_DOCTYPE_FAMILY         _FAMILY
14801 .ALIAS   DOC_COVER_FAMILY                 _FAMILY
14802 .ALIAS   DOC_COVER_SUBTITLE_FAMILY        _FAMILY
14803 .ALIAS   DOC_COVER_TITLE_FAMILY           _FAMILY
14804 .ALIAS   DOCHEADER_FAMILY                 _FAMILY
14805 .ALIAS   DOCTYPE_FAMILY                   _FAMILY
14806 .ALIAS   ENDNOTE_FAMILY                   _FAMILY
14807 .ALIAS   ENDNOTE_NUMBER_FAMILY            _FAMILY
14808 .ALIAS   ENDNOTE_LINENUMBER_FAMILY        _FAMILY
14809 .ALIAS   ENDNOTE_STRING_FAMILY            _FAMILY
14810 .ALIAS   ENDNOTE_TITLE_FAMILY             _FAMILY
14811 .ALIAS   EPIGRAPH_FAMILY                  _FAMILY
14812 .ALIAS   FOOTNOTE_FAMILY                  _FAMILY
14813 .ALIAS   HDRFTR_CENTER_FAMILY             _FAMILY
14814 .ALIAS   HDRFTR_FAMILY                    _FAMILY
14815 .ALIAS   HDRFTR_LEFT_FAMILY               _FAMILY
14816 .ALIAS   HDRFTR_RIGHT_FAMILY              _FAMILY
14817 .ALIAS   HEAD_FAMILY                      _FAMILY
14818 .ALIAS   PAGENUM_FAMILY                   _FAMILY
14819 .ALIAS   PARAHEAD_FAMILY                  _FAMILY
14820 .ALIAS   QUOTE_FAMILY                     _FAMILY
14821 .ALIAS   SUBHEAD_FAMILY                   _FAMILY
14822 .ALIAS   SUBTITLE_FAMILY                  _FAMILY
14823 .ALIAS   TITLE_FAMILY                     _FAMILY
14824 .ALIAS   TOC_FAM                          _FAMILY
14825 .ALIAS   TOC_FAMILY                       _FAMILY
14826 .ALIAS   TOC_HEADER_FAMILY                _FAMILY
14827 .ALIAS   TOC_HEAD_FAMILY                  _FAMILY
14828 .ALIAS   TOC_PARAHEAD_FAMILY              _FAMILY
14829 .ALIAS   TOC_PN_FAMILY                    _FAMILY
14830 .ALIAS   TOC_SUBHEAD_FAMILY               _FAMILY
14831 .ALIAS   TOC_TITLE_FAMILY                 _FAMILY
14832 \#
14833 .ALIAS   AUTHOR_FONT                    _FONT
14834 .ALIAS   BIBLIOGRAPHY_STRING_FONT       _FONT
14835 .ALIAS   BIBLIOGRAPHY_FONT              _FONT
14836 .ALIAS   BLOCKQUOTE_FONT                _FONT
14837 .ALIAS   CHAPTER_TITLE_FONT             _FONT
14838 .ALIAS   COVER_AUTHOR_FONT              _FONT
14839 .ALIAS   COVER_CHAPTER_TITLE_FONT       _FONT
14840 .ALIAS   COVER_COPYRIGHT_FONT           _FONT
14841 .ALIAS   COVER_DOCTYPE_FONT             _FONT
14842 .ALIAS   COVER_SUBTITLE_FONT            _FONT
14843 .ALIAS   COVER_TITLE_FONT               _FONT
14844 .ALIAS   DOC_COVER_AUTHOR_FONT          _FONT
14845 .ALIAS   DOC_COVER_CHAPTER_TITLE_FONT   _FONT
14846 .ALIAS   DOC_COVER_COPYRIGHT_FONT       _FONT
14847 .ALIAS   DOC_COVER_DOCTYPE_FONT         _FONT
14848 .ALIAS   DOC_COVER_SUBTITLE_FONT        _FONT
14849 .ALIAS   DOC_COVER_TITLE_FONT           _FONT
14850 .ALIAS   DOCTYPE_FONT                   _FONT
14851 .ALIAS   ENDNOTE_FONT                   _FONT
14852 .ALIAS   ENDNOTE_NUMBER_FONT            _FONT
14853 .ALIAS   ENDNOTE_LINENUMBER_FONT        _FONT
14854 .ALIAS   ENDNOTE_STRING_FONT            _FONT
14855 .ALIAS   ENDNOTE_TITLE_FONT             _FONT
14856 .ALIAS   EPIGRAPH_FONT                  _FONT
14857 .ALIAS   FOOTNOTE_FONT                  _FONT
14858 .ALIAS   HDRFTR_CENTER_FONT             _FONT
14859 .ALIAS   HDRFTR_LEFT_FONT               _FONT
14860 .ALIAS   HDRFTR_RIGHT_FONT              _FONT
14861 .ALIAS   HEAD_FONT                      _FONT
14862 .ALIAS   PAGENUM_FONT                   _FONT
14863 .ALIAS   PARAHEAD_FONT                  _FONT
14864 .ALIAS   QUOTE_FONT                     _FONT
14865 .ALIAS   SUBHEAD_FONT                   _FONT
14866 .ALIAS   SUBTITLE_FONT                  _FONT
14867 .ALIAS   TITLE_FONT                     _FONT
14868 .ALIAS   TOC_HEADER_FONT                _FONT
14869 .ALIAS   TOC_HEAD_FONT                  _FONT
14870 .ALIAS   TOC_PARAHEAD_FONT              _FONT
14871 .ALIAS   TOC_PN_FONT                    _FONT
14872 .ALIAS   TOC_SUBHEAD_FONT               _FONT
14873 .ALIAS   TOC_TITLE_FONT                 _FONT
14874 \#
14875 .ALIAS   AUTHOR_SIZE                    _SIZE
14876 .ALIAS   BIBLIOGRAPHY_STRING_SIZE       _SIZE
14877 .ALIAS   BLOCKQUOTE_SIZE                _SIZE
14878 .ALIAS   CHAPTER_TITLE_SIZE             _SIZE
14879 .ALIAS   COVER_AUTHOR_SIZE              _SIZE
14880 .ALIAS   COVER_CHAPTER_TITLE_SIZE       _SIZE
14881 .ALIAS   COVER_COPYRIGHT_SIZE           _SIZE
14882 .ALIAS   COVER_DOCTYPE_SIZE             _SIZE
14883 .ALIAS   COVER_SUBTITLE_SIZE            _SIZE
14884 .ALIAS   COVER_TITLE_SIZE               _SIZE
14885 .ALIAS   DOC_COVER_AUTHOR_SIZE          _SIZE
14886 .ALIAS   DOC_COVER_CHAPTER_TITLE_SIZE   _SIZE
14887 .ALIAS   DOC_COVER_COPYRIGHT_SIZE       _SIZE
14888 .ALIAS   DOC_COVER_DOCTYPE_SIZE         _SIZE
14889 .ALIAS   DOC_COVER_SUBTITLE_SIZE        _SIZE
14890 .ALIAS   DOC_COVER_TITLE_SIZE           _SIZE
14891 .ALIAS   DOCTYPE_SIZE                   _SIZE
14892 .ALIAS   ENDNOTE_NUMBER_SIZE            _SIZE
14893 .ALIAS   ENDNOTE_LINENUMBER_SIZE        _SIZE
14894 .ALIAS   ENDNOTE_STRING_SIZE            _SIZE
14895 .ALIAS   ENDNOTE_TITLE_SIZE             _SIZE
14896 .ALIAS   EPIGRAPH_SIZE                  _SIZE
14897 .ALIAS   FOOTNOTE_SIZE                  _SIZE
14898 .ALIAS   HDRFTR_CENTER_SIZE             _SIZE
14899 .ALIAS   HDRFTR_LEFT_SIZE               _SIZE
14900 .ALIAS   HDRFTR_RIGHT_SIZE              _SIZE
14901 .ALIAS   HDRFTR_SIZE                    _SIZE
14902 .ALIAS   HEAD_SIZE                      _SIZE
14903 .ALIAS   PAGENUM_SIZE                   _SIZE
14904 .ALIAS   PARAHEAD_SIZE                  _SIZE
14905 .ALIAS   QUOTE_SIZE                     _SIZE
14906 .ALIAS   SUBHEAD_SIZE                   _SIZE
14907 .ALIAS   SUBTITLE_SIZE                  _SIZE
14908 .ALIAS   TITLE_SIZE                     _SIZE
14909 .ALIAS   TOC_HEADER_SIZE                _SIZE
14910 .ALIAS   TOC_HEAD_SIZE                  _SIZE
14911 .ALIAS   TOC_PARAHEAD_SIZE              _SIZE
14912 .ALIAS   TOC_PN_SIZE                    _SIZE
14913 .ALIAS   TOC_SUBHEAD_SIZE               _SIZE
14914 .ALIAS   TOC_TITLE_SIZE                 _SIZE
14915 \#
14916 .ALIAS   ATTRIBUTE_COLOR                 _COLOR
14917 .ALIAS   AUTHOR_COLOR                    _COLOR
14918 .ALIAS   BLOCKQUOTE_COLOR                _COLOR
14919 .ALIAS   CHAPTER_TITLE_COLOR             _COLOR
14920 .ALIAS   COVER_ATTRIBUTE_COLOR           _COLOR
14921 .ALIAS   COVER_AUTHOR_COLOR              _COLOR
14922 .ALIAS   COVER_CHAPTER_TITLE_COLOR       _COLOR
14923 .ALIAS   COVER_COLOR                     _COLOR
14924 .ALIAS   COVER_COPYRIGHT_COLOR           _COLOR
14925 .ALIAS   COVER_DOCTYPE_COLOR             _COLOR
14926 .ALIAS   COVER_MISC_COLOR                _COLOR
14927 .ALIAS   COVER_SUBTITLE_COLOR            _COLOR
14928 .ALIAS   COVER_TITLE_COLOR               _COLOR
14929 .ALIAS   DOC_COVER_ATTRIBUTE_COLOR       _COLOR
14930 .ALIAS   DOC_COVER_AUTHOR_COLOR          _COLOR
14931 .ALIAS   DOC_COVER_CHAPTER_TITLE_COLOR   _COLOR
14932 .ALIAS   DOC_COVER_COLOR                 _COLOR
14933 .ALIAS   DOC_COVER_COPYRIGHT_COLOR       _COLOR
14934 .ALIAS   DOC_COVER_DOCTYPE_COLOR         _COLOR
14935 .ALIAS   DOC_COVER_MISC_COLOR            _COLOR
14936 .ALIAS   DOC_COVER_SUBTITLE_COLOR        _COLOR
14937 .ALIAS   DOC_COVER_TITLE_COLOR           _COLOR
14938 .ALIAS   DOCHEADER_COLOR                 _COLOR
14939 .ALIAS   DOCTYPE_COLOR                   _COLOR
14940 .ALIAS   EPIGRAPH_COLOR                  _COLOR
14941 .ALIAS   FINIS_COLOR                     _COLOR
14942 .ALIAS   FOOTNOTE_COLOR                  _COLOR
14943 .ALIAS   HDRFTR_CENTER_COLOR             _COLOR
14944 .ALIAS   HDRFTR_COLOR                    _COLOR
14945 .ALIAS   HDRFTR_LEFT_COLOR               _COLOR
14946 .ALIAS   HDRFTR_RIGHT_COLOR              _COLOR
14947 .ALIAS   HDRFTR_RULE_COLOR               _COLOR
14948 .ALIAS   HEAD_COLOR                      _COLOR
14949 .ALIAS   LINEBREAK_COLOR                 _COLOR
14950 .ALIAS   PAGENUM_COLOR                   _COLOR
14951 .ALIAS   PARAHEAD_COLOR                  _COLOR
14952 .ALIAS   QUOTE_COLOR                     _COLOR
14953 .ALIAS   SUBHEAD_COLOR                   _COLOR
14954 .ALIAS   SUBTITLE_COLOR                  _COLOR
14955 .ALIAS   TITLE_COLOR                     _COLOR
14956 \#
14957 .ALIAS   BIBLIOGRAPHY_QUAD          _QUAD
14958 .ALIAS   BIBLIOGRAPHY_STRING_QUAD   _QUAD
14959 .ALIAS   BLOCKQUOTE_QUAD            _QUAD
14960 .ALIAS   COVER_COPYRIGHT_QUAD       _QUAD
14961 .ALIAS   COVER_MISC_QUAD            _QUAD
14962 .ALIAS   DOC_COVER_COPYRIGHT_QUAD   _QUAD
14963 .ALIAS   DOC_COVER_MISC_QUAD        _QUAD
14964 .ALIAS   DOC_QUAD                   _QUAD
14965 .ALIAS   ENDNOTE_QUAD               _QUAD
14966 .ALIAS   ENDNOTE_STRING_QUAD        _QUAD
14967 .ALIAS   ENDNOTE_TITLE_QUAD         _QUAD
14968 .ALIAS   EPIGRAPH_QUAD              _QUAD
14969 .ALIAS   FOOTNOTE_QUAD              _QUAD
14970 .ALIAS   HEAD_QUAD                  _QUAD
14971 .ALIAS   SUBHEAD_QUAD               _QUAD
14972 .ALIAS   TOC_HEADER_QUAD            _QUAD
14973 \#
14974 \# Support aliases
14975 \#
14976 .ALIAS   COL_BREAK             COL_NEXT
14977 .ALIAS   DOC_COVER_ADVANCE     COVER_ADVANCE 
14978 .ALIAS   DOC_COVER             COVER
14979 .ALIAS   DOC_COVERS            COVERS
14980 .ALIAS   DOC_COVER_LEAD        COVER_LEAD
14981 .ALIAS   DOC_COVERTITLE        COVERTITLE
14982 .ALIAS   DO_DOC_COVER          DO_COVER
14983 .ALIAS   PRINT_FOOTNOTE_RULE   FOOTNOTE_RULE
14984 \#
14985 \# Miscellaneous aliases
14986 .ALIAS  SECTION       LINEBREAK
14987 .ALIAS  SECTION_CHAR  LINEBREAK_CHAR
14988 \#
14989 \# Miscellaneous macros to take care of backward compatibility
14990 \# -----------------------------------------------------------
14991 \#
14992 \# As of 1.1.9, EL and TN got changed to make TRAP...TRAP OFF
14993 \# unnecessary for users.  However, I used both macros extensively
14994 \# throughout this file (in conjunction with TRAP...TRAP OFF).
14995 \# EOL is the "old" EL, for the personal use of om.tmac
14996 \#
14997 .MAC EOL END
14998 .    br
14999 .    sp -1v
15000 .END
15001 \#
15002 \# REFER SUPPORT
15003 \# -------------
15004 \#
15005 \# Footnote references
15006 \# -------------------
15007 \# *Function:
15008 \#   Instruct REF to put references in footnotes.
15009 \#
15010 .MAC FOOTNOTE_REFS END
15011 .    if r#EN_REF \{ .rr #EN_REF \}
15012 .    nr #FN_REF 1
15013 .END
15014 \#
15015 \# Endnote references
15016 \# ------------------
15017 \# *Function:
15018 \#   Instruct REF to collect references for endnotes output.
15019 \#
15020 .MAC ENDNOTE_REFS END
15021 .    if r#FN_REF \{ .rr #FN_REF \}
15022 .    nr #EN_REF 1
15023 .END
15024 \#
15025 \# Prepare mom for a reference
15026 \# ---------------------------
15027 \# *Argument:
15028 \#   <none> | INDENT  L|LEFT|R|RIGHT|B|BOTH  <indent value>
15029 \# *Function:
15030 \#   Calls FOOTNOTE or ENDNOTE, depending on whether #REF_FN or
15031 \#   #REF_EN is set to 1.
15032 \# *Notes:
15033 \#   For convenience, REF is a toggle.
15034 \#
15035 \#   REF optionally takes the same arguments as FOOTNOTE, allowing
15036 \#   users to indent references that go in footnotes when footnote
15037 \#   indenting is required.  FOOTNOTE_REFS must be on for this.
15038 \#
15039 .MAC REF END
15040 .    ie \\n[#FN_REF]+\\n[#EN_REF]=0 \{\
15041 .       if !\\n[#REF_WARNING]=1 \{\
15042 .          tm1 "[mom]: Before REF at line \\n(.c, neither FOOTNOTE_REFS nor ENDNOTE_REFS
15043 .          tm1 "       has been selected.  If "sort" and "accumulate" are in your refer
15044 .          tm1 "       commands, references will be collected for later output with $LIST$.
15045 .          tm1 "       Otherwise, they will disappear.
15046 .          nr #REF_WARNING 1
15047 .       \}
15048 .    \}
15049 .    el \{\
15050 .    ie \\n[#REF]=1 \{\
15051 .       if \\n[#FN_REF]=1 \{ .FOOTNOTE OFF \}
15052 .       if \\n[#EN_REF]=1 \{ .ENDNOTE OFF  \}
15053 .       rr #REF
15054 .    \}
15055 .    el \{\
15056 .       rr #REF_WARNING
15057 .       nr #REF 1
15058 .       if \\n[#FN_REF]=1 \{ .FOOTNOTE \\$1 \\$2 \\$3 \}
15059 .       if \\n[#EN_REF]=1 \{ .ENDNOTE  \}
15060 .    \}
15061 .    \}
15062 .END
15063 \#
15064 \# Embedded references in text (with brackets)
15065 \# -------------------------------------------
15066 \#
15067 .MAC REF_BRACKETS_START END
15068 .    ds $CURRENT_EV \\n[.ev]
15069 .    ev REFERENCE
15070 .    evc  \\*[$CURRENT_EV]
15071 .    di REFERENCE
15072 .END
15073 \#
15074 .MAC REF_BRACKETS_END END
15075 .    br
15076 .    di
15077 .    ev
15078 .    chop REFERENCE
15079 .    unformat REFERENCE
15080 .    if '\\$0'REF)' \{ .nop (\\*[REFERENCE]) \}
15081 .    if '\\$0'REF]' \{ .nop [\\*[REFERENCE]] \}
15082 .    if '\\$0'REF}' \{ .nop {\\*[REFERENCE]} \}
15083 .END
15084 \#
15085 \# These three pairs of aliases allow users to embed references in
15086 \# text and have them surrounded by (), [] or {}.
15087 \#
15088 .ALIAS REF( REF_BRACKETS_START
15089 .ALIAS REF) REF_BRACKETS_END
15090 \#
15091 .ALIAS REF[ REF_BRACKETS_START
15092 .ALIAS REF{ REF_BRACKETS_START
15093 \#
15094 .ALIAS REF} REF_BRACKETS_END
15095 .ALIAS REF] REF_BRACKETS_END
15096 \#
15097 \# Second-line indent for refs
15098 \# ---------------------------
15099 \# *Argument:
15100 \#   FOOTNOTE | ENDNOTE | BIBLIO <indent for 2nd and subsequent lines of discrete reference entries>
15101 \# *Function:
15102 \#   Sets strings $REF_FN_INDENT, $REF_EN_INDENT or $REF_BIB_INDENT.
15103 \# *Notes:
15104 \#   Indent value requires a unit of measure.
15105 \#
15106 .MAC INDENT_REFS END
15107 .    if '\\$1'FOOTNOTE' .ds $REF_FN_INDENT \\$2
15108 .    if '\\$1'ENDNOTE'  .ds $REF_EN_INDENT \\$2
15109 .    if '\\$1'BIBLIO'   .ds $REF_BIB_INDENT \\$2
15110 .END
15111 \#
15112 \# Hyphenation of references
15113 \# -------------------------
15114 \# *Argument:
15115 \#   <none> | <anything>
15116 \# *Function:
15117 \#   Sets register #REF_HYPHENATE
15118 \#
15119 .MAC HYPHENATE_REFS END
15120 .    ie '\\$1'' \{ .nr #REF_HYPHENATE 1 \}
15121 .    el \{\
15122 .       if r#REF_HY \{ .rr #REF_HY \}
15123 .    \}
15124 .END
15125 \#
15126 .ig
15127 The remainder of the definitions in this section are modified
15128 versions of the definitions found in the refer module of s.tmac.
15129 ..
15130 \#
15131 \# This one is directly from s.tmac.
15132 .de @error
15133 .tm \\n(.F:\\n(.c: macro error: \\$*
15134 ..
15135 \#
15136 .ig
15137 The following strings define the order of entries for different
15138 types of references.  Each letter in the string refers to a database
15139 field (A for author, T1/T2 for article and book titles, etc).
15140 Mom is set up for MLA-style bibliographies.  Other styles can be
15141 implemented here by re-ordering the fields.
15142 ..
15143 \# Book - type 2
15144 .ds ref*spec!2 Q A T1 d t l r E S e V a C I D P O
15145 \# Article within book - type 3
15146 .ds ref*spec!3 Q A T2 B d t l r E S e V a C I D P O
15147 \# Journal article - type 1
15148 .ds ref*spec!1 Q A T2 J S N D P O
15149 \# Tech report - type 4
15150 .ds ref*spec!4 Q A T1 R G C I D P O
15151 \# Internet site - type 0
15152 .ds ref*spec!0 Q A T2 s E c d o a u O
15153 \#
15154 \# Refer's "1st" macro.  Since it is possible to define database
15155 \# fields using any single letter, we remove all possible string
15156 \# definitions of the form [X and [x
15157 \#
15158 .de ]-
15159 .rm [A [B [C [D [E [F [G [H [I [J [K [L [M \
15160     [N [O [P [Q [R [S [T [U [V [W [X [Y [Z \
15161 .   [a [b [c [d [e [f [g [h [i [j [k [l [m \
15162     [n [o [p [q [r [s [t [u [v [w [x [y [z
15163 .rm ref*string
15164 .rr ref*type
15165 ..
15166 \#
15167 \# Refer's "2nd" macro; builds up a reference with ref*build, and
15168 \# prints it with ref*print.
15169 \#
15170 .de ][
15171 .nr ref*type \\$1
15172 .if \\n[ref*type]=3 \{\
15173 .   if !'\\*([R'' \{\
15174 .      nr ref*type 4
15175 .      ds ref*spec!4 Q A T2 B R C I D P O
15176 .   \}
15177 .   if !'\\*([G'' \{\
15178 .      nr ref*type 4
15179 .      ds ref*spec!4 Q A T2 B G C I D P O
15180 .   \}
15181 .\}
15182 .if r [T \{\
15183 .   als [T1 [T
15184 .   als [T2 [T
15185 .\}
15186 .ie d ref*spec!\\n[ref*type] .ref*build \\*[ref*spec!\\n[ref*type]]
15187 .el \{\
15188 .   @error unknown reference type `\\n[ref*type]'
15189 .   ref*build \\*[ref*spec!0]
15190 .\}
15191 .if !\\n[.hy]=0 \{\
15192 .nr #RESTORE_HY \\n[.hy]
15193 .if !r#REF_HY .nh
15194 .\}
15195 .ref*print
15196 .if !\\n[#RESTORE_HY]=0 .hy \\n[#RESTORE_HY]
15197 .rr #RESTORE_HY
15198 .rm ref*string
15199 .rm [F [T1 [T2
15200 ..
15201 \#
15202 \# Refer's "3rd" macros, which set up and terminate the output
15203 \# of collected references
15204 \#
15205 .de ]<
15206 .als ref*print ref*end-print
15207 .nr #REF 1
15208 .if \\n[#BIB_LIST]=1 \{\
15209 .   nr #IN_BIB_LIST 1
15210 .   LIST DIGIT \\*[$BIB_LIST_SEPARATOR] \\*[$BIB_LIST_PREFIX]
15211 .\}
15212 ..
15213 \#
15214 .de ]>
15215 .LIST OFF
15216 .rr #REF
15217 .rr #IN_BIB_LIST
15218 .als ref*print ref*normal-print
15219 ..
15220 \#
15221 \# Output
15222 \# ------
15223 \#
15224 \# Output normal, non-collected refs
15225 \#
15226 .de ref*normal-print
15227 .nr #CURRENT_HY \\n[.hy]
15228 \\*[ref*string]
15229 ..
15230 \#
15231 \# Output collected refs
15232 \#
15233 .de ref*end-print
15234 .\" 10 is abritrary
15235 .nn 10
15236 .ie \\n[#BIB_LIST]=0 \{\
15237 .in +\\*[$REF_BIB_INDENT]
15238 .ti -\\*[$REF_BIB_INDENT]
15239 .\}
15240 .el .ITEM
15241 \\*[ref*string]
15242 .sp \\n[#BIB_SPACE]u
15243 .ie \\n[#BIB_LIST]=0 .in
15244 .el .IL -\\*[$REF_BIB_INDENT]u
15245 .nn 0
15246 ..
15247 \#
15248 .als ref*print ref*normal-print
15249 \#
15250 \# Build up the ref*string
15251 \#
15252 .ig
15253 Correct MLA "typewritten" style (printstyle TYPEWRITE) demands
15254 two spaces after each period.  The spaces are hardwired into the
15255 string definitions (ref*add-<x>), so we have to make sure that there
15256 aren't two spaces when the printstyle is TYPESET.  Since I find that
15257 references look a bit crowded with 0 sentence space, I've bumped it
15258 up to +4.  User's sentence spacing is reset in FOOTNOTES and ENDNOTES.
15259 ..
15260 \#
15261 .de ref*build
15262 .if \\n[#PRINT_STYLE]=2 \{\
15263 .   ds $RESTORE_SS_VAR \\*[$SS_VAR]
15264 .   SS +4
15265 .\}
15266 .rm ref*string ref*post-punct
15267 .nr ref*suppress-period 1
15268 .while \\n[.$] \{\
15269 .   if d [\\$1 \{\
15270 .      ie d ref*add-\\$1 .ref*add-\\$1
15271 .      el .ref*add-dflt \\$1
15272 .   \}
15273 .   shift
15274 .\}
15275 .\" now add a final period
15276 .ie d ref*string \{\
15277 .   if !\\n[ref*suppress-period] .as ref*string .
15278 .   if d ref*post-punct \{\
15279 .      as ref*string "\\*[ref*post-punct]
15280 .      rm ref*post-punct
15281 .   \}
15282 .\}
15283 .el .ds ref*string
15284 ..
15285 \#
15286 \# The following macros determine how entries are formatted WRT
15287 \# punctuation, type style, additional strings, etc.
15288 \#
15289 .ig
15290 o First argument is the database field letter.
15291 o Second argument is the punctuation character to use to separate this
15292   field from the previous field.
15293 o Third argument is a string with which to prefix this field.
15294 o Fourth argument is a string with which to postfix this field.
15295 o Fifth argument is a string to add after the punctuation character
15296   supplied by the next field.
15297 ..
15298 \#
15299 \# %A Author(s)
15300 .de ref*add-A
15301 .ref*field A ,
15302 .if r [A .nr ref*suppress-period \\n([A
15303 ..
15304 \# %T Title (generic)
15305 .de ref*add-T1
15306 .ref*field T . " \E*[IT]" "" \E*[PREV]
15307 .if \\n([T .nr ref*suppress-period \\n([T
15308 ..
15309 \# %T Title of a chapter or article
15310 .de ref*add-T2
15311 .ref*field T . " \(lq" "" "\(rq"
15312 .if \\n([T .nr ref*suppress-period \\n([T
15313 ..
15314 \# %B Book title (when citing an article from a book)
15315 .de ref*add-B
15316 .ie \\n([T .ref*field B "" ".\E*[IT]" "" \E*[PREV]
15317 .el .ref*field B . " \E*[IT]" "" \E*[PREV]
15318 \# refer doesn't set reg [T to 1 for these book titles, so we do it here
15319 .ds eval*[B \\*([B
15320 .substring eval*[B -1
15321 .rr [T
15322 .if '\\*[eval*[B]'!' .nr [T 1
15323 .if '\\*[eval*[B]'?' .nr [T 1
15324 .rm eval*[B
15325 ..
15326 \# %R Report number for technical reports
15327 .de ref*add-R
15328 .ref*field R . " "
15329 ..
15330 \# %J Journal name
15331 .de ref*add-J
15332 .ie \\n([T .ref*field J "" " \E*[IT]" "" \E*[PREV]
15333 .el .ref*field J . " \E*[IT]" "" \E*[PREV]
15334 ..
15335 \# %E Editor(s)
15336 .de ref*add-E
15337 .ie !\\n[ref*type]=0 \{\
15338 .   ie \\n([E>0 \{\
15339 .      ie \\n([T .ref*field E "" " Eds. "
15340 .      el .ref*field E . " Eds. "
15341 .   \}
15342 .   el \{\
15343 .      ie \\n([T .ref*field E "" " Ed. "
15344 .      el .ref*field E . " Ed. "
15345 .   \}
15346 .\}
15347 .el \{\
15348 .   ie \\n([T .ref*field E "" " "
15349 .   el .ref*field E . " "
15350 .\}
15351 .rr [T
15352 ..
15353 \# %e Edition
15354 .de ref*add-e
15355 .ie \\n([T .ref*field e "" " " " edition"
15356 .el .ref*field e . " " " edition"
15357 .rr [T
15358 ..
15359 \# %V Volume (of a journal, or series of books)
15360 .de ref*add-V
15361 .if \\n[ref*type]=1 \{\
15362 .   ref*field V 
15363 .\}
15364 .if \\n[ref*type]=2 \{\
15365 .   ie \\n([T .ref*field V "" " "
15366 .   el .ref*field V . " "
15367 .\}
15368 .if \\n[ref*type]=3 \{\
15369 .   ie \\n([T .ref*field V "" " "
15370 .   el .ref*field V . " "
15371 .\}
15372 .rr [T
15373 ..
15374 \# %N Journal number
15375 .de ref*add-N
15376 .ref*field N 
15377 ..
15378 \# %S Series (books or journals)
15379 .de ref*add-S
15380 .if \\n[ref*type]=1 \{\
15381 .   ref*field S
15382 .\}
15383 .if \\n[ref*type]=2 \{\
15384 .   ie \\n([T .ref*field S "" " "
15385 .   el .ref*field S . " "
15386 .\}
15387 .if \\n[ref*type]=3 \{\
15388 .   ie \\n([T .ref*field S "" " "
15389 .   el .ref*field S . " "
15390 .\}
15391 .rr [T
15392 \# refer doesn't set reg [T to 1 for series titles, so we do it here
15393 .ds eval*[S \\*([S
15394 .substring eval*[S -1
15395 .if '\\*[eval*[S]'!' .nr [T 1
15396 .if '\\*[eval*[S]'?' .nr [T 1
15397 .rm eval*[S
15398 ..
15399 \# %C City
15400 .de ref*add-C
15401 .ie \\n([T .ref*field C "" " "
15402 .el .ref*field C . " "
15403 .rr [T
15404 ..
15405 \# %I Publisher (I stands for Issuer)
15406 .de ref*add-I
15407 .ie !'\\*([C'' .ref*field I :
15408 .el \{\
15409 .   ie \\n([T .ref*field I "" " "
15410 .   el .ref*field I . " "
15411 .\}
15412 .rr [T
15413 ..
15414 \# %D Date of publication
15415 .de ref*add-D
15416 .if \\n[ref*type]=1 \{\
15417 .   ie !'\\*([V''.ref*field D "" "(" ")"
15418 .   el .ref*field D
15419 .\}
15420 .if \\n[ref*type]=2 .ref*field D ,
15421 .if \\n[ref*type]=3 \{\
15422 .   ie '\\*([C'' \{\
15423 .      ie '\\*([I'' .ref*field D . " "
15424 .      el .ref*field D ,
15425 .   \}
15426 .   el .ref*field D ,
15427 .\}
15428 .if \\n[ref*type]=4 .ref*field D ,
15429 ..
15430 \# %P Page number(s)
15431 .de ref*add-P
15432 .ie \\n[ref*type]=1 .ref*field P : 
15433 .el .ref*field P . " "
15434 ..
15435 \# %G Gov't. ordering number
15436 .de ref*add-G
15437 .ref*field G . " "
15438 ..
15439 \# %O Other (usually goes at end of ref)
15440 .de ref*add-O
15441 .ref*field O . " "
15442 .ie r [O .nr ref*suppress-period \\n([O
15443 .el .nr ref*suppress-period 1
15444 ..
15445 \#
15446 .de ref*add-dflt
15447 .ref*field \\$1 ,
15448 ..
15449 \#
15450 \# Book reprints
15451 \# -------------
15452 \# %d date of publication (the orignal date of publication)
15453 .de ref*add-d
15454 .ie \\n([T .ref*field d "" " "
15455 .el .ref*field d . " "
15456 .rr [T
15457 ..
15458 \# %a additions (such as a new intro to reprints)
15459 .de ref*add-a
15460 .ie \\n([T .ref*field a "" " "
15461 .el .ref*field a . " "
15462 .rr [T
15463 ..
15464 \# %t title, if different from original title (the T field, which s/b
15465 \# the original title)
15466 .de ref*add-t
15467 .ie \\n([T .ref*field t "" " Rpt. as \E*[IT]" "" \E*[PREV]
15468 .el .ref*field t . " Rpt. as \E*[IT]" "" \E*[PREV]
15469 .rr [T
15470 ..
15471 \#
15472 \# Translated works
15473 \# ----------------
15474 \# %l Trans(l)ator
15475 .de ref*add-l
15476 .ie \\n([T .ref*field l "" " Trans. "
15477 .el .ref*field l . " Trans. "
15478 .rr [T
15479 ..
15480 \# %r Translato(r) and edito(r)
15481 .de ref*add-r
15482 .ie \\n([T .ref*field r "" " Trans. and Ed. "
15483 .el .ref*field r . " Trans. and Ed. " 
15484 .rr [T
15485 ..
15486 \#
15487 \# Internet
15488 \# --------
15489 \# %s Site name
15490 .de ref*add-s
15491 .ie \\n([s .ref*field s "" ".\E*[IT]" "" \E*[PREV]
15492 .el .ref*field s . " \E*[IT]" "" \E*[PREV]
15493 .\" refer doesn't set reg [T to 1 for these book titles, so we do it here
15494 .ds eval*[s \\*([s
15495 .substring eval*[s -1
15496 .rr [T
15497 .if '\\*[eval*[s]'!' .nr [T 1
15498 .if '\\*[eval*[s]'?' .nr [T 1
15499 .rm eval*[s
15500 ..
15501 \# %c content of site, if unclear (i.e. advertisement, cartoon,
15502 \# interview, etc.)
15503 .de ref*add-c
15504 .ie \\n([T .ref*field c "" " "
15505 .el .ref*field c . " "
15506 .rr [T
15507 ..
15508 \# %o organization, group or sponsor of site
15509 .de ref*add-o
15510 .ie \\n([T .ref*field o "" " "
15511 .el .ref*field o . " "
15512 .rr [T
15513 ..
15514 \# %a access date, i.e. the date you read it
15515 .de ref*add-a
15516 .ie \\n([T .ref*field a "" " "
15517 .el .ref*field a . " "
15518 .rr [T
15519 ..
15520 \# %u URL
15521 .de ref*add-u
15522 .ref*field u "" " <" ">"
15523 .rr [T
15524 ..
15525 \#
15526 \# Build up reference string from ref*add-<x> macros.
15527 \#
15528 .de ref*field
15529 .if d ref*string \{\
15530 .   ie d ref*post-punct \{\
15531 .      as ref*string "\\$2\\*[ref*post-punct] \"
15532 .      rm ref*post-punct
15533 .   \}
15534 .   el .as ref*string "\\$2 \"
15535 .\}
15536 .as ref*string "\\$3\\*([\\$1\\$4
15537 .if \\n[.$]>4 .ds ref*post-punct "\\$5
15538 .nr ref*suppress-period 0
15539 ..
15540 \#
15541 \# MARGIN NOTES
15542 \# ------------
15543 \# This is a wrapper for MNinit.
15544 \#
15545 \# I could use a 'while' loop to assign args to strings, but too many
15546 \# 'while' loops are slowing things down.
15547 \#
15548 .MAC MN_INIT END
15549 .    if !'\\$1'rerun' \{\
15550 .    ds $MN-arg1 \\$1
15551 .    ds $MN-arg2 \\$2
15552 .    ds $MN-arg3 \\$3
15553 .    ds $MN-arg4 \\$4
15554 .    ds $MN-arg5 \\$5
15555 .    ds $MN-arg6 \\$6
15556 .    ds $MN-arg7 \\$7
15557 .    ds $MN-arg8 \\$8
15558 .    ds $MN-arg9 \\$9
15559 .    \}
15560 .    ie \\n[#START_FOR_MNinit]=0 \{\
15561 .       nr #MNinit_DEFERRED 1
15562 .       nr #START_FOR_MNinit 1
15563 .       return
15564 .    \}
15565 .    el \{\
15566 .       MNinit \\*[$MN-arg1] \\*[$MN-arg2] \\*[$MN-arg3] \\*[$MN-arg4] \\*[$MN-arg5] \\*[$MN-arg6] \\*[$MN-arg7] \\*[$MN-arg8] \\*[$MN-arg9]
15567 .    \}
15568 .END
15569 \#
15570 .MAC MN_OVERFLOW_TRAP END
15571 .    if \\n[#OVERFLOW_LEFT]=1  \{\
15572 .       nr #no-repeat-MN-left 1
15573 .       di MN_OVERFLOW_LEFT
15574 .    \}
15575 .    if \\n[#OVERFLOW_RIGHT]=1 \{\
15576 .       nr #no-repeat-MN-right 1
15577 .       di MN_OVERFLOW_RIGHT
15578 .    \}
15579 .    rr #OVERFLOW_LEFT
15580 .    rr #OVERFLOW_RIGHT
15581 .END
15582 \#
15583 .ig
15584 The remainder of the margin notes macros and routines are adapted
15585 from Werner Lemberg's MN.tmac.
15586 ..
15587 \#
15588 \# MNinit
15589 \# ------
15590 \# Usage:
15591 \# MNinit [ragged|symmetric] \
15592 \#        left-width right-width separation \
15593 \#        font fontsize vertical-spacing \
15594 \#        color hyphenation-flags
15595 \#
15596 \# Initialize margin notes.  Empty arguments (denoted with "") set
15597 \# default values.  If the first argument is the string `ragged',
15598 \# left and right margin notes are printed ragged-right.  If it is
15599 \# `symmetric', left margin notes are printed ragged-left and right
15600 \# margin notes ragged-right.  If omitted, margin notes are left
15601 \# and right adjusted.
15602 \#
15603 \#
15604 .de MNinit
15605 .  nr #MNinit 1
15606 .  ds MN-left-ad b\"
15607 .  ds MN-right-ad b\"
15608 .  if '\\$1'RAGGED' \{\
15609 .    ds MN-left-ad l\"
15610 .    ds MN-right-ad l\"
15611 .    shift
15612 .  \}
15613 .  if '\\$1'SYMMETRIC' \{\
15614 .    ds MN-left-ad r\"
15615 .    ds MN-right-ad l\"
15616 .    shift
15617 .  \}
15618 .  ie \B'\\$3' \
15619 .    nr MN-sep (n;\\$3)
15620 .  el \
15621 .    nr MN-sep 1m
15622 .  if ((\\n[.o] - \\n[MN-sep]) < 1n) \
15623 .    ab MN: Left margin too small (<1n) for requested margin notes separation.
15624 .  ie \B'\\$1' \{\
15625 .    nr MN-left-width (n;\\$1)
15626 .    nr MN-left-start (\\n[.o] - \\n[MN-sep] - \\n[MN-left-width])
15627 .  \}
15628 .  el \{\
15629 .    nr MN-left-width (\\n[.o] - \\n[MN-sep])
15630 .    nr MN-left-start 0
15631 .  \}
15632 .  if (\\n[MN-left-start] < 0) \
15633 .    ab MN: Left margin too small for requested margin notes settings.
15634 .  if (\\n[MN-left-width] < 1n) \
15635 .    ab MN: Left margin notes width too small (<1n).
15636 .
15637 .  ie \B'\\$2' \{\
15638 .    nr MN-right-width (n;\\$2)
15639 .    nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
15640 .    if \\n[#COLUMNS]=1 \{\
15641 .      if !\\n[#NUM_COLS]=1 \{\
15642 .        nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
15643 .      \}
15644 .    \}
15645 .  \}
15646 .  el \{\
15647 .    nr MN-right-width \\n[MN-left-width]
15648 .    nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
15649 .    if \\n[#COLUMNS]=1 \{\
15650 .      if !\\n[#NUM_COLS]=1 \{\
15651 .        nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
15652 .      \}
15653 .    \}
15654 .  \}
15655 .  ie \A'\\$4' \{\
15656 .    ds MN-font \\$4\"
15657 .    if \\n[#PRINT_STYLE]=1 .ds MN-font CR
15658 .  \}
15659 .  el \{\
15660 .    ds MN-font \\*[$PP_FT]
15661 .    if \\n[#PRINT_STYLE]=1 .ds MN-font CR
15662 .  \}
15663 .  ie \B'\\$5' \{\
15664 .    ps \\$5
15665 .    nr MN-size \\n[.ps]
15666 .    ps
15667 .    if \\n[#PRINT_STYLE]=1 \{\
15668 .       ps 12
15669 .       nr MN-size \\n[.ps]
15670 .       ps
15671 .    \}
15672 .  \}
15673 .  el \{\
15674 .    nr MN-size \\n[#DOC_PT_SIZE]
15675 .  \}
15676 .  ie \B'\\$6' \{\
15677 '    vs \\$6
15678 .    nr MN-spacing \\n(.v
15679 '    vs
15680 .    if '\\$6'DOC' \{ .nr MN-spacing \\n[#DOC_LEAD] \}
15681 .    if \\n[#PRINT_STYLE]=1 \{\
15682 .       nr MN-spacing \\n[#DOC_LEAD]
15683 .    \}
15684 .  \}
15685 .  el \{\
15686 .    nr MN-spacing \\n[#DOC_LEAD]
15687 .  \}
15688 .  ie \A'\\$7' \
15689 .    if !\\n[#PRINT_STYLE]=1 .ds MN-color \\$7\"
15690 .  el \
15691 .    if !\\n[#PRINT_STYLE]=1 .ds MN-color
15692 .  ie \B'\\$8' \
15693 .    nr MN-hy \\$8
15694 .  el \
15695 .    nr MN-hy \\n[.hy]
15696 .  ev MNbottom-left-env
15697 .  if \A'\\*[MN-font]' \
15698 .    ft \\*[MN-font]
15699 .  if \\n[MN-size] \
15700 .    ps \\n[MN-size]u
15701 .  if \\n[MN-spacing] \
15702 .    vs \\n[MN-spacing]u
15703 .  ll \\n[MN-left-width]u
15704 .  ad \\*[MN-left-ad]
15705 .  hy \\n[MN-hy]
15706 '  in 0
15707 .  nop \m[\\*[MN-color]]\c
15708 .  ev
15709 .  ev MNbottom-right-env
15710 .  if \A'\\*[MN-font]' \
15711 .    ft \\*[MN-font]
15712 .  if \\n[MN-size] \
15713 .    ps \\n[MN-size]u
15714 .  if \\n[MN-spacing] \
15715 .    vs \\n[MN-spacing]u
15716 .  ll \\n[MN-right-width]u
15717 .  ad \\*[MN-right-ad]
15718 .  hy \\n[MN-hy]
15719 '  in 0
15720 .  nop \m[\\*[MN-color]]\c
15721 .  ev
15722 .  nr MN-active 0
15723 ..
15724 \# MN
15725 \# --
15726 \# Usage:
15727 \# 
15728 \#   MN LEFT|RIGHT
15729 \#   margin note text
15730 \#   MN
15731 \#
15732 \# With a parameter, start a margin note, otherwise end a margin note.
15733 \# If the parameter is the string `left', define a left margin note,
15734 \# otherwise define a right margin note.
15735 \#
15736 .de MN
15737 .ds MN-dir \\$1
15738 .if \\n[#COLUMNS]=1 \{\
15739 .  if \\n[#NUM_COLS]>2 \{\
15740 .    tm MN: More than two columns.  Ignoring margin notes.
15741 .    return
15742 .  \}
15743 .  if !\\n[#NUM_COLS]=1 \{\
15744 .    ie \\n[#COL_NUM]=1 .ds MN-dir LEFT
15745 .    el .ds MN-dir RIGHT
15746 .  \}
15747 .\}
15748 .  if !\\n[#MNinit]=1 \{\
15749 .    tm MN: You must set parameters with MN_INIT before using MN. 
15750 .    ab Aborting
15751 .  \}
15752 .  ie !'\\$1'' \{\
15753 .    if \\n[MN-active] \{\
15754 .      tm MN: Can't handle nested margin notes.
15755 .      return
15756 .    \}
15757 .    nr MN-active 1
15758 .    ev MN-env
15759 .    ie '\\*[MN-dir]'LEFT' \{\
15760 .      nr MN-left +1
15761 .      ds MN-curr l-\\n[MN-left]\"
15762 .      evc MNbottom-left-env
15763 .    \}
15764 .    el \{\
15765 .      nr MN-right +1
15766 .      ds MN-curr r-\\n[MN-right]\"
15767 .      evc MNbottom-right-env
15768 .    \}
15769 .    mk MN-mk-\\*[MN-curr]
15770 .    di MN-div-\\*[MN-curr]
15771 .  \}
15772 .  el \{\
15773 .    if \\n[MN-active] \{\
15774 .      br
15775 .      di
15776 .      nr MN-div-\\*[MN-curr]-depth \\n(dn
15777 .      ev
15778 .    \}
15779 .    nr MN-active 0
15780 .  \}
15781 ..
15782 \#
15783 \# MNtop
15784 \# -----
15785 \# Resets these registers (called in HEADER)
15786 .de MNtop
15787 .  nr MN-left 0
15788 .  nr MN-right 0
15789 .  nr MN-active 0
15790 ..
15791 \#
15792 \# MNbottom-left
15793 \# -------------
15794 \# The "left" half of Werner's original MNbottom.
15795 \#
15796 .de MNbottom-left
15797 .  nr MN-curr 0
15798 .  nr MN-last-pos 0
15799 .  nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
15800 .  vpt 0
15801 .  mk MN-curr-pos
15802 .  if \\n[MN-active] \{\
15803 .    di
15804 .    tm MN: Margin note finished by new page.  Ignored.
15805 .  \}
15806 .  po \\n[MN-left-start]u
15807 .  ev MNbottom-left-env
15808 .  nr #P \\n%+\\n[#PAGE_NUM_ADJ]
15809 .  while (\\n[MN-curr] < \\n[MN-left]) \{\
15810 .    nr MN-curr +1
15811 .    ie (\\n[MN-last-pos] < \\n[MN-mk-l-\\n[MN-curr]]) \
15812 .      sp |\\n[MN-mk-l-\\n[MN-curr]]u+\\n[MN-lead-adj]u
15813 .    el \{\
15814 .      nr MN-shifted 1
15815 .      sp 1v
15816 .      SHIM
15817 .      if \\n[#SHIM]u>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
15818 .      tm MN: Warning: Left margin note #\\n[MN-curr] on page \\n[#P] shifted down.
15819 .    \}
15820 .\" If last margin note doesn't fit
15821 .    if ( (\\n(nl+\\n[MN-div-l-\\n[MN-curr]-depth]) > (\\n(.p+\\n[#VARIABLE_FOOTER_POS]) ) \{\
15822 .      if \\n[MN-shifted]=1 \{\
15823 .        sp -(1v+\\n[#SHIM]u)
15824 .        rm MN-div-l-\\n[MN-curr]
15825 .        tm1 "[mom]: No room to start left margin note #\\n[MN-curr] on page \\n[#P] on page \\n[#P].
15826 .        tm1 "       Ignoring margin note.
15827 .        rr MN-shifted
15828 .      \}
15829 .      nr #no-repeat-MN-left 1
15830 .      nr #OVERFLOW_LEFT 1
15831 .      wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
15832 .      vpt 1
15833 .    \}
15834 .    MN-div-l-\\n[MN-curr]
15835 .    br
15836 .    nr MN-last-pos \\n[nl]
15837 .\}
15838 .  ev
15839 .  po
15840 .  if !\\n[#no-repeat-MN-left]=1 \{\
15841 .     if \\n[MN-right]=0 .vpt 1
15842 .  \}
15843 ..
15844 \#
15845 \# MNbottom-right
15846 \# --------------
15847 \# The "right" half of Werner's original MNbottom.
15848 \#
15849 .de MNbottom-right
15850 .  nr MN-curr 0
15851 .  nr MN-last-pos 0
15852 .  nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
15853 .  vpt 0
15854 .  po \\n[MN-right-start]u
15855 .  ev MNbottom-right-env
15856 .  nr #P \\n%+\\n[#PAGE_NUM_ADJ]
15857 .  while (\\n[MN-curr] < \\n[MN-right]) \{\
15858 .    nr MN-curr +1
15859 .    ie (\\n[MN-last-pos] < \\n[MN-mk-r-\\n[MN-curr]]) \
15860 .      sp |\\n[MN-mk-r-\\n[MN-curr]]u+\\n[MN-lead-adj]u
15861 .    el \{\
15862 .      nr MN-shifted 1
15863 .      sp 1v
15864 .      SHIM
15865 .      tm MN: Warning: Right margin note #\\n[MN-curr] on page \\n[#P] shifted down.
15866 .    \}
15867 .\" If last margin note doesn't fit
15868 .    if ( (\\n(nl+\\n[MN-div-r-\\n[MN-curr]-depth]) > (\\n(.p+\\n[#VARIABLE_FOOTER_POS]) ) \{\
15869 .      if \\n[MN-shifted]=1 \{\
15870 .        sp -(1v+\\n[#SHIM]u)
15871 .        rm MN-div-r-\\n[MN-curr]
15872 .        tm1 "[mom]: No room to start right margin note #\\n[MN-curr] on page \\n[#P] on page \\n[#P].
15873 .        tm1 "       Ignoring margin note.
15874 .        rr MN-shifted
15875 .      \}
15876 .      nr #no-repeat-MN-right 1
15877 .      nr #OVERFLOW_RIGHT 1
15878 .      wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
15879 .      vpt 1
15880 .    \}
15881 .    MN-div-r-\\n[MN-curr]
15882 .    br
15883 .    nr MN-last-pos \\n[nl]
15884 .\}
15885 .  ev
15886 .  po
15887 '  sp |\\n[MN-curr-pos]u
15888 .  if !\\n[#no-repeat-MN-right]=1 .vpt 1
15889 ..