* tmac/doc-common (doc-volume-as-*): Use lowercase names.
[s-roff.git] / contrib / mom / om.tmac
blob68050697b9580f52d5e4d7c151076ef3edf21a83
1 .\" om.tmac
2 .\"
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 (df191@ncf.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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 .\"
24 .\"
25 .\"
26 \# Version 1.1.8
27 \# -------------
29 .if (\n[.x]\n[.y] < 118) \
30 .  ab You need GNU troff version 1.18 or higher to run this version of mom!
32 \# Inasmuch as possible, macros that turn a feature on or off follow
33 \# a similar style.  Invoking the macro without an argument turns
34 \# the feature on.  Invoking it with any other argument turns it off.
35 \# Use of the argument OFF is recommended, but not required; users
36 \# may find other conventions preferable (e.g. NO, X, END, QUIT, etc.).
38 \# "<anything>" in the description of arguments that can be passed
39 \# to a macro means that any argument turns the feature off.
41 \# ====================================================================
43 \# TYPESETTING MACROS, STRINGS, AND ALIASES
44 \# ========================================
46 \# +++ALIASES+++
48 .als      ALIAS           als   \"Alias .als as ALIAS
49 .als      ALIASN          aln   \"Alias .aln (number registers) as ALIASN
51 .ALIAS    MAC             de
52 .ALIAS    BR              br
53 .ALIAS    SPACE           sp
54 .ALIAS    SP              sp
55 .ALIAS    PAGELENGTH      pl
56 .ALIAS    NEWPAGE         bp
57 .ALIAS    SPREAD          brp
58 .ALIAS    ESC_CHAR        ec
60 \# ALIASES FOR NUMBER REGISTERS
61 \# ----------------------------
63 .ALIASN  #PT_SIZE        .ps    \"fractional point size in units
64 .ALIASN  #DIVER_DEPTH     dn    \"diversion depth
65 .ALIASN  #DIVER_WIDTH     dl    \"diversion width
66 .ALIASN  #TRAP_DISTANCE  .t     \"distance to next trap
67 .ALIASN  #LEAD           .v     \"line space (.vs, not .ls)
68 .ALIASN  #PAGE_LENGTH    .p     \"page length
69 .ALIASN  #NUM_ARGS       .$     \"number of arguments passed to a macro
70 .ALIASN  #INDENT         .i     \"value of current indent
72 \# ====================================================================
74 \# MISCELLANEOUS
75 \# =============
76 .cflags 4 /\(en      \" So slash and en-dashes get broken
77 .nr #L_MARGIN \n(.o  \" Tabs, etc require #L_MARGIN
79 \# ====================================================================
81 \# END MACRO FOR LETTERS
82 \# ---------------------
83 \# *Arguments:
84 \#   none
85 \# *Function:
86 \#   The .em macro executed at the end of letters.  Turns footers
87 \#   and pagination off, terminates and outputs diversion CLOSING
88 \#   (indented with the author's name underneath).
90 .MAC ALL_DONE END
91 .    br
92 .    FOOTERS OFF
93 .    PAGINATION OFF
94 .    if \\n[#DOC_TYPE]=4 \{\
95 .       br
96 .       if !'\\n(.z'' \{ .di \}
97 .       IQ CLEAR
98 .       TQ
99 .       TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
100 .       ALD \\n[#DOC_LEAD]u*2u
101 .       TAB 1
102 .       if \\n[#CLOSING] \{\
103 .          nf
104 .          CLOSING
105 .       \}
106 .       ALD \\n[#DOC_LEAD]u*3u
107 .       PRINT \\*[$AUTHOR_1]
108 .    \}
109 .    DO_FOOTER
110 .END
113 \# =====================================================================
115 \# +++PAGE LAYOUT+++
117 \# Macros that control the physical layout of the page: paper size
118 \# and margins.
120 \# PAGE WIDTH
121 \# ----------
122 \# *Argument:
123 \#   <width of printer sheet>
124 \# *Function:
125 \#   Stores user supplied page width in register #PAGE_WIDTH.
126 \# *Notes:
127 \#   #PAGE_WIDTH is used to establish the default LL (and right margin).
128 \#   Requires unit of measure.
130 .MAC PAGEWIDTH END
131 .    br
132 .    nr #PAGE_WIDTH \\$1
133 .    if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
134 .    if !r#R_MARGIN \{ .R_MARGIN 1i \}
135 .END
138 \# L_MARGIN
139 \# --------
140 \# *Argument:
141 \#   <offset from page left>
142 \# *Function:
143 \#   Stores user supplied page offset in register #L_MARGIN.
144 \#   Sets .po to user supplied offset.
145 \# *Notes:
146 \#   Requires unit of measure.
148 .MAC L_MARGIN END
149 .    br
150 .    nr #L_MARGIN (\\$1)
151 .    po \\n[#L_MARGIN]u
152 .END
155 \# R_MARGIN
156 \# --------
157 \# *Argument:
158 \#   <width of right margin>
159 \# *Function:
160 \#   Stores user supplied right margin in register #R_MARGIN.
161 \# *Notes:
162 \#   This is a pseudo-margin.  Right margin is actually a function of
163 \#   line length.  The macro calculates line length from the page offset
164 \#   and the value plugged into #R_MARGIN.
166 \#   N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
168 \#   Requires unit of measure.
170 .MAC R_MARGIN END
171 .    br
172 .    nr #R_MARGIN (\\$1)
173 .    ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
174 .    ta \\n(.lu
175 .    nr #L_LENGTH \\n(.l
176 .END
179 \# T_MARGIN
180 \# --------
181 \# *Argument:
182 \#   <distance to advance from top of page>
183 \# *Function:
184 \#   Stores the user supplied top margin in register #T_MARGIN.
185 \#   Advances user supplied depth from the top of the page.
186 \# *Notes:
187 \#   Requires unit of measure.
189 .MAC T_MARGIN END
190 .    br
191 .    nr #T_MARGIN (\\$1)
192 .    nr #T_MARGIN_SET 1
193 .    if !\\n[#DOCS] \{\
194 .       PRINT \&
195 .       sp |\\n[#T_MARGIN]u-1v
196 .    \}
197 .    wh 0i DO_T_MARGIN
198 .END
201 \# B_MARGIN
202 \# --------
203 \# *Argument:
204 \#   <space to leave at the bottom of the page>
205 \# *Function:
206 \#   Stores the user supplied bottom margin in register #B_MARGIN.
207 \# *Notes:
208 \#   Requires unit of measure.
210 .MAC B_MARGIN END
211 .    br
212 .    nr #B_MARGIN (\\$1)
213 .    wh -\\n[#B_MARGIN]u DO_B_MARGIN
214 .END
217 \# PAGE
218 \# ----
219 \# *Arguments:
220 \#   <pagewidth>  [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
221 \# *Function:
222 \#   Page set-up.  Collects arguments and passes them to the appropriate
223 \#   macros.
224 \# *Notes:
225 \#   All arguments after pagewidth are optional, but must appear
226 \#   in the order given above.  (User can fill in as much or as
227 \#   little as desired.)
229 \#   All arguments require a unit of measure.
231 .MAC PAGE END
232 .    br
233 .    PAGEWIDTH                \\$1
234 .    PAGELENGTH               \\$2
235 .    ie '\\$3'' \{ .L_MARGIN  \\n(.o \}
236 .    el \{ .L_MARGIN          \\$3 \}
237 .    ie '\\$4'' \{ .R_MARGIN  1i \}
238 .    el \{ .R_MARGIN          \\$4 \}
239 .    if !'\\$5'' \{ .T_MARGIN \\$5 \}
240 .    if !'\\$6'' \{ .B_MARGIN \\$6 \}
241 .END
243 \# =====================================================================
245 \# +++PAGE CONTROL+++
247 \# Generic macros for breaking pages.
249 \# DO_T_MARGIN
250 \# -----------
251 \# *Argument:
252 \#   <none>
253 \# *Function:
254 \#   Plants the top margin (set in .PAGE) at the top of each page.
255 \# *Notes:
256 \#   The trap is set in .PAGE
258 .MAC DO_T_MARGIN END
259 .    ev 1
260 .    sp |\\n[#T_MARGIN]u-1v
261 .    ev
262 .END
265 \# DO_B_MARGIN
266 \# -----------
267 \# *Argument:
268 \#   <none>
269 \# *Function:
270 \#   Plants the bottom margin (set in .PAGE) at the bottom of each page.
271 \# *Notes:
272 \#   The trap is set in .PAGE.
274 .MAC DO_B_MARGIN END
275 .    ev 1
276 .    bp
277 .    ev
278 .END
280 \# =====================================================================
282 \# +++GENERAL STYLE MACROS+++
284 \# Macros that are likely to appear together to define general
285 \# type style: line length, family, font, point size, and line
286 \# spacing.
288 \# LINE LENGTH
289 \# -----------
290 \# *Argument:
291 \#   <line length>
292 \# *Function:
293 \#   Stores user supplied line length in register #L_LENGTH.
294 \#   Sets .ll to #L_LENGTHu
295 \# *Notes:
296 \#   Requires unit of measure.
298 .MAC LL END
299 .    nr #L_LENGTH (\\$1)
300 .    nr #USER_SET_L_LENGTH 1
301 .    ll \\n[#L_LENGTH]u
302 .    ta \\n(.lu
303 .END
306 \# FAMILY
307 \# ------
308 \# *Argument:
309 \#   <font family>
310 \# *Function:
311 \#   Stores user supplied font family in string $FAMILY.  Sets .fam
312 \#   to $FAMILY.
314 .MAC FAMILY END
315 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
316 .    if \\n[#IGNORE]        \{ .return \}
317 .    ds $FAMILY \\$1
318 .    fam \\*[$FAMILY]
319 .END
322 \# FONT
323 \# ----
324 \# *Argument:
325 \#   R | I | B | BI
326 \# *Function:
327 \#  Stores user supplied font in $FONT and sets .ft to $FONT.
329 .MAC FT END
330 .    if \\n[#PRINT_STYLE]=1 \{\
331 .       ie '\\$1'I' \{\
332 .          if \\n[#UNDERLINE_ITALIC]=1 \{\
333 .             UNDERLINE
334 .             return
335 .          \}
336 .          if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
337 .             ds $FONT \\$1
338 .             ft \\*[$FONT]
339 .             return
340 .          \}
341 .       \}
342 .       el \{ .UNDERLINE OFF \}
343 .       return
344 .    \}
345 .    ds $FONT \\$1
346 .    ft \\*[$FONT]
347 .END
350 \# POINT SIZE
351 \# ----------
352 \# *Arguments:
353 \#   <point size of type>
354 \# *Function:
355 \#   Sets point size to user supplied value in scaled points.
356 \#   If #AUTO_LEAD is on, sets .vs to #AUTOLEAD_VALUE+#PT_SIZE.
357 \# *Notes:
358 \#   Must NOT use a unit of measure.
360 .MAC PT_SIZE END
361 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
362 .    if \\n[#IGNORE]        \{ .return \}
363 .    nr #PT_SIZE_SET 1
364 .    ps \\$1
365 .    if \\n[#AUTO_LEAD] \{\
366 .       ie \\n[#AUTOLEAD_FACTOR] \{ .vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u \}
367 .       el \{ .vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u \}
368 .    \}
369 .    nr #PT_SIZE_IN_UNITS \\n[.ps]
370 .END
373 \# SIZE (inline)
374 \# -------------
375 \# *Arguments:
376 \#   <point size of type>
377 \# *Function:
378 \#   Sets point size to user supplied value in scaled points.
379 \#   Intended to be called inline with \*[SIZE <n><unit>]
380 \# *Notes:
381 \#   Can be used with a unit of measure or not.
383 .MAC SIZE END
385 .ps \\$1
386 .END
389 \# LEADING
390 \# -------
391 \# *Argument:
392 \#   <leading between lines of text>
393 \# *Function:
394 \#   Turns off #AUTO_LEAD if it's on.
395 \#   Sets .vs to user supplied value.
396 \# *Notes:
397 \#   Does not require unit of measure.  LEAD automatically turns off AUTOLEAD.
399 .MAC LS END
400 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
401 .    if \\n[#IGNORE]        \{ .return \}
402 .    nr #LEAD_SET 1
403 .    if \\n[#AUTO_LEAD] \{\
404 .       rr #AUTO_LEAD
405 .       rr #AUTOLEAD_FACTOR
406 .    \}
407 .    vs \\$1
408 .    if \\n[#T_MARGIN_SET]=1 \{\
409 .       sp |\\n[#T_MARGIN]u-1v
410 .       rr #T_MARGIN_SET
411 .    \}
412 .END
415 \# AUTOLEAD
416 \# --------
417 \# *Argument:
418 \#   <leading value to add to #PT_SIZE> [FACTOR]
419 \# *Function:
420 \#   Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
421 \#   Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
422 \#   All subsequent PT_SIZE requests reset the leading in the same way until
423 \#   AUTOLEAD is turned off.
424 \# *Notes:
425 \#   With the optional FACTOR argument, the current point size is
426 \#   multiplied by #AUTOLEAD_VALUE instead of the two being added
427 \#   together.
429 .MAC AUTOLEAD END
430 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
431 .    if \\n[#IGNORE]        \{ .return \}
432 .    nr #AUTO_LEAD 1
433 .    nr #AUTOLEAD_VALUE (p;\\$1)
434 .    ie \\n[#NUM_ARGS]=2 \{\
435 .       if '\\$2'FACTOR' \{\
436 .          nr #AUTOLEAD_FACTOR 1
437 .          vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u
438 .       \}
439 .    \}
440 .    el \{\
441 .       vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u
442 .    \}
443 .    if \\n[#T_MARGIN_SET] \{\
444 .       sp |\\n[#T_MARGIN]u-1v
445 .       rr #T_MARGIN_SET
446 .    \}
447 .END
450 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
451 \# ------------------------------------------------
452 .ds ROM  \EfR
453 .ds IT   \EfI
454 .ds BD   \EfB
455 .ds BDI  \Ef(BI
456 .ds PREV \EfP
457 .ds S    \Es
459 \# =====================================================================
461 \# +++KERNING+++
463 \# AUTOMATIC PAIRWISE KERNING
464 \# --------------------------
465 \# *Arguments:
466 \#   <none> | <anything>
467 \# *Function:
468 \#   Turns automatic pairwise kerning on or off.
470 .MAC KERN END
471 .    ie '\\$1'' \{\
472 .       kern
473 .       nr #KERN 1
474 .    \}
475 .    el \{\
476 .       kern 0
477 .       nr #KERN 0
478 .    \}
479 .END
482 \# INLINE KERNING AND HORIZONTAL MOVEMENT
483 \# --------------------------------------
484 \# *Kerning
485 \#  Inline kerning provides a simple method for users to adjust the
486 \#  amount of space between any two letters.  It's predicated on a
487 \#  unit of measure "U", which is 1/36 of the current point size as
488 \#  returned by \n[.ps].  E.g., if the current point size is 18,
489 \#  \n[.ps] returns 18000u, therefore U=500u.  Since U remains
490 \#  proportional relative to the current point size, the amount
491 \#  of kerning between two letters as expressed in Us remains
492 \#  visually similar regardless of changes in point size.
494 \#  N.B.--the amount of inline kerning supplied by \*[BU<n>] or
495 \#  \*[FU<n>] is added to or subtracted from any kerning that already
496 \#  takes place between two characters when automatic kerning is
497 \#  turned on.
499 \#  In groff v. 1.17.2, it was not possible to pass arguments to macros that
500 \#  were called with inline escapes, nor thence to evaluate conditional
501 \#  expressions.  Consequently, each pseudo-escape \[BU<n>] had to be defined
502 \#  separately with ".char".
504 \#  As of v. 1.18, one can pass arguments to inline strings/macros,
505 \#  hence it is now possible to do \*[BU n] where n, inline, is the desired
506 \#  number of kern units.  The original .char definitions have been left in
507 \#  for backward compatibility with documents created prior to mom-1.1.3c.
510 .nr #KERN_UNIT 36
511 .ds BU   \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
512 .ds FU   \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
514 \# Initialize strings for pre-1.1.3c-style BU and FU
516 .nr #LOOP 0 1
517 .while \n+[#LOOP]<37 \{\
518 .   ds BU\n[#LOOP]  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
521 .nr #LOOP 0 1
522 .while \n+[#LOOP]<37 \{\
523 .   ds FU\n[#LOOP]  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
525 .rr #LOOP
528 \# *Horizontal movements
529 \#  BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
530 \#  specified number of points.
531 \#  Left in for backward compatibility with mom-1.1.3c, the
532 \#  preferred methods for inline horizontal movements are now
533 \#  \*[BCK <n><unit>] and \*[FWD <n><unit>].
535 .ds BCK  \h'-\\$1\\$2'
536 .ds FWD  \h'\\$1\\$2'
538 .ds BP.25    \h'-.25'
539 .ds BP.5     \h'-.5'
540 .ds BP.75    \h'-.75'
541 .ds BP1      \h'-1p'
542 .ds BP1.25   \h'-1.25p'
543 .ds BP1.5    \h'-1.5p'
544 .ds BP1.75   \h'-1.75p'
545 .ds BP2      \h'-2p'
546 .ds BP2.25   \h'-2.25p'
547 .ds BP2.5    \h'-2.5p'
548 .ds BP2.75   \h'-2.75p'
549 .ds BP3      \h'-3p'
550 .ds BP3.25   \h'-3.25p'
551 .ds BP3.5    \h'-3.5p'
552 .ds BP3.75   \h'-3.75p'
553 .ds BP4      \h'-4p'
554 .ds BP4.25   \h'-4.25p'
555 .ds BP4.5    \h'-4.5p'
556 .ds BP4.75   \h'-4.75p'
557 .ds BP5      \h'-5p'
558 .ds BP5.25   \h'-5.25p'
559 .ds BP5.5    \h'-5.5p'
560 .ds BP5.75   \h'-5.75p'
561 .ds BP6      \h'-6p'
562 .ds BP6.25   \h'-6.25p'
563 .ds BP6.5    \h'-6.5p'
564 .ds BP6.75   \h'-6.75p'
565 .ds BP7      \h'-7p'
566 .ds BP7.25   \h'-7.25p'
567 .ds BP7.5    \h'-7.5p'
568 .ds BP7.75   \h'-7.75p'
569 .ds BP8      \h'-8p'
570 .ds BP8.25   \h'-8.25p'
571 .ds BP8.5    \h'-8.5p'
572 .ds BP8.75   \h'-8.75p'
573 .ds BP9      \h'-9p'
574 .ds BP9.25   \h'-9.25p'
575 .ds BP9.5    \h'-9.5p'
576 .ds BP9.75   \h'-9.75p'
577 .ds BP10     \h'-10p'
578 .ds BP10.25  \h'-10.25p'
579 .ds BP10.5   \h'-10.5p'
580 .ds BP10.75  \h'-10.75p'
581 .ds BP11     \h'-11p'
582 .ds BP11.25  \h'-11.25p'
583 .ds BP11.5   \h'-11.5p'
584 .ds BP11.75  \h'-11.75p'
585 .ds BP12     \h'-12p'
586 .ds BP12.25  \h'-12.25p'
587 .ds BP12.5   \h'-12.5p'
588 .ds BP12.75  \h'-12.75p'
590 .ds FP.25    \h'.25'
591 .ds FP.5     \h'.5'
592 .ds FP.75    \h'.75'
593 .ds FP1      \h'1p'
594 .ds FP1.25   \h'1.25p'
595 .ds FP1.5    \h'1.5p'
596 .ds FP1.75   \h'1.75p'
597 .ds FP2      \h'2p'
598 .ds FP2.25   \h'2.25p'
599 .ds FP2.5    \h'2.5p'
600 .ds FP2.75   \h'2.75p'
601 .ds FP3      \h'3p'
602 .ds FP3.25   \h'3.25p'
603 .ds FP3.5    \h'3.5p'
604 .ds FP3.75   \h'3.75p'
605 .ds FP4      \h'4p'
606 .ds FP4.25   \h'4.25p'
607 .ds FP4.5    \h'4.5p'
608 .ds FP4.75   \h'4.75p'
609 .ds FP5      \h'5p'
610 .ds FP5.25   \h'5.25p'
611 .ds FP5.5    \h'5.5p'
612 .ds FP5.75   \h'5.75p'
613 .ds FP6      \h'6p'
614 .ds FP6.25   \h'6.25p'
615 .ds FP6.5    \h'6.5p'
616 .ds FP6.75   \h'6.75p'
617 .ds FP7      \h'7p'
618 .ds FP7.25   \h'7.25p'
619 .ds FP7.5    \h'7.5p'
620 .ds FP7.75   \h'7.75p'
621 .ds FP8      \h'8p'
622 .ds FP8.25   \h'8.25p'
623 .ds FP8.5    \h'8.5p'
624 .ds FP8.75   \h'8.75p'
625 .ds FP9      \h'9p'
626 .ds FP9.25   \h'9.25p'
627 .ds FP9.5    \h'9.5p'
628 .ds FP9.75   \h'9.75p'
629 .ds FP10     \h'10p'
630 .ds FP10.25  \h'10.25p'
631 .ds FP10.5   \h'10.5p'
632 .ds FP10.75  \h'10.75p'
633 .ds FP11     \h'11p'
634 .ds FP11.25  \h'11.25p'
635 .ds FP11.5   \h'11.5p'
636 .ds FP11.75  \h'11.75p'
637 .ds FP12     \h'12p'
638 .ds FP12.25  \h'12.25p'
639 .ds FP12.5   \h'12.5p'
640 .ds FP12.75  \h'12.75p'
643 \# WHOLE LINE KERNING (RW and EW)
644 \# -----------------------------
645 \# The line kerning macros are special instances of track kerning,
646 \# used where a complete line needs to be tightened (or relaxed) in
647 \# order to accomodate or remove one or two more characters
648 \# than the default justification permits.
650 \# *Argument:
651 \#   <amount of overall "kerning" (letter spacing) to apply to the line>
652 \# *Function:
653 \#   Invokes .tkf (track kerning) for the current font with
654 \#   1 as both the upper and lower point size limits, so that
655 \#   the value entered by the user applies regardless of point
656 \#   size.  RW ("Reduce Whitespace") reduces the amount of space
657 \#   between all characters by an equal amount.  EW ("Extra
658 \#   Whitespace") increases the amount of space.
659 \# *Notes:
660 \#   Decimal values are acceptable.
662 \#   The groff documentation is a tad confusing about what unit of
663 \#   measure is used in track kerning, only that the width of each
664 \#   character is increased or decreased by the amount(s) passed as
665 \#   arguments to .tkf, and something about linear function of point
666 \#   size.  In fact, with the way I've put this macro together, it
667 \#   doesn't matter.  All the user needs to know is that a value
668 \#   of one will produce an unacceptably tight or loose line at most
669 \#   text point sizes; therefore, effective use of RW and EW is in
670 \#   the fractional range below 1 (e.g. .25, .5).  Given that RW
671 \#   and EW are for massaging type, a certain amount of
672 \#   experimentation and previewing is expected and necessary.
674 \#   \n(.f holds the current font number, which is acceptable to .tkf.
676 \#   RW and EW must be reset to 0 to cancel their effect on
677 \#   subsequent output lines.
679 .MAC RW END
680 .    if \\n[#BR_AT_LINE_KERN] \{ .br \}
681 .    tkf 1 1 -\\$1 1 -\\$1
682 .    tkf 2 1 -\\$1 1 -\\$1
683 .    tkf 3 1 -\\$1 1 -\\$1
684 .    tkf 4 1 -\\$1 1 -\\$1
685 .END
688 .MAC EW END
689 .    if \\n[#BR_AT_LINE_KERN] \{ .br \}
690 .    tkf 1 1 \\$1 1 \\$1
691 .    tkf 2 1 \\$1 1 \\$1
692 .    tkf 3 1 \\$1 1 \\$1
693 .    tkf 4 1 \\$1 1 \\$1
694 .END
697 \# BREAK AT LINE KERN
698 \# ------------------
699 \# *Arguments:
700 \#   toggle
701 \# *Function:
702 \#   Enables/disables .br's before .RW and .EW
703 \# *Notes:
704 \#   Mostly, users will want .br's before any kind of line kerning, but
705 \#   there may be cases where they don't.  BR_BEFORE_LINE_KERN is off by
706 \#   default and must be invoked explicitly.
708 .MAC BR_AT_LINE_KERN END
709 .    ie '\\$1'' \{ .nr #BR_AT_LINE_KERN  1 \}
710 .    el         \{ .rr #BR_AT_LINE_KERN \}
711 .END
713 \# =====================================================================
715 \# +++HYPHENATION+++
717 \# AUTO HYPHENATION
718 \# ----------------
719 \# *Arguments:
720 \#   <none> | <anything> | DEFAULT
721 \#                 or
722 \#   LINES <n> | MARGIN <n> | SPACE <n>
723 \# *Function:
724 \#   Turns auto hyphenation on or off, resets the hyphenation style
725 \#   to default, or permits the setting of various hyphenation
726 \#   parameters.
727 \# *Notes:
728 \#   HY ON defaults to .hy 14, i.e. no hyphens after the
729 \#   first two or before the last two characters of a word, and
730 \#   no hyphenation of the last line prior to a trap (e.g.,
731 \#   at the bottom of a page).
733 \#   HY DEFAULT resets the hyphenation style to .hy 14 (see
734 \#   above) if that behaviour is desired after changes have been
735 \#   made to LINES, MARGIN, or SPACE.
737 \#   HY LINES <n> sets the number of allowable consecutive hyphenated lines.
739 \#   HY MARGIN <n> sets the amount of space (ipPcm) allowed at the end
740 \#   of a line in QUAD mode before hyphenation is tripped (e.g. if there's
741 \#   only 6 points left, groff won't try to hyphenate the next word).
743 \#   HY SPACE sets the amount of extra interword space (ipPcm) that can
744 \#   be added in JUSTIFY mode to prevent a line from being hyphenated.
746 .MAC HY END
747 .    ie '\\$1'' \{\
748 .       hy 14
749 .       nr #HYPHENATE 1
750 .    \}
751 .    el \{\
752 .       if !'\\$1'LINES'  \{\
753 .          nh
754 .          nr #HYPHENATE 0
755 .       \}
756 .       if !'\\$1'MARGIN' \{\
757 .          nh
758 .          nr #HYPHENATE 0
759 .       \}
760 .       if !'\\$1'SPACE'  \{\
761 .          nh
762 .          nr #HYPHENATE 0
763 .       \}
764 .       if !'\\$1'DEFAULT'  \{\
765 .          nh
766 .          nr #HYPHENATE 0
767 .       \}
768 .       if '\\$1'LINES'   \{ .hlm \\$2 \}
769 .       if '\\$1'MARGIN'  \{ .hym \\$2 \}
770 .       if '\\$1'SPACE'   \{ .hys \\$2 \}
771 .       if '\\$1'DEFAULT' \{\
772 .          hlm -1
773 .          hym 0
774 .          hys 0
775 .       \}
776 .    \}
777 .END
780 \# HYPHENATION PARAMETERS
781 \# ----------------------
782 \# *Arguments:
783 \#   <# of lines> | <size of margin> | <amount of interword space>
784 \# *Function:
785 \#   Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
787 .MAC HY_SET END
788 .    nr #HY_SET 1
789 .    hlm \\$1
790 .    hym \\$2
791 .    hys \\$3
792 .END
794 \# =====================================================================
796 \# +++VERTICAL SPACING+++
798 \# ADVANCE LEAD
799 \# ------------
800 \# *Argument:
801 \#   <user supplied lead to advance below current baseline>
802 \# *Function:
803 \#   Creates or modifies register #ALD.  Adds user supplied lead
804 \#   below current baseline.
805 \# *Notes:
806 \#   Requires a unit of measure.
808 .MAC ALD END
809 .    nr #ALD (\\$1)
810 .    sp \\n[#ALD]u
811 .END
814 \# REVERSE LEAD
815 \# ------------
816 \# *Argument:
817 \#   <user supplied lead to reverse above current baseline>
818 \# *Function:
819 \#   Creates or modifies register #RLD.  Reverses user supplied
820 \#   lead above current baseline.
821 \# *Notes:
822 \#   Requires a unit of measure.
824 .MAC RLD END
825 .    nr #RLD (\\$1)
826 .    sp -\\n[#RLD]u
827 .END
829 \# ALD/RLD STRINGS
830 \# ---------------
831 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding
832 \# \*[RLD] forms have been left in for backward compatibility with
833 \# documents created using mom-1.1.3c or earlier.  The prefered
834 \# methods of advancing and reversing on the page inline are \*[UP <n><unit>]
835 \# and \*[DOWN <n><unit>].
837 .ds DOWN      \v'\\$1\\$2'
838 .ds UP        \v'-\\$1\\$2'
840 .ds ALD.25    \v'.25p'
841 .ds ALD.5     \v'.5p'
842 .ds ALD.75    \v'.75p'
843 .ds ALD1      \v'1p'
844 .ds ALD1.25   \v'1.25p'
845 .ds ALD1.5    \v'1.5p'
846 .ds ALD1.75   \v'1.75p'
847 .ds ALD2      \v'2p'
848 .ds ALD2.25   \v'2.25p'
849 .ds ALD2.5    \v'2.5p'
850 .ds ALD2.75   \v'2.75p'
851 .ds ALD3      \v'3p'
852 .ds ALD3.25   \v'3.25p'
853 .ds ALD3.5    \v'3.5p'
854 .ds ALD3.75   \v'3.75p'
855 .ds ALD4      \v'4p'
856 .ds ALD4.25   \v'4.25p'
857 .ds ALD4.5    \v'4.5p'
858 .ds ALD4.75   \v'4.75p'
859 .ds ALD5      \v'5p'
860 .ds ALD5.25   \v'5.25p'
861 .ds ALD5.5    \v'5.5p'
862 .ds ALD5.75   \v'5.75p'
863 .ds ALD6      \v'6p'
864 .ds ALD6.25   \v'6.25p'
865 .ds ALD6.5    \v'6.5p'
866 .ds ALD6.75   \v'6.75p'
867 .ds ALD7      \v'7p'
868 .ds ALD7.25   \v'7.25p'
869 .ds ALD7.5    \v'7.5p'
870 .ds ALD7.75   \v'7.75p'
871 .ds ALD8      \v'8p'
872 .ds ALD8.25   \v'8.25p'
873 .ds ALD8.5    \v'8.5p'
874 .ds ALD8.75   \v'8.75p'
875 .ds ALD9      \v'9p'
876 .ds ALD9.25   \v'9.25p'
877 .ds ALD9.5    \v'9.5p'
878 .ds ALD9.75   \v'9.75p'
879 .ds ALD10     \v'10p'
880 .ds ALD10.25  \v'10.25p'
881 .ds ALD10.5   \v'10.5p'
882 .ds ALD10.75  \v'10.75p'
883 .ds ALD11     \v'11p'
884 .ds ALD11.25  \v'11.25p'
885 .ds ALD11.5   \v'11.5p'
886 .ds ALD11.75  \v'11.75p'
887 .ds ALD12     \v'12p'
888 .ds ALD12.25  \v'12.5p'
889 .ds ALD12.5   \v'12.5p'
890 .ds ALD12.75  \v'12.75p'
892 .ds RLD.25    \v'-.25p'
893 .ds RLD.5     \v'-.5p'
894 .ds RLD.75    \v'-.75p'
895 .ds RLD1      \v'-1p'
896 .ds RLD1.25   \v'-1.25p'
897 .ds RLD1.5    \v'-1.5p'
898 .ds RLD1.75   \v'-1.75p'
899 .ds RLD2      \v'-2p'
900 .ds RLD2.25   \v'-2.25p'
901 .ds RLD2.5    \v'-2.5p'
902 .ds RLD2.75   \v'-2.75p'
903 .ds RLD3      \v'-3p'
904 .ds RLD3.25   \v'-3.25p'
905 .ds RLD3.5    \v'-3.5p'
906 .ds RLD3.75   \v'-3.75p'
907 .ds RLD4      \v'-4p'
908 .ds RLD4.25   \v'-4.25p'
909 .ds RLD4.5    \v'-4.5p'
910 .ds RLD4.75   \v'-4.75p'
911 .ds RLD5      \v'-5p'
912 .ds RLD5.25   \v'-5.25p'
913 .ds RLD5.5    \v'-5.5p'
914 .ds RLD5.75   \v'-5.75p'
915 .ds RLD6      \v'-6p'
916 .ds RLD6.25   \v'-6.25p'
917 .ds RLD6.5    \v'-6.5p'
918 .ds RLD6.75   \v'-6.75p'
919 .ds RLD7      \v'-7p'
920 .ds RLD7.25   \v'-7.25p'
921 .ds RLD7.5    \v'-7.5p'
922 .ds RLD7.75   \v'-7.75p'
923 .ds RLD8      \v'-8p'
924 .ds RLD8.25   \v'-8.25p'
925 .ds RLD8.5    \v'-8.5p'
926 .ds RLD8.75   \v'-8.75p'
927 .ds RLD9      \v'-9p'
928 .ds RLD9.25   \v'-9.25p'
929 .ds RLD9.5    \v'-9.5p'
930 .ds RLD9.75   \v'-9.75p'
931 .ds RLD10     \v'-10p'
932 .ds RLD10.25  \v'-10.25p'
933 .ds RLD10.5   \v'-10.5p'
934 .ds RLD10.75  \v'-10.75p'
935 .ds RLD11     \v'-11p'
936 .ds RLD11.25  \v'-11.25p'
937 .ds RLD11.5   \v'-11.5p'
938 .ds RLD11.75  \v'-11.75p'
939 .ds RLD12     \v'-12p'
940 .ds RLD12.25  \v'-12.5p'
941 .ds RLD12.5   \v'-12.5p'
942 .ds RLD12.75  \v'-12.75p'
944 \# =====================================================================
946 \# +++REFINEMENTS+++
948 \# AUTOMATIC LIGATURES
949 \# -------------------
950 \# *Arguments:
951 \#   <none> | <anything>
952 \# *Function:
953 \#   Turns automatic ligature generation on or off.
954 \# *Notes:
955 \#   Ligatures may be supplied manually with \(fi, \(fl, etc.
957 .MAC LIGATURES END
958 .    ie '\\$1'' \{\
959 .       lg
960 .       nr #LIGATURES 1
961 .    \}
962 .    el \{\
963 .       lg 0
964 .       nr #LIGATURES 0
965 .    \}
966 .END
969 \# SMARTQUOTES
970 \# -----------
971 \# *Arguments:
972 \#   [ ,, ] | [ << ] | [ >> ] | <anything>
973 \#   or
974 \#   [ DA | DE | ES | FR | IT | NL | NO | PT | SV ] | <anything>
975 \# *Function:
976 \#   Turns smartquotes on (optionally with a quoting style from the
977 \#   argument list, or off).
978 \# *Notes:
979 \#   The " character is read outside the macro when mom is
980 \#   processed.  The strings for open/close ($QUOTE<n>) are then
981 \#   defined in the macro.
983 \#   (Note to myself: ascii code for " is \N'34'.)
985 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
987 .MAC SMARTQUOTES END
988 .    rr #ARGS_TO_SQ
989 .    ie '\\$1'' \{\
990 .       nr #OPEN_CLOSE 0
991 .       ds $QUOTE0 \\[lq]
992 .       ds $QUOTE1 \\[rq]
993 .    \}
994 .    el \{\
995 .       if '\\$1',,' \{\
996 .          nr #ARGS_TO_SQ 1
997 .          ds $QUOTE0 \\[Bq]
998 .          ds $QUOTE1 \\[lq]
999 .       \}
1000 .       if '\\$1'<<' \{\
1001 .          nr #ARGS_TO_SQ 1
1002 .          ds $QUOTE0 \\[Fo]
1003 .          ds $QUOTE1 \\[Fc]
1004 .       \}
1005 .       if '\\$1'>>' \{\
1006 .          nr #ARGS_TO_SQ 1
1007 .          ds $QUOTE0 \\[Fc]
1008 .          ds $QUOTE1 \\[Fo]
1009 .       \}
1010 .       if '\\$1'DA' \{\
1011 .          nr #ARGS_TO_SQ 1
1012 .          ds $QUOTE0 \\[Fc]
1013 .          ds $QUOTE1 \\[Fo]
1014 .       \}
1015 .       if '\\$1'DE' \{\
1016 .          nr #ARGS_TO_SQ 1
1017 .          ds $QUOTE0 \\[Bq]
1018 .          ds $QUOTE1 \\[lq]
1019 .       \}
1020 .       if '\\$1'ES' \{\
1021 .          nr #ARGS_TO_SQ 1
1022 .          ds $QUOTE0 \\[lq]
1023 .          ds $QUOTE1 \\[rq]
1024 .       \}
1025 .       if '\\$1'FR' \{\
1026 .          nr #ARGS_TO_SQ 1
1027 .          ds $QUOTE0 \\[Fo]\\|
1028 .          ds $QUOTE1 \\|\\[Fc]
1029 .       \}
1030 .       if '\\$1'IT' \{\
1031 .          nr #ARGS_TO_SQ 1
1032 .          ds $QUOTE0 \\[Fo]\\|
1033 .          ds $QUOTE1 \\|\\[Fc]
1034 .       \}
1035 .       if '\\$1'NL' \{\
1036 .          nr #ARGS_TO_SQ 1
1037 .          ds $QUOTE0 \\[rq]
1038 .          ds $QUOTE1 \\[rq]
1039 .       \}
1040 .       if '\\$1'NO' \{\
1041 .          nr #ARGS_TO_SQ 1
1042 .          ds $QUOTE0 \\[Fo]
1043 .          ds $QUOTE1 \\[Fc]
1044 .       \}
1045 .       if '\\$1'PT' \{\
1046 .          nr #ARGS_TO_SQ 1
1047 .          ds $QUOTE0 \\[Fo]
1048 .          ds $QUOTE1 \\[Fc]
1049 .       \}
1050 .       if '\\$1'SV' \{\
1051 .          nr #ARGS_TO_SQ 1
1052 .          ds $QUOTE0 \\[Fc]
1053 .          ds $QUOTE1 \\[Fc]
1054 .       \}
1055 .       if !r#ARGS_TO_SQ \{\
1056 .          ds $QUOTE0 \\[dq]
1057 .          ds $QUOTE1 \\[dq]
1058 .       \}
1059 .    \}
1060 .END
1062 .ds $QUOTE0 \[dq]
1063 .ds $QUOTE1 \[dq]
1065 \# Strings for foot and inch marks
1067 .ds FOOT \(fm
1068 .ds INCH \(fm\(fm
1070 \# =====================================================================
1072 \# +++LINE BREAKS+++
1074 \# NO-SPACE BREAK
1075 \# --------------
1076 \# *Argument:
1077 \#   <none>
1078 \# *Function:
1079 \#   Breaks a line without advancing.
1080 \# *Notes:
1081 \#   EL is the mnemonic used on older, dedicated typesetting machines
1082 \#   to indicate "process the line, then return to the left margin
1083 \#   without advancing the galley medium."  It stands for End Line.
1085 \#   Sadly, EL is only a fake.  It will work in all instances EXCEPT
1086 \#   when the line to be EL'd is the last line before a footer trap.
1087 \#   Use TRAP OFF/TRAP to circumvent this.
1089 .MAC EL END
1090 .    br
1091 .    sp -1v
1092 .END
1094 \# =====================================================================
1096 \# +++FILLING/QUADDING/JUSTIFYING+++
1098 \# JUSTIFY
1099 \# -------
1100 \# *Argument:
1101 \#   <none>
1102 \# *Function:
1103 \#   Turns fill on and sets .ad to b.
1104 \# *Notes:
1105 \#   Justifies text left and right.
1107 .MAC JUSTIFY END
1108 .    if \\n[#TAB_ACTIVE]=0 \{\
1109 .       nr #QUAD 1
1110 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1111 .    \}
1112 '    ce 0
1113 .    QUAD J
1114 .    if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1115 .    nr #FILL 0
1116 .END
1119 \# QUAD
1120 \# ----
1121 \# *Arguments:
1122 \#   L | LEFT | R | RIGHT | C | CENTER/CENTRE
1123 \# *Function:
1124 \#   Turns fill on and sets .ad to l, r, or c.
1125 \# *Notes:
1126 \#   Terminology is a problem here.  Some people call quad left
1127 \#   left justified, flush left, or flush left/rag right (and the
1128 \#   reverse for quad right).  Quad center is sometimes called rag
1129 \#   both.  For our purposes, all "quad" modes mean that groff fill
1130 \#   mode is enabled.
1132 .MAC QUAD END
1133 .    ds $QUAD_VALUE \\$1
1134 .    if \\n[#TAB_ACTIVE]=0 \{\
1135 .       nr #QUAD 1
1136 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1137 .    \}
1138 '    ce 0
1139 '    fi
1140 .    if '\\*[$QUAD_VALUE]'L'       \{ .ad l \}
1141 .    if '\\*[$QUAD_VALUE]'LEFT'    \{ .ad l \}
1142 .    if '\\*[$QUAD_VALUE]'R'       \{ .ad r \}
1143 .    if '\\*[$QUAD_VALUE]'RIGHT'   \{ .ad r \}
1144 .    if '\\*[$QUAD_VALUE]'C'       \{ .ad c \}
1145 .    if '\\*[$QUAD_VALUE]'CENTER'  \{ .ad c \}
1146 .    if '\\*[$QUAD_VALUE]'CENTRE'  \{ .ad c \}
1147 .    if '\\*[$QUAD_VALUE]'J'       \{ .ad b \}
1148 .    if '\\*[$QUAD_VALUE]'JUSTIFY' \{ .ad b \}
1149 .    nr #FILL 0
1150 .END
1153 \# LEFT, RIGHT, AND CENTER
1154 \# -----------------------
1155 \# The purpose of these macros is to allow the user to enter lines
1156 \# of text that will be quadded LRC *without* the user having to
1157 \# enter .BR or .br between lines.  For the sake of consistency,
1158 \# all three appear to behave similarly (from the point of view of the user),
1159 \# although the underlying primitives don't.  For this reason, LEFT,
1160 \# RIGHT, and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY
1161 \# to restore text to groff fill mode.
1163 \# LEFT
1164 \# ----
1165 \# *Argument:
1166 \#   <none>
1167 \# *Function:
1168 \#   Turns fill mode off.  Allows user to quad lines left without
1169 \#   requiring the .BR or .br macro.
1170 \# *Notes:
1171 \#   LEFT simply turns fill off.  Lines that exceed the current LL will
1172 \#   not be broken, simply continued (indefinitely) until a return is
1173 \#   encountered.  Note that this behaviour differs from the RIGHT and
1174 \#   CENTER macros.
1176 .MAC LEFT END
1177 .    if \\n[#TAB_ACTIVE]=0 \{\
1178 .       rr #QUAD
1179 .       ds $RESTORE_QUAD_VALUE LEFT
1180 .    \}
1181 .    ce 0
1182 .    nf
1183 .    nr #FILL 1
1184 .    if '\\n(.z'LETTERHEAD1' \{ .rr #DATE_FIRST \}
1185 .END
1188 \# RIGHT
1189 \# -----
1190 \# *Argument:
1191 \#   <none>
1192 \# *Function:
1193 \#   Turns fill on.  Allows user to quad lines right without
1194 \#   requiring the .BR or .br macro.
1195 \# *Notes:
1196 \#   Lines that exceed the current LL will be broken, with the excess
1197 \#   text quadded right.
1199 .MAC RIGHT END
1200 .    if \\n[#TAB_ACTIVE]=0 \{\
1201 .       rr #QUAD
1202 .       ds $RESTORE_QUAD_VALUE RIGHT
1203 .    \}
1204 .    fi
1205 .    rj 100000
1206 .    nr #FILL 1
1207 .END
1210 \# CENTER
1211 \# ------
1212 \# *Argument:
1213 \#   <none>
1214 \# *Function:
1215 \#   Turns fill on.  Allows user to center lines without
1216 \#   requiring the .BR or .br macro.
1217 \# *Notes:
1218 \#   Lines that exceed the current LL will be broken, with the excess
1219 \#   text centered.
1221 .MAC CENTER END
1222 .    if \\n[#TAB_ACTIVE]=0 \{\
1223 .       ds $RESTORE_QUAD_VALUE CENTER
1224 .    \}
1225 .    fi
1226 .    ce 100000
1227 .    nr #FILL 1
1228 .END
1230 \# =====================================================================
1232 \# +++TABS+++
1234 \#   There are two different kinds of tabs available: typesetting tabs
1235 \#   and string tabs.
1237 \#   Typesetting tabs are set with TAB_SET, which requires a tab number,
1238 \#   an indent (offset) from the left margin and a length (optionally
1239 \#   with a quad direction and an instruction to fill lines).  After tabs
1240 \#   are set with TS, they are called with .TAB n, where "n"
1241 \#   corresponds to the number passed to TAB_SET as a valid tab number.
1243 \#   String tabs allow the user to mark off tab positions inline.  Tab
1244 \#   indents and lengths are calculated from the beginning and end
1245 \#   positions of the marks.  Up to 19 string tabs may be created,
1246 \#   numbered 1-19.  Once created, they are called with .TAB n,
1247 \#   just like typesetting tabs.
1249 \#   Setting up string tabs is a two-step procedure.  First, the user
1250 \#   enters an input line in which s/he wants to mark off string tabs.
1251 \#   The beginning of a tab is marked with \*[STn], where "n" is
1252 \#   the desired number of the tab.  The end of the the tab is marked
1253 \#   with \*[STnX].  All ST's must have a matching STX.  String tabs
1254 \#   may be nested.
1256 \#   Next, the user invokes .ST n for every string tab defined, and
1257 \#   optionally passes quad information to it.  That done, string tabs
1258 \#   can be called just like typesetting tabs.
1260 \#   String tabs don't preview properly with gxditview.  Use gv instead.
1262 \# Strings for string tab inlines
1263 \# ------------------------------
1265 \# Initialize string tab markers numbered 1 to 19.
1267 .nr #LOOP 0 1
1268 .while \n+[#LOOP]<20 \{\
1269 .   ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET]
1272 .nr #LOOP 0 1
1273 .while \n+[#LOOP]<20 \{\
1274 .   ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK]
1276 .rr #LOOP
1279 \# These are reserved ST numbers for internal use
1280 .ds ST100  \Ek[#ST100_OFFSET]
1281 .ds ST100X \Ek[#ST100_MARK]
1282 .ds ST101  \Ek[#ST101_OFFSET]
1283 .ds ST101X \Ek[#ST101_MARK]
1286 \# QUAD AND SET STRING TABS
1287 \# ------------------------
1288 \# *Arguments:
1289 \#   <stringtab number>  L | R | C | J  [QUAD]
1290 \# *Function:
1291 \#   Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1292 \#   tab based on the collected information.
1293 \# *Notes:
1294 \#   Like TS, ST invoked without a quad direction will default to LEFT.
1295 \#   If lines should be filled and quadded, use the optional argument QUAD.
1296 \#   N.B. -- indents *must* be turned off before setting string tabs
1297 \#   inside .PAD
1299 .MAC ST END
1300 .    ds $ST\\$1_QUAD_DIR \\$2
1301 .    if \\n[#NUM_ARGS]=3 \{\
1302 .       ds $ST\\$1_FILL QUAD
1303 .    \}
1304 .    nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1305 .    ie \\n[#IN_TAB] \{\
1306 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1307 .    \}
1308 .    el \{\
1309 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1310 .    \}
1311 .END
1314 \# TAB SET
1315 \# -------
1316 \# *Arguments:
1317 \#   <n>  ident(ipPcm)  length(ipPcm)  [L | R | C | J [QUAD]]
1318 \# *Function:
1319 \#   Creates macros TABn and TAB n, where "n" is any arbitrary number.
1320 \#   TABn is a typesetting tab (i.e. a tab defined as an indent
1321 \#   from the page left offset plus a line length.)
1322 \# *Notes:
1323 \#   n      = arbitrary digit to identify the tab
1324 \#   indent = indent from left margin; unit of measure required
1325 \#   length = length of tab (unit of measure required; can be
1326 \#            \w'<string>'u--if more than one word in string, surround
1327 \#            with double quotes "\w'<three word string>'"
1328 \#   LRCJ   = quad for tab (left, right, center, justified)
1329 \#            If option QUAD afterwards is not given, quad is line for line
1330 \#            (no fill mode), meaning that there's no need for .BR or .br
1331 \#            between lines.
1332 \#   QUAD   = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1333 \#            had been given).
1335 \#   N.B. -- indents *must* be turned off before setting tabs
1337 \#   Examples:
1339 \#     .TAB_SET 1 2P+6p 12P C
1341 \#   means "create a tab numbered 1 that starts 2 picas and 6 points from
1342 \#   the left margin, is 12 picas long, and centre each input line."
1344 \#     .TAB_SET 1 2P+6P 12P C QUAD
1346 \#   means exactly the same thing, except that input lines are joined and
1347 \#   the area delimted by the tab filled with centered text.
1349 \#   TAB n can be called at any time after being set.
1351 \#   Tabs are NOT columnar in behaviour.  If the text inside a
1352 \#   tab runs to several lines, when you call the next tab a break
1353 \#   occurs, meaning that the new tab starts one line below the last
1354 \#   line in the previous tab.  For columnar behaviour, you must
1355 \#   use the multi-column macros in addition to tabs.
1357 \#   If you want tabs to line up bottom-line to bottom-line (most likely
1358 \#   single line tabs), use .TN (provided the tabs are numbered sequentially).
1359 \#   Otherwise, you must use .EL then .TAB <n> if you want them to align.
1361 \#   If you want to reset tabs, you must use .TQ before .TAB_SET.
1363 \#   Note that indents are turned off automatically whenever a new
1364 \#   tab is called with TAB <n>.
1366 \#   Tabs themselves are user-invoked using the TAB macro with a numeric
1367 \#   argument, e.g. TAB 1.
1369 \#   Generally, in order not to get confused, it's a good idea
1370 \#   to make sure all indents are off before setting tabs.
1372 .MAC TAB_SET END
1373 .    br
1374 .    nr #TAB_NUMBER \\$1
1375 .    ds $CURRENT_TAB \\n[#TAB_NUMBER]
1376 .    nr #TAB_OFFSET (\\$2)
1377 .    nr #TAB_LENGTH (\\$3)
1378 .    MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1379 .        br
1380 .        in 0
1381 .        nr #TAB_ACTIVE 1
1382 .        nr #CURRENT_TAB \\n[#TAB_NUMBER]
1383 .        ds $CURRENT_TAB \\*[$CURRENT_TAB]
1384 .        nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1385 .        nr #ST_OFFSET \\n[#TAB_OFFSET]
1386 .        po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
1387 .        ll \\n[#TAB_LENGTH]u
1388 .        ta \En(.lu
1389 .        ie '\\$5'QUAD' \{\
1390 .           if '\\$4'L' \{ .QUAD L  \}
1391 .           if '\\$4'R' \{ .QUAD R  \}
1392 .           if '\\$4'C' \{ .QUAD C  \}
1393 .           if '\\$4'J' \{ .JUSTIFY \}
1394 .        \}
1395 .        el \{\
1396 .           if '\\$4''  \{ .LEFT    \}
1397 .           if '\\$4'L' \{ .LEFT    \}
1398 .           if '\\$4'R' \{ .RIGHT   \}
1399 .           if '\\$4'C' \{ .CENTER  \}
1400 .           if '\\$4'J' \{ .JUSTIFY \}
1401 .        \}
1402 .DONE
1403 .    rr #TAB_ACTIVE
1404 .END
1407 \# TAB
1408 \# ---
1409 \# *Arguments:
1410 \#   <tab number to tab into>
1411 \# *Function:
1412 \#   Moves to tab number passed as an argument.
1414 .MAC TAB END
1415 .    ds $TAB_NUMBER \\$1
1416 .    TAB\\*[$TAB_NUMBER]
1417 .    nr #IN_TAB 1
1418 .END
1421 \# TAB NEXT
1422 \# --------
1423 \# *Argument:
1424 \#   <none>
1425 \# *Function:
1426 \#   Automagically moves to TAB<n+1> on the same line as the last
1427 \#   line of the previous tab.
1428 \# *Notes:
1429 \#   If the tabs being aligned fall too close to the footer
1430 \#   trap, the line entered after .TN will appear on the next page,
1431 \#   unless TRAP...TRAP OFF is used.
1433 .MAC TN END
1434 .    EL
1435 .    nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1436 .    TAB\\n[#NEXT_TAB]
1437 .END
1440 \# TAB QUIT
1441 \# --------
1442 \# *Argument:
1443 \#   <none>
1444 \# *Function:
1445 \#   Sets #TAB_ACTIVE to "0" (off).
1446 \#   Resets left margin to value in effect prior to tabs.
1447 \#   Resets line length to value in effect prior to tabs.
1448 \#   Checks #QUAD to see if we were in flush or quad mode
1449 \#   prior to tabs (0=off, 1=on).
1450 \#   Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1451 \#   in effect prior to tabs.
1452 \# *Notes:
1453 \#   TQ *must* come before setting any new tabs if you want the
1454 \#   tabs' indents measured from page left.  Otherwise, the tabs'
1455 \#   indents are measured from the left margin of the tab you're
1456 \#   currently in.
1458 .MAC TQ END
1459 .    br
1460 .    rr #TAB_ACTIVE
1461 .    rr #IN_TAB
1462 .    po \\n[#L_MARGIN]u
1463 .    ll \\n[#L_LENGTH]u
1464 .    ta \\n(.lu
1465 .    ie \\n[#QUAD] \{\
1466 .       ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1467 .       el                              \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1468 .    \}
1469 .    el \{\
1470 .       if '\\*[$RESTORE_QUAD_VALUE]'LEFT'   \{ .LEFT \}
1471 .       if '\\*[$RESTORE_QUAD_VALUE]'RIGHT'  \{ .RIGHT \}
1472 .       if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1473 .    \}
1474 .END
1476 \# ====================================================================
1478 \# COLOR HANDLING
1479 \# ==============
1481 \# COLOR
1482 \# -----
1483 \# *Arguments:
1484 \#   <pre-defined NEWCOLOR or XCOLOR>
1485 \# *Function:
1486 \#   Allows the inline escape for setting color to be called
1487 \#   as a macro.
1489 .MAC COLOR END
1490 .ie \\n(.u=1 \{\
1492 \\*[\\$1]\c
1493 .   \}
1494 .el \{ \\*[\\$1] \}
1495 .END
1498 \# NEWCOLOR
1499 \# --------
1500 \# *Arguments:
1501 \#   <color name> [<color scheme>] <color definition>
1502 \# *Function:
1503 \#   Based on .defcolor, allows users to name and define colors using
1504 \#   one of the four color schemes rgb, cmy, cmyk and grey.  The new
1505 \#   color is then defined as a string so that it can be called inline
1506 \#   with \*[COLORNAME] or with .COLOR.
1507 \# *Notes:
1508 \#   With only two args, the default color scheme is rgb.
1510 \#   It is highly recommended that users define new colors as
1511 \#   all-cap strings, to differentiate them from x colors, which must
1512 \#   be in lower case.
1514 .MAC NEWCOLOR END
1515 .    if \\n[#NUM_ARGS]=2 \{\
1516 .       defcolor \\$1 rgb \\$2
1517 .    \}
1518 .    if \\n[#NUM_ARGS]=3 \{\
1519 .       if '\\$2'RGB'  .ds $COLOR_SCHEME rgb
1520 .       if '\\$2'CYM'  .ds $COLOR_SCHEME cym
1521 .       if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk
1522 .       if '\\$2'GRAY' .ds $COLOR_SCHEME gray
1523 .       if '\\$2'GREY' .ds $COLOR_SCHEME gray
1524 .       defcolor \\$1  \\*[$COLOR_SCHEME] \\$3
1525 .    \}
1526 .    ds \\$1 \\m[\\$1]
1527 .END
1530 \# XCOLOR
1531 \# ------
1532 \# *Arguments:
1533 \#   <x color name> [<alias>]
1534 \# *Function:
1535 \#   Defines a string of x color name (i.e. a predefined x
1536 \#   color).  If <alias> is given, creates a string of <alias name>
1537 \#   that references the x color name of the first argument.
1538 \# *Notes:
1539 \#   The color name must be a legal color name from rgb.txt, and
1540 \#   must be given entirely in lower case, all one word.
1542 .MAC XCOLOR END
1543 .    ds \\$1 \m[\\$1]
1544 .    if \\n[#NUM_ARGS]=2 .ds \\$2 \m[\\$1]
1545 .END
1548 \# Pre-define xcolors black and white
1550 .ds black \m[black]
1551 .ds BLACK \m[black]
1552 .ds white \m[white]
1553 .ds WHITE \m[WHITE]
1555 \# =====================================================================
1557 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1559 \# UNDERLINE
1560 \# ---------
1561 \# *Arguments:
1562 \#   <none> | <anything>
1563 \# *Function:
1564 \#   When on, underlines all letters, words, and digits in a passage,
1565 \#   ignoring punctuation and spaces.
1566 \# *Notes:
1567 \#   Only for use when the font family is COURIER, to simulate
1568 \#   typewriter-style underlining of italic  passages.
1570 .MAC UNDERLINE END
1571 .    ie '\\$1'' \{\
1572 .       nr #UNDERLINE_ON 1
1573 .       char A _\bA
1574 .       char B _\bB
1575 .       char C _\bC
1576 .       char D _\bD
1577 .       char E _\bE
1578 .       char F _\bF
1579 .       char G _\bG
1580 .       char H _\bH
1581 .       char I _\bI
1582 .       char J _\bJ
1583 .       char K _\bK
1584 .       char L _\bL
1585 .       char M _\bM
1586 .       char N _\bN
1587 .       char O _\bO
1588 .       char P _\bP
1589 .       char Q _\bQ
1590 .       char R _\bR
1591 .       char S _\bS
1592 .       char T _\bT
1593 .       char U _\bU
1594 .       char V _\bV
1595 .       char W _\bW
1596 .       char X _\bX
1597 .       char Y _\bY
1598 .       char Z _\bZ
1599 .       char \[`A] _\b\[`A]
1600 .       char \[^A] _\b\[^A]
1601 .       char \['A] _\b\['A]
1602 .       char \[:A] _\b\[:A]
1603 .       char \[oA] _\b\[oA]
1604 .       char \[~A] _\b\[~A]
1605 .       char \[AE] _\b\[AE]
1606 .       char \[`E] _\b\[`E]
1607 .       char \[^E] _\b\[^E]
1608 .       char \['E] _\b\['E]
1609 .       char \[:E] _\b\[:E]
1610 .       char \[`I] _\b\[`I]
1611 .       char \[^I] _\b\[^I]
1612 .       char \['I] _\b\['I]
1613 .       char \[:I] _\b\[:I]
1614 .       char \[`O] _\b\[`O]
1615 .       char \[^O] _\b\[^O]
1616 .       char \['O] _\b\['O]
1617 .       char \[:O] _\b\[:O]
1618 .       char \[~O] _\b\[~O]
1619 .       char \[/O] _\b\[/O]
1620 .       char \[`U] _\b\[`U]
1621 .       char \[^U] _\b\[^U]
1622 .       char \['U] _\b\['U]
1623 .       char \[:U] _\b\[:U]
1624 .       char \[,C] _\b\[,C]
1625 .       char \[-D] _\b\[-D]
1626 .       char \[~N] _\b\[~N]
1627 .       char \[TP] _\b\[TP]
1628 .       char \['Y] _\b\['Y]
1629 .       char \[:Y] _\b\[:Y]
1630 .       char a _\ba
1631 .       char b _\bb
1632 .       char c _\bc
1633 .       char d _\bd
1634 .       char e _\be
1635 .       char f _\bf
1636 .       char g _\bg
1637 .       char h _\bh
1638 .       char i _\bi
1639 .       char j _\bj
1640 .       char k _\bk
1641 .       char l _\bl
1642 .       char m _\bm
1643 .       char n _\bn
1644 .       char o _\bo
1645 .       char p _\bp
1646 .       char q _\bq
1647 .       char r _\br
1648 .       char s _\bs
1649 .       char t _\bt
1650 .       char u _\bu
1651 .       char v _\bv
1652 .       char w _\bw
1653 .       char x _\bx
1654 .       char y _\by
1655 .       char z _\bz
1656 .       char \[`a] _\b\[`a]
1657 .       char \[^a] _\b\[^a]
1658 .       char \['a] _\b\['a]
1659 .       char \[:a] _\b\[:a]
1660 .       char \[oa] _\b\[oa]
1661 .       char \[~a] _\b\[~a]
1662 .       char \[ae] _\b\[ae]
1663 .       char \[`e] _\b\[`e]
1664 .       char \[^e] _\b\[^e]
1665 .       char \['e] _\b\['e]
1666 .       char \[:e] _\b\[:e]
1667 .       char \[`i] _\b\[`i]
1668 .       char \[^i] _\b\[^i]
1669 .       char \['i] _\b\['i]
1670 .       char \[:i] _\b\[:i]
1671 .       char \[`o] _\b\[`o]
1672 .       char \[^o] _\b\[^o]
1673 .       char \['o] _\b\['o]
1674 .       char \[:o] _\b\[:o]
1675 .       char \[~o] _\b\[~o]
1676 .       char \[/o] _\b\[/o]
1677 .       char \[`u] _\b\[`u]
1678 .       char \[^u] _\b\[^u]
1679 .       char \['u] _\b\['u]
1680 .       char \[:u] _\b\[:u]
1681 .       char \[,c] _\b\[,c]
1682 .       char \[Sd] _\b\[Sd]
1683 .       char \[~n] _\b\[~n]
1684 .       char \[Tp] _\b\[Tp]
1685 .       char \['y] _\b\['y]
1686 .       char \[:y] _\b\[:y]
1687 .       char \[ss] _\b\[ss]
1688 .       char ' _\b'
1689 .       char 1 _\b1
1690 .       char 2 _\b2
1691 .       char 3 _\b3
1692 .       char 4 _\b4
1693 .       char 5 _\b5
1694 .       char 6 _\b6
1695 .       char 7 _\b7
1696 .       char 8 _\b8
1697 .       char 9 _\b9
1698 .       char 0 _\b0
1699 .    \}
1700 .    el \{\
1701 .       nr #UNDERLINE_ON 0
1702 .       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 \
1703         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 \
1704         \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1705         \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1706         \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1707         \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1708         \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1709         \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1710         ' 1 2 3 4 5 6 7 8 9 0
1711 .    \}
1712 .END
1715 \# UL/ULX
1716 \# ------
1717 \# *Arguments:
1718 \#   <none>
1719 \# *Function:
1720 \#   Underscores all letters, words, and digits in a passage,
1721 \#   ignoring punctuation and spaces.
1722 \# *Notes:
1723 \#   Intended to be called with inline escapes \*[UL] (underline
1724 \#   on) and \*[ULX] (underline off).  Only works when the font family
1725 \#   is COURIER, to simulate typewriter-style underlining of italic
1726 \#   passages.
1728 .MAC UL END
1729 \c\R'#UNDERLINE_ON 1'
1730 .       char A _\bA
1731 .       char B _\bB
1732 .       char C _\bC
1733 .       char D _\bD
1734 .       char E _\bE
1735 .       char F _\bF
1736 .       char G _\bG
1737 .       char H _\bH
1738 .       char I _\bI
1739 .       char J _\bJ
1740 .       char K _\bK
1741 .       char L _\bL
1742 .       char M _\bM
1743 .       char N _\bN
1744 .       char O _\bO
1745 .       char P _\bP
1746 .       char Q _\bQ
1747 .       char R _\bR
1748 .       char S _\bS
1749 .       char T _\bT
1750 .       char U _\bU
1751 .       char V _\bV
1752 .       char W _\bW
1753 .       char X _\bX
1754 .       char Y _\bY
1755 .       char Z _\bZ
1756 .       char \[`A] _\b\[`A]
1757 .       char \[^A] _\b\[^A]
1758 .       char \['A] _\b\['A]
1759 .       char \[:A] _\b\[:A]
1760 .       char \[oA] _\b\[oA]
1761 .       char \[~A] _\b\[~A]
1762 .       char \[AE] _\b\[AE]
1763 .       char \[`E] _\b\[`E]
1764 .       char \[^E] _\b\[^E]
1765 .       char \['E] _\b\['E]
1766 .       char \[:E] _\b\[:E]
1767 .       char \[`I] _\b\[`I]
1768 .       char \[^I] _\b\[^I]
1769 .       char \['I] _\b\['I]
1770 .       char \[:I] _\b\[:I]
1771 .       char \[`O] _\b\[`O]
1772 .       char \[^O] _\b\[^O]
1773 .       char \['O] _\b\['O]
1774 .       char \[:O] _\b\[:O]
1775 .       char \[~O] _\b\[~O]
1776 .       char \[/O] _\b\[/O]
1777 .       char \[`U] _\b\[`U]
1778 .       char \[^U] _\b\[^U]
1779 .       char \['U] _\b\['U]
1780 .       char \[:U] _\b\[:U]
1781 .       char \[,C] _\b\[,C]
1782 .       char \[-D] _\b\[-D]
1783 .       char \[~N] _\b\[~N]
1784 .       char \[TP] _\b\[TP]
1785 .       char \['Y] _\b\['Y]
1786 .       char \[:Y] _\b\[:Y]
1787 .       char a _\ba
1788 .       char b _\bb
1789 .       char c _\bc
1790 .       char d _\bd
1791 .       char e _\be
1792 .       char f _\bf
1793 .       char g _\bg
1794 .       char h _\bh
1795 .       char i _\bi
1796 .       char j _\bj
1797 .       char k _\bk
1798 .       char l _\bl
1799 .       char m _\bm
1800 .       char n _\bn
1801 .       char o _\bo
1802 .       char p _\bp
1803 .       char q _\bq
1804 .       char r _\br
1805 .       char s _\bs
1806 .       char t _\bt
1807 .       char u _\bu
1808 .       char v _\bv
1809 .       char w _\bw
1810 .       char x _\bx
1811 .       char y _\by
1812 .       char z _\bz
1813 .       char \[`a] _\b\[`a]
1814 .       char \[^a] _\b\[^a]
1815 .       char \['a] _\b\['a]
1816 .       char \[:a] _\b\[:a]
1817 .       char \[oa] _\b\[oa]
1818 .       char \[~a] _\b\[~a]
1819 .       char \[ae] _\b\[ae]
1820 .       char \[`e] _\b\[`e]
1821 .       char \[^e] _\b\[^e]
1822 .       char \['e] _\b\['e]
1823 .       char \[:e] _\b\[:e]
1824 .       char \[`i] _\b\[`i]
1825 .       char \[^i] _\b\[^i]
1826 .       char \['i] _\b\['i]
1827 .       char \[:i] _\b\[:i]
1828 .       char \[`o] _\b\[`o]
1829 .       char \[^o] _\b\[^o]
1830 .       char \['o] _\b\['o]
1831 .       char \[:o] _\b\[:o]
1832 .       char \[~o] _\b\[~o]
1833 .       char \[/o] _\b\[/o]
1834 .       char \[`u] _\b\[`u]
1835 .       char \[^u] _\b\[^u]
1836 .       char \['u] _\b\['u]
1837 .       char \[:u] _\b\[:u]
1838 .       char \[,c] _\b\[,c]
1839 .       char \[Sd] _\b\[Sd]
1840 .       char \[~n] _\b\[~n]
1841 .       char \[Tp] _\b\[Tp]
1842 .       char \['y] _\b\['y]
1843 .       char \[:y] _\b\[:y]
1844 .       char \[ss] _\b\[ss]
1845 .       char ' _\b'
1846 .       char 1 _\b1
1847 .       char 2 _\b2
1848 .       char 3 _\b3
1849 .       char 4 _\b4
1850 .       char 5 _\b5
1851 .       char 6 _\b6
1852 .       char 7 _\b7
1853 .       char 8 _\b8
1854 .       char 9 _\b9
1855 .       char 0 _\b0
1856 .END
1859 .MAC ULX END
1860 \c\R'#UNDERLINE_ON 0'
1861 .    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 \
1862      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 \
1863      \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1864      \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1865      \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1866      \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1867      \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1868      \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1869      ' 1 2 3 4 5 6 7 8 9 0
1870 .END
1873 \# UNDERSCORE
1874 \# ----------
1875 \# *Arguments:
1876 \#   [points below baseline] "text"
1877 \# *Function:
1878 \#   Places an underscore 2 points under the string if no lead given,
1879 \#   otherwise places underscore under string by user specified amount.
1880 \# *Notes:
1881 \#   When using this macro, the string to be underscored must begin
1882 \#   with double-quotes ("), regardless of whether it's the sole
1883 \#   argument or the second.
1884 \#   E.g.:
1885 \#      .UNDERSCORE "Text to be underscored
1886 \#         or
1887 \#      .UNDERSCORE 2p "Text to be underscored
1889 \#   All text is underscored (including punctuation and spaces).
1890 \#   This is the primary difference between UNDERLINE and UNDERSCORE,
1891 \#   aside from the fact the UNDERLINE only works with Courier.
1893 \#   UNDERSCORE does not work across line breaks.  Each line of
1894 \#   text must be entered separately with UNDERSCORE.  If the
1895 \#   UNDERSCORE begins in the middle of a line and crosses over a
1896 \#   break, the portion before the break must be entered in its own
1897 \#   UNDERSCORE, as must the portion that comes after the break.
1899 .MAC UNDERSCORE END
1900 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1901 .    ie \\n[#NUM_ARGS]=1 \{ \\$1\\s(12\\v'+2p'\\l'|0'\\v'-2p'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1902 .    el                  \{ \\$2\\s(12\\v'+(\\$1)'\\l'|0'\\v'-(\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1903 .    rr #RESTORE_PT_SIZE
1904 .END
1907 \# DOUBLE UNDERSCORE
1908 \# -----------------
1909 \# *Arguments:
1910 \#   [points below baseline] [points distance between rules] "text"
1911 \# *Function:
1912 \#   Same as UNDERSCORE, except it produces a double underscore.  The default
1913 \#   distance between the rules is 2 points.
1914 \# *Notes:
1915 \#   The same double-quote requirement as UNDERSCORE.
1917 .MAC UNDERSCORE2 END
1918 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1919 .    if \\n[#NUM_ARGS]=1 \{\
1920 .       PRINT \\$1\\s(12\\v'+2p'\\l'|0'\\v'+2p'\\l'|0'\\v'-4p'\\s[\\n[#RESTORE_PT_SIZE]u]
1921 .    \}
1922 .    if \\n[#NUM_ARGS]=2 \{\
1923 .       PRINT \\$2\\s(12\\v'+\\$1'\\l'|0'\\v'+2p'\\l'|0'\\v'-(2p+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1924 .    \}
1925 .    if \\n[#NUM_ARGS]=3 \{\
1926 .       PRINT \\$3\\s(12\\v'+\\$1'\\l'|0'\\v'+\\$2'\\l'|0'\\v'-(\\$2+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1927 .    \}
1928 .    rr #RESTORE_PT_SIZE
1929 .END
1932 \# SUPERSCRIPT INLINES
1933 \# -------------------
1934 \# *Function:
1935 \#   Prints everything after invocation as superscript.
1936 \# *Notes:
1937 \#   \*[SUP] and \*[SUPX] turn superscript on and off respectively.
1938 \#   If running type is pseudo-condensed/expanded, invoke the superscript
1939 \#   strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
1940 \#   and \*[EXTSUPX] respectively.
1942 .ds SUP \
1943 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1944 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1945 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]
1947 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'
1949 .ds CONDSUP \
1950 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1951 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1952 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
1954 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
1956 .ds EXTSUP \
1957 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1958 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1959 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
1961 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
1964 \# SLANT
1965 \# -----
1967 \# SETSLANT
1968 \# --------
1969 \# *Arguments:
1970 \#   <number of degrees> | RESET
1971 \# *Function:
1972 \#   Modifies register #DEGREES for use with \*[SLANT], or resets
1973 \#   it to the default.  Defines string \*[SLANTX]
1974 \# *Notes:
1975 \#   \*[SLANT] permits pseudo-italicizing of a font in cases where
1976 \#   no italic font exists in a particular family.
1978 \#   Default # of degrees is 15.
1980 \#   Do not use unit of measure with arg to SETSLANT.
1982 \#   It may be necessary to adjust the spacing on either side of
1983 \#   [SLANT] and [SLANTX].
1985 \#   In docs, SLANT carries over from para to para.
1987 .nr #DEGREES 15
1988 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1989 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1991 .MAC SETSLANT END
1992 .    ie '\\$1'RESET' \{\
1993 .       nr #DEGREES 15
1994 .       if \\n[#PRINT_STYLE]=1 \{\
1995 .          if \\n[#UNDERLINE_SLANT] \{ .return \}
1996 .       \}
1997 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1998 .    \}
1999 .    el \{\
2000 .       nr #DEGREES \\$1
2001 .       if \\n[#PRINT_STYLE]=1 \{\
2002 .          if \\n[#UNDERLINE_SLANT] \{ .return \}
2003 .       \}
2004 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2005 .    \}
2006 .    ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2007 .END
2010 \# BOLDER
2011 \# ------
2013 \# SETBOLDER
2014 \# ---------
2015 \# *Arguments:
2016 \#   <amount of emboldening> | RESET
2017 \# *Function:
2018 \#   Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
2019 \#   it to the default 700 units.
2020 \# *Notes:
2021 \#   \*[BOLDER] allows pseudo-emboldening of a font where no bold
2022 \#   font exists in a particular family.
2024 \#   Default for SETBOLDER is 700 units.  Do not use unit of measure
2025 \#   with arg to SETBOLDER.
2027 .nr #BOLDER_UNITS 700
2029 .MAC SETBOLDER END
2030 .    if \\n[#IGNORE]=1 \{ .return \}
2031 .    ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
2032 .    el \{ .nr #BOLDER_UNITS \\$1 \}
2033 .END
2036 .MAC BOLDER END
2038 .bd \\n(.f \\n[#BOLDER_UNITS]
2039 .END
2042 .MAC BOLDERX END
2044 .bd \\n(.f
2045 .END
2047 \# +++CONDENSE/EXTEND+++
2049 \# CONDENSE/EXTEND
2050 \# ---------------
2051 \# *Arguments:
2052 \#   <percentage to condense/expand type size>
2053 \# *Function:
2054 \#   Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
2055 \#   new point size (for character width) from arg, and defines string
2056 \#   COND or EXT, which set the type size to the new character width,
2057 \#   and sets the height of type to the value stored in CURRENT_PT_SIZE
2058 \# *Notes:
2059 \#   CONDENSE_OR_EXTEND is invoked from the aliases
2060 \#   CONDENSE and EXTEND.  CONDENSE implies <100, EXTEND
2061 \#   implies >100.  Do not use a percent sign in the argument.
2063 \#   There is no default setting for CONDENSE or EXTEND.
2064 \#   80 is a good approximation of condensed type, 120 is okay
2065 \#   for extended.
2067 \#   The value set by CONDENSE or EXTEND applies to all
2068 \#   subsequent \*[COND] or \*[EXT] escapes until a new value is set.
2070 \#  \*[COND] or \*[EXT] must be turned off before all changes of point
2071 \#  size and reinvoked afterwards (if so desired).  This refers to
2072 \#  changes of point size via control lines AND with via inlines.
2074 .MAC CONDENSE_OR_EXTEND END
2075 .    if '\\$0'CONDENSE' \{\
2076 .       ds $COND_PERCENT \\$1
2077 .       if \\n[#PRINT_STYLE]=1 \{\
2078 .          rm $COND_PERCENT
2079 .          ds $COND_PERCENT 100
2080 .       \}
2081 .       ds COND \
2082 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2083 \R'#CONDENSE 1'\
2084 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2085 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2086 .       ds COND_FOR_SUP \
2087 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2088 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2089 .    \}
2090 .    if '\\$0'EXTEND' \{\
2091 .       ds $EXT_PERCENT \\$1
2092 .       if \\n[#PRINT_STYLE]=1 \{\
2093 .          rm $EXT_PERCENT
2094 .          ds $EXT_PERCENT 100
2095 .       \}
2096 .       ds EXT \
2097 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2098 \R'#EXTEND 1'\
2099 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2100 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2101 .       ds EXT_FOR_SUP \
2102 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2103 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2104 .    \}
2105 .END
2107 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2108 .ds EXTX  \ER'#EXTEND   0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2111 \# +++PAD LINES+++ (insert space)
2113 \# PAD MARKER
2114 \# ----------
2115 \# *Arguments:
2116 \#   <character to use for marking pad points>
2117 \# *Function:
2118 \#   Defines string $PAD_MARKER, used in PAD
2119 \# *Notes:
2120 \#   $PAD_MARKER is normally # (the pound sign).
2122 .MAC PAD_MARKER END
2123 .    ds $PAD_MARKER \\$1
2124 .END
2127 \# PAD
2128 \# ---
2129 \# *Argments:
2130 \#   "<string of text with padding markers inserted>"
2131 \# *Function:
2132 \#   Defines and redefines padding character (default=pound sign
2133 \#   unless padding character has been set with PAD_MARKER)
2134 \#   several times so that when the string is output at the end
2135 \#   of the macro, every # has been converted to an equal-sized
2136 \#   amount of padding (blank space) on a line. # is equivalent to
2137 \#   CompuGraphic's old <IS>.
2138 \# *Notes:
2139 \#   String tabs may be marked off during PAD.
2141 .MAC PAD END
2142 .    if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2143 .    nf
2144 .    if !d$PAD_MARKER \{ .ds $PAD_MARKER # \}
2145 .    char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2146 .    ds $FAMILY_FOR_PAD \\n[.fam]
2147 .    nr #FONT_FOR_PAD   \\n(.f
2148 .    nr #SIZE_FOR_PAD   \\n[.ps]
2149 .    ds $PAD_STRING \\$1
2150 .    as $PAD_STRING \Ekp
2151 .    di PAD_STRING
2152 .    fam \\*[$FAMILY_FOR_PAD]
2153 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2154 .    br
2155 .    di
2156 .    char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2157 .    di PAD_STRING
2158 .    fam \\*[$FAMILY_FOR_PAD]
2159 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2160 .    br
2161 .    di
2162 .    char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2163 .    ie \\n[#SILENT] \{\
2164 .       SILENT
2165 .       fam \\*[$FAMILY_FOR_PAD]
2166 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2167 .       br
2168 .       SILENT OFF
2169 .    \}
2170 .    el \{\
2171 .       fam \\*[$FAMILY_FOR_PAD]
2172 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2173 .       br
2174 .    \}
2175 .    if \\n[#FILL_MODE]=1 \{\
2176 .       fi
2177 .       rr #FILL_MODE
2178 .    \}
2179 .    rr #PAD_COUNT
2180 .    rr #SPACE_TO_END
2181 .    rr #PAD_SPACE
2182 .    rm $PAD_STRING
2183 .    rm PAD_STRING
2184 .    rchar #
2185 .END
2188 \# +++LEADERS+++
2190 \#  The leader mechanism is primitive, but it works.  Basically,
2191 \#  every macro in this set that includes a line length also sets
2192 \#  a single groff tab stop at the right hand end of the line.
2193 \#  That way, whenever Ctrl-A is invoked (always at the end of
2194 \#  an input line), leader of the correct length gets deposited.
2195 \#  Ctrl-A is accessed by the string LEADER (i.e. inline, as
2196 \#  \*[LEADER]).  Leaders within tabs get their length from the
2197 \#  tab line length.
2199 \# SET LEADER CHARACTER
2200 \# --------------------
2201 \# *Arguments:
2202 \#   <character to use whenever \*[LEADER] is invoked>
2203 \# *Function:
2204 \#   Set leader character.
2206 .MAC LEADER_CHARACTER END
2207 .    lc \\$1
2208 .END
2210 .ds LEADER \x01
2212 \# +++DROP CAPS+++
2214 \# DROP CAP FAMILY
2215 \# ---------------
2216 \# *Argument:
2217 \#   <family of drop cap>
2218 \# *Function:
2219 \#   Creates or modifies string $DC_FAM.
2221 .MAC DROPCAP_FAMILY END
2222 .    ds $DC_FAM \\$1
2223 .END
2226 \# DROP CAP FONT
2227 \# -------------
2228 \# *Argument:
2229 \#   <font of drop cap>
2230 \# *Function:
2231 \#   Creates or modifies string $DC_FT.
2233 .MAC DROPCAP_FONT END
2234 .    ds $DC_FT \\$1
2235 .END
2238 \# DROPCAP COLOR
2239 \# -------------
2240 \# *Arguments:
2241 \#   <pre-defined XCOLOR or NEWCOLOR>
2242 \# *Function:
2243 \#   Defines string $DC_COLOR to argument.
2244 \# *Notes:
2245 \#   User must define an XCOLOR or NEWCOLOR before using
2246 \#   DC_COLOR.
2248 .MAC DROPCAP_COLOR END
2249 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
2250 .    nr #DC_COLOR 1
2251 .    ds $DC_COLOR \\$1
2252 .END
2255 \# DROP CAP GUTTER
2256 \# ---------------
2257 \# *Argument:
2258 \#   <width of gutter between drop cap and indented text>
2259 \# *Function:
2260 \#   Creates or modifies register #DC_GUT.
2261 \# *Notes:
2262 \#   Requires unit of measure.  Default is 3p.
2264 .MAC DROPCAP_GUTTER END
2265 .    nr #DC_GUT (\\$1)
2266 .END
2269 \# DROP CAP ADJUST
2270 \# ---------------
2271 \# *Argument:
2272 \#   <+|- # of points to in/decrease point size of drop cap letter>
2273 \# *Function:
2274 \#   Creates or modifies string $DC_ADJUST.
2275 \# *Notes:
2276 \#   Despite its best efforts, DROPCAP doesn't always get the point
2277 \#   size of the drop cap critically perfect.  DROPCAP_ADJUST lets
2278 \#   the user add or subtract points (or fractions of points) to
2279 \#   get the size right.
2281 \#   Requires the + or - sign.
2283 .MAC DROPCAP_ADJUST END
2284 .    ds $DC_ADJUST \\$1
2285 .END
2288 \# DROP CAP
2289 \# --------
2290 \# *Arguments:
2291 \#   <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2292 \# *Function:
2293 \#   Calculates point size of dropcap based on # of lines passed as
2294 \#   arg 2.  Sets indent for text based on dropcap width+gutter.
2295 \#   Advances and prints dropcap; reverses and prints indented text
2296 \#   to bottom of dropcap, then resets indent to left margin (plus
2297 \#   any indent that was in effect prior to invoking DROPCAP).
2298 \# *Notes:
2299 \#   Drop caps put a strain on on resource-challenged systems.
2301 \#   Drop caps when using the doc processing macro PP only work with
2302 \#   initial paragraphs (i.e. at doc start, or after heads), only when
2303 \#   DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2304 \#   is TYPESET.  If these conditions aren't met, DROPCAPS is silently
2305 \#   ignored.
2307 \#   The COND or EXT argument are processed separately from all
2308 \#   other COND or EXT inlines or macros, hence passing COND or
2309 \#   EXT has no effect on running type.
2311 .MAC DROPCAP END
2312 .    if #IGNORE \{ .return \}
2313 .    br
2314 .    if \\n[#DOCS] \{\
2315 .       if \\n[#PRINT_STYLE]=1 \{ .return \}
2316 .       if \\n[#PRINT_STYLE]=2 \{\
2317 .          if \\n[#PP_STYLE]=2 \{ .return \}
2318 .          if \\n[#PP]>1 \{ .return \}
2319 .          ti 0
2320 .       \}
2321 .    \}
2322 .    ds $DROPCAP         \\$1
2323 .    nr #DC_LINES        \\$2-1
2324 .    ds $RESTORE_COND    \\*[$COND_PERCENT]
2325 .    if '\\$3'COND'      \{ .CONDENSE \\$4 \}
2326 .    if '\\$3'EXT'       \{ .EXTEND \\$4 \}
2327 .    if !r#DC_GUT        \{ .nr #DC_GUT (3p) \}
2328 .    ds $RESTORE_FAM     \\n[.fam]
2329 .    nr #RESTORE_FT      \\n(.f
2330 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2331 .    nr #RESTORE_INDENT  \\n(.i
2332 .    SIZESPECS
2333 .    nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2334 .    ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2335 .    el \{ .FAM \\*[$DC_FAM] \}
2336 .    ie !d$DC_FT \{ .FT \\n(.f \}
2337 .    el \{ .FT \\*[$DC_FT] \}
2338 .    while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2339 .       ps \\n[#PT_SIZE]u+100u
2340 .       SIZESPECS
2341 .       nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2342 .    \}
2343 .    if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2344 .    mk x
2345 .    sp \\n[#DC_LINES]v
2346 .    ie \\n[#DC_COLOR]=1 \{\
2347 .       ie !'\\$3'' \{\
2348 .          ie '\\$3'COND' \{ .PRINT \m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[] \}
2349 .          el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[] \}
2350 .       \}
2351 .       el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2352 .    \}
2353 .    el \{\
2354 .       ie !'\\$3'' \{\
2355 .          ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2356 .          el \{ .PRINT \\*[EXT]\\*[$DROPCAP]\\*[EXTX] \}
2357 .       \}
2358 .       el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2359 .    \}
2360 .    if '\\$3'COND' \{ \E*[COND] \}
2361 .    if '\\$3'EXT'  \{ \E*[EXT]  \}
2362 .    ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2363 .    el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2364 .    if '\\$3'COND' \{ \E*[CONDX]\c \}
2365 .    if '\\$3'EXT'  \{ \E*[EXTX]\c \}
2366 .    rt \\nxu
2367 .    FAM \\*[$RESTORE_FAM]
2368 .    FT  \\n[#RESTORE_FT]
2369 .    ps \\n[#RESTORE_PT_SIZE]u
2370 .    CONDENSE \\*[$RESTORE_COND]
2371 .    EXTEND   \\*[$RESTORE_EXT]
2372 .    ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2373 .    el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2374 .    rm $DROPCAP
2375 .    rr #DC_LINES
2376 .    rm $RESTORE_COND
2377 .    rm $RESTORE_EXT
2378 .    rm $RESTORE_FAM
2379 .    rr #RESTORE_FT
2380 .    rr #RESTORE_PT_SIZE
2381 .    rr #RESTORE_INDENT
2382 .    rr #DC_HEIGHT
2383 .    rr #GET_DC_HEIGHT
2384 .    rr x
2385 .END
2387 .MAC DROPCAP_OFF END
2388 '    in \\n[#RESTORE_INDENT]u
2389 .END
2392 \# RULE
2393 \# ----
2394 \# *Argument:
2395 \#   <none>
2396 \# *Function:
2397 \#   Draws a rule the length of the current measure.
2398 \# *Notes:
2400 .MAC RULE END
2402 .    EL
2403 .    if \\n(.u=1 \{\
2404 .       ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2405 .       nf
2406 .    \}
2407 .    ie \\n[#INDENT_ACTIVE] \{\
2408 .       nr #RESTORE_L_LENGTH \\n(.l
2409 .       if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2410 .       if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2411 .       PRINT \El'\En(.lu'
2412 .       ll \\n[#RESTORE_L_LENGTH]u
2413 .       rr #RESTORE_L_LENGTH
2414 .    \}
2415 .    el \{\
2416 .       PRINT \El'\En(.lu'
2417 .    \}
2418 .    QUAD \\*[$CURRENT_QUAD]
2419 .    rm $CURRENT_QUAD
2420 .    EL
2421 .END
2423 \# =====================================================================
2425 \# +++WORD AND SENTENCE SPACING+++
2427 \# WORD SPACE CONTROL
2428 \# ------------------
2429 \# *Argument:
2430 \#   <+|->wordspace | DEFAULT
2431 \# *Function:
2432 \#   Increases or decreases interword space by user supplied amount.
2433 \#   If DEFAULT, value is set to 12 (groff default).
2434 \# *Notes:
2435 \#   $WS_CONSTANT is the groff default word space.
2436 \#   $WS_VAR is the user supplied amount by which to in/decrease word space.
2437 \#   $WS is a concatenation of WS_CONSTANT and WS_VAR.
2439 \#   Because the user supplied value requires a literal + or - sign,
2440 \#   the macro argument is stored in a string.
2442 \#   \n[.sss] holds the current sentence space value.
2444 .MAC WS END
2445 .    ds $WS_CONSTANT 12
2446 .    ds $WS_VAR \\$1
2447 .    ie '\\$1'DEFAULT' \{ .ds $WS_VAR +0 \}
2448 .    el                \{ .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR]) \}
2449 .    ie \\n[.sss]=12   \{ .ss \\*[$WS] 12 \}
2450 .    el \{\
2451 .       ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
2452 .       SS \\*[$SS_VAR]
2453 .    \}
2454 .END
2457 \# SENTENCE SPACE CONTROL
2458 \# ----------------------
2459 \# *Argument:
2460 \#   <+-sentencespace> | 0 | DEFAULT
2461 \# *Function:
2462 \#   Increases or decreases sentence space by user supplied amount.
2463 \#   If 0, sentence spaces are ignored.  If DEFAULT, value is
2464 \#   set to 12 (groff default).
2465 \# *Notes:
2466 \#   Because the user supplied value requires a literal + or - sign,
2467 \#   the macro argument is stored in a string.
2469 \#   Sentence space applies only to input where sentences are separated
2470 \#   by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
2471 \#   Changing .SS when sentences are separated by only one space has
2472 \#   no effect on the space between sentences.
2474 \#   \n[.ss] holds the current wordspace value.
2475 \#   \n[.sss] holds the current sentence space value.
2477 .MAC SS END
2478 .    ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
2479 .    el \{\
2480 .       ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
2481 .       el \{\
2482 .          ds $SS_VAR \\$1
2483 .          ss \\n[.ss] (0\\*[$SS_VAR])
2484 .       \}
2485 .    \}
2486 .END
2489 \# =====================================================================
2491 \# +++INDENTS+++
2493 \# There are five styles of indents: left, right, both, temporary,
2494 \# and hanging.  Each is set/invoked with a different macro.
2495 \# Indent macros begin with the letter "I", hence .IL means "indent left,"
2496 \# .IR means "indent right," and so on.
2498 \# The first time any of the indent macros is used, it requires an
2499 \# argument--the size of the indent (with a unit of measure).  The
2500 \# size may also be entered using the \w escape--very useful
2501 \# for numbered lists using HI.  The unit of measure is required.
2502 \# Subsequent invocations don't require the argument; the indent
2503 \# measure remains the same until it's changed by invoking the macro
2504 \# with an argument again.
2506 \# If no indents are in effect, the arguments passed to indent macros are
2507 \# measured from the left and right margins of the page.  If a left indent
2508 \# or a right indent is already in effect, the arguments passed to
2509 \# the indent macros are calculated from the current values; in other words,
2510 \# the arguments are additive.  If you quit an indent and later return
2511 \# to it, its value will be the value last in effect, unless you pass
2512 \# it an argument.  If you do pass an argument, it is added to the last
2513 \# value in effect, unless you cleared the indent with one of
2514 \# .I<LRB>X/Q macros.
2516 \# Example
2517 \# -------
2519 \# .IL 2P
2520 \# ...some text...
2521 \# .IL 2P
2522 \# ...some text...
2523 \# .IQ
2524 \# ...some text...
2525 \# .IL
2526 \# ...some text...
2528 \# The first .IL 2P indents text 2P from the left margin.  The second
2529 \# .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
2530 \# .IQ turns the indent off.  The last .IL (which has no argument)
2531 \# takes its value from the total of all arguments passed to .IL (in
2532 \# this case, 2P and 2P), therefore it indents 2P+2P from the left
2533 \# margin, i.e. 4P.  If you wanted the last .IL to indent just 2P,
2534 \# you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
2535 \# the last .IL the argument 2P.
2537 \# To reverse the sense of an indent added to an indent, you may use
2538 \# negative values.
2540 \# Indents can be turned off individually with ILX, IRX, and IBX.
2541 \# LEFT and RIGHT indents may be combined and manipulated
2542 \# separately, (e.g. you can have an IL of 2P and an IR of 4P
2543 \# operative at the same time, and then change, say, the IL to
2544 \# 4P--thereby left indenting 6P--while the IR remains at 4P.
2546 \# IB automatically turns off IL and IR.  They have to be reinvoked
2547 \# again when needed. IL and IR automatically turn IB off; it, too,
2548 \# has to be reinvoked with needed.
2550 \# All indents can be turned off at once with IQ.  The ILX, IRX, IBX,
2551 \# and IQ macros simply turn the indents off; the values stored in
2552 \# the respective indent macros (IL, IR, IB) remain in effect.  If
2553 \# the user wishes to clear the values, the I<LRB>X macros should be
2554 \# invoked with the single argument CLEAR.  IQ CLEAR clears out
2555 \# the values stored for all indent styles.
2557 \# Indents *must* be turned off before settting string tabs
2558 \# inside PAD.  Generally, in order not to get confused, it's a
2559 \# good idea to turn all indents off before setting any tabs.
2561 \# TI and HI are special cases.  There's no need to turn them off,
2562 \# since they affect only one line--the first after their
2563 \# invocation.  Like the other indent styles, the first time
2564 \# they're invoked, they require a value in iPpcm; each subsequent
2565 \# invocation without an argument will use the same value.  To
2566 \# change the value, simply pass a new value.  Values for TI and HI
2567 \# are *not* additive.
2569 \# HI presupposes that you already have a left or both indent on.
2570 \# HI will never hang a line outside the left margin of a document
2571 \# or column.  In other words, you must have IL or IB on before you
2572 \# can use HI.
2574 \# INDENT LEFT
2575 \# -----------
2577 .MAC IL END
2578 .    if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2579 .    nr #INDENT_STYLE_LEFT  1
2580 .    nr #INDENT_ACTIVE      1
2581 .    nr #INDENT_LEFT_ACTIVE 1
2582 .    ie '\\$1'' \{\
2583 .       br
2584 .       in \\n[#L_INDENT]u
2585 .       ta \\n(.lu-\\n[#L_INDENT]u
2586 .    \}
2587 .    el \{\
2588 .       br
2589 .       nr #L_INDENT +(\\$1)
2590 .       in \\n[#L_INDENT]u
2591 .       ta \\n(.lu-\\n[#L_INDENT]u
2592 .    \}
2593 .END
2596 \# +++INDENT RIGHT+++
2598 .MAC IR END
2599 .    if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2600 .    nr #INDENT_STYLE_RIGHT   1
2601 .    nr #INDENT_ACTIVE        1
2602 .    nr #INDENT_RIGHT_ACTIVE 1
2603 .    ie '\\$1'' \{\
2604 .       br
2605 .       ie \\n[#TAB_ACTIVE] \{\
2606 .          ll \\n(.lu-\\n[#R_INDENT]u
2607 .          ta \\n(.lu-\\n[#L_INDENT]u
2608 .       \}
2609 .       el \{\
2610 .          ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2611 .          ta \\n(.lu-\\n[#L_INDENT]u
2612 .       \}
2613 .    \}
2614 .    el \{\
2615 .       br
2616 .       nr #R_INDENT +(\\$1)
2617 .       ie \\n[#TAB_ACTIVE] \{\
2618 .          ll \\n(.lu-\\n[#R_INDENT]u
2619 .          ta \\n(.lu-\\n[#L_INDENT]u
2620 .       \}
2621 .       el \{\
2622 .          ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2623 .          ta \\n(.lu-\\n[#L_INDENT]u
2624 .       \}
2625 .    \}
2626 .END
2629 \# +++INDENT BOTH+++
2631 .MAC IB END
2632 .    if \\n[#INDENT_STYLE_LEFT]  \{ .ILX \}
2633 .    if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
2634 .    nr #INDENT_STYLE_BOTH  1
2635 .    nr #INDENT_ACTIVE      1
2636 .    nr #INDENT_BOTH_ACTIVE 1
2637 .    ie '\\$1'' \{\
2638 .       br
2639 .       in \\n[#BL_INDENT]u
2640 .       ie \\n[#TAB_ACTIVE] \{\
2641 .          ll \\n(.lu-\\n[#BR_INDENT]u
2642 .          ta \\n(.lu-\\n[#BR_INDENT]u
2643 .       \}
2644 .       el \{\
2645 .          ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2646 .          ta \\n(.lu-\\n[#BR_INDENT]u
2647 .       \}
2648 .    \}
2649 .    el \{\
2650 .       br
2651 .       nr #BL_INDENT (\\n[#INDENT]+\\$1)
2652 .       ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
2653 .       el                  \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
2654 .       ie \\n[#TAB_ACTIVE] \{\
2655 .          in \\n[#BL_INDENT]u
2656 .          ll \\n(.lu-\\n[#BR_INDENT]u
2657 .          ta \\n(.lu-\\n[#BL_INDENT]u
2658 .       \}
2659 .       el \{\
2660 .          in \\n[#BL_INDENT]u
2661 .          ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2662 .          ta \\n(.lu-\\n[#BR_INDENT]u
2663 .       \}
2664 .    \}
2665 .END
2668 \# +++TEMPORARY INDENT+++
2670 .MAC TI END
2671 .    br
2672 .    ie '\\$1'' \{\
2673 .       ti \\n[#T_INDENT]u
2674 .       if \\n[#INDENT_LEFT_ACTIVE] \{\
2675 .          ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
2676 .       \}
2677 .       if \\n[#INDENT_BOTH_ACTIVE] \{\
2678 .          ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
2679 .       \}
2680 .    \}
2681 .    el \{\
2682 .       nr #T_INDENT (\\$1)
2683 .       ti \\n[#T_INDENT]u
2684 .    \}
2685 .END
2688 \# +++HANGING INDENT+++
2690 .MAC HI END
2691 .    ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
2692 .    el \{\
2693 .       nr #HL_INDENT (\\$1)
2694 .       ti -\\n[#HL_INDENT]u
2695 .    \}
2696 .END
2699 \# +++INDENTS OFF+++
2701 .MAC ILX END
2702 .    br
2703 .    in 0
2704 .    rr #INDENT_LEFT_ACTIVE
2705 .    if '\\$1'CLEAR' \{\
2706 .       rr #L_INDENT
2707 .       rr #INDENT_STYLE_LEFT
2708 .    \}
2709 .END
2712 .MAC IRX END
2713 .    br
2714 .    rr #INDENT_RIGHT_ACTIVE
2715 .    ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2716 .    el \{\
2717 .       ie \\n[#COLUMNS] \{\
2718 .          ll \\n[#COL_L_LENGTH]u
2719 .          ta \\n(.lu
2720 .       \}
2721 .       el \{\
2722 .          ll \\n[#L_LENGTH]u
2723 .          ta \\n(.lu
2724 .       \}
2725 .    \}
2726 .    if '\\$1'CLEAR' \{\
2727 .       rr #R_INDENT
2728 .       rr #INDENT_STYLE_RIGHT
2729 .    \}
2730 .END
2733 .MAC IBX END
2734 .    br
2735 .    in 0
2736 .    rr #INDENT_BOTH_ACTIVE
2737 .    ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2738 .    el \{\
2739 .       ie \\n[#COLUMNS] \{\
2740 .          ll \\n[#COL_L_LENGTH]u
2741 .          ta \\n(.lu
2742 .       \}
2743 .       el \{\
2744 .          ll \\n[#L_LENGTH]u
2745 .          ta \\n(.lu
2746 .       \}
2747 .    \}
2748 .    if '\\$1'CLEAR' \{\
2749 .       rr #BL_INDENT
2750 .       rr #BR_INDENT
2751 .       rr #INDENT_STYLE_BOTH
2752 .    \}
2753 .END
2756 .MAC IX END
2757 .    if '\\$0'IX' \{\
2758 .       if !\\n[#IX_WARN] \{\
2759 .          tm1 "[mom]: Use of .IX is now deprecated.  Use .IQ instead.
2760 .          tm1 "      .IX will continue to behave as before, but to
2761 .          tm1 "       avoid this message, please update your document.
2762 .          nr #IX_WARN 1
2763 .       \}
2764 .    \}
2765 .    br
2766 .    in 0
2767 .    rr #INDENT_LEFT_ACTIVE
2768 .    rr #INDENT_RIGHT_ACTIVE
2769 .    rr #INDENT_BOTH_ACTIVE
2770 .    if \\n[#INDENT_STYLE_RIGHT] \{\
2771 .       ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2772 .       el \{\
2773 .          ie \\n[#COLUMNS] \{\
2774 .             ll \\n[#COL_L_LENGTH]u
2775 .             ta \\n(.lu
2776 .          \}
2777 .          el \{\
2778 .             ll \\n[#L_LENGTH]u
2779 .             ta \\n(.lu
2780 .          \}
2781 .       \}
2782 .    \}
2783 .    if \\n[#INDENT_STYLE_BOTH] \{\
2784 .       ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2785 .       el \{\
2786 .          ie \\n[#COLUMNS] \{\
2787 .             ll \\n[#COL_L_LENGTH]u
2788 .             ta \\n(.lu
2789 .          \}
2790 .          el \{\
2791 .             ll \\n[#L_LENGTH]u
2792 .             ta \\n(.lu
2793 .          \}
2794 .       \}
2795 .    \}
2796 .    if '\\$1'CLEAR' \{\
2797 .       if \\n[#INDENT_STYLE_RIGHT] \{\
2798 .          ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2799 .          el \{\
2800 .             ie \\n[#COLUMNS] \{\
2801 .                ll \\n[#COL_L_LENGTH]u
2802 .                ta \\n(.lu
2803 .             \}
2804 .             el \{\
2805 .                ll \\n[#L_LENGTH]u
2806 .                ta \\n(.lu
2807 .             \}
2808 .          \}
2809 .       \}
2810 .       if \\n[#INDENT_STYLE_BOTH] \{\
2811 .          ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2812 .          el \{\
2813 .             ie \\n[#COLUMNS] \{\
2814 .                ll \\n[#COL_L_LENGTH]u
2815 .                ta \\n(.lu
2816 .             \}
2817 .             el \{\
2818 .                ll \\n[#L_LENGTH]u
2819 .                ta \\n(.lu
2820 .             \}
2821 .          \}
2822 .       \}
2823 .       rr #L_INDENT
2824 .       rr #R_INDENT
2825 .       rr #BL_INDENT
2826 .       rr #BR_INDENT
2827 .       rr #T_INDENT
2828 .       rr #H_INDENT
2829 .       rr #INDENT_STYLE_LEFT
2830 .       rr #INDENT_STYLE_RIGHT
2831 .       rr #INDENT_STYLE_BOTH
2832 .    \}
2833 .    rr #INDENT_ACTIVE
2834 .END
2836 \# =====================================================================
2838 \# +++MULTIPLE COLUMNS+++
2840 \# MULTIPLE COLUMNS ON
2841 \# -------------------
2842 \# *Arguments:
2843 \#   <none>
2844 \# *Function:
2845 \#   Marks the top of a column set
2847 .MAC MCO END
2848 .mk c
2849 .END
2851 \# MULTIPLE COLUMN RETURN
2852 \# ----------------------
2853 \# *Arguments:
2854 \#   <none>
2855 \# *Function:
2856 \#   Returns to the top of a column set
2858 .MAC MCR END
2859 .    sp |\\ncu
2860 .END
2862 \# MULTIPLE COLUMNS OFF
2863 \# --------------------
2864 \# *Arguments:
2865 \#   <none> | <lead to advance beneath bottom of deepest column>
2866 \# *Function:
2867 \#   Advances to the end of a column set
2868 \# *Notes:
2869 \#   With no argument, advances to the next baseline (at the current
2870 \#   leading value) beneath the longest column.  With an argument
2871 \#   (which requires a unit of measure), advances arg distance
2872 \#   beneath the baseline of the deepest column.  If the argument
2873 \#   is zero, advances to the baseline of the deepest column.
2875 .MAC MCX END
2876 .    ie '\\$1'' \{\
2877 .       TQ
2878 .       sp |\\n(.hu
2879 .    \}
2880 .    el \{\
2881 .       nr #MCX_ALD (\\$1)
2882 .       TQ
2883 .       ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
2884 .       el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
2885 .       rr #MCX_ALD (\\$1)
2886 .    \}
2887 .END
2889 \# =====================================================================
2891 \# +++TYPESETTING SUPPORT MACROS+++
2893 \# TRAP
2894 \# ----
2895 \# *Arguments:
2896 \#   toggle
2897 \# *Function:
2898 \#   Enables/disables traps.
2899 \# *Notes:
2900 \#   EL and TN don't function as advertised on the last line before
2901 \#   a trap (when they break the preceding line, they spring the
2902 \#   trap, and groff won't back up to the line preceding the trap).
2903 \#   TRAP is a kludge to get EL and TN work properly on last lines.
2904 \#   The user simply enloses the offending lines in TRAP OFF/TRAP.
2906 .MAC TRAP END
2907 .    ie '\\$1'' \{ .vpt 1 \}
2908 .    el \{ .vpt 0 \}
2909 .END
2912 \# SILENT
2913 \# ------
2914 \# *Arguments:
2915 \#   <none> | <anything>
2916 \# *Function:
2917 \#   Diverts text so that it doesn't print, or turns the function off.
2918 \# *Notes:
2919 \#   Useful for setting up autotabs where you don't want the line with
2920 \#   the tab marks to print.
2922 \#   Also aliased as COMMENT, in case user wants to input a batch of
2923 \#   text that doesn't print.
2925 .MAC SILENT END
2926 .    nr #SILENT 1
2927 .    if \\n[#QUAD] \{ .br \}
2928 .    ie '\\$1'' \{ .di NO_FLASH \}
2929 .    el \{\
2930 .       br
2931 .       di
2932 .       rm NO_FLASH
2933 .       rr #SILENT
2934 .    \}
2935 .END
2938 \# PRINT
2939 \# -----
2940 \# *Arguments:
2941 \#   <anything>
2942 \# *Function:
2943 \#   Prints anything.  A macro that helps keep my code nicely indented.
2945 .MAC PRINT END
2946 \\$*
2947 .END
2950 \# CAPS
2951 \# ----
2952 \# *Arguments:
2953 \#   <none> | <anything>
2954 \# *Function:
2955 \#   Converts text to caps, or, if OFF, reverts to normal caps/lc.
2957 .MAC CAPS END
2958 .    ie '\\$1'' \{\
2959 .       tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
2960 .       tr Ã \[`A]
2961 .       tr Ã¢\[^A]
2962 .       tr Ã¡\['A]
2963 .       tr Ã¤\[:A]
2964 .       tr Ã¥\[oA]
2965 .       tr Ã£\[~A]
2966 .       tr Ã¦\[AE]
2967 .       tr Ã¨\[`E]
2968 .       tr Ãª\[^E]
2969 .       tr Ã©\['E]
2970 .       tr Ã«\[:E]
2971 .       tr Ã¬\[`I]
2972 .       tr Ã®\[^I]
2973 .       tr Ã­\['I]
2974 .       tr Ã¯\[:I]
2975 .       tr Ã²\[`O]
2976 .       tr Ã´\[^O]
2977 .       tr Ã³\['O]
2978 .       tr Ã¶\[:O]
2979 .       tr Ãµ\[~O]
2980 .       tr Ã¸\[/O]
2981 .       tr Ã¹\[`U]
2982 .       tr Ã»\[^U]
2983 .       tr Ãº\['U]
2984 .       tr Ã¼\[:U]
2985 .       tr Ã§\[,C]
2986 .       tr Ã°\[-D]
2987 .       tr Ã±\[~N]
2988 .       tr Ã¾\[TP]
2989 .       tr Ã½\['Y]
2990 .       tr Ã¿\[:Y]
2991 .       nr #CAPS_ON 1
2992 .    \}
2993 .    el \{\
2994 .       tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
2995 .       tr Ã \[`a]
2996 .       tr Ã¢\[^a]
2997 .       tr Ã¡\['a]
2998 .       tr Ã¤\[:a]
2999 .       tr Ã¥\[oa]
3000 .       tr Ã£\[~a]
3001 .       tr Ã¦\[ae]
3002 .       tr Ã¨\[`e]
3003 .       tr Ãª\[^e]
3004 .       tr Ã©\['e]
3005 .       tr Ã«\[:e]
3006 .       tr Ã¬\[`i]
3007 .       tr Ã®\[^i]
3008 .       tr Ã­\['i]
3009 .       tr Ã¯\[:i]
3010 .       tr Ã²\[`o]
3011 .       tr Ã´\[^o]
3012 .       tr Ã³\['o]
3013 .       tr Ã¶\[:o]
3014 .       tr Ãµ\[~o]
3015 .       tr Ã¸\[/o]
3016 .       tr Ã¹\[`u]
3017 .       tr Ã»\[^u]
3018 .       tr Ãº\['u]
3019 .       tr Ã¼\[:u]
3020 .       tr Ã§\[,c]
3021 .       tr Ã°\[Sd]
3022 .       tr Ã±\[~n]
3023 .       tr Ã¾\[Tp]
3024 .       tr Ã½\['y]
3025 .       tr Ã¿\[:y]
3026 .       rr #CAPS_ON
3027 .    \}
3028 .END
3030 \# SIZESPECS
3031 \# ---------
3032 \# Argument:
3033 \#   <none>
3034 \# Function:
3035 \#   Gets cap-height, x-height, and descender depth of the
3036 \#   current font at the current point size.
3037 \# *Notes:
3038 \#   The routine is diverted so it remains invisible to output.
3040 .MAC SIZESPECS END
3041 .    di TYPESIZE
3042 E\\R'#CAP_HEIGHT \\n[.cht]'
3043 e\\R'#X_HEIGHT \\n[.cht]'
3044 y\\R'#DESCENDER \\n[.cdp]'
3045 .    br
3046 .    di
3047 .END
3049 \# =====================================================================
3051 \# +++TYPESETTING ALIASES+++
3053 .ALIAS    CENTRE          CENTER
3054 .ALIAS    COLOUR          COLOR
3055 .ALIAS    COMMENT         SILENT
3056 .ALIAS    CONDENSE        CONDENSE_OR_EXTEND
3057 .ALIAS    EXTEND          CONDENSE_OR_EXTEND
3058 .ALIAS    FAM             FAMILY
3059 .ALIAS    HYPHENATE       HY
3060 .ALIAS    HYPHENATION     HY
3061 .ALIAS    HYSET           HY_SET
3062 .ALIAS    IBQ             IBX
3063 .ALIAS    ILQ             ILX
3064 .ALIAS    IQ              IX
3065 .ALIAS    IRQ             IRX
3066 .ALIAS    LIG             LIGATURES
3067 .ALIAS    NEWCOLOUR       NEWCOLOR
3068 .ALIAS    PADMARKER       PAD_MARKER
3069 .ALIAS    TABSET          TAB_SET
3070 .ALIAS    TB              TAB
3071 .ALIAS    UNDERSCORE_2    UNDERSCORE2
3072 .ALIAS    XCOLOUR         XCOLOUR
3075 \# ====================================================================
3077 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
3078 \# ===============================================
3080 \# +++PAGE DIMENSIONS+++
3082 \# PAPER SIZE
3083 \# ----------
3084 \# *Arguments:
3085 \#   LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
3086 \# *Function:
3087 \#   Sets up margins for different paper sizes.
3089 .MAC PAPER END
3090 .    ds $PAPER \\$1
3091 .    if '\\*[$PAPER]'LETTER' \{\
3092 .       PAGEWIDTH  8.5i
3093 .       PAGELENGTH 11i
3094 .    \}
3095 .    if '\\*[$PAPER]'LEGAL' \{\
3096 .       PAGEWIDTH  8.5i
3097 .       PAGELENGTH 14i
3098 .    \}
3099 .    if '\\*[$PAPER]'STATEMENT' \{\
3100 .       PAGEWIDTH  5.5i
3101 .       PAGELENGTH 8.5i
3102 .    \}
3103 .    if '\\*[$PAPER]'TABLOID' \{\
3104 .       PAGEWIDTH  11i
3105 .       PAGELENGTH 17i
3106 .    \}
3107 .    if '\\*[$PAPER]'LEDGER' \{\
3108 .       PAGEWIDTH  17i
3109 .       PAGELENGTH 11i
3110 .    \}
3111 .    if '\\*[$PAPER]'FOLIO' \{\
3112 .       PAGEWIDTH  8.5i
3113 .       PAGELENGTH 13i
3114 .    \}
3115 .    if '\\*[$PAPER]'QUARTO' \{\
3116 .       PAGEWIDTH  610p
3117 .       PAGELENGTH 780p
3118 .    \}
3119 .    if '\\*[$PAPER]'10x14' \{\
3120 .       PAGEWIDTH  10i
3121 .       PAGELENGTH 14i
3122 .    \}
3123 .    if '\\*[$PAPER]'EXECUTIVE' \{\
3124 .       PAGEWIDTH  7.25i
3125 .       PAGELENGTH 10.5i
3126 .    \}
3127 .    if '\\*[$PAPER]'A3' \{\
3128 .       PAGEWIDTH  842p
3129 .       PAGELENGTH 1190p
3130 .    \}
3131 .    if '\\*[$PAPER]'A4' \{\
3132 .       PAGEWIDTH  595p
3133 .       PAGELENGTH 842p
3134 .    \}
3135 .    if '\\*[$PAPER]'A5' \{\
3136 .       PAGEWIDTH  421p
3137 .       PAGELENGTH 595p
3138 .    \}
3139 .    if '\\*[$PAPER]'B4' \{\
3140 .       PAGEWIDTH  709p
3141 .       PAGELENGTH 1002p
3142 .    \}
3143 .    if '\\*[$PAPER]'B5' \{\
3144 .       PAGEWIDTH  501p
3145 .       PAGELENGTH 709p
3146 .    \}
3147 .    if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
3148 .    if !r#R_MARGIN \{ .R_MARGIN 1i \}
3149 .END
3152 \# ====================================================================
3154 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
3156 \# PRINTSTYLE
3157 \# ----------
3158 \# *Arguments:
3159 \#   TYPESET | TYPEWRITE [SINGLESPACE]
3160 \# *Function:
3161 \#   Sets type specs for typewriter-style or typeset output.
3162 \# *Notes:
3163 \#   Number registers: TYPEWRITE=1, TYPESET=2.
3165 .MAC PRINTSTYLE END
3166 .    if !d$PAPER \{ .PAPER LETTER \}
3167 .    if '\\$1'TYPEWRITE' \{\
3168 .       nr #PRINT_STYLE 1
3169 .       if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3170 .       if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3171 .       fam  C
3172 .       ft   R
3173 .       ps   12
3174 .       color 0
3175 .       ie '\\$2'SINGLESPACE' \{\
3176 .           nr #SINGLE_SPACE 1
3177 .           vs 12
3178 .       \}
3179 .       el \{ .vs 24 \}
3180 .       QUAD    L
3181 .       HY      OFF
3182 .       SMARTQUOTES OFF
3183 .       if !\\n[#PP_INDENT] \{\
3184 .          in 3P                 \"Set indent
3185 .          nr #PP_INDENT \\n(.i  \"Read into #PP_INDENT
3186 .          in 0                  \"Remove indent
3187 .       \}
3188 .       HDRFTR_RIGHT_CAPS
3189 .       nr #BOLDER_UNITS 0
3190 .       nr #CONDENSE 0
3191 .       nr #EXTEND 0
3192 .       rm IT
3193 .       rm BD
3194 .       rm BDI
3195 .       rm PREV
3196 .       UNDERLINE_SLANT
3197 .       UNDERLINE_ITALIC
3198 .       UNDERLINE_QUOTES
3199 .       nr #IGNORE_COLUMNS 1
3200 .       char \(em --
3201 .    \}
3202 .    if '\\$1'TYPESET' \{\
3203 .       nr #PRINT_STYLE 2
3204 .       if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3205 .       if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3206 .       FAMILY  T
3207 .       FT      R
3208 .       if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
3209 .       if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
3210 .       JUSTIFY
3211 .       HY
3212 .       HY_SET 2 36p 1p
3213 .       KERN
3214 .       LIG
3215 .       SS 0
3216 .       SMARTQUOTES
3217 .       if !\\n[#PP_INDENT] \{\
3218 .          in 2m                 \"Set indent
3219 .          nr #PP_INDENT \\n(.i  \"Read into #PP_INDENT
3220 .          in 0                  \"Remove indent
3221 .       \}
3222 .       HDRFTR_RIGHT_CAPS
3223 .       rr #IGNORE_COLUMNS
3224 .    \}
3225 .END
3228 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
3230 \# ITALIC MEANS ITALIC
3231 \# -------------------
3232 \# *Argument:
3233 \#   <none>
3234 \# *Function:
3235 \#   Instructs TYPEWRITE to treat italics as italics, whether
3236 \#   invoked via control lines or inline.
3237 \# *Notes:
3238 \#   ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
3239 \#   hence invoking the one automatically turns off the other.
3241 .MAC ITALIC_MEANS_ITALIC END
3242 .    if \\n[#PRINT_STYLE]=1 \{\
3243 .       nr #ITALIC_MEANS_ITALIC 1
3244 .       rr #UNDERLINE_ITALIC
3245 .       rm ROM
3246 .       rm IT
3247 .       rm PREV
3248 .       ds ROM  \EfR
3249 .       ds IT   \EfI
3250 .       ds PREV \EfR
3251 .    \}
3252 .END
3255 \# UNDERLINE ITALIC
3256 \# ----------------
3257 \# *Argument:
3258 \#   <none>
3259 \# *Function:
3260 \#   Instructs TYPEWRITE to underline italics, whether invoked
3261 \#   via control lines or inline.
3262 \# *Notes:
3263 \#   UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
3264 \#   hence invoking the one automatically turns off the other.
3266 \#   UNDERLINE_ITALIC is the default for TYPEWRITE.
3268 .MAC UNDERLINE_ITALIC END
3269 .    if \\n[#PRINT_STYLE]=1 \{\
3270 .       nr #UNDERLINE_ITALIC 1
3271 .       rr #ITALIC_MEANS_ITALIC
3272 .       rm ROM
3273 .       rm IT
3274 .       rm PREV
3275 .       ds ROM  \E*[ULX]
3276 .       ds IT   \E*[UL]
3277 .       ds PREV \E*[ULX]
3278 .    \}
3279 .END
3282 \# UNDERLINE SLANT
3283 \# ---------------
3284 \# *Arguments:
3285 \#   <none> | <anything>
3286 \# *Function:
3287 \#   Instructs TYPEWRITE to underline occurences of \*[SLANT], or
3288 \#   turns feature off.
3289 \# *Notes:
3290 \#   Users may want \*[SLANT] to mean slant in TYPEWRITE, although
3291 \#   most of the time, \*[SLANT] most likely means the user wanted
3292 \#   italic but didn't have it, ergo the need to tell TYPEWRITE to
3293 \#   treat \*[SLANT] as italic (i.e. underlined).
3295 \#   UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
3296 \#   hence invoking the one automatically turns off the other.
3298 \#   UNDERLINE_SLANT is the default for TYPEWRITE.
3300 .MAC UNDERLINE_SLANT END
3301 .    if \\n[#PRINT_STYLE]=1 \{\
3302 .       rr #SLANT_MEANS_SLANT
3303 .       nr #UNDERLINE_SLANT 1
3304 .       rm SLANT
3305 .       rm SLANTX
3306 .       ds SLANT  \ER'#SLANT_ON 1'\E*[UL]
3307 .       ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
3308 .    \}
3309 .END
3312 .MAC SLANT_MEANS_SLANT END
3313 .    if \\n[#PRINT_STYLE]=1 \{\
3314 .       rr #UNDERLINE_SLANT
3315 .       nr #SLANT_MEANS_SLANT 1
3316 .       rm SLANT
3317 .       rm SLANTX
3318 .       ds SLANT  \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
3319 .       ds SLANTX \ER'#SLANT_ON 0'\ES'0'
3320 .    \}
3321 .END
3324 .MAC IGNORE_COLUMNS END
3325 .    if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
3326 .END
3329 \# ====================================================================
3331 \# +++COPY STYLE -- DRAFT OR FINAL+++
3333 \# COPY STYLE
3334 \# ----------
3335 \# *Arguments:
3336 \#   DRAFT | FINAL
3337 \# *Function:
3338 \#   Sets registers that are used to determine what to put
3339 \#   in the default header, and how to number pages.
3340 \# *Notes:
3341 \#   DOCTYPE must come before COPYSTYLE.
3343 .MAC COPYSTYLE END
3344 .    ds $COPY_STYLE \\$1
3345 .    if '\\*[$COPY_STYLE]'DRAFT' \{\
3346 .       nr #COPY_STYLE 1
3347 .       if !d$DRAFT \{ .DRAFT 1 \}
3348 .    \}
3349 .    if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2         \}
3350 .    if !d$CHAPTER_STRING        \{ .CHAPTER_STRING "Chapter" \}
3351 .    if !d$DRAFT_STRING          \{ .DRAFT_STRING "Draft"     \}
3352 .    if !d$REVISION_STRING       \{ .REVISION_STRING "Rev."   \}
3353 \# Default
3354 .    if \\n[#DOC_TYPE]=1 \{\
3355 .       ie \\n[#COPY_STYLE]=1 \{\
3356 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3357 .          el \{ .PAGENUM_STYLE roman \}
3358 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3359 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
3360 .                ds $HDRFTR_CENTER
3361 .             \}
3362 .             el \{\
3363 .                ie '\\*[$REVISION]'' \{\
3364 .                   ds $HDRFTR_CENTER \
3365                     \\*[$DRAFT_STRING]\\*[$DRAFT]
3366 .                \}
3367 .                el \{\
3368 .                   ds $HDRFTR_CENTER \
3369                     \\*[$DRAFT_STRING]\\*[$DRAFT], \
3370                     \\*[$REVISION_STRING] \\*[$REVISION]
3371 .                \}
3372 .             \}
3373 .          \}
3374 .       \}
3375 .       el \{\
3376 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3377 .          el \{ .PAGENUM_STYLE DIGIT \}
3378 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3379 .             ds $HDRFTR_CENTER
3380 .             rr #USER_DEF_HDRFTR_CENTER
3381 .          \}
3382 .       \}
3383 .    \}
3384 \# Chapter
3385 .    if \\n[#DOC_TYPE]=2 \{\
3386 \# Copystyle DRAFT
3387 .       ie \\n[#COPY_STYLE]=1 \{\
3388 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3389 .          el \{ .PAGENUM_STYLE roman \}
3390 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3391 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
3392 .                ie '\\*[$CHAPTER]'' \{\
3393 .                   ie !'\\*[$CHAPTER_TITLE]'' \{\
3394 .                      ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3395 .                   \}
3396 .                   el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \}
3397 .                \}
3398 .                el \{\
3399 .                   ie !'\\*[$CHAPTER_TITLE]'' \{\
3400 .                      ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3401 .                   \}
3402 .                   el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3403 .                \}
3404 .             \}
3405 .             el \{\
3406 .                ie '\\*[$REVISION]'' \{\
3407 .                   ie '\\*[$CHAPTER]'' \{\
3408 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3409 .                         ie '\\*[$DRAFT]'' \{\
3410 .                            ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3411 .                         \}
3412 .                         el \{\
3413 .                            ds $HDRFTR_CENTER \
3414                              \\*[$CHAPTER_TITLE], \
3415                              \\*[$DRAFT_STRING]\\*[$DRAFT]
3416 .                         \}
3417 .                      \}
3418 .                      el \{\
3419 .                         ie '\\*[$DRAFT]'' \{\
3420 .                            ds $HDRFTR_CENTER \
3421                              \\*[$CHAPTER_STRING]
3422 .                         \}
3423 .                         el \{\
3424 .                            ds $HDRFTR_CENTER \
3425                              \\*[$CHAPTER_STRING], \
3426                              \\*[$DRAFT_STRING]\\*[$DRAFT]
3427 .                         \}
3428 .                      \}
3429 .                   \}
3430 .                   el \{\
3431 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3432 .                         ie '\\*[$DRAFT]'' \{\
3433 .                            ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3434 .                         \}
3435 .                         el \{\
3436 .                            ds $HDRFTR_CENTER \
3437                              \\*[$CHAPTER_TITLE], \
3438                              \\*[$DRAFT_STRING]\\*[$DRAFT]
3439 .                         \}
3440 .                      \}
3441 .                      el \{\
3442 .                         ie '\\*[$DRAFT]'' \{\
3443 .                            ds $HDRFTR_CENTER \
3444                              \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3445 .                         \}
3446 .                         el \{\
3447 .                            ds $HDRFTR_CENTER \
3448                              \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3449                              \\*[$DRAFT_STRING]\\*[$DRAFT]
3450 .                         \}
3451 .                      \}
3452 .                   \}
3453 .                \}
3454 .                el \{\
3455 .                   ie '\\*[$CHAPTER]'' \{\
3456 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3457 .                         ie '\\*[$DRAFT]'' \{\
3458 .                            ds $HDRFTR_CENTER \
3459                              \\*[$CHAPTER_TITLE], \
3460                              \\*[$REVISION_STRING] \\*[$REVISION] 
3461 .                         \}
3462 .                         el \{\
3463 .                            ds $HDRFTR_CENTER \
3464                              \\*[$CHAPTER_TITLE], \
3465                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
3466                              \\*[$REVISION_STRING] \\*[$REVISION] 
3467 .                         \}
3468 .                      \}
3469 .                      el \{\
3470 .                         ie '\\*[$DRAFT]'' \{\
3471 .                            ds $HDRFTR_CENTER \
3472                              \\*[$CHAPTER_STRING], \
3473                              \\*[$REVISION_STRING] \\*[$REVISION] 
3474 .                         \}
3475 .                         el \{\
3476 .                            ds $HDRFTR_CENTER \
3477                              \\*[$CHAPTER_STRING], \
3478                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
3479                              \\*[$REVISION_STRING] \\*[$REVISION] 
3480 .                         \}
3481 .                      \}
3482 .                   \}
3483 .                   el \{\
3484 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3485 .                         ie '\\*[$DRAFT]'' \{\
3486 .                            ds $HDRFTR_CENTER \
3487                              \\*[$CHAPTER_TITLE], \
3488                              \\*[$REVISION_STRING] \\*[$REVISION] 
3489 .                         \}
3490 .                         el \{\
3491 .                            ds $HDRFTR_CENTER \
3492                              \\*[$CHAPTER_TITLE], \
3493                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
3494                              \\*[$REVISION_STRING] \\*[$REVISION] 
3495 .                         \}
3496 .                      \}
3497 .                      el \{\
3498 .                         ie '\\*[$DRAFT]'' \{\
3499 .                            ds $HDRFTR_CENTER \
3500                              \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3501                              \\*[$REVISION_STRING] \\*[$REVISION] 
3502 .                         \}
3503 .                         el \{\
3504 .                            ds $HDRFTR_CENTER \
3505                              \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3506                              \\*[$DRAFT_STRING]\\*[$DRAFT], \
3507                              \\*[$REVISION_STRING] \\*[$REVISION] 
3508 .                         \}
3509 .                      \}
3510 .                   \}
3511 .                \}
3512 .             \}
3513 .          \}
3514 .       \}
3515 \# Copystyle FINAL
3516 .       el \{\
3517 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3518 .             ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3519 .             el \{ .PAGENUM_STYLE DIGIT \}
3520 .             ie '\\*[$CHAPTER]'' \{\
3521 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
3522 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3523 .                \}
3524 .                el \{\
3525 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
3526 .                \}
3527 .             \}
3528 .             el \{\
3529 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
3530 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3531 .                \}
3532 .                el \{\
3533 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3534 .                \}
3535 .             \}
3536 .          \}
3537 .       \}
3538 .    \}
3539 \# Named
3540 .    if \\n[#DOC_TYPE]=3 \{\
3541 .       ie \\n[#COPY_STYLE]=1 \{\
3542 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3543 .          el \{ .PAGENUM_STYLE roman \}
3544 .          ie \\n[#DRAFT_WITH_PAGENUM] \{\
3545 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3546 .          \}
3547 .          el \{\
3548 .             if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3549 .                ie '\\*[$REVISION]'' \{\
3550 .                   ie '\\*[$DRAFT]'' \{\
3551 .                      ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3552 .                   \}
3553 .                   el \{\
3554 .                      ds $HDRFTR_CENTER \
3555                        \\*[$DOC_TYPE], \
3556                        \\*[$DRAFT_STRING]\\*[$DRAFT]
3557 .                   \}
3558 .                \}
3559 .                el \{\
3560 .                   ie '\\*[$DRAFT]'' \{\
3561 .                      ds $HDRFTR_CENTER \
3562                        \\*[$DOC_TYPE], \
3563                        \\*[$REVISION_STRING] \\*[$REVISION]
3564 .                   \}
3565 .                   el \{\
3566 .                      ds $HDRFTR_CENTER \
3567                        \\*[$DOC_TYPE], \
3568                        \\*[$DRAFT_STRING]\\*[$DRAFT], \
3569                        \\*[$REVISION_STRING] \\*[$REVISION]
3570 .                   \}
3571 .                \}
3572 .             \}
3573 .          \}
3574 .       \}
3575 .       el \{\
3576 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3577 .             ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3578 .             el \{ .PAGENUM_STYLE DIGIT \}
3579 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3580 .          \}
3581 .       \}
3582 .    \}
3583 .END
3585 \# ====================================================================
3587 \# +++COLLECT DOC INFO -- STRINGS AND NUMBER REGISTERS+++
3589 \# *Arguments:
3590 \#   various string/register arguments
3591 \# *Function:
3592 \#   Collect information about documents.
3595 .MAC DOC_TITLE END
3596 .    ds $DOC_TITLE \\$1
3597 .END
3599 .MAC TITLE END \"Document title
3600 .    ds $TITLE \\$1
3601 .END
3604 .MAC SUBTITLE END \"Document sub-title
3605 .    ds $SUBTITLE \\$1
3606 .END
3609 .MAC CHAPTER END \"If document is a chapter, the chapter number
3610 .    ds $CHAPTER \\$1
3611 .END
3614 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
3615 .    ds $CHAPTER_TITLE \\$1
3616 .END
3619 .MAC DRAFT END \"Draft number
3620 .    ie '\\$1'' \{ .ds $DRAFT \}
3621 .    el         \{ .ds $DRAFT " \\$1\}
3622 .END
3625 .MAC REVISION END \"Revision number
3626 .    ds $REVISION \\$1
3627 .END
3630 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
3631 .    nr #DRAFT_WITH_PAGENUM 1
3632 .END
3635 .MAC AUTHOR END \"Author.  Enclose all args fully in double quotes.
3636 .    nr #AUTHOR_NUM -1 1
3637 .    while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
3638 .       ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
3639 .    \}
3640 .    nr #NUM_AUTHORS \\n[#NUM_ARGS]%2 \"Use mod 2 to test if odd or even # of authors
3641 .    ie \\n[#NUM_AUTHORS]=1 \{ .nr #AUTHOR_LINES 0  \}
3642 .    el \{ .nr #AUTHOR_LINES 1 \}
3643 .END
3646 .MAC PAGENUMBER END \"Page # that appears on page one.
3647 .    nr #n%_AT_PAGENUM_SET \\n%
3648 .    nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
3649 .    rr #n%_AT_PAGENUM_SET
3650 .    nr #PAGE_NUM_SET 1
3651 .END
3653 \# ====================================================================
3655 \# +++TYPE OF DOCUMENT+++
3657 \# DOCUMENT TYPE
3658 \# -------------
3659 \# *Argument:
3660 \#   DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
3661 \# *Function:
3662 \#   Creates strings and sets registers for document types.
3663 \# *Notes:
3664 \#   Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
3666 .MAC DOCTYPE END
3667 .    if '\\$1'DEFAULT' \{\
3668 .       nr #DOC_TYPE 1
3669 .    \}
3670 .    if '\\$1'CHAPTER' \{\
3671 .       nr #DOC_TYPE 2
3672 .    \}
3673 .    if '\\$1'NAMED' \{\
3674 .       ds $DOC_TYPE \\$2
3675 .       nr #DOC_TYPE 3
3676 .    \}
3677 .    if '\\$1'LETTER' \{\
3678 .       nr #DOC_TYPE 4
3679 .       L_MARGIN 1.125i
3680 .       R_MARGIN 1.125i
3681 .       PT_SIZE 12
3682 .       LS 13.5
3683 .       DOCHEADER OFF
3684 .       PARA_INDENT 3m
3685 .       INDENT_FIRST_PARAS
3686 .       PARA_SPACE
3687 .       ds $SUITE \En[#SUITE]
3688 .       HEADER_MARGIN 3P+6p
3689 .       HEADER_GAP 3P
3690 .       FOOTERS
3691 .       FOOTER_RULE OFF
3692 .       FOOTER_LEFT ""
3693 .       FOOTER_CENTER ""
3694 .       FOOTER_RIGHT_SIZE +0
3695 .       FOOTER_RIGHT "\&.../\E*[$SUITE]
3696 .       FOOTER_ON_FIRST_PAGE
3697 .       em ALL_DONE
3698 .    \}
3699 .END
3701 \# +++LETTER MACROS+++
3703 \# First, create a register to hold incrementing numbers to be
3704 \# appended to LETTERHEAD.
3706 .nr #FIELD 0 1
3708 \# DATE
3709 \# ----
3710 \# *Arguments:
3711 \#   <none>
3712 \# *Function:
3713 \#   Stores date (entered on the line after .DATE) in diversion
3714 \#   LETTERHEAD<n>
3716 .MAC DATE END
3717 .    if !'\\n(.z'' \{ .di \}
3718 .    di LETTERHEAD\\n+[#FIELD]
3719 .    ie \\n[#FIELD]=1 \{\
3720 .       nr #DATE_FIRST 1
3721 .       RIGHT
3722 .    \}
3723 .    el \{\
3724 .       LEFT
3725 .    \}
3726 .END
3729 \# TO
3730 \# --
3731 \# *Arguments:
3732 \#   <none>
3733 \# *Function:
3734 \#   Stores addressee address (entered on the line after .TO) in
3735 \#   diversion LETTERHEAD<n>
3737 .MAC TO END
3738 .    if !'\\n(.z'' \{ .di \}
3739 .    di LETTERHEAD\\n+[#FIELD]
3740 .    LEFT
3741 .END
3744 \# FROM
3745 \# ----
3746 \# *Arguments:
3747 \#   <none>
3748 \# *Function:
3749 \#   Stores addresser address (entered on the line after .FROM) in
3750 \#   diversion LETTERHEAD<n>
3752 .MAC FROM END
3753 .    if !'\\n(.z'' \{ .di \}
3754 .    di LETTERHEAD\\n+[#FIELD]
3755 .    LEFT
3756 .END
3759 \# GREETING
3760 \# --------
3761 \# *Arguments:
3762 \#   <none>
3763 \# *Function:
3764 \#   Stores greeting (entered on the line after .GREETING) in
3765 \#   diversion LETTERHEAD<n>
3767 .MAC GREETING END
3768 .    if !'\\n(.z'' \{ .di \}
3769 .    di LETTERHEAD\\n+[#FIELD]
3770 .    LEFT
3771 .END
3774 \# CLOSING
3775 \# -------
3776 \# *Arguments:
3777 \#   <closing string>
3778 \# *Function:
3779 \#   Stores greeting in diversion CLOSING.
3781 .MAC CLOSING END
3782 .    br
3783 .    nr #CLOSING 1
3784 .    di CLOSING
3785 .    LEFT
3786 .END
3789 \# NO SUITE
3790 \# --------
3791 \# *Arguments:
3792 \#   <none>
3793 \# *Function:
3794 \#   Redefines $FOOTER_RIGHT to blank so that a suite number doesn't
3795 \#   appear at the bottom of letter pages.
3797 .MAC NO_SUITE END
3798 .    FOOTER_RIGHT ""
3799 .END
3801 \# ====================================================================
3803 \# +++DEFAULTS+++
3805 \# DEFAULTS
3806 \# --------
3807 \# *Arguments:
3808 \#   <none>
3809 \# *Function:
3810 \#   Sets up defaults if no values are entered prior to START.
3811 \# *Notes:
3812 \#   The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
3813 \#   $REVISION_STRING are in the COPYSTYLE macro.
3815 .MAC DEFAULTS END
3816 .    if !d$PAPER \{ .PAPER LETTER \}
3817 .    if !\\n[#DOC_TYPE]   \{ .DOCTYPE DEFAULT \}
3818 .    ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3819 .    el \{\
3820 .       if !\\n[#COPY_STYLE]=1 \{ .PAGENUM_STYLE DIGIT \}
3821 .    \}
3822 .    if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
3823 .    if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
3824 .    if \\n[#DOC_TYPE]=4 \{\
3825 .       if !\\n[#USER_SET_L_LENGTH] \{\
3826 .          R_MARGIN \\n[#R_MARGIN]u
3827 .          rr #USER_SET_L_LENGTH
3828 .       \}
3829 .       if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
3830 .    \}
3831 .    if \\n[#COPY_STYLE]=1 \{\
3832 .       COPYSTYLE DRAFT
3833 .       PAGENUMBER 1
3834 .    \}
3835 .    if !r#DOC_HEADER \{ .DOCHEADER  \}
3836 .    if !r#HEADERS_ON \{ .HEADERS    \}
3837 .    if !r#PAGINATE   \{ .PAGINATE   \}
3838 .    if \\n[#FOOTERS_ON] \{\
3839 .       HEADERS OFF
3840 .       if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
3841 .    \}
3842 .    if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
3843 .    if !r#HEADER_GAP    \{ .HEADER_GAP    3P    \}
3844 .    if \\n[#FOOTERS_ON] \{\
3845 .       if \\n[#PAGINATE]=0 \{\
3846 .          if !r#T_MARGIN \{ .T_MARGIN 6P \}
3847 .       \}
3848 .    \}
3849 .    if \\n[#HEADERS_ON]=0    \{\
3850 .       if \\n[#FOOTERS_ON]=0 \{\
3851 .          if !r#T_MARGIN \{ .T_MARGIN 6P \}
3852 .       \}
3853 .    \}
3854 .    if !r#T_MARGIN          \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
3855 .    if !r#DOCHEADER_ADVANCE \{ .DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
3856 .    if !r#FOOTER_MARGIN     \{ .FOOTER_MARGIN 3P \}
3857 .    if !r#FOOTER_GAP        \{ .FOOTER_GAP    3P \}
3858 .    if !r#B_MARGIN          \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
3859 .    if (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
3860 .       tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
3861 .       tm1 "       No footers or bottom-of-page page numbers will be printed.
3862 .       tm1 "       Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
3863 .       tm1 "       If no footers or bottom-of-page page numbers are required,
3864 .       tm1 "       place .FOOTER_MARGIN 0 before .START
3865 .    \}
3866 .    if !r#HDRFTR_RULE_GAP   \{\
3867 .       if \\n[#HEADERS_ON]  \{ .HDRFTR_RULE_GAP 4p \}
3868 .       if \\n[#FOOTERS_ON]  \{ .HDRFTR_RULE_GAP 4p \}
3869 .    \}
3870 .    if !r#HDRFTR_RULE       \{ .HDRFTR_RULE        \}
3871 .    if !r#PAGE_NUM_SET      \{ .PAGENUMBER 1       \}
3872 .    ie r#ADJ_DOC_LEAD \{ . \}
3873 .    el \{ .DOC_LEAD_ADJUST \}
3874 \# Read in number registers and strings for type parameters
3875 .    nr #DOC_L_MARGIN \\n[#L_MARGIN]
3876 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
3877 .    nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
3878 .    ds $DOC_FAM      \\*[$FAMILY]
3879 .    nr #DOC_PT_SIZE  \\n[#PT_SIZE]
3880 .    nr #DOC_LEAD     \\n[#LEAD]
3881 .    ds $DOC_QUAD     \\*[$QUAD_VALUE]
3882 .    ds $PP_FT        \\*[$FONT]
3883 \# Counters
3884 .    nr #PP 0
3885 .    nr #FN_NUMBER 0 1
3886 .    nr #EN_NUMBER 0 1
3887 .    nr #FN_COUNT_FOR_COLS 0 1
3888 .    RESET_HEAD_NUMBER
3889 .    RESET_SUBHEAD_NUMBER
3890 .    RESET_PARAHEAD_NUMBER
3891 \# General style defaults for both PRINTSTYLEs
3892 .    nr #PP_STYLE 1
3893 .    PARA_INDENT \\n[#PP_INDENT]u
3894 .    if !d$HDRFTR_FAM           \{ .HDRFTR_FAMILY  \\*[$DOC_FAM] \}
3895 .    if !d$HDRFTR_SIZE_CHANGE   \{ .HDRFTR_SIZE    +0            \}
3896 .    if !d$PAGE_NUM_FAM         \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
3897 .    if !d$PAGE_NUM_FT          \{ .PAGENUM_FONT   R             \}
3898 .    if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE   +0            \}
3899 .    if !r#PAGE_NUM_POS_SET     \{ .PAGENUM_POS BOTTOM CENTER    \}
3900 .    ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
3901 .       if \\n[#PAGE_NUM_HYPHENS]=0  \{ .PAGENUM_HYPHENS OFF \}
3902 .       if \\n[#PAGE_NUM_HYPHENS]=1  \{ .PAGENUM_HYPHENS     \}
3903 .    \}
3904 .    el \{ .PAGENUM_HYPHENS \}
3905 .    if !d$HEAD_QUAD         \{ .HEAD_QUAD CENTER  \}
3906 .    if !r#HEAD_CAPS         \{ .HEAD_CAPS         \}
3907 .    if !r#HEAD_UNDERLINE    \{ .HEAD_UNDERLINE    \}
3908 .    if !d$SH_QUAD           \{ .SUBHEAD_QUAD LEFT \}
3909 .    if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
3910 .    if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
3911 .       if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
3912 .    \}
3913 .    if !d$FN_FAM          \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
3914 .    if !d$FN_FT           \{ .FOOTNOTE_FONT R               \}
3915 .    if !d$FN_QUAD         \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD]  \}
3916 .    if !r#FN_RULE         \{ .FOOTNOTE_RULE                 \}
3917 .    if !r#FN_MARKERS      \{ .FOOTNOTE_MARKERS              \}
3918 .    if !r#FN_MARKER_STYLE \{ .FOOTNOTE_MARKER_STYLE STAR    \}
3919 .    if !d$EN_PN_STYLE          \{ .ENDNOTES_PAGENUM_STYLE digit        \}
3920 .    if !d$EN_FAM               \{ .ENDNOTE_FAMILY \\*[$DOC_FAM]        \}
3921 .    if !d$EN_FN                \{ .ENDNOTE_FONT R                      \}
3922 .    if !d$EN_QUAD              \{ .ENDNOTE_QUAD \\*[$DOC_QUAD]         \}
3923 .    if !d$EN_STRING            \{ .ENDNOTE_STRING "Endnotes"           \}
3924 .    if !d$EN_STRING_FAM        \{ .ENDNOTE_STRING_FAMILY \\*[$EN_FAM]  \}
3925 .    if !d$EN_STRING_QUAD       \{ .ENDNOTE_STRING_QUAD CENTER          \}
3926 .    if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2         \}
3927 .    if !r#EN_STRING_CAPS       \{ .ENDNOTE_STRING_CAPS                 \}
3928 .    if !d$EN_TITLE \{\
3929 .       ie \\n[#DOC_TYPE]=2 \{\
3930 .          ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
3931 .          el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"    \}
3932 .       \}
3933 .       el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
3934 .    \}
3935 .    if !d$EN_TITLE_FAM          \{ .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM]  \}
3936 .    if !d$EN_TITLE_QUAD         \{ .ENDNOTE_TITLE_QUAD LEFT            \}
3937 .    if !r#EN_TITLE_UNDERSCORE   \{ .ENDNOTE_TITLE_UNDERSCORE           \}
3938 .    if !d$EN_NUMBER_FAM         \{ .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] \}
3939 .    if !r#EN_NUMBERS_ALIGN_LEFT  \{\
3940 .       if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2  \}
3941 .    \}
3942 .    if !d$TOC_HEADER_STRING         \{ .TOC_HEADER_STRING "Contents"  \}
3943 .    if !d$TOC_HEADER_QUAD           \{ .TOC_HEADER_QUAD LEFT          \}
3944 .    if !d$TOC_PN_STYLE              \{ .TOC_PAGENUM_STYLE roman       \}
3945 .    if !r#TOC_PN_PADDING            \{ .TOC_PADDING   3               \}
3946 .    if !r#TOC_TITLE_INDENT          \{ .TOC_TITLE_INDENT    0         \}
3947 .    if !r#TOC_HEAD_INDENT           \{ .TOC_HEAD_INDENT     18p       \}
3948 .    if !r#TOC_SH_INDENT             \{ .TOC_SUBHEAD_INDENT  30p       \}
3949 .    if !r#TOC_PH_INDENT             \{ .TOC_PARAHEAD_INDENT 42p       \}
3950 \# String defaults for both PRINTSTYLEs
3951 .    ie \\n[#DOC_TYPE]=1 \{\
3952 .       ie '\\*[$DOC_TITLE]'' \{\
3953 .          if \\n[#USER_DEF_HDRFTR_LEFT]=0   \{ .ds $HDRFTR_LEFT  \\*[$AUTHOR_1]  \}
3954 .          rr #USER_DEF_HDRFTR_LEFT
3955 .          if \\n[#USER_DEF_HDRFTR_RIGHT]=0  \{ .ds $HDRFTR_RIGHT \\*[$TITLE]     \}
3956 .          rr #USER_DEF_HDRFTR_RIGHT
3957 .       \}
3958 .       el \{\
3959 .          if \\n[#COPY_STYLE]=1 \{ .DRAFT_WITH_PAGENUMBER \}
3960 .          if \\n[#USER_DEF_HDRFTR_LEFT]=0   \{ .ds $HDRFTR_LEFT  \\*[$AUTHOR_1]  \}
3961 .          rr #USER_DEF_HDRFTR_LEFT
3962 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{ .ds $HDRFTR_CENTER \\*[$TITLE]    \}
3963 .          rr #USER_DEF_HDRFTR_CENTER
3964 .          if \\n[#USER_DEF_HDRFTR_RIGHT]=0  \{ .ds $HDRFTR_RIGHT \\*[$DOC_TITLE] \}
3965 .          rr #USER_DEF_HDRFTR_RIGHT
3966 .       \}
3967 .    \}
3968 .    el \{\
3969 .       if \\n[#USER_DEF_HDRFTR_LEFT]=0   \{ .ds $HDRFTR_LEFT  \\*[$AUTHOR_1]  \}
3970 .       rr #USER_DEF_HDRFTR_LEFT
3971 .       if \\n[#USER_DEF_HDRFTR_RIGHT]=0  \{ .ds $HDRFTR_RIGHT \\*[$TITLE]     \}
3972 .       rr #USER_DEF_HDRFTR_RIGHT
3973 .    \}
3974 .    if !d$ATTRIBUTE_STRING           \{ .ATTRIBUTE_STRING "by"            \}
3975 .    if !d$FINIS_STRING               \{ .FINIS_STRING "END"               \}
3976 \# Defaults for printstyle TYPEWRITE
3977 .    if \\n[#PRINT_STYLE]=1 \{\
3978 .       if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES         \}
3979 .       if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF     \}
3980 .       if !r#Q_OFFSET_VALUE        \{ .QUOTE_INDENT      2      \}
3981 .       if !r#EPI_OFFSET_VALUE      \{ .EPIGRAPH_INDENT   2      \}
3982 .       if !d$LINEBREAK_CHAR        \{ .LINEBREAK_CHAR    * 3 2p \}
3983 .       if !d$FN_SIZE_CHANGE        \{ .FOOTNOTE_SIZE     +0     \}
3984 .       if !r#FN_RULE_LENGTH        \{ .FOOTNOTE_RULE_LENGTH 2i  \}
3985 .       if !r#FN_RULE_ADJ           \{ .FOOTNOTE_RULE_ADJ  6p    \}
3986 .       if !r#SLANT_MEANS_SLANT \{\
3987 .          ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
3988 .          el \{ .UNDERLINE_SLANT OFF \}
3989 .       \}
3990 .       if !r#PH_INDENT    \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3991 .       if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
3992 .    \}
3993 \# Defaults for printstyle TYPESET
3994 .    if \\n[#PRINT_STYLE]=2 \{\
3995 .       if !d$DOCHEADER_LEAD_ADJ \{\
3996 .          ie !'\\*[$CHAPTER_TITLE]'' \{\
3997 .             ie !'\\*[$CHAPTER_STRING]'' \{\
3998 .                DOCHEADER_LEAD +4
3999 .             \}
4000 .             el \{ .DOCHEADER_LEAD +0 \}
4001 .          \}
4002 .          el \{ .DOCHEADER_LEAD +0 \}
4003 .       \}
4004 .       if !d$TITLE_FAM     \{ .TITLE_FAMILY   \\*[$DOC_FAM] \}
4005 .       if !d$TITLE_FT      \{ .TITLE_FONT     B             \}
4006 .       if !d$TITLE_SIZE_CHANGE \{\
4007 .          ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
4008 .          el \{ .TITLE_SIZE +3.5 \}
4009 .       \}
4010 .       if !d$CHAPTER_TITLE_FAM         \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
4011 .       if !d$CHAPTER_TITLE_FT          \{ .CHAPTER_TITLE_FONT   BI            \}
4012 .       if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE  +4             \}
4013 .       if !d$SUBTITLE_FAM         \{ .SUBTITLE_FAMILY    \\*[$DOC_FAM] \}
4014 .       if !d$SUBTITLE_FT          \{ .SUBTITLE_FONT      R             \}
4015 .       if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE      +0            \}
4016 .       if !d$AUTHOR_FAM           \{ .AUTHOR_FAMILY      \\*[$DOC_FAM] \}
4017 .       if !d$AUTHOR_FT            \{ .AUTHOR_FONT        I             \}
4018 .       if !d$AUTHOR_SIZE_CHANGE   \{ .AUTHOR_SIZE        +0            \}
4019 .       if !d$DOCTYPE_FAM          \{ .DOCTYPE_FAMILY     \\*[$DOC_FAM] \}
4020 .       if !d$DOCTYPE_FT           \{ .DOCTYPE_FONT       BI            \}
4021 .       if !d$DOCTYPE_SIZE_CHANGE  \{ .DOCTYPE_SIZE       +3            \}
4022 .       if !d$HDRFTR_LEFT_FAM      \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
4023 .       if !d$HDRFTR_LEFT_FT       \{ .HDRFTR_LEFT_FONT   R             \}
4024 .       if \\n[#HDRFTR_LEFT_CAPS]  \{\
4025 .          if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE  -2 \}
4026 .       \}
4027 .       if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE     -.5           \}
4028 .       if !d$HDRFTR_CENTER_FAM       \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
4029 .       if !d$HDRFTR_CENTER_FT        \{ .HDRFTR_CENTER_FONT   I             \}
4030 .       if \\n[#HDRFTR_CENTER_CAPS] \{\
4031 .          if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
4032 .       \}
4033 .       if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5              \}
4034 .       if !d$HDRFTR_RIGHT_FAM          \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]   \}
4035 .       if !d$HDRFTR_RIGHT_FT           \{ .HDRFTR_RIGHT_FONT   R               \}
4036 .       if \\n[#HDRFTR_RIGHT_CAPS] \{\
4037 .          if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
4038 .       \}
4039 .       if !d$HDRFTR_RIGHT_SIZE_CHANGE  \{ .HDRFTR_RIGHT_SIZE  -.5              \}
4040 .       if !d$HEAD_FAM                  \{ .HEAD_FAMILY        \\*[$DOC_FAM]    \}
4041 .       if !d$HEAD_FT                   \{ .HEAD_FONT          B                \}
4042 .       if !d$HEAD_SIZE_CHANGE          \{ .HEAD_SIZE          +1               \}
4043 .       if !r#HEAD_SPACE                \{ .HEAD_SPACE                          \}
4044 .       if !d$SH_FAM                    \{ .SUBHEAD_FAMILY     \\*[$DOC_FAM]    \}
4045 .       if !d$SH_FT                     \{ .SUBHEAD_FONT       B                \}
4046 .       if !d$SH_SIZE_CHANGE            \{ .SUBHEAD_SIZE       +.5              \}
4047 .       if !d$PH_FAM                    \{ .PARAHEAD_FAMILY    \\*[$DOC_FAM]    \}
4048 .       if !d$PH_FT                     \{ .PARAHEAD_FONT      BI               \}
4049 .       if !d$PH_SIZE_CHANGE            \{ .PARAHEAD_SIZE      -.25             \}
4050 .       if !r#PH_INDENT                 \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
4051 .       if !d$QUOTE_FAM                 \{ .QUOTE_FAMILY       \\*[$DOC_FAM]    \}
4052 .       if !d$QUOTE_FT                  \{ .QUOTE_FONT         I                \}
4053 .       if !d$QUOTE_SIZE_CHANGE         \{ .QUOTE_SIZE         +0               \}
4054 .       if !r#Q_OFFSET_VALUE            \{ .QUOTE_INDENT       3                \}
4055 .       if !d$BQUOTE_FAM                \{ .BLOCKQUOTE_FAMILY  \\*[$DOC_FAM]    \}
4056 .       if !d$BQUOTE_FT                 \{ .BLOCKQUOTE_FONT    R                \}
4057 .       if !d$BQUOTE_SIZE_CHANGE        \{ .BLOCKQUOTE_SIZE    -1               \}
4058 .       if !d$BQUOTE_QUAD               \{ .BLOCKQUOTE_QUAD    LEFT             \}
4059 .       if !d$EPI_FAM                   \{ .EPIGRAPH_FAMILY    \\*[$DOC_FAM]    \}
4060 .       if !d$EPI_FT                    \{ .EPIGRAPH_FONT      R                \}
4061 .       if !d$EPI_SIZE_CHANGE           \{ .EPIGRAPH_SIZE      -1.5             \}
4062 .       if !r#EPI_AUTOLEAD              \{ .EPIGRAPH_AUTOLEAD  2                \}
4063 .       if !d$EPI_QUAD                  \{ .EPIGRAPH_QUAD      \\*[$DOC_QUAD]   \}
4064 .       if !r#EPI_OFFSET_VALUE          \{ .EPIGRAPH_INDENT    3                \}
4065 .       if !d$LINEBREAK_CHAR            \{ .LINEBREAK_CHAR     * 3 3p           \}
4066 .       if !r#FN_RULE_LENGTH            \{ .FOOTNOTE_RULE_LENGTH 4P             \}
4067 .       if !r#FN_RULE_ADJ               \{ .FOOTNOTE_RULE_ADJ  3p               \}
4068 .       if !d$FN_SIZE_CHANGE            \{ .FOOTNOTE_SIZE      -2               \}
4069 .       if !r#FN_AUTOLEAD               \{ .FOOTNOTE_AUTOLEAD  2                \}
4070 .       if !r#EN_PS                     \{ .ENDNOTE_PT_SIZE \\n[#DOC_PT_SIZE]u  \}
4071 .       if !d$EN_LEAD                   \{ .ENDNOTE_LEAD        14 ADJUST       \}
4072 .       if !d$EN_STRING_FT              \{ .ENDNOTE_STRING_FONT B               \}
4073 .       if !d$EN_STRING_SIZE_CHANGE     \{ .ENDNOTE_STRING_SIZE +1              \}
4074 .       if !d$EN_TITLE_FT               \{ .ENDNOTE_TITLE_FONT  B               \}
4075 .       if !d$EN_TITLE_SIZE_CHANGE      \{ .ENDNOTE_TITLE_SIZE  +0              \}
4076 .       if !d$EN_NUMBER_FT              \{ .ENDNOTE_NUMBER_FONT B               \}
4077 .       if !d$EN_NUMBER_SIZE_CHANGE      \{ .ENDNOTE_NUMBER_SIZE +0              \}
4078 .       if !r#EN_PP_INDENT              \{ .ENDNOTE_PARA_INDENT 1.5m            \}
4079 .       if !d$TOC_FAM                   \{ .TOC_FAMILY  \\*[$DOC_FAM]           \}
4080 .       if !r#TOC_PS                    \{ .TOC_PT_SIZE \\n[#DOC_PT_SIZE]u      \}
4081 .       if !r#TOC_LEAD                  \{ .TOC_LEAD    \\n[#DOC_LEAD]u ADJUST  \}
4082 .       if !d$TOC_HEADER_FAM            \{ .TOC_HEADER_FAMILY \\*[$TOC_FAM]     \}
4083 .       if !d$TOC_HEADER_SIZE_CHANGE    \{ .TOC_HEADER_SIZE  +4                 \}
4084 .       if !d$TOC_HEADER_FT             \{ .TOC_HEADER_FONT   B                 \}
4085 .       if !d$TOC_TITLE_FAM             \{ .TOC_TITLE_FAMILY \\*[$TOC_FAM]      \}
4086 .       if !d$TOC_PN_FAM                \{ .TOC_PN_FAMILY \\*[$TOC_FAM]         \}
4087 .       if !d$TOC_HEAD_FAM              \{ .TOC_HEAD_FAMILY \\*[$TOC_FAM]       \}
4088 .       if !d$TOC_SH_FAM                \{ .TOC_SUBHEAD_FAMILY \\*[$TOC_FAM]    \}
4089 .       if !d$TOC_PH_FAM                \{ .TOC_PARAHEAD_FAMILY \\*[$TOC_FAM]   \}
4090 .       if !d$TOC_TITLE_FT              \{ .TOC_TITLE_FONT   BI                 \}
4091 .       if !d$TOC_PN_FT                 \{ .TOC_PN_FONT   R                     \}
4092 .       if !d$TOC_HEAD_FT               \{ .TOC_HEAD_FONT   B                   \}
4093 .       if !d$TOC_SH_FT                 \{ .TOC_SUBHEAD_FONT   R                \}
4094 .       if !d$TOC_PH_FT                 \{ .TOC_PARAHEAD_FONT   I               \}
4095 .       if !d$TOC_TITLE_SIZE_CHANGE     \{ .TOC_TITLE_SIZE   +.5                \}
4096 .       if !d$TOC_PN_SIZE_CHANGE        \{ .TOC_PN_SIZE  +0                     \}
4097 .       if !d$TOC_HEAD_SIZE_CHANGE      \{ .TOC_HEAD_SIZE  +.5                  \}
4098 .       if !d$TOC_SH_SIZE_CHANGE        \{ .TOC_SUBHEAD_SIZE  +0                \}
4099 .       if !d$TOC_PH_SIZE_CHANGE        \{ .TOC_PARAHEAD_SIZE  +0               \}
4100 .    \}
4101 .    if \\n[#PRINT_STYLE]=2 \{\
4102 .       ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
4103 .       el \{ . \}
4104 .    \}
4105 .    if !\\n[#COLLATE] \{\
4106 .       TRAPS
4107 \# Endnote and toc leading
4108 .       nr #OK_PROCESS_LEAD 1
4109 .       nr #RESTORE_DOC_LEAD \\n(.v
4110 .       if \\n[#PRINT_STYLE]=1 \{\
4111 .          ie \\n[#SINGLE_SPACE] \{\
4112 .             ENDNOTE_LEAD 12 ADJUST
4113 .          \}
4114 .          el \{\
4115 .             ie \\n[#EN_SINGLESPACE] \{ .ENDNOTE_LEAD 12 ADJUST \}
4116 .             el \{ .ENDNOTE_LEAD 24 ADJUST \}
4117 .          \}
4118 .       \}
4119 .       if \\n[#PRINT_STYLE]=2 \{\
4120 .          ie !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
4121 .          el \{ .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] \}
4122 .          ie !d$TOC_LEAD \{ .TOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
4123 .          el \{ .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] \}
4124 .          rm $ADJUST_EN_LEAD
4125 .          rm $ADJUST_TOC_LEAD
4126 .       \}
4127 .       DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
4128 .    \}
4129 .    if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
4130 .END
4132 \# ====================================================================
4134 \# +++START THE DOCUMENT+++
4136 \# THE START MACRO
4137 \# ---------------
4138 \# *Arguments:
4139 \#   <none>
4140 \# *Function:
4141 \#   Reads in default document style parameters and any parameter
4142 \#   the user has changed before issuing START.
4143 \#   Using the information gathered in the opening macros,
4144 \#   prints appropriate title (or chapter #), subtitle, author
4145 \#   and document type (if appropriate).
4146 \# *Notes:
4147 \#   The .PRINT \& (zero-width character) is required to get the
4148 \#   subsequent .sp request to work as advertised.
4150 \#   The overall document line length, family, and point-size
4151 \#   are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
4152 \#   use in the HEADER and FOOTER macros.
4154 \#  First, define some strings for point sizes
4156 .ds $TITLE_PT_SIZE         \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
4157 .ds $CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
4158 .ds $SUBTITLE_PT_SIZE      \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
4159 .ds $AUTHOR_PT_SIZE        \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
4160 .ds $DOCTYPE_PT_SIZE       \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
4162 \# Next, some utility macros for various routines to prevent repetition
4164 .MAC PRINT_AUTHORS END
4165 .    nr #AUTHORS \\n[#AUTHOR_NUM]
4166 .    nr #NEXT_AUTHOR 0 1
4167 .    while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4168 .       ie \\n[#AUTHOR_COLOR]=1 \{\
4169 .          PRINT \m[\\*[$AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
4170 .       \}
4171 .       el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
4172 .    \}
4173 .END
4175 .MAC DEFAULT_DOCHEADER END
4176 .    CENTER
4177 .    FAMILY  \\*[$TITLE_FAM]
4178 .    FT      \\*[$TITLE_FT]
4179 .    PT_SIZE \\*[$TITLE_PT_SIZE]
4180 .    LS      \\n[#DOCHEADER_LEAD]u
4181 .    ie \\n[#TITLE_COLOR]=1 \{\
4182 .       PRINT \m[\\*[$TITLE_COLOR]]\\*[$TITLE]\m[]
4183 .    \}
4184 .    el \{ .PRINT \\*[$TITLE] \}
4185 .    if !'\\*[$SUBTITLE]'' \{\
4186 .       FAMILY  \\*[$SUBTITLE_FAM]
4187 .       FT      \\*[$SUBTITLE_FT]
4188 .       PT_SIZE \\*[$SUBTITLE_PT_SIZE]
4189 .       ie \\n[#SUBTITLE_COLOR]=1 \{\
4190 .          PRINT \m[\\*[$SUBTITLE_COLOR]]\\*[$TITLE]\m[]
4191 .       \}
4192 .       el \{ .PRINT \\*[$SUBTITLE] \}
4193 .    \}
4194 .    if !'\\*[$AUTHOR_1]'' \{\
4195 .       FAMILY  \\*[$AUTHOR_FAM]
4196 .       FT      \\*[$AUTHOR_FT]
4197 .       PT_SIZE \\*[$AUTHOR_PT_SIZE]
4198 .       if !'\\*[$ATTRIBUTE_STRING]'' \{\
4199 .          ie \\n[#ATTRIBUTE_COLOR]=1 \{\
4200 .             PRINT \m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
4201 .          \}
4202 .          el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
4203 .       \}
4204 .       PRINT_AUTHORS
4205 .    \}
4206 .END
4209 .MAC CHAPTER_DOCHEADER END
4210 .    CENTER
4211 .    FAMILY  \\*[$TITLE_FAM]
4212 .    FT      \\*[$TITLE_FT]
4213 .    PT_SIZE \\*[$TITLE_PT_SIZE]
4214 .    LS      \\n[#DOCHEADER_LEAD]u
4215 \# Chapter title only
4216 .    ie '\\*[$CHAPTER]'' \{\
4217 .       ie !'\\*[$CHAPTER_TITLE]'' \{\
4218 .          if \\n[#PRINT_STYLE]=2 \{\
4219 .             FAMILY  \\*[$CHAPTER_TITLE_FAM]
4220 .             FT      \\*[$CHAPTER_TITLE_FT]
4221 .             PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
4222 .             LS      \\n[#DOCHEADER_LEAD]u
4223 .          \}
4224 .          ie \\n[#TITLE_COLOR]=1 \{\
4225 .             PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
4226 .          \}
4227 .          el \{ .PRINT \\*[$CHAPTER_TITLE] \}
4228 .       \}
4229 .       el \{\
4230 .          ie \\n[#TITLE_COLOR]=1 \{\
4231 .             PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING]\m[]
4232 .          \}
4233 .          el \{ .PRINT \\*[$CHAPTER_STRING] \}
4234 .       \}
4235 .    \}
4236 \# Chapter string, possibly with a chapter title
4237 .    el \{\
4238 .       ie \\n[#TITLE_COLOR]=1 \{\
4239 .          PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
4240 .       \}
4241 .       el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
4242 .       if !'\\*[$CHAPTER_TITLE]'' \{\
4243 .          if \\n[#PRINT_STYLE]=1 \{ .PRINT \\*[$CHAPTER_TITLE] \}
4244 .          if \\n[#PRINT_STYLE]=2 \{\
4245 .             FAMILY  \\*[$CHAPTER_TITLE_FAM]
4246 .             FT      \\*[$CHAPTER_TITLE_FT]
4247 .             PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
4248 .             LS      \\n[#DOCHEADER_LEAD]u
4249 .             ie \\n[#TITLE_COLOR]=1 \{\
4250 .                PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
4251 .             \}
4252 .             el \{ .PRINT \\*[$CHAPTER_TITLE] \}
4253 .             RLD \\n[#DOC_LEAD]u \" Just looks better this way
4254 .          \}
4255 .       \}
4256 .    \}
4257 .END
4260 .MAC NAMED_DOCHEADER END
4261 .    CENTER
4262 .    FAMILY  \\*[$TITLE_FAM]
4263 .    FT      \\*[$TITLE_FT]
4264 .    PT_SIZE \\*[$TITLE_PT_SIZE]
4265 .    LS      \\n[#DOCHEADER_LEAD]u
4266 .    ie \\n[#TITLE_COLOR]=1 \{\
4267 .       PRINT \m[\\*[$TITLE_COLOR]]\\*[$TITLE]\m[]
4268 .    \}
4269 .    el \{ .PRINT \\*[$TITLE] \}
4270 .    if !'\\*[$SUBTITLE]'' \{\
4271 .       FAMILY  \\*[$SUBTITLE_FAM]
4272 .       FT      \\*[$SUBTITLE_FT]
4273 .       PT_SIZE \\*[$SUBTITLE_PT_SIZE]
4274 .       ie \\n[#SUBTITLE_COLOR]=1 \{\
4275 .          PRINT \m[\\*[$SUBTITLE_COLOR]]\\*[$TITLE]\m[]
4276 .       \}
4277 .       el \{ .PRINT \\*[$SUBTITLE] \}
4278 .    \}
4279 .    if !'\\*[$AUTHOR_1]'' \{\
4280 .       FAMILY  \\*[$AUTHOR_FAM]
4281 .       FT      \\*[$AUTHOR_FT]
4282 .       PT_SIZE \\*[$AUTHOR_PT_SIZE]
4283 .       if !'\\*[$ATTRIBUTE_STRING]'' \{\
4284 .          ie \\n[#ATTRIBUTE_COLOR]=1 \{\
4285 .             PRINT \m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
4286 .          \}
4287 .          el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
4288 .       \}
4289 .       \}
4290 .       PRINT_AUTHORS
4291 .    \}
4292 .    FAMILY  \\*[$DOCTYPE_FAM]
4293 .    FT      \\*[$DOCTYPE_FT]
4294 .    PT_SIZE \\*[$DOCTYPE_PT_SIZE]
4295 .    LS      \\n[#DOCHEADER_LEAD]u
4296 .    ALD     \\n[#DOCHEADER_LEAD]u
4297 .    ie \\n[#DOCTYPE_COLOR]=1 \{\
4298 .       COLOR \\*[$DOCTYPE_COLOR]
4299 .       UNDERSCORE "\\*[$DOC_TYPE]
4300 .    \}
4301 .    el .UNDERSCORE "\\*[$DOC_TYPE]
4302 .END
4305 .MAC START END
4306 .    if !\\n[#PRINT_STYLE] \{\
4307 .       PRINTSTYLE TYPEWRITE
4308 .       PRINT \&
4309 .       po 6P
4310 .       ll 39P
4311 .       ta \\n(.lu
4312 .       sp |1i-1v
4313 .       CENTER
4314 .       PRINT "You neglected to enter a PRINTSTYLE"
4315 .       fl
4316 .       ab PRINTSTYLE missing
4317 .    \}
4318 .    nr #DOCS 1
4319 .    if \\n[#COLLATE] \{\
4320 .       COPYSTYLE \\*[$COPY_STYLE]
4321 .       nr #HEADERS_ON \\n[#HEADER_STATE]
4322 .       if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
4323 .       sp |\\n[#HEADER_MARGIN]u
4324 .       PRINT \&
4325 .       if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
4326 .          PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
4327 .          rm $RESTORE_PAGENUM_STYLE
4328 .       \}
4329 .    \}
4330 .    DEFAULTS
4331 \# Collate stuff
4332 .    ie \\n[#COLLATED_DOC]=1 \{\
4333 \# Collect TITLE for TOC.
4334 .       nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
4335 .       af #TOC_ENTRY_PN \\g[#PAGENUMBER]
4336 .       ie \\n[#USER_SET_TITLE_ITEM] \{\
4337 .          ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]\\|
4338 .          rr #USER_SET_TITLE_ITEM
4339 .          rm $USER_SET_TITLE_ITEM
4340 .       \}
4341 .       el \{\
4342 .          ie \\n[#DOC_TYPE]=2 \{\
4343 .             ie '\\*[$CHAPTER_TITLE]'' \{\
4344 .                ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
4345 .             \}
4346 .             el \{\
4347 .                ie '\\*[$CHAPTER]'' \{\
4348 .                   ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]\\|
4349 .                \}
4350 .                el \{\
4351 .                   ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
4352 .                \}
4353 .             \}
4354 .          \}
4355 .          el \{\
4356 .             ds $TOC_TITLE_ITEM \\*[$TITLE]\\|
4357 .          \}
4358 .       \}
4359 .       if \\n[#TOC_AUTHORS]=1 \{\
4360 .          ie '\\*[$TOC_AUTHORS]'' \{\
4361 .             as $TOC_TITLE_ITEM /\\|\\*[$AUTHOR_1]\\|
4362 .          \}
4363 .          el \{\
4364 .             as $TOC_TITLE_ITEM /\\|\\*[$TOC_AUTHORS]\\|
4365 .             rm $TOC_AUTHORS
4366 .          \}
4367 .       \}
4368 \# Note the use of \!, which transparently embeds the macros used
4369 \# in the TOC_ENTRIES diversion.  The elements they control must be
4370 \# processed literally when the diversion is output.
4371 .       ev TOC_EV
4372 .       da TOC_ENTRIES
4373 .       if \\n[#PRINT_STYLE]=1 \{\
4374 \!.        fam C
4375 \!.        ft  R
4376 \!.        ps  12
4377 .       \}
4378 .       if \\n[#PRINT_STYLE]=2 \{\
4379 \!.        FAMILY  \\*[$TOC_TITLE_FAM]
4380 \!.        FT      \\*[$TOC_TITLE_FT]
4381 \!.        PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
4382 .       \}
4383 \!.     TRAP OFF
4384 .       ie \\n[#PRINT_STYLE]=1 \{\
4385 \!.        PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
4386 .       \}
4387 .       el \{\
4388 \!.        PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
4389 .       \}
4390 \!.    EL
4391 \!.    ST 100 L
4392 \!.    ST 101 R
4393 .      if \\n[#PRINT_STYLE]=2 \{\
4394 \!.       FAMILY  \\*[$TOC_PN_FAM]
4395 \!.       FT      \\*[$TOC_PN_FT]
4396 \!.       PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
4397 .      \}
4398 \!.    TAB 100
4399 \!.    PRINT \\*[LEADER]
4400 \!.    TN
4401 \!.    TRAP
4402 \!.    PRINT \\n[#TOC_ENTRY_PN]
4403 \!.    TQ
4404 .      di       
4405 .      ev
4406 .    \}
4407 .    el \{\
4408 .       nr #FIRST_DOC_TITLE_PN \\n%+\\n[#PAGE_NUM_ADJ]
4409 .       af #FIRST_DOC_TITLE_PN \\g[#PAGENUMBER]
4410 .       nr #FIRST_DOC_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
4411 .    \}
4412 \# End TITLE collection
4413 .    if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
4414 .       sp |\\n[#HEADER_MARGIN]u
4415 .       PRINT_PAGE_NUMBER
4416 .    \}
4417 .    rr #COLLATE
4418 .    rr #PAGINATION_STATE
4419 \# End collate stuff
4420 .    ie \\n[#DOC_HEADER]=0 \{\
4421 .       PRINT \&
4422 .       if \\n[#DOC_TYPE]=4 \{\
4423 .          if !'\\n(.z'' \{ .di \}
4424 .       \}
4425 .       nr #STORED_PP_INDENT \\n[#PP_INDENT]
4426 .       PARA_INDENT 0
4427 .       PP
4428 .       PARA_INDENT \\n[#STORED_PP_INDENT]u
4429 .       rr #STORED_PP_INDENT
4430 .       ie r#ADVANCE_FROM_TOP \{\
4431 .          sp |\\n[#ADVANCE_FROM_TOP]u-1v
4432 .          SHIM
4433 .       \}
4434 .       el \{ .sp |\\n[#T_MARGIN]u-1v \}
4435 .       if \\n[#COLUMNS] \{\
4436 .          mk dc
4437 .          nr #COL_NUM 0 1
4438 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4439 .          nr #L_MARGIN \\n(.o
4440 .          ll \\n[#COL_L_LENGTH]u
4441 .       \}
4442 .       nr #PP 0
4443 .       rr #DOC_HEADER
4444 .       if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \}
4445 .    \}
4446 .    el \{\
4447 .       if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ] \}
4448 .       nr #DOCHEADER_LEAD \\n[#LEAD]
4449 \# Default
4450 .       if \\n[#DOC_TYPE]=1 \{\
4451 .          PRINT \&
4452 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
4453 .          ev DOCHEADER
4454 .          if \\n[#DOCHEADER_COLOR]=1 \{\
4455 .             nf
4456 \m[\\*[$DOCHEADER_COLOR]]
4457 .             EL
4458 .          \}
4459 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4460 .          LL       \\n[#DOC_L_LENGTH]u
4461 .          ta \\n(.lu
4462 .          if \\n[#PRINT_STYLE]=1 \{\
4463 .             CENTER
4464 .             fam C
4465 .             ft  R
4466 .             ps  12
4467 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4468 .             el \{ .vs \\n[#DOC_LEAD]u \}
4469 .             CAPS
4470 .             if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
4471 .             CAPS OFF
4472 .             if !'\\*[$SUBTITLE]'' \{\
4473 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4474 .                el \{ .vs \\n[#DOC_LEAD]u \}
4475 .             PRINT \\*[$SUBTITLE]
4476 .             \}
4477 .             if '\\*[$SUBTITLE]'' \{\
4478 .                ALD \\n[#DOC_LEAD]u
4479 .             \}
4480 .             ie !'\\*[$AUTHOR_1]'' \{\
4481 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4482 .                el \{ .vs \\n[#DOC_LEAD]u/2u \}
4483 .                if !d$SUBTITLE \{\
4484 .                   ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4485 .                   el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4486 .                \}
4487 .                PRINT \\*[$ATTRIBUTE_STRING]
4488 .                nr #AUTHORS \\n[#AUTHOR_NUM]
4489 .                nr #NEXT_AUTHOR 0 1
4490 .                while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4491 .                   PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4492 .                \}
4493 .                if \\n[#AUTHOR_LINES]=1 \{\
4494 .                    ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4495 .                    el \{ .ALD \\n[#DOC_LEAD]u/2u \}
4496 .                \}
4497 .             \}
4498 .             el \{\
4499 .                ie !d$SUBTITLE \{\
4500 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4501 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4502 .                \}
4503 .                el \{\
4504 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4505 .                   el \{ .ALD \\n[#DOC_LEAD]u \}
4506 .                \}
4507 .             \}
4508 .          \}
4509 .          if \\n[#PRINT_STYLE]=2 \{\
4510 .             DEFAULT_DOCHEADER
4511 .             di DOCHEADER_DIVERSION \" This diversion is only
4512 .             br                     \" necessary to find the depth of the
4513 .             DEFAULT_DOCHEADER      \" docheader
4514 .             br
4515 .             di
4516 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
4517 .                                                             \"in #DOCHEADER_DEPTH
4518 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
4519 .          \}
4520 .          ev
4521 .       \}
4522 \# Chapter
4523 .       if \\n[#DOC_TYPE]=2 \{\
4524 .          PRINT \&
4525 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
4526 .          ev DOCHEADER
4527 .          if \\n[#DOCHEADER_COLOR]=1 \{\
4528 .             nf
4529 \m[\\*[$DOCHEADER_COLOR]]
4530 .             EL
4531 .          \}
4532 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4533 .          LL       \\n[#DOC_L_LENGTH]u
4534 .          ta \\n(.lu
4535 .          if \\n[#PRINT_STYLE]=1 \{\
4536 .             CENTER
4537 .             fam C
4538 .             ft  R
4539 .             ps  12
4540 .             vs \\n[#DOC_LEAD]u
4541 .             ie '\\*[$CHAPTER]'' \{\
4542 .                CAPS
4543 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
4544 .                   PRINT \\*[$CHAPTER_TITLE]
4545 .                \}
4546 .                el \{\
4547 .                   CAPS
4548 .                   PRINT \\*[$CHAPTER_STRING]
4549 .                \}
4550 .                CAPS OFF
4551 .             \}
4552 .             el \{\
4553 .                CAPS
4554 .                PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4555 .                CAPS OFF
4556 .                if !'\\*[$CHAPTER_TITLE]'' \{\
4557 .                   if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4558 .                   UNDERSCORE "\\*[$CHAPTER_TITLE]
4559 .                \}
4560 .             \}
4561 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4562 .          \}
4563 .          if \\n[#PRINT_STYLE]=2 \{\
4564 .             CHAPTER_DOCHEADER
4565 .             di DOCHEADER_DIVERSION \" This diversion is only
4566 .             br                     \" necessary to find the depth of the
4567 .             CHAPTER_DOCHEADER      \" docheader
4568 .             br
4569 .             di
4570 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
4571 .                                                             \" in #DOCHEADER_DEPTH
4572 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
4573 .          \}
4574 .          ev
4575 .       \}
4576 \# Named
4577 .       if \\n[#DOC_TYPE]=3 \{\
4578 .          PRINT \&
4579 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
4580 .          ev DOCHEADER
4581 .          if \\n[#DOCHEADER_COLOR]=1 \{\
4582 .             nf
4583 \m[\\*[$DOCHEADER_COLOR]]
4584 .             EL
4585 .          \}
4586 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4587 .          LL       \\n[#DOC_L_LENGTH]u
4588 .          ta \\n(.lu
4589 .          if \\n[#PRINT_STYLE]=1 \{\
4590 .             CENTER
4591 .             fam C
4592 .             ft  R
4593 .             ps  12
4594 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4595 .             el \{ .vs \\n[#DOC_LEAD]u \}
4596 .             CAPS
4597 .             if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
4598 .             CAPS OFF
4599 .             if !'\\*[$SUBTITLE]'' \{\
4600 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4601 .                el \{ .vs \\n[#DOC_LEAD]u \}
4602 .                PRINT \\*[$SUBTITLE]
4603 .             \}
4604 .             if '\\*[$SUBTITLE]'' \{\
4605 .                ALD \\n[#DOC_LEAD]u
4606 .             \}
4607 .             ie !'\\*[$AUTHOR_1]'' \{\
4608 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4609 .                el \{ .vs \\n[#DOC_LEAD]u/2u \}
4610 .                if !d$SUBTITLE \{\
4611 .                   ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4612 .                   el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4613 .                \}
4614 .                PRINT \\*[$ATTRIBUTE_STRING]
4615 .                nr #AUTHORS \\n[#AUTHOR_NUM]
4616 .                nr #NEXT_AUTHOR 0 1
4617 .                while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4618 .                   PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4619 .                \}
4620 .                if \\n[#AUTHOR_LINES]=1 \{\
4621 .                    ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4622 .                    el \{ .ALD \\n[#DOC_LEAD]u/2u \}
4623 .                 \}
4624 .             vs  \\n[#DOC_LEAD]u
4625 .             \}
4626 .             el \{\
4627 .                ie !d$SUBTITLE \{\
4628 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4629 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4630 .                \}
4631 .                el \{\
4632 .                   ie \\n[#SINGLE_SPACE] \{ . \}
4633 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4634 .                \}
4635 .             \}
4636 .             ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
4637 .             el \{ .ALD \\n[#DOC_LEAD]u \}
4638 .             UNDERSCORE2 "\\*[$DOC_TYPE]
4639 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4640 .          \}
4641 .          if \\n[#PRINT_STYLE]=2 \{\
4642 .             NAMED_DOCHEADER
4643 .             di DOCHEADER_DIVERSION \" This diversion is only
4644 .             br                     \" necessary to find the depth of the
4645 .             NAMED_DOCHEADER        \" docheader
4646 .             br
4647 .             di
4648 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
4649 .                                                             \"in #DOCHEADER_DEPTH
4650 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
4651 .          \}
4652 .          ev
4653 .       \}
4654 .       if !\\n[#DOC_TYPE]=4 \{\
4655 .          if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
4656 .          nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD]
4657 .          ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]-\\n[#DOCHEADER_SPACE_ADJ] \}
4658 .          el \{ .nr #DOCHEADER_EXTRA_SPACE 0 \}
4659 .          if \\n[#PRINT_STYLE]=2 \{ .ALD (\\n[#DOC_LEAD]u*2u)+\\n[#DOCHEADER_EXTRA_SPACE]u \}
4660 .          if \\n[#COLUMNS] \{\
4661 .             nr #COL_NUM 0 1
4662 .             nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
4663 .             po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4664 .             nr #L_MARGIN \\n(.o
4665 .             LL \\n[#COL_L_LENGTH]u
4666 .             ta \\n(.lu
4667 .             mk dc
4668 .          \}
4669 .       \}
4670 .    \}
4671 .    QUAD \\*[$DOC_QUAD]
4672 .    rr #DOCHEADER_LEAD
4673 .    rr #DOCHEADER_LEAD_ADJ
4674 .    rr #DEPTH_1
4675 .    rr #DEPTH_2
4676 .    rr #DOCHEADER_ADVANCE
4677 .    rr #ADVANCE_FROM_TOP
4678 .    rr #DOCHEADER_SPACE_ADJ
4679 .    rr #DOCHEADER_EXTRA_SPACE
4680 .    rr #AUTHORS
4681 .    rr #NEXT_AUTHOR
4682 .    rr #AUTHOR_NUM
4683 .    rr #NUM_AUTHORS
4684 .    rm $TOC_TITLE_ITEM
4685 .    nr #START 1
4686 .    nr #START_FOR_FOOTERS 1
4687 .END
4689 \# ====================================================================
4691 \# +++MACROS TO CHANGE SOME DEFAULTS+++
4693 \# DOCUMENT HEADER
4694 \# ---------------
4695 \# *Argument:
4696 \#   <none> | <anything> [distance to advance from top of page]
4697 \# *Function:
4698 \#   Turns printing of document header on or off.  If a second argument
4699 \#   in units of measure is given, advances that distance from the
4700 \#   top of the page without printing the document header.
4701 \# *Notes:
4702 \#   Default is on.  If the 1st argument is <anything> (which turns
4703 \#   document headers off), the optional 2nd argument may be given
4704 \#   (with a unit of measure).
4706 .MAC DOCHEADER END
4707 .    ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
4708 .    el \{\
4709 .       if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
4710 .       nr #DOC_HEADER 0
4711 .    \}
4712 .END
4715 \# DOCUMENT HEADER LEADING
4716 \# -----------------------
4717 \# *Arguments:
4718 \#   <+|- amount by which to in/decrease leading of doc header>
4719 \# *Function:
4720 \#   Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
4721 \# *Notes:
4722 \#   A unit of measure must be supplied.  Decimal fractions OK.
4723 \#   Default is +0, i.e. same as DOC_LEAD.
4725 .MAC DOCHEADER_LEAD END
4726 .    ds $DOCHEADER_LEAD_ADJ \\$1
4727 .END
4730 \# DOCHEADER ADVANCE
4731 \# -----------------
4732 \# *Arguments:
4733 \#   <docheader start position>
4734 \# *Function:
4735 \#   Creates register #DOCHEADER_ADVANCE, used in START.
4736 \# *Notes:
4737 \#   Unit of measure required.
4738 \#   Default is same as T_MARGIN.
4740 .MAC DOCHEADER_ADVANCE END
4741 .    nr #DOCHEADER_ADVANCE (\\$1)
4742 .END
4745 \# DOCHEADER COLOR
4746 \# ---------------
4747 \# *Arguments:
4748 \#   <pre-defined XCOLOR or NEWCOLOR>
4749 \# *Function:
4750 \#   Sets register #DOCHEADER_COLOR to 1; defines string
4751 \#   $DOCHEADER_COLOR to argument.
4752 \# *Notes:
4753 \#   User must define an XCOLOR or NEWCOLOR before using
4754 \#   DOCHEADER_COLOR.
4756 .MAC DOCHEADER_COLOR END
4757 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
4758 .    nr #DOCHEADER_COLOR 1
4759 .    ds $DOCHEADER_COLOR \\$1
4760 .END
4763 \# TITLE FAMILY
4764 \# ------------
4765 \# *Argument:
4766 \#   <family to use for the document header title>
4767 \# *Function:
4768 \#   Creates or modifies string $TITLE_FAM.
4769 \# *Notes:
4770 \#   Default is same as running text.
4772 .MAC TITLE_FAMILY END
4773 .    ds $TITLE_FAM \\$1
4774 .END
4777 \# TITLE FONT
4778 \# ----------
4779 \# *Argument:
4780 \#   <font to use for the document header title>
4781 \# *Function:
4782 \#   Creates or modifies string $TITLE_FT.
4783 \# *Notes:
4784 \#   Default is bold.
4786 .MAC TITLE_FONT END
4787 .    ds $TITLE_FT \\$1
4788 .END
4791 \# TITLE SIZE
4792 \# ----------
4793 \# *Argument:
4794 \#   <+|- number of points by which to in/decrease title at start
4795 \#   of the document (relative to running text)>
4796 \# *Function:
4797 \#   Creates string $TITLE_SIZE_CHANGE.
4798 \# *Notes:
4799 \#   Must be preceded by a +|- sign, with no space afterwards.
4800 \#   Fractional point sizes are allowed.
4801 \#   Default is +3.5 for printstyle TYPESET DEFAULT | STORY | NAMED;
4802 \#   4 for TYPESET CHAPTER; +0 for TYPEWRITE.
4804 .MAC TITLE_SIZE END
4805 .    ds $TITLE_SIZE_CHANGE \\$1
4806 .END
4809 \# TITLE COLOR
4810 \# -----------
4811 \# *Argument:
4812 \#   <pre-defined color name>
4813 \# *Function:
4814 \#   Sets register #TITLE_COLOR to 1; creates string $TITLE_COLOR 
4815 \# *Notes:
4816 \#   The color name must be pre-defined with NEWCOLOR or XCOLOR.
4818 .MAC TITLE_COLOR END
4819 .    nr #TITLE_COLOR 1
4820 .    ds $TITLE_COLOR \\$1
4821 .END
4824 \# CHAPTER TITLE FAMILY
4825 \# --------------------
4826 \# *Argument:
4827 \#   <family to use for the chapter title, if there is one>
4828 \# *Function:
4829 \#   Creates or modifies string $CHAPTER_TITLE_FAM.
4830 \# *Notes:
4831 \#   Default isame as running text.
4833 .MAC CHAPTER_TITLE_FAMILY END
4834 .    ds $CHAPTER_TITLE_FAM \\$1
4835 .END
4838 \# CHAPTER TITLE FONT
4839 \# ------------------
4840 \# *Argument:
4841 \#   <font to use for the chapter title, if there is one>
4842 \# *Function:
4843 \#   Creates or modifies string $CHAPTER_TITLE_FT.
4844 \# *Notes:
4845 \#   Default is bold italic for TYPESET; varies in TYPEWRITE between
4846 \#   caps and underscored, depending on whether chapter title stands
4847 \#   alone or has CHAPTER # above it.
4849 .MAC CHAPTER_TITLE_FONT END
4850 .    ds $CHAPTER_TITLE_FT \\$1
4851 .END
4854 \# CHAPTER TITLE SIZE
4855 \# ------------------
4856 \# *Argument:
4857 \#   <+|- number of points by which to in/decrease title at start
4858 \#   of the document (relative to running text)>
4859 \# *Function:
4860 \#   Creates string $CHAPTER_TITLE_SIZE_CHANGE.
4861 \# *Notes:
4862 \#   Must be preceded by a +|- sign, with no space afterwards.
4863 \#   Fractional point sizes are allowed.
4864 \#   Default is +4 for printstyle TYPESET
4866 .MAC CHAPTER_TITLE_SIZE END
4867 .    ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
4868 .END
4871 \# SUBTITLE FAMILY
4872 \# ---------------
4873 \# *Argument:
4874 \#   <family to use for the document header title>
4875 \# *Function:
4876 \#   Creates or modifies string $SUBTITLE_FAM.
4877 \# *Notes:
4878 \#   Default is same as running text.
4880 .MAC SUBTITLE_FAMILY END
4881 .    ds $SUBTITLE_FAM \\$1
4882 .END
4885 \# SUBTITLE FONT
4886 \# -------------
4887 \# *Argument:
4888 \#   <font to use for the document header title>
4889 \# *Function:
4890 \#   Creates or modifies string $SUBTITLE_FT.
4891 \# *Notes:
4892 \#   Default is same as running text.
4894 .MAC SUBTITLE_FONT END
4895 .    ds $SUBTITLE_FT \\$1
4896 .END
4899 \# SUBTITLE SIZE
4900 \# -------------
4901 \# *Argument:
4902 \#   <+|- number of points by which to in/decrease subtitle at start
4903 \#   of the document (relative to running text)>
4904 \# *Function:
4905 \#   Creates or modifies string $SUBTITLE_SIZE_CHANGE.
4906 \# *Notes:
4907 \#   Must be preceded by a +|- sign with no space afterwards.
4908 \#   Fractional point sizes are allowed.
4909 \#   Default is +0.
4911 .MAC SUBTITLE_SIZE END
4912 .    ds $SUBTITLE_SIZE_CHANGE \\$1
4913 .END
4916 \# SUBTITLE COLOR
4917 \# --------------
4918 \# *Argument:
4919 \#   <pre-defined color name>
4920 \# *Function:
4921 \#   Sets register #SUBTITLE_COLOR to 1; creates string
4922 \#   $SUBTITLE_COLOR.
4923 \# *Notes:
4924 \#   The color name must be pre-defined with NEWCOLOR or XCOLOR.
4926 .MAC SUBTITLE_COLOR END
4927 .    nr #SUBTITLE_COLOR 1
4928 .    ds $SUBTITLE_COLOR \\$1
4929 .END
4932 \# ATTRIBUTE COLOR
4933 \# ---------------
4934 \# *Argument:
4935 \#   <pre-defined color name>
4936 \# *Function:
4937 \#   Sets register #ATTRIBUTE_COLOR to 1; creates string $ATTRIBUTE_COLOR 
4938 \# *Notes:
4939 \#   The color name must be pre-defined with NEWCOLOR or XCOLOR.
4941 .MAC ATTRIBUTE_COLOR END
4942 .    nr #ATTRIBUTE_COLOR 1
4943 .    ds $ATTRIBUTE_COLOR \\$1
4944 .END
4947 \# AUTHOR FAMILY
4948 \# -------------
4949 \# *Argument:
4950 \#   <family to use for author in document header>
4951 \# *Function:
4952 \#   Creates or modifies string $AUTHOR_FAM.
4953 \# *Notes:
4954 \#   Default is same as running text.
4956 .MAC AUTHOR_FAMILY END
4957 .    ds $AUTHOR_FAM \\$1
4958 .END
4961 \# AUTHOR FONT
4962 \# -----------
4963 \# *Argument:
4964 \#   <font to use for author in document header>
4965 \# *Function:
4966 \#   Creates or modifies string $AUTHOR_FT.
4967 \# *Notes:
4968 \#   Default is italic.
4970 .MAC AUTHOR_FONT END
4971 .    ds $AUTHOR_FT \\$1
4972 .END
4975 \# AUTHOR SIZE
4976 \# -----------
4977 \# *Argument:
4978 \#   <+|- number of points by which to in/decrease author at start
4979 \#   of the document>
4980 \# *Function:
4981 \#   Creates or modifies string $AUTHOR_SIZE_CHANGE.
4982 \# *Notes:
4983 \#   Must be preceded by a +|- sign with no space afterwards.
4984 \#   Fractional point sizes are allowed.
4985 \#   Default is same as running text.
4987 .MAC AUTHOR_SIZE END
4988 .    ds $AUTHOR_SIZE_CHANGE \\$1
4989 .END
4992 \# AUTHOR COLOR
4993 \# ------------
4994 \# *Argument:
4995 \#   <pre-defined color name>
4996 \# *Function:
4997 \#   Sets register #AUTHOR_COLOR to 1; creates string $AUTHOR_COLOR 
4998 \# *Notes:
4999 \#   The color name must be pre-defined with NEWCOLOR or XCOLOR.
5001 .MAC AUTHOR_COLOR END
5002 .    nr #AUTHOR_COLOR 1
5003 .    ds $AUTHOR_COLOR \\$1
5004 .END
5007 \# DOCTYPE FAMILY
5008 \# --------------
5009 \# *Argument:
5010 \#   <family to use for the document type string>
5011 \# *Function:
5012 \#   Creates or modifies string $DOCTYPE_FAM.
5013 \# *Notes:
5014 \#   Default is same as running text.
5016 .MAC DOCTYPE_FAMILY END
5017 .    ds $DOCTYPE_FAM \\$1
5018 .END
5021 \# DOCTYPE FONT
5022 \# ------------
5023 \# *Argument:
5024 \#   <font to use for the document type string>
5025 \# *Function:
5026 \#   Creates or modifies string $DOCTYPE_FT.
5027 \# *Notes:
5028 \#   Default is bold italic.
5030 .MAC DOCTYPE_FONT END
5031 .    ds $DOCTYPE_FT \\$1
5032 .END
5035 \# DOCTYPE SIZE
5036 \# -------------
5037 \# *Argument:
5038 \#   <+|- number of points by which to in/decrease the document
5039 \#   type string (relative to running text)>
5040 \# *Function:
5041 \#   Creates or modifies string $DOCTYPE_SIZE_CHANGE.
5042 \# *Notes:
5043 \#   Must be preceded by a +|- sign with no space afterwards.
5044 \#   Fractional point sizes are allowed.
5045 \#   Default is +3 for TYPESET; 0 for TYPEWRITE.
5047 .MAC DOCTYPE_SIZE END
5048 .    ds $DOCTYPE_SIZE_CHANGE \\$1
5049 .END
5052 \# DOCTYPE COLOR
5053 \# -------------
5054 \# *Argument:
5055 \#   <pre-defined color name>
5056 \# *Function:
5057 \#   Sets register #DOCTYPE_COLOR to 1; creates string $DOCTYPE_COLOR 
5058 \# *Notes:
5059 \#   The color name must be pre-defined with NEWCOLOR or XCOLOR.
5061 .MAC DOCTYPE_COLOR END
5062 .    nr #DOCTYPE_COLOR 1
5063 .    ds $DOCTYPE_COLOR \\$1
5064 .END
5067 \# DOCUMENT LEFT MARGIN
5068 \# --------------------
5069 \# *Argument:
5070 \#   <left margin of document>
5071 \# *Function:
5072 \#   Creates or modifies register #DOC_L_MARGIN.
5073 \# *Notes:
5074 \#   Affects EVERYTHING on the page.
5076 .MAC DOC_LEFT_MARGIN END
5077 .    br
5078 .    nr #DOC_L_MARGIN (\\$1)
5079 .    L_MARGIN \\n[#DOC_L_MARGIN]u
5080 .END
5083 \# DOCUMENT RIGHT MARGIN
5084 \# ---------------------
5085 \# *Argument:
5086 \#   <right margin of document>
5087 \# *Function:
5088 \#   Creates or modifies register #DOC_R_MARGIN.
5089 \# *Notes:
5090 \#   Affects EVERYTHING on the page.
5092 .MAC DOC_RIGHT_MARGIN END
5093 .    br
5094 .    nr #DOC_R_MARGIN (\\$1)
5095 .    R_MARGIN \\n[#DOC_R_MARGIN]
5096 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
5097 .END
5100 \# DOCUMENT LINE LENGTH
5101 \# --------------------
5102 \# *Argument:
5103 \#   <line length of document>
5104 \# *Function:
5105 \#   Creates or modifies string $DOC_L_LENGTH.
5106 \# *Notes:
5107 \#   Affects EVERYTHING on the page.
5109 .MAC DOC_LINE_LENGTH END
5110 .    br
5111 .    nr #DOC_L_LENGTH (\\$1)
5112 .    LL \\n[#DOC_L_LENGTH]u
5113 .    ta \\n(.lu
5114 .END
5117 \# DOCUMENT FAMILY
5118 \# ---------------
5119 \# *Argument:
5120 \#   <family of running text>
5121 \# *Function:
5122 \#   Creates or modifies string $DOC_FAM.
5123 \# *Notes:
5124 \#   Affects everything EXCEPT headers and footers.
5126 .MAC DOC_FAMILY END
5127 .    br
5128 .    ds $DOC_FAM \\$1
5129 .    FAMILY            \\*[$DOC_FAM]
5130 .    TITLE_FAMILY      \\*[$DOC_FAM]
5131 .    SUBTITLE_FAMILY   \\*[$DOC_FAM]
5132 .    AUTHOR_FAMILY     \\*[$DOC_FAM]
5133 .    DOCTYPE_FAMILY    \\*[$DOC_FAM]
5134 .    HEAD_FAMILY       \\*[$DOC_FAM]
5135 .    SUBHEAD_FAMILY    \\*[$DOC_FAM]
5136 .    QUOTE_FAMILY      \\*[$DOC_FAM]
5137 .    BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
5138 .    EPIGRAPH_FAMILY   \\*[$DOC_FAM]
5139 .    HDRFTR_FAMILY     \\*[$DOC_FAM]
5140 .    PAGENUM_FAMILY    \\*[$DOC_FAM]
5141 .END
5144 \# DOCUMENT POINT SIZE
5145 \# -------------------
5146 \# *Argument:
5147 \#   <point size of running text>
5148 \# *Function:
5149 \#   Creates or modifies register #DOC_PT_SIZE.
5150 \# *Notes:
5151 \#   DOC_PT_SIZE is the basis for calculating all type sizes in
5152 \#   a document.
5154 .MAC DOC_PT_SIZE END
5155 .    if \\n[#IGNORE] \{ .return \}
5156 .    br
5157 .    PT_SIZE \\$1
5158 .    nr #DOC_PT_SIZE \\n[#PT_SIZE]
5159 .END
5162 \# DOCUMENT LEAD
5163 \# -------------
5164 \# *Argument:
5165 \#   <lead (".vs") of running text> [ADJUST]
5166 \# *Function:
5167 \#   Creates or modifies register #DOC_LEAD.  If the optional
5168 \#   ADJUST argument is given, adjusts leading so that the last
5169 \#   line of text falls exactly on #B_MARGIN.
5170 \# *Notes:
5171 \#   DOC_LEAD is the basis for calculating all leading changes in
5172 \#   a document.  Default for TYPESET is 16; 24 for TYPEWRITE.
5174 \#   Because the visible bottom or footer margin of a page depends
5175 \#   on the overall document lead supplied by the register #DOC_LEAD,
5176 \#   DOC_LEAD, in the body of a document, should always be associated
5177 \#   with the start of a new page (in other words, just before or
5178 \#   just after a manual NEWPAGE).
5180 .MAC DOC_LEAD END
5181 .    if \\n[#IGNORE] \{ .return \}
5182 .    br
5183 .    vs \\$1
5184 .    nr #DOC_LEAD \\n[#LEAD]
5185 .    if '\\$2'ADJUST' \{ .TRAPS \}
5186 .END
5189 \# ADJUST DOCUMENT LEAD
5190 \# --------------------
5191 \# *Arguments:
5192 \#   <none> | <anything>
5193 \# *Function:
5194 \#   Adjusts document lead so that the last line of text falls exactly
5195 \#   on #B_MARGIN.
5197 .MAC DOC_LEAD_ADJUST END
5198 .    ie '\\$1'' \{ .nr #ADJ_DOC_LEAD 1 \}
5199 .    el \{ .nr #ADJ_DOC_LEAD 0 \}
5200 .END
5203 \# SHIM
5204 \# ----
5205 \# *Argument:
5206 \#   None
5207 \# *Function:
5208 \#   Advances to the next "legal" baseline.
5209 \# *Notes:
5210 \#   If a user plays around with spacing in a doc (say, with ALD),
5211 \#   it isn't easy to get mom back on track so she can achieve
5212 \#   perfectly flush bottom margins.  Any time SHIM is used, it
5213 \#   ensures that the next output line falls on a legal baseline.
5215 \# First, a little convenience macro
5217 .MAC PROCESS_SHIM END
5218 .    while \\n+[#LEGAL_BASELINE]<\\n[#CURRENT_V_POS] \{\
5220 .    \}
5221 .    nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
5222 .END
5224 .MAC SHIM END
5225 .    nr #CURRENT_V_POS \\n(.d
5226 .    nr #LEGAL_BASELINE \\n[#T_MARGIN]-1v \\n[#DOC_LEAD]
5227 .    ie r#ADVANCE_FROM_TOP \{\
5228 .       ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
5229 .          while \\n-[#LEGAL_BASELINE]>\\n[#CURRENT_V_POS] \{\
5231 .          \}
5232 .          nr #LEGAL_BASELINE +\\n[#DOC_LEAD]
5233 .          nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
5234 .       \}
5235 .       el \{\
5236 .          PROCESS_SHIM
5237 .       \}
5238 .    \}
5239 .    el \{\
5240 .       PROCESS_SHIM
5241 .    \}
5242 .    ALD \\n[#SHIM]u
5243 .END
5246 \# DOCUMENT QUAD
5247 \# -------------
5248 \# *Arguments:
5249 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE | J | JUSTIFY
5250 \# *Function:
5251 \#   Creates or modifies string $DOC_QUAD.
5252 \# *Notes:
5253 \#   While QUAD (from the typesetting macros) can be used before START
5254 \#   to change  the default document quad, DOC_QUAD *must* be used after
5255 \#   the START macro has been invoked.
5257 \#   Default is LEFT for printstyle TYPEWRITE, JUSTIFY for printstyle
5258 \#   TYPESET.
5260 .MAC DOC_QUAD END
5261 .    ds $DOC_QUAD \\$1
5262 .    QUAD \\*[$DOC_QUAD]
5263 .END
5265 \# ====================================================================
5267 \# +++INTERNATIONALIZATION+++
5269 \# ATTRIBUTE STRING
5270 \# ----------------
5271 \# *Argument:
5272 \#   <what goes in the "by" slot before author in the document header>
5273 \# *Function:
5274 \#   Creates or modifies string $ATTRIBUTE_STRING.
5275 \# *Notes:
5276 \#   Default is "by".  A blank string ("") may be used if no
5277 \#   attribution is desired.
5279 .MAC ATTRIBUTE_STRING END
5280 .    ds $ATTRIBUTE_STRING \\$1
5281 .END
5284 \# CHAPTER STRING
5285 \# --------------
5286 \# *Argument:
5287 \#   <what to print any time the word "chapter" is required>
5288 \# *Function:
5289 \#   Creates or modifies string $CHAPTER_STRING.
5290 \# *Notes:
5291 \#   Default is "chapter".
5293 .MAC CHAPTER_STRING END
5294 .    ds $CHAPTER_STRING \\$1
5295 .END
5298 \# DRAFT STRING
5299 \# ------------
5300 \# *Argument:
5301 \#   <what to print any time the word "draft" is required>
5302 \# *Function:
5303 \#   Creates or modifies string $DRAFT_STRING.
5304 \# *Notes:
5305 \#   Default is "draft".
5307 .MAC DRAFT_STRING END
5308 .    ds $DRAFT_STRING \\$1
5309 .END
5312 \# REVISION STRING
5313 \# ---------------
5314 \# *Argument:
5315 \#   <what to print any time the word "revision" is required>
5316 \# *Function:
5317 \#   Creates or modifies string $REVISION_STRING.
5318 \# *Notes:
5319 \#   Default is "revision".
5321 .MAC REVISION_STRING END
5322 .    ds $REVISION_STRING \\$1
5323 .END
5326 \# FINIS STRING
5327 \# ------------
5328 \# *Argument:
5329 \#   <what to print with the finis macro>
5330 \# *Function:
5331 \#   Creates or modifies string $FINIS_STRING.
5332 \# *Notes:
5333 \#   Default is "END".
5335 .MAC FINIS_STRING END
5336 .    nr #FINIS 1
5337 .    CAPS
5338 .    ds $FINIS_STRING \\$1
5339 .    CAPS OFF
5340 .END
5342 \# FINIS COLOR
5343 \# -----------
5344 \# *Arguments:
5345 \#   <pre-defined XCOLOR or NEWCOLOR>
5346 \# *Function:
5347 \#   Defines string $FINIS_COLOR to argument.
5348 \# *Notes:
5349 \#   User must define an XCOLOR or NEWCOLOR before using
5350 \#   FINIS_COLOR.
5352 .MAC FINIS_COLOR END
5353 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
5354 .    ds $FINIS_COLOR \\$1
5355 .END
5358 \# ====================================================================
5360 \# +++RECTO/VERSO+++
5362 \# RECTO_VERSO
5363 \# -----------
5364 \# *Arguments:
5365 \#   <none> | <anything>
5366 \# *Function:
5367 \#   Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages.  Also
5368 \#   switches page numbers left and right if either is chosen rather
5369 \#   than the default centered page numbers.  Switches left and right
5370 \#   margins if differing values have been entered.
5371 \# *Notes:
5372 \#   Default is OFF.
5374 .MAC RECTO_VERSO END
5375 .    ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
5376 .    el \{ .nr #RECTO_VERSO 0 \}
5377 .END
5379 \# ====================================================================
5381 \# +++EPIGRAPHS+++
5383 \# EPIGRAPH FAMILY
5384 \# ---------------
5385 \# *Argument:
5386 \#   <family to use for epigraphs>
5387 \# *Function:
5388 \#   Creates or modifies string $EPI_FAM.
5389 \# *Notes:
5390 \#   Default is same as running text.
5392 .MAC EPIGRAPH_FAMILY END
5393 .    ds $EPI_FAM \\$1
5394 .END
5397 \# EPIGRAPH FONT
5398 \# -------------
5399 \# *Argument:
5400 \#   <font to use for epigraphs>
5401 \# *Function:
5402 \#   Creates or modifies string $EPI_FT.
5403 \# *Notes:
5404 \#   Default is same as running text.
5406 .MAC EPIGRAPH_FONT END
5407 .    ds $EPI_FT \\$1
5408 .END
5411 \# EPIGRAPH SIZE
5412 \# -------------
5413 \# *Argument:
5414 \#   <-|+ number of points by which to de/increase point size of epigraphs
5415 \#   (relative to running text)>
5416 \# *Function:
5417 \#   Creates or modifies string $EPI_SIZE_CHANGE.
5418 \# *Notes:
5419 \#   Must be preceded by a - or + sign with no space afterwards.
5420 \#   Fractional point sizes are allowed.  Default -1.5 for printstyle
5421 \#   TYPESET; +0 for TYPEWRITE.
5423 .MAC EPIGRAPH_SIZE END
5424 .    ds $EPI_SIZE_CHANGE \\$1
5425 .END
5428 \# EPIGRAPH COLOR
5429 \# --------------
5430 \# *Arguments:
5431 \#   <pre-defined XCOLOR or NEWCOLOR>
5432 \# *Function:
5433 \#   Sets register #EPI_COLOR to 1; defines string
5434 \#   $EPI_COLOR to argument.
5435 \# *Notes:
5436 \#   User must define an XCOLOR or NEWCOLOR before using
5437 \#   EPI_COLOR.
5439 .MAC EPIGRAPH_COLOR END
5440 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
5441 .    nr #EPI_COLOR 1
5442 .    ds $EPI_COLOR \\$1
5443 .END
5446 \# EPIGRAPH QUAD
5447 \# -------------
5448 \# *Arguments:
5449 \#   L | LEFT | J | JUSTIFY
5450 \# *Function:
5451 \#   Creates or modifies string $EPI_QUAD.
5452 \# *Notes:
5453 \#   Default is $DOC_QUAD when BLOCK argument is passed to EPIGRAPH.
5455 .MAC EPIGRAPH_QUAD END
5456 .    ds $EPI_QUAD \\$1
5457 .END
5460 \# EPIGRAPH INDENT
5461 \# ---------------
5462 \# *Argument:
5463 \#   <value by which to multiply PP_INDENT for block epigraphs>
5464 \# *Function:
5465 \#   Creates or modifies register #EPI_OFFSET_VALUE.
5466 \# *Notes:
5467 \#   Default is 2 for TYPEWRITE, 3 for TYPESET.
5469 .MAC EPIGRAPH_INDENT END
5470 .    nr #EPI_OFFSET_VALUE \\$1
5471 .END
5474 \# EPIGRAPH AUTOLEAD
5475 \# -----------------
5476 \# *Argument:
5477 \#   <amount of lead to add to the epigraph ps for epigraph leading>
5478 \# *Function:
5479 \#   Creates or modifies register #EPI_AUTOLEAD.
5480 \# *Notes:
5481 \#   Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
5483 .MAC EPIGRAPH_AUTOLEAD END
5484 .    nr #EPI_AUTOLEAD \\$1
5485 .END
5488 \# EPIGRAPH
5489 \# --------
5490 \# *Arguments:
5491 \#   BLOCK | <anything>
5492 \# *Function:
5493 \#   Places an epigraph before the document's text, after the
5494 \#   document header, or after a HEAD.
5495 \# *Notes:
5496 \#   #EPIGRAPH 1 = centered; 2 = block
5498 \#   By default, epigraphs are centered, allowing the user
5499 \#   to input them on a line per line basis.  To change this
5500 \#   behaviour, the user can supply the argument BLOCK, which
5501 \#   will produce indented, filled text similar to BLOCKQUOTE.
5503 \#   If a block epigraph contains more than one para, ALL paras of
5504 \#   the epigraph must be preceded by PP.  Otherwise, PP is optional.
5506 .MAC EPIGRAPH END
5507 .    nr #PP_STYLE 2
5508 .    nr #Q_PP     0
5509 .    if \\n[#START] \{\
5510 .       if \\n[#PRINT_STYLE]=1 \{\
5511 .          if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
5512 .       \}
5513 .    \}
5514 .    ie '\\$1'' \{\
5515 .       nr #EPIGRAPH 1
5516 .       ev EPIGRAPH
5517 .       ll \\n[#L_LENGTH]u
5518 .       ta \\n(.lu
5519 .       CHECK_INDENT
5520 .       if \\n[#COLUMNS] \{\
5521 .          ie \\n[#START] \{\
5522 .              ll \\n[#DOC_L_LENGTH]u
5523 .              ta \\n(.lu
5524 .          \}
5525 .          el \{\
5526 .             ll \\n[#COL_L_LENGTH]u
5527 .             ta \\n(.lu
5528 .          \}
5529 .       \}
5530 .       CENTER
5531 .       if \\n[#PRINT_STYLE]=1 \{\
5532 .          fam C
5533 .          ft  R
5534 .          if '\\*[$EPI_FT]'I' \{\
5535 .             FT I
5536 .          \}
5537 .          ps  12
5538 .          ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
5539 .          el \{ .vs  \\n[#DOC_LEAD]u/2u \}
5540 .          nr #EPI_LEAD      \\n[#LEAD]
5541 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5542 .       \}
5543 .       if \\n[#PRINT_STYLE]=2 \{\
5544 .          FAMILY   \\*[$EPI_FAM]
5545 .          FT       \\*[$EPI_FT]
5546 .          PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
5547 .          if \\n[#EPI_COLOR]=1 \{\
5548 .             nf
5549 \m[\\*[$EPI_COLOR]]
5550 .             EL
5551 .          \}
5552 .          AUTOLEAD \\n[#EPI_AUTOLEAD]
5553 .          nr #EPI_LEAD      \\n[#LEAD]
5554 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5555 .       \}
5556 .       di EPI_TEXT
5557 .       nr #EPI_ACTIVE 1
5558 .    \}
5559 .    el \{\
5560 .       ie '\\$1'BLOCK' \{\
5561 .          nr #EPIGRAPH 2
5562 .          ev EPIGRAPH
5563 .          ie \\n[#START] \{\
5564 .             ie \\n[#COLUMNS] \{\
5565 .                ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5566 .                ta \\n(.lu
5567 .             \}
5568 .             el \{\
5569 .                ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5570 .                ta \\n(.lu
5571 .             \}
5572 .          \}
5573 .          el \{\
5574 .             ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5575 .             ta \\n(.lu
5576 .             if \\n[#COLUMNS] \{\
5577 .                ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5578 .                ta \\n(.lu
5579 .             \}
5580 .             CHECK_INDENT
5581 .          \}
5582 .          if \\n[#PRINT_STYLE]=1 \{\
5583 .             fam C
5584 .             ft  R
5585 .             if '\\*[$EPI_FT]'I' \{\
5586 .                FT I
5587 .             \}
5588 .             ps  12
5589 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
5590 .             el \{ .vs  \\n[#DOC_LEAD]u/2u \}
5591 .             QUAD LEFT
5592 .             HY OFF
5593 .             nr #EPI_LEAD \\n[#LEAD]
5594 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5595 .             di EPI_TEXT
5596 .             nr #EPI_ACTIVE 1
5597 .          \}
5598 .          if \\n[#PRINT_STYLE]=2 \{\
5599 .             FAMILY   \\*[$EPI_FAM]
5600 .             FT       \\*[$EPI_FT]
5601 .             PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
5602 .          if \\n[#EPI_COLOR]=1 \{\
5603 .             nf
5604 \m[\\*[$EPI_COLOR]]
5605 .             EL
5606 .          \}
5607 .             AUTOLEAD \\n[#EPI_AUTOLEAD]
5608 .             QUAD     \\*[$EPI_QUAD]
5609 .             HY
5610 .             nr #EPI_LEAD \\n[#LEAD]
5611 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5612 .             di EPI_TEXT
5613 .             nr #EPI_ACTIVE 1
5614 .          \}
5615 .       \}
5616 .       el \{\
5617 .          DO_EPIGRAPH
5618 .       \}
5619 .    \}
5620 .END
5623 \# DO EPIGRAPH
5624 \# -----------
5625 \# *Arguments:
5626 \#   <none>
5627 \# *Function:
5628 \#   Ends diversion started in EPIGRAPH.  Makes spacing
5629 \#   adjustments to compensate for the difference between epigraph
5630 \#   leading and overall document leading, so that the bottom of
5631 \#   the pages remain flush.
5632 \# *Notes:
5633 \#   In addition to its usual place at the beginning of a
5634 \#   document, EPIGRAPH may also be used after HEAD.
5636 .MAC DO_EPIGRAPH END
5637 .    br
5638 .    di
5639 .    REMOVE_INDENT
5640 .    ev
5641 .    nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
5642 .    nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
5643 .    ie \\n[#START] \{\
5644 .       nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
5645 .       while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5646 .             nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
5647 .       \}
5648 .       if \\n[#PRINT_STYLE]=2 \{\
5649 .          RLD \\n[#DOC_LEAD]u
5650 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5651 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
5652 .          \}
5653 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5654 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5655 .          \}
5656 .       \}
5657 .    \}
5658 .    el \{\
5659 .       ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
5660 .          nr #EPI_FITS 1
5661 .          nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
5662 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5663 .                nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
5664 .          \}
5665 .          ie \\n[#PRINT_STYLE]=1 \{\
5666 .             if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
5667 .          \}
5668 .          el \{\
5669 .             if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5670 .                ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
5671 .             \}
5672 .             if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5673 .                ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5674 .             \}
5675 .          \}
5676 .       \}
5677 .       el \{\
5678 .          nr #EPI_LINES_TO_TRAP 0 1
5679 .          while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\
5680 .                nr #LOOP 1
5681 .          \}
5682 .          nr #EPI_LINES_TO_TRAP -1
5683 .          nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
5684 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5685 .                nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
5686 .          \}
5687 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
5688 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
5689 .      \}
5690 .    \}
5691 .    if \\n[#EPIGRAPH]=1 \{\
5692 .       po \\n[#L_MARGIN]u
5693 .       if \\n[#COLUMNS] \{\
5694 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5695 .          nr #L_MARGIN \\n(.o
5696 .       \}
5697 .    \}
5698 .    if \\n[#EPIGRAPH]=2 \{\
5699 .       nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5700 .       if \\n[#COLUMNS] \{\
5701 .          nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5702 .       \}
5703 .       po \\n[#EPI_OFFSET]u
5704 .    \}
5705 .    nf
5706 .    EPI_TEXT
5707 .    br
5708 .    ie \\n[#START] \{\
5709 .       if \\n[#PRINT_STYLE]=1 \{\
5710 .          ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
5711 .          el \{\
5712 .             ie \\n[#EPI_LINES]%2=1 \{ .ALD \\n[#DOC_LEAD]u \}
5713 .             el \{ .ALD \\n[#DOC_LEAD]u/2u \}
5714 .          \}
5715 .       \}
5716 .       if \\n[#PRINT_STYLE]=2 \{\
5717 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5718 .             ALD \\n[#EPI_WHITESPACE]u/2u
5719 .          \}
5720 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5721 .             ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5722 .          \}
5723 .       \}
5724 .    \}
5725 .    el \{\
5726 .       rr #EPI_ACTIVE
5727 .       ie \\n[#EPI_FITS] \{\
5728 .          ie \\n[#FN_FOR_EPI] \{\
5729 .             nr #EPI_LINES_TO_END 1
5730 .             nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
5731 .             while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5732 .                   nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
5733 .             \}
5734 .             ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
5735 .          \}
5736 .          el \{\
5737 .             ie \\n[#PRINT_STYLE]=1 \{\
5738 .                if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
5739 .             \}
5740 .             el \{\
5741 .                if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5742 .                   ALD \\n[#EPI_WHITESPACE]u/2u
5743 .                \}
5744 .                if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5745 .                   ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5746 .                \}
5747 .             \}
5748 .          \}
5749 .       \}
5750 .       el \{\
5751 .          nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
5752 .          if \\n[#LOOP] \{. nr #EPI_LINES_TO_END +1 \}
5753 .          rr #LOOP
5754 .          nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
5755 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5756 .                nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
5757 .          \}
5758 .          ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
5759 .          if \\n[#PRINT_STYLE]=1 \{\
5760 .             if !\\n[#SINGLE_SPACE] \{\
5761 .                nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
5762 .                ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
5763 .                el \{ .RLD .5v \}
5764 .                rr #EPI_LINES_EVEN
5765 .             \}
5766 .          \}
5767 .       \}
5768 .    \}
5769 .    nr #PP_STYLE 1
5770 .    rr #EPI_FITS
5771 .    ALD \\n[#DOC_LEAD]u
5772 .    QUAD \\*[$DOC_QUAD]
5773 .    po \\n[#L_MARGIN]u
5774 .    if \\n[#COLUMNS] \{\
5775 .       po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5776 .       nr #L_MARGIN \\n(.o
5777 .    \}
5778 .    if \\n[#START] \{\
5779 .       if \\n[#COLUMNS] \{\
5780 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5781 .          nr #L_MARGIN \\n(.o
5782 .          mk dc
5783 .       \}
5784 .    \}
5785 .END
5787 \# ====================================================================
5789 \# +++FINIS MACRO+++
5791 \# FINIS
5792 \# -----
5793 \# *Arguments:
5794 \#   <none>
5795 \# *Function:
5796 \#   Deposits --END-- at the end of a document.
5798 .MAC FINIS END
5799 .    ev FINIS
5800 .    evc 0
5801 .    nr #FINIS 1
5802 .    if \\n[#TAB_ACTIVE] \{ .TQ \}
5803 .    if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
5804 .    if \\n[#FOOTERS_ON] \{\
5805 .       nr #FOOTERS_WERE_ON 1
5806 .       FOOTERS OFF
5807 .    \}
5808 .    if \\n[#PAGINATE] \{\
5809 .       if \\n[#PAGE_NUM_V_POS]=2 \{\
5810 .          nr #PAGINATION_WAS_ON 1
5811 .          PAGINATION OFF
5812 .       \}
5813 .    \}
5814 .    nr #EM_ADJUST (1m/8)
5815 .    if \\n[#COLUMNS] \{\
5816 .       po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5817 .       nr #L_MARGIN \\n(.o
5818 .    \}
5819 .    ALD \\n[#DOC_LEAD]u
5820 .    CENTER
5821 .    if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
5822 .    if \\n[#PRINT_STYLE]=2 \{\
5823 .       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[]
5824 .    \}
5825 .    ev
5826 .END
5828 \# ====================================================================
5830 \# +++HEADERS/FOOTERS+++
5832 \# Define a string so that the current page number can be incorporated
5833 \# into the strings for hdrftr left, right, and center.  NOTE: This is
5834 \# not the same thing as using the shortform # in hdrftr strings.
5836 .ds PAGE# \En[#PAGENUMBER]
5839 \# HDRFTR FAMILY
5840 \# -------------
5841 \# *Argument:
5842 \#   <family to use in header/footers>
5843 \# *Function:
5844 \#   Creates or modifies string $HDRFTR_FAM.
5845 \# *Notes:
5846 \#   Default is same as running text.
5848 .MAC HDRFTR_FAMILY END
5849 .    ds $HDRFTR_FAM \\$1
5850 .END
5853 \# HDRFTR SIZE
5854 \# -----------
5855 \# *Argument:
5856 \#   <+|-number of points by which to in/decrease point size of
5857 \#   header/footers (relative to running text)>
5858 \# *Function:
5859 \#   Creates or modifies string $HDRFTR_SIZE_CHANGE.
5860 \# *Notes:
5861 \#   Must be preceded by a +|- sign.  No space afterwards.
5862 \#   Fractional point sizes are allowed.  Default is +0.
5864 \#   By default, header/footers print the author .5 points smaller
5865 \#   than the base point size of running text, center titles
5866 \#   (Chapter, Draft, Revision, etc.)  .5 points smaller
5867 \#   than running text (in italics), and the document title 2 full
5868 \#   points smaller than running text (in caps).  The HDRFTR_SIZE
5869 \#   macro changes the overall size for all three parts while
5870 \#   maintaining the internal size changes.
5872 \#   In other words, if the user likes the header/footers but wants
5873 \#   them a bit bigger or a bit smaller, s/he should use HDRFTR_SIZE.
5875 .MAC HDRFTR_SIZE END
5876 .    ds $HDRFTR_SIZE_CHANGE \\$1
5877 .END
5880 \# HDRFTR COLOR
5881 \# ------------
5882 \# *Arguments:
5883 \#   <pre-defined XCOLOR or NEWCOLOR>
5884 \# *Function:
5885 \#   Sets register #HDRFTR_COLOR to 1; defines string $HDRFTR_COLOR to
5886 \#   argument.
5887 \# *Notes:
5888 \#   User must define an XCOLOR or NEWCOLOR before using
5889 \#   HDRFTR_COLOR.
5891 .MAC HDRFTR_COLOR END
5892 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
5893 .    nr #HDRFTR_COLOR 1
5894 .    ds $HDRFTR_COLOR \\$1
5895 .END
5898 \# HDRFTR RULE GAP
5899 \# ---------------
5900 \# *Argument:
5901 \#   <amount of space between header/footer and header/footer rule>
5902 \# *Function:
5903 \#   Creates or modifies register #HDRFTR_RULE_GAP to hold amount
5904 \#   of space between header/footer and header/footer rule.
5905 \# *Notes:
5906 \#   Default is 4p.
5908 .MAC HDRFTR_RULE_GAP END
5909 .    nr #HDRFTR_RULE_GAP (\\$1)
5910 .END
5913 \# HDRFTR LEFT
5914 \# -----------
5915 \# *Argument:
5916 \#   <what to put in the left position of page header/footers>
5917 \# *Function:
5918 \#   Creates or modifies string $HDRFTR_LEFT.
5919 \#   Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
5920 \#   overrides the $HDRFTR_LEFT string created by default
5921 \#   in DEFAULTS.
5922 \# *Notes:
5923 \#   Especially useful if doc has more than one author, and a list
5924 \#   of authors by last name is desired in header/footers.
5925 \#   Default is author.
5927 \#   If the argument is the # character, simply prints the current
5928 \#   page number.
5930 \#   If the user wants to *incorporate* the page number into the string,
5931 \#   \*[PAGE#] must be used.  For example, if the user wants to put
5932 \#   an elipsis before the page number in the string, s/he should use
5933 \#   ...\*[PAGE#], not ...#
5935 .MAC HDRFTR_LEFT END
5936 .    nr #USER_DEF_HDRFTR_LEFT 1
5937 .    ds $HDRFTR_LEFT \\$1
5938 .END
5941 \# HDRFTR LEFT FAMILY
5942 \# ------------------
5943 \# *Argument:
5944 \#   <family of header/footer left string>
5945 \# *Function:
5946 \#   Creates or modifies string $HDRFTR_LEFT_FAM.
5948 .MAC HDRFTR_LEFT_FAMILY END
5949 .    ds $HDRFTR_LEFT_FAM \\$1
5950 .END
5953 \# HDRFTR LEFT FONT
5954 \# ----------------
5955 \# *Argument:
5956 \#   <font of header/footer left string>
5957 \# *Function:
5958 \#   Creates or modifies string $HDRFTR_LEFT_FT.
5960 .MAC HDRFTR_LEFT_FONT END
5961 .    ds $HDRFTR_LEFT_FT \\$1
5962 .END
5965 \# HDRFTR LEFT SIZE
5966 \# ----------------
5967 \# *Argument:
5968 \#   <+|- number of points to in/decrease size of left string in
5969 \#   header/footers (relative to running text)>
5970 \# *Function:
5971 \#   Creates or modifies string HDRFTR_LEFT_SIZE_CHANGE.
5972 \# *Notes:
5973 \#   Must be preceded by a +|- sign.  No space afterwards.
5974 \#   Fractional point sizes are allowed.
5975 \#   Default is -.5 for printstyle TYPESET; if all caps, -2
5976 \#   Has no effect in TYPEWRITE.
5978 .MAC HDRFTR_LEFT_SIZE END
5979 .    ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5980 .END
5983 \# HDRFTR LEFT COLOR
5984 \# -----------------
5985 \# *Argument:
5986 \#   <pre-defined color name>
5987 \# *Function:
5988 \#   Sets register #HDRFTR_LEFT_COLOR to 1; creates string
5989 \#   $HDRFTR_LEFT_COLOR
5990 \# *Notes:
5991 \#   The color name must be pre-defined with NEWCOLOR or XCOLOR.
5993 .MAC HDRFTR_LEFT_COLOR END
5994 .    nr #HDRFTR_LEFT_COLOR 1
5995 .    ds $HDRFTR_LEFT_COLOR \\$1
5996 .END
5999 \# HDRFTR LEFT CAPS
6000 \# ----------------
6001 \# *Argument:
6002 \#   <none> | <anything>
6003 \# *Function:
6004 \#   Turns capitalisation of $HDRFTR_LEFT (typically, the author of
6005 \#   the document) on or off.
6006 \# *Notes:
6007 \#   Default is on.
6009 .MAC HDRFTR_LEFT_CAPS END
6010 .    ie '\\$1'' \{\
6011 .        nr #HDRFTR_LEFT_CAPS 1
6012 .    \}
6013 .    el \{\
6014 .       nr #HDRFTR_LEFT_CAPS 0
6015 .       ds $HDRFTR_LEFT_SIZE_CHANGE +0
6016 .    \}
6017 .END
6020 \# HDRFTR CENTER
6021 \# -------------
6022 \# *Argument:
6023 \#   <what to put in the centre position of page header/footers>
6024 \# *Function:
6025 \#   Creates or modifies string $HDRFTR_CENTER.
6026 \#   Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
6027 \#   overrides the $HDRFTR_CENTER string created by default
6028 \#   in COPYSTYLE.
6029 \# *Notes:
6030 \#   Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
6031 \#   CHAPTER, draft and revision number if COPYSTYLE DRAFT.
6033 \#   If the argument is the # character, simply prints the current
6034 \#   page number.
6036 \#   If the user wants to *incorporate* the page number into the string,
6037 \#   \*[PAGE#] must be used.  For example, if the user wants to put
6038 \#   an elipsis before the page number in the string, s/he should use
6039 \#   ...\*[PAGE#], not ...#
6041 .MAC HDRFTR_CENTER END
6042 .    nr #USER_DEF_HDRFTR_CENTER 1
6043 .    if '\\$0'FOOTER_CENTER' \{\
6044 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
6045 .       ds $HDRFTR_CENTER_NEW \\$1
6046 .    \}
6047 .    if '\\$0'FOOTER_CENTRE' \{\
6048 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
6049 .       ds $HDRFTR_CENTER_NEW \\$1
6050 .    \}
6051 .    ds $HDRFTR_CENTER \\$1
6052 .END
6055 \# HDRFTR CENTER FAMILY
6056 \# --------------------
6057 \# *Argument:
6058 \#   <family of header/footer center string>
6059 \# *Function:
6060 \#   Creates or modifies string $HDRFTR_CENTER_FAM.
6062 .MAC HDRFTR_CENTER_FAMILY END
6063 .    ds $HDRFTR_CENTER_FAM \\$1
6064 .END
6067 \# HDRFTR CENTER FONT
6068 \# ------------------
6069 \# *Argument:
6070 \#   <font of header/footer center string>
6071 \# *Function:
6072 \#   Creates or modifies string $HDRFTR_CENTER_FT.
6074 .MAC HDRFTR_CENTER_FONT END
6075 .    ds $HDRFTR_CENTER_FT \\$1
6076 .END
6079 \# HDRFTR CENTER SIZE
6080 \# ------------------
6081 \# *Argument:
6082 \#   <+|- number of points to in/decrease size of centre string in
6083 \#   header/footers (relative to header/footer size)>
6084 \# *Function:
6085 \#   Creates string HDRFTR_CENTER_SIZE_CHANGE.
6086 \# *Notes:
6087 \#   Must be preceded by a +|- sign.  No space afterwards.
6088 \#   Fractional point sizes are allowed.
6089 \#   Default is -.5 for printstyle TYPESET; if all caps, -2
6090 \#   Has no effect in TYPEWRITE.
6092 .MAC HDRFTR_CENTER_SIZE END
6093 .    ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
6094 .END
6097 \# HDRFTR CENTER COLOR
6098 \# -------------------
6099 \# *Argument:
6100 \#   <pre-defined color name>
6101 \# *Function:
6102 \#   Sets register #HDRFTR_CENTER_COLOR to 1; creates string
6103 \#   $HDRFTR_CENTER_COLOR
6104 \# *Notes:
6105 \#   The color name must be pre-defined with NEWCOLOR or XCOLOR.
6107 .MAC HDRFTR_CENTER_COLOR END
6108 .    nr #HDRFTR_CENTER_COLOR 1
6109 .    ds $HDRFTR_CENTER_COLOR \\$1
6110 .END
6113 \# HDRFTR CENTER CAPS
6114 \# ------------------
6115 \# *Argument:
6116 \#   <none> | <anything>
6117 \# *Function:
6118 \#   Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
6119 \#   the document) on or off.
6120 \# *Notes:
6121 \#   Default is on.
6123 .MAC HDRFTR_CENTER_CAPS END
6124 .    ie '\\$1'' \{\
6125 .       nr #HDRFTR_CENTER_CAPS 1
6126 .    \}
6127 .    el \{\
6128 .       nr #HDRFTR_CENTER_CAPS 0
6129 .       ds $HDRFTR_CENTER_SIZE_CHANGE +0
6130 .    \}
6131 .END
6134 \# HDRFTR CENTER PADDING
6135 \# ---------------------
6136 \# *Argument:
6137 \#   LEFT | RIGHT <amount of padding to put left or right of hdrftr
6138 \#   center string>
6139 \# *Function:
6140 \#   Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
6141 \#   #HDRFTR_CTR_PAD_RIGHT.
6142 \# *Notes:
6143 \#   By default, the HDRFTR_CENTER string is centered on the doc
6144 \#   line length.  Long titles or long author names can screw up
6145 \#   visual centering, or create overprints.  This macro allows the
6146 \#   user to pad the center string by the specified amount of space
6147 \#   to fix these problems.  Use only one of LEFT or RIGHT.
6149 \#   A unit of measure is required.
6151 .MAC HDRFTR_CENTER_PAD END
6152 .    if '\\$1'LEFT' \{\
6153 .       nr #HDRFTR_CTR_PAD_LEFT (\\$2)
6154 .    \}
6155 .    if '\\$1'RIGHT' \{\
6156 .       nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
6157 .    \}
6158 .END
6161 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
6162 \# --------------------------------
6163 \# *Argument:
6164 \#   <none>
6165 \# *Function:
6166 \#   Switches the padding side of hdrftr center padding.
6167 \# *Notes:
6168 \#   Required to keep spacing around hdrftr string constant
6169 \#   in recto/verso documents.
6171 .MAC SWITCH_HDRFTR_CENTER_PAD END
6172 .    nr #HDRFTR_CTR_PAD_TMP  \\n[#HDRFTR_CTR_PAD_LEFT]
6173 .    HDRFTR_CENTER_PAD LEFT  \\n[#HDRFTR_CTR_PAD_RIGHT]u
6174 .    HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
6175 .END
6178 \# HDRFTR RIGHT
6179 \# ------------
6180 \# *Argument:
6181 \#   <what to put in the right position of page header/footers>
6182 \# *Function:
6183 \#   Creates or modifies string $HDRFTR_RIGHT.
6184 \#   Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
6185 \#   overrides the $HDRFTR_RIGHT string created by default
6186 \#   in DEFAULTS.
6187 \# *Notes:
6188 \#   Default is document title.
6190 \#   If the argument is the # character, simply prints the current
6191 \#   page number.
6193 \#   If the user wants to *incorporate* the page number into the string,
6194 \#   \*[PAGE#] must be used.  For example, if the user wants to put
6195 \#   an elipsis before the page number in the string, s/he should use
6196 \#   ...\*[PAGE#], not ...#
6198 .MAC HDRFTR_RIGHT END
6199 .    nr #USER_DEF_HDRFTR_RIGHT 1
6200 .    ds $HDRFTR_RIGHT \\$1
6201 .END
6204 \# HDRFTR RIGHT FAMILY
6205 \# -------------------
6206 \# *Argument:
6207 \#   <family of header/footer right string>
6208 \# *Function:
6209 \#   Creates or modifies string $HDRFTR_RIGHT_FAM.
6211 .MAC HDRFTR_RIGHT_FAMILY END
6212 .    ds $HDRFTR_RIGHT_FAM \\$1
6213 .END
6216 \# HDRFTR RIGHT FONT
6217 \# -----------------
6218 \# *Argument:
6219 \#   <font of header/footer right string>
6220 \# *Function:
6221 \#   Creates or modifies string $HDRFTR_RIGHT_FT.
6223 .MAC HDRFTR_RIGHT_FONT END
6224 .    ds $HDRFTR_RIGHT_FT \\$1
6225 .END
6228 \# HDRFTR RIGHT SIZE
6229 \# -----------------
6230 \# *Argument:
6231 \#   <+|- number of points to in/decrease size of right string in
6232 \#   header/footers (relative to header/footer size)>
6233 \# *Function:
6234 \#   Creates or modifies string HDRFTR_RIGHT_SIZE_CHANGE.
6235 \# *Notes:
6236 \#   Must be preceded by a +|- sign.  No space afterwards.
6237 \#   Fractional point sizes are allowed.
6238 \#   Default is -2 for printstyle TYPESET if all caps; otherwise -.5
6239 \#   Has no effect in TYPEWRITE.
6241 .MAC HDRFTR_RIGHT_SIZE END
6242 .    ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
6243 .END
6246 \# HDRFTR RIGHT COLOR
6247 \# ------------------
6248 \# *Argument:
6249 \#   <pre-defined color name>
6250 \# *Function:
6251 \#   Sets register #HDRFTR_RIGHT_COLOR to 1; creates string
6252 \#   $HDRFTR_RIGHT_COLOR
6253 \# *Notes:
6254 \#   The color name must be pre-defined with NEWCOLOR or XCOLOR.
6256 .MAC HDRFTR_RIGHT_COLOR END
6257 .    nr #HDRFTR_RIGHT_COLOR 1
6258 .    ds $HDRFTR_RIGHT_COLOR \\$1
6259 .END
6262 \# HDRFTR RIGHT CAPS
6263 \# -----------------
6264 \# *Argument:
6265 \#   <none> | <anything>
6266 \# *Function:
6267 \#   Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
6268 \#   the document) on or off.
6269 \# *Notes:
6270 \#   Default is on.
6272 .MAC HDRFTR_RIGHT_CAPS END
6273 .    ie '\\$1'' \{\
6274 .       nr #HDRFTR_RIGHT_CAPS 1
6275 .    \}
6276 .    el \{\
6277 .       nr #HDRFTR_RIGHT_CAPS 0
6278 .       ds $HDRFTR_RIGHT_SIZE_CHANGE +0
6279 .    \}
6280 .END
6283 \# HDRFTR RULE COLOR
6284 \# -----------------
6285 \# *Arguments:
6286 \#   <pre-defined XCOLOR or NEWCOLOR>
6287 \# *Function:
6288 \#   Sets register #HDRFTR_COLOR to 1; defines string
6289 \#   $HDRFTR_RULE_COLOR to argument.
6290 \# *Notes:
6291 \#   User must define an XCOLOR or NEWCOLOR before using
6292 \#   HDRFTR_RULE_COLOR.
6294 .MAC HDRFTR_RULE_COLOR END
6295 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
6296 .    nr #HDRFTR_RULE_COLOR 1
6297 .    ds $HDRFTR_RULE_COLOR \\$1
6298 .END
6301 \# HDRFTR RULE
6302 \# -----------
6303 \# *Arguments:
6304 \#   <none> | <anything>
6305 \# *Function:
6306 \#   If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
6307 \#   under the header/footer.  Otherwise, turns HDRFTR_RULE on or off.
6309 .MAC HDRFTR_RULE END   \"To print rule under header/over footer.
6310 .    ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
6311 .       ie \\n[#USERDEF_HDRFTR] \{\
6312 .          nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
6313 .          ps 12
6314 .          if \\n[#HEADERS_ON] \{\
6315 .             rt \\nyu
6316 .             ALD \\n[#HDRFTR_RULE_GAP]u
6317 .          \}
6318 .          if \\n[#FOOTERS_ON] \{\
6319 .              rt \\nyu
6320 .              RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
6321 .          \}
6322 .          ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
6323 .             PRINT \m[\\*[$HDRFTR_RULE_COLOR]]\\l'\\n[#DOC_L_LENGTH]u'\m[]
6324 .          \}
6325 .          el \{\
6326 .             PRINT \\l'\\n[#DOC_L_LENGTH]u'
6327 .          \}
6328 .          br
6329 .       \}
6330 .       el \{\
6331 .          if \\n[#PRINT_STYLE]=1 \{\
6332 .             nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
6333 .          \}
6334 .          if \\n[#PRINT_STYLE]=2 \{\
6335 .             ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
6336 .                nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
6337 .             \}
6338 .             el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
6339 .             ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
6340 .                nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
6341 .             \}
6342 .             el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
6343 .          \}
6344 .          ps 12
6345 .          if \\n[#HEADERS_ON] \{\
6346 .             rt \\nyu
6347 .             ALD \\n[#HDRFTR_RULE_GAP]u
6348 .          \}
6349 .          if \\n[#FOOTERS_ON] \{\
6350 .             rt \\nyu
6351 .             RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
6352 .          \}
6353 .          ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
6354 .             PRINT \m[\\*[$HDRFTR_RULE_COLOR]]\\l'\\n[#DOC_L_LENGTH]u'\m[]
6355 .          \}
6356 .          el \{\
6357 .             PRINT \\l'\\n[#DOC_L_LENGTH]u'
6358 .          \}
6359 .          br
6360 .       \}
6361 .    \}
6362 .    el \{\
6363 .       ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
6364 .       el \{ .nr #HDRFTR_RULE 0 \}
6365 .    \}
6366 .END
6369 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
6372 \# HDRFTR PLAIN
6373 \# ------------
6374 \# *Arguments:
6375 \#   <none>
6376 \# *Function:
6377 \#   Sets the family, font, and point size of all strings in
6378 \#   header/footers to the same family and point size as running
6379 \#   text.  Font for the header/footer becomes roman throughout.
6381 .MAC HDRFTR_PLAIN END
6382 .    HDRFTR_FAMILY        \\*[$DOC_FAM]
6383 .    HDRFTR_PT_SIZE       \\n[#DOC_PT_SIZE]
6384 .    HDRFTR_LEFT_FAMILY   \\*[$DOC_FAM]
6385 .    HDRFTR_LEFT_FONT     R
6386 .    HDRFTR_LEFT_SIZE     +0
6387 .    HDRFTR_LEFT_CAPS     OFF
6388 .    HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
6389 .    HDRFTR_CENTER_FONT   R
6390 .    HDRFTR_CENTER_SIZE   +0
6391 .    HDRFTR_CENTER_CAPS   OFF
6392 .    HDRFTR_RIGHT_FAMILY  \\*[$DOC_FAM]
6393 .    HDRFTR_RIGHT_FONT    R
6394 .    HDRFTR_RIGHT_SIZE    +0
6395 .    HDRFTR_RIGHT_CAPS    OFF
6396 .END
6399 \# SWITCH HDRFTR
6400 \# -------------
6401 \# *Arguments:
6402 \#   <none> | <anything>
6403 \# *Function:
6404 \#   Creates or modifies register #SWITCH_HDRFTR, used to switch
6405 \#   default location of HDRFTR_LEFT and HDRFTR_RIGHT.
6406 \# *Notes:
6407 \#   Typically, the author string appears at the left of header/footers,
6408 \#   and the title string appears at the right.  This switches the
6409 \#   location of the two.  Useful in conjuction with RECTO_VERSO to
6410 \#   tweak switches on alternate pages to come out as the user wishes.
6411 \#   The assumption of RECTO_VERSO is that the first page of the document
6412 \#   (recto) is odd, and even though it has no header/footer, if it did have one,
6413 \#   it would print as AUTHOR...CENTER...TITLE (or whatever strings
6414 \#   the user has supplied for HDRFTR_LEFT/RIGHT), meaning that the
6415 \#   next page, which does have a header/footer, will come out as
6416 \#   TITLE...CENTER...AUTHOR (or whatever strings the user has
6417 \#   supplied for HDRFTR_LEFT/RIGHT).  SWITCH_HDRFTRS allows the user
6418 \#   to get the desired string in the desired place on the desired
6419 \#   recto/verso page.
6421 \#   Default is OFF.
6423 .MAC SWITCH_HDRFTR END
6424 .    ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
6425 .    el \{ .nr #SWITCH_HDRFTR 0 \}
6426 .END
6429 \# USER DEFINED HDRFTR RECTO
6430 \# -------------------------
6431 \# *Arguments:
6432 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
6433 \# *Function:
6434 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
6435 \#   stores string in $USERDEF_HDRFTR_RECTO.
6436 \# *Notes:
6437 \#   For use when users don't want 3-part headers/footers, but rather
6438 \#   want to design their own headers/footers and need different
6439 \#   headers/footers on recto and verso pages.  Using just
6440 \#   HEADER_RECTO, even when recto/verso is not on, allows users to
6441 \#   design their own headers/footers for doc pages.
6443 .MAC HDRFTR_RECTO END
6444 .    nr #USERDEF_HDRFTR 1
6445 .    if '\\$1'L'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
6446 .    if '\\$1'LEFT'   \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
6447 .    if '\\$1'C'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
6448 .    if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
6449 .    if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
6450 .    if '\\$1'R'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
6451 .    if '\\$1'RIGHT'  \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
6452 .    ds $USERDEF_HDRFTR_RECTO \\$2
6453 .END
6456 \# USER DEFINED HDRFTR VERSO
6457 \# -------------------------
6458 \# *Arguments:
6459 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
6460 \# *Function:
6461 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
6462 \#   stores string in $USERDEF_HDRFTR_VERSO.
6463 \# *Notes:
6464 \#   For use when users don't want 3-part headers/footers, but rather
6465 \#   want to design their own headers/footers and need different
6466 \#   headers/footers on recto and verso pages.
6468 .MAC HDRFTR_VERSO END
6469 .    nr #USERDEF_HDRFTR 1
6470 .    if '\\$1'L'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
6471 .    if '\\$1'LEFT'   \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
6472 .    if '\\$1'C'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
6473 .    if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
6474 .    if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
6475 .    if '\\$1'R'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
6476 .    if '\\$1'RIGHT'  \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
6477 .    ds $USERDEF_HDRFTR_VERSO \\$2
6478 .END
6481 \# PRINT FOOTER ON FIRST PAGE
6482 \# --------------------------
6483 \# *Arguments:
6484 \#   <none> | <anything>
6485 \# *Function:
6486 \#   Toggles register #PRINT_FOOTER_ON_PAGE_1
6487 \# *Notes:
6488 \#   Lets user choose whether to print footer on first
6489 \#   page of doc.
6491 .MAC FOOTER_ON_FIRST_PAGE END
6492 .    ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
6493 .    el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
6494 .END
6497 \# PRINT PAGE NUMBER ON FIRST PAGE
6498 \# -------------------------------
6499 \# *Arguments:
6500 \#   <none> | <anything>
6501 \# *Function:
6502 \#   Toggles register #PRINT_PAGENUM_ON_PAGE_1
6503 \# *Notes:
6504 \#   Lets user choose whether to print page number on first
6505 \#   page of doc and after collate when footers are on or page numbering
6506 \#   has been user set at top of page.
6508 .MAC PAGENUM_ON_FIRST_PAGE END
6509 .    ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
6510 .    el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
6511 .END
6514 \# PRINT HEADER/FOOTER
6515 \# -------------------
6516 \# *Arguments:
6517 \#   <none>
6518 \# *Function:
6519 \#   Based on defaults or values entered by user, prints a
6520 \#   three-part title at either the top or the bottom of the page.
6521 \# *Notes:
6522 \#   Called from within either HEADER or FOOTER.
6524 .MAC PRINT_HDRFTR END
6525 .    if \\n[#DOC_TYPE]=4 \{\
6526 .       nr #SUITE \En[.pn]
6527 .    \}
6528 .    if \\n[#FOOTERS_ON] \{\
6529 .       if \\n[#START_FOR_FOOTERS] \{\
6530 .          rr #START_FOR_FOOTERS
6531 .          if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{ .return \}
6532 .       \}
6533 .    \}
6534 .    if \\n[#USERDEF_HDRFTR] \{\
6535 .       PRINT_USERDEF_HDRFTR
6536 .       return
6537 .    \}
6538 .    if \\n[#SWITCH_HDRFTR] \{\
6539 .       ds $HDRFTR_TMP_SWITCH             \\*[$HDRFTR_LEFT]
6540 .       ds $HDRFTR_LEFT                   \\*[$HDRFTR_RIGHT]
6541 .       ds $HDRFTR_RIGHT                  \\*[$HDRFTR_TMP_SWITCH]
6542 .       ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
6543 .       ds $HDRFTR_LEFT_SIZE_CHANGE       \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
6544 .       ds $HDRFTR_RIGHT_SIZE_CHANGE      \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
6545 .       nr #HDRFTR_TMP_CAPS_SWITCH        \\n[#HDRFTR_LEFT_CAPS]
6546 .       nr #HDRFTR_LEFT_CAPS              \\n[#HDRFTR_RIGHT_CAPS]
6547 .       nr #HDRFTR_RIGHT_CAPS             \\n[#HDRFTR_TMP_CAPS_SWITCH]
6548 .       ds $HDRFTR_TMP_COLOR_SWITCH       \\*[$HDRFTR_LEFT_COLOR]
6549 .       ds $HDRFTR_LEFT_COLOR             \\*[$HDRFTR_RIGHT_COLOR]
6550 .       ds $HDRFTR_RIGHT_COLOR            \\*[$HDRFTR_TMP_COLOR_SWITCH]
6551 .       rr #HDRFTR_TMP_CAPS_SWITCH
6552 .       rm $HDRFTR_TMP_SWITCH
6553 .       rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
6554 .       rm $HDRFTR_TMP_COLOR_SWITCH
6555 .       nr #SWITCH_HDRFTR 0
6556 .    \}
6557 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
6558 .    if \\n[#ENDNOTES] \{ .PAGENUM_STYLE \\*[$EN_PN_STYLE] \}
6559 .    if \\n[#PRINT_STYLE]=1 \{\
6560 .       if \\n[#FOOTERS_ON] \{\
6561 .          di NULL
6562 .          SIZESPECS
6563 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6564 .          di
6565 .       \}
6566 .       if o                        \{ .RIGHT \}
6567 .       if e                        \{ .LEFT  \}
6568 .       if \\n[#RECTO_VERSO]=0      \{ .LEFT  \}
6569 .       if \\n[#HDRFTR_LEFT_CAPS]   \{ .CAPS  \}
6570 .       ie '\\*[$HDRFTR_LEFT]'#' \{\
6571 .           PRINT \\n[#PAGENUMBER]
6572 .       \}
6573 .       el \{\
6574 .          ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
6575 .          el \{ .PRINT \& \}
6576 .       \}
6577 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
6578 .       CENTER
6579 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
6580 .       rt \\nyu
6581 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
6582 .           PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
6583 .       \}
6584 .       el \{\
6585 .          ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
6586 .          el \{ .PRINT \& \}
6587 .       \}
6588 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
6589 .       if o                       \{ .LEFT  \}
6590 .       if e                       \{ .RIGHT \}
6591 .       if \\n[#RECTO_VERSO]=0     \{ .RIGHT \}
6592 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS  \}
6593 .       rt \\nyu
6594 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
6595 .           PRINT \\n[#PAGENUMBER]
6596 .       \}
6597 .       el \{\
6598 .          ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \\*[$HDRFTR_RIGHT] \}
6599 .          el \{ .PRINT \& \}
6600 .       \}
6601 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
6602 .    \}
6603 .    if \\n[#PRINT_STYLE]=2 \{\
6604 .       if \\n[#HDRFTR_COLOR]=1 \{\
6605 .          nf
6606 \m[\\*[$HDRFTR_COLOR]]
6607 .          EL
6608 .       \}
6609 .       fam     \\*[$HDRFTR_LEFT_FAM]
6610 .       ft      \\*[$HDRFTR_LEFT_FT]
6611 .       ps      \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
6612 .       vs      12
6613 .       if \\n[#FOOTERS_ON] \{\
6614 .          di NULL
6615 .          SIZESPECS
6616 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6617 .          di
6618 .       \}
6619 .       if o                      \{ .LEFT  \}
6620 .       if e                      \{ .RIGHT \}
6621 .       if \\n[#RECTO_VERSO]=0    \{ .LEFT  \}
6622 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS  \}
6623 .       ie '\\*[$HDRFTR_LEFT]'#' \{\
6624 .          ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
6625 .             PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[]
6626 .          \}
6627 .          el \{\
6628 .             PRINT \\n[#PAGENUMBER]
6629 .          \}
6630 .       \}
6631 .       el \{\
6632 .          ie !'\\*[$HDRFTR_LEFT]'' \{\
6633 .             ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
6634 .                 PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[]
6635 .             \}
6636 .             el \{\
6637 .                 PRINT \\*[$HDRFTR_LEFT]
6638 .             \}
6639 .          \}
6640 .          el \{ .PRINT \& \}
6641 .       \}
6642 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
6643 .       fam     \\*[$HDRFTR_CENTER_FAM]
6644 .       ft      \\*[$HDRFTR_CENTER_FT]
6645 .       ps      \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
6646 .       vs      12
6647 .       if \\n[#FOOTERS_ON] \{\
6648 .          di NULL
6649 .          SIZESPECS
6650 .          nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
6651 .          di
6652 .       \}
6653 .       CENTER
6654 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
6655 .       rt \\nyu
6656 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
6657 .           ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
6658 .              PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
6659 .           \}
6660 .           el \{\
6661 .              PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
6662 .           \}
6663 .       \}
6664 .       el \{\
6665 .          ie !'\\*[$HDRFTR_CENTER]'' \{\
6666 .             ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
6667 .                PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
6668 .             \}
6669 .             el \{\
6670 .                PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
6671 .             \}
6672 .          \}
6673 .          el \{ .PRINT \& \}
6674 .       \}
6675 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
6676 .       fam     \\*[$HDRFTR_RIGHT_FAM]
6677 .       ft      \\*[$HDRFTR_RIGHT_FT]
6678 .       ps      \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
6679 .       vs      12
6680 .       if \\n[#FOOTERS_ON] \{\
6681 .          di NULL
6682 .          SIZESPECS
6683 .          nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6684 .          di
6685 .       \}
6686 .       if o                       \{ .RIGHT \}
6687 .       if e                       \{ .LEFT  \}
6688 .       if \\n[#RECTO_VERSO]=0     \{ .RIGHT \}
6689 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS  \}
6690 .       rt \\nyu
6691 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
6692 .          ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
6693 .             PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[]
6694 .          \}
6695 .          el \{\
6696 .             PRINT \\n[#PAGENUMBER]
6697 .          \}
6698 .       \}
6699 .       el \{\
6700 .          ie !'\\*[$HDRFTR_RIGHT]'' \{\
6701 .             ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
6702 .                PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[]
6703 .             \}
6704 .             el \{\
6705 .                PRINT \\*[$HDRFTR_RIGHT]
6706 .             \}
6707 .          \}
6708 .          el \{ .PRINT \& \}
6709 .       \}
6710 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
6711 .    \}
6712 .    if \\n[#HDRFTR_RULE] \{\
6713 .       HDRFTR_RULE_INTERNAL
6714 .    \}
6715 .END
6718 \# PRINT USER DEFINED HEADER/FOOTER
6719 \# --------------------------------
6720 \# *Arguments:
6721 \#   <none>
6722 \# *Function:
6723 \#   Based on defaults or values entered by user, prints a single part
6724 \#   (i.e. not 3-part) title at either the top or the bottom of the page.
6725 \# *Notes:
6726 \#   Called from within PRINT_HDRFTR.
6728 .MAC PRINT_USERDEF_HDRFTR END
6729 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
6730 .    fc ^ #
6731 .    if \\n[#PRINT_STYLE]=2 \{\
6732 .       FAMILY  \\*[$HDRFTR_FAM]
6733 .       FT      R
6734 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u
6735 .       if \\n[#HDRFTR_COLOR]=1 \{\
6736 .          nf
6737 .          COLOR \\*[$HDRFTR_COLOR]
6738 .       \}
6739 .    \}
6740 .    ie \\n[#RECTO_VERSO] \{\
6741 .       if o \{\
6742 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
6743 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6744 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
6745 .          PRINT \\*[$USERDEF_HDRFTR_RECTO]
6746 .          EL
6747 .          if \\n[#FOOTERS_ON] \{\
6748 .             di NULL
6749 .             SIZESPECS
6750 .             nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6751 .             di
6752 .          \}
6753 .       \}
6754 .       if e \{\
6755 .          ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
6756 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT   \}
6757 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
6758 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT  \}
6759 .             PRINT \\*[$USERDEF_HDRFTR_VERSO]
6760 .             EL
6761 .             if \\n[#FOOTERS_ON] \{\
6762 .                di NULL
6763 .                SIZESPECS
6764 .                nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6765 .                di
6766 .             \}
6767 .          \}
6768 .          el \{\
6769 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
6770 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6771 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
6772 .             PRINT \\*[$USERDEF_HDRFTR_RECTO]
6773 .             EL
6774 .             if \\n[#FOOTERS_ON] \{\
6775 .                di NULL
6776 .                SIZESPECS
6777 .                nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6778 .                di
6779 .             \}
6780 .          \}
6781 .       \}
6782 .    \}
6783 .    el \{\
6784 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
6785 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6786 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
6787 .       PRINT \\*[$USERDEF_HDRFTR_RECTO]
6788 .       EL
6789 .       if \\n[#FOOTERS_ON] \{\
6790 .          di NULL
6791 .          SIZESPECS
6792 .          nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6793 .          di
6794 .       \}
6795 .    \}
6796 .    fc
6797 .    if \\n[#PRINT_STYLE]=2 \{\
6798 .       ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]]
6799 .       el \m[black]
6800 .    \}
6801 .    if \\n[#HDRFTR_RULE] \{\
6802 .       HDRFTR_RULE_INTERNAL
6803 .    \}
6804 .END
6807 \# +++HEADERS+++
6809 \# HEADERS (off or on)
6810 \# -------------------
6811 \# *Arguments:
6812 \#   <none> | <anything>
6813 \# *Function:
6814 \#   Turns headers at the top of the page off or on.
6815 \# *Notes:
6816 \#   Default is on.
6818 .MAC HEADERS END
6819 .    ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
6820 .    el \{ .nr #HEADERS_ON 0 \}
6821 .END
6824 \# HEADER MARGIN
6825 \# -------------
6826 \# *Argument:
6827 \#   <amount of space between top of page and header>
6828 \# *Function:
6829 \#   Creates or modifies register #HEADER_MARGIN to hold amount
6830 \#   of space between top of page and header.
6831 \# *Notes:
6832 \#   Requires unit of measure.  Default is 4P+6p, measured top-of-page
6833 \#   to baseline.
6835 .MAC HEADER_MARGIN END
6836 .    nr #HEADER_MARGIN (\\$1)
6837 .END
6840 \# HEADER GAP
6841 \# ----------
6842 \# *Argument:
6843 \#   <amount of space between header and running text>
6844 \# *Function:
6845 \#   Creates or modifies register #HEADER_GAP to hold amount
6846 \#   of space between header and running text.
6847 \# *Notes:
6848 \#   Default is 1P+6p.
6850 .MAC HEADER_GAP END
6851 .    nr #HEADER_GAP (\\$1)
6852 .END
6855 \# HEADER
6856 \# ------
6857 \# *Arguments:
6858 \#   <none>
6859 \# *Function:
6860 \#   Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
6861 \# *Notes:
6862 \#   In order to convert the title string to caps in the header (in the
6863 \#   event that the user enters .TITLE in caps/lc), I've used
6864 \#   quad left, quad centre, and quad right to arrange the three bits
6865 \#   of the header, rather than .tl.  This allows the use of the CAPS macro.
6866 \#   The downside is that I have to add \\v'-(\\n[#LEAD]u*#) in order
6867 \#   for -Tlatin1 output to align the header/footer strings on the baseline.
6868 \#   The console output still isn't brilliant, but at least it's
6869 \#   comprehensible.
6871 .MAC HEADER END
6872 .    PROCESS_FN_LEFTOVER
6873 .    nr #FN_COUNT_FOR_COLS 0 1
6874 .    if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
6875 .    po \\n[#DOC_L_MARGIN]u
6876 .    if \\n[#RECTO_VERSO] \{\
6877 .       if !\\n[#TOC_RV_SWITCH] \{\
6878 .          nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
6879 .          DOC_LEFT_MARGIN  \\n[#DOC_R_MARGIN]u
6880 .          DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
6881 .          SWITCH_HDRFTR_CENTER_PAD
6882 .       \}
6883 .       rr #TOC_RV_SWITCH
6884 .    \}
6885 .    ev HEADER
6886 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
6887 .    sp |\\n[#HEADER_MARGIN]u-1v
6888 .    mk y
6889 .    ll \\n[#DOC_L_LENGTH]u
6890 .    ta \\n(.lu
6891 .    if \\n[#PRINT_STYLE]=1 \{\
6892 .       fam C
6893 .       ft  R
6894 .       ps  12\\*[$HDRFTR_SIZE_CHANGE]
6895 .    \}
6896 .    if \\n[#PRINT_STYLE]=2 \{\
6897 .      fam \\*[$HDRFTR_FAM]
6898 .      ft  R
6899 .      ps  \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
6900 .      vs  12
6901 .    \}
6902 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
6903 .    if \\n[#CAPS_ON] \{\
6904 .       nr #CAPS_WAS_ON 1
6905 .       CAPS OFF
6906 .    \}
6907 .    if \\n[#UNDERLINE_ON] \{\
6908 .       nr #UNDERLINE_WAS_ON 1
6909 .       UNDERLINE OFF
6910 .    \}
6911 .    if \\n[#PRINT_STYLE]=1 \{\
6912 .       if \\n[#ENDNOTES]=1 \{\
6913 .          if \\n[#EN_SINGLESPACE] \{\   \"Endnotes s-spaced have different lead
6914 .             nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
6915 .             nr #DOC_LEAD \\n[#EN_LEAD]u
6916 .          \}
6917 .       \}
6918 .    \}
6919 .    ie \\n[#HEADERS_ON] \{\
6920 .       PRINT_HDRFTR
6921 .       sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
6922 .    \}
6923 .    el \{\
6924 .       ie \\n[#PAGE_NUM_V_POS]=1 \{\
6925 .          ie \\n[#PAGINATE] \{\
6926 .             PRINT_PAGE_NUMBER
6927 .             sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
6928 .          \}
6929 .          el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
6930 .       \}
6931 .       el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
6932 .    \}
6933 .    if \\n[#PRINT_STYLE]=1 \{\
6934 .       if \\n[#ENDNOTES]=1 \{\
6935 .          if \\n[#EN_SINGLESPACE] \{\
6936 .             nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
6937 .             rr #RESTORE_DOC_LEAD
6938 .          \}
6939 .       \}
6940 .    \}
6941 .    nr #PAGE_TOP \\n(nl
6942 .    ev
6943 .    po \\n[#L_MARGIN]u
6944 .    if \\n[#RECTO_VERSO] \{\
6945 .       nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
6946 .    \}
6947 .    if \\n[#CAPS_WAS_ON] \{\
6948 .       CAPS
6949 .       rr #CAPS_WAS_ON
6950 .    \}
6951 .    if \\n[#UNDERLINE_WAS_ON] \{\
6952 .       UNDERLINE
6953 .       rr #UNDERLINE_WAS_ON
6954 .    \}
6955 .    if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6956 .    if \\n[#QUOTE] \{\
6957 .       ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6958 .       el \{\
6959 .          nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
6960 .          po \\n[#Q_OFFSET]u
6961 .       \}
6962 .    \}
6963 .    if \\n[#EPIGRAPH] \{\
6964 .       ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6965 .       el \{\
6966 .          nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6967 .          po \\n[#EPI_OFFSET]u
6968 .       \}
6969 .    \}
6970 .    ie \\n[#EPIGRAPH] \{\
6971 .       ie !\\n[#EPI_ACTIVE] \{\
6972 .          ns
6973 .          rr #EPI_ACTIVE
6974 .       \}
6975 .       el \{\
6976 .          ie \\n[#EPI_FITS] \{ .ns \}
6977 .          el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
6978 .       \}
6979 .    \}
6980 .    el \{ .ns \}
6981 .    ns
6982 .    if \\n[#COLUMNS] \{\
6983 .       nr #L_MARGIN \\n[#DOC_L_MARGIN]
6984 .       if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
6985 .       nr #COL_NUM 0 1
6986 .       mk dc
6987 .       po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6988 .       nr #L_MARGIN \\n(.o
6989 .       if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6990 .       ll \\n[#COL_L_LENGTH]u
6991 .       ta \\n(.lu
6992 .       if \\n[#QUOTE] \{\
6993 .          po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
6994 .       \}
6995 .       if \\n[#EPIGRAPH] \{\
6996 .          if \\n[#EPI_ACTIVE] \{\
6997 .             ie \\n[#EPI_FITS] \{ . \}
6998 .             el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
6999 .          \}
7000 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
7001 .       \}
7002 .    \}
7003 .    if \\n[#PRINT_STYLE]=1 \{\
7004 .       if \\n[#SLANT_ON] \{\
7005 .          if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
7006 .       \}
7007 .    \}
7008 .END
7010 \# ====================================================================
7012 \# +++FOOTERS+++
7014 \# FOOTERS (off or on)
7015 \# -------------------
7016 \# *Arguments:
7017 \#   <none> | <anything>
7018 \# *Function:
7019 \#   Turns footers at the bottom of the page off or on.
7020 \# *Notes:
7021 \#   Default is off.  If on, page numbers automatically go at
7022 \#   the top, centered, unless pagination has been turned off,
7023 \#   or the pagenumber position has been changed to left or right.
7025 .MAC FOOTERS END
7026 .    ie '\\$1''   \{\
7027 .       nr #FOOTERS_ON 1
7028 .       PAGE_NUM_POS TOP CENTER
7029 .    \}
7030 .    el \{ .nr #FOOTERS_ON 0 \}
7031 .END
7034 \# FOOTER MARGIN
7035 \# -------------
7036 \# *Argument:
7037 \#   <footer margin>
7038 \# *Function:
7039 \#   Creates or modifies register #FOOTER_MARGIN which holds the
7040 \#   amount of space to leave between the page number and the bottom
7041 \#   of the page.
7042 \# *Notes:
7043 \#   Unit of measure required.  Default is 3P.
7045 .MAC FOOTER_MARGIN END
7046 .    ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
7047 .    el \{ . \}
7048 .END
7051 \# FOOTER GAP
7052 \# ----------
7053 \# *Argument:
7054 \#   <distance from end of running text to page # or footer>
7055 \# *Function:
7056 \#   Creates or modifies register #FOOTER_GAP which holds the
7057 \#   amount of space to leave between running text and the page number.
7058 \# *Notes:
7059 \#   Requires unit of measure.  Default is 3P.  Measured baseline to
7060 \#   baseline.
7062 .MAC FOOTER_GAP END
7063 .    ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
7064 .    el \{ . \}
7065 .END
7068 \# FOOTER
7069 \# ------
7070 \# *Arguments:
7071 \#   <none>
7072 \# *Function:
7073 \#   Places footer at bottom of page if #FOOTERS=1, otherwise
7074 \#   places page number at bottom of page (if #PAGINATE=1).
7075 \#   Page numbers are in arabic or roman according to COPYSTYLE.
7076 \#   DRAFT starts the document at page 1 regardless of PAGENUMBER.
7077 \#   FINAL respects PAGENUMBER.
7079 .MAC FOOTER END
7080 .    ev PAGE_BOTTOM
7081 \# Removed this next bit; can't figure out why I needed it.
7082 \#.    if \\n[#START]=1 \{\
7083 \#.       bp
7084 \#.       ev
7085 \#.       rr #START
7086 \#.       return
7087 \#.    \}
7088 .    nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
7089 .    if !\\n[#FN_DEFER] \{\
7090 .       nr #DIVER_DEPTH 0
7091 .       if \\n[#FN_COUNT] \{\
7092 .          sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u)
7093 .          po \\n[#DOC_L_MARGIN]u
7094 .          if \\n[#COLUMNS] \{\
7095 .             po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
7096 .             nr #L_MARGIN \\n(.o
7097 .          \}
7098 .          nf
7099 .          FOOTNOTES
7100 .          rm FOOTNOTES
7101 .          if '\\n(.z'FN_OVERFLOW' \{\
7102 .              di
7103 .              nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
7104 .          \}
7105 .          nr #FN_COUNT 0
7106 .          if \\n[#COL_NEXT] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
7107 .       \}
7108 .    \}
7109 .    ie \\n[#COLUMNS] \{\
7110 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
7111 .       el \{\
7112 .          ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
7113 .          el \{ .sp |\\n(dcu \}
7114 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7115 .          nr #L_MARGIN \\n(.o
7116 .          PROCESS_FN_LEFTOVER
7117 .          if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
7118 .          if !\\n[#QUOTE]    \{ .rr #COL_NEXT \}
7119 .          if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7120 .          if \\n[#QUOTE] \{\
7121 .             ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7122 .             el \{\
7123 .                nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
7124 .                if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
7125 .                po \\n[#Q_OFFSET]u
7126 .             \}
7127 .          \}
7128 .          if \\n[#EPIGRAPH] \{\
7129 .             ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7130 .             el \{\
7131 .                nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
7132 .                if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
7133 .                po \\n[#EPI_OFFSET]u
7134 .             \}
7135 .          \}
7136 .          ie \\n[#EPIGRAPH] \{\
7137 .             ie !\\n[#EPI_ACTIVE] \{\
7138 .                ns
7139 .                rr #EPI_ACTIVE
7140 .             \}
7141 .             el \{\
7142 .                sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
7143 .                rr #EPI_ACTIVE
7144 .             \}
7145 .          \}
7146 .          el \{ .ns \}
7147 .          ev
7148 .       \}
7149 .       ns
7150 .    \}
7151 .    el \{ .DO_FOOTER \}
7152 .END
7155 \# PROCESS FOOTER
7156 \# --------------
7157 \# *Arguments:
7158 \#   <none>
7159 \# *Function:
7160 \#   Prints footer (page number, or 3-part footer).
7161 \#   Resets CAPS and UNDERLINE if they were on.
7163 .MAC DO_FOOTER END
7164 .    ie (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
7165 .       nr #SKIP_FOOTER 1
7166 .    \}
7167 .    el \{\
7168 .       vs 12
7169 .       sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
7170 .       mk y
7171 .    \}
7172 .    ev FOOTER
7173 .    po \\n[#DOC_L_MARGIN]u
7174 .    ll \\n[#DOC_L_LENGTH]u
7175 .    ta \\n(.lu
7176 .    FAMILY  \\*[$HDRFTR_FAM]
7177 .    FT      R
7178 .    PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
7179 .    if \\n[#PRINT_STYLE]=1 \{\
7180 .       fam C
7181 .       ft  R
7182 .       ps  12
7183 .    \}
7184 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
7185 .    if \\n[#CAPS_ON] \{\
7186 .       nr #CAPS_WAS_ON 1
7187 .       CAPS OFF
7188 .    \}
7189 .    if \\n[#UNDERLINE_ON] \{\
7190 .       nr #UNDERLINE_WAS_ON 1
7191 .       UNDERLINE OFF
7192 .    \}
7193 .    ie \\n[#FOOTERS_ON] \{\
7194 .       if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_HDRFTR \}
7195 .    \}
7196 .    el \{\
7197 .       if \\n[#PAGINATE] \{\
7198 .          if \\n[#PAGE_NUM_V_POS]=2 \{\
7199 .             if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_PAGE_NUMBER \}
7200 .          \}
7201 .       \}
7202 .    \}
7203 .    rr #SKIP_FOOTER
7204 .    if \\n[#CAPS_WAS_ON] \{\
7205 .       CAPS
7206 .       rr #CAPS_WAS_ON
7207 .    \}
7208 .    if \\n[#UNDERLINE_WAS_ON] \{\
7209 .       UNDERLINE
7210 .       rr #UNDERLINE_WAS_ON
7211 .    \}
7212 .    ev
7213 .    bp
7214 .    ev
7215 .END
7217 \# ====================================================================
7219 \# +++HEADS+++
7221 \# ---Head numbers---
7223 \# NUMBER HEADS
7224 \# ------------
7225 \# *Arguments:
7226 \#   <none> | <anything>
7227 \# *Function:
7228 \#   Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
7229 \# *Notes:
7230 \#   Default is OFF.
7232 .MAC NUMBER_HEADS END
7233 .    ie '\\$1'' \{\
7234 .       nr #NUMBER_HEAD 1
7235 .       if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
7236 .    \}
7237 .    el \{ .rr #NUMBER_HEAD \}
7238 .END
7241 \# RESET HEAD NUMBER
7242 \# -----------------
7243 \# *Arguments:
7244 \#   <none> | <desired head number>
7245 \# *Function:
7246 \#   Resets incrementing register #HEAD_NUM to 1 or, if there's
7247 \#   an argument, to user supplied number.
7248 \# *Notes:
7249 \#   Also resets subhead and parahead numbers.  If this is not
7250 \#   desired, subhead and parahead numbers may be reset individually.
7252 .MAC RESET_HEAD_NUMBER END
7253 .    ie '\\$1'' \{\
7254 .       nr #HEAD_NUM 0 1
7255 .       nr #SH_NUM   0 1
7256 .       nr #PH_NUM   0 1
7257 .    \}
7258 .    el \{\
7259 .       nr #HEAD_NUM \\$1-1 1
7260 .       nr #SH_NUM   0 1
7261 .       nr #PH_NUM   0 1
7262 .    \}
7263 .END
7266 \# NUMBER SUBHEADS
7267 \# ---------------
7268 \# *Arguments:
7269 \#   <none> | <anything>
7270 \# *Function:
7271 \#   Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
7272 \# *Notes:
7273 \#   Default is OFF.
7275 .MAC NUMBER_SUBHEADS END
7276 .    ie '\\$1'' \{\
7277 .       nr #NUMBER_SH 1
7278 .       if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
7279 .    \}
7280 .    el \{ .rr #NUMBER_SH \}
7281 .END
7284 \# RESET SUBHEAD NUMBER
7285 \# --------------------
7286 \# *Arguments:
7287 \#   <none> | <desired subhead number>
7288 \# *Function:
7289 \#   Resets incrementing register #SH_NUM to 1 or, if there's
7290 \#   an argument, to user supplied number.
7291 \# *Notes:
7292 \#   When the subhead number is reset, it resets the parahead number as
7293 \#   well.  If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
7294 \#   allows the user to set the parahead number to whatever s/he desires.
7296 .MAC RESET_SUBHEAD_NUMBER END
7297 .    ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
7298 .    el \{\
7299 .       nr #SH_NUM \\$1-1 1
7300 .       nr #PH_NUM 0 1
7301 .       \}
7302 .END
7305 \# NUMBER PARAHEADS
7306 \# ----------------
7307 \# *Arguments:
7308 \#   <none> | <anything>
7309 \# *Function:
7310 \#   Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
7311 \# *Notes:
7312 \#   Default is OFF.
7314 .MAC NUMBER_PARAHEADS END
7315 .    ie '\\$1'' \{\
7316 .       nr #NUMBER_PH 1
7317 .       if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
7318 .    \}
7319 .    el \{ .rr #NUMBER_PH \}
7320 .END
7323 \# RESET PARAHEAD NUMBER
7324 \# ---------------------
7325 \# *Arguments:
7326 \#   <none> | <desired parahead number>
7327 \# *Function:
7328 \#   Resets incrementing register #PH_NUM to 1 or, if there's
7329 \#   an argument, to user supplied number.
7330 \# *Notes:
7331 \#   Resetting the parahead number resets the parahead number
7332 \#   only.
7334 .MAC RESET_PARAHEAD_NUMBER END
7335 .    ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
7336 .    el \{ nr #SH_NUM \\$1-1 1 \}
7337 .END
7340 \# ---Main heads---
7342 \# HEAD FAMILY
7343 \# -----------
7344 \# *Argument:
7345 \#   <family to use for section titles (main heads)>
7346 \# *Function:
7347 \#   Creates or modifies string $HEAD_FAM.
7348 \# *Notes:
7349 \#   Default is same as running text.
7351 .MAC HEAD_FAMILY END
7352 .    ds $HEAD_FAM \\$1
7353 .END
7356 \# HEAD FONT
7357 \# ---------
7358 \# *Argument:
7359 \#   <font to use for section titles (main heads)>
7360 \# *Function:
7361 \#   Creates or modifies string $HEAD_FT.
7362 \# *Notes:
7363 \#   Default is bold.
7365 .MAC HEAD_FONT END
7366 .    ds $HEAD_FT \\$1
7367 .END
7370 \# HEAD SIZE
7371 \# ---------
7372 \# *Argument:
7373 \#   <+|- number of points by which to in/decrease point size of
7374 \#   section titles (relative to running text)>
7375 \# *Function:
7376 \#   Creates or modifies string $HEAD_SIZE_CHANGE.
7377 \# *Notes:
7378 \#   Must be preceded by a - or + sign with no space afterwards.
7379 \#   Fractional point sizes are allowed.
7380 \#   Default +1 for printstyle TYPESET; +0 for TYPEWRITE.
7382 .MAC HEAD_SIZE END
7383 .    ds $HEAD_SIZE_CHANGE \\$1
7384 .END
7387 \# HEAD QUAD
7388 \# ---------
7389 \# *Arguments:
7390 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE
7391 \# *Function:
7392 \#   Creates or modifies string $HEAD_QUAD.
7393 \# *Notes:
7394 \#   Default is CENTER.
7396 .MAC HEAD_QUAD END
7397 .    ds $HEAD_QUAD \\$1
7398 .END
7401 \# HEAD CAPS
7402 \# ---------
7403 \# *Arguments:
7404 \#   <none> | <anything>
7405 \# *Function:
7406 \#   Creates or modifies register #HEAD_CAPS.
7407 \# *Notes:
7408 \#   Default is on.
7410 .MAC HEAD_CAPS END
7411 .    ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
7412 .    el \{ .nr #HEAD_CAPS 0 \}
7413 .END
7416 \# HEAD COLOR
7417 \# ----------
7418 \# *Arguments:
7419 \#   <pre-defined XCOLOR or NEWCOLOR>
7420 \# *Function:
7421 \#   Defines string $HEAD_COLOR to argument.
7422 \# *Notes:
7423 \#   User must define an XCOLOR or NEWCOLOR before using
7424 \#   HEAD_COLOR.
7426 .MAC HEAD_COLOR END
7427 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
7428 .    nr #HEAD_COLOR 1
7429 .    ds $HEAD_COLOR \\$1
7430 .END
7433 \# HEAD SPACE
7434 \# ----------
7435 \# *Arguments:
7436 \#   <none> | <anything>
7437 \# *Function:
7438 \#   Creates register #HEAD_SPACE, which toggles whether the space
7439 \#   before heads is 1 extra line space ("off") or 2 ("on").  Used only
7440 \#   in PRINTSTYLE TYPESET.
7441 \# *Notes:
7442 \#   Default is on.
7444 .MAC HEAD_SPACE END
7445 .    ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
7446 .    el \{ .nr #HEAD_SPACE 0 \}
7447 .END
7450 \# HEAD UNDERLINE
7451 \# --------------
7452 \# *Arguments:
7453 \#   <none> | <anything>
7454 \# *Function:
7455 \#   Creates or modifies register #HEAD_UNDERLINE.
7456 \# *Notes:
7457 \#   Default is on.
7459 .MAC HEAD_UNDERLINE END
7460 .    ie '\\$1'' \{ .nr #HEAD_UNDERLINE 1 \}
7461 .    el \{ .nr #HEAD_UNDERLINE 0 \}
7462 .END
7465 \# MAIN HEAD
7466 \# ---------
7467 \# *Arguments:
7468 \#   "text of main head" ["text of main head"] ...
7469 \# *Function:
7470 \#   In TYPEWRITE, prints main heads centered, all caps, underlined.
7471 \#   In TYPESET, prints bold main heads 1 point larger than running
7472 \#   text, all caps, underlined.
7473 \# *Notes:
7474 \#   The HEAD macro requires that double-quotes (") surround
7475 \#   each line of text.
7477 .MAC HEAD END
7478 .    br
7479 \# Collect head for TOC.
7480 .    nr #ARG_NUM 0 1
7481 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7482 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
7483 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7484 .       ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
7485 .          as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\\|
7486 .       \}
7487 .       el \{\
7488 \# Note that in the .as lines, below, \ at the end has a literal
7489 \# space after it.
7490 .          ie \\n[#NUMBER_HEAD] \{\
7491 .             ie \\n[#ARG_NUM]=0 \{\
7492 .                as $TOC_HEAD_ITEM \\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\ 
7493 .                nr #HEAD_NUM \\n-[#HEAD_NUM]
7494 .             \}
7495 .             el \{\
7496 .                as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ 
7497 .             \}
7498 .          \}
7499 .          el \{\
7500 .             as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ 
7501 .          \}
7502 .       \}
7503 .    \}
7504 \# Note the use of \!, which transparently embeds the macros used
7505 \# in the TOC_ENTRIES diversion.  The elements they control must be
7506 \# processed literally when the diversion is output.
7507 .    ev TOC_EV
7508 .    da TOC_ENTRIES
7509 .    if \\n[#PRINT_STYLE]=1 \{\
7510 \!.     fam C
7511 \!.     ft  R
7512 \!.     ps  12
7513 .    \}
7514 .    if \\n[#PRINT_STYLE]=2 \{\
7515 \!.     FAMILY  \\*[$TOC_HEAD_FAM]
7516 \!.     FT      \\*[$TOC_HEAD_FT]
7517 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
7518 .    \}
7519 \!.  TRAP OFF
7520 .    ie \\n[#PRINT_STYLE]=1 \{\
7521 \!.     PAD "\\h'2m'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN_TYPEWRITE]"
7522 .    \}
7523 .    el \{\
7524 \!.     PAD "\\h'\\n[#TOC_HEAD_INDENT]u'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN]"
7525 .    \}
7526 \!.  EL
7527 \!.  ST 100 L
7528 \!.  ST 101 R
7529 .    if \\n[#PRINT_STYLE]=2 \{\
7530 \!.     FAMILY  \\*[$TOC_PN_FAM]
7531 \!.     FT      \\*[$TOC_PN_FT]
7532 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7533 .    \}
7534 \!.  TAB 100
7535 \!.  PRINT \\*[LEADER]
7536 \!.  TN
7537 \!.  TRAP
7538 \!.  PRINT \\n[#TOC_ENTRY_PN]
7539 \!.  TQ
7540 .    di       
7541 .    ev
7542 \# End collection of head for TOC
7543 \# Process head
7544 .    nr #HEAD 1
7545 .    ev HEAD
7546 .    ll \\n[#L_LENGTH]u
7547 .    ta \\n(.lu
7548 .    if \\n[#COLUMNS] \{\
7549 .       ll \\n[#COL_L_LENGTH]u
7550 .       ta \\n(.lu
7551 .    \}
7552 .    CHECK_INDENT
7553 .    QUAD \\*[$HEAD_QUAD]
7554 .    if \\n[#PRINT_STYLE]=1 \{\
7555 .       fam C
7556 .       ft  R
7557 .       ps  12
7558 .       vs  \\n[#DOC_LEAD]u
7559 .       UNDERLINE OFF
7560 .    \}
7561 .    if \\n[#PRINT_STYLE]=2 \{\
7562 .       FAMILY  \\*[$HEAD_FAM]
7563 .       FT      \\*[$HEAD_FT]
7564 .       PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
7565 .       LS      \\n[#DOC_LEAD]u
7566 .    \}
7567 .    if r#QUOTE             \{ .rr #QUOTE \}
7568 .    if r#EPIGRAPH          \{ .rr #EPIGRAPH \}
7569 .    if \\n[#PRINT_STYLE]=1 \{ .ne 3 \}
7570 .    if \\n[#PRINT_STYLE]=2 \{\
7571 .       ie \\n[#HEAD_SPACE] \{ .ne 4 \}
7572 .       el \{ .ne 3 \}
7573 .    \}
7574 .    ie \\n[#START] \{\
7575 .       if \\n[#DOC_HEADER]=0 \{ . \}
7576 .    \}
7577 .    el \{\
7578 .       if \\n[#PRINT_STYLE]=1 \{\
7579 .          if !\\n[#LINEBREAK] \{\
7580 .             ALD \\n[#DOC_LEAD]u
7581 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
7582 .          \}
7583 .       \}
7584 .       if \\n[#PRINT_STYLE]=2 \{\
7585 .          ie \\n[#PP_SPACE] \{\
7586 .             ie \\n[#END_QUOTE] \{ . \}
7587 .             el \{\
7588 .                if !\\n[#LINEBREAK] \{\
7589 .                   if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
7590 .                \}
7591 .             \}
7592 .          \}
7593 .          el \{\
7594 .             ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
7595 .             el \{ .ALD \\n[#DOC_LEAD]u \}
7596 .          \}
7597 .          if \\n[#END_QUOTE] \{\
7598 .             if !\\n[#Q_FITS] \{\
7599 .                RLD \\n[#DOC_LEAD]u
7600 .                if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
7601 .             \}
7602 .             if \\n[#Q_AT_TOP] \{\
7603 .                RLD \\n[#DOC_LEAD]u
7604 .                if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
7605 .             \}
7606 .          \}
7607 .          if \\n[#LINEBREAK] \{\
7608 .             if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
7609 .          \}
7610 .       \}
7611 .    \}
7612 \# Print head
7613 .    nr #ARG_NUM 0 1
7614 .    if \\n[#HEAD_CAPS] \{ .CAPS \}
7615 .    if \\n[#PRINT_STYLE]=2 \{\
7616 .       if \\n[#HEAD_COLOR]=1 \{\
7617 .          TRAP OFF
7618 .          COLOR \\*[$HEAD_COLOR]
7619 .          EL
7620 .          TRAP
7621 .       \}
7622 .    \}
7623 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7624 .       ie \\n[#NUMBER_HEAD] \{\
7625 .          ie \\n[#ARG_NUM]=0 \{\
7626 .             br
7627 .             ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
7628 .             el \{ .UNDERSCORE "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
7629 .             br
7630 .          \}
7631 .          el \{\
7632 .             br
7633 .             ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
7634 .             el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
7635 .             br
7636 .          \}
7637 .       \}
7638 .       el \{\
7639 .          br
7640 .          ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
7641 .          el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
7642 .          br
7643 .       \}
7644 .    \}
7645 .    REMOVE_INDENT
7646 .    CAPS OFF
7647 .    ev
7648 .    ALD \\n[#DOC_LEAD]u
7649 .    RESET_SUBHEAD_NUMBER
7650 .    RESET_PARAHEAD_NUMBER
7651 .    if r#START      \{ .rr #START     \}
7652 .    if r#EPIGRAPH   \{ .rr #EPIGRAPH  \}
7653 .    if r#QUOTE      \{ .rr #QUOTE     \}
7654 .    if r#Q_FITS     \{ .rr #Q_FITS    \}
7655 .    if r#END_QUOTE  \{ .rr #END_QUOTE \}
7656 .    if r#LINEBREAK  \{ .rr #LINEBREAK \}
7657 .    if r#Q_AT_TOP   \{ .rr #Q_AT_TOP  \}
7658 .    if r#PP_ACTIVE  \{ .rr #PP_ACTIVE \}
7659 .    rr #ARG_NUM
7660 .    rm $TOC_HEAD_ITEM
7661 .    nr #PP 0
7662 .END
7665 \# ---Subheads---
7667 \# SUBHEAD FAMILY
7668 \# --------------
7669 \# *Argument:
7670 \#   <family to use in subheads>
7671 \# *Function:
7672 \#   Creates or modifies string $SH_FAM.
7673 \# *Notes:
7674 \#   Default is same as running text.
7676 .MAC SUBHEAD_FAMILY END
7677 .    ds $SH_FAM \\$1
7678 .END
7681 \# SUBHEAD FONT
7682 \# --------------
7683 \# *Argument:
7684 \#   <font to use in subheads>
7685 \# *Function:
7686 \#   Creates or modifies string $SH_FT.
7687 \# *Notes:
7688 \#   Default is bold.
7690 .MAC SUBHEAD_FONT END
7691 .    ds $SH_FT \\$1
7692 .END
7695 \# SUBHEAD SIZE
7696 \# ------------
7697 \# *Argument:
7698 \#   <+|- number of points by which to in/decrease point size of subheads
7699 \#   (relative to running text)>
7700 \# *Function:
7701 \#   Creates or modifies string $SH_SIZE_CHANGE.
7702 \# *Notes:
7703 \#   Must be preceded by a +|- sign.  No space afterwards.
7704 \#   Fractional point sizes are allowed.
7705 \#   Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
7707 .MAC SUBHEAD_SIZE END
7708 .    ds $SH_SIZE_CHANGE \\$1
7709 .END
7712 \# SUBHEAD COLOR
7713 \# -------------
7714 \# *Arguments:
7715 \#   <pre-defined XCOLOR or NEWCOLOR>
7716 \# *Function:
7717 \#   Defines string $SH_COLOR to argument.
7718 \# *Notes:
7719 \#   User must define an XCOLOR or NEWCOLOR before using
7720 \#   SUBHEAD_COLOR.
7722 .MAC SUBHEAD_COLOR END
7723 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
7724 .    nr #SH_COLOR 1
7725 .    ds $SH_COLOR \\$1
7726 .END
7729 \# SUBHEAD QUAD
7730 \# ------------
7731 \# *Argument:
7732 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE
7733 \# *Function:
7734 \#   Creates or modifies string $SH_QUAD.
7735 \# *Notes:
7736 \#   Default is LEFT for both TYPESET and TYPEWRITE.
7738 .MAC SUBHEAD_QUAD END
7739 .    ds $SH_QUAD \\$1
7740 .END
7743 \# SUBHEAD
7744 \# -------
7745 \# *Arguments:
7746 \#   "text of subhead" ["text of subhead"] ...
7747 \# *Function:
7748 \#   In TYPEWRITE, prints subheads underlined.
7749 \#   In TYPESET, prints subheads bold, .5 points larger than running
7750 \#   text.
7751 \#   In both styles, a line space precedes the subhead, and a small
7752 \#   amount of lead comes after.
7753 \# *Notes:
7754 \#   As with the HEAD macro, double-quotes (") must surround
7755 \#   each line of text.
7757 .MAC SUBHEAD END
7758 .    br
7759 \# Collect subhead for TOC.
7760 .    nr #ARG_NUM 0 1
7761 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7762 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7763 .       ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
7764 .          as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\\|
7765 .       \}
7766 .       el \{\
7767 \# Note that in the .as lines, below, \ at the end has a literal
7768 \# space after it.
7769 .          ie \\n[#NUMBER_SH] \{\
7770 .             ie \\n[#ARG_NUM]=0 \{\
7771 .                as $TOC_SH_ITEM \\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]\ 
7772 .                nr #SH_NUM \\n-[#SH_NUM]
7773 .             \}
7774 .             el \{\
7775 .                as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ 
7776 .             \}
7777 .          \}
7778 .          el \{\
7779 .             as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ 
7780 .          \}
7781 .       \}
7782 .    \}
7783 \# Note the use of \!, which transparently embeds the macros used
7784 \# in the TOC_ENTRIES diversion.  The elements they control must be
7785 \# processed literally when the diversion is output.
7786 .    ev TOC_EV
7787 .    da TOC_ENTRIES
7788 .    if \\n[#PRINT_STYLE]=1 \{\
7789 \!.     fam C
7790 \!.     ft  R
7791 \!.     ps  12
7792 .    \}
7793 .    if \\n[#PRINT_STYLE]=2 \{\
7794 \!.     FAMILY  \\*[$TOC_SH_FAM]
7795 \!.     FT      \\*[$TOC_SH_FT]
7796 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
7797 .    \}
7798 \!.  TRAP OFF
7799 .    ie \\n[#PRINT_STYLE]=1 \{\
7800 \!.     PAD "\\h'4m'\\*[$TOC_SH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
7801 .    \}
7802 .    el \{\
7803 \!.     PAD "\\h'\\n[#TOC_SH_INDENT]u'\\*[$TOC_SH_ITEM]\\*[$TOC_PN]"
7804 .    \}
7805 \!.  EL
7806 \!.  ST 100 L
7807 \!.  ST 101 R
7808 .    if \\n[#PRINT_STYLE]=2 \{\
7809 \!.     FAMILY  \\*[$TOC_PN_FAM]
7810 \!.     FT      \\*[$TOC_PN_FT]
7811 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7812 .    \}
7813 \!.  TAB 100
7814 \!.  PRINT \\*[LEADER]
7815 \!.  TN
7816 \!.  TRAP
7817 \!.  PRINT \\n[#TOC_ENTRY_PN]
7818 \!.  TQ
7819 .    di       
7820 .    ev
7821 \# End collection of head for TOC
7822 \# Process subhead
7823 .    nr #ARG_NUM 0 1
7824 .    if r#QUOTE    \{ .rr #QUOTE    \}
7825 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7826 .    ev SUBHEAD
7827 .    ll \\n[#L_LENGTH]u
7828 .    ta \\n(.lu
7829 .    if \\n[#COLUMNS] \{\
7830 .       ll \\n[#COL_L_LENGTH]u
7831 .       ta \\n(.lu
7832 .    \}
7833 .    CHECK_INDENT
7834 .    if \\n[#PRINT_STYLE]=1 \{\
7835 .       fam C
7836 .       ft  R
7837 .       ps  12
7838 .       vs  \\n[#DOC_LEAD]u
7839 .       QUAD   \\*[$SH_QUAD]
7840 .       UNDERLINE OFF
7841 .    \}
7842 .    if \\n[#PRINT_STYLE]=2 \{\
7843 .       FAMILY  \\*[$SH_FAM]
7844 .       FT      \\*[$SH_FT]
7845 .       PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
7846 .       LS      \\n[#DOC_LEAD]u
7847 .       QUAD    \\*[$SH_QUAD]
7848 .    \}
7849 .    if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
7850 .    if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
7851 .    ie \\n[#START] \{ . \}
7852 .    el \{\
7853 .       ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]u*2u) ) \{\
7854 .          ie \\n[#COLUMNS] \{ .COL_NEXT \}
7855 .          el \{ .bp \}
7856 .       \}
7857 .       el \{\
7858 .          ie \\n[#HEAD]=1 \{ . \}
7859 .          el \{\
7860 .             if \\n[#PRINT_STYLE]=1 \{\
7861 .                if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7862 .             \}
7863 .             if \\n[#PRINT_STYLE]=2 \{\
7864 .                ie \\n[#PP_SPACE]=1 \{\
7865 .                   ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7866 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
7867 .                \}
7868 .                el \{\
7869 .                   if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7870 .                \}
7871 .             \}
7872 .          \}
7873 .       \}
7874 .    \}
7875 \# Print subhead
7876 .    if \\n[#PRINT_STYLE]=1 \{\
7877 .       while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7878 .          ie \\n[#NUMBER_SH] \{\
7879 .             ie \\n[#ARG_NUM]=0 \{\
7880 .                ie \\n[#NUMBER_HEAD] \{\
7881 .                   br
7882 .                   UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
7883 .                   br
7884 .                \}
7885 .                el \{\
7886 .                   br
7887 .                   UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
7888 .                   br
7889 .                \}
7890 .             \}
7891 .             el \{\
7892 .                br
7893 .                ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
7894 .                el \{ .UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
7895 .                br
7896 .             \}
7897 .          \}
7898 .          el \{\
7899 .             br
7900 .             UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7901 .             br
7902 .          \}
7903 .       \}
7904 .    \}
7905 .    if \\n[#PRINT_STYLE]=1 \{\
7906 .       if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
7907 .    \}
7908 .    if \\n[#PRINT_STYLE]=2 \{\
7909 .       if \\n[#SH_COLOR]=1 \{ .COLOR \\*[$SH_COLOR] \}
7910 .       ie \\n[#PP_SPACE]=0 \{\
7911 .          while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7912 .             ie \\n[#NUMBER_SH] \{\
7913 .                ie \\n[#ARG_NUM]=0 \{\
7914 .                   ie \\n[#NUMBER_HEAD] \{\
7915 .                      br
7916 .                      PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
7917 .                      br
7918 .                   \}
7919 .                   el \{\
7920 .                      br
7921 .                      PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
7922 .                      br
7923 .                   \}
7924 .                \}
7925 .                el \{\
7926 .                   br
7927 .                   PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7928 .                   br
7929 .                \}
7930 .             \}
7931 .             el \{\
7932 .                br
7933 .                PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7934 .                br
7935 .             \}
7936 .          \}
7937 .       \}
7938 .       el \{\
7939 .          ALD \\n[#DOC_LEAD]u
7940 .          if \\n[#HEAD]=1      \{ .RLD \\n[#DOC_LEAD]u \}
7941 .          if \\n[#END_QUOTE]   \{ .RLD \\n[#DOC_LEAD]u \}
7942 .          if \\n[#EPIGRAPH]    \{ .RLD \\n[#DOC_LEAD]u \}
7943 .          while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7944 .             PRINT "\\$[\\n+[#ARG_NUM]]
7945 .          \}
7946 .          ALD \\n[#DOC_LEAD]u
7947 .       \}
7948 .    \}
7949 .    REMOVE_INDENT
7950 .    ev
7951 .    RESET_PARAHEAD_NUMBER
7952 .    if r#START     \{ .rr #START     \}
7953 .    if r#EPIGRAPH  \{ .rr #EPIGRAPH  \}
7954 .    if r#Q_FITS    \{ .rr #Q_FITS    \}
7955 .    if r#END_QUOTE \{ .rr #END_QUOTE \}
7956 .    if r#LINEBREAK \{ .rr #LINEBREAK \}
7957 .    rm $TOC_SH_ITEM
7958 .    nr #PP 0
7959 .    nr #HEAD 2
7960 .END
7962 \# ---Paragraph heads---
7964 \# PARAHEAD FAMILY
7965 \# ---------------
7966 \# *Argument:
7967 \#   <family to use in paraheads>
7968 \# *Function:
7969 \#   Creates or modifies string $PH_FAM.
7970 \# *Notes:
7971 \#   Default is same as running text.
7973 .MAC PARAHEAD_FAMILY END
7974 .    ds $PH_FAM \\$1
7975 .END
7978 \# PARAHEAD FONT
7979 \# -------------
7980 \# *Argument:
7981 \#   <font to use in paraheads>
7982 \# *Function:
7983 \#   Creates or modifies string $PH_FT.
7984 \# *Notes:
7985 \#   Default is bold italic for TYPESET; underlined for TYPEWRITE.
7987 .MAC PARAHEAD_FONT END
7988 .    ds $PH_FT \\$1
7989 .END
7992 \# PARAHEAD SIZE
7993 \# -------------
7994 \# *Argument:
7995 \#   <+|- number of points by which to in/decrease point size of subheads
7996 \#   (relative to running text)>
7997 \# *Function:
7998 \#   Creates or modifies string $PH_SIZE_CHANGE.
7999 \# *Notes:
8000 \#   Must be preceded by a +|- sign.  No space afterwards.
8001 \#   Fractional point sizes are allowed.  No unit of measure, please.
8002 \#   Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
8004 .MAC PARAHEAD_SIZE END
8005 .    ds $PH_SIZE_CHANGE \\$1
8006 .END
8009 \# PARAHEAD COLOR
8010 \# --------------
8011 \# *Arguments:
8012 \#   <pre-defined XCOLOR or NEWCOLOR>
8013 \# *Function:
8014 \#   Defines string $PH_COLOR to argument.
8015 \# *Notes:
8016 \#   User must define an XCOLOR or NEWCOLOR before using
8017 \#   PARAHEAD_COLOR.
8019 .MAC PARAHEAD_COLOR END
8020 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
8021 .    nr #PH_COLOR 1
8022 .    ds $PH_COLOR \\$1
8023 .END
8026 \# PARAHEAD INDENT
8027 \# ---------------
8028 \# *Argument:
8029 \#   <size of indent>
8030 \# *Function:
8031 \#   Creates or modifies register #PH_INDENT.
8032 \# *Notes:
8033 \#   Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
8035 .MAC PARAHEAD_INDENT END
8036 .    nr #PH_INDENT (\\$1)
8037 .END
8040 \# PARAHEAD
8041 \# --------
8042 \# *Arguments:
8043 \#   "<para head>"
8044 \# *Function:
8045 \#   Deposits a paragraph head at the start and into the body of a
8046 \#   paragraph.
8047 \# *Notes:
8048 \#   PARAHEAD *must* come after PP.
8050 .MAC PARAHEAD END
8051 \# Collect parahead for TOC.
8052 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
8053 .    ie \\n[#NUMBER_PH] \{\
8054 .       ds $TOC_PH_ITEM \\n+[#PH_NUM].\0\\$1\\|
8055 .       nr #PH_NUM \\n-[#PH_NUM]
8056 .    \}
8057 .    el \{\
8058 .       ds $TOC_PH_ITEM \\$1\\|
8059 .    \}
8060 .    ev TOC_EV
8061 .    da TOC_ENTRIES
8062 .    if \\n[#PRINT_STYLE]=1 \{\
8063 \!.       fam C
8064 \!.       ft  R
8065 \!.       ps  12
8066 .    \}
8067 .    if \\n[#PRINT_STYLE]=2 \{\
8068 \!.     FAMILY  \\*[$TOC_PH_FAM]
8069 \!.     FT      \\*[$TOC_PH_FT]
8070 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PH_SIZE_CHANGE]
8071 .    \}
8072 \!.  TRAP OFF
8073 .    ie \\n[#PRINT_STYLE]=1 \{\
8074 \!.     PAD "\\h'6m'\\*[$TOC_PH_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
8075 .    \}
8076 .    el \{\
8077 \!.     PAD "\\h'\\n[#TOC_PH_INDENT]u'\\*[$TOC_PH_ITEM]\\*[$TOC_PN]"
8078 .    \}
8079 \!.  EL
8080 \!.  ST 100 L
8081 \!.  ST 101 R
8082 .    if \\n[#PRINT_STYLE]=2 \{\
8083 \!.     FAMILY  \\*[$TOC_PN_FAM]
8084 \!.     FT      \\*[$TOC_PN_FT]
8085 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
8086 .    \}
8087 \!.  TAB 100
8088 \!.  PRINT \\*[LEADER]
8089 \!.  TN
8090 \!.  TRAP
8091 \!.  PRINT \\n[#TOC_ENTRY_PN]
8092 \!.  TQ
8093 .    di       
8094 .    ev
8095 \# End collection of parahead for TOC
8096 \# Process parahead
8097 .    if \\n[#SLANT_ON] \{\
8098 .       nr #SLANT_WAS_ON 1
8099 \E*[SLANTX]
8100 .    \}
8101 .    ie \\n[#PP]=1 \{\
8102 .       if \\n[#INDENT_FIRST_PARAS] \{\
8103 .          ti \\n[#PH_INDENT]u
8104 .       \}
8105 .    \}
8106 .    el \{ .ti \\n[#PH_INDENT]u \}
8107 .    if \\n[#PRINT_STYLE]=1 \{\
8108 .       fam C
8109 .       ft  R
8110 .       ps  12
8111 .       UNDERLINE OFF
8112 .       ie \\n[#NUMBER_PH] \{\
8113 .          if \\n[#NUMBER_HEAD] \{\
8114 .             ie \\n[#NUMBER_SH] \{\
8115 .                UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
8117 .             \}
8118 .             el \{\
8119 .                UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1
8121 .             \}
8122 .          \}
8123 .          ie \\n[#NUMBER_SH] \{\
8124 .             if !\\n[#NUMBERED] \{\
8125 .                UNDERSCORE "\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1
8127 .             \}
8128 .          \}
8129 .          el \{\
8130 .             if !\\n[#NUMBERED] \{\
8131 .                UNDERSCORE "\\n+[#PH_NUM].\\ \\$1
8133 .             \}
8134 .          \}
8135 .       \}
8136 .       el \{\
8137 .          UNDERSCORE "\\$1
8139 .       \}
8140 .       if \\n[#SLANT_WAS_ON] \{\
8141 .          if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
8142 .          if \\n[#SLANT_MEANS_SLANT] \{\
8143 \E*[SLANT]\c
8144 .          \}
8145 .          rr #SLANT_WAS_ON
8146 .       \}
8147 .    \}
8148 .    if \\n[#PRINT_STYLE]=2 \{\
8149 .       FAM     \\*[$PH_FAM]
8150 .       FT      \\*[$PH_FT]
8151 .       PT_SIZE \\*[$PH_SIZE_CHANGE]
8152 .       if \\n[#PH_COLOR]=1 \{ .COLOR \\*[$PH_COLOR] \}
8153 .          ie \\n[#NUMBER_PH] \{\
8154 .             if \\n[#NUMBER_HEAD] \{\
8155 .                ie \\n[#NUMBER_SH] \{\
8156 .                   PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
8157 .                \}
8158 .                el \{\
8159 .                   PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
8160 .                \}
8161 .             \}
8162 .             ie \\n[#NUMBER_SH] \{\
8163 .                if !\\n[#NUMBERED] \{\
8164 .                   PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
8165 .                \}
8166 .             \}
8167 .             el \{\
8168 .                if !\\n[#NUMBERED] \{\
8169 .                   PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
8170 .                \}
8171 .             \}
8172 .          \}
8173 .          el \{\
8174 .             PRINT "\\$1\h'.6m'\c"
8175 .          \}
8176 .       \}
8177 .       FAMILY  \\*[$DOC_FAM]
8178 .       FT      \\*[$PP_FT]
8179 .       PT_SIZE \\n[#DOC_PT_SIZE]u
8180 .       if \\n[#PH_COLOR]=1 \m[]\c
8181 .       if \\n[#SLANT_WAS_ON] \{\
8182 .          rr #SLANT_WAS_ON 1
8183 \E*[SLANT]\c
8184 .       \}
8185 .    \}
8186 .    rr #NUMBERED
8187 .    rm $TOC_PH_ITEM
8188 .END
8191 \# ====================================================================
8193 \# +++LINE BREAKS+++
8195 \# LINEBREAK CHARACTER
8196 \# -------------------
8197 \# *Arguments:
8198 \#   [character] [iterations] [vertical adjustment]
8199 \# *Function:
8200 \#   Allows user to specify a line break character and the number
8201 \#   of times to repeat it horiontally.
8202 \# *Notes:
8203 \#   Without an argument, LINEBREAK_CHAR will deposit a blank line.
8205 \#   Vertical adjustment requires a unit of measure (most likely
8206 \#   "p"), and has to be preceded by +|-
8208 .MAC LINEBREAK_CHAR END
8209 .    nr #REPEAT 1
8210 .    ds $LINEBREAK_CHAR \\$1
8211 .    ds $LINEBREAK_CHAR_V_ADJ \\$3
8212 .    if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
8213 .       ds $LINEBREAK_CHAR_V_ADJ +0
8214 .    \}
8215 .    while \\$2>\\n[#REPEAT] \{\
8216 .       as $LINEBREAK_CHAR "\\ \\$1
8217 .       nr #REPEAT \\n[#REPEAT]+1
8218 .    \}
8219 .   rr #REPEAT
8220 .END
8223 \# LINEBREAK COLOR
8224 \# ---------------
8225 \# *Arguments:
8226 \#   <pre-defined XCOLOR or NEWCOLOR>
8227 \# *Function:
8228 \#   Defines string $LINEBREAK_COLOR to argument.
8229 \# *Notes:
8230 \#   User must define an XCOLOR or NEWCOLOR before using
8231 \#   LINEBREAK_COLOR.
8233 .MAC LINEBREAK_COLOR END
8234 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
8235 .    ds $LINEBREAK_COLOR \\$1
8236 .END
8239 \# LINE BREAK
8240 \# ----------
8241 \# *Arguments:
8242 \#   <none>
8243 \# *Function:
8244 \#   Deposits line break character.
8245 \# *Notes:
8246 \#   If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
8248 .MAC LINEBREAK END
8249 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
8250 .    po \\n[#DOC_L_MARGIN]u
8251 .    ie  '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
8252 .    el \{\
8253 .       if \\n[#PRINT_STYLE]=1 \{\
8254 .          ie \\n[#END_QUOTE] \{ . \}
8255 .          el \{ .ALD \\n[#DOC_LEAD]u \}
8256 .       \}
8257 .       if \\n[#PRINT_STYLE]=2 \{\
8258 .          ie \\n[#END_QUOTE] \{ . \}
8259 .          el \{ .ALD \\n[#DOC_LEAD]u \}
8260 .       \}
8261 .       ev LINEBREAK
8262 .       evc 0
8263 .       CENTER
8264 .       PRINT \m[\\*[$LINEBREAK_COLOR]]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\m[]
8265 .       if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8266 .       if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
8267 .       ev
8268 .       QUAD \\*[$DOC_QUAD]
8269 .    \}
8270 .    nr #LINEBREAK 1
8271 .    if r#QUOTE     \{ .rr #QUOTE     \}
8272 .    if r#END_QUOTE \{ .rr #END_QUOTE \}
8273 .    nr #PP 0
8274 .END
8276 \# ====================================================================
8278 \# +++PARAGRAPHS+++
8280 \# PARAGRAPH FONT
8281 \# --------------
8282 \# *Argument:
8283 \#   <font of running text>
8284 \# *Function:
8285 \#   Creates or modifies string $PP_FT.
8286 \# *Notes:
8287 \#   Affects all paragraphs.
8289 .MAC PP_FONT END
8290 .    if \\n[#IGNORE] \{ .return \}
8291 .    br
8292 .    ds $PP_FT \\$1
8293 .    FT \\*[$PP_FT]
8294 .END
8297 \# PARAGRAPH INDENT
8298 \# ----------------
8299 \# *Argument:
8300 \#   <amount to indent paragraphs in running text (ipPcm)>
8301 \# *Function:
8302 \#   Allows user to change the default para indent.  The change will
8303 \#   affect the indent of QUOTEs and BLOCKQUOTEs as well.
8304 \# *Notes:
8305 \#   Default for printstyle TYPEWRITE is 1/2-inch.  Default for
8306 \#   printstyle TYPESET is 2 ems.  The defaults are set in
8307 \#   PRINTSTYLE, not DEFAULTS.
8309 .MAC PARA_INDENT END
8310 .    nr #PP_INDENT (\\$1)
8311 .END
8314 \# INDENT FIRST PARAGRAPHS
8315 \# -----------------------
8316 \# *Arguments:
8317 \#   <none> | <anything>
8318 \# *Function:
8319 \#   By default, the first para of a document, as well as the first
8320 \#   paras of blockquotes and block-style epigraphs are not indented.
8321 \#   When invoked, this macro will indent all paras.
8322 \# *Notes:
8323 \#   Default is OFF.
8325 .MAC INDENT_FIRST_PARAS END
8326 .    ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
8327 .    el \{ .rr #INDENT_FIRST_PARAS   \}
8328 .END
8331 \# INTER-PARAGRAPH SPACING
8332 \# -----------------------
8333 \# *Arguments:
8334 \#   <none> | <anything>
8335 \# *Function:
8336 \#   Adds a line space between paragraphs in body text.  Block quotes
8337 \#   are unaffected.
8338 \# *Notes:
8339 \#   Default is OFF.  PARA_SPACE ON is not recommended for use
8340 \#   with PRINTSTYLE TYPEWRITE.
8342 .MAC PARA_SPACE END
8343 .    ie '\\$1'' \{ .nr #PP_SPACE 1 \}
8344 .    el \{ .rr #PP_SPACE   \}
8345 .END
8348 \# PARAGRAPH
8349 \# ---------
8350 \# *Arguments:
8351 \#   <none>
8352 \# *Function:
8353 \#   Figures out what to do with paragraphs under differing conditions.
8354 \# *Notes:
8355 \#   For the time being, there's no automatic widow/orphan control.
8356 \#   Controlling them isn't just a matter of establishing an arbitrary
8357 \#   number of lines needed for a para, since groff doesn't then
8358 \#   handle single line paragraphs gracefully.  Usually, the whole
8359 \#   page needs to be tweaked.
8361 \#   Note the use of transparent line break (\!.br) to get
8362 \#   PP to work within blockquotes and epigraphs.
8364 \#   PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
8366 .MAC PP END
8367 .    br
8368 .    if \\n[#DOC_TYPE]=4 \{\
8369 .       if !'\\n(.z'' \{ .di \}
8370 .       nr #TOTAL_FIELDS \\n[#FIELD]
8371 .       nr #FIELD        0 1
8372 .       nr #NUM_FIELDS   0 1
8373 .       if \\n[#TOTAL_FIELDS]>0 \{\
8374 .          while \\n+[#NUM_FIELDS]<=\\n[#TOTAL_FIELDS] \{\
8375 .             nf
8376 .             LETTERHEAD\\n+[#FIELD]
8377 .             QUAD \\*[$DOC_QUAD]
8378 .             ALD \\n[#DOC_LEAD]u
8379 .             if \\n[#DATE_FIRST]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8380 .             rr #DATE_FIRST
8381 .             rm LETTERHEAD\\n[#FIELD]
8382 .          \}
8383 .          rr #FIELD
8384 .          rr #NUM_FIELDS
8385 .          rr #TOTAL_FIELDS
8386 .       \}
8387 .    \}
8388 .    rr #PP_ACTIVE
8389 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
8390 .    if \\n[#PP_STYLE]=1 \{\
8391 .       if \\n[#ENDNOTE] \{\
8392 .          nr #RESET_PARA_SPACE \\n[#PP_SPACE]
8393 .          ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
8394 .          el \{ .PARA_SPACE OFF \}
8395 .       \}
8396 .       br
8397 .       if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
8398 .       if \\n[#COLUMNS] \{\
8399 .          if !\\n[#ENDNOTE] \{\
8400 .             po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8401 .             nr #L_MARGIN \\n(.o
8402 .          \}
8403 .       \}
8404 .       if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
8405 .       ie \\n[#PRINT_STYLE]=1 \{\
8406 .          fam C
8407 .          ft  R
8408 .          ps  12
8409 .          ie \\n[#ENDNOTE] \{ .vs \\n[#EN_LEAD]u \}
8410 .          el \{ .vs \\n[#DOC_LEAD]u \}
8411 .          QUAD \\*[$DOC_QUAD]
8412 .          UNDERLINE OFF
8413 .          if \\n[#SLANT_ON] \{\
8414 .             if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
8415 .          \}
8416 .       \}
8417 .       el \{\
8418 .          ie \\n[#ENDNOTE] \{\
8419 .             FAMILY  \\*[$EN_FAM]
8420 .             FT      \\*[$EN_FT]
8421 .             PT_SIZE \\n[#EN_PS]u
8422 .             vs      \\n[#EN_LEAD]u
8423 .             QUAD    \\*[$EN_QUAD]
8424 .          \}
8425 .          el \{\
8426 .             FAMILY  \\*[$DOC_FAM]
8427 .             FT      \\*[$PP_FT]
8428 .             PT_SIZE \\n[#DOC_PT_SIZE]u
8429 .             LS      \\n[#DOC_LEAD]u
8430 .             QUAD    \\*[$DOC_QUAD]
8431 .          \}
8432 .       \}
8433 .       ie \\n[#PP]=0 \{\
8434 .          if \\n[#INDENT_FIRST_PARAS] \{\
8435 .             ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
8436 .             el \{ .ti \\n[#PP_INDENT]u \}
8437 .             if '\\n(.z'END_NOTES' \{\
8438 .                ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
8439 .             \}
8440 .          \}
8441 .          if r#END_QUOTE \{\
8442 .             if \\n[#END_QUOTE] \{\
8443 .                if !\\n[#LINEBREAK] \{\
8444 .                   ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
8445 .                   el \{ .ti \\n[#PP_INDENT]u \}
8446 .                   if '\\n(.z'END_NOTES' \{\
8447 .                      ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
8448 .                   \}
8449 .                \}
8450 .             \}
8451 .          \}
8452 .       \}
8453 .       el \{\
8454 .          br
8455 .          if \\n[#PP_SPACE] \{\
8456 .             if \\n[#PRINT_STYLE]=2 \{\
8457 .                ie \\n[#END_QUOTE] \{\
8458 .                   rr #END_QUOTE
8459 .                \}
8460 .                el \{ .ALD \\n[#DOC_LEAD]u \}
8461 .             \}
8462 .          \}
8463 .          ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
8464 .          el \{ .ti \\n[#PP_INDENT]u \}
8465 .          if '\\n(.z'END_NOTES' \{\
8466 .             ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
8467 .          \}
8468 .       \}
8469 .       if r#START     \{ .rr #START     \}
8470 .       if r#QUOTE     \{ .rr #QUOTE     \}
8471 .       if r#END_QUOTE \{ .rr #END_QUOTE \}
8472 .       if r#HEAD      \{ .rr #HEAD      \}
8473 .       if r#EPIGRAPH  \{ .rr #EPIGRAPH  \}
8474 .       if r#Q_FITS    \{ .rr #Q_FITS    \}
8475 .       if r#LINEBREAK \{ .rr #LINEBREAK \}
8476 .       if \\n[#ENDNOTE] \{\
8477 .          ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
8478 .          el \{ .PARA_SPACE OFF \}
8479 .       \}
8480 .       if \\n[#CONDENSE] \{\
8481 \E*[COND]\c
8482 .       \}
8483 .       if \\n[#EXTEND]=1 \{\
8484 \E*[EXT]\c
8485 .       \}
8486 .       nr #PP +1
8487 .    \}
8488 .    if \\n[#PP_STYLE]=2 \{\
8489 \!.     br
8490 .       if \\n[#BROKEN_QUOTE] \{\
8491 .          ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
8492 .          el \{ .nr #Q_PP 0 \}
8493 .          rr #BROKEN_QUOTE
8494 .       \}
8495 .       ie \\n[#Q_PP]=0 \{\
8496 .          if \\n[#INDENT_FIRST_PARAS] \{\
8497 .             ti \\n[#PP_INDENT]u/2u
8498 .          \}
8499 .          if \\n[#ENDNOTE] \{\
8500 .             ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
8501 .             el \{ .ti 0 \}
8502 .          \}
8503 .       \}
8504 .       el \{\
8505 .          ti \\n[#PP_INDENT]u/2u
8506 .       \}
8507 .       if \\n[#CONDENSE] \{\
8508 \E*[COND]\c
8509 .       \}
8510 .       if \\n[#EXTEND]=1 \{\
8511 \E*[EXT]\c
8512 .       \}
8513 .    nr #Q_PP +1
8514 .    \}
8515 .    nr #PP_ACTIVE 1
8516 .END
8518 \# ====================================================================
8520 \# +++QUOTES+++
8522 \# ---Line for line (poetic) quotes---
8524 \# QUOTE FAMILY
8525 \# ------------
8526 \# *Argument:
8527 \#   <family to use in line for line quotes>
8528 \# *Function:
8529 \#   Creates or modifies string $QUOTE_FAM.
8530 \# *Notes:
8531 \#   Default is same as running text.
8533 .MAC QUOTE_FAMILY END
8534 .    ds $QUOTE_FAM \\$1
8535 .END
8538 \# QUOTE FONT
8539 \# ----------
8540 \# *Argument:
8541 \#   <font to use in line for line quotes>
8542 \# *Function:
8543 \#   Creates or modifies string $QUOTE_FT.
8544 \# *Notes:
8545 \#   Default is italic for TYPESET.
8547 .MAC QUOTE_FONT END
8548 .    ds $QUOTE_FT \\$1
8549 .END
8552 \# QUOTE SIZE
8553 \# ----------
8554 \# *Argument:
8555 \#   <-|+ number of points by which to de/increase point size of
8556 \#   line for line quotes (relative to running text)>
8557 \# *Function:
8558 \#   Creates or modifies string $QUOTE_SIZE_CHANGE.
8559 \# *Notes:
8560 \#   Must be preceded by a - or + sign with no space afterwards.
8561 \#   Fractional point sizes are allowed.
8562 \#   Default is +0.
8564 .MAC QUOTE_SIZE END
8565 .    ds $QUOTE_SIZE_CHANGE \\$1
8566 .END
8569 \# QUOTE COLOR
8570 \# -----------
8571 \# *Arguments:
8572 \#   <pre-defined XCOLOR or NEWCOLOR>
8573 \# *Function:
8574 \#   Sets register #QUOTE_COLOR to 1; defines string $QUOTE_COLOR to
8575 \#   argument.
8576 \# *Notes:
8577 \#   User must define an XCOLOR or NEWCOLOR before using
8578 \#   QUOTE_COLOR.
8580 .MAC QUOTE_COLOR END
8581 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
8582 .    nr #QUOTE_COLOR 1
8583 .    ds $QUOTE_COLOR \\$1
8584 .END
8587 \# UNDERLINE QUOTES
8588 \# ----------------
8589 \# *Arguments:
8590 \#   <none> | <anything>
8591 \# *Function:
8592 \#   Creates or modifies register #UNDERLINE_QUOTES (toggle).
8593 \#   If on, line for line quotes are underlined when printstyle
8594 \#   is TYPEWRITE.
8595 \# *Notes:
8596 \#   Default is ON for printstyle TYPEWRITE.
8598 .MAC UNDERLINE_QUOTES END
8599 .    ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
8600 .    el \{ .rr #UNDERLINE_QUOTES   \}
8601 .END
8604 \# QUOTE INDENT
8605 \# ------------
8606 \# *Argument:
8607 \#   <value by which to multiply PP_INDENT for indented quoted text>
8608 \# *Function:
8609 \#   Creates or modifies register #Q_OFFSET_VALUE.
8610 \# *Notes:
8611 \#   Default is 3 for typeset; 2 for typewrite
8613 .MAC QUOTE_INDENT END
8614 .    nr #Q_OFFSET_VALUE \\$1
8615 .END
8618 \# ALWAYS FULLSPACE QUOTES
8619 \# -----------------------
8620 \# *Arguments:
8621 \#   <none> | <anything>
8622 \# *Function:
8623 \#   Toggles register #FULLSPACE_QUOTES.
8624 \# *Notes:
8625 \#   If user doesn't like the default 1/2 line space above and below
8626 \#   quotes, s/he can turn it off here.  Has no effect in TYPEWRITE.
8628 .MAC ALWAYS_FULLSPACE_QUOTES END
8629 .    if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
8630 .    el \{ .rr #FULLSPACE_QUOTES \}
8631 .END
8634 \# QUOTE
8635 \# -----
8636 \# *Arguments:
8637 \#   <none> | <anything>
8638 \# *Function:
8639 \#   Indents quoted text on a line for line basis, or turns QUOTE off.
8640 \# *Notes:
8641 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
8642 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
8643 \#   how much space to put before and after.
8645 .MAC QUOTE END
8646 .    br
8647 \# **Uncomment the next line to prevent orphaned quote lines.
8648 \#.  ne 1
8649 .    ie '\\$1'' \{\
8650 .       ev QUOTE
8651 .       nr #QUOTE 1
8652 .       di P_QUOTE
8653 .       ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
8654 .       ta \\n(.lu
8655 .       if \\n[#COLUMNS] \{\
8656 .          ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
8657 .          ta \\n(.lu
8658 .       \}
8659 .       if \\n[#PRINT_STYLE]=1 \{\
8660 .          fam C
8661 .          ft  R
8662 .          ps 12
8663 .          vs \\n[#DOC_LEAD]u
8664 .          LEFT
8665 .       \}
8666 .       if \\n[#PRINT_STYLE]=2 \{\
8667 .          FAMILY  \\*[$QUOTE_FAM]
8668 .          FT      \\*[$QUOTE_FT]
8669 .          PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
8670 .          LS      \\n[#DOC_LEAD]u
8671 .          LEFT
8672 .          if \\n[#QUOTE_COLOR]=1 \{\
8673 .             nf
8674 \m[\\*[$QUOTE_COLOR]]
8675 .             EL
8676 .          \}
8677 .       \}
8678 .       nr #Q_TOP \\n(nl
8679 .       if \\n[#PRINT_STYLE]=1 \{\
8680 .          if \\n[#UNDERLINE_QUOTES] \{\
8681 .               FT I
8682 .          \}
8683 .       \}
8684 .    \}
8685 .    el \{ .DO_QUOTE \}
8686 .END
8689 \# ---Blockquotes---
8691 \# BLOCKQUOTE FAMILY
8692 \# -----------------
8693 \# *Argument:
8694 \#   <family to use in blockquotes>
8695 \# *Function:
8696 \#   Creates or modifies string $BQUOTE_FAM.
8697 \# *Notes:
8698 \#   Default is same as running text.
8700 .MAC BLOCKQUOTE_FAMILY END
8701 .    ds $BQUOTE_FAM \\$1
8702 .END
8705 \# BLOCKQUOTE FONT
8706 \# ---------------
8707 \# *Argument:
8708 \#   <font to use in blockquotes>
8709 \# *Function:
8710 \#   Creates or modifies string $BQUOTE_FT.
8711 \# *Notes:
8712 \#   Default is same as running text.
8714 .MAC BLOCKQUOTE_FONT END
8715 .    ds $BQUOTE_FT \\$1
8716 .END
8719 \# BLOCKQUOTE SIZE
8720 \# ---------------
8721 \# *Argument:
8722 \#   <-|+ number of points by which to de/increase point size of blockquotes
8723 \#   (relative to running text)>
8724 \# *Function:
8725 \#   Creates or modifies string $BQUOTE_SIZE_CHANGE.
8726 \# *Notes:
8727 \#   Must be preceded by a - or + sign with no space afterwards.
8728 \#   Fractional point sizes are allowed.
8729 \#   Default is -1 for printstyle TYPESET; +0 for TYPEWRITE.
8731 .MAC BLOCKQUOTE_SIZE END
8732 .    ds $BQUOTE_SIZE_CHANGE \\$1
8733 .END
8736 \# BLOCKQUOTE COLOR
8737 \# ----------------
8738 \# *Arguments:
8739 \#   <pre-defined XCOLOR or NEWCOLOR>
8740 \# *Function:
8741 \#   Sets register #BQUOTE_COLOR to 1; defines string
8742 \#   $BQUOTE_COLOR to argument.
8743 \# *Notes:
8744 \#   User must define an XCOLOR or NEWCOLOR before using
8745 \#   BLOCKQUOTE_COLOR.
8747 .MAC BLOCKQUOTE_COLOR END
8748 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
8749 .    nr #BQUOTE_COLOR 1
8750 .    ds $BQUOTE_COLOR \\$1
8751 .END
8754 \# BLOCKQUOTE QUAD
8755 \# ---------------
8756 \# *Arguments:
8757 \#   <quad to use in blockquotes>
8758 \# *Function:
8759 \#   Creates or modifies string $BQUOTE_QUAD.
8760 \# *Notes:
8761 \#   Default is LEFT.
8763 .MAC BLOCKQUOTE_QUAD END
8764 .    ds $BQUOTE_QUAD \\$1
8765 .END
8768 \# BLOCKQUOTE
8769 \# ----------
8770 \# *Arguments:
8771 \#   <none> | <anything>
8772 \# *Function:
8773 \#   Indents quoted text in fill mode and shortens line length
8774 \#   accordingly, or turns BLOCKQUOTE off.
8775 \# *Notes:
8776 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
8777 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
8778 \#   how much space to put before and after.
8780 \#   .PP after blockquote is optional if there's only one para,
8781 \#   but REQUIRED if there's more than one.
8783 .MAC BLOCKQUOTE END
8784 .    br
8785 .    ie '\\$1'' \{\
8786 .       ev BLOCKQUOTE
8787 .       nr #QUOTE    2
8788 .       nr #PP_STYLE 2
8789 .       nr #Q_PP     0
8790 .       di B_QUOTE
8791 .       ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8792 .       if \\n[#ENDNOTE] \{\
8793 .          if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
8794 .             ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8795 .          \}
8796 .          if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
8797 .             ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8798 .          \}
8799 .       \}
8800 .       ta \\n(.lu
8801 .       CHECK_INDENT
8802 .       if \\n[#COLUMNS] \{\
8803 .          ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8804 .          if \\n[#ENDNOTE] \{\
8805 .             if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
8806 .                ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8807 .             \}
8808 .             if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
8809 .                ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8810 .             \}
8811 .          \}
8812 .          ta \\n(.lu
8813 .       \}
8814 .       if \\n[#PRINT_STYLE]=1 \{\
8815 .          fam C
8816 .          ft  R
8817 .          ps  12
8818 .          vs  \\n[#DOC_LEAD]u
8819 .          QUAD LEFT
8820 .          HY OFF
8821 .       \}
8822 .       if \\n[#PRINT_STYLE]=2 \{\
8823 .          FAMILY  \\*[$BQUOTE_FAM]
8824 .          FT      \\*[$BQUOTE_FT]
8825 .          PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
8826 .          LS      \\n[#DOC_LEAD]u
8827 .          if \\n[#ENDNOTE] \{\
8828 .             PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
8829 .          \}
8830 .          if \\n[#BQUOTE_COLOR]=1 \{\
8831 .             nf
8832 \m[\\*[$BQUOTE_COLOR]]
8833 .             EL
8834 .          \}
8835 .          QUAD \\*[$BQUOTE_QUAD]
8836 .          HY
8837 .       \}
8838 .       nr #Q_TOP \\n(nl
8839 .       if \\n[#INDENT_FIRST_PARAS] \{\
8840 .          ie !\\n[#ENDNOTE] \{\
8841 .             if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
8842 .             if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
8843 .          \}
8844 .          el \{\
8845 .             if \\n[#INDENT_FIRSTS]=1 \{\
8846 .                if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
8847 .                if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
8848 .             \}
8849 .          \}
8850 .       \}
8851 .    \}
8852 .    el \{ .DO_QUOTE \}
8853 .END
8856 \# DO QUOTE
8857 \# --------
8858 \# *Arguments:
8859 \#   <none>
8860 \# *Function:
8861 \#   Ends the diversion P_QUOTE or B_QUOTE.  Spaces them according to
8862 \#   PRINTSTYLE, whether there's inter-paragraph spacing, and page
8863 \#   position.  TYPEWRITE treats spacing the same way in all circumstance
8864 \#   (viz. an extra line space).  TYPESET puts in only half
8865 \#   line spaces if the entire quote plus 1 line of body under the quote
8866 \#   fits on the the page; otherwise it puts in a full extra blank
8867 \#   line.  (This is to ensure the page remains bottom aligned).
8869 .MAC DO_QUOTE END
8870 .    di
8871 .    REMOVE_INDENT
8872 .    ev
8873 \#   **Change *1 to *2 in next line to prevent orphans after quotes
8874 .    if \\n[#ENDNOTE] \{\
8875 .       nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
8876 .       ALWAYS_FULLSPACE_QUOTES
8877 .    \}
8878 .    nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
8879 .    if \\n[#PRINT_STYLE]=1 \{\
8880 .       if \\n[#START]=1 \{ . \}
8881 .       if \\n[#START]=0 \{\
8882 .          if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8883 .       \}
8884 .       if \\n[#HEAD] \{\
8885 .          if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
8886 .       \}
8887 .    \}
8888 .    if \\n[#PRINT_STYLE]=2 \{\
8889 .       ie \\n[#PP_SPACE] \{\
8890 .          ie \\n[#HEAD]>0 \{ . \}
8891 .          el \{\
8892 .             ie \\n[#START] \{ . \}
8893 .             el \{ .ALD \\n[#DOC_LEAD]u \}
8894 .          \}
8895 .       \}
8896 .       el \{\
8897 .          ie \\n[#Q_DEPTH]<\\n[#TRAP_DISTANCE] \{\
8898 .             nr #Q_FITS 1
8899 .             ie \\n[#HEAD]=1 \{ . \}
8900 .             el \{\
8901 .                ie \\n[#START] \{ . \}
8902 .                el \{\
8903 .                   ie \\n[#FULLSPACE_QUOTES] \{\
8904 .                      ie \\n[#ENDNOTE] \{\
8905 .                         ALD \\n[#EN_LEAD]u
8906 .                      \}
8907 .                      el \{ .ALD \\n[#DOC_LEAD]u \}
8908 .                   \}
8909 .                   el \{\
8910 .                      ie \\n[#ENDNOTE] \{\
8911 .                         ALD \\n[#EN_LEAD]u/2u
8912 .                      \}
8913 .                      el \{ .ALD \\n[#DOC_LEAD]u/2u \}
8914 .                   \}
8915 .                \}
8916 .             \}
8917 .          \}
8918 .          el \{\
8919 .             rr #Q_FITS
8920 .             ie r#HEAD \{\
8921 .                if \\n[#HEAD]=1 \{ . \}
8922 .             \}
8923 .             el \{\
8924 .                ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
8925 .                el \{ .ALD \\n[#DOC_LEAD]u \}
8926 .             \}
8927 .          \}
8928 .       \}
8929 .    \}
8930 .    nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8931 .    if \\n[#COLUMNS] \{\
8932 .       nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8933 .    \}
8934 .    if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
8935 .    if \\n[#ENDNOTE] \{\
8936 .       in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
8937 .    \}
8938 .    if \\n[#QUOTE]=1 \{\
8939 .       nf
8940 .       P_QUOTE
8941 .       if !\\n[#START] \{ .rr #QUOTE \}
8942 .    \}
8943 .    if \\n[#QUOTE]=2 \{\
8944 .       nf
8945 .       B_QUOTE
8946 .    \}
8947 .    if \\n[#PRINT_STYLE]=1 \{\
8948 .       ALD \\n[#DOC_LEAD]u
8949 .    \}
8950 .    if \\n[#PRINT_STYLE]=2 \{\
8951 .       ie \\n[#START] \{\
8952 .          ie \\n[#PP_SPACE] \{ . \}
8953 .          el \{ .ALD \\n[#DOC_LEAD]u \}
8954 .       \}
8955 .       el \{\
8956 .          ie \\n[#PP_SPACE] \{ . \}
8957 .          el \{\
8958 .             ie \\n[#HEAD]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8959 .             el \{\
8960 .                ie \\n[#Q_FITS] \{\
8961 .                   ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
8962 .                      nr #Q_AT_TOP 1
8963 .                      ALD \\n[#DOC_LEAD]u
8964 .                   \}
8965 .                   el \{\
8966 .                      ie \\n[#FULLSPACE_QUOTES] \{ .ALD \\n[#DOC_LEAD]u \}
8967 .                      el \{ .ALD \\n[#DOC_LEAD]u/2u \}
8968 .                   \}
8969 .                \}
8970 .                el \{ .ALD \\n[#DOC_LEAD]u \}
8971 .             \}
8972 .          \}
8973 .       \}
8974 .    \}
8975 .    if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
8976 .    if r#HEAD     \{ .rr #HEAD     \}
8977 .    if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8978 .    rr #Q_PP
8979 .    rr #LINEBREAK
8980 .    nr #PP_STYLE  1
8981 .    nr #END_QUOTE 1
8982 .    if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
8983 .    if \\n[#ENDNOTE] \{\
8984 .       in \\n[#EN_TEXT_INDENT]u
8985 .    \}
8986 .    if \\n[#COLUMNS] \{\
8987 .       if !\\n[#ENDNOTE] \{\
8988 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8989 .          nr #L_MARGIN \\n(.o
8990 .       \}
8991 .       if \\n[#ENDNOTE] \{\
8992 .          in \\n[#EN_TEXT_INDENT]u
8993 .       \}
8994 .    \}
8995 .    ie !\\n[#ENDNOTE] \{\
8996 .       nr #RESET_PP_INDENT \\n[#PP_INDENT]
8997 .       PARA_INDENT 0
8998 .       PP
8999 .       PARA_INDENT \\n[#RESET_PP_INDENT]u
9000 .       QUAD \\*[$DOC_QUAD]
9001 .    \}
9002 .    el \{\
9003 .       nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
9004 .       ENDNOTE_PARA_INDENT 0
9005 .       PP
9006 .       ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
9007 .       QUAD \\*[EN_QUAD]
9008 .    \}
9009 .END
9011 \# ====================================================================
9013 \# BREAK QUOTE
9014 \# -----------
9015 \# *Arguments:
9016 \#   <none>
9017 \# *Function:
9018 \#   Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
9019 \#   page, and reinvokes BLOCKQUOTE.
9020 \# *Notes:
9021 \#   Because quotes go into a diversion before they're output,
9022 \#   footnotes in quotes that cross pages behave erratically.  The footnote
9023 \#   isn't processed until the diversion ends, hence the footnote
9024 \#   marker in the quote isn't always correct for the new page (it's
9025 \#   picked up from the old one).  BREAK_QUOTE is a workaround for
9026 \#   this problem.
9028 .MAC BREAK_QUOTE END
9029 .    br
9030 .    di
9031 .    nr #BROKEN_QUOTE 1
9032 .    REMOVE_INDENT
9033 .    ev
9034 .    nr #Q_DEPTH \\n[#DIVER_DEPTH]+\\n[#LEAD]
9035 .    if \\n[#PRINT_STYLE]=1 \{\
9036 .       if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
9037 .       if \\n[#HEAD] \{\
9038 .          if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
9039 .       \}
9040 .    \}
9041 .    if \\n[#PRINT_STYLE]=2 \{\
9042 .       ie \\n[#PP_SPACE] \{\
9043 .          ie \\n[#HEAD]=1 \{ . \}
9044 .          el \{\
9045 .             if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
9046 .          \}
9047 .       \}
9048 .       el \{\
9049 .          rr #Q_FITS
9050 .          ie r#HEAD \{\
9051 .             if \\n[#HEAD]=1 \{ . \}
9052 .          \}
9053 .          el \{ .ALD \\n[#DOC_LEAD]u \}
9054 .       \}
9055 .    \}
9056 .    nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9057 .    if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
9058 .    po \\n[#Q_OFFSET]u
9059 .    if \\n[#QUOTE]=1 \{\
9060 .       nf
9061 .       P_QUOTE
9062 .       if !\\n[#START] \{ .rr #QUOTE \}
9063 .    \}
9064 .    if \\n[#QUOTE]=2 \{\
9065 .       nf
9066 .       B_QUOTE
9067 .    \}
9068 .    if r#HEAD     \{ .rr #HEAD     \}
9069 .    if r#EPIGRAPH \{ .rr #EPIGRAPH \}
9070 .    rr #Q_PP
9071 .    rr #LINEBREAK
9072 .    nr #PP_STYLE  1
9073 .    nr #END_QUOTE 1
9074 .    if \\n[#PRINT_STYLE]=1 \{\
9075 .       if \\n[#UNDERLINE_QUOTES] \{\
9076 .          UNDERLINE OFF
9077 .       \}
9078 .    \}
9079 .    po \\n[#L_MARGIN]u
9080 .    if \\n[#COLUMNS] \{\
9081 .       po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9082 .       nr #L_MARGIN \\n(.o
9083 .    \}
9084 .    QUAD \\*[$DOC_QUAD]
9085 .    sp |\\n[#PAGE_LENGTH]u  \" To trip footer/header
9086 .    BLOCKQUOTE
9087 .END
9089 \# ====================================================================
9091 \# +++PAGINATION+++
9093 \# PAGINATE
9094 \# --------
9095 \# *Arguments:
9096 \#   <none> | <anything>
9097 \# *Function:
9098 \#   Turns page numbering off or on during document processing.
9099 \# *Notes:
9100 \#   Default is on.
9102 .MAC PAGINATE END
9103 .    ie '\\$1'' \{ .nr #PAGINATE 1 \}
9104 .    el \{ .nr #PAGINATE 0 \}
9105 .END
9108 \# SUSPEND PAGINATION (before ENDNOTES)
9109 \# ------------------
9110 \# *Argument:
9111 \#   <none>
9112 \# *Function:
9113 \#   Creates register #SUSPEND_PAGINATION
9114 \# *Notes:
9115 \#   Useful only to suspend pagination before outputting endnotes.
9117 .MAC SUSPEND_PAGINATION END
9118 .    nr #SUSPEND_PAGINATION 1
9119 .END
9121 \# RESTORE PAGINATION (after ENDNOTES)
9122 \# ------------------
9123 \# *Argument:
9124 \#   <none>
9125 \# *Function:
9126 \#   Removes register #SUSPEND_PAGINATION.  Creates register
9127 \#   #DEFER_PAGINATION
9128 \# *Notes:
9129 \#   Useful only to restore pagination after outputting endnotes.
9131 .MAC RESTORE_PAGINATION END
9132 .    rr #SUSPEND_PAGINATION
9133 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .PAGINATE \}
9134 .    if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #DEFER_PAGINATION 1 \}
9135 .END
9138 \# PAGENUMBER FAMILY
9139 \# -----------------
9140 \# *Argument:
9141 \#   <family to use for page numbers>
9142 \# *Function:
9143 \#   Creates or modifies string $PAGE_NUM_FAM.
9144 \# *Notes:
9145 \#   Default is same as running text.
9147 .MAC PAGENUM_FAMILY END
9148 .    ds $PAGE_NUM_FAM \\$1
9149 .END
9152 \# PAGE NUMBER FONT
9153 \# ----------------
9154 \# *Arguments:
9155 \#   <font to use for page numbers>
9156 \# *Function:
9157 \#   Creates or modifies string $PAGE_NUM_FT.
9158 \# *Notes:
9159 \#   Default is same as running text.
9161 .MAC PAGENUM_FONT END
9162 .    ds $PAGE_NUM_FT \\$1
9163 .END
9166 \# PAGE NUMBER SIZE
9167 \# ----------------
9168 \# *Argument:
9169 \#   <+|- number of points by which to in/decrease point size of
9170 \#   page numbers (relative to running text)>
9171 \# *Function:
9172 \#   Creates or modifies string $PAGE_NUM_SIZE_CHANGE.
9173 \# *Notes:
9174 \#   Must be preceded by a +|- sign with no space afterward.
9175 \#   Fractional point sizes are allowed.
9176 \#   Default is +0.
9178 .MAC PAGENUM_SIZE END
9179 .    ds $PAGE_NUM_SIZE_CHANGE \\$1
9180 .END
9183 \# PAGNUMBER COLOR
9184 \# ---------------
9185 \# *Arguments:
9186 \#   <pre-defined XCOLOR or NEWCOLOR>
9187 \# *Function:
9188 \#   Defines string $PAGENUM_COLOR to argument.
9189 \# *Notes:
9190 \#   User must define an XCOLOR or NEWCOLOR before using
9191 \#   PAGENUM_COLOR.
9193 .MAC PAGENUM_COLOR END
9194 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
9195 .    ds $PAGENUM_COLOR \\$1
9196 .END
9199 \# PAGE NUMBER FORMAT
9200 \# ------------------
9201 \# *Arguments:
9202 \#   DIGIT | ROMAN | roman | ALPHA | alpha
9203 \# *Function:
9204 \#   Assigns user entered format to #PAGENUMBER.
9206 .MAC PAGENUM_STYLE END
9207 .    nr #PAGENUM_STYLE_SET 1
9208 .    if '\\$1'DIGIT'  \{\
9209 .       ds $PAGENUM_STYLE \\$1
9210 .       af #PAGENUMBER 1
9211 .    \}
9212 .    if '\\$1'ROMAN'  \{\
9213 .       ds $PAGENUM_STYLE \\$1
9214 .       af #PAGENUMBER I
9215 .    \}
9216 .    if '\\$1'roman'  \{\
9217 .       ds $PAGENUM_STYLE \\$1
9218 .       af #PAGENUMBER i
9219 .    \}
9220 .    if '\\$1'ALPHA'  \{\
9221 .       ds $PAGENUM_STYLE \\$1
9222 .       af #PAGENUMBER A
9223 .    \}
9224 .    if '\\$1'alpha'  \{\
9225 .       ds $PAGENUM_STYLE \\$1
9226 .       af #PAGENUMBER a
9227 .    \}
9228 .END
9231 \# HYPHENS AROUND PAGE NUMBERS
9232 \# ---------------------------
9233 \# *Arguments:
9234 \#   <none> | <anything>
9235 \# *Function:
9236 \#   Creates or modifies register #PAGE_NUM_HYPHENS.
9237 \#   Used to dis/enable hyphens on either side of page numbers.
9238 \# *Notes:
9239 \#   Default is on.
9241 .MAC PAGENUM_HYPHENS END
9242 .    nr #PAGE_NUM_HYPHENS_SET 1
9243 .    ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
9244 .    el \{ .rr #PAGE_NUM_HYPHENS   \}
9245 .END
9248 \# PAGENUMBER POSITION
9249 \# -------------------
9250 \# *Arguments:
9251 \#   TOP | BOTTOM  LEFT | CENTER | RIGHT
9252 \# *Function:
9253 \#   Creates or modifies various PAGE_NUM_H | V_POS registers.
9254 \#   Used to position page numbers.
9255 \# *Notes:
9256 \#   Default is center/bottom.
9258 .MAC PAGENUM_POS END
9259 .    nr #PAGE_NUM_POS_SET 1
9260 .    if '\\$1'TOP'    \{ .nr #PAGE_NUM_V_POS 1 \}
9261 .    if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
9262 .    if '\\$2'LEFT'   \{ .nr #PAGE_NUM_H_POS 1 \}
9263 .    if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
9264 .    if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
9265 .    if '\\$2'RIGHT'  \{ .nr #PAGE_NUM_H_POS 3 \}
9266 .END
9269 .MAC PN_WITH_HYPHENS END
9270 .    nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
9271 .    ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
9272 .    PRINT \m[\\*[$PAGENUM_COLOR]]\\*[$HYPHEN]\|\\n[#PAGENUMBER]\|\\*[$HYPHEN]
9273 .END
9276 \# PRINT PAGE NUMBER
9277 \# -----------------
9278 \# *Arguments:
9279 \#   <none>
9280 \# *Function:
9281 \#   Prints page number if PAGINATE=1.
9283 .MAC PRINT_PAGE_NUMBER END
9284 .    ev PAGENUMBER
9285 .    nf
9286 .    na
9287 .    po \\n[#DOC_L_MARGIN]u
9288 .    ll \\n[#DOC_L_LENGTH]u
9289 .    ta \\n(.lu
9290 .    FAMILY  \\*[$PAGE_NUM_FAM]
9291 .    FT      \\*[$PAGE_NUM_FT]
9292 .    PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
9293 .    if \\n[#PRINT_STYLE]=1 \{\
9294 .       fam C
9295 .       ft  R
9296 .       ps 12
9297 .    \}
9298 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .EL \}
9299 .    if o \{\
9300 .       ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT  \}
9301 .       el                        \{ .RIGHT \}
9302 .    \}
9303 .    if e \{\
9304 .       ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT  \}
9305 .       el                        \{ .LEFT   \}
9306 .    \}
9307 .    if \\n[#PAGE_NUM_H_POS]=2    \{ .CENTER \}
9308 .    if \\n[#RECTO_VERSO]=0 \{\
9309 .       if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT   \}
9310 .       if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
9311 .       if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT  \}
9312 .    \}
9313 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
9314 .    if \\n[#EN_FIRST_PAGE] \{\
9315 .       if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
9316 .       rr #EN_FIRST_PAGE
9317 .    \}
9318 .    if \\n[#TOC_FIRST_PAGE] \{\
9319 .       PAGENUMBER 1
9320 .       rr #TOC_FIRST_PAGE
9321 .    \}
9322 .    ie \\n[#DRAFT_WITH_PAGENUM] \{\
9323 .       ie '\\*[$REVISION]'' \{\
9324 .          PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT] / \\n[#PAGENUMBER]"
9325 .       \}
9326 .       el \{\
9327 .          ie '\\*[$DRAFT]'' \{\
9328 .             PRINT "\\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
9329 .          \}
9330 .          el \{\
9331 .             PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT], \\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
9332 .          \}
9333 .       \}
9334 .    \}
9335 .    el \{\
9336 .       ie \\n[#PAGE_NUM_HYPHENS] \{\
9337 .          if '\\*[$PAGENUM_STYLE]'DIGIT' \{\
9338 .             di NULL
9339 1\\R'#CAP_HEIGHT \\n[.cht]'
9340 .             di
9341 .             PN_WITH_HYPHENS
9342 .          \}
9343 .          if '\\*[$PAGENUM_STYLE]'ROMAN' \{\
9344 .             di NULL
9345 I\\R'#CAP_HEIGHT \\n[.cht]'
9346 .             di
9347 .             PN_WITH_HYPHENS
9348 .          \}
9349 .          if '\\*[$PAGENUM_STYLE]'ALPHA' \{\
9350 .             di NULL
9351 E\\R'#CAP_HEIGHT \\n[.cht]'
9352 .             di
9353 .             PN_WITH_HYPHENS
9354 .          \}
9355 .          if '\\*[$PAGENUM_STYLE]'roman' \{\
9356 .             PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
9357 .          \}
9358 .          if '\\*[$PAGENUM_STYLE]'alpha' \{\
9359 .             PRINT "\m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-"
9360 .          \}
9361 .       \}
9362 .       el \{ .PRINT "\m[\\*[$PAGENUM_COLOR]]\\n[#PAGENUMBER]" \}
9363 .    \}
9364 .    ev
9365 .END
9367 \# ====================================================================
9369 \# +++FOOTNOTES+++
9371 \# FOOTNOTE FAMILY
9372 \# --------------
9373 \# *Argument:
9374 \#   <family to use in footnotes>
9375 \# *Function:
9376 \#   Creates or modifies string $FN_FAM.
9377 \# *Notes:
9378 \#   Default is same as running text.
9380 .MAC FOOTNOTE_FAMILY END
9381 .    ds $FN_FAM \\$1
9382 .END
9385 \# FOOTNOTE FONT
9386 \# --------------
9387 \# *Argument:
9388 \#   <font to use in footnotes>
9389 \# *Function:
9390 \#   Creates or modifies string $FN_FT.
9391 \# *Notes:
9392 \#   Default is roman.
9394 .MAC FOOTNOTE_FONT END
9395 .    ds $FN_FT \\$1
9396 .END
9399 \# FOOTNOTE SIZE
9400 \# ------------
9401 \# *Argument:
9402 \#   <+|- number of points by which to in/decrease point size of footnotes
9403 \#   (relative to running text)>
9404 \# *Function:
9405 \#   Creates or modifies string $FN_SIZE_CHANGE.
9406 \# *Notes:
9407 \#   Must be preceded by a +|- sign.  No space afterwards.
9408 \#   Fractional point sizes are allowed.
9409 \#   Default is -2 for printstyle TYPESET; +0 for TYPEWRITE.
9411 .MAC FOOTNOTE_SIZE END
9412 .    ds $FN_SIZE_CHANGE \\$1
9413 .END
9416 \# FOOTNOTE COLOR
9417 \# --------------
9418 \# *Arguments:
9419 \#   <pre-defined XCOLOR or NEWCOLOR>
9420 \# *Function:
9421 \#   Sets register #FOOTNOTE_COLOR to 1; defines string
9422 \#   $FOOTNOTE_COLOR to argument.
9423 \# *Notes:
9424 \#   User must define an XCOLOR or NEWCOLOR before using
9425 \#   FOOTNOTE_COLOR.
9427 .MAC FOOTNOTE_COLOR END
9428 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
9429 .    nr #FOOTNOTE_COLOR 1
9430 .    ds $FOOTNOTE_COLOR \\$1
9431 .END
9434 \# FOOTNOTE AUTOLEAD
9435 \# -----------------
9436 \# *Arguments:
9437 \#   <autolead value for footnotes>
9438 \# *Function:
9439 \#   Creates or modifies register #FN_AUTOLEAD.
9440 \# *Notes:
9441 \#   Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
9443 .MAC FOOTNOTE_AUTOLEAD END
9444 .    nr #FN_AUTOLEAD \\$1
9445 .END
9448 \# FOOTNOTE QUAD
9449 \# -------------
9450 \# *Arguments:
9451 \#   <quad to use in footnotes>
9452 \# *Function:
9453 \#   Creates or modifies string $FN_QUAD.
9454 \# *Notes:
9455 \#   Default is same as running text.
9457 .MAC FOOTNOTE_QUAD END
9458 .    ds $FN_QUAD \\$1
9459 .END
9462 \# FOOTNOTE MARKERS
9463 \# ----------------
9464 \# *Arguments:
9465 \#   <none> | <anything>
9466 \# *Function:
9467 \#   Turns generation of footnote markers on or off.
9468 \# *Notes:
9469 \#   Default is on.
9471 .MAC FOOTNOTE_MARKERS END
9472 .    ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
9473 .    el \{ .nr #FN_MARKERS 0 \}
9474 .END
9477 \# FOOTNOTE MARKER STYLE
9478 \# ---------------------
9479 \# *Arguments:
9480 \#   STAR | NUMBER
9481 \# *Function:
9482 \#   Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
9483 \#   the style of footnote markers.
9484 \# *Notes:
9485 \#   1=STAR; 2=NUMBER.  Default is STAR.
9487 .MAC FOOTNOTE_MARKER_STYLE END
9488 .    if '\\$1'STAR' \{\
9489 .       nr #FN_MARKER_STYLE 1
9490 .    \}
9491 .    if '\\$1'NUMBER' \{\
9492 .       nr #FN_MARKER_STYLE 2
9493 .    \}
9494 .END
9497 \# RESET FOOTNOTE NUMBER
9498 \# ---------------------
9499 \# *Arguments:
9500 \#   <none> | PAGE
9501 \# *Function:
9502 \#   Resets register #FN_NUMBER to 1.  If argument is PAGE, creates
9503 \#   toggle #RESET_FN_NUMBER which is checked in HEADER.  If 1,
9504 \#   numbered footnotes on every page start at 1.
9506 .MAC RESET_FOOTNOTE_NUMBER END
9507 .    ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
9508 .    el \{ .nr #RESET_FN_NUMBER 1 \}
9509 .END
9512 \# FOOTNOTE RULE LENGTH
9513 \# --------------------
9514 \# *Arguments:
9515 \#   <length of rule used to separate footnotes from running text>
9516 \# *Function:
9517 \#   Creates or modifies registers #FN_RULE_LENGTH.
9518 \# *Notes:
9519 \#   Requires unit of measure (iPpcm).
9520 \#   Default is 4P for both PRINTSTYLEs.
9522 .MAC FOOTNOTE_RULE_LENGTH END
9523 .    nr #FN_RULE_LENGTH (\\$1)
9524 .END
9527 \# FOOTNOTE_RULE_ADJ
9528 \# -----------------
9529 \# *Arguments:
9530 \#   <number of points to raise footnote rule from it's baseline position>
9531 \# *Function:
9532 \#   Creates or modifies register #FN_RULE_ADJ.
9533 \# *Notes:
9534 \#   Default is 3p for both TYPESTYLES.
9536 \#   Requires unit of measure.
9538 .MAC FOOTNOTE_RULE_ADJ END
9539 .    nr #FN_RULE_ADJ (\\$1)
9540 .END
9543 \# FOOTNOTE RULE
9544 \# -------------
9545 \# *Arguments:
9546 \#   <none> | <anything>
9547 \# *Function:
9548 \#   Turns printing of footnote separator rule on or off.  If invoked as
9549 \#   PRINT_FOOTNOTE_RULE, prints footnote separator rule.
9550 \# *Notes:
9551 \#   Default is on.
9553 \#   Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
9554 \#   if the footnote number (#FN_COUNT) is 1.
9556 .MAC FOOTNOTE_RULE END
9557 .    ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
9558 .       if \\n[#FN_RULE]=0 \{ .RLD 1v \}
9559 \!.     PT_SIZE 12  \"Not sure why these have to be transparently embedded, but they do.
9560 .       RLD 1v
9561 .       LEFT
9562 .       PRINT \\v'-\\n[#FN_RULE_ADJ]u'\\l'\\n[#FN_RULE_LENGTH]u'\\v'+\\n[#FN_RULE_ADJ]u'
9563 \!.     PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
9564 .       QUAD \\*[$FN_QUAD]
9565 .    \}
9566 .    el \{\
9567 .       ie '\\$1'' \{ .nr #FN_RULE 1 \}
9568 .       el \{ .nr #FN_RULE 0 \}
9569 .    \}
9570 .END
9573 \# FOOTNOTE
9574 \# --------
9575 \# *Arguments:
9576 \#   <none> | INDENT  L|LEFT|R|RIGHT|B|BOTH  <indent value> > | <anything>
9577 \# *Function:
9578 \#   Begins collecting and diverting footnote text if no argument
9579 \#   given.  Otherwise, ends diversion FOOTNOTES, measures footnote
9580 \#   depth, and sets footnote trap.
9581 \# *Notes:
9582 \#   The input line preceding a footnote call MUST terminate with \c
9583 \#   or the footnote marker will be spaced away from the word it
9584 \#   should be joined to.
9586 \#   If FOOTNOTES is invoked with INDENT, the footnote will
9587 \#   be indented.  An indent style and an indent value must be given.
9588 \#   Subsequent footnotes will NOT be indented; INDENT must be given
9589 \#   for each footnote the user wants indented.
9591 .MAC FOOTNOTE END
9592 .    ie '\\$1'' \{\
9593 .       if \\n[#FN_MARKERS] \{\
9594 .          if \\n[#CONDENSE] \{ \*[CONDX]\c \}
9595 .          if \\n[#EXTEND]   \{ \*[EXTX]\c  \}
9596 .          if \\n[#PRINT_STYLE]=1 \{\
9597 .             if \\n[#UNDERLINE_ON] \{\
9598 .                nr #UNDERLINE_WAS_ON 1
9599 .                UNDERLINE OFF
9600 .             \}
9601 .          \}
9602 .          if !\\n[#NO_FN_MARKER] \{\
9603 .             if \\n[#FN_MARKER_STYLE]=1 \{\
9604 .                ie \\n[#FN_COUNT_FOR_COLS] \{\
9605 .                   if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU3]* \}
9606 .                   if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU3]\(dg \}
9607 .                   if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \*[BU3]** \}
9608 .                   if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
9609 .                   if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU3]*** \}
9610 .                   if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
9611 .                   if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU3]**** \}
9612 .                   if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
9613 .                   if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \*[BU3]***** \}
9614 .                   if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg \}
9615 .                \}
9616 .                el \{\
9617 .                   if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU3]* \}
9618 .                   if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU3]\(dg \}
9619 .                   if \\n[#FN_COUNT]=2 \{ .PRINT \*[BU3]** \}
9620 .                   if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
9621 .                   if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU3]*** \}
9622 .                   if \\n[#FN_COUNT]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
9623 .                   if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU3]**** \}
9624 .                   if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
9625 .                   if \\n[#FN_COUNT]=8 \{ .PRINT \*[BU3]***** \}
9626 .                   if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg\(dg \}
9627 .                \}
9628 .             \}
9629 .             if \\n[#FN_MARKER_STYLE]=2 \{\
9630 .                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" \}
9631 .                if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]" \}
9632 .             \}
9633 .          \}
9634 .       \}
9635 .       nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-(\\n(nl+1v)
9636 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
9637 .       nr #PP_STYLE 2
9638 .       if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
9639 .       INDENT_FIRST_PARAS
9640 .       ev FOOTNOTES
9641 .       ll \\n[#DOC_L_LENGTH]u
9642 .       ta \\n(.lu
9643 .       if \\n[#COLUMNS] \{\
9644 .          ll \\n[#COL_L_LENGTH]u
9645 .          ta \\n(.lu
9646 .       \}
9647 .       if \\n[#FN_R_INDENT]  \{\
9648 .          ll -\\n[#FN_R_INDENT]u
9649 .          ta \\n(.lu
9650 .       \}
9651 .       if \\n[#FN_BR_INDENT] \{\
9652 .          ll -\\n[#FN_BR_INDENT]u
9653 .          ta \\n(.lu
9654 .       \}
9655 .       FAMILY   \\*[$FN_FAM]
9656 .       FT       \\*[$FN_FT]
9657 .       PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
9658 .       AUTOLEAD \\n[#FN_AUTOLEAD]
9659 .       QUAD     \\*[$FN_QUAD]
9660 .       if \\n[#PRINT_STYLE]=1 \{\
9661 .          fam C
9662 .          ft  R
9663 .          ps 12
9664 .          ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
9665 .          el \{ .vs \\n[#DOC_LEAD]u/2u \}
9666 .          QUAD LEFT
9667 .          HY OFF
9668 .       \}
9669 .       nr #FN_LEAD \\n[#LEAD]
9670 .       da FOOTNOTES
9671 .          if \\n[#FOOTNOTE_COLOR]=1 \{\
9672 .             TRAP OFF
9673 .             nf
9674 \m[\\*[$FOOTNOTE_COLOR]]
9675 .             EL
9676 .             fi
9677 .             TRAP
9678 .          \}
9679 .       if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
9680 .       if \\n[#FN_DEFER_SPACE] \{\
9681 .          if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
9682 .          if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
9683 .          rr #FN_DEFER_SPACE
9684 .       \}
9685 .       if \\n+[#FN_COUNT]=1 \{\
9686 .          if !\\n[#FN_DEPTH] \{\
9687 .             if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
9688 .             ie \\n[#FN_RULE] \{ .PRINT_FOOTNOTE_RULE \}
9689 .             el \{ .ALD 1v \}
9690 .          \}
9691 .       \}
9692 .       if \\n[#FN_MARKERS] \{\
9693 .          if !\\n[#NO_FN_MARKER] \{\
9694 .             if \\n[#FN_MARKER_STYLE]=1 \{\
9695 .                ie \\n+[#FN_COUNT_FOR_COLS] \{\
9696 .                   if \\n[#FN_COUNT_FOR_COLS]=1  \{ .PRINT *\c \}
9697 .                   if \\n[#FN_COUNT_FOR_COLS]=2  \{ .PRINT \(dg\c \}
9698 .                   if \\n[#FN_COUNT_FOR_COLS]=3  \{ .PRINT **\c \}
9699 .                   if \\n[#FN_COUNT_FOR_COLS]=4  \{ .PRINT \(dg\(dg\c \}
9700 .                   if \\n[#FN_COUNT_FOR_COLS]=5  \{ .PRINT ***\c \}
9701 .                   if \\n[#FN_COUNT_FOR_COLS]=6  \{ .PRINT \(dg\(dg\(dg\c \}
9702 .                   if \\n[#FN_COUNT_FOR_COLS]=7  \{ .PRINT ****\c \}
9703 .                   if \\n[#FN_COUNT_FOR_COLS]=8  \{ .PRINT \(dg\(dg\(dg\(dg\c \}
9704 .                   if \\n[#FN_COUNT_FOR_COLS]=9  \{ .PRINT *****\c \}
9705 .                   if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
9706 .                \}
9707 .                el \{\
9708 .                   if \\n[#FN_COUNT]=1  \{ .PRINT *\c \}
9709 .                   if \\n[#FN_COUNT]=2  \{ .PRINT \(dg\c \}
9710 .                   if \\n[#FN_COUNT]=3  \{ .PRINT **\c \}
9711 .                   if \\n[#FN_COUNT]=4  \{ .PRINT \(dg\(dg\c \}
9712 .                   if \\n[#FN_COUNT]=5  \{ .PRINT ***\c \}
9713 .                   if \\n[#FN_COUNT]=6  \{ .PRINT \(dg\(dg\(dg\c \}
9714 .                   if \\n[#FN_COUNT]=7  \{ .PRINT ****\c \}
9715 .                   if \\n[#FN_COUNT]=8  \{ .PRINT \(dg\(dg\(dg\(dg\c \}
9716 .                   if \\n[#FN_COUNT]=9  \{ .PRINT *****\c \}
9717 .                   if \\n[#FN_COUNT]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
9718 .                \}
9719 .             \}
9720 .             if \\n[#FN_MARKER_STYLE]=2 \{\
9721 .                if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
9722 .                if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\c" \}
9723 .             \}
9724 .          \}
9725 .       \}
9726 .    \}
9727 .    el \{\
9728 .       ie '\\$1'INDENT' \{\
9729 .          ev FOOTNOTES
9730 .          if '\\$2'L'     \{ .in (\\$3)  \}
9731 .          if '\\$2'LEFT'  \{ .in (\\$3)  \}
9732 .          if '\\$2'R'     \{ .nr #FN_R_INDENT (\\$3) \}
9733 .          if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
9734 .          if '\\$2'B' \{\
9735 .             nr #FN_BL_INDENT (\\$3)
9736 .             ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
9737 .             el \{ .nr #FN_BR_INDENT (\\$4) \}
9738 .             in \\n[#FN_BL_INDENT]u
9739 .          \}
9740 .          if '\\$2'BOTH' \{\
9741 .             nr #FN_BL_INDENT (\\$3)
9742 .             ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
9743 .             el \{ .nr #FN_BR_INDENT (\\$4) \}
9744 .             in \\n[#FN_BL_INDENT]u
9745 .          \}
9746 .          ev
9747 .          FOOTNOTE
9748 .       \}
9749 .       el \{\
9750 .          br
9751 .          di
9752 .          in 0 \"Turn off indent possibly set by FOOTNOTE INDENT...
9753 .          if \\n[#PRINT_STYLE]=1 \{\
9754 .             if \\n[#UNDERLINE_WAS_ON] \{\
9755 .                UNDERLINE
9756 .                rr #UNDERLINE_WAS_ON
9757 .             \}
9758 .          \}
9759 .          ev
9760 .          rr #FN_R_INDENT
9761 .          rr #FN_BR_INDENT
9762 .          nr #PP_STYLE \\n[#PP_STYLE_PREV]
9763 .          if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
9764 .          rr #INDENT_FIRSTS
9765 .          nr #FN_DEPTH +\\n[#DIVER_DEPTH]
9766 .          if \\n[#FN_DEFER] \{\
9767 .             nr #FN_DEFER_SPACE 1
9768 .             rr #FN_DEFER
9769 .          \}
9770 .          if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
9771 .             ie \\n[#SPACE_REMAINING]<(\\n[#LEAD]*2) \{ .nr #FN_DEFER 1 \}
9772 .             el \{\
9773 .                nr #FN_LINES 0 1
9774 .                while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
9775 .                   nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
9776 .                \}
9777 .             \}
9778 .          \}
9779 .          nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
9780 .          if \\n[#FN_COUNT]=1 \{ .nr #VARIABLE_FOOTER_POS -1v \}
9781 .       \}
9782 .       ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
9783 .       if (\\n(nl+1v)>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
9784 .          ch FOOTER \\n(nlu+1v
9785 .       \}
9786 .       if \\n[#FN_DEFER] \{\
9787 .          nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
9788 .          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
9789 .       \}
9790 .    \}
9791 .    nr #NO_FN_MARKER 0
9792 .END
9795 .MAC FN_OVERFLOW_TRAP END
9796 .    if \\n[#FN_COUNT] \{\
9797 .       di FN_OVERFLOW
9798 .     \}
9799 .END
9802 .MAC DIVERT_FN_LEFTOVER END
9803 .    nr #NO_FN_MARKER 1
9804 .    nr #OVERFLOW 1
9805 .    FOOTNOTE
9806 .    nf
9807 .    FN_OVERFLOW
9808 .    FOOTNOTE OFF
9809 .    rr #FN_OVERFLOW_DEPTH
9810 .END
9813 .MAC PROCESS_FN_LEFTOVER END
9814 .    if !\\n[#FN_DEFER] \{\
9815 .       nr #FN_COUNT 0 1
9816 .       nr #FN_DEPTH 0
9817 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
9818 .    \}
9819 .    if \\n[#FN_DEFER] \{\
9820 .       nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]+\\n[#DOC_LEAD])
9821 .    \}
9822 .    nr #SPACE_REMAINING 0
9823 .    ch FOOTER -\\n[#B_MARGIN]u
9824 .    if \\n[#FN_DEFER] \{\
9825 .       nr #NO_FN_MARKER 1
9826 .       da FOOTNOTES
9827 .       di
9828 .       FOOTNOTE
9829 .       nf
9830 .       FOOTNOTE OFF
9831 .    \}
9832 .    if !\\n[#FN_DEFER] \{\
9833 .       if \\n[#FN_OVERFLOW_DEPTH] \{\
9834 .           DIVERT_FN_LEFTOVER
9835 .       \}
9836 .    \}
9837 .    nr #FN_COUNT 0 1
9838 .END
9841 \# ====================================================================
9843 \# +++ENDNOTES+++
9845 \# When endnotes are output, the spacing between the notes is always 1
9846 \# extra linespace.  This can have bottom margin consequences.  If this
9847 \# doesn't bother you, don't worry about it.  If it does bother you, and
9848 \# you want to adjust the spacing between any two endnotes (as they're
9849 \# output), make the spacing adjustments (.ALD/.RLD) at the *end* of
9850 \# endnotes (i.e. just before .ENDNOTE OFF), not at the top.
9852 \# Endnotes must be output manually with .ENDNOTES.  This allows user
9853 \# the flexibility to output endnotes at the end of each collated
9854 \# document, or to output them at the end of the entire document.
9856 \# ENDNOTE FAMILY
9857 \# --------------
9858 \# *Argument:
9859 \#   <family to use in endnotes>
9860 \# *Function:
9861 \#   Creates or modifies string $EN_FAM.
9862 \# *Notes:
9863 \#   Default is same as running text in body of document.
9865 .MAC ENDNOTE_FAMILY END
9866 .    ds $EN_FAM \\$1
9867 .END
9870 \# ENDNOTE FONT
9871 \# ------------
9872 \# *Argument:
9873 \#   <font to use in endnotes>
9874 \# *Function:
9875 \#   Creates or modifies string $EN_FT.
9876 \# *Notes:
9877 \#   Default is roman.
9879 .MAC ENDNOTE_FONT END
9880 .    ds $EN_FT \\$1
9881 .END
9884 \# ENDNOTE POINT SIZE
9885 \# ------------------
9886 \# *Argument:
9887 \#   <base point size for endnotes>
9888 \# *Function:
9889 \#   Creates or modifies register #EN_PS.
9890 \# *Notes:
9891 \#   Default is same as running text in body of document.
9893 \#   This size control macro differs from other size control macros
9894 \#   in that it sets an absolute point size, not a relative one.  This
9895 \#   is because a) endnotes always appear separate from the body of
9896 \#   a document and therefore don't need to be relative to the body
9897 \#   of the document, and b) there are quite a few elements of the
9898 \#   endnotes page(s) that need to be relative to the base point size
9899 \#   of that page.  If the base endnote point size were relative to
9900 \#   the body of the document (i.e. a _SIZE macro taking a +|- value)
9901 \#   getting the rest of the endnote elements sized properly could
9902 \#   become very confusing.
9904 .MAC ENDNOTE_PT_SIZE END
9905 .    nr #EN_PS (p;\\$1)
9906 .END
9909 \# ENDNOTE LEAD
9910 \# ------------
9911 \# *Argument:
9912 \#   <base leading to use in endnotes> [ ADJUST ]
9913 \# *Function:
9914 \#   Creates or modifies register #EN_LEAD.  Creates or removes
9915 \#   register #ADJ_EN_LEAD.  Stores arguments in strings if ENDNOTE_LEAD
9916 \#   set before START.
9917 \# *Notes:
9918 \#   Default is 14 points for TYPESET, adjusted; 24 for TYPEWRITE.
9920 .MAC ENDNOTE_LEAD END
9921 .    if !\\n[#OK_PROCESS_LEAD] \{\
9922 .       ds $EN_LEAD \\$1
9923 .       if !'\\$2'' \{\
9924 .           ds $ADJUST_EN_LEAD \\$2
9925 .       \}
9926 .       return
9927 .    \}
9928 .    rr #ADJ_EN_LEAD
9929 .    nr #EN_LEAD (p;\\$1)
9930 .    if '\\$2'ADJUST' \{\
9931 .       nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
9932 .       nr #ADJ_DOC_LEAD 1
9933 .       nr #ADJ_EN_LEAD 1
9934 .       nr #NO_TRAP_RESET 1
9935 .       DOC_LEAD \\n[#EN_LEAD]u ADJUST
9936 .       nr #EN_LEAD \\n[#DOC_LEAD]
9937 .       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
9938 .       rr #NO_TRAP_RESET
9939 .       rr #ADJ_DOC_LEAD
9940 .       rr #ORIG_DOC_LEAD
9941 .    \}
9942 .END
9945 \# ENDNOTE QUAD
9946 \# ------------
9947 \# *Argument:
9948 \#   LEFT | L | CENTER | C | RIGHT | R | JUSTIFY | J
9949 \# *Function:
9950 \#   Creates or modifies string $EN_QUAD.
9951 \# *Notes:
9952 \#   Default is justified for TYPESET, left for TYPEWRITE.
9954 .MAC ENDNOTE_QUAD END
9955 .    ds $EN_QUAD \\$1
9956 .END
9959 \# ENDNOTES_HDRFTR_CENTER
9960 \# ----------------------
9961 \# *Argument:
9962 \#   toggle
9963 \# *Function:
9964 \#   Creates or removes toggle register #EN_HDRFTR_CENTER, used to
9965 \#   determine whether mom should print a/the hdrftr center string
9966 \#   on the endnotes page.  Primarily to enable/disable printing of the
9967 \#   chapter name in hdrftrs when DOCTYPE CHAPTER.
9968 \# *Notes:
9969 \#   Default is OFF
9971 .MAC ENDNOTES_HDRFTR_CENTER END
9972 .    ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
9973 .    el         \{ .rr #EN_HDRFTR_CENTER   \}
9974 .END
9977 \# ENDNOTE STRING 
9978 \# --------------
9979 \# *Argument:
9980 \#   <title for endnotes page>
9981 \# *Function:
9982 \#   Creates or modifies string $EN_STRING.
9983 \# *Notes:
9984 \#   Default is "Endnotes"
9986 .MAC ENDNOTE_STRING END
9987 .    ds $EN_STRING \\$1
9988 .END
9991 \# ENDNOTE STRING FAMILY
9992 \# ---------------------
9993 \# *Argument:
9994 \#   <family to use for endnote string>
9995 \# *Function:
9996 \#   Creates or modifies string $EN_STRING_FAM.
9997 \# *Notes:
9998 \#   Default is same as running text in body of document.
10000 .MAC ENDNOTE_STRING_FAMILY END
10001 .    ds $EN_STRING_FAM \\$1
10002 .END
10005 \# ENDNOTE STRING FONT
10006 \# -------------------
10007 \# *Argument:
10008 \#   <font to use for endnote string>
10009 \# *Function:
10010 \#   Creates or modifies string $EN_FT.
10011 \# *Notes:
10012 \#   Default is BOLD for TYPEWRITE; roman for TYPESET
10014 .MAC ENDNOTE_STRING_FONT END
10015 .    ds $EN_STRING_FT \\$1
10016 .END
10019 \# ENDNOTE STRING SIZE
10020 \# -------------------
10021 \# *Argument:
10022 \#   <+|- number of points by which to in/decrease endnote string
10023 \#    (relative to base endnote size)>
10024 \# *Function:
10025 \#   Creates or modifies string $EN_STRING_SIZE_CHANGE.
10026 \# *Notes:
10027 \#   Default is +1 for TYPESET.
10029 .MAC ENDNOTE_STRING_SIZE END \"Default for TYPESET is +1
10030 .    ds $EN_STRING_SIZE_CHANGE \\$1
10031 .END
10034 \# ENDNOTE STRING QUAD
10035 \# -------------------
10036 \# *Argument:
10037 \#   LEFT | L | CENTER | C | RIGHT | R
10038 \# *Function:
10039 \#   Creates or modifies string $EN_STRING_QUAD.
10040 \# *Notes:
10041 \#   Default is centered.
10043 .MAC ENDNOTE_STRING_QUAD END
10044 .    ds $EN_STRING_QUAD \\$1
10045 .END
10048 \# ENDNOTE STRING UNDERSCORE
10049 \# -------------------------
10050 \# *Arguments:
10051 \#   toggle | 2
10052 \# *Function:
10053 \#   Turns underscoring of endnote main title on or off.  If the argument
10054 \#   is the digit "2", turns on double-underscoring.
10055 \# *Notes:
10056 \#   Default is double-underscored.
10058 .MAC ENDNOTE_STRING_UNDERSCORE END
10059 .    ie '\\$1'' \{ .nr #EN_STRING_UNDERSCORE 1 \}
10060 .    el \{\
10061 .       ie '\\$1'2' \{ .nr #EN_STRING_UNDERSCORE 2 \}
10062 .       el \{ .nr #EN_STRING_UNDERSCORE 0 \}
10063 .    \}
10064 .END
10067 \# ENDNOTE STRING CAPS
10068 \# -------------------
10069 \# *Arguments:
10070 \#   <none> | <anything>
10071 \# *Function:
10072 \#   Turns capitalization of the endnotes pages title string
10073 \#   "Endnotes" on or off.
10074 \# *Notes:
10075 \#   Users may want the endnotes pages title string to be in caps,
10076 \#   but the toc entry for endnotes in lower case.  If the argument
10077 \#   to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
10078 \#   turned on, this is exactly what will happen.
10080 \#   Default is on.
10082 .MAC ENDNOTE_STRING_CAPS END
10083 .   ie '\\$1'' \{ .nr #EN_STRING_CAPS 1 \}
10084 .   el \{ .rr #EN_STRING_CAPS \}
10085 .END
10088 \# ENDNOTE TITLE
10089 \# -------------
10090 \# *Argument:
10091 \#   <string that appears before the first endnote pertaining to any document>
10092 \# *Function:
10093 \#   Creates string $EN_TITLE_STRING.
10094 \# *Notes:
10095 \#   Default is the document title, or, if doc is a chapter, "Chapter #"
10097 .MAC ENDNOTE_TITLE END
10098 .    ds $EN_TITLE \\$1
10099 .END
10102 \# ENDNOTE TITLE FAMILY
10103 \# --------------------
10104 \# *Argument:
10105 \#   <family to use for endnote title>
10106 \# *Function:
10107 \#   Creates string $EN_TITLE_FAM.
10108 \# *Notes:
10109 \#   Default is same as running text of document.
10111 .MAC ENDNOTE_TITLE_FAMILY END
10112 .    ds $EN_TITLE_FAM \\$1
10113 .END
10116 \# ENDNOTE TITLE FONT
10117 \# ------------------
10118 \# *Argument:
10119 \#   <font to use for endnote title>
10120 \# *Function:
10121 \#   Creates string $EN_TITLE_FT.
10122 \# *Notes:
10123 \#   Default is bold for TYPESET; roman for TYPEWRITE.
10125 .MAC ENDNOTE_TITLE_FONT END
10126 .    ds $EN_TITLE_FT \\$1
10127 .END
10130 \# ENDNOTE TITLE SIZE
10131 \# ------------------
10132 \# *Argument:
10133 \#   <+|- number of points by which to in/decrease endnote title
10134 \#    (relative to base endnote size)>
10135 \# *Function:
10136 \#   Creates string $EN_TITLE_SIZE_CHANGE.
10137 \# *Notes:
10138 \#   Default is 0 (i.e. title same size as text of endnotes).
10140 .MAC ENDNOTE_TITLE_SIZE END
10141 .    ds $EN_TITLE_SIZE_CHANGE \\$1 
10142 .END
10145 \# ENDNOTE TITLE QUAD
10146 \# ------------------
10147 \# *Argument:
10148 \#   <quad direction of endnote title>
10149 \# *Function:
10150 \#   Creates string $EN_TITLE_QUAD.
10151 \# *Notes:
10152 \#   Default is left.
10154 .MAC ENDNOTE_TITLE_QUAD END
10155 .    ds $EN_TITLE_QUAD \\$1
10156 .END
10159 \# ENDNOTE TITLE UNDERSCORE
10160 \# ------------------------
10161 \# *Argument:
10162 \#   toggle
10163 \# *Function:
10164 \#   Creates or removes register #EN_TITLE_UNDERSCORE.
10165 \# *Notes:
10166 \#   Default is to underscore the endnote titles.
10168 .MAC ENDNOTE_TITLE_UNDERSCORE END
10169 .    ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
10170 .    el \{ .rr #EN_TITLE_UNDERSCORE \}
10171 .END
10174 \# ENDNOTE NUMBER FAMILY
10175 \# ---------------------
10176 \# *Argument:
10177 \#   <family to use for endnote numbers on endnotes page>
10178 \# *Function:
10179 \#   Creates string $EN_NUMBER_FAM.
10180 \# *Notes:
10181 \#   Default is same as running text of document.
10183 \#   Family, font, and size of endnote numbers applies only to the
10184 \#   numbers as they appear on the endnotes page(s).  The superscript
10185 \#   numbers that appear in running text are unaffected.
10187 .MAC ENDNOTE_NUMBER_FAMILY END
10188 .    ds $EN_NUMBER_FAM \\$1
10189 .END
10192 \# ENDNOTE NUMBER FONT
10193 \# -------------------
10194 \# *Argument:
10195 \#   <font to use for endnote numbers on endnotes page>
10196 \# *Function:
10197 \#   Creates string $EN_NUMBER_FT.
10198 \# *Notes:
10199 \#   Default is bold for TYPESET; roman for TYPEWRITE.
10201 \#   Family, font, and size of endnote numbers applies only to the
10202 \#   numbers as they appear on the endnotes page(s).  The superscript
10203 \#   numbers that appear in running text are unaffected.
10205 .MAC ENDNOTE_NUMBER_FONT END \"Default for TYPESET is bold
10206 .    ds $EN_NUMBER_FT \\$1
10207 .END
10210 \# ENDNOTE NUMBER SIZE
10211 \# -------------------
10212 \# *Argument:
10213 \#   <+|- number of points by which to in/decrease endnote numbers
10214 \#    (relative to base endnote size)>
10215 \# *Function:
10216 \#   Creates string $EN_NUMBER_SIZE_CHANGE.
10217 \# *Notes:
10218 \#   Default is 0.
10220 \#   Family, font, and size of endnote numbers applies only to the
10221 \#   numbers as they appear on the endnotes page(s).  The superscript
10222 \#   numbers that appear in running text are unaffected.
10224 .MAC ENDNOTE_NUMBER_SIZE END
10225 .    ds $EN_NUMBER_SIZE_CHANGE \\$1
10226 .END
10229 \# ENDNOTE NUMBERS ALIGN RIGHT
10230 \# ---------------------------
10231 \# *Argument:
10232 \#   <max. number of digit placeholders that will appear in endnotes>
10233 \# *Function:
10234 \#   Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
10235 \#   #EN_NUMBER_PLACEHOLDERS.
10236 \# *Notes:
10237 \#   Default is for footnote numbers to be right aligned to 2 placeholders.
10239 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
10240 .    rr #EN_NUMBERS_ALIGN_LEFT
10241 .    nr #EN_NUMBERS_ALIGN_RIGHT 1
10242 .    nr #EN_NUMBER_PLACEHOLDERS \\$1
10243 .END
10246 \# ENDNOTE NUMBERS ALIGN LEFT
10247 \# --------------------------
10248 \# *Argument:
10249 \#   none
10250 \# *Function:
10251 \#   Toggles register #EN_NUMBERS_ALIGN_LEFT on.
10252 \# *Notes:
10253 \#   Default is for footnote numbers to be right aligned to 2 placeholders
10254 \#   (i.e. not left aligned).
10256 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
10257 .    rr #EN_NUMBERS_ALIGN_RIGHT
10258 .    nr #EN_NUMBERS_ALIGN_LEFT 1
10259 .END
10262 \# ENDNOTE PARAGRAPH INDENT
10263 \# ------------------------
10264 \# *Argument:
10265 \#   <first line indent of paras subsequent to 1st in endnotes>
10266 \# *Function:
10267 \#   Creates register #EN_PP_INDENT for use in .PP.
10268 \# *Notes:
10269 \#   Requires a unit of measure.
10271 \#   Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
10273 .MAC ENDNOTE_PARA_INDENT END
10274 .    nr #EN_PP_INDENT (\\$1)
10275 .END
10278 \# TURN OFF COLUMN MODE FOR ENDNOTES
10279 \# ---------------------------------
10280 \# *Argument:
10281 \#   <none> | <anything>
10282 \# *Function:
10283 \#   Creates or removes register #EN_NO_COLS
10284 \# *Notes:
10285 \#   Allows user to tell mom not to set endnotes in columnar
10286 \#   documents in columns.  Default is to set endnotes in columns.
10288 .MAC ENDNOTES_NO_COLUMNS END
10289 .    ie '\\$1'' \{ .nr #EN_NO_COLS 1 \}
10290 .    el \{ .rr #EN_NO_COLS \}
10291 .END
10294 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
10295 \# -------------------------------------------
10296 \# *Argument:
10297 \#   <none> | <anything>
10298 \# *Function:
10299 \#   Creates or removes register #EN_NO_FIRST_PN
10300 \# *Notes:
10301 \#   For use if FOOTERS are on.  Tells ENDNOTES not to put a page
10302 \#   number on the first endnotes page.  Some users may want this.
10303 \#   Default is to print a page number at the top of the first
10304 \#   endnotes page when footers are on.
10306 .MAC ENDNOTES_NO_FIRST_PAGENUM END
10307 .    ie '\\$1'' \{ .nr #EN_NO_FIRST_PN 1 \}
10308 .    el \{ .rr #EN_NO_FIRST_PN \}
10309 .END
10312 \# PAGE HEADERS ON ENDNOTES PAGES
10313 \# ------------------------------
10314 \# *Argument:
10315 \#   <none> | ALL
10316 \# *Function:
10317 \#   Creates or removes register #EN_ALLOWS_HEADERS or
10318 \#   #EN_ALLOWS_HEADERS_ALL
10319 \# *Notes:
10320 \#   Whether ENDNOTES puts a page header at the top of endnotes
10321 \#   pages if page headers are used throughout the document.
10322 \#   Default is to insert the page headers, but not on the first
10323 \#   page.  If the optional argument ALL is given, ENDNOTES puts a
10324 \#   page header on the first page as well.
10326 .MAC ENDNOTES_ALLOWS_HEADERS END
10327 .    ie '\\$1'' \{ .nr #EN_ALLOWS_HEADERS 1 \}
10328 .    el \{\
10329 .       ie '\\$1'ALL' \{\
10330 .          nr #EN_ALLOWS_HEADERS 1
10331 .          nr #EN_ALLOWS_HEADERS_ALL 1
10332 .       \}
10333 .       el \{\
10334 .          rr #EN_ALLOWS_HEADERS
10335 .          rr #EN_ALLOWS_HEADERS_ALL
10336 .       \}
10337 .    \}
10338 .END
10341 \# ENDNOTES PAGES PAGE NUMBERING STYLE
10342 \# -----------------------------------
10343 \# *Argument:
10344 \#   DIGIT | ROMAN | roman | ALPHA | alpha
10345 \# *Function:
10346 \#   Creates or modifies $EN_PN_STYLE.
10347 \# *Notes:
10348 \#   Allows user to define what style should be used for endnotes
10349 \#   pages page numbering.  Arguments are the same as for
10350 \#   PAGENUM_STYLE.
10352 \#   Default is DIGIT.
10354 .MAC ENDNOTES_PAGENUM_STYLE END
10355 .    ds $EN_PN_STYLE \\$1
10356 .END
10359 \# FIRST PAGE NUMBER FOR ENDNOTES
10360 \# ------------------------------
10361 \# *Argument:
10362 \#   <page number that appears on page 1 of endnotes pages>
10363 \# *Function:
10364 \#   Creates or modifies string $EN_FIRST_PN
10365 \# *Notes:
10366 \#   To be used with caution, only if all endnotes
10367 \#   are to be output at once, i.e. not at the end of the separate
10368 \#   docs of a collated doc
10370 .MAC ENDNOTES_FIRST_PAGENUMBER END
10371 .    nr #EN_FIRST_PN \\$1
10372 .END
10374 \# SINGLESPACE ENDNOTES
10375 \# --------------------
10376 \# *Argument:
10377 \#   <none> | <anything>
10378 \# *Function:
10379 \#   Sets lead of endnotes pages in TYPEWRITE to 12 points,
10380 \#   adjusted.
10381 \# *Notes:
10382 \#   Default is to double-space endnotes pages.
10384 .MAC SINGLESPACE_ENDNOTES END
10385 .    if \\n[#PRINT_STYLE]=1 \{\
10386 .       ie \\n[#SINGLE_SPACE] \{\
10387 .          nr #EN_SINGLESPACE 1
10388 .          rr #IGNORE
10389 .          if \\n[#OK_PROCESS_LEAD] \{\
10390 .             ENDNOTE_LEAD 12 ADJUST
10391 .             nr #IGNORE 1
10392 .          \}
10393 .       \}
10394 .       el \{\
10395 .          ie '\\$1'' \{\
10396 .             nr #EN_SINGLESPACE 1
10397 .             rr #IGNORE
10398 .             if \\n[#OK_PROCESS_LEAD] \{\
10399 .                ENDNOTE_LEAD 12 ADJUST
10400 .                nr #IGNORE 1
10401 .             \}
10402 .          \}
10403 .          el \{\
10404 .             rr #EN_SINGLESPACE
10405 .             rr #IGNORE
10406 .             if \\n[#OK_PROCESS_LEAD] \{\
10407 .                ENDNOTE_LEAD 24 ADJUST
10408 .                nr #IGNORE 1
10409 .             \}
10410 .          \}
10411 .       \}
10412 .    \}
10413 .END
10416 \# ENDNOTE PARAGRAPH SPACE
10417 \# -----------------------
10418 \# *Argument:
10419 \#   toggle
10420 \# *Function:
10421 \#   Creates toggle register #EN_PP_SPACE for use in .PP.
10422 \# *Notes:
10423 \#   Like PARA_SPACE.  Default is not to space endnote paras.
10425 .MAC ENDNOTE_PARA_SPACE END
10426 .    ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
10427 .    el \{ .rr #EN_PP_SPACE \}
10428 .END
10431 \# ENDNOTE
10432 \# -------
10433 \# *Argument:
10434 \#   toggle
10435 \# *Function:
10436 \#   Places superscript endnote number in text, then collects and
10437 \#   processes endnote in diversion END_NOTES.
10438 \# *Notes:
10439 \#   \c must be appended to the word immediately preceding .ENDNOTE.
10441 .MAC ENDNOTE END
10442 .    ie '\\$1'' \{\
10443 .       nr #ENDNOTE 1
10444 .       if \\n[#CONDENSE] \{ \*[CONDX]\c \}
10445 .       if \\n[#EXTEND]   \{ \*[EXTX]\c  \}
10446 .       if \\n[#PRINT_STYLE]=1 \{\
10447 .          if \\n[#UNDERLINE_ON] \{\
10448 .             nr #UNDERLINE_WAS_ON 1
10449 .             UNDERLINE OFF
10450 .          \}
10451 .          if \\n[#SLANT_ON] \{\
10452 .              nr #SLANT_WAS_ON 1
10453 \*[SLANTX]\c
10454 .          \}
10455 .          PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2"
10456 .       \}
10457 .       if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]" \}
10458 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
10459 .       nr #PP_STYLE 1
10460 .       if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
10461 .       INDENT_FIRST_PARAS
10462 .       ev EN
10463 .       da END_NOTES
10464 .       LL \\n[#DOC_L_LENGTH]u
10465 .       ta \\n(.lu
10466 .       if \\n[#COLUMNS] \{\
10467 .          ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
10468 .          el \{ .LL \\n[#COL_L_LENGTH]u \}
10469 .          ta \\n(.lu
10470 .       \}
10471 .       vs \\n[#EN_LEAD]u
10472 .       if \\n[#EN_NUMBER]=1 \{\
10473 \!.        ne 3
10474 .          if \\n[#PRINT_STYLE]=1 \{\
10475 .             fam C
10476 .             ft  R  
10477 .             ps  12
10478 .          \}
10479 .          if \\n[#PRINT_STYLE]=2 \{\
10480 .             FAMILY  \\*[$EN_TITLE_FAM]
10481 .             FT      \\*[$EN_TITLE_FT]
10482 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
10483 .          \}
10484 .          sp
10485 .          if !'\\*[$EN_TITLE]'' \{\
10486 .             if '\\*[$EN_TITLE_QUAD]'L'      \{ .LEFT   \}
10487 .             if '\\*[$EN_TITLE_QUAD]'LEFT'   \{ .LEFT   \}
10488 .             if '\\*[$EN_TITLE_QUAD]'C'      \{ .CENTER \}
10489 .             if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
10490 .             if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
10491 .             if '\\*[$EN_TITLE_QUAD]'R'      \{ .RIGHT  \}
10492 .             if '\\*[$EN_TITLE_QUAD]'RIGHT'  \{ .RIGHT  \}
10493 .             ie \\n[#EN_TITLE_UNDERSCORE] \{\
10494 .                UNDERSCORE "\\*[$EN_TITLE]
10495 .             \}
10496 .             el \{\
10497 .                PRINT "\\*[$EN_TITLE]
10498 .             \}
10499 .          \}
10500 .       \}
10501 .       ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
10502 .          ie \\n[#EN_NUMBER]=1 \{\
10503 .             if !'\\*[$EN_TITLE]'' \{ .sp \}
10504 .          \}
10505 .          el \{ .sp \}
10506 \!.        TRAP OFF
10507 .          if \\n[#PRINT_STYLE]=1 \{\
10508 .             fam C
10509 .             ft  R
10510 .             ps  12
10511 .          \}
10512 .          if \\n[#PRINT_STYLE]=2 \{\
10513 .             FAMILY  \\*[$EN_NUMBER_FAM]
10514 .             FT      \\*[$EN_NUMBER_FT]
10515 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
10516 .          \}
10517 .          nr #RESET_L_LENGTH \\n(.l
10518 .          nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
10519 .          ll \\n[#EN_NUMBER_L_LENGTH]u
10520 .          RIGHT
10521 \En[#EN_NUMBER].
10522 .          if \\n[#PRINT_STYLE]=1 \{\
10523 .             fam C
10524 .             ft  R
10525 .             ps  12
10526 .          \}
10527 .          if \\n[#PRINT_STYLE]=2 \{\
10528 .             FAMILY  \\*[$EN_FAM]
10529 .             FT      \\*[$EN_FT]
10530 .             PT_SIZE \\n[#EN_PS]u
10531 .          \}
10532 .          EL
10533 .          ll \\n[#RESET_L_LENGTH]u
10534 .          in \\n[#EN_NUMBER_L_LENGTH]u+\w'.\0'u
10535 .          nr #EN_TEXT_INDENT \\n(.i
10536 .          QUAD \\*[$EN_QUAD]
10537 \!.        TRAP
10538 .       \}
10539 .       el \{\
10540 .          ie \\n[#EN_NUMBER]=1 \{\
10541 .             if !'\\*[$EN_TITLE]'' \{ .sp \}
10542 .          \}
10543 .          el \{ .sp \}
10544 .          if \\n[#PRINT_STYLE]=1 \{\
10545 .             fam C
10546 .             ft  R
10547 .             ps  12
10548 .          \}
10549 .          if \\n[#PRINT_STYLE]=2 \{\
10550 .             FAMILY  \\*[$EN_NUMBER_FAM]
10551 .             FT      \\*[$EN_NUMBER_FT]
10552 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
10553 .          \}
10554 .          QUAD \\*[$EN_QUAD]
10555 \En[#EN_NUMBER].\0\c
10556 .          if \\n[#PRINT_STYLE]=2 \{\
10557 .             FAMILY  \\*[$EN_FAM]
10558 .             FT      \\*[$EN_FT]
10559 .             PT_SIZE \\n[#EN_PS]u
10560 .          \}
10561 .       \}
10562 .    \}
10563 .    el \{\
10564 .       br
10565 .       if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
10566 .          in 0
10567 .       \}
10568 .       di
10569 .       ev
10570 .       nr #PP_STYLE \\n[#PP_STYLE_PREV]
10571 .       if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
10572 .       rr #INDENT_FIRSTS
10573 .       rr #ENDNOTE
10574 .       if \\n[#PRINT_STYLE]=1 \{\
10575 .          if \\n[#UNDERLINE_WAS_ON] \{\
10576 .             rr #UNDERLINE_WAS_ON
10577 .             UNDERLINE
10578 .          \}
10579 .       \}
10580 .       if \\n[#SLANT_WAS_ON] \{\
10581 .          rr #SLANT_WAS_ON
10582 \*[SLANT]\c
10583 .       \}
10584 .    \}
10585 .END
10588 \# ENDNOTES
10589 \# --------
10590 \# *Arguments:
10591 \#   none
10592 \# *Function:
10593 \#   Sets new document leading from #EN_LEAD, breaks to a new page,
10594 \#   sets up an endnotes page based on registers and strings associated
10595 \#   with endnotes, then outputs diversion END_NOTES.
10597 .MAC ENDNOTES END
10598 .    nr #ENDNOTES 1
10599 .    nr #PAGINATION_STATE \\n[#PAGINATE]
10600 .    nr #EN_FIRST_PAGE 1
10601 .    nr #HEADER_STATE \\n[#HEADERS_ON]
10602 .    ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
10603 .    if \\n[#HEADERS_ON]=1 \{\
10604 .       if !\\n[#EN_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
10605 .    \}
10606 .    if \\n[#HEADER_STATE]=1 \{\
10607 .       ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
10608 .       el \{ .rm $HDRFTR_CENTER  \}
10609 .    \}
10610 .    ie !\\n[#SUSPEND_PAGINATION] \{\
10611 .       if \\n[#PAGINATE]=1 \{\
10612 .          if \\n[#PAGE_NUM_V_POS]=1 \{\
10613 .             PAGENUM_STYLE \\*[$EN_PN_STYLE]
10614 .             if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN]-1 \}
10615 .             if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
10616 .          \}
10617 .       \}
10618 .    \}
10619 .    el \{\
10620 .       ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
10621 .       el \{ .nr #PAGINATE 0 \}
10622 .    \}
10623 .    if \\n[#FOOTERS_ON]=1 \{\
10624 .       if !'\\*[$HDRFTR_CENTER_OLD]'' \{ .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD] \}
10625 .    \}
10626 .    NEWPAGE
10627 .    if \\n[#FINIS] \{\
10628 .       if \\n[#FOOTERS_WERE_ON] \{\
10629 .          FOOTERS
10630 .          rr #FOOTERS_WERE_ON
10631 .       \}
10632 .       if \\n[#PAGINATION_WAS_ON] \{\ \"This register only set in FINIS
10633 .          if \\n[#PAGINATION_STATE]=1 \{\
10634 .             PAGINATE
10635 .             rr #PAGINATION_WAS_ON
10636 .          \}
10637 .       \}
10638 .       rr #FINIS
10639 .    \}
10640 .    if \\n[#FOOTERS_WERE_ON] \{\
10641 .       FOOTERS
10642 .       rr #FOOTERS_WERE_ON
10643 .    \}
10644 .    if \\n[#PAGINATION_WAS_ON] \{\
10645 .       if \\n[#PAGINATION_STATE]=1 \{\
10646 .          PAGINATE
10647 .          rr #PAGINATION_WAS_ON
10648 .       \}
10649 .    \}
10650 .    if \\n[#FOOTERS_ON]=1 \{\
10651 .       ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
10652 .       rm $HDRFTR_CENTER_OLD
10653 .       rm $HDRFTR_CENTER_NEW
10654 .    \}
10655 .    ie !\\n[#SUSPEND_PAGINATION] \{\
10656 .       if \\n[#PAGE_NUM_V_POS]=1 \{\
10657 .          if r#EN_NO_FIRST_PN \{\
10658 .             if \\n[#PAGINATION_STATE]=1 \{\
10659 .                nr #PAGINATE 1
10660 .             \}
10661 .          \}
10662 .       \}
10663 .    \}
10664 .    el \{\
10665 .       if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
10666 .    \}
10667 .    rr #PAGINATION_STATE
10668 .    PAGENUM_STYLE \\*[$EN_PN_STYLE]
10669 .    if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
10670 .    if \\n[#HEADER_STATE]=1 \{\
10671 .       if \\n[#EN_ALLOWS_HEADERS] \{ .HEADERS \}
10672 .    \}
10673 \# Collect endnote title string for TOC
10674 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
10675 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
10676 .    ds $TOC_TITLE_ITEM \\*[$EN_STRING]\\|
10677 .    ev TOC_EV
10678 .    da TOC_ENTRIES
10679 .    if \\n[#PRINT_STYLE]=1 \{\
10680 .       fam C
10681 .       ft  R
10682 .       ps  12
10683 .    \}
10684 .    if \\n[#PRINT_STYLE]=2 \{\
10685 \!.     FAMILY  \\*[$TOC_TITLE_FAM]
10686 \!.     FT      \\*[$TOC_TITLE_FT]
10687 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
10688 .    \}
10689 \!.  TRAP OFF
10690 .    ie \\n[#PRINT_STYLE]=1 \{\
10691 \!.     PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
10692 .    \}
10693 .    el \{\
10694 \!.     PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
10695 .    \}
10696 \!.  EL
10697 \!.  ST 100 L
10698 \!.  ST 101 R
10699 .    if \\n[#PRINT_STYLE]=2 \{\
10700 \!.     FAMILY  \\*[$TOC_PN_FAM]
10701 \!.     FT      \\*[$TOC_PN_FT]
10702 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10703 .    \}
10704 \!.  TAB 100
10705 \!.  PRINT \\*[LEADER]
10706 \!.  TN
10707 \!.  TRAP
10708 \!.  PRINT \\n[#TOC_ENTRY_PN]
10709 \!.  TQ
10710 .    di       
10711 .    ev
10712 \# End collection of endnote title string for TOC
10713 \# Process endnote
10714 .    if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#EN_LEAD]u \}
10715 .    if \\n[#PRINT_STYLE]=2 \{\
10716 .       if \\n[#EN_NO_COLS] \{\
10717 .          if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
10718 .          nr #COLUMNS 0
10719 .       \}
10720 .       nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
10721 .       ie \\n[#ADJ_EN_LEAD] \{\
10722 .          nr #DOC_LEAD \\n[#EN_LEAD]
10723 .       \}
10724 .       el \{ .DOC_LEAD \\n[#EN_LEAD]u \}
10725 .    \}
10726 .    PRINT \&
10727 .    sp |\\n[#T_MARGIN]u
10728 .    mk ec
10729 .    if \\n[#SLANT_ON] \{\
10730 \*[SLANTX]\c
10731 .    \}
10732 .    ev ENDNOTES
10733 .    if !'\\*[$EN_STRING]'' \{\
10734 .       if \\n[#PRINT_STYLE]=1 \{\
10735 .          fam C
10736 .          ft  R
10737 .          ps  12
10738 .          vs \\n[#EN_LEAD]u
10739 .       \}
10740 .       if \\n[#PRINT_STYLE]=2 \{\
10741 .          LL \\n[#DOC_L_LENGTH]u
10742 .          ta \\n(.lu
10743 .          if \\n[#COLUMNS] \{\
10744 .             ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
10745 .             el \{ .LL \\n[#COL_L_LENGTH]u \}
10746 .             ta \\n(.lu
10747 .          \}
10748 .          FAMILY  \\*[$EN_STRING_FAM]
10749 .          FT      \\*[$EN_STRING_FT]
10750 .          PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
10751 .          vs      \\n[#EN_LEAD]u
10752 .       \}
10753 .       if '\\*[$EN_STRING_QUAD]'L'      \{ .LEFT   \}
10754 .       if '\\*[$EN_STRING_QUAD]'LEFT'   \{ .LEFT   \}
10755 .       if '\\*[$EN_STRING_QUAD]'C'      \{ .CENTER \}
10756 .       if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
10757 .       if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
10758 .       if '\\*[$EN_STRING_QUAD]'R'      \{ .RIGHT  \}
10759 .       if '\\*[$EN_STRING_QUAD]'RIGHT'  \{ .RIGHT  \}
10760 .       EL
10761 .       if \\n[#EN_STRING_CAPS] \{ .CAPS \}
10762 .       ie \\n[#EN_STRING_UNDERSCORE] \{\
10763 .          ie \\n[#EN_STRING_UNDERSCORE]=2 \{\
10764 .             UNDERSCORE2 "\\*[$EN_STRING]
10765 .          \}
10766 .          el \{\
10767 .             UNDERSCORE "\\*[$EN_STRING]
10768 .          \}
10769 .       \}
10770 .       el \{\
10771 .          PRINT "\\*[$EN_STRING]
10772 .       \}
10773 .    \}
10774 .    CAPS OFF
10775 .    ALD \\n[#EN_LEAD]u
10776 .    QUAD \\*[$EN_QUAD]
10777 .    nf
10778 .    END_NOTES
10779 .    br
10780 .    ev
10781 .    rm END_NOTES
10782 .    if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#DOC_LEAD]u \}
10783 .    if \\n[#PRINT_STYLE]=2 \{\
10784 .       ie \\n[#ADJ_EN_LEAD] \{\
10785 .          nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
10786 .       \}
10787 .       el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
10788 .       rr #RESTORE_DOC_LEAD
10789 .    \}
10790 .    if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
10791 .    if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
10792 .    rr #ENDNOTES
10793 .END
10795 \# ====================================================================
10797 \# +++TABLE OF CONTENTS+++
10799 \# Strings to allocate space for leaders and entry page numbers
10801 .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]
10802 .ds $TOC_PN_TYPEWRITE \\*[ST100]#\\*[ST100X]\\*[ST101]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST101X]
10804 \# TOC ENTRIES PAGE NUMBERS PADDING
10805 \# --------------------------------
10806 \# *Argument:
10807 \#   <number of placeholders for toc entries page numbers>
10808 \# *Function:
10809 \#   Creates or modifies register #TOC_PN_PADDING.
10810 \# *Notes:
10811 \#   "Placeholders" is the maximum number of digits in a page
10812 \#   number numeral.
10814 \#   Default is 3.
10816 .MAC TOC_PADDING END
10817 .    nr #TOC_PN_PADDING \\$1
10818 .END
10821 \# PAGINATE TOC
10822 \# ------------
10823 \# *Argument:
10824 \#   <none> | <anything>
10825 \# *Function:
10826 \#   Creates or removes register #PAGINATE_TOC.
10827 \# *Notes:
10828 \#   Default is to paginate toc.
10830 .MAC PAGINATE_TOC END
10831 .    ie '\\$1'' \{ .nr #PAGINATE_TOC 1 \}
10832 .    el \{ .nr #PAGINATE_TOC 0 \}
10833 .END
10836 \# TOC FAMILY
10837 \# ----------
10838 \# *Argument:
10839 \#   <overall default family for toc pages>
10840 \# *Function:
10841 \#   Creates string $TOC_FAM.
10842 \# *Notes:
10843 \#   Default is same as document family. 
10845 .MAC TOC_FAMILY END
10846 .    ds $TOC_FAM \\$1
10847 .END
10850 \# TOC POINT SIZE
10851 \# --------------
10852 \# *Argument:
10853 \#   <base point size for toc pages>
10854 \# *Function:
10855 \#   Creates or modifies register #TOC_PS.
10856 \# *Notes:
10857 \#   This size control macro differs from other size control macros
10858 \#   in that it sets an absolute point size, not a relative one.
10859 \#   See notes for ENDNOTE_PT_SIZE for explanation.  No unit of
10860 \#   measure required.
10862 \#   No unit of measure required (points assumed).  Default is 11.5
10863 \#   for TYPESET.
10865 .MAC TOC_PT_SIZE END
10866 .    nr #TOC_PS (p;\\$1)
10867 .END
10870 \# TOC LEADING
10871 \# -----------
10872 \# *Argument:
10873 \#   <leading for toc pages> [ADJUST]
10874 \# *Function:
10875 \#   Creates or modifies register #TOC_LEAD. If optional ADJUST
10876 \#   given, adjusts lead to fill page.  If #OK_PROCESS_LEAD doesn't
10877 \#   exist, stores arguments for when it's okay to run the macro.
10878 \# *Notes:
10879 \#   No unit of measure required (points assumed).
10881 \#   Default is same as DOC_LEAD.
10883 .MAC TOC_LEAD END
10884 .    if !\\n[#OK_PROCESS_LEAD] \{\
10885 .       ds $TOC_LEAD \\$1
10886 .       if !'\\$2'' \{\
10887 .           ds $ADJUST_TOC_LEAD \\$2
10888 .       \}
10889 .       return
10890 .    \}
10891 .    rr #ADJ_TOC_LEAD
10892 .    nr #TOC_LEAD (p;\\$1)
10893 .    if '\\$2'ADJUST' \{\
10894 .       nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
10895 .       nr #ADJ_DOC_LEAD 1
10896 .       nr #ADJ_TOC_LEAD 1
10897 .       nr #NO_TRAP_RESET 1
10898 .       DOC_LEAD \\n[#TOC_LEAD]u ADJUST
10899 .       nr #TOC_LEAD \\n[#DOC_LEAD]
10900 .       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
10901 .       rr #NO_TRAP_RESET
10902 .       rr #ADJ_DOC_LEAD
10903 .       rr #ORIG_DOC_LEAD
10904 .    \}
10905 .END
10908 \# TOC PAGES PAGE-NUMBERING STYLE
10909 \# ------------------------------
10910 \# *Argument:
10911 \#   DIGIT | ROMAN | roman | ALPHA | alpha
10912 \# *Function:
10913 \#   Creates or modifies string $TOC_PN_STYLE
10914 \# *Notes:
10915 \#   Page numbering style for page numbers that appear in the
10916 \#   headers/footers of toc pages.  See notes for PAGENUM_STYLE.  
10918 \#   Default is roman.
10920 .MAC TOC_PAGENUM_STYLE END
10921 .    ds $TOC_PN_STYLE \\$1
10922 .END
10925 \# TOC RECTO_VERSO SWITCH
10926 \# ----------------------
10927 \# *Argument:
10928 \#   <none> | <anything>
10929 \# *Function:
10930 \#   Creates or removes register #TOC_RV_SWITCH
10931 \# *Notes:
10932 \#   Allows switching of L/R margins if a doc is recto/verso and
10933 \#   the first toc page happens to fall the wrong way
10935 .MAC TOC_RV_SWITCH END
10936 .    ie '\\$1'' \{ .nr #TOC_RV_SWITCH 1 \}
10937 .    el \{ .rr #TOC_RV_SWITCH \}
10938 .END
10940 \# - for TOC "doc header" (i.e. "Contents")
10942 \# TOC HEADER FAMILY
10943 \# -----------------
10944 \# *Argument:
10945 \#   <family for toc header>
10946 \# *Function:
10947 \#   Creates or modifies string $TOC_HEADER_FAM
10948 \# *Notes:
10949 \#   Default is same as TOC_FAMILY.
10951 .MAC TOC_HEADER_FAMILY END
10952 .    ds $TOC_HEADER_FAM \\$1
10953 .END
10956 \# TOC HEADER FONT
10957 \# ---------------
10958 \# *Argument:
10959 \#   <font for toc header>
10960 \# *Function:
10961 \#   Creates or modified string $TOC_HEADER_FT
10962 \# *Notes:
10963 \#   Default is bold for TYPESET.
10965 .MAC TOC_HEADER_FONT END
10966 .    ds $TOC_HEADER_FT \\$1
10967 .END
10970 \# TOC HEADER SIZE
10971 \# --------------
10972 \# *Argument:
10973 \#   <+|- number of points by which to in/decrease toc header
10974 \#   (relative to overall toc point size)>
10975 \# *Function:
10976 \#   Creates or modifies string $TOC_HEADER_SIZE_CHANGE.
10977 \# *Notes:
10978 \#   Default is +4
10980 .MAC TOC_HEADER_SIZE END
10981 .    ds $TOC_HEADER_SIZE_CHANGE \\$1
10982 .END
10985 \# TOC HEADER QUAD
10986 \# ---------------
10987 \# *Argument:
10988 \#   L | LEFT | C | CENTER | CENTRE | R | RIGHT
10989 \# *Function:
10990 \#   Creates or modifies string $TOC_HEADER_QUAD.
10991 \# *Notes:
10992 \#   Default is LEFT.
10994 .MAC TOC_HEADER_QUAD END
10995 .    ds $TOC_HEADER_QUAD \\$1
10996 .END
10999 \# TOC HEADER STRING
11000 \# -----------------
11001 \# *Argument:
11002 \#   <string for "doc header" of first toc page>
11003 \# *Function:
11004 \#   Creates or modifies string $TOC_HEADER_STRING
11005 \# *Notes:
11006 \#   Default is "Contents".
11008 .MAC TOC_HEADER_STRING END
11009 .    ds $TOC_HEADER_STRING \\$1
11010 .END
11012 \# - for TOC entries page number numerals
11014 \# TOC ENTRIES PAGE NUMBER FAMILY
11015 \# ------------------------------
11016 \# *Argument:
11017 \#   <family to use for toc entries page number>
11018 \# *Function:
11019 \#   Creates or modifies string $TOC_PN_FAM.
11020 \# *Notes:
11021 \#   Default is same as $TOC_FAM.
11023 .MAC TOC_PN_FAMILY END
11024 .    ds $TOC_PN_FAM \\$1
11025 .END
11028 \# TOC ENTRIES PAGE NUMBER FONT
11029 \# ----------------------------
11030 \# *Argument:
11031 \#   <font to use for toc entries page number>
11032 \# *Function:
11033 \#   Creates or modifies string $TOC_PN_FT.
11034 \# *Notes:
11035 \#   Default is roman.
11037 .MAC TOC_PN_FONT END
11038 .    ds $TOC_PN_FT \\$1
11039 .END
11042 \# TOC ENTRIES PAGE NUMBER SIZE
11043 \# ----------------------------
11044 \# *Argument:
11045 \#   <+|- number of points by which to in/decrease toc
11046 \#   entries page numbers (relative to overall toc point size)>
11047 \# *Function:
11048 \#   Creates or modifies string $TOC_PN_SIZE_CHANGE.
11049 \# *Notes:
11050 \#   Default is +0.
11052 .MAC TOC_PN_SIZE END
11053 .    ds $TOC_PN_SIZE_CHANGE \\$1
11054 .END
11057 \# Control macros for toc doc titles, heads, subheads and paraheads 
11058 \# ----------------------------------------------------------------
11060 \# All these control macros behave the same way, setting the family,
11061 \# font, point size and indent from the left margin of the different
11062 \# kinds of entries that can appear in the toc.  The way they
11063 \# operate is identical to all other _FAMILY, _FONT and _SIZE
11064 \# control macros.  _INDENT takes an absolute value.
11065 \# TOC_APPENDS_AUTHORS is unique in this section.
11066 \# 
11067 \# - for title entries
11069 .MAC TOC_TITLE_FAMILY END
11070 .    ds $TOC_TITLE_FAM \\$1
11071 .END
11074 .MAC TOC_TITLE_FONT END
11075 .    ds $TOC_TITLE_FT \\$1
11076 .END
11079 .MAC TOC_TITLE_SIZE END
11080 .    ds $TOC_TITLE_SIZE_CHANGE \\$1
11081 .END
11084 .MAC TOC_TITLE_INDENT END
11085 .    nr #TOC_TITLE_INDENT (\\$1)
11086 .END
11089 .MAC TOC_TITLE_ENTRY END
11090 .    nr #USER_SET_TITLE_ITEM 1
11091 .    ds $USER_SET_TITLE_ITEM \\$1
11092 .END
11095 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
11096 \# -----------------------------------------
11097 \# *Argument:
11098 \#   <none> | <name(s) of author(s) as they should appear in toc doc title entries>
11099 \# *Function:
11100 \#   Creates register #TOC_AUTHORS (to tell TOC to append authors
11101 \#   to toc doc title entries).  Optionally creates string
11102 \#   $TOC_AUTHORS.
11103 \# *Notes:
11104 \#   Normally, TOC does not append the author(s) to a toc doc title
11105 \#   entry.  This special macro instructs TOC to do so.
11107 \#   If user has multiple authors for each doc when collating,
11108 \#   TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
11109 \#   COLLATE and START in each doc.  Otherwise, mom prints only the
11110 \#   first author given to AUTHOR.
11112 .MAC TOC_APPENDS_AUTHOR END
11113 .    nr #TOC_AUTHORS 1
11114 .    if !'\\$1'' \{\
11115 .       ds $TOC_AUTHORS \\$1
11116 .    \}
11117 .END
11119 \# - for head entries
11121 .MAC TOC_HEAD_FAMILY END
11122 .    ds $TOC_HEAD_FAM \\$1
11123 .END
11126 .MAC TOC_HEAD_FONT END
11127 .    ds $TOC_HEAD_FT \\$1
11128 .END
11131 .MAC TOC_HEAD_SIZE END
11132 .    ds $TOC_HEAD_SIZE_CHANGE \\$1
11133 .END
11136 .MAC TOC_HEAD_INDENT END
11137 .    nr #TOC_HEAD_INDENT (\\$1)
11138 .END
11140 \# - for subhead entries
11142 .MAC TOC_SUBHEAD_FAMILY END
11143 .    ds $TOC_SH_FAM \\$1
11144 .END
11147 .MAC TOC_SUBHEAD_FONT END
11148 .    ds $TOC_SH_FT \\$1
11149 .END
11152 .MAC TOC_SUBHEAD_SIZE END
11153 .    ds $TOC_SH_SIZE_CHANGE \\$1
11154 .END
11157 .MAC TOC_SUBHEAD_INDENT END
11158 .    nr #TOC_SH_INDENT (\\$1)
11159 .END
11161 \# - for parahead entries
11163 .MAC TOC_PARAHEAD_FAMILY END
11164 .    ds $TOC_PH_FAM \\$1
11165 .END
11168 .MAC TOC_PARAHEAD_FONT END
11169 .    ds $TOC_PH_FT \\$1
11170 .END
11173 .MAC TOC_PARAHEAD_SIZE END
11174 .    ds $TOC_PH_SIZE_CHANGE \\$1
11175 .END
11178 .MAC TOC_PARAHEAD_INDENT END
11179 .    nr #TOC_PH_INDENT (\\$1)
11180 .END
11183 .MAC TOC END
11184 .    if !r#PAGINATE_TOC \{ .PAGINATE_TOC \}
11185 .    nr #TOC_FIRST_PAGE 1
11186 .    if \\n[#FINIS] \{\
11187 .       if \\n[#FOOTERS_WERE_ON] \{\
11188 .          FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
11189 .       \}
11190 .    \}
11191 .    if \\n[#FOOTERS_ON]=1 \{\
11192 .       if !'\\*[$HDRFTR_CENTER_OLD]'' \{ .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD] \}
11193 .       ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
11194 .       el \{ .PAGINATION OFF \}
11195 .    \}
11196 .    if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS OFF \} \" But have to turn FOOTERS off again so they don't print when FINIS was called
11197 .    COLLATE
11198 .    if \\n[#FINIS] \{\
11199 .       if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \} \" Finally, turn footers on if they were on
11200 .       rr #FOOTERS_WERE_ON
11201 .       if \\n[#PAGINATION_WAS_ON] \{\
11202 .          nr #PAGINATE 1
11203 .          rr #PAGINATION_WAS_ON
11204 .       \}
11205 .       rr #FINIS
11206 .    \}
11207 .    ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
11208 .    el \{ .PAGINATION OFF \}
11209 .    if \\n[#FOOTERS_ON]=1 \{\
11210 .       ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
11211 .       rm $HDRFTR_CENTER_OLD
11212 .       rm $HDRFTR_CENTER_NEW
11213 .    \}
11214 .    rr #COLLATED_DOC
11215 .    DOCHEADER OFF
11216 .    PAGENUMBER 1
11217 .    if \\n[#PRINT_STYLE]=1 \{\
11218 .       rr #IGNORE
11219 .       DOC_LEAD 24 ADJUST
11220 .       nr #IGNORE 1
11221 .    \}
11222 .    START
11223 .    PP
11224 .    nr #COLUMNS 0
11225 .    if \\n[#PRINT_STYLE]=2 \{\
11226 .       ie r#ADJ_TOC_LEAD \{\
11227 .          nr #NO_TRAP_RESET 1
11228 .          DOC_LEAD \\n[#TOC_LEAD]u ADJUST
11229 .          rr #NO_TRAP_RESET
11230 .       \}
11231 .       el \{ .DOC_LEAD \\n[#TOC_LEAD]u \}
11232 .    \}
11233 .    sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
11234 .    if \\n[#SLANT_ON] \{\
11235 \*[SLANTX]\c
11236 .    \}
11237 .    DOC_LINE_LENGTH \\n[#DOC_L_LENGTH]u
11238 .    QUAD \\*[$TOC_HEADER_QUAD]
11239 .    PAGENUM_STYLE \\*[$TOC_PN_STYLE]
11240 .    if \\n[#PRINT_STYLE]=1 \{\
11241 .       fam C
11242 .       ft  R
11243 .       ps  12
11244 .    \}
11245 .    if \\n[#PRINT_STYLE]=2 \{\
11246 .       FAMILY  \\*[$TOC_HEADER_FAM]
11247 .       FT      \\*[$TOC_HEADER_FT]
11248 .       PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
11249 .    \}
11250 .    ie \\n[#PRINT_STYLE]=1 \{\
11251 .       CAPS
11252 .       UNDERLINE
11253 .       PRINT "\\*[$TOC_HEADER_STRING]"
11254 .       UNDERLINE OFF
11255 .       CAPS      OFF
11256 .    \}
11257 .    el \{\
11258 .       PRINT "\\*[$TOC_HEADER_STRING]"
11259 .    \}
11260 .    LEFT
11261 .    SP
11262 \# In collated docs, this bit inserts the first doc's title
11263 \# underneath the TOC header, before the TOC_ENTRIES diversion
11264 \# gets output.
11265 .    nf
11266 .    if d$FIRST_DOC_TITLE \{\
11267 .    nr #RESTORE_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
11268 .    TOC_PADDING \\n[#FIRST_DOC_TOC_PN_PADDING]
11269 .       if \\n[#PRINT_STYLE]=2 \{\
11270 .          FAMILY  \\*[$TOC_TITLE_FAM]
11271 .          FT      \\*[$TOC_TITLE_FT]
11272 .          PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
11273 .       \}
11274 .       ie \\n[#PRINT_STYLE]=1 \{\
11275 .          PAD "\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN_TYPEWRITE]" 
11276 .       \}
11277 .       el \{\
11278 .          PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN]"
11279 .       \}
11280 .       EL
11281 .       ST 100 L
11282 .       ST 101 R
11283 .       if \\n[#PRINT_STYLE]=2 \{\
11284 .          FAMILY  \\*[$TOC_PN_FAM]
11285 .          FT      \\*[$TOC_PN_FT]
11286 .          PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
11287 .       \}
11288 .       TAB 100
11289 .       PRINT \\*[LEADER]
11290 .       TN
11291 .       PRINT \\n[#FIRST_DOC_TITLE_PN]
11292 .       TQ
11293 .    \}
11294 .    TOC_PADDING \\n[#RESTORE_TOC_PN_PADDING]
11295 .    nf
11296 .    TOC_ENTRIES
11297 .    br
11298 .    rr #TOC
11299 .END
11301 \# ====================================================================
11303 \# +++COLUMNS+++
11305 \# COLUMNS
11306 \# -------
11307 \# *Arguments:
11308 \#   <number of columns>  <width of gutters>
11309 \# *Function:
11310 \#   Creates registers associated with setting docs in columns.
11311 \#   Calculates column line lengths and offsets
11312 \# *Notes:
11313 \#   COLUMNS, if used, s/b the last macro invoked before START.
11315 .MAC COLUMNS END
11316 .    if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
11317 .    nr #COLUMNS 1
11318 .    nr #NUM_COLS \\$1
11319 .    nr #GUTTER (\\$2)
11320 .    nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
11321 .    nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
11322 .    nr #COL_NUM 0 1
11323 .    while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11324 .       nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
11325 .       nr #COL_TOTAL \\n+[#COL_TOTAL]
11326 .    \}
11327 .    rr #COL_TOTAL
11328 .    rr #COL_NUM
11329 .END
11332 \# NEXT COLUMN
11333 \# -----------
11334 \# *Arguments:
11335 \#   <none>
11336 \# *Function:
11337 \#   Breaks current column and moves to next column.
11338 \#   If current column is the last on the page, breaks
11339 \#   to a new page.
11341 .MAC COL_NEXT END
11342 .    if \\n[#COLUMNS] \{\
11343 .       nr #COL_NEXT 1
11344 .       ie '\\$0'COL_NEXT' \{ .br  \}
11345 .       el \{\
11346 .          brp
11347 .          RLD 1v
11348 .       \}
11349 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11350 .          bp
11351 .       \}
11352 .       el \{ .FOOTER \}
11353 .    \}
11354 .END
11356 \# ====================================================================
11358 \# +++LISTS+++
11360 \# LIST
11361 \# ----
11362 \# *Arguments:
11363 \#   [ BULLET | DASH | DIGIT | ALPHA | USER ] [ <separator> ] [ <anything> ]
11364 \# *Function:
11365 \#   Stores indent information in effect prior to invocation and
11366 \#   initializes a list with the supplied enumerator (and separator).
11367 \# *Notes:
11368 \#   Default enumerator is a bullet.
11370 \#   Enumerator *must* be supplied for every list that's to the
11371 \#   right of another list, every time, unless the default bullet is
11372 \#   desired.
11374 \#   <anything> moves back one list level intuitively, or exits lists
11375 \#   completely if the level at which it's invoked is the first.
11377 .MAC LIST END
11378 .    if !r#DEPTH \{\
11379 .       nr #STORED_HL_INDENT \\n[#HL_INDENT]
11380 .       nr #STORED_T_INDENT  \\n[#T_INDENT]
11381 .       nr #CURRENT_L_LENGTH \\n(.l
11382 .       nr #DEPTH 0 1
11383 .       if \\n[#INDENT_ACTIVE]=1 \{\
11384 .          if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
11385 .             nr #STORED_L_INDENT \\n[#L_INDENT]
11386 .             nr #RESTORE_PREV_INDENT 1
11387 .          \}
11388 .          if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
11389 .             nr #STORED_BL_INDENT \\n[#BL_INDENT]
11390 .             nr #STORED_BR_INDENT \\n[#BR_INDENT]
11391 .             IBX
11392 .             nr #ORIG_L_LENGTH \\n(.l
11393 .             IB
11394 .             nr #RESTORE_PREV_INDENT 2
11395 .          \}
11396 .          if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
11397 .             nr #STORED_R_INDENT \\n[#R_INDENT]
11398 .             IRX
11399 .             nr #ORIG_L_LENGTH \\n(.l
11400 .             IR
11401 .             nr #RESTORE_PREV_INDENT 3
11402 .             if \\n[#INDENT_LEFT_ACTIVE]=1 \{ .nr #RESTORE_PREV_INDENT 4 \}
11403 .          \}
11404 .       \}
11405 .    \}
11406 .    if \\n[#NUM_ARGS]=0 \{\
11407 .       nr #ARGS_TO_LIST 1 \" So default behaves as if LIST BULLET
11408 .       ds $ENUMERATOR\\n+[#DEPTH] \(bu
11409 .       ds $SEPARATOR
11410 .    \}
11411 .    if \\n[#NUM_ARGS]>0 \{\
11412 .       rr #ARGS_TO_LIST \" Clear this before processing arg 1.
11413 .       if '\\$1'DASH'   \{\
11414 .          nr #ARGS_TO_LIST 1
11415 .          ds $ENUMERATOR\\n+[#DEPTH] \(en
11416 .          ds $SEPARATOR\\n[#DEPTH]
11417 .       \}
11418 .       if '\\$1'BULLET' \{\
11419 .          nr #ARGS_TO_LIST 1
11420 .          ds $ENUMERATOR\\n+[#DEPTH] \(bu
11421 .          ds $SEPARATOR\\n[#DEPTH]
11422 .       \}
11423 .       if '\\$1'DIGIT'  \{\
11424 .          nr #ARGS_TO_LIST 1
11425 .          nr #ENUMERATOR\\n+[#DEPTH] 0 1
11426 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] register
11427 .          ds $SEPARATOR\\n[#DEPTH] .
11428 .          if \\n[#NUM_ARGS]=2 \{\
11429 .             ie '\\$2'NONE' \{ .ds $SEPARATOR\\n[#DEPTH]\}
11430 .             el             \{ .ds $SEPARATOR\\n[#DEPTH] \\$2\}
11431 .          \}
11432 .       \}
11433 .       if '\\$1'ALPHA'  \{\
11434 .          nr #ARGS_TO_LIST 1
11435 .          nr #ENUMERATOR\\n+[#DEPTH] 0 1
11436 .          af #ENUMERATOR\\n[#DEPTH] a
11437 .          ds $ENUMERATOR_TYPE\\n[#DEPTH] register
11438 .          ds $SEPARATOR\\n[#DEPTH] )
11439 .          if \\n[#NUM_ARGS]=2 \{\
11440 .             ie '\\$2'NONE' \{ .ds $SEPARATOR\\n[#DEPTH]\}
11441 .             el             \{ .ds $SEPARATOR\\n[#DEPTH] \\$2\}
11442 .          \}
11443 .       \}
11444 .       if '\\$1'USER'   \{\
11445 .          nr #ARGS_TO_LIST 1
11446 .          ds $ENUMERATOR\\n+[#DEPTH] \\$2
11447 .          ds $SEPARATOR\\n[#DEPTH]
11448 .       \}
11449 .       if \\n[#NUM_ARGS]=1 \{\
11450 .          if !r#ARGS_TO_LIST \{\
11451 .             ie \\n[#DEPTH]=1 \{\
11452 .                ie \\n[#NEXT_DEPTH_BACK]=0 \{\
11453 .                   SET_LIST_INDENT
11454 .                   if \\n[#QUIT]=1 \{\
11455 .                      QUIT_LISTS
11456 .                      return
11457 .                   \}
11458 .                   return
11459 .                \}
11460 .                el \{\
11461 .                   QUIT_LISTS
11462 .                   return
11463 .                \} 
11464 .             \}
11465 .             el \{\
11466 .                SET_LIST_INDENT
11467 .                return
11468 .             \}
11469 .          \}
11470 .       \}
11471 .    \}
11472 .    nr #TOTAL_LISTS \\n[#DEPTH]
11473 .    ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
11474 .       nr #LIST_INDENT\\n[#DEPTH] \\w'm\\*[$SEPARATOR\\n[#DEPTH]]\\ '
11475 .    \}
11476 .    el \{\
11477 .       nr #LIST_INDENT\\n[#DEPTH] \\w'\\*[$ENUMERATOR\\n[#DEPTH]]\\0'
11478 .    \}
11479 .    LL \\n[#CURRENT_L_LENGTH]u
11480 .    ie \\n[#DEPTH]=1 \{\
11481 .       ie \\n[#INDENT_ACTIVE]=1 \{\
11482 .          if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
11483 .             nr #L_INDENT \\n[#L_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
11484 .             nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
11485 .             nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
11486 .          \}
11487 .          if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
11488 .             nr #L_INDENT \\n[#BL_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
11489 .             nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
11490 .             nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
11491 .          \}
11492 .          if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
11493 .             ie \\n[#INDENT_LEFT_ACTIVE]=1 \{\
11494 .             \" Don't do anything; we already have a left indent
11495 .             \}
11496 .             el \{\
11497 .                nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
11498 .                nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
11499 .             \}
11500 .          \}
11501 .       \}
11502 .       el \{\
11503 .          nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
11504 .          nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
11505 .       \}
11506 .    \}
11507 .    el \{\
11508 .       nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
11509 .       nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
11510 .    \}
11511 .END
11514 \# ITEM
11515 \# ----
11516 \# *Arguments:
11517 \#   none
11518 \# *Function:
11519 \#   Prints enumerator for a given list depth and prepares mom to
11520 \#   receive the text of an item.
11522 .MAC ITEM END
11523 .    KERN OFF
11524 .    IL 
11525 .    ll \\n[#CURRENT_L_LENGTH]u \" Set ll again because IL turns IB off.
11526 .    TRAP OFF
11527 .    HI \\n[#HL_INDENT\\n[#DEPTH]]u
11528 .    ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
11529 .       ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
11530 .          ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
11531 .             ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
11532 .                PRINT \\0\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
11533 .             \}
11534 .             el \{\
11535 .                PRINT \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
11536 .             \}
11537 .          \}
11538 .          el \{\
11539 .             PRINT \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
11540 .          \}
11541 .       \}
11542 .       el \{\
11543 .          PRINT \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
11544 .       \}
11545 .    \}
11546 .    el \{\
11547 .       PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
11548 .    \}
11549 .    EL
11550 .    TRAP
11551 .    KERN
11552 .END
11555 \# SHIFT LIST
11556 \# ---------
11557 \# *Arguments:
11558 \#   <amount by which to indent a list to the right>
11559 \# *Function:
11560 \#   Adds the value of the arg to the current list's indent.
11561 \# *Notes:
11562 \#   Requires a unit of measure.
11564 .MAC SHIFT_LIST END
11565 .    nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]+(\\$1)
11566 .    nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]
11567 .END
11570 \# PAD LIST DIGITS
11571 \# ---------------
11572 \# *Arguments:
11573 \#   [ LEFT ]
11574 \# *Function:
11575 \#   Adds a figure space to a list's hanging and left indent.  If
11576 \#   LEFT is given, sets reg. #PAD_LIST_DIGITS to 1 for use in ITEM.
11578 .MAC PAD_LIST_DIGITS END
11579 .    if '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
11580 .       nr #LIST_INDENT\\n[#DEPTH] +\\w'\\0'
11581 .       nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#LIST_INDENT\\n-[#DEPTH]]
11582 .       nr #HL_INDENT\\n+[#DEPTH] +\\w'\\n[#ENUMERATOR\\n[#DEPTH]]'
11583 .       if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
11584 .    \}
11585 .END
11588 \# RESET LIST
11589 \# ----------
11590 \# *Arguments:
11591 \#   none
11592 \# *Function:
11593 \#   Resets register enumerators to 1 or a.
11595 .MAC RESET_LIST END
11596 .    nr #ENUMERATOR\\n[#DEPTH] 0 1
11597 .END
11600 \# QUIT LISTS
11601 \# ----------
11602 \# *Arguments:
11603 \#   none
11604 \# *Function:
11605 \#   Exits lists cleanly and restores any indents that were in
11606 \#   effect prior to LIST.
11608 .MAC QUIT_LISTS END
11609 .   IQ CLEAR
11610 .   nr #HL_INDENT \\n[#STORED_HL_INDENT]
11611 .   nr #T_INDENT  \\n[#STORED_T_INDENT]
11612 .   rr #STORED_HL_INDENT
11613 .   if \\n[#RESTORE_PREV_INDENT]=1 \{\
11614 .      nr #L_INDENT  \\n[#STORED_L_INDENT]
11615 .      IL
11616 .      rr #STORED_L_INDENT
11617 .   \}
11618 .   if \\n[#RESTORE_PREV_INDENT]=2 \{\
11619 .      nr #BL_INDENT \\n[#STORED_BL_INDENT]
11620 .      nr #BR_INDENT \\n[#STORED_BR_INDENT]
11621 .      LL \\n[#ORIG_L_LENGTH]u
11622 .      IB
11623 .      rr #STORED_BL_INDENT
11624 .      rr #STORED_BR_INDENT
11625 .   \}
11626 .   if \\n[#RESTORE_PREV_INDENT]=3 \{\
11627 .      nr #R_INDENT \\n[#STORED_R_INDENT]
11628 .      LL \\n[#ORIG_L_LENGTH]u
11629 .      IR
11630 .      rr #STORED_R_INDENT
11631 .   \}
11632 .   if \\n[#RESTORE_PREV_INDENT]=4 \{\
11633 .      nr #R_INDENT \\n[#STORED_R_INDENT]
11634 .      nr #L_INDENT \\n[#STORED_L_INDENT]
11635 .      LL \\n[#ORIG_L_LENGTH]u
11636 .      IR
11637 .      IL
11638 .      rr #STORED_R_INDENT
11639 .      rr #STORED_L_INDENT
11640 .   \}
11641 .\" Clean up after exiting last depth of list
11642 .   nr #REMOVE 0 1
11643 .   while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\
11644 .      rr #LIST_INDENT\\n[#REMOVE]
11645 .      rr #ENUMERATOR\\n[#REMOVE]
11646 .      rm $ENUMERATOR\\n[#REMOVE]
11647 .      rr #SEPARATOR\\n[#REMOVE]
11648 .      rm $ENUMERATOR_TYPE\\n[#REMOVE]
11649 .      rr #PAD_LIST_DIGITS\\n[#REMOVE]
11650 .   \}
11651 .   rr #REMOVE
11652 .   rr #TOTAL_LISTS
11653 .   rr #QUIT
11654 .   rr #DEPTH
11655 .   rr #NEXT_DEPTH_BACK
11656 .   rr #RESTORE_PREV_INDENT
11657 .   rr #ORIG_L_LENGTH
11658 .   rr #CURRENT_L_LENGTH
11659 .END
11662 \# SET LIST INDENT
11663 \# ---------------
11664 \# *Arguments:
11665 \#   none
11666 \# *Function:
11667 \#   Restores indent of prev. list in nested lists.  Also sets the
11668 \#   #QUIT register if an invocation of LIST OFF applies to the first
11669 \#   level of list.
11671 .MAC SET_LIST_INDENT END
11672 .    nr #NEXT_DEPTH_BACK \\n[#DEPTH]-1
11673 .    if \\n[#NEXT_DEPTH_BACK]=0 \{\
11674 .       nr #QUIT 1
11675 .       return
11676 .    \}
11677 .    ie \\n[#NEXT_DEPTH_BACK]=1 \{ .nr #L_INDENT \\n[#LIST_INDENT1] \}
11678 .    el \{ .nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]] \}
11679 .    nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]]
11680 .END
11682 \# ====================================================================
11684 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
11686 \# COLLATE
11687 \# -------
11688 \# *Arguments:
11689 \#   <none>
11690 \# *Function:
11691 \#   Turns headers off (if on) and saves header state, sets register
11692 \#   #COLLATE to 1 (toggle), and breaks to a new page.
11693 \# *Notes:
11694 \#   COLLATE exists primarily to allow putting multiple chapters in
11695 \#   a single file, although it can be used for any document type.  After
11696 \#   COLLATE, any of the macros that normally precede START may be
11697 \#   used, and should behave as expected.
11699 \#   N.B.--the START macro *must* be used after COLLATE (and any other
11700 \#   macros that alter mom's behaviour).
11702 .MAC COLLATE END
11703 .    nr #COLLATE 1
11704 .    nr #HEADER_STATE \\n[#HEADERS_ON]
11705 .    HEADERS OFF
11706 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
11707 .       nr #PAGINATION_STATE \\n[#PAGINATE]
11708 .       PAGINATION OFF
11709 .    \}
11710 .    IQ CLEAR
11711 .    TQ
11712 \# Collect first doc's title for TOC
11713 .    if \\n[#COLLATED_DOC]=0 \{\
11714 .       ie \\n[#USER_SET_TITLE_ITEM] \{\
11715 .          ds $FIRST_DOC_TITLE \\*[$USER_SET_TITLE_ITEM]\\|
11716 .          rr #USER_SET_TITLE_ITEM
11717 .          rm $USER_SET_TITLE_ITEM
11718 .       \}
11719 .       el \{\
11720 .          ie \\n[#DOC_TYPE]=2 \{\
11721 .             ie '\\*[$CHAPTER_TITLE]'' \{\
11722 .                ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
11723 .             \}
11724 .             el \{\
11725 .                ie '\\*[$CHAPTER]'' \{\
11726 .                   ds $FIRST_DOC_TITLE \\*[$CHAPTER_TITLE]\\|
11727 .                \}
11728 .                el \{\
11729 .                   ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
11730 .                \}
11731 .             \}
11732 .          \}
11733 .          el \{\
11734 .             ds $FIRST_DOC_TITLE \\*[$TITLE]\\|
11735 .          \}
11736 .       \}
11737 .       if \\n[#TOC_AUTHORS]=1 \{\
11738 .          ie '\\*[$TOC_AUTHORS]'' \{\
11739 .             as $FIRST_DOC_TITLE /\\|\\*[$AUTHOR_1]\\|
11740 .          \}
11741 .          el \{\
11742 .             as $FIRST_DOC_TITLE /\\|\\*[$TOC_AUTHORS]\\|
11743 .             rm $TOC_AUTHORS
11744 .          \}
11745 .       \}
11746 .       nr #COLLATED_DOC 1
11747 .    \}
11748 \# End title collection for TOC
11749 .    LL \\n[#DOC_L_LENGTH]u
11750 .    QUAD $DOC_QUAD
11751 .    LS \\n[#DOC_LEAD]u
11752 \*[SLANTX]
11753 \*[CONDX]
11754 \*[EXTX]
11755 '    NEWPAGE
11756 .    if \\n[#DEFER_PAGINATION] \{ .PAGINATE \}
11757 .    if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
11758 .       PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
11759 .       rm $RESTORE_PAGENUM_STYLE
11760 .    \}
11761 .    rm $EN_TITLE
11762 .    rr #PAGENUM_STYLE_SET
11763 .END
11766 \# OUTPUT BLANK PAGES
11767 \# ------------------
11768 \# *Argument:
11769 \#   <number of blank pages to output>
11770 \# *Function:
11771 \#   Outputs blank pages.
11772 \# *Notes:
11773 \#   If recto/verso, each page is recto/verso, even if there's
11774 \#   nothing on it.
11776 .MAC BLANKPAGE END
11777 .    nr #HOW_MANY \\$1
11778 .    nr #PAGES 0 1
11779 .    while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
11780 .    if \\n[#HEADERS_ON]=1 \{\
11781 .       nr #HEADERS_WERE_ON 1
11782 .       HEADERS OFF
11783 .    \}
11784 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
11785 .       if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
11786 .       PAGINATION OFF
11787 .    \}
11788 .    NEWPAGE
11789 .    PRINT \&
11790 .    if \\n[#FOOTERS_ON]=1 \{\
11791 .       nr #FOOTERS_WERE_ON 1
11792 .       FOOTERS OFF
11793 .    \}
11794 .    if \\n[#PAGE_NUM_V_POS]=2 \{\
11795 .       if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
11796 .       PAGINATION OFF
11797 .    \}
11798 .    if \\n[#HEADERS_WERE_ON] \{ .HEADERS \}
11799 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
11800 .       if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
11801 .    \}
11802 .    \}
11803 .    NEWPAGE
11804 .    if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \}
11805 .    if \\n[#PAGE_NUM_V_POS]=2 \{\
11806 .       if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
11807 .     \}
11808 .    rr #HEADERS_WERE_ON
11809 .    rr #FOOTERS_WERE_ON
11810 .    rr #PAGINATE_WAS_ON
11811 .END
11814 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
11815 \# ---------------------------------------
11816 \# *Arguments:
11817 \#   <none>
11818 \# *Function:
11819 \#   Sets header/footer/footnotes/etc... traps.
11820 \#     Calculates the number of lines that actually fit on a
11821 \#   page based on #B_MARGIN and resets page bottom trap to coincide
11822 \#   with the depth of that number of lines, or, if #ADJ_DOC_LEAD=1,
11823 \#   adjusts #DOC_LEAD so that the last line of text on a page falls
11824 \#   exactly on #B_MARGIN.
11826 .MAC TRAPS END
11827 \#  *Remove all header/footer traps
11828 .    if !\\n[#NO_TRAP_RESET] \{\
11829 .       ch DO_T_MARGIN
11830 .       ch DO_B_MARGIN
11831 .       ch HEADER
11832 .       ch FOOTER
11833 \#  *Plant header trap
11834 .       wh 0 HEADER
11835 .    \}
11836 \#  *Adjust lead so last line of text falls on B_MARGIN,...
11837 .    ie \\n[#ADJ_DOC_LEAD]=1 \{\
11838 .       nr #LINES_PER_PAGE 0 1
11839 .       nr #DOC_LEAD_ADJ 0 1
11840 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
11841 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
11843 .       \}
11844 .       nr #LINES_PER_PAGE -1
11845 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
11847 .       \}
11848 .       DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
11849 .    \}
11850 \#  *...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
11851 \#  *on the page.
11852 .    el \{\
11853 .       nr #LINES_PER_PAGE 0 1
11854 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
11855 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
11857 .       \}
11858 .       nr #B_MARGIN \\n[#PAGE_LENGTH]-(\\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n[#LINES_PER_PAGE]))
11859 .    \}
11860 \#  *Set footer and footnote overflow traps
11861 .    if !\\n[#NO_TRAP_RESET] \{\
11862 .       nr #FN_COUNT 0 1
11863 .       nr #SPACE_REMAINING 0
11864 .       nr #FN_DEPTH 0
11865 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
11866 .       wh 12i FOOTER
11867 .       wh -\\n[#B_MARGIN]u FN_OVERFLOW_TRAP
11868 .       ch FOOTER -\\n[#B_MARGIN]u
11869 .    \}
11870 .    rr #ADJ_DOC_LEAD
11871 .END
11874 \# CHECK INDENT
11875 \# ------------
11876 \# *Arguments:
11877 \#   <none>
11878 \# *Function:
11879 \#   Adds left, right, or both indent values to document elements
11880 \#   like heads and subheads that are processed in environments.
11882 .MAC CHECK_INDENT END
11883 .    if \\n[#INDENT_LEFT_ACTIVE] \{\
11884 .       in \\n[#L_INDENT]u
11885 .       if \\n[#QUOTE] \{\
11886 .          in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
11887 .          ll -\\n[#L_INDENT]u
11888 .          ta \\n(.lu
11889 .       \}
11890 .       if \\n[#EPIGRAPH] \{\
11891 .          in -\\n[#L_INDENT]u
11892 .          ll -\\n[#L_INDENT]u
11893 .          ta \\n(.lu
11894 .       \}
11895 .    \}
11896 .    if \\n[#INDENT_RIGHT_ACTIVE] \{\
11897 .       ll -\\n[#R_INDENT]u
11898 .       ta \\n(.lu
11899 .    \}
11900 .    if \\n[#INDENT_BOTH_ACTIVE] \{\
11901 .       in \\n[#BL_INDENT]u
11902 .       ll -\\n[#BR_INDENT]u
11903 .       ta \\n(.lu
11904 .       if \\n[#QUOTE] \{\
11905 .          in -\\n[#BL_INDENT]u
11906 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
11907 .             ll -\\n[#BR_INDENT]u
11908 .             ta \\n(.lu
11909 .          \}
11910 .          el \{\
11911 .             ll -(\\n[#BR_INDENT]u/2u)
11912 .             ta \\n(.lu
11913 .          \}
11914 .       \}
11915 .       if \\n[#EPIGRAPH] \{\
11916 .          in -\\n[#BL_INDENT]u
11917 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
11918 .             ll -\\n[#BR_INDENT]u
11919 .             ta \\n(.lu
11920 .          \}
11921 .          el \{\
11922 .             ll -(\\n[#BR_INDENT]u/2u)
11923 .             ta \\n(.lu
11924 .          \}
11925 .       \}
11926 .    \}
11927 .END
11930 \# REMOVE INDENT
11931 \# -------------
11932 \# *Arguments:
11933 \#   <none>
11934 \# *Function:
11935 \#   Removes left, right, or both indent values from document elements
11936 \#   like heads and subheads that are processed in environments.
11938 .MAC REMOVE_INDENT END
11939 .    in 0
11940 .    ll \\n[#L_LENGTH]u
11941 .    ta \\n(.lu
11942 .END
11945 \# Set up a default papersize of US letter
11947 .PAPER LETTER
11949 \# ====================================================================
11951 \# +++DOCUMENT PROCESSING ALIASES+++
11953 \# Aliases to make life easier for users: synonyms, short forms
11954 \# and alternate spellings.
11956 \# Macros
11957 \# ------
11958 .ALIAS   BLOCKQUOTE_COLOUR               BLOCKQUOTE_COLOR
11959 .ALIAS   BREAK_BLOCKQUOTE                BREAK_QUOTE
11960 .ALIAS   BREAK_CITATION                  BREAK_QUOTE
11961 .ALIAS   BREAK_CITE                      BREAK_QUOTE
11962 .ALIAS   CITATION                        BLOCKQUOTE
11963 .ALIAS   CITATION_COLOUR                 CITATION_COLOR
11964 .ALIAS   CITATION_FAMILY                 BLOCKQUOTE_FAMILY
11965 .ALIAS   CITATION_FONT                   BLOCKQUOTE_FONT
11966 .ALIAS   CITATION_SIZE                   BLOCKQUOTE_SIZE
11967 .ALIAS   CITATION_COLOR                  BLOCKQUOTE_COLOR
11968 .ALIAS   CITATION_QUAD                   BLOCKQUOTE_QUAD
11969 .ALIAS   CITE                            BLOCKQUOTE
11970 .ALIAS   CITE_COLOUR                     CITE_COLOR
11971 .ALIAS   CITE_FAMILY                     BLOCKQUOTE_FAMILY
11972 .ALIAS   CITE_FONT                       BLOCKQUOTE_FONT
11973 .ALIAS   CITE_SIZE                       BLOCKQUOTE_SIZE
11974 .ALIAS   CITE_COLOR                      BLOCKQUOTE_COLOR
11975 .ALIAS   CITE_QUAD                       BLOCKQUOTE_QUAD
11976 .ALIAS   DOC_R_MARGIN                    DOC_RIGHT_MARGIN
11977 .ALIAS   DOC_L_MARGIN                    DOC_LEFT_MARGIN
11978 .ALIAS   DOC_L_LENGTH                    DOC_LINE_LENGTH
11979 .ALIAS   DOC_RMARGIN                     DOC_RIGHT_MARGIN
11980 .ALIAS   DOC_LMARGIN                     DOC_LEFT_MARGIN
11981 .ALIAS   DOC_LLENGTH                     DOC_LINE_LENGTH
11982 .ALIAS   DOC_FAM                         DOC_FAMILY
11983 .ALIAS   DOC_LS                          DOC_LEAD
11984 .ALIAS   DOC_PS                          DOC_PT_SIZE
11985 .ALIAS   DOCHEADER_COLOUR                DOCHEADER_COLOUR
11986 .ALIAS   EPIGRAPH_COLOUR                 EPIGRAPH_COLOR
11987 .ALIAS   FILL                            QUAD
11988 .ALIAS   FINIS_COLOUR                    FINIS_COLOR
11989 .ALIAS   HEAD_COLOUR                     HEAD_COLOR
11990 .ALIAS   LINEBREAK_COLOUR                LINEBREAK_COLOR
11991 .ALIAS   PAGENUM                         PAGENUMBER
11992 .ALIAS   PAGENUM_COLOUR                  PAGENUM_COLOR
11993 .ALIAS   PAGINATION                      PAGINATE
11994 .ALIAS   PARAHEAD_COLOUR                 PARAHEAD_COLOR
11995 .ALIAS   PP_FT                           PP_FONT
11996 .ALIAS   QUOTE_COLOUR                    QUOTE_COLOR
11997 .ALIAS   SUBHEAD_COLOUR                  SUBHEAD_COLOR
11998 .ALIAS   TOC_FAM                         TOC_FAM
11999 .ALIAS   TOC_PS                          TOC_PT_SIZE
12001 \# HEADER and FOOTER aliases for HDRFTR macros.
12003 .ALIAS   ENDNOTES_FOOTER_CENTER          ENDNOTES_HDRFTR_CENTER
12004 .ALIAS   ENDNOTES_HEADER_CENTER          ENDNOTES_HDRFTR_CENTER
12005 .ALIAS   ENDNOTES_FOOTER_CENTRE          ENDNOTES_HDRFTR_CENTRE
12006 .ALIAS   ENDNOTES_HEADER_CENTRE          ENDNOTES_HDRFTR_CENTRE
12007 .ALIAS   FOOTER_CENTER_CAPS              HDRFTR_CENTER_CAPS
12008 .ALIAS   FOOTER_CENTER_COLOR             HDRFTR_CENTER_COLOR
12009 .ALIAS   FOOTER_CENTER_COLOUR            HDRFTR_CENTER_COLOUR
12010 .ALIAS   FOOTER_CENTER_FAM               HDRFTR_CENTER_FAMILY
12011 .ALIAS   FOOTER_CENTER_FAMILY            HDRFTR_CENTER_FAMILY
12012 .ALIAS   FOOTER_CENTER_FONT              HDRFTR_CENTER_FONT
12013 .ALIAS   FOOTER_CENTER_FT                HDRFTR_CENTER_FONT
12014 .ALIAS   FOOTER_CENTER                   HDRFTR_CENTER
12015 .ALIAS   FOOTER_CENTER_PAD               HDRFTR_CENTER_PAD
12016 .ALIAS   FOOTER_CENTER_PS                HDRFTR_CENTER_SIZE
12017 .ALIAS   FOOTER_CENTER_SIZE              HDRFTR_CENTER_SIZE
12018 .ALIAS   FOOTER_CENTRE_CAPS              HDRFTR_CENTER_CAPS
12019 .ALIAS   FOOTER_CENTRE_COLOR             HDRFTR_CENTRE_COLOR
12020 .ALIAS   FOOTER_CENTRE_COLOUR            HDRFTR_CENTRE_COLOUR
12021 .ALIAS   FOOTER_CENTRE_FAM               HDRFTR_CENTER_FAMILY
12022 .ALIAS   FOOTER_CENTRE_FAMILY            HDRFTR_CENTER_FAMILY
12023 .ALIAS   FOOTER_CENTRE_FONT              HDRFTR_CENTER_FONT
12024 .ALIAS   FOOTER_CENTRE_FT                HDRFTR_CENTER_FONT
12025 .ALIAS   FOOTER_CENTRE                   HDRFTR_CENTER
12026 .ALIAS   FOOTER_CENTRE_PAD               HDRFTR_CENTER_PAD
12027 .ALIAS   FOOTER_CENTRE_PS                HDRFTR_CENTER_SIZE
12028 .ALIAS   FOOTER_CENTRE_SIZE              HDRFTR_CENTER_SIZE
12029 .ALIAS   FOOTER_COLOR                    HDRFTR_COLOR
12030 .ALIAS   FOOTER_COLOUR                   HDRFTR_COLOR
12031 .ALIAS   FOOTER_FAM                      HDRFTR_FAMILY
12032 .ALIAS   FOOTER_FAMILY                   HDRFTR_FAMILY
12033 .ALIAS   FOOTER_LEFT_CAPS                HDRFTR_LEFT_CAPS
12034 .ALIAS   FOOTER_LEFT_COLOR               HDRFTR_LEFT_COLOR
12035 .ALIAS   FOOTER_LEFT_COLOUR              HDRFTR_LEFT_COLOUR
12036 .ALIAS   FOOTER_LEFT_FAM                 HDRFTR_LEFT_FAMILY
12037 .ALIAS   FOOTER_LEFT_FAMILY              HDRFTR_LEFT_FAMILY
12038 .ALIAS   FOOTER_LEFT_FONT                HDRFTR_LEFT_FONT
12039 .ALIAS   FOOTER_LEFT_FT                  HDRFTR_LEFT_FONT
12040 .ALIAS   FOOTER_LEFT                     HDRFTR_LEFT
12041 .ALIAS   FOOTER_LEFT_PS                  HDRFTR_LEFT_SIZE
12042 .ALIAS   FOOTER_LEFT_SIZE                HDRFTR_LEFT_SIZE
12043 .ALIAS   FOOTER_PLAIN                    HDRFTR_PLAIN
12044 .ALIAS   FOOTER_RECTO                    HDRFTR_RECTO
12045 .ALIAS   FOOTER_RIGHT_CAPS               HDRFTR_RIGHT_CAPS
12046 .ALIAS   FOOTER_RIGHT_COLOR              HDRFTR_RIGHT_COLOR
12047 .ALIAS   FOOTER_RIGHT_COLOUR             HDRFTR_RIGHT_COLOUR
12048 .ALIAS   FOOTER_RIGHT_FAM                HDRFTR_RIGHT_FAMILY
12049 .ALIAS   FOOTER_RIGHT_FAMILY             HDRFTR_RIGHT_FAMILY
12050 .ALIAS   FOOTER_RIGHT_FONT               HDRFTR_RIGHT_FONT
12051 .ALIAS   FOOTER_RIGHT_FT                 HDRFTR_RIGHT_FONT
12052 .ALIAS   FOOTER_RIGHT                    HDRFTR_RIGHT
12053 .ALIAS   FOOTER_RIGHT_PS                 HDRFTR_RIGHT_SIZE
12054 .ALIAS   FOOTER_RIGHT_SIZE               HDRFTR_RIGHT_SIZE
12055 .ALIAS   FOOTER_RULE_COLOR               HDRFTR_RULE_COLOR
12056 .ALIAS   FOOTER_RULE_GAP                 HDRFTR_RULE_GAP
12057 .ALIAS   FOOTER_RULE                     HDRFTR_RULE
12058 .ALIAS   FOOTER_SIZE                     HDRFTR_SIZE
12059 .ALIAS   FOOTER_VERSO                    HDRFTR_VERSO
12060 .ALIAS   HEADER_CENTER_CAPS              HDRFTR_CENTER_CAPS
12061 .ALIAS   HEADER_CENTER_COLOR             HDRFTR_CENTER_COLOR
12062 .ALIAS   HEADER_CENTER_COLOUR            HDRFTR_CENTER_COLOUR
12063 .ALIAS   HEADER_CENTER_FAM               HDRFTR_CENTER_FAMILY
12064 .ALIAS   HEADER_CENTER_FAMILY            HDRFTR_CENTER_FAMILY
12065 .ALIAS   HEADER_CENTER_FONT              HDRFTR_CENTER_FONT
12066 .ALIAS   HEADER_CENTER_FT                HDRFTR_CENTER_FONT
12067 .ALIAS   HEADER_CENTER                   HDRFTR_CENTER
12068 .ALIAS   HEADER_CENTER_PAD               HDRFTR_CENTER_PAD
12069 .ALIAS   HEADER_CENTER_PS                HDRFTR_CENTER_SIZE
12070 .ALIAS   HEADER_CENTER_SIZE              HDRFTR_CENTER_SIZE
12071 .ALIAS   HEADER_CENTRE_CAPS              HDRFTR_CENTER_CAPS
12072 .ALIAS   HEADER_CENTRE_COLOR             HDRFTR_CENTRE_COLOR
12073 .ALIAS   HEADER_CENTRE_COLOUR            HDRFTR_CENTRE_COLOUR
12074 .ALIAS   HEADER_CENTRE_FAM               HDRFTR_CENTER_FAMILY
12075 .ALIAS   HEADER_CENTRE_FAMILY            HDRFTR_CENTER_FAMILY
12076 .ALIAS   HEADER_CENTRE_FONT              HDRFTR_CENTER_FONT
12077 .ALIAS   HEADER_CENTRE_FT                HDRFTR_CENTER_FONT
12078 .ALIAS   HEADER_CENTRE                   HDRFTR_CENTER
12079 .ALIAS   HEADER_CENTRE_PAD               HDRFTR_CENTER_PAD
12080 .ALIAS   HEADER_CENTRE_PS                HDRFTR_CENTER_SIZE
12081 .ALIAS   HEADER_CENTRE_SIZE              HDRFTR_CENTER_SIZE
12082 .ALIAS   HEADER_COLOR                    HDRFTR_COLOR
12083 .ALIAS   HEADER_COLOUR                   HDRFTR_COLOR
12084 .ALIAS   HEADER_FAM                      HDRFTR_FAMILY
12085 .ALIAS   HEADER_FAMILY                   HDRFTR_FAMILY
12086 .ALIAS   HEADER_LEFT_CAPS                HDRFTR_LEFT_CAPS
12087 .ALIAS   HEADER_LEFT_COLOR               HDRFTR_LEFT_COLOR
12088 .ALIAS   HEADER_LEFT_COLOUR              HDRFTR_LEFT_COLOUR
12089 .ALIAS   HEADER_LEFT_FAM                 HDRFTR_LEFT_FAMILY
12090 .ALIAS   HEADER_LEFT_FAMILY              HDRFTR_LEFT_FAMILY
12091 .ALIAS   HEADER_LEFT_FONT                HDRFTR_LEFT_FONT
12092 .ALIAS   HEADER_LEFT_FT                  HDRFTR_LEFT_FONT
12093 .ALIAS   HEADER_LEFT                     HDRFTR_LEFT
12094 .ALIAS   HEADER_LEFT_PS                  HDRFTR_LEFT_SIZE
12095 .ALIAS   HEADER_LEFT_SIZE                HDRFTR_LEFT_SIZE
12096 .ALIAS   HEADER_PLAIN                    HDRFTR_PLAIN
12097 .ALIAS   HEADER_RECTO                    HDRFTR_RECTO
12098 .ALIAS   HEADER_RIGHT_CAPS               HDRFTR_RIGHT_CAPS
12099 .ALIAS   HEADER_RIGHT_COLOR              HDRFTR_RIGHT_COLOR
12100 .ALIAS   HEADER_RIGHT_COLOUR             HDRFTR_RIGHT_COLOUR
12101 .ALIAS   HEADER_RIGHT_FAM                HDRFTR_RIGHT_FAMILY
12102 .ALIAS   HEADER_RIGHT_FAMILY             HDRFTR_RIGHT_FAMILY
12103 .ALIAS   HEADER_RIGHT_FONT               HDRFTR_RIGHT_FONT
12104 .ALIAS   HEADER_RIGHT_FT                 HDRFTR_RIGHT_FONT
12105 .ALIAS   HEADER_RIGHT                    HDRFTR_RIGHT
12106 .ALIAS   HEADER_RIGHT_PS                 HDRFTR_RIGHT_SIZE
12107 .ALIAS   HEADER_RIGHT_SIZE               HDRFTR_RIGHT_SIZE
12108 .ALIAS   HEADER_RULE_COLOR               HDRFTR_RULE_COLOR
12109 .ALIAS   HEADER_RULE_GAP                 HDRFTR_RULE_GAP
12110 .ALIAS   HEADER_RULE                     HDRFTR_RULE
12111 .ALIAS   HEADER_SIZE                     HDRFTR_SIZE
12112 .ALIAS   HEADER_VERSO                    HDRFTR_VERSO
12113 .ALIAS   SWITCH_FOOTERS                  SWITCH_HDRFTR
12114 .ALIAS   SWITCH_HEADERS                  SWITCH_HDRFTR
12116 \# Support aliases
12118 .ALIAS   COL_BREAK                       COL_NEXT
12119 .ALIAS   PRINT_FOOTNOTE_RULE             FOOTNOTE_RULE