3 Mom -- a typesetting/document-processing macro set for groff.
5 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007,
6 2008 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 2, or (at your option) any later
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 along
22 with groff; see the file COPYING. If not, write to the Free Software
23 Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 Antoine de St-Exupéry asserted that elegance in engineering is
28 achieved not when there is nothing left to add, but when there is
29 nothing left to take away.
31 By those standards, mom is a Rube Goldberg contraption. She was
32 created over the years while groff, and my understanding of it,
33 changed and evolved. However, I'm a firm believer in "if it
34 ain't broke, don't fix it," so I'm leaving any major clean-up
35 of redundancies and whatnot for a rainy day.
37 Inasmuch as possible, macros that turn a feature on or off follow
38 a similar style. Invoking the macro without an argument turns
39 the feature on. Invoking it with any other argument turns it off.
40 Use of the argument OFF is recommended, but not required; users
41 may find other conventions preferable (e.g. NO, X, END, QUIT, etc.).
43 "<anything>" in the description of arguments that can be passed
44 to a macro means that any argument turns the feature off.
48 \# ====================================================================
50 \# Check which version of groff is being run
51 .if (\n[.x]\n[.y] < 118) \
52 . ab [mom]: You need GNU troff version 1.18 or higher to run this version of mom.
53 \# Check that GNU troff is being run
55 . ab [mom]: The mom macros require that you be running GNU troff.
57 . ab [mom]: The groff mom macros do not work in compatibility mode.
58 \# Add supplementary styles
59 .sty \n[.fp] L \" Light Roman
60 .sty \n[.fp] LI \" Light Italic
61 .sty \n[.fp] LCD \" Light Condensed Roman
62 .sty \n[.fp] LCDI \" Light Condensed Italic
63 .sty \n[.fp] LEX \" Light Extended Roman
64 .sty \n[.fp] LEXI \" Light Extended Italic
65 .sty \n[.fp] CD \" Medium/Book Condensed Roman
66 .sty \n[.fp] CDI \" Medium/Book Condensed Italic
67 .sty \n[.fp] EX \" Medium/Book Extended Roman
68 .sty \n[.fp] EXI \" Medium/Book Extended Italic
69 .sty \n[.fp] DB \" DemiBold Roman
70 .sty \n[.fp] DBI \" DemiBold Italic
71 .sty \n[.fp] BCD \" Bold Condensed Roman
72 .sty \n[.fp] BCDI \" Bold Condensed Italic
73 .sty \n[.fp] BEX \" Bold Extended Roman
74 .sty \n[.fp] BEXI \" Bold Extended Italic
75 .sty \n[.fp] HV \" Heavy Roman
76 .sty \n[.fp] HVI \" Heavy Italic
77 .sty \n[.fp] HVCD \" Heavy Condensed Roman
78 .sty \n[.fp] HVCDI \" Heavy Condensed Italic
79 .sty \n[.fp] HVEX \" Heavy Extended Roman
80 .sty \n[.fp] HVEXI \" Heavy Extended Italic
81 .sty \n[.fp] BL \" Black Roman
82 .sty \n[.fp] BLI \" Black Italic
83 .sty \n[.fp] BLCD \" Black Condensed Roman
84 .sty \n[.fp] BLCDI \" Black Condensed Italic
85 .sty \n[.fp] BLEX \" Black Extended Roman
86 .sty \n[.fp] BLEXI \" Black Extended Italic
87 .sty \n[.fp] UBL \" Ultra-Black Roman
88 .sty \n[.fp] UBLI \" Ultra-Black Italic
90 \# Instruct grops to use square linecaps and joins.
91 \# This instruction is also executed in DO_B_MARGIN, NEWPAGE, and HEADER
93 \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
95 \# ====================================================================
97 \# TYPESETTING MACROS, STRINGS, AND ALIASES
98 \# ========================================
102 \# Alias .als as ALIAS, and .aln (number registers) as ALIASN
108 \# ALIASES FOR GROFF REQUESTS
109 \# --------------------------
120 \# ALIASES FOR NUMBER REGISTERS
121 \# ----------------------------
123 .ALIASN #PT_SIZE .ps \"fractional point size in units
124 .ALIASN #DIVER_DEPTH dn \"diversion depth
125 .ALIASN #DIVER_WIDTH dl \"diversion width
126 .ALIASN #TRAP_DISTANCE .t \"distance to next trap
127 .ALIASN #LEAD .v \"line space (.vs, not .ls)
128 .ALIASN #PAGE_LENGTH .p \"page length
129 .ALIASN #NUM_ARGS .$ \"number of arguments passed to a macro
130 .ALIASN #INDENT .i \"value of current indent
132 \# ====================================================================
136 .nr #L_MARGIN \n(.o \" Tabs, etc require #L_MARGIN
137 .cflags 4 /\(en \" So slash and en-dashes get broken
140 \# About the warn level
141 \# --------------------
143 \# There's a lot of testing for the presence of number registers and
144 \# strings in this macro file. Many of the registers and strings
145 \# pop into and out of existence on the fly. For convenience, I
148 \# .if \\n[whatever] and .if !\\n[whatever]
150 \# to test "if the register exists and is (not) empty." Groff,
151 \# encountering such tests when called with the -ww options, emits
153 \# warning: number register whatever not defined.
155 \# Groff also warns about strings similarly tested for.
157 \# The warn level, above, is high in order to shut off those
158 \# warnings. If you're futzing in this file and need more verbose
159 \# warnings, either comment out ".warn 8192" or set the warnlevel
160 \# to the one you need (but be ready for lots of what I've just
163 \# ====================================================================
167 \# Macros that control the physical layout of the page: paper size
173 \# <width of printer sheet>
175 \# Stores user supplied page width in register #PAGE_WIDTH.
177 \# #PAGE_WIDTH is used to establish the default LL (and right margin).
178 \# Requires unit of measure.
182 . nr #PAGE_WIDTH \\$1
183 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
184 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
191 \# <offset from page left>
193 \# Stores user supplied page offset in register #L_MARGIN.
194 \# Sets .po to user supplied offset.
196 \# Requires unit of measure.
200 . nr #L_MARGIN (\\$1)
208 \# <width of right margin>
210 \# Stores user supplied right margin in register #R_MARGIN.
212 \# This is a pseudo-margin. Right margin is actually a function of
213 \# line length. The macro calculates line length from the page offset
214 \# and the value plugged into #R_MARGIN.
216 \# N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
218 \# Requires unit of measure.
222 . nr #R_MARGIN (\\$1)
223 . ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
225 . nr #L_LENGTH \\n(.l
232 \# <distance to advance from top of page>
234 \# Stores the user supplied top margin in register #T_MARGIN.
235 \# Advances user supplied depth from the top of the page.
237 \# Requires unit of measure.
240 . nr #T_MARGIN (\\$1)
243 . sp |\\n[#T_MARGIN]u-1v
252 \# <space to leave at the bottom of the page>
254 \# Stores the user supplied bottom margin in register #B_MARGIN.
256 \# Requires unit of measure.
260 . nr #B_MARGIN (\\$1)
261 . nr #ORIGINAL_B_MARGIN \\n[#B_MARGIN]
263 . wh -\\n[#B_MARGIN]u DO_B_MARGIN
270 \# <pagewidth> [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
272 \# Page set-up. Collects arguments and passes them to the appropriate
275 \# All arguments after pagewidth are optional, but must appear
276 \# in the order given above. (User can fill in as much or as
277 \# little as desired.)
279 \# All arguments require a unit of measure.
285 . ie '\\$3'' \{ .L_MARGIN \\n(.o \}
286 . el \{ .L_MARGIN \\$3 \}
287 . ie '\\$4'' \{ .R_MARGIN 1i \}
288 . el \{ .R_MARGIN \\$4 \}
289 . if !'\\$5'' \{ .T_MARGIN \\$5 \}
290 . if !'\\$6'' \{ .B_MARGIN \\$6 \}
293 \# =====================================================================
295 \# +++PAGE CONTROL+++
297 \# Generic macros for breaking pages.
304 \# Plants the top margin at the top of each page.
306 \# The trap is set in .T_MARGIN or .PAGE
311 . sp |\\n[#T_MARGIN]u-1v
313 . sp -\\n[#T_MARGIN_LEAD_ADJ]u
322 \# Plants the bottom margin at the bottom of each page.
324 \# The trap is set in .B_MARGIN or .PAGE.
327 . nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000
330 . nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
340 \# Breaks to a new page.
342 \# If a B_MARGIN has been set, processes that, otherwise, just
343 \# breaks to a new page.
346 . ie \\n[#NO_BREAK] \{\
354 . ie \\n[#B_MARGIN_SET]=1 \{\
355 . ie !\\n[#DOCS]=1 \{\
358 . nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
362 . if \\n[#COLUMNS]=1 \{ .nr #COL_NUM \\n[#NUM_COLS] \}
363 . ie !\\n[#FN_DEPTH] \{\
364 . ch FN_OVERFLOW_TRAP
366 . wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
378 \# =====================================================================
380 \# +++GENERAL STYLE MACROS+++
382 \# Macros that are likely to appear together to define general
383 \# type style: line length, family, font, point size, and line
391 \# Stores user supplied line length in register #L_LENGTH.
392 \# Sets .ll to #L_LENGTHu
394 \# Requires unit of measure.
397 . nr #USER_SET_L_LENGTH 1
399 . nr #L_LENGTH \\n(.l
404 \# +++FAMILY AND FONT+++
409 \# <fallback font> [ ABORT | WARN ] | ABORT | WARN
411 \# Sets register #ABORT_FT_ERRORS to 1, or defines a fallback font
412 \# called "dummy" at font position 0.
414 \# Calls to non-existent families cause mom to continue processing
415 \# files using the fallback font until a valid family is entered.
417 \# Calls to non-existent fonts generate warnings. If ABORT is passed
418 \# to FALLBACK_FONT, mom stops processing files after the warning.
419 \# Otherwise, she continues to process files using the fallback font
420 \# after the warning is issued. The default fallback font is CR; the
421 \# default for font warnings is to abort.
423 .MAC FALLBACK_FONT END
424 . if \\n[#NUM_ARGS]=1 \{\
425 . if '\\$1'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
427 . if r#ABORT_FT_ERRORS \{ .nr #ABORT_FT_ERRORS 0 \}
429 . if !'\\$1'ABORT' \{\
430 . if !'\\$1'WARN' \{\
435 . if \\n[#NUM_ARGS]=2 \{\
437 . if '\\$2'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
438 . if '\\$2'WARN' \{ .nr #ABORT_FT_ERRORS 0 \}
442 .FALLBACK_FONT CR ABORT
449 \# Stores user supplied font family in string $FAMILY. Sets .fam
454 . if \\n[#PRINT_STYLE]=1 \{\
458 . if \\n[#IGNORE] \{\
462 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
463 . ds $SAVED_STYLE \\n[.sty]
467 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
468 . ft \\*[$SAVED_STYLE]
473 . ie \\n[#PRE_COLLATE]=1 \{ . \}
475 . if \\n[#COLLATE]=1 \{\
476 . if !r#START \{ .DOC_FAM \\*[$FAMILY] \}
485 \# R | I | B | BI | <other style extension>
487 \# Stores user supplied font in $FONT and sets .ft to $FONT.
491 . if \\n[#PRINT_STYLE]=1 \{\
493 . if \\n[#UNDERLINE_ITALIC]=1 \{\
497 . if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
503 . el \{ .UNDERLINE OFF \}
508 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
509 . if '\\n[.sty]'' \{\
511 . if !S\\*[$FONT] \{\
512 . tm1 "[mom]: Font style "\\*[$FONT]" at line \\n(.c has not been registered.
513 . ie \\n[#ABORT_FT_ERRORS]=0 \{\
514 . tm1 " Continuing to process using fallback font.
519 . tm1 "[mom]: Either font style "\\*[$FONT]" at line \\n(.c does not exist in family "\\n[.fam]",
520 . tm1 " or family "\\n[.fam]" has not been installed in font/devps.
521 . ie \\n[#ABORT_FT_ERRORS]=0 \{\
522 . tm1 " Continuing to process using fallback font.
535 \# <point size of type>
537 \# Sets point size to user supplied value in scaled points.
538 \# If #AUTO_LEAD is on, sets .vs to #AUTOLEAD_VALUE+#PT_SIZE.
540 \# Must NOT use a unit of measure.
543 . if \\n[#PRINT_STYLE]=1 \{ .return \}
544 . if \\n[#IGNORE] \{ .return \}
547 . if \\n[#AUTO_LEAD] \{\
548 . ie \\n[#AUTOLEAD_FACTOR] \{ .vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u \}
549 . el \{ .vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u \}
551 . nr #PT_SIZE_IN_UNITS \\n[.ps]
558 \# <point size of type>
560 \# Sets point size to user supplied value in scaled points.
561 \# Intended to be called inline with \*[SIZE <n><unit>]
563 \# Can be used with a unit of measure or not.
574 \# <leading between lines of text>
576 \# Turns off #AUTOLEAD if it's on.
577 \# Sets .vs to user supplied value.
579 \# Does not require unit of measure. LS automatically turns off AUTOLEAD.
583 . nr #OLD_LEAD \\n(.v
584 . if \\n[#PRINT_STYLE]=1 \{ .return \}
585 . if \\n[#IGNORE] \{ .return \}
586 . if \\n[#AUTO_LEAD] \{\
588 . rr #AUTOLEAD_FACTOR
592 . nr #TOP_BASELINE_ADJ \\n(.v-\\n[#OLD_LEAD]
593 . sp -\\n[#TOP_BASELINE_ADJ]u
595 . rr #TOP_BASELINE_ADJ
608 \# <leading value to add to #PT_SIZE> [FACTOR]
610 \# Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
611 \# Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
612 \# All subsequent PT_SIZE requests reset the leading in the same way until
613 \# AUTOLEAD is turned off.
615 \# With the optional FACTOR argument, the current point size is
616 \# multiplied by #AUTOLEAD_VALUE instead of the two being added
620 . if \\n[#PRINT_STYLE]=1 \{ .return \}
621 . if \\n[#IGNORE] \{ .return \}
623 . nr #OLD_LEAD \\n(.v
624 . nr #AUTOLEAD_VALUE (p;\\$1)
625 . ie \\n[#NUM_ARGS]=2 \{\
626 . if '\\$2'FACTOR' \{\
627 . nr #AUTOLEAD_FACTOR 1
628 . vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u
632 . vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u
635 . nr #TOP_BASELINE_ADJ \\n(.v-\\n[#OLD_LEAD]
636 . sp -\\n[#TOP_BASELINE_ADJ]u
638 . rr #TOP_BASELINE_ADJ
643 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
644 \# ------------------------------------------------
652 \# =====================================================================
656 \# AUTOMATIC PAIRWISE KERNING
657 \# --------------------------
659 \# <none> | <anything>
661 \# Turns automatic pairwise kerning on or off.
675 \# INLINE KERNING AND HORIZONTAL MOVEMENT
676 \# --------------------------------------
679 \# Inline kerning provides a simple method for users to adjust the
680 \# amount of space between any two letters. It's predicated on a
681 \# unit of measure "U", which is 1/36 of the current point size as
682 \# returned by \n[.ps]. E.g., if the current point size is 18,
683 \# \n[.ps] returns 18000u, therefore U=500u. Since U remains
684 \# proportional relative to the current point size, the amount
685 \# of kerning between two letters as expressed in Us remains
686 \# visually similar regardless of changes in point size.
688 \# N.B.--the amount of inline kerning supplied by \*[BU<n>] or
689 \# \*[FU<n>] is added to or subtracted from any kerning that already
690 \# takes place between two characters when automatic kerning is
693 \# In groff v. 1.17.2, it was not possible to pass arguments to macros that
694 \# were called with inline escapes, nor thence to evaluate conditional
695 \# expressions. Consequently, each pseudo-escape \[BU<n>] had to be defined
696 \# separately with ".char".
698 \# As of v. 1.18, one can pass arguments to inline strings/macros,
699 \# hence it is now possible to do \*[BU n] where n, inline, is the desired
700 \# number of kern units. The original .char definitions have been left in
701 \# for backward compatibility with documents created prior to mom-1.1.3c.
704 .ds BU \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
705 .ds FU \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
707 \# Initialize strings for pre-1.1.3c-style BU and FU
710 .while \n+[#LOOP]<37 \{\
711 . ds BU\n[#LOOP] \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
715 .while \n+[#LOOP]<37 \{\
716 . ds FU\n[#LOOP] \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
720 \# Horizontal movements
721 \# --------------------
722 \# BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
723 \# specified number of points.
725 \# Left in for backward compatibility with mom-1.1.3c, the
726 \# preferred methods for inline horizontal movements are now
727 \# \*[BCK <n><unit>] and \*[FWD <n><unit>].
736 .ds BP1.25 \h'-1.25p'
738 .ds BP1.75 \h'-1.75p'
740 .ds BP2.25 \h'-2.25p'
742 .ds BP2.75 \h'-2.75p'
744 .ds BP3.25 \h'-3.25p'
746 .ds BP3.75 \h'-3.75p'
748 .ds BP4.25 \h'-4.25p'
750 .ds BP4.75 \h'-4.75p'
752 .ds BP5.25 \h'-5.25p'
754 .ds BP5.75 \h'-5.75p'
756 .ds BP6.25 \h'-6.25p'
758 .ds BP6.75 \h'-6.75p'
760 .ds BP7.25 \h'-7.25p'
762 .ds BP7.75 \h'-7.75p'
764 .ds BP8.25 \h'-8.25p'
766 .ds BP8.75 \h'-8.75p'
768 .ds BP9.25 \h'-9.25p'
770 .ds BP9.75 \h'-9.75p'
772 .ds BP10.25 \h'-10.25p'
773 .ds BP10.5 \h'-10.5p'
774 .ds BP10.75 \h'-10.75p'
776 .ds BP11.25 \h'-11.25p'
777 .ds BP11.5 \h'-11.5p'
778 .ds BP11.75 \h'-11.75p'
780 .ds BP12.25 \h'-12.25p'
781 .ds BP12.5 \h'-12.5p'
782 .ds BP12.75 \h'-12.75p'
824 .ds FP10.25 \h'10.25p'
826 .ds FP10.75 \h'10.75p'
828 .ds FP11.25 \h'11.25p'
830 .ds FP11.75 \h'11.75p'
832 .ds FP12.25 \h'12.25p'
834 .ds FP12.75 \h'12.75p'
837 \# WHOLE LINE KERNING (RW and EW)
838 \# -----------------------------
839 \# The line kerning macros are special instances of track kerning,
840 \# used where a complete line needs to be tightened (or relaxed) in
841 \# order to accomodate or remove one or two more characters
842 \# than the default justification permits.
845 \# <amount of overall "kerning" (letter spacing) to apply to the line>
847 \# Invokes .tkf (track kerning) for the current font with
848 \# 1 as both the upper and lower point size limits, so that
849 \# the value entered by the user applies regardless of point
850 \# size. RW ("Reduce Whitespace") reduces the amount of space
851 \# between all characters by an equal amount. EW ("Extra
852 \# Whitespace") increases the amount of space.
854 \# Decimal values are acceptable.
856 \# The groff documentation is a tad confusing about what unit of
857 \# measure is used in track kerning, only that the width of each
858 \# character is increased or decreased by the amount(s) passed as
859 \# arguments to .tkf, and something about linear function of point
860 \# size. In fact, with the way I've put this macro together, it
861 \# doesn't matter. All the user needs to know is that a value of
862 \# one will produce an unacceptably tight or loose line at most text
863 \# point sizes; therefore, effective use of RW and EW is in the
864 \# fractional range below 1 (e.g. .25, .5). Given that RW and EW
865 \# are for massaging type, a certain amount of experimentation and
866 \# previewing is expected and necessary.
868 \# \n(.f holds the current font number, which is acceptable to .tkf.
870 \# RW and EW must be reset to 0 to cancel their effect on subsequent
874 . if \\n[#BR_AT_LINE_KERN] \{\
875 . ie \\n[#JUSTIFY]=1 \{ .brp \}
878 . tkf \\n(.f 1 -\\$1 1 -\\$1
883 . if \\n[#BR_AT_LINE_KERN] \{\
884 . ie \\n[#JUSTIFY]=1 \{ .brp \}
887 . tkf \\n(.f 1 \\$1 1 \\$1
891 \# BREAK AT LINE KERN
892 \# ------------------
896 \# Enables/disables .br's before .RW and .EW
898 \# Mostly, users will want .br's before any kind of line kerning, but
899 \# there may be cases where they don't. BR_BEFORE_LINE_KERN is off by
900 \# default and must be invoked explicitly.
902 .MAC BR_AT_LINE_KERN END
903 . ie '\\$1'' \{ .nr #BR_AT_LINE_KERN 1 \}
904 . el \{ .rr #BR_AT_LINE_KERN \}
907 \# =====================================================================
914 \# <none> | <anything> | DEFAULT
916 \# LINES <n> | MARGIN <n> | SPACE <n>
918 \# Turns auto hyphenation on or off, resets the hyphenation style
919 \# to default, or permits the setting of various hyphenation
922 \# HY, by itself, defaults to .hy 14, i.e. no hyphens after the
923 \# first two or before the last two characters of a word, and no
924 \# hyphenation of the last line prior to a trap (e.g., at the
925 \# bottom of a page).
927 \# HY DEFAULT resets the hyphenation style to .hy 14 (see
928 \# above) if that behaviour is desired after changes have been
929 \# made to LINES, MARGIN, or SPACE.
931 \# HY LINES <n> sets the number of allowable consecutive hyphenated lines.
933 \# HY MARGIN <n> sets the amount of space (ipPcm) allowed at the end
934 \# of a line in QUAD mode before hyphenation is tripped (e.g. if there's
935 \# only 6 points left, groff won't try to hyphenate the next word).
937 \# HY SPACE sets the amount of extra interword space (ipPcm) that can
938 \# be added in JUSTIFY mode to prevent a line from being hyphenated.
946 . if !'\\$1'LINES' \{\
950 . if !'\\$1'MARGIN' \{\
954 . if !'\\$1'SPACE' \{\
958 . if !'\\$1'DEFAULT' \{\
962 . if '\\$1'LINES' \{ .hlm \\$2 \}
963 . if '\\$1'MARGIN' \{ .hym \\$2 \}
964 . if '\\$1'SPACE' \{ .hys \\$2 \}
965 . if '\\$1'DEFAULT' \{\
974 \# HYPHENATION PARAMETERS
975 \# ----------------------
977 \# <# of lines> | <size of margin> | <amount of interword space>
979 \# Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
988 \# =====================================================================
990 \# +++VERTICAL SPACING+++
995 \# <user supplied lead to advance below current baseline>
997 \# Creates or modifies register #ALD. Adds user supplied lead
998 \# below current baseline.
1000 \# Requires a unit of measure.
1003 . if \\n(nl=0 \{ .nr #TOP 1 \}
1008 . if '\\$0'ADD_SPACE' \{\
1013 . if '\\$0'SPACE' \{\
1025 \# <user supplied lead to reverse above current baseline>
1027 \# Creates or modifies register #RLD. Reverses user supplied
1028 \# lead above current baseline.
1030 \# Requires a unit of measure.
1039 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding
1040 \# \*[RLD] forms have been left in for backward compatibility with
1041 \# documents created using mom-1.1.3c or earlier. The prefered methods
1042 \# of advancing and reversing on the page inline are \*[UP <n><unit>]
1043 \# and \*[DOWN <n><unit>].
1052 .ds ALD1.25 \v'1.25p'
1054 .ds ALD1.75 \v'1.75p'
1056 .ds ALD2.25 \v'2.25p'
1058 .ds ALD2.75 \v'2.75p'
1060 .ds ALD3.25 \v'3.25p'
1062 .ds ALD3.75 \v'3.75p'
1064 .ds ALD4.25 \v'4.25p'
1066 .ds ALD4.75 \v'4.75p'
1068 .ds ALD5.25 \v'5.25p'
1070 .ds ALD5.75 \v'5.75p'
1072 .ds ALD6.25 \v'6.25p'
1074 .ds ALD6.75 \v'6.75p'
1076 .ds ALD7.25 \v'7.25p'
1078 .ds ALD7.75 \v'7.75p'
1080 .ds ALD8.25 \v'8.25p'
1082 .ds ALD8.75 \v'8.75p'
1084 .ds ALD9.25 \v'9.25p'
1086 .ds ALD9.75 \v'9.75p'
1088 .ds ALD10.25 \v'10.25p'
1089 .ds ALD10.5 \v'10.5p'
1090 .ds ALD10.75 \v'10.75p'
1092 .ds ALD11.25 \v'11.25p'
1093 .ds ALD11.5 \v'11.5p'
1094 .ds ALD11.75 \v'11.75p'
1096 .ds ALD12.25 \v'12.5p'
1097 .ds ALD12.5 \v'12.5p'
1098 .ds ALD12.75 \v'12.75p'
1100 .ds RLD.25 \v'-.25p'
1102 .ds RLD.75 \v'-.75p'
1104 .ds RLD1.25 \v'-1.25p'
1105 .ds RLD1.5 \v'-1.5p'
1106 .ds RLD1.75 \v'-1.75p'
1108 .ds RLD2.25 \v'-2.25p'
1109 .ds RLD2.5 \v'-2.5p'
1110 .ds RLD2.75 \v'-2.75p'
1112 .ds RLD3.25 \v'-3.25p'
1113 .ds RLD3.5 \v'-3.5p'
1114 .ds RLD3.75 \v'-3.75p'
1116 .ds RLD4.25 \v'-4.25p'
1117 .ds RLD4.5 \v'-4.5p'
1118 .ds RLD4.75 \v'-4.75p'
1120 .ds RLD5.25 \v'-5.25p'
1121 .ds RLD5.5 \v'-5.5p'
1122 .ds RLD5.75 \v'-5.75p'
1124 .ds RLD6.25 \v'-6.25p'
1125 .ds RLD6.5 \v'-6.5p'
1126 .ds RLD6.75 \v'-6.75p'
1128 .ds RLD7.25 \v'-7.25p'
1129 .ds RLD7.5 \v'-7.5p'
1130 .ds RLD7.75 \v'-7.75p'
1132 .ds RLD8.25 \v'-8.25p'
1133 .ds RLD8.5 \v'-8.5p'
1134 .ds RLD8.75 \v'-8.75p'
1136 .ds RLD9.25 \v'-9.25p'
1137 .ds RLD9.5 \v'-9.5p'
1138 .ds RLD9.75 \v'-9.75p'
1140 .ds RLD10.25 \v'-10.25p'
1141 .ds RLD10.5 \v'-10.5p'
1142 .ds RLD10.75 \v'-10.75p'
1144 .ds RLD11.25 \v'-11.25p'
1145 .ds RLD11.5 \v'-11.5p'
1146 .ds RLD11.75 \v'-11.75p'
1148 .ds RLD12.25 \v'-12.5p'
1149 .ds RLD12.5 \v'-12.5p'
1150 .ds RLD12.75 \v'-12.75p'
1152 \# =====================================================================
1154 \# +++REFINEMENTS+++
1156 \# AUTOMATIC LIGATURES
1157 \# -------------------
1159 \# <none> | <anything>
1161 \# Turns automatic ligature generation on or off.
1163 \# Ligatures may be supplied manually with \(fi, \(fl, etc.
1180 \# [ ,, ] | [ << ] | [ >> ] | <anything>
1182 \# [ DA | DE | ES | FR | IT | NL | NO | PT | SV ] | <anything>
1184 \# Turns smartquotes on (optionally with a quoting style from the
1185 \# argument list, or off).
1187 \# The " character is read outside the macro when mom is
1188 \# processed. The strings for open/close ($QUOTE<n>) are then
1189 \# defined in the macro.
1191 \# (Note to myself: code for " is \N'34'.)
1193 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1195 .MAC SMARTQUOTES END
1197 . if \\n[#RESTORE_SQ]=1 \{\
1199 . ie '\\*[$RESTORE_SQ]'' \{\
1204 . SMARTQUOTES \\*[$RESTORE_SQ]
1212 . ds $RESTORE_SQ \\$1
1219 . ds $RESTORE_SQ \\$1
1225 . ds $RESTORE_SQ \\$1
1231 . ds $RESTORE_SQ \\$1
1237 . ds $RESTORE_SQ \\$1
1243 . ds $RESTORE_SQ \\$1
1249 . ds $RESTORE_SQ \\$1
1253 . ds $QUOTE0 \\[Fo]\\|
1254 . ds $QUOTE1 \\|\\[Fc]
1255 . ds $RESTORE_SQ \\$1
1259 . ds $QUOTE0 \\[Fo]\\|
1260 . ds $QUOTE1 \\|\\[Fc]
1261 . ds $RESTORE_SQ \\$1
1267 . ds $RESTORE_SQ \\$1
1273 . ds $RESTORE_SQ \\$1
1279 . ds $RESTORE_SQ \\$1
1285 . ds $RESTORE_SQ \\$1
1287 . if !r#ARGS_TO_SQ \{\
1298 \# Strings for foot and inch marks
1303 \# =====================================================================
1305 \# +++LINE BREAKS+++
1312 \# Breaks a line without advancing.
1314 \# EL is the mnemonic used on older, dedicated typesetting machines
1315 \# to indicate "process the line, without advancing the galley
1316 \# medium." It stands for End Line.
1318 \# The \c inline must be appended to the end of input lines when in
1319 \# nofill mode; in fill modes, the \c inline must not be used.
1323 . if \\n[#PSEUDO_FILL]=1 \&
1329 \# An inline escape to accomplish the same thing. Actually
1330 \# preferable, since it works with filled and non-filled copy and
1331 \# doesn't require the user to remember to use (or not use) the \c.
1333 .ds B \h'|0'\R'#NO_ADVANCE 1'\c
1335 \# =====================================================================
1337 \# +++FILLING/QUADDING/JUSTIFYING+++
1344 \# Turns fill on and sets .ad to b.
1346 \# Justifies text left and right.
1349 . if \\n[#TAB_ACTIVE]=0 \{\
1351 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1355 . if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1363 \# L | LEFT | R | RIGHT | C | CENTER/CENTRE
1365 \# Turns fill on and sets .ad to l, r, or c.
1367 \# Terminology is a problem here. Some people call quad left
1368 \# left justified, flush left, or flush left/rag right (and the
1369 \# reverse for quad right). Quad center is sometimes called rag
1370 \# both. For our purposes, all "quad" modes mean that groff fill
1374 . ds $QUAD_VALUE \\$1
1375 . if \\n[#TAB_ACTIVE]=0 \{\
1377 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1381 . if '\\*[$QUAD_VALUE]'L' \{\
1385 . if '\\*[$QUAD_VALUE]'LEFT' \{\
1389 . if '\\*[$QUAD_VALUE]'R' \{\
1393 . if '\\*[$QUAD_VALUE]'RIGHT' \{\
1397 . if '\\*[$QUAD_VALUE]'C' \{\
1401 . if '\\*[$QUAD_VALUE]'CENTER' \{\
1405 . if '\\*[$QUAD_VALUE]'CENTRE' \{\
1409 . if '\\*[$QUAD_VALUE]'J' \{\
1413 . if '\\*[$QUAD_VALUE]'JUSTIFY' \{\
1421 \# LEFT, RIGHT, AND CENTER
1422 \# -----------------------
1423 \# The purpose of these macros is to allow the user to enter lines of
1424 \# text that will be quadded LRC *without* the user having to enter .BR
1425 \# or .br between lines. For the sake of consistency, all three appear
1426 \# to behave similarly (from the point of view of the user), although
1427 \# the underlying primitives don't. For this reason, LEFT, RIGHT, and
1428 \# CENTER must be followed by .QUAD [L R C J] or .JUSTIFY to restore
1429 \# text to groff fill mode.
1436 \# Turns fill mode off. Allows user to quad lines left without
1437 \# requiring the .BR or .br macro.
1439 \# LEFT simply turns fill off. Lines that exceed the current LL will
1440 \# not be broken, just continued (indefinitely) until a return is
1441 \# encountered. Note that this behaviour differs from the RIGHT and
1445 . if \\n[#TAB_ACTIVE]=0 \{\
1447 . ds $RESTORE_QUAD_VALUE LEFT
1452 .\" Fix for a little conflict with DOCTYPE LETTER
1453 . if '\\n(.z'LETTERHEAD1' \{ .rr #DATE_FIRST \}
1462 \# Turns fill on. Allows user to quad lines right without
1463 \# requiring the .BR or .br macro.
1465 \# Lines that exceed the current LL will be broken, with the excess
1466 \# text quadded right.
1469 . if \\n[#TAB_ACTIVE]=0 \{\
1471 . ds $RESTORE_QUAD_VALUE RIGHT
1484 \# Turns fill on. Allows user to center lines without
1485 \# requiring the .BR or .br macro.
1487 \# Lines that exceed the current LL will be broken, with the excess
1491 . if \\n[#TAB_ACTIVE]=0 \{\
1493 . ds $RESTORE_QUAD_VALUE CENTER
1500 \# =====================================================================
1504 \# There are two different kinds of tabs available: typesetting tabs
1507 \# Typesetting tabs are set with TAB_SET, which requires a tab number,
1508 \# an indent (offset) from the left margin and a length (optionally
1509 \# with a quad direction and an instruction to fill lines). After tabs
1510 \# are set with TAB_SET, they are called with .TAB n, where "n"
1511 \# corresponds to the number passed to TAB_SET as a valid tab number.
1513 \# String tabs allow the user to mark off tab positions inline. Tab
1514 \# indents and lengths are calculated from the beginning and end
1515 \# positions of the marks. Up to 19 string tabs may be created,
1516 \# numbered 1-19. Once created, they are called with .TAB n,
1517 \# just like typesetting tabs.
1519 \# Setting up string tabs is a two-step procedure. First, the user
1520 \# enters an input line in which s/he wants to mark off string tabs.
1521 \# The beginning of a tab is marked with \*[STn], where "n" is
1522 \# the desired number of the tab. The end of the the tab is marked
1523 \# with \*[STnX]. All ST's must have a matching STX. String tabs
1526 \# Next, the user invokes .ST n for every string tab defined, and
1527 \# optionally passes quad information to it. That done, string tabs
1528 \# can be called just like typesetting tabs.
1530 \# String tabs don't preview properly with gxditview. Use gv instead.
1532 \# Strings for string tab inlines
1533 \# ------------------------------
1534 \# Initialize string tab markers numbered 1 to 19.
1537 .while \n+[#LOOP]<20 \{\
1538 . ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET]
1542 .while \n+[#LOOP]<20 \{\
1543 . ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK]
1548 \# These are reserved ST numbers for internal use
1549 .ds ST100 \Ek[#ST100_OFFSET]
1550 .ds ST100X \Ek[#ST100_MARK]
1551 .ds ST101 \Ek[#ST101_OFFSET]
1552 .ds ST101X \Ek[#ST101_MARK]
1555 \# QUAD AND SET STRING TABS
1556 \# ------------------------
1558 \# <stringtab number> L | R | C | J [QUAD]
1560 \# Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1561 \# tab based on the collected information.
1563 \# Like TAB_SET, ST invoked without a quad direction will default to LEFT.
1564 \# If lines should be filled and quadded, use the optional argument QUAD.
1565 \# N.B. -- indents *must* be turned off before setting string tabs
1569 . ds $ST\\$1_QUAD_DIR \\$2
1570 . if \\n[#NUM_ARGS]=3 \{\
1571 . ds $ST\\$1_FILL QUAD
1573 . nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1574 . ie \\n[#IN_TAB] \{\
1575 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1578 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1586 \# <n> ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]]
1588 \# Creates macros TABn and TAB n, where "n" is any arbitrary number.
1589 \# TABn is a typesetting tab (i.e. a tab defined as an indent
1590 \# from the page left offset plus a line length.)
1592 \# n = arbitrary digit to identify the tab
1593 \# indent = indent from left margin; unit of measure required
1594 \# length = length of tab (unit of measure required; can be
1595 \# \w'<string>'u--if more than one word in string, surround
1596 \# with double quotes "\w'<three word string>'"
1597 \# LRCJ = quad for tab (left, right, center, justified)
1598 \# If option QUAD afterwards is not given, quad is line for line
1599 \# (no fill mode), meaning that there's no need for .BR or .br
1601 \# QUAD = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1604 \# N.B. -- indents *must* be turned off before setting tabs
1609 \# .TAB_SET 1 2P+6p 12P C
1611 \# means "create a tab numbered 1 that starts 2 picas and 6 points from
1612 \# the left margin, is 12 picas long, and centre each input line."
1614 \# .TAB_SET 1 2P+6P 12P C QUAD
1616 \# means exactly the same thing, except that input lines are joined and
1617 \# the area delimted by the tab filled with centered text.
1619 \# TAB n can be called at any time after being set.
1621 \# Tabs are NOT columnar in behaviour. If the text inside a
1622 \# tab runs to several lines, when you call the next tab a break
1623 \# occurs, meaning that the new tab starts one line below the last
1624 \# line in the previous tab. For columnar behaviour, you must
1625 \# use the multi-column macros in addition to tabs.
1627 \# If you want tabs to line up bottom-line to bottom-line (most likely
1628 \# single line tabs), use .TN (provided the tabs are numbered sequentially).
1629 \# Otherwise, you must use .EL then .TAB <n> if you want them to align.
1631 \# If you want to reset tabs, you must use .TQ before .TAB_SET.
1633 \# Note that indents are turned off automatically whenever a new
1634 \# tab is called with TAB <n>.
1636 \# Tabs themselves are user-invoked using the TAB macro with a numeric
1637 \# argument, e.g. TAB 1.
1639 \# Generally, in order not to get confused, it's a good idea
1640 \# to make sure all indents are off before setting tabs.
1644 . nr #TAB_NUMBER \\$1
1645 . ds $CURRENT_TAB \\n[#TAB_NUMBER]
1646 . nr #TAB_OFFSET (\\$2)
1647 . nr #TAB_LENGTH (\\$3)
1648 . MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1649 . if !\\\\n[#TB+]=1 \{ .br \}
1650 . if \\\\n[#TB+]=1 \{\
1657 . nr #CURRENT_TAB \\n[#TAB_NUMBER]
1658 . ds $CURRENT_TAB \\*[$CURRENT_TAB]
1659 . nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1660 . nr #ST_OFFSET \\n[#TAB_OFFSET]
1661 . po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
1662 . ll \\n[#TAB_LENGTH]u
1664 . ie '\\$5'QUAD' \{\
1665 . if '\\$4'L' \{ .QUAD L \}
1666 . if '\\$4'R' \{ .QUAD R \}
1667 . if '\\$4'C' \{ .QUAD C \}
1668 . if '\\$4'J' \{ .JUSTIFY \}
1671 . if '\\$4'' \{ .LEFT \}
1672 . if '\\$4'L' \{ .LEFT \}
1673 . if '\\$4'R' \{ .RIGHT \}
1674 . if '\\$4'C' \{ .CENTER \}
1675 . if '\\$4'J' \{ .JUSTIFY \}
1677 . if \\\\n[#TN]=1 \{\
1689 \# <tab number to tab into>
1691 \# Moves to tab number passed as an argument.
1694 . ds $TAB_NUMBER \\$1
1695 . TAB\\*[$TAB_NUMBER]
1705 \# Automagically moves to TAB<n+1> on the same line as the last
1706 \# line of the previous tab.
1708 \# The \c inline must be appended to the end of input lines when in
1709 \# nofill mode; in fill modes, the \c inline must not be used.
1715 . nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1720 \# An inline escape to accomplish the same thing. Actually
1721 \# preferable, since it works with filled and non-filled copy and
1722 \# doesn't require the user to remember to use (or not use) the \c.
1724 .ds TB+ "\c\\R'#TB+ 1'\\R'#TN 1'\\R'#NEXT_TAB \\n[#CURRENT_TAB]+1'\\*[TAB\\n[#NEXT_TAB]]\c
1731 \# Sets #TAB_ACTIVE to "0" (off).
1732 \# Resets left margin to value in effect prior to tabs.
1733 \# Resets line length to value in effect prior to tabs.
1734 \# Checks #QUAD to see if we were in flush or quad mode
1735 \# prior to tabs (0=off, 1=on).
1736 \# Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1737 \# in effect prior to tabs.
1739 \# TQ *must* come before setting any new tabs if you want the
1740 \# tabs' indents measured from page left. Otherwise, the tabs'
1741 \# indents are measured from the left margin of the tab you're
1748 . po \\n[#L_MARGIN]u
1749 . ll \\n[#L_LENGTH]u
1752 . ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1753 . el \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1756 . if '\\*[$RESTORE_QUAD_VALUE]'LEFT' \{ .LEFT \}
1757 . if '\\*[$RESTORE_QUAD_VALUE]'RIGHT' \{ .RIGHT \}
1758 . if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1762 \# ====================================================================
1770 \# <pre-defined NEWCOLOR or XCOLOR>
1772 \# Allows the inline escape for setting color to be called
1787 \# <color name> [<color scheme>] <color definition>
1789 \# Based on .defcolor, allows users to name and define colors using
1790 \# one of the four color schemes rgb, cmy, cmyk and grey. The new
1791 \# color is then defined as a string so that it can be called inline
1792 \# with \*[COLORNAME] or with .COLOR.
1794 \# With only two args, the default color scheme is rgb.
1796 \# It is highly recommended that users define new colors as
1797 \# all-cap strings, to differentiate them from x colors, which must
1798 \# be in lower case.
1801 . if \\n[#NUM_ARGS]=2 \{\
1802 . defcolor \\$1 rgb \\$2
1804 . if \\n[#NUM_ARGS]=3 \{\
1805 . if '\\$2'RGB' .ds $COLOR_SCHEME rgb
1806 . if '\\$2'CYM' .ds $COLOR_SCHEME cym
1807 . if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk
1808 . if '\\$2'GRAY' .ds $COLOR_SCHEME gray
1809 . if '\\$2'GREY' .ds $COLOR_SCHEME gray
1810 . defcolor \\$1 \\*[$COLOR_SCHEME] \\$3
1819 \# <x color name> [<alias>]
1821 \# Defines a string of x color name (i.e. a predefined x
1822 \# color). If <alias> is given, creates a string of <alias name>
1823 \# that references the x color name of the first argument.
1825 \# The color name must be a valid color name from rgb.txt, and
1826 \# must be given entirely in lower case, all one word.
1830 . if \\n[#NUM_ARGS]=2 \{\
1832 . ds $\\$2_FILL \\$1
1836 \# Pre-define xcolors black and white
1843 \# =====================================================================
1845 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1850 \# <none> | <anything>
1852 \# When on, underlines all letters, words, and digits in a passage,
1853 \# ignoring punctuation and spaces.
1855 \# Only for use when the font family is COURIER, to simulate
1856 \# typewriter-style underlining of italic passages.
1860 . nr #UNDERLINE_ON 1
1887 . char \[`A] _
\b\[`A]
1888 . char \[^A] _
\b\[^A]
1889 . char \['A] _
\b\['A]
1890 . char \[:A] _
\b\[:A]
1891 . char \[oA] _
\b\[oA]
1892 . char \[~A] _
\b\[~A]
1893 . char \[AE] _
\b\[AE]
1894 . char \[`E] _
\b\[`E]
1895 . char \[^E] _
\b\[^E]
1896 . char \['E] _
\b\['E]
1897 . char \[:E] _
\b\[:E]
1898 . char \[`I] _
\b\[`I]
1899 . char \[^I] _
\b\[^I]
1900 . char \['I] _
\b\['I]
1901 . char \[:I] _
\b\[:I]
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 \[/O] _
\b\[/O]
1908 . char \[`U] _
\b\[`U]
1909 . char \[^U] _
\b\[^U]
1910 . char \['U] _
\b\['U]
1911 . char \[:U] _
\b\[:U]
1912 . char \[,C] _
\b\[,C]
1913 . char \[-D] _
\b\[-D]
1914 . char \[~N] _
\b\[~N]
1915 . char \[TP] _
\b\[TP]
1916 . char \['Y] _
\b\['Y]
1917 . char \[:Y] _
\b\[:Y]
1944 . char \[`a] _
\b\[`a]
1945 . char \[^a] _
\b\[^a]
1946 . char \['a] _
\b\['a]
1947 . char \[:a] _
\b\[:a]
1948 . char \[oa] _
\b\[oa]
1949 . char \[~a] _
\b\[~a]
1950 . char \[ae] _
\b\[ae]
1951 . char \[`e] _
\b\[`e]
1952 . char \[^e] _
\b\[^e]
1953 . char \['e] _
\b\['e]
1954 . char \[:e] _
\b\[:e]
1955 . char \[`i] _
\b\[`i]
1956 . char \[^i] _
\b\[^i]
1957 . char \['i] _
\b\['i]
1958 . char \[:i] _
\b\[:i]
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 \[/o] _
\b\[/o]
1965 . char \[`u] _
\b\[`u]
1966 . char \[^u] _
\b\[^u]
1967 . char \['u] _
\b\['u]
1968 . char \[:u] _
\b\[:u]
1969 . char \[,c] _
\b\[,c]
1970 . char \[Sd] _
\b\[Sd]
1971 . char \[~n] _
\b\[~n]
1972 . char \[Tp] _
\b\[Tp]
1973 . char \['y] _
\b\['y]
1974 . char \[:y] _
\b\[:y]
1975 . char \[ss] _
\b\[ss]
1989 . nr #UNDERLINE_ON 0
1990 . 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 \
1991 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 \
1992 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1993 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1994 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1995 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1996 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1997 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1998 ' 1 2 3 4 5 6 7 8 9 0
2008 \# Underscores all letters, words, and digits in a passage,
2009 \# ignoring punctuation and spaces.
2011 \# Intended to be called with inline escapes \*[UL] (underline
2012 \# on) and \*[ULX] (underline off). Only works when the font family
2013 \# is fixed width, to simulate typewriter-style underlining of italic
2017 \c\R'#UNDERLINE_ON 1'
2044 . char \[`A] _
\b\[`A]
2045 . char \[^A] _
\b\[^A]
2046 . char \['A] _
\b\['A]
2047 . char \[:A] _
\b\[:A]
2048 . char \[oA] _
\b\[oA]
2049 . char \[~A] _
\b\[~A]
2050 . char \[AE] _
\b\[AE]
2051 . char \[`E] _
\b\[`E]
2052 . char \[^E] _
\b\[^E]
2053 . char \['E] _
\b\['E]
2054 . char \[:E] _
\b\[:E]
2055 . char \[`I] _
\b\[`I]
2056 . char \[^I] _
\b\[^I]
2057 . char \['I] _
\b\['I]
2058 . char \[:I] _
\b\[:I]
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 \[/O] _
\b\[/O]
2065 . char \[`U] _
\b\[`U]
2066 . char \[^U] _
\b\[^U]
2067 . char \['U] _
\b\['U]
2068 . char \[:U] _
\b\[:U]
2069 . char \[,C] _
\b\[,C]
2070 . char \[-D] _
\b\[-D]
2071 . char \[~N] _
\b\[~N]
2072 . char \[TP] _
\b\[TP]
2073 . char \['Y] _
\b\['Y]
2074 . char \[:Y] _
\b\[:Y]
2101 . char \[`a] _
\b\[`a]
2102 . char \[^a] _
\b\[^a]
2103 . char \['a] _
\b\['a]
2104 . char \[:a] _
\b\[:a]
2105 . char \[oa] _
\b\[oa]
2106 . char \[~a] _
\b\[~a]
2107 . char \[ae] _
\b\[ae]
2108 . char \[`e] _
\b\[`e]
2109 . char \[^e] _
\b\[^e]
2110 . char \['e] _
\b\['e]
2111 . char \[:e] _
\b\[:e]
2112 . char \[`i] _
\b\[`i]
2113 . char \[^i] _
\b\[^i]
2114 . char \['i] _
\b\['i]
2115 . char \[:i] _
\b\[:i]
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 \[/o] _
\b\[/o]
2122 . char \[`u] _
\b\[`u]
2123 . char \[^u] _
\b\[^u]
2124 . char \['u] _
\b\['u]
2125 . char \[:u] _
\b\[:u]
2126 . char \[,c] _
\b\[,c]
2127 . char \[Sd] _
\b\[Sd]
2128 . char \[~n] _
\b\[~n]
2129 . char \[Tp] _
\b\[Tp]
2130 . char \['y] _
\b\['y]
2131 . char \[:y] _
\b\[:y]
2132 . char \[ss] _
\b\[ss]
2148 \c\R'#UNDERLINE_ON 0'
2149 . 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 \
2150 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 \
2151 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
2152 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
2153 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
2154 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
2155 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
2156 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
2157 ' 1 2 3 4 5 6 7 8 9 0
2164 \# [<points below baseline>] "text"
2166 \# Places an underscore 2 points under the string if no lead given,
2167 \# otherwise places underscore under string by user specified amount.
2169 \# When using this macro, the string to be underscored must begin
2170 \# with double-quotes ("), regardless of whether it's the sole
2171 \# argument or the second.
2173 \# .UNDERSCORE "Text to be underscored
2175 \# .UNDERSCORE 2p "Text to be underscored
2177 \# All text is underscored (including punctuation and spaces).
2178 \# This is the primary difference between UNDERLINE and
2179 \# UNDERSCORE, aside from the fact the UNDERLINE only works with
2180 \# fixed width fonts.
2182 \# UNDERSCORE does not work across line breaks. Each line of
2183 \# text must be entered separately with UNDERSCORE. If the
2184 \# UNDERSCORE begins in the middle of a line and crosses over a
2185 \# break, the portion before the break must be entered in its own
2186 \# UNDERSCORE, as must the portion that comes after the break.
2189 . nr #SAVED_UNDERSCORE_WEIGHT \\n[#UNDERSCORE_WEIGHT]
2190 . nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ]
2191 . ds $SAVED_UNDERSCORE_GAP \\*[$UNDERSCORE_GAP]
2192 . if \\n[#FROM_BIB_STRING]=1 \{\
2193 . nr #UNDERSCORE_WEIGHT \\n[#BIB_STRING_UNDERLINE_WEIGHT]
2194 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#BIB_STRING_UNDERLINE_WEIGHT_ADJ]
2195 . ds $UNDERSCORE_GAP \\*[$BIB_STRING_UNDERLINE_GAP]
2197 . if \\n[#FROM_COVER]=1 \{\
2198 . nr #UNDERSCORE_WEIGHT \\n[#COVER_UNDERLINE_WEIGHT]
2199 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#COVER_UNDERLINE_WEIGHT_ADJ]
2200 . ds $UNDERSCORE_GAP \\*[$COVER_UNDERLINE_GAP]
2202 . if \\n[#FROM_DOC_COVER]=1 \{\
2203 . nr #UNDERSCORE_WEIGHT \\n[#DOCCOVER_UNDERLINE_WEIGHT]
2204 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#DOCCOVER_UNDERLINE_WEIGHT_ADJ]
2205 . ds $UNDERSCORE_GAP \\*[$DOCCOVER_UNDERLINE_GAP]
2207 . if \\n[#FROM_DOCTYPE]=1 \{\
2208 . nr #UNDERSCORE_WEIGHT \\n[#DOCTYPE_UNDERLINE_WEIGHT]
2209 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#DOCTYPE_UNDERLINE_WEIGHT_ADJ]
2210 . ds $UNDERSCORE_GAP \\*[$DOCTYPE_UNDERLINE_GAP]
2212 . if \\n[#FROM_HEAD]=1 \{\
2213 . nr #UNDERSCORE_WEIGHT \\n[#HEAD_UNDERLINE_WEIGHT]
2214 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#HEAD_UNDERLINE_WEIGHT_ADJ]
2215 . ds $UNDERSCORE_GAP \\*[$HEAD_UNDERLINE_GAP]
2217 . if \\n[#FROM_EN_STRING]=1 \{\
2218 . nr #UNDERSCORE_WEIGHT \\n[#EN_STRING_UNDERLINE_WEIGHT]
2219 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT_ADJ]
2220 . ds $UNDERSCORE_GAP \\*[$EN_STRING_UNDERLINE_GAP]
2222 . if \\n[#FROM_EN_TITLE]=1 \{\
2223 . nr #UNDERSCORE_WEIGHT \\n[#EN_TITLE_UNDERLINE_WEIGHT]
2224 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_TITLE_UNDERLINE_WEIGHT_ADJ]
2225 . ds $UNDERSCORE_GAP \\*[$EN_TITLE_UNDERLINE_GAP]
2227 . ie \\n[#NUM_ARGS]=1 \{\
2228 . nr #TEXT_WIDTH \w'\\$1'
2230 \D't \\n[#UNDERSCORE_WEIGHT]'\
2231 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2232 \v'+(\\*[$UNDERSCORE_GAP])+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2233 \D'l \\n[#TEXT_WIDTH]u 0'\
2234 \D't \\n[#RULE_WEIGHT]'\
2235 \h'-\\n[#RULE_WEIGHT]u'\
2236 \v'-(\\*[$UNDERSCORE_GAP])-\\n[#UNDERSCORE_WEIGHT_ADJ]u'
2239 . nr #TEXT_WIDTH \w'\\$2'
2241 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2242 \v'+(\\$1)+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2243 \D't \\n[#UNDERSCORE_WEIGHT]'\
2244 \D'l \\n[#TEXT_WIDTH]u 0'\
2245 \D't \\n[#RULE_WEIGHT]'\
2246 \h'-\\n[#RULE_WEIGHT]u'\
2247 \v'-(\\$1)-\\n[#UNDERSCORE_WEIGHT_ADJ]u'
2249 . nr #UNDERSCORE_WEIGHT \\n[#SAVED_UNDERSCORE_WEIGHT]
2250 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ]
2251 . ds $UNDERSCORE_GAP \\*[$SAVED_UNDERSCORE_GAP]
2252 . rr #SAVED_UNDERSCORE_WEIGHT
2253 . rr #SAVED_UNDERSCORE_WEIGHT_ADJ
2254 . rm $SAVED_UNDERSCORE_GAP
2258 \# DOUBLE UNDERSCORE
2259 \# -----------------
2261 \# [points below baseline] [points distance between rules] "text"
2263 \# Same as UNDERSCORE, except it produces a double underscore. The default
2264 \# distance between the rules is 2 points.
2266 \# The same double-quote requirement as UNDERSCORE.
2269 .MAC UNDERSCORE2 END
2270 . nr #SAVED_UNDERSCORE_WEIGHT \\n[#UNDERSCORE_WEIGHT]
2271 . nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ]
2272 . ds $SAVED_UNDERSCORE_GAP \\*[$UNDERSCORE_GAP]
2273 . ds $SAVED_RULE_GAP \\*[$RULE_GAP]
2274 . if \\n[#NUM_ARGS]=2 \{\
2275 . ds $UNDERSCORE_GAP \\$1
2277 . if \\n[#NUM_ARGS]=3 \{\
2278 . ds $UNDERSCORE_GAP \\$1
2281 . if \\n[#FROM_BIB_STRING] \{\
2282 . nr #UNDERSCORE_WEIGHT \\n[#BIB_STRING_UNDERLINE_WEIGHT]
2283 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#BIB_STRING_UNDERLINE_WEIGHT_ADJ]
2284 . ds $UNDERSCORE_GAP \\*[$BIB_STRING_UNDERLINE_GAP]
2285 . ds $RULE_GAP \\*[$BIB_STRING_RULE_GAP]
2287 . if \\n[#FROM_EN_STRING] \{\
2288 . nr #UNDERSCORE_WEIGHT \\n[#EN_STRING_UNDERLINE_WEIGHT]
2289 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT_ADJ]
2290 . ds $UNDERSCORE_GAP \\*[$EN_STRING_UNDERLINE_GAP]
2291 . ds $RULE_GAP \\*[$EN_STRING_RULE_GAP]
2293 . if \\n[#NUM_ARGS]=1 \{\
2294 . nr #TEXT_WIDTH \w'\\$1'
2296 \D't \\n[#UNDERSCORE_WEIGHT]'\
2297 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2298 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2299 \D'l \\n[#TEXT_WIDTH]u 0'\
2300 \v'+\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\
2301 \h'-\\n[#TEXT_WIDTH]u'\
2302 \D'l \\n[#TEXT_WIDTH]u 0'\
2303 \D't \\n[#RULE_WEIGHT]'\
2304 \h'-\\n[#RULE_WEIGHT]u'\
2305 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2307 . if \\n[#NUM_ARGS]=2 \{\
2308 . nr #TEXT_WIDTH \w'\\$2'
2310 \D't \\n[#UNDERSCORE_WEIGHT]'\
2311 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2312 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2313 \D'l \\n[#TEXT_WIDTH]u 0'\
2314 \v'+(\\*[$RULE_GAP])+\\n[#UNDERSCORE_WEIGHT]u'\
2315 \h'-\\n[#TEXT_WIDTH]u'\
2316 \D'l \\n[#TEXT_WIDTH]u 0'\
2317 \D't \\n[#RULE_WEIGHT]'\
2318 \h'-\\n[#RULE_WEIGHT]u'\
2319 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])+(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2321 . if \\n[#NUM_ARGS]=3 \{\
2322 . nr #TEXT_WIDTH \w'\\$3'
2324 \D't \\n[#UNDERSCORE_WEIGHT]'\
2325 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2326 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2327 \D'l \\n[#TEXT_WIDTH]u 0'\
2328 \v'+\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\
2329 \h'-\\n[#TEXT_WIDTH]u'\
2330 \D'l \\n[#TEXT_WIDTH]u 0'\
2331 \D't \\n[#RULE_WEIGHT]'\
2332 \h'-\\n[#RULE_WEIGHT]u'\
2333 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2335 . nr #UNDERSCORE_WEIGHT \\n[#SAVED_UNDERSCORE_WEIGHT]
2336 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ]
2337 . ds $UNDERSCORE_GAP \\*[$SAVED_UNDERSCORE_GAP]
2338 . rr #SAVED_UNDERSCORE_WEIGHT
2339 . rr #SAVED_UNDERSCORE_WEIGHT_ADJ
2340 . rm $SAVED_UNDERSCORE_GAP
2341 . rm $SAVED_RULE_GAP
2344 \# Default underscoring rule gaps
2346 .ds $BIB_STRING_UNDERLINE_GAP 2p
2347 .ds $BIB_STRING_RULE_GAP 2p
2348 .ds $COVER_UNDERLINE_GAP 2p
2349 .ds $DOCCOVER_UNDERLINE_GAP 2p
2350 .ds $DOCTYPE_UNDERLINE_GAP 2p
2351 .ds $EN_STRING_UNDERLINE_GAP 2p
2352 .ds $EN_STRING_RULE_GAP 2p
2353 .ds $EN_TITLE_UNDERLINE_GAP 2p
2354 .ds $HEAD_UNDERLINE_GAP 2p
2356 .ds $UNDERSCORE_GAP 2p
2359 \# SUPERSCRIPT INLINES
2360 \# -------------------
2362 \# Prints everything after invocation as superscript.
2364 \# \*[SUP] and \*[SUPX] turn superscript on and off respectively.
2365 \# If running type is pseudo-condensed/expanded, invoke the superscript
2366 \# strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
2367 \# and \*[EXTSUPX] respectively.
2370 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2371 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2372 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.26m'\s[\En[#SUP_PT_SIZE]u]
2374 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.26m'
2377 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2378 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2379 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
2381 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
2384 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2385 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2386 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
2388 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
2397 \# <number of degrees> | RESET
2399 \# Modifies register #DEGREES for use with \*[SLANT], or resets
2400 \# it to the default. Defines string \*[SLANTX]
2402 \# \*[SLANT] permits pseudo-italicizing of a font in cases where
2403 \# no italic font exists in a particular family.
2405 \# Default # of degrees is 15.
2407 \# Do not use unit of measure with arg to SETSLANT.
2409 \# It may be necessary to adjust the spacing on either side of
2410 \# [SLANT] and [SLANTX].
2412 \# In docs, SLANT carries over from para to para.
2415 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2416 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2419 . ie '\\$1'RESET' \{\
2421 . if \\n[#PRINT_STYLE]=1 \{\
2422 . if \\n[#UNDERLINE_SLANT] \{ .return \}
2424 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2428 . if \\n[#PRINT_STYLE]=1 \{\
2429 . if \\n[#UNDERLINE_SLANT] \{ .return \}
2431 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2433 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2443 \# <amount of emboldening> | RESET
2445 \# Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
2446 \# it to the default 700 units.
2448 \# \*[BOLDER] allows pseudo-emboldening of a font where no bold
2449 \# font exists in a particular family.
2451 \# Default for SETBOLDER is 700 units. Do not use unit of measure
2452 \# with arg to SETBOLDER.
2454 .nr #BOLDER_UNITS 700
2457 . if \\n[#IGNORE]=1 \{ .return \}
2458 . ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
2459 . el \{ .nr #BOLDER_UNITS \\$1 \}
2465 .bd \\n(.f \\n[#BOLDER_UNITS]
2474 \# +++CONDENSE/EXTEND+++
2479 \# <percentage to condense/expand type size>
2481 \# Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
2482 \# new point size (for character width) from arg, and defines string
2483 \# COND or EXT, which set the type size to the new character width,
2484 \# and sets the height of type to the value stored in CURRENT_PT_SIZE
2486 \# CONDENSE_OR_EXTEND is invoked from the aliases
2487 \# CONDENSE and EXTEND. CONDENSE implies <100, EXTEND
2488 \# implies >100. Do not use a percent sign in the argument.
2490 \# There is no default setting for CONDENSE or EXTEND.
2491 \# 80 is a good approximation of condensed type, 120 is okay
2494 \# The value set by CONDENSE or EXTEND applies to all
2495 \# subsequent \*[COND] or \*[EXT] escapes until a new value is set.
2497 \# \*[COND] or \*[EXT] must be turned off before all changes of point
2498 \# size and reinvoked afterwards (if so desired). This refers to
2499 \# changes of point size via control lines AND with via inlines.
2501 .MAC CONDENSE_OR_EXTEND END
2502 . if '\\$0'CONDENSE' \{\
2503 . ds $COND_PERCENT \\$1
2504 . if \\n[#PRINT_STYLE]=1 \{\
2506 . ds $COND_PERCENT 100
2509 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2511 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2512 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2514 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2515 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2517 . if '\\$0'EXTEND' \{\
2518 . ds $EXT_PERCENT \\$1
2519 . if \\n[#PRINT_STYLE]=1 \{\
2521 . ds $EXT_PERCENT 100
2524 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2526 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2527 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2529 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2530 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2534 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2535 .ds EXTX \ER'#EXTEND 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2538 \# +++PAD LINES+++ (insert space)
2543 \# <character to use for marking pad points>
2545 \# Defines string $PAD_MARKER, used in PAD
2547 \# $PAD_MARKER is normally # (the pound sign).
2550 . ds $PAD_MARKER \\$1
2557 \# "<string of text with padding markers inserted>"
2559 \# Defines and redefines padding character (default=pound sign
2560 \# unless padding character has been set with PAD_MARKER)
2561 \# several times so that when the string is output at the end
2562 \# of the macro, every # has been converted to an equal-sized
2563 \# amount of padding (blank space) on a line. # is equivalent to
2564 \# CompuGraphic's old <IS>.
2566 \# String tabs may be marked off during PAD.
2569 . if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2571 . if !d$PAD_MARKER .ds $PAD_MARKER #
2572 . char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2573 . ds $FAMILY_FOR_PAD \\n[.fam]
2574 . fp \\n[.fp] \\n[.sty]
2575 . ds $FONT_FOR_PAD \\*[$FONT]
2576 . nr #SIZE_FOR_PAD \\n[.ps]
2577 . ds $PAD_STRING \\$1
2578 . as $PAD_STRING \Ekp
2580 . fam \\*[$FAMILY_FOR_PAD]
2581 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2584 . char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2586 . fam \\*[$FAMILY_FOR_PAD]
2587 \\f]\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2590 . char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2591 . ie \\n[#SILENT] \{\
2593 . fam \\*[$FAMILY_FOR_PAD]
2594 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2599 . fam \\*[$FAMILY_FOR_PAD]
2600 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2603 . if \\n[#FILL_MODE]=1 \{\
2613 . if '\\$2'NOBREAK' \{\
2623 \# The leader mechanism is primitive, but it works. Basically, every
2624 \# macro in this set that includes a line length also sets a single
2625 \# groff tab stop at the right hand end of the line. That way,
2626 \# whenever Ctrl-A is invoked (always at the end of an input line),
2627 \# leader of the correct length gets deposited. Ctrl-A is accessed by
2628 \# the string LEADER (i.e. inline, as \*[LEADER]). Leaders within tabs
2629 \# get their length from the tab line length.
2631 \# SET LEADER CHARACTER
2632 \# --------------------
2634 \# <character to use whenever \*[LEADER] is invoked>
2636 \# Set leader character.
2638 .MAC LEADER_CHARACTER END
2649 \# <family of drop cap>
2651 \# Creates or modifies string $DC_FAM.
2653 .MAC DROPCAP_FAMILY END
2661 \# <font of drop cap>
2663 \# Creates or modifies string $DC_FT.
2665 .MAC DROPCAP_FONT END
2673 \# <pre-defined XCOLOR or NEWCOLOR>
2675 \# Defines string $DC_COLOR to argument.
2677 \# User must define an XCOLOR or NEWCOLOR before using
2680 .MAC DROPCAP_COLOR END
2681 . if \\n[#PRINT_STYLE]=1 \{ .return \}
2690 \# <width of gutter between drop cap and indented text>
2692 \# Creates or modifies register #DC_GUT.
2694 \# Requires unit of measure. Default is 3p.
2696 .MAC DROPCAP_GUTTER END
2704 \# <+|- # of points to in/decrease point size of drop cap letter>
2706 \# Creates or modifies string $DC_ADJUST.
2708 \# Despite its best efforts, DROPCAP doesn't always get the point
2709 \# size of the drop cap critically perfect. DROPCAP_ADJUST lets
2710 \# the user add or subtract points (or fractions of points) to
2711 \# get the size right.
2713 \# Requires the + or - sign.
2715 .MAC DROPCAP_ADJUST END
2716 . ds $DC_ADJUST \\$1
2723 \# <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2725 \# Calculates point size of dropcap based on # of lines passed as
2726 \# arg 2. Sets indent for text based on dropcap width+gutter.
2727 \# Advances and prints dropcap; reverses and prints indented text
2728 \# to bottom of dropcap, then resets indent to left margin (plus
2729 \# any indent that was in effect prior to invoking DROPCAP).
2731 \# Drop caps put a strain on on resource-challenged systems.
2733 \# Drop caps when using the doc processing macro PP only work with
2734 \# initial paragraphs (i.e. at doc start, or after heads), only when
2735 \# DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2736 \# is TYPESET. If these conditions aren't met, DROPCAPS is silently
2739 \# The COND or EXT argument are processed separately from all
2740 \# other COND or EXT inlines or macros, hence passing COND or
2741 \# EXT has no effect on running type.
2744 . if \\n[#IGNORE]=1 \{\
2754 . if \\n[#PRINT_STYLE]=1 \{\
2758 . if \\n[#PRINT_STYLE]=2 \{\
2759 . if \\n[#PP_STYLE]=2 \{\
2771 . nr #DC_LINES \\$2-1
2772 . if \\n[#CONDENSE]=1 \{\
2773 . ds $RESTORE_COND \\*[$COND_PERCENT]
2775 . nr #CONDENSE_WAS_ON 1
2777 . if \\n[#EXTEND]=1 \{\
2778 . ds $RESTORE_EXT \\*[$EXT_PERCENT]
2780 . nr #EXTEND_WAS_ON 1
2782 . if '\\$3'COND' \{ .CONDENSE \\$4 \}
2783 . if '\\$3'EXT' \{ .EXTEND \\$4 \}
2784 . if !r#DC_GUT \{ .nr #DC_GUT (3p) \}
2785 . ds $RESTORE_FAM \\n[.fam]
2786 . ds $RESTORE_FT \\*[$FONT]
2787 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2788 . nr #RESTORE_INDENT \\n(.i
2790 . nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2791 . ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2792 . el \{ .FAM \\*[$DC_FAM] \}
2793 . ie !d$DC_FT \{ .FT \\*[$FONT] \}
2794 . el \{ .FT \\*[$DC_FT] \}
2795 . while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2796 . ps \\n[#PT_SIZE]u+100u
2798 . nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2800 . if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2802 . sp \\n[#DC_LINES]v
2803 . if \\n[#DOCS]=1 \{ .SHIM \}
2804 . ie \\n[#DC_COLOR]=1 \{\
2806 . ie '\\$3'COND' \{ .PRINT \m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[] \}
2807 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[] \}
2809 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2813 . ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2814 . el \{ .PRINT \\*[EXT]\\*[$DROPCAP]\\*[EXTX] \}
2816 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2818 . if '\\$3'COND' \{ \E*[COND] \}
2819 . if '\\$3'EXT' \{ \E*[EXT] \}
2820 . ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2821 . el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2822 . if '\\$3'COND' \{ \E*[CONDX]\c \}
2823 . if '\\$3'EXT' \{ \E*[EXTX]\c \}
2825 . FAM \\*[$RESTORE_FAM]
2826 . FT \\*[$RESTORE_FT]
2827 . ps \\n[#RESTORE_PT_SIZE]u
2828 . if \\n[#CONDENSE_WAS_ON] \{\
2829 . CONDENSE \\*[$RESTORE_COND]
2832 . if \\n[#EXTEND_WAS_ON] \{\
2833 . EXTEND \\*[$RESTORE_EXT]
2836 . ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2837 . el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2838 . rr #CONDENSE_WAS_ON
2846 . rr #RESTORE_PT_SIZE
2847 . rr #RESTORE_INDENT
2853 .MAC DROPCAP_OFF END
2854 ' in \\n[#RESTORE_INDENT]u
2857 \# =====================================================================
2859 \# +++GRAPHICAL OBJECTS+++
2861 \# HORIZONTAL RULE - DRH
2862 \# ---------------------
2864 \# <none> | <rule weight> <indent> <length> [ <color> ]
2866 \# With no arg, draws a full measure rule. With args, draws
2867 \# described horizontal rule.
2869 \# Rules are drawn left-to-right, from the baseline down, and
2870 \# return to their point of origin. Color must be set in the
2871 \# macro; otherwise the color will be black, regardless of current
2872 \# .gcolor. If no arg given, the rule weight is the one set by
2876 . if \\n[.vpt]=1 \{\
2878 . nr #RESTORE_TRAP 1
2880 . ie !\\n[#NO_ADVANCE]=1 \{ .br \}
2887 . nr #FILL_MODE \\n(.j
2891 . if \\n[.ce]>0 \{ .nr #NOFILL_MODE 3 \}
2892 . if \\n[.rj]>0 \{ .nr #NOFILL_MODE 5 \}
2897 . ds $RL_WEIGHT \\$1
2898 . ds $RL_INDENT \\$2
2899 . ds $RL_LENGTH \\$3
2904 . ds $RL_COLOR default
2906 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
2907 . nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
2909 . if \\n[#NUM_ARGS]>=1 \{ .RULE_WEIGHT \\*[$RL_WEIGHT] \}
2911 . gcolor \\*[$RL_COLOR]
2912 . ie \\n[#NUM_ARGS]=0 \{\
2913 . ie \\n[#INDENT_ACTIVE] \{\
2914 . nr #RESTORE_L_LENGTH \\n(.l
2915 . if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2916 . if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2917 \D't \\n[#RULE_WEIGHT]'\
2918 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2919 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2920 \D'l \En(.lu 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\
2921 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2922 \D't \\n[#SAVED_RULE_WEIGHT]'
2923 . ll \\n[#RESTORE_L_LENGTH]u
2924 . rr #RESTORE_L_LENGTH
2927 \D't \\n[#RULE_WEIGHT]'\
2928 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2929 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2930 \D'l \En(.lu 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\
2931 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2932 \D't \\n[#SAVED_RULE_WEIGHT]'
2936 \D't \\n[#RULE_WEIGHT]'\
2937 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2938 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2939 \D'l \\*[$RL_LENGTH] 0'\
2940 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2941 \D't \\n[#SAVED_RULE_WEIGHT]'
2943 . if \\n[#FILLED]=1 \{\
2944 . if \\n[#FILL_MODE]=0 \{ .QUAD LEFT \}
2945 . if \\n[#FILL_MODE]=1 \{ .JUSTIFY \}
2946 . if \\n[#FILL_MODE]=3 \{ .QUAD CENTER \}
2947 . if \\n[#FILL_MODE]=5 \{ .QUAD RIGHT \}
2951 . if \\n[#NOFILL]=1 \{\
2952 . if \\n[#NOFILL_MODE]=3 \{ .CENTER \}
2953 . if \\n[#NOFILL_MODE]=5 \{ .RIGHT \}
2956 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
2957 . nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
2959 . rr #SAVED_WEIGHT_ADJ
2960 . if \\n[#RESTORE_TRAP]=1 \{\
2972 \# Draws a rule the length of the current measure.
2974 \# A convenience macro. DRV does the same thing. Kept in for
2975 \# backward compatibility.
2980 . ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2983 . ie \\n[#INDENT_ACTIVE] \{\
2984 . if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2985 . if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2986 . 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
2988 . rr #RESTORE_L_LENGTH
2991 . 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
2996 . QUAD \\*[$CURRENT_QUAD]
3003 \# VERTICAL RULE - DRV
3004 \# -------------------
3006 \# <rule weight> <indent> <depth> [ <color> ]
3008 \# Draws described vertical rule.
3010 \# Rules are drawn left-to-right, from the baseline down, and
3011 \# return to their point of origin. Color must be set in the
3012 \# macro; otherwise the color will be black, regardless of current
3016 . if \\n[.vpt]=1 \{\
3018 . nr #RESTORE_TRAP 1
3020 . ie !\\n[#NO_ADVANCE]=1 \{ .br \}
3027 . nr #FILL_MODE \\n(.j
3031 . if \\n[.ce]>0 \{ .nr #NOFILL_MODE 3 \}
3032 . if \\n[.rj]>0 \{ .nr #NOFILL_MODE 5 \}
3037 . ds $RL_WEIGHT \\$1
3038 . ds $RL_INDENT \\$2
3044 . ds $RL_COLOR default
3046 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
3047 . nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
3049 . RULE_WEIGHT \\*[$RL_WEIGHT]
3051 . gcolor \\*[$RL_COLOR]
3052 \D't \\n[#RULE_WEIGHT]'\
3053 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT_ADJ]u'\
3054 \D'l 0 \\*[$RL_DEPTH]'\
3055 \D't \\n[#SAVED_RULE_WEIGHT]'
3056 . if \\n[#FILLED]=1 \{\
3057 . if \\n[#FILL_MODE]=0 \{ .QUAD LEFT \}
3058 . if \\n[#FILL_MODE]=1 \{ .JUSTIFY \}
3059 . if \\n[#FILL_MODE]=3 \{ .QUAD CENTER \}
3060 . if \\n[#FILL_MODE]=5 \{ .QUAD RIGHT \}
3064 . if \\n[#NOFILL]=1 \{\
3065 . if \\n[#NOFILL_MODE]=3 \{ .CENTER \}
3066 . if \\n[#NOFILL_MODE]=5 \{ .RIGHT \}
3069 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
3070 . nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
3071 . if \\n[#RESTORE_TRAP]=1 \{\
3080 \# <rule weight | SOLID> <indent> <length> <depth> [ <color> ]
3082 \# Draws described box.
3084 \# Boxes are drawn left-to-right, from the baseline down, and
3085 \# return to their point of origin. Box rules are drawn from the
3086 \# perimeter inwards. Color must be set in the macro; otherwise
3087 \# the color will be black, regardless of current .gcolor. If no
3088 \# arg given, the rule weight is the one set by RULE_WEIGHT.
3091 . if \\n[.vpt]=1 \{\
3093 . nr #RESTORE_TRAP 1
3095 . ie !\\n[#NO_ADVANCE]=1 \{ .br \}
3102 . nr #FILL_MODE \\n(.j
3106 . if \\n[.ce]>0 \{ .nr #NOFILL_MODE 3 \}
3107 . if \\n[.rj]>0 \{ .nr #NOFILL_MODE 5 \}
3112 . ie '\\$1'SOLID' \{\
3116 . ds $BX_WEIGHT \\$1
3118 . ds $BX_INDENT \\$2
3122 . ie d$\\$5_FILL \{\
3123 . ds $BX_COLOR \\*[$\\$5_FILL]
3130 . ds $BX_COLOR default
3132 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
3133 . nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3134 . if !'\\$1'SOLID' \{\
3136 . RULE_WEIGHT \\*[$BX_WEIGHT]
3139 . ds $BX_INDENT \\*[$BX_INDENT]-\\n[#WEIGHT_ADJ]u
3140 . ie \\n[#BX_SOLID]=1 \{\
3141 . fcolor \\*[$BX_COLOR]
3142 \h'\\*[$BX_INDENT]'\
3143 \D'P \\*[$BX_WIDTH] 0 0 \\*[$BX_DEPTH] -\\*[$BX_WIDTH] 0 0 -\\*[$BX_DEPTH]'
3148 . gcolor \\*[$BX_COLOR]
3149 \D't \\n[#RULE_WEIGHT]'\
3150 \h'\\*[$BX_INDENT]'\
3151 \v'\\n[#WEIGHT_ADJ]u'\
3152 \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'\
3153 \v'-\\n[#WEIGHT_ADJ]u'\
3154 \D't \\n[#SAVED_RULE_WEIGHT]'
3158 . if \\n[#FILLED]=1 \{\
3159 . if \\n[#FILL_MODE]=0 \{ .QUAD LEFT \}
3160 . if \\n[#FILL_MODE]=1 \{ .JUSTIFY \}
3161 . if \\n[#FILL_MODE]=3 \{ .QUAD CENTER \}
3162 . if \\n[#FILL_MODE]=5 \{ .QUAD RIGHT \}
3165 . if \\n[#NOFILL]=1 \{\
3166 . if \\n[#NOFILL_MODE]=3 \{ .CENTER \}
3167 . if \\n[#NOFILL_MODE]=5 \{ .RIGHT \}
3169 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
3170 . nr #WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
3172 . rr #SAVED_WEIGHT_ADJ
3173 . if \\n[#RESTORE_TRAP]=1 \{\
3183 \# <rule weight | SOLID> <indent> <width> <depth> [ <color> ]
3185 \# Draws described ellipses.
3187 \# Ellipses (circles) are drawn left-to-right, from the baseline
3188 \# down, and return to their point of origin. Ellipse rules are
3189 \# drawn from the perimeter inwards. Color must be set in the
3190 \# macro; otherwise the color will be black, regardless of current
3191 \# .gcolor. If no arg given, the rule weight is the one set by
3195 . if \\n[.vpt]=1 \{\
3197 . nr #RESTORE_TRAP 1
3199 . ie !\\n[#NO_ADVANCE]=1 \{ .br \}
3206 . nr #FILL_MODE \\n(.j
3210 . if \\n[.ce]>0 \{ .nr #NOFILL_MODE 3 \}
3211 . if \\n[.rj]>0 \{ .nr #NOFILL_MODE 5 \}
3216 . ie '\\$1'SOLID' \{\
3220 . ds $CL_WEIGHT \\$1
3222 . ds $CL_INDENT \\$2
3226 . ie d$\\$5_FILL \{\
3227 . ds $CL_COLOR \\*[$\\$5_FILL]
3234 . ds $CL_COLOR default
3236 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
3237 . nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3238 . if !'\\$1'SOLID' \{\
3240 . RULE_WEIGHT \\*[$CL_WEIGHT]
3243 . ds $CL_INDENT \\*[$CL_INDENT]-\\n[#WEIGHT_ADJ]u
3244 . ie \\n[#CL_SOLID]=1 \{\
3245 . fcolor \\*[$CL_COLOR]
3246 \h'\\*[$CL_INDENT]'\
3247 \v'\\*[$CL_DEPTH]/2u'\
3248 \D'E \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\
3249 \v'-\\*[$CL_DEPTH]/2u'
3254 . gcolor \\*[$CL_COLOR]
3255 \D't \\n[#RULE_WEIGHT]'\
3256 \h'\\*[$CL_INDENT]'\
3257 \v'\\*[$CL_DEPTH]/2u'\
3258 \D'e \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\
3259 \v'-(\\*[$CL_DEPTH]/2u)'\
3260 \D't \\n[#SAVED_RULE_WEIGHT]'
3264 . if \\n[#FILLED]=1 \{\
3265 . if \\n[#FILL_MODE]=0 \{ .QUAD LEFT \}
3266 . if \\n[#FILL_MODE]=1 \{ .JUSTIFY \}
3267 . if \\n[#FILL_MODE]=3 \{ .QUAD CENTER \}
3268 . if \\n[#FILL_MODE]=5 \{ .QUAD RIGHT \}
3271 . if \\n[#NOFILL]=1 \{\
3272 . if \\n[#NOFILL_MODE]=3 \{ .CENTER \}
3273 . if \\n[#NOFILL_MODE]=5 \{ .RIGHT \}
3275 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
3276 . nr #WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
3278 . rr #SAVED_WEIGHT_ADJ
3279 . if \\n[#RESTORE_TRAP]=1 \{\
3289 \# <weight of rules in points>
3291 \# Sets \D't <n>' to the correct number of machine units for the
3292 \# argument given in points.
3294 \# Decimal fractions are allowed. Rule weight must be > 100.
3296 .MAC RULE_WEIGHT END
3297 . di NULL \" Diverted so there's no problem with breaks, spacing, etc.
3300 . if !\B'\\*[$ARG]' \{\
3301 . tm1 "[mom]: The argument to \\$0 must not have a unit of measure appended.
3302 . ab Aborting at \\$0, line \\n[.c].
3304 . length #STR_LENGTH \\$1
3306 . substring $ARG 0 0
3307 . ie '\\*[$ARG]'.' \{\
3309 . substring $ARG 1 \\n[#STR_LENGTH]-1
3310 . nr #WEIGHT \\*[$ARG]*100
3311 . if (\\n[#WEIGHT]>=1000) \{\
3312 . while (\\n[#WEIGHT]>=1000) \{\
3313 . nr #WEIGHT \\n[#WEIGHT]/10
3319 . substring $ARG 1 1
3320 . ie '\\*[$ARG]'.' \{\
3322 . substring $LHS 0 0
3325 . nr #WEIGHT \\*[$LHS]\\*[$RHS]*100
3326 . if (\\n[#WEIGHT]>=10000) \{\
3327 . while (\\n[#WEIGHT]>=10000) \{\
3328 . nr #WEIGHT \\n[#WEIGHT]/10
3333 . ie \\n[#STR_LENGTH]<=2 \{\
3334 . nr #WEIGHT \\$1*1000
3338 . substring $ARG 2 2
3339 . ie !'\\*[$ARG]'.' \{\
3340 . tm1 "[mom]: Invalid argument given to macro \\$0 at line \\n[.c].
3341 . tm1 " Rule weight must be > 100 points.
3342 . tm1 " Falling back to default weight .5 points.
3347 . substring $LHS 0 1
3350 . nr #WEIGHT \\*[$LHS]\\*[$RHS]*1000
3351 . if (\\n[#WEIGHT]>=100000) \{\
3352 . while (\\n[#WEIGHT]>=100000) \{\
3353 . nr #WEIGHT \\n[#WEIGHT]/10
3360 . nr #WEIGHT_ADJ \\n[#WEIGHT]/2
3361 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT' \{\
3362 . nr #BIB_STRING_UNDERLINE_WEIGHT \\n[#WEIGHT]
3363 . nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3365 . if '\\$0'COVER_UNDERLINE_WEIGHT' \{\
3366 . nr #COVER_UNDERLINE_WEIGHT \\n[#WEIGHT]
3367 . nr #COVER_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3369 . if '\\$0'DOCCOVER_UNDERLINE_WEIGHT' \{\
3370 . nr #DOCCOVER_UNDERLINE_WEIGHT \\n[#WEIGHT]
3371 . nr #DOCCOVER_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3373 . if '\\$0'DOCTYPE_UNDERLINE_WEIGHT' \{\
3374 . nr #DOCTYPE_UNDERLINE_WEIGHT \\n[#WEIGHT]
3375 . nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3377 . if '\\$0'ENDNOTE_STRING_UNDERLINE_WEIGHT' \{\
3378 . nr #EN_STRING_UNDERLINE_WEIGHT \\n[#WEIGHT]
3379 . nr #EN_STRING_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3381 . if '\\$0'ENDNOTE_TITLE_UNDERLINE_WEIGHT' \{\
3382 . nr #EN_TITLE_UNDERLINE_WEIGHT \\n[#WEIGHT]
3383 . nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3385 . if '\\$0'FOOTER_RULE_WEIGHT' \{\
3386 . nr #FOOTER_RULE_WEIGHT \\n[#WEIGHT]
3387 . nr #FOOTER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3389 . if '\\$0'FOOTNOTE_RULE_WEIGHT' \{\
3390 . nr #FN_RULE_WEIGHT \\n[#WEIGHT]
3391 . nr #FN_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3393 . if '\\$0'HEAD_UNDERLINE_WEIGHT' \{\
3394 . nr #HEAD_UNDERLINE_WEIGHT \\n[#WEIGHT]
3395 . nr #HEAD_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3397 . if '\\$0'HEADER_RULE_WEIGHT' \{\
3398 . nr #HEADER_RULE_WEIGHT \\n[#WEIGHT]
3399 . nr #HEADER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3401 . if '\\$0'RULE_WEIGHT' \{\
3402 . nr #RULE_WEIGHT \\n[#WEIGHT]
3403 . nr #RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3405 . if '\\$0'UNDERSCORE_WEIGHT' \{\
3406 . nr #UNDERSCORE_WEIGHT \\n[#WEIGHT]
3407 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3414 .ALIAS BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT RULE_WEIGHT
3415 .ALIAS COVER_UNDERLINE_WEIGHT RULE_WEIGHT
3416 .ALIAS DOCCOVER_UNDERLINE_WEIGHT RULE_WEIGHT
3417 .ALIAS DOCTYPE_UNDERLINE_WEIGHT RULE_WEIGHT
3418 .ALIAS ENDNOTE_STRING_UNDERLINE_WEIGHT RULE_WEIGHT
3419 .ALIAS ENDNOTE_TITLE_UNDERLINE_WEIGHT RULE_WEIGHT
3420 .ALIAS FOOTER_RULE_WEIGHT RULE_WEIGHT
3421 .ALIAS FOOTNOTE_RULE_WEIGHT RULE_WEIGHT
3422 .ALIAS HEAD_UNDERLINE_WEIGHT RULE_WEIGHT
3423 .ALIAS HEADER_RULE_WEIGHT RULE_WEIGHT
3424 .ALIAS UNDERSCORE_WEIGHT RULE_WEIGHT
3426 \# Default rule weights
3427 \# ~~~~~~~~~~~~~~~~~~~~
3428 .nr #BIB_STRING_UNDERLINE_WEIGHT 500
3429 .nr #COVER_UNDERLINE_WEIGHT 500
3430 .nr #DOCCOVER_UNDERLINE_WEIGHT 500
3431 .nr #DOCTYPE_UNDERLINE_WEIGHT 500
3432 .nr #EN_STRING_UNDERLINE_WEIGHT 500
3433 .nr #EN_TITLE_UNDERLINE_WEIGHT 500
3434 .nr #FN_RULE_WEIGHT 500
3435 .nr #FOOTER_RULE_WEIGHT 500
3436 .nr #HEAD_UNDERLINE_WEIGHT 500
3437 .nr #HEADER_RULE_WEIGHT 500
3438 .nr #RULE_WEIGHT 500
3439 .nr #UNDERSCORE_WEIGHT 500
3441 .nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \\n[#BIB_STRING_UNDERLINE_WEIGHT]/2
3442 .nr #COVER_UNDERLINE_WEIGHT_ADJ \\n[#DOCTYPE_UNDERLINE_WEIGHT]/2
3443 .nr #DOCCOVER_UNDERLINE_WEIGHT_ADJ \\n[#DOCTYPE_RULE_WEIGHT]/2
3444 .nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ \\n[#DOCTYPE_RULE_WEIGHT]/2
3445 .nr #EN_STRING_UNDERLINE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT]/2
3446 .nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT]/2
3447 .nr #FOOTER_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT]/2
3448 .nr #FN_RULE_WEIGHT_ADJ \\n[#FN_RULE_WEIGHT]/2
3449 .nr #HEAD_UNDERLINE_WEIGHT_ADJ \\n[#HEAD_UNDERLINE_WEIGHT]/2
3450 .nr #HEADER_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT]/2
3451 .nr #RULE_WEIGHT_ADJ \\n[#RULE_WEIGHT]/2
3452 .nr #UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT]/2
3454 \# Set default rule weight
3460 \# =====================================================================
3462 \# +++WORD AND SENTENCE SPACING+++
3464 \# WORD SPACE CONTROL
3465 \# ------------------
3467 \# <+|->wordspace | DEFAULT
3469 \# Increases or decreases interword space by user supplied amount.
3470 \# If DEFAULT, value is set to 12 (groff default).
3472 \# $WS_CONSTANT is the groff default word space.
3473 \# $WS_VAR is the user supplied amount by which to in/decrease word space.
3474 \# $WS is a concatenation of WS_CONSTANT and WS_VAR.
3476 \# Because the user supplied value requires a literal + or - sign,
3477 \# the macro argument is stored in a string.
3479 \# \n[.sss] holds the current sentence space value.
3482 . ds $WS_CONSTANT 12
3484 . ie '\\$1'DEFAULT' .ds $WS_VAR +0
3485 . el .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR])
3486 . ie \\n[.sss]=12 \{ .ss \\*[$WS] 12 \}
3488 . ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
3494 \# SENTENCE SPACE CONTROL
3495 \# ----------------------
3497 \# <+-sentencespace> | 0 | DEFAULT
3499 \# Increases or decreases sentence space by user supplied amount.
3500 \# If 0, sentence spaces are ignored. If DEFAULT, value is
3501 \# set to 12 (groff default).
3503 \# Because the user supplied value requires a literal + or - sign,
3504 \# the macro argument is stored in a string.
3506 \# Sentence space applies only to input where sentences are separated
3507 \# by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
3508 \# Changing .SS when sentences are separated by only one space has
3509 \# no effect on the space between sentences.
3511 \# \n[.ss] holds the current wordspace value.
3512 \# \n[.sss] holds the current sentence space value.
3515 . ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
3517 . ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
3520 . ss \\n[.ss] (0\\*[$SS_VAR])
3526 \# =====================================================================
3530 \# There are five styles of indents: left, right, both, temporary,
3531 \# and hanging. Each is set/invoked with a different macro.
3532 \# Indent macros begin with the letter "I", hence .IL means "indent left,"
3533 \# .IR means "indent right," and so on.
3535 \# The first time any of the indent macros is used, it requires an
3536 \# argument--the size of the indent (with a unit of measure). The
3537 \# size may also be entered using the \w escape--very useful
3538 \# for numbered lists using HI. The unit of measure is required.
3539 \# Subsequent invocations don't require the argument; the indent
3540 \# measure remains the same until it's changed by invoking the macro
3541 \# with an argument again.
3543 \# If no indents are in effect, the arguments passed to indent macros are
3544 \# measured from the left and right margins of the page. If a left indent
3545 \# or a right indent is already in effect, the arguments passed to
3546 \# the indent macros are calculated from the current values; in other words,
3547 \# the arguments are additive. If you quit an indent and later return
3548 \# to it, its value will be the value last in effect, unless you pass
3549 \# it an argument. If you do pass an argument, it is added to the last
3550 \# value in effect, unless you cleared the indent with one of
3551 \# .I<LRB>X/Q macros.
3565 \# The first .IL 2P indents text 2P from the left margin. The second
3566 \# .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
3567 \# .IQ turns the indent off. The last .IL (which has no argument)
3568 \# takes its value from the total of all arguments passed to .IL (in
3569 \# this case, 2P and 2P), therefore it indents 2P+2P from the left
3570 \# margin, i.e. 4P. If you wanted the last .IL to indent just 2P,
3571 \# you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
3572 \# the last .IL the argument 2P.
3574 \# To reverse the sense of an indent added to an indent, you may use
3577 \# Indents can be turned off individually with ILX, IRX, and IBX.
3578 \# LEFT and RIGHT indents may be combined and manipulated
3579 \# separately, (e.g. you can have an IL of 2P and an IR of 4P
3580 \# operative at the same time, and then change, say, the IL to
3581 \# 4P--thereby left indenting 6P--while the IR remains at 4P.
3583 \# IB automatically turns off IL and IR. They have to be reinvoked
3584 \# again when needed. IL and IR automatically turn IB off; it, too,
3585 \# has to be reinvoked with needed.
3587 \# All indents can be turned off at once with IQ. The ILX, IRX, IBX,
3588 \# and IQ macros simply turn the indents off; the values stored in
3589 \# the respective indent macros (IL, IR, IB) remain in effect. If
3590 \# the user wishes to clear the values, the I<LRB>X macros should be
3591 \# invoked with the single argument CLEAR. IQ CLEAR clears out
3592 \# the values stored for all indent styles.
3594 \# Indents *must* be turned off before settting string tabs
3595 \# inside PAD. Generally, in order not to get confused, it's a
3596 \# good idea to turn all indents off before setting any tabs.
3598 \# TI and HI are special cases. There's no need to turn them off,
3599 \# since they affect only one line--the first after their
3600 \# invocation. Like the other indent styles, the first time
3601 \# they're invoked, they require a value in iPpcm; each subsequent
3602 \# invocation without an argument will use the same value. To
3603 \# change the value, simply pass a new value. Values for TI and HI
3604 \# are *not* additive.
3606 \# HI presupposes that you already have a left or both indent on.
3607 \# HI will never hang a line outside the left margin of a document
3608 \# or column. In other words, you must have IL or IB on before you
3615 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
3616 . nr #INDENT_STYLE_LEFT 1
3617 . nr #INDENT_ACTIVE 1
3618 . nr #INDENT_LEFT_ACTIVE 1
3621 . in \\n[#L_INDENT]u
3622 . ta \\n(.lu-\\n[#L_INDENT]u
3626 . nr #L_INDENT +(\\$1)
3627 . in \\n[#L_INDENT]u
3628 . ta \\n(.lu-\\n[#L_INDENT]u
3633 \# +++INDENT RIGHT+++
3636 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
3637 . nr #INDENT_STYLE_RIGHT 1
3638 . nr #INDENT_ACTIVE 1
3639 . nr #INDENT_RIGHT_ACTIVE 1
3642 . ie \\n[#TAB_ACTIVE] \{\
3643 . ll \\n(.lu-\\n[#R_INDENT]u
3644 . ta \\n(.lu-\\n[#L_INDENT]u
3647 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
3648 . ta \\n(.lu-\\n[#L_INDENT]u
3653 . nr #R_INDENT +(\\$1)
3654 . ie \\n[#TAB_ACTIVE] \{\
3655 . ll \\n(.lu-\\n[#R_INDENT]u
3656 . ta \\n(.lu-\\n[#L_INDENT]u
3659 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
3660 . ta \\n(.lu-\\n[#L_INDENT]u
3666 \# +++INDENT BOTH+++
3669 . if \\n[#INDENT_STYLE_LEFT] \{ .ILX \}
3670 . if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
3671 . nr #INDENT_STYLE_BOTH 1
3672 . nr #INDENT_ACTIVE 1
3673 . nr #INDENT_BOTH_ACTIVE 1
3676 . in \\n[#BL_INDENT]u
3677 . ie \\n[#TAB_ACTIVE] \{\
3678 . ll \\n(.lu-\\n[#BR_INDENT]u
3679 . ta \\n(.lu-\\n[#BR_INDENT]u
3682 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
3683 . ta \\n(.lu-\\n[#BR_INDENT]u
3688 . nr #BL_INDENT (\\n[#INDENT]+\\$1)
3689 . ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
3690 . el \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
3691 . ie \\n[#TAB_ACTIVE] \{\
3692 . in \\n[#BL_INDENT]u
3693 . ll \\n(.lu-\\n[#BR_INDENT]u
3694 . ta \\n(.lu-\\n[#BL_INDENT]u
3697 . in \\n[#BL_INDENT]u
3698 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
3699 . ta \\n(.lu-\\n[#BR_INDENT]u
3705 \# +++TEMPORARY INDENT+++
3710 . ti \\n[#T_INDENT]u
3711 . if \\n[#INDENT_LEFT_ACTIVE] \{\
3712 . ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
3714 . if \\n[#INDENT_BOTH_ACTIVE] \{\
3715 . ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
3719 . nr #T_INDENT (\\$1)
3720 . ti \\n[#T_INDENT]u
3725 \# +++HANGING INDENT+++
3728 . ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
3730 . nr #HL_INDENT (\\$1)
3731 . ti -\\n[#HL_INDENT]u
3736 \# +++INDENTS OFF+++
3741 . rr #INDENT_LEFT_ACTIVE
3742 . if '\\$1'CLEAR' \{\
3744 . rr #INDENT_STYLE_LEFT
3751 . rr #INDENT_RIGHT_ACTIVE
3752 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3754 . ie \\n[#COLUMNS] \{\
3755 . ll \\n[#COL_L_LENGTH]u
3759 . ll \\n[#L_LENGTH]u
3763 . if '\\$1'CLEAR' \{\
3765 . rr #INDENT_STYLE_RIGHT
3773 . rr #INDENT_BOTH_ACTIVE
3774 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3776 . ie \\n[#COLUMNS] \{\
3777 . ll \\n[#COL_L_LENGTH]u
3781 . ll \\n[#L_LENGTH]u
3785 . if '\\$1'CLEAR' \{\
3788 . rr #INDENT_STYLE_BOTH
3795 . if !\\n[#IX_WARN] \{\
3796 . tm1 "[mom]: Use of .IX is now deprecated. Use .IQ instead.
3797 . tm1 " .IX will continue to behave as before, but to
3798 . tm1 " avoid this message, please update your document.
3804 . rr #INDENT_LEFT_ACTIVE
3805 . rr #INDENT_RIGHT_ACTIVE
3806 . rr #INDENT_BOTH_ACTIVE
3807 . if \\n[#INDENT_STYLE_RIGHT] \{\
3808 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3810 . ie \\n[#COLUMNS] \{\
3811 . ll \\n[#COL_L_LENGTH]u
3815 . ll \\n[#L_LENGTH]u
3820 . if \\n[#INDENT_STYLE_BOTH] \{\
3821 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3823 . ie \\n[#COLUMNS] \{\
3824 . ll \\n[#COL_L_LENGTH]u
3828 . ll \\n[#L_LENGTH]u
3833 . if '\\$1'CLEAR' \{\
3834 . if \\n[#INDENT_STYLE_RIGHT] \{\
3835 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3837 . ie \\n[#COLUMNS] \{\
3838 . ll \\n[#COL_L_LENGTH]u
3842 . ll \\n[#L_LENGTH]u
3847 . if \\n[#INDENT_STYLE_BOTH] \{\
3848 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
3850 . ie \\n[#COLUMNS] \{\
3851 . ll \\n[#COL_L_LENGTH]u
3855 . ll \\n[#L_LENGTH]u
3866 . rr #INDENT_STYLE_LEFT
3867 . rr #INDENT_STYLE_RIGHT
3868 . rr #INDENT_STYLE_BOTH
3873 \# =====================================================================
3875 \# +++MULTIPLE COLUMNS+++
3877 \# MULTIPLE COLUMNS ON
3878 \# -------------------
3882 \# Marks the top of a column set
3888 \# MULTIPLE COLUMN RETURN
3889 \# ----------------------
3893 \# Returns to the top of a column set
3901 \# MULTIPLE COLUMNS OFF
3902 \# --------------------
3904 \# <none> | <lead to advance beneath bottom of deepest column>
3906 \# Advances to the end of a column set
3908 \# With no argument, advances to the next baseline (at the current
3909 \# leading value) beneath the longest column. With an argument
3910 \# (which requires a unit of measure), advances arg distance
3911 \# beneath the baseline of the deepest column. If the argument
3912 \# is zero, advances to the baseline of the deepest column.
3921 . nr #MCX_ALD (\\$1)
3923 . ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
3924 . el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
3930 \# =====================================================================
3932 \# +++TYPESETTING SUPPORT MACROS+++
3939 \# Enables/disables traps.
3941 \# EL and TN don't function as advertised on the last line before
3942 \# a trap (when they break the preceding line, they spring the
3943 \# trap, and groff won't back up to the line preceding the trap).
3944 \# TRAP is a kludge to get EL and TN work properly on last lines.
3945 \# The user simply enloses the offending lines in TRAP OFF/TRAP.
3948 . ie '\\$1'' \{ .vpt 1 \}
3956 \# <none> | <anything>
3958 \# Diverts text so that it doesn't print, or turns the function off.
3960 \# Useful for setting up autotabs where you don't want the line with
3961 \# the tab marks to print.
3963 \# Also aliased as COMMENT, in case user wants to input a batch of
3964 \# text that doesn't print.
3968 . if \\n[#QUAD] \{ .br \}
3969 . ie '\\$1'' \{ .di NO_FLASH \}
3982 \# Prints anything. A macro that helps keep my code nicely indented.
3992 \# <none> | <anything>
3994 \# Converts text to caps, or, if OFF, reverts to normal caps/lc.
3996 \# For inline control of capitalization style, use \*[UC] and
4001 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
4036 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
4074 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
4111 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
4151 \# Gets cap-height, x-height, and descender depth of the
4152 \# current font at the current point size.
4154 \# The routine is diverted so it remains invisible to output.
4158 E\\R'#CAP_HEIGHT \\n[.cht]'
4159 e\\R'#X_HEIGHT \\n[.cht]'
4160 y\\R'#DESCENDER \\n[.cdp]'
4165 \# =====================================================================
4167 \# +++TYPESETTING ALIASES+++
4169 .ALIAS ADD_SPACE ALD
4170 .ALIAS CENTRE CENTER
4172 .ALIAS COMMENT SILENT
4173 .ALIAS CONDENSE CONDENSE_OR_EXTEND
4174 .ALIAS EXTEND CONDENSE_OR_EXTEND
4178 .ALIAS HYPHENATION HY
4184 .ALIAS LIG LIGATURES
4185 .ALIAS NEWCOLOUR NEWCOLOR
4186 .ALIAS PADMARKER PAD_MARKER
4189 .ALIAS TABSET TAB_SET
4191 .ALIAS UNDERSCORE_2 UNDERSCORE2
4192 .ALIAS XCOLOUR XCOLOR
4195 \# ====================================================================
4197 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
4198 \# ===============================================
4200 \# +++PAGE DIMENSIONS+++
4205 \# LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
4207 \# Sets up dimensions for different paper sizes.
4211 . if '\\*[$PAPER]'LETTER' \{\
4215 . if '\\*[$PAPER]'LEGAL' \{\
4219 . if '\\*[$PAPER]'STATEMENT' \{\
4223 . if '\\*[$PAPER]'TABLOID' \{\
4227 . if '\\*[$PAPER]'LEDGER' \{\
4231 . if '\\*[$PAPER]'FOLIO' \{\
4235 . if '\\*[$PAPER]'QUARTO' \{\
4239 . if '\\*[$PAPER]'10x14' \{\
4243 . if '\\*[$PAPER]'EXECUTIVE' \{\
4247 . if '\\*[$PAPER]'A3' \{\
4251 . if '\\*[$PAPER]'A4' \{\
4255 . if '\\*[$PAPER]'A5' \{\
4259 . if '\\*[$PAPER]'B4' \{\
4263 . if '\\*[$PAPER]'B5' \{\
4267 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
4268 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
4272 \# ====================================================================
4274 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
4279 \# TYPESET | TYPEWRITE [SINGLESPACE]
4281 \# Sets type specs for typewriter-style or typeset output.
4283 \# Number registers: TYPEWRITE=1, TYPESET=2.
4286 . if !\\n[#COLLATE]=1 \{\
4287 . if !d$PAPER \{ .PAPER LETTER \}
4288 . if '\\$1'TYPEWRITE' \{\
4290 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
4291 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
4294 . ie '\\$2'SINGLESPACE' \{\
4295 . nr #SINGLE_SPACE 1
4297 . nr #ORIGINAL_DOC_LEAD \\n(.v
4301 . nr #ORIGINAL_DOC_LEAD \\n(.v
4306 . if !\\n[#PP_INDENT] \{\
4307 . in 3P \"Set indent
4308 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
4309 . in 0 \"Remove indent
4312 . nr #BOLDER_UNITS 0
4315 . if !\\n[#ITALIC_MEANS_ITALIC] \{ .rm IT \}
4318 . if !\\n[#ITALIC_MEANS_ITALIC] \{ .rm PREV \}
4319 . if !\\n[#SLANT_MEANS_SLANT] \{ .UNDERLINE_SLANT \}
4320 . if !\\n[#ITALIC_MEANS_ITALIC] \{ .UNDERLINE_ITALIC \}
4321 . if !\\n[#UNDERLINE_QUOTES] \{ .UNDERLINE_QUOTES \}
4322 . nr #IGNORE_COLUMNS 1
4323 . nr #RULE_WEIGHT 500
4324 . nr #HEAD_UNDERLINE_WEIGHT 500
4328 . if '\\$1'TYPESET' \{\
4330 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
4331 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
4334 . if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
4335 . if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
4343 . if !\\n[#PP_INDENT] \{\
4344 . in 2m \"Set indent
4345 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
4346 . in 0 \"Remove indent
4349 . rr #IGNORE_COLUMNS
4355 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
4357 \# First, a little utility macro.
4366 \# ITALIC MEANS ITALIC
4367 \# -------------------
4371 \# Instructs TYPEWRITE to treat italics as italics, whether
4372 \# invoked via control lines or inline.
4374 \# ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
4375 \# hence invoking the one automatically turns off the other.
4377 .MAC ITALIC_MEANS_ITALIC END
4378 . if \\n[#PRINT_STYLE]=1 \{\
4379 . nr #ITALIC_MEANS_ITALIC 1
4380 . rr #UNDERLINE_ITALIC
4396 \# Instructs TYPEWRITE to underline italics, whether invoked
4397 \# via control lines or inline.
4399 \# UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
4400 \# hence invoking the one automatically turns off the other.
4402 \# UNDERLINE_ITALIC is the default for TYPEWRITE.
4404 .MAC UNDERLINE_ITALIC END
4405 . if \\n[#PRINT_STYLE]=1 \{\
4406 . nr #UNDERLINE_ITALIC 1
4407 . rr #ITALIC_MEANS_ITALIC
4421 \# <none> | <anything>
4423 \# Instructs TYPEWRITE to underline occurences of \*[SLANT], or
4424 \# turns feature off.
4426 \# Users may want \*[SLANT] to mean slant in TYPEWRITE, although
4427 \# most of the time, \*[SLANT] most likely means the user wanted
4428 \# italic but didn't have it, ergo the need to tell TYPEWRITE to
4429 \# treat \*[SLANT] as italic (i.e. underlined).
4431 \# UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
4432 \# hence invoking the one automatically turns off the other.
4434 \# UNDERLINE_SLANT is the default for TYPEWRITE.
4436 .MAC UNDERLINE_SLANT END
4437 . if \\n[#PRINT_STYLE]=1 \{\
4438 . rr #SLANT_MEANS_SLANT
4439 . nr #UNDERLINE_SLANT 1
4442 . ds SLANT \ER'#SLANT_ON 1'\E*[UL]
4443 . ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
4448 .MAC SLANT_MEANS_SLANT END
4449 . if \\n[#PRINT_STYLE]=1 \{\
4450 . rr #UNDERLINE_SLANT
4451 . nr #SLANT_MEANS_SLANT 1
4454 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
4455 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
4460 .MAC IGNORE_COLUMNS END
4461 . if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
4465 \# ====================================================================
4467 \# +++COPY STYLE -- DRAFT OR FINAL+++
4474 \# Sets registers that are used to determine what to put
4475 \# in the default header, and how to number pages.
4477 \# DOCTYPE must come before COPYSTYLE.
4480 . ds $COPY_STYLE \\$1
4481 . if '\\*[$COPY_STYLE]'DRAFT' \{\
4483 . if !d$DRAFT \{ .DRAFT 1 \}
4485 . if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2 \}
4486 . if !d$CHAPTER_STRING \{ .CHAPTER_STRING "Chapter" \}
4487 . if !d$DRAFT_STRING \{ .DRAFT_STRING "Draft" \}
4488 . if !d$REVISION_STRING \{ .REVISION_STRING "Rev." \}
4490 . if \\n[#DOC_TYPE]=1 \{\
4491 . ie \\n[#COPY_STYLE]=1 \{\
4492 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4493 . el \{ .PAGENUM_STYLE roman \}
4494 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4495 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
4499 . ie '\\*[$REVISION]'' \{\
4500 . ds $HDRFTR_CENTER \
4501 \\*[$DRAFT_STRING]\\*[$DRAFT]
4504 . ds $HDRFTR_CENTER \
4505 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4506 \\*[$REVISION_STRING] \\*[$REVISION]
4512 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4513 . el \{ .PAGENUM_STYLE DIGIT \}
4514 . if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
4515 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4517 . rr #USER_DEF_HDRFTR_CENTER
4522 . if \\n[#DOC_TYPE]=2 \{\
4524 . ie \\n[#COPY_STYLE]=1 \{\
4525 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4526 . el \{ .PAGENUM_STYLE roman \}
4527 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4528 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
4529 . ie '\\*[$CHAPTER]'' \{\
4530 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4531 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4533 . el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
4536 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4537 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4539 . el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4543 . ie '\\*[$REVISION]'' \{\
4544 . ie '\\*[$CHAPTER]'' \{\
4545 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4546 . ie '\\*[$DRAFT]'' \{\
4547 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4550 . ds $HDRFTR_CENTER \
4551 \\*[$CHAPTER_TITLE], \
4552 \\*[$DRAFT_STRING]\\*[$DRAFT]
4556 . ie '\\*[$DRAFT]'' \{\
4557 . ds $HDRFTR_CENTER \
4558 \\*[$CHAPTER_STRING]
4561 . ds $HDRFTR_CENTER \
4562 \\*[$CHAPTER_STRING], \
4563 \\*[$DRAFT_STRING]\\*[$DRAFT]
4568 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4569 . ie '\\*[$DRAFT]'' \{\
4570 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4573 . ds $HDRFTR_CENTER \
4574 \\*[$CHAPTER_TITLE_1], \
4575 \\*[$DRAFT_STRING]\\*[$DRAFT]
4579 . ie '\\*[$DRAFT]'' \{\
4580 . ds $HDRFTR_CENTER \
4581 \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4584 . ds $HDRFTR_CENTER \
4585 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4586 \\*[$DRAFT_STRING]\\*[$DRAFT]
4592 . ie '\\*[$CHAPTER]'' \{\
4593 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4594 . ie '\\*[$DRAFT]'' \{\
4595 . ds $HDRFTR_CENTER \
4596 \\*[$CHAPTER_TITLE], \
4597 \\*[$REVISION_STRING] \\*[$REVISION]
4600 . ds $HDRFTR_CENTER \
4601 \\*[$CHAPTER_TITLE], \
4602 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4603 \\*[$REVISION_STRING] \\*[$REVISION]
4607 . ie '\\*[$DRAFT]'' \{\
4608 . ds $HDRFTR_CENTER \
4609 \\*[$CHAPTER_STRING], \
4610 \\*[$REVISION_STRING] \\*[$REVISION]
4613 . ds $HDRFTR_CENTER \
4614 \\*[$CHAPTER_STRING], \
4615 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4616 \\*[$REVISION_STRING] \\*[$REVISION]
4621 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4622 . ie '\\*[$DRAFT]'' \{\
4623 . ds $HDRFTR_CENTER \
4624 \\*[$CHAPTER_TITLE], \
4625 \\*[$REVISION_STRING] \\*[$REVISION]
4628 . ds $HDRFTR_CENTER \
4629 \\*[$CHAPTER_TITLE], \
4630 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4631 \\*[$REVISION_STRING] \\*[$REVISION]
4635 . ie '\\*[$DRAFT]'' \{\
4636 . ds $HDRFTR_CENTER \
4637 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4638 \\*[$REVISION_STRING] \\*[$REVISION]
4641 . ds $HDRFTR_CENTER \
4642 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4643 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4644 \\*[$REVISION_STRING] \\*[$REVISION]
4654 . if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
4655 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4656 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4657 . el \{ .PAGENUM_STYLE DIGIT \}
4658 . ie '\\*[$CHAPTER]'' \{\
4659 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4660 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4663 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
4667 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4668 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4671 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4678 . if \\n[#DOC_TYPE]=3 \{\
4679 . ie \\n[#COPY_STYLE]=1 \{\
4680 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4681 . el \{ .PAGENUM_STYLE roman \}
4682 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
4683 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4686 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4687 . ie '\\*[$REVISION]'' \{\
4688 . ie '\\*[$DRAFT]'' \{\
4689 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4692 . ds $HDRFTR_CENTER \
4694 \\*[$DRAFT_STRING]\\*[$DRAFT]
4698 . ie '\\*[$DRAFT]'' \{\
4699 . ds $HDRFTR_CENTER \
4701 \\*[$REVISION_STRING] \\*[$REVISION]
4704 . ds $HDRFTR_CENTER \
4706 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4707 \\*[$REVISION_STRING] \\*[$REVISION]
4714 . if r#DRAFT_WITH_PAGENUM \{ .rr #DRAFT_WITH_PAGENUM \}
4715 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4716 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
4717 . el \{ .PAGENUM_STYLE DIGIT \}
4718 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4724 \# ====================================================================
4726 \# +++COLLECT DOC INFO -- STRINGS AND REGISTERS FOR REFERENCE MACROS+++
4729 \# various string/register arguments
4731 \# Collect information about documents.
4736 . nr #DOCTITLE_NUM 0 1
4737 . while \\n[#NUM_ARGS]>\\n[#DOCTITLE_NUM] \{\
4738 . ds $DOC_TITLE_\\n+[#DOCTITLE_NUM] \\$\\n[#DOCTITLE_NUM]
4740 . ds $DOC_TITLE \\$*
4743 .MAC TITLE END \"Document title
4744 . ie \\n[#NUM_ARGS]=0 \{\
4745 . if \\n[#TITLE_NUM] \{\
4747 . while \\n[#TITLE_NUM]>\\n[#ITEM] \{\
4748 . rm $TITLE_\\n+[#ITEM]
4755 . while \\n[#NUM_ARGS]>\\n[#TITLE_NUM] \{\
4756 . ds $TITLE_\\n+[#TITLE_NUM] \\$\\n[#TITLE_NUM]
4763 .MAC SUBTITLE END \"Document sub-title
4764 . ie \\n[#NUM_ARGS]=0 \{\
4765 . if \\n[#SUBTITLE_NUM] \{\
4767 . while \\n[#SUBTITLE_NUM]>\\n[#ITEM] \{\
4768 . rm $SUBTITLE_\\n+[#ITEM]
4775 . if '\\$1'DOC_COVER' \{\
4777 . nr #SUBTITLE_DOCCOVER_NUM 0 1
4778 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_DOCCOVER_NUM] \{\
4779 . ds $SUBTITLE_DOCCOVER_\\n+[#SUBTITLE_DOCCOVER_NUM] \\$\\n[#SUBTITLE_DOCCOVER_NUM]
4783 . if '\\$1'COVER' \{\
4785 . nr #SUBTITLE_COVER_NUM 0 1
4786 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_COVER_NUM] \{\
4787 . ds $SUBTITLE_COVER_\\n+[#SUBTITLE_COVER_NUM] \\$\\n[#SUBTITLE_COVER_NUM]
4791 . nr #SUBTITLE_NUM 0 1
4792 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_NUM] \{\
4793 . ds $SUBTITLE_\\n+[#SUBTITLE_NUM] \\$\\n[#SUBTITLE_NUM]
4800 .MAC CHAPTER END \"If document is a chapter, the chapter number
4801 . nr #CHAPTER_CALLED 1
4804 . if \B'\\*[$CHAPTER]' \{\
4805 . nr #CH_NUM \\*[$CHAPTER]
4811 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
4812 . ie \\n[#NUM_ARGS]=0 \{\
4813 . if \\n[#CHAPTER_TITLE_NUM] \{\
4815 . while \\n[#CHAPTER_TITLE_NUM]>\\n[#ITEM] \{\
4816 . rm $CHAPTER_TITLE_\\n+[#ITEM]
4818 . rr #CHAPTER_TITLE_NUM
4823 . rr #CHAPTER_TITLE_NUM
4824 . nr #CHAPTER_TITLE_NUM 0 1
4825 . while \\n[#NUM_ARGS]>\\n[#CHAPTER_TITLE_NUM] \{\
4826 . ds $CHAPTER_TITLE_\\n+[#CHAPTER_TITLE_NUM] \\$\\n[#CHAPTER_TITLE_NUM]
4828 . ds $CHAPTER_TITLE \\$*
4833 .MAC DRAFT END \"Draft number
4834 . ie '\\$1'' .ds $DRAFT
4835 . el .ds $DRAFT " \\$1
4839 .MAC REVISION END \"Revision number
4844 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
4845 . nr #DRAFT_WITH_PAGENUM 1
4849 .MAC AUTHOR END \"Author. Enclose all args fully in double quotes.
4850 . if '\\$1'DOC_COVER' \{\
4852 . nr #AUTHOR_DOCCOVER_NUM 0 1
4853 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_DOCCOVER_NUM] \{\
4854 . ds $AUTHOR_DOCCOVER_\\n+[#AUTHOR_DOCCOVER_NUM] \\$\\n[#AUTHOR_DOCCOVER_NUM]
4858 . if '\\$1'COVER' \{\
4860 . nr #AUTHOR_COVER_NUM 0 1
4861 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_COVER_NUM] \{\
4862 . ds $AUTHOR_COVER_\\n+[#AUTHOR_COVER_NUM] \\$\\n[#AUTHOR_COVER_NUM]
4866 . nr #AUTHOR_NUM 0 1
4868 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
4869 . ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
4870 . as $AUTHORS \\*[$AUTHOR_\\n[#AUTHOR_NUM]], \"
4872 . substring $AUTHORS 0 -3
4873 . ds $AUTHOR \\*[$AUTHOR_1]
4876 .ALIAS EDITOR AUTHOR
4878 .MAC COPYRIGHT END \"For use on cover pages only
4879 . ie \\n[#NUM_ARGS]=1 \{\
4880 . ds $COPYRIGHT \[co]\\$1
4881 . rm $COPYRIGHT_DOCCOVER
4882 . rm $COPYRIGHT_COVER
4885 . if '\\$1'DOC_COVER' \{\
4886 . ds $COPYRIGHT_DOCCOVER \[co]\\$2
4888 . if '\\$1'COVER' \{\
4889 . ds $COPYRIGHT_COVER \[co]\\$2
4895 .MAC MISC END \"For use on cover pages only; enclose all args in double quotes
4896 . ie \\n[#NUM_ARGS]=0 \{\
4897 . if \\n[#MISC_NUM] \{\
4899 . while \\n[#MISC_NUM]>\\n[#ITEM] \{\
4900 . rm $MISC_\\n+[#ITEM]
4905 . if \\n[#MISC_DOCCOVER_NUM] \{\
4907 . while \\n[#MISC_DOCCOVER_NUM]>\\n[#ITEM] \{\
4908 . rm $MISC_DOCCOVER_\\n+[#ITEM]
4910 . rr #MISC_DOCCOVER_NUM
4913 . if \\n[#MISC_COVER_NUM] \{\
4915 . while \\n[#MISC_COVER_NUM]>\\n[#ITEM] \{\
4916 . rm $MISC_COVER_\\n+[#ITEM]
4918 . rr #MISC_COVER_NUM
4923 . if !'\\$1'DOC_COVER' \{\
4924 . if !'\\$1'COVER' \{ .nr #NEITHER 1 \}
4926 . if !'\\$1'COVER' \{\
4927 . if !'\\$1'DOC_COVER'\{ .nr #NEITHER 1 \}
4929 . if '\\$1'DOC_COVER' \{\
4931 . nr #MISC_DOCCOVER_NUM 0 1
4932 . while \\n[#NUM_ARGS]>\\n[#MISC_DOCCOVER_NUM] \{\
4933 . ds $MISC_DOCCOVER_\\n+[#MISC_DOCCOVER_NUM] \\$\\n[#MISC_DOCCOVER_NUM]
4935 . nr #NUM_MISCS_DOCCOVER \\n[#NUM_ARGS]
4937 . if '\\$1'COVER' \{\
4939 . nr #MISC_COVER_NUM 0 1
4940 . while \\n[#NUM_ARGS]>\\n[#MISC_COVER_NUM] \{\
4941 . ds $MISC_COVER_\\n+[#MISC_COVER_NUM] \\$\\n[#MISC_COVER_NUM]
4943 . nr #NUM_MISCS_COVER \\n[#NUM_ARGS]
4945 . if \\n[#NEITHER]=1 \{\
4947 . while \\n[#NUM_ARGS]>\\n[#MISC_NUM] \{\
4948 . ds $MISC_\\n+[#MISC_NUM] \\$\\n[#MISC_NUM]
4950 . nr #NUM_MISCS \\n[#NUM_ARGS]
4957 .MAC PAGENUMBER END \"Page # that appears on page one.
4958 . nr #n%_AT_PAGENUM_SET \\n%
4959 . nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
4960 . rr #n%_AT_PAGENUM_SET
4961 . nr #PAGE_NUM_SET 1
4964 \# ====================================================================
4966 \# +++TYPE OF DOCUMENT+++
4971 \# DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
4973 \# Creates strings and sets registers for document types.
4975 \# Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
4978 . if '\\$1'DEFAULT' \{\
4981 . if '\\$1'CHAPTER' \{\
4984 . if '\\$1'NAMED' \{\
4988 . if '\\$1'LETTER' \{\
4996 . INDENT_FIRST_PARAS
4998 . ds $SUITE \En[#SUITE]
4999 . HEADER_MARGIN 3P+6p
5005 . FOOTER_RIGHT_SIZE +0
5006 . FOOTER_RIGHT "\&.../\E*[$SUITE]
5007 . FOOTER_ON_FIRST_PAGE
5012 \# +++LETTER MACROS+++
5014 \# First, create a register to hold incrementing numbers to be
5015 \# appended to LETTERHEAD.
5024 \# Stores date (entered on the line after .DATE) in diversion
5028 . if !'\\n(.z'' \{ .di \}
5029 . di LETTERHEAD\\n+[#FIELD]
5030 . ie \\n[#FIELD]=1 \{\
5045 \# Stores addressee address (entered on the line after .TO) in
5046 \# diversion LETTERHEAD<n>
5049 . if !'\\n(.z'' \{ .di \}
5050 . di LETTERHEAD\\n+[#FIELD]
5060 \# Stores addresser address (entered on the line after .FROM) in
5061 \# diversion LETTERHEAD<n>
5064 . if !'\\n(.z'' \{ .di \}
5065 . di LETTERHEAD\\n+[#FIELD]
5075 \# Stores greeting (entered on the line after .GREETING) in
5076 \# diversion LETTERHEAD<n>
5079 . if !'\\n(.z'' \{ .di \}
5080 . di LETTERHEAD\\n+[#FIELD]
5090 \# Stores greeting in diversion CLOSING.
5105 \# Redefines $FOOTER_RIGHT to blank so that a suite number doesn't
5106 \# appear at the bottom of letter pages.
5112 \# ====================================================================
5116 \# TYPE-STYLE CONTROL MACROS
5117 \# -------------------------
5118 \# The control macros for family, font, size, quad and color are here
5119 \# grouped together. Each (e.g. _FAMILY or _FONT) tests for a calling
5120 \# alias before performing the action(s) appropriate to the calling
5121 \# macro. Defaults for all these guys are set in DEFAULTS, and listed
5122 \# in the "Control Macros" section of the documentation pertinent to
5123 \# the macro whose style is to be changed.
5126 . if '\\$0'AUTHOR_FAMILY'
5127 . if '\\$0'BIBLIOGRAPHY_FAMILY' .ds $BIB_FAM \\$1
5128 . if '\\$0'BIBLIOGRAPHY_STRING_FAMILY' .ds $BIB_STRING_FAM \\$1
5129 . if '\\$0'BLOCKQUOTE_FAMILY' .ds $BQUOTE_FAM \\$1
5130 . if '\\$0'CITATION_FAMILY' .ds $BQUOTE_FAM \\$1
5131 . if '\\$0'CITE_FAMILY' .ds $BQUOTE_FAM \\$1
5132 . if '\\$0'CHAPTER_TITLE_FAMILY' .ds $CHAPTER_TITLE_FAM \\$1
5133 . if '\\$0'COVER_AUTHOR_FAMILY' .ds $COVER_AUTHOR_FAM \\$1
5134 . if '\\$0'COVER_CHAPTER_TITLE_FAMILY' .ds $COVER_CHAPTER_TITLE_FAM \\$1
5135 . if '\\$0'COVER_COPYRIGHT_FAMILY' .ds $COVER_COPYRIGHT_FAM \\$1
5136 . if '\\$0'COVER_DOCTYPE_FAMILY' .ds $COVER_DOCTYPE_FAM \\$1
5137 . if '\\$0'COVER_FAMILY' .ds $COVER_FAM \\$1
5138 . if '\\$0'COVER_SUBTITLE_FAMILY' .ds $COVER_SUBTITLE_FAM \\$1
5139 . if '\\$0'COVER_TITLE_FAMILY' .ds $COVER_TITLE_FAM \\$1
5140 . if '\\$0'DOC_COVER_AUTHOR_FAMILY' .ds $DOC_COVER_AUTHOR_FAM \\$1
5141 . if '\\$0'DOC_COVER_CHAPTER_TITLE_FAMILY' .ds $DOC_COVER_CHAPTER_TITLE_FAM \\$1
5142 . if '\\$0'DOC_COVER_COPYRIGHT_FAMILY' .ds $DOC_COVER_COPYRIGHT_FAM \\$1
5143 . if '\\$0'DOC_COVER_DOCTYPE_FAMILY' .ds $DOC_COVER_DOCTYPE_FAM \\$1
5144 . if '\\$0'DOC_COVER_FAMILY' .ds $DOC_COVER_FAM \\$1
5145 . if '\\$0'DOC_COVER_SUBTITLE_FAMILY' .ds $DOC_COVER_SUBTITLE_FAM \\$1
5146 . if '\\$0'DOC_COVER_TITLE_FAMILY' .ds $DOC_COVER_TITLE_FAM \\$1
5147 . if '\\$0'DOCHEADER_FAMILY' .ds $DOCHEADER_FAM \\$1
5148 . if '\\$0'DOCTYPE_FAMILY' .ds $DOCTYPE_FAM \\$1
5149 . if '\\$0'ENDNOTE_FAMILY' .ds $EN_FAM \\$1
5150 . if '\\$0'ENDNOTE_NUMBER_FAMILY' .ds $EN_NUMBER_FAM \\$1
5151 . if '\\$0'ENDNOTE_LINENUMBER_FAMILY' .ds $EN_LN_FAM \\$1
5152 . if '\\$0'ENDNOTE_STRING_FAMILY' .ds $EN_STRING_FAM \\$1
5153 . if '\\$0'ENDNOTE_TITLE_FAMILY' .ds $EN_TITLE_FAM \\$1
5154 . if '\\$0'EPIGRAPH_FAMILY' .ds $EPI_FAM \\$1
5155 . if '\\$0'FOOTNOTE_FAMILY' .ds $FN_FAM \\$1
5156 . if '\\$0'HDRFTR_CENTER_FAMILY' .ds $HDRFTR_CENTER_FAM \\$1
5157 . if '\\$0'HDRFTR_FAMILY' \{\
5158 . ds $HDRFTR_FAM \\$1
5159 . ds $HDRFTR_LEFT_FAM \\$1
5160 . ds $HDRFTR_CENTER_FAM \\$1
5161 . ds $HDRFTR_RIGHT_FAM \\$1
5163 . if '\\$0'HDRFTR_LEFT_FAMILY' .ds $HDRFTR_LEFT_FAM \\$1
5164 . if '\\$0'HDRFTR_RIGHT_FAMILY' .ds $HDRFTR_RIGHT_FAM \\$1
5165 . if '\\$0'HEAD_FAMILY' .ds $HEAD_FAM \\$1
5166 . if '\\$0'LINENUMBER_FAMILY' .ds $LN_FAM \\$1
5167 . if '\\$0'PAGENUM_FAMILY' .ds $PAGE_NUM_FAM \\$1
5168 . if '\\$0'PARAHEAD_FAMILY' .ds $PH_FAM \\$1
5169 . if '\\$0'QUOTE_FAMILY' .ds $QUOTE_FAM \\$1
5170 . if '\\$0'SUBHEAD_FAMILY' .ds $SH_FAM \\$1
5171 . if '\\$0'SUBTITLE_FAMILY' .ds $SUBTITLE_FAM \\$1
5172 . if '\\$0'TITLE_FAMILY' .ds $TITLE_FAM \\$1
5173 . if '\\$0'TOC_FAMILY' .ds $TOC_FAM \\$1
5174 . if '\\$0'TOC_FAM' .ds $TOC_FAM \\$1
5175 . if '\\$0'TOC_HEADER_FAMILY' .ds $TOC_HEADER_FAM \\$1
5176 . if '\\$0'TOC_HEAD_FAMILY' .ds $TOC_HEAD_FAM \\$1
5177 . if '\\$0'TOC_PARAHEAD_FAMILY' .ds $TOC_PH_FAM \\$1
5178 . if '\\$0'TOC_PN_FAMILY' .ds $TOC_PN_FAM \\$1
5179 . if '\\$0'TOC_SUBHEAD_FAMILY' .ds $TOC_SH_FAM \\$1
5180 . if '\\$0'TOC_TITLE_FAMILY' .ds $TOC_TITLE_FAM \\$1
5185 . if '\\$0'AUTHOR_FONT' .ds $AUTHOR_FT \\$1
5186 . if '\\$0'BIBLIOGRAPHY_FONT' .ds $BIB_FT \\$1
5187 . if '\\$0'BIBLIOGRAPHY_STRING_FONT' .ds $BIB_STRING_FT \\$1
5188 . if '\\$0'BLOCKQUOTE_FONT' .ds $BQUOTE_FT \\$1
5189 . if '\\$0'CITATION_FONT' .ds $BQUOTE_FT \\$1
5190 . if '\\$0'CITE_FONT' .ds $BQUOTE_FT \\$1
5191 . if '\\$0'CHAPTER_TITLE_FONT' .ds $CHAPTER_TITLE_FT \\$1
5192 . if '\\$0'COVER_AUTHOR_FONT' .ds $COVER_AUTHOR_FT \\$1
5193 . if '\\$0'COVER_CHAPTER_TITLE_FONT' .ds $COVER_CHAPTER_TITLE_FT \\$1
5194 . if '\\$0'COVER_COPYRIGHT_FONT' .ds $COVER_COPYRIGHT_FT \\$1
5195 . if '\\$0'COVER_DOCTYPE_FONT' .ds $COVER_DOCTYPE_FT \\$1
5196 . if '\\$0'COVER_SUBTITLE_FONT' .ds $COVER_SUBTITLE_FT \\$1
5197 . if '\\$0'COVER_TITLE_FONT' .ds $COVER_TITLE_FT \\$1
5198 . if '\\$0'DOC_COVER_AUTHOR_FONT' .ds $DOC_COVER_AUTHOR_FT \\$1
5199 . if '\\$0'DOC_COVER_CHAPTER_TITLE_FONT' .ds $DOC_COVER_CHAPTER_TITLE_FT \\$1
5200 . if '\\$0'DOC_COVER_COPYRIGHT_FONT' .ds $DOC_COVER_COPYRIGHT_FT \\$1
5201 . if '\\$0'DOC_COVER_DOCTYPE_FONT' .ds $DOC_COVER_DOCTYPE_FT \\$1
5202 . if '\\$0'DOC_COVER_SUBTITLE_FONT' .ds $DOC_COVER_SUBTITLE_FT \\$1
5203 . if '\\$0'DOC_COVER_TITLE_FONT' .ds $DOC_COVER_TITLE_FT \\$1
5204 . if '\\$0'DOCTYPE_FONT' .ds $DOCTYPE_FT \\$1
5205 . if '\\$0'ENDNOTE_FONT' .ds $EN_FT \\$1
5206 . if '\\$0'ENDNOTE_NUMBER_FONT' .ds $EN_NUMBER_FT \\$1
5207 . if '\\$0'ENDNOTE_LINENUMBER_FONT' .ds $EN_LN_FT \\$1
5208 . if '\\$0'ENDNOTE_STRING_FONT' .ds $EN_STRING_FT \\$1
5209 . if '\\$0'ENDNOTE_TITLE_FONT' .ds $EN_TITLE_FT \\$1
5210 . if '\\$0'EPIGRAPH_FONT' .ds $EPI_FT \\$1
5211 . if '\\$0'FOOTNOTE_FONT' .ds $FN_FT \\$1
5212 . if '\\$0'HDRFTR_CENTER_FONT' .ds $HDRFTR_CENTER_FT \\$1
5213 . if '\\$0'HDRFTR_LEFT_FONT' .ds $HDRFTR_LEFT_FT \\$1
5214 . if '\\$0'HDRFTR_RIGHT_FONT' .ds $HDRFTR_RIGHT_FT \\$1
5215 . if '\\$0'HEAD_FONT' .ds $HEAD_FT \\$1
5216 . if '\\$0'LINENUMBER_FONT' .ds $LN_FT \\$1
5217 . if '\\$0'PAGENUM_FONT' .ds $PAGE_NUM_FT \\$1
5218 . if '\\$0'PARAHEAD_FONT' .ds $PH_FT \\$1
5219 . if '\\$0'QUOTE_FONT' .ds $QUOTE_FT \\$1
5220 . if '\\$0'SUBHEAD_FONT' .ds $SH_FT \\$1
5221 . if '\\$0'SUBTITLE_FONT' .ds $SUBTITLE_FT \\$1
5222 . if '\\$0'TITLE_FONT' .ds $TITLE_FT \\$1
5223 . if '\\$0'TOC_HEADER_FONT' .ds $TOC_HEADER_FT \\$1
5224 . if '\\$0'TOC_HEAD_FONT' .ds $TOC_HEAD_FT \\$1
5225 . if '\\$0'TOC_PARAHEAD_FONT' .ds $TOC_PH_FT \\$1
5226 . if '\\$0'TOC_PN_FONT' .ds $TOC_PN_FT \\$1
5227 . if '\\$0'TOC_SUBHEAD_FONT' .ds $TOC_SH_FT \\$1
5228 . if '\\$0'TOC_TITLE_FONT' .ds $TOC_TITLE_FT \\$1
5233 . if '\\$0'AUTHOR_SIZE' .ds $AUTHOR_SIZE_CHANGE \\$1
5234 . if '\\$0'BIBLIOGRAPHY_STRING_SIZE' .ds $BIB_STRING_SIZE_CHANGE \\$1
5235 . if '\\$0'BLOCKQUOTE_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
5236 . if '\\$0'CITATION_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
5237 . if '\\$0'CITE_SIZE' .ds $BQUOTE_SIZE_CHANGE \\$1
5238 . if '\\$0'CHAPTER_TITLE_SIZE' .ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
5239 . if '\\$0'COVER_AUTHOR_SIZE' .ds $COVER_AUTHOR_SIZE_CHANGE \\$1
5240 . if '\\$0'COVER_CHAPTER_TITLE_SIZE' .ds $COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
5241 . if '\\$0'COVER_COPYRIGHT_SIZE' .ds $COVER_COPYRIGHT_SIZE_CHANGE \\$1
5242 . if '\\$0'COVER_DOCTYPE_SIZE' .ds $COVER_DOCTYPE_SIZE_CHANGE \\$1
5243 . if '\\$0'COVER_SUBTITLE_SIZE' .ds $COVER_SUBTITLE_SIZE_CHANGE \\$1
5244 . if '\\$0'COVER_TITLE_SIZE' .ds $COVER_TITLE_SIZE_CHANGE \\$1
5245 . if '\\$0'DOC_COVER_AUTHOR_SIZE' .ds $DOC_COVER_AUTHOR_SIZE_CHANGE \\$1
5246 . if '\\$0'DOC_COVER_CHAPTER_TITLE_SIZE' .ds $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
5247 . if '\\$0'DOC_COVER_COPYRIGHT_SIZE' .ds $DOC_COVER_COPYRIGHT_SIZE_CHANGE \\$1
5248 . if '\\$0'DOC_COVER_DOCTYPE_SIZE' .ds $DOC_COVER_DOCTYPE_SIZE_CHANGE \\$1
5249 . if '\\$0'DOC_COVER_SUBTITLE_SIZE' .ds $DOC_COVER_SUBTITLE_SIZE_CHANGE \\$1
5250 . if '\\$0'DOC_COVER_TITLE_SIZE' .ds $DOC_COVER_TITLE_SIZE_CHANGE \\$1
5251 . if '\\$0'DOCTYPE_SIZE' .ds $DOCTYPE_SIZE_CHANGE \\$1
5252 . if '\\$0'ENDNOTE_NUMBER_SIZE' .ds $EN_NUMBER_SIZE_CHANGE \\$1
5253 . if '\\$0'ENDNOTE_LINENUMBER_SIZE' .ds $EN_LN_SIZE_CHANGE \\$1
5254 . if '\\$0'ENDNOTE_STRING_SIZE' .ds $EN_STRING_SIZE_CHANGE \\$1
5255 . if '\\$0'ENDNOTE_TITLE_SIZE' .ds $EN_TITLE_SIZE_CHANGE \\$1
5256 . if '\\$0'EPIGRAPH_SIZE' .ds $EPI_SIZE_CHANGE \\$1
5257 . if '\\$0'FOOTNOTE_SIZE' .ds $FN_SIZE_CHANGE \\$1
5258 . if '\\$0'HDRFTR_CENTER_SIZE' .ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
5259 . if '\\$0'HDRFTR_LEFT_SIZE' .ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5260 . if '\\$0'HDRFTR_RIGHT_SIZE' .ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
5261 . if '\\$0'HDRFTR_SIZE' .ds $HDRFTR_SIZE_CHANGE \\$1
5262 . if '\\$0'HEAD_SIZE' .ds $HEAD_SIZE_CHANGE \\$1
5263 . if '\\$0'LINENUMBER_SIZE' .ds $LN_SIZE_CHANGE \\$1
5264 . if '\\$0'PAGENUM_SIZE' .ds $PAGE_NUM_SIZE_CHANGE \\$1
5265 . if '\\$0'PARAHEAD_SIZE' .ds $PH_SIZE_CHANGE \\$1
5266 . if '\\$0'QUOTE_SIZE' .ds $QUOTE_SIZE_CHANGE \\$1
5267 . if '\\$0'SUBHEAD_SIZE' .ds $SH_SIZE_CHANGE \\$1
5268 . if '\\$0'SUBTITLE_SIZE' .ds $SUBTITLE_SIZE_CHANGE \\$1
5269 . if '\\$0'TITLE_SIZE' .ds $TITLE_SIZE_CHANGE \\$1
5270 . if '\\$0'TOC_HEADER_SIZE' .ds $TOC_HEADER_SIZE_CHANGE \\$1
5271 . if '\\$0'TOC_HEAD_SIZE' .ds $TOC_HEAD_SIZE_CHANGE \\$1
5272 . if '\\$0'TOC_PARAHEAD_SIZE' .ds $TOC_PH_SIZE_CHANGE \\$1
5273 . if '\\$0'TOC_PN_SIZE' .ds $TOC_PN_SIZE_CHANGE \\$1
5274 . if '\\$0'TOC_SUBHEAD_SIZE' .ds $TOC_SH_SIZE_CHANGE \\$1
5275 . if '\\$0'TOC_TITLE_SIZE' .ds $TOC_TITLE_SIZE_CHANGE \\$1
5280 . if \\n[#PRINT_STYLE]=1 \{ .return \}
5281 . if '\\$0'ATTRIBUTE_COLOR' \{\
5282 . nr #ATTRIBUTE_COLOR 1
5283 . ds $ATTRIBUTE_COLOR \\$1
5285 . if '\\$0'AUTHOR_COLOR' \{\
5286 . nr #AUTHOR_COLOR 1
5287 . ds $AUTHOR_COLOR \\$1
5289 . if '\\$0'BLOCKQUOTE_COLOR' \{\
5290 . nr #BQUOTE_COLOR 1
5291 . ds $BQUOTE_COLOR \\$1
5293 . if '\\$0'CITATION_COLOR' \{\
5294 . nr #BQUOTE_COLOR 1
5295 . ds $BQUOTE_COLOR \\$1
5297 . if '\\$0'CITE_COLOR' \{\
5298 . nr #BQUOTE_COLOR 1
5299 . ds $BQUOTE_COLOR \\$1
5301 . if '\\$0'CHAPTER_TITLE_COLOR' \{\
5302 . nr #CHAPTER_TITLE_COLOR 1
5303 . ds $CHAPTER_TITLE_COLOR \\$1
5305 . if '\\$0'COVER_ATTRIBUTE_COLOR' \{\
5306 . nr #COVER_ATTRIBUTE_COLOR 1
5307 . ds $COVER_ATTRIBUTE_COLOR \\$1
5309 . if '\\$0'COVER_AUTHOR_COLOR' \{\
5310 . nr #COVER_AUTHOR_COLOR 1
5311 . ds $COVER_AUTHOR_COLOR \\$1
5313 . if '\\$0'COVER_CHAPTER_TITLE_COLOR' \{\
5314 . nr #COVER_CHAPTER_TITLE_COLOR 1
5315 . ds $COVER_CHAPTER_TITLE_COLOR \\$1
5317 . if '\\$0'COVER_COLOR' \{\
5319 . ds $COVER_COLOR \\$1
5321 . if '\\$0'COVER_COPYRIGHT_COLOR' \{\
5322 . nr #COVER_COPYRIGHT_COLOR 1
5323 . ds $COVER_COPYRIGHT_COLOR \\$1
5325 . if '\\$0'COVER_MISC_COLOR' \{\
5326 . nr #COVER_MISC_COLOR 1
5327 . ds $COVER_MISC_COLOR \\$1
5329 . if '\\$0'COVER_TITLE_COLOR' \{\
5330 . nr #COVER_TITLE_COLOR 1
5331 . ds $COVER_TITLE_COLOR \\$1
5333 . if '\\$0'COVER_SUBTITLE_COLOR' \{\
5334 . nr #COVER_SUBTITLE_COLOR 1
5335 . ds $COVER_SUBTITLE_COLOR \\$1
5337 . if '\\$0'COVER_DOCTYPE_COLOR' \{\
5338 . nr #COVER_DOCTYPE_COLOR 1
5339 . ds $COVER_DOCTYPE_COLOR \\$1
5341 . if '\\$0'DOC_COVER_ATTRIBUTE_COLOR' \{\
5342 . nr #DOC_COVER_ATTRIBUTE_COLOR 1
5343 . ds $DOC_COVER_ATTRIBUTE_COLOR \\$1
5345 . if '\\$0'DOC_COVER_AUTHOR_COLOR' \{\
5346 . nr #DOC_COVER_AUTHOR_COLOR 1
5347 . ds $DOC_COVER_AUTHOR_COLOR \\$1
5349 . if '\\$0'DOC_COVER_CHAPTER_TITLE_COLOR' \{\
5350 . nr #DOC_COVER_CHAPTER_TITLE_COLOR 1
5351 . ds $DOC_COVER_CHAPTER_TITLE_COLOR \\$1
5353 . if '\\$0'DOC_COVER_COLOR' \{\
5354 . nr #DOC_COVER_COLOR 1
5355 . ds $DOC_COVER_COLOR \\$1
5357 . if '\\$0'DOC_COVER_COPYRIGHT_COLOR' \{\
5358 . nr #DOC_COVER_COPYRIGHT_COLOR 1
5359 . ds $DOC_COVER_COPYRIGHT_COLOR \\$1
5361 . if '\\$0'DOC_COVER_MISC_COLOR' \{\
5362 . nr #DOC_COVER_MISC_COLOR 1
5363 . ds $DOC_COVER_MISC_COLOR \\$1
5365 . if '\\$0'DOC_COVER_TITLE_COLOR' \{\
5366 . nr #DOC_COVER_TITLE_COLOR 1
5367 . ds $DOC_COVER_TITLE_COLOR \\$1
5369 . if '\\$0'DOC_COVER_SUBTITLE_COLOR' \{\
5370 . nr #DOC_COVER_SUBTITLE_COLOR 1
5371 . ds $DOC_COVER_SUBTITLE_COLOR \\$1
5373 . if '\\$0'DOC_COVER_DOCTYPE_COLOR' \{\
5374 . nr #DOC_COVER_DOCTYPE_COLOR 1
5375 . ds $DOC_COVER_DOCTYPE_COLOR \\$1
5377 . if '\\$0'DOCHEADER_COLOR' \{\
5378 . nr #DOCHEADER_COLOR 1
5379 . ds $DOCHEADER_COLOR \\$1
5381 . if '\\$0'DOCTYPE_COLOR' \{\
5382 . nr #DOCTYPE_COLOR 1
5383 . ds $DOCTYPE_COLOR \\$1
5385 . if '\\$0'EPIGRAPH_COLOR' \{\
5387 . ds $EPI_COLOR \\$1
5389 . if '\\$0'FINIS_COLOR' \{\
5391 . ds $FINIS_COLOR \\$1
5393 . if '\\$0'FOOTNOTE_COLOR' \{\
5394 . nr #FOOTNOTE_COLOR 1
5395 . ds $FOOTNOTE_COLOR \\$1
5397 . if '\\$0'HDRFTR_CENTER_COLOR' \{\
5398 . nr #HDRFTR_CENTER_COLOR 1
5399 . ds $HDRFTR_CENTER_COLOR \\$1
5401 . if '\\$0'HDRFTR_COLOR' \{\
5402 . nr #HDRFTR_COLOR 1
5403 . ds $HDRFTR_COLOR \\$1
5405 . if '\\$0'HDRFTR_LEFT_COLOR' \{\
5406 . nr #HDRFTR_LEFT_COLOR 1
5407 . ds $HDRFTR_LEFT_COLOR \\$1
5409 . if '\\$0'HDRFTR_RIGHT_COLOR' \{\
5410 . nr #HDRFTR_RIGHT_COLOR 1
5411 . ds $HDRFTR_RIGHT_COLOR \\$1
5413 . if '\\$0'HDRFTR_RULE_COLOR' \{\
5414 . nr #HDRFTR_RULE_COLOR 1
5415 . ds $HDRFTR_RULE_COLOR \\$1
5417 . if '\\$0'HEAD_COLOR' \{\
5419 . ds $HEAD_COLOR \\$1
5421 . if '\\$0'LINEBREAK_COLOR' \{\
5422 . nr #LINEBREAK_COLOR 1
5423 . ds $LINEBREAK_COLOR \\$1
5425 . if '\\$0'LINENUMBER_COLOR' \{\
5426 . nr #LINENUMBER_COLOR 1
5429 . if '\\$0'PAGENUM_COLOR' \{\
5430 . nr #PAGE_NUM_COLOR 1
5431 . ds $PAGENUM_COLOR \\$1
5433 . if '\\$0'PARAHEAD_COLOR' \{\
5437 . if '\\$0'QUOTE_COLOR' \{\
5439 . ds $QUOTE_COLOR \\$1
5441 . if '\\$0'SUBHEAD_COLOR' \{\
5445 . if '\\$0'SUBTITLE_COLOR' \{\
5446 . nr #SUBTITLE_COLOR 1
5447 . ds $SUBTITLE_COLOR \\$1
5449 . if '\\$0'TITLE_COLOR' \{\
5451 . ds $TITLE_COLOR \\$1
5457 . if '\\$0'BIBLIOGRAPHY_QUAD' \{\
5459 . if '\\*[$BIB_QUAD]'R' .ab Fatal error: \\$0 must be set to either L or J
5460 . if '\\*[$BIB_QUAD]'C' .ab Fatal error: \\$0 must be set to either L or J
5462 . if '\\$0'BIBLIOGRAPHY_STRING_QUAD' .ds $BIB_STRING_QUAD \\$1
5463 . if '\\$0'BLOCKQUOTE_QUAD' .ds $BQUOTE_QUAD \\$1
5464 . if '\\$0'CITATION_QUAD' .ds $BQUOTE_QUAD \\$1
5465 . if '\\$0'CITE_QUAD' .ds $BQUOTE_QUAD \\$1
5466 . if '\\$0'COVER_COPYRIGHT_QUAD' .ds $COVER_COPYRIGHT_QUAD \\$1
5467 . if '\\$0'COVER_MISC_QUAD' .ds $COVER_MISC_QUAD \\$1
5468 . if '\\$0'DOC_COVER_COPYRIGHT_QUAD' .ds $DOC_COVER_COPYRIGHT_QUAD \\$1
5469 . if '\\$0'DOC_COVER_MISC_QUAD' .ds $DOC_COVER_MISC_QUAD \\$1
5470 . if '\\$0'DOC_QUAD' \{\
5472 . QUAD \\*[$DOC_QUAD]
5474 . if '\\$0'ENDNOTE_QUAD' \{\
5476 . if '\\*[$EN_QUAD]'R' .ab Fatal error: \\$0 must be set to either L or J
5477 . if '\\*[$EN_QUAD]'C' .ab Fatal error: \\$0 must be set to either L or J
5479 . if '\\$0'ENDNOTE_STRING_QUAD' .ds $EN_STRING_QUAD \\$1
5480 . if '\\$0'ENDNOTE_TITLE_QUAD' .ds $EN_TITLE_QUAD \\$1
5481 . if '\\$0'EPIGRAPH_QUAD' .ds $EPI_QUAD \\$1
5482 . if '\\$0'FOOTNOTE_QUAD' .ds $FN_QUAD \\$1
5483 . if '\\$0'HEAD_QUAD' .ds $HEAD_QUAD \\$1
5484 . if '\\$0'SUBHEAD_QUAD' .ds $SH_QUAD \\$1
5485 . if '\\$0'TOC_HEADER_QUAD' .ds $TOC_HEADER_QUAD \\$1
5494 \# Sets up defaults if no values are entered prior to START.
5496 \# The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
5497 \# $REVISION_STRING are in the COPYSTYLE macro.
5500 . if !d$PAPER \{ .PAPER LETTER \}
5501 . if !\\n[#DOC_TYPE] \{ .DOCTYPE DEFAULT \}
5502 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
5504 . if !\\n[#COPY_STYLE]=1 \{ .PAGENUM_STYLE DIGIT \}
5506 . if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
5507 . if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
5508 . if \\n[#DOC_TYPE]=4 \{\
5509 . if !\\n[#USER_SET_L_LENGTH] \{\
5510 . R_MARGIN \\n[#R_MARGIN]u
5511 . rr #USER_SET_L_LENGTH
5513 . if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
5515 . if \\n[#COPY_STYLE]=1 \{\
5519 . if !r#DOC_HEADER \{ .DOCHEADER \}
5520 . if !r#HEADERS_ON \{ .HEADERS \}
5521 . if !r#PAGINATE \{ .PAGINATE \}
5522 . if \\n[#FOOTERS_ON] \{\
5524 . if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
5526 . if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
5527 . if !r#HEADER_GAP \{ .HEADER_GAP 3P \}
5528 . if \\n[#FOOTERS_ON] \{\
5529 . if \\n[#PAGINATE]=0 \{\
5530 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
5533 . if \\n[#HEADERS_ON]=0 \{\
5534 . if \\n[#FOOTERS_ON]=0 \{\
5535 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
5538 . if !r#T_MARGIN \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
5539 . if !r#DOCHEADER_ADVANCE \{ .nr #DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
5540 . if !r#FOOTER_MARGIN \{ .FOOTER_MARGIN 3P \}
5541 . if !r#FOOTER_GAP \{ .FOOTER_GAP 3P \}
5542 . if !r#B_MARGIN \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
5543 . if (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
5544 . tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
5545 . tm1 " No footers or bottom-of-page page numbers will be printed.
5546 . tm1 " Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
5547 . tm1 " If no footers or bottom-of-page page numbers are required,
5548 . tm1 " type in .FOOTER_MARGIN 0 before .START
5550 . if !r#HEADER_RULE_GAP \{ .HEADER_RULE_GAP 4p \}
5551 . if !r#FOOTER_RULE_GAP \{ .FOOTER_RULE_GAP 4p \}
5552 . if !r#HDRFTR_RULE \{ .HDRFTR_RULE \}
5553 . if !r#PAGE_NUM_SET \{ .PAGENUMBER 1 \}
5554 .\" Read in number registers and strings for type parameters
5555 . nr #DOC_L_MARGIN \\n[#L_MARGIN]
5556 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
5557 . nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
5558 . ds $DOC_FAM \\*[$FAMILY]
5559 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
5560 . nr #DOC_LEAD \\n[#LEAD]
5561 .\" #SAVED_DOC_LEAD is set in COLLATE
5562 . if r#SAVED_DOC_LEAD \{\
5563 . if !\\n[#DOC_LEAD]=\\n[#SAVED_DOC_LEAD] \{ .nr #RERUN_TRAPS 1 \}
5565 . ie \\n[#ADJ_DOC_LEAD]=1 \{ . \}
5567 . if !\\n[#DOC_LEAD_ADJUST_OFF] \{\
5571 . ds $DOC_QUAD \\*[$QUAD_VALUE]
5572 . if '\\*[$FONT]'' \{ .FT R \}
5573 . if '\\*[$PP_FT]'' \{\
5574 . ds $PP_FT \\*[$FONT]
5576 . if !'\\*[$PP_FT]'' \{\
5577 . ds $PP_FT \\*[$FONT]
5583 . nr #FN_COUNT_FOR_COLS 0 1
5586 . RESET_SUBHEAD_NUMBER
5587 . RESET_PARAHEAD_NUMBER
5588 .\" General style defaults for both PRINTSTYLEs
5590 . PARA_INDENT \\n[#PP_INDENT]u
5591 . if !d$HDRFTR_FAM \{ .HDRFTR_FAMILY \\*[$DOC_FAM] \}
5592 . if !d$HDRFTR_SIZE_CHANGE \{ .HDRFTR_SIZE +0 \}
5593 . if !d$PAGE_NUM_FAM \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
5594 . if !d$PAGE_NUM_FT \{ .PAGENUM_FONT R \}
5595 . if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE +0 \}
5596 . if !r#PAGE_NUM_POS_SET \{ .PAGENUM_POS BOTTOM CENTER \}
5597 . ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
5598 . if \\n[#PAGE_NUM_HYPHENS]=0 \{ .PAGENUM_HYPHENS OFF \}
5599 . if \\n[#PAGE_NUM_HYPHENS]=1 \{ .PAGENUM_HYPHENS \}
5601 . el \{ .PAGENUM_HYPHENS \}
5602 . if !d$HEAD_QUAD \{ .HEAD_QUAD CENTER \}
5603 . if !r#HEAD_CAPS \{ .HEAD_CAPS \}
5604 . if !r#HEAD_UNDERLINE \{ .HEAD_UNDERLINE \}
5605 . if !d$SH_QUAD \{ .SUBHEAD_QUAD LEFT \}
5606 . if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
5607 . if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
5608 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
5610 . if !d$FN_FAM \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
5611 . if !d$FN_FT \{ .FOOTNOTE_FONT R \}
5612 . if !d$FN_QUAD \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD] \}
5613 . if !r#FN_RULE \{ .FOOTNOTE_RULE \}
5614 . if !r#FN_MARKERS \{ .FOOTNOTE_MARKERS \}
5615 . if \\n[#FN_MARKERS]=1 \{\
5616 . if !\\n[#FN_MARKER_STYLE] \{ .FOOTNOTE_MARKER_STYLE STAR \}
5618 . if !\\n[#EN_MARKER_STYLE] \{ .ENDNOTE_MARKER_STYLE NUMBER \}
5619 . if !d$EN_PN_STYLE \{ .ENDNOTES_PAGENUM_STYLE digit \}
5620 . if !d$EN_FAM \{ .ENDNOTE_FAMILY \\*[$DOC_FAM] \}
5621 . if !d$EN_FT \{ .ENDNOTE_FONT R \}
5622 . if !d$EN_QUAD \{ .ENDNOTE_QUAD \\*[$DOC_QUAD] \}
5623 . if !d$EN_STRING \{ .ENDNOTE_STRING "Endnotes" \}
5624 . if !d$EN_STRING_FAM \{ .ENDNOTE_STRING_FAMILY \\*[$EN_FAM] \}
5625 . if !d$EN_STRING_QUAD \{ .ENDNOTE_STRING_QUAD CENTER \}
5626 . if !r#EN_STRING_UNDERLINE \{ .nr #EN_STRING_UNDERLINE 2 \}
5627 . if !r#EN_STRING_CAPS \{ .ENDNOTE_STRING_CAPS \}
5628 . if !d$EN_TITLE \{\
5629 . ie \\n[#DOC_TYPE]=2 \{\
5630 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
5631 . ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_TITLE]" \}
5632 . el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]" \}
5635 . ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
5636 . el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]" \}
5639 . el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
5641 . if !d$EN_TITLE_FAM \{ .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM] \}
5642 . if !d$EN_TITLE_QUAD \{ .ENDNOTE_TITLE_QUAD LEFT \}
5643 . if !r#EN_TITLE_UNDERLINE \{ .nr #EN_TITLE_UNDERLINE 1 \}
5644 . if !d$EN_NUMBER_FAM \{ .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] \}
5645 . if !d$EN_LN_FAM \{ .ENDNOTE_LINENUMBER_FAMILY \\*[$EN_FAM] \}
5646 . if !r#EN_NUMBERS_ALIGN_LEFT \{\
5647 . if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2 \}
5649 . if !d$EN_LN_GAP \{ .ENDNOTE_LINENUMBER_GAP 1.5n \}
5650 . if !r#EN_ALLOWS_HEADERS \{ .ENDNOTES_ALLOWS_HEADERS \}
5651 . if !d$BIB_PN_STYLE \{ .BIBLIOGRAPHY_PAGENUM_STYLE digit \}
5652 . if !d$BIB_FAM \{ .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM] \}
5653 . if !d$BIB_FT \{ .BIBLIOGRAPHY_FONT R \}
5654 . if !d$BIB_QUAD \{ .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD] \}
5655 . if !d$BIB_STRING \{ .BIBLIOGRAPHY_STRING "Bibliography" \}
5656 . if !d$BIB_STRING_FAM \{ .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FAM] \}
5657 . if !d$BIB_STRING_QUAD \{ .BIBLIOGRAPHY_STRING_QUAD CENTER \}
5658 . if !r#BIB_STRING_UNDERLINE \{ .nr #BIB_STRING_UNDERLINE 2 \}
5659 . if !r#BIB_STRING_CAPS \{ .BIBLIOGRAPHY_STRING_CAPS \}
5660 . if !d$TOC_HEADER_STRING \{ .TOC_HEADER_STRING "Contents" \}
5661 . if !d$TOC_HEADER_QUAD \{ .TOC_HEADER_QUAD LEFT \}
5662 . if !d$TOC_PN_STYLE \{ .TOC_PAGENUM_STYLE roman \}
5663 . if !r#TOC_PN_PADDING \{ .TOC_PADDING 3 \}
5664 . if !r#TOC_TITLE_INDENT \{ .TOC_TITLE_INDENT 0 \}
5665 .\" String defaults for both PRINTSTYLEs
5666 . ie \\n[#DOC_TYPE]=1 \{\
5667 . ie '\\*[$DOC_TITLE]'' \{\
5668 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5669 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
5672 . if \\n[#COPY_STYLE]=1 \{ .DRAFT_WITH_PAGENUMBER \}
5673 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5674 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 .ds $HDRFTR_CENTER \\*[$TITLE]
5675 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$DOC_TITLE]
5679 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5680 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
5682 . if !d$ATTRIBUTE_STRING .ds $ATTRIBUTE_STRING by
5683 . if !d$FINIS_STRING \{ .FINIS_STRING "End" \}
5684 . if !r#FINIS_STRING_CAPS \{ .nr #FINIS_STRING_CAPS 1 \}
5686 . if !r#DOC_COVERS_OFF \{ .nr #DOC_COVERS 1 \}
5687 . if !r#COVERS_OFF \{ .nr #COVERS 1 \}
5688 . if !d$COVER_COPYRIGHT_QUAD \{ .COVER_COPYRIGHT_QUAD R \}
5689 . if !d$COVER_MISC_QUAD \{ .COVER_MISC_QUAD L \}
5690 . if !d$DOC_COVER_COPYRIGHT_QUAD \{ .DOC_COVER_COPYRIGHT_QUAD R \}
5691 . if !d$DOC_COVER_MISC_QUAD \{ .DOC_COVER_MISC_QUAD L \}
5692 . if !r#DOCCOVER_UNDERLINE \{ .DOC_COVER_UNDERLINE \}
5693 . if !r#COVER_UNDERLINE \{ .COVER_UNDERLINE \}
5694 .\" Defaults for printstyle TYPEWRITE
5695 . if \\n[#PRINT_STYLE]=1 \{\
5696 . if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES \}
5697 . if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF \}
5698 .\" +Quotes and blockquotes
5699 . if !r#Q_OFFSET_VALUE \{\
5700 . if '\\*[$Q_OFFSET_VALUE]'' \{ .QUOTE_INDENT 2 \}
5703 . if !r#EPI_OFFSET_VALUE \{\
5704 . if '\\*[$EPI_OFFSET_VALUE]'' \{ .EPIGRAPH_INDENT 2 \}
5707 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 2p \}
5709 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE +0 \}
5710 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 2i \}
5711 .\" +Paragraph heads
5712 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
5714 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
5716 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 6p \}
5718 . if !r#SLANT_MEANS_SLANT \{\
5719 . ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
5720 . el \{ .UNDERLINE_SLANT OFF \}
5723 .\" Defaults for printstyle TYPESET
5724 . if \\n[#PRINT_STYLE]=2 \{\
5725 . if !d$DOCHEADER_LEAD_ADJ \{ .DOCHEADER_LEAD +0 \}
5727 . if !d$COVER_LEAD_ADJ \{ .COVER_LEAD +0 \}
5728 . if !d$COVER_FAM \{ .COVER_FAMILY \\*[$DOC_FAM] \}
5730 . if !d$COVER_TITLE_FAM \{\
5731 . ie !d$COVER_FAM \{ .COVER_TITLE_FAMILY \\*[$DOC_FAM] \}
5732 . el \{ .COVER_TITLE_FAMILY \\*[$COVER_FAM] \}
5734 . if !d$COVER_TITLE_FT \{ .COVER_TITLE_FONT B \}
5735 . if !d$COVER_TITLE_SIZE_CHANGE \{ .COVER_TITLE_SIZE +3.5 \}
5737 . if !d$COVER_CHAPTER_TITLE_FAM \{\
5738 . ie !d$COVER_FAM \{ .COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
5739 . el \{ .COVER_CHAPTER_TITLE_FAMILY \\*[$COVER_FAM] \}
5741 . if !d$COVER_CHAPTER_TITLE_FT \{ .COVER_CHAPTER_TITLE_FONT BI \}
5742 . if !d$COVER_CHAPTER_TITLE_SIZE_CHANGE \{ .COVER_CHAPTER_TITLE_SIZE +4 \}
5744 . if !d$COVER_SUBTITLE_FAM \{\
5745 . ie !d$COVER_FAM \{ .COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] \}
5746 . el \{ .COVER_SUBTITLE_FAMILY \\*[$COVER_FAM] \}
5748 . if !d$COVER_SUBTITLE_FT \{ .COVER_SUBTITLE_FONT R \}
5749 . if !d$COVER_SUBTITLE_SIZE_CHANGE \{ .COVER_SUBTITLE_SIZE +0 \}
5750 .\" (attribution and author[s])
5751 . if !d$COVER_AUTHOR_FAM \{\
5752 . ie !d$COVER_FAM \{ .COVER_AUTHOR_FAMILY \\*[$DOC_FAM] \}
5753 . el \{ .COVER_AUTHOR_FAMILY \\*[$COVER_FAM] \}
5755 . if !d$COVER_AUTHOR_FT \{ .COVER_AUTHOR_FONT I \}
5756 . if !d$COVER_AUTHOR_SIZE_CHANGE \{ .COVER_AUTHOR_SIZE +0 \}
5757 .\" (doctype if "named")
5758 . if !d$COVER_DOCTYPE_FAM \{\
5759 . ie !d$COVER_FAM \{ .COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] \}
5760 . el \{ .COVER_DOCTYPE_FAMILY \\*[$COVER_FAM] \}
5762 . if !d$COVER_DOCTYPE_FT \{ .COVER_DOCTYPE_FONT BI \}
5763 . if !d$COVER_DOCTYPE_SIZE_CHANGE \{ .COVER_DOCTYPE_SIZE +3 \}
5765 . if !d$COVER_COPYRIGHT_FAM \{\
5766 . ie !d$COVER_FAM \{ .COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] \}
5767 . el \{ .COVER_COPYRIGHT_FAMILY \\*[$COVER_FAM] \}
5769 . if !d$COVER_COPYRIGHT_FT \{ .COVER_COPYRIGHT_FONT R \}
5770 . if !d$COVER_COPYRIGHT_SIZE_CHANGE \{ .COVER_COPYRIGHT_SIZE -2 \}
5772 . if !d$DOC_COVER_LEAD_ADJ \{ .DOC_COVER_LEAD +0 \}
5773 . if !d$DOC_COVER_FAM \{ .DOC_COVER_FAMILY \\*[$DOC_FAM] \}
5775 . if !d$DOC_COVER_TITLE_FAM \{\
5776 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_TITLE_FAMILY \\*[$DOC_FAM] \}
5777 . el \{ .DOC_COVER_TITLE_FAMILY \\*[$DOC_COVER_FAM] \}
5779 . if !d$DOC_COVER_TITLE_FT \{ .DOC_COVER_TITLE_FONT B \}
5780 . if !d$DOC_COVER_TITLE_SIZE_CHANGE \{ .DOC_COVER_TITLE_SIZE +3.5 \}
5782 . if !d$DOC_COVER_CHAPTER_TITLE_FAM \{\
5783 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
5784 . el \{ .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_COVER_FAM] \}
5786 . if !d$DOC_COVER_CHAPTER_TITLE_FT \{ .DOC_COVER_CHAPTER_TITLE_FONT BI \}
5787 . if !d$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \{ .DOC_COVER_CHAPTER_TITLE_SIZE +4 \}
5789 . if !d$DOC_COVER_SUBTITLE_FAM \{\
5790 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_FAM] \}
5791 . el \{ .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_COVER_FAM] \}
5793 . if !d$DOC_COVER_SUBTITLE_FT \{ .DOC_COVER_SUBTITLE_FONT R \}
5794 . if !d$DOC_COVER_SUBTITLE_SIZE_CHANGE \{ .DOC_COVER_SUBTITLE_SIZE +0 \}
5795 .\" (attribution and author[s])
5796 . if !d$DOC_COVER_AUTHOR_FAM \{\
5797 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_FAM] \}
5798 . el \{ .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_COVER_FAM] \}
5800 . if !d$DOC_COVER_AUTHOR_FT \{ .DOC_COVER_AUTHOR_FONT I \}
5801 . if !d$DOC_COVER_AUTHOR_SIZE_CHANGE \{ .DOC_COVER_AUTHOR_SIZE +0 \}
5802 .\" (doctype if "named")
5803 . if !d$DOC_COVER_DOCTYPE_FAM \{\
5804 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_FAM] \}
5805 . el \{ .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_COVER_FAM] \}
5807 . if !d$DOC_COVER_DOCTYPE_FT \{ .DOC_COVER_DOCTYPE_FONT BI \}
5808 . if !d$DOC_COVER_DOCTYPE_SIZE_CHANGE \{ .DOC_COVER_DOCTYPE_SIZE +3 \}
5810 . if !d$DOC_COVER_COPYRIGHT_FAM \{\
5811 . ie !d$DOC_COVER_FAM \{ .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM] \}
5812 . el \{ .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_COVER_FAM] \}
5814 . if !d$DOC_COVER_COPYRIGHT_FT \{ .DOC_COVER_COPYRIGHT_FONT R \}
5815 . if !d$DOC_COVER_COPYRIGHT_SIZE_CHANGE \{ .DOC_COVER_COPYRIGHT_SIZE -2 \}
5817 . if !d$DOCHEADER_FAM \{ .DOCHEADER_FAMILY \\*[$DOC_FAM] \}
5818 . if !d$TITLE_FAM \{\
5819 . ie !d$DOCHEADER_FAM \{ .TITLE_FAMILY \\*[$DOC_FAM] \}
5820 . el \{ .TITLE_FAMILY \\*[$DOCHEADER_FAM] \}
5822 . if !d$TITLE_FT \{ .TITLE_FONT B \}
5823 . if !d$TITLE_SIZE_CHANGE \{\
5824 . ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
5825 . el \{ .TITLE_SIZE +3.5 \}
5827 . if !d$CHAPTER_TITLE_FAM \{\
5828 . ie !d$DOCHEADER_FAM \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
5829 . el \{ .CHAPTER_TITLE_FAMILY \\*[$DOCHEADER_FAM] \}
5831 . if !d$CHAPTER_TITLE_FT \{ .CHAPTER_TITLE_FONT BI \}
5832 . if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE +4 \}
5833 . if !d$SUBTITLE_FAM \{\
5834 . ie !d$DOCHEADER_FAM \{ .SUBTITLE_FAMILY \\*[$DOC_FAM] \}
5835 . el \{ .SUBTITLE_FAMILY \\*[$DOCHEADER_FAM] \}
5837 . if !d$SUBTITLE_FT \{ .SUBTITLE_FONT R \}
5838 . if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE +0 \}
5839 . if !d$AUTHOR_FAM \{\
5840 . ie !d$DOCHEADER_FAM \{ .AUTHOR_FAMILY \\*[$DOC_FAM] \}
5841 . el \{ .AUTHOR_FAMILY \\*[$DOCHEADER_FAM] \}
5843 . if !d$AUTHOR_FT \{ .AUTHOR_FONT I \}
5844 . if !d$AUTHOR_SIZE_CHANGE \{ .AUTHOR_SIZE +0 \}
5845 . if !d$DOCTYPE_FAM \{\
5846 . ie !d$DOCHEADER_FAM \{ .DOCTYPE_FAMILY \\*[$DOC_FAM] \}
5847 . el \{ .DOCTYPE_FAMILY \\*[$DOCHEADER_FAM] \}
5849 . if !d$DOCTYPE_FT \{ .DOCTYPE_FONT BI \}
5850 . if !d$DOCTYPE_SIZE_CHANGE \{ .DOCTYPE_SIZE +3 \}
5851 . if !r#DOCTYPE_UNDERLINE \{ .DOCTYPE_UNDERLINE \}
5852 .\" +Headers and footers
5853 . if !d$HDRFTR_LEFT_FAM \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
5854 . if !d$HDRFTR_LEFT_FT \{ .HDRFTR_LEFT_FONT R \}
5855 . if \\n[#HDRFTR_LEFT_CAPS] \{\
5856 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -2 \}
5858 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -.5 \}
5859 . if !d$HDRFTR_CENTER_FAM \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
5860 . if !d$HDRFTR_CENTER_FT \{ .HDRFTR_CENTER_FONT I \}
5861 . if \\n[#HDRFTR_CENTER_CAPS] \{\
5862 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
5864 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5 \}
5865 . if !d$HDRFTR_RIGHT_FAM \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] \}
5866 . if !d$HDRFTR_RIGHT_FT \{ .HDRFTR_RIGHT_FONT R \}
5867 . if \\n[#HDRFTR_RIGHT_CAPS] \{\
5868 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
5870 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -.5 \}
5872 . if !d$HEAD_FAM \{ .HEAD_FAMILY \\*[$DOC_FAM] \}
5873 . if !d$HEAD_FT \{ .HEAD_FONT B \}
5874 . if !d$HEAD_SIZE_CHANGE \{ .HEAD_SIZE +1 \}
5875 . if !r#HEAD_SPACE \{ .HEAD_SPACE \}
5877 . if !d$SH_FAM \{ .SUBHEAD_FAMILY \\*[$DOC_FAM] \}
5878 . if !d$SH_FT \{ .SUBHEAD_FONT B \}
5879 . if !d$SH_SIZE_CHANGE \{ .SUBHEAD_SIZE +.5 \}
5880 .\" +Paragraph heads
5881 . if !d$PH_FAM \{ .PARAHEAD_FAMILY \\*[$DOC_FAM] \}
5882 . if !d$PH_FT \{ .PARAHEAD_FONT BI \}
5883 . if !d$PH_SIZE_CHANGE \{ .PARAHEAD_SIZE -.25 \}
5884 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
5886 . if !d$QUOTE_FAM \{ .QUOTE_FAMILY \\*[$DOC_FAM] \}
5887 . if !d$QUOTE_FT \{ .QUOTE_FONT I \}
5888 . if !d$QUOTE_SIZE_CHANGE \{ .QUOTE_SIZE +0 \}
5889 . if !r#Q_OFFSET_VALUE \{\
5890 . if '\\*[$Q_OFFSET_VALUE]'' \{ .QUOTE_INDENT 3 \}
5893 .\" Note: the leading for quotes and blockquotes is set after .DEFAULTS in START
5894 . if !d$BQUOTE_FAM \{ .BLOCKQUOTE_FAMILY \\*[$DOC_FAM] \}
5895 . if !d$BQUOTE_FT \{ .BLOCKQUOTE_FONT R \}
5896 . if !d$BQUOTE_SIZE_CHANGE \{ .BLOCKQUOTE_SIZE -1 \}
5897 . if !d$BQUOTE_QUAD \{ .BLOCKQUOTE_QUAD LEFT \}
5899 . if !d$EPI_FAM \{ .EPIGRAPH_FAMILY \\*[$DOC_FAM] \}
5900 . if !d$EPI_FT \{ .EPIGRAPH_FONT R \}
5901 . if !d$EPI_SIZE_CHANGE \{ .EPIGRAPH_SIZE -1.5 \}
5902 . if !r#EPI_AUTOLEAD \{ .EPIGRAPH_AUTOLEAD 2 \}
5903 . if !d$EPI_QUAD \{ .EPIGRAPH_QUAD \\*[$DOC_QUAD] \}
5904 . if !r#EPI_OFFSET_VALUE \{\
5905 . if '\\*[$EPI_OFFSET_VALUE]'' \{ .EPIGRAPH_INDENT 3 \}
5908 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 3p \}
5909 . if !d$LINEBREAK_COLOR \{ .LINEBREAK_COLOR black \}
5911 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 4P \}
5912 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 3p \}
5913 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE -2 \}
5914 . if !r#FN_AUTOLEAD \{ .FOOTNOTE_AUTOLEAD 2 \}
5916 . if !r#EN_PS \{ .ENDNOTE_PT_SIZE (\\n[#DOC_PT_SIZE]u)\}
5917 . if !d$EN_STRING_FT \{ .ENDNOTE_STRING_FONT B \}
5918 . if !d$EN_STRING_SIZE_CHANGE \{ .ENDNOTE_STRING_SIZE +1 \}
5919 . if !d$EN_TITLE_FT \{ .ENDNOTE_TITLE_FONT B \}
5920 . if !d$EN_TITLE_SIZE_CHANGE \{ .ENDNOTE_TITLE_SIZE +0 \}
5921 . if !d$EN_NUMBER_FT \{ .ENDNOTE_NUMBER_FONT B \}
5922 . if !d$EN_LN_FT \{ .ENDNOTE_LINENUMBER_FONT R \}
5923 . if !d$EN_NUMBER_SIZE_CHANGE \{ .ENDNOTE_NUMBER_SIZE +0 \}
5924 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT 1.5m \}
5926 . if !r#BIB_LIST \{ .BIBLIOGRAPHY_TYPE LIST . \}
5927 . if !r#BIB_PS \{ .BIBLIOGRAPHY_PT_SIZE (\\n[#DOC_PT_SIZE]u) \}
5928 . if !d$BIB_STRING_FT \{ .BIBLIOGRAPHY_STRING_FONT B \}
5929 . if !d$BIB_STRING_SIZE_CHANGE \{ .BIBLIOGRAPHY_STRING_SIZE +1 \}
5930 .\" +Table of contents
5931 . if !d$TOC_FAM \{ .TOC_FAMILY \\*[$DOC_FAM] \}
5932 . if !r#TOC_PS \{ .TOC_PT_SIZE (\\n[#DOC_PT_SIZE]u) \}
5933 . if !r#TOC_LEAD \{ .TOC_LEAD \\n[#DOC_LEAD]u ADJUST \}
5934 . if !d$TOC_HEADER_FAM \{ .TOC_HEADER_FAMILY \\*[$TOC_FAM] \}
5935 . if !d$TOC_HEADER_SIZE_CHANGE \{ .TOC_HEADER_SIZE +4 \}
5936 . if !d$TOC_HEADER_FT \{ .TOC_HEADER_FONT B \}
5937 . if !d$TOC_TITLE_FAM \{ .TOC_TITLE_FAMILY \\*[$TOC_FAM] \}
5938 . if !d$TOC_PN_FAM \{ .TOC_PN_FAMILY \\*[$TOC_FAM] \}
5939 . if !d$TOC_HEAD_FAM \{ .TOC_HEAD_FAMILY \\*[$TOC_FAM] \}
5940 . if !d$TOC_SH_FAM \{ .TOC_SUBHEAD_FAMILY \\*[$TOC_FAM] \}
5941 . if !d$TOC_PH_FAM \{ .TOC_PARAHEAD_FAMILY \\*[$TOC_FAM] \}
5942 . if !d$TOC_TITLE_FT \{ .TOC_TITLE_FONT BI \}
5943 . if !d$TOC_PN_FT \{ .TOC_PN_FONT R \}
5944 . if !d$TOC_HEAD_FT \{ .TOC_HEAD_FONT B \}
5945 . if !d$TOC_SH_FT \{ .TOC_SUBHEAD_FONT R \}
5946 . if !d$TOC_PH_FT \{ .TOC_PARAHEAD_FONT I \}
5947 . if !d$TOC_TITLE_SIZE_CHANGE \{ .TOC_TITLE_SIZE +.5 \}
5948 . if !d$TOC_PN_SIZE_CHANGE \{ .TOC_PN_SIZE +0 \}
5949 . if !d$TOC_HEAD_SIZE_CHANGE \{ .TOC_HEAD_SIZE +.5 \}
5950 . if !d$TOC_SH_SIZE_CHANGE \{ .TOC_SUBHEAD_SIZE +0 \}
5951 . if !d$TOC_PH_SIZE_CHANGE \{ .TOC_PARAHEAD_SIZE +0 \}
5952 . ps \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
5953 . if !r#TOC_HEAD_INDENT \{ .TOC_HEAD_INDENT \w'\0\0.' \}
5955 . ps \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
5956 . if !r#TOC_SH_INDENT \{ .TOC_SUBHEAD_INDENT \\n[#TOC_HEAD_INDENT]+\w'\0\0.' \}
5958 . ps \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
5959 . if !r#TOC_PH_INDENT \{ .TOC_PARAHEAD_INDENT \\n[#TOC_SH_INDENT]+\w'\0\0.' \}
5963 . if !r#EN_REF \{ .nr #FN_REF 1 \}
5964 . if '\\*[$REF_FN_INDENT]'' \{\
5965 . if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS FOOTNOTE 2m \}
5966 . if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS FOOTNOTE 1.5m \}
5968 . if '\\*[$REF_EN_INDENT]'' \{\
5969 . if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS ENDNOTE 2m \}
5970 . if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS ENDNOTE 1.5m \}
5972 . if '\\*[$REF_BIB_INDENT]'' \{\
5973 . if \\n[#PRINT_STYLE]=1 \{ .INDENT_REFS BIBLIO 2m \}
5974 . if \\n[#PRINT_STYLE]=2 \{ .INDENT_REFS BIBLIO 1.5m :\}
5976 .\" Adjust doc leading for PRINTSTYLE TYPESET
5977 . if \\n[#PRINT_STYLE]=2 \{\
5978 . ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
5981 .\" This diversion is to get a value for #FN_AUTOLEAD
5984 . if \\n[#PRINT_STYLE]=1 \{\
5986 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
5987 . el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
5989 . if \\n[#PRINT_STYLE]=2 \{\
5990 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
5991 . AUTOLEAD \\n[#FN_AUTOLEAD]
5993 . nr #FN_LEAD \\n[#LEAD]
5994 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u \}
5997 . ie !\\n[#COLLATE] \{\
5998 .\" DOC_LEAD adjusted (or not) here
6000 .\" Endnote, bibliography and toc leading
6001 . nr #OK_PROCESS_LEAD 1
6002 . nr #RESTORE_DOC_LEAD \\n(.v
6003 . nr #RESTORE_B_MARGIN \\n[#B_MARGIN]
6004 . if \\n[#PRINT_STYLE]=1 \{\
6005 . ie \\n[#SINGLE_SPACE] \{\
6006 . ENDNOTE_LEAD 12 ADJUST
6007 . BIBLIOGRAPHY_LEAD 12 ADJUST
6010 . ie \\n[#EN_SINGLESPACE] \{ .ENDNOTE_LEAD 12 ADJUST \}
6011 . el \{ .ENDNOTE_LEAD 24 ADJUST \}
6012 . ie \\n[#BIB_SINGLESPACE] \{ .BIBLIOGRAPHY_LEAD 12 ADJUST \}
6013 . el \{ .BIBLIOGRAPHY_LEAD 24 ADJUST \}
6016 . if \\n[#PRINT_STYLE]=2 \{\
6017 . ie !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
6018 . el \{ .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] \}
6019 . ie !d$BIB_LEAD \{ .BIBLIOGRAPHY_LEAD 14 ADJUST \}
6020 . el \{ .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD] \}
6021 . ie !d$TOC_LEAD \{ .TOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
6022 . el \{ .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] \}
6023 . rm $ADJUST_EN_LEAD
6024 . rm $ADJUST_BIB_LEAD
6025 . rm $ADJUST_TOC_LEAD
6027 . ie !d$BIB_SPACE \{ .BIBLIOGRAPHY_SPACING 1v \}
6029 . if \\n[#DEFER_BIB_SPACING]=1 \{\
6030 . BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE]
6031 . rr #DEFER_BIB_SPACING
6034 . DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
6035 . nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
6038 . if \\n[#COLLATE] \{\
6039 . if !\\n[#PRINT_STYLE]=1 \{\
6040 . if \\n[#RERUN_TRAPS] \{ .TRAPS \}
6044 . if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
6047 \# ====================================================================
6049 \# +++START THE DOCUMENT+++
6056 \# Reads in default document style parameters and any parameter
6057 \# the user has changed before issuing START.
6058 \# Using the information gathered in the opening macros,
6059 \# prints appropriate title (or chapter #), subtitle, author
6060 \# and document type (if appropriate).
6062 \# The .PRINT \& (zero-width character) is required to get the
6063 \# subsequent .sp request to work as advertised.
6065 \# The overall document line length, family, and point-size
6066 \# are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
6067 \# use in the HEADER and FOOTER macros.
6069 \# First, define some strings for point sizes
6072 .ds $DOC_COVER_AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_AUTHOR_SIZE_CHANGE]
6073 .ds $DOC_COVER_CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE]
6074 .ds $DOC_COVER_COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_COPYRIGHT_SIZE_CHANGE]
6075 .ds $DOC_COVER_DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_DOCTYPE_SIZE_CHANGE]
6076 .ds $DOC_COVER_SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_SUBTITLE_SIZE_CHANGE]
6077 .ds $DOC_COVER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_TITLE_SIZE_CHANGE]
6079 .ds $COVER_AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_AUTHOR_SIZE_CHANGE]
6080 .ds $COVER_CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_CHAPTER_TITLE_SIZE_CHANGE]
6081 .ds $COVER_COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_COPYRIGHT_SIZE_CHANGE]
6082 .ds $COVER_DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_DOCTYPE_SIZE_CHANGE]
6083 .ds $COVER_SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_SUBTITLE_SIZE_CHANGE]
6084 .ds $COVER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COVER_TITLE_SIZE_CHANGE]
6086 .ds $AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
6087 .ds $CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
6088 .ds $COPYRIGHT_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$COPYRIGHT_SIZE_CHANGE]
6089 .ds $DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
6090 .ds $SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
6091 .ds $TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
6093 \# Next, some utility macros for various routines to prevent repetition
6095 . if '\\$1'DOC_COVER' \{\
6097 . nr #AUTHOR_DOCCOVER_NUM 0 1
6098 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_DOCCOVER_NUM] \{\
6099 . ds $AUTHOR_DOCCOVER_\\n+[#AUTHOR_DOCCOVER_NUM] \\$\\n[#AUTHOR_DOCCOVER_NUM]
6103 . if '\\$1'COVER' \{\
6105 . nr #AUTHOR_COVER_NUM 0 1
6106 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_COVER_NUM] \{\
6107 . ds $AUTHOR_COVER_\\n+[#AUTHOR_COVER_NUM] \\$\\n[#AUTHOR_COVER_NUM]
6112 .MAC PRINT_AUTHORS END
6113 . ie r#DOING_COVER \{\
6114 . if \\n[#DOC_COVER]=1 \{\
6115 . ie !'\\*[$AUTHOR_DOCCOVER_1]'' \{\
6116 . nr #AUTHORS \\n[#AUTHOR_DOCCOVER_NUM]
6117 . nr #NEXT_AUTHOR 0 1
6118 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6119 . ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \{\
6120 . PRINT \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_DOCCOVER_\\n+[#NEXT_AUTHOR]]\m[]
6122 . el \{ .PRINT \\*[$AUTHOR_DOCCOVER_\\n+[#NEXT_AUTHOR]] \}
6126 . nr #AUTHORS \\n[#AUTHOR_NUM]
6127 . nr #NEXT_AUTHOR 0 1
6128 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6129 . ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \{\
6130 . PRINT \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6132 . el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
6137 . if \\n[#COVER]=1 \{\
6138 . ie !'\\*[$AUTHOR_COVER_1]'' \{\
6139 . nr #AUTHORS \\n[#AUTHOR_COVER_NUM]
6140 . nr #NEXT_AUTHOR 0 1
6141 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6142 . ie \\n[#COVER_AUTHOR_COLOR]=1 \{\
6143 . PRINT \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_COVER_\\n+[#NEXT_AUTHOR]]\m[]
6145 . el \{ .PRINT \\*[$AUTHOR_COVER_\\n+[#NEXT_AUTHOR]] \}
6149 . nr #AUTHORS \\n[#AUTHOR_NUM]
6150 . nr #NEXT_AUTHOR 0 1
6151 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6152 . ie \\n[#COVER_AUTHOR_COLOR]=1 \{\
6153 . PRINT \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6155 . el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
6162 . nr #AUTHORS \\n[#AUTHOR_NUM]
6163 . nr #NEXT_AUTHOR 0 1
6164 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6165 . ie \\n[#AUTHOR_COLOR]=1 \{\
6166 . PRINT \m[\\*[$AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6168 . el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
6173 .MAC DEFAULT_DOCHEADER END
6174 . if !'\\*[$TITLE_1]'' \{\
6176 . FAMILY \\*[$TITLE_FAM]
6178 . PT_SIZE \\*[$TITLE_PT_SIZE]
6179 . LS \\n[#DOCHEADER_LEAD]u
6181 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6182 . ie \\n[#TITLE_COLOR]=1 \{\
6183 . PRINT "\m[\\*[$TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6186 . PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6190 . if !'\\*[$SUBTITLE_1]'' \{\
6191 . FAMILY \\*[$SUBTITLE_FAM]
6192 . FT \\*[$SUBTITLE_FT]
6193 . PT_SIZE \\*[$SUBTITLE_PT_SIZE]
6195 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6196 . ie \\n[#SUBTITLE_COLOR]=1 \{\
6197 . PRINT "\m[\\*[$SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n[#ARG_NUM]]\m[]
6200 . PRINT "\\*[$SUBTITLE_\\n[#ARG_NUM]]
6204 . if !'\\*[$AUTHOR_1]'' \{\
6205 . FAMILY \\*[$AUTHOR_FAM]
6206 . FT \\*[$AUTHOR_FT]
6207 . PT_SIZE \\*[$AUTHOR_PT_SIZE]
6208 . ie \\n[#ATTRIBUTE_COLOR]=1 \{\
6209 . PRINT \&\m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
6211 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING] \}
6214 . FAMILY \\*[$DOC_FAM]
6219 .MAC CHAPTER_DOCHEADER END
6221 . FAMILY \\*[$TITLE_FAM]
6223 . PT_SIZE \\*[$TITLE_PT_SIZE]
6224 . LS \\n[#DOCHEADER_LEAD]u
6225 .\" Chapter title only
6226 . ie '\\*[$CHAPTER]'' \{\
6227 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
6228 . if \\n[#PRINT_STYLE]=2 \{\
6229 . FAMILY \\*[$CHAPTER_TITLE_FAM]
6230 . FT \\*[$CHAPTER_TITLE_FT]
6231 . PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
6232 . LS \\n[#DOCHEADER_LEAD]u
6235 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6236 . ie \\n[#TITLE_COLOR]=1 \{\
6237 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6239 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
6243 . ie \\n[#TITLE_COLOR]=1 \{\
6244 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING]\m[]
6246 . el \{ .PRINT \\*[$CHAPTER_STRING] \}
6249 .\" Chapter string, possibly with a chapter title
6251 . ie \\n[#TITLE_COLOR]=1 \{\
6252 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6254 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
6255 . if !'\\*[$CHAPTER_TITLE_1]'' \{\
6256 . if \\n[#PRINT_STYLE]=2 \{\
6257 . FAMILY \\*[$CHAPTER_TITLE_FAM]
6258 . FT \\*[$CHAPTER_TITLE_FT]
6259 . PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
6260 . LS \\n[#DOCHEADER_LEAD]u
6261 . ALD \\n[.v]u/4u \"Put a little space before the chapter title
6264 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6265 . ie \\n[#CHAPTER_TITLE_COLOR]=1 \{\
6266 . PRINT \m[\\*[$CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6268 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
6270 . RLD \\n[#DOC_LEAD]u \" Just looks better this way
6273 . FAMILY \\*[$DOC_FAM]
6278 .MAC NAMED_DOCHEADER END
6280 . FAMILY \\*[$TITLE_FAM]
6282 . PT_SIZE \\*[$TITLE_PT_SIZE]
6283 . LS \\n[#DOCHEADER_LEAD]u
6284 . if !'\\*[$TITLE_1]'' \{\
6286 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6287 . ie \\n[#TITLE_COLOR]=1 \{\
6288 . PRINT "\m[\\*[$TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6291 . PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6295 . if !'\\*[$SUBTITLE]'' \{\
6296 . FAMILY \\*[$SUBTITLE_FAM]
6297 . FT \\*[$SUBTITLE_FT]
6298 . PT_SIZE \\*[$SUBTITLE_PT_SIZE]
6300 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6301 . ie \\n[#SUBTITLE_COLOR]=1 \{\
6302 . PRINT "\m[\\*[$SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n[#ARG_NUM]]\m[]
6305 . PRINT "\\*[$SUBTITLE_\\n[#ARG_NUM]]
6309 . if !'\\*[$AUTHOR_1]'' \{\
6310 . FAMILY \\*[$AUTHOR_FAM]
6311 . FT \\*[$AUTHOR_FT]
6312 . PT_SIZE \\*[$AUTHOR_PT_SIZE]
6313 . ie \\n[#ATTRIBUTE_COLOR]=1 \{\
6314 . PRINT \&\m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
6316 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING] \}
6319 . FAMILY \\*[$DOCTYPE_FAM]
6320 . FT \\*[$DOCTYPE_FT]
6321 . PT_SIZE \\*[$DOCTYPE_PT_SIZE]
6322 . LS \\n[#DOCHEADER_LEAD]u
6323 . ALD \\n[#DOCHEADER_LEAD]u
6324 . nr #FROM_DOCTYPE 1
6325 . if \\n[#DOCTYPE_COLOR]=1 \{\
6326 . COLOR \\*[$DOCTYPE_COLOR]
6328 . ie \\n[#DOCTYPE_UNDERLINE]=1 \{\
6329 . UNDERSCORE \\*[$DOCTYPE_UNDERLINE_GAP] "\\*[$DOC_TYPE]"
6332 . PRINT "\\*[$DOC_TYPE]"
6335 . FAMILY \\*[$DOC_FAM]
6344 \# TITLE | DOCTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE | COVERTITLE ...
6345 \# ... [ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC BLANKPAGE ]
6347 \# Toggles the number register for each cover page element
6348 \# passed as an argument.
6350 \# TITLE, DOCTITLE, CHAPTER, CHAPTER_TITLE or CHAPTER+TITLE must
6351 \# be supplied. After that, users may enter as many or as few of
6352 \# the arguments as they like; however, the arguments must appear
6353 \# in the order given above. BLANKPAGE, as the final argument,
6354 \# inserts a blank page after the cover.
6356 \# If called as DOC_COVER, performs the same operations, but
6357 \# applies everything to a doc cover.
6360 . ie '\\$0'DOC_COVER' \{\
6361 . if '\\$\\n[#NUM_ARGS]'BLANKPAGE' \{ .nr #DOCCOVER_BLANKPAGE 1 \}
6363 . if '\\$1'TITLE' \{ .nr #DOC_COVER_TITLE 1 \}
6364 . if '\\$1'DOCTITLE' \{ .nr #DOC_COVER_TITLE 2 \}
6365 . if '\\$1'CHAPTER' \{ .nr #DOC_COVER_TITLE 3 \}
6366 . if '\\$1'CHAPTER_TITLE' \{ .nr #DOC_COVER_TITLE 4 \}
6367 . if '\\$1'CHAPTER+TITLE' \{ .nr #DOC_COVER_TITLE 5 \}
6368 . if '\\$1'COVERTITLE' \{ .nr #DOC_COVER_TITLE 6 \}
6369 . if '\\$2'SUBTITLE' \{ .nr #DOC_COVER_SUBTITLE 1 \}
6370 . if '\\$2'AUTHOR' \{ .nr #DOC_COVER_AUTHOR 1 \}
6371 . if '\\$2'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
6372 . if '\\$2'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
6373 . if '\\$2'MISC' \{ .nr #DOC_COVER_MISC 1 \}
6374 . if '\\$3'AUTHOR' \{ .nr #DOC_COVER_AUTHOR 1 \}
6375 . if '\\$3'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
6376 . if '\\$3'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
6377 . if '\\$3'MISC' \{ .nr #DOC_COVER_MISC 1 \}
6378 . if '\\$4'DOCTYPE' \{ .nr #DOC_COVER_DOCTYPE 1 \}
6379 . if '\\$4'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
6380 . if '\\$4'MISC' \{ .nr #DOC_COVER_MISC 1 \}
6381 . if '\\$5'COPYRIGHT' \{ .nr #DOC_COVER_COPYRIGHT 1 \}
6382 . if '\\$5'MISC' \{ .nr #DOC_COVER_MISC 1 \}
6383 . if '\\$6'MISC' \{ .nr #DOC_COVER_MISC 1 \}
6386 . if '\\$\\n[#NUM_ARGS]'BLANKPAGE' \{ .nr #COVER_BLANKPAGE 1 \}
6388 . if '\\$1'TITLE' \{ .nr #COVER_TITLE 1 \}
6389 . if '\\$1'DOCTITLE' \{ .nr #COVER_TITLE 2 \}
6390 . if '\\$1'CHAPTER' \{ .nr #COVER_TITLE 3 \}
6391 . if '\\$1'CHAPTER_TITLE' \{ .nr #COVER_TITLE 4 \}
6392 . if '\\$1'CHAPTER+TITLE' \{ .nr #COVER_TITLE 5 \}
6393 . if '\\$1'COVERTITLE' \{ .nr #COVER_TITLE 6 \}
6394 . if '\\$2'SUBTITLE' \{ .nr #COVER_SUBTITLE 1 \}
6395 . if '\\$2'AUTHOR' \{ .nr #COVER_AUTHOR 1 \}
6396 . if '\\$2'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
6397 . if '\\$2'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
6398 . if '\\$2'MISC' \{ .nr #COVER_MISC 1 \}
6399 . if '\\$3'AUTHOR' \{ .nr #COVER_AUTHOR 1 \}
6400 . if '\\$3'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
6401 . if '\\$3'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
6402 . if '\\$3'MISC' \{ .nr #COVER_MISC 1 \}
6403 . if '\\$4'DOCTYPE' \{ .nr #COVER_DOCTYPE 1 \}
6404 . if '\\$4'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
6405 . if '\\$4'MISC' \{ .nr #COVER_MISC 1 \}
6406 . if '\\$5'COPYRIGHT' \{ .nr #COVER_COPYRIGHT 1 \}
6407 . if '\\$5'MISC' \{ .nr #COVER_MISC 1 \}
6408 . if '\\$6'MISC' \{ .nr #COVER_MISC 1 \}
6414 . ie '\\$0'DOC_COVERTITLE' \{\
6415 . ie \\n[#NUM_ARGS]=0 \{\
6416 . if \\n[#DOC_COVER_TITLE_NUM] \{\
6418 . while \\n[#DOC_COVER_TITLE_NUM]>\\n[#ITEM] \{\
6419 . rm $DOC_COVER_TITLE_\\n+[#ITEM]
6421 . rr #DOC_COVER_TITLE_NUM
6422 . rm $DOC_COVER_TITLE
6426 . nr #DOC_COVER_TITLE_NUM 0 1
6427 . while \\n[#NUM_ARGS]>\\n[#DOC_COVER_TITLE_NUM] \{\
6428 . ds $DOC_COVER_TITLE_\\n+[#DOC_COVER_TITLE_NUM] \\$\\n[#DOC_COVER_TITLE_NUM]
6430 . ds $DOC_COVER_TITLE \\$*
6434 . ie \\n[#NUM_ARGS]=0 \{\
6435 . if \\n[#COVER_TITLE_NUM] \{\
6437 . while \\n[#COVER_TITLE_NUM]>\\n[#ITEM] \{\
6438 . rm $COVER_TITLE_\\n+[#ITEM]
6440 . rr #COVER_TITLE_NUM
6445 . nr #COVER_TITLE_NUM 0 1
6446 . while \\n[#NUM_ARGS]>\\n[#COVER_TITLE_NUM] \{\
6447 . ds $COVER_TITLE_\\n+[#COVER_TITLE_NUM] \\$\\n[#COVER_TITLE_NUM]
6449 . ds $COVER_TITLE \\$*
6455 \# COVER PAGE LEADING
6456 \# ------------------
6458 \# <+|- amount by which to in/decrease leading of cover/doc cover>
6460 \# Stores user supplied lead in/decrease in string $COVER_LEAD_ADJ
6461 \# or $DOC_COVER_LEAD_ADJ, depending on whether the macro was called
6462 \# with an alias (DOC_COVER_LEAD).
6464 \# A unit of measure must be supplied. Decimal fractions OK.
6465 \# Default is +0, i.e. same as DOC_LEAD.
6468 . ie '\\$0'DOC_COVER_LEAD' \{\
6469 . ds $DOC_COVER_LEAD_ADJ \\$1
6472 . ds $COVER_LEAD_ADJ \\$1
6477 \# COVER PAGE START POSITION
6478 \# -------------------------
6480 \# <distance from page top at which to start cover/doc cover>
6482 \# Stores user supplied lead in/decrease in #COVER_START_POS
6483 \# or #DOC_COVER_START_POS, depending on whether the macro was
6484 \# called by an alias (DOC_COVER_ADVANCE).
6486 \# A unit of measure must be supplied. Decimal fractions OK.
6487 \# If user doesn't invoke this macro, the default starting
6488 \# position for both covers and doc covers is 1/3 of the way
6489 \# down the page (setup in DO_COVER).
6491 .MAC COVER_ADVANCE END
6492 . ie '\\$0'DOC_COVER_ADVANCE' \{\
6493 . nr #DOC_COVER_START_POS (\\$1)
6496 . nr #COVER_START_POS (\\$1)
6501 \# UNDERLINE CONTROL
6502 \# -----------------
6504 \# [ DOUBLE ] [ <underline weight> [<underline gap>] ] | <none> | <anything>
6506 \# Toggles underlining of the element indicated by the calling alias
6507 \# on or off. Uses #<element>_UNDERLINE_WEIGHT to set the weight,
6508 \# and defines string $<element>_UNDERLINE_GAP.
6510 \# Calling aliases COVER_ and DOCCOVER_ only apply if DOCTYPE is
6511 \# NAMED and the DOCTYPE arg is passed to COVER or DOC_COVER.
6515 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{ .nr #BIB_STRING_UNDERLINE 1 \}
6516 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{ .nr #BIB_STRING_UNDERLINE 1 \}
6517 . if '\\$0'COVER_UNDERLINE' \{ .nr #COVER_UNDERLINE 1 \}
6518 . if '\\$0'DOC_COVER_UNDERLINE' \{ .nr #DOCCOVER_UNDERLINE 1 \}
6519 . if '\\$0'DOCTYPE_UNDERLINE' \{ .nr #DOCTYPE_UNDERLINE 1 \}
6520 . if '\\$0'HEAD_UNDERLINE' \{ .nr #HEAD_UNDERLINE 1 \}
6521 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{ .nr #EN_STRING_UNDERLINE 1 \}
6522 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{ .nr #EN_STRING_UNDERLINE 1 \}
6523 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{ .nr #EN_TITLE_UNDERLINE 1 \}
6524 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{ .nr #EN_TITLE_UNDERLINE 1 \}
6527 . ie \\n[#NUM_ARGS]=1 \{\
6530 . ie \B'\\*[$ARG]' \{\
6531 . if !\\n[#PRINT_STYLE]=1 \{\
6532 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{ .BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1 \}
6533 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{ .BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1 \}
6534 . if '\\$0'COVER_UNDERLINE' \{ .COVER_UNDERLINE_WEIGHT \\$1 \}
6535 . if '\\$0'DOC_COVER_UNDERLINE' \{ .DOCCOVER_UNDERLINE_WEIGHT \\$1 \}
6536 . if '\\$0'DOCTYPE_UNDERLINE' \{ .DOCTYPE_UNDERLINE_WEIGHT \\$1 \}
6537 . if '\\$0'HEAD_UNDERLINE' \{ .HEAD_UNDERLINE_WEIGHT \\$1 \}
6538 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{ .ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1 \}
6539 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{ .ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1 \}
6540 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{ .ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1 \}
6541 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{ .ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1 \}
6545 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{\
6546 . ie '\\$1'DOUBLE' \{ .nr #BIB_STRING_UNDERLINE 2 \}
6547 . el \{ .nr #BIB_STRING_UNDERLINE 0 \}
6549 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{\
6550 . ie '\\$1'DOUBLE' \{ .nr #BIB_STRING_UNDERLINE 2 \}
6551 . el \{ .nr #BIB_STRING_UNDERLINE 0 \}
6553 . if '\\$0'COVER_UNDERLINE' \{ .nr #COVER_UNDERLINE 0 \}
6554 . if '\\$0'DOC_COVER_UNDERLINE' \{ .nr #DOCCOVER_UNDERLINE 0 \}
6555 . if '\\$0'DOCTYPE_UNDERLINE' \{ .nr #DOCTYPE_UNDERLINE 0 \}
6556 . if '\\$0'HEAD_UNDERLINE' \{ .nr #HEAD_UNDERLINE 0 \}
6557 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\
6558 . ie '\\$1'DOUBLE' \{ .nr #EN_STRING_UNDERLINE 2 \}
6559 . el \{ .nr #EN_STRING_UNDERLINE 0 \}
6561 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\
6562 . ie '\\$1'DOUBLE' \{ .nr #EN_STRING_UNDERLINE 2 \}
6563 . el \{ .nr #EN_STRING_UNDERLINE 0 \}
6568 . if !\\n[#PRINT_STYLE]=1 \{\
6569 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{\
6570 . nr #BIB_STRING_UNDERLINE 1
6571 . if '\\$1'DOUBLE' \{\
6572 . nr #BIB_STRING_UNDERLINE 2
6575 . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6577 . ds $BIB_STRING_UNDERLINE_GAP \\$2
6580 . ds $BIB_STRING_RULE_GAP \\$3
6583 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{\
6584 . nr #BIB_STRING_UNDERLINE 1
6585 . if '\\$1'DOUBLE' \{\
6586 . nr #BIB_STRING_UNDERLINE 2
6589 . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6591 . ds $BIB_STRING_UNDERLINE_GAP \\$2
6594 . ds $BIB_STRING_RULE_GAP \\$3
6597 . if '\\$0'COVER_UNDERLINE' \{\
6598 . nr #COVER_UNDERLINE 1
6599 . COVER_UNDERLINE_WEIGHT \\$1
6600 . ds $COVER_UNDERLINE_GAP \\$2
6602 . if '\\$0'DOC_COVER_UNDERLINE' \{\
6603 . nr #DOCCOVER_UNDERLINE 1
6604 . DOCCOVER_UNDERLINE_WEIGHT \\$1
6605 . ds $DOCCOVER_UNDERLINE_GAP \\$2
6607 . if '\\$0'DOCTYPE_UNDERLINE' \{\
6608 . nr #DOCTYPE_UNDERLINE 1
6609 . DOCTYPE_UNDERLINE_WEIGHT \\$1
6610 . ds $DOCTYPE_UNDERLINE_GAP \\$2
6612 . if '\\$0'HEAD_UNDERLINE' \{\
6613 . nr #HEAD_UNDERLINE 1
6614 . HEAD_UNDERLINE_WEIGHT \\$1
6615 . ds $HEAD_UNDERLINE_GAP \\$2
6617 \# ENDNOTE_STRING_UNDERLINE and ENDNOTE_STRING_UNDERSCORE are identical;
6618 \# the _UNDERSCORE version is left in for backward compatibility.
6619 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\
6620 . nr #EN_STRING_UNDERLINE 1
6621 . if '\\$1'DOUBLE' \{\
6622 . nr #EN_STRING_UNDERLINE 2
6625 . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6627 . ds $EN_STRING_UNDERLINE_GAP \\$2
6630 . ds $EN_STRING_RULE_GAP \\$3
6633 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\
6634 . nr #EN_STRING_UNDERLINE 1
6635 . if '\\$1'DOUBLE' \{\
6636 . nr #EN_STRING_UNDERLINE 2
6639 . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6641 . ds $EN_STRING_UNDERLINE_GAP \\$2
6644 . ds $EN_STRING_RULE_GAP \\$3
6647 \# ENDNOTE_TITLE_UNDERLINE and ENDNOTE_TITLE_UNDERSCORE are identical;
6648 \# the _UNDERSCORE version is left in for backward compatibility.
6649 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{\
6650 . nr #ENDNOTE_TITLE_UNDERLINE 1
6651 . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6652 . ds $EN_TITLE_UNDERLINE_GAP \\$2
6654 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{\
6655 . nr #ENDNOTE_TITLE_UNDERLINE 1
6656 . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6657 . ds $EN_TITLE_UNDERLINE_GAP \\$2
6664 .ALIAS BIBLIOGRAPHY_STRING_UNDERSCORE _UNDERLINE
6665 .ALIAS BIBLIOGRAPHY_STRING_UNDERLINE _UNDERLINE
6666 .ALIAS COVER_UNDERLINE _UNDERLINE
6667 .ALIAS DOC_COVER_UNDERLINE _UNDERLINE
6668 .ALIAS DOCTYPE_UNDERLINE _UNDERLINE
6669 .ALIAS HEAD_UNDERLINE _UNDERLINE
6670 .ALIAS ENDNOTE_STRING_UNDERLINE _UNDERLINE
6671 .ALIAS ENDNOTE_STRING_UNDERSCORE _UNDERLINE
6672 .ALIAS ENDNOTE_TITLE_UNDERLINE _UNDERLINE
6673 .ALIAS ENDNOTE_TITLE_UNDERSCORE _UNDERLINE
6676 \# COVERS - WHETHER TO PRINT
6677 \# -------------------------
6679 \# <none> | <anything>
6681 \# Creates or removes registers #COVERS and #COVERS_OFF, checked for
6682 \# in DEFAULTS (in START) prior to printing
6685 . ie '\\$0'DOC_COVERS' \{\
6687 . rr #DOC_COVERS_OFF
6692 . nr #DOC_COVERS_OFF 1
6708 \# COVER_COUNTS_PAGES
6709 \# ------------------
6711 \# <none> | <anything>
6713 \# Creates or removes registers #COVERS_COUNT or #DOCCOVERS_COUNT,
6714 \# used in END_COVER to determine whether to increment the page
6715 \# number silently when doc covers or covers are output.
6717 .MAC COVER_COUNTS_PAGES END
6718 . if '\\$0'DOC_COVER_COUNTS_PAGES' \{\
6719 . ie '\\$1'' \{ .nr #DOCCOVERS_COUNT 1 \}
6720 . el \{ .rr #DOCCOVERS_COUNT \}
6723 . if '\\$0'COVER_COUNTS_PAGES' \{\
6724 . ie '\\$1'' \{ .nr #COVERS_COUNT 1 \}
6725 . el \{ .rr #COVERS_COUNT \}
6736 . if \\n[#PAGINATE]=1 \{\
6737 . nr #PAGINATION_WAS_ON 1
6740 . if \\n[#HEADERS_ON]=1 \{\
6741 . nr #HEADERS_WERE_ON 1
6744 . if \\n[#FOOTERS_ON]=1 \{\
6745 . nr #FOOTERS_WERE_ON 1
6748 . if \\n[#COLUMNS]=1 \{\
6749 . nr #COLUMNS_WERE_ON 1
6753 . ie '\\$0'DO_DOC_COVER' \{\
6754 . if !r#DOC_COVER_START_POS \{\
6755 . nr #DOC_COVER_START_POS \\n[#PAGE_LENGTH]/3
6757 . if \\n[#PRINT_STYLE]=1 \{\
6758 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
6759 . el \{ .vs \\n[#DOC_LEAD]u \}
6761 . if \\n[#PRINT_STYLE]=2 \{\
6762 . LS \\n[#DOC_LEAD]u\\*[$DOC_COVER_LEAD_ADJ]
6763 . nr #DOC_COVER_LEAD \\n[#LEAD]
6766 . sp |\\n[#DOC_COVER_START_POS]u-1v
6767 . if \\n[#DOC_COVER_COLOR]=1 \{\
6769 \m[\\*[$DOC_COVER_COLOR]]
6773 . FAMILY \\*[$DOC_COVER_TITLE_FAM]
6774 . FT \\*[$DOC_COVER_TITLE_FT]
6775 . PT_SIZE \\*[$DOC_COVER_TITLE_PT_SIZE]
6776 . LS \\n[#DOC_COVER_LEAD]u
6777 . if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
6778 . if \\n[#DOC_COVER_TITLE]=1 \{\
6779 . ie \\n[#PRINT_STYLE]=1 \{\
6782 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6783 . UNDERSCORE "\\*[$TITLE_\\n[#ARG_NUM]]"
6789 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6790 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6791 . PRINT "\m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6794 . PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6799 . if \\n[#DOC_COVER_TITLE]=2 \{\
6800 . ie \\n[#PRINT_STYLE]=1 \{\
6803 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6804 . UNDERSCORE "\\*[$DOC_TITLE_\\n[#ARG_NUM]]"
6810 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6811 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6812 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_TITLE_\\n[#ARG_NUM]]\m[]
6814 . el \{ .PRINT \\*[$DOC_TITLE_\\n[#ARG_NUM]] \}
6818 . if \\n[#DOC_COVER_TITLE]=3 \{\
6819 . ie \\n[#PRINT_STYLE]=1 \{\
6821 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6825 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6826 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6828 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
6831 . if \\n[#DOC_COVER_TITLE]=4 \{\
6832 . ie \\n[#PRINT_STYLE]=1 \{\
6835 . ie \\n[#SINGLE_SPACE]=0 \{\
6836 . vs \\n[#DOC_LEAD]u/2u
6839 . vs \\n[#DOC_LEAD]u
6842 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6843 . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
6846 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u \}
6850 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6851 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6852 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6854 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
6858 . if \\n[#DOC_COVER_TITLE]=5 \{\
6859 . ie \\n[#PRINT_STYLE]=1 \{\
6861 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6865 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6866 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6868 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
6870 . if !'\\*[$CHAPTER_TITLE_1]'' \{\
6871 . ie \\n[#PRINT_STYLE]=1 \{\
6872 . ie \\n[#SINGLE_SPACE]=0 \{\
6873 . vs \\n[#DOC_LEAD]u/2u
6876 . vs \\n[#DOC_LEAD]u
6880 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6881 . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
6883 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u \}
6886 . FAMILY \\*[$DOC_COVER_CHAPTER_TITLE_FAM]
6887 . FT \\*[$DOC_COVER_CHAPTER_TITLE_FT]
6888 . PT_SIZE \\*[$DOC_COVER_CHAPTER_TITLE_PT_SIZE]
6890 . ALD \\n[.v]u/4u \"Put a little space before the chapter title
6891 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6892 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6893 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6895 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
6900 . if \\n[#DOC_COVER_TITLE]=6 \{\
6901 . ie \\n[#PRINT_STYLE]=1 \{\
6904 . while \\n[#DOC_COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6905 . UNDERSCORE "\\*[$DOC_COVER_TITLE_\\n[#ARG_NUM]]"
6911 . while \\n[#DOC_COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6912 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
6913 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_COVER_TITLE_\\n[#ARG_NUM]]\m[]
6915 . el \{ .PRINT \\*[$DOC_COVER_TITLE_\\n[#ARG_NUM]] \}
6919 . if !\\n[#DOC_TYPE]=2 \{\
6920 . if \\n[#DOC_COVER_SUBTITLE]=1 \{\
6921 . FAMILY \\*[$DOC_COVER_SUBTITLE_FAM]
6922 . FT \\*[$DOC_COVER_SUBTITLE_FT]
6923 . PT_SIZE \\*[$DOC_COVER_SUBTITLE_PT_SIZE]
6924 . if \\n[#PRINT_STYLE]=1 \{\
6926 . ie \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u/2u \}
6927 . el \{ .vs \\n[#DOC_LEAD]u \}
6930 . if \\n[#DOC_COVER]=1 \{\
6931 . ie !'\\*[$SUBTITLE_DOCCOVER_1]'' \{\
6932 . nr #SUBTITLES \\n[#SUBTITLE_DOCCOVER_NUM]
6933 . nr #NEXT_SUBTITLE 0 1
6934 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
6935 . ie \\n[#DOC_COVER_SUBTITLE_COLOR]=1 \{\
6936 . PRINT \m[\\*[$DOC_COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_DOCCOVER_\\n+[#NEXT_SUBTITLE]]\m[]
6938 . el \{ .PRINT \\*[$SUBTITLE_DOCCOVER_\\n+[#NEXT_SUBTITLE]] \}
6942 . nr #SUBTITLES \\n[#SUBTITLE_NUM]
6943 . nr #NEXT_SUBTITLE 0 1
6944 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
6945 . ie \\n[#DOC_COVER_SUBTITLE_COLOR]=1 \{\
6946 . PRINT \m[\\*[$DOC_COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]]\m[]
6948 . el \{ .PRINT \\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]] \}
6952 . if \\n[#PRINT_STYLE]=1 \{\
6953 . if \\n[#SINGLE_SPACE]=0 \{ .vs \}
6956 . if \\n[#PRINT_STYLE]=1 \{\
6957 . if !r#DOC_COVER_SUBTITLE \{ .sp \}
6960 . if \\n[#DOC_COVER_AUTHOR]=1 \{\
6961 . FAMILY \\*[$DOC_COVER_AUTHOR_FAM]
6962 . FT \\*[$DOC_COVER_AUTHOR_FT]
6963 . PT_SIZE \\*[$DOC_COVER_AUTHOR_PT_SIZE]
6964 . if \\n[#PRINT_STYLE]=1 \{\
6966 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
6967 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
6970 . ie d$ATTRIBUTE_STRING_DOCCOVER \{\
6971 . ie \\n[#DOC_COVER_ATTRIBUTE_COLOR]=1 \{\
6972 . PRINT \&\m[\\*[$DOC_COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING_DOCCOVER]\m[]
6974 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING_DOCCOVER] \}
6977 . if d$ATTRIBUTE_STRING \{\
6978 . ie \\n[#DOC_COVER_ATTRIBUTE_COLOR]=1 \{\
6979 . PRINT \&\m[\\*[$DOC_COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
6981 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING] \}
6986 . FAMILY \\*[$DOC_COVER_DOCTYPE_FAM]
6987 . FT \\*[$DOC_COVER_DOCTYPE_FT]
6988 . PT_SIZE \\*[$DOC_COVER_DOCTYPE_PT_SIZE]
6990 . if \\n[#DOC_TYPE]=3 \{\
6991 . if \\n[#DOC_COVER_DOCTYPE]=1 \{\
6992 . ie \\n[#PRINT_STYLE]=1 \{\
6994 . vs \\n[#DOC_LEAD]u
6995 . UNDERSCORE2 "\\*[$DOC_TYPE]"
6998 . nr #FROM_DOC_COVER 1
6999 . ie \\n[#DOC_COVER_DOCTYPE_COLOR]=1 \{\
7000 . COLOR \\*[$DOC_COVER_DOCTYPE_COLOR]
7001 . ie \\n[#DOCCOVER_UNDERLINE]= 1 \{ .UNDERSCORE \\*[$DOCCOVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]" \}
7002 . el \{ .PRINT "\\*[$DOC_TYPE]" \}
7005 . ie \\n[#DOCCOVER_UNDERLINE]=1 \{ .UNDERSCORE \\*[$DOCCOVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]" \}
7006 . el \{ .PRINT "\\*[$DOC_TYPE]" \}
7008 . rr #FROM_DOC_COVER
7012 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
7013 . ie \\n[#PRINT_STYLE]=1 \{\
7015 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
7016 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
7019 . FAMILY \\*[$DOC_COVER_COPYRIGHT_FAM]
7020 . FT \\*[$DOC_COVER_COPYRIGHT_FT]
7022 . PT_SIZE \\*[$DOC_COVER_COPYRIGHT_PT_SIZE]
7024 . if \\n[#DOC_COVER_COPYRIGHT]=1 \{\
7025 . if !'\\*[$COPYRIGHT_DOCCOVER]'' \{\
7026 . ds $SAVED_COPYRIGHT \\*[$COPYRIGHT]
7027 . ds $COPYRIGHT \\*[$COPYRIGHT_DOCCOVER]
7029 . QUAD \\*[$DOC_COVER_COPYRIGHT_QUAD]
7030 . ie \\n[#DOC_COVER_COPYRIGHT_COLOR]=1 \{\
7031 . PRINT \m[\\*[$DOC_COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
7033 . el \{ .PRINT \\*[$COPYRIGHT] \}
7034 . ds $COPYRIGHT \\*[$SAVED_COPYRIGHT]
7036 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
7037 . if \\n[#DOC_COVER_MISC]=1 \{\
7038 . QUAD \\*[$DOC_COVER_MISC_QUAD]
7039 . ie !'\\*[$MISC_DOCCOVER_1]'' \{\
7040 . nr #MISCS \\n[#MISC_DOCCOVER_NUM]
7043 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
7044 . ie \\n[#DOC_COVER_MISC_COLOR]=1 \{\
7045 . PRINT \m[\\*[$DOC_COVER_MISC_COLOR]]\\*[$MISC_DOCCOVER_\\n+[#NEXT_MISC]]\m[]
7046 . rm $MISC_DOCCOVER_\\n[#NEXT_MISC]
7047 . rm $MISC_\\n[#NEXT_MISC]
7051 . PRINT \\*[$MISC_DOCCOVER_\\n+[#NEXT_MISC]]
7052 . rm $MISC_DOCCOVER_\\n[#NEXT_MISC]
7053 . rm $MISC_\\n[#NEXT_MISC]
7057 . rm $MISC_\\n+[#NEXT_MISC]
7060 . nr #MISCS \\n[#MISC_NUM]
7063 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
7064 . ie \\n[#DOC_COVER_MISC_COLOR]=1 \{\
7065 . PRINT \m[\\*[$DOC_COVER_MISC_COLOR]]\\*[$MISC_\\n+[#NEXT_MISC]]\m[]
7069 . PRINT \\*[$MISC_\\n+[#NEXT_MISC]]
7075 . if \\n[#DOCCOVERS_COUNT]=1 \{ .nr #PAGE_NUM_ADJ +1 \}
7076 . nr #DOCCOVER_END 1
7081 . if !r#COVER_START_POS \{\
7082 . nr #COVER_START_POS \\n[#PAGE_LENGTH]/3
7084 . if \\n[#PRINT_STYLE]=1 \{\
7085 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
7086 . el \{ .vs \\n[#DOC_LEAD]u \}
7088 . if \\n[#PRINT_STYLE]=2 \{\
7089 . LS \\n[#DOC_LEAD]u\\*[$COVER_LEAD_ADJ]
7090 . nr #COVER_LEAD \\n[#LEAD]
7093 . sp |\\n[#COVER_START_POS]u-1v
7094 . if \\n[#COVER_COLOR]=1 \{\
7096 \m[\\*[$COVER_COLOR]]
7100 . FAMILY \\*[$COVER_TITLE_FAM]
7101 . FT \\*[$COVER_TITLE_FT]
7102 . PT_SIZE \\*[$COVER_TITLE_PT_SIZE]
7103 . LS \\n[#COVER_LEAD]u
7104 . if \\n[#PRINT_STYLE]=1 \{ .TYPEWRITER \}
7105 . if \\n[#COVER_TITLE]=1 \{\
7106 . ie \\n[#PRINT_STYLE]=1 \{\
7109 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7110 . UNDERSCORE "\\*[$TITLE_\\n[#ARG_NUM]]"
7116 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7117 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
7118 . PRINT "\m[\\*[$COVER_TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
7121 . PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
7126 . if \\n[#COVER_TITLE]=2 \{\
7127 . ie \\n[#PRINT_STYLE]=1 \{\
7130 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7131 . UNDERSCORE "\\*[$DOC_TITLE_\\n[#ARG_NUM]]"
7137 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7138 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
7139 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$DOC_TITLE_\\n[#ARG_NUM]]\m[]
7141 . el \{ .PRINT \\*[$DOC_TITLE_\\n[#ARG_NUM]] \}
7145 . if \\n[#COVER_TITLE]=3 \{\
7146 . ie \\n[#PRINT_STYLE]=1 \{\
7148 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
7152 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
7153 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
7155 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
7158 . if \\n[#COVER_TITLE]=4 \{\
7159 . ie \\n[#PRINT_STYLE]=1 \{\
7160 . ie \\n[#SINGLE_SPACE]=0 \{\
7161 . vs \\n[#DOC_LEAD]u/2u
7164 . vs \\n[#DOC_LEAD]u
7169 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7170 . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7173 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u \}
7177 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7178 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
7179 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
7181 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
7185 . if \\n[#COVER_TITLE]=5 \{\
7186 . ie \\n[#PRINT_STYLE]=1 \{\
7188 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
7192 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
7193 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
7195 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
7197 . if !'\\*[$CHAPTER_TITLE_1]'' \{\
7198 . ie \\n[#PRINT_STYLE]=1 \{\
7199 . ie \\n[#SINGLE_SPACE]=0 \{\
7200 . vs \\n[#DOC_LEAD]u/2u
7203 . vs \\n[#DOC_LEAD]u
7207 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7208 . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7210 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u \}
7213 . FAMILY \\*[$COVER_CHAPTER_TITLE_FAM]
7214 . FT \\*[$COVER_CHAPTER_TITLE_FT]
7215 . PT_SIZE \\*[$COVER_CHAPTER_TITLE_PT_SIZE]
7216 . ALD \\n[.v]u/4u \"Put a little space before the chapter title
7218 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7219 . ie \\n[#DOC_COVER_TITLE_COLOR]=1 \{\
7220 . PRINT \m[\\*[$DOC_COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
7222 . el \{ .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]] \}
7227 . if \\n[#COVER_TITLE]=6 \{\
7228 . ie \\n[#PRINT_STYLE]=1 \{\
7231 . while \\n[#COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7232 . UNDERSCORE "\\*[$COVER_TITLE_\\n[#ARG_NUM]]"
7238 . while \\n[#COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7239 . ie \\n[#COVER_TITLE_COLOR]=1 \{\
7240 . PRINT \m[\\*[$COVER_TITLE_COLOR]]\\*[$COVER_TITLE_\\n[#ARG_NUM]]\m[]
7242 . el \{ .PRINT \\*[$COVER_TITLE_\\n[#ARG_NUM]] \}
7246 . if !\\n[#DOC_TYPE]=2 \{\
7247 . if \\n[#COVER_SUBTITLE]=1 \{\
7248 . FAMILY \\*[$COVER_SUBTITLE_FAM]
7249 . FT \\*[$COVER_SUBTITLE_FT]
7250 . PT_SIZE \\*[$COVER_SUBTITLE_PT_SIZE]
7251 . if \\n[#PRINT_STYLE]=1 \{\
7253 . if \\n[#PRINT_STYLE]=1 \{\
7255 . ie \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u/2u \}
7256 . el \{ .vs \\n[#DOC_LEAD]u \}
7260 . if \\n[#COVER]=1 \{\
7261 . ie !'\\*[$SUBTITLE_COVER_1]'' \{\
7262 . nr #SUBTITLES \\n[#SUBTITLE_COVER_NUM]
7263 . nr #NEXT_SUBTITLE 0 1
7264 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
7265 . ie \\n[#COVER_SUBTITLE_COLOR]=1 \{\
7266 . PRINT \m[\\*[$COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_COVER_\\n+[#NEXT_SUBTITLE]]\m[]
7268 . el \{ .PRINT \\*[$SUBTITLE_COVER_\\n+[#NEXT_SUBTITLE]] \}
7272 . nr #SUBTITLES \\n[#SUBTITLE_NUM]
7273 . nr #NEXT_SUBTITLE 0 1
7274 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
7275 . ie \\n[#COVER_SUBTITLE_COLOR]=1 \{\
7276 . PRINT \m[\\*[$COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]]\m[]
7278 . el \{ .PRINT \\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]] \}
7282 . if \\n[#PRINT_STYLE]=1 \{\
7283 . if \\n[#SINGLE_SPACE]=0 \{ .vs \}
7286 . if \\n[#PRINT_STYLE]=1 \{\
7287 . if !r#COVER_SUBTITLE \{ .sp \}
7290 . if \\n[#COVER_AUTHOR]=1 \{\
7291 . FAMILY \\*[$COVER_AUTHOR_FAM]
7292 . FT \\*[$COVER_AUTHOR_FT]
7293 . PT_SIZE \\*[$COVER_AUTHOR_PT_SIZE]
7294 . if \\n[#PRINT_STYLE]=1 \{\
7296 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
7297 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
7300 . ie d$ATTRIBUTE_STRING_COVER \{\
7301 . ie \\n[#COVER_ATTRIBUTE_COLOR]=1 \{\
7302 . PRINT \&\m[\\*[$COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING_COVER]\m[]
7304 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING_COVER] \}
7307 . if d$ATTRIBUTE_STRING \{\
7308 . ie \\n[#COVER_ATTRIBUTE_COLOR]=1 \{\
7309 . PRINT \&\m[\\*[$COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
7311 . el \{ .PRINT \&\\*[$ATTRIBUTE_STRING] \}
7316 . FAMILY \\*[$COVER_DOCTYPE_FAM]
7317 . FT \\*[$COVER_DOCTYPE_FT]
7318 . PT_SIZE \\*[$COVER_DOCTYPE_PT_SIZE]
7320 . if \\n[#DOC_TYPE]=3 \{\
7321 . if \\n[#COVER_DOCTYPE]=1 \{\
7322 . ie \\n[#PRINT_STYLE]=1 \{\
7324 . vs \\n[#DOC_LEAD]u
7325 . UNDERSCORE2 "\\*[$DOC_TYPE]"
7329 . ie \\n[#COVER_DOCTYPE_COLOR]=1 \{\
7330 . COLOR \\*[$COVER_DOCTYPE_COLOR]
7331 . ie \\n[#COVER_UNDERLINE]= 1 \{ .UNDERSCORE \\*[$COVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]" \}
7332 . el \{ .PRINT "\\*[$DOC_TYPE] \}
7335 . ie \\n[#COVER_UNDERLINE]=1 \{ .UNDERSCORE \\*[$COVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]" \}
7336 . el \{ .PRINT "\\*[$DOC_TYPE]" \}
7342 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
7343 . ie \\n[#PRINT_STYLE]=1 \{\
7345 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
7346 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
7349 . FAMILY \\*[$COVER_COPYRIGHT_FAM]
7350 . FT \\*[$COVER_COPYRIGHT_FT]
7352 . PT_SIZE \\*[$COVER_COPYRIGHT_PT_SIZE]
7354 . if \\n[#COVER_COPYRIGHT]=1 \{\
7355 . if !'\\*[$COPYRIGHT_COVER]'' \{\
7356 . ds $SAVED_COPYRIGHT \\*[$COPYRIGHT]
7357 . ds $COPYRIGHT \\*[$COPYRIGHT_COVER]
7359 . QUAD \\*[$COVER_COPYRIGHT_QUAD]
7360 . ie \\n[#COVER_COPYRIGHT_COLOR]=1 \{\
7361 . PRINT \m[\\*[$COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
7363 . el \{ .PRINT \\*[$COPYRIGHT] \}
7364 . ds $COPYRIGHT \\*[$SAVED_COPYRIGHT]
7366 . sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
7367 . if \\n[#COVER_MISC]=1 \{\
7368 . QUAD \\*[$COVER_MISC_QUAD]
7369 . ie !'\\*[$MISC_COVER_1]'' \{\
7370 . nr #MISCS \\n[#MISC_COVER_NUM]
7373 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
7374 . ie \\n[#COVER_MISC_COLOR]=1 \{\
7375 . PRINT \m[\\*[$COVER_MISC_COLOR]]\\*[$MISC_COVER_\\n+[#NEXT_MISC]]\m[]
7379 . PRINT \\*[$MISC_COVER_\\n+[#NEXT_MISC]]
7385 . nr #MISCS \\n[#MISC_NUM]
7388 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
7389 . ie \\n[#COVER_MISC_COLOR]=1 \{\
7390 . PRINT \m[\\*[$COVER_MISC_COLOR]]\\*[$MISC_\\n+[#NEXT_MISC]]\m[]
7394 . PRINT \\*[$MISC_\\n+[#NEXT_MISC]]
7400 . if \\n[#COVERS_COUNT]=1 \{ .nr #PAGE_NUM_ADJ +1 \}
7406 \# Macro to terminate (doc)cover processing
7412 . if \\n[#PAGINATION_WAS_ON]=1 \{ .nr % +1 \}
7413 . if \\n[#DOCCOVER_END]=1 \{\
7414 . ie \\n[#DOCCOVER_BLANKPAGE]=1 \{\
7416 . rr #DOCCOVER_BLANKPAGE
7417 . if !\\n[#DOCCOVERS_COUNT]=1 \{ .nr % -2 \}
7420 . if !\\n[#DOCCOVERS_COUNT]=1 \{ .nr #PAGE_NUM_ADJ -1 \}
7424 . if \\n[#COVER_END]=1 \{\
7425 . ie \\n[#COVER_BLANKPAGE]=1 \{\
7427 . rr #COVER_BLANKPAGE
7428 . if !\\n[#COVERS_COUNT]=1 \{ .nr % -2 \}
7431 . if !\\n[#COVERS_COUNT]=1 \{ .nr #PAGE_NUM_ADJ -1 \}
7436 . if \\n[#PAGINATION_WAS_ON] \{\
7437 . rr #PAGINATION_WAS_ON
7439 . PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]-1
7441 . if \\n[#HEADERS_WERE_ON] \{\
7442 . rr #HEADERS_WERE_ON
7445 . if \\n[#FOOTERS_WERE_ON] \{\
7446 . rr #FOOTERS_WERE_ON
7449 . if \\n[#COLUMNS_WERE_ON]=1 \{\
7450 . rr #COLUMNS_WERE_ON 1
7456 \# Macro to begin document processing
7459 . nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
7460 . if !\\n[#PRINT_STYLE] \{\
7461 . PRINTSTYLE TYPEWRITE
7468 . PRINT "You neglected to enter a PRINTSTYLE"
7470 . ab [mom]: PRINTSTYLE missing. Aborting.
7473 . if \\n[#LINENUMBERS]=1 \{\
7477 . if \\n[#COLLATE] \{\
7478 . COPYSTYLE \\*[$COPY_STYLE]
7479 . nr #HEADERS_ON \\n[#HEADER_STATE]
7480 . if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
7481 . sp |\\n[#HEADER_MARGIN]u
7483 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
7484 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
7485 . rm $RESTORE_PAGENUM_STYLE
7489 .\" Quote and blockquote default leads are the same as #DOC_LEAD, so
7490 .\" they have to be set after DEFAULTS (where DOC_LEAD is finalized)
7491 . if !r#Q_AUTOLEAD \{ .nr #Q_LEAD \\n[#DOC_LEAD] \}
7492 . if !r#BQ_AUTOLEAD \{ .nr #BQ_LEAD \\n[#DOC_LEAD] \}
7493 . if !r#EN_Q_AUTOLEAD \{ .nr #EN_Q_LEAD \\n[#EN_LEAD] \}
7494 . if !r#EN_BQ_AUTOLEAD \{ .nr #EN_BQ_LEAD \\n[#EN_LEAD] \}
7495 .\" Covers and doc covers
7496 . if \\n[#DOC_COVERS]=1 \{\
7497 . if \\n[#DOC_COVER]=1 \{\
7500 . rr #DOC_COVER_TITLE
7501 . rr #DOC_COVER_SUBTITLE
7502 . rr #DOC_COVER_AUTHOR
7503 . rr #DOC_COVER_DOCTYPE
7504 . rr #DOC_COVER_COPYRIGHT
7505 . rr #DOC_COVER_MISC
7508 . if \\n[#COVERS]=1 \{\
7509 . if \\n[#COVER]=1 \{\
7513 . rr #COVER_SUBTITLE
7516 . rr #COVER_COPYRIGHT
7520 .\" Collate related stuff
7521 . ie \\n[#COLLATED_DOC]=1 \{\
7522 .\" Collect TITLE for TOC.
7523 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7524 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
7525 . ie \\n[#USER_SET_TITLE_ITEM] \{\
7526 . ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]\\|
7527 . rr #USER_SET_TITLE_ITEM
7528 . rm $USER_SET_TITLE_ITEM
7531 . ie \\n[#DOC_TYPE]=2 \{\
7532 . ie '\\*[$CHAPTER_TITLE]'' \{\
7533 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
7536 . ie '\\*[$CHAPTER]'' \{\
7537 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]\\|
7540 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
7545 . ds $TOC_TITLE_ITEM \\*[$TITLE]\\|
7548 . if \\n[#TOC_AUTHORS]=1 \{\
7549 . ie '\\*[$TOC_AUTHORS]'' \{\
7550 . as $TOC_TITLE_ITEM /\\|\\*[$AUTHOR_1]\\|
7553 . as $TOC_TITLE_ITEM /\\|\\*[$TOC_AUTHORS]\\|
7557 .\" Note the use of \!, which transparently embeds the macros used
7558 .\" in the TOC_ENTRIES diversion. The elements they control must be
7559 .\" processed literally when the diversion is output.
7562 . if \\n[#PRINT_STYLE]=1 \{\
7567 . if \\n[#PRINT_STYLE]=2 \{\
7568 \!. FAMILY \\*[$TOC_TITLE_FAM]
7569 \!. FT \\*[$TOC_TITLE_FT]
7570 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
7574 . ie \\n[#PRINT_STYLE]=1 \{\
7575 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
7578 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
7584 . if \\n[#PRINT_STYLE]=2 \{\
7585 \!. FAMILY \\*[$TOC_PN_FAM]
7586 \!. FT \\*[$TOC_PN_FT]
7587 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7590 \!. PRINT \\*[LEADER]
7593 \!. PRINT \\n[#TOC_ENTRY_PN]
7599 . nr #FIRST_DOC_TITLE_PN \\n%+\\n[#PAGE_NUM_ADJ]
7600 . af #FIRST_DOC_TITLE_PN \\g[#PAGENUMBER]
7601 . nr #FIRST_DOC_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
7603 .\" End TITLE collection
7604 . if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
7605 . sp |\\n[#HEADER_MARGIN]u
7609 . rr #PAGINATION_STATE
7610 .\" End collate stuff
7611 . ie \\n[#DOC_HEADER]=0 \{\
7613 . if \\n[#DOC_TYPE]=4 \{\
7614 . if !'\\n(.z'' \{ .di \}
7616 . nr #STORED_PP_INDENT \\n[#PP_INDENT]
7619 . PARA_INDENT \\n[#STORED_PP_INDENT]u
7620 . rr #STORED_PP_INDENT
7621 . ie r#ADVANCE_FROM_TOP \{\
7622 . sp |\\n[#ADVANCE_FROM_TOP]u-1v
7623 . if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
7625 . el \{ .sp |\\n[#T_MARGIN]u-1v \}
7626 . if \\n[#COLUMNS] \{\
7629 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7630 . nr #L_MARGIN \\n(.o
7631 . ll \\n[#COL_L_LENGTH]u
7636 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ] \}
7637 . nr #DOCHEADER_LEAD \\n[#LEAD]
7639 . if \\n[#DOC_TYPE]=1 \{\
7641 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
7643 . if \\n[#DOCHEADER_COLOR]=1 \{\
7645 \m[\\*[$DOCHEADER_COLOR]]
7648 . L_MARGIN \\n[#DOC_L_MARGIN]u
7649 . LL \\n[#DOC_L_LENGTH]u
7651 . if \\n[#PRINT_STYLE]=1 \{\
7654 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u/2u \}
7655 . if !'\\*[$TITLE_1]'' \{\
7658 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7659 . UNDERSCORE 4p "\\*[$TITLE_\\n[#ARG_NUM]]"
7663 . if !'\\*[$SUBTITLE]'' \{\
7666 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7667 . UNDERSCORE 4p "\\*[$SUBTITLE_\\n[#ARG_NUM]]"
7670 . if !'\\*[$AUTHOR_1]'' \{\
7672 . PRINT \&\\*[$ATTRIBUTE_STRING]
7673 . nr #AUTHORS \\n[#AUTHOR_NUM]
7674 . nr #NEXT_AUTHOR 0 1
7675 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
7676 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
7680 . if \\n[#PRINT_STYLE]=2 \{\
7686 . if \\n[#DOC_TYPE]=2 \{\
7688 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
7690 . if \\n[#DOCHEADER_COLOR]=1 \{\
7692 \m[\\*[$DOCHEADER_COLOR]]
7695 . L_MARGIN \\n[#DOC_L_MARGIN]u
7696 . LL \\n[#DOC_L_LENGTH]u
7698 . if \\n[#PRINT_STYLE]=1 \{\
7701 . vs \\n[#DOC_LEAD]u
7702 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u/2u \}
7703 . ie '\\*[$CHAPTER]'' \{\
7705 . ie !'\\*[$CHAPTER_TITLE]'' \{\
7707 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7708 . UNDERSCORE 4p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7713 . UNDERSCORE 4p "\\*[$CHAPTER_STRING]"
7720 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
7722 . if !'\\*[$CHAPTER_TITLE]'' \{\
7725 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7726 . UNDERSCORE 4p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7731 . if \\n[#SINGLE_SPACE] \{ .ALD 2v \}
7733 . if \\n[#PRINT_STYLE]=2 \{\
7735 . di DOCHEADER_DIVERSION \" This diversion is only
7736 . br \" necessary to find the depth of the
7737 . CHAPTER_DOCHEADER \" docheader
7740 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
7741 . \" in #DOCHEADER_DEPTH
7742 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
7747 . if \\n[#DOC_TYPE]=3 \{\
7749 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
7751 . if \\n[#DOCHEADER_COLOR]=1 \{\
7753 \m[\\*[$DOCHEADER_COLOR]]
7756 . L_MARGIN \\n[#DOC_L_MARGIN]u
7757 . LL \\n[#DOC_L_LENGTH]u
7759 . if \\n[#PRINT_STYLE]=1 \{\
7762 . if \\n[#SINGLE_SPACE]=0 \{ .vs \\n[#DOC_LEAD]u/2u \}
7764 . if !'\\*[$TITLE]'' \{\
7766 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7767 . UNDERSCORE 4p "\\*[$TITLE_\\n[#ARG_NUM]]"
7771 . if !'\\*[$SUBTITLE]'' \{\
7774 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7775 . UNDERSCORE 4p "\\*[$SUBTITLE_\\n[#ARG_NUM]]"
7778 . if !'\\*[$AUTHOR_1]'' \{\
7780 . PRINT \&\\*[$ATTRIBUTE_STRING]
7781 . nr #AUTHORS \\n[#AUTHOR_NUM]
7782 . nr #NEXT_AUTHOR 0 1
7783 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
7784 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
7787 . ie \\n[#SINGLE_SPACE]=0 \{ .sp 2 \}
7789 . UNDERSCORE2 4p "\\*[$DOC_TYPE]"
7790 . if \\n[#SINGLE_SPACE]=1 \{ .sp \}
7792 . if \\n[#PRINT_STYLE]=2 \{\
7797 . if !\\n[#DOC_TYPE]=4 \{\
7798 . if \\n[#PRINT_STYLE]=1 \{\
7801 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u*2u \}
7802 . if \\n[#COLUMNS] \{\
7804 . nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
7805 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7806 . nr #L_MARGIN \\n(.o
7807 . LL \\n[#COL_L_LENGTH]u
7813 . LS \\n[#DOC_LEAD]u
7814 . if \\n[#ADJ_DOC_LEAD]=1 \{\
7815 . ie !r#ADVANCE_FROM_TOP \{\
7816 . if \\n[#DOC_HEADER]=1 \{ .SHIM \}
7818 . el \{ .rr #ADVANCE_FROM_TOP \}
7820 . QUAD \\*[$DOC_QUAD]
7822 . nr #START_FOR_FOOTERS 1
7823 . if \\n[#COLLATED_DOC]=1 \{\
7824 . if !\\n[MNinit_DEFERRED]=1 \{\
7828 . if \\n[#MNinit_DEFERRED]=1 \{\
7829 . rr #MNinit_DEFERRED
7830 . nr #START_FOR_MNinit 1
7831 . MN_INIT \\*[$MN-arg1] \\*[$MN-arg2] \\*[$MN-arg3] \\*[$MN-arg4] \\*[$MN-arg5] \\*[$MN-arg6] \\*[$MN-arg7] \\*[$MN-arg8] \\*[$MN-arg9]
7833 . nr #START_FOR_MNinit 2
7834 . if !\\n[#DOC_TYPE]=4 \{ .em TERMINATE \}
7835 . if \\n[#LINENUMBERS]=2 \{\
7836 . NUMBER_LINES RESUME
7839 . if \\n[#RUN_ON]=1 \{\
7840 . if \\n[#FN_MARKER_STYLE]=1 \{ .RUNON_WARNING \}
7841 . if \\n[#FN_MARKER_STYLE]=2 \{ .RUNON_WARNING \}
7845 .MAC CLEANUP_DEFAULTS END
7847 .\" Family strings for docheader
7849 . rm $CHAPTER_TITLE_FAM
7853 .\" Family strings for cover
7854 . rm $COVER_AUTHOR_FAM
7855 . rm $COVER_CHAPTER_TITLE_FAM
7856 . rm $COVER_COPYRIGHT_FAM
7857 . rm $COVER_DOCTYPE_FAM
7858 . rm $COVER_LEAD_ADJ
7859 . rm $COVER_SUBTITLE_FAM
7860 . rm $COVER_TITLE_FAM
7861 .\" Family strings for doc cover
7862 . rm $DOC_COVER_AUTHOR_FAM
7863 . rm $DOC_COVER_CHAPTER_TITLE_FAM
7864 . rm $DOC_COVER_COPYRIGHT_FAM
7865 . rm $DOC_COVER_DOCTYPE_FAM
7866 . rm $DOC_COVER_LEAD_ADJ
7867 . rm $DOC_COVER_SUBTITLE_FAM
7868 . rm $DOC_COVER_TITLE_FAM
7869 .\" Quad args to copyright and misc
7870 . rm $COVER_COPYRIGHT_QUAD
7871 . rm $COVER_MISC_QUAD
7872 . rm $DOC_COVER_COPYRIGHT_QUAD
7873 . rm $DOC_COVER_MISC_QUAD
7874 .\" Miscellaneous strings
7875 . rm $TOC_TITLE_ITEM
7876 . rm $DOCHEADER_LEAD_ADJ
7877 .\" Various registers
7879 . rr #ADVANCE_FROM_TOP
7883 . rr #DOC_COVER_LEAD
7884 . if \\n[#DOC_HEADER]=1 \{ .nr #DOC_HEADER 2 \}
7885 . rr #DOCHEADER_ADVANCE
7886 . rr #DOCHEADER_EXTRA_SPACE
7887 . rr #DOCHEADER_LEAD
7888 . rr #DOCHEADER_SPACE_ADJ
7895 \# ====================================================================
7897 \# +++MACROS TO CHANGE SOME DEFAULTS+++
7902 \# <none> | <anything> [distance to advance from top of page]
7904 \# Turns printing of document header on or off. If a second argument
7905 \# in units of measure is given, advances that distance from the
7906 \# top of the page without printing the document header.
7908 \# Default is on. If the 1st argument is <anything> (which turns
7909 \# document headers off), the optional 2nd argument may be given
7910 \# (with a unit of measure).
7913 . ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
7915 . if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
7921 \# DOCUMENT HEADER LEADING
7922 \# -----------------------
7924 \# <+|- amount by which to in/decrease leading of doc header>
7926 \# Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
7928 \# A unit of measure must be supplied. Decimal fractions OK.
7929 \# Default is +0, i.e. same as DOC_LEAD.
7931 .MAC DOCHEADER_LEAD END
7932 . ds $DOCHEADER_LEAD_ADJ \\$1
7936 \# DOCHEADER ADVANCE
7937 \# -----------------
7939 \# <docheader start position>
7941 \# Creates register #DOCHEADER_ADVANCE, used in START.
7943 \# Unit of measure required.
7944 \# Default is same as T_MARGIN.
7946 .MAC DOCHEADER_ADVANCE END
7947 . nr #DOCHEADER_ADVANCE (\\$1)
7951 \# DOCUMENT LEFT MARGIN
7952 \# --------------------
7954 \# <left margin of document>
7956 \# Creates or modifies register #DOC_L_MARGIN.
7958 \# Affects EVERYTHING on the page.
7960 .MAC DOC_LEFT_MARGIN END
7962 . nr #DOC_L_MARGIN (\\$1)
7963 . L_MARGIN \\n[#DOC_L_MARGIN]u
7967 \# DOCUMENT RIGHT MARGIN
7968 \# ---------------------
7970 \# <right margin of document>
7972 \# Creates or modifies register #DOC_R_MARGIN.
7974 \# Affects EVERYTHING on the page.
7976 .MAC DOC_RIGHT_MARGIN END
7978 . nr #DOC_R_MARGIN (\\$1)
7979 . R_MARGIN \\n[#DOC_R_MARGIN]
7980 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
7984 \# DOCUMENT LINE LENGTH
7985 \# --------------------
7987 \# <line length of document>
7989 \# Creates or modifies string $DOC_L_LENGTH.
7991 \# Affects EVERYTHING on the page.
7993 .MAC DOC_LINE_LENGTH END
7995 . nr #DOC_L_LENGTH (\\$1)
7996 . LL \\n[#DOC_L_LENGTH]u
8004 \# <family of running text>
8006 \# Creates or modifies string $DOC_FAM.
8008 \# Affects everything EXCEPT headers and footers.
8013 . ds $FAMILY \\*[$DOC_FAM]
8014 . AUTHOR_FAMILY \\*[$DOC_FAM]
8015 . BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
8016 . DOCHEADER_FAMILY \\*[$DOC_FAM]
8017 . DOCTYPE_FAMILY \\*[$DOC_FAM]
8018 . EPIGRAPH_FAMILY \\*[$DOC_FAM]
8019 . FOOTNOTE_FAMILY \\*[$DOC_FAM]
8020 . HDRFTR_FAMILY \\*[$DOC_FAM]
8021 . HEAD_FAMILY \\*[$DOC_FAM]
8022 . LINENUMBER_FAMILY \\*[$DOC_FAM]
8023 . PARAHEAD_FAMILY \\*[$DOC_FAM]
8024 . QUOTE_FAMILY \\*[$DOC_FAM]
8025 . SUBHEAD_FAMILY \\*[$DOC_FAM]
8026 . SUBTITLE_FAMILY \\*[$DOC_FAM]
8027 . TITLE_FAMILY \\*[$DOC_FAM]
8031 \# DOCUMENT POINT SIZE
8032 \# -------------------
8034 \# <point size of running text>
8036 \# Creates or modifies register #DOC_PT_SIZE.
8038 \# DOC_PT_SIZE is the basis for calculating all type sizes in
8041 .MAC DOC_PT_SIZE END
8042 . if \\n[#IGNORE] \{ .return \}
8045 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
8052 \# <lead (".vs") of running text> [ADJUST]
8054 \# Creates or modifies register #DOC_LEAD. If the optional
8055 \# ADJUST argument is given, adjusts leading so that the last
8056 \# line of text falls exactly on #B_MARGIN.
8058 \# DOC_LEAD is the basis for calculating all leading changes in
8059 \# a document. Default for TYPESET is 16; 24 for TYPEWRITE.
8061 \# Because the visible bottom or footer margin of a page depends
8062 \# on the overall document lead supplied by the register #DOC_LEAD,
8063 \# DOC_LEAD, in the body of a document, should always be associated
8064 \# with the start of a new page (in other words, just before or
8065 \# just after a manual NEWPAGE).
8068 . if \\n[#IGNORE] \{ .return \}
8071 . nr #DOC_LEAD \\n[#LEAD]
8072 . if '\\$2'ADJUST' \{ .TRAPS \}
8076 \# ADJUST DOCUMENT LEAD
8077 \# --------------------
8079 \# <none> | <anything>
8081 \# Adjusts document lead so that the last line of text falls exactly
8084 .MAC DOC_LEAD_ADJUST END
8086 . nr #ADJ_DOC_LEAD 1
8087 . rr #DOC_LEAD_ADJUST_OFF
8090 . nr #ADJ_DOC_LEAD 0
8091 . nr #DOC_LEAD_ADJUST_OFF 1
8101 \# Advances to the next "valid" baseline.
8103 \# If a user plays around with spacing in a doc (say, with ALD),
8104 \# it isn't easy to get mom back on track so she can achieve
8105 \# perfectly flush bottom margins. Any time SHIM is used, it
8106 \# ensures that the next output line falls on a valid baseline.
8108 \# First, a little convenience macro
8110 .MAC PROCESS_SHIM END
8111 . while \\n+[#VALID_BASELINE]<\\n[#CURRENT_V_POS] \{\
8114 . nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
8117 \# And a macro to disable SHIM (useful sometimes with QUOTE and
8121 . ie '\\$1'' \{ .nr #NO_SHIM 1 \}
8122 . el \{ .rr #NO_SHIM \}
8126 . ie r#NO_SHIM \{ .return \}
8128 . nr #VALID_BASELINE \\n[#T_MARGIN]-1v \\n[#DOC_LEAD]
8129 . if !r#CURRENT_V_POS \{ .nr #CURRENT_V_POS \\n(.d \}
8130 . ie r#ADVANCE_FROM_TOP \{\
8131 . ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
8132 . while \\n-[#VALID_BASELINE]>\\n[#CURRENT_V_POS] \{\
8135 . nr #VALID_BASELINE +\\n[#DOC_LEAD]
8136 . nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
8152 \# ====================================================================
8154 \# +++INTERNATIONALIZATION+++
8159 \# <what goes in the "by" slot before author in the document header>
8161 \# Creates or modifies string $ATTRIBUTE_STRING.
8163 \# Default is "by". A blank string ("") may be used if no
8164 \# attribution is desired.
8166 .MAC ATTRIBUTE_STRING END
8167 . if !'\\$1'DOC_COVER' \{\
8168 . if !'\\$1'COVER' \{ .nr #NEITHER 1 \}
8170 . if !'\\$1'COVER' \{\
8171 . if !'\\$1'DOC_COVER' \{ .nr #NEITHER 1 \}
8173 . if '\\$1'DOC_COVER' \{\
8174 . ds $ATTRIBUTE_STRING_DOCCOVER \\$2
8176 . if '\\$1'COVER' \{\
8177 . ds $ATTRIBUTE_STRING_COVER \\$2
8179 . if \\n[#NEITHER]=1 \{\
8180 . ds $ATTRIBUTE_STRING \\$1
8189 \# <what to print any time the word "chapter" is required>
8191 \# Creates or modifies string $CHAPTER_STRING.
8193 \# Default is "chapter".
8195 .MAC CHAPTER_STRING END
8196 . ds $CHAPTER_STRING \\$1
8203 \# <what to print any time the word "draft" is required>
8205 \# Creates or modifies string $DRAFT_STRING.
8207 \# Default is "draft".
8209 .MAC DRAFT_STRING END
8210 . ds $DRAFT_STRING \\$1
8217 \# <what to print any time the word "revision" is required>
8219 \# Creates or modifies string $REVISION_STRING.
8221 \# Default is "revision".
8223 .MAC REVISION_STRING END
8224 . ds $REVISION_STRING \\$1
8231 \# <what to print with the finis macro>
8233 \# Creates or modifies string $FINIS_STRING.
8235 \# Default is "END".
8237 .MAC FINIS_STRING END
8238 \#. if \\n[#FINIS_STRING_CAPS]=1 \{ .CAPS \}
8239 . ds $FINIS_STRING \\$1
8240 \#. if \\n[#FINIS_STRING_CAPS]=1 \{ .CAPS OFF \}
8243 .MAC FINIS_STRING_CAPS END
8244 . ie '\\$1'' \{ .nr #FINIS_STRING_CAPS 1 \}
8245 . el \{ .nr #FINIS_STRING_CAPS 0 \}
8248 \# ====================================================================
8250 \# +++RECTO/VERSO+++
8255 \# <none> | <anything>
8257 \# Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages. Also
8258 \# switches page numbers left and right if either is chosen rather
8259 \# than the default centered page numbers. Switches left and right
8260 \# margins if differing values have been entered.
8264 .MAC RECTO_VERSO END
8265 . ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
8266 . el \{ .nr #RECTO_VERSO 0 \}
8269 \# ====================================================================
8276 \# <value by which to multiply PP_INDENT for block epigraphs>
8278 \# Creates or modifies register #EPI_OFFSET_VALUE.
8280 \# Default is 2 for TYPEWRITE, 3 for TYPESET.
8282 .MAC EPIGRAPH_INDENT END
8283 . if r#EPI_OFFSET_VALUE \{ .rr #EPI_OFFSET_VALUE \}
8284 . if !'\\*[$EPI_OFFSET_VALUE]'' \{ .rm $EPI_OFFSET_VALUE \}
8285 . ds $EVAL_EI_ARG \\$1
8286 . substring $EVAL_EI_ARG -1
8287 . ie \B'\\*[$EVAL_EI_ARG]' \{\
8288 . nr #EPI_OFFSET_VALUE \\$1
8291 . ds $EPI_OFFSET_VALUE \\$1
8297 \# EPIGRAPH AUTOLEAD
8298 \# -----------------
8300 \# <amount of lead to add to the epigraph ps for epigraph leading>
8302 \# Creates or modifies register #EPI_AUTOLEAD.
8304 \# Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
8306 .MAC EPIGRAPH_AUTOLEAD END
8307 . nr #EPI_AUTOLEAD \\$1
8314 \# BLOCK | <anything>
8316 \# Places an epigraph before the document's text, after the
8317 \# document header, or after a HEAD.
8319 \# #EPIGRAPH 1 = centered; 2 = block
8321 \# By default, epigraphs are centered, allowing the user
8322 \# to input them on a line per line basis. To change this
8323 \# behaviour, the user can supply the argument BLOCK, which
8324 \# will produce indented, filled text similar to BLOCKQUOTE.
8326 \# If a block epigraph contains more than one para, ALL paras of
8327 \# the epigraph must be preceded by PP. Otherwise, PP is optional.
8332 . if \\n[#LINENUMBERS]=1 \{\
8336 . if \\n[#START] \{\
8337 . if \\n[#PRINT_STYLE]=1 \{\
8338 . if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8345 . ll \\n[#L_LENGTH]u
8348 . if \\n[#COLUMNS] \{\
8349 . ie \\n[#START] \{\
8350 . ll \\n[#DOC_L_LENGTH]u
8354 . ll \\n[#COL_L_LENGTH]u
8359 . if \\n[#PRINT_STYLE]=1 \{\
8362 . if '\\*[$EPI_FT]'I' \{\
8366 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
8367 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
8368 . nr #EPI_LEAD \\n[#LEAD]
8369 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8371 . if \\n[#PRINT_STYLE]=2 \{\
8372 . FAMILY \\*[$EPI_FAM]
8374 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
8375 . if \\n[#EPI_COLOR]=1 \{\
8380 . AUTOLEAD \\n[#EPI_AUTOLEAD]
8381 . nr #EPI_LEAD \\n[#LEAD]
8382 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8385 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
8386 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
8391 . ie '\\$1'BLOCK' \{\
8394 . ie \\n[#START] \{\
8395 . ie \\n[#COLUMNS] \{\
8396 . ie r#EPI_OFFSET_VALUE \{\
8397 . ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8400 . ll \\n[#L_LENGTH_FOR_EPI]u-(\\*[$EPI_OFFSET_VALUE]u*2u)
8405 . ie r#EPI_OFFSET_VALUE \{\
8406 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8409 . ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8415 . ie r#EPI_OFFSET_VALUE \{\
8416 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8419 . ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8422 . if \\n[#COLUMNS] \{\
8423 . ie r#EPI_OFFSET_VALUE \{\
8424 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8427 . ll \\n[#COL_L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8433 . if \\n[#PRINT_STYLE]=1 \{\
8436 . if '\\*[$EPI_FT]'I' \{\
8440 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
8441 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
8444 . nr #EPI_LEAD \\n[#LEAD]
8445 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8449 . if \\n[#PRINT_STYLE]=2 \{\
8450 . FAMILY \\*[$EPI_FAM]
8452 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
8453 . if \\n[#EPI_COLOR]=1 \{\
8458 . AUTOLEAD \\n[#EPI_AUTOLEAD]
8459 . QUAD \\*[$EPI_QUAD]
8460 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
8461 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
8463 . nr #EPI_LEAD \\n[#LEAD]
8464 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8481 \# Ends diversion started in EPIGRAPH. Makes spacing
8482 \# adjustments to compensate for the difference between epigraph
8483 \# leading and overall document leading, so that the bottom of
8484 \# the pages remain flush.
8486 \# In addition to its usual place at the beginning of a
8487 \# document, EPIGRAPH may also be used after HEAD.
8489 .MAC DO_EPIGRAPH END
8493 . if \\n[#RESET_FN_COUNTERS]=2 \{\
8494 . if !\\n[#FN_COUNT]=1 \{\
8495 . if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
8497 . rr #RESET_FN_COUNTERS
8501 . nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
8505 . nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
8506 . nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
8507 . ie \\n[#START] \{\
8509 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
8510 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8511 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8513 . if \\n[#PRINT_STYLE]=1 \{\
8514 . if !\\n[#SINGLE_SPACE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8516 . if \\n[#PRINT_STYLE]=2 \{\
8517 . ie !\\n[#DOC_TYPE]=2 \{ .RLD \\n[#DOC_LEAD]u \}
8519 . ie '\\*[$CHAPTER_TITLE]'' \{ .RLD \\n[#DOC_LEAD]u \}
8521 . if '\\*[$CHAPTER]'' \{ .RLD \\n[#DOC_LEAD]u \}
8524 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
8525 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
8527 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8528 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8533 . ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
8535 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
8536 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8537 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8539 . ie \\n[#PRINT_STYLE]=1 \{\
8540 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
8543 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
8544 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
8546 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8547 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8550 . if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
8553 . nr #EPI_LINES_TO_TRAP 0 1
8554 . while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\
8557 . nr #EPI_LINES_TO_TRAP -1
8558 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
8559 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8560 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8562 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
8563 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
8566 . if \\n[#EPIGRAPH]=1 \{\
8567 . po \\n[#L_MARGIN]u
8568 . if \\n[#COLUMNS] \{\
8569 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8570 . nr #L_MARGIN \\n(.o
8573 . if \\n[#EPIGRAPH]=2 \{\
8574 . ie r#EPI_OFFSET_VALUE \{\
8575 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
8577 . el \{ .nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE] \}
8578 . if \\n[#COLUMNS] \{\
8579 . ie r#EPI_OFFSET_VALUE \{\
8580 . nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
8582 . el \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE] \}
8584 . po \\n[#EPI_OFFSET]u
8589 . ie \\n[#START] \{\
8590 . if \\n[#PRINT_STYLE]=1 \{\
8593 . if \\n[#PRINT_STYLE]=2 \{\
8594 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
8595 . ALD \\n[#EPI_WHITESPACE]u/2u
8597 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8598 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8605 . ie \\n[#EPI_FITS] \{\
8606 . ie \\n[#FN_FOR_EPI] \{\
8607 . nr #EPI_LINES_TO_END 1
8608 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
8609 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8610 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8612 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
8615 . ie \\n[#PRINT_STYLE]=1 \{\
8616 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
8619 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
8620 . ALD \\n[#EPI_WHITESPACE]u/2u
8622 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8623 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8629 . nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
8630 . if \\n[#LOOP] \{ .nr #EPI_LINES_TO_END +1 \}
8632 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
8633 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8634 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8636 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
8637 . if \\n[#PRINT_STYLE]=1 \{\
8638 . if !\\n[#SINGLE_SPACE] \{\
8639 . nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
8640 . ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
8642 . rr #EPI_LINES_EVEN
8649 . ALD \\n[#DOC_LEAD]u
8650 . QUAD \\*[$DOC_QUAD]
8651 . po \\n[#L_MARGIN]u
8652 . if \\n[#COLUMNS] \{\
8653 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8654 . nr #L_MARGIN \\n(.o
8656 . if \\n[#START] \{\
8657 . if \\n[#COLUMNS] \{\
8658 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8659 . nr #L_MARGIN \\n(.o
8663 . if \\n[#LINENUMBERS]=2 \{\
8664 . NUMBER_LINES RESUME
8669 \# ====================================================================
8671 \# +++FINIS MACRO+++
8678 \# Deposits --END-- at the end of a document.
8684 . if \\n[#TAB_ACTIVE] \{ .TQ \}
8685 . if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
8686 . nr #EM_ADJUST (1m/8)
8687 . if \\n[#COLUMNS] \{\
8688 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8689 . nr #L_MARGIN \\n(.o
8691 . ALD \\n[#DOC_LEAD]u
8693 . if \\n[#FINIS_STRING_CAPS]=1 \{ .CAPS \}
8694 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
8695 . if \\n[#PRINT_STYLE]=2 \{\
8696 . ie \\n[#FINIS_COLOR] \{\
8697 . 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[]
8699 . el \{ .PRINT \v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em\m[] \}
8701 . if \\n[#FINIS_STRING_CAPS]=1 \{ .CAPS OFF \}
8705 \# ====================================================================
8707 \# +++HEADERS/FOOTERS+++
8709 \# Define a string so that the current page number can be incorporated
8710 \# into the strings for hdrftr left, right, and center. NOTE: This is
8711 \# not the same thing as using the shortform # in hdrftr strings.
8713 .ds PAGE# \En[#PAGENUMBER]
8719 \# <amount of space between header/footer and header/footer rule>
8721 \# Creates or modifies register #HDRFTR_RULE_GAP to hold amount
8722 \# of space between header/footer and header/footer rule.
8726 .MAC HDRFTR_RULE_GAP END
8727 . nr #HDRFTR_RULE_GAP (\\$1)
8728 . if '\\$0'HEADER_RULE_GAP' \{\
8729 . nr #HEADER_RULE_GAP \\n[#HDRFTR_RULE_GAP]
8730 . if r#FOOTER_RULE_GAP \{ .nr #FOOTER_RULE_GAP \\n[#FOOTER_RULE_GAP] \}
8732 . if '\\$0'FOOTER_RULE_GAP' \{\
8733 . nr #FOOTER_RULE_GAP \\n[#HDRFTR_RULE_GAP]
8734 . if r#HEADER_RULE_GAP \{ .nr #HEADER_RULE_GAP \\n[#HEADER_RULE_GAP] \}
8742 \# <what to put in the left position of page header/footers>
8744 \# Creates or modifies string $HDRFTR_LEFT.
8745 \# Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
8746 \# overrides the $HDRFTR_LEFT string created by default
8749 \# Especially useful if doc has more than one author, and a list
8750 \# of authors by last name is desired in header/footers.
8751 \# Default is author.
8753 \# If the argument is the # character, simply prints the current
8756 \# If the user wants to *incorporate* the page number into the string,
8757 \# \*[PAGE#] must be used. For example, if the user wants to put
8758 \# an elipsis before the page number in the string, s/he should use
8759 \# ...\*[PAGE#], not ...#
8761 .MAC HDRFTR_LEFT END
8762 . nr #USER_DEF_HDRFTR_LEFT 1
8763 . ds $HDRFTR_LEFT \\$1
8770 \# <none> | <anything>
8772 \# Turns capitalisation of $HDRFTR_LEFT (typically, the author of
8773 \# the document) on or off.
8777 .MAC HDRFTR_LEFT_CAPS END
8779 . nr #HDRFTR_LEFT_CAPS 1
8782 . nr #HDRFTR_LEFT_CAPS 0
8783 . ds $HDRFTR_LEFT_SIZE_CHANGE +0
8791 \# <what to put in the centre position of page header/footers>
8793 \# Creates or modifies string $HDRFTR_CENTER.
8794 \# Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
8795 \# overrides the $HDRFTR_CENTER string created by default
8798 \# Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
8799 \# CHAPTER, draft and revision number if COPYSTYLE DRAFT.
8801 \# If the argument is the # character, simply prints the current
8804 \# If the user wants to *incorporate* the page number into the string,
8805 \# \*[PAGE#] must be used. For example, if the user wants to put
8806 \# an elipsis before the page number in the string, s/he should use
8807 \# ...\*[PAGE#], not ...#
8809 .MAC HDRFTR_CENTER END
8810 . nr #USER_DEF_HDRFTR_CENTER 1
8811 . if '\\$0'FOOTER_CENTER' \{\
8812 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
8813 . ds $HDRFTR_CENTER_NEW \\$1
8815 . if '\\$0'FOOTER_CENTRE' \{\
8816 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
8817 . ds $HDRFTR_CENTER_NEW \\$1
8819 . ds $HDRFTR_CENTER \\$1
8823 \# HDRFTR CENTER CAPS
8824 \# ------------------
8826 \# <none> | <anything>
8828 \# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
8829 \# the document) on or off.
8833 .MAC HDRFTR_CENTER_CAPS END
8835 . nr #HDRFTR_CENTER_CAPS 1
8838 . nr #HDRFTR_CENTER_CAPS 0
8839 . ds $HDRFTR_CENTER_SIZE_CHANGE +0
8844 \# HDRFTR CENTER PADDING
8845 \# ---------------------
8847 \# LEFT | RIGHT <amount of padding to put left or right of hdrftr
8850 \# Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
8851 \# #HDRFTR_CTR_PAD_RIGHT.
8853 \# By default, the HDRFTR_CENTER string is centered on the doc
8854 \# line length. Long titles or long author names can screw up
8855 \# visual centering, or create overprints. This macro allows the
8856 \# user to pad the center string by the specified amount of space
8857 \# to fix these problems. Use only one of LEFT or RIGHT.
8859 \# A unit of measure is required.
8861 .MAC HDRFTR_CENTER_PAD END
8862 . if '\\$1'LEFT' \{\
8863 . nr #HDRFTR_CTR_PAD_LEFT (\\$2)
8865 . if '\\$1'RIGHT' \{\
8866 . nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
8871 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
8872 \# --------------------------------
8876 \# Switches the padding side of hdrftr center padding.
8878 \# Required to keep spacing around hdrftr string constant
8879 \# in recto/verso documents.
8881 .MAC SWITCH_HDRFTR_CENTER_PAD END
8882 . nr #HDRFTR_CTR_PAD_TMP \\n[#HDRFTR_CTR_PAD_LEFT]
8883 . HDRFTR_CENTER_PAD LEFT \\n[#HDRFTR_CTR_PAD_RIGHT]u
8884 . HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
8891 \# <what to put in the right position of page header/footers>
8893 \# Creates or modifies string $HDRFTR_RIGHT.
8894 \# Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
8895 \# overrides the $HDRFTR_RIGHT string created by default
8898 \# Default is document title.
8900 \# If the argument is the # character, simply prints the current
8903 \# If the user wants to *incorporate* the page number into the string,
8904 \# \*[PAGE#] must be used. For example, if the user wants to put
8905 \# an elipsis before the page number in the string, s/he should use
8906 \# ...\*[PAGE#], not ...#
8908 .MAC HDRFTR_RIGHT END
8909 . nr #USER_DEF_HDRFTR_RIGHT 1
8910 . ds $HDRFTR_RIGHT \\$1
8914 \# HDRFTR RIGHT CAPS
8915 \# -----------------
8917 \# <none> | <anything>
8919 \# Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
8920 \# the document) on or off.
8924 .MAC HDRFTR_RIGHT_CAPS END
8926 . nr #HDRFTR_RIGHT_CAPS 1
8929 . nr #HDRFTR_RIGHT_CAPS 0
8930 . ds $HDRFTR_RIGHT_SIZE_CHANGE +0
8938 \# <none> | <anything>
8940 \# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
8941 \# under the header/over the footer. Otherwise, turns HDRFTR_RULE
8944 .MAC HDRFTR_RULE END \"To print rule under header/over footer.
8945 . if \\n[#HEADERS_ON] \{ .nr #HDRFTR_RULE_GAP \\n[#HEADER_RULE_GAP] \}
8946 . if \\n[#FOOTERS_ON] \{ .nr #HDRFTR_RULE_GAP \\n[#FOOTER_RULE_GAP] \}
8947 . if '\\$0'HDRFTR_RULE_INTERNAL' \{\
8948 . ie \\n[#USERDEF_HDRFTR] \{\
8949 . nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
8950 . if \\n[#HEADERS_ON] \{\
8952 . ALD \\n[#HDRFTR_RULE_GAP]u
8953 . nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT]
8954 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ]
8956 . if \\n[#FOOTERS_ON] \{\
8958 . RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u
8959 . nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT]
8960 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ]
8962 . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
8963 \m[\\*[$HDRFTR_RULE_COLOR]]\
8964 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8966 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8967 \D'l \\n[#DOC_L_LENGTH]u 0'\
8968 \D't \\n[#RULE_WEIGHT]u'\
8969 \h'-\\n[#RULE_WEIGHT]u'\
8973 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8975 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8976 \D'l \\n[#DOC_L_LENGTH]u 0'\
8977 \D't \\n[#RULE_WEIGHT]u'\
8978 \h'-\\n[#RULE_WEIGHT]u'
8983 . if \\n[#PRINT_STYLE]=1 \{\
8984 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
8986 . if \\n[#PRINT_STYLE]=2 \{\
8987 . ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
8988 . nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
8990 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
8991 . ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
8992 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
8994 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
8996 . if \\n[#HEADERS_ON] \{\
8998 . ALD \\n[#HDRFTR_RULE_GAP]u
8999 . nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT]
9000 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ]
9002 . if \\n[#FOOTERS_ON] \{\
9004 . RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u
9005 . nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT]
9006 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ]
9008 . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
9009 \m[\\*[$HDRFTR_RULE_COLOR]]\
9010 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
9012 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
9013 \D'l \\n[#DOC_L_LENGTH]u 0'\
9014 \D't \\n[#RULE_WEIGHT]u'\
9015 \h'-\\n[#RULE_WEIGHT]u'\
9019 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
9021 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
9022 \D'l \\n[#DOC_L_LENGTH]u 0'\
9023 \D't \\n[#RULE_WEIGHT]u'\
9024 \h'-\\n[#RULE_WEIGHT]u'
9029 . if '\\$0'HEADER_RULE' \{\
9040 . if '\\$0'FOOTER_RULE' \{\
9051 . if '\\$0'HDRFTR_RULE' \{\
9052 . ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
9053 . el \{ .nr #HDRFTR_RULE 0 \}
9058 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
9066 \# Sets the family, font, and point size of all strings in
9067 \# header/footers to the same family and point size as running
9068 \# text. Font for the header/footer becomes roman throughout.
9070 .MAC HDRFTR_PLAIN END
9071 . HDRFTR_FAMILY \\*[$DOC_FAM]
9072 . HDRFTR_PT_SIZE \\n[#DOC_PT_SIZE]
9073 . HDRFTR_LEFT_FAMILY \\*[$DOC_FAM]
9074 . HDRFTR_LEFT_FONT R
9075 . HDRFTR_LEFT_SIZE +0
9076 . HDRFTR_LEFT_CAPS OFF
9077 . HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
9078 . HDRFTR_CENTER_FONT R
9079 . HDRFTR_CENTER_SIZE +0
9080 . HDRFTR_CENTER_CAPS OFF
9081 . HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]
9082 . HDRFTR_RIGHT_FONT R
9083 . HDRFTR_RIGHT_SIZE +0
9084 . HDRFTR_RIGHT_CAPS OFF
9091 \# <none> | <anything>
9093 \# Creates or modifies register #SWITCH_HDRFTR, used to switch
9094 \# default location of HDRFTR_LEFT and HDRFTR_RIGHT.
9098 \# Typically, the author string appears at the left of header/footers,
9099 \# and the title string appears at the right. This switches the
9100 \# location of the two. Useful in conjuction with RECTO_VERSO to tweak
9101 \# switches on alternate pages to come out as the user wishes. The
9102 \# assumption of RECTO_VERSO is that the first page of the document
9103 \# (recto) is odd, and even though it has no header/footer, if it did
9104 \# have one, it would print as AUTHOR...CENTER...TITLE (or whatever
9105 \# strings the user has supplied for HDRFTR_LEFT/RIGHT), meaning that
9106 \# the next page, which does have a header/footer, will come out as
9107 \# TITLE...CENTER...AUTHOR (or whatever strings the user has supplied
9108 \# for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user to get the
9109 \# desired string in the desired place on the desired recto/verso page.
9111 .MAC SWITCH_HDRFTR END
9112 . ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
9113 . el \{ .nr #SWITCH_HDRFTR 0 \}
9117 \# USER DEFINED HDRFTR RECTO
9118 \# -------------------------
9120 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
9122 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
9123 \# stores string in $USERDEF_HDRFTR_RECTO.
9125 \# For use when users don't want 3-part headers/footers, but rather
9126 \# want to design their own headers/footers and need different
9127 \# headers/footers on recto and verso pages. Using just
9128 \# HEADER_RECTO, even when recto/verso is not on, allows users to
9129 \# design their own headers/footers for doc pages.
9131 .MAC HDRFTR_RECTO END
9132 . nr #USERDEF_HDRFTR 1
9133 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
9134 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
9135 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
9136 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
9137 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
9138 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
9139 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
9141 . if '\\$1'CAPS' \{ .nr #HDRFTR_RECTO_CAPS 1 \}
9142 . ds $USERDEF_HDRFTR_RECTO \\$2
9146 \# USER DEFINED HDRFTR VERSO
9147 \# -------------------------
9149 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
9151 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
9152 \# stores string in $USERDEF_HDRFTR_VERSO.
9154 \# For use when users don't want 3-part headers/footers, but rather
9155 \# want to design their own headers/footers and need different
9156 \# headers/footers on recto and verso pages.
9158 .MAC HDRFTR_VERSO END
9159 . nr #USERDEF_HDRFTR 1
9160 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
9161 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
9162 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
9163 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
9164 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
9165 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
9166 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
9168 . if '\\$1'CAPS' \{ .nr #HDRFTR_VERSO_CAPS 1 \}
9169 . ds $USERDEF_HDRFTR_VERSO \\$2
9172 \# PRINT FOOTER ON FIRST PAGE
9173 \# --------------------------
9175 \# <none> | <anything>
9177 \# Toggles register #PRINT_FOOTER_ON_PAGE_1
9179 \# Lets user choose whether to print footer on first
9182 .MAC FOOTER_ON_FIRST_PAGE END
9183 . ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
9184 . el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
9188 \# PRINT PAGE NUMBER ON FIRST PAGE
9189 \# -------------------------------
9191 \# <none> | <anything>
9193 \# Toggles register #PRINT_PAGENUM_ON_PAGE_1
9195 \# Lets user choose whether to print page number on first
9196 \# page of doc and after collate when footers are on or page numbering
9197 \# has been user set at top of page.
9199 .MAC PAGENUM_ON_FIRST_PAGE END
9200 . ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
9201 . el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
9205 \# PRINT HEADER/FOOTER
9206 \# -------------------
9210 \# Based on defaults or values entered by user, prints a
9211 \# three-part title at either the top or the bottom of the page.
9213 \# Called from within either HEADER or FOOTER.
9215 .MAC PRINT_HDRFTR END
9216 . if \\n[#DOC_TYPE]=4 \{\
9217 . nr #SUITE \En[.pn]
9219 . if \\n[#FOOTERS_ON] \{\
9220 . if \\n[#START_FOR_FOOTERS] \{\
9221 . rr #START_FOR_FOOTERS
9222 . if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{\
9223 . ie !\\n[#HDRFTR_BOTH] \{ .return \}
9227 . ie \\n[#HEADER_RULE]=1 \{ .HEADER_RULE \}
9228 . el \{ .HEADER_RULE OFF \}
9229 . HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
9235 . if \\n[#USERDEF_HDRFTR] \{\
9236 . PRINT_USERDEF_HDRFTR
9239 . if \\n[#SWITCH_HDRFTR] \{\
9240 . ds $HDRFTR_TMP_SWITCH \\*[$HDRFTR_LEFT]
9241 . ds $HDRFTR_LEFT \\*[$HDRFTR_RIGHT]
9242 . ds $HDRFTR_RIGHT \\*[$HDRFTR_TMP_SWITCH]
9243 . ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
9244 . ds $HDRFTR_LEFT_SIZE_CHANGE \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
9245 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
9246 . nr #HDRFTR_TMP_CAPS_SWITCH \\n[#HDRFTR_LEFT_CAPS]
9247 . nr #HDRFTR_LEFT_CAPS \\n[#HDRFTR_RIGHT_CAPS]
9248 . nr #HDRFTR_RIGHT_CAPS \\n[#HDRFTR_TMP_CAPS_SWITCH]
9249 . ds $HDRFTR_TMP_COLOR_SWITCH \\*[$HDRFTR_LEFT_COLOR]
9250 . ds $HDRFTR_LEFT_COLOR \\*[$HDRFTR_RIGHT_COLOR]
9251 . ds $HDRFTR_RIGHT_COLOR \\*[$HDRFTR_TMP_COLOR_SWITCH]
9252 . rr #HDRFTR_TMP_CAPS_SWITCH
9253 . rm $HDRFTR_TMP_SWITCH
9254 . rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
9255 . rm $HDRFTR_TMP_COLOR_SWITCH
9256 . nr #SWITCH_HDRFTR 0
9258 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
9259 . if \\n[#ENDNOTES] \{ .PAGENUM_STYLE \\*[$EN_PN_STYLE] \}
9260 . if \\n[#PRINT_STYLE]=1 \{\
9261 . if \\n[#FOOTERS_ON] \{\
9264 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
9269 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
9270 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
9271 . ie '\\*[$HDRFTR_LEFT]'#' \{\
9272 . PRINT \\n[#PAGENUMBER]
9275 . ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
9276 . el \{ .PRINT \& \}
9278 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
9280 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
9282 . ie '\\*[$HDRFTR_CENTER]'#' \{\
9283 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
9286 . ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
9287 . el \{ .PRINT \& \}
9289 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
9292 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
9293 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
9295 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
9296 . PRINT \\n[#PAGENUMBER]
9299 . ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \\*[$HDRFTR_RIGHT] \}
9300 . el \{ .PRINT \& \}
9302 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
9304 . if \\n[#PRINT_STYLE]=2 \{\
9305 . if \\n[#HDRFTR_COLOR]=1 \{\
9307 \m[\\*[$HDRFTR_COLOR]]
9309 . fam \\*[$HDRFTR_LEFT_FAM]
9310 . ft \\*[$HDRFTR_LEFT_FT]
9311 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
9313 . if \\n[#FOOTERS_ON] \{\
9316 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
9321 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
9322 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
9323 . ie '\\*[$HDRFTR_LEFT]'#' \{\
9324 . ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
9325 . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[]
9328 . PRINT \\n[#PAGENUMBER]
9332 . ie !'\\*[$HDRFTR_LEFT]'' \{\
9333 . ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
9334 . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[]
9337 . PRINT \\*[$HDRFTR_LEFT]
9340 . el \{ .PRINT \& \}
9342 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
9343 . fam \\*[$HDRFTR_CENTER_FAM]
9344 . ft \\*[$HDRFTR_CENTER_FT]
9345 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
9347 . if \\n[#FOOTERS_ON] \{\
9350 . nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
9354 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
9356 . ie '\\*[$HDRFTR_CENTER]'#' \{\
9357 . ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
9358 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
9361 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
9365 . ie !'\\*[$HDRFTR_CENTER]'' \{\
9366 . ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
9367 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
9370 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
9373 . el \{ .PRINT \& \}
9375 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
9376 . fam \\*[$HDRFTR_RIGHT_FAM]
9377 . ft \\*[$HDRFTR_RIGHT_FT]
9378 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
9380 . if \\n[#FOOTERS_ON] \{\
9383 . nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
9388 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
9389 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
9391 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
9392 . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
9393 . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[]
9396 . PRINT \\n[#PAGENUMBER]
9400 . ie !'\\*[$HDRFTR_RIGHT]'' \{\
9401 . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
9402 . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[]
9405 . PRINT \\*[$HDRFTR_RIGHT]
9408 . el \{ .PRINT \& \}
9410 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
9412 . if \\n[#HDRFTR_RULE] \{\
9413 . HDRFTR_RULE_INTERNAL
9419 \# PRINT USER DEFINED HEADER/FOOTER
9420 \# --------------------------------
9424 \# Based on defaults or values entered by user, prints a single part
9425 \# (i.e. not 3-part) title at either the top or the bottom of the page.
9427 \# Called from within PRINT_HDRFTR.
9429 .MAC PRINT_USERDEF_HDRFTR END
9430 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
9432 . if \\n[#PRINT_STYLE]=2 \{\
9433 . fam \\*[$HDRFTR_FAM]
9435 . ps \\n[#HDRFTR_PT_SIZE]u
9436 . if \\n[#HDRFTR_COLOR]=1 \{\
9438 . COLOR \\*[$HDRFTR_COLOR]
9441 . ie \\n[#RECTO_VERSO] \{\
9443 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
9444 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
9445 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
9446 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS \}
9447 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
9448 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS OFF \}
9450 . if \\n[#FOOTERS_ON] \{\
9453 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9458 . ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
9459 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT \}
9460 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
9461 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT \}
9462 . if \\n[#HDRFTR_VERSO_CAPS]=1 \{ .CAPS \}
9463 . PRINT \\*[$USERDEF_HDRFTR_VERSO]
9464 . if \\n[#HDRFTR_VERSO_CAPS]=1 \{ .CAPS OFF \}
9466 . if \\n[#FOOTERS_ON] \{\
9469 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9474 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
9475 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
9476 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
9477 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS \}
9478 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
9479 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS OFF \}
9481 . if \\n[#FOOTERS_ON] \{\
9484 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9491 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
9492 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
9493 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
9494 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS \}
9495 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
9496 . if \\n[#HDRFTR_RECTO_CAPS]=1 \{ .CAPS OFF \}
9498 . if \\n[#FOOTERS_ON] \{\
9501 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9506 . if \\n[#PRINT_STYLE]=2 \{\
9507 . ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]]
9510 . if \\n[#HDRFTR_RULE] \{\
9511 . HDRFTR_RULE_INTERNAL
9518 \# HEADERS (off or on)
9519 \# -------------------
9521 \# <none> | <anything>
9523 \# Turns headers at the top of the page off or on.
9528 . ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
9529 . el \{ .nr #HEADERS_ON 0 \}
9536 \# <amount of space between top of page and header>
9538 \# Creates or modifies register #HEADER_MARGIN to hold amount
9539 \# of space between top of page and header.
9541 \# Requires unit of measure. Default is 4P+6p, measured top-of-page
9544 .MAC HEADER_MARGIN END
9545 . nr #HEADER_MARGIN (\\$1)
9552 \# <amount of space between header and running text>
9554 \# Creates or modifies register #HEADER_GAP to hold amount
9555 \# of space between header and running text.
9557 \# Default is 1P+6p.
9560 . nr #HEADER_GAP (\\$1)
9569 \# Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
9571 \# In order to convert the title string to caps in the header (in the
9572 \# event that the user enters .TITLE in caps/lc), I've used
9573 \# quad left, quad centre, and quad right to arrange the three bits
9574 \# of the header, rather than .tl. This allows the use of the CAPS macro.
9575 \# The downside is that I have to add \\v'-(\\n[#LEAD]u*<n>) in order
9576 \# for -Tlatin1 output to align the header/footer strings on the baseline.
9577 \# The console output still isn't brilliant, but at least it's
9584 . nr #LAST_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]
9585 . if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
9587 . if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
9588 . po \\n[#DOC_L_MARGIN]u
9589 . if \\n[#RECTO_VERSO] \{\
9590 . if !\\n[#TOC_RV_SWITCH] \{\
9591 . nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
9592 . DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u
9593 . DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
9594 . SWITCH_HDRFTR_CENTER_PAD
9599 . if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
9600 . sp |\\n[#HEADER_MARGIN]u-1v
9602 . ll \\n[#DOC_L_LENGTH]u
9604 . if \\n[#PRINT_STYLE]=1 \{\
9607 . ps 12\\*[$HDRFTR_SIZE_CHANGE]
9609 . if \\n[#PRINT_STYLE]=2 \{\
9610 . fam \\*[$HDRFTR_FAM]
9612 . ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
9615 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
9616 . if \\n[#CAPS_ON] \{\
9620 . if \\n[#UNDERLINE_ON] \{\
9621 . nr #UNDERLINE_WAS_ON 1
9624 . if \\n[#PRINT_STYLE]=1 \{\
9625 . if \\n[#ENDNOTES]=1 \{\
9626 .\" Single-spaced endotes have a different lead
9627 . if \\n[#EN_SINGLESPACE] \{\
9628 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
9629 . nr #DOC_LEAD \\n[#EN_LEAD]u
9633 . nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
9635 . ie \\n[#HEADERS_ON] \{\
9637 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
9640 . ie \\n[#PAGE_NUM_V_POS]=1 \{\
9641 . ie \\n[#PAGINATE] \{\
9643 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
9645 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
9647 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
9649 . if \\n[#PRINT_STYLE]=1 \{\
9650 . if \\n[#ENDNOTES]=1 \{\
9651 . if \\n[#EN_SINGLESPACE] \{\
9652 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
9653 . rr #RESTORE_DOC_LEAD
9657 . nr #PAGE_TOP \\n(nl
9659 . po \\n[#L_MARGIN]u
9660 . if \\n[#RECTO_VERSO] \{\
9661 . nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
9663 . if \\n[#CAPS_WAS_ON] \{\
9667 . if \\n[#UNDERLINE_WAS_ON] \{\
9669 . rr #UNDERLINE_WAS_ON
9671 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9672 . if \\n[#QUOTE] \{\
9673 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9675 . ie r#Q_OFFSET_VALUE \{\
9676 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9679 . nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9681 . po \\n[#Q_OFFSET]u
9683 . if \\n[#PRINTSTYLE]=2 \{ .ALD \\n[#Q_LEAD_DIFF]u \}
9685 . if \\n[#EPIGRAPH] \{\
9686 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9688 . ie r#EPI_OFFSET_VALUE \{\
9689 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9692 . nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9694 . po \\n[#EPI_OFFSET]u
9697 . ie \\n[#EPIGRAPH] \{\
9698 . ie !\\n[#EPI_ACTIVE] \{\
9703 . ie \\n[#EPI_FITS] \{ .ns \}
9704 . el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
9709 . if \\n[#COLUMNS] \{\
9710 . nr #FN_COUNT_FOR_COLS 0 1
9711 . nr #L_MARGIN \\n[#DOC_L_MARGIN]
9712 . if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
9715 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
9716 . nr #L_MARGIN \\n(.o
9717 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9718 . ll \\n[#COL_L_LENGTH]u
9720 . if \\n[#QUOTE] \{\
9721 . ie r#Q_OFFSET_VALUE \{\
9722 . po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
9725 . po +\\*[$Q_OFFSET_VALUE]
9728 . if \\n[#EPIGRAPH] \{\
9729 . if \\n[#EPI_ACTIVE] \{\
9730 . ie \\n[#EPI_FITS] \{ . \}
9731 . el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
9733 . ie r#EPI_OFFSET_VALUE \{\
9734 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
9737 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+\\*[$EPI_OFFSET_VALUE]
9741 . if \\n[#RESET_FN_COUNTERS]=1 \{\
9742 . rr #RESET_FN_COUNTERS
9743 . PROCESS_FN_IN_DIVER
9744 . nr #FN_COUNT \\n[#SAVED_FN_COUNT] 1
9745 . if \\n[#COLUMNS]=1 \{ .nr #FN_COUNT_FOR_COLS \\n[#SAVED_FN_COUNT_FOR_COLS] 1 \}
9746 . ie \\n[#RESET_FN_NUMBER]=1 \{ .nr #FN_NUMBER \\n[#SAVED_FN_NUMBER] 1 \}
9747 . el \{ .nr #FN_NUMBER \\n[#FN_NUMBER] 1 \}
9749 . if dRUNON_FN_IN_DIVER \{ .rm RUNON_FN_IN_DIVER \}
9751 . if \\n[#PRINT_STYLE]=1 \{\
9752 . if \\n[#SLANT_ON] \{\
9753 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
9755 . if \\n[#UNDERLINE_ON]=1 \{\
9756 . if \\n[#UNDERLINE_ITALIC] \{ .UNDERLINE \}
9760 . rr #DEFER_SPACE_ADDED
9761 . if !\\n[#FN_DEPTH] \{\
9762 . if r#DIVERTED \{ .rr #DIVERTED \}
9764 . if \\n[#MN_OVERFLOW_LEFT]=1 \{\
9770 . if \\n[#MN_OVERFLOW_RIGHT]=1 \{\
9776 . rm MN_OVERFLOW_LEFT
9777 . rr #MN_OVERFLOW_LEFT
9778 . rr #no-repeat-MN-left
9779 . rm MN_OVERFLOW_RIGHT
9780 . rr #MN_OVERFLOW_RIGHT
9781 . rr #no-repeat-MN-right
9782 . if \\n[#PRE_COLLATE]=1 \{ .rr #PRE_COLLATE \}
9785 \# ====================================================================
9789 \# FOOTERS (off or on)
9790 \# -------------------
9792 \# <none> | <anything>
9794 \# Turns footers at the bottom of the page off or on.
9796 \# Default is off. If on, page numbers automatically go at
9797 \# the top, centered, unless pagination has been turned off,
9798 \# or the pagenumber position has been changed to left or right.
9804 . PAGENUM_POS TOP CENTER
9806 . el \{ .nr #FOOTERS_ON 0 \}
9815 \# Creates or modifies register #FOOTER_MARGIN which holds the
9816 \# amount of space to leave between the page number and the bottom
9819 \# Unit of measure required. Default is 3P.
9821 .MAC FOOTER_MARGIN END
9822 . ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
9830 \# <distance from end of running text to page # or footer>
9832 \# Creates or modifies register #FOOTER_GAP which holds the
9833 \# amount of space to leave between running text and the page number.
9835 \# Requires unit of measure. Default is 3P. Measured baseline to
9839 . ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
9849 \# Places footer at bottom of page if #FOOTERS=1, otherwise
9850 \# places page number at bottom of page (if #PAGINATE=1).
9851 \# Page numbers are in arabic or roman according to COPYSTYLE.
9852 \# DRAFT starts the document at page 1 regardless of PAGENUMBER.
9853 \# FINAL respects PAGENUMBER.
9856 . ev PAGE_TRANSITION
9857 . if \\n[MN-left]>0 \{\
9858 . if !\\n[#no-repeat-MN-left]=1 \{\
9860 . nr #no-repeat-MN-left 1
9862 . if '\\n(.z'MN_OVERFLOW_LEFT' \{\
9864 . nr #MN_OVERFLOW_LEFT 1
9868 . if \\n[MN-right]>0 \{\
9869 . if (\\n[MN-right] > 0) \{\
9870 . if !\\n[#no-repeat-MN-right]=1 \{\
9874 . if '\\n(.z'MN_OVERFLOW_RIGHT' \{\
9876 . nr #MN_OVERFLOW_RIGHT 1
9877 . rr #OVERFLOW_RIGHT
9880 . ch MN_OVERFLOW_TRAP
9881 . nr #SAVED_LEAD \\n(.v
9882 . nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
9883 . if !\\n[#FN_DEFER] \{\
9885 . if \\n[#FN_DEPTH] \{\
9886 . if \\n[#DIVERTED]=3 \{ .nr #FN_DEPTH +\\n[#VFP_DIFF] \}
9888 . sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u-\\n[#DOC_LEAD]u)
9890 . po \\n[#DOC_L_MARGIN]u
9891 . if \\n[#COLUMNS] \{\
9892 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9893 . nr #L_MARGIN \\n(.o
9899 . if dRUNON_FOOTNOTES \{ .rm RUNON_FOOTNOTES \}
9900 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#SAVED_LEAD]u \}
9901 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#SAVED_LEAD]u \}
9902 . if '\\n(.z'FN_OVERFLOW' \{\
9904 . nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
9906 . nr #FN_COUNT_AT_FOOTER \\n[#FN_COUNT]
9908 . if \\n[#COL_NEXT] \{\
9909 . ie !\\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
9910 . el \{ .nr #COL_NUM \\n[#NUM_COLS] 1 \}
9915 . ie \\n[#COLUMNS]=1 \{\
9916 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
9918 . ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
9919 . el \{ .sp |\\n(dcu \}
9920 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
9921 . nr #L_MARGIN \\n(.o
9922 . if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
9923 . LS \\n[#SAVED_LEAD]u
9924 . if \\n[#PREV_FN_DEFERRED] \{\
9925 . nr #PREV_FN_DEFERRED 2
9928 . if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
9929 . if !\\n[#QUOTE] \{ .rr #COL_NEXT \}
9930 . if \\n[#RESET_FN_COUNTERS]=1 \{\
9931 . rr #RESET_FN_COUNTERS
9932 . PROCESS_FN_IN_DIVER
9933 . LS \\n[#SAVED_LEAD]u
9934 . nr #FN_COUNT \\n[#FN_COUNT] 1
9935 . nr #FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] 1
9937 . if dRUNON_FN_IN_DIVER \{ .rm RUNON_FN_IN_DIVER \}
9939 . rr #DEFER_SPACE_ADDED
9940 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9941 . if \\n[#QUOTE] \{\
9942 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9944 . ie r#Q_OFFSET_VALUE \{\
9945 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9948 . nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9950 . if \\n[#COLUMNS] \{\
9951 . ie r#Q_OFFSET_VALUE \{\
9952 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9955 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9958 . po \\n[#Q_OFFSET]u
9961 . if \\n[#EPIGRAPH] \{\
9962 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
9964 . ie r#EPI_OFFSET_VALUE \{\
9965 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9968 . nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9970 . if \\n[#COLUMNS] \{\
9971 . ie r#EPI_OFFSET_VALUE \{\
9972 . nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9975 . nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9978 . po \\n[#EPI_OFFSET]u
9981 . ie \\n[#EPIGRAPH] \{\
9982 . ie !\\n[#EPI_ACTIVE] \{\
9987 . sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
9997 . el \{ .DO_FOOTER \}
10006 \# Prints footer (page number, or 3-part footer).
10007 \# Resets CAPS and UNDERLINE if they were on.
10010 .\" Have to change position of FN_OVERFLOW_TRAP or it screws up the
10011 .\" placement of page numbers (or footers). It's reset to its original
10012 .\" position at the end of the macro.
10013 . if r#SAVED_FOOTER_POS \{ .ch FOOTER \\n[#SAVED_FOOTER_POS]u \}
10014 . rr #SAVED_FOOTER_POS
10015 . ie (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
10016 . nr #SKIP_FOOTER 1
10020 . sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
10025 . po \\n[#DOC_L_MARGIN]u
10026 . ll \\n[#DOC_L_LENGTH]u
10028 . if \\n[#PRINT_STYLE]=1 \{\
10031 . if \\n[#PRINT_STYLE]=2 \{\
10032 . fam \\*[$HDRFTR_FAM]
10034 . ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
10036 . vs \\n[#SAVED_LEAD]u
10037 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
10038 . if \\n[#CAPS_ON] \{\
10039 . nr #CAPS_WAS_ON 1
10042 . if \\n[#UNDERLINE_ON] \{\
10043 . nr #UNDERLINE_WAS_ON 1
10046 . ie \\n[#FOOTERS_ON] \{\
10047 . if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_HDRFTR \}
10050 . if \\n[#PAGINATE] \{\
10051 . if \\n[#PAGE_NUM_V_POS]=2 \{\
10052 . if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_PAGE_NUMBER \}
10057 . if \\n[#CAPS_WAS_ON] \{\
10061 . if \\n[#UNDERLINE_WAS_ON] \{\
10063 . rr #UNDERLINE_WAS_ON
10068 .\" This ev pops the PAGE_TRANSITION environment still active at the
10073 \# ====================================================================
10075 \# +++HEADERS AND FOOTERS+++
10077 \# HEADERS_AND_FOOTERS
10078 \# -------------------
10080 \# HEADER_RECTO_QUAD \
10081 \# HEADER_RECTO_STRING \
10082 \# FOOTER_RECTO_QUAD \
10083 \# FOOTER_RECTO_STRING \
10084 \# HEADER_VERSO_QUAD \
10085 \# HEADER_VERSO_STRING \
10086 \# FOOTER_VERSO_QUAD \
10087 \# FOOTER_VERSO_STRING
10090 \# Allows having both headers and footers. Sets register
10091 \# #HDRFTR_BOTH to 1; collects HEADER/FOOTER_RECTO/VERSO
10092 \# information; appends FOOTER_RECTO and FOOTER_VERSO to
10093 \# START and turns off pagination; appends to macros
10094 \# PRINT_USERDEF_HDRFTR and HEADER the necessary number
10095 \# register manipulations and redefinitions of the
10096 \# HEADER/FOOTER_RECTO/VERSO strings so that both
10097 \# headers and footers get printed, with the appropriate
10098 \# strings for each
10100 \# Works in conjunction with HDRFTR_RECTO and HDRFTR_VERSO (qqv.),
10101 \# ergo all style changes must be done inline in the strings
10102 \# passed as arguments.
10104 .MAC HEADERS_AND_FOOTERS END
10105 . ie \\n[#NUM_ARGS]>1 \{\
10106 . nr #HDRFTR_BOTH 1
10108 . if !r#HEADER_RULE .nr #HEADER_RULE 1
10109 . if !r#FOOTER_RULE .nr #FOOTER_RULE 1
10110 . ds $HDR_RECTO_QUAD \\$1
10111 . ds $HDR_RECTO_STRING \\$2
10112 . ds $FTR_RECTO_QUAD \\$3
10113 . ds $FTR_RECTO_STRING \\$4
10114 . ds $HDR_VERSO_QUAD \\$5
10115 . ds $HDR_VERSO_STRING \\$6
10116 . ds $FTR_VERSO_QUAD \\$7
10117 . ds $FTR_VERSO_STRING \\$8
10119 . if \\\\n[#HDRFTR_BOTH]=1 \{\
10120 . FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
10121 . FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
10122 . if \\\\n[#HEADER_RULE]=1 \{ .HEADER_RULE \}
10123 . ie \\\\n[#FOOTER_RULE]=1 \{ .FOOTER_RULE \}
10124 . el \{ .FOOTER_RULE OFF \}
10125 . if r#PAGINATE .rr #PAGINATE
10126 . if r#PAGE_NUM_V_POS .rr #PAGE_NUM_V_POS
10129 .am PRINT_USERDEF_HDRFTR DONE
10130 . if \\\\n[#HDRFTR_BOTH]=1 \{\
10131 . if \\n[#FOOTERS_ON]=1 \{\
10132 . if !\\\\n[#COLLATE]=1 \{\
10133 . HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
10134 . HEADER_VERSO \\*[$HDR_VERSO_QUAD] "\\*[$HDR_VERSO_STRING]"
10137 . ie \\\\n[#HEADER_RULE]=1 \{ .HEADER_RULE \}
10138 . el \{ .HEADER_RULE OFF \}
10141 . if \\n[#HEADERS_ON]=1 \{\
10142 . FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
10143 . FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
10148 . if \\\\n[#HDRFTR_BOTH]=1 \{\
10149 . if r#START_FOR_FOOTERS .rr #START_FOR_FOOTERS
10152 . FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
10153 . FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
10154 . ie \\\\n[#FOOTER_RULE]=1 \{ .FOOTER_RULE \}
10155 . el \{ .FOOTER_RULE OFF \}
10161 . rr #USERDEF_HDRFTR
10162 . rm $USERDEF_HDRFTR_RECTO
10163 . rm $USERDEF_HDRFTR_VERSO
10166 . if \\n[#COLLATE]=1 \{\
10167 . nr #HEADER_STATE 1
10168 . nr #PAGINATION_STATE 1
10171 . PAGENUM_POS BOTTOM CENTER
10176 \# ====================================================================
10180 \# ---Head numbers---
10185 \# <none> | <anything>
10187 \# Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
10191 .MAC NUMBER_HEADS END
10193 . nr #NUMBER_HEAD 1
10194 . if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
10196 . el \{ .rr #NUMBER_HEAD \}
10200 \# RESET HEAD NUMBER
10201 \# -----------------
10203 \# <none> | <desired head number>
10205 \# Resets incrementing register #HEAD_NUM to 1 or, if there's
10206 \# an argument, to user supplied number.
10208 \# Also resets subhead and parahead numbers. If this is not
10209 \# desired, subhead and parahead numbers may be reset individually.
10211 .MAC RESET_HEAD_NUMBER END
10218 . nr #HEAD_NUM \\$1-1 1
10228 \# <none> | <anything>
10230 \# Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
10234 .MAC NUMBER_SUBHEADS END
10237 . if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
10239 . el \{ .rr #NUMBER_SH \}
10243 \# RESET SUBHEAD NUMBER
10244 \# --------------------
10246 \# <none> | <desired subhead number>
10248 \# Resets incrementing register #SH_NUM to 1 or, if there's
10249 \# an argument, to user supplied number.
10251 \# When the subhead number is reset, it resets the parahead number as
10252 \# well. If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
10253 \# allows the user to set the parahead number to whatever s/he desires.
10255 .MAC RESET_SUBHEAD_NUMBER END
10256 . ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
10258 . nr #SH_NUM \\$1-1 1
10264 \# NUMBER PARAHEADS
10265 \# ----------------
10267 \# <none> | <anything>
10269 \# Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
10273 .MAC NUMBER_PARAHEADS END
10276 . if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
10278 . el \{ .rr #NUMBER_PH \}
10282 \# RESET PARAHEAD NUMBER
10283 \# ---------------------
10285 \# <none> | <desired parahead number>
10287 \# Resets incrementing register #PH_NUM to 1 or, if there's
10288 \# an argument, to user supplied number.
10290 \# Resetting the parahead number resets the parahead number
10293 .MAC RESET_PARAHEAD_NUMBER END
10294 . ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
10295 . el \{ .nr #SH_NUM \\$1-1 1 \}
10299 \# PREFIX CHAPTER NUMBERS TO NUMBERED HEADS, SUBHEADS AND PARAHEADS
10300 \# ----------------------------------------------------------------
10302 \# <none> | <chapter number> | <anything>
10304 \# Toggles register #PREFIX_CH_NUM. Sets register #CH_NUM from
10305 \# string $CHAPTER if $CHAPTER is a digit; if <chapter number> arg
10306 \# given, sets #CH_NUM to arg.
10310 .MAC PREFIX_CHAPTER_NUMBER END
10313 . nr #PREFIX_CH_NUM 1
10314 . if \\n[#CHAPTER_CALLED] \{\
10315 . ie \B'\\*[$CHAPTER]' \{\
10316 . nr #CH_NUM \\*[$CHAPTER]
10319 . PREFIX_CH_NUM_WARNING
10321 . rr #CHAPTER_CALLED
10325 . ie \B'\\*[$CHAPTER]' \{\
10326 . nr #PREFIX_CH_NUM 1
10327 . nr #CH_NUM \\*[$CHAPTER]
10330 . PREFIX_CH_NUM_WARNING
10337 . nr #PREFIX_CH_NUM 1
10340 . rr #PREFIX_CH_NUM
10345 .MAC PREFIX_CH_NUM_WARNING END
10346 . tm1 "[mom]: PREFIX_CHAPTER_NUMBER cannot determine a chapter number.
10347 . tm1 " Please enter the current chapter number as a digit after
10348 . tm1 " PREFIX_CHAPTER_NUMBER.
10349 . ab Aborting on PREFIX_CHAPTER_NUMBER at line \\n(.c.
10353 \# ---Main heads---
10358 \# <none> | <anything>
10360 \# Creates or modifies register #HEAD_CAPS.
10365 . ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
10366 . el \{ .nr #HEAD_CAPS 0 \}
10373 \# <none> | <anything>
10375 \# Creates register #HEAD_SPACE, which toggles whether the space
10376 \# before heads is 1 extra line space ("off") or 2 ("on"). Used only
10377 \# in PRINTSTYLE TYPESET.
10381 .MAC HEAD_SPACE END
10382 . ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
10383 . el \{ .nr #HEAD_SPACE 0 \}
10390 \# "text of main head" ["text of main head"] ...
10392 \# In TYPEWRITE, prints main heads centered, all caps, underlined.
10393 \# In TYPESET, prints bold main heads 1 point larger than running
10394 \# text, all caps, underlined.
10396 \# The HEAD macro requires that double-quotes (") surround
10397 \# each line of text.
10401 . if \\n[#PRINT_STYLE]=1 \{ .ne \\n[#NUM_ARGS]+2 \}
10402 . if \\n[#PRINT_STYLE]=2 \{\
10403 . ie \\n[#HEAD_SPACE] \{ .ne \\n[#NUM_ARGS]+3 \}
10404 . el \{ .ne \\n[#NUM_ARGS]+2 \}
10406 .\" Collect head for TOC.
10408 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
10409 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
10410 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10411 . ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
10412 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\\|
10415 .\" Note that in the .as lines, below, \ at the end has a literal
10416 .\" space after it.
10417 . ie \\n[#NUMBER_HEAD] \{\
10418 . ie \\n[#ARG_NUM]=0 \{\
10419 . as $TOC_HEAD_ITEM \\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\ \"
10420 . nr #HEAD_NUM \\n-[#HEAD_NUM]
10423 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ \"
10427 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ \"
10431 .\" Note the use of \!, which transparently embeds the macros used
10432 .\" in the TOC_ENTRIES diversion. The elements they control must be
10433 .\" processed literally when the diversion is output.
10436 . if \\n[#PRINT_STYLE]=1 \{\
10441 . if \\n[#PRINT_STYLE]=2 \{\
10442 \!. FAMILY \\*[$TOC_HEAD_FAM]
10443 \!. FT \\*[$TOC_HEAD_FT]
10444 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
10448 . ie \\n[#PRINT_STYLE]=1 \{\
10449 \!. PAD "\\h'2m'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN_TYPEWRITE]"
10452 \!. PAD "\\h'\\n[#TOC_HEAD_INDENT]u'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN]"
10458 . if \\n[#PRINT_STYLE]=2 \{\
10459 \!. FAMILY \\*[$TOC_PN_FAM]
10460 \!. FT \\*[$TOC_PN_FT]
10461 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10464 \!. PRINT \\*[LEADER]
10467 \!. PRINT \\n[#TOC_ENTRY_PN]
10471 .\" End collection of head for TOC
10475 . ll \\n[#L_LENGTH]u
10477 . if \\n[#COLUMNS] \{\
10478 . ll \\n[#COL_L_LENGTH]u
10482 . QUAD \\*[$HEAD_QUAD]
10483 . if \\n[#PRINT_STYLE]=1 \{\
10485 . vs \\n[#DOC_LEAD]u
10488 . if \\n[#PRINT_STYLE]=2 \{\
10489 . FAMILY \\*[$HEAD_FAM]
10491 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
10492 . LS \\n[#DOC_LEAD]u
10494 . if r#QUOTE \{ .rr #QUOTE \}
10495 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
10496 . ie \\n[#START] \{\
10497 . if \\n[#DOC_HEADER]=0 \{ .RLD 1v \}
10500 . if \\n[#PRINT_STYLE]=1 \{\
10501 . if !\\n[#LINEBREAK] \{\
10502 . ALD \\n[#DOC_LEAD]u
10503 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
10506 . if \\n[#PRINT_STYLE]=2 \{\
10507 . ie \\n[#PP_SPACE] \{\
10508 . ie \\n[#END_QUOTE] \{ . \}
10510 . if !\\n[#LINEBREAK] \{\
10511 . if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
10516 . ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
10517 . el \{ .ALD \\n[#DOC_LEAD]u \}
10519 . if \\n[#END_QUOTE] \{\
10520 . if !\\n[#Q_FITS] \{\
10521 . RLD \\n[#DOC_LEAD]u
10522 . if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
10524 . if \\n[#Q_AT_TOP] \{\
10525 . RLD \\n[#DOC_LEAD]u
10526 . if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
10529 . if \\n[#LINEBREAK] \{\
10530 . if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
10537 . if \\n[#HEAD_CAPS] \{ .CAPS \}
10538 . if \\n[#PRINT_STYLE]=2 \{\
10539 . if \\n[#HEAD_COLOR]=1 \{\
10541 . COLOR \\*[$HEAD_COLOR]
10546 . if \\n[#PRINT_STYLE]=1 \{\
10547 . ie \\n[#HEAD_CAPS]=1 \{\
10548 . ds $HEAD_UNDERLINE_GAP 2p
10551 . ds $HEAD_UNDERLINE_GAP 4p
10554 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10555 . ie \\n[#NUMBER_HEAD] \{\
10556 . ie \\n[#ARG_NUM]=0 \{\
10557 . ie \\n[#PREFIX_CH_NUM]=1 \{\
10558 . ds $CH_NUM \\n[#CH_NUM].
10564 . ie \\n[#HEAD_UNDERLINE]=0 \{\
10565 . PRINT "\\*[$CH_NUM]\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]"
10568 . UNDERSCORE \\*[$HEAD_UNDERLINE_GAP] "\\*[$CH_NUM]\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]"
10574 . ie \\n[#HEAD_UNDERLINE]=0 \{\
10575 . PRINT "\\$[\\n+[#ARG_NUM]]"
10578 . UNDERSCORE \\*[$HEAD_UNDERLINE_GAP] "\\$[\\n+[#ARG_NUM]]"
10585 . ie \\n[#HEAD_UNDERLINE]=0 \{\
10586 . PRINT "\\$[\\n+[#ARG_NUM]]"
10589 . UNDERSCORE \\*[$HEAD_UNDERLINE_GAP] "\\$[\\n+[#ARG_NUM]]"
10597 . ALD \\n[#DOC_LEAD]u
10598 . if \\n[#NUMBER_HEAD] \{ .RESET_SUBHEAD_NUMBER \}
10599 . if \\n[#NUMBER_SH] \{ .RESET_PARAHEAD_NUMBER \}
10600 . if r#START \{ .rr #START \}
10601 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
10602 . if r#QUOTE \{ .rr #QUOTE \}
10603 . if r#Q_FITS \{ .rr #Q_FITS \}
10604 . if r#END_QUOTE \{ .rr #END_QUOTE \}
10605 . if r#LINEBREAK \{ .rr #LINEBREAK \}
10606 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
10607 . if r#PP_ACTIVE \{ .rr #PP_ACTIVE \}
10610 . rm $TOC_HEAD_ITEM
10620 \# "text of subhead" ["text of subhead"] ...
10622 \# In TYPEWRITE, prints subheads underlined.
10623 \# In TYPESET, prints subheads bold, .5 points larger than running
10625 \# In both styles, a line space precedes the subhead, and a small
10626 \# amount of lead comes after.
10628 \# As with the HEAD macro, double-quotes (") must surround
10629 \# each line of text.
10633 . ne \\n[#NUM_ARGS]+2
10634 .\" Collect subhead for TOC.
10636 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
10637 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10638 . ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
10639 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\\|
10642 .\" Note that in the .as lines, below, \ at the end has a literal
10643 .\" space after it.
10644 . ie \\n[#NUMBER_SH] \{\
10645 . ie \\n[#ARG_NUM]=0 \{\
10646 . as $TOC_SH_ITEM \\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]\ \"
10647 . nr #SH_NUM \\n-[#SH_NUM]
10650 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ \"
10654 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ \"
10658 .\" Note the use of \!, which transparently embeds the macros used
10659 .\" in the TOC_ENTRIES diversion. The elements they control must be
10660 .\" processed literally when the diversion is output.
10663 . if \\n[#PRINT_STYLE]=1 \{\
10668 . if \\n[#PRINT_STYLE]=2 \{\
10669 \!. FAMILY \\*[$TOC_SH_FAM]
10670 \!. FT \\*[$TOC_SH_FT]
10671 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
10675 . ie \\n[#PRINT_STYLE]=1 \{\
10676 \!. PAD "\\h'4m'\\*[$TOC_SH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
10679 \!. PAD "\\h'\\n[#TOC_SH_INDENT]u'\\*[$TOC_SH_ITEM]\\*[$TOC_PN]"
10685 . if \\n[#PRINT_STYLE]=2 \{\
10686 \!. FAMILY \\*[$TOC_PN_FAM]
10687 \!. FT \\*[$TOC_PN_FT]
10688 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10691 \!. PRINT \\*[LEADER]
10694 \!. PRINT \\n[#TOC_ENTRY_PN]
10698 .\" End collection of head for TOC
10699 .\" Process subhead
10701 . if r#QUOTE \{ .rr #QUOTE \}
10702 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
10704 . ll \\n[#L_LENGTH]u
10706 . if \\n[#COLUMNS] \{\
10707 . ll \\n[#COL_L_LENGTH]u
10711 . if \\n[#PRINT_STYLE]=1 \{\
10713 . vs \\n[#DOC_LEAD]u
10714 . QUAD \\*[$SH_QUAD]
10717 . if \\n[#PRINT_STYLE]=2 \{\
10718 . FAMILY \\*[$SH_FAM]
10720 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
10721 . LS \\n[#DOC_LEAD]u
10722 . QUAD \\*[$SH_QUAD]
10724 . if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
10725 . if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
10726 . ie \\n[#START] \{ .RLD 1v \}
10728 . ie \\n[#HEAD]=1 \{ . \}
10730 . if \\n[#PRINT_STYLE]=1 \{\
10731 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
10733 . if \\n[#PRINT_STYLE]=2 \{\
10734 . ie \\n[#PP_SPACE]=1 \{\
10735 . ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
10736 . el \{ .RLD \\n[#DOC_LEAD]u \}
10739 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
10745 . if \\n[#PRINT_STYLE]=1 \{\
10746 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10747 . ie \\n[#NUMBER_SH] \{\
10748 . ie \\n[#ARG_NUM]=0 \{\
10749 . ie \\n[#PREFIX_CH_NUM]=1 \{\
10750 . ds $CH_NUM \\n[#CH_NUM].
10755 . ie \\n[#NUMBER_HEAD] \{\
10757 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]"
10762 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]"
10768 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]"
10774 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]"
10779 . if \\n[#PRINT_STYLE]=1 \{\
10780 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
10782 . if \\n[#PRINT_STYLE]=2 \{\
10783 . if \\n[#SH_COLOR]=1 \{ .COLOR \\*[$SH_COLOR] \}
10784 . ie \\n[#PP_SPACE]=0 \{\
10785 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10786 . ie \\n[#NUMBER_SH] \{\
10787 . ie \\n[#ARG_NUM]=0 \{\
10788 . ie \\n[#PREFIX_CH_NUM]=1 \{\
10789 . ds $CH_NUM \\n[#CH_NUM].
10794 . ie \\n[#NUMBER_HEAD] \{\
10796 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
10801 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
10807 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
10813 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
10819 . ALD \\n[#DOC_LEAD]u
10820 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
10821 . if \\n[#END_QUOTE] \{ .RLD \\n[#DOC_LEAD]u \}
10822 . if \\n[#EPIGRAPH] \{ .RLD \\n[#DOC_LEAD]u \}
10823 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10824 . ie \\n[#NUMBER_SH] \{\
10825 . ie \\n[#ARG_NUM]=0 \{\
10826 . ie \\n[#PREFIX_CH_NUM]=1 \{\
10827 . ds $CH_NUM \\n[#CH_NUM].
10832 . ie \\n[#NUMBER_HEAD] \{\
10834 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
10839 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\*[$CH_NUM]\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
10845 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
10851 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
10855 . ALD \\n[#DOC_LEAD]u
10860 . if \\n[#NUMBER_SH] \{ .RESET_PARAHEAD_NUMBER \}
10861 . if r#START \{ .rr #START \}
10862 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
10863 . if r#Q_FITS \{ .rr #Q_FITS \}
10864 . if r#END_QUOTE \{ .rr #END_QUOTE \}
10865 . if r#LINEBREAK \{ .rr #LINEBREAK \}
10871 \# ---Paragraph heads---
10876 \# <size of indent>
10878 \# Creates or modifies register #PH_INDENT.
10880 \# Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
10882 .MAC PARAHEAD_INDENT END
10883 . nr #PH_INDENT (\\$1)
10892 \# Deposits a paragraph head at the start and into the body of a
10895 \# PARAHEAD *must* come after PP.
10898 .\" Collect parahead for TOC.
10899 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
10900 . ie \\n[#NUMBER_PH] \{\
10901 . ds $TOC_PH_ITEM \\n+[#PH_NUM].\0\\$1\\|
10902 . nr #PH_NUM \\n-[#PH_NUM]
10905 . ds $TOC_PH_ITEM \\$1\\|
10909 . if \\n[#PRINT_STYLE]=1 \{\
10914 . if \\n[#PRINT_STYLE]=2 \{\
10915 \!. FAMILY \\*[$TOC_PH_FAM]
10916 \!. FT \\*[$TOC_PH_FT]
10917 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PH_SIZE_CHANGE]
10921 . ie \\n[#PRINT_STYLE]=1 \{\
10922 \!. PAD "\\h'6m'\\*[$TOC_PH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
10925 \!. PAD "\\h'\\n[#TOC_PH_INDENT]u'\\*[$TOC_PH_ITEM]\\*[$TOC_PN]"
10931 . if \\n[#PRINT_STYLE]=2 \{\
10932 \!. FAMILY \\*[$TOC_PN_FAM]
10933 \!. FT \\*[$TOC_PN_FT]
10934 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10937 \!. PRINT \\*[LEADER]
10940 \!. PRINT \\n[#TOC_ENTRY_PN]
10944 .\" End collection of parahead for TOC
10945 .\" Process parahead
10946 . if \\n[#SLANT_ON] \{\
10947 . nr #SLANT_WAS_ON 1
10950 . ie \\n[#PP]=1 \{\
10951 . if \\n[#INDENT_FIRST_PARAS] \{\
10952 . ti \\n[#PH_INDENT]u
10955 . el \{ .ti \\n[#PH_INDENT]u \}
10956 . ie \\n[#PREFIX_CH_NUM]=1 \{\
10957 . ds $CH_NUM \\n[#CH_NUM].
10962 . if \\n[#PRINT_STYLE]=1 \{\
10965 . ie \\n[#NUMBER_PH] \{\
10966 . if \\n[#NUMBER_HEAD] \{\
10967 . ie \\n[#NUMBER_SH] \{\
10968 . UNDERSCORE "\R'#NUMBERED 1'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
10972 . UNDERSCORE "\R'#NUMBERED 1'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1"
10976 . ie \\n[#NUMBER_SH] \{\
10977 . if !\\n[#NUMBERED] \{\
10978 . UNDERSCORE "\\*[$CH_NUM]\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
10983 . if !\\n[#NUMBERED] \{\
10984 . UNDERSCORE "\\*[$CH_NUM]\\n+[#PH_NUM].\\ \\$1"
10990 . UNDERSCORE "\\$1"
10993 . if \\n[#SLANT_WAS_ON] \{\
10994 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
10995 . if \\n[#SLANT_MEANS_SLANT] \{\
11001 . if \\n[#PRINT_STYLE]=2 \{\
11004 . PT_SIZE \\*[$PH_SIZE_CHANGE]
11005 . if \\n[#PH_COLOR]=1 \{ .COLOR \\*[$PH_COLOR] \}
11006 . ie \\n[#NUMBER_PH] \{\
11007 . ie \\n[#PREFIX_CH_NUM]=1 \{\
11008 . ds $CH_NUM \\n[#CH_NUM].
11013 . if \\n[#NUMBER_HEAD] \{\
11014 . ie \\n[#NUMBER_SH] \{\
11015 . PRINT "\R'#NUMBERED 1'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
11018 . PRINT "\R'#NUMBERED 1'\\*[$CH_NUM]\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
11021 . ie \\n[#NUMBER_SH] \{\
11022 . if !\\n[#NUMBERED] \{\
11023 . PRINT "\\*[$CH_NUM]\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
11027 . if !\\n[#NUMBERED] \{\
11028 . PRINT "\\*[$CH_NUM]\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
11033 . PRINT "\\$1\h'.6m'\c"
11036 . FAMILY \\*[$DOC_FAM]
11038 . PT_SIZE \\n[#DOC_PT_SIZE]u
11039 . if \\n[#PH_COLOR]=1 \m[]\c
11040 . if \\n[#SLANT_WAS_ON] \{\
11049 \# ====================================================================
11051 \# +++LINE BREAKS+++
11053 \# LINEBREAK CHARACTER
11054 \# -------------------
11056 \# [character] [iterations] [vertical adjustment]
11058 \# Allows user to specify a line break character and the number
11059 \# of times to repeat it horiontally.
11061 \# Without an argument, LINEBREAK_CHAR will deposit a blank line.
11063 \# Vertical adjustment requires a unit of measure (most likely
11064 \# "p"), and has to be preceded by +|-
11066 .MAC LINEBREAK_CHAR END
11068 . ds $LINEBREAK_CHAR \\$1
11069 . ds $LINEBREAK_CHAR_V_ADJ \\$3
11070 . if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
11071 . ds $LINEBREAK_CHAR_V_ADJ +0
11073 . while \\$2>\\n[#REPEAT] \{\
11074 . as $LINEBREAK_CHAR "\\ \\$1
11075 . nr #REPEAT \\n[#REPEAT]+1
11086 \# Deposits line break character.
11088 \# If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
11091 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
11092 . po \\n[#DOC_L_MARGIN]u
11093 . ie '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
11095 . if \\n[#PRINT_STYLE]=1 \{\
11096 . ie \\n[#END_QUOTE] \{ . \}
11097 . el \{ .ALD \\n[#DOC_LEAD]u \}
11099 . if \\n[#PRINT_STYLE]=2 \{\
11100 . ie \\n[#END_QUOTE] \{ . \}
11101 . el \{ .ALD \\n[#DOC_LEAD]u \}
11106 . PRINT \m[\\*[$LINEBREAK_COLOR]]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\m[]
11107 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
11108 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
11110 . QUAD \\*[$DOC_QUAD]
11113 . if r#QUOTE \{ .rr #QUOTE \}
11114 . if r#END_QUOTE \{ .rr #END_QUOTE \}
11118 \# ====================================================================
11120 \# +++PARAGRAPHS+++
11125 \# <font of running text>
11127 \# Creates or modifies string $PP_FT.
11129 \# Affects all paragraphs.
11132 . if \n[#PRINT_STYLE]=1 \{\
11133 . ie \n[#ITALIC_MEANS_ITALIC] \{ .nop \}
11137 . if \\n[#COLLATE]=1 \{\
11138 . if !'\\*[$SAVED_PP_FT]'' \{ .rm $SAVED_PP_FT \}
11145 \# PARAGRAPH INDENT
11146 \# ----------------
11148 \# <amount to indent paragraphs in running text (ipPcm)>
11150 \# Allows user to change the default para indent. The change will
11151 \# affect the indent of QUOTEs and BLOCKQUOTEs as well.
11153 \# Default for printstyle TYPEWRITE is 1/2-inch. Default for
11154 \# printstyle TYPESET is 2 ems. The defaults are set in
11155 \# PRINTSTYLE, not DEFAULTS.
11157 .MAC PARA_INDENT END
11158 . nr #PP_INDENT (\\$1)
11162 \# INDENT FIRST PARAGRAPHS
11163 \# -----------------------
11165 \# <none> | <anything>
11167 \# By default, the first para of a document, as well as the first
11168 \# paras of blockquotes and block-style epigraphs are not indented.
11169 \# When invoked, this macro will indent all paras.
11173 .MAC INDENT_FIRST_PARAS END
11174 . ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
11175 . el \{ .rr #INDENT_FIRST_PARAS \}
11179 \# INTER-PARAGRAPH SPACING
11180 \# -----------------------
11182 \# <none> | <anything>
11184 \# Adds a line space between paragraphs in body text. Block quotes
11187 \# Default is OFF. PARA_SPACE ON is not recommended for use
11188 \# with PRINTSTYLE TYPEWRITE.
11190 .MAC PARA_SPACE END
11191 . ie '\\$1'' \{ .nr #PP_SPACE 1 \}
11192 . el \{ .rr #PP_SPACE \}
11201 \# Figures out what to do with paragraphs under differing conditions.
11203 \# For the time being, there's no automatic widow/orphan control.
11204 \# Controlling them isn't just a matter of establishing an arbitrary
11205 \# number of lines needed for a para, since groff doesn't then
11206 \# handle single line paragraphs gracefully. Usually, the whole
11207 \# page needs to be tweaked.
11209 \# Note the use of transparent line break (\!.br) to get
11210 \# PP to work within blockquotes and epigraphs.
11212 \# PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
11216 . if \\n[#DOC_TYPE]=4 \{\
11217 . if !'\\n(.z'' \{ .di \}
11218 . nr #TOTAL_FIELDS \\n[#FIELD]
11220 . nr #NUM_FIELDS 0 1
11221 . if \\n[#TOTAL_FIELDS]>0 \{\
11222 . while \\n+[#NUM_FIELDS]<=\\n[#TOTAL_FIELDS] \{\
11224 . LETTERHEAD\\n+[#FIELD]
11225 . QUAD \\*[$DOC_QUAD]
11226 . ALD \\n[#DOC_LEAD]u
11227 . if \\n[#DATE_FIRST]=1 \{ .ALD \\n[#DOC_LEAD]u \}
11229 . rm LETTERHEAD\\n[#FIELD]
11237 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
11238 . if \\n[#PP_STYLE]=1 \{\
11239 . if \\n[#ENDNOTE] \{\
11240 . nr #RESET_PARA_SPACE \\n[#PP_SPACE]
11241 . ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
11242 . el \{ .PARA_SPACE OFF \}
11245 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
11246 . if \\n[#COLUMNS] \{\
11247 . if !\\n[#ENDNOTE] \{\
11248 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
11249 . nr #L_MARGIN \\n(.o
11252 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
11253 . ie \\n[#PRINT_STYLE]=1 \{\
11255 . ie \\n[#ENDNOTE] \{ .vs \\n[#EN_LEAD]u \}
11256 . el \{ .vs \\n[#DOC_LEAD]u \}
11257 . QUAD \\*[$DOC_QUAD]
11259 . if \\n[#SLANT_ON] \{\
11260 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
11262 . if '\\*[$PP_FT]'I' \{\
11263 . if \\n[#ITALIC_MEANS_ITALIC] \{ .FT I \}
11267 . ie \\n[#ENDNOTE] \{\
11268 . FAMILY \\*[$EN_FAM]
11270 . PT_SIZE \\n[#EN_PS]u
11271 . vs \\n[#EN_LEAD]u
11272 . QUAD \\*[$EN_QUAD]
11275 . FAMILY \\*[$DOC_FAM]
11276 . if !'\\*[$SAVED_PP_FT]'' \{\
11277 . ds $PP_FT \\*[$SAVED_PP_FT]
11281 . PT_SIZE \\n[#DOC_PT_SIZE]u
11282 . LS \\n[#DOC_LEAD]u
11283 . QUAD \\*[$DOC_QUAD]
11286 . ie \\n[#PP]=0 \{\
11287 . if \\n[#INDENT_FIRST_PARAS] \{\
11288 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
11289 . el \{ .ti \\n[#PP_INDENT]u \}
11290 . if '\\n(.z'END_NOTES' \{\
11291 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
11294 . if r#END_QUOTE \{\
11295 . if \\n[#END_QUOTE] \{\
11296 . if !\\n[#LINEBREAK] \{\
11297 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
11298 . el \{ .ti \\n[#PP_INDENT]u \}
11299 . if '\\n(.z'END_NOTES' \{\
11300 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
11308 . if \\n[#PP_SPACE] \{\
11309 . if \\n[#PRINT_STYLE]=2 \{\
11310 . ie \\n[#END_QUOTE] \{\
11311 . ALD \\n[#DOC_LEAD]u
11314 . nr #BASELINE_MARK \\n(nl
11317 . if \\n[#NO_SPACE]=1 \{\
11320 . if !\\n(nl=\\n[#BASELINE_MARK] \{\
11321 . ALD \\n[#DOC_LEAD]u
11322 . rr #BASELINE_MARK
11327 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
11328 . el \{ .ti \\n[#PP_INDENT]u \}
11329 . if '\\n(.z'END_NOTES' \{\
11330 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
11333 . if r#START \{ .rr #START \}
11334 . if r#QUOTE \{ .rr #QUOTE \}
11335 . if r#END_QUOTE \{ .rr #END_QUOTE \}
11336 . if r#HEAD \{ .rr #HEAD \}
11337 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
11338 . if r#Q_FITS \{ .rr #Q_FITS \}
11339 . if r#LINEBREAK \{ .rr #LINEBREAK \}
11340 . if \\n[#ENDNOTE] \{\
11341 . ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
11342 . el \{ .PARA_SPACE OFF \}
11344 . if \\n[#CONDENSE] \{\
11347 . if \\n[#EXTEND]=1 \{\
11352 . if \\n[#PP_STYLE]=2 \{\
11354 . if \\n[#BROKEN_QUOTE] \{\
11355 . ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
11356 . el \{ .nr #Q_PP 0 \}
11359 . ie \\n[#Q_PP]=0 \{\
11360 . if \\n[#INDENT_FIRST_PARAS] \{\
11361 . ti \\n[#PP_INDENT]u/2u
11363 . if \\n[#ENDNOTE] \{\
11364 . ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
11369 . ti \\n[#PP_INDENT]u/2u
11370 . if \\n[#PP_SPACE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
11372 . if \\n[#CONDENSE] \{\
11375 . if \\n[#EXTEND]=1 \{\
11380 \# This takes care of multi-paragraph dialogue, where each para
11381 \# is introduced by an open quote whereas the previous para has
11383 . if \\n[#OPEN_CLOSE]=1 \{\
11389 \# ====================================================================
11393 \# ---Line for line quotes, i.e. poetry or code snippets---
11395 \# UNDERLINE QUOTES
11396 \# ----------------
11398 \# <none> | <anything>
11400 \# Creates or modifies register #UNDERLINE_QUOTES (toggle).
11401 \# If on, line for line quotes are underlined when printstyle
11404 \# Default is ON for printstyle TYPEWRITE.
11406 .MAC UNDERLINE_QUOTES END
11407 . ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
11408 . el \{ .rr #UNDERLINE_QUOTES \}
11415 \# <integer> | <integer with unit of measure appended>
11417 \# Creates or modifies register #Q_OFFSET_VALUE.
11419 \# If just an integer given, value by which to multiply PARA_INDENT
11420 \# to get quote indent. If integer with a unit of measure appended,
11421 \# absolute value of quote indent.
11423 \# Default is 3 for typeset; 2 for typewrite.
11425 .MAC QUOTE_INDENT END
11426 . if r#Q_OFFSET_VALUE \{ .rr #Q_OFFSET_VALUE \}
11427 . if !'\\*[$Q_OFFSET_VALUE]'' \{ .rm $Q_OFFSET_VALUE \}
11428 . ds $EVAL_QI_ARG \\$1
11429 . substring $EVAL_QI_ARG -1
11430 . ie \B'\\*[$EVAL_QI_ARG]' \{\
11431 . nr #Q_OFFSET_VALUE \\$1
11434 . ds $Q_OFFSET_VALUE \\$1
11443 \# <autolead value>
11445 \# Sets autolead for quotes and/or blockquotes.
11447 .MAC QUOTE_AUTOLEAD END
11448 . if '\\$0'QUOTE_AUTOLEAD' \{ .nr #Q_AUTOLEAD \\$1 \}
11449 . if '\\$0'BLOCKQUOTE_AUTOLEAD' \{ .nr #BQ_AUTOLEAD \\$1 \}
11450 . if '\\$0'ENDNOTE_QUOTE_AUTOLEAD' \{ .nr #EN_Q_AUTOLEAD \\$1 \}
11451 . if '\\$0'ENDNOTE_BLOCKQUOTE_AUTOLEAD' \{ .nr #EN_BQ_AUTOLEAD \\$1 \}
11454 .ALIAS BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
11455 .ALIAS ENDNOTE_QUOTE_AUTOLEAD QUOTE_AUTOLEAD
11456 .ALIAS ENDNOTE_BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
11458 \# ALWAYS FULLSPACE QUOTES
11459 \# -----------------------
11461 \# <none> | <anything>
11463 \# Toggles register #FULLSPACE_QUOTES.
11465 \# If user doesn't like the default 1/2 line space above and below
11466 \# quotes, s/he can turn it off here. Has no effect in TYPEWRITE.
11468 .MAC ALWAYS_FULLSPACE_QUOTES END
11469 . if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
11470 . el \{ .rr #FULLSPACE_QUOTES \}
11477 \# <none> | <anything>
11479 \# Indents quoted text on a line for line basis, or turns QUOTE off.
11481 \# Owing to the need to bottom align TYPESET pages, quoted text gets
11482 \# diverted so its depth can be measured (in DO_QUOTE) for determining
11483 \# how much space to put before and after.
11488 \# <none> | <anything>
11490 \# Indents quoted text on a line for line basis, or turns QUOTE off.
11492 \# Owing to the need to bottom align TYPESET pages, quoted text gets
11493 \# diverted so its depth can be measured (in DO_QUOTE) for determining
11494 \# how much space to put before and after.
11498 . if \\n[#LINENUMBERS]=1 \{\
11499 . nr #LINENUMBERS 2
11500 . nr #NEXT_LN \\n(ln
11505 . if \\n[#LINENUMBERS]=2 \{\
11506 . if \\n[#SILENT_QUOTE_LN]=1 \{ .nm \\n[#NEXT_LN] 1000 -4 \}
11511 . ie r#Q_OFFSET_VALUE \{\
11512 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
11514 . el \{ .ll \\n[#L_LENGTH]u-\\*[$Q_OFFSET_VALUE] \}
11515 . if \\n[#LINENUMBERS]=2 \{\
11516 . if \\n[#QUOTE_LN]=1 \{\
11517 . nm \\n(ln "" \\*[$Q_LN_GUTTER] -3-\\*[$Q_LN_GUTTER]
11521 . if \\n[#COLUMNS] \{\
11522 . ie r#Q_OFFSET_VALUE \{\
11523 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
11526 . ll \\n[#COL_L_LENGTH]u-\\*[$Q_OFFSET_VALUE]
11530 . if \\n[#PRINT_STYLE]=1 \{\
11532 . vs \\n[#DOC_LEAD]u
11535 . if \\n[#PRINT_STYLE]=2 \{\
11536 . FAMILY \\*[$QUOTE_FAM]
11537 . FT \\*[$QUOTE_FT]
11538 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
11539 . ie !r#Q_AUTOLEAD \{ .LS \\n[#Q_LEAD]u \}
11541 . AUTOLEAD \\n[#Q_AUTOLEAD]
11542 . nr #Q_LEAD \\n(.v
11544 . if \\n[#ENDNOTE] \{\
11545 . PT_SIZE \\n[#EN_PS]u\\*[$QUOTE_SIZE_CHANGE]
11546 . ie !r#EN_Q_AUTOLEAD \{ .LS \\n[#EN_Q_LEAD]u \}
11548 . AUTOLEAD \\n[#EN_Q_AUTOLEAD]
11549 . nr #EN_Q_LEAD \\n(.v
11552 . nr #Q_LEAD_REAL \\n(.v
11554 . if \\n[#QUOTE_COLOR]=1 \{\
11556 \m[\\*[$QUOTE_COLOR]]
11560 . if \\n[#LINENUMBERS]=2 \{\
11561 . ie \\n[#QUOTE_LN]=1 \{\
11562 . if '\\*[$Q_LN_GUTTER]'' .ds $Q_LN_GUTTER \\*[$LN_GUTTER]
11563 . nm \\n(ln "" \\*[$Q_LN_GUTTER] -3-\\*[$Q_LN_GUTTER]
11566 . if !\\n[#SILENT_QUOTE_LN] \{ .NUMBER_LINES OFF \}
11570 . if \\n[#PRINT_STYLE]=1 \{\
11571 . if \\n[#UNDERLINE_QUOTES] \{\
11576 . el \{ .DO_QUOTE \}
11583 \# <none [ BR | BREAK | SPREAD ]> | <anything [ BR | BREAK | SPREAD ]>
11585 \# Takes care of admistrivia associated with setting code snippets.
11593 . if '\\$1'BREAK' \{\
11597 . if '\\$1'SPREAD' \{\
11602 . ds $PRE_CODE_FAM \\n[.fam]
11603 . ds $PRE_CODE_FT \\n[.sty]
11604 . if !\\n[#PRINT_STYLE]=1 \{\
11605 . ie \\n[#CODE_FAM]=1 \{ .fam \\*[$CODE_FAM] \}
11609 . if \\n[#UNDERLINE_QUOTES]=1 \{\
11610 . nr #RESTORE_UNDERLINE 1
11611 . UNDERLINE_QUOTES OFF
11614 . if \\n[#PRINT_STYLE]=2 \{\
11617 . if \\n[#RESTORE_SQ]=1 \{\
11623 . fam \\*[$PRE_CODE_FAM]
11624 . ft \\*[$PRE_CODE_FT]
11626 . if \\n[#RESTORE_UNDERLINE]=1 \{\
11627 . rr #RESTORE_UNDERLINE
11630 . if \\n[#SQ_WAS_ON]=1 \{\
11634 . if \\n[#PRINT_STYLE]=2 \{\
11638 . if \\n[#NUM_ARGS]=2 \{\
11639 . if '\\$2'BR' \{ .br \}
11640 . if '\\$2'BREAK' \{ .br \}
11641 . if '\\$2'SPREAK' \{ .brp \}
11650 \# Creates register #CODE_FAM and string $CODE_FAM for use by CODE.
11652 .MAC CODE_FAMILY END
11654 . ds $CODE_FAM \\$1
11658 \# ---Blockquotes---
11663 \# <none> | <anything>
11665 \# Indents quoted text in fill mode and shortens line length
11666 \# equivalently, or turns BLOCKQUOTE off.
11668 \# Owing to the need to bottom align TYPESET pages, quoted text gets
11669 \# diverted so its depth can be measured (in DO_QUOTE) for determining
11670 \# how much space to put before and after.
11672 \# .PP after blockquote is optional if there's only one para,
11673 \# but REQUIRED if there's more than one.
11675 .MAC BLOCKQUOTE END
11677 . if \\n[#LINENUMBERS]=1 \{\
11678 . nr #LINENUMBERS 2
11679 . nr #NEXT_LN \\n(ln
11684 . if \\n[#LINENUMBERS]=2 \{\
11685 . if \\n[#SILENT_BQUOTE_LN]=1 \{ .nm \\n[#NEXT_LN] 1000 -4 \}
11692 . ie r#Q_OFFSET_VALUE \{\
11693 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11695 . el \{ .ll \\n[#L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u) \}
11696 . if \\n[#ENDNOTE] \{\
11697 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
11698 . ie r#Q_OFFSET_VALUE \{\
11699 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11702 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\*[$Q_OFFSET_VALUE]*2u)
11705 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
11706 . ie r#Q_OFFSET_VALUE \{\
11707 . ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11710 . ll \\n[#L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]u*2u)
11716 . if \\n[#COLUMNS] \{\
11717 . ie r#Q_OFFSET_VALUE \{\
11718 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11721 . ll \\n[#COL_L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11723 . if \\n[#ENDNOTE] \{\
11724 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
11725 . ie r#Q_OFFSET_VALUE \{\
11726 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11729 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\*[$Q_OFFSET_VALUE]*2u)
11732 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
11733 . ie r#Q_OFFSET_VALUE \{\
11734 . ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11737 . ll \\n[#COL_L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11743 . if \\n[#PRINT_STYLE]=1 \{\
11745 . vs \\n[#DOC_LEAD]u
11749 . if \\n[#PRINT_STYLE]=2 \{\
11750 . FAMILY \\*[$BQUOTE_FAM]
11751 . FT \\*[$BQUOTE_FT]
11752 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
11753 . ie !\\n[#BQ_AUTOLEAD] \{ .LS \\n[#BQ_LEAD]u \}
11755 . AUTOLEAD \\n[#BQ_AUTOLEAD]
11756 . nr #BQ_LEAD \\n(.v
11758 . if \\n[#ENDNOTE] \{\
11759 . PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
11760 . ie !r#EN_BQ_AUTOLEAD \{ .LS \\n[#EN_BQ_LEAD]u \}
11762 . AUTOLEAD \\n[#EN_BQ_AUTOLEAD]
11763 . nr #EN_BQ_LEAD \\n(.v
11766 . nr #Q_LEAD_REAL \\n(.v
11767 . if \\n[#BQUOTE_COLOR]=1 \{\
11769 \m[\\*[$BQUOTE_COLOR]]
11772 . QUAD \\*[$BQUOTE_QUAD]
11773 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
11774 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
11777 . if \\n[#LINENUMBERS]=2 \{\
11778 . ie \\n[#BQUOTE_LN]=1 \{\
11779 . if '\\*[$BQ_LN_GUTTER]'' .ds $BQ_LN_GUTTER \\*[$LN_GUTTER]
11780 . nm \\n(ln "" \\*[$BQ_LN_GUTTER] -3-\\*[$BQ_LN_GUTTER]
11783 . if !\\n[#SILENT_BQUOTE_LN] \{ .NUMBER_LINES OFF \}
11787 . if \\n[#INDENT_FIRST_PARAS] \{\
11788 . ie !\\n[#ENDNOTE] \{\
11789 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
11790 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
11793 . if \\n[#INDENT_FIRSTS]=1 \{\
11794 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
11795 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
11800 . el \{ .DO_QUOTE \}
11809 \# Ends the diversion P_QUOTE or B_QUOTE. Spaces them according to
11810 \# PRINTSTYLE, whether there's inter-paragraph spacing, and page
11811 \# position. TYPEWRITE treats spacing the same way in all circumstance
11812 \# (viz. an extra line space). TYPESET puts in only half
11813 \# line spaces if the entire quote plus 1 line of body under the quote
11814 \# fits on the the page; otherwise it puts in a full extra blank
11815 \# line. (This is to ensure the page remains bottom aligned).
11819 . if \\n[#DIVER_LN_OFF] \{\
11820 \!. NUMBER_LINES OFF
11825 . if \\n[#RESET_FN_COUNTERS]=2 \{\
11826 . if !\\n[#FN_COUNT]=1 \{\
11827 . if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
11829 . rr #RESET_FN_COUNTERS
11833 . nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
11834 . nr #DONE_ONCE 0 1
11837 . nr #Q_DEPTH (\\n[#DIVER_DEPTH]-\\n[#Q_LEAD_REAL])+\\n[#LEAD]
11838 . nr #Q_LEAD_DIFF \\n[#LEAD]-\\n[#Q_LEAD_REAL]
11842 . nr #CURRENT_V_POS \\n(nl+\\n[#Q_LEAD_DIFF]+(\\n[#DIVER_DEPTH]-\\n[#Q_DEPTH_REAL])
11845 . nr #Q_SPACE_ADJ \\n[#SHIM]/2
11846 . nr #TRAP \\n(.t-1
11847 . if \\n[#ENDNOTE] \{\
11848 . nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
11849 . ALWAYS_FULLSPACE_QUOTES
11851 . if \\n[#PRINT_STYLE]=1 \{\
11852 . if \\n[#START]=1 \{ . \}
11853 . if \\n[#START]=0 \{\
11854 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
11856 . if \\n[#HEAD] \{\
11857 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
11860 . if \\n[#PRINT_STYLE]=2 \{\
11861 . ie \\n[#PP_SPACE] \{\
11862 . ie \\n[#HEAD]>0 \{ . \}
11864 . ie \\n[#START] \{ . \}
11865 . el \{ .ALD \\n[#DOC_LEAD]u \}
11869 . ie \\n[#Q_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
11870 . ie (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_DEPTH]<\\n[#DOC_LEAD] \{\
11882 . ie r#Q_OFFSET_VALUE \{\
11883 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
11885 . el \{ .nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE] \}
11886 . if \\n[#COLUMNS] \{\
11887 . ie r#Q_OFFSET_VALUE \{\
11888 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
11890 . el \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE] \}
11892 . if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
11893 . if \\n[#ENDNOTE] \{\
11894 . ie r#Q_OFFSET_VALUE \{ .in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u \}
11895 . el \{ .in +\\*[$Q_OFFSET_VALUE] \}
11897 . ie \\n[#START]=1 \{\
11898 . ie !\\n[#Q_LEAD_DIFF]<0 \{ .ALD \\n[#Q_SPACE_ADJ]u \}
11899 . el \{ .RLD 0-\\n[#Q_LEAD_DIFF]u \}
11902 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#Q_SPACE_ADJ]u \}
11904 . if \\n[#QUOTE]=1 \{\
11907 . if !\\n[#START] \{ .rr #QUOTE \}
11909 . if \\n[#QUOTE]=2 \{\
11913 . if \\n[#PRINT_STYLE]=1 \{\
11914 . ALD \\n[#DOC_LEAD]u
11915 . if !\\n[.v]=\\n[#DOC_LEAD] \{ .SHIM \}
11917 . if \\n[#PRINT_STYLE]=2 \{\
11918 . ie \\n[#START] \{\
11919 . ie \\n[#PP_SPACE] \{\
11923 . ALD \\n[#DOC_LEAD]u
11928 . ie \\n[#PP_SPACE] \{ . \}
11930 . ie \\n[#HEAD]=1 \{\
11931 . ALD \\n[#DOC_LEAD]u
11935 . ie \\n[#FULLSPACE_QUOTES] \{\
11936 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
11937 . el \{ .ALD \\n[#DOC_LEAD]u \}
11939 . el \{ .ALD (\\n[#DOC_LEAD]u/2u) \}
11940 . ie \\n[#Q_FITS] \{\
11941 . ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
11949 .\" Make sure that Q_LEAD_DIFF is not added to the first line of
11950 .\" normal text at the top of any page following output of a quote
11951 .\" whose last line falls on B_MARGIN of the previous page.
11952 . if \\n(nl=(\\n[#T_MARGIN]-\\n[#DOC_LEAD]+\\n[#Q_LEAD_DIFF]) \{\
11955 . sp -1v-\\n[#Q_LEAD_DIFF]u
11962 . if \\n[#LINENUMBERS]=2 \{\
11963 . nr #LINENUMBERS 1
11964 . if !\\n[#ENDNOTE] \{\
11965 . ie \\n[#RESTORE_LN_NUM]=1 \{ .nm \\n[#NEXT_LN] \}
11969 . if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
11970 . if r#HEAD \{ .rr #HEAD \}
11971 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
11976 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
11977 . if \\n[#ENDNOTE] \{\
11978 . in \\n[#EN_TEXT_INDENT]u
11980 . if \\n[#COLUMNS] \{\
11981 . if !\\n[#ENDNOTE] \{\
11982 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
11983 . nr #L_MARGIN \\n(.o
11985 . if \\n[#ENDNOTE] \{\
11986 . in \\n[#EN_TEXT_INDENT]u
11989 . ie !\\n[#ENDNOTE] \{\
11990 . nr #RESET_PP_INDENT \\n[#PP_INDENT]
11993 . PARA_INDENT \\n[#RESET_PP_INDENT]u
11994 . QUAD \\*[$DOC_QUAD]
11997 . nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
11998 . ENDNOTE_PARA_INDENT 0
12000 . ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
12001 . QUAD \\*[EN_QUAD]
12003 . if r#DELAY_SHIM \{\
12010 \# Utility macros for DO_QUOTE
12011 \# ---------------------------
12015 . ie \\n[#HEAD]=1 \{\
12016 . ALD \\n[#Q_LEAD_DIFF]u
12019 . ie \\n[#START] \{ . \}
12021 . ie \\n[#FULLSPACE_QUOTES] \{\
12022 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
12023 . el \{ .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
12026 .\" This seems to be the only way to get the baseline of quotes that start
12027 .\" at the top of the page to fall on the first line of the "grid" (i.e on
12028 .\" the first valid baseline of the page).
12029 . ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
12030 . if \\n[#QUOTE]=1 \{\
12031 . rn P_QUOTE Q_TEMP
12035 . sp -1v+\\n[#Q_LEAD_DIFF]u
12039 . if \\n[#QUOTE]=2 \{\
12040 . rn B_QUOTE Q_TEMP
12042 . vs \\n[#BQ_LEAD]u
12044 . sp -1v+\\n[#Q_LEAD_DIFF]u
12051 . ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_LEAD_DIFF]u
12055 . if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
12062 . if \\n[#HEAD]=1 \{ . \}
12065 . ie \\n[#FULLSPACE_QUOTES] \{\
12066 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
12067 . el \{ .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u \}
12069 . el \{ .ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_LEAD_DIFF]u \}
12070 . nr #Q_PARTIAL_DEPTH 0 \\n[#Q_LEAD_REAL]
12071 . while \\n+[#Q_PARTIAL_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
12074 . nr #Q_PARTIAL_DEPTH -\\n[#Q_LEAD_REAL]
12075 . nr #Q_SPACE_ADJ (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_PARTIAL_DEPTH]+\\n[#Q_LEAD_DIFF]u
12076 .\" Hack to deal with the fact that even though the above routine
12077 .\" makes the bottom line of the quote fall exactly on the bottom
12078 .\" margin when traps are disabled, it refuses to do so when traps
12079 .\" are on. The difference by which it's off is #Q_LEAD_DIFF
12080 .\" (the +\\n[#Q_LEAD_DIFF] at the end of the line, above). Hack
12081 .\" solution: temporarily lower the FOOTER trap position.
12082 . nr #SAVED_FOOTER_POS \\n[#VARIABLE_FOOTER_POS]
12083 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+.25v
12087 \# ====================================================================
12094 \# Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
12095 \# page, and reinvokes BLOCKQUOTE.
12097 \# Because quotes go into a diversion before they're output,
12098 \# footnotes in quotes that cross pages behave erratically. The footnote
12099 \# isn't processed until the diversion ends, hence the footnote
12100 \# marker in the quote isn't always correct for the new page (it's
12101 \# picked up from the old one). BREAK_QUOTE is a workaround for
12104 .MAC BREAK_QUOTE END
12107 . nr #BROKEN_QUOTE 1
12110 . nr #Q_DEPTH \\n[#DIVER_DEPTH]+\\n[#LEAD]
12111 . if \\n[#PRINT_STYLE]=1 \{\
12112 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
12113 . if \\n[#HEAD] \{\
12114 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
12117 . if \\n[#PRINT_STYLE]=2 \{\
12118 . ie \\n[#PP_SPACE] \{\
12119 . ie \\n[#HEAD]=1 \{ . \}
12121 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
12127 . if \\n[#HEAD]=1 \{ . \}
12129 . el \{ .ALD \\n[#DOC_LEAD]u \}
12132 . ie r#Q_OFFSET_VALUE \{\
12133 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
12136 . nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
12138 . if \\n[#COLUMNS] \{\
12139 . ie r#Q_OFFSET_VALUE \{\
12140 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
12143 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE]
12146 . po \\n[#Q_OFFSET]u
12147 . if \\n[#QUOTE]=1 \{\
12151 . if \\n[#QUOTE]=2 \{\
12155 . if r#HEAD \{ .rr #HEAD \}
12156 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
12161 . if \\n[#PRINT_STYLE]=1 \{\
12162 . if \\n[#UNDERLINE_QUOTES] \{\
12166 . po \\n[#L_MARGIN]u
12167 . if \\n[#COLUMNS] \{\
12168 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
12169 . nr #L_MARGIN \\n(.o
12171 . QUAD \\*[$DOC_QUAD]
12172 . sp |\\n[#PAGE_LENGTH]u \" To trip footer/header
12176 \# ====================================================================
12178 \# +++PAGINATION+++
12183 \# <none> | <anything>
12185 \# Turns page numbering off or on during document processing.
12190 . ie '\\$1'' \{ .nr #PAGINATE 1 \}
12191 . el \{ .nr #PAGINATE 0 \}
12192 . if \\n[#HF_OFF]=1 \{\
12193 . rr #PAGINATION_STATE
12199 \# SUSPEND PAGINATION (before ENDNOTES)
12200 \# ------------------
12204 \# Creates register #SUSPEND_PAGINATION
12206 \# Useful only to suspend pagination before outputting endnotes.
12208 .MAC SUSPEND_PAGINATION END
12209 . nr #SUSPEND_PAGINATION 1
12212 \# RESTORE PAGINATION (after ENDNOTES)
12213 \# ------------------
12217 \# Removes register #SUSPEND_PAGINATION. Creates register
12218 \# #DEFER_PAGINATION
12220 \# Useful only to restore pagination after outputting endnotes.
12222 .MAC RESTORE_PAGINATION END
12223 . rr #SUSPEND_PAGINATION
12224 . if \\n[#PAGE_NUM_V_POS]=1 \{ .PAGINATE \}
12225 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #DEFER_PAGINATION 1 \}
12229 \# PAGE NUMBER FORMAT
12230 \# ------------------
12232 \# DIGIT | ROMAN | roman | ALPHA | alpha
12234 \# Assigns user entered format to #PAGENUMBER.
12236 .MAC PAGENUM_STYLE END
12237 . nr #PAGENUM_STYLE_SET 1
12238 . if '\\$1'DIGIT' \{\
12239 . ds $PAGENUM_STYLE \\$1
12242 . if '\\$1'ROMAN' \{\
12243 . ds $PAGENUM_STYLE \\$1
12246 . if '\\$1'roman' \{\
12247 . ds $PAGENUM_STYLE \\$1
12250 . if '\\$1'ALPHA' \{\
12251 . ds $PAGENUM_STYLE \\$1
12254 . if '\\$1'alpha' \{\
12255 . ds $PAGENUM_STYLE \\$1
12261 \# HYPHENS AROUND PAGE NUMBERS
12262 \# ---------------------------
12264 \# <none> | <anything>
12266 \# Creates or modifies register #PAGE_NUM_HYPHENS.
12267 \# Used to dis/enable hyphens on either side of page numbers.
12271 .MAC PAGENUM_HYPHENS END
12272 . nr #PAGE_NUM_HYPHENS_SET 1
12273 . ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
12274 . el \{ .rr #PAGE_NUM_HYPHENS \}
12278 \# PAGENUMBER POSITION
12279 \# -------------------
12281 \# TOP | BOTTOM LEFT | CENTER | RIGHT
12283 \# Creates or modifies various PAGE_NUM_H | V_POS registers.
12284 \# Used to position page numbers.
12286 \# Default is center/bottom.
12288 .MAC PAGENUM_POS END
12289 . nr #PAGE_NUM_POS_SET 1
12290 . if '\\$1'TOP' \{ .nr #PAGE_NUM_V_POS 1 \}
12291 . if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
12292 . if '\\$2'LEFT' \{ .nr #PAGE_NUM_H_POS 1 \}
12293 . if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
12294 . if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
12295 . if '\\$2'RIGHT' \{ .nr #PAGE_NUM_H_POS 3 \}
12299 .MAC PN_WITH_HYPHENS END
12300 . nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
12301 . ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
12302 . PRINT \m[\\*[$PAGENUM_COLOR]]\\*[$HYPHEN]\|\\n[#PAGENUMBER]\|\\*[$HYPHEN]
12307 \# PRINT PAGE NUMBER
12308 \# -----------------
12312 \# Prints page number if PAGINATE=1.
12314 .MAC PRINT_PAGE_NUMBER END
12318 . po \\n[#DOC_L_MARGIN]u
12319 . ll \\n[#DOC_L_LENGTH]u
12321 . FAMILY \\*[$PAGE_NUM_FAM]
12322 . FT \\*[$PAGE_NUM_FT]
12323 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
12324 . if \\n[#PRINT_STYLE]=1 \{\
12327 . if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
12329 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
12333 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
12336 . if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
12337 . if \\n[#RECTO_VERSO]=0 \{\
12338 . if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
12339 . if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
12340 . if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT \}
12342 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
12343 . if \\n[#EN_FIRST_PAGE] \{\
12344 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
12345 . rr #EN_FIRST_PAGE
12347 . if \\n[#BIB_FIRST_PAGE] \{\
12348 . if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN] \}
12349 . rr #BIB_FIRST_PAGE
12351 . if \\n[#TOC_FIRST_PAGE] \{\
12353 . rr #TOC_FIRST_PAGE
12355 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
12356 . ie '\\*[$REVISION]'' \{\
12357 . PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT] / \\n[#PAGENUMBER]"
12360 . ie '\\*[$DRAFT]'' \{\
12361 . PRINT "\\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
12364 . PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT], \\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
12369 . ie \\n[#PAGE_NUM_HYPHENS] \{\
12370 . if '\\*[$PAGENUM_STYLE]'DIGIT' \{\
12372 1\\R'#CAP_HEIGHT \\n[.cht]'
12376 . if '\\*[$PAGENUM_STYLE]'ROMAN' \{\
12378 I\\R'#CAP_HEIGHT \\n[.cht]'
12382 . if '\\*[$PAGENUM_STYLE]'ALPHA' \{\
12384 E\\R'#CAP_HEIGHT \\n[.cht]'
12388 . if '\\*[$PAGENUM_STYLE]'roman' \{\
12389 . PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
12391 . if '\\*[$PAGENUM_STYLE]'alpha' \{\
12392 . PRINT "\m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-"
12395 . el \{ .PRINT "\m[\\*[$PAGENUM_COLOR]]\\n[#PAGENUMBER]" \}
12398 . nr #DIVER_DEPTH 0
12401 \# ====================================================================
12405 \# Mom's footnote handling is baroque, to say the least. There are
12406 \# redundancies in a number of the macros involved, as well as some
12407 \# registers that probably don't get used anymore. The baggage is left
12408 \# in in case some new footnote oddity/challenge gets thrown my way.
12410 \# The macros are heavily commented.
12412 \# FOOTNOTE AUTOLEAD
12413 \# -----------------
12415 \# <autolead value for footnotes>
12417 \# Creates or modifies register #FN_AUTOLEAD.
12419 \# Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
12421 .MAC FOOTNOTE_AUTOLEAD END
12422 . nr #FN_AUTOLEAD \\$1
12426 \# FOOTNOTE MARKERS
12427 \# ----------------
12429 \# <none> | <anything>
12431 \# Turns generation of footnote markers on or off.
12435 .MAC FOOTNOTE_MARKERS END
12436 . ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
12437 . el \{ .nr #FN_MARKERS 0 \}
12441 \# FOOTNOTE MARKER STYLE
12442 \# ---------------------
12444 \# STAR | NUMBER | LINE
12446 \# Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
12447 \# the style of footnote markers.
12449 \# 1=STAR; 2=NUMBER; 3=LINE. LINE means "use output line numbers".
12450 \# Default is STAR.
12452 .MAC FOOTNOTE_MARKER_STYLE END
12453 . if '\\$1'STAR' \{\
12454 . if \\n[#FN_MARKER_STYLE]=3 \{\
12455 . if !\\n[#NEWPAGE]=1 \{\
12456 . tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is LINE.
12457 . tm1 " You cannot change footnote marker style without
12458 . tm1 " first breaking to a new page with NEWPAGE.
12459 . tm1 " Ignoring request FOOTNOTE_MARKER_STYLE STAR at line \\n(.c.
12463 . if \\n[#RUN_ON]=1 \{\
12464 . tm1 "[mom]: FOOTNOTE_MARKER_STYLE STAR at line \\n(.c is incompatible
12465 . tm1 " with RUN_ON footnotes. Ignoring request.
12468 . nr #FN_MARKER_STYLE 1
12469 . if \\n[#NEWPAGE]=1 \{ .rr #NEWPAGE \}
12472 . if '\\$1'NUMBER' \{\
12473 . if \\n[#FN_MARKER_STYLE]=3 \{\
12474 . if !\\n[#NEWPAGE]=1 \{\
12475 . tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is NUMBER.
12476 . tm1 " You cannot change footnote marker style without
12477 . tm1 " first breaking to a new page with NEWPAGE.
12478 . tm1 " Ignoring request FOOTNOTE_MARKER_STYLE NUMBER at line \\n(.c.
12482 . if \\n[#RUN_ON]=1 \{\
12483 . tm1 "[mom]: FOOTNOTE_MARKER_STYLE NUMBER at line \\n(.c is incompatible
12484 . tm1 " with RUN_ON footnotes. Ignoring request.
12487 . nr #FN_MARKER_STYLE 2
12488 . if \\n[#NEWPAGE]=1 \{ .rr #NEWPAGE \}
12491 . if '\\$1'LINE' \{\
12492 . nr #FN_MARKER_STYLE 3
12493 . FOOTNOTE_MARKERS OFF
12494 . if !\\n[#FN_LN_SEP] \{\
12495 . if !\\n[#FN_LN_BRACKETS] \{ .FOOTNOTE_LINENUMBER_BRACKETS SQUARE \}
12501 \# FOOTNOTE LINENUMBER MARK
12502 \# ------------------------
12504 \# This string, when called inline, stores the current output line
12505 \# number in register #FN_MARK for use with FOOTNOTE.
12507 .ds FN-MARK \R'#FN_MARK \En(ln'
12510 \# FOOTNOTE LINENUMBER SEPARATOR
12511 \# -----------------------------
12513 \# <user-defined separator>
12515 \# Stores user-defined separator (for use then
12516 \# FOOTNOTE_MARKER_STYLE is LINE) in string $FN_LN_SEP. The
12517 \# separator is intended to be used when the user wishes a
12518 \# separator, rather than the choice of brackets offered by
12519 \# FOOTNOTE_LINENUMBER_BRACKETS.
12521 .MAC FOOTNOTE_LINENUMBER_SEPARATOR END
12522 . rr #FN_LN_BRACKETS
12524 . ds $FN_LN_SEP "\\$1
12528 \# FOOTNOTE LINENUMBER BRACKETS
12529 \# ----------------------------
12531 \# PARENS | SQUARE | BRACES or ( | [ | {
12533 \# Sets register #FN_LN_BRACKETS to 1, and creates strings
12534 \# $FN_OPEN_BRACKET and $FN_CLOSE_BRACKET according to the given
12537 .MAC FOOTNOTE_LINENUMBER_BRACKETS END
12539 . nr #FN_LN_BRACKETS 1
12540 . if '\\$1'PARENS' \{\
12541 . ds $FN_OPEN_BRACKET (
12542 . ds $FN_CLOSE_BRACKET )
12545 . ds $FN_OPEN_BRACKET (
12546 . ds $FN_CLOSE_BRACKET )
12548 . if '\\$1'SQUARE' \{\
12549 . ds $FN_OPEN_BRACKET [
12550 . ds $FN_CLOSE_BRACKET ]
12553 . ds $FN_OPEN_BRACKET [
12554 . ds $FN_CLOSE_BRACKET ]
12556 . if '\\$1'BRACES' \{\
12557 . ds $FN_OPEN_BRACKET {
12558 . ds $FN_CLOSE_BRACKET }
12561 . ds $FN_OPEN_BRACKET {
12562 . ds $FN_CLOSE_BRACKET }
12567 \# RESET FOOTNOTE NUMBER
12568 \# ---------------------
12572 \# Resets register #FN_NUMBER to 1. If argument is PAGE, creates
12573 \# toggle #RESET_FN_NUMBER which is checked in HEADER. If 1,
12574 \# numbered footnotes on every page start at 1.
12576 .MAC RESET_FOOTNOTE_NUMBER END
12577 . ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
12578 . el \{ .nr #RESET_FN_NUMBER 1 \}
12582 \# FOOTNOTE RULE LENGTH
12583 \# --------------------
12585 \# <length of rule used to separate footnotes from running text>
12587 \# Creates or modifies registers #FN_RULE_LENGTH.
12589 \# Requires unit of measure (iPpcm).
12590 \# Default is 4P for both PRINTSTYLEs.
12592 .MAC FOOTNOTE_RULE_LENGTH END
12593 . nr #FN_RULE_LENGTH (\\$1)
12597 \# FOOTNOTE_RULE_ADJ
12598 \# -----------------
12600 \# <number of points to raise footnote rule from it's baseline position>
12602 \# Creates or modifies register #FN_RULE_ADJ.
12604 \# Default is 3p for both TYPESTYLES.
12606 \# Requires unit of measure.
12608 .MAC FOOTNOTE_RULE_ADJ END
12609 . nr #FN_RULE_ADJ (\\$1)
12616 \# <none> | <anything>
12618 \# Turns printing of footnote separator rule on or off. If invoked as
12619 \# PRINT_FOOTNOTE_RULE, prints footnote separator rule.
12623 \# Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
12624 \# if the footnote number (#FN_COUNT) is 1.
12626 .MAC FOOTNOTE_RULE END
12627 . ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
12628 . if \\n[#FN_RULE]=0 \{ .RLD 1v \}
12631 \v'-\\n[#FN_RULE_ADJ]u-\\n[#FN_RULE_WEIGHT_ADJ]u'\
12632 \D't \\n[#FN_RULE_WEIGHT]'\
12633 \h'-\\n[#FN_RULE_WEIGHT]u'\
12634 \D'l \\n[#FN_RULE_LENGTH]u 0'\
12635 \v'+\\n[#FN_RULE_ADJ]u+\\n[#FN_RULE_WEIGHT_ADJ]u'
12636 \!. PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
12637 . QUAD \\*[$FN_QUAD]
12640 . ie '\\$1'' \{ .nr #FN_RULE 1 \}
12641 . el \{ .nr #FN_RULE 0 \}
12646 \# FOOTNOTE SPACING
12647 \# ----------------
12649 \# <per item post footnote spacing> | <anything>
12651 \# Enables printing of post footnote spacing.
12653 \# Default is no space.
12655 .MAC FOOTNOTE_SPACING END
12656 . ie \B'\\$1' \{ .nr #FN_SPACE (\\$1) \}
12657 . el \{ .nr #FN_SPACE 0 \}
12661 \# RUN ON FOOTNOTES
12662 \# ----------------
12664 \# <none> | <anything>
12666 \# Toggles run-on footnotes on or off.
12668 .MAC FOOTNOTES_RUN_ON END
12670 . if \\n[#FN_COUNT]>0 \{\
12671 . tm1 "[mom]: Switching to run-on footnotes at line \\n(.c will cause
12672 . tm1 " you to loose footnotes already formatted for this page.
12673 . tm1 " Ignoring request FOOTNOTES_RUN_ON.
12678 . if \\n[#FN_MARKER_STYLE]=1 \{ .RUNON_WARNING \}
12679 . if \\n[#FN_MARKER_STYLE]=2 \{ .RUNON_WARNING \}
12682 . if \\n[#FN_COUNT]>0 \{\
12683 . if \\n[#RUN_ON]=1 \{\
12684 . tm1 "[mom]: Switching off run-on footnotes at line \\n(.c will cause
12685 . tm1 " you to loose footnotes already formatted for this page.
12686 . tm1 " Ignoring request FOOTNOTES_RUN_ON \\$1.
12695 .MAC RUNON_WARNING END
12696 . if \\n[#FN_MARKER_STYLE]=1 \{\
12697 . tm1 "[mom]: The footnote marker style active at line \\n(.c is STAR,
12698 . tm1 " which is incompatible with run-on footnotes. Please change
12699 . tm1 " the footnote marker style to LINE. Continuing to process,
12700 . tm1 " but ignoring request FOOTNOTES_RUN_ON.
12703 . if \\n[#FN_MARKER_STYLE]=2 \{\
12704 . tm1 "[mom]: The footnote marker style active at line \\n(.c is NUMBER,
12705 . tm1 " which is incompatible with run-on footnotes. Please change
12706 . tm1 " the footnote marker style to LINE. Continuing to process,
12707 . tm1 " but ignoring request FOOTNOTES_RUN_ON.
12715 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value> | <anything>
12717 \# Begins collecting and diverting footnote text if no argument
12718 \# given. Otherwise, ends diversion FOOTNOTES, measures footnote
12719 \# depth, and sets footnote trap.
12721 \# The input line preceding a footnote call MUST terminate with \c
12722 \# or the footnote marker will be spaced away from the word it
12723 \# should be joined to.
12725 \# If FOOTNOTE is invoked with INDENT, the footnote will
12726 \# be indented. An indent style and an indent value must be given.
12727 \# Subsequent footnotes will NOT be indented; INDENT must be given
12728 \# for each footnote the user wants indented.
12732 . if \\n[#FN_MARKER_STYLE]=3 \{\
12733 . if !\\n[#LINENUMBERS] \{\
12734 . tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
12735 . tm1 " FOOTNOTE_MARKER_STYLE is LINE.
12736 . ab Aborting on FOOTNOTE at line \\n(.c.
12738 . if \\n[#FN_MARK]=0 \{ .nr #FN_MARK \\n(ln \}
12739 . nr #FN_MARK_2 \\n(ln
12740 . if '\\n(.z'P_QUOTE' \{\
12744 . if \\n[#IN_DIVER]=1 \{\
12745 . if '\\n(.z'P_QUOTE' \{\
12746 . if !\\n[#QUOTE_LN]=1 \{\
12747 . if !\\n[#SILENT_QUOTE_LN]=1 \{\
12748 . tm1 "[mom]: You have requested a line-numbered footnote inside a
12749 . tm1 " QUOTE at line \\n(.c, but line-numbering has not been enabled
12750 . tm1 " for QUOTES. Printing footnote with label "0".
12756 . if '\\n(.z'B_QUOTE' \{\
12757 . if !\\n[#BQUOTE_LN]=1 \{\
12758 . if !\\n[#SILENT_BQUOTE_LN]=1 \{\
12759 . tm1 "[mom]: You have requested a line-numbered footnote inside a
12760 . tm1 " BLOCKQUOTE at line \\n(.c, but line-numbering has not been enabled
12761 . tm1 " for BLOCKQUOTES. Printing footnote with label "0".
12769 .\" Begin processing footnotes that occur inside QUOTE, BLOCKQUOTE
12771 . if \\n[#IN_DIVER]=1 \{\
12772 . nr #PAGE_POS \\n(nl+\\n(.d+\\n[#DOC_LEAD]
12773 . nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS]-1)
12774 . nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
12775 .\" Are we on a "defer" line? If so, defer the text of the footnote.
12776 . ie \\n[#SPACE_TO_FOOTER]=\\n[#DOC_LEAD]:\\n[#SPACE_TO_FOOTER]=0 \{\
12777 . nr #DIVER_FN 2 \" treat like a normal deferred footnote
12780 . nr #DIVER_FN 2 \" treat like a normal footnote
12782 . if \\n[#PAGE_POS]>\\n[#FOOTER_POS] \{\
12783 . nr #DIVER_FN 1 \" move this footnote
12785 .\" Test for situation where, because a final line of QUOTE, BLOCKQUOTE
12786 .\" or EPIGRAPH isn't yet adjusted at this point, the last word on the
12787 .\" line may *seem* to belong to the final line of the page, but will,
12788 .\" in fact, become the first word of the subsequent page. In such
12789 .\" circumstances, we want the the footnote to be treated as a "moved"
12790 .\" diversion footnote.
12791 . if \\n(.k>\\n(.l \{ .nr #DIVER_FN 1 \}
12792 . if r#DIVER_FN \{\
12793 . if !\\n[#DIVER_FN]=2 \{ .\\n+[#DONE_ONCE] \}
12794 .\" A footnote inside a diversion will become the 1st footnote on the
12795 .\" following page/column.
12796 . if \\n[#DIVER_FN]=1 \{ .DIVER_FN_1_PRE \}
12797 .\" A footnote inside a diversion that should be treated like a
12798 .\" normal footnote (including defers.)
12799 . if \\n[#DIVER_FN]=2 \{ .DIVER_FN_2_PRE \}
12801 . nr #SAVED_FN_COUNT \\n[#FN_COUNT]+1
12802 . nr #SAVED_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]+1
12804 .\" End processing footnotes that occur inside QUOTE, BLOCKQUOTE or
12807 .\" Test for situation where, because a final line of running text
12808 .\" isn't yet adjusted at this point, the last word on the line may
12809 .\" *seem* to belong to the final line of the page, but will, in
12810 .\" fact, become the first word of the subsequent page. In such
12811 .\" circumstances, we want the the footnote marker in running text to
12812 .\" be the correct one for the 1st footnote on the page.
12813 . if \\n(.k>\\n(.l \{\
12814 . if (\\n(nl+\\n[#DOC_LEAD])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
12815 . ie \\n[#COLUMNS]=1 \{\
12816 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
12817 . if \\n[#FN_MARKER_STYLE]=1 \{\
12818 . nr #FN_COUNT_FOR_COLS 0 1
12820 . if \\n[#FN_MARKER_STYLE]=2 \{\
12821 . if \\n[#RESET_FN_NUMBER] \{\
12822 . nr #FN_NUMBER 0 1
12823 . nr #NOT_YET_ADJUSTED 1
12829 . if \\n[#FN_MARKER_STYLE]=1 \{\
12832 . if \\n[#FN_MARKER_STYLE]=2 \{\
12833 . if \\n[#RESET_FN_NUMBER] \{\
12834 . nr #FN_NUMBER 0 1
12835 . nr #NOT_YET_ADJUSTED 1
12841 . if \\n[#FN_MARKERS] \{\
12843 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
12844 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
12845 . if \\n[#PRINT_STYLE]=1 \{\
12846 . if \\n[#UNDERLINE_ON] \{\
12847 . nr #UNDERLINE_WAS_ON 1
12851 .\" Add footnote markers to running text...
12852 . if !\\n[#NO_FN_MARKER] \{\
12853 .\" ...but not if TERMINATE has not been called
12854 . if !r#TERMINATE \{\
12855 .\" Marker style star/dagger/double-dagger
12856 . if \\n[#FN_MARKER_STYLE]=1 \{\
12857 .\" Columnar docs either move col to col, or last col to next page.
12858 .\" They require their own special FN_COUNT because regular FN_COUNT
12859 .\" is used to figure out things like whether or not to put a rule
12860 .\" above footnotes (in addition to keeping track of the footnote
12861 .\" count in non-columnar docs).
12862 . ie \\n[#COLUMNS]=1 \{\
12863 . if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU2]*\c \}
12864 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU1]\(dg\c \}
12865 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dd\c \}
12866 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU2]**\c \}
12867 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU1]\(dg\(dg\c \}
12868 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dd\(dd\c \}
12869 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU2]***\c \}
12870 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg\c \}
12871 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dd\(dd\(dd\c \}
12872 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU2]****\c \}
12875 . if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU2]*\c \}
12876 . if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU1]\(dg\c \}
12877 . if \\n[#FN_COUNT]=2 \{ .PRINT \(dd\c \}
12878 . if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU2]**\c \}
12879 . if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU1]\(dg\(dg\c \}
12880 . if \\n[#FN_COUNT]=5 \{ .PRINT \(dd\(dd\c \}
12881 . if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU2]***\c \}
12882 . if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg\c \}
12883 . if \\n[#FN_COUNT]=8 \{ .PRINT \(dd\(dd\(dd\c \}
12884 . if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU2]****\c \}
12887 .\" Marker style superscript numbers
12888 . if \\n[#FN_MARKER_STYLE]=2 \{\
12889 . 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" \}
12890 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]\c" \}
12895 .\" More housekeeping
12897 .\" #SPACE_REMAINING is the space left between where we are
12898 .\" on the page and the bottom margin. It's used to determine whether
12899 .\" or not the footnote will overflow, and how many lines of
12900 .\" footnotes will fit on the page if some have to overflow.
12901 . ie \\n[#DIVER_FN]=2 \{\
12902 . nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-(\\n[#PAGE_POS])
12905 . nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n(nl
12907 . if \\n[#FROM_DIVERT_FN]=1 \{\
12908 . nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]
12909 . rr #FROM_DIVERT_FN
12911 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
12913 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
12914 . INDENT_FIRST_PARAS
12915 .\" Prepare FOOTNOTE to receive footnote text.
12917 . ll \\n[#DOC_L_LENGTH]u
12919 . if \\n[#COLUMNS]=1 \{\
12920 . ll \\n[#COL_L_LENGTH]u
12923 . if \\n[#FN_R_INDENT] \{\
12924 . ll -\\n[#FN_R_INDENT]u
12927 . if \\n[#FN_BR_INDENT] \{\
12928 . ll -\\n[#FN_BR_INDENT]u
12931 . FAMILY \\*[$FN_FAM]
12933 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
12934 . AUTOLEAD \\n[#FN_AUTOLEAD]
12935 . QUAD \\*[$FN_QUAD]
12936 . if \\n[#PRINT_STYLE]=1 \{\
12938 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
12939 . el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
12943 . nr #FN_LEAD \\n[#LEAD]
12944 .\" Begin diversion FOOTNOTES or FN_IN_DIVER
12945 . ie r#COUNTERS_RESET \{\
12946 . ie \\n[#DONE_ONCE]=1 \{\
12947 . ie \\n[#RUN_ON] \{\
12948 . di RUNON_FN_IN_DIVER
12949 . nr #RUNON_FN_IN_DIVER 1
12951 . el \{ .di FN_IN_DIVER \}
12954 . ie \\n[#RUN_ON] \{\
12955 . da RUNON_FN_IN_DIVER
12956 . nr #RUNON_FN_IN_DIVER 1
12958 . el \{ .da FN_IN_DIVER \}
12963 . ie \\n[#RUN_ON] \{\
12964 . da RUNON_FOOTNOTES
12965 . nr #RUNON_FOOTNOTES 1
12967 . el \{ .da FOOTNOTES \}
12969 . if \\n[#FOOTNOTE_COLOR]=1 \{\
12972 \m[\\*[$FOOTNOTE_COLOR]]
12977 . if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
12978 .\" When a deferred footnote is also the 1st footnote on the page,
12979 .\" and when the page it's output on also has footnotes, some
12980 .\" whitespace is needed between the deferred footnote and the
12981 .\" first footnote belonging to the output page so that there's
12982 .\" no confusion when two stars (or two number 1s) appear in
12984 . if \\n[#FN_DEFER_SPACE] \{\
12985 .\" ...but only add the extra space if TERMINATE has not been called
12986 . if !r#TERMINATE \{\
12987 .\" ...and not if defer space has already been added
12988 . if !\\n[#DEFER_SPACE_ADDED] \{\
12989 .\" ...and not if the footnote count the last time we checked for
12990 .\" a defer situation inside a diversion is greater than 1.
12991 . if !\\n[#SAVED_DIVER_FN_COUNT]>1 \{\
12992 . if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
12993 . if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
12994 . nr #DEFER_SPACE_ADDED 1
12998 . rr #FN_DEFER_SPACE
12999 . rr #SAVED_DIVER_FN_COUNT
13001 . if \\n[#DIVERTED]=3 \{\
13002 . if \\n[#FN_COUNT]>0 \{\
13006 .\" Add footnote rule (or, if no rule, some whitespace).
13007 .\" N.B.- this line increments #FN_COUNT each and every time FOOTNOTE
13009 . if \\n+[#FN_COUNT]=1 \{\
13010 .\" If a footnote is called in a diversion, and the footnote has to
13011 .\" be moved, don't put in the rule now (it's taken care of when
13012 .\" FN_IN_DIVER is output into FOOTNOTE in PROCESS_FN_IN_DIVER).
13013 . if !\\n[#DONT_RULE_ME]=1 \{\
13014 . if !\\n[#FN_DEPTH] \{\
13015 . if \\n[#PRINT_STYLE]=1 \{\
13016 . if !\\n[#RUN_ON] \{ .ALD \\n[#DOC_LEAD]u \}
13018 . ie \\n[#FN_RULE]=1 \{\
13019 . if !\\n[#RUN_ON] \{ .PRINT_FOOTNOTE_RULE \}
13027 .\" Add footnote markers to footnote text...
13028 . ie \\n[#FN_MARKERS] \{\
13029 . if \\n[#FN_SPACE]>0 \{\
13030 . if \\n[#FN_COUNT]>0 \{\
13031 . ALD \\n[#FN_SPACE]u
13034 . if !\\n[#NO_FN_MARKER] \{\
13035 .\" ...but not if TERMINATE has been called.
13036 . if !r#TERMINATE \{\
13037 . if \\n[#REF]=1 \{\
13038 \!. in +\\*[$REF_FN_INDENT]
13039 \!. ti -\\*[$REF_FN_INDENT]
13041 . if \\n[#FN_MARKER_STYLE]=1 \{\
13042 . ie \\n[#COLUMNS]=1 \{\
13043 . \\n+[#FN_COUNT_FOR_COLS]
13044 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT *\c \}
13045 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dg\c \}
13046 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \(dd\c \}
13047 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT **\c \}
13048 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dg\(dg\c \}
13049 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \(dd\(dd\c \}
13050 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT ***\c \}
13051 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dg\(dg\(dg\c \}
13052 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \(dd\(dd\(dd\c \}
13053 . if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT ****\c \}
13056 . if \\n[#FN_COUNT]=1 \{ .PRINT *\c \}
13057 . if \\n[#FN_COUNT]=2 \{ .PRINT \(dg\c \}
13058 . if \\n[#FN_COUNT]=3 \{ .PRINT \(dd\c \}
13059 . if \\n[#FN_COUNT]=4 \{ .PRINT **\c \}
13060 . if \\n[#FN_COUNT]=5 \{ .PRINT \(dg\(dg\c \}
13061 . if \\n[#FN_COUNT]=6 \{ .PRINT \(dd\(dd\c \}
13062 . if \\n[#FN_COUNT]=7 \{ .PRINT ***\c \}
13063 . if \\n[#FN_COUNT]=8 \{ .PRINT \(dg\(dg\(dg\c \}
13064 . if \\n[#FN_COUNT]=9 \{ .PRINT \(dd\(dd\(dd\c \}
13065 . if \\n[#FN_COUNT]=10 \{ .PRINT ****\c \}
13068 . if \\n[#FN_MARKER_STYLE]=2 \{\
13069 . if \\n[#COLUMNS]=1 \{\
13070 . \\n+[#FN_COUNT_FOR_COLS]
13072 . if \\n[#NOT_YET_ADJUSTED]=1 \{\
13073 . nr #FN_NUMBER 1 1
13074 . rr #NOT_YET_ADJUSTED
13076 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
13077 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\*[FU 2]\c" \}
13083 .\" Line-numbered footnotes handling
13084 . if \\n[#FN_MARKER_STYLE]=3 \{\
13085 . if \\n[#FN_SPACE]>0 \{\
13086 . if !\\n[#RUN_ON]=1 \{\
13087 . if \\n[#FN_COUNT]>0 \{\
13088 . ALD \\n[#FN_SPACE]u
13092 . if \\n[#REF]=1 \{\
13093 . if !\\n[#RUN_ON]=1 \{\
13094 \!. in +\\*[$REF_FN_INDENT]
13095 \!. ti -\\*[$REF_FN_INDENT]
13098 . ie \\n[#FN_LN_BRACKETS]=1 \{\
13099 . ds $FN_LINENUMBER \v'-.085m'\\*[$FN_OPEN_BRACKET]\v'.085m'
13100 . ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \{\
13101 . as $FN_LINENUMBER \\n[#FN_MARK]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m' \"
13104 . as $FN_LINENUMBER \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m' \"
13108 . ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \{\
13109 . ds $FN_LINENUMBER \\n[#FN_MARK]\\*[$FN_LN_SEP]
13112 . ds $FN_LINENUMBER \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\\*[$FN_LN_SEP]
13115 . if !\\n[#NO_FN_MARKER] \{\
13116 . PRINT \\*[$FN_LINENUMBER]\c
13118 . rm $FN_LINENUMBER
13124 .\" If INDENT arg is passed to FOOTNOTE, calculate the indent...
13125 . ie '\\$1'INDENT' \{\
13127 . if '\\$2'L' \{ .in (\\$3) \}
13128 . if '\\$2'LEFT' \{ .in (\\$3) \}
13129 . if '\\$2'R' \{ .nr #FN_R_INDENT (\\$3) \}
13130 . if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
13132 . nr #FN_BL_INDENT (\\$3)
13133 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
13134 . el \{ .nr #FN_BR_INDENT (\\$4) \}
13135 . in \\n[#FN_BL_INDENT]u
13137 . if '\\$2'BOTH' \{\
13138 . nr #FN_BL_INDENT (\\$3)
13139 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
13140 . el \{ .nr #FN_BR_INDENT (\\$4) \}
13141 . in \\n[#FN_BL_INDENT]u
13144 .\" ...then re-run FOOTNOTE without an argument.
13149 .\" Add "defer space" if the previously diverted footnote was the
13150 .\" 1st footnote proper to its page (i.e. it looks like a deferred
13151 .\" footnote but it's really an overflow).
13152 . if \\n[#DIVERTED] \{\
13153 . if \\n[#PREV_FN_DEFERRED]=1 \{\
13154 . if \\n[#FN_MARKER_STYLE]=1 \{ .ALD \\n[#FN_LEAD]u \}
13155 . if \\n[#RESET_FN_NUMBER] \{ .ALD \\n[#FN_LEAD]u \}
13156 . nr #PREV_FN_DEFERRED 2
13159 . if \\n[#REF]=1 \{\
13162 .\" Terminate FOOTNOTES or FN_IN_DIVER diversion
13164 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
13166 .\" More housekeeping
13167 .\" Turn off indent possibly set by FOOTNOTE INDENT
13169 .\" Restore sentence spacing
13170 . if \\n[#PRINT_STYLE]=2 \{\
13171 . if d$RESTORE_SS_VAR \{ .SS \\*[$RESTORE_SS_VAR] \}
13172 . rm $RESTORE_SS_VAR
13174 . if \\n[#PRINT_STYLE]=1 \{\
13175 . if \\n[#UNDERLINE_WAS_ON] \{\
13177 . rr #UNDERLINE_WAS_ON
13183 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
13184 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
13185 . rr #INDENT_FIRSTS
13186 .\" Calculate footnote depth, but not if #COUNTERS_RESET (created in
13187 .\" DIVER_FN_1_PRE) to instruct FOOTNOTES to skip this step for now
13188 .\" (it's taken care of when FN_IN_DIVER is output into FOOTNOTES in
13189 .\" PROCESS_FN_IN_DIVER).
13190 . ie r#COUNTERS_RESET \{\
13191 . rr #COUNTERS_RESET
13195 .\" If the footnote is the 1st on the page and it falls too close
13196 .\" to the bottom margin, defer the footnote text to the next page...
13197 . if (\\n[#SPACE_REMAINING]-1)<=(\\n[#DOC_LEAD]) \{\
13198 .\" ...but not if PROCESS_FN_LEFTOVER has set #PREV_FN_DEFERRED to 1
13199 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
13201 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
13203 .\" This is required so that the defer space clause can distinguish
13204 .\" a real #FN_COUNT=1 from one generated if FOOTNOTE is run inside
13205 .\" QUOTE, BLOCKQUOTE or EPIGRAPH
13206 . if \\n[#DIVER_FN]=2 \{\
13207 . nr #SAVED_DIVER_FN_COUNT \\n[#FN_COUNT]
13212 .\" Calculate the footnote depth.
13213 . if \\n[#GET_DEPTH]=1 \{\
13214 .\" Save the previous footnote depth (for use when there will be
13215 .\" some overflowed footnote text).
13216 . nr #SAVED_FN_DEPTH_1 \\n[#FN_DEPTH]
13217 .\" Add the depth of the current footnote to any already existent
13219 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
13220 .\" Special handling for run-on footnotes
13221 . if \\n[#RUN_ON]=1 \{\
13222 . if \\n[#RUNON_FOOTNOTES] \{\
13223 . unformat RUNON_FOOTNOTES
13225 . if \\n[#RUNON_FN_IN_DIVER] \{\
13226 . unformat RUNON_FN_IN_DIVER
13229 .\" Recreate FOOTNOTES with rule followed by text of unformatted
13230 .\" run-on footnotes.
13232 . ie \\n[#FN_RULE]=0 \{ .RLD 1v \}
13234 \v'-\\n[#FN_RULE_ADJ]u-\\n[#FN_RULE_WEIGHT_ADJ]u'\
13235 \D't \\n[#FN_RULE_WEIGHT]'\
13236 \h'-\\n[#FN_RULE_WEIGHT]u'\
13237 \D'l \\n[#FN_RULE_LENGTH]u 0'\
13238 \v'+\\n[#FN_RULE_ADJ]u+\\n[#FN_RULE_WEIGHT_ADJ]u'
13241 . if \\n[#RUNON_FOOTNOTES] \{\
13243 . rr #RUNON_FOOTNOTES
13245 . if \\n[#RUNON_FN_IN_DIVER] \{\
13246 . RUNON_FN_IN_DIVER
13247 . rr #RUNON_FN_IN_DIVER
13252 . nr #FN_DEPTH \\n[#DIVER_DEPTH]
13253 . nr #SAVED_VFP 0+\\n[#VARIABLE_FOOTER_POS]
13254 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
13256 .\" Save the new depth
13257 . nr #SAVED_FN_DEPTH_2 \\n[#FN_DEPTH]
13258 .\" Signal that defer space should be added when PROCESS_FN_LEFTOVER
13259 .\" processes deferred footnotes.
13260 . if \\n[#FN_DEFER] \{\
13261 . if \\n[#FN_COUNT]=2 \{\
13262 . ie \\n[#COLUMNS] \{\
13263 . if !\\n[#FROM_FOOTER] \{\
13264 . if \\n[#FN_DEFER]=1 \{ .nr #FN_DEFER_SPACE 1 \}
13265 . if \\n[#FN_COUNT_FOR_COLS]>=1 \{ .rr #FN_DEFER_SPACE \}
13266 . if \\n[#FROM_HEADER] \{ .nr #FN_DEFER_SPACE 1 \}
13270 . nr #FN_DEFER_SPACE 1
13275 .\" If the depth of the whole footnote won't fit in the space
13276 .\" between where we are on the page and the bottom margin, calculate
13277 .\" how much of it will fit.
13278 . if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
13280 . while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
13281 . nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
13283 . nr #VFP_DIFF \\n[#FN_DEPTH]-\\n[#SAVED_FN_DEPTH_1]
13285 .\" Very occasionally, #VFP_DIFF, on a 1st footnote that isn't to
13286 .\" be deferred, comes up with a depth equal to exactly 1 line
13287 .\" of footnotes, i.e. enough room to print the rule and nothing
13288 .\" else. The following tests for such a condition, and rather than
13289 .\" attempting to treat the footnote as an overflow, it tells mom to
13290 .\" treat it as a special kind of deferred footnote (#FN_DEFER 2).
13291 . if \\n[#SAVED_FN_DEPTH_1]=0 \{\
13292 . if \\n[#FN_DEPTH]=\\n[#FN_LEAD] \{\
13294 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_2]
13299 .\" Calculate VFP based on whether the footnote overflows, or is to
13300 .\" be treated normally.
13301 . ie \\n[#OVERFLOW]=1 \{\
13302 . if \\n[#RUN_ON] \{\
13303 . rr #VARIABLE_FOOTER_POS
13304 . nr #VARIABLE_FOOTER_POS \\n[#SAVED_VFP]
13306 . ie \\n[#FN_COUNT]=1 \{\
13307 . ie \\n[#RULED]=1 \{\
13308 . ie \\n[#COLUMNS]=1 \{\
13309 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13310 . ie \\n[#FROM_FOOTER] \{\
13311 . ie \\n[#FN_COUNT_FOR_COLS]>1 \{\
13312 . nr #FN_DEPTH -\\n[#FN_DEPTH]
13313 . if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
13314 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
13315 . nr #FN_DEPTH -\\n[#VFP_DIFF]
13319 . nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
13320 . if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
13324 . nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
13328 . nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
13331 . el \{ .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]) \}
13334 . nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
13335 . if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
13336 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
13337 . ie \\n[#COLUMNS]=1 \{\
13338 . if !\\n[#FROM_FOOTER] \{\
13343 . nr #FN_DEPTH -\\n[#VFP_DIFF]
13346 . if \\n[#DIVERTED]=3 \{\
13347 . if !\\n[#PREV_FN_DEFERRED] \{\
13348 . if !\\n[#FROM_FOOTER] \{\
13349 . if \\n[#FN_COUNT]=1 \{\
13350 . if !\\n[#VFP_DIFF] \{\
13351 . if \\n[#FN_MARKER_STYLE]=1 \{\
13353 \!. ALD \\n[#FN_LEAD]u
13356 . if \\n[#RESET_FN_NUMBER] \{\
13358 \!. ALD \\n[#FN_LEAD]u
13367 .\" Not sure what I was thinking with this next line. As is, it
13368 .\" moves the already established VFP trap for footnote 1 higher up
13369 .\" the page, resulting in a VFP that's higher on the page than the
13370 .\" current page position. Leaving it in anyway, commented out, in
13371 .\" case the logic and the conditions under which it should
13372 .\" apply reveal themselves.
13373 \#. nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
13374 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
13377 . nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
13378 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
13384 . nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
13385 . if \\n[#PREV_FN_DEFERRED]=1 \{\
13386 . if \\n[#DIVERTED] \{\
13387 . if !\\n[#FN_DEPTH]=\\n[#SAVED_FN_DEPTH_1] \{\
13388 . nr #FN_DEPTH +\\n[#FN_LEAD]
13389 . nr #VARIABLE_FOOTER_POS -\\n[#FN_LEAD]
13390 . rr #PREV_FN_DEFERRED
13394 . if \\n[#FN_COUNT]>1 \{\
13402 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13403 .\" See VFP_CHECK for an explanation of the next lines.
13404 .\" The trap has to be removed, prior to setting it, each time
13405 .\" FOOTNOTE is run.
13406 . if \\n[#PRINT_STYLE]=2 \{\
13408 . wh \\n[#VARIABLE_FOOTER_POS]u-\\n[#DOC_LEAD]u VFP_CHECK
13410 .\" If we have a footnote whose text has to be deferred to the next
13411 .\" page, reset the FOOTER trap to its original location.
13412 . if \\n[#FN_DEFER] \{\
13413 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
13414 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13417 . nr #NO_FN_MARKER 0
13419 . if \\n[#NUM_ARGS]=2 \{\
13420 . if '\\$2'BREAK' \{ .BR \}
13421 . if '\\$2'BR' \{ .BR \}
13425 \# Utility macros to manage footnotes that occur inside diversions
13426 \# ---------------------------------------------------------------
13428 \# There are some redundancies here; they're left in in case unforeseen
13429 \# footnote situations crop up in the future that might require
13430 \# manipulation of them.
13432 \# 1. Pre-footnote processing for footnotes in diversions
13434 \# a) A footnote inside a diversion will be moved entirely (marker
13435 \# in running text and text of footnote) to the next page/column.
13437 .MAC DIVER_FN_1_PRE END
13438 . nr #RESET_FN_COUNTERS 1
13439 . nr #COUNTERS_RESET 1
13440 . if \\n[#DONE_ONCE]=1 \{\
13441 . if \\n[#FN_DEFER] \{\
13442 . if \\n[#SAVED_DIVER_FN_COUNT]=1 \{\
13443 . ie \\n[#COLUMNS]=1 \{\
13444 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_DEFER_SPACE 1 \}
13447 . nr #FN_DEFER_SPACE 1
13451 . if \\n[#FN_MARKER_STYLE]=1 \{\
13452 . if \\n[#FN_COUNT]>0 \{ .nr #FN_COUNT 0 1 \}
13453 . if \\n[#COLUMNS]=1 \{\
13454 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13455 . nr #FN_COUNT_FOR_COLS 0 1
13459 . if \\n[#FN_MARKER_STYLE]=2 \{\
13460 . if \\n[#RESET_FN_NUMBER]=1 \{\
13461 . ie \\n[#COLUMNS]=1 \{\
13462 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
13465 . nr #FN_NUMBER 0 1
13472 \# b) Treat as a normal footnote, including defers.
13474 .MAC DIVER_FN_2_PRE END
13475 . nr #RESET_FN_COUNTERS 2
13478 \# 2. Post-footnote processing for footnotes in diversions
13480 \# Even when a footnote inside a diversion is treated as
13481 \# "normal," some manipulation of registers is required. The
13482 \# macro is called in DO_QUOTE (i.e. at the termination of
13483 \# quotes and blockquotes) and in DO_EPIGRAPH.
13485 .MAC DIVER_FN_2_POST END
13486 . if \\n[#DONE_ONCE]=1 \{\
13487 . if \\n[#FN_MARKER_STYLE]=1 \{\
13488 . if \\n[#FN_COUNT]=0 \{\
13489 . nr #DONT_RULE_ME 1
13491 . if \\n[#FN_COUNT]>0 \{\
13494 . if \\n[#COLUMNS]=1 \{\
13495 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT_FOR_COLS 0 1 \}
13496 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13500 . if \\n[#FN_MARKER_STYLE]=2 \{\
13501 . if \\n[#FN_COUNT]=0 \{\
13502 . nr #DONT_RULE_ME 1
13504 . if \\n[#FN_COUNT]>0 \{\
13507 . if \\n[#RESET_FN_NUMBER]=1 \{\
13508 . ie \\n[#COLUMNS]=1 \{\
13509 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
13512 . nr #FN_NUMBER 0 1
13519 \# The main macros that handle footnote processing.
13520 \# -----------------------------------------------
13521 \# Sometimes, #VARIABLE_FOOTER_POS sets FOOTER at a location that gives
13522 \# the impression another line of running text could fit on the page.
13523 \# VFP_CHECK is always set to the line just above the one where FOOTER
13524 \# will be sprung, and checks for this condition. If it exists, FOOTER
13525 \# is set one line lower on the page, thus squeezing in an extra line
13526 \# of running text. This is a judgment call on my part, but seems to
13527 \# work well. If there are problems (e.g. footnotes really do look
13528 \# jammed), the user should probably adjust FOOTNOTE_AUTOLEAD and/or
13529 \# FOOTNOTE_RULE_ADJ.
13531 \# The macro has to be run in its own environment, otherwise the first
13532 \# word of the last line before the footnotes gets chopped.
13536 .\" The trap also has to be removed each time VFP_CHECK is run
13537 . if \\n[#PRINT_STYLE]=2 \{\
13540 . ie !\\n[#IN_DIVER] \{ .nr #PAGE_POS \\n(nl \}
13541 . el \{ .nr #PAGE_POS \\n(nl+\\n(.d+(\\n[#DOC_LEAD]) \}
13542 . nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS])
13543 . nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
13544 . nr #FN_GAP \\n[#SPACE_TO_FOOTER]%\\n[#DOC_LEAD]
13545 . if !\\n[#FN_GAP]<0 \{\
13546 . if \\n[#FN_GAP]<\\n[#DOC_LEAD] \{\
13547 . ie (\\n[#PAGE_POS]+(\\n[#FN_DEPTH]+\\n[#FN_GAP]))>(\\n[#VISUAL_B_MARGIN]) \{\
13548 . nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
13551 . ie \\n[#DOC_LEAD]-\\n[#FN_GAP]<\\n[#DESCENDER] \{\
13552 . nr #VARIABLE_FOOTER_POS +\\n[#DOC_LEAD]
13553 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13556 . nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
13565 \# FN_OVERFLOW_TRAP starts off "underneath" FOOTER, but is revealed
13566 \# as #VARIABLE_FOOTER_POSITION changes the position of FOOTER.
13567 \# FN_OVERFLOW_TRAP simply starts diversion FN_OVERFLOW to "catch"
13568 \# the overflow. The diversion is ended in FOOTER, immediately after
13569 \# FOOTER outputs the diversion, FOOTNOTES, before PROCESS_FN_LEFTOVER
13570 \# is run (either in HEADER, or in FOOTER if moving col to col).
13572 .MAC FN_OVERFLOW_TRAP END
13573 . if \\n[#FN_COUNT] \{\
13575 . ie !\\n[#NO_BACK_UP]=1 \{\
13576 . if \\n[#PREV_FN_DEFERRED] \{\
13577 . ie \\n[#COLUMNS]=1 \{\
13578 . if \\n[#FROM_FOOTER] \{\
13579 . if \\n[#PREV_FN_DEFERRED] \{\
13580 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13581 . rr #PREV_FN_DEFERRED
13585 . if !\\n[#FROM_FOOTER] \{\
13586 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13587 . if !\\n[#LAST_FN_COUNT_FOR_COLS]>1 \{\
13588 \!. RLD \\n[#FN_LEAD]u
13594 \!. RLD \\n[#FN_LEAD]u
13600 . rr #PREV_FN_DEFERRED
13603 .\" When #FROM_DIVERT_FN is 1, it signals to FOOTNOTE, when run from
13604 .\" within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING to the total
13605 .\" area allowable for running text.
13606 . nr #FROM_DIVERT_FN 1
13609 \# PROCESS_FN_LEFTOVER is called at the top of HEADER, and in
13610 \# FOOTER if we're moving from one column to the next (i.e. after
13611 \# outputting FOOTNOTES). It checks for whether we have a "deferred
13612 \# footnote" situation, and resets counters and number registers
13613 \# accordingly. Lastly, if we have some footnote overflow, it calls
13614 \# DIVERT_FN_OVERFLOW.
13616 .MAC PROCESS_FN_LEFTOVER END
13617 . if \\n[#PREV_FN_DEFERRED]=2 \{\
13618 . if \\n[#FN_COUNT_AT_FOOTER]>1 \{ .rr #PREV_FN_DEFERRED \}
13620 . if !\\n[#FN_DEFER] \{\
13623 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
13625 . if r#FN_DEFER \{\
13626 . if \\n[#FN_DEFER]=1 \{\
13627 . nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
13629 . if \\n[#FN_DEFER]=2 \{\
13631 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
13634 . nr #SPACE_REMAINING 0
13635 . ch FOOTER -\\n[#B_MARGIN]u
13636 . if \\n[#FN_DEFER] \{\
13637 . nr #NO_FN_MARKER 1
13641 . ie \\n[#COLUMNS]=1 \{\
13642 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13643 . if !\\n[#FROM_FOOTER] \{\
13644 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .nr #PREV_FN_DEFERRED 1 \}
13648 . el \{ .nr #PREV_FN_DEFERRED 1 \}
13650 . if !\\n[#FN_DEFER] \{\
13651 . if \\n[#FN_OVERFLOW_DEPTH] \{\
13652 . DIVERT_FN_LEFTOVER
13655 . ie \\n[#COLUMNS]=1 \{\
13656 . if \\n[#COL_NUM]>1 \{\
13657 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT 0 1 \}
13660 . el \{ .nr #FN_COUNT 0 1 \}
13661 . if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
13662 . rr #FROM_DIVERT_FN
13665 \# DIVERT_FN_LEFTOVER is called in PROCESS_FN_LEFTOVER (at
13666 \# the top of HEADER, and in FOOTER if we're moving from one column
13669 .MAC DIVERT_FN_LEFTOVER END
13670 . nr #NO_FN_MARKER 1
13676 . if \\n[#PREV_FN_DEFERRED] \{\
13677 . nr #FN_DEPTH -\\n[#FN_LEAD]
13678 . nr #VARIABLE_FOOTER_POS +\\n[#FN_LEAD]
13679 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13680 . if \\n[#PREV_FN_DEFERRED]=2 \{\
13681 . nr #PREV_FN_DEFERRED 1
13685 . rr #FN_OVERFLOW_DEPTH
13688 \# This is a special macro to deal with footnotes that are set inside
13689 \# diversions (QUOTE, BLOCKQUOTE and EPIGRAPH). It's called in HEADER
13690 \# (and in FOOTER, if we're moving from column to column), and comes
13691 \# after PROCESS_FOOTNOTE_LEFTOVER in those two macros.
13693 .MAC PROCESS_FN_IN_DIVER END
13694 . nr #SPACE_REMAINING 0
13695 . ch FOOTER -\\n[#B_MARGIN]u
13696 . nr #NO_FN_MARKER 1
13697 . if !\\n[#RESET_FN_COUNTERS]=2 \{\
13698 . rr #RESET_FN_COUNTERS
13701 . if \\n[#FN_OVERFLOW_DEPTH] \{ .nf \}
13702 . ie dRUNON_FN_IN_DIVER \{\
13703 . RUNON_FN_IN_DIVER
13704 . rm RUNON_FN_IN_DIVER
13714 \# ====================================================================
13718 \# When endnotes are output, the spacing between the notes is always
13719 \# 1 extra linespace. This can have bottom margin consequences. If
13720 \# this doesn't bother you, don't worry about it. If it does bother
13721 \# you, and you want to adjust the spacing between any two endnotes (as
13722 \# they're output), make the spacing adjustments (.ALD/.RLD) at the
13723 \# *end* of endnotes (i.e. just before .ENDNOTE OFF), not at the top.
13725 \# Endnotes must be output manually with .ENDNOTES. This allows user
13726 \# the flexibility to output endnotes at the end of each collated
13727 \# document, or to output them at the end of the entire document.
13732 \# ENDNOTE POINT SIZE
13733 \# ------------------
13735 \# <base point size for endnotes>
13737 \# Creates or modifies register #EN_PS.
13739 \# Default is same as running text in body of document.
13741 \# This size control macro differs from other size control macros
13742 \# in that it sets an absolute point size, not a relative one. This
13743 \# is because a) endnotes always appear separate from the body of
13744 \# a document and therefore don't need to be relative to the body
13745 \# of the document, and b) there are quite a few elements of the
13746 \# endnotes page(s) that need to be relative to the base point size
13747 \# of that page. If the base endnote point size were relative to
13748 \# the body of the document (i.e. a _SIZE macro taking a +|- value)
13749 \# getting the rest of the endnote elements sized properly could
13750 \# become very confusing.
13752 .MAC ENDNOTE_PT_SIZE END
13753 . nr #EN_PS (p;\\$1)
13760 \# <base leading to use in endnotes> [ ADJUST ]
13762 \# Creates or modifies register #EN_LEAD. Creates or removes
13763 \# register #ADJ_EN_LEAD. Stores arguments in strings if ENDNOTE_LEAD
13764 \# set before START.
13766 \# Default is 14 points for TYPESET, adjusted; 24 for TYPEWRITE.
13768 .MAC ENDNOTE_LEAD END
13769 . if !\\n[#OK_PROCESS_LEAD] \{\
13772 . ds $ADJUST_EN_LEAD \\$2
13777 . nr #EN_LEAD (p;\\$1)
13778 . if '\\$2'ADJUST' \{\
13779 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
13780 . nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
13781 . nr #ADJ_DOC_LEAD 1
13782 . nr #ADJ_EN_LEAD 1
13783 . nr #NO_TRAP_RESET 1
13784 . DOC_LEAD \\n[#EN_LEAD]u ADJUST
13785 . nr #EN_LEAD \\n[#DOC_LEAD]
13786 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
13787 . rr #NO_TRAP_RESET
13788 . nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
13789 . rr #ORIG_DOC_LEAD
13794 \# ENDNOTES_HDRFTR_CENTER
13795 \# ----------------------
13799 \# Creates or removes toggle register #EN_HDRFTR_CENTER, used to
13800 \# determine whether mom should print a/the hdrftr center string
13801 \# on the endnotes page. Primarily to enable/disable printing of the
13802 \# chapter name in hdrftrs when DOCTYPE CHAPTER.
13806 .MAC ENDNOTES_HDRFTR_CENTER END
13807 . ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
13808 . el \{ .rr #EN_HDRFTR_CENTER \}
13815 \# <title for endnotes page>
13817 \# Creates or modifies string $EN_STRING.
13819 \# Default is "Endnotes"
13821 .MAC ENDNOTE_STRING END
13822 . ds $EN_STRING \\$1
13826 .MAC ENDNOTE_STRING_ADVANCE END
13827 . nr #EN_STRING_ADVANCE (\\$1)
13831 \# ENDNOTE STRING CAPS
13832 \# -------------------
13834 \# <none> | <anything>
13836 \# Turns capitalization of the endnotes pages title string
13837 \# "Endnotes" on or off.
13839 \# Users may want the endnotes pages title string to be in caps,
13840 \# but the toc entry for endnotes in lower case. If the argument
13841 \# to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
13842 \# turned on, this is exactly what will happen.
13846 .MAC ENDNOTE_STRING_CAPS END
13847 . ie '\\$1'' \{ .nr #EN_STRING_CAPS 1 \}
13848 . el \{ .rr #EN_STRING_CAPS \}
13855 \# <string that appears before the first endnote pertaining to any document>
13857 \# Creates string $EN_TITLE.
13859 \# Default is the document title, or, if doc is a chapter, "Chapter #"
13861 .MAC ENDNOTE_TITLE END
13862 . ds $EN_TITLE \\$1
13866 \# ENDNOTE MARKER STYLE
13867 \# --------------------
13871 \# Sets register #EN_MARKER_STYLE, used in ENDNOTE to determine
13872 \# the style of endnote markers (labels).
13874 \# 1=NUMBER; 2=LINE. LINE means "use output line numbers".
13875 \# Default is NUMBER.
13877 .MAC ENDNOTE_MARKER_STYLE END
13878 . if '\\$1'NUMBER' \{\
13879 . nr #EN_MARKER_STYLE 1
13881 . if '\\$1'LINE' \{\
13882 . nr #EN_MARKER_STYLE 2
13883 . if !\\n[#EN_LN_SEP] \{\
13884 . if !\\n[#EN_LN_BRACKETS] \{ .ENDNOTE_LINENUMBER_BRACKETS SQUARE \}
13890 \# ENDNOTE LINENUMBER MARK
13891 \# -----------------------
13893 \# This string, when called inline, stores the current output line
13894 \# number in register #EN_MARK for use with ENDNOTE.
13896 .ds EN-MARK \R'#EN_MARK \En(ln'
13899 \# ENDNOTE LINENUMBER SEPARATOR
13900 \# ----------------------------
13902 \# <user-defined separator>
13904 \# Stores user-defined separator (for use then
13905 \# ENDNOTE_MARKER_STYLE is LINE) in string $EN_LN_SEP. The
13906 \# separator is intended to be used when the user wishes a
13907 \# separator, rather than the choice of brackets offered by
13908 \# ENDNOTE_LINENUMBER_BRACKETS.
13910 .MAC ENDNOTE_LINENUMBER_SEPARATOR END
13911 . rr #EN_LN_BRACKETS
13913 . ds $EN_LN_SEP "\\$1
13917 \# ENDNOTE LINENUMBER BRACKETS
13918 \# ---------------------------
13920 \# PARENS | SQUARE | BRACES or ( | [ | {
13922 \# Sets register #EN_LN_BRACKETS to 1, and creates strings
13923 \# $EN_OPEN_BRACKET and $EN_CLOSE_BRACKET according to the given argument.
13925 .MAC ENDNOTE_LINENUMBER_BRACKETS END
13927 . nr #EN_LN_BRACKETS 1
13928 . if '\\$1'PARENS' \{\
13929 . ds $EN_OPEN_BRACKET (
13930 . ds $EN_CLOSE_BRACKET )
13933 . ds $EN_OPEN_BRACKET (
13934 . ds $EN_CLOSE_BRACKET )
13936 . if '\\$1'SQUARE' \{\
13937 . ds $EN_OPEN_BRACKET [
13938 . ds $EN_CLOSE_BRACKET ]
13941 . ds $EN_OPEN_BRACKET [
13942 . ds $EN_CLOSE_BRACKET ]
13944 . if '\\$1'BRACES' \{\
13945 . ds $EN_OPEN_BRACKET {
13946 . ds $EN_CLOSE_BRACKET }
13949 . ds $EN_OPEN_BRACKET {
13950 . ds $EN_CLOSE_BRACKET }
13955 \# ENDNOTE LINENUMBER GAP
13956 \# ----------------------
13958 \# <space between line-number labels and endnotes text>
13960 \# Defines string $EN_LN_GAP, used during printing of line-number
13961 \# labels in ENDNOTE.
13963 .MAC ENDNOTE_LINENUMBER_GAP END
13964 . ds $EN_LN_GAP \\$1
13968 \# ENDNOTE NUMBERS ALIGN RIGHT
13969 \# ---------------------------
13971 \# <max. number of digit placeholders that will appear in endnotes>
13973 \# Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
13974 \# #EN_NUMBER_PLACEHOLDERS.
13976 \# Default is for footnote numbers to be right aligned to 2 placeholders.
13978 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
13979 . rr #EN_NUMBERS_ALIGN_LEFT
13980 . nr #EN_NUMBERS_ALIGN_RIGHT 1
13981 . nr #EN_NUMBER_PLACEHOLDERS \\$1
13985 \# ENDNOTE NUMBERS ALIGN LEFT
13986 \# --------------------------
13990 \# Toggles register #EN_NUMBERS_ALIGN_LEFT on.
13992 \# Default is for footnote numbers to be right aligned to 2 placeholders
13993 \# (i.e. not left aligned).
13995 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
13996 . rr #EN_NUMBERS_ALIGN_RIGHT
13997 . nr #EN_NUMBERS_ALIGN_LEFT 1
14001 \# ENDNOTE PARAGRAPH INDENT
14002 \# ------------------------
14004 \# <first line indent of paras subsequent to 1st in endnotes>
14006 \# Creates register #EN_PP_INDENT for use in .PP.
14008 \# Requires a unit of measure.
14010 \# Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
14012 .MAC ENDNOTE_PARA_INDENT END
14013 . nr #EN_PP_INDENT (\\$1)
14017 \# TURN OFF COLUMN MODE FOR ENDNOTES
14018 \# ---------------------------------
14020 \# <none> | <anything>
14022 \# Creates or removes register #EN_NO_COLS
14024 \# Allows user to tell mom not to set endnotes in columnar
14025 \# documents in columns. Default is to set endnotes in columns.
14027 .MAC ENDNOTES_NO_COLUMNS END
14028 . ie '\\$1'' \{ .nr #EN_NO_COLS 1 \}
14029 . el \{ .rr #EN_NO_COLS \}
14033 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
14034 \# -------------------------------------------
14036 \# <none> | <anything>
14038 \# Creates or removes register #EN_NO_FIRST_PN
14040 \# For use if FOOTERS are on. Tells ENDNOTES not to put a page
14041 \# number on the first endnotes page. Some users may want this.
14042 \# Default is to print a page number at the top of the first
14043 \# endnotes page when footers are on.
14045 .MAC ENDNOTES_NO_FIRST_PAGENUM END
14046 . ie '\\$1'' \{ .nr #EN_NO_FIRST_PN 1 \}
14047 . el \{ .rr #EN_NO_FIRST_PN \}
14051 \# PAGE HEADERS ON ENDNOTES PAGES
14052 \# ------------------------------
14056 \# Creates or removes register #EN_ALLOWS_HEADERS or
14057 \# #EN_ALLOWS_HEADERS_ALL
14059 \# Whether ENDNOTES puts a page header at the top of endnotes
14060 \# pages if page headers are used throughout the document.
14061 \# Default is to insert the page headers, but not on the first
14062 \# page. If the optional argument ALL is given, ENDNOTES puts a
14063 \# page header on the first page as well.
14065 .MAC ENDNOTES_ALLOWS_HEADERS END
14066 . ie '\\$1'' \{ .nr #EN_ALLOWS_HEADERS 1 \}
14068 . ie '\\$1'ALL' \{\
14069 . nr #EN_ALLOWS_HEADERS 1
14070 . nr #EN_ALLOWS_HEADERS_ALL 1
14073 . nr #EN_ALLOWS_HEADERS 0
14074 . nr #EN_ALLOWS_HEADERS_ALL 0
14080 \# ENDNOTES PAGES PAGE NUMBERING STYLE
14081 \# -----------------------------------
14083 \# DIGIT | ROMAN | roman | ALPHA | alpha
14085 \# Creates or modifies $EN_PN_STYLE.
14087 \# Allows user to define what style should be used for endnotes
14088 \# pages page numbering. Arguments are the same as for
14091 \# Default is DIGIT.
14093 .MAC ENDNOTES_PAGENUM_STYLE END
14094 . ds $EN_PN_STYLE \\$1
14098 \# FIRST PAGE NUMBER FOR ENDNOTES
14099 \# ------------------------------
14101 \# <page number that appears on page 1 of endnotes pages>
14103 \# Creates or modifies string $EN_FIRST_PN
14105 \# To be used with caution, only if all endnotes
14106 \# are to be output at once, i.e. not at the end of the separate
14107 \# docs of a collated doc
14109 .MAC ENDNOTES_FIRST_PAGENUMBER END
14110 . nr #EN_FIRST_PN \\$1
14113 \# SINGLESPACE ENDNOTES
14114 \# --------------------
14116 \# <none> | <anything>
14118 \# Sets lead of endnotes pages in TYPEWRITE to 12 points,
14121 \# Default is to double-space endnotes pages.
14123 .MAC SINGLESPACE_ENDNOTES END
14124 . if \\n[#PRINT_STYLE]=1 \{\
14125 . ie \\n[#SINGLE_SPACE] \{\
14126 . nr #EN_SINGLESPACE 1
14128 . if \\n[#OK_PROCESS_LEAD] \{\
14129 . ENDNOTE_LEAD 12 ADJUST
14135 . nr #EN_SINGLESPACE 1
14137 . if \\n[#OK_PROCESS_LEAD] \{\
14138 . ENDNOTE_LEAD 12 ADJUST
14143 . rr #EN_SINGLESPACE
14145 . if \\n[#OK_PROCESS_LEAD] \{\
14146 . ENDNOTE_LEAD 24 ADJUST
14155 \# ENDNOTE PARAGRAPH SPACE
14156 \# -----------------------
14160 \# Creates toggle register #EN_PP_SPACE for use in .PP.
14162 \# Like PARA_SPACE. Default is not to space endnote paras.
14164 .MAC ENDNOTE_PARA_SPACE END
14165 . ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
14166 . el \{ .rr #EN_PP_SPACE \}
14175 \# Places superscript endnote number in text, then collects and
14176 \# processes endnote in diversion END_NOTES.
14178 \# \c must be appended to the word immediately preceding .ENDNOTE
14179 \# when ENDNOTE_MARKER_STYLE is NUMBER.
14184 . if \\n[#EN_MARKER_STYLE]=1 \{\
14185 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
14186 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
14187 . if \\n[#PRINT_STYLE]=1 \{\
14188 . if \\n[#UNDERLINE_ON] \{\
14189 . nr #UNDERLINE_WAS_ON 1
14192 . if \\n[#SLANT_ON] \{\
14193 . nr #SLANT_WAS_ON 1
14196 . PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
14198 . if \\n[#PRINT_STYLE]=2 \{\
14199 . PRINT \*[SUP]\\n+[#EN_NUMBER]\*[SUPX]\c
14202 . if \\n[#EN_MARKER_STYLE]=2 \{\
14203 . ie r#EN_NUMBER \{ \\n+[#EN_NUMBER] \}
14204 . el \{ .nr #EN_NUMBER 1 1 \}
14205 . if !\\n[#LINENUMBERS] \{\
14206 . tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
14207 . tm1 " ENDNOTE_MARKER_STYLE is LINE.
14208 . ab Aborting on ENDNOTE at line \\n(.c.
14210 . if \\n[#EN_MARK]=0 \{ .nr #EN_MARK \\n(ln \}
14211 . nr #EN_MARK_2 \\n(ln
14212 . if '\\n(.z'P_QUOTE' \{\
14217 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
14219 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
14220 . INDENT_FIRST_PARAS
14223 . LL \\n[#DOC_L_LENGTH]u
14225 . if \\n[#COLUMNS] \{\
14226 . ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
14227 . el \{ .LL \\n[#COL_L_LENGTH]u \}
14230 . vs \\n[#EN_LEAD]u
14231 . if \\n[#EN_NUMBER]=1 \{\
14233 . if \\n[#PRINT_STYLE]=1 \{\
14236 . if \\n[#PRINT_STYLE]=2 \{\
14237 . FAMILY \\*[$EN_TITLE_FAM]
14238 . FT \\*[$EN_TITLE_FT]
14239 . PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
14242 . if !'\\*[$EN_TITLE]'' \{\
14243 . if '\\*[$EN_TITLE_QUAD]'L' \{ .LEFT \}
14244 . if '\\*[$EN_TITLE_QUAD]'LEFT' \{ .LEFT \}
14245 . if '\\*[$EN_TITLE_QUAD]'C' \{ .CENTER \}
14246 . if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
14247 . if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
14248 . if '\\*[$EN_TITLE_QUAD]'R' \{ .RIGHT \}
14249 . if '\\*[$EN_TITLE_QUAD]'RIGHT' \{ .RIGHT \}
14250 . ie \\n[#EN_TITLE_UNDERLINE] \{\
14251 . nr #FROM_EN_TITLE 1
14252 . UNDERSCORE "\\*[$EN_TITLE]"
14253 . rr #FROM_EN_TITLE
14256 . PRINT "\\*[$EN_TITLE]"
14260 . if \\n[#PRINT_STYLE]=1 \{\
14262 . if \\n[#EN_NUMBER]=1 \{\
14263 . if \\n[#SINGLE_SPACE]=1 \{ .sp \}
14266 . if \\n[#PRINT_STYLE]=2 \{\
14267 . if \\n[#EN_NUMBER]=1 \{\
14268 . if !'\\*[$EN_TITLE]'' \{ .sp \}
14270 . if \\n[#EN_MARKER_STYLE]=1 \{\
14271 . FAMILY \\*[$EN_NUMBER_FAM]
14272 . FT \\*[$EN_NUMBER_FT]
14273 . PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
14275 . if \\n[#EN_MARKER_STYLE]=2 \{\
14276 . FAMILY \\*[$EN_LN_FAM]
14277 . FT \\*[$EN_LN_FT]
14278 . PT_SIZE \\n[#EN_PS]u\\*[$EN_LN_SIZE_CHANGE]
14281 . if \\n[#EN_MARKER_STYLE]=2 \{\
14282 . ENDNOTE_NUMBERS_ALIGN_LEFT
14283 . ie \\n[#EN_LN_BRACKETS]=1 \{\
14284 . ds $EN_LINENUMBER \v'-.085m'\\*[$EN_OPEN_BRACKET]\v'.085m'
14285 . ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \{\
14286 . as $EN_LINENUMBER \\n[#EN_MARK]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m' \"
14289 . as $EN_LINENUMBER \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m' \"
14293 . ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \{\
14294 . ds $EN_LINENUMBER \\n[#EN_MARK]\\*[$EN_LN_SEP]
14297 . ds $EN_LINENUMBER \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\\*[$EN_LN_SEP]
14303 . nr #RESET_L_LENGTH \\n(.l
14304 . ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
14305 . nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
14309 . nr #EN_NUMBER_L_LENGTH \w'\En[#EN_NUMBER].\0'
14312 . if \\n[#EN_MARKER_STYLE]=2 \{\
14313 . if !\\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
14314 . nr #EN_NUMBER_L_LENGTH \w'\\*[$EN_LINENUMBER]'+\\*[$EN_LN_GAP]
14318 . ll \\n[#EN_NUMBER_L_LENGTH]u
14319 . if \\n[#EN_MARKER_STYLE]=1 \{\
14322 . if \\n[#EN_MARKER_STYLE]=2 \{\
14323 \\*[$EN_LINENUMBER]
14324 . rm $EN_LINENUMBER
14327 . ll \\n[#RESET_L_LENGTH]u
14328 . nr #EN_FIGURE_SPACE \w'\0.'
14329 . ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
14330 . in \\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_FIGURE_SPACE]u
14333 . ti \\n[#EN_NUMBER_L_LENGTH]u
14335 . nr #EN_TEXT_INDENT \\n(.i
14336 . QUAD \\*[$EN_QUAD]
14338 . if \\n[#PRINT_STYLE]=1 \{\
14341 . if \\n[#PRINT_STYLE]=2 \{\
14342 . FAMILY \\*[$EN_FAM]
14344 . PT_SIZE \\n[#EN_PS]u
14346 . if \\n[#REF]=1 \{\
14347 . ie !\\n[#EN_MARKER_STYLE]=2 \{\
14348 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
14349 . in \\*[$REF_EN_INDENT]
14350 . ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u)
14352 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
14353 \#. in \\*[$REF_EN_INDENT]
14354 \#. ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u-\\n[#EN_FIGURE_SPACE]u)
14355 \#. in \\*[$REF_EN_INDENT]+\\n[#EN_NUMBER_L_LENGTH]u
14356 \#. ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_FIGURE_SPACE]u)
14357 . in +\\*[$REF_EN_INDENT]
14358 . ti -\\*[$REF_EN_INDENT]
14362 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
14363 . in \\*[$REF_EN_INDENT]
14364 . ti -(\\*[$REF_EN_INDENT]-\\n[#EN_NUMBER_L_LENGTH]u)
14372 . if \\n[#EN_MARKER_STYLE]=2 \{\
14376 .\" Restore sentence spacing
14377 . if \\n[#PRINT_STYLE]=2 \{\
14378 . if d$RESTORE_SS_VAR \{ .SS \\*[$RESTORE_SS_VAR] \}
14379 . rm $RESTORE_SS_VAR
14382 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
14383 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
14384 . rr #INDENT_FIRSTS
14386 . if \\n[#PRINT_STYLE]=1 \{\
14387 . if \\n[#UNDERLINE_WAS_ON] \{\
14388 . rr #UNDERLINE_WAS_ON
14392 . if \\n[#SLANT_WAS_ON] \{\
14397 . if \\n[#NUM_ARGS]=2 \{\
14398 . if '\\$2'BREAK' \{ .BR \}
14399 . if '\\$2'BR' \{ .BR \}
14409 \# Sets new document leading from #EN_LEAD, breaks to a new page,
14410 \# sets up an endnotes page based on registers and strings associated
14411 \# with endnotes, then outputs diversion END_NOTES.
14415 . nr #EN_FIRST_PAGE 1
14416 . nr #HEADER_STATE \\n[#HEADERS_ON]
14417 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
14418 . if \\n[#LINENUMBERS]=1 \{\
14420 . nr #LINENUMBERS 2
14422 . if \\n[#HEADERS_ON]=1 \{\
14423 . if !\\n[#EN_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
14425 . if \\n[#HEADER_STATE]=1 \{\
14426 . ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
14427 . el \{ .rm $HDRFTR_CENTER \}
14429 . ie !\\n[#SUSPEND_PAGINATION] \{\
14430 . if \\n[#PAGINATE]=1 \{\
14431 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14432 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
14433 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN]-1 \}
14434 . if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
14439 . ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
14440 . el \{ .nr #PAGINATE 0 \}
14442 . if \\n[#FOOTERS_ON]=1 \{\
14443 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
14446 . if \\n[#FOOTERS_ON]=1 \{\
14447 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
14448 . rm $HDRFTR_CENTER_OLD
14449 . rm $HDRFTR_CENTER_NEW
14451 . ie !\\n[#SUSPEND_PAGINATION] \{\
14452 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14453 . if r#EN_NO_FIRST_PN \{\
14454 . if \\n[#PAGINATION_STATE]=1 \{\
14461 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
14463 . rr #PAGINATION_STATE
14464 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
14465 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
14466 . if \\n[#HEADER_STATE]=1 \{\
14467 . if \\n[#EN_ALLOWS_HEADERS] \{ .HEADERS \}
14469 .\" Collect endnotes title string for TOC
14470 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
14471 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
14472 . ds $TOC_TITLE_ITEM \\*[$EN_STRING]\\|
14475 . if \\n[#PRINT_STYLE]=1 \{\
14478 . if \\n[#PRINT_STYLE]=2 \{\
14479 \!. FAMILY \\*[$TOC_TITLE_FAM]
14480 \!. FT \\*[$TOC_TITLE_FT]
14481 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
14485 . ie \\n[#PRINT_STYLE]=1 \{\
14486 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
14489 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
14495 . if \\n[#PRINT_STYLE]=2 \{\
14496 \!. FAMILY \\*[$TOC_PN_FAM]
14497 \!. FT \\*[$TOC_PN_FT]
14498 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
14501 \!. PRINT \\*[LEADER]
14504 \!. PRINT \\n[#TOC_ENTRY_PN]
14508 .\" End collection of endnotes title string for TOC
14509 .\" Process endnotes
14510 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#EN_LEAD]u \}
14511 . if \\n[#PRINT_STYLE]=2 \{\
14512 . if \\n[#EN_NO_COLS] \{\
14513 . if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
14516 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
14517 . ie \\n[#ADJ_EN_LEAD] \{\
14518 . nr #DOC_LEAD \\n[#EN_LEAD]
14520 . el \{ .DOC_LEAD \\n[#EN_LEAD]u \}
14523 . ie r#EN_STRING_ADVANCE \{ .sp |\\n[#EN_STRING_ADVANCE]u \}
14524 . el \{ .sp |\\n[#T_MARGIN]u \}
14526 . if \\n[#SLANT_ON] \{\
14530 . if !'\\*[$EN_STRING]'' \{\
14531 . if \\n[#PRINT_STYLE]=1 \{\
14533 . vs \\n[#EN_LEAD]u
14535 . if \\n[#PRINT_STYLE]=2 \{\
14536 . LL \\n[#DOC_L_LENGTH]u
14538 . if \\n[#COLUMNS] \{\
14539 . ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
14540 . el \{ .LL \\n[#COL_L_LENGTH]u \}
14543 . FAMILY \\*[$EN_STRING_FAM]
14544 . FT \\*[$EN_STRING_FT]
14545 . PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
14546 . vs \\n[#EN_LEAD]u
14548 . if '\\*[$EN_STRING_QUAD]'L' \{ .LEFT \}
14549 . if '\\*[$EN_STRING_QUAD]'LEFT' \{ .LEFT \}
14550 . if '\\*[$EN_STRING_QUAD]'C' \{ .CENTER \}
14551 . if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
14552 . if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
14553 . if '\\*[$EN_STRING_QUAD]'R' \{ .RIGHT \}
14554 . if '\\*[$EN_STRING_QUAD]'RIGHT' \{ .RIGHT \}
14556 . if \\n[#EN_STRING_CAPS] \{ .CAPS \}
14557 . ie \\n[#EN_STRING_UNDERLINE] \{\
14558 . nr #FROM_EN_STRING 1
14559 . ie \\n[#EN_STRING_UNDERLINE]=2 \{\
14560 . UNDERSCORE2 \\*[$EN_UNDERLINE_GAP] \\*[$EN_RULE_GAP] "\\*[$EN_STRING]"
14563 . UNDERSCORE "\\*[$EN_STRING]"
14565 . rr #FROM_EN_STRING
14568 . PRINT "\\*[$EN_STRING]
14572 . if \\n[#PRINT_STYLE]=1 \{\
14573 . ie \\n[#SINGLE_SPACE]=1 \{\
14574 . ALD \\n[#EN_LEAD]u*2u
14577 . ie \\n[#EN_SINGLESPACE]=1 \{\
14578 . ALD \\n[#EN_LEAD]u*2
14585 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#EN_LEAD]u \}
14586 . QUAD \\*[$EN_QUAD]
14592 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#DOC_LEAD]u \}
14593 . if \\n[#PRINT_STYLE]=2 \{\
14594 . ie \\n[#ADJ_EN_LEAD] \{\
14595 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
14597 . el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
14598 . rr #RESTORE_DOC_LEAD
14600 . if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
14601 . if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
14602 . if \\n[#LINENUMBERS]=2 \{\
14603 . NUMBER_LINES RESUME
14604 . nr #LINENUMBERS 1
14609 \# ====================================================================
14611 \# +++BIBLIOGRAPHY+++
14613 \# Mom treats bibliographies and endnotes very similarly. The chief
14614 \# difference is that endnotes are collected and formatted inside a
14615 \# diversion, while bibliographies are built "by hand." ENDNOTES sets
14616 \# up the endnotes page and outputs the formatted diversion.
14617 \# BIBLIOGRAPHY sets up the bibliography page, then awaits refer
14620 \# All of the bibliography control macros have their exact
14621 \# counterparts in the endnotes control macros. It was tempting to do
14622 \# fancy stuff with aliases to avoid the repetition, but for reasons
14623 \# of my own sanity, and for the benefit of anyone wanting to play
14624 \# around with the bibliography control macros, I decided to keep them
14627 \# Because the bibliography control macros all have endnotes
14628 \# equivalents, refer to the appropriate, similar endnote macro for
14629 \# Arguments, Function and Notes.
14630 \# Bibliography control macros
14632 .MAC BIBLIOGRAPHY_PT_SIZE END
14633 . nr #BIB_PS (p;\\$1)
14636 .MAC BIBLIOGRAPHY_LEAD END
14637 . if !\\n[#OK_PROCESS_LEAD] \{\
14638 . ds $BIB_LEAD \\$1
14640 . ds $ADJUST_BIB_LEAD \\$2
14645 . nr #BIB_LEAD (p;\\$1)
14646 . if '\\$2'ADJUST' \{\
14647 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
14648 . nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
14649 . nr #ADJ_DOC_LEAD 1
14650 . nr #ADJ_BIB_LEAD 1
14651 . nr #NO_TRAP_RESET 1
14652 . DOC_LEAD \\n[#BIB_LEAD]u ADJUST
14653 . nr #BIB_LEAD \\n[#DOC_LEAD]
14654 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
14655 . rr #NO_TRAP_RESET
14656 . nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
14657 . rr #ORIG_DOC_LEAD
14661 .MAC BIBLIOGRAPHY_HDRFTR_CENTER END
14662 . ie '\\$1'' \{ .nr #BIB_HDRFTR_CENTER 1 \}
14663 . el \{ .rr #BIB_HDRFTR_CENTER \}
14666 .MAC BIBLIOGRAPHY_STRING END
14667 . ds $BIB_STRING \\$1
14670 .MAC BIBLIOGRAPHY_STRING_CAPS END
14671 . ie '\\$1'' \{ .nr #BIB_STRING_CAPS 1 \}
14672 . el \{ .rr #BIB_STRING_CAPS \}
14675 .MAC BIBLIOGRAPHY_NO_COLUMNS END
14676 . ie '\\$1'' \{ .nr #BIB_NO_COLS 1 \}
14677 . el \{ .rr #BIB_NO_COLS \}
14680 .MAC BIBLIOGRAPHY_NO_FIRST_PAGENUM END
14681 . ie '\\$1'' \{ .nr #BIB_NO_FIRST_PN 1 \}
14682 . el \{ .rr #BIB_NO_FIRST_PN \}
14685 .MAC BIBLIOGRAPHY_ALLOWS_HEADERS END
14686 . ie '\\$1'' \{ .nr #BIB_ALLOWS_HEADERS 1 \}
14688 . ie '\\$1'ALL' \{\
14689 . nr #BIB_ALLOWS_HEADERS 1
14690 . nr #BIB_ALLOWS_HEADERS_ALL 1
14693 . rr #BIB_ALLOWS_HEADERS
14694 . rr #BIB_ALLOWS_HEADERS_ALL
14699 .MAC BIBLIOGRAPHY_PAGENUM_STYLE END
14700 . ds $BIB_PN_STYLE \\$1
14703 .MAC BIBLIOGRAPHY_FIRST_PAGENUMBER END
14704 . nr #BIB_FIRST_PN \\$1
14707 .MAC SINGLESPACE_BIBLIOGRAPHY END
14708 . if \\n[#PRINT_STYLE]=1 \{\
14709 . ie \\n[#SINGLE_SPACE] \{\
14710 . nr #BIB_SINGLESPACE 1
14712 . if \\n[#OK_PROCESS_LEAD] \{\
14713 . BIBLIOGRAPHY_LEAD 12 ADJUST
14719 . nr #BIB_SINGLESPACE 1
14721 . if \\n[#OK_PROCESS_LEAD] \{\
14722 . BIBLIOGRAPHY_LEAD 12 ADJUST
14727 . rr #BIB_SINGLESPACE
14729 . if \\n[#OK_PROCESS_LEAD] \{\
14730 . BIBLIOGRAPHY_LEAD 24 ADJUST
14739 \# Style for outputting collected bibliographic references
14740 \# -------------------------------------------------------
14742 \# LIST | PLAIN [ <list separator> ] [ <list prefix> ]
14744 \# Sets #BIB_LIST to 1 for numbered list style, 0 for plain output
14746 \# Technically, user is supposed to enter PLAIN if s/he wants an
14747 \# unumbered bibliography, but the el clause says "any arg but
14748 \# LIST means unumbered." Effectively, any arg but LIST produces
14749 \# a "plain" bibliographic list.
14751 \# The 2nd and 3rd args have the same options as the 2nd arg to LIST.
14753 .MAC BIBLIOGRAPHY_TYPE END
14754 . ie '\\$1'LIST' \{\
14757 . if '\\*[$BIB_LIST_SEPARATOR]'' .ds $BIB_LIST_SEPARATOR .
14759 . el .ds $BIB_LIST_SEPARATOR \\$2
14760 . ie '\\$3'' .ds $BIB_LIST_PREFIX
14761 . el .ds $BIB_LIST_PREFIX \\$3
14763 . el \{ .nr #BIB_LIST 0 \}
14766 \# Spacing between items in bibliographies
14767 \# ---------------------------------------
14769 \# <amount of space>
14771 \# Gets value for #BIB_SPACE in units.
14773 \# Requires a unit of measure.
14775 .MAC BIBLIOGRAPHY_SPACING END
14776 . ds $BIB_SPACE \\$1
14777 . if \\n[#BIB_LEAD]=0 \{\
14778 . nr #DEFER_BIB_SPACING 1
14781 . ds $EVAL_BIB_SPACE \\*[$BIB_SPACE]
14782 . substring $EVAL_BIB_SPACE -1
14783 . ie '\\*[$EVAL_BIB_SPACE]'v' \{\
14784 . substring $BIB_SPACE 0 0
14785 . nr #BIB_SPACE \\n[#BIB_LEAD]*\\*[$BIB_SPACE]
14788 . nr #BIB_SPACE (\\$1)
14792 \# Set up bibliography page
14793 \# ------------------------
14795 \# Sets up a new page, with title, ready to accept the output
14796 \# of refer's $LIST$ or .R1 bibliography .R2
14798 \# Bibliography pages are set up almost identically to endnotes pages.
14800 .MAC BIBLIOGRAPHY END
14801 . nr #BIBLIOGRAPHY 1
14802 . nr #BIB_FIRST_PAGE 1
14803 . nr #HEADER_STATE \\n[#HEADERS_ON]
14804 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
14805 . if \\n[#LINENUMBERS]=1 \{\
14807 . nr #LINENUMBERS 2
14809 . if \\n[#HEADERS_ON]=1 \{\
14810 . if !\\n[#BIB_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
14812 . if \\n[#HEADER_STATE]=1 \{\
14813 . ie \\n[#BIB_HDRFTR_CENTER]=1 \{ . \}
14814 . el \{ .rm $HDRFTR_CENTER \}
14816 . ie !\\n[#SUSPEND_PAGINATION] \{\
14817 . if \\n[#PAGINATE]=1 \{\
14818 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14819 . PAGENUM_STYLE \\*[$BIB_PN_STYLE]
14820 . if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN]-1 \}
14821 . if r#BIB_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
14826 . ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
14827 . el \{ .nr #PAGINATE 0 \}
14829 . if \\n[#FOOTERS_ON]=1 \{\
14830 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
14833 . if \\n[#FOOTERS_ON]=1 \{\
14834 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
14835 . rm $HDRFTR_CENTER_OLD
14836 . rm $HDRFTR_CENTER_NEW
14838 . ie !\\n[#SUSPEND_PAGINATION] \{\
14839 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14840 . if r#BIB_NO_FIRST_PN \{\
14841 . if \\n[#PAGINATION_STATE]=1 \{\
14848 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
14850 . rr #PAGINATION_STATE
14851 . PAGENUM_STYLE \\*[$BIB_PN_STYLE]
14852 . if \\n[#BIB_FIRST_PN] \{ .PAGENUMBER \\n[#BIB_FIRST_PN] \}
14853 . if \\n[#HEADER_STATE]=1 \{\
14854 . if \\n[#BIB_ALLOWS_HEADERS] \{ .HEADERS \}
14856 .\" Collect bibliography title string for TOC
14857 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
14858 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
14859 . ds $TOC_TITLE_ITEM \\*[$BIB_STRING]\\|
14862 . if \\n[#PRINT_STYLE]=1 \{\
14865 . if \\n[#PRINT_STYLE]=2 \{\
14866 \!. FAMILY \\*[$TOC_TITLE_FAM]
14867 \!. FT \\*[$TOC_TITLE_FT]
14868 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
14871 . ie \\n[#PRINT_STYLE]=1 \{\
14872 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
14875 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
14880 . if \\n[#PRINT_STYLE]=2 \{\
14881 \!. FAMILY \\*[$TOC_PN_FAM]
14882 \!. FT \\*[$TOC_PN_FT]
14883 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
14886 \!. PRINT \\*[LEADER]
14889 \!. PRINT \\n[#TOC_ENTRY_PN]
14893 .\" End collection of bibliography title string for TOC
14894 .\" Process bibliography
14895 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#BIB_LEAD]u \}
14896 . if \\n[#PRINT_STYLE]=2 \{\
14897 . if \\n[#BIB_NO_COLS] \{\
14898 . if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
14901 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
14902 . ie \\n[#ADJ_BIB_LEAD] \{\
14903 . nr #DOC_LEAD \\n[#BIB_LEAD]
14905 . el \{ .DOC_LEAD \\n[#BIB_LEAD]u \}
14908 . ie r#BIB_TITLE_SPACE \{ .sp |\\n[#BIB_TITLE_SPACE]u \}
14909 . el \{ .sp |\\n[#T_MARGIN]u \}
14911 . if \\n[#SLANT_ON] \{\
14914 . if !'\\*[$BIB_STRING]'' \{\
14915 . if \\n[#PRINT_STYLE]=1 \{\
14917 . vs \\n[#BIB_LEAD]u
14919 . if \\n[#PRINT_STYLE]=2 \{\
14920 . LL \\n[#DOC_L_LENGTH]u
14922 . if \\n[#COLUMNS] \{\
14923 . ie \\n[#BIB_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
14924 . el \{ .LL \\n[#COL_L_LENGTH]u \}
14927 . FAMILY \\*[$BIB_STRING_FAM]
14928 . FT \\*[$BIB_STRING_FT]
14929 . PT_SIZE \\n[#BIB_PS]u\\*[$BIB_STRING_SIZE_CHANGE]
14930 . vs \\n[#BIB_LEAD]u
14932 . if '\\*[$BIB_STRING_QUAD]'L' \{ .LEFT \}
14933 . if '\\*[$BIB_STRING_QUAD]'LEFT' \{ .LEFT \}
14934 . if '\\*[$BIB_STRING_QUAD]'C' \{ .CENTER \}
14935 . if '\\*[$BIB_STRING_QUAD]'CENTER' \{ .CENTER \}
14936 . if '\\*[$BIB_STRING_QUAD]'CENTRE' \{ .CENTER \}
14937 . if '\\*[$BIB_STRING_QUAD]'R' \{ .RIGHT \}
14938 . if '\\*[$BIB_STRING_QUAD]'RIGHT' \{ .RIGHT \}
14940 . if \\n[#BIB_STRING_CAPS] \{ .CAPS \}
14941 . ie \\n[#BIB_STRING_UNDERLINE] \{\
14942 . nr #FROM_BIB_STRING 1
14943 . ie \\n[#BIB_STRING_UNDERLINE]=2 \{\
14944 . UNDERSCORE2 "\\*[$BIB_STRING]"
14947 . UNDERSCORE "\\*[$BIB_STRING]"
14949 . rr #FROM_BIB_STRING
14952 . PRINT "\\*[$BIB_STRING]"
14956 . FAMILY \\*[$BIB_FAMILY]
14958 . PT_SIZE -\\*[$BIB_STRING_SIZE_CHANGE]
14959 . if \\n[#PRINT_STYLE]=1 \{\
14960 . ie \\n[#SINGLE_SPACE]=1 \{\
14961 . ALD \\n[#BIB_LEAD]*3u
14964 . ie \\n[#BIB_SINGLESPACE]=1 \{\
14965 . ALD \\n[#BIB_LEAD]u*3u
14968 . ALD \\n[#BIB_LEAD]u
14972 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#BIB_LEAD]u*2u \}
14973 . QUAD \\*[$BIB_QUAD]
14974 . if \\n[#PRINT_STYLE]=1 \{\
14975 . ie \\n[#SINGLE_SPACE]=1 \{\
14976 . vs \\n[#BIB_LEAD]u
14979 . ie \\n[#BIB_SINGLESPACE]=1 \{\
14980 . vs \\n[#BIB_LEAD]u
14983 . vs \\n[#BIB_LEAD]u
14987 . if \\n[#PRINT_STYLE]=2 \{\
14988 . ie \\n[#ADJ_BIB_LEAD] \{\
14989 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
14991 . el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
14992 . rr #RESTORE_DOC_LEAD
14994 . if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
14995 . if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
14997 . if \\n[#LINENUMBERS]=2 \{\
14998 . NUMBER_LINES RESUME
14999 . nr #LINENUMBERS 1
15003 \# ====================================================================
15005 \# +++TABLE OF CONTENTS+++
15007 \# Strings to allocate space for leaders and entry page numbers
15009 .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]
15010 .ds $TOC_PN_TYPEWRITE \\*[ST100]^\\*[ST100X]\\*[ST101]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST101X]
15012 \# TOC ENTRIES PAGE NUMBERS PADDING
15013 \# --------------------------------
15015 \# <number of placeholders for toc entries page numbers>
15017 \# Creates or modifies register #TOC_PN_PADDING.
15019 \# "Placeholders" is the maximum number of digits in a page
15024 .MAC TOC_PADDING END
15025 . nr #TOC_PN_PADDING \\$1
15032 \# <none> | <anything>
15034 \# Creates or removes register #PAGINATE_TOC.
15036 \# Default is to paginate toc.
15038 .MAC PAGINATE_TOC END
15039 . ie '\\$1'' \{ .nr #PAGINATE_TOC 1 \}
15040 . el \{ .nr #PAGINATE_TOC 0 \}
15047 \# <base point size for toc pages>
15049 \# Creates or modifies register #TOC_PS.
15051 \# This size control macro differs from other size control macros
15052 \# in that it sets an absolute point size, not a relative one.
15053 \# See notes for ENDNOTE_PT_SIZE for explanation. No unit of
15054 \# measure required.
15056 \# No unit of measure required (points assumed). Default is 12.5
15059 .MAC TOC_PT_SIZE END
15060 . nr #TOC_PS (p;\\$1)
15067 \# <leading for toc pages> [ADJUST]
15069 \# Creates or modifies register #TOC_LEAD. If optional ADJUST
15070 \# given, adjusts lead to fill page. If #OK_PROCESS_LEAD doesn't
15071 \# exist, stores arguments for when it's okay to run the macro.
15073 \# No unit of measure required (points assumed).
15075 \# Default is same as DOC_LEAD.
15078 . if !\\n[#OK_PROCESS_LEAD] \{\
15079 . ds $TOC_LEAD \\$1
15081 . ds $ADJUST_TOC_LEAD \\$2
15086 . nr #TOC_LEAD (p;\\$1)
15087 . if '\\$2'ADJUST' \{\
15088 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
15089 . nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
15090 . nr #ADJ_DOC_LEAD 1
15091 . nr #ADJ_TOC_LEAD 1
15092 . nr #NO_TRAP_RESET 1
15093 . DOC_LEAD \\n[#TOC_LEAD]u ADJUST
15094 . nr #TOC_LEAD \\n[#DOC_LEAD]
15095 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
15096 . rr #NO_TRAP_RESET
15097 . nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
15098 . rr #ORIG_DOC_LEAD
15103 \# TOC PAGES PAGE-NUMBERING STYLE
15104 \# ------------------------------
15106 \# DIGIT | ROMAN | roman | ALPHA | alpha
15108 \# Creates or modifies string $TOC_PN_STYLE
15110 \# Page numbering style for page numbers that appear in the
15111 \# headers/footers of toc pages. See notes for PAGENUM_STYLE.
15113 \# Default is roman.
15115 .MAC TOC_PAGENUM_STYLE END
15116 . ds $TOC_PN_STYLE \\$1
15120 \# TOC RECTO_VERSO SWITCH
15121 \# ----------------------
15123 \# <none> | <anything>
15125 \# Creates or removes register #TOC_RV_SWITCH
15127 \# Allows switching of L/R margins if a doc is recto/verso and
15128 \# the first toc page happens to fall the wrong way
15130 .MAC TOC_RV_SWITCH END
15131 . ie '\\$1'' \{ .nr #TOC_RV_SWITCH 1 \}
15132 . el \{ .rr #TOC_RV_SWITCH \}
15135 \# - for TOC "doc header" (i.e. "Contents")
15137 \# TOC HEADER STRING
15138 \# -----------------
15140 \# <string for "doc header" of first toc page>
15142 \# Creates or modifies string $TOC_HEADER_STRING
15144 \# Default is "Contents".
15146 .MAC TOC_HEADER_STRING END
15147 . ds $TOC_HEADER_STRING \\$1
15150 \# - for TOC entries page number numerals
15152 \# Control macros for toc doc titles, heads, subheads and paraheads
15153 \# ----------------------------------------------------------------
15155 \# All these control macros behave the same way, setting the family,
15156 \# font, point size and indent from the left margin of the different
15157 \# kinds of entries that can appear in the toc. The way they
15158 \# operate is identical to all other _FAMILY, _FONT and _SIZE
15159 \# control macros. _INDENT takes an absolute value.
15160 \# TOC_APPENDS_AUTHORS is unique in this section.
15162 \# - for title entries
15164 .MAC TOC_TITLE_INDENT END
15165 . nr #TOC_TITLE_INDENT (\\$1)
15169 .MAC TOC_TITLE_ENTRY END
15170 . nr #USER_SET_TITLE_ITEM 1
15171 . ds $USER_SET_TITLE_ITEM \\$1
15175 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
15176 \# -----------------------------------------
15178 \# <none> | <name(s) of author(s) as they should appear in toc doc title entries>
15180 \# Creates register #TOC_AUTHORS (to tell TOC to append authors
15181 \# to toc doc title entries). Optionally creates string
15184 \# Normally, TOC does not append the author(s) to a toc doc title
15185 \# entry. This special macro instructs TOC to do so.
15187 \# If user has multiple authors for each doc when collating,
15188 \# TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
15189 \# COLLATE and START in each doc. Otherwise, mom prints only the
15190 \# first author given to AUTHOR.
15192 .MAC TOC_APPENDS_AUTHOR END
15193 . nr #TOC_AUTHORS 1
15195 . ds $TOC_AUTHORS \\$1
15199 \# - for head entries
15201 .MAC TOC_HEAD_INDENT END
15202 . nr #TOC_HEAD_INDENT (\\$1)
15205 \# - for subhead entries
15207 .MAC TOC_SUBHEAD_INDENT END
15208 . nr #TOC_SH_INDENT (\\$1)
15211 \# - for parahead entries
15213 .MAC TOC_PARAHEAD_INDENT END
15214 . nr #TOC_PH_INDENT (\\$1)
15219 . if \\n[#LINENUMBERS]=1 \{\
15221 . nr #LINENUMBERS 2
15223 . if !r#PAGINATE_TOC \{ .PAGINATE_TOC \}
15224 . nr #TOC_FIRST_PAGE 1
15225 . if \\n[#FINIS] \{\
15226 . if \\n[#FOOTERS_WERE_ON] \{\
15227 . FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
15230 . if \\n[#FOOTERS_ON]=1 \{\
15231 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
15232 . ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
15233 . el \{ .PAGINATION OFF \}
15235 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS OFF \} \" But have to turn FOOTERS off again so they don't print when FINIS was called
15237 . if \\n[#FINIS] \{\
15238 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \} \" Finally, turn footers on if they were on
15239 . rr #FOOTERS_WERE_ON
15240 . if \\n[#PAGINATION_WAS_ON] \{\
15242 . rr #PAGINATION_WAS_ON
15246 . ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
15247 . el \{ .PAGINATION OFF \}
15248 . if \\n[#FOOTERS_ON]=1 \{\
15249 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
15250 . rm $HDRFTR_CENTER_OLD
15251 . rm $HDRFTR_CENTER_NEW
15256 . if \\n[#PRINT_STYLE]=1 \{\
15258 . DOC_LEAD 24 ADJUST
15261 . if \\n[#LINENUMBERS]=2 \{ .nr #LINENUMBERS 3 \}
15265 . if \\n[#PRINT_STYLE]=2 \{\
15266 . ie r#ADJ_TOC_LEAD \{\
15267 . nr #NO_TRAP_RESET 1
15268 . DOC_LEAD \\n[#TOC_LEAD]u ADJUST
15269 . rr #NO_TRAP_RESET
15271 . el \{ .DOC_LEAD \\n[#TOC_LEAD]u \}
15273 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
15274 . if \\n[#SLANT_ON] \{\
15277 . DOC_LINE_LENGTH \\n[#DOC_L_LENGTH]u
15278 . QUAD \\*[$TOC_HEADER_QUAD]
15279 . PAGENUM_STYLE \\*[$TOC_PN_STYLE]
15280 . if \\n[#PRINT_STYLE]=1 \{\
15283 . if \\n[#PRINT_STYLE]=2 \{\
15284 . FAMILY \\*[$TOC_HEADER_FAM]
15285 . FT \\*[$TOC_HEADER_FT]
15286 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
15288 . ie \\n[#PRINT_STYLE]=1 \{\
15291 . PRINT "\\*[$TOC_HEADER_STRING]"
15296 . PRINT "\\*[$TOC_HEADER_STRING]"
15300 .\" In collated docs, this bit inserts the first doc's title
15301 .\" underneath the TOC header, before the TOC_ENTRIES diversion
15304 . if d$FIRST_DOC_TITLE \{\
15305 . nr #RESTORE_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
15306 . TOC_PADDING \\n[#FIRST_DOC_TOC_PN_PADDING]
15307 . if \\n[#PRINT_STYLE]=2 \{\
15308 . FAMILY \\*[$TOC_TITLE_FAM]
15309 . FT \\*[$TOC_TITLE_FT]
15310 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
15313 . ie \\n[#PRINT_STYLE]=1 \{\
15314 . PAD "\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN_TYPEWRITE]"
15317 . PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN]"
15323 . if \\n[#PRINT_STYLE]=2 \{\
15324 . FAMILY \\*[$TOC_PN_FAM]
15325 . FT \\*[$TOC_PN_FT]
15326 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
15329 . PRINT \\*[LEADER]
15331 . PRINT \\n[#FIRST_DOC_TITLE_PN]
15334 . TOC_PADDING \\n[#RESTORE_TOC_PN_PADDING]
15339 . if \\n[#LINENUMBERS]=3 \{\
15340 . NUMBER_LINES RESUME
15341 . nr #LINENUMBERS 1
15346 \# ====================================================================
15353 \# <number of columns> <width of gutters>
15355 \# Creates registers associated with setting docs in columns.
15356 \# Calculates column line lengths and offsets
15358 \# COLUMNS, if used, s/b the last macro invoked before START.
15361 . if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
15363 . nr #NUM_COLS \\$1
15364 . nr #GUTTER (\\$2)
15365 . nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
15366 . nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
15368 . while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
15369 . nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
15370 . nr #COL_TOTAL \\n+[#COL_TOTAL]
15372 . if \\n[#NUM_COLS]=1 \{\
15373 . if !\\n[#COLLATE]=1 \{ .MN_INIT \}
15385 \# Breaks current column and moves to next column.
15386 \# If current column is the last on the page, breaks
15390 . if \\n[#COLUMNS] \{\
15392 . ie '\\$0'COL_NEXT' \{ .br \}
15397 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
15404 \# ====================================================================
15411 \# [ BULLET | DASH | DIGIT | alpha | ALPHA | roman | ROMAN | USER ] [ <separator> | NONE ] [ <prefix> ] [ <anything> ]
15413 \# Stores indent information in effect prior to invocation and
15414 \# initializes a list with the supplied enumerator (and separator).
15416 \# Default enumerator is a bullet.
15418 \# Enumerator *must* be supplied for every list that's to the
15419 \# right of another list, every time, unless the default bullet is
15422 \# <anything> moves back one list level intuitively, or exits lists
15423 \# completely if the level in which it's invoked is the first.
15426 . ds $1ST_LETTER \\$1
15427 . substring $1ST_LETTER 0 0
15428 . if '\\*[$1ST_LETTER]'r' .ds $1ST_LETTER R
15429 . ie '\\*[$1ST_LETTER]'R' \{\
15430 . ds $LAST_CHAR \\$1
15431 . substring $LAST_CHAR -1
15432 . if !\B'\\*[$LAST_CHAR]' \{\
15433 . if !'\\$1'ROMAN' \{\
15437 . if !'\\$1'roman' \{\
15441 . tm1 "[mom]: You must append a number to the \\$1 argument to LIST at line \\n(.c.
15442 . tm1 " The number should be the total number of items in this list.
15443 . tm1 " See the documentation.
15446 . ds $ROMAN_WIDTH \\$1
15447 . substring $ROMAN_WIDTH 1
15448 . while !\B'\\*[$ROMAN_WIDTH]' \{\
15449 . substring $ROMAN_WIDTH 1
15451 . length #ROMAN_LENGTH \\*[$ROMAN_WIDTH]
15452 . ds $LIST_ARG_1 \\$1
15453 . substring $LIST_ARG_1 0 -(\\n[#ROMAN_LENGTH]+1)
15456 . ds $LIST_ARG_1 \\$1
15459 . nr #STORED_HL_INDENT \\n[#HL_INDENT]
15460 . nr #STORED_T_INDENT \\n[#T_INDENT]
15461 . nr #CURRENT_L_LENGTH \\n(.l
15463 . if \\n[#INDENT_ACTIVE]=1 \{\
15464 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
15465 . nr #STORED_L_INDENT \\n[#L_INDENT]
15466 . nr #RESTORE_PREV_INDENT 1
15468 . if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
15469 . nr #STORED_BL_INDENT \\n[#BL_INDENT]
15470 . nr #STORED_BR_INDENT \\n[#BR_INDENT]
15472 . nr #ORIG_L_LENGTH \\n(.l
15474 . nr #RESTORE_PREV_INDENT 2
15476 . if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
15477 . nr #STORED_R_INDENT \\n[#R_INDENT]
15479 . nr #ORIG_L_LENGTH \\n(.l
15481 . nr #RESTORE_PREV_INDENT 3
15482 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{ .nr #RESTORE_PREV_INDENT 4 \}
15486 . if \\n[#NUM_ARGS]=0 \{\
15487 . nr #ARGS_TO_LIST 1 \" So default behaves as if LIST BULLET
15488 . ds $ENUMERATOR\\n+[#DEPTH] \(bu
15489 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
15492 . if \\n[#NUM_ARGS]>0 \{\
15493 . rr #ARGS_TO_LIST \" Clear this before processing arg 1.
15494 . if '\\*[$LIST_ARG_1]'DASH' \{\
15495 . nr #ARGS_TO_LIST 1
15496 . ds $ENUMERATOR\\n+[#DEPTH] \(en
15497 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
15498 . ds $SEPARATOR\\n[#DEPTH]
15500 . if '\\*[$LIST_ARG_1]'BULLET' \{\
15501 . nr #ARGS_TO_LIST 1
15502 . ds $ENUMERATOR\\n+[#DEPTH] \(bu
15503 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
15504 . ds $SEPARATOR\\n[#DEPTH]
15506 . if '\\*[$LIST_ARG_1]'DIGIT' \{\
15507 . nr #ARGS_TO_LIST 1
15508 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15509 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
15510 . ds $SEPARATOR\\n[#DEPTH] .
15511 . ds $PREFIX\\n[#DEPTH]
15512 . if \\n[#NUM_ARGS]>=2 \{\
15513 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15514 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15515 . if \\n[#NUM_ARGS]=3 \{\
15516 . ds $PREFIX\\n[#DEPTH] \\$3
15520 . if '\\*[$LIST_ARG_1]'alpha' \{\
15521 . nr #ARGS_TO_LIST 1
15522 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15523 . af #ENUMERATOR\\n[#DEPTH] a
15524 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
15525 . ds $SEPARATOR\\n[#DEPTH] )
15526 . ds $PREFIX\\n[#DEPTH]
15527 . if \\n[#NUM_ARGS]>=2 \{\
15528 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15529 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15530 . if \\n[#NUM_ARGS]=3 \{\
15531 . ds $PREFIX\\n[#DEPTH] \\$3
15535 . if '\\*[$LIST_ARG_1]'ALPHA' \{\
15536 . nr #ARGS_TO_LIST 1
15537 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15538 . af #ENUMERATOR\\n[#DEPTH] A
15539 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
15540 . ds $SEPARATOR\\n[#DEPTH] )
15541 . ds $PREFIX\\n[#DEPTH]
15542 . if \\n[#NUM_ARGS]>=2 \{\
15543 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15544 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15545 . if \\n[#NUM_ARGS]=3 \{\
15546 . ds $PREFIX\\n[#DEPTH] \\$3
15550 . if '\\*[$1ST_LETTER]'R' \{\
15551 . nr #ARGS_TO_LIST 1
15552 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15553 . if '\\*[$LIST_ARG_1]'roman' \{\
15554 . af #ENUMERATOR\\n[#DEPTH] i
15556 . if '\\*[$LIST_ARG_1]'ROMAN' \{\
15557 . af #ENUMERATOR\\n[#DEPTH] I
15559 . ds $ENUMERATOR_TYPE\\n[#DEPTH] roman
15560 . ds $SEPARATOR\\n[#DEPTH] )
15561 . ds $PREFIX\\n[#DEPTH]
15562 . if \\n[#NUM_ARGS]>=2 \{\
15563 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15564 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15565 . if \\n[#NUM_ARGS]=3 \{\
15566 . ds $PREFIX\\n[#DEPTH] \\$3
15570 . if '\\*[$LIST_ARG_1]'USER' \{\
15571 . nr #ARGS_TO_LIST 1
15572 . ds $ENUMERATOR\\n+[#DEPTH] \\$2
15573 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
15574 . ds $SEPARATOR\\n[#DEPTH]
15575 . ds $PREFIX\\n[#DEPTH]
15577 . if \\n[#NUM_ARGS]=1 \{\
15578 . if !r#ARGS_TO_LIST \{\
15579 . ie \\n[#DEPTH]=1 \{\
15580 . ie \\n[#NEXT_DEPTH_BACK]=0 \{\
15582 . if \\n[#QUIT]=1 \{\
15600 . nr #TOTAL_LISTS \\n[#DEPTH]
15601 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
15602 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]m\\*[$SEPARATOR\\n[#DEPTH]]\ '
15603 . if '\\*[$LIST_ARG_1]'ALPHA'\{\
15604 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]M\\*[$SEPARATOR\\n[#DEPTH]]\ '
15607 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
15610 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \{\
15611 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$ENUMERATOR\\n[#DEPTH]]\0'
15613 . ll \\n[#CURRENT_L_LENGTH]u
15614 . ie \\n[#DEPTH]=1 \{\
15615 . ie \\n[#INDENT_ACTIVE]=1 \{\
15616 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
15617 . nr #L_INDENT \\n[#L_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
15618 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15619 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
15621 . if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
15622 . nr #L_INDENT \\n[#BL_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
15623 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15624 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
15626 . if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
15627 . ie \\n[#INDENT_LEFT_ACTIVE]=1 \{\
15628 . \" Don't do anything; we already have a left indent
15631 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15632 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15637 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15638 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15642 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15643 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15653 \# Prints enumerator for a given list depth and prepares mom to
15654 \# receive the text of an item.
15657 . if !r#DEPTH \{ .return \}
15658 . if \\n[#LINENUMBERS]=1 \{\
15660 . nr #LINENUMBERS 2
15662 . if \\n[#KERN]=1 \{\
15663 . nr #KERN_WAS_ON 1
15667 . ll \\n[#CURRENT_L_LENGTH]u \" Set ll again because IL turns IB off.
15669 . HI \\n[#HL_INDENT\\n[#DEPTH]]u
15670 . if '\\*[$SEPARATOR\\n[#DEPTH]]')' \{ .nr #SEP_TYPE 1 \}
15671 . if '\\*[$SEPARATOR\\n[#DEPTH]]']' \{ .nr #SEP_TYPE 1 \}
15672 . if '\\*[$SEPARATOR\\n[#DEPTH]]'}' \{ .nr #SEP_TYPE 1 \}
15673 . ie \\n[#IN_BIB_LIST]=1 \{\
15674 . ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
15675 . ie \\n[#SEP_TYPE]=1 \{\
15676 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15679 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15683 . ie \\n[#SEP_TYPE]=1 \{\
15684 . PRINT \h'-\w'\0'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15687 . PRINT \h'-\w'\0'u'\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15692 . ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
15694 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
15695 . ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
15696 . ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
15697 . ie \\n[#SEP_TYPE]=1 \{\
15698 . PRINT \0\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15701 . PRINT \0\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15705 . ie \\n[#SEP_TYPE]=1 \{\
15706 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15709 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15714 . ie \\n[#SEP_TYPE]=1 \{\
15715 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15718 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15724 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'A' \{\
15725 . ie \\n[#SEP_TYPE]=1 \{\
15726 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15729 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15734 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15738 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
15739 . ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
15740 .\" ROMAN I, padded
15741 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
15742 . ie \\n[#SEP_TYPE]=1 \{\
15743 . 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'
15746 . 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]]
15749 .\" roman i, padded
15751 . 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]]
15756 .\" ROMAN I, no pad
15757 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
15758 . ie \\n[#SEP_TYPE]=1 \{\
15759 . PRINT \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15762 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15765 .\" roman i, no pad
15767 . PRINT \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15771 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \{\
15772 . PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15777 . if \\n[#REF]=1 \{\
15778 . IL +\\*[$REF_BIB_INDENT]
15779 . ti \\n[#L_INDENT]u-\\*[$REF_BIB_INDENT]
15782 . if \\n[#KERN_WAS_ON]=1 \{\
15786 . if \\n[#LINENUMBERS]=2 \{\
15787 . NUMBER_LINES RESUME
15788 . nr #LINENUMBERS 1
15792 \# A utility macro that determines the space to reserve for
15793 \# roman numeral enumerated lists. Limit is 20 roman numerals
15794 \# per list. If this isn't enough, the user can add to the
15797 .MAC GET_ROMAN_INDENT END
15798 . if '\\*[$LIST_ARG_1]'roman' \{\
15799 . if '\\*[$ROMAN_WIDTH]'1' \{\
15800 . ds $ROMAN_WIDTH\\n[#DEPTH] 1
15801 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]i\\*[$SEPARATOR\\n[#DEPTH]]\0'
15803 . if '\\*[$ROMAN_WIDTH]'2' \{\
15804 . ds $ROMAN_WIDTH\\n[#DEPTH] 2
15805 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]ii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15807 . if '\\*[$ROMAN_WIDTH]'3' \{\
15808 . ds $ROMAN_WIDTH\\n[#DEPTH] 3
15809 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15811 . if '\\*[$ROMAN_WIDTH]'4' \{\
15812 . ds $ROMAN_WIDTH\\n[#DEPTH] 4
15813 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15815 . if '\\*[$ROMAN_WIDTH]'5' \{\
15816 . ds $ROMAN_WIDTH\\n[#DEPTH] 5
15817 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15819 . if '\\*[$ROMAN_WIDTH]'6' \{\
15820 . ds $ROMAN_WIDTH\\n[#DEPTH] 6
15821 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15823 . if '\\*[$ROMAN_WIDTH]'7' \{\
15824 . ds $ROMAN_WIDTH\\n[#DEPTH] 7
15825 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]vii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15827 . if '\\*[$ROMAN_WIDTH]'8' \{\
15828 . ds $ROMAN_WIDTH\\n[#DEPTH] 8
15829 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15831 . if '\\*[$ROMAN_WIDTH]'9' \{\
15832 . ds $ROMAN_WIDTH\\n[#DEPTH] 9
15833 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15835 . if '\\*[$ROMAN_WIDTH]'10' \{\
15836 . ds $ROMAN_WIDTH\\n[#DEPTH] 10
15837 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15839 . if '\\*[$ROMAN_WIDTH]'11' \{\
15840 . ds $ROMAN_WIDTH\\n[#DEPTH] 11
15841 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15843 . if '\\*[$ROMAN_WIDTH]'12' \{\
15844 . ds $ROMAN_WIDTH\\n[#DEPTH] 12
15845 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15847 . if '\\*[$ROMAN_WIDTH]'13' \{\
15848 . ds $ROMAN_WIDTH\\n[#DEPTH] 13
15849 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15851 . if '\\*[$ROMAN_WIDTH]'14' \{\
15852 . ds $ROMAN_WIDTH\\n[#DEPTH] 14
15853 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15855 . if '\\*[$ROMAN_WIDTH]'15' \{\
15856 . ds $ROMAN_WIDTH\\n[#DEPTH] 15
15857 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15859 . if '\\*[$ROMAN_WIDTH]'16' \{\
15860 . ds $ROMAN_WIDTH\\n[#DEPTH] 16
15861 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15863 . if '\\*[$ROMAN_WIDTH]'17' \{\
15864 . ds $ROMAN_WIDTH\\n[#DEPTH] 17
15865 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xvii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15867 . if '\\*[$ROMAN_WIDTH]'18' \{\
15868 . ds $ROMAN_WIDTH\\n[#DEPTH] 18
15869 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15871 . if '\\*[$ROMAN_WIDTH]'19' \{\
15872 . ds $ROMAN_WIDTH\\n[#DEPTH] 19
15873 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15875 . if '\\*[$ROMAN_WIDTH]'20' \{\
15876 . ds $ROMAN_WIDTH\\n[#DEPTH] 20
15877 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15880 . if '\\*[$LIST_ARG_1]'ROMAN' \{\
15881 . if '\\*[$ROMAN_WIDTH]'1' \{\
15882 . ds $ROMAN_WIDTH\\n[#DEPTH] 1
15883 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]I\\*[$SEPARATOR\\n[#DEPTH]]\0'
15885 . if '\\*[$ROMAN_WIDTH]'2' \{\
15886 . ds $ROMAN_WIDTH\\n[#DEPTH] 2
15887 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]II\\*[$SEPARATOR\\n[#DEPTH]]\0'
15889 . if '\\*[$ROMAN_WIDTH]'3' \{\
15890 . ds $ROMAN_WIDTH\\n[#DEPTH] 3
15891 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]III\\*[$SEPARATOR\\n[#DEPTH]]\0'
15893 . if '\\*[$ROMAN_WIDTH]'4' \{\
15894 . ds $ROMAN_WIDTH\\n[#DEPTH] 4
15895 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15897 . if '\\*[$ROMAN_WIDTH]'5' \{\
15898 . ds $ROMAN_WIDTH\\n[#DEPTH] 5
15899 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15901 . if '\\*[$ROMAN_WIDTH]'6' \{\
15902 . ds $ROMAN_WIDTH\\n[#DEPTH] 6
15903 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15905 . if '\\*[$ROMAN_WIDTH]'7' \{\
15906 . ds $ROMAN_WIDTH\\n[#DEPTH] 7
15907 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15909 . if '\\*[$ROMAN_WIDTH]'8' \{\
15910 . ds $ROMAN_WIDTH\\n[#DEPTH] 8
15911 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15913 . if '\\*[$ROMAN_WIDTH]'9' \{\
15914 . ds $ROMAN_WIDTH\\n[#DEPTH] 9
15915 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15917 . if '\\*[$ROMAN_WIDTH]'10' \{\
15918 . ds $ROMAN_WIDTH\\n[#DEPTH] 10
15919 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15921 . if '\\*[$ROMAN_WIDTH]'11' \{\
15922 . ds $ROMAN_WIDTH\\n[#DEPTH] 11
15923 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15925 . if '\\*[$ROMAN_WIDTH]'12' \{\
15926 . ds $ROMAN_WIDTH\\n[#DEPTH] 12
15927 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15929 . if '\\*[$ROMAN_WIDTH]'13' \{\
15930 . ds $ROMAN_WIDTH\\n[#DEPTH] 13
15931 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15933 . if '\\*[$ROMAN_WIDTH]'14' \{\
15934 . ds $ROMAN_WIDTH\\n[#DEPTH] 14
15935 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15937 . if '\\*[$ROMAN_WIDTH]'15' \{\
15938 . ds $ROMAN_WIDTH\\n[#DEPTH] 15
15939 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15941 . if '\\*[$ROMAN_WIDTH]'16' \{\
15942 . ds $ROMAN_WIDTH\\n[#DEPTH] 16
15943 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15945 . if '\\*[$ROMAN_WIDTH]'17' \{\
15946 . ds $ROMAN_WIDTH\\n[#DEPTH] 17
15947 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15949 . if '\\*[$ROMAN_WIDTH]'18' \{\
15950 . ds $ROMAN_WIDTH\\n[#DEPTH] 18
15951 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15953 . if '\\*[$ROMAN_WIDTH]'19' \{\
15954 . ds $ROMAN_WIDTH\\n[#DEPTH] 19
15955 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15957 . if '\\*[$ROMAN_WIDTH]'20' \{\
15958 . ds $ROMAN_WIDTH\\n[#DEPTH] 20
15959 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15967 \# <amount by which to indent a list to the right>
15969 \# Adds the value of the arg to the current list's indent.
15971 \# Requires a unit of measure.
15973 .MAC SHIFT_LIST END
15974 . nr #SHIFT_LIST\\n[#DEPTH] (\\$1)
15975 . nr #L_INDENT +\\n[#SHIFT_LIST\\n[#DEPTH]]
15984 \# Adds a figure space to a list's hanging and left indent. If
15985 \# LEFT is given, sets reg. #PAD_LIST_DIGITS to 1 for use in ITEM.
15987 .MAC PAD_LIST_DIGITS END
15988 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
15989 . nr #LIST_INDENT\\n[#DEPTH] +\\w'\\0'
15990 . nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#LIST_INDENT\\n-[#DEPTH]]
15991 . nr #HL_INDENT\\n+[#DEPTH] +\\w'\\n[#ENUMERATOR\\n[#DEPTH]]'
15992 . if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
15994 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'i' \{\
15995 . if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
15997 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
15998 . if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
16008 \# Resets register enumerators to 1 or a.
16010 .MAC RESET_LIST END
16011 . ie '\\$1'' \{ .nr #ENUMERATOR\\n[#DEPTH] 0 1 \}
16012 . el \{ .nr #ENUMERATOR\\n[#DEPTH] \\$1-1 1 \}
16021 \# Exits lists cleanly and restores any indents that were in
16022 \# effect prior to LIST.
16024 .MAC QUIT_LISTS END
16026 . nr #HL_INDENT \\n[#STORED_HL_INDENT]
16027 . nr #T_INDENT \\n[#STORED_T_INDENT]
16028 . rr #STORED_HL_INDENT
16029 . if \\n[#RESTORE_PREV_INDENT]=1 \{\
16030 . nr #L_INDENT \\n[#STORED_L_INDENT]
16032 . rr #STORED_L_INDENT
16034 . if \\n[#RESTORE_PREV_INDENT]=2 \{\
16035 . nr #BL_INDENT \\n[#STORED_BL_INDENT]
16036 . nr #BR_INDENT \\n[#STORED_BR_INDENT]
16037 . ll \\n[#ORIG_L_LENGTH]u
16039 . rr #STORED_BL_INDENT
16040 . rr #STORED_BR_INDENT
16042 . if \\n[#RESTORE_PREV_INDENT]=3 \{\
16043 . nr #R_INDENT \\n[#STORED_R_INDENT]
16044 . ll \\n[#ORIG_L_LENGTH]u
16046 . rr #STORED_R_INDENT
16048 . if \\n[#RESTORE_PREV_INDENT]=4 \{\
16049 . nr #R_INDENT \\n[#STORED_R_INDENT]
16050 . nr #L_INDENT \\n[#STORED_L_INDENT]
16051 . ll \\n[#ORIG_L_LENGTH]u
16054 . rr #STORED_R_INDENT
16055 . rr #STORED_L_INDENT
16057 .\" Clean up after exiting last depth of list
16059 . while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\
16060 . rr #LIST_INDENT\\n[#REMOVE]
16061 . rr #ENUMERATOR\\n[#REMOVE]
16062 . rm $ENUMERATOR\\n[#REMOVE]
16063 . rm $SEPARATOR\\n[#REMOVE]
16064 . rm $ENUMERATOR_TYPE\\n[#REMOVE]
16065 . rr #PAD_LIST_DIGITS\\n[#REMOVE]
16071 . rr #NEXT_DEPTH_BACK
16072 . rr #RESTORE_PREV_INDENT
16073 . rr #ORIG_L_LENGTH
16074 . rr #CURRENT_L_LENGTH
16083 \# Restores indent of prev. list in nested lists. Also sets the
16084 \# #QUIT register if an invocation of LIST OFF applies to the first
16087 .MAC SET_LIST_INDENT END
16088 . nr #NEXT_DEPTH_BACK \\n[#DEPTH]-1
16089 . if \\n[#NEXT_DEPTH_BACK]=0 \{\
16093 . nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#SHIFT_LIST\\n[#DEPTH]]
16094 . nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]]
16097 \# ====================================================================
16099 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
16106 \# Turns headers off (if on) and saves header state, sets register
16107 \# #COLLATE to 1 (toggle), and breaks to a new page.
16109 \# COLLATE exists primarily to allow putting multiple chapters in
16110 \# a single file, although it can be used for any document type. After
16111 \# COLLATE, any of the macros that normally precede START may be
16112 \# used, and should behave as expected.
16114 \# N.B.--the START macro *must* be used after COLLATE (and any other
16115 \# macros that alter mom's behaviour).
16118 . if ( (\\n[.t]-1) <= \\n[.v] ) \{ .nr #NO_BREAK 1 \}
16119 . ds $SAVED_PP_FT \\*[$PP_FT]
16121 . nr #PRE_COLLATE 1
16122 . nr #HEADER_STATE \\n[#HEADERS_ON]
16124 . if \\n[#DOC_HEADER]=2 \{ .nr #DOC_HEADER 1 \}
16125 . if \\n[#PAGE_NUM_V_POS]=1 \{\
16126 . nr #PAGINATION_STATE \\n[#PAGINATE]
16131 .\" Collect first doc's title for TOC
16132 . if \\n[#COLLATED_DOC]=0 \{\
16133 . ie \\n[#USER_SET_TITLE_ITEM] \{\
16134 . ds $FIRST_DOC_TITLE \\*[$USER_SET_TITLE_ITEM]\\|
16135 . rr #USER_SET_TITLE_ITEM
16136 . rm $USER_SET_TITLE_ITEM
16139 . ie \\n[#DOC_TYPE]=2 \{\
16140 . ie '\\*[$CHAPTER_TITLE]'' \{\
16141 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
16144 . ie '\\*[$CHAPTER]'' \{\
16145 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_TITLE]\\|
16148 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
16153 . ds $FIRST_DOC_TITLE \\*[$TITLE]\\|
16156 . if \\n[#TOC_AUTHORS]=1 \{\
16157 . ie '\\*[$TOC_AUTHORS]'' \{\
16158 . as $FIRST_DOC_TITLE /\\|\\*[$AUTHOR_1]\\|
16161 . as $FIRST_DOC_TITLE /\\|\\*[$TOC_AUTHORS]\\|
16165 . nr #COLLATED_DOC 1
16167 .\" End title collection for TOC
16168 . LL \\n[#DOC_L_LENGTH]u
16170 . nr #SAVED_DOC_LEAD \\n[#DOC_LEAD]
16171 . LS \\n[#DOC_LEAD]u
16176 . if \\n[#DEFER_PAGINATION] \{ .PAGINATE \}
16177 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
16178 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
16179 . rm $RESTORE_PAGENUM_STYLE
16181 . if \\n[#CH_NUM] \{ .nr #CH_NUM +1 \}
16190 . rr #PAGENUM_STYLE_SET
16199 \# <starting line number> [ <increment> [ <gutter> ] ]
16201 \# <anything> | RESUME
16203 \# Begin, suspend/turn off, or resume numbering of output lines.
16205 .MAC NUMBER_LINES END
16207 . if '\\n(.z'EPI_TEXT' \{ .return \}
16209 . tm1 "[mom]: NUMBER_LINES at line \\n(.c has no argument.
16210 . tm1 " Most likely, you have forgotten to give it a starting line number.
16211 . ab Aborting on NUMBER_LINES.
16213 . if !\\n[#LINENUMBERS]=2 \{ .nr #LINENUMBERS 1 \}
16214 .\" Test whether the first arg is a digit.
16218 . if !'\\n(.z'' \{ .nr #RESTORE_LN_NUM 1 \}
16220 . if '\\*[$LN_INC]'' .ds $LN_INC 1
16222 . el .ds $LN_INC \\$2
16224 . if '\\*[$LN_GUTTER]'' .ds $LN_GUTTER 2
16226 . el .ds $LN_GUTTER \\$3
16229 .\" In other words, the first arg was not a digit.
16231 . ie '\\$1'RESUME' \{\
16246 . if !\\n[#LINENUMBERS]=2 \{ .rr #LINENUMBERS \}
16251 . nm \\*[$LN_NUM] \\*[$LN_INC] \\*[$LN_GUTTER] -3-\\*[$LN_GUTTER]
16256 . if !'\\n(.z'' \{ .nr #DIVER_LN_OFF 1 \}
16262 \# LINENUMBER STYLE PARAMETERS
16263 \# ---------------------------
16267 \# Checks if any line numbering parameters have been set, and
16268 \# passes the args, if any, to the appropriate request. If a linenumber
16269 \# parameter is missing, passes the current value of the register
16270 \# associated with the request to the request. (Ensures that the
16271 \# same requests, called in NUMBER_LINES to reset the registers
16272 \# to their former values, stay at those values.)
16275 . ie d$LN_FAM \{ .fam \\*[$LN_FAM] \}
16276 . el \{ .fam \\n[.fam] \}
16277 . ie d$LN_FT \{ .ft \\*[$LN_FT] \}
16278 . el \{ .ft \\n[.sty] \}
16279 . ie d$LN_SIZE_CHANGE \{ .ps \\*[$LN_SIZE_CHANGE] \}
16280 . el \{ .ps \\n[.s] \}
16281 . ie d$LN_COLOR \{ .gcolor \\*[$LN_COLOR] \}
16282 . el \{ .gcolor \\n[.m] \}
16286 \# NUMBER QUOTE AND BLOCKQUOTE LINES AS PART OF RUNNING TEXT
16287 \# ---------------------------------------------------------
16289 \# <gutter> | <anything>
16291 \# Sets #(B)QUOTE_LN to 1 if no argument, or a single numeric
16292 \# argument, is given; otherwise, turns (BLOCK)QUOTE linenumbering
16295 \# #(B)QUOTE is checked for in QUOTE and BLOCKQUOTE.
16296 \# The single numeric argument allows establishing a different gutter from
16297 \# the one used for line numbers in running text.
16299 .MAC NUMBER_QUOTE_LINES END
16300 . ie \\n[#NUM_ARGS]=0 \{ .nr #QUOTE_LN 1 \}
16304 . ds $Q_LN_GUTTER \\$1
16307 . ie '\\$1'SILENT' \{ .nr #SILENT_QUOTE_LN 1 \}
16310 . rr #SILENT_QUOTE_LN
16317 .MAC NUMBER_BLOCKQUOTE_LINES END
16318 . ie \\n[#NUM_ARGS]=0 \{ .nr #BQUOTE_LN 1 \}
16322 . ds $BQ_LN_GUTTER \\$1
16325 . ie '\\$1'SILENT' \{ .nr #SILENT_BQUOTE_LN 1 \}
16328 . rr #SILENT_BQUOTE_LN
16334 \# OUTPUT BLANK PAGES
16335 \# ------------------
16337 \# <number of blank pages to output> [ NULL ]
16339 \# Outputs blank pages.
16341 \# If recto/verso, each page is recto/verso, even if there's
16344 \# The argument to BLANKPAGE is non-optional.
16347 . nr #HOW_MANY \\$1
16349 . while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
16350 . if \\n[#HEADERS_ON]=1 \{\
16351 . nr #HEADERS_WERE_ON 1
16354 . if \\n[#PAGE_NUM_V_POS]=1 \{\
16355 . if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
16360 . if \\n[#FOOTERS_ON]=1 \{\
16361 . nr #FOOTERS_WERE_ON 1
16364 . if \\n[#PAGE_NUM_V_POS]=2 \{\
16365 . if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
16368 . if \\n[#HEADERS_WERE_ON] \{ .HEADERS \}
16369 . if \\n[#PAGE_NUM_V_POS]=1 \{\
16370 . if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
16374 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \}
16375 . if \\n[#PAGE_NUM_V_POS]=2 \{\
16376 . if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
16378 . if \\n[#PAGINATE]=1 \{\
16379 . if '\\$2'NULL' \{ .nr #PAGE_NUM_ADJ -\\n[#HOW_MANY] \}
16382 . rr #HEADERS_WERE_ON
16383 . rr #FOOTERS_WERE_ON
16384 . rr #PAGINATE_WAS_ON
16388 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
16389 \# ---------------------------------------
16393 \# Sets header/footer/footnotes/etc... traps.
16395 \# Calculates the number of lines that actually fit on a
16396 \# page based on #B_MARGIN and resets page bottom trap to coincide
16397 \# with the depth of that number of lines, or, if #ADJ_DOC_LEAD=1,
16398 \# adjusts #DOC_LEAD so that the last line of text on a page falls
16399 \# exactly on #B_MARGIN.
16402 .\" Remove all header/footer traps
16403 . if !\\n[#NO_TRAP_RESET] \{\
16408 . ch FN_OVERFLOW_TRAP
16409 .\" Plant header trap
16412 .\" Adjust lead so last line of text falls on B_MARGIN,...
16413 . ie \\n[#ADJ_DOC_LEAD]=1 \{\
16414 . nr #LINES_PER_PAGE 0 1
16415 . nr #DOC_LEAD_ADJ 0 1
16416 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#ORIGINAL_B_MARGIN]-1v
16417 .\" Get the number of unadjusted lines that fit on the page; always a
16418 .\" bit short of the bottom margin
16419 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
16422 . nr #LINES_PER_PAGE -1
16423 .\" Add machine units, 1 at a time, increasing the leading until the
16424 .\" new leading fills the page properly
16425 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
16428 . DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
16429 .\" The "visual" bottom margin is what \n(nl would report on the
16430 .\" last line before the FOOTER trap is sprung
16431 . nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD])
16432 .\" Get the difference between #B_MARGIN and #VISUAL_B_MARGIN
16433 . nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
16434 .\" Set #B_MARGIN to 1 machine unit lower on the page than #VISUAL_B_MARGIN
16435 . nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
16436 .\" Set the FN_OVERFLOW_TRAP position
16437 . nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
16438 . if \\n[#PRINT_STYLE]=1 .nr #FN_OVERFLOW_TRAP_POS \\n[#ORIGINAL_B_MARGIN]u
16440 .\" ...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
16443 . nr #LINES_PER_PAGE 0 1
16444 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
16445 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
16448 . nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD]-1v)
16449 . nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
16450 . nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
16451 . nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
16453 .\" Set footer and footnote overflow traps
16454 . if !\\n[#NO_TRAP_RESET] \{\
16456 . nr #SPACE_REMAINING 0
16458 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
16459 . wh \\n(.pu FOOTER
16460 . wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
16461 . ch FOOTER -\\n[#B_MARGIN]u
16471 \# Adds left, right, or both indent values to document elements
16472 \# like heads and subheads that are processed in environments.
16474 .MAC CHECK_INDENT END
16475 . if \\n[#INDENT_LEFT_ACTIVE] \{\
16476 . in \\n[#L_INDENT]u
16477 . if \\n[#QUOTE] \{\
16478 . in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
16479 . ll -\\n[#L_INDENT]u
16482 . if \\n[#EPIGRAPH] \{\
16483 . in -\\n[#L_INDENT]u
16484 . ll -\\n[#L_INDENT]u
16488 . if \\n[#INDENT_RIGHT_ACTIVE] \{\
16489 . ll -\\n[#R_INDENT]u
16492 . if \\n[#INDENT_BOTH_ACTIVE] \{\
16493 . in \\n[#BL_INDENT]u
16494 . ll -\\n[#BR_INDENT]u
16496 . if \\n[#QUOTE] \{\
16497 . in -\\n[#BL_INDENT]u
16498 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
16499 . ll -\\n[#BR_INDENT]u
16503 . ll -(\\n[#BR_INDENT]u/2u)
16507 . if \\n[#EPIGRAPH] \{\
16508 . in -\\n[#BL_INDENT]u
16509 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
16510 . ll -\\n[#BR_INDENT]u
16514 . ll -(\\n[#BR_INDENT]u/2u)
16527 \# Removes left, right, or both indent values from document elements
16528 \# like heads and subheads that are processed in environments.
16530 .MAC REMOVE_INDENT END
16532 . ll \\n[#L_LENGTH]u
16537 \# This .em (for all DOC_TYPEs except 4 [LETTER]) ensures that
16538 \# deferred footnotes that happen on the 2nd to last page get
16542 . ie \\n[#FN_DEPTH] \{\
16543 . ie \\n[#FN_DEFER] \{\
16552 . ch FN_OVERFLOW_TRAP
16558 . ch FN_OVERFLOW_TRAP
16563 \# END MACRO FOR LETTERS
16564 \# ---------------------
16568 \# The .em macro executed at the end of letters. Turns footers
16569 \# and pagination off, terminates and outputs diversion CLOSING
16570 \# (indented with the author's name underneath).
16576 . if \\n[#DOC_TYPE]=4 \{\
16578 . if !'\\n(.z'' \{ .di \}
16581 . TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
16582 . ALD \\n[#DOC_LEAD]u*2u
16584 . if \\n[#CLOSING] \{\
16588 . ALD \\n[#DOC_LEAD]u*3u
16589 . PRINT \\*[$AUTHOR_1]
16594 \# Set up a default papersize of US letter
16598 \# ====================================================================
16600 \# +++DOCUMENT PROCESSING ALIASES+++
16602 \# Aliases to make life easier for users: synonyms, short forms
16603 \# and alternate spellings.
16605 .ALIAS BREAK_BLOCKQUOTE BREAK_QUOTE
16606 .ALIAS BREAK_CITATION BREAK_QUOTE
16607 .ALIAS BREAK_CITE BREAK_QUOTE
16608 .ALIAS BLOCKQUOTE_INDENT QUOTE_INDENT
16609 .ALIAS CITATION BLOCKQUOTE
16610 .ALIAS CITATION_FAMILY BLOCKQUOTE_FAMILY
16611 .ALIAS CITATION_FONT BLOCKQUOTE_FONT
16612 .ALIAS CITATION_SIZE BLOCKQUOTE_SIZE
16613 .ALIAS CITATION_COLOR BLOCKQUOTE_COLOR
16614 .ALIAS CITATION_QUAD BLOCKQUOTE_QUAD
16615 .ALIAS CITE BLOCKQUOTE
16616 .ALIAS CITE_FAMILY BLOCKQUOTE_FAMILY
16617 .ALIAS CITE_FONT BLOCKQUOTE_FONT
16618 .ALIAS CITE_SIZE BLOCKQUOTE_SIZE
16619 .ALIAS CITE_COLOR BLOCKQUOTE_COLOR
16620 .ALIAS CITE_QUAD BLOCKQUOTE_QUAD
16621 .ALIAS DOC_R_MARGIN DOC_RIGHT_MARGIN
16622 .ALIAS DOC_L_MARGIN DOC_LEFT_MARGIN
16623 .ALIAS DOC_L_LENGTH DOC_LINE_LENGTH
16624 .ALIAS DOC_RMARGIN DOC_RIGHT_MARGIN
16625 .ALIAS DOC_LMARGIN DOC_LEFT_MARGIN
16626 .ALIAS DOC_LLENGTH DOC_LINE_LENGTH
16627 .ALIAS DOC_FAM DOC_FAMILY
16628 .ALIAS DOC_LS DOC_LEAD
16629 .ALIAS DOC_PS DOC_PT_SIZE
16631 .ALIAS PAGENUM PAGENUMBER
16632 .ALIAS PAGINATION PAGINATE
16633 .ALIAS PP_FT PP_FONT
16634 .ALIAS REF_INDENT INDENT_REFS
16635 .ALIAS TOC_PS TOC_PT_SIZE
16637 \# HEADER and FOOTER macros
16638 \# ------------------------
16639 \# Because the type-style of headers and footers are managed
16640 \# identically, and the type-style macros (_<type parameter>) all
16641 \# require the correct name of the calling macro, it's necessary
16642 \# to create HEADER_ and FOOTER_ macros here. They're basically
16643 \# "aliases" of HDRFTR_, but required because you can't alias an
16646 .MAC FOOTER_CENTER_COLOR END
16647 . HDRFTR_CENTER_COLOR \\$1
16650 .MAC FOOTER_CENTER_COLOUR END
16651 . HDRFTR_CENTER_COLOR \\$1
16654 .MAC FOOTER_CENTER_FAM END
16655 . HDRFTR_CENTER_FAMILY \\$1
16658 .MAC FOOTER_CENTER_FAMILY END
16659 . HDRFTR_CENTER_FAMILY \\$1
16662 .MAC FOOTER_CENTER_FONT END
16663 . HDRFTR_CENTER_FONT \\$1
16666 .MAC FOOTER_CENTER_FT END
16667 . HDRFTR_CENTER_FONT \\$1
16670 .MAC FOOTER_CENTER_PS END
16671 . HDRFTR_CENTER_SIZE \\$1
16674 .MAC FOOTER_CENTER_SIZE END
16675 . HDRFTR_CENTER_SIZE \\$1
16678 .MAC FOOTER_CENTRE_CAPS END
16679 . HDRFTR_CENTER_CAPS \\$1
16682 .MAC FOOTER_CENTRE_COLOR END
16683 . HDRFTR_CENTRE_COLOR \\$1
16686 .MAC FOOTER_CENTRE_COLOUR END
16687 . HDRFTR_CENTRE_COLOR \\$1
16690 .MAC FOOTER_CENTRE_FAM END
16691 . HDRFTR_CENTER_FAMILY \\$1
16694 .MAC FOOTER_CENTRE_FAMILY END
16695 . HDRFTR_CENTER_FAMILY \\$1
16698 .MAC FOOTER_CENTRE_FONT END
16699 . HDRFTR_CENTER_FONT \\$1
16702 .MAC FOOTER_CENTRE_FT END
16703 . HDRFTR_CENTER_FONT \\$1
16706 .MAC FOOTER_CENTRE_PS END
16707 . HDRFTR_CENTER_SIZE \\$1
16710 .MAC FOOTER_CENTRE_SIZE END
16711 . HDRFTR_CENTER_SIZE \\$1
16714 .MAC FOOTER_COLOR END
16715 . HDRFTR_COLOR \\$1
16718 .MAC FOOTER_COLOUR END
16719 . HDRFTR_COLOR \\$1
16722 .MAC FOOTER_FAM END
16723 . HDRFTR_FAMILY \\$1
16726 .MAC FOOTER_FAMILY END
16727 . HDRFTR_FAMILY \\$1
16730 .MAC FOOTER_LEFT_COLOR END
16731 . HDRFTR_LEFT_COLOR \\$1
16734 .MAC FOOTER_LEFT_COLOUR END
16735 . HDRFTR_LEFT_COLOR \\$1
16738 .MAC FOOTER_LEFT_FAM END
16739 . HDRFTR_LEFT_FAMILY \\$1
16742 .MAC FOOTER_LEFT_FAMILY END
16743 . HDRFTR_LEFT_FAMILY \\$1
16746 .MAC FOOTER_LEFT_FONT END
16747 . HDRFTR_LEFT_FONT \\$1
16750 .MAC FOOTER_LEFT_FT END
16751 . HDRFTR_LEFT_FONT \\$1
16754 .MAC FOOTER_LEFT_PS END
16755 . HDRFTR_LEFT_SIZE \\$1
16758 .MAC FOOTER_LEFT_SIZE END
16759 . HDRFTR_LEFT_SIZE \\$1
16762 .MAC FOOTER_RIGHT_COLOR END
16763 . HDRFTR_RIGHT_COLOR \\$1
16766 .MAC FOOTER_RIGHT_COLOUR END
16767 . HDRFTR_RIGHT_COLOR \\$1
16770 .MAC FOOTER_RIGHT_FAM END
16771 . HDRFTR_RIGHT_FAMILY \\$1
16774 .MAC FOOTER_RIGHT_FAMILY END
16775 . HDRFTR_RIGHT_FAMILY \\$1
16778 .MAC FOOTER_RIGHT_FONT END
16779 . HDRFTR_RIGHT_FONT \\$1
16782 .MAC FOOTER_RIGHT_FT END
16783 . HDRFTR_RIGHT_FONT \\$1
16786 .MAC FOOTER_RIGHT_PS END
16787 . HDRFTR_RIGHT_SIZE \\$1
16790 .MAC FOOTER_RIGHT_SIZE END
16791 . HDRFTR_RIGHT_SIZE \\$1
16794 .MAC FOOTER_RULE_COLOR END
16795 . HDRFTR_RULE_COLOR \\$1
16798 .MAC FOOTER_SIZE END
16802 .MAC HEADER_CENTER_COLOR END
16803 . HDRFTR_CENTER_COLOR \\$1
16806 .MAC HEADER_CENTER_COLOUR END
16807 . HDRFTR_CENTER_COLOR \\$1
16810 .MAC HEADER_CENTER_FAM END
16811 . HDRFTR_CENTER_FAMILY \\$1
16814 .MAC HEADER_CENTER_FAMILY END
16815 . HDRFTR_CENTER_FAMILY \\$1
16818 .MAC HEADER_CENTER_FONT END
16819 . HDRFTR_CENTER_FONT \\$1
16822 .MAC HEADER_CENTER_FT END
16823 . HDRFTR_CENTER_FONT \\$1
16826 .MAC HEADER_CENTER_PS END
16827 . HDRFTR_CENTER_SIZE \\$1
16830 .MAC HEADER_CENTER_SIZE END
16831 . HDRFTR_CENTER_SIZE \\$1
16834 .MAC HEADER_CENTRE_COLOR END
16835 . HDRFTR_CENTRE_COLOR \\$1
16838 .MAC HEADER_CENTRE_COLOUR END
16839 . HDRFTR_CENTRE_COLOR \\$1
16842 .MAC HEADER_CENTRE_FAM END
16843 . HDRFTR_CENTER_FAMILY \\$1
16846 .MAC HEADER_CENTRE_FAMILY END
16847 . HDRFTR_CENTER_FAMILY \\$1
16850 .MAC HEADER_CENTRE_FONT END
16851 . HDRFTR_CENTER_FONT \\$1
16854 .MAC HEADER_CENTRE_FT END
16855 . HDRFTR_CENTER_FONT \\$1
16858 .MAC HEADER_CENTRE_PS END
16859 . HDRFTR_CENTER_SIZE \\$1
16862 .MAC HEADER_CENTRE_SIZE END
16863 . HDRFTR_CENTER_SIZE \\$1
16866 .MAC HEADER_COLOR END
16867 . HDRFTR_COLOR \\$1
16870 .MAC HEADER_COLOUR END
16871 . HDRFTR_COLOR \\$1
16874 .MAC HEADER_FAM END
16875 . HDRFTR_FAMILY \\$1
16878 .MAC HEADER_FAMILY END
16879 . HDRFTR_FAMILY \\$1
16882 .MAC HEADER_LEFT_COLOR END
16883 . HDRFTR_LEFT_COLOR \\$1
16886 .MAC HEADER_LEFT_COLOUR END
16887 . HDRFTR_LEFT_COLOR \\$1
16890 .MAC HEADER_LEFT_FAM END
16891 . HDRFTR_LEFT_FAMILY \\$1
16894 .MAC HEADER_LEFT_FAMILY END
16895 . HDRFTR_LEFT_FAMILY \\$1
16898 .MAC HEADER_LEFT_FONT END
16899 . HDRFTR_LEFT_FONT \\$1
16902 .MAC HEADER_LEFT_FT END
16903 . HDRFTR_LEFT_FONT \\$1
16906 .MAC HEADER_LEFT_PS END
16907 . HDRFTR_LEFT_SIZE \\$1
16910 .MAC HEADER_LEFT_SIZE END
16911 . HDRFTR_LEFT_SIZE \\$1
16914 .MAC HEADER_RIGHT_COLOR END
16915 . HDRFTR_RIGHT_COLOR \\$1
16918 .MAC HEADER_RIGHT_COLOUR END
16919 . HDRFTR_RIGHT_COLOR \\$1
16922 .MAC HEADER_RIGHT_FAM END
16923 . HDRFTR_RIGHT_FAMILY \\$1
16926 .MAC HEADER_RIGHT_FAMILY END
16927 . HDRFTR_RIGHT_FAMILY \\$1
16930 .MAC HEADER_RIGHT_FONT END
16931 . HDRFTR_RIGHT_FONT \\$1
16934 .MAC HEADER_RIGHT_FT END
16935 . HDRFTR_RIGHT_FONT \\$1
16938 .MAC HEADER_RIGHT_PS END
16939 . HDRFTR_RIGHT_SIZE \\$1
16942 .MAC HEADER_RIGHT_SIZE END
16943 . HDRFTR_RIGHT_SIZE \\$1
16946 .MAC HEADER_RULE_COLOR END
16947 . HDRFTR_RULE_COLOR \\$1
16950 .MAC HEADER_SIZE END
16954 \# HEADER and FOOTER aliases for HDRFTR macros.
16956 .ALIAS BIBLIOGRAPHY_FOOTER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
16957 .ALIAS BIBLIOGRAPHY_FOOTER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
16958 .ALIAS BIBLIOGRAPHY_HEADER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
16959 .ALIAS BIBLIOGRAPHY_HEADER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
16960 .ALIAS ENDNOTES_FOOTER_CENTER ENDNOTES_HDRFTR_CENTER
16961 .ALIAS ENDNOTES_FOOTER_CENTRE ENDNOTES_HDRFTR_CENTRE
16962 .ALIAS ENDNOTES_HEADER_CENTER ENDNOTES_HDRFTR_CENTER
16963 .ALIAS ENDNOTES_HEADER_CENTRE ENDNOTES_HDRFTR_CENTRE
16964 .ALIAS FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS
16965 .ALIAS FOOTER_CENTER HDRFTR_CENTER
16966 .ALIAS FOOTER_CENTER_PAD HDRFTR_CENTER_PAD
16967 .ALIAS FOOTER_CENTRE HDRFTR_CENTER
16968 .ALIAS FOOTER_CENTRE_PAD HDRFTR_CENTER_PAD
16969 .ALIAS FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS
16970 .ALIAS FOOTER_LEFT HDRFTR_LEFT
16971 .ALIAS FOOTER_PLAIN HDRFTR_PLAIN
16972 .ALIAS FOOTER_RECTO HDRFTR_RECTO
16973 .ALIAS FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
16974 .ALIAS FOOTER_RIGHT HDRFTR_RIGHT
16975 .ALIAS FOOTER_RULE_GAP HDRFTR_RULE_GAP
16976 .ALIAS FOOTER_RULE HDRFTR_RULE
16977 .ALIAS FOOTER_VERSO HDRFTR_VERSO
16978 .ALIAS HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS
16979 .ALIAS HEADER_CENTER HDRFTR_CENTER
16980 .ALIAS HEADER_CENTER_PAD HDRFTR_CENTER_PAD
16981 .ALIAS HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS
16982 .ALIAS HEADER_CENTRE HDRFTR_CENTER
16983 .ALIAS HEADER_CENTRE_PAD HDRFTR_CENTER_PAD
16984 .ALIAS HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS
16985 .ALIAS HEADER_LEFT HDRFTR_LEFT
16986 .ALIAS HEADER_PLAIN HDRFTR_PLAIN
16987 .ALIAS HEADER_RECTO HDRFTR_RECTO
16988 .ALIAS HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
16989 .ALIAS HEADER_RIGHT HDRFTR_RIGHT
16990 .ALIAS HEADER_RULE_GAP HDRFTR_RULE_GAP
16991 .ALIAS HEADER_RULE HDRFTR_RULE
16992 .ALIAS HEADER_VERSO HDRFTR_VERSO
16993 .ALIAS SWITCH_FOOTERS SWITCH_HDRFTR
16994 .ALIAS SWITCH_HEADERS SWITCH_HDRFTR
16996 \# Type-style aliases
16998 .ALIAS AUTHOR_FAMILY _FAMILY
16999 .ALIAS BIBLIOGRAPHY_FAMILY _FAMILY
17000 .ALIAS BIBLIOGRAPHY_STRING_FAMILY _FAMILY
17001 .ALIAS BLOCKQUOTE_FAMILY _FAMILY
17002 .ALIAS CHAPTER_TITLE_FAMILY _FAMILY
17003 .ALIAS COVER_AUTHOR_FAMILY _FAMILY
17004 .ALIAS COVER_CHAPTER_TITLE_FAMILY _FAMILY
17005 .ALIAS COVER_COPYRIGHT_FAMILY _FAMILY
17006 .ALIAS COVER_DOCTYPE_FAMILY _FAMILY
17007 .ALIAS COVER_FAMILY _FAMILY
17008 .ALIAS COVER_SUBTITLE_FAMILY _FAMILY
17009 .ALIAS COVER_TITLE_FAMILY _FAMILY
17010 .ALIAS DOC_COVER_AUTHOR_FAMILY _FAMILY
17011 .ALIAS DOC_COVER_CHAPTER_TITLE_FAMILY _FAMILY
17012 .ALIAS DOC_COVER_COPYRIGHT_FAMILY _FAMILY
17013 .ALIAS DOC_COVER_DOCTYPE_FAMILY _FAMILY
17014 .ALIAS DOC_COVER_FAMILY _FAMILY
17015 .ALIAS DOC_COVER_SUBTITLE_FAMILY _FAMILY
17016 .ALIAS DOC_COVER_TITLE_FAMILY _FAMILY
17017 .ALIAS DOCHEADER_FAMILY _FAMILY
17018 .ALIAS DOCTYPE_FAMILY _FAMILY
17019 .ALIAS ENDNOTE_FAMILY _FAMILY
17020 .ALIAS ENDNOTE_NUMBER_FAMILY _FAMILY
17021 .ALIAS ENDNOTE_LINENUMBER_FAMILY _FAMILY
17022 .ALIAS ENDNOTE_STRING_FAMILY _FAMILY
17023 .ALIAS ENDNOTE_TITLE_FAMILY _FAMILY
17024 .ALIAS EPIGRAPH_FAMILY _FAMILY
17025 .ALIAS FOOTNOTE_FAMILY _FAMILY
17026 .ALIAS HDRFTR_CENTER_FAMILY _FAMILY
17027 .ALIAS HDRFTR_FAMILY _FAMILY
17028 .ALIAS HDRFTR_LEFT_FAMILY _FAMILY
17029 .ALIAS HDRFTR_RIGHT_FAMILY _FAMILY
17030 .ALIAS HEAD_FAMILY _FAMILY
17031 .ALIAS LINENUMBER_FAMILY _FAMILY
17032 .ALIAS PAGENUM_FAMILY _FAMILY
17033 .ALIAS PARAHEAD_FAMILY _FAMILY
17034 .ALIAS QUOTE_FAMILY _FAMILY
17035 .ALIAS SUBHEAD_FAMILY _FAMILY
17036 .ALIAS SUBTITLE_FAMILY _FAMILY
17037 .ALIAS TITLE_FAMILY _FAMILY
17038 .ALIAS TOC_FAM _FAMILY
17039 .ALIAS TOC_FAMILY _FAMILY
17040 .ALIAS TOC_HEADER_FAMILY _FAMILY
17041 .ALIAS TOC_HEAD_FAMILY _FAMILY
17042 .ALIAS TOC_PARAHEAD_FAMILY _FAMILY
17043 .ALIAS TOC_PN_FAMILY _FAMILY
17044 .ALIAS TOC_SUBHEAD_FAMILY _FAMILY
17045 .ALIAS TOC_TITLE_FAMILY _FAMILY
17047 .ALIAS AUTHOR_FONT _FONT
17048 .ALIAS BIBLIOGRAPHY_STRING_FONT _FONT
17049 .ALIAS BIBLIOGRAPHY_FONT _FONT
17050 .ALIAS BLOCKQUOTE_FONT _FONT
17051 .ALIAS CHAPTER_TITLE_FONT _FONT
17052 .ALIAS COVER_AUTHOR_FONT _FONT
17053 .ALIAS COVER_CHAPTER_TITLE_FONT _FONT
17054 .ALIAS COVER_COPYRIGHT_FONT _FONT
17055 .ALIAS COVER_DOCTYPE_FONT _FONT
17056 .ALIAS COVER_SUBTITLE_FONT _FONT
17057 .ALIAS COVER_TITLE_FONT _FONT
17058 .ALIAS DOC_COVER_AUTHOR_FONT _FONT
17059 .ALIAS DOC_COVER_CHAPTER_TITLE_FONT _FONT
17060 .ALIAS DOC_COVER_COPYRIGHT_FONT _FONT
17061 .ALIAS DOC_COVER_DOCTYPE_FONT _FONT
17062 .ALIAS DOC_COVER_SUBTITLE_FONT _FONT
17063 .ALIAS DOC_COVER_TITLE_FONT _FONT
17064 .ALIAS DOCTYPE_FONT _FONT
17065 .ALIAS ENDNOTE_FONT _FONT
17066 .ALIAS ENDNOTE_NUMBER_FONT _FONT
17067 .ALIAS ENDNOTE_LINENUMBER_FONT _FONT
17068 .ALIAS ENDNOTE_STRING_FONT _FONT
17069 .ALIAS ENDNOTE_TITLE_FONT _FONT
17070 .ALIAS EPIGRAPH_FONT _FONT
17071 .ALIAS FOOTNOTE_FONT _FONT
17072 .ALIAS HDRFTR_CENTER_FONT _FONT
17073 .ALIAS HDRFTR_LEFT_FONT _FONT
17074 .ALIAS HDRFTR_RIGHT_FONT _FONT
17075 .ALIAS HEAD_FONT _FONT
17076 .ALIAS LINENUMBER_FONT _FONT
17077 .ALIAS PAGENUM_FONT _FONT
17078 .ALIAS PARAHEAD_FONT _FONT
17079 .ALIAS QUOTE_FONT _FONT
17080 .ALIAS SUBHEAD_FONT _FONT
17081 .ALIAS SUBTITLE_FONT _FONT
17082 .ALIAS TITLE_FONT _FONT
17083 .ALIAS TOC_HEADER_FONT _FONT
17084 .ALIAS TOC_HEAD_FONT _FONT
17085 .ALIAS TOC_PARAHEAD_FONT _FONT
17086 .ALIAS TOC_PN_FONT _FONT
17087 .ALIAS TOC_SUBHEAD_FONT _FONT
17088 .ALIAS TOC_TITLE_FONT _FONT
17090 .ALIAS AUTHOR_SIZE _SIZE
17091 .ALIAS BIBLIOGRAPHY_STRING_SIZE _SIZE
17092 .ALIAS BLOCKQUOTE_SIZE _SIZE
17093 .ALIAS CHAPTER_TITLE_SIZE _SIZE
17094 .ALIAS COVER_AUTHOR_SIZE _SIZE
17095 .ALIAS COVER_CHAPTER_TITLE_SIZE _SIZE
17096 .ALIAS COVER_COPYRIGHT_SIZE _SIZE
17097 .ALIAS COVER_DOCTYPE_SIZE _SIZE
17098 .ALIAS COVER_SUBTITLE_SIZE _SIZE
17099 .ALIAS COVER_TITLE_SIZE _SIZE
17100 .ALIAS DOC_COVER_AUTHOR_SIZE _SIZE
17101 .ALIAS DOC_COVER_CHAPTER_TITLE_SIZE _SIZE
17102 .ALIAS DOC_COVER_COPYRIGHT_SIZE _SIZE
17103 .ALIAS DOC_COVER_DOCTYPE_SIZE _SIZE
17104 .ALIAS DOC_COVER_SUBTITLE_SIZE _SIZE
17105 .ALIAS DOC_COVER_TITLE_SIZE _SIZE
17106 .ALIAS DOCTYPE_SIZE _SIZE
17107 .ALIAS ENDNOTE_NUMBER_SIZE _SIZE
17108 .ALIAS ENDNOTE_LINENUMBER_SIZE _SIZE
17109 .ALIAS ENDNOTE_STRING_SIZE _SIZE
17110 .ALIAS ENDNOTE_TITLE_SIZE _SIZE
17111 .ALIAS EPIGRAPH_SIZE _SIZE
17112 .ALIAS FOOTNOTE_SIZE _SIZE
17113 .ALIAS HDRFTR_CENTER_SIZE _SIZE
17114 .ALIAS HDRFTR_LEFT_SIZE _SIZE
17115 .ALIAS HDRFTR_RIGHT_SIZE _SIZE
17116 .ALIAS HDRFTR_SIZE _SIZE
17117 .ALIAS HEAD_SIZE _SIZE
17118 .ALIAS LINENUMBER_SIZE _SIZE
17119 .ALIAS PAGENUM_SIZE _SIZE
17120 .ALIAS PARAHEAD_SIZE _SIZE
17121 .ALIAS QUOTE_SIZE _SIZE
17122 .ALIAS SUBHEAD_SIZE _SIZE
17123 .ALIAS SUBTITLE_SIZE _SIZE
17124 .ALIAS TITLE_SIZE _SIZE
17125 .ALIAS TOC_HEADER_SIZE _SIZE
17126 .ALIAS TOC_HEAD_SIZE _SIZE
17127 .ALIAS TOC_PARAHEAD_SIZE _SIZE
17128 .ALIAS TOC_PN_SIZE _SIZE
17129 .ALIAS TOC_SUBHEAD_SIZE _SIZE
17130 .ALIAS TOC_TITLE_SIZE _SIZE
17132 .ALIAS ATTRIBUTE_COLOR _COLOR
17133 .ALIAS AUTHOR_COLOR _COLOR
17134 .ALIAS BLOCKQUOTE_COLOR _COLOR
17135 .ALIAS CHAPTER_TITLE_COLOR _COLOR
17136 .ALIAS COVER_ATTRIBUTE_COLOR _COLOR
17137 .ALIAS COVER_AUTHOR_COLOR _COLOR
17138 .ALIAS COVER_CHAPTER_TITLE_COLOR _COLOR
17139 .ALIAS COVER_COLOR _COLOR
17140 .ALIAS COVER_COPYRIGHT_COLOR _COLOR
17141 .ALIAS COVER_DOCTYPE_COLOR _COLOR
17142 .ALIAS COVER_MISC_COLOR _COLOR
17143 .ALIAS COVER_SUBTITLE_COLOR _COLOR
17144 .ALIAS COVER_TITLE_COLOR _COLOR
17145 .ALIAS DOC_COVER_ATTRIBUTE_COLOR _COLOR
17146 .ALIAS DOC_COVER_AUTHOR_COLOR _COLOR
17147 .ALIAS DOC_COVER_CHAPTER_TITLE_COLOR _COLOR
17148 .ALIAS DOC_COVER_COLOR _COLOR
17149 .ALIAS DOC_COVER_COPYRIGHT_COLOR _COLOR
17150 .ALIAS DOC_COVER_DOCTYPE_COLOR _COLOR
17151 .ALIAS DOC_COVER_MISC_COLOR _COLOR
17152 .ALIAS DOC_COVER_SUBTITLE_COLOR _COLOR
17153 .ALIAS DOC_COVER_TITLE_COLOR _COLOR
17154 .ALIAS DOCHEADER_COLOR _COLOR
17155 .ALIAS DOCTYPE_COLOR _COLOR
17156 .ALIAS EPIGRAPH_COLOR _COLOR
17157 .ALIAS FINIS_COLOR _COLOR
17158 .ALIAS FOOTNOTE_COLOR _COLOR
17159 .ALIAS HDRFTR_CENTER_COLOR _COLOR
17160 .ALIAS HDRFTR_COLOR _COLOR
17161 .ALIAS HDRFTR_LEFT_COLOR _COLOR
17162 .ALIAS HDRFTR_RIGHT_COLOR _COLOR
17163 .ALIAS HDRFTR_RULE_COLOR _COLOR
17164 .ALIAS HEAD_COLOR _COLOR
17165 .ALIAS LINEBREAK_COLOR _COLOR
17166 .ALIAS LINENUMBER_COLOR _COLOR
17167 .ALIAS PAGENUM_COLOR _COLOR
17168 .ALIAS PARAHEAD_COLOR _COLOR
17169 .ALIAS QUOTE_COLOR _COLOR
17170 .ALIAS SUBHEAD_COLOR _COLOR
17171 .ALIAS SUBTITLE_COLOR _COLOR
17172 .ALIAS TITLE_COLOR _COLOR
17174 .ALIAS BIBLIOGRAPHY_QUAD _QUAD
17175 .ALIAS BIBLIOGRAPHY_STRING_QUAD _QUAD
17176 .ALIAS BLOCKQUOTE_QUAD _QUAD
17177 .ALIAS COVER_COPYRIGHT_QUAD _QUAD
17178 .ALIAS COVER_MISC_QUAD _QUAD
17179 .ALIAS DOC_COVER_COPYRIGHT_QUAD _QUAD
17180 .ALIAS DOC_COVER_MISC_QUAD _QUAD
17181 .ALIAS DOC_QUAD _QUAD
17182 .ALIAS ENDNOTE_QUAD _QUAD
17183 .ALIAS ENDNOTE_STRING_QUAD _QUAD
17184 .ALIAS ENDNOTE_TITLE_QUAD _QUAD
17185 .ALIAS EPIGRAPH_QUAD _QUAD
17186 .ALIAS FOOTNOTE_QUAD _QUAD
17187 .ALIAS HEAD_QUAD _QUAD
17188 .ALIAS SUBHEAD_QUAD _QUAD
17189 .ALIAS TOC_HEADER_QUAD _QUAD
17193 .ALIAS COL_BREAK COL_NEXT
17194 .ALIAS DOC_COVER_ADVANCE COVER_ADVANCE
17195 .ALIAS DOC_COVER COVER
17196 .ALIAS DOC_COVERS COVERS
17197 .ALIAS DOC_COVER_LEAD COVER_LEAD
17198 .ALIAS DOC_COVERTITLE COVERTITLE
17199 .ALIAS DO_DOC_COVER DO_COVER
17200 .ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE
17202 \# Miscellaneous aliases
17203 .ALIAS SECTION LINEBREAK
17204 .ALIAS SECTION_CHAR LINEBREAK_CHAR
17206 \# Miscellaneous macros to take care of backward compatibility
17207 \# -----------------------------------------------------------
17209 \# As of 1.1.9, EL and TN got changed to make TRAP...TRAP OFF
17210 \# unnecessary for users. However, I used both macros extensively
17211 \# throughout this file (in conjunction with TRAP...TRAP OFF).
17212 \# EOL is the "old" EL, for the personal use of om.tmac
17224 \# Footnote references
17225 \# -------------------
17227 \# Instruct REF to put references in footnotes.
17229 .MAC FOOTNOTE_REFS END
17230 . if r#EN_REF \{ .rr #EN_REF \}
17234 \# Endnote references
17235 \# ------------------
17237 \# Instruct REF to collect references for endnotes output.
17239 .MAC ENDNOTE_REFS END
17240 . if r#FN_REF \{ .rr #FN_REF \}
17244 \# Prepare mom for a reference
17245 \# ---------------------------
17247 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value>
17249 \# Calls FOOTNOTE or ENDNOTE, depending on whether #REF_FN or
17250 \# #REF_EN is set to 1.
17252 \# For convenience, REF is a toggle.
17254 \# REF optionally takes the same arguments as FOOTNOTE, allowing
17255 \# users to indent references that go in footnotes when footnote
17256 \# indenting is required. FOOTNOTE_REFS must be on for this.
17259 . ie \\n[#FN_REF]+\\n[#EN_REF]=0 \{\
17260 . if !\\n[#REF_WARNING]=1 \{\
17261 . tm1 "[mom]: Before REF at line \\n(.c, neither FOOTNOTE_REFS nor ENDNOTE_REFS
17262 . tm1 " has been selected. If "sort" and "accumulate" are in your refer
17263 . tm1 " commands, references will be collected for later output with $LIST$.
17264 . tm1 " Otherwise, they will disappear.
17265 . nr #REF_WARNING 1
17269 . ie \\n[#REF]=1 \{\
17270 . if \\n[#FN_REF]=1 \{ .FOOTNOTE OFF \}
17271 . if \\n[#EN_REF]=1 \{ .ENDNOTE OFF \}
17277 . if \\n[#FN_REF]=1 \{ .FOOTNOTE \\$1 \\$2 \\$3 \}
17278 . if \\n[#EN_REF]=1 \{ .ENDNOTE \}
17283 \# Embedded references in text (with brackets)
17284 \# -------------------------------------------
17286 .MAC REF_BRACKETS_START END
17287 . ds $CURRENT_EV \\n[.ev]
17289 . evc \\*[$CURRENT_EV]
17293 .MAC REF_BRACKETS_END END
17298 . unformat REFERENCE
17299 . if '\\$0'REF)' \{ .nop (\\*[REFERENCE]) \}
17300 . if '\\$0'REF]' \{ .nop [\\*[REFERENCE]] \}
17301 . if '\\$0'REF}' \{ .nop {\\*[REFERENCE]} \}
17304 \# These three pairs of aliases allow users to embed references in
17305 \# text and have them surrounded by (), [] or {}.
17307 .ALIAS REF( REF_BRACKETS_START
17308 .ALIAS REF) REF_BRACKETS_END
17310 .ALIAS REF[ REF_BRACKETS_START
17311 .ALIAS REF{ REF_BRACKETS_START
17313 .ALIAS REF} REF_BRACKETS_END
17314 .ALIAS REF] REF_BRACKETS_END
17316 \# Second-line indent for refs
17317 \# ---------------------------
17319 \# FOOTNOTE | ENDNOTE | BIBLIO <indent for 2nd and subsequent lines of discrete reference entries>
17321 \# Sets strings $REF_FN_INDENT, $REF_EN_INDENT or $REF_BIB_INDENT.
17323 \# Indent value requires a unit of measure.
17325 .MAC INDENT_REFS END
17326 . if '\\$1'FOOTNOTE' .ds $REF_FN_INDENT \\$2
17327 . if '\\$1'ENDNOTE' .ds $REF_EN_INDENT \\$2
17328 . if '\\$1'BIBLIO' .ds $REF_BIB_INDENT \\$2
17331 \# Hyphenation of references
17332 \# -------------------------
17334 \# <none> | <anything>
17336 \# Sets register #REF_HY
17338 .MAC HYPHENATE_REFS END
17339 . ie '\\$1'' \{ .nr #REF_HY 1 \}
17341 . if r#REF_HY \{ .rr #REF_HY \}
17345 \# The remainder of the definitions in this section are modified
17346 \# versions of the definitions found in the refer module of s.tmac.
17348 \# This one is directly from s.tmac.
17351 .tm \\n(.F:\\n(.c: macro error: \\$*
17354 \# The following strings define the order of entries for different
17355 \# types of references. Each letter in the string refers to a database
17356 \# field (A for author, T1/T2 for article and book titles, etc).
17357 \# Mom is set up for MLA-style bibliographies. Other styles can be
17358 \# implemented here by re-ordering the fields.
17361 .ds ref*spec!2 Q A T1 d t l r E S e V a C I D P O
17362 \# Article within book - type 3
17363 .ds ref*spec!3 Q A T2 B d t l r E S e V a C I D P O
17364 \# Journal article - type 1
17365 .ds ref*spec!1 Q A T2 J S N D P O
17366 \# Tech report - type 4
17367 .ds ref*spec!4 Q A T1 R G C I D P O
17368 \# Internet site - type 0
17369 .ds ref*spec!0 Q A T2 s E c d o a u O
17371 \# Refer's "1st" macro. Since it is possible to define database
17372 \# fields using any single letter, we remove all possible string
17373 \# definitions of the form [X and [x
17376 .rm [A [B [C [D [E [F [G [H [I [J [K [L [M \
17377 [N [O [P [Q [R [S [T [U [V [W [X [Y [Z \
17378 . [a [b [c [d [e [f [g [h [i [j [k [l [m \
17379 [n [o [p [q [r [s [t [u [v [w [x [y [z
17384 \# Refer's "2nd" macro; builds up a reference with ref*build, and
17385 \# prints it with ref*print.
17389 .if \\n[ref*type]=3 \{\
17390 . if !'\\*([R'' \{\
17392 . ds ref*spec!4 Q A T2 B R C I D P O
17394 . if !'\\*([G'' \{\
17396 . ds ref*spec!4 Q A T2 B G C I D P O
17403 .ie d ref*spec!\\n[ref*type] .ref*build \\*[ref*spec!\\n[ref*type]]
17405 . @error unknown reference type `\\n[ref*type]'
17406 . ref*build \\*[ref*spec!0]
17408 .if !\\n[.hy]=0 \{\
17409 .nr #RESTORE_HY \\n[.hy]
17413 .if !\\n[#RESTORE_HY]=0 .hy \\n[#RESTORE_HY]
17419 \# Refer's "3rd" macros, which set up and terminate the output
17420 \# of collected references
17423 .als ref*print ref*end-print
17425 .if \\n[#BIB_LIST]=1 \{\
17426 . nr #IN_BIB_LIST 1
17427 . LIST DIGIT \\*[$BIB_LIST_SEPARATOR] \\*[$BIB_LIST_PREFIX]
17435 .als ref*print ref*normal-print
17441 \# Output normal, non-collected refs
17443 .de ref*normal-print
17444 .nr #CURRENT_HY \\n[.hy]
17448 \# Output collected refs
17451 .\" 10 is abritrary
17453 .ie \\n[#BIB_LIST]=0 \{\
17454 .in +\\*[$REF_BIB_INDENT]
17455 .ti -\\*[$REF_BIB_INDENT]
17459 .sp \\n[#BIB_SPACE]u
17460 .ie \\n[#BIB_LIST]=0 .in
17461 .el .IL -\\*[$REF_BIB_INDENT]u
17465 .als ref*print ref*normal-print
17467 \# Build up the ref*string
17469 \# Correct MLA "typewritten" style (printstyle TYPEWRITE) demands
17470 \# two spaces after each period. The spaces are hardwired into the
17471 \# string definitions (ref*add-<x>), so we have to make sure that there
17472 \# aren't two spaces when the printstyle is TYPESET. Since I find that
17473 \# references look a bit crowded with 0 sentence space, I've bumped it
17474 \# up to +4. User's sentence spacing is reset in FOOTNOTES and ENDNOTES.
17477 .if \\n[#PRINT_STYLE]=2 \{\
17478 . ds $RESTORE_SS_VAR \\*[$SS_VAR]
17481 \#.rm ref*string ref*post-punct
17483 .nr ref*suppress-period 1
17486 . ie d ref*add-\\$1 .ref*add-\\$1
17487 . el .ref*add-dflt \\$1
17491 .\" now add a final period
17492 .ie d ref*string \{\
17493 . if !\\n[ref*suppress-period] .as ref*string .
17494 . if d ref*post-punct \{\
17495 . as ref*string "\\*[ref*post-punct]
17496 . rm ref*post-punct
17502 \# The following macros determine how entries are formatted WRT
17503 \# punctuation, type style, additional strings, etc.
17505 \# o First argument is the database field letter.
17506 \# o Second argument is the punctuation character to use to separate this
17507 \# field from the previous field.
17508 \# o Third argument is a string with which to prefix this field.
17509 \# o Fourth argument is a string with which to postfix this field.
17510 \# o Fifth argument is a string to add after the punctuation character
17511 \# supplied by the next field.
17516 .if r [A .nr ref*suppress-period \\n([A
17518 \# %T Title (generic)
17520 .ref*field T . " \E*[IT]" "" \E*[PREV]
17521 .if \\n([T .nr ref*suppress-period \\n([T
17523 \# %T Title of a chapter or article
17525 .ref*field T . " \(lq" "" "\(rq"
17526 .if \\n([T .nr ref*suppress-period \\n([T
17528 \# %B Book title (when citing an article from a book)
17530 .ie \\n([T .ref*field B "" ".\E*[IT]" "" \E*[PREV]
17531 .el .ref*field B . " \E*[IT]" "" \E*[PREV]
17532 \# refer doesn't set reg [T to 1 for these book titles, so we do it here
17534 .substring eval*[B -1
17536 .if '\\*[eval*[B]'!' .nr [T 1
17537 .if '\\*[eval*[B]'?' .nr [T 1
17540 \# %R Report number for technical reports
17546 .ie \\n([T .ref*field J "" " \E*[IT]" "" \E*[PREV]
17547 .el .ref*field J . " \E*[IT]" "" \E*[PREV]
17551 .ie !\\n[ref*type]=0 \{\
17553 . ie \\n([T .ref*field E "" " Eds. "
17554 . el .ref*field E . " Eds. "
17557 . ie \\n([T .ref*field E "" " Ed. "
17558 . el .ref*field E . " Ed. "
17562 . ie \\n([T .ref*field E "" " "
17563 . el .ref*field E . " "
17569 .ie \\n([T .ref*field e "" " " " edition"
17570 .el .ref*field e . " " " edition"
17573 \# %V Volume (of a journal, or series of books)
17575 .if \\n[ref*type]=1 \{\
17578 .if \\n[ref*type]=2 \{\
17579 . ie \\n([T .ref*field V "" " "
17580 . el .ref*field V . " "
17582 .if \\n[ref*type]=3 \{\
17583 . ie \\n([T .ref*field V "" " "
17584 . el .ref*field V . " "
17588 \# %N Journal number
17592 \# %S Series (books or journals)
17594 .if \\n[ref*type]=1 \{\
17597 .if \\n[ref*type]=2 \{\
17598 . ie \\n([T .ref*field S "" " "
17599 . el .ref*field S . " "
17601 .if \\n[ref*type]=3 \{\
17602 . ie \\n([T .ref*field S "" " "
17603 . el .ref*field S . " "
17606 \# refer doesn't set reg [T to 1 for series titles, so we do it here
17608 .substring eval*[S -1
17609 .if '\\*[eval*[S]'!' .nr [T 1
17610 .if '\\*[eval*[S]'?' .nr [T 1
17615 .ie \\n([T .ref*field C "" " "
17616 .el .ref*field C . " "
17619 \# %I Publisher (I stands for Issuer)
17621 .ie !'\\*([C'' .ref*field I :
17623 . ie \\n([T .ref*field I "" " "
17624 . el .ref*field I . " "
17628 \# %D Date of publication
17630 .if \\n[ref*type]=1 \{\
17631 . ie !'\\*([V''.ref*field D "" "(" ")"
17634 .if \\n[ref*type]=2 .ref*field D ,
17635 .if \\n[ref*type]=3 \{\
17637 . ie '\\*([I'' .ref*field D . " "
17638 . el .ref*field D ,
17640 . el .ref*field D ,
17642 .if \\n[ref*type]=4 .ref*field D ,
17644 \# %P Page number(s)
17646 .ie \\n[ref*type]=1 .ref*field P :
17647 .el .ref*field P . " "
17649 \# %G Gov't. ordering number
17653 \# %O Other (usually goes at end of ref)
17656 .ie r [O .nr ref*suppress-period \\n([O
17657 .el .nr ref*suppress-period 1
17666 \# %d date of publication (the orignal date of publication)
17668 .ie \\n([T .ref*field d "" " "
17669 .el .ref*field d . " "
17672 \# %a additions (such as a new intro to reprints)
17674 .ie \\n([T .ref*field a "" " "
17675 .el .ref*field a . " "
17678 \# %t title, if different from original title (the T field, which s/b
17679 \# the original title)
17681 .ie \\n([T .ref*field t "" " Rpt. as \E*[IT]" "" \E*[PREV]
17682 .el .ref*field t . " Rpt. as \E*[IT]" "" \E*[PREV]
17686 \# Translated works
17687 \# ----------------
17690 .ie \\n([T .ref*field l "" " Trans. "
17691 .el .ref*field l . " Trans. "
17694 \# %r Translato(r) and edito(r)
17696 .ie \\n([T .ref*field r "" " Trans. and Ed. "
17697 .el .ref*field r . " Trans. and Ed. "
17705 .ie \\n([s .ref*field s "" ".\E*[IT]" "" \E*[PREV]
17706 .el .ref*field s . " \E*[IT]" "" \E*[PREV]
17707 .\" refer doesn't set reg [T to 1 for these book titles, so we do it here
17709 .substring eval*[s -1
17711 .if '\\*[eval*[s]'!' .nr [T 1
17712 .if '\\*[eval*[s]'?' .nr [T 1
17715 \# %c content of site, if unclear (i.e. advertisement, cartoon,
17716 \# interview, etc.)
17718 .ie \\n([T .ref*field c "" " "
17719 .el .ref*field c . " "
17722 \# %o organization, group or sponsor of site
17724 .ie \\n([T .ref*field o "" " "
17725 .el .ref*field o . " "
17728 \# %a access date, i.e. the date you read it
17730 .ie \\n([T .ref*field a "" " "
17731 .el .ref*field a . " "
17736 .ref*field u "" " <" ">"
17740 \# Build up reference string from ref*add-<x> macros.
17743 .if d ref*string \{\
17744 . ie d ref*post-punct \{\
17745 . as ref*string "\\$2\\*[ref*post-punct] \"
17746 . rm ref*post-punct
17748 . el .as ref*string "\\$2 \"
17750 .as ref*string "\\$3\\*([\\$1\\$4
17751 .if \\n[.$]>4 .ds ref*post-punct "\\$5
17752 .nr ref*suppress-period 0
17757 \# This is a wrapper for MNinit.
17759 \# I could use a 'while' loop to assign args to strings, but too many
17760 \# 'while' loops are slowing things down.
17763 . if !'\\$1'rerun' \{\
17765 . ie '\\$2'' .ds $MN-arg2 @
17766 . el .ds $MN-arg2 \\$2
17767 . ie '\\$3'' .ds $MN-arg3 @
17768 . el .ds $MN-arg3 \\$3
17769 . ie '\\$4'' .ds $MN-arg4 @
17770 . el .ds $MN-arg4 \\$4
17771 . ie '\\$5'' .ds $MN-arg5 @
17772 . el .ds $MN-arg5 \\$5
17773 . ie '\\$6'' .ds $MN-arg6 @
17774 . el .ds $MN-arg6 \\$6
17775 . ie '\\$7'' .ds $MN-arg7 @
17776 . el .ds $MN-arg7 \\$7
17777 . ie '\\$8'' .ds $MN-arg8 @
17778 . el .ds $MN-arg8 \\$8
17779 . ie '\\$9'' .ds $MN-arg9 @
17780 . el .ds $MN-arg9 \\$9
17782 . ie \\n[#START_FOR_MNinit]=0 \{\
17783 . nr #MNinit_DEFERRED 1
17784 . nr #START_FOR_MNinit 1
17788 . MNinit \\*[$MN-arg1] \\*[$MN-arg2] \\*[$MN-arg3] \\*[$MN-arg4] \\*[$MN-arg5] \\*[$MN-arg6] \\*[$MN-arg7] \\*[$MN-arg8] \\*[$MN-arg9]
17792 .MAC MN_OVERFLOW_TRAP END
17793 . if \\n[#OVERFLOW_LEFT]=1 \{\
17794 . nr #no-repeat-MN-left 1
17795 . di MN_OVERFLOW_LEFT
17797 . if \\n[#OVERFLOW_RIGHT]=1 \{\
17798 . nr #no-repeat-MN-right 1
17799 . di MN_OVERFLOW_RIGHT
17801 . rr #OVERFLOW_LEFT
17802 . rr #OVERFLOW_RIGHT
17805 \# The remainder of the margin notes macros and routines are adapted
17806 \# from Werner Lemberg's MN.tmac.
17811 \# MNinit [ragged|symmetric] \
17812 \# left-width right-width separation \
17813 \# font fontsize vertical-spacing \
17814 \# color hyphenation-flags
17816 \# Initialize margin notes. Empty arguments (denoted with "") set
17817 \# default values. If the first argument is the string `ragged',
17818 \# left and right margin notes are printed ragged-right. If it is
17819 \# `symmetric', left margin notes are printed ragged-left and right
17820 \# margin notes ragged-right. If omitted, margin notes are left
17821 \# and right adjusted.
17826 . ds MN-left-ad b\"
17827 . ds MN-right-ad b\"
17828 . if '\\$1'RAGGED' \{\
17829 . ds MN-left-ad l\"
17830 . ds MN-right-ad l\"
17833 . if '\\$1'SYMMETRIC' \{\
17834 . ds MN-left-ad r\"
17835 . ds MN-right-ad l\"
17839 . nr MN-sep (n;\\$3)
17842 . if ((\\n[.o] - \\n[MN-sep]) < 1n) \
17843 . ab MN: Left margin too small (<1n) for requested margin notes separation.
17845 . nr MN-left-width (n;\\$1)
17846 . nr MN-left-start (\\n[.o] - \\n[MN-sep] - \\n[MN-left-width])
17849 . nr MN-left-width (\\n[.o] - \\n[MN-sep])
17850 . nr MN-left-start 0
17852 . if (\\n[MN-left-start] < 0) \
17853 . ab MN: Left margin too small for requested margin notes settings.
17854 . if (\\n[MN-left-width] < 1n) \
17855 . ab MN: Left margin notes width too small (<1n).
17857 . nr MN-right-width (n;\\$2)
17858 . nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
17859 . if \\n[#COLUMNS]=1 \{\
17860 . if !\\n[#NUM_COLS]=1 \{\
17861 . nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
17866 . nr MN-right-width \\n[MN-left-width]
17867 . nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
17868 . if \\n[#COLUMNS]=1 \{\
17869 . if !\\n[#NUM_COLS]=1 \{\
17870 . nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
17875 . ds MN-font \\$4\"
17876 . if \\n[#PRINT_STYLE]=1 .ds MN-font CR
17879 . ds MN-font \\*[$PP_FT]
17880 . if \\n[#PRINT_STYLE]=1 .ds MN-font CR
17884 . nr MN-size \\n[.ps]
17886 . if \\n[#PRINT_STYLE]=1 \{\
17888 . nr MN-size \\n[.ps]
17893 . nr MN-size \\n[#DOC_PT_SIZE]
17897 . nr MN-spacing \\n(.v
17899 . if '\\$6'DOC' \{ .nr MN-spacing \\n[#DOC_LEAD] \}
17900 . if \\n[#PRINT_STYLE]=1 \{\
17901 . nr MN-spacing \\n[#DOC_LEAD]
17905 . nr MN-spacing \\n[#DOC_LEAD]
17908 . if !\\n[#PRINT_STYLE]=1 .ds MN-color \\$7\"
17910 . if !\\n[#PRINT_STYLE]=1 .ds MN-color
17914 . nr MN-hy \\n[.hy]
17915 . ev MNbottom-left-env
17916 . if \A'\\*[MN-font]' \
17918 . if \\n[MN-size] \
17920 . if \\n[MN-spacing] \
17921 . vs \\n[MN-spacing]u
17922 . ll \\n[MN-left-width]u
17923 . ad \\*[MN-left-ad]
17926 . nop \m[\\*[MN-color]]\c
17928 . ev MNbottom-right-env
17929 . if \A'\\*[MN-font]' \
17931 . if \\n[MN-size] \
17933 . if \\n[MN-spacing] \
17934 . vs \\n[MN-spacing]u
17935 . ll \\n[MN-right-width]u
17936 . ad \\*[MN-right-ad]
17939 . nop \m[\\*[MN-color]]\c
17948 \# margin note text
17951 \# With a parameter, start a margin note, otherwise end a margin note.
17952 \# If the parameter is the string `left', define a left margin note,
17953 \# otherwise define a right margin note.
17957 .if !'\\$1'LEFT' \{\
17958 . if !'\\$1'RIGHT' \{\
17963 .if \\n[#COLUMNS]=1 \{\
17964 . if \\n[#NUM_COLS]>2 \{\
17965 . tm [mom]: Macro MN: More than two columns. Ignoring margin notes.
17968 . if !\\n[#NUM_COLS]=1 \{\
17969 . ie \\n[#COL_NUM]=1 .ds MN-dir LEFT
17970 . el .ds MN-dir RIGHT
17973 . if !\\n[#MNinit]=1 \{\
17974 . tm [mom]: Macro MN: You must set parameters with MN_INIT before using MN.
17978 . if \\n[MN-active] \{\
17979 . tm [mom]: Macro MN: Can't handle nested margin notes.
17984 . ie '\\*[MN-dir]'LEFT' \{\
17986 . ds MN-curr l-\\n[MN-left]\"
17987 . evc MNbottom-left-env
17991 . ds MN-curr r-\\n[MN-right]\"
17992 . evc MNbottom-right-env
17994 . mk MN-mk-\\*[MN-curr]
17995 . di MN-div-\\*[MN-curr]
18004 \# Utility macro to handle .MN OFF | QUIT | X etc
18007 . if \\n[MN-active] \{\
18010 . nr MN-div-\\*[MN-curr]-depth \\n(dn
18018 \# Resets these registers (called in HEADER)
18024 . ch FOOTER -\\n[#B_MARGIN]u
18029 \# The "left" half of Werner's original MNbottom.
18034 . nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
18037 . if \\n[MN-active] \{\
18039 . tm [mom]: Macro MN: Margin note finished by new page. Ignored.
18041 . po \\n[MN-left-start]u
18042 . ev MNbottom-left-env
18043 . nr #P \\n%+\\n[#PAGE_NUM_ADJ]
18044 . while (\\n[MN-curr] < \\n[MN-left]) \{\
18046 . ie (\\n[MN-last-pos] < \\n[MN-mk-l-\\n[MN-curr]]) \
18047 . sp |\\n[MN-mk-l-\\n[MN-curr]]u+\\n[MN-lead-adj]u
18052 . if \\n[#SHIM]>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
18053 . tm [mom]: Macro MN: Warning: Left margin note #\\n[MN-curr] on page \\n[#P] shifted down.
18055 .\" If last margin note doesn't fit
18056 . if ( (\\n(nl+\\n[MN-div-l-\\n[MN-curr]-depth]) > (\\n(.p+\\n[#VARIABLE_FOOTER_POS]-1) ) \{\
18057 . if \\n[MN-shifted]=1 \{\
18058 . sp -(1v+\\n[#SHIM]u)
18059 . rm MN-div-l-\\n[MN-curr]
18060 . tm1 "[mom]: No room to start left margin note #\\n[MN-curr] on page \\n[#P].
18061 . tm1 " Ignoring margin note.
18064 . nr #no-repeat-MN-left 1
18065 . nr #OVERFLOW_LEFT 1
18066 . ie \\n[#FN_COUNT]=0 \{\
18067 . ch FOOTER \\n(.pu
18068 . wh \\n[#VARIABLE_FOOTER_POS]u+\\n[MN-lead-adj]u+1u MN_OVERFLOW_TRAP
18071 . wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
18076 . MN-div-l-\\n[MN-curr]
18079 . nr MN-last-pos \\n[nl]
18083 . if !\\n[#no-repeat-MN-left]=1 \{\
18084 . if \\n[MN-right]=0 .vpt 1
18090 \# The "right" half of Werner's original MNbottom.
18095 . nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
18097 . po \\n[MN-right-start]u
18098 . ev MNbottom-right-env
18099 . nr #P \\n%+\\n[#PAGE_NUM_ADJ]
18100 . while (\\n[MN-curr] < \\n[MN-right]) \{\
18102 . ie (\\n[MN-last-pos] < \\n[MN-mk-r-\\n[MN-curr]]) \
18103 . sp |\\n[MN-mk-r-\\n[MN-curr]]u+\\n[MN-lead-adj]u
18108 . if \\n[#SHIM]>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
18109 . tm [mom]: Macro MN: Warning: Right margin note #\\n[MN-curr] on page \\n[#P] shifted down.
18111 .\" If last margin note doesn't fit
18112 . if ( (\\n(nl+\\n[MN-div-r-\\n[MN-curr]-depth]) > (\\n(.p+\\n[#VARIABLE_FOOTER_POS]-1) ) \{\
18113 . if \\n[MN-shifted]=1 \{\
18114 . sp -(1v+\\n[#SHIM]u)
18115 . rm MN-div-r-\\n[MN-curr]
18116 . tm1 "[mom]: No room to start right margin note #\\n[MN-curr] on page \\n[#P] on page \\n[#P].
18117 . tm1 " Ignoring margin note.
18120 . nr #no-repeat-MN-right 1
18121 . nr #OVERFLOW_RIGHT 1
18122 . ie \\n[#FN_COUNT]=0 \{\
18123 . ch FOOTER \\n(.pu
18124 . wh \\n[#VARIABLE_FOOTER_POS]u+\\n[MN-lead-adj]u+1u MN_OVERFLOW_TRAP
18127 . wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
18132 . MN-div-r-\\n[MN-curr]
18135 . nr MN-last-pos \\n[nl]
18139 . if !\\n[#no-repeat-MN-right]=1 .vpt 1