3 Mom -- a typesetting/document-processing macro set for groff.
5 Copyright (C) 2002, 2003 Free Software Foundation, Inc.
6 Written by Peter Schaffter (peter@faustus.dyn.ca)
8 This file is part of groff.
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
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
20 You should have received a copy of the GNU General Public License along
21 with groff; see the file COPYING. If not, write to the Free Software
22 Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 Antoine de St-Exupéry asserted that elegance in engineering is
27 achieved not when there is nothing left to add, but when there is
28 nothing left to take away.
30 By those standards, mom is a Rube Goldberg contraption. She was
31 created over the years while groff, and my understanding of it,
32 changed and evolved. However, I'm a firm believer in "if it
33 ain't broke, don't fix it," so I'm leaving any major clean-up
34 of redundancies and whatnot for a rainy day.
36 Inasmuch as possible, macros that turn a feature on or off follow
37 a similar style. Invoking the macro without an argument turns
38 the feature on. Invoking it with any other argument turns it off.
39 Use of the argument OFF is recommended, but not required; users
40 may find other conventions preferable (e.g. NO, X, END, QUIT, etc.).
42 "<anything>" in the description of arguments that can be passed
43 to a macro means that any argument turns the feature off.
46 \# ====================================================================
48 \# Check which version of groff is being run
49 .if (\n[.x]\n[.y] < 118) \
50 . ab You need GNU troff version 1.18 or higher to run this version of mom.
51 \# Check that GNU troff is being run
53 . ab The mom macros require that you be running GNU troff.
55 . ab The groff mom macros do not work in compatibility mode.
56 \# Add supplementary styles
57 .sty \n[.fp] L \" Light Roman
58 .sty \n[.fp] LI \" Light Italic
59 .sty \n[.fp] LCD \" Light Condensed Roman
60 .sty \n[.fp] LCDI \" Light Condensed Italic
61 .sty \n[.fp] LEX \" Light Extended Roman
62 .sty \n[.fp] LEXI \" Light Extended Italic
63 .sty \n[.fp] CD \" Medium/Book Condensed Roman
64 .sty \n[.fp] CDI \" Medium/Book Condensed Italic
65 .sty \n[.fp] EX \" Medium/Book Extended Roman
66 .sty \n[.fp] EXI \" Medium/Book Extended Italic
67 .sty \n[.fp] DB \" DemiBold Roman
68 .sty \n[.fp] DBI \" DemiBold Italic
69 .sty \n[.fp] BCD \" Bold Condensed Roman
70 .sty \n[.fp] BCDI \" Bold Condensed Italic
71 .sty \n[.fp] BEX \" Bold Extended Roman
72 .sty \n[.fp] BEXI \" Bold Extended Italic
73 .sty \n[.fp] HV \" Heavy Roman
74 .sty \n[.fp] HVI \" Heavy Italic
75 .sty \n[.fp] HVCD \" Heavy Condensed Roman
76 .sty \n[.fp] HVCDI \" Heavy Condensed Italic
77 .sty \n[.fp] HVEX \" Heavy Extended Roman
78 .sty \n[.fp] HVEXI \" Heavy Extended Italic
79 .sty \n[.fp] BL \" Black Roman
80 .sty \n[.fp] BLI \" Black Italic
81 .sty \n[.fp] BLCD \" Black Condensed Roman
82 .sty \n[.fp] BLCDI \" Black Condensed Italic
83 .sty \n[.fp] BLEX \" Black Extended Roman
84 .sty \n[.fp] BLEXI \" Black Extended Italic
85 .sty \n[.fp] UBL \" Ultra-Black Roman
86 .sty \n[.fp] UBLI \" Ultra-Black Italic
88 \# ====================================================================
90 \# TYPESETTING MACROS, STRINGS, AND ALIASES
91 \# ========================================
95 \# Alias .als as ALIAS, and .aln (number registers) as ALIASN
101 \# ALIASES FOR GROFF REQUESTS
102 \# --------------------------
112 \# ALIASES FOR NUMBER REGISTERS
113 \# ----------------------------
115 .ALIASN #PT_SIZE .ps \"fractional point size in units
116 .ALIASN #DIVER_DEPTH dn \"diversion depth
117 .ALIASN #DIVER_WIDTH dl \"diversion width
118 .ALIASN #TRAP_DISTANCE .t \"distance to next trap
119 .ALIASN #LEAD .v \"line space (.vs, not .ls)
120 .ALIASN #PAGE_LENGTH .p \"page length
121 .ALIASN #NUM_ARGS .$ \"number of arguments passed to a macro
122 .ALIASN #INDENT .i \"value of current indent
124 \# ====================================================================
128 .nr #L_MARGIN \n(.o \" Tabs, etc require #L_MARGIN
129 .cflags 4 /\(en \" So slash and en-dashes get broken
136 There's a lot of testing for the presence of number registers and
137 strings in this macro file. Many of the registers and strings
138 pop into and out of existence on the fly. For convenience, I
141 .if \\n[whatever] and .if !\\n[whatever]
143 to test "if the register exists and is (not) empty." Groff,
144 encountering such tests when called with the -ww options, emits
146 warning: number register whatever not defined.
148 Groff also warns about strings similarly tested for.
150 The warn level, above, is high in order to shut off those
151 warnings. If you're futzing in this file and need more verbose
152 warnings, either comment out ".warn 8192" or set the warnlevel
153 to the one you need (but be ready for lots of what I've just
157 \# ====================================================================
161 \# Macros that control the physical layout of the page: paper size
167 \# <width of printer sheet>
169 \# Stores user supplied page width in register #PAGE_WIDTH.
171 \# #PAGE_WIDTH is used to establish the default LL (and right margin).
172 \# Requires unit of measure.
176 . nr #PAGE_WIDTH \\$1
177 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
178 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
185 \# <offset from page left>
187 \# Stores user supplied page offset in register #L_MARGIN.
188 \# Sets .po to user supplied offset.
190 \# Requires unit of measure.
194 . nr #L_MARGIN (\\$1)
202 \# <width of right margin>
204 \# Stores user supplied right margin in register #R_MARGIN.
206 \# This is a pseudo-margin. Right margin is actually a function of
207 \# line length. The macro calculates line length from the page offset
208 \# and the value plugged into #R_MARGIN.
210 \# N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
212 \# Requires unit of measure.
216 . nr #R_MARGIN (\\$1)
217 . ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
219 . nr #L_LENGTH \\n(.l
226 \# <distance to advance from top of page>
228 \# Stores the user supplied top margin in register #T_MARGIN.
229 \# Advances user supplied depth from the top of the page.
231 \# Requires unit of measure.
234 . nr #T_MARGIN (\\$1)
237 . sp |\\n[#T_MARGIN]u-1v
246 \# <space to leave at the bottom of the page>
248 \# Stores the user supplied bottom margin in register #B_MARGIN.
250 \# Requires unit of measure.
254 . nr #B_MARGIN (\\$1)
255 . nr #ORIGINAL_B_MARGIN \\n[#B_MARGIN]
257 . wh -\\n[#B_MARGIN]u DO_B_MARGIN
264 \# <pagewidth> [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
266 \# Page set-up. Collects arguments and passes them to the appropriate
269 \# All arguments after pagewidth are optional, but must appear
270 \# in the order given above. (User can fill in as much or as
271 \# little as desired.)
273 \# All arguments require a unit of measure.
279 . ie '\\$3'' \{ .L_MARGIN \\n(.o \}
280 . el \{ .L_MARGIN \\$3 \}
281 . ie '\\$4'' \{ .R_MARGIN 1i \}
282 . el \{ .R_MARGIN \\$4 \}
283 . if !'\\$5'' \{ .T_MARGIN \\$5 \}
284 . if !'\\$6'' \{ .B_MARGIN \\$6 \}
287 \# =====================================================================
289 \# +++PAGE CONTROL+++
291 \# Generic macros for breaking pages.
298 \# Plants the top margin at the top of each page.
300 \# The trap is set in .T_MARGIN or .PAGE
305 . sp |\\n[#T_MARGIN]u-1v
307 . sp -\\n[#T_MARGIN_LEAD_ADJ]u
316 \# Plants the bottom margin at the bottom of each page.
318 \# The trap is set in .B_MARGIN or .PAGE.
321 . nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000
333 \# Breaks to a new page.
335 \# If a B_MARGIN has been set, processes that, otherwise, just
336 \# breaks to a new page.
341 . ie \\n[#B_MARGIN_SET]=1 \{\
342 . ie !\\n[#DOCS]=1 \{\
348 . if \\n[#COLUMNS]=1 \{ .nr #COL_NUM \\n[#NUM_COLS] \}
349 . ie !\\n[#FN_DEPTH] \{\
350 . ch FN_OVERFLOW_TRAP
352 . wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
364 \# =====================================================================
366 \# +++GENERAL STYLE MACROS+++
368 \# Macros that are likely to appear together to define general
369 \# type style: line length, family, font, point size, and line
377 \# Stores user supplied line length in register #L_LENGTH.
378 \# Sets .ll to #L_LENGTHu
380 \# Requires unit of measure.
383 . nr #USER_SET_L_LENGTH 1
385 . nr #L_LENGTH \\n(.l
390 \# +++FAMILY AND FONT+++
395 \# <fallback font> [ ABORT | WARN ] | ABORT | WARN
397 \# Sets register #ABORT_FT_ERRORS to 1, or defines a fallback font
398 \# called "dummy" at font position 0.
400 \# Calls to non-existent families cause mom to continue processing
401 \# files using the fallback font until a valid family is entered.
403 \# Calls to non-existent fonts generate warnings. If ABORT is passed
404 \# to FALLBACK_FONT, mom stops processing files after the warning.
405 \# Otherwise, she continues to process files using the fallback font
406 \# after the warning is issued. The default fallback font is CR; the
407 \# default for font warnings is to abort.
409 .MAC FALLBACK_FONT END
410 . if \\n[#NUM_ARGS]=1 \{\
411 . if '\\$1'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
413 . if r#ABORT_FT_ERRORS \{ .nr #ABORT_FT_ERRORS 0 \}
415 . if !'\\$1'ABORT' \{\
416 . if !'\\$1'WARN' \{\
421 . if \\n[#NUM_ARGS]=2 \{\
423 . if '\\$2'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
424 . if '\\$2'WARN' \{ .nr #ABORT_FT_ERRORS 0 \}
428 .FALLBACK_FONT CR ABORT
435 \# Stores user supplied font family in string $FAMILY. Sets .fam
439 . if \\n[#PRINT_STYLE]=1 \{\
443 . if \\n[#IGNORE] \{\
447 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
448 . ds $SAVED_STYLE \\n[.sty]
453 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
454 . ft \\*[$SAVED_STYLE]
459 . if \\n[#COLLATE]=1 \{\
460 . if !r#START \{ .DOC_FAM \\*[$FAMILY] \}
468 \# R | I | B | BI | <other style extension>
470 \# Stores user supplied font in $FONT and sets .ft to $FONT.
473 . if \\n[#PRINT_STYLE]=1 \{\
475 . if \\n[#UNDERLINE_ITALIC]=1 \{\
479 . if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
485 . el \{ .UNDERLINE OFF \}
491 . if if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
492 . if '\\n[.sty]'' \{\
494 . if !S\\*[$FONT] \{\
495 . tm1 "[mom]: Font style "\\*[$FONT]" at line \\n(.c has not been registered.
496 . ie \\n[#ABORT_FT_ERRORS]=0 \{\
497 . tm1 " Continuing to process using fallback font.
502 . tm1 "[mom]: Either font style "\\*[$FONT]" at line \\n(.c does not exist in family "\\n[.fam]",
503 . tm1 " or family "\\n[.fam]" has not been installed in font/devps.
504 . ie \\n[#ABORT_FT_ERRORS]=0 \{\
505 . tm1 " Continuing to process using fallback font.
518 \# <point size of type>
520 \# Sets point size to user supplied value in scaled points.
521 \# If #AUTO_LEAD is on, sets .vs to #AUTOLEAD_VALUE+#PT_SIZE.
523 \# Must NOT use a unit of measure.
526 . if \\n[#PRINT_STYLE]=1 \{ .return \}
527 . if \\n[#IGNORE] \{ .return \}
530 . if \\n[#AUTO_LEAD] \{\
531 . ie \\n[#AUTOLEAD_FACTOR] \{ .vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u \}
532 . el \{ .vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u \}
534 . nr #PT_SIZE_IN_UNITS \\n[.ps]
541 \# <point size of type>
543 \# Sets point size to user supplied value in scaled points.
544 \# Intended to be called inline with \*[SIZE <n><unit>]
546 \# Can be used with a unit of measure or not.
557 \# <leading between lines of text>
559 \# Turns off #AUTOLEAD if it's on.
560 \# Sets .vs to user supplied value.
562 \# Does not require unit of measure. LS automatically turns off AUTOLEAD.
566 . nr #OLD_LEAD \\n(.v
567 . if \\n[#PRINT_STYLE]=1 \{ .return \}
568 . if \\n[#IGNORE] \{ .return \}
569 . if \\n[#AUTO_LEAD] \{\
571 . rr #AUTOLEAD_FACTOR
575 . nr #TOP_BASELINE_ADJ \\n(.v-\\n[#OLD_LEAD]
576 . sp -\\n[#TOP_BASELINE_ADJ]u
578 . rr #TOP_BASELINE_ADJ
591 \# <leading value to add to #PT_SIZE> [FACTOR]
593 \# Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
594 \# Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
595 \# All subsequent PT_SIZE requests reset the leading in the same way until
596 \# AUTOLEAD is turned off.
598 \# With the optional FACTOR argument, the current point size is
599 \# multiplied by #AUTOLEAD_VALUE instead of the two being added
603 . if \\n[#PRINT_STYLE]=1 \{ .return \}
604 . if \\n[#IGNORE] \{ .return \}
606 . nr #OLD_LEAD \\n(.v
607 . nr #AUTOLEAD_VALUE (p;\\$1)
608 . ie \\n[#NUM_ARGS]=2 \{\
609 . if '\\$2'FACTOR' \{\
610 . nr #AUTOLEAD_FACTOR 1
611 . vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u
615 . vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u
618 . nr #TOP_BASELINE_ADJ \\n(.v-\\n[#OLD_LEAD]
619 . sp -\\n[#TOP_BASELINE_ADJ]u
621 . rr #TOP_BASELINE_ADJ
626 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
627 \# ------------------------------------------------
635 \# =====================================================================
639 \# AUTOMATIC PAIRWISE KERNING
640 \# --------------------------
642 \# <none> | <anything>
644 \# Turns automatic pairwise kerning on or off.
659 INLINE KERNING AND HORIZONTAL MOVEMENT
660 --------------------------------------
663 Inline kerning provides a simple method for users to adjust the
664 amount of space between any two letters. It's predicated on a
665 unit of measure "U", which is 1/36 of the current point size as
666 returned by \n[.ps]. E.g., if the current point size is 18,
667 \n[.ps] returns 18000u, therefore U=500u. Since U remains
668 proportional relative to the current point size, the amount
669 of kerning between two letters as expressed in Us remains
670 visually similar regardless of changes in point size.
672 N.B.--the amount of inline kerning supplied by \*[BU<n>] or
673 \*[FU<n>] is added to or subtracted from any kerning that already
674 takes place between two characters when automatic kerning is
677 In groff v. 1.17.2, it was not possible to pass arguments to macros that
678 were called with inline escapes, nor thence to evaluate conditional
679 expressions. Consequently, each pseudo-escape \[BU<n>] had to be defined
680 separately with ".char".
682 As of v. 1.18, one can pass arguments to inline strings/macros,
683 hence it is now possible to do \*[BU n] where n, inline, is the desired
684 number of kern units. The original .char definitions have been left in
685 for backward compatibility with documents created prior to mom-1.1.3c.
689 .ds BU \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
690 .ds FU \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
692 \# Initialize strings for pre-1.1.3c-style BU and FU
695 .while \n+[#LOOP]<37 \{\
696 . ds BU\n[#LOOP] \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
700 .while \n+[#LOOP]<37 \{\
701 . ds FU\n[#LOOP] \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
708 BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
709 specified number of points.
710 Left in for backward compatibility with mom-1.1.3c, the
711 preferred methods for inline horizontal movements are now
712 \*[BCK <n><unit>] and \*[FWD <n><unit>].
722 .ds BP1.25 \h'-1.25p'
724 .ds BP1.75 \h'-1.75p'
726 .ds BP2.25 \h'-2.25p'
728 .ds BP2.75 \h'-2.75p'
730 .ds BP3.25 \h'-3.25p'
732 .ds BP3.75 \h'-3.75p'
734 .ds BP4.25 \h'-4.25p'
736 .ds BP4.75 \h'-4.75p'
738 .ds BP5.25 \h'-5.25p'
740 .ds BP5.75 \h'-5.75p'
742 .ds BP6.25 \h'-6.25p'
744 .ds BP6.75 \h'-6.75p'
746 .ds BP7.25 \h'-7.25p'
748 .ds BP7.75 \h'-7.75p'
750 .ds BP8.25 \h'-8.25p'
752 .ds BP8.75 \h'-8.75p'
754 .ds BP9.25 \h'-9.25p'
756 .ds BP9.75 \h'-9.75p'
758 .ds BP10.25 \h'-10.25p'
759 .ds BP10.5 \h'-10.5p'
760 .ds BP10.75 \h'-10.75p'
762 .ds BP11.25 \h'-11.25p'
763 .ds BP11.5 \h'-11.5p'
764 .ds BP11.75 \h'-11.75p'
766 .ds BP12.25 \h'-12.25p'
767 .ds BP12.5 \h'-12.5p'
768 .ds BP12.75 \h'-12.75p'
810 .ds FP10.25 \h'10.25p'
812 .ds FP10.75 \h'10.75p'
814 .ds FP11.25 \h'11.25p'
816 .ds FP11.75 \h'11.75p'
818 .ds FP12.25 \h'12.25p'
820 .ds FP12.75 \h'12.75p'
823 \# WHOLE LINE KERNING (RW and EW)
824 \# -----------------------------
827 The line kerning macros are special instances of track kerning,
828 used where a complete line needs to be tightened (or relaxed) in
829 order to accomodate or remove one or two more characters
830 than the default justification permits.
834 \# <amount of overall "kerning" (letter spacing) to apply to the line>
836 \# Invokes .tkf (track kerning) for the current font with
837 \# 1 as both the upper and lower point size limits, so that
838 \# the value entered by the user applies regardless of point
839 \# size. RW ("Reduce Whitespace") reduces the amount of space
840 \# between all characters by an equal amount. EW ("Extra
841 \# Whitespace") increases the amount of space.
843 \# Decimal values are acceptable.
846 The groff documentation is a tad confusing about what unit of
847 measure is used in track kerning, only that the width of each
848 character is increased or decreased by the amount(s) passed as
849 arguments to .tkf, and something about linear function of point
850 size. In fact, with the way I've put this macro together, it
851 doesn't matter. All the user needs to know is that a value of
852 one will produce an unacceptably tight or loose line at most text
853 point sizes; therefore, effective use of RW and EW is in the
854 fractional range below 1 (e.g. .25, .5). Given that RW and EW
855 are for massaging type, a certain amount of experimentation and
856 previewing is expected and necessary.
858 \n(.f holds the current font number, which is acceptable to .tkf.
860 RW and EW must be reset to 0 to cancel their effect on subsequent
865 . if \\n[#BR_AT_LINE_KERN] \{\
866 . ie \\n[#JUSTIFY]=1 \{ .brp \}
869 . tkf \\n(.f 1 -\\$1 1 -\\$1
874 . if \\n[#BR_AT_LINE_KERN] \{\
875 . ie \\n[#JUSTIFY]=1 \{ .brp \}
878 . tkf \\n(.f 1 \\$1 1 \\$1
882 \# BREAK AT LINE KERN
883 \# ------------------
887 \# Enables/disables .br's before .RW and .EW
889 \# Mostly, users will want .br's before any kind of line kerning, but
890 \# there may be cases where they don't. BR_BEFORE_LINE_KERN is off by
891 \# default and must be invoked explicitly.
893 .MAC BR_AT_LINE_KERN END
894 . ie '\\$1'' \{ .nr #BR_AT_LINE_KERN 1 \}
895 . el \{ .rr #BR_AT_LINE_KERN \}
898 \# =====================================================================
905 \# <none> | <anything> | DEFAULT
907 \# LINES <n> | MARGIN <n> | SPACE <n>
909 \# Turns auto hyphenation on or off, resets the hyphenation style
910 \# to default, or permits the setting of various hyphenation
913 \# HY, by itself, defaults to .hy 14, i.e. no hyphens after the
914 \# first two or before the last two characters of a word, and no
915 \# hyphenation of the last line prior to a trap (e.g., at the
916 \# bottom of a page).
918 \# HY DEFAULT resets the hyphenation style to .hy 14 (see
919 \# above) if that behaviour is desired after changes have been
920 \# made to LINES, MARGIN, or SPACE.
922 \# HY LINES <n> sets the number of allowable consecutive hyphenated lines.
924 \# HY MARGIN <n> sets the amount of space (ipPcm) allowed at the end
925 \# of a line in QUAD mode before hyphenation is tripped (e.g. if there's
926 \# only 6 points left, groff won't try to hyphenate the next word).
928 \# HY SPACE sets the amount of extra interword space (ipPcm) that can
929 \# be added in JUSTIFY mode to prevent a line from being hyphenated.
937 . if !'\\$1'LINES' \{\
941 . if !'\\$1'MARGIN' \{\
945 . if !'\\$1'SPACE' \{\
949 . if !'\\$1'DEFAULT' \{\
953 . if '\\$1'LINES' \{ .hlm \\$2 \}
954 . if '\\$1'MARGIN' \{ .hym \\$2 \}
955 . if '\\$1'SPACE' \{ .hys \\$2 \}
956 . if '\\$1'DEFAULT' \{\
965 \# HYPHENATION PARAMETERS
966 \# ----------------------
968 \# <# of lines> | <size of margin> | <amount of interword space>
970 \# Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
979 \# =====================================================================
981 \# +++VERTICAL SPACING+++
986 \# <user supplied lead to advance below current baseline>
988 \# Creates or modifies register #ALD. Adds user supplied lead
989 \# below current baseline.
991 \# Requires a unit of measure.
994 . if \\n(nl=0 \{ .nr #TOP 1 \}
999 . if '\\$0'ADD_SPACE' \{\
1004 . if '\\$0'SPACE' \{\
1016 \# <user supplied lead to reverse above current baseline>
1018 \# Creates or modifies register #RLD. Reverses user supplied
1019 \# lead above current baseline.
1021 \# Requires a unit of measure.
1031 The strings \*[ALD.25]...\*[ALD12.75] and their corresponding
1032 \*[RLD] forms have been left in for backward compatibility with
1033 documents created using mom-1.1.3c or earlier. The prefered methods
1034 of advancing and reversing on the page inline are \*[UP <n><unit>]
1035 and \*[DOWN <n><unit>].
1045 .ds ALD1.25 \v'1.25p'
1047 .ds ALD1.75 \v'1.75p'
1049 .ds ALD2.25 \v'2.25p'
1051 .ds ALD2.75 \v'2.75p'
1053 .ds ALD3.25 \v'3.25p'
1055 .ds ALD3.75 \v'3.75p'
1057 .ds ALD4.25 \v'4.25p'
1059 .ds ALD4.75 \v'4.75p'
1061 .ds ALD5.25 \v'5.25p'
1063 .ds ALD5.75 \v'5.75p'
1065 .ds ALD6.25 \v'6.25p'
1067 .ds ALD6.75 \v'6.75p'
1069 .ds ALD7.25 \v'7.25p'
1071 .ds ALD7.75 \v'7.75p'
1073 .ds ALD8.25 \v'8.25p'
1075 .ds ALD8.75 \v'8.75p'
1077 .ds ALD9.25 \v'9.25p'
1079 .ds ALD9.75 \v'9.75p'
1081 .ds ALD10.25 \v'10.25p'
1082 .ds ALD10.5 \v'10.5p'
1083 .ds ALD10.75 \v'10.75p'
1085 .ds ALD11.25 \v'11.25p'
1086 .ds ALD11.5 \v'11.5p'
1087 .ds ALD11.75 \v'11.75p'
1089 .ds ALD12.25 \v'12.5p'
1090 .ds ALD12.5 \v'12.5p'
1091 .ds ALD12.75 \v'12.75p'
1093 .ds RLD.25 \v'-.25p'
1095 .ds RLD.75 \v'-.75p'
1097 .ds RLD1.25 \v'-1.25p'
1098 .ds RLD1.5 \v'-1.5p'
1099 .ds RLD1.75 \v'-1.75p'
1101 .ds RLD2.25 \v'-2.25p'
1102 .ds RLD2.5 \v'-2.5p'
1103 .ds RLD2.75 \v'-2.75p'
1105 .ds RLD3.25 \v'-3.25p'
1106 .ds RLD3.5 \v'-3.5p'
1107 .ds RLD3.75 \v'-3.75p'
1109 .ds RLD4.25 \v'-4.25p'
1110 .ds RLD4.5 \v'-4.5p'
1111 .ds RLD4.75 \v'-4.75p'
1113 .ds RLD5.25 \v'-5.25p'
1114 .ds RLD5.5 \v'-5.5p'
1115 .ds RLD5.75 \v'-5.75p'
1117 .ds RLD6.25 \v'-6.25p'
1118 .ds RLD6.5 \v'-6.5p'
1119 .ds RLD6.75 \v'-6.75p'
1121 .ds RLD7.25 \v'-7.25p'
1122 .ds RLD7.5 \v'-7.5p'
1123 .ds RLD7.75 \v'-7.75p'
1125 .ds RLD8.25 \v'-8.25p'
1126 .ds RLD8.5 \v'-8.5p'
1127 .ds RLD8.75 \v'-8.75p'
1129 .ds RLD9.25 \v'-9.25p'
1130 .ds RLD9.5 \v'-9.5p'
1131 .ds RLD9.75 \v'-9.75p'
1133 .ds RLD10.25 \v'-10.25p'
1134 .ds RLD10.5 \v'-10.5p'
1135 .ds RLD10.75 \v'-10.75p'
1137 .ds RLD11.25 \v'-11.25p'
1138 .ds RLD11.5 \v'-11.5p'
1139 .ds RLD11.75 \v'-11.75p'
1141 .ds RLD12.25 \v'-12.5p'
1142 .ds RLD12.5 \v'-12.5p'
1143 .ds RLD12.75 \v'-12.75p'
1145 \# =====================================================================
1147 \# +++REFINEMENTS+++
1149 \# AUTOMATIC LIGATURES
1150 \# -------------------
1152 \# <none> | <anything>
1154 \# Turns automatic ligature generation on or off.
1156 \# Ligatures may be supplied manually with \(fi, \(fl, etc.
1173 \# [ ,, ] | [ << ] | [ >> ] | <anything>
1175 \# [ DA | DE | ES | FR | IT | NL | NO | PT | SV ] | <anything>
1177 \# Turns smartquotes on (optionally with a quoting style from the
1178 \# argument list, or off).
1180 \# The " character is read outside the macro when mom is
1181 \# processed. The strings for open/close ($QUOTE<n>) are then
1182 \# defined in the macro.
1184 \# (Note to myself: code for " is \N'34'.)
1186 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1188 .MAC SMARTQUOTES END
1228 . ds $QUOTE0 \\[Fo]\\|
1229 . ds $QUOTE1 \\|\\[Fc]
1233 . ds $QUOTE0 \\[Fo]\\|
1234 . ds $QUOTE1 \\|\\[Fc]
1256 . if !r#ARGS_TO_SQ \{\
1266 \# Strings for foot and inch marks
1271 \# =====================================================================
1273 \# +++LINE BREAKS+++
1280 \# Breaks a line without advancing.
1282 \# EL is the mnemonic used on older, dedicated typesetting machines
1283 \# to indicate "process the line, without advancing the galley
1284 \# medium." It stands for End Line.
1286 \# The \c inline must be appended to the end of input lines when in
1287 \# nofill mode; in fill modes, the \c inline must not be used.
1291 . if \\n[#PSEUDO_FILL]=1 \&
1297 \# An inline escape to accomplish the same thing. Actually
1298 \# preferable, since it works with filled and non-filled copy and
1299 \# doesn't require the user to remember to use (or not use) the \c.
1303 \# =====================================================================
1305 \# +++FILLING/QUADDING/JUSTIFYING+++
1312 \# Turns fill on and sets .ad to b.
1314 \# Justifies text left and right.
1317 . if \\n[#TAB_ACTIVE]=0 \{\
1319 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1323 . if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1331 \# L | LEFT | R | RIGHT | C | CENTER/CENTRE
1333 \# Turns fill on and sets .ad to l, r, or c.
1335 \# Terminology is a problem here. Some people call quad left
1336 \# left justified, flush left, or flush left/rag right (and the
1337 \# reverse for quad right). Quad center is sometimes called rag
1338 \# both. For our purposes, all "quad" modes mean that groff fill
1342 . ds $QUAD_VALUE \\$1
1343 . if \\n[#TAB_ACTIVE]=0 \{\
1345 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1349 . if '\\*[$QUAD_VALUE]'L' \{\
1353 . if '\\*[$QUAD_VALUE]'LEFT' \{\
1357 . if '\\*[$QUAD_VALUE]'R' \{\
1361 . if '\\*[$QUAD_VALUE]'RIGHT' \{\
1365 . if '\\*[$QUAD_VALUE]'C' \{\
1369 . if '\\*[$QUAD_VALUE]'CENTER' \{\
1373 . if '\\*[$QUAD_VALUE]'CENTRE' \{\
1377 . if '\\*[$QUAD_VALUE]'J' \{\
1381 . if '\\*[$QUAD_VALUE]'JUSTIFY' \{\
1389 \# LEFT, RIGHT, AND CENTER
1390 \# -----------------------
1393 The purpose of these macros is to allow the user to enter lines of
1394 text that will be quadded LRC *without* the user having to enter .BR
1395 or .br between lines. For the sake of consistency, all three appear
1396 to behave similarly (from the point of view of the user), although
1397 the underlying primitives don't. For this reason, LEFT, RIGHT, and
1398 CENTER must be followed by .QUAD [L R C J] or .JUSTIFY to restore
1399 text to groff fill mode.
1407 \# Turns fill mode off. Allows user to quad lines left without
1408 \# requiring the .BR or .br macro.
1410 \# LEFT simply turns fill off. Lines that exceed the current LL will
1411 \# not be broken, just continued (indefinitely) until a return is
1412 \# encountered. Note that this behaviour differs from the RIGHT and
1416 . if \\n[#TAB_ACTIVE]=0 \{\
1418 . ds $RESTORE_QUAD_VALUE LEFT
1423 .\" Fix for a little conflict with DOCTYPE LETTER
1424 . if '\\n(.z'LETTERHEAD1' \{ .rr #DATE_FIRST \}
1433 \# Turns fill on. Allows user to quad lines right without
1434 \# requiring the .BR or .br macro.
1436 \# Lines that exceed the current LL will be broken, with the excess
1437 \# text quadded right.
1440 . if \\n[#TAB_ACTIVE]=0 \{\
1442 . ds $RESTORE_QUAD_VALUE RIGHT
1455 \# Turns fill on. Allows user to center lines without
1456 \# requiring the .BR or .br macro.
1458 \# Lines that exceed the current LL will be broken, with the excess
1462 . if \\n[#TAB_ACTIVE]=0 \{\
1464 . ds $RESTORE_QUAD_VALUE CENTER
1471 \# =====================================================================
1476 There are two different kinds of tabs available: typesetting tabs
1479 Typesetting tabs are set with TAB_SET, which requires a tab number,
1480 an indent (offset) from the left margin and a length (optionally
1481 with a quad direction and an instruction to fill lines). After tabs
1482 are set with TAB_SET, they are called with .TAB n, where "n"
1483 corresponds to the number passed to TAB_SET as a valid tab number.
1485 String tabs allow the user to mark off tab positions inline. Tab
1486 indents and lengths are calculated from the beginning and end
1487 positions of the marks. Up to 19 string tabs may be created,
1488 numbered 1-19. Once created, they are called with .TAB n,
1489 just like typesetting tabs.
1491 Setting up string tabs is a two-step procedure. First, the user
1492 enters an input line in which s/he wants to mark off string tabs.
1493 The beginning of a tab is marked with \*[STn], where "n" is
1494 the desired number of the tab. The end of the the tab is marked
1495 with \*[STnX]. All ST's must have a matching STX. String tabs
1498 Next, the user invokes .ST n for every string tab defined, and
1499 optionally passes quad information to it. That done, string tabs
1500 can be called just like typesetting tabs.
1502 String tabs don't preview properly with gxditview. Use gv instead.
1505 \# Strings for string tab inlines
1506 \# ------------------------------
1508 \# Initialize string tab markers numbered 1 to 19.
1511 .while \n+[#LOOP]<20 \{\
1512 . ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET]
1516 .while \n+[#LOOP]<20 \{\
1517 . ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK]
1522 \# These are reserved ST numbers for internal use
1523 .ds ST100 \Ek[#ST100_OFFSET]
1524 .ds ST100X \Ek[#ST100_MARK]
1525 .ds ST101 \Ek[#ST101_OFFSET]
1526 .ds ST101X \Ek[#ST101_MARK]
1529 \# QUAD AND SET STRING TABS
1530 \# ------------------------
1532 \# <stringtab number> L | R | C | J [QUAD]
1534 \# Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1535 \# tab based on the collected information.
1537 \# Like TAB_SET, ST invoked without a quad direction will default to LEFT.
1538 \# If lines should be filled and quadded, use the optional argument QUAD.
1539 \# N.B. -- indents *must* be turned off before setting string tabs
1543 . ds $ST\\$1_QUAD_DIR \\$2
1544 . if \\n[#NUM_ARGS]=3 \{\
1545 . ds $ST\\$1_FILL QUAD
1547 . nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1548 . ie \\n[#IN_TAB] \{\
1549 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1552 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1560 \# <n> ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]]
1562 \# Creates macros TABn and TAB n, where "n" is any arbitrary number.
1563 \# TABn is a typesetting tab (i.e. a tab defined as an indent
1564 \# from the page left offset plus a line length.)
1566 \# n = arbitrary digit to identify the tab
1567 \# indent = indent from left margin; unit of measure required
1568 \# length = length of tab (unit of measure required; can be
1569 \# \w'<string>'u--if more than one word in string, surround
1570 \# with double quotes "\w'<three word string>'"
1571 \# LRCJ = quad for tab (left, right, center, justified)
1572 \# If option QUAD afterwards is not given, quad is line for line
1573 \# (no fill mode), meaning that there's no need for .BR or .br
1575 \# QUAD = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1578 \# N.B. -- indents *must* be turned off before setting tabs
1584 .TAB_SET 1 2P+6p 12P C
1586 means "create a tab numbered 1 that starts 2 picas and 6 points from
1587 the left margin, is 12 picas long, and centre each input line."
1589 .TAB_SET 1 2P+6P 12P C QUAD
1591 means exactly the same thing, except that input lines are joined and
1592 the area delimted by the tab filled with centered text.
1594 TAB n can be called at any time after being set.
1596 Tabs are NOT columnar in behaviour. If the text inside a
1597 tab runs to several lines, when you call the next tab a break
1598 occurs, meaning that the new tab starts one line below the last
1599 line in the previous tab. For columnar behaviour, you must
1600 use the multi-column macros in addition to tabs.
1602 If you want tabs to line up bottom-line to bottom-line (most likely
1603 single line tabs), use .TN (provided the tabs are numbered sequentially).
1604 Otherwise, you must use .EL then .TAB <n> if you want them to align.
1606 If you want to reset tabs, you must use .TQ before .TAB_SET.
1608 Note that indents are turned off automatically whenever a new
1609 tab is called with TAB <n>.
1611 Tabs themselves are user-invoked using the TAB macro with a numeric
1612 argument, e.g. TAB 1.
1614 Generally, in order not to get confused, it's a good idea
1615 to make sure all indents are off before setting tabs.
1620 . nr #TAB_NUMBER \\$1
1621 . ds $CURRENT_TAB \\n[#TAB_NUMBER]
1622 . nr #TAB_OFFSET (\\$2)
1623 . nr #TAB_LENGTH (\\$3)
1624 . MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1625 . if !\\\\n[#TB+]=1 \{ .br \}
1626 . if \\\\n[#TB+]=1 \{\
1633 . nr #CURRENT_TAB \\n[#TAB_NUMBER]
1634 . ds $CURRENT_TAB \\*[$CURRENT_TAB]
1635 . nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1636 . nr #ST_OFFSET \\n[#TAB_OFFSET]
1637 . po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
1638 . ll \\n[#TAB_LENGTH]u
1640 . ie '\\$5'QUAD' \{\
1641 . if '\\$4'L' \{ .QUAD L \}
1642 . if '\\$4'R' \{ .QUAD R \}
1643 . if '\\$4'C' \{ .QUAD C \}
1644 . if '\\$4'J' \{ .JUSTIFY \}
1647 . if '\\$4'' \{ .LEFT \}
1648 . if '\\$4'L' \{ .LEFT \}
1649 . if '\\$4'R' \{ .RIGHT \}
1650 . if '\\$4'C' \{ .CENTER \}
1651 . if '\\$4'J' \{ .JUSTIFY \}
1653 . if \\\\n[#TN]=1 \{\
1665 \# <tab number to tab into>
1667 \# Moves to tab number passed as an argument.
1670 . ds $TAB_NUMBER \\$1
1671 . TAB\\*[$TAB_NUMBER]
1681 \# Automagically moves to TAB<n+1> on the same line as the last
1682 \# line of the previous tab.
1684 \# The \c inline must be appended to the end of input lines when in
1685 \# nofill mode; in fill modes, the \c inline must not be used.
1691 . nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1696 \# An inline escape to accomplish the same thing. Actually
1697 \# preferable, since it works with filled and non-filled copy and
1698 \# doesn't require the user to remember to use (or not use) the \c.
1700 .ds TB+ "\c\\R'#TB+ 1'\\R'#TN 1'\\R'#NEXT_TAB \\n[#CURRENT_TAB]+1'\\*[TAB\\n[#NEXT_TAB]]\c
1707 \# Sets #TAB_ACTIVE to "0" (off).
1708 \# Resets left margin to value in effect prior to tabs.
1709 \# Resets line length to value in effect prior to tabs.
1710 \# Checks #QUAD to see if we were in flush or quad mode
1711 \# prior to tabs (0=off, 1=on).
1712 \# Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1713 \# in effect prior to tabs.
1715 \# TQ *must* come before setting any new tabs if you want the
1716 \# tabs' indents measured from page left. Otherwise, the tabs'
1717 \# indents are measured from the left margin of the tab you're
1724 . po \\n[#L_MARGIN]u
1725 . ll \\n[#L_LENGTH]u
1728 . ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1729 . el \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1732 . if '\\*[$RESTORE_QUAD_VALUE]'LEFT' \{ .LEFT \}
1733 . if '\\*[$RESTORE_QUAD_VALUE]'RIGHT' \{ .RIGHT \}
1734 . if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1738 \# ====================================================================
1746 \# <pre-defined NEWCOLOR or XCOLOR>
1748 \# Allows the inline escape for setting color to be called
1763 \# <color name> [<color scheme>] <color definition>
1765 \# Based on .defcolor, allows users to name and define colors using
1766 \# one of the four color schemes rgb, cmy, cmyk and grey. The new
1767 \# color is then defined as a string so that it can be called inline
1768 \# with \*[COLORNAME] or with .COLOR.
1770 \# With only two args, the default color scheme is rgb.
1772 \# It is highly recommended that users define new colors as
1773 \# all-cap strings, to differentiate them from x colors, which must
1774 \# be in lower case.
1777 . if \\n[#NUM_ARGS]=2 \{\
1778 . defcolor \\$1 rgb \\$2
1780 . if \\n[#NUM_ARGS]=3 \{\
1781 . if '\\$2'RGB' .ds $COLOR_SCHEME rgb
1782 . if '\\$2'CYM' .ds $COLOR_SCHEME cym
1783 . if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk
1784 . if '\\$2'GRAY' .ds $COLOR_SCHEME gray
1785 . if '\\$2'GREY' .ds $COLOR_SCHEME gray
1786 . defcolor \\$1 \\*[$COLOR_SCHEME] \\$3
1795 \# <x color name> [<alias>]
1797 \# Defines a string of x color name (i.e. a predefined x
1798 \# color). If <alias> is given, creates a string of <alias name>
1799 \# that references the x color name of the first argument.
1801 \# The color name must be a legal color name from rgb.txt, and
1802 \# must be given entirely in lower case, all one word.
1806 . if \\n[#NUM_ARGS]=2 .ds \\$2 \m[\\$1]
1809 \# Pre-define xcolors black and white
1816 \# =====================================================================
1818 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1823 \# <none> | <anything>
1825 \# When on, underlines all letters, words, and digits in a passage,
1826 \# ignoring punctuation and spaces.
1828 \# Only for use when the font family is COURIER, to simulate
1829 \# typewriter-style underlining of italic passages.
1833 . nr #UNDERLINE_ON 1
1860 . char \[`A] _
\b\[`A]
1861 . char \[^A] _
\b\[^A]
1862 . char \['A] _
\b\['A]
1863 . char \[:A] _
\b\[:A]
1864 . char \[oA] _
\b\[oA]
1865 . char \[~A] _
\b\[~A]
1866 . char \[AE] _
\b\[AE]
1867 . char \[`E] _
\b\[`E]
1868 . char \[^E] _
\b\[^E]
1869 . char \['E] _
\b\['E]
1870 . char \[:E] _
\b\[:E]
1871 . char \[`I] _
\b\[`I]
1872 . char \[^I] _
\b\[^I]
1873 . char \['I] _
\b\['I]
1874 . char \[:I] _
\b\[:I]
1875 . char \[`O] _
\b\[`O]
1876 . char \[^O] _
\b\[^O]
1877 . char \['O] _
\b\['O]
1878 . char \[:O] _
\b\[:O]
1879 . char \[~O] _
\b\[~O]
1880 . char \[/O] _
\b\[/O]
1881 . char \[`U] _
\b\[`U]
1882 . char \[^U] _
\b\[^U]
1883 . char \['U] _
\b\['U]
1884 . char \[:U] _
\b\[:U]
1885 . char \[,C] _
\b\[,C]
1886 . char \[-D] _
\b\[-D]
1887 . char \[~N] _
\b\[~N]
1888 . char \[TP] _
\b\[TP]
1889 . char \['Y] _
\b\['Y]
1890 . char \[:Y] _
\b\[:Y]
1917 . char \[`a] _
\b\[`a]
1918 . char \[^a] _
\b\[^a]
1919 . char \['a] _
\b\['a]
1920 . char \[:a] _
\b\[:a]
1921 . char \[oa] _
\b\[oa]
1922 . char \[~a] _
\b\[~a]
1923 . char \[ae] _
\b\[ae]
1924 . char \[`e] _
\b\[`e]
1925 . char \[^e] _
\b\[^e]
1926 . char \['e] _
\b\['e]
1927 . char \[:e] _
\b\[:e]
1928 . char \[`i] _
\b\[`i]
1929 . char \[^i] _
\b\[^i]
1930 . char \['i] _
\b\['i]
1931 . char \[:i] _
\b\[:i]
1932 . char \[`o] _
\b\[`o]
1933 . char \[^o] _
\b\[^o]
1934 . char \['o] _
\b\['o]
1935 . char \[:o] _
\b\[:o]
1936 . char \[~o] _
\b\[~o]
1937 . char \[/o] _
\b\[/o]
1938 . char \[`u] _
\b\[`u]
1939 . char \[^u] _
\b\[^u]
1940 . char \['u] _
\b\['u]
1941 . char \[:u] _
\b\[:u]
1942 . char \[,c] _
\b\[,c]
1943 . char \[Sd] _
\b\[Sd]
1944 . char \[~n] _
\b\[~n]
1945 . char \[Tp] _
\b\[Tp]
1946 . char \['y] _
\b\['y]
1947 . char \[:y] _
\b\[:y]
1948 . char \[ss] _
\b\[ss]
1962 . nr #UNDERLINE_ON 0
1963 . rchar A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
1964 a b c d e f g h i j k l m n o p q r s t u v w x y z \
1965 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1966 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1967 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1968 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1969 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1970 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1971 ' 1 2 3 4 5 6 7 8 9 0
1981 \# Underscores all letters, words, and digits in a passage,
1982 \# ignoring punctuation and spaces.
1984 \# Intended to be called with inline escapes \*[UL] (underline
1985 \# on) and \*[ULX] (underline off). Only works when the font family
1986 \# is COURIER, to simulate typewriter-style underlining of italic
1990 \c\R'#UNDERLINE_ON 1'
2017 . char \[`A] _
\b\[`A]
2018 . char \[^A] _
\b\[^A]
2019 . char \['A] _
\b\['A]
2020 . char \[:A] _
\b\[:A]
2021 . char \[oA] _
\b\[oA]
2022 . char \[~A] _
\b\[~A]
2023 . char \[AE] _
\b\[AE]
2024 . char \[`E] _
\b\[`E]
2025 . char \[^E] _
\b\[^E]
2026 . char \['E] _
\b\['E]
2027 . char \[:E] _
\b\[:E]
2028 . char \[`I] _
\b\[`I]
2029 . char \[^I] _
\b\[^I]
2030 . char \['I] _
\b\['I]
2031 . char \[:I] _
\b\[:I]
2032 . char \[`O] _
\b\[`O]
2033 . char \[^O] _
\b\[^O]
2034 . char \['O] _
\b\['O]
2035 . char \[:O] _
\b\[:O]
2036 . char \[~O] _
\b\[~O]
2037 . char \[/O] _
\b\[/O]
2038 . char \[`U] _
\b\[`U]
2039 . char \[^U] _
\b\[^U]
2040 . char \['U] _
\b\['U]
2041 . char \[:U] _
\b\[:U]
2042 . char \[,C] _
\b\[,C]
2043 . char \[-D] _
\b\[-D]
2044 . char \[~N] _
\b\[~N]
2045 . char \[TP] _
\b\[TP]
2046 . char \['Y] _
\b\['Y]
2047 . char \[:Y] _
\b\[:Y]
2074 . char \[`a] _
\b\[`a]
2075 . char \[^a] _
\b\[^a]
2076 . char \['a] _
\b\['a]
2077 . char \[:a] _
\b\[:a]
2078 . char \[oa] _
\b\[oa]
2079 . char \[~a] _
\b\[~a]
2080 . char \[ae] _
\b\[ae]
2081 . char \[`e] _
\b\[`e]
2082 . char \[^e] _
\b\[^e]
2083 . char \['e] _
\b\['e]
2084 . char \[:e] _
\b\[:e]
2085 . char \[`i] _
\b\[`i]
2086 . char \[^i] _
\b\[^i]
2087 . char \['i] _
\b\['i]
2088 . char \[:i] _
\b\[:i]
2089 . char \[`o] _
\b\[`o]
2090 . char \[^o] _
\b\[^o]
2091 . char \['o] _
\b\['o]
2092 . char \[:o] _
\b\[:o]
2093 . char \[~o] _
\b\[~o]
2094 . char \[/o] _
\b\[/o]
2095 . char \[`u] _
\b\[`u]
2096 . char \[^u] _
\b\[^u]
2097 . char \['u] _
\b\['u]
2098 . char \[:u] _
\b\[:u]
2099 . char \[,c] _
\b\[,c]
2100 . char \[Sd] _
\b\[Sd]
2101 . char \[~n] _
\b\[~n]
2102 . char \[Tp] _
\b\[Tp]
2103 . char \['y] _
\b\['y]
2104 . char \[:y] _
\b\[:y]
2105 . char \[ss] _
\b\[ss]
2121 \c\R'#UNDERLINE_ON 0'
2122 . rchar A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
2123 a b c d e f g h i j k l m n o p q r s t u v w x y z \
2124 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
2125 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
2126 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
2127 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
2128 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
2129 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
2130 ' 1 2 3 4 5 6 7 8 9 0
2137 \# [points below baseline] "text"
2139 \# Places an underscore 2 points under the string if no lead given,
2140 \# otherwise places underscore under string by user specified amount.
2142 \# When using this macro, the string to be underscored must begin
2143 \# with double-quotes ("), regardless of whether it's the sole
2144 \# argument or the second.
2146 \# .UNDERSCORE "Text to be underscored
2148 \# .UNDERSCORE 2p "Text to be underscored
2150 \# All text is underscored (including punctuation and spaces).
2151 \# This is the primary difference between UNDERLINE and UNDERSCORE,
2152 \# aside from the fact the UNDERLINE only works with Courier.
2154 \# UNDERSCORE does not work across line breaks. Each line of
2155 \# text must be entered separately with UNDERSCORE. If the
2156 \# UNDERSCORE begins in the middle of a line and crosses over a
2157 \# break, the portion before the break must be entered in its own
2158 \# UNDERSCORE, as must the portion that comes after the break.
2161 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2162 . ie \\n[#NUM_ARGS]=1 \{ \\$1\\s(12\\v'+2p'\\l'|0'\\v'-2p'\\s[\\n[#RESTORE_PT_SIZE]u] \}
2163 . el \{ \\$2\\s(12\\v'+(\\$1)'\\l'|0'\\v'-(\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u] \}
2164 . rr #RESTORE_PT_SIZE
2168 \# DOUBLE UNDERSCORE
2169 \# -----------------
2171 \# [points below baseline] [points distance between rules] "text"
2173 \# Same as UNDERSCORE, except it produces a double underscore. The default
2174 \# distance between the rules is 2 points.
2176 \# The same double-quote requirement as UNDERSCORE.
2178 .MAC UNDERSCORE2 END
2179 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2180 . if \\n[#NUM_ARGS]=1 \{\
2181 . PRINT \\$1\\s(12\\v'+2p'\\l'|0'\\v'+2p'\\l'|0'\\v'-4p'\\s[\\n[#RESTORE_PT_SIZE]u]
2183 . if \\n[#NUM_ARGS]=2 \{\
2184 . PRINT \\$2\\s(12\\v'+\\$1'\\l'|0'\\v'+2p'\\l'|0'\\v'-(2p+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
2186 . if \\n[#NUM_ARGS]=3 \{\
2187 . PRINT \\$3\\s(12\\v'+\\$1'\\l'|0'\\v'+\\$2'\\l'|0'\\v'-(\\$2+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
2189 . rr #RESTORE_PT_SIZE
2193 \# SUPERSCRIPT INLINES
2194 \# -------------------
2196 \# Prints everything after invocation as superscript.
2198 \# \*[SUP] and \*[SUPX] turn superscript on and off respectively.
2199 \# If running type is pseudo-condensed/expanded, invoke the superscript
2200 \# strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
2201 \# and \*[EXTSUPX] respectively.
2204 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2205 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2206 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.26m'\s[\En[#SUP_PT_SIZE]u]
2208 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.26m'
2211 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2212 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2213 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
2215 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
2218 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2219 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2220 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
2222 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
2231 \# <number of degrees> | RESET
2233 \# Modifies register #DEGREES for use with \*[SLANT], or resets
2234 \# it to the default. Defines string \*[SLANTX]
2236 \# \*[SLANT] permits pseudo-italicizing of a font in cases where
2237 \# no italic font exists in a particular family.
2239 \# Default # of degrees is 15.
2241 \# Do not use unit of measure with arg to SETSLANT.
2243 \# It may be necessary to adjust the spacing on either side of
2244 \# [SLANT] and [SLANTX].
2246 \# In docs, SLANT carries over from para to para.
2249 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2250 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2253 . ie '\\$1'RESET' \{\
2255 . if \\n[#PRINT_STYLE]=1 \{\
2256 . if \\n[#UNDERLINE_SLANT] \{ .return \}
2258 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2262 . if \\n[#PRINT_STYLE]=1 \{\
2263 . if \\n[#UNDERLINE_SLANT] \{ .return \}
2265 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2267 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2277 \# <amount of emboldening> | RESET
2279 \# Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
2280 \# it to the default 700 units.
2282 \# \*[BOLDER] allows pseudo-emboldening of a font where no bold
2283 \# font exists in a particular family.
2285 \# Default for SETBOLDER is 700 units. Do not use unit of measure
2286 \# with arg to SETBOLDER.
2288 .nr #BOLDER_UNITS 700
2291 . if \\n[#IGNORE]=1 \{ .return \}
2292 . ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
2293 . el \{ .nr #BOLDER_UNITS \\$1 \}
2299 .bd \\n(.f \\n[#BOLDER_UNITS]
2308 \# +++CONDENSE/EXTEND+++
2313 \# <percentage to condense/expand type size>
2315 \# Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
2316 \# new point size (for character width) from arg, and defines string
2317 \# COND or EXT, which set the type size to the new character width,
2318 \# and sets the height of type to the value stored in CURRENT_PT_SIZE
2320 \# CONDENSE_OR_EXTEND is invoked from the aliases
2321 \# CONDENSE and EXTEND. CONDENSE implies <100, EXTEND
2322 \# implies >100. Do not use a percent sign in the argument.
2324 \# There is no default setting for CONDENSE or EXTEND.
2325 \# 80 is a good approximation of condensed type, 120 is okay
2328 \# The value set by CONDENSE or EXTEND applies to all
2329 \# subsequent \*[COND] or \*[EXT] escapes until a new value is set.
2331 \# \*[COND] or \*[EXT] must be turned off before all changes of point
2332 \# size and reinvoked afterwards (if so desired). This refers to
2333 \# changes of point size via control lines AND with via inlines.
2335 .MAC CONDENSE_OR_EXTEND END
2336 . if '\\$0'CONDENSE' \{\
2337 . ds $COND_PERCENT \\$1
2338 . if \\n[#PRINT_STYLE]=1 \{\
2340 . ds $COND_PERCENT 100
2343 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2345 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2346 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2348 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2349 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2351 . if '\\$0'EXTEND' \{\
2352 . ds $EXT_PERCENT \\$1
2353 . if \\n[#PRINT_STYLE]=1 \{\
2355 . ds $EXT_PERCENT 100
2358 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2360 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2361 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2363 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2364 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2368 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2369 .ds EXTX \ER'#EXTEND 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2372 \# +++PAD LINES+++ (insert space)
2377 \# <character to use for marking pad points>
2379 \# Defines string $PAD_MARKER, used in PAD
2381 \# $PAD_MARKER is normally # (the pound sign).
2384 . ds $PAD_MARKER \\$1
2391 \# "<string of text with padding markers inserted>"
2393 \# Defines and redefines padding character (default=pound sign
2394 \# unless padding character has been set with PAD_MARKER)
2395 \# several times so that when the string is output at the end
2396 \# of the macro, every # has been converted to an equal-sized
2397 \# amount of padding (blank space) on a line. # is equivalent to
2398 \# CompuGraphic's old <IS>.
2400 \# String tabs may be marked off during PAD.
2403 . if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2405 . if !d$PAD_MARKER .ds $PAD_MARKER #
2406 . char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2407 . ds $FAMILY_FOR_PAD \\n[.fam]
2408 \#. fp \\n[.fp] \\*[$FONT]
2409 . fp \\n[.fp] \\n[.sty]
2410 . ds $FONT_FOR_PAD \\*[$FONT]
2411 . nr #SIZE_FOR_PAD \\n[.ps]
2412 . ds $PAD_STRING \\$1
2413 . as $PAD_STRING \Ekp
2415 . fam \\*[$FAMILY_FOR_PAD]
2416 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2419 . char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2421 . fam \\*[$FAMILY_FOR_PAD]
2422 \\f]\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2425 . char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2426 . ie \\n[#SILENT] \{\
2428 . fam \\*[$FAMILY_FOR_PAD]
2429 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2434 . fam \\*[$FAMILY_FOR_PAD]
2435 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2438 . if \\n[#FILL_MODE]=1 \{\
2448 . if '\\$2'NOBREAK' \{\
2459 The leader mechanism is primitive, but it works. Basically, every
2460 macro in this set that includes a line length also sets a single
2461 groff tab stop at the right hand end of the line. That way,
2462 whenever Ctrl-A is invoked (always at the end of an input line),
2463 leader of the correct length gets deposited. Ctrl-A is accessed by
2464 the string LEADER (i.e. inline, as \*[LEADER]). Leaders within tabs
2465 get their length from the tab line length.
2468 \# SET LEADER CHARACTER
2469 \# --------------------
2471 \# <character to use whenever \*[LEADER] is invoked>
2473 \# Set leader character.
2475 .MAC LEADER_CHARACTER END
2486 \# <family of drop cap>
2488 \# Creates or modifies string $DC_FAM.
2490 .MAC DROPCAP_FAMILY END
2498 \# <font of drop cap>
2500 \# Creates or modifies string $DC_FT.
2502 .MAC DROPCAP_FONT END
2510 \# <pre-defined XCOLOR or NEWCOLOR>
2512 \# Defines string $DC_COLOR to argument.
2514 \# User must define an XCOLOR or NEWCOLOR before using
2517 .MAC DROPCAP_COLOR END
2518 . if \\n[#PRINT_STYLE]=1 \{ .return \}
2527 \# <width of gutter between drop cap and indented text>
2529 \# Creates or modifies register #DC_GUT.
2531 \# Requires unit of measure. Default is 3p.
2533 .MAC DROPCAP_GUTTER END
2541 \# <+|- # of points to in/decrease point size of drop cap letter>
2543 \# Creates or modifies string $DC_ADJUST.
2545 \# Despite its best efforts, DROPCAP doesn't always get the point
2546 \# size of the drop cap critically perfect. DROPCAP_ADJUST lets
2547 \# the user add or subtract points (or fractions of points) to
2548 \# get the size right.
2550 \# Requires the + or - sign.
2552 .MAC DROPCAP_ADJUST END
2553 . ds $DC_ADJUST \\$1
2560 \# <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2562 \# Calculates point size of dropcap based on # of lines passed as
2563 \# arg 2. Sets indent for text based on dropcap width+gutter.
2564 \# Advances and prints dropcap; reverses and prints indented text
2565 \# to bottom of dropcap, then resets indent to left margin (plus
2566 \# any indent that was in effect prior to invoking DROPCAP).
2568 \# Drop caps put a strain on on resource-challenged systems.
2570 \# Drop caps when using the doc processing macro PP only work with
2571 \# initial paragraphs (i.e. at doc start, or after heads), only when
2572 \# DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2573 \# is TYPESET. If these conditions aren't met, DROPCAPS is silently
2576 \# The COND or EXT argument are processed separately from all
2577 \# other COND or EXT inlines or macros, hence passing COND or
2578 \# EXT has no effect on running type.
2581 . if #IGNORE \{ .return \}
2584 . if \\n[#PRINT_STYLE]=1 \{ .return \}
2585 . if \\n[#PRINT_STYLE]=2 \{\
2586 . if \\n[#PP_STYLE]=2 \{ .return \}
2587 . if \\n[#PP]>1 \{ .return \}
2592 . nr #DC_LINES \\$2-1
2593 . if \\n[#CONDENSE]=1 \{\
2594 . ds $RESTORE_COND \\*[$COND_PERCENT]
2596 . nr #CONDENSE_WAS_ON 1
2598 . if \\n[#EXTEND]=1 \{\
2599 . ds $RESTORE_EXT \\*[$EXT_PERCENT]
2601 . nr #EXTEND_WAS_ON 1
2603 . if '\\$3'COND' \{ .CONDENSE \\$4 \}
2604 . if '\\$3'EXT' \{ .EXTEND \\$4 \}
2605 . if !r#DC_GUT \{ .nr #DC_GUT (3p) \}
2606 . ds $RESTORE_FAM \\n[.fam]
2607 . ds $RESTORE_FT \\*[$FONT]
2608 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2609 . nr #RESTORE_INDENT \\n(.i
2611 . nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2612 . ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2613 . el \{ .FAM \\*[$DC_FAM] \}
2614 . ie !d$DC_FT \{ .FT \\*[$FONT] \}
2615 . el \{ .FT \\*[$DC_FT] \}
2616 . while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2617 . ps \\n[#PT_SIZE]u+100u
2619 . nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2621 . if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2623 . sp \\n[#DC_LINES]v
2624 . ie \\n[#DC_COLOR]=1 \{\
2626 . ie '\\$3'COND' \{ .PRINT \m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[] \}
2627 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[] \}
2629 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2633 . ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2634 . el \{ .PRINT \\*[EXT]\\*[$DROPCAP]\\*[EXTX] \}
2636 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2638 . if '\\$3'COND' \{ \E*[COND] \}
2639 . if '\\$3'EXT' \{ \E*[EXT] \}
2640 . ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2641 . el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2642 . if '\\$3'COND' \{ \E*[CONDX]\c \}
2643 . if '\\$3'EXT' \{ \E*[EXTX]\c \}
2645 . FAM \\*[$RESTORE_FAM]
2646 . FT \\*[$RESTORE_FT]
2647 . ps \\n[#RESTORE_PT_SIZE]u
2648 . if \\n[#CONDENSE_WAS_ON] \{\
2649 . CONDENSE \\*[$RESTORE_COND]
2652 . if \\n[#EXTEND_WAS_ON] \{\
2653 . EXTEND \\*[$RESTORE_EXT]
2656 . ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2657 . el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2658 . rr #CONDENSE_WAS_ON
2666 . rr #RESTORE_PT_SIZE
2667 . rr #RESTORE_INDENT
2673 .MAC DROPCAP_OFF END
2674 ' in \\n[#RESTORE_INDENT]u
2683 \# Draws a rule the length of the current measure.
2691 . ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2694 . ie \\n[#INDENT_ACTIVE] \{\
2695 . nr #RESTORE_L_LENGTH \\n(.l
2696 . if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2697 . if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2698 . PRINT \El'\En(.lu'\c
2699 . ll \\n[#RESTORE_L_LENGTH]u
2700 . rr #RESTORE_L_LENGTH
2703 . PRINT \El'\En(.lu'\c
2705 . if r#FILL_WAS_ON \{\
2708 . QUAD \\*[$CURRENT_QUAD]
2714 \# =====================================================================
2716 \# +++WORD AND SENTENCE SPACING+++
2718 \# WORD SPACE CONTROL
2719 \# ------------------
2721 \# <+|->wordspace | DEFAULT
2723 \# Increases or decreases interword space by user supplied amount.
2724 \# If DEFAULT, value is set to 12 (groff default).
2726 \# $WS_CONSTANT is the groff default word space.
2727 \# $WS_VAR is the user supplied amount by which to in/decrease word space.
2728 \# $WS is a concatenation of WS_CONSTANT and WS_VAR.
2730 \# Because the user supplied value requires a literal + or - sign,
2731 \# the macro argument is stored in a string.
2733 \# \n[.sss] holds the current sentence space value.
2736 . ds $WS_CONSTANT 12
2738 . ie '\\$1'DEFAULT' .ds $WS_VAR +0
2739 . el .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR])
2740 . ie \\n[.sss]=12 \{ .ss \\*[$WS] 12 \}
2742 . ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
2748 \# SENTENCE SPACE CONTROL
2749 \# ----------------------
2751 \# <+-sentencespace> | 0 | DEFAULT
2753 \# Increases or decreases sentence space by user supplied amount.
2754 \# If 0, sentence spaces are ignored. If DEFAULT, value is
2755 \# set to 12 (groff default).
2757 \# Because the user supplied value requires a literal + or - sign,
2758 \# the macro argument is stored in a string.
2760 \# Sentence space applies only to input where sentences are separated
2761 \# by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
2762 \# Changing .SS when sentences are separated by only one space has
2763 \# no effect on the space between sentences.
2765 \# \n[.ss] holds the current wordspace value.
2766 \# \n[.sss] holds the current sentence space value.
2769 . ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
2771 . ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
2774 . ss \\n[.ss] (0\\*[$SS_VAR])
2780 \# =====================================================================
2785 There are five styles of indents: left, right, both, temporary,
2786 and hanging. Each is set/invoked with a different macro.
2787 Indent macros begin with the letter "I", hence .IL means "indent left,"
2788 .IR means "indent right," and so on.
2790 The first time any of the indent macros is used, it requires an
2791 argument--the size of the indent (with a unit of measure). The
2792 size may also be entered using the \w escape--very useful
2793 for numbered lists using HI. The unit of measure is required.
2794 Subsequent invocations don't require the argument; the indent
2795 measure remains the same until it's changed by invoking the macro
2796 with an argument again.
2798 If no indents are in effect, the arguments passed to indent macros are
2799 measured from the left and right margins of the page. If a left indent
2800 or a right indent is already in effect, the arguments passed to
2801 the indent macros are calculated from the current values; in other words,
2802 the arguments are additive. If you quit an indent and later return
2803 to it, its value will be the value last in effect, unless you pass
2804 it an argument. If you do pass an argument, it is added to the last
2805 value in effect, unless you cleared the indent with one of
2820 The first .IL 2P indents text 2P from the left margin. The second
2821 .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
2822 .IQ turns the indent off. The last .IL (which has no argument)
2823 takes its value from the total of all arguments passed to .IL (in
2824 this case, 2P and 2P), therefore it indents 2P+2P from the left
2825 margin, i.e. 4P. If you wanted the last .IL to indent just 2P,
2826 you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
2827 the last .IL the argument 2P.
2829 To reverse the sense of an indent added to an indent, you may use
2832 Indents can be turned off individually with ILX, IRX, and IBX.
2833 LEFT and RIGHT indents may be combined and manipulated
2834 separately, (e.g. you can have an IL of 2P and an IR of 4P
2835 operative at the same time, and then change, say, the IL to
2836 4P--thereby left indenting 6P--while the IR remains at 4P.
2838 IB automatically turns off IL and IR. They have to be reinvoked
2839 again when needed. IL and IR automatically turn IB off; it, too,
2840 has to be reinvoked with needed.
2842 All indents can be turned off at once with IQ. The ILX, IRX, IBX,
2843 and IQ macros simply turn the indents off; the values stored in
2844 the respective indent macros (IL, IR, IB) remain in effect. If
2845 the user wishes to clear the values, the I<LRB>X macros should be
2846 invoked with the single argument CLEAR. IQ CLEAR clears out
2847 the values stored for all indent styles.
2849 Indents *must* be turned off before settting string tabs
2850 inside PAD. Generally, in order not to get confused, it's a
2851 good idea to turn all indents off before setting any tabs.
2853 TI and HI are special cases. There's no need to turn them off,
2854 since they affect only one line--the first after their
2855 invocation. Like the other indent styles, the first time
2856 they're invoked, they require a value in iPpcm; each subsequent
2857 invocation without an argument will use the same value. To
2858 change the value, simply pass a new value. Values for TI and HI
2861 HI presupposes that you already have a left or both indent on.
2862 HI will never hang a line outside the left margin of a document
2863 or column. In other words, you must have IL or IB on before you
2871 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2872 . nr #INDENT_STYLE_LEFT 1
2873 . nr #INDENT_ACTIVE 1
2874 . nr #INDENT_LEFT_ACTIVE 1
2877 . in \\n[#L_INDENT]u
2878 . ta \\n(.lu-\\n[#L_INDENT]u
2882 . nr #L_INDENT +(\\$1)
2883 . in \\n[#L_INDENT]u
2884 . ta \\n(.lu-\\n[#L_INDENT]u
2889 \# +++INDENT RIGHT+++
2892 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2893 . nr #INDENT_STYLE_RIGHT 1
2894 . nr #INDENT_ACTIVE 1
2895 . nr #INDENT_RIGHT_ACTIVE 1
2898 . ie \\n[#TAB_ACTIVE] \{\
2899 . ll \\n(.lu-\\n[#R_INDENT]u
2900 . ta \\n(.lu-\\n[#L_INDENT]u
2903 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2904 . ta \\n(.lu-\\n[#L_INDENT]u
2909 . nr #R_INDENT +(\\$1)
2910 . ie \\n[#TAB_ACTIVE] \{\
2911 . ll \\n(.lu-\\n[#R_INDENT]u
2912 . ta \\n(.lu-\\n[#L_INDENT]u
2915 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2916 . ta \\n(.lu-\\n[#L_INDENT]u
2922 \# +++INDENT BOTH+++
2925 . if \\n[#INDENT_STYLE_LEFT] \{ .ILX \}
2926 . if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
2927 . nr #INDENT_STYLE_BOTH 1
2928 . nr #INDENT_ACTIVE 1
2929 . nr #INDENT_BOTH_ACTIVE 1
2932 . in \\n[#BL_INDENT]u
2933 . ie \\n[#TAB_ACTIVE] \{\
2934 . ll \\n(.lu-\\n[#BR_INDENT]u
2935 . ta \\n(.lu-\\n[#BR_INDENT]u
2938 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2939 . ta \\n(.lu-\\n[#BR_INDENT]u
2944 . nr #BL_INDENT (\\n[#INDENT]+\\$1)
2945 . ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
2946 . el \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
2947 . ie \\n[#TAB_ACTIVE] \{\
2948 . in \\n[#BL_INDENT]u
2949 . ll \\n(.lu-\\n[#BR_INDENT]u
2950 . ta \\n(.lu-\\n[#BL_INDENT]u
2953 . in \\n[#BL_INDENT]u
2954 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2955 . ta \\n(.lu-\\n[#BR_INDENT]u
2961 \# +++TEMPORARY INDENT+++
2966 . ti \\n[#T_INDENT]u
2967 . if \\n[#INDENT_LEFT_ACTIVE] \{\
2968 . ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
2970 . if \\n[#INDENT_BOTH_ACTIVE] \{\
2971 . ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
2975 . nr #T_INDENT (\\$1)
2976 . ti \\n[#T_INDENT]u
2981 \# +++HANGING INDENT+++
2984 . ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
2986 . nr #HL_INDENT (\\$1)
2987 . ti -\\n[#HL_INDENT]u
2992 \# +++INDENTS OFF+++
2997 . rr #INDENT_LEFT_ACTIVE
2998 . if '\\$1'CLEAR' \{\
3000 . rr #INDENT_STYLE_LEFT
3007 . rr #INDENT_RIGHT_ACTIVE
3008 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3010 . ie \\n[#COLUMNS] \{\
3011 . ll \\n[#COL_L_LENGTH]u
3015 . ll \\n[#L_LENGTH]u
3019 . if '\\$1'CLEAR' \{\
3021 . rr #INDENT_STYLE_RIGHT
3029 . rr #INDENT_BOTH_ACTIVE
3030 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3032 . ie \\n[#COLUMNS] \{\
3033 . ll \\n[#COL_L_LENGTH]u
3037 . ll \\n[#L_LENGTH]u
3041 . if '\\$1'CLEAR' \{\
3044 . rr #INDENT_STYLE_BOTH
3051 . if !\\n[#IX_WARN] \{\
3052 . tm1 "[mom]: Use of .IX is now deprecated. Use .IQ instead.
3053 . tm1 " .IX will continue to behave as before, but to
3054 . tm1 " avoid this message, please update your document.
3060 . rr #INDENT_LEFT_ACTIVE
3061 . rr #INDENT_RIGHT_ACTIVE
3062 . rr #INDENT_BOTH_ACTIVE
3063 . if \\n[#INDENT_STYLE_RIGHT] \{\
3064 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3066 . ie \\n[#COLUMNS] \{\
3067 . ll \\n[#COL_L_LENGTH]u
3071 . ll \\n[#L_LENGTH]u
3076 . if \\n[#INDENT_STYLE_BOTH] \{\
3077 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3079 . ie \\n[#COLUMNS] \{\
3080 . ll \\n[#COL_L_LENGTH]u
3084 . ll \\n[#L_LENGTH]u
3089 . if '\\$1'CLEAR' \{\
3090 . if \\n[#INDENT_STYLE_RIGHT] \{\
3091 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3093 . ie \\n[#COLUMNS] \{\
3094 . ll \\n[#COL_L_LENGTH]u
3098 . ll \\n[#L_LENGTH]u
3103 . if \\n[#INDENT_STYLE_BOTH] \{\
3104 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3106 . ie \\n[#COLUMNS] \{\
3107 . ll \\n[#COL_L_LENGTH]u
3111 . ll \\n[#L_LENGTH]u
3122 . rr #INDENT_STYLE_LEFT
3123 . rr #INDENT_STYLE_RIGHT
3124 . rr #INDENT_STYLE_BOTH
3129 \# =====================================================================
3131 \# +++MULTIPLE COLUMNS+++
3133 \# MULTIPLE COLUMNS ON
3134 \# -------------------
3138 \# Marks the top of a column set
3144 \# MULTIPLE COLUMN RETURN
3145 \# ----------------------
3149 \# Returns to the top of a column set
3157 \# MULTIPLE COLUMNS OFF
3158 \# --------------------
3160 \# <none> | <lead to advance beneath bottom of deepest column>
3162 \# Advances to the end of a column set
3164 \# With no argument, advances to the next baseline (at the current
3165 \# leading value) beneath the longest column. With an argument
3166 \# (which requires a unit of measure), advances arg distance
3167 \# beneath the baseline of the deepest column. If the argument
3168 \# is zero, advances to the baseline of the deepest column.
3176 . nr #MCX_ALD (\\$1)
3178 . ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
3179 . el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
3184 \# =====================================================================
3186 \# +++TYPESETTING SUPPORT MACROS+++
3193 \# Enables/disables traps.
3195 \# EL and TN don't function as advertised on the last line before
3196 \# a trap (when they break the preceding line, they spring the
3197 \# trap, and groff won't back up to the line preceding the trap).
3198 \# TRAP is a kludge to get EL and TN work properly on last lines.
3199 \# The user simply enloses the offending lines in TRAP OFF/TRAP.
3202 . ie '\\$1'' \{ .vpt 1 \}
3210 \# <none> | <anything>
3212 \# Diverts text so that it doesn't print, or turns the function off.
3214 \# Useful for setting up autotabs where you don't want the line with
3215 \# the tab marks to print.
3217 \# Also aliased as COMMENT, in case user wants to input a batch of
3218 \# text that doesn't print.
3222 . if \\n[#QUAD] \{ .br \}
3223 . ie '\\$1'' \{ .di NO_FLASH \}
3236 \# Prints anything. A macro that helps keep my code nicely indented.
3246 \# <none> | <anything>
3248 \# Converts text to caps, or, if OFF, reverts to normal caps/lc.
3252 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
3287 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
3328 \# Gets cap-height, x-height, and descender depth of the
3329 \# current font at the current point size.
3331 \# The routine is diverted so it remains invisible to output.
3335 E\\R'#CAP_HEIGHT \\n[.cht]'
3336 e\\R'#X_HEIGHT \\n[.cht]'
3337 y\\R'#DESCENDER \\n[.cdp]'
3342 \# =====================================================================
3344 \# +++TYPESETTING ALIASES+++
3346 .ALIAS ADD_SPACE ALD
3347 .ALIAS CENTRE CENTER
3349 .ALIAS COMMENT SILENT
3350 .ALIAS CONDENSE CONDENSE_OR_EXTEND
3351 .ALIAS EXTEND CONDENSE_OR_EXTEND
3354 .ALIAS HYPHENATION HY
3360 .ALIAS LIG LIGATURES
3361 .ALIAS NEWCOLOUR NEWCOLOR
3362 .ALIAS PADMARKER PAD_MARKER
3365 .ALIAS TABSET TAB_SET
3367 .ALIAS UNDERSCORE_2 UNDERSCORE2
3368 .ALIAS XCOLOUR XCOLOR
3371 \# ====================================================================
3373 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
3374 \# ===============================================
3376 \# +++PAGE DIMENSIONS+++
3381 \# LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
3383 \# Sets up dimensions for different paper sizes.
3387 . if '\\*[$PAPER]'LETTER' \{\
3391 . if '\\*[$PAPER]'LEGAL' \{\
3395 . if '\\*[$PAPER]'STATEMENT' \{\
3399 . if '\\*[$PAPER]'TABLOID' \{\
3403 . if '\\*[$PAPER]'LEDGER' \{\
3407 . if '\\*[$PAPER]'FOLIO' \{\
3411 . if '\\*[$PAPER]'QUARTO' \{\
3415 . if '\\*[$PAPER]'10x14' \{\
3419 . if '\\*[$PAPER]'EXECUTIVE' \{\
3423 . if '\\*[$PAPER]'A3' \{\
3427 . if '\\*[$PAPER]'A4' \{\
3431 . if '\\*[$PAPER]'A5' \{\
3435 . if '\\*[$PAPER]'B4' \{\
3439 . if '\\*[$PAPER]'B5' \{\
3443 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
3444 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
3448 \# ====================================================================
3450 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
3455 \# TYPESET | TYPEWRITE [SINGLESPACE]
3457 \# Sets type specs for typewriter-style or typeset output.
3459 \# Number registers: TYPEWRITE=1, TYPESET=2.
3462 . if !\\n[#COLLATE]=1 \{\
3463 . if !d$PAPER \{ .PAPER LETTER \}
3464 . if '\\$1'TYPEWRITE' \{\
3466 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3467 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3470 . ie '\\$2'SINGLESPACE' \{\
3471 . nr #SINGLE_SPACE 1
3473 . nr #ORIGINAL_DOC_LEAD \\n(.v
3477 . nr #ORIGINAL_DOC_LEAD \\n(.v
3482 . if !\\n[#PP_INDENT] \{\
3483 . in 3P \"Set indent
3484 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
3485 . in 0 \"Remove indent
3488 . nr #BOLDER_UNITS 0
3498 . nr #IGNORE_COLUMNS 1
3502 . if '\\$1'TYPESET' \{\
3504 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3505 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3508 . if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
3509 . if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
3517 . if !\\n[#PP_INDENT] \{\
3518 . in 2m \"Set indent
3519 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
3520 . in 0 \"Remove indent
3523 . rr #IGNORE_COLUMNS
3529 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
3531 \# First, a little utility macro.
3540 \# ITALIC MEANS ITALIC
3541 \# -------------------
3545 \# Instructs TYPEWRITE to treat italics as italics, whether
3546 \# invoked via control lines or inline.
3548 \# ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
3549 \# hence invoking the one automatically turns off the other.
3551 .MAC ITALIC_MEANS_ITALIC END
3552 . if \\n[#PRINT_STYLE]=1 \{\
3553 . nr #ITALIC_MEANS_ITALIC 1
3554 . rr #UNDERLINE_ITALIC
3570 \# Instructs TYPEWRITE to underline italics, whether invoked
3571 \# via control lines or inline.
3573 \# UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
3574 \# hence invoking the one automatically turns off the other.
3576 \# UNDERLINE_ITALIC is the default for TYPEWRITE.
3578 .MAC UNDERLINE_ITALIC END
3579 . if \\n[#PRINT_STYLE]=1 \{\
3580 . nr #UNDERLINE_ITALIC 1
3581 . rr #ITALIC_MEANS_ITALIC
3595 \# <none> | <anything>
3597 \# Instructs TYPEWRITE to underline occurences of \*[SLANT], or
3598 \# turns feature off.
3600 \# Users may want \*[SLANT] to mean slant in TYPEWRITE, although
3601 \# most of the time, \*[SLANT] most likely means the user wanted
3602 \# italic but didn't have it, ergo the need to tell TYPEWRITE to
3603 \# treat \*[SLANT] as italic (i.e. underlined).
3605 \# UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
3606 \# hence invoking the one automatically turns off the other.
3608 \# UNDERLINE_SLANT is the default for TYPEWRITE.
3610 .MAC UNDERLINE_SLANT END
3611 . if \\n[#PRINT_STYLE]=1 \{\
3612 . rr #SLANT_MEANS_SLANT
3613 . nr #UNDERLINE_SLANT 1
3616 . ds SLANT \ER'#SLANT_ON 1'\E*[UL]
3617 . ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
3622 .MAC SLANT_MEANS_SLANT END
3623 . if \\n[#PRINT_STYLE]=1 \{\
3624 . rr #UNDERLINE_SLANT
3625 . nr #SLANT_MEANS_SLANT 1
3628 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
3629 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
3634 .MAC IGNORE_COLUMNS END
3635 . if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
3639 \# ====================================================================
3641 \# +++COPY STYLE -- DRAFT OR FINAL+++
3648 \# Sets registers that are used to determine what to put
3649 \# in the default header, and how to number pages.
3651 \# DOCTYPE must come before COPYSTYLE.
3654 . ds $COPY_STYLE \\$1
3655 . if '\\*[$COPY_STYLE]'DRAFT' \{\
3657 . if !d$DRAFT \{ .DRAFT 1 \}
3659 . if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2 \}
3660 . if !d$CHAPTER_STRING \{ .CHAPTER_STRING "Chapter" \}
3661 . if !d$DRAFT_STRING \{ .DRAFT_STRING "Draft" \}
3662 . if !d$REVISION_STRING \{ .REVISION_STRING "Rev." \}
3664 . if \\n[#DOC_TYPE]=1 \{\
3665 . ie \\n[#COPY_STYLE]=1 \{\
3666 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3667 . el \{ .PAGENUM_STYLE roman \}
3668 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3669 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3673 . ie '\\*[$REVISION]'' \{\
3674 . ds $HDRFTR_CENTER \
3675 \\*[$DRAFT_STRING]\\*[$DRAFT]
3678 . ds $HDRFTR_CENTER \
3679 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3680 \\*[$REVISION_STRING] \\*[$REVISION]
3686 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3687 . el \{ .PAGENUM_STYLE DIGIT \}
3688 . if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
3689 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3691 . rr #USER_DEF_HDRFTR_CENTER
3696 . if \\n[#DOC_TYPE]=2 \{\
3698 . ie \\n[#COPY_STYLE]=1 \{\
3699 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3700 . el \{ .PAGENUM_STYLE roman \}
3701 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3702 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3703 . ie '\\*[$CHAPTER]'' \{\
3704 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3705 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3707 . el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
3710 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3711 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3713 . el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3717 . ie '\\*[$REVISION]'' \{\
3718 . ie '\\*[$CHAPTER]'' \{\
3719 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3720 . ie '\\*[$DRAFT]'' \{\
3721 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3724 . ds $HDRFTR_CENTER \
3725 \\*[$CHAPTER_TITLE], \
3726 \\*[$DRAFT_STRING]\\*[$DRAFT]
3730 . ie '\\*[$DRAFT]'' \{\
3731 . ds $HDRFTR_CENTER \
3732 \\*[$CHAPTER_STRING]
3735 . ds $HDRFTR_CENTER \
3736 \\*[$CHAPTER_STRING], \
3737 \\*[$DRAFT_STRING]\\*[$DRAFT]
3742 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3743 . ie '\\*[$DRAFT]'' \{\
3744 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3747 . ds $HDRFTR_CENTER \
3748 \\*[$CHAPTER_TITLE], \
3749 \\*[$DRAFT_STRING]\\*[$DRAFT]
3753 . ie '\\*[$DRAFT]'' \{\
3754 . ds $HDRFTR_CENTER \
3755 \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3758 . ds $HDRFTR_CENTER \
3759 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3760 \\*[$DRAFT_STRING]\\*[$DRAFT]
3766 . ie '\\*[$CHAPTER]'' \{\
3767 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3768 . ie '\\*[$DRAFT]'' \{\
3769 . ds $HDRFTR_CENTER \
3770 \\*[$CHAPTER_TITLE], \
3771 \\*[$REVISION_STRING] \\*[$REVISION]
3774 . ds $HDRFTR_CENTER \
3775 \\*[$CHAPTER_TITLE], \
3776 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3777 \\*[$REVISION_STRING] \\*[$REVISION]
3781 . ie '\\*[$DRAFT]'' \{\
3782 . ds $HDRFTR_CENTER \
3783 \\*[$CHAPTER_STRING], \
3784 \\*[$REVISION_STRING] \\*[$REVISION]
3787 . ds $HDRFTR_CENTER \
3788 \\*[$CHAPTER_STRING], \
3789 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3790 \\*[$REVISION_STRING] \\*[$REVISION]
3795 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3796 . ie '\\*[$DRAFT]'' \{\
3797 . ds $HDRFTR_CENTER \
3798 \\*[$CHAPTER_TITLE], \
3799 \\*[$REVISION_STRING] \\*[$REVISION]
3802 . ds $HDRFTR_CENTER \
3803 \\*[$CHAPTER_TITLE], \
3804 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3805 \\*[$REVISION_STRING] \\*[$REVISION]
3809 . ie '\\*[$DRAFT]'' \{\
3810 . ds $HDRFTR_CENTER \
3811 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3812 \\*[$REVISION_STRING] \\*[$REVISION]
3815 . ds $HDRFTR_CENTER \
3816 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3817 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3818 \\*[$REVISION_STRING] \\*[$REVISION]
3828 . if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
3829 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3830 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3831 . el \{ .PAGENUM_STYLE DIGIT \}
3832 . ie '\\*[$CHAPTER]'' \{\
3833 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3834 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3837 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
3841 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3842 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3845 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3852 . if \\n[#DOC_TYPE]=3 \{\
3853 . ie \\n[#COPY_STYLE]=1 \{\
3854 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3855 . el \{ .PAGENUM_STYLE roman \}
3856 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3857 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3860 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3861 . ie '\\*[$REVISION]'' \{\
3862 . ie '\\*[$DRAFT]'' \{\
3863 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3866 . ds $HDRFTR_CENTER \
3868 \\*[$DRAFT_STRING]\\*[$DRAFT]
3872 . ie '\\*[$DRAFT]'' \{\
3873 . ds $HDRFTR_CENTER \
3875 \\*[$REVISION_STRING] \\*[$REVISION]
3878 . ds $HDRFTR_CENTER \
3880 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3881 \\*[$REVISION_STRING] \\*[$REVISION]
3888 . if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
3889 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3890 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3891 . el \{ .PAGENUM_STYLE DIGIT \}
3892 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3898 \# ====================================================================
3900 \# +++COLLECT DOC INFO -- STRINGS AND REGISTERS FOR REFERENCE MACROS+++
3903 \# various string/register arguments
3905 \# Collect information about documents.
3909 . ds $DOC_TITLE \\$1
3912 .MAC TITLE END \"Document title
3917 .MAC SUBTITLE END \"Document sub-title
3922 .MAC CHAPTER END \"If document is a chapter, the chapter number
3927 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
3928 . ds $CHAPTER_TITLE \\$1
3932 .MAC DRAFT END \"Draft number
3933 . ie '\\$1'' .ds $DRAFT
3934 . el .ds $DRAFT " \\$1
3938 .MAC REVISION END \"Revision number
3943 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
3944 . nr #DRAFT_WITH_PAGENUM 1
3948 .MAC AUTHOR END \"Author. Enclose all args fully in double quotes.
3949 . nr #AUTHOR_NUM -1 1
3950 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
3951 . ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
3953 . nr #NUM_AUTHORS \\n[#NUM_ARGS]%2 \"Use mod 2 to test if odd or even # of authors
3954 . ie \\n[#NUM_AUTHORS]=1 \{ .nr #AUTHOR_LINES 0 \}
3955 . el \{ .nr #AUTHOR_LINES 1 \}
3959 .MAC COPYRIGHT END \"For use on cover page only
3960 . ds $COPYRIGHT \[co]\\$1
3964 .MAC MISC END \"For use on cover page only; enclose all args in double quotes
3966 . while \\n[#NUM_ARGS]>\\n[#MISC_NUM] \{\
3967 . ds $MISC_\\n+[#MISC_NUM] \\$\\n[#MISC_NUM]
3969 . nr #NUM_MISCS \\n[#NUM_ARGS]
3973 .MAC PAGENUMBER END \"Page # that appears on page one.
3974 . nr #n%_AT_PAGENUM_SET \\n%
3975 . nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
3976 . rr #n%_AT_PAGENUM_SET
3977 . nr #PAGE_NUM_SET 1
3980 \# ====================================================================
3982 \# +++TYPE OF DOCUMENT+++
3987 \# DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
3989 \# Creates strings and sets registers for document types.
3991 \# Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
3994 . if '\\$1'DEFAULT' \{\
3997 . if '\\$1'CHAPTER' \{\
4000 . if '\\$1'NAMED' \{\
4004 . if '\\$1'LETTER' \{\
4012 . INDENT_FIRST_PARAS
4014 . ds $SUITE \En[#SUITE]
4015 . HEADER_MARGIN 3P+6p
4021 . FOOTER_RIGHT_SIZE +0
4022 . FOOTER_RIGHT "\&.../\E*[$SUITE]
4023 . FOOTER_ON_FIRST_PAGE
4028 \# +++LETTER MACROS+++
4030 \# First, create a register to hold incrementing numbers to be
4031 \# appended to LETTERHEAD.
4040 \# Stores date (entered on the line after .DATE) in diversion
4044 . if !'\\n(.z'' \{ .di \}
4045 . di LETTERHEAD\\n+[#FIELD]
4046 . ie \\n[#FIELD]=1 \{\
4061 \# Stores addressee address (entered on the line after .TO) in
4062 \# diversion LETTERHEAD<n>
4065 . if !'\\n(.z'' \{ .di \}
4066 . di LETTERHEAD\\n+[#FIELD]
4076 \# Stores addresser address (entered on the line after .FROM) in
4077 \# diversion LETTERHEAD<n>
4080 . if !'\\n(.z'' \{ .di \}
4081 . di LETTERHEAD\\n+[#FIELD]
4091 \# Stores greeting (entered on the line after .GREETING) in
4092 \# diversion LETTERHEAD<n>
4095 . if !'\\n(.z'' \{ .di \}
4096 . di LETTERHEAD\\n+[#FIELD]
4106 \# Stores greeting in diversion CLOSING.
4121 \# Redefines $FOOTER_RIGHT to blank so that a suite number doesn't
4122 \# appear at the bottom of letter pages.
4128 \# ====================================================================
4132 \# TYPE-STYLE CONTROL MACROS
4133 \# -------------------------
4136 The control macros for family, font, size, quad and color are here
4137 grouped together. Each (e.g. _FAMILY or _FONT) tests for a calling
4138 alias before performing the action(s) appropriate to the calling
4139 macro. Defaults for all these guys are set in DEFAULTS, and listed
4140 in the "Control Macros" section of the documentation pertinent to
4141 the macro whose style is to be changed.
4145 . if '\\$0'AUTHOR_FAMILY' .ds $AUTHOR_FAM \\$1
4146 . if '\\$0'BIBLIOGRAPHY_FAMILY' .ds $BIB_FAM \\$1
4147 . if '\\$0'BIBLIOGRAPHY_STRING_FAMILY' .ds $BIB_STRING_FAM \\$1
4148 . if '\\$0'BLOCKQUOTE_FAMILY' .ds $BQUOTE_FAM \\$1
4149 . if '\\$0'CITATION_FAMILY' .ds $BQUOTE_FAM \\$1
4150 . if '\\$0'CITE_FAMILY' .ds $BQUOTE_FAM \\$1
4151 . if '\\$0'CHAPTER_TITLE_FAMILY' .ds $CHAPTER_TITLE_FAM \\$1
4152 . if '\\$0'COVER_AUTHOR_FAMILY' .ds $COVER_AUTHOR_FAM \\$1
4153 . if '\\$0'COVER_CHAPTER_TITLE_FAMILY' .ds $COVER_CHAPTER_TITLE_FAM \\$1
4154 . if '\\$0'COVER_COPYRIGHT_FAMILY' .ds $COVER_COPYRIGHT_FAM \\$1
4155 . if '\\$0'COVER_DOCTYPE_FAMILY' .ds $COVER_DOCTYPE_FAM \\$1
4156 . if '\\$0'COVER_FAMILY' .ds $COVER_FAM \\$1
4157 . if '\\$0'COVER_SUBTITLE_FAMILY' .ds $COVER_SUBTITLE_FAM \\$1
4158 . if '\\$0'COVER_TITLE_FAMILY' .ds $COVER_TITLE_FAM \\$1
4159 . if '\\$0'DOC_COVER_AUTHOR_FAMILY' .ds $DOC_COVER_AUTHOR_FAM \\$1
4160 . if '\\$0'DOC_COVER_CHAPTER_TITLE_FAMILY' .ds $DOC_COVER_CHAPTER_TITLE_FAM \\$1
4161 . if '\\$0'DOC_COVER_COPYRIGHT_FAMILY' .ds $DOC_COVER_COPYRIGHT_FAM \\$1
4162 . if '\\$0'DOC_COVER_DOCTYPE_FAMILY' .ds $DOC_COVER_DOCTYPE_FAM \\$1
4163 . if '\\$0'DOC_COVER_FAMILY' .ds $DOC_COVER_FAM \\$1
4164 . if '\\$0'DOC_COVER_SUBTITLE_FAMILY' .ds $DOC_COVER_SUBTITLE_FAM \\$1
4165 . if '\\$0'DOC_COVER_TITLE_FAMILY' .ds $DOC_COVER_TITLE_FAM \\$1
4166 . if '\\$0'DOCHEADER_FAMILY' .ds $DOCHEADER_FAM \\$1
4167 . if '\\$0'DOCTYPE_FAMILY' .ds $DOCTYPE_FAM \\$1
4168 . if '\\$0'ENDNOTE_FAMILY' .ds $EN_FAM \\$1
4169 . if '\\$0'ENDNOTE_NUMBER_FAMILY' .ds $EN_NUMBER_FAM \\$1
4170 . if '\\$0'ENDNOTE_LINENUMBER_FAMILY' .ds $EN_LN_FAM \\$1
4171 . if '\\$0'ENDNOTE_STRING_FAMILY' .ds $EN_STRING_FAM \\$1
4172 . if '\\$0'ENDNOTE_TITLE_FAMILY' .ds $EN_TITLE_FAM \\$1
4173 . if '\\$0'EPIGRAPH_FAMILY' .ds $EPI_FAM \\$1
4174 . if '\\$0'FOOTNOTE_FAMILY' .ds $FN_FAM \\$1
4175 . if '\\$0'HDRFTR_CENTER_FAMILY' .ds $HDRFTR_CENTER_FAM \\$1
4176 . if '\\$0'HDRFTR_FAMILY' \{\
4177 . ds $HDRFTR_FAM \\$1
4178 . ds $HDRFTR_LEFT_FAM \\$1
4179 . ds $HDRFTR_CENTER_FAM \\$1
4180 . ds $HDRFTR_RIGHT_FAM \\$1
4182 . if '\\$0'HDRFTR_LEFT_FAMILY' .ds $HDRFTR_LEFT_FAM \\$1
4183 . if '\\$0'HDRFTR_RIGHT_FAMILY' .ds $HDRFTR_RIGHT_FAM \\$1
4184 . if '\\$0'HEAD_FAMILY' .ds $HEAD_FAM \\$1
4185 . if '\\$0'PAGENUM_FAMILY' .ds $PAGE_NUM_FAM \\$1
4186 . if '\\$0'PARAHEAD_FAMILY' .ds $PH_FAM \\$1
4187 . if '\\$0'QUOTE_FAMILY' .ds $QUOTE_FAM \\$1
4188 . if '\\$0'SUBHEAD_FAMILY' .ds $SH_FAM \\$1
4189 . if '\\$0'SUBTITLE_FAMILY' .ds $SUBTITLE_FAM \\$1
4190 . if '\\$0'TITLE_FAMILY' .ds $TITLE_FAM \\$1
4191 . if '\\$0'TOC_FAMILY' .ds $TOC_FAM \\$1
4192 . if '\\$0'TOC_FAM' .ds $TOC_FAM \\$1
4193 . if '\\$0'TOC_HEADER_FAMILY' .ds $TOC_HEADER_FAM \\$1
4194 . if '\\$0'TOC_HEAD_FAMILY' .ds $TOC_HEAD_FAM \\$1
4195 . if '\\$0'TOC_PARAHEAD_FAMILY' .ds $TOC_PH_FAM \\$1
4196 . if '\\$0'TOC_PN_FAMILY' .ds $TOC_PN_FAM \\$1
4197 . if '\\$0'TOC_SUBHEAD_FAMILY' .ds $TOC_SH_FAM \\$1
4198 . if '\\$0'TOC_TITLE_FAMILY' .ds $TOC_TITLE_FAM \\$1
4203 . if '\\$0'AUTHOR_FONT' .ds $AUTHOR_FT \\$1
4204 . if '\\$0'BIBLIOGRAPHY_FONT' .ds $BIB_FT \\$1
4205 . if '\\$0'BIBLIOGRAPHY_STRING_FONT' .ds $BIB_STRING_FT \\$1
4206 . if '\\$0'BLOCKQUOTE_FONT' .ds $BQUOTE_FT \\$1
4207 . if '\\$0'CITATION_FONT' .ds $BQUOTE_FT \\$1
4208 . if '\\$0'CITE_FONT' .ds $BQUOTE_FT \\$1
4209 . if '\\$0'CHAPTER_TITLE_FONT' .ds $CHAPTER_TITLE_FT \\$1
4210 . if '\\$0'COVER_AUTHOR_FONT' .ds $COVER_AUTHOR_FT \\$1
4211 . if '\\$0'COVER_CHAPTER_TITLE_FONT' .ds $COVER_CHAPTER_TITLE_FT \\$1
4212 . if '\\$0'COVER_COPYRIGHT_FONT' .ds $COVER_COPYRIGHT_FT \\$1
4213 . if '\\$0'COVER_DOCTYPE_FONT' .ds $COVER_DOCTYPE_FT \\$1
4214 . if '\\$0'COVER_SUBTITLE_FONT' .ds $COVER_SUBTITLE_FT \\$1
4215 . if '\\$0'COVER_TITLE_FONT' .ds $COVER_TITLE_FT \\$1
4216 . if '\\$0'DOC_COVER_AUTHOR_FONT' .ds $DOC_COVER_AUTHOR_FT \\$1
4217 . if '\\$0'DOC_COVER_CHAPTER_TITLE_FONT' .ds $DOC_COVER_CHAPTER_TITLE_FT \\$1
4218 . if '\\$0'DOC_COVER_COPYRIGHT_FONT' .ds $DOC_COVER_COPYRIGHT_FT \\$1
4219 . if '\\$0'DOC_COVER_DOCTYPE_FONT' .ds $DOC_COVER_DOCTYPE_FT \\$1
4220 . if '\\$0'DOC_COVER_SUBTITLE_FONT' .ds $DOC_COVER_SUBTITLE_FT \\$1
4221 . if '\\$0'DOC_COVER_TITLE_FONT' .ds $DOC_COVER_TITLE_FT \\$1
4222 . if '\\$0'DOCTYPE_FONT' .ds $DOCTYPE_FT \\$1
4223 . if '\\$0'ENDNOTE_FONT' .ds $EN_FT \\$1
4224 . if '\\$0'ENDNOTE_NUMBER_FONT' .ds $EN_NUMBER_FT \\$1
4225 . if '\\$0'ENDNOTE_LINENUMBER_FONT' .ds $EN_LN_FT \\$1
4226 . if '\\$0'ENDNOTE_STRING_FONT' .ds $EN_STRING_FT \\$1
4227 . if '\\$0'ENDNOTE_TITLE_FONT' .ds $EN_TITLE_FT \\$1
4228 . if '\\$0'EPIGRAPH_FONT' .ds $EPI_FT \\$1
4229 . if '\\$0'FOOTNOTE_FONT' .ds $FN_FT \\$1
4230 . if '\\$0'HDRFTR_CENTER_FONT' .ds $HDRFTR_CENTER_FT \\$1
4231 . if '\\$0'HDRFTR_LEFT_FONT' .ds $HDRFTR_LEFT_FT \\$1
4232 . if '\\$0'HDRFTR_RIGHT_FONT' .ds $HDRFTR_RIGHT_FT \\$1
4233 . if '\\$0'HEAD_FONT' .ds $HEAD_FT \\$1
4234 . if '\\$0'PAGENUM_FONT' .ds $PAGE_NUM_FT \\$1
4235 . if '\\$0'PARAHEAD_FONT' .ds $PH_FT \\$1
4236 . if '\\$0'QUOTE_FONT' .ds $QUOTE_FT \\$1
4237 . if '\\$0'SUBHEAD_FONT' .ds $SH_FT \\$1
4238 . if '\\$0'SUBTITLE_FONT' .ds $SUBTITLE_FT \\$1
4239 . if '\\$0'TITLE_FONT' .ds $TITLE_FT \\$1
4240 . if '\\$0'TOC_HEADER_FONT' .ds $TOC_HEADER_FT \\$1
4241 . if '\\$0'TOC_HEAD_FONT' .ds $TOC_HEAD_FT \\$1
4242 . if '\\$0'TOC_PARAHEAD_FONT' .ds $TOC_PH_FT \\$1
4243 . if '\\$0'TOC_PN_FONT' .ds $TOC_PN_FT \\$1
4244 . if '\\$0'TOC_SUBHEAD_FONT' .ds $TOC_SH_FT \\$1
4245 . if '\\$0'TOC_TITLE_FONT' .ds $TOC_TITLE_FT \\$1
4250 . if '\\$0'AUTHOR_SIZE' .ds $AUTHOR_SIZE_CHANGE \\$1
4251 . if '\\$0'BIBLIOGRAPHY_STRING_SIZE' .ds $BIB_STRING_SIZE_CHANGE \\$1
4252 . if '\\$0'BLOCKQUOTE_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
4253 . if '\\$0'CITATION_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
4254 . if '\\$0'CITE_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
4255 . if '\\$0'CHAPTER_TITLE_SIZE' .ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
4256 . if '\\$0'COVER_AUTHOR_SIZE' .ds $COVER_AUTHOR_SIZE_CHANGE \\$1
4257 . if '\\$0'COVER_CHAPTER_TITLE_SIZE' .ds $COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
4258 . if '\\$0'COVER_COPYRIGHT_SIZE' .ds $COVER_COPYRIGHT_SIZE_CHANGE \\$1
4259 . if '\\$0'COVER_DOCTYPE_SIZE' .ds $COVER_DOCTYPE_SIZE_CHANGE \\$1
4260 . if '\\$0'COVER_SUBTITLE_SIZE' .ds $COVER_SUBTITLE_SIZE_CHANGE \\$1
4261 . if '\\$0'COVER_TITLE_SIZE' .ds $COVER_TITLE_SIZE_CHANGE \\$1
4262 . if '\\$0'DOC_COVER_AUTHOR_SIZE' .ds $DOC_COVER_AUTHOR_SIZE_CHANGE \\$1
4263 . if '\\$0'DOC_COVER_CHAPTER_TITLE_SIZE' .ds $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
4264 . if '\\$0'DOC_COVER_COPYRIGHT_SIZE' .ds $DOC_COVER_COPYRIGHT_SIZE_CHANGE \\$1
4265 . if '\\$0'DOC_COVER_DOCTYPE_SIZE' .ds $DOC_COVER_DOCTYPE_SIZE_CHANGE \\$1
4266 . if '\\$0'DOC_COVER_SUBTITLE_SIZE' .ds $DOC_COVER_SUBTITLE_SIZE_CHANGE \\$1
4267 . if '\\$0'DOC_COVER_TITLE_SIZE' .ds $DOC_COVER_TITLE_SIZE_CHANGE \\$1
4268 . if '\\$0'DOCTYPE_SIZE' .ds $DOCTYPE_SIZE_CHANGE \\$1
4269 . if '\\$0'ENDNOTE_NUMBER_SIZE' .ds $EN_NUMBER_SIZE_CHANGE \\$1
4270 . if '\\$0'ENDNOTE_LINENUMBER_SIZE' .ds $EN_LN_SIZE_CHANGE \\$1
4271 . if '\\$0'ENDNOTE_STRING_SIZE' .ds $EN_STRING_SIZE_CHANGE \\$1
4272 . if '\\$0'ENDNOTE_TITLE_SIZE' .ds $EN_TITLE_SIZE_CHANGE \\$1
4273 . if '\\$0'EPIGRAPH_SIZE' .ds $EPI_SIZE_CHANGE \\$1
4274 . if '\\$0'FOOTNOTE_SIZE' .ds $FN_SIZE_CHANGE \\$1
4275 . if '\\$0'HDRFTR_CENTER_SIZE' .ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
4276 . if '\\$0'HDRFTR_LEFT_SIZE' .ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
4277 . if '\\$0'HDRFTR_RIGHT_SIZE' .ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
4278 . if '\\$0'HDRFTR_SIZE' .ds $HDRFTR_SIZE_CHANGE \\$1
4279 . if '\\$0'HEAD_SIZE' .ds $HEAD_SIZE_CHANGE \\$1
4280 . if '\\$0'PAGENUM_SIZE' .ds $PAGE_NUM_SIZE_CHANGE \\$1
4281 . if '\\$0'PARAHEAD_SIZE' .ds $PH_SIZE_CHANGE \\$1
4282 . if '\\$0'QUOTE_SIZE' .ds $QUOTE_SIZE_CHANGE \\$1
4283 . if '\\$0'SUBHEAD_SIZE' .ds $SH_SIZE_CHANGE \\$1
4284 . if '\\$0'SUBTITLE_SIZE' .ds $SUBTITLE_SIZE_CHANGE \\$1
4285 . if '\\$0'TITLE_SIZE' .ds $TITLE_SIZE_CHANGE \\$1
4286 . if '\\$0'TOC_HEADER_SIZE' .ds $TOC_HEADER_SIZE_CHANGE \\$1
4287 . if '\\$0'TOC_HEAD_SIZE' .ds $TOC_HEAD_SIZE_CHANGE \\$1
4288 . if '\\$0'TOC_PARAHEAD_SIZE' .ds $TOC_PH_SIZE_CHANGE \\$1
4289 . if '\\$0'TOC_PN_SIZE' .ds $TOC_PN_SIZE_CHANGE \\$1
4290 . if '\\$0'TOC_SUBHEAD_SIZE' .ds $TOC_SH_SIZE_CHANGE \\$1
4291 . if '\\$0'TOC_TITLE_SIZE' .ds $TOC_TITLE_SIZE_CHANGE \\$1
4296 . if \\n[#PRINT_STYLE]=1 \{ .return \}
4297 . if '\\$0'ATTRIBUTE_COLOR' \{\
4298 . nr #ATTRIBUTE_COLOR 1
4299 . ds $ATTRIBUTE_COLOR \\$1
4301 . if '\\$0'AUTHOR_COLOR' \{\
4302 . nr #AUTHOR_COLOR 1
4303 . ds $AUTHOR_COLOR \\$1
4305 . if '\\$0'BLOCKQUOTE_COLOR' \{\
4306 . nr #BQUOTE_COLOR 1
4307 . ds $BQUOTE_COLOR \\$1
4309 . if '\\$0'CITATION_COLOR' \{\
4310 . nr #BQUOTE_COLOR 1
4311 . ds $BQUOTE_COLOR \\$1
4313 . if '\\$0'CITE_COLOR' \{\
4314 . nr #BQUOTE_COLOR 1
4315 . ds $BQUOTE_COLOR \\$1
4317 . if '\\$0'CHAPTER_TITLE_COLOR' \{\
4318 . nr #CHAPTER_TITLE_COLOR 1
4319 . ds $CHAPTER_TITLE_COLOR \\$1
4321 . if '\\$0'COVER_ATTRIBUTE_COLOR' \{\
4322 . nr #COVER_ATTRIBUTE_COLOR 1
4323 . ds $COVER_ATTRIBUTE_COLOR \\$1
4325 . if '\\$0'COVER_AUTHOR_COLOR' \{\
4326 . nr #COVER_AUTHOR_COLOR 1
4327 . ds $COVER_AUTHOR_COLOR \\$1
4329 . if '\\$0'COVER_CHAPTER_TITLE_COLOR' \{\
4330 . nr #COVER_CHAPTER_TITLE_COLOR 1
4331 . ds $COVER_CHAPTER_TITLE_COLOR \\$1
4333 . if '\\$0'COVER_COLOR' \{\
4335 . ds $COVER_COLOR \\$1
4337 . if '\\$0'COVER_COPYRIGHT_COLOR' \{\
4338 . nr #COVER_COPYRIGHT_COLOR 1
4339 . ds $COVER_COPYRIGHT_COLOR \\$1
4341 . if '\\$0'COVER_MISC_COLOR' \{\
4342 . nr #COVER_MISC_COLOR 1
4343 . ds $COVER_MISC_COLOR \\$1
4345 . if '\\$0'COVER_TITLE_COLOR' \{\
4346 . nr #COVER_TITLE_COLOR 1
4347 . ds $COVER_TITLE_COLOR \\$1
4349 . if '\\$0'COVER_SUBTITLE_COLOR' \{\
4350 . nr #COVER_SUBTITLE_COLOR 1
4351 . ds $COVER_SUBTITLE_COLOR \\$1
4353 . if '\\$0'COVER_DOCTYPE_COLOR' \{\
4354 . nr #COVER_DOCTYPE_COLOR 1
4355 . ds $COVER_DOCTYPE_COLOR \\$1
4357 . if '\\$0'DOC_COVER_ATTRIBUTE_COLOR' \{\
4358 . nr #DOC_COVER_ATTRIBUTE_COLOR 1
4359 . ds $DOC_COVER_ATTRIBUTE_COLOR \\$1
4361 . if '\\$0'DOC_COVER_AUTHOR_COLOR' \{\
4362 . nr #DOC_COVER_AUTHOR_COLOR 1
4363 . ds $DOC_COVER_AUTHOR_COLOR \\$1
4365 . if '\\$0'DOC_COVER_CHAPTER_TITLE_COLOR' \{\
4366 . nr #DOC_COVER_CHAPTER_TITLE_COLOR 1
4367 . ds $DOC_COVER_CHAPTER_TITLE_COLOR \\$1
4369 . if '\\$0'DOC_COVER_COLOR' \{\
4370 . nr #DOC_COVER_COLOR 1
4371 . ds $DOC_COVER_COLOR \\$1
4373 . if '\\$0'DOC_COVER_COPYRIGHT_COLOR' \{\
4374 . nr #DOC_COVER_COPYRIGHT_COLOR 1
4375 . ds $DOC_COVER_COPYRIGHT_COLOR \\$1
4377 . if '\\$0'DOC_COVER_MISC_COLOR' \{\
4378 . nr #DOC_COVER_MISC_COLOR 1
4379 . ds $DOC_COVER_MISC_COLOR \\$1
4381 . if '\\$0'DOC_COVER_TITLE_COLOR' \{\
4382 . nr #DOC_COVER_TITLE_COLOR 1
4383 . ds $DOC_COVER_TITLE_COLOR \\$1
4385 . if '\\$0'DOC_COVER_SUBTITLE_COLOR' \{\
4386 . nr #DOC_COVER_SUBTITLE_COLOR 1
4387 . ds $DOC_COVER_SUBTITLE_COLOR \\$1
4389 . if '\\$0'DOC_COVER_DOCTYPE_COLOR' \{\
4390 . nr #DOC_COVER_DOCTYPE_COLOR 1
4391 . ds $DOC_COVER_DOCTYPE_COLOR \\$1
4393 . if '\\$0'DOCHEADER_COLOR' \{\
4394 . nr #DOCHEADER_COLOR 1
4395 . ds $DOCHEADER_COLOR \\$1
4397 . if '\\$0'DOCTYPE_COLOR' \{\
4398 . nr #DOCTYPE_COLOR 1
4399 . ds $DOCTYPE_COLOR \\$1
4401 . if '\\$0'EPIGRAPH_COLOR' \{\
4403 . ds $EPI_COLOR \\$1
4405 . if '\\$0'FINIS_COLOR' \{\
4407 . ds $FINIS_COLOR \\$1
4409 . if '\\$0'FOOTNOTE_COLOR' \{\
4410 . nr #FOOTNOTE_COLOR 1
4411 . ds $FOOTNOTE_COLOR \\$1
4413 . if '\\$0'HDRFTR_CENTER_COLOR' \{\
4414 . nr #HDRFTR_CENTER_COLOR 1
4415 . ds $HDRFTR_CENTER_COLOR \\$1
4417 . if '\\$0'HDRFTR_COLOR' \{\
4418 . nr #HDRFTR_COLOR 1
4419 . ds $HDRFTR_COLOR \\$1
4421 . if '\\$0'HDRFTR_LEFT_COLOR' \{\
4422 . nr #HDRFTR_LEFT_COLOR 1
4423 . ds $HDRFTR_LEFT_COLOR \\$1
4425 . if '\\$0'HDRFTR_RIGHT_COLOR' \{\
4426 . nr #HDRFTR_RIGHT_COLOR 1
4427 . ds $HDRFTR_RIGHT_COLOR \\$1
4429 . if '\\$0'HDRFTR_RULE_COLOR' \{\
4430 . nr #HDRFTR_RULE_COLOR 1
4431 . ds $HDRFTR_RULE_COLOR \\$1
4433 . if '\\$0'HEAD_COLOR' \{\
4435 . ds $HEAD_COLOR \\$1
4437 . if '\\$0'LINEBREAK_COLOR' \{\
4438 . nr #LINEBREAK_COLOR 1
4439 . ds $LINEBREAK_COLOR \\$1
4441 . if '\\$0'PAGENUM_COLOR' \{\
4442 . nr #PAGE_NUM_COLOR 1
4443 . ds $PAGENUM_COLOR \\$1
4445 . if '\\$0'PARAHEAD_COLOR' \{\
4449 . if '\\$0'QUOTE_COLOR' \{\
4451 . ds $QUOTE_COLOR \\$1
4453 . if '\\$0'SUBHEAD_COLOR' \{\
4457 . if '\\$0'SUBTITLE_COLOR' \{\
4458 . nr #SUBTITLE_COLOR 1
4459 . ds $SUBTITLE_COLOR \\$1
4461 . if '\\$0'TITLE_COLOR' \{\
4463 . ds $TITLE_COLOR \\$1
4469 . if '\\$0'BIBLIOGRAPHY_QUAD' \{\
4471 . if '\\*[$BIB_QUAD]'R' .ab Fatal error: \\$0 must be set to either L or J
4472 . if '\\*[$BIB_QUAD]'C' .ab Fatal error: \\$0 must be set to either L or J
4474 . if '\\$0'BIBLIOGRAPHY_STRING_QUAD' .ds $BIB_STRING_QUAD \\$1
4475 . if '\\$0'BLOCKQUOTE_QUAD' .ds $BQUOTE_QUAD \\$1
4476 . if '\\$0'CITATION_QUAD' .ds $BQUOTE_QUAD \\$1
4477 . if '\\$0'CITE_QUAD' .ds $BQUOTE_QUAD \\$1
4478 . if '\\$0'COVER_COPYRIGHT_QUAD' .ds $COVER_COPYRIGHT_QUAD \\$1
4479 . if '\\$0'COVER_MISC_QUAD' .ds $COVER_MISC_QUAD \\$1
4480 . if '\\$0'DOC_COVER_COPYRIGHT_QUAD' .ds $DOC_COVER_COPYRIGHT_QUAD \\$1
4481 . if '\\$0'DOC_COVER_MISC_QUAD' .ds $DOC_COVER_MISC_QUAD \\$1
4482 . if '\\$0'DOC_QUAD' \{\
4484 . QUAD \\*[$DOC_QUAD]
4486 . if '\\$0'ENDNOTE_QUAD' \{\
4488 . if '\\*[$EN_QUAD]'R' .ab Fatal error: \\$0 must be set to either L or J
4489 . if '\\*[$EN_QUAD]'C' .ab Fatal error: \\$0 must be set to either L or J
4491 . if '\\$0'ENDNOTE_STRING_QUAD' .ds $EN_STRING_QUAD \\$1
4492 . if '\\$0'ENDNOTE_TITLE_QUAD' .ds $EN_TITLE_QUAD \\$1
4493 . if '\\$0'EPIGRAPH_QUAD' .ds $EPI_QUAD \\$1
4494 . if '\\$0'FOOTNOTE_QUAD' .ds $FN_QUAD \\$1
4495 . if '\\$0'HEAD_QUAD' .ds $HEAD_QUAD \\$1
4496 . if '\\$0'SUBHEAD_QUAD' .ds $SH_QUAD \\$1
4497 . if '\\$0'TOC_HEADER_QUAD' .ds $TOC_HEADER_QUAD \\$1
4506 \# Sets up defaults if no values are entered prior to START.
4508 \# The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
4509 \# $REVISION_STRING are in the COPYSTYLE macro.
4512 . if !d$PAPER \{ .PAPER LETTER \}
4513 . if !\\n[#DOC_TYPE] \{ .DOCTYPE DEFAULT \}
4514 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4516 . if !\\n[#COPY_STYLE]=1 \{ .PAGENUM_STYLE DIGIT \}
4518 . if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
4519 . if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
4520 . if \\n[#DOC_TYPE]=4 \{\
4521 . if !\\n[#USER_SET_L_LENGTH] \{\
4522 . R_MARGIN \\n[#R_MARGIN]u
4523 . rr #USER_SET_L_LENGTH
4525 . if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
4527 . if \\n[#COPY_STYLE]=1 \{\
4531 . if !r#DOC_HEADER \{ .DOCHEADER \}
4532 . if !r#HEADERS_ON \{ .HEADERS \}
4533 . if !r#PAGINATE \{ .PAGINATE \}
4534 . if \\n[#FOOTERS_ON] \{\
4536 . if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
4538 . if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
4539 . if !r#HEADER_GAP \{ .HEADER_GAP 3P \}
4540 . if \\n[#FOOTERS_ON] \{\
4541 . if \\n[#PAGINATE]=0 \{\
4542 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
4545 . if \\n[#HEADERS_ON]=0 \{\
4546 . if \\n[#FOOTERS_ON]=0 \{\
4547 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
4550 . if !r#T_MARGIN \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
4551 . if !r#DOCHEADER_ADVANCE \{ .nr #DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
4552 . if !r#FOOTER_MARGIN \{ .FOOTER_MARGIN 3P \}
4553 . if !r#FOOTER_GAP \{ .FOOTER_GAP 3P \}
4554 . if !r#B_MARGIN \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
4555 . if (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
4556 . tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
4557 . tm1 " No footers or bottom-of-page page numbers will be printed.
4558 . tm1 " Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
4559 . tm1 " If no footers or bottom-of-page page numbers are required,
4560 . tm1 " type in .FOOTER_MARGIN 0 before .START
4562 . if !r#HDRFTR_RULE_GAP \{\
4563 . if \\n[#HEADERS_ON] \{ .HDRFTR_RULE_GAP 4p \}
4564 . if \\n[#FOOTERS_ON] \{ .HDRFTR_RULE_GAP 4p \}
4566 . if !r#HDRFTR_RULE \{ .HDRFTR_RULE \}
4567 . if !r#PAGE_NUM_SET \{ .PAGENUMBER 1 \}
4568 .\" Read in number registers and strings for type parameters
4569 . nr #DOC_L_MARGIN \\n[#L_MARGIN]
4570 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
4571 . nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
4572 . ds $DOC_FAM \\*[$FAMILY]
4573 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
4574 . nr #DOC_LEAD \\n[#LEAD]
4575 .\" #SAVED_DOC_LEAD is set in COLLATE
4576 . if r#SAVED_DOC_LEAD \{\
4577 . if !\\n[#DOC_LEAD]=\\n[#SAVED_DOC_LEAD] \{ .nr #RERUN_TRAPS 1 \}
4579 . ie \\n[#ADJ_DOC_LEAD]=1 \{ . \}
4581 . if !\\n[#DOC_LEAD_ADJUST_OFF] \{\
4585 . ds $DOC_QUAD \\*[$QUAD_VALUE]
4586 . ds $PP_FT \\*[$FONT]
4591 . nr #FN_COUNT_FOR_COLS 0 1
4594 . RESET_SUBHEAD_NUMBER
4595 . RESET_PARAHEAD_NUMBER
4596 .\" General style defaults for both PRINTSTYLEs
4598 . PARA_INDENT \\n[#PP_INDENT]u
4599 . if !d$HDRFTR_FAM \{ .HDRFTR_FAMILY \\*[$DOC_FAM] \}
4600 . if !d$HDRFTR_SIZE_CHANGE \{ .HDRFTR_SIZE +0 \}
4601 . if !d$PAGE_NUM_FAM \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
4602 . if !d$PAGE_NUM_FT \{ .PAGENUM_FONT R \}
4603 . if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE +0 \}
4604 . if !r#PAGE_NUM_POS_SET \{ .PAGENUM_POS BOTTOM CENTER \}
4605 . ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
4606 . if \\n[#PAGE_NUM_HYPHENS]=0 \{ .PAGENUM_HYPHENS OFF \}
4607 . if \\n[#PAGE_NUM_HYPHENS]=1 \{ .PAGENUM_HYPHENS \}
4609 . el \{ .PAGENUM_HYPHENS \}
4610 . if !d$HEAD_QUAD \{ .HEAD_QUAD CENTER \}
4611 . if !r#HEAD_CAPS \{ .HEAD_CAPS \}
4612 . if !r#HEAD_UNDERLINE \{ .HEAD_UNDERLINE \}
4613 . if !d$SH_QUAD \{ .SUBHEAD_QUAD LEFT \}
4614 . if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
4615 . if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
4616 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
4618 . if !d$FN_FAM \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
4619 . if !d$FN_FT \{ .FOOTNOTE_FONT R \}
4620 . if !d$FN_QUAD \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD] \}
4621 . if !r#FN_RULE \{ .FOOTNOTE_RULE \}
4622 . if !r#FN_MARKERS \{ .FOOTNOTE_MARKERS \}
4623 . if !\\n[#FN_MARKER_STYLE] \{ .FOOTNOTE_MARKER_STYLE STAR \}
4624 . if !\\n[#EN_MARKER_STYLE] \{ .ENDNOTE_MARKER_STYLE NUMBER \}
4625 . if !d$EN_PN_STYLE \{ .ENDNOTES_PAGENUM_STYLE digit \}
4626 . if !d$EN_FAM \{ .ENDNOTE_FAMILY \\*[$DOC_FAM] \}
4627 . if !d$EN_FT \{ .ENDNOTE_FONT R \}
4628 . if !d$EN_QUAD \{ .ENDNOTE_QUAD \\*[$DOC_QUAD] \}
4629 . if !d$EN_STRING \{ .ENDNOTE_STRING "Endnotes" \}
4630 . if !d$EN_STRING_FAM \{ .ENDNOTE_STRING_FAMILY \\*[$EN_FAM] \}
4631 . if !d$EN_STRING_QUAD \{ .ENDNOTE_STRING_QUAD CENTER \}
4632 . if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2 \}
4633 . if !r#EN_STRING_CAPS \{ .ENDNOTE_STRING_CAPS \}
4634 . if !d$EN_TITLE \{\
4635 . ie \\n[#DOC_TYPE]=2 \{\
4636 . ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
4637 . el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]" \}
4639 . el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
4641 . if !d$EN_TITLE_FAM \{ .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM] \}
4642 . if !d$EN_TITLE_QUAD \{ .ENDNOTE_TITLE_QUAD LEFT \}
4643 . if !r#EN_TITLE_UNDERSCORE \{ .ENDNOTE_TITLE_UNDERSCORE \}
4644 . if !d$EN_NUMBER_FAM \{ .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] \}
4645 . if !r#EN_NUMBERS_ALIGN_LEFT \{\
4646 . if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2 \}
4648 . if !d$EN_LN_GAP \{ .ENDNOTE_LINENUMBER_GAP 1.5n \}
4649 . if !d$BIB_PN_STYLE \{ .BIBLIOGRAPHY_PAGENUM_STYLE digit \}
4650 . if !d$BIB_FAM \{ .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM] \}
4651 . if !d$BIB_FT \{ .BIBLIOGRAPHY_FONT R \}
4652 . if !d$BIB_QUAD \{ .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD] \}
4653 . if !d$BIB_STRING \{ .BIBLIOGRAPHY_STRING "Bibliography" \}
4654 . if !d$BIB_STRING_FAM \{ .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FAM] \}
4655 . if !d$BIB_STRING_QUAD \{ .BIBLIOGRAPHY_STRING_QUAD CENTER \}
4656 . if !r#BIB_STRING_UNDERSCORE \{ .BIBLIOGRAPHY_STRING_UNDERSCORE 2 \}
4657 . if !r#BIB_STRING_CAPS \{ .BIBLIOGRAPHY_STRING_CAPS \}
4658 . if !d$TOC_HEADER_STRING \{ .TOC_HEADER_STRING "Contents" \}
4659 . if !d$TOC_HEADER_QUAD \{ .TOC_HEADER_QUAD LEFT \}
4660 . if !d$TOC_PN_STYLE \{ .TOC_PAGENUM_STYLE roman \}
4661 . if !r#TOC_PN_PADDING \{ .TOC_PADDING 3 \}
4662 . if !r#TOC_TITLE_INDENT \{ .TOC_TITLE_INDENT 0 \}
4663 . if !r#TOC_HEAD_INDENT \{ .TOC_HEAD_INDENT 18p \}
4664 . if !r#TOC_SH_INDENT \{ .TOC_SUBHEAD_INDENT 30p \}
4665 . if !r#TOC_PH_INDENT \{ .TOC_PARAHEAD_INDENT 42p \}
4666 .\" String defaults for both PRINTSTYLEs
4667 . ie \\n[#DOC_TYPE]=1 \{\
4668 . ie '\\*[$DOC_TITLE]'' \{\
4669 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
4670 . rr #USER_DEF_HDRFTR_LEFT
4671 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
4672 . rr #USER_DEF_HDRFTR_RIGHT
4675 . if \\n[#COPY_STYLE]=1 \{ .DRAFT_WITH_PAGENUMBER \}
4676 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
4677 . rr #USER_DEF_HDRFTR_LEFT
4678 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 .ds $HDRFTR_CENTER \\*[$TITLE]
4679 . rr #USER_DEF_HDRFTR_CENTER
4680 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$DOC_TITLE]
4681 . rr #USER_DEF_HDRFTR_RIGHT
4685 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
4686 . rr #USER_DEF_HDRFTR_LEFT
4687 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
4688 . rr #USER_DEF_HDRFTR_RIGHT
4690 . if !d$ATTRIBUTE_STRING \{ .ATTRIBUTE_STRING "by" \}
4691 . if !d$FINIS_STRING \{ .FINIS_STRING "END" \}
4693 . if !r#DOC_COVERS_OFF \{ .nr #DOC_COVERS 1 \}
4694 . if !r#COVERS_OFF \{ .nr #COVERS 1 \}
4695 . if !d$COVER_COPYRIGHT_QUAD \{ .COVER_COPYRIGHT_QUAD R \}
4696 . if !d$COVER_MISC_QUAD \{ .COVER_MISC_QUAD L \}
4697 . if !d$DOC_COVER_COPYRIGHT_QUAD \{ .DOC_COVER_COPYRIGHT_QUAD R \}
4698 . if !d$DOC_COVER_MISC_QUAD \{ .DOC_COVER_MISC_QUAD L \}
4699 .\" Defaults for printstyle TYPEWRITE
4700 . if \\n[#PRINT_STYLE]=1 \{\
4701 . if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES \}
4702 . if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF \}
4703 .\" +Quotes and blockquotes
4704 . if !r#Q_OFFSET_VALUE \{ .QUOTE_INDENT 2 \}
4706 . if !r#EPI_OFFSET_VALUE \{ .EPIGRAPH_INDENT 2 \}
4708 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 2p \}
4710 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE +0 \}
4711 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 2i \}
4712 .\" +Paragraph heads
4713 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
4715 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
4717 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 6p \}
4719 . if !r#SLANT_MEANS_SLANT \{\
4720 . ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
4721 . el \{ .UNDERLINE_SLANT OFF \}
4724 .\" Defaults for printstyle TYPESET
4725 . if \\n[#PRINT_STYLE]=2 \{\
4726 . if !d$DOCHEADER_LEAD_ADJ \{\
4727 . ie !'\\*[$CHAPTER_TITLE]'' \{\
4728 . ie !'\\*[$CHAPTER_STRING]'' \{\
4731 . el \{ .DOCHEADER_LEAD +0 \}
4733 . el \{ .DOCHEADER_LEAD +0 \}
4736 . if !d$COVER_LEAD_ADJ \{ .COVER_LEAD +0 \}
4737 . if !d$COVER_FAM \{ .COVER_FAMILY \\*[$DOC_FAM] \}
4739 . if !d$COVER_TITLE_FAM \{\
4740 . ie !d$COVER_FAM \{ .COVER_TITLE_FAMILY \\*[$DOC_FAM] \}
4741 . el \{ .COVER_TITLE_FAMILY \\*[$COVER_FAM] \}
4743 . if !d$COVER_TITLE_FT \{ .COVER_TITLE_FONT B \}
4744 . if !d$COVER_TITLE_SIZE_CHANGE \{ .COVER_TITLE_SIZE +3.5 \}
4746 . if !d$COVER_CHAPTER_TITLE_FAM \{\
4747 . ie !d$COVER_FAM \{ .COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
4748 . el \{ .COVER_CHAPTER_TITLE_FAMILY \\*[$COVER_FAM] \}
4750 . if !d$COVER_CHAPTER_TITLE_FT \{ .COVER_CHAPTER_TITLE_FONT BI \}
4751 . if !d$COVER_CHAPTER_TITLE_SIZE_CHANGE \{ .COVER_CHAPTER_TITLE_SIZE +4 \}
4753 . if !d$COVER_SUBTITLE_FAM \{\
4754 . ie !d$COVER_FAM \{ .COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] \}
4755 . el \{ .COVER_SUBTITLE_FAMILY \\*[$COVER_FAM] \}
4757 . if !d$COVER_SUBTITLE_FT \{ .COVER_SUBTITLE_FONT R \}
4758 . if !d$COVER_SUBTITLE_SIZE_CHANGE \{ .COVER_SUBTITLE_SIZE +0 \}
4759 .\" (attribution and author[s])
4760 . if !d$COVER_AUTHOR_FAM \{\
4761 . ie !d$COVER_FAM \{ .COVER_AUTHOR_FAMILY \\*[$DOC_FAM] \}
4762 . el \{ .COVER_AUTHOR_FAMILY \\*[$COVER_FAM] \}
4764 . if !d$COVER_AUTHOR_FT \{ .COVER_AUTHOR_FONT I \}
4765 . if !d$COVER_AUTHOR_SIZE_CHANGE \{ .COVER_AUTHOR_SIZE +0 \}
4766 .\" (doctype if "named")
4767 . if !d$COVER_DOCTYPE_FAM \{\
4768 . ie !d$COVER_FAM \{ .COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] \}
4769 . el \{ .COVER_DOCTYPE_FAMILY \\*[$COVER_FAM] \}
4771 . if !d$COVER_DOCTYPE_FT \{ .COVER_DOCTYPE_FONT BI \}
4772 . if !d$COVER_DOCTYPE_SIZE_CHANGE \{ .COVER_DOCTYPE_SIZE +3 \}
4774 . if !d$COVER_COPYRIGHT_FAM \{\
4775 . ie !d$COVER_FAM \{ .COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] \}
4776 . el \{ .COVER_COPYRIGHT_FAMILY \\*[$COVER_FAM] \}
4778 . if !d$COVER_COPYRIGHT_FT \{ .COVER_COPYRIGHT_FONT R \}
4779 . if !d$COVER_COPYRIGHT_SIZE_CHANGE \{ .COVER_COPYRIGHT_SIZE -2 \}
4781 . if !d$DOC_COVER_LEAD_ADJ \{ .DOC_COVER_LEAD +0 \}
4782 . if !d$DOC_COVER_FAM \{ .DOC_COVER_FAMILY \\*[$DOC_FAM] \}
4784 . if !d$DOC_COVER_TITLE_FAM \{\
4785 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_TITLE_FAMILY \\*[$DOC_FAM] \}
4786 . el \{ .DOC_COVER_TITLE_FAMILY \\*[$DOC_COVER_FAM] \}
4788 . if !d$DOC_COVER_TITLE_FT \{ .DOC_COVER_TITLE_FONT B \}
4789 . if !d$DOC_COVER_TITLE_SIZE_CHANGE \{ .DOC_COVER_TITLE_SIZE +3.5 \}
4791 . if !d$DOC_COVER_CHAPTER_TITLE_FAM \{\
4792 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
4793 . el \{ .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_COVER_FAM] \}
4795 . if !d$DOC_COVER_CHAPTER_TITLE_FT \{ .DOC_COVER_CHAPTER_TITLE_FONT BI \}
4796 . if !d$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \{ .DOC_COVER_CHAPTER_TITLE_SIZE +4 \}
4798 . if !d$DOC_COVER_SUBTITLE_FAM \{\
4799 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] \}
4800 . el \{ .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_COVER_FAM] \}
4802 . if !d$DOC_COVER_SUBTITLE_FT \{ .DOC_COVER_SUBTITLE_FONT R \}
4803 . if !d$DOC_COVER_SUBTITLE_SIZE_CHANGE \{ .DOC_COVER_SUBTITLE_SIZE +0 \}
4804 .\" (attribution and author[s])
4805 . if !d$DOC_COVER_AUTHOR_FAM \{\
4806 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_FAM] \}
4807 . el \{ .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_COVER_FAM] \}
4809 . if !d$DOC_COVER_AUTHOR_FT \{ .DOC_COVER_AUTHOR_FONT I \}
4810 . if !d$DOC_COVER_AUTHOR_SIZE_CHANGE \{ .DOC_COVER_AUTHOR_SIZE +0 \}
4811 .\" (doctype if "named")
4812 . if !d$DOC_COVER_DOCTYPE_FAM \{\
4813 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] \}
4814 . el \{ .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_COVER_FAM] \}
4816 . if !d$DOC_COVER_DOCTYPE_FT \{ .DOC_COVER_DOCTYPE_FONT BI \}
4817 . if !d$DOC_COVER_DOCTYPE_SIZE_CHANGE \{ .DOC_COVER_DOCTYPE_SIZE +3 \}
4819 . if !d$DOC_COVER_COPYRIGHT_FAM \{\
4820 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] \}
4821 . el \{ .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_COVER_FAM] \}
4823 . if !d$DOC_COVER_COPYRIGHT_FT \{ .DOC_COVER_COPYRIGHT_FONT R \}
4824 . if !d$DOC_COVER_COPYRIGHT_SIZE_CHANGE \{ .DOC_COVER_COPYRIGHT_SIZE -2 \}
4826 . if !d$DOCHEADER_FAM \{ .DOCHEADER_FAMILY \\*[$DOC_FAM] \}
4827 . if !d$TITLE_FAM \{\
4828 . ie !d$DOCHEADER_FAM \{ .TITLE_FAMILY \\*[$DOC_FAM] \}
4829 . el \{ .TITLE_FAMILY \\*[$DOCHEADER_FAM] \}
4831 . if !d$TITLE_FT \{ .TITLE_FONT B \}
4832 . if !d$TITLE_SIZE_CHANGE \{\
4833 . ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
4834 . el \{ .TITLE_SIZE +3.5 \}
4836 . if !d$CHAPTER_TITLE_FAM \{\
4837 . ie !d$DOCHEADER_FAM \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
4838 . el \{ .CHAPTER_TITLE_FAMILY \\*[$DOCHEADER_FAM] \}
4840 . if !d$CHAPTER_TITLE_FT \{ .CHAPTER_TITLE_FONT BI \}
4841 . if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE +4 \}
4842 . if !d$SUBTITLE_FAM \{\
4843 . ie !d$DOCHEADER_FAM \{ .SUBTITLE_FAMILY \\*[$DOC_FAM] \}
4844 . el \{ .SUBTITLE_FAMILY \\*[$DOCHEADER_FAM] \}
4846 . if !d$SUBTITLE_FT \{ .SUBTITLE_FONT R \}
4847 . if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE +0 \}
4848 . if !d$AUTHOR_FAM \{\
4849 . ie !d$DOCHEADER_FAM \{ .AUTHOR_FAMILY \\*[$DOC_FAM] \}
4850 . el \{ .AUTHOR_FAMILY \\*[$DOCHEADER_FAM] \}
4852 . if !d$AUTHOR_FT \{ .AUTHOR_FONT I \}
4853 . if !d$AUTHOR_SIZE_CHANGE \{ .AUTHOR_SIZE +0 \}
4854 . if !d$DOCTYPE_FAM \{\
4855 . ie !d$DOCHEADER_FAM \{ .DOCTYPE_FAMILY \\*[$DOC_FAM] \}
4856 . el \{ .DOCTYPE_FAMILY \\*[$DOCHEADER_FAM] \}
4858 . if !d$DOCTYPE_FT \{ .DOCTYPE_FONT BI \}
4859 . if !d$DOCTYPE_SIZE_CHANGE \{ .DOCTYPE_SIZE +3 \}
4860 .\" +Headers and footers
4861 . if !d$HDRFTR_LEFT_FAM \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
4862 . if !d$HDRFTR_LEFT_FT \{ .HDRFTR_LEFT_FONT R \}
4863 . if \\n[#HDRFTR_LEFT_CAPS] \{\
4864 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -2 \}
4866 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -.5 \}
4867 . if !d$HDRFTR_CENTER_FAM \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
4868 . if !d$HDRFTR_CENTER_FT \{ .HDRFTR_CENTER_FONT I \}
4869 . if \\n[#HDRFTR_CENTER_CAPS] \{\
4870 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
4872 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5 \}
4873 . if !d$HDRFTR_RIGHT_FAM \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] \}
4874 . if !d$HDRFTR_RIGHT_FT \{ .HDRFTR_RIGHT_FONT R \}
4875 . if \\n[#HDRFTR_RIGHT_CAPS] \{\
4876 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
4878 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -.5 \}
4880 . if !d$HEAD_FAM \{ .HEAD_FAMILY \\*[$DOC_FAM] \}
4881 . if !d$HEAD_FT \{ .HEAD_FONT B \}
4882 . if !d$HEAD_SIZE_CHANGE \{ .HEAD_SIZE +1 \}
4883 . if !r#HEAD_SPACE \{ .HEAD_SPACE \}
4885 . if !d$SH_FAM \{ .SUBHEAD_FAMILY \\*[$DOC_FAM] \}
4886 . if !d$SH_FT \{ .SUBHEAD_FONT B \}
4887 . if !d$SH_SIZE_CHANGE \{ .SUBHEAD_SIZE +.5 \}
4888 .\" +Paragraph heads
4889 . if !d$PH_FAM \{ .PARAHEAD_FAMILY \\*[$DOC_FAM] \}
4890 . if !d$PH_FT \{ .PARAHEAD_FONT BI \}
4891 . if !d$PH_SIZE_CHANGE \{ .PARAHEAD_SIZE -.25 \}
4892 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
4894 . if !d$QUOTE_FAM \{ .QUOTE_FAMILY \\*[$DOC_FAM] \}
4895 . if !d$QUOTE_FT \{ .QUOTE_FONT I \}
4896 . if !d$QUOTE_SIZE_CHANGE \{ .QUOTE_SIZE +0 \}
4897 . if !r#Q_OFFSET_VALUE \{ .QUOTE_INDENT 3 \}
4899 .\" Note: the leading for quotes and blockquotes is set after .DEFAULTS in START
4900 . if !d$BQUOTE_FAM \{ .BLOCKQUOTE_FAMILY \\*[$DOC_FAM] \}
4901 . if !d$BQUOTE_FT \{ .BLOCKQUOTE_FONT R \}
4902 . if !d$BQUOTE_SIZE_CHANGE \{ .BLOCKQUOTE_SIZE -1 \}
4903 . if !d$BQUOTE_QUAD \{ .BLOCKQUOTE_QUAD LEFT \}
4905 . if !d$EPI_FAM \{ .EPIGRAPH_FAMILY \\*[$DOC_FAM] \}
4906 . if !d$EPI_FT \{ .EPIGRAPH_FONT R \}
4907 . if !d$EPI_SIZE_CHANGE \{ .EPIGRAPH_SIZE -1.5 \}
4908 . if !r#EPI_AUTOLEAD \{ .EPIGRAPH_AUTOLEAD 2 \}
4909 . if !d$EPI_QUAD \{ .EPIGRAPH_QUAD \\*[$DOC_QUAD] \}
4910 . if !r#EPI_OFFSET_VALUE \{ .EPIGRAPH_INDENT 3 \}
4912 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 3p \}
4914 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 4P \}
4915 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 3p \}
4916 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE -2 \}
4917 . if !r#FN_AUTOLEAD \{ .FOOTNOTE_AUTOLEAD 2 \}
4919 . if !r#EN_PS \{ .ENDNOTE_PT_SIZE \\n[#DOC_PT_SIZE]u \}
4920 . if !d$EN_STRING_FT \{ .ENDNOTE_STRING_FONT B \}
4921 . if !d$EN_STRING_SIZE_CHANGE \{ .ENDNOTE_STRING_SIZE +1 \}
4922 . if !d$EN_TITLE_FT \{ .ENDNOTE_TITLE_FONT B \}
4923 . if !d$EN_TITLE_SIZE_CHANGE \{ .ENDNOTE_TITLE_SIZE +0 \}
4924 . if !d$EN_NUMBER_FT \{ .ENDNOTE_NUMBER_FONT B \}
4925 . if !d$EN_NUMBER_SIZE_CHANGE \{ .ENDNOTE_NUMBER_SIZE +0 \}
4926 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT 1.5m \}
4928 . if !r#BIB_LIST \{ .BIBLIOGRAPHY_TYPE LIST . \}
4929 . if !r#BIB_PS \{ .BIBLIOGRAPHY_PT_SIZE \\n[#DOC_PT_SIZE]u \}
4930 . if !d$BIB_STRING_FT \{ .BIBLIOGRAPHY_STRING_FONT B \}
4931 . if !d$BIB_STRING_SIZE_CHANGE \{ .BIBLIOGRAPHY_STRING_SIZE +1 \}
4932 .\" +Table of contents
4933 . if !d$TOC_FAM \{ .TOC_FAMILY \\*[$DOC_FAM] \}
4934 . if !r#TOC_PS \{ .TOC_PT_SIZE \\n[#DOC_PT_SIZE]u \}
4935 . if !r#TOC_LEAD \{ .TOC_LEAD \\n[#DOC_LEAD]u ADJUST \}
4936 . if !d$TOC_HEADER_FAM \{ .TOC_HEADER_FAMILY \\*[$TOC_FAM] \}
4937 . if !d$TOC_HEADER_SIZE_CHANGE \{ .TOC_HEADER_SIZE +4 \}
4938 . if !d$TOC_HEADER_FT \{ .TOC_HEADER_FONT B \}
4939 . if !d$TOC_TITLE_FAM \{ .TOC_TITLE_FAMILY \\*[$TOC_FAM] \}
4940 . if !d$TOC_PN_FAM \{ .TOC_PN_FAMILY \\*[$TOC_FAM] \}
4941 . if !d$TOC_HEAD_FAM \{ .TOC_HEAD_FAMILY \\*[$TOC_FAM] \}
4942 . if !d$TOC_SH_FAM \{ .TOC_SUBHEAD_FAMILY \\*[$TOC_FAM] \}
4943 . if !d$TOC_PH_FAM \{ .TOC_PARAHEAD_FAMILY \\*[$TOC_FAM] \}
4944 . if !d$TOC_TITLE_FT \{ .TOC_TITLE_FONT BI \}
4945 . if !d$TOC_PN_FT \{ .TOC_PN_FONT R \}
4946 . if !d$TOC_HEAD_FT \{ .TOC_HEAD_FONT B \}
4947 . if !d$TOC_SH_FT \{ .TOC_SUBHEAD_FONT R \}
4948 . if !d$TOC_PH_FT \{ .TOC_PARAHEAD_FONT I \}
4949 . if !d$TOC_TITLE_SIZE_CHANGE \{ .TOC_TITLE_SIZE +.5 \}
4950 . if !d$TOC_PN_SIZE_CHANGE \{ .TOC_PN_SIZE +0 \}
4951 . if !d$TOC_HEAD_SIZE_CHANGE \{ .TOC_HEAD_SIZE +.5 \}
4952 . if !d$TOC_SH_SIZE_CHANGE \{ .TOC_SUBHEAD_SIZE +0 \}
4953 . if !d$TOC_PH_SIZE_CHANGE \{ .TOC_PARAHEAD_SIZE +0 \}
4956 . if !r#ENDNOTE_REFS \{ .nr #FN_REFS 1 \}
4957 . if '\\*[$REF_FN_INDENT]'' \{\
4958 . if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS FOOTNOTE 2m \}
4959 . if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS FOOTNOTE 1.5m \}
4961 . if '\\*[$REF_EN_INDENT]'' \{\
4962 . if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS ENDNOTE 2m \}
4963 . if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS ENDNOTE 1.5m \}
4965 . if '\\*[$REF_BIB_INDENT]'' \{\
4966 . if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS BIBLIO 2m \}
4967 . if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS BIBLIO 1.5m :\}
4969 .\" Adjust doc leading for PRINTSTYLE TYPESET
4970 . if \\n[#PRINT_STYLE]=2 \{\
4971 . ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
4974 .\" This diversion is to get a value for #FN_AUTOLEAD
4977 . if \\n[#PRINT_STYLE]=1 \{\
4979 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
4980 . el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
4982 . if \\n[#PRINT_STYLE]=2 \{\
4983 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
4984 . AUTOLEAD \\n[#FN_AUTOLEAD]
4986 . nr #FN_LEAD \\n[#LEAD]
4987 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u \}
4990 . ie !\\n[#COLLATE] \{\
4991 .\" DOC_LEAD adjusted (or not) here
4993 . rr #DOC_LEAD_ADJUST_OFF
4994 .\" Endnote, bibliography and toc leading
4995 . nr #OK_PROCESS_LEAD 1
4996 . nr #RESTORE_DOC_LEAD \\n(.v
4997 . nr #RESTORE_B_MARGIN \\n[#B_MARGIN]
4998 . if \\n[#PRINT_STYLE]=1 \{\
4999 . ie \\n[#SINGLE_SPACE] \{\
5000 . ENDNOTE_LEAD 12 ADJUST
5001 . BIBLIOGRAPHY_LEAD 12 ADJUST
5004 . ie \\n[#EN_SINGLESPACE] \{ .ENDNOTE_LEAD 12 ADJUST \}
5005 . el \{ .ENDNOTE_LEAD 24 ADJUST \}
5006 . ie \\n[#BIB_SINGLESPACE] \{ .BIBLIOGRAPHY_LEAD 12 ADJUST \}
5007 . el \{ .BIBLIOGRAPHY_LEAD 24 ADJUST \}
5010 . if \\n[#PRINT_STYLE]=2 \{\
5011 . ie !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
5012 . el \{ .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] \}
5013 . ie !d$BIB_LEAD \{ .BIBLIOGRAPHY_LEAD 14 ADJUST \}
5014 . el \{ .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD] \}
5015 . ie !d$TOC_LEAD \{ .TOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
5016 . el \{ .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] \}
5017 . rm $ADJUST_EN_LEAD
5018 . rm $ADJUST_BIB_LEAD
5019 . rm $ADJUST_TOC_LEAD
5021 . ie !d$BIB_SPACE \{ .BIBLIOGRAPHY_SPACING 1v \}
5023 . if \\n[#DEFER_BIB_SPACING]=1 \{\
5024 . BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE]
5025 . rr #DEFER_BIB_SPACING
5028 . DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
5029 . nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
5032 . if \\n[#COLLATE] \{\
5033 . if !\\n[#PRINT_STYLE]=1 \{\
5034 . if \\n[#RERUN_TRAPS] \{ .TRAPS \}
5038 . if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
5041 \# ====================================================================
5043 \# +++START THE DOCUMENT+++
5050 \# Reads in default document style parameters and any parameter
5051 \# the user has changed before issuing START.
5052 \# Using the information gathered in the opening macros,
5053 \# prints appropriate title (or chapter #), subtitle, author
5054 \# and document type (if appropriate).
5056 \# The .PRINT \& (zero-width character) is required to get the
5057 \# subsequent .sp request to work as advertised.
5059 \# The overall document line length, family, and point-size
5060 \# are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
5061 \# use in the HEADER and FOOTER macros.
5063 \# First, define some strings for point sizes
5066 .ds $DOC_COVER_AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_AUTHOR_SIZE_CHANGE]
5067 .ds $DOC_COVER_CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE]
5068 .ds $DOC_COVER_COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_COPYRIGHT_SIZE_CHANGE]
5069 .ds $DOC_COVER_DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_DOCTYPE_SIZE_CHANGE]
5070 .ds $DOC_COVER_SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_SUBTITLE_SIZE_CHANGE]
5071 .ds $DOC_COVER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_TITLE_SIZE_CHANGE]
5073 .ds $COVER_AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_AUTHOR_SIZE_CHANGE]
5074 .ds $COVER_CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_CHAPTER_TITLE_SIZE_CHANGE]
5075 .ds $COVER_COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_COPYRIGHT_SIZE_CHANGE]
5076 .ds $COVER_DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_DOCTYPE_SIZE_CHANGE]
5077 .ds $COVER_SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_SUBTITLE_SIZE_CHANGE]
5078 .ds $COVER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_TITLE_SIZE_CHANGE]
5080 .ds $AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
5081 .ds $CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
5082 .ds $COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COPYRIGHT_SIZE_CHANGE]
5083 .ds $DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
5084 .ds $SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
5085 .ds $TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
5087 \# Next, some utility macros for various routines to prevent repetition
5089 .MAC PRINT_AUTHORS END
5090 . nr #AUTHORS \\n[#AUTHOR_NUM]
5091 . nr #NEXT_AUTHOR 0 1
5092 . ie r#DOING_COVER \{\
5093 . if \\n[#COVER]=1 \{\
5094 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
5095 . ie \\n[#COVER_AUTHOR_COLOR]=1 \{\
5096 . PRINT \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
5098 . el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
5101 . if \\n[#DOC_COVER]=1 \{\
5102 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
5103 . ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \{\
5104 . PRINT \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
5106 . el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
5111 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
5112 . ie \\n[#AUTHOR_COLOR]=1 \{\
5113 . PRINT \m[\\*[$AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
5115 . el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
5120 .MAC DEFAULT_DOCHEADER END
5122 . FAMILY \\*[$TITLE_FAM]
5124 . PT_SIZE \\*[$TITLE_PT_SIZE]
5125 . LS \\n[#DOCHEADER_LEAD]u
5126 . ie \\n[#TITLE_COLOR]=1 \{\
5127 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$TITLE]\m[]
5129 . el \{ .PRINT \\*[$TITLE] \}
5130 . if !'\\*[$SUBTITLE]'' \{\
5131 . FAMILY \\*[$SUBTITLE_FAM]
5132 . FT \\*[$SUBTITLE_FT]
5133 . PT_SIZE \\*[$SUBTITLE_PT_SIZE]
5134 . ie \\n[#SUBTITLE_COLOR]=1 \{\
5135 . PRINT \m[\\*[$SUBTITLE_COLOR]]\\*[$TITLE]\m[]
5137 . el \{ .PRINT \\*[$SUBTITLE] \}
5139 . if !'\\*[$AUTHOR_1]'' \{\
5140 . FAMILY \\*[$AUTHOR_FAM]
5141 . FT \\*[$AUTHOR_FT]
5142 . PT_SIZE \\*[$AUTHOR_PT_SIZE]
5143 . if !'\\*[$ATTRIBUTE_STRING]'' \{\
5144 . ie \\n[#ATTRIBUTE_COLOR]=1 \{\
5145 . PRINT \m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
5147 . el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
5154 .MAC CHAPTER_DOCHEADER END
5156 . FAMILY \\*[$TITLE_FAM]
5158 . PT_SIZE \\*[$TITLE_PT_SIZE]
5159 . LS \\n[#DOCHEADER_LEAD]u
5160 .\" Chapter title only
5161 . ie '\\*[$CHAPTER]'' \{\
5162 . ie !'\\*[$CHAPTER_TITLE]'' \{\
5163 . if \\n[#PRINT_STYLE]=2 \{\
5164 . FAMILY \\*[$CHAPTER_TITLE_FAM]
5165 . FT \\*[$CHAPTER_TITLE_FT]
5166 . PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
5167 . LS \\n[#DOCHEADER_LEAD]u
5169 . ie \\n[#TITLE_COLOR]=1 \{\
5170 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5172 . el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5175 . ie \\n[#TITLE_COLOR]=1 \{\
5176 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING]\m[]
5178 . el \{ .PRINT \\*[$CHAPTER_STRING] \}
5181 .\" Chapter string, possibly with a chapter title
5183 . ie \\n[#TITLE_COLOR]=1 \{\
5184 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
5186 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
5187 . if !'\\*[$CHAPTER_TITLE]'' \{\
5188 . if \\n[#PRINT_STYLE]=1 \{ .PRINT \\*[$CHAPTER_TITLE] \}
5189 . if \\n[#PRINT_STYLE]=2 \{\
5190 . FAMILY \\*[$CHAPTER_TITLE_FAM]
5191 . FT \\*[$CHAPTER_TITLE_FT]
5192 . PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
5193 . LS \\n[#DOCHEADER_LEAD]u
5194 . ie \\n[#CHAPTER_TITLE_COLOR]=1 \{\
5195 . PRINT \m[\\*[$CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5197 . el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5198 . RLD \\n[#DOC_LEAD]u \" Just looks better this way
5205 .MAC NAMED_DOCHEADER END
5207 . FAMILY \\*[$TITLE_FAM]
5209 . PT_SIZE \\*[$TITLE_PT_SIZE]
5210 . LS \\n[#DOCHEADER_LEAD]u
5211 . ie \\n[#TITLE_COLOR]=1 \{\
5212 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$TITLE]\m[]
5214 . el \{ .PRINT \\*[$TITLE] \}
5215 . if !'\\*[$SUBTITLE]'' \{\
5216 . FAMILY \\*[$SUBTITLE_FAM]
5217 . FT \\*[$SUBTITLE_FT]
5218 . PT_SIZE \\*[$SUBTITLE_PT_SIZE]
5219 . ie \\n[#SUBTITLE_COLOR]=1 \{\
5220 . PRINT \m[\\*[$SUBTITLE_COLOR]]\\*[$TITLE]\m[]
5222 . el \{ .PRINT \\*[$SUBTITLE] \}
5224 . if !'\\*[$AUTHOR_1]'' \{\
5225 . FAMILY \\*[$AUTHOR_FAM]
5226 . FT \\*[$AUTHOR_FT]
5227 . PT_SIZE \\*[$AUTHOR_PT_SIZE]
5228 . if !'\\*[$ATTRIBUTE_STRING]'' \{\
5229 . ie \\n[#ATTRIBUTE_COLOR]=1 \{\
5230 . PRINT \m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
5232 . el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
5236 . FAMILY \\*[$DOCTYPE_FAM]
5237 . FT \\*[$DOCTYPE_FT]
5238 . PT_SIZE \\*[$DOCTYPE_PT_SIZE]
5239 . LS \\n[#DOCHEADER_LEAD]u
5240 . ALD \\n[#DOCHEADER_LEAD]u
5241 . ie \\n[#DOCTYPE_COLOR]=1 \{\
5242 . COLOR \\*[$DOCTYPE_COLOR]
5243 . UNDERSCORE "\\*[$DOC_TYPE]
5245 . el .UNDERSCORE "\\*[$DOC_TYPE]
5252 \# TITLE | DOCTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE | COVERTITLE ...
5253 \# ... [ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC ]
5255 \# Toggles the number register for each cover page element
5256 \# passed as an argument.
5258 \# TITLE, DOCTITLE, CHAPTER, CHAPTER_TITLE or CHAPTER+TITLE must
5259 \# be supplied. After that, users may enter as many or as few of
5260 \# the arguments as they like; however, the arguments must appear
5261 \# in the order given above.
5263 \# If called as DOC_COVER, performs the same operations, but
5264 \# applies everything to a doc cover.
5267 . ie '\\$0'DOC_COVER' \{\
5269 . if '\\$1'TITLE' \{ .nr #DOC_COVER_TITLE 1 \}
5270 . if '\\$1'DOCTITLE' \{ .nr #DOC_COVER_TITLE 2 \}
5271 . if '\\$1'CHAPTER' \{ .nr #DOC_COVER_TITLE 3 \}
5272 . if '\\$1'CHAPTER_TITLE' \{ .nr #DOC_COVER_TITLE 4 \}
5273 . if '\\$1'CHAPTER+TITLE' \{ .nr #DOC_COVER_TITLE 5 \}
5274 . if '\\$1'COVERTITLE' \{ .nr #DOC_COVER_TITLE 6 \}
5275 . if '\\$2'SUBTITLE' \{ .nr #DOC_COVER_SUBTITLE 1 \}
5276 . if '\\$2'AUTHOR' \{ .nr #DOC_COVER_AUTHOR 1 \}
5277 . if '\\$2'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
5278 . if '\\$2'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
5279 . if '\\$2'MISC' \{ .nr #DOC_COVER_MISC 1 \}
5280 . if '\\$3'AUTHOR' \{ .nr #DOC_COVER_AUTHOR 1 \}
5281 . if '\\$3'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
5282 . if '\\$3'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
5283 . if '\\$3'MISC' \{ .nr #DOC_COVER_MISC 1 \}
5284 . if '\\$4'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
5285 . if '\\$4'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
5286 . if '\\$4'MISC' \{ .nr #DOC_COVER_MISC 1 \}
5287 . if '\\$5'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
5288 . if '\\$5'MISC' \{ .nr #DOC_COVER_MISC 1 \}
5289 . if '\\$6'MISC' \{ .nr #DOC_COVER_MISC 1 \}
5293 . if '\\$1'TITLE' \{ .nr #COVER_TITLE 1 \}
5294 . if '\\$1'DOCTITLE' \{ .nr #COVER_TITLE 2 \}
5295 . if '\\$1'CHAPTER' \{ .nr #COVER_TITLE 3 \}
5296 . if '\\$1'CHAPTER_TITLE' \{ .nr #COVER_TITLE 4 \}
5297 . if '\\$1'CHAPTER+TITLE' \{ .nr #COVER_TITLE 5 \}
5298 . if '\\$1'COVERTITLE' \{ .nr #COVER_TITLE 6 \}
5299 . if '\\$2'SUBTITLE' \{ .nr #COVER_SUBTITLE 1 \}
5300 . if '\\$2'AUTHOR' \{ .nr #COVER_AUTHOR 1 \}
5301 . if '\\$2'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
5302 . if '\\$2'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
5303 . if '\\$2'MISC' \{ .nr #COVER_MISC 1 \}
5304 . if '\\$3'AUTHOR' \{ .nr #COVER_AUTHOR 1 \}
5305 . if '\\$3'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
5306 . if '\\$3'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
5307 . if '\\$3'MISC' \{ .nr #COVER_MISC 1 \}
5308 . if '\\$4'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
5309 . if '\\$4'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
5310 . if '\\$4'MISC' \{ .nr #COVER_MISC 1 \}
5311 . if '\\$5'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
5312 . if '\\$5'MISC' \{ .nr #COVER_MISC 1 \}
5313 . if '\\$6'MISC' \{ .nr #COVER_MISC 1 \}
5319 . ie '\\$0'DOC_COVERTITLE' .ds $DOC_COVER_TITLE \\$1
5320 . el .ds $COVER_TITLE \\$1
5324 \# COVER PAGE LEADING
5325 \# ------------------
5327 \# <+|- amount by which to in/decrease leading of cover/doc cover>
5329 \# Stores user supplied lead in/decrease in string $COVER_LEAD_ADJ
5330 \# or $DOC_COVER_LEAD_ADJ, depending on whether the macro was called
5331 \# with an alias (DOC_COVER_LEAD).
5333 \# A unit of measure must be supplied. Decimal fractions OK.
5334 \# Default is +0, i.e. same as DOC_LEAD.
5337 . ie '\\$0'DOC_COVER_LEAD' \{\
5338 . ds $DOC_COVER_LEAD_ADJ \\$1
5341 . ds $COVER_LEAD_ADJ \\$1
5346 \# COVER PAGE START POSITION
5347 \# -------------------------
5349 \# <distance from page top at which to start cover/doc cover>
5351 \# Stores user supplied lead in/decrease in #COVER_START_POS
5352 \# or #DOC_COVER_START_POS, depending on whether the macro was
5353 \# called by an alias (DOC_COVER_ADVANCE).
5355 \# A unit of measure must be supplied. Decimal fractions OK.
5356 \# If user doesn't invoke this macro, the default starting
5357 \# position for both covers and doc covers is 1/3 of the way
5358 \# down the page (setup in DO_COVER).
5360 .MAC COVER_ADVANCE END
5361 . ie '\\$0'DOC_COVER_ADVANCE' \{\
5362 . nr #DOC_COVER_START_POS (\\$1)
5365 . nr #COVER_START_POS (\\$1)
5370 \# COVERS - WHETHER TO PRINT
5371 \# -------------------------
5373 \# <none> | <anything>
5375 \# Creates or removes registers #COVERS and #COVERS_OFF, checked for
5376 \# in DEFAULTS (in START) prior to printing
5379 . ie '\\$0'DOC_COVERS' \{\
5381 . rr #DOC_COVERS_OFF
5386 . nr #DOC_COVERS_OFF 1
5407 . if \\n[#PAGINATE]=1 \{\
5408 . nr #PAGINATION_WAS_ON 1
5411 . if \\n[#HEADERS_ON]=1 \{\
5412 . nr #HEADERS_WERE_ON 1
5415 . if \\n[#FOOTERS_ON]=1 \{\
5416 . nr #FOOTERS_WERE_ON 1
5419 . if \\n[#COLUMNS]=1 \{\
5420 . nr #COLUMNS_WERE_ON 1
5424 . ie '\\$0'DO_DOC_COVER' \{\
5425 . if !r#DOC_COVER_START_POS \{\
5426 . nr #DOC_COVER_START_POS \\n[#PAGE_LENGTH]/3
5428 . if \\n[#PRINT_STYLE]=1 \{\
5429 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
5430 . el \{ .vs \\n[#DOC_LEAD]u \}
5432 . if \\n[#PRINT_STYLE]=2 \{\
5433 . LS \\n[#DOC_LEAD]u\\*[$DOC_COVER_LEAD_ADJ]
5434 . nr #DOC_COVER_LEAD \\n[#LEAD]
5437 . sp |\\n[#DOC_COVER_START_POS]u-1v
5438 . if \\n[#DOC_COVER_COLOR]=1 \{\
5440 \m[\\*[$DOC_COVER_COLOR]]
5444 . FAMILY \\*[$DOC_COVER_TITLE_FAM]
5445 . FT \\*[$DOC_COVER_TITLE_FT]
5446 . PT_SIZE \\*[$DOC_COVER_TITLE_PT_SIZE]
5447 . LS \\n[#DOC_COVER_LEAD]u
5448 . if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
5449 . if \\n[#DOC_COVER_TITLE]=1 \{\
5450 . ie \\n[#PRINT_STYLE]=1 \{\
5452 . UNDERSCORE "\\*[$TITLE]"
5456 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5457 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$TITLE]\m[]
5459 . el \{ .PRINT \\*[$TITLE] \}
5462 . if \\n[#DOC_COVER_TITLE]=2 \{\
5463 . ie \\n[#PRINT_STYLE]=1 \{\
5465 . UNDERSCORE "\\*[$DOC_TITLE]"
5469 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5470 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_TITLE]\m[]
5472 . el \{ .PRINT \\*[$DOC_TITLE] \}
5475 . if \\n[#DOC_COVER_TITLE]=3 \{\
5476 . ie \\n[#PRINT_STYLE]=1 \{\
5478 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
5482 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5483 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
5485 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
5488 . if \\n[#DOC_COVER_TITLE]=4 \{\
5489 . ie \\n[#PRINT_STYLE]=1 \{\
5491 . UNDERSCORE "\\*[$CHAPTER_TITLE]"
5495 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5496 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5498 . el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5501 . if \\n[#DOC_COVER_TITLE]=5 \{\
5502 . ie \\n[#PRINT_STYLE]=1 \{\
5504 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
5508 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5509 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
5511 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
5513 . if !'\\*[$CHAPTER_TITLE]'' \{\
5514 . ie \\n[#PRINT_STYLE]=1 \{\
5515 . UNDERSCORE "\\*[$CHAPTER_TITLE]"
5518 . FAMILY \\*[$DOC_COVER_CHAPTER_TITLE_FAM]
5519 . FT \\*[$DOC_COVER_CHAPTER_TITLE_FT]
5520 . PT_SIZE \\*[$DOC_COVER_CHAPTER_TITLE_PT_SIZE]
5521 . ie \\n[#DOC_COVER_CHAPTER_TITLE_COLOR]=1 \{\
5522 . PRINT \m[\\*[$DOC_COVER_CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5524 . el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5528 . if \\n[#DOC_COVER_TITLE]=6 \{\
5529 . ie \\n[#PRINT_STYLE]=1 \{\
5531 . UNDERSCORE "\\*[$DOC_COVER_TITLE]"
5535 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
5536 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_COVER_TITLE]\m[]
5538 . el \{ .PRINT \\*[$DOC_COVER_TITLE] \}
5541 . if \\n[#DOC_COVER_SUBTITLE]=1 \{\
5542 . FAMILY \\*[$DOC_COVER_SUBTITLE_FAM]
5543 . FT \\*[$DOC_COVER_SUBTITLE_FT]
5544 . PT_SIZE \\*[$DOC_COVER_SUBTITLE_PT_SIZE]
5545 . if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
5546 . ie \\n[#DOC_COVER_SUBTITLE_COLOR]=1 \{\
5547 . PRINT \m[\\*[$DOC_COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE]\m[]
5549 . el \{ .PRINT \\*[$SUBTITLE] \}
5551 . if \\n[#PRINT_STYLE]=1 \{\
5552 . if !r#DOC_COVER_SUBTITLE \{ .SP \}
5554 . if \\n[#DOC_COVER_AUTHOR]=1 \{\
5555 . FAMILY \\*[$DOC_COVER_AUTHOR_FAM]
5556 . FT \\*[$DOC_COVER_AUTHOR_FT]
5557 . PT_SIZE \\*[$DOC_COVER_AUTHOR_PT_SIZE]
5558 . if \\n[#PRINT_STYLE]=1 \{\
5560 . vs \\n[#DOC_LEAD]u/2u
5562 . if !'\\*[$ATTRIBUTE_STRING]'' \{\
5563 . ie \\n[#DOC_COVER_ATTRIBUTE_COLOR]=1 \{\
5564 . PRINT \m[\\*[$DOC_COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
5566 . el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
5570 . FAMILY \\*[$DOC_COVER_DOCTYPE_FAM]
5571 . FT \\*[$DOC_COVER_DOCTYPE_FT]
5572 . PT_SIZE \\*[$DOC_COVER_DOCTYPE_PT_SIZE]
5574 . if \\n[#DOC_COVER_DOCTYPE]=1 \{\
5575 . ie \\n[#PRINT_STYLE]=1 \{\
5577 . vs \\n[#DOC_LEAD]u
5578 . UNDERSCORE2 "\\*[$DOC_TYPE]
5581 . ie \\n[#DOC_COVER_DOCTYPE_COLOR]=1 \{\
5582 . COLOR \\*[$DOC_COVER_DOCTYPE_COLOR]
5583 . UNDERSCORE "\\*[$DOC_TYPE]
5585 . el .UNDERSCORE "\\*[$DOC_TYPE]
5588 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
5589 . ie \\n[#PRINT_STYLE]=1 \{\
5591 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
5592 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
5595 . FAMILY \\*[$DOC_COVER_COPYRIGHT_FAM]
5596 . FT \\*[$DOC_COVER_COPYRIGHT_FT]
5598 . PT_SIZE \\*[$DOC_COVER_COPYRIGHT_PT_SIZE]
5600 . if \\n[#DOC_COVER_COPYRIGHT]=1 \{\
5601 . QUAD \\*[$DOC_COVER_COPYRIGHT_QUAD]
5602 . ie \\n[#DOC_COVER_COPYRIGHT_COLOR]=1 \{\
5603 . PRINT \m[\\*[$DOC_COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
5605 . el \{ .PRINT \\*[$COPYRIGHT] \}
5607 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
5608 . if \\n[#DOC_COVER_MISC]=1 \{\
5609 . QUAD \\*[$DOC_COVER_MISC_QUAD]
5610 . nr #MISCS \\n[#MISC_NUM]
5613 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
5614 . ie \\n[#DOC_COVER_MISC_COLOR]=1 \{\
5615 . PRINT \m[\\*[$DOC_COVER_MISC_COLOR]]\\*[$MISC_\\n+[#NEXT_MISC]]\m[]
5619 . PRINT \\*[$MISC_\\n+[#NEXT_MISC]]
5627 . if !r#COVER_START_POS \{\
5628 . nr #COVER_START_POS \\n[#PAGE_LENGTH]/3
5630 . if \\n[#PRINT_STYLE]=1 \{\
5631 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
5632 . el \{ .vs \\n[#DOC_LEAD]u \}
5634 . if \\n[#PRINT_STYLE]=2 \{\
5635 . LS \\n[#DOC_LEAD]u\\*[$COVER_LEAD_ADJ]
5636 . nr #COVER_LEAD \\n[#LEAD]
5639 . sp |\\n[#COVER_START_POS]u-1v
5640 . if \\n[#COVER_COLOR]=1 \{\
5642 \m[\\*[$COVER_COLOR]]
5646 . FAMILY \\*[$COVER_TITLE_FAM]
5647 . FT \\*[$COVER_TITLE_FT]
5648 . PT_SIZE \\*[$COVER_TITLE_PT_SIZE]
5649 . LS \\n[#COVER_LEAD]u
5650 . if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
5651 . if \\n[#COVER_TITLE]=1 \{\
5652 . ie \\n[#PRINT_STYLE]=1 \{\
5654 . UNDERSCORE "\\*[$TITLE]"
5658 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
5659 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$TITLE]\m[]
5661 . el \{ .PRINT \\*[$TITLE] \}
5664 . if \\n[#COVER_TITLE]=2 \{\
5665 . ie \\n[#PRINT_STYLE]=1 \{\
5667 . UNDERSCORE "\\*[$DOC_TITLE]"
5671 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
5672 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$DOC_TITLE]\m[]
5674 . el \{ .PRINT \\*[$DOC_TITLE] \}
5677 . if \\n[#COVER_TITLE]=3 \{\
5678 . ie \\n[#PRINT_STYLE]=1 \{\
5680 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
5684 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
5685 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
5687 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
5690 . if \\n[#COVER_TITLE]=4 \{\
5691 . ie \\n[#PRINT_STYLE]=1 \{\
5693 . UNDERSCORE "\\*[$CHAPTER_TITLE]"
5697 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
5698 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5700 . el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5703 . if \\n[#COVER_TITLE]=5 \{\
5704 . ie \\n[#PRINT_STYLE]=1 \{\
5706 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
5710 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
5711 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
5713 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
5715 . if !'\\*[$CHAPTER_TITLE]'' \{\
5716 . ie \\n[#PRINT_STYLE]=1 \{\
5717 . UNDERSCORE "\\*[$CHAPTER_TITLE]"
5720 . FAMILY \\*[$COVER_CHAPTER_TITLE_FAM]
5721 . FT \\*[$COVER_CHAPTER_TITLE_FT]
5722 . PT_SIZE \\*[$COVER_CHAPTER_TITLE_PT_SIZE]
5723 . ie \\n[#COVER_CHAPTER_TITLE_COLOR]=1 \{\
5724 . PRINT \m[\\*[$COVER_CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
5726 . el \{ .PRINT \\*[$CHAPTER_TITLE] \}
5730 . if \\n[#COVER_TITLE]=6 \{\
5731 . ie \\n[#PRINT_STYLE]=1 \{\
5733 . UNDERSCORE "\\*[$COVER_TITLE]"
5737 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
5738 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$COVER_TITLE]\m[]
5740 . el \{ .PRINT \\*[$COVER_TITLE] \}
5743 . if \\n[#COVER_SUBTITLE]=1 \{\
5744 . FAMILY \\*[$COVER_SUBTITLE_FAM]
5745 . FT \\*[$COVER_SUBTITLE_FT]
5746 . PT_SIZE \\*[$COVER_SUBTITLE_PT_SIZE]
5747 . if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
5748 . ie \\n[#COVER_SUBTITLE_COLOR]=1 \{\
5749 . PRINT \m[\\*[$COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE]\m[]
5751 . el \{ .PRINT \\*[$SUBTITLE] \}
5753 . if \\n[#PRINT_STYLE]=1 \{\
5754 . if !r#COVER_SUBTITLE \{ .SP \}
5756 . if \\n[#COVER_AUTHOR]=1 \{\
5757 . FAMILY \\*[$COVER_AUTHOR_FAM]
5758 . FT \\*[$COVER_AUTHOR_FT]
5759 . PT_SIZE \\*[$COVER_AUTHOR_PT_SIZE]
5760 . if \\n[#PRINT_STYLE]=1 \{\
5762 . vs \\n[#DOC_LEAD]u/2u
5764 . if !'\\*[$ATTRIBUTE_STRING]'' \{\
5765 . ie \\n[#COVER_ATTRIBUTE_COLOR]=1 \{\
5766 . PRINT \m[\\*[$COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
5768 . el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
5772 . FAMILY \\*[$COVER_DOCTYPE_FAM]
5773 . FT \\*[$COVER_DOCTYPE_FT]
5774 . PT_SIZE \\*[$COVER_DOCTYPE_PT_SIZE]
5776 . if \\n[#COVER_DOCTYPE]=1 \{\
5777 . ie \\n[#PRINT_STYLE]=1 \{\
5779 . vs \\n[#DOC_LEAD]u
5780 . UNDERSCORE2 "\\*[$DOC_TYPE]
5783 . ie \\n[#COVER_DOCTYPE_COLOR]=1 \{\
5784 . COLOR \\*[$COVER_DOCTYPE_COLOR]
5785 . UNDERSCORE "\\*[$DOC_TYPE]
5787 . el .UNDERSCORE "\\*[$DOC_TYPE]
5790 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
5791 . ie \\n[#PRINT_STYLE]=1 \{\
5793 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
5794 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
5797 . FAMILY \\*[$COVER_COPYRIGHT_FAM]
5798 . FT \\*[$COVER_COPYRIGHT_FT]
5800 . PT_SIZE \\*[$COVER_COPYRIGHT_PT_SIZE]
5802 . if \\n[#COVER_COPYRIGHT]=1 \{\
5803 . QUAD \\*[$COVER_COPYRIGHT_QUAD]
5804 . ie \\n[#COVER_COPYRIGHT_COLOR]=1 \{\
5805 . PRINT \m[\\*[$COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
5807 . el \{ .PRINT \\*[$COPYRIGHT] \}
5809 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
5810 . if \\n[#COVER_MISC]=1 \{\
5811 . QUAD \\*[$COVER_MISC_QUAD]
5812 . nr #MISCS \\n[#MISC_NUM]
5815 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
5816 . ie \\n[#COVER_MISC_COLOR]=1 \{\
5817 . PRINT \m[\\*[$COVER_MISC_COLOR]]\\*[$MISC_\\n+[#NEXT_MISC]]\m[]
5821 . PRINT \\*[$MISC_\\n+[#NEXT_MISC]]
5831 . if \\n[#PAGINATION_WAS_ON] \{\
5832 . rr #PAGINATION_WAS_ON
5834 . PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]-1
5836 . if \\n[#HEADERS_WERE_ON] \{\
5837 . rr #HEADERS_WERE_ON
5840 . if \\n[#FOOTERS_WERE_ON] \{\
5841 . rr #FOOTERS_WERE_ON
5844 . if \\n[#COLUMNS_WERE_ON]=1 \{\
5845 . rr #COLUMNS_WERE_ON 1
5853 . if !\\n[#PRINT_STYLE] \{\
5854 . PRINTSTYLE TYPEWRITE
5861 . PRINT "You neglected to enter a PRINTSTYLE"
5863 . ab PRINTSTYLE missing
5866 . if \\n[#LINENUMBERS]=1 \{\
5870 . if \\n[#COLLATE] \{\
5871 . COPYSTYLE \\*[$COPY_STYLE]
5872 . nr #HEADERS_ON \\n[#HEADER_STATE]
5873 . if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
5874 . sp |\\n[#HEADER_MARGIN]u
5876 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
5877 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
5878 . rm $RESTORE_PAGENUM_STYLE
5882 .\" Quote and blockquote default leads are the same as #DOC_LEAD, so
5883 .\" they have to be set after DEFAULTS (where DOC_LEAD is finalized)
5884 . if !r#Q_AUTOLEAD \{ .nr #Q_LEAD \\n[#DOC_LEAD] \}
5885 . if !r#BQ_AUTOLEAD \{ .nr #BQ_LEAD \\n[#DOC_LEAD] \}
5886 . if !r#EN_Q_AUTOLEAD \{ .nr #EN_Q_LEAD \\n[#EN_LEAD] \}
5887 . if !r#EN_BQ_AUTOLEAD \{ .nr #EN_BQ_LEAD \\n[#EN_LEAD] \}
5888 .\" Covers and doc covers
5889 . if \\n[#DOC_COVERS]=1 \{\
5890 . if \\n[#DOC_COVER]=1 \{\
5893 . rr #DOC_COVER_TITLE
5894 . rr #DOC_COVER_SUBTITLE
5895 . rr #DOC_COVER_AUTHOR
5896 . rr #DOC_COVER_DOCTYPE
5897 . rr #DOC_COVER_COPYRIGHT
5898 . rr #DOC_COVER_MISC
5901 . if \\n[#COVERS]=1 \{\
5902 . if \\n[#COVER]=1 \{\
5906 . rr #COVER_SUBTITLE
5909 . rr #COVER_COPYRIGHT
5913 .\" Collate related stuff
5914 . ie \\n[#COLLATED_DOC]=1 \{\
5915 .\" Collect TITLE for TOC.
5916 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
5917 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
5918 . ie \\n[#USER_SET_TITLE_ITEM] \{\
5919 . ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]\\|
5920 . rr #USER_SET_TITLE_ITEM
5921 . rm $USER_SET_TITLE_ITEM
5924 . ie \\n[#DOC_TYPE]=2 \{\
5925 . ie '\\*[$CHAPTER_TITLE]'' \{\
5926 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
5929 . ie '\\*[$CHAPTER]'' \{\
5930 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]\\|
5933 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
5938 . ds $TOC_TITLE_ITEM \\*[$TITLE]\\|
5941 . if \\n[#TOC_AUTHORS]=1 \{\
5942 . ie '\\*[$TOC_AUTHORS]'' \{\
5943 . as $TOC_TITLE_ITEM /\\|\\*[$AUTHOR_1]\\|
5946 . as $TOC_TITLE_ITEM /\\|\\*[$TOC_AUTHORS]\\|
5950 .\" Note the use of \!, which transparently embeds the macros used
5951 .\" in the TOC_ENTRIES diversion. The elements they control must be
5952 .\" processed literally when the diversion is output.
5955 . if \\n[#PRINT_STYLE]=1 \{\
5960 . if \\n[#PRINT_STYLE]=2 \{\
5961 \!. FAMILY \\*[$TOC_TITLE_FAM]
5962 \!. FT \\*[$TOC_TITLE_FT]
5963 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
5966 . ie \\n[#PRINT_STYLE]=1 \{\
5967 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
5970 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
5975 . if \\n[#PRINT_STYLE]=2 \{\
5976 \!. FAMILY \\*[$TOC_PN_FAM]
5977 \!. FT \\*[$TOC_PN_FT]
5978 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
5981 \!. PRINT \\*[LEADER]
5984 \!. PRINT \\n[#TOC_ENTRY_PN]
5990 . nr #FIRST_DOC_TITLE_PN \\n%+\\n[#PAGE_NUM_ADJ]
5991 . af #FIRST_DOC_TITLE_PN \\g[#PAGENUMBER]
5992 . nr #FIRST_DOC_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
5994 .\" End TITLE collection
5995 . if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
5996 . sp |\\n[#HEADER_MARGIN]u
6000 . rr #PAGINATION_STATE
6001 .\" End collate stuff
6002 . ie \\n[#DOC_HEADER]=0 \{\
6004 . if \\n[#DOC_TYPE]=4 \{\
6005 . if !'\\n(.z'' \{ .di \}
6007 . nr #STORED_PP_INDENT \\n[#PP_INDENT]
6010 . PARA_INDENT \\n[#STORED_PP_INDENT]u
6011 . rr #STORED_PP_INDENT
6012 . ie r#ADVANCE_FROM_TOP \{\
6013 . sp |\\n[#ADVANCE_FROM_TOP]u-1v
6014 . if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
6016 . el \{ .sp |\\n[#T_MARGIN]u-1v \}
6017 . if \\n[#COLUMNS] \{\
6020 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6021 . nr #L_MARGIN \\n(.o
6022 . ll \\n[#COL_L_LENGTH]u
6026 . if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \}
6029 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ] \}
6030 . nr #DOCHEADER_LEAD \\n[#LEAD]
6032 . if \\n[#DOC_TYPE]=1 \{\
6034 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
6036 . if \\n[#DOCHEADER_COLOR]=1 \{\
6038 \m[\\*[$DOCHEADER_COLOR]]
6041 . L_MARGIN \\n[#DOC_L_MARGIN]u
6042 . LL \\n[#DOC_L_LENGTH]u
6044 . if \\n[#PRINT_STYLE]=1 \{\
6047 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
6048 . el \{ .vs \\n[#DOC_LEAD]u \}
6050 . if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
6052 . if !'\\*[$SUBTITLE]'' \{\
6053 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
6054 . el \{ .vs \\n[#DOC_LEAD]u \}
6055 . PRINT \\*[$SUBTITLE]
6057 . if '\\*[$SUBTITLE]'' \{\
6058 . ALD \\n[#DOC_LEAD]u
6060 . ie !'\\*[$AUTHOR_1]'' \{\
6061 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
6062 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
6063 . if !d$SUBTITLE \{\
6064 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6065 . el \{ .ALD \\n[#DOC_LEAD]u*2u \}
6067 . PRINT \\*[$ATTRIBUTE_STRING]
6068 . nr #AUTHORS \\n[#AUTHOR_NUM]
6069 . nr #NEXT_AUTHOR 0 1
6070 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6071 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
6073 . if \\n[#AUTHOR_LINES]=1 \{\
6074 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
6075 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
6079 . ie !d$SUBTITLE \{\
6080 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
6081 . el \{ .RLD \\n[#DOC_LEAD]u \}
6084 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
6085 . el \{ .ALD \\n[#DOC_LEAD]u \}
6089 . if \\n[#PRINT_STYLE]=2 \{\
6091 . di DOCHEADER_DIVERSION \" This diversion is only
6092 . br \" necessary to find the depth of the
6093 . DEFAULT_DOCHEADER \" docheader
6096 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
6097 . \"in #DOCHEADER_DEPTH
6098 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
6103 . if \\n[#DOC_TYPE]=2 \{\
6105 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
6107 . if \\n[#DOCHEADER_COLOR]=1 \{\
6109 \m[\\*[$DOCHEADER_COLOR]]
6112 . L_MARGIN \\n[#DOC_L_MARGIN]u
6113 . LL \\n[#DOC_L_LENGTH]u
6115 . if \\n[#PRINT_STYLE]=1 \{\
6118 . vs \\n[#DOC_LEAD]u
6119 . ie '\\*[$CHAPTER]'' \{\
6121 . ie !'\\*[$CHAPTER_TITLE]'' \{\
6122 . PRINT \\*[$CHAPTER_TITLE]
6126 . PRINT \\*[$CHAPTER_STRING]
6132 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6134 . if !'\\*[$CHAPTER_TITLE]'' \{\
6135 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6136 . UNDERSCORE "\\*[$CHAPTER_TITLE]
6139 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6141 . if \\n[#PRINT_STYLE]=2 \{\
6143 . di DOCHEADER_DIVERSION \" This diversion is only
6144 . br \" necessary to find the depth of the
6145 . CHAPTER_DOCHEADER \" docheader
6148 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
6149 . \" in #DOCHEADER_DEPTH
6150 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
6155 . if \\n[#DOC_TYPE]=3 \{\
6157 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
6159 . if \\n[#DOCHEADER_COLOR]=1 \{\
6161 \m[\\*[$DOCHEADER_COLOR]]
6164 . L_MARGIN \\n[#DOC_L_MARGIN]u
6165 . LL \\n[#DOC_L_LENGTH]u
6167 . if \\n[#PRINT_STYLE]=1 \{\
6170 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
6171 . el \{ .vs \\n[#DOC_LEAD]u \}
6173 . if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
6175 . if !'\\*[$SUBTITLE]'' \{\
6176 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
6177 . el \{ .vs \\n[#DOC_LEAD]u \}
6178 . PRINT \\*[$SUBTITLE]
6180 . if '\\*[$SUBTITLE]'' \{\
6181 . ALD \\n[#DOC_LEAD]u
6183 . ie !'\\*[$AUTHOR_1]'' \{\
6184 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
6185 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
6186 . if !d$SUBTITLE \{\
6187 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6188 . el \{ .ALD \\n[#DOC_LEAD]u*2u \}
6190 . PRINT \\*[$ATTRIBUTE_STRING]
6191 . nr #AUTHORS \\n[#AUTHOR_NUM]
6192 . nr #NEXT_AUTHOR 0 1
6193 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6194 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
6196 . if \\n[#AUTHOR_LINES]=1 \{\
6197 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
6198 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
6200 . vs \\n[#DOC_LEAD]u
6203 . ie !d$SUBTITLE \{\
6204 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
6205 . el \{ .RLD \\n[#DOC_LEAD]u \}
6208 . ie \\n[#SINGLE_SPACE] \{ . \}
6209 . el \{ .RLD \\n[#DOC_LEAD]u \}
6212 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
6213 . el \{ .ALD \\n[#DOC_LEAD]u \}
6214 . UNDERSCORE2 "\\*[$DOC_TYPE]
6215 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6217 . if \\n[#PRINT_STYLE]=2 \{\
6219 . di DOCHEADER_DIVERSION \" This diversion is only
6220 . br \" necessary to find the depth of the
6221 . NAMED_DOCHEADER \" docheader
6224 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
6225 . \"in #DOCHEADER_DEPTH
6226 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
6230 . if !\\n[#DOC_TYPE]=4 \{\
6231 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
6232 . nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD]
6233 . ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]-\\n[#DOCHEADER_SPACE_ADJ] \}
6234 . el \{ .nr #DOCHEADER_EXTRA_SPACE 0 \}
6235 . if \\n[#PRINT_STYLE]=2 \{ .ALD (\\n[#DOC_LEAD]u*2u)+\\n[#DOCHEADER_EXTRA_SPACE]u \}
6236 . if \\n[#COLUMNS] \{\
6238 . nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
6239 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6240 . nr #L_MARGIN \\n(.o
6241 . LL \\n[#COL_L_LENGTH]u
6247 . LS \\n[#DOC_LEAD]u
6248 . if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
6249 . QUAD \\*[$DOC_QUAD]
6251 . nr #START_FOR_FOOTERS 1
6252 . if \\n[#COLLATED_DOC]=1 \{\
6253 . if !\\n[MNinit_DEFERRED]=1 \{\
6257 . if \\n[#MNinit_DEFERRED]=1 \{\
6258 . rr #MNinit_DEFERRED
6259 . nr #START_FOR_MNinit 1
6260 . MN_INIT \\*[$MN-arg1] \\*[$MN-arg2] \\*[$MN-arg3] \\*[$MN-arg4] \\*[$MN-arg5] \\*[$MN-arg6] \\*[$MN-arg7] \\*[$MN-arg8] \\*[$MN-arg9]
6262 . nr #START_FOR_MNinit 2
6263 . if !\\n[#DOC_TYPE]=4 \{ .em TERMINATE \}
6264 . if \\n[#LINENUMBERS]=2 \{\
6265 . NUMBER_LINES RESUME
6268 . if \\n[#RUN_ON]=1 \{\
6269 . if \\n[#FN_MARKER_STYLE]=1 \{ .RUNON_WARNING \}
6270 . if \\n[#FN_MARKER_STYLE]=2 \{ .RUNON_WARNING \}
6274 .MAC CLEANUP_DEFAULTS END
6276 .\" Family strings for docheader
6278 . rm $CHAPTER_TITLE_FAM
6282 .\" Family strings for cover
6283 . rm $COVER_AUTHOR_FAM
6284 . rm $COVER_CHAPTER_TITLE_FAM
6285 . rm $COVER_COPYRIGHT_FAM
6286 . rm $COVER_DOCTYPE_FAM
6287 . rm $COVER_LEAD_ADJ
6288 . rm $COVER_SUBTITLE_FAM
6289 . rm $COVER_TITLE_FAM
6290 .\" Family strings for doc cover
6291 . rm $DOC_COVER_AUTHOR_FAM
6292 . rm $DOC_COVER_CHAPTER_TITLE_FAM
6293 . rm $DOC_COVER_COPYRIGHT_FAM
6294 . rm $DOC_COVER_DOCTYPE_FAM
6295 . rm $DOC_COVER_LEAD_ADJ
6296 . rm $DOC_COVER_SUBTITLE_FAM
6297 . rm $DOC_COVER_TITLE_FAM
6298 .\" Quad args to copyright and misc
6299 . rm $COVER_COPYRIGHT_QUAD
6300 . rm $COVER_MISC_QUAD
6301 . rm $DOC_COVER_COPYRIGHT_QUAD
6302 . rm $DOC_COVER_MISC_QUAD
6303 .\" Miscellaneous strings
6304 . rm $TOC_TITLE_ITEM
6305 . rm $DOCHEADER_LEAD_ADJ
6306 .\" Various registers
6308 . rr #ADVANCE_FROM_TOP
6314 . rr #DOC_COVER_LEAD
6315 . rr #DOCHEADER_ADVANCE
6316 . rr #DOCHEADER_EXTRA_SPACE
6317 . rr #DOCHEADER_LEAD
6318 . rr #DOCHEADER_SPACE_ADJ
6326 \# ====================================================================
6328 \# +++MACROS TO CHANGE SOME DEFAULTS+++
6333 \# <none> | <anything> [distance to advance from top of page]
6335 \# Turns printing of document header on or off. If a second argument
6336 \# in units of measure is given, advances that distance from the
6337 \# top of the page without printing the document header.
6339 \# Default is on. If the 1st argument is <anything> (which turns
6340 \# document headers off), the optional 2nd argument may be given
6341 \# (with a unit of measure).
6344 . ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
6346 . if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
6352 \# DOCUMENT HEADER LEADING
6353 \# -----------------------
6355 \# <+|- amount by which to in/decrease leading of doc header>
6357 \# Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
6359 \# A unit of measure must be supplied. Decimal fractions OK.
6360 \# Default is +0, i.e. same as DOC_LEAD.
6362 .MAC DOCHEADER_LEAD END
6363 . ds $DOCHEADER_LEAD_ADJ \\$1
6367 \# DOCHEADER ADVANCE
6368 \# -----------------
6370 \# <docheader start position>
6372 \# Creates register #DOCHEADER_ADVANCE, used in START.
6374 \# Unit of measure required.
6375 \# Default is same as T_MARGIN.
6377 .MAC DOCHEADER_ADVANCE END
6378 . nr #DOCHEADER_ADVANCE (\\$1)
6382 \# DOCUMENT LEFT MARGIN
6383 \# --------------------
6385 \# <left margin of document>
6387 \# Creates or modifies register #DOC_L_MARGIN.
6389 \# Affects EVERYTHING on the page.
6391 .MAC DOC_LEFT_MARGIN END
6393 . nr #DOC_L_MARGIN (\\$1)
6394 . L_MARGIN \\n[#DOC_L_MARGIN]u
6398 \# DOCUMENT RIGHT MARGIN
6399 \# ---------------------
6401 \# <right margin of document>
6403 \# Creates or modifies register #DOC_R_MARGIN.
6405 \# Affects EVERYTHING on the page.
6407 .MAC DOC_RIGHT_MARGIN END
6409 . nr #DOC_R_MARGIN (\\$1)
6410 . R_MARGIN \\n[#DOC_R_MARGIN]
6411 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
6415 \# DOCUMENT LINE LENGTH
6416 \# --------------------
6418 \# <line length of document>
6420 \# Creates or modifies string $DOC_L_LENGTH.
6422 \# Affects EVERYTHING on the page.
6424 .MAC DOC_LINE_LENGTH END
6426 . nr #DOC_L_LENGTH (\\$1)
6427 . LL \\n[#DOC_L_LENGTH]u
6435 \# <family of running text>
6437 \# Creates or modifies string $DOC_FAM.
6439 \# Affects everything EXCEPT headers and footers.
6444 . ds $FAMILY \\*[$DOC_FAM]
6445 . TITLE_FAMILY \\*[$DOC_FAM]
6446 . SUBTITLE_FAMILY \\*[$DOC_FAM]
6447 . AUTHOR_FAMILY \\*[$DOC_FAM]
6448 . DOCTYPE_FAMILY \\*[$DOC_FAM]
6449 . HEAD_FAMILY \\*[$DOC_FAM]
6450 . SUBHEAD_FAMILY \\*[$DOC_FAM]
6451 . QUOTE_FAMILY \\*[$DOC_FAM]
6452 . BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
6453 . EPIGRAPH_FAMILY \\*[$DOC_FAM]
6454 . HDRFTR_FAMILY \\*[$DOC_FAM]
6455 . FOOTNOTE_FAMILY \\*[$DOC_FAM]
6459 \# DOCUMENT POINT SIZE
6460 \# -------------------
6462 \# <point size of running text>
6464 \# Creates or modifies register #DOC_PT_SIZE.
6466 \# DOC_PT_SIZE is the basis for calculating all type sizes in
6469 .MAC DOC_PT_SIZE END
6470 . if \\n[#IGNORE] \{ .return \}
6473 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
6480 \# <lead (".vs") of running text> [ADJUST]
6482 \# Creates or modifies register #DOC_LEAD. If the optional
6483 \# ADJUST argument is given, adjusts leading so that the last
6484 \# line of text falls exactly on #B_MARGIN.
6486 \# DOC_LEAD is the basis for calculating all leading changes in
6487 \# a document. Default for TYPESET is 16; 24 for TYPEWRITE.
6489 \# Because the visible bottom or footer margin of a page depends
6490 \# on the overall document lead supplied by the register #DOC_LEAD,
6491 \# DOC_LEAD, in the body of a document, should always be associated
6492 \# with the start of a new page (in other words, just before or
6493 \# just after a manual NEWPAGE).
6496 . if \\n[#IGNORE] \{ .return \}
6499 . nr #DOC_LEAD \\n[#LEAD]
6500 . if '\\$2'ADJUST' \{ .TRAPS \}
6504 \# ADJUST DOCUMENT LEAD
6505 \# --------------------
6507 \# <none> | <anything>
6509 \# Adjusts document lead so that the last line of text falls exactly
6512 .MAC DOC_LEAD_ADJUST END
6514 . nr #ADJ_DOC_LEAD 1
6517 . nr #ADJ_DOC_LEAD 0
6518 . nr #DOC_LEAD_ADJUST_OFF 1
6528 \# Advances to the next "legal" baseline.
6530 \# If a user plays around with spacing in a doc (say, with ALD),
6531 \# it isn't easy to get mom back on track so she can achieve
6532 \# perfectly flush bottom margins. Any time SHIM is used, it
6533 \# ensures that the next output line falls on a legal baseline.
6535 \# First, a little convenience macro
6537 .MAC PROCESS_SHIM END
6538 . while \\n+[#LEGAL_BASELINE]<\\n[#CURRENT_V_POS] \{\
6541 . nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
6546 . nr #LEGAL_BASELINE \\n[#T_MARGIN]-1v \\n[#DOC_LEAD]
6547 . if !r#CURRENT_V_POS \{ .nr #CURRENT_V_POS \\n(.d \}
6548 . ie r#ADVANCE_FROM_TOP \{\
6549 . ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
6550 . while \\n-[#LEGAL_BASELINE]>\\n[#CURRENT_V_POS] \{\
6553 . nr #LEGAL_BASELINE +\\n[#DOC_LEAD]
6554 . nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
6569 \# ====================================================================
6571 \# +++INTERNATIONALIZATION+++
6576 \# <what goes in the "by" slot before author in the document header>
6578 \# Creates or modifies string $ATTRIBUTE_STRING.
6580 \# Default is "by". A blank string ("") may be used if no
6581 \# attribution is desired.
6583 .MAC ATTRIBUTE_STRING END
6584 . ds $ATTRIBUTE_STRING \\$1
6591 \# <what to print any time the word "chapter" is required>
6593 \# Creates or modifies string $CHAPTER_STRING.
6595 \# Default is "chapter".
6597 .MAC CHAPTER_STRING END
6598 . ds $CHAPTER_STRING \\$1
6605 \# <what to print any time the word "draft" is required>
6607 \# Creates or modifies string $DRAFT_STRING.
6609 \# Default is "draft".
6611 .MAC DRAFT_STRING END
6612 . ds $DRAFT_STRING \\$1
6619 \# <what to print any time the word "revision" is required>
6621 \# Creates or modifies string $REVISION_STRING.
6623 \# Default is "revision".
6625 .MAC REVISION_STRING END
6626 . ds $REVISION_STRING \\$1
6633 \# <what to print with the finis macro>
6635 \# Creates or modifies string $FINIS_STRING.
6637 \# Default is "END".
6639 .MAC FINIS_STRING END
6642 . ds $FINIS_STRING \\$1
6647 \# ====================================================================
6649 \# +++RECTO/VERSO+++
6654 \# <none> | <anything>
6656 \# Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages. Also
6657 \# switches page numbers left and right if either is chosen rather
6658 \# than the default centered page numbers. Switches left and right
6659 \# margins if differing values have been entered.
6663 .MAC RECTO_VERSO END
6664 . ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
6665 . el \{ .nr #RECTO_VERSO 0 \}
6668 \# ====================================================================
6675 \# <value by which to multiply PP_INDENT for block epigraphs>
6677 \# Creates or modifies register #EPI_OFFSET_VALUE.
6679 \# Default is 2 for TYPEWRITE, 3 for TYPESET.
6681 .MAC EPIGRAPH_INDENT END
6682 . nr #EPI_OFFSET_VALUE \\$1
6686 \# EPIGRAPH AUTOLEAD
6687 \# -----------------
6689 \# <amount of lead to add to the epigraph ps for epigraph leading>
6691 \# Creates or modifies register #EPI_AUTOLEAD.
6693 \# Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
6695 .MAC EPIGRAPH_AUTOLEAD END
6696 . nr #EPI_AUTOLEAD \\$1
6703 \# BLOCK | <anything>
6705 \# Places an epigraph before the document's text, after the
6706 \# document header, or after a HEAD.
6708 \# #EPIGRAPH 1 = centered; 2 = block
6710 \# By default, epigraphs are centered, allowing the user
6711 \# to input them on a line per line basis. To change this
6712 \# behaviour, the user can supply the argument BLOCK, which
6713 \# will produce indented, filled text similar to BLOCKQUOTE.
6715 \# If a block epigraph contains more than one para, ALL paras of
6716 \# the epigraph must be preceded by PP. Otherwise, PP is optional.
6721 . if \\n[#LINENUMBERS]=1 \{\
6725 . if \\n[#START] \{\
6726 . if \\n[#PRINT_STYLE]=1 \{\
6727 . if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
6734 . ll \\n[#L_LENGTH]u
6737 . if \\n[#COLUMNS] \{\
6738 . ie \\n[#START] \{\
6739 . ll \\n[#DOC_L_LENGTH]u
6743 . ll \\n[#COL_L_LENGTH]u
6748 . if \\n[#PRINT_STYLE]=1 \{\
6751 . if '\\*[$EPI_FT]'I' \{\
6755 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
6756 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
6757 . nr #EPI_LEAD \\n[#LEAD]
6758 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
6760 . if \\n[#PRINT_STYLE]=2 \{\
6761 . FAMILY \\*[$EPI_FAM]
6763 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
6764 . if \\n[#EPI_COLOR]=1 \{\
6769 . AUTOLEAD \\n[#EPI_AUTOLEAD]
6770 . nr #EPI_LEAD \\n[#LEAD]
6771 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
6774 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
6775 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
6780 . ie '\\$1'BLOCK' \{\
6783 . ie \\n[#START] \{\
6784 . ie \\n[#COLUMNS] \{\
6785 . ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
6789 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
6794 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
6796 . if \\n[#COLUMNS] \{\
6797 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
6802 . if \\n[#PRINT_STYLE]=1 \{\
6805 . if '\\*[$EPI_FT]'I' \{\
6809 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
6810 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
6813 . nr #EPI_LEAD \\n[#LEAD]
6814 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
6818 . if \\n[#PRINT_STYLE]=2 \{\
6819 . FAMILY \\*[$EPI_FAM]
6821 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
6822 . if \\n[#EPI_COLOR]=1 \{\
6827 . AUTOLEAD \\n[#EPI_AUTOLEAD]
6828 . QUAD \\*[$EPI_QUAD]
6829 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
6830 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
6832 . nr #EPI_LEAD \\n[#LEAD]
6833 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
6850 \# Ends diversion started in EPIGRAPH. Makes spacing
6851 \# adjustments to compensate for the difference between epigraph
6852 \# leading and overall document leading, so that the bottom of
6853 \# the pages remain flush.
6855 \# In addition to its usual place at the beginning of a
6856 \# document, EPIGRAPH may also be used after HEAD.
6858 .MAC DO_EPIGRAPH END
6862 . if \\n[#RESET_FN_COUNTERS]=2 \{\
6863 . if !\\n[#FN_COUNT]=1 \{\
6864 . if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
6866 . rr #RESET_FN_COUNTERS
6870 . nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
6874 . nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
6875 . nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
6876 . ie \\n[#START] \{\
6878 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
6879 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6880 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
6882 . if \\n[#PRINT_STYLE]=2 \{\
6883 . RLD \\n[#DOC_LEAD]u
6884 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
6885 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
6887 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6888 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
6893 . ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
6895 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
6896 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6897 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
6899 . ie \\n[#PRINT_STYLE]=1 \{\
6900 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
6903 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
6904 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
6906 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6907 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
6910 . if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
6913 . nr #EPI_LINES_TO_TRAP 0 1
6914 . while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\
6917 . nr #EPI_LINES_TO_TRAP -1
6918 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
6919 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6920 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
6922 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
6923 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
6926 . if \\n[#EPIGRAPH]=1 \{\
6927 . po \\n[#L_MARGIN]u
6928 . if \\n[#COLUMNS] \{\
6929 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
6930 . nr #L_MARGIN \\n(.o
6933 . if \\n[#EPIGRAPH]=2 \{\
6934 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6935 . if \\n[#COLUMNS] \{\
6936 . nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6938 . po \\n[#EPI_OFFSET]u
6943 . ie \\n[#START] \{\
6944 . if \\n[#PRINT_STYLE]=1 \{\
6945 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6947 . ie \\n[#EPI_LINES]%2=1 \{ .ALD \\n[#DOC_LEAD]u \}
6948 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
6952 . if \\n[#PRINT_STYLE]=2 \{\
6953 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
6954 . ALD \\n[#EPI_WHITESPACE]u/2u
6956 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6957 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
6964 . ie \\n[#EPI_FITS] \{\
6965 . ie \\n[#FN_FOR_EPI] \{\
6966 . nr #EPI_LINES_TO_END 1
6967 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
6968 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6969 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
6971 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
6974 . ie \\n[#PRINT_STYLE]=1 \{\
6975 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
6978 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
6979 . ALD \\n[#EPI_WHITESPACE]u/2u
6981 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6982 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
6988 . nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
6989 . if \\n[#LOOP] \{ .nr #EPI_LINES_TO_END +1 \}
6991 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
6992 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
6993 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
6995 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
6996 . if \\n[#PRINT_STYLE]=1 \{\
6997 . if !\\n[#SINGLE_SPACE] \{\
6998 . nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
6999 . ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
7001 . rr #EPI_LINES_EVEN
7008 . ALD \\n[#DOC_LEAD]u
7009 . QUAD \\*[$DOC_QUAD]
7010 . po \\n[#L_MARGIN]u
7011 . if \\n[#COLUMNS] \{\
7012 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
7013 . nr #L_MARGIN \\n(.o
7015 . if \\n[#START] \{\
7016 . if \\n[#COLUMNS] \{\
7017 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
7018 . nr #L_MARGIN \\n(.o
7022 . if \\n[#LINENUMBERS]=2 \{\
7023 . NUMBER_LINES RESUME
7028 \# ====================================================================
7030 \# +++FINIS MACRO+++
7037 \# Deposits --END-- at the end of a document.
7043 . if \\n[#TAB_ACTIVE] \{ .TQ \}
7044 . if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
7045 . nr #EM_ADJUST (1m/8)
7046 . if \\n[#COLUMNS] \{\
7047 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
7048 . nr #L_MARGIN \\n(.o
7050 . ALD \\n[#DOC_LEAD]u
7052 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
7053 . if \\n[#PRINT_STYLE]=2 \{\
7054 . ie \\n[#FINIS_COLOR] \{\
7055 . PRINT "\m[\\*[$FINIS_COLOR]]\v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em\m[]
7057 . el \{ .PRINT \v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em\m[] \}
7062 \# ====================================================================
7064 \# +++HEADERS/FOOTERS+++
7066 \# Define a string so that the current page number can be incorporated
7067 \# into the strings for hdrftr left, right, and center. NOTE: This is
7068 \# not the same thing as using the shortform # in hdrftr strings.
7070 .ds PAGE# \En[#PAGENUMBER]
7076 \# <amount of space between header/footer and header/footer rule>
7078 \# Creates or modifies register #HDRFTR_RULE_GAP to hold amount
7079 \# of space between header/footer and header/footer rule.
7083 .MAC HDRFTR_RULE_GAP END
7084 . nr #HDRFTR_RULE_GAP (\\$1)
7091 \# <what to put in the left position of page header/footers>
7093 \# Creates or modifies string $HDRFTR_LEFT.
7094 \# Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
7095 \# overrides the $HDRFTR_LEFT string created by default
7098 \# Especially useful if doc has more than one author, and a list
7099 \# of authors by last name is desired in header/footers.
7100 \# Default is author.
7102 \# If the argument is the # character, simply prints the current
7105 \# If the user wants to *incorporate* the page number into the string,
7106 \# \*[PAGE#] must be used. For example, if the user wants to put
7107 \# an elipsis before the page number in the string, s/he should use
7108 \# ...\*[PAGE#], not ...#
7110 .MAC HDRFTR_LEFT END
7111 . nr #USER_DEF_HDRFTR_LEFT 1
7112 . ds $HDRFTR_LEFT \\$1
7119 \# <none> | <anything>
7121 \# Turns capitalisation of $HDRFTR_LEFT (typically, the author of
7122 \# the document) on or off.
7126 .MAC HDRFTR_LEFT_CAPS END
7128 . nr #HDRFTR_LEFT_CAPS 1
7131 . nr #HDRFTR_LEFT_CAPS 0
7132 . ds $HDRFTR_LEFT_SIZE_CHANGE +0
7140 \# <what to put in the centre position of page header/footers>
7142 \# Creates or modifies string $HDRFTR_CENTER.
7143 \# Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
7144 \# overrides the $HDRFTR_CENTER string created by default
7147 \# Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
7148 \# CHAPTER, draft and revision number if COPYSTYLE DRAFT.
7150 \# If the argument is the # character, simply prints the current
7153 \# If the user wants to *incorporate* the page number into the string,
7154 \# \*[PAGE#] must be used. For example, if the user wants to put
7155 \# an elipsis before the page number in the string, s/he should use
7156 \# ...\*[PAGE#], not ...#
7158 .MAC HDRFTR_CENTER END
7159 . nr #USER_DEF_HDRFTR_CENTER 1
7160 . if '\\$0'FOOTER_CENTER' \{\
7161 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
7162 . ds $HDRFTR_CENTER_NEW \\$1
7164 . if '\\$0'FOOTER_CENTRE' \{\
7165 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
7166 . ds $HDRFTR_CENTER_NEW \\$1
7168 . ds $HDRFTR_CENTER \\$1
7172 \# HDRFTR CENTER CAPS
7173 \# ------------------
7175 \# <none> | <anything>
7177 \# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
7178 \# the document) on or off.
7182 .MAC HDRFTR_CENTER_CAPS END
7184 . nr #HDRFTR_CENTER_CAPS 1
7187 . nr #HDRFTR_CENTER_CAPS 0
7188 . ds $HDRFTR_CENTER_SIZE_CHANGE +0
7193 \# HDRFTR CENTER PADDING
7194 \# ---------------------
7196 \# LEFT | RIGHT <amount of padding to put left or right of hdrftr
7199 \# Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
7200 \# #HDRFTR_CTR_PAD_RIGHT.
7202 \# By default, the HDRFTR_CENTER string is centered on the doc
7203 \# line length. Long titles or long author names can screw up
7204 \# visual centering, or create overprints. This macro allows the
7205 \# user to pad the center string by the specified amount of space
7206 \# to fix these problems. Use only one of LEFT or RIGHT.
7208 \# A unit of measure is required.
7210 .MAC HDRFTR_CENTER_PAD END
7211 . if '\\$1'LEFT' \{\
7212 . nr #HDRFTR_CTR_PAD_LEFT (\\$2)
7214 . if '\\$1'RIGHT' \{\
7215 . nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
7220 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
7221 \# --------------------------------
7225 \# Switches the padding side of hdrftr center padding.
7227 \# Required to keep spacing around hdrftr string constant
7228 \# in recto/verso documents.
7230 .MAC SWITCH_HDRFTR_CENTER_PAD END
7231 . nr #HDRFTR_CTR_PAD_TMP \\n[#HDRFTR_CTR_PAD_LEFT]
7232 . HDRFTR_CENTER_PAD LEFT \\n[#HDRFTR_CTR_PAD_RIGHT]u
7233 . HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
7240 \# <what to put in the right position of page header/footers>
7242 \# Creates or modifies string $HDRFTR_RIGHT.
7243 \# Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
7244 \# overrides the $HDRFTR_RIGHT string created by default
7247 \# Default is document title.
7249 \# If the argument is the # character, simply prints the current
7252 \# If the user wants to *incorporate* the page number into the string,
7253 \# \*[PAGE#] must be used. For example, if the user wants to put
7254 \# an elipsis before the page number in the string, s/he should use
7255 \# ...\*[PAGE#], not ...#
7257 .MAC HDRFTR_RIGHT END
7258 . nr #USER_DEF_HDRFTR_RIGHT 1
7259 . ds $HDRFTR_RIGHT \\$1
7263 \# HDRFTR RIGHT CAPS
7264 \# -----------------
7266 \# <none> | <anything>
7268 \# Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
7269 \# the document) on or off.
7273 .MAC HDRFTR_RIGHT_CAPS END
7275 . nr #HDRFTR_RIGHT_CAPS 1
7278 . nr #HDRFTR_RIGHT_CAPS 0
7279 . ds $HDRFTR_RIGHT_SIZE_CHANGE +0
7287 \# <none> | <anything>
7289 \# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
7290 \# under the header/over the footer. Otherwise, turns HDRFTR_RULE
7293 .MAC HDRFTR_RULE END \"To print rule under header/over footer.
7294 . ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
7295 . ie \\n[#USERDEF_HDRFTR] \{\
7296 . nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
7298 . if \\n[#HEADERS_ON] \{\
7300 . ALD \\n[#HDRFTR_RULE_GAP]u
7302 . if \\n[#FOOTERS_ON] \{\
7304 . RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
7306 . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
7307 . PRINT \m[\\*[$HDRFTR_RULE_COLOR]]\\l'\\n[#DOC_L_LENGTH]u'\m[]
7310 . PRINT \\l'\\n[#DOC_L_LENGTH]u'
7315 . if \\n[#PRINT_STYLE]=1 \{\
7316 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
7318 . if \\n[#PRINT_STYLE]=2 \{\
7319 . ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
7320 . nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
7322 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
7323 . ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
7324 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
7326 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
7329 . if \\n[#HEADERS_ON] \{\
7331 . ALD \\n[#HDRFTR_RULE_GAP]u
7333 . if \\n[#FOOTERS_ON] \{\
7335 . RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
7337 . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
7338 . PRINT \m[\\*[$HDRFTR_RULE_COLOR]]\\l'\\n[#DOC_L_LENGTH]u'\m[]
7341 . PRINT \\l'\\n[#DOC_L_LENGTH]u'
7347 . ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
7348 . el \{ .nr #HDRFTR_RULE 0 \}
7353 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
7361 \# Sets the family, font, and point size of all strings in
7362 \# header/footers to the same family and point size as running
7363 \# text. Font for the header/footer becomes roman throughout.
7365 .MAC HDRFTR_PLAIN END
7366 . HDRFTR_FAMILY \\*[$DOC_FAM]
7367 . HDRFTR_PT_SIZE \\n[#DOC_PT_SIZE]
7368 . HDRFTR_LEFT_FAMILY \\*[$DOC_FAM]
7369 . HDRFTR_LEFT_FONT R
7370 . HDRFTR_LEFT_SIZE +0
7371 . HDRFTR_LEFT_CAPS OFF
7372 . HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
7373 . HDRFTR_CENTER_FONT R
7374 . HDRFTR_CENTER_SIZE +0
7375 . HDRFTR_CENTER_CAPS OFF
7376 . HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]
7377 . HDRFTR_RIGHT_FONT R
7378 . HDRFTR_RIGHT_SIZE +0
7379 . HDRFTR_RIGHT_CAPS OFF
7386 \# <none> | <anything>
7388 \# Creates or modifies register #SWITCH_HDRFTR, used to switch
7389 \# default location of HDRFTR_LEFT and HDRFTR_RIGHT.
7393 Typically, the author string appears at the left of header/footers,
7394 and the title string appears at the right. This switches the
7395 location of the two. Useful in conjuction with RECTO_VERSO to tweak
7396 switches on alternate pages to come out as the user wishes. The
7397 assumption of RECTO_VERSO is that the first page of the document
7398 (recto) is odd, and even though it has no header/footer, if it did
7399 have one, it would print as AUTHOR...CENTER...TITLE (or whatever
7400 strings the user has supplied for HDRFTR_LEFT/RIGHT), meaning that
7401 the next page, which does have a header/footer, will come out as
7402 TITLE...CENTER...AUTHOR (or whatever strings the user has supplied
7403 for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user to get the
7404 desired string in the desired place on the desired recto/verso page.
7409 .MAC SWITCH_HDRFTR END
7410 . ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
7411 . el \{ .nr #SWITCH_HDRFTR 0 \}
7415 \# USER DEFINED HDRFTR RECTO
7416 \# -------------------------
7418 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
7420 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
7421 \# stores string in $USERDEF_HDRFTR_RECTO.
7423 \# For use when users don't want 3-part headers/footers, but rather
7424 \# want to design their own headers/footers and need different
7425 \# headers/footers on recto and verso pages. Using just
7426 \# HEADER_RECTO, even when recto/verso is not on, allows users to
7427 \# design their own headers/footers for doc pages.
7429 .MAC HDRFTR_RECTO END
7430 . nr #USERDEF_HDRFTR 1
7431 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
7432 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
7433 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
7434 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
7435 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
7436 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
7437 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
7438 . ds $USERDEF_HDRFTR_RECTO \\$2
7442 \# USER DEFINED HDRFTR VERSO
7443 \# -------------------------
7445 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
7447 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
7448 \# stores string in $USERDEF_HDRFTR_VERSO.
7450 \# For use when users don't want 3-part headers/footers, but rather
7451 \# want to design their own headers/footers and need different
7452 \# headers/footers on recto and verso pages.
7454 .MAC HDRFTR_VERSO END
7455 . nr #USERDEF_HDRFTR 1
7456 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
7457 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
7458 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
7459 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
7460 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
7461 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
7462 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
7463 . ds $USERDEF_HDRFTR_VERSO \\$2
7467 \# PRINT FOOTER ON FIRST PAGE
7468 \# --------------------------
7470 \# <none> | <anything>
7472 \# Toggles register #PRINT_FOOTER_ON_PAGE_1
7474 \# Lets user choose whether to print footer on first
7477 .MAC FOOTER_ON_FIRST_PAGE END
7478 . ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
7479 . el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
7483 \# PRINT PAGE NUMBER ON FIRST PAGE
7484 \# -------------------------------
7486 \# <none> | <anything>
7488 \# Toggles register #PRINT_PAGENUM_ON_PAGE_1
7490 \# Lets user choose whether to print page number on first
7491 \# page of doc and after collate when footers are on or page numbering
7492 \# has been user set at top of page.
7494 .MAC PAGENUM_ON_FIRST_PAGE END
7495 . ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
7496 . el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
7500 \# PRINT HEADER/FOOTER
7501 \# -------------------
7505 \# Based on defaults or values entered by user, prints a
7506 \# three-part title at either the top or the bottom of the page.
7508 \# Called from within either HEADER or FOOTER.
7510 .MAC PRINT_HDRFTR END
7511 . if \\n[#DOC_TYPE]=4 \{\
7512 . nr #SUITE \En[.pn]
7514 . if \\n[#FOOTERS_ON] \{\
7515 . if \\n[#START_FOR_FOOTERS] \{\
7516 . rr #START_FOR_FOOTERS
7517 . if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{ .return \}
7520 . if \\n[#USERDEF_HDRFTR] \{\
7521 . PRINT_USERDEF_HDRFTR
7524 . if \\n[#SWITCH_HDRFTR] \{\
7525 . ds $HDRFTR_TMP_SWITCH \\*[$HDRFTR_LEFT]
7526 . ds $HDRFTR_LEFT \\*[$HDRFTR_RIGHT]
7527 . ds $HDRFTR_RIGHT \\*[$HDRFTR_TMP_SWITCH]
7528 . ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
7529 . ds $HDRFTR_LEFT_SIZE_CHANGE \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
7530 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
7531 . nr #HDRFTR_TMP_CAPS_SWITCH \\n[#HDRFTR_LEFT_CAPS]
7532 . nr #HDRFTR_LEFT_CAPS \\n[#HDRFTR_RIGHT_CAPS]
7533 . nr #HDRFTR_RIGHT_CAPS \\n[#HDRFTR_TMP_CAPS_SWITCH]
7534 . ds $HDRFTR_TMP_COLOR_SWITCH \\*[$HDRFTR_LEFT_COLOR]
7535 . ds $HDRFTR_LEFT_COLOR \\*[$HDRFTR_RIGHT_COLOR]
7536 . ds $HDRFTR_RIGHT_COLOR \\*[$HDRFTR_TMP_COLOR_SWITCH]
7537 . rr #HDRFTR_TMP_CAPS_SWITCH
7538 . rm $HDRFTR_TMP_SWITCH
7539 . rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
7540 . rm $HDRFTR_TMP_COLOR_SWITCH
7541 . nr #SWITCH_HDRFTR 0
7543 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
7544 . if \\n[#ENDNOTES] \{ .PAGENUM_STYLE \\*[$EN_PN_STYLE] \}
7545 . if \\n[#PRINT_STYLE]=1 \{\
7546 . if \\n[#FOOTERS_ON] \{\
7549 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
7554 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
7555 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
7556 . ie '\\*[$HDRFTR_LEFT]'#' \{\
7557 . PRINT \\n[#PAGENUMBER]
7560 . ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
7561 . el \{ .PRINT \& \}
7563 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
7565 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
7567 . ie '\\*[$HDRFTR_CENTER]'#' \{\
7568 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
7571 . ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
7572 . el \{ .PRINT \& \}
7574 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
7577 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
7578 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
7580 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
7581 . PRINT \\n[#PAGENUMBER]
7584 . ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \\*[$HDRFTR_RIGHT] \}
7585 . el \{ .PRINT \& \}
7587 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
7589 . if \\n[#PRINT_STYLE]=2 \{\
7590 . if \\n[#HDRFTR_COLOR]=1 \{\
7592 \m[\\*[$HDRFTR_COLOR]]
7595 . fam \\*[$HDRFTR_LEFT_FAM]
7596 . ft \\*[$HDRFTR_LEFT_FT]
7597 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
7599 . if \\n[#FOOTERS_ON] \{\
7602 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
7607 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
7608 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
7609 . ie '\\*[$HDRFTR_LEFT]'#' \{\
7610 . ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
7611 . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[]
7614 . PRINT \\n[#PAGENUMBER]
7618 . ie !'\\*[$HDRFTR_LEFT]'' \{\
7619 . ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
7620 . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[]
7623 . PRINT \\*[$HDRFTR_LEFT]
7626 . el \{ .PRINT \& \}
7628 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
7629 . fam \\*[$HDRFTR_CENTER_FAM]
7630 . ft \\*[$HDRFTR_CENTER_FT]
7631 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
7633 . if \\n[#FOOTERS_ON] \{\
7636 . nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
7640 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
7642 . ie '\\*[$HDRFTR_CENTER]'#' \{\
7643 . ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
7644 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
7647 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
7651 . ie !'\\*[$HDRFTR_CENTER]'' \{\
7652 . ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
7653 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
7656 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
7659 . el \{ .PRINT \& \}
7661 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
7662 . fam \\*[$HDRFTR_RIGHT_FAM]
7663 . ft \\*[$HDRFTR_RIGHT_FT]
7664 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
7666 . if \\n[#FOOTERS_ON] \{\
7669 . nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
7674 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
7675 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
7677 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
7678 . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
7679 . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[]
7682 . PRINT \\n[#PAGENUMBER]
7686 . ie !'\\*[$HDRFTR_RIGHT]'' \{\
7687 . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
7688 . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[]
7691 . PRINT \\*[$HDRFTR_RIGHT]
7694 . el \{ .PRINT \& \}
7696 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
7698 . if \\n[#HDRFTR_RULE] \{\
7699 . HDRFTR_RULE_INTERNAL
7705 \# PRINT USER DEFINED HEADER/FOOTER
7706 \# --------------------------------
7710 \# Based on defaults or values entered by user, prints a single part
7711 \# (i.e. not 3-part) title at either the top or the bottom of the page.
7713 \# Called from within PRINT_HDRFTR.
7715 .MAC PRINT_USERDEF_HDRFTR END
7716 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
7718 . if \\n[#PRINT_STYLE]=2 \{\
7719 . FAMILY \\*[$HDRFTR_FAM]
7721 . PT_SIZE \\n[#HDRFTR_PT_SIZE]u
7722 . if \\n[#HDRFTR_COLOR]=1 \{\
7724 . COLOR \\*[$HDRFTR_COLOR]
7727 . ie \\n[#RECTO_VERSO] \{\
7729 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
7730 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
7731 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
7732 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
7734 . if \\n[#FOOTERS_ON] \{\
7737 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
7742 . ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
7743 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT \}
7744 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
7745 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT \}
7746 . PRINT \\*[$USERDEF_HDRFTR_VERSO]
7748 . if \\n[#FOOTERS_ON] \{\
7751 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
7756 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
7757 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
7758 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
7759 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
7761 . if \\n[#FOOTERS_ON] \{\
7764 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
7771 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
7772 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
7773 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
7774 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
7776 . if \\n[#FOOTERS_ON] \{\
7779 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
7784 . if \\n[#PRINT_STYLE]=2 \{\
7785 . ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]]
7788 . if \\n[#HDRFTR_RULE] \{\
7789 . HDRFTR_RULE_INTERNAL
7796 \# HEADERS (off or on)
7797 \# -------------------
7799 \# <none> | <anything>
7801 \# Turns headers at the top of the page off or on.
7806 . ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
7807 . el \{ .nr #HEADERS_ON 0 \}
7814 \# <amount of space between top of page and header>
7816 \# Creates or modifies register #HEADER_MARGIN to hold amount
7817 \# of space between top of page and header.
7819 \# Requires unit of measure. Default is 4P+6p, measured top-of-page
7822 .MAC HEADER_MARGIN END
7823 . nr #HEADER_MARGIN (\\$1)
7830 \# <amount of space between header and running text>
7832 \# Creates or modifies register #HEADER_GAP to hold amount
7833 \# of space between header and running text.
7835 \# Default is 1P+6p.
7838 . nr #HEADER_GAP (\\$1)
7847 \# Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
7849 \# In order to convert the title string to caps in the header (in the
7850 \# event that the user enters .TITLE in caps/lc), I've used
7851 \# quad left, quad centre, and quad right to arrange the three bits
7852 \# of the header, rather than .tl. This allows the use of the CAPS macro.
7853 \# The downside is that I have to add \\v'-(\\n[#LEAD]u*<n>) in order
7854 \# for -Tlatin1 output to align the header/footer strings on the baseline.
7855 \# The console output still isn't brilliant, but at least it's
7862 . nr #LAST_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]
7863 . if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
7865 . if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
7866 . po \\n[#DOC_L_MARGIN]u
7867 . if \\n[#RECTO_VERSO] \{\
7868 . if !\\n[#TOC_RV_SWITCH] \{\
7869 . nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
7870 . DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u
7871 . DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
7872 . SWITCH_HDRFTR_CENTER_PAD
7877 . if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
7878 . sp |\\n[#HEADER_MARGIN]u-1v
7880 . ll \\n[#DOC_L_LENGTH]u
7882 . if \\n[#PRINT_STYLE]=1 \{\
7885 . ps 12\\*[$HDRFTR_SIZE_CHANGE]
7887 . if \\n[#PRINT_STYLE]=2 \{\
7888 . fam \\*[$HDRFTR_FAM]
7890 . ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
7893 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
7894 . if \\n[#CAPS_ON] \{\
7898 . if \\n[#UNDERLINE_ON] \{\
7899 . nr #UNDERLINE_WAS_ON 1
7902 . if \\n[#PRINT_STYLE]=1 \{\
7903 . if \\n[#ENDNOTES]=1 \{\
7904 .\" Single-spaced endotes have a different lead
7905 . if \\n[#EN_SINGLESPACE] \{\
7906 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
7907 . nr #DOC_LEAD \\n[#EN_LEAD]u
7911 . ie \\n[#HEADERS_ON] \{\
7913 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
7916 . ie \\n[#PAGE_NUM_V_POS]=1 \{\
7917 . ie \\n[#PAGINATE] \{\
7919 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
7921 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
7923 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
7925 . if \\n[#PRINT_STYLE]=1 \{\
7926 . if \\n[#ENDNOTES]=1 \{\
7927 . if \\n[#EN_SINGLESPACE] \{\
7928 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
7929 . rr #RESTORE_DOC_LEAD
7933 . nr #PAGE_TOP \\n(nl
7935 . po \\n[#L_MARGIN]u
7936 . if \\n[#RECTO_VERSO] \{\
7937 . nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
7939 . if \\n[#CAPS_WAS_ON] \{\
7943 . if \\n[#UNDERLINE_WAS_ON] \{\
7945 . rr #UNDERLINE_WAS_ON
7947 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7948 . if \\n[#QUOTE] \{\
7949 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7951 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
7952 . po \\n[#Q_OFFSET]u
7954 . ALD \\n[#Q_LEAD_DIFF]u
7956 . if \\n[#EPIGRAPH] \{\
7957 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7959 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
7960 . po \\n[#EPI_OFFSET]u
7963 . ie \\n[#EPIGRAPH] \{\
7964 . ie !\\n[#EPI_ACTIVE] \{\
7969 . ie \\n[#EPI_FITS] \{ .ns \}
7970 . el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
7975 . if \\n[#COLUMNS] \{\
7976 . nr #FN_COUNT_FOR_COLS 0 1
7977 . nr #L_MARGIN \\n[#DOC_L_MARGIN]
7978 . if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
7981 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7982 . nr #L_MARGIN \\n(.o
7983 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7984 . ll \\n[#COL_L_LENGTH]u
7986 . if \\n[#QUOTE] \{\
7987 . po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7989 . if \\n[#EPIGRAPH] \{\
7990 . if \\n[#EPI_ACTIVE] \{\
7991 . ie \\n[#EPI_FITS] \{ . \}
7992 . el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
7994 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
7997 . if \\n[#RESET_FN_COUNTERS]=1 \{\
7998 . rr #RESET_FN_COUNTERS
7999 . PROCESS_FN_IN_DIVER
8000 . nr #FN_COUNT \\n[#SAVED_FN_COUNT] 1
8001 . if \\n[#COLUMNS]=1 \{ .nr #FN_COUNT_FOR_COLS \\n[#SAVED_FN_COUNT_FOR_COLS] 1 \}
8002 . ie \\n[#RESET_FN_NUMBER]=1 \{ .nr #FN_NUMBER \\n[#SAVED_FN_NUMBER] 1 \}
8003 . el \{ .nr #FN_NUMBER \\n[#FN_NUMBER] 1 \}
8005 . if dRUNON_FN_IN_DIVER \{ .rm RUNON_FN_IN_DIVER \}
8007 . if \\n[#PRINT_STYLE]=1 \{\
8008 . if \\n[#SLANT_ON] \{\
8009 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
8013 . rr #DEFER_SPACE_ADDED
8014 . if !\\n[#FN_DEPTH] \{\
8015 . if r#DIVERTED \{ .rr #DIVERTED \}
8017 . if \\n[#MN_OVERFLOW_LEFT]=1 \{\
8023 . if \\n[#MN_OVERFLOW_RIGHT]=1 \{\
8029 . rm MN_OVERFLOW_LEFT
8030 . rr #MN_OVERFLOW_LEFT
8031 . rr #no-repeat-MN-left
8032 . rm MN_OVERFLOW_RIGHT
8033 . rr #MN_OVERFLOW_RIGHT
8034 . rr #no-repeat-MN-right
8037 \# ====================================================================
8041 \# FOOTERS (off or on)
8042 \# -------------------
8044 \# <none> | <anything>
8046 \# Turns footers at the bottom of the page off or on.
8048 \# Default is off. If on, page numbers automatically go at
8049 \# the top, centered, unless pagination has been turned off,
8050 \# or the pagenumber position has been changed to left or right.
8055 . PAGE_NUM_POS TOP CENTER
8057 . el \{ .nr #FOOTERS_ON 0 \}
8066 \# Creates or modifies register #FOOTER_MARGIN which holds the
8067 \# amount of space to leave between the page number and the bottom
8070 \# Unit of measure required. Default is 3P.
8072 .MAC FOOTER_MARGIN END
8073 . ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
8081 \# <distance from end of running text to page # or footer>
8083 \# Creates or modifies register #FOOTER_GAP which holds the
8084 \# amount of space to leave between running text and the page number.
8086 \# Requires unit of measure. Default is 3P. Measured baseline to
8090 . ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
8100 \# Places footer at bottom of page if #FOOTERS=1, otherwise
8101 \# places page number at bottom of page (if #PAGINATE=1).
8102 \# Page numbers are in arabic or roman according to COPYSTYLE.
8103 \# DRAFT starts the document at page 1 regardless of PAGENUMBER.
8104 \# FINAL respects PAGENUMBER.
8107 . ev PAGE_TRANSITION
8108 . if \\n[MN-left]>0 \{\
8109 . if !\\n[#no-repeat-MN-left]=1 \{\
8111 . nr #no-repeat-MN-left 1
8113 . if '\\n(.z'MN_OVERFLOW_LEFT' \{\
8115 . nr #MN_OVERFLOW_LEFT 1
8119 . if \\n[MN-right]>0 \{\
8120 . if (\\n[MN-right] > 0) \{\
8121 . if !\\n[#no-repeat-MN-right]=1 \{\
8125 . if '\\n(.z'MN_OVERFLOW_RIGHT' \{\
8127 . nr #MN_OVERFLOW_RIGHT 1
8128 . rr #OVERFLOW_RIGHT
8131 . ch MN_OVERFLOW_TRAP
8132 . nr #SAVED_LEAD \\n(.v
8133 . nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
8134 . if !\\n[#FN_DEFER] \{\
8136 . if \\n[#FN_DEPTH] \{\
8137 . if \\n[#DIVERTED]=3 \{ .nr #FN_DEPTH +\\n[#VFP_DIFF] \}
8139 . sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u-\\n[#DOC_LEAD]u)
8141 . po \\n[#DOC_L_MARGIN]u
8142 . if \\n[#COLUMNS] \{\
8143 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8144 . nr #L_MARGIN \\n(.o
8150 . if dRUNON_FOOTNOTES \{ .rm RUNON_FOOTNOTES \}
8151 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#SAVED_LEAD]u \}
8152 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#SAVED_LEAD]u \}
8153 . if '\\n(.z'FN_OVERFLOW' \{\
8155 . nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
8157 . nr #FN_COUNT_AT_FOOTER \\n[#FN_COUNT]
8159 . if \\n[#COL_NEXT] \{\
8160 . ie !\\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
8161 . el \{ .nr #COL_NUM \\n[#NUM_COLS] 1 \}
8166 . ie \\n[#COLUMNS]=1 \{\
8167 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
8169 . ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
8170 . el \{ .sp |\\n(dcu \}
8171 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
8172 . nr #L_MARGIN \\n(.o
8173 . if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
8174 . LS \\n[#SAVED_LEAD]u
8175 . if \\n[#PREV_FN_DEFERRED] \{\
8176 . nr #PREV_FN_DEFERRED 2
8179 . if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
8180 . if !\\n[#QUOTE] \{ .rr #COL_NEXT \}
8181 . if \\n[#RESET_FN_COUNTERS]=1 \{\
8182 . rr #RESET_FN_COUNTERS
8183 . PROCESS_FN_IN_DIVER
8184 . LS \\n[#SAVED_LEAD]u
8185 . nr #FN_COUNT \\n[#FN_COUNT] 1
8186 . nr #FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] 1
8188 . if dRUNON_FN_IN_DIVER \{ .rm RUNON_FN_IN_DIVER \}
8190 . rr #DEFER_SPACE_ADDED
8191 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
8192 . if \\n[#QUOTE] \{\
8193 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
8195 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8196 . if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
8197 . po \\n[#Q_OFFSET]u
8200 . if \\n[#EPIGRAPH] \{\
8201 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
8203 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
8204 . if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
8205 . po \\n[#EPI_OFFSET]u
8208 . ie \\n[#EPIGRAPH] \{\
8209 . ie !\\n[#EPI_ACTIVE] \{\
8214 . sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
8224 . el \{ .DO_FOOTER \}
8233 \# Prints footer (page number, or 3-part footer).
8234 \# Resets CAPS and UNDERLINE if they were on.
8237 .\" Have to change position of FN_OVERFLOW_TRAP or it screws up the
8238 .\" placement of page numbers (or footers). It's reset to its original
8239 .\" position at the end of the macro.
8240 . if r#SAVED_FOOTER_POS \{ .ch FOOTER \\n[#SAVED_FOOTER_POS]u \}
8241 . rr #SAVED_FOOTER_POS
8242 . ie (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
8247 . sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
8252 . po \\n[#DOC_L_MARGIN]u
8253 . ll \\n[#DOC_L_LENGTH]u
8255 . FAMILY \\*[$HDRFTR_FAM]
8257 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
8258 . if \\n[#PRINT_STYLE]=1 \{\
8261 . LS \\n[#SAVED_LEAD]u
8262 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
8263 . if \\n[#CAPS_ON] \{\
8267 . if \\n[#UNDERLINE_ON] \{\
8268 . nr #UNDERLINE_WAS_ON 1
8271 . ie \\n[#FOOTERS_ON] \{\
8272 . if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_HDRFTR \}
8275 . if \\n[#PAGINATE] \{\
8276 . if \\n[#PAGE_NUM_V_POS]=2 \{\
8277 . if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_PAGE_NUMBER \}
8282 . if \\n[#CAPS_WAS_ON] \{\
8286 . if \\n[#UNDERLINE_WAS_ON] \{\
8288 . rr #UNDERLINE_WAS_ON
8293 .\" This ev pops the PAGE_TRANSITION environment still active at the
8298 \# ====================================================================
8302 \# ---Head numbers---
8307 \# <none> | <anything>
8309 \# Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
8313 .MAC NUMBER_HEADS END
8316 . if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
8318 . el \{ .rr #NUMBER_HEAD \}
8322 \# RESET HEAD NUMBER
8323 \# -----------------
8325 \# <none> | <desired head number>
8327 \# Resets incrementing register #HEAD_NUM to 1 or, if there's
8328 \# an argument, to user supplied number.
8330 \# Also resets subhead and parahead numbers. If this is not
8331 \# desired, subhead and parahead numbers may be reset individually.
8333 .MAC RESET_HEAD_NUMBER END
8340 . nr #HEAD_NUM \\$1-1 1
8350 \# <none> | <anything>
8352 \# Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
8356 .MAC NUMBER_SUBHEADS END
8359 . if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
8361 . el \{ .rr #NUMBER_SH \}
8365 \# RESET SUBHEAD NUMBER
8366 \# --------------------
8368 \# <none> | <desired subhead number>
8370 \# Resets incrementing register #SH_NUM to 1 or, if there's
8371 \# an argument, to user supplied number.
8373 \# When the subhead number is reset, it resets the parahead number as
8374 \# well. If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
8375 \# allows the user to set the parahead number to whatever s/he desires.
8377 .MAC RESET_SUBHEAD_NUMBER END
8378 . ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
8380 . nr #SH_NUM \\$1-1 1
8389 \# <none> | <anything>
8391 \# Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
8395 .MAC NUMBER_PARAHEADS END
8398 . if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
8400 . el \{ .rr #NUMBER_PH \}
8404 \# RESET PARAHEAD NUMBER
8405 \# ---------------------
8407 \# <none> | <desired parahead number>
8409 \# Resets incrementing register #PH_NUM to 1 or, if there's
8410 \# an argument, to user supplied number.
8412 \# Resetting the parahead number resets the parahead number
8415 .MAC RESET_PARAHEAD_NUMBER END
8416 . ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
8417 . el \{ nr #SH_NUM \\$1-1 1 \}
8426 \# <none> | <anything>
8428 \# Creates or modifies register #HEAD_CAPS.
8433 . ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
8434 . el \{ .nr #HEAD_CAPS 0 \}
8441 \# <none> | <anything>
8443 \# Creates register #HEAD_SPACE, which toggles whether the space
8444 \# before heads is 1 extra line space ("off") or 2 ("on"). Used only
8445 \# in PRINTSTYLE TYPESET.
8450 . ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
8451 . el \{ .nr #HEAD_SPACE 0 \}
8458 \# <none> | <anything>
8460 \# Creates or modifies register #HEAD_UNDERLINE.
8464 .MAC HEAD_UNDERLINE END
8465 . ie '\\$1'' \{ .nr #HEAD_UNDERLINE 1 \}
8466 . el \{ .nr #HEAD_UNDERLINE 0 \}
8473 \# "text of main head" ["text of main head"] ...
8475 \# In TYPEWRITE, prints main heads centered, all caps, underlined.
8476 \# In TYPESET, prints bold main heads 1 point larger than running
8477 \# text, all caps, underlined.
8479 \# The HEAD macro requires that double-quotes (") surround
8480 \# each line of text.
8484 .\" Collect head for TOC.
8486 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
8487 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
8488 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8489 . ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
8490 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\\|
8493 .\" Note that in the .as lines, below, \ at the end has a literal
8495 . ie \\n[#NUMBER_HEAD] \{\
8496 . ie \\n[#ARG_NUM]=0 \{\
8497 . as $TOC_HEAD_ITEM \\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\
8498 . nr #HEAD_NUM \\n-[#HEAD_NUM]
8501 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\
8505 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\
8509 .\" Note the use of \!, which transparently embeds the macros used
8510 .\" in the TOC_ENTRIES diversion. The elements they control must be
8511 .\" processed literally when the diversion is output.
8514 . if \\n[#PRINT_STYLE]=1 \{\
8519 . if \\n[#PRINT_STYLE]=2 \{\
8520 \!. FAMILY \\*[$TOC_HEAD_FAM]
8521 \!. FT \\*[$TOC_HEAD_FT]
8522 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
8525 . ie \\n[#PRINT_STYLE]=1 \{\
8526 \!. PAD "\\h'2m'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN_TYPEWRITE]"
8529 \!. PAD "\\h'\\n[#TOC_HEAD_INDENT]u'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN]"
8534 . if \\n[#PRINT_STYLE]=2 \{\
8535 \!. FAMILY \\*[$TOC_PN_FAM]
8536 \!. FT \\*[$TOC_PN_FT]
8537 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
8540 \!. PRINT \\*[LEADER]
8543 \!. PRINT \\n[#TOC_ENTRY_PN]
8547 .\" End collection of head for TOC
8551 . ll \\n[#L_LENGTH]u
8553 . if \\n[#COLUMNS] \{\
8554 . ll \\n[#COL_L_LENGTH]u
8558 . QUAD \\*[$HEAD_QUAD]
8559 . if \\n[#PRINT_STYLE]=1 \{\
8561 . vs \\n[#DOC_LEAD]u
8564 . if \\n[#PRINT_STYLE]=2 \{\
8565 . FAMILY \\*[$HEAD_FAM]
8567 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
8568 . LS \\n[#DOC_LEAD]u
8570 . if r#QUOTE \{ .rr #QUOTE \}
8571 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8572 . if \\n[#PRINT_STYLE]=1 \{ .ne \\n[#NUM_ARGS]+2 \}
8573 . if \\n[#PRINT_STYLE]=2 \{\
8574 . ie \\n[#HEAD_SPACE] \{ .ne \\n[#NUM_ARGS]+3 \}
8575 . el \{ .ne \\n[#NUM_ARGS]+2 \}
8577 . ie \\n[#START] \{\
8578 . if \\n[#DOC_HEADER]=0 \{ .RLD 1v \}
8581 . if \\n[#PRINT_STYLE]=1 \{\
8582 . if !\\n[#LINEBREAK] \{\
8583 . ALD \\n[#DOC_LEAD]u
8584 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
8587 . if \\n[#PRINT_STYLE]=2 \{\
8588 . ie \\n[#PP_SPACE] \{\
8589 . ie \\n[#END_QUOTE] \{ . \}
8591 . if !\\n[#LINEBREAK] \{\
8592 . if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
8597 . ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
8598 . el \{ .ALD \\n[#DOC_LEAD]u \}
8600 . if \\n[#END_QUOTE] \{\
8601 . if !\\n[#Q_FITS] \{\
8602 . RLD \\n[#DOC_LEAD]u
8603 . if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
8605 . if \\n[#Q_AT_TOP] \{\
8606 . RLD \\n[#DOC_LEAD]u
8607 . if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
8610 . if \\n[#LINEBREAK] \{\
8611 . if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
8617 . if \\n[#HEAD_CAPS] \{ .CAPS \}
8618 . if \\n[#PRINT_STYLE]=2 \{\
8619 . if \\n[#HEAD_COLOR]=1 \{\
8621 . COLOR \\*[$HEAD_COLOR]
8626 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8627 . ie \\n[#NUMBER_HEAD] \{\
8628 . ie \\n[#ARG_NUM]=0 \{\
8630 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
8631 . el \{ .UNDERSCORE "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
8636 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
8637 . el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
8643 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
8644 . el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
8651 . ALD \\n[#DOC_LEAD]u
8652 . RESET_SUBHEAD_NUMBER
8653 . RESET_PARAHEAD_NUMBER
8654 . if r#START \{ .rr #START \}
8655 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8656 . if r#QUOTE \{ .rr #QUOTE \}
8657 . if r#Q_FITS \{ .rr #Q_FITS \}
8658 . if r#END_QUOTE \{ .rr #END_QUOTE \}
8659 . if r#LINEBREAK \{ .rr #LINEBREAK \}
8660 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
8661 . if r#PP_ACTIVE \{ .rr #PP_ACTIVE \}
8673 \# "text of subhead" ["text of subhead"] ...
8675 \# In TYPEWRITE, prints subheads underlined.
8676 \# In TYPESET, prints subheads bold, .5 points larger than running
8678 \# In both styles, a line space precedes the subhead, and a small
8679 \# amount of lead comes after.
8681 \# As with the HEAD macro, double-quotes (") must surround
8682 \# each line of text.
8686 .\" Collect subhead for TOC.
8688 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
8689 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8690 . ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
8691 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\\|
8694 .\" Note that in the .as lines, below, \ at the end has a literal
8696 . ie \\n[#NUMBER_SH] \{\
8697 . ie \\n[#ARG_NUM]=0 \{\
8698 . as $TOC_SH_ITEM \\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]\
8699 . nr #SH_NUM \\n-[#SH_NUM]
8702 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\
8706 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\
8710 .\" Note the use of \!, which transparently embeds the macros used
8711 .\" in the TOC_ENTRIES diversion. The elements they control must be
8712 .\" processed literally when the diversion is output.
8715 . if \\n[#PRINT_STYLE]=1 \{\
8720 . if \\n[#PRINT_STYLE]=2 \{\
8721 \!. FAMILY \\*[$TOC_SH_FAM]
8722 \!. FT \\*[$TOC_SH_FT]
8723 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
8726 . ie \\n[#PRINT_STYLE]=1 \{\
8727 \!. PAD "\\h'4m'\\*[$TOC_SH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
8730 \!. PAD "\\h'\\n[#TOC_SH_INDENT]u'\\*[$TOC_SH_ITEM]\\*[$TOC_PN]"
8735 . if \\n[#PRINT_STYLE]=2 \{\
8736 \!. FAMILY \\*[$TOC_PN_FAM]
8737 \!. FT \\*[$TOC_PN_FT]
8738 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
8741 \!. PRINT \\*[LEADER]
8744 \!. PRINT \\n[#TOC_ENTRY_PN]
8748 .\" End collection of head for TOC
8751 . if r#QUOTE \{ .rr #QUOTE \}
8752 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
8754 . ll \\n[#L_LENGTH]u
8756 . if \\n[#COLUMNS] \{\
8757 . ll \\n[#COL_L_LENGTH]u
8761 . if \\n[#PRINT_STYLE]=1 \{\
8763 . vs \\n[#DOC_LEAD]u
8764 . QUAD \\*[$SH_QUAD]
8767 . if \\n[#PRINT_STYLE]=2 \{\
8768 . FAMILY \\*[$SH_FAM]
8770 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
8771 . LS \\n[#DOC_LEAD]u
8772 . QUAD \\*[$SH_QUAD]
8774 . if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
8775 . if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
8776 . ie \\n[#START] \{ .RLD 1v \}
8778 . ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]*(\\n[#NUM_ARGS]+1)) ) \{\
8779 . ie \\n[#COLUMNS] \{ .COL_NEXT \}
8783 . ie \\n[#HEAD]=1 \{ . \}
8785 . if \\n[#PRINT_STYLE]=1 \{\
8786 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8788 . if \\n[#PRINT_STYLE]=2 \{\
8789 . ie \\n[#PP_SPACE]=1 \{\
8790 . ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8791 . el \{ .RLD \\n[#DOC_LEAD]u \}
8794 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8801 . if \\n[#PRINT_STYLE]=1 \{\
8802 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8803 . ie \\n[#NUMBER_SH] \{\
8804 . ie \\n[#ARG_NUM]=0 \{\
8805 . ie \\n[#NUMBER_HEAD] \{\
8807 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
8812 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
8818 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
8819 . el \{ .UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
8825 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
8830 . if \\n[#PRINT_STYLE]=1 \{\
8831 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
8833 . if \\n[#PRINT_STYLE]=2 \{\
8834 . if \\n[#SH_COLOR]=1 \{ .COLOR \\*[$SH_COLOR] \}
8835 . ie \\n[#PP_SPACE]=0 \{\
8836 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8837 . ie \\n[#NUMBER_SH] \{\
8838 . ie \\n[#ARG_NUM]=0 \{\
8839 . ie \\n[#NUMBER_HEAD] \{\
8841 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
8846 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
8852 . PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
8858 . PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
8864 . ALD \\n[#DOC_LEAD]u
8865 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
8866 . if \\n[#END_QUOTE] \{ .RLD \\n[#DOC_LEAD]u \}
8867 . if \\n[#EPIGRAPH] \{ .RLD \\n[#DOC_LEAD]u \}
8868 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
8869 . PRINT "\\$[\\n+[#ARG_NUM]]
8871 . ALD \\n[#DOC_LEAD]u
8876 . RESET_PARAHEAD_NUMBER
8877 . if r#START \{ .rr #START \}
8878 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8879 . if r#Q_FITS \{ .rr #Q_FITS \}
8880 . if r#END_QUOTE \{ .rr #END_QUOTE \}
8881 . if r#LINEBREAK \{ .rr #LINEBREAK \}
8887 \# ---Paragraph heads---
8894 \# Creates or modifies register #PH_INDENT.
8896 \# Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
8898 .MAC PARAHEAD_INDENT END
8899 . nr #PH_INDENT (\\$1)
8908 \# Deposits a paragraph head at the start and into the body of a
8911 \# PARAHEAD *must* come after PP.
8914 .\" Collect parahead for TOC.
8915 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
8916 . ie \\n[#NUMBER_PH] \{\
8917 . ds $TOC_PH_ITEM \\n+[#PH_NUM].\0\\$1\\|
8918 . nr #PH_NUM \\n-[#PH_NUM]
8921 . ds $TOC_PH_ITEM \\$1\\|
8925 . if \\n[#PRINT_STYLE]=1 \{\
8930 . if \\n[#PRINT_STYLE]=2 \{\
8931 \!. FAMILY \\*[$TOC_PH_FAM]
8932 \!. FT \\*[$TOC_PH_FT]
8933 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PH_SIZE_CHANGE]
8936 . ie \\n[#PRINT_STYLE]=1 \{\
8937 \!. PAD "\\h'6m'\\*[$TOC_PH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
8940 \!. PAD "\\h'\\n[#TOC_PH_INDENT]u'\\*[$TOC_PH_ITEM]\\*[$TOC_PN]"
8945 . if \\n[#PRINT_STYLE]=2 \{\
8946 \!. FAMILY \\*[$TOC_PN_FAM]
8947 \!. FT \\*[$TOC_PN_FT]
8948 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
8951 \!. PRINT \\*[LEADER]
8954 \!. PRINT \\n[#TOC_ENTRY_PN]
8958 .\" End collection of parahead for TOC
8959 .\" Process parahead
8960 . if \\n[#SLANT_ON] \{\
8961 . nr #SLANT_WAS_ON 1
8965 . if \\n[#INDENT_FIRST_PARAS] \{\
8966 . ti \\n[#PH_INDENT]u
8969 . el \{ .ti \\n[#PH_INDENT]u \}
8970 . if \\n[#PRINT_STYLE]=1 \{\
8973 . ie \\n[#NUMBER_PH] \{\
8974 . if \\n[#NUMBER_HEAD] \{\
8975 . ie \\n[#NUMBER_SH] \{\
8976 . UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
8980 . UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1
8984 . ie \\n[#NUMBER_SH] \{\
8985 . if !\\n[#NUMBERED] \{\
8986 . UNDERSCORE "\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1
8991 . if !\\n[#NUMBERED] \{\
8992 . UNDERSCORE "\\n+[#PH_NUM].\\ \\$1
9001 . if \\n[#SLANT_WAS_ON] \{\
9002 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
9003 . if \\n[#SLANT_MEANS_SLANT] \{\
9009 . if \\n[#PRINT_STYLE]=2 \{\
9012 . PT_SIZE \\*[$PH_SIZE_CHANGE]
9013 . if \\n[#PH_COLOR]=1 \{ .COLOR \\*[$PH_COLOR] \}
9014 . ie \\n[#NUMBER_PH] \{\
9015 . if \\n[#NUMBER_HEAD] \{\
9016 . ie \\n[#NUMBER_SH] \{\
9017 . PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
9020 . PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
9023 . ie \\n[#NUMBER_SH] \{\
9024 . if !\\n[#NUMBERED] \{\
9025 . PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
9029 . if !\\n[#NUMBERED] \{\
9030 . PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
9035 . PRINT "\\$1\h'.6m'\c"
9038 . FAMILY \\*[$DOC_FAM]
9040 . PT_SIZE \\n[#DOC_PT_SIZE]u
9041 . if \\n[#PH_COLOR]=1 \m[]\c
9042 . if \\n[#SLANT_WAS_ON] \{\
9051 \# ====================================================================
9053 \# +++LINE BREAKS+++
9055 \# LINEBREAK CHARACTER
9056 \# -------------------
9058 \# [character] [iterations] [vertical adjustment]
9060 \# Allows user to specify a line break character and the number
9061 \# of times to repeat it horiontally.
9063 \# Without an argument, LINEBREAK_CHAR will deposit a blank line.
9065 \# Vertical adjustment requires a unit of measure (most likely
9066 \# "p"), and has to be preceded by +|-
9068 .MAC LINEBREAK_CHAR END
9070 . ds $LINEBREAK_CHAR \\$1
9071 . ds $LINEBREAK_CHAR_V_ADJ \\$3
9072 . if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
9073 . ds $LINEBREAK_CHAR_V_ADJ +0
9075 . while \\$2>\\n[#REPEAT] \{\
9076 . as $LINEBREAK_CHAR "\\ \\$1
9077 . nr #REPEAT \\n[#REPEAT]+1
9088 \# Deposits line break character.
9090 \# If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
9093 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
9094 . po \\n[#DOC_L_MARGIN]u
9095 . ie '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
9097 . if \\n[#PRINT_STYLE]=1 \{\
9098 . ie \\n[#END_QUOTE] \{ . \}
9099 . el \{ .ALD \\n[#DOC_LEAD]u \}
9101 . if \\n[#PRINT_STYLE]=2 \{\
9102 . ie \\n[#END_QUOTE] \{ . \}
9103 . el \{ .ALD \\n[#DOC_LEAD]u \}
9108 . PRINT \m[\\*[$LINEBREAK_COLOR]]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\m[]
9109 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
9110 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
9112 . QUAD \\*[$DOC_QUAD]
9115 . if r#QUOTE \{ .rr #QUOTE \}
9116 . if r#END_QUOTE \{ .rr #END_QUOTE \}
9120 \# ====================================================================
9127 \# <font of running text>
9129 \# Creates or modifies string $PP_FT.
9131 \# Affects all paragraphs.
9134 . if \\n[#IGNORE] \{ .return \}
9144 \# <amount to indent paragraphs in running text (ipPcm)>
9146 \# Allows user to change the default para indent. The change will
9147 \# affect the indent of QUOTEs and BLOCKQUOTEs as well.
9149 \# Default for printstyle TYPEWRITE is 1/2-inch. Default for
9150 \# printstyle TYPESET is 2 ems. The defaults are set in
9151 \# PRINTSTYLE, not DEFAULTS.
9153 .MAC PARA_INDENT END
9154 . nr #PP_INDENT (\\$1)
9158 \# INDENT FIRST PARAGRAPHS
9159 \# -----------------------
9161 \# <none> | <anything>
9163 \# By default, the first para of a document, as well as the first
9164 \# paras of blockquotes and block-style epigraphs are not indented.
9165 \# When invoked, this macro will indent all paras.
9169 .MAC INDENT_FIRST_PARAS END
9170 . ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
9171 . el \{ .rr #INDENT_FIRST_PARAS \}
9175 \# INTER-PARAGRAPH SPACING
9176 \# -----------------------
9178 \# <none> | <anything>
9180 \# Adds a line space between paragraphs in body text. Block quotes
9183 \# Default is OFF. PARA_SPACE ON is not recommended for use
9184 \# with PRINTSTYLE TYPEWRITE.
9187 . ie '\\$1'' \{ .nr #PP_SPACE 1 \}
9188 . el \{ .rr #PP_SPACE \}
9197 \# Figures out what to do with paragraphs under differing conditions.
9199 \# For the time being, there's no automatic widow/orphan control.
9200 \# Controlling them isn't just a matter of establishing an arbitrary
9201 \# number of lines needed for a para, since groff doesn't then
9202 \# handle single line paragraphs gracefully. Usually, the whole
9203 \# page needs to be tweaked.
9205 \# Note the use of transparent line break (\!.br) to get
9206 \# PP to work within blockquotes and epigraphs.
9208 \# PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
9212 . if \\n[#DOC_TYPE]=4 \{\
9213 . if !'\\n(.z'' \{ .di \}
9214 . nr #TOTAL_FIELDS \\n[#FIELD]
9216 . nr #NUM_FIELDS 0 1
9217 . if \\n[#TOTAL_FIELDS]>0 \{\
9218 . while \\n+[#NUM_FIELDS]<=\\n[#TOTAL_FIELDS] \{\
9220 . LETTERHEAD\\n+[#FIELD]
9221 . QUAD \\*[$DOC_QUAD]
9222 . ALD \\n[#DOC_LEAD]u
9223 . if \\n[#DATE_FIRST]=1 \{ .ALD \\n[#DOC_LEAD]u \}
9225 . rm LETTERHEAD\\n[#FIELD]
9233 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
9234 . if \\n[#PP_STYLE]=1 \{\
9235 . if \\n[#ENDNOTE] \{\
9236 . nr #RESET_PARA_SPACE \\n[#PP_SPACE]
9237 . ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
9238 . el \{ .PARA_SPACE OFF \}
9241 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
9242 . if \\n[#COLUMNS] \{\
9243 . if !\\n[#ENDNOTE] \{\
9244 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9245 . nr #L_MARGIN \\n(.o
9248 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9249 . ie \\n[#PRINT_STYLE]=1 \{\
9251 . ie \\n[#ENDNOTE] \{ .vs \\n[#EN_LEAD]u \}
9252 . el \{ .vs \\n[#DOC_LEAD]u \}
9253 . QUAD \\*[$DOC_QUAD]
9255 . if \\n[#SLANT_ON] \{\
9256 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
9260 . ie \\n[#ENDNOTE] \{\
9261 . FAMILY \\*[$EN_FAM]
9263 . PT_SIZE \\n[#EN_PS]u
9265 . QUAD \\*[$EN_QUAD]
9268 . FAMILY \\*[$DOC_FAM]
9270 . PT_SIZE \\n[#DOC_PT_SIZE]u
9271 . LS \\n[#DOC_LEAD]u
9272 . QUAD \\*[$DOC_QUAD]
9276 . if \\n[#INDENT_FIRST_PARAS] \{\
9277 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
9278 . el \{ .ti \\n[#PP_INDENT]u \}
9279 . if '\\n(.z'END_NOTES' \{\
9280 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
9283 . if r#END_QUOTE \{\
9284 . if \\n[#END_QUOTE] \{\
9285 . if !\\n[#LINEBREAK] \{\
9286 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
9287 . el \{ .ti \\n[#PP_INDENT]u \}
9288 . if '\\n(.z'END_NOTES' \{\
9289 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
9297 . if \\n[#PP_SPACE] \{\
9298 . if \\n[#PRINT_STYLE]=2 \{\
9299 . ie \\n[#END_QUOTE] \{\
9300 . ALD \\n[#DOC_LEAD]u
9303 . nr #BASELINE_MARK \\n(nl
9306 . if \\n[#NO_SPACE]=1 \{\
9309 . if !\\n(nl=\\n[#BASELINE_MARK] \{\
9310 . ALD \\n[#DOC_LEAD]u
9316 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
9317 . el \{ .ti \\n[#PP_INDENT]u \}
9318 . if '\\n(.z'END_NOTES' \{\
9319 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
9322 . if r#START \{ .rr #START \}
9323 . if r#QUOTE \{ .rr #QUOTE \}
9324 . if r#END_QUOTE \{ .rr #END_QUOTE \}
9325 . if r#HEAD \{ .rr #HEAD \}
9326 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
9327 . if r#Q_FITS \{ .rr #Q_FITS \}
9328 . if r#LINEBREAK \{ .rr #LINEBREAK \}
9329 . if \\n[#ENDNOTE] \{\
9330 . ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
9331 . el \{ .PARA_SPACE OFF \}
9333 . if \\n[#CONDENSE] \{\
9336 . if \\n[#EXTEND]=1 \{\
9341 . if \\n[#PP_STYLE]=2 \{\
9343 . if \\n[#BROKEN_QUOTE] \{\
9344 . ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
9345 . el \{ .nr #Q_PP 0 \}
9348 . ie \\n[#Q_PP]=0 \{\
9349 . if \\n[#INDENT_FIRST_PARAS] \{\
9350 . ti \\n[#PP_INDENT]u/2u
9352 . if \\n[#ENDNOTE] \{\
9353 . ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
9358 . ti \\n[#PP_INDENT]u/2u
9360 . if \\n[#CONDENSE] \{\
9363 . if \\n[#EXTEND]=1 \{\
9371 \# ====================================================================
9375 \# ---Line for line quotes, i.e. poetry or code snippets---
9380 \# <none> | <anything>
9382 \# Creates or modifies register #UNDERLINE_QUOTES (toggle).
9383 \# If on, line for line quotes are underlined when printstyle
9386 \# Default is ON for printstyle TYPEWRITE.
9388 .MAC UNDERLINE_QUOTES END
9389 . ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
9390 . el \{ .rr #UNDERLINE_QUOTES \}
9397 \# <value by which to multiply PP_INDENT for indented quoted text>
9399 \# Creates or modifies register #Q_OFFSET_VALUE.
9401 \# Default is 3 for typeset; 2 for typewrite
9403 .MAC QUOTE_INDENT END
9404 . nr #Q_OFFSET_VALUE \\$1
9413 \# Sets autolead for quotes and/or blockquotes.
9415 .MAC QUOTE_AUTOLEAD END
9416 . if '\\$0'QUOTE_AUTOLEAD' \{ .nr #Q_AUTOLEAD \\$1 \}
9417 . if '\\$0'BLOCKQUOTE_AUTOLEAD' \{ .nr #BQ_AUTOLEAD \\$1 \}
9418 . if '\\$0'ENDNOTE_QUOTE_AUTOLEAD' \{ .nr #EN_Q_AUTOLEAD \\$1 \}
9419 . if '\\$0'ENDNOTE_BLOCKQUOTE_AUTOLEAD' \{ .nr #EN_BQ_AUTOLEAD \\$1 \}
9422 .ALIAS BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
9423 .ALIAS ENDNOTE_QUOTE_AUTOLEAD QUOTE_AUTOLEAD
9424 .ALIAS ENDNOTE_BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
9426 \# ALWAYS FULLSPACE QUOTES
9427 \# -----------------------
9429 \# <none> | <anything>
9431 \# Toggles register #FULLSPACE_QUOTES.
9433 \# If user doesn't like the default 1/2 line space above and below
9434 \# quotes, s/he can turn it off here. Has no effect in TYPEWRITE.
9436 .MAC ALWAYS_FULLSPACE_QUOTES END
9437 . if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
9438 . el \{ .rr #FULLSPACE_QUOTES \}
9445 \# <none> | <anything>
9447 \# Indents quoted text on a line for line basis, or turns QUOTE off.
9449 \# Owing to the need to bottom align TYPESET pages, quoted text gets
9450 \# diverted so its depth can be measured (in DO_QUOTE) for determining
9451 \# how much space to put before and after.
9455 . if \\n[#LINENUMBERS]=1 \{\
9457 . nr #NEXT_LN \\n(ln
9462 . if \\n[#LINENUMBERS]=2 \{\
9463 . if \\n[#SILENT_QUOTE_LN]=1 \{ .nm \\n[#NEXT_LN] 1000 -4 \}
9468 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
9469 . if \\n[#LINENUMBERS]=2 \{\
9470 . if \\n[#QUOTE_LN]=1 \{\
9471 . nm \\n(ln "" \\*[$Q_LN_GUTTER] -3-\\*[$Q_LN_GUTTER]
9475 . if \\n[#COLUMNS] \{\
9476 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
9479 . if \\n[#PRINT_STYLE]=1 \{\
9481 . vs \\n[#DOC_LEAD]u
9484 . if \\n[#PRINT_STYLE]=2 \{\
9485 . FAMILY \\*[$QUOTE_FAM]
9487 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
9488 . ie !r#Q_AUTOLEAD \{ .LS \\n[#Q_LEAD]u \}
9490 . AUTOLEAD \\n[#Q_AUTOLEAD]
9493 . if \\n[#ENDNOTE] \{\
9494 . PT_SIZE \\n[#EN_PS]u\\*[$QUOTE_SIZE_CHANGE]
9495 . ie !r#EN_Q_AUTOLEAD \{ .LS \\n[#EN_Q_LEAD]u \}
9497 . AUTOLEAD \\n[#EN_Q_AUTOLEAD]
9498 . nr #EN_Q_LEAD \\n(.v
9501 . nr #Q_LEAD_REAL \\n(.v
9503 . if \\n[#QUOTE_COLOR]=1 \{\
9505 \m[\\*[$QUOTE_COLOR]]
9509 . if \\n[#LINENUMBERS]=2 \{\
9510 . ie \\n[#QUOTE_LN]=1 \{\
9511 . if '\\*[$Q_LN_GUTTER]'' .ds $Q_LN_GUTTER \\*[$LN_GUTTER]
9512 . nm \\n(ln "" \\*[$Q_LN_GUTTER] -3-\\*[$Q_LN_GUTTER]
9515 . if !\\n[#SILENT_QUOTE_LN] \{ .NUMBER_LINES OFF \}
9519 . if \\n[#PRINT_STYLE]=1 \{\
9520 . if \\n[#UNDERLINE_QUOTES] \{\
9525 . el \{ .DO_QUOTE \}
9528 \# ---Blockquotes---
9533 \# <none> | <anything>
9535 \# Indents quoted text in fill mode and shortens line length
9536 \# equivalently, or turns BLOCKQUOTE off.
9538 \# Owing to the need to bottom align TYPESET pages, quoted text gets
9539 \# diverted so its depth can be measured (in DO_QUOTE) for determining
9540 \# how much space to put before and after.
9542 \# .PP after blockquote is optional if there's only one para,
9543 \# but REQUIRED if there's more than one.
9547 . if \\n[#LINENUMBERS]=1 \{\
9549 . nr #NEXT_LN \\n(ln
9554 . if \\n[#LINENUMBERS]=2 \{\
9555 . if \\n[#SILENT_BQUOTE_LN]=1 \{ .nm \\n[#NEXT_LN] 1000 -4 \}
9562 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9563 . if \\n[#ENDNOTE] \{\
9564 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
9565 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9567 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
9568 . ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9573 . if \\n[#COLUMNS] \{\
9574 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9575 . if \\n[#ENDNOTE] \{\
9576 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
9577 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9579 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
9580 . ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
9585 . if \\n[#PRINT_STYLE]=1 \{\
9587 . vs \\n[#DOC_LEAD]u
9591 . if \\n[#PRINT_STYLE]=2 \{\
9592 . FAMILY \\*[$BQUOTE_FAM]
9593 . FT \\*[$BQUOTE_FT]
9594 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
9595 . ie !\\n[#BQ_AUTOLEAD] \{ .LS \\n[#BQ_LEAD]u \}
9597 . AUTOLEAD \\n[#BQ_AUTOLEAD]
9598 . nr #BQ_LEAD \\n(.v
9600 . if \\n[#ENDNOTE] \{\
9601 . PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
9602 . ie !r#EN_BQ_AUTOLEAD \{ .LS \\n[#EN_BQ_LEAD]u \}
9604 . AUTOLEAD \\n[#EN_BQ_AUTOLEAD]
9605 . nr #EN_BQ_LEAD \\n(.v
9608 . nr #Q_LEAD_REAL \\n(.v
9609 . if \\n[#BQUOTE_COLOR]=1 \{\
9611 \m[\\*[$BQUOTE_COLOR]]
9614 . QUAD \\*[$BQUOTE_QUAD]
9615 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
9616 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
9619 . if \\n[#LINENUMBERS]=2 \{\
9620 . ie \\n[#BQUOTE_LN]=1 \{\
9621 . if '\\*[$BQ_LN_GUTTER]'' .ds $BQ_LN_GUTTER \\*[$LN_GUTTER]
9622 . nm \\n(ln "" \\*[$BQ_LN_GUTTER] -3-\\*[$BQ_LN_GUTTER]
9625 . if !\\n[#SILENT_BQUOTE_LN] \{ .NUMBER_LINES OFF \}
9629 . if \\n[#INDENT_FIRST_PARAS] \{\
9630 . ie !\\n[#ENDNOTE] \{\
9631 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
9632 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
9635 . if \\n[#INDENT_FIRSTS]=1 \{\
9636 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
9637 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
9642 . el \{ .DO_QUOTE \}
9651 \# Ends the diversion P_QUOTE or B_QUOTE. Spaces them according to
9652 \# PRINTSTYLE, whether there's inter-paragraph spacing, and page
9653 \# position. TYPEWRITE treats spacing the same way in all circumstance
9654 \# (viz. an extra line space). TYPESET puts in only half
9655 \# line spaces if the entire quote plus 1 line of body under the quote
9656 \# fits on the the page; otherwise it puts in a full extra blank
9657 \# line. (This is to ensure the page remains bottom aligned).
9661 . if \\n[#DIVER_LN_OFF] \{\
9662 \!. NUMBER_LINES OFF
9667 . if \\n[#RESET_FN_COUNTERS]=2 \{\
9668 . if !\\n[#FN_COUNT]=1 \{\
9669 . if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
9671 . rr #RESET_FN_COUNTERS
9675 . nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
9679 . nr #Q_DEPTH (\\n[#DIVER_DEPTH]-\\n[#Q_LEAD_REAL])+\\n[#LEAD]
9680 . nr #Q_LEAD_DIFF \\n[#LEAD]-\\n[#Q_LEAD_REAL]
9684 . nr #CURRENT_V_POS \\n(nl+\\n[#Q_LEAD_DIFF]+(\\n[#DIVER_DEPTH]-\\n[#Q_DEPTH_REAL])
9687 . nr #Q_SPACE_ADJ \\n[#SHIM]/2
9689 . if \\n[#ENDNOTE] \{\
9690 . nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
9691 . ALWAYS_FULLSPACE_QUOTES
9693 . if \\n[#PRINT_STYLE]=1 \{\
9694 . if \\n[#START]=1 \{ . \}
9695 . if \\n[#START]=0 \{\
9696 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
9699 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
9702 . if \\n[#PRINT_STYLE]=2 \{\
9703 . ie \\n[#PP_SPACE] \{\
9704 . ie \\n[#HEAD]>0 \{ . \}
9706 . ie \\n[#START] \{ . \}
9707 . el \{ .ALD \\n[#DOC_LEAD]u \}
9711 . ie \\n[#Q_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
9712 . ie (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_DEPTH]<\\n[#DOC_LEAD] \{\
9724 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9725 . if \\n[#COLUMNS] \{\
9726 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9728 . if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
9729 . if \\n[#ENDNOTE] \{\
9730 . in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
9732 . ie \\n[#START]=1 \{\
9733 . ie !\\n[#Q_LEAD_DIFF]<0 \{ .ALD \\n[#Q_SPACE_ADJ]u \}
9734 . el \{ .RLD 0-\\n[#Q_LEAD_DIFF]u \}
9737 . ALD \\n[#Q_SPACE_ADJ]u
9739 . if \\n[#QUOTE]=1 \{\
9742 . if !\\n[#START] \{ .rr #QUOTE \}
9744 . if \\n[#QUOTE]=2 \{\
9748 . if \\n[#PRINT_STYLE]=1 \{\
9749 . ALD \\n[#DOC_LEAD]u
9751 . if \\n[#PRINT_STYLE]=2 \{\
9752 . ie \\n[#START] \{\
9753 . ie \\n[#PP_SPACE] \{\
9757 . ALD \\n[#DOC_LEAD]u
9762 . ie \\n[#PP_SPACE] \{ . \}
9764 . ie \\n[#HEAD]=1 \{\
9765 . ALD \\n[#DOC_LEAD]u
9769 . ie \\n[#FULLSPACE_QUOTES] \{\
9770 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
9771 . el \{ .ALD \\n[#DOC_LEAD]u \}
9773 . el \{ .ALD (\\n[#DOC_LEAD]u/2u) \}
9774 . ie \\n[#Q_FITS] \{\
9775 . ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
9783 .\" Make sure that Q_LEAD_DIFF is not added to the first line of
9784 .\" normal text at the top of any page following output of a quote
9785 .\" whose last line falls on B_MARGIN of the previous page.
9786 . if \\n(nl=(\\n[#T_MARGIN]-\\n[#DOC_LEAD]+\\n[#Q_LEAD_DIFF]) \{\
9789 . sp -1v-\\n[#Q_LEAD_DIFF]u
9796 . if \\n[#LINENUMBERS]=2 \{\
9798 . ie \\n[#RESTORE_LN_NUM]=1 \{ .nm \\n[#NEXT_LN] \}
9801 . if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
9802 . if r#HEAD \{ .rr #HEAD \}
9803 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
9808 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
9809 . if \\n[#ENDNOTE] \{\
9810 . in \\n[#EN_TEXT_INDENT]u
9812 . if \\n[#COLUMNS] \{\
9813 . if !\\n[#ENDNOTE] \{\
9814 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9815 . nr #L_MARGIN \\n(.o
9817 . if \\n[#ENDNOTE] \{\
9818 . in \\n[#EN_TEXT_INDENT]u
9821 . ie !\\n[#ENDNOTE] \{\
9822 . nr #RESET_PP_INDENT \\n[#PP_INDENT]
9825 . PARA_INDENT \\n[#RESET_PP_INDENT]u
9826 . QUAD \\*[$DOC_QUAD]
9829 . nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
9830 . ENDNOTE_PARA_INDENT 0
9832 . ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
9835 . if r#DELAY_SHIM \{\
9842 \# Utility macros for DO_QUOTE
9843 \# ---------------------------
9847 . ie \\n[#HEAD]=1 \{\
9848 . ALD \\n[#Q_LEAD_DIFF]u
9851 . ie \\n[#START] \{ . \}
9853 . ie \\n[#FULLSPACE_QUOTES] \{\
9854 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
9855 . el \{ .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
9858 .\" This seems to be the only way to get the baseline of quotes that start
9859 .\" at the top of the page to fall on the first line of the "grid" (i.e on
9860 .\" the first legal baseline of the page).
9861 . ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
9862 . if \\n[#QUOTE]=1 \{\
9867 . sp -1v+\\n[#Q_LEAD_DIFF]u
9871 . if \\n[#QUOTE]=2 \{\
9876 . sp -1v+\\n[#Q_LEAD_DIFF]u
9883 . ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_LEAD_DIFF]u
9887 . if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
9894 . if \\n[#HEAD]=1 \{ . \}
9897 . ie \\n[#FULLSPACE_QUOTES] \{\
9898 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
9899 . el \{ .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
9901 . el \{ .ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_LEAD_DIFF]u \}
9902 . nr #Q_PARTIAL_DEPTH 0 \\n[#Q_LEAD_REAL]
9903 . while \\n+[#Q_PARTIAL_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
9906 . nr #Q_PARTIAL_DEPTH -\\n[#Q_LEAD_REAL]
9907 . nr #Q_SPACE_ADJ (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_PARTIAL_DEPTH]+\\n[#Q_LEAD_DIFF]u
9908 .\" Hack to deal with the fact that even though the above routine
9909 .\" makes the bottom line of the quote fall exactly on the bottom
9910 .\" margin when traps are disabled, it refuses to do so when traps
9911 .\" are on. The difference by which it's off is #Q_LEAD_DIFF
9912 .\" (the +\\n[#Q_LEAD_DIFF] at the end of the line, above). Hack
9913 .\" solution: temporarily lower the FOOTER trap position.
9914 . nr #SAVED_FOOTER_POS \\n[#VARIABLE_FOOTER_POS]
9915 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+.25v
9919 \# ====================================================================
9926 \# Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
9927 \# page, and reinvokes BLOCKQUOTE.
9929 \# Because quotes go into a diversion before they're output,
9930 \# footnotes in quotes that cross pages behave erratically. The footnote
9931 \# isn't processed until the diversion ends, hence the footnote
9932 \# marker in the quote isn't always correct for the new page (it's
9933 \# picked up from the old one). BREAK_QUOTE is a workaround for
9936 .MAC BREAK_QUOTE END
9939 . nr #BROKEN_QUOTE 1
9942 . nr #Q_DEPTH \\n[#DIVER_DEPTH]+\\n[#LEAD]
9943 . if \\n[#PRINT_STYLE]=1 \{\
9944 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
9946 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
9949 . if \\n[#PRINT_STYLE]=2 \{\
9950 . ie \\n[#PP_SPACE] \{\
9951 . ie \\n[#HEAD]=1 \{ . \}
9953 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
9959 . if \\n[#HEAD]=1 \{ . \}
9961 . el \{ .ALD \\n[#DOC_LEAD]u \}
9964 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9965 . if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
9966 . po \\n[#Q_OFFSET]u
9967 . if \\n[#QUOTE]=1 \{\
9971 . if \\n[#QUOTE]=2 \{\
9975 . if r#HEAD \{ .rr #HEAD \}
9976 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
9981 . if \\n[#PRINT_STYLE]=1 \{\
9982 . if \\n[#UNDERLINE_QUOTES] \{\
9986 . po \\n[#L_MARGIN]u
9987 . if \\n[#COLUMNS] \{\
9988 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9989 . nr #L_MARGIN \\n(.o
9991 . QUAD \\*[$DOC_QUAD]
9992 . sp |\\n[#PAGE_LENGTH]u \" To trip footer/header
9996 \# ====================================================================
10003 \# <none> | <anything>
10005 \# Turns page numbering off or on during document processing.
10010 . ie '\\$1'' \{ .nr #PAGINATE 1 \}
10011 . el \{ .nr #PAGINATE 0 \}
10015 \# SUSPEND PAGINATION (before ENDNOTES)
10016 \# ------------------
10020 \# Creates register #SUSPEND_PAGINATION
10022 \# Useful only to suspend pagination before outputting endnotes.
10024 .MAC SUSPEND_PAGINATION END
10025 . nr #SUSPEND_PAGINATION 1
10028 \# RESTORE PAGINATION (after ENDNOTES)
10029 \# ------------------
10033 \# Removes register #SUSPEND_PAGINATION. Creates register
10034 \# #DEFER_PAGINATION
10036 \# Useful only to restore pagination after outputting endnotes.
10038 .MAC RESTORE_PAGINATION END
10039 . rr #SUSPEND_PAGINATION
10040 . if \\n[#PAGE_NUM_V_POS]=1 \{ .PAGINATE \}
10041 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #DEFER_PAGINATION 1 \}
10045 \# PAGE NUMBER FORMAT
10046 \# ------------------
10048 \# DIGIT | ROMAN | roman | ALPHA | alpha
10050 \# Assigns user entered format to #PAGENUMBER.
10052 .MAC PAGENUM_STYLE END
10053 . nr #PAGENUM_STYLE_SET 1
10054 . if '\\$1'DIGIT' \{\
10055 . ds $PAGENUM_STYLE \\$1
10058 . if '\\$1'ROMAN' \{\
10059 . ds $PAGENUM_STYLE \\$1
10062 . if '\\$1'roman' \{\
10063 . ds $PAGENUM_STYLE \\$1
10066 . if '\\$1'ALPHA' \{\
10067 . ds $PAGENUM_STYLE \\$1
10070 . if '\\$1'alpha' \{\
10071 . ds $PAGENUM_STYLE \\$1
10077 \# HYPHENS AROUND PAGE NUMBERS
10078 \# ---------------------------
10080 \# <none> | <anything>
10082 \# Creates or modifies register #PAGE_NUM_HYPHENS.
10083 \# Used to dis/enable hyphens on either side of page numbers.
10087 .MAC PAGENUM_HYPHENS END
10088 . nr #PAGE_NUM_HYPHENS_SET 1
10089 . ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
10090 . el \{ .rr #PAGE_NUM_HYPHENS \}
10094 \# PAGENUMBER POSITION
10095 \# -------------------
10097 \# TOP | BOTTOM LEFT | CENTER | RIGHT
10099 \# Creates or modifies various PAGE_NUM_H | V_POS registers.
10100 \# Used to position page numbers.
10102 \# Default is center/bottom.
10104 .MAC PAGENUM_POS END
10105 . nr #PAGE_NUM_POS_SET 1
10106 . if '\\$1'TOP' \{ .nr #PAGE_NUM_V_POS 1 \}
10107 . if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
10108 . if '\\$2'LEFT' \{ .nr #PAGE_NUM_H_POS 1 \}
10109 . if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
10110 . if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
10111 . if '\\$2'RIGHT' \{ .nr #PAGE_NUM_H_POS 3 \}
10115 .MAC PN_WITH_HYPHENS END
10116 . nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
10117 . ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
10118 . PRINT \m[\\*[$PAGENUM_COLOR]]\\*[$HYPHEN]\|\\n[#PAGENUMBER]\|\\*[$HYPHEN]
10123 \# PRINT PAGE NUMBER
10124 \# -----------------
10128 \# Prints page number if PAGINATE=1.
10130 .MAC PRINT_PAGE_NUMBER END
10134 . po \\n[#DOC_L_MARGIN]u
10135 . ll \\n[#DOC_L_LENGTH]u
10137 . FAMILY \\*[$PAGE_NUM_FAM]
10138 . FT \\*[$PAGE_NUM_FT]
10139 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
10140 . if \\n[#PRINT_STYLE]=1 \{\
10143 . if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
10145 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
10149 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
10152 . if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
10153 . if \\n[#RECTO_VERSO]=0 \{\
10154 . if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
10155 . if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
10156 . if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT \}
10158 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
10159 . if \\n[#EN_FIRST_PAGE] \{\
10160 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
10161 . rr #EN_FIRST_PAGE
10163 . if \\n[#BIB_FIRST_PAGE] \{\
10164 . if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN] \}
10165 . rr #BIB_FIRST_PAGE
10167 . if \\n[#TOC_FIRST_PAGE] \{\
10169 . rr #TOC_FIRST_PAGE
10171 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
10172 . ie '\\*[$REVISION]'' \{\
10173 . PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT] / \\n[#PAGENUMBER]"
10176 . ie '\\*[$DRAFT]'' \{\
10177 . PRINT "\\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
10180 . PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT], \\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
10185 . ie \\n[#PAGE_NUM_HYPHENS] \{\
10186 . if '\\*[$PAGENUM_STYLE]'DIGIT' \{\
10188 1\\R'#CAP_HEIGHT \\n[.cht]'
10192 . if '\\*[$PAGENUM_STYLE]'ROMAN' \{\
10194 I\\R'#CAP_HEIGHT \\n[.cht]'
10198 . if '\\*[$PAGENUM_STYLE]'ALPHA' \{\
10200 E\\R'#CAP_HEIGHT \\n[.cht]'
10204 . if '\\*[$PAGENUM_STYLE]'roman' \{\
10205 . PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
10207 . if '\\*[$PAGENUM_STYLE]'alpha' \{\
10208 . PRINT "\m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-"
10211 . el \{ .PRINT "\m[\\*[$PAGENUM_COLOR]]\\n[#PAGENUMBER]" \}
10216 \# ====================================================================
10221 Mom's footnote handling is baroque, to say the least. There are
10222 redundancies in a number of the macros involved, as well as some
10223 registers that probably don't get used anymore. The baggage is left
10224 in in case some new footnote oddity/challenge gets thrown my way.
10226 The macros are heavily commented.
10229 \# FOOTNOTE AUTOLEAD
10230 \# -----------------
10232 \# <autolead value for footnotes>
10234 \# Creates or modifies register #FN_AUTOLEAD.
10236 \# Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
10238 .MAC FOOTNOTE_AUTOLEAD END
10239 . nr #FN_AUTOLEAD \\$1
10243 \# FOOTNOTE MARKERS
10244 \# ----------------
10246 \# <none> | <anything>
10248 \# Turns generation of footnote markers on or off.
10252 .MAC FOOTNOTE_MARKERS END
10253 . ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
10254 . el \{ .nr #FN_MARKERS 0 \}
10258 \# FOOTNOTE MARKER STYLE
10259 \# ---------------------
10261 \# STAR | NUMBER | LINE
10263 \# Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
10264 \# the style of footnote markers.
10266 \# 1=STAR; 2=NUMBER; 3=LINE. LINE means "use output line numbers".
10267 \# Default is STAR.
10269 .MAC FOOTNOTE_MARKER_STYLE END
10270 . if '\\$1'STAR' \{\
10271 . if \\n[#FN_MARKER_STYLE]=3 \{\
10272 . if !\\n[#NEWPAGE]=1 \{\
10273 . tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is LINE.
10274 . tm1 " You cannot change footnote marker style without
10275 . tm1 " first breaking to a new page with NEWPAGE.
10276 . tm1 " Ignoring request FOOTNOTE_MARKER_STYLE STAR at line \\n(.c.
10280 . if \\n[#RUN_ON]=1 \{\
10281 . tm1 "[mom]: FOOTNOTE_MARKER_STYLE STAR at line \\n(.c is incompatible
10282 . tm1 " with RUN_ON footnotes. Ignoring request.
10285 . nr #FN_MARKER_STYLE 1
10286 . if \\n[#NEWPAGE]=1 \{ .rr #NEWPAGE \}
10289 . if '\\$1'NUMBER' \{\
10290 . if \\n[#FN_MARKER_STYLE]=3 \{\
10291 . if !\\n[#NEWPAGE]=1 \{\
10292 . tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is NUMBER.
10293 . tm1 " You cannot change footnote marker style without
10294 . tm1 " first breaking to a new page with NEWPAGE.
10295 . tm1 " Ignoring request FOOTNOTE_MARKER_STYLE NUMBER at line \\n(.c.
10299 . if \\n[#RUN_ON]=1 \{\
10300 . tm1 "[mom]: FOOTNOTE_MARKER_STYLE NUMBER at line \\n(.c is incompatible
10301 . tm1 " with RUN_ON footnotes. Ignoring request.
10304 . nr #FN_MARKER_STYLE 2
10305 . if \\n[#NEWPAGE]=1 \{ .rr #NEWPAGE \}
10308 . if '\\$1'LINE' \{\
10309 . nr #FN_MARKER_STYLE 3
10310 . FOOTNOTE_MARKERS OFF
10311 . if !\\n[#FN_LN_SEP] \{\
10312 . if !\\n[#FN_LN_BRACKETS] \{ .FOOTNOTE_LINENUMBER_BRACKETS SQUARE \}
10318 \# FOOTNOTE LINENUMBER MARK
10319 \# ------------------------
10321 \# This string, when called inline, stores the current output line
10322 \# number in register #FN_MARK for use with FOOTNOTE.
10324 .ds FN-MARK \R'#FN_MARK \En(ln'
10327 \# FOOTNOTE LINENUMBER SEPARATOR
10328 \# -----------------------------
10330 \# <user-defined separator>
10332 \# Stores user-defined separator (for use then
10333 \# FOOTNOTE_MARKER_STYLE is LINE) in string $FN_LN_SEP. The
10334 \# separator is intended to be used when the user wishes a
10335 \# separator, rather than the choice of brackets offered by
10336 \# FOOTNOTE_LINENUMBER_BRACKETS.
10338 .MAC FOOTNOTE_LINENUMBER_SEPARATOR END
10339 . rr #FN_LN_BRACKETS
10341 . ds $FN_LN_SEP "\\$1
10345 \# FOOTNOTE LINENUMBER BRACKETS
10346 \# ----------------------------
10348 \# PARENS | SQUARE | BRACES or ( | [ | {
10350 \# Sets register #FN_LN_BRACKETS to 1, and creates strings
10351 \# $FN_OPEN_BRACKET and $FN_CLOSE_BRACKET according to the given
10354 .MAC FOOTNOTE_LINENUMBER_BRACKETS END
10356 . nr #FN_LN_BRACKETS 1
10357 . if '\\$1'PARENS' \{\
10358 . ds $FN_OPEN_BRACKET (
10359 . ds $FN_CLOSE_BRACKET )
10362 . ds $FN_OPEN_BRACKET (
10363 . ds $FN_CLOSE_BRACKET )
10365 . if '\\$1'SQUARE' \{\
10366 . ds $FN_OPEN_BRACKET [
10367 . ds $FN_CLOSE_BRACKET ]
10370 . ds $FN_OPEN_BRACKET [
10371 . ds $FN_CLOSE_BRACKET ]
10373 . if '\\$1'BRACES' \{\
10374 . ds $FN_OPEN_BRACKET {
10375 . ds $FN_CLOSE_BRACKET }
10378 . ds $FN_OPEN_BRACKET {
10379 . ds $FN_CLOSE_BRACKET }
10384 \# RESET FOOTNOTE NUMBER
10385 \# ---------------------
10389 \# Resets register #FN_NUMBER to 1. If argument is PAGE, creates
10390 \# toggle #RESET_FN_NUMBER which is checked in HEADER. If 1,
10391 \# numbered footnotes on every page start at 1.
10393 .MAC RESET_FOOTNOTE_NUMBER END
10394 . ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
10395 . el \{ .nr #RESET_FN_NUMBER 1 \}
10399 \# FOOTNOTE RULE LENGTH
10400 \# --------------------
10402 \# <length of rule used to separate footnotes from running text>
10404 \# Creates or modifies registers #FN_RULE_LENGTH.
10406 \# Requires unit of measure (iPpcm).
10407 \# Default is 4P for both PRINTSTYLEs.
10409 .MAC FOOTNOTE_RULE_LENGTH END
10410 . nr #FN_RULE_LENGTH (\\$1)
10414 \# FOOTNOTE_RULE_ADJ
10415 \# -----------------
10417 \# <number of points to raise footnote rule from it's baseline position>
10419 \# Creates or modifies register #FN_RULE_ADJ.
10421 \# Default is 3p for both TYPESTYLES.
10423 \# Requires unit of measure.
10425 .MAC FOOTNOTE_RULE_ADJ END
10426 . nr #FN_RULE_ADJ (\\$1)
10433 \# <none> | <anything>
10435 \# Turns printing of footnote separator rule on or off. If invoked as
10436 \# PRINT_FOOTNOTE_RULE, prints footnote separator rule.
10440 \# Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
10441 \# if the footnote number (#FN_COUNT) is 1.
10443 .MAC FOOTNOTE_RULE END
10444 . ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
10445 . if \\n[#FN_RULE]=0 \{ .RLD 1v \}
10449 . PRINT \v'-\\n[#FN_RULE_ADJ]u'\l'\\n[#FN_RULE_LENGTH]u'\v'+\\n[#FN_RULE_ADJ]u'
10450 \!. PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
10451 . QUAD \\*[$FN_QUAD]
10454 . ie '\\$1'' \{ .nr #FN_RULE 1 \}
10455 . el \{ .nr #FN_RULE 0 \}
10460 \# FOOTNOTE SPACING
10461 \# ----------------
10463 \# <per item post footnote spacing> | <anything>
10465 \# Enables printing of post footnote spacing.
10467 \# Default is no space.
10469 .MAC FOOTNOTE_SPACING END
10470 . ie \B'\\$1' \{ .nr #FN_SPACE (\\$1) \}
10471 . el \{ .nr #FN_SPACE 0 \}
10475 \# RUN ON FOOTNOTES
10476 \# ----------------
10478 \# <none> | <anything>
10480 \# Toggles run-on footnotes on or off.
10482 .MAC FOOTNOTES_RUN_ON END
10484 . if \\n[#FN_COUNT]>0 \{\
10485 . tm1 "[mom]: Switching to run-on footnotes at line \\n(.c will cause
10486 . tm1 " you to loose footnotes already formatted for this page.
10487 . tm1 " Ignoring request FOOTNOTES_RUN_ON.
10492 . if \\n[#FN_MARKER_STYLE]=1 \{ .RUNON_WARNING \}
10493 . if \\n[#FN_MARKER_STYLE]=2 \{ .RUNON_WARNING \}
10496 . if \\n[#FN_COUNT]>0 \{\
10497 . if \\n[#RUN_ON]=1 \{\
10498 . tm1 "[mom]: Switching off run-on footnotes at line \\n(.c will cause
10499 . tm1 " you to loose footnotes already formatted for this page.
10500 . tm1 " Ignoring request FOOTNOTES_RUN_ON \\$1.
10509 .MAC RUNON_WARNING END
10510 . if \\n[#FN_MARKER_STYLE]=1 \{\
10511 . tm1 "[mom]: The footnote marker style active at line \\n(.c is STAR,
10512 . tm1 " which is incompatible with run-on footnotes. Please change
10513 . tm1 " the footnote marker style to LINE. Continuing to process,
10514 . tm1 " but ignoring request FOOTNOTES_RUN_ON.
10517 . if \\n[#FN_MARKER_STYLE]=2 \{\
10518 . tm1 "[mom]: The footnote marker style active at line \\n(.c is NUMBER,
10519 . tm1 " which is incompatible with run-on footnotes. Please change
10520 . tm1 " the footnote marker style to LINE. Continuing to process,
10521 . tm1 " but ignoring request FOOTNOTES_RUN_ON.
10529 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value> | <anything>
10531 \# Begins collecting and diverting footnote text if no argument
10532 \# given. Otherwise, ends diversion FOOTNOTES, measures footnote
10533 \# depth, and sets footnote trap.
10535 \# The input line preceding a footnote call MUST terminate with \c
10536 \# or the footnote marker will be spaced away from the word it
10537 \# should be joined to.
10539 \# If FOOTNOTE is invoked with INDENT, the footnote will
10540 \# be indented. An indent style and an indent value must be given.
10541 \# Subsequent footnotes will NOT be indented; INDENT must be given
10542 \# for each footnote the user wants indented.
10545 . if !\\n(.u \{ .nr #ADD_BREAK 1 \}
10547 . if \\n[#FN_MARKER_STYLE]=3 \{\
10548 . if !\\n[#LINENUMBERS] \{\
10549 . tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
10550 . tm1 " FOOTNOTE_MARKER_STYLE is LINE.
10551 . ab Aborting on FOOTNOTE at line \\n(.c.
10553 . if \\n[#FN_MARK]=0 \{ .nr #FN_MARK \\n(ln \}
10554 . nr #FN_MARK_2 \\n(ln
10555 . if '\\n(.z'P_QUOTE' \{\
10559 . if \\n[#IN_DIVER]=1 \{\
10560 . if '\\n(.z'P_QUOTE' \{\
10561 . if !\\n[#QUOTE_LN]=1 \{\
10562 . if !\\n[#SILENT_QUOTE_LN]=1 \{\
10563 . tm1 "[mom]: You have requested a line-numbered footnote inside a
10564 . tm1 " QUOTE at line \\n(.c, but line-numbering has not been enabled
10565 . tm1 " for QUOTES. Printing footnote with label "0".
10571 . if '\\n(.z'B_QUOTE' \{\
10572 . if !\\n[#BQUOTE_LN]=1 \{\
10573 . if !\\n[#SILENT_BQUOTE_LN]=1 \{\
10574 . tm1 "[mom]: You have requested a line-numbered footnote inside a
10575 . tm1 " BLOCKQUOTE at line \\n(.c, but line-numbering has not been enabled
10576 . tm1 " for BLOCKQUOTES. Printing footnote with label "0".
10584 .\" Begin processing footnotes that occur inside QUOTE, BLOCKQUOTE
10586 . if \\n[#IN_DIVER]=1 \{\
10587 . nr #PAGE_POS \\n(nl+\\n(.d+\\n[#DOC_LEAD]
10588 . nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS]-1)
10589 . nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
10590 .\" Are we on a "defer" line? If so, defer the text of the footnote.
10591 . ie \\n[#SPACE_TO_FOOTER]=\\n[#DOC_LEAD]:\\n[#SPACE_TO_FOOTER]=0 \{\
10592 . nr #DIVER_FN 2 \" treat like a normal deferred footnote
10595 . nr #DIVER_FN 2 \" treat like a normal footnote
10597 . if \\n[#PAGE_POS]>\\n[#FOOTER_POS] \{\
10598 . nr #DIVER_FN 1 \" move this footnote
10600 .\" Test for situation where, because a final line of QUOTE, BLOCKQUOTE
10601 .\" or EPIGRAPH isn't yet adjusted at this point, the last word on the
10602 .\" line may *seem* to belong to the final line of the page, but will,
10603 .\" in fact, become the first word of the subsequent page. In such
10604 .\" circumstances, we want the the footnote to be treated as a "moved"
10605 .\" diversion footnote.
10606 . if \\n(.k>\\n(.l \{ .nr #DIVER_FN 1 \}
10607 . if r#DIVER_FN \{\
10608 . if !\\n[#DIVER_FN]=2 \{ .\\n+[#DONE_ONCE] \}
10609 .\" A footnote inside a diversion will become the 1st footnote on the
10610 .\" following page/column.
10611 . if \\n[#DIVER_FN]=1 \{ .DIVER_FN_1_PRE \}
10612 .\" A footnote inside a diversion that should be treated like a
10613 .\" normal footnote (including defers.)
10614 . if \\n[#DIVER_FN]=2 \{ .DIVER_FN_2_PRE \}
10616 . nr #SAVED_FN_COUNT \\n[#FN_COUNT]+1
10617 . nr #SAVED_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]+1
10619 .\" End processing footnotes that occur inside QUOTE, BLOCKQUOTE or
10622 .\" Test for situation where, because a final line of running text
10623 .\" isn't yet adjusted at this point, the last word on the line may
10624 .\" *seem* to belong to the final line of the page, but will, in
10625 .\" fact, become the first word of the subsequent page. In such
10626 .\" circumstances, we want the the footnote marker in running text to
10627 .\" be the correct one for the 1st footnote on the page.
10628 . if \\n(.k>\\n(.l \{\
10629 . if (\\n(nl+\\n[#DOC_LEAD])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
10630 . ie \\n[#COLUMNS]=1 \{\
10631 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
10632 . if \\n[#FN_MARKER_STYLE]=1 \{\
10633 . nr #FN_COUNT_FOR_COLS 0 1
10635 . if \\n[#FN_MARKER_STYLE]=2 \{\
10636 . if \\n[#RESET_FN_NUMBER] \{\
10637 . nr #FN_NUMBER 0 1
10638 . nr #NOT_YET_ADJUSTED 1
10644 . if \\n[#FN_MARKER_STYLE]=1 \{\
10647 . if \\n[#FN_MARKER_STYLE]=2 \{\
10648 . if \\n[#RESET_FN_NUMBER] \{\
10649 . nr #FN_NUMBER 0 1
10650 . nr #NOT_YET_ADJUSTED 1
10656 . if \\n[#FN_MARKERS] \{\
10658 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
10659 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
10660 . if \\n[#PRINT_STYLE]=1 \{\
10661 . if \\n[#UNDERLINE_ON] \{\
10662 . nr #UNDERLINE_WAS_ON 1
10666 .\" Add footnote markers to running text...
10667 . if !\\n[#NO_FN_MARKER] \{\
10668 .\" ...but not if TERMINATE has not been called
10669 . if !r#TERMINATE \{\
10670 .\" Marker style star/dagger/double-dagger
10671 . if \\n[#FN_MARKER_STYLE]=1 \{\
10672 .\" Columnar docs either move col to col, or last col to next page.
10673 .\" They require their own special FN_COUNT because regular FN_COUNT
10674 .\" is used to figure out things like whether or not to put a rule
10675 .\" above footnotes (in addition to keeping track of the footnote
10676 .\" count in non-columnar docs).
10677 . ie \\n[#COLUMNS]=1 \{\
10678 . if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU2]*\c \}
10679 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU1]\(dg\c \}
10680 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dd\c \}
10681 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU2]**\c \}
10682 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU1]\(dg\(dg\c \}
10683 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dd\(dd\c \}
10684 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU2]***\c \}
10685 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg\c \}
10686 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dd\(dd\(dd\c \}
10687 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU2]****\c \}
10690 . if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU2]*\c \}
10691 . if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU1]\(dg\c \}
10692 . if \\n[#FN_COUNT]=2 \{ .PRINT \(dd\c \}
10693 . if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU2]**\c \}
10694 . if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU1]\(dg\(dg\c \}
10695 . if \\n[#FN_COUNT]=5 \{ .PRINT \(dd\(dd\c \}
10696 . if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU2]***\c \}
10697 . if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg\c \}
10698 . if \\n[#FN_COUNT]=8 \{ .PRINT \(dd\(dd\(dd\c \}
10699 . if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU2]****\c \}
10702 .\" Marker style superscript numbers
10703 . if \\n[#FN_MARKER_STYLE]=2 \{\
10704 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#FN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c" \}
10705 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]\c" \}
10710 .\" More housekeeping
10712 .\" #SPACE_REMAINING is the space left between where we are
10713 .\" on the page and the bottom margin. It's used to determine whether
10714 .\" or not the footnote will overflow, and how many lines of
10715 .\" footnotes will fit on the page if some have to overflow.
10716 . ie \\n[#DIVER_FN]=2 \{\
10717 . nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-(\\n[#PAGE_POS])
10720 . nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n(nl
10722 . if \\n[#FROM_DIVERT_FN]=1 \{\
10723 . nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]
10724 . rr #FROM_DIVERT_FN
10726 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
10728 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
10729 . INDENT_FIRST_PARAS
10730 .\" Prepare FOOTNOTE to receive footnote text.
10732 . ll \\n[#DOC_L_LENGTH]u
10734 . if \\n[#COLUMNS]=1 \{\
10735 . ll \\n[#COL_L_LENGTH]u
10738 . if \\n[#FN_R_INDENT] \{\
10739 . ll -\\n[#FN_R_INDENT]u
10742 . if \\n[#FN_BR_INDENT] \{\
10743 . ll -\\n[#FN_BR_INDENT]u
10746 . FAMILY \\*[$FN_FAM]
10748 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
10749 . AUTOLEAD \\n[#FN_AUTOLEAD]
10750 . QUAD \\*[$FN_QUAD]
10751 . if \\n[#PRINT_STYLE]=1 \{\
10753 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
10754 . el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
10758 . nr #FN_LEAD \\n[#LEAD]
10759 .\" Begin diversion FOOTNOTES or FN_IN_DIVER
10760 . ie r#COUNTERS_RESET \{\
10761 . ie \\n[#DONE_ONCE]=1 \{\
10762 . ie \\n[#RUN_ON] \{\
10763 . di RUNON_FN_IN_DIVER
10764 . nr #RUNON_FN_IN_DIVER 1
10766 . el \{ .di FN_IN_DIVER \}
10769 . ie \\n[#RUN_ON] \{\
10770 . da RUNON_FN_IN_DIVER
10771 . nr #RUNON_FN_IN_DIVER 1
10773 . el \{ .da FN_IN_DIVER \}
10778 . ie \\n[#RUN_ON] \{\
10779 . da RUNON_FOOTNOTES
10780 . nr #RUNON_FOOTNOTES 1
10782 . el \{ .da FOOTNOTES \}
10784 . if \\n[#FOOTNOTE_COLOR]=1 \{\
10787 \m[\\*[$FOOTNOTE_COLOR]]
10792 . if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
10793 .\" When a deferred footnote is also the 1st footnote on the page,
10794 .\" and when the page it's output on also has footnotes, some
10795 .\" whitespace is needed between the deferred footnote and the
10796 .\" first footnote belonging to the output page so that there's
10797 .\" no confusion when two stars (or two number 1s) appear in
10799 . if \\n[#FN_DEFER_SPACE] \{\
10800 .\" ...but only add the extra space if TERMINATE has not been called
10801 . if !r#TERMINATE \{\
10802 .\" ...and not if defer space has already been added
10803 . if !\\n[#DEFER_SPACE_ADDED] \{\
10804 .\" ...and not if the footnote count the last time we checked for
10805 .\" a defer situation inside a diversion is greater than 1.
10806 . if !\\n[#SAVED_DIVER_FN_COUNT]>1 \{\
10807 . if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
10808 . if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
10809 . nr #DEFER_SPACE_ADDED 1
10813 . rr #FN_DEFER_SPACE
10814 . rr #SAVED_DIVER_FN_COUNT
10816 . if \\n[#DIVERTED]=3 \{\
10817 . if \\n[#FN_COUNT]>0 \{\
10821 .\" Add footnote rule (or, if no rule, some whitespace).
10822 .\" N.B.- this line increments #FN_COUNT each and every time FOOTNOTE
10824 . if \\n+[#FN_COUNT]=1 \{\
10825 .\" If a footnote is called in a diversion, and the footnote has to
10826 .\" be moved, don't put in the rule now (it's taken care of when
10827 .\" FN_IN_DIVER is output into FOOTNOTE in PROCESS_FN_IN_DIVER).
10828 . if !\\n[#DONT_RULE_ME]=1 \{\
10829 . if !\\n[#FN_DEPTH] \{\
10830 . if \\n[#PRINT_STYLE]=1 \{\
10831 . if !\\n[#RUN_ON] \{ .ALD \\n[#DOC_LEAD]u \}
10833 . ie \\n[#FN_RULE]=1 \{\
10834 . if !\\n[#RUN_ON] \{ .PRINT_FOOTNOTE_RULE \}
10842 .\" Add footnote markers to footnote text...
10843 . ie \\n[#FN_MARKERS] \{\
10844 . if \\n[#FN_SPACE]>0 \{\
10845 . if \\n[#FN_COUNT]>0 \{\
10846 . ALD \\n[#FN_SPACE]u
10849 . if !\\n[#NO_FN_MARKER] \{\
10850 .\" ...but not if TERMINATE has been called.
10851 . if !r#TERMINATE \{\
10852 . if \\n[#REF]=1 \{\
10853 \!. in +\\*[$REF_FN_INDENT]
10854 \!. ti -\\*[$REF_FN_INDENT]
10856 . if \\n[#FN_MARKER_STYLE]=1 \{\
10857 . ie \\n[#COLUMNS]=1 \{\
10858 . \\n+[#FN_COUNT_FOR_COLS]
10859 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT *\c \}
10860 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dg\c \}
10861 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \(dd\c \}
10862 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT **\c \}
10863 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dg\(dg\c \}
10864 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \(dd\(dd\c \}
10865 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT ***\c \}
10866 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dg\(dg\(dg\c \}
10867 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \(dd\(dd\(dd\c \}
10868 . if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT ****\c \}
10871 . if \\n[#FN_COUNT]=1 \{ .PRINT *\c \}
10872 . if \\n[#FN_COUNT]=2 \{ .PRINT \(dg\c \}
10873 . if \\n[#FN_COUNT]=3 \{ .PRINT \(dd\c \}
10874 . if \\n[#FN_COUNT]=4 \{ .PRINT **\c \}
10875 . if \\n[#FN_COUNT]=5 \{ .PRINT \(dg\(dg\c \}
10876 . if \\n[#FN_COUNT]=6 \{ .PRINT \(dd\(dd\c \}
10877 . if \\n[#FN_COUNT]=7 \{ .PRINT ***\c \}
10878 . if \\n[#FN_COUNT]=8 \{ .PRINT \(dg\(dg\(dg\c \}
10879 . if \\n[#FN_COUNT]=9 \{ .PRINT \(dd\(dd\(dd\c \}
10880 . if \\n[#FN_COUNT]=10 \{ .PRINT ****\c \}
10883 . if \\n[#FN_MARKER_STYLE]=2 \{\
10884 . if \\n[#COLUMNS]=1 \{\
10885 . \\n+[#FN_COUNT_FOR_COLS]
10887 . if \\n[#NOT_YET_ADJUSTED]=1 \{\
10888 . nr #FN_NUMBER 1 1
10889 . rr #NOT_YET_ADJUSTED
10891 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
10892 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\*[FU 2]\c" \}
10898 .\" Line-numbered footnotes handling
10899 . if \\n[#FN_MARKER_STYLE]=3 \{\
10900 . if \\n[#FN_SPACE]>0 \{\
10901 . if !\\n[#RUN_ON]=1 \{\
10902 . if \\n[#FN_COUNT]>0 \{\
10903 . ALD \\n[#FN_SPACE]u
10907 . if \\n[#REF]=1 \{\
10908 . if !\\n[#RUN_ON]=1 \{\
10909 \!. in +\\*[$REF_FN_INDENT]
10910 \!. ti -\\*[$REF_FN_INDENT]
10913 . ie \\n[#FN_LN_BRACKETS]=1 \{\
10914 . ds $FN_LINENUMBER \v'-.085m'\\*[$FN_OPEN_BRACKET]\v'.085m'
10915 . ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \{\
10916 . as $FN_LINENUMBER \\n[#FN_MARK]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m' \"
10919 . as $FN_LINENUMBER \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m' \"
10923 . ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \{\
10924 . ds $FN_LINENUMBER \\n[#FN_MARK]\\*[$FN_LN_SEP]
10927 . ds $FN_LINENUMBER \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\\*[$FN_LN_SEP]
10930 . if !\\n[#NO_FN_MARKER] \{\
10931 . PRINT \\*[$FN_LINENUMBER]\c
10933 . rm $FN_LINENUMBER
10938 .\" If INDENT arg is passed to FOOTNOTE, calculate the indent...
10940 . ie '\\$1'INDENT' \{\
10942 . if '\\$2'L' \{ .in (\\$3) \}
10943 . if '\\$2'LEFT' \{ .in (\\$3) \}
10944 . if '\\$2'R' \{ .nr #FN_R_INDENT (\\$3) \}
10945 . if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
10947 . nr #FN_BL_INDENT (\\$3)
10948 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
10949 . el \{ .nr #FN_BR_INDENT (\\$4) \}
10950 . in \\n[#FN_BL_INDENT]u
10952 . if '\\$2'BOTH' \{\
10953 . nr #FN_BL_INDENT (\\$3)
10954 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
10955 . el \{ .nr #FN_BR_INDENT (\\$4) \}
10956 . in \\n[#FN_BL_INDENT]u
10959 .\" ...then re-run FOOTNOTE without an argument.
10964 .\" Add "defer space" if the previously diverted footnote was the
10965 .\" 1st footnote proper to its page (i.e. it looks like a deferred
10966 .\" footnote but it's really an overflow).
10967 . if \\n[#DIVERTED] \{\
10968 . if \\n[#PREV_FN_DEFERRED]=1 \{\
10969 . if \\n[#FN_MARKER_STYLE]=1 \{ .ALD \\n[#FN_LEAD]u \}
10970 . if \\n[#RESET_FN_NUMBER] \{ .ALD \\n[#FN_LEAD]u \}
10971 . nr #PREV_FN_DEFERRED 2
10974 . if \\n[#REF]=1 \{\
10977 .\" Terminate FOOTNOTES or FN_IN_DIVER diversion
10979 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
10981 .\" More housekeeping
10982 .\" Turn off indent possibly set by FOOTNOTE INDENT
10984 .\" Restore sentence spacing
10985 . if \\n[#PRINT_STYLE]=2 \{\
10986 . if d$RESTORE_SS_VAR \{ .SS \\*[$RESTORE_SS_VAR] \}
10987 . rm $RESTORE_SS_VAR
10989 . if \\n[#PRINT_STYLE]=1 \{\
10990 . if \\n[#UNDERLINE_WAS_ON] \{\
10992 . rr #UNDERLINE_WAS_ON
10998 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
10999 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
11000 . rr #INDENT_FIRSTS
11001 .\" Calculate footnote depth, but not if #COUNTERS_RESET (created in
11002 .\" DIVER_FN_1_PRE) to instruct FOOTNOTES to skip this step for now
11003 .\" (it's taken care of when FN_IN_DIVER is output into FOOTNOTES in
11004 .\" PROCESS_FN_IN_DIVER).
11005 . ie r#COUNTERS_RESET \{\
11006 . rr #COUNTERS_RESET
11010 .\" If the footnote is the 1st on the page and it falls too close
11011 .\" to the bottom margin, defer the footnote text to the next page...
11012 . if (\\n[#SPACE_REMAINING]-1)<=(\\n[#DOC_LEAD]) \{\
11013 .\" ...but not if PROCESS_FN_LEFTOVER has set #PREV_FN_DEFERRED to 1
11014 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
11016 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
11018 .\" This is required so that the defer space clause can distinguish
11019 .\" a real #FN_COUNT=1 from one generated if FOOTNOTE is run inside
11020 .\" QUOTE, BLOCKQUOTE or EPIGRAPH
11021 . if \\n[#DIVER_FN]=2 \{\
11022 . nr #SAVED_DIVER_FN_COUNT \\n[#FN_COUNT]
11027 .\" Calculate the footnote depth.
11028 . if \\n[#GET_DEPTH]=1 \{\
11029 .\" Save the previous footnote depth (for use when there will be
11030 .\" some overflowed footnote text).
11031 . nr #SAVED_FN_DEPTH_1 \\n[#FN_DEPTH]
11032 .\" Add the depth of the current footnote to any already existent
11034 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
11035 .\" Special handling for run-on footnotes
11036 . if \\n[#RUN_ON]=1 \{\
11037 . if \\n[#RUNON_FOOTNOTES] \{\
11038 . unformat RUNON_FOOTNOTES
11040 . if \\n[#RUNON_FN_IN_DIVER] \{\
11041 . unformat RUNON_FN_IN_DIVER
11044 .\" Recreate FOOTNOTES with rule followed by text of unformatted
11045 .\" run-on footnotes.
11047 . ie \\n[#FN_RULE]=0 \{ .RLD 1v \}
11049 . PRINT \v'-\\n[#FN_RULE_ADJ]u'\l'\\n[#FN_RULE_LENGTH]u'\v'+\\n[#FN_RULE_ADJ]u'
11052 . if \\n[#RUNON_FOOTNOTES] \{\
11054 . rr #RUNON_FOOTNOTES
11056 . if \\n[#RUNON_FN_IN_DIVER] \{\
11057 . RUNON_FN_IN_DIVER
11058 . rr #RUNON_FN_IN_DIVER
11063 . nr #FN_DEPTH \\n[#DIVER_DEPTH]
11064 . nr #SAVED_VFP 0+\\n[#VARIABLE_FOOTER_POS]
11065 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
11067 .\" Save the new depth
11068 . nr #SAVED_FN_DEPTH_2 \\n[#FN_DEPTH]
11069 .\" Signal that defer space should be added when PROCESS_FN_LEFTOVER
11070 .\" processes deferred footnotes.
11071 . if \\n[#FN_DEFER] \{\
11072 . if \\n[#FN_COUNT]=2 \{\
11073 . ie \\n[#COLUMNS] \{\
11074 . if !\\n[#FROM_FOOTER] \{\
11075 . if \\n[#FN_DEFER]=1 \{ .nr #FN_DEFER_SPACE 1 \}
11076 . if \\n[#FN_COUNT_FOR_COLS]>=1 \{ .rr #FN_DEFER_SPACE \}
11077 . if \\n[#FROM_HEADER] \{ .nr #FN_DEFER_SPACE 1 \}
11081 . nr #FN_DEFER_SPACE 1
11086 .\" If the depth of the whole footnote won't fit in the space
11087 .\" between where we are on the page and the bottom margin, calculate
11088 .\" how much of it will fit.
11089 . if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
11091 . while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
11092 . nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
11094 . nr #VFP_DIFF \\n[#FN_DEPTH]-\\n[#SAVED_FN_DEPTH_1]
11096 .\" Very occasionally, #VFP_DIFF, on a 1st footnote that isn't to
11097 .\" be deferred, comes up with a depth equal to exactly 1 line
11098 .\" of footnotes, i.e. enough room to print the rule and nothing
11099 .\" else. The following tests for such a condition, and rather than
11100 .\" attempting to treat the footnote as an overflow, it tells mom to
11101 .\" treat it as a special kind of deferred footnote (#FN_DEFER 2).
11102 . if \\n[#SAVED_FN_DEPTH_1]=0 \{\
11103 . if \\n[#FN_DEPTH]=\\n[#FN_LEAD] \{\
11105 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_2]
11110 .\" Calculate VFP based on whether the footnote overflows, or is to
11111 .\" be treated normally.
11112 . ie \\n[#OVERFLOW]=1 \{\
11113 . if \\n[#RUN_ON] \{\
11114 . rr #VARIABLE_FOOTER_POS
11115 . nr #VARIABLE_FOOTER_POS \\n[#SAVED_VFP]
11117 . ie \\n[#FN_COUNT]=1 \{\
11118 . ie \\n[#RULED]=1 \{\
11119 . ie \\n[#COLUMNS]=1 \{\
11120 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11121 . ie \\n[#FROM_FOOTER] \{\
11122 . ie \\n[#FN_COUNT_FOR_COLS]>1 \{\
11123 . nr #FN_DEPTH -\\n[#FN_DEPTH]
11124 . if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
11125 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
11126 . nr #FN_DEPTH -\\n[#VFP_DIFF]
11130 . nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
11131 . if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
11135 . nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
11139 . nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
11142 . el \{ .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]) \}
11145 . nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
11146 . if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
11147 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
11148 . ie \\n[#COLUMNS]=1 \{\
11149 . if !\\n[#FROM_FOOTER] \{\
11154 . nr #FN_DEPTH -\\n[#VFP_DIFF]
11157 . if \\n[#DIVERTED]=3 \{\
11158 . if !\\n[#PREV_FN_DEFERRED] \{\
11159 . if !\\n[#FROM_FOOTER] \{\
11160 . if \\n[#FN_COUNT]=1 \{\
11161 . if !\\n[#VFP_DIFF] \{\
11162 . if \\n[#FN_MARKER_STYLE]=1 \{\
11164 \!. ALD \\n[#FN_LEAD]u
11167 . if \\n[#RESET_FN_NUMBER] \{\
11169 \!. ALD \\n[#FN_LEAD]u
11178 . nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
11179 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
11182 . nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
11183 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
11189 . nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
11190 . if \\n[#PREV_FN_DEFERRED]=1 \{\
11191 . if \\n[#DIVERTED] \{\
11192 . if !\\n[#FN_DEPTH]=\\n[#SAVED_FN_DEPTH_1] \{\
11193 . nr #FN_DEPTH +\\n[#FN_LEAD]
11194 . nr #VARIABLE_FOOTER_POS -\\n[#FN_LEAD]
11195 . rr #PREV_FN_DEFERRED
11199 . if \\n[#FN_COUNT]>1 \{\
11207 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
11208 .\" See VFP_CHECK for an explanation of the next lines.
11209 .\" The trap has to be removed, prior to setting it, each time
11210 .\" FOOTNOTE is run.
11211 . if \\n[#PRINT_STYLE]=2 \{\
11213 . wh \\n[#VARIABLE_FOOTER_POS]u-\\n[#DOC_LEAD]u VFP_CHECK
11215 .\" If we have a footnote whose text has to be deferred to the next
11216 .\" page, reset the FOOTER trap to its original location.
11217 . if \\n[#FN_DEFER] \{\
11218 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
11219 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
11222 . nr #NO_FN_MARKER 0
11224 . if \\n[#ADD_BREAK] \{\
11230 \# Utility macros to manage footnotes that occur inside diversions
11231 \# ---------------------------------------------------------------
11234 There are some redundancies here; they're left in in case unforeseen
11235 footnote situations crop up in the future that might require
11236 manipulation of them.
11239 \# 1. Pre-footnote processing for footnotes in diversions
11241 \# a) A footnote inside a diversion will be moved entirely (marker
11242 \# in running text and text of footnote) to the next page/column.
11244 .MAC DIVER_FN_1_PRE END
11245 . nr #RESET_FN_COUNTERS 1
11246 . nr #COUNTERS_RESET 1
11247 . if \\n[#DONE_ONCE]=1 \{\
11248 . if \\n[#FN_DEFER] \{\
11249 . if \\n[#SAVED_DIVER_FN_COUNT]=1 \{\
11250 . ie \\n[#COLUMNS]=1 \{\
11251 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_DEFER_SPACE 1 \}
11254 . nr #FN_DEFER_SPACE 1
11258 . if \\n[#FN_MARKER_STYLE]=1 \{\
11259 . if \\n[#FN_COUNT]>0 \{ .nr #FN_COUNT 0 1 \}
11260 . if \\n[#COLUMNS]=1 \{\
11261 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11262 . nr #FN_COUNT_FOR_COLS 0 1
11266 . if \\n[#FN_MARKER_STYLE]=2 \{\
11267 . if \\n[#RESET_FN_NUMBER]=1 \{\
11268 . ie \\n[#COLUMNS]=1 \{\
11269 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
11272 . nr #FN_NUMBER 0 1
11279 \# b) Treat as a normal footnote, including defers.
11281 .MAC DIVER_FN_2_PRE END
11282 . nr #RESET_FN_COUNTERS 2
11285 \# 2. Post-footnote processing for footnotes in diversions
11287 \# Even when a footnote inside a diversion is treated as
11288 \# "normal," some manipulation of registers is required. The
11289 \# macro is called in DO_QUOTE (i.e. at the termination of
11290 \# quotes and blockquotes) and in DO_EPIGRAPH.
11292 .MAC DIVER_FN_2_POST END
11293 . if \\n[#DONE_ONCE]=1 \{\
11294 . if \\n[#FN_MARKER_STYLE]=1 \{\
11295 . if \\n[#FN_COUNT]=0 \{\
11296 . nr #DONT_RULE_ME 1
11298 . if \\n[#FN_COUNT]>0 \{\
11301 . if \\n[#COLUMNS]=1 \{\
11302 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT_FOR_COLS 0 1 \}
11303 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11307 . if \\n[#FN_MARKER_STYLE]=2 \{\
11308 . if \\n[#FN_COUNT]=0 \{\
11309 . nr #DONT_RULE_ME 1
11311 . if \\n[#FN_COUNT]>0 \{\
11314 . if \\n[#RESET_FN_NUMBER]=1 \{\
11315 . ie \\n[#COLUMNS]=1 \{\
11316 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
11319 . nr #FN_NUMBER 0 1
11326 \# The main macros that handle footnote processing.
11327 \# -----------------------------------------------
11330 Sometimes, #VARIABLE_FOOTER_POS sets FOOTER at a location that gives
11331 the impression another line of running text could fit on the page.
11332 VFP_CHECK is always set to the line just above the one where FOOTER
11333 will be sprung, and checks for this condition. If it exists, FOOTER
11334 is set one line lower on the page, thus squeezing in an extra line
11335 of running text. This is a judgment call on my part, but seems to
11336 work well. If there are problems (e.g. footnotes really do look
11337 jammed), the user should probably adjust FOOTNOTE_AUTOLEAD and/or
11340 The macro has to be run in its own environment, otherwise the first
11341 word of the last line before the footnotes gets chopped.
11346 .\" The trap also has to be removed each time VFP_CHECK is run
11347 . if \\n[#PRINT_STYLE]=2 \{\
11350 . ie !\\n[#IN_DIVER] \{ .nr #PAGE_POS \\n(nl \}
11351 . el \{ .nr #PAGE_POS \\n(nl+\\n(.d+(\\n[#DOC_LEAD]) \}
11352 . nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS])
11353 . nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
11354 . nr #FN_GAP \\n[#SPACE_TO_FOOTER]%\\n[#DOC_LEAD]
11355 . if !\\n[#FN_GAP]<0 \{\
11356 . if \\n[#FN_GAP]<\\n[#DOC_LEAD] \{\
11357 . ie (\\n[#PAGE_POS]+(\\n[#FN_DEPTH]+\\n[#FN_GAP]))>(\\n[#VISUAL_B_MARGIN]) \{\
11358 . nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
11361 . ie \\n[#DOC_LEAD]-\\n[#FN_GAP]<\\n[#DESCENDER] \{\
11362 . nr #VARIABLE_FOOTER_POS +\\n[#DOC_LEAD]
11363 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
11366 . nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
11376 FN_OVERFLOW_TRAP starts off "underneath" FOOTER, but is revealed
11377 as #VARIABLE_FOOTER_POSITION changes the position of FOOTER.
11378 FN_OVERFLOW_TRAP simply starts diversion FN_OVERFLOW to "catch"
11379 the overflow. The diversion is ended in FOOTER, immediately after
11380 FOOTER outputs the diversion, FOOTNOTES, before PROCESS_FN_LEFTOVER
11381 is run (either in HEADER, or in FOOTER if moving col to col).
11384 .MAC FN_OVERFLOW_TRAP END
11385 . if \\n[#FN_COUNT] \{\
11387 . ie !\\n[#NO_BACK_UP]=1 \{\
11388 . if \\n[#PREV_FN_DEFERRED] \{\
11389 . ie \\n[#COLUMNS]=1 \{\
11390 . if \\n[#FROM_FOOTER] \{\
11391 . if \\n[#PREV_FN_DEFERRED] \{\
11392 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11393 . rr #PREV_FN_DEFERRED
11397 . if !\\n[#FROM_FOOTER] \{\
11398 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11399 . if !\\n[#LAST_FN_COUNT_FOR_COLS]>1 \{\
11400 \!. RLD \\n[#FN_LEAD]u
11406 \!. RLD \\n[#FN_LEAD]u
11412 . rr #PREV_FN_DEFERRED
11415 .\" When #FROM_DIVERT_FN is 1, it signals to FOOTNOTE, when run from
11416 .\" within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING to the total
11417 .\" area allowable for running text.
11418 . nr #FROM_DIVERT_FN 1
11422 PROCESS_FN_LEFTOVER is called at the top of HEADER, and in
11423 FOOTER if we're moving from one column to the next (i.e. after
11424 outputting FOOTNOTES). It checks for whether we have a "deferred
11425 footnote" situation, and resets counters and number registers
11426 accordingly. Lastly, if we have some footnote overflow, it calls
11427 DIVERT_FN_OVERFLOW.
11430 .MAC PROCESS_FN_LEFTOVER END
11431 . if \\n[#PREV_FN_DEFERRED]=2 \{\
11432 . if \\n[#FN_COUNT_AT_FOOTER]>1 \{ .rr #PREV_FN_DEFERRED \}
11434 . if !\\n[#FN_DEFER] \{\
11437 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
11439 . if r#FN_DEFER \{\
11440 . if \\n[#FN_DEFER]=1 \{\
11441 . nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
11443 . if \\n[#FN_DEFER]=2 \{\
11445 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
11448 . nr #SPACE_REMAINING 0
11449 . ch FOOTER -\\n[#B_MARGIN]u
11450 . if \\n[#FN_DEFER] \{\
11451 . nr #NO_FN_MARKER 1
11455 . ie \\n[#COLUMNS]=1 \{\
11456 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11457 . if !\\n[#FROM_FOOTER] \{\
11458 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .nr #PREV_FN_DEFERRED 1 \}
11462 . el \{ .nr #PREV_FN_DEFERRED 1 \}
11464 . if !\\n[#FN_DEFER] \{\
11465 . if \\n[#FN_OVERFLOW_DEPTH] \{\
11466 . DIVERT_FN_LEFTOVER
11469 . ie \\n[#COLUMNS]=1 \{\
11470 . if \\n[#COL_NUM]>1 \{\
11471 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT 0 1 \}
11474 . el \{ .nr #FN_COUNT 0 1 \}
11475 . if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
11476 . rr #FROM_DIVERT_FN
11480 DIVERT_FN_LEFTOVER is called in PROCESS_FN_LEFTOVER (at
11481 the top of HEADER, and in FOOTER if we're moving from one column
11485 .MAC DIVERT_FN_LEFTOVER END
11486 . nr #NO_FN_MARKER 1
11492 . if \\n[#PREV_FN_DEFERRED] \{\
11493 . nr #FN_DEPTH -\\n[#FN_LEAD]
11494 . nr #VARIABLE_FOOTER_POS +\\n[#FN_LEAD]
11495 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
11496 . if \\n[#PREV_FN_DEFERRED]=2 \{\
11497 . nr #PREV_FN_DEFERRED 1
11501 . rr #FN_OVERFLOW_DEPTH
11505 This is a special macro to deal with footnotes that are set inside
11506 diversions (QUOTE, BLOCKQUOTE and EPIGRAPH). It's called in HEADER
11507 (and in FOOTER, if we're moving from column to column), and comes
11508 after PROCESS_FOOTNOTE_LEFTOVER in those two macros.
11511 .MAC PROCESS_FN_IN_DIVER END
11512 . nr #SPACE_REMAINING 0
11513 . ch FOOTER -\\n[#B_MARGIN]u
11514 . nr #NO_FN_MARKER 1
11515 . if !\\n[#RESET_FN_COUNTERS]=2 \{\
11516 . rr #RESET_FN_COUNTERS
11519 . if \\n[#FN_OVERFLOW_DEPTH] \{ .nf \}
11520 . ie dRUNON_FN_IN_DIVER \{\
11521 . RUNON_FN_IN_DIVER
11522 . rm RUNON_FN_IN_DIVER
11532 \# ====================================================================
11537 When endnotes are output, the spacing between the notes is always
11538 1 extra linespace. This can have bottom margin consequences. If
11539 this doesn't bother you, don't worry about it. If it does bother
11540 you, and you want to adjust the spacing between any two endnotes (as
11541 they're output), make the spacing adjustments (.ALD/.RLD) at the
11542 *end* of endnotes (i.e. just before .ENDNOTE OFF), not at the top.
11544 Endnotes must be output manually with .ENDNOTES. This allows user
11545 the flexibility to output endnotes at the end of each collated
11546 document, or to output them at the end of the entire document.
11551 \# ENDNOTE POINT SIZE
11552 \# ------------------
11554 \# <base point size for endnotes>
11556 \# Creates or modifies register #EN_PS.
11558 \# Default is same as running text in body of document.
11560 \# This size control macro differs from other size control macros
11561 \# in that it sets an absolute point size, not a relative one. This
11562 \# is because a) endnotes always appear separate from the body of
11563 \# a document and therefore don't need to be relative to the body
11564 \# of the document, and b) there are quite a few elements of the
11565 \# endnotes page(s) that need to be relative to the base point size
11566 \# of that page. If the base endnote point size were relative to
11567 \# the body of the document (i.e. a _SIZE macro taking a +|- value)
11568 \# getting the rest of the endnote elements sized properly could
11569 \# become very confusing.
11571 .MAC ENDNOTE_PT_SIZE END
11572 . nr #EN_PS (p;\\$1)
11579 \# <base leading to use in endnotes> [ ADJUST ]
11581 \# Creates or modifies register #EN_LEAD. Creates or removes
11582 \# register #ADJ_EN_LEAD. Stores arguments in strings if ENDNOTE_LEAD
11583 \# set before START.
11585 \# Default is 14 points for TYPESET, adjusted; 24 for TYPEWRITE.
11587 .MAC ENDNOTE_LEAD END
11588 . if !\\n[#OK_PROCESS_LEAD] \{\
11591 . ds $ADJUST_EN_LEAD \\$2
11596 . nr #EN_LEAD (p;\\$1)
11597 . if '\\$2'ADJUST' \{\
11598 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
11599 . nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
11600 . nr #ADJ_DOC_LEAD 1
11601 . nr #ADJ_EN_LEAD 1
11602 . nr #NO_TRAP_RESET 1
11603 . DOC_LEAD \\n[#EN_LEAD]u ADJUST
11604 . nr #EN_LEAD \\n[#DOC_LEAD]
11605 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
11606 . rr #NO_TRAP_RESET
11607 . nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
11608 . rr #ORIG_DOC_LEAD
11613 \# ENDNOTES_HDRFTR_CENTER
11614 \# ----------------------
11618 \# Creates or removes toggle register #EN_HDRFTR_CENTER, used to
11619 \# determine whether mom should print a/the hdrftr center string
11620 \# on the endnotes page. Primarily to enable/disable printing of the
11621 \# chapter name in hdrftrs when DOCTYPE CHAPTER.
11625 .MAC ENDNOTES_HDRFTR_CENTER END
11626 . ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
11627 . el \{ .rr #EN_HDRFTR_CENTER \}
11634 \# <title for endnotes page>
11636 \# Creates or modifies string $EN_STRING.
11638 \# Default is "Endnotes"
11640 .MAC ENDNOTE_STRING END
11641 . ds $EN_STRING \\$1
11645 \# ENDNOTE STRING UNDERSCORE
11646 \# -------------------------
11650 \# Turns underscoring of endnote main title on or off. If the argument
11651 \# is the digit "2", turns on double-underscoring.
11653 \# Default is double-underscored.
11655 .MAC ENDNOTE_STRING_UNDERSCORE END
11656 . ie '\\$1'' \{ .nr #EN_STRING_UNDERSCORE 1 \}
11658 . ie '\\$1'2' \{ .nr #EN_STRING_UNDERSCORE 2 \}
11659 . el \{ .nr #EN_STRING_UNDERSCORE 0 \}
11664 \# ENDNOTE STRING CAPS
11665 \# -------------------
11667 \# <none> | <anything>
11669 \# Turns capitalization of the endnotes pages title string
11670 \# "Endnotes" on or off.
11672 \# Users may want the endnotes pages title string to be in caps,
11673 \# but the toc entry for endnotes in lower case. If the argument
11674 \# to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
11675 \# turned on, this is exactly what will happen.
11679 .MAC ENDNOTE_STRING_CAPS END
11680 . ie '\\$1'' \{ .nr #EN_STRING_CAPS 1 \}
11681 . el \{ .rr #EN_STRING_CAPS \}
11688 \# <string that appears before the first endnote pertaining to any document>
11690 \# Creates string $EN_TITLE_STRING.
11692 \# Default is the document title, or, if doc is a chapter, "Chapter #"
11694 .MAC ENDNOTE_TITLE END
11695 . ds $EN_TITLE \\$1
11699 .MAC ENDNOTE_TITLE_SPACE END
11700 . nr #EN_TITLE_SPACE (\\$1)
11704 \# ENDNOTE TITLE UNDERSCORE
11705 \# ------------------------
11709 \# Creates or removes register #EN_TITLE_UNDERSCORE.
11711 \# Default is to underscore the endnote titles.
11713 .MAC ENDNOTE_TITLE_UNDERSCORE END
11714 . ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
11715 . el \{ .rr #EN_TITLE_UNDERSCORE \}
11719 \# ENDNOTE MARKER STYLE
11720 \# --------------------
11724 \# Sets register #EN_MARKER_STYLE, used in ENDNOTE to determine
11725 \# the style of endnote markers (labels).
11727 \# 1=NUMBER; 2=LINE. LINE means "use output line numbers".
11728 \# Default is NUMBER.
11730 .MAC ENDNOTE_MARKER_STYLE END
11731 . if '\\$1'NUMBER' \{\
11732 . nr #EN_MARKER_STYLE 1
11734 . if '\\$1'LINE' \{\
11735 . nr #EN_MARKER_STYLE 2
11736 . if !\\n[#EN_LN_SEP] \{\
11737 . if !\\n[#EN_LN_BRACKETS] \{ .ENDNOTE_LINENUMBER_BRACKETS SQUARE \}
11743 \# ENDNOTE LINENUMBER MARK
11744 \# -----------------------
11746 \# This string, when called inline, stores the current output line
11747 \# number in register #EN_MARK for use with ENDNOTE.
11749 .ds EN-MARK \R'#EN_MARK \En(ln'
11752 \# ENDNOTE LINENUMBER SEPARATOR
11753 \# ----------------------------
11755 \# <user-defined separator>
11757 \# Stores user-defined separator (for use then
11758 \# ENDNOTE_MARKER_STYLE is LINE) in string $EN_LN_SEP. The
11759 \# separator is intended to be used when the user wishes a
11760 \# separator, rather than the choice of brackets offered by
11761 \# ENDNOTE_LINENUMBER_BRACKETS.
11763 .MAC ENDNOTE_LINENUMBER_SEPARATOR END
11764 . rr #EN_LN_BRACKETS
11766 . ds $EN_LN_SEP "\\$1
11770 \# ENDNOTE LINENUMBER BRACKETS
11771 \# ---------------------------
11773 \# PARENS | SQUARE | BRACES or ( | [ | {
11775 \# Sets register #EN_LN_BRACKETS to 1, and creates strings
11776 \# $EN_OPEN_BRACKET and $EN_CLOSE_BRACKET according to the given argument.
11778 .MAC ENDNOTE_LINENUMBER_BRACKETS END
11780 . nr #EN_LN_BRACKETS 1
11781 . if '\\$1'PARENS' \{\
11782 . ds $EN_OPEN_BRACKET (
11783 . ds $EN_CLOSE_BRACKET )
11786 . ds $EN_OPEN_BRACKET (
11787 . ds $EN_CLOSE_BRACKET )
11789 . if '\\$1'SQUARE' \{\
11790 . ds $EN_OPEN_BRACKET [
11791 . ds $EN_CLOSE_BRACKET ]
11794 . ds $EN_OPEN_BRACKET [
11795 . ds $EN_CLOSE_BRACKET ]
11797 . if '\\$1'BRACES' \{\
11798 . ds $EN_OPEN_BRACKET {
11799 . ds $EN_CLOSE_BRACKET }
11802 . ds $EN_OPEN_BRACKET {
11803 . ds $EN_CLOSE_BRACKET }
11808 \# ENDNOTE LINENUMBER GAP
11809 \# ----------------------
11811 \# <space between line-number labels and endnotes text>
11813 \# Defines string $EN_LN_GAP, used during printing of line-number
11814 \# labels in ENDNOTE.
11816 .MAC ENDNOTE_LINENUMBER_GAP END
11817 . ds $EN_LN_GAP \\$1
11821 \# ENDNOTE NUMBERS ALIGN RIGHT
11822 \# ---------------------------
11824 \# <max. number of digit placeholders that will appear in endnotes>
11826 \# Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
11827 \# #EN_NUMBER_PLACEHOLDERS.
11829 \# Default is for footnote numbers to be right aligned to 2 placeholders.
11831 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
11832 . rr #EN_NUMBERS_ALIGN_LEFT
11833 . nr #EN_NUMBERS_ALIGN_RIGHT 1
11834 . nr #EN_NUMBER_PLACEHOLDERS \\$1
11838 \# ENDNOTE NUMBERS ALIGN LEFT
11839 \# --------------------------
11843 \# Toggles register #EN_NUMBERS_ALIGN_LEFT on.
11845 \# Default is for footnote numbers to be right aligned to 2 placeholders
11846 \# (i.e. not left aligned).
11848 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
11849 . rr #EN_NUMBERS_ALIGN_RIGHT
11850 . nr #EN_NUMBERS_ALIGN_LEFT 1
11854 \# ENDNOTE PARAGRAPH INDENT
11855 \# ------------------------
11857 \# <first line indent of paras subsequent to 1st in endnotes>
11859 \# Creates register #EN_PP_INDENT for use in .PP.
11861 \# Requires a unit of measure.
11863 \# Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
11865 .MAC ENDNOTE_PARA_INDENT END
11866 . nr #EN_PP_INDENT (\\$1)
11870 \# TURN OFF COLUMN MODE FOR ENDNOTES
11871 \# ---------------------------------
11873 \# <none> | <anything>
11875 \# Creates or removes register #EN_NO_COLS
11877 \# Allows user to tell mom not to set endnotes in columnar
11878 \# documents in columns. Default is to set endnotes in columns.
11880 .MAC ENDNOTES_NO_COLUMNS END
11881 . ie '\\$1'' \{ .nr #EN_NO_COLS 1 \}
11882 . el \{ .rr #EN_NO_COLS \}
11886 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
11887 \# -------------------------------------------
11889 \# <none> | <anything>
11891 \# Creates or removes register #EN_NO_FIRST_PN
11893 \# For use if FOOTERS are on. Tells ENDNOTES not to put a page
11894 \# number on the first endnotes page. Some users may want this.
11895 \# Default is to print a page number at the top of the first
11896 \# endnotes page when footers are on.
11898 .MAC ENDNOTES_NO_FIRST_PAGENUM END
11899 . ie '\\$1'' \{ .nr #EN_NO_FIRST_PN 1 \}
11900 . el \{ .rr #EN_NO_FIRST_PN \}
11904 \# PAGE HEADERS ON ENDNOTES PAGES
11905 \# ------------------------------
11909 \# Creates or removes register #EN_ALLOWS_HEADERS or
11910 \# #EN_ALLOWS_HEADERS_ALL
11912 \# Whether ENDNOTES puts a page header at the top of endnotes
11913 \# pages if page headers are used throughout the document.
11914 \# Default is to insert the page headers, but not on the first
11915 \# page. If the optional argument ALL is given, ENDNOTES puts a
11916 \# page header on the first page as well.
11918 .MAC ENDNOTES_ALLOWS_HEADERS END
11919 . ie '\\$1'' \{ .nr #EN_ALLOWS_HEADERS 1 \}
11921 . ie '\\$1'ALL' \{\
11922 . nr #EN_ALLOWS_HEADERS 1
11923 . nr #EN_ALLOWS_HEADERS_ALL 1
11926 . rr #EN_ALLOWS_HEADERS
11927 . rr #EN_ALLOWS_HEADERS_ALL
11933 \# ENDNOTES PAGES PAGE NUMBERING STYLE
11934 \# -----------------------------------
11936 \# DIGIT | ROMAN | roman | ALPHA | alpha
11938 \# Creates or modifies $EN_PN_STYLE.
11940 \# Allows user to define what style should be used for endnotes
11941 \# pages page numbering. Arguments are the same as for
11944 \# Default is DIGIT.
11946 .MAC ENDNOTES_PAGENUM_STYLE END
11947 . ds $EN_PN_STYLE \\$1
11951 \# FIRST PAGE NUMBER FOR ENDNOTES
11952 \# ------------------------------
11954 \# <page number that appears on page 1 of endnotes pages>
11956 \# Creates or modifies string $EN_FIRST_PN
11958 \# To be used with caution, only if all endnotes
11959 \# are to be output at once, i.e. not at the end of the separate
11960 \# docs of a collated doc
11962 .MAC ENDNOTES_FIRST_PAGENUMBER END
11963 . nr #EN_FIRST_PN \\$1
11966 \# SINGLESPACE ENDNOTES
11967 \# --------------------
11969 \# <none> | <anything>
11971 \# Sets lead of endnotes pages in TYPEWRITE to 12 points,
11974 \# Default is to double-space endnotes pages.
11976 .MAC SINGLESPACE_ENDNOTES END
11977 . if \\n[#PRINT_STYLE]=1 \{\
11978 . ie \\n[#SINGLE_SPACE] \{\
11979 . nr #EN_SINGLESPACE 1
11981 . if \\n[#OK_PROCESS_LEAD] \{\
11982 . ENDNOTE_LEAD 12 ADJUST
11988 . nr #EN_SINGLESPACE 1
11990 . if \\n[#OK_PROCESS_LEAD] \{\
11991 . ENDNOTE_LEAD 12 ADJUST
11996 . rr #EN_SINGLESPACE
11998 . if \\n[#OK_PROCESS_LEAD] \{\
11999 . ENDNOTE_LEAD 24 ADJUST
12008 \# ENDNOTE PARAGRAPH SPACE
12009 \# -----------------------
12013 \# Creates toggle register #EN_PP_SPACE for use in .PP.
12015 \# Like PARA_SPACE. Default is not to space endnote paras.
12017 .MAC ENDNOTE_PARA_SPACE END
12018 . ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
12019 . el \{ .rr #EN_PP_SPACE \}
12028 \# Places superscript endnote number in text, then collects and
12029 \# processes endnote in diversion END_NOTES.
12031 \# \c must be appended to the word immediately preceding .ENDNOTE
12032 \# when ENDNOTE_MARKER_STYLE is NUMBER.
12035 . if !\\n(.u \{ .nr #ADD_BREAK 1 \}
12038 . if \\n[#EN_MARKER_STYLE]=1 \{\
12039 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
12040 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
12041 . if \\n[#PRINT_STYLE]=1 \{\
12042 . if \\n[#UNDERLINE_ON] \{\
12043 . nr #UNDERLINE_WAS_ON 1
12046 . if \\n[#SLANT_ON] \{\
12047 . nr #SLANT_WAS_ON 1
12050 . PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
12052 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]\c" \}
12054 . if \\n[#EN_MARKER_STYLE]=2 \{\
12055 . if !\\n[#LINENUMBERS] \{\
12056 . tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
12057 . tm1 " ENDNOTE_MARKER_STYLE is LINE.
12058 . ab Aborting on ENDNOTE at line \\n(.c.
12060 . if \\n[#EN_MARK]=0 \{ .nr #EN_MARK \\n(ln \}
12061 . nr #EN_MARK_2 \\n(ln
12062 . if '\\n(.z'P_QUOTE' \{\
12067 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
12069 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
12070 . INDENT_FIRST_PARAS
12073 . LL \\n[#DOC_L_LENGTH]u
12075 . if \\n[#COLUMNS] \{\
12076 . ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
12077 . el \{ .LL \\n[#COL_L_LENGTH]u \}
12080 . vs \\n[#EN_LEAD]u
12081 . if \\n[#EN_NUMBER]=1 \{\
12083 . if \\n[#PRINT_STYLE]=1 \{\
12086 . if \\n[#PRINT_STYLE]=2 \{\
12087 . FAMILY \\*[$EN_TITLE_FAM]
12088 . FT \\*[$EN_TITLE_FT]
12089 . PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
12092 . if !'\\*[$EN_TITLE]'' \{\
12093 . if '\\*[$EN_TITLE_QUAD]'L' \{ .LEFT \}
12094 . if '\\*[$EN_TITLE_QUAD]'LEFT' \{ .LEFT \}
12095 . if '\\*[$EN_TITLE_QUAD]'C' \{ .CENTER \}
12096 . if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
12097 . if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
12098 . if '\\*[$EN_TITLE_QUAD]'R' \{ .RIGHT \}
12099 . if '\\*[$EN_TITLE_QUAD]'RIGHT' \{ .RIGHT \}
12100 . ie \\n[#EN_TITLE_UNDERSCORE] \{\
12101 . UNDERSCORE "\\*[$EN_TITLE]
12104 . PRINT "\\*[$EN_TITLE]
12108 . ie \\n[#EN_NUMBER]=1 \{\
12109 . if !'\\*[$EN_TITLE]'' \{ .sp \}
12112 . if \\n[#PRINT_STYLE]=1 \{\
12115 . if \\n[#PRINT_STYLE]=2 \{\
12116 . if \\n[#EN_MARKER_STYLE]=1 \{\
12117 . FAMILY \\*[$EN_NUMBER_FAM]
12118 . FT \\*[$EN_NUMBER_FT]
12119 . PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
12121 . if \\n[#EN_MARKER_STYLE]=2 \{\
12122 . FAMILY \\*[$EN_LN_FAM]
12123 . FT \\*[$EN_LN_FT]
12124 . PT_SIZE \\n[#EN_PS]u\\*[$EN_LN_SIZE_CHANGE]
12127 . if \\n[#EN_MARKER_STYLE]=2 \{\
12128 . ENDNOTE_NUMBERS_ALIGN_LEFT
12129 . ie \\n[#EN_LN_BRACKETS]=1 \{\
12130 . ds $EN_LINENUMBER \v'-.085m'\\*[$EN_OPEN_BRACKET]\v'.085m'
12131 . ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \{\
12132 . as $EN_LINENUMBER \\n[#EN_MARK]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m' \"
12135 . as $EN_LINENUMBER \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m' \"
12139 . ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \{\
12140 . ds $EN_LINENUMBER \\n[#EN_MARK]\\*[$EN_LN_SEP]
12143 . ds $EN_LINENUMBER \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\\*[$EN_LN_SEP]
12149 . nr #RESET_L_LENGTH \\n(.l
12150 . ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
12151 . nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
12155 . nr #EN_NUMBER_L_LENGTH \w'\En[#EN_NUMBER].\0'
12158 . if \\n[#EN_MARKER_STYLE]=2 \{\
12159 . if !\\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
12160 . nr #EN_NUMBER_L_LENGTH \w'\\*[$EN_LINENUMBER]'+\\*[$EN_LN_GAP]
12164 . ll \\n[#EN_NUMBER_L_LENGTH]u
12165 . if \\n[#EN_MARKER_STYLE]=1 \{\
12168 . if \\n[#EN_MARKER_STYLE]=2 \{\
12169 \\*[$EN_LINENUMBER]
12170 . rm $EN_LINENUMBER
12173 . ll \\n[#RESET_L_LENGTH]u
12174 . nr #EN_FIGURE_SPACE \w'\0.'
12175 . ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
12176 . in \\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_FIGURE_SPACE]u
12179 . ti \\n[#EN_NUMBER_L_LENGTH]u
12181 . nr #EN_TEXT_INDENT \\n(.i
12182 . QUAD \\*[$EN_QUAD]
12184 . if \\n[#PRINT_STYLE]=1 \{\
12187 . if \\n[#PRINT_STYLE]=2 \{\
12188 . FAMILY \\*[$EN_FAM]
12190 . PT_SIZE \\n[#EN_PS]u
12192 . if \\n[#REF]=1 \{\
12193 . ie !\\n[#EN_MARKER_STYLE]=2 \{\
12194 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
12195 . in \\*[$REF_EN_INDENT]
12196 . ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u)
12198 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
12199 . in \\*[$REF_EN_INDENT]
12200 . ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u-\\n[#EN_FIGURE_SPACE]u)
12204 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
12205 . in \\*[$REF_EN_INDENT]
12206 . ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u)
12214 . if \\n[#EN_MARKER_STYLE]=2 \{\
12218 .\" Restore sentence spacing
12219 . if \\n[#PRINT_STYLE]=2 \{\
12220 . if d$RESTORE_SS_VAR \{ .SS \\*[$RESTORE_SS_VAR] \}
12221 . rm $RESTORE_SS_VAR
12224 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
12225 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
12226 . rr #INDENT_FIRSTS
12228 . if \\n[#PRINT_STYLE]=1 \{\
12229 . if \\n[#UNDERLINE_WAS_ON] \{\
12230 . rr #UNDERLINE_WAS_ON
12234 . if \\n[#SLANT_WAS_ON] \{\
12239 . if \\n[#ADD_BREAK] \{\
12251 \# Sets new document leading from #EN_LEAD, breaks to a new page,
12252 \# sets up an endnotes page based on registers and strings associated
12253 \# with endnotes, then outputs diversion END_NOTES.
12257 . nr #EN_FIRST_PAGE 1
12258 . nr #HEADER_STATE \\n[#HEADERS_ON]
12259 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
12260 . if \\n[#LINENUMBERS]=1 \{\
12262 . nr #LINENUMBERS 2
12264 . if \\n[#HEADERS_ON]=1 \{\
12265 . if !\\n[#EN_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
12267 . if \\n[#HEADER_STATE]=1 \{\
12268 . ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
12269 . el \{ .rm $HDRFTR_CENTER \}
12271 . ie !\\n[#SUSPEND_PAGINATION] \{\
12272 . if \\n[#PAGINATE]=1 \{\
12273 . if \\n[#PAGE_NUM_V_POS]=1 \{\
12274 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
12275 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN]-1 \}
12276 . if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
12281 . ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
12282 . el \{ .nr #PAGINATE 0 \}
12284 . if \\n[#FOOTERS_ON]=1 \{\
12285 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
12288 . if \\n[#FOOTERS_ON]=1 \{\
12289 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
12290 . rm $HDRFTR_CENTER_OLD
12291 . rm $HDRFTR_CENTER_NEW
12293 . ie !\\n[#SUSPEND_PAGINATION] \{\
12294 . if \\n[#PAGE_NUM_V_POS]=1 \{\
12295 . if r#EN_NO_FIRST_PN \{\
12296 . if \\n[#PAGINATION_STATE]=1 \{\
12303 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
12305 . rr #PAGINATION_STATE
12306 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
12307 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
12308 . if \\n[#HEADER_STATE]=1 \{\
12309 . if \\n[#EN_ALLOWS_HEADERS] \{ .HEADERS \}
12311 .\" Collect endnotes title string for TOC
12312 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
12313 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
12314 . ds $TOC_TITLE_ITEM \\*[$EN_STRING]\\|
12317 . if \\n[#PRINT_STYLE]=1 \{\
12320 . if \\n[#PRINT_STYLE]=2 \{\
12321 \!. FAMILY \\*[$TOC_TITLE_FAM]
12322 \!. FT \\*[$TOC_TITLE_FT]
12323 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
12326 . ie \\n[#PRINT_STYLE]=1 \{\
12327 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
12330 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
12335 . if \\n[#PRINT_STYLE]=2 \{\
12336 \!. FAMILY \\*[$TOC_PN_FAM]
12337 \!. FT \\*[$TOC_PN_FT]
12338 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
12341 \!. PRINT \\*[LEADER]
12344 \!. PRINT \\n[#TOC_ENTRY_PN]
12348 .\" End collection of endnotes title string for TOC
12349 .\" Process endnotes
12350 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#EN_LEAD]u \}
12351 . if \\n[#PRINT_STYLE]=2 \{\
12352 . if \\n[#EN_NO_COLS] \{\
12353 . if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
12356 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
12357 . ie \\n[#ADJ_EN_LEAD] \{\
12358 . nr #DOC_LEAD \\n[#EN_LEAD]
12360 . el \{ .DOC_LEAD \\n[#EN_LEAD]u \}
12363 . ie r#EN_TITLE_SPACE \{ .sp |\\n[#EN_TITLE_SPACE]u \}
12364 . el \{ .sp |\\n[#T_MARGIN]u \}
12366 . if \\n[#SLANT_ON] \{\
12370 . if !'\\*[$EN_STRING]'' \{\
12371 . if \\n[#PRINT_STYLE]=1 \{\
12373 . vs \\n[#EN_LEAD]u
12375 . if \\n[#PRINT_STYLE]=2 \{\
12376 . LL \\n[#DOC_L_LENGTH]u
12378 . if \\n[#COLUMNS] \{\
12379 . ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
12380 . el \{ .LL \\n[#COL_L_LENGTH]u \}
12383 . FAMILY \\*[$EN_STRING_FAM]
12384 . FT \\*[$EN_STRING_FT]
12385 . PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
12386 . vs \\n[#EN_LEAD]u
12388 . if '\\*[$EN_STRING_QUAD]'L' \{ .LEFT \}
12389 . if '\\*[$EN_STRING_QUAD]'LEFT' \{ .LEFT \}
12390 . if '\\*[$EN_STRING_QUAD]'C' \{ .CENTER \}
12391 . if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
12392 . if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
12393 . if '\\*[$EN_STRING_QUAD]'R' \{ .RIGHT \}
12394 . if '\\*[$EN_STRING_QUAD]'RIGHT' \{ .RIGHT \}
12396 . if \\n[#EN_STRING_CAPS] \{ .CAPS \}
12397 . ie \\n[#EN_STRING_UNDERSCORE] \{\
12398 . ie \\n[#EN_STRING_UNDERSCORE]=2 \{\
12399 . UNDERSCORE2 "\\*[$EN_STRING]
12402 . UNDERSCORE "\\*[$EN_STRING]
12406 . PRINT "\\*[$EN_STRING]
12410 . if \\n[#PRINT_STYLE]=1 \{\
12411 . ie \\n[#SINGLE_SPACE]=1 \{\
12412 . ALD \\n[#EN_LEAD]u*2u
12415 . ie \\n[#EN_SINGLESPACE]=1 \{\
12416 . ALD \\n[#EN_LEAD]u*2
12423 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#EN_LEAD]u \}
12424 . QUAD \\*[$EN_QUAD]
12430 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#DOC_LEAD]u \}
12431 . if \\n[#PRINT_STYLE]=2 \{\
12432 . ie \\n[#ADJ_EN_LEAD] \{\
12433 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
12435 . el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
12436 . rr #RESTORE_DOC_LEAD
12438 . if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
12439 . if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
12440 . if \\n[#LINENUMBERS]=2 \{\
12441 . NUMBER_LINES RESUME
12442 . nr #LINENUMBERS 1
12447 \# ====================================================================
12449 \# +++BIBLIOGRAPHY+++
12452 Mom treats bibliographies and endnotes very similarly. The chief
12453 difference is that endnotes are collected and formatted inside a
12454 diversion, while bibliographies are built "by hand." ENDNOTES sets
12455 up the endnotes page and outputs the formatted diversion.
12456 BIBLIOGRAPHY sets up the bibliography page, then awaits refer
12459 All of the bibliography control macros have their exact
12460 counterparts in the endnotes control macros. It was tempting to do
12461 fancy stuff with aliases to avoid the repetition, but for reasons
12462 of my own sanity, and for the benefit of anyone wanting to play
12463 around with the bibliography control macros, I decided to keep them
12466 Because the bibliography control macros all have endnotes
12467 equivalents, refer to the appropriate, similar endnote macro for
12468 Arguments, Function and Notes.
12470 \# Bibliography control macros
12472 .MAC BIBLIOGRAPHY_PT_SIZE END
12473 . nr #BIB_PS (p;\\$1)
12476 .MAC BIBLIOGRAPHY_LEAD END
12477 . if !\\n[#OK_PROCESS_LEAD] \{\
12478 . ds $BIB_LEAD \\$1
12480 . ds $ADJUST_BIB_LEAD \\$2
12485 . nr #BIB_LEAD (p;\\$1)
12486 . if '\\$2'ADJUST' \{\
12487 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
12488 . nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
12489 . nr #ADJ_DOC_LEAD 1
12490 . nr #ADJ_BIB_LEAD 1
12491 . nr #NO_TRAP_RESET 1
12492 . DOC_LEAD \\n[#BIB_LEAD]u ADJUST
12493 . nr #BIB_LEAD \\n[#DOC_LEAD]
12494 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
12495 . rr #NO_TRAP_RESET
12496 . nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
12497 . rr #ORIG_DOC_LEAD
12501 .MAC BIBLIOGRAPHY_HDRFTR_CENTER END
12502 . ie '\\$1'' \{ .nr #BIB_HDRFTR_CENTER 1 \}
12503 . el \{ .rr #BIB_HDRFTR_CENTER \}
12506 .MAC BIBLIOGRAPHY_STRING END
12507 . ds $BIB_STRING \\$1
12510 .MAC BIBLIOGRAPHY_STRING_UNDERSCORE END
12511 . ie '\\$1'' \{ .nr #BIB_STRING_UNDERSCORE 1 \}
12513 . ie '\\$1'2' \{ .nr #BIB_STRING_UNDERSCORE 2 \}
12514 . el \{ .nr #BIB_STRING_UNDERSCORE 0 \}
12518 .MAC BIBLIOGRAPHY_STRING_CAPS END
12519 . ie '\\$1'' \{ .nr #BIB_STRING_CAPS 1 \}
12520 . el \{ .rr #BIB_STRING_CAPS \}
12523 .MAC BIBLIOGRAPHY_NO_COLUMNS END
12524 . ie '\\$1'' \{ .nr #BIB_NO_COLS 1 \}
12525 . el \{ .rr #BIB_NO_COLS \}
12528 .MAC BIBLIOGRAPHY_NO_FIRST_PAGENUM END
12529 . ie '\\$1'' \{ .nr #BIB_NO_FIRST_PN 1 \}
12530 . el \{ .rr #BIB_NO_FIRST_PN \}
12533 .MAC BIBLIOGRAPHY_ALLOWS_HEADERS END
12534 . ie '\\$1'' \{ .nr #BIB_ALLOWS_HEADERS 1 \}
12536 . ie '\\$1'ALL' \{\
12537 . nr #BIB_ALLOWS_HEADERS 1
12538 . nr #BIB_ALLOWS_HEADERS_ALL 1
12541 . rr #BIB_ALLOWS_HEADERS
12542 . rr #BIB_ALLOWS_HEADERS_ALL
12547 .MAC BIBLIOGRAPHY_PAGENUM_STYLE END
12548 . ds $BIB_PN_STYLE \\$1
12551 .MAC BIBLIOGRAPHY_FIRST_PAGENUMBER END
12552 . nr #BIB_FIRST_PN \\$1
12555 .MAC SINGLESPACE_BIBLIOGRAPHY END
12556 . if \\n[#PRINT_STYLE]=1 \{\
12557 . ie \\n[#SINGLE_SPACE] \{\
12558 . nr #BIB_SINGLESPACE 1
12560 . if \\n[#OK_PROCESS_LEAD] \{\
12561 . BIBLIOGRAPHY_LEAD 12 ADJUST
12567 . nr #BIB_SINGLESPACE 1
12569 . if \\n[#OK_PROCESS_LEAD] \{\
12570 . BIBLIOGRAPHY_LEAD 12 ADJUST
12575 . rr #BIB_SINGLESPACE
12577 . if \\n[#OK_PROCESS_LEAD] \{\
12578 . BIBLIOGRAPHY_LEAD 24 ADJUST
12587 \# Style for outputting collected bibliographic references
12588 \# -------------------------------------------------------
12590 \# LIST | PLAIN [ <list separator> ] [ <list prefix> ]
12592 \# Sets #BIB_LIST to 1 for numbered list style, 0 for plain output
12594 \# Technically, user is supposed to enter PLAIN if s/he wants an
12595 \# unumbered bibliography, but the el clause says "any arg but
12596 \# LIST means unumbered." Effectively, any arg but LIST produces
12597 \# a "plain" bibliographic list.
12599 \# The 2nd and 3rd args have the same options as the 2nd arg to LIST.
12601 .MAC BIBLIOGRAPHY_TYPE END
12602 . ie '\\$1'LIST' \{\
12605 . if '\\*[$BIB_LIST_SEPARATOR]'' .ds $BIB_LIST_SEPARATOR .
12607 . el .ds $BIB_LIST_SEPARATOR \\$2
12608 . ie '\\$3'' .ds $BIB_LIST_PREFIX
12609 . el .ds $BIB_LIST_PREFIX \\$3
12611 . el \{ .nr #BIB_LIST 0 \}
12614 \# Spacing between items in bibliographies
12615 \# ---------------------------------------
12617 \# <amount of space>
12619 \# Gets value for #BIB_SPACE in units.
12621 \# Requires a unit of measure.
12623 .MAC BIBLIOGRAPHY_SPACING END
12624 . ds $BIB_SPACE \\$1
12625 . if \\n[#BIB_LEAD]=0 \{\
12626 . nr #DEFER_BIB_SPACING 1
12629 . ds $EVAL_BIB_SPACE \\*[$BIB_SPACE]
12630 . substring $EVAL_BIB_SPACE -1
12631 . ie '\\*[$EVAL_BIB_SPACE]'v' \{\
12632 . substring $BIB_SPACE 0 0
12633 . nr #BIB_SPACE \\n[#BIB_LEAD]*\\*[$BIB_SPACE]
12636 . nr #BIB_SPACE (\\$1)
12640 \# Set up bibliography page
12641 \# ------------------------
12643 \# Sets up a new page, with title, ready to accept the output
12644 \# of refer's $LIST$ or .R1 bibliography .R2
12646 \# Bibliography pages are set up almost identically to endnotes pages.
12648 .MAC BIBLIOGRAPHY END
12649 . nr #BIBLIOGRAPHY 1
12650 . nr #BIB_FIRST_PAGE 1
12651 . nr #HEADER_STATE \\n[#HEADERS_ON]
12652 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
12653 . if \\n[#LINENUMBERS]=1 \{\
12655 . nr #LINENUMBERS 2
12657 . if \\n[#HEADERS_ON]=1 \{\
12658 . if !\\n[#BIB_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
12660 . if \\n[#HEADER_STATE]=1 \{\
12661 . ie \\n[#BIB_HDRFTR_CENTER]=1 \{ . \}
12662 . el \{ .rm $HDRFTR_CENTER \}
12664 . ie !\\n[#SUSPEND_PAGINATION] \{\
12665 . if \\n[#PAGINATE]=1 \{\
12666 . if \\n[#PAGE_NUM_V_POS]=1 \{\
12667 . PAGENUM_STYLE \\*[$BIB_PN_STYLE]
12668 . if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN]-1 \}
12669 . if r#BIB_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
12674 . ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
12675 . el \{ .nr #PAGINATE 0 \}
12677 . if \\n[#FOOTERS_ON]=1 \{\
12678 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
12681 . if \\n[#FOOTERS_ON]=1 \{\
12682 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
12683 . rm $HDRFTR_CENTER_OLD
12684 . rm $HDRFTR_CENTER_NEW
12686 . ie !\\n[#SUSPEND_PAGINATION] \{\
12687 . if \\n[#PAGE_NUM_V_POS]=1 \{\
12688 . if r#BIB_NO_FIRST_PN \{\
12689 . if \\n[#PAGINATION_STATE]=1 \{\
12696 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
12698 . rr #PAGINATION_STATE
12699 . PAGENUM_STYLE \\*[$BIB_PN_STYLE]
12700 . if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN] \}
12701 . if \\n[#HEADER_STATE]=1 \{\
12702 . if \\n[#BIB_ALLOWS_HEADERS] \{ .HEADERS \}
12704 .\" Collect bibliography title string for TOC
12705 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
12706 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
12707 . ds $TOC_TITLE_ITEM \\*[$BIB_STRING]\\|
12710 . if \\n[#PRINT_STYLE]=1 \{\
12713 . if \\n[#PRINT_STYLE]=2 \{\
12714 \!. FAMILY \\*[$TOC_TITLE_FAM]
12715 \!. FT \\*[$TOC_TITLE_FT]
12716 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
12719 . ie \\n[#PRINT_STYLE]=1 \{\
12720 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
12723 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
12728 . if \\n[#PRINT_STYLE]=2 \{\
12729 \!. FAMILY \\*[$TOC_PN_FAM]
12730 \!. FT \\*[$TOC_PN_FT]
12731 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
12734 \!. PRINT \\*[LEADER]
12737 \!. PRINT \\n[#TOC_ENTRY_PN]
12741 .\" End collection of bibliography title string for TOC
12742 .\" Process bibliography
12743 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#BIB_LEAD]u \}
12744 . if \\n[#PRINT_STYLE]=2 \{\
12745 . if \\n[#BIB_NO_COLS] \{\
12746 . if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
12749 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
12750 . ie \\n[#ADJ_BIB_LEAD] \{\
12751 . nr #DOC_LEAD \\n[#BIB_LEAD]
12753 . el \{ .DOC_LEAD \\n[#BIB_LEAD]u \}
12756 . ie r#BIB_TITLE_SPACE \{ .sp |\\n[#BIB_TITLE_SPACE]u \}
12757 . el \{ .sp |\\n[#T_MARGIN]u \}
12759 . if \\n[#SLANT_ON] \{\
12762 . if !'\\*[$BIB_STRING]'' \{\
12763 . if \\n[#PRINT_STYLE]=1 \{\
12765 . vs \\n[#BIB_LEAD]u
12767 . if \\n[#PRINT_STYLE]=2 \{\
12768 . LL \\n[#DOC_L_LENGTH]u
12770 . if \\n[#COLUMNS] \{\
12771 . ie \\n[#BIB_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
12772 . el \{ .LL \\n[#COL_L_LENGTH]u \}
12775 . FAMILY \\*[$BIB_STRING_FAM]
12776 . FT \\*[$BIB_STRING_FT]
12777 . PT_SIZE \\n[#BIB_PS]u\\*[$BIB_STRING_SIZE_CHANGE]
12778 . vs \\n[#BIB_LEAD]u
12780 . if '\\*[$BIB_STRING_QUAD]'L' \{ .LEFT \}
12781 . if '\\*[$BIB_STRING_QUAD]'LEFT' \{ .LEFT \}
12782 . if '\\*[$EN_STRING_QUAD]'C' \{ .CENTER \}
12783 . if '\\*[$BIB_STRING_QUAD]'CENTER' \{ .CENTER \}
12784 . if '\\*[$BIB_STRING_QUAD]'CENTRE' \{ .CENTER \}
12785 . if '\\*[$BIB_STRING_QUAD]'R' \{ .RIGHT \}
12786 . if '\\*[$BIB_STRING_QUAD]'RIGHT' \{ .RIGHT \}
12788 . if \\n[#BIB_STRING_CAPS] \{ .CAPS \}
12789 . ie \\n[#BIB_STRING_UNDERSCORE] \{\
12790 . ie \\n[#BIB_STRING_UNDERSCORE]=2 \{\
12791 . UNDERSCORE2 "\\*[$BIB_STRING]
12794 . UNDERSCORE "\\*[$BIB_STRING]
12798 . PRINT "\\*[$BIB_STRING]
12802 . FAMILY \\*[$BIB_FAMILY]
12804 . PT_SIZE -\\*[$BIB_STRING_SIZE_CHANGE]
12805 . if \\n[#PRINT_STYLE]=1 \{\
12806 . ie \\n[#SINGLE_SPACE]=1 \{\
12807 . ALD \\n[#BIB_LEAD]*3u
12810 . ie \\n[#BIB_SINGLESPACE]=1 \{\
12811 . ALD \\n[#BIB_LEAD]u*3u
12814 . ALD \\n[#BIB_LEAD]u
12818 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#BIB_LEAD]u*2u \}
12819 . QUAD \\*[$BIB_QUAD]
12820 . if \\n[#PRINT_STYLE]=1 \{\
12821 . ie \\n[#SINGLE_SPACE]=1 \{\
12822 . vs \\n[#BIB_LEAD]u
12825 . ie \\n[#BIB_SINGLESPACE]=1 \{\
12826 . vs \\n[#BIB_LEAD]u
12829 . vs \\n[#BIB_LEAD]u
12833 . if \\n[#PRINT_STYLE]=2 \{\
12834 . ie \\n[#ADJ_BIB_LEAD] \{\
12835 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
12837 . el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
12838 . rr #RESTORE_DOC_LEAD
12840 . if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
12841 . if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
12843 . if \\n[#LINENUMBERS]=2 \{\
12844 . NUMBER_LINES RESUME
12845 . nr #LINENUMBERS 1
12849 \# ====================================================================
12851 \# +++TABLE OF CONTENTS+++
12853 \# Strings to allocate space for leaders and entry page numbers
12855 .ds $TOC_PN \\*[ST100]\\F[\\*[$TOC_PN_FAM]]\\f[\\*[$TOC_PN_FT]]\\s[\\n[#TOC_PS]u]#\\*[ST100X]\\*[ST101]\\s[\\*[$TOC_PN_SIZE_CHANGE]]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\*[ST101X]
12856 .ds $TOC_PN_TYPEWRITE \\*[ST100]#\\*[ST100X]\\*[ST101]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST101X]
12858 \# TOC ENTRIES PAGE NUMBERS PADDING
12859 \# --------------------------------
12861 \# <number of placeholders for toc entries page numbers>
12863 \# Creates or modifies register #TOC_PN_PADDING.
12865 \# "Placeholders" is the maximum number of digits in a page
12870 .MAC TOC_PADDING END
12871 . nr #TOC_PN_PADDING \\$1
12878 \# <none> | <anything>
12880 \# Creates or removes register #PAGINATE_TOC.
12882 \# Default is to paginate toc.
12884 .MAC PAGINATE_TOC END
12885 . ie '\\$1'' \{ .nr #PAGINATE_TOC 1 \}
12886 . el \{ .nr #PAGINATE_TOC 0 \}
12893 \# <base point size for toc pages>
12895 \# Creates or modifies register #TOC_PS.
12897 \# This size control macro differs from other size control macros
12898 \# in that it sets an absolute point size, not a relative one.
12899 \# See notes for ENDNOTE_PT_SIZE for explanation. No unit of
12900 \# measure required.
12902 \# No unit of measure required (points assumed). Default is 11.5
12905 .MAC TOC_PT_SIZE END
12906 . nr #TOC_PS (p;\\$1)
12913 \# <leading for toc pages> [ADJUST]
12915 \# Creates or modifies register #TOC_LEAD. If optional ADJUST
12916 \# given, adjusts lead to fill page. If #OK_PROCESS_LEAD doesn't
12917 \# exist, stores arguments for when it's okay to run the macro.
12919 \# No unit of measure required (points assumed).
12921 \# Default is same as DOC_LEAD.
12924 . if !\\n[#OK_PROCESS_LEAD] \{\
12925 . ds $TOC_LEAD \\$1
12927 . ds $ADJUST_TOC_LEAD \\$2
12932 . nr #TOC_LEAD (p;\\$1)
12933 . if '\\$2'ADJUST' \{\
12934 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
12935 . nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
12936 . nr #ADJ_DOC_LEAD 1
12937 . nr #ADJ_TOC_LEAD 1
12938 . nr #NO_TRAP_RESET 1
12939 . DOC_LEAD \\n[#TOC_LEAD]u ADJUST
12940 . nr #TOC_LEAD \\n[#DOC_LEAD]
12941 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
12942 . rr #NO_TRAP_RESET
12943 . nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
12944 . rr #ORIG_DOC_LEAD
12949 \# TOC PAGES PAGE-NUMBERING STYLE
12950 \# ------------------------------
12952 \# DIGIT | ROMAN | roman | ALPHA | alpha
12954 \# Creates or modifies string $TOC_PN_STYLE
12956 \# Page numbering style for page numbers that appear in the
12957 \# headers/footers of toc pages. See notes for PAGENUM_STYLE.
12959 \# Default is roman.
12961 .MAC TOC_PAGENUM_STYLE END
12962 . ds $TOC_PN_STYLE \\$1
12966 \# TOC RECTO_VERSO SWITCH
12967 \# ----------------------
12969 \# <none> | <anything>
12971 \# Creates or removes register #TOC_RV_SWITCH
12973 \# Allows switching of L/R margins if a doc is recto/verso and
12974 \# the first toc page happens to fall the wrong way
12976 .MAC TOC_RV_SWITCH END
12977 . ie '\\$1'' \{ .nr #TOC_RV_SWITCH 1 \}
12978 . el \{ .rr #TOC_RV_SWITCH \}
12981 \# - for TOC "doc header" (i.e. "Contents")
12983 \# TOC HEADER STRING
12984 \# -----------------
12986 \# <string for "doc header" of first toc page>
12988 \# Creates or modifies string $TOC_HEADER_STRING
12990 \# Default is "Contents".
12992 .MAC TOC_HEADER_STRING END
12993 . ds $TOC_HEADER_STRING \\$1
12996 \# - for TOC entries page number numerals
12998 \# Control macros for toc doc titles, heads, subheads and paraheads
12999 \# ----------------------------------------------------------------
13001 \# All these control macros behave the same way, setting the family,
13002 \# font, point size and indent from the left margin of the different
13003 \# kinds of entries that can appear in the toc. The way they
13004 \# operate is identical to all other _FAMILY, _FONT and _SIZE
13005 \# control macros. _INDENT takes an absolute value.
13006 \# TOC_APPENDS_AUTHORS is unique in this section.
13008 \# - for title entries
13010 .MAC TOC_TITLE_INDENT END
13011 . nr #TOC_TITLE_INDENT (\\$1)
13015 .MAC TOC_TITLE_ENTRY END
13016 . nr #USER_SET_TITLE_ITEM 1
13017 . ds $USER_SET_TITLE_ITEM \\$1
13021 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
13022 \# -----------------------------------------
13024 \# <none> | <name(s) of author(s) as they should appear in toc doc title entries>
13026 \# Creates register #TOC_AUTHORS (to tell TOC to append authors
13027 \# to toc doc title entries). Optionally creates string
13030 \# Normally, TOC does not append the author(s) to a toc doc title
13031 \# entry. This special macro instructs TOC to do so.
13033 \# If user has multiple authors for each doc when collating,
13034 \# TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
13035 \# COLLATE and START in each doc. Otherwise, mom prints only the
13036 \# first author given to AUTHOR.
13038 .MAC TOC_APPENDS_AUTHOR END
13039 . nr #TOC_AUTHORS 1
13041 . ds $TOC_AUTHORS \\$1
13045 \# - for head entries
13047 .MAC TOC_HEAD_INDENT END
13048 . nr #TOC_HEAD_INDENT (\\$1)
13051 \# - for subhead entries
13053 .MAC TOC_SUBHEAD_INDENT END
13054 . nr #TOC_SH_INDENT (\\$1)
13057 \# - for parahead entries
13059 .MAC TOC_PARAHEAD_INDENT END
13060 . nr #TOC_PH_INDENT (\\$1)
13065 . if \\n[#LINENUMBERS]=1 \{\
13067 . nr #LINENUMBERS 2
13069 . if !r#PAGINATE_TOC \{ .PAGINATE_TOC \}
13070 . nr #TOC_FIRST_PAGE 1
13071 . if \\n[#FINIS] \{\
13072 . if \\n[#FOOTERS_WERE_ON] \{\
13073 . FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
13076 . if \\n[#FOOTERS_ON]=1 \{\
13077 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
13078 . ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
13079 . el \{ .PAGINATION OFF \}
13081 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS OFF \} \" But have to turn FOOTERS off again so they don't print when FINIS was called
13083 . if \\n[#FINIS] \{\
13084 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \} \" Finally, turn footers on if they were on
13085 . rr #FOOTERS_WERE_ON
13086 . if \\n[#PAGINATION_WAS_ON] \{\
13088 . rr #PAGINATION_WAS_ON
13092 . ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
13093 . el \{ .PAGINATION OFF \}
13094 . if \\n[#FOOTERS_ON]=1 \{\
13095 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
13096 . rm $HDRFTR_CENTER_OLD
13097 . rm $HDRFTR_CENTER_NEW
13102 . if \\n[#PRINT_STYLE]=1 \{\
13104 . DOC_LEAD 24 ADJUST
13107 . if \\n[#LINENUMBERS]=2 \{ .nr #LINENUMBERS 3 \}
13111 . if \\n[#PRINT_STYLE]=2 \{\
13112 . ie r#ADJ_TOC_LEAD \{\
13113 . nr #NO_TRAP_RESET 1
13114 . DOC_LEAD \\n[#TOC_LEAD]u ADJUST
13115 . rr #NO_TRAP_RESET
13117 . el \{ .DOC_LEAD \\n[#TOC_LEAD]u \}
13119 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
13120 . if \\n[#SLANT_ON] \{\
13123 . DOC_LINE_LENGTH \\n[#DOC_L_LENGTH]u
13124 . QUAD \\*[$TOC_HEADER_QUAD]
13125 . PAGENUM_STYLE \\*[$TOC_PN_STYLE]
13126 . if \\n[#PRINT_STYLE]=1 \{\
13129 . if \\n[#PRINT_STYLE]=2 \{\
13130 . FAMILY \\*[$TOC_HEADER_FAM]
13131 . FT \\*[$TOC_HEADER_FT]
13132 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
13134 . ie \\n[#PRINT_STYLE]=1 \{\
13137 . PRINT "\\*[$TOC_HEADER_STRING]"
13142 . PRINT "\\*[$TOC_HEADER_STRING]"
13146 .\" In collated docs, this bit inserts the first doc's title
13147 .\" underneath the TOC header, before the TOC_ENTRIES diversion
13150 . if d$FIRST_DOC_TITLE \{\
13151 . nr #RESTORE_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
13152 . TOC_PADDING \\n[#FIRST_DOC_TOC_PN_PADDING]
13153 . if \\n[#PRINT_STYLE]=2 \{\
13154 . FAMILY \\*[$TOC_TITLE_FAM]
13155 . FT \\*[$TOC_TITLE_FT]
13156 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
13158 . ie \\n[#PRINT_STYLE]=1 \{\
13159 . PAD "\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN_TYPEWRITE]"
13162 . PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN]"
13167 . if \\n[#PRINT_STYLE]=2 \{\
13168 . FAMILY \\*[$TOC_PN_FAM]
13169 . FT \\*[$TOC_PN_FT]
13170 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
13173 . PRINT \\*[LEADER]
13175 . PRINT \\n[#FIRST_DOC_TITLE_PN]
13178 . TOC_PADDING \\n[#RESTORE_TOC_PN_PADDING]
13183 . if \\n[#LINENUMBERS]=3 \{\
13184 . NUMBER_LINES RESUME
13185 . nr #LINENUMBERS 1
13190 \# ====================================================================
13197 \# <number of columns> <width of gutters>
13199 \# Creates registers associated with setting docs in columns.
13200 \# Calculates column line lengths and offsets
13202 \# COLUMNS, if used, s/b the last macro invoked before START.
13205 . if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
13207 . nr #NUM_COLS \\$1
13208 . nr #GUTTER (\\$2)
13209 . nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
13210 . nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
13212 . while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13213 . nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
13214 . nr #COL_TOTAL \\n+[#COL_TOTAL]
13216 . if \\n[#NUM_COLS]=1 \{\
13217 . if !\\n[#COLLATE]=1 \{ .MN_INIT \}
13229 \# Breaks current column and moves to next column.
13230 \# If current column is the last on the page, breaks
13234 . if \\n[#COLUMNS] \{\
13236 . ie '\\$0'COL_NEXT' \{ .br \}
13241 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13248 \# ====================================================================
13255 \# [ BULLET | DASH | DIGIT | alpha | ALPHA | roman | ROMAN | USER ] [ <separator> | NONE ] [ <prefix> ] [ <anything> ]
13257 \# Stores indent information in effect prior to invocation and
13258 \# initializes a list with the supplied enumerator (and separator).
13260 \# Default enumerator is a bullet.
13262 \# Enumerator *must* be supplied for every list that's to the
13263 \# right of another list, every time, unless the default bullet is
13266 \# <anything> moves back one list level intuitively, or exits lists
13267 \# completely if the level in which it's invoked is the first.
13270 . ds $1ST_LETTER \\$1
13271 . substring $1ST_LETTER 0 0
13272 . if '\\*[$1ST_LETTER]'r' .ds $1ST_LETTER R
13273 . ie '\\*[$1ST_LETTER]'R' \{\
13274 . ds $LAST_CHAR \\$1
13275 . substring $LAST_CHAR -1
13276 . if !\B'\\*[$LAST_CHAR]' \{\
13277 . tm1 "[mom]: You must append a number to the \\$1 argument to LIST at line \\n(.c.
13278 . tm1 " The number should be the total number of items in this list.
13279 . tm1 " See the documentation.
13282 . ds $ROMAN_WIDTH \\$1
13283 . substring $ROMAN_WIDTH 1
13284 . while !\B'\\*[$ROMAN_WIDTH]' \{\
13285 . substring $ROMAN_WIDTH 1
13287 . length #ROMAN_LENGTH \\*[$ROMAN_WIDTH]
13288 . ds $LIST_ARG_1 \\$1
13289 . substring $LIST_ARG_1 0 -(\\n[#ROMAN_LENGTH]+1)
13292 . ds $LIST_ARG_1 \\$1
13295 . nr #STORED_HL_INDENT \\n[#HL_INDENT]
13296 . nr #STORED_T_INDENT \\n[#T_INDENT]
13297 . nr #CURRENT_L_LENGTH \\n(.l
13299 . if \\n[#INDENT_ACTIVE]=1 \{\
13300 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
13301 . nr #STORED_L_INDENT \\n[#L_INDENT]
13302 . nr #RESTORE_PREV_INDENT 1
13304 . if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
13305 . nr #STORED_BL_INDENT \\n[#BL_INDENT]
13306 . nr #STORED_BR_INDENT \\n[#BR_INDENT]
13308 . nr #ORIG_L_LENGTH \\n(.l
13310 . nr #RESTORE_PREV_INDENT 2
13312 . if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
13313 . nr #STORED_R_INDENT \\n[#R_INDENT]
13315 . nr #ORIG_L_LENGTH \\n(.l
13317 . nr #RESTORE_PREV_INDENT 3
13318 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{ .nr #RESTORE_PREV_INDENT 4 \}
13322 . if \\n[#NUM_ARGS]=0 \{\
13323 . nr #ARGS_TO_LIST 1 \" So default behaves as if LIST BULLET
13324 . ds $ENUMERATOR\\n+[#DEPTH] \(bu
13325 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
13328 . if \\n[#NUM_ARGS]>0 \{\
13329 . rr #ARGS_TO_LIST \" Clear this before processing arg 1.
13330 . if '\\*[$LIST_ARG_1]'DASH' \{\
13331 . nr #ARGS_TO_LIST 1
13332 . ds $ENUMERATOR\\n+[#DEPTH] \(en
13333 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
13334 . ds $SEPARATOR\\n[#DEPTH]
13336 . if '\\*[$LIST_ARG_1]'BULLET' \{\
13337 . nr #ARGS_TO_LIST 1
13338 . ds $ENUMERATOR\\n+[#DEPTH] \(bu
13339 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
13340 . ds $SEPARATOR\\n[#DEPTH]
13342 . if '\\*[$LIST_ARG_1]'DIGIT' \{\
13343 . nr #ARGS_TO_LIST 1
13344 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
13345 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
13346 . ds $SEPARATOR\\n[#DEPTH] .
13347 . ds $PREFIX\\n[#DEPTH]
13348 . if \\n[#NUM_ARGS]>=2 \{\
13349 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
13350 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
13351 . if \\n[#NUM_ARGS]=3 \{\
13352 . ds $PREFIX\\n[#DEPTH] \\$3
13356 . if '\\*[$LIST_ARG_1]'alpha' \{\
13357 . nr #ARGS_TO_LIST 1
13358 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
13359 . af #ENUMERATOR\\n[#DEPTH] a
13360 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
13361 . ds $SEPARATOR\\n[#DEPTH] )
13362 . ds $PREFIX\\n[#DEPTH]
13363 . if \\n[#NUM_ARGS]>=2 \{\
13364 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
13365 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
13366 . if \\n[#NUM_ARGS]=3 \{\
13367 . ds $PREFIX\\n[#DEPTH] \\$3
13371 . if '\\*[$LIST_ARG_1]'ALPHA' \{\
13372 . nr #ARGS_TO_LIST 1
13373 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
13374 . af #ENUMERATOR\\n[#DEPTH] A
13375 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
13376 . ds $SEPARATOR\\n[#DEPTH] )
13377 . ds $PREFIX\\n[#DEPTH]
13378 . if \\n[#NUM_ARGS]>=2 \{\
13379 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
13380 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
13381 . if \\n[#NUM_ARGS]=3 \{\
13382 . ds $PREFIX\\n[#DEPTH] \\$3
13386 . if '\\*[$1ST_LETTER]'R' \{\
13387 . nr #ARGS_TO_LIST 1
13388 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
13389 . if '\\*[$LIST_ARG_1]'roman' \{\
13390 . af #ENUMERATOR\\n[#DEPTH] i
13392 . if '\\*[$LIST_ARG_1]'ROMAN' \{\
13393 . af #ENUMERATOR\\n[#DEPTH] I
13395 . ds $ENUMERATOR_TYPE\\n[#DEPTH] roman
13396 . ds $SEPARATOR\\n[#DEPTH] )
13397 . ds $PREFIX\\n[#DEPTH]
13398 . if \\n[#NUM_ARGS]>=2 \{\
13399 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
13400 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
13401 . if \\n[#NUM_ARGS]=3 \{\
13402 . ds $PREFIX\\n[#DEPTH] \\$3
13406 . if '\\*[$LIST_ARG_1]'USER' \{\
13407 . nr #ARGS_TO_LIST 1
13408 . ds $ENUMERATOR\\n+[#DEPTH] \\$2
13409 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
13410 . ds $SEPARATOR\\n[#DEPTH]
13411 . ds $PREFIX\\n[#DEPTH]
13413 . if \\n[#NUM_ARGS]=1 \{\
13414 . if !r#ARGS_TO_LIST \{\
13415 . ie \\n[#DEPTH]=1 \{\
13416 . ie \\n[#NEXT_DEPTH_BACK]=0 \{\
13418 . if \\n[#QUIT]=1 \{\
13436 . nr #TOTAL_LISTS \\n[#DEPTH]
13437 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
13438 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]m\\*[$SEPARATOR\\n[#DEPTH]]\ '
13439 . if '\\*[$LIST_ARG_1]'ALPHA'\{\
13440 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]M\\*[$SEPARATOR\\n[#DEPTH]]\ '
13443 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
13446 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \{\
13447 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$ENUMERATOR\\n[#DEPTH]]\0'
13449 . LL \\n[#CURRENT_L_LENGTH]u
13450 . ie \\n[#DEPTH]=1 \{\
13451 . ie \\n[#INDENT_ACTIVE]=1 \{\
13452 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
13453 . nr #L_INDENT \\n[#L_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
13454 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
13455 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
13457 . if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
13458 . nr #L_INDENT \\n[#BL_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
13459 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
13460 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
13462 . if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
13463 . ie \\n[#INDENT_LEFT_ACTIVE]=1 \{\
13464 . \" Don't do anything; we already have a left indent
13467 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
13468 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
13473 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
13474 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
13478 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
13479 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
13489 \# Prints enumerator for a given list depth and prepares mom to
13490 \# receive the text of an item.
13493 . if \\n[#LINENUMBERS]=1 \{\
13495 . nr #LINENUMBERS 2
13497 . if \\n[#KERN]=1 \{\
13498 . nr #KERN_WAS_ON 1
13502 . ll \\n[#CURRENT_L_LENGTH]u \" Set ll again because IL turns IB off.
13504 . HI \\n[#HL_INDENT\\n[#DEPTH]]u
13505 . if '\\*[$SEPARATOR\\n[#DEPTH]]')' \{ .nr #SEP_TYPE 1 \}
13506 . if '\\*[$SEPARATOR\\n[#DEPTH]]']' \{ .nr #SEP_TYPE 1 \}
13507 . if '\\*[$SEPARATOR\\n[#DEPTH]]'}' \{ .nr #SEP_TYPE 1 \}
13508 . ie \\n[#IN_BIB_LIST]=1 \{\
13509 . ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
13510 . ie \\n[#SEP_TYPE]=1 \{\
13511 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13514 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13518 . ie \\n[#SEP_TYPE]=1 \{\
13519 . PRINT \h'-\w'\0'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13522 . PRINT \h'-\w'\0'u'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13527 . ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
13529 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
13530 . ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
13531 . ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
13532 . ie \\n[#SEP_TYPE]=1 \{\
13533 . PRINT \0\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13536 . PRINT \0\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13540 . ie \\n[#SEP_TYPE]=1 \{\
13541 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13544 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13549 . ie \\n[#SEP_TYPE]=1 \{\
13550 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13553 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13559 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'A' \{\
13560 . ie \\n[#SEP_TYPE]=1 \{\
13561 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13564 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13569 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13575 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
13576 . ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
13577 .\" ROMAN I, padded
13578 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
13579 . ie \\n[#SEP_TYPE]=1 \{\
13580 . PRINT "\h'\\n[#LIST_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\n[#SEPARATOR\\n[#DEPTH]]\ 'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13583 . PRINT "\h'\\n[#LIST_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\n[#SEPARATOR\\n[#DEPTH]]\ 'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13586 .\" roman i, padded
13588 . PRINT "\h'\\n[#LIST_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\n[#SEPARATOR\\n[#DEPTH]]\ 'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13593 .\" ROMAN I, no pad
13594 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
13595 . ie \\n[#SEP_TYPE]=1 \{\
13596 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
13599 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13602 .\" roman i, no pad
13604 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13608 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \{\
13609 . PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
13614 . if \\n[#REF]=1 \{\
13615 . IL +\\*[$REF_BIB_INDENT]
13616 . ti \\n[#L_INDENT]u-\\*[$REF_BIB_INDENT]
13619 . if \\n[#KERN_WAS_ON]=1 \{\
13623 . if \\n[#LINENUMBERS]=2 \{\
13624 . NUMBER_LINES RESUME
13625 . nr #LINENUMBERS 1
13629 \# A utility macro that determines the space to reserve for
13630 \# roman numeral enumerated lists. Limit is 20 roman numerals
13631 \# per list. If this isn't enough, the user can add to the
13634 .MAC GET_ROMAN_INDENT END
13635 . if '\\*[$LIST_ARG_1]'roman' \{\
13636 . if '\\*[$ROMAN_WIDTH]'1' \{\
13637 . ds $ROMAN_WIDTH\\n[#DEPTH] 1
13638 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]i\\*[$SEPARATOR\\n[#DEPTH]]\0'
13640 . if '\\*[$ROMAN_WIDTH]'2' \{\
13641 . ds $ROMAN_WIDTH\\n[#DEPTH] 2
13642 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]ii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13644 . if '\\*[$ROMAN_WIDTH]'3' \{\
13645 . ds $ROMAN_WIDTH\\n[#DEPTH] 3
13646 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13648 . if '\\*[$ROMAN_WIDTH]'4' \{\
13649 . ds $ROMAN_WIDTH\\n[#DEPTH] 4
13650 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13652 . if '\\*[$ROMAN_WIDTH]'5' \{\
13653 . ds $ROMAN_WIDTH\\n[#DEPTH] 5
13654 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13656 . if '\\*[$ROMAN_WIDTH]'6' \{\
13657 . ds $ROMAN_WIDTH\\n[#DEPTH] 6
13658 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13660 . if '\\*[$ROMAN_WIDTH]'7' \{\
13661 . ds $ROMAN_WIDTH\\n[#DEPTH] 7
13662 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]vii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13664 . if '\\*[$ROMAN_WIDTH]'8' \{\
13665 . ds $ROMAN_WIDTH\\n[#DEPTH] 8
13666 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13668 . if '\\*[$ROMAN_WIDTH]'9' \{\
13669 . ds $ROMAN_WIDTH\\n[#DEPTH] 9
13670 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13672 . if '\\*[$ROMAN_WIDTH]'10' \{\
13673 . ds $ROMAN_WIDTH\\n[#DEPTH] 10
13674 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13676 . if '\\*[$ROMAN_WIDTH]'11' \{\
13677 . ds $ROMAN_WIDTH\\n[#DEPTH] 11
13678 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13680 . if '\\*[$ROMAN_WIDTH]'12' \{\
13681 . ds $ROMAN_WIDTH\\n[#DEPTH] 12
13682 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13684 . if '\\*[$ROMAN_WIDTH]'13' \{\
13685 . ds $ROMAN_WIDTH\\n[#DEPTH] 13
13686 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13688 . if '\\*[$ROMAN_WIDTH]'14' \{\
13689 . ds $ROMAN_WIDTH\\n[#DEPTH] 14
13690 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13692 . if '\\*[$ROMAN_WIDTH]'15' \{\
13693 . ds $ROMAN_WIDTH\\n[#DEPTH] 15
13694 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13696 . if '\\*[$ROMAN_WIDTH]'16' \{\
13697 . ds $ROMAN_WIDTH\\n[#DEPTH] 16
13698 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13700 . if '\\*[$ROMAN_WIDTH]'17' \{\
13701 . ds $ROMAN_WIDTH\\n[#DEPTH] 17
13702 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xvii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13704 . if '\\*[$ROMAN_WIDTH]'18' \{\
13705 . ds $ROMAN_WIDTH\\n[#DEPTH] 18
13706 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13708 . if '\\*[$ROMAN_WIDTH]'19' \{\
13709 . ds $ROMAN_WIDTH\\n[#DEPTH] 19
13710 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13712 . if '\\*[$ROMAN_WIDTH]'20' \{\
13713 . ds $ROMAN_WIDTH\\n[#DEPTH] 20
13714 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
13717 . if '\\*[$LIST_ARG_1]'ROMAN' \{\
13718 . if '\\*[$ROMAN_WIDTH]'1' \{\
13719 . ds $ROMAN_WIDTH\\n[#DEPTH] 1
13720 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]I\\*[$SEPARATOR\\n[#DEPTH]]\0'
13722 . if '\\*[$ROMAN_WIDTH]'2' \{\
13723 . ds $ROMAN_WIDTH\\n[#DEPTH] 2
13724 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]II\\*[$SEPARATOR\\n[#DEPTH]]\0'
13726 . if '\\*[$ROMAN_WIDTH]'3' \{\
13727 . ds $ROMAN_WIDTH\\n[#DEPTH] 3
13728 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]III\\*[$SEPARATOR\\n[#DEPTH]]\0'
13730 . if '\\*[$ROMAN_WIDTH]'4' \{\
13731 . ds $ROMAN_WIDTH\\n[#DEPTH] 4
13732 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13734 . if '\\*[$ROMAN_WIDTH]'5' \{\
13735 . ds $ROMAN_WIDTH\\n[#DEPTH] 5
13736 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13738 . if '\\*[$ROMAN_WIDTH]'6' \{\
13739 . ds $ROMAN_WIDTH\\n[#DEPTH] 6
13740 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13742 . if '\\*[$ROMAN_WIDTH]'7' \{\
13743 . ds $ROMAN_WIDTH\\n[#DEPTH] 7
13744 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13746 . if '\\*[$ROMAN_WIDTH]'8' \{\
13747 . ds $ROMAN_WIDTH\\n[#DEPTH] 8
13748 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13750 . if '\\*[$ROMAN_WIDTH]'9' \{\
13751 . ds $ROMAN_WIDTH\\n[#DEPTH] 9
13752 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13754 . if '\\*[$ROMAN_WIDTH]'10' \{\
13755 . ds $ROMAN_WIDTH\\n[#DEPTH] 10
13756 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13758 . if '\\*[$ROMAN_WIDTH]'11' \{\
13759 . ds $ROMAN_WIDTH\\n[#DEPTH] 11
13760 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13762 . if '\\*[$ROMAN_WIDTH]'12' \{\
13763 . ds $ROMAN_WIDTH\\n[#DEPTH] 12
13764 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13766 . if '\\*[$ROMAN_WIDTH]'13' \{\
13767 . ds $ROMAN_WIDTH\\n[#DEPTH] 13
13768 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13770 . if '\\*[$ROMAN_WIDTH]'14' \{\
13771 . ds $ROMAN_WIDTH\\n[#DEPTH] 14
13772 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13774 . if '\\*[$ROMAN_WIDTH]'15' \{\
13775 . ds $ROMAN_WIDTH\\n[#DEPTH] 15
13776 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13778 . if '\\*[$ROMAN_WIDTH]'16' \{\
13779 . ds $ROMAN_WIDTH\\n[#DEPTH] 16
13780 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
13782 . if '\\*[$ROMAN_WIDTH]'17' \{\
13783 . ds $ROMAN_WIDTH\\n[#DEPTH] 17
13784 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13786 . if '\\*[$ROMAN_WIDTH]'18' \{\
13787 . ds $ROMAN_WIDTH\\n[#DEPTH] 18
13788 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13790 . if '\\*[$ROMAN_WIDTH]'19' \{\
13791 . ds $ROMAN_WIDTH\\n[#DEPTH] 19
13792 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13794 . if '\\*[$ROMAN_WIDTH]'20' \{\
13795 . ds $ROMAN_WIDTH\\n[#DEPTH] 20
13796 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
13804 \# <amount by which to indent a list to the right>
13806 \# Adds the value of the arg to the current list's indent.
13808 \# Requires a unit of measure.
13810 .MAC SHIFT_LIST END
13811 . ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
13812 . nr #SHIFT_LIST\\n[#DEPTH] (\\$1)
13813 . nr #LIST_INDENT\\n[#DEPTH] \\n(.i+\\n[#L_INDENT]+\\n[#SHIFT_LIST\\n[#DEPTH]]
13814 . nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]
13817 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]+(\\$1)
13818 . nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]
13828 \# Adds a figure space to a list's hanging and left indent. If
13829 \# LEFT is given, sets reg. #PAD_LIST_DIGITS to 1 for use in ITEM.
13831 .MAC PAD_LIST_DIGITS END
13832 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
13833 . nr #LIST_INDENT\\n[#DEPTH] +\\w'\\0'
13834 . nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#LIST_INDENT\\n-[#DEPTH]]
13835 . nr #HL_INDENT\\n+[#DEPTH] +\\w'\\n[#ENUMERATOR\\n[#DEPTH]]'
13836 . if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
13838 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'i' \{\
13839 . if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
13841 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
13842 . if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
13852 \# Resets register enumerators to 1 or a.
13854 .MAC RESET_LIST END
13855 . ie '\\$1'' \{ .nr #ENUMERATOR\\n[#DEPTH] 0 1 \}
13856 . el \{ .nr #ENUMERATOR\\n[#DEPTH] \\$1-1 1 \}
13865 \# Exits lists cleanly and restores any indents that were in
13866 \# effect prior to LIST.
13868 .MAC QUIT_LISTS END
13870 . nr #HL_INDENT \\n[#STORED_HL_INDENT]
13871 . nr #T_INDENT \\n[#STORED_T_INDENT]
13872 . rr #STORED_HL_INDENT
13873 . if \\n[#RESTORE_PREV_INDENT]=1 \{\
13874 . nr #L_INDENT \\n[#STORED_L_INDENT]
13876 . rr #STORED_L_INDENT
13878 . if \\n[#RESTORE_PREV_INDENT]=2 \{\
13879 . nr #BL_INDENT \\n[#STORED_BL_INDENT]
13880 . nr #BR_INDENT \\n[#STORED_BR_INDENT]
13881 . LL \\n[#ORIG_L_LENGTH]u
13883 . rr #STORED_BL_INDENT
13884 . rr #STORED_BR_INDENT
13886 . if \\n[#RESTORE_PREV_INDENT]=3 \{\
13887 . nr #R_INDENT \\n[#STORED_R_INDENT]
13888 . LL \\n[#ORIG_L_LENGTH]u
13890 . rr #STORED_R_INDENT
13892 . if \\n[#RESTORE_PREV_INDENT]=4 \{\
13893 . nr #R_INDENT \\n[#STORED_R_INDENT]
13894 . nr #L_INDENT \\n[#STORED_L_INDENT]
13895 . LL \\n[#ORIG_L_LENGTH]u
13898 . rr #STORED_R_INDENT
13899 . rr #STORED_L_INDENT
13901 .\" Clean up after exiting last depth of list
13903 . while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\
13904 . rr #LIST_INDENT\\n[#REMOVE]
13905 . rr #ENUMERATOR\\n[#REMOVE]
13906 . rm $ENUMERATOR\\n[#REMOVE]
13907 . rr #SEPARATOR\\n[#REMOVE]
13908 . rm $ENUMERATOR_TYPE\\n[#REMOVE]
13909 . rr #PAD_LIST_DIGITS\\n[#REMOVE]
13915 . rr #NEXT_DEPTH_BACK
13916 . rr #RESTORE_PREV_INDENT
13917 . rr #ORIG_L_LENGTH
13918 . rr #CURRENT_L_LENGTH
13927 \# Restores indent of prev. list in nested lists. Also sets the
13928 \# #QUIT register if an invocation of LIST OFF applies to the first
13931 .MAC SET_LIST_INDENT END
13932 . nr #NEXT_DEPTH_BACK \\n[#DEPTH]-1
13933 . if \\n[#NEXT_DEPTH_BACK]=0 \{\
13937 . nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]]
13938 . nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]]
13941 \# ====================================================================
13943 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
13950 \# Turns headers off (if on) and saves header state, sets register
13951 \# #COLLATE to 1 (toggle), and breaks to a new page.
13953 \# COLLATE exists primarily to allow putting multiple chapters in
13954 \# a single file, although it can be used for any document type. After
13955 \# COLLATE, any of the macros that normally precede START may be
13956 \# used, and should behave as expected.
13958 \# N.B.--the START macro *must* be used after COLLATE (and any other
13959 \# macros that alter mom's behaviour).
13963 . nr #HEADER_STATE \\n[#HEADERS_ON]
13965 . if \\n[#PAGE_NUM_V_POS]=1 \{\
13966 . nr #PAGINATION_STATE \\n[#PAGINATE]
13971 .\" Collect first doc's title for TOC
13972 . if \\n[#COLLATED_DOC]=0 \{\
13973 . ie \\n[#USER_SET_TITLE_ITEM] \{\
13974 . ds $FIRST_DOC_TITLE \\*[$USER_SET_TITLE_ITEM]\\|
13975 . rr #USER_SET_TITLE_ITEM
13976 . rm $USER_SET_TITLE_ITEM
13979 . ie \\n[#DOC_TYPE]=2 \{\
13980 . ie '\\*[$CHAPTER_TITLE]'' \{\
13981 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
13984 . ie '\\*[$CHAPTER]'' \{\
13985 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_TITLE]\\|
13988 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
13993 . ds $FIRST_DOC_TITLE \\*[$TITLE]\\|
13996 . if \\n[#TOC_AUTHORS]=1 \{\
13997 . ie '\\*[$TOC_AUTHORS]'' \{\
13998 . as $FIRST_DOC_TITLE /\\|\\*[$AUTHOR_1]\\|
14001 . as $FIRST_DOC_TITLE /\\|\\*[$TOC_AUTHORS]\\|
14005 . nr #COLLATED_DOC 1
14007 .\" End title collection for TOC
14008 . LL \\n[#DOC_L_LENGTH]u
14010 . nr #SAVED_DOC_LEAD \\n[#DOC_LEAD]
14011 . LS \\n[#DOC_LEAD]u
14016 . if \\n[#DEFER_PAGINATION] \{ .PAGINATE \}
14017 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
14018 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
14019 . rm $RESTORE_PAGENUM_STYLE
14022 . rr #PAGENUM_STYLE_SET
14029 \# <starting line number> [ <increment> [ <gutter> ] ]
14031 \# <anything> | RESUME
14033 \# Begin, suspend/turn off, or resume numbering of output lines.
14035 .MAC NUMBER_LINES END
14037 . if '\\n(.z'EPI_TEXT' \{ .return \}
14039 . tm1 "[mom]: NUMBER_LINES at line \\n(.c has no argument.
14040 . tm1 " Most likely, you have forgotten to give it a starting line number.
14041 . ab Aborting on NUMBER_LINES.
14043 . if !\\n[#LINENUMBERS]=2 \{ .nr #LINENUMBERS 1 \}
14044 .\" Test whether the first arg is a digit.
14048 . if !'\\n(.z'' \{ .nr #RESTORE_LN_NUM 1 \}
14050 . if '\\*[$LN_INC]'' .ds $LN_INC 1
14052 . el .ds $LN_INC \\$2
14054 . if '\\*[$LN_GUTTER]'' .ds $LN_GUTTER 2
14056 . el .ds $LN_GUTTER \\$3
14059 .\" In other words, the first arg was not a digit.
14061 . ie '\\$1'RESUME' \{\
14066 . if !\\n[#LINENUMBERS]=2 \{ .rr #LINENUMBERS \}
14070 . nm \\*[$LN_NUM] \\*[$LN_INC] \\*[$LN_GUTTER] -3-\\*[$LN_GUTTER]
14071 . if !'\\n(.z'' \{ .nr #DIVER_LN_OFF 1 \}
14077 \# NUMBER QUOTE AND BLOCKQUOTE LINES AS PART OF RUNNING TEXT
14078 \# ---------------------------------------------------------
14080 \# <gutter> | <anything>
14082 \# Sets #(B)QUOTE_LN to 1 if no argument, or a single numeric
14083 \# argument, is given; otherwise, turns (BLOCK)QUOTE linenumbering
14086 \# #(B)QUOTE is checked for in QUOTE and BLOCKQUOTE.
14087 \# The single numeric argument allows establishing a different gutter from
14088 \# the one used for line numbers in running text.
14090 .MAC NUMBER_QUOTE_LINES END
14091 . ie \\n[#NUM_ARGS]=0 \{ .nr #QUOTE_LN 1 \}
14095 . ds $Q_LN_GUTTER \\$1
14098 . ie '\\$1'SILENT' \{ .nr #SILENT_QUOTE_LN 1 \}
14101 . rr #SILENT_QUOTE_LN
14108 .MAC NUMBER_BLOCKQUOTE_LINES END
14109 . ie \\n[#NUM_ARGS]=0 \{ .nr #BQUOTE_LN 1 \}
14113 . ds $BQ_LN_GUTTER \\$1
14116 . ie '\\$1'SILENT' \{ .nr #SILENT_BQUOTE_LN 1 \}
14119 . rr #SILENT_BQUOTE_LN
14125 \# OUTPUT BLANK PAGES
14126 \# ------------------
14128 \# <number of blank pages to output>
14130 \# Outputs blank pages.
14132 \# If recto/verso, each page is recto/verso, even if there's
14135 \# The argument to BLANKPAGE is non-optional.
14138 . nr #HOW_MANY \\$1
14140 . while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
14141 . if \\n[#HEADERS_ON]=1 \{\
14142 . nr #HEADERS_WERE_ON 1
14145 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14146 . if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
14151 . if \\n[#FOOTERS_ON]=1 \{\
14152 . nr #FOOTERS_WERE_ON 1
14155 . if \\n[#PAGE_NUM_V_POS]=2 \{\
14156 . if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
14159 . if \\n[#HEADERS_WERE_ON] \{ .HEADERS \}
14160 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14161 . if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
14165 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \}
14166 . if \\n[#PAGE_NUM_V_POS]=2 \{\
14167 . if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
14169 . rr #HEADERS_WERE_ON
14170 . rr #FOOTERS_WERE_ON
14171 . rr #PAGINATE_WAS_ON
14175 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
14176 \# ---------------------------------------
14180 \# Sets header/footer/footnotes/etc... traps.
14182 \# Calculates the number of lines that actually fit on a
14183 \# page based on #B_MARGIN and resets page bottom trap to coincide
14184 \# with the depth of that number of lines, or, if #ADJ_DOC_LEAD=1,
14185 \# adjusts #DOC_LEAD so that the last line of text on a page falls
14186 \# exactly on #B_MARGIN.
14189 .\" Remove all header/footer traps
14190 . if !\\n[#NO_TRAP_RESET] \{\
14195 . ch FN_OVERFLOW_TRAP
14196 .\" Plant header trap
14199 .\" Adjust lead so last line of text falls on B_MARGIN,...
14200 . ie \\n[#ADJ_DOC_LEAD]=1 \{\
14201 . nr #LINES_PER_PAGE 0 1
14202 . nr #DOC_LEAD_ADJ 0 1
14203 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#ORIGINAL_B_MARGIN]-1v
14204 .\" Get the number of unadjusted lines that fit on the page; always a
14205 .\" bit short of the bottom margin
14206 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
14209 . nr #LINES_PER_PAGE -1
14210 .\" Add machine units, 1 at a time, increasing the leading until the
14211 .\" new leading fills the page properly
14212 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
14215 . DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
14216 .\" The "visual" bottom margin is what \n(nl would report on the
14217 .\" last line before the FOOTER trap is sprung
14218 . nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD])
14219 .\" Get the difference between #B_MARGIN and #VISUAL_B_MARGIN
14220 . nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
14221 .\" Set #B_MARGIN to 1 machine unit lower on the page than #VISUAL_B_MARGIN
14222 . nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
14223 .\" Set the FN_OVERFLOW_TRAP position
14224 . nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
14225 . if \\n[#PRINT_STYLE]=1 .nr #FN_OVERFLOW_TRAP_POS \\n[#ORIGINAL_B_MARGIN]u
14227 .\" ...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
14230 . nr #LINES_PER_PAGE 0 1
14231 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
14232 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
14235 . nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD]-1v)
14236 . nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
14237 . nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
14238 . nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
14240 .\" Set footer and footnote overflow traps
14241 . if !\\n[#NO_TRAP_RESET] \{\
14243 . nr #SPACE_REMAINING 0
14245 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
14247 . wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
14248 . ch FOOTER -\\n[#B_MARGIN]u
14258 \# Adds left, right, or both indent values to document elements
14259 \# like heads and subheads that are processed in environments.
14261 .MAC CHECK_INDENT END
14262 . if \\n[#INDENT_LEFT_ACTIVE] \{\
14263 . in \\n[#L_INDENT]u
14264 . if \\n[#QUOTE] \{\
14265 . in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
14266 . ll -\\n[#L_INDENT]u
14269 . if \\n[#EPIGRAPH] \{\
14270 . in -\\n[#L_INDENT]u
14271 . ll -\\n[#L_INDENT]u
14275 . if \\n[#INDENT_RIGHT_ACTIVE] \{\
14276 . ll -\\n[#R_INDENT]u
14279 . if \\n[#INDENT_BOTH_ACTIVE] \{\
14280 . in \\n[#BL_INDENT]u
14281 . ll -\\n[#BR_INDENT]u
14283 . if \\n[#QUOTE] \{\
14284 . in -\\n[#BL_INDENT]u
14285 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
14286 . ll -\\n[#BR_INDENT]u
14290 . ll -(\\n[#BR_INDENT]u/2u)
14294 . if \\n[#EPIGRAPH] \{\
14295 . in -\\n[#BL_INDENT]u
14296 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
14297 . ll -\\n[#BR_INDENT]u
14301 . ll -(\\n[#BR_INDENT]u/2u)
14314 \# Removes left, right, or both indent values from document elements
14315 \# like heads and subheads that are processed in environments.
14317 .MAC REMOVE_INDENT END
14319 . ll \\n[#L_LENGTH]u
14324 \# This .em (for all DOC_TYPEs except 4 [LETTER]) ensures that
14325 \# deferred footnotes that happen on the 2nd to last page get
14329 . ie \\n[#FN_DEPTH] \{\
14330 . ie \\n[#FN_DEFER] \{\
14339 . ch FN_OVERFLOW_TRAP
14345 . ch FN_OVERFLOW_TRAP
14350 \# END MACRO FOR LETTERS
14351 \# ---------------------
14355 \# The .em macro executed at the end of letters. Turns footers
14356 \# and pagination off, terminates and outputs diversion CLOSING
14357 \# (indented with the author's name underneath).
14363 . if \\n[#DOC_TYPE]=4 \{\
14365 . if !'\\n(.z'' \{ .di \}
14368 . TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
14369 . ALD \\n[#DOC_LEAD]u*2u
14371 . if \\n[#CLOSING] \{\
14375 . ALD \\n[#DOC_LEAD]u*3u
14376 . PRINT \\*[$AUTHOR_1]
14381 \# Set up a default papersize of US letter
14385 \# ====================================================================
14387 \# +++DOCUMENT PROCESSING ALIASES+++
14389 \# Aliases to make life easier for users: synonyms, short forms
14390 \# and alternate spellings.
14392 .ALIAS BREAK_BLOCKQUOTE BREAK_QUOTE
14393 .ALIAS BREAK_CITATION BREAK_QUOTE
14394 .ALIAS BREAK_CITE BREAK_QUOTE
14395 .ALIAS BLOCKQUOTE_INDENT QUOTE_INDENT
14396 .ALIAS CITATION BLOCKQUOTE
14397 .ALIAS CITATION_FAMILY BLOCKQUOTE_FAMILY
14398 .ALIAS CITATION_FONT BLOCKQUOTE_FONT
14399 .ALIAS CITATION_SIZE BLOCKQUOTE_SIZE
14400 .ALIAS CITATION_COLOR BLOCKQUOTE_COLOR
14401 .ALIAS CITATION_QUAD BLOCKQUOTE_QUAD
14402 .ALIAS CITE BLOCKQUOTE
14403 .ALIAS CITE_FAMILY BLOCKQUOTE_FAMILY
14404 .ALIAS CITE_FONT BLOCKQUOTE_FONT
14405 .ALIAS CITE_SIZE BLOCKQUOTE_SIZE
14406 .ALIAS CITE_COLOR BLOCKQUOTE_COLOR
14407 .ALIAS CITE_QUAD BLOCKQUOTE_QUAD
14408 .ALIAS DOC_R_MARGIN DOC_RIGHT_MARGIN
14409 .ALIAS DOC_L_MARGIN DOC_LEFT_MARGIN
14410 .ALIAS DOC_L_LENGTH DOC_LINE_LENGTH
14411 .ALIAS DOC_RMARGIN DOC_RIGHT_MARGIN
14412 .ALIAS DOC_LMARGIN DOC_LEFT_MARGIN
14413 .ALIAS DOC_LLENGTH DOC_LINE_LENGTH
14414 .ALIAS DOC_FAM DOC_FAMILY
14415 .ALIAS DOC_LS DOC_LEAD
14416 .ALIAS DOC_PS DOC_PT_SIZE
14418 .ALIAS PAGENUM PAGENUMBER
14419 .ALIAS PAGINATION PAGINATE
14420 .ALIAS PP_FT PP_FONT
14421 .ALIAS REF_INDENT INDENT_REFS
14422 .ALIAS TOC_PS TOC_PT_SIZE
14424 \# HEADER and FOOTER macros
14425 \# ------------------------
14426 \# Because the type-style of headers and footers are managed
14427 \# identically, and the type-style macros (_<type parameter>) all
14428 \# require the correct name of the calling macro, it's necessary
14429 \# to create HEADER_ and FOOTER_ macros here. They're basically
14430 \# "aliases" of HDRFTR_, but required because you can't alias an
14433 .MAC FOOTER_CENTER_COLOR END
14434 . HDRFTR_CENTER_COLOR \\$1
14437 .MAC FOOTER_CENTER_COLOUR END
14438 . HDRFTR_CENTER_COLOR \\$1
14441 .MAC FOOTER_CENTER_FAM END
14442 . HDRFTR_CENTER_FAMILY \\$1
14445 .MAC FOOTER_CENTER_FAMILY END
14446 . HDRFTR_CENTER_FAMILY \\$1
14449 .MAC FOOTER_CENTER_FONT END
14450 . HDRFTR_CENTER_FONT \\$1
14453 .MAC FOOTER_CENTER_FT END
14454 . HDRFTR_CENTER_FONT \\$1
14457 .MAC FOOTER_CENTER_PS END
14458 . HDRFTR_CENTER_SIZE \\$1
14461 .MAC FOOTER_CENTER_SIZE END
14462 . HDRFTR_CENTER_SIZE \\$1
14465 .MAC FOOTER_CENTRE_CAPS END
14466 . HDRFTR_CENTER_CAPS \\$1
14469 .MAC FOOTER_CENTRE_COLOR END
14470 . HDRFTR_CENTRE_COLOR \\$1
14473 .MAC FOOTER_CENTRE_COLOUR END
14474 . HDRFTR_CENTRE_COLOR \\$1
14477 .MAC FOOTER_CENTRE_FAM END
14478 . HDRFTR_CENTER_FAMILY \\$1
14481 .MAC FOOTER_CENTRE_FAMILY END
14482 . HDRFTR_CENTER_FAMILY \\$1
14485 .MAC FOOTER_CENTRE_FONT END
14486 . HDRFTR_CENTER_FONT \\$1
14489 .MAC FOOTER_CENTRE_FT END
14490 . HDRFTR_CENTER_FONT \\$1
14493 .MAC FOOTER_CENTRE_PS END
14494 . HDRFTR_CENTER_SIZE \\$1
14497 .MAC FOOTER_CENTRE_SIZE END
14498 . HDRFTR_CENTER_SIZE \\$1
14501 .MAC FOOTER_COLOR END
14502 . HDRFTR_COLOR \\$1
14505 .MAC FOOTER_COLOUR END
14506 . HDRFTR_COLOR \\$1
14509 .MAC FOOTER_FAM END
14510 . HDRFTR_FAMILY \\$1
14513 .MAC FOOTER_FAMILY END
14514 . HDRFTR_FAMILY \\$1
14517 .MAC FOOTER_LEFT_COLOR END
14518 . HDRFTR_LEFT_COLOR \\$1
14521 .MAC FOOTER_LEFT_COLOUR END
14522 . HDRFTR_LEFT_COLOR \\$1
14525 .MAC FOOTER_LEFT_FAM END
14526 . HDRFTR_LEFT_FAMILY \\$1
14529 .MAC FOOTER_LEFT_FAMILY END
14530 . HDRFTR_LEFT_FAMILY \\$1
14533 .MAC FOOTER_LEFT_FONT END
14534 . HDRFTR_LEFT_FONT \\$1
14537 .MAC FOOTER_LEFT_FT END
14538 . HDRFTR_LEFT_FONT \\$1
14541 .MAC FOOTER_LEFT_PS END
14542 . HDRFTR_LEFT_SIZE \\$1
14545 .MAC FOOTER_LEFT_SIZE END
14546 . HDRFTR_LEFT_SIZE \\$1
14549 .MAC FOOTER_RIGHT_COLOR END
14550 . HDRFTR_RIGHT_COLOR \\$1
14553 .MAC FOOTER_RIGHT_COLOUR END
14554 . HDRFTR_RIGHT_COLOR \\$1
14557 .MAC FOOTER_RIGHT_FAM END
14558 . HDRFTR_RIGHT_FAMILY \\$1
14561 .MAC FOOTER_RIGHT_FAMILY END
14562 . HDRFTR_RIGHT_FAMILY \\$1
14565 .MAC FOOTER_RIGHT_FONT END
14566 . HDRFTR_RIGHT_FONT \\$1
14569 .MAC FOOTER_RIGHT_FT END
14570 . HDRFTR_RIGHT_FONT \\$1
14573 .MAC FOOTER_RIGHT_PS END
14574 . HDRFTR_RIGHT_SIZE \\$1
14577 .MAC FOOTER_RIGHT_SIZE END
14578 . HDRFTR_RIGHT_SIZE \\$1
14581 .MAC FOOTER_RULE_COLOR END
14582 . HDRFTR_RULE_COLOR \\$1
14585 .MAC FOOTER_SIZE END
14589 .MAC HEADER_CENTER_COLOR END
14590 . HDRFTR_CENTER_COLOR \\$1
14593 .MAC HEADER_CENTER_COLOUR END
14594 . HDRFTR_CENTER_COLOR \\$1
14597 .MAC HEADER_CENTER_FAM END
14598 . HDRFTR_CENTER_FAMILY \\$1
14601 .MAC HEADER_CENTER_FAMILY END
14602 . HDRFTR_CENTER_FAMILY \\$1
14605 .MAC HEADER_CENTER_FONT END
14606 . HDRFTR_CENTER_FONT \\$1
14609 .MAC HEADER_CENTER_FT END
14610 . HDRFTR_CENTER_FONT \\$1
14613 .MAC HEADER_CENTER_PS END
14614 . HDRFTR_CENTER_SIZE \\$1
14617 .MAC HEADER_CENTER_SIZE END
14618 . HDRFTR_CENTER_SIZE \\$1
14621 .MAC HEADER_CENTRE_COLOR END
14622 . HDRFTR_CENTRE_COLOR \\$1
14625 .MAC HEADER_CENTRE_COLOUR END
14626 . HDRFTR_CENTRE_COLOR \\$1
14629 .MAC HEADER_CENTRE_FAM END
14630 . HDRFTR_CENTER_FAMILY \\$1
14633 .MAC HEADER_CENTRE_FAMILY END
14634 . HDRFTR_CENTER_FAMILY \\$1
14637 .MAC HEADER_CENTRE_FONT END
14638 . HDRFTR_CENTER_FONT \\$1
14641 .MAC HEADER_CENTRE_FT END
14642 . HDRFTR_CENTER_FONT \\$1
14645 .MAC HEADER_CENTRE_PS END
14646 . HDRFTR_CENTER_SIZE \\$1
14649 .MAC HEADER_CENTRE_SIZE END
14650 . HDRFTR_CENTER_SIZE \\$1
14653 .MAC HEADER_COLOR END
14654 . HDRFTR_COLOR \\$1
14657 .MAC HEADER_COLOUR END
14658 . HDRFTR_COLOR \\$1
14661 .MAC HEADER_FAM END
14662 . HDRFTR_FAMILY \\$1
14665 .MAC HEADER_FAMILY END
14666 . HDRFTR_FAMILY \\$1
14669 .MAC HEADER_LEFT_COLOR END
14670 . HDRFTR_LEFT_COLOR \\$1
14673 .MAC HEADER_LEFT_COLOUR END
14674 . HDRFTR_LEFT_COLOR \\$1
14677 .MAC HEADER_LEFT_FAM END
14678 . HDRFTR_LEFT_FAMILY \\$1
14681 .MAC HEADER_LEFT_FAMILY END
14682 . HDRFTR_LEFT_FAMILY \\$1
14685 .MAC HEADER_LEFT_FONT END
14686 . HDRFTR_LEFT_FONT \\$1
14689 .MAC HEADER_LEFT_FT END
14690 . HDRFTR_LEFT_FONT \\$1
14693 .MAC HEADER_LEFT_PS END
14694 . HDRFTR_LEFT_SIZE \\$1
14697 .MAC HEADER_LEFT_SIZE END
14698 . HDRFTR_LEFT_SIZE \\$1
14701 .MAC HEADER_RIGHT_COLOR END
14702 . HDRFTR_RIGHT_COLOR \\$1
14705 .MAC HEADER_RIGHT_COLOUR END
14706 . HDRFTR_RIGHT_COLOR \\$1
14709 .MAC HEADER_RIGHT_FAM END
14710 . HDRFTR_RIGHT_FAMILY \\$1
14713 .MAC HEADER_RIGHT_FAMILY END
14714 . HDRFTR_RIGHT_FAMILY \\$1
14717 .MAC HEADER_RIGHT_FONT END
14718 . HDRFTR_RIGHT_FONT \\$1
14721 .MAC HEADER_RIGHT_FT END
14722 . HDRFTR_RIGHT_FONT \\$1
14725 .MAC HEADER_RIGHT_PS END
14726 . HDRFTR_RIGHT_SIZE \\$1
14729 .MAC HEADER_RIGHT_SIZE END
14730 . HDRFTR_RIGHT_SIZE \\$1
14733 .MAC HEADER_RULE_COLOR END
14734 . HDRFTR_RULE_COLOR \\$1
14737 .MAC HEADER_SIZE END
14741 \# HEADER and FOOTER aliases for HDRFTR macros.
14743 .ALIAS BIBLIOGRAPHY_FOOTER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
14744 .ALIAS BIBLIOGRAPHY_FOOTER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
14745 .ALIAS BIBLIOGRAPHY_HEADER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
14746 .ALIAS BIBLIOGRAPHY_HEADER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
14747 .ALIAS ENDNOTES_FOOTER_CENTER ENDNOTES_HDRFTR_CENTER
14748 .ALIAS ENDNOTES_FOOTER_CENTRE ENDNOTES_HDRFTR_CENTRE
14749 .ALIAS ENDNOTES_HEADER_CENTER ENDNOTES_HDRFTR_CENTER
14750 .ALIAS ENDNOTES_HEADER_CENTRE ENDNOTES_HDRFTR_CENTRE
14751 .ALIAS FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS
14752 .ALIAS FOOTER_CENTER HDRFTR_CENTER
14753 .ALIAS FOOTER_CENTER_PAD HDRFTR_CENTER_PAD
14754 .ALIAS FOOTER_CENTRE HDRFTR_CENTER
14755 .ALIAS FOOTER_CENTRE_PAD HDRFTR_CENTER_PAD
14756 .ALIAS FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS
14757 .ALIAS FOOTER_LEFT HDRFTR_LEFT
14758 .ALIAS FOOTER_PLAIN HDRFTR_PLAIN
14759 .ALIAS FOOTER_RECTO HDRFTR_RECTO
14760 .ALIAS FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
14761 .ALIAS FOOTER_RIGHT HDRFTR_RIGHT
14762 .ALIAS FOOTER_RULE_GAP HDRFTR_RULE_GAP
14763 .ALIAS FOOTER_RULE HDRFTR_RULE
14764 .ALIAS FOOTER_VERSO HDRFTR_VERSO
14765 .ALIAS HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS
14766 .ALIAS HEADER_CENTER HDRFTR_CENTER
14767 .ALIAS HEADER_CENTER_PAD HDRFTR_CENTER_PAD
14768 .ALIAS HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS
14769 .ALIAS HEADER_CENTRE HDRFTR_CENTER
14770 .ALIAS HEADER_CENTRE_PAD HDRFTR_CENTER_PAD
14771 .ALIAS HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS
14772 .ALIAS HEADER_LEFT HDRFTR_LEFT
14773 .ALIAS HEADER_PLAIN HDRFTR_PLAIN
14774 .ALIAS HEADER_RECTO HDRFTR_RECTO
14775 .ALIAS HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
14776 .ALIAS HEADER_RIGHT HDRFTR_RIGHT
14777 .ALIAS HEADER_RULE_GAP HDRFTR_RULE_GAP
14778 .ALIAS HEADER_RULE HDRFTR_RULE
14779 .ALIAS HEADER_VERSO HDRFTR_VERSO
14780 .ALIAS SWITCH_FOOTERS SWITCH_HDRFTR
14781 .ALIAS SWITCH_HEADERS SWITCH_HDRFTR
14783 \# Type-style aliases
14785 .ALIAS AUTHOR_FAMILY _FAMILY
14786 .ALIAS BIBLIOGRAPHY_FAMILY _FAMILY
14787 .ALIAS BIBLIOGRAPHY_STRING_FAMILY _FAMILY
14788 .ALIAS BLOCKQUOTE_FAMILY _FAMILY
14789 .ALIAS CHAPTER_TITLE_FAMILY _FAMILY
14790 .ALIAS COVER_AUTHOR_FAMILY _FAMILY
14791 .ALIAS COVER_CHAPTER_TITLE_FAMILY _FAMILY
14792 .ALIAS COVER_COPYRIGHT_FAMILY _FAMILY
14793 .ALIAS COVER_DOCTYPE_FAMILY _FAMILY
14794 .ALIAS COVER_FAMILY _FAMILY
14795 .ALIAS COVER_SUBTITLE_FAMILY _FAMILY
14796 .ALIAS COVER_TITLE_FAMILY _FAMILY
14797 .ALIAS DOC_COVER_AUTHOR_FAMILY _FAMILY
14798 .ALIAS DOC_COVER_CHAPTER_TITLE_FAMILY _FAMILY
14799 .ALIAS DOC_COVER_COPYRIGHT_FAMILY _FAMILY
14800 .ALIAS DOC_COVER_DOCTYPE_FAMILY _FAMILY
14801 .ALIAS DOC_COVER_FAMILY _FAMILY
14802 .ALIAS DOC_COVER_SUBTITLE_FAMILY _FAMILY
14803 .ALIAS DOC_COVER_TITLE_FAMILY _FAMILY
14804 .ALIAS DOCHEADER_FAMILY _FAMILY
14805 .ALIAS DOCTYPE_FAMILY _FAMILY
14806 .ALIAS ENDNOTE_FAMILY _FAMILY
14807 .ALIAS ENDNOTE_NUMBER_FAMILY _FAMILY
14808 .ALIAS ENDNOTE_LINENUMBER_FAMILY _FAMILY
14809 .ALIAS ENDNOTE_STRING_FAMILY _FAMILY
14810 .ALIAS ENDNOTE_TITLE_FAMILY _FAMILY
14811 .ALIAS EPIGRAPH_FAMILY _FAMILY
14812 .ALIAS FOOTNOTE_FAMILY _FAMILY
14813 .ALIAS HDRFTR_CENTER_FAMILY _FAMILY
14814 .ALIAS HDRFTR_FAMILY _FAMILY
14815 .ALIAS HDRFTR_LEFT_FAMILY _FAMILY
14816 .ALIAS HDRFTR_RIGHT_FAMILY _FAMILY
14817 .ALIAS HEAD_FAMILY _FAMILY
14818 .ALIAS PAGENUM_FAMILY _FAMILY
14819 .ALIAS PARAHEAD_FAMILY _FAMILY
14820 .ALIAS QUOTE_FAMILY _FAMILY
14821 .ALIAS SUBHEAD_FAMILY _FAMILY
14822 .ALIAS SUBTITLE_FAMILY _FAMILY
14823 .ALIAS TITLE_FAMILY _FAMILY
14824 .ALIAS TOC_FAM _FAMILY
14825 .ALIAS TOC_FAMILY _FAMILY
14826 .ALIAS TOC_HEADER_FAMILY _FAMILY
14827 .ALIAS TOC_HEAD_FAMILY _FAMILY
14828 .ALIAS TOC_PARAHEAD_FAMILY _FAMILY
14829 .ALIAS TOC_PN_FAMILY _FAMILY
14830 .ALIAS TOC_SUBHEAD_FAMILY _FAMILY
14831 .ALIAS TOC_TITLE_FAMILY _FAMILY
14833 .ALIAS AUTHOR_FONT _FONT
14834 .ALIAS BIBLIOGRAPHY_STRING_FONT _FONT
14835 .ALIAS BIBLIOGRAPHY_FONT _FONT
14836 .ALIAS BLOCKQUOTE_FONT _FONT
14837 .ALIAS CHAPTER_TITLE_FONT _FONT
14838 .ALIAS COVER_AUTHOR_FONT _FONT
14839 .ALIAS COVER_CHAPTER_TITLE_FONT _FONT
14840 .ALIAS COVER_COPYRIGHT_FONT _FONT
14841 .ALIAS COVER_DOCTYPE_FONT _FONT
14842 .ALIAS COVER_SUBTITLE_FONT _FONT
14843 .ALIAS COVER_TITLE_FONT _FONT
14844 .ALIAS DOC_COVER_AUTHOR_FONT _FONT
14845 .ALIAS DOC_COVER_CHAPTER_TITLE_FONT _FONT
14846 .ALIAS DOC_COVER_COPYRIGHT_FONT _FONT
14847 .ALIAS DOC_COVER_DOCTYPE_FONT _FONT
14848 .ALIAS DOC_COVER_SUBTITLE_FONT _FONT
14849 .ALIAS DOC_COVER_TITLE_FONT _FONT
14850 .ALIAS DOCTYPE_FONT _FONT
14851 .ALIAS ENDNOTE_FONT _FONT
14852 .ALIAS ENDNOTE_NUMBER_FONT _FONT
14853 .ALIAS ENDNOTE_LINENUMBER_FONT _FONT
14854 .ALIAS ENDNOTE_STRING_FONT _FONT
14855 .ALIAS ENDNOTE_TITLE_FONT _FONT
14856 .ALIAS EPIGRAPH_FONT _FONT
14857 .ALIAS FOOTNOTE_FONT _FONT
14858 .ALIAS HDRFTR_CENTER_FONT _FONT
14859 .ALIAS HDRFTR_LEFT_FONT _FONT
14860 .ALIAS HDRFTR_RIGHT_FONT _FONT
14861 .ALIAS HEAD_FONT _FONT
14862 .ALIAS PAGENUM_FONT _FONT
14863 .ALIAS PARAHEAD_FONT _FONT
14864 .ALIAS QUOTE_FONT _FONT
14865 .ALIAS SUBHEAD_FONT _FONT
14866 .ALIAS SUBTITLE_FONT _FONT
14867 .ALIAS TITLE_FONT _FONT
14868 .ALIAS TOC_HEADER_FONT _FONT
14869 .ALIAS TOC_HEAD_FONT _FONT
14870 .ALIAS TOC_PARAHEAD_FONT _FONT
14871 .ALIAS TOC_PN_FONT _FONT
14872 .ALIAS TOC_SUBHEAD_FONT _FONT
14873 .ALIAS TOC_TITLE_FONT _FONT
14875 .ALIAS AUTHOR_SIZE _SIZE
14876 .ALIAS BIBLIOGRAPHY_STRING_SIZE _SIZE
14877 .ALIAS BLOCKQUOTE_SIZE _SIZE
14878 .ALIAS CHAPTER_TITLE_SIZE _SIZE
14879 .ALIAS COVER_AUTHOR_SIZE _SIZE
14880 .ALIAS COVER_CHAPTER_TITLE_SIZE _SIZE
14881 .ALIAS COVER_COPYRIGHT_SIZE _SIZE
14882 .ALIAS COVER_DOCTYPE_SIZE _SIZE
14883 .ALIAS COVER_SUBTITLE_SIZE _SIZE
14884 .ALIAS COVER_TITLE_SIZE _SIZE
14885 .ALIAS DOC_COVER_AUTHOR_SIZE _SIZE
14886 .ALIAS DOC_COVER_CHAPTER_TITLE_SIZE _SIZE
14887 .ALIAS DOC_COVER_COPYRIGHT_SIZE _SIZE
14888 .ALIAS DOC_COVER_DOCTYPE_SIZE _SIZE
14889 .ALIAS DOC_COVER_SUBTITLE_SIZE _SIZE
14890 .ALIAS DOC_COVER_TITLE_SIZE _SIZE
14891 .ALIAS DOCTYPE_SIZE _SIZE
14892 .ALIAS ENDNOTE_NUMBER_SIZE _SIZE
14893 .ALIAS ENDNOTE_LINENUMBER_SIZE _SIZE
14894 .ALIAS ENDNOTE_STRING_SIZE _SIZE
14895 .ALIAS ENDNOTE_TITLE_SIZE _SIZE
14896 .ALIAS EPIGRAPH_SIZE _SIZE
14897 .ALIAS FOOTNOTE_SIZE _SIZE
14898 .ALIAS HDRFTR_CENTER_SIZE _SIZE
14899 .ALIAS HDRFTR_LEFT_SIZE _SIZE
14900 .ALIAS HDRFTR_RIGHT_SIZE _SIZE
14901 .ALIAS HDRFTR_SIZE _SIZE
14902 .ALIAS HEAD_SIZE _SIZE
14903 .ALIAS PAGENUM_SIZE _SIZE
14904 .ALIAS PARAHEAD_SIZE _SIZE
14905 .ALIAS QUOTE_SIZE _SIZE
14906 .ALIAS SUBHEAD_SIZE _SIZE
14907 .ALIAS SUBTITLE_SIZE _SIZE
14908 .ALIAS TITLE_SIZE _SIZE
14909 .ALIAS TOC_HEADER_SIZE _SIZE
14910 .ALIAS TOC_HEAD_SIZE _SIZE
14911 .ALIAS TOC_PARAHEAD_SIZE _SIZE
14912 .ALIAS TOC_PN_SIZE _SIZE
14913 .ALIAS TOC_SUBHEAD_SIZE _SIZE
14914 .ALIAS TOC_TITLE_SIZE _SIZE
14916 .ALIAS ATTRIBUTE_COLOR _COLOR
14917 .ALIAS AUTHOR_COLOR _COLOR
14918 .ALIAS BLOCKQUOTE_COLOR _COLOR
14919 .ALIAS CHAPTER_TITLE_COLOR _COLOR
14920 .ALIAS COVER_ATTRIBUTE_COLOR _COLOR
14921 .ALIAS COVER_AUTHOR_COLOR _COLOR
14922 .ALIAS COVER_CHAPTER_TITLE_COLOR _COLOR
14923 .ALIAS COVER_COLOR _COLOR
14924 .ALIAS COVER_COPYRIGHT_COLOR _COLOR
14925 .ALIAS COVER_DOCTYPE_COLOR _COLOR
14926 .ALIAS COVER_MISC_COLOR _COLOR
14927 .ALIAS COVER_SUBTITLE_COLOR _COLOR
14928 .ALIAS COVER_TITLE_COLOR _COLOR
14929 .ALIAS DOC_COVER_ATTRIBUTE_COLOR _COLOR
14930 .ALIAS DOC_COVER_AUTHOR_COLOR _COLOR
14931 .ALIAS DOC_COVER_CHAPTER_TITLE_COLOR _COLOR
14932 .ALIAS DOC_COVER_COLOR _COLOR
14933 .ALIAS DOC_COVER_COPYRIGHT_COLOR _COLOR
14934 .ALIAS DOC_COVER_DOCTYPE_COLOR _COLOR
14935 .ALIAS DOC_COVER_MISC_COLOR _COLOR
14936 .ALIAS DOC_COVER_SUBTITLE_COLOR _COLOR
14937 .ALIAS DOC_COVER_TITLE_COLOR _COLOR
14938 .ALIAS DOCHEADER_COLOR _COLOR
14939 .ALIAS DOCTYPE_COLOR _COLOR
14940 .ALIAS EPIGRAPH_COLOR _COLOR
14941 .ALIAS FINIS_COLOR _COLOR
14942 .ALIAS FOOTNOTE_COLOR _COLOR
14943 .ALIAS HDRFTR_CENTER_COLOR _COLOR
14944 .ALIAS HDRFTR_COLOR _COLOR
14945 .ALIAS HDRFTR_LEFT_COLOR _COLOR
14946 .ALIAS HDRFTR_RIGHT_COLOR _COLOR
14947 .ALIAS HDRFTR_RULE_COLOR _COLOR
14948 .ALIAS HEAD_COLOR _COLOR
14949 .ALIAS LINEBREAK_COLOR _COLOR
14950 .ALIAS PAGENUM_COLOR _COLOR
14951 .ALIAS PARAHEAD_COLOR _COLOR
14952 .ALIAS QUOTE_COLOR _COLOR
14953 .ALIAS SUBHEAD_COLOR _COLOR
14954 .ALIAS SUBTITLE_COLOR _COLOR
14955 .ALIAS TITLE_COLOR _COLOR
14957 .ALIAS BIBLIOGRAPHY_QUAD _QUAD
14958 .ALIAS BIBLIOGRAPHY_STRING_QUAD _QUAD
14959 .ALIAS BLOCKQUOTE_QUAD _QUAD
14960 .ALIAS COVER_COPYRIGHT_QUAD _QUAD
14961 .ALIAS COVER_MISC_QUAD _QUAD
14962 .ALIAS DOC_COVER_COPYRIGHT_QUAD _QUAD
14963 .ALIAS DOC_COVER_MISC_QUAD _QUAD
14964 .ALIAS DOC_QUAD _QUAD
14965 .ALIAS ENDNOTE_QUAD _QUAD
14966 .ALIAS ENDNOTE_STRING_QUAD _QUAD
14967 .ALIAS ENDNOTE_TITLE_QUAD _QUAD
14968 .ALIAS EPIGRAPH_QUAD _QUAD
14969 .ALIAS FOOTNOTE_QUAD _QUAD
14970 .ALIAS HEAD_QUAD _QUAD
14971 .ALIAS SUBHEAD_QUAD _QUAD
14972 .ALIAS TOC_HEADER_QUAD _QUAD
14976 .ALIAS COL_BREAK COL_NEXT
14977 .ALIAS DOC_COVER_ADVANCE COVER_ADVANCE
14978 .ALIAS DOC_COVER COVER
14979 .ALIAS DOC_COVERS COVERS
14980 .ALIAS DOC_COVER_LEAD COVER_LEAD
14981 .ALIAS DOC_COVERTITLE COVERTITLE
14982 .ALIAS DO_DOC_COVER DO_COVER
14983 .ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE
14985 \# Miscellaneous aliases
14986 .ALIAS SECTION LINEBREAK
14987 .ALIAS SECTION_CHAR LINEBREAK_CHAR
14989 \# Miscellaneous macros to take care of backward compatibility
14990 \# -----------------------------------------------------------
14992 \# As of 1.1.9, EL and TN got changed to make TRAP...TRAP OFF
14993 \# unnecessary for users. However, I used both macros extensively
14994 \# throughout this file (in conjunction with TRAP...TRAP OFF).
14995 \# EOL is the "old" EL, for the personal use of om.tmac
15005 \# Footnote references
15006 \# -------------------
15008 \# Instruct REF to put references in footnotes.
15010 .MAC FOOTNOTE_REFS END
15011 . if r#EN_REF \{ .rr #EN_REF \}
15015 \# Endnote references
15016 \# ------------------
15018 \# Instruct REF to collect references for endnotes output.
15020 .MAC ENDNOTE_REFS END
15021 . if r#FN_REF \{ .rr #FN_REF \}
15025 \# Prepare mom for a reference
15026 \# ---------------------------
15028 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value>
15030 \# Calls FOOTNOTE or ENDNOTE, depending on whether #REF_FN or
15031 \# #REF_EN is set to 1.
15033 \# For convenience, REF is a toggle.
15035 \# REF optionally takes the same arguments as FOOTNOTE, allowing
15036 \# users to indent references that go in footnotes when footnote
15037 \# indenting is required. FOOTNOTE_REFS must be on for this.
15040 . ie \\n[#FN_REF]+\\n[#EN_REF]=0 \{\
15041 . if !\\n[#REF_WARNING]=1 \{\
15042 . tm1 "[mom]: Before REF at line \\n(.c, neither FOOTNOTE_REFS nor ENDNOTE_REFS
15043 . tm1 " has been selected. If "sort" and "accumulate" are in your refer
15044 . tm1 " commands, references will be collected for later output with $LIST$.
15045 . tm1 " Otherwise, they will disappear.
15046 . nr #REF_WARNING 1
15050 . ie \\n[#REF]=1 \{\
15051 . if \\n[#FN_REF]=1 \{ .FOOTNOTE OFF \}
15052 . if \\n[#EN_REF]=1 \{ .ENDNOTE OFF \}
15058 . if \\n[#FN_REF]=1 \{ .FOOTNOTE \\$1 \\$2 \\$3 \}
15059 . if \\n[#EN_REF]=1 \{ .ENDNOTE \}
15064 \# Embedded references in text (with brackets)
15065 \# -------------------------------------------
15067 .MAC REF_BRACKETS_START END
15068 . ds $CURRENT_EV \\n[.ev]
15070 . evc \\*[$CURRENT_EV]
15074 .MAC REF_BRACKETS_END END
15079 . unformat REFERENCE
15080 . if '\\$0'REF)' \{ .nop (\\*[REFERENCE]) \}
15081 . if '\\$0'REF]' \{ .nop [\\*[REFERENCE]] \}
15082 . if '\\$0'REF}' \{ .nop {\\*[REFERENCE]} \}
15085 \# These three pairs of aliases allow users to embed references in
15086 \# text and have them surrounded by (), [] or {}.
15088 .ALIAS REF( REF_BRACKETS_START
15089 .ALIAS REF) REF_BRACKETS_END
15091 .ALIAS REF[ REF_BRACKETS_START
15092 .ALIAS REF{ REF_BRACKETS_START
15094 .ALIAS REF} REF_BRACKETS_END
15095 .ALIAS REF] REF_BRACKETS_END
15097 \# Second-line indent for refs
15098 \# ---------------------------
15100 \# FOOTNOTE | ENDNOTE | BIBLIO <indent for 2nd and subsequent lines of discrete reference entries>
15102 \# Sets strings $REF_FN_INDENT, $REF_EN_INDENT or $REF_BIB_INDENT.
15104 \# Indent value requires a unit of measure.
15106 .MAC INDENT_REFS END
15107 . if '\\$1'FOOTNOTE' .ds $REF_FN_INDENT \\$2
15108 . if '\\$1'ENDNOTE' .ds $REF_EN_INDENT \\$2
15109 . if '\\$1'BIBLIO' .ds $REF_BIB_INDENT \\$2
15112 \# Hyphenation of references
15113 \# -------------------------
15115 \# <none> | <anything>
15117 \# Sets register #REF_HYPHENATE
15119 .MAC HYPHENATE_REFS END
15120 . ie '\\$1'' \{ .nr #REF_HYPHENATE 1 \}
15122 . if r#REF_HY \{ .rr #REF_HY \}
15127 The remainder of the definitions in this section are modified
15128 versions of the definitions found in the refer module of s.tmac.
15131 \# This one is directly from s.tmac.
15133 .tm \\n(.F:\\n(.c: macro error: \\$*
15137 The following strings define the order of entries for different
15138 types of references. Each letter in the string refers to a database
15139 field (A for author, T1/T2 for article and book titles, etc).
15140 Mom is set up for MLA-style bibliographies. Other styles can be
15141 implemented here by re-ordering the fields.
15144 .ds ref*spec!2 Q A T1 d t l r E S e V a C I D P O
15145 \# Article within book - type 3
15146 .ds ref*spec!3 Q A T2 B d t l r E S e V a C I D P O
15147 \# Journal article - type 1
15148 .ds ref*spec!1 Q A T2 J S N D P O
15149 \# Tech report - type 4
15150 .ds ref*spec!4 Q A T1 R G C I D P O
15151 \# Internet site - type 0
15152 .ds ref*spec!0 Q A T2 s E c d o a u O
15154 \# Refer's "1st" macro. Since it is possible to define database
15155 \# fields using any single letter, we remove all possible string
15156 \# definitions of the form [X and [x
15159 .rm [A [B [C [D [E [F [G [H [I [J [K [L [M \
15160 [N [O [P [Q [R [S [T [U [V [W [X [Y [Z \
15161 . [a [b [c [d [e [f [g [h [i [j [k [l [m \
15162 [n [o [p [q [r [s [t [u [v [w [x [y [z
15167 \# Refer's "2nd" macro; builds up a reference with ref*build, and
15168 \# prints it with ref*print.
15172 .if \\n[ref*type]=3 \{\
15173 . if !'\\*([R'' \{\
15175 . ds ref*spec!4 Q A T2 B R C I D P O
15177 . if !'\\*([G'' \{\
15179 . ds ref*spec!4 Q A T2 B G C I D P O
15186 .ie d ref*spec!\\n[ref*type] .ref*build \\*[ref*spec!\\n[ref*type]]
15188 . @error unknown reference type `\\n[ref*type]'
15189 . ref*build \\*[ref*spec!0]
15191 .if !\\n[.hy]=0 \{\
15192 .nr #RESTORE_HY \\n[.hy]
15196 .if !\\n[#RESTORE_HY]=0 .hy \\n[#RESTORE_HY]
15202 \# Refer's "3rd" macros, which set up and terminate the output
15203 \# of collected references
15206 .als ref*print ref*end-print
15208 .if \\n[#BIB_LIST]=1 \{\
15209 . nr #IN_BIB_LIST 1
15210 . LIST DIGIT \\*[$BIB_LIST_SEPARATOR] \\*[$BIB_LIST_PREFIX]
15218 .als ref*print ref*normal-print
15224 \# Output normal, non-collected refs
15226 .de ref*normal-print
15227 .nr #CURRENT_HY \\n[.hy]
15231 \# Output collected refs
15234 .\" 10 is abritrary
15236 .ie \\n[#BIB_LIST]=0 \{\
15237 .in +\\*[$REF_BIB_INDENT]
15238 .ti -\\*[$REF_BIB_INDENT]
15242 .sp \\n[#BIB_SPACE]u
15243 .ie \\n[#BIB_LIST]=0 .in
15244 .el .IL -\\*[$REF_BIB_INDENT]u
15248 .als ref*print ref*normal-print
15250 \# Build up the ref*string
15253 Correct MLA "typewritten" style (printstyle TYPEWRITE) demands
15254 two spaces after each period. The spaces are hardwired into the
15255 string definitions (ref*add-<x>), so we have to make sure that there
15256 aren't two spaces when the printstyle is TYPESET. Since I find that
15257 references look a bit crowded with 0 sentence space, I've bumped it
15258 up to +4. User's sentence spacing is reset in FOOTNOTES and ENDNOTES.
15262 .if \\n[#PRINT_STYLE]=2 \{\
15263 . ds $RESTORE_SS_VAR \\*[$SS_VAR]
15266 .rm ref*string ref*post-punct
15267 .nr ref*suppress-period 1
15270 . ie d ref*add-\\$1 .ref*add-\\$1
15271 . el .ref*add-dflt \\$1
15275 .\" now add a final period
15276 .ie d ref*string \{\
15277 . if !\\n[ref*suppress-period] .as ref*string .
15278 . if d ref*post-punct \{\
15279 . as ref*string "\\*[ref*post-punct]
15280 . rm ref*post-punct
15286 \# The following macros determine how entries are formatted WRT
15287 \# punctuation, type style, additional strings, etc.
15290 o First argument is the database field letter.
15291 o Second argument is the punctuation character to use to separate this
15292 field from the previous field.
15293 o Third argument is a string with which to prefix this field.
15294 o Fourth argument is a string with which to postfix this field.
15295 o Fifth argument is a string to add after the punctuation character
15296 supplied by the next field.
15302 .if r [A .nr ref*suppress-period \\n([A
15304 \# %T Title (generic)
15306 .ref*field T . " \E*[IT]" "" \E*[PREV]
15307 .if \\n([T .nr ref*suppress-period \\n([T
15309 \# %T Title of a chapter or article
15311 .ref*field T . " \(lq" "" "\(rq"
15312 .if \\n([T .nr ref*suppress-period \\n([T
15314 \# %B Book title (when citing an article from a book)
15316 .ie \\n([T .ref*field B "" ".\E*[IT]" "" \E*[PREV]
15317 .el .ref*field B . " \E*[IT]" "" \E*[PREV]
15318 \# refer doesn't set reg [T to 1 for these book titles, so we do it here
15320 .substring eval*[B -1
15322 .if '\\*[eval*[B]'!' .nr [T 1
15323 .if '\\*[eval*[B]'?' .nr [T 1
15326 \# %R Report number for technical reports
15332 .ie \\n([T .ref*field J "" " \E*[IT]" "" \E*[PREV]
15333 .el .ref*field J . " \E*[IT]" "" \E*[PREV]
15337 .ie !\\n[ref*type]=0 \{\
15339 . ie \\n([T .ref*field E "" " Eds. "
15340 . el .ref*field E . " Eds. "
15343 . ie \\n([T .ref*field E "" " Ed. "
15344 . el .ref*field E . " Ed. "
15348 . ie \\n([T .ref*field E "" " "
15349 . el .ref*field E . " "
15355 .ie \\n([T .ref*field e "" " " " edition"
15356 .el .ref*field e . " " " edition"
15359 \# %V Volume (of a journal, or series of books)
15361 .if \\n[ref*type]=1 \{\
15364 .if \\n[ref*type]=2 \{\
15365 . ie \\n([T .ref*field V "" " "
15366 . el .ref*field V . " "
15368 .if \\n[ref*type]=3 \{\
15369 . ie \\n([T .ref*field V "" " "
15370 . el .ref*field V . " "
15374 \# %N Journal number
15378 \# %S Series (books or journals)
15380 .if \\n[ref*type]=1 \{\
15383 .if \\n[ref*type]=2 \{\
15384 . ie \\n([T .ref*field S "" " "
15385 . el .ref*field S . " "
15387 .if \\n[ref*type]=3 \{\
15388 . ie \\n([T .ref*field S "" " "
15389 . el .ref*field S . " "
15392 \# refer doesn't set reg [T to 1 for series titles, so we do it here
15394 .substring eval*[S -1
15395 .if '\\*[eval*[S]'!' .nr [T 1
15396 .if '\\*[eval*[S]'?' .nr [T 1
15401 .ie \\n([T .ref*field C "" " "
15402 .el .ref*field C . " "
15405 \# %I Publisher (I stands for Issuer)
15407 .ie !'\\*([C'' .ref*field I :
15409 . ie \\n([T .ref*field I "" " "
15410 . el .ref*field I . " "
15414 \# %D Date of publication
15416 .if \\n[ref*type]=1 \{\
15417 . ie !'\\*([V''.ref*field D "" "(" ")"
15420 .if \\n[ref*type]=2 .ref*field D ,
15421 .if \\n[ref*type]=3 \{\
15423 . ie '\\*([I'' .ref*field D . " "
15424 . el .ref*field D ,
15426 . el .ref*field D ,
15428 .if \\n[ref*type]=4 .ref*field D ,
15430 \# %P Page number(s)
15432 .ie \\n[ref*type]=1 .ref*field P :
15433 .el .ref*field P . " "
15435 \# %G Gov't. ordering number
15439 \# %O Other (usually goes at end of ref)
15442 .ie r [O .nr ref*suppress-period \\n([O
15443 .el .nr ref*suppress-period 1
15452 \# %d date of publication (the orignal date of publication)
15454 .ie \\n([T .ref*field d "" " "
15455 .el .ref*field d . " "
15458 \# %a additions (such as a new intro to reprints)
15460 .ie \\n([T .ref*field a "" " "
15461 .el .ref*field a . " "
15464 \# %t title, if different from original title (the T field, which s/b
15465 \# the original title)
15467 .ie \\n([T .ref*field t "" " Rpt. as \E*[IT]" "" \E*[PREV]
15468 .el .ref*field t . " Rpt. as \E*[IT]" "" \E*[PREV]
15472 \# Translated works
15473 \# ----------------
15476 .ie \\n([T .ref*field l "" " Trans. "
15477 .el .ref*field l . " Trans. "
15480 \# %r Translato(r) and edito(r)
15482 .ie \\n([T .ref*field r "" " Trans. and Ed. "
15483 .el .ref*field r . " Trans. and Ed. "
15491 .ie \\n([s .ref*field s "" ".\E*[IT]" "" \E*[PREV]
15492 .el .ref*field s . " \E*[IT]" "" \E*[PREV]
15493 .\" refer doesn't set reg [T to 1 for these book titles, so we do it here
15495 .substring eval*[s -1
15497 .if '\\*[eval*[s]'!' .nr [T 1
15498 .if '\\*[eval*[s]'?' .nr [T 1
15501 \# %c content of site, if unclear (i.e. advertisement, cartoon,
15502 \# interview, etc.)
15504 .ie \\n([T .ref*field c "" " "
15505 .el .ref*field c . " "
15508 \# %o organization, group or sponsor of site
15510 .ie \\n([T .ref*field o "" " "
15511 .el .ref*field o . " "
15514 \# %a access date, i.e. the date you read it
15516 .ie \\n([T .ref*field a "" " "
15517 .el .ref*field a . " "
15522 .ref*field u "" " <" ">"
15526 \# Build up reference string from ref*add-<x> macros.
15529 .if d ref*string \{\
15530 . ie d ref*post-punct \{\
15531 . as ref*string "\\$2\\*[ref*post-punct] \"
15532 . rm ref*post-punct
15534 . el .as ref*string "\\$2 \"
15536 .as ref*string "\\$3\\*([\\$1\\$4
15537 .if \\n[.$]>4 .ds ref*post-punct "\\$5
15538 .nr ref*suppress-period 0
15543 \# This is a wrapper for MNinit.
15545 \# I could use a 'while' loop to assign args to strings, but too many
15546 \# 'while' loops are slowing things down.
15549 . if !'\\$1'rerun' \{\
15560 . ie \\n[#START_FOR_MNinit]=0 \{\
15561 . nr #MNinit_DEFERRED 1
15562 . nr #START_FOR_MNinit 1
15566 . MNinit \\*[$MN-arg1] \\*[$MN-arg2] \\*[$MN-arg3] \\*[$MN-arg4] \\*[$MN-arg5] \\*[$MN-arg6] \\*[$MN-arg7] \\*[$MN-arg8] \\*[$MN-arg9]
15570 .MAC MN_OVERFLOW_TRAP END
15571 . if \\n[#OVERFLOW_LEFT]=1 \{\
15572 . nr #no-repeat-MN-left 1
15573 . di MN_OVERFLOW_LEFT
15575 . if \\n[#OVERFLOW_RIGHT]=1 \{\
15576 . nr #no-repeat-MN-right 1
15577 . di MN_OVERFLOW_RIGHT
15579 . rr #OVERFLOW_LEFT
15580 . rr #OVERFLOW_RIGHT
15584 The remainder of the margin notes macros and routines are adapted
15585 from Werner Lemberg's MN.tmac.
15591 \# MNinit [ragged|symmetric] \
15592 \# left-width right-width separation \
15593 \# font fontsize vertical-spacing \
15594 \# color hyphenation-flags
15596 \# Initialize margin notes. Empty arguments (denoted with "") set
15597 \# default values. If the first argument is the string `ragged',
15598 \# left and right margin notes are printed ragged-right. If it is
15599 \# `symmetric', left margin notes are printed ragged-left and right
15600 \# margin notes ragged-right. If omitted, margin notes are left
15601 \# and right adjusted.
15606 . ds MN-left-ad b\"
15607 . ds MN-right-ad b\"
15608 . if '\\$1'RAGGED' \{\
15609 . ds MN-left-ad l\"
15610 . ds MN-right-ad l\"
15613 . if '\\$1'SYMMETRIC' \{\
15614 . ds MN-left-ad r\"
15615 . ds MN-right-ad l\"
15619 . nr MN-sep (n;\\$3)
15622 . if ((\\n[.o] - \\n[MN-sep]) < 1n) \
15623 . ab MN: Left margin too small (<1n) for requested margin notes separation.
15625 . nr MN-left-width (n;\\$1)
15626 . nr MN-left-start (\\n[.o] - \\n[MN-sep] - \\n[MN-left-width])
15629 . nr MN-left-width (\\n[.o] - \\n[MN-sep])
15630 . nr MN-left-start 0
15632 . if (\\n[MN-left-start] < 0) \
15633 . ab MN: Left margin too small for requested margin notes settings.
15634 . if (\\n[MN-left-width] < 1n) \
15635 . ab MN: Left margin notes width too small (<1n).
15638 . nr MN-right-width (n;\\$2)
15639 . nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
15640 . if \\n[#COLUMNS]=1 \{\
15641 . if !\\n[#NUM_COLS]=1 \{\
15642 . nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
15647 . nr MN-right-width \\n[MN-left-width]
15648 . nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
15649 . if \\n[#COLUMNS]=1 \{\
15650 . if !\\n[#NUM_COLS]=1 \{\
15651 . nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
15656 . ds MN-font \\$4\"
15657 . if \\n[#PRINT_STYLE]=1 .ds MN-font CR
15660 . ds MN-font \\*[$PP_FT]
15661 . if \\n[#PRINT_STYLE]=1 .ds MN-font CR
15665 . nr MN-size \\n[.ps]
15667 . if \\n[#PRINT_STYLE]=1 \{\
15669 . nr MN-size \\n[.ps]
15674 . nr MN-size \\n[#DOC_PT_SIZE]
15678 . nr MN-spacing \\n(.v
15680 . if '\\$6'DOC' \{ .nr MN-spacing \\n[#DOC_LEAD] \}
15681 . if \\n[#PRINT_STYLE]=1 \{\
15682 . nr MN-spacing \\n[#DOC_LEAD]
15686 . nr MN-spacing \\n[#DOC_LEAD]
15689 . if !\\n[#PRINT_STYLE]=1 .ds MN-color \\$7\"
15691 . if !\\n[#PRINT_STYLE]=1 .ds MN-color
15695 . nr MN-hy \\n[.hy]
15696 . ev MNbottom-left-env
15697 . if \A'\\*[MN-font]' \
15699 . if \\n[MN-size] \
15701 . if \\n[MN-spacing] \
15702 . vs \\n[MN-spacing]u
15703 . ll \\n[MN-left-width]u
15704 . ad \\*[MN-left-ad]
15707 . nop \m[\\*[MN-color]]\c
15709 . ev MNbottom-right-env
15710 . if \A'\\*[MN-font]' \
15712 . if \\n[MN-size] \
15714 . if \\n[MN-spacing] \
15715 . vs \\n[MN-spacing]u
15716 . ll \\n[MN-right-width]u
15717 . ad \\*[MN-right-ad]
15720 . nop \m[\\*[MN-color]]\c
15729 \# margin note text
15732 \# With a parameter, start a margin note, otherwise end a margin note.
15733 \# If the parameter is the string `left', define a left margin note,
15734 \# otherwise define a right margin note.
15738 .if \\n[#COLUMNS]=1 \{\
15739 . if \\n[#NUM_COLS]>2 \{\
15740 . tm MN: More than two columns. Ignoring margin notes.
15743 . if !\\n[#NUM_COLS]=1 \{\
15744 . ie \\n[#COL_NUM]=1 .ds MN-dir LEFT
15745 . el .ds MN-dir RIGHT
15748 . if !\\n[#MNinit]=1 \{\
15749 . tm MN: You must set parameters with MN_INIT before using MN.
15753 . if \\n[MN-active] \{\
15754 . tm MN: Can't handle nested margin notes.
15759 . ie '\\*[MN-dir]'LEFT' \{\
15761 . ds MN-curr l-\\n[MN-left]\"
15762 . evc MNbottom-left-env
15766 . ds MN-curr r-\\n[MN-right]\"
15767 . evc MNbottom-right-env
15769 . mk MN-mk-\\*[MN-curr]
15770 . di MN-div-\\*[MN-curr]
15773 . if \\n[MN-active] \{\
15776 . nr MN-div-\\*[MN-curr]-depth \\n(dn
15785 \# Resets these registers (called in HEADER)
15794 \# The "left" half of Werner's original MNbottom.
15799 . nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
15802 . if \\n[MN-active] \{\
15804 . tm MN: Margin note finished by new page. Ignored.
15806 . po \\n[MN-left-start]u
15807 . ev MNbottom-left-env
15808 . nr #P \\n%+\\n[#PAGE_NUM_ADJ]
15809 . while (\\n[MN-curr] < \\n[MN-left]) \{\
15811 . ie (\\n[MN-last-pos] < \\n[MN-mk-l-\\n[MN-curr]]) \
15812 . sp |\\n[MN-mk-l-\\n[MN-curr]]u+\\n[MN-lead-adj]u
15817 . if \\n[#SHIM]u>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
15818 . tm MN: Warning: Left margin note #\\n[MN-curr] on page \\n[#P] shifted down.
15820 .\" If last margin note doesn't fit
15821 . if ( (\\n(nl+\\n[MN-div-l-\\n[MN-curr]-depth]) > (\\n(.p+\\n[#VARIABLE_FOOTER_POS]) ) \{\
15822 . if \\n[MN-shifted]=1 \{\
15823 . sp -(1v+\\n[#SHIM]u)
15824 . rm MN-div-l-\\n[MN-curr]
15825 . tm1 "[mom]: No room to start left margin note #\\n[MN-curr] on page \\n[#P] on page \\n[#P].
15826 . tm1 " Ignoring margin note.
15829 . nr #no-repeat-MN-left 1
15830 . nr #OVERFLOW_LEFT 1
15831 . wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
15834 . MN-div-l-\\n[MN-curr]
15836 . nr MN-last-pos \\n[nl]
15840 . if !\\n[#no-repeat-MN-left]=1 \{\
15841 . if \\n[MN-right]=0 .vpt 1
15847 \# The "right" half of Werner's original MNbottom.
15852 . nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
15854 . po \\n[MN-right-start]u
15855 . ev MNbottom-right-env
15856 . nr #P \\n%+\\n[#PAGE_NUM_ADJ]
15857 . while (\\n[MN-curr] < \\n[MN-right]) \{\
15859 . ie (\\n[MN-last-pos] < \\n[MN-mk-r-\\n[MN-curr]]) \
15860 . sp |\\n[MN-mk-r-\\n[MN-curr]]u+\\n[MN-lead-adj]u
15865 . tm MN: Warning: Right margin note #\\n[MN-curr] on page \\n[#P] shifted down.
15867 .\" If last margin note doesn't fit
15868 . if ( (\\n(nl+\\n[MN-div-r-\\n[MN-curr]-depth]) > (\\n(.p+\\n[#VARIABLE_FOOTER_POS]) ) \{\
15869 . if \\n[MN-shifted]=1 \{\
15870 . sp -(1v+\\n[#SHIM]u)
15871 . rm MN-div-r-\\n[MN-curr]
15872 . tm1 "[mom]: No room to start right margin note #\\n[MN-curr] on page \\n[#P] on page \\n[#P].
15873 . tm1 " Ignoring margin note.
15876 . nr #no-repeat-MN-right 1
15877 . nr #OVERFLOW_RIGHT 1
15878 . wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
15881 . MN-div-r-\\n[MN-curr]
15883 . nr MN-last-pos \\n[nl]
15887 ' sp |\\n[MN-curr-pos]u
15888 . if !\\n[#no-repeat-MN-right]=1 .vpt 1