3 Mom -- a typesetting/document-processing macro set for groff.
5 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
6 Free Software Foundation, Inc.
7 Written by Peter Schaffter (pschaffter@magma.ca)
9 This file is part of groff.
11 groff is free software; you can redistribute it and/or modify it under
12 the terms of the GNU General Public License as published by the Free
13 Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 groff is distributed in the hope that it will be useful, but WITHOUT ANY
17 WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
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.
47 \# ====================================================================
49 \# Check which version of groff is being run
50 .if (\n[.x]\n[.y] < 118) \
51 . ab [mom]: You need GNU troff version 1.18 or higher to run this version of mom.
52 \# Check that GNU troff is being run
54 . ab [mom]: The mom macros require that you be running GNU troff.
56 . ab [mom]: The groff mom macros do not work in compatibility mode.
57 \# Add supplementary styles
58 .sty \n[.fp] L \" Light Roman
59 .sty \n[.fp] LI \" Light Italic
60 .sty \n[.fp] LCD \" Light Condensed Roman
61 .sty \n[.fp] LCDI \" Light Condensed Italic
62 .sty \n[.fp] LEX \" Light Extended Roman
63 .sty \n[.fp] LEXI \" Light Extended Italic
64 .sty \n[.fp] CD \" Medium/Book Condensed Roman
65 .sty \n[.fp] CDI \" Medium/Book Condensed Italic
66 .sty \n[.fp] EX \" Medium/Book Extended Roman
67 .sty \n[.fp] EXI \" Medium/Book Extended Italic
68 .sty \n[.fp] DB \" DemiBold Roman
69 .sty \n[.fp] DBI \" DemiBold Italic
70 .sty \n[.fp] BCD \" Bold Condensed Roman
71 .sty \n[.fp] BCDI \" Bold Condensed Italic
72 .sty \n[.fp] BEX \" Bold Extended Roman
73 .sty \n[.fp] BEXI \" Bold Extended Italic
74 .sty \n[.fp] HV \" Heavy Roman
75 .sty \n[.fp] HVI \" Heavy Italic
76 .sty \n[.fp] HVCD \" Heavy Condensed Roman
77 .sty \n[.fp] HVCDI \" Heavy Condensed Italic
78 .sty \n[.fp] HVEX \" Heavy Extended Roman
79 .sty \n[.fp] HVEXI \" Heavy Extended Italic
80 .sty \n[.fp] BL \" Black Roman
81 .sty \n[.fp] BLI \" Black Italic
82 .sty \n[.fp] BLCD \" Black Condensed Roman
83 .sty \n[.fp] BLCDI \" Black Condensed Italic
84 .sty \n[.fp] BLEX \" Black Extended Roman
85 .sty \n[.fp] BLEXI \" Black Extended Italic
86 .sty \n[.fp] UBL \" Ultra-Black Roman
87 .sty \n[.fp] UBLI \" Ultra-Black Italic
89 \# Instruct grops to use square linecaps and joins.
90 \# This instruction is also executed in DO_B_MARGIN, NEWPAGE, and HEADER
92 \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
94 \# ====================================================================
96 \# TYPESETTING MACROS, STRINGS, AND ALIASES
97 \# ========================================
101 \# Alias .als as ALIAS, and .aln (number registers) as ALIASN
107 \# ALIASES FOR GROFF REQUESTS
108 \# --------------------------
119 \# ALIASES FOR NUMBER REGISTERS
120 \# ----------------------------
122 .ALIASN #PT_SIZE .ps \"fractional point size in units
123 .ALIASN #DIVER_DEPTH dn \"diversion depth
124 .ALIASN #DIVER_WIDTH dl \"diversion width
125 .ALIASN #TRAP_DISTANCE .t \"distance to next trap
126 .ALIASN #LEAD .v \"line space (.vs, not .ls)
127 .ALIASN #PAGE_LENGTH .p \"page length
128 .ALIASN #NUM_ARGS .$ \"number of arguments passed to a macro
129 .ALIASN #INDENT .i \"value of current indent
131 \# ====================================================================
135 .nr #L_MARGIN \n(.o \" Tabs, etc require #L_MARGIN
136 .cflags 4 /\(en \" So slash and en-dashes get broken
139 \# About the warn level
140 \# --------------------
142 \# There's a lot of testing for the presence of number registers and
143 \# strings in this macro file. Many of the registers and strings
144 \# pop into and out of existence on the fly. For convenience, I
147 \# .if \\n[whatever] and .if !\\n[whatever]
149 \# to test "if the register exists and is (not) empty." Groff,
150 \# encountering such tests when called with the -ww options, emits
152 \# warning: number register whatever not defined.
154 \# Groff also warns about strings similarly tested for.
156 \# The warn level, above, is high in order to shut off those
157 \# warnings. If you're futzing in this file and need more verbose
158 \# warnings, either comment out ".warn 8192" or set the warnlevel
159 \# to the one you need (but be ready for lots of what I've just
162 \# ====================================================================
166 \# Macros that control the physical layout of the page: paper size
172 \# <width of printer sheet>
174 \# Stores user supplied page width in register #PAGE_WIDTH.
176 \# #PAGE_WIDTH is used to establish the default LL (and right margin).
177 \# Requires unit of measure.
181 . nr #PAGE_WIDTH \\$1
182 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
183 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
190 \# <offset from page left>
192 \# Stores user supplied page offset in register #L_MARGIN.
193 \# Sets .po to user supplied offset.
195 \# Requires unit of measure.
199 . nr #L_MARGIN (\\$1)
207 \# <width of right margin>
209 \# Stores user supplied right margin in register #R_MARGIN.
211 \# This is a pseudo-margin. Right margin is actually a function of
212 \# line length. The macro calculates line length from the page offset
213 \# and the value plugged into #R_MARGIN.
215 \# N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
217 \# Requires unit of measure.
221 . nr #R_MARGIN (\\$1)
222 . ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
224 . nr #L_LENGTH \\n(.l
231 \# <distance to advance from top of page>
233 \# Stores the user supplied top margin in register #T_MARGIN.
234 \# Advances user supplied depth from the top of the page.
236 \# Requires unit of measure.
239 . nr #T_MARGIN (\\$1)
242 . sp |\\n[#T_MARGIN]u-1v
251 \# <space to leave at the bottom of the page>
253 \# Stores the user supplied bottom margin in register #B_MARGIN.
255 \# Requires unit of measure.
259 . nr #B_MARGIN (\\$1)
260 . nr #ORIGINAL_B_MARGIN \\n[#B_MARGIN]
262 . wh -\\n[#B_MARGIN]u DO_B_MARGIN
269 \# <pagewidth> [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
271 \# Page set-up. Collects arguments and passes them to the appropriate
274 \# All arguments after pagewidth are optional, but must appear
275 \# in the order given above. (User can fill in as much or as
276 \# little as desired.)
278 \# All arguments require a unit of measure.
284 . ie '\\$3'' \{ .L_MARGIN \\n(.o \}
285 . el \{ .L_MARGIN \\$3 \}
286 . ie '\\$4'' \{ .R_MARGIN 1i \}
287 . el \{ .R_MARGIN \\$4 \}
288 . if !'\\$5'' \{ .T_MARGIN \\$5 \}
289 . if !'\\$6'' \{ .B_MARGIN \\$6 \}
292 \# =====================================================================
294 \# +++PAGE CONTROL+++
296 \# Generic macros for breaking pages.
303 \# Plants the top margin at the top of each page.
305 \# The trap is set in .T_MARGIN or .PAGE
310 . sp |\\n[#T_MARGIN]u-1v
312 . sp -\\n[#T_MARGIN_LEAD_ADJ]u
321 \# Plants the bottom margin at the bottom of each page.
323 \# The trap is set in .B_MARGIN or .PAGE.
326 . nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000
329 . nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
339 \# Breaks to a new page.
341 \# If a B_MARGIN has been set, processes that, otherwise, just
342 \# breaks to a new page.
345 . ie \\n[#NO_BREAK] \{\
353 . ie \\n[#B_MARGIN_SET]=1 \{\
354 . ie !\\n[#DOCS]=1 \{\
357 . nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
361 . if \\n[#COLUMNS]=1 \{ .nr #COL_NUM \\n[#NUM_COLS] \}
362 . ie !\\n[#FN_DEPTH] \{\
363 . ch FN_OVERFLOW_TRAP
365 . wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
377 \# =====================================================================
379 \# +++GENERAL STYLE MACROS+++
381 \# Macros that are likely to appear together to define general
382 \# type style: line length, family, font, point size, and line
390 \# Stores user supplied line length in register #L_LENGTH.
391 \# Sets .ll to #L_LENGTHu
393 \# Requires unit of measure.
396 . nr #USER_SET_L_LENGTH 1
398 . nr #L_LENGTH \\n(.l
403 \# +++FAMILY AND FONT+++
408 \# <fallback font> [ ABORT | WARN ] | ABORT | WARN
410 \# Sets register #ABORT_FT_ERRORS to 1, or defines a fallback font
411 \# called "dummy" at font position 0.
413 \# Calls to non-existent families cause mom to continue processing
414 \# files using the fallback font until a valid family is entered.
416 \# Calls to non-existent fonts generate warnings. If ABORT is passed
417 \# to FALLBACK_FONT, mom stops processing files after the warning.
418 \# Otherwise, she continues to process files using the fallback font
419 \# after the warning is issued. The default fallback font is CR; the
420 \# default for font warnings is to abort.
422 .MAC FALLBACK_FONT END
423 . if \\n[#NUM_ARGS]=1 \{\
424 . if '\\$1'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
426 . if r#ABORT_FT_ERRORS \{ .nr #ABORT_FT_ERRORS 0 \}
428 . if !'\\$1'ABORT' \{\
429 . if !'\\$1'WARN' \{\
434 . if \\n[#NUM_ARGS]=2 \{\
436 . if '\\$2'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
437 . if '\\$2'WARN' \{ .nr #ABORT_FT_ERRORS 0 \}
441 .FALLBACK_FONT CR ABORT
448 \# Stores user supplied font family in string $FAMILY. Sets .fam
453 . if \\n[#PRINT_STYLE]=1 \{\
457 . if \\n[#IGNORE] \{\
461 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
462 . ds $SAVED_STYLE \\n[.sty]
466 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
467 . ft \\*[$SAVED_STYLE]
472 . ie \\n[#PRE_COLLATE]=1 \{ . \}
474 . if \\n[#COLLATE]=1 \{\
475 . if !r#START \{ .DOC_FAM \\*[$FAMILY] \}
484 \# R | I | B | BI | <other style extension>
486 \# Stores user supplied font in $FONT and sets .ft to $FONT.
490 . if \\n[#PRINT_STYLE]=1 \{\
492 . if \\n[#UNDERLINE_ITALIC]=1 \{\
496 . if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
502 . el \{ .UNDERLINE OFF \}
507 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
508 . if '\\n[.sty]'' \{\
510 . if !S\\*[$FONT] \{\
511 . tm1 "[mom]: Font style "\\*[$FONT]" at line \\n(.c has not been registered.
512 . ie \\n[#ABORT_FT_ERRORS]=0 \{\
513 . tm1 " Continuing to process using fallback font.
518 . tm1 "[mom]: Either font style "\\*[$FONT]" at line \\n(.c does not exist in family "\\n[.fam]",
519 . tm1 " or family "\\n[.fam]" has not been installed in font/devps.
520 . ie \\n[#ABORT_FT_ERRORS]=0 \{\
521 . tm1 " Continuing to process using fallback font.
534 \# <point size of type>
536 \# Sets point size to user supplied value in scaled points.
537 \# If #AUTO_LEAD is on, sets .vs to #AUTOLEAD_VALUE+#PT_SIZE.
539 \# Must NOT use a unit of measure.
542 . if \\n[#PRINT_STYLE]=1 \{ .return \}
543 . if \\n[#IGNORE] \{ .return \}
546 . if \\n[#AUTO_LEAD] \{\
547 . ie \\n[#AUTOLEAD_FACTOR] \{ .vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u \}
548 . el \{ .vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u \}
550 . nr #PT_SIZE_IN_UNITS \\n[.ps]
557 \# <point size of type>
559 \# Sets point size to user supplied value in scaled points.
560 \# Intended to be called inline with \*[SIZE <n><unit>]
562 \# Can be used with a unit of measure or not.
573 \# <leading between lines of text>
575 \# Turns off #AUTOLEAD if it's on.
576 \# Sets .vs to user supplied value.
578 \# Does not require unit of measure. LS automatically turns off AUTOLEAD.
582 . nr #OLD_LEAD \\n(.v
583 . if \\n[#PRINT_STYLE]=1 \{ .return \}
584 . if \\n[#IGNORE] \{ .return \}
585 . if \\n[#AUTO_LEAD] \{\
587 . rr #AUTOLEAD_FACTOR
591 . nr #TOP_BASELINE_ADJ \\n(.v-\\n[#OLD_LEAD]
592 . sp -\\n[#TOP_BASELINE_ADJ]u
594 . rr #TOP_BASELINE_ADJ
607 \# <leading value to add to #PT_SIZE> [FACTOR]
609 \# Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
610 \# Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
611 \# All subsequent PT_SIZE requests reset the leading in the same way until
612 \# AUTOLEAD is turned off.
614 \# With the optional FACTOR argument, the current point size is
615 \# multiplied by #AUTOLEAD_VALUE instead of the two being added
619 . if \\n[#PRINT_STYLE]=1 \{ .return \}
620 . if \\n[#IGNORE] \{ .return \}
622 . nr #OLD_LEAD \\n(.v
623 . nr #AUTOLEAD_VALUE (p;\\$1)
624 . ie \\n[#NUM_ARGS]=2 \{\
625 . if '\\$2'FACTOR' \{\
626 . nr #AUTOLEAD_FACTOR 1
627 . vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u
631 . vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u
634 . nr #TOP_BASELINE_ADJ \\n(.v-\\n[#OLD_LEAD]
635 . sp -\\n[#TOP_BASELINE_ADJ]u
637 . rr #TOP_BASELINE_ADJ
642 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
643 \# ------------------------------------------------
651 \# =====================================================================
655 \# AUTOMATIC PAIRWISE KERNING
656 \# --------------------------
658 \# <none> | <anything>
660 \# Turns automatic pairwise kerning on or off.
674 \# INLINE KERNING AND HORIZONTAL MOVEMENT
675 \# --------------------------------------
678 \# Inline kerning provides a simple method for users to adjust the
679 \# amount of space between any two letters. It's predicated on a
680 \# unit of measure "U", which is 1/36 of the current point size as
681 \# returned by \n[.ps]. E.g., if the current point size is 18,
682 \# \n[.ps] returns 18000u, therefore U=500u. Since U remains
683 \# proportional relative to the current point size, the amount
684 \# of kerning between two letters as expressed in Us remains
685 \# visually similar regardless of changes in point size.
687 \# N.B.--the amount of inline kerning supplied by \*[BU<n>] or
688 \# \*[FU<n>] is added to or subtracted from any kerning that already
689 \# takes place between two characters when automatic kerning is
692 \# In groff v. 1.17.2, it was not possible to pass arguments to macros that
693 \# were called with inline escapes, nor thence to evaluate conditional
694 \# expressions. Consequently, each pseudo-escape \[BU<n>] had to be defined
695 \# separately with ".char".
697 \# As of v. 1.18, one can pass arguments to inline strings/macros,
698 \# hence it is now possible to do \*[BU n] where n, inline, is the desired
699 \# number of kern units. The original .char definitions have been left in
700 \# for backward compatibility with documents created prior to mom-1.1.3c.
703 .ds BU \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
704 .ds FU \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
706 \# Initialize strings for pre-1.1.3c-style BU and FU
709 .while \n+[#LOOP]<37 \{\
710 . ds BU\n[#LOOP] \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
714 .while \n+[#LOOP]<37 \{\
715 . ds FU\n[#LOOP] \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
719 \# Horizontal movements
720 \# --------------------
721 \# BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
722 \# specified number of points.
724 \# Left in for backward compatibility with mom-1.1.3c, the
725 \# preferred methods for inline horizontal movements are now
726 \# \*[BCK <n><unit>] and \*[FWD <n><unit>].
735 .ds BP1.25 \h'-1.25p'
737 .ds BP1.75 \h'-1.75p'
739 .ds BP2.25 \h'-2.25p'
741 .ds BP2.75 \h'-2.75p'
743 .ds BP3.25 \h'-3.25p'
745 .ds BP3.75 \h'-3.75p'
747 .ds BP4.25 \h'-4.25p'
749 .ds BP4.75 \h'-4.75p'
751 .ds BP5.25 \h'-5.25p'
753 .ds BP5.75 \h'-5.75p'
755 .ds BP6.25 \h'-6.25p'
757 .ds BP6.75 \h'-6.75p'
759 .ds BP7.25 \h'-7.25p'
761 .ds BP7.75 \h'-7.75p'
763 .ds BP8.25 \h'-8.25p'
765 .ds BP8.75 \h'-8.75p'
767 .ds BP9.25 \h'-9.25p'
769 .ds BP9.75 \h'-9.75p'
771 .ds BP10.25 \h'-10.25p'
772 .ds BP10.5 \h'-10.5p'
773 .ds BP10.75 \h'-10.75p'
775 .ds BP11.25 \h'-11.25p'
776 .ds BP11.5 \h'-11.5p'
777 .ds BP11.75 \h'-11.75p'
779 .ds BP12.25 \h'-12.25p'
780 .ds BP12.5 \h'-12.5p'
781 .ds BP12.75 \h'-12.75p'
823 .ds FP10.25 \h'10.25p'
825 .ds FP10.75 \h'10.75p'
827 .ds FP11.25 \h'11.25p'
829 .ds FP11.75 \h'11.75p'
831 .ds FP12.25 \h'12.25p'
833 .ds FP12.75 \h'12.75p'
836 \# WHOLE LINE KERNING (RW and EW)
837 \# -----------------------------
838 \# The line kerning macros are special instances of track kerning,
839 \# used where a complete line needs to be tightened (or relaxed) in
840 \# order to accomodate or remove one or two more characters
841 \# than the default justification permits.
844 \# <amount of overall "kerning" (letter spacing) to apply to the line>
846 \# Invokes .tkf (track kerning) for the current font with
847 \# 1 as both the upper and lower point size limits, so that
848 \# the value entered by the user applies regardless of point
849 \# size. RW ("Reduce Whitespace") reduces the amount of space
850 \# between all characters by an equal amount. EW ("Extra
851 \# Whitespace") increases the amount of space.
853 \# Decimal values are acceptable.
855 \# The groff documentation is a tad confusing about what unit of
856 \# measure is used in track kerning, only that the width of each
857 \# character is increased or decreased by the amount(s) passed as
858 \# arguments to .tkf, and something about linear function of point
859 \# size. In fact, with the way I've put this macro together, it
860 \# doesn't matter. All the user needs to know is that a value of
861 \# one will produce an unacceptably tight or loose line at most text
862 \# point sizes; therefore, effective use of RW and EW is in the
863 \# fractional range below 1 (e.g. .25, .5). Given that RW and EW
864 \# are for massaging type, a certain amount of experimentation and
865 \# previewing is expected and necessary.
867 \# \n(.f holds the current font number, which is acceptable to .tkf.
869 \# RW and EW must be reset to 0 to cancel their effect on subsequent
873 . if \\n[#BR_AT_LINE_KERN] \{\
874 . ie \\n[#JUSTIFY]=1 \{ .brp \}
877 . tkf \\n(.f 1 -\\$1 1 -\\$1
882 . if \\n[#BR_AT_LINE_KERN] \{\
883 . ie \\n[#JUSTIFY]=1 \{ .brp \}
886 . tkf \\n(.f 1 \\$1 1 \\$1
890 \# BREAK AT LINE KERN
891 \# ------------------
895 \# Enables/disables .br's before .RW and .EW
897 \# Mostly, users will want .br's before any kind of line kerning, but
898 \# there may be cases where they don't. BR_BEFORE_LINE_KERN is off by
899 \# default and must be invoked explicitly.
901 .MAC BR_AT_LINE_KERN END
902 . ie '\\$1'' \{ .nr #BR_AT_LINE_KERN 1 \}
903 . el \{ .rr #BR_AT_LINE_KERN \}
906 \# =====================================================================
913 \# <none> | <anything> | DEFAULT
915 \# LINES <n> | MARGIN <n> | SPACE <n>
917 \# Turns auto hyphenation on or off, resets the hyphenation style
918 \# to default, or permits the setting of various hyphenation
921 \# HY, by itself, defaults to .hy 14, i.e. no hyphens after the
922 \# first two or before the last two characters of a word, and no
923 \# hyphenation of the last line prior to a trap (e.g., at the
924 \# bottom of a page).
926 \# HY DEFAULT resets the hyphenation style to .hy 14 (see
927 \# above) if that behaviour is desired after changes have been
928 \# made to LINES, MARGIN, or SPACE.
930 \# HY LINES <n> sets the number of allowable consecutive hyphenated lines.
932 \# HY MARGIN <n> sets the amount of space (ipPcm) allowed at the end
933 \# of a line in QUAD mode before hyphenation is tripped (e.g. if there's
934 \# only 6 points left, groff won't try to hyphenate the next word).
936 \# HY SPACE sets the amount of extra interword space (ipPcm) that can
937 \# be added in JUSTIFY mode to prevent a line from being hyphenated.
945 . if !'\\$1'LINES' \{\
949 . if !'\\$1'MARGIN' \{\
953 . if !'\\$1'SPACE' \{\
957 . if !'\\$1'DEFAULT' \{\
961 . if '\\$1'LINES' \{ .hlm \\$2 \}
962 . if '\\$1'MARGIN' \{ .hym \\$2 \}
963 . if '\\$1'SPACE' \{ .hys \\$2 \}
964 . if '\\$1'DEFAULT' \{\
973 \# HYPHENATION PARAMETERS
974 \# ----------------------
976 \# <# of lines> | <size of margin> | <amount of interword space>
978 \# Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
987 \# =====================================================================
989 \# +++VERTICAL SPACING+++
994 \# <user supplied lead to advance below current baseline>
996 \# Creates or modifies register #ALD. Adds user supplied lead
997 \# below current baseline.
999 \# Requires a unit of measure.
1002 . if \\n(nl=0 \{ .nr #TOP 1 \}
1007 . if '\\$0'ADD_SPACE' \{\
1012 . if '\\$0'SPACE' \{\
1024 \# <user supplied lead to reverse above current baseline>
1026 \# Creates or modifies register #RLD. Reverses user supplied
1027 \# lead above current baseline.
1029 \# Requires a unit of measure.
1038 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding
1039 \# \*[RLD] forms have been left in for backward compatibility with
1040 \# documents created using mom-1.1.3c or earlier. The prefered methods
1041 \# of advancing and reversing on the page inline are \*[UP <n><unit>]
1042 \# and \*[DOWN <n><unit>].
1051 .ds ALD1.25 \v'1.25p'
1053 .ds ALD1.75 \v'1.75p'
1055 .ds ALD2.25 \v'2.25p'
1057 .ds ALD2.75 \v'2.75p'
1059 .ds ALD3.25 \v'3.25p'
1061 .ds ALD3.75 \v'3.75p'
1063 .ds ALD4.25 \v'4.25p'
1065 .ds ALD4.75 \v'4.75p'
1067 .ds ALD5.25 \v'5.25p'
1069 .ds ALD5.75 \v'5.75p'
1071 .ds ALD6.25 \v'6.25p'
1073 .ds ALD6.75 \v'6.75p'
1075 .ds ALD7.25 \v'7.25p'
1077 .ds ALD7.75 \v'7.75p'
1079 .ds ALD8.25 \v'8.25p'
1081 .ds ALD8.75 \v'8.75p'
1083 .ds ALD9.25 \v'9.25p'
1085 .ds ALD9.75 \v'9.75p'
1087 .ds ALD10.25 \v'10.25p'
1088 .ds ALD10.5 \v'10.5p'
1089 .ds ALD10.75 \v'10.75p'
1091 .ds ALD11.25 \v'11.25p'
1092 .ds ALD11.5 \v'11.5p'
1093 .ds ALD11.75 \v'11.75p'
1095 .ds ALD12.25 \v'12.5p'
1096 .ds ALD12.5 \v'12.5p'
1097 .ds ALD12.75 \v'12.75p'
1099 .ds RLD.25 \v'-.25p'
1101 .ds RLD.75 \v'-.75p'
1103 .ds RLD1.25 \v'-1.25p'
1104 .ds RLD1.5 \v'-1.5p'
1105 .ds RLD1.75 \v'-1.75p'
1107 .ds RLD2.25 \v'-2.25p'
1108 .ds RLD2.5 \v'-2.5p'
1109 .ds RLD2.75 \v'-2.75p'
1111 .ds RLD3.25 \v'-3.25p'
1112 .ds RLD3.5 \v'-3.5p'
1113 .ds RLD3.75 \v'-3.75p'
1115 .ds RLD4.25 \v'-4.25p'
1116 .ds RLD4.5 \v'-4.5p'
1117 .ds RLD4.75 \v'-4.75p'
1119 .ds RLD5.25 \v'-5.25p'
1120 .ds RLD5.5 \v'-5.5p'
1121 .ds RLD5.75 \v'-5.75p'
1123 .ds RLD6.25 \v'-6.25p'
1124 .ds RLD6.5 \v'-6.5p'
1125 .ds RLD6.75 \v'-6.75p'
1127 .ds RLD7.25 \v'-7.25p'
1128 .ds RLD7.5 \v'-7.5p'
1129 .ds RLD7.75 \v'-7.75p'
1131 .ds RLD8.25 \v'-8.25p'
1132 .ds RLD8.5 \v'-8.5p'
1133 .ds RLD8.75 \v'-8.75p'
1135 .ds RLD9.25 \v'-9.25p'
1136 .ds RLD9.5 \v'-9.5p'
1137 .ds RLD9.75 \v'-9.75p'
1139 .ds RLD10.25 \v'-10.25p'
1140 .ds RLD10.5 \v'-10.5p'
1141 .ds RLD10.75 \v'-10.75p'
1143 .ds RLD11.25 \v'-11.25p'
1144 .ds RLD11.5 \v'-11.5p'
1145 .ds RLD11.75 \v'-11.75p'
1147 .ds RLD12.25 \v'-12.5p'
1148 .ds RLD12.5 \v'-12.5p'
1149 .ds RLD12.75 \v'-12.75p'
1151 \# =====================================================================
1153 \# +++REFINEMENTS+++
1155 \# AUTOMATIC LIGATURES
1156 \# -------------------
1158 \# <none> | <anything>
1160 \# Turns automatic ligature generation on or off.
1162 \# Ligatures may be supplied manually with \(fi, \(fl, etc.
1179 \# [ ,, ] | [ << ] | [ >> ] | <anything>
1181 \# [ DA | DE | ES | FR | IT | NL | NO | PT | SV ] | <anything>
1183 \# Turns smartquotes on (optionally with a quoting style from the
1184 \# argument list, or off).
1186 \# The " character is read outside the macro when mom is
1187 \# processed. The strings for open/close ($QUOTE<n>) are then
1188 \# defined in the macro.
1190 \# (Note to myself: code for " is \N'34'.)
1192 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1194 .MAC SMARTQUOTES END
1196 . if \\n[#RESTORE_SQ]=1 \{\
1198 . ie '\\*[$RESTORE_SQ]'' \{\
1203 . SMARTQUOTES \\*[$RESTORE_SQ]
1211 . ds $RESTORE_SQ \\$1
1218 . ds $RESTORE_SQ \\$1
1224 . ds $RESTORE_SQ \\$1
1230 . ds $RESTORE_SQ \\$1
1236 . ds $RESTORE_SQ \\$1
1242 . ds $RESTORE_SQ \\$1
1248 . ds $RESTORE_SQ \\$1
1252 . ds $QUOTE0 \\[Fo]\\|
1253 . ds $QUOTE1 \\|\\[Fc]
1254 . ds $RESTORE_SQ \\$1
1258 . ds $QUOTE0 \\[Fo]\\|
1259 . ds $QUOTE1 \\|\\[Fc]
1260 . ds $RESTORE_SQ \\$1
1266 . ds $RESTORE_SQ \\$1
1272 . ds $RESTORE_SQ \\$1
1278 . ds $RESTORE_SQ \\$1
1284 . ds $RESTORE_SQ \\$1
1286 . if !r#ARGS_TO_SQ \{\
1297 \# Strings for foot and inch marks
1302 \# =====================================================================
1304 \# +++LINE BREAKS+++
1311 \# Breaks a line without advancing.
1313 \# EL is the mnemonic used on older, dedicated typesetting machines
1314 \# to indicate "process the line, without advancing the galley
1315 \# medium." It stands for End Line.
1317 \# The \c inline must be appended to the end of input lines when in
1318 \# nofill mode; in fill modes, the \c inline must not be used.
1322 . if \\n[#PSEUDO_FILL]=1 \&
1328 \# An inline escape to accomplish the same thing. Actually
1329 \# preferable, since it works with filled and non-filled copy and
1330 \# doesn't require the user to remember to use (or not use) the \c.
1332 .ds B \h'|0'\R'#NO_ADVANCE 1'\c
1334 \# =====================================================================
1336 \# +++FILLING/QUADDING/JUSTIFYING+++
1343 \# Turns fill on and sets .ad to b.
1345 \# Justifies text left and right.
1348 . if \\n[#TAB_ACTIVE]=0 \{\
1350 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1354 . if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1362 \# L | LEFT | R | RIGHT | C | CENTER/CENTRE
1364 \# Turns fill on and sets .ad to l, r, or c.
1366 \# Terminology is a problem here. Some people call quad left
1367 \# left justified, flush left, or flush left/rag right (and the
1368 \# reverse for quad right). Quad center is sometimes called rag
1369 \# both. For our purposes, all "quad" modes mean that groff fill
1373 . ds $QUAD_VALUE \\$1
1374 . if \\n[#TAB_ACTIVE]=0 \{\
1376 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1380 . if '\\*[$QUAD_VALUE]'L' \{\
1384 . if '\\*[$QUAD_VALUE]'LEFT' \{\
1388 . if '\\*[$QUAD_VALUE]'R' \{\
1392 . if '\\*[$QUAD_VALUE]'RIGHT' \{\
1396 . if '\\*[$QUAD_VALUE]'C' \{\
1400 . if '\\*[$QUAD_VALUE]'CENTER' \{\
1404 . if '\\*[$QUAD_VALUE]'CENTRE' \{\
1408 . if '\\*[$QUAD_VALUE]'J' \{\
1412 . if '\\*[$QUAD_VALUE]'JUSTIFY' \{\
1420 \# LEFT, RIGHT, AND CENTER
1421 \# -----------------------
1422 \# The purpose of these macros is to allow the user to enter lines of
1423 \# text that will be quadded LRC *without* the user having to enter .BR
1424 \# or .br between lines. For the sake of consistency, all three appear
1425 \# to behave similarly (from the point of view of the user), although
1426 \# the underlying primitives don't. For this reason, LEFT, RIGHT, and
1427 \# CENTER must be followed by .QUAD [L R C J] or .JUSTIFY to restore
1428 \# text to groff fill mode.
1435 \# Turns fill mode off. Allows user to quad lines left without
1436 \# requiring the .BR or .br macro.
1438 \# LEFT simply turns fill off. Lines that exceed the current LL will
1439 \# not be broken, just continued (indefinitely) until a return is
1440 \# encountered. Note that this behaviour differs from the RIGHT and
1444 . if \\n[#TAB_ACTIVE]=0 \{\
1446 . ds $RESTORE_QUAD_VALUE LEFT
1451 .\" Fix for a little conflict with DOCTYPE LETTER
1452 . if '\\n(.z'LETTERHEAD1' \{ .rr #DATE_FIRST \}
1461 \# Turns fill on. Allows user to quad lines right without
1462 \# requiring the .BR or .br macro.
1464 \# Lines that exceed the current LL will be broken, with the excess
1465 \# text quadded right.
1468 . if \\n[#TAB_ACTIVE]=0 \{\
1470 . ds $RESTORE_QUAD_VALUE RIGHT
1483 \# Turns fill on. Allows user to center lines without
1484 \# requiring the .BR or .br macro.
1486 \# Lines that exceed the current LL will be broken, with the excess
1490 . if \\n[#TAB_ACTIVE]=0 \{\
1492 . ds $RESTORE_QUAD_VALUE CENTER
1499 \# =====================================================================
1503 \# There are two different kinds of tabs available: typesetting tabs
1506 \# Typesetting tabs are set with TAB_SET, which requires a tab number,
1507 \# an indent (offset) from the left margin and a length (optionally
1508 \# with a quad direction and an instruction to fill lines). After tabs
1509 \# are set with TAB_SET, they are called with .TAB n, where "n"
1510 \# corresponds to the number passed to TAB_SET as a valid tab number.
1512 \# String tabs allow the user to mark off tab positions inline. Tab
1513 \# indents and lengths are calculated from the beginning and end
1514 \# positions of the marks. Up to 19 string tabs may be created,
1515 \# numbered 1-19. Once created, they are called with .TAB n,
1516 \# just like typesetting tabs.
1518 \# Setting up string tabs is a two-step procedure. First, the user
1519 \# enters an input line in which s/he wants to mark off string tabs.
1520 \# The beginning of a tab is marked with \*[STn], where "n" is
1521 \# the desired number of the tab. The end of the the tab is marked
1522 \# with \*[STnX]. All ST's must have a matching STX. String tabs
1525 \# Next, the user invokes .ST n for every string tab defined, and
1526 \# optionally passes quad information to it. That done, string tabs
1527 \# can be called just like typesetting tabs.
1529 \# String tabs don't preview properly with gxditview. Use gv instead.
1531 \# Strings for string tab inlines
1532 \# ------------------------------
1533 \# Initialize string tab markers numbered 1 to 19.
1536 .while \n+[#LOOP]<20 \{\
1537 . ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET]
1541 .while \n+[#LOOP]<20 \{\
1542 . ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK]
1547 \# These are reserved ST numbers for internal use
1548 .ds ST100 \Ek[#ST100_OFFSET]
1549 .ds ST100X \Ek[#ST100_MARK]
1550 .ds ST101 \Ek[#ST101_OFFSET]
1551 .ds ST101X \Ek[#ST101_MARK]
1554 \# QUAD AND SET STRING TABS
1555 \# ------------------------
1557 \# <stringtab number> L | R | C | J [QUAD]
1559 \# Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1560 \# tab based on the collected information.
1562 \# Like TAB_SET, ST invoked without a quad direction will default to LEFT.
1563 \# If lines should be filled and quadded, use the optional argument QUAD.
1564 \# N.B. -- indents *must* be turned off before setting string tabs
1568 . ds $ST\\$1_QUAD_DIR \\$2
1569 . if \\n[#NUM_ARGS]=3 \{\
1570 . ds $ST\\$1_FILL QUAD
1572 . nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1573 . ie \\n[#IN_TAB] \{\
1574 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1577 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1585 \# <n> ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]]
1587 \# Creates macros TABn and TAB n, where "n" is any arbitrary number.
1588 \# TABn is a typesetting tab (i.e. a tab defined as an indent
1589 \# from the page left offset plus a line length.)
1591 \# n = arbitrary digit to identify the tab
1592 \# indent = indent from left margin; unit of measure required
1593 \# length = length of tab (unit of measure required; can be
1594 \# \w'<string>'u--if more than one word in string, surround
1595 \# with double quotes "\w'<three word string>'"
1596 \# LRCJ = quad for tab (left, right, center, justified)
1597 \# If option QUAD afterwards is not given, quad is line for line
1598 \# (no fill mode), meaning that there's no need for .BR or .br
1600 \# QUAD = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1603 \# N.B. -- indents *must* be turned off before setting tabs
1608 \# .TAB_SET 1 2P+6p 12P C
1610 \# means "create a tab numbered 1 that starts 2 picas and 6 points from
1611 \# the left margin, is 12 picas long, and centre each input line."
1613 \# .TAB_SET 1 2P+6P 12P C QUAD
1615 \# means exactly the same thing, except that input lines are joined and
1616 \# the area delimted by the tab filled with centered text.
1618 \# TAB n can be called at any time after being set.
1620 \# Tabs are NOT columnar in behaviour. If the text inside a
1621 \# tab runs to several lines, when you call the next tab a break
1622 \# occurs, meaning that the new tab starts one line below the last
1623 \# line in the previous tab. For columnar behaviour, you must
1624 \# use the multi-column macros in addition to tabs.
1626 \# If you want tabs to line up bottom-line to bottom-line (most likely
1627 \# single line tabs), use .TN (provided the tabs are numbered sequentially).
1628 \# Otherwise, you must use .EL then .TAB <n> if you want them to align.
1630 \# If you want to reset tabs, you must use .TQ before .TAB_SET.
1632 \# Note that indents are turned off automatically whenever a new
1633 \# tab is called with TAB <n>.
1635 \# Tabs themselves are user-invoked using the TAB macro with a numeric
1636 \# argument, e.g. TAB 1.
1638 \# Generally, in order not to get confused, it's a good idea
1639 \# to make sure all indents are off before setting tabs.
1643 . nr #TAB_NUMBER \\$1
1644 . ds $CURRENT_TAB \\n[#TAB_NUMBER]
1645 . nr #TAB_OFFSET (\\$2)
1646 . nr #TAB_LENGTH (\\$3)
1647 . MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1648 . if !\\\\n[#TB+]=1 \{ .br \}
1649 . if \\\\n[#TB+]=1 \{\
1656 . nr #CURRENT_TAB \\n[#TAB_NUMBER]
1657 . ds $CURRENT_TAB \\*[$CURRENT_TAB]
1658 . nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1659 . nr #ST_OFFSET \\n[#TAB_OFFSET]
1660 . po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
1661 . ll \\n[#TAB_LENGTH]u
1663 . ie '\\$5'QUAD' \{\
1664 . if '\\$4'L' \{ .QUAD L \}
1665 . if '\\$4'R' \{ .QUAD R \}
1666 . if '\\$4'C' \{ .QUAD C \}
1667 . if '\\$4'J' \{ .JUSTIFY \}
1670 . if '\\$4'' \{ .LEFT \}
1671 . if '\\$4'L' \{ .LEFT \}
1672 . if '\\$4'R' \{ .RIGHT \}
1673 . if '\\$4'C' \{ .CENTER \}
1674 . if '\\$4'J' \{ .JUSTIFY \}
1676 . if \\\\n[#TN]=1 \{\
1688 \# <tab number to tab into>
1690 \# Moves to tab number passed as an argument.
1693 . ds $TAB_NUMBER \\$1
1694 . TAB\\*[$TAB_NUMBER]
1704 \# Automagically moves to TAB<n+1> on the same line as the last
1705 \# line of the previous tab.
1707 \# The \c inline must be appended to the end of input lines when in
1708 \# nofill mode; in fill modes, the \c inline must not be used.
1714 . nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1719 \# An inline escape to accomplish the same thing. Actually
1720 \# preferable, since it works with filled and non-filled copy and
1721 \# doesn't require the user to remember to use (or not use) the \c.
1723 .ds TB+ "\c\\R'#TB+ 1'\\R'#TN 1'\\R'#NEXT_TAB \\n[#CURRENT_TAB]+1'\\*[TAB\\n[#NEXT_TAB]]\c
1730 \# Sets #TAB_ACTIVE to "0" (off).
1731 \# Resets left margin to value in effect prior to tabs.
1732 \# Resets line length to value in effect prior to tabs.
1733 \# Checks #QUAD to see if we were in flush or quad mode
1734 \# prior to tabs (0=off, 1=on).
1735 \# Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1736 \# in effect prior to tabs.
1738 \# TQ *must* come before setting any new tabs if you want the
1739 \# tabs' indents measured from page left. Otherwise, the tabs'
1740 \# indents are measured from the left margin of the tab you're
1747 . po \\n[#L_MARGIN]u
1748 . ll \\n[#L_LENGTH]u
1751 . ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1752 . el \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1755 . if '\\*[$RESTORE_QUAD_VALUE]'LEFT' \{ .LEFT \}
1756 . if '\\*[$RESTORE_QUAD_VALUE]'RIGHT' \{ .RIGHT \}
1757 . if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1761 \# ====================================================================
1769 \# <pre-defined NEWCOLOR or XCOLOR>
1771 \# Allows the inline escape for setting color to be called
1786 \# <color name> [<color scheme>] <color definition>
1788 \# Based on .defcolor, allows users to name and define colors using
1789 \# one of the four color schemes rgb, cmy, cmyk and grey. The new
1790 \# color is then defined as a string so that it can be called inline
1791 \# with \*[COLORNAME] or with .COLOR.
1793 \# With only two args, the default color scheme is rgb.
1795 \# It is highly recommended that users define new colors as
1796 \# all-cap strings, to differentiate them from x colors, which must
1797 \# be in lower case.
1800 . if \\n[#NUM_ARGS]=2 \{\
1801 . defcolor \\$1 rgb \\$2
1803 . if \\n[#NUM_ARGS]=3 \{\
1804 . if '\\$2'RGB' .ds $COLOR_SCHEME rgb
1805 . if '\\$2'CYM' .ds $COLOR_SCHEME cym
1806 . if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk
1807 . if '\\$2'GRAY' .ds $COLOR_SCHEME gray
1808 . if '\\$2'GREY' .ds $COLOR_SCHEME gray
1809 . defcolor \\$1 \\*[$COLOR_SCHEME] \\$3
1818 \# <x color name> [<alias>]
1820 \# Defines a string of x color name (i.e. a predefined x
1821 \# color). If <alias> is given, creates a string of <alias name>
1822 \# that references the x color name of the first argument.
1824 \# The color name must be a valid color name from rgb.txt, and
1825 \# must be given entirely in lower case, all one word.
1829 . if \\n[#NUM_ARGS]=2 \{\
1831 . ds $\\$2_FILL \\$1
1835 \# Pre-define xcolors black and white
1842 \# =====================================================================
1844 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1849 \# <none> | <anything>
1851 \# When on, underlines all letters, words, and digits in a passage,
1852 \# ignoring punctuation and spaces.
1854 \# Only for use when the font family is COURIER, to simulate
1855 \# typewriter-style underlining of italic passages.
1859 . nr #UNDERLINE_ON 1
1886 . char \[`A] _
\b\[`A]
1887 . char \[^A] _
\b\[^A]
1888 . char \['A] _
\b\['A]
1889 . char \[:A] _
\b\[:A]
1890 . char \[oA] _
\b\[oA]
1891 . char \[~A] _
\b\[~A]
1892 . char \[AE] _
\b\[AE]
1893 . char \[`E] _
\b\[`E]
1894 . char \[^E] _
\b\[^E]
1895 . char \['E] _
\b\['E]
1896 . char \[:E] _
\b\[:E]
1897 . char \[`I] _
\b\[`I]
1898 . char \[^I] _
\b\[^I]
1899 . char \['I] _
\b\['I]
1900 . char \[:I] _
\b\[:I]
1901 . char \[`O] _
\b\[`O]
1902 . char \[^O] _
\b\[^O]
1903 . char \['O] _
\b\['O]
1904 . char \[:O] _
\b\[:O]
1905 . char \[~O] _
\b\[~O]
1906 . char \[/O] _
\b\[/O]
1907 . char \[`U] _
\b\[`U]
1908 . char \[^U] _
\b\[^U]
1909 . char \['U] _
\b\['U]
1910 . char \[:U] _
\b\[:U]
1911 . char \[,C] _
\b\[,C]
1912 . char \[-D] _
\b\[-D]
1913 . char \[~N] _
\b\[~N]
1914 . char \[TP] _
\b\[TP]
1915 . char \['Y] _
\b\['Y]
1916 . char \[:Y] _
\b\[:Y]
1943 . char \[`a] _
\b\[`a]
1944 . char \[^a] _
\b\[^a]
1945 . char \['a] _
\b\['a]
1946 . char \[:a] _
\b\[:a]
1947 . char \[oa] _
\b\[oa]
1948 . char \[~a] _
\b\[~a]
1949 . char \[ae] _
\b\[ae]
1950 . char \[`e] _
\b\[`e]
1951 . char \[^e] _
\b\[^e]
1952 . char \['e] _
\b\['e]
1953 . char \[:e] _
\b\[:e]
1954 . char \[`i] _
\b\[`i]
1955 . char \[^i] _
\b\[^i]
1956 . char \['i] _
\b\['i]
1957 . char \[:i] _
\b\[:i]
1958 . char \[`o] _
\b\[`o]
1959 . char \[^o] _
\b\[^o]
1960 . char \['o] _
\b\['o]
1961 . char \[:o] _
\b\[:o]
1962 . char \[~o] _
\b\[~o]
1963 . char \[/o] _
\b\[/o]
1964 . char \[`u] _
\b\[`u]
1965 . char \[^u] _
\b\[^u]
1966 . char \['u] _
\b\['u]
1967 . char \[:u] _
\b\[:u]
1968 . char \[,c] _
\b\[,c]
1969 . char \[Sd] _
\b\[Sd]
1970 . char \[~n] _
\b\[~n]
1971 . char \[Tp] _
\b\[Tp]
1972 . char \['y] _
\b\['y]
1973 . char \[:y] _
\b\[:y]
1974 . char \[ss] _
\b\[ss]
1988 . nr #UNDERLINE_ON 0
1989 . 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 \
1990 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 \
1991 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1992 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1993 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1994 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1995 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1996 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1997 ' 1 2 3 4 5 6 7 8 9 0
2007 \# Underscores all letters, words, and digits in a passage,
2008 \# ignoring punctuation and spaces.
2010 \# Intended to be called with inline escapes \*[UL] (underline
2011 \# on) and \*[ULX] (underline off). Only works when the font family
2012 \# is fixed width, to simulate typewriter-style underlining of italic
2016 \c\R'#UNDERLINE_ON 1'
2043 . char \[`A] _
\b\[`A]
2044 . char \[^A] _
\b\[^A]
2045 . char \['A] _
\b\['A]
2046 . char \[:A] _
\b\[:A]
2047 . char \[oA] _
\b\[oA]
2048 . char \[~A] _
\b\[~A]
2049 . char \[AE] _
\b\[AE]
2050 . char \[`E] _
\b\[`E]
2051 . char \[^E] _
\b\[^E]
2052 . char \['E] _
\b\['E]
2053 . char \[:E] _
\b\[:E]
2054 . char \[`I] _
\b\[`I]
2055 . char \[^I] _
\b\[^I]
2056 . char \['I] _
\b\['I]
2057 . char \[:I] _
\b\[:I]
2058 . char \[`O] _
\b\[`O]
2059 . char \[^O] _
\b\[^O]
2060 . char \['O] _
\b\['O]
2061 . char \[:O] _
\b\[:O]
2062 . char \[~O] _
\b\[~O]
2063 . char \[/O] _
\b\[/O]
2064 . char \[`U] _
\b\[`U]
2065 . char \[^U] _
\b\[^U]
2066 . char \['U] _
\b\['U]
2067 . char \[:U] _
\b\[:U]
2068 . char \[,C] _
\b\[,C]
2069 . char \[-D] _
\b\[-D]
2070 . char \[~N] _
\b\[~N]
2071 . char \[TP] _
\b\[TP]
2072 . char \['Y] _
\b\['Y]
2073 . char \[:Y] _
\b\[:Y]
2100 . char \[`a] _
\b\[`a]
2101 . char \[^a] _
\b\[^a]
2102 . char \['a] _
\b\['a]
2103 . char \[:a] _
\b\[:a]
2104 . char \[oa] _
\b\[oa]
2105 . char \[~a] _
\b\[~a]
2106 . char \[ae] _
\b\[ae]
2107 . char \[`e] _
\b\[`e]
2108 . char \[^e] _
\b\[^e]
2109 . char \['e] _
\b\['e]
2110 . char \[:e] _
\b\[:e]
2111 . char \[`i] _
\b\[`i]
2112 . char \[^i] _
\b\[^i]
2113 . char \['i] _
\b\['i]
2114 . char \[:i] _
\b\[:i]
2115 . char \[`o] _
\b\[`o]
2116 . char \[^o] _
\b\[^o]
2117 . char \['o] _
\b\['o]
2118 . char \[:o] _
\b\[:o]
2119 . char \[~o] _
\b\[~o]
2120 . char \[/o] _
\b\[/o]
2121 . char \[`u] _
\b\[`u]
2122 . char \[^u] _
\b\[^u]
2123 . char \['u] _
\b\['u]
2124 . char \[:u] _
\b\[:u]
2125 . char \[,c] _
\b\[,c]
2126 . char \[Sd] _
\b\[Sd]
2127 . char \[~n] _
\b\[~n]
2128 . char \[Tp] _
\b\[Tp]
2129 . char \['y] _
\b\['y]
2130 . char \[:y] _
\b\[:y]
2131 . char \[ss] _
\b\[ss]
2147 \c\R'#UNDERLINE_ON 0'
2148 . 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 \
2149 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 \
2150 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
2151 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
2152 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
2153 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
2154 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
2155 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
2156 ' 1 2 3 4 5 6 7 8 9 0
2163 \# [<points below baseline>] "text"
2165 \# Places an underscore 2 points under the string if no lead given,
2166 \# otherwise places underscore under string by user specified amount.
2168 \# When using this macro, the string to be underscored must begin
2169 \# with double-quotes ("), regardless of whether it's the sole
2170 \# argument or the second.
2172 \# .UNDERSCORE "Text to be underscored
2174 \# .UNDERSCORE 2p "Text to be underscored
2176 \# All text is underscored (including punctuation and spaces).
2177 \# This is the primary difference between UNDERLINE and
2178 \# UNDERSCORE, aside from the fact the UNDERLINE only works with
2179 \# fixed width fonts.
2181 \# UNDERSCORE does not work across line breaks. Each line of
2182 \# text must be entered separately with UNDERSCORE. If the
2183 \# UNDERSCORE begins in the middle of a line and crosses over a
2184 \# break, the portion before the break must be entered in its own
2185 \# UNDERSCORE, as must the portion that comes after the break.
2188 . nr #SAVED_UNDERSCORE_WEIGHT \\n[#UNDERSCORE_WEIGHT]
2189 . nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ]
2190 . ds $SAVED_UNDERSCORE_GAP \\*[$UNDERSCORE_GAP]
2191 . if \\n[#FROM_BIB_STRING]=1 \{\
2192 . nr #UNDERSCORE_WEIGHT \\n[#BIB_STRING_UNDERLINE_WEIGHT]
2193 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#BIB_STRING_UNDERLINE_WEIGHT_ADJ]
2194 . ds $UNDERSCORE_GAP \\*[$BIB_STRING_UNDERLINE_GAP]
2196 . if \\n[#FROM_COVER]=1 \{\
2197 . nr #UNDERSCORE_WEIGHT \\n[#COVER_UNDERLINE_WEIGHT]
2198 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#COVER_UNDERLINE_WEIGHT_ADJ]
2199 . ds $UNDERSCORE_GAP \\*[$COVER_UNDERLINE_GAP]
2201 . if \\n[#FROM_DOC_COVER]=1 \{\
2202 . nr #UNDERSCORE_WEIGHT \\n[#DOCCOVER_UNDERLINE_WEIGHT]
2203 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#DOCCOVER_UNDERLINE_WEIGHT_ADJ]
2204 . ds $UNDERSCORE_GAP \\*[$DOCCOVER_UNDERLINE_GAP]
2206 . if \\n[#FROM_DOCTYPE]=1 \{\
2207 . nr #UNDERSCORE_WEIGHT \\n[#DOCTYPE_UNDERLINE_WEIGHT]
2208 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#DOCTYPE_UNDERLINE_WEIGHT_ADJ]
2209 . ds $UNDERSCORE_GAP \\*[$DOCTYPE_UNDERLINE_GAP]
2211 . if \\n[#FROM_HEAD]=1 \{\
2212 . nr #UNDERSCORE_WEIGHT \\n[#HEAD_UNDERLINE_WEIGHT]
2213 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#HEAD_UNDERLINE_WEIGHT_ADJ]
2214 . ds $UNDERSCORE_GAP \\*[$HEAD_UNDERLINE_GAP]
2216 . if \\n[#FROM_EN_STRING]=1 \{\
2217 . nr #UNDERSCORE_WEIGHT \\n[#EN_STRING_UNDERLINE_WEIGHT]
2218 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT_ADJ]
2219 . ds $UNDERSCORE_GAP \\*[$EN_STRING_UNDERLINE_GAP]
2221 . if \\n[#FROM_EN_TITLE]=1 \{\
2222 . nr #UNDERSCORE_WEIGHT \\n[#EN_TITLE_UNDERLINE_WEIGHT]
2223 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_TITLE_UNDERLINE_WEIGHT_ADJ]
2224 . ds $UNDERSCORE_GAP \\*[$EN_TITLE_UNDERLINE_GAP]
2226 . ie \\n[#NUM_ARGS]=1 \{\
2227 . nr #TEXT_WIDTH \w'\\$1'
2229 \D't \\n[#UNDERSCORE_WEIGHT]'\
2230 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2231 \v'+(\\*[$UNDERSCORE_GAP])+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2232 \D'l \\n[#TEXT_WIDTH]u 0'\
2233 \D't \\n[#RULE_WEIGHT]'\
2234 \h'-\\n[#RULE_WEIGHT]u'\
2235 \v'-(\\*[$UNDERSCORE_GAP])-\\n[#UNDERSCORE_WEIGHT_ADJ]u'
2238 . nr #TEXT_WIDTH \w'\\$2'
2240 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2241 \v'+(\\$1)+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2242 \D't \\n[#UNDERSCORE_WEIGHT]'\
2243 \D'l \\n[#TEXT_WIDTH]u 0'\
2244 \D't \\n[#RULE_WEIGHT]'\
2245 \h'-\\n[#RULE_WEIGHT]u'\
2246 \v'-(\\$1)-\\n[#UNDERSCORE_WEIGHT_ADJ]u'
2248 . nr #UNDERSCORE_WEIGHT \\n[#SAVED_UNDERSCORE_WEIGHT]
2249 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ]
2250 . ds $UNDERSCORE_GAP \\*[$SAVED_UNDERSCORE_GAP]
2251 . rr #SAVED_UNDERSCORE_WEIGHT
2252 . rr #SAVED_UNDERSCORE_WEIGHT_ADJ
2253 . rm $SAVED_UNDERSCORE_GAP
2257 \# DOUBLE UNDERSCORE
2258 \# -----------------
2260 \# [points below baseline] [points distance between rules] "text"
2262 \# Same as UNDERSCORE, except it produces a double underscore. The default
2263 \# distance between the rules is 2 points.
2265 \# The same double-quote requirement as UNDERSCORE.
2268 .MAC UNDERSCORE2 END
2269 . nr #SAVED_UNDERSCORE_WEIGHT \\n[#UNDERSCORE_WEIGHT]
2270 . nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ]
2271 . ds $SAVED_UNDERSCORE_GAP \\*[$UNDERSCORE_GAP]
2272 . ds $SAVED_RULE_GAP \\*[$RULE_GAP]
2273 . if \\n[#NUM_ARGS]=2 \{\
2274 . ds $UNDERSCORE_GAP \\$1
2276 . if \\n[#NUM_ARGS]=3 \{\
2277 . ds $UNDERSCORE_GAP \\$1
2280 . if \\n[#FROM_BIB_STRING] \{\
2281 . nr #UNDERSCORE_WEIGHT \\n[#BIB_STRING_UNDERLINE_WEIGHT]
2282 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#BIB_STRING_UNDERLINE_WEIGHT_ADJ]
2283 . ds $UNDERSCORE_GAP \\*[$BIB_STRING_UNDERLINE_GAP]
2284 . ds $RULE_GAP \\*[$BIB_STRING_RULE_GAP]
2286 . if \\n[#FROM_EN_STRING] \{\
2287 . nr #UNDERSCORE_WEIGHT \\n[#EN_STRING_UNDERLINE_WEIGHT]
2288 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT_ADJ]
2289 . ds $UNDERSCORE_GAP \\*[$EN_STRING_UNDERLINE_GAP]
2290 . ds $RULE_GAP \\*[$EN_STRING_RULE_GAP]
2292 . if \\n[#NUM_ARGS]=1 \{\
2293 . nr #TEXT_WIDTH \w'\\$1'
2295 \D't \\n[#UNDERSCORE_WEIGHT]'\
2296 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2297 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2298 \D'l \\n[#TEXT_WIDTH]u 0'\
2299 \v'+\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\
2300 \h'-\\n[#TEXT_WIDTH]u'\
2301 \D'l \\n[#TEXT_WIDTH]u 0'\
2302 \D't \\n[#RULE_WEIGHT]'\
2303 \h'-\\n[#RULE_WEIGHT]u'\
2304 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2306 . if \\n[#NUM_ARGS]=2 \{\
2307 . nr #TEXT_WIDTH \w'\\$2'
2309 \D't \\n[#UNDERSCORE_WEIGHT]'\
2310 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2311 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2312 \D'l \\n[#TEXT_WIDTH]u 0'\
2313 \v'+(\\*[$RULE_GAP])+\\n[#UNDERSCORE_WEIGHT]u'\
2314 \h'-\\n[#TEXT_WIDTH]u'\
2315 \D'l \\n[#TEXT_WIDTH]u 0'\
2316 \D't \\n[#RULE_WEIGHT]'\
2317 \h'-\\n[#RULE_WEIGHT]u'\
2318 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])+(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2320 . if \\n[#NUM_ARGS]=3 \{\
2321 . nr #TEXT_WIDTH \w'\\$3'
2323 \D't \\n[#UNDERSCORE_WEIGHT]'\
2324 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2325 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2326 \D'l \\n[#TEXT_WIDTH]u 0'\
2327 \v'+\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\
2328 \h'-\\n[#TEXT_WIDTH]u'\
2329 \D'l \\n[#TEXT_WIDTH]u 0'\
2330 \D't \\n[#RULE_WEIGHT]'\
2331 \h'-\\n[#RULE_WEIGHT]u'\
2332 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2334 . nr #UNDERSCORE_WEIGHT \\n[#SAVED_UNDERSCORE_WEIGHT]
2335 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ]
2336 . ds $UNDERSCORE_GAP \\*[$SAVED_UNDERSCORE_GAP]
2337 . rr #SAVED_UNDERSCORE_WEIGHT
2338 . rr #SAVED_UNDERSCORE_WEIGHT_ADJ
2339 . rm $SAVED_UNDERSCORE_GAP
2340 . rm $SAVED_RULE_GAP
2343 \# Default underscoring rule gaps
2345 .ds $BIB_STRING_UNDERLINE_GAP 2p
2346 .ds $BIB_STRING_RULE_GAP 2p
2347 .ds $COVER_UNDERLINE_GAP 2p
2348 .ds $DOCCOVER_UNDERLINE_GAP 2p
2349 .ds $DOCTYPE_UNDERLINE_GAP 2p
2350 .ds $EN_STRING_UNDERLINE_GAP 2p
2351 .ds $EN_STRING_RULE_GAP 2p
2352 .ds $EN_TITLE_UNDERLINE_GAP 2p
2353 .ds $HEAD_UNDERLINE_GAP 2p
2355 .ds $UNDERSCORE_GAP 2p
2358 \# SUPERSCRIPT INLINES
2359 \# -------------------
2361 \# Prints everything after invocation as superscript.
2363 \# \*[SUP] and \*[SUPX] turn superscript on and off respectively.
2364 \# If running type is pseudo-condensed/expanded, invoke the superscript
2365 \# strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
2366 \# and \*[EXTSUPX] respectively.
2369 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2370 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2371 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.26m'\s[\En[#SUP_PT_SIZE]u]
2373 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.26m'
2376 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2377 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2378 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
2380 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
2383 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2384 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2385 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
2387 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
2396 \# <number of degrees> | RESET
2398 \# Modifies register #DEGREES for use with \*[SLANT], or resets
2399 \# it to the default. Defines string \*[SLANTX]
2401 \# \*[SLANT] permits pseudo-italicizing of a font in cases where
2402 \# no italic font exists in a particular family.
2404 \# Default # of degrees is 15.
2406 \# Do not use unit of measure with arg to SETSLANT.
2408 \# It may be necessary to adjust the spacing on either side of
2409 \# [SLANT] and [SLANTX].
2411 \# In docs, SLANT carries over from para to para.
2414 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2415 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2418 . ie '\\$1'RESET' \{\
2420 . if \\n[#PRINT_STYLE]=1 \{\
2421 . if \\n[#UNDERLINE_SLANT] \{ .return \}
2423 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2427 . if \\n[#PRINT_STYLE]=1 \{\
2428 . if \\n[#UNDERLINE_SLANT] \{ .return \}
2430 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2432 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2442 \# <amount of emboldening> | RESET
2444 \# Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
2445 \# it to the default 700 units.
2447 \# \*[BOLDER] allows pseudo-emboldening of a font where no bold
2448 \# font exists in a particular family.
2450 \# Default for SETBOLDER is 700 units. Do not use unit of measure
2451 \# with arg to SETBOLDER.
2453 .nr #BOLDER_UNITS 700
2456 . if \\n[#IGNORE]=1 \{ .return \}
2457 . ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
2458 . el \{ .nr #BOLDER_UNITS \\$1 \}
2464 .bd \\n(.f \\n[#BOLDER_UNITS]
2473 \# +++CONDENSE/EXTEND+++
2478 \# <percentage to condense/expand type size>
2480 \# Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
2481 \# new point size (for character width) from arg, and defines string
2482 \# COND or EXT, which set the type size to the new character width,
2483 \# and sets the height of type to the value stored in CURRENT_PT_SIZE
2485 \# CONDENSE_OR_EXTEND is invoked from the aliases
2486 \# CONDENSE and EXTEND. CONDENSE implies <100, EXTEND
2487 \# implies >100. Do not use a percent sign in the argument.
2489 \# There is no default setting for CONDENSE or EXTEND.
2490 \# 80 is a good approximation of condensed type, 120 is okay
2493 \# The value set by CONDENSE or EXTEND applies to all
2494 \# subsequent \*[COND] or \*[EXT] escapes until a new value is set.
2496 \# \*[COND] or \*[EXT] must be turned off before all changes of point
2497 \# size and reinvoked afterwards (if so desired). This refers to
2498 \# changes of point size via control lines AND with via inlines.
2500 .MAC CONDENSE_OR_EXTEND END
2501 . if '\\$0'CONDENSE' \{\
2502 . ds $COND_PERCENT \\$1
2503 . if \\n[#PRINT_STYLE]=1 \{\
2505 . ds $COND_PERCENT 100
2508 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2510 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2511 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2513 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2514 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2516 . if '\\$0'EXTEND' \{\
2517 . ds $EXT_PERCENT \\$1
2518 . if \\n[#PRINT_STYLE]=1 \{\
2520 . ds $EXT_PERCENT 100
2523 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2525 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2526 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2528 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2529 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2533 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2534 .ds EXTX \ER'#EXTEND 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2537 \# +++PAD LINES+++ (insert space)
2542 \# <character to use for marking pad points>
2544 \# Defines string $PAD_MARKER, used in PAD
2546 \# $PAD_MARKER is normally # (the pound sign).
2549 . ds $PAD_MARKER \\$1
2556 \# "<string of text with padding markers inserted>"
2558 \# Defines and redefines padding character (default=pound sign
2559 \# unless padding character has been set with PAD_MARKER)
2560 \# several times so that when the string is output at the end
2561 \# of the macro, every # has been converted to an equal-sized
2562 \# amount of padding (blank space) on a line. # is equivalent to
2563 \# CompuGraphic's old <IS>.
2565 \# String tabs may be marked off during PAD.
2568 . if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2570 . if !d$PAD_MARKER .ds $PAD_MARKER #
2571 . char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2572 . ds $FAMILY_FOR_PAD \\n[.fam]
2573 . fp \\n[.fp] \\n[.sty]
2574 . ds $FONT_FOR_PAD \\*[$FONT]
2575 . nr #SIZE_FOR_PAD \\n[.ps]
2576 . ds $PAD_STRING \\$1
2577 . as $PAD_STRING \Ekp
2579 . fam \\*[$FAMILY_FOR_PAD]
2580 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2583 . char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2585 . fam \\*[$FAMILY_FOR_PAD]
2586 \\f]\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2589 . char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2590 . ie \\n[#SILENT] \{\
2592 . fam \\*[$FAMILY_FOR_PAD]
2593 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2598 . fam \\*[$FAMILY_FOR_PAD]
2599 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2602 . if \\n[#FILL_MODE]=1 \{\
2612 . if '\\$2'NOBREAK' \{\
2622 \# The leader mechanism is primitive, but it works. Basically, every
2623 \# macro in this set that includes a line length also sets a single
2624 \# groff tab stop at the right hand end of the line. That way,
2625 \# whenever Ctrl-A is invoked (always at the end of an input line),
2626 \# leader of the correct length gets deposited. Ctrl-A is accessed by
2627 \# the string LEADER (i.e. inline, as \*[LEADER]). Leaders within tabs
2628 \# get their length from the tab line length.
2630 \# SET LEADER CHARACTER
2631 \# --------------------
2633 \# <character to use whenever \*[LEADER] is invoked>
2635 \# Set leader character.
2637 .MAC LEADER_CHARACTER END
2648 \# <family of drop cap>
2650 \# Creates or modifies string $DC_FAM.
2652 .MAC DROPCAP_FAMILY END
2660 \# <font of drop cap>
2662 \# Creates or modifies string $DC_FT.
2664 .MAC DROPCAP_FONT END
2672 \# <pre-defined XCOLOR or NEWCOLOR>
2674 \# Defines string $DC_COLOR to argument.
2676 \# User must define an XCOLOR or NEWCOLOR before using
2679 .MAC DROPCAP_COLOR END
2680 . if \\n[#PRINT_STYLE]=1 \{ .return \}
2689 \# <width of gutter between drop cap and indented text>
2691 \# Creates or modifies register #DC_GUT.
2693 \# Requires unit of measure. Default is 3p.
2695 .MAC DROPCAP_GUTTER END
2703 \# <+|- # of points to in/decrease point size of drop cap letter>
2705 \# Creates or modifies string $DC_ADJUST.
2707 \# Despite its best efforts, DROPCAP doesn't always get the point
2708 \# size of the drop cap critically perfect. DROPCAP_ADJUST lets
2709 \# the user add or subtract points (or fractions of points) to
2710 \# get the size right.
2712 \# Requires the + or - sign.
2714 .MAC DROPCAP_ADJUST END
2715 . ds $DC_ADJUST \\$1
2722 \# <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2724 \# Calculates point size of dropcap based on # of lines passed as
2725 \# arg 2. Sets indent for text based on dropcap width+gutter.
2726 \# Advances and prints dropcap; reverses and prints indented text
2727 \# to bottom of dropcap, then resets indent to left margin (plus
2728 \# any indent that was in effect prior to invoking DROPCAP).
2730 \# Drop caps put a strain on on resource-challenged systems.
2732 \# Drop caps when using the doc processing macro PP only work with
2733 \# initial paragraphs (i.e. at doc start, or after heads), only when
2734 \# DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2735 \# is TYPESET. If these conditions aren't met, DROPCAPS is silently
2738 \# The COND or EXT argument are processed separately from all
2739 \# other COND or EXT inlines or macros, hence passing COND or
2740 \# EXT has no effect on running type.
2743 . if \\n[#IGNORE]=1 \{\
2753 . if \\n[#PRINT_STYLE]=1 \{\
2757 . if \\n[#PRINT_STYLE]=2 \{\
2758 . if \\n[#PP_STYLE]=2 \{\
2770 . nr #DC_LINES \\$2-1
2771 . if \\n[#CONDENSE]=1 \{\
2772 . ds $RESTORE_COND \\*[$COND_PERCENT]
2774 . nr #CONDENSE_WAS_ON 1
2776 . if \\n[#EXTEND]=1 \{\
2777 . ds $RESTORE_EXT \\*[$EXT_PERCENT]
2779 . nr #EXTEND_WAS_ON 1
2781 . if '\\$3'COND' \{ .CONDENSE \\$4 \}
2782 . if '\\$3'EXT' \{ .EXTEND \\$4 \}
2783 . if !r#DC_GUT \{ .nr #DC_GUT (3p) \}
2784 . ds $RESTORE_FAM \\n[.fam]
2785 . ds $RESTORE_FT \\*[$FONT]
2786 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2787 . nr #RESTORE_INDENT \\n(.i
2789 . nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2790 . ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2791 . el \{ .FAM \\*[$DC_FAM] \}
2792 . ie !d$DC_FT \{ .FT \\*[$FONT] \}
2793 . el \{ .FT \\*[$DC_FT] \}
2794 . while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2795 . ps \\n[#PT_SIZE]u+100u
2797 . nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2799 . if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2801 . sp \\n[#DC_LINES]v
2802 . if \\n[#DOCS]=1 \{ .SHIM \}
2803 . ie \\n[#DC_COLOR]=1 \{\
2805 . ie '\\$3'COND' \{ .PRINT \m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[] \}
2806 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[] \}
2808 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2812 . ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2813 . el \{ .PRINT \\*[EXT]\\*[$DROPCAP]\\*[EXTX] \}
2815 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2817 . if '\\$3'COND' \{ \E*[COND] \}
2818 . if '\\$3'EXT' \{ \E*[EXT] \}
2819 . ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2820 . el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2821 . if '\\$3'COND' \{ \E*[CONDX]\c \}
2822 . if '\\$3'EXT' \{ \E*[EXTX]\c \}
2824 . FAM \\*[$RESTORE_FAM]
2825 . FT \\*[$RESTORE_FT]
2826 . ps \\n[#RESTORE_PT_SIZE]u
2827 . if \\n[#CONDENSE_WAS_ON] \{\
2828 . CONDENSE \\*[$RESTORE_COND]
2831 . if \\n[#EXTEND_WAS_ON] \{\
2832 . EXTEND \\*[$RESTORE_EXT]
2835 . ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2836 . el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2837 . rr #CONDENSE_WAS_ON
2845 . rr #RESTORE_PT_SIZE
2846 . rr #RESTORE_INDENT
2852 .MAC DROPCAP_OFF END
2853 ' in \\n[#RESTORE_INDENT]u
2856 \# =====================================================================
2858 \# +++GRAPHICAL OBJECTS+++
2860 \# HORIZONTAL RULE - DRH
2861 \# ---------------------
2863 \# <none> | <rule weight> <indent> <length> [ <color> ]
2865 \# With no arg, draws a full measure rule. With args, draws
2866 \# described horizontal rule.
2868 \# Rules are drawn left-to-right, from the baseline down, and
2869 \# return to their point of origin. Color must be set in the
2870 \# macro; otherwise the color will be black, regardless of current
2871 \# .gcolor. If no arg given, the rule weight is the one set by
2875 . if \\n[.vpt]=1 \{\
2877 . nr #RESTORE_TRAP 1
2879 . ie !\\n[#NO_ADVANCE]=1 \{ .br \}
2886 . nr #FILL_MODE \\n(.j
2890 . if \\n[.ce]>0 \{ .nr #NOFILL_MODE 3 \}
2891 . if \\n[.rj]>0 \{ .nr #NOFILL_MODE 5 \}
2896 . ds $RL_WEIGHT \\$1
2897 . ds $RL_INDENT \\$2
2898 . ds $RL_LENGTH \\$3
2903 . ds $RL_COLOR default
2905 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
2906 . nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
2908 . if \\n[#NUM_ARGS]>=1 \{ .RULE_WEIGHT \\*[$RL_WEIGHT] \}
2910 . gcolor \\*[$RL_COLOR]
2911 . ie \\n[#NUM_ARGS]=0 \{\
2912 . ie \\n[#INDENT_ACTIVE] \{\
2913 . nr #RESTORE_L_LENGTH \\n(.l
2914 . if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2915 . if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2916 \D't \\n[#RULE_WEIGHT]'\
2917 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2918 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2919 \D'l \En(.lu 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\
2920 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2921 \D't \\n[#SAVED_RULE_WEIGHT]'
2922 . ll \\n[#RESTORE_L_LENGTH]u
2923 . rr #RESTORE_L_LENGTH
2926 \D't \\n[#RULE_WEIGHT]'\
2927 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2928 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2929 \D'l \En(.lu 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\
2930 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2931 \D't \\n[#SAVED_RULE_WEIGHT]'
2935 \D't \\n[#RULE_WEIGHT]'\
2936 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2937 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2938 \D'l \\*[$RL_LENGTH] 0'\
2939 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2940 \D't \\n[#SAVED_RULE_WEIGHT]'
2942 . if \\n[#FILLED]=1 \{\
2943 . if \\n[#FILL_MODE]=0 \{ .QUAD LEFT \}
2944 . if \\n[#FILL_MODE]=1 \{ .JUSTIFY \}
2945 . if \\n[#FILL_MODE]=3 \{ .QUAD CENTER \}
2946 . if \\n[#FILL_MODE]=5 \{ .QUAD RIGHT \}
2950 . if \\n[#NOFILL]=1 \{\
2951 . if \\n[#NOFILL_MODE]=3 \{ .CENTER \}
2952 . if \\n[#NOFILL_MODE]=5 \{ .RIGHT \}
2955 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
2956 . nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
2958 . rr #SAVED_WEIGHT_ADJ
2959 . if \\n[#RESTORE_TRAP]=1 \{\
2971 \# Draws a rule the length of the current measure.
2973 \# A convenience macro. DRV does the same thing. Kept in for
2974 \# backward compatibility.
2979 . ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2982 . ie \\n[#INDENT_ACTIVE] \{\
2983 . if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2984 . if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2985 . PRINT \D't \\n[#RULE_WEIGHT]'\v'\\n[#RULE_WEIGHT_ADJ]u'\D'l \En(.lu 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\h'|0'\c
2987 . rr #RESTORE_L_LENGTH
2990 . PRINT \D't \\n[#RULE_WEIGHT]'\v'\\n[#RULE_WEIGHT_ADJ]u'\D'l \En(.lu 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\h'|0'\c
2995 . QUAD \\*[$CURRENT_QUAD]
3002 \# VERTICAL RULE - DRV
3003 \# -------------------
3005 \# <rule weight> <indent> <depth> [ <color> ]
3007 \# Draws described vertical rule.
3009 \# Rules are drawn left-to-right, from the baseline down, and
3010 \# return to their point of origin. Color must be set in the
3011 \# macro; otherwise the color will be black, regardless of current
3015 . if \\n[.vpt]=1 \{\
3017 . nr #RESTORE_TRAP 1
3019 . ie !\\n[#NO_ADVANCE]=1 \{ .br \}
3026 . nr #FILL_MODE \\n(.j
3030 . if \\n[.ce]>0 \{ .nr #NOFILL_MODE 3 \}
3031 . if \\n[.rj]>0 \{ .nr #NOFILL_MODE 5 \}
3036 . ds $RL_WEIGHT \\$1
3037 . ds $RL_INDENT \\$2
3043 . ds $RL_COLOR default
3045 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
3046 . nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
3048 . RULE_WEIGHT \\*[$RL_WEIGHT]
3050 . gcolor \\*[$RL_COLOR]
3051 \D't \\n[#RULE_WEIGHT]'\
3052 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT_ADJ]u'\
3053 \D'l 0 \\*[$RL_DEPTH]'\
3054 \D't \\n[#SAVED_RULE_WEIGHT]'
3055 . if \\n[#FILLED]=1 \{\
3056 . if \\n[#FILL_MODE]=0 \{ .QUAD LEFT \}
3057 . if \\n[#FILL_MODE]=1 \{ .JUSTIFY \}
3058 . if \\n[#FILL_MODE]=3 \{ .QUAD CENTER \}
3059 . if \\n[#FILL_MODE]=5 \{ .QUAD RIGHT \}
3063 . if \\n[#NOFILL]=1 \{\
3064 . if \\n[#NOFILL_MODE]=3 \{ .CENTER \}
3065 . if \\n[#NOFILL_MODE]=5 \{ .RIGHT \}
3068 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
3069 . nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
3070 . if \\n[#RESTORE_TRAP]=1 \{\
3079 \# <rule weight | SOLID> <indent> <length> <depth> [ <color> ]
3081 \# Draws described box.
3083 \# Boxes are drawn left-to-right, from the baseline down, and
3084 \# return to their point of origin. Box rules are drawn from the
3085 \# perimeter inwards. Color must be set in the macro; otherwise
3086 \# the color will be black, regardless of current .gcolor. If no
3087 \# arg given, the rule weight is the one set by RULE_WEIGHT.
3090 . if \\n[.vpt]=1 \{\
3092 . nr #RESTORE_TRAP 1
3094 . ie !\\n[#NO_ADVANCE]=1 \{ .br \}
3101 . nr #FILL_MODE \\n(.j
3105 . if \\n[.ce]>0 \{ .nr #NOFILL_MODE 3 \}
3106 . if \\n[.rj]>0 \{ .nr #NOFILL_MODE 5 \}
3111 . ie '\\$1'SOLID' \{\
3115 . ds $BX_WEIGHT \\$1
3117 . ds $BX_INDENT \\$2
3121 . ie d$\\$5_FILL \{\
3122 . ds $BX_COLOR \\*[$\\$5_FILL]
3129 . ds $BX_COLOR default
3131 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
3132 . nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3133 . if !'\\$1'SOLID' \{\
3135 . RULE_WEIGHT \\*[$BX_WEIGHT]
3138 . ds $BX_INDENT \\*[$BX_INDENT]-\\n[#WEIGHT_ADJ]u
3139 . ie \\n[#BX_SOLID]=1 \{\
3140 . fcolor \\*[$BX_COLOR]
3141 \h'\\*[$BX_INDENT]'\
3142 \D'P \\*[$BX_WIDTH] 0 0 \\*[$BX_DEPTH] -\\*[$BX_WIDTH] 0 0 -\\*[$BX_DEPTH]'
3147 . gcolor \\*[$BX_COLOR]
3148 \D't \\n[#RULE_WEIGHT]'\
3149 \h'\\*[$BX_INDENT]'\
3150 \v'\\n[#WEIGHT_ADJ]u'\
3151 \D'p \\*[$BX_WIDTH]-\\n[#RULE_WEIGHT]u 0 0 \\*[$BX_DEPTH]-\\n[#RULE_WEIGHT]u -\\*[$BX_WIDTH]+\\n[#RULE_WEIGHT]u 0 0 -\\*[$BX_DEPTH]+\\n[#RULE_WEIGHT]u'\
3152 \v'-\\n[#WEIGHT_ADJ]u'\
3153 \D't \\n[#SAVED_RULE_WEIGHT]'
3157 . if \\n[#FILLED]=1 \{\
3158 . if \\n[#FILL_MODE]=0 \{ .QUAD LEFT \}
3159 . if \\n[#FILL_MODE]=1 \{ .JUSTIFY \}
3160 . if \\n[#FILL_MODE]=3 \{ .QUAD CENTER \}
3161 . if \\n[#FILL_MODE]=5 \{ .QUAD RIGHT \}
3164 . if \\n[#NOFILL]=1 \{\
3165 . if \\n[#NOFILL_MODE]=3 \{ .CENTER \}
3166 . if \\n[#NOFILL_MODE]=5 \{ .RIGHT \}
3168 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
3169 . nr #WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
3171 . rr #SAVED_WEIGHT_ADJ
3172 . if \\n[#RESTORE_TRAP]=1 \{\
3182 \# <rule weight | SOLID> <indent> <width> <depth> [ <color> ]
3184 \# Draws described ellipses.
3186 \# Ellipses (circles) are drawn left-to-right, from the baseline
3187 \# down, and return to their point of origin. Ellipse rules are
3188 \# drawn from the perimeter inwards. Color must be set in the
3189 \# macro; otherwise the color will be black, regardless of current
3190 \# .gcolor. If no arg given, the rule weight is the one set by
3194 . if \\n[.vpt]=1 \{\
3196 . nr #RESTORE_TRAP 1
3198 . ie !\\n[#NO_ADVANCE]=1 \{ .br \}
3205 . nr #FILL_MODE \\n(.j
3209 . if \\n[.ce]>0 \{ .nr #NOFILL_MODE 3 \}
3210 . if \\n[.rj]>0 \{ .nr #NOFILL_MODE 5 \}
3215 . ie '\\$1'SOLID' \{\
3219 . ds $CL_WEIGHT \\$1
3221 . ds $CL_INDENT \\$2
3225 . ie d$\\$5_FILL \{\
3226 . ds $CL_COLOR \\*[$\\$5_FILL]
3233 . ds $CL_COLOR default
3235 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
3236 . nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3237 . if !'\\$1'SOLID' \{\
3239 . RULE_WEIGHT \\*[$CL_WEIGHT]
3242 . ds $CL_INDENT \\*[$CL_INDENT]-\\n[#WEIGHT_ADJ]u
3243 . ie \\n[#CL_SOLID]=1 \{\
3244 . fcolor \\*[$CL_COLOR]
3245 \h'\\*[$CL_INDENT]'\
3246 \v'\\*[$CL_DEPTH]/2u'\
3247 \D'E \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\
3248 \v'-\\*[$CL_DEPTH]/2u'
3253 . gcolor \\*[$CL_COLOR]
3254 \D't \\n[#RULE_WEIGHT]'\
3255 \h'\\*[$CL_INDENT]'\
3256 \v'\\*[$CL_DEPTH]/2u'\
3257 \D'e \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\
3258 \v'-(\\*[$CL_DEPTH]/2u)'\
3259 \D't \\n[#SAVED_RULE_WEIGHT]'
3263 . if \\n[#FILLED]=1 \{\
3264 . if \\n[#FILL_MODE]=0 \{ .QUAD LEFT \}
3265 . if \\n[#FILL_MODE]=1 \{ .JUSTIFY \}
3266 . if \\n[#FILL_MODE]=3 \{ .QUAD CENTER \}
3267 . if \\n[#FILL_MODE]=5 \{ .QUAD RIGHT \}
3270 . if \\n[#NOFILL]=1 \{\
3271 . if \\n[#NOFILL_MODE]=3 \{ .CENTER \}
3272 . if \\n[#NOFILL_MODE]=5 \{ .RIGHT \}
3274 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
3275 . nr #WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
3277 . rr #SAVED_WEIGHT_ADJ
3278 . if \\n[#RESTORE_TRAP]=1 \{\
3288 \# <weight of rules in points>
3290 \# Sets \D't <n>' to the correct number of machine units for the
3291 \# argument given in points.
3293 \# Decimal fractions are allowed. Rule weight must be > 100.
3295 .MAC RULE_WEIGHT END
3296 . di NULL \" Diverted so there's no problem with breaks, spacing, etc.
3299 . if !\B'\\*[$ARG]' \{\
3300 . tm1 "[mom]: The argument to \\$0 must not have a unit of measure appended.
3301 . ab Aborting at \\$0, line \\n[.c].
3303 . length #STR_LENGTH \\$1
3305 . substring $ARG 0 0
3306 . ie '\\*[$ARG]'.' \{\
3308 . substring $ARG 1 \\n[#STR_LENGTH]-1
3309 . nr #WEIGHT \\*[$ARG]*100
3310 . if (\\n[#WEIGHT]>=1000) \{\
3311 . while (\\n[#WEIGHT]>=1000) \{\
3312 . nr #WEIGHT \\n[#WEIGHT]/10
3318 . substring $ARG 1 1
3319 . ie '\\*[$ARG]'.' \{\
3321 . substring $LHS 0 0
3324 . nr #WEIGHT \\*[$LHS]\\*[$RHS]*100
3325 . if (\\n[#WEIGHT]>=10000) \{\
3326 . while (\\n[#WEIGHT]>=10000) \{\
3327 . nr #WEIGHT \\n[#WEIGHT]/10
3332 . ie \\n[#STR_LENGTH]<=2 \{\
3333 . nr #WEIGHT \\$1*1000
3337 . substring $ARG 2 2
3338 . ie !'\\*[$ARG]'.' \{\
3339 . tm1 "[mom]: Invalid argument given to macro \\$0 at line \\n[.c].
3340 . tm1 " Rule weight must be > 100 points.
3341 . tm1 " Falling back to default weight .5 points.
3346 . substring $LHS 0 1
3349 . nr #WEIGHT \\*[$LHS]\\*[$RHS]*1000
3350 . if (\\n[#WEIGHT]>=100000) \{\
3351 . while (\\n[#WEIGHT]>=100000) \{\
3352 . nr #WEIGHT \\n[#WEIGHT]/10
3359 . nr #WEIGHT_ADJ \\n[#WEIGHT]/2
3360 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT' \{\
3361 . nr #BIB_STRING_UNDERLINE_WEIGHT \\n[#WEIGHT]
3362 . nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3364 . if '\\$0'COVER_UNDERLINE_WEIGHT' \{\
3365 . nr #COVER_UNDERLINE_WEIGHT \\n[#WEIGHT]
3366 . nr #COVER_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3368 . if '\\$0'DOCCOVER_UNDERLINE_WEIGHT' \{\
3369 . nr #DOCCOVER_UNDERLINE_WEIGHT \\n[#WEIGHT]
3370 . nr #DOCCOVER_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3372 . if '\\$0'DOCTYPE_UNDERLINE_WEIGHT' \{\
3373 . nr #DOCTYPE_UNDERLINE_WEIGHT \\n[#WEIGHT]
3374 . nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3376 . if '\\$0'ENDNOTE_STRING_UNDERLINE_WEIGHT' \{\
3377 . nr #EN_STRING_UNDERLINE_WEIGHT \\n[#WEIGHT]
3378 . nr #EN_STRING_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3380 . if '\\$0'ENDNOTE_TITLE_UNDERLINE_WEIGHT' \{\
3381 . nr #EN_TITLE_UNDERLINE_WEIGHT \\n[#WEIGHT]
3382 . nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3384 . if '\\$0'FOOTER_RULE_WEIGHT' \{\
3385 . nr #FOOTER_RULE_WEIGHT \\n[#WEIGHT]
3386 . nr #FOOTER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3388 . if '\\$0'FOOTNOTE_RULE_WEIGHT' \{\
3389 . nr #FN_RULE_WEIGHT \\n[#WEIGHT]
3390 . nr #FN_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3392 . if '\\$0'HEAD_UNDERLINE_WEIGHT' \{\
3393 . nr #HEAD_UNDERLINE_WEIGHT \\n[#WEIGHT]
3394 . nr #HEAD_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3396 . if '\\$0'HEADER_RULE_WEIGHT' \{\
3397 . nr #HEADER_RULE_WEIGHT \\n[#WEIGHT]
3398 . nr #HEADER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3400 . if '\\$0'RULE_WEIGHT' \{\
3401 . nr #RULE_WEIGHT \\n[#WEIGHT]
3402 . nr #RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3404 . if '\\$0'UNDERSCORE_WEIGHT' \{\
3405 . nr #UNDERSCORE_WEIGHT \\n[#WEIGHT]
3406 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3413 .ALIAS BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT RULE_WEIGHT
3414 .ALIAS COVER_UNDERLINE_WEIGHT RULE_WEIGHT
3415 .ALIAS DOCCOVER_UNDERLINE_WEIGHT RULE_WEIGHT
3416 .ALIAS DOCTYPE_UNDERLINE_WEIGHT RULE_WEIGHT
3417 .ALIAS ENDNOTE_STRING_UNDERLINE_WEIGHT RULE_WEIGHT
3418 .ALIAS ENDNOTE_TITLE_UNDERLINE_WEIGHT RULE_WEIGHT
3419 .ALIAS FOOTER_RULE_WEIGHT RULE_WEIGHT
3420 .ALIAS FOOTNOTE_RULE_WEIGHT RULE_WEIGHT
3421 .ALIAS HEAD_UNDERLINE_WEIGHT RULE_WEIGHT
3422 .ALIAS HEADER_RULE_WEIGHT RULE_WEIGHT
3423 .ALIAS UNDERSCORE_WEIGHT RULE_WEIGHT
3425 \# Default rule weights
3426 \# ~~~~~~~~~~~~~~~~~~~~
3427 .nr #BIB_STRING_UNDERLINE_WEIGHT 500
3428 .nr #COVER_UNDERLINE_WEIGHT 500
3429 .nr #DOCCOVER_UNDERLINE_WEIGHT 500
3430 .nr #DOCTYPE_UNDERLINE_WEIGHT 500
3431 .nr #EN_STRING_UNDERLINE_WEIGHT 500
3432 .nr #EN_TITLE_UNDERLINE_WEIGHT 500
3433 .nr #FN_RULE_WEIGHT 500
3434 .nr #FOOTER_RULE_WEIGHT 500
3435 .nr #HEAD_UNDERLINE_WEIGHT 500
3436 .nr #HEADER_RULE_WEIGHT 500
3437 .nr #RULE_WEIGHT 500
3438 .nr #UNDERSCORE_WEIGHT 500
3440 .nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \\n[#BIB_STRING_UNDERLINE_WEIGHT]/2
3441 .nr #COVER_UNDERLINE_WEIGHT_ADJ \\n[#DOCTYPE_UNDERLINE_WEIGHT]/2
3442 .nr #DOCCOVER_UNDERLINE_WEIGHT_ADJ \\n[#DOCTYPE_RULE_WEIGHT]/2
3443 .nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ \\n[#DOCTYPE_RULE_WEIGHT]/2
3444 .nr #EN_STRING_UNDERLINE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT]/2
3445 .nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT]/2
3446 .nr #FOOTER_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT]/2
3447 .nr #FN_RULE_WEIGHT_ADJ \\n[#FN_RULE_WEIGHT]/2
3448 .nr #HEAD_UNDERLINE_WEIGHT_ADJ \\n[#HEAD_UNDERLINE_WEIGHT]/2
3449 .nr #HEADER_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT]/2
3450 .nr #RULE_WEIGHT_ADJ \\n[#RULE_WEIGHT]/2
3451 .nr #UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT]/2
3453 \# Set default rule weight
3459 \# =====================================================================
3461 \# +++WORD AND SENTENCE SPACING+++
3463 \# WORD SPACE CONTROL
3464 \# ------------------
3466 \# <+|->wordspace | DEFAULT
3468 \# Increases or decreases interword space by user supplied amount.
3469 \# If DEFAULT, value is set to 12 (groff default).
3471 \# $WS_CONSTANT is the groff default word space.
3472 \# $WS_VAR is the user supplied amount by which to in/decrease word space.
3473 \# $WS is a concatenation of WS_CONSTANT and WS_VAR.
3475 \# Because the user supplied value requires a literal + or - sign,
3476 \# the macro argument is stored in a string.
3478 \# \n[.sss] holds the current sentence space value.
3481 . ds $WS_CONSTANT 12
3483 . ie '\\$1'DEFAULT' .ds $WS_VAR +0
3484 . el .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR])
3485 . ie \\n[.sss]=12 \{ .ss \\*[$WS] 12 \}
3487 . ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
3493 \# SENTENCE SPACE CONTROL
3494 \# ----------------------
3496 \# <+-sentencespace> | 0 | DEFAULT
3498 \# Increases or decreases sentence space by user supplied amount.
3499 \# If 0, sentence spaces are ignored. If DEFAULT, value is
3500 \# set to 12 (groff default).
3502 \# Because the user supplied value requires a literal + or - sign,
3503 \# the macro argument is stored in a string.
3505 \# Sentence space applies only to input where sentences are separated
3506 \# by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
3507 \# Changing .SS when sentences are separated by only one space has
3508 \# no effect on the space between sentences.
3510 \# \n[.ss] holds the current wordspace value.
3511 \# \n[.sss] holds the current sentence space value.
3514 . ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
3516 . ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
3519 . ss \\n[.ss] (0\\*[$SS_VAR])
3525 \# =====================================================================
3529 \# There are five styles of indents: left, right, both, temporary,
3530 \# and hanging. Each is set/invoked with a different macro.
3531 \# Indent macros begin with the letter "I", hence .IL means "indent left,"
3532 \# .IR means "indent right," and so on.
3534 \# The first time any of the indent macros is used, it requires an
3535 \# argument--the size of the indent (with a unit of measure). The
3536 \# size may also be entered using the \w escape--very useful
3537 \# for numbered lists using HI. The unit of measure is required.
3538 \# Subsequent invocations don't require the argument; the indent
3539 \# measure remains the same until it's changed by invoking the macro
3540 \# with an argument again.
3542 \# If no indents are in effect, the arguments passed to indent macros are
3543 \# measured from the left and right margins of the page. If a left indent
3544 \# or a right indent is already in effect, the arguments passed to
3545 \# the indent macros are calculated from the current values; in other words,
3546 \# the arguments are additive. If you quit an indent and later return
3547 \# to it, its value will be the value last in effect, unless you pass
3548 \# it an argument. If you do pass an argument, it is added to the last
3549 \# value in effect, unless you cleared the indent with one of
3550 \# .I<LRB>X/Q macros.
3564 \# The first .IL 2P indents text 2P from the left margin. The second
3565 \# .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
3566 \# .IQ turns the indent off. The last .IL (which has no argument)
3567 \# takes its value from the total of all arguments passed to .IL (in
3568 \# this case, 2P and 2P), therefore it indents 2P+2P from the left
3569 \# margin, i.e. 4P. If you wanted the last .IL to indent just 2P,
3570 \# you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
3571 \# the last .IL the argument 2P.
3573 \# To reverse the sense of an indent added to an indent, you may use
3576 \# Indents can be turned off individually with ILX, IRX, and IBX.
3577 \# LEFT and RIGHT indents may be combined and manipulated
3578 \# separately, (e.g. you can have an IL of 2P and an IR of 4P
3579 \# operative at the same time, and then change, say, the IL to
3580 \# 4P--thereby left indenting 6P--while the IR remains at 4P.
3582 \# IB automatically turns off IL and IR. They have to be reinvoked
3583 \# again when needed. IL and IR automatically turn IB off; it, too,
3584 \# has to be reinvoked with needed.
3586 \# All indents can be turned off at once with IQ. The ILX, IRX, IBX,
3587 \# and IQ macros simply turn the indents off; the values stored in
3588 \# the respective indent macros (IL, IR, IB) remain in effect. If
3589 \# the user wishes to clear the values, the I<LRB>X macros should be
3590 \# invoked with the single argument CLEAR. IQ CLEAR clears out
3591 \# the values stored for all indent styles.
3593 \# Indents *must* be turned off before settting string tabs
3594 \# inside PAD. Generally, in order not to get confused, it's a
3595 \# good idea to turn all indents off before setting any tabs.
3597 \# TI and HI are special cases. There's no need to turn them off,
3598 \# since they affect only one line--the first after their
3599 \# invocation. Like the other indent styles, the first time
3600 \# they're invoked, they require a value in iPpcm; each subsequent
3601 \# invocation without an argument will use the same value. To
3602 \# change the value, simply pass a new value. Values for TI and HI
3603 \# are *not* additive.
3605 \# HI presupposes that you already have a left or both indent on.
3606 \# HI will never hang a line outside the left margin of a document
3607 \# or column. In other words, you must have IL or IB on before you
3614 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
3615 . nr #INDENT_STYLE_LEFT 1
3616 . nr #INDENT_ACTIVE 1
3617 . nr #INDENT_LEFT_ACTIVE 1
3620 . in \\n[#L_INDENT]u
3621 . ta \\n(.lu-\\n[#L_INDENT]u
3625 . nr #L_INDENT +(\\$1)
3626 . in \\n[#L_INDENT]u
3627 . ta \\n(.lu-\\n[#L_INDENT]u
3632 \# +++INDENT RIGHT+++
3635 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
3636 . nr #INDENT_STYLE_RIGHT 1
3637 . nr #INDENT_ACTIVE 1
3638 . nr #INDENT_RIGHT_ACTIVE 1
3641 . ie \\n[#TAB_ACTIVE] \{\
3642 . ll \\n(.lu-\\n[#R_INDENT]u
3643 . ta \\n(.lu-\\n[#L_INDENT]u
3646 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
3647 . ta \\n(.lu-\\n[#L_INDENT]u
3652 . nr #R_INDENT +(\\$1)
3653 . ie \\n[#TAB_ACTIVE] \{\
3654 . ll \\n(.lu-\\n[#R_INDENT]u
3655 . ta \\n(.lu-\\n[#L_INDENT]u
3658 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
3659 . ta \\n(.lu-\\n[#L_INDENT]u
3665 \# +++INDENT BOTH+++
3668 . if \\n[#INDENT_STYLE_LEFT] \{ .ILX \}
3669 . if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
3670 . nr #INDENT_STYLE_BOTH 1
3671 . nr #INDENT_ACTIVE 1
3672 . nr #INDENT_BOTH_ACTIVE 1
3675 . in \\n[#BL_INDENT]u
3676 . ie \\n[#TAB_ACTIVE] \{\
3677 . ll \\n(.lu-\\n[#BR_INDENT]u
3678 . ta \\n(.lu-\\n[#BR_INDENT]u
3681 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
3682 . ta \\n(.lu-\\n[#BR_INDENT]u
3687 . nr #BL_INDENT (\\n[#INDENT]+\\$1)
3688 . ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
3689 . el \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
3690 . ie \\n[#TAB_ACTIVE] \{\
3691 . in \\n[#BL_INDENT]u
3692 . ll \\n(.lu-\\n[#BR_INDENT]u
3693 . ta \\n(.lu-\\n[#BL_INDENT]u
3696 . in \\n[#BL_INDENT]u
3697 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
3698 . ta \\n(.lu-\\n[#BR_INDENT]u
3704 \# +++TEMPORARY INDENT+++
3709 . ti \\n[#T_INDENT]u
3710 . if \\n[#INDENT_LEFT_ACTIVE] \{\
3711 . ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
3713 . if \\n[#INDENT_BOTH_ACTIVE] \{\
3714 . ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
3718 . nr #T_INDENT (\\$1)
3719 . ti \\n[#T_INDENT]u
3724 \# +++HANGING INDENT+++
3727 . ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
3729 . nr #HL_INDENT (\\$1)
3730 . ti -\\n[#HL_INDENT]u
3735 \# +++INDENTS OFF+++
3740 . rr #INDENT_LEFT_ACTIVE
3741 . if '\\$1'CLEAR' \{\
3743 . rr #INDENT_STYLE_LEFT
3750 . rr #INDENT_RIGHT_ACTIVE
3751 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3753 . ie \\n[#COLUMNS] \{\
3754 . ll \\n[#COL_L_LENGTH]u
3758 . ll \\n[#L_LENGTH]u
3762 . if '\\$1'CLEAR' \{\
3764 . rr #INDENT_STYLE_RIGHT
3772 . rr #INDENT_BOTH_ACTIVE
3773 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3775 . ie \\n[#COLUMNS] \{\
3776 . ll \\n[#COL_L_LENGTH]u
3780 . ll \\n[#L_LENGTH]u
3784 . if '\\$1'CLEAR' \{\
3787 . rr #INDENT_STYLE_BOTH
3794 . if !\\n[#IX_WARN] \{\
3795 . tm1 "[mom]: Use of .IX is now deprecated. Use .IQ instead.
3796 . tm1 " .IX will continue to behave as before, but to
3797 . tm1 " avoid this message, please update your document.
3803 . rr #INDENT_LEFT_ACTIVE
3804 . rr #INDENT_RIGHT_ACTIVE
3805 . rr #INDENT_BOTH_ACTIVE
3806 . if \\n[#INDENT_STYLE_RIGHT] \{\
3807 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3809 . ie \\n[#COLUMNS] \{\
3810 . ll \\n[#COL_L_LENGTH]u
3814 . ll \\n[#L_LENGTH]u
3819 . if \\n[#INDENT_STYLE_BOTH] \{\
3820 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3822 . ie \\n[#COLUMNS] \{\
3823 . ll \\n[#COL_L_LENGTH]u
3827 . ll \\n[#L_LENGTH]u
3832 . if '\\$1'CLEAR' \{\
3833 . if \\n[#INDENT_STYLE_RIGHT] \{\
3834 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3836 . ie \\n[#COLUMNS] \{\
3837 . ll \\n[#COL_L_LENGTH]u
3841 . ll \\n[#L_LENGTH]u
3846 . if \\n[#INDENT_STYLE_BOTH] \{\
3847 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3849 . ie \\n[#COLUMNS] \{\
3850 . ll \\n[#COL_L_LENGTH]u
3854 . ll \\n[#L_LENGTH]u
3865 . rr #INDENT_STYLE_LEFT
3866 . rr #INDENT_STYLE_RIGHT
3867 . rr #INDENT_STYLE_BOTH
3872 \# =====================================================================
3874 \# +++MULTIPLE COLUMNS+++
3876 \# MULTIPLE COLUMNS ON
3877 \# -------------------
3881 \# Marks the top of a column set
3887 \# MULTIPLE COLUMN RETURN
3888 \# ----------------------
3892 \# Returns to the top of a column set
3900 \# MULTIPLE COLUMNS OFF
3901 \# --------------------
3903 \# <none> | <lead to advance beneath bottom of deepest column>
3905 \# Advances to the end of a column set
3907 \# With no argument, advances to the next baseline (at the current
3908 \# leading value) beneath the longest column. With an argument
3909 \# (which requires a unit of measure), advances arg distance
3910 \# beneath the baseline of the deepest column. If the argument
3911 \# is zero, advances to the baseline of the deepest column.
3920 . nr #MCX_ALD (\\$1)
3922 . ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
3923 . el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
3929 \# =====================================================================
3931 \# +++TYPESETTING SUPPORT MACROS+++
3938 \# Enables/disables traps.
3940 \# EL and TN don't function as advertised on the last line before
3941 \# a trap (when they break the preceding line, they spring the
3942 \# trap, and groff won't back up to the line preceding the trap).
3943 \# TRAP is a kludge to get EL and TN work properly on last lines.
3944 \# The user simply enloses the offending lines in TRAP OFF/TRAP.
3947 . ie '\\$1'' \{ .vpt 1 \}
3955 \# <none> | <anything>
3957 \# Diverts text so that it doesn't print, or turns the function off.
3959 \# Useful for setting up autotabs where you don't want the line with
3960 \# the tab marks to print.
3962 \# Also aliased as COMMENT, in case user wants to input a batch of
3963 \# text that doesn't print.
3967 . if \\n[#QUAD] \{ .br \}
3968 . ie '\\$1'' \{ .di NO_FLASH \}
3981 \# Prints anything. A macro that helps keep my code nicely indented.
3991 \# <none> | <anything>
3993 \# Converts text to caps, or, if OFF, reverts to normal caps/lc.
3995 \# For inline control of capitalization style, use \*[UC] and
4000 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
4035 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
4073 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
4110 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
4150 \# Gets cap-height, x-height, and descender depth of the
4151 \# current font at the current point size.
4153 \# The routine is diverted so it remains invisible to output.
4157 E\\R'#CAP_HEIGHT \\n[.cht]'
4158 e\\R'#X_HEIGHT \\n[.cht]'
4159 y\\R'#DESCENDER \\n[.cdp]'
4164 \# =====================================================================
4166 \# +++TYPESETTING ALIASES+++
4168 .ALIAS ADD_SPACE ALD
4169 .ALIAS CENTRE CENTER
4171 .ALIAS COMMENT SILENT
4172 .ALIAS CONDENSE CONDENSE_OR_EXTEND
4173 .ALIAS EXTEND CONDENSE_OR_EXTEND
4177 .ALIAS HYPHENATION HY
4183 .ALIAS LIG LIGATURES
4184 .ALIAS NEWCOLOUR NEWCOLOR
4185 .ALIAS PADMARKER PAD_MARKER
4188 .ALIAS TABSET TAB_SET
4190 .ALIAS UNDERSCORE_2 UNDERSCORE2
4191 .ALIAS XCOLOUR XCOLOR
4194 \# ====================================================================
4196 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
4197 \# ===============================================
4199 \# +++PAGE DIMENSIONS+++
4204 \# LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
4206 \# Sets up dimensions for different paper sizes.
4210 . if '\\*[$PAPER]'LETTER' \{\
4214 . if '\\*[$PAPER]'LEGAL' \{\
4218 . if '\\*[$PAPER]'STATEMENT' \{\
4222 . if '\\*[$PAPER]'TABLOID' \{\
4226 . if '\\*[$PAPER]'LEDGER' \{\
4230 . if '\\*[$PAPER]'FOLIO' \{\
4234 . if '\\*[$PAPER]'QUARTO' \{\
4238 . if '\\*[$PAPER]'10x14' \{\
4242 . if '\\*[$PAPER]'EXECUTIVE' \{\
4246 . if '\\*[$PAPER]'A3' \{\
4250 . if '\\*[$PAPER]'A4' \{\
4254 . if '\\*[$PAPER]'A5' \{\
4258 . if '\\*[$PAPER]'B4' \{\
4262 . if '\\*[$PAPER]'B5' \{\
4266 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
4267 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
4271 \# ====================================================================
4273 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
4278 \# TYPESET | TYPEWRITE [SINGLESPACE]
4280 \# Sets type specs for typewriter-style or typeset output.
4282 \# Number registers: TYPEWRITE=1, TYPESET=2.
4285 . if !\\n[#COLLATE]=1 \{\
4286 . if !d$PAPER \{ .PAPER LETTER \}
4287 . if '\\$1'TYPEWRITE' \{\
4289 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
4290 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
4293 . ie '\\$2'SINGLESPACE' \{\
4294 . nr #SINGLE_SPACE 1
4296 . nr #ORIGINAL_DOC_LEAD \\n(.v
4300 . nr #ORIGINAL_DOC_LEAD \\n(.v
4305 . if !\\n[#PP_INDENT] \{\
4306 . in 3P \"Set indent
4307 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
4308 . in 0 \"Remove indent
4311 . nr #BOLDER_UNITS 0
4314 . if !\\n[#ITALIC_MEANS_ITALIC] \{ .rm IT \}
4317 . if !\\n[#ITALIC_MEANS_ITALIC] \{ .rm PREV \}
4318 . if !\\n[#SLANT_MEANS_SLANT] \{ .UNDERLINE_SLANT \}
4319 . if !\\n[#ITALIC_MEANS_ITALIC] \{ .UNDERLINE_ITALIC \}
4320 . if !\\n[#UNDERLINE_QUOTES] \{ .UNDERLINE_QUOTES \}
4321 . nr #IGNORE_COLUMNS 1
4322 . nr #RULE_WEIGHT 500
4323 . nr #HEAD_UNDERLINE_WEIGHT 500
4327 . if '\\$1'TYPESET' \{\
4329 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
4330 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
4333 . if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
4334 . if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
4342 . if !\\n[#PP_INDENT] \{\
4343 . in 2m \"Set indent
4344 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
4345 . in 0 \"Remove indent
4348 . rr #IGNORE_COLUMNS
4354 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
4356 \# First, a little utility macro.
4365 \# ITALIC MEANS ITALIC
4366 \# -------------------
4370 \# Instructs TYPEWRITE to treat italics as italics, whether
4371 \# invoked via control lines or inline.
4373 \# ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
4374 \# hence invoking the one automatically turns off the other.
4376 .MAC ITALIC_MEANS_ITALIC END
4377 . if \\n[#PRINT_STYLE]=1 \{\
4378 . nr #ITALIC_MEANS_ITALIC 1
4379 . rr #UNDERLINE_ITALIC
4395 \# Instructs TYPEWRITE to underline italics, whether invoked
4396 \# via control lines or inline.
4398 \# UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
4399 \# hence invoking the one automatically turns off the other.
4401 \# UNDERLINE_ITALIC is the default for TYPEWRITE.
4403 .MAC UNDERLINE_ITALIC END
4404 . if \\n[#PRINT_STYLE]=1 \{\
4405 . nr #UNDERLINE_ITALIC 1
4406 . rr #ITALIC_MEANS_ITALIC
4420 \# <none> | <anything>
4422 \# Instructs TYPEWRITE to underline occurences of \*[SLANT], or
4423 \# turns feature off.
4425 \# Users may want \*[SLANT] to mean slant in TYPEWRITE, although
4426 \# most of the time, \*[SLANT] most likely means the user wanted
4427 \# italic but didn't have it, ergo the need to tell TYPEWRITE to
4428 \# treat \*[SLANT] as italic (i.e. underlined).
4430 \# UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
4431 \# hence invoking the one automatically turns off the other.
4433 \# UNDERLINE_SLANT is the default for TYPEWRITE.
4435 .MAC UNDERLINE_SLANT END
4436 . if \\n[#PRINT_STYLE]=1 \{\
4437 . rr #SLANT_MEANS_SLANT
4438 . nr #UNDERLINE_SLANT 1
4441 . ds SLANT \ER'#SLANT_ON 1'\E*[UL]
4442 . ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
4447 .MAC SLANT_MEANS_SLANT END
4448 . if \\n[#PRINT_STYLE]=1 \{\
4449 . rr #UNDERLINE_SLANT
4450 . nr #SLANT_MEANS_SLANT 1
4453 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
4454 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
4459 .MAC IGNORE_COLUMNS END
4460 . if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
4464 \# ====================================================================
4466 \# +++COPY STYLE -- DRAFT OR FINAL+++
4473 \# Sets registers that are used to determine what to put
4474 \# in the default header, and how to number pages.
4476 \# DOCTYPE must come before COPYSTYLE.
4479 . ds $COPY_STYLE \\$1
4480 . if '\\*[$COPY_STYLE]'DRAFT' \{\
4482 . if !d$DRAFT \{ .DRAFT 1 \}
4484 . if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2 \}
4485 . if !d$CHAPTER_STRING \{ .CHAPTER_STRING "Chapter" \}
4486 . if !d$DRAFT_STRING \{ .DRAFT_STRING "Draft" \}
4487 . if !d$REVISION_STRING \{ .REVISION_STRING "Rev." \}
4489 . if \\n[#DOC_TYPE]=1 \{\
4490 . ie \\n[#COPY_STYLE]=1 \{\
4491 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4492 . el \{ .PAGENUM_STYLE roman \}
4493 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4494 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
4498 . ie '\\*[$REVISION]'' \{\
4499 . ds $HDRFTR_CENTER \
4500 \\*[$DRAFT_STRING]\\*[$DRAFT]
4503 . ds $HDRFTR_CENTER \
4504 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4505 \\*[$REVISION_STRING] \\*[$REVISION]
4511 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4512 . el \{ .PAGENUM_STYLE DIGIT \}
4513 . if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
4514 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4516 . rr #USER_DEF_HDRFTR_CENTER
4521 . if \\n[#DOC_TYPE]=2 \{\
4523 . ie \\n[#COPY_STYLE]=1 \{\
4524 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4525 . el \{ .PAGENUM_STYLE roman \}
4526 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4527 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
4528 . ie '\\*[$CHAPTER]'' \{\
4529 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4530 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4532 . el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
4535 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4536 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4538 . el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4542 . ie '\\*[$REVISION]'' \{\
4543 . ie '\\*[$CHAPTER]'' \{\
4544 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4545 . ie '\\*[$DRAFT]'' \{\
4546 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4549 . ds $HDRFTR_CENTER \
4550 \\*[$CHAPTER_TITLE], \
4551 \\*[$DRAFT_STRING]\\*[$DRAFT]
4555 . ie '\\*[$DRAFT]'' \{\
4556 . ds $HDRFTR_CENTER \
4557 \\*[$CHAPTER_STRING]
4560 . ds $HDRFTR_CENTER \
4561 \\*[$CHAPTER_STRING], \
4562 \\*[$DRAFT_STRING]\\*[$DRAFT]
4567 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4568 . ie '\\*[$DRAFT]'' \{\
4569 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4572 . ds $HDRFTR_CENTER \
4573 \\*[$CHAPTER_TITLE_1], \
4574 \\*[$DRAFT_STRING]\\*[$DRAFT]
4578 . ie '\\*[$DRAFT]'' \{\
4579 . ds $HDRFTR_CENTER \
4580 \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4583 . ds $HDRFTR_CENTER \
4584 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4585 \\*[$DRAFT_STRING]\\*[$DRAFT]
4591 . ie '\\*[$CHAPTER]'' \{\
4592 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4593 . ie '\\*[$DRAFT]'' \{\
4594 . ds $HDRFTR_CENTER \
4595 \\*[$CHAPTER_TITLE], \
4596 \\*[$REVISION_STRING] \\*[$REVISION]
4599 . ds $HDRFTR_CENTER \
4600 \\*[$CHAPTER_TITLE], \
4601 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4602 \\*[$REVISION_STRING] \\*[$REVISION]
4606 . ie '\\*[$DRAFT]'' \{\
4607 . ds $HDRFTR_CENTER \
4608 \\*[$CHAPTER_STRING], \
4609 \\*[$REVISION_STRING] \\*[$REVISION]
4612 . ds $HDRFTR_CENTER \
4613 \\*[$CHAPTER_STRING], \
4614 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4615 \\*[$REVISION_STRING] \\*[$REVISION]
4620 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4621 . ie '\\*[$DRAFT]'' \{\
4622 . ds $HDRFTR_CENTER \
4623 \\*[$CHAPTER_TITLE], \
4624 \\*[$REVISION_STRING] \\*[$REVISION]
4627 . ds $HDRFTR_CENTER \
4628 \\*[$CHAPTER_TITLE], \
4629 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4630 \\*[$REVISION_STRING] \\*[$REVISION]
4634 . ie '\\*[$DRAFT]'' \{\
4635 . ds $HDRFTR_CENTER \
4636 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4637 \\*[$REVISION_STRING] \\*[$REVISION]
4640 . ds $HDRFTR_CENTER \
4641 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4642 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4643 \\*[$REVISION_STRING] \\*[$REVISION]
4653 . if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
4654 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4655 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4656 . el \{ .PAGENUM_STYLE DIGIT \}
4657 . ie '\\*[$CHAPTER]'' \{\
4658 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4659 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4662 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
4666 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4667 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4670 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4677 . if \\n[#DOC_TYPE]=3 \{\
4678 . ie \\n[#COPY_STYLE]=1 \{\
4679 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4680 . el \{ .PAGENUM_STYLE roman \}
4681 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
4682 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4685 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4686 . ie '\\*[$REVISION]'' \{\
4687 . ie '\\*[$DRAFT]'' \{\
4688 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4691 . ds $HDRFTR_CENTER \
4693 \\*[$DRAFT_STRING]\\*[$DRAFT]
4697 . ie '\\*[$DRAFT]'' \{\
4698 . ds $HDRFTR_CENTER \
4700 \\*[$REVISION_STRING] \\*[$REVISION]
4703 . ds $HDRFTR_CENTER \
4705 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4706 \\*[$REVISION_STRING] \\*[$REVISION]
4713 . if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
4714 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4715 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4716 . el \{ .PAGENUM_STYLE DIGIT \}
4717 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4723 \# ====================================================================
4725 \# +++COLLECT DOC INFO -- STRINGS AND REGISTERS FOR REFERENCE MACROS+++
4728 \# various string/register arguments
4730 \# Collect information about documents.
4735 . nr #DOCTITLE_NUM 0 1
4736 . while \\n[#NUM_ARGS]>\\n[#DOCTITLE_NUM] \{\
4737 . ds $DOC_TITLE_\\n+[#DOCTITLE_NUM] \\$\\n[#DOCTITLE_NUM]
4739 . ds $DOC_TITLE \\$*
4742 .MAC TITLE END \"Document title
4743 . ie \\n[#NUM_ARGS]=0 \{\
4744 . if \\n[#TITLE_NUM] \{\
4746 . while \\n[#TITLE_NUM]>\\n[#ITEM] \{\
4747 . rm $TITLE_\\n+[#ITEM]
4754 . while \\n[#NUM_ARGS]>\\n[#TITLE_NUM] \{\
4755 . ds $TITLE_\\n+[#TITLE_NUM] \\$\\n[#TITLE_NUM]
4762 .MAC SUBTITLE END \"Document sub-title
4763 . ie \\n[#NUM_ARGS]=0 \{\
4764 . if \\n[#SUBTITLE_NUM] \{\
4766 . while \\n[#SUBTITLE_NUM]>\\n[#ITEM] \{\
4767 . rm $SUBTITLE_\\n+[#ITEM]
4774 . if '\\$1'DOC_COVER' \{\
4776 . nr #SUBTITLE_DOCCOVER_NUM 0 1
4777 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_DOCCOVER_NUM] \{\
4778 . ds $SUBTITLE_DOCCOVER_\\n+[#SUBTITLE_DOCCOVER_NUM] \\$\\n[#SUBTITLE_DOCCOVER_NUM]
4782 . if '\\$1'COVER' \{\
4784 . nr #SUBTITLE_COVER_NUM 0 1
4785 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_COVER_NUM] \{\
4786 . ds $SUBTITLE_COVER_\\n+[#SUBTITLE_COVER_NUM] \\$\\n[#SUBTITLE_COVER_NUM]
4790 . nr #SUBTITLE_NUM 0 1
4791 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_NUM] \{\
4792 . ds $SUBTITLE_\\n+[#SUBTITLE_NUM] \\$\\n[#SUBTITLE_NUM]
4799 .MAC CHAPTER END \"If document is a chapter, the chapter number
4800 . nr #CHAPTER_CALLED 1
4803 . if \B'\\*[$CHAPTER]' \{\
4804 . nr #CH_NUM \\*[$CHAPTER]
4810 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
4811 . ie \\n[#NUM_ARGS]=0 \{\
4812 . if \\n[#CHAPTER_TITLE_NUM] \{\
4814 . while \\n[#CHAPTER_TITLE_NUM]>\\n[#ITEM] \{\
4815 . rm $CHAPTER_TITLE_\\n+[#ITEM]
4817 . rr #CHAPTER_TITLE_NUM
4822 . rr #CHAPTER_TITLE_NUM
4823 . nr #CHAPTER_TITLE_NUM 0 1
4824 . while \\n[#NUM_ARGS]>\\n[#CHAPTER_TITLE_NUM] \{\
4825 . ds $CHAPTER_TITLE_\\n+[#CHAPTER_TITLE_NUM] \\$\\n[#CHAPTER_TITLE_NUM]
4827 . ds $CHAPTER_TITLE \\$*
4832 .MAC DRAFT END \"Draft number
4833 . ie '\\$1'' .ds $DRAFT
4834 . el .ds $DRAFT " \\$1
4838 .MAC REVISION END \"Revision number
4843 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
4844 . nr #DRAFT_WITH_PAGENUM 1
4848 .MAC AUTHOR END \"Author. Enclose all args fully in double quotes.
4849 . if '\\$1'DOC_COVER' \{\
4851 . nr #AUTHOR_DOCCOVER_NUM 0 1
4852 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_DOCCOVER_NUM] \{\
4853 . ds $AUTHOR_DOCCOVER_\\n+[#AUTHOR_DOCCOVER_NUM] \\$\\n[#AUTHOR_DOCCOVER_NUM]
4857 . if '\\$1'COVER' \{\
4859 . nr #AUTHOR_COVER_NUM 0 1
4860 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_COVER_NUM] \{\
4861 . ds $AUTHOR_COVER_\\n+[#AUTHOR_COVER_NUM] \\$\\n[#AUTHOR_COVER_NUM]
4865 . nr #AUTHOR_NUM 0 1
4867 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
4868 . ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
4869 . as $AUTHORS \\*[$AUTHOR_\\n[#AUTHOR_NUM]], \"
4871 . substring $AUTHORS 0 -3
4872 . ds $AUTHOR \\*[$AUTHOR_1]
4875 .ALIAS EDITOR AUTHOR
4877 .MAC COPYRIGHT END \"For use on cover pages only
4878 . ie \\n[#NUM_ARGS]=1 \{\
4879 . ds $COPYRIGHT \[co]\\$1
4880 . rm $COPYRIGHT_DOCCOVER
4881 . rm $COPYRIGHT_COVER
4884 . if '\\$1'DOC_COVER' \{\
4885 . ds $COPYRIGHT_DOCCOVER \[co]\\$2
4887 . if '\\$1'COVER' \{\
4888 . ds $COPYRIGHT_COVER \[co]\\$2
4894 .MAC MISC END \"For use on cover pages only; enclose all args in double quotes
4895 . ie \\n[#NUM_ARGS]=0 \{\
4896 . if \\n[#MISC_NUM] \{\
4898 . while \\n[#MISC_NUM]>\\n[#ITEM] \{\
4899 . rm $MISC_\\n+[#ITEM]
4904 . if \\n[#MISC_DOCCOVER_NUM] \{\
4906 . while \\n[#MISC_DOCCOVER_NUM]>\\n[#ITEM] \{\
4907 . rm $MISC_DOCCOVER_\\n+[#ITEM]
4909 . rr #MISC_DOCCOVER_NUM
4912 . if \\n[#MISC_COVER_NUM] \{\
4914 . while \\n[#MISC_COVER_NUM]>\\n[#ITEM] \{\
4915 . rm $MISC_COVER_\\n+[#ITEM]
4917 . rr #MISC_COVER_NUM
4922 . if !'\\$1'DOC_COVER' \{\
4923 . if !'\\$1'COVER' \{ .nr #NEITHER 1 \}
4925 . if !'\\$1'COVER' \{\
4926 . if !'\\$1'DOC_COVER'\{ .nr #NEITHER 1 \}
4928 . if '\\$1'DOC_COVER' \{\
4930 . nr #MISC_DOCCOVER_NUM 0 1
4931 . while \\n[#NUM_ARGS]>\\n[#MISC_DOCCOVER_NUM] \{\
4932 . ds $MISC_DOCCOVER_\\n+[#MISC_DOCCOVER_NUM] \\$\\n[#MISC_DOCCOVER_NUM]
4934 . nr #NUM_MISCS_DOCCOVER \\n[#NUM_ARGS]
4936 . if '\\$1'COVER' \{\
4938 . nr #MISC_COVER_NUM 0 1
4939 . while \\n[#NUM_ARGS]>\\n[#MISC_COVER_NUM] \{\
4940 . ds $MISC_COVER_\\n+[#MISC_COVER_NUM] \\$\\n[#MISC_COVER_NUM]
4942 . nr #NUM_MISCS_COVER \\n[#NUM_ARGS]
4944 . if \\n[#NEITHER]=1 \{\
4946 . while \\n[#NUM_ARGS]>\\n[#MISC_NUM] \{\
4947 . ds $MISC_\\n+[#MISC_NUM] \\$\\n[#MISC_NUM]
4949 . nr #NUM_MISCS \\n[#NUM_ARGS]
4956 .MAC PAGENUMBER END \"Page # that appears on page one.
4957 . nr #n%_AT_PAGENUM_SET \\n%
4958 . nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
4959 . rr #n%_AT_PAGENUM_SET
4960 . nr #PAGE_NUM_SET 1
4963 \# ====================================================================
4965 \# +++TYPE OF DOCUMENT+++
4970 \# DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
4972 \# Creates strings and sets registers for document types.
4974 \# Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
4977 . if '\\$1'DEFAULT' \{\
4980 . if '\\$1'CHAPTER' \{\
4983 . if '\\$1'NAMED' \{\
4987 . if '\\$1'LETTER' \{\
4995 . INDENT_FIRST_PARAS
4997 . ds $SUITE \En[#SUITE]
4998 . HEADER_MARGIN 3P+6p
5004 . FOOTER_RIGHT_SIZE +0
5005 . FOOTER_RIGHT "\&.../\E*[$SUITE]
5006 . FOOTER_ON_FIRST_PAGE
5011 \# +++LETTER MACROS+++
5013 \# First, create a register to hold incrementing numbers to be
5014 \# appended to LETTERHEAD.
5023 \# Stores date (entered on the line after .DATE) in diversion
5027 . if !'\\n(.z'' \{ .di \}
5028 . di LETTERHEAD\\n+[#FIELD]
5029 . ie \\n[#FIELD]=1 \{\
5044 \# Stores addressee address (entered on the line after .TO) in
5045 \# diversion LETTERHEAD<n>
5048 . if !'\\n(.z'' \{ .di \}
5049 . di LETTERHEAD\\n+[#FIELD]
5059 \# Stores addresser address (entered on the line after .FROM) in
5060 \# diversion LETTERHEAD<n>
5063 . if !'\\n(.z'' \{ .di \}
5064 . di LETTERHEAD\\n+[#FIELD]
5074 \# Stores greeting (entered on the line after .GREETING) in
5075 \# diversion LETTERHEAD<n>
5078 . if !'\\n(.z'' \{ .di \}
5079 . di LETTERHEAD\\n+[#FIELD]
5089 \# Stores greeting in diversion CLOSING.
5104 \# Redefines $FOOTER_RIGHT to blank so that a suite number doesn't
5105 \# appear at the bottom of letter pages.
5111 \# ====================================================================
5115 \# TYPE-STYLE CONTROL MACROS
5116 \# -------------------------
5117 \# The control macros for family, font, size, quad and color are here
5118 \# grouped together. Each (e.g. _FAMILY or _FONT) tests for a calling
5119 \# alias before performing the action(s) appropriate to the calling
5120 \# macro. Defaults for all these guys are set in DEFAULTS, and listed
5121 \# in the "Control Macros" section of the documentation pertinent to
5122 \# the macro whose style is to be changed.
5125 . if '\\$0'AUTHOR_FAMILY'
5126 . if '\\$0'BIBLIOGRAPHY_FAMILY' .ds $BIB_FAM \\$1
5127 . if '\\$0'BIBLIOGRAPHY_STRING_FAMILY' .ds $BIB_STRING_FAM \\$1
5128 . if '\\$0'BLOCKQUOTE_FAMILY' .ds $BQUOTE_FAM \\$1
5129 . if '\\$0'CITATION_FAMILY' .ds $BQUOTE_FAM \\$1
5130 . if '\\$0'CITE_FAMILY' .ds $BQUOTE_FAM \\$1
5131 . if '\\$0'CHAPTER_TITLE_FAMILY' .ds $CHAPTER_TITLE_FAM \\$1
5132 . if '\\$0'COVER_AUTHOR_FAMILY' .ds $COVER_AUTHOR_FAM \\$1
5133 . if '\\$0'COVER_CHAPTER_TITLE_FAMILY' .ds $COVER_CHAPTER_TITLE_FAM \\$1
5134 . if '\\$0'COVER_COPYRIGHT_FAMILY' .ds $COVER_COPYRIGHT_FAM \\$1
5135 . if '\\$0'COVER_DOCTYPE_FAMILY' .ds $COVER_DOCTYPE_FAM \\$1
5136 . if '\\$0'COVER_FAMILY' .ds $COVER_FAM \\$1
5137 . if '\\$0'COVER_SUBTITLE_FAMILY' .ds $COVER_SUBTITLE_FAM \\$1
5138 . if '\\$0'COVER_TITLE_FAMILY' .ds $COVER_TITLE_FAM \\$1
5139 . if '\\$0'DOC_COVER_AUTHOR_FAMILY' .ds $DOC_COVER_AUTHOR_FAM \\$1
5140 . if '\\$0'DOC_COVER_CHAPTER_TITLE_FAMILY' .ds $DOC_COVER_CHAPTER_TITLE_FAM \\$1
5141 . if '\\$0'DOC_COVER_COPYRIGHT_FAMILY' .ds $DOC_COVER_COPYRIGHT_FAM \\$1
5142 . if '\\$0'DOC_COVER_DOCTYPE_FAMILY' .ds $DOC_COVER_DOCTYPE_FAM \\$1
5143 . if '\\$0'DOC_COVER_FAMILY' .ds $DOC_COVER_FAM \\$1
5144 . if '\\$0'DOC_COVER_SUBTITLE_FAMILY' .ds $DOC_COVER_SUBTITLE_FAM \\$1
5145 . if '\\$0'DOC_COVER_TITLE_FAMILY' .ds $DOC_COVER_TITLE_FAM \\$1
5146 . if '\\$0'DOCHEADER_FAMILY' .ds $DOCHEADER_FAM \\$1
5147 . if '\\$0'DOCTYPE_FAMILY' .ds $DOCTYPE_FAM \\$1
5148 . if '\\$0'ENDNOTE_FAMILY' .ds $EN_FAM \\$1
5149 . if '\\$0'ENDNOTE_NUMBER_FAMILY' .ds $EN_NUMBER_FAM \\$1
5150 . if '\\$0'ENDNOTE_LINENUMBER_FAMILY' .ds $EN_LN_FAM \\$1
5151 . if '\\$0'ENDNOTE_STRING_FAMILY' .ds $EN_STRING_FAM \\$1
5152 . if '\\$0'ENDNOTE_TITLE_FAMILY' .ds $EN_TITLE_FAM \\$1
5153 . if '\\$0'EPIGRAPH_FAMILY' .ds $EPI_FAM \\$1
5154 . if '\\$0'FOOTNOTE_FAMILY' .ds $FN_FAM \\$1
5155 . if '\\$0'HDRFTR_CENTER_FAMILY' .ds $HDRFTR_CENTER_FAM \\$1
5156 . if '\\$0'HDRFTR_FAMILY' \{\
5157 . ds $HDRFTR_FAM \\$1
5158 . ds $HDRFTR_LEFT_FAM \\$1
5159 . ds $HDRFTR_CENTER_FAM \\$1
5160 . ds $HDRFTR_RIGHT_FAM \\$1
5162 . if '\\$0'HDRFTR_LEFT_FAMILY' .ds $HDRFTR_LEFT_FAM \\$1
5163 . if '\\$0'HDRFTR_RIGHT_FAMILY' .ds $HDRFTR_RIGHT_FAM \\$1
5164 . if '\\$0'HEAD_FAMILY' .ds $HEAD_FAM \\$1
5165 . if '\\$0'LINENUMBER_FAMILY' .ds $LN_FAM \\$1
5166 . if '\\$0'PAGENUM_FAMILY' .ds $PAGE_NUM_FAM \\$1
5167 . if '\\$0'PARAHEAD_FAMILY' .ds $PH_FAM \\$1
5168 . if '\\$0'QUOTE_FAMILY' .ds $QUOTE_FAM \\$1
5169 . if '\\$0'SUBHEAD_FAMILY' .ds $SH_FAM \\$1
5170 . if '\\$0'SUBTITLE_FAMILY' .ds $SUBTITLE_FAM \\$1
5171 . if '\\$0'TITLE_FAMILY' .ds $TITLE_FAM \\$1
5172 . if '\\$0'TOC_FAMILY' .ds $TOC_FAM \\$1
5173 . if '\\$0'TOC_FAM' .ds $TOC_FAM \\$1
5174 . if '\\$0'TOC_HEADER_FAMILY' .ds $TOC_HEADER_FAM \\$1
5175 . if '\\$0'TOC_HEAD_FAMILY' .ds $TOC_HEAD_FAM \\$1
5176 . if '\\$0'TOC_PARAHEAD_FAMILY' .ds $TOC_PH_FAM \\$1
5177 . if '\\$0'TOC_PN_FAMILY' .ds $TOC_PN_FAM \\$1
5178 . if '\\$0'TOC_SUBHEAD_FAMILY' .ds $TOC_SH_FAM \\$1
5179 . if '\\$0'TOC_TITLE_FAMILY' .ds $TOC_TITLE_FAM \\$1
5184 . if '\\$0'AUTHOR_FONT' .ds $AUTHOR_FT \\$1
5185 . if '\\$0'BIBLIOGRAPHY_FONT' .ds $BIB_FT \\$1
5186 . if '\\$0'BIBLIOGRAPHY_STRING_FONT' .ds $BIB_STRING_FT \\$1
5187 . if '\\$0'BLOCKQUOTE_FONT' .ds $BQUOTE_FT \\$1
5188 . if '\\$0'CITATION_FONT' .ds $BQUOTE_FT \\$1
5189 . if '\\$0'CITE_FONT' .ds $BQUOTE_FT \\$1
5190 . if '\\$0'CHAPTER_TITLE_FONT' .ds $CHAPTER_TITLE_FT \\$1
5191 . if '\\$0'COVER_AUTHOR_FONT' .ds $COVER_AUTHOR_FT \\$1
5192 . if '\\$0'COVER_CHAPTER_TITLE_FONT' .ds $COVER_CHAPTER_TITLE_FT \\$1
5193 . if '\\$0'COVER_COPYRIGHT_FONT' .ds $COVER_COPYRIGHT_FT \\$1
5194 . if '\\$0'COVER_DOCTYPE_FONT' .ds $COVER_DOCTYPE_FT \\$1
5195 . if '\\$0'COVER_SUBTITLE_FONT' .ds $COVER_SUBTITLE_FT \\$1
5196 . if '\\$0'COVER_TITLE_FONT' .ds $COVER_TITLE_FT \\$1
5197 . if '\\$0'DOC_COVER_AUTHOR_FONT' .ds $DOC_COVER_AUTHOR_FT \\$1
5198 . if '\\$0'DOC_COVER_CHAPTER_TITLE_FONT' .ds $DOC_COVER_CHAPTER_TITLE_FT \\$1
5199 . if '\\$0'DOC_COVER_COPYRIGHT_FONT' .ds $DOC_COVER_COPYRIGHT_FT \\$1
5200 . if '\\$0'DOC_COVER_DOCTYPE_FONT' .ds $DOC_COVER_DOCTYPE_FT \\$1
5201 . if '\\$0'DOC_COVER_SUBTITLE_FONT' .ds $DOC_COVER_SUBTITLE_FT \\$1
5202 . if '\\$0'DOC_COVER_TITLE_FONT' .ds $DOC_COVER_TITLE_FT \\$1
5203 . if '\\$0'DOCTYPE_FONT' .ds $DOCTYPE_FT \\$1
5204 . if '\\$0'ENDNOTE_FONT' .ds $EN_FT \\$1
5205 . if '\\$0'ENDNOTE_NUMBER_FONT' .ds $EN_NUMBER_FT \\$1
5206 . if '\\$0'ENDNOTE_LINENUMBER_FONT' .ds $EN_LN_FT \\$1
5207 . if '\\$0'ENDNOTE_STRING_FONT' .ds $EN_STRING_FT \\$1
5208 . if '\\$0'ENDNOTE_TITLE_FONT' .ds $EN_TITLE_FT \\$1
5209 . if '\\$0'EPIGRAPH_FONT' .ds $EPI_FT \\$1
5210 . if '\\$0'FOOTNOTE_FONT' .ds $FN_FT \\$1
5211 . if '\\$0'HDRFTR_CENTER_FONT' .ds $HDRFTR_CENTER_FT \\$1
5212 . if '\\$0'HDRFTR_LEFT_FONT' .ds $HDRFTR_LEFT_FT \\$1
5213 . if '\\$0'HDRFTR_RIGHT_FONT' .ds $HDRFTR_RIGHT_FT \\$1
5214 . if '\\$0'HEAD_FONT' .ds $HEAD_FT \\$1
5215 . if '\\$0'LINENUMBER_FONT' .ds $LN_FT \\$1
5216 . if '\\$0'PAGENUM_FONT' .ds $PAGE_NUM_FT \\$1
5217 . if '\\$0'PARAHEAD_FONT' .ds $PH_FT \\$1
5218 . if '\\$0'QUOTE_FONT' .ds $QUOTE_FT \\$1
5219 . if '\\$0'SUBHEAD_FONT' .ds $SH_FT \\$1
5220 . if '\\$0'SUBTITLE_FONT' .ds $SUBTITLE_FT \\$1
5221 . if '\\$0'TITLE_FONT' .ds $TITLE_FT \\$1
5222 . if '\\$0'TOC_HEADER_FONT' .ds $TOC_HEADER_FT \\$1
5223 . if '\\$0'TOC_HEAD_FONT' .ds $TOC_HEAD_FT \\$1
5224 . if '\\$0'TOC_PARAHEAD_FONT' .ds $TOC_PH_FT \\$1
5225 . if '\\$0'TOC_PN_FONT' .ds $TOC_PN_FT \\$1
5226 . if '\\$0'TOC_SUBHEAD_FONT' .ds $TOC_SH_FT \\$1
5227 . if '\\$0'TOC_TITLE_FONT' .ds $TOC_TITLE_FT \\$1
5232 . if '\\$0'AUTHOR_SIZE' .ds $AUTHOR_SIZE_CHANGE \\$1
5233 . if '\\$0'BIBLIOGRAPHY_STRING_SIZE' .ds $BIB_STRING_SIZE_CHANGE \\$1
5234 . if '\\$0'BLOCKQUOTE_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
5235 . if '\\$0'CITATION_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
5236 . if '\\$0'CITE_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
5237 . if '\\$0'CHAPTER_TITLE_SIZE' .ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
5238 . if '\\$0'COVER_AUTHOR_SIZE' .ds $COVER_AUTHOR_SIZE_CHANGE \\$1
5239 . if '\\$0'COVER_CHAPTER_TITLE_SIZE' .ds $COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
5240 . if '\\$0'COVER_COPYRIGHT_SIZE' .ds $COVER_COPYRIGHT_SIZE_CHANGE \\$1
5241 . if '\\$0'COVER_DOCTYPE_SIZE' .ds $COVER_DOCTYPE_SIZE_CHANGE \\$1
5242 . if '\\$0'COVER_SUBTITLE_SIZE' .ds $COVER_SUBTITLE_SIZE_CHANGE \\$1
5243 . if '\\$0'COVER_TITLE_SIZE' .ds $COVER_TITLE_SIZE_CHANGE \\$1
5244 . if '\\$0'DOC_COVER_AUTHOR_SIZE' .ds $DOC_COVER_AUTHOR_SIZE_CHANGE \\$1
5245 . if '\\$0'DOC_COVER_CHAPTER_TITLE_SIZE' .ds $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
5246 . if '\\$0'DOC_COVER_COPYRIGHT_SIZE' .ds $DOC_COVER_COPYRIGHT_SIZE_CHANGE \\$1
5247 . if '\\$0'DOC_COVER_DOCTYPE_SIZE' .ds $DOC_COVER_DOCTYPE_SIZE_CHANGE \\$1
5248 . if '\\$0'DOC_COVER_SUBTITLE_SIZE' .ds $DOC_COVER_SUBTITLE_SIZE_CHANGE \\$1
5249 . if '\\$0'DOC_COVER_TITLE_SIZE' .ds $DOC_COVER_TITLE_SIZE_CHANGE \\$1
5250 . if '\\$0'DOCTYPE_SIZE' .ds $DOCTYPE_SIZE_CHANGE \\$1
5251 . if '\\$0'ENDNOTE_NUMBER_SIZE' .ds $EN_NUMBER_SIZE_CHANGE \\$1
5252 . if '\\$0'ENDNOTE_LINENUMBER_SIZE' .ds $EN_LN_SIZE_CHANGE \\$1
5253 . if '\\$0'ENDNOTE_STRING_SIZE' .ds $EN_STRING_SIZE_CHANGE \\$1
5254 . if '\\$0'ENDNOTE_TITLE_SIZE' .ds $EN_TITLE_SIZE_CHANGE \\$1
5255 . if '\\$0'EPIGRAPH_SIZE' .ds $EPI_SIZE_CHANGE \\$1
5256 . if '\\$0'FOOTNOTE_SIZE' .ds $FN_SIZE_CHANGE \\$1
5257 . if '\\$0'HDRFTR_CENTER_SIZE' .ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
5258 . if '\\$0'HDRFTR_LEFT_SIZE' .ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5259 . if '\\$0'HDRFTR_RIGHT_SIZE' .ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
5260 . if '\\$0'HDRFTR_SIZE' .ds $HDRFTR_SIZE_CHANGE \\$1
5261 . if '\\$0'HEAD_SIZE' .ds $HEAD_SIZE_CHANGE \\$1
5262 . if '\\$0'LINENUMBER_SIZE' .ds $LN_SIZE_CHANGE \\$1
5263 . if '\\$0'PAGENUM_SIZE' .ds $PAGE_NUM_SIZE_CHANGE \\$1
5264 . if '\\$0'PARAHEAD_SIZE' .ds $PH_SIZE_CHANGE \\$1
5265 . if '\\$0'QUOTE_SIZE' .ds $QUOTE_SIZE_CHANGE \\$1
5266 . if '\\$0'SUBHEAD_SIZE' .ds $SH_SIZE_CHANGE \\$1
5267 . if '\\$0'SUBTITLE_SIZE' .ds $SUBTITLE_SIZE_CHANGE \\$1
5268 . if '\\$0'TITLE_SIZE' .ds $TITLE_SIZE_CHANGE \\$1
5269 . if '\\$0'TOC_HEADER_SIZE' .ds $TOC_HEADER_SIZE_CHANGE \\$1
5270 . if '\\$0'TOC_HEAD_SIZE' .ds $TOC_HEAD_SIZE_CHANGE \\$1
5271 . if '\\$0'TOC_PARAHEAD_SIZE' .ds $TOC_PH_SIZE_CHANGE \\$1
5272 . if '\\$0'TOC_PN_SIZE' .ds $TOC_PN_SIZE_CHANGE \\$1
5273 . if '\\$0'TOC_SUBHEAD_SIZE' .ds $TOC_SH_SIZE_CHANGE \\$1
5274 . if '\\$0'TOC_TITLE_SIZE' .ds $TOC_TITLE_SIZE_CHANGE \\$1
5279 . if \\n[#PRINT_STYLE]=1 \{ .return \}
5280 . if '\\$0'ATTRIBUTE_COLOR' \{\
5281 . nr #ATTRIBUTE_COLOR 1
5282 . ds $ATTRIBUTE_COLOR \\$1
5284 . if '\\$0'AUTHOR_COLOR' \{\
5285 . nr #AUTHOR_COLOR 1
5286 . ds $AUTHOR_COLOR \\$1
5288 . if '\\$0'BLOCKQUOTE_COLOR' \{\
5289 . nr #BQUOTE_COLOR 1
5290 . ds $BQUOTE_COLOR \\$1
5292 . if '\\$0'CITATION_COLOR' \{\
5293 . nr #BQUOTE_COLOR 1
5294 . ds $BQUOTE_COLOR \\$1
5296 . if '\\$0'CITE_COLOR' \{\
5297 . nr #BQUOTE_COLOR 1
5298 . ds $BQUOTE_COLOR \\$1
5300 . if '\\$0'CHAPTER_TITLE_COLOR' \{\
5301 . nr #CHAPTER_TITLE_COLOR 1
5302 . ds $CHAPTER_TITLE_COLOR \\$1
5304 . if '\\$0'COVER_ATTRIBUTE_COLOR' \{\
5305 . nr #COVER_ATTRIBUTE_COLOR 1
5306 . ds $COVER_ATTRIBUTE_COLOR \\$1
5308 . if '\\$0'COVER_AUTHOR_COLOR' \{\
5309 . nr #COVER_AUTHOR_COLOR 1
5310 . ds $COVER_AUTHOR_COLOR \\$1
5312 . if '\\$0'COVER_CHAPTER_TITLE_COLOR' \{\
5313 . nr #COVER_CHAPTER_TITLE_COLOR 1
5314 . ds $COVER_CHAPTER_TITLE_COLOR \\$1
5316 . if '\\$0'COVER_COLOR' \{\
5318 . ds $COVER_COLOR \\$1
5320 . if '\\$0'COVER_COPYRIGHT_COLOR' \{\
5321 . nr #COVER_COPYRIGHT_COLOR 1
5322 . ds $COVER_COPYRIGHT_COLOR \\$1
5324 . if '\\$0'COVER_MISC_COLOR' \{\
5325 . nr #COVER_MISC_COLOR 1
5326 . ds $COVER_MISC_COLOR \\$1
5328 . if '\\$0'COVER_TITLE_COLOR' \{\
5329 . nr #COVER_TITLE_COLOR 1
5330 . ds $COVER_TITLE_COLOR \\$1
5332 . if '\\$0'COVER_SUBTITLE_COLOR' \{\
5333 . nr #COVER_SUBTITLE_COLOR 1
5334 . ds $COVER_SUBTITLE_COLOR \\$1
5336 . if '\\$0'COVER_DOCTYPE_COLOR' \{\
5337 . nr #COVER_DOCTYPE_COLOR 1
5338 . ds $COVER_DOCTYPE_COLOR \\$1
5340 . if '\\$0'DOC_COVER_ATTRIBUTE_COLOR' \{\
5341 . nr #DOC_COVER_ATTRIBUTE_COLOR 1
5342 . ds $DOC_COVER_ATTRIBUTE_COLOR \\$1
5344 . if '\\$0'DOC_COVER_AUTHOR_COLOR' \{\
5345 . nr #DOC_COVER_AUTHOR_COLOR 1
5346 . ds $DOC_COVER_AUTHOR_COLOR \\$1
5348 . if '\\$0'DOC_COVER_CHAPTER_TITLE_COLOR' \{\
5349 . nr #DOC_COVER_CHAPTER_TITLE_COLOR 1
5350 . ds $DOC_COVER_CHAPTER_TITLE_COLOR \\$1
5352 . if '\\$0'DOC_COVER_COLOR' \{\
5353 . nr #DOC_COVER_COLOR 1
5354 . ds $DOC_COVER_COLOR \\$1
5356 . if '\\$0'DOC_COVER_COPYRIGHT_COLOR' \{\
5357 . nr #DOC_COVER_COPYRIGHT_COLOR 1
5358 . ds $DOC_COVER_COPYRIGHT_COLOR \\$1
5360 . if '\\$0'DOC_COVER_MISC_COLOR' \{\
5361 . nr #DOC_COVER_MISC_COLOR 1
5362 . ds $DOC_COVER_MISC_COLOR \\$1
5364 . if '\\$0'DOC_COVER_TITLE_COLOR' \{\
5365 . nr #DOC_COVER_TITLE_COLOR 1
5366 . ds $DOC_COVER_TITLE_COLOR \\$1
5368 . if '\\$0'DOC_COVER_SUBTITLE_COLOR' \{\
5369 . nr #DOC_COVER_SUBTITLE_COLOR 1
5370 . ds $DOC_COVER_SUBTITLE_COLOR \\$1
5372 . if '\\$0'DOC_COVER_DOCTYPE_COLOR' \{\
5373 . nr #DOC_COVER_DOCTYPE_COLOR 1
5374 . ds $DOC_COVER_DOCTYPE_COLOR \\$1
5376 . if '\\$0'DOCHEADER_COLOR' \{\
5377 . nr #DOCHEADER_COLOR 1
5378 . ds $DOCHEADER_COLOR \\$1
5380 . if '\\$0'DOCTYPE_COLOR' \{\
5381 . nr #DOCTYPE_COLOR 1
5382 . ds $DOCTYPE_COLOR \\$1
5384 . if '\\$0'EPIGRAPH_COLOR' \{\
5386 . ds $EPI_COLOR \\$1
5388 . if '\\$0'FINIS_COLOR' \{\
5390 . ds $FINIS_COLOR \\$1
5392 . if '\\$0'FOOTNOTE_COLOR' \{\
5393 . nr #FOOTNOTE_COLOR 1
5394 . ds $FOOTNOTE_COLOR \\$1
5396 . if '\\$0'HDRFTR_CENTER_COLOR' \{\
5397 . nr #HDRFTR_CENTER_COLOR 1
5398 . ds $HDRFTR_CENTER_COLOR \\$1
5400 . if '\\$0'HDRFTR_COLOR' \{\
5401 . nr #HDRFTR_COLOR 1
5402 . ds $HDRFTR_COLOR \\$1
5404 . if '\\$0'HDRFTR_LEFT_COLOR' \{\
5405 . nr #HDRFTR_LEFT_COLOR 1
5406 . ds $HDRFTR_LEFT_COLOR \\$1
5408 . if '\\$0'HDRFTR_RIGHT_COLOR' \{\
5409 . nr #HDRFTR_RIGHT_COLOR 1
5410 . ds $HDRFTR_RIGHT_COLOR \\$1
5412 . if '\\$0'HDRFTR_RULE_COLOR' \{\
5413 . nr #HDRFTR_RULE_COLOR 1
5414 . ds $HDRFTR_RULE_COLOR \\$1
5416 . if '\\$0'HEAD_COLOR' \{\
5418 . ds $HEAD_COLOR \\$1
5420 . if '\\$0'LINEBREAK_COLOR' \{\
5421 . nr #LINEBREAK_COLOR 1
5422 . ds $LINEBREAK_COLOR \\$1
5424 . if '\\$0'LINENUMBER_COLOR' \{\
5425 . nr #LINENUMBER_COLOR 1
5428 . if '\\$0'PAGENUM_COLOR' \{\
5429 . nr #PAGE_NUM_COLOR 1
5430 . ds $PAGENUM_COLOR \\$1
5432 . if '\\$0'PARAHEAD_COLOR' \{\
5436 . if '\\$0'QUOTE_COLOR' \{\
5438 . ds $QUOTE_COLOR \\$1
5440 . if '\\$0'SUBHEAD_COLOR' \{\
5444 . if '\\$0'SUBTITLE_COLOR' \{\
5445 . nr #SUBTITLE_COLOR 1
5446 . ds $SUBTITLE_COLOR \\$1
5448 . if '\\$0'TITLE_COLOR' \{\
5450 . ds $TITLE_COLOR \\$1
5456 . if '\\$0'BIBLIOGRAPHY_QUAD' \{\
5458 . if '\\*[$BIB_QUAD]'R' .ab Fatal error: \\$0 must be set to either L or J
5459 . if '\\*[$BIB_QUAD]'C' .ab Fatal error: \\$0 must be set to either L or J
5461 . if '\\$0'BIBLIOGRAPHY_STRING_QUAD' .ds $BIB_STRING_QUAD \\$1
5462 . if '\\$0'BLOCKQUOTE_QUAD' .ds $BQUOTE_QUAD \\$1
5463 . if '\\$0'CITATION_QUAD' .ds $BQUOTE_QUAD \\$1
5464 . if '\\$0'CITE_QUAD' .ds $BQUOTE_QUAD \\$1
5465 . if '\\$0'COVER_COPYRIGHT_QUAD' .ds $COVER_COPYRIGHT_QUAD \\$1
5466 . if '\\$0'COVER_MISC_QUAD' .ds $COVER_MISC_QUAD \\$1
5467 . if '\\$0'DOC_COVER_COPYRIGHT_QUAD' .ds $DOC_COVER_COPYRIGHT_QUAD \\$1
5468 . if '\\$0'DOC_COVER_MISC_QUAD' .ds $DOC_COVER_MISC_QUAD \\$1
5469 . if '\\$0'DOC_QUAD' \{\
5471 . QUAD \\*[$DOC_QUAD]
5473 . if '\\$0'ENDNOTE_QUAD' \{\
5475 . if '\\*[$EN_QUAD]'R' .ab Fatal error: \\$0 must be set to either L or J
5476 . if '\\*[$EN_QUAD]'C' .ab Fatal error: \\$0 must be set to either L or J
5478 . if '\\$0'ENDNOTE_STRING_QUAD' .ds $EN_STRING_QUAD \\$1
5479 . if '\\$0'ENDNOTE_TITLE_QUAD' .ds $EN_TITLE_QUAD \\$1
5480 . if '\\$0'EPIGRAPH_QUAD' .ds $EPI_QUAD \\$1
5481 . if '\\$0'FOOTNOTE_QUAD' .ds $FN_QUAD \\$1
5482 . if '\\$0'HEAD_QUAD' .ds $HEAD_QUAD \\$1
5483 . if '\\$0'SUBHEAD_QUAD' .ds $SH_QUAD \\$1
5484 . if '\\$0'TOC_HEADER_QUAD' .ds $TOC_HEADER_QUAD \\$1
5493 \# Sets up defaults if no values are entered prior to START.
5495 \# The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
5496 \# $REVISION_STRING are in the COPYSTYLE macro.
5499 . if !d$PAPER \{ .PAPER LETTER \}
5500 . if !\\n[#DOC_TYPE] \{ .DOCTYPE DEFAULT \}
5501 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
5503 . if !\\n[#COPY_STYLE]=1 \{ .PAGENUM_STYLE DIGIT \}
5505 . if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
5506 . if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
5507 . if \\n[#DOC_TYPE]=4 \{\
5508 . if !\\n[#USER_SET_L_LENGTH] \{\
5509 . R_MARGIN \\n[#R_MARGIN]u
5510 . rr #USER_SET_L_LENGTH
5512 . if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
5514 . if \\n[#COPY_STYLE]=1 \{\
5518 . if !r#DOC_HEADER \{ .DOCHEADER \}
5519 . if !r#HEADERS_ON \{ .HEADERS \}
5520 . if !r#PAGINATE \{ .PAGINATE \}
5521 . if \\n[#FOOTERS_ON] \{\
5523 . if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
5525 . if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
5526 . if !r#HEADER_GAP \{ .HEADER_GAP 3P \}
5527 . if \\n[#FOOTERS_ON] \{\
5528 . if \\n[#PAGINATE]=0 \{\
5529 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
5532 . if \\n[#HEADERS_ON]=0 \{\
5533 . if \\n[#FOOTERS_ON]=0 \{\
5534 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
5537 . if !r#T_MARGIN \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
5538 . if !r#DOCHEADER_ADVANCE \{ .nr #DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
5539 . if !r#FOOTER_MARGIN \{ .FOOTER_MARGIN 3P \}
5540 . if !r#FOOTER_GAP \{ .FOOTER_GAP 3P \}
5541 . if !r#B_MARGIN \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
5542 . if (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
5543 . tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
5544 . tm1 " No footers or bottom-of-page page numbers will be printed.
5545 . tm1 " Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
5546 . tm1 " If no footers or bottom-of-page page numbers are required,
5547 . tm1 " type in .FOOTER_MARGIN 0 before .START
5549 . if !r#HEADER_RULE_GAP \{ .HEADER_RULE_GAP 4p \}
5550 . if !r#FOOTER_RULE_GAP \{ .FOOTER_RULE_GAP 4p \}
5551 . if !r#HDRFTR_RULE \{ .HDRFTR_RULE \}
5552 . if !r#PAGE_NUM_SET \{ .PAGENUMBER 1 \}
5553 .\" Read in number registers and strings for type parameters
5554 . nr #DOC_L_MARGIN \\n[#L_MARGIN]
5555 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
5556 . nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
5557 . ds $DOC_FAM \\*[$FAMILY]
5558 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
5559 . nr #DOC_LEAD \\n[#LEAD]
5560 .\" #SAVED_DOC_LEAD is set in COLLATE
5561 . if r#SAVED_DOC_LEAD \{\
5562 . if !\\n[#DOC_LEAD]=\\n[#SAVED_DOC_LEAD] \{ .nr #RERUN_TRAPS 1 \}
5564 . ie \\n[#ADJ_DOC_LEAD]=1 \{ . \}
5566 . if !\\n[#DOC_LEAD_ADJUST_OFF] \{\
5570 . ds $DOC_QUAD \\*[$QUAD_VALUE]
5571 . if '\\*[$FONT]'' \{ .FT R \}
5572 . if '\\*[$PP_FT]'' \{\
5573 . ds $PP_FT \\*[$FONT]
5575 . if !'\\*[$PP_FT]'' \{\
5576 . ds $PP_FT \\*[$FONT]
5582 . nr #FN_COUNT_FOR_COLS 0 1
5585 . RESET_SUBHEAD_NUMBER
5586 . RESET_PARAHEAD_NUMBER
5587 .\" General style defaults for both PRINTSTYLEs
5589 . PARA_INDENT \\n[#PP_INDENT]u
5590 . if !d$HDRFTR_FAM \{ .HDRFTR_FAMILY \\*[$DOC_FAM] \}
5591 . if !d$HDRFTR_SIZE_CHANGE \{ .HDRFTR_SIZE +0 \}
5592 . if !d$PAGE_NUM_FAM \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
5593 . if !d$PAGE_NUM_FT \{ .PAGENUM_FONT R \}
5594 . if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE +0 \}
5595 . if !r#PAGE_NUM_POS_SET \{ .PAGENUM_POS BOTTOM CENTER \}
5596 . ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
5597 . if \\n[#PAGE_NUM_HYPHENS]=0 \{ .PAGENUM_HYPHENS OFF \}
5598 . if \\n[#PAGE_NUM_HYPHENS]=1 \{ .PAGENUM_HYPHENS \}
5600 . el \{ .PAGENUM_HYPHENS \}
5601 . if !d$HEAD_QUAD \{ .HEAD_QUAD CENTER \}
5602 . if !r#HEAD_CAPS \{ .HEAD_CAPS \}
5603 . if !r#HEAD_UNDERLINE \{ .HEAD_UNDERLINE \}
5604 . if !d$SH_QUAD \{ .SUBHEAD_QUAD LEFT \}
5605 . if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
5606 . if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
5607 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
5609 . if !d$FN_FAM \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
5610 . if !d$FN_FT \{ .FOOTNOTE_FONT R \}
5611 . if !d$FN_QUAD \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD] \}
5612 . if !r#FN_RULE \{ .FOOTNOTE_RULE \}
5613 . if !r#FN_MARKERS \{ .FOOTNOTE_MARKERS \}
5614 . if \\n[#FN_MARKERS]=1 \{\
5615 . if !\\n[#FN_MARKER_STYLE] \{ .FOOTNOTE_MARKER_STYLE STAR \}
5617 . if !\\n[#EN_MARKER_STYLE] \{ .ENDNOTE_MARKER_STYLE NUMBER \}
5618 . if !d$EN_PN_STYLE \{ .ENDNOTES_PAGENUM_STYLE digit \}
5619 . if !d$EN_FAM \{ .ENDNOTE_FAMILY \\*[$DOC_FAM] \}
5620 . if !d$EN_FT \{ .ENDNOTE_FONT R \}
5621 . if !d$EN_QUAD \{ .ENDNOTE_QUAD \\*[$DOC_QUAD] \}
5622 . if !d$EN_STRING \{ .ENDNOTE_STRING "Endnotes" \}
5623 . if !d$EN_STRING_FAM \{ .ENDNOTE_STRING_FAMILY \\*[$EN_FAM] \}
5624 . if !d$EN_STRING_QUAD \{ .ENDNOTE_STRING_QUAD CENTER \}
5625 . if !r#EN_STRING_UNDERLINE \{ .nr #EN_STRING_UNDERLINE 2 \}
5626 . if !r#EN_STRING_CAPS \{ .ENDNOTE_STRING_CAPS \}
5627 . if !d$EN_TITLE \{\
5628 . ie \\n[#DOC_TYPE]=2 \{\
5629 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
5630 . ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_TITLE]" \}
5631 . el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]" \}
5634 . ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
5635 . el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]" \}
5638 . el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
5640 . if !d$EN_TITLE_FAM \{ .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM] \}
5641 . if !d$EN_TITLE_QUAD \{ .ENDNOTE_TITLE_QUAD LEFT \}
5642 . if !r#EN_TITLE_UNDERLINE \{ .nr #EN_TITLE_UNDERLINE 1 \}
5643 . if !d$EN_NUMBER_FAM \{ .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] \}
5644 . if !d$EN_LN_FAM \{ .ENDNOTE_LINENUMBER_FAMILY \\*[$EN_FAM] \}
5645 . if !r#EN_NUMBERS_ALIGN_LEFT \{\
5646 . if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2 \}
5648 . if !d$EN_LN_GAP \{ .ENDNOTE_LINENUMBER_GAP 1.5n \}
5649 . if !r#EN_ALLOWS_HEADERS \{ .ENDNOTES_ALLOWS_HEADERS \}
5650 . if !d$BIB_PN_STYLE \{ .BIBLIOGRAPHY_PAGENUM_STYLE digit \}
5651 . if !d$BIB_FAM \{ .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM] \}
5652 . if !d$BIB_FT \{ .BIBLIOGRAPHY_FONT R \}
5653 . if !d$BIB_QUAD \{ .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD] \}
5654 . if !d$BIB_STRING \{ .BIBLIOGRAPHY_STRING "Bibliography" \}
5655 . if !d$BIB_STRING_FAM \{ .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FAM] \}
5656 . if !d$BIB_STRING_QUAD \{ .BIBLIOGRAPHY_STRING_QUAD CENTER \}
5657 . if !r#BIB_STRING_UNDERLINE \{ .nr #BIB_STRING_UNDERLINE 2 \}
5658 . if !r#BIB_STRING_CAPS \{ .BIBLIOGRAPHY_STRING_CAPS \}
5659 . if !d$TOC_HEADER_STRING \{ .TOC_HEADER_STRING "Contents" \}
5660 . if !d$TOC_HEADER_QUAD \{ .TOC_HEADER_QUAD LEFT \}
5661 . if !d$TOC_PN_STYLE \{ .TOC_PAGENUM_STYLE roman \}
5662 . if !r#TOC_PN_PADDING \{ .TOC_PADDING 3 \}
5663 . if !r#TOC_TITLE_INDENT \{ .TOC_TITLE_INDENT 0 \}
5664 .\" String defaults for both PRINTSTYLEs
5665 . ie \\n[#DOC_TYPE]=1 \{\
5666 . ie '\\*[$DOC_TITLE]'' \{\
5667 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5668 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
5671 . if \\n[#COPY_STYLE]=1 \{ .DRAFT_WITH_PAGENUMBER \}
5672 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5673 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 .ds $HDRFTR_CENTER \\*[$TITLE]
5674 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$DOC_TITLE]
5678 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5679 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
5681 . if !d$ATTRIBUTE_STRING .ds $ATTRIBUTE_STRING by
5682 . if !d$FINIS_STRING \{ .FINIS_STRING "End" \}
5683 . if !r#FINIS_STRING_CAPS \{ .nr #FINIS_STRING_CAPS 1 \}
5685 . if !r#DOC_COVERS_OFF \{ .nr #DOC_COVERS 1 \}
5686 . if !r#COVERS_OFF \{ .nr #COVERS 1 \}
5687 . if !d$COVER_COPYRIGHT_QUAD \{ .COVER_COPYRIGHT_QUAD R \}
5688 . if !d$COVER_MISC_QUAD \{ .COVER_MISC_QUAD L \}
5689 . if !d$DOC_COVER_COPYRIGHT_QUAD \{ .DOC_COVER_COPYRIGHT_QUAD R \}
5690 . if !d$DOC_COVER_MISC_QUAD \{ .DOC_COVER_MISC_QUAD L \}
5691 . if !r#DOCCOVER_UNDERLINE \{ .DOC_COVER_UNDERLINE \}
5692 . if !r#COVER_UNDERLINE \{ .COVER_UNDERLINE \}
5693 .\" Defaults for printstyle TYPEWRITE
5694 . if \\n[#PRINT_STYLE]=1 \{\
5695 . if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES \}
5696 . if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF \}
5697 .\" +Quotes and blockquotes
5698 . if !r#Q_OFFSET_VALUE \{\
5699 . if '\\*[$Q_OFFSET_VALUE]'' \{ .QUOTE_INDENT 2 \}
5702 . if !r#EPI_OFFSET_VALUE \{\
5703 . if '\\*[$EPI_OFFSET_VALUE]'' \{ .EPIGRAPH_INDENT 2 \}
5706 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 2p \}
5708 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE +0 \}
5709 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 2i \}
5710 .\" +Paragraph heads
5711 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
5713 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
5715 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 6p \}
5717 . if !r#SLANT_MEANS_SLANT \{\
5718 . ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
5719 . el \{ .UNDERLINE_SLANT OFF \}
5722 .\" Defaults for printstyle TYPESET
5723 . if \\n[#PRINT_STYLE]=2 \{\
5724 . if !d$DOCHEADER_LEAD_ADJ \{ .DOCHEADER_LEAD +0 \}
5726 . if !d$COVER_LEAD_ADJ \{ .COVER_LEAD +0 \}
5727 . if !d$COVER_FAM \{ .COVER_FAMILY \\*[$DOC_FAM] \}
5729 . if !d$COVER_TITLE_FAM \{\
5730 . ie !d$COVER_FAM \{ .COVER_TITLE_FAMILY \\*[$DOC_FAM] \}
5731 . el \{ .COVER_TITLE_FAMILY \\*[$COVER_FAM] \}
5733 . if !d$COVER_TITLE_FT \{ .COVER_TITLE_FONT B \}
5734 . if !d$COVER_TITLE_SIZE_CHANGE \{ .COVER_TITLE_SIZE +3.5 \}
5736 . if !d$COVER_CHAPTER_TITLE_FAM \{\
5737 . ie !d$COVER_FAM \{ .COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
5738 . el \{ .COVER_CHAPTER_TITLE_FAMILY \\*[$COVER_FAM] \}
5740 . if !d$COVER_CHAPTER_TITLE_FT \{ .COVER_CHAPTER_TITLE_FONT BI \}
5741 . if !d$COVER_CHAPTER_TITLE_SIZE_CHANGE \{ .COVER_CHAPTER_TITLE_SIZE +4 \}
5743 . if !d$COVER_SUBTITLE_FAM \{\
5744 . ie !d$COVER_FAM \{ .COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] \}
5745 . el \{ .COVER_SUBTITLE_FAMILY \\*[$COVER_FAM] \}
5747 . if !d$COVER_SUBTITLE_FT \{ .COVER_SUBTITLE_FONT R \}
5748 . if !d$COVER_SUBTITLE_SIZE_CHANGE \{ .COVER_SUBTITLE_SIZE +0 \}
5749 .\" (attribution and author[s])
5750 . if !d$COVER_AUTHOR_FAM \{\
5751 . ie !d$COVER_FAM \{ .COVER_AUTHOR_FAMILY \\*[$DOC_FAM] \}
5752 . el \{ .COVER_AUTHOR_FAMILY \\*[$COVER_FAM] \}
5754 . if !d$COVER_AUTHOR_FT \{ .COVER_AUTHOR_FONT I \}
5755 . if !d$COVER_AUTHOR_SIZE_CHANGE \{ .COVER_AUTHOR_SIZE +0 \}
5756 .\" (doctype if "named")
5757 . if !d$COVER_DOCTYPE_FAM \{\
5758 . ie !d$COVER_FAM \{ .COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] \}
5759 . el \{ .COVER_DOCTYPE_FAMILY \\*[$COVER_FAM] \}
5761 . if !d$COVER_DOCTYPE_FT \{ .COVER_DOCTYPE_FONT BI \}
5762 . if !d$COVER_DOCTYPE_SIZE_CHANGE \{ .COVER_DOCTYPE_SIZE +3 \}
5764 . if !d$COVER_COPYRIGHT_FAM \{\
5765 . ie !d$COVER_FAM \{ .COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] \}
5766 . el \{ .COVER_COPYRIGHT_FAMILY \\*[$COVER_FAM] \}
5768 . if !d$COVER_COPYRIGHT_FT \{ .COVER_COPYRIGHT_FONT R \}
5769 . if !d$COVER_COPYRIGHT_SIZE_CHANGE \{ .COVER_COPYRIGHT_SIZE -2 \}
5771 . if !d$DOC_COVER_LEAD_ADJ \{ .DOC_COVER_LEAD +0 \}
5772 . if !d$DOC_COVER_FAM \{ .DOC_COVER_FAMILY \\*[$DOC_FAM] \}
5774 . if !d$DOC_COVER_TITLE_FAM \{\
5775 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_TITLE_FAMILY \\*[$DOC_FAM] \}
5776 . el \{ .DOC_COVER_TITLE_FAMILY \\*[$DOC_COVER_FAM] \}
5778 . if !d$DOC_COVER_TITLE_FT \{ .DOC_COVER_TITLE_FONT B \}
5779 . if !d$DOC_COVER_TITLE_SIZE_CHANGE \{ .DOC_COVER_TITLE_SIZE +3.5 \}
5781 . if !d$DOC_COVER_CHAPTER_TITLE_FAM \{\
5782 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
5783 . el \{ .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_COVER_FAM] \}
5785 . if !d$DOC_COVER_CHAPTER_TITLE_FT \{ .DOC_COVER_CHAPTER_TITLE_FONT BI \}
5786 . if !d$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \{ .DOC_COVER_CHAPTER_TITLE_SIZE +4 \}
5788 . if !d$DOC_COVER_SUBTITLE_FAM \{\
5789 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] \}
5790 . el \{ .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_COVER_FAM] \}
5792 . if !d$DOC_COVER_SUBTITLE_FT \{ .DOC_COVER_SUBTITLE_FONT R \}
5793 . if !d$DOC_COVER_SUBTITLE_SIZE_CHANGE \{ .DOC_COVER_SUBTITLE_SIZE +0 \}
5794 .\" (attribution and author[s])
5795 . if !d$DOC_COVER_AUTHOR_FAM \{\
5796 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_FAM] \}
5797 . el \{ .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_COVER_FAM] \}
5799 . if !d$DOC_COVER_AUTHOR_FT \{ .DOC_COVER_AUTHOR_FONT I \}
5800 . if !d$DOC_COVER_AUTHOR_SIZE_CHANGE \{ .DOC_COVER_AUTHOR_SIZE +0 \}
5801 .\" (doctype if "named")
5802 . if !d$DOC_COVER_DOCTYPE_FAM \{\
5803 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] \}
5804 . el \{ .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_COVER_FAM] \}
5806 . if !d$DOC_COVER_DOCTYPE_FT \{ .DOC_COVER_DOCTYPE_FONT BI \}
5807 . if !d$DOC_COVER_DOCTYPE_SIZE_CHANGE \{ .DOC_COVER_DOCTYPE_SIZE +3 \}
5809 . if !d$DOC_COVER_COPYRIGHT_FAM \{\
5810 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] \}
5811 . el \{ .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_COVER_FAM] \}
5813 . if !d$DOC_COVER_COPYRIGHT_FT \{ .DOC_COVER_COPYRIGHT_FONT R \}
5814 . if !d$DOC_COVER_COPYRIGHT_SIZE_CHANGE \{ .DOC_COVER_COPYRIGHT_SIZE -2 \}
5816 . if !d$DOCHEADER_FAM \{ .DOCHEADER_FAMILY \\*[$DOC_FAM] \}
5817 . if !d$TITLE_FAM \{\
5818 . ie !d$DOCHEADER_FAM \{ .TITLE_FAMILY \\*[$DOC_FAM] \}
5819 . el \{ .TITLE_FAMILY \\*[$DOCHEADER_FAM] \}
5821 . if !d$TITLE_FT \{ .TITLE_FONT B \}
5822 . if !d$TITLE_SIZE_CHANGE \{\
5823 . ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
5824 . el \{ .TITLE_SIZE +3.5 \}
5826 . if !d$CHAPTER_TITLE_FAM \{\
5827 . ie !d$DOCHEADER_FAM \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
5828 . el \{ .CHAPTER_TITLE_FAMILY \\*[$DOCHEADER_FAM] \}
5830 . if !d$CHAPTER_TITLE_FT \{ .CHAPTER_TITLE_FONT BI \}
5831 . if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE +4 \}
5832 . if !d$SUBTITLE_FAM \{\
5833 . ie !d$DOCHEADER_FAM \{ .SUBTITLE_FAMILY \\*[$DOC_FAM] \}
5834 . el \{ .SUBTITLE_FAMILY \\*[$DOCHEADER_FAM] \}
5836 . if !d$SUBTITLE_FT \{ .SUBTITLE_FONT R \}
5837 . if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE +0 \}
5838 . if !d$AUTHOR_FAM \{\
5839 . ie !d$DOCHEADER_FAM \{ .AUTHOR_FAMILY \\*[$DOC_FAM] \}
5840 . el \{ .AUTHOR_FAMILY \\*[$DOCHEADER_FAM] \}
5842 . if !d$AUTHOR_FT \{ .AUTHOR_FONT I \}
5843 . if !d$AUTHOR_SIZE_CHANGE \{ .AUTHOR_SIZE +0 \}
5844 . if !d$DOCTYPE_FAM \{\
5845 . ie !d$DOCHEADER_FAM \{ .DOCTYPE_FAMILY \\*[$DOC_FAM] \}
5846 . el \{ .DOCTYPE_FAMILY \\*[$DOCHEADER_FAM] \}
5848 . if !d$DOCTYPE_FT \{ .DOCTYPE_FONT BI \}
5849 . if !d$DOCTYPE_SIZE_CHANGE \{ .DOCTYPE_SIZE +3 \}
5850 . if !r#DOCTYPE_UNDERLINE \{ .DOCTYPE_UNDERLINE \}
5851 .\" +Headers and footers
5852 . if !d$HDRFTR_LEFT_FAM \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
5853 . if !d$HDRFTR_LEFT_FT \{ .HDRFTR_LEFT_FONT R \}
5854 . if \\n[#HDRFTR_LEFT_CAPS] \{\
5855 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -2 \}
5857 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -.5 \}
5858 . if !d$HDRFTR_CENTER_FAM \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
5859 . if !d$HDRFTR_CENTER_FT \{ .HDRFTR_CENTER_FONT I \}
5860 . if \\n[#HDRFTR_CENTER_CAPS] \{\
5861 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
5863 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5 \}
5864 . if !d$HDRFTR_RIGHT_FAM \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] \}
5865 . if !d$HDRFTR_RIGHT_FT \{ .HDRFTR_RIGHT_FONT R \}
5866 . if \\n[#HDRFTR_RIGHT_CAPS] \{\
5867 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
5869 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -.5 \}
5871 . if !d$HEAD_FAM \{ .HEAD_FAMILY \\*[$DOC_FAM] \}
5872 . if !d$HEAD_FT \{ .HEAD_FONT B \}
5873 . if !d$HEAD_SIZE_CHANGE \{ .HEAD_SIZE +1 \}
5874 . if !r#HEAD_SPACE \{ .HEAD_SPACE \}
5876 . if !d$SH_FAM \{ .SUBHEAD_FAMILY \\*[$DOC_FAM] \}
5877 . if !d$SH_FT \{ .SUBHEAD_FONT B \}
5878 . if !d$SH_SIZE_CHANGE \{ .SUBHEAD_SIZE +.5 \}
5879 .\" +Paragraph heads
5880 . if !d$PH_FAM \{ .PARAHEAD_FAMILY \\*[$DOC_FAM] \}
5881 . if !d$PH_FT \{ .PARAHEAD_FONT BI \}
5882 . if !d$PH_SIZE_CHANGE \{ .PARAHEAD_SIZE -.25 \}
5883 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
5885 . if !d$QUOTE_FAM \{ .QUOTE_FAMILY \\*[$DOC_FAM] \}
5886 . if !d$QUOTE_FT \{ .QUOTE_FONT I \}
5887 . if !d$QUOTE_SIZE_CHANGE \{ .QUOTE_SIZE +0 \}
5888 . if !r#Q_OFFSET_VALUE \{\
5889 . if '\\*[$Q_OFFSET_VALUE]'' \{ .QUOTE_INDENT 3 \}
5892 .\" Note: the leading for quotes and blockquotes is set after .DEFAULTS in START
5893 . if !d$BQUOTE_FAM \{ .BLOCKQUOTE_FAMILY \\*[$DOC_FAM] \}
5894 . if !d$BQUOTE_FT \{ .BLOCKQUOTE_FONT R \}
5895 . if !d$BQUOTE_SIZE_CHANGE \{ .BLOCKQUOTE_SIZE -1 \}
5896 . if !d$BQUOTE_QUAD \{ .BLOCKQUOTE_QUAD LEFT \}
5898 . if !d$EPI_FAM \{ .EPIGRAPH_FAMILY \\*[$DOC_FAM] \}
5899 . if !d$EPI_FT \{ .EPIGRAPH_FONT R \}
5900 . if !d$EPI_SIZE_CHANGE \{ .EPIGRAPH_SIZE -1.5 \}
5901 . if !r#EPI_AUTOLEAD \{ .EPIGRAPH_AUTOLEAD 2 \}
5902 . if !d$EPI_QUAD \{ .EPIGRAPH_QUAD \\*[$DOC_QUAD] \}
5903 . if !r#EPI_OFFSET_VALUE \{\
5904 . if '\\*[$EPI_OFFSET_VALUE]'' \{ .EPIGRAPH_INDENT 3 \}
5907 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 3p \}
5908 . if !d$LINEBREAK_COLOR \{ .LINEBREAK_COLOR black \}
5910 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 4P \}
5911 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 3p \}
5912 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE -2 \}
5913 . if !r#FN_AUTOLEAD \{ .FOOTNOTE_AUTOLEAD 2 \}
5915 . if !r#EN_PS \{ .ENDNOTE_PT_SIZE (\\n[#DOC_PT_SIZE]u)\}
5916 . if !d$EN_STRING_FT \{ .ENDNOTE_STRING_FONT B \}
5917 . if !d$EN_STRING_SIZE_CHANGE \{ .ENDNOTE_STRING_SIZE +1 \}
5918 . if !d$EN_TITLE_FT \{ .ENDNOTE_TITLE_FONT B \}
5919 . if !d$EN_TITLE_SIZE_CHANGE \{ .ENDNOTE_TITLE_SIZE +0 \}
5920 . if !d$EN_NUMBER_FT \{ .ENDNOTE_NUMBER_FONT B \}
5921 . if !d$EN_LN_FT \{ .ENDNOTE_LINENUMBER_FONT R \}
5922 . if !d$EN_NUMBER_SIZE_CHANGE \{ .ENDNOTE_NUMBER_SIZE +0 \}
5923 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT 1.5m \}
5925 . if !r#BIB_LIST \{ .BIBLIOGRAPHY_TYPE LIST . \}
5926 . if !r#BIB_PS \{ .BIBLIOGRAPHY_PT_SIZE (\\n[#DOC_PT_SIZE]u) \}
5927 . if !d$BIB_STRING_FT \{ .BIBLIOGRAPHY_STRING_FONT B \}
5928 . if !d$BIB_STRING_SIZE_CHANGE \{ .BIBLIOGRAPHY_STRING_SIZE +1 \}
5929 .\" +Table of contents
5930 . if !d$TOC_FAM \{ .TOC_FAMILY \\*[$DOC_FAM] \}
5931 . if !r#TOC_PS \{ .TOC_PT_SIZE (\\n[#DOC_PT_SIZE]u) \}
5932 . if !r#TOC_LEAD \{ .TOC_LEAD \\n[#DOC_LEAD]u ADJUST \}
5933 . if !d$TOC_HEADER_FAM \{ .TOC_HEADER_FAMILY \\*[$TOC_FAM] \}
5934 . if !d$TOC_HEADER_SIZE_CHANGE \{ .TOC_HEADER_SIZE +4 \}
5935 . if !d$TOC_HEADER_FT \{ .TOC_HEADER_FONT B \}
5936 . if !d$TOC_TITLE_FAM \{ .TOC_TITLE_FAMILY \\*[$TOC_FAM] \}
5937 . if !d$TOC_PN_FAM \{ .TOC_PN_FAMILY \\*[$TOC_FAM] \}
5938 . if !d$TOC_HEAD_FAM \{ .TOC_HEAD_FAMILY \\*[$TOC_FAM] \}
5939 . if !d$TOC_SH_FAM \{ .TOC_SUBHEAD_FAMILY \\*[$TOC_FAM] \}
5940 . if !d$TOC_PH_FAM \{ .TOC_PARAHEAD_FAMILY \\*[$TOC_FAM] \}
5941 . if !d$TOC_TITLE_FT \{ .TOC_TITLE_FONT BI \}
5942 . if !d$TOC_PN_FT \{ .TOC_PN_FONT R \}
5943 . if !d$TOC_HEAD_FT \{ .TOC_HEAD_FONT B \}
5944 . if !d$TOC_SH_FT \{ .TOC_SUBHEAD_FONT R \}
5945 . if !d$TOC_PH_FT \{ .TOC_PARAHEAD_FONT I \}
5946 . if !d$TOC_TITLE_SIZE_CHANGE \{ .TOC_TITLE_SIZE +.5 \}
5947 . if !d$TOC_PN_SIZE_CHANGE \{ .TOC_PN_SIZE +0 \}
5948 . if !d$TOC_HEAD_SIZE_CHANGE \{ .TOC_HEAD_SIZE +.5 \}
5949 . if !d$TOC_SH_SIZE_CHANGE \{ .TOC_SUBHEAD_SIZE +0 \}
5950 . if !d$TOC_PH_SIZE_CHANGE \{ .TOC_PARAHEAD_SIZE +0 \}
5951 . ps \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
5952 . if !r#TOC_HEAD_INDENT \{ .TOC_HEAD_INDENT \w'\0\0.' \}
5954 . ps \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
5955 . if !r#TOC_SH_INDENT \{ .TOC_SUBHEAD_INDENT \\n[#TOC_HEAD_INDENT]+\w'\0\0.' \}
5957 . ps \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
5958 . if !r#TOC_PH_INDENT \{ .TOC_PARAHEAD_INDENT \\n[#TOC_SH_INDENT]+\w'\0\0.' \}
5962 . if !r#EN_REF \{ .nr #FN_REF 1 \}
5963 . if '\\*[$REF_FN_INDENT]'' \{\
5964 . if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS FOOTNOTE 2m \}
5965 . if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS FOOTNOTE 1.5m \}
5967 . if '\\*[$REF_EN_INDENT]'' \{\
5968 . if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS ENDNOTE 2m \}
5969 . if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS ENDNOTE 1.5m \}
5971 . if '\\*[$REF_BIB_INDENT]'' \{\
5972 . if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS BIBLIO 2m \}
5973 . if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS BIBLIO 1.5m :\}
5975 .\" Adjust doc leading for PRINTSTYLE TYPESET
5976 . if \\n[#PRINT_STYLE]=2 \{\
5977 . ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
5980 .\" This diversion is to get a value for #FN_AUTOLEAD
5983 . if \\n[#PRINT_STYLE]=1 \{\
5985 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
5986 . el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
5988 . if \\n[#PRINT_STYLE]=2 \{\
5989 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
5990 . AUTOLEAD \\n[#FN_AUTOLEAD]
5992 . nr #FN_LEAD \\n[#LEAD]
5993 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u \}
5996 . ie !\\n[#COLLATE] \{\
5997 .\" DOC_LEAD adjusted (or not) here
5999 .\" Endnote, bibliography and toc leading
6000 . nr #OK_PROCESS_LEAD 1
6001 . nr #RESTORE_DOC_LEAD \\n(.v
6002 . nr #RESTORE_B_MARGIN \\n[#B_MARGIN]
6003 . if \\n[#PRINT_STYLE]=1 \{\
6004 . ie \\n[#SINGLE_SPACE] \{\
6005 . ENDNOTE_LEAD 12 ADJUST
6006 . BIBLIOGRAPHY_LEAD 12 ADJUST
6009 . ie \\n[#EN_SINGLESPACE] \{ .ENDNOTE_LEAD 12 ADJUST \}
6010 . el \{ .ENDNOTE_LEAD 24 ADJUST \}
6011 . ie \\n[#BIB_SINGLESPACE] \{ .BIBLIOGRAPHY_LEAD 12 ADJUST \}
6012 . el \{ .BIBLIOGRAPHY_LEAD 24 ADJUST \}
6015 . if \\n[#PRINT_STYLE]=2 \{\
6016 . ie !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
6017 . el \{ .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] \}
6018 . ie !d$BIB_LEAD \{ .BIBLIOGRAPHY_LEAD 14 ADJUST \}
6019 . el \{ .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD] \}
6020 . ie !d$TOC_LEAD \{ .TOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
6021 . el \{ .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] \}
6022 . rm $ADJUST_EN_LEAD
6023 . rm $ADJUST_BIB_LEAD
6024 . rm $ADJUST_TOC_LEAD
6026 . ie !d$BIB_SPACE \{ .BIBLIOGRAPHY_SPACING 1v \}
6028 . if \\n[#DEFER_BIB_SPACING]=1 \{\
6029 . BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE]
6030 . rr #DEFER_BIB_SPACING
6033 . DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
6034 . nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
6037 . if \\n[#COLLATE] \{\
6038 . if !\\n[#PRINT_STYLE]=1 \{\
6039 . if \\n[#RERUN_TRAPS] \{ .TRAPS \}
6043 . if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
6046 \# ====================================================================
6048 \# +++START THE DOCUMENT+++
6055 \# Reads in default document style parameters and any parameter
6056 \# the user has changed before issuing START.
6057 \# Using the information gathered in the opening macros,
6058 \# prints appropriate title (or chapter #), subtitle, author
6059 \# and document type (if appropriate).
6061 \# The .PRINT \& (zero-width character) is required to get the
6062 \# subsequent .sp request to work as advertised.
6064 \# The overall document line length, family, and point-size
6065 \# are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
6066 \# use in the HEADER and FOOTER macros.
6068 \# First, define some strings for point sizes
6071 .ds $DOC_COVER_AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_AUTHOR_SIZE_CHANGE]
6072 .ds $DOC_COVER_CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE]
6073 .ds $DOC_COVER_COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_COPYRIGHT_SIZE_CHANGE]
6074 .ds $DOC_COVER_DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_DOCTYPE_SIZE_CHANGE]
6075 .ds $DOC_COVER_SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_SUBTITLE_SIZE_CHANGE]
6076 .ds $DOC_COVER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_TITLE_SIZE_CHANGE]
6078 .ds $COVER_AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_AUTHOR_SIZE_CHANGE]
6079 .ds $COVER_CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_CHAPTER_TITLE_SIZE_CHANGE]
6080 .ds $COVER_COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_COPYRIGHT_SIZE_CHANGE]
6081 .ds $COVER_DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_DOCTYPE_SIZE_CHANGE]
6082 .ds $COVER_SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_SUBTITLE_SIZE_CHANGE]
6083 .ds $COVER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_TITLE_SIZE_CHANGE]
6085 .ds $AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
6086 .ds $CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
6087 .ds $COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COPYRIGHT_SIZE_CHANGE]
6088 .ds $DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
6089 .ds $SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
6090 .ds $TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
6092 \# Next, some utility macros for various routines to prevent repetition
6094 . if '\\$1'DOC_COVER' \{\
6096 . nr #AUTHOR_DOCCOVER_NUM 0 1
6097 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_DOCCOVER_NUM] \{\
6098 . ds $AUTHOR_DOCCOVER_\\n+[#AUTHOR_DOCCOVER_NUM] \\$\\n[#AUTHOR_DOCCOVER_NUM]
6102 . if '\\$1'COVER' \{\
6104 . nr #AUTHOR_COVER_NUM 0 1
6105 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_COVER_NUM] \{\
6106 . ds $AUTHOR_COVER_\\n+[#AUTHOR_COVER_NUM] \\$\\n[#AUTHOR_COVER_NUM]
6111 .MAC PRINT_AUTHORS END
6112 . ie r#DOING_COVER \{\
6113 . if \\n[#DOC_COVER]=1 \{\
6114 . ie !'\\*[$AUTHOR_DOCCOVER_1]'' \{\
6115 . nr #AUTHORS \\n[#AUTHOR_DOCCOVER_NUM]
6116 . nr #NEXT_AUTHOR 0 1
6117 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6118 . ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \{\
6119 . PRINT \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_DOCCOVER_\\n+[#NEXT_AUTHOR]]\m[]
6121 . el \{ .PRINT \\*[$AUTHOR_DOCCOVER_\\n+[#NEXT_AUTHOR]] \}
6125 . nr #AUTHORS \\n[#AUTHOR_NUM]
6126 . nr #NEXT_AUTHOR 0 1
6127 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6128 . ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \{\
6129 . PRINT \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6131 . el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
6136 . if \\n[#COVER]=1 \{\
6137 . ie !'\\*[$AUTHOR_COVER_1]'' \{\
6138 . nr #AUTHORS \\n[#AUTHOR_COVER_NUM]
6139 . nr #NEXT_AUTHOR 0 1
6140 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6141 . ie \\n[#COVER_AUTHOR_COLOR]=1 \{\
6142 . PRINT \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_COVER_\\n+[#NEXT_AUTHOR]]\m[]
6144 . el \{ .PRINT \\*[$AUTHOR_COVER_\\n+[#NEXT_AUTHOR]] \}
6148 . nr #AUTHORS \\n[#AUTHOR_NUM]
6149 . nr #NEXT_AUTHOR 0 1
6150 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6151 . ie \\n[#COVER_AUTHOR_COLOR]=1 \{\
6152 . PRINT \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6154 . el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
6161 . nr #AUTHORS \\n[#AUTHOR_NUM]
6162 . nr #NEXT_AUTHOR 0 1
6163 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6164 . ie \\n[#AUTHOR_COLOR]=1 \{\
6165 . PRINT \m[\\*[$AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6167 . el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
6172 .MAC DEFAULT_DOCHEADER END
6173 . if !'\\*[$TITLE_1]'' \{\
6175 . FAMILY \\*[$TITLE_FAM]
6177 . PT_SIZE \\*[$TITLE_PT_SIZE]
6178 . LS \\n[#DOCHEADER_LEAD]u
6180 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6181 . ie \\n[#TITLE_COLOR]=1 \{\
6182 . PRINT "\m[\\*[$TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6185 . PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6189 . if !'\\*[$SUBTITLE_1]'' \{\
6190 . FAMILY \\*[$SUBTITLE_FAM]
6191 . FT \\*[$SUBTITLE_FT]
6192 . PT_SIZE \\*[$SUBTITLE_PT_SIZE]
6194 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6195 . ie \\n[#SUBTITLE_COLOR]=1 \{\
6196 . PRINT "\m[\\*[$SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n[#ARG_NUM]]\m[]
6199 . PRINT "\\*[$SUBTITLE_\\n[#ARG_NUM]]
6203 . if !'\\*[$AUTHOR_1]'' \{\
6204 . FAMILY \\*[$AUTHOR_FAM]
6205 . FT \\*[$AUTHOR_FT]
6206 . PT_SIZE \\*[$AUTHOR_PT_SIZE]
6207 . ie \\n[#ATTRIBUTE_COLOR]=1 \{\
6208 . PRINT \&\m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
6210 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING] \}
6213 . FAMILY \\*[$DOC_FAM]
6218 .MAC CHAPTER_DOCHEADER END
6220 . FAMILY \\*[$TITLE_FAM]
6222 . PT_SIZE \\*[$TITLE_PT_SIZE]
6223 . LS \\n[#DOCHEADER_LEAD]u
6224 .\" Chapter title only
6225 . ie '\\*[$CHAPTER]'' \{\
6226 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
6227 . if \\n[#PRINT_STYLE]=2 \{\
6228 . FAMILY \\*[$CHAPTER_TITLE_FAM]
6229 . FT \\*[$CHAPTER_TITLE_FT]
6230 . PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
6231 . LS \\n[#DOCHEADER_LEAD]u
6234 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6235 . ie \\n[#TITLE_COLOR]=1 \{\
6236 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6238 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
6242 . ie \\n[#TITLE_COLOR]=1 \{\
6243 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING]\m[]
6245 . el \{ .PRINT \\*[$CHAPTER_STRING] \}
6248 .\" Chapter string, possibly with a chapter title
6250 . ie \\n[#TITLE_COLOR]=1 \{\
6251 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6253 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
6254 . if !'\\*[$CHAPTER_TITLE_1]'' \{\
6255 . if \\n[#PRINT_STYLE]=2 \{\
6256 . FAMILY \\*[$CHAPTER_TITLE_FAM]
6257 . FT \\*[$CHAPTER_TITLE_FT]
6258 . PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
6259 . LS \\n[#DOCHEADER_LEAD]u
6260 . ALD \\n[.v]u/4u \"Put a little space before the chapter title
6263 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6264 . ie \\n[#CHAPTER_TITLE_COLOR]=1 \{\
6265 . PRINT \m[\\*[$CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6267 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
6269 . RLD \\n[#DOC_LEAD]u \" Just looks better this way
6272 . FAMILY \\*[$DOC_FAM]
6277 .MAC NAMED_DOCHEADER END
6279 . FAMILY \\*[$TITLE_FAM]
6281 . PT_SIZE \\*[$TITLE_PT_SIZE]
6282 . LS \\n[#DOCHEADER_LEAD]u
6283 . if !'\\*[$TITLE_1]'' \{\
6285 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6286 . ie \\n[#TITLE_COLOR]=1 \{\
6287 . PRINT "\m[\\*[$TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6290 . PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6294 . if !'\\*[$SUBTITLE]'' \{\
6295 . FAMILY \\*[$SUBTITLE_FAM]
6296 . FT \\*[$SUBTITLE_FT]
6297 . PT_SIZE \\*[$SUBTITLE_PT_SIZE]
6299 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6300 . ie \\n[#SUBTITLE_COLOR]=1 \{\
6301 . PRINT "\m[\\*[$SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n[#ARG_NUM]]\m[]
6304 . PRINT "\\*[$SUBTITLE_\\n[#ARG_NUM]]
6308 . if !'\\*[$AUTHOR_1]'' \{\
6309 . FAMILY \\*[$AUTHOR_FAM]
6310 . FT \\*[$AUTHOR_FT]
6311 . PT_SIZE \\*[$AUTHOR_PT_SIZE]
6312 . ie \\n[#ATTRIBUTE_COLOR]=1 \{\
6313 . PRINT \&\m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
6315 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING] \}
6318 . FAMILY \\*[$DOCTYPE_FAM]
6319 . FT \\*[$DOCTYPE_FT]
6320 . PT_SIZE \\*[$DOCTYPE_PT_SIZE]
6321 . LS \\n[#DOCHEADER_LEAD]u
6322 . ALD \\n[#DOCHEADER_LEAD]u
6323 . nr #FROM_DOCTYPE 1
6324 . if \\n[#DOCTYPE_COLOR]=1 \{\
6325 . COLOR \\*[$DOCTYPE_COLOR]
6327 . ie \\n[#DOCTYPE_UNDERLINE]=1 \{\
6328 . UNDERSCORE \\*[$DOCTYPE_UNDERLINE_GAP] "\\*[$DOC_TYPE]"
6331 . PRINT "\\*[$DOC_TYPE]"
6334 . FAMILY \\*[$DOC_FAM]
6343 \# TITLE | DOCTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE | COVERTITLE ...
6344 \# ... [ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC BLANKPAGE ]
6346 \# Toggles the number register for each cover page element
6347 \# passed as an argument.
6349 \# TITLE, DOCTITLE, CHAPTER, CHAPTER_TITLE or CHAPTER+TITLE must
6350 \# be supplied. After that, users may enter as many or as few of
6351 \# the arguments as they like; however, the arguments must appear
6352 \# in the order given above. BLANKPAGE, as the final argument,
6353 \# inserts a blank page after the cover.
6355 \# If called as DOC_COVER, performs the same operations, but
6356 \# applies everything to a doc cover.
6359 . ie '\\$0'DOC_COVER' \{\
6360 . if '\\$\\n[#NUM_ARGS]'BLANKPAGE' \{ .nr #DOCCOVER_BLANKPAGE 1 \}
6362 . if '\\$1'TITLE' \{ .nr #DOC_COVER_TITLE 1 \}
6363 . if '\\$1'DOCTITLE' \{ .nr #DOC_COVER_TITLE 2 \}
6364 . if '\\$1'CHAPTER' \{ .nr #DOC_COVER_TITLE 3 \}
6365 . if '\\$1'CHAPTER_TITLE' \{ .nr #DOC_COVER_TITLE 4 \}
6366 . if '\\$1'CHAPTER+TITLE' \{ .nr #DOC_COVER_TITLE 5 \}
6367 . if '\\$1'COVERTITLE' \{ .nr #DOC_COVER_TITLE 6 \}
6368 . if '\\$2'SUBTITLE' \{ .nr #DOC_COVER_SUBTITLE 1 \}
6369 . if '\\$2'AUTHOR' \{ .nr #DOC_COVER_AUTHOR 1 \}
6370 . if '\\$2'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
6371 . if '\\$2'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
6372 . if '\\$2'MISC' \{ .nr #DOC_COVER_MISC 1 \}
6373 . if '\\$3'AUTHOR' \{ .nr #DOC_COVER_AUTHOR 1 \}
6374 . if '\\$3'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
6375 . if '\\$3'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
6376 . if '\\$3'MISC' \{ .nr #DOC_COVER_MISC 1 \}
6377 . if '\\$4'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
6378 . if '\\$4'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
6379 . if '\\$4'MISC' \{ .nr #DOC_COVER_MISC 1 \}
6380 . if '\\$5'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
6381 . if '\\$5'MISC' \{ .nr #DOC_COVER_MISC 1 \}
6382 . if '\\$6'MISC' \{ .nr #DOC_COVER_MISC 1 \}
6385 . if '\\$\\n[#NUM_ARGS]'BLANKPAGE' \{ .nr #COVER_BLANKPAGE 1 \}
6387 . if '\\$1'TITLE' \{ .nr #COVER_TITLE 1 \}
6388 . if '\\$1'DOCTITLE' \{ .nr #COVER_TITLE 2 \}
6389 . if '\\$1'CHAPTER' \{ .nr #COVER_TITLE 3 \}
6390 . if '\\$1'CHAPTER_TITLE' \{ .nr #COVER_TITLE 4 \}
6391 . if '\\$1'CHAPTER+TITLE' \{ .nr #COVER_TITLE 5 \}
6392 . if '\\$1'COVERTITLE' \{ .nr #COVER_TITLE 6 \}
6393 . if '\\$2'SUBTITLE' \{ .nr #COVER_SUBTITLE 1 \}
6394 . if '\\$2'AUTHOR' \{ .nr #COVER_AUTHOR 1 \}
6395 . if '\\$2'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
6396 . if '\\$2'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
6397 . if '\\$2'MISC' \{ .nr #COVER_MISC 1 \}
6398 . if '\\$3'AUTHOR' \{ .nr #COVER_AUTHOR 1 \}
6399 . if '\\$3'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
6400 . if '\\$3'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
6401 . if '\\$3'MISC' \{ .nr #COVER_MISC 1 \}
6402 . if '\\$4'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
6403 . if '\\$4'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
6404 . if '\\$4'MISC' \{ .nr #COVER_MISC 1 \}
6405 . if '\\$5'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
6406 . if '\\$5'MISC' \{ .nr #COVER_MISC 1 \}
6407 . if '\\$6'MISC' \{ .nr #COVER_MISC 1 \}
6413 . ie '\\$0'DOC_COVERTITLE' \{\
6414 . ie \\n[#NUM_ARGS]=0 \{\
6415 . if \\n[#DOC_COVER_TITLE_NUM] \{\
6417 . while \\n[#DOC_COVER_TITLE_NUM]>\\n[#ITEM] \{\
6418 . rm $DOC_COVER_TITLE_\\n+[#ITEM]
6420 . rr #DOC_COVER_TITLE_NUM
6421 . rm $DOC_COVER_TITLE
6425 . nr #DOC_COVER_TITLE_NUM 0 1
6426 . while \\n[#NUM_ARGS]>\\n[#DOC_COVER_TITLE_NUM] \{\
6427 . ds $DOC_COVER_TITLE_\\n+[#DOC_COVER_TITLE_NUM] \\$\\n[#DOC_COVER_TITLE_NUM]
6429 . ds $DOC_COVER_TITLE \\$*
6433 . ie \\n[#NUM_ARGS]=0 \{\
6434 . if \\n[#COVER_TITLE_NUM] \{\
6436 . while \\n[#COVER_TITLE_NUM]>\\n[#ITEM] \{\
6437 . rm $COVER_TITLE_\\n+[#ITEM]
6439 . rr #COVER_TITLE_NUM
6444 . nr #COVER_TITLE_NUM 0 1
6445 . while \\n[#NUM_ARGS]>\\n[#COVER_TITLE_NUM] \{\
6446 . ds $COVER_TITLE_\\n+[#COVER_TITLE_NUM] \\$\\n[#COVER_TITLE_NUM]
6448 . ds $COVER_TITLE \\$*
6454 \# COVER PAGE LEADING
6455 \# ------------------
6457 \# <+|- amount by which to in/decrease leading of cover/doc cover>
6459 \# Stores user supplied lead in/decrease in string $COVER_LEAD_ADJ
6460 \# or $DOC_COVER_LEAD_ADJ, depending on whether the macro was called
6461 \# with an alias (DOC_COVER_LEAD).
6463 \# A unit of measure must be supplied. Decimal fractions OK.
6464 \# Default is +0, i.e. same as DOC_LEAD.
6467 . ie '\\$0'DOC_COVER_LEAD' \{\
6468 . ds $DOC_COVER_LEAD_ADJ \\$1
6471 . ds $COVER_LEAD_ADJ \\$1
6476 \# COVER PAGE START POSITION
6477 \# -------------------------
6479 \# <distance from page top at which to start cover/doc cover>
6481 \# Stores user supplied lead in/decrease in #COVER_START_POS
6482 \# or #DOC_COVER_START_POS, depending on whether the macro was
6483 \# called by an alias (DOC_COVER_ADVANCE).
6485 \# A unit of measure must be supplied. Decimal fractions OK.
6486 \# If user doesn't invoke this macro, the default starting
6487 \# position for both covers and doc covers is 1/3 of the way
6488 \# down the page (setup in DO_COVER).
6490 .MAC COVER_ADVANCE END
6491 . ie '\\$0'DOC_COVER_ADVANCE' \{\
6492 . nr #DOC_COVER_START_POS (\\$1)
6495 . nr #COVER_START_POS (\\$1)
6500 \# UNDERLINE CONTROL
6501 \# -----------------
6503 \# [ DOUBLE ] [ <underline weight> [<underline gap>] ] | <none> | <anything>
6505 \# Toggles underlining of the element indicated by the calling alias
6506 \# on or off. Uses #<element>_UNDERLINE_WEIGHT to set the weight,
6507 \# and defines string $<element>_UNDERLINE_GAP.
6509 \# Calling aliases COVER_ and DOCCOVER_ only apply if DOCTYPE is
6510 \# NAMED and the DOCTYPE arg is passed to COVER or DOC_COVER.
6514 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{ .nr #BIB_STRING_UNDERLINE 1 \}
6515 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{ .nr #BIB_STRING_UNDERLINE 1 \}
6516 . if '\\$0'COVER_UNDERLINE' \{ .nr #COVER_UNDERLINE 1 \}
6517 . if '\\$0'DOC_COVER_UNDERLINE' \{ .nr #DOCCOVER_UNDERLINE 1 \}
6518 . if '\\$0'DOCTYPE_UNDERLINE' \{ .nr #DOCTYPE_UNDERLINE 1 \}
6519 . if '\\$0'HEAD_UNDERLINE' \{ .nr #HEAD_UNDERLINE 1 \}
6520 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{ .nr #EN_STRING_UNDERLINE 1 \}
6521 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{ .nr #EN_STRING_UNDERLINE 1 \}
6522 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{ .nr #EN_TITLE_UNDERLINE 1 \}
6523 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{ .nr #EN_TITLE_UNDERLINE 1 \}
6526 . ie \\n[#NUM_ARGS]=1 \{\
6529 . ie \B'\\*[$ARG]' \{\
6530 . if !\\n[#PRINT_STYLE]=1 \{\
6531 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{ .BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1 \}
6532 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{ .BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1 \}
6533 . if '\\$0'COVER_UNDERLINE' \{ .COVER_UNDERLINE_WEIGHT \\$1 \}
6534 . if '\\$0'DOC_COVER_UNDERLINE' \{ .DOCCOVER_UNDERLINE_WEIGHT \\$1 \}
6535 . if '\\$0'DOCTYPE_UNDERLINE' \{ .DOCTYPE_UNDERLINE_WEIGHT \\$1 \}
6536 . if '\\$0'HEAD_UNDERLINE' \{ .HEAD_UNDERLINE_WEIGHT \\$1 \}
6537 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{ .ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1 \}
6538 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{ .ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1 \}
6539 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{ .ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1 \}
6540 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{ .ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1 \}
6544 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{\
6545 . ie '\\$1'DOUBLE' \{ .nr #BIB_STRING_UNDERLINE 2 \}
6546 . el \{ .nr #BIB_STRING_UNDERLINE 0 \}
6548 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{\
6549 . ie '\\$1'DOUBLE' \{ .nr #BIB_STRING_UNDERLINE 2 \}
6550 . el \{ .nr #BIB_STRING_UNDERLINE 0 \}
6552 . if '\\$0'COVER_UNDERLINE' \{ .nr #COVER_UNDERLINE 0 \}
6553 . if '\\$0'DOC_COVER_UNDERLINE' \{ .nr #DOCCOVER_UNDERLINE 0 \}
6554 . if '\\$0'DOCTYPE_UNDERLINE' \{ .nr #DOCTYPE_UNDERLINE 0 \}
6555 . if '\\$0'HEAD_UNDERLINE' \{ .nr #HEAD_UNDERLINE 0 \}
6556 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\
6557 . ie '\\$1'DOUBLE' \{ .nr #EN_STRING_UNDERLINE 2 \}
6558 . el \{ .nr #EN_STRING_UNDERLINE 0 \}
6560 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\
6561 . ie '\\$1'DOUBLE' \{ .nr #EN_STRING_UNDERLINE 2 \}
6562 . el \{ .nr #EN_STRING_UNDERLINE 0 \}
6567 . if !\\n[#PRINT_STYLE]=1 \{\
6568 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{\
6569 . nr #BIB_STRING_UNDERLINE 1
6570 . if '\\$1'DOUBLE' \{\
6571 . nr #BIB_STRING_UNDERLINE 2
6574 . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6576 . ds $BIB_STRING_UNDERLINE_GAP \\$2
6579 . ds $BIB_STRING_RULE_GAP \\$3
6582 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{\
6583 . nr #BIB_STRING_UNDERLINE 1
6584 . if '\\$1'DOUBLE' \{\
6585 . nr #BIB_STRING_UNDERLINE 2
6588 . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6590 . ds $BIB_STRING_UNDERLINE_GAP \\$2
6593 . ds $BIB_STRING_RULE_GAP \\$3
6596 . if '\\$0'COVER_UNDERLINE' \{\
6597 . nr #COVER_UNDERLINE 1
6598 . COVER_UNDERLINE_WEIGHT \\$1
6599 . ds $COVER_UNDERLINE_GAP \\$2
6601 . if '\\$0'DOC_COVER_UNDERLINE' \{\
6602 . nr #DOCCOVER_UNDERLINE 1
6603 . DOCCOVER_UNDERLINE_WEIGHT \\$1
6604 . ds $DOCCOVER_UNDERLINE_GAP \\$2
6606 . if '\\$0'DOCTYPE_UNDERLINE' \{\
6607 . nr #DOCTYPE_UNDERLINE 1
6608 . DOCTYPE_UNDERLINE_WEIGHT \\$1
6609 . ds $DOCTYPE_UNDERLINE_GAP \\$2
6611 . if '\\$0'HEAD_UNDERLINE' \{\
6612 . nr #HEAD_UNDERLINE 1
6613 . HEAD_UNDERLINE_WEIGHT \\$1
6614 . ds $HEAD_UNDERLINE_GAP \\$2
6616 \# ENDNOTE_STRING_UNDERLINE and ENDNOTE_STRING_UNDERSCORE are identical;
6617 \# the _UNDERSCORE version is left in for backward compatibility.
6618 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\
6619 . nr #EN_STRING_UNDERLINE 1
6620 . if '\\$1'DOUBLE' \{\
6621 . nr #EN_STRING_UNDERLINE 2
6624 . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6626 . ds $EN_STRING_UNDERLINE_GAP \\$2
6629 . ds $EN_STRING_RULE_GAP \\$3
6632 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\
6633 . nr #EN_STRING_UNDERLINE 1
6634 . if '\\$1'DOUBLE' \{\
6635 . nr #EN_STRING_UNDERLINE 2
6638 . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6640 . ds $EN_STRING_UNDERLINE_GAP \\$2
6643 . ds $EN_STRING_RULE_GAP \\$3
6646 \# ENDNOTE_TITLE_UNDERLINE and ENDNOTE_TITLE_UNDERSCORE are identical;
6647 \# the _UNDERSCORE version is left in for backward compatibility.
6648 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{\
6649 . nr #ENDNOTE_TITLE_UNDERLINE 1
6650 . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6651 . ds $EN_TITLE_UNDERLINE_GAP \\$2
6653 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{\
6654 . nr #ENDNOTE_TITLE_UNDERLINE 1
6655 . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6656 . ds $EN_TITLE_UNDERLINE_GAP \\$2
6663 .ALIAS BIBLIOGRAPHY_STRING_UNDERSCORE _UNDERLINE
6664 .ALIAS BIBLIOGRAPHY_STRING_UNDERLINE _UNDERLINE
6665 .ALIAS COVER_UNDERLINE _UNDERLINE
6666 .ALIAS DOC_COVER_UNDERLINE _UNDERLINE
6667 .ALIAS DOCTYPE_UNDERLINE _UNDERLINE
6668 .ALIAS HEAD_UNDERLINE _UNDERLINE
6669 .ALIAS ENDNOTE_STRING_UNDERLINE _UNDERLINE
6670 .ALIAS ENDNOTE_STRING_UNDERSCORE _UNDERLINE
6671 .ALIAS ENDNOTE_TITLE_UNDERLINE _UNDERLINE
6672 .ALIAS ENDNOTE_TITLE_UNDERSCORE _UNDERLINE
6675 \# COVERS - WHETHER TO PRINT
6676 \# -------------------------
6678 \# <none> | <anything>
6680 \# Creates or removes registers #COVERS and #COVERS_OFF, checked for
6681 \# in DEFAULTS (in START) prior to printing
6684 . ie '\\$0'DOC_COVERS' \{\
6686 . rr #DOC_COVERS_OFF
6691 . nr #DOC_COVERS_OFF 1
6707 \# COVER_COUNTS_PAGES
6708 \# ------------------
6710 \# <none> | <anything>
6712 \# Creates or removes registers #COVERS_COUNT or #DOCCOVERS_COUNT,
6713 \# used in END_COVER to determine whether to increment the page
6714 \# number silently when doc covers or covers are output.
6716 .MAC COVER_COUNTS_PAGES END
6717 . if '\\$0'DOC_COVER_COUNTS_PAGES' \{\
6718 . ie '\\$1'' \{ .nr #DOCCOVERS_COUNT 1 \}
6719 . el \{ .rr #DOCCOVERS_COUNT \}
6722 . if '\\$0'COVER_COUNTS_PAGES' \{\
6723 . ie '\\$1'' \{ .nr #COVERS_COUNT 1 \}
6724 . el \{ .rr #COVERS_COUNT \}
6735 . if \\n[#PAGINATE]=1 \{\
6736 . nr #PAGINATION_WAS_ON 1
6739 . if \\n[#HEADERS_ON]=1 \{\
6740 . nr #HEADERS_WERE_ON 1
6743 . if \\n[#FOOTERS_ON]=1 \{\
6744 . nr #FOOTERS_WERE_ON 1
6747 . if \\n[#COLUMNS]=1 \{\
6748 . nr #COLUMNS_WERE_ON 1
6752 . ie '\\$0'DO_DOC_COVER' \{\
6753 . if !r#DOC_COVER_START_POS \{\
6754 . nr #DOC_COVER_START_POS \\n[#PAGE_LENGTH]/3
6756 . if \\n[#PRINT_STYLE]=1 \{\
6757 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
6758 . el \{ .vs \\n[#DOC_LEAD]u \}
6760 . if \\n[#PRINT_STYLE]=2 \{\
6761 . LS \\n[#DOC_LEAD]u\\*[$DOC_COVER_LEAD_ADJ]
6762 . nr #DOC_COVER_LEAD \\n[#LEAD]
6765 . sp |\\n[#DOC_COVER_START_POS]u-1v
6766 . if \\n[#DOC_COVER_COLOR]=1 \{\
6768 \m[\\*[$DOC_COVER_COLOR]]
6772 . FAMILY \\*[$DOC_COVER_TITLE_FAM]
6773 . FT \\*[$DOC_COVER_TITLE_FT]
6774 . PT_SIZE \\*[$DOC_COVER_TITLE_PT_SIZE]
6775 . LS \\n[#DOC_COVER_LEAD]u
6776 . if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
6777 . if \\n[#DOC_COVER_TITLE]=1 \{\
6778 . ie \\n[#PRINT_STYLE]=1 \{\
6781 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6782 . UNDERSCORE "\\*[$TITLE_\\n[#ARG_NUM]]"
6788 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6789 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6790 . PRINT "\m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6793 . PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6798 . if \\n[#DOC_COVER_TITLE]=2 \{\
6799 . ie \\n[#PRINT_STYLE]=1 \{\
6802 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6803 . UNDERSCORE "\\*[$DOC_TITLE_\\n[#ARG_NUM]]"
6809 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6810 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6811 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_TITLE_\\n[#ARG_NUM]]\m[]
6813 . el \{ .PRINT \\*[$DOC_TITLE_\\n[#ARG_NUM]] \}
6817 . if \\n[#DOC_COVER_TITLE]=3 \{\
6818 . ie \\n[#PRINT_STYLE]=1 \{\
6820 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6824 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6825 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6827 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
6830 . if \\n[#DOC_COVER_TITLE]=4 \{\
6831 . ie \\n[#PRINT_STYLE]=1 \{\
6834 . ie \\n[#SINGLE_SPACE]=0 \{\
6835 . vs \\n[#DOC_LEAD]u/2u
6838 . vs \\n[#DOC_LEAD]u
6841 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6842 . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
6845 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u \}
6849 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6850 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6851 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6853 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
6857 . if \\n[#DOC_COVER_TITLE]=5 \{\
6858 . ie \\n[#PRINT_STYLE]=1 \{\
6860 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6864 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6865 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6867 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
6869 . if !'\\*[$CHAPTER_TITLE_1]'' \{\
6870 . ie \\n[#PRINT_STYLE]=1 \{\
6871 . ie \\n[#SINGLE_SPACE]=0 \{\
6872 . vs \\n[#DOC_LEAD]u/2u
6875 . vs \\n[#DOC_LEAD]u
6879 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6880 . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
6882 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u \}
6885 . FAMILY \\*[$DOC_COVER_CHAPTER_TITLE_FAM]
6886 . FT \\*[$DOC_COVER_CHAPTER_TITLE_FT]
6887 . PT_SIZE \\*[$DOC_COVER_CHAPTER_TITLE_PT_SIZE]
6889 . ALD \\n[.v]u/4u \"Put a little space before the chapter title
6890 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6891 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6892 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6894 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
6899 . if \\n[#DOC_COVER_TITLE]=6 \{\
6900 . ie \\n[#PRINT_STYLE]=1 \{\
6903 . while \\n[#DOC_COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6904 . UNDERSCORE "\\*[$DOC_COVER_TITLE_\\n[#ARG_NUM]]"
6910 . while \\n[#DOC_COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6911 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6912 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_COVER_TITLE_\\n[#ARG_NUM]]\m[]
6914 . el \{ .PRINT \\*[$DOC_COVER_TITLE_\\n[#ARG_NUM]] \}
6918 . if !\\n[#DOC_TYPE]=2 \{\
6919 . if \\n[#DOC_COVER_SUBTITLE]=1 \{\
6920 . FAMILY \\*[$DOC_COVER_SUBTITLE_FAM]
6921 . FT \\*[$DOC_COVER_SUBTITLE_FT]
6922 . PT_SIZE \\*[$DOC_COVER_SUBTITLE_PT_SIZE]
6923 . if \\n[#PRINT_STYLE]=1 \{\
6925 . ie \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u/2u \}
6926 . el \{ .vs \\n[#DOC_LEAD]u \}
6929 . if \\n[#DOC_COVER]=1 \{\
6930 . ie !'\\*[$SUBTITLE_DOCCOVER_1]'' \{\
6931 . nr #SUBTITLES \\n[#SUBTITLE_DOCCOVER_NUM]
6932 . nr #NEXT_SUBTITLE 0 1
6933 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
6934 . ie \\n[#DOC_COVER_SUBTITLE_COLOR]=1 \{\
6935 . PRINT \m[\\*[$DOC_COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_DOCCOVER_\\n+[#NEXT_SUBTITLE]]\m[]
6937 . el \{ .PRINT \\*[$SUBTITLE_DOCCOVER_\\n+[#NEXT_SUBTITLE]] \}
6941 . nr #SUBTITLES \\n[#SUBTITLE_NUM]
6942 . nr #NEXT_SUBTITLE 0 1
6943 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
6944 . ie \\n[#DOC_COVER_SUBTITLE_COLOR]=1 \{\
6945 . PRINT \m[\\*[$DOC_COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]]\m[]
6947 . el \{ .PRINT \\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]] \}
6951 . if \\n[#PRINT_STYLE]=1 \{\
6952 . if \\n[#SINGLE_SPACE]=0 \{ .vs \}
6955 . if \\n[#PRINT_STYLE]=1 \{\
6956 . if !r#DOC_COVER_SUBTITLE \{ .sp \}
6959 . if \\n[#DOC_COVER_AUTHOR]=1 \{\
6960 . FAMILY \\*[$DOC_COVER_AUTHOR_FAM]
6961 . FT \\*[$DOC_COVER_AUTHOR_FT]
6962 . PT_SIZE \\*[$DOC_COVER_AUTHOR_PT_SIZE]
6963 . if \\n[#PRINT_STYLE]=1 \{\
6965 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
6966 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
6969 . ie d$ATTRIBUTE_STRING_DOCCOVER \{\
6970 . ie \\n[#DOC_COVER_ATTRIBUTE_COLOR]=1 \{\
6971 . PRINT \&\m[\\*[$DOC_COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING_DOCCOVER]\m[]
6973 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING_DOCCOVER] \}
6976 . if d$ATTRIBUTE_STRING \{\
6977 . ie \\n[#DOC_COVER_ATTRIBUTE_COLOR]=1 \{\
6978 . PRINT \&\m[\\*[$DOC_COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
6980 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING] \}
6985 . FAMILY \\*[$DOC_COVER_DOCTYPE_FAM]
6986 . FT \\*[$DOC_COVER_DOCTYPE_FT]
6987 . PT_SIZE \\*[$DOC_COVER_DOCTYPE_PT_SIZE]
6989 . if \\n[#DOC_TYPE]=3 \{\
6990 . if \\n[#DOC_COVER_DOCTYPE]=1 \{\
6991 . ie \\n[#PRINT_STYLE]=1 \{\
6993 . vs \\n[#DOC_LEAD]u
6994 . UNDERSCORE2 "\\*[$DOC_TYPE]"
6997 . nr #FROM_DOC_COVER 1
6998 . ie \\n[#DOC_COVER_DOCTYPE_COLOR]=1 \{\
6999 . COLOR \\*[$DOC_COVER_DOCTYPE_COLOR]
7000 . ie \\n[#DOCCOVER_UNDERLINE]= 1 \{ .UNDERSCORE \\*[$DOCCOVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]" \}
7001 . el \{ .PRINT "\\*[$DOC_TYPE]" \}
7004 . ie \\n[#DOCCOVER_UNDERLINE]=1 \{ .UNDERSCORE \\*[$DOCCOVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]" \}
7005 . el \{ .PRINT "\\*[$DOC_TYPE]" \}
7007 . rr #FROM_DOC_COVER
7011 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
7012 . ie \\n[#PRINT_STYLE]=1 \{\
7014 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
7015 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
7018 . FAMILY \\*[$DOC_COVER_COPYRIGHT_FAM]
7019 . FT \\*[$DOC_COVER_COPYRIGHT_FT]
7021 . PT_SIZE \\*[$DOC_COVER_COPYRIGHT_PT_SIZE]
7023 . if \\n[#DOC_COVER_COPYRIGHT]=1 \{\
7024 . if !'\\*[$COPYRIGHT_DOCCOVER]'' \{\
7025 . ds $SAVED_COPYRIGHT \\*[$COPYRIGHT]
7026 . ds $COPYRIGHT \\*[$COPYRIGHT_DOCCOVER]
7028 . QUAD \\*[$DOC_COVER_COPYRIGHT_QUAD]
7029 . ie \\n[#DOC_COVER_COPYRIGHT_COLOR]=1 \{\
7030 . PRINT \m[\\*[$DOC_COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
7032 . el \{ .PRINT \\*[$COPYRIGHT] \}
7033 . ds $COPYRIGHT \\*[$SAVED_COPYRIGHT]
7035 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
7036 . if \\n[#DOC_COVER_MISC]=1 \{\
7037 . QUAD \\*[$DOC_COVER_MISC_QUAD]
7038 . ie !'\\*[$MISC_DOCCOVER_1]'' \{\
7039 . nr #MISCS \\n[#MISC_DOCCOVER_NUM]
7042 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
7043 . ie \\n[#DOC_COVER_MISC_COLOR]=1 \{\
7044 . PRINT \m[\\*[$DOC_COVER_MISC_COLOR]]\\*[$MISC_DOCCOVER_\\n+[#NEXT_MISC]]\m[]
7045 . rm $MISC_DOCCOVER_\\n[#NEXT_MISC]
7046 . rm $MISC_\\n[#NEXT_MISC]
7050 . PRINT \\*[$MISC_DOCCOVER_\\n+[#NEXT_MISC]]
7051 . rm $MISC_DOCCOVER_\\n[#NEXT_MISC]
7052 . rm $MISC_\\n[#NEXT_MISC]
7056 . rm $MISC_\\n+[#NEXT_MISC]
7059 . nr #MISCS \\n[#MISC_NUM]
7062 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
7063 . ie \\n[#DOC_COVER_MISC_COLOR]=1 \{\
7064 . PRINT \m[\\*[$DOC_COVER_MISC_COLOR]]\\*[$MISC_\\n+[#NEXT_MISC]]\m[]
7068 . PRINT \\*[$MISC_\\n+[#NEXT_MISC]]
7074 . if \\n[#DOCCOVERS_COUNT]=1 \{ .nr #PAGE_NUM_ADJ +1 \}
7075 . nr #DOCCOVER_END 1
7080 . if !r#COVER_START_POS \{\
7081 . nr #COVER_START_POS \\n[#PAGE_LENGTH]/3
7083 . if \\n[#PRINT_STYLE]=1 \{\
7084 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
7085 . el \{ .vs \\n[#DOC_LEAD]u \}
7087 . if \\n[#PRINT_STYLE]=2 \{\
7088 . LS \\n[#DOC_LEAD]u\\*[$COVER_LEAD_ADJ]
7089 . nr #COVER_LEAD \\n[#LEAD]
7092 . sp |\\n[#COVER_START_POS]u-1v
7093 . if \\n[#COVER_COLOR]=1 \{\
7095 \m[\\*[$COVER_COLOR]]
7099 . FAMILY \\*[$COVER_TITLE_FAM]
7100 . FT \\*[$COVER_TITLE_FT]
7101 . PT_SIZE \\*[$COVER_TITLE_PT_SIZE]
7102 . LS \\n[#COVER_LEAD]u
7103 . if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
7104 . if \\n[#COVER_TITLE]=1 \{\
7105 . ie \\n[#PRINT_STYLE]=1 \{\
7108 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7109 . UNDERSCORE "\\*[$TITLE_\\n[#ARG_NUM]]"
7115 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7116 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
7117 . PRINT "\m[\\*[$COVER_TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
7120 . PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
7125 . if \\n[#COVER_TITLE]=2 \{\
7126 . ie \\n[#PRINT_STYLE]=1 \{\
7129 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7130 . UNDERSCORE "\\*[$DOC_TITLE_\\n[#ARG_NUM]]"
7136 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7137 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
7138 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_TITLE_\\n[#ARG_NUM]]\m[]
7140 . el \{ .PRINT \\*[$DOC_TITLE_\\n[#ARG_NUM]] \}
7144 . if \\n[#COVER_TITLE]=3 \{\
7145 . ie \\n[#PRINT_STYLE]=1 \{\
7147 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
7151 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
7152 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
7154 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
7157 . if \\n[#COVER_TITLE]=4 \{\
7158 . ie \\n[#PRINT_STYLE]=1 \{\
7159 . ie \\n[#SINGLE_SPACE]=0 \{\
7160 . vs \\n[#DOC_LEAD]u/2u
7163 . vs \\n[#DOC_LEAD]u
7168 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7169 . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7172 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u \}
7176 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7177 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
7178 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
7180 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
7184 . if \\n[#COVER_TITLE]=5 \{\
7185 . ie \\n[#PRINT_STYLE]=1 \{\
7187 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
7191 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
7192 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
7194 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
7196 . if !'\\*[$CHAPTER_TITLE_1]'' \{\
7197 . ie \\n[#PRINT_STYLE]=1 \{\
7198 . ie \\n[#SINGLE_SPACE]=0 \{\
7199 . vs \\n[#DOC_LEAD]u/2u
7202 . vs \\n[#DOC_LEAD]u
7206 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7207 . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7209 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u \}
7212 . FAMILY \\*[$COVER_CHAPTER_TITLE_FAM]
7213 . FT \\*[$COVER_CHAPTER_TITLE_FT]
7214 . PT_SIZE \\*[$COVER_CHAPTER_TITLE_PT_SIZE]
7215 . ALD \\n[.v]u/4u \"Put a little space before the chapter title
7217 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7218 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
7219 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
7221 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
7226 . if \\n[#COVER_TITLE]=6 \{\
7227 . ie \\n[#PRINT_STYLE]=1 \{\
7230 . while \\n[#COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7231 . UNDERSCORE "\\*[$COVER_TITLE_\\n[#ARG_NUM]]"
7237 . while \\n[#COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7238 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
7239 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$COVER_TITLE_\\n[#ARG_NUM]]\m[]
7241 . el \{ .PRINT \\*[$COVER_TITLE_\\n[#ARG_NUM]] \}
7245 . if !\\n[#DOC_TYPE]=2 \{\
7246 . if \\n[#COVER_SUBTITLE]=1 \{\
7247 . FAMILY \\*[$COVER_SUBTITLE_FAM]
7248 . FT \\*[$COVER_SUBTITLE_FT]
7249 . PT_SIZE \\*[$COVER_SUBTITLE_PT_SIZE]
7250 . if \\n[#PRINT_STYLE]=1 \{\
7252 . if \\n[#PRINT_STYLE]=1 \{\
7254 . ie \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u/2u \}
7255 . el \{ .vs \\n[#DOC_LEAD]u \}
7259 . if \\n[#COVER]=1 \{\
7260 . ie !'\\*[$SUBTITLE_COVER_1]'' \{\
7261 . nr #SUBTITLES \\n[#SUBTITLE_COVER_NUM]
7262 . nr #NEXT_SUBTITLE 0 1
7263 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
7264 . ie \\n[#COVER_SUBTITLE_COLOR]=1 \{\
7265 . PRINT \m[\\*[$COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_COVER_\\n+[#NEXT_SUBTITLE]]\m[]
7267 . el \{ .PRINT \\*[$SUBTITLE_COVER_\\n+[#NEXT_SUBTITLE]] \}
7271 . nr #SUBTITLES \\n[#SUBTITLE_NUM]
7272 . nr #NEXT_SUBTITLE 0 1
7273 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
7274 . ie \\n[#COVER_SUBTITLE_COLOR]=1 \{\
7275 . PRINT \m[\\*[$COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]]\m[]
7277 . el \{ .PRINT \\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]] \}
7281 . if \\n[#PRINT_STYLE]=1 \{\
7282 . if \\n[#SINGLE_SPACE]=0 \{ .vs \}
7285 . if \\n[#PRINT_STYLE]=1 \{\
7286 . if !r#COVER_SUBTITLE \{ .sp \}
7289 . if \\n[#COVER_AUTHOR]=1 \{\
7290 . FAMILY \\*[$COVER_AUTHOR_FAM]
7291 . FT \\*[$COVER_AUTHOR_FT]
7292 . PT_SIZE \\*[$COVER_AUTHOR_PT_SIZE]
7293 . if \\n[#PRINT_STYLE]=1 \{\
7295 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
7296 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
7299 . ie d$ATTRIBUTE_STRING_COVER \{\
7300 . ie \\n[#COVER_ATTRIBUTE_COLOR]=1 \{\
7301 . PRINT \&\m[\\*[$COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING_COVER]\m[]
7303 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING_COVER] \}
7306 . if d$ATTRIBUTE_STRING \{\
7307 . ie \\n[#COVER_ATTRIBUTE_COLOR]=1 \{\
7308 . PRINT \&\m[\\*[$COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
7310 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING] \}
7315 . FAMILY \\*[$COVER_DOCTYPE_FAM]
7316 . FT \\*[$COVER_DOCTYPE_FT]
7317 . PT_SIZE \\*[$COVER_DOCTYPE_PT_SIZE]
7319 . if \\n[#DOC_TYPE]=3 \{\
7320 . if \\n[#COVER_DOCTYPE]=1 \{\
7321 . ie \\n[#PRINT_STYLE]=1 \{\
7323 . vs \\n[#DOC_LEAD]u
7324 . UNDERSCORE2 "\\*[$DOC_TYPE]"
7328 . ie \\n[#COVER_DOCTYPE_COLOR]=1 \{\
7329 . COLOR \\*[$COVER_DOCTYPE_COLOR]
7330 . ie \\n[#COVER_UNDERLINE]= 1 \{ .UNDERSCORE \\*[$COVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]" \}
7331 . el \{ .PRINT "\\*[$DOC_TYPE] \}
7334 . ie \\n[#COVER_UNDERLINE]=1 \{ .UNDERSCORE \\*[$COVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]" \}
7335 . el \{ .PRINT "\\*[$DOC_TYPE]" \}
7341 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
7342 . ie \\n[#PRINT_STYLE]=1 \{\
7344 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
7345 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
7348 . FAMILY \\*[$COVER_COPYRIGHT_FAM]
7349 . FT \\*[$COVER_COPYRIGHT_FT]
7351 . PT_SIZE \\*[$COVER_COPYRIGHT_PT_SIZE]
7353 . if \\n[#COVER_COPYRIGHT]=1 \{\
7354 . if !'\\*[$COPYRIGHT_COVER]'' \{\
7355 . ds $SAVED_COPYRIGHT \\*[$COPYRIGHT]
7356 . ds $COPYRIGHT \\*[$COPYRIGHT_COVER]
7358 . QUAD \\*[$COVER_COPYRIGHT_QUAD]
7359 . ie \\n[#COVER_COPYRIGHT_COLOR]=1 \{\
7360 . PRINT \m[\\*[$COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
7362 . el \{ .PRINT \\*[$COPYRIGHT] \}
7363 . ds $COPYRIGHT \\*[$SAVED_COPYRIGHT]
7365 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
7366 . if \\n[#COVER_MISC]=1 \{\
7367 . QUAD \\*[$COVER_MISC_QUAD]
7368 . ie !'\\*[$MISC_COVER_1]'' \{\
7369 . nr #MISCS \\n[#MISC_COVER_NUM]
7372 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
7373 . ie \\n[#COVER_MISC_COLOR]=1 \{\
7374 . PRINT \m[\\*[$COVER_MISC_COLOR]]\\*[$MISC_COVER_\\n+[#NEXT_MISC]]\m[]
7378 . PRINT \\*[$MISC_COVER_\\n+[#NEXT_MISC]]
7384 . nr #MISCS \\n[#MISC_NUM]
7387 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
7388 . ie \\n[#COVER_MISC_COLOR]=1 \{\
7389 . PRINT \m[\\*[$COVER_MISC_COLOR]]\\*[$MISC_\\n+[#NEXT_MISC]]\m[]
7393 . PRINT \\*[$MISC_\\n+[#NEXT_MISC]]
7399 . if \\n[#COVERS_COUNT]=1 \{ .nr #PAGE_NUM_ADJ +1 \}
7405 \# Macro to terminate (doc)cover processing
7411 . if \\n[#PAGINATION_WAS_ON]=1 \{ .nr % +1 \}
7412 . if \\n[#DOCCOVER_END]=1 \{\
7413 . ie \\n[#DOCCOVER_BLANKPAGE]=1 \{\
7415 . rr #DOCCOVER_BLANKPAGE
7416 . if !\\n[#DOCCOVERS_COUNT]=1 \{ .nr % -2 \}
7419 . if !\\n[#DOCCOVERS_COUNT]=1 \{ .nr #PAGE_NUM_ADJ -1 \}
7423 . if \\n[#COVER_END]=1 \{\
7424 . ie \\n[#COVER_BLANKPAGE]=1 \{\
7426 . rr #COVER_BLANKPAGE
7427 . if !\\n[#COVERS_COUNT]=1 \{ .nr % -2 \}
7430 . if !\\n[#COVERS_COUNT]=1 \{ .nr #PAGE_NUM_ADJ -1 \}
7435 . if \\n[#PAGINATION_WAS_ON] \{\
7436 . rr #PAGINATION_WAS_ON
7438 . PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]-1
7440 . if \\n[#HEADERS_WERE_ON] \{\
7441 . rr #HEADERS_WERE_ON
7444 . if \\n[#FOOTERS_WERE_ON] \{\
7445 . rr #FOOTERS_WERE_ON
7448 . if \\n[#COLUMNS_WERE_ON]=1 \{\
7449 . rr #COLUMNS_WERE_ON 1
7455 \# Macro to begin document processing
7458 . nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
7459 . if !\\n[#PRINT_STYLE] \{\
7460 . PRINTSTYLE TYPEWRITE
7467 . PRINT "You neglected to enter a PRINTSTYLE"
7469 . ab [mom]: PRINTSTYLE missing. Aborting.
7472 . if \\n[#LINENUMBERS]=1 \{\
7476 . if \\n[#COLLATE] \{\
7477 . COPYSTYLE \\*[$COPY_STYLE]
7478 . nr #HEADERS_ON \\n[#HEADER_STATE]
7479 . if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
7480 . sp |\\n[#HEADER_MARGIN]u
7482 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
7483 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
7484 . rm $RESTORE_PAGENUM_STYLE
7488 .\" Quote and blockquote default leads are the same as #DOC_LEAD, so
7489 .\" they have to be set after DEFAULTS (where DOC_LEAD is finalized)
7490 . if !r#Q_AUTOLEAD \{ .nr #Q_LEAD \\n[#DOC_LEAD] \}
7491 . if !r#BQ_AUTOLEAD \{ .nr #BQ_LEAD \\n[#DOC_LEAD] \}
7492 . if !r#EN_Q_AUTOLEAD \{ .nr #EN_Q_LEAD \\n[#EN_LEAD] \}
7493 . if !r#EN_BQ_AUTOLEAD \{ .nr #EN_BQ_LEAD \\n[#EN_LEAD] \}
7494 .\" Covers and doc covers
7495 . if \\n[#DOC_COVERS]=1 \{\
7496 . if \\n[#DOC_COVER]=1 \{\
7499 . rr #DOC_COVER_TITLE
7500 . rr #DOC_COVER_SUBTITLE
7501 . rr #DOC_COVER_AUTHOR
7502 . rr #DOC_COVER_DOCTYPE
7503 . rr #DOC_COVER_COPYRIGHT
7504 . rr #DOC_COVER_MISC
7507 . if \\n[#COVERS]=1 \{\
7508 . if \\n[#COVER]=1 \{\
7512 . rr #COVER_SUBTITLE
7515 . rr #COVER_COPYRIGHT
7519 .\" Collate related stuff
7520 . ie \\n[#COLLATED_DOC]=1 \{\
7521 .\" Collect TITLE for TOC.
7522 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7523 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
7524 . ie \\n[#USER_SET_TITLE_ITEM] \{\
7525 . ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]\\|
7526 . rr #USER_SET_TITLE_ITEM
7527 . rm $USER_SET_TITLE_ITEM
7530 . ie \\n[#DOC_TYPE]=2 \{\
7531 . ie '\\*[$CHAPTER_TITLE]'' \{\
7532 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
7535 . ie '\\*[$CHAPTER]'' \{\
7536 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]\\|
7539 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
7544 . ds $TOC_TITLE_ITEM \\*[$TITLE]\\|
7547 . if \\n[#TOC_AUTHORS]=1 \{\
7548 . ie '\\*[$TOC_AUTHORS]'' \{\
7549 . as $TOC_TITLE_ITEM /\\|\\*[$AUTHOR_1]\\|
7552 . as $TOC_TITLE_ITEM /\\|\\*[$TOC_AUTHORS]\\|
7556 .\" Note the use of \!, which transparently embeds the macros used
7557 .\" in the TOC_ENTRIES diversion. The elements they control must be
7558 .\" processed literally when the diversion is output.
7561 . if \\n[#PRINT_STYLE]=1 \{\
7566 . if \\n[#PRINT_STYLE]=2 \{\
7567 \!. FAMILY \\*[$TOC_TITLE_FAM]
7568 \!. FT \\*[$TOC_TITLE_FT]
7569 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
7573 . ie \\n[#PRINT_STYLE]=1 \{\
7574 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
7577 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
7583 . if \\n[#PRINT_STYLE]=2 \{\
7584 \!. FAMILY \\*[$TOC_PN_FAM]
7585 \!. FT \\*[$TOC_PN_FT]
7586 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7589 \!. PRINT \\*[LEADER]
7592 \!. PRINT \\n[#TOC_ENTRY_PN]
7598 . nr #FIRST_DOC_TITLE_PN \\n%+\\n[#PAGE_NUM_ADJ]
7599 . af #FIRST_DOC_TITLE_PN \\g[#PAGENUMBER]
7600 . nr #FIRST_DOC_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
7602 .\" End TITLE collection
7603 . if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
7604 . sp |\\n[#HEADER_MARGIN]u
7608 . rr #PAGINATION_STATE
7609 .\" End collate stuff
7610 . ie \\n[#DOC_HEADER]=0 \{\
7612 . if \\n[#DOC_TYPE]=4 \{\
7613 . if !'\\n(.z'' \{ .di \}
7615 . nr #STORED_PP_INDENT \\n[#PP_INDENT]
7618 . PARA_INDENT \\n[#STORED_PP_INDENT]u
7619 . rr #STORED_PP_INDENT
7620 . ie r#ADVANCE_FROM_TOP \{\
7621 . sp |\\n[#ADVANCE_FROM_TOP]u-1v
7622 . if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
7624 . el \{ .sp |\\n[#T_MARGIN]u-1v \}
7625 . if \\n[#COLUMNS] \{\
7628 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7629 . nr #L_MARGIN \\n(.o
7630 . ll \\n[#COL_L_LENGTH]u
7635 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ] \}
7636 . nr #DOCHEADER_LEAD \\n[#LEAD]
7638 . if \\n[#DOC_TYPE]=1 \{\
7640 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
7642 . if \\n[#DOCHEADER_COLOR]=1 \{\
7644 \m[\\*[$DOCHEADER_COLOR]]
7647 . L_MARGIN \\n[#DOC_L_MARGIN]u
7648 . LL \\n[#DOC_L_LENGTH]u
7650 . if \\n[#PRINT_STYLE]=1 \{\
7653 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u/2u \}
7654 . if !'\\*[$TITLE_1]'' \{\
7657 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7658 . UNDERSCORE 4p "\\*[$TITLE_\\n[#ARG_NUM]]"
7662 . if !'\\*[$SUBTITLE]'' \{\
7665 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7666 . UNDERSCORE 4p "\\*[$SUBTITLE_\\n[#ARG_NUM]]"
7669 . if !'\\*[$AUTHOR_1]'' \{\
7671 . PRINT \&\\*[$ATTRIBUTE_STRING]
7672 . nr #AUTHORS \\n[#AUTHOR_NUM]
7673 . nr #NEXT_AUTHOR 0 1
7674 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
7675 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
7679 . if \\n[#PRINT_STYLE]=2 \{\
7685 . if \\n[#DOC_TYPE]=2 \{\
7687 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
7689 . if \\n[#DOCHEADER_COLOR]=1 \{\
7691 \m[\\*[$DOCHEADER_COLOR]]
7694 . L_MARGIN \\n[#DOC_L_MARGIN]u
7695 . LL \\n[#DOC_L_LENGTH]u
7697 . if \\n[#PRINT_STYLE]=1 \{\
7700 . vs \\n[#DOC_LEAD]u
7701 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u/2u \}
7702 . ie '\\*[$CHAPTER]'' \{\
7704 . ie !'\\*[$CHAPTER_TITLE]'' \{\
7706 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7707 . UNDERSCORE 4p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7712 . UNDERSCORE 4p "\\*[$CHAPTER_STRING]"
7719 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
7721 . if !'\\*[$CHAPTER_TITLE]'' \{\
7724 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7725 . UNDERSCORE 4p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7730 . if \\n[#SINGLE_SPACE] \{ .ALD 2v \}
7732 . if \\n[#PRINT_STYLE]=2 \{\
7734 . di DOCHEADER_DIVERSION \" This diversion is only
7735 . br \" necessary to find the depth of the
7736 . CHAPTER_DOCHEADER \" docheader
7739 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
7740 . \" in #DOCHEADER_DEPTH
7741 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
7746 . if \\n[#DOC_TYPE]=3 \{\
7748 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
7750 . if \\n[#DOCHEADER_COLOR]=1 \{\
7752 \m[\\*[$DOCHEADER_COLOR]]
7755 . L_MARGIN \\n[#DOC_L_MARGIN]u
7756 . LL \\n[#DOC_L_LENGTH]u
7758 . if \\n[#PRINT_STYLE]=1 \{\
7761 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u/2u \}
7763 . if !'\\*[$TITLE]'' \{\
7765 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7766 . UNDERSCORE 4p "\\*[$TITLE_\\n[#ARG_NUM]]"
7770 . if !'\\*[$SUBTITLE]'' \{\
7773 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7774 . UNDERSCORE 4p "\\*[$SUBTITLE_\\n[#ARG_NUM]]"
7777 . if !'\\*[$AUTHOR_1]'' \{\
7779 . PRINT \&\\*[$ATTRIBUTE_STRING]
7780 . nr #AUTHORS \\n[#AUTHOR_NUM]
7781 . nr #NEXT_AUTHOR 0 1
7782 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
7783 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
7786 . ie \\n[#SINGLE_SPACE]=0 \{ .sp 2 \}
7788 . UNDERSCORE2 4p "\\*[$DOC_TYPE]"
7789 . if \\n[#SINGLE_SPACE]=1 \{ .sp \}
7791 . if \\n[#PRINT_STYLE]=2 \{\
7796 . if !\\n[#DOC_TYPE]=4 \{\
7797 . if \\n[#PRINT_STYLE]=1 \{\
7800 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u*2u \}
7801 . if \\n[#COLUMNS] \{\
7803 . nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
7804 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7805 . nr #L_MARGIN \\n(.o
7806 . LL \\n[#COL_L_LENGTH]u
7812 . LS \\n[#DOC_LEAD]u
7813 . if \\n[#ADJ_DOC_LEAD]=1 \{\
7814 . ie !r#ADVANCE_FROM_TOP \{\
7815 . if \\n[#DOC_HEADER]=1 \{ .SHIM \}
7817 . el \{ .rr #ADVANCE_FROM_TOP \}
7819 . QUAD \\*[$DOC_QUAD]
7821 . nr #START_FOR_FOOTERS 1
7822 . if \\n[#COLLATED_DOC]=1 \{\
7823 . if !\\n[MNinit_DEFERRED]=1 \{\
7827 . if \\n[#MNinit_DEFERRED]=1 \{\
7828 . rr #MNinit_DEFERRED
7829 . nr #START_FOR_MNinit 1
7830 . MN_INIT \\*[$MN-arg1] \\*[$MN-arg2] \\*[$MN-arg3] \\*[$MN-arg4] \\*[$MN-arg5] \\*[$MN-arg6] \\*[$MN-arg7] \\*[$MN-arg8] \\*[$MN-arg9]
7832 . nr #START_FOR_MNinit 2
7833 . if !\\n[#DOC_TYPE]=4 \{ .em TERMINATE \}
7834 . if \\n[#LINENUMBERS]=2 \{\
7835 . NUMBER_LINES RESUME
7838 . if \\n[#RUN_ON]=1 \{\
7839 . if \\n[#FN_MARKER_STYLE]=1 \{ .RUNON_WARNING \}
7840 . if \\n[#FN_MARKER_STYLE]=2 \{ .RUNON_WARNING \}
7844 .MAC CLEANUP_DEFAULTS END
7846 .\" Family strings for docheader
7848 . rm $CHAPTER_TITLE_FAM
7852 .\" Family strings for cover
7853 . rm $COVER_AUTHOR_FAM
7854 . rm $COVER_CHAPTER_TITLE_FAM
7855 . rm $COVER_COPYRIGHT_FAM
7856 . rm $COVER_DOCTYPE_FAM
7857 . rm $COVER_LEAD_ADJ
7858 . rm $COVER_SUBTITLE_FAM
7859 . rm $COVER_TITLE_FAM
7860 .\" Family strings for doc cover
7861 . rm $DOC_COVER_AUTHOR_FAM
7862 . rm $DOC_COVER_CHAPTER_TITLE_FAM
7863 . rm $DOC_COVER_COPYRIGHT_FAM
7864 . rm $DOC_COVER_DOCTYPE_FAM
7865 . rm $DOC_COVER_LEAD_ADJ
7866 . rm $DOC_COVER_SUBTITLE_FAM
7867 . rm $DOC_COVER_TITLE_FAM
7868 .\" Quad args to copyright and misc
7869 . rm $COVER_COPYRIGHT_QUAD
7870 . rm $COVER_MISC_QUAD
7871 . rm $DOC_COVER_COPYRIGHT_QUAD
7872 . rm $DOC_COVER_MISC_QUAD
7873 .\" Miscellaneous strings
7874 . rm $TOC_TITLE_ITEM
7875 . rm $DOCHEADER_LEAD_ADJ
7876 .\" Various registers
7878 . rr #ADVANCE_FROM_TOP
7882 . rr #DOC_COVER_LEAD
7883 . if \\n[#DOC_HEADER]=1 \{ .nr #DOC_HEADER 2 \}
7884 . rr #DOCHEADER_ADVANCE
7885 . rr #DOCHEADER_EXTRA_SPACE
7886 . rr #DOCHEADER_LEAD
7887 . rr #DOCHEADER_SPACE_ADJ
7894 \# ====================================================================
7896 \# +++MACROS TO CHANGE SOME DEFAULTS+++
7901 \# <none> | <anything> [distance to advance from top of page]
7903 \# Turns printing of document header on or off. If a second argument
7904 \# in units of measure is given, advances that distance from the
7905 \# top of the page without printing the document header.
7907 \# Default is on. If the 1st argument is <anything> (which turns
7908 \# document headers off), the optional 2nd argument may be given
7909 \# (with a unit of measure).
7912 . ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
7914 . if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
7920 \# DOCUMENT HEADER LEADING
7921 \# -----------------------
7923 \# <+|- amount by which to in/decrease leading of doc header>
7925 \# Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
7927 \# A unit of measure must be supplied. Decimal fractions OK.
7928 \# Default is +0, i.e. same as DOC_LEAD.
7930 .MAC DOCHEADER_LEAD END
7931 . ds $DOCHEADER_LEAD_ADJ \\$1
7935 \# DOCHEADER ADVANCE
7936 \# -----------------
7938 \# <docheader start position>
7940 \# Creates register #DOCHEADER_ADVANCE, used in START.
7942 \# Unit of measure required.
7943 \# Default is same as T_MARGIN.
7945 .MAC DOCHEADER_ADVANCE END
7946 . nr #DOCHEADER_ADVANCE (\\$1)
7950 \# DOCUMENT LEFT MARGIN
7951 \# --------------------
7953 \# <left margin of document>
7955 \# Creates or modifies register #DOC_L_MARGIN.
7957 \# Affects EVERYTHING on the page.
7959 .MAC DOC_LEFT_MARGIN END
7961 . nr #DOC_L_MARGIN (\\$1)
7962 . L_MARGIN \\n[#DOC_L_MARGIN]u
7966 \# DOCUMENT RIGHT MARGIN
7967 \# ---------------------
7969 \# <right margin of document>
7971 \# Creates or modifies register #DOC_R_MARGIN.
7973 \# Affects EVERYTHING on the page.
7975 .MAC DOC_RIGHT_MARGIN END
7977 . nr #DOC_R_MARGIN (\\$1)
7978 . R_MARGIN \\n[#DOC_R_MARGIN]
7979 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
7983 \# DOCUMENT LINE LENGTH
7984 \# --------------------
7986 \# <line length of document>
7988 \# Creates or modifies string $DOC_L_LENGTH.
7990 \# Affects EVERYTHING on the page.
7992 .MAC DOC_LINE_LENGTH END
7994 . nr #DOC_L_LENGTH (\\$1)
7995 . LL \\n[#DOC_L_LENGTH]u
8003 \# <family of running text>
8005 \# Creates or modifies string $DOC_FAM.
8007 \# Affects everything EXCEPT headers and footers.
8012 . ds $FAMILY \\*[$DOC_FAM]
8013 . AUTHOR_FAMILY \\*[$DOC_FAM]
8014 . BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
8015 . DOCHEADER_FAMILY \\*[$DOC_FAM]
8016 . DOCTYPE_FAMILY \\*[$DOC_FAM]
8017 . EPIGRAPH_FAMILY \\*[$DOC_FAM]
8018 . FOOTNOTE_FAMILY \\*[$DOC_FAM]
8019 . HDRFTR_FAMILY \\*[$DOC_FAM]
8020 . HEAD_FAMILY \\*[$DOC_FAM]
8021 . LINENUMBER_FAMILY \\*[$DOC_FAM]
8022 . PARAHEAD_FAMILY \\*[$DOC_FAM]
8023 . QUOTE_FAMILY \\*[$DOC_FAM]
8024 . SUBHEAD_FAMILY \\*[$DOC_FAM]
8025 . SUBTITLE_FAMILY \\*[$DOC_FAM]
8026 . TITLE_FAMILY \\*[$DOC_FAM]
8030 \# DOCUMENT POINT SIZE
8031 \# -------------------
8033 \# <point size of running text>
8035 \# Creates or modifies register #DOC_PT_SIZE.
8037 \# DOC_PT_SIZE is the basis for calculating all type sizes in
8040 .MAC DOC_PT_SIZE END
8041 . if \\n[#IGNORE] \{ .return \}
8044 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
8051 \# <lead (".vs") of running text> [ADJUST]
8053 \# Creates or modifies register #DOC_LEAD. If the optional
8054 \# ADJUST argument is given, adjusts leading so that the last
8055 \# line of text falls exactly on #B_MARGIN.
8057 \# DOC_LEAD is the basis for calculating all leading changes in
8058 \# a document. Default for TYPESET is 16; 24 for TYPEWRITE.
8060 \# Because the visible bottom or footer margin of a page depends
8061 \# on the overall document lead supplied by the register #DOC_LEAD,
8062 \# DOC_LEAD, in the body of a document, should always be associated
8063 \# with the start of a new page (in other words, just before or
8064 \# just after a manual NEWPAGE).
8067 . if \\n[#IGNORE] \{ .return \}
8070 . nr #DOC_LEAD \\n[#LEAD]
8071 . if '\\$2'ADJUST' \{ .TRAPS \}
8075 \# ADJUST DOCUMENT LEAD
8076 \# --------------------
8078 \# <none> | <anything>
8080 \# Adjusts document lead so that the last line of text falls exactly
8083 .MAC DOC_LEAD_ADJUST END
8085 . nr #ADJ_DOC_LEAD 1
8086 . rr #DOC_LEAD_ADJUST_OFF
8089 . nr #ADJ_DOC_LEAD 0
8090 . nr #DOC_LEAD_ADJUST_OFF 1
8100 \# Advances to the next "valid" baseline.
8102 \# If a user plays around with spacing in a doc (say, with ALD),
8103 \# it isn't easy to get mom back on track so she can achieve
8104 \# perfectly flush bottom margins. Any time SHIM is used, it
8105 \# ensures that the next output line falls on a valid baseline.
8107 \# First, a little convenience macro
8109 .MAC PROCESS_SHIM END
8110 . while \\n+[#VALID_BASELINE]<\\n[#CURRENT_V_POS] \{\
8113 . nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
8116 \# And a macro to disable SHIM (useful sometimes with QUOTE and
8120 . ie '\\$1'' \{ .nr #NO_SHIM 1 \}
8121 . el \{ .rr #NO_SHIM \}
8125 . ie r#NO_SHIM \{ .return \}
8127 . nr #VALID_BASELINE \\n[#T_MARGIN]-1v \\n[#DOC_LEAD]
8128 . if !r#CURRENT_V_POS \{ .nr #CURRENT_V_POS \\n(.d \}
8129 . ie r#ADVANCE_FROM_TOP \{\
8130 . ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
8131 . while \\n-[#VALID_BASELINE]>\\n[#CURRENT_V_POS] \{\
8134 . nr #VALID_BASELINE +\\n[#DOC_LEAD]
8135 . nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
8151 \# ====================================================================
8153 \# +++INTERNATIONALIZATION+++
8158 \# <what goes in the "by" slot before author in the document header>
8160 \# Creates or modifies string $ATTRIBUTE_STRING.
8162 \# Default is "by". A blank string ("") may be used if no
8163 \# attribution is desired.
8165 .MAC ATTRIBUTE_STRING END
8166 . if !'\\$1'DOC_COVER' \{\
8167 . if !'\\$1'COVER' \{ .nr #NEITHER 1 \}
8169 . if !'\\$1'COVER' \{\
8170 . if !'\\$1'DOC_COVER' \{ .nr #NEITHER 1 \}
8172 . if '\\$1'DOC_COVER' \{\
8173 . ds $ATTRIBUTE_STRING_DOCCOVER \\$2
8175 . if '\\$1'COVER' \{\
8176 . ds $ATTRIBUTE_STRING_COVER \\$2
8178 . if \\n[#NEITHER]=1 \{\
8179 . ds $ATTRIBUTE_STRING \\$1
8188 \# <what to print any time the word "chapter" is required>
8190 \# Creates or modifies string $CHAPTER_STRING.
8192 \# Default is "chapter".
8194 .MAC CHAPTER_STRING END
8195 . ds $CHAPTER_STRING \\$1
8202 \# <what to print any time the word "draft" is required>
8204 \# Creates or modifies string $DRAFT_STRING.
8206 \# Default is "draft".
8208 .MAC DRAFT_STRING END
8209 . ds $DRAFT_STRING \\$1
8216 \# <what to print any time the word "revision" is required>
8218 \# Creates or modifies string $REVISION_STRING.
8220 \# Default is "revision".
8222 .MAC REVISION_STRING END
8223 . ds $REVISION_STRING \\$1
8230 \# <what to print with the finis macro>
8232 \# Creates or modifies string $FINIS_STRING.
8234 \# Default is "END".
8236 .MAC FINIS_STRING END
8237 \#. if \\n[#FINIS_STRING_CAPS]=1 \{ .CAPS \}
8238 . ds $FINIS_STRING \\$1
8239 \#. if \\n[#FINIS_STRING_CAPS]=1 \{ .CAPS OFF \}
8242 .MAC FINIS_STRING_CAPS END
8243 . ie '\\$1'' \{ .nr #FINIS_STRING_CAPS 1 \}
8244 . el \{ .nr #FINIS_STRING_CAPS 0 \}
8247 \# ====================================================================
8249 \# +++RECTO/VERSO+++
8254 \# <none> | <anything>
8256 \# Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages. Also
8257 \# switches page numbers left and right if either is chosen rather
8258 \# than the default centered page numbers. Switches left and right
8259 \# margins if differing values have been entered.
8263 .MAC RECTO_VERSO END
8264 . ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
8265 . el \{ .nr #RECTO_VERSO 0 \}
8268 \# ====================================================================
8275 \# <value by which to multiply PP_INDENT for block epigraphs>
8277 \# Creates or modifies register #EPI_OFFSET_VALUE.
8279 \# Default is 2 for TYPEWRITE, 3 for TYPESET.
8281 .MAC EPIGRAPH_INDENT END
8282 . if r#EPI_OFFSET_VALUE \{ .rr #EPI_OFFSET_VALUE \}
8283 . if !'\\*[$EPI_OFFSET_VALUE]'' \{ .rm $EPI_OFFSET_VALUE \}
8284 . ds $EVAL_EI_ARG \\$1
8285 . substring $EVAL_EI_ARG -1
8286 . ie \B'\\*[$EVAL_EI_ARG]' \{\
8287 . nr #EPI_OFFSET_VALUE \\$1
8290 . ds $EPI_OFFSET_VALUE \\$1
8296 \# EPIGRAPH AUTOLEAD
8297 \# -----------------
8299 \# <amount of lead to add to the epigraph ps for epigraph leading>
8301 \# Creates or modifies register #EPI_AUTOLEAD.
8303 \# Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
8305 .MAC EPIGRAPH_AUTOLEAD END
8306 . nr #EPI_AUTOLEAD \\$1
8313 \# BLOCK | <anything>
8315 \# Places an epigraph before the document's text, after the
8316 \# document header, or after a HEAD.
8318 \# #EPIGRAPH 1 = centered; 2 = block
8320 \# By default, epigraphs are centered, allowing the user
8321 \# to input them on a line per line basis. To change this
8322 \# behaviour, the user can supply the argument BLOCK, which
8323 \# will produce indented, filled text similar to BLOCKQUOTE.
8325 \# If a block epigraph contains more than one para, ALL paras of
8326 \# the epigraph must be preceded by PP. Otherwise, PP is optional.
8331 . if \\n[#LINENUMBERS]=1 \{\
8335 . if \\n[#START] \{\
8336 . if \\n[#PRINT_STYLE]=1 \{\
8337 . if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8344 . ll \\n[#L_LENGTH]u
8347 . if \\n[#COLUMNS] \{\
8348 . ie \\n[#START] \{\
8349 . ll \\n[#DOC_L_LENGTH]u
8353 . ll \\n[#COL_L_LENGTH]u
8358 . if \\n[#PRINT_STYLE]=1 \{\
8361 . if '\\*[$EPI_FT]'I' \{\
8365 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
8366 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
8367 . nr #EPI_LEAD \\n[#LEAD]
8368 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8370 . if \\n[#PRINT_STYLE]=2 \{\
8371 . FAMILY \\*[$EPI_FAM]
8373 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
8374 . if \\n[#EPI_COLOR]=1 \{\
8379 . AUTOLEAD \\n[#EPI_AUTOLEAD]
8380 . nr #EPI_LEAD \\n[#LEAD]
8381 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8384 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
8385 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
8390 . ie '\\$1'BLOCK' \{\
8393 . ie \\n[#START] \{\
8394 . ie \\n[#COLUMNS] \{\
8395 . ie r#EPI_OFFSET_VALUE \{\
8396 . ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8399 . ll \\n[#L_LENGTH_FOR_EPI]u-(\\*[$EPI_OFFSET_VALUE]u*2u)
8404 . ie r#EPI_OFFSET_VALUE \{\
8405 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8408 . ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8414 . ie r#EPI_OFFSET_VALUE \{\
8415 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8418 . ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8421 . if \\n[#COLUMNS] \{\
8422 . ie r#EPI_OFFSET_VALUE \{\
8423 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8426 . ll \\n[#COL_L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8432 . if \\n[#PRINT_STYLE]=1 \{\
8435 . if '\\*[$EPI_FT]'I' \{\
8439 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
8440 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
8443 . nr #EPI_LEAD \\n[#LEAD]
8444 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8448 . if \\n[#PRINT_STYLE]=2 \{\
8449 . FAMILY \\*[$EPI_FAM]
8451 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
8452 . if \\n[#EPI_COLOR]=1 \{\
8457 . AUTOLEAD \\n[#EPI_AUTOLEAD]
8458 . QUAD \\*[$EPI_QUAD]
8459 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
8460 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
8462 . nr #EPI_LEAD \\n[#LEAD]
8463 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8480 \# Ends diversion started in EPIGRAPH. Makes spacing
8481 \# adjustments to compensate for the difference between epigraph
8482 \# leading and overall document leading, so that the bottom of
8483 \# the pages remain flush.
8485 \# In addition to its usual place at the beginning of a
8486 \# document, EPIGRAPH may also be used after HEAD.
8488 .MAC DO_EPIGRAPH END
8492 . if \\n[#RESET_FN_COUNTERS]=2 \{\
8493 . if !\\n[#FN_COUNT]=1 \{\
8494 . if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
8496 . rr #RESET_FN_COUNTERS
8500 . nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
8504 . nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
8505 . nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
8506 . ie \\n[#START] \{\
8508 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
8509 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8510 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8512 . if \\n[#PRINT_STYLE]=1 \{\
8513 . if !\\n[#SINGLE_SPACE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8515 . if \\n[#PRINT_STYLE]=2 \{\
8516 . ie !\\n[#DOC_TYPE]=2 \{ .RLD \\n[#DOC_LEAD]u \}
8518 . ie '\\*[$CHAPTER_TITLE]'' \{ .RLD \\n[#DOC_LEAD]u \}
8520 . if '\\*[$CHAPTER]'' \{ .RLD \\n[#DOC_LEAD]u \}
8523 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
8524 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
8526 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8527 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8532 . ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
8534 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
8535 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8536 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8538 . ie \\n[#PRINT_STYLE]=1 \{\
8539 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
8542 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
8543 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
8545 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8546 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8549 . if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
8552 . nr #EPI_LINES_TO_TRAP 0 1
8553 . while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\
8556 . nr #EPI_LINES_TO_TRAP -1
8557 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
8558 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8559 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8561 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
8562 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
8565 . if \\n[#EPIGRAPH]=1 \{\
8566 . po \\n[#L_MARGIN]u
8567 . if \\n[#COLUMNS] \{\
8568 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8569 . nr #L_MARGIN \\n(.o
8572 . if \\n[#EPIGRAPH]=2 \{\
8573 . ie r#EPI_OFFSET_VALUE \{\
8574 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
8576 . el \{ .nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE] \}
8577 . if \\n[#COLUMNS] \{\
8578 . ie r#EPI_OFFSET_VALUE \{\
8579 . nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
8581 . el \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE] \}
8583 . po \\n[#EPI_OFFSET]u
8588 . ie \\n[#START] \{\
8589 . if \\n[#PRINT_STYLE]=1 \{\
8592 . if \\n[#PRINT_STYLE]=2 \{\
8593 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
8594 . ALD \\n[#EPI_WHITESPACE]u/2u
8596 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8597 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8604 . ie \\n[#EPI_FITS] \{\
8605 . ie \\n[#FN_FOR_EPI] \{\
8606 . nr #EPI_LINES_TO_END 1
8607 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
8608 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8609 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8611 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
8614 . ie \\n[#PRINT_STYLE]=1 \{\
8615 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
8618 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
8619 . ALD \\n[#EPI_WHITESPACE]u/2u
8621 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8622 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8628 . nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
8629 . if \\n[#LOOP] \{ .nr #EPI_LINES_TO_END +1 \}
8631 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
8632 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8633 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8635 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
8636 . if \\n[#PRINT_STYLE]=1 \{\
8637 . if !\\n[#SINGLE_SPACE] \{\
8638 . nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
8639 . ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
8641 . rr #EPI_LINES_EVEN
8648 . ALD \\n[#DOC_LEAD]u
8649 . QUAD \\*[$DOC_QUAD]
8650 . po \\n[#L_MARGIN]u
8651 . if \\n[#COLUMNS] \{\
8652 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8653 . nr #L_MARGIN \\n(.o
8655 . if \\n[#START] \{\
8656 . if \\n[#COLUMNS] \{\
8657 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8658 . nr #L_MARGIN \\n(.o
8662 . if \\n[#LINENUMBERS]=2 \{\
8663 . NUMBER_LINES RESUME
8668 \# ====================================================================
8670 \# +++FINIS MACRO+++
8677 \# Deposits --END-- at the end of a document.
8683 . if \\n[#TAB_ACTIVE] \{ .TQ \}
8684 . if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
8685 . nr #EM_ADJUST (1m/8)
8686 . if \\n[#COLUMNS] \{\
8687 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8688 . nr #L_MARGIN \\n(.o
8690 . ALD \\n[#DOC_LEAD]u
8692 . if \\n[#FINIS_STRING_CAPS]=1 \{ .CAPS \}
8693 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
8694 . if \\n[#PRINT_STYLE]=2 \{\
8695 . ie \\n[#FINIS_COLOR] \{\
8696 . 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[]
8698 . el \{ .PRINT \v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em\m[] \}
8700 . if \\n[#FINIS_STRING_CAPS]=1 \{ .CAPS OFF \}
8704 \# ====================================================================
8706 \# +++HEADERS/FOOTERS+++
8708 \# Define a string so that the current page number can be incorporated
8709 \# into the strings for hdrftr left, right, and center. NOTE: This is
8710 \# not the same thing as using the shortform # in hdrftr strings.
8712 .ds PAGE# \En[#PAGENUMBER]
8718 \# <amount of space between header/footer and header/footer rule>
8720 \# Creates or modifies register #HDRFTR_RULE_GAP to hold amount
8721 \# of space between header/footer and header/footer rule.
8725 .MAC HDRFTR_RULE_GAP END
8726 . nr #HDRFTR_RULE_GAP (\\$1)
8727 . if '\\$0'HEADER_RULE_GAP' \{\
8728 . nr #HEADER_RULE_GAP \\n[#HDRFTR_RULE_GAP]
8729 . if r#FOOTER_RULE_GAP \{ .nr #FOOTER_RULE_GAP \\n[#FOOTER_RULE_GAP] \}
8731 . if '\\$0'FOOTER_RULE_GAP' \{\
8732 . nr #FOOTER_RULE_GAP \\n[#HDRFTR_RULE_GAP]
8733 . if r#HEADER_RULE_GAP \{ .nr #HEADER_RULE_GAP \\n[#HEADER_RULE_GAP] \}
8741 \# <what to put in the left position of page header/footers>
8743 \# Creates or modifies string $HDRFTR_LEFT.
8744 \# Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
8745 \# overrides the $HDRFTR_LEFT string created by default
8748 \# Especially useful if doc has more than one author, and a list
8749 \# of authors by last name is desired in header/footers.
8750 \# Default is author.
8752 \# If the argument is the # character, simply prints the current
8755 \# If the user wants to *incorporate* the page number into the string,
8756 \# \*[PAGE#] must be used. For example, if the user wants to put
8757 \# an elipsis before the page number in the string, s/he should use
8758 \# ...\*[PAGE#], not ...#
8760 .MAC HDRFTR_LEFT END
8761 . nr #USER_DEF_HDRFTR_LEFT 1
8762 . ds $HDRFTR_LEFT \\$1
8769 \# <none> | <anything>
8771 \# Turns capitalisation of $HDRFTR_LEFT (typically, the author of
8772 \# the document) on or off.
8776 .MAC HDRFTR_LEFT_CAPS END
8778 . nr #HDRFTR_LEFT_CAPS 1
8781 . nr #HDRFTR_LEFT_CAPS 0
8782 . ds $HDRFTR_LEFT_SIZE_CHANGE +0
8790 \# <what to put in the centre position of page header/footers>
8792 \# Creates or modifies string $HDRFTR_CENTER.
8793 \# Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
8794 \# overrides the $HDRFTR_CENTER string created by default
8797 \# Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
8798 \# CHAPTER, draft and revision number if COPYSTYLE DRAFT.
8800 \# If the argument is the # character, simply prints the current
8803 \# If the user wants to *incorporate* the page number into the string,
8804 \# \*[PAGE#] must be used. For example, if the user wants to put
8805 \# an elipsis before the page number in the string, s/he should use
8806 \# ...\*[PAGE#], not ...#
8808 .MAC HDRFTR_CENTER END
8809 . nr #USER_DEF_HDRFTR_CENTER 1
8810 . if '\\$0'FOOTER_CENTER' \{\
8811 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
8812 . ds $HDRFTR_CENTER_NEW \\$1
8814 . if '\\$0'FOOTER_CENTRE' \{\
8815 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
8816 . ds $HDRFTR_CENTER_NEW \\$1
8818 . ds $HDRFTR_CENTER \\$1
8822 \# HDRFTR CENTER CAPS
8823 \# ------------------
8825 \# <none> | <anything>
8827 \# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
8828 \# the document) on or off.
8832 .MAC HDRFTR_CENTER_CAPS END
8834 . nr #HDRFTR_CENTER_CAPS 1
8837 . nr #HDRFTR_CENTER_CAPS 0
8838 . ds $HDRFTR_CENTER_SIZE_CHANGE +0
8843 \# HDRFTR CENTER PADDING
8844 \# ---------------------
8846 \# LEFT | RIGHT <amount of padding to put left or right of hdrftr
8849 \# Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
8850 \# #HDRFTR_CTR_PAD_RIGHT.
8852 \# By default, the HDRFTR_CENTER string is centered on the doc
8853 \# line length. Long titles or long author names can screw up
8854 \# visual centering, or create overprints. This macro allows the
8855 \# user to pad the center string by the specified amount of space
8856 \# to fix these problems. Use only one of LEFT or RIGHT.
8858 \# A unit of measure is required.
8860 .MAC HDRFTR_CENTER_PAD END
8861 . if '\\$1'LEFT' \{\
8862 . nr #HDRFTR_CTR_PAD_LEFT (\\$2)
8864 . if '\\$1'RIGHT' \{\
8865 . nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
8870 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
8871 \# --------------------------------
8875 \# Switches the padding side of hdrftr center padding.
8877 \# Required to keep spacing around hdrftr string constant
8878 \# in recto/verso documents.
8880 .MAC SWITCH_HDRFTR_CENTER_PAD END
8881 . nr #HDRFTR_CTR_PAD_TMP \\n[#HDRFTR_CTR_PAD_LEFT]
8882 . HDRFTR_CENTER_PAD LEFT \\n[#HDRFTR_CTR_PAD_RIGHT]u
8883 . HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
8890 \# <what to put in the right position of page header/footers>
8892 \# Creates or modifies string $HDRFTR_RIGHT.
8893 \# Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
8894 \# overrides the $HDRFTR_RIGHT string created by default
8897 \# Default is document title.
8899 \# If the argument is the # character, simply prints the current
8902 \# If the user wants to *incorporate* the page number into the string,
8903 \# \*[PAGE#] must be used. For example, if the user wants to put
8904 \# an elipsis before the page number in the string, s/he should use
8905 \# ...\*[PAGE#], not ...#
8907 .MAC HDRFTR_RIGHT END
8908 . nr #USER_DEF_HDRFTR_RIGHT 1
8909 . ds $HDRFTR_RIGHT \\$1
8913 \# HDRFTR RIGHT CAPS
8914 \# -----------------
8916 \# <none> | <anything>
8918 \# Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
8919 \# the document) on or off.
8923 .MAC HDRFTR_RIGHT_CAPS END
8925 . nr #HDRFTR_RIGHT_CAPS 1
8928 . nr #HDRFTR_RIGHT_CAPS 0
8929 . ds $HDRFTR_RIGHT_SIZE_CHANGE +0
8937 \# <none> | <anything>
8939 \# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
8940 \# under the header/over the footer. Otherwise, turns HDRFTR_RULE
8943 .MAC HDRFTR_RULE END \"To print rule under header/over footer.
8944 . if \\n[#HEADERS_ON] \{ .nr #HDRFTR_RULE_GAP \\n[#HEADER_RULE_GAP] \}
8945 . if \\n[#FOOTERS_ON] \{ .nr #HDRFTR_RULE_GAP \\n[#FOOTER_RULE_GAP] \}
8946 . if '\\$0'HDRFTR_RULE_INTERNAL' \{\
8947 . ie \\n[#USERDEF_HDRFTR] \{\
8948 . nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
8949 . if \\n[#HEADERS_ON] \{\
8951 . ALD \\n[#HDRFTR_RULE_GAP]u
8952 . nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT]
8953 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ]
8955 . if \\n[#FOOTERS_ON] \{\
8957 . RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u
8958 . nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT]
8959 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ]
8961 . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
8962 \m[\\*[$HDRFTR_RULE_COLOR]]\
8963 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8965 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8966 \D'l \\n[#DOC_L_LENGTH]u 0'\
8967 \D't \\n[#RULE_WEIGHT]u'\
8968 \h'-\\n[#RULE_WEIGHT]u'\
8972 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8974 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8975 \D'l \\n[#DOC_L_LENGTH]u 0'\
8976 \D't \\n[#RULE_WEIGHT]u'\
8977 \h'-\\n[#RULE_WEIGHT]u'
8982 . if \\n[#PRINT_STYLE]=1 \{\
8983 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
8985 . if \\n[#PRINT_STYLE]=2 \{\
8986 . ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
8987 . nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
8989 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
8990 . ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
8991 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
8993 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
8995 . if \\n[#HEADERS_ON] \{\
8997 . ALD \\n[#HDRFTR_RULE_GAP]u
8998 . nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT]
8999 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ]
9001 . if \\n[#FOOTERS_ON] \{\
9003 . RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u
9004 . nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT]
9005 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ]
9007 . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
9008 \m[\\*[$HDRFTR_RULE_COLOR]]\
9009 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
9011 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
9012 \D'l \\n[#DOC_L_LENGTH]u 0'\
9013 \D't \\n[#RULE_WEIGHT]u'\
9014 \h'-\\n[#RULE_WEIGHT]u'\
9018 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
9020 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
9021 \D'l \\n[#DOC_L_LENGTH]u 0'\
9022 \D't \\n[#RULE_WEIGHT]u'\
9023 \h'-\\n[#RULE_WEIGHT]u'
9028 . if '\\$0'HEADER_RULE' \{\
9039 . if '\\$0'FOOTER_RULE' \{\
9050 . if '\\$0'HDRFTR_RULE' \{\
9051 . ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
9052 . el \{ .nr #HDRFTR_RULE 0 \}
9057 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
9065 \# Sets the family, font, and point size of all strings in
9066 \# header/footers to the same family and point size as running
9067 \# text. Font for the header/footer becomes roman throughout.
9069 .MAC HDRFTR_PLAIN END
9070 . HDRFTR_FAMILY \\*[$DOC_FAM]
9071 . HDRFTR_PT_SIZE \\n[#DOC_PT_SIZE]
9072 . HDRFTR_LEFT_FAMILY \\*[$DOC_FAM]
9073 . HDRFTR_LEFT_FONT R
9074 . HDRFTR_LEFT_SIZE +0
9075 . HDRFTR_LEFT_CAPS OFF
9076 . HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
9077 . HDRFTR_CENTER_FONT R
9078 . HDRFTR_CENTER_SIZE +0
9079 . HDRFTR_CENTER_CAPS OFF
9080 . HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]
9081 . HDRFTR_RIGHT_FONT R
9082 . HDRFTR_RIGHT_SIZE +0
9083 . HDRFTR_RIGHT_CAPS OFF
9090 \# <none> | <anything>
9092 \# Creates or modifies register #SWITCH_HDRFTR, used to switch
9093 \# default location of HDRFTR_LEFT and HDRFTR_RIGHT.
9097 \# Typically, the author string appears at the left of header/footers,
9098 \# and the title string appears at the right. This switches the
9099 \# location of the two. Useful in conjuction with RECTO_VERSO to tweak
9100 \# switches on alternate pages to come out as the user wishes. The
9101 \# assumption of RECTO_VERSO is that the first page of the document
9102 \# (recto) is odd, and even though it has no header/footer, if it did
9103 \# have one, it would print as AUTHOR...CENTER...TITLE (or whatever
9104 \# strings the user has supplied for HDRFTR_LEFT/RIGHT), meaning that
9105 \# the next page, which does have a header/footer, will come out as
9106 \# TITLE...CENTER...AUTHOR (or whatever strings the user has supplied
9107 \# for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user to get the
9108 \# desired string in the desired place on the desired recto/verso page.
9110 .MAC SWITCH_HDRFTR END
9111 . ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
9112 . el \{ .nr #SWITCH_HDRFTR 0 \}
9116 \# USER DEFINED HDRFTR RECTO
9117 \# -------------------------
9119 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
9121 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
9122 \# stores string in $USERDEF_HDRFTR_RECTO.
9124 \# For use when users don't want 3-part headers/footers, but rather
9125 \# want to design their own headers/footers and need different
9126 \# headers/footers on recto and verso pages. Using just
9127 \# HEADER_RECTO, even when recto/verso is not on, allows users to
9128 \# design their own headers/footers for doc pages.
9130 .MAC HDRFTR_RECTO END
9131 . nr #USERDEF_HDRFTR 1
9132 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
9133 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
9134 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
9135 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
9136 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
9137 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
9138 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
9140 . if '\\$1'CAPS' \{ .nr #HDRFTR_RECTO_CAPS 1 \}
9141 . ds $USERDEF_HDRFTR_RECTO \\$2
9145 \# USER DEFINED HDRFTR VERSO
9146 \# -------------------------
9148 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
9150 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
9151 \# stores string in $USERDEF_HDRFTR_VERSO.
9153 \# For use when users don't want 3-part headers/footers, but rather
9154 \# want to design their own headers/footers and need different
9155 \# headers/footers on recto and verso pages.
9157 .MAC HDRFTR_VERSO END
9158 . nr #USERDEF_HDRFTR 1
9159 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
9160 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
9161 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
9162 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
9163 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
9164 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
9165 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
9167 . if '\\$1'CAPS' \{ .nr #HDRFTR_VERSO_CAPS 1 \}
9168 . ds $USERDEF_HDRFTR_VERSO \\$2
9171 \# PRINT FOOTER ON FIRST PAGE
9172 \# --------------------------
9174 \# <none> | <anything>
9176 \# Toggles register #PRINT_FOOTER_ON_PAGE_1
9178 \# Lets user choose whether to print footer on first
9181 .MAC FOOTER_ON_FIRST_PAGE END
9182 . ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
9183 . el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
9187 \# PRINT PAGE NUMBER ON FIRST PAGE
9188 \# -------------------------------
9190 \# <none> | <anything>
9192 \# Toggles register #PRINT_PAGENUM_ON_PAGE_1
9194 \# Lets user choose whether to print page number on first
9195 \# page of doc and after collate when footers are on or page numbering
9196 \# has been user set at top of page.
9198 .MAC PAGENUM_ON_FIRST_PAGE END
9199 . ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
9200 . el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
9204 \# PRINT HEADER/FOOTER
9205 \# -------------------
9209 \# Based on defaults or values entered by user, prints a
9210 \# three-part title at either the top or the bottom of the page.
9212 \# Called from within either HEADER or FOOTER.
9214 .MAC PRINT_HDRFTR END
9215 . if \\n[#DOC_TYPE]=4 \{\
9216 . nr #SUITE \En[.pn]
9218 . if \\n[#FOOTERS_ON] \{\
9219 . if \\n[#START_FOR_FOOTERS] \{\
9220 . rr #START_FOR_FOOTERS
9221 . if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{\
9222 . ie !\\n[#HDRFTR_BOTH] \{ .return \}
9226 . ie \\n[#HEADER_RULE]=1 \{ .HEADER_RULE \}
9227 . el \{ .HEADER_RULE OFF \}
9228 . HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
9234 . if \\n[#USERDEF_HDRFTR] \{\
9235 . PRINT_USERDEF_HDRFTR
9238 . if \\n[#SWITCH_HDRFTR] \{\
9239 . ds $HDRFTR_TMP_SWITCH \\*[$HDRFTR_LEFT]
9240 . ds $HDRFTR_LEFT \\*[$HDRFTR_RIGHT]
9241 . ds $HDRFTR_RIGHT \\*[$HDRFTR_TMP_SWITCH]
9242 . ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
9243 . ds $HDRFTR_LEFT_SIZE_CHANGE \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
9244 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
9245 . nr #HDRFTR_TMP_CAPS_SWITCH \\n[#HDRFTR_LEFT_CAPS]
9246 . nr #HDRFTR_LEFT_CAPS \\n[#HDRFTR_RIGHT_CAPS]
9247 . nr #HDRFTR_RIGHT_CAPS \\n[#HDRFTR_TMP_CAPS_SWITCH]
9248 . ds $HDRFTR_TMP_COLOR_SWITCH \\*[$HDRFTR_LEFT_COLOR]
9249 . ds $HDRFTR_LEFT_COLOR \\*[$HDRFTR_RIGHT_COLOR]
9250 . ds $HDRFTR_RIGHT_COLOR \\*[$HDRFTR_TMP_COLOR_SWITCH]
9251 . rr #HDRFTR_TMP_CAPS_SWITCH
9252 . rm $HDRFTR_TMP_SWITCH
9253 . rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
9254 . rm $HDRFTR_TMP_COLOR_SWITCH
9255 . nr #SWITCH_HDRFTR 0
9257 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
9258 . if \\n[#ENDNOTES] \{ .PAGENUM_STYLE \\*[$EN_PN_STYLE] \}
9259 . if \\n[#PRINT_STYLE]=1 \{\
9260 . if \\n[#FOOTERS_ON] \{\
9263 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
9268 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
9269 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
9270 . ie '\\*[$HDRFTR_LEFT]'#' \{\
9271 . PRINT \\n[#PAGENUMBER]
9274 . ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
9275 . el \{ .PRINT \& \}
9277 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
9279 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
9281 . ie '\\*[$HDRFTR_CENTER]'#' \{\
9282 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
9285 . ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
9286 . el \{ .PRINT \& \}
9288 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
9291 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
9292 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
9294 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
9295 . PRINT \\n[#PAGENUMBER]
9298 . ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \\*[$HDRFTR_RIGHT] \}
9299 . el \{ .PRINT \& \}
9301 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
9303 . if \\n[#PRINT_STYLE]=2 \{\
9304 . if \\n[#HDRFTR_COLOR]=1 \{\
9306 \m[\\*[$HDRFTR_COLOR]]
9308 . fam \\*[$HDRFTR_LEFT_FAM]
9309 . ft \\*[$HDRFTR_LEFT_FT]
9310 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
9312 . if \\n[#FOOTERS_ON] \{\
9315 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
9320 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
9321 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
9322 . ie '\\*[$HDRFTR_LEFT]'#' \{\
9323 . ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
9324 . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[]
9327 . PRINT \\n[#PAGENUMBER]
9331 . ie !'\\*[$HDRFTR_LEFT]'' \{\
9332 . ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
9333 . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[]
9336 . PRINT \\*[$HDRFTR_LEFT]
9339 . el \{ .PRINT \& \}
9341 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
9342 . fam \\*[$HDRFTR_CENTER_FAM]
9343 . ft \\*[$HDRFTR_CENTER_FT]
9344 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
9346 . if \\n[#FOOTERS_ON] \{\
9349 . nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
9353 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
9355 . ie '\\*[$HDRFTR_CENTER]'#' \{\
9356 . ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
9357 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
9360 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
9364 . ie !'\\*[$HDRFTR_CENTER]'' \{\
9365 . ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
9366 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
9369 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
9372 . el \{ .PRINT \& \}
9374 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
9375 . fam \\*[$HDRFTR_RIGHT_FAM]
9376 . ft \\*[$HDRFTR_RIGHT_FT]
9377 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
9379 . if \\n[#FOOTERS_ON] \{\
9382 . nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
9387 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
9388 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
9390 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
9391 . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
9392 . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[]
9395 . PRINT \\n[#PAGENUMBER]
9399 . ie !'\\*[$HDRFTR_RIGHT]'' \{\
9400 . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
9401 . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[]
9404 . PRINT \\*[$HDRFTR_RIGHT]
9407 . el \{ .PRINT \& \}
9409 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
9411 . if \\n[#HDRFTR_RULE] \{\
9412 . HDRFTR_RULE_INTERNAL
9418 \# PRINT USER DEFINED HEADER/FOOTER
9419 \# --------------------------------
9423 \# Based on defaults or values entered by user, prints a single part
9424 \# (i.e. not 3-part) title at either the top or the bottom of the page.
9426 \# Called from within PRINT_HDRFTR.
9428 .MAC PRINT_USERDEF_HDRFTR END
9429 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
9431 . if \\n[#PRINT_STYLE]=2 \{\
9432 . fam \\*[$HDRFTR_FAM]
9434 . ps \\n[#HDRFTR_PT_SIZE]u
9435 . if \\n[#HDRFTR_COLOR]=1 \{\
9437 . COLOR \\*[$HDRFTR_COLOR]
9440 . ie \\n[#RECTO_VERSO] \{\
9442 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
9443 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
9444 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
9445 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS \}
9446 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
9447 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS OFF \}
9449 . if \\n[#FOOTERS_ON] \{\
9452 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9457 . ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
9458 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT \}
9459 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
9460 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT \}
9461 . if \\n[#HDRFTR_VERSO_CAPS]=1 \{ .CAPS \}
9462 . PRINT \\*[$USERDEF_HDRFTR_VERSO]
9463 . if \\n[#HDRFTR_VERSO_CAPS]=1 \{ .CAPS OFF \}
9465 . if \\n[#FOOTERS_ON] \{\
9468 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9473 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
9474 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
9475 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
9476 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS \}
9477 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
9478 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS OFF \}
9480 . if \\n[#FOOTERS_ON] \{\
9483 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9490 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
9491 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
9492 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
9493 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS \}
9494 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
9495 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS OFF \}
9497 . if \\n[#FOOTERS_ON] \{\
9500 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9505 . if \\n[#PRINT_STYLE]=2 \{\
9506 . ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]]
9509 . if \\n[#HDRFTR_RULE] \{\
9510 . HDRFTR_RULE_INTERNAL
9517 \# HEADERS (off or on)
9518 \# -------------------
9520 \# <none> | <anything>
9522 \# Turns headers at the top of the page off or on.
9527 . ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
9528 . el \{ .nr #HEADERS_ON 0 \}
9535 \# <amount of space between top of page and header>
9537 \# Creates or modifies register #HEADER_MARGIN to hold amount
9538 \# of space between top of page and header.
9540 \# Requires unit of measure. Default is 4P+6p, measured top-of-page
9543 .MAC HEADER_MARGIN END
9544 . nr #HEADER_MARGIN (\\$1)
9551 \# <amount of space between header and running text>
9553 \# Creates or modifies register #HEADER_GAP to hold amount
9554 \# of space between header and running text.
9556 \# Default is 1P+6p.
9559 . nr #HEADER_GAP (\\$1)
9568 \# Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
9570 \# In order to convert the title string to caps in the header (in the
9571 \# event that the user enters .TITLE in caps/lc), I've used
9572 \# quad left, quad centre, and quad right to arrange the three bits
9573 \# of the header, rather than .tl. This allows the use of the CAPS macro.
9574 \# The downside is that I have to add \\v'-(\\n[#LEAD]u*<n>) in order
9575 \# for -Tlatin1 output to align the header/footer strings on the baseline.
9576 \# The console output still isn't brilliant, but at least it's
9583 . nr #LAST_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]
9584 . if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
9586 . if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
9587 . po \\n[#DOC_L_MARGIN]u
9588 . if \\n[#RECTO_VERSO] \{\
9589 . if !\\n[#TOC_RV_SWITCH] \{\
9590 . nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
9591 . DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u
9592 . DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
9593 . SWITCH_HDRFTR_CENTER_PAD
9598 . if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
9599 . sp |\\n[#HEADER_MARGIN]u-1v
9601 . ll \\n[#DOC_L_LENGTH]u
9603 . if \\n[#PRINT_STYLE]=1 \{\
9606 . ps 12\\*[$HDRFTR_SIZE_CHANGE]
9608 . if \\n[#PRINT_STYLE]=2 \{\
9609 . fam \\*[$HDRFTR_FAM]
9611 . ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
9614 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
9615 . if \\n[#CAPS_ON] \{\
9619 . if \\n[#UNDERLINE_ON] \{\
9620 . nr #UNDERLINE_WAS_ON 1
9623 . if \\n[#PRINT_STYLE]=1 \{\
9624 . if \\n[#ENDNOTES]=1 \{\
9625 .\" Single-spaced endotes have a different lead
9626 . if \\n[#EN_SINGLESPACE] \{\
9627 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
9628 . nr #DOC_LEAD \\n[#EN_LEAD]u
9632 . nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
9634 . ie \\n[#HEADERS_ON] \{\
9636 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
9639 . ie \\n[#PAGE_NUM_V_POS]=1 \{\
9640 . ie \\n[#PAGINATE] \{\
9642 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
9644 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
9646 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
9648 . if \\n[#PRINT_STYLE]=1 \{\
9649 . if \\n[#ENDNOTES]=1 \{\
9650 . if \\n[#EN_SINGLESPACE] \{\
9651 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
9652 . rr #RESTORE_DOC_LEAD
9656 . nr #PAGE_TOP \\n(nl
9658 . po \\n[#L_MARGIN]u
9659 . if \\n[#RECTO_VERSO] \{\
9660 . nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
9662 . if \\n[#CAPS_WAS_ON] \{\
9666 . if \\n[#UNDERLINE_WAS_ON] \{\
9668 . rr #UNDERLINE_WAS_ON
9670 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9671 . if \\n[#QUOTE] \{\
9672 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9674 . ie r#Q_OFFSET_VALUE \{\
9675 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9678 . nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9680 . po \\n[#Q_OFFSET]u
9682 . if \\n[#PRINTSTYLE]=2 \{ .ALD \\n[#Q_LEAD_DIFF]u \}
9684 . if \\n[#EPIGRAPH] \{\
9685 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9687 . ie r#EPI_OFFSET_VALUE \{\
9688 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9691 . nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9693 . po \\n[#EPI_OFFSET]u
9696 . ie \\n[#EPIGRAPH] \{\
9697 . ie !\\n[#EPI_ACTIVE] \{\
9702 . ie \\n[#EPI_FITS] \{ .ns \}
9703 . el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
9708 . if \\n[#COLUMNS] \{\
9709 . nr #FN_COUNT_FOR_COLS 0 1
9710 . nr #L_MARGIN \\n[#DOC_L_MARGIN]
9711 . if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
9714 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
9715 . nr #L_MARGIN \\n(.o
9716 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9717 . ll \\n[#COL_L_LENGTH]u
9719 . if \\n[#QUOTE] \{\
9720 . ie r#Q_OFFSET_VALUE \{\
9721 . po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
9724 . po +\\*[$Q_OFFSET_VALUE]
9727 . if \\n[#EPIGRAPH] \{\
9728 . if \\n[#EPI_ACTIVE] \{\
9729 . ie \\n[#EPI_FITS] \{ . \}
9730 . el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
9732 . ie r#EPI_OFFSET_VALUE \{\
9733 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
9736 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+\\*[$EPI_OFFSET_VALUE]
9740 . if \\n[#RESET_FN_COUNTERS]=1 \{\
9741 . rr #RESET_FN_COUNTERS
9742 . PROCESS_FN_IN_DIVER
9743 . nr #FN_COUNT \\n[#SAVED_FN_COUNT] 1
9744 . if \\n[#COLUMNS]=1 \{ .nr #FN_COUNT_FOR_COLS \\n[#SAVED_FN_COUNT_FOR_COLS] 1 \}
9745 . ie \\n[#RESET_FN_NUMBER]=1 \{ .nr #FN_NUMBER \\n[#SAVED_FN_NUMBER] 1 \}
9746 . el \{ .nr #FN_NUMBER \\n[#FN_NUMBER] 1 \}
9748 . if dRUNON_FN_IN_DIVER \{ .rm RUNON_FN_IN_DIVER \}
9750 . if \\n[#PRINT_STYLE]=1 \{\
9751 . if \\n[#SLANT_ON] \{\
9752 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
9754 . if \\n[#UNDERLINE_ON]=1 \{\
9755 . if \\n[#UNDERLINE_ITALIC] \{ .UNDERLINE \}
9759 . rr #DEFER_SPACE_ADDED
9760 . if !\\n[#FN_DEPTH] \{\
9761 . if r#DIVERTED \{ .rr #DIVERTED \}
9763 . if \\n[#MN_OVERFLOW_LEFT]=1 \{\
9769 . if \\n[#MN_OVERFLOW_RIGHT]=1 \{\
9775 . rm MN_OVERFLOW_LEFT
9776 . rr #MN_OVERFLOW_LEFT
9777 . rr #no-repeat-MN-left
9778 . rm MN_OVERFLOW_RIGHT
9779 . rr #MN_OVERFLOW_RIGHT
9780 . rr #no-repeat-MN-right
9781 . if \\n[#PRE_COLLATE]=1 \{ .rr #PRE_COLLATE \}
9784 \# ====================================================================
9788 \# FOOTERS (off or on)
9789 \# -------------------
9791 \# <none> | <anything>
9793 \# Turns footers at the bottom of the page off or on.
9795 \# Default is off. If on, page numbers automatically go at
9796 \# the top, centered, unless pagination has been turned off,
9797 \# or the pagenumber position has been changed to left or right.
9803 . PAGENUM_POS TOP CENTER
9805 . el \{ .nr #FOOTERS_ON 0 \}
9814 \# Creates or modifies register #FOOTER_MARGIN which holds the
9815 \# amount of space to leave between the page number and the bottom
9818 \# Unit of measure required. Default is 3P.
9820 .MAC FOOTER_MARGIN END
9821 . ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
9829 \# <distance from end of running text to page # or footer>
9831 \# Creates or modifies register #FOOTER_GAP which holds the
9832 \# amount of space to leave between running text and the page number.
9834 \# Requires unit of measure. Default is 3P. Measured baseline to
9838 . ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
9848 \# Places footer at bottom of page if #FOOTERS=1, otherwise
9849 \# places page number at bottom of page (if #PAGINATE=1).
9850 \# Page numbers are in arabic or roman according to COPYSTYLE.
9851 \# DRAFT starts the document at page 1 regardless of PAGENUMBER.
9852 \# FINAL respects PAGENUMBER.
9855 . ev PAGE_TRANSITION
9856 . if \\n[MN-left]>0 \{\
9857 . if !\\n[#no-repeat-MN-left]=1 \{\
9859 . nr #no-repeat-MN-left 1
9861 . if '\\n(.z'MN_OVERFLOW_LEFT' \{\
9863 . nr #MN_OVERFLOW_LEFT 1
9867 . if \\n[MN-right]>0 \{\
9868 . if (\\n[MN-right] > 0) \{\
9869 . if !\\n[#no-repeat-MN-right]=1 \{\
9873 . if '\\n(.z'MN_OVERFLOW_RIGHT' \{\
9875 . nr #MN_OVERFLOW_RIGHT 1
9876 . rr #OVERFLOW_RIGHT
9879 . ch MN_OVERFLOW_TRAP
9880 . nr #SAVED_LEAD \\n(.v
9881 . nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
9882 . if !\\n[#FN_DEFER] \{\
9884 . if \\n[#FN_DEPTH] \{\
9885 . if \\n[#DIVERTED]=3 \{ .nr #FN_DEPTH +\\n[#VFP_DIFF] \}
9887 . sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u-\\n[#DOC_LEAD]u)
9889 . po \\n[#DOC_L_MARGIN]u
9890 . if \\n[#COLUMNS] \{\
9891 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9892 . nr #L_MARGIN \\n(.o
9898 . if dRUNON_FOOTNOTES \{ .rm RUNON_FOOTNOTES \}
9899 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#SAVED_LEAD]u \}
9900 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#SAVED_LEAD]u \}
9901 . if '\\n(.z'FN_OVERFLOW' \{\
9903 . nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
9905 . nr #FN_COUNT_AT_FOOTER \\n[#FN_COUNT]
9907 . if \\n[#COL_NEXT] \{\
9908 . ie !\\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
9909 . el \{ .nr #COL_NUM \\n[#NUM_COLS] 1 \}
9914 . ie \\n[#COLUMNS]=1 \{\
9915 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
9917 . ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
9918 . el \{ .sp |\\n(dcu \}
9919 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
9920 . nr #L_MARGIN \\n(.o
9921 . if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
9922 . LS \\n[#SAVED_LEAD]u
9923 . if \\n[#PREV_FN_DEFERRED] \{\
9924 . nr #PREV_FN_DEFERRED 2
9927 . if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
9928 . if !\\n[#QUOTE] \{ .rr #COL_NEXT \}
9929 . if \\n[#RESET_FN_COUNTERS]=1 \{\
9930 . rr #RESET_FN_COUNTERS
9931 . PROCESS_FN_IN_DIVER
9932 . LS \\n[#SAVED_LEAD]u
9933 . nr #FN_COUNT \\n[#FN_COUNT] 1
9934 . nr #FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] 1
9936 . if dRUNON_FN_IN_DIVER \{ .rm RUNON_FN_IN_DIVER \}
9938 . rr #DEFER_SPACE_ADDED
9939 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9940 . if \\n[#QUOTE] \{\
9941 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9943 . ie r#Q_OFFSET_VALUE \{\
9944 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9947 . nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9949 . if \\n[#COLUMNS] \{\
9950 . ie r#Q_OFFSET_VALUE \{\
9951 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9954 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9957 . po \\n[#Q_OFFSET]u
9960 . if \\n[#EPIGRAPH] \{\
9961 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9963 . ie r#EPI_OFFSET_VALUE \{\
9964 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9967 . nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9969 . if \\n[#COLUMNS] \{\
9970 . ie r#EPI_OFFSET_VALUE \{\
9971 . nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9974 . nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9977 . po \\n[#EPI_OFFSET]u
9980 . ie \\n[#EPIGRAPH] \{\
9981 . ie !\\n[#EPI_ACTIVE] \{\
9986 . sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
9996 . el \{ .DO_FOOTER \}
10005 \# Prints footer (page number, or 3-part footer).
10006 \# Resets CAPS and UNDERLINE if they were on.
10009 .\" Have to change position of FN_OVERFLOW_TRAP or it screws up the
10010 .\" placement of page numbers (or footers). It's reset to its original
10011 .\" position at the end of the macro.
10012 . if r#SAVED_FOOTER_POS \{ .ch FOOTER \\n[#SAVED_FOOTER_POS]u \}
10013 . rr #SAVED_FOOTER_POS
10014 . ie (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
10015 . nr #SKIP_FOOTER 1
10019 . sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
10024 . po \\n[#DOC_L_MARGIN]u
10025 . ll \\n[#DOC_L_LENGTH]u
10027 . if \\n[#PRINT_STYLE]=1 \{\
10030 . if \\n[#PRINT_STYLE]=2 \{\
10031 . fam \\*[$HDRFTR_FAM]
10033 . ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
10035 . vs \\n[#SAVED_LEAD]u
10036 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
10037 . if \\n[#CAPS_ON] \{\
10038 . nr #CAPS_WAS_ON 1
10041 . if \\n[#UNDERLINE_ON] \{\
10042 . nr #UNDERLINE_WAS_ON 1
10045 . ie \\n[#FOOTERS_ON] \{\
10046 . if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_HDRFTR \}
10049 . if \\n[#PAGINATE] \{\
10050 . if \\n[#PAGE_NUM_V_POS]=2 \{\
10051 . if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_PAGE_NUMBER \}
10056 . if \\n[#CAPS_WAS_ON] \{\
10060 . if \\n[#UNDERLINE_WAS_ON] \{\
10062 . rr #UNDERLINE_WAS_ON
10067 .\" This ev pops the PAGE_TRANSITION environment still active at the
10072 \# ====================================================================
10074 \# +++HEADERS AND FOOTERS+++
10076 \# HEADERS_AND_FOOTERS
10077 \# -------------------
10079 \# HEADER_RECTO_QUAD \
10080 \# HEADER_RECTO_STRING \
10081 \# FOOTER_RECTO_QUAD \
10082 \# FOOTER_RECTO_STRING \
10083 \# HEADER_VERSO_QUAD \
10084 \# HEADER_VERSO_STRING \
10085 \# FOOTER_VERSO_QUAD \
10086 \# FOOTER_VERSO_STRING
10089 \# Allows having both headers and footers. Sets register
10090 \# #HDRFTR_BOTH to 1; collects HEADER/FOOTER_RECTO/VERSO
10091 \# information; appends FOOTER_RECTO and FOOTER_VERSO to
10092 \# START and turns off pagination; appends to macros
10093 \# PRINT_USERDEF_HDRFTR and HEADER the necessary number
10094 \# register manipulations and redefinitions of the
10095 \# HEADER/FOOTER_RECTO/VERSO strings so that both
10096 \# headers and footers get printed, with the appropriate
10097 \# strings for each
10099 \# Works in conjunction with HDRFTR_RECTO and HDRFTR_VERSO (qqv.),
10100 \# ergo all style changes must be done inline in the strings
10101 \# passed as arguments.
10103 .MAC HEADERS_AND_FOOTERS END
10104 . ie \\n[#NUM_ARGS]>1 \{\
10105 . nr #HDRFTR_BOTH 1
10107 . if !r#HEADER_RULE .nr #HEADER_RULE 1
10108 . if !r#FOOTER_RULE .nr #FOOTER_RULE 1
10109 . ds $HDR_RECTO_QUAD \\$1
10110 . ds $HDR_RECTO_STRING \\$2
10111 . ds $FTR_RECTO_QUAD \\$3
10112 . ds $FTR_RECTO_STRING \\$4
10113 . ds $HDR_VERSO_QUAD \\$5
10114 . ds $HDR_VERSO_STRING \\$6
10115 . ds $FTR_VERSO_QUAD \\$7
10116 . ds $FTR_VERSO_STRING \\$8
10118 . if \\\\n[#HDRFTR_BOTH]=1 \{\
10119 . FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
10120 . FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
10121 . if \\\\n[#HEADER_RULE]=1 \{ .HEADER_RULE \}
10122 . ie \\\\n[#FOOTER_RULE]=1 \{ .FOOTER_RULE \}
10123 . el \{ .FOOTER_RULE OFF \}
10124 . if r#PAGINATE .rr #PAGINATE
10125 . if r#PAGE_NUM_V_POS .rr #PAGE_NUM_V_POS
10128 .am PRINT_USERDEF_HDRFTR DONE
10129 . if \\\\n[#HDRFTR_BOTH]=1 \{\
10130 . if \\n[#FOOTERS_ON]=1 \{\
10131 . if !\\\\n[#COLLATE]=1 \{\
10132 . HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
10133 . HEADER_VERSO \\*[$HDR_VERSO_QUAD] "\\*[$HDR_VERSO_STRING]"
10136 . ie \\\\n[#HEADER_RULE]=1 \{ .HEADER_RULE \}
10137 . el \{ .HEADER_RULE OFF \}
10140 . if \\n[#HEADERS_ON]=1 \{\
10141 . FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
10142 . FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
10147 . if \\\\n[#HDRFTR_BOTH]=1 \{\
10148 . if r#START_FOR_FOOTERS .rr #START_FOR_FOOTERS
10151 . FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
10152 . FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
10153 . ie \\\\n[#FOOTER_RULE]=1 \{ .FOOTER_RULE \}
10154 . el \{ .FOOTER_RULE OFF \}
10160 . rr #USERDEF_HDRFTR
10161 . rm $USERDEF_HDRFTR_RECTO
10162 . rm $USERDEF_HDRFTR_VERSO
10165 . if \\n[#COLLATE]=1 \{\
10166 . nr #HEADER_STATE 1
10167 . nr #PAGINATION_STATE 1
10170 . PAGENUM_POS BOTTOM CENTER
10175 \# ====================================================================
10179 \# ---Head numbers---
10184 \# <none> | <anything>
10186 \# Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
10190 .MAC NUMBER_HEADS END
10192 . nr #NUMBER_HEAD 1
10193 . if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
10195 . el \{ .rr #NUMBER_HEAD \}
10199 \# RESET HEAD NUMBER
10200 \# -----------------
10202 \# <none> | <desired head number>
10204 \# Resets incrementing register #HEAD_NUM to 1 or, if there's
10205 \# an argument, to user supplied number.
10207 \# Also resets subhead and parahead numbers. If this is not
10208 \# desired, subhead and parahead numbers may be reset individually.
10210 .MAC RESET_HEAD_NUMBER END
10217 . nr #HEAD_NUM \\$1-1 1
10227 \# <none> | <anything>
10229 \# Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
10233 .MAC NUMBER_SUBHEADS END
10236 . if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
10238 . el \{ .rr #NUMBER_SH \}
10242 \# RESET SUBHEAD NUMBER
10243 \# --------------------
10245 \# <none> | <desired subhead number>
10247 \# Resets incrementing register #SH_NUM to 1 or, if there's
10248 \# an argument, to user supplied number.
10250 \# When the subhead number is reset, it resets the parahead number as
10251 \# well. If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
10252 \# allows the user to set the parahead number to whatever s/he desires.
10254 .MAC RESET_SUBHEAD_NUMBER END
10255 . ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
10257 . nr #SH_NUM \\$1-1 1
10263 \# NUMBER PARAHEADS
10264 \# ----------------
10266 \# <none> | <anything>
10268 \# Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
10272 .MAC NUMBER_PARAHEADS END
10275 . if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
10277 . el \{ .rr #NUMBER_PH \}
10281 \# RESET PARAHEAD NUMBER
10282 \# ---------------------
10284 \# <none> | <desired parahead number>
10286 \# Resets incrementing register #PH_NUM to 1 or, if there's
10287 \# an argument, to user supplied number.
10289 \# Resetting the parahead number resets the parahead number
10292 .MAC RESET_PARAHEAD_NUMBER END
10293 . ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
10294 . el \{ .nr #SH_NUM \\$1-1 1 \}
10298 \# PREFIX CHAPTER NUMBERS TO NUMBERED HEADS, SUBHEADS AND PARAHEADS
10299 \# ----------------------------------------------------------------
10301 \# <none> | <chapter number> | <anything>
10303 \# Toggles register #PREFIX_CH_NUM. Sets register #CH_NUM from
10304 \# string $CHAPTER if $CHAPTER is a digit; if <chapter number> arg
10305 \# given, sets #CH_NUM to arg.
10309 .MAC PREFIX_CHAPTER_NUMBER END
10312 . nr #PREFIX_CH_NUM 1
10313 . if \\n[#CHAPTER_CALLED] \{\
10314 . ie \B'\\*[$CHAPTER]' \{\
10315 . nr #CH_NUM \\*[$CHAPTER]
10318 . PREFIX_CH_NUM_WARNING
10320 . rr #CHAPTER_CALLED
10324 . ie \B'\\*[$CHAPTER]' \{\
10325 . nr #PREFIX_CH_NUM 1
10326 . nr #CH_NUM \\*[$CHAPTER]
10329 . PREFIX_CH_NUM_WARNING
10336 . nr #PREFIX_CH_NUM 1
10339 . rr #PREFIX_CH_NUM
10344 .MAC PREFIX_CH_NUM_WARNING END
10345 . tm1 "[mom]: PREFIX_CHAPTER_NUMBER cannot determine a chapter number.
10346 . tm1 " Please enter the current chapter number as a digit after
10347 . tm1 " PREFIX_CHAPTER_NUMBER.
10348 . ab Aborting on PREFIX_CHAPTER_NUMBER at line \\n(.c.
10352 \# ---Main heads---
10357 \# <none> | <anything>
10359 \# Creates or modifies register #HEAD_CAPS.
10364 . ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
10365 . el \{ .nr #HEAD_CAPS 0 \}
10372 \# <none> | <anything>
10374 \# Creates register #HEAD_SPACE, which toggles whether the space
10375 \# before heads is 1 extra line space ("off") or 2 ("on"). Used only
10376 \# in PRINTSTYLE TYPESET.
10380 .MAC HEAD_SPACE END
10381 . ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
10382 . el \{ .nr #HEAD_SPACE 0 \}
10389 \# "text of main head" ["text of main head"] ...
10391 \# In TYPEWRITE, prints main heads centered, all caps, underlined.
10392 \# In TYPESET, prints bold main heads 1 point larger than running
10393 \# text, all caps, underlined.
10395 \# The HEAD macro requires that double-quotes (") surround
10396 \# each line of text.
10400 . if \\n[#PRINT_STYLE]=1 \{ .ne \\n[#NUM_ARGS]+2 \}
10401 . if \\n[#PRINT_STYLE]=2 \{\
10402 . ie \\n[#HEAD_SPACE] \{ .ne \\n[#NUM_ARGS]+3 \}
10403 . el \{ .ne \\n[#NUM_ARGS]+2 \}
10405 .\" Collect head for TOC.
10407 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
10408 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
10409 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10410 . ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
10411 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\\|
10414 .\" Note that in the .as lines, below, \ at the end has a literal
10415 .\" space after it.
10416 . ie \\n[#NUMBER_HEAD] \{\
10417 . ie \\n[#ARG_NUM]=0 \{\
10418 . as $TOC_HEAD_ITEM \\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\ \"
10419 . nr #HEAD_NUM \\n-[#HEAD_NUM]
10422 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ \"
10426 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ \"
10430 .\" Note the use of \!, which transparently embeds the macros used
10431 .\" in the TOC_ENTRIES diversion. The elements they control must be
10432 .\" processed literally when the diversion is output.
10435 . if \\n[#PRINT_STYLE]=1 \{\
10440 . if \\n[#PRINT_STYLE]=2 \{\
10441 \!. FAMILY \\*[$TOC_HEAD_FAM]
10442 \!. FT \\*[$TOC_HEAD_FT]
10443 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
10447 . ie \\n[#PRINT_STYLE]=1 \{\
10448 \!. PAD "\\h'2m'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN_TYPEWRITE]"
10451 \!. PAD "\\h'\\n[#TOC_HEAD_INDENT]u'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN]"
10457 . if \\n[#PRINT_STYLE]=2 \{\
10458 \!. FAMILY \\*[$TOC_PN_FAM]
10459 \!. FT \\*[$TOC_PN_FT]
10460 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10463 \!. PRINT \\*[LEADER]
10466 \!. PRINT \\n[#TOC_ENTRY_PN]
10470 .\" End collection of head for TOC
10474 . ll \\n[#L_LENGTH]u
10476 . if \\n[#COLUMNS] \{\
10477 . ll \\n[#COL_L_LENGTH]u
10481 . QUAD \\*[$HEAD_QUAD]
10482 . if \\n[#PRINT_STYLE]=1 \{\
10484 . vs \\n[#DOC_LEAD]u
10487 . if \\n[#PRINT_STYLE]=2 \{\
10488 . FAMILY \\*[$HEAD_FAM]
10490 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
10491 . LS \\n[#DOC_LEAD]u
10493 . if r#QUOTE \{ .rr #QUOTE \}
10494 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
10495 . ie \\n[#START] \{\
10496 . if \\n[#DOC_HEADER]=0 \{ .RLD 1v \}
10499 . if \\n[#PRINT_STYLE]=1 \{\
10500 . if !\\n[#LINEBREAK] \{\
10501 . ALD \\n[#DOC_LEAD]u
10502 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
10505 . if \\n[#PRINT_STYLE]=2 \{\
10506 . ie \\n[#PP_SPACE] \{\
10507 . ie \\n[#END_QUOTE] \{ . \}
10509 . if !\\n[#LINEBREAK] \{\
10510 . if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
10515 . ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
10516 . el \{ .ALD \\n[#DOC_LEAD]u \}
10518 . if \\n[#END_QUOTE] \{\
10519 . if !\\n[#Q_FITS] \{\
10520 . RLD \\n[#DOC_LEAD]u
10521 . if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
10523 . if \\n[#Q_AT_TOP] \{\
10524 . RLD \\n[#DOC_LEAD]u
10525 . if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
10528 . if \\n[#LINEBREAK] \{\
10529 . if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
10536 . if \\n[#HEAD_CAPS] \{ .CAPS \}
10537 . if \\n[#PRINT_STYLE]=2 \{\
10538 . if \\n[#HEAD_COLOR]=1 \{\
10540 . COLOR \\*[$HEAD_COLOR]
10545 . if \\n[#PRINT_STYLE]=1 \{\
10546 . ie \\n[#HEAD_CAPS]=1 \{\
10547 . ds $HEAD_UNDERLINE_GAP 2p
10550 . ds $HEAD_UNDERLINE_GAP 4p
10553 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10554 . ie \\n[#NUMBER_HEAD] \{\
10555 . ie \\n[#ARG_NUM]=0 \{\
10556 . ie \\n[#PREFIX_CH_NUM]=1 \{\
10557 . ds $CH_NUM \\n[#CH_NUM].
10563 . ie \\n[#HEAD_UNDERLINE]=0 \{\
10564 . PRINT "\\*[$CH_NUM]\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]"
10567 . UNDERSCORE \\*[$HEAD_UNDERLINE_GAP] "\\*[$CH_NUM]\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]"
10573 . ie \\n[#HEAD_UNDERLINE]=0 \{\
10574 . PRINT "\\$[\\n+[#ARG_NUM]]"
10577 . UNDERSCORE \\*[$HEAD_UNDERLINE_GAP] "\\$[\\n+[#ARG_NUM]]"
10584 . ie \\n[#HEAD_UNDERLINE]=0 \{\
10585 . PRINT "\\$[\\n+[#ARG_NUM]]"
10588 . UNDERSCORE \\*[$HEAD_UNDERLINE_GAP] "\\$[\\n+[#ARG_NUM]]"
10596 . ALD \\n[#DOC_LEAD]u
10597 . if \\n[#NUMBER_HEAD] \{ .RESET_SUBHEAD_NUMBER \}
10598 . if \\n[#NUMBER_SH] \{ .RESET_PARAHEAD_NUMBER \}
10599 . if r#START \{ .rr #START \}
10600 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
10601 . if r#QUOTE \{ .rr #QUOTE \}
10602 . if r#Q_FITS \{ .rr #Q_FITS \}
10603 . if r#END_QUOTE \{ .rr #END_QUOTE \}
10604 . if r#LINEBREAK \{ .rr #LINEBREAK \}
10605 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
10606 . if r#PP_ACTIVE \{ .rr #PP_ACTIVE \}
10609 . rm $TOC_HEAD_ITEM
10619 \# "text of subhead" ["text of subhead"] ...
10621 \# In TYPEWRITE, prints subheads underlined.
10622 \# In TYPESET, prints subheads bold, .5 points larger than running
10624 \# In both styles, a line space precedes the subhead, and a small
10625 \# amount of lead comes after.
10627 \# As with the HEAD macro, double-quotes (") must surround
10628 \# each line of text.
10632 . ne \\n[#NUM_ARGS]+2
10633 .\" Collect subhead for TOC.
10635 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
10636 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10637 . ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
10638 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\\|
10641 .\" Note that in the .as lines, below, \ at the end has a literal
10642 .\" space after it.
10643 . ie \\n[#NUMBER_SH] \{\
10644 . ie \\n[#ARG_NUM]=0 \{\
10645 . as $TOC_SH_ITEM \\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]\ \"
10646 . nr #SH_NUM \\n-[#SH_NUM]
10649 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ \"
10653 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ \"
10657 .\" Note the use of \!, which transparently embeds the macros used
10658 .\" in the TOC_ENTRIES diversion. The elements they control must be
10659 .\" processed literally when the diversion is output.
10662 . if \\n[#PRINT_STYLE]=1 \{\
10667 . if \\n[#PRINT_STYLE]=2 \{\
10668 \!. FAMILY \\*[$TOC_SH_FAM]
10669 \!. FT \\*[$TOC_SH_FT]
10670 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
10674 . ie \\n[#PRINT_STYLE]=1 \{\
10675 \!. PAD "\\h'4m'\\*[$TOC_SH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
10678 \!. PAD "\\h'\\n[#TOC_SH_INDENT]u'\\*[$TOC_SH_ITEM]\\*[$TOC_PN]"
10684 . if \\n[#PRINT_STYLE]=2 \{\
10685 \!. FAMILY \\*[$TOC_PN_FAM]
10686 \!. FT \\*[$TOC_PN_FT]
10687 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10690 \!. PRINT \\*[LEADER]
10693 \!. PRINT \\n[#TOC_ENTRY_PN]
10697 .\" End collection of head for TOC
10698 .\" Process subhead
10700 . if r#QUOTE \{ .rr #QUOTE \}
10701 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
10703 . ll \\n[#L_LENGTH]u
10705 . if \\n[#COLUMNS] \{\
10706 . ll \\n[#COL_L_LENGTH]u
10710 . if \\n[#PRINT_STYLE]=1 \{\
10712 . vs \\n[#DOC_LEAD]u
10713 . QUAD \\*[$SH_QUAD]
10716 . if \\n[#PRINT_STYLE]=2 \{\
10717 . FAMILY \\*[$SH_FAM]
10719 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
10720 . LS \\n[#DOC_LEAD]u
10721 . QUAD \\*[$SH_QUAD]
10723 . if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
10724 . if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
10725 . ie \\n[#START] \{ .RLD 1v \}
10727 . ie \\n[#HEAD]=1 \{ . \}
10729 . if \\n[#PRINT_STYLE]=1 \{\
10730 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
10732 . if \\n[#PRINT_STYLE]=2 \{\
10733 . ie \\n[#PP_SPACE]=1 \{\
10734 . ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
10735 . el \{ .RLD \\n[#DOC_LEAD]u \}
10738 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
10744 . if \\n[#PRINT_STYLE]=1 \{\
10745 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10746 . ie \\n[#NUMBER_SH] \{\
10747 . ie \\n[#ARG_NUM]=0 \{\
10748 . ie \\n[#PREFIX_CH_NUM]=1 \{\
10749 . ds $CH_NUM \\n[#CH_NUM].
10754 . ie \\n[#NUMBER_HEAD] \{\
10756 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]"
10761 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]"
10767 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]"
10773 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]"
10778 . if \\n[#PRINT_STYLE]=1 \{\
10779 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
10781 . if \\n[#PRINT_STYLE]=2 \{\
10782 . if \\n[#SH_COLOR]=1 \{ .COLOR \\*[$SH_COLOR] \}
10783 . ie \\n[#PP_SPACE]=0 \{\
10784 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10785 . ie \\n[#NUMBER_SH] \{\
10786 . ie \\n[#ARG_NUM]=0 \{\
10787 . ie \\n[#PREFIX_CH_NUM]=1 \{\
10788 . ds $CH_NUM \\n[#CH_NUM].
10793 . ie \\n[#NUMBER_HEAD] \{\
10795 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
10800 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
10806 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
10812 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
10818 . ALD \\n[#DOC_LEAD]u
10819 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
10820 . if \\n[#END_QUOTE] \{ .RLD \\n[#DOC_LEAD]u \}
10821 . if \\n[#EPIGRAPH] \{ .RLD \\n[#DOC_LEAD]u \}
10822 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10823 . ie \\n[#NUMBER_SH] \{\
10824 . ie \\n[#ARG_NUM]=0 \{\
10825 . ie \\n[#PREFIX_CH_NUM]=1 \{\
10826 . ds $CH_NUM \\n[#CH_NUM].
10831 . ie \\n[#NUMBER_HEAD] \{\
10833 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
10838 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
10844 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
10850 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
10854 . ALD \\n[#DOC_LEAD]u
10859 . if \\n[#NUMBER_SH] \{ .RESET_PARAHEAD_NUMBER \}
10860 . if r#START \{ .rr #START \}
10861 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
10862 . if r#Q_FITS \{ .rr #Q_FITS \}
10863 . if r#END_QUOTE \{ .rr #END_QUOTE \}
10864 . if r#LINEBREAK \{ .rr #LINEBREAK \}
10870 \# ---Paragraph heads---
10875 \# <size of indent>
10877 \# Creates or modifies register #PH_INDENT.
10879 \# Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
10881 .MAC PARAHEAD_INDENT END
10882 . nr #PH_INDENT (\\$1)
10891 \# Deposits a paragraph head at the start and into the body of a
10894 \# PARAHEAD *must* come after PP.
10897 .\" Collect parahead for TOC.
10898 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
10899 . ie \\n[#NUMBER_PH] \{\
10900 . ds $TOC_PH_ITEM \\n+[#PH_NUM].\0\\$1\\|
10901 . nr #PH_NUM \\n-[#PH_NUM]
10904 . ds $TOC_PH_ITEM \\$1\\|
10908 . if \\n[#PRINT_STYLE]=1 \{\
10913 . if \\n[#PRINT_STYLE]=2 \{\
10914 \!. FAMILY \\*[$TOC_PH_FAM]
10915 \!. FT \\*[$TOC_PH_FT]
10916 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PH_SIZE_CHANGE]
10920 . ie \\n[#PRINT_STYLE]=1 \{\
10921 \!. PAD "\\h'6m'\\*[$TOC_PH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
10924 \!. PAD "\\h'\\n[#TOC_PH_INDENT]u'\\*[$TOC_PH_ITEM]\\*[$TOC_PN]"
10930 . if \\n[#PRINT_STYLE]=2 \{\
10931 \!. FAMILY \\*[$TOC_PN_FAM]
10932 \!. FT \\*[$TOC_PN_FT]
10933 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10936 \!. PRINT \\*[LEADER]
10939 \!. PRINT \\n[#TOC_ENTRY_PN]
10943 .\" End collection of parahead for TOC
10944 .\" Process parahead
10945 . if \\n[#SLANT_ON] \{\
10946 . nr #SLANT_WAS_ON 1
10949 . ie \\n[#PP]=1 \{\
10950 . if \\n[#INDENT_FIRST_PARAS] \{\
10951 . ti \\n[#PH_INDENT]u
10954 . el \{ .ti \\n[#PH_INDENT]u \}
10955 . ie \\n[#PREFIX_CH_NUM]=1 \{\
10956 . ds $CH_NUM \\n[#CH_NUM].
10961 . if \\n[#PRINT_STYLE]=1 \{\
10964 . ie \\n[#NUMBER_PH] \{\
10965 . if \\n[#NUMBER_HEAD] \{\
10966 . ie \\n[#NUMBER_SH] \{\
10967 . UNDERSCORE "\R'#NUMBERED 1'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
10971 . UNDERSCORE "\R'#NUMBERED 1'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1"
10975 . ie \\n[#NUMBER_SH] \{\
10976 . if !\\n[#NUMBERED] \{\
10977 . UNDERSCORE "\\*[$CH_NUM]\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
10982 . if !\\n[#NUMBERED] \{\
10983 . UNDERSCORE "\\*[$CH_NUM]\\n+[#PH_NUM].\\ \\$1"
10989 . UNDERSCORE "\\$1"
10992 . if \\n[#SLANT_WAS_ON] \{\
10993 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
10994 . if \\n[#SLANT_MEANS_SLANT] \{\
11000 . if \\n[#PRINT_STYLE]=2 \{\
11003 . PT_SIZE \\*[$PH_SIZE_CHANGE]
11004 . if \\n[#PH_COLOR]=1 \{ .COLOR \\*[$PH_COLOR] \}
11005 . ie \\n[#NUMBER_PH] \{\
11006 . ie \\n[#PREFIX_CH_NUM]=1 \{\
11007 . ds $CH_NUM \\n[#CH_NUM].
11012 . if \\n[#NUMBER_HEAD] \{\
11013 . ie \\n[#NUMBER_SH] \{\
11014 . PRINT "\R'#NUMBERED 1'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
11017 . PRINT "\R'#NUMBERED 1'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
11020 . ie \\n[#NUMBER_SH] \{\
11021 . if !\\n[#NUMBERED] \{\
11022 . PRINT "\\*[$CH_NUM]\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
11026 . if !\\n[#NUMBERED] \{\
11027 . PRINT "\\*[$CH_NUM]\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
11032 . PRINT "\\$1\h'.6m'\c"
11035 . FAMILY \\*[$DOC_FAM]
11037 . PT_SIZE \\n[#DOC_PT_SIZE]u
11038 . if \\n[#PH_COLOR]=1 \m[]\c
11039 . if \\n[#SLANT_WAS_ON] \{\
11048 \# ====================================================================
11050 \# +++LINE BREAKS+++
11052 \# LINEBREAK CHARACTER
11053 \# -------------------
11055 \# [character] [iterations] [vertical adjustment]
11057 \# Allows user to specify a line break character and the number
11058 \# of times to repeat it horiontally.
11060 \# Without an argument, LINEBREAK_CHAR will deposit a blank line.
11062 \# Vertical adjustment requires a unit of measure (most likely
11063 \# "p"), and has to be preceded by +|-
11065 .MAC LINEBREAK_CHAR END
11067 . ds $LINEBREAK_CHAR \\$1
11068 . ds $LINEBREAK_CHAR_V_ADJ \\$3
11069 . if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
11070 . ds $LINEBREAK_CHAR_V_ADJ +0
11072 . while \\$2>\\n[#REPEAT] \{\
11073 . as $LINEBREAK_CHAR "\\ \\$1
11074 . nr #REPEAT \\n[#REPEAT]+1
11085 \# Deposits line break character.
11087 \# If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
11090 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
11091 . po \\n[#DOC_L_MARGIN]u
11092 . ie '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
11094 . if \\n[#PRINT_STYLE]=1 \{\
11095 . ie \\n[#END_QUOTE] \{ . \}
11096 . el \{ .ALD \\n[#DOC_LEAD]u \}
11098 . if \\n[#PRINT_STYLE]=2 \{\
11099 . ie \\n[#END_QUOTE] \{ . \}
11100 . el \{ .ALD \\n[#DOC_LEAD]u \}
11105 . PRINT \m[\\*[$LINEBREAK_COLOR]]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\m[]
11106 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
11107 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
11109 . QUAD \\*[$DOC_QUAD]
11112 . if r#QUOTE \{ .rr #QUOTE \}
11113 . if r#END_QUOTE \{ .rr #END_QUOTE \}
11117 \# ====================================================================
11119 \# +++PARAGRAPHS+++
11124 \# <font of running text>
11126 \# Creates or modifies string $PP_FT.
11128 \# Affects all paragraphs.
11131 . if \n[#PRINT_STYLE]=1 \{\
11132 . ie \n[#ITALIC_MEANS_ITALIC] \{ .nop \}
11136 . if \\n[#COLLATE]=1 \{\
11137 . if !'\\*[$SAVED_PP_FT]'' \{ .rm $SAVED_PP_FT \}
11144 \# PARAGRAPH INDENT
11145 \# ----------------
11147 \# <amount to indent paragraphs in running text (ipPcm)>
11149 \# Allows user to change the default para indent. The change will
11150 \# affect the indent of QUOTEs and BLOCKQUOTEs as well.
11152 \# Default for printstyle TYPEWRITE is 1/2-inch. Default for
11153 \# printstyle TYPESET is 2 ems. The defaults are set in
11154 \# PRINTSTYLE, not DEFAULTS.
11156 .MAC PARA_INDENT END
11157 . nr #PP_INDENT (\\$1)
11161 \# INDENT FIRST PARAGRAPHS
11162 \# -----------------------
11164 \# <none> | <anything>
11166 \# By default, the first para of a document, as well as the first
11167 \# paras of blockquotes and block-style epigraphs are not indented.
11168 \# When invoked, this macro will indent all paras.
11172 .MAC INDENT_FIRST_PARAS END
11173 . ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
11174 . el \{ .rr #INDENT_FIRST_PARAS \}
11178 \# INTER-PARAGRAPH SPACING
11179 \# -----------------------
11181 \# <none> | <anything>
11183 \# Adds a line space between paragraphs in body text. Block quotes
11186 \# Default is OFF. PARA_SPACE ON is not recommended for use
11187 \# with PRINTSTYLE TYPEWRITE.
11189 .MAC PARA_SPACE END
11190 . ie '\\$1'' \{ .nr #PP_SPACE 1 \}
11191 . el \{ .rr #PP_SPACE \}
11200 \# Figures out what to do with paragraphs under differing conditions.
11202 \# For the time being, there's no automatic widow/orphan control.
11203 \# Controlling them isn't just a matter of establishing an arbitrary
11204 \# number of lines needed for a para, since groff doesn't then
11205 \# handle single line paragraphs gracefully. Usually, the whole
11206 \# page needs to be tweaked.
11208 \# Note the use of transparent line break (\!.br) to get
11209 \# PP to work within blockquotes and epigraphs.
11211 \# PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
11215 . if \\n[#DOC_TYPE]=4 \{\
11216 . if !'\\n(.z'' \{ .di \}
11217 . nr #TOTAL_FIELDS \\n[#FIELD]
11219 . nr #NUM_FIELDS 0 1
11220 . if \\n[#TOTAL_FIELDS]>0 \{\
11221 . while \\n+[#NUM_FIELDS]<=\\n[#TOTAL_FIELDS] \{\
11223 . LETTERHEAD\\n+[#FIELD]
11224 . QUAD \\*[$DOC_QUAD]
11225 . ALD \\n[#DOC_LEAD]u
11226 . if \\n[#DATE_FIRST]=1 \{ .ALD \\n[#DOC_LEAD]u \}
11228 . rm LETTERHEAD\\n[#FIELD]
11236 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
11237 . if \\n[#PP_STYLE]=1 \{\
11238 . if \\n[#ENDNOTE] \{\
11239 . nr #RESET_PARA_SPACE \\n[#PP_SPACE]
11240 . ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
11241 . el \{ .PARA_SPACE OFF \}
11244 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
11245 . if \\n[#COLUMNS] \{\
11246 . if !\\n[#ENDNOTE] \{\
11247 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
11248 . nr #L_MARGIN \\n(.o
11251 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
11252 . ie \\n[#PRINT_STYLE]=1 \{\
11254 . ie \\n[#ENDNOTE] \{ .vs \\n[#EN_LEAD]u \}
11255 . el \{ .vs \\n[#DOC_LEAD]u \}
11256 . QUAD \\*[$DOC_QUAD]
11258 . if \\n[#SLANT_ON] \{\
11259 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
11261 . if '\\*[$PP_FT]'I' \{\
11262 . if \\n[#ITALIC_MEANS_ITALIC] \{ .FT I \}
11266 . ie \\n[#ENDNOTE] \{\
11267 . FAMILY \\*[$EN_FAM]
11269 . PT_SIZE \\n[#EN_PS]u
11270 . vs \\n[#EN_LEAD]u
11271 . QUAD \\*[$EN_QUAD]
11274 . FAMILY \\*[$DOC_FAM]
11275 . if !'\\*[$SAVED_PP_FT]'' \{\
11276 . ds $PP_FT \\*[$SAVED_PP_FT]
11280 . PT_SIZE \\n[#DOC_PT_SIZE]u
11281 . LS \\n[#DOC_LEAD]u
11282 . QUAD \\*[$DOC_QUAD]
11285 . ie \\n[#PP]=0 \{\
11286 . if \\n[#INDENT_FIRST_PARAS] \{\
11287 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
11288 . el \{ .ti \\n[#PP_INDENT]u \}
11289 . if '\\n(.z'END_NOTES' \{\
11290 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
11293 . if r#END_QUOTE \{\
11294 . if \\n[#END_QUOTE] \{\
11295 . if !\\n[#LINEBREAK] \{\
11296 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
11297 . el \{ .ti \\n[#PP_INDENT]u \}
11298 . if '\\n(.z'END_NOTES' \{\
11299 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
11307 . if \\n[#PP_SPACE] \{\
11308 . if \\n[#PRINT_STYLE]=2 \{\
11309 . ie \\n[#END_QUOTE] \{\
11310 . ALD \\n[#DOC_LEAD]u
11313 . nr #BASELINE_MARK \\n(nl
11316 . if \\n[#NO_SPACE]=1 \{\
11319 . if !\\n(nl=\\n[#BASELINE_MARK] \{\
11320 . ALD \\n[#DOC_LEAD]u
11321 . rr #BASELINE_MARK
11326 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
11327 . el \{ .ti \\n[#PP_INDENT]u \}
11328 . if '\\n(.z'END_NOTES' \{\
11329 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
11332 . if r#START \{ .rr #START \}
11333 . if r#QUOTE \{ .rr #QUOTE \}
11334 . if r#END_QUOTE \{ .rr #END_QUOTE \}
11335 . if r#HEAD \{ .rr #HEAD \}
11336 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
11337 . if r#Q_FITS \{ .rr #Q_FITS \}
11338 . if r#LINEBREAK \{ .rr #LINEBREAK \}
11339 . if \\n[#ENDNOTE] \{\
11340 . ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
11341 . el \{ .PARA_SPACE OFF \}
11343 . if \\n[#CONDENSE] \{\
11346 . if \\n[#EXTEND]=1 \{\
11351 . if \\n[#PP_STYLE]=2 \{\
11353 . if \\n[#BROKEN_QUOTE] \{\
11354 . ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
11355 . el \{ .nr #Q_PP 0 \}
11358 . ie \\n[#Q_PP]=0 \{\
11359 . if \\n[#INDENT_FIRST_PARAS] \{\
11360 . ti \\n[#PP_INDENT]u/2u
11362 . if \\n[#ENDNOTE] \{\
11363 . ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
11368 . ti \\n[#PP_INDENT]u/2u
11369 . if \\n[#PP_SPACE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
11371 . if \\n[#CONDENSE] \{\
11374 . if \\n[#EXTEND]=1 \{\
11379 \# This takes care of multi-paragraph dialogue, where each para
11380 \# is introduced by an open quote whereas the previous para has
11382 . if \\n[#OPEN_CLOSE]=1 \{\
11388 \# ====================================================================
11392 \# ---Line for line quotes, i.e. poetry or code snippets---
11394 \# UNDERLINE QUOTES
11395 \# ----------------
11397 \# <none> | <anything>
11399 \# Creates or modifies register #UNDERLINE_QUOTES (toggle).
11400 \# If on, line for line quotes are underlined when printstyle
11403 \# Default is ON for printstyle TYPEWRITE.
11405 .MAC UNDERLINE_QUOTES END
11406 . ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
11407 . el \{ .rr #UNDERLINE_QUOTES \}
11414 \# <integer> | <integer with unit of measure appended>
11416 \# Creates or modifies register #Q_OFFSET_VALUE.
11418 \# If just an integer given, value by which to multiply PARA_INDENT
11419 \# to get quote indent. If integer with a unit of measure appended,
11420 \# absolute value of quote indent.
11422 \# Default is 3 for typeset; 2 for typewrite.
11424 .MAC QUOTE_INDENT END
11425 . if r#Q_OFFSET_VALUE \{ .rr #Q_OFFSET_VALUE \}
11426 . if !'\\*[$Q_OFFSET_VALUE]'' \{ .rm $Q_OFFSET_VALUE \}
11427 . ds $EVAL_QI_ARG \\$1
11428 . substring $EVAL_QI_ARG -1
11429 . ie \B'\\*[$EVAL_QI_ARG]' \{\
11430 . nr #Q_OFFSET_VALUE \\$1
11433 . ds $Q_OFFSET_VALUE \\$1
11442 \# <autolead value>
11444 \# Sets autolead for quotes and/or blockquotes.
11446 .MAC QUOTE_AUTOLEAD END
11447 . if '\\$0'QUOTE_AUTOLEAD' \{ .nr #Q_AUTOLEAD \\$1 \}
11448 . if '\\$0'BLOCKQUOTE_AUTOLEAD' \{ .nr #BQ_AUTOLEAD \\$1 \}
11449 . if '\\$0'ENDNOTE_QUOTE_AUTOLEAD' \{ .nr #EN_Q_AUTOLEAD \\$1 \}
11450 . if '\\$0'ENDNOTE_BLOCKQUOTE_AUTOLEAD' \{ .nr #EN_BQ_AUTOLEAD \\$1 \}
11453 .ALIAS BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
11454 .ALIAS ENDNOTE_QUOTE_AUTOLEAD QUOTE_AUTOLEAD
11455 .ALIAS ENDNOTE_BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
11457 \# ALWAYS FULLSPACE QUOTES
11458 \# -----------------------
11460 \# <none> | <anything>
11462 \# Toggles register #FULLSPACE_QUOTES.
11464 \# If user doesn't like the default 1/2 line space above and below
11465 \# quotes, s/he can turn it off here. Has no effect in TYPEWRITE.
11467 .MAC ALWAYS_FULLSPACE_QUOTES END
11468 . if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
11469 . el \{ .rr #FULLSPACE_QUOTES \}
11476 \# <none> | <anything>
11478 \# Indents quoted text on a line for line basis, or turns QUOTE off.
11480 \# Owing to the need to bottom align TYPESET pages, quoted text gets
11481 \# diverted so its depth can be measured (in DO_QUOTE) for determining
11482 \# how much space to put before and after.
11487 \# <none> | <anything>
11489 \# Indents quoted text on a line for line basis, or turns QUOTE off.
11491 \# Owing to the need to bottom align TYPESET pages, quoted text gets
11492 \# diverted so its depth can be measured (in DO_QUOTE) for determining
11493 \# how much space to put before and after.
11497 . if \\n[#LINENUMBERS]=1 \{\
11498 . nr #LINENUMBERS 2
11499 . nr #NEXT_LN \\n(ln
11504 . if \\n[#LINENUMBERS]=2 \{\
11505 . if \\n[#SILENT_QUOTE_LN]=1 \{ .nm \\n[#NEXT_LN] 1000 -4 \}
11510 . ie r#Q_OFFSET_VALUE \{\
11511 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
11513 . el \{ .ll \\n[#L_LENGTH]u-\\*[$Q_OFFSET_VALUE] \}
11514 . if \\n[#LINENUMBERS]=2 \{\
11515 . if \\n[#QUOTE_LN]=1 \{\
11516 . nm \\n(ln "" \\*[$Q_LN_GUTTER] -3-\\*[$Q_LN_GUTTER]
11520 . if \\n[#COLUMNS] \{\
11521 . ie r#Q_OFFSET_VALUE \{\
11522 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
11525 . ll \\n[#COL_L_LENGTH]u-\\*[$Q_OFFSET_VALUE]
11529 . if \\n[#PRINT_STYLE]=1 \{\
11531 . vs \\n[#DOC_LEAD]u
11534 . if \\n[#PRINT_STYLE]=2 \{\
11535 . FAMILY \\*[$QUOTE_FAM]
11536 . FT \\*[$QUOTE_FT]
11537 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
11538 . ie !r#Q_AUTOLEAD \{ .LS \\n[#Q_LEAD]u \}
11540 . AUTOLEAD \\n[#Q_AUTOLEAD]
11541 . nr #Q_LEAD \\n(.v
11543 . if \\n[#ENDNOTE] \{\
11544 . PT_SIZE \\n[#EN_PS]u\\*[$QUOTE_SIZE_CHANGE]
11545 . ie !r#EN_Q_AUTOLEAD \{ .LS \\n[#EN_Q_LEAD]u \}
11547 . AUTOLEAD \\n[#EN_Q_AUTOLEAD]
11548 . nr #EN_Q_LEAD \\n(.v
11551 . nr #Q_LEAD_REAL \\n(.v
11553 . if \\n[#QUOTE_COLOR]=1 \{\
11555 \m[\\*[$QUOTE_COLOR]]
11559 . if \\n[#LINENUMBERS]=2 \{\
11560 . ie \\n[#QUOTE_LN]=1 \{\
11561 . if '\\*[$Q_LN_GUTTER]'' .ds $Q_LN_GUTTER \\*[$LN_GUTTER]
11562 . nm \\n(ln "" \\*[$Q_LN_GUTTER] -3-\\*[$Q_LN_GUTTER]
11565 . if !\\n[#SILENT_QUOTE_LN] \{ .NUMBER_LINES OFF \}
11569 . if \\n[#PRINT_STYLE]=1 \{\
11570 . if \\n[#UNDERLINE_QUOTES] \{\
11575 . el \{ .DO_QUOTE \}
11582 \# <none [ BR | BREAK | SPREAD ]> | <anything [ BR | BREAK | SPREAD ]>
11584 \# Takes care of admistrivia associated with setting code snippets.
11592 . if '\\$1'BREAK' \{\
11596 . if '\\$1'SPREAD' \{\
11601 . ds $PRE_CODE_FAM \\n[.fam]
11602 . ds $PRE_CODE_FT \\n[.sty]
11603 . if !\\n[#PRINT_STYLE]=1 \{\
11604 . ie \\n[#CODE_FAM]=1 \{ .fam \\*[$CODE_FAM] \}
11608 . if \\n[#UNDERLINE_QUOTES]=1 \{\
11609 . nr #RESTORE_UNDERLINE 1
11610 . UNDERLINE_QUOTES OFF
11613 . if \\n[#PRINT_STYLE]=2 \{\
11616 . if \\n[#RESTORE_SQ]=1 \{\
11622 . fam \\*[$PRE_CODE_FAM]
11623 . ft \\*[$PRE_CODE_FT]
11625 . if \\n[#RESTORE_UNDERLINE]=1 \{\
11626 . rr #RESTORE_UNDERLINE
11629 . if \\n[#SQ_WAS_ON]=1 \{\
11633 . if \\n[#PRINT_STYLE]=2 \{\
11637 . if \\n[#NUM_ARGS]=2 \{\
11638 . if '\\$2'BR' \{ .br \}
11639 . if '\\$2'BREAK' \{ .br \}
11640 . if '\\$2'SPREAK' \{ .brp \}
11649 \# Creates register #CODE_FAM and string $CODE_FAM for use by CODE.
11651 .MAC CODE_FAMILY END
11653 . ds $CODE_FAM \\$1
11657 \# ---Blockquotes---
11662 \# <none> | <anything>
11664 \# Indents quoted text in fill mode and shortens line length
11665 \# equivalently, or turns BLOCKQUOTE off.
11667 \# Owing to the need to bottom align TYPESET pages, quoted text gets
11668 \# diverted so its depth can be measured (in DO_QUOTE) for determining
11669 \# how much space to put before and after.
11671 \# .PP after blockquote is optional if there's only one para,
11672 \# but REQUIRED if there's more than one.
11674 .MAC BLOCKQUOTE END
11676 . if \\n[#LINENUMBERS]=1 \{\
11677 . nr #LINENUMBERS 2
11678 . nr #NEXT_LN \\n(ln
11683 . if \\n[#LINENUMBERS]=2 \{\
11684 . if \\n[#SILENT_BQUOTE_LN]=1 \{ .nm \\n[#NEXT_LN] 1000 -4 \}
11691 . ie r#Q_OFFSET_VALUE \{\
11692 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11694 . el \{ .ll \\n[#L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u) \}
11695 . if \\n[#ENDNOTE] \{\
11696 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
11697 . ie r#Q_OFFSET_VALUE \{\
11698 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11701 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\*[$Q_OFFSET_VALUE]*2u)
11704 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
11705 . ie r#Q_OFFSET_VALUE \{\
11706 . ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11709 . ll \\n[#L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]u*2u)
11715 . if \\n[#COLUMNS] \{\
11716 . ie r#Q_OFFSET_VALUE \{\
11717 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11720 . ll \\n[#COL_L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11722 . if \\n[#ENDNOTE] \{\
11723 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
11724 . ie r#Q_OFFSET_VALUE \{\
11725 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11728 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\*[$Q_OFFSET_VALUE]*2u)
11731 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
11732 . ie r#Q_OFFSET_VALUE \{\
11733 . ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11736 . ll \\n[#COL_L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11742 . if \\n[#PRINT_STYLE]=1 \{\
11744 . vs \\n[#DOC_LEAD]u
11748 . if \\n[#PRINT_STYLE]=2 \{\
11749 . FAMILY \\*[$BQUOTE_FAM]
11750 . FT \\*[$BQUOTE_FT]
11751 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
11752 . ie !\\n[#BQ_AUTOLEAD] \{ .LS \\n[#BQ_LEAD]u \}
11754 . AUTOLEAD \\n[#BQ_AUTOLEAD]
11755 . nr #BQ_LEAD \\n(.v
11757 . if \\n[#ENDNOTE] \{\
11758 . PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
11759 . ie !r#EN_BQ_AUTOLEAD \{ .LS \\n[#EN_BQ_LEAD]u \}
11761 . AUTOLEAD \\n[#EN_BQ_AUTOLEAD]
11762 . nr #EN_BQ_LEAD \\n(.v
11765 . nr #Q_LEAD_REAL \\n(.v
11766 . if \\n[#BQUOTE_COLOR]=1 \{\
11768 \m[\\*[$BQUOTE_COLOR]]
11771 . QUAD \\*[$BQUOTE_QUAD]
11772 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
11773 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
11776 . if \\n[#LINENUMBERS]=2 \{\
11777 . ie \\n[#BQUOTE_LN]=1 \{\
11778 . if '\\*[$BQ_LN_GUTTER]'' .ds $BQ_LN_GUTTER \\*[$LN_GUTTER]
11779 . nm \\n(ln "" \\*[$BQ_LN_GUTTER] -3-\\*[$BQ_LN_GUTTER]
11782 . if !\\n[#SILENT_BQUOTE_LN] \{ .NUMBER_LINES OFF \}
11786 . if \\n[#INDENT_FIRST_PARAS] \{\
11787 . ie !\\n[#ENDNOTE] \{\
11788 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
11789 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
11792 . if \\n[#INDENT_FIRSTS]=1 \{\
11793 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
11794 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
11799 . el \{ .DO_QUOTE \}
11808 \# Ends the diversion P_QUOTE or B_QUOTE. Spaces them according to
11809 \# PRINTSTYLE, whether there's inter-paragraph spacing, and page
11810 \# position. TYPEWRITE treats spacing the same way in all circumstance
11811 \# (viz. an extra line space). TYPESET puts in only half
11812 \# line spaces if the entire quote plus 1 line of body under the quote
11813 \# fits on the the page; otherwise it puts in a full extra blank
11814 \# line. (This is to ensure the page remains bottom aligned).
11818 . if \\n[#DIVER_LN_OFF] \{\
11819 \!. NUMBER_LINES OFF
11824 . if \\n[#RESET_FN_COUNTERS]=2 \{\
11825 . if !\\n[#FN_COUNT]=1 \{\
11826 . if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
11828 . rr #RESET_FN_COUNTERS
11832 . nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
11833 . nr #DONE_ONCE 0 1
11836 . nr #Q_DEPTH (\\n[#DIVER_DEPTH]-\\n[#Q_LEAD_REAL])+\\n[#LEAD]
11837 . nr #Q_LEAD_DIFF \\n[#LEAD]-\\n[#Q_LEAD_REAL]
11841 . nr #CURRENT_V_POS \\n(nl+\\n[#Q_LEAD_DIFF]+(\\n[#DIVER_DEPTH]-\\n[#Q_DEPTH_REAL])
11844 . nr #Q_SPACE_ADJ \\n[#SHIM]/2
11845 . nr #TRAP \\n(.t-1
11846 . if \\n[#ENDNOTE] \{\
11847 . nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
11848 . ALWAYS_FULLSPACE_QUOTES
11850 . if \\n[#PRINT_STYLE]=1 \{\
11851 . if \\n[#START]=1 \{ . \}
11852 . if \\n[#START]=0 \{\
11853 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
11855 . if \\n[#HEAD] \{\
11856 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
11859 . if \\n[#PRINT_STYLE]=2 \{\
11860 . ie \\n[#PP_SPACE] \{\
11861 . ie \\n[#HEAD]>0 \{ . \}
11863 . ie \\n[#START] \{ . \}
11864 . el \{ .ALD \\n[#DOC_LEAD]u \}
11868 . ie \\n[#Q_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
11869 . ie (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_DEPTH]<\\n[#DOC_LEAD] \{\
11881 . ie r#Q_OFFSET_VALUE \{\
11882 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
11884 . el \{ .nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE] \}
11885 . if \\n[#COLUMNS] \{\
11886 . ie r#Q_OFFSET_VALUE \{\
11887 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
11889 . el \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE] \}
11891 . if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
11892 . if \\n[#ENDNOTE] \{\
11893 . ie r#Q_OFFSET_VALUE \{ .in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u \}
11894 . el \{ .in +\\*[$Q_OFFSET_VALUE] \}
11896 . ie \\n[#START]=1 \{\
11897 . ie !\\n[#Q_LEAD_DIFF]<0 \{ .ALD \\n[#Q_SPACE_ADJ]u \}
11898 . el \{ .RLD 0-\\n[#Q_LEAD_DIFF]u \}
11901 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#Q_SPACE_ADJ]u \}
11903 . if \\n[#QUOTE]=1 \{\
11906 . if !\\n[#START] \{ .rr #QUOTE \}
11908 . if \\n[#QUOTE]=2 \{\
11912 . if \\n[#PRINT_STYLE]=1 \{\
11913 . ALD \\n[#DOC_LEAD]u
11914 . if !\\n[.v]=\\n[#DOC_LEAD] \{ .SHIM \}
11916 . if \\n[#PRINT_STYLE]=2 \{\
11917 . ie \\n[#START] \{\
11918 . ie \\n[#PP_SPACE] \{\
11922 . ALD \\n[#DOC_LEAD]u
11927 . ie \\n[#PP_SPACE] \{ . \}
11929 . ie \\n[#HEAD]=1 \{\
11930 . ALD \\n[#DOC_LEAD]u
11934 . ie \\n[#FULLSPACE_QUOTES] \{\
11935 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
11936 . el \{ .ALD \\n[#DOC_LEAD]u \}
11938 . el \{ .ALD (\\n[#DOC_LEAD]u/2u) \}
11939 . ie \\n[#Q_FITS] \{\
11940 . ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
11948 .\" Make sure that Q_LEAD_DIFF is not added to the first line of
11949 .\" normal text at the top of any page following output of a quote
11950 .\" whose last line falls on B_MARGIN of the previous page.
11951 . if \\n(nl=(\\n[#T_MARGIN]-\\n[#DOC_LEAD]+\\n[#Q_LEAD_DIFF]) \{\
11954 . sp -1v-\\n[#Q_LEAD_DIFF]u
11961 . if \\n[#LINENUMBERS]=2 \{\
11962 . nr #LINENUMBERS 1
11963 . if !\\n[#ENDNOTE] \{\
11964 . ie \\n[#RESTORE_LN_NUM]=1 \{ .nm \\n[#NEXT_LN] \}
11968 . if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
11969 . if r#HEAD \{ .rr #HEAD \}
11970 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
11975 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
11976 . if \\n[#ENDNOTE] \{\
11977 . in \\n[#EN_TEXT_INDENT]u
11979 . if \\n[#COLUMNS] \{\
11980 . if !\\n[#ENDNOTE] \{\
11981 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
11982 . nr #L_MARGIN \\n(.o
11984 . if \\n[#ENDNOTE] \{\
11985 . in \\n[#EN_TEXT_INDENT]u
11988 . ie !\\n[#ENDNOTE] \{\
11989 . nr #RESET_PP_INDENT \\n[#PP_INDENT]
11992 . PARA_INDENT \\n[#RESET_PP_INDENT]u
11993 . QUAD \\*[$DOC_QUAD]
11996 . nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
11997 . ENDNOTE_PARA_INDENT 0
11999 . ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
12000 . QUAD \\*[EN_QUAD]
12002 . if r#DELAY_SHIM \{\
12009 \# Utility macros for DO_QUOTE
12010 \# ---------------------------
12014 . ie \\n[#HEAD]=1 \{\
12015 . ALD \\n[#Q_LEAD_DIFF]u
12018 . ie \\n[#START] \{ . \}
12020 . ie \\n[#FULLSPACE_QUOTES] \{\
12021 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
12022 . el \{ .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
12025 .\" This seems to be the only way to get the baseline of quotes that start
12026 .\" at the top of the page to fall on the first line of the "grid" (i.e on
12027 .\" the first valid baseline of the page).
12028 . ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
12029 . if \\n[#QUOTE]=1 \{\
12030 . rn P_QUOTE Q_TEMP
12034 . sp -1v+\\n[#Q_LEAD_DIFF]u
12038 . if \\n[#QUOTE]=2 \{\
12039 . rn B_QUOTE Q_TEMP
12041 . vs \\n[#BQ_LEAD]u
12043 . sp -1v+\\n[#Q_LEAD_DIFF]u
12050 . ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_LEAD_DIFF]u
12054 . if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
12061 . if \\n[#HEAD]=1 \{ . \}
12064 . ie \\n[#FULLSPACE_QUOTES] \{\
12065 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
12066 . el \{ .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
12068 . el \{ .ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_LEAD_DIFF]u \}
12069 . nr #Q_PARTIAL_DEPTH 0 \\n[#Q_LEAD_REAL]
12070 . while \\n+[#Q_PARTIAL_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
12073 . nr #Q_PARTIAL_DEPTH -\\n[#Q_LEAD_REAL]
12074 . nr #Q_SPACE_ADJ (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_PARTIAL_DEPTH]+\\n[#Q_LEAD_DIFF]u
12075 .\" Hack to deal with the fact that even though the above routine
12076 .\" makes the bottom line of the quote fall exactly on the bottom
12077 .\" margin when traps are disabled, it refuses to do so when traps
12078 .\" are on. The difference by which it's off is #Q_LEAD_DIFF
12079 .\" (the +\\n[#Q_LEAD_DIFF] at the end of the line, above). Hack
12080 .\" solution: temporarily lower the FOOTER trap position.
12081 . nr #SAVED_FOOTER_POS \\n[#VARIABLE_FOOTER_POS]
12082 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+.25v
12086 \# ====================================================================
12093 \# Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
12094 \# page, and reinvokes BLOCKQUOTE.
12096 \# Because quotes go into a diversion before they're output,
12097 \# footnotes in quotes that cross pages behave erratically. The footnote
12098 \# isn't processed until the diversion ends, hence the footnote
12099 \# marker in the quote isn't always correct for the new page (it's
12100 \# picked up from the old one). BREAK_QUOTE is a workaround for
12103 .MAC BREAK_QUOTE END
12106 . nr #BROKEN_QUOTE 1
12109 . nr #Q_DEPTH \\n[#DIVER_DEPTH]+\\n[#LEAD]
12110 . if \\n[#PRINT_STYLE]=1 \{\
12111 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
12112 . if \\n[#HEAD] \{\
12113 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
12116 . if \\n[#PRINT_STYLE]=2 \{\
12117 . ie \\n[#PP_SPACE] \{\
12118 . ie \\n[#HEAD]=1 \{ . \}
12120 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
12126 . if \\n[#HEAD]=1 \{ . \}
12128 . el \{ .ALD \\n[#DOC_LEAD]u \}
12131 . ie r#Q_OFFSET_VALUE \{\
12132 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
12135 . nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
12137 . if \\n[#COLUMNS] \{\
12138 . ie r#Q_OFFSET_VALUE \{\
12139 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
12142 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE]
12145 . po \\n[#Q_OFFSET]u
12146 . if \\n[#QUOTE]=1 \{\
12150 . if \\n[#QUOTE]=2 \{\
12154 . if r#HEAD \{ .rr #HEAD \}
12155 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
12160 . if \\n[#PRINT_STYLE]=1 \{\
12161 . if \\n[#UNDERLINE_QUOTES] \{\
12165 . po \\n[#L_MARGIN]u
12166 . if \\n[#COLUMNS] \{\
12167 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
12168 . nr #L_MARGIN \\n(.o
12170 . QUAD \\*[$DOC_QUAD]
12171 . sp |\\n[#PAGE_LENGTH]u \" To trip footer/header
12175 \# ====================================================================
12177 \# +++PAGINATION+++
12182 \# <none> | <anything>
12184 \# Turns page numbering off or on during document processing.
12189 . ie '\\$1'' \{ .nr #PAGINATE 1 \}
12190 . el \{ .nr #PAGINATE 0 \}
12191 . if \\n[#HF_OFF]=1 \{\
12192 . rr #PAGINATION_STATE
12198 \# SUSPEND PAGINATION (before ENDNOTES)
12199 \# ------------------
12203 \# Creates register #SUSPEND_PAGINATION
12205 \# Useful only to suspend pagination before outputting endnotes.
12207 .MAC SUSPEND_PAGINATION END
12208 . nr #SUSPEND_PAGINATION 1
12211 \# RESTORE PAGINATION (after ENDNOTES)
12212 \# ------------------
12216 \# Removes register #SUSPEND_PAGINATION. Creates register
12217 \# #DEFER_PAGINATION
12219 \# Useful only to restore pagination after outputting endnotes.
12221 .MAC RESTORE_PAGINATION END
12222 . rr #SUSPEND_PAGINATION
12223 . if \\n[#PAGE_NUM_V_POS]=1 \{ .PAGINATE \}
12224 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #DEFER_PAGINATION 1 \}
12228 \# PAGE NUMBER FORMAT
12229 \# ------------------
12231 \# DIGIT | ROMAN | roman | ALPHA | alpha
12233 \# Assigns user entered format to #PAGENUMBER.
12235 .MAC PAGENUM_STYLE END
12236 . nr #PAGENUM_STYLE_SET 1
12237 . if '\\$1'DIGIT' \{\
12238 . ds $PAGENUM_STYLE \\$1
12241 . if '\\$1'ROMAN' \{\
12242 . ds $PAGENUM_STYLE \\$1
12245 . if '\\$1'roman' \{\
12246 . ds $PAGENUM_STYLE \\$1
12249 . if '\\$1'ALPHA' \{\
12250 . ds $PAGENUM_STYLE \\$1
12253 . if '\\$1'alpha' \{\
12254 . ds $PAGENUM_STYLE \\$1
12260 \# HYPHENS AROUND PAGE NUMBERS
12261 \# ---------------------------
12263 \# <none> | <anything>
12265 \# Creates or modifies register #PAGE_NUM_HYPHENS.
12266 \# Used to dis/enable hyphens on either side of page numbers.
12270 .MAC PAGENUM_HYPHENS END
12271 . nr #PAGE_NUM_HYPHENS_SET 1
12272 . ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
12273 . el \{ .rr #PAGE_NUM_HYPHENS \}
12277 \# PAGENUMBER POSITION
12278 \# -------------------
12280 \# TOP | BOTTOM LEFT | CENTER | RIGHT
12282 \# Creates or modifies various PAGE_NUM_H | V_POS registers.
12283 \# Used to position page numbers.
12285 \# Default is center/bottom.
12287 .MAC PAGENUM_POS END
12288 . nr #PAGE_NUM_POS_SET 1
12289 . if '\\$1'TOP' \{ .nr #PAGE_NUM_V_POS 1 \}
12290 . if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
12291 . if '\\$2'LEFT' \{ .nr #PAGE_NUM_H_POS 1 \}
12292 . if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
12293 . if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
12294 . if '\\$2'RIGHT' \{ .nr #PAGE_NUM_H_POS 3 \}
12298 .MAC PN_WITH_HYPHENS END
12299 . nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
12300 . ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
12301 . PRINT \m[\\*[$PAGENUM_COLOR]]\\*[$HYPHEN]\|\\n[#PAGENUMBER]\|\\*[$HYPHEN]
12306 \# PRINT PAGE NUMBER
12307 \# -----------------
12311 \# Prints page number if PAGINATE=1.
12313 .MAC PRINT_PAGE_NUMBER END
12317 . po \\n[#DOC_L_MARGIN]u
12318 . ll \\n[#DOC_L_LENGTH]u
12320 . FAMILY \\*[$PAGE_NUM_FAM]
12321 . FT \\*[$PAGE_NUM_FT]
12322 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
12323 . if \\n[#PRINT_STYLE]=1 \{\
12326 . if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
12328 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
12332 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
12335 . if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
12336 . if \\n[#RECTO_VERSO]=0 \{\
12337 . if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
12338 . if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
12339 . if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT \}
12341 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
12342 . if \\n[#EN_FIRST_PAGE] \{\
12343 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
12344 . rr #EN_FIRST_PAGE
12346 . if \\n[#BIB_FIRST_PAGE] \{\
12347 . if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN] \}
12348 . rr #BIB_FIRST_PAGE
12350 . if \\n[#TOC_FIRST_PAGE] \{\
12352 . rr #TOC_FIRST_PAGE
12354 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
12355 . ie '\\*[$REVISION]'' \{\
12356 . PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT] / \\n[#PAGENUMBER]"
12359 . ie '\\*[$DRAFT]'' \{\
12360 . PRINT "\\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
12363 . PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT], \\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
12368 . ie \\n[#PAGE_NUM_HYPHENS] \{\
12369 . if '\\*[$PAGENUM_STYLE]'DIGIT' \{\
12371 1\\R'#CAP_HEIGHT \\n[.cht]'
12375 . if '\\*[$PAGENUM_STYLE]'ROMAN' \{\
12377 I\\R'#CAP_HEIGHT \\n[.cht]'
12381 . if '\\*[$PAGENUM_STYLE]'ALPHA' \{\
12383 E\\R'#CAP_HEIGHT \\n[.cht]'
12387 . if '\\*[$PAGENUM_STYLE]'roman' \{\
12388 . PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
12390 . if '\\*[$PAGENUM_STYLE]'alpha' \{\
12391 . PRINT "\m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-"
12394 . el \{ .PRINT "\m[\\*[$PAGENUM_COLOR]]\\n[#PAGENUMBER]" \}
12397 . nr #DIVER_DEPTH 0
12400 \# ====================================================================
12404 \# Mom's footnote handling is baroque, to say the least. There are
12405 \# redundancies in a number of the macros involved, as well as some
12406 \# registers that probably don't get used anymore. The baggage is left
12407 \# in in case some new footnote oddity/challenge gets thrown my way.
12409 \# The macros are heavily commented.
12411 \# FOOTNOTE AUTOLEAD
12412 \# -----------------
12414 \# <autolead value for footnotes>
12416 \# Creates or modifies register #FN_AUTOLEAD.
12418 \# Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
12420 .MAC FOOTNOTE_AUTOLEAD END
12421 . nr #FN_AUTOLEAD \\$1
12425 \# FOOTNOTE MARKERS
12426 \# ----------------
12428 \# <none> | <anything>
12430 \# Turns generation of footnote markers on or off.
12434 .MAC FOOTNOTE_MARKERS END
12435 . ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
12436 . el \{ .nr #FN_MARKERS 0 \}
12440 \# FOOTNOTE MARKER STYLE
12441 \# ---------------------
12443 \# STAR | NUMBER | LINE
12445 \# Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
12446 \# the style of footnote markers.
12448 \# 1=STAR; 2=NUMBER; 3=LINE. LINE means "use output line numbers".
12449 \# Default is STAR.
12451 .MAC FOOTNOTE_MARKER_STYLE END
12452 . if '\\$1'STAR' \{\
12453 . if \\n[#FN_MARKER_STYLE]=3 \{\
12454 . if !\\n[#NEWPAGE]=1 \{\
12455 . tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is LINE.
12456 . tm1 " You cannot change footnote marker style without
12457 . tm1 " first breaking to a new page with NEWPAGE.
12458 . tm1 " Ignoring request FOOTNOTE_MARKER_STYLE STAR at line \\n(.c.
12462 . if \\n[#RUN_ON]=1 \{\
12463 . tm1 "[mom]: FOOTNOTE_MARKER_STYLE STAR at line \\n(.c is incompatible
12464 . tm1 " with RUN_ON footnotes. Ignoring request.
12467 . nr #FN_MARKER_STYLE 1
12468 . if \\n[#NEWPAGE]=1 \{ .rr #NEWPAGE \}
12471 . if '\\$1'NUMBER' \{\
12472 . if \\n[#FN_MARKER_STYLE]=3 \{\
12473 . if !\\n[#NEWPAGE]=1 \{\
12474 . tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is NUMBER.
12475 . tm1 " You cannot change footnote marker style without
12476 . tm1 " first breaking to a new page with NEWPAGE.
12477 . tm1 " Ignoring request FOOTNOTE_MARKER_STYLE NUMBER at line \\n(.c.
12481 . if \\n[#RUN_ON]=1 \{\
12482 . tm1 "[mom]: FOOTNOTE_MARKER_STYLE NUMBER at line \\n(.c is incompatible
12483 . tm1 " with RUN_ON footnotes. Ignoring request.
12486 . nr #FN_MARKER_STYLE 2
12487 . if \\n[#NEWPAGE]=1 \{ .rr #NEWPAGE \}
12490 . if '\\$1'LINE' \{\
12491 . nr #FN_MARKER_STYLE 3
12492 . FOOTNOTE_MARKERS OFF
12493 . if !\\n[#FN_LN_SEP] \{\
12494 . if !\\n[#FN_LN_BRACKETS] \{ .FOOTNOTE_LINENUMBER_BRACKETS SQUARE \}
12500 \# FOOTNOTE LINENUMBER MARK
12501 \# ------------------------
12503 \# This string, when called inline, stores the current output line
12504 \# number in register #FN_MARK for use with FOOTNOTE.
12506 .ds FN-MARK \R'#FN_MARK \En(ln'
12509 \# FOOTNOTE LINENUMBER SEPARATOR
12510 \# -----------------------------
12512 \# <user-defined separator>
12514 \# Stores user-defined separator (for use then
12515 \# FOOTNOTE_MARKER_STYLE is LINE) in string $FN_LN_SEP. The
12516 \# separator is intended to be used when the user wishes a
12517 \# separator, rather than the choice of brackets offered by
12518 \# FOOTNOTE_LINENUMBER_BRACKETS.
12520 .MAC FOOTNOTE_LINENUMBER_SEPARATOR END
12521 . rr #FN_LN_BRACKETS
12523 . ds $FN_LN_SEP "\\$1
12527 \# FOOTNOTE LINENUMBER BRACKETS
12528 \# ----------------------------
12530 \# PARENS | SQUARE | BRACES or ( | [ | {
12532 \# Sets register #FN_LN_BRACKETS to 1, and creates strings
12533 \# $FN_OPEN_BRACKET and $FN_CLOSE_BRACKET according to the given
12536 .MAC FOOTNOTE_LINENUMBER_BRACKETS END
12538 . nr #FN_LN_BRACKETS 1
12539 . if '\\$1'PARENS' \{\
12540 . ds $FN_OPEN_BRACKET (
12541 . ds $FN_CLOSE_BRACKET )
12544 . ds $FN_OPEN_BRACKET (
12545 . ds $FN_CLOSE_BRACKET )
12547 . if '\\$1'SQUARE' \{\
12548 . ds $FN_OPEN_BRACKET [
12549 . ds $FN_CLOSE_BRACKET ]
12552 . ds $FN_OPEN_BRACKET [
12553 . ds $FN_CLOSE_BRACKET ]
12555 . if '\\$1'BRACES' \{\
12556 . ds $FN_OPEN_BRACKET {
12557 . ds $FN_CLOSE_BRACKET }
12560 . ds $FN_OPEN_BRACKET {
12561 . ds $FN_CLOSE_BRACKET }
12566 \# RESET FOOTNOTE NUMBER
12567 \# ---------------------
12571 \# Resets register #FN_NUMBER to 1. If argument is PAGE, creates
12572 \# toggle #RESET_FN_NUMBER which is checked in HEADER. If 1,
12573 \# numbered footnotes on every page start at 1.
12575 .MAC RESET_FOOTNOTE_NUMBER END
12576 . ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
12577 . el \{ .nr #RESET_FN_NUMBER 1 \}
12581 \# FOOTNOTE RULE LENGTH
12582 \# --------------------
12584 \# <length of rule used to separate footnotes from running text>
12586 \# Creates or modifies registers #FN_RULE_LENGTH.
12588 \# Requires unit of measure (iPpcm).
12589 \# Default is 4P for both PRINTSTYLEs.
12591 .MAC FOOTNOTE_RULE_LENGTH END
12592 . nr #FN_RULE_LENGTH (\\$1)
12596 \# FOOTNOTE_RULE_ADJ
12597 \# -----------------
12599 \# <number of points to raise footnote rule from it's baseline position>
12601 \# Creates or modifies register #FN_RULE_ADJ.
12603 \# Default is 3p for both TYPESTYLES.
12605 \# Requires unit of measure.
12607 .MAC FOOTNOTE_RULE_ADJ END
12608 . nr #FN_RULE_ADJ (\\$1)
12615 \# <none> | <anything>
12617 \# Turns printing of footnote separator rule on or off. If invoked as
12618 \# PRINT_FOOTNOTE_RULE, prints footnote separator rule.
12622 \# Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
12623 \# if the footnote number (#FN_COUNT) is 1.
12625 .MAC FOOTNOTE_RULE END
12626 . ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
12627 . if \\n[#FN_RULE]=0 \{ .RLD 1v \}
12630 \v'-\\n[#FN_RULE_ADJ]u-\\n[#FN_RULE_WEIGHT_ADJ]u'\
12631 \D't \\n[#FN_RULE_WEIGHT]'\
12632 \h'-\\n[#FN_RULE_WEIGHT]u'\
12633 \D'l \\n[#FN_RULE_LENGTH]u 0'\
12634 \v'+\\n[#FN_RULE_ADJ]u+\\n[#FN_RULE_WEIGHT_ADJ]u'
12635 \!. PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
12636 . QUAD \\*[$FN_QUAD]
12639 . ie '\\$1'' \{ .nr #FN_RULE 1 \}
12640 . el \{ .nr #FN_RULE 0 \}
12645 \# FOOTNOTE SPACING
12646 \# ----------------
12648 \# <per item post footnote spacing> | <anything>
12650 \# Enables printing of post footnote spacing.
12652 \# Default is no space.
12654 .MAC FOOTNOTE_SPACING END
12655 . ie \B'\\$1' \{ .nr #FN_SPACE (\\$1) \}
12656 . el \{ .nr #FN_SPACE 0 \}
12660 \# RUN ON FOOTNOTES
12661 \# ----------------
12663 \# <none> | <anything>
12665 \# Toggles run-on footnotes on or off.
12667 .MAC FOOTNOTES_RUN_ON END
12669 . if \\n[#FN_COUNT]>0 \{\
12670 . tm1 "[mom]: Switching to run-on footnotes at line \\n(.c will cause
12671 . tm1 " you to loose footnotes already formatted for this page.
12672 . tm1 " Ignoring request FOOTNOTES_RUN_ON.
12677 . if \\n[#FN_MARKER_STYLE]=1 \{ .RUNON_WARNING \}
12678 . if \\n[#FN_MARKER_STYLE]=2 \{ .RUNON_WARNING \}
12681 . if \\n[#FN_COUNT]>0 \{\
12682 . if \\n[#RUN_ON]=1 \{\
12683 . tm1 "[mom]: Switching off run-on footnotes at line \\n(.c will cause
12684 . tm1 " you to loose footnotes already formatted for this page.
12685 . tm1 " Ignoring request FOOTNOTES_RUN_ON \\$1.
12694 .MAC RUNON_WARNING END
12695 . if \\n[#FN_MARKER_STYLE]=1 \{\
12696 . tm1 "[mom]: The footnote marker style active at line \\n(.c is STAR,
12697 . tm1 " which is incompatible with run-on footnotes. Please change
12698 . tm1 " the footnote marker style to LINE. Continuing to process,
12699 . tm1 " but ignoring request FOOTNOTES_RUN_ON.
12702 . if \\n[#FN_MARKER_STYLE]=2 \{\
12703 . tm1 "[mom]: The footnote marker style active at line \\n(.c is NUMBER,
12704 . tm1 " which is incompatible with run-on footnotes. Please change
12705 . tm1 " the footnote marker style to LINE. Continuing to process,
12706 . tm1 " but ignoring request FOOTNOTES_RUN_ON.
12714 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value> | <anything>
12716 \# Begins collecting and diverting footnote text if no argument
12717 \# given. Otherwise, ends diversion FOOTNOTES, measures footnote
12718 \# depth, and sets footnote trap.
12720 \# The input line preceding a footnote call MUST terminate with \c
12721 \# or the footnote marker will be spaced away from the word it
12722 \# should be joined to.
12724 \# If FOOTNOTE is invoked with INDENT, the footnote will
12725 \# be indented. An indent style and an indent value must be given.
12726 \# Subsequent footnotes will NOT be indented; INDENT must be given
12727 \# for each footnote the user wants indented.
12731 . if \\n[#FN_MARKER_STYLE]=3 \{\
12732 . if !\\n[#LINENUMBERS] \{\
12733 . tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
12734 . tm1 " FOOTNOTE_MARKER_STYLE is LINE.
12735 . ab Aborting on FOOTNOTE at line \\n(.c.
12737 . if \\n[#FN_MARK]=0 \{ .nr #FN_MARK \\n(ln \}
12738 . nr #FN_MARK_2 \\n(ln
12739 . if '\\n(.z'P_QUOTE' \{\
12743 . if \\n[#IN_DIVER]=1 \{\
12744 . if '\\n(.z'P_QUOTE' \{\
12745 . if !\\n[#QUOTE_LN]=1 \{\
12746 . if !\\n[#SILENT_QUOTE_LN]=1 \{\
12747 . tm1 "[mom]: You have requested a line-numbered footnote inside a
12748 . tm1 " QUOTE at line \\n(.c, but line-numbering has not been enabled
12749 . tm1 " for QUOTES. Printing footnote with label "0".
12755 . if '\\n(.z'B_QUOTE' \{\
12756 . if !\\n[#BQUOTE_LN]=1 \{\
12757 . if !\\n[#SILENT_BQUOTE_LN]=1 \{\
12758 . tm1 "[mom]: You have requested a line-numbered footnote inside a
12759 . tm1 " BLOCKQUOTE at line \\n(.c, but line-numbering has not been enabled
12760 . tm1 " for BLOCKQUOTES. Printing footnote with label "0".
12768 .\" Begin processing footnotes that occur inside QUOTE, BLOCKQUOTE
12770 . if \\n[#IN_DIVER]=1 \{\
12771 . nr #PAGE_POS \\n(nl+\\n(.d+\\n[#DOC_LEAD]
12772 . nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS]-1)
12773 . nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
12774 .\" Are we on a "defer" line? If so, defer the text of the footnote.
12775 . ie \\n[#SPACE_TO_FOOTER]=\\n[#DOC_LEAD]:\\n[#SPACE_TO_FOOTER]=0 \{\
12776 . nr #DIVER_FN 2 \" treat like a normal deferred footnote
12779 . nr #DIVER_FN 2 \" treat like a normal footnote
12781 . if \\n[#PAGE_POS]>\\n[#FOOTER_POS] \{\
12782 . nr #DIVER_FN 1 \" move this footnote
12784 .\" Test for situation where, because a final line of QUOTE, BLOCKQUOTE
12785 .\" or EPIGRAPH isn't yet adjusted at this point, the last word on the
12786 .\" line may *seem* to belong to the final line of the page, but will,
12787 .\" in fact, become the first word of the subsequent page. In such
12788 .\" circumstances, we want the the footnote to be treated as a "moved"
12789 .\" diversion footnote.
12790 . if \\n(.k>\\n(.l \{ .nr #DIVER_FN 1 \}
12791 . if r#DIVER_FN \{\
12792 . if !\\n[#DIVER_FN]=2 \{ .\\n+[#DONE_ONCE] \}
12793 .\" A footnote inside a diversion will become the 1st footnote on the
12794 .\" following page/column.
12795 . if \\n[#DIVER_FN]=1 \{ .DIVER_FN_1_PRE \}
12796 .\" A footnote inside a diversion that should be treated like a
12797 .\" normal footnote (including defers.)
12798 . if \\n[#DIVER_FN]=2 \{ .DIVER_FN_2_PRE \}
12800 . nr #SAVED_FN_COUNT \\n[#FN_COUNT]+1
12801 . nr #SAVED_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]+1
12803 .\" End processing footnotes that occur inside QUOTE, BLOCKQUOTE or
12806 .\" Test for situation where, because a final line of running text
12807 .\" isn't yet adjusted at this point, the last word on the line may
12808 .\" *seem* to belong to the final line of the page, but will, in
12809 .\" fact, become the first word of the subsequent page. In such
12810 .\" circumstances, we want the the footnote marker in running text to
12811 .\" be the correct one for the 1st footnote on the page.
12812 . if \\n(.k>\\n(.l \{\
12813 . if (\\n(nl+\\n[#DOC_LEAD])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
12814 . ie \\n[#COLUMNS]=1 \{\
12815 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
12816 . if \\n[#FN_MARKER_STYLE]=1 \{\
12817 . nr #FN_COUNT_FOR_COLS 0 1
12819 . if \\n[#FN_MARKER_STYLE]=2 \{\
12820 . if \\n[#RESET_FN_NUMBER] \{\
12821 . nr #FN_NUMBER 0 1
12822 . nr #NOT_YET_ADJUSTED 1
12828 . if \\n[#FN_MARKER_STYLE]=1 \{\
12831 . if \\n[#FN_MARKER_STYLE]=2 \{\
12832 . if \\n[#RESET_FN_NUMBER] \{\
12833 . nr #FN_NUMBER 0 1
12834 . nr #NOT_YET_ADJUSTED 1
12840 . if \\n[#FN_MARKERS] \{\
12842 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
12843 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
12844 . if \\n[#PRINT_STYLE]=1 \{\
12845 . if \\n[#UNDERLINE_ON] \{\
12846 . nr #UNDERLINE_WAS_ON 1
12850 .\" Add footnote markers to running text...
12851 . if !\\n[#NO_FN_MARKER] \{\
12852 .\" ...but not if TERMINATE has not been called
12853 . if !r#TERMINATE \{\
12854 .\" Marker style star/dagger/double-dagger
12855 . if \\n[#FN_MARKER_STYLE]=1 \{\
12856 .\" Columnar docs either move col to col, or last col to next page.
12857 .\" They require their own special FN_COUNT because regular FN_COUNT
12858 .\" is used to figure out things like whether or not to put a rule
12859 .\" above footnotes (in addition to keeping track of the footnote
12860 .\" count in non-columnar docs).
12861 . ie \\n[#COLUMNS]=1 \{\
12862 . if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU2]*\c \}
12863 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU1]\(dg\c \}
12864 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dd\c \}
12865 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU2]**\c \}
12866 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU1]\(dg\(dg\c \}
12867 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dd\(dd\c \}
12868 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU2]***\c \}
12869 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg\c \}
12870 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dd\(dd\(dd\c \}
12871 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU2]****\c \}
12874 . if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU2]*\c \}
12875 . if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU1]\(dg\c \}
12876 . if \\n[#FN_COUNT]=2 \{ .PRINT \(dd\c \}
12877 . if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU2]**\c \}
12878 . if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU1]\(dg\(dg\c \}
12879 . if \\n[#FN_COUNT]=5 \{ .PRINT \(dd\(dd\c \}
12880 . if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU2]***\c \}
12881 . if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg\c \}
12882 . if \\n[#FN_COUNT]=8 \{ .PRINT \(dd\(dd\(dd\c \}
12883 . if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU2]****\c \}
12886 .\" Marker style superscript numbers
12887 . if \\n[#FN_MARKER_STYLE]=2 \{\
12888 . 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" \}
12889 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]\c" \}
12894 .\" More housekeeping
12896 .\" #SPACE_REMAINING is the space left between where we are
12897 .\" on the page and the bottom margin. It's used to determine whether
12898 .\" or not the footnote will overflow, and how many lines of
12899 .\" footnotes will fit on the page if some have to overflow.
12900 . ie \\n[#DIVER_FN]=2 \{\
12901 . nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-(\\n[#PAGE_POS])
12904 . nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n(nl
12906 . if \\n[#FROM_DIVERT_FN]=1 \{\
12907 . nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]
12908 . rr #FROM_DIVERT_FN
12910 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
12912 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
12913 . INDENT_FIRST_PARAS
12914 .\" Prepare FOOTNOTE to receive footnote text.
12916 . ll \\n[#DOC_L_LENGTH]u
12918 . if \\n[#COLUMNS]=1 \{\
12919 . ll \\n[#COL_L_LENGTH]u
12922 . if \\n[#FN_R_INDENT] \{\
12923 . ll -\\n[#FN_R_INDENT]u
12926 . if \\n[#FN_BR_INDENT] \{\
12927 . ll -\\n[#FN_BR_INDENT]u
12930 . FAMILY \\*[$FN_FAM]
12932 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
12933 . AUTOLEAD \\n[#FN_AUTOLEAD]
12934 . QUAD \\*[$FN_QUAD]
12935 . if \\n[#PRINT_STYLE]=1 \{\
12937 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
12938 . el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
12942 . nr #FN_LEAD \\n[#LEAD]
12943 .\" Begin diversion FOOTNOTES or FN_IN_DIVER
12944 . ie r#COUNTERS_RESET \{\
12945 . ie \\n[#DONE_ONCE]=1 \{\
12946 . ie \\n[#RUN_ON] \{\
12947 . di RUNON_FN_IN_DIVER
12948 . nr #RUNON_FN_IN_DIVER 1
12950 . el \{ .di FN_IN_DIVER \}
12953 . ie \\n[#RUN_ON] \{\
12954 . da RUNON_FN_IN_DIVER
12955 . nr #RUNON_FN_IN_DIVER 1
12957 . el \{ .da FN_IN_DIVER \}
12962 . ie \\n[#RUN_ON] \{\
12963 . da RUNON_FOOTNOTES
12964 . nr #RUNON_FOOTNOTES 1
12966 . el \{ .da FOOTNOTES \}
12968 . if \\n[#FOOTNOTE_COLOR]=1 \{\
12971 \m[\\*[$FOOTNOTE_COLOR]]
12976 . if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
12977 .\" When a deferred footnote is also the 1st footnote on the page,
12978 .\" and when the page it's output on also has footnotes, some
12979 .\" whitespace is needed between the deferred footnote and the
12980 .\" first footnote belonging to the output page so that there's
12981 .\" no confusion when two stars (or two number 1s) appear in
12983 . if \\n[#FN_DEFER_SPACE] \{\
12984 .\" ...but only add the extra space if TERMINATE has not been called
12985 . if !r#TERMINATE \{\
12986 .\" ...and not if defer space has already been added
12987 . if !\\n[#DEFER_SPACE_ADDED] \{\
12988 .\" ...and not if the footnote count the last time we checked for
12989 .\" a defer situation inside a diversion is greater than 1.
12990 . if !\\n[#SAVED_DIVER_FN_COUNT]>1 \{\
12991 . if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
12992 . if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
12993 . nr #DEFER_SPACE_ADDED 1
12997 . rr #FN_DEFER_SPACE
12998 . rr #SAVED_DIVER_FN_COUNT
13000 . if \\n[#DIVERTED]=3 \{\
13001 . if \\n[#FN_COUNT]>0 \{\
13005 .\" Add footnote rule (or, if no rule, some whitespace).
13006 .\" N.B.- this line increments #FN_COUNT each and every time FOOTNOTE
13008 . if \\n+[#FN_COUNT]=1 \{\
13009 .\" If a footnote is called in a diversion, and the footnote has to
13010 .\" be moved, don't put in the rule now (it's taken care of when
13011 .\" FN_IN_DIVER is output into FOOTNOTE in PROCESS_FN_IN_DIVER).
13012 . if !\\n[#DONT_RULE_ME]=1 \{\
13013 . if !\\n[#FN_DEPTH] \{\
13014 . if \\n[#PRINT_STYLE]=1 \{\
13015 . if !\\n[#RUN_ON] \{ .ALD \\n[#DOC_LEAD]u \}
13017 . ie \\n[#FN_RULE]=1 \{\
13018 . if !\\n[#RUN_ON] \{ .PRINT_FOOTNOTE_RULE \}
13026 .\" Add footnote markers to footnote text...
13027 . ie \\n[#FN_MARKERS] \{\
13028 . if \\n[#FN_SPACE]>0 \{\
13029 . if \\n[#FN_COUNT]>0 \{\
13030 . ALD \\n[#FN_SPACE]u
13033 . if !\\n[#NO_FN_MARKER] \{\
13034 .\" ...but not if TERMINATE has been called.
13035 . if !r#TERMINATE \{\
13036 . if \\n[#REF]=1 \{\
13037 \!. in +\\*[$REF_FN_INDENT]
13038 \!. ti -\\*[$REF_FN_INDENT]
13040 . if \\n[#FN_MARKER_STYLE]=1 \{\
13041 . ie \\n[#COLUMNS]=1 \{\
13042 . \\n+[#FN_COUNT_FOR_COLS]
13043 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT *\c \}
13044 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dg\c \}
13045 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \(dd\c \}
13046 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT **\c \}
13047 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dg\(dg\c \}
13048 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \(dd\(dd\c \}
13049 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT ***\c \}
13050 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dg\(dg\(dg\c \}
13051 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \(dd\(dd\(dd\c \}
13052 . if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT ****\c \}
13055 . if \\n[#FN_COUNT]=1 \{ .PRINT *\c \}
13056 . if \\n[#FN_COUNT]=2 \{ .PRINT \(dg\c \}
13057 . if \\n[#FN_COUNT]=3 \{ .PRINT \(dd\c \}
13058 . if \\n[#FN_COUNT]=4 \{ .PRINT **\c \}
13059 . if \\n[#FN_COUNT]=5 \{ .PRINT \(dg\(dg\c \}
13060 . if \\n[#FN_COUNT]=6 \{ .PRINT \(dd\(dd\c \}
13061 . if \\n[#FN_COUNT]=7 \{ .PRINT ***\c \}
13062 . if \\n[#FN_COUNT]=8 \{ .PRINT \(dg\(dg\(dg\c \}
13063 . if \\n[#FN_COUNT]=9 \{ .PRINT \(dd\(dd\(dd\c \}
13064 . if \\n[#FN_COUNT]=10 \{ .PRINT ****\c \}
13067 . if \\n[#FN_MARKER_STYLE]=2 \{\
13068 . if \\n[#COLUMNS]=1 \{\
13069 . \\n+[#FN_COUNT_FOR_COLS]
13071 . if \\n[#NOT_YET_ADJUSTED]=1 \{\
13072 . nr #FN_NUMBER 1 1
13073 . rr #NOT_YET_ADJUSTED
13075 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
13076 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\*[FU 2]\c" \}
13082 .\" Line-numbered footnotes handling
13083 . if \\n[#FN_MARKER_STYLE]=3 \{\
13084 . if \\n[#FN_SPACE]>0 \{\
13085 . if !\\n[#RUN_ON]=1 \{\
13086 . if \\n[#FN_COUNT]>0 \{\
13087 . ALD \\n[#FN_SPACE]u
13091 . if \\n[#REF]=1 \{\
13092 . if !\\n[#RUN_ON]=1 \{\
13093 \!. in +\\*[$REF_FN_INDENT]
13094 \!. ti -\\*[$REF_FN_INDENT]
13097 . ie \\n[#FN_LN_BRACKETS]=1 \{\
13098 . ds $FN_LINENUMBER \v'-.085m'\\*[$FN_OPEN_BRACKET]\v'.085m'
13099 . ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \{\
13100 . as $FN_LINENUMBER \\n[#FN_MARK]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m' \"
13103 . as $FN_LINENUMBER \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m' \"
13107 . ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \{\
13108 . ds $FN_LINENUMBER \\n[#FN_MARK]\\*[$FN_LN_SEP]
13111 . ds $FN_LINENUMBER \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\\*[$FN_LN_SEP]
13114 . if !\\n[#NO_FN_MARKER] \{\
13115 . PRINT \\*[$FN_LINENUMBER]\c
13117 . rm $FN_LINENUMBER
13123 .\" If INDENT arg is passed to FOOTNOTE, calculate the indent...
13124 . ie '\\$1'INDENT' \{\
13126 . if '\\$2'L' \{ .in (\\$3) \}
13127 . if '\\$2'LEFT' \{ .in (\\$3) \}
13128 . if '\\$2'R' \{ .nr #FN_R_INDENT (\\$3) \}
13129 . if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
13131 . nr #FN_BL_INDENT (\\$3)
13132 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
13133 . el \{ .nr #FN_BR_INDENT (\\$4) \}
13134 . in \\n[#FN_BL_INDENT]u
13136 . if '\\$2'BOTH' \{\
13137 . nr #FN_BL_INDENT (\\$3)
13138 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
13139 . el \{ .nr #FN_BR_INDENT (\\$4) \}
13140 . in \\n[#FN_BL_INDENT]u
13143 .\" ...then re-run FOOTNOTE without an argument.
13148 .\" Add "defer space" if the previously diverted footnote was the
13149 .\" 1st footnote proper to its page (i.e. it looks like a deferred
13150 .\" footnote but it's really an overflow).
13151 . if \\n[#DIVERTED] \{\
13152 . if \\n[#PREV_FN_DEFERRED]=1 \{\
13153 . if \\n[#FN_MARKER_STYLE]=1 \{ .ALD \\n[#FN_LEAD]u \}
13154 . if \\n[#RESET_FN_NUMBER] \{ .ALD \\n[#FN_LEAD]u \}
13155 . nr #PREV_FN_DEFERRED 2
13158 . if \\n[#REF]=1 \{\
13161 .\" Terminate FOOTNOTES or FN_IN_DIVER diversion
13163 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
13165 .\" More housekeeping
13166 .\" Turn off indent possibly set by FOOTNOTE INDENT
13168 .\" Restore sentence spacing
13169 . if \\n[#PRINT_STYLE]=2 \{\
13170 . if d$RESTORE_SS_VAR \{ .SS \\*[$RESTORE_SS_VAR] \}
13171 . rm $RESTORE_SS_VAR
13173 . if \\n[#PRINT_STYLE]=1 \{\
13174 . if \\n[#UNDERLINE_WAS_ON] \{\
13176 . rr #UNDERLINE_WAS_ON
13182 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
13183 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
13184 . rr #INDENT_FIRSTS
13185 .\" Calculate footnote depth, but not if #COUNTERS_RESET (created in
13186 .\" DIVER_FN_1_PRE) to instruct FOOTNOTES to skip this step for now
13187 .\" (it's taken care of when FN_IN_DIVER is output into FOOTNOTES in
13188 .\" PROCESS_FN_IN_DIVER).
13189 . ie r#COUNTERS_RESET \{\
13190 . rr #COUNTERS_RESET
13194 .\" If the footnote is the 1st on the page and it falls too close
13195 .\" to the bottom margin, defer the footnote text to the next page...
13196 . if (\\n[#SPACE_REMAINING]-1)<=(\\n[#DOC_LEAD]) \{\
13197 .\" ...but not if PROCESS_FN_LEFTOVER has set #PREV_FN_DEFERRED to 1
13198 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
13200 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
13202 .\" This is required so that the defer space clause can distinguish
13203 .\" a real #FN_COUNT=1 from one generated if FOOTNOTE is run inside
13204 .\" QUOTE, BLOCKQUOTE or EPIGRAPH
13205 . if \\n[#DIVER_FN]=2 \{\
13206 . nr #SAVED_DIVER_FN_COUNT \\n[#FN_COUNT]
13211 .\" Calculate the footnote depth.
13212 . if \\n[#GET_DEPTH]=1 \{\
13213 .\" Save the previous footnote depth (for use when there will be
13214 .\" some overflowed footnote text).
13215 . nr #SAVED_FN_DEPTH_1 \\n[#FN_DEPTH]
13216 .\" Add the depth of the current footnote to any already existent
13218 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
13219 .\" Special handling for run-on footnotes
13220 . if \\n[#RUN_ON]=1 \{\
13221 . if \\n[#RUNON_FOOTNOTES] \{\
13222 . unformat RUNON_FOOTNOTES
13224 . if \\n[#RUNON_FN_IN_DIVER] \{\
13225 . unformat RUNON_FN_IN_DIVER
13228 .\" Recreate FOOTNOTES with rule followed by text of unformatted
13229 .\" run-on footnotes.
13231 . ie \\n[#FN_RULE]=0 \{ .RLD 1v \}
13233 \v'-\\n[#FN_RULE_ADJ]u-\\n[#FN_RULE_WEIGHT_ADJ]u'\
13234 \D't \\n[#FN_RULE_WEIGHT]'\
13235 \h'-\\n[#FN_RULE_WEIGHT]u'\
13236 \D'l \\n[#FN_RULE_LENGTH]u 0'\
13237 \v'+\\n[#FN_RULE_ADJ]u+\\n[#FN_RULE_WEIGHT_ADJ]u'
13240 . if \\n[#RUNON_FOOTNOTES] \{\
13242 . rr #RUNON_FOOTNOTES
13244 . if \\n[#RUNON_FN_IN_DIVER] \{\
13245 . RUNON_FN_IN_DIVER
13246 . rr #RUNON_FN_IN_DIVER
13251 . nr #FN_DEPTH \\n[#DIVER_DEPTH]
13252 . nr #SAVED_VFP 0+\\n[#VARIABLE_FOOTER_POS]
13253 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
13255 .\" Save the new depth
13256 . nr #SAVED_FN_DEPTH_2 \\n[#FN_DEPTH]
13257 .\" Signal that defer space should be added when PROCESS_FN_LEFTOVER
13258 .\" processes deferred footnotes.
13259 . if \\n[#FN_DEFER] \{\
13260 . if \\n[#FN_COUNT]=2 \{\
13261 . ie \\n[#COLUMNS] \{\
13262 . if !\\n[#FROM_FOOTER] \{\
13263 . if \\n[#FN_DEFER]=1 \{ .nr #FN_DEFER_SPACE 1 \}
13264 . if \\n[#FN_COUNT_FOR_COLS]>=1 \{ .rr #FN_DEFER_SPACE \}
13265 . if \\n[#FROM_HEADER] \{ .nr #FN_DEFER_SPACE 1 \}
13269 . nr #FN_DEFER_SPACE 1
13274 .\" If the depth of the whole footnote won't fit in the space
13275 .\" between where we are on the page and the bottom margin, calculate
13276 .\" how much of it will fit.
13277 . if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
13279 . while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
13280 . nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
13282 . nr #VFP_DIFF \\n[#FN_DEPTH]-\\n[#SAVED_FN_DEPTH_1]
13284 .\" Very occasionally, #VFP_DIFF, on a 1st footnote that isn't to
13285 .\" be deferred, comes up with a depth equal to exactly 1 line
13286 .\" of footnotes, i.e. enough room to print the rule and nothing
13287 .\" else. The following tests for such a condition, and rather than
13288 .\" attempting to treat the footnote as an overflow, it tells mom to
13289 .\" treat it as a special kind of deferred footnote (#FN_DEFER 2).
13290 . if \\n[#SAVED_FN_DEPTH_1]=0 \{\
13291 . if \\n[#FN_DEPTH]=\\n[#FN_LEAD] \{\
13293 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_2]
13298 .\" Calculate VFP based on whether the footnote overflows, or is to
13299 .\" be treated normally.
13300 . ie \\n[#OVERFLOW]=1 \{\
13301 . if \\n[#RUN_ON] \{\
13302 . rr #VARIABLE_FOOTER_POS
13303 . nr #VARIABLE_FOOTER_POS \\n[#SAVED_VFP]
13305 . ie \\n[#FN_COUNT]=1 \{\
13306 . ie \\n[#RULED]=1 \{\
13307 . ie \\n[#COLUMNS]=1 \{\
13308 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13309 . ie \\n[#FROM_FOOTER] \{\
13310 . ie \\n[#FN_COUNT_FOR_COLS]>1 \{\
13311 . nr #FN_DEPTH -\\n[#FN_DEPTH]
13312 . if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
13313 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
13314 . nr #FN_DEPTH -\\n[#VFP_DIFF]
13318 . nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
13319 . if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
13323 . nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
13327 . nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
13330 . el \{ .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]) \}
13333 . nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
13334 . if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
13335 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
13336 . ie \\n[#COLUMNS]=1 \{\
13337 . if !\\n[#FROM_FOOTER] \{\
13342 . nr #FN_DEPTH -\\n[#VFP_DIFF]
13345 . if \\n[#DIVERTED]=3 \{\
13346 . if !\\n[#PREV_FN_DEFERRED] \{\
13347 . if !\\n[#FROM_FOOTER] \{\
13348 . if \\n[#FN_COUNT]=1 \{\
13349 . if !\\n[#VFP_DIFF] \{\
13350 . if \\n[#FN_MARKER_STYLE]=1 \{\
13352 \!. ALD \\n[#FN_LEAD]u
13355 . if \\n[#RESET_FN_NUMBER] \{\
13357 \!. ALD \\n[#FN_LEAD]u
13366 .\" Not sure what I was thinking with this next line. As is, it
13367 .\" moves the already established VFP trap for footnote 1 higher up
13368 .\" the page, resulting in a VFP that's higher on the page than the
13369 .\" current page position. Leaving it in anyway, commented out, in
13370 .\" case the logic and the conditions under which it should
13371 .\" apply reveal themselves.
13372 \#. nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
13373 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
13376 . nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
13377 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
13383 . nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
13384 . if \\n[#PREV_FN_DEFERRED]=1 \{\
13385 . if \\n[#DIVERTED] \{\
13386 . if !\\n[#FN_DEPTH]=\\n[#SAVED_FN_DEPTH_1] \{\
13387 . nr #FN_DEPTH +\\n[#FN_LEAD]
13388 . nr #VARIABLE_FOOTER_POS -\\n[#FN_LEAD]
13389 . rr #PREV_FN_DEFERRED
13393 . if \\n[#FN_COUNT]>1 \{\
13401 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13402 .\" See VFP_CHECK for an explanation of the next lines.
13403 .\" The trap has to be removed, prior to setting it, each time
13404 .\" FOOTNOTE is run.
13405 . if \\n[#PRINT_STYLE]=2 \{\
13407 . wh \\n[#VARIABLE_FOOTER_POS]u-\\n[#DOC_LEAD]u VFP_CHECK
13409 .\" If we have a footnote whose text has to be deferred to the next
13410 .\" page, reset the FOOTER trap to its original location.
13411 . if \\n[#FN_DEFER] \{\
13412 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
13413 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13416 . nr #NO_FN_MARKER 0
13418 . if \\n[#NUM_ARGS]=2 \{\
13419 . if '\\$2'BREAK' \{ .BR \}
13420 . if '\\$2'BR' \{ .BR \}
13424 \# Utility macros to manage footnotes that occur inside diversions
13425 \# ---------------------------------------------------------------
13427 \# There are some redundancies here; they're left in in case unforeseen
13428 \# footnote situations crop up in the future that might require
13429 \# manipulation of them.
13431 \# 1. Pre-footnote processing for footnotes in diversions
13433 \# a) A footnote inside a diversion will be moved entirely (marker
13434 \# in running text and text of footnote) to the next page/column.
13436 .MAC DIVER_FN_1_PRE END
13437 . nr #RESET_FN_COUNTERS 1
13438 . nr #COUNTERS_RESET 1
13439 . if \\n[#DONE_ONCE]=1 \{\
13440 . if \\n[#FN_DEFER] \{\
13441 . if \\n[#SAVED_DIVER_FN_COUNT]=1 \{\
13442 . ie \\n[#COLUMNS]=1 \{\
13443 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_DEFER_SPACE 1 \}
13446 . nr #FN_DEFER_SPACE 1
13450 . if \\n[#FN_MARKER_STYLE]=1 \{\
13451 . if \\n[#FN_COUNT]>0 \{ .nr #FN_COUNT 0 1 \}
13452 . if \\n[#COLUMNS]=1 \{\
13453 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13454 . nr #FN_COUNT_FOR_COLS 0 1
13458 . if \\n[#FN_MARKER_STYLE]=2 \{\
13459 . if \\n[#RESET_FN_NUMBER]=1 \{\
13460 . ie \\n[#COLUMNS]=1 \{\
13461 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
13464 . nr #FN_NUMBER 0 1
13471 \# b) Treat as a normal footnote, including defers.
13473 .MAC DIVER_FN_2_PRE END
13474 . nr #RESET_FN_COUNTERS 2
13477 \# 2. Post-footnote processing for footnotes in diversions
13479 \# Even when a footnote inside a diversion is treated as
13480 \# "normal," some manipulation of registers is required. The
13481 \# macro is called in DO_QUOTE (i.e. at the termination of
13482 \# quotes and blockquotes) and in DO_EPIGRAPH.
13484 .MAC DIVER_FN_2_POST END
13485 . if \\n[#DONE_ONCE]=1 \{\
13486 . if \\n[#FN_MARKER_STYLE]=1 \{\
13487 . if \\n[#FN_COUNT]=0 \{\
13488 . nr #DONT_RULE_ME 1
13490 . if \\n[#FN_COUNT]>0 \{\
13493 . if \\n[#COLUMNS]=1 \{\
13494 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT_FOR_COLS 0 1 \}
13495 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13499 . if \\n[#FN_MARKER_STYLE]=2 \{\
13500 . if \\n[#FN_COUNT]=0 \{\
13501 . nr #DONT_RULE_ME 1
13503 . if \\n[#FN_COUNT]>0 \{\
13506 . if \\n[#RESET_FN_NUMBER]=1 \{\
13507 . ie \\n[#COLUMNS]=1 \{\
13508 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
13511 . nr #FN_NUMBER 0 1
13518 \# The main macros that handle footnote processing.
13519 \# -----------------------------------------------
13520 \# Sometimes, #VARIABLE_FOOTER_POS sets FOOTER at a location that gives
13521 \# the impression another line of running text could fit on the page.
13522 \# VFP_CHECK is always set to the line just above the one where FOOTER
13523 \# will be sprung, and checks for this condition. If it exists, FOOTER
13524 \# is set one line lower on the page, thus squeezing in an extra line
13525 \# of running text. This is a judgment call on my part, but seems to
13526 \# work well. If there are problems (e.g. footnotes really do look
13527 \# jammed), the user should probably adjust FOOTNOTE_AUTOLEAD and/or
13528 \# FOOTNOTE_RULE_ADJ.
13530 \# The macro has to be run in its own environment, otherwise the first
13531 \# word of the last line before the footnotes gets chopped.
13535 .\" The trap also has to be removed each time VFP_CHECK is run
13536 . if \\n[#PRINT_STYLE]=2 \{\
13539 . ie !\\n[#IN_DIVER] \{ .nr #PAGE_POS \\n(nl \}
13540 . el \{ .nr #PAGE_POS \\n(nl+\\n(.d+(\\n[#DOC_LEAD]) \}
13541 . nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS])
13542 . nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
13543 . nr #FN_GAP \\n[#SPACE_TO_FOOTER]%\\n[#DOC_LEAD]
13544 . if !\\n[#FN_GAP]<0 \{\
13545 . if \\n[#FN_GAP]<\\n[#DOC_LEAD] \{\
13546 . ie (\\n[#PAGE_POS]+(\\n[#FN_DEPTH]+\\n[#FN_GAP]))>(\\n[#VISUAL_B_MARGIN]) \{\
13547 . nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
13550 . ie \\n[#DOC_LEAD]-\\n[#FN_GAP]<\\n[#DESCENDER] \{\
13551 . nr #VARIABLE_FOOTER_POS +\\n[#DOC_LEAD]
13552 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13555 . nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
13564 \# FN_OVERFLOW_TRAP starts off "underneath" FOOTER, but is revealed
13565 \# as #VARIABLE_FOOTER_POSITION changes the position of FOOTER.
13566 \# FN_OVERFLOW_TRAP simply starts diversion FN_OVERFLOW to "catch"
13567 \# the overflow. The diversion is ended in FOOTER, immediately after
13568 \# FOOTER outputs the diversion, FOOTNOTES, before PROCESS_FN_LEFTOVER
13569 \# is run (either in HEADER, or in FOOTER if moving col to col).
13571 .MAC FN_OVERFLOW_TRAP END
13572 . if \\n[#FN_COUNT] \{\
13574 . ie !\\n[#NO_BACK_UP]=1 \{\
13575 . if \\n[#PREV_FN_DEFERRED] \{\
13576 . ie \\n[#COLUMNS]=1 \{\
13577 . if \\n[#FROM_FOOTER] \{\
13578 . if \\n[#PREV_FN_DEFERRED] \{\
13579 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13580 . rr #PREV_FN_DEFERRED
13584 . if !\\n[#FROM_FOOTER] \{\
13585 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13586 . if !\\n[#LAST_FN_COUNT_FOR_COLS]>1 \{\
13587 \!. RLD \\n[#FN_LEAD]u
13593 \!. RLD \\n[#FN_LEAD]u
13599 . rr #PREV_FN_DEFERRED
13602 .\" When #FROM_DIVERT_FN is 1, it signals to FOOTNOTE, when run from
13603 .\" within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING to the total
13604 .\" area allowable for running text.
13605 . nr #FROM_DIVERT_FN 1
13608 \# PROCESS_FN_LEFTOVER is called at the top of HEADER, and in
13609 \# FOOTER if we're moving from one column to the next (i.e. after
13610 \# outputting FOOTNOTES). It checks for whether we have a "deferred
13611 \# footnote" situation, and resets counters and number registers
13612 \# accordingly. Lastly, if we have some footnote overflow, it calls
13613 \# DIVERT_FN_OVERFLOW.
13615 .MAC PROCESS_FN_LEFTOVER END
13616 . if \\n[#PREV_FN_DEFERRED]=2 \{\
13617 . if \\n[#FN_COUNT_AT_FOOTER]>1 \{ .rr #PREV_FN_DEFERRED \}
13619 . if !\\n[#FN_DEFER] \{\
13622 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
13624 . if r#FN_DEFER \{\
13625 . if \\n[#FN_DEFER]=1 \{\
13626 . nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
13628 . if \\n[#FN_DEFER]=2 \{\
13630 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
13633 . nr #SPACE_REMAINING 0
13634 . ch FOOTER -\\n[#B_MARGIN]u
13635 . if \\n[#FN_DEFER] \{\
13636 . nr #NO_FN_MARKER 1
13640 . ie \\n[#COLUMNS]=1 \{\
13641 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13642 . if !\\n[#FROM_FOOTER] \{\
13643 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .nr #PREV_FN_DEFERRED 1 \}
13647 . el \{ .nr #PREV_FN_DEFERRED 1 \}
13649 . if !\\n[#FN_DEFER] \{\
13650 . if \\n[#FN_OVERFLOW_DEPTH] \{\
13651 . DIVERT_FN_LEFTOVER
13654 . ie \\n[#COLUMNS]=1 \{\
13655 . if \\n[#COL_NUM]>1 \{\
13656 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT 0 1 \}
13659 . el \{ .nr #FN_COUNT 0 1 \}
13660 . if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
13661 . rr #FROM_DIVERT_FN
13664 \# DIVERT_FN_LEFTOVER is called in PROCESS_FN_LEFTOVER (at
13665 \# the top of HEADER, and in FOOTER if we're moving from one column
13668 .MAC DIVERT_FN_LEFTOVER END
13669 . nr #NO_FN_MARKER 1
13675 . if \\n[#PREV_FN_DEFERRED] \{\
13676 . nr #FN_DEPTH -\\n[#FN_LEAD]
13677 . nr #VARIABLE_FOOTER_POS +\\n[#FN_LEAD]
13678 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13679 . if \\n[#PREV_FN_DEFERRED]=2 \{\
13680 . nr #PREV_FN_DEFERRED 1
13684 . rr #FN_OVERFLOW_DEPTH
13687 \# This is a special macro to deal with footnotes that are set inside
13688 \# diversions (QUOTE, BLOCKQUOTE and EPIGRAPH). It's called in HEADER
13689 \# (and in FOOTER, if we're moving from column to column), and comes
13690 \# after PROCESS_FOOTNOTE_LEFTOVER in those two macros.
13692 .MAC PROCESS_FN_IN_DIVER END
13693 . nr #SPACE_REMAINING 0
13694 . ch FOOTER -\\n[#B_MARGIN]u
13695 . nr #NO_FN_MARKER 1
13696 . if !\\n[#RESET_FN_COUNTERS]=2 \{\
13697 . rr #RESET_FN_COUNTERS
13700 . if \\n[#FN_OVERFLOW_DEPTH] \{ .nf \}
13701 . ie dRUNON_FN_IN_DIVER \{\
13702 . RUNON_FN_IN_DIVER
13703 . rm RUNON_FN_IN_DIVER
13713 \# ====================================================================
13717 \# When endnotes are output, the spacing between the notes is always
13718 \# 1 extra linespace. This can have bottom margin consequences. If
13719 \# this doesn't bother you, don't worry about it. If it does bother
13720 \# you, and you want to adjust the spacing between any two endnotes (as
13721 \# they're output), make the spacing adjustments (.ALD/.RLD) at the
13722 \# *end* of endnotes (i.e. just before .ENDNOTE OFF), not at the top.
13724 \# Endnotes must be output manually with .ENDNOTES. This allows user
13725 \# the flexibility to output endnotes at the end of each collated
13726 \# document, or to output them at the end of the entire document.
13731 \# ENDNOTE POINT SIZE
13732 \# ------------------
13734 \# <base point size for endnotes>
13736 \# Creates or modifies register #EN_PS.
13738 \# Default is same as running text in body of document.
13740 \# This size control macro differs from other size control macros
13741 \# in that it sets an absolute point size, not a relative one. This
13742 \# is because a) endnotes always appear separate from the body of
13743 \# a document and therefore don't need to be relative to the body
13744 \# of the document, and b) there are quite a few elements of the
13745 \# endnotes page(s) that need to be relative to the base point size
13746 \# of that page. If the base endnote point size were relative to
13747 \# the body of the document (i.e. a _SIZE macro taking a +|- value)
13748 \# getting the rest of the endnote elements sized properly could
13749 \# become very confusing.
13751 .MAC ENDNOTE_PT_SIZE END
13752 . nr #EN_PS (p;\\$1)
13759 \# <base leading to use in endnotes> [ ADJUST ]
13761 \# Creates or modifies register #EN_LEAD. Creates or removes
13762 \# register #ADJ_EN_LEAD. Stores arguments in strings if ENDNOTE_LEAD
13763 \# set before START.
13765 \# Default is 14 points for TYPESET, adjusted; 24 for TYPEWRITE.
13767 .MAC ENDNOTE_LEAD END
13768 . if !\\n[#OK_PROCESS_LEAD] \{\
13771 . ds $ADJUST_EN_LEAD \\$2
13776 . nr #EN_LEAD (p;\\$1)
13777 . if '\\$2'ADJUST' \{\
13778 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
13779 . nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
13780 . nr #ADJ_DOC_LEAD 1
13781 . nr #ADJ_EN_LEAD 1
13782 . nr #NO_TRAP_RESET 1
13783 . DOC_LEAD \\n[#EN_LEAD]u ADJUST
13784 . nr #EN_LEAD \\n[#DOC_LEAD]
13785 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
13786 . rr #NO_TRAP_RESET
13787 . nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
13788 . rr #ORIG_DOC_LEAD
13793 \# ENDNOTES_HDRFTR_CENTER
13794 \# ----------------------
13798 \# Creates or removes toggle register #EN_HDRFTR_CENTER, used to
13799 \# determine whether mom should print a/the hdrftr center string
13800 \# on the endnotes page. Primarily to enable/disable printing of the
13801 \# chapter name in hdrftrs when DOCTYPE CHAPTER.
13805 .MAC ENDNOTES_HDRFTR_CENTER END
13806 . ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
13807 . el \{ .rr #EN_HDRFTR_CENTER \}
13814 \# <title for endnotes page>
13816 \# Creates or modifies string $EN_STRING.
13818 \# Default is "Endnotes"
13820 .MAC ENDNOTE_STRING END
13821 . ds $EN_STRING \\$1
13825 .MAC ENDNOTE_STRING_ADVANCE END
13826 . nr #EN_STRING_ADVANCE (\\$1)
13830 \# ENDNOTE STRING CAPS
13831 \# -------------------
13833 \# <none> | <anything>
13835 \# Turns capitalization of the endnotes pages title string
13836 \# "Endnotes" on or off.
13838 \# Users may want the endnotes pages title string to be in caps,
13839 \# but the toc entry for endnotes in lower case. If the argument
13840 \# to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
13841 \# turned on, this is exactly what will happen.
13845 .MAC ENDNOTE_STRING_CAPS END
13846 . ie '\\$1'' \{ .nr #EN_STRING_CAPS 1 \}
13847 . el \{ .rr #EN_STRING_CAPS \}
13854 \# <string that appears before the first endnote pertaining to any document>
13856 \# Creates string $EN_TITLE.
13858 \# Default is the document title, or, if doc is a chapter, "Chapter #"
13860 .MAC ENDNOTE_TITLE END
13861 . ds $EN_TITLE \\$1
13865 \# ENDNOTE MARKER STYLE
13866 \# --------------------
13870 \# Sets register #EN_MARKER_STYLE, used in ENDNOTE to determine
13871 \# the style of endnote markers (labels).
13873 \# 1=NUMBER; 2=LINE. LINE means "use output line numbers".
13874 \# Default is NUMBER.
13876 .MAC ENDNOTE_MARKER_STYLE END
13877 . if '\\$1'NUMBER' \{\
13878 . nr #EN_MARKER_STYLE 1
13880 . if '\\$1'LINE' \{\
13881 . nr #EN_MARKER_STYLE 2
13882 . if !\\n[#EN_LN_SEP] \{\
13883 . if !\\n[#EN_LN_BRACKETS] \{ .ENDNOTE_LINENUMBER_BRACKETS SQUARE \}
13889 \# ENDNOTE LINENUMBER MARK
13890 \# -----------------------
13892 \# This string, when called inline, stores the current output line
13893 \# number in register #EN_MARK for use with ENDNOTE.
13895 .ds EN-MARK \R'#EN_MARK \En(ln'
13898 \# ENDNOTE LINENUMBER SEPARATOR
13899 \# ----------------------------
13901 \# <user-defined separator>
13903 \# Stores user-defined separator (for use then
13904 \# ENDNOTE_MARKER_STYLE is LINE) in string $EN_LN_SEP. The
13905 \# separator is intended to be used when the user wishes a
13906 \# separator, rather than the choice of brackets offered by
13907 \# ENDNOTE_LINENUMBER_BRACKETS.
13909 .MAC ENDNOTE_LINENUMBER_SEPARATOR END
13910 . rr #EN_LN_BRACKETS
13912 . ds $EN_LN_SEP "\\$1
13916 \# ENDNOTE LINENUMBER BRACKETS
13917 \# ---------------------------
13919 \# PARENS | SQUARE | BRACES or ( | [ | {
13921 \# Sets register #EN_LN_BRACKETS to 1, and creates strings
13922 \# $EN_OPEN_BRACKET and $EN_CLOSE_BRACKET according to the given argument.
13924 .MAC ENDNOTE_LINENUMBER_BRACKETS END
13926 . nr #EN_LN_BRACKETS 1
13927 . if '\\$1'PARENS' \{\
13928 . ds $EN_OPEN_BRACKET (
13929 . ds $EN_CLOSE_BRACKET )
13932 . ds $EN_OPEN_BRACKET (
13933 . ds $EN_CLOSE_BRACKET )
13935 . if '\\$1'SQUARE' \{\
13936 . ds $EN_OPEN_BRACKET [
13937 . ds $EN_CLOSE_BRACKET ]
13940 . ds $EN_OPEN_BRACKET [
13941 . ds $EN_CLOSE_BRACKET ]
13943 . if '\\$1'BRACES' \{\
13944 . ds $EN_OPEN_BRACKET {
13945 . ds $EN_CLOSE_BRACKET }
13948 . ds $EN_OPEN_BRACKET {
13949 . ds $EN_CLOSE_BRACKET }
13954 \# ENDNOTE LINENUMBER GAP
13955 \# ----------------------
13957 \# <space between line-number labels and endnotes text>
13959 \# Defines string $EN_LN_GAP, used during printing of line-number
13960 \# labels in ENDNOTE.
13962 .MAC ENDNOTE_LINENUMBER_GAP END
13963 . ds $EN_LN_GAP \\$1
13967 \# ENDNOTE NUMBERS ALIGN RIGHT
13968 \# ---------------------------
13970 \# <max. number of digit placeholders that will appear in endnotes>
13972 \# Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
13973 \# #EN_NUMBER_PLACEHOLDERS.
13975 \# Default is for footnote numbers to be right aligned to 2 placeholders.
13977 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
13978 . rr #EN_NUMBERS_ALIGN_LEFT
13979 . nr #EN_NUMBERS_ALIGN_RIGHT 1
13980 . nr #EN_NUMBER_PLACEHOLDERS \\$1
13984 \# ENDNOTE NUMBERS ALIGN LEFT
13985 \# --------------------------
13989 \# Toggles register #EN_NUMBERS_ALIGN_LEFT on.
13991 \# Default is for footnote numbers to be right aligned to 2 placeholders
13992 \# (i.e. not left aligned).
13994 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
13995 . rr #EN_NUMBERS_ALIGN_RIGHT
13996 . nr #EN_NUMBERS_ALIGN_LEFT 1
14000 \# ENDNOTE PARAGRAPH INDENT
14001 \# ------------------------
14003 \# <first line indent of paras subsequent to 1st in endnotes>
14005 \# Creates register #EN_PP_INDENT for use in .PP.
14007 \# Requires a unit of measure.
14009 \# Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
14011 .MAC ENDNOTE_PARA_INDENT END
14012 . nr #EN_PP_INDENT (\\$1)
14016 \# TURN OFF COLUMN MODE FOR ENDNOTES
14017 \# ---------------------------------
14019 \# <none> | <anything>
14021 \# Creates or removes register #EN_NO_COLS
14023 \# Allows user to tell mom not to set endnotes in columnar
14024 \# documents in columns. Default is to set endnotes in columns.
14026 .MAC ENDNOTES_NO_COLUMNS END
14027 . ie '\\$1'' \{ .nr #EN_NO_COLS 1 \}
14028 . el \{ .rr #EN_NO_COLS \}
14032 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
14033 \# -------------------------------------------
14035 \# <none> | <anything>
14037 \# Creates or removes register #EN_NO_FIRST_PN
14039 \# For use if FOOTERS are on. Tells ENDNOTES not to put a page
14040 \# number on the first endnotes page. Some users may want this.
14041 \# Default is to print a page number at the top of the first
14042 \# endnotes page when footers are on.
14044 .MAC ENDNOTES_NO_FIRST_PAGENUM END
14045 . ie '\\$1'' \{ .nr #EN_NO_FIRST_PN 1 \}
14046 . el \{ .rr #EN_NO_FIRST_PN \}
14050 \# PAGE HEADERS ON ENDNOTES PAGES
14051 \# ------------------------------
14055 \# Creates or removes register #EN_ALLOWS_HEADERS or
14056 \# #EN_ALLOWS_HEADERS_ALL
14058 \# Whether ENDNOTES puts a page header at the top of endnotes
14059 \# pages if page headers are used throughout the document.
14060 \# Default is to insert the page headers, but not on the first
14061 \# page. If the optional argument ALL is given, ENDNOTES puts a
14062 \# page header on the first page as well.
14064 .MAC ENDNOTES_ALLOWS_HEADERS END
14065 . ie '\\$1'' \{ .nr #EN_ALLOWS_HEADERS 1 \}
14067 . ie '\\$1'ALL' \{\
14068 . nr #EN_ALLOWS_HEADERS 1
14069 . nr #EN_ALLOWS_HEADERS_ALL 1
14072 . nr #EN_ALLOWS_HEADERS 0
14073 . nr #EN_ALLOWS_HEADERS_ALL 0
14079 \# ENDNOTES PAGES PAGE NUMBERING STYLE
14080 \# -----------------------------------
14082 \# DIGIT | ROMAN | roman | ALPHA | alpha
14084 \# Creates or modifies $EN_PN_STYLE.
14086 \# Allows user to define what style should be used for endnotes
14087 \# pages page numbering. Arguments are the same as for
14090 \# Default is DIGIT.
14092 .MAC ENDNOTES_PAGENUM_STYLE END
14093 . ds $EN_PN_STYLE \\$1
14097 \# FIRST PAGE NUMBER FOR ENDNOTES
14098 \# ------------------------------
14100 \# <page number that appears on page 1 of endnotes pages>
14102 \# Creates or modifies string $EN_FIRST_PN
14104 \# To be used with caution, only if all endnotes
14105 \# are to be output at once, i.e. not at the end of the separate
14106 \# docs of a collated doc
14108 .MAC ENDNOTES_FIRST_PAGENUMBER END
14109 . nr #EN_FIRST_PN \\$1
14112 \# SINGLESPACE ENDNOTES
14113 \# --------------------
14115 \# <none> | <anything>
14117 \# Sets lead of endnotes pages in TYPEWRITE to 12 points,
14120 \# Default is to double-space endnotes pages.
14122 .MAC SINGLESPACE_ENDNOTES END
14123 . if \\n[#PRINT_STYLE]=1 \{\
14124 . ie \\n[#SINGLE_SPACE] \{\
14125 . nr #EN_SINGLESPACE 1
14127 . if \\n[#OK_PROCESS_LEAD] \{\
14128 . ENDNOTE_LEAD 12 ADJUST
14134 . nr #EN_SINGLESPACE 1
14136 . if \\n[#OK_PROCESS_LEAD] \{\
14137 . ENDNOTE_LEAD 12 ADJUST
14142 . rr #EN_SINGLESPACE
14144 . if \\n[#OK_PROCESS_LEAD] \{\
14145 . ENDNOTE_LEAD 24 ADJUST
14154 \# ENDNOTE PARAGRAPH SPACE
14155 \# -----------------------
14159 \# Creates toggle register #EN_PP_SPACE for use in .PP.
14161 \# Like PARA_SPACE. Default is not to space endnote paras.
14163 .MAC ENDNOTE_PARA_SPACE END
14164 . ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
14165 . el \{ .rr #EN_PP_SPACE \}
14174 \# Places superscript endnote number in text, then collects and
14175 \# processes endnote in diversion END_NOTES.
14177 \# \c must be appended to the word immediately preceding .ENDNOTE
14178 \# when ENDNOTE_MARKER_STYLE is NUMBER.
14183 . if \\n[#EN_MARKER_STYLE]=1 \{\
14184 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
14185 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
14186 . if \\n[#PRINT_STYLE]=1 \{\
14187 . if \\n[#UNDERLINE_ON] \{\
14188 . nr #UNDERLINE_WAS_ON 1
14191 . if \\n[#SLANT_ON] \{\
14192 . nr #SLANT_WAS_ON 1
14195 . PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
14197 . if \\n[#PRINT_STYLE]=2 \{\
14198 . PRINT \*[SUP]\\n+[#EN_NUMBER]\*[SUPX]\c
14201 . if \\n[#EN_MARKER_STYLE]=2 \{\
14202 . ie r#EN_NUMBER \{ \\n+[#EN_NUMBER] \}
14203 . el \{ .nr #EN_NUMBER 1 1 \}
14204 . if !\\n[#LINENUMBERS] \{\
14205 . tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
14206 . tm1 " ENDNOTE_MARKER_STYLE is LINE.
14207 . ab Aborting on ENDNOTE at line \\n(.c.
14209 . if \\n[#EN_MARK]=0 \{ .nr #EN_MARK \\n(ln \}
14210 . nr #EN_MARK_2 \\n(ln
14211 . if '\\n(.z'P_QUOTE' \{\
14216 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
14218 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
14219 . INDENT_FIRST_PARAS
14222 . LL \\n[#DOC_L_LENGTH]u
14224 . if \\n[#COLUMNS] \{\
14225 . ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
14226 . el \{ .LL \\n[#COL_L_LENGTH]u \}
14229 . vs \\n[#EN_LEAD]u
14230 . if \\n[#EN_NUMBER]=1 \{\
14232 . if \\n[#PRINT_STYLE]=1 \{\
14235 . if \\n[#PRINT_STYLE]=2 \{\
14236 . FAMILY \\*[$EN_TITLE_FAM]
14237 . FT \\*[$EN_TITLE_FT]
14238 . PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
14241 . if !'\\*[$EN_TITLE]'' \{\
14242 . if '\\*[$EN_TITLE_QUAD]'L' \{ .LEFT \}
14243 . if '\\*[$EN_TITLE_QUAD]'LEFT' \{ .LEFT \}
14244 . if '\\*[$EN_TITLE_QUAD]'C' \{ .CENTER \}
14245 . if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
14246 . if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
14247 . if '\\*[$EN_TITLE_QUAD]'R' \{ .RIGHT \}
14248 . if '\\*[$EN_TITLE_QUAD]'RIGHT' \{ .RIGHT \}
14249 . ie \\n[#EN_TITLE_UNDERLINE] \{\
14250 . nr #FROM_EN_TITLE 1
14251 . UNDERSCORE "\\*[$EN_TITLE]"
14252 . rr #FROM_EN_TITLE
14255 . PRINT "\\*[$EN_TITLE]"
14259 . if \\n[#PRINT_STYLE]=1 \{\
14261 . if \\n[#EN_NUMBER]=1 \{\
14262 . if \\n[#SINGLE_SPACE]=1 \{ .sp \}
14265 . if \\n[#PRINT_STYLE]=2 \{\
14266 . if \\n[#EN_NUMBER]=1 \{\
14267 . if !'\\*[$EN_TITLE]'' \{ .sp \}
14269 . if \\n[#EN_MARKER_STYLE]=1 \{\
14270 . FAMILY \\*[$EN_NUMBER_FAM]
14271 . FT \\*[$EN_NUMBER_FT]
14272 . PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
14274 . if \\n[#EN_MARKER_STYLE]=2 \{\
14275 . FAMILY \\*[$EN_LN_FAM]
14276 . FT \\*[$EN_LN_FT]
14277 . PT_SIZE \\n[#EN_PS]u\\*[$EN_LN_SIZE_CHANGE]
14280 . if \\n[#EN_MARKER_STYLE]=2 \{\
14281 . ENDNOTE_NUMBERS_ALIGN_LEFT
14282 . ie \\n[#EN_LN_BRACKETS]=1 \{\
14283 . ds $EN_LINENUMBER \v'-.085m'\\*[$EN_OPEN_BRACKET]\v'.085m'
14284 . ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \{\
14285 . as $EN_LINENUMBER \\n[#EN_MARK]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m' \"
14288 . as $EN_LINENUMBER \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m' \"
14292 . ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \{\
14293 . ds $EN_LINENUMBER \\n[#EN_MARK]\\*[$EN_LN_SEP]
14296 . ds $EN_LINENUMBER \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\\*[$EN_LN_SEP]
14302 . nr #RESET_L_LENGTH \\n(.l
14303 . ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
14304 . nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
14308 . nr #EN_NUMBER_L_LENGTH \w'\En[#EN_NUMBER].\0'
14311 . if \\n[#EN_MARKER_STYLE]=2 \{\
14312 . if !\\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
14313 . nr #EN_NUMBER_L_LENGTH \w'\\*[$EN_LINENUMBER]'+\\*[$EN_LN_GAP]
14317 . ll \\n[#EN_NUMBER_L_LENGTH]u
14318 . if \\n[#EN_MARKER_STYLE]=1 \{\
14321 . if \\n[#EN_MARKER_STYLE]=2 \{\
14322 \\*[$EN_LINENUMBER]
14323 . rm $EN_LINENUMBER
14326 . ll \\n[#RESET_L_LENGTH]u
14327 . nr #EN_FIGURE_SPACE \w'\0.'
14328 . ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
14329 . in \\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_FIGURE_SPACE]u
14332 . ti \\n[#EN_NUMBER_L_LENGTH]u
14334 . nr #EN_TEXT_INDENT \\n(.i
14335 . QUAD \\*[$EN_QUAD]
14337 . if \\n[#PRINT_STYLE]=1 \{\
14340 . if \\n[#PRINT_STYLE]=2 \{\
14341 . FAMILY \\*[$EN_FAM]
14343 . PT_SIZE \\n[#EN_PS]u
14345 . if \\n[#REF]=1 \{\
14346 . ie !\\n[#EN_MARKER_STYLE]=2 \{\
14347 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
14348 . in \\*[$REF_EN_INDENT]
14349 . ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u)
14351 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
14352 \#. in \\*[$REF_EN_INDENT]
14353 \#. ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u-\\n[#EN_FIGURE_SPACE]u)
14354 \#. in \\*[$REF_EN_INDENT]+\\n[#EN_NUMBER_L_LENGTH]u
14355 \#. ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_FIGURE_SPACE]u)
14356 . in +\\*[$REF_EN_INDENT]
14357 . ti -\\*[$REF_EN_INDENT]
14361 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
14362 . in \\*[$REF_EN_INDENT]
14363 . ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u)
14371 . if \\n[#EN_MARKER_STYLE]=2 \{\
14375 .\" Restore sentence spacing
14376 . if \\n[#PRINT_STYLE]=2 \{\
14377 . if d$RESTORE_SS_VAR \{ .SS \\*[$RESTORE_SS_VAR] \}
14378 . rm $RESTORE_SS_VAR
14381 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
14382 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
14383 . rr #INDENT_FIRSTS
14385 . if \\n[#PRINT_STYLE]=1 \{\
14386 . if \\n[#UNDERLINE_WAS_ON] \{\
14387 . rr #UNDERLINE_WAS_ON
14391 . if \\n[#SLANT_WAS_ON] \{\
14396 . if \\n[#NUM_ARGS]=2 \{\
14397 . if '\\$2'BREAK' \{ .BR \}
14398 . if '\\$2'BR' \{ .BR \}
14408 \# Sets new document leading from #EN_LEAD, breaks to a new page,
14409 \# sets up an endnotes page based on registers and strings associated
14410 \# with endnotes, then outputs diversion END_NOTES.
14414 . nr #EN_FIRST_PAGE 1
14415 . nr #HEADER_STATE \\n[#HEADERS_ON]
14416 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
14417 . if \\n[#LINENUMBERS]=1 \{\
14419 . nr #LINENUMBERS 2
14421 . if \\n[#HEADERS_ON]=1 \{\
14422 . if !\\n[#EN_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
14424 . if \\n[#HEADER_STATE]=1 \{\
14425 . ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
14426 . el \{ .rm $HDRFTR_CENTER \}
14428 . ie !\\n[#SUSPEND_PAGINATION] \{\
14429 . if \\n[#PAGINATE]=1 \{\
14430 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14431 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
14432 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN]-1 \}
14433 . if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
14438 . ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
14439 . el \{ .nr #PAGINATE 0 \}
14441 . if \\n[#FOOTERS_ON]=1 \{\
14442 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
14445 . if \\n[#FOOTERS_ON]=1 \{\
14446 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
14447 . rm $HDRFTR_CENTER_OLD
14448 . rm $HDRFTR_CENTER_NEW
14450 . ie !\\n[#SUSPEND_PAGINATION] \{\
14451 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14452 . if r#EN_NO_FIRST_PN \{\
14453 . if \\n[#PAGINATION_STATE]=1 \{\
14460 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
14462 . rr #PAGINATION_STATE
14463 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
14464 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
14465 . if \\n[#HEADER_STATE]=1 \{\
14466 . if \\n[#EN_ALLOWS_HEADERS] \{ .HEADERS \}
14468 .\" Collect endnotes title string for TOC
14469 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
14470 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
14471 . ds $TOC_TITLE_ITEM \\*[$EN_STRING]\\|
14474 . if \\n[#PRINT_STYLE]=1 \{\
14477 . if \\n[#PRINT_STYLE]=2 \{\
14478 \!. FAMILY \\*[$TOC_TITLE_FAM]
14479 \!. FT \\*[$TOC_TITLE_FT]
14480 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
14484 . ie \\n[#PRINT_STYLE]=1 \{\
14485 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
14488 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
14494 . if \\n[#PRINT_STYLE]=2 \{\
14495 \!. FAMILY \\*[$TOC_PN_FAM]
14496 \!. FT \\*[$TOC_PN_FT]
14497 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
14500 \!. PRINT \\*[LEADER]
14503 \!. PRINT \\n[#TOC_ENTRY_PN]
14507 .\" End collection of endnotes title string for TOC
14508 .\" Process endnotes
14509 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#EN_LEAD]u \}
14510 . if \\n[#PRINT_STYLE]=2 \{\
14511 . if \\n[#EN_NO_COLS] \{\
14512 . if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
14515 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
14516 . ie \\n[#ADJ_EN_LEAD] \{\
14517 . nr #DOC_LEAD \\n[#EN_LEAD]
14519 . el \{ .DOC_LEAD \\n[#EN_LEAD]u \}
14522 . ie r#EN_STRING_ADVANCE \{ .sp |\\n[#EN_STRING_ADVANCE]u \}
14523 . el \{ .sp |\\n[#T_MARGIN]u \}
14525 . if \\n[#SLANT_ON] \{\
14529 . if !'\\*[$EN_STRING]'' \{\
14530 . if \\n[#PRINT_STYLE]=1 \{\
14532 . vs \\n[#EN_LEAD]u
14534 . if \\n[#PRINT_STYLE]=2 \{\
14535 . LL \\n[#DOC_L_LENGTH]u
14537 . if \\n[#COLUMNS] \{\
14538 . ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
14539 . el \{ .LL \\n[#COL_L_LENGTH]u \}
14542 . FAMILY \\*[$EN_STRING_FAM]
14543 . FT \\*[$EN_STRING_FT]
14544 . PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
14545 . vs \\n[#EN_LEAD]u
14547 . if '\\*[$EN_STRING_QUAD]'L' \{ .LEFT \}
14548 . if '\\*[$EN_STRING_QUAD]'LEFT' \{ .LEFT \}
14549 . if '\\*[$EN_STRING_QUAD]'C' \{ .CENTER \}
14550 . if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
14551 . if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
14552 . if '\\*[$EN_STRING_QUAD]'R' \{ .RIGHT \}
14553 . if '\\*[$EN_STRING_QUAD]'RIGHT' \{ .RIGHT \}
14555 . if \\n[#EN_STRING_CAPS] \{ .CAPS \}
14556 . ie \\n[#EN_STRING_UNDERLINE] \{\
14557 . nr #FROM_EN_STRING 1
14558 . ie \\n[#EN_STRING_UNDERLINE]=2 \{\
14559 . UNDERSCORE2 \\*[$EN_UNDERLINE_GAP] \\*[$EN_RULE_GAP] "\\*[$EN_STRING]"
14562 . UNDERSCORE "\\*[$EN_STRING]"
14564 . rr #FROM_EN_STRING
14567 . PRINT "\\*[$EN_STRING]
14571 . if \\n[#PRINT_STYLE]=1 \{\
14572 . ie \\n[#SINGLE_SPACE]=1 \{\
14573 . ALD \\n[#EN_LEAD]u*2u
14576 . ie \\n[#EN_SINGLESPACE]=1 \{\
14577 . ALD \\n[#EN_LEAD]u*2
14584 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#EN_LEAD]u \}
14585 . QUAD \\*[$EN_QUAD]
14591 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#DOC_LEAD]u \}
14592 . if \\n[#PRINT_STYLE]=2 \{\
14593 . ie \\n[#ADJ_EN_LEAD] \{\
14594 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
14596 . el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
14597 . rr #RESTORE_DOC_LEAD
14599 . if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
14600 . if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
14601 . if \\n[#LINENUMBERS]=2 \{\
14602 . NUMBER_LINES RESUME
14603 . nr #LINENUMBERS 1
14608 \# ====================================================================
14610 \# +++BIBLIOGRAPHY+++
14612 \# Mom treats bibliographies and endnotes very similarly. The chief
14613 \# difference is that endnotes are collected and formatted inside a
14614 \# diversion, while bibliographies are built "by hand." ENDNOTES sets
14615 \# up the endnotes page and outputs the formatted diversion.
14616 \# BIBLIOGRAPHY sets up the bibliography page, then awaits refer
14619 \# All of the bibliography control macros have their exact
14620 \# counterparts in the endnotes control macros. It was tempting to do
14621 \# fancy stuff with aliases to avoid the repetition, but for reasons
14622 \# of my own sanity, and for the benefit of anyone wanting to play
14623 \# around with the bibliography control macros, I decided to keep them
14626 \# Because the bibliography control macros all have endnotes
14627 \# equivalents, refer to the appropriate, similar endnote macro for
14628 \# Arguments, Function and Notes.
14629 \# Bibliography control macros
14631 .MAC BIBLIOGRAPHY_PT_SIZE END
14632 . nr #BIB_PS (p;\\$1)
14635 .MAC BIBLIOGRAPHY_LEAD END
14636 . if !\\n[#OK_PROCESS_LEAD] \{\
14637 . ds $BIB_LEAD \\$1
14639 . ds $ADJUST_BIB_LEAD \\$2
14644 . nr #BIB_LEAD (p;\\$1)
14645 . if '\\$2'ADJUST' \{\
14646 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
14647 . nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
14648 . nr #ADJ_DOC_LEAD 1
14649 . nr #ADJ_BIB_LEAD 1
14650 . nr #NO_TRAP_RESET 1
14651 . DOC_LEAD \\n[#BIB_LEAD]u ADJUST
14652 . nr #BIB_LEAD \\n[#DOC_LEAD]
14653 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
14654 . rr #NO_TRAP_RESET
14655 . nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
14656 . rr #ORIG_DOC_LEAD
14660 .MAC BIBLIOGRAPHY_HDRFTR_CENTER END
14661 . ie '\\$1'' \{ .nr #BIB_HDRFTR_CENTER 1 \}
14662 . el \{ .rr #BIB_HDRFTR_CENTER \}
14665 .MAC BIBLIOGRAPHY_STRING END
14666 . ds $BIB_STRING \\$1
14669 .MAC BIBLIOGRAPHY_STRING_CAPS END
14670 . ie '\\$1'' \{ .nr #BIB_STRING_CAPS 1 \}
14671 . el \{ .rr #BIB_STRING_CAPS \}
14674 .MAC BIBLIOGRAPHY_NO_COLUMNS END
14675 . ie '\\$1'' \{ .nr #BIB_NO_COLS 1 \}
14676 . el \{ .rr #BIB_NO_COLS \}
14679 .MAC BIBLIOGRAPHY_NO_FIRST_PAGENUM END
14680 . ie '\\$1'' \{ .nr #BIB_NO_FIRST_PN 1 \}
14681 . el \{ .rr #BIB_NO_FIRST_PN \}
14684 .MAC BIBLIOGRAPHY_ALLOWS_HEADERS END
14685 . ie '\\$1'' \{ .nr #BIB_ALLOWS_HEADERS 1 \}
14687 . ie '\\$1'ALL' \{\
14688 . nr #BIB_ALLOWS_HEADERS 1
14689 . nr #BIB_ALLOWS_HEADERS_ALL 1
14692 . rr #BIB_ALLOWS_HEADERS
14693 . rr #BIB_ALLOWS_HEADERS_ALL
14698 .MAC BIBLIOGRAPHY_PAGENUM_STYLE END
14699 . ds $BIB_PN_STYLE \\$1
14702 .MAC BIBLIOGRAPHY_FIRST_PAGENUMBER END
14703 . nr #BIB_FIRST_PN \\$1
14706 .MAC SINGLESPACE_BIBLIOGRAPHY END
14707 . if \\n[#PRINT_STYLE]=1 \{\
14708 . ie \\n[#SINGLE_SPACE] \{\
14709 . nr #BIB_SINGLESPACE 1
14711 . if \\n[#OK_PROCESS_LEAD] \{\
14712 . BIBLIOGRAPHY_LEAD 12 ADJUST
14718 . nr #BIB_SINGLESPACE 1
14720 . if \\n[#OK_PROCESS_LEAD] \{\
14721 . BIBLIOGRAPHY_LEAD 12 ADJUST
14726 . rr #BIB_SINGLESPACE
14728 . if \\n[#OK_PROCESS_LEAD] \{\
14729 . BIBLIOGRAPHY_LEAD 24 ADJUST
14738 \# Style for outputting collected bibliographic references
14739 \# -------------------------------------------------------
14741 \# LIST | PLAIN [ <list separator> ] [ <list prefix> ]
14743 \# Sets #BIB_LIST to 1 for numbered list style, 0 for plain output
14745 \# Technically, user is supposed to enter PLAIN if s/he wants an
14746 \# unumbered bibliography, but the el clause says "any arg but
14747 \# LIST means unumbered." Effectively, any arg but LIST produces
14748 \# a "plain" bibliographic list.
14750 \# The 2nd and 3rd args have the same options as the 2nd arg to LIST.
14752 .MAC BIBLIOGRAPHY_TYPE END
14753 . ie '\\$1'LIST' \{\
14756 . if '\\*[$BIB_LIST_SEPARATOR]'' .ds $BIB_LIST_SEPARATOR .
14758 . el .ds $BIB_LIST_SEPARATOR \\$2
14759 . ie '\\$3'' .ds $BIB_LIST_PREFIX
14760 . el .ds $BIB_LIST_PREFIX \\$3
14762 . el \{ .nr #BIB_LIST 0 \}
14765 \# Spacing between items in bibliographies
14766 \# ---------------------------------------
14768 \# <amount of space>
14770 \# Gets value for #BIB_SPACE in units.
14772 \# Requires a unit of measure.
14774 .MAC BIBLIOGRAPHY_SPACING END
14775 . ds $BIB_SPACE \\$1
14776 . if \\n[#BIB_LEAD]=0 \{\
14777 . nr #DEFER_BIB_SPACING 1
14780 . ds $EVAL_BIB_SPACE \\*[$BIB_SPACE]
14781 . substring $EVAL_BIB_SPACE -1
14782 . ie '\\*[$EVAL_BIB_SPACE]'v' \{\
14783 . substring $BIB_SPACE 0 0
14784 . nr #BIB_SPACE \\n[#BIB_LEAD]*\\*[$BIB_SPACE]
14787 . nr #BIB_SPACE (\\$1)
14791 \# Set up bibliography page
14792 \# ------------------------
14794 \# Sets up a new page, with title, ready to accept the output
14795 \# of refer's $LIST$ or .R1 bibliography .R2
14797 \# Bibliography pages are set up almost identically to endnotes pages.
14799 .MAC BIBLIOGRAPHY END
14800 . nr #BIBLIOGRAPHY 1
14801 . nr #BIB_FIRST_PAGE 1
14802 . nr #HEADER_STATE \\n[#HEADERS_ON]
14803 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
14804 . if \\n[#LINENUMBERS]=1 \{\
14806 . nr #LINENUMBERS 2
14808 . if \\n[#HEADERS_ON]=1 \{\
14809 . if !\\n[#BIB_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
14811 . if \\n[#HEADER_STATE]=1 \{\
14812 . ie \\n[#BIB_HDRFTR_CENTER]=1 \{ . \}
14813 . el \{ .rm $HDRFTR_CENTER \}
14815 . ie !\\n[#SUSPEND_PAGINATION] \{\
14816 . if \\n[#PAGINATE]=1 \{\
14817 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14818 . PAGENUM_STYLE \\*[$BIB_PN_STYLE]
14819 . if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN]-1 \}
14820 . if r#BIB_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
14825 . ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
14826 . el \{ .nr #PAGINATE 0 \}
14828 . if \\n[#FOOTERS_ON]=1 \{\
14829 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
14832 . if \\n[#FOOTERS_ON]=1 \{\
14833 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
14834 . rm $HDRFTR_CENTER_OLD
14835 . rm $HDRFTR_CENTER_NEW
14837 . ie !\\n[#SUSPEND_PAGINATION] \{\
14838 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14839 . if r#BIB_NO_FIRST_PN \{\
14840 . if \\n[#PAGINATION_STATE]=1 \{\
14847 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
14849 . rr #PAGINATION_STATE
14850 . PAGENUM_STYLE \\*[$BIB_PN_STYLE]
14851 . if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN] \}
14852 . if \\n[#HEADER_STATE]=1 \{\
14853 . if \\n[#BIB_ALLOWS_HEADERS] \{ .HEADERS \}
14855 .\" Collect bibliography title string for TOC
14856 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
14857 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
14858 . ds $TOC_TITLE_ITEM \\*[$BIB_STRING]\\|
14861 . if \\n[#PRINT_STYLE]=1 \{\
14864 . if \\n[#PRINT_STYLE]=2 \{\
14865 \!. FAMILY \\*[$TOC_TITLE_FAM]
14866 \!. FT \\*[$TOC_TITLE_FT]
14867 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
14870 . ie \\n[#PRINT_STYLE]=1 \{\
14871 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
14874 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
14879 . if \\n[#PRINT_STYLE]=2 \{\
14880 \!. FAMILY \\*[$TOC_PN_FAM]
14881 \!. FT \\*[$TOC_PN_FT]
14882 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
14885 \!. PRINT \\*[LEADER]
14888 \!. PRINT \\n[#TOC_ENTRY_PN]
14892 .\" End collection of bibliography title string for TOC
14893 .\" Process bibliography
14894 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#BIB_LEAD]u \}
14895 . if \\n[#PRINT_STYLE]=2 \{\
14896 . if \\n[#BIB_NO_COLS] \{\
14897 . if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
14900 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
14901 . ie \\n[#ADJ_BIB_LEAD] \{\
14902 . nr #DOC_LEAD \\n[#BIB_LEAD]
14904 . el \{ .DOC_LEAD \\n[#BIB_LEAD]u \}
14907 . ie r#BIB_TITLE_SPACE \{ .sp |\\n[#BIB_TITLE_SPACE]u \}
14908 . el \{ .sp |\\n[#T_MARGIN]u \}
14910 . if \\n[#SLANT_ON] \{\
14913 . if !'\\*[$BIB_STRING]'' \{\
14914 . if \\n[#PRINT_STYLE]=1 \{\
14916 . vs \\n[#BIB_LEAD]u
14918 . if \\n[#PRINT_STYLE]=2 \{\
14919 . LL \\n[#DOC_L_LENGTH]u
14921 . if \\n[#COLUMNS] \{\
14922 . ie \\n[#BIB_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
14923 . el \{ .LL \\n[#COL_L_LENGTH]u \}
14926 . FAMILY \\*[$BIB_STRING_FAM]
14927 . FT \\*[$BIB_STRING_FT]
14928 . PT_SIZE \\n[#BIB_PS]u\\*[$BIB_STRING_SIZE_CHANGE]
14929 . vs \\n[#BIB_LEAD]u
14931 . if '\\*[$BIB_STRING_QUAD]'L' \{ .LEFT \}
14932 . if '\\*[$BIB_STRING_QUAD]'LEFT' \{ .LEFT \}
14933 . if '\\*[$BIB_STRING_QUAD]'C' \{ .CENTER \}
14934 . if '\\*[$BIB_STRING_QUAD]'CENTER' \{ .CENTER \}
14935 . if '\\*[$BIB_STRING_QUAD]'CENTRE' \{ .CENTER \}
14936 . if '\\*[$BIB_STRING_QUAD]'R' \{ .RIGHT \}
14937 . if '\\*[$BIB_STRING_QUAD]'RIGHT' \{ .RIGHT \}
14939 . if \\n[#BIB_STRING_CAPS] \{ .CAPS \}
14940 . ie \\n[#BIB_STRING_UNDERLINE] \{\
14941 . nr #FROM_BIB_STRING 1
14942 . ie \\n[#BIB_STRING_UNDERLINE]=2 \{\
14943 . UNDERSCORE2 "\\*[$BIB_STRING]"
14946 . UNDERSCORE "\\*[$BIB_STRING]"
14948 . rr #FROM_BIB_STRING
14951 . PRINT "\\*[$BIB_STRING]"
14955 . FAMILY \\*[$BIB_FAMILY]
14957 . PT_SIZE -\\*[$BIB_STRING_SIZE_CHANGE]
14958 . if \\n[#PRINT_STYLE]=1 \{\
14959 . ie \\n[#SINGLE_SPACE]=1 \{\
14960 . ALD \\n[#BIB_LEAD]*3u
14963 . ie \\n[#BIB_SINGLESPACE]=1 \{\
14964 . ALD \\n[#BIB_LEAD]u*3u
14967 . ALD \\n[#BIB_LEAD]u
14971 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#BIB_LEAD]u*2u \}
14972 . QUAD \\*[$BIB_QUAD]
14973 . if \\n[#PRINT_STYLE]=1 \{\
14974 . ie \\n[#SINGLE_SPACE]=1 \{\
14975 . vs \\n[#BIB_LEAD]u
14978 . ie \\n[#BIB_SINGLESPACE]=1 \{\
14979 . vs \\n[#BIB_LEAD]u
14982 . vs \\n[#BIB_LEAD]u
14986 . if \\n[#PRINT_STYLE]=2 \{\
14987 . ie \\n[#ADJ_BIB_LEAD] \{\
14988 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
14990 . el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
14991 . rr #RESTORE_DOC_LEAD
14993 . if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
14994 . if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
14996 . if \\n[#LINENUMBERS]=2 \{\
14997 . NUMBER_LINES RESUME
14998 . nr #LINENUMBERS 1
15002 \# ====================================================================
15004 \# +++TABLE OF CONTENTS+++
15006 \# Strings to allocate space for leaders and entry page numbers
15008 .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]
15009 .ds $TOC_PN_TYPEWRITE \\*[ST100]^\\*[ST100X]\\*[ST101]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST101X]
15011 \# TOC ENTRIES PAGE NUMBERS PADDING
15012 \# --------------------------------
15014 \# <number of placeholders for toc entries page numbers>
15016 \# Creates or modifies register #TOC_PN_PADDING.
15018 \# "Placeholders" is the maximum number of digits in a page
15023 .MAC TOC_PADDING END
15024 . nr #TOC_PN_PADDING \\$1
15031 \# <none> | <anything>
15033 \# Creates or removes register #PAGINATE_TOC.
15035 \# Default is to paginate toc.
15037 .MAC PAGINATE_TOC END
15038 . ie '\\$1'' \{ .nr #PAGINATE_TOC 1 \}
15039 . el \{ .nr #PAGINATE_TOC 0 \}
15046 \# <base point size for toc pages>
15048 \# Creates or modifies register #TOC_PS.
15050 \# This size control macro differs from other size control macros
15051 \# in that it sets an absolute point size, not a relative one.
15052 \# See notes for ENDNOTE_PT_SIZE for explanation. No unit of
15053 \# measure required.
15055 \# No unit of measure required (points assumed). Default is 12.5
15058 .MAC TOC_PT_SIZE END
15059 . nr #TOC_PS (p;\\$1)
15066 \# <leading for toc pages> [ADJUST]
15068 \# Creates or modifies register #TOC_LEAD. If optional ADJUST
15069 \# given, adjusts lead to fill page. If #OK_PROCESS_LEAD doesn't
15070 \# exist, stores arguments for when it's okay to run the macro.
15072 \# No unit of measure required (points assumed).
15074 \# Default is same as DOC_LEAD.
15077 . if !\\n[#OK_PROCESS_LEAD] \{\
15078 . ds $TOC_LEAD \\$1
15080 . ds $ADJUST_TOC_LEAD \\$2
15085 . nr #TOC_LEAD (p;\\$1)
15086 . if '\\$2'ADJUST' \{\
15087 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
15088 . nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
15089 . nr #ADJ_DOC_LEAD 1
15090 . nr #ADJ_TOC_LEAD 1
15091 . nr #NO_TRAP_RESET 1
15092 . DOC_LEAD \\n[#TOC_LEAD]u ADJUST
15093 . nr #TOC_LEAD \\n[#DOC_LEAD]
15094 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
15095 . rr #NO_TRAP_RESET
15096 . nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
15097 . rr #ORIG_DOC_LEAD
15102 \# TOC PAGES PAGE-NUMBERING STYLE
15103 \# ------------------------------
15105 \# DIGIT | ROMAN | roman | ALPHA | alpha
15107 \# Creates or modifies string $TOC_PN_STYLE
15109 \# Page numbering style for page numbers that appear in the
15110 \# headers/footers of toc pages. See notes for PAGENUM_STYLE.
15112 \# Default is roman.
15114 .MAC TOC_PAGENUM_STYLE END
15115 . ds $TOC_PN_STYLE \\$1
15119 \# TOC RECTO_VERSO SWITCH
15120 \# ----------------------
15122 \# <none> | <anything>
15124 \# Creates or removes register #TOC_RV_SWITCH
15126 \# Allows switching of L/R margins if a doc is recto/verso and
15127 \# the first toc page happens to fall the wrong way
15129 .MAC TOC_RV_SWITCH END
15130 . ie '\\$1'' \{ .nr #TOC_RV_SWITCH 1 \}
15131 . el \{ .rr #TOC_RV_SWITCH \}
15134 \# - for TOC "doc header" (i.e. "Contents")
15136 \# TOC HEADER STRING
15137 \# -----------------
15139 \# <string for "doc header" of first toc page>
15141 \# Creates or modifies string $TOC_HEADER_STRING
15143 \# Default is "Contents".
15145 .MAC TOC_HEADER_STRING END
15146 . ds $TOC_HEADER_STRING \\$1
15149 \# - for TOC entries page number numerals
15151 \# Control macros for toc doc titles, heads, subheads and paraheads
15152 \# ----------------------------------------------------------------
15154 \# All these control macros behave the same way, setting the family,
15155 \# font, point size and indent from the left margin of the different
15156 \# kinds of entries that can appear in the toc. The way they
15157 \# operate is identical to all other _FAMILY, _FONT and _SIZE
15158 \# control macros. _INDENT takes an absolute value.
15159 \# TOC_APPENDS_AUTHORS is unique in this section.
15161 \# - for title entries
15163 .MAC TOC_TITLE_INDENT END
15164 . nr #TOC_TITLE_INDENT (\\$1)
15168 .MAC TOC_TITLE_ENTRY END
15169 . nr #USER_SET_TITLE_ITEM 1
15170 . ds $USER_SET_TITLE_ITEM \\$1
15174 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
15175 \# -----------------------------------------
15177 \# <none> | <name(s) of author(s) as they should appear in toc doc title entries>
15179 \# Creates register #TOC_AUTHORS (to tell TOC to append authors
15180 \# to toc doc title entries). Optionally creates string
15183 \# Normally, TOC does not append the author(s) to a toc doc title
15184 \# entry. This special macro instructs TOC to do so.
15186 \# If user has multiple authors for each doc when collating,
15187 \# TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
15188 \# COLLATE and START in each doc. Otherwise, mom prints only the
15189 \# first author given to AUTHOR.
15191 .MAC TOC_APPENDS_AUTHOR END
15192 . nr #TOC_AUTHORS 1
15194 . ds $TOC_AUTHORS \\$1
15198 \# - for head entries
15200 .MAC TOC_HEAD_INDENT END
15201 . nr #TOC_HEAD_INDENT (\\$1)
15204 \# - for subhead entries
15206 .MAC TOC_SUBHEAD_INDENT END
15207 . nr #TOC_SH_INDENT (\\$1)
15210 \# - for parahead entries
15212 .MAC TOC_PARAHEAD_INDENT END
15213 . nr #TOC_PH_INDENT (\\$1)
15218 . if \\n[#LINENUMBERS]=1 \{\
15220 . nr #LINENUMBERS 2
15222 . if !r#PAGINATE_TOC \{ .PAGINATE_TOC \}
15223 . nr #TOC_FIRST_PAGE 1
15224 . if \\n[#FINIS] \{\
15225 . if \\n[#FOOTERS_WERE_ON] \{\
15226 . FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
15229 . if \\n[#FOOTERS_ON]=1 \{\
15230 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
15231 . ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
15232 . el \{ .PAGINATION OFF \}
15234 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS OFF \} \" But have to turn FOOTERS off again so they don't print when FINIS was called
15236 . if \\n[#FINIS] \{\
15237 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \} \" Finally, turn footers on if they were on
15238 . rr #FOOTERS_WERE_ON
15239 . if \\n[#PAGINATION_WAS_ON] \{\
15241 . rr #PAGINATION_WAS_ON
15245 . ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
15246 . el \{ .PAGINATION OFF \}
15247 . if \\n[#FOOTERS_ON]=1 \{\
15248 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
15249 . rm $HDRFTR_CENTER_OLD
15250 . rm $HDRFTR_CENTER_NEW
15255 . if \\n[#PRINT_STYLE]=1 \{\
15257 . DOC_LEAD 24 ADJUST
15260 . if \\n[#LINENUMBERS]=2 \{ .nr #LINENUMBERS 3 \}
15264 . if \\n[#PRINT_STYLE]=2 \{\
15265 . ie r#ADJ_TOC_LEAD \{\
15266 . nr #NO_TRAP_RESET 1
15267 . DOC_LEAD \\n[#TOC_LEAD]u ADJUST
15268 . rr #NO_TRAP_RESET
15270 . el \{ .DOC_LEAD \\n[#TOC_LEAD]u \}
15272 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
15273 . if \\n[#SLANT_ON] \{\
15276 . DOC_LINE_LENGTH \\n[#DOC_L_LENGTH]u
15277 . QUAD \\*[$TOC_HEADER_QUAD]
15278 . PAGENUM_STYLE \\*[$TOC_PN_STYLE]
15279 . if \\n[#PRINT_STYLE]=1 \{\
15282 . if \\n[#PRINT_STYLE]=2 \{\
15283 . FAMILY \\*[$TOC_HEADER_FAM]
15284 . FT \\*[$TOC_HEADER_FT]
15285 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
15287 . ie \\n[#PRINT_STYLE]=1 \{\
15290 . PRINT "\\*[$TOC_HEADER_STRING]"
15295 . PRINT "\\*[$TOC_HEADER_STRING]"
15299 .\" In collated docs, this bit inserts the first doc's title
15300 .\" underneath the TOC header, before the TOC_ENTRIES diversion
15303 . if d$FIRST_DOC_TITLE \{\
15304 . nr #RESTORE_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
15305 . TOC_PADDING \\n[#FIRST_DOC_TOC_PN_PADDING]
15306 . if \\n[#PRINT_STYLE]=2 \{\
15307 . FAMILY \\*[$TOC_TITLE_FAM]
15308 . FT \\*[$TOC_TITLE_FT]
15309 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
15312 . ie \\n[#PRINT_STYLE]=1 \{\
15313 . PAD "\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN_TYPEWRITE]"
15316 . PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN]"
15322 . if \\n[#PRINT_STYLE]=2 \{\
15323 . FAMILY \\*[$TOC_PN_FAM]
15324 . FT \\*[$TOC_PN_FT]
15325 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
15328 . PRINT \\*[LEADER]
15330 . PRINT \\n[#FIRST_DOC_TITLE_PN]
15333 . TOC_PADDING \\n[#RESTORE_TOC_PN_PADDING]
15338 . if \\n[#LINENUMBERS]=3 \{\
15339 . NUMBER_LINES RESUME
15340 . nr #LINENUMBERS 1
15345 \# ====================================================================
15352 \# <number of columns> <width of gutters>
15354 \# Creates registers associated with setting docs in columns.
15355 \# Calculates column line lengths and offsets
15357 \# COLUMNS, if used, s/b the last macro invoked before START.
15360 . if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
15362 . nr #NUM_COLS \\$1
15363 . nr #GUTTER (\\$2)
15364 . nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
15365 . nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
15367 . while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
15368 . nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
15369 . nr #COL_TOTAL \\n+[#COL_TOTAL]
15371 . if \\n[#NUM_COLS]=1 \{\
15372 . if !\\n[#COLLATE]=1 \{ .MN_INIT \}
15384 \# Breaks current column and moves to next column.
15385 \# If current column is the last on the page, breaks
15389 . if \\n[#COLUMNS] \{\
15391 . ie '\\$0'COL_NEXT' \{ .br \}
15396 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
15403 \# ====================================================================
15410 \# [ BULLET | DASH | DIGIT | alpha | ALPHA | roman | ROMAN | USER ] [ <separator> | NONE ] [ <prefix> ] [ <anything> ]
15412 \# Stores indent information in effect prior to invocation and
15413 \# initializes a list with the supplied enumerator (and separator).
15415 \# Default enumerator is a bullet.
15417 \# Enumerator *must* be supplied for every list that's to the
15418 \# right of another list, every time, unless the default bullet is
15421 \# <anything> moves back one list level intuitively, or exits lists
15422 \# completely if the level in which it's invoked is the first.
15425 . ds $1ST_LETTER \\$1
15426 . substring $1ST_LETTER 0 0
15427 . if '\\*[$1ST_LETTER]'r' .ds $1ST_LETTER R
15428 . ie '\\*[$1ST_LETTER]'R' \{\
15429 . ds $LAST_CHAR \\$1
15430 . substring $LAST_CHAR -1
15431 . if !\B'\\*[$LAST_CHAR]' \{\
15432 . if !'\\$1'ROMAN' \{\
15436 . if !'\\$1'roman' \{\
15440 . tm1 "[mom]: You must append a number to the \\$1 argument to LIST at line \\n(.c.
15441 . tm1 " The number should be the total number of items in this list.
15442 . tm1 " See the documentation.
15445 . ds $ROMAN_WIDTH \\$1
15446 . substring $ROMAN_WIDTH 1
15447 . while !\B'\\*[$ROMAN_WIDTH]' \{\
15448 . substring $ROMAN_WIDTH 1
15450 . length #ROMAN_LENGTH \\*[$ROMAN_WIDTH]
15451 . ds $LIST_ARG_1 \\$1
15452 . substring $LIST_ARG_1 0 -(\\n[#ROMAN_LENGTH]+1)
15455 . ds $LIST_ARG_1 \\$1
15458 . nr #STORED_HL_INDENT \\n[#HL_INDENT]
15459 . nr #STORED_T_INDENT \\n[#T_INDENT]
15460 . nr #CURRENT_L_LENGTH \\n(.l
15462 . if \\n[#INDENT_ACTIVE]=1 \{\
15463 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
15464 . nr #STORED_L_INDENT \\n[#L_INDENT]
15465 . nr #RESTORE_PREV_INDENT 1
15467 . if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
15468 . nr #STORED_BL_INDENT \\n[#BL_INDENT]
15469 . nr #STORED_BR_INDENT \\n[#BR_INDENT]
15471 . nr #ORIG_L_LENGTH \\n(.l
15473 . nr #RESTORE_PREV_INDENT 2
15475 . if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
15476 . nr #STORED_R_INDENT \\n[#R_INDENT]
15478 . nr #ORIG_L_LENGTH \\n(.l
15480 . nr #RESTORE_PREV_INDENT 3
15481 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{ .nr #RESTORE_PREV_INDENT 4 \}
15485 . if \\n[#NUM_ARGS]=0 \{\
15486 . nr #ARGS_TO_LIST 1 \" So default behaves as if LIST BULLET
15487 . ds $ENUMERATOR\\n+[#DEPTH] \(bu
15488 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
15491 . if \\n[#NUM_ARGS]>0 \{\
15492 . rr #ARGS_TO_LIST \" Clear this before processing arg 1.
15493 . if '\\*[$LIST_ARG_1]'DASH' \{\
15494 . nr #ARGS_TO_LIST 1
15495 . ds $ENUMERATOR\\n+[#DEPTH] \(en
15496 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
15497 . ds $SEPARATOR\\n[#DEPTH]
15499 . if '\\*[$LIST_ARG_1]'BULLET' \{\
15500 . nr #ARGS_TO_LIST 1
15501 . ds $ENUMERATOR\\n+[#DEPTH] \(bu
15502 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
15503 . ds $SEPARATOR\\n[#DEPTH]
15505 . if '\\*[$LIST_ARG_1]'DIGIT' \{\
15506 . nr #ARGS_TO_LIST 1
15507 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15508 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
15509 . ds $SEPARATOR\\n[#DEPTH] .
15510 . ds $PREFIX\\n[#DEPTH]
15511 . if \\n[#NUM_ARGS]>=2 \{\
15512 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15513 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15514 . if \\n[#NUM_ARGS]=3 \{\
15515 . ds $PREFIX\\n[#DEPTH] \\$3
15519 . if '\\*[$LIST_ARG_1]'alpha' \{\
15520 . nr #ARGS_TO_LIST 1
15521 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15522 . af #ENUMERATOR\\n[#DEPTH] a
15523 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
15524 . ds $SEPARATOR\\n[#DEPTH] )
15525 . ds $PREFIX\\n[#DEPTH]
15526 . if \\n[#NUM_ARGS]>=2 \{\
15527 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15528 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15529 . if \\n[#NUM_ARGS]=3 \{\
15530 . ds $PREFIX\\n[#DEPTH] \\$3
15534 . if '\\*[$LIST_ARG_1]'ALPHA' \{\
15535 . nr #ARGS_TO_LIST 1
15536 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15537 . af #ENUMERATOR\\n[#DEPTH] A
15538 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
15539 . ds $SEPARATOR\\n[#DEPTH] )
15540 . ds $PREFIX\\n[#DEPTH]
15541 . if \\n[#NUM_ARGS]>=2 \{\
15542 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15543 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15544 . if \\n[#NUM_ARGS]=3 \{\
15545 . ds $PREFIX\\n[#DEPTH] \\$3
15549 . if '\\*[$1ST_LETTER]'R' \{\
15550 . nr #ARGS_TO_LIST 1
15551 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15552 . if '\\*[$LIST_ARG_1]'roman' \{\
15553 . af #ENUMERATOR\\n[#DEPTH] i
15555 . if '\\*[$LIST_ARG_1]'ROMAN' \{\
15556 . af #ENUMERATOR\\n[#DEPTH] I
15558 . ds $ENUMERATOR_TYPE\\n[#DEPTH] roman
15559 . ds $SEPARATOR\\n[#DEPTH] )
15560 . ds $PREFIX\\n[#DEPTH]
15561 . if \\n[#NUM_ARGS]>=2 \{\
15562 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15563 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15564 . if \\n[#NUM_ARGS]=3 \{\
15565 . ds $PREFIX\\n[#DEPTH] \\$3
15569 . if '\\*[$LIST_ARG_1]'USER' \{\
15570 . nr #ARGS_TO_LIST 1
15571 . ds $ENUMERATOR\\n+[#DEPTH] \\$2
15572 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
15573 . ds $SEPARATOR\\n[#DEPTH]
15574 . ds $PREFIX\\n[#DEPTH]
15576 . if \\n[#NUM_ARGS]=1 \{\
15577 . if !r#ARGS_TO_LIST \{\
15578 . ie \\n[#DEPTH]=1 \{\
15579 . ie \\n[#NEXT_DEPTH_BACK]=0 \{\
15581 . if \\n[#QUIT]=1 \{\
15599 . nr #TOTAL_LISTS \\n[#DEPTH]
15600 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
15601 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]m\\*[$SEPARATOR\\n[#DEPTH]]\ '
15602 . if '\\*[$LIST_ARG_1]'ALPHA'\{\
15603 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]M\\*[$SEPARATOR\\n[#DEPTH]]\ '
15606 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
15609 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \{\
15610 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$ENUMERATOR\\n[#DEPTH]]\0'
15612 . ll \\n[#CURRENT_L_LENGTH]u
15613 . ie \\n[#DEPTH]=1 \{\
15614 . ie \\n[#INDENT_ACTIVE]=1 \{\
15615 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
15616 . nr #L_INDENT \\n[#L_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
15617 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15618 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
15620 . if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
15621 . nr #L_INDENT \\n[#BL_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
15622 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15623 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
15625 . if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
15626 . ie \\n[#INDENT_LEFT_ACTIVE]=1 \{\
15627 . \" Don't do anything; we already have a left indent
15630 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15631 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15636 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15637 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15641 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15642 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15652 \# Prints enumerator for a given list depth and prepares mom to
15653 \# receive the text of an item.
15656 . if !r#DEPTH \{ .return \}
15657 . if \\n[#LINENUMBERS]=1 \{\
15659 . nr #LINENUMBERS 2
15661 . if \\n[#KERN]=1 \{\
15662 . nr #KERN_WAS_ON 1
15666 . ll \\n[#CURRENT_L_LENGTH]u \" Set ll again because IL turns IB off.
15668 . HI \\n[#HL_INDENT\\n[#DEPTH]]u
15669 . if '\\*[$SEPARATOR\\n[#DEPTH]]')' \{ .nr #SEP_TYPE 1 \}
15670 . if '\\*[$SEPARATOR\\n[#DEPTH]]']' \{ .nr #SEP_TYPE 1 \}
15671 . if '\\*[$SEPARATOR\\n[#DEPTH]]'}' \{ .nr #SEP_TYPE 1 \}
15672 . ie \\n[#IN_BIB_LIST]=1 \{\
15673 . ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
15674 . ie \\n[#SEP_TYPE]=1 \{\
15675 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15678 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15682 . ie \\n[#SEP_TYPE]=1 \{\
15683 . PRINT \h'-\w'\0'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15686 . PRINT \h'-\w'\0'u'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15691 . ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
15693 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
15694 . ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
15695 . ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
15696 . ie \\n[#SEP_TYPE]=1 \{\
15697 . PRINT \0\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15700 . PRINT \0\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15704 . ie \\n[#SEP_TYPE]=1 \{\
15705 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15708 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15713 . ie \\n[#SEP_TYPE]=1 \{\
15714 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15717 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15723 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'A' \{\
15724 . ie \\n[#SEP_TYPE]=1 \{\
15725 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15728 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15733 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15737 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
15738 . ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
15739 .\" ROMAN I, padded
15740 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
15741 . ie \\n[#SEP_TYPE]=1 \{\
15742 . PRINT "\h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\0'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15745 . PRINT "\h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\0'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15748 .\" roman i, padded
15750 . PRINT "\h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\0'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15755 .\" ROMAN I, no pad
15756 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
15757 . ie \\n[#SEP_TYPE]=1 \{\
15758 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15761 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15764 .\" roman i, no pad
15766 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15770 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \{\
15771 . PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15776 . if \\n[#REF]=1 \{\
15777 . IL +\\*[$REF_BIB_INDENT]
15778 . ti \\n[#L_INDENT]u-\\*[$REF_BIB_INDENT]
15781 . if \\n[#KERN_WAS_ON]=1 \{\
15785 . if \\n[#LINENUMBERS]=2 \{\
15786 . NUMBER_LINES RESUME
15787 . nr #LINENUMBERS 1
15791 \# A utility macro that determines the space to reserve for
15792 \# roman numeral enumerated lists. Limit is 20 roman numerals
15793 \# per list. If this isn't enough, the user can add to the
15796 .MAC GET_ROMAN_INDENT END
15797 . if '\\*[$LIST_ARG_1]'roman' \{\
15798 . if '\\*[$ROMAN_WIDTH]'1' \{\
15799 . ds $ROMAN_WIDTH\\n[#DEPTH] 1
15800 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]i\\*[$SEPARATOR\\n[#DEPTH]]\0'
15802 . if '\\*[$ROMAN_WIDTH]'2' \{\
15803 . ds $ROMAN_WIDTH\\n[#DEPTH] 2
15804 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]ii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15806 . if '\\*[$ROMAN_WIDTH]'3' \{\
15807 . ds $ROMAN_WIDTH\\n[#DEPTH] 3
15808 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15810 . if '\\*[$ROMAN_WIDTH]'4' \{\
15811 . ds $ROMAN_WIDTH\\n[#DEPTH] 4
15812 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15814 . if '\\*[$ROMAN_WIDTH]'5' \{\
15815 . ds $ROMAN_WIDTH\\n[#DEPTH] 5
15816 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15818 . if '\\*[$ROMAN_WIDTH]'6' \{\
15819 . ds $ROMAN_WIDTH\\n[#DEPTH] 6
15820 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15822 . if '\\*[$ROMAN_WIDTH]'7' \{\
15823 . ds $ROMAN_WIDTH\\n[#DEPTH] 7
15824 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]vii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15826 . if '\\*[$ROMAN_WIDTH]'8' \{\
15827 . ds $ROMAN_WIDTH\\n[#DEPTH] 8
15828 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15830 . if '\\*[$ROMAN_WIDTH]'9' \{\
15831 . ds $ROMAN_WIDTH\\n[#DEPTH] 9
15832 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15834 . if '\\*[$ROMAN_WIDTH]'10' \{\
15835 . ds $ROMAN_WIDTH\\n[#DEPTH] 10
15836 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15838 . if '\\*[$ROMAN_WIDTH]'11' \{\
15839 . ds $ROMAN_WIDTH\\n[#DEPTH] 11
15840 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15842 . if '\\*[$ROMAN_WIDTH]'12' \{\
15843 . ds $ROMAN_WIDTH\\n[#DEPTH] 12
15844 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15846 . if '\\*[$ROMAN_WIDTH]'13' \{\
15847 . ds $ROMAN_WIDTH\\n[#DEPTH] 13
15848 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15850 . if '\\*[$ROMAN_WIDTH]'14' \{\
15851 . ds $ROMAN_WIDTH\\n[#DEPTH] 14
15852 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15854 . if '\\*[$ROMAN_WIDTH]'15' \{\
15855 . ds $ROMAN_WIDTH\\n[#DEPTH] 15
15856 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15858 . if '\\*[$ROMAN_WIDTH]'16' \{\
15859 . ds $ROMAN_WIDTH\\n[#DEPTH] 16
15860 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15862 . if '\\*[$ROMAN_WIDTH]'17' \{\
15863 . ds $ROMAN_WIDTH\\n[#DEPTH] 17
15864 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xvii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15866 . if '\\*[$ROMAN_WIDTH]'18' \{\
15867 . ds $ROMAN_WIDTH\\n[#DEPTH] 18
15868 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15870 . if '\\*[$ROMAN_WIDTH]'19' \{\
15871 . ds $ROMAN_WIDTH\\n[#DEPTH] 19
15872 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15874 . if '\\*[$ROMAN_WIDTH]'20' \{\
15875 . ds $ROMAN_WIDTH\\n[#DEPTH] 20
15876 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15879 . if '\\*[$LIST_ARG_1]'ROMAN' \{\
15880 . if '\\*[$ROMAN_WIDTH]'1' \{\
15881 . ds $ROMAN_WIDTH\\n[#DEPTH] 1
15882 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]I\\*[$SEPARATOR\\n[#DEPTH]]\0'
15884 . if '\\*[$ROMAN_WIDTH]'2' \{\
15885 . ds $ROMAN_WIDTH\\n[#DEPTH] 2
15886 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]II\\*[$SEPARATOR\\n[#DEPTH]]\0'
15888 . if '\\*[$ROMAN_WIDTH]'3' \{\
15889 . ds $ROMAN_WIDTH\\n[#DEPTH] 3
15890 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]III\\*[$SEPARATOR\\n[#DEPTH]]\0'
15892 . if '\\*[$ROMAN_WIDTH]'4' \{\
15893 . ds $ROMAN_WIDTH\\n[#DEPTH] 4
15894 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15896 . if '\\*[$ROMAN_WIDTH]'5' \{\
15897 . ds $ROMAN_WIDTH\\n[#DEPTH] 5
15898 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15900 . if '\\*[$ROMAN_WIDTH]'6' \{\
15901 . ds $ROMAN_WIDTH\\n[#DEPTH] 6
15902 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15904 . if '\\*[$ROMAN_WIDTH]'7' \{\
15905 . ds $ROMAN_WIDTH\\n[#DEPTH] 7
15906 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15908 . if '\\*[$ROMAN_WIDTH]'8' \{\
15909 . ds $ROMAN_WIDTH\\n[#DEPTH] 8
15910 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15912 . if '\\*[$ROMAN_WIDTH]'9' \{\
15913 . ds $ROMAN_WIDTH\\n[#DEPTH] 9
15914 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15916 . if '\\*[$ROMAN_WIDTH]'10' \{\
15917 . ds $ROMAN_WIDTH\\n[#DEPTH] 10
15918 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15920 . if '\\*[$ROMAN_WIDTH]'11' \{\
15921 . ds $ROMAN_WIDTH\\n[#DEPTH] 11
15922 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15924 . if '\\*[$ROMAN_WIDTH]'12' \{\
15925 . ds $ROMAN_WIDTH\\n[#DEPTH] 12
15926 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15928 . if '\\*[$ROMAN_WIDTH]'13' \{\
15929 . ds $ROMAN_WIDTH\\n[#DEPTH] 13
15930 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15932 . if '\\*[$ROMAN_WIDTH]'14' \{\
15933 . ds $ROMAN_WIDTH\\n[#DEPTH] 14
15934 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15936 . if '\\*[$ROMAN_WIDTH]'15' \{\
15937 . ds $ROMAN_WIDTH\\n[#DEPTH] 15
15938 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15940 . if '\\*[$ROMAN_WIDTH]'16' \{\
15941 . ds $ROMAN_WIDTH\\n[#DEPTH] 16
15942 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15944 . if '\\*[$ROMAN_WIDTH]'17' \{\
15945 . ds $ROMAN_WIDTH\\n[#DEPTH] 17
15946 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15948 . if '\\*[$ROMAN_WIDTH]'18' \{\
15949 . ds $ROMAN_WIDTH\\n[#DEPTH] 18
15950 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15952 . if '\\*[$ROMAN_WIDTH]'19' \{\
15953 . ds $ROMAN_WIDTH\\n[#DEPTH] 19
15954 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15956 . if '\\*[$ROMAN_WIDTH]'20' \{\
15957 . ds $ROMAN_WIDTH\\n[#DEPTH] 20
15958 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15966 \# <amount by which to indent a list to the right>
15968 \# Adds the value of the arg to the current list's indent.
15970 \# Requires a unit of measure.
15972 .MAC SHIFT_LIST END
15973 . nr #SHIFT_LIST\\n[#DEPTH] (\\$1)
15974 . nr #L_INDENT +\\n[#SHIFT_LIST\\n[#DEPTH]]
15983 \# Adds a figure space to a list's hanging and left indent. If
15984 \# LEFT is given, sets reg. #PAD_LIST_DIGITS to 1 for use in ITEM.
15986 .MAC PAD_LIST_DIGITS END
15987 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
15988 . nr #LIST_INDENT\\n[#DEPTH] +\\w'\\0'
15989 . nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#LIST_INDENT\\n-[#DEPTH]]
15990 . nr #HL_INDENT\\n+[#DEPTH] +\\w'\\n[#ENUMERATOR\\n[#DEPTH]]'
15991 . if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
15993 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'i' \{\
15994 . if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
15996 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
15997 . if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
16007 \# Resets register enumerators to 1 or a.
16009 .MAC RESET_LIST END
16010 . ie '\\$1'' \{ .nr #ENUMERATOR\\n[#DEPTH] 0 1 \}
16011 . el \{ .nr #ENUMERATOR\\n[#DEPTH] \\$1-1 1 \}
16020 \# Exits lists cleanly and restores any indents that were in
16021 \# effect prior to LIST.
16023 .MAC QUIT_LISTS END
16025 . nr #HL_INDENT \\n[#STORED_HL_INDENT]
16026 . nr #T_INDENT \\n[#STORED_T_INDENT]
16027 . rr #STORED_HL_INDENT
16028 . if \\n[#RESTORE_PREV_INDENT]=1 \{\
16029 . nr #L_INDENT \\n[#STORED_L_INDENT]
16031 . rr #STORED_L_INDENT
16033 . if \\n[#RESTORE_PREV_INDENT]=2 \{\
16034 . nr #BL_INDENT \\n[#STORED_BL_INDENT]
16035 . nr #BR_INDENT \\n[#STORED_BR_INDENT]
16036 . ll \\n[#ORIG_L_LENGTH]u
16038 . rr #STORED_BL_INDENT
16039 . rr #STORED_BR_INDENT
16041 . if \\n[#RESTORE_PREV_INDENT]=3 \{\
16042 . nr #R_INDENT \\n[#STORED_R_INDENT]
16043 . ll \\n[#ORIG_L_LENGTH]u
16045 . rr #STORED_R_INDENT
16047 . if \\n[#RESTORE_PREV_INDENT]=4 \{\
16048 . nr #R_INDENT \\n[#STORED_R_INDENT]
16049 . nr #L_INDENT \\n[#STORED_L_INDENT]
16050 . ll \\n[#ORIG_L_LENGTH]u
16053 . rr #STORED_R_INDENT
16054 . rr #STORED_L_INDENT
16056 .\" Clean up after exiting last depth of list
16058 . while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\
16059 . rr #LIST_INDENT\\n[#REMOVE]
16060 . rr #ENUMERATOR\\n[#REMOVE]
16061 . rm $ENUMERATOR\\n[#REMOVE]
16062 . rm $SEPARATOR\\n[#REMOVE]
16063 . rm $ENUMERATOR_TYPE\\n[#REMOVE]
16064 . rr #PAD_LIST_DIGITS\\n[#REMOVE]
16070 . rr #NEXT_DEPTH_BACK
16071 . rr #RESTORE_PREV_INDENT
16072 . rr #ORIG_L_LENGTH
16073 . rr #CURRENT_L_LENGTH
16082 \# Restores indent of prev. list in nested lists. Also sets the
16083 \# #QUIT register if an invocation of LIST OFF applies to the first
16086 .MAC SET_LIST_INDENT END
16087 . nr #NEXT_DEPTH_BACK \\n[#DEPTH]-1
16088 . if \\n[#NEXT_DEPTH_BACK]=0 \{\
16092 . nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#SHIFT_LIST\\n[#DEPTH]]
16093 . nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]]
16096 \# ====================================================================
16098 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
16105 \# Turns headers off (if on) and saves header state, sets register
16106 \# #COLLATE to 1 (toggle), and breaks to a new page.
16108 \# COLLATE exists primarily to allow putting multiple chapters in
16109 \# a single file, although it can be used for any document type. After
16110 \# COLLATE, any of the macros that normally precede START may be
16111 \# used, and should behave as expected.
16113 \# N.B.--the START macro *must* be used after COLLATE (and any other
16114 \# macros that alter mom's behaviour).
16117 . if ( (\\n[.t]-1) <= \\n[.v] ) \{ .nr #NO_BREAK 1 \}
16118 . ds $SAVED_PP_FT \\*[$PP_FT]
16120 . nr #PRE_COLLATE 1
16121 . nr #HEADER_STATE \\n[#HEADERS_ON]
16123 . if \\n[#DOC_HEADER]=2 \{ .nr #DOC_HEADER 1 \}
16124 . if \\n[#PAGE_NUM_V_POS]=1 \{\
16125 . nr #PAGINATION_STATE \\n[#PAGINATE]
16130 .\" Collect first doc's title for TOC
16131 . if \\n[#COLLATED_DOC]=0 \{\
16132 . ie \\n[#USER_SET_TITLE_ITEM] \{\
16133 . ds $FIRST_DOC_TITLE \\*[$USER_SET_TITLE_ITEM]\\|
16134 . rr #USER_SET_TITLE_ITEM
16135 . rm $USER_SET_TITLE_ITEM
16138 . ie \\n[#DOC_TYPE]=2 \{\
16139 . ie '\\*[$CHAPTER_TITLE]'' \{\
16140 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
16143 . ie '\\*[$CHAPTER]'' \{\
16144 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_TITLE]\\|
16147 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
16152 . ds $FIRST_DOC_TITLE \\*[$TITLE]\\|
16155 . if \\n[#TOC_AUTHORS]=1 \{\
16156 . ie '\\*[$TOC_AUTHORS]'' \{\
16157 . as $FIRST_DOC_TITLE /\\|\\*[$AUTHOR_1]\\|
16160 . as $FIRST_DOC_TITLE /\\|\\*[$TOC_AUTHORS]\\|
16164 . nr #COLLATED_DOC 1
16166 .\" End title collection for TOC
16167 . LL \\n[#DOC_L_LENGTH]u
16169 . nr #SAVED_DOC_LEAD \\n[#DOC_LEAD]
16170 . LS \\n[#DOC_LEAD]u
16175 . if \\n[#DEFER_PAGINATION] \{ .PAGINATE \}
16176 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
16177 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
16178 . rm $RESTORE_PAGENUM_STYLE
16180 . if \\n[#CH_NUM] \{ .nr #CH_NUM +1 \}
16189 . rr #PAGENUM_STYLE_SET
16198 \# <starting line number> [ <increment> [ <gutter> ] ]
16200 \# <anything> | RESUME
16202 \# Begin, suspend/turn off, or resume numbering of output lines.
16204 .MAC NUMBER_LINES END
16206 . if '\\n(.z'EPI_TEXT' \{ .return \}
16208 . tm1 "[mom]: NUMBER_LINES at line \\n(.c has no argument.
16209 . tm1 " Most likely, you have forgotten to give it a starting line number.
16210 . ab Aborting on NUMBER_LINES.
16212 . if !\\n[#LINENUMBERS]=2 \{ .nr #LINENUMBERS 1 \}
16213 .\" Test whether the first arg is a digit.
16217 . if !'\\n(.z'' \{ .nr #RESTORE_LN_NUM 1 \}
16219 . if '\\*[$LN_INC]'' .ds $LN_INC 1
16221 . el .ds $LN_INC \\$2
16223 . if '\\*[$LN_GUTTER]'' .ds $LN_GUTTER 2
16225 . el .ds $LN_GUTTER \\$3
16228 .\" In other words, the first arg was not a digit.
16230 . ie '\\$1'RESUME' \{\
16245 . if !\\n[#LINENUMBERS]=2 \{ .rr #LINENUMBERS \}
16250 . nm \\*[$LN_NUM] \\*[$LN_INC] \\*[$LN_GUTTER] -3-\\*[$LN_GUTTER]
16255 . if !'\\n(.z'' \{ .nr #DIVER_LN_OFF 1 \}
16261 \# LINENUMBER STYLE PARAMETERS
16262 \# ---------------------------
16266 \# Checks if any line numbering parameters have been set, and
16267 \# passes the args, if any, to the appropriate request. If a linenumber
16268 \# parameter is missing, passes the current value of the register
16269 \# associated with the request to the request. (Ensures that the
16270 \# same requests, called in NUMBER_LINES to reset the registers
16271 \# to their former values, stay at those values.)
16274 . ie d$LN_FAM \{ .fam \\*[$LN_FAM] \}
16275 . el \{ .fam \\n[.fam] \}
16276 . ie d$LN_FT \{ .ft \\*[$LN_FT] \}
16277 . el \{ .ft \\n[.sty] \}
16278 . ie d$LN_SIZE_CHANGE \{ .ps \\*[$LN_SIZE_CHANGE] \}
16279 . el \{ .ps \\n[.s] \}
16280 . ie d$LN_COLOR \{ .gcolor \\*[$LN_COLOR] \}
16281 . el \{ .gcolor \\n[.m] \}
16285 \# NUMBER QUOTE AND BLOCKQUOTE LINES AS PART OF RUNNING TEXT
16286 \# ---------------------------------------------------------
16288 \# <gutter> | <anything>
16290 \# Sets #(B)QUOTE_LN to 1 if no argument, or a single numeric
16291 \# argument, is given; otherwise, turns (BLOCK)QUOTE linenumbering
16294 \# #(B)QUOTE is checked for in QUOTE and BLOCKQUOTE.
16295 \# The single numeric argument allows establishing a different gutter from
16296 \# the one used for line numbers in running text.
16298 .MAC NUMBER_QUOTE_LINES END
16299 . ie \\n[#NUM_ARGS]=0 \{ .nr #QUOTE_LN 1 \}
16303 . ds $Q_LN_GUTTER \\$1
16306 . ie '\\$1'SILENT' \{ .nr #SILENT_QUOTE_LN 1 \}
16309 . rr #SILENT_QUOTE_LN
16316 .MAC NUMBER_BLOCKQUOTE_LINES END
16317 . ie \\n[#NUM_ARGS]=0 \{ .nr #BQUOTE_LN 1 \}
16321 . ds $BQ_LN_GUTTER \\$1
16324 . ie '\\$1'SILENT' \{ .nr #SILENT_BQUOTE_LN 1 \}
16327 . rr #SILENT_BQUOTE_LN
16333 \# OUTPUT BLANK PAGES
16334 \# ------------------
16336 \# <number of blank pages to output> [ NULL ]
16338 \# Outputs blank pages.
16340 \# If recto/verso, each page is recto/verso, even if there's
16343 \# The argument to BLANKPAGE is non-optional.
16346 . nr #HOW_MANY \\$1
16348 . while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
16349 . if \\n[#HEADERS_ON]=1 \{\
16350 . nr #HEADERS_WERE_ON 1
16353 . if \\n[#PAGE_NUM_V_POS]=1 \{\
16354 . if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
16359 . if \\n[#FOOTERS_ON]=1 \{\
16360 . nr #FOOTERS_WERE_ON 1
16363 . if \\n[#PAGE_NUM_V_POS]=2 \{\
16364 . if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
16367 . if \\n[#HEADERS_WERE_ON] \{ .HEADERS \}
16368 . if \\n[#PAGE_NUM_V_POS]=1 \{\
16369 . if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
16373 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \}
16374 . if \\n[#PAGE_NUM_V_POS]=2 \{\
16375 . if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
16377 . if \\n[#PAGINATE]=1 \{\
16378 . if '\\$2'NULL' \{ .nr #PAGE_NUM_ADJ -\\n[#HOW_MANY] \}
16381 . rr #HEADERS_WERE_ON
16382 . rr #FOOTERS_WERE_ON
16383 . rr #PAGINATE_WAS_ON
16387 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
16388 \# ---------------------------------------
16392 \# Sets header/footer/footnotes/etc... traps.
16394 \# Calculates the number of lines that actually fit on a
16395 \# page based on #B_MARGIN and resets page bottom trap to coincide
16396 \# with the depth of that number of lines, or, if #ADJ_DOC_LEAD=1,
16397 \# adjusts #DOC_LEAD so that the last line of text on a page falls
16398 \# exactly on #B_MARGIN.
16401 .\" Remove all header/footer traps
16402 . if !\\n[#NO_TRAP_RESET] \{\
16407 . ch FN_OVERFLOW_TRAP
16408 .\" Plant header trap
16411 .\" Adjust lead so last line of text falls on B_MARGIN,...
16412 . ie \\n[#ADJ_DOC_LEAD]=1 \{\
16413 . nr #LINES_PER_PAGE 0 1
16414 . nr #DOC_LEAD_ADJ 0 1
16415 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#ORIGINAL_B_MARGIN]-1v
16416 .\" Get the number of unadjusted lines that fit on the page; always a
16417 .\" bit short of the bottom margin
16418 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
16421 . nr #LINES_PER_PAGE -1
16422 .\" Add machine units, 1 at a time, increasing the leading until the
16423 .\" new leading fills the page properly
16424 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
16427 . DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
16428 .\" The "visual" bottom margin is what \n(nl would report on the
16429 .\" last line before the FOOTER trap is sprung
16430 . nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD])
16431 .\" Get the difference between #B_MARGIN and #VISUAL_B_MARGIN
16432 . nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
16433 .\" Set #B_MARGIN to 1 machine unit lower on the page than #VISUAL_B_MARGIN
16434 . nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
16435 .\" Set the FN_OVERFLOW_TRAP position
16436 . nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
16437 . if \\n[#PRINT_STYLE]=1 .nr #FN_OVERFLOW_TRAP_POS \\n[#ORIGINAL_B_MARGIN]u
16439 .\" ...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
16442 . nr #LINES_PER_PAGE 0 1
16443 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
16444 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
16447 . nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD]-1v)
16448 . nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
16449 . nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
16450 . nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
16452 .\" Set footer and footnote overflow traps
16453 . if !\\n[#NO_TRAP_RESET] \{\
16455 . nr #SPACE_REMAINING 0
16457 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
16458 . wh \\n(.pu FOOTER
16459 . wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
16460 . ch FOOTER -\\n[#B_MARGIN]u
16470 \# Adds left, right, or both indent values to document elements
16471 \# like heads and subheads that are processed in environments.
16473 .MAC CHECK_INDENT END
16474 . if \\n[#INDENT_LEFT_ACTIVE] \{\
16475 . in \\n[#L_INDENT]u
16476 . if \\n[#QUOTE] \{\
16477 . in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
16478 . ll -\\n[#L_INDENT]u
16481 . if \\n[#EPIGRAPH] \{\
16482 . in -\\n[#L_INDENT]u
16483 . ll -\\n[#L_INDENT]u
16487 . if \\n[#INDENT_RIGHT_ACTIVE] \{\
16488 . ll -\\n[#R_INDENT]u
16491 . if \\n[#INDENT_BOTH_ACTIVE] \{\
16492 . in \\n[#BL_INDENT]u
16493 . ll -\\n[#BR_INDENT]u
16495 . if \\n[#QUOTE] \{\
16496 . in -\\n[#BL_INDENT]u
16497 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
16498 . ll -\\n[#BR_INDENT]u
16502 . ll -(\\n[#BR_INDENT]u/2u)
16506 . if \\n[#EPIGRAPH] \{\
16507 . in -\\n[#BL_INDENT]u
16508 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
16509 . ll -\\n[#BR_INDENT]u
16513 . ll -(\\n[#BR_INDENT]u/2u)
16526 \# Removes left, right, or both indent values from document elements
16527 \# like heads and subheads that are processed in environments.
16529 .MAC REMOVE_INDENT END
16531 . ll \\n[#L_LENGTH]u
16536 \# This .em (for all DOC_TYPEs except 4 [LETTER]) ensures that
16537 \# deferred footnotes that happen on the 2nd to last page get
16541 . ie \\n[#FN_DEPTH] \{\
16542 . ie \\n[#FN_DEFER] \{\
16551 . ch FN_OVERFLOW_TRAP
16557 . ch FN_OVERFLOW_TRAP
16562 \# END MACRO FOR LETTERS
16563 \# ---------------------
16567 \# The .em macro executed at the end of letters. Turns footers
16568 \# and pagination off, terminates and outputs diversion CLOSING
16569 \# (indented with the author's name underneath).
16575 . if \\n[#DOC_TYPE]=4 \{\
16577 . if !'\\n(.z'' \{ .di \}
16580 . TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
16581 . ALD \\n[#DOC_LEAD]u*2u
16583 . if \\n[#CLOSING] \{\
16587 . ALD \\n[#DOC_LEAD]u*3u
16588 . PRINT \\*[$AUTHOR_1]
16593 \# Set up a default papersize of US letter
16597 \# ====================================================================
16599 \# +++DOCUMENT PROCESSING ALIASES+++
16601 \# Aliases to make life easier for users: synonyms, short forms
16602 \# and alternate spellings.
16604 .ALIAS BREAK_BLOCKQUOTE BREAK_QUOTE
16605 .ALIAS BREAK_CITATION BREAK_QUOTE
16606 .ALIAS BREAK_CITE BREAK_QUOTE
16607 .ALIAS BLOCKQUOTE_INDENT QUOTE_INDENT
16608 .ALIAS CITATION BLOCKQUOTE
16609 .ALIAS CITATION_FAMILY BLOCKQUOTE_FAMILY
16610 .ALIAS CITATION_FONT BLOCKQUOTE_FONT
16611 .ALIAS CITATION_SIZE BLOCKQUOTE_SIZE
16612 .ALIAS CITATION_COLOR BLOCKQUOTE_COLOR
16613 .ALIAS CITATION_QUAD BLOCKQUOTE_QUAD
16614 .ALIAS CITE BLOCKQUOTE
16615 .ALIAS CITE_FAMILY BLOCKQUOTE_FAMILY
16616 .ALIAS CITE_FONT BLOCKQUOTE_FONT
16617 .ALIAS CITE_SIZE BLOCKQUOTE_SIZE
16618 .ALIAS CITE_COLOR BLOCKQUOTE_COLOR
16619 .ALIAS CITE_QUAD BLOCKQUOTE_QUAD
16620 .ALIAS DOC_R_MARGIN DOC_RIGHT_MARGIN
16621 .ALIAS DOC_L_MARGIN DOC_LEFT_MARGIN
16622 .ALIAS DOC_L_LENGTH DOC_LINE_LENGTH
16623 .ALIAS DOC_RMARGIN DOC_RIGHT_MARGIN
16624 .ALIAS DOC_LMARGIN DOC_LEFT_MARGIN
16625 .ALIAS DOC_LLENGTH DOC_LINE_LENGTH
16626 .ALIAS DOC_FAM DOC_FAMILY
16627 .ALIAS DOC_LS DOC_LEAD
16628 .ALIAS DOC_PS DOC_PT_SIZE
16630 .ALIAS PAGENUM PAGENUMBER
16631 .ALIAS PAGINATION PAGINATE
16632 .ALIAS PP_FT PP_FONT
16633 .ALIAS REF_INDENT INDENT_REFS
16634 .ALIAS TOC_PS TOC_PT_SIZE
16636 \# HEADER and FOOTER macros
16637 \# ------------------------
16638 \# Because the type-style of headers and footers are managed
16639 \# identically, and the type-style macros (_<type parameter>) all
16640 \# require the correct name of the calling macro, it's necessary
16641 \# to create HEADER_ and FOOTER_ macros here. They're basically
16642 \# "aliases" of HDRFTR_, but required because you can't alias an
16645 .MAC FOOTER_CENTER_COLOR END
16646 . HDRFTR_CENTER_COLOR \\$1
16649 .MAC FOOTER_CENTER_COLOUR END
16650 . HDRFTR_CENTER_COLOR \\$1
16653 .MAC FOOTER_CENTER_FAM END
16654 . HDRFTR_CENTER_FAMILY \\$1
16657 .MAC FOOTER_CENTER_FAMILY END
16658 . HDRFTR_CENTER_FAMILY \\$1
16661 .MAC FOOTER_CENTER_FONT END
16662 . HDRFTR_CENTER_FONT \\$1
16665 .MAC FOOTER_CENTER_FT END
16666 . HDRFTR_CENTER_FONT \\$1
16669 .MAC FOOTER_CENTER_PS END
16670 . HDRFTR_CENTER_SIZE \\$1
16673 .MAC FOOTER_CENTER_SIZE END
16674 . HDRFTR_CENTER_SIZE \\$1
16677 .MAC FOOTER_CENTRE_CAPS END
16678 . HDRFTR_CENTER_CAPS \\$1
16681 .MAC FOOTER_CENTRE_COLOR END
16682 . HDRFTR_CENTRE_COLOR \\$1
16685 .MAC FOOTER_CENTRE_COLOUR END
16686 . HDRFTR_CENTRE_COLOR \\$1
16689 .MAC FOOTER_CENTRE_FAM END
16690 . HDRFTR_CENTER_FAMILY \\$1
16693 .MAC FOOTER_CENTRE_FAMILY END
16694 . HDRFTR_CENTER_FAMILY \\$1
16697 .MAC FOOTER_CENTRE_FONT END
16698 . HDRFTR_CENTER_FONT \\$1
16701 .MAC FOOTER_CENTRE_FT END
16702 . HDRFTR_CENTER_FONT \\$1
16705 .MAC FOOTER_CENTRE_PS END
16706 . HDRFTR_CENTER_SIZE \\$1
16709 .MAC FOOTER_CENTRE_SIZE END
16710 . HDRFTR_CENTER_SIZE \\$1
16713 .MAC FOOTER_COLOR END
16714 . HDRFTR_COLOR \\$1
16717 .MAC FOOTER_COLOUR END
16718 . HDRFTR_COLOR \\$1
16721 .MAC FOOTER_FAM END
16722 . HDRFTR_FAMILY \\$1
16725 .MAC FOOTER_FAMILY END
16726 . HDRFTR_FAMILY \\$1
16729 .MAC FOOTER_LEFT_COLOR END
16730 . HDRFTR_LEFT_COLOR \\$1
16733 .MAC FOOTER_LEFT_COLOUR END
16734 . HDRFTR_LEFT_COLOR \\$1
16737 .MAC FOOTER_LEFT_FAM END
16738 . HDRFTR_LEFT_FAMILY \\$1
16741 .MAC FOOTER_LEFT_FAMILY END
16742 . HDRFTR_LEFT_FAMILY \\$1
16745 .MAC FOOTER_LEFT_FONT END
16746 . HDRFTR_LEFT_FONT \\$1
16749 .MAC FOOTER_LEFT_FT END
16750 . HDRFTR_LEFT_FONT \\$1
16753 .MAC FOOTER_LEFT_PS END
16754 . HDRFTR_LEFT_SIZE \\$1
16757 .MAC FOOTER_LEFT_SIZE END
16758 . HDRFTR_LEFT_SIZE \\$1
16761 .MAC FOOTER_RIGHT_COLOR END
16762 . HDRFTR_RIGHT_COLOR \\$1
16765 .MAC FOOTER_RIGHT_COLOUR END
16766 . HDRFTR_RIGHT_COLOR \\$1
16769 .MAC FOOTER_RIGHT_FAM END
16770 . HDRFTR_RIGHT_FAMILY \\$1
16773 .MAC FOOTER_RIGHT_FAMILY END
16774 . HDRFTR_RIGHT_FAMILY \\$1
16777 .MAC FOOTER_RIGHT_FONT END
16778 . HDRFTR_RIGHT_FONT \\$1
16781 .MAC FOOTER_RIGHT_FT END
16782 . HDRFTR_RIGHT_FONT \\$1
16785 .MAC FOOTER_RIGHT_PS END
16786 . HDRFTR_RIGHT_SIZE \\$1
16789 .MAC FOOTER_RIGHT_SIZE END
16790 . HDRFTR_RIGHT_SIZE \\$1
16793 .MAC FOOTER_RULE_COLOR END
16794 . HDRFTR_RULE_COLOR \\$1
16797 .MAC FOOTER_SIZE END
16801 .MAC HEADER_CENTER_COLOR END
16802 . HDRFTR_CENTER_COLOR \\$1
16805 .MAC HEADER_CENTER_COLOUR END
16806 . HDRFTR_CENTER_COLOR \\$1
16809 .MAC HEADER_CENTER_FAM END
16810 . HDRFTR_CENTER_FAMILY \\$1
16813 .MAC HEADER_CENTER_FAMILY END
16814 . HDRFTR_CENTER_FAMILY \\$1
16817 .MAC HEADER_CENTER_FONT END
16818 . HDRFTR_CENTER_FONT \\$1
16821 .MAC HEADER_CENTER_FT END
16822 . HDRFTR_CENTER_FONT \\$1
16825 .MAC HEADER_CENTER_PS END
16826 . HDRFTR_CENTER_SIZE \\$1
16829 .MAC HEADER_CENTER_SIZE END
16830 . HDRFTR_CENTER_SIZE \\$1
16833 .MAC HEADER_CENTRE_COLOR END
16834 . HDRFTR_CENTRE_COLOR \\$1
16837 .MAC HEADER_CENTRE_COLOUR END
16838 . HDRFTR_CENTRE_COLOR \\$1
16841 .MAC HEADER_CENTRE_FAM END
16842 . HDRFTR_CENTER_FAMILY \\$1
16845 .MAC HEADER_CENTRE_FAMILY END
16846 . HDRFTR_CENTER_FAMILY \\$1
16849 .MAC HEADER_CENTRE_FONT END
16850 . HDRFTR_CENTER_FONT \\$1
16853 .MAC HEADER_CENTRE_FT END
16854 . HDRFTR_CENTER_FONT \\$1
16857 .MAC HEADER_CENTRE_PS END
16858 . HDRFTR_CENTER_SIZE \\$1
16861 .MAC HEADER_CENTRE_SIZE END
16862 . HDRFTR_CENTER_SIZE \\$1
16865 .MAC HEADER_COLOR END
16866 . HDRFTR_COLOR \\$1
16869 .MAC HEADER_COLOUR END
16870 . HDRFTR_COLOR \\$1
16873 .MAC HEADER_FAM END
16874 . HDRFTR_FAMILY \\$1
16877 .MAC HEADER_FAMILY END
16878 . HDRFTR_FAMILY \\$1
16881 .MAC HEADER_LEFT_COLOR END
16882 . HDRFTR_LEFT_COLOR \\$1
16885 .MAC HEADER_LEFT_COLOUR END
16886 . HDRFTR_LEFT_COLOR \\$1
16889 .MAC HEADER_LEFT_FAM END
16890 . HDRFTR_LEFT_FAMILY \\$1
16893 .MAC HEADER_LEFT_FAMILY END
16894 . HDRFTR_LEFT_FAMILY \\$1
16897 .MAC HEADER_LEFT_FONT END
16898 . HDRFTR_LEFT_FONT \\$1
16901 .MAC HEADER_LEFT_FT END
16902 . HDRFTR_LEFT_FONT \\$1
16905 .MAC HEADER_LEFT_PS END
16906 . HDRFTR_LEFT_SIZE \\$1
16909 .MAC HEADER_LEFT_SIZE END
16910 . HDRFTR_LEFT_SIZE \\$1
16913 .MAC HEADER_RIGHT_COLOR END
16914 . HDRFTR_RIGHT_COLOR \\$1
16917 .MAC HEADER_RIGHT_COLOUR END
16918 . HDRFTR_RIGHT_COLOR \\$1
16921 .MAC HEADER_RIGHT_FAM END
16922 . HDRFTR_RIGHT_FAMILY \\$1
16925 .MAC HEADER_RIGHT_FAMILY END
16926 . HDRFTR_RIGHT_FAMILY \\$1
16929 .MAC HEADER_RIGHT_FONT END
16930 . HDRFTR_RIGHT_FONT \\$1
16933 .MAC HEADER_RIGHT_FT END
16934 . HDRFTR_RIGHT_FONT \\$1
16937 .MAC HEADER_RIGHT_PS END
16938 . HDRFTR_RIGHT_SIZE \\$1
16941 .MAC HEADER_RIGHT_SIZE END
16942 . HDRFTR_RIGHT_SIZE \\$1
16945 .MAC HEADER_RULE_COLOR END
16946 . HDRFTR_RULE_COLOR \\$1
16949 .MAC HEADER_SIZE END
16953 \# HEADER and FOOTER aliases for HDRFTR macros.
16955 .ALIAS BIBLIOGRAPHY_FOOTER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
16956 .ALIAS BIBLIOGRAPHY_FOOTER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
16957 .ALIAS BIBLIOGRAPHY_HEADER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
16958 .ALIAS BIBLIOGRAPHY_HEADER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
16959 .ALIAS ENDNOTES_FOOTER_CENTER ENDNOTES_HDRFTR_CENTER
16960 .ALIAS ENDNOTES_FOOTER_CENTRE ENDNOTES_HDRFTR_CENTRE
16961 .ALIAS ENDNOTES_HEADER_CENTER ENDNOTES_HDRFTR_CENTER
16962 .ALIAS ENDNOTES_HEADER_CENTRE ENDNOTES_HDRFTR_CENTRE
16963 .ALIAS FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS
16964 .ALIAS FOOTER_CENTER HDRFTR_CENTER
16965 .ALIAS FOOTER_CENTER_PAD HDRFTR_CENTER_PAD
16966 .ALIAS FOOTER_CENTRE HDRFTR_CENTER
16967 .ALIAS FOOTER_CENTRE_PAD HDRFTR_CENTER_PAD
16968 .ALIAS FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS
16969 .ALIAS FOOTER_LEFT HDRFTR_LEFT
16970 .ALIAS FOOTER_PLAIN HDRFTR_PLAIN
16971 .ALIAS FOOTER_RECTO HDRFTR_RECTO
16972 .ALIAS FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
16973 .ALIAS FOOTER_RIGHT HDRFTR_RIGHT
16974 .ALIAS FOOTER_RULE_GAP HDRFTR_RULE_GAP
16975 .ALIAS FOOTER_RULE HDRFTR_RULE
16976 .ALIAS FOOTER_VERSO HDRFTR_VERSO
16977 .ALIAS HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS
16978 .ALIAS HEADER_CENTER HDRFTR_CENTER
16979 .ALIAS HEADER_CENTER_PAD HDRFTR_CENTER_PAD
16980 .ALIAS HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS
16981 .ALIAS HEADER_CENTRE HDRFTR_CENTER
16982 .ALIAS HEADER_CENTRE_PAD HDRFTR_CENTER_PAD
16983 .ALIAS HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS
16984 .ALIAS HEADER_LEFT HDRFTR_LEFT
16985 .ALIAS HEADER_PLAIN HDRFTR_PLAIN
16986 .ALIAS HEADER_RECTO HDRFTR_RECTO
16987 .ALIAS HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
16988 .ALIAS HEADER_RIGHT HDRFTR_RIGHT
16989 .ALIAS HEADER_RULE_GAP HDRFTR_RULE_GAP
16990 .ALIAS HEADER_RULE HDRFTR_RULE
16991 .ALIAS HEADER_VERSO HDRFTR_VERSO
16992 .ALIAS SWITCH_FOOTERS SWITCH_HDRFTR
16993 .ALIAS SWITCH_HEADERS SWITCH_HDRFTR
16995 \# Type-style aliases
16997 .ALIAS AUTHOR_FAMILY _FAMILY
16998 .ALIAS BIBLIOGRAPHY_FAMILY _FAMILY
16999 .ALIAS BIBLIOGRAPHY_STRING_FAMILY _FAMILY
17000 .ALIAS BLOCKQUOTE_FAMILY _FAMILY
17001 .ALIAS CHAPTER_TITLE_FAMILY _FAMILY
17002 .ALIAS COVER_AUTHOR_FAMILY _FAMILY
17003 .ALIAS COVER_CHAPTER_TITLE_FAMILY _FAMILY
17004 .ALIAS COVER_COPYRIGHT_FAMILY _FAMILY
17005 .ALIAS COVER_DOCTYPE_FAMILY _FAMILY
17006 .ALIAS COVER_FAMILY _FAMILY
17007 .ALIAS COVER_SUBTITLE_FAMILY _FAMILY
17008 .ALIAS COVER_TITLE_FAMILY _FAMILY
17009 .ALIAS DOC_COVER_AUTHOR_FAMILY _FAMILY
17010 .ALIAS DOC_COVER_CHAPTER_TITLE_FAMILY _FAMILY
17011 .ALIAS DOC_COVER_COPYRIGHT_FAMILY _FAMILY
17012 .ALIAS DOC_COVER_DOCTYPE_FAMILY _FAMILY
17013 .ALIAS DOC_COVER_FAMILY _FAMILY
17014 .ALIAS DOC_COVER_SUBTITLE_FAMILY _FAMILY
17015 .ALIAS DOC_COVER_TITLE_FAMILY _FAMILY
17016 .ALIAS DOCHEADER_FAMILY _FAMILY
17017 .ALIAS DOCTYPE_FAMILY _FAMILY
17018 .ALIAS ENDNOTE_FAMILY _FAMILY
17019 .ALIAS ENDNOTE_NUMBER_FAMILY _FAMILY
17020 .ALIAS ENDNOTE_LINENUMBER_FAMILY _FAMILY
17021 .ALIAS ENDNOTE_STRING_FAMILY _FAMILY
17022 .ALIAS ENDNOTE_TITLE_FAMILY _FAMILY
17023 .ALIAS EPIGRAPH_FAMILY _FAMILY
17024 .ALIAS FOOTNOTE_FAMILY _FAMILY
17025 .ALIAS HDRFTR_CENTER_FAMILY _FAMILY
17026 .ALIAS HDRFTR_FAMILY _FAMILY
17027 .ALIAS HDRFTR_LEFT_FAMILY _FAMILY
17028 .ALIAS HDRFTR_RIGHT_FAMILY _FAMILY
17029 .ALIAS HEAD_FAMILY _FAMILY
17030 .ALIAS LINENUMBER_FAMILY _FAMILY
17031 .ALIAS PAGENUM_FAMILY _FAMILY
17032 .ALIAS PARAHEAD_FAMILY _FAMILY
17033 .ALIAS QUOTE_FAMILY _FAMILY
17034 .ALIAS SUBHEAD_FAMILY _FAMILY
17035 .ALIAS SUBTITLE_FAMILY _FAMILY
17036 .ALIAS TITLE_FAMILY _FAMILY
17037 .ALIAS TOC_FAM _FAMILY
17038 .ALIAS TOC_FAMILY _FAMILY
17039 .ALIAS TOC_HEADER_FAMILY _FAMILY
17040 .ALIAS TOC_HEAD_FAMILY _FAMILY
17041 .ALIAS TOC_PARAHEAD_FAMILY _FAMILY
17042 .ALIAS TOC_PN_FAMILY _FAMILY
17043 .ALIAS TOC_SUBHEAD_FAMILY _FAMILY
17044 .ALIAS TOC_TITLE_FAMILY _FAMILY
17046 .ALIAS AUTHOR_FONT _FONT
17047 .ALIAS BIBLIOGRAPHY_STRING_FONT _FONT
17048 .ALIAS BIBLIOGRAPHY_FONT _FONT
17049 .ALIAS BLOCKQUOTE_FONT _FONT
17050 .ALIAS CHAPTER_TITLE_FONT _FONT
17051 .ALIAS COVER_AUTHOR_FONT _FONT
17052 .ALIAS COVER_CHAPTER_TITLE_FONT _FONT
17053 .ALIAS COVER_COPYRIGHT_FONT _FONT
17054 .ALIAS COVER_DOCTYPE_FONT _FONT
17055 .ALIAS COVER_SUBTITLE_FONT _FONT
17056 .ALIAS COVER_TITLE_FONT _FONT
17057 .ALIAS DOC_COVER_AUTHOR_FONT _FONT
17058 .ALIAS DOC_COVER_CHAPTER_TITLE_FONT _FONT
17059 .ALIAS DOC_COVER_COPYRIGHT_FONT _FONT
17060 .ALIAS DOC_COVER_DOCTYPE_FONT _FONT
17061 .ALIAS DOC_COVER_SUBTITLE_FONT _FONT
17062 .ALIAS DOC_COVER_TITLE_FONT _FONT
17063 .ALIAS DOCTYPE_FONT _FONT
17064 .ALIAS ENDNOTE_FONT _FONT
17065 .ALIAS ENDNOTE_NUMBER_FONT _FONT
17066 .ALIAS ENDNOTE_LINENUMBER_FONT _FONT
17067 .ALIAS ENDNOTE_STRING_FONT _FONT
17068 .ALIAS ENDNOTE_TITLE_FONT _FONT
17069 .ALIAS EPIGRAPH_FONT _FONT
17070 .ALIAS FOOTNOTE_FONT _FONT
17071 .ALIAS HDRFTR_CENTER_FONT _FONT
17072 .ALIAS HDRFTR_LEFT_FONT _FONT
17073 .ALIAS HDRFTR_RIGHT_FONT _FONT
17074 .ALIAS HEAD_FONT _FONT
17075 .ALIAS LINENUMBER_FONT _FONT
17076 .ALIAS PAGENUM_FONT _FONT
17077 .ALIAS PARAHEAD_FONT _FONT
17078 .ALIAS QUOTE_FONT _FONT
17079 .ALIAS SUBHEAD_FONT _FONT
17080 .ALIAS SUBTITLE_FONT _FONT
17081 .ALIAS TITLE_FONT _FONT
17082 .ALIAS TOC_HEADER_FONT _FONT
17083 .ALIAS TOC_HEAD_FONT _FONT
17084 .ALIAS TOC_PARAHEAD_FONT _FONT
17085 .ALIAS TOC_PN_FONT _FONT
17086 .ALIAS TOC_SUBHEAD_FONT _FONT
17087 .ALIAS TOC_TITLE_FONT _FONT
17089 .ALIAS AUTHOR_SIZE _SIZE
17090 .ALIAS BIBLIOGRAPHY_STRING_SIZE _SIZE
17091 .ALIAS BLOCKQUOTE_SIZE _SIZE
17092 .ALIAS CHAPTER_TITLE_SIZE _SIZE
17093 .ALIAS COVER_AUTHOR_SIZE _SIZE
17094 .ALIAS COVER_CHAPTER_TITLE_SIZE _SIZE
17095 .ALIAS COVER_COPYRIGHT_SIZE _SIZE
17096 .ALIAS COVER_DOCTYPE_SIZE _SIZE
17097 .ALIAS COVER_SUBTITLE_SIZE _SIZE
17098 .ALIAS COVER_TITLE_SIZE _SIZE
17099 .ALIAS DOC_COVER_AUTHOR_SIZE _SIZE
17100 .ALIAS DOC_COVER_CHAPTER_TITLE_SIZE _SIZE
17101 .ALIAS DOC_COVER_COPYRIGHT_SIZE _SIZE
17102 .ALIAS DOC_COVER_DOCTYPE_SIZE _SIZE
17103 .ALIAS DOC_COVER_SUBTITLE_SIZE _SIZE
17104 .ALIAS DOC_COVER_TITLE_SIZE _SIZE
17105 .ALIAS DOCTYPE_SIZE _SIZE
17106 .ALIAS ENDNOTE_NUMBER_SIZE _SIZE
17107 .ALIAS ENDNOTE_LINENUMBER_SIZE _SIZE
17108 .ALIAS ENDNOTE_STRING_SIZE _SIZE
17109 .ALIAS ENDNOTE_TITLE_SIZE _SIZE
17110 .ALIAS EPIGRAPH_SIZE _SIZE
17111 .ALIAS FOOTNOTE_SIZE _SIZE
17112 .ALIAS HDRFTR_CENTER_SIZE _SIZE
17113 .ALIAS HDRFTR_LEFT_SIZE _SIZE
17114 .ALIAS HDRFTR_RIGHT_SIZE _SIZE
17115 .ALIAS HDRFTR_SIZE _SIZE
17116 .ALIAS HEAD_SIZE _SIZE
17117 .ALIAS LINENUMBER_SIZE _SIZE
17118 .ALIAS PAGENUM_SIZE _SIZE
17119 .ALIAS PARAHEAD_SIZE _SIZE
17120 .ALIAS QUOTE_SIZE _SIZE
17121 .ALIAS SUBHEAD_SIZE _SIZE
17122 .ALIAS SUBTITLE_SIZE _SIZE
17123 .ALIAS TITLE_SIZE _SIZE
17124 .ALIAS TOC_HEADER_SIZE _SIZE
17125 .ALIAS TOC_HEAD_SIZE _SIZE
17126 .ALIAS TOC_PARAHEAD_SIZE _SIZE
17127 .ALIAS TOC_PN_SIZE _SIZE
17128 .ALIAS TOC_SUBHEAD_SIZE _SIZE
17129 .ALIAS TOC_TITLE_SIZE _SIZE
17131 .ALIAS ATTRIBUTE_COLOR _COLOR
17132 .ALIAS AUTHOR_COLOR _COLOR
17133 .ALIAS BLOCKQUOTE_COLOR _COLOR
17134 .ALIAS CHAPTER_TITLE_COLOR _COLOR
17135 .ALIAS COVER_ATTRIBUTE_COLOR _COLOR
17136 .ALIAS COVER_AUTHOR_COLOR _COLOR
17137 .ALIAS COVER_CHAPTER_TITLE_COLOR _COLOR
17138 .ALIAS COVER_COLOR _COLOR
17139 .ALIAS COVER_COPYRIGHT_COLOR _COLOR
17140 .ALIAS COVER_DOCTYPE_COLOR _COLOR
17141 .ALIAS COVER_MISC_COLOR _COLOR
17142 .ALIAS COVER_SUBTITLE_COLOR _COLOR
17143 .ALIAS COVER_TITLE_COLOR _COLOR
17144 .ALIAS DOC_COVER_ATTRIBUTE_COLOR _COLOR
17145 .ALIAS DOC_COVER_AUTHOR_COLOR _COLOR
17146 .ALIAS DOC_COVER_CHAPTER_TITLE_COLOR _COLOR
17147 .ALIAS DOC_COVER_COLOR _COLOR
17148 .ALIAS DOC_COVER_COPYRIGHT_COLOR _COLOR
17149 .ALIAS DOC_COVER_DOCTYPE_COLOR _COLOR
17150 .ALIAS DOC_COVER_MISC_COLOR _COLOR
17151 .ALIAS DOC_COVER_SUBTITLE_COLOR _COLOR
17152 .ALIAS DOC_COVER_TITLE_COLOR _COLOR
17153 .ALIAS DOCHEADER_COLOR _COLOR
17154 .ALIAS DOCTYPE_COLOR _COLOR
17155 .ALIAS EPIGRAPH_COLOR _COLOR
17156 .ALIAS FINIS_COLOR _COLOR
17157 .ALIAS FOOTNOTE_COLOR _COLOR
17158 .ALIAS HDRFTR_CENTER_COLOR _COLOR
17159 .ALIAS HDRFTR_COLOR _COLOR
17160 .ALIAS HDRFTR_LEFT_COLOR _COLOR
17161 .ALIAS HDRFTR_RIGHT_COLOR _COLOR
17162 .ALIAS HDRFTR_RULE_COLOR _COLOR
17163 .ALIAS HEAD_COLOR _COLOR
17164 .ALIAS LINEBREAK_COLOR _COLOR
17165 .ALIAS LINENUMBER_COLOR _COLOR
17166 .ALIAS PAGENUM_COLOR _COLOR
17167 .ALIAS PARAHEAD_COLOR _COLOR
17168 .ALIAS QUOTE_COLOR _COLOR
17169 .ALIAS SUBHEAD_COLOR _COLOR
17170 .ALIAS SUBTITLE_COLOR _COLOR
17171 .ALIAS TITLE_COLOR _COLOR
17173 .ALIAS BIBLIOGRAPHY_QUAD _QUAD
17174 .ALIAS BIBLIOGRAPHY_STRING_QUAD _QUAD
17175 .ALIAS BLOCKQUOTE_QUAD _QUAD
17176 .ALIAS COVER_COPYRIGHT_QUAD _QUAD
17177 .ALIAS COVER_MISC_QUAD _QUAD
17178 .ALIAS DOC_COVER_COPYRIGHT_QUAD _QUAD
17179 .ALIAS DOC_COVER_MISC_QUAD _QUAD
17180 .ALIAS DOC_QUAD _QUAD
17181 .ALIAS ENDNOTE_QUAD _QUAD
17182 .ALIAS ENDNOTE_STRING_QUAD _QUAD
17183 .ALIAS ENDNOTE_TITLE_QUAD _QUAD
17184 .ALIAS EPIGRAPH_QUAD _QUAD
17185 .ALIAS FOOTNOTE_QUAD _QUAD
17186 .ALIAS HEAD_QUAD _QUAD
17187 .ALIAS SUBHEAD_QUAD _QUAD
17188 .ALIAS TOC_HEADER_QUAD _QUAD
17192 .ALIAS COL_BREAK COL_NEXT
17193 .ALIAS DOC_COVER_ADVANCE COVER_ADVANCE
17194 .ALIAS DOC_COVER COVER
17195 .ALIAS DOC_COVERS COVERS
17196 .ALIAS DOC_COVER_LEAD COVER_LEAD
17197 .ALIAS DOC_COVERTITLE COVERTITLE
17198 .ALIAS DO_DOC_COVER DO_COVER
17199 .ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE
17201 \# Miscellaneous aliases
17202 .ALIAS SECTION LINEBREAK
17203 .ALIAS SECTION_CHAR LINEBREAK_CHAR
17205 \# Miscellaneous macros to take care of backward compatibility
17206 \# -----------------------------------------------------------
17208 \# As of 1.1.9, EL and TN got changed to make TRAP...TRAP OFF
17209 \# unnecessary for users. However, I used both macros extensively
17210 \# throughout this file (in conjunction with TRAP...TRAP OFF).
17211 \# EOL is the "old" EL, for the personal use of om.tmac
17223 \# Footnote references
17224 \# -------------------
17226 \# Instruct REF to put references in footnotes.
17228 .MAC FOOTNOTE_REFS END
17229 . if r#EN_REF \{ .rr #EN_REF \}
17233 \# Endnote references
17234 \# ------------------
17236 \# Instruct REF to collect references for endnotes output.
17238 .MAC ENDNOTE_REFS END
17239 . if r#FN_REF \{ .rr #FN_REF \}
17243 \# Prepare mom for a reference
17244 \# ---------------------------
17246 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value>
17248 \# Calls FOOTNOTE or ENDNOTE, depending on whether #REF_FN or
17249 \# #REF_EN is set to 1.
17251 \# For convenience, REF is a toggle.
17253 \# REF optionally takes the same arguments as FOOTNOTE, allowing
17254 \# users to indent references that go in footnotes when footnote
17255 \# indenting is required. FOOTNOTE_REFS must be on for this.
17258 . ie \\n[#FN_REF]+\\n[#EN_REF]=0 \{\
17259 . if !\\n[#REF_WARNING]=1 \{\
17260 . tm1 "[mom]: Before REF at line \\n(.c, neither FOOTNOTE_REFS nor ENDNOTE_REFS
17261 . tm1 " has been selected. If "sort" and "accumulate" are in your refer
17262 . tm1 " commands, references will be collected for later output with $LIST$.
17263 . tm1 " Otherwise, they will disappear.
17264 . nr #REF_WARNING 1
17268 . ie \\n[#REF]=1 \{\
17269 . if \\n[#FN_REF]=1 \{ .FOOTNOTE OFF \}
17270 . if \\n[#EN_REF]=1 \{ .ENDNOTE OFF \}
17276 . if \\n[#FN_REF]=1 \{ .FOOTNOTE \\$1 \\$2 \\$3 \}
17277 . if \\n[#EN_REF]=1 \{ .ENDNOTE \}
17282 \# Embedded references in text (with brackets)
17283 \# -------------------------------------------
17285 .MAC REF_BRACKETS_START END
17286 . ds $CURRENT_EV \\n[.ev]
17288 . evc \\*[$CURRENT_EV]
17292 .MAC REF_BRACKETS_END END
17297 . unformat REFERENCE
17298 . if '\\$0'REF)' \{ .nop (\\*[REFERENCE]) \}
17299 . if '\\$0'REF]' \{ .nop [\\*[REFERENCE]] \}
17300 . if '\\$0'REF}' \{ .nop {\\*[REFERENCE]} \}
17303 \# These three pairs of aliases allow users to embed references in
17304 \# text and have them surrounded by (), [] or {}.
17306 .ALIAS REF( REF_BRACKETS_START
17307 .ALIAS REF) REF_BRACKETS_END
17309 .ALIAS REF[ REF_BRACKETS_START
17310 .ALIAS REF{ REF_BRACKETS_START
17312 .ALIAS REF} REF_BRACKETS_END
17313 .ALIAS REF] REF_BRACKETS_END
17315 \# Second-line indent for refs
17316 \# ---------------------------
17318 \# FOOTNOTE | ENDNOTE | BIBLIO <indent for 2nd and subsequent lines of discrete reference entries>
17320 \# Sets strings $REF_FN_INDENT, $REF_EN_INDENT or $REF_BIB_INDENT.
17322 \# Indent value requires a unit of measure.
17324 .MAC INDENT_REFS END
17325 . if '\\$1'FOOTNOTE' .ds $REF_FN_INDENT \\$2
17326 . if '\\$1'ENDNOTE' .ds $REF_EN_INDENT \\$2
17327 . if '\\$1'BIBLIO' .ds $REF_BIB_INDENT \\$2
17330 \# Hyphenation of references
17331 \# -------------------------
17333 \# <none> | <anything>
17335 \# Sets register #REF_HY
17337 .MAC HYPHENATE_REFS END
17338 . ie '\\$1'' \{ .nr #REF_HY 1 \}
17340 . if r#REF_HY \{ .rr #REF_HY \}
17344 \# The remainder of the definitions in this section are modified
17345 \# versions of the definitions found in the refer module of s.tmac.
17347 \# This one is directly from s.tmac.
17350 .tm \\n(.F:\\n(.c: macro error: \\$*
17353 \# The following strings define the order of entries for different
17354 \# types of references. Each letter in the string refers to a database
17355 \# field (A for author, T1/T2 for article and book titles, etc).
17356 \# Mom is set up for MLA-style bibliographies. Other styles can be
17357 \# implemented here by re-ordering the fields.
17360 .ds ref*spec!2 Q A T1 d t l r E S e V a C I D P O
17361 \# Article within book - type 3
17362 .ds ref*spec!3 Q A T2 B d t l r E S e V a C I D P O
17363 \# Journal article - type 1
17364 .ds ref*spec!1 Q A T2 J S N D P O
17365 \# Tech report - type 4
17366 .ds ref*spec!4 Q A T1 R G C I D P O
17367 \# Internet site - type 0
17368 .ds ref*spec!0 Q A T2 s E c d o a u O
17370 \# Refer's "1st" macro. Since it is possible to define database
17371 \# fields using any single letter, we remove all possible string
17372 \# definitions of the form [X and [x
17375 .rm [A [B [C [D [E [F [G [H [I [J [K [L [M \
17376 [N [O [P [Q [R [S [T [U [V [W [X [Y [Z \
17377 . [a [b [c [d [e [f [g [h [i [j [k [l [m \
17378 [n [o [p [q [r [s [t [u [v [w [x [y [z
17383 \# Refer's "2nd" macro; builds up a reference with ref*build, and
17384 \# prints it with ref*print.
17388 .if \\n[ref*type]=3 \{\
17389 . if !'\\*([R'' \{\
17391 . ds ref*spec!4 Q A T2 B R C I D P O
17393 . if !'\\*([G'' \{\
17395 . ds ref*spec!4 Q A T2 B G C I D P O
17402 .ie d ref*spec!\\n[ref*type] .ref*build \\*[ref*spec!\\n[ref*type]]
17404 . @error unknown reference type `\\n[ref*type]'
17405 . ref*build \\*[ref*spec!0]
17407 .if !\\n[.hy]=0 \{\
17408 .nr #RESTORE_HY \\n[.hy]
17412 .if !\\n[#RESTORE_HY]=0 .hy \\n[#RESTORE_HY]
17418 \# Refer's "3rd" macros, which set up and terminate the output
17419 \# of collected references
17422 .als ref*print ref*end-print
17424 .if \\n[#BIB_LIST]=1 \{\
17425 . nr #IN_BIB_LIST 1
17426 . LIST DIGIT \\*[$BIB_LIST_SEPARATOR] \\*[$BIB_LIST_PREFIX]
17434 .als ref*print ref*normal-print
17440 \# Output normal, non-collected refs
17442 .de ref*normal-print
17443 .nr #CURRENT_HY \\n[.hy]
17447 \# Output collected refs
17450 .\" 10 is abritrary
17452 .ie \\n[#BIB_LIST]=0 \{\
17453 .in +\\*[$REF_BIB_INDENT]
17454 .ti -\\*[$REF_BIB_INDENT]
17458 .sp \\n[#BIB_SPACE]u
17459 .ie \\n[#BIB_LIST]=0 .in
17460 .el .IL -\\*[$REF_BIB_INDENT]u
17464 .als ref*print ref*normal-print
17466 \# Build up the ref*string
17468 \# Correct MLA "typewritten" style (printstyle TYPEWRITE) demands
17469 \# two spaces after each period. The spaces are hardwired into the
17470 \# string definitions (ref*add-<x>), so we have to make sure that there
17471 \# aren't two spaces when the printstyle is TYPESET. Since I find that
17472 \# references look a bit crowded with 0 sentence space, I've bumped it
17473 \# up to +4. User's sentence spacing is reset in FOOTNOTES and ENDNOTES.
17476 .if \\n[#PRINT_STYLE]=2 \{\
17477 . ds $RESTORE_SS_VAR \\*[$SS_VAR]
17480 \#.rm ref*string ref*post-punct
17482 .nr ref*suppress-period 1
17485 . ie d ref*add-\\$1 .ref*add-\\$1
17486 . el .ref*add-dflt \\$1
17490 .\" now add a final period
17491 .ie d ref*string \{\
17492 . if !\\n[ref*suppress-period] .as ref*string .
17493 . if d ref*post-punct \{\
17494 . as ref*string "\\*[ref*post-punct]
17495 . rm ref*post-punct
17501 \# The following macros determine how entries are formatted WRT
17502 \# punctuation, type style, additional strings, etc.
17504 \# o First argument is the database field letter.
17505 \# o Second argument is the punctuation character to use to separate this
17506 \# field from the previous field.
17507 \# o Third argument is a string with which to prefix this field.
17508 \# o Fourth argument is a string with which to postfix this field.
17509 \# o Fifth argument is a string to add after the punctuation character
17510 \# supplied by the next field.
17515 .if r [A .nr ref*suppress-period \\n([A
17517 \# %T Title (generic)
17519 .ref*field T . " \E*[IT]" "" \E*[PREV]
17520 .if \\n([T .nr ref*suppress-period \\n([T
17522 \# %T Title of a chapter or article
17524 .ref*field T . " \(lq" "" "\(rq"
17525 .if \\n([T .nr ref*suppress-period \\n([T
17527 \# %B Book title (when citing an article from a book)
17529 .ie \\n([T .ref*field B "" ".\E*[IT]" "" \E*[PREV]
17530 .el .ref*field B . " \E*[IT]" "" \E*[PREV]
17531 \# refer doesn't set reg [T to 1 for these book titles, so we do it here
17533 .substring eval*[B -1
17535 .if '\\*[eval*[B]'!' .nr [T 1
17536 .if '\\*[eval*[B]'?' .nr [T 1
17539 \# %R Report number for technical reports
17545 .ie \\n([T .ref*field J "" " \E*[IT]" "" \E*[PREV]
17546 .el .ref*field J . " \E*[IT]" "" \E*[PREV]
17550 .ie !\\n[ref*type]=0 \{\
17552 . ie \\n([T .ref*field E "" " Eds. "
17553 . el .ref*field E . " Eds. "
17556 . ie \\n([T .ref*field E "" " Ed. "
17557 . el .ref*field E . " Ed. "
17561 . ie \\n([T .ref*field E "" " "
17562 . el .ref*field E . " "
17568 .ie \\n([T .ref*field e "" " " " edition"
17569 .el .ref*field e . " " " edition"
17572 \# %V Volume (of a journal, or series of books)
17574 .if \\n[ref*type]=1 \{\
17577 .if \\n[ref*type]=2 \{\
17578 . ie \\n([T .ref*field V "" " "
17579 . el .ref*field V . " "
17581 .if \\n[ref*type]=3 \{\
17582 . ie \\n([T .ref*field V "" " "
17583 . el .ref*field V . " "
17587 \# %N Journal number
17591 \# %S Series (books or journals)
17593 .if \\n[ref*type]=1 \{\
17596 .if \\n[ref*type]=2 \{\
17597 . ie \\n([T .ref*field S "" " "
17598 . el .ref*field S . " "
17600 .if \\n[ref*type]=3 \{\
17601 . ie \\n([T .ref*field S "" " "
17602 . el .ref*field S . " "
17605 \# refer doesn't set reg [T to 1 for series titles, so we do it here
17607 .substring eval*[S -1
17608 .if '\\*[eval*[S]'!' .nr [T 1
17609 .if '\\*[eval*[S]'?' .nr [T 1
17614 .ie \\n([T .ref*field C "" " "
17615 .el .ref*field C . " "
17618 \# %I Publisher (I stands for Issuer)
17620 .ie !'\\*([C'' .ref*field I :
17622 . ie \\n([T .ref*field I "" " "
17623 . el .ref*field I . " "
17627 \# %D Date of publication
17629 .if \\n[ref*type]=1 \{\
17630 . ie !'\\*([V''.ref*field D "" "(" ")"
17633 .if \\n[ref*type]=2 .ref*field D ,
17634 .if \\n[ref*type]=3 \{\
17636 . ie '\\*([I'' .ref*field D . " "
17637 . el .ref*field D ,
17639 . el .ref*field D ,
17641 .if \\n[ref*type]=4 .ref*field D ,
17643 \# %P Page number(s)
17645 .ie \\n[ref*type]=1 .ref*field P :
17646 .el .ref*field P . " "
17648 \# %G Gov't. ordering number
17652 \# %O Other (usually goes at end of ref)
17655 .ie r [O .nr ref*suppress-period \\n([O
17656 .el .nr ref*suppress-period 1
17665 \# %d date of publication (the orignal date of publication)
17667 .ie \\n([T .ref*field d "" " "
17668 .el .ref*field d . " "
17671 \# %a additions (such as a new intro to reprints)
17673 .ie \\n([T .ref*field a "" " "
17674 .el .ref*field a . " "
17677 \# %t title, if different from original title (the T field, which s/b
17678 \# the original title)
17680 .ie \\n([T .ref*field t "" " Rpt. as \E*[IT]" "" \E*[PREV]
17681 .el .ref*field t . " Rpt. as \E*[IT]" "" \E*[PREV]
17685 \# Translated works
17686 \# ----------------
17689 .ie \\n([T .ref*field l "" " Trans. "
17690 .el .ref*field l . " Trans. "
17693 \# %r Translato(r) and edito(r)
17695 .ie \\n([T .ref*field r "" " Trans. and Ed. "
17696 .el .ref*field r . " Trans. and Ed. "
17704 .ie \\n([s .ref*field s "" ".\E*[IT]" "" \E*[PREV]
17705 .el .ref*field s . " \E*[IT]" "" \E*[PREV]
17706 .\" refer doesn't set reg [T to 1 for these book titles, so we do it here
17708 .substring eval*[s -1
17710 .if '\\*[eval*[s]'!' .nr [T 1
17711 .if '\\*[eval*[s]'?' .nr [T 1
17714 \# %c content of site, if unclear (i.e. advertisement, cartoon,
17715 \# interview, etc.)
17717 .ie \\n([T .ref*field c "" " "
17718 .el .ref*field c . " "
17721 \# %o organization, group or sponsor of site
17723 .ie \\n([T .ref*field o "" " "
17724 .el .ref*field o . " "
17727 \# %a access date, i.e. the date you read it
17729 .ie \\n([T .ref*field a "" " "
17730 .el .ref*field a . " "
17735 .ref*field u "" " <" ">"
17739 \# Build up reference string from ref*add-<x> macros.
17742 .if d ref*string \{\
17743 . ie d ref*post-punct \{\
17744 . as ref*string "\\$2\\*[ref*post-punct] \"
17745 . rm ref*post-punct
17747 . el .as ref*string "\\$2 \"
17749 .as ref*string "\\$3\\*([\\$1\\$4
17750 .if \\n[.$]>4 .ds ref*post-punct "\\$5
17751 .nr ref*suppress-period 0
17756 \# This is a wrapper for MNinit.
17758 \# I could use a 'while' loop to assign args to strings, but too many
17759 \# 'while' loops are slowing things down.
17762 . if !'\\$1'rerun' \{\
17764 . ie '\\$2'' .ds $MN-arg2 @
17765 . el .ds $MN-arg2 \\$2
17766 . ie '\\$3'' .ds $MN-arg3 @
17767 . el .ds $MN-arg3 \\$3
17768 . ie '\\$4'' .ds $MN-arg4 @
17769 . el .ds $MN-arg4 \\$4
17770 . ie '\\$5'' .ds $MN-arg5 @
17771 . el .ds $MN-arg5 \\$5
17772 . ie '\\$6'' .ds $MN-arg6 @
17773 . el .ds $MN-arg6 \\$6
17774 . ie '\\$7'' .ds $MN-arg7 @
17775 . el .ds $MN-arg7 \\$7
17776 . ie '\\$8'' .ds $MN-arg8 @
17777 . el .ds $MN-arg8 \\$8
17778 . ie '\\$9'' .ds $MN-arg9 @
17779 . el .ds $MN-arg9 \\$9
17781 . ie \\n[#START_FOR_MNinit]=0 \{\
17782 . nr #MNinit_DEFERRED 1
17783 . nr #START_FOR_MNinit 1
17787 . MNinit \\*[$MN-arg1] \\*[$MN-arg2] \\*[$MN-arg3] \\*[$MN-arg4] \\*[$MN-arg5] \\*[$MN-arg6] \\*[$MN-arg7] \\*[$MN-arg8] \\*[$MN-arg9]
17791 .MAC MN_OVERFLOW_TRAP END
17792 . if \\n[#OVERFLOW_LEFT]=1 \{\
17793 . nr #no-repeat-MN-left 1
17794 . di MN_OVERFLOW_LEFT
17796 . if \\n[#OVERFLOW_RIGHT]=1 \{\
17797 . nr #no-repeat-MN-right 1
17798 . di MN_OVERFLOW_RIGHT
17800 . rr #OVERFLOW_LEFT
17801 . rr #OVERFLOW_RIGHT
17804 \# The remainder of the margin notes macros and routines are adapted
17805 \# from Werner Lemberg's MN.tmac.
17810 \# MNinit [ragged|symmetric] \
17811 \# left-width right-width separation \
17812 \# font fontsize vertical-spacing \
17813 \# color hyphenation-flags
17815 \# Initialize margin notes. Empty arguments (denoted with "") set
17816 \# default values. If the first argument is the string `ragged',
17817 \# left and right margin notes are printed ragged-right. If it is
17818 \# `symmetric', left margin notes are printed ragged-left and right
17819 \# margin notes ragged-right. If omitted, margin notes are left
17820 \# and right adjusted.
17825 . ds MN-left-ad b\"
17826 . ds MN-right-ad b\"
17827 . if '\\$1'RAGGED' \{\
17828 . ds MN-left-ad l\"
17829 . ds MN-right-ad l\"
17832 . if '\\$1'SYMMETRIC' \{\
17833 . ds MN-left-ad r\"
17834 . ds MN-right-ad l\"
17838 . nr MN-sep (n;\\$3)
17841 . if ((\\n[.o] - \\n[MN-sep]) < 1n) \
17842 . ab MN: Left margin too small (<1n) for requested margin notes separation.
17844 . nr MN-left-width (n;\\$1)
17845 . nr MN-left-start (\\n[.o] - \\n[MN-sep] - \\n[MN-left-width])
17848 . nr MN-left-width (\\n[.o] - \\n[MN-sep])
17849 . nr MN-left-start 0
17851 . if (\\n[MN-left-start] < 0) \
17852 . ab MN: Left margin too small for requested margin notes settings.
17853 . if (\\n[MN-left-width] < 1n) \
17854 . ab MN: Left margin notes width too small (<1n).
17856 . nr MN-right-width (n;\\$2)
17857 . nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
17858 . if \\n[#COLUMNS]=1 \{\
17859 . if !\\n[#NUM_COLS]=1 \{\
17860 . nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
17865 . nr MN-right-width \\n[MN-left-width]
17866 . nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
17867 . if \\n[#COLUMNS]=1 \{\
17868 . if !\\n[#NUM_COLS]=1 \{\
17869 . nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
17874 . ds MN-font \\$4\"
17875 . if \\n[#PRINT_STYLE]=1 .ds MN-font CR
17878 . ds MN-font \\*[$PP_FT]
17879 . if \\n[#PRINT_STYLE]=1 .ds MN-font CR
17883 . nr MN-size \\n[.ps]
17885 . if \\n[#PRINT_STYLE]=1 \{\
17887 . nr MN-size \\n[.ps]
17892 . nr MN-size \\n[#DOC_PT_SIZE]
17896 . nr MN-spacing \\n(.v
17898 . if '\\$6'DOC' \{ .nr MN-spacing \\n[#DOC_LEAD] \}
17899 . if \\n[#PRINT_STYLE]=1 \{\
17900 . nr MN-spacing \\n[#DOC_LEAD]
17904 . nr MN-spacing \\n[#DOC_LEAD]
17907 . if !\\n[#PRINT_STYLE]=1 .ds MN-color \\$7\"
17909 . if !\\n[#PRINT_STYLE]=1 .ds MN-color
17913 . nr MN-hy \\n[.hy]
17914 . ev MNbottom-left-env
17915 . if \A'\\*[MN-font]' \
17917 . if \\n[MN-size] \
17919 . if \\n[MN-spacing] \
17920 . vs \\n[MN-spacing]u
17921 . ll \\n[MN-left-width]u
17922 . ad \\*[MN-left-ad]
17925 . nop \m[\\*[MN-color]]\c
17927 . ev MNbottom-right-env
17928 . if \A'\\*[MN-font]' \
17930 . if \\n[MN-size] \
17932 . if \\n[MN-spacing] \
17933 . vs \\n[MN-spacing]u
17934 . ll \\n[MN-right-width]u
17935 . ad \\*[MN-right-ad]
17938 . nop \m[\\*[MN-color]]\c
17947 \# margin note text
17950 \# With a parameter, start a margin note, otherwise end a margin note.
17951 \# If the parameter is the string `left', define a left margin note,
17952 \# otherwise define a right margin note.
17956 .if !'\\$1'LEFT' \{\
17957 . if !'\\$1'RIGHT' \{\
17962 .if \\n[#COLUMNS]=1 \{\
17963 . if \\n[#NUM_COLS]>2 \{\
17964 . tm [mom]: Macro MN: More than two columns. Ignoring margin notes.
17967 . if !\\n[#NUM_COLS]=1 \{\
17968 . ie \\n[#COL_NUM]=1 .ds MN-dir LEFT
17969 . el .ds MN-dir RIGHT
17972 . if !\\n[#MNinit]=1 \{\
17973 . tm [mom]: Macro MN: You must set parameters with MN_INIT before using MN.
17977 . if \\n[MN-active] \{\
17978 . tm [mom]: Macro MN: Can't handle nested margin notes.
17983 . ie '\\*[MN-dir]'LEFT' \{\
17985 . ds MN-curr l-\\n[MN-left]\"
17986 . evc MNbottom-left-env
17990 . ds MN-curr r-\\n[MN-right]\"
17991 . evc MNbottom-right-env
17993 . mk MN-mk-\\*[MN-curr]
17994 . di MN-div-\\*[MN-curr]
18003 \# Utility macro to handle .MN OFF | QUIT | X etc
18006 . if \\n[MN-active] \{\
18009 . nr MN-div-\\*[MN-curr]-depth \\n(dn
18017 \# Resets these registers (called in HEADER)
18023 . ch FOOTER -\\n[#B_MARGIN]u
18028 \# The "left" half of Werner's original MNbottom.
18033 . nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
18036 . if \\n[MN-active] \{\
18038 . tm [mom]: Macro MN: Margin note finished by new page. Ignored.
18040 . po \\n[MN-left-start]u
18041 . ev MNbottom-left-env
18042 . nr #P \\n%+\\n[#PAGE_NUM_ADJ]
18043 . while (\\n[MN-curr] < \\n[MN-left]) \{\
18045 . ie (\\n[MN-last-pos] < \\n[MN-mk-l-\\n[MN-curr]]) \
18046 . sp |\\n[MN-mk-l-\\n[MN-curr]]u+\\n[MN-lead-adj]u
18051 . if \\n[#SHIM]>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
18052 . tm [mom]: Macro MN: Warning: Left margin note #\\n[MN-curr] on page \\n[#P] shifted down.
18054 .\" If last margin note doesn't fit
18055 . if ( (\\n(nl+\\n[MN-div-l-\\n[MN-curr]-depth]) > (\\n(.p+\\n[#VARIABLE_FOOTER_POS]-1) ) \{\
18056 . if \\n[MN-shifted]=1 \{\
18057 . sp -(1v+\\n[#SHIM]u)
18058 . rm MN-div-l-\\n[MN-curr]
18059 . tm1 "[mom]: No room to start left margin note #\\n[MN-curr] on page \\n[#P].
18060 . tm1 " Ignoring margin note.
18063 . nr #no-repeat-MN-left 1
18064 . nr #OVERFLOW_LEFT 1
18065 . ie \\n[#FN_COUNT]=0 \{\
18066 . ch FOOTER \\n(.pu
18067 . wh \\n[#VARIABLE_FOOTER_POS]u+\\n[MN-lead-adj]u+1u MN_OVERFLOW_TRAP
18070 . wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
18075 . MN-div-l-\\n[MN-curr]
18078 . nr MN-last-pos \\n[nl]
18082 . if !\\n[#no-repeat-MN-left]=1 \{\
18083 . if \\n[MN-right]=0 .vpt 1
18089 \# The "right" half of Werner's original MNbottom.
18094 . nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
18096 . po \\n[MN-right-start]u
18097 . ev MNbottom-right-env
18098 . nr #P \\n%+\\n[#PAGE_NUM_ADJ]
18099 . while (\\n[MN-curr] < \\n[MN-right]) \{\
18101 . ie (\\n[MN-last-pos] < \\n[MN-mk-r-\\n[MN-curr]]) \
18102 . sp |\\n[MN-mk-r-\\n[MN-curr]]u+\\n[MN-lead-adj]u
18107 . if \\n[#SHIM]>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
18108 . tm [mom]: Macro MN: Warning: Right margin note #\\n[MN-curr] on page \\n[#P] shifted down.
18110 .\" If last margin note doesn't fit
18111 . if ( (\\n(nl+\\n[MN-div-r-\\n[MN-curr]-depth]) > (\\n(.p+\\n[#VARIABLE_FOOTER_POS]-1) ) \{\
18112 . if \\n[MN-shifted]=1 \{\
18113 . sp -(1v+\\n[#SHIM]u)
18114 . rm MN-div-r-\\n[MN-curr]
18115 . tm1 "[mom]: No room to start right margin note #\\n[MN-curr] on page \\n[#P] on page \\n[#P].
18116 . tm1 " Ignoring margin note.
18119 . nr #no-repeat-MN-right 1
18120 . nr #OVERFLOW_RIGHT 1
18121 . ie \\n[#FN_COUNT]=0 \{\
18122 . ch FOOTER \\n(.pu
18123 . wh \\n[#VARIABLE_FOOTER_POS]u+\\n[MN-lead-adj]u+1u MN_OVERFLOW_TRAP
18126 . wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
18131 . MN-div-r-\\n[MN-curr]
18134 . nr MN-last-pos \\n[nl]
18138 . if !\\n[#no-repeat-MN-right]=1 .vpt 1