1 .\" -*- nroff -*- om.tmac
3 Mom -- a typesetting/document-processing macro set for groff.
5 Copyright (C) 2002-2014 Free Software Foundation, Inc.
6 Written by Peter Schaffter <peter@schaffter.ca>
7 PDF integration contributed by Deri James <deri.james@chuzzlewit.co.uk>
9 This file is part of groff.
11 groff is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 groff is distributed in the hope that it will be useful, but WITHOUT ANY
17 WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 Antoine de St-Exupéry asserted that elegance in engineering is
27 achieved not when there is nothing left to add, but when there is
28 nothing left to take away.
30 By those standards, mom is a Rube Goldberg contraption. She was
31 created over the years while groff, and my understanding of it,
32 changed and evolved. However, I'm a firm believer in "if it ain't
33 broke, don't fix it." Version 2.0 removes some of the redundancies
34 and cruft, but mom still needs some nip and tuck.
36 "<anything>" in the description of arguments that can be passed
37 to a macro means that any argument turns the feature off.
39 Thanks to everyone who has contributed suggestions and patches,
40 and to those whose GPL'd work has been plundered. Special thanks
41 to Werner Lemberg (margin notes), Tadziu Hoffman (underlining),
42 Deri James (pdf integration), Robin Haberkorn (tbl integration, eqn
43 extentions, and float management).
47 \# ====================================================================
49 \# Check which version of groff is being run
50 .if (\n[.x]\n[.y] < 118) \
51 . ab [mom]: You need GNU troff version 1.18 or higher to run this version of mom.
52 \# Check that GNU troff is being run
54 . ab [mom]: The mom macros require that you be running GNU troff.
56 . ab [mom]: The groff mom macros do not work in compatibility mode.
57 \# Add supplementary styles
58 .sty \n[.fp] UL \" Ultra Light
59 .sty \n[.fp] ULI \" Ultra Light Italic
60 .sty \n[.fp] ULCD \" Ultra Light Condensed
61 .sty \n[.fp] ULCDI \" Ultra Light Condensed Italic
62 .sty \n[.fp] ULEX \" Ultra Light Extended
63 .sty \n[.fp] ULEXI \" Ultra Light Extended Italic
65 .sty \n[.fp] XL \" Extra Light
66 .sty \n[.fp] XLI \" Extra Light Italic
67 .sty \n[.fp] XLCD \" Extra Light Condensed
68 .sty \n[.fp] XLCDI \" Extra Light Condensed Italic
69 .sty \n[.fp] XLEX \" Extra Light Extended
70 .sty \n[.fp] XLEXI \" Extra Light Extended Italic
72 .sty \n[.fp] TH \" Thin
73 .sty \n[.fp] THI \" Thin Italic
74 .sty \n[.fp] THCD \" Thin Condensed
75 .sty \n[.fp] THCDI \" Thin Condensed Italic
76 .sty \n[.fp] THEX \" Thin Extended
77 .sty \n[.fp] THEXI \" Thin Extended Italic
79 .sty \n[.fp] L \" Light Roman
80 .sty \n[.fp] LI \" Light Italic
81 .sty \n[.fp] LCD \" Light Condensed
82 .sty \n[.fp] LCDI \" Light Condensed Italic
83 .sty \n[.fp] LEX \" Light Extended
84 .sty \n[.fp] LEXI \" Light Extended Italic
86 .sty \n[.fp] BK \" Book Roman
87 .sty \n[.fp] BKI \" Book Italic
88 .sty \n[.fp] BKCD \" Book Condensed
89 .sty \n[.fp] BKCDI \" Book Condensed Italic
90 .sty \n[.fp] BKEX \" Book Extended
91 .sty \n[.fp] BKEXI \" Book Extended Italic
93 .sty \n[.fp] CD \" Medium Condensed
94 .sty \n[.fp] CDI \" Medium Condensed Italic
95 .sty \n[.fp] EX \" Medium Extended
96 .sty \n[.fp] EXI \" Medium Extended Italic
98 .sty \n[.fp] DB \" DemiBold Roman
99 .sty \n[.fp] DBI \" DemiBold Italic
100 .sty \n[.fp] DBCD \" DemiBold Condensed
101 .sty \n[.fp] DBCDI \" DemiBold Condensed Italic
102 .sty \n[.fp] DBEX \" DemiBold Extended
103 .sty \n[.fp] DBEXI \" DemiBold Extended Italic
105 .sty \n[.fp] SB \" SemiBold Roman
106 .sty \n[.fp] SBI \" SemiBold Italic
107 .sty \n[.fp] SBCD \" SemiBold Condensed
108 .sty \n[.fp] SBCDI \" SemiBold Condensed Italic
109 .sty \n[.fp] SBEX \" SemiBold Extended
110 .sty \n[.fp] SBEXI \" SemiBold Extended Italic
112 .sty \n[.fp] BCD \" Bold Condensed
113 .sty \n[.fp] BCDI \" Bold Condensed Italic
114 .sty \n[.fp] BEX \" Bold Extended
115 .sty \n[.fp] BEXI \" Bold Extended Italic
116 .sty \n[.fp] BO \" Bold Outline
118 .sty \n[.fp] XB \" Extra Bold
119 .sty \n[.fp] XBI \" Extra Bold Italic
120 .sty \n[.fp] XBCD \" Extra Bold Condensed
121 .sty \n[.fp] XBCDI \" Extra Bold Condensed Italic
122 .sty \n[.fp] XBEX \" Extra Bold Extended
123 .sty \n[.fp] XBEXI \" Extra Bold Extended Italic
125 .sty \n[.fp] UB \" Ultra Bold
126 .sty \n[.fp] UBI \" Ultra Bold Italic
127 .sty \n[.fp] UBCD \" Ultra Bold Condensed
128 .sty \n[.fp] UBCDI \" Ultra Bold Condensed Italic
129 .sty \n[.fp] UBEX \" Ultra Bold Extended
130 .sty \n[.fp] UBEXI \" Ultra Bold Extended Italic
132 .sty \n[.fp] HV \" Heavy
133 .sty \n[.fp] HVI \" Heavy Italic
134 .sty \n[.fp] HVCD \" Heavy Condensed
135 .sty \n[.fp] HVCDI \" Heavy Condensed Italic
136 .sty \n[.fp] HVEX \" Heavy Extended
137 .sty \n[.fp] HVEXI \" Heavy Extended Italic
139 .sty \n[.fp] BL \" Black
140 .sty \n[.fp] BLI \" Black Italic
141 .sty \n[.fp] BLCD \" Black Condensed
142 .sty \n[.fp] BLCDI \" Black Condensed Italic
143 .sty \n[.fp] BLEX \" Black Extended
144 .sty \n[.fp] BLEXI \" Black Extended Italic
145 .sty \n[.fp] BLO \" Black Outline
147 .sty \n[.fp] XBL \" Extra Black
148 .sty \n[.fp] XBLI \" Extra Black Italic
149 .sty \n[.fp] XBLCD \" Extra Black
150 .sty \n[.fp] XBLCDI \" Extra Black
151 .sty \n[.fp] XBLEX \" Extra Black Italic
152 .sty \n[.fp] XBLEXI \" Extra Black Italic
154 .sty \n[.fp] UBL \" Ultra Black
155 .sty \n[.fp] UBLI \" Ultra Black Italic
156 .sty \n[.fp] UBLCD \" Ultra Black Condensed
157 .sty \n[.fp] UBLCDI \" Ultra Black Condensed Italic
158 .sty \n[.fp] UBLEX \" Ultra Black Exteneded
159 .sty \n[.fp] UBLEXI \" Ultra Black Extended Italic
161 .sty \n[.fp] SC \" Small Caps Roman
162 .sty \n[.fp] SCI \" Small Caps Italic
163 .sty \n[.fp] SCDB \" Small Caps Demibold
164 .sty \n[.fp] SCDBI \" Small Caps Demibold Italic
165 .sty \n[.fp] SCSB \" Small Caps Semibold
166 .sty \n[.fp] SCSBI \" Small Caps Semibold Italic
168 \# Instruct grops to use square linecaps and joins.
169 \# This instruction is also executed in DO_B_MARGIN, NEWPAGE, and HEADER
171 .if !n \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
173 \# The following PostScript, provided by Tadziu Hoffmann, permits
174 \# no-fail underlining
179 /decornone { grops begin /X { } def /Y { } def /y2 -1 def end } def
180 /decorline { grops begin u neg /uld exch def u /ulw exch def
181 /X { currentpoint /y0 exch def /x0 exch def } def
182 /Y { currentpoint /y1 exch def /x1 exch def
183 drawline /x2 x1 def /y2 y1 def } def end } def
184 /drawline { gsave ulw setlinewidth 0 setlinecap x1 y1 uld sub moveto
185 y2 y0 eq { x2 y2 } { x0 y0 } ifelse uld sub lineto stroke
191 /B { 0 SC 3 -1 roll X widthshow Y } def
192 /C { 0 exch X ashow Y } def
193 /D { 0 exch 0 SC 5 2 roll X awidthshow Y } def
194 /E { 0 rmoveto X show Y } def
195 /F { 0 rmoveto 0 SC 3 -1 roll X widthshow Y } def
196 /G { 0 rmoveto 0 exch X ashow Y } def
197 /H { 0 rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
198 /I { 0 exch rmoveto X show Y } def
199 /J { 0 exch rmoveto 0 SC 3 -1 roll X widthshow Y } def
200 /K { 0 exch rmoveto 0 exch X ashow Y } def
201 /L { 0 exch rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
202 /M { rmoveto X show Y } def
203 /N { rmoveto 0 SC 3 -1 roll X widthshow Y } def
204 /O { rmoveto 0 exch X ashow Y } def
205 /P { rmoveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
206 /Q { moveto X show Y } def
207 /R { moveto 0 SC 3 -1 roll X widthshow Y } def
208 /S { moveto 0 exch X ashow Y } def
209 /T { moveto 0 exch 0 SC 5 2 roll X awidthshow Y } def
215 .nr TOC.RELOCATE 0 \" TOC.RELOCATE is off by default
216 .ds PDFHREF.TEXTCOL.DEFAULT 0.0 0.3 0.9
218 \# ====================================================================
220 \# TYPESETTING MACROS, STRINGS, AND ALIASES
221 \# ========================================
225 \# Alias .als as ALIAS, and .aln (number registers) as ALIASN
230 \# ALIASES FOR GROFF REQUESTS
231 \# --------------------------
240 \# ALIASES FOR NUMBER REGISTERS
241 \# ----------------------------
243 .ALIASN #PT_SIZE .ps \"fractional point size in units
244 .ALIASN #DIVER_DEPTH dn \"diversion depth
245 .ALIASN #DIVER_WIDTH dl \"diversion width
246 .ALIASN #TRAP_DISTANCE .t \"distance to next trap
247 .ALIASN #LEAD .v \"line space
248 .ALIASN #PAGE_LENGTH .p \"page length
249 .ALIASN #NUM_ARGS .$ \"number of arguments passed to a macro
250 .ALIASN #INDENT .i \"value of current indent
252 \# ====================================================================
256 .nr #L_MARGIN \n[.o] \" Tabs, etc require #L_MARGIN
257 .cflags 4 /\[en] \" So slash and en-dashes get broken
259 \# ====================================================================
263 \# Macros that control the physical layout of the page: paper size
269 \# <width of printer sheet>
271 \# Stores user supplied page width in register #PAGE_WIDTH.
273 \# #PAGE_WIDTH is used to establish the default LL (and right margin).
274 \# Requires unit of measure.
278 . nr #PAGE_WIDTH \\$1
279 . if !r#L_MARGIN .L_MARGIN \\n[.o]
280 . if !r#R_MARGIN .R_MARGIN 1i
281 . if '\\*[.T]'pdf' \X'papersize=\\n[#PAGE_WIDTH]z,\\n[#PAGE_LENGTH]z'\c
287 \# <offset from page left>
289 \# Stores user supplied page offset in register #L_MARGIN.
290 \# Sets .po to user supplied offset.
292 \# Requires unit of measure.
296 . nr #L_MARGIN (\\$1)
303 \# <width of right margin>
305 \# Stores user supplied right margin in register #R_MARGIN.
307 \# This is a pseudo-margin. Right margin is actually a function of
308 \# line length. The macro calculates line length from the page offset
309 \# and the value plugged into #R_MARGIN.
311 \# N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
313 \# Requires unit of measure.
317 . nr #R_MARGIN (\\$1)
318 . ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
320 . nr #L_LENGTH \\n[.l]
326 \# <distance to advance from top of page>
328 \# Stores the user supplied top margin in register #T_MARGIN.
329 \# Advances user supplied depth from the top of the page.
331 \# Requires unit of measure.
334 . nr #T_MARGIN (\\$1)
336 . if !\\n[#DOCS] .sp |\\n[#T_MARGIN]u-1v
343 \# <space to leave at the bottom of the page>
345 \# Stores the user supplied bottom margin in register #B_MARGIN.
347 \# Requires unit of measure.
351 . nr #B_MARGIN (\\$1)
352 . nr #ORIGINAL_B_MARGIN \\n[#B_MARGIN]
354 . wh -\\n[#B_MARGIN]u DO_B_MARGIN
360 \# <pagewidth> [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
362 \# Page set-up. Collects arguments and passes them to the appropriate
365 \# All arguments after pagewidth are optional, but must appear
366 \# in the order given above. (User can fill in as much or as
367 \# little as desired.)
369 \# All arguments require a unit of measure.
375 . ie '\\$3'' .L_MARGIN \\n[.o]
377 . ie '\\$4'' .R_MARGIN 1i
379 . if !'\\$5'' .T_MARGIN \\$5
380 . if !'\\$6'' .B_MARGIN \\$6
383 \# gropdf: pass pagelength to postprocessor; no need for -P-p
387 . if '\\*[.T]'pdf' \X'papersize=\\n[#PAGE_WIDTH]z,\\n[#PAGE_LENGTH]z'\c
390 \# =====================================================================
392 \# +++PAGE CONTROL+++
394 \# Generic macros for breaking pages.
401 \# Plants the top margin at the top of each page.
403 \# The trap is set in .T_MARGIN or .PAGE
408 . sp |\\n[#T_MARGIN]u-1v
410 . sp -\\n[#T_MARGIN_LEAD_ADJ]u
418 \# Plants the bottom margin at the bottom of each page.
420 \# The trap is set in .B_MARGIN or .PAGE.
423 . nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000
425 . if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
433 \# Breaks to a new page.
435 \# If a B_MARGIN has been set, processes that, otherwise, just
436 \# breaks to a new page.
439 . if \\n[.vpt]=0 .vpt
440 . ie \\n[#NO_BREAK] \{\
447 . ie \\n[#B_MARGIN_SET]=1 \{\
448 . ie !\\n[#DOCS]=1 \{\
454 . if \\n[#COLUMNS]=1 .nr #COL_NUM \\n[#NUM_COLS]
455 . ie !\\n[#FN_DEPTH] \{\
456 . ch FN_OVERFLOW_TRAP
458 . wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
466 \# =====================================================================
468 \# +++GENERAL STYLE MACROS+++
475 \# Stores user supplied line length in register #L_LENGTH.
476 \# Sets .ll to #L_LENGTHu
478 \# Requires unit of measure.
481 . nr #USER_SET_L_LENGTH 1
483 . nr #L_LENGTH \\n[.l]
487 \# +++FAMILY AND FONT+++
492 \# <fallback font> [ ABORT | WARN ] | ABORT | WARN
494 \# Sets register #ABORT_FT_ERRORS to 1, or defines a fallback font
495 \# called "dummy" at font position 0.
497 \# Calls to non-existent families cause mom to continue processing
498 \# files using the fallback font until a valid family is entered.
500 \# Calls to non-existent fonts generate warnings. If ABORT is passed
501 \# to FALLBACK_FONT, mom stops processing files after the warning.
502 \# Otherwise, she continues to process files using the fallback font
503 \# after the warning is issued. The default fallback font is CR; the
504 \# default for font warnings is to abort.
506 .MAC FALLBACK_FONT END
507 . if \\n[#NUM_ARGS]=1 \{\
508 . if '\\$1'ABORT' .nr #ABORT_FT_ERRORS 1
510 . if r #ABORT_FT_ERRORS .nr #ABORT_FT_ERRORS 0
512 . if !'\\$1'WARN' .fp 0 dummy \\$1
514 . if \\n[#NUM_ARGS]=2 \{\
516 . if '\\$2'ABORT' .nr #ABORT_FT_ERRORS 1
517 . if '\\$2'WARN' .nr #ABORT_FT_ERRORS 0
521 .FALLBACK_FONT CR ABORT
528 \# Stores user supplied font family in string $FAMILY. Sets .fam
533 . if \\n[#PRINT_STYLE]=1 \{\
534 . fam \\*[$TYPEWRITER_FAM]
537 . if \\n[#IGNORE] \{\
538 . fam \\*[$TYPEWRITER_FAM]
541 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) .ds $SAVED_STYLE \\n[.sty]
544 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
545 . ft \\*[$SAVED_STYLE]
546 . if !F\\n[.fn] .ft 0
548 . ie \\n[#PRE_COLLATE]=1 .
550 . if \\n[#COLLATE]=1 \
551 . if !r#START .ds $DOC_FAM \\*[$FAMILY]
558 \# R | I | B | BI | <other style extension>
560 \# Stores user supplied font in $FONT and sets .ft to $FONT.
564 . if \\n[#PRINT_STYLE]=1 \{\
566 . if \\n[#UNDERLINE_ITALIC]=1 \{\
570 . if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
581 . if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
582 . if '\\n[.sty]'' \{\
584 . if !S\\*[$FONT] \{\
585 . tm1 "[mom]: Font style "\\*[$FONT]" at line \\n[.c] has not been registered.
586 . ie \\n[#ABORT_FT_ERRORS]=0 \
587 . tm1 " Continuing to process using fallback font.
588 . el .ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
591 . tm1 "[mom]: Either font style "\\*[$FONT]" at line \\n[.c] does not exist in family "\\n[.fam]",
592 . tm1 " or family "\\n[.fam]" has not been installed.
593 . ie \\n[#ABORT_FT_ERRORS]=0 \
594 . tm1 " Continuing to process using fallback font.
595 . el .ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
605 \# <point size of type>
607 \# Sets point size to user supplied value in scaled points.
608 \# If #AUTO_LEAD is on, resets lead accordingly.
610 \# Must NOT use a unit of measure.
613 . if \\n[#PRINT_STYLE]=1 .return
614 . if \\n[#IGNORE] .return
616 . nr #PT_SIZE_IN_UNITS \\n[.ps]
617 . ie '\\$0'DOC_PT_SIZE' \{\
618 . if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
620 . nr #NEW_DOC_PT_SIZE \\n[.ps]
621 . if \\n[#DOC_AUTOLEAD] \{\
622 . ie !\\n[#DOC_AUTOLEAD_FACTOR] .nr #AUTOLEADING \\n[#DOC_AUTOLEAD]
623 . el .nr #AUTOLEADING \\n[.ps]*\\n[#DOC_AUTOLEAD]/1000-\\n[.ps]
624 . nr #DOC_LEAD \\n[.ps]+\\n[#AUTOLEADING]
628 . el .if \\n[#AUTO_LEAD] .vs \\n[.ps]u+\\n[#AUTOLEADING]u
634 \# <point size of type>
636 \# Sets point size to user supplied value in scaled points.
637 \# Intended to be called inline with \*[SIZE <n><unit>]
639 \# Can be used with a unit of measure or not.
649 \# <leading between lines of text>
651 \# Turns off #AUTOLEAD if it's on.
652 \# Sets .vs to user supplied value.
654 \# Does not require unit of measure. LS automatically turns off AUTOLEAD.
658 . nr #OLD_LEAD \\n[.v]
659 . if \\n[#PRINT_STYLE]=1 .return
660 . if \\n[#IGNORE] .return
661 . if \\n[#AUTO_LEAD] \{\
667 . if \\n[.t]<\\n[.v] 'bp
669 . nr #TOP_BASELINE_ADJ \\n[.v]-\\n[#OLD_LEAD]
670 . sp -\\n[#TOP_BASELINE_ADJ]u
672 . rr #TOP_BASELINE_ADJ
679 \# <leading value to add to #PT_SIZE> [FACTOR]
681 \# Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
682 \# Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
683 \# All subsequent PT_SIZE requests reset the leading in the same way until
684 \# AUTOLEAD is turned off.
686 \# With the optional FACTOR argument, the current point size is
687 \# multiplied by #AUTOLEAD_VALUE/1000 instead of the two being added
691 . if \\n[#PRINT_STYLE]=1 .return
692 . if \\n[#IGNORE] .return
693 . nr #AUTO_LEAD 1 \" autolead on or off
694 . nr #OLD_LEAD \\n[.v]
695 . nr #AUTOLEAD_VALUE (p;\\$1) \" arg x 1000
696 . ie '\\$2'FACTOR' \{\
697 . if !\\n[#DOCS] .nr #DOC_AUTOLEAD_FACTOR \\n[#AUTOLEAD_VALUE] \" save for DOC_PT_SIZE
698 . nr #AUTOLEADING \\n[.ps]*\\n[#AUTOLEAD_VALUE]/1000-\\n[.ps]
700 . el .nr #AUTOLEADING \\n[#AUTOLEAD_VALUE]
701 . vs \\n[.ps]u+\\n[#AUTOLEADING]u
703 . nr #TOP_BASELINE_ADJ \\n[.v]-\\n[#OLD_LEAD]
704 . sp -\\n[#TOP_BASELINE_ADJ]u
706 . rr #TOP_BASELINE_ADJ
710 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
711 \# ------------------------------------------------
719 \# =====================================================================
723 \# AUTOMATIC PAIRWISE KERNING
724 \# --------------------------
726 \# <none> | <anything>
728 \# Turns automatic pairwise kerning on or off.
741 \# INLINE KERNING AND HORIZONTAL MOVEMENT
742 \# --------------------------------------
744 \# Inline kerning provides a simple way to adjust the amount of
745 \# space between any two letters. It's predicated on a unit of
746 \# measure "U", which, by default, is 1/36 of the current point
747 \# size as returned by \n[.ps]; e.g., if the current point size is
748 \# 18, \n[.ps] returns 18000u, therefore U=500u. Since U remains
749 \# proportional relative to the current point size, the amount of
750 \# kerning between two letters as expressed in Us remains visually
751 \# similar regardless of changes in point size.
753 \# The default value for U may be changed or reset with the
757 . ie '\\$1'DEFAULT' .nr #KERN_UNIT 36
758 . el .nr #KERN_UNIT \\$1
762 .ds BU \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
763 .ds FU \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
765 \# Initialize strings for pre-1.1.3c-style BU and FU
768 .while \n+[#LOOP]<37 \{\
769 . ds BU\n[#LOOP] \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
773 .while \n+[#LOOP]<37 \{\
774 . ds FU\n[#LOOP] \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
778 \# Horizontal movements
779 \# --------------------
780 \# BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
781 \# specified number of points.
790 .ds BP1.25 \h'-1.25p'
792 .ds BP1.75 \h'-1.75p'
794 .ds BP2.25 \h'-2.25p'
796 .ds BP2.75 \h'-2.75p'
798 .ds BP3.25 \h'-3.25p'
800 .ds BP3.75 \h'-3.75p'
802 .ds BP4.25 \h'-4.25p'
804 .ds BP4.75 \h'-4.75p'
806 .ds BP5.25 \h'-5.25p'
808 .ds BP5.75 \h'-5.75p'
810 .ds BP6.25 \h'-6.25p'
812 .ds BP6.75 \h'-6.75p'
814 .ds BP7.25 \h'-7.25p'
816 .ds BP7.75 \h'-7.75p'
818 .ds BP8.25 \h'-8.25p'
820 .ds BP8.75 \h'-8.75p'
822 .ds BP9.25 \h'-9.25p'
824 .ds BP9.75 \h'-9.75p'
826 .ds BP10.25 \h'-10.25p'
827 .ds BP10.5 \h'-10.5p'
828 .ds BP10.75 \h'-10.75p'
830 .ds BP11.25 \h'-11.25p'
831 .ds BP11.5 \h'-11.5p'
832 .ds BP11.75 \h'-11.75p'
834 .ds BP12.25 \h'-12.25p'
835 .ds BP12.5 \h'-12.5p'
836 .ds BP12.75 \h'-12.75p'
878 .ds FP10.25 \h'10.25p'
880 .ds FP10.75 \h'10.75p'
882 .ds FP11.25 \h'11.25p'
884 .ds FP11.75 \h'11.75p'
886 .ds FP12.25 \h'12.25p'
888 .ds FP12.75 \h'12.75p'
890 \# WHOLE LINE (TRACK) KERNING
891 \# --------------------------
893 \# <amount of track kerning>
895 \# Invokes .tkf (track kerning) for the current font with
896 \# 1 as both the upper and lower point size limits, so that
897 \# the value entered by the user applies regardless of point
898 \# size. RW ("Reduce Whitespace") reduces the amount of space
899 \# between all characters by an equal amount. EW ("Extra
900 \# Whitespace") increases the amount of space.
902 \# Decimal values are acceptable.
904 \# A value of 1 will produce an unacceptably tight or loose line
905 \# at most text point sizes; therefore, effective use of RW and
906 \# EW is in the fractional range below 1.
908 \# \n[.f] holds the current font number, which is acceptable to .tkf.
910 \# RW and EW must be reset to 0 to cancel their effect on subsequent
914 . if \\n[#BR_AT_LINE_KERN] \{\
915 . ie \\n[#JUSTIFY]=1 .brp
922 . tkf \\n[.f] 1 -\\$1 1 -\\$1
926 . if \\n[#BR_AT_LINE_KERN] \{\
927 . ie \\n[#JUSTIFY]=1 .brp
934 . tkf \\n[.f] 1 \\$1 1 \\$1
937 \# BREAK AT LINE KERN
938 \# ------------------
942 \# Enables/disables .br's before .RW and .EW
944 \# Mostly, users will want .br's before any kind of line kerning, but
945 \# there may be cases where they don't. BR_AT_LINE_KERN is off by
946 \# default and must be invoked explicitly.
948 .MAC BR_AT_LINE_KERN END
949 . ie '\\$1'' .nr #BR_AT_LINE_KERN 1
950 . el .rr #BR_AT_LINE_KERN
953 \# =====================================================================
960 \# <none> | <anything> | DEFAULT
962 \# LINES <n> | MARGIN <n> | SPACE <n>
964 \# Turns auto hyphenation on or off, resets the hyphenation style
965 \# to default, or permits the setting of various hyphenation
968 \# HY, by itself, defaults to .hy 14, i.e. no hyphens after the
969 \# first two or before the last two characters of a word, and no
970 \# hyphenation of the last line prior to a trap (e.g., at the
971 \# bottom of a page).
973 \# HY DEFAULT resets the hyphenation style to .hy 14 (see
974 \# above) if that behaviour is desired after changes have been
975 \# made to LINES, MARGIN, or SPACE.
977 \# HY LINES <n> sets the number of allowable consecutive hyphenated lines.
979 \# HY MARGIN <n> sets the amount of space (ipPcm) allowed at the end
980 \# of a line in QUAD mode before hyphenation is tripped (e.g. if there's
981 \# only 6 points left, groff won't try to hyphenate the next word).
983 \# HY SPACE sets the amount of extra interword space (ipPcm) that can
984 \# be added in JUSTIFY mode to prevent a line from being hyphenated.
989 . if \\n[#LINES] .hlm \\n[#LINES]
990 . if \\n[#MARGIN] .hym \\n[#MARGIN]]
991 . if \\n[#SPACE] .hys \\n[#SPACE]
995 . if !'\\$1'LINES' \{\
999 . if !'\\$1'MARGIN' \{\
1003 . if !'\\$1'SPACE' \{\
1007 . if !'\\$1'DEFAULT' \{\
1011 . if '\\$1'LINES' \{\
1015 . if '\\$1'MARGIN' \{\
1017 . nr #HY_MARGIN \\$2
1019 . if '\\$1'SPACE' \{\
1023 . if '\\$1'DEFAULT' \{\
1034 \# HYPHENATION PARAMETERS
1035 \# ----------------------
1037 \# <# of lines> | <size of margin> | <amount of interword space>
1039 \# Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
1048 \# =====================================================================
1050 \# +++VERTICAL SPACING+++
1055 \# <user supplied lead to advance below current baseline>
1057 \# Creates or modifies register #ALD. Adds user supplied lead
1058 \# below current baseline.
1060 \# Requires a unit of measure.
1064 . if \\n[nl]=0 .nr #TOP 1
1069 . if '\\$0'ADD_SPACE' \{\
1074 . sp |\\n[#T_MARGIN]u-1v+\\n[#ALD]u
1079 . if '\\$0'SPACE' .sp \\$1
1080 . if '\\$0'SP' .sp \\$1
1086 \# <user supplied lead to reverse above current baseline>
1088 \# Creates or modifies register #RLD. Reverses user supplied
1089 \# lead above current baseline.
1091 \# Requires a unit of measure.
1101 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding
1102 \# \*[RLD] forms have been left in for backward compatibility with
1103 \# documents created using mom-1.1.3c or earlier. The preferred methods
1104 \# of advancing and reversing on the page inline are \*[UP <n><unit>]
1105 \# and \*[DOWN <n><unit>].
1114 .ds ALD1.25 \v'1.25p'
1116 .ds ALD1.75 \v'1.75p'
1118 .ds ALD2.25 \v'2.25p'
1120 .ds ALD2.75 \v'2.75p'
1122 .ds ALD3.25 \v'3.25p'
1124 .ds ALD3.75 \v'3.75p'
1126 .ds ALD4.25 \v'4.25p'
1128 .ds ALD4.75 \v'4.75p'
1130 .ds ALD5.25 \v'5.25p'
1132 .ds ALD5.75 \v'5.75p'
1134 .ds ALD6.25 \v'6.25p'
1136 .ds ALD6.75 \v'6.75p'
1138 .ds ALD7.25 \v'7.25p'
1140 .ds ALD7.75 \v'7.75p'
1142 .ds ALD8.25 \v'8.25p'
1144 .ds ALD8.75 \v'8.75p'
1146 .ds ALD9.25 \v'9.25p'
1148 .ds ALD9.75 \v'9.75p'
1150 .ds ALD10.25 \v'10.25p'
1151 .ds ALD10.5 \v'10.5p'
1152 .ds ALD10.75 \v'10.75p'
1154 .ds ALD11.25 \v'11.25p'
1155 .ds ALD11.5 \v'11.5p'
1156 .ds ALD11.75 \v'11.75p'
1158 .ds ALD12.25 \v'12.5p'
1159 .ds ALD12.5 \v'12.5p'
1160 .ds ALD12.75 \v'12.75p'
1162 .ds RLD.25 \v'-.25p'
1164 .ds RLD.75 \v'-.75p'
1166 .ds RLD1.25 \v'-1.25p'
1167 .ds RLD1.5 \v'-1.5p'
1168 .ds RLD1.75 \v'-1.75p'
1170 .ds RLD2.25 \v'-2.25p'
1171 .ds RLD2.5 \v'-2.5p'
1172 .ds RLD2.75 \v'-2.75p'
1174 .ds RLD3.25 \v'-3.25p'
1175 .ds RLD3.5 \v'-3.5p'
1176 .ds RLD3.75 \v'-3.75p'
1178 .ds RLD4.25 \v'-4.25p'
1179 .ds RLD4.5 \v'-4.5p'
1180 .ds RLD4.75 \v'-4.75p'
1182 .ds RLD5.25 \v'-5.25p'
1183 .ds RLD5.5 \v'-5.5p'
1184 .ds RLD5.75 \v'-5.75p'
1186 .ds RLD6.25 \v'-6.25p'
1187 .ds RLD6.5 \v'-6.5p'
1188 .ds RLD6.75 \v'-6.75p'
1190 .ds RLD7.25 \v'-7.25p'
1191 .ds RLD7.5 \v'-7.5p'
1192 .ds RLD7.75 \v'-7.75p'
1194 .ds RLD8.25 \v'-8.25p'
1195 .ds RLD8.5 \v'-8.5p'
1196 .ds RLD8.75 \v'-8.75p'
1198 .ds RLD9.25 \v'-9.25p'
1199 .ds RLD9.5 \v'-9.5p'
1200 .ds RLD9.75 \v'-9.75p'
1202 .ds RLD10.25 \v'-10.25p'
1203 .ds RLD10.5 \v'-10.5p'
1204 .ds RLD10.75 \v'-10.75p'
1206 .ds RLD11.25 \v'-11.25p'
1207 .ds RLD11.5 \v'-11.5p'
1208 .ds RLD11.75 \v'-11.75p'
1210 .ds RLD12.25 \v'-12.5p'
1211 .ds RLD12.5 \v'-12.5p'
1212 .ds RLD12.75 \v'-12.75p'
1214 \# =====================================================================
1216 \# +++REFINEMENTS+++
1218 \# AUTOMATIC LIGATURES
1219 \# -------------------
1221 \# <none> | <anything>
1223 \# Turns automatic ligature generation on or off.
1225 \# Ligatures may be supplied manually with \[fi], \[fl], etc.
1241 \# [ ,, ] | [ << ] | [ >> ] | <anything>
1243 \# [ DA | DE | EN | ES | FR | IT | NL | NO | PT | SV ] | <anything>
1245 \# Turns smartquotes on (optionally with a quoting style from the
1246 \# argument list, or off).
1247 \# If no quoting style is given, then EN (English) is used by default.
1248 \# If no quoting style is given and smart quotes have been turned off
1249 \# previously, the old quoting style will be restored.
1251 \# The " character is read outside the macro when mom is
1252 \# processed. The strings for open/close ($QUOTE<n>) are then
1253 \# defined in the macro.
1255 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1258 .MAC SMARTQUOTES END
1259 .\" First " will be translated to $QUOTE0
1262 . if !'\\*[$RESTORE_SQ]'' \{\
1263 . SMARTQUOTES \\*[$RESTORE_SQ]
1266 .\" Default smart quotes (English)
1276 . ds $RESTORE_SQ \\$1
1283 . ds $RESTORE_SQ \\$1
1290 . ds $RESTORE_SQ \\$1
1297 . ds $RESTORE_SQ \\$1
1304 . ds $RESTORE_SQ \\$1
1311 . ds $RESTORE_SQ \\$1
1318 . ds $RESTORE_SQ \\$1
1323 . ds $QUOTE0 \[Fo]\|
1324 . ds $QUOTE1 \|\[Fc]
1325 . ds $RESTORE_SQ \\$1
1330 . ds $QUOTE0 \[Fo]\|
1331 . ds $QUOTE1 \|\[Fc]
1332 . ds $RESTORE_SQ \\$1
1339 . ds $RESTORE_SQ \\$1
1346 . ds $RESTORE_SQ \\$1
1353 . ds $RESTORE_SQ \\$1
1360 . ds $RESTORE_SQ \\$1
1364 .\" None of the above -> turn smartquotes off
1373 \# Strings for foot and inch marks
1378 \# =====================================================================
1380 \# +++LINE BREAKS+++
1387 \# Breaks a line without advancing.
1389 \# EL is the mnemonic used on older, dedicated typesetting machines
1390 \# to indicate "process the line, without advancing the galley
1391 \# medium." It stands for End Line.
1393 \# The \c inline must be appended to the end of input lines when in
1394 \# nofill mode; in fill modes, the \c inline must not be used.
1398 . if \\n[#PSEUDO_FILL]=1 \&
1404 \# An inline escape to accomplish the same thing.
1405 \# Preferable, since it works with filled and non-filled copy and
1406 \# doesn't require the user to remember whether to use (or not use)
1409 .ds B \h'|0'\R'#NO_ADVANCE 1'\c
1411 \# =====================================================================
1413 \# +++FILLING/QUADDING/JUSTIFYING+++
1420 \# Turns fill on and sets .ad to b.
1422 \# Justifies text left and right.
1425 . if \\n[#TAB_ACTIVE]=0 \{\
1427 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1431 . if \\n[#PRINT_STYLE]=1 .QUAD L
1438 \# L | LEFT | R | RIGHT | C | CENTER/CENTRE
1440 \# Turns fill on and sets .ad to l, r, or c.
1442 \# Terminology is a problem here. Some people call quad left
1443 \# left justified, flush left, or flush left/rag right (and the
1444 \# reverse for quad right). Quad center is sometimes called rag
1445 \# both. For our purposes, all "quad" modes mean that groff fill
1449 . ds $QUAD_VALUE \\$1
1450 . if \\n[#TAB_ACTIVE]=0 \{\
1452 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1456 . if '\\*[$QUAD_VALUE]'L' \{\
1460 . if '\\*[$QUAD_VALUE]'LEFT' \{\
1464 . if '\\*[$QUAD_VALUE]'R' \{\
1468 . if '\\*[$QUAD_VALUE]'RIGHT' \{\
1472 . if '\\*[$QUAD_VALUE]'C' \{\
1476 . if '\\*[$QUAD_VALUE]'CENTER' \{\
1480 . if '\\*[$QUAD_VALUE]'CENTRE' \{\
1484 . if '\\*[$QUAD_VALUE]'J' \{\
1488 . if '\\*[$QUAD_VALUE]'JUSTIFY' \{\
1495 \# LEFT, RIGHT, AND CENTER
1496 \# -----------------------
1497 \# The purpose of these macros is to allow the user to enter lines
1498 \# of text that will be quadded LRC having to stick .BR or .br
1499 \# between lines. For the sake of consistency, all three appear to
1500 \# behave similarly (from the point of view of the user), although
1501 \# the underlying primitives don't. For this reason, LEFT, RIGHT,
1502 \# and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY to
1503 \# restore text to fill mode.
1510 \# Turns fill mode off. Allows user to quad lines left without
1511 \# requiring the .BR or .br macro.
1513 \# LEFT simply turns fill off. Lines that exceed the current LL
1514 \# will not be broken. Note that this behaviour differs from the
1515 \# RIGHT and CENTER macros.
1518 . if \\n[#TAB_ACTIVE]=0 \{\
1520 . ds $RESTORE_QUAD_VALUE LEFT
1525 .\" Fix for a little conflict with DOCTYPE LETTER
1526 . if '\\n[.z]'LETTERHEAD1' .rr #DATE_FIRST
1534 \# Turns fill on. Allows user to quad lines right without
1535 \# requiring the .BR or .br macro.
1537 \# Lines that exceed the current LL will be broken, with the excess
1538 \# text quadded right.
1541 . if \\n[#TAB_ACTIVE]=0 \{\
1543 . ds $RESTORE_QUAD_VALUE RIGHT
1555 \# Turns fill on. Allows user to center lines without
1556 \# requiring the .BR or .br macro.
1558 \# Lines that exceed the current LL will be broken, with the excess
1562 . if \\n[#TAB_ACTIVE]=0 \{\
1564 . ds $RESTORE_QUAD_VALUE CENTER
1571 \# =====================================================================
1575 \# There are two different kinds of tabs: typesetting tabs and
1578 \# Typesetting tabs are set with TAB_SET, which requires a tab number,
1579 \# an indent (offset) from the left margin and a length (optionally
1580 \# with a quad direction and an instruction to fill lines). After tabs
1581 \# are set with TAB_SET, they are called with .TAB n, where "n"
1582 \# corresponds to the number passed to TAB_SET as a valid tab number.
1584 \# String tabs allow the user to mark off tab positions inline. Tab
1585 \# indents and lengths are calculated from the beginning and end
1586 \# positions of the marks. Up to 19 string tabs may be created,
1587 \# numbered 1-19. Once created, they are called with .TAB n,
1588 \# just like typesetting tabs.
1590 \# Setting up string tabs is a two-step procedure. First, the user
1591 \# enters an input line in which s/he wants to mark off string tabs.
1592 \# The beginning of a tab is marked with \*[STn], where "n" is
1593 \# the desired number of the tab. The end of the the tab is marked
1594 \# with \*[STnX]. All ST's must have a matching STX. String tabs
1597 \# Next, the user invokes .ST n for every string tab defined, and
1598 \# optionally passes quad information to it. That done, string tabs
1599 \# can be called just like typesetting tabs.
1601 \# Strings for string tab inlines
1602 \# ------------------------------
1603 \# Initialize string tab markers numbered 1 to 19.
1606 .while \n+[#LOOP]<20 \{\
1607 . ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET]
1611 .while \n+[#LOOP]<20 \{\
1612 . ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK]
1616 \# These are reserved ST numbers for internal use
1617 .ds ST100 \Ek[#ST100_OFFSET]
1618 .ds ST100X \Ek[#ST100_MARK]
1619 .ds ST101 \Ek[#ST101_OFFSET]
1620 .ds ST101X \Ek[#ST101_MARK]
1621 .ds ST102 \Ek[#ST102_OFFSET]
1622 .ds ST102X \Ek[#ST102_MARK]
1623 .ds ST103 \Ek[#ST103_OFFSET]
1624 .ds ST103X \Ek[#ST103_MARK]
1626 \# QUAD AND SET STRING TABS
1627 \# ------------------------
1629 \# <stringtab number> L | R | C | J [QUAD]
1631 \# Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1632 \# tab based on the collected information.
1634 \# Like TAB_SET, ST invoked without a quad direction will default to LEFT.
1635 \# If lines should be filled and quadded, use the optional argument QUAD.
1636 \# N.B. -- indents *must* be turned off before setting string tabs
1640 . ds $ST\\$1_QUAD_DIR \\$2
1641 . if \\n[#NUM_ARGS]=3 .ds $ST\\$1_FILL QUAD
1642 . nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1644 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \
1645 \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1647 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \
1648 \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1654 \# <n> ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]]
1656 \# Creates macros TABn and TAB n, where "n" is any arbitrary number.
1657 \# TABn is a typesetting tab (i.e. a tab defined as an indent
1658 \# from the page left offset plus a line length.)
1660 \# n = arbitrary digit to identify the tab
1661 \# indent = indent from left margin; unit of measure required
1662 \# length = length of tab (unit of measure required; can be
1663 \# \w'<string>'u--if more than one word in string, surround
1664 \# with double quotes "\w'<three word string>'"
1665 \# LRCJ = quad for tab (left, right, center, justified)
1666 \# If option QUAD afterwards is not given, quad is line for line
1667 \# (no fill mode), meaning that there's no need for .BR or .br
1669 \# QUAD = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1672 \# N.B. -- indents *must* be turned off before setting tabs
1674 \# Tabs are not columnar in behaviour. .TN and \*[TB+] permit
1675 \# bottom-line to bottom-line tab movement.
1677 \# When resetting tabs, .TQ must be invoked before .TAB_SET.
1679 \# Indents are turned off automatically whenever a new tab is called
1682 \# Generally, it's a good idea to make sure all indents are off
1683 \# before setting tabs.
1687 . nr #TAB_NUMBER \\$1
1688 . ds $CURRENT_TAB \\n[#TAB_NUMBER]
1689 . nr #TAB_OFFSET (\\$2)
1690 . nr #TAB_LENGTH (\\$3)
1691 . MAC TAB\\n[#TAB_NUMBER]
1692 . if !\\\\n[#TB+]=1 .br
1693 . if \\\\n[#TB+]=1 \{\
1700 . nr #CURRENT_TAB \\n[#TAB_NUMBER]
1701 . ds $CURRENT_TAB \\*[$CURRENT_TAB]
1702 . nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1703 . nr #ST_OFFSET \\n[#TAB_OFFSET]
1704 . ie !'\\\\n[.z]'' \
1705 \!. po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
1707 . po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
1708 . ll \\n[#TAB_LENGTH]u
1710 . ie '\\$5'QUAD' \{\
1711 . if '\\$4'L' .QUAD L
1712 . if '\\$4'R' .QUAD R
1713 . if '\\$4'C' .QUAD C
1714 . if '\\$4'J' .JUSTIFY
1719 . if '\\$4'R' .RIGHT
1720 . if '\\$4'C' .CENTER
1721 . if '\\$4'J' .JUSTIFY
1723 . if \\\\n[#TN]=1 \{\
1734 \# <tab number to tab into>
1736 \# Moves to tab number passed as an argument.
1739 . ds $TAB_NUMBER \\$1
1740 . TAB\\*[$TAB_NUMBER]
1749 \# Automagically moves to TAB<n+1> on the same line as the last
1750 \# line of the previous tab.
1752 \# The \c inline must be appended to the end of input lines when in
1753 \# nofill mode; in fill modes, the \c inline must not be used.
1759 . nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1764 \# An inline escape to accomplish the same thing. Preferable, since
1765 \# it works with filled and non-filled copy and doesn't require the
1766 \# user to remember to use (or not use) the \c.
1769 "\c\R'#TB+ 1'\R'#TN 1'\R'#NEXT_TAB \\n[#CURRENT_TAB]+1'\\*[TAB\\n[#NEXT_TAB]]\c
1776 \# Sets #TAB_ACTIVE to "0" (off).
1777 \# Resets left margin to value in effect prior to tabs.
1778 \# Resets line length to value in effect prior to tabs.
1779 \# Checks #QUAD to see if we were in flush or quad mode
1780 \# prior to tabs (0=off, 1=on).
1781 \# Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1782 \# in effect prior to tabs.
1784 \# TQ must precede setting new tabs to get the tabs' indents
1785 \# measured from page left. Otherwise, the tabs' indents are
1786 \# measured from the left margin of the currently active tab.
1793 . while \\n+[#LOOP]<20 \{\
1794 . rm $ST\\n[#LOOP]_FILL
1797 . po \\n[#L_MARGIN]u
1798 . ll \\n[#L_LENGTH]u
1801 . ie '\\*[$RESTORE_QUAD_VALUE]'J' .JUSTIFY
1802 . el .QUAD \\*[$RESTORE_QUAD_VALUE]
1805 . if '\\*[$RESTORE_QUAD_VALUE]'LEFT' .LEFT
1806 . if '\\*[$RESTORE_QUAD_VALUE]'RIGHT' .RIGHT
1807 . if '\\*[$RESTORE_QUAD_VALUE]'CENTER' .CENTER
1811 \# ====================================================================
1819 \# <pre-defined NEWCOLOR or XCOLOR>
1821 \# Allows the inline escape for setting color to be called
1835 \# <color name> [<color scheme>] <color definition>
1837 \# Based on .defcolor, allows users to name and define colors using
1838 \# one of the four color schemes rgb, cmy, cmyk and grey. The new
1839 \# color is then defined as a string so that it can be called inline
1840 \# with \*[COLORNAME] or with .COLOR.
1842 \# With only two args, the default color scheme is rgb.
1844 \# It is highly recommended that users define new colors as
1845 \# all-cap strings, to differentiate them from x colors, which must
1846 \# be in lower case.
1849 . if \\n[#NUM_ARGS]=2 .defcolor \\$1 rgb \\$2
1850 . if \\n[#NUM_ARGS]=3 \{\
1851 . if '\\$2'RGB' .ds $COLOR_SCHEME rgb
1852 . if '\\$2'CYM' .ds $COLOR_SCHEME cym
1853 . if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk
1854 . if '\\$2'GRAY' .ds $COLOR_SCHEME gray
1855 . if '\\$2'GREY' .ds $COLOR_SCHEME gray
1856 . defcolor \\$1 \\*[$COLOR_SCHEME] \\$3
1864 \# <x color name> [<alias>]
1866 \# Defines a string of x color name (i.e. a predefined x
1867 \# color). If <alias> is given, creates a string of <alias name>
1868 \# that references the x color name of the first argument.
1870 \# The color name must be a valid color name from rgb.txt, and
1871 \# must be given entirely in lower case, all one word.
1875 . if \\n[#NUM_ARGS]=2 \{\
1877 . ds $\\$2_FILL \\$1
1878 . ds COLAL_\\$2 \\$1
1882 \# Pre-define xcolors black and white
1889 \# =====================================================================
1891 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1896 \# <none> | <anything>
1898 \# Simulates typewriter-style underlining of italic passages.
1900 \# Defaults for rule weight and distance from baseline are below.
1901 \# UNDERLINE_SPECS lets user change them
1906 .MAC UNDERLINE_SPECS END
1907 . ie \B'\\$1' .nr _w (u;\\$1)
1909 . ie '\\$1'DEFAULT' .nr _w 500
1912 . tm1 "[mom]: The first argument to \\$0 must be a numeric
1913 . tm1 " argument with a unit of measure appended, or DEFAULT.
1914 . tm1 " Setting underline weight to DEFAULT.
1918 . ie \B'\\$1' .nr _d (u;\\$1)
1920 . ie '\\$1'DEFAULT' .nr _d 1250
1923 . tm1 "[mom]: The second argument to \\$0 must be a numeric
1924 . tm1 " argument with a unit of measure appended, or DEFAULT.
1925 . tm1 " Setting underline distance from baseline to DEFAULT.
1932 . ds $SAVED_SS_VAR \\*[$SS_VAR]
1934 . nr #UNDERLINE_ON 1
1935 . ss \\n[.ss] (\\n[.ss]-\\n[.ss])
1936 . ie !n .nop \X'ps: exec \\n[_w] \\n[_d] decorline'\c
1940 . nr #UNDERLINE_ON 0
1941 . SS \\*[$SAVED_SS_VAR]
1942 . ie !n .nop \X'ps: exec decornone'\c
1952 \# Simulates typewriter-style underlining of italic passages.
1954 \# Intended to be called with inline escapes \*[UL] (underline
1955 \# on) and \*[ULX] (underline off).
1959 . ds $SAVED_SS_VAR \\*[$SS_VAR]
1960 . ss \\n[.ss] (\\n[.ss]-\\n[.ss])
1961 . ie !'\\n[.z]'' \{\
1964 . if !\\n[.k]=0 \?\h'-\w'\\n[.ss]'u'\?
1965 \?\R'#UNDERLINE_ON 1'\X'ps: exec \\n[_w] \\n[_d] decorline'\?\c
1968 \?\R'#UNDERLINE_ON 1'\?\c
1974 . nr #UNDERLINE_ON 1
1975 . nop \X'ps: exec \\n[_w] \\n[_d] decorline'\c
1978 \R'#UNDERLINE_ON 1'\c
1986 . SS \\*[$SAVED_SS_VAR]
1988 . ie !'\\n[.z]'' \{\
1991 \?\R'#UNDERLINE_ON 0'\X'ps: exec decornone'\?\c
1994 \?\R'#UNDERLINE_ON 0'\?\c
2000 . nr #UNDERLINE_ON 0
2001 . nop \X'ps: exec decornone'\c
2004 . nr #UNDERLINE_ON 0
2013 \# [<points below baseline>] "text"
2015 \# Places an underscore 2 points under the string if no lead given,
2016 \# otherwise places underscore under string by user specified amount.
2018 \# When using this macro, the string to be underscored must begin
2019 \# with double-quotes ("), regardless of whether it's the sole
2020 \# argument or the second.
2022 \# .UNDERSCORE "Text to be underscored
2024 \# .UNDERSCORE 2p "Text to be underscored
2026 \# UNDERSCORE does not work across line breaks. Each line of text
2027 \# must be entered separately. If the UNDERSCORE begins in the
2028 \# middle of a line and crosses over a break, the portion before
2029 \# the break and the portion afterwards must be entered
2033 . nr #SAVED_UNDERSCORE_WEIGHT \\n[#UNDERSCORE_WEIGHT]
2034 . nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ]
2035 . ds $SAVED_UNDERSCORE_GAP \\*[$UNDERSCORE_GAP]
2036 . if \\n[#FROM_BIB_STRING]=1 \{\
2037 . nr #UNDERSCORE_WEIGHT \\n[#BIB_STRING_UNDERLINE_WEIGHT]
2038 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#BIB_STRING_UNDERLINE_WEIGHT_ADJ]
2039 . ds $UNDERSCORE_GAP \\*[$BIB_STRING_UNDERLINE_GAP]
2041 . if \\n[#FROM_COVER]=1 \{\
2042 . nr #UNDERSCORE_WEIGHT \\n[#COVER_UNDERLINE_WEIGHT]
2043 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#COVER_UNDERLINE_WEIGHT_ADJ]
2044 . ds $UNDERSCORE_GAP \\*[$COVER_UNDERLINE_GAP]
2046 . if \\n[#FROM_DOC_COVER]=1 \{\
2047 . nr #UNDERSCORE_WEIGHT \\n[#DOC_COVER_UNDERLINE_WEIGHT]
2048 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#DOC_COVER_UNDERLINE_WEIGHT_ADJ]
2049 . ds $UNDERSCORE_GAP \\*[$DOC_COVER_UNDERLINE_GAP]
2051 . if \\n[#FROM_DOCTYPE]=1 \{\
2052 . nr #UNDERSCORE_WEIGHT \\n[#DOCTYPE_UNDERLINE_WEIGHT]
2053 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#DOCTYPE_UNDERLINE_WEIGHT_ADJ]
2054 . ds $UNDERSCORE_GAP \\*[$DOCTYPE_UNDERLINE_GAP]
2056 . if \\n[#FROM_EN_STRING]=1 \{\
2057 . nr #UNDERSCORE_WEIGHT \\n[#EN_STRING_UNDERLINE_WEIGHT]
2058 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT_ADJ]
2059 . ds $UNDERSCORE_GAP \\*[$EN_STRING_UNDERLINE_GAP]
2061 . if \\n[#FROM_EN_TITLE]=1 \{\
2062 . nr #UNDERSCORE_WEIGHT \\n[#EN_TITLE_UNDERLINE_WEIGHT]
2063 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_TITLE_UNDERLINE_WEIGHT_ADJ]
2064 . ds $UNDERSCORE_GAP \\*[$EN_TITLE_UNDERLINE_GAP]
2066 . ie \\n[#NUM_ARGS]=1 \{\
2067 . nr #TEXT_WIDTH \w'\\$1'
2069 \D't \\n[#UNDERSCORE_WEIGHT]'\
2070 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2071 \v'+(\\*[$UNDERSCORE_GAP])+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2072 \D'l \\n[#TEXT_WIDTH]u 0'\
2073 \D't \\n[#RULE_WEIGHT]'\
2074 \h'-\\n[#RULE_WEIGHT]u'\
2075 \v'-(\\*[$UNDERSCORE_GAP])-\\n[#UNDERSCORE_WEIGHT_ADJ]u'
2078 . nr #TEXT_WIDTH \w'\\$2'
2080 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2081 \v'+(\\$1)+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2082 \D't \\n[#UNDERSCORE_WEIGHT]'\
2083 \D'l \\n[#TEXT_WIDTH]u 0'\
2084 \D't \\n[#RULE_WEIGHT]'\
2085 \h'-\\n[#RULE_WEIGHT]u'\
2086 \v'-(\\$1)-\\n[#UNDERSCORE_WEIGHT_ADJ]u'
2088 . nr #UNDERSCORE_WEIGHT \\n[#SAVED_UNDERSCORE_WEIGHT]
2089 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ]
2090 . ds $UNDERSCORE_GAP \\*[$SAVED_UNDERSCORE_GAP]
2091 . rr #SAVED_UNDERSCORE_WEIGHT
2092 . rr #SAVED_UNDERSCORE_WEIGHT_ADJ
2093 . rm $SAVED_UNDERSCORE_GAP
2096 \# DOUBLE UNDERSCORE
2097 \# -----------------
2099 \# [points below baseline] [points distance between rules] "text"
2101 \# Same as UNDERSCORE, except it produces a double underscore. The default
2102 \# distance between the rules is 2 points.
2104 \# The same double-quote requirement as UNDERSCORE.
2106 .MAC UNDERSCORE2 END
2107 . nr #SAVED_UNDERSCORE_WEIGHT \\n[#UNDERSCORE_WEIGHT]
2108 . nr #SAVED_UNDERSCORE_WEIGHT_ADJ \\n[#UNDERSCORE_WEIGHT_ADJ]
2109 . ds $SAVED_UNDERSCORE_GAP \\*[$UNDERSCORE_GAP]
2110 . ds $SAVED_RULE_GAP \\*[$RULE_GAP]
2111 . if \\n[#NUM_ARGS]=2 \{\
2112 . ds $UNDERSCORE_GAP \\$1
2114 . if \\n[#NUM_ARGS]=3 \{\
2115 . ds $UNDERSCORE_GAP \\$1
2118 . if \\n[#FROM_BIB_STRING] \{\
2119 . nr #UNDERSCORE_WEIGHT \\n[#BIB_STRING_UNDERLINE_WEIGHT]
2120 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#BIB_STRING_UNDERLINE_WEIGHT_ADJ]
2121 . ds $UNDERSCORE_GAP \\*[$BIB_STRING_UNDERLINE_GAP]
2122 . ds $RULE_GAP \\*[$BIB_STRING_RULE_GAP]
2124 . if \\n[#FROM_EN_STRING] \{\
2125 . nr #UNDERSCORE_WEIGHT \\n[#EN_STRING_UNDERLINE_WEIGHT]
2126 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#EN_STRING_UNDERLINE_WEIGHT_ADJ]
2127 . ds $UNDERSCORE_GAP \\*[$EN_STRING_UNDERLINE_GAP]
2128 . ds $RULE_GAP \\*[$EN_STRING_RULE_GAP]
2130 . if \\n[#NUM_ARGS]=1 \{\
2131 . nr #TEXT_WIDTH \w'\\$1'
2133 \D't \\n[#UNDERSCORE_WEIGHT]'\
2134 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2135 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2136 \D'l \\n[#TEXT_WIDTH]u 0'\
2137 \v'+\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\
2138 \h'-\\n[#TEXT_WIDTH]u'\
2139 \D'l \\n[#TEXT_WIDTH]u 0'\
2140 \D't \\n[#RULE_WEIGHT]'\
2141 \h'-\\n[#RULE_WEIGHT]u'\
2142 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2144 . if \\n[#NUM_ARGS]=2 \{\
2145 . nr #TEXT_WIDTH \w'\\$2'
2147 \D't \\n[#UNDERSCORE_WEIGHT]'\
2148 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2149 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2150 \D'l \\n[#TEXT_WIDTH]u 0'\
2151 \v'+(\\*[$RULE_GAP])+\\n[#UNDERSCORE_WEIGHT]u'\
2152 \h'-\\n[#TEXT_WIDTH]u'\
2153 \D'l \\n[#TEXT_WIDTH]u 0'\
2154 \D't \\n[#RULE_WEIGHT]'\
2155 \h'-\\n[#RULE_WEIGHT]u'\
2156 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])+(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2158 . if \\n[#NUM_ARGS]=3 \{\
2159 . nr #TEXT_WIDTH \w'\\$3'
2161 \D't \\n[#UNDERSCORE_WEIGHT]'\
2162 \v'+\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
2163 \h'-\\n[#TEXT_WIDTH]u-\\n[#UNDERSCORE_WEIGHT]u'\
2164 \D'l \\n[#TEXT_WIDTH]u 0'\
2165 \v'+\\*[$RULE_GAP]+\\n[#UNDERSCORE_WEIGHT]u'\
2166 \h'-\\n[#TEXT_WIDTH]u'\
2167 \D'l \\n[#TEXT_WIDTH]u 0'\
2168 \D't \\n[#RULE_WEIGHT]'\
2169 \h'-\\n[#RULE_WEIGHT]u'\
2170 \v'-(\\*[$UNDERSCORE_GAP]+\\*[$RULE_GAP])-(\\n[#UNDERSCORE_WEIGHT]u*2u)'
2172 . nr #UNDERSCORE_WEIGHT \\n[#SAVED_UNDERSCORE_WEIGHT]
2173 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#SAVED_UNDERSCORE_WEIGHT_ADJ]
2174 . ds $UNDERSCORE_GAP \\*[$SAVED_UNDERSCORE_GAP]
2175 . rr #SAVED_UNDERSCORE_WEIGHT
2176 . rr #SAVED_UNDERSCORE_WEIGHT_ADJ
2177 . rm $SAVED_UNDERSCORE_GAP
2178 . rm $SAVED_RULE_GAP
2181 \# Default underscoring rule gaps
2183 .ds $BIB_STRING_UNDERLINE_GAP 2p
2184 .ds $BIB_STRING_RULE_GAP 2p
2185 .ds $COVER_UNDERLINE_GAP 2p
2186 .ds $DOC_COVER_UNDERLINE_GAP 2p
2187 .ds $DOCTYPE_UNDERLINE_GAP 2p
2188 .ds $EN_STRING_UNDERLINE_GAP 2p
2189 .ds $EN_STRING_RULE_GAP 2p
2190 .ds $EN_TITLE_UNDERLINE_GAP 2p
2192 .ds $UNDERSCORE_GAP 2p
2197 \# Prints everything after inline invocation as superscript.
2199 \# \*[SUP] and \*[SUPX] turn superscript on and off respectively.
2200 \# If running type is pseudo-condensed/expanded, invoke the superscript
2201 \# strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
2202 \# and \*[EXTSUPX] respectively.
2204 \# Default raise/lower amount
2205 .ds $SUP_RAISE \v'-.3m'
2206 .ds $SUP_LOWER \v'.3m'
2208 \# SUPERSCRIPT RAISE
2209 \# -----------------
2211 \# <amount to raise superscript>
2213 \# Defines strings $SUP_RAISE and $SUP_LOWER for use with \*[SUP],
2214 \# \*[CONDSUP] and \*[EXTSUP].
2216 .MAC SUPERSCRIPT_RAISE_AMOUNT END
2217 . ds $SUP_RAISE_AMOUNT \\$1
2218 . ds $SUP_RAISE \v'-\\*[$SUP_RAISE_AMOUNT]'
2219 . ds $SUP_LOWER \v'\\*[$SUP_RAISE_AMOUNT]'
2223 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2224 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2225 \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]
2227 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]
2230 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2231 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2232 \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
2234 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]\E*[COND]
2237 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2238 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
2239 \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_RAISE]\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
2241 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\E*[$SUP_LOWER]\E*[EXT]
2249 \# <number of degrees> | RESET
2251 \# Modifies register #DEGREES for use with \*[SLANT], or resets
2252 \# it to the default. Defines string \*[SLANTX]
2254 \# \*[SLANT] permits pseudo-italicizing of a font in cases where
2255 \# no italic font exists in a particular family.
2257 \# Default # of degrees is 15.
2259 \# Do not use unit of measure with arg to SETSLANT.
2261 \# It may be necessary to adjust the spacing on either side of
2262 \# [SLANT] and [SLANTX].
2264 \# In docs, SLANT carries over from para to para.
2267 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2268 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2271 . ie '\\$1'RESET' \{\
2273 . if \\n[#PRINT_STYLE]=1 \
2274 . if \\n[#UNDERLINE_SLANT] .return
2275 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2279 . if \\n[#PRINT_STYLE]=1 \
2280 . if \\n[#UNDERLINE_SLANT] .return
2281 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2283 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2292 \# <amount of emboldening> | RESET
2294 \# Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
2295 \# it to the default 700 units.
2297 \# \*[BOLDER] allows pseudo-emboldening of a font where no bold
2298 \# font exists in a particular family.
2300 \# Default for SETBOLDER is 700 units. Do not use unit of measure
2301 \# with arg to SETBOLDER.
2303 .nr #BOLDER_UNITS 700
2306 . if \\n[#IGNORE]=1 .return
2307 . ie '\\$1'RESET' .nr #BOLDER_UNITS 700
2308 . el .nr #BOLDER_UNITS \\$1
2313 .bd \\n[.f] \\n[#BOLDER_UNITS]
2321 \# +++CONDENSE/EXTEND+++
2326 \# <percentage to condense/expand type size>
2328 \# Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
2329 \# new point size (for character width) from arg, and defines string
2330 \# COND or EXT, which set the type size to the new character width,
2331 \# and sets the height of type to the value stored in CURRENT_PT_SIZE
2333 \# CONDENSE_OR_EXTEND is invoked from the aliases
2334 \# CONDENSE and EXTEND. CONDENSE implies <100, EXTEND
2335 \# implies >100. Do not use a percent sign in the argument.
2337 \# There is no default setting for CONDENSE or EXTEND.
2338 \# 80 is a good approximation of condensed type, 120 is okay
2341 \# The value set by CONDENSE or EXTEND applies to all
2342 \# subsequent \*[COND] or \*[EXT] escapes until a new value is set.
2344 \# \*[COND] or \*[EXT] must be turned off before all changes of point
2345 \# size, and reinvoked afterwards (if so desired). This refers to
2346 \# changes of point size via control lines AND via inlines.
2348 .MAC CONDENSE_OR_EXTEND END
2349 . if '\\$0'CONDENSE' \{\
2350 . ds $COND_PERCENT \\$1
2351 . if \\n[#PRINT_STYLE]=1 \{\
2353 . ds $COND_PERCENT 100
2356 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2358 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2359 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2361 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2362 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2364 . if '\\$0'EXTEND' \{\
2365 . ds $EXT_PERCENT \\$1
2366 . if \\n[#PRINT_STYLE]=1 \{\
2368 . ds $EXT_PERCENT 100
2371 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2373 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2374 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2376 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2377 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2382 \ER'#CONDENSE 0'\Es[0]\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2384 \ER'#EXTEND 0'\Es[0]\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2386 \# +++PAD LINES+++ (insert space)
2391 \# <character to use for marking pad points>
2393 \# Defines string $PAD_MARKER, used in PAD
2395 \# $PAD_MARKER is normally # (the pound sign).
2398 . ds $PAD_MARKER \\$1
2404 \# "<string of text with padding markers inserted>"
2405 \# "<id of bookmark created by .PDF_BOOKMARK>"
2407 \# Defines and redefines padding character (default=pound sign
2408 \# unless padding character has been set with PAD_MARKER)
2409 \# several times so that when the string is output at the end
2410 \# of the macro, every # has been converted to an equal-sized
2411 \# amount of padding (blank space) on a line.
2413 \# String tabs may be marked off during PAD.
2416 . if \\n[.u]=1 .nr fill 1
2418 . if !d$PAD_MARKER .ds $PAD_MARKER #
2419 . char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2420 . ds $FAMILY_FOR_PAD \\n[.fam]
2421 .\" .if !n .fp \\n[.fp] \\n[.sty]
2422 . ds $FONT_FOR_PAD \\n[.sty]
2423 . nr #SIZE_FOR_PAD \\n[.ps]
2424 . ds $PAD_STRING \\$1
2425 . as $PAD_STRING \Ekp
2427 . fam \\*[$FAMILY_FOR_PAD]
2428 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2431 . char \\*[$PAD_MARKER] \
2432 \R'#SPACE_TO_END \En[.l]-\En[p]'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2434 . fam \\*[$FAMILY_FOR_PAD]
2435 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2438 . char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2439 . if \\n[#SILENT] .SILENT
2440 . fam \\*[$FAMILY_FOR_PAD]
2441 \\f[\\*[$FONT_FOR_PAD]]\\s[\\n[#SIZE_FOR_PAD]u]
2442 . ie '\\$2'' .nop \\*[$PAD_STRING]
2444 . ie !'\\$2'NOBREAK' .pdfhref L -D "\\$2" -E -- \&\\*[$PAD_STRING]
2445 . el .nop \\*[$PAD_STRING]
2447 . if \\n[#SILENT] .SILENT OFF
2459 . if '\\$2'NOBREAK' \{\
2468 \# The leader mechanism is primitive, but it works. Basically, every
2469 \# macro in this set that includes a line length also sets a single
2470 \# groff tab stop at the right hand end of the line. That way,
2471 \# whenever Ctrl-A is invoked (always at the end of an input line),
2472 \# leader of the correct length gets deposited. Ctrl-A is accessed by
2473 \# the string LEADER (i.e. inline, as \*[LEADER]). Leaders within tabs
2474 \# get their length from the tab line length.
2476 \# SET LEADER CHARACTER
2477 \# --------------------
2479 \# <character to use whenever \*[LEADER] is invoked>
2481 \# Set leader character.
2483 .MAC LEADER_CHARACTER END
2494 \# <family of drop cap>
2496 \# Creates or modifies string $DC_FAM.
2498 .MAC DROPCAP_FAMILY END
2505 \# <font of drop cap>
2507 \# Creates or modifies string $DC_FT.
2509 .MAC DROPCAP_FONT END
2516 \# <pre-defined XCOLOR or NEWCOLOR>
2518 \# Defines string $DC_COLOR to argument.
2520 \# User must define an XCOLOR or NEWCOLOR before using
2523 .MAC DROPCAP_COLOR END
2524 . if \\n[#PRINT_STYLE]=1 .return
2532 \# <width of gutter between drop cap and indented text>
2534 \# Creates or modifies register #DC_GUT.
2536 \# Requires unit of measure. Default is 3p.
2538 .MAC DROPCAP_GUTTER END
2545 \# <+|- # of points to in/decrease point size of drop cap letter>
2547 \# Creates or modifies string $DC_ADJUST.
2549 \# Despite its best efforts, DROPCAP doesn't always get the point
2550 \# size of the drop cap critically perfect. DROPCAP_ADJUST lets
2551 \# the user add or subtract points (or fractions of points) to
2552 \# get the size right.
2554 \# Requires the + or - sign.
2556 .MAC DROPCAP_ADJUST END
2557 . ds $DC_ADJUST \\$1
2563 \# <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2565 \# Calculates point size of dropcap based on # of lines passed as
2566 \# arg 2. Sets indent for text based on dropcap width+gutter.
2567 \# Advances and prints dropcap; reverses and prints indented text
2568 \# to bottom of dropcap, then resets indent to left margin (plus
2569 \# any indent that was in effect prior to invoking DROPCAP).
2571 \# Drop caps when using the doc processing macro PP only work with
2572 \# initial paragraphs (i.e. at doc start, or after heads), only when
2573 \# DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2574 \# is TYPESET. If these conditions aren't met, DROPCAPS is silently
2577 \# The COND or EXT argument are processed separately from all
2578 \# other COND or EXT inlines or macros, hence passing COND or
2579 \# EXT has no effect on running type.
2582 . if \\n[#IGNORE]=1 \{\
2592 . if \\n[#PRINT_STYLE]=1 \{\
2596 . if \\n[#PRINT_STYLE]=2 \{\
2597 . if \\n[#PP_STYLE]=2 \{\
2609 . nr #DC_LINES \\$2-1
2610 . if \\n[#CONDENSE]=1 \{\
2611 . ds $RESTORE_COND \\*[$COND_PERCENT]
2613 . nr #CONDENSE_WAS_ON 1
2615 . if \\n[#EXTEND]=1 \{\
2616 . ds $RESTORE_EXT \\*[$EXT_PERCENT]
2618 . nr #EXTEND_WAS_ON 1
2620 . if '\\$3'COND' .CONDENSE \\$4
2621 . if '\\$3'EXT' .EXTEND \\$4
2622 . if !r#DC_GUT .nr #DC_GUT (3p)
2623 . ie \\n[#DOCS] .ds $RESTORE_FAM \\*[$DOC_FAM]
2624 . el .ds $RESTORE_FAM \\n[.fam]
2625 . ie \\n[#DOCS] .ds $RESTORE_FT \\*[$PP_FT]
2626 . el .ds $RESTORE_FT \\*[$FONT]
2627 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2628 . nr #RESTORE_INDENT \\n[.i]
2630 . nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2631 . ie !d$DC_FAM .FAM \\n[.fam]
2632 . el .FAM \\*[$DC_FAM]
2633 . ie !d$DC_FT .FT \\*[$FONT]
2634 . el .FT \\*[$DC_FT]
2635 . while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2636 . ps \\n[#PT_SIZE]u+100u
2638 . nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2640 . if d$DC_ADJUST .ps \\*[$DC_ADJUST]p
2642 . if \\n[#DC_LINES]v>\\n[.t] \{\
2643 . nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1
2644 . tm1 "[mom]: Dropcap at line \\n[.c] does not fit on page \\n[pgnum].
2645 . tm1 " Shifting paragraph to page \\n+[pgnum].
2648 . ie \\n[#DC_COLOR]=1 \{\
2652 \\*[DOWN \\n[#DC_LINES]v]\
2653 \m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[]\\*[UP \\n[#DC_LINES]v]
2656 \\*[DOWN \\n[#DC_LINES]v]\
2657 \m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[]\\*[UP \\n[#DC_LINES]v]
2660 \\*[DOWN \\n[#DC_LINES]v]\
2661 \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[]\\*[UP \\n[#DC_LINES]v]
2667 \\*[DOWN \\n[#DC_LINES]v]\
2668 \\*[COND]\\*[$DROPCAP]\\*[CONDX]\\*[UP \\n[#DC_LINES]v]
2671 \\*[DOWN \\n[#DC_LINES]v]\
2672 \\*[EXT]\\*[$DROPCAP]\\*[EXTX]\\*[UP \\n[#DC_LINES]v]
2675 \\*[DOWN \\n[#DC_LINES]v]\
2676 \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[]\\*[UP \\n[#DC_LINES]v]
2678 . if '\\$3'COND' \E*[COND]
2679 . if '\\$3'EXT' \E*[EXT]
2683 . in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u
2689 . in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u
2692 . if '\\$3'COND' \E*[CONDX]\c
2693 . if '\\$3'EXT' \E*[EXTX]\c
2694 . FAM \\*[$RESTORE_FAM]
2695 . FT \\*[$RESTORE_FT]
2696 . ps \\n[#RESTORE_PT_SIZE]u
2697 . if \\n[#CONDENSE_WAS_ON] \{\
2698 . CONDENSE \\*[$RESTORE_COND]
2701 . if \\n[#EXTEND_WAS_ON] \{\
2702 . EXTEND \\*[$RESTORE_EXT]
2705 . ie \\n[.u] .wh \\n[.d]u+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF
2706 . el .wh \\n[.d]u+\\n[#DC_HEIGHT]u DROPCAP_OFF
2707 . rr #CONDENSE_WAS_ON
2715 . rr #RESTORE_PT_SIZE
2716 . rr #RESTORE_INDENT
2722 .MAC DROPCAP_OFF END
2723 ' in \\n[#RESTORE_INDENT]u
2727 \# =====================================================================
2729 \# +++GRAPHICAL OBJECTS+++
2731 \# HORIZONTAL RULE - DRH
2732 \# ---------------------
2734 \# <none> | <rule weight> <indent> <length> [ <color> ]
2736 \# With no arg, draws a full measure rule. With args, draws
2737 \# described horizontal rule.
2739 \# Rules are drawn left-to-right, from the baseline down, and
2740 \# return to their point of origin. Color must be set in the
2741 \# macro; otherwise the color will be black, regardless of current
2742 \# .gcolor. If no arg given, the rule weight is the one set by
2746 . if \\n[.vpt]=1 \{\
2748 . nr #RESTORE_TRAP 1
2750 . ie !\\n[#NO_ADVANCE]=1 .br
2757 . nr #FILL_MODE \\n[.j]
2761 . if \\n[.ce]>0 .nr #NOFILL_MODE 3
2762 . if \\n[.rj]>0 .nr #NOFILL_MODE 5
2767 . ds $RL_WEIGHT \\$1
2768 . ds $RL_INDENT \\$2
2769 . ds $RL_LENGTH \\$3
2770 . ie !'\\$4'' .ds $RL_COLOR \\$4
2771 . el .ds $RL_COLOR default
2772 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
2773 . nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
2775 . if \\n[#NUM_ARGS]>=1 .RULE_WEIGHT \\*[$RL_WEIGHT]
2777 . gcolor \\*[$RL_COLOR]
2778 . ie \\n[#NUM_ARGS]=0 \{\
2779 . ie \\n[#INDENT_ACTIVE] \{\
2780 . nr #RESTORE_L_LENGTH \\n[.l]
2781 . if \\n[#INDENT_BOTH_ACTIVE] .ll \\n[.l]u-\\n[#BL_INDENT]u
2782 . if \\n[#INDENT_LEFT_ACTIVE] .ll \\n[.l]u-\\n[#L_INDENT]u
2783 \D't \\n[#RULE_WEIGHT]'\
2784 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2785 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2786 \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\
2787 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2788 \D't \\n[#SAVED_RULE_WEIGHT]'
2789 . ll \\n[#RESTORE_L_LENGTH]u
2790 . rr #RESTORE_L_LENGTH
2793 \D't \\n[#RULE_WEIGHT]'\
2794 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2795 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2796 \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\
2797 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2798 \D't \\n[#SAVED_RULE_WEIGHT]'
2802 \D't \\n[#RULE_WEIGHT]'\
2803 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT]u'\
2804 \v'\\n[#RULE_WEIGHT_ADJ]u'\
2805 \D'l \\*[$RL_LENGTH] 0'\
2806 \v'-\\n[#RULE_WEIGHT_ADJ]u'\
2807 \D't \\n[#SAVED_RULE_WEIGHT]'
2809 . if \\n[#FILLED]=1 \{\
2810 . if \\n[#FILL_MODE]=0 .QUAD LEFT
2811 . if \\n[#FILL_MODE]=1 .JUSTIFY
2812 . if \\n[#FILL_MODE]=3 .QUAD CENTER
2813 . if \\n[#FILL_MODE]=5 .QUAD RIGHT
2817 . if \\n[#NOFILL]=1 \{\
2818 . if \\n[#NOFILL_MODE]=3 .CENTER
2819 . if \\n[#NOFILL_MODE]=5 .RIGHT
2822 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
2823 . nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
2825 . rr #SAVED_WEIGHT_ADJ
2826 . if \\n[#RESTORE_TRAP]=1 \{\
2830 . if '\\n[.z]'FLOAT*DIV' \
2831 . if !(\\n[.d]+\\n[#WEIGHT])<\\n[D-float] .nr D-float \\n[.d]+\\n[#WEIGHT]
2839 \# Draws a rule the length of the current measure.
2841 \# A convenience macro. DRH with no argument does the same thing.
2842 \# Kept in for backward compatibility.
2847 . ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2850 . ie \\n[#INDENT_ACTIVE] \{\
2851 . if \\n[#INDENT_BOTH_ACTIVE] .ll \\n[.l]u-\\n[#BL_INDENT]u
2852 . if \\n[#INDENT_LEFT_ACTIVE] .ll \\n[.l]u-\\n[#L_INDENT]u
2854 \D't \\n[#RULE_WEIGHT]'\v'\\n[#RULE_WEIGHT_ADJ]u'\
2855 \h'-\\n[#RULE_WEIGHT]u'\
2856 \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\h'|0'\c
2858 . rr #RESTORE_L_LENGTH
2862 \D't \\n[#RULE_WEIGHT]'\v'\\n[#RULE_WEIGHT_ADJ]u'\
2863 \h'-\\n[#RULE_WEIGHT]u'\
2864 \D'l \En[.l]u 0'\v'-\\n[#RULE_WEIGHT_ADJ]u'\h'|0'\c
2869 . QUAD \\*[$CURRENT_QUAD]
2875 \# VERTICAL RULE - DRV
2876 \# -------------------
2878 \# <rule weight> <indent> <depth> [ <color> ]
2880 \# Draws described vertical rule.
2882 \# Rules are drawn left-to-right, from the baseline down, and
2883 \# return to their point of origin. Color must be set in the
2884 \# macro; otherwise the color will be black, regardless of current
2888 . if \\n[.vpt]=1 \{\
2890 . nr #RESTORE_TRAP 1
2892 . ie !\\n[#NO_ADVANCE]=1 .br
2899 . nr #FILL_MODE \\n[.j]
2903 . if \\n[.ce]>0 .nr #NOFILL_MODE 3
2904 . if \\n[.rj]>0 .nr #NOFILL_MODE 5
2909 . ds $RL_WEIGHT \\$1
2910 . ds $RL_INDENT \\$2
2915 . el .ds $RL_COLOR default
2916 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
2917 . nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
2918 . RULE_WEIGHT \\*[$RL_WEIGHT]
2919 . gcolor \\*[$RL_COLOR]
2920 \D't \\n[#RULE_WEIGHT]'\
2921 \h'\\*[$RL_INDENT]-\\n[#RULE_WEIGHT_ADJ]u'\
2922 \D'l 0 \\*[$RL_DEPTH]'\
2923 \D't \\n[#SAVED_RULE_WEIGHT]'
2924 . if \\n[#FILLED]=1 \{\
2925 . if \\n[#FILL_MODE]=0 .QUAD LEFT
2926 . if \\n[#FILL_MODE]=1 .JUSTIFY
2927 . if \\n[#FILL_MODE]=3 .QUAD CENTER
2928 . if \\n[#FILL_MODE]=5 .QUAD RIGHT
2932 . if \\n[#NOFILL]=1 \{\
2933 . if \\n[#NOFILL_MODE]=3 .CENTER
2934 . if \\n[#NOFILL_MODE]=5 .RIGHT
2937 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
2938 . nr #RULE_WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
2939 . if \\n[#RESTORE_TRAP]=1 \{\
2943 . if '\\n[.z]'FLOAT*DIV' \{\
2944 . if !(\\n[.d]+\\*[$RL_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$RL_DEPTH]
2951 \# <rule weight | SOLID> <indent> <length> <depth> [ <color> ]
2953 \# Draws described box.
2955 \# Boxes are drawn left-to-right, from the baseline down, and
2956 \# return to their point of origin. Box rules are drawn from the
2957 \# perimeter inwards. Color must be set in the macro; otherwise
2958 \# the color will be black, regardless of current .gcolor. If no
2959 \# arg given, the rule weight is the one set by RULE_WEIGHT.
2962 . if \\n[.vpt]=1 \{\
2964 . nr #RESTORE_TRAP 1
2966 . ie !\\n[#NO_ADVANCE]=1 .br
2973 . nr #FILL_MODE \\n[.j]
2977 . if \\n[.ce]>0 .nr #NOFILL_MODE 3
2978 . if \\n[.rj]>0 .nr #NOFILL_MODE 5
2983 . ie '\\$1'SOLID' .nr #BX_SOLID 1
2984 . el .ds $BX_WEIGHT \\$1
2985 . ds $BX_INDENT \\$2
2989 . ie d$\\$5_FILL .ds $BX_COLOR \\*[$\\$5_FILL]
2990 . el .ds $BX_COLOR \\$5
2992 . el .ds $BX_COLOR default
2993 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
2994 . nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
2995 . if !'\\$1'SOLID' .RULE_WEIGHT \\*[$BX_WEIGHT]
2996 . ds $BX_INDENT \\*[$BX_INDENT]-\\n[#WEIGHT_ADJ]u
2997 . ie \\n[#BX_SOLID]=1 \{\
2998 . fcolor \\*[$BX_COLOR]
2999 \h'\\*[$BX_INDENT]'\
3000 \D'P \\*[$BX_WIDTH] 0 0 \\*[$BX_DEPTH] -\\*[$BX_WIDTH] 0 0 -\\*[$BX_DEPTH]'
3005 . gcolor \\*[$BX_COLOR]
3006 \D't \\n[#RULE_WEIGHT]'\
3007 \h'\\*[$BX_INDENT]'\
3008 \v'\\n[#WEIGHT_ADJ]u'\
3009 \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'\
3010 \v'-\\n[#WEIGHT_ADJ]u'\
3011 \D't \\n[#SAVED_RULE_WEIGHT]'
3015 . if \\n[#FILLED]=1 \{\
3016 . if \\n[#FILL_MODE]=0 .QUAD LEFT
3017 . if \\n[#FILL_MODE]=1 .JUSTIFY
3018 . if \\n[#FILL_MODE]=3 .QUAD CENTER
3019 . if \\n[#FILL_MODE]=5 .QUAD RIGHT
3022 . if \\n[#NOFILL]=1 \{\
3023 . if \\n[#NOFILL_MODE]=3 .CENTER
3024 . if \\n[#NOFILL_MODE]=5 .RIGHT
3026 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
3027 . nr #WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
3029 . rr #SAVED_WEIGHT_ADJ
3030 . if \\n[#RESTORE_TRAP]=1 \{\
3034 . if '\\n[.z]'FLOAT*DIV' \
3035 . if !(\\n[.d]+\\*[$BX_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$BX_DEPTH]
3041 \# <rule weight | SOLID> <indent> <width> <depth> [ <color> ]
3043 \# Draws described ellipses.
3045 \# Ellipses (circles) are drawn left-to-right, from the baseline
3046 \# down, and return to their point of origin. Ellipse rules are
3047 \# drawn from the perimeter inwards. Color must be set in the
3048 \# macro; otherwise the color will be black, regardless of current
3049 \# .gcolor. If no arg given, the rule weight is the one set by
3053 . if \\n[.vpt]=1 \{\
3055 . nr #RESTORE_TRAP 1
3057 . ie !\\n[#NO_ADVANCE]=1 .br
3064 . nr #FILL_MODE \\n[.j]
3068 . if \\n[.ce]>0 .nr #NOFILL_MODE 3
3069 . if \\n[.rj]>0 .nr #NOFILL_MODE 5
3074 . ie '\\$1'SOLID' .nr #CL_SOLID 1
3075 . el .ds $CL_WEIGHT \\$1
3076 . ds $CL_INDENT \\$2
3080 . ie d$\\$5_FILL .ds $CL_COLOR \\*[$\\$5_FILL]
3081 . el .ds $CL_COLOR \\$5
3083 . el .ds $CL_COLOR default
3084 . nr #SAVED_WEIGHT \\n[#RULE_WEIGHT]
3085 . nr #SAVED_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3086 . if !'\\$1'SOLID' .RULE_WEIGHT \\*[$CL_WEIGHT]
3087 . ds $CL_INDENT \\*[$CL_INDENT]-\\n[#WEIGHT_ADJ]u
3088 . ie \\n[#CL_SOLID]=1 \{\
3089 . fcolor \\*[$CL_COLOR]
3090 \h'\\*[$CL_INDENT]'\
3091 \v'\\*[$CL_DEPTH]/2u'\
3092 \D'E \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\
3093 \v'-\\*[$CL_DEPTH]/2u'
3098 . gcolor \\*[$CL_COLOR]
3099 \D't \\n[#RULE_WEIGHT]'\
3100 \h'\\*[$CL_INDENT]'\
3101 \v'\\*[$CL_DEPTH]/2u'\
3102 \D'e \\*[$CL_WIDTH]-\\n[#RULE_WEIGHT]u \\*[$CL_DEPTH]-\\n[#RULE_WEIGHT]u'\
3103 \v'-(\\*[$CL_DEPTH]/2u)'\
3104 \D't \\n[#SAVED_RULE_WEIGHT]'
3108 . if \\n[#FILLED]=1 \{\
3109 . if \\n[#FILL_MODE]=0 .QUAD LEFT
3110 . if \\n[#FILL_MODE]=1 .JUSTIFY
3111 . if \\n[#FILL_MODE]=3 .QUAD CENTER
3112 . if \\n[#FILL_MODE]=5 .QUAD RIGHT
3115 . if \\n[#NOFILL]=1 \{\
3116 . if \\n[#NOFILL_MODE]=3 .CENTER
3117 . if \\n[#NOFILL_MODE]=5 .RIGHT
3119 . nr #RULE_WEIGHT \\n[#SAVED_WEIGHT]
3120 . nr #WEIGHT_ADJ \\n[#SAVED_WEIGHT_ADJ]
3122 . rr #SAVED_WEIGHT_ADJ
3123 . if \\n[#RESTORE_TRAP]=1 \{\
3127 . if '\\n[.z]'FLOAT*DIV' \
3128 . if !(\\n[.d]+\\*[$CL_DEPTH])<\\n[D-float] .nr D-float \\n[.d]+\\*[$CL_DEPTH]
3134 \# <weight of rules in points>
3136 \# Sets \D't <n>' to the correct number of machine units for the
3137 \# argument given in points.
3139 \# Decimal fractions are allowed. Rule weight must be < 100.
3141 .MAC RULE_WEIGHT END
3142 . di NULL \" Diverted so there's no problem with breaks, spacing, etc.
3145 . if !\B'\\*[$ARG]' \{\
3146 . tm1 "[mom]: The argument to \\$0 must not have a unit of measure appended.
3147 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
3149 . length #STR_LENGTH \\$1
3151 . substring $ARG 0 0
3152 . ie '\\*[$ARG]'.' \{\
3154 . substring $ARG 1 \\n[#STR_LENGTH]-1
3155 . nr #WEIGHT \\*[$ARG]*100
3156 . if (\\n[#WEIGHT]>=1000) \{\
3157 . while (\\n[#WEIGHT]>=1000) \{\
3158 . nr #WEIGHT \\n[#WEIGHT]/10
3164 . substring $ARG 1 1
3165 . ie '\\*[$ARG]'.' \{\
3167 . substring $LHS 0 0
3170 . nr #WEIGHT \\*[$LHS]\\*[$RHS]*100
3171 . if (\\n[#WEIGHT]>=10000) \{\
3172 . while (\\n[#WEIGHT]>=10000) \{\
3173 . nr #WEIGHT \\n[#WEIGHT]/10
3178 . ie \\n[#STR_LENGTH]<=2 .nr #WEIGHT \\$1*1000
3181 . substring $ARG 2 2
3182 . ie !'\\*[$ARG]'.' \{\
3183 . tm1 "[mom]: Invalid argument given to macro \\$0 at line \\n[.c].
3184 . tm1 " Rule weight must be < 100 points.
3185 . tm1 " Falling back to default weight .5 points.
3190 . substring $LHS 0 1
3193 . nr #WEIGHT \\*[$LHS]\\*[$RHS]*1000
3194 . if (\\n[#WEIGHT]>=100000) \{\
3195 . while (\\n[#WEIGHT]>=100000) \{\
3196 . nr #WEIGHT \\n[#WEIGHT]/10
3203 . nr #WEIGHT_ADJ \\n[#WEIGHT]/2
3204 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT' \{\
3205 . nr #BIB_STRING_UNDERLINE_WEIGHT \\n[#WEIGHT]
3206 . nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3208 . if '\\$0'COVER_UNDERLINE_WEIGHT' \{\
3209 . nr #COVER_UNDERLINE_WEIGHT \\n[#WEIGHT]
3210 . nr #COVER_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3212 . if '\\$0'DOC_COVER_UNDERLINE_WEIGHT' \{\
3213 . nr #DOC_COVER_UNDERLINE_WEIGHT \\n[#WEIGHT]
3214 . nr #DOC_COVER_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3216 . if '\\$0'DOCTYPE_UNDERLINE_WEIGHT' \{\
3217 . nr #DOCTYPE_UNDERLINE_WEIGHT \\n[#WEIGHT]
3218 . nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3220 . if '\\$0'ENDNOTE_STRING_UNDERLINE_WEIGHT' \{\
3221 . nr #EN_STRING_UNDERLINE_WEIGHT \\n[#WEIGHT]
3222 . nr #EN_STRING_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3224 . if '\\$0'ENDNOTE_TITLE_UNDERLINE_WEIGHT' \{\
3225 . nr #EN_TITLE_UNDERLINE_WEIGHT \\n[#WEIGHT]
3226 . nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3228 . if '\\$0'FOOTER_RULE_WEIGHT' \{\
3229 . nr #FOOTER_RULE_WEIGHT \\n[#WEIGHT]
3230 . nr #FOOTER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3232 . if '\\$0'FOOTNOTE_RULE_WEIGHT' \{\
3233 . nr #FN_RULE_WEIGHT \\n[#WEIGHT]
3234 . nr #FN_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3236 . if '\\$0'HEADER_RULE_WEIGHT' \{\
3237 . nr #HEADER_RULE_WEIGHT \\n[#WEIGHT]
3238 . nr #HEADER_RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3240 . if '\\$0'RULE_WEIGHT' \{\
3241 . nr #RULE_WEIGHT \\n[#WEIGHT]
3242 . nr #RULE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3244 . if '\\$0'UNDERSCORE_WEIGHT' \{\
3245 . nr #UNDERSCORE_WEIGHT \\n[#WEIGHT]
3246 . nr #UNDERSCORE_WEIGHT_ADJ \\n[#WEIGHT_ADJ]
3253 .ALIAS BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT RULE_WEIGHT
3254 .ALIAS COVER_UNDERLINE_WEIGHT RULE_WEIGHT
3255 .ALIAS DOC_COVER_UNDERLINE_WEIGHT RULE_WEIGHT
3256 .ALIAS DOCTYPE_UNDERLINE_WEIGHT RULE_WEIGHT
3257 .ALIAS ENDNOTE_STRING_UNDERLINE_WEIGHT RULE_WEIGHT
3258 .ALIAS ENDNOTE_TITLE_UNDERLINE_WEIGHT RULE_WEIGHT
3259 .ALIAS FOOTER_RULE_WEIGHT RULE_WEIGHT
3260 .ALIAS FOOTNOTE_RULE_WEIGHT RULE_WEIGHT
3261 .ALIAS HEADER_RULE_WEIGHT RULE_WEIGHT
3262 .ALIAS UNDERSCORE_WEIGHT RULE_WEIGHT
3264 \# Default rule weights
3265 \# ~~~~~~~~~~~~~~~~~~~~
3266 .nr #BIB_STRING_UNDERLINE_WEIGHT 500
3267 .nr #COVER_UNDERLINE_WEIGHT 500
3268 .nr #DOC_COVER_UNDERLINE_WEIGHT 500
3269 .nr #DOCTYPE_UNDERLINE_WEIGHT 500
3270 .nr #EN_STRING_UNDERLINE_WEIGHT 500
3271 .nr #EN_TITLE_UNDERLINE_WEIGHT 500
3272 .nr #FN_RULE_WEIGHT 500
3273 .nr #FOOTER_RULE_WEIGHT 500
3274 .nr #HEADER_RULE_WEIGHT 500
3275 .nr #RULE_WEIGHT 500
3276 .nr #UNDERSCORE_WEIGHT 500
3278 .nr #BIB_STRING_UNDERLINE_WEIGHT_ADJ \n[#BIB_STRING_UNDERLINE_WEIGHT]/2
3279 .nr #COVER_UNDERLINE_WEIGHT_ADJ \n[#DOCTYPE_UNDERLINE_WEIGHT]/2
3280 .nr #DOC_COVER_UNDERLINE_WEIGHT_ADJ \n[#DOCTYPE_RULE_WEIGHT]/2
3281 .nr #DOCTYPE_UNDERLINE_WEIGHT_ADJ \n[#DOCTYPE_RULE_WEIGHT]/2
3282 .nr #EN_STRING_UNDERLINE_WEIGHT_ADJ \n[#EN_STRING_UNDERLINE_WEIGHT]/2
3283 .nr #EN_TITLE_UNDERLINE_WEIGHT_ADJ \n[#EN_STRING_UNDERLINE_WEIGHT]/2
3284 .nr #FOOTER_RULE_WEIGHT_ADJ \n[#FOOTER_RULE_WEIGHT]/2
3285 .nr #FN_RULE_WEIGHT_ADJ \n[#FN_RULE_WEIGHT]/2
3286 .nr #HEADER_RULE_WEIGHT_ADJ \n[#HEADER_RULE_WEIGHT]/2
3287 .nr #RULE_WEIGHT_ADJ \n[#RULE_WEIGHT]/2
3288 .nr #UNDERSCORE_WEIGHT_ADJ \n[#UNDERSCORE_WEIGHT]/2
3290 \# Set default rule weight
3296 \# =====================================================================
3298 \# +++WORD AND SENTENCE SPACING+++
3300 \# WORD SPACE CONTROL
3301 \# ------------------
3303 \# <+|->wordspace | DEFAULT
3305 \# Increases or decreases interword space by user supplied amount.
3306 \# If DEFAULT, value is set to 12 (groff default).
3308 \# $WS_CONSTANT is the groff default word space.
3309 \# $WS_VAR is the user supplied amount by which to in/decrease word space.
3310 \# $WS is a concatenation of WS_CONSTANT and WS_VAR.
3312 \# \n[.sss] holds the current sentence space value.
3315 . ds $WS_CURR \\n[.ss]
3317 . ie '\\$1'DEFAULT' .ss 12 \\n[.sss]
3319 . ds $WS (\\*[$WS_CURR]\\*[$WS_VAR])
3320 . ie \\n[.sss]=12 .ss \\*[$WS] 12
3322 . ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
3328 \# SENTENCE SPACE CONTROL
3329 \# ----------------------
3331 \# <+-sentencespace> | 0 | DEFAULT
3333 \# Increases or decreases sentence space by user supplied amount.
3334 \# If 0, sentence spaces are ignored. If DEFAULT, value is
3335 \# set to 12 (groff default).
3337 \# Because the user supplied value requires a literal + or - sign,
3338 \# the macro argument is stored in a string.
3340 \# Sentence space applies only to input where sentences are separated
3341 \# by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
3342 \# Changing .SS when sentences are separated by only one space has
3343 \# no effect on the space between sentences.
3345 \# \n[.ss] holds the current wordspace value.
3346 \# \n[.sss] holds the current sentence space value.
3350 . ie '\\$1'0' .ss \\n[.ss] (\\n[.ss]-\\n[.ss])
3352 . ie '\\$1'DEFAULT' .ss \\n[.ss]
3353 . el .ss \\n[.ss] (0\\*[$SS_VAR])
3357 \# =====================================================================
3362 \# +++INDENT LEFT+++
3365 . if \\n[#INDENT_STYLE_BOTH] .IBX
3366 . nr #INDENT_STYLE_LEFT 1
3367 . nr #INDENT_ACTIVE 1
3368 . nr #INDENT_LEFT_ACTIVE 1
3371 . in \\n[#L_INDENT]u
3372 . ta \\n[.l]u-\\n[#L_INDENT]u
3376 . nr #L_INDENT +(\\$1)
3377 . in \\n[#L_INDENT]u
3378 . ta \\n[.l]u-\\n[#L_INDENT]u
3380 . if \\n[#IN_ITEM] .nr #IN_ITEM_L_INDENT +(\\$1)
3383 \# +++INDENT RIGHT+++
3386 . if \\n[#INDENT_STYLE_BOTH] .IBX
3387 . nr #INDENT_STYLE_RIGHT 1
3388 . nr #INDENT_ACTIVE 1
3389 . nr #INDENT_RIGHT_ACTIVE 1
3392 . ie \\n[#TAB_ACTIVE] \{\
3393 . ll \\n[.l]u-\\n[#R_INDENT]u
3394 . ta \\n[.l]u-\\n[#L_INDENT]u
3397 . ll \\n[.l]u-\\n[#R_INDENT]u
3398 . ta \\n[.l]u-\\n[#L_INDENT]u
3403 . nr #R_INDENT +(\\$1)
3404 . ie \\n[#TAB_ACTIVE] \{\
3405 . ll \\n[.l]u-\\n[#R_INDENT]u
3406 . ta \\n[.l]u-\\n[#L_INDENT]u
3409 . ll \\n[.l]u-\\n[#R_INDENT]u
3410 . ta \\n[.l]u-\\n[#L_INDENT]u
3415 \# +++INDENT BOTH+++
3418 . if \\n[#INDENT_STYLE_LEFT] .ILX
3419 . if \\n[#INDENT_STYLE_RIGHT] .IRX
3420 . nr #INDENT_STYLE_BOTH 1
3421 . nr #INDENT_ACTIVE 1
3422 . nr #INDENT_BOTH_ACTIVE 1
3425 . in \\n[#BL_INDENT]u
3426 . ie \\n[#TAB_ACTIVE] \{\
3427 . ll \\n[.l]u-\\n[#BR_INDENT]u
3428 . ta \\n[.l]u-\\n[#BR_INDENT]u
3431 . ll \\n[.l]u-\\n[#BR_INDENT]u
3432 . ta \\n[.l]u-\\n[#BR_INDENT]u
3437 . nr #BL_INDENT (\\n[#INDENT]+\\$1)
3438 . ie \\n[#NUM_ARGS]=2 .nr #BR_INDENT +(\\$2)
3439 . el .nr #BR_INDENT \\n[#BL_INDENT]
3440 . ie \\n[#TAB_ACTIVE] \{\
3441 . in \\n[#BL_INDENT]u
3442 . ll \\n[.l]u-\\n[#BR_INDENT]u
3443 . ta \\n[.l]u-\\n[#BL_INDENT]u
3446 . in \\n[#BL_INDENT]u
3447 . ll \\n[.l]u-\\n[#BR_INDENT]u
3448 . ta \\n[.l]u-\\n[#BR_INDENT]u
3453 \# +++TEMPORARY INDENT+++
3458 . ti \\n[#T_INDENT]u
3459 . if \\n[#INDENT_LEFT_ACTIVE] .ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
3460 . if \\n[#INDENT_BOTH_ACTIVE] .ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
3463 . nr #T_INDENT (\\$1)
3464 . ti \\n[#T_INDENT]u
3468 \# +++HANGING INDENT+++
3471 . ie '\\$1'' .ti -\\n[#HL_INDENT]u
3473 . nr #HL_INDENT (\\$1)
3474 . ti -\\n[#HL_INDENT]u
3478 \# +++INDENTS OFF+++
3481 . ie \\n[#IN_ITEM] .nr #L_INDENT -\\n[#IN_ITEM_L_INDENT]
3485 . rr #INDENT_LEFT_ACTIVE
3487 . if '\\$1'CLEAR' \{\
3489 . rr #INDENT_STYLE_LEFT
3495 . rr #INDENT_RIGHT_ACTIVE
3496 . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3498 . ie \\n[#COLUMNS] \{\
3499 . ll \\n[#COL_L_LENGTH]u
3503 . ll \\n[#L_LENGTH]u
3507 . if '\\$1'CLEAR' \{\
3509 . rr #INDENT_STYLE_RIGHT
3516 . rr #INDENT_BOTH_ACTIVE
3517 . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3519 . ie \\n[#COLUMNS] \{\
3520 . ll \\n[#COL_L_LENGTH]u
3524 . ll \\n[#L_LENGTH]u
3528 . if '\\$1'CLEAR' \{\
3531 . rr #INDENT_STYLE_BOTH
3537 . if !\\n[#IX_WARN] \{\
3538 . tm1 "[mom]: Use of .IX is deprecated. Use .IQ instead.
3539 . tm1 " .IX will continue to behave as before, but to
3540 . tm1 " avoid this message, please update your document.
3546 . rr #INDENT_LEFT_ACTIVE
3547 . rr #INDENT_RIGHT_ACTIVE
3548 . rr #INDENT_BOTH_ACTIVE
3549 . if \\n[#INDENT_STYLE_RIGHT] \{\
3550 . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3552 . ie \\n[#COLUMNS] \{\
3553 . ll \\n[#COL_L_LENGTH]u
3557 . ll \\n[#L_LENGTH]u
3562 . if \\n[#INDENT_STYLE_BOTH] \{\
3563 . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3565 . ie \\n[#COLUMNS] \{\
3566 . ll \\n[#COL_L_LENGTH]u
3570 . ll \\n[#L_LENGTH]u
3575 . if '\\$1'CLEAR' \{\
3576 . if \\n[#INDENT_STYLE_RIGHT] \{\
3577 . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3579 . ie \\n[#COLUMNS] \{\
3580 . ll \\n[#COL_L_LENGTH]u
3584 . ll \\n[#L_LENGTH]u
3589 . if \\n[#INDENT_STYLE_BOTH] \{\
3590 . ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
3592 . ie \\n[#COLUMNS] \{\
3593 . ll \\n[#COL_L_LENGTH]u
3597 . ll \\n[#L_LENGTH]u
3608 . rr #INDENT_STYLE_LEFT
3609 . rr #INDENT_STYLE_RIGHT
3610 . rr #INDENT_STYLE_BOTH
3615 \# =====================================================================
3617 \# +++MULTIPLE COLUMNS+++
3619 \# MULTIPLE COLUMNS ON
3620 \# -------------------
3624 \# Marks the top of a column set
3630 \# MULTIPLE COLUMN RETURN
3631 \# ----------------------
3635 \# Returns to the top of a column set
3643 \# MULTIPLE COLUMNS OFF
3644 \# --------------------
3646 \# <none> | <lead to advance beneath bottom of deepest column>
3648 \# Advances to the end of a column set
3650 \# With no argument, advances to the next baseline (at the current
3651 \# leading value) beneath the longest column. With an argument
3652 \# (which requires a unit of measure), advances arg distance
3653 \# beneath the baseline of the deepest column. If the argument
3654 \# is zero, advances to the baseline of the deepest column.
3663 . nr #MCX_ALD (\\$1)
3665 . ie \\n[#MCX_ALD]=0 .sp |\\n[.h]u-1v
3666 . el .sp |\\n[.h]u+\\n[#MCX_ALD]u
3672 \# =====================================================================
3674 \# +++TYPESETTING SUPPORT MACROS+++
3681 \# Enables/disables traps.
3683 \# EL and TN don't function as advertised on the last line before
3684 \# a trap (when they break the preceding line, they spring the
3685 \# trap, and groff won't back up to the line preceding the trap).
3686 \# TRAP is a kludge to get EL and TN work properly on last lines.
3687 \# The user simply enloses the offending lines in TRAP OFF/TRAP.
3697 \# <none> | <anything>
3699 \# Diverts text so that it doesn't print, or turns the function off.
3701 \# Useful for setting up autotabs where you don't want the line with
3702 \# the tab marks to print.
3704 \# Also aliased as COMMENT, in case user wants to input a batch of
3705 \# text that doesn't print.
3710 . ie '\\$1'' .di NO_FLASH
3722 \# Prints anything. A macro that helps keep my code nicely indented.
3731 \# <none> | <anything>
3733 \# Converts text to caps, or, if OFF, reverts to normal caps/lc.
3735 \# For inline control of capitalization style, use \*[UC] and
3740 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
3776 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
3814 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
3851 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
3891 \# Gets cap-height, x-height, and descender depth of the
3892 \# current font at the current point size.
3894 \# The routine is diverted so it remains invisible to output.
3897 . if '\\n[.z]'FLOAT*DIV' \
3898 . if \\n[dn] .nr saved-dn \\n[dn]
3900 E\R'#CAP_HEIGHT \\n[.cht]'
3901 e\R'#X_HEIGHT \\n[.cht]'
3902 y\R'#DESCENDER \\n[.cdp]'
3904 . ds $CAP_HEIGHT \\n[#CAP_HEIGHT]u
3905 . ds $X_HEIGHT \\n[#X_HEIGHT]u
3906 . ds $DESCENDER \\n[#DESCENDER]u
3908 . if '\\n[.z]'FLOAT*DIV' \
3909 . nr dn \\n[saved-dn]
3912 \# =====================================================================
3914 \# +++TYPESETTING ALIASES+++
3916 .ALIAS ADD_SPACE ALD
3917 .ALIAS CENTRE CENTER
3919 .ALIAS COMMENT SILENT
3920 .ALIAS CONDENSE CONDENSE_OR_EXTEND
3921 .ALIAS EXTEND CONDENSE_OR_EXTEND
3925 .ALIAS HYPHENATION HY
3931 .ALIAS LIG LIGATURES
3932 .ALIAS NEWCOLOUR NEWCOLOR
3933 .ALIAS PADMARKER PAD_MARKER
3936 .ALIAS TABSET TAB_SET
3938 .ALIAS UNDERSCORE_2 UNDERSCORE2
3939 .ALIAS XCOLOUR XCOLOR
3940 .ALIAS PDF_LINK_COLOUR PDF_LINK_COLOR
3941 .ALIAS AUTO_TOC_RELOCATE AUTO_RELOCATE_TOC
3943 \# ====================================================================
3945 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
3946 \# ===============================================
3953 \# Warning message if DOC_<PARAMETER> called before START.
3955 .MAC DOC_MACRO_ERROR END
3956 . if '\\$1'DOC_L_MARGIN' .ds $REPLACEMENT L_MARGIN
3957 . if '\\$1'DOC_R_MARGIN' .ds $REPLACEMENT R_MARGIN
3958 . if '\\$1'DOC_LINE_LENGTH' .ds $REPLACEMENT LL
3959 . if '\\$1'DOC_FAMILY' .ds $REPLACEMENT "FAMILY or FAM
3960 . if '\\$1'DOC_PT_SIZE' .ds $REPLACEMENT PT_SIZE
3961 . if '\\$1'DOC_LEAD' .ds $REPLACEMENT LS
3962 . if '\\$1'DOC_QUAD' .ds $REPLACEMENT QUAD
3963 . tm1 "[mom]: \\$1 at line \\n[.c] of '\\n[.F]' should not be used before START.
3964 . tm1 " Use \\*[$REPLACEMENT] instead.
3968 \# +++PAGE DIMENSIONS+++
3973 \# LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
3975 \# Sets up dimensions for different paper sizes.
3979 . if '\\*[$PAPER]'LETTER' \{\
3983 . if '\\*[$PAPER]'LEGAL' \{\
3987 . if '\\*[$PAPER]'STATEMENT' \{\
3991 . if '\\*[$PAPER]'TABLOID' \{\
3995 . if '\\*[$PAPER]'LEDGER' \{\
3999 . if '\\*[$PAPER]'FOLIO' \{\
4003 . if '\\*[$PAPER]'QUARTO' \{\
4007 . if '\\*[$PAPER]'10x14' \{\
4011 . if '\\*[$PAPER]'EXECUTIVE' \{\
4015 . if '\\*[$PAPER]'A3' \{\
4019 . if '\\*[$PAPER]'A4' \{\
4023 . if '\\*[$PAPER]'A5' \{\
4027 . if '\\*[$PAPER]'B4' \{\
4031 . if '\\*[$PAPER]'B5' \{\
4035 . if '\\$2'LANDSCAPE' \{\
4036 . nr #PAGE_WIDTH_TMP \\n[#PAGE_WIDTH]
4037 . PAGEWIDTH \\n[#PAGE_LENGTH]u
4038 . PAGELENGTH \\n[#PAGE_WIDTH_TMP]u
4040 . if !r#L_MARGIN .L_MARGIN \\n[.o]
4041 . if !r#R_MARGIN .R_MARGIN 1i
4044 \# ====================================================================
4046 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
4051 \# TYPESET | TYPEWRITE [SINGLESPACE]
4053 \# Sets type specs for typewriter-style or typeset output.
4055 \# Number registers: TYPEWRITE=1, TYPESET=2.
4058 . if !\\n[#COLLATE]=1 \{\
4059 . if !d$PAPER .PAPER LETTER
4060 . if '\\$1'TYPEWRITE' \{\
4062 . if !\\n[#DOC_TYPE]=4 .L_MARGIN 6P
4063 . if !\\n[#DOC_TYPE]=4 .R_MARGIN 6P
4064 . ds $TYPEWRITER_FAM C
4065 . ds $TYPEWRITER_PS 12
4068 . ie '\\$2'SINGLESPACE' \{\
4069 . nr #SINGLE_SPACE 1
4071 . ie \\n[#DOC_TYPE]=4 .nr #FOOTER_ADJ \\n[.v]
4072 . el .nr #FOOTER_ADJ \\n[.v]*2
4073 . nr #ORIGINAL_DOC_LEAD \\n[.v]
4076 . if !\\n[#DOC_TYPE]=4 \{\
4078 . nr #FOOTER_ADJ \\n[.v]/2
4079 . nr #ORIGINAL_DOC_LEAD \\n[.v]
4085 . if !\\n[#PP_INDENT] .nr #PP_INDENT 3P
4087 . nr #BOLDER_UNITS 0
4090 . if !\\n[#ITALIC_MEANS_ITALIC] .rm IT
4093 . if !\\n[#ITALIC_MEANS_ITALIC] .rm PREV
4094 . if !\\n[#SLANT_MEANS_SLANT] .UNDERLINE_SLANT
4095 . if !\\n[#ITALIC_MEANS_ITALIC] .UNDERLINE_ITALIC
4096 . if !\\n[#UNDERLINE_QUOTES] .UNDERLINE_QUOTES
4097 . nr #IGNORE_COLUMNS 1
4098 . nr #RULE_WEIGHT 500
4104 . if '\\$1'TYPESET' \{\
4106 . if !\\n[#DOC_TYPE]=4 .L_MARGIN 6P
4107 . if !\\n[#DOC_TYPE]=4 .R_MARGIN 6P
4110 . if !\\n[#DOC_TYPE]=4 .ps 12.5
4111 . if !\\n[#DOC_TYPE]=4 .vs 16
4112 .\" In DEFAULTS, TRAPS is run with this leading, so we need a register to
4113 .\" hold it for use with the .sp in FOOTER
4114 . nr #FOOTER_ADJ 12000
4122 . if !\\n[#PP_INDENT] \{\
4123 . in 2m \"Set indent
4124 . nr #PP_INDENT \\n[.i] \"Read into #PP_INDENT
4125 . in 0 \"Remove indent
4128 . rr #IGNORE_COLUMNS
4130 .\" Set up default style for nine levels of headings
4131 . nr #HD_LEVEL 0 1 \" loop step
4132 . nr #LOOP 9 \" loop count
4133 . while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\
4134 . HEADING_STYLE \\n[#HD_LEVEL] \
4139 .\" Set up default style for nine levels of TOC headings
4140 . TOC_ENTRY_STYLE \\n[#HD_LEVEL] \
4145 .\" Set up decreasing sizes for headings levels 1 - 3, starting at +3
4146 . nr #HD_LEVEL 0 1 \" loop step
4147 . nr #LOOP 3 \" loop count
4149 . while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\
4150 . nr #HD_SIZE_CHANGE \\n-[#HD_SIZE]
4151 . ds $HEAD_\\n[#HD_LEVEL]_SIZE +\\n[#HD_SIZE_CHANGE]
4153 .\" Set up TOC title style
4154 . TOC_TITLE_STYLE FONT R SIZE +0 INDENT 0
4155 .\" Set up captions, labels, sources
4156 . LABELS ALL FONT B AUTOLEAD 2
4157 . LABELS EQN FONT R QUAD RIGHT
4158 . CAPTIONS ALL AUTOLEAD 2
4159 . CAPTIONS EQN QUAD CENTER
4160 . SOURCES TBL AUTOLEAD 2
4164 \# PRINTSTYLE TYPEWRITE control.
4166 .MAC TYPEWRITER_FAMILY END
4167 . ds $TYPEWRITER_FAM \\$1
4170 .ALIAS TYPEWRITER_FAM TYPEWRITER_FAMILY
4172 .MAC TYPEWRITER_SIZE END
4173 . ds $TYPEWRITER_PS \\$1
4177 . fam \\*[$TYPEWRITER_FAM]
4179 . ps \\*[$TYPEWRITER_PS]
4182 \# ITALIC MEANS ITALIC
4183 \# -------------------
4187 \# Instructs TYPEWRITE to treat italics as italics, whether
4188 \# invoked via control lines or inline.
4190 \# ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
4191 \# hence invoking the one automatically turns off the other.
4193 .MAC ITALIC_MEANS_ITALIC END
4194 . if \\n[#PRINT_STYLE]=1 \{\
4195 . nr #ITALIC_MEANS_ITALIC 1
4196 . rr #UNDERLINE_ITALIC
4211 \# Instructs TYPEWRITE to underline italics, whether invoked
4212 \# via control lines or inline.
4214 \# UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
4215 \# hence invoking the one automatically turns off the other.
4217 \# UNDERLINE_ITALIC is the default for TYPEWRITE.
4219 .MAC UNDERLINE_ITALIC END
4220 . if \\n[#PRINT_STYLE]=1 \{\
4221 . nr #UNDERLINE_ITALIC 1
4222 . rr #ITALIC_MEANS_ITALIC
4235 \# <none> | <anything>
4237 \# Instructs TYPEWRITE to underline occurrences of \*[SLANT], or
4238 \# turns feature off.
4240 \# Users may want \*[SLANT] to mean slant in TYPEWRITE, although
4241 \# most of the time, \*[SLANT] most likely means the user wanted
4242 \# italic but didn't have it, ergo the need to tell TYPEWRITE to
4243 \# treat \*[SLANT] as italic (i.e. underlined).
4245 \# UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
4246 \# hence invoking the one automatically turns off the other.
4248 \# UNDERLINE_SLANT is the default for TYPEWRITE.
4250 .MAC UNDERLINE_SLANT END
4251 . if \\n[#PRINT_STYLE]=1 \{\
4252 . rr #SLANT_MEANS_SLANT
4253 . nr #UNDERLINE_SLANT 1
4256 . ds SLANT \ER'#SLANT_ON 1'\E*[UL]
4257 . ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
4261 .MAC SLANT_MEANS_SLANT END
4262 . if \\n[#PRINT_STYLE]=1 \{\
4263 . rr #UNDERLINE_SLANT
4264 . nr #SLANT_MEANS_SLANT 1
4267 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
4268 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
4272 .MAC IGNORE_COLUMNS END
4273 . if \\n[#PRINT_STYLE]=1 .nr #NO_COLUMNS 1
4276 \# ====================================================================
4278 \# +++COPY STYLE -- DRAFT OR FINAL+++
4285 \# Sets registers that are used to determine what to put
4286 \# in the default header, and how to number pages.
4288 \# DOCTYPE must come before COPYSTYLE.
4291 . ds $COPY_STYLE \\$1
4292 . if '\\*[$COPY_STYLE]'DRAFT' \{\
4294 . if !d$DRAFT .DRAFT 1
4296 . if '\\*[$COPY_STYLE]'FINAL' .nr #COPY_STYLE 2
4297 . if !d$CHAPTER_STRING .CHAPTER_STRING "Chapter"
4298 . if !d$DRAFT_STRING .DRAFT_STRING "Draft"
4299 . if !d$REVISION_STRING .REVISION_STRING "Rev."
4301 . if \\n[#DOC_TYPE]=1 \{\
4302 . ie \\n[#COPY_STYLE]=1 \{\
4303 . ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4304 . el .PAGENUM_STYLE roman
4305 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4306 . ie \\n[#DRAFT_WITH_PAGENUM] .ds $HDRFTR_CENTER
4308 . ie '\\*[$REVISION]'' \{\
4309 . ds $HDRFTR_CENTER \
4310 \\*[$DRAFT_STRING]\\*[$DRAFT]
4313 . ds $HDRFTR_CENTER \
4314 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4315 \\*[$REVISION_STRING] \\*[$REVISION]
4321 . ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4322 . el .PAGENUM_STYLE DIGIT
4323 . if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM
4324 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4326 . rr #USER_DEF_HDRFTR_CENTER
4331 . if \\n[#DOC_TYPE]=2 \{\
4333 . ie \\n[#COPY_STYLE]=1 \{\
4334 . ie \\n[#PAGENUM_STYLE_SET] \
4335 . PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4337 . PAGENUM_STYLE roman
4338 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4339 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
4340 . ie '\\*[$CHAPTER]'' \{\
4341 . ie !'\\*[$CHAPTER_TITLE_1]'' \
4342 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4343 . el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
4346 . ie !'\\*[$CHAPTER_TITLE_1]'' \
4347 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4348 . el .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4352 . ie '\\*[$REVISION]'' \{\
4353 . ie '\\*[$CHAPTER]'' \{\
4354 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4355 . ie '\\*[$DRAFT]'' \
4356 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4358 . ds $HDRFTR_CENTER \
4359 \\*[$CHAPTER_TITLE], \
4360 \\*[$DRAFT_STRING]\\*[$DRAFT]
4364 . ie '\\*[$DRAFT]'' \{\
4365 . ds $HDRFTR_CENTER \
4366 \\*[$CHAPTER_STRING]
4369 . ds $HDRFTR_CENTER \
4370 \\*[$CHAPTER_STRING], \
4371 \\*[$DRAFT_STRING]\\*[$DRAFT]
4376 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4377 . ie '\\*[$DRAFT]'' \
4378 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4380 . ds $HDRFTR_CENTER \
4381 \\*[$CHAPTER_TITLE_1], \
4382 \\*[$DRAFT_STRING]\\*[$DRAFT]
4386 . ie '\\*[$DRAFT]'' \{\
4387 . ds $HDRFTR_CENTER \
4388 \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4391 . ds $HDRFTR_CENTER \
4392 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4393 \\*[$DRAFT_STRING]\\*[$DRAFT]
4399 . ie '\\*[$CHAPTER]'' \{\
4400 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4401 . ie '\\*[$DRAFT]'' \{\
4402 . ds $HDRFTR_CENTER \
4403 \\*[$CHAPTER_TITLE], \
4404 \\*[$REVISION_STRING] \\*[$REVISION]
4407 . ds $HDRFTR_CENTER \
4408 \\*[$CHAPTER_TITLE], \
4409 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4410 \\*[$REVISION_STRING] \\*[$REVISION]
4414 . ie '\\*[$DRAFT]'' \{\
4415 . ds $HDRFTR_CENTER \
4416 \\*[$CHAPTER_STRING], \
4417 \\*[$REVISION_STRING] \\*[$REVISION]
4420 . ds $HDRFTR_CENTER \
4421 \\*[$CHAPTER_STRING], \
4422 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4423 \\*[$REVISION_STRING] \\*[$REVISION]
4428 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
4429 . ie '\\*[$DRAFT]'' \{\
4430 . ds $HDRFTR_CENTER \
4431 \\*[$CHAPTER_TITLE], \
4432 \\*[$REVISION_STRING] \\*[$REVISION]
4435 . ds $HDRFTR_CENTER \
4436 \\*[$CHAPTER_TITLE], \
4437 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4438 \\*[$REVISION_STRING] \\*[$REVISION]
4442 . ie '\\*[$DRAFT]'' \{\
4443 . ds $HDRFTR_CENTER \
4444 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4445 \\*[$REVISION_STRING] \\*[$REVISION]
4448 . ds $HDRFTR_CENTER \
4449 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
4450 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4451 \\*[$REVISION_STRING] \\*[$REVISION]
4461 . if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM
4462 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4463 . ie \\n[#PAGENUM_STYLE_SET] \
4464 . PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4465 . el .PAGENUM_STYLE DIGIT
4466 . ie '\\*[$CHAPTER]'' \{\
4467 . ie !'\\*[$CHAPTER_TITLE_1]'' \
4468 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4470 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
4473 . ie !'\\*[$CHAPTER_TITLE_1]'' \
4474 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
4476 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4482 . if \\n[#DOC_TYPE]=3 \{\
4483 . ie \\n[#COPY_STYLE]=1 \{\
4484 . ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4485 . el .PAGENUM_STYLE roman
4486 . ie \\n[#DRAFT_WITH_PAGENUM] \
4487 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4489 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4490 . ie '\\*[$REVISION]'' \{\
4491 . ie '\\*[$DRAFT]'' \
4492 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4494 . ds $HDRFTR_CENTER \
4496 \\*[$DRAFT_STRING]\\*[$DRAFT]
4500 . ie '\\*[$DRAFT]'' \{\
4501 . ds $HDRFTR_CENTER \
4503 \\*[$REVISION_STRING] \\*[$REVISION]
4506 . ds $HDRFTR_CENTER \
4508 \\*[$DRAFT_STRING]\\*[$DRAFT], \
4509 \\*[$REVISION_STRING] \\*[$REVISION]
4516 . if \\n[#DRAFT_WITH_PAGENUM] .rr #DRAFT_WITH_PAGENUM
4517 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
4518 . ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
4519 . el .PAGENUM_STYLE DIGIT
4520 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
4526 \# ====================================================================
4528 \# +++COLLECT DOC INFO -- STRINGS AND REGISTERS FOR REFERENCE MACROS+++
4531 \# various string/register arguments
4533 \# Collect information about documents.
4537 . nr #DOCTITLE_NUM 0 1
4538 . while \\n[#NUM_ARGS]>\\n[#DOCTITLE_NUM] \{\
4539 . ds $DOC_TITLE_\\n+[#DOCTITLE_NUM] \\$\\n[#DOCTITLE_NUM]
4541 . ds $DOC_TITLE \\$*
4542 . PDF_TITLE \\*[$DOC_TITLE]
4545 .MAC TITLE END \"Document title
4546 . ie \\n[#NUM_ARGS]=0 \{\
4547 . if \\n[#TITLE_NUM] \{\
4549 . while \\n[#TITLE_NUM]>\\n[#ITEM] \{\
4550 . rm $TITLE_\\n+[#ITEM]
4557 . while \\n[#NUM_ARGS]>\\n[#TITLE_NUM] \{\
4558 . ds $TITLE_\\n+[#TITLE_NUM] \\$\\n[#TITLE_NUM]
4564 .MAC SUBTITLE END \"Document sub-title
4565 . ie \\n[#NUM_ARGS]=0 \{\
4566 . if \\n[#SUBTITLE_NUM] \{\
4568 . while \\n[#SUBTITLE_NUM]>\\n[#ITEM] \{\
4569 . rm $SUBTITLE_\\n+[#ITEM]
4576 . if '\\$1'DOC_COVER' \{\
4578 . nr #SUBTITLE_DOC_COVER_NUM 0 1
4579 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_DOC_COVER_NUM] \{\
4580 . ds $SUBTITLE_DOC_COVER_\\n+[#SUBTITLE_DOC_COVER_NUM] \
4581 \\$\\n[#SUBTITLE_DOC_COVER_NUM]
4585 . if '\\$1'COVER' \{\
4587 . nr #SUBTITLE_COVER_NUM 0 1
4588 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_COVER_NUM] \{\
4589 . ds $SUBTITLE_COVER_\\n+[#SUBTITLE_COVER_NUM] \
4590 \\$\\n[#SUBTITLE_COVER_NUM]
4594 . nr #SUBTITLE_NUM 0 1
4595 . while \\n[#NUM_ARGS]>\\n[#SUBTITLE_NUM] \{\
4596 . ds $SUBTITLE_\\n+[#SUBTITLE_NUM] \\$\\n[#SUBTITLE_NUM]
4602 .MAC CHAPTER END \"If document is a chapter, the chapter number
4603 . nr #CHAPTER_CALLED 1
4606 . if \B'\\*[$CHAPTER]' .nr #CH_NUM \\*[$CHAPTER]
4609 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
4610 . ie \\n[#NUM_ARGS]=0 \{\
4611 . if \\n[#CHAPTER_TITLE_NUM] \{\
4613 . while \\n[#CHAPTER_TITLE_NUM]>\\n[#ITEM] \{\
4614 . rm $CHAPTER_TITLE_\\n+[#ITEM]
4616 . rr #CHAPTER_TITLE_NUM
4621 . rr #CHAPTER_TITLE_NUM
4622 . nr #CHAPTER_TITLE_NUM 0 1
4623 . while \\n[#NUM_ARGS]>\\n[#CHAPTER_TITLE_NUM] \{\
4624 . ds $CHAPTER_TITLE_\\n+[#CHAPTER_TITLE_NUM] \
4625 \\$\\n[#CHAPTER_TITLE_NUM]
4627 . ds $CHAPTER_TITLE \\$*
4631 .MAC DRAFT END \"Draft number
4632 . ie '\\$1'' .ds $DRAFT
4633 . el .ds $DRAFT " \\$1
4636 .MAC REVISION END \"Revision number
4640 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
4641 . nr #DRAFT_WITH_PAGENUM 1
4644 .MAC AUTHOR END \"Author. Enclose all args fully in double quotes.
4645 . if '\\$1'DOC_COVER' \{\
4647 . nr #AUTHOR_DOCCOVER_NUM 0 1
4648 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_DOCCOVER_NUM] \{\
4649 . ds $AUTHOR_DOCCOVER_\\n+[#AUTHOR_DOCCOVER_NUM] \
4650 \\$\\n[#AUTHOR_DOCCOVER_NUM]
4654 . if '\\$1'COVER' \{\
4656 . nr #AUTHOR_COVER_NUM 0 1
4657 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_COVER_NUM] \{\
4658 . ds $AUTHOR_COVER_\\n+[#AUTHOR_COVER_NUM] \\$\\n[#AUTHOR_COVER_NUM]
4662 . nr #AUTHOR_NUM 0 1
4664 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
4665 . ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
4666 . as $AUTHORS \\*[$AUTHOR_\\n[#AUTHOR_NUM]], \"
4668 . ds $AUTHOR \\*[$AUTHOR_1]
4669 . substring $AUTHORS 0 -2
4670 . ds PDF_AUTHORS \\*[$AUTHORS]
4671 . pdfmomclean PDF_AUTHORS
4672 . nop \!x X ps:exec [/Author (\\*[PDF_AUTHORS]) /DOCINFO pdfmark
4675 .ALIAS EDITOR AUTHOR
4677 .MAC COPYRIGHT END \"For use on cover pages only
4678 . ie \\n[#NUM_ARGS]=1 \{\
4679 . ds $COPYRIGHT \[co]\\$1
4680 . rm $COPYRIGHT_DOCCOVER
4681 . rm $COPYRIGHT_COVER
4684 . if '\\$1'DOC_COVER' .ds $COPYRIGHT_DOCCOVER \[co]\\$2
4685 . if '\\$1'COVER' .ds $COPYRIGHT_COVER \[co]\\$2
4689 .MAC MISC END \"For use on cover pages only; enclose all args in double quotes
4690 . ie \\n[#NUM_ARGS]=0 \{\
4691 . if \\n[#MISC_NUM] \{\
4693 . while \\n[#MISC_NUM]>\\n[#ITEM] \{\
4694 . rm $MISC_\\n+[#ITEM]
4699 . if \\n[#MISC_DOC_COVER_NUM] \{\
4701 . while \\n[#MISC_DOC_COVER_NUM]>\\n[#ITEM] \{\
4702 . rm $MISC_DOC_COVER_\\n+[#ITEM]
4704 . rr #MISC_DOC_COVER_NUM
4707 . if \\n[#MISC_COVER_NUM] \{\
4709 . while \\n[#MISC_COVER_NUM]>\\n[#ITEM] \{\
4710 . rm $MISC_COVER_\\n+[#ITEM]
4712 . rr #MISC_COVER_NUM
4717 . if !'\\$1'DOC_COVER' \{\
4718 . if !'\\$1'COVER' .nr #NEITHER 1
4720 . if !'\\$1'COVER' \{\
4721 . if !'\\$1'DOC_COVER' .nr #NEITHER 1
4723 . if '\\$1'DOC_COVER' \{\
4725 . nr #MISC_DOC_COVER_NUM 0 1
4726 . while \\n[#NUM_ARGS]>\\n[#MISC_DOC_COVER_NUM] \{\
4727 . ds $MISC_DOC_COVER_\\n+[#MISC_DOC_COVER_NUM] \
4728 \\$[\\n[#MISC_DOC_COVER_NUM]]
4730 . nr #NUM_MISCS_DOCCOVER \\n[#NUM_ARGS]
4732 . if '\\$1'COVER' \{\
4734 . nr #MISC_COVER_NUM 0 1
4735 . while \\n[#NUM_ARGS]>\\n[#MISC_COVER_NUM] \{\
4736 . ds $MISC_COVER_\\n+[#MISC_COVER_NUM] \\$[\\n[#MISC_COVER_NUM]]
4738 . nr #NUM_MISCS_COVER \\n[#NUM_ARGS]
4740 . if \\n[#NEITHER]=1 \{\
4742 . while \\n[#NUM_ARGS]>\\n[#MISC_NUM] \{\
4743 . ds $MISC_\\n+[#MISC_NUM] \\$[\\n[#MISC_NUM]]
4745 . nr #NUM_MISCS \\n[#NUM_ARGS]
4751 .MAC PAGENUMBER END \"Page # that appears on page one.
4752 . nr #n%_AT_PAGENUM_SET \\n%
4753 . nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
4754 . rr #n%_AT_PAGENUM_SET
4755 . nr #PAGE_NUM_SET 1
4758 \# ====================================================================
4760 \# +++TYPE OF DOCUMENT+++
4765 \# DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
4767 \# Creates strings and sets registers for document types.
4769 \# Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
4772 . if '\\$1'DEFAULT' .nr #DOC_TYPE 1
4773 . if '\\$1'CHAPTER' .nr #DOC_TYPE 2
4774 . if '\\$1'NAMED' \{\
4778 . if '\\$1'LETTER' \{\
4784 . nr #FOOTER_ADJ \\n[.v]
4787 . INDENT_FIRST_PARAS
4789 . ds $SUITE \En[#SUITE]
4790 . HEADER_MARGIN 3P+6p
4796 . FOOTER_RIGHT_SIZE +0
4797 . FOOTER_RIGHT "\&.../\E*[$SUITE]
4798 . FOOTER_ON_FIRST_PAGE
4803 \# +++LETTER MACROS+++
4805 \# First, create a register to hold incrementing numbers to be
4806 \# appended to LETTERHEAD.
4815 \# Stores date (entered on the line after .DATE) in diversion
4819 . if !'\\n[.z]'' .di
4820 . di LETTERHEAD\\n+[#FIELD]
4821 . ie \\n[#FIELD]=1 \{\
4833 \# Stores addressee address (entered on the line after .TO) in
4834 \# diversion LETTERHEAD<n>
4837 . if !'\\n[.z]'' .di
4838 . di LETTERHEAD\\n+[#FIELD]
4847 \# Stores addresser address (entered on the line after .FROM) in
4848 \# diversion LETTERHEAD<n>
4851 . if !'\\n[.z]'' .di
4852 . di LETTERHEAD\\n+[#FIELD]
4861 \# Stores greeting (entered on the line after .GREETING) in
4862 \# diversion LETTERHEAD<n>
4865 . if !'\\n[.z]'' .di
4866 . di LETTERHEAD\\n+[#FIELD]
4875 \# Stores greeting in diversion CLOSING.
4878 . if '\\*[$SIG_SPACE]'' .ds $SIG_SPACE 3v
4879 . ie ( (2v+\\*[$SIG_SPACE]) > \\n[.t] ) \{\
4883 . tm1 "[mom]: Insufficient room for \\$0 and signature line.
4884 . ab Aborting '\\n[.F]'.
4894 \# <amount to indent closing from left margin>
4896 \# Defines string $CLOSE_INDENT for use in macro, ALL_DONE.
4898 .MAC CLOSING_INDENT END
4899 . ds $CLOSE_INDENT \\$1
4905 \# <amount of space to leave for signature>
4907 \# Defines string $SIG_SPACE for use in macro, ALL_DONE.
4909 .MAC SIGNATURE_SPACE END
4910 . ds $SIG_SPACE \\$1
4918 \# Redefines $FOOTER_RIGHT to blank so that a suite number doesn't
4919 \# appear at the bottom of letter pages.
4925 \# ====================================================================
4929 \# TYPE-STYLE CONTROL MACROS
4930 \# -------------------------
4931 \# The control macros for family, font, size, quad and color are here
4932 \# grouped together. Each (e.g. _FAMILY or _FONT) tests for a calling
4933 \# alias before performing the action(s) appropriate to the calling
4934 \# macro. Defaults for all these guys are set in DEFAULTS, and listed
4935 \# in the "Control Macros" section of the documentation pertinent to
4936 \# the macro whose style is to be changed.
4939 . if '\\$0'AUTHOR_FAMILY' \
4940 . ds $AUTHOR_FAM \\$1
4941 . if '\\$0'BIBLIOGRAPHY_FAMILY' \
4943 . if '\\$0'BIBLIOGRAPHY_STRING_FAMILY' \
4944 . ds $BIB_STRING_FAM \\$1
4945 . if '\\$0'BLOCKQUOTE_FAMILY' \
4946 . ds $BQUOTE_FAM \\$1
4947 . if '\\$0'CITATION_FAMILY' \
4948 . ds $BQUOTE_FAM \\$1
4949 . if '\\$0'CITE_FAMILY' \
4950 . ds $BQUOTE_FAM \\$1
4951 . if '\\$0'CHAPTER_TITLE_FAMILY' \
4952 . ds $CHAPTER_TITLE_FAM \\$1
4953 . if '\\$0'COVER_AUTHOR_FAMILY' \
4954 . ds $COVER_AUTHOR_FAM \\$1
4955 . if '\\$0'COVER_CHAPTER_TITLE_FAMILY' \
4956 . ds $COVER_CHAPTER_TITLE_FAM \\$1
4957 . if '\\$0'COVER_COPYRIGHT_FAMILY' \
4958 . ds $COVER_COPYRIGHT_FAM \\$1
4959 . if '\\$0'COVER_DOCTYPE_FAMILY' \
4960 . ds $COVER_DOCTYPE_FAM \\$1
4961 . if '\\$0'COVER_FAMILY' \
4962 . ds $COVER_FAM \\$1
4963 . if '\\$0'COVER_MISC_FAMILY' \
4964 . ds $COVER_MISC_FAM \\$1
4965 . if '\\$0'COVER_SUBTITLE_FAMILY' \
4966 . ds $COVER_SUBTITLE_FAM \\$1
4967 . if '\\$0'COVER_TITLE_FAMILY' \
4968 . ds $COVER_TITLE_FAM \\$1
4969 . if '\\$0'DOC_COVER_AUTHOR_FAMILY' \
4970 . ds $DOC_COVER_AUTHOR_FAM \\$1
4971 . if '\\$0'DOC_COVER_CHAPTER_TITLE_FAMILY' \
4972 . ds $DOC_COVER_CHAPTER_TITLE_FAM \\$1
4973 . if '\\$0'DOC_COVER_COPYRIGHT_FAMILY' \
4974 . ds $DOC_COVER_COPYRIGHT_FAM \\$1
4975 . if '\\$0'DOC_COVER_DOCTYPE_FAMILY' \
4976 . ds $DOC_COVER_DOCTYPE_FAM \\$1
4977 . if '\\$0'DOC_COVER_FAMILY' \
4978 . ds $DOC_COVER_FAM \\$1
4979 . if '\\$0'DOC_COVER_MISC_FAMILY' \
4980 . ds $DOC_COVER_MISC_FAM \\$1
4981 . if '\\$0'DOC_COVER_SUBTITLE_FAMILY' \
4982 . ds $DOC_COVER_SUBTITLE_FAM \\$1
4983 . if '\\$0'DOC_COVER_TITLE_FAMILY' \
4984 . ds $DOC_COVER_TITLE_FAM \\$1
4985 . if '\\$0'DOCHEADER_FAMILY' \
4986 . ds $DOCHEADER_FAM \\$1
4987 . if '\\$0'DOCTYPE_FAMILY' \
4988 . ds $DOCTYPE_FAM \\$1
4989 . if '\\$0'ENDNOTE_FAMILY' \
4991 . if '\\$0'ENDNOTE_NUMBER_FAMILY' \
4992 . ds $EN_NUMBER_FAM \\$1
4993 . if '\\$0'ENDNOTE_LINENUMBER_FAMILY' \
4994 . ds $EN_LN_FAM \\$1
4995 . if '\\$0'ENDNOTE_STRING_FAMILY' \
4996 . ds $EN_STRING_FAM \\$1
4997 . if '\\$0'ENDNOTE_TITLE_FAMILY' \
4998 . ds $EN_TITLE_FAM \\$1
4999 . if '\\$0'EPIGRAPH_FAMILY' \
5001 . if '\\$0'FOOTNOTE_FAMILY' \
5003 . if '\\$0'HDRFTR_CENTER_FAMILY' \
5004 . ds $HDRFTR_CENTER_FAM \\$1
5005 . if '\\$0'HDRFTR_FAMILY' \{\
5006 . ds $HDRFTR_FAM \\$1
5007 . ds $HDRFTR_LEFT_FAM \\$1
5008 . ds $HDRFTR_CENTER_FAM \\$1
5009 . ds $HDRFTR_RIGHT_FAM \\$1
5011 . if '\\$0'HDRFTR_LEFT_FAMILY' \
5012 . ds $HDRFTR_LEFT_FAM \\$1
5013 . if '\\$0'HDRFTR_RIGHT_FAMILY' \
5014 . ds $HDRFTR_RIGHT_FAM \\$1
5015 . if '\\$0'LINENUMBER_FAMILY' \
5017 . if '\\$0'PAGENUM_FAMILY' \
5018 . ds $PAGE_NUM_FAM \\$1
5019 . if '\\$0'QUOTE_FAMILY' \
5020 . ds $QUOTE_FAM \\$1
5021 . if '\\$0'SUBTITLE_FAMILY' \
5022 . ds $SUBTITLE_FAM \\$1
5023 . if '\\$0'TITLE_FAMILY' \
5024 . ds $TITLE_FAM \\$1
5025 . if '\\$0'TOC_FAMILY' \
5027 . if '\\$0'TOC_FAM' \
5029 . if '\\$0'TOC_HEADER_FAMILY' \
5030 . ds $TOC_HEADER_FAM \\$1
5031 . if '\\$0'TOC_PN_FAMILY' \
5032 . ds $TOC_PN_FAM \\$1
5036 . if '\\$0'AUTHOR_FONT' \
5037 . ds $AUTHOR_FT \\$1
5038 . if '\\$0'BIBLIOGRAPHY_FONT' \
5040 . if '\\$0'BIBLIOGRAPHY_STRING_FONT' \
5041 . ds $BIB_STRING_FT \\$1
5042 . if '\\$0'BLOCKQUOTE_FONT' \
5043 . ds $BQUOTE_FT \\$1
5044 . if '\\$0'CITATION_FONT' \
5045 . ds $BQUOTE_FT \\$1
5046 . if '\\$0'CITE_FONT' \
5047 . ds $BQUOTE_FT \\$1
5048 . if '\\$0'CHAPTER_TITLE_FONT' \
5049 . ds $CHAPTER_TITLE_FT \\$1
5050 . if '\\$0'COVER_AUTHOR_FONT' \
5051 . ds $COVER_AUTHOR_FT \\$1
5052 . if '\\$0'COVER_CHAPTER_TITLE_FONT' \
5053 . ds $COVER_CHAPTER_TITLE_FT \\$1
5054 . if '\\$0'COVER_COPYRIGHT_FONT' \
5055 . ds $COVER_COPYRIGHT_FT \\$1
5056 . if '\\$0'COVER_DOCTYPE_FONT' \
5057 . ds $COVER_DOCTYPE_FT \\$1
5058 . if '\\$0'COVER_MISC_FONT' \
5059 . ds $COVER_MISC_FT \\$1
5060 . if '\\$0'COVER_SUBTITLE_FONT' \
5061 . ds $COVER_SUBTITLE_FT \\$1
5062 . if '\\$0'COVER_TITLE_FONT' \
5063 . ds $COVER_TITLE_FT \\$1
5064 . if '\\$0'DOC_COVER_AUTHOR_FONT' \
5065 . ds $DOC_COVER_AUTHOR_FT \\$1
5066 . if '\\$0'DOC_COVER_CHAPTER_TITLE_FONT' \
5067 . ds $DOC_COVER_CHAPTER_TITLE_FT \\$1
5068 . if '\\$0'DOC_COVER_COPYRIGHT_FONT' \
5069 . ds $DOC_COVER_COPYRIGHT_FT \\$1
5070 . if '\\$0'DOC_COVER_DOCTYPE_FONT' \
5071 . ds $DOC_COVER_DOCTYPE_FT \\$1
5072 . if '\\$0'DOC_COVER_MISC_FONT' \
5073 . ds $DOC_COVER_MISC_FT \\$1
5074 . if '\\$0'DOC_COVER_SUBTITLE_FONT' \
5075 . ds $DOC_COVER_SUBTITLE_FT \\$1
5076 . if '\\$0'DOC_COVER_TITLE_FONT' \
5077 . ds $DOC_COVER_TITLE_FT \\$1
5078 . if '\\$0'DOCTYPE_FONT' \
5079 . ds $DOCTYPE_FT \\$1
5080 . if '\\$0'ENDNOTE_FONT' \
5082 . if '\\$0'ENDNOTE_NUMBER_FONT' \
5083 . ds $EN_NUMBER_FT \\$1
5084 . if '\\$0'ENDNOTE_LINENUMBER_FONT' \
5086 . if '\\$0'ENDNOTE_STRING_FONT' \
5087 . ds $EN_STRING_FT \\$1
5088 . if '\\$0'ENDNOTE_TITLE_FONT' \
5089 . ds $EN_TITLE_FT \\$1
5090 . if '\\$0'EPIGRAPH_FONT' \
5092 . if '\\$0'FOOTNOTE_FONT' \
5094 . if '\\$0'HDRFTR_CENTER_FONT' \
5095 . ds $HDRFTR_CENTER_FT \\$1
5096 . if '\\$0'HDRFTR_LEFT_FONT' \
5097 . ds $HDRFTR_LEFT_FT \\$1
5098 . if '\\$0'HDRFTR_RIGHT_FONT' \
5099 . ds $HDRFTR_RIGHT_FT \\$1
5100 . if '\\$0'LINENUMBER_FONT' \
5102 . if '\\$0'PAGENUM_FONT' \
5103 . ds $PAGE_NUM_FT \\$1
5104 . if '\\$0'QUOTE_FONT' \
5106 . if '\\$0'SUBTITLE_FONT' \
5107 . ds $SUBTITLE_FT \\$1
5108 . if '\\$0'TITLE_FONT' \
5110 . if '\\$0'TOC_HEADER_FONT' \
5111 . ds $TOC_HEADER_FT \\$1
5112 . if '\\$0'TOC_PN_FONT' \
5113 . ds $TOC_PN_FT \\$1
5117 . if '\\$0'AUTHOR_SIZE' \
5118 . ds $AUTHOR_SIZE_CHANGE \\$1
5119 . if '\\$0'BIBLIOGRAPHY_STRING_SIZE' \
5120 . ds $BIB_STRING_SIZE_CHANGE \\$1
5121 . if '\\$0'BLOCKQUOTE_SIZE' \
5122 . ds $BQUOTE_SIZE_CHANGE \\$1
5123 . if '\\$0'CITATION_SIZE' \
5124 . ds $BQUOTE_SIZE_CHANGE \\$1
5125 . if '\\$0'CITE_SIZE' \
5126 . ds $BQUOTE_SIZE_CHANGE \\$1
5127 . if '\\$0'CHAPTER_TITLE_SIZE' \
5128 . ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
5129 . if '\\$0'COVER_AUTHOR_SIZE' \
5130 . ds $COVER_AUTHOR_SIZE_CHANGE \\$1
5131 . if '\\$0'COVER_CHAPTER_TITLE_SIZE' \
5132 . ds $COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
5133 . if '\\$0'COVER_COPYRIGHT_SIZE' \
5134 . ds $COVER_COPYRIGHT_SIZE_CHANGE \\$1
5135 . if '\\$0'COVER_DOCTYPE_SIZE' \
5136 . ds $COVER_DOCTYPE_SIZE_CHANGE \\$1
5137 . if '\\$0'COVER_MISC_SIZE' \
5138 . ds $COVER_MISC_SIZE_CHANGE \\$1
5139 . if '\\$0'COVER_SUBTITLE_SIZE' \
5140 . ds $COVER_SUBTITLE_SIZE_CHANGE \\$1
5141 . if '\\$0'COVER_TITLE_SIZE' \
5142 . ds $COVER_TITLE_SIZE_CHANGE \\$1
5143 . if '\\$0'DOC_COVER_AUTHOR_SIZE' \
5144 . ds $DOC_COVER_AUTHOR_SIZE_CHANGE \\$1
5145 . if '\\$0'DOC_COVER_CHAPTER_TITLE_SIZE' \
5146 . ds $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE \\$1
5147 . if '\\$0'DOC_COVER_COPYRIGHT_SIZE' \
5148 . ds $DOC_COVER_COPYRIGHT_SIZE_CHANGE \\$1
5149 . if '\\$0'DOC_COVER_DOCTYPE_SIZE' \
5150 . ds $DOC_COVER_DOCTYPE_SIZE_CHANGE \\$1
5151 . if '\\$0'DOC_COVER_MISC_SIZE' \
5152 . ds $DOC_COVER_MISC_SIZE_CHANGE \\$1
5153 . if '\\$0'DOC_COVER_SUBTITLE_SIZE' \
5154 . ds $DOC_COVER_SUBTITLE_SIZE_CHANGE \\$1
5155 . if '\\$0'DOC_COVER_TITLE_SIZE' \
5156 . ds $DOC_COVER_TITLE_SIZE_CHANGE \\$1
5157 . if '\\$0'DOCTYPE_SIZE' \
5158 . ds $DOCTYPE_SIZE_CHANGE \\$1
5159 . if '\\$0'ENDNOTE_NUMBER_SIZE' \
5160 . ds $EN_NUMBER_SIZE_CHANGE \\$1
5161 . if '\\$0'ENDNOTE_LINENUMBER_SIZE' \
5162 . ds $EN_LN_SIZE_CHANGE \\$1
5163 . if '\\$0'ENDNOTE_STRING_SIZE' \
5164 . ds $EN_STRING_SIZE_CHANGE \\$1
5165 . if '\\$0'ENDNOTE_TITLE_SIZE' \
5166 . ds $EN_TITLE_SIZE_CHANGE \\$1
5167 . if '\\$0'EPIGRAPH_SIZE' \
5168 . ds $EPI_SIZE_CHANGE \\$1
5169 . if '\\$0'FOOTNOTE_SIZE' \
5170 . ds $FN_SIZE_CHANGE \\$1
5171 . if '\\$0'HDRFTR_CENTER_SIZE' \
5172 . ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
5173 . if '\\$0'HDRFTR_LEFT_SIZE' \
5174 . ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5175 . if '\\$0'HDRFTR_RIGHT_SIZE' \
5176 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
5177 . if '\\$0'HDRFTR_SIZE' \
5178 . ds $HDRFTR_SIZE_CHANGE \\$1
5179 . if '\\$0'LINENUMBER_SIZE' \
5180 . ds $LN_SIZE_CHANGE \\$1
5181 . if '\\$0'PAGENUM_SIZE' \
5182 . ds $PAGE_NUM_SIZE_CHANGE \\$1
5183 . if '\\$0'QUOTE_SIZE' \
5184 . ds $QUOTE_SIZE_CHANGE \\$1
5185 . if '\\$0'SUBTITLE_SIZE' \
5186 . ds $SUBTITLE_SIZE_CHANGE \\$1
5187 . if '\\$0'TITLE_SIZE' \
5188 . ds $TITLE_SIZE_CHANGE \\$1
5189 . if '\\$0'TOC_HEADER_SIZE' \
5190 . ds $TOC_HEADER_SIZE_CHANGE \\$1
5191 . if '\\$0'TOC_PN_SIZE' \
5192 . ds $TOC_PN_SIZE_CHANGE \\$1
5196 . if \\n[#PRINT_STYLE]=1 .return
5197 . if '\\$0'ATTRIBUTE_COLOR' \{\
5198 . nr #ATTRIBUTE_COLOR 1
5199 . ds $ATTRIBUTE_COLOR \\$1
5201 . if '\\$0'AUTHOR_COLOR' \{\
5202 . nr #AUTHOR_COLOR 1
5203 . ds $AUTHOR_COLOR \\$1
5205 . if '\\$0'BLOCKQUOTE_COLOR' \{\
5206 . nr #BQUOTE_COLOR 1
5207 . ds $BQUOTE_COLOR \\$1
5209 . if '\\$0'CITATION_COLOR' \{\
5210 . nr #BQUOTE_COLOR 1
5211 . ds $BQUOTE_COLOR \\$1
5213 . if '\\$0'CITE_COLOR' \{\
5214 . nr #BQUOTE_COLOR 1
5215 . ds $BQUOTE_COLOR \\$1
5217 . if '\\$0'CHAPTER_TITLE_COLOR' \{\
5218 . nr #CHAPTER_TITLE_COLOR 1
5219 . ds $CHAPTER_TITLE_COLOR \\$1
5221 . if '\\$0'CODE_COLOR' \{\
5223 . ds $CODE_COLOR \\$1
5225 . if '\\$0'COVER_ATTRIBUTE_COLOR' \{\
5226 . nr #COVER_ATTRIBUTE_COLOR 1
5227 . ds $COVER_ATTRIBUTE_COLOR \\$1
5229 . if '\\$0'COVER_AUTHOR_COLOR' \{\
5230 . nr #COVER_AUTHOR_COLOR 1
5231 . ds $COVER_AUTHOR_COLOR \\$1
5233 . if '\\$0'COVER_CHAPTER_TITLE_COLOR' \{\
5234 . nr #COVER_CHAPTER_TITLE_COLOR 1
5235 . ds $COVER_CHAPTER_TITLE_COLOR \\$1
5237 . if '\\$0'COVER_COLOR' \{\
5239 . ds $COVER_COLOR \\$1
5241 . if '\\$0'COVER_COPYRIGHT_COLOR' \{\
5242 . nr #COVER_COPYRIGHT_COLOR 1
5243 . ds $COVER_COPYRIGHT_COLOR \\$1
5245 . if '\\$0'COVER_MISC_COLOR' \{\
5246 . nr #COVER_MISC_COLOR 1
5247 . ds $COVER_MISC_COLOR \\$1
5249 . if '\\$0'COVER_TITLE_COLOR' \{\
5250 . nr #COVER_TITLE_COLOR 1
5251 . ds $COVER_TITLE_COLOR \\$1
5253 . if '\\$0'COVER_SUBTITLE_COLOR' \{\
5254 . nr #COVER_SUBTITLE_COLOR 1
5255 . ds $COVER_SUBTITLE_COLOR \\$1
5257 . if '\\$0'COVER_DOCTYPE_COLOR' \{\
5258 . nr #COVER_DOCTYPE_COLOR 1
5259 . ds $COVER_DOCTYPE_COLOR \\$1
5261 . if '\\$0'DOC_COVER_ATTRIBUTE_COLOR' \{\
5262 . nr #DOC_COVER_ATTRIBUTE_COLOR 1
5263 . ds $DOC_COVER_ATTRIBUTE_COLOR \\$1
5265 . if '\\$0'DOC_COVER_AUTHOR_COLOR' \{\
5266 . nr #DOC_COVER_AUTHOR_COLOR 1
5267 . ds $DOC_COVER_AUTHOR_COLOR \\$1
5269 . if '\\$0'DOC_COVER_CHAPTER_TITLE_COLOR' \{\
5270 . nr #DOC_COVER_CHAPTER_TITLE_COLOR 1
5271 . ds $DOC_COVER_CHAPTER_TITLE_COLOR \\$1
5273 . if '\\$0'DOC_COVER_COLOR' \{\
5274 . nr #DOC_COVER_COLOR 1
5275 . ds $DOC_COVER_COLOR \\$1
5277 . if '\\$0'DOC_COVER_COPYRIGHT_COLOR' \{\
5278 . nr #DOC_COVER_COPYRIGHT_COLOR 1
5279 . ds $DOC_COVER_COPYRIGHT_COLOR \\$1
5281 . if '\\$0'DOC_COVER_MISC_COLOR' \{\
5282 . nr #DOC_COVER_MISC_COLOR 1
5283 . ds $DOC_COVER_MISC_COLOR \\$1
5285 . if '\\$0'DOC_COVER_TITLE_COLOR' \{\
5286 . nr #DOC_COVER_TITLE_COLOR 1
5287 . ds $DOC_COVER_TITLE_COLOR \\$1
5289 . if '\\$0'DOC_COVER_SUBTITLE_COLOR' \{\
5290 . nr #DOC_COVER_SUBTITLE_COLOR 1
5291 . ds $DOC_COVER_SUBTITLE_COLOR \\$1
5293 . if '\\$0'DOC_COVER_DOCTYPE_COLOR' \{\
5294 . nr #DOC_COVER_DOCTYPE_COLOR 1
5295 . ds $DOC_COVER_DOCTYPE_COLOR \\$1
5297 . if '\\$0'DOCHEADER_COLOR' \{\
5298 . nr #DOCHEADER_COLOR 1
5299 . ds $DOCHEADER_COLOR \\$1
5301 . if '\\$0'DOCTYPE_COLOR' \{\
5302 . nr #DOCTYPE_COLOR 1
5303 . ds $DOCTYPE_COLOR \\$1
5305 . if '\\$0'ENDNOTE_STRING_COLOR' \{\
5306 . nr #ENDNOTE_STRING_COLOR 1
5307 . ds $ENDNOTE_STRING_COLOR \\$1
5309 . if '\\$0'EPIGRAPH_COLOR' \{\
5311 . ds $EPI_COLOR \\$1
5313 . if '\\$0'FINIS_COLOR' \{\
5315 . ds $FINIS_COLOR \\$1
5317 . if '\\$0'FOOTNOTE_COLOR' \{\
5318 . nr #FOOTNOTE_COLOR 1
5319 . ds $FOOTNOTE_COLOR \\$1
5321 . if '\\$0'HDRFTR_CENTER_COLOR' \{\
5322 . nr #HDRFTR_CENTER_COLOR 1
5323 . ds $HDRFTR_CENTER_COLOR \\$1
5325 . if '\\$0'HDRFTR_COLOR' \{\
5326 . nr #HDRFTR_COLOR 1
5327 . ds $HDRFTR_COLOR \\$1
5329 . if '\\$0'HDRFTR_LEFT_COLOR' \{\
5330 . nr #HDRFTR_LEFT_COLOR 1
5331 . ds $HDRFTR_LEFT_COLOR \\$1
5333 . if '\\$0'HDRFTR_RIGHT_COLOR' \{\
5334 . nr #HDRFTR_RIGHT_COLOR 1
5335 . ds $HDRFTR_RIGHT_COLOR \\$1
5337 . if '\\$0'HDRFTR_RULE_COLOR' \{\
5338 . nr #HDRFTR_RULE_COLOR 1
5339 . ds $HDRFTR_RULE_COLOR \\$1
5341 . if '\\$0'LINEBREAK_COLOR' \{\
5342 . nr #LINEBREAK_COLOR 1
5343 . ds $LINEBREAK_COLOR \\$1
5345 . if '\\$0'LINENUMBER_COLOR' \{\
5346 . nr #LINENUMBER_COLOR 1
5349 . if '\\$0'PAGENUM_COLOR' \{\
5350 . nr #PAGE_NUM_COLOR 1
5351 . ds $PAGENUM_COLOR \\$1
5353 . if '\\$0'QUOTE_COLOR' \{\
5355 . ds $QUOTE_COLOR \\$1
5357 . if '\\$0'SECTION_COLOR' \{\
5358 . nr #LINEBREAK_COLOR 1
5359 . ds $LINEBREAK_COLOR \\$1
5361 . if '\\$0'SUBTITLE_COLOR' \{\
5362 . nr #SUBTITLE_COLOR 1
5363 . ds $SUBTITLE_COLOR \\$1
5365 . if '\\$0'TITLE_COLOR' \{\
5367 . ds $TITLE_COLOR \\$1
5372 . if '\\$0'BIBLIOGRAPHY_QUAD' \{\
5374 . if '\\*[$BIB_QUAD]'R' \
5375 .ab \\$0 at line \\n[.c] must be set to either L or J. Aborting \\n'[.F]'.
5376 . if '\\*[$BIB_QUAD]'C' \
5377 .ab \\$0 at line \\n[.c] must be set to either L or J. Aborting \\n'[.F]'.
5379 . if '\\$0'BIBLIOGRAPHY_STRING_QUAD' \
5380 . ds $BIB_STRING_QUAD \\$1
5381 . if '\\$0'BLOCKQUOTE_QUAD' \
5382 . ds $BQUOTE_QUAD \\$1
5383 . if '\\$0'CITATION_QUAD' \
5384 . ds $BQUOTE_QUAD \\$1
5385 . if '\\$0'CITE_QUAD' \
5386 . ds $BQUOTE_QUAD \\$1
5387 . if '\\$0'COVER_COPYRIGHT_QUAD' \
5388 . ds $COVER_COPYRIGHT_QUAD \\$1
5389 . if '\\$0'COVER_MISC_QUAD' \
5390 . ds $COVER_MISC_QUAD \\$1
5391 . if '\\$0'COVER_QUAD' \
5392 . ds $COVER_QUAD \\$1
5393 . if '\\$0'DOC_COVER_COPYRIGHT_QUAD' \
5394 . ds $DOC_COVER_COPYRIGHT_QUAD \\$1
5395 . if '\\$0'DOC_COVER_MISC_QUAD' \
5396 . ds $DOC_COVER_MISC_QUAD \\$1
5397 . if '\\$0'DOC_COVER_QUAD' \
5398 . ds $DOC_COVER_QUAD \\$1
5399 . if '\\$0'DOCHEADER_QUAD' \
5400 . ds $DOCHEADER_QUAD \\$1
5401 . if '\\$0'DOC_QUAD' \{\
5402 . if !\\n[DOCS] .DOC_MACRO_ERROR \\$0
5404 . QUAD \\*[$DOC_QUAD]
5406 . if '\\$0'ENDNOTE_QUAD' \{\
5408 . if '\\*[$EN_QUAD]'R' \
5409 .ab \\$0 at line \\n[.c] must be set to either L or J. Aborting \\n'[.F]'.
5410 . if '\\*[$EN_QUAD]'C' \
5411 .ab \\$0 at line \\n[.c] must be set to either L or J. Aborting \\n'[.F]'.
5413 . if '\\$0'ENDNOTE_STRING_QUAD' \
5414 . ds $EN_STRING_QUAD \\$1
5415 . if '\\$0'ENDNOTE_TITLE_QUAD' \
5416 . ds $EN_TITLE_QUAD \\$1
5417 . if '\\$0'EPIGRAPH_QUAD' \
5419 . if '\\$0'FOOTNOTE_QUAD' \
5421 . if '\\$0'TOC_HEADER_QUAD' \
5422 . ds $TOC_HEADER_QUAD \\$1
5430 \# Sets up defaults if no values are entered prior to START.
5432 \# The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
5433 \# $REVISION_STRING are in the COPYSTYLE macro.
5436 . if !d $PAPER .PAPER LETTER
5437 . if !\\n[#DOC_TYPE] .DOCTYPE DEFAULT
5438 . ie \\n[#PAGENUM_STYLE_SET] .PAGENUM_STYLE \\*[$PAGENUM_STYLE]
5440 . if !\\n[#COPY_STYLE]=1 .PAGENUM_STYLE DIGIT
5441 . if !\\n[#COPY_STYLE] .COPYSTYLE FINAL
5442 . if \\n[#DRAFT_WITH_PAGENUM] .COPYSTYLE \\*[$COPY_STYLE]
5443 . if \\n[#DOC_TYPE]=4 \{\
5444 . if !\\n[#USER_SET_L_LENGTH] \{\
5445 . R_MARGIN \\n[#R_MARGIN]u
5446 . rr #USER_SET_L_LENGTH
5448 . if \\n[#PRINT_STYLE]=1 .PRINTSTYLE TYPEWRITE SINGLESPACE
5450 . if \\n[#COPY_STYLE]=1 \{\
5454 . if !r #DOC_HEADER .DOCHEADER
5455 . if !r #HEADERS_ON .HEADERS
5456 . if !r #PAGINATE .PAGINATE
5458 . if !r #HEADER_MARGIN .HEADER_MARGIN 4P+6p
5459 . if !r #HEADER_GAP .HEADER_GAP 3P
5461 . if \\n[#FOOTERS_ON] \{\
5463 . ie \\n[#PAGINATE] \
5464 . if \\n[#PAGE_NUM_POS_SET]=0 .PAGENUM_POS TOP CENTER
5466 . if !\\n[#T_MARGIN] .T_MARGIN 6P
5468 . if !\\n[#HEADERS_ON] \{\
5469 . if !\\n[#FOOTERS_ON] \{\
5470 . ie \\n[#PAGE_NUM_V_POS]=1 \{\
5471 . HEADER_MARGIN \\n[#HEADER_MARGIN]
5472 . HEADER_GAP \\n[#HEADER_GAP]
5474 . el .if !r #T_MARGIN .T_MARGIN 6P
5477 . if !r #T_MARGIN .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP]
5478 . if !r #DOCHEADER_ADVANCE .nr #DOCHEADER_ADVANCE \\n[#T_MARGIN]
5479 . if !r #FOOTER_MARGIN .FOOTER_MARGIN 3P
5480 . if !r #FOOTER_GAP .FOOTER_GAP 3P
5481 . if !r #B_MARGIN .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u
5482 . if (\\n[#FOOTER_MARGIN]+\\n[.v]>=\\n[#B_MARGIN]) \{\
5483 . tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
5484 . tm1 " No footers or bottom-of-page page numbers will be printed.
5485 . tm1 " Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
5486 . tm1 " If no footers or bottom-of-page page numbers are required,
5487 . tm1 " invoke .FOOTER_MARGIN 0 before .START
5489 . if !r #HEADER_RULE_GAP .HEADER_RULE_GAP 4p
5490 . if !r #FOOTER_RULE_GAP .FOOTER_RULE_GAP 4p
5491 . if !r #HDRFTR_RULE .HDRFTR_RULE
5492 . if !r #PAGE_NUM_SET .PAGENUMBER 1
5493 .\" Read in number registers and strings for type parameters
5494 . nr #DOC_L_MARGIN \\n[#L_MARGIN]
5495 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
5496 . nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
5497 . if '\\*[$SAVED_DOC_FAM]'' \{\
5498 . ds $DOC_FAM \\*[$FAMILY]
5501 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
5503 . if \\n[#TOC] .nr #DOC_PT_SIZE \\n[#TOC_PS]
5504 . if \\n[#ENDNOTES] .nr #DOC_PT_SIZE \\n[#EN_PS]
5505 . if \\n[#BIBLIOGRAPHY] .nr #DOC_PT_SIZE \\n[#BIB_PS]
5507 . nr #DOC_LEAD \\n[.v]
5508 . nr #DOC@LEAD \\n[#DOC_LEAD]
5509 . if \\n[#AUTO_LEAD] .nr #DOC_AUTOLEAD \\n[#AUTOLEAD_VALUE]
5510 .\" #SAVED_DOC_LEAD is set in COLLATE
5511 . if \\n[#SAVED_DOC_LEAD] \{\
5514 (\\n[#LIST_OF_FIGURES]=0):\
5515 (\\n[#LIST_OF_TABLES]=0):\
5516 (\\n[#LIST_OF_EQUATIONS]=0) \
5517 . if !\\n[#DOC_LEAD]=\\n[#SAVED_DOC_LEAD] .nr #RERUN_TRAPS 1
5519 . ie \\n[#ADJ_DOC_LEAD]=1 .
5521 . if !\\n[#DOC_LEAD_ADJUST_OFF] .DOC_LEAD_ADJUST
5522 . ds $DOC_QUAD \\*[$QUAD_VALUE]
5523 . if '\\*[$FONT]'' .FT R
5524 . if '\\*[$PP_FT]'' .ds $PP_FT \\*[$FONT]
5525 . if !'\\*[$PP_FT]'' .ds $PP_FT \\*[$FONT]
5530 . nr #FN_COUNT_FOR_COLS 0 1
5532 .\" Enable shimming if user hasn't turned it off
5533 . if \\n[#NO_SHIM]=2 .rr #NO_SHIM
5534 .\" General style defaults for both PRINTSTYLEs
5536 . PARA_INDENT \\n[#PP_INDENT]u
5537 . if !d $HDRFTR_FAM .HDRFTR_FAMILY \\*[$DOC_FAM]
5538 . if !d $HDRFTR_SIZE_CHANGE .HDRFTR_SIZE +0
5539 . if !d $PAGE_NUM_FAM .PAGENUM_FAMILY \\*[$DOC_FAM]
5540 . if !d $PAGE_NUM_FT .PAGENUM_FONT R
5541 . if !d $PAGE_NUM_SIZE_CHANGE .PAGENUM_SIZE +0
5542 . if !r #PAGE_NUM_POS_SET .PAGENUM_POS BOTTOM CENTER
5543 . ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
5544 . if \\n[#PAGE_NUM_HYPHENS]=0 .PAGENUM_HYPHENS OFF
5545 . if \\n[#PAGE_NUM_HYPHENS]=1 .PAGENUM_HYPHENS
5547 . el .PAGENUM_HYPHENS
5548 . if !r #HDRFTR_RIGHT_CAPS .HDRFTR_RIGHT_CAPS
5549 . if \\n[#HDRFTR_RIGHT_CAPS]=0 \
5550 . if !d $HDRFTR_RIGHT_SIZE_CHANGE .HDRFTR_RIGHT_SIZE +0
5551 . if !d $FN_FAM .FOOTNOTE_FAMILY \\*[$DOC_FAM]
5552 . if !d $FN_FT .FOOTNOTE_FONT R
5553 . if !d $FN_QUAD .FOOTNOTE_QUAD \\*[$DOC_QUAD]
5554 . if !r #FN_RULE .FOOTNOTE_RULE
5555 . if !r #FN_MARKERS .FOOTNOTE_MARKERS
5556 . if \\n[#FN_MARKERS]=1 \{\
5557 . if \\n[#FN_REF]=1 \
5558 . if !\\n[#FN_MARKER_STYLE] .FOOTNOTE_MARKER_STYLE NUMBER
5559 . if !\\n[#FN_MARKER_STYLE] .FOOTNOTE_MARKER_STYLE STAR
5561 . if !r #EN_MARKER_STYLE .ENDNOTE_MARKER_STYLE SUPERSCRIPT
5562 . if !d $EN_PN_STYLE .ENDNOTES_PAGENUM_STYLE digit
5563 . if !d $EN_FAM .ENDNOTE_FAMILY \\*[$DOC_FAM]
5564 . if !d $EN_FT .ENDNOTE_FONT R
5565 . if !d $EN_QUAD .ENDNOTE_QUAD \\*[$DOC_QUAD]
5566 . if !d $EN_STRING .ENDNOTE_STRING "Endnotes"
5567 . if !d $EN_STRING_FAM .ENDNOTE_STRING_FAMILY \\*[$EN_FAM]
5568 . if !d $EN_STRING_QUAD .ENDNOTE_STRING_QUAD CENTER
5569 . if !r #EN_STRING_UNDERLINE .nr #EN_STRING_UNDERLINE 2
5570 . if !r #EN_STRING_CAPS .ENDNOTE_STRING_CAPS
5571 . if !d $EN_TITLE \{\
5572 . ie \\n[#DOC_TYPE]=2 \{\
5573 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
5574 . ie '\\*[$CHAPTER]'' .ENDNOTE_TITLE "\\*[$CHAPTER_TITLE]"
5575 . el .ENDNOTE_TITLE \
5576 "\\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]"
5579 . ie '\\*[$CHAPTER]'' .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]"
5580 . el .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
5583 . el .ENDNOTE_TITLE "\\*[$TITLE]"
5585 . if !d $EN_TITLE_FAM .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM]
5586 . if !d $EN_TITLE_QUAD .ENDNOTE_TITLE_QUAD LEFT
5587 . if !r #EN_TITLE_UNDERLINE .nr #EN_TITLE_UNDERLINE 1
5588 . if !d $EN_NUMBER_FAM .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM]
5589 . if !d $EN_LN_FAM .ENDNOTE_LINENUMBER_FAMILY \\*[$EN_FAM]
5590 . if !r #EN_NUMBERS_ALIGN_LEFT \{\
5591 . if !r #EN_NUMBERS_ALIGN_RIGHT \{\
5592 . ie !\\n[#EN_MARKER_STYLE]=2 .ENDNOTE_NUMBERS_ALIGN RIGHT 2
5593 . el .ENDNOTE_NUMBERS_ALIGN RIGHT 4
5596 . if !r #EN_LN_GAP .ENDNOTE_LINENUMBER_GAP 1m
5597 . if !r #EN_ALLOWS_HEADERS .ENDNOTES_ALLOWS_HEADERS
5598 . if !d $BIB_PN_STYLE .BIBLIOGRAPHY_PAGENUM_STYLE digit
5599 . if !d $BIB_FAM .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM]
5600 . if !d $BIB_FT .BIBLIOGRAPHY_FONT R
5601 . if !d $BIB_QUAD .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD]
5602 . if !d $BIB_STRING .BIBLIOGRAPHY_STRING "Bibliography"
5603 . if !d $BIB_STRING_FAM .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FAM]
5604 . if !d $BIB_STRING_QUAD .BIBLIOGRAPHY_STRING_QUAD CENTER
5605 . if !r #BIB_STRING_UNDERLINE .nr #BIB_STRING_UNDERLINE 2
5606 . if !r #BIB_STRING_CAPS .BIBLIOGRAPHY_STRING_CAPS
5607 . if !d $TOC_HEADER_STRING .TOC_HEADER_STRING "Contents"
5608 . if !d $TOC_HEADER_QUAD .TOC_HEADER_QUAD LEFT
5609 . if !d $TOC_PN_STYLE .TOC_PAGENUM_STYLE roman
5610 . if !r #TOC_PN_PADDING .TOC_PADDING 3
5612 . if !r #LN_GUTTER .nr #LN_GUTTER 2
5613 . if !r #Q_LN_GUTTER .nr #Q_LN_GUTTER 2
5614 . if !r #BQ_LN_GUTTER .nr #BQ_LN_GUTTER 2
5615 . if !d $LN_FAM .ds $LN_FAM \\*[$DOC_FAM]
5616 . if !d $LN_FT .ds $LN_FT R
5617 . if !d $LN_SIZE_CHANGE .ds $LN_SIZE_CHANGE +0
5618 . if !d $LN_COLOR .ds $LN_COLOR black
5620 . if !\\n[PDFHREF_COLOR_SET] .PDF_LINK_COLOR 0.0 0.3 0.9
5622 . if !d pdf-img:frame-weight .ds pdf-img:frame-weight .5
5623 . if !d pdf-img:frame-color .ds pdf-img:frame-color black
5624 .\" Captions, labels, sources
5625 .\" All at default doc specs except leading, which is autolead 2
5626 . nr label-type-counter 0 1
5627 . while \\n+[label-type-counter]<=4 \{\
5628 . if \\n[label-type-counter]=1 .ds label-type eqn
5629 . if \\n[label-type-counter]=2 .ds label-type pdf-img
5630 . if \\n[label-type-counter]=3 .ds label-type pic
5631 . if \\n[label-type-counter]=4 .ds label-type tbl
5632 . nr spec-type-counter 0 1
5633 . while \\n+[spec-type-counter]<=3 \{\
5634 . if \\n[spec-type-counter]=1 .ds spec-type label
5635 . if \\n[spec-type-counter]=2 .ds spec-type caption
5636 . if \\n[spec-type-counter]=3 .ds spec-type source
5641 .\" String defaults for both PRINTSTYLEs
5642 . ie \\n[#DOC_TYPE]=1 \{\
5643 . ie '\\*[$DOC_TITLE]'' \{\
5644 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5645 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
5648 . if \\n[#COPY_STYLE]=1 .DRAFT_WITH_PAGENUMBER
5649 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5650 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 .ds $HDRFTR_CENTER \\*[$TITLE]
5651 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$DOC_TITLE]
5655 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 .ds $HDRFTR_LEFT \\*[$AUTHOR_1]
5656 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 .ds $HDRFTR_RIGHT \\*[$TITLE]
5658 . if !d $ATTRIBUTE_STRING .ds $ATTRIBUTE_STRING by
5659 . if !d $FINIS_STRING .FINIS_STRING "End"
5660 . if !r #FINIS_STRING_CAPS .nr #FINIS_STRING_CAPS 1
5662 . if !r #DOC_COVERS_OFF .nr #DOC_COVERS 1
5663 . if !r #COVERS_OFF .nr #COVERS 1
5664 . if !d $COVER_COPYRIGHT_QUAD .COVER_COPYRIGHT_QUAD R
5665 . if !d $COVER_MISC_QUAD .COVER_MISC_QUAD L
5666 . if !d $DOC_COVER_COPYRIGHT_QUAD .DOC_COVER_COPYRIGHT_QUAD R
5667 . if !d $DOC_COVER_MISC_QUAD .DOC_COVER_MISC_QUAD L
5668 . if !r #DOC_COVER_UNDERLINE .DOC_COVER_UNDERLINE
5669 . if !r #COVER_UNDERLINE .COVER_UNDERLINE
5670 .\" Defaults for printstyle TYPEWRITE
5671 . if \\n[#PRINT_STYLE]=1 \{\
5674 . if \\n[#UNDERLINE_QUOTES]=1 .UNDERLINE_QUOTES
5675 . if \\n[#UNDERLINE_QUOTES]=0 .UNDERLINE_QUOTES OFF
5676 .\" +Doctype underlining (if NAMED)
5677 . if !r #DOCTYPE_UNDERLINE .nr #DOCTYPE_UNDERLINE 1
5678 .\" +Quotes and blockquotes
5679 . if !r #Q_OFFSET_VALUE \{\
5680 . if '\\*[$Q_OFFSET_VALUE]'' .QUOTE_INDENT 1
5683 . if !r #EPI_OFFSET_VALUE \
5684 . if '\\*[$EPI_OFFSET_VALUE]'' .EPIGRAPH_INDENT 2
5686 . if !d $LINEBREAK_CHAR .LINEBREAK_CHAR * 3 2p
5688 . if !d $FN_SIZE_CHANGE .FOOTNOTE_SIZE +0
5689 . if !r #FN_RULE_LENGTH .FOOTNOTE_RULE_LENGTH 2i
5691 . if !r #EN_PP_INDENT .ENDNOTE_PARA_INDENT \\n[#PP_INDENT]
5693 . if !r #FN_RULE_ADJ .FOOTNOTE_RULE_ADJ 6p
5695 . if !r #SLANT_MEANS_SLANT \{\
5696 . ie \\n[#UNDERLINE_SLANT]=1 .UNDERLINE_SLANT
5697 . el .UNDERLINE_SLANT OFF
5700 .\" Defaults for printstyle TYPESET
5701 . if \\n[#PRINT_STYLE]=2 \{\
5702 . if !d $DOCHEADER_LEAD_ADJ .DOCHEADER_LEAD +0
5704 . if !d $COVER_LEAD_ADJ .COVER_LEAD +0
5705 . if !d $COVER_FAM .COVER_FAMILY \\*[$DOC_FAM]
5707 . if !d $COVER_TITLE_FAM \{\
5708 . ie !d $COVER_FAM .COVER_TITLE_FAMILY \\*[$DOC_FAM]
5709 . el .COVER_TITLE_FAMILY \\*[$COVER_FAM]
5711 . if !d $COVER_TITLE_FT .COVER_TITLE_FONT B
5712 . if !d $COVER_TITLE_SIZE_CHANGE .COVER_TITLE_SIZE +3.5
5714 . if !d $COVER_CHAPTER_TITLE_FAM \{\
5715 . ie !d $COVER_FAM .COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM]
5716 . el .COVER_CHAPTER_TITLE_FAMILY \\*[$COVER_FAM]
5718 . if !d $COVER_CHAPTER_TITLE_FT .COVER_CHAPTER_TITLE_FONT BI
5719 . if !d $COVER_CHAPTER_TITLE_SIZE_CHANGE .COVER_CHAPTER_TITLE_SIZE +4
5721 . if !d $COVER_SUBTITLE_FAM \{\
5722 . ie !d $COVER_FAM .COVER_SUBTITLE_FAMILY \\*[$DOC_FAM]
5723 . el .COVER_SUBTITLE_FAMILY \\*[$COVER_FAM]
5725 . if !d $COVER_SUBTITLE_FT .COVER_SUBTITLE_FONT R
5726 . if !d $COVER_SUBTITLE_SIZE_CHANGE .COVER_SUBTITLE_SIZE +0
5727 .\" (attribution and author[s])
5728 . if !d $COVER_AUTHOR_FAM \{\
5729 . ie !d $COVER_FAM .COVER_AUTHOR_FAMILY \\*[$DOC_FAM]
5730 . el .COVER_AUTHOR_FAMILY \\*[$COVER_FAM]
5732 . if !d $COVER_AUTHOR_FT .COVER_AUTHOR_FONT I
5733 . if !d $COVER_AUTHOR_SIZE_CHANGE .COVER_AUTHOR_SIZE +0
5734 .\" (doctype if "named")
5735 . if !d $COVER_DOCTYPE_FAM \{\
5736 . ie !d $COVER_FAM .COVER_DOCTYPE_FAMILY \\*[$DOC_FAM]
5737 . el .COVER_DOCTYPE_FAMILY \\*[$COVER_FAM]
5739 . if !d $COVER_DOCTYPE_FT .COVER_DOCTYPE_FONT BI
5740 . if !d $COVER_DOCTYPE_SIZE_CHANGE .COVER_DOCTYPE_SIZE +3
5742 . if !d $COVER_COPYRIGHT_FAM \{\
5743 . ie !d $COVER_FAM .COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM]
5744 . el .COVER_COPYRIGHT_FAMILY \\*[$COVER_FAM]
5746 . if !d $COVER_COPYRIGHT_FT .COVER_COPYRIGHT_FONT R
5747 . if !d $COVER_COPYRIGHT_SIZE_CHANGE .COVER_COPYRIGHT_SIZE -2
5749 . if !d $COVER_MISC_FAM .COVER_MISC_FAMILY \\*[$DOC_FAM]
5750 . if !d $COVER_MISC_FT .COVER_MISC_FONT R
5751 . if !d $COVER_MISC_SIZE_CHANGE .COVER_MISC_SIZE -2
5752 . if !r #COVER_MISC_AUTOLEAD .COVER_MISC_AUTOLEAD 2
5754 . if !d $DOC_COVER_LEAD_ADJ .DOC_COVER_LEAD +0
5755 . if !d $DOC_COVER_FAM .DOC_COVER_FAMILY \\*[$DOC_FAM]
5757 . if !d $DOC_COVER_TITLE_FAM \{\
5758 . ie !d $DOC_COVER_FAM .DOC_COVER_TITLE_FAMILY \\*[$DOC_FAM]
5759 . el .DOC_COVER_TITLE_FAMILY \\*[$DOC_COVER_FAM]
5761 . if !d $DOC_COVER_TITLE_FT .DOC_COVER_TITLE_FONT B
5762 . if !d $DOC_COVER_TITLE_SIZE_CHANGE .DOC_COVER_TITLE_SIZE +3.5
5764 . if !d $DOC_COVER_CHAPTER_TITLE_FAM \{\
5765 . ie !d $DOC_COVER_FAM .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_FAM]
5766 . el .DOC_COVER_CHAPTER_TITLE_FAMILY \\*[$DOC_COVER_FAM]
5768 . if !d $DOC_COVER_CHAPTER_TITLE_FT .DOC_COVER_CHAPTER_TITLE_FONT BI
5769 . if !d $DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE .DOC_COVER_CHAPTER_TITLE_SIZE +4
5771 . if !d $DOC_COVER_SUBTITLE_FAM \{\
5772 . ie !d $DOC_COVER_FAM .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_FAM]
5773 . el .DOC_COVER_SUBTITLE_FAMILY \\*[$DOC_COVER_FAM]
5775 . if !d $DOC_COVER_SUBTITLE_FT .DOC_COVER_SUBTITLE_FONT R
5776 . if !d $DOC_COVER_SUBTITLE_SIZE_CHANGE .DOC_COVER_SUBTITLE_SIZE +0
5777 .\" (attribution and author[s])
5778 . if !d $DOC_COVER_AUTHOR_FAM \{\
5779 . ie !d $DOC_COVER_FAM .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_FAM]
5780 . el .DOC_COVER_AUTHOR_FAMILY \\*[$DOC_COVER_FAM]
5782 . if !d $DOC_COVER_AUTHOR_FT .DOC_COVER_AUTHOR_FONT I
5783 . if !d $DOC_COVER_AUTHOR_SIZE_CHANGE .DOC_COVER_AUTHOR_SIZE +0
5784 .\" (doctype if "named")
5785 . if !d $DOC_COVER_DOCTYPE_FAM \{\
5786 . ie !d $DOC_COVER_FAM .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_FAM]
5787 . el .DOC_COVER_DOCTYPE_FAMILY \\*[$DOC_COVER_FAM]
5789 . if !d $DOC_COVER_DOCTYPE_FT .DOC_COVER_DOCTYPE_FONT BI
5790 . if !d $DOC_COVER_DOCTYPE_SIZE_CHANGE .DOC_COVER_DOCTYPE_SIZE +3
5792 . if !d $DOC_COVER_COPYRIGHT_FAM \{\
5793 . ie !d $DOC_COVER_FAM .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_FAM]
5794 . el .DOC_COVER_COPYRIGHT_FAMILY \\*[$DOC_COVER_FAM]
5796 . if !d $DOC_COVER_COPYRIGHT_FT .DOC_COVER_COPYRIGHT_FONT R
5797 . if !d $DOC_COVER_COPYRIGHT_SIZE_CHANGE .DOC_COVER_COPYRIGHT_SIZE -2
5799 . if !d $DOC_COVER_MISC_FAM .DOC_COVER_MISC_FAMILY \\*[$DOC_FAM]
5800 . if !d $DOC_COVER_MISC_FT .DOC_COVER_MISC_FONT R
5801 . if !d $DOC_COVER_MISC_SIZE_CHANGE .DOC_COVER_MISC_SIZE -2
5802 . if !r #DOC_COVER_MISC_AUTOLEAD .DOC_COVER_MISC_AUTOLEAD 2
5804 . if !d $DOCHEADER_FAM .DOCHEADER_FAMILY \\*[$DOC_FAM]
5805 . if !d $TITLE_FAM \{\
5806 . ie !d $DOCHEADER_FAM .TITLE_FAMILY \\*[$DOC_FAM]
5807 . el .TITLE_FAMILY \\*[$DOCHEADER_FAM]
5809 . if !d $TITLE_FT .TITLE_FONT B
5810 . if !d $TITLE_SIZE_CHANGE \{\
5811 . ie \\n[#DOC_TYPE]=2 .TITLE_SIZE +4
5812 . el .TITLE_SIZE +3.5
5814 . if !d $CHAPTER_TITLE_FAM \{\
5815 . ie !d $DOCHEADER_FAM .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM]
5816 . el .CHAPTER_TITLE_FAMILY \\*[$DOCHEADER_FAM]
5818 . if !d $CHAPTER_TITLE_FT .CHAPTER_TITLE_FONT BI
5819 . if !d $CHAPTER_TITLE_SIZE_CHANGE .CHAPTER_TITLE_SIZE +4
5820 . if !d $SUBTITLE_FAM \{\
5821 . ie !d $DOCHEADER_FAM .SUBTITLE_FAMILY \\*[$DOC_FAM]
5822 . el .SUBTITLE_FAMILY \\*[$DOCHEADER_FAM]
5824 . if !d $SUBTITLE_FT .SUBTITLE_FONT R
5825 . if !d $SUBTITLE_SIZE_CHANGE .SUBTITLE_SIZE +0
5826 . if !d $AUTHOR_FAM \{\
5827 . ie !d $DOCHEADER_FAM .AUTHOR_FAMILY \\*[$DOC_FAM]
5828 . el .AUTHOR_FAMILY \\*[$DOCHEADER_FAM]
5830 . if !d $AUTHOR_FT .AUTHOR_FONT I
5831 . if !d $AUTHOR_SIZE_CHANGE .AUTHOR_SIZE +0
5832 . if !d $DOCTYPE_FAM \{\
5833 . ie !d $DOCHEADER_FAM .DOCTYPE_FAMILY \\*[$DOC_FAM]
5834 . el .DOCTYPE_FAMILY \\*[$DOCHEADER_FAM]
5836 . if !d $DOCTYPE_FT .DOCTYPE_FONT BI
5837 . if !d $DOCTYPE_SIZE_CHANGE .DOCTYPE_SIZE +3
5838 . if !r #DOCTYPE_UNDERLINE .DOCTYPE_UNDERLINE
5839 .\" +Headers and footers
5840 . if !d $HDRFTR_LEFT_FAM .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM]
5841 . if !d $HDRFTR_LEFT_FT .HDRFTR_LEFT_FONT R
5842 . if \\n[#HDRFTR_LEFT_CAPS] \
5843 . if !d $HDRFTR_LEFT_SIZE_CHANGE .HDRFTR_LEFT_SIZE -2
5844 . if !d $HDRFTR_LEFT_SIZE_CHANGE .HDRFTR_LEFT_SIZE -.5
5845 . if !d $HDRFTR_CENTER_FAM .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
5846 . if !d $HDRFTR_CENTER_FT .HDRFTR_CENTER_FONT I
5847 . if \\n[#HDRFTR_CENTER_CAPS] \
5848 . if !d $HDRFTR_CENTER_SIZE_CHANGE .HDRFTR_CENTER_SIZE -2
5849 . if !d $HDRFTR_CENTER_SIZE_CHANGE .HDRFTR_CENTER_SIZE -.5
5850 . if !d $HDRFTR_RIGHT_FAM .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]
5851 . if !d $HDRFTR_RIGHT_FT .HDRFTR_RIGHT_FONT R
5852 . if \\n[#HDRFTR_RIGHT_CAPS] \
5853 . if !d $HDRFTR_RIGHT_SIZE_CHANGE .HDRFTR_RIGHT_SIZE -2
5854 . if !d $HDRFTR_RIGHT_SIZE_CHANGE .HDRFTR_RIGHT_SIZE -.5
5856 . if !d $QUOTE_FAM .QUOTE_FAMILY \\*[$DOC_FAM]
5857 . if !d $QUOTE_FT .QUOTE_FONT I
5858 . if !d $QUOTE_SIZE_CHANGE .QUOTE_SIZE+0
5859 . if !r #Q_OFFSET_VALUE \
5860 . if '\\*[$Q_OFFSET_VALUE]'' .QUOTE_INDENT 3
5862 .\" Note: the leading for quotes and blockquotes is set after .DEFAULTS in START
5863 . if !d $BQUOTE_FAM .BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
5864 . if !d $BQUOTE_FT .BLOCKQUOTE_FONT R
5865 . if !d $BQUOTE_SIZE_CHANGE .BLOCKQUOTE_SIZE -1
5866 . if !d $BQUOTE_QUAD .BLOCKQUOTE_QUAD LEFT
5868 . if !d $EPI_FAM .EPIGRAPH_FAMILY \\*[$DOC_FAM]
5869 . if !d $EPI_FT .EPIGRAPH_FONT R
5870 . if !d $EPI_SIZE_CHANGE .EPIGRAPH_SIZE -1.5
5871 . if !r #EPI_AUTOLEAD .EPIGRAPH_AUTOLEAD 2
5872 . if !d $EPI_QUAD .EPIGRAPH_QUAD \\*[$DOC_QUAD]
5873 . if !r #EPI_OFFSET_VALUE \
5874 . if '\\*[$EPI_OFFSET_VALUE]'' .EPIGRAPH_INDENT 3
5876 . if !d $LINEBREAK_CHAR .LINEBREAK_CHAR * 3 3p
5877 . if !d $LINEBREAK_COLOR .LINEBREAK_COLOR black
5879 . if !r #FN_RULE_LENGTH .FOOTNOTE_RULE_LENGTH 4P
5880 . if !r #FN_RULE_ADJ .FOOTNOTE_RULE_ADJ 3p
5881 . if !d $FN_SIZE_CHANGE .FOOTNOTE_SIZE -2
5882 . if !r #FN_AUTOLEAD .FOOTNOTE_AUTOLEAD 2
5884 . if !r #EN_PS .ENDNOTE_PT_SIZE (\\n[#DOC_PT_SIZE]u)
5885 . if !d $EN_STRING_FT .ENDNOTE_STRING_FONT B
5886 . if !d $EN_STRING_SIZE_CHANGE .ENDNOTE_STRING_SIZE +1
5887 . if !d $EN_TITLE_FT .ENDNOTE_TITLE_FONT B
5888 . if !d $EN_TITLE_SIZE_CHANGE .ENDNOTE_TITLE_SIZE +0
5889 . if !d $EN_NUMBER_FT .ENDNOTE_NUMBER_FONT B
5890 . if !d $EN_LN_FT .ENDNOTE_LINENUMBER_FONT R
5891 . if !d $EN_NUMBER_SIZE_CHANGE .ENDNOTE_NUMBER_SIZE +0
5892 . if !d $EN_LN_SIZE_CHANGE .ENDNOTE_LINENUMBER_SIZE +0
5893 . if !r #EN_PP_INDENT .ENDNOTE_PARA_INDENT 1.5m
5894 . if !d $EN_SPACE .ENDNOTE_SPACING 0
5896 . if !r #BIB_LIST .BIBLIOGRAPHY_TYPE PLAIN
5897 . if !r #BIB_PS .BIBLIOGRAPHY_PT_SIZE (\\n[#DOC_PT_SIZE]u)
5898 . if !d $BIB_STRING_FT .BIBLIOGRAPHY_STRING_FONT B
5899 . if !d $BIB_STRING_SIZE_CHANGE .BIBLIOGRAPHY_STRING_SIZE +1
5900 .\" +Table of contents
5901 . if !d $TOC_FAM .TOC_FAMILY \\*[$DOC_FAM]
5902 . if !r #TOC_PS .TOC_PT_SIZE (\\n[#DOC_PT_SIZE]u)
5903 . if '\\*[$TOC_LEAD]'' .TOC_LEAD \\n[#DOC@LEAD]u ADJUST
5904 . if !d $TOC_HEADER_FAM .TOC_HEADER_FAMILY \\*[$TOC_FAM]
5905 . if !d $TOC_HEADER_SIZE_CHANGE .TOC_HEADER_SIZE +4
5906 . if !d $TOC_HEADER_FT .TOC_HEADER_FONT B
5907 . if !d $TOC_PN_FAM .TOC_PN_FAMILY \\*[$TOC_FAM]
5908 . if !d $TOC_PN_FT .TOC_PN_FONT R
5909 . if !d $TOC_PN_SIZE_CHANGE .TOC_PN_SIZE +0
5912 . if !r #EN_REF .nr #FN_REF 1
5913 . if !d $REF_FN_INDENT \{\
5914 . if \\n[#PRINT_STYLE]=1 .INDENT_REFS FOOTNOTE .5i
5915 . if \\n[#PRINT_STYLE]=2 .INDENT_REFS FOOTNOTE 2m
5917 . if !d $REF_EN_INDENT \{\
5918 . if \\n[#PRINT_STYLE]=1 .INDENT_REFS ENDNOTE .5i
5919 . if \\n[#PRINT_STYLE]=2 .INDENT_REFS ENDNOTE 2m
5921 . if !d $REF_BIB_INDENT \{\
5922 . if \\n[#PRINT_STYLE]=1 .INDENT_REFS BIBLIO .5i
5923 . if \\n[#PRINT_STYLE]=2 .INDENT_REFS BIBLIO 2m
5925 .\" Define strings for idem entries
5926 . if \\n[#PRINT_STYLE]=1 .char \[idem] \[hy]\[hy]\[hy]
5927 . if \\n[#PRINT_STYLE]=2 .char \[idem] \v'-.3m'\l'3m'\v'.3m'
5928 .\" Adjust doc leading for PRINTSTYLE TYPESET
5929 . if \\n[#PRINT_STYLE]=2 \
5930 . if \\n[#ADJ_DOC_LEAD]=1 .DOC_LEAD_ADJUST
5931 .\" This diversion is to get a value for #FN_AUTOLEAD
5933 . if \\n[#AUTO_LEAD] \{\
5934 . nr #RESTORE_AUTO_LEAD 1
5935 . nr #SAVED_AUTOLEAD_VALUE \\n[#AUTOLEAD_VALUE]
5938 . if \\n[#PRINT_STYLE]=1 \{\
5939 . ps \\*[$TYPEWRITER_PS]
5940 . ie \\n[#SINGLE_SPACE]=1 .vs \\n[#ORIGINAL_DOC_LEAD]u
5941 . el .vs \\n[#ORIGINAL_DOC_LEAD]u/2u
5943 . if \\n[#PRINT_STYLE]=2 \{\
5944 . ps \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
5945 . vs \\n[.ps]u+\\n[#FN_AUTOLEAD]u
5947 . nr #FN_LEAD \\n[#LEAD]
5950 . if \\n[#RESTORE_AUTO_LEAD] \{\
5952 . nr #AUTOLEAD_VALUE \\n[#SAVED_AUTOLEAD_VALUE]
5954 . ie !\\n[#COLLATE] \{\
5955 .\" DOC_LEAD adjusted (or not) here
5957 . if \\n[#REMOVE_ADJ] .DOC_LEAD \\n[#DOC_LEAD]u-\\n[#DOC_LEAD_ADJ]u
5958 .\" Endnote, bibliography and toc leading
5959 . nr #OK_PROCESS_LEAD 1
5960 . nr #RESTORE_DOC_LEAD \\n[.v]
5961 . nr #RESTORE_B_MARGIN \\n[#B_MARGIN]
5962 . if \\n[#PRINT_STYLE]=1 \{\
5963 . ie \\n[#SINGLE_SPACE] \{\
5964 . ENDNOTE_LEAD 12 ADJUST
5965 . BIBLIOGRAPHY_LEAD 12 ADJUST
5968 . ie \\n[#EN_SINGLESPACE] .ENDNOTE_LEAD 12 ADJUST
5969 . el .ENDNOTE_LEAD 24 ADJUST
5970 . ie \\n[#BIB_SINGLESPACE] .BIBLIOGRAPHY_LEAD 12 ADJUST
5971 . el .BIBLIOGRAPHY_LEAD 24 ADJUST
5974 . if \\n[#PRINT_STYLE]=2 \{\
5975 . ie !d $EN_LEAD .ENDNOTE_LEAD \\n[#UNADJUSTED_DOC_LEAD]u ADJUST
5976 . el .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD]
5977 . ie !d $BIB_LEAD .BIBLIOGRAPHY_LEAD \\n[#UNADJUSTED_DOC_LEAD]u ADJUST
5978 . el .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD]
5979 . ie !d $TOC_LEAD .TOC_LEAD \\n[#UNADJUSTED_DOC_LEAD]u \\*[$ADJUST_TOC_LEAD]
5980 . el .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD]
5982 . ie !d $BIB_SPACE .BIBLIOGRAPHY_SPACING 0
5984 . if \\n[#DEFER_BIB_SPACING]=1 \{\
5985 . BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE]
5986 . rr #DEFER_BIB_SPACING
5989 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
5990 . nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
5991 . vs \\n[#DOC_LEAD]u
5994 . if \\n[#COLLATE] \{\
5995 . if !\\n[#PRINT_STYLE]=1 \{\
5996 . if \\n[#RERUN_TRAPS] \{\
6003 .\" Set default heading and toc-entry family if not done already
6004 . nr #HD_LEVEL 0 1 \" loop step
6005 . nr #LOOP 9 \" loop count
6006 . while \\n+[#HD_LEVEL]<=\\n[#LOOP] \{\
6007 . if '\\*[$HEAD_\\n[#HD_LEVEL]_FAM]'' \
6008 . ds $HEAD_\\n[#HD_LEVEL]_FAM \\*[$DOC_FAM]
6009 . if '\\*[$HEAD_\\n[#HD_LEVEL]_BASELINE_ADJ]'' \
6010 . ds $HEAD_\\n[#HD_LEVEL]_BASELINE_ADJ \\n[.v]/10
6011 . if '\\*[$TOC_HEAD_\\n[#HD_LEVEL]_FAM]'' \
6012 . ds $TOC_HEAD_\\n[#HD_LEVEL]_FAM \\*[$DOC_FAM]
6014 . if '\\*[$TOC_TITLE_FAM]'' .ds $TOC_TITLE_FAM \\*[$DOC_FAM]
6015 .\" Re-run MNinit to capture strings and registers set in DEFAULTS.
6016 . if !'\\*[$MN-arg1]'' \{\
6018 \\*[$MN-arg1] \\*[$MN-arg2] \
6019 \\*[$MN-arg3] \\*[$MN-arg4] \
6020 \\*[$MN-arg5] \\*[$MN-arg6] \
6021 \\*[$MN-arg7] \\*[$MN-arg8] \
6024 . if \\n[#PRINT_STYLE]=1 .nr #IGNORE 1
6025 . if \\n[#AUTO_LEAD] \{\
6027 . rr #AUTOLEAD_VALUE
6031 \# ====================================================================
6033 \# +++START THE DOCUMENT+++
6040 \# Reads in default document style parameters and any parameters
6041 \# the user has changed before issuing START.
6042 \# Using the information gathered in the opening macros,
6043 \# prints appropriate title (or chapter #), subtitle, author
6044 \# and document type (if appropriate).
6046 \# The .PRINT \& (zero-width character) is required to get the
6047 \# subsequent .sp request to work as advertised.
6049 \# The overall document line length, family, and point-size
6050 \# are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
6051 \# use in the HEADER and FOOTER macros.
6053 \# First, define some strings for point sizes
6057 .ds $DOC_COVER_AUTHOR_PT_SIZE \
6058 \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_AUTHOR_SIZE_CHANGE]
6059 .ds $DOC_COVER_CHAPTER_TITLE_PT_SIZE \
6060 \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_CHAPTER_TITLE_SIZE_CHANGE]
6061 .ds $DOC_COVER_COPYRIGHT_PT_SIZE \
6062 \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_COPYRIGHT_SIZE_CHANGE]
6063 .ds $DOC_COVER_DOCTYPE_PT_SIZE \
6064 \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_DOCTYPE_SIZE_CHANGE]
6065 .ds $DOC_COVER_MISC_PT_SIZE \
6066 \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_MISC_SIZE_CHANGE]
6067 .ds $DOC_COVER_SUBTITLE_PT_SIZE \
6068 \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_SUBTITLE_SIZE_CHANGE]
6069 .ds $DOC_COVER_TITLE_PT_SIZE \
6070 \\n[#DOC_PT_SIZE]u\\*[$DOC_COVER_TITLE_SIZE_CHANGE]
6072 .ds $COVER_AUTHOR_PT_SIZE \
6073 \\n[#DOC_PT_SIZE]u\\*[$COVER_AUTHOR_SIZE_CHANGE]
6074 .ds $COVER_CHAPTER_TITLE_PT_SIZE \
6075 \\n[#DOC_PT_SIZE]u\\*[$COVER_CHAPTER_TITLE_SIZE_CHANGE]
6076 .ds $COVER_COPYRIGHT_PT_SIZE \
6077 \\n[#DOC_PT_SIZE]u\\*[$COVER_COPYRIGHT_SIZE_CHANGE]
6078 .ds $COVER_DOCTYPE_PT_SIZE \
6079 \\n[#DOC_PT_SIZE]u\\*[$COVER_DOCTYPE_SIZE_CHANGE]
6080 .ds $COVER_MISC_PT_SIZE \
6081 \\n[#DOC_PT_SIZE]u\\*[$COVER_MISC_SIZE_CHANGE]
6082 .ds $COVER_SUBTITLE_PT_SIZE \
6083 \\n[#DOC_PT_SIZE]u\\*[$COVER_SUBTITLE_SIZE_CHANGE]
6084 .ds $COVER_TITLE_PT_SIZE \
6085 \\n[#DOC_PT_SIZE]u\\*[$COVER_TITLE_SIZE_CHANGE]
6087 .ds $AUTHOR_PT_SIZE \
6088 \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
6089 .ds $CHAPTER_TITLE_PT_SIZE \
6090 \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
6091 .ds $COPYRIGHT_PT_SIZE \
6092 \\n[#DOC_PT_SIZE]u\\*[$COPYRIGHT_SIZE_CHANGE]
6093 .ds $DOCTYPE_PT_SIZE \
6094 \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
6095 .ds $SUBTITLE_PT_SIZE \
6096 \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
6097 .ds $TITLE_PT_SIZE \
6098 \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
6100 \# Next, some utility macros for various routines to prevent repetition
6102 .MAC DOC_HEADER_QUAD END
6103 . if '\\$0'DOC_HEADER_QUAD' .ds $CALLING_MACRO DOCHEADER
6104 . if '\\$0'COVER_H_POS' .ds $CALLING_MACRO COVER
6105 . if '\\$0'DOC_COVER_H_POS' .ds $CALLING_MACRO DOC_COVER
6106 . ie !'\\*[$\\*[$CALLING_MACRO]_QUAD]'' \{\
6107 . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'L' .LEFT
6108 . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'LEFT' .LEFT
6109 . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'R' .RIGHT
6110 . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'RIGHT' .RIGHT
6111 . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'C' .RIGHT
6112 . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'CENTER' .CENTER
6113 . if '\\*[$\\*[$CALLING_MACRO]_QUAD]'CENTRE' .CENTER
6118 \# Aliases for DOC_HEADER_QUAD
6120 .ALIAS COVER_H_POS DOC_HEADER_QUAD
6121 .ALIAS DOC_COVER_H_POS DOC_HEADER_QUAD
6123 .MAC PRINT_AUTHORS END
6124 . ie r#DOING_COVER \{\
6125 . if \\n[#DOC_COVER]=1 \{\
6126 . ie !'\\*[$AUTHOR_DOCCOVER_1]'' \{\
6127 . nr #AUTHORS \\n[#AUTHOR_DOCCOVER_NUM]
6128 . nr #NEXT_AUTHOR 0 1
6129 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6130 . ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \
6132 \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_DOCCOVER_\\n+[#NEXT_AUTHOR]]\m[]
6133 . el .PRINT \\*[$AUTHOR_DOCCOVER_\\n+[#NEXT_AUTHOR]]
6137 . nr #AUTHORS \\n[#AUTHOR_NUM]
6138 . nr #NEXT_AUTHOR 0 1
6139 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6140 . ie \\n[#DOC_COVER_AUTHOR_COLOR]=1 \
6142 \m[\\*[$DOC_COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6143 . el .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
6148 . if \\n[#COVER]=1 \{\
6149 . ie !'\\*[$AUTHOR_COVER_1]'' \{\
6150 . nr #AUTHORS \\n[#AUTHOR_COVER_NUM]
6151 . nr #NEXT_AUTHOR 0 1
6152 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6153 . ie \\n[#COVER_AUTHOR_COLOR]=1 \
6155 \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_COVER_\\n+[#NEXT_AUTHOR]]\m[]
6156 . el .PRINT \\*[$AUTHOR_COVER_\\n+[#NEXT_AUTHOR]]
6160 . nr #AUTHORS \\n[#AUTHOR_NUM]
6161 . nr #NEXT_AUTHOR 0 1
6162 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6163 . ie \\n[#COVER_AUTHOR_COLOR]=1 \
6165 \m[\\*[$COVER_AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6166 . el .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
6173 . nr #AUTHORS \\n[#AUTHOR_NUM]
6174 . nr #NEXT_AUTHOR 0 1
6175 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
6176 . ie \\n[#AUTHOR_COLOR]=1 \
6177 . PRINT \m[\\*[$AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
6178 . el .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
6183 .MAC DEFAULT_DOCHEADER END
6185 . if !'\\*[$TITLE_1]'' \{\
6186 . FAMILY \\*[$TITLE_FAM]
6188 . ps \\*[$TITLE_PT_SIZE]
6189 . vs \\n[#DOCHEADER_LEAD]u
6191 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6192 . ie \\n[#TITLE_COLOR]=1 \
6193 . PRINT "\m[\\*[$TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6194 . el .PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6197 . if !'\\*[$SUBTITLE_1]'' \{\
6198 . FAMILY \\*[$SUBTITLE_FAM]
6199 . FT \\*[$SUBTITLE_FT]
6200 . ps \\*[$SUBTITLE_PT_SIZE]
6202 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6203 . ie \\n[#SUBTITLE_COLOR]=1 \
6204 . PRINT "\m[\\*[$SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n[#ARG_NUM]]\m[]
6205 . el .PRINT "\\*[$SUBTITLE_\\n[#ARG_NUM]]
6208 . if !'\\*[$AUTHOR_1]'' \{\
6209 . FAMILY \\*[$AUTHOR_FAM]
6210 . FT \\*[$AUTHOR_FT]
6211 . ps \\*[$AUTHOR_PT_SIZE]
6212 . ie \\n[#ATTRIBUTE_COLOR]=1 \
6213 . PRINT \&\m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
6214 . el .PRINT \&\\*[$ATTRIBUTE_STRING]
6217 . FAMILY \\*[$DOC_FAM]
6221 .MAC CHAPTER_DOCHEADER END
6223 . FAMILY \\*[$TITLE_FAM]
6225 . ps \\*[$TITLE_PT_SIZE]
6226 . vs \\n[#DOCHEADER_LEAD]u
6227 .\" Chapter title only
6228 . ie '\\*[$CHAPTER]'' \{\
6229 . ie !'\\*[$CHAPTER_TITLE_1]'' \{\
6230 . if \\n[#PRINT_STYLE]=2 \{\
6231 . FAMILY \\*[$CHAPTER_TITLE_FAM]
6232 . FT \\*[$CHAPTER_TITLE_FT]
6233 . ps \\*[$CHAPTER_TITLE_PT_SIZE]
6234 . vs \\n[#DOCHEADER_LEAD]u
6237 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6238 . ie \\n[#TITLE_COLOR]=1 \{\
6240 \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6242 . el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6246 . ie \\n[#TITLE_COLOR]=1 \{\
6247 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING]\m[]
6249 . el .PRINT \\*[$CHAPTER_STRING]
6252 .\" Chapter string, possibly with a chapter title
6254 . ie \\n[#TITLE_COLOR]=1 \{\
6255 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6257 . el .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6258 . if !'\\*[$CHAPTER_TITLE_1]'' \{\
6259 . if \\n[#PRINT_STYLE]=2 \{\
6260 . FAMILY \\*[$CHAPTER_TITLE_FAM]
6261 . FT \\*[$CHAPTER_TITLE_FT]
6262 . ps \\*[$CHAPTER_TITLE_PT_SIZE]
6263 . vs \\n[#DOCHEADER_LEAD]u
6264 . ALD \\n[.v]u/4u \" Put a little space before the chapter title
6267 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6268 . ie \\n[#CHAPTER_TITLE_COLOR]=1 \{\
6270 \m[\\*[$CHAPTER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6272 . el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6274 . RLD \\n[#DOC_LEAD]u \" Just looks better this way
6277 . FAMILY \\*[$DOC_FAM]
6281 .MAC NAMED_DOCHEADER END
6283 . FAMILY \\*[$TITLE_FAM]
6285 . ps \\*[$TITLE_PT_SIZE]
6286 . vs \\n[#DOCHEADER_LEAD]u
6287 . if !'\\*[$TITLE_1]'' \{\
6289 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6290 . ie \\n[#TITLE_COLOR]=1 \{\
6291 . PRINT "\m[\\*[$TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6293 . el .PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6296 . if !'\\*[$SUBTITLE]'' \{\
6297 . FAMILY \\*[$SUBTITLE_FAM]
6298 . FT \\*[$SUBTITLE_FT]
6299 . ps \\*[$SUBTITLE_PT_SIZE]
6301 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6302 . ie \\n[#SUBTITLE_COLOR]=1 \{\
6303 . PRINT "\m[\\*[$SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n[#ARG_NUM]]\m[]
6305 . el .PRINT "\\*[$SUBTITLE_\\n[#ARG_NUM]]
6308 . if !'\\*[$AUTHOR_1]'' \{\
6309 . FAMILY \\*[$AUTHOR_FAM]
6310 . FT \\*[$AUTHOR_FT]
6311 . ps \\*[$AUTHOR_PT_SIZE]
6312 . ie \\n[#ATTRIBUTE_COLOR]=1 \{\
6313 . PRINT \&\m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
6315 . el .PRINT \&\\*[$ATTRIBUTE_STRING]
6318 . FAMILY \\*[$DOCTYPE_FAM]
6319 . FT \\*[$DOCTYPE_FT]
6320 . ps \\*[$DOCTYPE_PT_SIZE]
6321 . vs \\n[#DOCHEADER_LEAD]u
6322 . ALD \\n[#DOCHEADER_LEAD]u
6323 . nr #FROM_DOCTYPE 1
6324 . if \\n[#DOCTYPE_COLOR]=1 .COLOR \\*[$DOCTYPE_COLOR]
6325 . ie \\n[#DOCTYPE_UNDERLINE]=1 \
6326 . UNDERSCORE \\*[$DOCTYPE_UNDERLINE_GAP] "\\*[$DOC_TYPE]"
6327 . el .PRINT "\\*[$DOC_TYPE]"
6329 . FAMILY \\*[$DOC_FAM]
6337 \# TITLE | DOCTITLE | CHAPTER | CHAPTER_TITLE | CHAPTER+TITLE | COVERTITLE \
6338 \# [ SUBTITLE AUTHOR DOCTYPE COPYRIGHT MISC BLANKPAGE ]
6340 \# Toggles the number register for each cover page element
6341 \# passed as an argument.
6343 \# TITLE, DOCTITLE, CHAPTER, CHAPTER_TITLE or CHAPTER+TITLE must
6344 \# be supplied. After that, users may enter as many or as few of
6345 \# the arguments as they like. BLANKPAGE inserts a blank page
6348 \# If called as DOC_COVER, performs the same operations, but
6349 \# applies everything to a doc cover.
6352 . ie '\\$0'DOC_COVER' \{\
6358 . nr #COVER_ITEM \\n[#NUM_ARGS] \"loop count
6359 . while \\n+[#ARG_NUM]<=\\n[#COVER_ITEM] \{\
6360 . if '\\$1'TITLE' \{\
6361 . nr #\\*[DOC_]COVER_TITLE 1
6364 . if '\\$1'DOCTITLE' \{\
6365 . nr #\\*[DOC_]COVER_TITLE 2
6368 . if '\\$1'CHAPTER' \{\
6369 . nr #\\*[DOC_]COVER_TITLE 3
6372 . if '\\$1'CHAPTER_TITLE' \{\
6373 . nr #\\*[DOC_]COVER_TITLE 4
6376 . if '\\$1'CHAPTER+TITLE' \{\
6377 . nr #\\*[DOC_]COVER_TITLE 5
6380 . if '\\$1'\\*[DOC_]COVERTITLE' \{\
6381 . nr #\\*[DOC_]COVER_TITLE 6
6384 . if '\\$1'SUBTITLE' \{\
6385 . nr #\\*[DOC_]COVER_SUBTITLE 1
6388 . if '\\$1'AUTHOR' \{\
6389 . nr #\\*[DOC_]COVER_AUTHOR 1
6392 . if '\\$1'DOCTYPE' \{\
6393 . nr #\\*[DOC_]COVER_DOCTYPE 1
6396 . if '\\$1'COPYRIGHT' \{\
6397 . nr #\\*[DOC_]COVER_COPYRIGHT 1
6400 . if '\\$1'MISC' \{\
6401 . nr #\\*[DOC_]COVER_MISC 1
6404 . if '\\$1'PDF_OUTLINE_LABEL' \{\
6406 . ds $PDF_\\*[DOC_]COVER_LABEL \\$1
6409 . if '\\$1'BLANKPAGE' \{\
6410 . nr #\\*[DOC_]COVER_BLANKPAGE 1
6414 . if '\\$0'DOC_COVER' .rm DOC_
6418 . ie '\\$0'DOC_COVERTITLE' \{\
6419 . ie \\n[#NUM_ARGS]=0 \{\
6420 . if \\n[#DOC_COVER_TITLE_NUM] \{\
6422 . while \\n[#DOC_COVER_TITLE_NUM]>\\n[#ITEM] \{\
6423 . rm $DOC_COVER_TITLE_\\n+[#ITEM]
6425 . rr #DOC_COVER_TITLE_NUM
6426 . rm $DOC_COVER_TITLE
6430 . nr #DOC_COVER_TITLE_NUM 0 1
6431 . while \\n[#NUM_ARGS]>\\n[#DOC_COVER_TITLE_NUM] \{\
6433 $DOC_COVER_TITLE_\\n+[#DOC_COVER_TITLE_NUM] \\$\\n[#DOC_COVER_TITLE_NUM]
6435 . ds $DOC_COVER_TITLE \\$*
6439 . ie \\n[#NUM_ARGS]=0 \{\
6440 . if \\n[#COVER_TITLE_NUM] \{\
6442 . while \\n[#COVER_TITLE_NUM]>\\n[#ITEM] \{\
6443 . rm $COVER_TITLE_\\n+[#ITEM]
6445 . rr #COVER_TITLE_NUM
6450 . nr #COVER_TITLE_NUM 0 1
6451 . while \\n[#NUM_ARGS]>\\n[#COVER_TITLE_NUM] \{\
6452 . ds $COVER_TITLE_\\n+[#COVER_TITLE_NUM] \\$\\n[#COVER_TITLE_NUM]
6454 . ds $COVER_TITLE \\$*
6455 .\" . if \\n[#DOCTITLE_NUM]=0 .PDF_TITLE \\*[$COVER_TITLE]
6460 \# COVER PAGE LEADING
6461 \# ------------------
6463 \# <+|- amount by which to in/decrease leading of cover/doc cover>
6465 \# Stores user supplied lead in/decrease in string $COVER_LEAD_ADJ
6466 \# or $DOC_COVER_LEAD_ADJ, depending on whether the macro was called
6467 \# with an alias (DOC_COVER_LEAD).
6469 \# A unit of measure must be supplied. Decimal fractions OK.
6470 \# Default is +0, i.e. same as DOC_LEAD.
6473 . ie '\\$0'DOC_COVER_LEAD' .ds $DOC_COVER_LEAD_ADJ \\$1
6474 . el .ds $COVER_LEAD_ADJ \\$1
6477 \# MISCs get treated similarly to QUOTEs and BLOCKQUOTEs with respect to
6480 .MAC MISC_AUTOLEAD END
6481 . if '\\$0'DOC_COVER_MISC_AUTOLEAD' .nr #DOC_COVER_MISC_AUTOLEAD (p;\\$1)
6482 . if '\\$0'COVER_MISC_AUTOLEAD' .nr #COVER_MISC_AUTOLEAD (p;\\$1)
6485 .ALIAS DOC_COVER_MISC_AUTOLEAD MISC_AUTOLEAD
6486 .ALIAS COVER_MISC_AUTOLEAD MISC_AUTOLEAD
6488 \# COVER PAGE START POSITION
6489 \# -------------------------
6491 \# <distance from page top at which to start cover/doc cover>
6493 \# Stores user supplied lead in/decrease in #COVER_START_POS
6494 \# or #DOC_COVER_START_POS, depending on whether the macro was
6495 \# called by an alias (DOC_COVER_ADVANCE).
6497 \# A unit of measure must be supplied. Decimal fractions OK.
6498 \# If user doesn't invoke this macro, the default starting
6499 \# position for both covers and doc covers is 1/3 of the way
6500 \# down the page (setup in DO_COVER).
6502 .MAC COVER_ADVANCE END
6503 . ie '\\$0'DOC_COVER_ADVANCE' .nr #DOC_COVER_START_POS (\\$1)
6504 . el .nr #COVER_START_POS (\\$1)
6507 \# UNDERLINE CONTROL
6508 \# -----------------
6510 \# [ DOUBLE ] [ <underline weight> [<underline gap>] ] | <none> | <anything>
6512 \# Toggles underlining of the element indicated by the calling alias
6513 \# on or off. Uses #<element>_UNDERLINE_WEIGHT to set the weight,
6514 \# and defines string $<element>_UNDERLINE_GAP.
6516 \# Calling aliases COVER_ and DOCCOVER_ only apply if DOCTYPE is
6517 \# NAMED and the DOCTYPE arg is passed to COVER or DOC_COVER.
6521 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \
6522 . nr #BIB_STRING_UNDERLINE 1
6523 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \
6524 . nr #BIB_STRING_UNDERLINE 1
6525 . if '\\$0'COVER_UNDERLINE' \
6526 . nr #COVER_UNDERLINE 1
6527 . if '\\$0'DOC_COVER_UNDERLINE' \
6528 . nr #DOC_COVER_UNDERLINE 1
6529 . if '\\$0'DOCTYPE_UNDERLINE' \
6530 . nr #DOCTYPE_UNDERLINE 1
6531 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \
6532 . nr #EN_STRING_UNDERLINE 1
6533 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \
6534 . nr #EN_STRING_UNDERLINE 1
6535 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \
6536 . nr #EN_TITLE_UNDERLINE 1
6537 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \
6538 . nr #EN_TITLE_UNDERLINE 1
6541 . ie \\n[#NUM_ARGS]=1 \{\
6544 . ie \B'\\*[$ARG]' \{\
6545 . if !\\n[#PRINT_STYLE]=1 \{\
6546 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \
6547 . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6548 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \
6549 . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6550 . if '\\$0'COVER_UNDERLINE' \
6551 . COVER_UNDERLINE_WEIGHT \\$1
6552 . if '\\$0'DOC_COVER_UNDERLINE' \
6553 . DOC_COVER_UNDERLINE_WEIGHT \\$1
6554 . if '\\$0'DOCTYPE_UNDERLINE' \
6555 . DOCTYPE_UNDERLINE_WEIGHT \\$1
6556 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\
6557 . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6558 . nr #EN_STRING_UNDERLINE 1
6560 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\
6561 . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6562 . nr #EN_STRING_UNDERLINE 1
6564 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \
6565 . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6566 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \
6567 . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6571 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{\
6572 . ie '\\$1'DOUBLE' .nr #BIB_STRING_UNDERLINE 2
6573 . el .nr #BIB_STRING_UNDERLINE 0
6575 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{\
6576 . ie '\\$1'DOUBLE' .nr #BIB_STRING_UNDERLINE 2
6577 . el .nr #BIB_STRING_UNDERLINE 0
6579 . if '\\$0'COVER_UNDERLINE' .nr #COVER_UNDERLINE 0
6580 . if '\\$0'DOC_COVER_UNDERLINE' .nr #DOC_COVER_UNDERLINE 0
6581 . if '\\$0'DOCTYPE_UNDERLINE' .nr #DOCTYPE_UNDERLINE 0
6582 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\
6583 . ie '\\$1'DOUBLE' .nr #EN_STRING_UNDERLINE 2
6584 . el .nr #EN_STRING_UNDERLINE 0
6586 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\
6587 . ie '\\$1'DOUBLE' .nr #EN_STRING_UNDERLINE 2
6588 . el .nr #EN_STRING_UNDERLINE 0
6590 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{\
6591 . ie '\\$1'DOUBLE' .nr #EN_TITLE_UNDERLINE 2
6592 . el .nr #EN_TITLE_UNDERLINE 0
6594 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{\
6595 . ie '\\$1'DOUBLE' .nr #EN_TITLE_UNDERLINE 2
6596 . el .nr #EN_TITLE_UNDERLINE 0
6601 . if !\\n[#PRINT_STYLE]=1 \{\
6602 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERLINE' \{\
6603 . nr #BIB_STRING_UNDERLINE 1
6604 . if '\\$1'DOUBLE' \{\
6605 . nr #BIB_STRING_UNDERLINE 2
6608 . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6610 . ds $BIB_STRING_UNDERLINE_GAP \\$2
6612 . ds $BIB_STRING_RULE_GAP \\$3
6614 . if '\\$0'BIBLIOGRAPHY_STRING_UNDERSCORE' \{\
6615 . nr #BIB_STRING_UNDERLINE 1
6616 . if '\\$1'DOUBLE' \{\
6617 . nr #BIB_STRING_UNDERLINE 2
6620 . BIBLIOGRAPHY_STRING_UNDERLINE_WEIGHT \\$1
6621 . if !'\\$2'' .ds $BIB_STRING_UNDERLINE_GAP \\$2
6622 . if !'\\$3'' .ds $BIB_STRING_RULE_GAP \\$3
6624 . if '\\$0'COVER_UNDERLINE' \{\
6625 . nr #COVER_UNDERLINE 1
6626 . COVER_UNDERLINE_WEIGHT \\$1
6627 . ds $COVER_UNDERLINE_GAP \\$2
6629 . if '\\$0'DOC_COVER_UNDERLINE' \{\
6630 . nr #DOC_COVER_UNDERLINE 1
6631 . DOC_COVER_UNDERLINE_WEIGHT \\$1
6632 . ds $DOC_COVER_UNDERLINE_GAP \\$2
6634 . if '\\$0'DOCTYPE_UNDERLINE' \{\
6635 . nr #DOCTYPE_UNDERLINE 1
6636 . DOCTYPE_UNDERLINE_WEIGHT \\$1
6637 . ds $DOCTYPE_UNDERLINE_GAP \\$2
6639 .\" ENDNOTE_STRING_UNDERLINE and ENDNOTE_STRING_UNDERSCORE are identical
6640 .\" _UNDERLINE left in for backward compatibility
6641 . if '\\$0'ENDNOTE_STRING_UNDERLINE' \{\
6642 . nr #EN_STRING_UNDERLINE 1
6643 . if '\\$1'DOUBLE' \{\
6644 . nr #EN_STRING_UNDERLINE 2
6647 . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6648 . if !'\\$2'' .ds $EN_STRING_UNDERLINE_GAP \\$2
6649 . if !'\\$3'' .ds $EN_STRING_RULE_GAP \\$3
6651 . if '\\$0'ENDNOTE_STRING_UNDERSCORE' \{\
6652 . nr #EN_STRING_UNDERLINE 1
6653 . if '\\$1'DOUBLE' \{\
6654 . nr #EN_STRING_UNDERLINE 2
6657 . ENDNOTE_STRING_UNDERLINE_WEIGHT \\$1
6658 . if !'\\$2'' .ds $EN_STRING_UNDERLINE_GAP \\$2
6659 . if !'\\$3'' .ds $EN_STRING_RULE_GAP \\$3
6661 .\" ENDNOTE_TITLE_UNDERLINE and ENDNOTE_TITLE_UNDERSCORE are identical
6662 .\" _UNDERLINE left in for backward compatibility
6663 . if '\\$0'ENDNOTE_TITLE_UNDERLINE' \{\
6664 . nr #EN_TITLE_UNDERLINE 1
6665 . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6666 . ds $EN_TITLE_UNDERLINE_GAP \\$2
6668 . if '\\$0'ENDNOTE_TITLE_UNDERSCORE' \{\
6669 . nr #EN_TITLE_UNDERLINE 1
6670 . ENDNOTE_TITLE_UNDERLINE_WEIGHT \\$1
6671 . ds $EN_TITLE_UNDERLINE_GAP \\$2
6678 .ALIAS BIBLIOGRAPHY_STRING_UNDERSCORE _UNDERLINE
6679 .ALIAS BIBLIOGRAPHY_STRING_UNDERLINE _UNDERLINE
6680 .ALIAS COVER_UNDERLINE _UNDERLINE
6681 .ALIAS DOC_COVER_UNDERLINE _UNDERLINE
6682 .ALIAS DOCTYPE_UNDERLINE _UNDERLINE
6683 .ALIAS ENDNOTE_STRING_UNDERLINE _UNDERLINE
6684 .ALIAS ENDNOTE_STRING_UNDERSCORE _UNDERLINE
6685 .ALIAS ENDNOTE_TITLE_UNDERLINE _UNDERLINE
6686 .ALIAS ENDNOTE_TITLE_UNDERSCORE _UNDERLINE
6688 \# COVERS - WHETHER TO PRINT
6689 \# -------------------------
6691 \# <none> | <anything>
6693 \# Creates or removes registers #COVERS and #COVERS_OFF, checked for
6694 \# in DEFAULTS (in START) prior to printing
6697 . ie '\\$0'DOC_COVERS' \{\
6699 . rr #DOC_COVERS_OFF
6704 . nr #DOC_COVERS_OFF 1
6719 \# COVER_COUNTS_PAGES
6720 \# ------------------
6722 \# <none> | <anything>
6724 \# Creates or removes registers #COVERS_COUNT or #DOCCOVERS_COUNT,
6725 \# used in END_COVER to determine whether to increment the page
6726 \# number silently when doc covers or covers are output.
6728 .MAC COVER_COUNTS_PAGES END
6729 . if '\\$0'DOC_COVER_COUNTS_PAGES' \{\
6730 . ie '\\$1'' .nr #DOCCOVERS_COUNT 1
6731 . el .rr #DOCCOVERS_COUNT
6734 . if '\\$0'COVER_COUNTS_PAGES' \{\
6735 . ie '\\$1'' .nr #COVERS_COUNT 1
6736 . el .rr #COVERS_COUNT
6746 . if \\n[#PAGINATE]=1 \{\
6747 . nr #PAGINATION_WAS_ON 1
6750 . if \\n[#HEADERS_ON]=1 \{\
6751 . nr #HEADERS_WERE_ON 1
6754 . if \\n[#FOOTERS_ON]=1 \{\
6755 . nr #FOOTERS_WERE_ON 1
6758 . if \\n[#COLUMNS]=1 \{\
6759 . nr #COLUMNS_WERE_ON 1
6763 . ie '\\$0'DO_DOC_COVER' \{\
6765 . nr #DOC_COVER_DONE 1
6766 . if '\\*[$PDF_DOC_COVER_LABEL]'' \
6767 . ds $PDF_DOC_COVER_LABEL Cover:
6770 . if '\\*[$PDF_COVER_LABEL]'' .ds $PDF_COVER_LABEL Title Page:
6772 . if !r#\\*[DOC_]COVER_START_POS \
6773 . nr #\\*[DOC_]COVER_START_POS \\n[#PAGE_LENGTH]/3
6774 . if \\n[#PRINT_STYLE]=1 \{\
6775 . ie \\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u*2u
6776 . el .vs \\n[#DOC_LEAD]u
6778 . if \\n[#PRINT_STYLE]=2 \{\
6779 . vs \\n[#DOC_LEAD]u\\*[$\\*[DOC_]COVER_LEAD_ADJ]
6780 . nr #\\*[DOC_]COVER_LEAD \\n[#LEAD]
6783 . if '\\$0'DO_COVER' \{\
6784 . if \\n[TOC.RELOCATE]==5 \{\
6785 . if !rTOC_BH .TOC_BEFORE_HERE
6788 . if '\\$0'DO_DOC_COVER' \{\
6789 . if \\n[TOC.RELOCATE]==3 \{\
6790 . if !rTOC_BH .TOC_BEFORE_HERE
6793 . RV_HARD_SET_MARGINS
6794 . sp |\\n[#\\*[DOC_]COVER_START_POS]u-1v
6795 . if \\n[#\\*[DOC_]COVER_COLOR]=1 \{\
6797 \m[\\*[$\\*[DOC_]COVER_COLOR]]
6800 . \\*[DOC_]COVER_H_POS
6801 . fam \\*[$\\*[DOC_]COVER_TITLE_FAM]
6802 . ft \\*[$\\*[DOC_]COVER_TITLE_FT]
6803 . ps \\*[$\\*[DOC_]COVER_TITLE_PT_SIZE]
6804 . ie \\n[#PRINT_STYLE]=1 \{\
6805 . ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u*2u \}
6806 . el \{ .vs \\n[#DOC_LEAD]u \}
6808 . el .vs \\n[#\\*[DOC_]COVER_LEAD]u
6809 . if \\n[#PRINT_STYLE]=1 .TYPEWRITER
6810 . if \\n[#\\*[DOC_]COVER_TITLE] \{\
6811 . nr PDFHREF.VIEW.LEADING.H \\n[PDFHREF.VIEW.LEADING]
6812 . nr PDFHREF.VIEW.LEADING \\n[nl]u-1v-1000u
6814 . if \\n[#\\*[DOC_]COVER_TITLE]=1 \{\
6815 . ie \\n[#PRINT_STYLE]=1 \{\
6818 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6819 . UNDERSCORE "\\*[$TITLE_\\n[#ARG_NUM]]"
6820 . if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6821 . as PDF_BM \\*[$TITLE_\\n[#ARG_NUM]]
6827 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6828 . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6830 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$TITLE_\\n[#ARG_NUM]]\m[]
6833 . PRINT "\\*[$TITLE_\\n[#ARG_NUM]]
6834 . if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6835 . as PDF_BM \\*[$TITLE_\\n[#ARG_NUM]]
6838 . PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
6839 .\" . PDF_TITLE \\*[PDF_BM]
6841 . if \\n[#\\*[DOC_]COVER_TITLE]=2 \{\
6842 . ie \\n[#PRINT_STYLE]=1 \{\
6845 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6846 . UNDERSCORE "\\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]"
6847 . if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6848 . as PDF_BM \\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]
6854 . while \\n[#DOCTITLE_NUM]>=\\n+[#ARG_NUM] \{\
6855 . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6857 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]\m[]
6859 . el .PRINT \\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]
6860 . if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6861 . as PDF_BM \\*[$\\*[DOC_]TITLE_\\n[#ARG_NUM]]
6864 . PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
6865 .\" . PDF_TITLE \\*[PDF_BM]
6867 . if \\n[#\\*[DOC_]COVER_TITLE]=3 \{\
6868 . ie \\n[#PRINT_STYLE]=1 \{\
6870 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6874 . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6876 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6878 . el .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6881 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6882 .\" . PDF_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6884 . if \\n[#\\*[DOC_]COVER_TITLE]=4 \{\
6885 . ie \\n[#PRINT_STYLE]=1 \{\
6888 . ie \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u/2u
6889 . el .vs \\n[#DOC_LEAD]u
6891 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6892 . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
6893 . if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6894 . as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6897 . if \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u
6901 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6902 . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6904 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6906 . el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6907 . if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6908 . as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6911 . PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
6912 .\" . PDF_TITLE \\*[PDF_BM]
6914 . if \\n[#\\*[DOC_]COVER_TITLE]=5 \{\
6915 . ie \\n[#PRINT_STYLE]=1 \{\
6917 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6921 . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6923 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
6925 . el .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
6927 . if !'\\*[$CHAPTER_TITLE_1]'' \{\
6928 . ie \\n[#PRINT_STYLE]=1 \{\
6929 . ie \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u/2u
6930 . el .vs \\n[#DOC_LEAD]u
6933 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6934 . UNDERSCORE "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
6935 . if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6936 . as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6938 . if \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u
6941 . fam \\*[$\\*[DOC_]COVER_CHAPTER_TITLE_FAM]
6942 . ft \\*[$\\*[DOC_]COVER_CHAPTER_TITLE_FT]
6943 . ps \\*[$\\*[DOC_]COVER_CHAPTER_TITLE_PT_SIZE]
6944 . ALD \\n[.v]u/4u \"Put a little space before the chapter title
6946 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6947 . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6949 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]\m[]
6951 . el .PRINT \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6952 . if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6953 . as PDF_BM \\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]
6957 . PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
6958 .\" . PDF_TITLE \\*[PDF_BM]
6960 . if \\n[#\\*[DOC_]COVER_TITLE]=6 \{\
6961 . ie \\n[#PRINT_STYLE]=1 \{\
6964 . while \\n[#\\*[DOC_]COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6965 . UNDERSCORE "\\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]"
6966 . if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6967 . as PDF_BM \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]
6973 . while \\n[#\\*[DOC_]COVER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
6974 . ie \\n[#\\*[DOC_]COVER_TITLE_COLOR]=1 \{\
6976 \m[\\*[$\\*[DOC_]COVER_TITLE_COLOR]]\
6977 \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]\m[]
6979 . el .PRINT \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]
6980 . if \\n[#ARG_NUM]>1 .as PDF_BM " \"
6981 . as PDF_BM \\*[$\\*[DOC_]COVER_TITLE_\\n[#ARG_NUM]]
6984 . PDF_BOOKMARK 1 \\*[$PDF_\\*[DOC_]COVER_LABEL] \\*[PDF_BM]
6985 .\" . PDF_TITLE \\*[PDF_BM]
6987 . if \\n[#\\*[DOC_]COVER_TITLE] \{\
6988 . nr PDFHREF.VIEW.LEADING \\n[PDFHREF.VIEW.LEADING.H]
6989 . rr PDFHREF.VIEW.LEADING.H
6991 . if !\\n[#DOC_TYPE]=2 \{\
6992 . if \\n[#\\*[DOC_]COVER_SUBTITLE]=1 \{\
6993 . fam \\*[$\\*[DOC_]COVER_SUBTITLE_FAM]
6994 . ft \\*[$\\*[DOC_]COVER_SUBTITLE_FT]
6995 . ps \\*[$\\*[DOC_]COVER_SUBTITLE_PT_SIZE]
6996 . if \\n[#PRINT_STYLE]=1 \{\
6998 . ie \\n[#SINGLE_SPACE]=0 .vs \\n[#DOC_LEAD]u/2u
6999 . el .vs \\n[#DOC_LEAD]u
7002 . if \\n[#\\*[DOC_]COVER]=1 \{\
7003 . ie !'\\*[$SUBTITLE_\\*[DOC_]COVER_1]'' \{\
7004 . nr #SUBTITLES \\n[#SUBTITLE_\\*[DOC_]COVER_NUM]
7005 . nr #NEXT_SUBTITLE 0 1
7006 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
7007 . ie \\n[#\\*[DOC_]COVER_SUBTITLE_COLOR]=1 \{\
7009 \m[\\*[$\\*[DOC_]COVER_SUBTITLE_COLOR]]\
7010 \\*[$SUBTITLE_\\*[DOC_]COVER_\\n+[#NEXT_SUBTITLE]]\m[]
7013 \\*[$SUBTITLE_\\*[DOC_]COVER_\\n+[#NEXT_SUBTITLE]]
7017 . nr #SUBTITLES \\n[#SUBTITLE_NUM]
7018 . nr #NEXT_SUBTITLE 0 1
7019 . while \\n[#SUBTITLES]>\\n[#NEXT_SUBTITLE] \{\
7020 . ie \\n[#\\*[DOC_]COVER_SUBTITLE_COLOR]=1 \{\
7022 \m[\\*[$\\*[DOC_]COVER_SUBTITLE_COLOR]]\\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]]\m[]
7024 . el .PRINT \\*[$SUBTITLE_\\n+[#NEXT_SUBTITLE]]
7028 . if \\n[#PRINT_STYLE]=1 \{\
7029 . if \\n[#SINGLE_SPACE]=0 .vs
7032 . if \\n[#PRINT_STYLE]=1 \{\
7033 . if !r#\\*[DOC_]COVER_SUBTITLE .sp
7036 . if \\n[#\\*[DOC_]COVER_AUTHOR]=1 \{\
7037 . fam \\*[$\\*[DOC_]COVER_AUTHOR_FAM]
7038 . ft \\*[$\\*[DOC_]COVER_AUTHOR_FT]
7039 . ps \\*[$\\*[DOC_]COVER_AUTHOR_PT_SIZE]
7040 . if \\n[#PRINT_STYLE]=1 \{\
7042 . ie \\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u
7043 . el .vs \\n[#DOC_LEAD]u/2u
7046 . ie d$ATTRIBUTE_STRING_DO_CCOVER \{\
7047 . ie \\n[#\\*[DOC_]COVER_ATTRIBUTE_COLOR]=1 \{\
7049 \&\m[\\*[$\\*[DOC_]COVER_ATTRIBUTE_COLOR]]\
7050 \\*[$ATTRIBUTE_STRING_\\*[DOC_]COVER]\m[]
7052 . el .PRINT \&\\*[$ATTRIBUTE_STRING_\\*[DOC_]COVER]
7055 . if d$ATTRIBUTE_STRING \{\
7056 . ie \\n[#\\*[DOC_]COVER_ATTRIBUTE_COLOR]=1 \{\
7058 \&\m[\\*[$\\*[DOC_]COVER_ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
7060 . el .PRINT \&\\*[$ATTRIBUTE_STRING]
7065 . fam \\*[$\\*[DOC_]COVER_DOCTYPE_FAM]
7066 . ft \\*[$\\*[DOC_]COVER_DOCTYPE_FT]
7067 . ps \\*[$\\*[DOC_]COVER_DOCTYPE_PT_SIZE]
7069 . if \\n[#DOC_TYPE]=3 \{\
7070 . if \\n[#\\*[DOC_]COVER_DOCTYPE]=1 \{\
7071 . ie \\n[#PRINT_STYLE]=1 \{\
7073 . vs \\n[#DOC_LEAD]u
7074 . UNDERSCORE2 "\\*[$DOC_TYPE]"
7077 . nr #FROM_\\*[DOC_]COVER 1
7078 . ie \\n[#\\*[DOC_]COVER_DOCTYPE_COLOR]=1 \{\
7079 . COLOR \\*[$\\*[DOC_]COVER_DOCTYPE_COLOR]
7080 . ie \\n[#\\*[DOC_]COVER_UNDERLINE]=1 \
7081 . UNDERSCORE \\*[$\\*[DOC_]COVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]"
7082 . el .PRINT "\\*[$DOC_TYPE]"
7085 . ie \\n[#\\*[DOC_]COVER_UNDERLINE]=1 \
7087 \\*[$\\*[DOC_]COVER_UNDERLINE_GAP] "\\*[$DOC_TYPE]"
7088 . el .PRINT "\\*[$DOC_TYPE]"
7090 . rr #FROM_\\*[DOC_]COVER
7094 . sp |\\n[#VISUAL_B_MARGIN]u
7095 . ie \\n[#PRINT_STYLE]=1 \{\
7097 . ie \\n[#SINGLE_SPACE]=1 .vs \\n[#DOC_LEAD]u
7098 . el .vs \\n[#DOC_LEAD]u/2u
7102 . fam \\*[$\\*[DOC_]COVER_COPYRIGHT_FAM]
7103 . ft \\*[$\\*[DOC_]COVER_COPYRIGHT_FT]
7104 . ps \\*[$\\*[DOC_]COVER_COPYRIGHT_PT_SIZE]
7105 . vs \\n[.ps]u+\\n[#\\*[DOC_]COVER_MISC_AUTOLEAD]u
7106 . nr #COPYRIGHT_V_ADJ \\n[#DOC_LEAD]-\\n[.v]
7107 . sp \\n[#COPYRIGHT_V_ADJ]u
7108 . rr #COPYRIGHT_V_ADJ
7110 . if \\n[#\\*[DOC_]COVER_COPYRIGHT]=1 \{\
7111 . if !'\\*[$COPYRIGHT_DOCCOVER]'' \{\
7112 . ds $SAVED_COPYRIGHT \\*[$COPYRIGHT]
7113 . ds $COPYRIGHT \\*[$COPYRIGHT_DOCCOVER]
7115 . QUAD \\*[$\\*[DOC_]COVER_COPYRIGHT_QUAD]
7116 . ie \\n[#\\*[DOC_]COVER_COPYRIGHT_COLOR]=1 \{\
7117 . PRINT \m[\\*[$\\*[DOC_]COVER_COPYRIGHT_COLOR]]\\*[$COPYRIGHT]\m[]
7119 . el .PRINT \\*[$COPYRIGHT]
7120 . if d$SAVED_COPYRIGHT .ds $COPYRIGHT \\*[$SAVED_COPYRIGHT]
7123 . if \\n[#\\*[DOC_]COVER_MISC]=1 \{\
7124 . if \\n[#PRINT_STYLE]=2 \{\
7125 . fam \\*[$\\*[DOC_]COVER_MISC_FAM]
7126 . ft \\*[$\\*[DOC_]COVER_MISC_FT]
7127 . ps \\*[$\\*[DOC_]COVER_MISC_PT_SIZE]
7129 . QUAD \\*[$\\*[DOC_]COVER_MISC_QUAD]
7130 . ie !'\\*[$MISC_\\*[DOC_]COVER_1]'' \{\
7131 . nr #MISCS \\n[#MISC_\\*[DOC_]COVER_NUM]
7133 . while \\n[#MISCS]>\\n[#NEXT_MISC] \{\
7134 . ie \\n[#\\*[DOC_]COVER_MISC_COLOR]=1 \{\
7137 \m[\\*[$\\*[DOC_]COVER_MISC_COLOR]]\\*[$MISC_\\*[DOC_]COVER_\\n+[#NEXT_MISC]]\m[]
7140 . rm $MISC_\\*[DOC_]COVER_\\n[#NEXT_MISC]
7141 . rm $MISC_\\n[#NEXT_MISC]
7145 . PRINT \\*[$MISC_\\*[DOC_]COVER_\\n+[#NEXT_MISC]]
7148 . rm $MISC_\\*[DOC_]COVER_\\n[#NEXT_MISC]
7149 . rm $MISC_\\n[#NEXT_MISC]
7152 . rm $MISC_\\n+[#NEXT_MISC]
7155 . nr #MISCS \\n[#MISC_NUM]
7157 . while (\\n[#MISCS]>=\\n+[#NEXT_MISC]) \{\
7158 . ie \\n[#\\*[DOC_]COVER_MISC_COLOR]=1 \{\
7161 \m[\\*[$\\*[DOC_]COVER_MISC_COLOR]]\\*[$MISC_\\n[#NEXT_MISC]]\m[]
7167 . PRINT \\*[$MISC_\\n[#NEXT_MISC]]
7171 . nr #MISC_DEPTH +\\n[dn]
7174 . nr #MISC_DEPTH -\\n[#DOC_LEAD]
7175 . sp |\\n[#VISUAL_B_MARGIN]u-\\n[#MISC_DEPTH]u
7181 . if '\\$0'DO_COVER' .nr #COVER_END 1
7182 . if '\\$0'DO_DOC_COVER' .nr #DOC_COVER_END 1
7183 . if \\n[TOC.RELOCATE]==1 \{\
7184 . if !\\n[#COVER_BLANKPAGE] \
7185 . if !rTOC_BH .TOC_AFTER_HERE
7187 . if '\\$0'DO_COVER' \{\
7188 . if \\n[TOC.RELOCATE]==6 \
7189 . if !rTOC_BH .TOC_AFTER_HERE
7191 . if '\\$0'DO_DOC_COVER' \{\
7192 . if \\n[TOC.RELOCATE]==4 \
7193 . if !rTOC_BH .TOC_AFTER_HERE
7195 . if '\\$0'DO_DOC_COVER' .rm DOC_
7199 \# Macro to terminate (doc)cover processing
7205 . if \\n[#PAGINATION_WAS_ON]=1 .nr % +1
7206 . if \\n[#DOC_COVER_END]=1 \{\
7207 . ie \\n[#DOC_COVER_BLANKPAGE]=1 \{\
7208 . if \\n[TOC.RELOCATE] \
7209 . if !\\n[#TOC_BH] .TOC_AFTER_HERE
7211 . rr #DOC_COVER_BLANKPAGE
7212 . if !\\n[#DOCCOVERS_COUNT]=1 .nr % -2
7215 . if !\\n[#DOCCOVERS_COUNT]=1 .nr #PAGE_NUM_ADJ -1
7218 . if \\n[#COVER_END]=1 \{\
7219 . ie \\n[#COVER_BLANKPAGE]=1 \{\
7220 . if \\n[TOC.RELOCATE] \
7221 . if !\\n[TOC_BH] .TOC_AFTER_HERE
7223 . rr #COVER_BLANKPAGE
7224 . if !\\n[#COVERS_COUNT]=1 .nr % -2
7227 . if !\\n[#COVERS_COUNT]=1 .nr #PAGE_NUM_ADJ -1
7230 . if !'\\n[.ev]'0' .ev
7231 . if \\n[#PAGINATION_WAS_ON] \{\
7232 . rr #PAGINATION_WAS_ON
7234 . PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]-1
7236 . if \\n[#HEADERS_WERE_ON] \{\
7237 . rr #HEADERS_WERE_ON
7240 . if \\n[#FOOTERS_WERE_ON] \{\
7241 . rr #FOOTERS_WERE_ON
7244 . if \\n[#COLUMNS_WERE_ON]=1 \{\
7245 . rr #COLUMNS_WERE_ON 1
7249 . if \\n[.ns] .nop \&
7250 . if \\n[#RECTO_VERSO] .nr #RV_POST_COVER 1
7253 \# Macro to begin document processing
7257 . if \\n[TOC.RELOCATE]==2 \{\
7258 . if !\\n[TOC_BH] .TOC_BEFORE_HERE
7260 . if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
7261 . if !\\n[#PRINT_STYLE] \{\
7262 . PRINTSTYLE TYPEWRITE
7269 . PRINT "You neglected to enter a PRINTSTYLE"
7271 . ab [mom]: PRINTSTYLE missing. Aborting '\\n[.F]'.
7273 . if \\n[#LINENUMBERS]=1 \{\
7278 . if \\n[#COLLATE] \{\
7279 . COPYSTYLE \\*[$COPY_STYLE]
7280 . nr #HEADERS_ON \\n[#HEADER_STATE]
7281 . if \\n[#PAGE_NUM_V_POS]=1 .nr #PAGINATE \\n[#PAGINATION_STATE]
7283 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
7284 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
7285 . rm $RESTORE_PAGENUM_STYLE
7289 . nr #PAGE_TOP \\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
7291 . if !r#EN_Q_AUTOLEAD .nr #EN_Q_LEAD \\n[#EN_LEAD]
7292 . if !r#EN_BQ_AUTOLEAD .nr #EN_BQ_LEAD \\n[#EN_LEAD]
7293 .\" TOC/recto-verso stuff
7294 . if !r@L_MARGIN .nr @L_MARGIN \\n[#DOC_L_MARGIN]
7295 . if !r@R_MARGIN .nr @R_MARGIN \\n[#DOC_R_MARGIN]
7296 .\" Covers and doc covers
7297 . if \\n[#DOC_COVERS]=1 \{\
7298 . if \\n[#DOC_COVER]=1 \{\
7301 . rr #DOC_COVER_TITLE
7302 . rr #DOC_COVER_SUBTITLE
7303 . rr #DOC_COVER_AUTHOR
7304 . rr #DOC_COVER_DOCTYPE
7305 . rr #DOC_COVER_COPYRIGHT
7306 . rr #DOC_COVER_MISC
7309 . if \\n[#COVERS]=1 \{\
7310 . if \\n[#COVER]=1 \{\
7314 . rr #COVER_SUBTITLE
7317 . rr #COVER_COPYRIGHT
7321 . if !\\n[#TOC] .RV_HARD_SET_MARGINS
7322 . if \\n[#COLUMNS] .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u
7323 .\" Collect TITLE for TOC.
7324 . if !\\n[#TOC]=1 \{\
7325 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7326 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
7327 . ie \\n[#USER_SET_TITLE_ITEM] \{\
7328 . ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]
7329 . rr #USER_SET_TITLE_ITEM
7330 . rm $USER_SET_TITLE_ITEM
7333 . ie \\n[#DOC_TYPE]=2 \{\
7334 . ie '\\*[$CHAPTER_TITLE]'' \
7335 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]
7337 . ie '\\*[$CHAPTER]'' \
7338 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]
7340 . ds $TOC_TITLE_ITEM \
7341 \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]
7345 . ds $TOC_TITLE_ITEM \\*[$TITLE]
7347 . if \\n[#TOC_AUTHORS]=1 \{\
7348 . ie '\\*[$TOC_AUTHORS]'' \
7349 . as $TOC_TITLE_ITEM / \\*[$AUTHOR_1]
7351 . as $TOC_TITLE_ITEM / \\*[$TOC_AUTHORS]
7355 . sp |\\n[#DOCHEADER_ADVANCE]u-\\n[#DOC_LEAD]u
7356 . PDF_BOOKMARK 1 \\*[$TOC_TITLE_ITEM]
7357 . as $TOC_TITLE_ITEM \|
7358 . if \\n[#PREFIX_CH_NUM] \{\
7359 . rn $TOC_TITLE_ITEM $TOC_TITLE_ITEM_OLD
7360 . ds $TOC_CH_NUM \\n[#CH_NUM].\[toc-hd-num-spacer]
7361 . ds $TOC_TITLE_ITEM \\*[$TOC_CH_NUM]\\*[$TOC_TITLE_ITEM_OLD]
7362 . rm $TOC_TITLE_ITEM_OLD
7366 . if !\\n[#TOC] .nr #POST_TOP 1
7367 .\" End TITLE collection
7368 . if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
7370 . sp |\\n[#HEADER_MARGIN]u
7374 . rr #PAGINATION_STATE
7375 .\" End collate stuff
7376 . ie \\n[#DOC_HEADER]=0 \{\
7378 . if \\n[#DOC_TYPE]=4 \
7379 . if !'\\n[.z]'' .di
7380 . nr #STORED_PP_INDENT \\n[#PP_INDENT]
7383 . PARA_INDENT \\n[#STORED_PP_INDENT]u
7384 . rr #STORED_PP_INDENT
7385 . ie r#ADVANCE_FROM_TOP \{\
7387 . sp |\\n[#ADVANCE_FROM_TOP]u-1v
7388 . if \\n[#ADJ_DOC_LEAD]=1 .SHIM
7392 . sp |\\n[#T_MARGIN]u-1v
7394 . if \\n[#COLUMNS] \{\
7397 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7398 . nr #L_MARGIN \\n[.o]
7399 . ll \\n[#COL_L_LENGTH]u
7404 . if \\n[#AUTO_LEAD] .nr #RESTORE_AUTO_LEAD 1
7405 . if \\n[#PRINT_STYLE]=2 .vs \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ]
7406 . if \\n[#RESTORE_AUTO_LEAD] \{\
7408 . nr #AUTOLEAD_VALUE \\n[#SAVED_AUTOLEAD_VALUE]
7410 . nr #DOCHEADER_LEAD \\n[#LEAD]
7412 . if \\n[#DOC_TYPE]=1 \{\
7415 . if \\n[#DOCHEADER_COLOR]=1 \{\
7417 \m[\\*[$DOCHEADER_COLOR]]
7420 . L_MARGIN \\n[#DOC_L_MARGIN]u
7421 . LL \\n[#DOC_L_LENGTH]u
7423 . if \\n[#PRINT_STYLE]=1 \{\
7426 . if !\\n[#SINGLE_SPACE] \{\
7427 . vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u)
7428 . sp |\\n[#T_MARGIN]u-1v
7430 . if !'\\*[$TITLE_1]'' \{\
7433 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7434 . UNDERSCORE 3p "\\*[$TITLE_\\n[#ARG_NUM]]"
7438 . if !'\\*[$SUBTITLE]'' \{\
7441 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7442 . UNDERSCORE 3p "\\*[$SUBTITLE_\\n[#ARG_NUM]]"
7445 . if !'\\*[$AUTHOR_1]'' \{\
7447 . PRINT \&\\*[$ATTRIBUTE_STRING]
7448 . nr #AUTHORS \\n[#AUTHOR_NUM]
7449 . nr #NEXT_AUTHOR 0 1
7450 . if !\\n[#SINGLE_SPACE] .vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u)
7451 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
7452 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
7456 . if \\n[#PRINT_STYLE]=2 \{\
7462 . if \\n[#DOC_TYPE]=2 \{\
7465 . if \\n[#DOCHEADER_COLOR]=1 \{\
7467 \m[\\*[$DOCHEADER_COLOR]]
7470 . L_MARGIN \\n[#DOC_L_MARGIN]u
7471 . LL \\n[#DOC_L_LENGTH]u
7473 . if \\n[#PRINT_STYLE]=1 \{\
7476 . if !\\n[#SINGLE_SPACE] \{\
7477 . vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u)
7478 . sp |\\n[#T_MARGIN]u-1v
7480 . ie '\\*[$CHAPTER]'' \{\
7482 . ie !'\\*[$CHAPTER_TITLE]'' \{\
7484 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7485 . UNDERSCORE 3p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7490 . UNDERSCORE 3p "\\*[$CHAPTER_STRING]"
7497 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
7499 . if !'\\*[$CHAPTER_TITLE]'' \{\
7502 . while \\n[#CHAPTER_TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7503 . UNDERSCORE 3p "\\*[$CHAPTER_TITLE_\\n[#ARG_NUM]]"
7508 . vs \\n[#DOC_LEAD]u
7509 . if \\n[#SINGLE_SPACE] .sp 2
7511 . if \\n[#PRINT_STYLE]=2 \{\
7513 . di DOCHEADER_DIVERSION \" This diversion is only
7514 . br \" necessary to find the depth of the
7515 . CHAPTER_DOCHEADER \" docheader
7518 . nr #DOCHEADER_DEPTH \\n[dn]-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
7519 . \" in #DOCHEADER_DEPTH
7520 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
7525 . if \\n[#DOC_TYPE]=3 \{\
7528 . if \\n[#DOCHEADER_COLOR]=1 \{\
7530 \m[\\*[$DOCHEADER_COLOR]]
7533 . L_MARGIN \\n[#DOC_L_MARGIN]u
7534 . LL \\n[#DOC_L_LENGTH]u
7536 . if \\n[#PRINT_STYLE]=1 \{\
7539 . if !\\n[#SINGLE_SPACE] \{\
7540 . vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u)
7541 . sp |\\n[#T_MARGIN]u-1v
7543 . if !'\\*[$TITLE_1]'' \{\
7546 . while \\n[#TITLE_NUM]>=\\n+[#ARG_NUM] \{\
7547 . UNDERSCORE 3p "\\*[$TITLE_\\n[#ARG_NUM]]"
7551 . if !'\\*[$SUBTITLE]'' \{\
7554 . while \\n[#SUBTITLE_NUM]>=\\n+[#ARG_NUM] \{\
7555 . UNDERSCORE 3p "\\*[$SUBTITLE_\\n[#ARG_NUM]]"
7558 . if !'\\*[$AUTHOR_1]'' \{\
7560 . PRINT \&\\*[$ATTRIBUTE_STRING]
7561 . nr #AUTHORS \\n[#AUTHOR_NUM]
7562 . nr #NEXT_AUTHOR 0 1
7563 . if !\\n[#SINGLE_SPACE] .vs (\\n[#DOC_LEAD]u/2u)+(\\n[.v]u/3u)
7564 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
7565 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
7568 . ie !\\n[#SINGLE_SPACE] .sp 2
7570 . ie \\n[#DOCTYPE_UNDERLINE] \{\
7571 . UNDERSCORE2 3p "\\*[$DOC_TYPE]"
7574 . PRINT "\\*[$DOC_TYPE]"
7575 . if \\n[#SINGLE_SPACE]=1 .sp
7577 . if \\n[#PRINT_STYLE]=2 .NAMED_DOCHEADER
7580 . if !\\n[#DOC_TYPE]=4 \{\
7581 . if \\n[#PRINT_STYLE]=1 .sp
7582 . if \\n[#PRINT_STYLE]=2 .sp \\n[#DOC_LEAD]u*2u
7583 . if \\n[#COLUMNS] \{\
7585 . nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
7586 . ie \\n[#RV_POST_COVER] \{\
7587 . nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#DOC_L_MARGIN]
7588 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
7589 . nr #L_MARGIN \\n[.o]
7593 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7594 . nr #L_MARGIN \\n[.o]
7596 . LL \\n[#COL_L_LENGTH]u
7601 . vs \\n[#DOC_LEAD]u
7602 . if \\n[#ADJ_DOC_LEAD]=1 \{\
7603 . ie \\n[#ADVANCE_FROM_TOP]=0 \
7604 . if \\n[#DOC_HEADER]=1 .SHIM
7605 . el .rr #ADVANCE_FROM_TOP
7608 . QUAD \\*[$DOC_QUAD]
7610 . nr #START_FOR_FOOTERS 1
7611 . if !\\n[#DOC_TYPE]=4 .em TERMINATE
7612 . if \\n[#LINENUMBERS]=2 \{\
7613 . NUMBER_LINES RESUME
7616 . if \\n[#RUN_ON]=1 \{\
7617 . if \\n[#FN_MARKER_STYLE]=1 .RUNON_WARNING
7618 . if \\n[#FN_MARKER_STYLE]=2 .RUNON_WARNING
7622 .MAC CLEANUP_DEFAULTS END
7624 . if \\n[#DOC_HEADER]=1 .nr #DOC_HEADER 2
7625 . rm $TOC_TITLE_ITEM
7632 \# ====================================================================
7634 \# +++MACROS TO CHANGE SOME DEFAULTS+++
7639 \# <none> | <anything> [distance to advance from top of page]
7641 \# Turns printing of document header on or off. If a second
7642 \# numeric argument with units of measure is given, advances that
7643 \# distance from the top of the page without printing the document
7646 \# Default is on. If the 1st argument is <anything> (which turns
7647 \# document headers off), the optional 2nd argument may be given
7648 \# (with a unit of measure).
7651 . ie '\\$1'' .nr #DOC_HEADER 1
7653 . if !'\\$2'' .nr #ADVANCE_FROM_TOP (\\$2)
7658 \# DOCUMENT HEADER LEADING
7659 \# -----------------------
7661 \# <+|- amount by which to in/decrease leading of doc header>
7663 \# Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
7665 \# A unit of measure must be supplied. Decimal fractions OK.
7666 \# Default is +0, i.e. same as DOC_LEAD.
7668 .MAC DOCHEADER_LEAD END
7669 . ds $DOCHEADER_LEAD_ADJ \\$1
7672 \# DOCHEADER ADVANCE
7673 \# -----------------
7675 \# <docheader start position>
7677 \# Creates register #DOCHEADER_ADVANCE, used in START.
7679 \# Unit of measure required.
7680 \# Default is same as T_MARGIN.
7682 .MAC DOCHEADER_ADVANCE END
7683 . nr #DOCHEADER_ADVANCE \\$1
7686 \# DOCUMENT LEFT MARGIN
7687 \# --------------------
7689 \# <left margin of document>
7691 \# Creates or modifies register #DOC_L_MARGIN.
7693 \# Affects everything on the page.
7695 .MAC DOC_LEFT_MARGIN END
7696 . if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
7698 . nr #DOC_L_MARGIN (\\$1)
7699 . L_MARGIN \\n[#DOC_L_MARGIN]u
7702 \# DOCUMENT RIGHT MARGIN
7703 \# ---------------------
7705 \# <right margin of document>
7707 \# Creates or modifies register #DOC_R_MARGIN.
7709 \# Affects everything on the page.
7711 .MAC DOC_RIGHT_MARGIN END
7713 . nr #DOC_R_MARGIN (\\$1)
7714 . R_MARGIN \\n[#DOC_R_MARGIN]
7715 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
7718 \# DOCUMENT LINE LENGTH
7719 \# --------------------
7721 \# <line length of document>
7723 \# Creates or modifies register #DOC_L_LENGTH.
7725 \# Affects everything on the page.
7727 .MAC DOC_LINE_LENGTH END
7728 . if !\\n[DOCS] .DOC_MACRO_ERROR \\$0
7730 . nr #DOC_L_LENGTH (\\$1)
7731 . LL \\n[#DOC_L_LENGTH]u
7738 \# <family of running text>
7740 \# Creates or modifies string $DOC_FAM.
7742 \# Affects everything except headers and footers.
7745 . if !\\n[DOCS] .DOC_MACRO_ERROR \\$0
7748 . ds $FAMILY \\*[$DOC_FAM]
7749 . AUTHOR_FAMILY \\*[$DOC_FAM]
7750 . BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
7751 . DOCHEADER_FAMILY \\*[$DOC_FAM]
7752 . DOCTYPE_FAMILY \\*[$DOC_FAM]
7753 . EPIGRAPH_FAMILY \\*[$DOC_FAM]
7754 . FOOTNOTE_FAMILY \\*[$DOC_FAM]
7755 . HDRFTR_FAMILY \\*[$DOC_FAM]
7756 . LINENUMBER_FAMILY \\*[$DOC_FAM]
7757 . QUOTE_FAMILY \\*[$DOC_FAM]
7758 . SUBTITLE_FAMILY \\*[$DOC_FAM]
7759 . TITLE_FAMILY \\*[$DOC_FAM]
7762 \# DOCUMENT POINT SIZE
7763 \# -------------------
7765 \# <point size of running text>
7767 \# Creates or modifies register #DOC_PT_SIZE.
7769 \# DOC_PT_SIZE is the basis for calculating all type sizes in
7770 \# a document. Ignored if PRINTSTYLE TYPEWRITE.
7772 .ALIAS DOC_PT_SIZE PT_SIZE
7777 \# <lead (".vs") of running text> [ADJUST]
7779 \# Creates or modifies register #DOC_LEAD. If the optional
7780 \# ADJUST argument is given, adjusts leading so that the last
7781 \# line of text falls exactly on #B_MARGIN.
7783 \# DOC_LEAD is the basis for calculating all leading changes in
7784 \# a document. Default for TYPESET is 16; 24 for TYPEWRITE.
7786 \# Because the visible bottom or footer margin of a page depends
7787 \# on the overall document lead supplied by the register #DOC_LEAD,
7788 \# DOC_LEAD, in the body of a document, should always be associated
7789 \# with the start of a new page (in other words, just before or
7790 \# just after a manual NEWPAGE). Ignored if PRINTSTYLE TYPEWRITE.
7793 . if \\n[#IGNORE] .return
7794 . if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
7796 . if '\\$0'DOC_LEAD' \{\
7799 . rr #DOC_AUTOLEAD_FACTOR
7800 . nr #DOC_LEAD \\n[.v]
7803 . if !\\n[#ADJ_DOC_LEAD] .nr #REMOVE_ADJ 1
7804 . if !'\\$0'DOC_LEAD' \{\
7805 . if '\\$0'EN_LEAD' .nr #DOC_LEAD \\n[#EN_LEAD]
7806 . if '\\$0'BIB_LEAD' .nr #DOC_LEAD \\n[#BIB_LEAD]
7807 . if '\\$0'TOC_LEAD' .nr #DOC_LEAD \\n[#TOC_LEAD]
7808 . if '\\$2'ADJUST' .TRAPS
7813 \# ADJUST DOCUMENT LEAD
7814 \# --------------------
7816 \# <none> | <anything>
7818 \# Adjusts document lead so that the last line of text falls exactly
7821 .MAC DOC_LEAD_ADJUST END
7823 . nr #ADJ_DOC_LEAD 1
7824 . rr #DOC_LEAD_ADJUST_OFF
7827 . nr #ADJ_DOC_LEAD 0
7828 . nr #DOC_LEAD_ADJUST_OFF 1
7837 \# Advances to the next "valid" baseline.
7839 \# If a user plays around with spacing in a doc (say, with ALD),
7840 \# it isn't easy to get mom back on track so she can achieve
7841 \# perfectly flush bottom margins. Any time SHIM is used, it
7842 \# ensures that the next output line falls on a valid baseline.
7844 \# First, a little convenience macro
7846 .MAC PROCESS_SHIM END
7847 . while \\n+[#VALID_BASELINE]<\\n[#CURRENT_V_POS] \{\
7850 . nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
7853 \# And a macro to disable SHIM
7856 . ie '\\$1'' .nr #NO_SHIM 1
7860 .nr #NO_SHIM 2 \" Restored to 1 in DEFAULTS.
7863 . ie \\n[#NO_SHIM] .return
7865 . nr #VALID_BASELINE \\n[#T_MARGIN]-\\n[#DOC_LEAD] \\n[#DOC_LEAD]
7866 . if !r#CURRENT_V_POS .nr #CURRENT_V_POS \\n[.d]
7867 . ie \\n[#ADVANCE_FROM_TOP] \{\
7868 . ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
7869 . while \\n-[#VALID_BASELINE]>\\n[#CURRENT_V_POS] .
7870 . nr #VALID_BASELINE +\\n[#DOC_LEAD]
7871 . nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
7881 \# ====================================================================
7883 \# +++INTERNATIONALIZATION+++
7888 \# <what goes in the "by" slot before author in the document header>
7890 \# Creates or modifies string $ATTRIBUTE_STRING.
7892 \# Default is "by". A blank string ("") may be used if no
7893 \# attribution is desired. Blank line results.
7895 .MAC ATTRIBUTE_STRING END
7896 . if !'\\$1'DOC_COVER' \
7897 . if !'\\$1'COVER' .nr #NEITHER 1
7898 . if !'\\$1'COVER' \
7899 . if !'\\$1'DOC_COVER' .nr #NEITHER 1
7900 . if '\\$1'DOC_COVER' \
7901 . ds $ATTRIBUTE_STRING_DOC_COVER \\$2
7903 . ds $ATTRIBUTE_STRING_COVER \\$2
7904 . if \\n[#NEITHER]=1 \{\
7905 . ds $ATTRIBUTE_STRING \\$1
7913 \# <what to print any time the word "chapter" is required>
7915 \# Creates or modifies string $CHAPTER_STRING.
7917 \# Default is "chapter".
7919 .MAC CHAPTER_STRING END
7920 . ds $CHAPTER_STRING \\$1
7926 \# <what to print any time the word "draft" is required>
7928 \# Creates or modifies string $DRAFT_STRING.
7930 \# Default is "draft".
7932 .MAC DRAFT_STRING END
7933 . ds $DRAFT_STRING \\$1
7939 \# <what to print any time the word "revision" is required>
7941 \# Creates or modifies string $REVISION_STRING.
7943 \# Default is "revision".
7945 .MAC REVISION_STRING END
7946 . ds $REVISION_STRING \\$1
7952 \# <what to print with the finis macro>
7954 \# Creates or modifies string $FINIS_STRING.
7956 \# Default is "END".
7958 .MAC FINIS_STRING END
7959 . ds $FINIS_STRING \\$1
7962 .MAC FINIS_STRING_CAPS END
7963 . ie '\\$1'' .nr #FINIS_STRING_CAPS 1
7964 . el .nr #FINIS_STRING_CAPS 0
7967 \# ====================================================================
7969 \# +++RECTO/VERSO+++
7974 \# <none> | <anything>
7976 \# Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages. Also
7977 \# switches page numbers left and right if either is chosen rather
7978 \# than the default centered page numbers. Switches left and right
7979 \# margins if differing values have been entered.
7983 .MAC RECTO_VERSO END
7984 . ie '\\$1'' .nr #RECTO_VERSO 1
7985 . el .nr #RECTO_VERSO 0
7991 \# Forces doccover and cover pages to recto
7993 .MAC RV_HARD_SET_MARGINS END
7994 . DOC_LEFT_MARGIN \\n[@L_MARGIN]u
7995 . DOC_RIGHT_MARGIN \\n[@R_MARGIN]u
7996 . po \\n[#DOC_L_MARGIN]u
7997 . LL \\n[#DOC_L_LENGTH]u
8000 \# ====================================================================
8007 \# <value by which to multiply PP_INDENT for block epigraphs>
8009 \# Creates or modifies register #EPI_OFFSET_VALUE.
8011 \# Default is 2 for TYPEWRITE, 3 for TYPESET.
8013 .MAC EPIGRAPH_INDENT END
8014 . rr #EPI_OFFSET_VALUE
8015 . rm $EPI_OFFSET_VALUE
8016 . ds $EVAL_EI_ARG \\$1
8017 . substring $EVAL_EI_ARG -1
8018 . ie \B'\\*[$EVAL_EI_ARG]' .nr #EPI_OFFSET_VALUE \\$1
8019 . el .ds $EPI_OFFSET_VALUE \\$1
8023 \# EPIGRAPH AUTOLEAD
8024 \# -----------------
8026 \# <amount of lead to add to the epigraph ps for epigraph leading>
8028 \# Creates or modifies register #EPI_AUTOLEAD.
8030 \# Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
8032 .MAC EPIGRAPH_AUTOLEAD END
8033 . nr #EPI_AUTOLEAD (p;\\$1)
8039 \# BLOCK | <anything>
8041 \# Places an epigraph before the document's text, after the
8042 \# document header, or after a HEAD.
8044 \# #EPIGRAPH 1 = centered; 2 = block
8046 \# By default, epigraphs are centered, allowing the user
8047 \# to input them on a line per line basis. To change this
8048 \# behaviour, the user can supply the argument BLOCK, which
8049 \# will produce indented, filled text similar to BLOCKQUOTE.
8051 \# If a block epigraph contains more than one para, ALL paras of
8052 \# the epigraph must be preceded by PP. Otherwise, PP is optional.
8057 . if \\n[#LINENUMBERS]=1 \{\
8061 . if \\n[#START] \{\
8062 . if \\n[#PRINT_STYLE]=1 \
8063 . if \\n[#AUTHOR_LINES]=1 .sp \\n[#DOC_LEAD]u
8069 . ll \\n[#L_LENGTH]u
8072 . if \\n[#COLUMNS] \{\
8073 . ie \\n[#START] \{\
8074 . ll \\n[#DOC_L_LENGTH]u
8078 . ll \\n[#COL_L_LENGTH]u
8083 . if \\n[#PRINT_STYLE]=1 \{\
8084 . fam \\*[$TYPEWRITER_FAM]
8086 . if '\\*[$EPI_FT]'I' .FT I
8087 . ps \\*[$TYPEWRITER_PS]
8088 . ie \\n[#SINGLE_SPACE] .vs \\n[#DOC_LEAD]u
8089 . el .vs \\n[#DOC_LEAD]u/2u
8090 . nr #EPI_LEAD \\n[#LEAD]
8091 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8093 . if \\n[#PRINT_STYLE]=2 \{\
8094 . FAMILY \\*[$EPI_FAM]
8096 . ps \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
8097 . if \\n[#EPI_COLOR]=1 \{\
8102 . vs \\n[.ps]u+\\n[#EPI_AUTOLEAD]u
8103 . nr #EPI_LEAD \\n[#LEAD]
8104 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8107 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
8108 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
8113 . ie '\\$1'BLOCK' \{\
8117 . ie \\n[#START] \{\
8118 . ie \\n[#COLUMNS] \{\
8119 . ie r#EPI_OFFSET_VALUE \
8121 \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8124 \\n[#L_LENGTH_FOR_EPI]u-(\\*[$EPI_OFFSET_VALUE]u*2u)
8128 . ie r#EPI_OFFSET_VALUE \
8130 \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8132 . ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8137 . ie r#EPI_OFFSET_VALUE \
8139 \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8141 . ll \\n[#L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8143 . if \\n[#COLUMNS] \{\
8144 . ie r#EPI_OFFSET_VALUE \
8146 \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
8148 . ll \\n[#COL_L_LENGTH]u-(\\*[$EPI_OFFSET_VALUE]*2u)
8153 . if \\n[#PRINT_STYLE]=1 \{\
8154 . fam \\*[$TYPEWRITER_FAM]
8156 . if '\\*[$EPI_FT]'I' .FT I
8157 . ps \\*[$TYPEWRITER_PS]
8158 . ie \\n[#SINGLE_SPACE] .vs \\n[#DOC_LEAD]u
8159 . el .vs \\n[#DOC_LEAD]u/2u
8162 . nr #EPI_LEAD \\n[#LEAD]
8163 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8167 . if \\n[#PRINT_STYLE]=2 \{\
8168 . FAMILY \\*[$EPI_FAM]
8170 . ps \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
8171 . if \\n[#EPI_COLOR]=1 \{\
8176 . vs \\n[.ps]u+\\n[#EPI_AUTOLEAD]u
8177 . QUAD \\*[$EPI_QUAD]
8178 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
8179 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
8181 . nr #EPI_LEAD \\n[#LEAD]
8182 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
8196 \# Ends diversion started in EPIGRAPH. Makes spacing
8197 \# adjustments to compensate for the difference between epigraph
8198 \# leading and overall document leading, so that the bottom of
8199 \# the pages remain flush.
8201 \# In addition to its usual place at the beginning of a
8202 \# document, EPIGRAPH may also be used after HEAD.
8204 .MAC DO_EPIGRAPH END
8208 . if \\n[#RESET_FN_COUNTERS]=2 \{\
8209 . if !\\n[#FN_COUNT]=1 \{\
8210 . if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
8212 . rr #RESET_FN_COUNTERS
8216 . nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
8220 . nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
8221 . nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
8222 . ie \\n[#START] \{\
8224 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
8225 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8226 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8228 . if \\n[#PRINT_STYLE]=1 \
8229 . if !\\n[#SINGLE_SPACE]=1 .ALD \\n[#DOC_LEAD]u
8230 . if \\n[#PRINT_STYLE]=2 \{\
8231 . ie !\\n[#DOC_TYPE]=2 .RLD \\n[#DOC_LEAD]u
8233 . ie '\\*[$CHAPTER_TITLE]'' .RLD \\n[#DOC_LEAD]u
8234 . el .if '\\*[$CHAPTER]'' .RLD \\n[#DOC_LEAD]u
8236 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
8237 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
8238 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
8240 \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8244 . ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
8246 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
8247 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8248 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8250 . ie \\n[#PRINT_STYLE]=1 \{\
8251 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \
8252 . ALD \\n[#EPI_WHITESPACE]u/2u
8255 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
8257 \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
8258 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
8260 \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8262 . if \\n[#DIVER_FN]=2 .rr #DIVER_FN
8265 . nr #EPI_LINES_TO_TRAP 0 1
8266 . while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\
8269 . nr #EPI_LINES_TO_TRAP -1
8270 . nr #EPI_WHITESPACE \
8271 (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
8272 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8273 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8275 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
8276 . ALD \\n[#EPI_WHITESPACE]u
8277 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
8278 . ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u
8281 . if \\n[#EPIGRAPH]=1 \{\
8282 . po \\n[#L_MARGIN]u
8283 . if \\n[#COLUMNS] \{\
8284 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8285 . nr #L_MARGIN \\n[.o]
8288 . if \\n[#EPIGRAPH]=2 \{\
8289 . ie \\n[#EPI_OFFSET_VALUE] \
8291 \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
8292 . el .nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
8293 . if \\n[#COLUMNS] \{\
8294 . ie r#EPI_OFFSET_VALUE \
8296 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
8297 . el .nr #EPI_OFFSET \
8298 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
8300 . po \\n[#EPI_OFFSET]u
8305 . ie \\n[#START] \{\
8306 . if \\n[#PRINT_STYLE]=1 .SHIM
8307 . if \\n[#PRINT_STYLE]=2 \{\
8308 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
8309 . ALD \\n[#EPI_WHITESPACE]u/2u
8310 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
8311 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8317 . ie \\n[#EPI_FITS] \{\
8318 . ie \\n[#FN_FOR_EPI] \{\
8319 . nr #EPI_LINES_TO_END 1
8320 . nr #EPI_WHITESPACE \
8321 (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
8322 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8323 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8325 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
8328 . ie \\n[#PRINT_STYLE]=1 \{\
8329 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \
8330 . ALD \\n[#EPI_WHITESPACE]u
8333 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \
8334 . ALD \\n[#EPI_WHITESPACE]u/2u
8335 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \
8336 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
8341 . nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
8342 . if \\n[#LOOP] .nr #EPI_LINES_TO_END +1
8344 . nr #EPI_WHITESPACE \
8345 (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
8346 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
8347 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
8349 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
8350 . if \\n[#PRINT_STYLE]=1 \{\
8351 . if !\\n[#SINGLE_SPACE] \{\
8352 . nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
8353 . ie \\n[#EPI_LINES_EVEN] .ALD .5v
8355 . rr #EPI_LINES_EVEN
8362 . ALD \\n[#DOC_LEAD]u
8363 . QUAD \\*[$DOC_QUAD]
8364 . po \\n[#L_MARGIN]u
8365 . if \\n[#COLUMNS] \{\
8366 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8367 . nr #L_MARGIN \\n[.o]
8369 . if \\n[#START] \{\
8370 . if \\n[#COLUMNS] \{\
8371 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8372 . nr #L_MARGIN \\n[.o]
8376 . if \\n[#LINENUMBERS]=2 \{\
8377 . NUMBER_LINES RESUME
8382 \# ====================================================================
8384 \# +++FINIS MACRO+++
8391 \# Deposits --END-- at the end of a document.
8395 . if \\n[.t]<=2v \{\
8396 . tm1 "[mom]: '\\n[.F]': Insufficient room to print \\$0 on last page.
8403 . if \\n[#TAB_ACTIVE] .TQ
8404 . if \\n[#INDENT_ACTIVE] .IQ CLEAR
8405 . nr #EM_ADJUST (1m/8)
8406 . if \\n[#COLUMNS] \{\
8407 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8408 . nr #L_MARGIN \\n[.o]
8410 . ALD \\n[#DOC_LEAD]u
8412 . if \\n[#FINIS_STRING_CAPS]=1 .CAPS
8413 . if \\n[#PRINT_STYLE]=1 .PRINT "--\\*[$FINIS_STRING]--
8414 . if \\n[#PRINT_STYLE]=2 \{\
8415 . ie \\n[#FINIS_COLOR] \
8417 \m[\\*[$FINIS_COLOR]]\v'-\\n[#EM_ADJUST]u'\[em]\v'+\\n[#EM_ADJUST]u'\
8418 \\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\[em]\m[]\c
8420 \v'-\\n[#EM_ADJUST]u'\[em]\v'+\\n[#EM_ADJUST]u'\
8421 \\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\[em]\m[]\c
8424 . if \\n[#FINIS_STRING_CAPS]=1 .CAPS OFF
8429 \# ====================================================================
8431 \# +++HEADERS/FOOTERS+++
8433 \# Define a string so that the current page number can be incorporated
8434 \# into the strings for hdrftr left, right, and center. NOTE: This is
8435 \# not the same thing as using the shortform # in hdrftr strings.
8437 .ds PAGE# \En[#PAGENUMBER]
8439 .MAC RESTORE_SPACE END
8452 \# <amount of space between header/footer and header/footer rule>
8454 \# Creates or modifies register #HDRFTR_RULE_GAP to hold amount
8455 \# of space between header/footer and header/footer rule.
8459 .MAC HDRFTR_RULE_GAP END
8460 . nr #HDRFTR_RULE_GAP (\\$1)
8461 . if '\\$0'HEADER_RULE_GAP' \{\
8462 . nr #HEADER_RULE_GAP \\n[#HDRFTR_RULE_GAP]
8463 . if r #FOOTER_RULE_GAP .nr #FOOTER_RULE_GAP \\n[#FOOTER_RULE_GAP]
8465 . if '\\$0'FOOTER_RULE_GAP' \{\
8466 . nr #FOOTER_RULE_GAP \\n[#HDRFTR_RULE_GAP]
8467 . if r #HEADER_RULE_GAP .nr #HEADER_RULE_GAP \\n[#HEADER_RULE_GAP]
8474 \# <what to put in the left position of page header/footers>
8476 \# Creates or modifies string $HDRFTR_LEFT.
8477 \# Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
8478 \# overrides the $HDRFTR_LEFT string created by default
8481 \# Especially useful if doc has more than one author, and a list
8482 \# of authors by last name is desired in header/footers.
8483 \# Default is author.
8485 \# If the argument is the # character, simply prints the current
8488 \# If the user wants to incorporate the page number into the string,
8489 \# \*[PAGE#] must be used. For example, if the user wants to put
8490 \# an elipsis before the page number in the string, s/he should use
8491 \# ...\*[PAGE#], not ...#
8493 .MAC HDRFTR_LEFT END
8494 . nr #USER_DEF_HDRFTR_LEFT 1
8495 . ds $HDRFTR_LEFT \\$1
8501 \# <none> | <anything>
8503 \# Turns capitalisation of $HDRFTR_LEFT (typically, the author of
8504 \# the document) on or off.
8508 .MAC HDRFTR_LEFT_CAPS END
8509 . ie '\\$1'' .nr #HDRFTR_LEFT_CAPS 1
8511 . nr #HDRFTR_LEFT_CAPS 0
8512 . ds $HDRFTR_LEFT_SIZE_CHANGE +0
8519 \# <what to put in the centre position of page header/footers>
8521 \# Creates or modifies string $HDRFTR_CENTER.
8522 \# Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
8523 \# overrides the $HDRFTR_CENTER string created by default
8526 \# Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
8527 \# CHAPTER, draft and revision number if COPYSTYLE DRAFT.
8529 \# If the argument is the # character, simply prints the current
8532 \# If the user wants to incorporate the page number into the string,
8533 \# \*[PAGE#] must be used. For example, if the user wants to put
8534 \# an elipsis before the page number in the string, s/he should use
8535 \# ...\*[PAGE#], not ...#
8537 .MAC HDRFTR_CENTER END
8538 . nr #USER_DEF_HDRFTR_CENTER 1
8539 . if '\\$0'FOOTER_CENTER' \{\
8540 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
8541 . ds $HDRFTR_CENTER_NEW \\$1
8543 . if '\\$0'FOOTER_CENTRE' \{\
8544 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
8545 . ds $HDRFTR_CENTER_NEW \\$1
8547 . ds $HDRFTR_CENTER \\$1
8550 \# HDRFTR CENTER CAPS
8551 \# ------------------
8553 \# <none> | <anything>
8555 \# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
8556 \# the document) on or off.
8560 .MAC HDRFTR_CENTER_CAPS END
8561 . ie '\\$1'' .nr #HDRFTR_CENTER_CAPS 1
8563 . nr #HDRFTR_CENTER_CAPS 0
8564 . ds $HDRFTR_CENTER_SIZE_CHANGE +0
8568 \# HDRFTR CENTER PADDING
8569 \# ---------------------
8571 \# LEFT | RIGHT <amount of padding to put left or right of hdrftr
8574 \# Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
8575 \# #HDRFTR_CTR_PAD_RIGHT.
8577 \# By default, the HDRFTR_CENTER string is centered on the doc
8578 \# line length. Long titles or long author names can screw up
8579 \# visual centering, or create overprints. This macro allows the
8580 \# user to pad the center string by the specified amount of space
8581 \# to fix these problems.
8583 \# A unit of measure is required.
8585 .MAC HDRFTR_CENTER_PAD END
8586 . if '\\$1'LEFT' .nr #HDRFTR_CTR_PAD_LEFT (\\$2)
8587 . if '\\$1'RIGHT' .nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
8590 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
8591 \# --------------------------------
8595 \# Switches the padding side of hdrftr center padding.
8597 \# Required to keep spacing around hdrftr string constant
8598 \# in recto/verso documents.
8600 .MAC SWITCH_HDRFTR_CENTER_PAD END
8601 . nr #HDRFTR_CTR_PAD_TMP \\n[#HDRFTR_CTR_PAD_LEFT]
8602 . HDRFTR_CENTER_PAD LEFT \\n[#HDRFTR_CTR_PAD_RIGHT]u
8603 . HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
8609 \# <what to put in the right position of page header/footers>
8611 \# Creates or modifies string $HDRFTR_RIGHT.
8612 \# Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
8613 \# overrides the $HDRFTR_RIGHT string created by default
8616 \# Default is document title.
8618 \# If the argument is the # character, simply prints the current
8621 \# If the user wants to incorporate the page number into the string,
8622 \# \*[PAGE#] must be used. For example, if the user wants to put
8623 \# an elipsis before the page number in the string, s/he should use
8624 \# ...\*[PAGE#], not ...#
8626 .MAC HDRFTR_RIGHT END
8627 . nr #USER_DEF_HDRFTR_RIGHT 1
8628 . ds $HDRFTR_RIGHT \\$1
8631 \# HDRFTR RIGHT CAPS
8632 \# -----------------
8634 \# <none> | <anything>
8636 \# Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
8637 \# the document) on or off.
8641 .MAC HDRFTR_RIGHT_CAPS END
8642 . ie '\\$1'' .nr #HDRFTR_RIGHT_CAPS 1
8644 . nr #HDRFTR_RIGHT_CAPS 0
8645 . ds $HDRFTR_RIGHT_SIZE_CHANGE +0
8652 \# <none> | <anything>
8654 \# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
8655 \# under the header/over the footer. Otherwise, turns HDRFTR_RULE
8658 .MAC HDRFTR_RULE END
8659 . if r #HEADERS_ON \
8660 . if \\n[#HEADERS_ON]=1 .nr #HDRFTR_RULE_GAP \\n[#HEADER_RULE_GAP]
8661 . if r #FOOTERS_ON \
8662 . if \\n[#FOOTERS_ON]=1 .nr #HDRFTR_RULE_GAP \\n[#FOOTER_RULE_GAP]
8663 . if '\\$0'HDRFTR_RULE_INTERNAL' \{\
8664 . ie \\n[#USERDEF_HDRFTR] \{\
8665 . nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
8666 . if \\n[#HEADERS_ON] \{\
8668 . ALD \\n[#HDRFTR_RULE_GAP]u
8669 . nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT]
8670 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ]
8672 . if \\n[#FOOTERS_ON] \{\
8675 \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u
8676 . nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT]
8677 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ]
8679 . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
8680 \m[\\*[$HDRFTR_RULE_COLOR]]\
8681 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8683 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8684 \D'l \\n[#DOC_L_LENGTH]u 0'\
8685 \D't \\n[#RULE_WEIGHT]u'\
8686 \h'-\\n[#RULE_WEIGHT]u'\
8690 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8692 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8693 \D'l \\n[#DOC_L_LENGTH]u 0'\
8694 \D't \\n[#RULE_WEIGHT]u'\
8695 \h'-\\n[#RULE_WEIGHT]u'
8700 . if \\n[#PRINT_STYLE]=1 .nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
8701 . if \\n[#PRINT_STYLE]=2 \{\
8702 . ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \
8703 . nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
8704 . el .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT]
8705 . ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \
8706 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
8707 . el .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT]
8709 . if \\n[#HEADERS_ON] \{\
8711 . ALD \\n[#HDRFTR_RULE_GAP]u
8712 . nr #HDRFTR_RULE_WEIGHT \\n[#HEADER_RULE_WEIGHT]
8713 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#HEADER_RULE_WEIGHT_ADJ]
8715 . if \\n[#FOOTERS_ON] \{\
8718 \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+\\n[#FOOTER_RULE_WEIGHT]u
8719 . nr #HDRFTR_RULE_WEIGHT \\n[#FOOTER_RULE_WEIGHT]
8720 . nr #HDRFTR_RULE_WEIGHT_ADJ \\n[#FOOTER_RULE_WEIGHT_ADJ]
8722 . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
8723 \m[\\*[$HDRFTR_RULE_COLOR]]\
8724 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8726 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8727 \D'l \\n[#DOC_L_LENGTH]u 0'\
8728 \D't \\n[#RULE_WEIGHT]u'\
8729 \h'-\\n[#RULE_WEIGHT]u'\
8733 \D't \\n[#HDRFTR_RULE_WEIGHT]u'\
8735 \v'+\\n[#HDRFTR_RULE_WEIGHT_ADJ]u'\
8736 \D'l \\n[#DOC_L_LENGTH]u 0'\
8737 \D't \\n[#RULE_WEIGHT]u'\
8738 \h'-\\n[#RULE_WEIGHT]u'
8743 . if '\\$0'HEADER_RULE' \{\
8753 . if '\\$0'FOOTER_RULE' \{\
8763 . if '\\$0'HDRFTR_RULE' \{\
8764 . ie '\\$1'' .nr #HDRFTR_RULE 1
8765 . el .nr #HDRFTR_RULE 0
8769 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
8776 \# Sets the family, font, and point size of all strings in
8777 \# header/footers to the same family and point size as running
8778 \# text. Font for the header/footer becomes roman throughout.
8780 .MAC HDRFTR_PLAIN END
8781 . HDRFTR_FAMILY \\*[$DOC_FAM]
8782 . HDRFTR_PT_SIZE \\n[#DOC_PT_SIZE]
8783 . HDRFTR_LEFT_FAMILY \\*[$DOC_FAM]
8784 . HDRFTR_LEFT_FONT R
8785 . HDRFTR_LEFT_SIZE +0
8786 . HDRFTR_LEFT_CAPS OFF
8787 . HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
8788 . HDRFTR_CENTER_FONT R
8789 . HDRFTR_CENTER_SIZE +0
8790 . HDRFTR_CENTER_CAPS OFF
8791 . HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]
8792 . HDRFTR_RIGHT_FONT R
8793 . HDRFTR_RIGHT_SIZE +0
8794 . HDRFTR_RIGHT_CAPS OFF
8800 \# <none> | <anything>
8802 \# Creates or modifies register #SWITCH_HDRFTR, used to switch
8803 \# default location of HDRFTR_LEFT and HDRFTR_RIGHT.
8807 \# Typically, the author string appears at the left of header/footers,
8808 \# and the title string appears at the right. This switches the
8809 \# location of the two. Useful in conjunction with RECTO_VERSO to tweak
8810 \# switches on alternate pages to come out as the user wishes. The
8811 \# assumption of RECTO_VERSO is that the first page of the document
8812 \# (recto) is odd, and even though it has no header/footer, if it did
8813 \# have one, it would print as AUTHOR...CENTER...TITLE (or whatever
8814 \# strings the user has supplied for HDRFTR_LEFT/RIGHT), meaning that
8815 \# the next page, which does have a header/footer, will come out as
8816 \# TITLE...CENTER...AUTHOR (or whatever strings the user has supplied
8817 \# for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user to get the
8818 \# desired string in the desired place on the desired recto/verso page.
8820 .MAC SWITCH_HDRFTR END
8821 . ie '\\$1'' .nr #SWITCH_HDRFTR 1
8822 . el .nr #SWITCH_HDRFTR 0
8825 \# USER DEFINED HDRFTR RECTO
8826 \# -------------------------
8828 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
8830 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
8831 \# stores string in $USERDEF_HDRFTR_RECTO.
8833 \# For use when users don't want 3-part headers/footers, but rather
8834 \# want to design their own headers/footers and need different
8835 \# headers/footers on recto and verso pages. Using just
8836 \# HEADER_RECTO, even when recto/verso is not on, allows users to
8837 \# design their own headers/footers for doc pages.
8839 .MAC HDRFTR_RECTO END
8840 . nr #USERDEF_HDRFTR 1
8841 . if '\\$1'L' .nr #USERDEF_HDRFTR_RECTO_QUAD 1
8842 . if '\\$1'LEFT' .nr #USERDEF_HDRFTR_RECTO_QUAD 1
8843 . if '\\$1'C' .nr #USERDEF_HDRFTR_RECTO_QUAD 2
8844 . if '\\$1'CENTER' .nr #USERDEF_HDRFTR_RECTO_QUAD 2
8845 . if '\\$1'CENTRE' .nr #USERDEF_HDRFTR_RECTO_QUAD 2
8846 . if '\\$1'R' .nr #USERDEF_HDRFTR_RECTO_QUAD 3
8847 . if '\\$1'RIGHT' .nr #USERDEF_HDRFTR_RECTO_QUAD 3
8849 . ie '\\$1'CAPS' \{\
8850 . nr #HDRFTR_RECTO_CAPS 1
8851 . ds $USERDEF_HDRFTR_RECTO \\$2
8853 . el .ds $USERDEF_HDRFTR_RECTO \\$1
8856 \# USER DEFINED HDRFTR VERSO
8857 \# -------------------------
8859 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
8861 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
8862 \# stores string in $USERDEF_HDRFTR_VERSO.
8864 \# For use when users don't want 3-part headers/footers, but rather
8865 \# want to design their own headers/footers and need different
8866 \# headers/footers on recto and verso pages.
8868 .MAC HDRFTR_VERSO END
8869 . nr #USERDEF_HDRFTR 1
8870 . if '\\$1'L' .nr #USERDEF_HDRFTR_VERSO_QUAD 1
8871 . if '\\$1'LEFT' .nr #USERDEF_HDRFTR_VERSO_QUAD 1
8872 . if '\\$1'C' .nr #USERDEF_HDRFTR_VERSO_QUAD 2
8873 . if '\\$1'CENTER' .nr #USERDEF_HDRFTR_VERSO_QUAD 2
8874 . if '\\$1'CENTRE' .nr #USERDEF_HDRFTR_VERSO_QUAD 2
8875 . if '\\$1'R' .nr #USERDEF_HDRFTR_VERSO_QUAD 3
8876 . if '\\$1'RIGHT' .nr #USERDEF_HDRFTR_VERSO_QUAD 3
8878 . ie '\\$1'CAPS' \{\
8879 . nr #HDRFTR_VERSO_CAPS 1
8880 . ds $USERDEF_HDRFTR_VERSO \\$2
8882 . el .ds $USERDEF_HDRFTR_VERSO \\$1
8885 \# PRINT FOOTER ON FIRST PAGE
8886 \# --------------------------
8888 \# <none> | <anything>
8890 \# Toggles register #PRINT_FOOTER_ON_PAGE_1
8892 \# Lets user choose whether to print footer on first
8895 .MAC FOOTER_ON_FIRST_PAGE END
8896 . ie '\\$1'' .nr #PRINT_FOOTER_ON_PAGE_1 1
8897 . el .rr #PRINT_FOOTER_ON_PAGE_1
8900 \# PRINT PAGE NUMBER ON FIRST PAGE
8901 \# -------------------------------
8903 \# <none> | <anything>
8905 \# Toggles register #PRINT_PAGENUM_ON_PAGE_1
8907 \# Lets user choose whether to print page number on first
8908 \# page of doc and after collate when footers are on or page numbering
8909 \# has been user set at top of page.
8911 .MAC PAGENUM_ON_FIRST_PAGE END
8912 . ie '\\$1'' .nr #PRINT_PAGENUM_ON_PAGE_1 1
8913 . el .rr #PRINT_PAGENUM_ON_PAGE_1
8916 \# PRINT HEADER/FOOTER
8917 \# -------------------
8921 \# Based on defaults or values entered by user, prints a
8922 \# three-part title at either the top or the bottom of the page.
8924 \# Called from within either HEADER or FOOTER.
8926 .MAC PRINT_HDRFTR END
8927 . if \\n[#DOC_TYPE]=4 .nr #SUITE \En[.pn]
8928 . if \\n[#FOOTERS_ON] \{\
8929 . if \\n[#START_FOR_FOOTERS] \{\
8930 . rr #START_FOR_FOOTERS
8931 . if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{\
8932 . ie !\\n[#HDRFTR_BOTH] .return
8936 . ie \\n[#HEADER_RULE]=1 .HEADER_RULE
8937 . el .HEADER_RULE OFF
8938 . ie \\n[#HDRFTR_BOTH] .HEADER_VERSO \\*[$HDR_VERSO_QUAD] "\\*[$HDR_VERSO_STRING]"
8939 . el .HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
8945 . if \\n[#USERDEF_HDRFTR] \{\
8946 . PRINT_USERDEF_HDRFTR
8949 . if \\n[#SWITCH_HDRFTR] \{\
8950 . ds $HDRFTR_TMP_SWITCH \\*[$HDRFTR_LEFT]
8951 . ds $HDRFTR_LEFT \\*[$HDRFTR_RIGHT]
8952 . ds $HDRFTR_RIGHT \\*[$HDRFTR_TMP_SWITCH]
8953 . ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
8954 . ds $HDRFTR_LEFT_SIZE_CHANGE \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
8955 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
8956 . nr #HDRFTR_TMP_CAPS_SWITCH \\n[#HDRFTR_LEFT_CAPS]
8957 . nr #HDRFTR_LEFT_CAPS \\n[#HDRFTR_RIGHT_CAPS]
8958 . nr #HDRFTR_RIGHT_CAPS \\n[#HDRFTR_TMP_CAPS_SWITCH]
8959 . ds $HDRFTR_TMP_COLOR_SWITCH \\*[$HDRFTR_LEFT_COLOR]
8960 . ds $HDRFTR_LEFT_COLOR \\*[$HDRFTR_RIGHT_COLOR]
8961 . ds $HDRFTR_RIGHT_COLOR \\*[$HDRFTR_TMP_COLOR_SWITCH]
8962 . rr #HDRFTR_TMP_CAPS_SWITCH
8963 . rm $HDRFTR_TMP_SWITCH
8964 . rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
8965 . rm $HDRFTR_TMP_COLOR_SWITCH
8966 . nr #SWITCH_HDRFTR 0
8968 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
8969 . if \\n[#ENDNOTES] .PAGENUM_STYLE \\*[$EN_PN_STYLE]
8970 . if \\n[#PRINT_STYLE]=1 \{\
8971 . if \\n[#FOOTERS_ON] \{\
8974 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
8979 . if \\n[#RECTO_VERSO]=0 .LEFT
8980 . if \\n[#HDRFTR_LEFT_CAPS] .CAPS
8981 . ie '\\*[$HDRFTR_LEFT]'#' .PRINT \\n[#PAGENUMBER]
8983 . ie !'\\*[$HDRFTR_LEFT]'' .PRINT \\*[$HDRFTR_LEFT]
8986 . if \\n[#HDRFTR_LEFT_CAPS] .CAPS OFF
8988 . if \\n[#HDRFTR_CENTER_CAPS] .CAPS
8990 . ie '\\*[$HDRFTR_CENTER]'#' .PRINT \
8991 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
8993 . ie !'\\*[$HDRFTR_CENTER]'' .PRINT \
8994 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
8997 . if \\n[#HDRFTR_CENTER_CAPS] .CAPS OFF
9000 . if \\n[#RECTO_VERSO]=0 .RIGHT
9001 . if \\n[#HDRFTR_RIGHT_CAPS] .CAPS
9003 . ie '\\*[$HDRFTR_RIGHT]'#' .PRINT \\n[#PAGENUMBER]
9005 . ie !'\\*[$HDRFTR_RIGHT]'' .PRINT \\*[$HDRFTR_RIGHT]
9008 . if \\n[#HDRFTR_RIGHT_CAPS] .CAPS OFF
9010 . if \\n[#PRINT_STYLE]=2 \{\
9011 . if \\n[#HDRFTR_COLOR]=1 \{\
9013 \m[\\*[$HDRFTR_COLOR]]
9015 . fam \\*[$HDRFTR_LEFT_FAM]
9016 . ft \\*[$HDRFTR_LEFT_FT]
9017 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
9018 . if \\n[#FOOTERS_ON] \{\
9021 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
9026 . if \\n[#RECTO_VERSO]=0 .LEFT
9027 . if \\n[#HDRFTR_LEFT_CAPS] .CAPS
9028 . ie '\\*[$HDRFTR_LEFT]'#' \{\
9029 . ie \\n[#HDRFTR_LEFT_COLOR]=1 \
9030 . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[]
9032 . PRINT \\n[#PAGENUMBER]
9035 . ie !'\\*[$HDRFTR_LEFT]'' \{\
9036 . ie \\n[#HDRFTR_LEFT_COLOR]=1 \
9037 . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[]
9039 . PRINT \\*[$HDRFTR_LEFT]
9043 . if \\n[#HDRFTR_LEFT_CAPS] .CAPS OFF
9044 . fam \\*[$HDRFTR_CENTER_FAM]
9045 . ft \\*[$HDRFTR_CENTER_FT]
9046 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
9047 . if \\n[#FOOTERS_ON] \{\
9050 . nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
9054 . if \\n[#HDRFTR_CENTER_CAPS] .CAPS
9056 . ie '\\*[$HDRFTR_CENTER]'#' \{\
9057 . ie \\n[#HDRFTR_CENTER_COLOR]=1 .PRINT \
9058 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\
9059 \\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
9061 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
9064 . ie !'\\*[$HDRFTR_CENTER]'' \{\
9065 . ie \\n[#HDRFTR_CENTER_COLOR]=1 .PRINT \
9066 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\
9067 \\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
9069 \h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
9073 . if \\n[#HDRFTR_CENTER_CAPS] .CAPS OFF
9074 . fam \\*[$HDRFTR_RIGHT_FAM]
9075 . ft \\*[$HDRFTR_RIGHT_FT]
9076 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
9077 . if \\n[#FOOTERS_ON] \{\
9080 . nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
9085 . if \\n[#RECTO_VERSO]=0 .RIGHT
9086 . if \\n[#HDRFTR_RIGHT_CAPS] .CAPS
9088 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
9089 . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \
9090 . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[]
9092 . PRINT \\n[#PAGENUMBER]
9095 . ie !'\\*[$HDRFTR_RIGHT]'' \{\
9096 . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \
9097 . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[]
9099 . PRINT \\*[$HDRFTR_RIGHT]
9103 . if \\n[#HDRFTR_RIGHT_CAPS] .CAPS OFF
9105 . if \\n[#HDRFTR_RULE] .HDRFTR_RULE_INTERNAL
9109 \# PRINT USER DEFINED HEADER/FOOTER
9110 \# --------------------------------
9114 \# Based on defaults or values entered by user, prints a single part
9115 \# (i.e. not 3-part) title at either the top or the bottom of the page.
9117 \# Called from within PRINT_HDRFTR.
9119 .MAC PRINT_USERDEF_HDRFTR END
9120 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
9122 . if \\n[#PRINT_STYLE]=2 \{\
9123 . fam \\*[$HDRFTR_FAM]
9125 . ps \\n[#HDRFTR_PT_SIZE]u
9126 . if \\n[#HDRFTR_COLOR]=1 \{\
9128 . COLOR \\*[$HDRFTR_COLOR]
9131 . ie \\n[#RECTO_VERSO] \{\
9133 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT
9134 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER
9135 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT
9136 . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS
9137 . if '\\n[.ev]'FOOTER' .vs 0
9138 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
9139 . if '\\n[.ev]'FOOTER' .vs
9140 . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF
9142 . if \\n[#FOOTERS_ON] \{\
9145 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9150 . ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
9151 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 .LEFT
9152 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 .CENTER
9153 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 .RIGHT
9154 . if \\n[#HDRFTR_VERSO_CAPS]=1 .CAPS
9155 . if '\\n[.ev]'FOOTER' .vs 0
9156 . PRINT \\*[$USERDEF_HDRFTR_VERSO]
9157 . if '\\n[.ev]'FOOTER' .vs
9158 . if \\n[#HDRFTR_VERSO_CAPS]=1 .CAPS OFF
9160 . if \\n[#FOOTERS_ON] \{\
9163 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9168 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT
9169 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER
9170 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT
9171 . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS
9172 . if '\\n[.ev]'FOOTER' .vs 0
9173 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
9174 . if '\\n[.ev]'FOOTER' .vs
9175 . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF
9177 . if \\n[#FOOTERS_ON] \{\
9180 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9187 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 .LEFT
9188 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 .CENTER
9189 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 .RIGHT
9190 . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS
9191 . if '\\n[.ev]'FOOTER' .vs 0
9192 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
9193 . if '\\n[.ev]'FOOTER' .vs
9194 . if \\n[#HDRFTR_RECTO_CAPS]=1 .CAPS OFF
9196 . if \\n[#FOOTERS_ON] \{\
9199 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
9204 . if \\n[#PRINT_STYLE]=2 \{\
9205 . ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]]
9208 . if \\n[#HDRFTR_RULE] \{\
9209 . HDRFTR_RULE_INTERNAL
9215 \# HEADERS (off or on)
9216 \# -------------------
9218 \# <none> | <anything>
9220 \# Turns headers at the top of the page off or on.
9225 . ie '\\$1'' .nr #HEADERS_ON 1
9226 . el .nr #HEADERS_ON 0
9232 \# <amount of space between top of page and header>
9234 \# Creates or modifies register #HEADER_MARGIN to hold amount
9235 \# of space between top of page and header.
9237 \# Requires unit of measure. Default is 4P+6p, measured top-of-page
9240 .MAC HEADER_MARGIN END
9241 . nr #HEADER_MARGIN (\\$1)
9247 \# <amount of space between header and running text>
9249 \# Creates or modifies register #HEADER_GAP to hold amount
9250 \# of space between header and running text.
9252 \# Default is 1P+6p.
9255 . nr #HEADER_GAP (\\$1)
9263 \# Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
9265 \# In order to convert the title string to caps in the header
9266 \# (in the event that the user enters .TITLE in caps/lc), I've
9267 \# used quad left, quad centre, and quad right to arrange the
9268 \# three bits of the header, rather than .tl. This allows the
9269 \# use of the CAPS macro. The downside is that I have to add
9270 \# \\v'-(\\n[#LEAD]u*<n>) in order for -Tlatin1 output to align
9271 \# the header/footer strings on the baseline. The console output
9272 \# still isn't brilliant, but at least it's comprehensible.
9276 . if \\n[#NEW_DOC_PT_SIZE] .nr #DOC_PT_SIZE \\n[#NEW_DOC_PT_SIZE]
9277 . rr #NEW_DOC_PT_SIZE
9278 . if \\n[#RESET_TRAPS] \{\
9280 . if \\n[#REMOVE_ADJ] .nr #DOC_LEAD -\\n[#DOC_LEAD_ADJ]
9287 . nr #LAST_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]
9288 . if \\n[#FN_DEPTH] .PROCESS_FN_LEFTOVER
9290 . if \\n[#RESET_FN_NUMBER] .nr #FN_NUMBER 0 1
9291 . po \\n[#DOC_L_MARGIN]u
9292 . if \\n[#RECTO_VERSO] \{\
9293 . nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
9294 . DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u
9295 . if \\n[#CROPS] .DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u+\\n[cropmarks]u
9296 . DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
9297 . if \\n[#CROPS] .DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u-\\n[cropmarks]u
9298 . SWITCH_HDRFTR_CENTER_PAD
9302 . if \\n[#PAGE_NUM_V_POS]=1 .vs 0
9303 . sp |\\n[#HEADER_MARGIN]u-1v
9305 . ll \\n[#DOC_L_LENGTH]u
9307 . if \\n[#PRINT_STYLE]=1 \{\
9308 . fam \\*[$TYPEWRITER_FAM]
9310 . ps \\*[$TYPEWRITER_PS]\\*[$HDRFTR_SIZE_CHANGE]
9312 . if \\n[#PRINT_STYLE]=2 \{\
9313 . fam \\*[$HDRFTR_FAM]
9315 . ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
9317 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
9318 . if \\n[#CAPS_ON] \{\
9322 . if \\n[#PRINT_STYLE]=1 \{\
9323 . if \\n[#ENDNOTES]=1 \{\
9324 .\" Single-spaced endotes have a different lead
9325 . if \\n[#EN_SINGLESPACE] \{\
9326 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
9327 . nr #DOC_LEAD \\n[#EN_LEAD]u
9331 . if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
9333 . ie \\n[#HEADERS_ON] .PRINT_HDRFTR
9335 . if \\n[#PAGE_NUM_V_POS]=1 \{\
9336 . if \\n[#PAGINATE] .PRINT_PAGE_NUMBER
9339 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
9340 . if \\n[#PRINT_STYLE]=1 \{\
9341 . if \\n[#ENDNOTES]=1 \{\
9342 . if \\n[#EN_SINGLESPACE] \{\
9343 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
9344 . rr #RESTORE_DOC_LEAD
9348 . nr #PAGE_TOP \\n[nl]
9350 . po \\n[#L_MARGIN]u
9351 . if \\n[#RECTO_VERSO] .nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
9352 . if \\n[#CAPS_WAS_ON] \{\
9356 . if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9357 . if \\n[#QUOTE] \{\
9358 . ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9360 . ie \\n[#Q_OFFSET_VALUE] .nr #Q_OFFSET \
9361 \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9362 . el .nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9363 . po \\n[#Q_OFFSET]u
9365 . if \\n[#PRINT_STYLE]=2 .sp \\n[#Q_LEAD_DIFF]u
9367 . if \\n[#EPIGRAPH] \{\
9368 . ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9370 . ie r#EPI_OFFSET_VALUE \
9372 \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9374 . nr #EPI_OFFSET \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9375 . po \\n[#EPI_OFFSET]u
9378 . ie \\n[#EPIGRAPH] \{\
9379 . ie !\\n[#EPI_ACTIVE] \{\
9384 . ie \\n[#EPI_FITS] .ns
9385 . el .sp \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u
9389 . if \\n[#COLUMNS] \{\
9390 . nr #FN_COUNT_FOR_COLS 0 1
9391 . nr #L_MARGIN \\n[#DOC_L_MARGIN]
9392 . if \\n[#RECTO_VERSO] .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u
9395 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
9396 . nr #L_MARGIN \\n[.o]
9397 . if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9398 . ll \\n[#COL_L_LENGTH]u
9400 . if \\n[#QUOTE] \{\
9401 . ie \\n[#Q_OFFSET_VALUE] \
9402 . po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
9404 . po +\\*[$Q_OFFSET_VALUE]
9406 . if \\n[#EPIGRAPH] \{\
9407 . if \\n[#EPI_ACTIVE] \{\
9408 . ie \\n[#EPI_FITS] .
9409 . el .nr dc -\\n[#EPI_LEAD_DIFF]
9411 . ie r#EPI_OFFSET_VALUE \{\
9413 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
9415 . el .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+\\*[$EPI_OFFSET_VALUE]
9418 . if \\n[#RESET_FN_COUNTERS]=1 \{\
9419 . rr #RESET_FN_COUNTERS
9420 . PROCESS_FN_IN_DIVER
9421 . nr #FN_COUNT \\n[#SAVED_FN_COUNT] 1
9422 . if \\n[#COLUMNS]=1 .nr #FN_COUNT_FOR_COLS \\n[#SAVED_FN_COUNT_FOR_COLS] 1
9423 . ie \\n[#RESET_FN_NUMBER]=1 .nr #FN_NUMBER \\n[#SAVED_FN_NUMBER] 1
9424 . el .nr #FN_NUMBER \\n[#FN_NUMBER] 1
9426 . if dRUNON_FN_IN_DIVER .rm RUNON_FN_IN_DIVER
9429 . rr #DEFER_SPACE_ADDED
9430 . if !\\n[#FN_DEPTH] .if r #DIVERTED .rr #DIVERTED
9431 . if \\n[#MN_OVERFLOW_LEFT]=1 \{\
9437 . if \\n[#MN_OVERFLOW_RIGHT]=1 \{\
9443 . rm MN_OVERFLOW_LEFT
9444 . rr #MN_OVERFLOW_LEFT
9445 . rr #no-repeat-MN-left
9446 . rm MN_OVERFLOW_RIGHT
9447 . rr #MN_OVERFLOW_RIGHT
9448 . rr #no-repeat-MN-right
9449 . if \\n[#PRE_COLLATE]=1 .rr #PRE_COLLATE
9450 . if \\n[#UNDERLINE_WAS_ON]=1 \{\
9453 . nop \R'#UNDERLINE_ON 1'\X'ps: exec \\n[_w] \\n[_d] decorline'
9457 . rr #UNDERLINE_WAS_ON
9459 . if \\n[#RESTORE_PAGINATION] \{\
9461 . rr #RESTORE_PAGINATION
9464 . ie \\n[tbl*have-header] .rr @TOP
9465 . el .wh \\n[nl]u+1u RR_@TOP
9466 . ie \\n[defer] .PROCESS_FLOATS
9468 . if \\n[tbl*have-caption] \{\
9470 . ie \\n[#MLA] .sp \n[tbl*label-lead-diff]u
9471 . el .sp \n[tbl*caption-lead-diff]u
9474 .\" So tables without TH that don't fit don't overprint first row
9476 . ie \\n[tbl*no-header] \{\
9480 . rr \\n[tbl*no-header]
9484 . if \\n[#NEWPAGE] .rr #NEWPAGE
9485 . ie \\n[tbl*interrupted] \{\
9487 . rr tbl*interrupted
9492 \# ====================================================================
9496 \# FOOTERS (off or on)
9497 \# -------------------
9499 \# <none> | <anything>
9501 \# Turns footers at the bottom of the page off or on.
9503 \# Default is off. If on, page numbers automatically go at
9504 \# the top, centered, unless pagination has been turned off,
9505 \# or the pagenumber position has been changed to left or right.
9511 . PAGENUM_POS TOP CENTER
9513 . el .nr #FOOTERS_ON 0
9521 \# Creates or modifies register #FOOTER_MARGIN which holds the
9522 \# amount of space to leave between the page number and the bottom
9525 \# Unit of measure required. Default is 3P.
9527 .MAC FOOTER_MARGIN END
9528 . ie \\n%>0 .nr #FOOTER_MARGIN (\\$1)
9535 \# <distance from end of running text to page # or footer>
9537 \# Creates or modifies register #FOOTER_GAP which holds the
9538 \# amount of space to leave between running text and the page number.
9540 \# Requires unit of measure. Default is 3P. Measured baseline to
9544 . ie \\n%>0 .nr #FOOTER_GAP (\\$1)
9553 \# Places footer at bottom of page if #FOOTERS=1, otherwise
9554 \# places page number at bottom of page (if #PAGINATE=1).
9555 \# Page numbers are in arabic or roman according to COPYSTYLE.
9556 \# DRAFT starts the document at page 1 regardless of PAGENUMBER.
9557 \# FINAL respects PAGENUMBER.
9563 . nr #SAVED_LEAD \\n[.v]
9564 . ev PAGE_TRANSITION
9566 . ie !n .nop \X'ps: exec decornone'
9569 . if \\n[#UNDERLINE_ON]=1 .nr #UNDERLINE_WAS_ON 1
9570 . if \\n[MN-left]>0 \{\
9571 . if !\\n[#no-repeat-MN-left]=1 \{\
9573 . nr #no-repeat-MN-left 1
9575 . if '\\n[.z]'MN_OVERFLOW_LEFT' \{\
9577 . nr #MN_OVERFLOW_LEFT 1
9581 . if \\n[MN-right]>0 \{\
9582 . if (\\n[MN-right] > 0) \
9583 . if !\\n[#no-repeat-MN-right]=1 .MNbottom-right
9584 . if '\\n[.z]'MN_OVERFLOW_RIGHT' \{\
9586 . nr #MN_OVERFLOW_RIGHT 1
9587 . rr #OVERFLOW_RIGHT
9590 \# Table bottom hook, draws the table borders in
9591 \# multipage boxed tables.
9593 . ch MN_OVERFLOW_TRAP
9594 . nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
9595 . if !\\n[#FN_DEFER] \{\
9597 . if \\n[#FN_DEPTH] \{\
9598 . if \\n[#DIVERTED]=3 .nr #FN_DEPTH +\\n[#VFP_DIFF]
9601 |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u-\\n[#DOC_LEAD]u)
9603 . po \\n[#DOC_L_MARGIN]u
9604 . if \\n[#COLUMNS] \{\
9605 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9606 . nr #L_MARGIN \\n[.o]
9612 . if d RUNON_FOOTNOTES .rm RUNON_FOOTNOTES
9613 . if \\n[#PRINT_STYLE]=1 .vs \\n[#SAVED_LEAD]u
9614 . if \\n[#PRINT_STYLE]=2 .LS \\n[#SAVED_LEAD]u
9615 . if '\\n[.z]'FN_OVERFLOW' \{\
9617 . nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
9619 . nr #FN_COUNT_AT_FOOTER \\n[#FN_COUNT]
9621 . if \\n[#COL_NEXT] \{\
9622 . ie !\\n[#COL_NUM]=\\n[#NUM_COLS] .nr #COL_NUM \\n-[#COL_NUM]
9623 . el .nr #COL_NUM \\n[#NUM_COLS] 1
9629 . ie \\n[#COLUMNS]=1 \{\
9630 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] .DO_FOOTER
9632 . ie (\\n[#ENDNOTES]=1):(\\n[#BIBLIOGRAPHY]=1) \{\
9633 . if \\n[#ENDNOTES] .sp |\\n[ec]u-\\n[#EN_LEAD]u
9634 . if \\n[#BIBLIOGRAPHY] .sp |\\n[bc]u-\\n[#BIB_LEAD]u
9637 . vs \\n[#SAVED_LEAD]u
9640 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
9641 . nr #L_MARGIN \\n[.o]
9642 . if \\n[#FN_DEPTH] .PROCESS_FN_LEFTOVER
9643 . vs \\n[#SAVED_LEAD]u
9644 . if \\n[#PREV_FN_DEFERRED] .nr #PREV_FN_DEFERRED 2
9646 . if !\\n[#EPIGRAPH] .rr #COL_NEXT
9647 . if !\\n[#QUOTE] .rr #COL_NEXT
9648 . if \\n[#RESET_FN_COUNTERS]=1 \{\
9649 . rr #RESET_FN_COUNTERS
9650 . PROCESS_FN_IN_DIVER
9651 . LS \\n[#SAVED_LEAD]u
9652 . nr #FN_COUNT \\n[#FN_COUNT] 1
9653 . nr #FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] 1
9655 . if dRUNON_FN_IN_DIVER .rm RUNON_FN_IN_DIVER
9657 . rr #DEFER_SPACE_ADDED
9658 . if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9659 . if \\n[#QUOTE] \{\
9660 . ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9662 . ie \\n[#Q_OFFSET_VALUE] \
9664 \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9666 . nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9667 . if \\n[#COLUMNS] \{\
9668 . ie \\n[#Q_OFFSET_VALUE] .nr #Q_OFFSET \
9669 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9670 . el .nr #Q_OFFSET \
9671 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE]
9673 . po \\n[#Q_OFFSET]u
9676 . if \\n[#EPIGRAPH] \{\
9677 . ie \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
9679 . ie r#EPI_OFFSET_VALUE .nr #EPI_OFFSET \
9680 \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9681 . el .nr #EPI_OFFSET \
9682 \\n[#L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9683 . if \\n[#COLUMNS] \{\
9684 . ie r#EPI_OFFSET_VALUE .nr #EPI_OFFSET \
9685 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
9686 . el .nr #EPI_OFFSET \
9687 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$EPI_OFFSET_VALUE]
9689 . po \\n[#EPI_OFFSET]u
9692 . ie \\n[#EPIGRAPH] \{\
9693 . ie !\\n[#EPI_ACTIVE] \{\
9698 . sp |\\n[dc]u+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
9708 . wh \\n[nl]u+1u RR_@TOP
9709 . if \\n[tbl*have-header] .tbl@bottom-hook
9710 . if \\n[defer] .PROCESS_FLOATS
9711 . ie \\n[tbl*no-header] \{\
9715 . rr \\n[tbl*no-header]
9719 . if \\n[tbl*interrupted] .tbl*print-header
9720 . rr tbl*interrupted
9731 \# Prints footer (page number, or 3-part footer).
9732 \# Resets CAPS and UNDERLINE if they were on.
9735 .\" Part of workaround for refer spitting out a blank page if the
9736 .\" last reference falls on the bottom line.
9737 . if \\n[num*refs] \{\
9738 . if \\n[ref*num]=\\n[num*refs] \{\
9744 . if !\\n[ref*last] \{\
9745 . ie \\n[defer]>0 \{\
9751 . if !'\\n[.ev]'0' .ev
9753 . po \" Ensure reset to last value
9756 .MAC PRINT_FOOTER END
9758 .\" Have to change position of FN_OVERFLOW_TRAP or it screws up the
9759 .\" placement of page numbers (or footers). It's reset to its original
9760 .\" position at the end of the macro.
9761 . if r #SAVED_FOOTER_POS .ch FOOTER \\n[#SAVED_FOOTER_POS]u
9762 . rr #SAVED_FOOTER_POS
9763 . ie (\\n[#FOOTER_MARGIN]+\\n[.v]>\\n[#B_MARGIN]) .nr #SKIP_FOOTER 1
9768 . sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u
9770 . sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-\\n[#FOOTER_ADJ]u
9774 . po \\n[#DOC_L_MARGIN]u
9775 . ll \\n[#DOC_L_LENGTH]u
9777 . if \\n[#PRINT_STYLE]=1 .TYPEWRITER
9778 . if \\n[#PRINT_STYLE]=2 \{\
9779 . fam \\*[$HDRFTR_FAM]
9781 . ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
9783 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
9784 . if \\n[#CAPS_ON] \{\
9788 . ie \\n[#FOOTERS_ON] \{\
9789 . if !\\n[#SKIP_FOOTER]=1 .PRINT_HDRFTR
9792 . if \\n[#PAGINATE] \{\
9793 . if \\n[#PAGE_NUM_V_POS]=2 \
9794 . if !\\n[#SKIP_FOOTER]=1 .PRINT_PAGE_NUMBER
9798 . if \\n[#CAPS_WAS_ON] \{\
9806 \# ====================================================================
9808 \# +++HEADERS AND FOOTERS+++
9810 \# HEADERS_AND_FOOTERS
9811 \# -------------------
9813 \# HEADER_RECTO_QUAD \
9814 \# HEADER_RECTO_STRING \
9815 \# FOOTER_RECTO_QUAD \
9816 \# FOOTER_RECTO_STRING \
9817 \# HEADER_VERSO_QUAD \
9818 \# HEADER_VERSO_STRING \
9819 \# FOOTER_VERSO_QUAD \
9820 \# FOOTER_VERSO_STRING
9823 \# Allows having both headers and footers. Sets register
9824 \# #HDRFTR_BOTH to 1; collects HEADER/FOOTER_RECTO/VERSO
9825 \# information; appends FOOTER_RECTO and FOOTER_VERSO to
9826 \# START and turns off pagination; appends to macros
9827 \# PRINT_USERDEF_HDRFTR and HEADER the necessary number
9828 \# register manipulations and redefinitions of the
9829 \# HEADER/FOOTER_RECTO/VERSO strings so that both
9830 \# headers and footers get printed, with the appropriate
9833 \# Works in conjunction with HDRFTR_RECTO and HDRFTR_VERSO (qqv.),
9834 \# ergo all style changes must be done inline in the strings
9835 \# passed as arguments.
9837 .MAC HEADERS_AND_FOOTERS END
9838 . ie \\n[#NUM_ARGS]>1 \{\
9841 . if !r#HEADER_RULE .nr #HEADER_RULE 1
9842 . if !r#FOOTER_RULE .nr #FOOTER_RULE 1
9843 . ds $HDR_RECTO_QUAD \\$1
9844 . ds $HDR_RECTO_STRING \\$2
9845 . ds $FTR_RECTO_QUAD \\$3
9846 . ds $FTR_RECTO_STRING \\$4
9847 . ds $HDR_VERSO_QUAD \\$5
9848 . ds $HDR_VERSO_STRING \\$6
9849 . ds $FTR_VERSO_QUAD \\$7
9850 . ds $FTR_VERSO_STRING \\$8
9852 . if \\\\n[#HDRFTR_BOTH]=1 \{\
9853 . FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
9854 . FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
9855 . if \\\\n[#HEADER_RULE]=1 .HEADER_RULE
9856 . ie \\\\n[#FOOTER_RULE]=1 .FOOTER_RULE
9857 . el .FOOTER_RULE OFF
9858 . if r #PAGINATE .rr #PAGINATE
9859 . if r #PAGE_NUM_V_POS .rr #PAGE_NUM_V_POS
9862 .am PRINT_USERDEF_HDRFTR DONE
9863 . if \\\\n[#HDRFTR_BOTH]=1 \{\
9864 . if \\n[#FOOTERS_ON]=1 \{\
9865 . if !\\\\n[#COLLATE]=1 \{\
9866 . HEADER_RECTO \\*[$HDR_RECTO_QUAD] "\\*[$HDR_RECTO_STRING]"
9867 . HEADER_VERSO \\*[$HDR_VERSO_QUAD] "\\*[$HDR_VERSO_STRING]"
9870 . ie \\\\n[#HEADER_RULE]=1 .HEADER_RULE
9871 . el .HEADER_RULE OFF
9874 . if \\n[#HEADERS_ON]=1 \{\
9875 . FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
9876 . FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
9881 . if \\\\n[#HDRFTR_BOTH]=1 \{\
9882 . if r #START_FOR_FOOTERS .rr #START_FOR_FOOTERS
9885 . FOOTER_RECTO \\*[$FTR_RECTO_QUAD] "\\*[$FTR_RECTO_STRING]"
9886 . FOOTER_VERSO \\*[$FTR_VERSO_QUAD] "\\*[$FTR_VERSO_STRING]"
9887 . ie \\\\n[#FOOTER_RULE]=1 .FOOTER_RULE
9888 . el .FOOTER_RULE OFF
9894 . rr #USERDEF_HDRFTR
9895 . rm $USERDEF_HDRFTR_RECTO
9896 . rm $USERDEF_HDRFTR_VERSO
9899 . if \\n[#COLLATE]=1 \{\
9900 . nr #HEADER_STATE 1
9901 . nr #PAGINATION_STATE 1
9904 . PAGENUM_POS BOTTOM CENTER
9909 \# ====================================================================
9913 .char \[hd-num-spacer] \0
9914 .char \[parahead-spacer] \~\~
9915 .char \[toc-hd-num-spacer] \h'\w'\[en]'u'
9916 .ds toc-word-space \ \" ie an unbreakable space
9921 \# <heading level> [PARAHEAD] [NAMED <pdf-id>] <heading text>
9923 \# Assigns a heading level to the heading text and prints heading
9924 \# in the style set up for that level. If PARAHEAD given, the
9925 \# heading is attached to the body of the paragraph. If NAMED
9926 \# given, creates a target for pdf links. Collects the heading
9927 \# for the TOC and sets TOC indenting appropriate for the level.
9929 \# If PARAHEAD given, HEADING must come after PP.
9933 . tm1 "[mom]: The first argument to \\$0 must be a numeric heading level.
9934 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
9936 . if r #QUOTE .rr #QUOTE
9937 . if r #END_QUOTE .rr #END_QUOTE
9938 . if r #EPIGRAPH .rr #EPIGRAPH
9939 . vs \\n[#DOC_LEAD]u
9940 . if \\$1<\\n[#LEVEL] \
9941 . nr #ACTIVE_LEVELS \\n[#LEVEL] \" loop count for resetting numbering registers
9942 . nr #LAST_LEVEL \\n[#LEVEL] \" used during TOC collection, if SPACE_TOC_ITEMS
9943 . nr #LEVEL \\$1 \" reset #LEVEL to arg
9946 . while \\n+[#ARG_NUM]<=2 \{\
9947 . if '\\$1'NAMED' \{\
9948 . ds PDF_NM "\\$1 \\$2
9949 . shift 2 \" \\$1 is now heading text
9951 . if '\\$1'PARAHEAD' \{\
9953 . shift \" \\$1 is now NAMED, if we have it; otherwise heading text
9957 . if \\n[#Q_LEAD_DIFF_CHECK] .sp -1v
9958 . ie \\n[#PARAHEAD] 'br
9960 . ie !\\n[#PARAHEAD] \{\
9963 . ie \\n[#HEAD_\\n[#LEVEL]_SPACE_AFTER] .ne \\n[#NUM_ARGS]+2
9964 . el .ne \\n[#NUM_ARGS]+1
9967 . if !\\n[#SPACE_ADDED] .if !\\n[#LINEBREAK] .sp
9969 . ie !\\n[#PP] .rr #START
9972 . if \\n[#EPIGRAPH] \
9973 . if \\n[#SINGLE_SPACE] .sp
9975 . if \\n[#PP_SPACE] \
9976 . if \\n[#QUOTE_4_HD] .sp .5v
9977 . if !\\n[#SPACE_ADDED] .SHIM
9978 . if \\n[#SPACE_ADDED] .rr #SPACE_ADDED
9981 . if \\n[#NUM_ARGS]>1 \{\
9982 . tm1 "[mom]: Error at line \\n[.c], \\$0.
9983 . tm1 " PARAHEAD may not be given more than 1 line of text.
9984 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
9987 . if !(\\n[#PRINT_STYLE]=1)&(\\n[#SINGLE_SPACE]=1) .sp -1v
9988 . if \\n[#QUOTE_4_HD] \{\
9990 . if \\n[#PP_SPACE] \{\
9995 . if (\\n[#QUOTE_4_HD]=0)&(\\n[#LB_4_HD]=0)&(\\n[#START]=0) \
9996 . if !\\n[#LB_4_PARAHEAD] .sp -1v
10001 . if \\n[#PRINT_STYLE]=2 \{\
10002 . fam \\*[$HEAD_\\n[#LEVEL]_FAM]
10003 . ft \\*[$HEAD_\\n[#LEVEL]_FT]
10004 . ps \\n[#DOC_PT_SIZE]u+\\*[$HEAD_\\n[#LEVEL]_SIZE]
10008 . ds $TOC_HD_NUM_PREV \\*[$TOC_HD_NUM]
10011 . ie \\n[#NUMBER_HEAD_\\n[#LEVEL]] \{\
10012 . if \\n[#PREFIX_CH_NUM] .ds $HD_NUM \\n[#CH_NUM].
10013 . nr #HEAD_\\n[#LEVEL]_NUM +1 \" incremented manually here; still auto-increments
10014 .\" Reset numbering registers for headings beneath current level
10015 . nr @LEVEL \\n[#LEVEL] 1 \" loop step
10016 . nr #LOOP \\n[#ACTIVE_LEVELS] \" loop count
10017 . while \\n+[@LEVEL]<=\\n[#LOOP] \
10018 . if \\n[#HEAD_\\n[@LEVEL]_NUM] \
10019 . nr #HEAD_\\n[@LEVEL]_NUM 0 1
10020 .\" Build numbering strings for body and toc
10021 . nr @LEVEL 0 1 \" loop step
10022 . nr #LOOP \\n[#LEVEL] \" loop count
10023 . while \\n+[@LEVEL]<=\\n[#LOOP] \
10024 . if \\n[#HEAD_\\n[@LEVEL]_NUM] \
10025 . as $HD_NUM \\n[#HEAD_\\n[@LEVEL]_NUM].
10026 . ie \\n[#TRUNC_TOC_HD_NUM] \
10027 . ds $TOC_HD_NUM \\n[#HEAD_\\n[#LEVEL]_NUM].
10028 . el .ds $TOC_HD_NUM \\*[$HD_NUM]
10029 . if \\n[#LEVEL]=1 \
10030 . ds $TOC_HD_NUM_PREV \\*[$TOC_HD_NUM]
10031 . if \\n[#TOC_NO_HD_NUM] .rm $TOC_HD_NUM
10032 . if !\\n[#HEAD_\\n[#LEVEL]_NUM]] .rm $TOC_HD_NUM
10033 . as $HD_NUM \[hd-num-spacer]
10034 . ds $PDF_HD_NUM \\*[$TOC_HD_NUM]
10035 . if !'\\*[$TOC_HD_NUM]'' .as $TOC_HD_NUM \[toc-hd-num-spacer]
10036 . if !'\\*[$PDF_HD_NUM]'' .as $PDF_HD_NUM " "
10038 . el .nr @LEVEL \\n[#LEVEL] 1
10039 .\" TOC collection and formatting
10040 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
10041 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
10043 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
10044 . as $TOC_HEAD_\\n[#LEVEL]_ITEM "\\$[\\n+[#ARG_NUM]]
10045 . if \\n[#NUM_ARGS]>\\n[#ARG_NUM] \
10046 . as $TOC_HEAD_\\n[#LEVEL]_ITEM "\\*[toc-word-space]
10049 \\*[PDF_NM] \\n[#LEVEL]+1 \
10050 \\*[$PDF_HD_NUM] \\*[$TOC_HEAD_\\n[#LEVEL]_ITEM]
10054 . ie \\n[#PRINT_STYLE]=1 \{\
10055 . fam \\*[$TYPEWRITER_FAM]
10057 . ps \\*[$TYPEWRITER_PS]
10060 . FAMILY \\*[$TOC_HEAD_\\n[#LEVEL]_FAM]
10061 . FT \\*[$TOC_HEAD_\\n[#LEVEL]_FT]
10062 . ps \\n[#TOC_PS]u\\*[$TOC_HEAD_\\n[#LEVEL]_SIZE]
10064 .\" Indents for TOC heading levels.
10065 .\" First, numbered heads. @LEVEL here is #LEVEL+1
10066 . ie \\n[#NUMBER_HEAD_\\n[#LEVEL]] \{\
10067 . ie !\\n[#TOC_NO_HD_NUM] \{\
10068 . ie \\n[#TRUNC_TOC_HD_NUM] \{\
10069 . if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \{\
10070 . ie !\\n[#FROM_STYLE_\\n[@LEVEL]] \{\
10071 . ie !\\n[#NUMBER_HEAD_\\n[@LEVEL]] \
10072 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10073 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\w'\\*[$TOC_HD_NUM]'+1.5m
10075 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10076 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\w'\\*[$TOC_HD_NUM]'
10079 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10080 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]
10084 . if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \{\
10085 . ie !\\n[#FROM_STYLE_\\n[@LEVEL]] \{\
10086 . ie \\n[#NUMBER_HEAD_\\n-[@LEVEL]] \{\
10087 . ie !\\n[#NUMBER_HEAD_\\n+[@LEVEL]] \
10088 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10089 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\w'\\*[$TOC_HD_NUM_PREV]'+1.5m
10091 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10092 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\w'.\[toc-hd-num-spacer]'
10095 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10096 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\w'\\n[#TOC_HD_NUM].'
10097 . ie \\n[#LEVEL]=1 \
10098 . nr #TOC_HEAD_\\n+[@LEVEL]_INDENT +\w'\0'
10100 . if !\\n[#NUMBER_HEAD_\\n[@LEVEL]] \{\
10101 . nr @LEVEL \\n+[@LEVEL] 1
10102 . nr #TOC_HEAD_\\n+[@LEVEL]_INDENT +\w'\0'
10107 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10108 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\\n[#TOC_HEAD_\\n+[@LEVEL]_INDENT]
10110 . if \\n[#LEVEL]=1 \{\
10111 . if \\n[#NUMBER_HEAD_\\n[@LEVEL]] \{\
10112 . if \\n[#PREFIX_CH_NUM] \
10113 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \w'\\*[$TOC_HD_NUM]'
10119 . ie !\\n[#FROM_STYLE_\\n[@LEVEL]] \{\
10120 . if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \
10121 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10122 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+1.5m
10125 . if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \
10126 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10127 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+\\n[#TOC_HEAD_\\n+[@LEVEL]_INDENT]
10131 .\" Non-numbered heads
10133 . nr @LEVEL \\n[#LEVEL] 1
10134 . ie \\n[#FROM_STYLE_\\n+[@LEVEL]] \{\ \" increments @LEVEL even if false
10135 . if !\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT_SET] \{\
10136 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10137 \\n[#TOC_HEAD_\\n[#LEVEL]_INDENT]+\\n[#TOC_HEAD_\\n[@LEVEL]_INDENT]
10138 . if !\\n[#LEVEL]=\\n[#LAST_LEVEL] \{\
10139 . if \\n[#NUMBER_HEAD_\\n[@LEVEL]] \
10140 . nr #TOC_HEAD_\\n[#LEVEL]_INDENT \
10141 \\n[#TOC_HEAD_\\n[@LEVEL]_INDENT]+\w'\\*[$TOC_HD_NUM_PREV]'
10146 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT \
10147 \\n[#TOC_HEAD_\\n-[@LEVEL]_INDENT]+1.5m
10148 . if \\n[#LEVEL]=1 \{\
10149 . if !\\n[#FROM_STYLE_1] \
10150 . nr #TOC_HEAD_1_INDENT 0
10154 . nr #TOC_HEAD_\\n[@LEVEL]_INDENT_SET 1
10156 . rm $TOC_HEAD_\\n[#LEVEL]_ITEM
10158 . if !\\n[#PARAHEAD] .\\*[$HEAD_\\n[#LEVEL]_QUAD]
10159 . if \\n[#CAPS_ON] \{\
10161 . nr #CAPS_RESTORE 1
10163 . if \\n[#HEAD_\\n[#LEVEL]_CAPS] \{\
10167 . if !'\\*[$HEAD_\\n[#LEVEL]_COLOR]'' \
10168 . COLOR \\*[$HEAD_\\n[#LEVEL]_COLOR]
10169 . nop \X'ps: exec decornone'\c
10171 . while \\n+[#ARG_NUM]<=\\n[#NUM_ARGS] \{\
10172 . if \\n[#PARAHEAD] \
10173 . nr #PP_TEXT_OFFSET \
10174 \w'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]'+\w'\[parahead-spacer]'
10175 . if (\\n[#HEAD_\\n[#LEVEL]_UNDERSCORE]=0)&(\\n[#HEAD_\\n[#LEVEL]_UNDERSCORE2]=0) \{\
10176 . ie \\n[#HD_NUM_INDENT] \{\
10177 . if !'\\*[$HEAD_\\n[#LEVEL]_QUAD]'CENTER' \
10178 . ti \\n[#HD_NUM_INDENT]u
10180 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\$[\\n[#ARG_NUM]]
10184 . ie !\\n[#PARAHEAD] \{\
10186 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10190 . if (\\n[#PP]>0):(\\n[#INDENT_FIRST_PARAS]) \{\
10191 . if !\\n[#LB_4_PARAHEAD] \{\
10192 . if !\\n[#START] \{\
10193 . if \\n[#PP_ACTIVE] \{\
10194 . ie \\n[#PP]=1 .br
10196 . nr #PP_TEXT_OFFSET +\\n[#PP_INDENT]
10197 . ti \\n[#PP_INDENT]u
10203 . ie \\n[#PRINT_STYLE]=1 \
10204 . PRINT "\\*[UL]\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]\\*[ULX]
10205 . el .PRINT "\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10206 . rr #LB_4_PARAHEAD
10211 . if \\n[#HEAD_\\n[#LEVEL]_UNDERSCORE] \{\
10212 . nr #SAVED_UL_WEIGHT \\n[#UNDERSCORE_WEIGHT]
10213 . UNDERSCORE_WEIGHT \\*[$HEAD_\\n[#LEVEL]_UL_WEIGHT]
10214 . ie \\n[#HD_NUM_INDENT] \{\
10215 . if !'\\*[$HEAD_\\n[#LEVEL]_QUAD]'CENTER' \
10216 . ti \\n[#HD_NUM_INDENT]u
10217 . UNDERSCORE \\*[$HEAD_\\n[#LEVEL]_UL_GAP] \
10218 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\$[\\n[#ARG_NUM]]
10222 . ie !\\n[#PARAHEAD] \{\
10223 . UNDERSCORE \\*[$HEAD_\\n[#LEVEL]_UL_GAP] \
10224 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10228 . if (\\n[#PP]>0):(\\n[#INDENT_FIRST_PARAS]) \{\
10229 . if !\\n[#LB_4_HD] \{\
10230 . if !\\n[#START] \{\
10231 . if \\n[#PP_ACTIVE] \{\
10232 . nr #PP_TEXT_OFFSET +\\n[#PP_INDENT]
10233 . if (\\n[#PRINT_STYLE]=1)&(\\n[#SINGLE_SPACE]=1) .sp -1v
10234 . ti \\n[#PP_INDENT]u
10239 . UNDERSCORE \\*[$HEAD_\\n[#LEVEL]_UL_GAP] \
10240 "\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10244 . nr #UNDERSCORE_WEIGHT \\n[#SAVED_UL_WEIGHT]
10246 . if \\n[#HEAD_\\n[#LEVEL]_UNDERSCORE2] \{\
10247 . nr #SAVED_UL2_WEIGHT \\n[#UNDERSCORE_WEIGHT]
10248 . UNDERSCORE_WEIGHT \\*[$HEAD_\\n[#LEVEL]_UL2_WEIGHT]
10249 . ie \\n[#HD_NUM_INDENT] \{\
10250 . if !'\\*[$HEAD_\\n[#LEVEL]_QUAD]'CENTER' \
10251 . ti \\n[#HD_NUM_INDENT]u
10252 . UNDERSCORE2 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_1] \
10253 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_2] \
10254 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\$[\\n[#ARG_NUM]]
10258 . ie !\\n[#PARAHEAD] \{\
10259 . UNDERSCORE2 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_1] \
10260 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_2] \
10261 "\v'-\\*[$HEAD_\\n[#LEVEL]_BASELINE_ADJ]'\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10265 . if (\\n[#PP]>0):(\\n[#INDENT_FIRST_PARAS]) \{\
10266 . if !\\n[#LB_4_HD] \{\
10267 . if !\\n[#START] \{\
10268 . if \\n[#PP_ACTIVE] \{\
10269 . nr #PP_TEXT_OFFSET +\\n[#PP_INDENT]
10270 . if (\\n[#PRINT_STYLE]=1)&(\\n[#SINGLE_SPACE]=1) \
10272 . ti \\n[#PP_INDENT]u
10277 . UNDERSCORE2 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_1] \
10278 \\*[$HEAD_\\n[#LEVEL]_UL2_GAP_2] "\\*[$HD_NUM]\\$[\\n[#ARG_NUM]]
10282 . nr #UNDERSCORE_WEIGHT \\n[#SAVED_UL2_WEIGHT]
10284 . if !\\n[#HD_NUM_INDENT] .nr #HD_NUM_INDENT \w'\\*[$HD_NUM]'
10286 . if !\\n[#PARAHEAD] \{\
10287 . if \\n[#HEAD_\\n[#LEVEL]_SPACE_AFTER] .sp
10289 . if \\n[#CAPS_OFF] \{\
10293 . if \\n[#CAPS_RESTORE] \{\
10299 . rr #HD_NUM_INDENT
10300 . if \\n[#PARAHEAD] .ti \\n[#PP_TEXT_OFFSET]u
10301 . if !\\n[#PARAHEAD] .nr #PP 0
10303 . if \\n[#LB_4_HD] .rr #LB_4_HD
10304 . if \\n[#QUOTE_4_HD] .rr #QUOTE_4_HD
10324 \#---when called as HEADING_STYLE, these are also available---
10325 \# QUAD <direction>
10326 \# NUMBER | NO_NUMBER
10327 \# SPACE_AFTER | NO_SPACE_AFTER
10328 \# UNDERSCORE <weight> <gap> | UNDERSCORE2 <weight> <gap1> <gap2>
10329 \# NO_UNDERSCORE | NO_UNDERSCORE2
10331 \#---when called as TOC_ENTRY_STYLE this is also available---
10334 \# Sets up complete style parameters for HEADING <level>. If
10335 \# invoked as TOC_ENTRY_STYLE, sets up parameters for the
10336 \# corresponding TOC entry at <level>.
10338 \# Arguments may be given in any order. Any not given retain
10339 \# their current values. Defaults for an initial 9 levels of
10340 \# heading are set up in PRINTSTYLE.
10342 \# NUMBER indicates that hierarchic numbering of <level> should be
10343 \# prepended to heading text. If invoked as TOC_ENTRY_STYLE,
10344 \# prepend numbering to TOC entries at <level> (only works if
10345 \# NUMBER is given to the corresponding HEADING <level>).
10347 \# INDENT refers to the indent for <level> in the TOC. It is
10348 \# measured from the left offset of the entry level above it
10349 \# (including numbering, if present). TOC entry levels beneath
10350 \# <level> will have their indents adjusted accordingly.
10352 .MAC HEADING_STYLE END
10354 . tm1 "[mom]: The first argument to \\$0 must be a numeric heading level.
10355 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10358 . if \\n[#FROM_OLDSTYLE] .nr #LEVEL_\\n[#LEVEL]_SET 1
10360 .\" Prepend TOC_ to style strings if called as TOC_ENTRY_STYLE
10361 . if '\\$0'TOC_ENTRY_STYLE' .ds $TOC TOC_
10363 . nr #ATTRIB \\n[#NUM_ARGS]
10364 . while \\n+[#ARG_NUM]<=\\n[#ATTRIB] \{\
10365 . if '\\$1'UNDERSCORE' \{\
10366 . nr #HEAD_\\n[#LEVEL]_UNDERSCORE 1
10369 . tm1 "[mom]: The UNDERSCORE argument to \\$0 requires a rule weight.
10370 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10372 . ds $HEAD_\\n[#LEVEL]_UL_WEIGHT \\$1
10375 . tm1 "[mom]: The UNDERSCORE argument to \\$0 requires a rule gap.
10376 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10378 . ds $HEAD_\\n[#LEVEL]_UL_GAP \\$1
10381 . if '\\$1'NO_UNDERSCORE' \{\
10382 . rr #HEAD_\\n[#LEVEL]_UNDERSCORE
10385 . if '\\$1'UNDERSCORE2' \{\
10386 . nr #HEAD_\\n[#LEVEL]_UNDERSCORE2 1
10389 . tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires a rule weight.
10390 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10392 . ds $HEAD_\\n[#LEVEL]_UL2_WEIGHT \\$1
10395 . tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires a rule gap.
10396 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10398 . ds $HEAD_\\n[#LEVEL]_UL2_GAP_1 \\$1
10401 . tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires an inter-rule gap.
10402 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10404 . ds $HEAD_\\n[#LEVEL]_UL2_GAP_2 \\$1
10407 . if '\\$1'NO_UNDERSCORE2' \{\
10408 . rr #HEAD_\\n[#LEVEL]_UNDERSCORE2
10410 . if '\\$1'SPACE_AFTER' \{\
10411 . nr #HEAD_\\n[#LEVEL]_SPACE_AFTER 1
10414 . if '\\$1'NO_SPACE_AFTER' \{\
10415 . rr #HEAD_\\n[#LEVEL]_SPACE_AFTER
10418 . if '\\$1'FAMILY' \{\
10420 . ds $\\*[$TOC]HEAD_\\n[#LEVEL]_FAM \\$1
10423 . if '\\$1'FONT' \{\
10425 . ds $\\*[$TOC]HEAD_\\n[#LEVEL]_FT \\$1
10428 . if '\\$1'SIZE' \{\
10430 . ds $\\*[$TOC]HEAD_\\n[#LEVEL]_SIZE \\$1
10433 . if '\\$1'QUAD' \{\
10435 . if '\\$1'L' .ds $HEAD_\\n[#LEVEL]_QUAD LEFT
10436 . if '\\$1'LEFT' .ds $HEAD_\\n[#LEVEL]_QUAD LEFT
10437 . if '\\$1'C' .ds $HEAD_\\n[#LEVEL]_QUAD CENTER
10438 . if '\\$1'CENTRE' .ds $HEAD_\\n[#LEVEL]_QUAD CENTER
10439 . if '\\$1'CENTER' .ds $HEAD_\\n[#LEVEL]_QUAD CENTER
10440 . if '\\$1'R' .ds $HEAD_\\n[#LEVEL]_QUAD RIGHT
10441 . if '\\$1'RIGHT' .ds $HEAD_\\n[#LEVEL]_QUAD RIGHT
10444 . if '\\$1'COLOR' \{\
10446 . ds $\\*[$TOC]HEAD_\\n[#LEVEL]_COLOR \\$1
10449 . if '\\$1'BASELINE_ADJUST' \{\
10451 . ds $HEAD_\\n[#LEVEL]_BASELINE_ADJ \\$1
10454 . if '\\$1'CAPS' \{\
10455 . nr #\\*[$TOC]HEAD_\\n[#LEVEL]_CAPS 1
10458 . if '\\$1'NO_CAPS' \{\
10459 . rr #HEAD_\\n[#LEVEL]_CAPS
10462 . if '\\$1'NUMBER' \{\
10463 . nr #NUMBER_HEAD_\\n[#LEVEL] 1
10464 . nr #HEAD_\\n[#LEVEL]_NUM 0 1
10467 . if '\\$1'NO_NUMBER' \{\
10468 . rr #NUMBER_HEAD_\\n[#LEVEL]
10471 . if '\\$1'INDENT' \{\
10473 . nr #TOC_HEAD_\\n[#LEVEL]_INDENT \\$1
10474 . nr #FROM_STYLE_\\n[#LEVEL] 1
10479 . if d$TOC .rm $TOC
10482 .ALIAS TOC_ENTRY_STYLE HEADING_STYLE
10484 \# OLDSTYLE HEADINGS
10485 \# -----------------
10489 \# Called from HEAD, SUBHEAD, and SUBSUBHEAD, sets style
10490 \# parameters for HEADINGs 1-3 to former mom defaults for those macros.
10491 \# Any styles already assigned to those levels are retained.
10493 \# Called by user with no argument, allows use of old style HEAD,
10494 \# SUBHEAD, and SUBSUBHEAD without generating the deprecated msg.
10496 \# For backward compatibility, and to ease the transition to
10497 \# the HEADING scheme for heads.
10499 \# Paraheads must be set with .HEADING <level> PARAHEAD; attempts
10500 \# to call PARAHEAD abort with an instructive message.
10502 .MAC OLDSTYLE_HEADINGS END
10503 . if '\\$1'' .nr #SKIP_MSG 1
10504 . nr #FROM_OLDSTYLE 1 \" Used in HEADING
10505 . if \\n[#PRINT_STYLE]=1 \{\
10506 . if !\\n[#LEVEL_1_SET] \{\
10507 . HEADING_STYLE 1 \
10513 BASELINE_ADJUST 0 \
10515 . nr #OLDSTYLE_HD 1
10518 . if !\\n[#LEVEL_2_SET] \{\
10519 . HEADING_STYLE 2 \
10523 BASELINE_ADJUST \\n[.v]/8
10524 . nr #OLDSTYLE_SH 1
10527 . if !\\n[#LEVEL_3_SET] \{\
10528 . HEADING_STYLE 3 \
10531 BASELINE_ADJUST \\n[.v]/8
10532 . nr #OLDSTYLE_SSH 1
10536 . if \\n[#PRINT_STYLE]=2 \{\
10537 . if !\\n[#LEVEL_1_SET] \{\
10538 . HEADING_STYLE 1 \
10539 FAMILY \E*[$DOC_FAM] \
10545 BASELINE_ADJUST 0 \
10547 . nr #OLDSTYLE_HD 1
10550 . if !\\n[#LEVEL_2_SET] \{\
10551 . HEADING_STYLE 2 \
10552 FAMILY \E*[$DOC_FAM] \
10555 BASELINE_ADJUST \\n[.v]/8
10556 . nr #OLDSTYLE_SH 1
10559 . if !\\n[#LEVEL_3_SET] \{\
10560 . HEADING_STYLE 3 \
10561 FAMILY \E*[$DOC_FAM] \
10564 BASELINE_ADJUST \\n[.v]/8
10565 . nr #OLDSTYLE_SSH 1
10569 . rr #FROM_OLDSTYLE
10572 \# "Deprecated" message
10574 .MAC DEPRECATED END
10575 . if !\\n[#SKIP_MSG] \{\
10576 . tm1 "[mom]: Macro '\\$1' at line \\n[.c] is deprecated.
10577 . tm1 " Invoking HEADING \\$2 instead and assigning style defaults
10578 . tm1 " from former \\$1 as described in the documentation.
10579 . tm1 " If another style is desired, use HEADING_STYLE \\$2 to
10580 . tm1 " create it (see docs).
10581 . tm1 " Further warnings will not be emitted for \\$1.
10582 . tm1 " To avoid this message when using the deprecated HEAD,
10583 . tm1 " SUBHEAD, and SUBSUBHEAD macros, add '.OLDSTYLE_HEADINGS'
10584 . tm1 " after PRINTSTYLE before START.
10589 \# Wrappers around old-style headings.
10592 . if !\\n[#OLDSTYLE_HD] \{\
10593 . DEPRECATED HEAD 1
10594 . OLDSTYLE_HEADINGS HEAD
10600 . if !\\n[#OLDSTYLE_SH] \{\
10601 . DEPRECATED SUBHEAD 2
10602 . OLDSTYLE_HEADINGS SUBHEAD
10607 .MAC SUBSUBHEAD END
10608 . if !\\n[#OLDSTYLE_SSH] \{\
10609 . DEPRECATED SUBSUBHEAD 3
10610 . OLDSTYLE_HEADINGS SUBSUBHEAD
10616 . tm1 "[mom]: \\$0 is no longer a valid macro.
10617 . tm1 " Use 'HEADING <level> PARAHEAD <text>' instead.
10618 . tm1 " You will probably want to invoke HEADING_STYLE to set
10619 . tm1 " the type parameters for the parahead. See docs.
10620 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10623 \# Wrapper macro for oldstyle NUMBER_HEADS, NUMBER_SUBHEADS...
10625 .MAC HEADING_NUMBERS END
10626 . if '\\$0'NUMBER_PARAHEADS' \{\
10627 . tm1 "[mom]: \\$0 is no longer a valid macro.
10628 . tm1 " Use 'HEADING_STYLE <level> NUMBER' instead. See docs.
10629 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
10632 . if '\\$0'NUMBER_HEADS' .nr level 1
10633 . if '\\$0'NUMBER_SUBHEADS' .nr level 2
10634 . if '\\$0'NUMBER_SUBSUBHEADS' .nr level 3
10636 . ie '\\$1'' .ds $PARAM NUMBER
10638 . ds $PARAM NO_NUMBER
10639 . ds $SWITCH " \\$1
10641 . HEADING_STYLE \\n[level] \\*[$PARAM]
10642 . if (\\n[#OLDSTYLE_HD]=1):(\\n[#OLDSTYLE_SH]=1):(\\n[#OLDSTYLE_SSH]=1) \{\
10643 . tm1 "\\*[mom] OLDSTYLE_HEADINGS detected.
10646 . tm1 "\\*[mom] Setting HEADING_STYLE \\n[level] to '\\*[$PARAM]' at '\\$0\\*[$SWITCH]', line \\n[.c].
10651 .ALIAS NUMBER_HEADS HEADING_NUMBERS
10652 .ALIAS NUMBER_SUBHEADS HEADING_NUMBERS
10653 .ALIAS NUMBER_SUBSUBHEADS HEADING_NUMBERS
10654 .ALIAS NUMBER_PARAHEADS HEADING_NUMBERS
10656 \# PREFIX CHAPTER NUMBERS TO HEADINGS/TOC ENTRIES
10657 \# ----------------------------------------------------------------
10659 \# <none> | <chapter number> | <anything>
10661 \# Toggles register #PREFIX_CH_NUM. Sets register #CH_NUM from
10662 \# string $CHAPTER if $CHAPTER is a digit; if <chapter number> arg
10663 \# given, sets #CH_NUM to arg.
10667 .MAC PREFIX_CHAPTER_NUMBER END
10670 . nr #PREFIX_CH_NUM 1
10671 . if \\n[#CHAPTER_CALLED] \{\
10672 . ie \B'\\*[$CHAPTER]' .nr #CH_NUM \\*[$CHAPTER]
10673 . el .PREFIX_CH_NUM_WARNING
10674 . rr #CHAPTER_CALLED
10678 . ie \B'\\*[$CHAPTER]' \{\
10679 . nr #PREFIX_CH_NUM 1
10680 . nr #CH_NUM \\*[$CHAPTER]
10682 . el .PREFIX_CH_NUM_WARNING
10688 . nr #PREFIX_CH_NUM 1
10690 . el .rr #PREFIX_CH_NUM
10694 .MAC PREFIX_CH_NUM_WARNING END
10695 . tm1 "[mom]: PREFIX_CHAPTER_NUMBER cannot determine a chapter number.
10696 . tm1 " Enter the current chapter number as a digit after
10697 . tm1 " PREFIX_CHAPTER_NUMBER.
10698 . ab Aborting '\\n[.F]', line \\n[.c].
10701 \# ====================================================================
10703 \# +++LINE BREAKS+++
10705 \# LINEBREAK CHARACTER
10706 \# -------------------
10708 \# [character] [iterations] [vertical adjustment]
10710 \# Allows user to specify a line break character and the number
10711 \# of times to repeat it horiontally.
10713 \# Without an argument, LINEBREAK_CHAR will deposit a blank line.
10715 \# Vertical adjustment requires a unit of measure (most likely
10716 \# "p"), and has to be preceded by +|-
10718 .MAC LINEBREAK_CHAR END
10720 . ds $LINEBREAK_CHAR \\$1
10721 . if !'\\$2'' .nr #LB_CHAR_ITERATIONS \\$2
10722 . if !'\\$3'' .ds $LINEBREAK_CHAR_V_ADJ \\$3
10723 . if '\\*[$LINEBREAK_CHAR_V_ADJ]'' .ds $LINEBREAK_CHAR_V_ADJ +0
10724 . if \\n[#LB_CHAR_ITERATIONS] \{\
10725 . while (\\n[#LB_CHAR_ITERATIONS]>\\n[#REPEAT]) \{\
10726 . as $LINEBREAK_CHAR "\\ \\$1
10727 . nr #REPEAT \\n[#REPEAT]+1
10731 . rr #LB_CHAR_ITERATIONS
10739 \# Deposits line break character.
10741 \# If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
10744 . if r #Q_AT_TOP .rr #Q_AT_TOP
10745 . ie '\\*[$LINEBREAK_CHAR]'' .sp 2
10747 . ie \\n[#END_QUOTE] .
10753 \m[\\*[$LINEBREAK_COLOR]]\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\
10754 \\*[$LINEBREAK_CHAR]\m[]
10757 . QUAD \\*[$DOC_QUAD]
10760 . if r #QUOTE .rr #QUOTE
10761 . if r #END_QUOTE .rr #END_QUOTE
10764 . nr #LB_4_PARAHEAD 1
10767 \# ====================================================================
10769 \# +++PARAGRAPHS+++
10774 \# <font of running text>
10776 \# Creates or modifies string $PP_FT.
10778 \# Affects all paragraphs.
10781 . if \\n[#PRINT_STYLE]=1 \{\
10782 . ie \\n[#ITALIC_MEANS_ITALIC] .nop
10785 . if \\n[#COLLATE]=1 \
10786 . if !'\\*[$SAVED_PP_FT]'' .rm $SAVED_PP_FT
10791 \# PARAGRAPH INDENT
10792 \# ----------------
10794 \# <amount to indent paragraphs in running text (ipPcm)>
10796 \# Allows user to change the default para indent. The change will
10797 \# affect the indent of QUOTEs and BLOCKQUOTEs as well.
10799 \# Default for printstyle TYPEWRITE is 1/2-inch. Default for
10800 \# printstyle TYPESET is 2 ems. The defaults are set in
10801 \# PRINTSTYLE, not DEFAULTS.
10803 .MAC PARA_INDENT END
10805 . nr #PP_INDENT (\\$1)
10806 . nr #SAVED_PP_INDENT \\n[#PP_INDENT]
10810 . nr #PP_INDENT \\n[#SAVED_PP_INDENT]
10811 . rr #SAVED_PP_INDENT
10814 . nr #SAVED_PP_INDENT \\n[#PP_INDENT]
10820 \# INDENT FIRST PARAGRAPHS
10821 \# -----------------------
10823 \# <none> | <anything>
10825 \# By default, the first para of a document, as well as the first
10826 \# paras of blockquotes and block-style epigraphs are not indented.
10827 \# When invoked, this macro will indent all paras.
10831 .MAC INDENT_FIRST_PARAS END
10832 . ie '\\$1'' .nr #INDENT_FIRST_PARAS 1
10833 . el .rr #INDENT_FIRST_PARAS
10836 \# INTER-PARAGRAPH SPACING
10837 \# -----------------------
10839 \# <none> | <anything>
10841 \# Adds a line space between paragraphs in body text. Block quotes
10844 \# Default is OFF. PARA_SPACE is not recommended for use with
10845 \# PRINTSTYLE TYPEWRITE without SINGLESPACE.
10847 .MAC PARA_SPACE END
10854 . ds $PP_SPACE_AMOUNT \\$1
10865 \# Figures out what to do with paragraphs under differing conditions.
10867 \# Note the use of transparent line break (\!.br) to get
10868 \# PP to work within blockquotes and epigraphs.
10870 \# PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
10873 . if \\n[#DOC_TYPE]=4 \{\
10874 . if !'\\n[.z]'' .di
10875 . nr #TOTAL_FIELDS \\n[#FIELD]
10877 . nr #NUM_FIELDS 0 1
10878 . if \\n[#TOTAL_FIELDS]>0 \{\
10879 . while \\n+[#NUM_FIELDS]<=\\n[#TOTAL_FIELDS] \{\
10881 . LETTERHEAD\\n+[#FIELD]
10882 . QUAD \\*[$DOC_QUAD]
10883 . ALD \\n[#DOC_LEAD]u
10884 . if \\n[#DATE_FIRST]=1 .ALD \\n[#DOC_LEAD]u
10886 . rm LETTERHEAD\\n[#FIELD]
10894 . if r #Q_AT_TOP .rr #Q_AT_TOP
10895 . if \\n[#PP_STYLE]=1 \{\
10896 . if \\n[#ENDNOTE] \{\
10897 . nr #RESET_PARA_SPACE \\n[#PP_SPACE]
10898 . ie \\n[#EN_PP_SPACE] .PARA_SPACE
10899 . el .PARA_SPACE OFF
10901 . if !\\n[#ENDNOTE] .po \\n[#L_MARGIN]u
10902 . if \\n[#COLUMNS] \{\
10903 . if !\\n[#ENDNOTE] \{\
10904 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
10905 . nr #L_MARGIN \\n[.o]
10908 . if \\n[#TAB_ACTIVE] .TAB \\n[#CURRENT_TAB]
10909 . ie \\n[#PRINT_STYLE]=1 \{\
10911 . ie \\n[#ENDNOTE] .vs \\n[#EN_LEAD]u
10912 . el .vs \\n[#DOC_LEAD]u
10913 . QUAD \\*[$DOC_QUAD]
10914 . if \\n[#SLANT_ON] \{\
10915 . if \\n[#UNDERLINE_SLANT] .UNDERLINE
10917 . if '\\*[$PP_FT]'I' \
10918 . if \\n[#ITALIC_MEANS_ITALIC] .FT I
10921 . ie \\n[#ENDNOTE] \{\
10922 . FAMILY \\*[$EN_FAM]
10925 . vs \\n[#EN_LEAD]u
10926 . QUAD \\*[$EN_QUAD]
10929 . FAMILY \\*[$DOC_FAM]
10930 . if !'\\*[$SAVED_PP_FT]'' \{\
10931 . ds $PP_FT \\*[$SAVED_PP_FT]
10935 . ps \\n[#DOC_PT_SIZE]u
10936 . vs \\n[#DOC_LEAD]u
10937 . QUAD \\*[$DOC_QUAD]
10940 . ie \\n[#PP]=0 \{\
10941 . if \\n[#INDENT_FIRST_PARAS] \{\
10942 . ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
10943 . el .ti \\n[#PP_INDENT]u
10944 . if '\\n[.z]'END_NOTES' \
10945 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
10947 . if r #END_QUOTE \{\
10948 . if \\n[#END_QUOTE] \{\
10949 . if !\\n[#LINEBREAK] \{\
10950 . ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
10951 . el .ti \\n[#PP_INDENT]u
10952 . if '\\n[.z]'END_NOTES' \
10953 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
10960 . if \\n[#PP_SPACE] \{\
10961 . ie \\n[#END_QUOTE] \{\
10962 . ie !'\\*[$PP_SPACE_AMOUNT]'' .ALD \\*[$PP_SPACE_AMOUNT]
10966 . nr #BASELINE_MARK \\n[nl]
10969 . if \\n[#NO_SPACE]=1 .rr #NO_SPACE
10970 . if !\\n[nl]=\\n[#BASELINE_MARK] \{\
10971 . ie !'\\*[$PP_SPACE_AMOUNT]'' .ALD \\*[$PP_SPACE_AMOUNT]
10973 . rr #BASELINE_MARK
10977 . ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
10978 . el .ti \\n[#PP_INDENT]u
10979 . if '\\n[.z]'END_NOTES' \
10980 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
10982 . if r #START .rr #START
10983 . if r #QUOTE .rr #QUOTE
10984 . if r #END_QUOTE .rr #END_QUOTE
10985 . if r #HEAD .rr #HEAD
10986 . if r #SUBHEAD .rr #SUBHEAD
10987 . if r #EPIGRAPH .rr #EPIGRAPH
10988 . if r #Q_FITS .rr #Q_FITS
10989 . if r #LINEBREAK .rr #LINEBREAK
10990 . if \\n[#ENDNOTE] \{\
10991 . ie \\n[#RESET_PARA_SPACE] .PARA_SPACE
10992 . el .PARA_SPACE OFF
10994 . if \\n[#CONDENSE] \{\
10997 . if \\n[#EXTEND]=1 \{\
11002 . if \\n[#PP_STYLE]=2 \{\
11004 . if \\n[#BROKEN_QUOTE] \{\
11005 . ie \\n[nl]=\\n[#PAGE_TOP] .nr #Q_PP 1
11009 . ie \\n[#Q_PP]=0 \{\
11010 . if \\n[#INDENT_FIRST_PARAS] \
11011 . ti \\n[#PP_INDENT]u/2u
11012 . if \\n[#ENDNOTE] \{\
11013 . ie \\n[#INDENT_FIRSTS] .ti \\n[#PP_INDENT]u/2u
11018 . ti \\n[#PP_INDENT]u/2u
11019 . if \\n[#PP_SPACE]=1 \{\
11020 . ie !'\\*[$PP_SPACE_AMOUNT]'' .ALD \\*[$PP_SPACE_AMOUNT]
11024 . if \\n[#CONDENSE] \{\
11027 . if \\n[#EXTEND]=1 \{\
11032 .\" This takes care of multi-paragraph dialogue, where each para
11033 .\" is introduced by an open quote whereas the previous para has
11034 .\" no close quote.
11035 . if \\n[#OPEN_CLOSE]=1 .nr #OPEN_CLOSE 0
11038 . if r #QUOTE_4_HD .rr #QUOTE_4_HD
11039 . if r #LB_4_HD .rr #LB_4_HD
11041 \# ====================================================================
11045 \# ---Line for line quotes, i.e. poetry or code snippets---
11047 \# UNDERLINE QUOTES
11048 \# ----------------
11050 \# <none> | <anything>
11052 \# Creates or modifies register #UNDERLINE_QUOTES (toggle).
11053 \# If on, line for line quotes are underlined when printstyle
11056 \# Default is ON for printstyle TYPEWRITE.
11058 .MAC UNDERLINE_QUOTES END
11059 . ie '\\$1'' .nr #UNDERLINE_QUOTES 1
11060 . el .rr #UNDERLINE_QUOTES
11066 \# <integer> | <integer with unit of measure appended>
11068 \# Creates or modifies register #Q_OFFSET_VALUE or string
11069 \# $Q_OFFSET_VALUE.
11071 \# If just an integer given, value by which to multiply PARA_INDENT
11072 \# to get quote indent. If integer with a unit of measure appended,
11073 \# absolute value of quote indent.
11075 \# Default is 3 for typeset; 2 for typewrite.
11077 .MAC QUOTE_INDENT END
11078 . rr #Q_OFFSET_VALUE
11079 . rm $Q_OFFSET_VALUE
11080 . ds $EVAL_QI_ARG \\$1
11081 . substring $EVAL_QI_ARG -1
11082 . ie \B'\\*[$EVAL_QI_ARG]' .nr #Q_OFFSET_VALUE \\$1
11083 . el .ds $Q_OFFSET_VALUE \\$1
11090 \# <autolead value>
11092 \# Sets autolead for quotes and/or blockquotes.
11094 .MAC QUOTE_AUTOLEAD END
11096 . if '\\$0'QUOTE_AUTOLEAD' .nr #Q_AUTOLEAD (p;\\$1)
11097 . if '\\$0'BLOCKQUOTE_AUTOLEAD' .nr #BQ_AUTOLEAD (p;\\$1)
11098 . if '\\$0'ENDNOTE_QUOTE_AUTOLEAD' .nr #EN_Q_AUTOLEAD (p;\\$1)
11099 . if '\\$0'ENDNOTE_BLOCKQUOTE_AUTOLEAD' .nr #EN_BQ_AUTOLEAD (p;\\$1)
11102 .ALIAS BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
11103 .ALIAS ENDNOTE_QUOTE_AUTOLEAD QUOTE_AUTOLEAD
11104 .ALIAS ENDNOTE_BLOCKQUOTE_AUTOLEAD QUOTE_AUTOLEAD
11106 \# ALWAYS FULLSPACE QUOTES
11107 \# -----------------------
11109 \# <none> | <anything>
11111 \# Toggles register #FULLSPACE_QUOTES.
11113 \# If user doesn't like the default 1/2 line space above and below
11114 \# quotes, s/he can turn it off here. Has no effect in TYPEWRITE.
11116 .MAC ALWAYS_FULLSPACE_QUOTES END
11117 . if '\\$1'' .nr #FULLSPACE_QUOTES 1
11118 . el .rr #FULLSPACE_QUOTES
11124 \# <none> | <anything>
11126 \# Indents quoted text on a line for line basis, or turns QUOTE off.
11128 \# Owing to the need to bottom align TYPESET pages, quoted text gets
11129 \# diverted so its depth can be measured (in DO_QUOTE) for determining
11130 \# how much space to put before and after.
11135 \# <none> | <anything>
11137 \# Indents quoted text on a line for line basis, or turns QUOTE off.
11139 \# Owing to the need to bottom align TYPESET pages, quoted text gets
11140 \# diverted so its depth can be measured (in DO_QUOTE) for determining
11141 \# how much space to put before and after.
11145 . if \\n[#PP]>0 .rr #START
11146 . if \\n[#LINENUMBERS]=1 \{\
11147 . nr #LINENUMBERS 2
11148 . nr #NEXT_LN \\n[ln]
11154 . if \\n[#LINENUMBERS]=2 \{\
11155 . if \\n[#SILENT_QUOTE_LN]=1 .nm \\n[#NEXT_LN] 1000 -4
11160 . ie !'\\*[$Q_OFFSET_VALUE]'' .ll \\n[#L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11161 . el .ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11163 . if \\n[#COLUMNS] \{\
11164 . ie \\n[#Q_OFFSET_VALUE] \
11165 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
11166 . el .ll \\n[#COL_L_LENGTH]u-\\*[$Q_OFFSET_VALUE]
11169 . if \\n[#PRINT_STYLE]=1 \{\
11171 . vs \\n[#DOC_LEAD]u
11174 . if \\n[#PRINT_STYLE]=2 \{\
11175 . FAMILY \\*[$QUOTE_FAM]
11176 . FT \\*[$QUOTE_FT]
11177 . ps \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
11178 . ie !r #Q_AUTOLEAD .vs \\n[#DOC_LEAD]u
11180 . vs \\n[.ps]u+\\n[#Q_AUTOLEAD]u
11181 . nr #Q_LEAD \\n[.v]
11183 . if \\n[#ENDNOTE] \{\
11184 . ps \\n[#EN_PS]u\\*[$QUOTE_SIZE_CHANGE]
11185 . ie !r #EN_Q_AUTOLEAD .vs \\n[#EN_Q_LEAD]u
11187 . vs \\n[.ps]u+\n[#EN_Q_AUTOLEAD]u
11188 . nr #EN_Q_LEAD \\n[.v]
11191 . nr #Q_LEAD_REAL \\n[.v]
11193 . if \\n[#QUOTE_COLOR]=1 \{\
11195 \m[\\*[$QUOTE_COLOR]]
11199 . if \\n[#LINENUMBERS]=2 \{\
11200 . ie \\n[#QUOTE_LN]=1 \{\
11201 . if '\\n[#Q_LN_GUTTER]'' .nr #Q_LN_GUTTER \\n[#LN_GUTTER]
11203 . nm \\n[ln] "" \\n[#Q_LN_GUTTER] -3-\\n[#Q_LN_GUTTER]
11207 . if !\\n[#SILENT_QUOTE_LN] .NUMBER_LINES OFF
11210 . nr #Q_TOP \\n[nl]
11211 . if \\n[#PRINT_STYLE]=1 \
11212 . if \\n[#UNDERLINE_QUOTES] .FT I
11220 \# <none> [ BR | BREAK | SPREAD ]
11222 \# <anything> [ BR | BREAK | SPREAD ]
11224 \# Takes care of administrivia associated with setting code snippets.
11230 . nr #BREAK_OR_SPREAD 1
11233 . if '\\$1'BREAK' \{\
11234 . nr #BREAK_OR_SPREAD 1
11238 . if '\\$1'SPREAD' \{\
11239 . nr #BREAK_OR_SPREAD 2
11244 . ds $RESTORE_FAM \\n[.fam]
11245 . ds $RESTORE_FT \\n[.sty]
11246 . ie \\n[#PRINT_STYLE]=1 \{\
11248 . ie \\n[#CODE_FT]=1 .ft \\*[$CODE_FT]
11254 . if \\n[#UNDERLINE_QUOTES]=1 \{\
11255 . nr #RESTORE_UNDERLINE 1
11256 . UNDERLINE_QUOTES OFF
11262 . ie \\n[#CODE_FAM]=1 .fam \\*[$CODE_FAM]
11265 . fam \\*[$CODE_FAM]
11267 . ie \\n[#CODE_FT]=1 .ft \\*[$CODE_FT]
11272 . if \\n[#CODE_COLOR]=1 .COLOR \\*[$CODE_COLOR]
11274 . if !\\n[#CODE_SIZE_ADJ]=0 .ps \\n[#PT_SIZE]u*\\n[#CODE_SIZE_ADJ]u/100u
11275 . if \\n[#SQ_ON] \{\
11282 . fam \\*[#RESTORE_FAM]
11283 . ft \\*[#RESTORE_FT]
11286 . if !\\n[#CODE_SIZE_ADJ]=0 .ps
11289 . if \\n[#LINENUMBERS] .nn
11290 . if \\n[#CODE_COLOR]=1 .gcolor
11291 . if \\n[#RESTORE_UNDERLINE]=1 \{\
11292 . rr #RESTORE_UNDERLINE
11295 . if \\n[#SQ_WAS_ON]=1 \{\
11299 . if \\n[#QUOTE] .sp 1v
11308 \# Creates register #CODE_FAM and string $CODE_FAM for use by CODE.
11310 .MAC CODE_FAMILY END
11312 . ds $CODE_FAM \\$1
11320 \# Creates register #CODE_FT and string $CODE_FT for use by CODE.
11330 \# <percentage to zoom code font>
11332 \# Creates register #CODE_SIZE_ADJ, used in CODE to zoom the
11333 \# CODE_FONT to a percentage of the current point size.
11336 . nr #CODE_SIZE_ADJ \\$1
11339 \# ---Blockquotes---
11344 \# <none> | <anything>
11346 \# Indents quoted text in fill mode and shortens line length
11347 \# equivalently, or turns BLOCKQUOTE off.
11349 \# Owing to the need to bottom align TYPESET pages, quoted text gets
11350 \# diverted so its depth can be measured (in DO_QUOTE) for determining
11351 \# how much space to put before and after.
11353 \# .PP after blockquote is optional if there's only one para,
11354 \# but required if there's more than one.
11356 .MAC BLOCKQUOTE END
11358 . if \\n[#LINENUMBERS]=1 \{\
11359 . nr #LINENUMBERS 2
11360 . nr #NEXT_LN \\n[ln]
11371 . ie !'\\*[$Q_OFFSET_VALUE]'' .ll \\n[#L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11372 . el .ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11373 . if \\n[#ENDNOTE] \{\
11374 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
11375 . ie r#Q_OFFSET_VALUE \
11377 \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11380 \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\*[$Q_OFFSET_VALUE]*2u)
11382 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
11383 . ie r#Q_OFFSET_VALUE \
11384 . ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11386 . ll \\n[#L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]u*2u)
11391 . if \\n[#COLUMNS] \{\
11392 . ie r#Q_OFFSET_VALUE \
11394 \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11396 . ll \\n[#COL_L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11397 . if \\n[#ENDNOTE] \{\
11398 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
11399 . ie r#Q_OFFSET_VALUE \
11401 \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11404 \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\*[$Q_OFFSET_VALUE]*2u)
11406 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
11407 . ie r#Q_OFFSET_VALUE \
11409 \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
11411 . ll \\n[#COL_L_LENGTH]u-(\\*[$Q_OFFSET_VALUE]*2u)
11416 . if \\n[#PRINT_STYLE]=1 \{\
11418 . vs \\n[#DOC_LEAD]u
11422 . if \\n[#PRINT_STYLE]=2 \{\
11423 . FAMILY \\*[$BQUOTE_FAM]
11424 . FT \\*[$BQUOTE_FT]
11425 . ps \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
11426 . ie !r #BQ_AUTOLEAD .vs \\n[#DOC_LEAD]u
11428 . vs \\n[.ps]u+\\n[#BQ_AUTOLEAD]u
11429 . nr #BQ_LEAD \\n[.v]
11431 . if \\n[#ENDNOTE] \{\
11432 . ps \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
11433 . ie !r#EN_BQ_AUTOLEAD .vs \\n[#EN_BQ_LEAD]u
11435 . vs \\n[.ps]u+\\n[#EN_BQ_AUTOLEAD]u
11436 . nr #EN_BQ_LEAD \\n[.v]
11439 . nr #Q_LEAD_REAL \\n[.v]
11440 . if \\n[#BQUOTE_COLOR]=1 \{\
11442 \m[\\*[$BQUOTE_COLOR]]
11445 . QUAD \\*[$BQUOTE_QUAD]
11446 . nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
11447 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
11450 . if \\n[#LINENUMBERS]=2 \{\
11451 . ie \\n[#BQUOTE_LN]=1 \{\
11452 . if '\\n[#BQ_LN_GUTTER]'' .nr #BQ_LN_GUTTER \\n[#LN_GUTTER]
11454 . nm \\n[ln] "" \\n[#BQ_LN_GUTTER] -3-\\n[#BQ_LN_GUTTER]
11458 . if !\\n[#SILENT_BQUOTE_LN] .NUMBER_LINES OFF
11460 . nr #Q_TOP \\n[nl]
11461 . if \\n[#INDENT_FIRST_PARAS] \{\
11462 . ie !\\n[#ENDNOTE] \{\
11463 . if \\n[#PRINT_STYLE]=1 .ti \\n[#PP_INDENT]u/2u
11464 . if \\n[#PRINT_STYLE]=2 .ti \\n[#PP_INDENT]u/2u
11467 . if \\n[#INDENT_FIRSTS]=1 \{\
11468 . if \\n[#PRINT_STYLE]=1 .ti \\n[#EN_PP_INDENT]u/2u
11469 . if \\n[#PRINT_STYLE]=2 .ti \\n[#EN_PP_INDENT]u/2u
11482 \# Ends the diversion P_QUOTE or B_QUOTE. Spaces them according to
11483 \# PRINTSTYLE, whether there's inter-paragraph spacing, and page
11484 \# position. TYPEWRITE treats spacing the same way in all circumstance
11485 \# (viz. an extra line space). TYPESET puts in only half
11486 \# line spaces if the entire quote plus 1 line of body under the quote
11487 \# fits on the the page; otherwise it puts in a full extra blank
11488 \# line. (This is to ensure the page remains bottom aligned).
11492 . if \\n[#DIVER_LN_OFF] \{\
11493 \!. NUMBER_LINES OFF
11498 . if \\n[#RESET_FN_COUNTERS]=2 \{\
11499 . if !\\n[#FN_COUNT]=1 \{\
11500 . if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
11502 . rr #RESET_FN_COUNTERS
11506 . nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
11507 . nr #DONE_ONCE 0 1
11510 . nr #Q_DEPTH (\\n[#DIVER_DEPTH]-\\n[#Q_LEAD_REAL])
11511 . nr #Q_LEAD_DIFF \\n[#LEAD]-\\n[#Q_LEAD_REAL]
11512 . if !\\n[.v]=\\n[#Q_LEAD_REAL] \{\
11516 . nr #CURRENT_V_POS \
11517 \\n[nl]+\\n[#Q_LEAD_DIFF]+(\\n[#DIVER_DEPTH]-\\n[#Q_DEPTH_REAL])
11520 . nr #Q_SPACE_ADJ \\n[#SHIM]/2
11521 . nr #TRAP \\n[.t]-1
11523 . if \\n[#ENDNOTE] \{\
11524 . nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
11525 . ALWAYS_FULLSPACE_QUOTES
11527 . if \\n[#PRINT_STYLE]=1 \{\
11528 . if \\n[#START]=1 .
11529 . if \\n[#START]=0 \
11530 . if !\\n[#LINEBREAK] .ALD \\n[#DOC_LEAD]u
11532 . if \\n[#HEAD]=1 .RLD \\n[#DOC_LEAD]u
11534 . if \\n[#PRINT_STYLE]=2 \{\
11535 . ie \\n[#PP_SPACE] \{\
11540 . ie \\n[#FULLSPACE_QUOTES] .ALD \\n[#DOC_LEAD]u
11541 . el .ALD \\n[#DOC_LEAD]u/2u
11546 . ie \\n[#Q_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
11547 . ie ((\\n[#TRAP_DISTANCE]-1)-\\n[#Q_DEPTH])<\\n[#DOC_LEAD] \
11550 . ie (\\n[#TRAP_DISTANCE]-\\n[#DOC_LEAD])<\\n[#DOC_LEAD] .Q_NOFIT
11552 . ie (\\n[#Q_DEPTH]+\\n[.v])=(\\n[#TRAP_DISTANCE]-1) .Q_NOFIT
11559 . if \\n[#LINEBREAK] \{\
11560 . ie !\\n[@TOP] .RLD \\n[#DOC_LEAD]u
11563 . sp |\\n[#T_MARGIN]u-\\n[#BQ_LEAD]u
11567 . ie !'\\*[$Q_OFFSET_VALUE]'' .nr #Q_OFFSET \\n[#L_MARGIN]+\\*[$Q_OFFSET_VALUE]
11569 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
11570 . if \\n[#COLUMNS] \{\
11571 . ie r#Q_OFFSET_VALUE \
11573 \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
11574 . el .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+\\*[$Q_OFFSET_VALUE]
11576 . if !\\n[#ENDNOTE] \{\
11577 . po \\n[#Q_OFFSET]u
11578 . if '\\n[.z]'FLOAT*DIV' \!.po \\n[#Q_OFFSET]u
11580 . if \\n[#ENDNOTE] \{\
11581 . ie \\n[#Q_OFFSET_VALUE] .in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
11582 . el .in +\\*[$Q_OFFSET_VALUE]
11584 . ie \\n[#START]=1 \{\
11585 . ie !\\n[#Q_LEAD_DIFF]<0 .ALD \\n[#Q_SPACE_ADJ]u
11586 . el .RLD 0-\\n[#Q_LEAD_DIFF]u
11589 . if \\n[#PRINT_STYLE]=2 \{\
11590 . if !\\n[.v]=\\n[#Q_LEAD] .ALD \\n[#Q_SPACE_ADJ]u
11593 . if \\n[#QUOTE]=1 \{\
11597 . if !\\n[#START] .rr #QUOTE
11599 . if \\n[#QUOTE]=2 \{\
11604 . if \\n[#PRINT_STYLE]=1 \
11605 . if !\\n[.v]=\\n[#DOC_LEAD] .SHIM
11606 . if \\n[#PRINT_STYLE]=2 \{\
11607 . ie \\n[#START] \{\
11608 . ie \\n[#PP_SPACE] .
11610 . ALD \\n[#DOC_LEAD]u
11615 . ie \\n[#HEAD]=1 \{\
11616 . ALD \\n[#DOC_LEAD]u
11620 . ie \\n[#FULLSPACE_QUOTES] \{\
11621 . ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u
11622 . el .ALD \\n[#DOC_LEAD]u
11624 . el .ALD (\\n[#DOC_LEAD]/2)u
11625 . ie \\n[#Q_FITS] \{\
11626 . ie (\\n[#Q_TOP]=\\n[#PAGE_TOP]):(\\n[@TOP]=1) \{\
11631 . if !\\n[.v]=\\n[#Q_LEAD_REAL] .SHIM
11635 .\" Make sure that Q_LEAD_DIFF is not added to the first line of
11636 .\" normal text at the top of any page following output of a quote
11637 .\" whose last line falls on B_MARGIN of the previous page.
11638 . if \\n[#Q_LEAD_DIFF] \{\
11639 . if \\n[nl]=(\\n[#T_MARGIN]-\\n[#DOC_LEAD]+\\n[#Q_LEAD_DIFF]) \{\
11642 . sp -1v-\\n[#Q_LEAD_DIFF]u
11643 . nr #Q_LEAD_DIFF_CHECK 1
11651 . if \\n[#LINENUMBERS]=2 \{\
11652 . nr #LINENUMBERS 1
11653 . if !\\n[#ENDNOTE] \{\
11654 . ie \\n[#RESTORE_LN_NUM]=1 \{\
11666 . if \\n[#ENDNOTE] .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING]
11667 . if r #HEAD .rr #HEAD
11668 . if r #EPIGRAPH .rr #EPIGRAPH
11673 . if !\\n[#ENDNOTE] \{\
11674 . po \\n[#L_MARGIN]u
11675 . if '\\n[.z]'FLOAT*DIV' \!.po \\n[#L_MARGIN]u
11677 . if \\n[#ENDNOTE] .in \\n[#EN_TEXT_INDENT]u
11678 . if \\n[#COLUMNS] \{\
11679 . if !\\n[#ENDNOTE] \{\
11680 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
11681 . nr #L_MARGIN \\n[.o]
11683 . if \\n[#ENDNOTE] .in \\n[#EN_TEXT_INDENT]u
11685 . ie !\\n[#ENDNOTE] .QUAD \\*[$DOC_QUAD]
11686 . el .QUAD \\*[EN_QUAD]
11687 . if r #DELAY_SHIM \{\
11691 . if \\n[#PRINT_STYLE]=1 \
11692 . if \\n[#UNDERLINE_QUOTES] .FT R
11696 \# Utility macros for DO_QUOTE
11697 \# ---------------------------
11701 . ie \\n[#HEAD]=1 .ALD \\n[#Q_LEAD_DIFF]u
11705 . ie \\n[#FULLSPACE_QUOTES] \{\
11706 . ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u
11707 . el .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u
11710 .\" This seems to be the only way to get the baseline of quotes that
11711 .\" start at the top of the page to fall on the first line of the
11712 .\" grid (ie. on the first valid baseline of the page).
11713 . ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
11714 . if \\n[#QUOTE]=1 \{\
11715 . rn P_QUOTE Q_TEMP
11720 . sp -1v+\\n[#Q_LEAD_DIFF]u
11724 . if \\n[#QUOTE]=2 \{\
11725 . rn B_QUOTE Q_TEMP
11728 . vs \\n[#BQ_LEAD]u
11730 . sp -1v+\\n[#Q_LEAD_DIFF]u
11736 . el .ALD (\\n[#DOC_LEAD]u/2u)+\\n[#Q_SPACE_ADJ]u
11739 . if \\n[#DIVER_FN]=2 .rr #DIVER_FN
11746 . if \\n[#HEAD]=1 .
11748 . if \\n[#Q_DEPTH]=0 \
11750 . ie \\n[#FULLSPACE_QUOTES] \{\
11751 . ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u
11752 . el .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u
11755 . ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]
11758 . nr #Q_PARTIAL_DEPTH 0 \\n[#Q_LEAD_REAL]
11759 . while \\n+[#Q_PARTIAL_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
11762 . nr #Q_PARTIAL_DEPTH -\\n[#Q_LEAD_REAL]
11763 . nr #Q_SPACE_ADJ \
11764 (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_PARTIAL_DEPTH]+\\n[#Q_LEAD_DIFF]u
11765 . if \\n[#FN_COUNT]>0 .nr #Q_SPACE_ADJ (\\n[#Q_SPACE_ADJ] / 2u)
11766 .\" Hack to deal with the fact that even though the above routine
11767 .\" makes the bottom line of the quote fall exactly on the bottom
11768 .\" margin when traps are disabled, it refuses to do so when traps
11769 .\" are on. The difference by which it's off is #Q_LEAD_DIFF
11770 .\" (the +\\n[#Q_LEAD_DIFF] at the end of the line, above). Hack
11771 .\" solution: temporarily lower the FOOTER trap position.
11772 . if !\\n[#Q_DEPTH]=0 \{\
11773 . nr #SAVED_FOOTER_POS \\n[#VARIABLE_FOOTER_POS]
11774 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+.25v
11779 \# ====================================================================
11781 \# +++PAGINATION+++
11786 \# <none> | <anything>
11788 \# Turns page numbering off or on during document processing.
11793 . ie '\\$1'' .nr #PAGINATE 1
11796 . if !\\n[#COLLATE] .rr #PAGE_NUM_V_POS
11798 . if \\n[#HF_OFF]=1 \{\
11799 . rr #PAGINATION_STATE
11804 \# SUSPEND PAGINATION (before ENDNOTES)
11805 \# ------------------
11809 \# Creates register #SUSPEND_PAGINATION
11811 \# Useful only to suspend pagination before outputting endnotes.
11813 .MAC SUSPEND_PAGINATION END
11814 . nr #SUSPEND_PAGINATION 1
11817 \# RESTORE PAGINATION (after ENDNOTES)
11818 \# ------------------
11822 \# Removes register #SUSPEND_PAGINATION. Creates register
11823 \# #DEFER_PAGINATION
11825 \# Useful only to restore pagination after outputting endnotes.
11827 .MAC RESTORE_PAGINATION END
11828 . rr #SUSPEND_PAGINATION
11829 . if \\n[#PAGE_NUM_V_POS]=1 .PAGINATE
11830 . if \\n[#PAGE_NUM_V_POS]=2 .nr #DEFER_PAGINATION 1
11833 \# PAGE NUMBER FORMAT
11834 \# ------------------
11836 \# DIGIT | ROMAN | roman | ALPHA | alpha
11838 \# Assigns user entered format to #PAGENUMBER.
11840 .MAC PAGENUM_STYLE END
11841 . nr #PAGENUM_STYLE_SET 1
11842 . if '\\$1'DIGIT' \{\
11843 . ds $PAGENUM_STYLE \\$1
11846 . if '\\$1'ROMAN' \{\
11847 . ds $PAGENUM_STYLE \\$1
11850 . if '\\$1'roman' \{\
11851 . ds $PAGENUM_STYLE \\$1
11854 . if '\\$1'ALPHA' \{\
11855 . ds $PAGENUM_STYLE \\$1
11858 . if '\\$1'alpha' \{\
11859 . ds $PAGENUM_STYLE \\$1
11864 \# HYPHENS AROUND PAGE NUMBERS
11865 \# ---------------------------
11867 \# <none> | <anything>
11869 \# Creates or modifies register #PAGE_NUM_HYPHENS.
11870 \# Used to dis/enable hyphens on either side of page numbers.
11874 .MAC PAGENUM_HYPHENS END
11875 . nr #PAGE_NUM_HYPHENS_SET 1
11876 . ie '\\$1'' .nr #PAGE_NUM_HYPHENS 1
11877 . el .rr #PAGE_NUM_HYPHENS
11880 \# PAGENUMBER POSITION
11881 \# -------------------
11883 \# TOP | BOTTOM LEFT | CENTER | RIGHT
11885 \# Creates or modifies various PAGE_NUM_H | V_POS registers.
11886 \# Used to position page numbers.
11888 \# Default is center/bottom.
11890 .MAC PAGENUM_POS END
11891 . nr #PAGE_NUM_POS_SET 1
11892 . if '\\$1'TOP' .nr #PAGE_NUM_V_POS 1
11893 . if '\\$1'BOTTOM' .nr #PAGE_NUM_V_POS 2
11894 . if '\\$2'LEFT' .nr #PAGE_NUM_H_POS 1
11895 . if '\\$2'CENTER' .nr #PAGE_NUM_H_POS 2
11896 . if '\\$2'CENTRE' .nr #PAGE_NUM_H_POS 2
11897 . if '\\$2'RIGHT' .nr #PAGE_NUM_H_POS 3
11900 .MAC PN_WITH_HYPHENS END
11901 . nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
11902 . ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
11903 . ds $PN_FOR_KN \\n[#PAGENUMBER]
11904 .\" Check for initial or terminal 1's or 7's, and apply a little kerning
11905 . substring $PN_FOR_KN 0 0 \" 1st digit
11906 . if '\\*[$PN_FOR_KN]'1' .ds $PRE_HY_KN \*[BU3]
11907 . if '\\*[$PN_FOR_KN]'7' .ds $PRE_HY_KN \*[BU3]
11908 . ds $PN_FOR_KN \\n[#PAGENUMBER]
11909 . substring $PN_FOR_KN -1 -1 \" last digit
11910 . if '\\*[$PN_FOR_KN]'1' .ds $POST_HY_KN \*[BU3]
11911 . if '\\*[$PN_FOR_KN]'7' .ds $POST_HY_KN \*[BU3]
11913 \m[\\*[$PAGENUM_COLOR]]\
11914 \\*[$HYPHEN]\|\\*[$PRE_HY_KN]\\n[#PAGENUMBER]\\*[$POST_HY_KN]\|\\*[$HYPHEN]
11920 \# PRINT PAGE NUMBER
11921 \# -----------------
11925 \# Prints page number if PAGINATE=1.
11927 .MAC PRINT_PAGE_NUMBER END
11930 . po \\n[#DOC_L_MARGIN]u
11931 . ll \\n[#DOC_L_LENGTH]u
11933 . fam \\*[$PAGE_NUM_FAM]
11934 . ft \\*[$PAGE_NUM_FT]
11935 . ps \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
11936 . if \\n[#PRINT_STYLE]=1 .TYPEWRITER
11937 . if \\n[#PAGE_NUM_V_POS]=1 .vs 0
11939 . ie \\n[#PAGE_NUM_H_POS]=1 .LEFT
11943 . ie \\n[#PAGE_NUM_H_POS]=1 .RIGHT
11946 . if \\n[#PAGE_NUM_H_POS]=2 .CENTER
11947 . if \\n[#RECTO_VERSO]=0 \{\
11948 . if \\n[#PAGE_NUM_H_POS]=1 .LEFT
11949 . if \\n[#PAGE_NUM_H_POS]=2 .CENTER
11950 . if \\n[#PAGE_NUM_H_POS]=3 .RIGHT
11952 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
11953 . if \\n[#EN_FIRST_PAGE] \{\
11954 . if \\n[#EN_FIRST_PN] .PAGENUMBER \\n[#EN_FIRST_PN]
11955 . rr #EN_FIRST_PAGE
11957 . if \\n[#BIB_FIRST_PAGE] \{\
11958 . if \\n[#BIB_FIRST_PN] .PAGENUMBER \\n[#BIB_FIRST_PN]
11959 . rr #BIB_FIRST_PAGE
11961 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
11962 . ie '\\*[$REVISION]'' \
11963 . PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT] / \\n[#PAGENUMBER]"
11965 . ie '\\*[$DRAFT]'' \
11966 . PRINT "\\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
11969 "\\*[$DRAFT_STRING]\\*[$DRAFT], \\*[$REVISION_STRING] \\*[$REVISION] / \
11974 . ie \\n[#PAGE_NUM_HYPHENS] \{\
11975 . if '\\*[$PAGENUM_STYLE]'DIGIT' \{\
11977 1\\R'#CAP_HEIGHT \\n[.cht]'
11981 . if '\\*[$PAGENUM_STYLE]'ROMAN' \{\
11983 I\\R'#CAP_HEIGHT \\n[.cht]'
11987 . if '\\*[$PAGENUM_STYLE]'ALPHA' \{\
11989 E\\R'#CAP_HEIGHT \\n[.cht]'
11993 . if '\\*[$PAGENUM_STYLE]'roman' \
11994 . PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
11995 . if '\\*[$PAGENUM_STYLE]'alpha' \
11996 . PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
11998 . el .PRINT \m[\\*[$PAGENUM_COLOR]]\\n[#PAGENUMBER]
12001 . nr #DIVER_DEPTH 0
12004 \# ====================================================================
12008 \# Mom's footnote handling is baroque, to say the least. There are
12009 \# redundancies in a number of the macros involved, as well as some
12010 \# registers that probably don't get used anymore. The baggage is left
12011 \# in in case some new footnote oddity/challenge gets thrown at her.
12013 \# The macros are heavily commented.
12015 \# FOOTNOTE AUTOLEAD
12016 \# -----------------
12018 \# <autolead value for footnotes>
12020 \# Creates or modifies register #FN_AUTOLEAD.
12022 \# Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
12024 .MAC FOOTNOTE_AUTOLEAD END
12025 . nr #FN_AUTOLEAD (p;\\$1)
12028 \# FOOTNOTE MARKERS
12029 \# ----------------
12031 \# <none> | <anything>
12033 \# Turns generation of footnote markers on or off.
12037 .MAC FOOTNOTE_MARKERS END
12038 . ie '\\$1'' .nr #FN_MARKERS 1
12039 . el .nr #FN_MARKERS 0
12042 \# FOOTNOTE MARKER STYLE
12043 \# ---------------------
12045 \# STAR | NUMBER | LINE
12047 \# Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
12048 \# the style of footnote markers.
12050 \# 1=STAR; 2=NUMBER; 3=LINE. LINE means "use output line numbers".
12051 \# Default is STAR.
12053 .MAC FOOTNOTE_MARKER_STYLE END
12054 . if '\\$1'STAR' \{\
12055 . if \\n[#FN_MARKER_STYLE]=3 \{\
12056 . if !\\n[#NEWPAGE]=1 \{\
12057 . tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is LINE.
12058 . tm1 " You cannot change footnote marker style without
12059 . tm1 " first breaking to a new page with NEWPAGE.
12060 . tm1 " Ignoring request FOOTNOTE_MARKER_STYLE STAR at line \\n[.c].
12064 . if \\n[#RUN_ON]=1 \{\
12065 . tm1 "[mom]: FOOTNOTE_MARKER_STYLE STAR at line \\n[.c] is incompatible
12066 . tm1 " with RUN_ON footnotes. Ignoring request.
12069 . nr #FN_MARKER_STYLE 1
12070 . if \\n[#NEWPAGE]=1 .rr #NEWPAGE
12073 . if '\\$1'NUMBER' \{\
12074 . if \\n[#FN_MARKER_STYLE]=3 \{\
12075 . if !\\n[#NEWPAGE]=1 \{\
12076 . tm1 "[mom]: Your current FOOTNOTE_MARKER STYLE is NUMBER.
12077 . tm1 " You cannot change footnote marker style without
12078 . tm1 " first breaking to a new page with NEWPAGE.
12079 . tm1 " Ignoring request FOOTNOTE_MARKER_STYLE NUMBER at line \\n[.c].
12083 . if \\n[#RUN_ON]=1 \{\
12084 . tm1 "[mom]: FOOTNOTE_MARKER_STYLE NUMBER at line \\n[.c] is incompatible
12085 . tm1 " with RUN_ON footnotes. Ignoring request.
12088 . nr #FN_MARKER_STYLE 2
12090 . if '\\$1'NO_SUPERSCRIPT' .nr #NO_SUPERSCRIPT 1
12091 . if \\n[#NEWPAGE]=1 .rr #NEWPAGE
12094 . if '\\$1'LINE' \{\
12095 . nr #FN_MARKER_STYLE 3
12096 . FOOTNOTE_MARKERS OFF
12097 . if !\\n[#FN_LN_SEP] \
12098 . if !\\n[#FN_LN_BRACKETS] .FOOTNOTE_LINENUMBER_BRACKETS SQUARE
12102 \# FOOTNOTE NUMBER PLACEHOLDERS
12103 \# ----------------------------
12105 \# <number of placeholders>
12107 \# Sets register #FN_NUMBER_PLACEHOLDERS, used to establish whether to
12108 \# right pad a footnote number (in the footnote itself, not body copy).
12110 \# No default is set for this; user must determine if, and where, it's
12113 .MAC FOOTNOTE_NUMBER_PLACEHOLDERS END
12114 . nr #FN_NUMBER_PLACEHOLDERS \\$1
12117 \# FOOTNOTE LINENUMBER MARK
12118 \# ------------------------
12120 \# This string, when called inline, stores the current output line
12121 \# number in register #FN_MARK for use with FOOTNOTE.
12123 .ds FN_MARK \R'#FN_MARK \En[ln]'
12125 \# FOOTNOTE LINENUMBER SEPARATOR
12126 \# -----------------------------
12128 \# <user-defined separator>
12130 \# Stores user-defined separator (for use then
12131 \# FOOTNOTE_MARKER_STYLE is LINE) in string $FN_LN_SEP. The
12132 \# separator is intended to be used when the user wishes a
12133 \# separator, rather than the choice of brackets offered by
12134 \# FOOTNOTE_LINENUMBER_BRACKETS.
12136 .MAC FOOTNOTE_LINENUMBER_SEPARATOR END
12137 . rr #FN_LN_BRACKETS
12139 . ds $FN_LN_SEP "\\$1
12142 \# FOOTNOTE LINENUMBER BRACKETS
12143 \# ----------------------------
12145 \# PARENS | SQUARE | BRACES or ( | [ | {
12147 \# Sets register #FN_LN_BRACKETS to 1, and creates strings
12148 \# $FN_OPEN_BRACKET and $FN_CLOSE_BRACKET according to the given
12151 .MAC FOOTNOTE_LINENUMBER_BRACKETS END
12153 . nr #FN_LN_BRACKETS 1
12154 . if '\\$1'PARENS' \{\
12155 . ds $FN_OPEN_BRACKET (
12156 . ds $FN_CLOSE_BRACKET )
12159 . ds $FN_OPEN_BRACKET (
12160 . ds $FN_CLOSE_BRACKET )
12162 . if '\\$1'SQUARE' \{\
12163 . ds $FN_OPEN_BRACKET [
12164 . ds $FN_CLOSE_BRACKET ]
12167 . ds $FN_OPEN_BRACKET [
12168 . ds $FN_CLOSE_BRACKET ]
12170 . if '\\$1'BRACES' \{\
12171 . ds $FN_OPEN_BRACKET {
12172 . ds $FN_CLOSE_BRACKET }
12175 . ds $FN_OPEN_BRACKET {
12176 . ds $FN_CLOSE_BRACKET }
12180 \# RESET FOOTNOTE NUMBER
12181 \# ---------------------
12185 \# Resets register #FN_NUMBER to 1. If argument is PAGE, creates
12186 \# toggle #RESET_FN_NUMBER which is checked in HEADER. If 1,
12187 \# numbered footnotes on every page start at 1.
12189 .MAC RESET_FOOTNOTE_NUMBER END
12190 . ie '\\$1'' .nr #FN_NUMBER 0 1
12191 . el .nr #RESET_FN_NUMBER 1
12194 \# FOOTNOTE RULE LENGTH
12195 \# --------------------
12197 \# <length of rule used to separate footnotes from running text>
12199 \# Creates or modifies registers #FN_RULE_LENGTH.
12201 \# Requires unit of measure (iPpcm).
12202 \# Default is 4P for both PRINTSTYLEs.
12204 .MAC FOOTNOTE_RULE_LENGTH END
12205 . nr #FN_RULE_LENGTH (\\$1)
12208 \# FOOTNOTE_RULE_ADJ
12209 \# -----------------
12211 \# <number of points to raise footnote rule from it's baseline position>
12213 \# Creates or modifies register #FN_RULE_ADJ.
12215 \# Default is 3p for both TYPESTYLES.
12217 \# Requires unit of measure.
12219 .MAC FOOTNOTE_RULE_ADJ END
12220 . nr #FN_RULE_ADJ (\\$1)
12226 \# <none> | <anything>
12228 \# Turns printing of footnote separator rule on or off. If invoked as
12229 \# PRINT_FOOTNOTE_RULE, prints footnote separator rule.
12233 \# Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
12234 \# if the footnote number (#FN_COUNT) is 1.
12236 .MAC FOOTNOTE_RULE END
12237 . ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
12238 . if \\n[#FN_RULE]=0 .RLD 1v
12241 \v'-\\n[#FN_RULE_ADJ]u-\\n[#FN_RULE_WEIGHT_ADJ]u'\
12242 \D't \\n[#FN_RULE_WEIGHT]'\
12243 \h'-\\n[#FN_RULE_WEIGHT]u'\
12244 \D'l \\n[#FN_RULE_LENGTH]u 0'\
12245 \v'+\\n[#FN_RULE_ADJ]u+\\n[#FN_RULE_WEIGHT_ADJ]u'
12246 \!. ps \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
12247 . QUAD \\*[$FN_QUAD]
12250 . ie '\\$1'' .nr #FN_RULE 1
12251 . el .nr #FN_RULE 0
12255 \# FOOTNOTE SPACING
12256 \# ----------------
12258 \# <per item post footnote spacing> | <anything>
12260 \# Enables printing of post footnote spacing.
12262 \# Default is no space.
12264 .MAC FOOTNOTE_SPACING END
12265 . ie \B'\\$1' .ds $FN_SPACE \\$1
12269 \# RUN ON FOOTNOTES
12270 \# ----------------
12272 \# <none> | <anything>
12274 \# Toggles run-on footnotes on or off.
12276 .MAC FOOTNOTES_RUN_ON END
12278 . if \\n[#FN_COUNT]>0 \{\
12279 . tm1 "[mom]: Switching to run-on footnotes at line \\n[.c] will cause
12280 . tm1 " you to loose footnotes already formatted for this page.
12281 . tm1 " Ignoring request FOOTNOTES_RUN_ON.
12286 . if \\n[#FN_MARKER_STYLE]=1 .RUNON_WARNING
12287 . if \\n[#FN_MARKER_STYLE]=2 .RUNON_WARNING
12290 . if \\n[#FN_COUNT]>0 \{\
12291 . if \\n[#RUN_ON]=1 \{\
12292 . tm1 "[mom]: Switching off run-on footnotes at line \\n[.c] will cause
12293 . tm1 " you to loose footnotes already formatted for this page.
12294 . tm1 " Ignoring request FOOTNOTES_RUN_ON \\$1.
12302 .MAC RUNON_WARNING END
12303 . if \\n[#FN_MARKER_STYLE]=1 \{\
12304 . tm1 "[mom]: The footnote marker style active at line \\n[.c] is STAR,
12305 . tm1 " which is incompatible with run-on footnotes. Please change
12306 . tm1 " the footnote marker style to LINE. Continuing to process,
12307 . tm1 " but ignoring request FOOTNOTES_RUN_ON.
12310 . if \\n[#FN_MARKER_STYLE]=2 \{\
12311 . tm1 "[mom]: The footnote marker style active at line \\n[.c] is NUMBER,
12312 . tm1 " which is incompatible with run-on footnotes. Please change
12313 . tm1 " the footnote marker style to LINE. Continuing to process,
12314 . tm1 " but ignoring request FOOTNOTES_RUN_ON.
12322 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value> | <anything>
12324 \# Begins collecting and diverting footnote text if no argument
12325 \# given. Otherwise, ends diversion FOOTNOTES, measures footnote
12326 \# depth, and sets footnote trap.
12328 \# The input line preceding a footnote call MUST terminate with \c
12329 \# or the footnote marker will be spaced away from the word it
12330 \# should be joined to.
12332 \# If FOOTNOTE is invoked with INDENT, the footnote will
12333 \# be indented. An indent style and an indent value must be given.
12334 \# Subsequent footnotes will NOT be indented; INDENT must be given
12335 \# for each footnote the user wants indented.
12339 . if \\n[#UNDERLINE_ON] \{\
12341 . nr #UNDERLINE_WAS_ON_FN 1
12343 . if \\n[#FN_MARKER_STYLE]=3 \{\
12344 . if !\\n[#LINENUMBERS] \{\
12345 . tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
12346 . tm1 " FOOTNOTE_MARKER_STYLE is LINE.
12347 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
12349 . if \\n[#FN_MARK]=0 .nr #FN_MARK \\n[ln]
12350 . nr #FN_MARK_2 \\n[ln]
12351 . if '\\n[.z]'P_QUOTE' \{\
12355 . if \\n[#IN_DIVER]=1 \{\
12356 . if '\\n[.z]'P_QUOTE' \{\
12357 . if !\\n[#QUOTE_LN]=1 \{\
12358 . if !\\n[#SILENT_QUOTE_LN]=1 \{\
12359 . tm1 "[mom]: You have requested a line-numbered footnote inside a
12360 . tm1 " QUOTE at line \\n[.c], but line-numbering has not been enabled
12361 . tm1 " for QUOTES. Printing footnote with label "0".
12367 . if '\\n[.z]'B_QUOTE' \{\
12368 . if !\\n[#BQUOTE_LN]=1 \{\
12369 . if !\\n[#SILENT_BQUOTE_LN]=1 \{\
12370 . tm1 "[mom]: You have requested a line-numbered footnote inside a
12371 . tm1 " BLOCKQUOTE at line \\n[.c], but line-numbering has not been enabled
12372 . tm1 " for BLOCKQUOTES. Printing footnote with label "0".
12380 .\" Begin processing footnotes that occur inside QUOTE, BLOCKQUOTE
12382 . if \\n[#IN_DIVER]=1 \{\
12383 . nr #PAGE_POS \\n[nl]+\\n[.d]+\\n[#DOC_LEAD]
12384 . nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS]-1)
12385 . nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
12386 .\" Are we on a "defer" line? If so, defer the text of the footnote.
12387 . ie \\n[#SPACE_TO_FOOTER]<=\\n[#DOC_LEAD] \
12388 . nr #DIVER_FN 2 \" treat like a normal deferred footnote
12390 . nr #DIVER_FN 2 \" treat like a normal footnote
12391 . if \\n[#PAGE_POS]>\\n[#FOOTER_POS] \
12392 . nr #DIVER_FN 1 \" move this footnote
12393 .\" Test for situation where, because a final line of QUOTE, BLOCKQUOTE
12394 .\" or EPIGRAPH isn't yet adjusted at this point, the last word on the
12395 .\" line may *seem* to belong to the final line of the page, but will,
12396 .\" in fact, become the first word of the subsequent page. In such
12397 .\" circumstances, we want the the footnote to be treated as a "moved"
12398 .\" diversion footnote.
12399 . if \\n[.k]>\\n[.l] .nr #DIVER_FN 1
12400 . if r #DIVER_FN \{\
12401 . if !\\n[#DIVER_FN]=2 .\\n+[#DONE_ONCE]
12402 .\" A footnote inside a diversion will become the 1st footnote on the
12403 .\" following page/column.
12404 . if \\n[#DIVER_FN]=1 .DIVER_FN_1_PRE
12405 .\" A footnote inside a diversion that should be treated like a
12406 .\" normal footnote (including defers.)
12407 . if \\n[#DIVER_FN]=2 .DIVER_FN_2_PRE
12409 . nr #SAVED_FN_COUNT \\n[#FN_COUNT]+1
12410 . nr #SAVED_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]+1
12412 .\" End processing footnotes that occur inside QUOTE, BLOCKQUOTE or
12415 .\" Test for situation where, because a final line of running text
12416 .\" isn't yet adjusted at this point, the last word on the line may
12417 .\" *seem* to belong to the final line of the page, but will, in
12418 .\" fact, become the first word of the subsequent page. In such
12419 .\" circumstances, we want the footnote marker in running text to
12420 .\" be the correct one for the 1st footnote on the page.
12421 . if \\n[.k]>\\n[.l] \{\
12422 . if (\\n[nl]+\\n[#DOC_LEAD])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
12423 . ie \\n[#COLUMNS]=1 \{\
12424 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
12425 . if \\n[#FN_MARKER_STYLE]=1 .nr #FN_COUNT_FOR_COLS 0 1
12426 . if \\n[#FN_MARKER_STYLE]=2 \{\
12427 . if \\n[#RESET_FN_NUMBER] \{\
12428 . nr #FN_NUMBER 0 1
12429 . nr #NOT_YET_ADJUSTED 1
12435 . if \\n[#FN_MARKER_STYLE]=1 .nr #FN_COUNT 0 1
12436 . if \\n[#FN_MARKER_STYLE]=2 \{\
12437 . if \\n[#RESET_FN_NUMBER] \{\
12438 . nr #FN_NUMBER 0 1
12439 . nr #NOT_YET_ADJUSTED 1
12445 . if \\n[#FN_MARKERS] \{\
12447 . if \\n[#CONDENSE] \*[CONDX]\c
12448 . if \\n[#EXTEND] \*[EXTX]\c
12449 .\" Add footnote markers to running text...
12450 . if !\\n[#NO_FN_MARKER] \{\
12451 .\" ...but not if TERMINATE has not been called
12452 . if !r#TERMINATE \{\
12453 .\" Marker style star/dagger/double-dagger
12454 . if \\n[#FN_MARKER_STYLE]=1 \{\
12455 .\" Columnar docs either move col to col, or last col to next page.
12456 .\" They require their own special FN_COUNT because regular FN_COUNT
12457 .\" is used to figure out things like whether or not to put a rule
12458 .\" above footnotes (in addition to keeping track of the footnote
12459 .\" count in non-columnar docs).
12460 . ie \\n[#COLUMNS]=1 \{\
12461 . if \\n[#FN_COUNT_FOR_COLS]=0 .PRINT \*[BU2]*\c
12462 . if \\n[#FN_COUNT_FOR_COLS]=1 .PRINT \*[BU1]\[dg]\c
12463 . if \\n[#FN_COUNT_FOR_COLS]=2 .PRINT \[dd]\c
12464 . if \\n[#FN_COUNT_FOR_COLS]=3 .PRINT \*[BU2]**\c
12465 . if \\n[#FN_COUNT_FOR_COLS]=4 .PRINT \*[BU1]\[dg]\[dg]\c
12466 . if \\n[#FN_COUNT_FOR_COLS]=5 .PRINT \[dd]\[dd]\c
12467 . if \\n[#FN_COUNT_FOR_COLS]=6 .PRINT \*[BU2]***\c
12468 . if \\n[#FN_COUNT_FOR_COLS]=7 .PRINT \*[BU1]\[dg]\[dg]\[dg]\c
12469 . if \\n[#FN_COUNT_FOR_COLS]=8 .PRINT \[dd]\[dd]\[dd]\c
12470 . if \\n[#FN_COUNT_FOR_COLS]=9 .PRINT \*[BU2]****\c
12473 . if \\n[#FN_COUNT]=0 .PRINT \*[BU2]*\c
12474 . if \\n[#FN_COUNT]=1 .PRINT \*[BU1]\[dg]\c
12475 . if \\n[#FN_COUNT]=2 .PRINT \[dd]\c
12476 . if \\n[#FN_COUNT]=3 .PRINT \*[BU2]**\c
12477 . if \\n[#FN_COUNT]=4 .PRINT \*[BU1]\[dg]\[dg]\c
12478 . if \\n[#FN_COUNT]=5 .PRINT \[dd]\[dd]\c
12479 . if \\n[#FN_COUNT]=6 .PRINT \*[BU2]***\c
12480 . if \\n[#FN_COUNT]=7 .PRINT \*[BU1]\[dg]\[dg]\[dg]\c
12481 . if \\n[#FN_COUNT]=8 .PRINT \[dd]\[dd]\[dd]\c
12482 . if \\n[#FN_COUNT]=9 .PRINT \*[BU2]****\c
12485 .\" Marker style superscript numbers
12486 . if \\n[#FN_MARKER_STYLE]=2 \{\
12487 . if \\n[#PRINT_STYLE]=1 \
12489 "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#FN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
12490 . if \\n[#PRINT_STYLE]=2 \
12492 "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]\c"
12497 .\" More housekeeping
12499 .\" #SPACE_REMAINING is the space left between where we are
12500 .\" on the page and the bottom margin. It's used to determine whether
12501 .\" or not the footnote will overflow, and how many lines of
12502 .\" footnotes will fit on the page if some have to overflow.
12503 . ie \\n[#DIVER_FN]=2 \
12504 . nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-(\\n[#PAGE_POS])
12506 . nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[nl]
12507 . if \\n[#FROM_DIVERT_FN]=1 \{\
12508 . nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]
12509 . rr #FROM_DIVERT_FN
12511 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
12513 . if \\n[#INDENT_FIRST_PARAS] .nr #INDENT_FIRSTS 1
12514 . INDENT_FIRST_PARAS
12515 .\" Prepare FOOTNOTE to receive footnote text.
12517 . ll \\n[#DOC_L_LENGTH]u
12519 . if \\n[#COLUMNS]=1 \{\
12520 . ll \\n[#COL_L_LENGTH]u
12523 . if \\n[#FN_R_INDENT] \{\
12524 . ll -\\n[#FN_R_INDENT]u
12527 . if \\n[#FN_BR_INDENT] \{\
12528 . ll -\\n[#FN_BR_INDENT]u
12531 . FAMILY \\*[$FN_FAM]
12533 . ps \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
12534 . vs \\n[.ps]u+\\n[#FN_AUTOLEAD]u
12535 . QUAD \\*[$FN_QUAD]
12536 . if \\n[#PRINT_STYLE]=1 \{\
12538 . ie \\n[#SINGLE_SPACE] .vs \\n[#ORIGINAL_DOC_LEAD]u
12539 . el .vs \\n[#ORIGINAL_DOC_LEAD]u/2u
12543 . nr #FN_LEAD \\n[#LEAD]
12544 .\" Begin diversion FOOTNOTES or FN_IN_DIVER
12545 . ie r#COUNTERS_RESET \{\
12546 . ie \\n[#DONE_ONCE]=1 \{\
12547 . ie \\n[#RUN_ON] \{\
12548 . di RUNON_FN_IN_DIVER
12549 . nr #RUNON_FN_IN_DIVER 1
12551 . el .di FN_IN_DIVER
12554 . ie \\n[#RUN_ON] \{\
12555 . da RUNON_FN_IN_DIVER
12556 . nr #RUNON_FN_IN_DIVER 1
12558 . el .da FN_IN_DIVER
12563 . ie \\n[#RUN_ON] \{\
12564 . da RUNON_FOOTNOTES
12565 . nr #RUNON_FOOTNOTES 1
12569 . if \\n[#FOOTNOTE_COLOR]=1 \{\
12572 \m[\\*[$FOOTNOTE_COLOR]]
12577 . if \\n[#EPIGRAPH] .nr #FN_FOR_EPI 1
12578 .\" When a deferred footnote is also the 1st footnote on the page,
12579 .\" and when the page it's output on also has footnotes, some
12580 .\" whitespace is needed between the deferred footnote and the
12581 .\" first footnote belonging to the output page so that there's
12582 .\" no confusion when two stars (or two number 1s) appear in
12584 . if \\n[#FN_DEFER_SPACE] \{\
12585 .\" ...but only add the extra space if TERMINATE has not been called
12586 . if !r#TERMINATE \{\
12587 .\" ...and not if defer space has already been added
12588 . if !\\n[#DEFER_SPACE_ADDED] \{\
12589 .\" ...and not if the footnote count the last time we checked for
12590 .\" a defer situation inside a diversion is greater than 1.
12591 . if !\\n[#SAVED_DIVER_FN_COUNT]>1 \{\
12592 . if \\n[#FN_MARKER_STYLE]=1 .ALD 1v
12593 . if \\n[#RESET_FN_NUMBER] .ALD 1v
12594 . nr #DEFER_SPACE_ADDED 1
12598 . rr #FN_DEFER_SPACE
12599 . rr #SAVED_DIVER_FN_COUNT
12601 . if \\n[#DIVERTED]=3 \{\
12602 . if \\n[#FN_COUNT]>0 \{\
12606 .\" Add footnote rule (or, if no rule, some whitespace).
12607 .\" N.B.- this line increments #FN_COUNT each and every time FOOTNOTE
12609 . if \\n+[#FN_COUNT]=1 \{\
12610 .\" If a footnote is called in a diversion, and the footnote has to
12611 .\" be moved, don't put in the rule now (it's taken care of when
12612 .\" FN_IN_DIVER is output into FOOTNOTE in PROCESS_FN_IN_DIVER).
12613 . if !\\n[#DONT_RULE_ME]=1 \{\
12614 . if !\\n[#FN_DEPTH] \{\
12615 . if \\n[#PRINT_STYLE]=1 \{\
12616 . if !\\n[#RUN_ON] .sp \\n[#DOC_LEAD]u
12618 . ie \\n[#FN_RULE]=1 \{\
12619 . if !\\n[#RUN_ON] \{\
12620 . if \\n[#SINGLE_SPACE] .sp \\n[#DOC_LEAD]u
12621 . PRINT_FOOTNOTE_RULE
12622 . if !'\\*[$FN_SPACE]'' .sp -\\*[$FN_SPACE]
12631 . ds $RESTORE_SS_VAR \\*[$SS_VAR]
12633 .\" Add footnote markers to footnote text...
12634 . ie \\n[#FN_MARKERS] \{\
12635 . if !'\\*[$FN_SPACE]'' \{\
12636 . if \\n[#FN_COUNT]>0 .ALD \\*[$FN_SPACE]
12638 . if !\\n[#NO_FN_MARKER] \{\
12639 .\" ...but not if TERMINATE has been called.
12640 . if !r#TERMINATE \{\
12641 . if \\n[#REF]=1 \{\
12642 . nr #REF_FN_INDENT (u;\\*[$REF_FN_INDENT])
12643 . ti \\n[#REF_FN_INDENT]u
12645 . if \\n[#FN_MARKER_STYLE]=1 \{\
12646 . ie \\n[#COLUMNS]=1 \{\
12647 . \\n+[#FN_COUNT_FOR_COLS]
12648 . if \\n[#FN_COUNT_FOR_COLS]=1 .PRINT *\c
12649 . if \\n[#FN_COUNT_FOR_COLS]=2 .PRINT \[dg]\c
12650 . if \\n[#FN_COUNT_FOR_COLS]=3 .PRINT \[dd]\c
12651 . if \\n[#FN_COUNT_FOR_COLS]=4 .PRINT **\c
12652 . if \\n[#FN_COUNT_FOR_COLS]=5 .PRINT \[dg]\[dg]\c
12653 . if \\n[#FN_COUNT_FOR_COLS]=6 .PRINT \[dd]\[dd]\c
12654 . if \\n[#FN_COUNT_FOR_COLS]=7 .PRINT ***\c
12655 . if \\n[#FN_COUNT_FOR_COLS]=8 .PRINT \[dg]\[dg]\[dg]\c
12656 . if \\n[#FN_COUNT_FOR_COLS]=9 .PRINT \[dd]\[dd]\[dd]\c
12657 . if \\n[#FN_COUNT_FOR_COLS]=10 .PRINT ****\c
12660 . if \\n[#FN_COUNT]=1 .PRINT *\c
12661 . if \\n[#FN_COUNT]=2 .PRINT \[dg]\c
12662 . if \\n[#FN_COUNT]=3 .PRINT \[dd]\c
12663 . if \\n[#FN_COUNT]=4 .PRINT **\c
12664 . if \\n[#FN_COUNT]=5 .PRINT \[dg]\[dg]\c
12665 . if \\n[#FN_COUNT]=6 .PRINT \[dd]\[dd]\c
12666 . if \\n[#FN_COUNT]=7 .PRINT ***\c
12667 . if \\n[#FN_COUNT]=8 .PRINT \[dg]\[dg]\[dg]\c
12668 . if \\n[#FN_COUNT]=9 .PRINT \[dd]\[dd]\[dd]\c
12669 . if \\n[#FN_COUNT]=10 .PRINT ****\c
12672 . if \\n[#FN_MARKER_STYLE]=2 \{\
12673 . ds $FN_NUMBER \\n[#FN_NUMBER]
12674 . length #FN_NUMBER_LENGTH \\*[$FN_NUMBER]
12675 . if \\n[#COLUMNS]=1 \{\
12676 . \\n+[#FN_COUNT_FOR_COLS]
12678 . if \\n[#NOT_YET_ADJUSTED]=1 \{\
12679 . nr #FN_NUMBER 1 1
12680 . rr #NOT_YET_ADJUSTED
12682 . if \\n[#PRINT_STYLE]=1 \{\
12683 . ie \\n[#NO_SUPERSCRIPT] \{\
12684 . ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACEHOLDERS] \
12685 . PRINT "\0(\\n[#FN_NUMBER])\|\c"
12687 . PRINT "(\\n[#FN_NUMBER])\|\c"
12690 . ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACEHOLDERS] \
12692 "\s-2\v'-\\n[.v]u/5u'\0\\n[#FN_NUMBER]\|\v'+\\n[.v]u/5u'\s+2\|\c"
12695 "\s-2\v'-\\n[.v]u/5u'\\n[#FN_NUMBER]\|\v'+\\n[.v]u/5u'\s+2\|\c"
12698 . if \\n[#PRINT_STYLE]=2 \{\
12699 . ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACEHOLDERS] \
12700 . PRINT "\*[SUP]\0\\n[#FN_NUMBER]\*[SUPX]\*[FU 3]\c"
12702 . PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\*[FU 3]\c"
12709 .\" Line-numbered footnotes handling
12710 . if \\n[#FN_MARKER_STYLE]=3 \{\
12711 . if \\n[#FN_SPACE]>0 \{\
12712 . if !\\n[#RUN_ON]=1 \
12713 . if \\n[#FN_COUNT]>0 .ALD \\n[#FN_SPACE]u
12715 . if \\n[#REF]=1 \{\
12716 . if !\\n[#RUN_ON]=1 \{\
12717 \!. ti +\\n[#REF_FN_INDENT]u
12720 . ie \\n[#FN_LN_BRACKETS]=1 \{\
12721 . ds $FN_LINENUMBER \v'-.085m'\\*[$FN_OPEN_BRACKET]\v'.085m'
12722 . ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \
12723 . as $FN_LINENUMBER \
12724 \\n[#FN_MARK]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m'\h'.25m'
12726 . as $FN_LINENUMBER \
12727 \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\v'-.085m'\
12728 \\*[$FN_CLOSE_BRACKET]\v'.085m'\h'.25m'
12731 . ie \\n[#FN_MARK_2]=\\n[#FN_MARK] \
12732 . ds $FN_LINENUMBER \\n[#FN_MARK]\\*[$FN_LN_SEP]
12734 . ds $FN_LINENUMBER \
12735 \\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\\*[$FN_LN_SEP]
12738 . if !\\n[#NO_FN_MARKER] \
12739 . PRINT \\*[$FN_LINENUMBER]\c
12740 . rm $FN_LINENUMBER
12746 .\" If INDENT arg is passed to FOOTNOTE, calculate the indent...
12747 . ie '\\$1'INDENT' \{\
12749 . if '\\$2'L' .in (\\$3)
12750 . if '\\$2'LEFT' .in (\\$3)
12751 . if '\\$2'R' .nr #FN_R_INDENT (\\$3)
12752 . if '\\$2'RIGHT' .nr #FN_R_INDENT (\\$3)
12754 . nr #FN_BL_INDENT (\\$3)
12755 . ie '\\$4'' .nr #FN_BR_INDENT \\n[#FN_BL_INDENT]
12756 . el .nr #FN_BR_INDENT (\\$4)
12757 . in \\n[#FN_BL_INDENT]u
12759 . if '\\$2'BOTH' \{\
12760 . nr #FN_BL_INDENT (\\$3)
12761 . ie '\\$4'' .nr #FN_BR_INDENT \\n[#FN_BL_INDENT]
12762 . el .nr #FN_BR_INDENT (\\$4)
12763 . in \\n[#FN_BL_INDENT]u
12766 .\" ...then re-run FOOTNOTE without an argument.
12771 .\" Add "defer space" if the previously diverted footnote was the
12772 .\" 1st footnote proper to its page (i.e. it looks like a deferred
12773 .\" footnote but it's really an overflow).
12774 . if \\n[#DIVERTED] \{\
12775 . if \\n[#PREV_FN_DEFERRED]=1 \{\
12776 . if \\n[#FN_MARKER_STYLE]=1 .ALD \\n[#FN_LEAD]u
12777 . if \\n[#RESET_FN_NUMBER] .ALD \\n[#FN_LEAD]u
12778 . nr #PREV_FN_DEFERRED 2
12781 . if \\n[#REF]=1 \{\
12784 .\" Terminate FOOTNOTES or FN_IN_DIVER diversion
12786 . HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
12788 .\" More housekeeping
12789 .\" Turn off indent possibly set by FOOTNOTE INDENT
12792 . if \\n[#UNDERLINE_WAS_ON_FN] \{\
12794 . rr #UNDERLINE_WAS_ON_FN
12796 .\" Restore sentence spacing
12797 . if \\n[#PRINT_STYLE]=2 \{\
12798 . if d $RESTORE_SS_VAR .SS \\*[$RESTORE_SS_VAR]
12799 . rm $RESTORE_SS_VAR
12803 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
12804 . if !\\n[#INDENT_FIRSTS] .INDENT_FIRST_PARAS OFF
12805 . rr #INDENT_FIRSTS
12806 .\" Calculate footnote depth, but not if #COUNTERS_RESET (created in
12807 .\" DIVER_FN_1_PRE) to instruct FOOTNOTES to skip this step for now
12808 .\" (it's taken care of when FN_IN_DIVER is output into FOOTNOTES in
12809 .\" PROCESS_FN_IN_DIVER).
12810 . ie r#COUNTERS_RESET .rr #COUNTERS_RESET
12813 .\" If the footnote is the 1st on the page and it falls too close
12814 .\" to the bottom margin, defer the footnote text to the next page...
12815 . if (\\n[#SPACE_REMAINING]-1)<=(\\n[.v]) \{\
12816 .\" ...but not if PROCESS_FN_LEFTOVER has set #PREV_FN_DEFERRED to 1
12817 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
12819 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
12821 .\" This is required so that the defer space clause can distinguish
12822 .\" a real #FN_COUNT=1 from one generated if FOOTNOTE is run inside
12823 .\" QUOTE, BLOCKQUOTE or EPIGRAPH
12824 . if \\n[#DIVER_FN]=2 \{\
12825 . nr #SAVED_DIVER_FN_COUNT \\n[#FN_COUNT]
12830 .\" Calculate the footnote depth.
12831 . if \\n[#GET_DEPTH]=1 \{\
12832 .\" Save the previous footnote depth (for use when there will be
12833 .\" some overflowed footnote text).
12834 . nr #SAVED_FN_DEPTH_1 \\n[#FN_DEPTH]
12835 .\" Add the depth of the current footnote to any already existent
12837 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
12838 .\" Special handling for run-on footnotes
12839 . if \\n[#RUN_ON]=1 \{\
12840 . if \\n[#RUNON_FOOTNOTES] .unformat RUNON_FOOTNOTES
12841 . if \\n[#RUNON_FN_IN_DIVER] .unformat RUNON_FN_IN_DIVER
12843 .\" Recreate FOOTNOTES with rule followed by text of unformatted
12844 .\" run-on footnotes.
12846 . ie \\n[#FN_RULE]=0 .RLD 1v
12848 \v'-\\n[#FN_RULE_ADJ]u-\\n[#FN_RULE_WEIGHT_ADJ]u'\
12849 \D't \\n[#FN_RULE_WEIGHT]'\
12850 \h'-\\n[#FN_RULE_WEIGHT]u'\
12851 \D'l \\n[#FN_RULE_LENGTH]u 0'\
12852 \v'+\\n[#FN_RULE_ADJ]u+\\n[#FN_RULE_WEIGHT_ADJ]u'
12855 . if \\n[#RUNON_FOOTNOTES] \{\
12857 . rr #RUNON_FOOTNOTES
12859 . if \\n[#RUNON_FN_IN_DIVER] \{\
12860 . RUNON_FN_IN_DIVER
12861 . rr #RUNON_FN_IN_DIVER
12866 . nr #FN_DEPTH \\n[#DIVER_DEPTH]
12867 . nr #SAVED_VFP 0+\\n[#VARIABLE_FOOTER_POS]
12868 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
12870 .\" Save the new depth
12871 . nr #SAVED_FN_DEPTH_2 \\n[#FN_DEPTH]
12872 .\" Signal that defer space should be added when PROCESS_FN_LEFTOVER
12873 .\" processes deferred footnotes.
12874 . if \\n[#FN_DEFER] \{\
12875 . if \\n[#FN_COUNT]=2 \{\
12876 . ie \\n[#COLUMNS] \{\
12877 . if !\\n[#FROM_FOOTER] \{\
12878 . if \\n[#FN_DEFER]=1 .nr #FN_DEFER_SPACE 1
12879 . if \\n[#FN_COUNT_FOR_COLS]>=1 .rr #FN_DEFER_SPACE
12880 . if \\n[#FROM_HEADER] .nr #FN_DEFER_SPACE 1
12883 . el .nr #FN_DEFER_SPACE 1
12887 .\" If the depth of the whole footnote won't fit in the space
12888 .\" between where we are on the page and the bottom margin, calculate
12889 .\" how much of it will fit.
12890 . if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
12892 . while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
12893 . nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
12895 . nr #VFP_DIFF \\n[#FN_DEPTH]-\\n[#SAVED_FN_DEPTH_1]
12897 .\" Very occasionally, #VFP_DIFF, on a 1st footnote that isn't to
12898 .\" be deferred, comes up with a depth equal to exactly 1 line
12899 .\" of footnotes, i.e. enough room to print the rule and nothing
12900 .\" else. The following tests for such a condition, and rather than
12901 .\" attempting to treat the footnote as an overflow, it tells mom to
12902 .\" treat it as a special kind of deferred footnote (#FN_DEFER 2).
12903 . if \\n[#SAVED_FN_DEPTH_1]=0 \{\
12904 . if \\n[#FN_DEPTH]=\\n[#FN_LEAD] \{\
12906 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_2]
12911 .\" Calculate VFP based on whether the footnote overflows, or is to
12912 .\" be treated normally.
12913 . ie \\n[#OVERFLOW]=1 \{\
12914 . if \\n[#RUN_ON] \{\
12915 . rr #VARIABLE_FOOTER_POS
12916 . nr #VARIABLE_FOOTER_POS \\n[#SAVED_VFP]
12918 . ie \\n[#FN_COUNT]=1 \{\
12919 . ie \\n[#RULED]=1 \{\
12920 . ie \\n[#COLUMNS]=1 \{\
12921 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
12922 . ie \\n[#FROM_FOOTER] \{\
12923 . ie \\n[#FN_COUNT_FOR_COLS]>1 \{\
12924 . nr #FN_DEPTH -\\n[#FN_DEPTH]
12925 . if \\n[#DIVERTED]=1 .nr #DIVERTED 3
12926 . if !\\n[#PREV_FN_DEFERRED]=1 \
12927 . nr #FN_DEPTH -\\n[#VFP_DIFF]
12930 . nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
12931 . if \\n[#DIVERTED]=1 .nr #DIVERTED 3
12934 . el .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
12936 . el .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
12938 . el .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
12941 . nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
12942 . if \\n[#DIVERTED]=1 .nr #DIVERTED 3
12943 . if !\\n[#PREV_FN_DEFERRED]=1 \{\
12944 . ie \\n[#COLUMNS]=1 \{\
12945 . if !\\n[#FROM_FOOTER] .
12947 . el .nr #FN_DEPTH -\\n[#VFP_DIFF]
12949 . if \\n[#DIVERTED]=3 \{\
12950 . if !\\n[#PREV_FN_DEFERRED] \{\
12951 . if !\\n[#FROM_FOOTER] \{\
12952 . if \\n[#FN_COUNT]=1 \{\
12953 . if !\\n[#VFP_DIFF] \{\
12954 . if \\n[#FN_MARKER_STYLE]=1 \{\
12956 \!. ALD \\n[#FN_LEAD]u
12959 . if \\n[#RESET_FN_NUMBER] \{\
12961 \!. ALD \\n[#FN_LEAD]u
12970 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
12973 . nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
12974 . nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
12980 . nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
12981 . if \\n[#PREV_FN_DEFERRED]=1 \{\
12982 . if \\n[#DIVERTED] \{\
12983 . if !\\n[#FN_DEPTH]=\\n[#SAVED_FN_DEPTH_1] \{\
12984 . nr #FN_DEPTH +\\n[#FN_LEAD]
12985 . nr #VARIABLE_FOOTER_POS -\\n[#FN_LEAD]
12986 . rr #PREV_FN_DEFERRED
12990 . if \\n[#FN_COUNT]>1 \{\
12998 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
12999 .\" If we have a footnote whose text has to be deferred to the next
13000 .\" page, reset the FOOTER trap to its original location.
13001 . if \\n[#FN_DEFER] \{\
13002 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
13003 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13006 . nr #NO_FN_MARKER 0
13008 . if \\n[#NUM_ARGS]=2 \{\
13009 . if '\\$2'BREAK' .BR
13014 \# Utility macros to manage footnotes that occur inside diversions
13015 \# ---------------------------------------------------------------
13017 \# There are some redundancies here; they're left in in case unforeseen
13018 \# footnote situations crop up in the future that might require
13019 \# manipulation of them.
13021 \# 1. Pre-footnote processing for footnotes in diversions
13023 \# a) A footnote inside a diversion will be moved entirely (marker
13024 \# in running text and text of footnote) to the next page/column.
13026 .MAC DIVER_FN_1_PRE END
13027 . nr #RESET_FN_COUNTERS 1
13028 . nr #COUNTERS_RESET 1
13029 . if \\n[#DONE_ONCE]=1 \{\
13030 . if \\n[#FN_DEFER] \{\
13031 . if \\n[#SAVED_DIVER_FN_COUNT]=1 \{\
13032 . ie \\n[#COLUMNS]=1 \
13033 . if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_DEFER_SPACE 1
13034 . el .nr #FN_DEFER_SPACE 1
13037 . if \\n[#FN_MARKER_STYLE]=1 \{\
13038 . if \\n[#FN_COUNT]>0 .nr #FN_COUNT 0 1
13039 . if \\n[#COLUMNS]=1 \
13040 . if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_COUNT_FOR_COLS 0 1
13042 . if \\n[#FN_MARKER_STYLE]=2 \{\
13043 . if \\n[#RESET_FN_NUMBER]=1 \{\
13044 . ie \\n[#COLUMNS]=1 \
13045 . if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_NUMBER 0 1
13046 . el .nr #FN_NUMBER 0 1
13052 \# b) Treat as a normal footnote, including defers.
13054 .MAC DIVER_FN_2_PRE END
13055 . nr #RESET_FN_COUNTERS 2
13058 \# 2. Post-footnote processing for footnotes in diversions
13060 \# Even when a footnote inside a diversion is treated as
13061 \# "normal," some manipulation of registers is required. The
13062 \# macro is called in DO_QUOTE (i.e. at the termination of
13063 \# quotes and blockquotes) and in DO_EPIGRAPH.
13065 .MAC DIVER_FN_2_POST END
13066 . if \\n[#DONE_ONCE]=1 \{\
13067 . if \\n[#FN_MARKER_STYLE]=1 \{\
13068 . if \\n[#FN_COUNT]=0 .nr #DONT_RULE_ME 1
13069 . if \\n[#FN_COUNT]>0 .nr #FN_COUNT 0 1
13070 . if \\n[#COLUMNS]=1 \{\
13071 . if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_COUNT_FOR_COLS 0 1
13072 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] .
13075 . if \\n[#FN_MARKER_STYLE]=2 \{\
13076 . if \\n[#FN_COUNT]=0 .nr #DONT_RULE_ME 1
13077 . if \\n[#FN_COUNT]>0 .nr #FN_COUNT 0 1
13078 . if \\n[#RESET_FN_NUMBER]=1 \{\
13079 . ie \\n[#COLUMNS]=1 \
13080 . if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_NUMBER 0 1
13081 . el .nr #FN_NUMBER 0 1
13087 \# The main macros that handle footnote processing.
13088 \# -----------------------------------------------
13090 \# FN_OVERFLOW_TRAP starts off "underneath" FOOTER, but is revealed
13091 \# as #VARIABLE_FOOTER_POSITION changes the position of FOOTER.
13092 \# FN_OVERFLOW_TRAP simply starts diversion FN_OVERFLOW to "catch"
13093 \# the overflow. The diversion is ended in FOOTER, immediately after
13094 \# FOOTER outputs the diversion, FOOTNOTES, before PROCESS_FN_LEFTOVER
13095 \# is run (either in HEADER, or in FOOTER if moving col to col).
13097 .MAC FN_OVERFLOW_TRAP END
13098 . if \\n[#FN_COUNT] \{\
13100 . ie !\\n[#NO_BACK_UP]=1 \{\
13101 . if \\n[#PREV_FN_DEFERRED] \{\
13102 . ie \\n[#COLUMNS]=1 \{\
13103 . if \\n[#FROM_FOOTER] \{\
13104 . if \\n[#PREV_FN_DEFERRED] \{\
13105 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \
13106 . rr #PREV_FN_DEFERRED
13109 . if !\\n[#FROM_FOOTER] \{\
13110 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13111 . if !\\n[#LAST_FN_COUNT_FOR_COLS]>1 \{\
13112 \!. RLD \\n[#FN_LEAD]u
13118 \!. RLD \\n[#FN_LEAD]u
13124 . rr #PREV_FN_DEFERRED
13127 .\" When #FROM_DIVERT_FN is 1, it signals to FOOTNOTE, when run from
13128 .\" within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING to the total
13129 .\" area allowable for running text.
13130 \#. nr #FROM_DIVERT_FN 1
13133 \# PROCESS_FN_LEFTOVER is called at the top of HEADER, and in
13134 \# FOOTER if we're moving from one column to the next (i.e. after
13135 \# outputting FOOTNOTES). It checks for whether we have a "deferred
13136 \# footnote" situation, and resets counters and number registers
13137 \# accordingly. Lastly, if we have some footnote overflow, it calls
13138 \# DIVERT_FN_OVERFLOW.
13140 .MAC PROCESS_FN_LEFTOVER END
13141 . if \\n[#PREV_FN_DEFERRED]=2 \
13142 . if \\n[#FN_COUNT_AT_FOOTER]>1 .rr #PREV_FN_DEFERRED
13143 . ie !\\n[#FN_DEFER] \{\
13146 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
13149 . if \\n[#FN_DEFER]=1 .nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
13150 . if \\n[#FN_DEFER]=2 \{\
13152 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
13155 . nr #SPACE_REMAINING 0
13156 . ch FOOTER -\\n[#B_MARGIN]u
13157 . if \\n[#FN_DEFER] \{\
13158 . nr #NO_FN_MARKER 1
13162 . ie \\n[#COLUMNS]=1 \{\
13163 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
13164 . if !\\n[#FROM_FOOTER] \{\
13165 . if \\n[#FN_COUNT_FOR_COLS]=1 .nr #PREV_FN_DEFERRED 1
13169 . el .nr #PREV_FN_DEFERRED 1
13171 . if !\\n[#FN_DEFER] \
13172 . if \\n[#FN_OVERFLOW_DEPTH] .DIVERT_FN_LEFTOVER
13173 . ie \\n[#COLUMNS]=1 \{\
13174 . if \\n[#COL_NUM]>1 \
13175 . if \\n[#COL_NUM]=\\n[#NUM_COLS] .nr #FN_COUNT 0 1
13177 . el .nr #FN_COUNT 0 1
13178 . if \\n[#DIVER_FN]=2 .rr #DIVER_FN
13179 . rr #FROM_DIVERT_FN
13182 \# DIVERT_FN_LEFTOVER is called in PROCESS_FN_LEFTOVER (at
13183 \# the top of HEADER, and in FOOTER if we're moving from one column
13186 .MAC DIVERT_FN_LEFTOVER END
13187 . nr #NO_FN_MARKER 1
13193 . if \\n[#PREV_FN_DEFERRED] \{\
13194 . nr #FN_DEPTH -\\n[#FN_LEAD]
13195 . nr #VARIABLE_FOOTER_POS +\\n[#FN_LEAD]
13196 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
13197 . if \\n[#PREV_FN_DEFERRED]=2 \{\
13198 . nr #PREV_FN_DEFERRED 1
13202 . rr #FN_OVERFLOW_DEPTH
13205 \# This is a special macro to deal with footnotes that are set inside
13206 \# diversions (QUOTE, BLOCKQUOTE and EPIGRAPH). It's called in HEADER
13207 \# (and in FOOTER, if we're moving from column to column), and comes
13208 \# after PROCESS_FOOTNOTE_LEFTOVER in those two macros.
13210 .MAC PROCESS_FN_IN_DIVER END
13211 . nr #SPACE_REMAINING 0
13212 . ch FOOTER -\\n[#B_MARGIN]u
13213 . nr #NO_FN_MARKER 1
13214 . if !\\n[#RESET_FN_COUNTERS]=2 .rr #RESET_FN_COUNTERS
13216 . if \\n[#FN_OVERFLOW_DEPTH] .nf
13217 . ie dRUNON_FN_IN_DIVER \{\
13218 . RUNON_FN_IN_DIVER
13219 . rm RUNON_FN_IN_DIVER
13229 \# ====================================================================
13233 \# When endnotes are output, the spacing between the notes is always
13234 \# 1 extra linespace. This can have bottom margin consequences. If
13235 \# this doesn't bother you, don't worry about it. If it does bother
13236 \# you, and you want to adjust the spacing between any two endnotes (as
13237 \# they're output), make the spacing adjustments (.ALD/.RLD) at the
13238 \# *end* of endnotes (i.e. just before .ENDNOTE OFF), not at the top.
13240 \# Endnotes must be output manually with .ENDNOTES. This allows user
13241 \# the flexibility to output endnotes at the end of each collated
13242 \# document, or to output them at the end of the entire document.
13247 \# ENDNOTE POINT SIZE
13248 \# ------------------
13250 \# <base point size for endnotes>
13252 \# Creates or modifies register #EN_PS.
13254 \# Default is same as running text in body of document.
13256 \# This size control macro differs from other size control macros
13257 \# in that it sets an absolute point size, not a relative one. This
13258 \# is because a) endnotes always appear separate from the body of
13259 \# a document and therefore don't need to be relative to the body
13260 \# of the document, and b) there are quite a few elements of the
13261 \# endnotes page(s) that need to be relative to the base point size
13262 \# of that page. If the base endnote point size were relative to
13263 \# the body of the document (i.e. a _SIZE macro taking a +|- value)
13264 \# getting the rest of the endnote elements sized properly could
13265 \# become very confusing.
13267 .MAC ENDNOTE_PT_SIZE END
13268 . nr #EN_PS (p;\\$1)
13271 \# ENDNOTES, BIBLIOGRAPHY and TOC LEADING
13272 \# --------------------------------------
13274 \# <leading> [ ADJUST ]
13276 \# Depending on the name by which it's called, creates or modifies
13277 \# register #<type>_LEAD, where <type> is BIB, EN, or TOC. Creates or removes
13278 \# register #ADJ_<type>_LEAD. Stores arguments in strings if BIB,
13279 \# EN, or TOC leading are set before START.
13281 \# Default is same as doc lead for TYPESET, adjusted; 24 for TYPEWRITE.
13284 . if '\\$0'BIBLIOGRAPHY_LEAD' .ds $SECTION BIB
13285 . if '\\$0'ENDNOTE_LEAD' .ds $SECTION EN
13286 . if '\\$0'TOC_LEAD' .ds $SECTION TOC
13287 . ds $\\*[$SECTION]_LEAD \\$1
13288 . ds $ADJUST_\\*[$SECTION]_LEAD \\$2
13289 . if !\\n[#OK_PROCESS_LEAD] .return
13290 . nr #\\*[$SECTION]_LEAD (p;\\$1)
13291 . rr #ADJ_\\*[$SECTION]_LEAD
13292 . als \\*[$SECTION]_LEAD DOC_LEAD
13293 . if '\\$2'ADJUST' \{\
13294 . nr #ORIG_DOC_LEAD \\n[#UNADJUSTED_DOC_LEAD]
13295 . nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
13296 . nr #ADJ_DOC_LEAD 1
13297 . nr #ADJ_\\*[$SECTION]_LEAD 1
13298 . nr #NO_TRAP_RESET 1
13299 . \\*[$SECTION]_LEAD \\n[#\\*[$SECTION]_LEAD]u ADJUST
13300 . nr #\\*[$SECTION]_LEAD \\n[#DOC_LEAD]
13301 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
13302 . rr #NO_TRAP_RESET
13303 . nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
13304 . rr #ORIG_DOC_LEAD
13308 .ALIAS BIBLIOGRAPHY_LEAD _LEAD
13309 .ALIAS ENDNOTE_LEAD _LEAD
13310 .ALIAS TOC_LEAD _LEAD
13313 \# ----------------
13315 \# <per item endnote spacing> | <anything>
13317 \# Enables space between endnotes items.
13319 \# Default is no space.
13321 .MAC ENDNOTE_SPACING END
13322 . ie \B'\\$1' .ds $EN_SPACE \\$1
13326 \# ENDNOTES_HDRFTR_CENTER
13327 \# ----------------------
13331 \# Creates or removes toggle register #EN_HDRFTR_CENTER, used to
13332 \# determine whether mom should print a/the hdrftr center string
13333 \# on the endnotes page. Primarily to enable/disable printing of the
13334 \# chapter name in hdrftrs when DOCTYPE CHAPTER.
13338 .MAC ENDNOTES_HDRFTR_CENTER END
13339 . ie '\\$1'' .nr #EN_HDRFTR_CENTER 1
13340 . el .rr #EN_HDRFTR_CENTER
13346 \# <title for endnotes page>
13348 \# Creates or modifies string $EN_STRING.
13350 \# Default is "Endnotes"
13352 .MAC ENDNOTE_STRING END
13353 . ds $EN_STRING \\$1
13356 .MAC ENDNOTE_STRING_ADVANCE END
13357 . nr #EN_STRING_ADVANCE (\\$1)
13360 \# ENDNOTE STRING CAPS
13361 \# -------------------
13363 \# <none> | <anything>
13365 \# Turns capitalization of the endnotes pages title string
13366 \# "Endnotes" on or off.
13368 \# Users may want the endnotes pages title string to be in caps,
13369 \# but the toc entry for endnotes in lower case. If the argument
13370 \# to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
13371 \# turned on, this is exactly what will happen.
13375 .MAC ENDNOTE_STRING_CAPS END
13376 . ie '\\$1'' .nr #EN_STRING_CAPS 1
13377 . el .nr #EN_STRING_CAPS 0
13383 \# <string that appears before the first endnote pertaining to any document>
13385 \# Creates string $EN_TITLE.
13387 \# Default is the document title, or, if doc is a chapter, "Chapter #"
13389 .MAC ENDNOTE_TITLE END
13390 . ds $EN_TITLE \\$1
13393 \# ENDNOTE MARKER STYLE
13394 \# --------------------
13396 \# NUMBER | LINE | SUPERSCRIPT
13398 \# Sets register #EN_MARKER_STYLE, used in ENDNOTE to determine
13399 \# the style of endnote markers (labels).
13401 \# 1=NUMBER; 2=LINE. LINE means "use output line numbers".
13402 \# Default is NUMBER.
13404 .MAC ENDNOTE_MARKER_STYLE END
13405 . if '\\$1'NUMBER' .nr #EN_MARKER_STYLE 1
13406 . if '\\$1'LINE' \{\
13407 . nr #EN_MARKER_STYLE 2
13408 . if !\\n[#EN_LN_SEP] \
13409 . if !\\n[#EN_LN_BRACKETS] .ENDNOTE_LINENUMBER_BRACKETS SQUARE
13411 . if '\\$1'SUPERSCRIPT' .nr #EN_MARKER_STYLE 3
13414 \# ENDNOTE LINENUMBER MARK
13415 \# -----------------------
13417 \# This string, when called inline, stores the current output line
13418 \# number in register #EN_MARK for use with ENDNOTE.
13420 .ds EN_MARK \R'#EN_MARK \En[ln]'
13422 \# ENDNOTE LINENUMBER SEPARATOR
13423 \# ----------------------------
13425 \# <user-defined separator>
13427 \# Stores user-defined separator (for use then
13428 \# ENDNOTE_MARKER_STYLE is LINE) in string $EN_LN_SEP. The
13429 \# separator is intended to be used when the user wishes a
13430 \# separator, rather than the choice of brackets offered by
13431 \# ENDNOTE_LINENUMBER_BRACKETS.
13433 .MAC ENDNOTE_LINENUMBER_SEPARATOR END
13434 . rr #EN_LN_BRACKETS
13436 . ds $EN_LN_SEP "\\$1
13439 \# ENDNOTE LINENUMBER BRACKETS
13440 \# ---------------------------
13442 \# PARENS | SQUARE | BRACES or ( | [ | {
13444 \# Sets register #EN_LN_BRACKETS to 1, and creates strings
13445 \# $EN_OPEN_BRACKET and $EN_CLOSE_BRACKET according to the given argument.
13447 .MAC ENDNOTE_LINENUMBER_BRACKETS END
13449 . nr #EN_LN_BRACKETS 1
13450 . if '\\$1'PARENS' \{\
13451 . ds $EN_OPEN_BRACKET (
13452 . ds $EN_CLOSE_BRACKET )
13455 . ds $EN_OPEN_BRACKET (
13456 . ds $EN_CLOSE_BRACKET )
13458 . if '\\$1'SQUARE' \{\
13459 . ds $EN_OPEN_BRACKET [
13460 . ds $EN_CLOSE_BRACKET ]
13463 . ds $EN_OPEN_BRACKET [
13464 . ds $EN_CLOSE_BRACKET ]
13466 . if '\\$1'BRACES' \{\
13467 . ds $EN_OPEN_BRACKET {
13468 . ds $EN_CLOSE_BRACKET }
13471 . ds $EN_OPEN_BRACKET {
13472 . ds $EN_CLOSE_BRACKET }
13476 \# ENDNOTE LINENUMBER GAP
13477 \# ----------------------
13479 \# <space between line-number labels and endnotes text>
13481 \# Defines string $EN_LN_GAP, used during printing of line-number
13482 \# labels in ENDNOTE.
13484 .MAC ENDNOTE_LINENUMBER_GAP END
13485 . nr #EN_LN_GAP (u;\\$1)
13488 \# ENDNOTE NUMBERS ALIGNMENT
13489 \# -------------------------
13491 \# LEFT | RIGHT <max. number of digit placeholders that will appear in endnotes>
13493 \# Creates registers for _LEFT or _RIGHT; creates register
13494 \# #EN_NUMBER_PLACEHOLDERS.
13496 \# Default is for endnote numbers to be right aligned to 2 placeholders.
13498 .MAC ENDNOTE_NUMBERS_ALIGN END
13499 . if '\\$1'LEFT' \{\
13500 . rr #EN_NUMBERS_ALIGN_RIGHT
13501 . nr #EN_NUMBERS_ALIGN_LEFT 1
13503 . if '\\$1'RIGHT' \{\
13504 . rr #EN_NUMBERS_ALIGN_LEFT
13505 . nr #EN_NUMBERS_ALIGN_RIGHT 1
13507 . nr #EN_NUMBER_PLACEHOLDERS \\$2
13510 \# ENDNOTE PARAGRAPH INDENT
13511 \# ------------------------
13513 \# <first line indent of paras subsequent to 1st in endnotes>
13515 \# Creates register #EN_PP_INDENT for use in .PP.
13517 \# Requires a unit of measure.
13519 \# Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
13521 .MAC ENDNOTE_PARA_INDENT END
13522 . nr #EN_PP_INDENT (\\$1)
13525 \# TURN OFF COLUMN MODE FOR ENDNOTES
13526 \# ---------------------------------
13528 \# <none> | <anything>
13530 \# Creates or removes register #EN_NO_COLS
13532 \# Allows user to tell mom not to set endnotes in columnar
13533 \# documents in columns. Default is to set endnotes in columns.
13535 .MAC ENDNOTES_NO_COLUMNS END
13536 . ie '\\$1'' .nr #EN_NO_COLS 1
13537 . el .rr #EN_NO_COLS
13540 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
13541 \# -------------------------------------------
13543 \# <none> | <anything>
13545 \# Creates or removes register #EN_NO_FIRST_PN
13547 \# For use if FOOTERS are on. Tells ENDNOTES not to put a page
13548 \# number on the first endnotes page. Some users may want this.
13549 \# Default is to print a page number at the top of the first
13550 \# endnotes page when footers are on.
13552 .MAC ENDNOTES_NO_FIRST_PAGENUM END
13553 . ie '\\$1'' .nr #EN_NO_FIRST_PN 1
13554 . el .rr #EN_NO_FIRST_PN
13557 \# PAGE HEADERS ON ENDNOTES PAGES
13558 \# ------------------------------
13562 \# Creates or removes register #EN_ALLOWS_HEADERS or
13563 \# #EN_ALLOWS_HEADERS_ALL
13565 \# Whether ENDNOTES puts a page header at the top of endnotes
13566 \# pages if page headers are used throughout the document.
13567 \# Default is to insert the page headers, but not on the first
13568 \# page. If the optional argument ALL is given, ENDNOTES puts a
13569 \# page header on the first page as well.
13571 .MAC ENDNOTES_ALLOWS_HEADERS END
13572 . ie '\\$1'' .nr #EN_ALLOWS_HEADERS 1
13574 . ie '\\$1'ALL' \{\
13575 . nr #EN_ALLOWS_HEADERS 1
13576 . nr #EN_ALLOWS_HEADERS_ALL 1
13579 . nr #EN_ALLOWS_HEADERS 0
13580 . nr #EN_ALLOWS_HEADERS_ALL 0
13585 \# ENDNOTES PAGES PAGE NUMBERING STYLE
13586 \# -----------------------------------
13588 \# DIGIT | ROMAN | roman | ALPHA | alpha
13590 \# Creates or modifies $EN_PN_STYLE.
13592 \# Allows user to define what style should be used for endnotes
13593 \# pages page numbering. Arguments are the same as for
13596 \# Default is DIGIT.
13598 .MAC ENDNOTES_PAGENUM_STYLE END
13599 . ds $EN_PN_STYLE \\$1
13602 \# FIRST PAGE NUMBER FOR ENDNOTES
13603 \# ------------------------------
13605 \# <page number that appears on page 1 of endnotes pages>
13607 \# Creates or modifies string $EN_FIRST_PN
13609 \# To be used with caution, only if all endnotes
13610 \# are to be output at once, i.e. not at the end of the separate
13611 \# docs of a collated doc
13613 .MAC ENDNOTES_FIRST_PAGENUMBER END
13614 . nr #EN_FIRST_PN \\$1
13617 \# SINGLESPACE ENDNOTES
13618 \# --------------------
13620 \# <none> | <anything>
13622 \# Sets lead of endnotes pages in TYPEWRITE to 12 points,
13625 \# Default is to double-space endnotes pages.
13627 .MAC SINGLESPACE_ENDNOTES END
13628 . if \\n[#PRINT_STYLE]=1 \{\
13629 . ie \\n[#SINGLE_SPACE] \{\
13630 . nr #EN_SINGLESPACE 1
13632 . if \\n[#OK_PROCESS_LEAD] \{\
13633 . ENDNOTE_LEAD 12 ADJUST
13639 . nr #EN_SINGLESPACE 1
13641 . if \\n[#OK_PROCESS_LEAD] \{\
13642 . ENDNOTE_LEAD 12 ADJUST
13647 . rr #EN_SINGLESPACE
13649 . if \\n[#OK_PROCESS_LEAD] \{\
13650 . ENDNOTE_LEAD 24 ADJUST
13658 \# ENDNOTE PARAGRAPH SPACE
13659 \# -----------------------
13663 \# Creates toggle register #EN_PP_SPACE for use in .PP.
13665 \# Like PARA_SPACE. Default is not to space endnote paras.
13667 .MAC ENDNOTE_PARA_SPACE END
13668 . ie '\\$1'' .nr #EN_PP_SPACE 1
13669 . el .rr #EN_PP_SPACE
13677 \# Places superscript endnote number in text, then collects and
13678 \# processes endnote in diversion END_NOTES.
13680 \# \c must be appended to the word immediately preceding .ENDNOTE
13681 \# when ENDNOTE_MARKER_STYLE is NUMBER.
13686 . ie !\\n[#EN_MARKER_STYLE]=2 \{\
13687 . if \\n[#CONDENSE] .nop \*[CONDX]\c
13688 . if \\n[#EXTEND] .nop \*[EXTX]\c
13689 . if \\n[#UNDERLINE_ON] \{\
13690 . nr #UNDERLINE_WAS_ON 1
13693 . if \\n[#PRINT_STYLE]=1 \{\
13694 . if \\n[#SLANT_ON] \{\
13695 . nr #SLANT_WAS_ON 1
13698 .\" Vertical raise amount here is more than when the same string is printed in
13699 .\" the endnotes so bottom of number aligns with top of bowl.
13701 "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2\c"
13703 . if \\n[#PRINT_STYLE]=2 .PRINT \*[SUP]\\n+[#EN_NUMBER]\*[SUPX]\c
13706 . ie r#EN_NUMBER .nr #EN_NUMBER \\n[#EN_NUMBER]+1
13707 . el .nr #EN_NUMBER 1 1
13708 . if !\\n[#LINENUMBERS] \{\
13709 . tm1 "[mom]: Line numbering must be enabled with NUMBER_LINES when
13710 . tm1 " ENDNOTE_MARKER_STYLE is LINE.
13711 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
13713 . if \\n[#EN_MARK]=0 .nr #EN_MARK \\n[ln]
13714 . nr #EN_MARK_2 \\n[ln]
13715 . if '\\n[.z]'P_QUOTE' \{\
13720 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
13722 . if \\n[#INDENT_FIRST_PARAS] .nr #INDENT_FIRSTS 1
13723 . INDENT_FIRST_PARAS
13726 . LL \\n[#DOC_L_LENGTH]u
13728 . if \\n[#COLUMNS] \{\
13729 . ie \\n[#EN_NO_COLS] .LL \\n[#DOC_L_LENGTH]u
13730 . el .LL \\n[#COL_L_LENGTH]u
13733 \!. if \\\\n[.vpt]=0 .vpt
13735 . vs \\n[#EN_LEAD]u
13736 .\" Print identifying doc title (eg Chapter n)
13737 . if \\n[#EN_NUMBER]=1 \{\
13738 . if \\n[#PRINT_STYLE]=1 .TYPEWRITER
13739 . if \\n[#PRINT_STYLE]=2 \{\
13740 . FAMILY \\*[$EN_TITLE_FAM]
13741 . FT \\*[$EN_TITLE_FT]
13742 . ps \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
13745 . if !'\\*[$EN_TITLE]'' \{\
13746 . if '\\*[$EN_TITLE_QUAD]'L' .LEFT
13747 . if '\\*[$EN_TITLE_QUAD]'LEFT' .LEFT
13748 . if '\\*[$EN_TITLE_QUAD]'C' .CENTER
13749 . if '\\*[$EN_TITLE_QUAD]'CENTER' .CENTER
13750 . if '\\*[$EN_TITLE_QUAD]'CENTRE' .CENTER
13751 . if '\\*[$EN_TITLE_QUAD]'R' .RIGHT
13752 . if '\\*[$EN_TITLE_QUAD]'RIGHT' .RIGHT
13753 . ie \\n[#EN_TITLE_UNDERLINE] \{\
13754 . nr #FROM_EN_TITLE 1
13755 . UNDERSCORE "\\*[$EN_TITLE]"
13756 . rr #FROM_EN_TITLE
13758 . el .PRINT "\\*[$EN_TITLE]"
13761 .\" Get indent from endnotes point size; convert string to reg in
13762 .\" case indent string is, e.g., m or n
13764 . nr #REF_EN_INDENT (u;\\*[$REF_EN_INDENT])
13765 . if \\n[#PRINT_STYLE]=1 \{\
13767 . if \\n[#EN_NUMBER]=1 .sp
13768 . if \\n[#EN_MARKER_STYLE]=3 .ps -2
13770 . if \\n[#PRINT_STYLE]=2 \{\
13771 . if \\n[#EN_NUMBER]=1 \
13772 . if !'\\*[$EN_TITLE]'' .sp .5v
13773 . if \\n[#EN_MARKER_STYLE]=1 \{\
13774 . FAMILY \\*[$EN_NUMBER_FAM]
13775 . FT \\*[$EN_NUMBER_FT]
13776 . ps \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
13778 . if \\n[#EN_MARKER_STYLE]=2 \{\
13779 . FAMILY \\*[$EN_LN_FAM]
13780 . FT \\*[$EN_LN_FT]
13781 . ps \\n[#EN_PS]u\\*[$EN_LN_SIZE_CHANGE]
13783 . if \\n[#EN_MARKER_STYLE]=3 \{\
13784 . FAMILY \\*[$EN_NUMBER_FAM]
13785 . FT \\*[$EN_NUMBER_FT]
13786 . ps \\n[#PT_SIZE_IN_UNITS]u*6u/10u
13789 .\" Build string for line-numbered endnotes
13790 . if \\n[#EN_MARKER_STYLE]=2 \{\
13791 . ie \\n[#EN_LN_BRACKETS]=1 \{\
13792 . ds $EN_LINENUMBER \v'-.085m'\\*[$EN_OPEN_BRACKET]\v'.085m'
13793 . ie \\n[#EN_MARK_2]=\\n[#EN_MARK] .as $EN_LINENUMBER \
13794 \\n[#EN_MARK]\v'-.085m'\\*[$EN_CLOSE_BRACKET]\v'.085m'\"
13795 . el .as $EN_LINENUMBER \
13796 \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\v'-.085m'\
13797 \\*[$EN_CLOSE_BRACKET]\v'.085m'\"
13800 . ie \\n[#EN_MARK_2]=\\n[#EN_MARK] \
13801 . ds $EN_LINENUMBER \
13802 \\n[#EN_MARK]\\*[$EN_LN_SEP]
13804 . ds $EN_LINENUMBER \
13805 \\n[#EN_MARK]\v'-.1m'-\v'.1m'\\n[#EN_MARK_2]\\*[$EN_LN_SEP]
13810 . ie \\n[#EN_NUMBERS_ALIGN_RIGHT] .RIGHT
13812 . if \\n[#EN_MARKER_STYLE]=1 \
13813 . nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
13814 . if \\n[#EN_MARKER_STYLE]=2 \{\
13815 . ie \\n[#EN_LN_BRACKETS]=1 .nr #EN_NUMBER_L_LENGTH \
13816 (\w'\0'*(\\n[#EN_NUMBER_PLACEHOLDERS]*2))+\w'-[]'
13817 . el .nr #EN_NUMBER_L_LENGTH \
13818 (\w'\0'*(\\n[#EN_NUMBER_PLACEHOLDERS]*2))+\w'-\\*[$EN_LN_SEP]'
13821 . if \\n[#EN_MARKER_STYLE]=3 \{\
13822 . nr #EN_NUMBER_L_LENGTH \
13823 \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+.15m
13827 . ll \\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u
13828 . el .ll \\n[#EN_NUMBER_L_LENGTH]u
13829 . if \\n[#EN_MARKER_STYLE]=1 \{\
13830 . if \\n[#REF]=1 .ti \\n[#REF_EN_INDENT]u
13831 . nop \En[#EN_NUMBER].
13833 . if \\n[#EN_MARKER_STYLE]=2 \{\
13834 . nop \\*[$EN_LINENUMBER]
13835 . rm $EN_LINENUMBER
13837 . if \\n[#EN_MARKER_STYLE]=3 \{\
13838 . ps \" Reset ps changed to get width of s-script numbers
13839 . ie \\n[#PRINT_STYLE]=1 \{\
13840 .\" Vertical raise amount here is less than when the same string is printed in
13841 .\" the body of the text because number precedes a cap.
13843 \s-2\v'-\\n[#DOC_LEAD]u/7u'\\n[#EN_NUMBER]\|\v'+\\n[#DOC_LEAD]u/7u'\s+2
13845 . el .nop \E*[SUP]\\n[#EN_NUMBER]\E*[SUPX]\h'.15m'
13849 . nr #EN_FIGURE_SPACE \w'\0'
13850 . if \\n[#EN_MARKER_STYLE]=1 \{\
13851 . ie \\n[#REF]=1 .ti \
13852 \\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u+\\n[#EN_FIGURE_SPACE]u
13854 \\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_FIGURE_SPACE]u
13856 . if \\n[#EN_MARKER_STYLE]=2 \{\
13857 . ie \\n[#REF]=1 .ti \
13858 \\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u+\\n[#EN_LN_GAP]u
13860 \\n[#EN_NUMBER_L_LENGTH]u+\\n[#EN_LN_GAP]u
13862 . if \\n[#EN_MARKER_STYLE]=3 \{\
13863 . ie \\n[#REF]=1 .ti \
13864 \\n[#EN_NUMBER_L_LENGTH]u+\\n[#REF_EN_INDENT]u+\w'\|'u
13866 \\n[#EN_NUMBER_L_LENGTH]u
13868 . nr #EN_TEXT_INDENT \\n[.i]
13869 . QUAD \\*[$EN_QUAD]
13871 . if \\n[#PRINT_STYLE]=1 .TYPEWRITER
13872 . if \\n[#PRINT_STYLE]=2 \{\
13873 . FAMILY \\*[$EN_FAM]
13879 \!. ie \\n[#EN_NUMBER]=\\\\n[#LAST_EN] .vpt 0
13881 . if \\n[#PRINT_STYLE]=2 .sp \\*[$EN_SPACE]
13883 . if \\n[#EN_MARKER_STYLE]=2 \{\
13887 .\" Restore sentence spacing
13888 . if \\n[#PRINT_STYLE]=2 \{\
13889 . if d$RESTORE_SS_VAR .SS \\*[$RESTORE_SS_VAR]
13890 . rm $RESTORE_SS_VAR
13893 .\" Restore lead -- need
13894 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
13895 . if !\\n[#INDENT_FIRSTS] .INDENT_FIRST_PARAS OFF
13896 . rr #INDENT_FIRSTS
13898 . if \\n[#UNDERLINE_WAS_ON] \{\
13899 . rr #UNDERLINE_WAS_ON
13902 . if \\n[#SLANT_WAS_ON] \{\
13907 . if \\n[#NUM_ARGS]=2 \{\
13908 . if '\\$2'BREAK' .BR
13918 \# Sets new document leading from #EN_LEAD, breaks to a new page,
13919 \# sets up an endnotes page based on registers and strings associated
13920 \# with endnotes, then outputs diversion END_NOTES.
13923 . if \\n[defer] .NEWPAGE
13924 . nr #LAST_EN \\n[#EN_NUMBER]
13926 . nr #EN_FIRST_PAGE 1
13927 . nr #HEADER_STATE \\n[#HEADERS_ON]
13928 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
13929 . if \\n[#LINENUMBERS]=1 \{\
13931 . nr #LINENUMBERS 2
13933 . if \\n[#HEADERS_ON]=1 \
13934 . if !\\n[#EN_ALLOWS_HEADERS_ALL] .HEADERS OFF
13935 . if \\n[#HEADER_STATE]=1 \{\
13936 . ie \\n[#EN_HDRFTR_CENTER]=1 .
13937 . el .rm $HDRFTR_CENTER
13939 . ie !\\n[#SUSPEND_PAGINATION] \{\
13940 . if \\n[#PAGINATE]=1 \{\
13941 . if \\n[#PAGE_NUM_V_POS]=1 \{\
13942 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
13943 . if \\n[#EN_FIRST_PN] .PAGENUMBER \\n[#EN_FIRST_PN]-1
13944 . if r #EN_NO_FIRST_PN .nr #PAGINATE 0
13949 . ie \\n[#PAGE_NUM_V_POS]=2 .nr #PAGINATE 1
13950 . el .nr #PAGINATE 0
13952 . if \\n[#FOOTERS_ON]=1 \{\
13953 . if !'\\*[$HDRFTR_CENTER_OLD]'' \
13954 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
13957 . if \\n[#FOOTERS_ON]=1 \{\
13958 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
13959 . rm $HDRFTR_CENTER_OLD
13960 . rm $HDRFTR_CENTER_NEW
13962 . ie !\\n[#SUSPEND_PAGINATION] \{\
13963 . if \\n[#PAGE_NUM_V_POS]=1 \{\
13964 . if r #EN_NO_FIRST_PN \
13965 . if \\n[#PAGINATION_STATE]=1 .nr #PAGINATE 1
13969 . if \\n[#PAGE_NUM_V_POS]=2 .nr #PAGINATE 0
13970 . rr #PAGINATION_STATE
13971 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
13972 . if \\n[#EN_FIRST_PN] .PAGENUMBER \\n[#EN_FIRST_PN]
13973 . if \\n[#HEADER_STATE]=1 \
13974 . if \\n[#EN_ALLOWS_HEADERS] .HEADERS
13975 .\" Collect endnotes title string for TOC
13976 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
13977 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
13978 . ds $TOC_TITLE_ITEM \\*[$EN_STRING]\|
13979 . PDF_BOOKMARK 1 \\*[$EN_STRING]
13981 .\" End collection of endnotes title string for TOC
13982 .\" Process endnotes
13983 . if \\n[#PRINT_STYLE]=1 .vs \\n[#EN_LEAD]u
13984 . if \\n[#PRINT_STYLE]=2 \{\
13985 . if \\n[#EN_NO_COLS] \{\
13986 . if \\n[#COLUMNS] .nr #COLUMNS_WERE_ON 1
13989 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
13990 . ie \\n[#ADJ_EN_LEAD] .nr #DOC_LEAD \\n[#EN_LEAD]
13991 . el .DOC_LEAD \\n[#EN_LEAD]u
13994 . ie r#EN_STRING_ADVANCE .sp |\\n[#EN_STRING_ADVANCE]u-1v
13995 . el .sp |\\n[#T_MARGIN]u-1v
13998 . if \\n[#SLANT_ON] \{\
14002 . if !'\\*[$EN_STRING]'' \{\
14003 . if \\n[#PRINT_STYLE]=1 \{\
14005 . vs \\n[#EN_LEAD]u
14007 . if \\n[#PRINT_STYLE]=2 \{\
14008 . LL \\n[#DOC_L_LENGTH]u
14010 . if \\n[#COLUMNS] \{\
14011 . ie \\n[#EN_NO_COLS] .LL \\n[#DOC_L_LENGTH]u
14012 . el .LL \\n[#COL_L_LENGTH]u
14015 . FAMILY \\*[$EN_STRING_FAM]
14016 . FT \\*[$EN_STRING_FT]
14017 . ps \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
14018 . vs \\n[#EN_LEAD]u
14019 . if \\n[#ENDNOTE_STRING_COLOR]=1 \{\
14020 . COLOR \\*[$ENDNOTE_STRING_COLOR]
14024 . if '\\*[$EN_STRING_QUAD]'L' .LEFT
14025 . if '\\*[$EN_STRING_QUAD]'LEFT' .LEFT
14026 . if '\\*[$EN_STRING_QUAD]'C' .CENTER
14027 . if '\\*[$EN_STRING_QUAD]'CENTER' .CENTER
14028 . if '\\*[$EN_STRING_QUAD]'CENTRE' .CENTER
14029 . if '\\*[$EN_STRING_QUAD]'R' .RIGHT
14030 . if '\\*[$EN_STRING_QUAD]'RIGHT' .RIGHT
14032 . if \\n[#EN_STRING_CAPS] .CAPS
14033 . ie \\n[#EN_STRING_UNDERLINE] \{\
14034 . nr #FROM_EN_STRING 1
14035 . ie \\n[#EN_STRING_UNDERLINE]=2 \
14036 . UNDERSCORE2 \\*[$EN_UNDERLINE_GAP] \\*[$EN_RULE_GAP] "\\*[$EN_STRING]"
14037 . el .UNDERSCORE "\\*[$EN_STRING]"
14038 . rr #FROM_EN_STRING
14040 . el .PRINT "\\*[$EN_STRING]
14043 . if \\n[#PRINT_STYLE]=1 \{\
14044 . ie \\n[#SINGLE_SPACE]=1 .sp
14046 . ie \\n[#EN_SINGLESPACE]=1 .sp
14050 . if \\n[#PRINT_STYLE]=2 .ALD \\n[#EN_LEAD]u
14051 . QUAD \\*[$EN_QUAD]
14056 . ps \\n[#DOC_PT_SIZE]u
14057 . if \\n[#PRINT_STYLE]=1 .vs \\n[#DOC_LEAD]u
14058 . if \\n[#PRINT_STYLE]=2 \{\
14059 . ie \\n[#ADJ_EN_LEAD] \
14060 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
14061 . el .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
14062 . rr #RESTORE_DOC_LEAD
14064 . if \\n[#COLUMNS_WERE_ON] .nr #COLUMNS 1
14065 . if \\n[#HEADER_STATE]=1 .HEADERS
14066 . if \\n[#LINENUMBERS]=2 \{\
14067 . NUMBER_LINES RESUME
14068 . nr #LINENUMBERS 1
14075 \# ====================================================================
14077 \# +++BIBLIOGRAPHY+++
14079 \# Mom treats bibliographies and endnotes very similarly. The chief
14080 \# difference is that endnotes are collected and formatted inside a
14081 \# diversion, while bibliographies are built "by hand." ENDNOTES sets
14082 \# up the endnotes page and outputs the formatted diversion.
14083 \# BIBLIOGRAPHY sets up the bibliography page, then awaits refer
14086 \# All of the bibliography control macros have their exact
14087 \# counterparts in the endnotes control macros. See, therefore,
14088 \# Arguments, Functions, and Notes in the Endnotes section.
14090 \# Bibliography control macros
14092 .MAC BIBLIOGRAPHY_PT_SIZE END
14093 . nr #BIB_PS (p;\\$1)
14096 .MAC BIBLIOGRAPHY_HDRFTR_CENTER END
14097 . ie '\\$1'' .nr #BIB_HDRFTR_CENTER 1
14098 . el .rr #BIB_HDRFTR_CENTER
14101 .MAC BIBLIOGRAPHY_STRING END
14102 . ds $BIB_STRING \\$1
14105 .MAC BIBLIOGRAPHY_STRING_ADVANCE END
14106 . nr #BIB_STRING_ADVANCE (\\$1)
14109 .MAC BIBLIOGRAPHY_STRING_CAPS END
14110 . ie '\\$1'' .nr #BIB_STRING_CAPS 1
14111 . el .nr #BIB_STRING_CAPS 0
14114 .MAC BIBLIOGRAPHY_NO_COLUMNS END
14115 . ie '\\$1'' .nr #BIB_NO_COLS 1
14116 . el .rr #BIB_NO_COLS
14119 .MAC BIBLIOGRAPHY_NO_FIRST_PAGENUM END
14120 . ie '\\$1'' .nr #BIB_NO_FIRST_PN 1
14121 . el .rr #BIB_NO_FIRST_PN
14124 .MAC BIBLIOGRAPHY_ALLOWS_HEADERS END
14125 . ie '\\$1'' .nr #BIB_ALLOWS_HEADERS 1
14127 . ie '\\$1'ALL' \{\
14128 . nr #BIB_ALLOWS_HEADERS 1
14129 . nr #BIB_ALLOWS_HEADERS_ALL 1
14132 . rr #BIB_ALLOWS_HEADERS
14133 . rr #BIB_ALLOWS_HEADERS_ALL
14138 .MAC BIBLIOGRAPHY_PAGENUM_STYLE END
14139 . ds $BIB_PN_STYLE \\$1
14142 .MAC BIBLIOGRAPHY_FIRST_PAGENUMBER END
14143 . nr #BIB_FIRST_PN \\$1
14146 .MAC SINGLESPACE_BIBLIOGRAPHY END
14147 . if \\n[#PRINT_STYLE]=1 \{\
14148 . ie \\n[#SINGLE_SPACE] \{\
14149 . nr #BIB_SINGLESPACE 1
14151 . if \\n[#OK_PROCESS_LEAD] \{\
14152 . BIBLIOGRAPHY_LEAD 12 ADJUST
14158 . nr #BIB_SINGLESPACE 1
14160 . if \\n[#OK_PROCESS_LEAD] \{\
14161 . BIBLIOGRAPHY_LEAD 12 ADJUST
14166 . rr #BIB_SINGLESPACE
14168 . if \\n[#OK_PROCESS_LEAD] \{\
14169 . BIBLIOGRAPHY_LEAD 24 ADJUST
14177 \# Style for outputting collected bibliographic references
14178 \# -------------------------------------------------------
14180 \# LIST | PLAIN [ <list separator> ] [ <list prefix> ]
14182 \# Sets #BIB_LIST to 1 for numbered list style, 0 for plain output
14184 \# Technically, user is supposed to enter PLAIN if s/he wants an
14185 \# unumbered bibliography, but the el clause says "any arg but
14186 \# LIST means unumbered." Effectively, any arg but LIST produces
14187 \# a "plain" bibliographic list.
14189 \# The 2nd and 3rd args have the same options as the 2nd arg to LIST.
14191 .MAC BIBLIOGRAPHY_TYPE END
14192 . ie '\\$1'LIST' \{\
14195 . if '\\*[$BIB_LIST_SEPARATOR]'' .ds $BIB_LIST_SEPARATOR .
14197 . el .ds $BIB_LIST_SEPARATOR \\$2
14198 . ie '\\$3'' .ds $BIB_LIST_PREFIX
14199 . el .ds $BIB_LIST_PREFIX \\$3
14201 . el .nr #BIB_LIST 0
14204 \# Spacing between items in bibliographies
14205 \# ---------------------------------------
14207 \# <amount of space>
14209 \# Gets value for #BIB_SPACE in units.
14211 \# Requires a unit of measure.
14213 .MAC BIBLIOGRAPHY_SPACING END
14214 . ds $BIB_SPACE \\$1
14215 . if \\n[#BIB_LEAD]=0 \{\
14216 . nr #DEFER_BIB_SPACING 1
14219 . ds $EVAL_BIB_SPACE \\*[$BIB_SPACE]
14220 . substring $EVAL_BIB_SPACE -1
14221 . ie '\\*[$EVAL_BIB_SPACE]'v' \{\
14222 . substring $BIB_SPACE 0 0
14223 . nr #BIB_SPACE \\n[#BIB_LEAD]*\\*[$BIB_SPACE]
14225 . el .nr #BIB_SPACE (\\$1)
14228 \# Set up bibliography page
14229 \# ------------------------
14231 \# Sets up a new page, with title, ready to accept the output
14232 \# of refer's $LIST$ or .R1 bibliography .R2
14234 \# Bibliography pages are set up almost identically to endnotes pages.
14236 .MAC BIBLIOGRAPHY END
14240 . nr #BIBLIOGRAPHY 1
14241 . nr #BIB_FIRST_PAGE 1
14242 . nr #HEADER_STATE \\n[#HEADERS_ON]
14243 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
14244 . if \\n[#LINENUMBERS]=1 \{\
14246 . nr #LINENUMBERS 2
14248 . if \\n[#HEADERS_ON]=1 \
14249 . if !\\n[#BIB_ALLOWS_HEADERS_ALL] .HEADERS OFF
14250 . if \\n[#HEADER_STATE]=1 \{\
14251 . ie \\n[#BIB_HDRFTR_CENTER]=1 .
14252 . el .rm $HDRFTR_CENTER
14254 . ie !\\n[#SUSPEND_PAGINATION] \{\
14255 . if \\n[#PAGINATE]=1 \{\
14256 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14257 . PAGENUM_STYLE \\*[$BIB_PN_STYLE]
14258 . if \\n[#BIB_FIRST_PN] .PAGENUMBER \\n[#BIB_FIRST_PN]-1
14259 . if r #BIB_NO_FIRST_PN .nr #PAGINATE 0
14264 . ie \\n[#PAGE_NUM_V_POS]=2 .nr #PAGINATE 1
14265 . el .nr #PAGINATE 0
14267 . if \\n[#FOOTERS_ON]=1 \{\
14268 . if !'\\*[$HDRFTR_CENTER_OLD]'' \
14269 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
14272 . if \\n[#FOOTERS_ON]=1 \{\
14273 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
14274 . rm $HDRFTR_CENTER_OLD
14275 . rm $HDRFTR_CENTER_NEW
14277 . ie !\\n[#SUSPEND_PAGINATION] \{\
14278 . if \\n[#PAGE_NUM_V_POS]=1 \{\
14279 . if r #BIB_NO_FIRST_PN \{\
14280 . if \\n[#PAGINATION_STATE]=1 .nr #PAGINATE 1
14285 . if \\n[#PAGE_NUM_V_POS]=2 .nr #PAGINATE 0
14286 . rr #PAGINATION_STATE
14287 . PAGENUM_STYLE \\*[$BIB_PN_STYLE]
14288 . if \\n[#BIB_FIRST_PN] .PAGENUMBER \\n[#BIB_FIRST_PN]
14289 . if \\n[#HEADER_STATE]=1 \
14290 . if \\n[#BIB_ALLOWS_HEADERS] .HEADERS
14291 .\" Collect bibliography title string for TOC
14292 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
14293 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
14294 . ds $TOC_TITLE_ITEM \\*[$BIB_STRING]\\|
14295 . PDF_BOOKMARK 1 \\*[$BIB_STRING]
14297 .\" End collection of bibliography title string for TOC
14298 .\" Process bibliography
14299 . if \\n[#PRINT_STYLE]=1 .vs \\n[#BIB_LEAD]u
14300 . if \\n[#PRINT_STYLE]=2 \{\
14301 . if \\n[#BIB_NO_COLS] \{\
14302 . if \\n[#COLUMNS] .nr #COLUMNS_WERE_ON 1
14305 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
14306 . ie \\n[#ADJ_BIB_LEAD] .nr #DOC_LEAD \\n[#BIB_LEAD]
14307 . el .DOC_LEAD \\n[#BIB_LEAD]u
14310 . ie r#BIB_STRING_ADVANCE .sp |\\n[#BIB_STRING_ADVANCE]u-1v
14311 . el .sp |\\n[#T_MARGIN]u-1v
14314 . if \\n[#SLANT_ON] \{\
14318 . if !'\\*[$BIB_STRING]'' \{\
14319 . if \\n[#PRINT_STYLE]=1 \{\
14321 . vs \\n[#BIB_LEAD]u
14323 . if \\n[#PRINT_STYLE]=2 \{\
14324 . LL \\n[#DOC_L_LENGTH]u
14326 . if \\n[#COLUMNS] \{\
14327 . ie \\n[#BIB_NO_COLS] .LL \\n[#DOC_L_LENGTH]u
14328 . el .LL \\n[#COL_L_LENGTH]u
14331 . FAMILY \\*[$BIB_STRING_FAM]
14332 . FT \\*[$BIB_STRING_FT]
14333 . ps \\n[#BIB_PS]u\\*[$BIB_STRING_SIZE_CHANGE]
14334 . vs \\n[#BIB_LEAD]u
14336 . if '\\*[$BIB_STRING_QUAD]'LEFT' .LEFT
14337 . if '\\*[$BIB_STRING_QUAD]'C' .CENTER
14338 . if '\\*[$BIB_STRING_QUAD]'CENTER' .CENTER
14339 . if '\\*[$BIB_STRING_QUAD]'CENTRE' .CENTER
14340 . if '\\*[$BIB_STRING_QUAD]'R' .RIGHT
14341 . if '\\*[$BIB_STRING_QUAD]'RIGHT' .RIGHT
14343 . if \\n[#BIB_STRING_CAPS] .CAPS
14344 . ie \\n[#BIB_STRING_UNDERLINE] \{\
14345 . nr #FROM_BIB_STRING 1
14346 . ie \\n[#BIB_STRING_UNDERLINE]=2 \
14347 . UNDERSCORE2 "\\*[$BIB_STRING]"
14348 . el .UNDERSCORE "\\*[$BIB_STRING]"
14349 . rr #FROM_BIB_STRING
14351 . el .PRINT "\\*[$BIB_STRING]"
14354 . FAMILY \\*[$BIB_FAMILY]
14356 . ps -\\*[$BIB_STRING_SIZE_CHANGE]
14357 . if \\n[#PRINT_STYLE]=1 \{\
14358 . ie \\n[#SINGLE_SPACE]=1 .ALD \\n[#BIB_LEAD]*3u
14360 . ie \\n[#BIB_SINGLESPACE]=1 .ALD \\n[#BIB_LEAD]u*3u
14361 . el .ALD \\n[#BIB_LEAD]u
14364 . if \\n[#PRINT_STYLE]=2 .ALD \\n[#BIB_LEAD]u*2u
14365 . QUAD \\*[$BIB_QUAD]
14366 . if \\n[#PRINT_STYLE]=1 \{\
14367 . ie \\n[#SINGLE_SPACE]=1 .vs \\n[#BIB_LEAD]u
14369 . ie \\n[#BIB_SINGLESPACE]=1 .vs \\n[#BIB_LEAD]u
14370 . el .vs \\n[#BIB_LEAD]u
14373 . if \\n[#PRINT_STYLE]=2 \{\
14374 . ie \\n[#ADJ_BIB_LEAD] \
14375 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
14376 . el .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
14377 . rr #RESTORE_DOC_LEAD
14379 . if \\n[#COLUMNS_WERE_ON] .nr #COLUMNS 1
14380 . if \\n[#HEADER_STATE]=1 .HEADERS
14381 . if \\n[#LINENUMBERS]=2 \{\
14382 . NUMBER_LINES RESUME
14383 . nr #LINENUMBERS 1
14390 .\" Part of workaround for refer spitting out a blank page if the
14391 .\" last ref falls on the bottom line.
14392 . nr num*refs \\n[ref*num*first-pass]
14399 \# ====================================================================
14401 \# +++TABLE OF CONTENTS+++
14403 \# Strings to allocate space for leaders and entry page numbers
14405 .ds $TOC_PN \\*[ST102]\F[\\*[$TOC_PN_FAM]]\f[\\*[$TOC_PN_FT]]\
14406 \s[\\n[#TOC_PS]u]^\\*[ST102X]\\*[ST103]\s[\\*[$TOC_PN_SIZE_CHANGE]]\
14407 \|\|\|\h'\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST103X]
14409 .ds $TOC_PN_TYPEWRITE \\*[ST102]^\\*[ST102X]\\*[ST103]\
14410 \h'\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST103X]
14415 . if !'\\n[.ev]'TOC_EV' .ev TOC_EV
14416 . nr #TOC_CH_NUM_INDENT \w'\\*[$TOC_CH_NUM]'
14418 \!. ie \\\\n[#SKIP_ENTRY]=1 \{\
14423 . ie \\n[#PRINT_STYLE]=1 \{\
14424 \!. fam \\*[$TYPEWRITER_FAM]
14426 \!. ps \\*[$TYPEWRITER_PS]
14427 . ds _TYPEWRITE _TYPEWRITE
14430 . ie '\\$0'HD_TO_TOC' \{\
14431 \!. ps \\n[#TOC_PS]u\\*[$TOC_HEAD_\\n[#LEVEL]_SIZE]
14434 \!. FAMILY \\*[$TOC_TITLE_FAM]
14435 \!. FT \\*[$TOC_TITLE_FT]
14436 \!. ps \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE]
14439 . if \\n[#PRINT_STYLE]=2 \{\
14441 . if \\n[#SPACE_TOC_ITEMS] \{\
14442 . if \\n[#POST_TOP]=1 \{\
14443 . ie !\\n[#LEVEL]=\\n[#LAST_LEVEL] \{\
14444 . ie \\n[#LEVEL]>\\n[#LAST_LEVEL] \!.sp .2v
14448 . if \\n[#COLLATED_DOC] \
14449 . if '\\$0'TITLE_TO_TOC' \!.sp .4v
14455 . if !'\\$0'HD_TO_TOC' \{\
14456 \!. if \\n[#TOC_TITLE_CAPS]=1 .CAPS
14458 . if '\\$0'HD_TO_TOC' \{\
14460 \!. if \\n[#TOC_HEAD_\\n[#LEVEL]_CAPS]=1 .CAPS
14463 . ie '\\$0'HD_TO_TOC' \{\
14465 "\\f[\\*[$TOC_HEAD_\\n[#LEVEL]_FAM]\
14466 \\*[$TOC_HEAD_\\n[#LEVEL]_FT]]\
14467 \h'\\\\n[#TOC_INDENT_ADJ]u'\h'\\n[#TOC_HEAD_\\n[#LEVEL]_INDENT]u'\
14468 \\*[$TOC_HD_NUM]\\*[$TOC_HEAD_\\n[#LEVEL]_ITEM]\\*[$TOC_PN\\*[_TYPEWRITE]]" \
14469 "\\*[PDFBOOKMARK.NAME]"
14473 "\\f[\\*[$TOC_TITLE_FAM]\\*[$TOC_TITLE_FT]]\
14474 \h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN\\*[_TYPEWRITE]]" \
14475 "\\*[PDFBOOKMARK.NAME]"
14477 . if '\\$0'HD_TO_TOC' \{\
14478 \!. if \\n[#TOC_HEAD_\\n[#LEVEL]_CAPS]=1 .CAPS OFF
14480 . if !'\\$0'HD_TO_TOC' \{\
14481 \!. if \\n[#TOC_TITLE_CAPS]=1 .CAPS OFF
14487 . if \\n[#PRINT_STYLE]=2 \{\
14488 \!. FAMILY \\*[$TOC_PN_FAM]
14489 \!. FT \\*[$TOC_PN_FT]
14490 \!. ps \\n[#TOC_PS]u
14493 \!. PRINT \\*[LEADER]
14495 . if \\n[#PRINT_STYLE]=2 \{\
14496 \!. ps \\*[$TOC_PN_SIZE_CHANGE]u
14498 \!. PRINT \\n[#TOC_ENTRY_PN]
14506 .ALIAS HD_TO_TOC TO_TOC
14507 .ALIAS TITLE_TO_TOC TO_TOC
14509 \# Control macros for toc
14510 \# ----------------------
14522 \# Assigns complete style parameters to TITLEs (doc titles,
14523 \# chapter titles, etc) in the TOC.
14525 \# TITLEs are not headings, therefore they require their own style
14526 \# macro. Otherwise, the same as TOC_ENTRY_STYLE.
14528 .MAC TOC_TITLE_STYLE END
14530 . nr #ATTRIB \\n[#NUM_ARGS]
14531 . while \\n+[#ARG_NUM]<=\\n[#ATTRIB] \{\
14532 . if '\\$1'FAMILY' \{\
14534 . ds $TOC_TITLE_FAM \\$1
14537 . if '\\$1'FONT' \{\
14539 . ds $TOC_TITLE_FT \\$1
14542 . if '\\$1'SIZE' \{\
14544 . ds $TOC_TITLE_SIZE \\$1
14547 . if '\\$1'CAPS' \{\
14548 . nr #TOC_TITLE_CAPS 1
14551 . if '\\$1'NO_CAPS' \{\
14552 . rr #TOC_TITLE_CAPS
14555 . if '\\$1'INDENT' \{\
14557 . nr #TOC_TITLE_INDENT \\$1
14563 \# TOC HEADER STRING
14564 \# -----------------
14566 \# <string for "doc header" of first toc page>
14568 \# Creates or modifies string $TOC_HEADER_STRING
14570 \# Default is "Contents".
14572 .MAC TOC_HEADER_STRING END
14573 . ds $TOC_HEADER_STRING \\$1
14579 \# <base point size for toc pages>
14581 \# Creates or modifies register #TOC_PS.
14583 \# This size control macro differs from other size control macros
14584 \# in that it sets an absolute point size, not a relative one.
14585 \# See notes for ENDNOTE_PT_SIZE for explanation.
14587 \# No unit of measure required (points assumed). Default is 12.5
14590 .MAC TOC_PT_SIZE END
14591 . nr #TOC_PS (p;\\$1)
14594 \# TOC ENTRIES PAGE NUMBERS PADDING
14595 \# --------------------------------
14597 \# <number of placeholders for toc entries page numbers>
14599 \# Creates or modifies register #TOC_PN_PADDING.
14601 \# "Placeholders" is the maximum number of digits in a page
14606 .MAC TOC_PADDING END
14607 . nr #TOC_PN_PADDING \\$1
14613 \# <none> | <anything>
14615 \# Creates or removes register #PAGINATE_TOC.
14617 \# Default is to paginate toc.
14619 .MAC PAGINATE_TOC END
14620 . ie '\\$1'' .nr #PAGINATE_TOC 1
14621 . el .nr #PAGINATE_TOC 0
14624 .MAC TOC_FIRST_PAGENUM END
14625 . nr #TOC_START_PAGENUM \\$1
14628 \# TOC PAGES PAGE-NUMBERING STYLE
14629 \# ------------------------------
14631 \# DIGIT | ROMAN | roman | ALPHA | alpha
14633 \# Creates or modifies string $TOC_PN_STYLE
14635 \# Page numbering style for page numbers that appear in the
14636 \# headers/footers of toc pages. See notes for PAGENUM_STYLE.
14638 \# Default is roman.
14640 .MAC TOC_PAGENUM_STYLE END
14641 . ds $TOC_PN_STYLE \\$1
14644 \# TOC RECTO_VERSO SWITCH
14645 \# ----------------------
14647 \# <none> | <anything>
14649 \# Creates or removes register #TOC_RV_SWITCH
14651 \# Allows switching of L/R margins if a doc is recto/verso and
14652 \# the first toc page happens to fall the wrong way
14654 .MAC TOC_RV_SWITCH END
14655 . ie '\\$1'' .nr #TOC_RV_SWITCH 1
14656 . el .rr #TOC_RV_SWITCH
14659 \# TOC ENTRY SPACING
14660 \# -----------------
14662 \# <none> | <anything>
14664 \# Toggles whether a small amount of space is inserted between TOC
14665 \# entries for greater legibility.
14667 .MAC SPACE_TOC_ITEMS END
14668 . ie !'\\$1'' .rr #SPACE_TOC_ITEMS
14669 . el .nr #SPACE_TOC_ITEMS 1
14672 \# NUMBERING OF TOC ENTRIES
14673 \# ------------------------
14675 \# FULL | TRUNCATE | NONE
14677 \# Determines how, or whether, to prepend heading numbers to TOC
14680 \# FULL means the complete numbering string (default).
14682 \# TRUNCATE means prepend a single digit sufficient to identify
14683 \# an entry's place in the numbering scheme with reference to the
14684 \# level above it. Thus, if a HEADING 1 is the second HEADING 1
14685 \# and therefore numbered "2.", a HEADING 2 beneath it (in the TOC)
14686 \# will have only "1." prepended to the entry; TOC indenting makes it
14687 \# evident under which level the HEADING 2 belongs.
14689 \# Note that TRUNCATE also removes chapter numbers, if
14690 \# PREFIX_CHAPTER_NUMBER is on.
14692 .MAC TOC_ENTRY_NUMBERS END
14693 . if '\\$1'TRUNCATE' .nr #TRUNC_TOC_HD_NUM 1
14694 . if '\\$1'FULL' .nr #TRUNC_TOC_HD_NUM 0
14695 . if '\\$1'NONE' .nr #TOC_NO_HD_NUM 1
14698 \# User defined TITLE entry string
14700 .MAC TOC_TITLE_ENTRY END
14701 . nr #USER_SET_TITLE_ITEM 1
14702 . ds $USER_SET_TITLE_ITEM \\$1
14705 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
14706 \# -----------------------------------------
14708 \# <none> | <name(s) of author(s) as they should appear in toc doc title entries>
14710 \# Creates register #TOC_AUTHORS (to tell TOC to append authors
14711 \# to toc doc title entries). Optionally creates string
14714 \# Normally, TOC does not append the author(s) to a toc doc title
14715 \# entry. This special macro instructs TOC to do so.
14717 \# If user has multiple authors for each doc when collating,
14718 \# TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
14719 \# COLLATE and START in each doc. Otherwise, mom prints only the
14720 \# first author given to AUTHOR.
14722 .MAC TOC_APPENDS_AUTHOR END
14723 . nr #TOC_AUTHORS 1
14724 . if !'\\$1'' .ds $TOC_AUTHORS \\$1
14727 \# TABLE OF CONTENTS
14728 \# -----------------
14732 \# Takes care of the administrivia of setting up the TOC as if
14733 \# it's a collated doc, then outputs the formatted TOC_ENTRIES
14737 . char \[leader] " .
14738 . LEADER_CHARACTER \[leader]
14739 . ie \\n[#COLLATED_DOC] \{\
14740 . nr #TOC_INDENT_ADJ 1.5m
14741 . if \\n[#PREFIX_CH_NUM] .nr #TOC_INDENT_ADJ \\n[#TOC_CH_NUM_INDENT]
14745 . nr #TOC_INDENT_ADJ 0
14748 . nr TOC.RELOCATE 0
14749 . if \\n[#LINENUMBERS]=1 \{\
14751 . nr #LINENUMBERS 2
14753 . if !r #PAGINATE_TOC .PAGINATE_TOC
14754 . nr #TOC_FIRST_PAGE 1
14755 . if \\n[#FINIS] \{\
14756 . if \\n[#FOOTERS_WERE_ON] \
14757 . FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
14759 . if \\n[#FOOTERS_ON]=1 \{\
14760 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
14761 . ie \\n[#PAGINATE_TOC]=1 .PAGINATE
14762 . el .PAGINATION OFF
14764 . if \\n[#FOOTERS_WERE_ON] .FOOTERS OFF \" But have to turn FOOTERS off again so they don't print when FINIS was called
14767 . if \\n[#PRINT_STYLE]=1 \{\
14768 . if \\n[#SINGLE_SPACE] .vs 24
14771 . if \\n[#PRINT_STYLE]=2 .vs \\n[#TOC_LEAD]u
14772 . if \\n[#FINIS] \{\
14773 . if \\n[#FOOTERS_WERE_ON] .FOOTERS \" Finally, turn footers on if they were on
14774 . rr #FOOTERS_WERE_ON
14775 . if \\n[#PAGINATION_WAS_ON] \{\
14777 . rr #PAGINATION_WAS_ON
14781 . ie \\n[#PAGINATE_TOC]=1 .PAGINATE
14782 . el .PAGINATION OFF
14783 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
14784 . rm $HDRFTR_CENTER_OLD
14785 . rm $HDRFTR_CENTER_NEW
14787 . DOCHEADER OFF \\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
14788 . if !r #TOC_START_PAGENUM .nr #TOC_START_PAGENUM 1
14789 . PAGENUMBER \\n[#TOC_START_PAGENUM]
14790 . if \\n[#LINENUMBERS]=2 .nr #LINENUMBERS 3
14791 . L_MARGIN \\n[#DOC_L_MARGIN]u
14792 . LL \\n[#DOC_L_LENGTH]u
14793 . HEADER_CENTER "\\*[$TOC_HEADER_STRING]
14794 . if \\n[#SLANT_ON] .nop \\*[SLANTX]
14796 . PAGENUM_STYLE \\*[$TOC_PN_STYLE]
14797 . PDF_BOOKMARK 1 \\*[$TOC_HEADER_STRING]
14798 . if \\n[#PRINT_STYLE]=1 .TYPEWRITER
14799 . if \\n[#PRINT_STYLE]=2 \{\
14800 . FAMILY \\*[$TOC_HEADER_FAM]
14801 . FT \\*[$TOC_HEADER_FT]
14802 . ps \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
14804 . ie \\n[#PRINT_STYLE]=1 \{\
14806 . UNDERSCORE 3p "\\*[$TOC_HEADER_STRING]"
14809 . el .PRINT \\*[$TOC_HEADER_STRING]
14814 . if \\n[#LINENUMBERS]=3 \{\
14815 . NUMBER_LINES RESUME
14816 . nr #LINENUMBERS 1
14823 \# ====================================================================
14830 \# <number of columns> <width of gutters>
14832 \# Creates registers associated with setting docs in columns.
14833 \# Calculates column line lengths and offsets
14835 \# COLUMNS, if used, s/b the last macro invoked before START.
14838 . if \\n[#IGNORE_COLUMNS]=1 .return
14840 . nr #NUM_COLS \\$1
14841 . nr #GUTTER (\\$2)
14842 . nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
14843 . nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
14845 . while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
14846 . nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
14847 . nr #COL_TOTAL \\n+[#COL_TOTAL]
14849 . if \\n[#NUM_COLS]=1 \
14850 . if !\\n[#COLLATE]=1 .MN_INIT
14855 \# MARK COL V-POSITION AFTER DOCHEADER
14856 \# -----------------------------------
14860 \# Sets 1st page dc register.
14862 \# Only required if manual spacing, positive or negative, precedes
14863 \# start of columns on first page of doc.
14874 \# Breaks current column and moves to next column.
14875 \# If current column is the last on the page, breaks
14879 . if \\n[#COLUMNS] \{\
14881 . ie '\\$0'COL_NEXT' .br
14886 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] .bp
14891 \# ====================================================================
14898 \# [ BULLET | DASH | DIGIT | alpha | ALPHA | roman | ROMAN | USER ] \
14899 \# [ <separator> | NONE ] [ <prefix> ] [ <anything> ]
14901 \# Stores indent information in effect prior to invocation and
14902 \# initializes a list with the supplied enumerator (and separator).
14904 \# Default enumerator is a bullet.
14906 \# Enumerator *must* be supplied for every list that's to the
14907 \# right of another list, every time, unless the default bullet is
14910 \# <anything> moves back one list level intuitively, or exits lists
14911 \# completely if the level in which it's invoked is the first.
14914 . ds $1ST_LETTER \\$1
14915 . if !'\\*[$1ST_LETTER]'' .substring $1ST_LETTER 0 0
14916 . if '\\*[$1ST_LETTER]'r' .ds $1ST_LETTER R
14917 . ie '\\*[$1ST_LETTER]'R' \{\
14918 . ds $LAST_CHAR \\$1
14919 . substring $LAST_CHAR -1
14920 . if !\B'\\*[$LAST_CHAR]' \{\
14921 . if !'\\$1'ROMAN' \{\
14925 . if !'\\$1'roman' \{\
14929 . tm1 "[mom]: You must append a number to the \\$1 argument to \\$0.
14930 . tm1 " The number should be the total number of items in this list.
14931 . tm1 " See the documentation.
14932 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
14934 . ds $ROMAN_WIDTH \\$1
14935 . substring $ROMAN_WIDTH 1
14936 . while !\B'\\*[$ROMAN_WIDTH]' \{\
14937 . substring $ROMAN_WIDTH 1
14939 . length #ROMAN_LENGTH \\*[$ROMAN_WIDTH]
14940 . ds $LIST_ARG_1 \\$1
14941 . substring $LIST_ARG_1 0 -(\\n[#ROMAN_LENGTH]+1)
14943 . el .ds $LIST_ARG_1 \\$1
14945 . nr #STORED_HL_INDENT \\n[#HL_INDENT]
14946 . nr #STORED_T_INDENT \\n[#T_INDENT]
14947 . nr #CURRENT_L_LENGTH \\n[.l]
14949 . if \\n[#INDENT_ACTIVE]=1 \{\
14950 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
14951 . nr #STORED_L_INDENT \\n[#L_INDENT]
14952 . nr #RESTORE_PREV_INDENT 1
14954 . if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
14955 . nr #STORED_BL_INDENT \\n[#BL_INDENT]
14956 . nr #STORED_BR_INDENT \\n[#BR_INDENT]
14958 . nr #ORIG_L_LENGTH \\n[.l]
14960 . nr #RESTORE_PREV_INDENT 2
14962 . if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
14963 . nr #STORED_R_INDENT \\n[#R_INDENT]
14965 . nr #ORIG_L_LENGTH \\n[.l]
14967 . nr #RESTORE_PREV_INDENT 3
14968 . if \\n[#INDENT_LEFT_ACTIVE]=1 .nr #RESTORE_PREV_INDENT 4
14972 . if \\n[#NUM_ARGS]=0 \{\
14973 . nr #ARGS_TO_LIST 1 \" So default behaves as if LIST BULLET
14974 . ds $ENUMERATOR\\n+[#DEPTH] \[bu]
14975 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
14978 . if \\n[#NUM_ARGS]>0 \{\
14979 . rr #ARGS_TO_LIST \" Clear this before processing arg 1.
14980 . if '\\*[$LIST_ARG_1]'DASH' \{\
14981 . nr #ARGS_TO_LIST 1
14982 . ds $ENUMERATOR\\n+[#DEPTH] \[en]
14983 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
14984 . ds $SEPARATOR\\n[#DEPTH]
14986 . if '\\*[$LIST_ARG_1]'BULLET' \{\
14987 . nr #ARGS_TO_LIST 1
14988 . ds $ENUMERATOR\\n+[#DEPTH] \[bu]
14989 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
14990 . ds $SEPARATOR\\n[#DEPTH]
14992 . if '\\*[$LIST_ARG_1]'DIGIT' \{\
14993 . nr #ARGS_TO_LIST 1
14994 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
14995 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
14996 . ds $SEPARATOR\\n[#DEPTH] .
14997 . ds $PREFIX\\n[#DEPTH]
14998 . if \\n[#NUM_ARGS]>=2 \{\
14999 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15000 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15001 . if \\n[#NUM_ARGS]=3 .ds $PREFIX\\n[#DEPTH] \\$3
15004 . if '\\*[$LIST_ARG_1]'alpha' \{\
15005 . nr #ARGS_TO_LIST 1
15006 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15007 . af #ENUMERATOR\\n[#DEPTH] a
15008 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
15009 . ds $SEPARATOR\\n[#DEPTH] )
15010 . ds $PREFIX\\n[#DEPTH]
15011 . if \\n[#NUM_ARGS]>=2 \{\
15012 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15013 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15014 . if \\n[#NUM_ARGS]=3 .ds $PREFIX\\n[#DEPTH] \\$3
15017 . if '\\*[$LIST_ARG_1]'ALPHA' \{\
15018 . nr #ARGS_TO_LIST 1
15019 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15020 . af #ENUMERATOR\\n[#DEPTH] A
15021 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
15022 . ds $SEPARATOR\\n[#DEPTH] )
15023 . ds $PREFIX\\n[#DEPTH]
15024 . if \\n[#NUM_ARGS]>=2 \{\
15025 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15026 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15027 . if \\n[#NUM_ARGS]=3 \{\
15028 . ds $PREFIX\\n[#DEPTH] \\$3
15032 . if '\\*[$1ST_LETTER]'R' \{\
15033 . nr #ARGS_TO_LIST 1
15034 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
15035 . if '\\*[$LIST_ARG_1]'roman' .af #ENUMERATOR\\n[#DEPTH] i
15036 . if '\\*[$LIST_ARG_1]'ROMAN' .af #ENUMERATOR\\n[#DEPTH] I
15037 . ds $ENUMERATOR_TYPE\\n[#DEPTH] roman
15038 . ds $SEPARATOR\\n[#DEPTH] )
15039 . ds $PREFIX\\n[#DEPTH]
15040 . if \\n[#NUM_ARGS]>=2 \{\
15041 . ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
15042 . el .ds $SEPARATOR\\n[#DEPTH] \\$2
15043 . if \\n[#NUM_ARGS]=3 .ds $PREFIX\\n[#DEPTH] \\$3
15046 . if '\\*[$LIST_ARG_1]'USER' \{\
15047 . nr #ARGS_TO_LIST 1
15048 . ds $ENUMERATOR\\n+[#DEPTH] \\$2
15049 . ds $ENUMERATOR_TYPE\\n[#DEPTH] other
15050 . ds $SEPARATOR\\n[#DEPTH]
15051 . ds $PREFIX\\n[#DEPTH]
15053 . if \\n[#NUM_ARGS]=1 \{\
15054 . if !r#ARGS_TO_LIST \{\
15055 . ie \\n[#DEPTH]=1 \{\
15056 . ie \\n[#NEXT_DEPTH_BACK]=0 \{\
15058 . if \\n[#QUIT]=1 \{\
15076 . nr #TOTAL_LISTS \\n[#DEPTH]
15077 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
15078 . nr #LIST_INDENT\\n[#DEPTH] \
15079 \w'\\*[$PREFIX\\n[#DEPTH]]m\\*[$SEPARATOR\\n[#DEPTH]]\ '
15080 . if '\\*[$LIST_ARG_1]'ALPHA' nr #LIST_INDENT\\n[#DEPTH] \
15081 \w'\\*[$PREFIX\\n[#DEPTH]]M\\*[$SEPARATOR\\n[#DEPTH]]\ '
15083 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \
15085 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \
15086 . nr #LIST_INDENT\\n[#DEPTH] \w'\\*[$ENUMERATOR\\n[#DEPTH]]\0'
15087 . ll \\n[#CURRENT_L_LENGTH]u
15088 . ie \\n[#DEPTH]=1 \{\
15089 . ie \\n[#INDENT_ACTIVE]=1 \{\
15090 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
15091 . nr #L_INDENT \\n[#L_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
15092 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15093 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
15095 . if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
15096 . nr #L_INDENT \\n[#BL_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
15097 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15098 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
15100 . if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
15101 . ie \\n[#INDENT_LEFT_ACTIVE]=1 \{\
15102 . \" Don't do anything; we already have a left indent
15105 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15106 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15111 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15112 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15116 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
15117 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
15126 \# Prints enumerator for a given list depth and prepares mom to
15127 \# receive the text of an item.
15130 . if !r#DEPTH .return
15131 . if \\n[#LINENUMBERS]=1 \{\
15133 . nr #LINENUMBERS 2
15135 . if \\n[#KERN]=1 \{\
15136 . nr #KERN_WAS_ON 1
15142 . ll \\n[#CURRENT_L_LENGTH]u \" Set ll again because IL turns IB off.
15144 . HI \\n[#HL_INDENT\\n[#DEPTH]]u
15145 . if '\\*[$SEPARATOR\\n[#DEPTH]]')' .nr #SEP_TYPE 1
15146 . if '\\*[$SEPARATOR\\n[#DEPTH]]']' .nr #SEP_TYPE 1
15147 . if '\\*[$SEPARATOR\\n[#DEPTH]]'}' .nr #SEP_TYPE 1
15148 . ie \\n[#IN_BIB_LIST]=1 \{\
15149 . ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
15150 . ie \\n[#SEP_TYPE]=1 .PRINT \
15151 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\
15152 \\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15154 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15157 . ie \\n[#SEP_TYPE]=1 .PRINT \
15158 \h'-\w'\0'u'\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\
15159 \\n+[#ENUMERATOR\\n[#DEPTH]]\v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15162 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15166 . ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
15168 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
15169 . ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
15170 . ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
15171 . ie \\n[#SEP_TYPE]=1 .PRINT \
15172 \0\v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
15173 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15175 \0\\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15178 . ie \\n[#SEP_TYPE]=1 .PRINT \
15179 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
15180 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15182 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15186 . ie \\n[#SEP_TYPE]=1 .PRINT \
15187 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
15188 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15190 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15195 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'A' \{\
15196 . ie \\n[#SEP_TYPE]=1 .PRINT \
15197 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
15198 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15200 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15204 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15207 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'roman' \{\
15208 . ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
15209 .\" ROMAN I, padded
15210 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
15211 . ie \\n[#SEP_TYPE]=1 .PRINT \
15212 \h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\
15213 \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\0'u'\
15214 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n[#ENUMERATOR\\n[#DEPTH]]\
15215 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15217 \h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\
15218 \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\
15219 \0'u'\\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\
15220 \\*[$SEPARATOR\\n[#DEPTH]]
15222 .\" roman i, padded
15224 \h'\\n[#HL_INDENT\\n[#DEPTH]]u'\h'-\w'\\*[$PREFIX\\n[#DEPTH]]\
15225 \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]\0'u'\
15226 \\*[$PREFIX\\n[#DEPTH]]\\n[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15230 .\" ROMAN I, no pad
15231 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \{\
15232 . ie \\n[#SEP_TYPE]=1 .PRINT \
15233 \v'-.085m'\\*[$PREFIX\\n[#DEPTH]]\v'.085m'\\n+[#ENUMERATOR\\n[#DEPTH]]\
15234 \v'-.085m'\\*[$SEPARATOR\\n[#DEPTH]]\v'.085m'
15236 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15238 .\" roman i, no pad
15240 \\*[$PREFIX\\n[#DEPTH]]\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15243 . if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'other' \
15244 . PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
15248 . if \\n[#REF]=1 \{\
15249 . IL +\\n[#REF_BIB_INDENT]u
15250 . ti \\n[#L_INDENT]u-\\n[#REF_BIB_INDENT]u
15253 . if \\n[#KERN_WAS_ON]=1 \{\
15257 . if \\n[#LINENUMBERS]=2 \{\
15258 . NUMBER_LINES RESUME
15259 . nr #LINENUMBERS 1
15263 \# A utility macro that determines the space to reserve for
15264 \# roman numeral enumerated lists. Limit is 20 roman numerals
15265 \# per list. If this isn't enough, the user can add to the
15268 .MAC GET_ROMAN_INDENT END
15269 . if '\\*[$LIST_ARG_1]'roman' \{\
15270 . if '\\*[$ROMAN_WIDTH]'1' \{\
15271 . ds $ROMAN_WIDTH\\n[#DEPTH] 1
15272 . nr #LIST_INDENT\\n[#DEPTH] \
15273 \w'\\*[$PREFIX\\n[#DEPTH]]i\\*[$SEPARATOR\\n[#DEPTH]]\0'
15275 . if '\\*[$ROMAN_WIDTH]'2' \{\
15276 . ds $ROMAN_WIDTH\\n[#DEPTH] 2
15277 . nr #LIST_INDENT\\n[#DEPTH] \
15278 \w'\\*[$PREFIX\\n[#DEPTH]]ii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15280 . if '\\*[$ROMAN_WIDTH]'3' \{\
15281 . ds $ROMAN_WIDTH\\n[#DEPTH] 3
15282 . nr #LIST_INDENT\\n[#DEPTH] \
15283 \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15285 . if '\\*[$ROMAN_WIDTH]'4' \{\
15286 . ds $ROMAN_WIDTH\\n[#DEPTH] 4
15287 . nr #LIST_INDENT\\n[#DEPTH] \
15288 \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15290 . if '\\*[$ROMAN_WIDTH]'5' \{\
15291 . ds $ROMAN_WIDTH\\n[#DEPTH] 5
15292 . nr #LIST_INDENT\\n[#DEPTH] \
15293 \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15295 . if '\\*[$ROMAN_WIDTH]'6' \{\
15296 . ds $ROMAN_WIDTH\\n[#DEPTH] 6
15297 . nr #LIST_INDENT\\n[#DEPTH] \
15298 \w'\\*[$PREFIX\\n[#DEPTH]]iii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15300 . if '\\*[$ROMAN_WIDTH]'7' \{\
15301 . ds $ROMAN_WIDTH\\n[#DEPTH] 7
15302 . nr #LIST_INDENT\\n[#DEPTH] \
15303 \w'\\*[$PREFIX\\n[#DEPTH]]vii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15305 . if '\\*[$ROMAN_WIDTH]'8' \{\
15306 . ds $ROMAN_WIDTH\\n[#DEPTH] 8
15307 . nr #LIST_INDENT\\n[#DEPTH] \
15308 \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15310 . if '\\*[$ROMAN_WIDTH]'9' \{\
15311 . ds $ROMAN_WIDTH\\n[#DEPTH] 9
15312 . nr #LIST_INDENT\\n[#DEPTH] \
15313 \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15315 . if '\\*[$ROMAN_WIDTH]'10' \{\
15316 . ds $ROMAN_WIDTH\\n[#DEPTH] 10
15317 . nr #LIST_INDENT\\n[#DEPTH] \
15318 \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15320 . if '\\*[$ROMAN_WIDTH]'11' \{\
15321 . ds $ROMAN_WIDTH\\n[#DEPTH] 11
15322 . nr #LIST_INDENT\\n[#DEPTH] \
15323 \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15325 . if '\\*[$ROMAN_WIDTH]'12' \{\
15326 . ds $ROMAN_WIDTH\\n[#DEPTH] 12
15327 . nr #LIST_INDENT\\n[#DEPTH] \
15328 \w'\\*[$PREFIX\\n[#DEPTH]]viii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15330 . if '\\*[$ROMAN_WIDTH]'13' \{\
15331 . ds $ROMAN_WIDTH\\n[#DEPTH] 13
15332 . nr #LIST_INDENT\\n[#DEPTH] \
15333 \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15335 . if '\\*[$ROMAN_WIDTH]'14' \{\
15336 . ds $ROMAN_WIDTH\\n[#DEPTH] 14
15337 . nr #LIST_INDENT\\n[#DEPTH] \
15338 \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15340 . if '\\*[$ROMAN_WIDTH]'15' \{\
15341 . ds $ROMAN_WIDTH\\n[#DEPTH] 15
15342 . nr #LIST_INDENT\\n[#DEPTH] \
15343 \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15345 . if '\\*[$ROMAN_WIDTH]'16' \{\
15346 . ds $ROMAN_WIDTH\\n[#DEPTH] 16
15347 . nr #LIST_INDENT\\n[#DEPTH] \
15348 \w'\\*[$PREFIX\\n[#DEPTH]]xiii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15350 . if '\\*[$ROMAN_WIDTH]'17' \{\
15351 . ds $ROMAN_WIDTH\\n[#DEPTH] 17
15352 . nr #LIST_INDENT\\n[#DEPTH] \
15353 \w'\\*[$PREFIX\\n[#DEPTH]]xvii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15355 . if '\\*[$ROMAN_WIDTH]'18' \{\
15356 . ds $ROMAN_WIDTH\\n[#DEPTH] 18
15357 . nr #LIST_INDENT\\n[#DEPTH] \
15358 \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15360 . if '\\*[$ROMAN_WIDTH]'19' \{\
15361 . ds $ROMAN_WIDTH\\n[#DEPTH] 19
15362 . nr #LIST_INDENT\\n[#DEPTH] \
15363 \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15365 . if '\\*[$ROMAN_WIDTH]'20' \{\
15366 . ds $ROMAN_WIDTH\\n[#DEPTH] 20
15367 . nr #LIST_INDENT\\n[#DEPTH] \
15368 \w'\\*[$PREFIX\\n[#DEPTH]]xviii\\*[$SEPARATOR\\n[#DEPTH]]\0'
15371 . if '\\*[$LIST_ARG_1]'ROMAN' \{\
15372 . if '\\*[$ROMAN_WIDTH]'1' \{\
15373 . ds $ROMAN_WIDTH\\n[#DEPTH] 1
15374 . nr #LIST_INDENT\\n[#DEPTH] \
15375 \w'\\*[$PREFIX\\n[#DEPTH]]I\\*[$SEPARATOR\\n[#DEPTH]]\0'
15377 . if '\\*[$ROMAN_WIDTH]'2' \{\
15378 . ds $ROMAN_WIDTH\\n[#DEPTH] 2
15379 . nr #LIST_INDENT\\n[#DEPTH] \
15380 \w'\\*[$PREFIX\\n[#DEPTH]]II\\*[$SEPARATOR\\n[#DEPTH]]\0'
15382 . if '\\*[$ROMAN_WIDTH]'3' \{\
15383 . ds $ROMAN_WIDTH\\n[#DEPTH] 3
15384 . nr #LIST_INDENT\\n[#DEPTH] \
15385 \w'\\*[$PREFIX\\n[#DEPTH]]III\\*[$SEPARATOR\\n[#DEPTH]]\0'
15387 . if '\\*[$ROMAN_WIDTH]'4' \{\
15388 . ds $ROMAN_WIDTH\\n[#DEPTH] 4
15389 . nr #LIST_INDENT\\n[#DEPTH] \
15390 \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15392 . if '\\*[$ROMAN_WIDTH]'5' \{\
15393 . ds $ROMAN_WIDTH\\n[#DEPTH] 5
15394 . nr #LIST_INDENT\\n[#DEPTH] \
15395 \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15397 . if '\\*[$ROMAN_WIDTH]'6' \{\
15398 . ds $ROMAN_WIDTH\\n[#DEPTH] 6
15399 . nr #LIST_INDENT\\n[#DEPTH] \
15400 \w'\\*[$PREFIX\\n[#DEPTH]]IV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15402 . if '\\*[$ROMAN_WIDTH]'7' \{\
15403 . ds $ROMAN_WIDTH\\n[#DEPTH] 7
15404 . nr #LIST_INDENT\\n[#DEPTH] \
15405 \w'\\*[$PREFIX\\n[#DEPTH]]VII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15407 . if '\\*[$ROMAN_WIDTH]'8' \{\
15408 . ds $ROMAN_WIDTH\\n[#DEPTH] 8
15409 . nr #LIST_INDENT\\n[#DEPTH] \
15410 \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15412 . if '\\*[$ROMAN_WIDTH]'9' \{\
15413 . ds $ROMAN_WIDTH\\n[#DEPTH] 9
15414 . nr #LIST_INDENT\\n[#DEPTH] \
15415 \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15417 . if '\\*[$ROMAN_WIDTH]'10' \{\
15418 . ds $ROMAN_WIDTH\\n[#DEPTH] 10
15419 . nr #LIST_INDENT\\n[#DEPTH] \
15420 \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15422 . if '\\*[$ROMAN_WIDTH]'11' \{\
15423 . ds $ROMAN_WIDTH\\n[#DEPTH] 11
15424 . nr #LIST_INDENT\\n[#DEPTH] \
15425 \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15427 . if '\\*[$ROMAN_WIDTH]'12' \{\
15428 . ds $ROMAN_WIDTH\\n[#DEPTH] 12
15429 . nr #LIST_INDENT\\n[#DEPTH] \
15430 \w'\\*[$PREFIX\\n[#DEPTH]]VIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15432 . if '\\*[$ROMAN_WIDTH]'13' \{\
15433 . ds $ROMAN_WIDTH\\n[#DEPTH] 13
15434 . nr #LIST_INDENT\\n[#DEPTH] \
15435 \w'\\*[$PREFIX\\n[#DEPTH]]XIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15437 . if '\\*[$ROMAN_WIDTH]'14' \{\
15438 . ds $ROMAN_WIDTH\\n[#DEPTH] 14
15439 . nr #LIST_INDENT\\n[#DEPTH] \
15440 \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15442 . if '\\*[$ROMAN_WIDTH]'15' \{\
15443 . ds $ROMAN_WIDTH\\n[#DEPTH] 15
15444 . nr #LIST_INDENT\\n[#DEPTH] \
15445 \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15447 . if '\\*[$ROMAN_WIDTH]'16' \{\
15448 . ds $ROMAN_WIDTH\\n[#DEPTH] 16
15449 . nr #LIST_INDENT\\n[#DEPTH] \
15450 \w'\\*[$PREFIX\\n[#DEPTH]]XIV\\*[$SEPARATOR\\n[#DEPTH]]\0'
15452 . if '\\*[$ROMAN_WIDTH]'17' \{\
15453 . ds $ROMAN_WIDTH\\n[#DEPTH] 17
15454 . nr #LIST_INDENT\\n[#DEPTH] \
15455 \w'\\*[$PREFIX\\n[#DEPTH]]XVII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15457 . if '\\*[$ROMAN_WIDTH]'18' \{\
15458 . ds $ROMAN_WIDTH\\n[#DEPTH] 18
15459 . nr #LIST_INDENT\\n[#DEPTH] \
15460 \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15462 . if '\\*[$ROMAN_WIDTH]'19' \{\
15463 . ds $ROMAN_WIDTH\\n[#DEPTH] 19
15464 . nr #LIST_INDENT\\n[#DEPTH] \
15465 \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15467 . if '\\*[$ROMAN_WIDTH]'20' \{\
15468 . ds $ROMAN_WIDTH\\n[#DEPTH] 20
15469 . nr #LIST_INDENT\\n[#DEPTH] \
15470 \w'\\*[$PREFIX\\n[#DEPTH]]XVIII\\*[$SEPARATOR\\n[#DEPTH]]\0'
15478 \# <amount by which to indent a list to the right>
15480 \# Adds the value of the arg to the current list's indent.
15482 \# Requires a unit of measure.
15484 .MAC SHIFT_LIST END
15485 . nr #SHIFT_LIST\\n[#DEPTH] (\\$1)
15486 . nr #L_INDENT +\\n[#SHIFT_LIST\\n[#DEPTH]]
15494 \# Adds a figure space to a list's hanging and left indent. If
15495 \# LEFT is given, sets reg. #PAD_LIST_DIGITS to 1 for use in ITEM.
15497 .MAC PAD_LIST_DIGITS END
15498 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
15499 . nr #LIST_INDENT\\n[#DEPTH] +\\w'\\0'
15500 . nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#LIST_INDENT\\n-[#DEPTH]]
15501 . nr #HL_INDENT\\n+[#DEPTH] +\\w'\\n[#ENUMERATOR\\n[#DEPTH]]'
15502 . if '\\$1'LEFT' .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1
15504 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'i' \
15505 . if '\\$1'LEFT' .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1
15506 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'I' \
15507 . if '\\$1'LEFT' .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1
15515 \# Resets register enumerators to 1 or a.
15517 .MAC RESET_LIST END
15518 . ie '\\$1'' .nr #ENUMERATOR\\n[#DEPTH] 0 1
15519 . el .nr #ENUMERATOR\\n[#DEPTH] \\$1-1 1
15527 \# Exits lists cleanly and restores any indents that were in
15528 \# effect prior to LIST.
15530 .MAC QUIT_LISTS END
15532 . nr #HL_INDENT \\n[#STORED_HL_INDENT]
15533 . nr #T_INDENT \\n[#STORED_T_INDENT]
15534 . rr #STORED_HL_INDENT
15535 . if \\n[#RESTORE_PREV_INDENT]=1 \{\
15536 . nr #L_INDENT \\n[#STORED_L_INDENT]
15538 . rr #STORED_L_INDENT
15540 . if \\n[#RESTORE_PREV_INDENT]=2 \{\
15541 . nr #BL_INDENT \\n[#STORED_BL_INDENT]
15542 . nr #BR_INDENT \\n[#STORED_BR_INDENT]
15543 . ll \\n[#ORIG_L_LENGTH]u
15545 . rr #STORED_BL_INDENT
15546 . rr #STORED_BR_INDENT
15548 . if \\n[#RESTORE_PREV_INDENT]=3 \{\
15549 . nr #R_INDENT \\n[#STORED_R_INDENT]
15550 . ll \\n[#ORIG_L_LENGTH]u
15552 . rr #STORED_R_INDENT
15554 . if \\n[#RESTORE_PREV_INDENT]=4 \{\
15555 . nr #R_INDENT \\n[#STORED_R_INDENT]
15556 . nr #L_INDENT \\n[#STORED_L_INDENT]
15557 . ll \\n[#ORIG_L_LENGTH]u
15560 . rr #STORED_R_INDENT
15561 . rr #STORED_L_INDENT
15563 .\" Clean up after exiting last depth of list
15565 . while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\
15566 . rr #LIST_INDENT\\n[#REMOVE]
15567 . rr #ENUMERATOR\\n[#REMOVE]
15568 . rm $ENUMERATOR\\n[#REMOVE]
15569 . rm $SEPARATOR\\n[#REMOVE]
15570 . rm $ENUMERATOR_TYPE\\n[#REMOVE]
15571 . rr #PAD_LIST_DIGITS\\n[#REMOVE]
15577 . rr #NEXT_DEPTH_BACK
15578 . rr #RESTORE_PREV_INDENT
15579 . rr #ORIG_L_LENGTH
15580 . rr #CURRENT_L_LENGTH
15582 . rr #IN_ITEM_L_INDENT
15590 \# Restores indent of prev. list in nested lists. Also sets the
15591 \# #QUIT register if an invocation of LIST OFF applies to the first
15594 .MAC SET_LIST_INDENT END
15595 . nr #NEXT_DEPTH_BACK \\n[#DEPTH]-1
15596 . if \\n[#NEXT_DEPTH_BACK]=0 \{\
15600 . nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#SHIFT_LIST\\n[#DEPTH]]
15601 . nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]]
15604 \# ====================================================================
15606 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
15613 \# Turns headers off (if on) and saves header state, sets register
15614 \# #COLLATE to 1 (toggle), and breaks to a new page.
15616 \# COLLATE exists primarily to allow putting multiple chapters in
15617 \# a single file, although it can be used for any document type. After
15618 \# COLLATE, any of the macros that normally precede START may be
15619 \# used, and should behave as expected.
15621 \# N.B.--the START macro must be used after every COLLATE
15627 . nr #COLLATED_DOC 1
15628 . if ( (\\n[.t]-1) <= \\n[.v] ) .nr #NO_BREAK 1
15629 . ds $SAVED_DOC_FAM \\*[$DOC_FAM]
15630 . ds $SAVED_PP_FT \\*[$PP_FT]
15632 . nr #PRE_COLLATE 1
15633 . nr #HEADER_STATE \\n[#HEADERS_ON]
15636 . nr #LOOP \\n[#ACTIVE_LEVELS] \" loop count
15637 . nr #HEAD_1_NUM 0 1
15638 . nr eqn*label-width (\\n[eqn*label-num] >? \\n[eqn*label-width])
15639 . nr pdf-img*label-width (\\n[pdf-img*label-num] >? \\n[pdf-img*label-width])
15640 . nr pic*label-width (\\n[pic*label-num] >? \\n[pic*label-width])
15641 . nr tbl*label-width (\\n[tbl*label-num] >? \\n[tbl*label-width])
15642 . nr fig*label-width (\\n[pdf-img*label-width] >? \\n[pic*label-width])
15643 . if \\n[eqn*label-with-chapter]=1 .nr eqn*label-num 0 1
15644 . if \\n[pdf-img*label-with-chapter]=1 .nr pdf-img*label-num 0 1
15645 . if \\n[pic*label-with-chapter]=1 .nr pic*label-num 0 1
15646 . if \\n[tbl*label-with-chapter]=1 .nr tbl*label-num 0 1
15647 . if (\\n[defer]=0)&(\\n[float*defer]=0) .HEADERS OFF
15648 . if \\n[#DOC_HEADER]=2 .nr #DOC_HEADER 1
15649 . if \\n[#PAGE_NUM_V_POS]=1 \{\
15650 . nr #PAGINATION_STATE \\n[#PAGINATE]
15655 . LL \\n[#DOC_L_LENGTH]u
15656 . QUAD \\*[$DOC_QUAD]
15657 . nr #SAVED_DOC_LEAD \\n[#DOC_LEAD]
15658 . vs \\n[#DOC_LEAD]u
15663 . if \\n[TOC_BH]=1 .pdfswitchtopage before MOM:TOC
15664 . if \\n[TOC_BH]=2 .pdfswitchtopage after MOM:TOC
15666 . if !\\n[#NO_NEWPAGE] .NEWPAGE
15674 . if '\\n[.ev]'PAGE_TRANSITION' .ev
15675 . if \\n[#DEFER_PAGINATION] .PAGINATE
15676 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
15677 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
15678 . rm $RESTORE_PAGENUM_STYLE
15680 . if \\n[#CH_NUM] \
15681 . if \\n[#TOC]=0 .nr #CH_NUM +1
15690 . rr #PAGENUM_STYLE_SET
15695 . if \\n[#RESTORE_PN_V_POS] \{\
15696 . nr #PAGE_NUM_V_POS \\n[#RESTORE_PN_V_POS]
15697 . rr #RESTORE_PN_V_POS
15704 \# <starting line number> [ <increment> [ <gutter> ] ]
15706 \# <anything> | RESUME
15708 \# Begin, suspend/turn off, or resume numbering of output lines.
15710 .MAC NUMBER_LINES END
15712 . if \\n[#QUOTE] \{\
15713 . if \\n[#QUOTE]=1 .ds macro QUOTE
15714 . if \\n[#QUOTE]=2 .ds macro BLOCKQUOTE
15715 . tm1 "[mom]: \\$0 at line \\n[.c] may not be used inside \\*[macro].
15716 . tm1 " Please set NUMBER_LINES before \\*[macro], followed by
15717 . tm1 " NUMBER_\\*[macro]_LINES.
15718 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
15720 . if '\\n[.z]'EPI_TEXT' .return
15722 . tm1 "[mom]: NUMBER_LINES at line \\n[.c] has no argument.
15723 . tm1 " Most likely, you have forgotten to give it a starting line number.
15724 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
15726 . if !\\n[#LINENUMBERS]=2 .nr #LINENUMBERS 1
15727 .\" Test whether the first arg is a digit.
15731 . if !'\\n[.z]'' .nr #RESTORE_LN_NUM 1
15733 . if '\\*[$LN_INC]'' .ds $LN_INC 1
15734 . el .ds $LN_INC \\$2
15736 . if !\\n[#LN_GUTTER] .nr #LN_GUTTER 2
15737 . el .nr #LN_GUTTER \\$3
15740 .\" In other words, the first arg was not a digit.
15742 . ie '\\$1'RESUME' \{\
15749 .\" register ln is still set and may confuse preprocessors like tbl
15750 .\" still, resuming line numbering must be possible, so save ln in $LN_NUM
15751 . ds $LN_NUM \\n[ln]
15752 . if !\\n[#QUOTE] .nr ln 0
15753 . if !\\n[#LINENUMBERS]=2 .rr #LINENUMBERS
15758 . nm \\*[$LN_NUM] \\*[$LN_INC] \\n[#LN_GUTTER] -3-\\n[#LN_GUTTER]
15760 . if !'\\n[.z]'' .nr #DIVER_LN_OFF 1
15765 \# LINENUMBER STYLE PARAMETERS
15766 \# ---------------------------
15770 \# LN_PARAMS sets parameters for line numbers.
15771 \# RESTORE_PARAMS restores them after internal calls to .nm
15774 . ie d$LN_FAM .fam \\*[$LN_FAM]
15775 . el .fam \\n[.fam]
15776 . ie d$LN_FT .ft \\*[$LN_FT]
15778 . ie d$LN_SIZE_CHANGE .ps \\*[$LN_SIZE_CHANGE]
15780 . ie d$LN_COLOR .gcolor \\*[$LN_COLOR]
15781 . el .gcolor \\n[.m]
15784 .MAC RESTORE_PARAMS END
15791 \# NUMBER QUOTE AND BLOCKQUOTE LINES AS PART OF RUNNING TEXT
15792 \# ---------------------------------------------------------
15794 \# <gutter> | <anything>
15796 \# Sets #(B)QUOTE_LN to 1 if no argument, or a single numeric
15797 \# argument, is given; otherwise, turns (BLOCK)QUOTE linenumbering
15800 \# #(B)QUOTE is checked for in QUOTE and BLOCKQUOTE.
15801 \# The single numeric argument allows establishing a different gutter from
15802 \# the one used for line numbers in running text.
15804 .MAC NUMBER_QUOTE_LINES END
15805 . ie \\n[#NUM_ARGS]=0 .nr #QUOTE_LN 1
15809 . nr #Q_LN_GUTTER \\$1
15812 . ie '\\$1'SILENT' .nr #SILENT_QUOTE_LN 1
15815 . rr #SILENT_QUOTE_LN
15821 .MAC NUMBER_BLOCKQUOTE_LINES END
15822 . ie \\n[#NUM_ARGS]=0 .nr #BQUOTE_LN 1
15826 . nr #BQ_LN_GUTTER \\$1
15829 . ie '\\$1'SILENT' .nr #SILENT_BQUOTE_LN 1
15832 . rr #SILENT_BQUOTE_LN
15838 \# OUTPUT BLANK PAGES
15839 \# ------------------
15841 \# <number of blank pages to output> [ DIVIDER [ NULL ] ]
15843 \# Outputs blank pages.
15845 \# If recto/verso, each page is recto/verso, even if there's
15848 \# The 1st argument to BLANKPAGE is non-optional. DIVIDER is for
15849 \# blank pages before endnotes, bibliographies, tocs, new chapters.
15852 . nr #HOW_MANY \\$1
15854 . if \\n[#LINENUMBERS] \{\
15855 . nr #LINENUMBERS_WERE_ON 1
15858 . while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
15859 . if \\n[#HEADERS_ON]=1 \{\
15860 . nr #HEADERS_WERE_ON 1
15863 . if \\n[#PAGE_NUM_V_POS]=1 \{\
15864 . if \\n[#PAGINATE]=1 .nr #PAGINATE_WAS_ON 1
15869 . if \\n[#FOOTERS_ON]=1 \{\
15870 . nr #FOOTERS_WERE_ON 1
15873 . if \\n[#PAGE_NUM_V_POS]=2 \{\
15874 . if \\n[#PAGINATE]=1 .nr #PAGINATE_WAS_ON 1
15875 . nr #RESTORE_PN_V_POS \\n[#PAGE_NUM_V_POS]
15878 . if \\n[#HEADERS_WERE_ON] .HEADERS
15879 . if \\n[#PAGE_NUM_V_POS]=1 \
15880 . if \\n[#PAGINATE_WAS_ON] .PAGINATE
15883 . ie '\\$1'DIVIDER' \{\
15884 . if \\n[#FOOTERS_WERE_ON] .FOOTERS
15885 . if \\n[#RESTORE_PN_V_POS]=2 \{\
15886 . if \\n[#PAGINATE_WAS_ON] .nr #RESTORE_PAGINATION 1
15889 . if '\\$1'NULL' .nr #PAGE_NUM_ADJ -\\n[#HOW_MANY]
15894 . if \\n[#FOOTERS_WERE_ON] .FOOTERS
15895 . if \\n[#PAGE_NUM_V_POS]=2 \
15896 . if \\n[#PAGINATE_WAS_ON] .PAGINATE
15898 . if '\\$1'NULL' \{\
15900 . if \\n[#FOOTERS_WERE_ON] .FOOTERS
15901 . if \\n[#PAGE_NUM_V_POS]=2 \
15902 . if \\n[#PAGINATE_WAS_ON] .PAGINATE
15905 . if \\n[#PAGINATE]=1 \
15906 . if '\\$1'NULL' .nr #PAGE_NUM_ADJ -\\n[#HOW_MANY]
15907 . if \\n[#LINENUMBERS_WERE_ON] .NUMBER_LINES RESUME
15909 . rr #HEADERS_WERE_ON
15910 . rr #FOOTERS_WERE_ON
15911 . rr #PAGINATE_WAS_ON
15917 .am PSPIC \" Need to do this for PSPIC inside a float
15919 \h'(\\n[ps-offset]u + \\n[ps-deswid]u)'
15924 .MAC PROCESS_FLOATS END
15925 . if (\\n[float*defer]>0):(\\n[defer]=0) \{\
15926 . if !\\n[tbl*no-top-hook] .tbl@top-hook
15927 . rr tbl*no-top-hook
15929 . if \\n[defer] \{\
15935 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
15936 . if '\\*[float*type:1]'boxed-tbl' \{\
15938 . if (\\n[.t] >= 1)&(\\n[float-depth:1] > \\n[.t]) \
15939 . tbl*float-warning
15940 . if \\n[#MLA] .sp \\n[tbl*label-lead-diff]u
15941 . if (\\n[tbl*have-caption]=1)&(\\n[tbl*caption-after-label]=0) \
15942 . sp \\n[tbl*caption-lead-diff]u
15943 . if \\n[tbl*caption-after-label] .sp 1n+(\\n[tbl*caption-lead-diff]u*2u)
15945 . if \\n[float*pic] \{\
15946 . if (\\n[pic*have-caption]=1)&(\\n[pic*caption-after-label]=0) \{\
15947 . ie \\n[#COLUMNS] \{\
15951 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u-.5v
15953 . rr pic*caption-lead-diff
15954 . rr pic*top-lead-diff
15957 . if \\n[float*img] \{\
15958 . ie \\n[#COLUMNS] \
15961 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
15963 . nr defer-count \\n[defer]
15964 . nr loop-count 0 1
15966 . while \\n+[loop-count]<=\\n[defer-count] \{\
15967 . nr tbl*no-top-hook 1
15968 . if \\n[defer] .rnn defer float*defer \" So '.if \n[defer]' is skipped during float output
15972 . if \\n[pdf-img*have-caption] \{\
15973 . if !\\n[pdf-img*caption-after-label] .sp -.5v
15975 . rr pdf-img*have-caption
15976 . rr pic*have-caption
15977 . if '\\*[float*type:\\n[loop-count]]'table' \{\
15978 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
15979 . ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_LEAD]u
15981 . ie !\\n[float-span:\\n[loop-count]] \{\
15982 . ie ((\\n[float-depth:\\n[loop-count]]-\\n[.v])>\\n[.t]):(\\n[D-float:\\n[loop-count]]>\\n[.t]) \{\
15983 .\" Insufficient space, defer to next page
15984 . rn FLOAT*DIV:\\n[loop-count] NEW*FLOAT*DIV:\\n+[new-defer]
15985 . rnn float-depth:\\n[loop-count] new-float-depth:\\n[new-defer]
15986 . rnn D-float:\\n[loop-count] new-D-float:\\n[new-defer]
15993 . rr tbl*no-top-hook
15997 . rm FLOAT*DIV:\\n[loop-count]
15998 . rr float-depth:\\n[loop-count]
15999 . rm tbl*header-div:\\n[loop-count]
16000 . rm float*type:\\n[loop-count]
16001 .\" FLOAT arrays are empty now
16002 .\" Rename new arrays (FLOATs deferred to next page) to proper names
16003 . nr loop-count 0 1
16004 . rnn new-defer defer
16005 . while \\n+[loop-count]<=\\n[defer] \{\
16006 . rn NEW*FLOAT*DIV:\\n[loop-count] FLOAT*DIV:\\n[loop-count]
16007 . rnn new-float-depth:\\n[loop-count] float-depth:\\n[loop-count]
16008 . rnn new-D-float:\\n[loop-count] D-float:\\n[loop-count]
16011 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
16012 . ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
16015 . if \\n[#SHIM]>(\\n[#DOC_LEAD]-(\\n[#DOC_LEAD]/4)) 'sp -\\n[#DOC_LEAD]u
16016 . nr tbl*have-header 0
16019 . rr float*before-shim
16020 . rr float*after-shim
16023 . rm float-adj:bottom
16024 . if \\n[#NEWPAGE] \{\
16036 .MAC output-float END
16040 . if \\n[no-top-space] \{\
16041 . ie !\\n[#COLUMNS] \{\
16042 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
16046 . if \\n[float*tbl] \{\
16048 . if \\n[tbl*caption-top-lead-diff] \{\
16049 . sp \\n[tbl*caption-top-lead-diff]u
16050 . rr tbl*caption-top-lead-diff
16055 . if \\n[float*pic] \{\
16056 . nr pic*top-space-adj \\n[#DOC_LEAD]-\\n[pic@text-lead]
16057 . if (\\n[pic*have-caption]=0):(\\n[pic*caption-after-label]=1) \{\
16058 . sp \\n[pic*top-space-adj]u
16060 . if \\n[#COLUMNS] \{\
16061 . if !'\\*[pic*space-adj]'' .sp \\*[pic*space-adj]
16065 . if \\n[float*eqn] \{\
16069 . FLOAT*DIV:\\n[loop-count]
16070 . if \\n[no-top-space] \{\
16076 . if \\n[#COLUMNS] \
16077 . if !'\\*[pic*space-adj]'' .sp -\\*[pic*space-adj]
16079 . if \\n[D-float:\\n[loop-count]] \{\
16081 -\\n[float-depth:\\n[loop-count]]u+\\n[D-float:\\n[loop-count]]u+\\n[#DOC_LEAD]u
16082 . rr D-float:\\n[loop-count]
16089 \# [ ADJUST +|-<amount> ] [ FORCE] [ SPAN] [ NO_SHIM] | <anything>
16091 \# Captures input in a diversion, which is output immediately if
16092 \# there's room on the page; otherwise outputs diversion at top of
16095 \# ADJUST allows for raising or lowering the contents of
16096 \# the diversion within the space allotted. FORCE breaks to
16097 \# a new page immediately.
16100 .\" Case where upcoming .br breaks to a new page, causing a defered float
16101 .\" to be output by HEADER and the defer register to be cleared.
16102 . nr pagenum \\n%+\\n[#PAGE_NUM_ADJ]
16104 .\" Clear .ns when a single line of running text precededs float
16105 .\" at the top of the page.
16106 . if \\n[nl]=\\n[#PAGE_TOP] \{\
16114 . if \\n[#NUM_ARGS]>0 \{\
16115 . nr loop-count 0 1
16116 . nr loop-counter \\n[#NUM_ARGS]
16117 . while \\n+[loop-count]<=\\n[loop-counter] \{\
16118 . if '\\$1'FORCE' \{\
16122 . if '\\$1'SPAN' \{\
16126 . if '\\$1'ADJUST' \{\
16128 . ds float-adj \\$1
16131 . if '\\$1'NO_SHIM' \{\
16132 . nr float*no-shim 1
16146 . if \\n[float*table] \
16147 . if !\\n[tbl*have-header] .ev
16149 . if \\n[tbl*boxed] \{\
16150 . ie !\\n[#MLA] \{\
16151 . ie (\\n[tbl@label]=1):(\\n[tbl@source]=1) .nr dn -.65v
16155 . if !\\n[tbl@source] .nr dn -1.65v
16158 . if (\\n[dn]>\\n[.t]):(\\n[D-float]>\\n[.t]) \{\
16160 . if \\n[tbl*boxed] .rs
16162 . if !\\n[defer] .nr defer 0 1
16163 . rn FLOAT*DIV FLOAT*DIV:\\n+[defer]
16164 . if \\n[float-span] \
16165 . if !\\n[tbl*boxed] .rnn float-span float-span:\\n[defer]
16166 . if \\n[float*tbl] \{\
16167 . if \\n[defer]=1 .nr no-top-space 1
16168 . ie \\n[tbl*boxed] \{\
16169 . ds float*type:\\n[defer] boxed-tbl
16172 . el .ds float*type:\\n[defer] table
16173 . if \\n[tbl*center] .nr float*tbl-center:\\n[defer] 1
16174 . rn tbl*header-div tbl*header-div:\\n[defer]
16177 . if \\n[float*eqn] \{\
16178 . if \\n[defer]=1 .nr no-top-space 1
16179 . ds float*type:\\n[defer] eqn
16181 . if \\n[float*pic] \{\
16182 . ds float*type:\\n[defer] pic
16184 . if \\n[float*img] \{\
16185 . ds float*type:\\n[defer] img
16187 . if \\n[D-float] .nr D-float:\\n[defer] \\n[D-float]
16188 . nr float-depth:\\n[defer] \\n[dn]
16189 . if \\n[#FORCE] \{\
16193 . return \" output div after header
16196 . if !'\\*[float-adj]'' .sp \\*[float-adj]
16197 . if \\n[.u] .nr fill 1
16203 . if \\n[float*tbl] \
16204 . if (\\n[#MLA]=1)&(\\n[tbl@source]=0) \
16206 . if \\n[nl]=\\n[#PAGE_TOP] \{\
16207 . if \\n[tbl*have-caption] \{\
16208 . ie !\\n[#MLA] .sp \\n[tbl*caption-lead-diff]u
16211 . sp \\n[tbl*label-lead-diff]u-.5v
16216 . if \\n[float*tbl] \{\
16217 . ie \\n[tbl*boxed] \{\
16218 . if \\n[dn]=\\n[bx-tbl-depth] .sp .35v
16219 . if \\n[tbl*plain-boxed] .sp .5v
16220 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
16221 . ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
16226 . if '\\*[tbl*label]'' \
16227 . if \\n[tbl*autolabel]=0 .sp
16231 . rm tbl*header-div
16232 . rr tbl*have-caption
16233 . rr tbl*have-label
16234 . rr tbl*have-source
16239 . if \\n[D-float] \
16240 . sp -\\n[dn]u+\\n[#DOC_LEAD]u+\\n[D-float]u
16246 . if !'\\*[float-adj]'' \
16247 . if !\\n[no-adjust] .sp -\\*[float-adj]
16248 . if !\\n[float*no-shim] .SHIM
16252 . rm float-adj:bottom
16259 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
16260 \# ---------------------------------------
16264 \# Sets header/footer/footnotes/etc... traps.
16266 \# Calculates the number of lines that actually fit on a
16267 \# page based on #B_MARGIN and resets page bottom trap to coincide
16268 \# with the depth of that number of lines, or, if #ADJ_DOC_LEAD=1,
16269 \# adjusts #DOC_LEAD so that the last line of text on a page falls
16270 \# exactly on #B_MARGIN.
16272 .MAC RR_@TOP END \" Trap-invoked after first line of text on a new page
16277 . if \\n[.u] .nr fill 1
16283 . if \\n[.vpt]=0 .vpt
16287 . if !\\n[#UNADJUSTED_DOC_LEAD] .nr #UNADJUSTED_DOC_LEAD \\n[#DOC@LEAD]
16288 .\" Remove all header/footer traps
16289 . if !\\n[#NO_TRAP_RESET] \{\
16294 . ch FN_OVERFLOW_TRAP
16295 .\" Plant header trap
16298 .\" Adjust lead so last line of text falls on B_MARGIN
16299 . nr #LINES_PER_PAGE 0 1
16300 . nr #DOC_LEAD_ADJ 0 1
16301 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#ORIGINAL_B_MARGIN]-\\n[#DOC_LEAD]
16302 .\" Get the number of unadjusted lines that fit on the page; always a
16303 .\" bit short of the bottom margin
16304 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
16307 . nr #LINES_PER_PAGE -1
16308 .\" Add machine units, 1 at a time, increasing the leading until the
16309 .\" new leading fills the page properly
16310 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<=\\n[#DEPTH_TO_B_MARGIN] \{\
16313 . DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
16314 .\" The "visual" bottom margin is what \n[nl] would report on the
16315 .\" last line before the FOOTER trap is sprung
16316 . nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD])
16317 .\" Get the difference between #B_MARGIN and #VISUAL_B_MARGIN
16318 . nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
16319 .\" Set #B_MARGIN to 1 machine unit lower on the page than #VISUAL_B_MARGIN
16320 . nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
16321 .\" Set the FN_OVERFLOW_TRAP position
16322 . nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]-\\n[#FN_LEAD]
16323 . if \\n[#PRINT_STYLE]=1 .nr #FN_OVERFLOW_TRAP_POS \\n[#ORIGINAL_B_MARGIN]u
16324 .\" Set footer and footnote overflow traps
16325 . if !\\n[#NO_TRAP_RESET] \{\
16327 . nr #SPACE_REMAINING 0
16329 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
16330 . wh \\n[.p]u FOOTER
16331 . wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
16332 . ch FOOTER -\\n[#B_MARGIN]u
16341 \# Adds left, right, or both indent values to document elements
16342 \# like heads and subheads that are processed in environments.
16344 .MAC CHECK_INDENT END
16345 . if \\n[#INDENT_LEFT_ACTIVE] \{\
16346 . in \\n[#L_INDENT]u
16347 . if \\n[#QUOTE] \{\
16348 . in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
16349 . ll -\\n[#L_INDENT]u
16352 . if \\n[#EPIGRAPH] \{\
16353 . in -\\n[#L_INDENT]u
16354 . ll -\\n[#L_INDENT]u
16358 . if \\n[#INDENT_RIGHT_ACTIVE] \{\
16359 . ll -\\n[#R_INDENT]u
16362 . if \\n[#INDENT_BOTH_ACTIVE] \{\
16363 . in \\n[#BL_INDENT]u
16364 . ll -\\n[#BR_INDENT]u
16366 . if \\n[#QUOTE] \{\
16367 . in -\\n[#BL_INDENT]u
16368 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
16369 . ll -\\n[#BR_INDENT]u
16373 . ll -(\\n[#BR_INDENT]u/2u)
16377 . if \\n[#EPIGRAPH] \{\
16378 . in -\\n[#BL_INDENT]u
16379 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
16380 . ll -\\n[#BR_INDENT]u
16384 . ll -(\\n[#BR_INDENT]u/2u)
16396 \# Removes left, right, or both indent values from document elements
16397 \# like heads and subheads that are processed in environments.
16399 .MAC REMOVE_INDENT END
16401 . ll \\n[#L_LENGTH]u
16405 \# This .em (for all DOC_TYPEs, except 4 [LETTER]) ensures that
16406 \# deferred footnotes that happen on the 2nd to last page get
16410 . ie \\n[#FN_DEPTH] \{\
16411 . ie \\n[#FN_DEFER] \{\
16420 . ch FN_OVERFLOW_TRAP
16425 . ch FN_OVERFLOW_TRAP
16430 \# END MACRO FOR LETTERS
16431 \# ---------------------
16435 \# The .em macro executed at the end of letters. Turns footers
16436 \# and pagination off, terminates and outputs diversion CLOSING
16437 \# (indented with the author's name underneath).
16443 . if \\n[#DOC_TYPE]=4 \{\
16444 . if !'\\n[.z]'' \{\
16446 . ALD \\*[$SIG_SPACE]
16452 . ie !'\\*[$CLOSE_INDENT]'' .IL \\*[$CLOSE_INDENT]
16453 . el .IL \\n[#DOC_L_LENGTH]u/2u
16455 . if \\n[#CLOSING] \{\
16459 . PRINT \\*[$AUTHOR_1]
16463 \# Set up a default papersize of US letter
16467 \# ====================================================================
16469 \# +++DOCUMENT PROCESSING ALIASES+++
16471 \# Aliases to make life easier for users: synonyms, short forms
16472 \# and alternate spellings.
16474 .ALIAS BREAK_BLOCKQUOTE BREAK_QUOTE
16475 .ALIAS BREAK_CITATION BREAK_QUOTE
16476 .ALIAS BREAK_CITE BREAK_QUOTE
16477 .ALIAS BLOCKQUOTE_INDENT QUOTE_INDENT
16478 .ALIAS CITATION BLOCKQUOTE
16479 .ALIAS CITATION_FAMILY BLOCKQUOTE_FAMILY
16480 .ALIAS CITATION_FONT BLOCKQUOTE_FONT
16481 .ALIAS CITATION_SIZE BLOCKQUOTE_SIZE
16482 .ALIAS CITATION_COLOR BLOCKQUOTE_COLOR
16483 .ALIAS CITATION_QUAD BLOCKQUOTE_QUAD
16484 .ALIAS CITE BLOCKQUOTE
16485 .ALIAS CITE_FAMILY BLOCKQUOTE_FAMILY
16486 .ALIAS CITE_FONT BLOCKQUOTE_FONT
16487 .ALIAS CITE_SIZE BLOCKQUOTE_SIZE
16488 .ALIAS CITE_COLOR BLOCKQUOTE_COLOR
16489 .ALIAS CITE_QUAD BLOCKQUOTE_QUAD
16490 .ALIAS DOC_R_MARGIN DOC_RIGHT_MARGIN
16491 .ALIAS DOC_L_MARGIN DOC_LEFT_MARGIN
16492 .ALIAS DOC_L_LENGTH DOC_LINE_LENGTH
16493 .ALIAS DOC_RMARGIN DOC_RIGHT_MARGIN
16494 .ALIAS DOC_LMARGIN DOC_LEFT_MARGIN
16495 .ALIAS DOC_LLENGTH DOC_LINE_LENGTH
16496 .ALIAS DOC_FAM DOC_FAMILY
16497 .ALIAS DOC_LS DOC_LEAD
16498 .ALIAS DOC_PS DOC_PT_SIZE
16500 .ALIAS PAGENUM PAGENUMBER
16501 .ALIAS PAGINATION PAGINATE
16502 .ALIAS PP_FT PP_FONT
16503 .ALIAS REF_INDENT INDENT_REFS
16504 .ALIAS TOC_PS TOC_PT_SIZE
16506 \# HEADER and FOOTER macros
16507 \# ------------------------
16508 \# Because the type-style of headers and footers are managed
16509 \# identically, and the type-style macros (_<type parameter>) all
16510 \# require the correct name of the calling macro, it's necessary
16511 \# to create HEADER_ and FOOTER_ macros here. They're basically
16512 \# aliases of HDRFTR_, but required because you can't alias an
16515 .MAC FOOTER_CENTER_COLOR END
16516 . HDRFTR_CENTER_COLOR \\$1
16519 .MAC FOOTER_CENTER_COLOUR END
16520 . HDRFTR_CENTER_COLOR \\$1
16523 .MAC FOOTER_CENTER_FAM END
16524 . HDRFTR_CENTER_FAMILY \\$1
16527 .MAC FOOTER_CENTER_FAMILY END
16528 . HDRFTR_CENTER_FAMILY \\$1
16531 .MAC FOOTER_CENTER_FONT END
16532 . HDRFTR_CENTER_FONT \\$1
16535 .MAC FOOTER_CENTER_FT END
16536 . HDRFTR_CENTER_FONT \\$1
16539 .MAC FOOTER_CENTER_PS END
16540 . HDRFTR_CENTER_SIZE \\$1
16543 .MAC FOOTER_CENTER_SIZE END
16544 . HDRFTR_CENTER_SIZE \\$1
16547 .MAC FOOTER_CENTRE_CAPS END
16548 . HDRFTR_CENTER_CAPS \\$1
16551 .MAC FOOTER_CENTRE_COLOR END
16552 . HDRFTR_CENTRE_COLOR \\$1
16555 .MAC FOOTER_CENTRE_COLOUR END
16556 . HDRFTR_CENTRE_COLOR \\$1
16559 .MAC FOOTER_CENTRE_FAM END
16560 . HDRFTR_CENTER_FAMILY \\$1
16563 .MAC FOOTER_CENTRE_FAMILY END
16564 . HDRFTR_CENTER_FAMILY \\$1
16567 .MAC FOOTER_CENTRE_FONT END
16568 . HDRFTR_CENTER_FONT \\$1
16571 .MAC FOOTER_CENTRE_FT END
16572 . HDRFTR_CENTER_FONT \\$1
16575 .MAC FOOTER_CENTRE_PS END
16576 . HDRFTR_CENTER_SIZE \\$1
16579 .MAC FOOTER_CENTRE_SIZE END
16580 . HDRFTR_CENTER_SIZE \\$1
16583 .MAC FOOTER_COLOR END
16584 . HDRFTR_COLOR \\$1
16587 .MAC FOOTER_COLOUR END
16588 . HDRFTR_COLOR \\$1
16591 .MAC FOOTER_FAM END
16592 . HDRFTR_FAMILY \\$1
16595 .MAC FOOTER_FAMILY END
16596 . HDRFTR_FAMILY \\$1
16599 .MAC FOOTER_LEFT_COLOR END
16600 . HDRFTR_LEFT_COLOR \\$1
16603 .MAC FOOTER_LEFT_COLOUR END
16604 . HDRFTR_LEFT_COLOR \\$1
16607 .MAC FOOTER_LEFT_FAM END
16608 . HDRFTR_LEFT_FAMILY \\$1
16611 .MAC FOOTER_LEFT_FAMILY END
16612 . HDRFTR_LEFT_FAMILY \\$1
16615 .MAC FOOTER_LEFT_FONT END
16616 . HDRFTR_LEFT_FONT \\$1
16619 .MAC FOOTER_LEFT_FT END
16620 . HDRFTR_LEFT_FONT \\$1
16623 .MAC FOOTER_LEFT_PS END
16624 . HDRFTR_LEFT_SIZE \\$1
16627 .MAC FOOTER_LEFT_SIZE END
16628 . HDRFTR_LEFT_SIZE \\$1
16631 .MAC FOOTER_RIGHT_COLOR END
16632 . HDRFTR_RIGHT_COLOR \\$1
16635 .MAC FOOTER_RIGHT_COLOUR END
16636 . HDRFTR_RIGHT_COLOR \\$1
16639 .MAC FOOTER_RIGHT_FAM END
16640 . HDRFTR_RIGHT_FAMILY \\$1
16643 .MAC FOOTER_RIGHT_FAMILY END
16644 . HDRFTR_RIGHT_FAMILY \\$1
16647 .MAC FOOTER_RIGHT_FONT END
16648 . HDRFTR_RIGHT_FONT \\$1
16651 .MAC FOOTER_RIGHT_FT END
16652 . HDRFTR_RIGHT_FONT \\$1
16655 .MAC FOOTER_RIGHT_PS END
16656 . HDRFTR_RIGHT_SIZE \\$1
16659 .MAC FOOTER_RIGHT_SIZE END
16660 . HDRFTR_RIGHT_SIZE \\$1
16663 .MAC FOOTER_RULE_COLOR END
16664 . HDRFTR_RULE_COLOR \\$1
16667 .MAC FOOTER_SIZE END
16671 .MAC HEADER_CENTER_COLOR END
16672 . HDRFTR_CENTER_COLOR \\$1
16675 .MAC HEADER_CENTER_COLOUR END
16676 . HDRFTR_CENTER_COLOR \\$1
16679 .MAC HEADER_CENTER_FAM END
16680 . HDRFTR_CENTER_FAMILY \\$1
16683 .MAC HEADER_CENTER_FAMILY END
16684 . HDRFTR_CENTER_FAMILY \\$1
16687 .MAC HEADER_CENTER_FONT END
16688 . HDRFTR_CENTER_FONT \\$1
16691 .MAC HEADER_CENTER_FT END
16692 . HDRFTR_CENTER_FONT \\$1
16695 .MAC HEADER_CENTER_PS END
16696 . HDRFTR_CENTER_SIZE \\$1
16699 .MAC HEADER_CENTER_SIZE END
16700 . HDRFTR_CENTER_SIZE \\$1
16703 .MAC HEADER_CENTRE_COLOR END
16704 . HDRFTR_CENTRE_COLOR \\$1
16707 .MAC HEADER_CENTRE_COLOUR END
16708 . HDRFTR_CENTRE_COLOR \\$1
16711 .MAC HEADER_CENTRE_FAM END
16712 . HDRFTR_CENTER_FAMILY \\$1
16715 .MAC HEADER_CENTRE_FAMILY END
16716 . HDRFTR_CENTER_FAMILY \\$1
16719 .MAC HEADER_CENTRE_FONT END
16720 . HDRFTR_CENTER_FONT \\$1
16723 .MAC HEADER_CENTRE_FT END
16724 . HDRFTR_CENTER_FONT \\$1
16727 .MAC HEADER_CENTRE_PS END
16728 . HDRFTR_CENTER_SIZE \\$1
16731 .MAC HEADER_CENTRE_SIZE END
16732 . HDRFTR_CENTER_SIZE \\$1
16735 .MAC HEADER_COLOR END
16736 . HDRFTR_COLOR \\$1
16739 .MAC HEADER_COLOUR END
16740 . HDRFTR_COLOR \\$1
16743 .MAC HEADER_FAM END
16744 . HDRFTR_FAMILY \\$1
16747 .MAC HEADER_FAMILY END
16748 . HDRFTR_FAMILY \\$1
16751 .MAC HEADER_LEFT_COLOR END
16752 . HDRFTR_LEFT_COLOR \\$1
16755 .MAC HEADER_LEFT_COLOUR END
16756 . HDRFTR_LEFT_COLOR \\$1
16759 .MAC HEADER_LEFT_FAM END
16760 . HDRFTR_LEFT_FAMILY \\$1
16763 .MAC HEADER_LEFT_FAMILY END
16764 . HDRFTR_LEFT_FAMILY \\$1
16767 .MAC HEADER_LEFT_FONT END
16768 . HDRFTR_LEFT_FONT \\$1
16771 .MAC HEADER_LEFT_FT END
16772 . HDRFTR_LEFT_FONT \\$1
16775 .MAC HEADER_LEFT_PS END
16776 . HDRFTR_LEFT_SIZE \\$1
16779 .MAC HEADER_LEFT_SIZE END
16780 . HDRFTR_LEFT_SIZE \\$1
16783 .MAC HEADER_RIGHT_COLOR END
16784 . HDRFTR_RIGHT_COLOR \\$1
16787 .MAC HEADER_RIGHT_COLOUR END
16788 . HDRFTR_RIGHT_COLOR \\$1
16791 .MAC HEADER_RIGHT_FAM END
16792 . HDRFTR_RIGHT_FAMILY \\$1
16795 .MAC HEADER_RIGHT_FAMILY END
16796 . HDRFTR_RIGHT_FAMILY \\$1
16799 .MAC HEADER_RIGHT_FONT END
16800 . HDRFTR_RIGHT_FONT \\$1
16803 .MAC HEADER_RIGHT_FT END
16804 . HDRFTR_RIGHT_FONT \\$1
16807 .MAC HEADER_RIGHT_PS END
16808 . HDRFTR_RIGHT_SIZE \\$1
16811 .MAC HEADER_RIGHT_SIZE END
16812 . HDRFTR_RIGHT_SIZE \\$1
16815 .MAC HEADER_RULE_COLOR END
16816 . HDRFTR_RULE_COLOR \\$1
16819 .MAC HEADER_SIZE END
16823 \# HEADER and FOOTER aliases for HDRFTR macros.
16825 .ALIAS BIBLIOGRAPHY_FOOTER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
16826 .ALIAS BIBLIOGRAPHY_FOOTER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
16827 .ALIAS BIBLIOGRAPHY_HEADER_CENTER BIBLIOGRAPHY_HDRFTR_CENTER
16828 .ALIAS BIBLIOGRAPHY_HEADER_CENTRE BIBLIOGRAPHY_HDRFTR_CENTRE
16829 .ALIAS ENDNOTES_FOOTER_CENTER ENDNOTES_HDRFTR_CENTER
16830 .ALIAS ENDNOTES_FOOTER_CENTRE ENDNOTES_HDRFTR_CENTRE
16831 .ALIAS ENDNOTES_HEADER_CENTER ENDNOTES_HDRFTR_CENTER
16832 .ALIAS ENDNOTES_HEADER_CENTRE ENDNOTES_HDRFTR_CENTRE
16833 .ALIAS FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS
16834 .ALIAS FOOTER_CENTER HDRFTR_CENTER
16835 .ALIAS FOOTER_CENTER_PAD HDRFTR_CENTER_PAD
16836 .ALIAS FOOTER_CENTRE HDRFTR_CENTER
16837 .ALIAS FOOTER_CENTRE_PAD HDRFTR_CENTER_PAD
16838 .ALIAS FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS
16839 .ALIAS FOOTER_LEFT HDRFTR_LEFT
16840 .ALIAS FOOTER_PLAIN HDRFTR_PLAIN
16841 .ALIAS FOOTER_RECTO HDRFTR_RECTO
16842 .ALIAS FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
16843 .ALIAS FOOTER_RIGHT HDRFTR_RIGHT
16844 .ALIAS FOOTER_RULE_GAP HDRFTR_RULE_GAP
16845 .ALIAS FOOTER_RULE HDRFTR_RULE
16846 .ALIAS FOOTER_VERSO HDRFTR_VERSO
16847 .ALIAS HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS
16848 .ALIAS HEADER_CENTER HDRFTR_CENTER
16849 .ALIAS HEADER_CENTER_PAD HDRFTR_CENTER_PAD
16850 .ALIAS HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS
16851 .ALIAS HEADER_CENTRE HDRFTR_CENTER
16852 .ALIAS HEADER_CENTRE_PAD HDRFTR_CENTER_PAD
16853 .ALIAS HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS
16854 .ALIAS HEADER_LEFT HDRFTR_LEFT
16855 .ALIAS HEADER_PLAIN HDRFTR_PLAIN
16856 .ALIAS HEADER_RECTO HDRFTR_RECTO
16857 .ALIAS HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
16858 .ALIAS HEADER_RIGHT HDRFTR_RIGHT
16859 .ALIAS HEADER_RULE_GAP HDRFTR_RULE_GAP
16860 .ALIAS HEADER_RULE HDRFTR_RULE
16861 .ALIAS HEADER_VERSO HDRFTR_VERSO
16862 .ALIAS SWITCH_FOOTERS SWITCH_HDRFTR
16863 .ALIAS SWITCH_HEADERS SWITCH_HDRFTR
16865 \# Type-style aliases
16867 .ALIAS AUTHOR_FAMILY _FAMILY
16868 .ALIAS BIBLIOGRAPHY_FAMILY _FAMILY
16869 .ALIAS BIBLIOGRAPHY_STRING_FAMILY _FAMILY
16870 .ALIAS BLOCKQUOTE_FAMILY _FAMILY
16871 .ALIAS CHAPTER_TITLE_FAMILY _FAMILY
16872 .ALIAS COVER_AUTHOR_FAMILY _FAMILY
16873 .ALIAS COVER_CHAPTER_TITLE_FAMILY _FAMILY
16874 .ALIAS COVER_COPYRIGHT_FAMILY _FAMILY
16875 .ALIAS COVER_DOCTYPE_FAMILY _FAMILY
16876 .ALIAS COVER_FAMILY _FAMILY
16877 .ALIAS COVER_MISC_FAMILY _FAMILY
16878 .ALIAS COVER_SUBTITLE_FAMILY _FAMILY
16879 .ALIAS COVER_TITLE_FAMILY _FAMILY
16880 .ALIAS DOC_COVER_AUTHOR_FAMILY _FAMILY
16881 .ALIAS DOC_COVER_CHAPTER_TITLE_FAMILY _FAMILY
16882 .ALIAS DOC_COVER_COPYRIGHT_FAMILY _FAMILY
16883 .ALIAS DOC_COVER_DOCTYPE_FAMILY _FAMILY
16884 .ALIAS DOC_COVER_FAMILY _FAMILY
16885 .ALIAS DOC_COVER_MISC_FAMILY _FAMILY
16886 .ALIAS DOC_COVER_SUBTITLE_FAMILY _FAMILY
16887 .ALIAS DOC_COVER_TITLE_FAMILY _FAMILY
16888 .ALIAS DOCHEADER_FAMILY _FAMILY
16889 .ALIAS DOCTYPE_FAMILY _FAMILY
16890 .ALIAS ENDNOTE_FAMILY _FAMILY
16891 .ALIAS ENDNOTE_NUMBER_FAMILY _FAMILY
16892 .ALIAS ENDNOTE_LINENUMBER_FAMILY _FAMILY
16893 .ALIAS ENDNOTE_STRING_FAMILY _FAMILY
16894 .ALIAS ENDNOTE_TITLE_FAMILY _FAMILY
16895 .ALIAS EPIGRAPH_FAMILY _FAMILY
16896 .ALIAS FOOTNOTE_FAMILY _FAMILY
16897 .ALIAS HDRFTR_CENTER_FAMILY _FAMILY
16898 .ALIAS HDRFTR_FAMILY _FAMILY
16899 .ALIAS HDRFTR_LEFT_FAMILY _FAMILY
16900 .ALIAS HDRFTR_RIGHT_FAMILY _FAMILY
16901 .ALIAS LINENUMBER_FAMILY _FAMILY
16902 .ALIAS PAGENUM_FAMILY _FAMILY
16903 .ALIAS QUOTE_FAMILY _FAMILY
16904 .ALIAS SUBTITLE_FAMILY _FAMILY
16905 .ALIAS TITLE_FAMILY _FAMILY
16906 .ALIAS TOC_FAM _FAMILY
16907 .ALIAS TOC_FAMILY _FAMILY
16908 .ALIAS TOC_HEADER_FAMILY _FAMILY
16909 .ALIAS TOC_PN_FAMILY _FAMILY
16911 .ALIAS AUTHOR_FONT _FONT
16912 .ALIAS BIBLIOGRAPHY_STRING_FONT _FONT
16913 .ALIAS BIBLIOGRAPHY_FONT _FONT
16914 .ALIAS BLOCKQUOTE_FONT _FONT
16915 .ALIAS CHAPTER_TITLE_FONT _FONT
16916 .ALIAS COVER_AUTHOR_FONT _FONT
16917 .ALIAS COVER_CHAPTER_TITLE_FONT _FONT
16918 .ALIAS COVER_COPYRIGHT_FONT _FONT
16919 .ALIAS COVER_DOCTYPE_FONT _FONT
16920 .ALIAS COVER_MISC_FONT _FONT
16921 .ALIAS COVER_SUBTITLE_FONT _FONT
16922 .ALIAS COVER_TITLE_FONT _FONT
16923 .ALIAS DOC_COVER_AUTHOR_FONT _FONT
16924 .ALIAS DOC_COVER_CHAPTER_TITLE_FONT _FONT
16925 .ALIAS DOC_COVER_COPYRIGHT_FONT _FONT
16926 .ALIAS DOC_COVER_DOCTYPE_FONT _FONT
16927 .ALIAS DOC_COVER_MISC_FONT _FONT
16928 .ALIAS DOC_COVER_SUBTITLE_FONT _FONT
16929 .ALIAS DOC_COVER_TITLE_FONT _FONT
16930 .ALIAS DOCTYPE_FONT _FONT
16931 .ALIAS ENDNOTE_FONT _FONT
16932 .ALIAS ENDNOTE_NUMBER_FONT _FONT
16933 .ALIAS ENDNOTE_LINENUMBER_FONT _FONT
16934 .ALIAS ENDNOTE_STRING_FONT _FONT
16935 .ALIAS ENDNOTE_TITLE_FONT _FONT
16936 .ALIAS EPIGRAPH_FONT _FONT
16937 .ALIAS FOOTNOTE_FONT _FONT
16938 .ALIAS HDRFTR_CENTER_FONT _FONT
16939 .ALIAS HDRFTR_LEFT_FONT _FONT
16940 .ALIAS HDRFTR_RIGHT_FONT _FONT
16941 .ALIAS LINENUMBER_FONT _FONT
16942 .ALIAS PAGENUM_FONT _FONT
16943 .ALIAS QUOTE_FONT _FONT
16944 .ALIAS SUBTITLE_FONT _FONT
16945 .ALIAS TITLE_FONT _FONT
16946 .ALIAS TOC_HEADER_FONT _FONT
16947 .ALIAS TOC_PN_FONT _FONT
16949 .ALIAS AUTHOR_SIZE _SIZE
16950 .ALIAS BIBLIOGRAPHY_STRING_SIZE _SIZE
16951 .ALIAS BLOCKQUOTE_SIZE _SIZE
16952 .ALIAS CHAPTER_TITLE_SIZE _SIZE
16953 .ALIAS COVER_AUTHOR_SIZE _SIZE
16954 .ALIAS COVER_CHAPTER_TITLE_SIZE _SIZE
16955 .ALIAS COVER_COPYRIGHT_SIZE _SIZE
16956 .ALIAS COVER_DOCTYPE_SIZE _SIZE
16957 .ALIAS COVER_MISC_SIZE _SIZE
16958 .ALIAS COVER_SUBTITLE_SIZE _SIZE
16959 .ALIAS COVER_TITLE_SIZE _SIZE
16960 .ALIAS DOC_COVER_AUTHOR_SIZE _SIZE
16961 .ALIAS DOC_COVER_CHAPTER_TITLE_SIZE _SIZE
16962 .ALIAS DOC_COVER_COPYRIGHT_SIZE _SIZE
16963 .ALIAS DOC_COVER_DOCTYPE_SIZE _SIZE
16964 .ALIAS DOC_COVER_MISC_SIZE _SIZE
16965 .ALIAS DOC_COVER_SUBTITLE_SIZE _SIZE
16966 .ALIAS DOC_COVER_TITLE_SIZE _SIZE
16967 .ALIAS DOCTYPE_SIZE _SIZE
16968 .ALIAS ENDNOTE_NUMBER_SIZE _SIZE
16969 .ALIAS ENDNOTE_LINENUMBER_SIZE _SIZE
16970 .ALIAS ENDNOTE_STRING_SIZE _SIZE
16971 .ALIAS ENDNOTE_TITLE_SIZE _SIZE
16972 .ALIAS EPIGRAPH_SIZE _SIZE
16973 .ALIAS FOOTNOTE_SIZE _SIZE
16974 .ALIAS HDRFTR_CENTER_SIZE _SIZE
16975 .ALIAS HDRFTR_LEFT_SIZE _SIZE
16976 .ALIAS HDRFTR_RIGHT_SIZE _SIZE
16977 .ALIAS HDRFTR_SIZE _SIZE
16978 .ALIAS LINENUMBER_SIZE _SIZE
16979 .ALIAS PAGENUM_SIZE _SIZE
16980 .ALIAS QUOTE_SIZE _SIZE
16981 .ALIAS SUBTITLE_SIZE _SIZE
16982 .ALIAS TITLE_SIZE _SIZE
16983 .ALIAS TOC_HEADER_SIZE _SIZE
16984 .ALIAS TOC_PN_SIZE _SIZE
16986 .ALIAS ATTRIBUTE_COLOR _COLOR
16987 .ALIAS AUTHOR_COLOR _COLOR
16988 .ALIAS BLOCKQUOTE_COLOR _COLOR
16989 .ALIAS CHAPTER_TITLE_COLOR _COLOR
16990 .ALIAS CODE_COLOR _COLOR
16991 .ALIAS COVER_ATTRIBUTE_COLOR _COLOR
16992 .ALIAS COVER_AUTHOR_COLOR _COLOR
16993 .ALIAS COVER_CHAPTER_TITLE_COLOR _COLOR
16994 .ALIAS COVER_COLOR _COLOR
16995 .ALIAS COVER_COPYRIGHT_COLOR _COLOR
16996 .ALIAS COVER_DOCTYPE_COLOR _COLOR
16997 .ALIAS COVER_MISC_COLOR _COLOR
16998 .ALIAS COVER_SUBTITLE_COLOR _COLOR
16999 .ALIAS COVER_TITLE_COLOR _COLOR
17000 .ALIAS DOC_COVER_ATTRIBUTE_COLOR _COLOR
17001 .ALIAS DOC_COVER_AUTHOR_COLOR _COLOR
17002 .ALIAS DOC_COVER_CHAPTER_TITLE_COLOR _COLOR
17003 .ALIAS DOC_COVER_COLOR _COLOR
17004 .ALIAS DOC_COVER_COPYRIGHT_COLOR _COLOR
17005 .ALIAS DOC_COVER_DOCTYPE_COLOR _COLOR
17006 .ALIAS DOC_COVER_MISC_COLOR _COLOR
17007 .ALIAS DOC_COVER_SUBTITLE_COLOR _COLOR
17008 .ALIAS DOC_COVER_TITLE_COLOR _COLOR
17009 .ALIAS DOCHEADER_COLOR _COLOR
17010 .ALIAS DOCTYPE_COLOR _COLOR
17011 .ALIAS ENDNOTE_STRING_COLOR _COLOR
17012 .ALIAS EPIGRAPH_COLOR _COLOR
17013 .ALIAS FINIS_COLOR _COLOR
17014 .ALIAS FOOTNOTE_COLOR _COLOR
17015 .ALIAS HDRFTR_CENTER_COLOR _COLOR
17016 .ALIAS HDRFTR_COLOR _COLOR
17017 .ALIAS HDRFTR_LEFT_COLOR _COLOR
17018 .ALIAS HDRFTR_RIGHT_COLOR _COLOR
17019 .ALIAS HDRFTR_RULE_COLOR _COLOR
17020 .ALIAS LINEBREAK_COLOR _COLOR
17021 .ALIAS LINENUMBER_COLOR _COLOR
17022 .ALIAS PAGENUM_COLOR _COLOR
17023 .ALIAS QUOTE_COLOR _COLOR
17024 .ALIAS SECTION_COLOR _COLOR
17025 .ALIAS SUBTITLE_COLOR _COLOR
17026 .ALIAS TITLE_COLOR _COLOR
17028 .ALIAS BIBLIOGRAPHY_QUAD _QUAD
17029 .ALIAS BIBLIOGRAPHY_STRING_QUAD _QUAD
17030 .ALIAS BLOCKQUOTE_QUAD _QUAD
17031 .ALIAS COVER_COPYRIGHT_QUAD _QUAD
17032 .ALIAS COVER_MISC_QUAD _QUAD
17033 .ALIAS COVER_QUAD _QUAD
17034 .ALIAS DOC_COVER_COPYRIGHT_QUAD _QUAD
17035 .ALIAS DOC_COVER_MISC_QUAD _QUAD
17036 .ALIAS DOC_COVER_QUAD _QUAD
17037 .ALIAS DOCHEADER_QUAD _QUAD
17038 .ALIAS DOC_QUAD _QUAD
17039 .ALIAS ENDNOTE_QUAD _QUAD
17040 .ALIAS ENDNOTE_STRING_QUAD _QUAD
17041 .ALIAS ENDNOTE_TITLE_QUAD _QUAD
17042 .ALIAS EPIGRAPH_QUAD _QUAD
17043 .ALIAS FOOTNOTE_QUAD _QUAD
17044 .ALIAS TOC_HEADER_QUAD _QUAD
17048 .ALIAS COL_BREAK COL_NEXT
17049 .ALIAS DOC_COVER_ADVANCE COVER_ADVANCE
17050 .ALIAS DOC_COVER COVER
17051 .ALIAS DOC_COVER_COUNTS_PAGES COVER_COUNTS_PAGES
17052 .ALIAS DOC_COVERS COVERS
17053 .ALIAS DOC_COVER_LEAD COVER_LEAD
17054 .ALIAS DOC_COVERTITLE COVERTITLE
17055 .ALIAS DO_DOC_COVER DO_COVER
17056 .ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE
17058 \# Miscellaneous aliases
17059 .ALIAS SECTION LINEBREAK
17060 .ALIAS SECTION_CHAR LINEBREAK_CHAR
17062 \# Miscellaneous macros to take care of backward compatibility
17063 \# -----------------------------------------------------------
17065 \# As of 1.1.9, EL and TN got changed to make TRAP...TRAP OFF
17066 \# unnecessary for users. However, I used both macros extensively
17067 \# throughout this file (in conjunction with TRAP...TRAP OFF).
17068 \# EOL is the old EL; used only in om.tmac.
17073 . nr #RESTORE_TRAP 1
17077 . if \\n[#RESTORE_TRAP] \{\
17084 \# PREPROCESSOR SUPPORT
17085 \# ====================
17087 \# Utility macros--label and caption styles, lists collector, lists
17090 .nr lists*target 0 1
17092 .MAC get-label-type END
17093 . if \\n[all]=1 .ds label-type eqn
17094 . if \\n[all]=2 .ds label-type pdf-img
17095 . if \\n[all]=3 .ds label-type pic
17096 . if \\n[all]=4 .ds label-type tbl
17099 .MAC set-defaults END
17100 . if '\\*[\\*[label-type]*\\*[spec-type]-family]'' \
17101 . ds \\*[label-type]*\\*[spec-type]-family \\*[$DOC_FAM]\"
17102 . if '\\*[\\*[label-type]*\\*[spec-type]-font]'' \
17103 . ds \\*[label-type]*\\*[spec-type]-font R\"
17104 . if '\\*[\\*[label-type]*\\*[spec-type]-size-change]'' \
17105 . ds \\*[label-type]*\\*[spec-type]-size-change +0\"
17106 . if !r \\*[label-type]*\\*[spec-type]-autolead \
17107 . nr \\*[label-type]*\\*[spec-type]-autolead 2
17108 . if '\\*[\\*[label-type]*\\*[spec-type]-color]'' \
17109 . ds \\*[label-type]*\\*[spec-type]-color black\"
17110 . if '\\*[\\*[label-type]*\\*[spec-type]-quad]'' \{\
17111 . ie '\\*[label-type]'eqn' \{\
17112 . if '\\*[spec-type]'caption' \
17113 . ds \\*[label-type]*\\*[spec-type]-quad C\"
17115 . el .ds \\*[label-type]*\\*[spec-type]-quad L\"
17117 . if '\\n[\\*[label-type]*\\*[spec-type]-quad-on-ll]'' \
17118 . nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
17119 . if '\\*[spec-type]'caption' \{\
17120 . nr default-left 1
17124 .MAC set-inline-specs END
17125 . ds \\*[label-type]*\\*[spec-type]-specs \
17126 \f[\\*[\\*[label-type]*\\*[spec-type]-family]\\*[\\*[label-type]*\\*[spec-type]-font]]\
17127 \s[\\*[\\*[label-type]*\\*[spec-type]-size-change]]\
17128 \m[\\*[\\*[label-type]*\\*[spec-type]-color]]
17131 \# Line lengths, indents, and quads for captions and labels.
17132 \# Aliased for eqn, pic, pdf-image, and tbl.
17135 . ds label-type \\$0
17136 . substring label-type 0 2
17137 . if '\\*[label-type]'PDF' .ds label-type pdf-img
17138 . if '\\*[label-type]'TBL' .ds label-type tbl
17139 . if '\\*[label-type]'PIC' .ds label-type pic
17140 . if '\\*[label-type]'EQN' .ds label-type eqn
17141 . ds spec-type \\$0
17142 . substring spec-type -6 -10
17143 . if '\\*[spec-type]'PTION' .ds spec-type caption
17144 . if '\\*[spec-type]'LABEL' .ds spec-type label
17145 . if '\\*[spec-type]'OURCE' .ds spec-type source
17147 . ds \\*[label-type]*\\*[spec-type]-quad \\$1
17148 . substring \\*[label-type]*\\*[spec-type]-quad 0 0
17149 . if '\\*[label-type]'pdf-img' \{\
17150 . if '\\*[\\*[label-type]*\\*[spec-type]-quad]'L' \{\
17151 . if !\\n[pdf-img*\\*[spec-type]-quad-on-ll] \{\
17152 . ie !'\\*[pdf-img:pos]'-R' \
17153 . ll \\n[pdf-img:ind]u+\\n[pdf-img:width]u+\\n[pdf-img:frame-inset]u
17154 . el .ll -\\n[ind-pre-img]u
17155 . if '\\*[pdf-img:pos]'-C' \
17156 . in \\n[pdf-img:ind]u-\\n[pdf-img:frame-inset]u
17157 . if '\\*[pdf-img:pos]'-R' \
17158 . in \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u))
17159 . if '\\*[pdf-img:pos]'-I' \
17160 . in \\n[pdf-img:ind]u
17163 . if '\\*[\\*[label-type]*\\*[spec-type]-quad]'C' \{\
17164 . if !\\n[pdf-img*\\*[spec-type]-quad-on-ll] \{\
17165 . if '\\*[pdf-img:pos]'-L' \
17166 . ll \\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)
17167 . if '\\*[pdf-img:pos]'-C' \{\
17168 . ll (\\n[ll-pre-img]u-\\n[pdf-img:width]u/2u+(\\n[pdf-img:frame-inset]u))+\\n[pdf-img:width]u
17169 . in \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u))
17171 . if '\\*[pdf-img:pos]'-R' \{\
17172 . ll -\\n[ind-pre-img]u
17173 . in \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u))
17175 . if '\\*[pdf-img:pos]'-I' \{\
17176 . ll \\n[pdf-img:ind]u+\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)
17177 . in \\n[pdf-img:ind]u
17181 . if '\\*[\\*[label-type]*\\*[spec-type]-quad]'R' \{\
17182 . if !\\n[pdf-img*\\*[spec-type]-quad-on-ll] \{\
17183 . if '\\*[pdf-img:pos]'-L' \
17184 . ll \\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u]
17185 . if '\\*[pdf-img:pos]'-C' \{\
17186 . ll (\\n[.l]u-\\n[ind-pre-img]u-\\n[pdf-img:width]u/2u)+\\n[pdf-img:width]u+\\n[pdf-img:frame-inset]u
17187 . in \\n[pdf-img:ind]u
17189 . if '\\*[pdf-img:pos]'-R' \{\
17190 . ll -\\n[ind-pre-img]u
17191 . in \\n[.l]u-\\n[pdf-img:width]u
17193 . if '\\*[pdf-img:pos]'-I' \{\
17194 . ll \\n[pdf-img:ind]u+\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)
17195 . in \\n[pdf-img:ind]u
17200 . if '\\*[label-type]'pic' \{\
17201 . if !\\n[pic*\\*[spec-type]-quad-on-ll] \{\
17202 . ie \\n[pic*left] .ll \\n[pic*div-width]u
17204 . ll \\n[pic*div-width]u
17205 \!. in \\n[ll-pre-pic]u-\\n[pic*div-width]u/2u
17209 . if '\\*[label-type]'tbl' \{\
17210 . if !\\n[tbl*\\*[spec-type]-quad-on-ll] \{\
17211 . ie \\n[tbl*center] \{\
17212 . ie '\\*[spec-type]'label' \{\
17213 . ll \\n[ll-pre-tbl]u-\\n[TW]u/2u+\\n[TW]u
17214 \!. in \\n[ll-pre-tbl]u-\\n[TW]u/2u
17218 \!. in \\n[ll-pre-tbl]u-\\n[TW]u/2u
17226 .ALIAS TBL*SET_CAPTION_QUAD SET_QUAD
17227 .ALIAS TBL*SET_LABEL_QUAD SET_QUAD
17228 .ALIAS TBL*SET_SOURCE_QUAD SET_QUAD
17229 .ALIAS PDF_IMG*SET_CAPTION_QUAD SET_QUAD
17230 .ALIAS PDF_IMG*SET_LABEL_QUAD SET_QUAD
17231 .ALIAS PIC*SET_CAPTION_QUAD SET_QUAD
17232 .ALIAS PIC*SET_LABEL_QUAD SET_QUAD
17235 . ds label-type \\$0
17236 . substring label-type 0 2
17237 . if '\\*[label-type]'img' .ds label-type pdf-img
17238 . if '\\*[label-type]'tbl' .ds label-type tbl
17239 . if '\\*[label-type]'pic' .ds label-type pic
17240 . ds spec-type \\$0
17241 . substring spec-type 4 6
17242 . if '\\*[spec-type]'cap' .ds spec-type caption
17243 . if '\\*[spec-type]'lab' .ds spec-type label
17244 . if '\\*[spec-type]'sou' .ds spec-type source
17245 . fam \\*[\\*[label-type]*\\*[spec-type]-family]
17246 . ft \\*[\\*[label-type]*\\*[spec-type]-font]
17247 . ps \\n[#DOC_PT_SIZE]u\\*[\\*[label-type]*\\*[spec-type]-size-change]
17248 . gcolor \\*[\\*[label-type]*\\*[spec-type]-color]
17251 .ALIAS tbl*caption-style style
17252 .ALIAS tbl*label-style style
17253 .ALIAS tbl*source-style style
17254 .ALIAS img*caption-style style
17255 .ALIAS img*label-style style
17256 .ALIAS img*source-style style
17257 .ALIAS pic*caption-style style
17258 .ALIAS pic*label-style style
17259 .ALIAS pic*source-style style
17261 \# User style macros
17263 \# TYPE SPECS FOR LABELS, CAPTIONS, AND SOURCES
17264 \# --------------------------------------------
17265 \# Aliased as CAPTIONS and LABELS for eqn, pic, tbl, and pdf images.
17267 \# EQN | IMG | PIC | TBL \
17268 \# Remaining arguments are optional
17272 \# QUAD LEFT | CENTRE | RIGHT [ ON_LL ] \
17277 \# Sets type specs for captions, labels, and sources according to
17278 \# calling alias name
17280 \# SIZE is relative to running text.
17281 \# QUAD optional arg says quad on full line length rather than
17282 \# pdf-img or pre-processor output.
17284 .MAC CAPTION_LABEL_SPECS END
17285 . if '\\$0'CAPTIONS' .ds spec-type caption
17286 . if '\\$0'LABELS' .ds spec-type label
17287 . if '\\$0'SOURCES' .ds spec-type source
17288 . if '\\$1'EQN' .ds label-type eqn
17289 . if '\\$1'IMG' .ds label-type pdf-img
17290 . if '\\$1'PIC' .ds label-type pic
17291 . if '\\$1'TBL' .ds label-type tbl
17292 . if '\\$1'ALL' .nr all 1
17294 . nr loop-counter \\n[#NUM_ARGS]
17295 . nr loop-count 0 1
17296 . while \\n+[loop-count]<=\\n[loop-counter] \{\
17297 . if '\\$1'FAMILY' \{\
17301 . while \\n+[all]<=4 \{\
17303 . ds \\*[label-type]*\\*[spec-type]-family \\$1
17306 . el .ds \\*[label-type]*\\*[spec-type]-family \\$1
17307 . if \\n[#PRINT_STYLE]=1 \
17308 . ds \\*[label-type]*\\*[spec-type]-family \\*[$TYPEWRITER_FAM]
17311 . if '\\$1'FONT' \{\
17315 . while \\n+[all]<=4 \{\
17317 . ds \\*[label-type]*\\*[spec-type]-font \\$1
17320 . el .ds \\*[label-type]*\\*[spec-type]-font \\$1
17321 . if \\n[#PRINT_STYLE]=1 \
17322 . ds \\*[label-type]*\\*[spec-type]-font R
17325 . if '\\$1'SIZE' \{\
17329 . while \\n+[all]<=4 \{\
17331 . ds \\*[label-type]*\\*[spec-type]-size-change \\$1
17334 . el .ds \\*[label-type]*\\*[spec-type]-size-change \\$1
17335 . if \\n[#PRINT_STYLE]=1 \
17336 . ds \\*[label-type]*\\*[spec-type]-size-change +0
17339 . if '\\$1'AUTOLEAD' \{\
17343 . while \\n+[all]<=4 \{\
17345 . nr \\*[label-type]*\\*[spec-type]-autolead (p;\\$1)
17348 . el .nr \\*[label-type]*\\*[spec-type]-autolead (p;\\$1)
17351 . if '\\$1'QUAD' \{\
17355 . while \\n+[all]<=4 \{\
17357 . ds \\*[label-type]*\\*[spec-type]-quad \\$1
17358 . substring \\*[label-type]*\\*[spec-type]-quad 0 0
17362 . ds \\*[label-type]*\\*[spec-type]-quad \\$1
17363 . substring \\*[label-type]*\\*[spec-type]-quad 0 0
17364 . if \\n[\\*[label-type]*\\*[spec-type]-quad-on-ll] \
17365 . rr \\*[label-type]*\\*[spec-type]-quad-on-ll
17368 . if '\\$1'ON_LL' \{\
17369 . nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
17373 . if '\\$1'COLOR' \{\
17377 . while \\n+[all]<=4 \{\
17379 . ds \\*[label-type]*\\*[spec-type]-color \\$1
17382 . el .ds \\*[label-type]*\\*[spec-type]-color \\$1
17383 . if \\n[#PRINT_STYLE]=1 \
17384 . ds \\*[label-type]*\\*[spec-type]-color black
17387 . if '\\$1'ADJUST' \{\
17391 . while \\n+[all]<=4 \{\
17393 . ds \\*[label-type]*\\*[spec-type]-space \\$1
17396 . el .ds \\*[label-type]*\\*[spec-type]-space \\$1
17397 . if \\n[#PRINT_STYLE]=1 \
17398 . ds \\*[label-type]*\\*[spec-type]-space +0
17404 . while \\n+[all]<=4 \{\
17414 . ds revert-specs \f[]\s[0]\m[]
17418 .ALIAS CAPTIONS CAPTION_LABEL_SPECS
17419 .ALIAS LABELS CAPTION_LABEL_SPECS
17420 .ALIAS SOURCES CAPTION_LABEL_SPECS
17422 \# CAPTION_AFTER_LABEL
17423 \# -------------------
17425 \# <none> | <anything>
17427 \# Sets register indicating non-MLA captions should come after labels.
17429 .MAC CAPTION_AFTER_LABEL END
17430 . if '\\$1'IMG' .ds type pdf-img
17431 . if '\\$1'PIC' .ds type pic
17432 . if '\\$1'TBL' .ds type tbl
17433 . if !\\n[#MLA] \{\
17434 . nr \\*[type]*caption-after-label 1
17435 . if '\\$1'ALL' \{\
17436 . if '\\$1'IMG' .nr pdf-img*caption-after-label 1
17437 . if '\\$1'TBL' .nr tbl*caption-after-label 1
17438 . if '\\$1'PIC' .nr pic*caption-after-label 1
17441 . ie !'\\$1'ALL' .rr \\*[type]*caption-after-label
17443 . rr pdf-img*caption-after-label
17444 . rr tbl*caption-after-label
17445 . rr pic*caption-after-label
17454 \# [ PREFIX <prefix> SUFFIX <suffix> ] | <anything>
17456 \# Turns label autonumbering on of off; optionally lets user set
17457 \# prefix and suffix for labels.
17459 \# Aliased for images (pdf), tbl, pic, and eqn.
17462 . if '\\$0'AUTOLABEL_EQUATIONS' .ds label-type eqn
17463 . if '\\$0'AUTOLABEL_IMAGES' .ds label-type pdf-img
17464 . if '\\$0'AUTOLABEL_PIC' .ds label-type pic
17465 . if '\\$0'AUTOLABEL_TABLES' .ds label-type tbl
17467 . ds \\*[label-type]-label-args \\$1
17468 . substring \\*[label-type]-label-args -1 -3
17470 . if '\\*[\\*[label-type]-label-args]'FIX' .nr \\*[label-type]-label-args 1
17471 . if '\\*[\\*[label-type]-label-args]'TER' .nr \\*[label-type]-label-args 1
17472 . if !\\n[\\*[label-type]*label-num] \
17473 . nr \\*[label-type]*label-num 0 1
17474 . if '\\*[label-type]'pdf-img' .nr fig*label-num 0 1
17475 . if '\\*[label-type]'pic' .nr fig*label-num 0 1
17476 . nr \\*[label-type]*autolabel 1
17477 . nr loop-counter 0 1
17478 . nr loop-count \\n[#NUM_ARGS]
17479 . while \\n+[loop-counter]<=\\n[loop-count] \{\
17480 . if '\\$1'PREFIX' \{\
17481 . ds \\*[label-type]*label-prfx \\$2
17482 . nr \\*[label-type]*label-prfx-set 1
17485 . if '\\$1'SUFFIX' \{\
17486 . ds \\*[label-type]*label-sffx \\$2
17487 . nr \\*[label-type]*label-sffx-set 1
17490 . if '\\$1'PREFIX_CHAPTER' \{\
17491 . nr \\*[label-type]*label-with-chapter 1
17493 . ie \B'\\$2' .nr #CH_NUM \\$2
17494 . el .autolabel@error
17497 . ie \\n[#CHAPTER_CALLED] \
17498 . ie \B'\\*[$CHAPTER]' .nr #CH_NUM \\*[$CHAPTER]
17499 . el .autolabel@error \\$0
17500 . el .autolabel@error \\$0
17505 . if '\\*[\\*[label-type]*label-prfx]'' \{\
17506 . if '\\*[label-type]'eqn' \
17507 . if !\\n[\\*[label-type]*label-prfx-set] \
17508 . ds \\*[label-type]*label-prfx (\"
17509 . if '\\*[label-type]'pic' \
17510 . if !\\n[\\*[label-type]*label-prfx-set] \
17511 . ds \\*[label-type]*label-prfx Fig. \"
17512 . if '\\*[label-type]'pdf-img' \
17513 . if !\\n[\\*[label-type]*label-prfx-set] \
17514 . ds \\*[label-type]*label-prfx Fig. \"
17515 . if '\\*[label-type]'tbl' \
17516 . if !\\n[\\*[label-type]*label-prfx-set] \
17517 . ds \\*[label-type]*label-prfx Table \"
17519 . if '\\*[\\*[label-type]*label-sffx]'' \{\
17520 . if '\\*[label-type]'eqn' \
17521 . if !\\n[\\*[label-type]*label-sffx-set] \
17522 . ds \\*[label-type]*label-sffx )\"
17523 . if '\\*[label-type]'pic' \
17524 . if !\\n[\\*[label-type]*label-sffx-set] \
17525 . ds \\*[label-type]*label-sffx .\"
17526 . if '\\*[label-type]'pdf-img' \
17527 . if !\\n[\\*[label-type]*label-sffx-set] \
17528 . ds \\*[label-type]*label-sffx .\"
17529 . if '\\*[label-type]'tbl' \
17530 . if !\\n[\\*[label-type]*label-sffx-set] \
17531 . ds \\*[label-type]*label-sffx .\"
17533 . ie \\n[args]>0 \{\
17534 . if \\n[\\*[label-type]*label-prfx-set]+\\n[\\*[label-type]*label-sffx-set]=1 \{\
17535 . ie (\\n[\\*[label-type]*label-prfx-set]=1)&(\\n[\\*[label-type]*label-sffx-set]=0) \
17536 . ds missing-arg SUFFIX
17537 . el .ds missing-arg PREFIX
17538 . tm1 "[mom]: You must supply a \\*[missing-arg] argument to \\$0.
17539 . tm1 " If you wish the \\*[missing-arg] to be blank, use \\*[missing-arg] "".
17540 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
17542 . if !\\n[\\*[label-type]-label-args] \{\
17543 . rr \\*[label-type]*autolabel
17544 . rr \\*[label-type]*label-prfx-set
17545 . rr \\*[label-type]*label-suffx-set
17546 . rr \\*[label-type]-label-args
17549 . rr \\*[label-type]-label-args
17552 .ALIAS AUTOLABEL_EQUATIONS AUTOLABEL
17553 .ALIAS AUTOLABEL_IMAGES AUTOLABEL
17554 .ALIAS AUTOLABEL_PIC AUTOLABEL
17555 .ALIAS AUTOLABEL_TABLES AUTOLABEL
17557 .MAC autolabel@error END
17558 . tm1 "[mom]: \\$1 cannot determine a chapter number.
17559 . tm1 " Enter the current chapter number as a digit after the
17560 . tm1 " PREFIX_CHAPTER argument at line \\n[.c].
17561 . ab Aborting '\\n[.F]', line \\n[.c].
17567 \# <none> | <anything>
17569 \# Sets or removes register #MLA.
17571 \# MLA formatting differs from other styles wrt caption and
17572 \# label placement.
17577 . nr pdf-img*caption-after-label 1
17578 . nr pic*caption-after-label 1
17579 . rr tbl*caption-after-label
17587 . tm1 "[mom]: MLA style enabled, but \\$1 has no corresponding \\$2.
17588 . ab Aborting '\\$3' at \\$4, line \\$5.
17594 \# LIST_OF_EQUATIONS
17598 \# TITLE_STRING <string> START_PAGENUM <pagenumber>
17600 \# Generates lists-of based on calling alias.
17602 \# Called at end of file.
17603 \# If after TOC, and TOC is being auto-relocated, lists are also
17604 \# relocated. If called before, lists are output at end of file.
17607 . ds $LIST_TYPE \\$0
17608 . substring $LIST_TYPE -1 -4
17609 . if '\\*[$LIST_TYPE]'URES' \{\
17610 . ds $LIST_TYPE FIGURES
17611 . ds \\*[$LIST_TYPE]_TITLE_STRING "List of Figures
17613 . if '\\*[$LIST_TYPE]'BLES' \{\
17614 . ds $LIST_TYPE TABLES
17615 . ds \\*[$LIST_TYPE]_TITLE_STRING "List of Tables
17617 . if '\\*[$LIST_TYPE]'IONS' \{\
17618 . ds $LIST_TYPE EQUATIONS
17619 . ds \\*[$LIST_TYPE]_TITLE_STRING "List of Equations
17621 . nr #LIST_OF_\\*[$LIST_TYPE] 1
17622 . nr loop-count 0 1
17623 . nr loop-counter \\n[#NUM_ARGS]
17624 . while \\n+[loop-count]<=\\n[loop-counter] \{\
17625 . if '\\$1'TITLE_STRING' \{\
17626 . ds \\*[$LIST_TYPE]_TITLE_STRING \\$2
17629 . if '\\$1'START_PAGENUM' \{\
17630 . nr #\\*[$LIST_TYPE]_START_PAGENUM \\$2
17634 . char \[leader] " .
17635 . LEADER_CHARACTER \[leader]
17636 . if \\n[#LINENUMBERS]=1 \{\
17638 . nr #LINENUMBERS 2
17640 . if \\n[#FINIS] \{\
17641 . if \\n[#FOOTERS_WERE_ON] \
17644 . if \\n[#FOOTERS_ON]=1 \{\
17645 . if !'\\*[$HDRFTR_CENTER_OLD]'' .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD]
17646 . ie \\n[#LISTS_NO_PAGENUM]=1 .PAGINATION off
17649 . if \\n[#FOOTERS_WERE_ON] .FOOTERS OFF
17652 . if \\n[#PRINT_STYLE]=1 \{\
17653 . if \\n[#SINGLE_SPACE] .LS 24
17656 . if \\n[#FINIS] \{\
17657 . if \\n[#FOOTERS_WERE_ON] .FOOTERS
17658 . rr #FOOTERS_WERE_ON
17659 . if \\n[#PAGINATION_WAS_ON] \{\
17661 . rr #PAGINATION_WAS_ON
17665 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
17666 . rm $HDRFTR_CENTER_OLD
17667 . rm $HDRFTR_CENTER_NEW
17671 . TITLE "\\*[\\*[$LIST_TYPE]_TITLE_STRING]
17673 . L_MARGIN \\n[#DOC_L_MARGIN]u
17674 . LL \\n[#DOC_L_LENGTH]u
17675 . if '\\*[$LISTS_FAM]'' \
17676 . ds $LISTS_FAM \\*[$TOC_FAM]
17677 . if '\\*[$LISTS_FT]'' \
17678 . ds $LISTS_FT \\*[$TOC_TITLE_FT]
17679 . if !\\n[#LISTS_PS] \
17680 . nr #LISTS_PS \\n[#TOC_PS]
17681 . ps \\n[#LISTS_PS]u
17682 . if !\\n[#LISTS_LEAD] \
17683 . nr #LISTS_LEAD \\n[#TOC_LEAD]
17684 . if \\n[#PRINT_STYLE]=2 \{\
17685 . ie \\n[#LISTS_LEAD_ADJUST]=1 \{\
17686 . vs \\n[#LISTS_LEAD]u
17690 . vs \\n[#LISTS_LEAD]u
17691 . DOC_LEAD_ADJUST OFF
17694 . ie !'\\*[$LISTS_TITLE_QUAD]'' \
17695 . DOCHEADER_QUAD \\*[$LISTS_TITLE_QUAD]
17696 . el .DOCHEADER_QUAD \\*[$TOC_HEADER_QUAD]
17697 . if '\\*[$LISTS_TITLE_QUAD]'' \
17698 . ds $LISTS_TITLE_QUAD \\*[$TOC_HEADER_QUAD]
17699 . if !'\\*[$LISTS_TITLE_FAM]'' \
17700 . TITLE_FAMILY \\*[$LISTS_TITLE_FAM]
17701 . if !'\\*[$LISTS_TITLE_FT]'' \
17702 . TITLE_FONT \\*[$LISTS_TITLE_FT]
17703 . if !'\\*[$LISTS_TITLE_SIZE]'' \
17704 . TITLE_SIZE \\*[$LISTS_TITLE_SIZE]
17705 . if !'\\*[$LISTS_TITLE_COLOR]'' \
17706 . TITLE_COLOR \\*[$LISTS_TITLE_COLOR]
17707 . if '\\*[$LISTS_PN_FAM]'' \
17708 . ds $LISTS_PN_FAM \\*[$TOC_PN_FAM]
17709 . if '\\*[$LISTS_PN_FT]'' \
17710 . ds $LISTS_PN_FT \\*[$TOC_PN_FT]
17711 . if '\\*[$LISTS_PN_SIZE_CHANGE]'' \
17712 . ds $LISTS_PN_SIZE_CHANGE \\*[$TOC_PN_SIZE_CHANGE]
17713 . if !\\n[#EQN_PN_PADDING] \
17714 . nr #EQN_PN_PADDING \\n[#TOC_PN_PADDING]
17715 . if !\\n[#FIG_PN_PADDING] \
17716 . nr #FIG_PN_PADDING \\n[#TOC_PN_PADDING]
17717 . if !\\n[#TBL_PN_PADDING] \
17718 . nr #TBL_PN_PADDING \\n[#TOC_PN_PADDING]
17719 . ie '\\*[$LISTS_PAGENUM_STYLE]'' \
17720 . PAGENUM_STYLE \\*[$TOC_PAGENUM_STYLE]
17722 . PAGENUM_STYLE \\*[$LISTS_PAGENUM_STYLE]
17723 . if r #\\*[$LIST_TYPE]_START_PAGENUM \
17724 . PAGENUMBER \\n[#\\*[$LIST_TYPE]_START_PAGENUM]
17725 . if r #LISTS_NO_PAGENUM .PAGINATION off
17726 . HEADER_LEFT "\\*[$HDRFTR_LEFT]
17727 . HEADER_RIGHT "\\*[$HDRFTR_RIGHT]
17728 . HEADER_CENTER "\\*[\\*[$LIST_TYPE]_TITLE_STRING]
17729 . if \\n[#LINENUMBERS]=2 .nr #LINENUMBERS 3
17730 .\" Get num placeholders for ch. num and label num.
17731 . if \\n[\\*[list-type]*autolabel] \{\
17732 . if \\n[#CH_NUM]<1000 .nr chapno-width 3
17733 . if \\n[#CH_NUM]<100 .nr chapno-width 2
17734 . if \\n[#CH_NUM]<10 .nr chapno-width 1
17735 . if \\n[\\*[list-type]*label-width]<1000 .nr label-width 3
17736 . if \\n[\\*[list-type]*label-width]<100 .nr label-width 2
17737 . if \\n[\\*[list-type]*label-width]<10 .nr label-width 1
17738 .\" Calculate width of label-num tab
17739 . nr label-width \w'\0'*(\\n[chapno-width]+\\n[label-width])+\w'.'
17741 . if \\n[#SLANT_ON] .nop \\*[SLANTX]
17742 . if \\n[#COLUMNS]=1 .nr #COLUMNS 0
17744 . if \\n[#PRINT_STYLE]=2 .sp -1
17745 . if '\\*[$LIST_TYPE]'FIGURES' .LIST_OF_FIG
17746 . if '\\*[$LIST_TYPE]'TABLES' .LIST_OF_TBL
17747 . if '\\*[$LIST_TYPE]'EQUATIONS' .LIST_OF_EQN
17748 . if \\n[#LINENUMBERS]=3 \{\
17749 . NUMBER_LINES RESUME
17750 . nr #LINENUMBERS 1
17756 .ALIAS LIST_OF_EQUATIONS LISTS_OF
17757 .ALIAS LIST_OF_FIGURES LISTS_OF
17758 .ALIAS LIST_OF_TABLES LISTS_OF
17766 \# LEAD leading [ADJUST] /
17767 \# TITLE_FAMILY fam /
17768 \# TITLE_FONT sty /
17769 \# TITLE_SIZE +|-size /
17770 \# TITLE_QUAD LEFT | CENTER | RIGHT /
17771 \# TITLE_COLOR color /
17773 \# PAGENUM_STYLE format /
17776 \# PN_SIZE +|-size /
17779 \# Allows setting of all style parameters for lists-of.
17781 \# Assumption is that lists-of will all have the same style.
17782 \# TOC style is used if LISTS_STYLE is omitted.
17784 .MAC LISTS_STYLE END
17785 . nr loop-count 0 1
17786 . nr loop-counter \\n[#NUM_ARGS]
17787 . while \\n+[loop-count]<=\\n[loop-counter] \{\
17788 . if '\\$1'FAMILY' \{\
17789 . ds $LISTS_FAM \\$2
17792 . if '\\$1'FONT' \{\
17793 . ds $LISTS_FT \\$2
17796 . if '\\$1'TITLE_FAMILY' \{\
17797 . ds $LISTS_TITLE_FAM \\$2
17800 . if '\\$1'TITLE_FONT' \{\
17801 . ds $LISTS_TITLE_FT \\$2
17804 . if '\\$1'TITLE_SIZE' \{\
17805 . ds $LISTS_TITLE_SIZE \\$2
17808 . if '\\$1'TITLE_QUAD' \{\
17809 . ds $LISTS_TITLE_QUAD \\$2
17812 . if '\\$1'TITLE_COLOR' \{\
17813 . ds $LISTS_TITLE_COLOR \\$2
17816 . if '\\$1'PT_SIZE' \{\
17817 . nr #LISTS_PS (p;\\$2)
17820 . if '\\$1'LEAD' \{\
17821 . nr #LISTS_LEAD (p;\\$2)
17822 . ie !'\\$3'ADJUST' \{\
17823 . nr #LISTS_LEAD_ADJUST 0
17827 . nr #LISTS_LEAD_ADJUST 1
17831 . if '\\$1'NO_PAGINATION' \{\
17832 . nr #LISTS_NO_PAGENUM 1
17835 . if '\\$1'PAGENUM_STYLE' \{\
17836 . ds $LISTS_PAGENUM_STYLE \\$2
17839 . if '\\$1'PN_FAMILY' \{\
17840 . ds $LISTS_PN_FAM \\$2
17843 . if '\\$1'PN_FONT' \{\
17844 . ds $LISTS_PN_FT \\$2
17847 . if '\\$1'PN_SIZE' \{\
17848 . ds $LISTS_PN_SIZE_CHANGE \\$2
17851 . if '\\$1'EQN_PN_PADDING' \{\
17852 . nr #EQN_PN_PADDING \\$2
17855 . if '\\$1'FIG_PN_PADDING' \{\
17856 . nr #FIG_PN_PADDING \\$2
17859 . if '\\$1'TBL_PN_PADDING' \{\
17860 . nr #TBL_PN_PADDING \\$2
17866 \# Lists-of collector
17867 \# Strings to allocate space for leaders and entry page numbers
17869 .ds $LISTS_PN \\*[ST102]\F[\\*[$LISTS_PN_FAM]]\f[\\*[$LISTS_PN_FT]]\
17870 \s[\\n[#LISTS_PS]u]^\\*[ST102X]\\*[ST103]\s[\\\\*[$LISTS_PN_SIZE_CHANGE]]\
17871 \|\|\|\h'\w'0'u*\\\\n[#LISTS_PN_PADDING]u'\\*[ST103X]
17873 .ds $LISTS_PN_TYPEWRITE \\*[ST102]^\\*[ST102X]\\*[ST103]\|\
17874 \h'\w'0'u*\\\\n[#LISTS_PN_PADDING]u'\\*[ST103X]
17876 .MAC LISTS_COLLECTOR END
17877 . if '\\$0'TO_EQUATIONS' \{\
17880 \!. nr #LISTS_PN_PADDING \\\\n[#EQN_PN_PADDING]
17881 . nr label-width \w'\\$1'
17883 . if '\\$0'TO_FIGURES' \{\
17886 \!. nr #LISTS_PN_PADDING \\\\n[#FIG_PN_PADDING]
17887 . nr label-width \w'\\$1'
17889 . if '\\$0'TO_TABLES' \{\
17892 \!. nr #LISTS_PN_PADDING \\\\n[#TBL_PN_PADDING]
17893 . nr label-width \w'\\$1'
17896 . nr #LISTS_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
17897 . ie \\n[#PRINT_STYLE]=1 \{\
17898 \!. fam \\*[$TYPEWRITER_FAM]
17900 \!. ps \\*[$TYPEWRITER_PS]
17901 . ds _TYPEWRITE _TYPEWRITE
17904 \!. FAMILY \\\\*[$LISTS_FAM]
17905 \!. FONT \\\\*[$LISTS_FT]
17906 \!. ps \\\\n[#LISTS_PS]u
17908 . if \\n[#PRINT_STYLE]=2 .rm _TYPEWRITE
17912 "\\*[ST100]\h'\\n[label-width]u'\\*[ST100X]\0\\*[ST101]\h'\w'\\$2'u'\\*[ST101X]\\\\*[$LISTS_PN\\*[_TYPEWRITE]]" \
17913 "\\*[PDFBOOKMARK.NAME]"
17916 . ie !\\n[\\*[label-type]*autolabel] \
17923 . if \\n[#PRINT_STYLE]=2 \{\
17924 \!. FAMILY \\\\*[$LISTS_FAM]
17925 \!. FT \\\\*[$LISTS_FT]
17926 \!. ps \\\\n[#LISTS_PS]u
17929 \!. PDF_LINK \\*[list-type]:\\n[lists*target] "\\$1"
17931 \!. PDF_LINK \\*[list-type]:\\n[lists*target] "\\$2"
17933 \!. PRINT \\*[LEADER]
17935 . if \\n[#PRINT_STYLE]=2 \{\
17936 \!. FAMILY \\\\*[$LISTS_PN_FAM]
17937 \!. FT \\\\*[$LISTS_PN_FT]
17938 \!. ps \\\\*[$LISTS_PN_SIZE_CHANGE]u
17940 \!. PRINT \\n[#LISTS_ENTRY_PN]
17946 .ALIAS TO_EQUATIONS LISTS_COLLECTOR
17947 .ALIAS TO_FIGURES LISTS_COLLECTOR
17948 .ALIAS TO_TABLES LISTS_COLLECTOR
17952 \# Support for multipage tables with headers borrowed from ms and
17953 \# mommified by Robin Haberkorn <robin.haberkorn@googlemail.com>
17954 \# with extensions by Peter Schaffter.
17956 .nr tbl*have-header 0
17960 . di NULL \" Set rule weight for boxed tables
17965 . if \\n[.t]=1 .sp \\n[.t]u
17966 . rr tbl*have-header
17968 . if '\\n[.z]'FLOAT*DIV' .nr float*tbl 1
17969 . if !'\\n[.z]'FLOAT*DIV' \{\
17971 . if !\\n[@TOP] \{\
17972 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \
17980 . nr loop-count 0 1
17981 . nr loop-counter \\n[#NUM_ARGS]
17982 . while \\n+[loop-count]<=\\n[loop-counter] \{\
17984 . nr tbl*have-header 1
17986 . if \\n[#NUM_ARGS]=0 .nr tbl*plain 1
17988 . if '\\$1'BOXED' \{\
17992 . if '\\$1'CENTER' \{\
17996 . if '\\$1'NEEDS' \{\
17997 . nr tbl*needs \\$2
18000 . if '\\$1'NO_SHIM' \{\
18004 . if '\\$1'ADJUST' \{\
18005 . ds tbl*space-adj \\$2
18008 . if '\\$1'CAPTION' \{\
18009 . nr tbl*have-caption 1
18010 . ds tbl*caption \\$2
18013 . if '\\$1'SHORT_CAPTION' \{\
18014 . ds tbl*caption-short \\$2
18017 . if '\\$1'LABEL' \{\
18018 . nr tbl*have-label 1
18019 . ds tbl*label \\$2
18020 . ds label-type tbl
18024 . if \\n[tbl*boxed]=1 \{\
18025 . if (\\n[tbl*have-label]=0)&(\\n[tbl*have-caption]=0)&\
18026 (\\n[tbl*autolabel]=0)&(\\n[tbl*have-source]=0) \
18027 . nr tbl*plain-boxed 1
18029 . if !\\n[tbl*needs] .nr tbl*needs 1
18030 . if !\\n[tbl*have-header] .nr tbl*no-header 1
18031 . ds tbl*label-sffx-tmp \\*[tbl*label-sffx]
18032 . substring tbl*label-sffx-tmp -1
18033 . if '\\*[tbl*label-sffx-tmp]'.' \
18034 . if (\\n[tbl*caption-after-label]=0):(\\n[#MLA]=1) .chop tbl*label-sffx
18035 . if \\n[tbl*caption-after-label] \{\
18036 . if !'\\*[tbl*label-sffx]'' \
18037 . if '\\*[tbl*caption]'' .chop tbl*label-sffx
18040 . if !'\\n[.z]'FLOAT*DIV' \{\
18046 . if \\n[#COLUMNS] \
18047 . if !'\\*[tbl*space-adj]'' \
18048 . sp \\*[tbl*space-adj]-1v
18054 . if !'\\*[tbl*space-adj]'' .sp \\*[tbl*space-adj]u
18055 . if !\\n[#MLA] \{\
18056 . if (\\n[tbl*have-caption]=0):(\\n[tbl*caption-after-label]=1) \{\
18057 . ie !'\\n[.z]'FLOAT*DIV' \{\
18059 . if \\n[tbl*boxed] .sp .25v
18064 . if '\\n[.z]'FLOAT*DIV' \{\
18065 . if \\n[defer]>0 .sp .5v
18067 . ds ev-current \\n[.ev]
18068 . nr ll-pre-tbl \\n[.l]
18069 . nr lead-pre-tbl \\n[.v]
18070 . nr ind-pre-tbl \\n[.i]
18071 . ll \\n[.l]u-\\n[.i]u
18072 . if (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \
18073 . nr tbl*caption-lead-diff-adj 1
18075 . if \\n[tbl*have-label]+\\n[tbl*have-caption]=0 \
18077 . if \\n[tbl*boxed]=2 \{\
18079 . if (\\n[tbl*caption-after-label]=1):(\\n[tbl*have-caption]=0) \
18082 . if \\n[tbl*have-header] \{\
18084 . evc \\*[ev-current]
18085 . di tbl*header-div
18086 . if !\\n[float-span] \!.in 0
18091 . ie '\\n[.z]'tbl*header-div' \{\
18096 . PDF_TARGET tbl:\\n+[lists*target]
18097 . if !'\\n[.z]'FLOAT*DIV' \{\
18098 . ie !\\n[tbl*boxed] \{\
18099 . nr th*needs (u;\\n[dn]+\\n[tbl*needs]v)
18100 . if \\n[th*needs]>\\n[.t] \{\
18101 . ne \\n[dn]u+\\n[tbl*needs]
18106 . nr th*needs (u;\\n[dn]+2p+\\n[tbl*needs]v)
18107 . if \\n[th*needs]>\\n[.t] \{\
18108 . ne \\n[dn]u+2p+\\n[tbl*needs]
18109 . if \\n[#COLUMNS] \
18110 . if !\\n[#COL_NUM]=\\n[#NUM_COLS] .nr tbl*no-top-hook 1
18114 . if \\n[defer] .nr tbl*interrupted 1
18116 . ie (\\n[dn]-\\n[.v])>\\n[.t] \{\
18117 . if !\\n[@TOP] .@error ridiculously long table header
18118 . if \\n[tbl@needs] \{\
18119 . if \\n[tbl*boxed] \{\
18126 . if \\n[tbl*have-caption] .TBL*CAPTION
18130 . nr tbl*header-ht \\n[dn]
18131 . if \\n[tbl@needs] \{\
18132 . if \\n[tbl*boxed] \{\
18139 . if \\n[tbl*have-caption] .TBL*CAPTION
18145 . if \\n[tbl*have-caption] \{\
18147 . nr skip-th-warning 1
18149 . if !\\n[skip-th-warning] .@error .TH without .TS H
18150 . rr skip-th-warning
18152 .\" When centering a boxed table inside a float, .T# won't place
18153 .\" vertical rules in the correct horizontal position unless .ll is
18154 .\" given a nominal value (can be anything) and an indent is set
18156 . if '\\n[.z]'FLOAT*DIV' \{\
18157 . if \\n[tbl*center] \{\
18158 . nr float*ll \\n[.l]
18160 . in \\n[float*ll]u-\\n[TW]u/2u
18166 . ev tbl*end \" Needed because of .ad changes
18167 . evc \\*[ev-current]
18171 . if !'\\n[.z]'FLOAT*DIV' \{\
18172 . ie \\n[.t]<(\\n[.v]+(\\n[.v]/2u)) \{\
18173 . rm tbl*header-div
18174 . nr tbl*no-top-hook 1
18175 . nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
18176 . tm1 "[mom]: '\\n[.F]', macro \\$0, line \\n[.c]:
18177 . tm1 " Insufficient room for label, caption, and/or source after
18178 . tm1 " table on page \\n[pgnum]. Omitting, but continuing to process.
18180 . nr tbl*skip-source 1
18181 . nr tbl*skip-label 1
18182 . ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
18185 . ch FOOTER 0+\\n[pre-tbl-vfp]u
18186 . ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
18190 . if '\\$1'SOURCE' \{\
18191 . nr tbl*have-source 1
18195 . if !\\n[#MLA] \{\
18196 . if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1):(\\n[tbl*caption-after-label]=1) \{\
18199 . ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
18202 . vs \\n[.ps]u+\\n[tbl*label-autolead]u
18205 . if \\n[tbl*label-with-chapter] \
18206 . ds chapno \\n[#CH_NUM].
18207 . TBL*SET_LABEL_QUAD \\*[tbl*label-quad]
18209 \!. in -\\n[ind-pre-tbl]u
18210 . ie \\n[tbl*boxed] .sp \\n[#CAP_HEIGHT]u
18211 . el .sp \\n[#DOC_LEAD]u/4u
18212 . if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1) \{\
18213 . if !'\\*[tbl*label-space]'' .sp \\*[tbl*label-space]
18214 . ie \\n[tbl*autolabel] \{\
18215 . ie !\\n[tbl*caption-after-label] .nop \
18216 \\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]
18218 . nop \\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]\|
18219 . tbl*caption-style
18220 . vs \\n[.ps]u+\\n[tbl*caption-autolead]u
18221 . ds tbl*caption " \\*[tbl*caption]
18222 . nop \\*[tbl*caption]
18226 . if !'\\*[tbl*label]'' \{\
18227 . ie !\\n[tbl*caption-after-label] .nop \\*[tbl*label]
18229 . nop \\*[tbl*label]\ \|\c
18230 . tbl*caption-style
18231 . vs \\n[.ps]u+\\n[tbl*caption-autolead]u
18232 . ds tbl*caption " \\*[tbl*caption]
18233 . nop \\*[tbl*caption]
18237 . if \\n[tbl*autolabel] \
18238 . ds tbl*label \\*[chapno]\\n[tbl*label-num]
18243 . nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
18244 . ie !'\\n[.z]'FLOAT*DIV' \{\
18245 . ie \\n[dn]>\\n[.t] \{\
18246 . tm1 "[mom]: '\\n[.F]', macro \\$0, line \\n[.c]:
18247 . tm1 " Insufficient room for label, caption, and/or source after
18248 . tm1 " table on page \\n[pgnum]. Omitting, but continuing to process.
18249 . if d tbl*header-div .rm tbl*header-div
18250 . rr tbl*caption-top-lead-diff
18251 . rr tbl*have-header
18252 . nr tbl*skip-source 1
18253 . nr tbl*skip-label 1
18261 . if !'\\*[tbl*caption-short]'' .ds short -short
18262 . ie !'\\*[tbl*label]'' \
18263 . TO_TABLES "\\*[tbl*label]" "\\*[tbl*caption\\*[short]]"
18264 . el .TO_TABLES "\\*[tbl*caption]\\*[short]]"
18265 . if !\\n[tbl*skip-source] \{\
18266 . if \\n[tbl*have-source] \{\
18267 . ds tbl*source \\$1
18271 . ie \\n[#PRINT_STYLE]=1 \{\
18277 . vs \\n[.ps]u+\\n[tbl*source-autolead]u
18279 . di tbl*source-div
18280 . TBL*SET_SOURCE_QUAD \\*[tbl*source-quad]
18282 . if '\\*[tbl*source-quad]'L' \{\
18283 . in \\n[ind-pre-tbl]u+\\n[tmp-ind]u
18284 . ti -\\n[tmp-ind]u
18287 . if (\\n[tbl*have-label]=0)&(\\n[#MLA]=0) \
18288 . if !\\n[tbl*autolabel] .sp \\n[#CAP_HEIGHT]u
18290 . sp \\n[#CAP_HEIGHT]u
18291 . if !'\\*[tbl*source-space]'' .sp \\*[tbl*source-space]
18292 . nop \\*[tbl*source]
18301 . if '\\n[.z]'FLOAT*DIV' .nr bx-tbl-depth \\n[.d]-1v
18302 . if '\\n[.z]'tbl*header-div' \{\
18303 . @error .TS with 'H' flag but no corresponding .TH
18307 . if !\\n[tbl*plain] \{\
18308 . ie \\n[tbl*plain-boxed] .sp 1
18311 . ll \\n[ll-pre-tbl]u
18312 . if !'\\*[tbl*space-adj]'' .sp -\\*[tbl*space-adj]u
18313 . if !\\n[tbl*no-shim] .SHIM
18317 \# Utility macros for tbl
18319 .MAC TBL*CAPTION END
18320 . if \\n[tbl*have-caption] \{\
18321 . vs \\n[.ps]u+\\n[tbl*caption-autolead]u
18322 . nr tbl*caption-lead-diff \\n[lead-pre-tbl]-\\n[.v]
18323 . nr tbl*caption-top-lead-diff \\n[tbl*caption-lead-diff]
18324 . ie !\\n[#MLA] \{\
18325 . if !\\n[tbl*caption-after-label] \{\
18326 . ie !'\\n[.z]'FLOAT*DIV' \{\
18327 . ie (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \{\
18328 . ie \\n[#COLUMNS] .sp |\\n[dc]u
18329 . el .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
18330 . sp \\n[tbl*caption-lead-diff]u
18337 . evc \\*[ev-current]
18341 . if !\\n[tbl*autolabel] \{\
18342 . ie !\\n[tbl*have-label] \
18343 . mla@error caption label \\n[.F] \\$0 \\n[.c]
18347 . ie \\n[#PRINT_STYLE]=1 .nr tmp-ind 2m
18348 . el .nr tmp-ind 1.25m
18349 . ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
18351 . if !\\n[#MLA] \{\
18352 . tbl*caption-style
18353 . nr lead-current \\n[.v]
18356 . ie !\\n[#MLA] \{\
18357 . ie !\\n[tbl*caption-after-label] \{\
18358 . di tbl*caption-div
18359 \!. in -\\n[ind-pre-tbl]u
18360 . TBL*SET_CAPTION_QUAD \\*[tbl*caption-quad]
18361 . nop \\*[tbl*caption]
18364 . if !'\\n[.z]'FLOAT*DIV' \{\
18365 . nr caption-needs 2
18366 . if (\\n[dn]+(\\n[#DOC_LEAD]*(\\n[tbl*needs]*2)))>\\n[.t] \{\
18367 . nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1
18368 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
18369 . tm1 "[mom]: Table with caption at line \\n[.c] does not fit on page \\n[pgnum].
18370 . tm1 " Shifting table to page \\n+[pgnum].
18376 . sp |\\n[#PAGE_TOP]u+\\n[tbl*caption-lead-diff]u
18380 . if \\n[.u] .nr fill 1
18382 . if \\n[.ns] .RESTORE_SPACE
18384 . if \\n[#PRINT_STYLE]=1 .sp .5v
18385 . if !'\\*[tbl*caption-space]'' \
18386 . sp \\*[tbl*caption-space]
18387 . if \\n[tbl*caption-lead-diff-adj] \{\
18388 . sp -\\n[tbl*caption-lead-diff]u
18389 . rr tbl*label-lead-diff-adj
18395 . if (\\n[tbl*have-label]=0) \{\
18396 . if !\\n[tbl*autolabel] \{\
18397 . tm1 "[mom]: CAPTION_AFTER_LABEL enabled, but no label given
18398 . tm1 " for table at line \\n[.c].
18399 . tm1 " Skipping caption but continuing to process.
18405 . if (\\n[tbl*have-label]=1):(\\n[tbl*autolabel]=1) \{\
18406 . ie !\\n[tbl*have-caption] \
18407 . mla@error label caption \\n[.F] \\$0 \\n[.c]
18409 . ie !'\\n[.z]'FLOAT*DIV' \{\
18410 . ie (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \{\
18411 . ie !\\n[#COLUMNS] .sp |\\n[#PAGE_TOP]u+\\n[tbl*caption-lead-diff]u
18412 . el .sp |\\n[dc]u+\\n[tbl*caption-lead-diff]u
18419 . evc \\*[ev-current]
18421 . ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
18424 . vs \\n[.ps]u+\\n[tbl*label-autolead]u
18425 . nr tbl*label-lead-diff \\n[lead-pre-tbl]-\\n[.v]
18427 . if \\n[tbl*label-with-chapter] \
18428 . ds chapno \\n[#CH_NUM].
18429 . TBL*SET_LABEL_QUAD \\*[tbl*label-quad]
18430 . di tbl*mla-label-caption
18431 . ie '\\*[tbl*label-quad]'L' \{\
18432 \!. in -\\n[ind-pre-tbl]u
18433 \!. in \\n[tmp-ind]u
18434 \!. ti -\\n[tmp-ind]u
18437 . if \\n[tbl*label-quad-on-ll] \{\
18438 . if '\\n[tbl*label-quad]'L' \
18442 . ie \\n[tbl*autolabel] \
18444 \\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]
18445 . el .if !'\\*[tbl*label]'' .nop \\*[tbl*label]
18446 . if \\n[tbl*autolabel] \
18447 . ds tbl*label \\*[chapno]\\n[tbl*label-num]
18451 . da tbl*mla-label-caption
18452 . ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
18453 . el .tbl*caption-style
18454 . if '\\*[tbl*caption-quad]'L' \{\
18455 \!. ti -\\n[tmp-ind]u
18458 . nop \\*[tbl*caption]
18463 . if !'\\n[.z]'FLOAT*DIV' \{\
18464 . ie \\n[#MLA] .nr caption-needs 3
18465 . el .nr caption-needs 2
18466 . if (\\n[dn]+(\\n[#DOC_LEAD]*(\\n[tbl*needs]+\\n[caption-needs])))>\\n[.t] \{\
18467 . nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1
18468 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
18469 . tm1 "[mom]: Table with caption at line \\n[.c] does not fit on page \\n[pgnum].
18470 . tm1 " Shifting table to page \\n+[pgnum].
18472 . if \\n[defer] .nr skip-th-warning 1
18476 . nr tbl*no-top-hook 1
18478 . if (\\n[tbl*caption-after-label]=1):(\\n[tbl*plain]) \
18484 . if (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \
18485 . nr tbl*label-lead-diff-adj 1
18486 . ie (\\n[.t]>1)&(\\n[@TOP]=0) \{\
18487 . sp \\n[tbl*label-lead-diff]u
18490 . if \\n[.t]=1 .sp \\n[.t]u
18491 . ie \\n[#COL_NUM]>1 \
18492 . ie (\\n[nl]=\\n[#PAGE_TOP]):(\\n[nl]=\\n[dc]) \
18493 . sp |\\n[dc]u+\\n[tbl*label-lead-diff]u
18496 . tbl*mla-label-caption
18497 . ie \\n[#PRINT_STYLE]=1 .sp .5v
18499 . if \\n[tbl*label-lead-diff-adj] \{\
18500 . sp -\\n[tbl*label-lead-diff]u
18501 . rr tbl*label-lead-diff-adj
18504 . if !'\\*[tbl*caption-space]'' .sp \\*[tbl*caption-space]
18506 . if !'\\n[.ev]'0' .ev
18509 .MAC TBL*CLEANUP END
18510 . if !'\\n[.z]'FLOAT*DIV' \{\
18512 . rm tbl*header-div
18513 . rr tbl*caption-top-lead-diff
18515 . rr tbl*have-header
18516 . if !'\\n[.z]'FLOAT*DIV' \{\
18517 . rr tbl*have-caption
18518 . rr tbl*have-label
18520 . rr tbl*label-warning
18522 . rr tbl*skip-source
18523 . if !'\\n[.z]'FLOAT*DIV' \{\
18526 . rm tbl*caption-short
18530 . rnn tbl*have-label tbl@label
18531 . rnn tbl*have-source tbl@source
18532 . rr tbl*have-label
18534 . if '\\*[tbl*label-sffx-tmp]'.' .ds tbl*label-sffx .
18537 .MAC print-label END
18538 . if \\n[.u] .nr fill 1
18540 . if !\\n[tbl*skip-label] \{\
18547 .MAC tbl@top-hook END
18548 . if \\n[tbl*have-header] \{\
18556 . ie !\\n[tbl*boxed] .sp -1
18563 .MAC tbl*print-header END
18568 . if \\n[#COL_NUM]>1 \
18570 . ie d tbl*header-div:\\n[loop-count] \
18571 . tbl*header-div:\\n[loop-count]
18572 . el .tbl*header-div
18573 . if '\\n[.z]'FLOAT*DIV' \
18574 . if \\n[tbl*center] .ce 1000
18576 . if !'\\n[.z]'FLOAT*DIV' \{\
18577 . nr pre-tbl-vfp 0+\\n[#VARIABLE_FOOTER_POS]
18578 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
18579 . ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_LEAD]u
18583 .MAC tbl@bottom-hook END
18590 .MAC tbl*float-warning END
18591 . tm1 "[mom]: Table in FLOAT, output page \\n[#PAGENUMBER], exceeds page vertical limits.
18592 . tm1 " Multipage boxed tables cannot be contained within floats.
18593 . ab Aborting '\\n[.F]'.
18596 .MAC ds@need END \" Move vertically until there is enough space for \$1
18598 . while \\n[.t]<=(\\$1)&(\\n[nl]>\\n[#PAGE_TOP]) \{\
18607 \# EQ/EN macros borrowed from ms, mommified by Robin Haberkorn
18608 \# <robin.haberkorn@googlemail.com>, expanded by Peter Schaffter.
18610 \# EQ [ -L | -C | -I <indent> ] [label]
18611 \# EN [ CONT | CONTINUED | ... ]
18613 \# Equations are centered by default, but can be left-justified
18614 \# (EQ -L), explicitly centered, or indented (EQ -I).
18616 \# Each eqn block for multi-line equations aligned with 'mark' and
18617 \# 'lineup' should be terminated by passing 'CONT' or 'CONTINUED'
18620 \# Note that geqn mark and lineup work correctly in centered equations.
18623 . if \\n[eqn*copy-in]=1 \{\
18624 . if !\\n[eqn-linenum] .nr eqn-linenum \\n[.c]
18625 . if !\\n[pgnum] .nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
18627 . if \\n[.u] .nr fill 1
18629 . if '\\n[.z]'FLOAT*DIV' .nr float*eqn 1
18630 . nr eqn*restore-adj \\n[.j]
18631 . if !\\n[continued] \{\
18632 . PDF_TARGET eqn:\\n+[lists*target]
18634 . nr loop-counter \\n[#NUM_ARGS]
18635 . nr loop-count 0 1
18636 . while \\n+[loop-count]<=\\n[loop-counter] \{\
18647 . ds DI@cont \\*[DI]
18655 . if '\\$1'ADJUST' \{\
18656 . ds eqn*space-adj \\$2
18659 . if '\\$1'NO_SHIM' \{\
18663 . if '\\$1'LABEL' \{\
18664 . ds eqn*label \\$2
18665 . ds label-type eqn
18668 . if '\\$1'SHIFT_LABEL' \{\
18669 . ds eqn*shift-label \\$2
18672 . if '\\$1'CAPTION' \{\
18673 . ds eqn*caption \\$2
18676 . if '\\$1'SHORT_CAPTION' \{\
18677 . ds eqn*caption-short \\$2
18682 . if '\\*[eqn*shift-label]'' .ds eqn*shift-label 0
18683 . if !\\n[eqn*type] \{\
18688 . if !'\\*[eqn*caption]'' \{\
18689 . if '\\*[caption-quad]'L' \{\
18690 . if \\n[default-left] .ds caption-quad R
18694 . if \\n[continued] \{\
18698 . if \\n[eqn@left*cont] .nr eqn*type 1
18699 . if \\n[eqn@ind*cont] \{\
18701 . ds DI \\*[DI@cont]
18704 . if \\n[eqn@center*cont] .nr eqn*type 3
18713 . if !'\\n(.z'eqn*div' \{\
18714 . @error mismatched EN
18720 . if !'\\*[eqn*label]'' .nr eqn*have-label 1
18721 . if !'\\*[eqn*caption]'' .nr eqn*have-caption 1
18723 . ie '\\$1'...' .ds continued CONT
18724 . el .ds continued \\$1
18725 . substring continued 0 3
18726 . ie '\\*[continued]'CONT' \{\
18729 . if \\n[eqn*ind] .nr eqn@ind*cont 1
18730 . if \\n[eqn*left] .nr eqn@left*cont 1
18731 . if \\n[eqn*center] .nr eqn@center*cont 1
18734 . tm1 "[mom]: Invalid argument \\$1 to \\$0.
18735 . tm1 " Must be 'CONTINUED', 'CONT', or '...'
18736 . ab Aborting '\\n[.F]' at line \\n[.c].
18739 . if \\n[dl]:\\n[eqn*have-label] \{\
18740 . ds eqn*tabs \\n[.tabs]
18741 . if \\n[eqn*label-with-chapter] \
18742 . ds chapno \\n[#CH_NUM].
18745 . if !'\\n[.z]'FLOAT*DIV' \{\
18746 . ie \\n[eqn*have-caption] .ne \\n[dn]u-\\n[.V]
18747 . el .ne \\n[dn]u-1v-\\n[.V]
18750 . if '\\*[DD]'' \{\
18752 . if !\\n[@TOP] \{\
18754 . if !'\\*[eqn*space-adj]'' .sp \\*[eqn*space-adj]u
18757 . if \\n[cutaround] .ll \\n[eqn*cutaround-width]u
18758 . ie \\n[eqn*type]=1 \{\
18759 . ta (u;\\n[.l]-\\n[.i])R
18760 . ie \\n[continued] .nop \\*[eqn*div]
18762 . ie \\n[eqn*autolabel] \
18765 \\*[eqn*label-specs]\
18766 \t\v'+\\*[eqn*shift-label]'\
18767 \\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
18768 \v'-\\*[eqn*shift-label]'\
18773 \\*[eqn*label-specs]\
18774 \t\v'+\\*[eqn*shift-label]'\
18776 \v'-\\*[eqn*shift-label]'\
18779 . if \\n[eqn-cutaround] .ll
18780 . if !\\n[continued] \{\
18781 . if \\n[eqn*have-caption] \
18786 . ie \\n[eqn*type]=2 \{\
18787 . ie '\\*[eqn*label-quad]'L' \{\
18789 . ie \\n[continued] .nop \t\\*[eqn*div]
18791 . ie \\n[eqn*autolabel] \
18793 \\*[eqn*label-specs]\
18794 \v'+\\*[eqn*shift-label]'\
18795 \\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
18796 \v'-\\*[eqn*shift-label]'\
18801 \\*[eqn*label-specs]\
18802 \v'+\\*[eqn*shift-label]'\
18804 \v'-\\*[eqn*shift-label]'\
18810 . ta \\*[DI] (u;\\n[.l]-\\n[.i])R
18811 . ie \\n[continued] .nop \t\\*[eqn*div]
18813 . ie \\n[eqn*autolabel] \
18816 \\*[eqn*label-specs]\
18817 \t\v'+\\*[eqn*shift-label]'\
18818 \\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
18819 \v'-\\*[eqn*shift-label]'\
18824 \\*[eqn*label-specs]\
18825 \t\v'+\\*[eqn*shift-label]'\
18827 \v'-\\*[eqn*shift-label]'\
18831 . if !\\n[continued] \{\
18832 . if \\n[eqn*have-caption] \
18837 . ie '\\*[eqn*label-quad]'L' \{\
18838 . ta (u;\\n[.l]-\\n[.i]/2)C
18839 . ie \\n[continued] .nop \t\\*[eqn*div]
18841 . ie \\n[eqn*autolabel] \
18843 \\*[eqn*label-specs]\
18844 \v'+\\*[eqn*shift-label]'\
18845 \\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
18846 \v'-\\*[eqn*shift-label]'\
18851 \\*[eqn*label-specs]\
18852 \v'+\\*[eqn*shift-label]'\
18854 \v'-\\*[eqn*shift-label]'\
18860 . ta (u;\\n[.l]-\\n[.i]/2)C (u;\\n[.l]-\\n[.i])R
18861 . ie \\n[continued] .nop \t\\*[eqn*div]
18863 . ie \\n[eqn*autolabel] \
18866 \\*[eqn*label-specs]\
18867 \t\v'+\\*[eqn*shift-label]'\
18868 \\*[eqn*label-prfx]\\*[chapno]\\n+[eqn*label-num]\\*[eqn*label-sffx]\
18869 \v'-\\*[eqn*shift-label]'\
18874 \\*[eqn*label-specs]\
18875 \t\v'+\\*[eqn*shift-label]'\
18877 \v'-\\*[eqn*shift-label]'\
18881 . if !\\n[continued] \{\
18882 . if \\n[eqn*have-caption] \
18889 . ta (u;\\n[.l]-\\n[.i])R
18891 \\*[eqn*label-specs]\
18892 \t\v'+\\*[eqn*shift-label]'\
18894 \v'-\\*[eqn*shift-label]'\
18898 .\" if continuing (ie is a multi-line equation), don't space and SHIM
18899 . if !\\n[continued] \{\
18901 . if !'\\*[eqn*space-adj]'' .sp -\\*[eqn*space-adj]u
18902 . if !'\\n[.z]'FLOAT*DIV' \{\
18903 . if !\\n[eqn*no-shim] .SHIM
18905 . if !'\\*[eqn*caption-short]'' .ds short -short
18906 . if \\n[eqn*autolabel] \
18907 . ds eqn*label \\*[chapno]\\n[eqn*label-num]
18908 . ie !'\\*[eqn*label]'' \
18909 . TO_EQUATIONS "\\*[eqn*label]" "\\*[eqn*caption\\*[short]]"
18910 . el .TO_EQUATIONS "\\*[eqn*caption\\*[short]]"
18913 . rm eqn*caption-short
18920 . rr eqn@center*cont
18921 . rr eqn*have-label
18926 . if !\\n[eqn-cutaround] .rm eqn*space-adj
18930 . ad \\n[eqn*restore-adj]
18934 .MAC ADD_CAPTION END
18935 . ie \\n[.t]<\\n[.v] \{\
18936 . if !'\\n[.z]'FLOAT*DIV' \{\
18937 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
18938 . tm1 "[mom]: '\\n[.F]', macro EQ, line \\n[eqn-linenum]: Insufficient room for
18939 . tm1 " equation caption on page \\n[pgnum].
18940 . tm1 " Skipping caption, but continuing to process.
18941 . if !\\n[@TOP] \{\
18942 . if \\n[#COL_NUM]=\\n[#NUM_COLS] \
18951 . if \\n[#PRINT_STYLE]=2 \{\
18952 . ps \\*[eqn*caption-size-change]
18953 . nr lead-curr \\n[.v]
18955 . vs \\n[.ps]u+\\n[eqn*caption-autolead]u
18956 . nr eqn*caption-lead-diff \\n[lead-curr]-\\n[.v]
18957 . sp \\n[eqn*caption-lead-diff]u
18959 . if !'\\*[eqn*caption-space]'' \
18960 . sp \\*[eqn*caption-space]
18962 . if '\\*[eqn*caption-quad]'L' \{\
18966 \\*[eqn*caption-specs]\
18971 . if '\\*[eqn*caption-quad]'C' \{\
18975 \\*[eqn*caption-specs]\
18980 . if '\\*[eqn*caption-quad]'R' \{\
18984 \\*[eqn*caption-specs]\
18989 . if !'\\*[eqn*caption-space]'' \
18990 . sp -\\*[eqn*caption-space]
18997 .MAC have-adjust END
18999 . nr #COUNT \\n[#NUM_ARGS]
19000 . while \\n+[#ARGS]<=\\n[#COUNT] \{\
19001 . if '\\$1'ADJUST' \{\
19002 . ds pic*space-adj \\$2
19009 \# User settable text style for pic
19014 \# <offset from page left>
19016 \# Stores user supplied page offset in register #L_MARGIN.
19017 \# Sets .po to user supplied offset.
19019 \# Requires unit of measure.
19021 .MAC PIC_TEXT_STYLE END
19023 . nr #COUNT \\n[#NUM_ARGS]
19024 . while \\n+[#ARGS]<=\\n[#COUNT] \{\
19025 . if '\\$1'FAMILY' \{\
19027 . ds pic*text-family \\$1
19030 . if '\\$1'FONT' \{\
19032 . ds pic*text-font \\$1
19035 . if '\\$1'SIZE' \{\
19037 . ds pic*text-size-change \\$1
19040 . if '\\$1'AUTOLEAD' \{\
19042 . nr pic*text-autolead \\$1
19052 . have-adjust \\$@ \" Adjusting is handled by FLOAT
19053 . ds ev-current \\n[.ev]
19055 . if !'\\n[.z]'FLOAT*DIV' .FLOAT ADJUST \\*[pic*space-adj]
19056 . PDF_TARGET fig:\\n+[lists*target]
19058 . nr ind-pre-pic \\n[.i]
19059 . nr ll-pre-pic \\n[.l]
19060 . nr lead-pre-pic \\n[.v]
19061 . if \\n[#MLA] .sp .5v
19064 . evc \\n[ev-current]
19066 . ie \\n[#NUM_ARGS]<2 .@error bad arguments to PS (not preprocessed with pic?)
19069 . ie !\B'\\$2' .ds pic*scale-width \\$1
19070 . el .ds pic*scale-width \\$2
19073 . \" This is a bit confusing. pic is decorated with 2 args (width
19074 . \" and height), which are read during pre-processing but have to be
19075 . \" ignored when parsing args during main processing. We shift pic's
19076 . \" args out of the way, then pop them off the arg stack because
19077 . \" they're not needed during macro processing.
19078 . while \B'\\$1' .shift
19079 . nr loop-counter \\n[#NUM_ARGS]
19080 . nr loop-count 0 1
19081 . while \\n+[loop-count]<=\\n[loop-counter] \{\
19082 . if '\\$1'NO_SHIM' \{\
19083 . nr float*no-shim 1
19086 . if '\\$1'LEFT' \{\
19090 . if '\\$1'CAPTION' \{\
19091 . nr pic*have-caption 1
19092 . ds pic*caption \\$2
19095 . if '\\$1'SHORT_CAPTION' \{\
19096 . ds pic*caption-short \\$2
19099 . if '\\$1'LABEL' \{\
19100 . nr pic*have-label 1
19101 . ds pic*label \\$2
19102 . ds label-type pic
19106 . ds pic*label-sffx-tmp \\*[pic*label-sffx]
19107 . substring pic*label-sffx-tmp -1
19108 . if '\\*[pic*label-sffx-tmp]'.' \
19109 . if \\n[pic*caption-after-label]=0 .chop pic*label-sffx
19111 . if (\\n[pic*have-label]=1):(\\n[pic*autolabel]=1) \{\
19112 . if !\\n[pic*have-caption] \
19113 . mla@error label caption \\n[.F] \\$0 \\n[.c]
19115 . if \\n[pic*have-caption] \{\
19116 . if !\\n[pic*have-label] \{\
19117 . if !\\n[pic*autolabel] \
19118 . mla@error caption label \\n[.F] \\$0 \\n[.c]
19122 . if !'\\*[pic*text-family]'' \
19123 . fam \\*[pic*text-family]
19124 . if !'\\*[pic*text-font]'' \
19125 . ft \\*[pic*text-font]
19126 . if !'\\*[pic*text-size-change]'' \
19127 . ps \\n[#DOC_PT_SIZE]u\\*[pic*text-size-change]
19128 . nr lead-current \\n[.v]
19129 . ie \\n[pic*text-autolead] \
19130 . vs \\n[.ps]u+(\\n[pic*text-autolead]u*1000u)
19132 . nr pic@text-lead \\n[.v]
19133 . nr pic@text-size \\n[.ps]
19134 . if !'\\*[pic*text-color]'' .gcolor \\*[pic*text-color]
19137 . nr pic*top-lead-adj 1
19139 . nr pic*top-lead-diff \\n[lead-pre-pic]u-\\n[.v]u
19140 . if (\\n[pic*have-caption]=0):(\\n[pic*caption-after-label]=1) \{\
19141 . ie \\n[pic*top-lead-adj] \{\
19142 . sp \\n[pic*top-lead-diff]u
19143 . rr pic*top-lead-adj
19145 . el .if (\\n[pic*caption-after-label]=0):(\\n[#MLA]=0) .sp \\n[lead-pre-pic]u/2u
19152 . nr pic*div-width \\n[dl]
19156 . sp \\n[lead-pre-pic]u/2u
19157 . if (\\n[pic*have-caption]=1)&(\\n[pic*caption-after-label]=0) \{\
19160 . evc \\*[ev-current]
19162 . ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
19164 . pic*caption-style
19165 . nr lead-current \\n[.v]
19166 . vs \\n[.ps]u+\\n[pic*caption-autolead]u
19167 . nr pic*caption-lead-diff \\n[lead-current]-\\n[.v]
19168 . in \\n[ind-pre-pic]u
19170 . PIC*SET_CAPTION_QUAD \\*[pic*caption-quad]
19171 . if \\n[@TOP] .RESTORE_SPACE
19172 \!. in -\\n[ind-pre-pic]u
19173 . sp \\n[pic*caption-lead-diff]u
19174 \!. if \\\\n[.ns] .rs
19175 . nop \\*[pic*caption]
19176 . if \\n[#PRINT_STYLE]=1 .sp .5v
19177 . if !'\\*[pic*caption-space]'' \
19178 . sp \\*[pic*caption-space]
19182 . if !\\n[pic*left] .in \\n[ll-pre-pic]u-\\n[pic*div-width]u/2u
19185 . if (\\n[pic*have-label]=1):(\\n[pic*autolabel]=1):(\\n[pic*caption-after-label]=1) \{\
19186 . nr lead-pre-label \\n[.v]
19188 . evc \\*[ev-current]
19189 . ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
19192 . nr lead-current \\n[.v]
19193 . vs \\n[.ps]u+\\n[pic*label-autolead]u
19194 . in \\n[ind-pre-pic]u
19195 . sp \\n[lead-current]u-\\n[.v]u
19197 . if \\n[pic*label-with-chapter] \
19198 . ds chapno \\n[#CH_NUM].
19199 . PIC*SET_LABEL_QUAD \\*[pic*label-quad]
19200 \!. in -\\n[ind-pre-pic]u
19201 . sp \\n[lead-pre-label]u-\\n[.v]u
19202 . if !'\\*[pic*label-space]'' .sp \\*[pic*label-space]
19203 . if \\n[#PRINT_STYLE]=1 .sp .5v
19204 . ie \\n[pic*autolabel] \
19206 \\*[pic*label-prfx]\\*[chapno]\\n+[fig*label-num]\\*[pic*label-sffx]\|
19207 . el .if !'\\*[pic*label]'' .nop \\*[pic*label]
19208 . if \\n[pic*autolabel] \
19209 . ds pic*label \\*[chapno]\\n[fig*label-num]
19214 . ie !\\n[pic*caption-after-label] .br
19216 . if !'\\*[pic*caption]'' .nop \
19217 \\*[pic*caption-specs]\\*[pic*caption]\\*[revert-specs]
19226 . in \\n[ind-pre-pic]u
19227 . if !'\\*[pic*caption-short]'' .ds short -short
19228 . ie !'\\*[pic*label]'' \
19229 . TO_FIGURES "\\*[pic*label]" "\\*[pic*caption\\*[short]]"
19230 . el .TO_FIGURES "\\*[pic*caption\\*[short]]"
19235 . if !\\n[cutaround] .rm pic*space-adj
19236 . if !\\n[defer] .rr pic*have-caption
19237 . rr pic*have-label
19239 . if '\\*[pic*label-sffx-tmp]'.' .ds pic*label-sffx .
19244 \# Footnote references
19245 \# -------------------
19247 \# Instruct REF to put references in footnotes.
19249 .MAC FOOTNOTE_REFS END
19250 . ie !'\\$1'' .rr #FN_REF
19252 . if r #EN_REF .rr #EN_REF
19258 \# Endnote references
19259 \# ------------------
19261 \# Instruct REF to collect references for endnotes output.
19263 .MAC ENDNOTE_REFS END
19264 . ie !'\\$1'' .rr #EN_REF
19266 . if r #FN_REF .rr #FN_REF
19268 . if !r#EN_MARKER_STYLE .ENDNOTE_MARKER_STYLE SUPERSCRIPT
19273 \# Prepare mom for a reference
19274 \# ---------------------------
19276 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value>
19278 \# Calls FOOTNOTE or ENDNOTE, depending on whether #REF_FN or
19279 \# #REF_EN is set to 1.
19281 \# For convenience, REF is a toggle.
19283 \# REF optionally takes the same arguments as FOOTNOTE, allowing
19284 \# users to indent references that go in footnotes when footnote
19285 \# indenting is required. FOOTNOTE_REFS must be on for this.
19288 . ie \\n[#FN_REF]+\\n[#EN_REF]=0 \{\
19289 . if !\\n[#REF_WARNING]=1 \{\
19290 . tm1 "[mom]: Before REF at line \\n[.c], neither FOOTNOTE_REFS nor ENDNOTE_REFS
19291 . tm1 " has been selected. If "sort" and "accumulate" are in your refer
19292 . tm1 " commands, references will be collected for later output with $LIST$.
19293 . tm1 " Otherwise, they will disappear.
19294 . nr #REF_WARNING 1
19298 . ie \\n[#REF]=1 \{\
19299 . if \\n[#FN_REF]=1 .FOOTNOTE OFF
19300 . if \\n[#EN_REF]=1 .ENDNOTE OFF
19306 . if \\n[#FN_REF]=1 .FOOTNOTE \\$1 \\$2 \\$3
19307 . if \\n[#EN_REF]=1 .ENDNOTE
19312 \# Embedded references in text (with brackets)
19313 \# -------------------------------------------
19315 .MAC REF_BRACKETS_NOTICE END
19316 . tm1 "[mom]: \\$1 has been removed from mom. See the mom documentation 'refer.html'
19317 . tm1 " for instructions on parenthetical insertions of references into text.
19318 . ie '\\$1'REF_STYLE' .tm1 " Continuing to process '\\n[.F]' from line \\n[.c].
19319 . el .ab Aborting '\\n[.F]' at \\$1, line \\n[.c].
19322 .MAC REF_BRACKETS_START END
19323 . REF_BRACKETS_NOTICE \\$0
19326 .MAC REF_BRACKETS_END END
19327 . REF_BRACKETS_NOTICE \\$0
19330 \# These four pairs of aliases allow users to embed references in
19331 \# text and have them surrounded by (), [], {} or <>.
19333 .ALIAS REF( REF_BRACKETS_START
19334 .ALIAS REF) REF_BRACKETS_END
19336 .ALIAS REF[ REF_BRACKETS_START
19337 .ALIAS REF] REF_BRACKETS_END
19339 .ALIAS REF{ REF_BRACKETS_START
19340 .ALIAS REF} REF_BRACKETS_END
19342 .ALIAS REF< REF_BRACKETS_START
19343 .ALIAS REF> REF_BRACKETS_END
19346 . REF_BRACKETS_NOTICE \\$0
19352 \# FOOTNOTE | ENDNOTE | BIBLIO <indent for 2nd and subsequent lines of discrete reference entries>
19354 \# Sets registers #REF_FN_INDENT, #REF_EN_INDENT or #REF_BIB_INDENT.
19356 \# Indent value requires a unit of measure. If refs are going
19357 \# into footnotes or endnotes, first lines get indented; if going
19358 \# into a bibliography, second lines get indented
19360 .MAC INDENT_REFS END
19361 . if '\\$1'FOOTNOTE' .ds $REF_FN_INDENT \\$2
19362 . if '\\$1'ENDNOTE' .ds $REF_EN_INDENT \\$2
19363 . if '\\$1'BIBLIO' .ds $REF_BIB_INDENT \\$2
19366 \# Hyphenation of references
19367 \# -------------------------
19369 \# <none> | <anything>
19371 \# Sets register #REF_HY
19373 .MAC HYPHENATE_REFS END
19374 . ie '\\$1'' .nr #REF_HY 1
19376 . if r #REF_HY .rr #REF_HY
19380 \# The remainder of the definitions in this section are modified
19381 \# versions of the definitions found in the refer module of s.tmac.
19384 .tm [mom]: '\\n[.F]', line \\n[.c]: \\$*
19387 \# Underlining unavoidably turns off sentence spacing.
19391 .SS \\*[$SAVED_SS_VAR]
19392 .if '\\n[.z]'END_NOTES' \{\
19397 \# The following strings define the order of entries for different
19398 \# types of references. Each letter in the string refers to a database
19399 \# field (A for author, T1/T2 for article and book titles, etc).
19402 .if \\n[#PRINT_STYLE]=1 \{\
19406 .\" Internet site - type 0
19407 .ds ref*spec!0 i Q A m p T2 s o D c a u n
19408 .\" Journal article - type 1
19409 .ds ref*spec!1 i Q A m p T2 q O J V S N D P n
19411 .ds ref*spec!2 i Q A m p T1 q b d l r E S e V O C I D P t n
19412 .\" Article within book - type 3
19413 .ds ref*spec!3 i Q A m p T2 B b d l r E S e V O C I D P t n
19414 .\" Tech report - type 4
19415 .ds ref*spec!4 i Q A m p T1 R G O C I D P n
19416 .\" Magazine or newspaper article - type 5
19417 .ds ref*spec!5 i Q A m p T2 O M V S N D P n
19420 \# Refer's "1st" macro. Since it is possible to define database
19421 \# fields using any single letter, we remove all possible string
19422 \# definitions of the form [X and [x. Also, reset ref*spec!<n>
19423 \# strings to their defaults.
19427 .rm [A [B [C [D [E [F [G [H [I [J [K [L [M \
19428 [N [O [P [Q [R [S [T [U [V [W [X [Y [Z \
19429 [a [b [c [d [e [f [g [h [i [j [k [l [m \
19430 [n [o [p [q [r [s [t [u [v [w [x [y [z
19431 .if r [e .rr [e \" [e persists if %e field is last
19436 \# Refer's "2nd" macro; builds up a reference with ref*build, and
19437 \# prints it with ref*print.
19441 .if \\n[ref*type]=0 \{\
19444 . nr pre-1900 1 \" If pre-1900, MLA allows excluding publisher
19448 . el .nr ref*type 2
19449 . if d [q .nr ref*type 2
19451 .if \\n[ref*type]=3 \{\
19452 . if !'\\*([R'' \{\
19454 . ds ref*spec!4 i Q A m p T2 B R O C I D P n
19456 . if !'\\*([G'' \{\
19458 . ds ref*spec!4 i A m p T2 B G O C I D P O n
19465 .ie d ref*spec!\\n[ref*type] .ref*build \\*[ref*spec!\\n[ref*type]]
19467 . @error unknown reference type `\\n[ref*type]'
19468 . ref*build \\*[ref*spec!0]
19470 .if !\\n[.hy]=0 \{\
19471 .nr #RESTORE_HY \\n[.hy]
19475 .if !\\n[#RESTORE_HY]=0 .hy \\n[#RESTORE_HY]
19481 \# Refer's "3rd" macros, which set up and terminate the output
19482 \# of collected references
19485 .als ref*print ref*end-print
19487 .if \\n[#BIB_LIST]=1 \{\
19488 . nr #IN_BIB_LIST 1
19489 . LIST DIGIT \\*[$BIB_LIST_SEPARATOR] \\*[$BIB_LIST_PREFIX]
19497 .als ref*print ref*normal-print
19503 \# Output normal, non-collected refs
19505 .de ref*normal-print
19506 .nr #CURRENT_HY \\n[.hy]
19510 \# Output collected refs
19513 .\" 10 is arbitrary
19515 .nr #REF_BIB_INDENT (u;\\*[$REF_BIB_INDENT])
19516 .ie \\n[#BIB_LIST]=0 \{\
19517 . in +\\n[#REF_BIB_INDENT]u
19518 . ti -\\n[#REF_BIB_INDENT]u
19521 .\" Part of workaround for refer spitting out a blank page if the
19522 .\" last ref falls on the bottom line.
19523 \\*[ref*string]\R'ref*num*first-pass +1'\?\R'ref*num +1'\?
19524 .sp \\n[#BIB_SPACE]u
19525 .ie \\n[#BIB_LIST]=0 .in
19526 .el .IL -\\n[#REF_BIB_INDENT]u
19530 .als ref*print ref*normal-print
19532 \# Build up the ref*string
19534 \# Correct MLA "typewritten" style (printstyle TYPEWRITE) demands
19535 \# two spaces after each period. The spaces are hardwired into the
19536 \# string definitions (ref*add-<x>), so we have to make sure that there
19537 \# aren't two spaces when the printstyle is TYPESET. Since I find that
19538 \# references look a bit crowded with 0 sentence space, I've bumped it
19539 \# up to +4. User's sentence spacing is reset in FOOTNOTES and ENDNOTES.
19542 .if \\n[#PRINT_STYLE]=2 \{\
19543 . ds $RESTORE_SS_VAR \\*[$SS_VAR]
19549 . ie d ref*add-\\$1 .ref*add-\\$1
19550 . el .ref*add-dflt \\$1
19554 .\" now add a final period
19555 .ie d ref*string \{\
19556 . if !\\n[ref*suppress-period] .as ref*string .
19557 . if d ref*post-punct \{\
19558 . as ref*string "\\*[ref*post-punct]
19559 . rm ref*post-punct
19565 \# The following macros determine how entries are formatted WRT
19566 \# punctuation, type style, additional strings, etc.
19568 \# o First argument is the database field letter.
19569 \# o Second argument is the punctuation character to use to separate this
19570 \# field from the previous field.
19571 \# o Third argument is a string with which to prefix this field.
19572 \# o Fourth argument is a string with which to postfix this field.
19573 \# o Fifth argument is a string to add after the punctuation character
19574 \# supplied by the next field.
19579 .substring eval*[A -1
19580 .if '\\*[eval*[A]'.' \{\
19581 . if !'\\*[$REF_STYLE]'NOTE' .chop [A
19583 .\" Per MLA, NOTE should not use idem, therefore if %i contains other than
19584 .\" idem (eg. ed., trans.), transpose it to after author's name
19585 .ie '\\*[$REF_STYLE]'NOTE' \{\
19586 . ie !'\\*[idem]'' .ref*field A "" "" ", \\*[idem]"
19591 .if \\n([A .nr ref*suppress-period 1
19593 \# %i Idem. BIBLIO: In all instances, removes %A field and replaces
19594 \# it with a dash; if %i field contains other than the word, idem,
19595 \# appends it to the dash
19597 .ie '\\*[$REF_STYLE]'NOTE' \{\
19598 . ie '\\*([i'idem' .rm [i
19599 . el .ds idem \\*([i
19602 . ie '\\*([i'idem' \{\
19605 . ref*field i "" \[idem] "" " "
19608 . ds eval*[i \\*([i
19609 . substring eval*[i -1
19610 . if '\\*[eval*[i]'.' \{\
19616 . ref*field i "" \[idem] ", \\*[idem]" " "
19620 \# %m Multiple authors (et al.)
19622 .if !'\\*[$REF_STYLE]'NOTE' \{\
19623 . ds eval*[m \\*([m
19624 . substring eval*[m -1
19625 . if '\\*[eval*[m]'.' .chop [m
19629 \# %p Post-author string (eg. Preface, Foreword, etc)
19631 .\" Convert first letter to uppercase, per MLA, if BIBLIO
19632 .if '\\*[$REF_STYLE]'BIBLIO' \{\
19633 . ds initial*cap \\*([p
19634 . substring initial*cap 0 0
19635 . ds [p*string \\*([p
19636 . substring [p*string 1
19637 . ds [p \E*[UC]\\*[initial*cap]\E*[LC]\\*[[p*string]
19639 .ie '\\*[$REF_STYLE]'NOTE' .ref*field p ,
19640 .el .ref*field p . " "
19642 \# %Q Author(s) when author is not a person
19644 .ie '\\*[$REF_STYLE]'NOTE' .ref*field Q
19647 \# %T Title (generic)
19649 .ie '\\*[$REF_STYLE]'NOTE' .ref*field T , \E*[IT] \E*[ref*restore-ss]
19651 . ie !'\\*([A'' .ref*field T . " \E*[IT]" \E*[ref*restore-ss]
19653 . ie !'\\*([Q'' .ref*field T . " \E*[IT]" \E*[ref*restore-ss]
19654 . el .ref*field T . \E*[IT] \E*[ref*restore-ss]
19657 .if \\n([T .nr ref*suppress-period \\n([T
19660 \# %T Title of a chapter or article
19662 .ie '\\*[$REF_STYLE]'NOTE' \{\
19663 . ref*field T , \[lq] "" \[rq]
19667 . ref*field T . \[lq] "" \[rq]
19668 . if !'\\*([Q''.ref*field T . " \[lq]" "" \[rq]
19670 . el .ref*field T . " \[lq]" "" \[rq]
19672 .if \\n([T .nr ref*suppress-period \\n([T
19674 \# %B Book title (when citing an article from a book)
19676 .ie '\\*[$REF_STYLE]'NOTE' \{\
19677 . ie \\n([T .ref*field B "" \E*[IT] \E*[ref*restore-ss]
19678 . el .ref*field B , \E*[IT] \E*[ref*restore-ss]
19681 . ie \\n([T .ref*field B "" ".\E*[IT]" \E*[ref*restore-ss]
19682 . el .ref*field B . " \E*[IT]" \E*[ref*restore-ss]
19684 \# refer doesn't set reg [T to 1 for these book titles, so we do it here
19686 .substring eval*[B -1
19688 .if '\\*[eval*[B]'!' .nr [T 1
19689 .if '\\*[eval*[B]'?' .nr [T 1
19692 \# %q Titles that must go in quotes (e.g. an unpublished dissertation)
19694 .ie '\\*[$REF_STYLE]'NOTE' .ref*field q , \[lq] "" \[rq]
19696 . ie !'\\*([A'' .ref*field q . " \[lq]" "" \[rq]
19698 . ie !'\\*([Q'' .ref*field q . " \[lq]" "" \[rq]
19699 . el .ref*field q . \[lq] "" \[rq]
19703 \# %R Report number for technical reports
19709 .ie '\\*[$REF_STYLE]'NOTE' \{\
19710 . ie \\n([T .ref*field J "" "\E*[IT]" \E*[ref*restore-ss]
19711 . el .ref*field J , "\E*[IT]" \E*[ref*restore-ss]
19714 . ie \\n([T .ref*field J "" " \E*[IT]" \E*[ref*restore-ss]
19715 . el .ref*field J . " \E*[IT]" \E*[ref*restore-ss]
19718 \# %M Magazine or newspaper name
19720 .ie '\\*[$REF_STYLE]'NOTE' \{\
19721 . ie \\n([T .ref*field M "" "\E*[IT]" \E*[ref*restore-ss]
19722 . el .ref*field M , "\E*[IT]" \E*[ref*restore-ss]
19725 . ie \\n([T .ref*field M "" " \E*[IT]" \E*[ref*restore-ss]
19726 . el .ref*field M . " \E*[IT]" \E*[ref*restore-ss]
19732 .substring eval*[E -1
19733 .if '\\*[eval*[E]'.' \{\
19734 . if !\\n[#FN_REF]+\\n[#EN_REF] .chop [E
19737 .\" Workaround for join-authors also joining editors. MLA style
19738 .\" requires a comma after first editor only if there are more than
19739 .\" two, whereas join-authors always puts a comma after the first if
19740 .\" there's more than one.
19744 .while !'\\*[eval*[E]',' \{\
19745 . ds eval*[E \\*([E
19746 . substring eval*[E \\n+[position] \\n[position]
19747 . if \\n+[counter]>30 .break \" 30 is abitrary
19749 .\" Check for " and"
19750 .if '\\*[eval*[E]',' \{\
19751 . ds eval*[E \\*([E
19752 . nr and-check \\n[position]+4
19753 . substring eval*[E \\n+[position] \\n[and-check]
19755 .if '\\*[eval*[E]' and' \{\
19757 . nr start-range -1 1
19759 . while !'\\*[eval*[E]', and' \{\
19760 . ds eval*[E \\*([E
19761 . substring eval*[E \\n+[start-range] \\n+[end-range]
19762 . if \\n+[counter]>50 .break \" just in case; 50 is arbitrary
19764 . if '\\*[eval*[E]', and' \{\
19765 . length len*[E \\*([E
19766 . nr rhs \\n[len*[E]-\\n[start-range]
19769 . substring lhs 0 \\n[start-range]-1
19770 . substring rhs -(\\n[rhs]-1)
19771 . ds [E \\*[lhs]\\*[rhs]
19782 .ie !\\n[ref*type]=0 \{\
19784 . ie '\\*[$REF_STYLE]'NOTE' \{\
19785 . ie \\n([T .ref*field E "" "ed. "
19786 . el .ref*field E , "ed. "
19789 . ie \\n([T .ref*field E "" " Eds. "
19790 . el .ref*field E . " Eds. "
19794 . ie '\\*[$REF_STYLE]'NOTE' \{\
19795 . ie \\n([T .ref*field E "" "ed. "
19796 . el .ref*field E , "ed. "
19799 . ie \\n([T .ref*field E "" " Ed. "
19800 . el .ref*field E . " Ed. "
19805 . ie \\n([T .ref*field E "" " "
19806 . el .ref*field E . " "
19813 .ie \\n([T .ref*field e "" "" " ed."
19815 . ie '\\*[$REF_STYLE]'NOTE' .ref*field e , "" " ed."
19816 . el .ref*field e . " " " ed."
19818 .nr ref*suppress-period 1
19822 \# %V Volume (of a journal, or series of books); for journals, %N may be preferable
19824 .if \\n[ref*type]=1 \{\
19827 .if \\n[ref*type]=2 \{\
19828 . ie '\\*[$REF_STYLE]'NOTE' .ref*field V , "vol. "
19830 . ie \\n([T .ref*field V "" " Vol. "
19831 . el .ref*field V . " Vol. "
19834 .if \\n[ref*type]=3 \{\
19835 . ie \\n([T .ref*field V "" " "
19836 . el .ref*field V . " "
19840 \# %N Journal number
19844 \# %S Series (books or journals)
19846 .if \\n[ref*type]=1 \{\
19849 .if \\n[ref*type]=2 \{\
19850 . ie '\\*[$REF_STYLE]'NOTE' \{\
19851 . ie \\n([T .ref*field S
19852 . el .ref*field S ,
19855 . ie \\n([T .ref*field S "" " "
19856 . el .ref*field S . " "
19859 .if \\n[ref*type]=3 \{\
19860 . ie \\n([T .ref*field S "" " "
19861 . el .ref*field S . " "
19864 \# refer doesn't set reg [T to 1 for series titles, so we do it here
19866 .substring eval*[S -1
19867 .if '\\*[eval*[S]'!' .nr [T 1
19868 .if '\\*[eval*[S]'?' .nr [T 1
19873 .ie '\\*[$REF_STYLE]'NOTE' \{\
19879 . ref*field C "" \*[FU 2](
19881 . if \\n([T .nr ref*suppress-period \\n([T
19884 . ie \\n([T .ref*field C "" " "
19886 . ie r [e .ref*field C "" " "
19887 . el .ref*field C . " "
19893 \# %I Publisher (I stands for Issuer)
19895 .ie '\\*[$REF_STYLE]'NOTE' \{\
19896 . ie !'\\*([C'' .ref*field I :
19897 . el .ref*field I "" (
19900 . ie !'\\*([C'' .ref*field I :
19902 . ie \\n([T .ref*field I "" " "
19903 . el .ref*field I . " "
19908 \# %D Date of publication
19910 .if \\n[ref*type]=0 \{\
19911 . ie '\\*[$REF_STYLE]'NOTE' .ref*field D ,
19912 . el .ref*field D . " "
19914 .if \\n[ref*type]=1 \{\
19915 . ref*field D "" "(" ")"
19917 .if \\n[ref*type]=2 \{\
19918 . ie '\\*[$REF_STYLE]'NOTE' .ref*field D , "" )
19919 . el .ref*field D ,
19921 .if \\n[ref*type]=3 \{\
19922 . ie !'\\*([C'' \{\
19923 . ie '\\*[$REF_STYLE]'NOTE' .ref*field D , "" )
19924 . el .ref*field D ,
19928 . ds eval*[D \\*([D
19929 . substring eval*[D 0 -4
19930 . ie '\\*[eval*[D]'1' .ds kern \*[BU3]
19931 . el .ds kern \*[BU2]
19932 . ie \\n[#PRINT_STYLE]=2 \{\
19933 . if '\\*[$REF_STYLE]'NOTE' .ref*field D "" (\\*[kern] )
19941 .if \\n[ref*type]=4 .ref*field D ,
19942 .if \\n[ref*type]=5 .ref*field D
19944 .substring eval*[D -1
19945 .if '\\*[eval*[D]'.' .nr ref*suppress-period 1
19947 \# %P Page number(s)
19949 .if \\n[ref*type]=5 .nr ref*type 1
19950 .ie '\\*[$REF_STYLE]'NOTE' \{\
19951 . ie \\n[ref*type]=1 .ref*field P : "" .
19952 . el .ref*field P "" "\|"
19953 . if \\n[ref*type]=1 .nr ref*suppress-period 1
19956 . ie \\n[ref*type]=1 .ref*field P \|:
19958 . ie d [n .ref*field P . \| .
19959 . el .ref*field P . " "
19963 \# %G Gov't. ordering number
19965 .ie '\\*[$REF_STYLE]'NOTE' ref*field G ,
19966 .el .ref*field G . " "
19968 \# %O Other (info that goes after %T [or %B] but is hard to categorize; eg a dissertation)
19971 .substring eval*[O -1
19972 .if '\\*[eval*[O]'.' .nr [O 1
19973 .ds initial*cap \\*([O
19974 .substring initial*cap 0 0
19975 .ds [O*string \\*([O
19976 .substring [O*string 1
19977 .if '\\*[$REF_STYLE]'BIBLIO' \{\
19978 . ds [O \E*[UC]\\*[initial*cap]\E*[LC]\\*[[O*string]
19980 .ie '\\*[$REF_STYLE]'NOTE' .ref*field O ,
19982 . if \\n([O=1 .chop [O
19983 . ie r [e .ref*field O "" " "
19985 . ie !d [A .ref*field O
19986 . el .ref*field O . " "
19992 \# %n Annotations (after ref)
19995 .substring eval*[n -1
19996 .if '\\*[eval*[n]'.' .chop [n
19997 .if '\\*[eval*[n]'?' .nr [n 1
19998 .if '\\*[eval*[n]'!' .nr [n 1
19999 .ie '\\*[$REF_STYLE]'NOTE' .ref*field n ,
20001 . ie !'\\*([P'' .ref*field n "" " "
20002 . el .ref*field n . " "
20004 .if r [n .nr ref*suppress-period 1
20014 \# %d date of publication (the orignal date of publication)
20016 .ie '\\*[$REF_STYLE]'NOTE' \{\
20017 . ref*field d "" ( ;
20021 . ie \\n([T .ref*field d "" " "
20022 . el .ref*field d . " "
20026 \# %b main author when citing from a preface, introduction, foreword
20029 .ie '\\*[$REF_STYLE]'NOTE' \{\
20030 . ie \\n([T .ref*field b "" "by"
20031 . el .ref*field b , "by "
20034 . ie \\n([T .ref*field b "" " By "
20035 . el .ref*field b . " By "
20039 \# %t title, if different from original title (the T field, which s/b
20040 \# the original title)
20042 .ie '\\*[$REF_STYLE]'NOTE' .ref*field t , "rpt. of \E*[IT] " \E*[ref*restore-ss]
20044 . ie \\n([T .ref*field t "" " Rpt. of \E*[IT] " \E*[ref*restore-ss]
20045 . el .ref*field t . " Rpt. of \E*[IT] " \E*[ref*restore-ss]
20050 \# Translated works
20051 \# ----------------
20054 .ie '\\*[$REF_STYLE]'NOTE' \{\
20055 . ie \\n([T .ref*field l "" "trans. "
20056 . el .ref*field l , "trans. "
20059 . ie \\n([T .ref*field l "" " Trans. "
20060 . el .ref*field l . " Trans. "
20064 \# %r Translato(r) and edito(r)
20066 .ie '\\*[$REF_STYLE]'NOTE' .ref*field r , "trans. and ed. "
20068 . ie \\n([T .ref*field r "" " Trans. and ed. "
20069 . el .ref*field r . " Trans. and ed. "
20078 .ie '\\*[$REF_STYLE]'NOTE' .ref*field s , \E*[IT] \E*[ref*restore-ss]
20080 .ie \\n([s .ref*field s "" ".\E*[IT]" \E*[ref*restore-ss]
20081 .el .ref*field s . " \E*[IT]" \E*[ref*restore-ss]
20083 .\" refer doesn't set reg [T to 1 for these titles, so we do it here
20084 .if !'\\*[$REF_STYLE]'NOTE' \{\
20085 . ds eval*[s \\*([s
20086 . substring eval*[s -1
20088 . if '\\*[eval*[s]'.' .nr [T 1
20089 . if '\\*[eval*[s]'!' .nr [T 1
20090 . if '\\*[eval*[s]'?' .nr [T 1
20094 \# %c content of site (ie. Web, Online posting, etc)
20096 .ie '\\*[$REF_STYLE]'NOTE' .ref*field c ,
20098 . ie \\n([T .ref*field c "" " "
20099 . el .ref*field c . " "
20103 \# %o organization, group or sponsor of site
20105 .ie '\\*[$REF_STYLE]'NOTE' .ref*field o ,
20107 . ie \\n([T .ref*field o "" " "
20108 . el .ref*field o . " "
20112 \# %a access date, i.e. the date you read it
20114 .ie '\\*[$REF_STYLE]'NOTE' .ref*field a ,
20116 . ie \\n([T .ref*field a "" " "
20117 . el .ref*field a . " "
20123 .ref*field u "" < >
20130 \# Build up reference string from ref*add-<x> macros.
20132 \# First, a string to ensure next field's font is reset to roman
20133 \# (TYPESET) or non-underlined (TYPEWRITE)
20135 .ie !n .ds ref*roman \f[R]\X'ps: exec decornone'\?\R'#UNDERLINE_ON 0'\?
20136 .el .ds ref*roman \f[R]\?\R'#UNDERLINE_ON 0'\?
20139 .if d ref*string \{\
20140 . ie d ref*post-punct \{\
20141 . as ref*string "\\$2\\*[ref*post-punct] \"
20142 . rm ref*post-punct
20144 . el .as ref*string "\\$2 \"
20146 .as ref*string "\\$3\\*([\\$1\\$4\E*[ref*roman]
20147 .if \\n[.$]>4 .ds ref*post-punct "\\$5\E*[ref*roman]
20148 .nr ref*suppress-period 0
20154 \# Wrapper for MNinit.
20158 . tm1 "[mom]: 1.x-style \\$0 detected, but you are using v2.x.
20159 . tm1 " v2.x requires flags before arguments to \\$0.
20160 . tm1 " Please read docelement.html#mn-init and update your file.
20161 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
20165 . while \\n+[#ARGS]<=\\n[#COUNT] \{\
20166 . ds $MN-arg\\n[#ARGS] @
20169 . nr #COUNT \\n[#NUM_ARGS]
20170 . while \\n+[#FLAG]<=\\n[#COUNT] \{\
20171 . if '\\$1'RAGGED' \{\
20175 . if '\\$1'SYMMETRIC' \{\
20179 . if '\\$1'L_WIDTH' \{\
20184 . if '\\$1'R_WIDTH' \{\
20189 . if '\\$1'GUTTER' \{\
20194 . if '\\$1'FONTSTYLE' \{\
20199 . if '\\$1'SIZE' \{\
20204 . if '\\$1'LEAD' \{\
20209 . if '\\$1'COLOR' \{\
20220 . if '\\*[$MN-arg5]'@' .ds $MN-arg5 \E*[$DOC_FAM]R
20222 \\*[$MN-arg1] \\*[$MN-arg2] \
20223 \\*[$MN-arg3] \\*[$MN-arg4] \
20224 \\*[$MN-arg5] \\*[$MN-arg6] \
20225 \\*[$MN-arg7] \\*[$MN-arg8] \
20229 .MAC MN_OVERFLOW_TRAP END
20230 . if \\n[#OVERFLOW_LEFT]=1 \{\
20231 . nr #no-repeat-MN-left 1
20232 . di MN_OVERFLOW_LEFT
20234 . if \\n[#OVERFLOW_RIGHT]=1 \{\
20235 . nr #no-repeat-MN-right 1
20236 . di MN_OVERFLOW_RIGHT
20238 . rr #OVERFLOW_LEFT
20239 . rr #OVERFLOW_RIGHT
20242 \# The remainder of the margin notes macros and routines are adapted
20243 \# from Werner Lemberg's MN.tmac.
20248 \# MNinit [ragged|symmetric] \
20249 \# left-width right-width separation \
20250 \# font fontsize vertical-spacing \
20251 \# color hyphenation-flags
20253 \# Initialize margin notes. Empty arguments (denoted with "") set
20254 \# default values. If the first argument is the string `ragged',
20255 \# left and right margin notes are printed ragged-right. If it is
20256 \# `symmetric', left margin notes are printed ragged-left and right
20257 \# margin notes ragged-right. If omitted, margin notes are left
20258 \# and right adjusted.
20262 . ds MN-left-ad b\"
20263 . ds MN-right-ad b\"
20264 . if '\\$1'@' .shift
20265 . if '\\$1'RAGGED' \{\
20266 . ds MN-left-ad l\"
20267 . ds MN-right-ad l\"
20270 . if '\\$1'SYMMETRIC' \{\
20271 . ds MN-left-ad r\"
20272 . ds MN-right-ad l\"
20275 . ie \B'\\$3' .nr MN-sep (n;\\$3)
20277 . if ((\\n[.o] - \\n[MN-sep]) < 1n) \
20278 . ab MN: Left margin too small (<1n) for requested margin notes separation.
20280 . nr MN-left-width (n;\\$1)
20281 . nr MN-left-start (\\n[.o] - \\n[MN-sep] - \\n[MN-left-width])
20284 . nr MN-left-width (\\n[.o] - \\n[MN-sep])
20285 . nr MN-left-start 0
20287 . if (\\n[MN-left-start] < 0) \
20288 . ab MN: Left margin too small for requested margin notes settings.
20289 . if (\\n[MN-left-width] < 1n) \
20290 . ab MN: Left margin notes width too small (<1n).
20292 . nr MN-right-width (n;\\$2)
20293 . nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
20294 . if \\n[#COLUMNS]=1 \{\
20295 . if !\\n[#NUM_COLS]=1 \{\
20296 . nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
20301 . nr MN-right-width \\n[MN-left-width]
20302 . nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
20303 . if \\n[#COLUMNS]=1 \{\
20304 . if !\\n[#NUM_COLS]=1 \{\
20305 . nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + \\n[MN-sep])
20310 . ds MN-font \\$4\"
20311 . if \\n[#PRINT_STYLE]=1 .ds MN-font CR
20314 . ds MN-font \\*[$PP_FT]
20315 . if \\n[#PRINT_STYLE]=1 .ds MN-font CR
20319 . nr MN-size \\n[.ps]
20321 . if \\n[#PRINT_STYLE]=1 \{\
20322 . ps \\*[$TYPEWRITER_PS]
20323 . nr MN-size \\n[.ps]
20328 . nr MN-size \\n[#DOC_PT_SIZE]
20331 . nr MN-spacing \\n[.v]
20333 . if \\n[#PRINT_STYLE]=1 \
20334 . nr MN-spacing \\n[#DOC_LEAD]
20336 . el .nr MN-spacing \\n[#DOC_LEAD]
20338 . if !\\n[#PRINT_STYLE]=1 .ds MN-color \\$7\"
20340 . if !\\n[#PRINT_STYLE]=1 .ds MN-color
20341 . ie \B'\\$8' .nr MN-hy \\$8
20342 . el .nr MN-hy \\n[.hy]
20343 . ev MNbottom-left-env
20344 . if \A'\\*[MN-font]' .ft \\*[MN-font]
20345 . if \\n[MN-size] .ps \\n[MN-size]u
20346 . if \\n[MN-spacing] .vs \\n[MN-spacing]u
20347 . ll \\n[MN-left-width]u
20348 . ad \\*[MN-left-ad]
20351 . nop \m[\\*[MN-color]]\c
20353 . ev MNbottom-right-env
20354 . if \A'\\*[MN-font]' .ft \\*[MN-font]
20355 . if \\n[MN-size] .ps \\n[MN-size]u
20356 . if \\n[MN-spacing] .vs \\n[MN-spacing]u
20357 . ll \\n[MN-right-width]u
20358 . ad \\*[MN-right-ad]
20361 . nop \m[\\*[MN-color]]\c
20370 \# margin note text
20373 \# With a parameter, start a margin note, otherwise end a margin note.
20374 \# If the parameter is the string `left', define a left margin note,
20375 \# otherwise define a right margin note.
20379 .if !'\\$1'LEFT' \{\
20380 . if !'\\$1'RIGHT' \{\
20385 .if \\n[#COLUMNS]=1 \{\
20386 . if \\n[#NUM_COLS]>2 \{\
20387 . tm [mom]: Macro MN: More than two columns. Ignoring margin notes.
20390 . if !\\n[#NUM_COLS]=1 \{\
20391 . ie \\n[#COL_NUM]=1 .ds MN-dir LEFT
20392 . el .ds MN-dir RIGHT
20395 . if !\\n[#MNinit]=1 \{\
20396 . tm [mom]: Macro MN: You must set parameters with MN_INIT before using MN.
20397 . ab Aborting '\\n[.F]' at MN, line \\n[.c].
20400 . if \\n[MN-active] \{\
20401 . tm [mom]: Macro MN: Can't handle nested margin notes, line \\n[.c].
20406 . ie '\\*[MN-dir]'LEFT' \{\
20408 . ds MN-curr l-\\n[MN-left]\"
20409 . evc MNbottom-left-env
20413 . ds MN-curr r-\\n[MN-right]\"
20414 . evc MNbottom-right-env
20416 . mk MN-mk-\\*[MN-curr]
20417 . di MN-div-\\*[MN-curr]
20424 \# Utility macro to handle .MN OFF | QUIT | X etc
20427 . if \\n[MN-active] \{\
20430 . nr MN-div-\\*[MN-curr]-depth \\n[dn]
20438 \# Resets these registers (called in HEADER)
20444 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
20449 \# The "left" half of Werner's original MNbottom.
20454 . nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
20457 . if \\n[MN-active] \{\
20459 . tm [mom]: Macro MN: Margin note finished by new page. Ignored.
20461 . po \\n[MN-left-start]u
20462 . ev MNbottom-left-env
20463 . nr #P \\n%+\\n[#PAGE_NUM_ADJ]
20464 . while (\\n[MN-curr] < \\n[MN-left]) \{\
20466 . ie (\\n[MN-last-pos] < \\n[MN-mk-l-\\n[MN-curr]]) \
20467 . sp |\\n[MN-mk-l-\\n[MN-curr]]u+\\n[MN-lead-adj]u
20472 . if \\n[#SHIM]>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
20474 [mom]: Macro MN: Warning: Left margin note #\\n[MN-curr] on page \\n[#P] shifted down.
20476 .\" If last margin note doesn't fit
20477 . if ( (\\n[nl]+\\n[MN-div-l-\\n[MN-curr]-depth]) > (\\n[.p]+\\n[#VARIABLE_FOOTER_POS]-1) ) \{\
20478 . if \\n[MN-shifted]=1 \{\
20479 . sp -(1v+\\n[#SHIM]u)
20480 . rm MN-div-l-\\n[MN-curr]
20481 . tm1 "[mom]: No room to start left margin note #\\n[MN-curr] on page \\n[#P].
20482 . tm1 " Ignoring margin note.
20485 . nr #no-repeat-MN-left 1
20486 . nr #OVERFLOW_LEFT 1
20487 . ie \\n[#FN_COUNT]=0 \{\
20488 . ch FOOTER \\n[.p]u
20489 . wh \\n[#VARIABLE_FOOTER_POS]u+\\n[MN-lead-adj]u+1u MN_OVERFLOW_TRAP
20492 . wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
20496 . MN-div-l-\\n[MN-curr]
20499 . nr MN-last-pos \\n[nl]
20503 . if !\\n[#no-repeat-MN-left]=1 \
20504 . if \\n[MN-right]=0 .vpt 1
20509 \# The "right" half of Werner's original MNbottom.
20514 . nr MN-lead-adj \\n[#DOC_LEAD]-\\n[MN-spacing]
20516 . po \\n[MN-right-start]u
20517 . ev MNbottom-right-env
20518 . nr #P \\n%+\\n[#PAGE_NUM_ADJ]
20519 . while (\\n[MN-curr] < \\n[MN-right]) \{\
20521 . ie (\\n[MN-last-pos] < \\n[MN-mk-r-\\n[MN-curr]]) \
20522 . sp |\\n[MN-mk-r-\\n[MN-curr]]u+\\n[MN-lead-adj]u
20527 . if \\n[#SHIM]>\\n[MN-spacing] .sp -(1v+\\n[MN-lead-adj]u)
20529 Macro MN: Warning: Right margin note #\\n[MN-curr] on page \\n[#P] shifted down.
20531 .\" If last margin note doesn't fit
20532 . if ( (\\n[nl]+\\n[MN-div-r-\\n[MN-curr]-depth]) > (\\n[.p]+\\n[#VARIABLE_FOOTER_POS]-1) ) \{\
20533 . if \\n[MN-shifted]=1 \{\
20534 . sp -(1v+\\n[#SHIM]u)
20535 . rm MN-div-r-\\n[MN-curr]
20537 [mom]: No room to start right margin note #\\n[MN-curr] on page \\n[#P] on page \\n[#P].
20538 . tm1 " Ignoring margin note.
20541 . nr #no-repeat-MN-right 1
20542 . nr #OVERFLOW_RIGHT 1
20543 . ie \\n[#FN_COUNT]=0 \{\
20544 . ch FOOTER \\n[.p]u
20545 . wh \\n[#VARIABLE_FOOTER_POS]u+\\n[MN-lead-adj]u+1u MN_OVERFLOW_TRAP
20548 . wh \\n[.p]u+\\n[#VARIABLE_FOOTER_POS]u-1u MN_OVERFLOW_TRAP
20552 . MN-div-r-\\n[MN-curr]
20555 . nr MN-last-pos \\n[nl]
20559 . if !\\n[#no-repeat-MN-right]=1 .vpt 1
20567 .nr CURRENT_LEVEL 0
20568 .nr VIRTUAL_LEVEL 0
20569 .nr #PDF_BOOKMARKS 1
20570 .nr #PDF_BOOKMARKS_OPEN 1
20571 .pdfview /PageMode /UseOutlines
20576 \# Call this and the TOC will be placed preceding this page
20578 .MAC TOC_BEFORE_HERE END
20580 . pdfpagename MOM:TOC
20586 \# Call this and the TOC will be placed after this page
20588 .MAC TOC_AFTER_HERE END
20590 . pdfpagename MOM:TOC
20594 \# -----------------
20597 \# <name defined by previous call to XCOLOR or NEWCOLOR> or
20598 \# <red> <green> <blue> all 0.0 -> 1.0
20600 \# Should be called before START but can also be called at any time to change colour
20601 \# The colour assigned at the end of the document is used for all links in the TOC
20603 .MAC PDF_LINK_COLOR END
20604 . ie \\n[.$]==3 \{\
20605 . ds PDFHREF.COLOUR \\$*
20606 . if !(\B'\\$1' & \B'\\$2' & \B'\\$3') \{\
20607 . tm1 "[mom]: All three arguments to \\$0 at line \\n[.c] must be decimal.
20608 . tm1 " Continuing to process using default link color.
20609 . ds PDFHREF.COLOUR 0.0 0.3 0.9
20611 . defcolor pdf:href.colour rgb \\*[PDFHREF.COLOUR]
20612 . ds PDFHREF.TEXT.COLOUR pdf:href.colour
20615 . ie \\n[.$]==0 \{\
20616 . if dPDFHREF.TEXTCOL.DEFAULT \
20617 . PDF_LINK_COLOR \\*[PDFHREF.TEXTCOL.DEFAULT]
20621 . substring ARG_1 0 0
20622 . ie '\\*[ARG_1]'#' \{\
20623 . defcolor pdf:href.colour rgb \\$1
20624 . ds PDFHREF.TEXT.COLOUR pdf:href.colour
20627 . ie dCOLAL_\\$1 .ds PDFHREF.TEXT.COLOUR \\*[COLAL_\\$1]
20628 . el .ds PDFHREF.TEXT.COLOUR \\$1
20632 . if !\\n[PDFHREF_COLOR_SET]=1 \{\
20633 . nr PDFHREF_COLOR_SET 1
20637 \# AUTO_RELOCATE_TOC
20638 \# -----------------
20640 \# Call before START to have TOC automatically relocated to after the
20641 \# DOC COVER (if there is one) or the COVER if there isn't
20643 .MAC AUTO_RELOCATE_TOC END
20644 . if '\\$1'' .nr TOC.RELOCATE 1
20645 . if '\\$1'TOP' .nr TOC.RELOCATE 2
20646 . if '\\$1'BEFORE_DOCCOVER' .nr TOC.RELOCATE 3 \" Same as TOP unless no DOCCOVER
20647 . if '\\$1'AFTER_DOCCOVER' .nr TOC.RELOCATE 4
20648 . if '\\$1'BEFORE_COVER' .nr TOC.RELOCATE 5
20649 . if '\\$1'AFTER_COVER' .nr TOC.RELOCATE 6
20658 \# Creates a bookmark using the given text
20659 \# The level controls the hierarchy of the bookmarks
20661 \# Bookmarks can be turned off (will not be added to document outline) by calling
20662 \# "PDF_BOOKMARKS NO" and turned on with "PDF_BOOKMARKS".
20664 \# Bookmarks can be open or closed by calling PDF_BOOKMARKS_OPEN
20666 .MAC PDF_BOOKMARK END
20667 . if \\n[#PDF_BOOKMARKS] \{\
20668 . ie '\\$1'NAMED' \{\
20669 . ds PDF_NM -T \\$2
20674 . nr LEVEL_REQ \\$1
20676 . ie \\n[LEVEL_REQ]>\\n[VIRTUAL_LEVEL] \{\
20677 . nr VIRTUAL_LEVEL \\n[LEVEL_REQ]
20678 . nr LEVEL_REQ \\n[CURRENT_LEVEL]+1
20681 . ie \\n[LEVEL_REQ]<\\n[VIRTUAL_LEVEL] \{\
20682 . nr VIRTUAL_DIFF \\n[VIRTUAL_LEVEL]-\\n[LEVEL_REQ]
20683 . nr VIRTUAL_LEVEL \\n[LEVEL_REQ]
20684 . nr LEVEL_REQ (\\n[CURRENT_LEVEL]-\\n[VIRTUAL_DIFF])>?1
20686 . el .nr LEVEL_REQ \\n[CURRENT_LEVEL]
20689 . pdfmomclean PDF_TX
20691 . nr PDF_LEV (\\n[LEVEL_REQ]*\\n[#PDF_BOOKMARKS_OPEN])
20692 . ie '\\*[.T]'ps' \{\
20693 . if !'\\*[PDF_NM]'' \{\
20694 . pdfhref M -N \\*[PDF_NM2] -- \\*[PDF_TX]
20695 . if !dpdf:href.map .tm gropdf-info:href \\*[PDF_NM2] \\*[PDF_TX]
20697 . pdfbookmark \\n[PDF_LEV] \\*[PDF_TX]
20699 . el .pdfbookmark \\*[PDF_NM] \\n[PDF_LEV] \\$*
20701 . nr CURRENT_LEVEL \\n[LEVEL_REQ]
20714 \# Set the PDF title (this is often used by PDF readers to title the main window)
20718 . pdfmomclean pdftitle
20719 . nop \!x X ps:exec [/Title (\\*[pdftitle]) /DOCINFO pdfmark
20725 \# <nothing> | <anything>
20727 \# With no parameter turns on outline bookmarks
20728 \# With any parameter turns off outline bookmarks
20730 .MAC PDF_BOOKMARKS END
20731 . ie '\\$1'' .nr #PDF_BOOKMARKS 1
20732 . el .nr #PDF_BOOKMARKS 0
20735 \# PDF_BOOKMARKS_OPEN
20736 \# ------------------
20738 \# <number> | <nothing> | <text>
20740 \# If arg is numeric all Bookmark levels > arg are closed
20741 \# If arg is empty all bookmarks are open
20742 \# If arg is any text then any following bookmarks are closed
20744 .MAC PDF_BOOKMARKS_OPEN END
20746 . nr PDFOUTLINE.FOLDLEVEL \\$1
20747 . nr #PDF_BOOKMARKS_OPEN 1
20749 . el .if '\\*[.T]'pdf' \{\
20750 . nr PDFOUTLINE.FOLDLEVEL 10000
20751 . ie '\\$1'' .nr #PDF_BOOKMARKS_OPEN 1
20752 . el .nr #PDF_BOOKMARKS_OPEN 0-1
20760 \# [PREFIX text] : text to prefix link
20761 \# [SUFFIX text] : text after link
20765 \# Text is output as a hotspot link to named destination.
20766 \# If text has final '*' it is replaced with the text associated with the link
20771 . ie '\\$1'PREFIX' \{\
20772 . ds PDF_PRE -P "\&\\$2"
20776 . ie '\\$1'SUFFIX' \{\
20777 . ds PDF_POST -A "\\$2"
20782 . ds PDF_TXT \&\\$1
20783 . ds PDF_AST \\*[PDF_TXT]
20784 . substring PDF_AST -1 -1
20785 . if '\\*[PDF_AST]'+' \{\
20789 . if '\\*[PDF_AST]'*' \{\
20791 . ie '\\*[.T]'pdf' \{\
20792 . ie d pdf:look(\\*[PDF_NM]) \
20793 . as PDF_TXT \&\\*[PDF_AST_Q]\\*[pdf:look(\\*[PDF_NM])]\\*[PDF_AST_Q]
20795 . as PDF_TXT Unknown
20796 . if !rPDF_UNKNOWN .tm \
20797 \\n[.F]:\\n[.c]: forward reference detected (please run using 'pdfmom')
20802 . ie d pdf:href(\\*[PDF_NM]).info \
20803 . as PDF_TXT \&\\*[PDF_AST_Q]\\*[pdf:href(\\*[PDF_NM]).info]\\*[PDF_AST_Q]
20804 . el .as PDF_TXT Unknown
20807 . pdfhref L \\*[PDF_PRE] \\*[PDF_POST] -D \\*[PDF_NM] -- \\*[PDF_TXT]
20816 .MAC PDF_WWW_LINK END
20819 . ie '\\$1'PREFIX' \{\
20820 . ds PDF_PRE -P "\\$2"
20824 . ie '\\$1'SUFFIX' \{\
20825 . ds PDF_POST -A "\\$2"
20831 . ie !'\\*[PDF_TXT]'' \{\
20832 . ds PDF_AST \\*[PDF_TXT]
20833 . substring PDF_AST -1 -1
20834 . if '\\*[PDF_AST]'+' \{\
20838 . if '\\*[PDF_AST]'*' \{\
20840 . as PDF_TXT \&\\*[PDF_AST_Q]\\*[PDF_NM]\\*[PDF_AST_Q]
20843 . el .ds PDF_TXT \\*[PDF_NM]
20844 . pdfhref W -D "\\*[PDF_NM]" \\*[PDF_PRE] \\*[PDF_POST] -- \\*[PDF_TXT]
20849 . rm PDF_AST PDF_AST_Q
20852 .MAC PDF_TARGET END
20855 . pdfhref M -N \\*[ARG_1] -- \\$*
20856 . if '\\*[.T]'ps' .if !dpdf:href.map .tm gropdf-info:href \\*[ARG_1] \\$*
20862 \# [ -L -| -R | -C | -I <indent> ] \
20863 \# <image file> <width> <height> \
20864 \# [ SCALE <factor> ] [ ADJUST +|-<vertical shift> ]
20866 \# Allows embedding of PDF images with the same arguments as PSPIC
20867 \# plus SCALE and ADJUST options.
20869 \# <image file> <width> <height> are required.
20873 . if !'\\n[.z]'FLOAT*DIV' .FLOAT
20875 . ds ev-current \\n[.ev]
20877 . evc \\*[ev-current]
20878 . if \\n[#HYPHENATE] .nh
20879 . nr ind-pre-img \\n[.i]
20880 . nr ll-pre-img \\n[.l]
20883 . substring pos:tmp 0 0
20884 . ie !'\\*[pos:tmp]'-' .ds pdf-img:pos -C
20886 . ds pdf-img:pos \\$1
20889 . if '\\*[pdf-img:pos]'-I' \{\
20890 . nr pdf-img:ind \\$1
20893 . ds pdf-img:file \\$1
20894 . ds pdf-img@file \\$1
20895 . substring pdf-img@file -1 -3
20896 . if !'\\*[pdf-img@file]'pdf' \{\
20897 . tm1 "[mom]: Image file '\\*[pdf-img:file]' at line \\n[.c] not found, or not a PDF image.
20898 . ab Aborting '\\n[.F]' at \\$0, line \\n[.c].
20900 . nr pdf-img:width \\$2
20901 . nr pdf-img:depth \\$3
20903 . nr loop-counter \\n[#NUM_ARGS]
20904 . nr loop-count 0 1
20905 . while \\n+[loop-count]<=\\n[loop-counter] \{\
20906 . if '\\$1'SCALE' \{\
20908 . nr pdf-img:scale \\$1
20910 . nr pdf-img:width \\n[pdf-img:width]*\\n[pdf-img:scale]/100
20911 . nr pdf-img:depth \\n[pdf-img:depth]*\\n[pdf-img:scale]/100
20913 . if '\\$1'ADJUST' \{\
20915 . ds pdf-img:adj \\$1
20918 . if '\\$1'FRAME' \{\
20919 . nr pdf-img:frame 1
20920 . if !r pdf-img:frame-inset .nr pdf-img:frame-inset 6p
20923 . if '\\$1'CAPTION' \{\
20924 . nr pdf-img*have-caption 1
20925 . ds pdf-img*caption \\$2
20928 . if '\\$1'SHORT_CAPTION' \{\
20929 . ds pdf-img*caption-short \\$2
20932 . if '\\$1'LABEL' \{\
20933 . nr pdf-img*have-label 1
20934 . ds pdf-img*label \\$2
20935 . ds label-type pdf-img
20938 . if '\\$1'NO_SHIM' \{\
20939 . nr float*no-shim 1
20942 . ds pdf-img*label-sffx-tmp \\*[pdf-img*label-sffx]
20943 . substring pdf-img*label-sffx-tmp -1
20944 . if '\\*[pdf-img*label-sffx-tmp]'.' \
20945 . if \\n[pdf-img*caption-after-label]=0 .chop pdf-img*label-sffx
20946 . PDF_TARGET fig:\\n+[lists*target]
20947 . if '\\*[pdf-img:pos]'-C' \
20948 . nr pdf-img:ind (\\n[.ll]-\\n[ind-pre-img]-\\n[pdf-img:width])/2
20949 . if '\\*[pdf-img:pos]'-R' \{\
20950 . nr pdf-img:ind \\n[.ll]-\\n[pdf-img:width]-\\n[ind-pre-img]
20959 . if \\n[pdf-img*have-caption] \{\
20960 . if !\\n[pdf-img*autolabel] \{\
20961 . if !\\n[pdf-img*have-label] \{\
20963 . mla@error caption label \\n[.F] \\$0 \\n[.c]
20966 . if !\\n[pdf-img*caption-after-label] \{\
20967 . if !\\n[@TOP] .sp .5v
20968 . nr lead-pre-caption \\n[.v]
20971 . ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
20973 . img*caption-style
20974 . vs \\n[.ps]u+\\n[pdf-img*caption-autolead]u
20976 . PDF_IMG*SET_CAPTION_QUAD \\*[pdf-img*caption-quad]
20977 . sp \\n[lead-pre-caption]u-\\n[.v]u
20978 . nop \\*[pdf-img*caption]
20980 . if !'\\*[pdf-img*caption-space]'' .sp \\*[pdf-img*caption-space]
20987 . if \\n[pdf-img:frame] \{\
20988 . nr frame-width \\n[pdf-img:width]+(\\n[pdf-img:frame-inset]*2)
20989 . nr frame-depth \\n[pdf-img:depth]+(\\n[pdf-img:frame-inset]*2)
20990 . if '\\*[pdf-img:pos]'-L' \{\
20991 . nr pdf-img:ind \\n[pdf-img:frame-inset]
20992 . nr pdf-img:dbx-ind 0
20994 . if '\\*[pdf-img:pos]'-C' \{\
20995 . nr pdf-img:dbx-ind \
20996 \\n[.ll]-\\n[ind-pre-img]-\\n[pdf-img:width]/2-\\n[pdf-img:frame-inset]
20998 . if '\\*[pdf-img:pos]'-R' \{\
20999 . nr pdf-img:ind -\\n[pdf-img:frame-inset]
21000 . nr pdf-img:dbx-ind \
21001 \\n[.l]u-(\\n[pdf-img:width]u+(\\n[pdf-img:frame-inset]u*2u)+\\n[ind-pre-img]u)
21003 . if '\\*[pdf-img:pos]'-I' \{\
21004 . nr pdf-img:ind +\\n[pdf-img:frame-inset]
21005 . nr pdf-img:dbx-ind \\n[pdf-img:ind]-\\n[pdf-img:frame-inset]
21007 . DBX \\*[pdf-img:frame-weight] \
21008 \\n[pdf-img:dbx-ind]u \
21009 \\n[frame-width]u \
21010 \\n[frame-depth]u \
21011 \\*[pdf-img:frame-color]
21012 . sp \\n[pdf-img:frame-inset]u
21013 . nr pdf-img:ind -\\n[pdf-img:frame-inset]
21015 . ti \\n[pdf-img:ind]u+\\n[pdf-img:frame-inset]u
21016 . nop \X'pdf: pdfpic \\*[pdf-img:file] -L \\n[pdf-img:width]z \\n[pdf-img:depth]z'
21017 . if '\\*[pdf-img:pos]'-C' .nr pdf-img:ind +\\n[pdf-img:frame-inset]
21018 . sp \\n[pdf-img:depth]u
21019 . if \\n[pdf-img:frame] .sp \\n[pdf-img:frame-inset]u
21020 . if (\\n[pdf-img*have-label]=1):(\\n[pdf-img*autolabel]=1):(\\n[pdf-img*caption-after-label]=1) \{\
21022 . if (\\n[pdf-img*have-label]=1):(\\n[pdf-img*autolabel]=1) \{\
21023 . if !\\n[pdf-img*have-caption] \
21024 . mla@error label caption \\n[.F] \\$0 \\n[.c]
21027 . nr lead-pre-label \\n[.v]
21030 . ie \\n[#PRINT_STYLE]=1 .TYPEWRITER
21033 . vs \\n[.ps]u+\\n[pdf-img*label-autolead]u
21035 . if \\n[pdf-img*label-with-chapter] \
21036 . ds chapno \\n[#CH_NUM].
21037 . PDF_IMG*SET_LABEL_QUAD \\*[pdf-img*label-quad]
21038 . sp \\n[lead-pre-label]u-\\n[.v]u
21039 . if !'\\*[pdf-img*label-space]'' .sp \\*[pdf-img*label-space]
21040 . ie \\n[pdf-img*autolabel] \
21042 \\*[pdf-img*label-prfx]\\*[chapno]\\n+[fig*label-num]\\*[pdf-img*label-sffx]\|
21043 . el .if !'\\*[pdf-img*label]'' .nop \\*[pdf-img*label]
21044 . if \\n[pdf-img*autolabel] \
21045 . ds pdf-img*label \\*[chapno]\\n[fig*label-num]
21050 . if !'\\*[pdf-img*caption]'' \{\
21051 . if \\n[pdf-img*caption-after-label] \{\
21052 . ds pdf-img*caption " \\*[pdf-img*caption]
21053 . nop \\*[pdf-img*caption-specs]\\*[pdf-img*caption]\\*[revert-specs]
21064 . if !'\\*[pdf-img:adj]'' \{\
21066 . if \\n[#COLUMNS]>1 \
21068 \!. sp \\*[pdf-img:adj]
21071 . if !'\\*[pdf-img:adj]'' \
21072 . if !\\n[@TOP] \!.sp -\\*[pdf-img:adj]
21076 . nr dl \\n[pdf-img:width]
21077 . if !'\\*[pdf-img*caption-short]'' .ds short -short
21078 . ie !'\\*[pdf-img*label]'' \
21079 . TO_FIGURES "\\*[pdf-img*label]" "\\*[pdf-img*caption\\*[short]]"
21080 . el .TO_FIGURES "\\*[pdf-img*caption\\*[short]]"
21087 \# [ <inset> ] [ <rule weight> ] [ <color> ]
21089 \# Sets parameters for pdf image frames.
21091 \# Defaults are '6p' '.5' 'black'. Arguments to be left at default
21092 \# must be entered as "".
21094 .MAC PDF_IMAGE_FRAME END
21096 . ds frame-arg \\$1
21097 . substring frame-arg -1
21098 . ie \B'\\*[frame-arg]' \{\
21099 . tm1 "[mom]: \\$0 inset argument at line \\n[.c]
21100 . tm1 " of '\\n[.F]' requires a unit of measure.
21101 . tm1 " Default 6 point inset will be used instead.
21103 . el .nr pdf-img:frame-inset \\$1
21107 . ds frame-arg \\$1
21108 . substring frame-arg -1
21109 . ie \B'\\*[frame-arg]' \{\
21110 . ds pdf-img:frame-weight \\$1
21114 . ds frame-arg \\$1
21115 . substring frame-arg -1
21116 . length arg-len \\*[frame-arg]
21117 . if \\n[arg-len]=1 \{\
21118 . tm1 "[mom]: \\$0 rule weight argument at line \\n[.c]
21119 . tm1 " of '\\n[.F]' must not have a unit of measure appended.
21120 . tm1 " Default .5 rule weight will be used instead.
21126 . ie m \\$1 .ds pdf-img:frame-color \\$1
21128 . tm1 "[mom]: \\$0 color argument '\\$1' at line \\n[.c]
21129 . tm1 " of '\\n[.F]' is not a valid color.
21130 . tm1 " Default black will be used instead.
21135 .MAC PDF_IMAGE_CLEAN END
21138 . rm pdf-img*caption
21139 . rm pdf-img*caption-short
21140 . rm pdf-img*caption-space
21143 . rm pdf-img*label-space
21151 . rr pdf-img:no-shim
21153 .\" Cutarounds not yet implemented
21155 . if !\\n[cutaround] \
21156 . rr pdf-img*have-caption
21157 . if !\\n[cutaround] \{\
21158 . rr pdf-img:frame-inset
21161 . if '\\*[pdf-img*label-sffx-tmp]'.' .ds pdf-img*label-sffx .
21165 . ie '\\n[.z]'' \{\
21166 . ds pdfcleaned \\$*
21171 . nop \\*[\\*[pdfcleaned]]
21175 . asciify pdf:clean
21177 . ds \\*[pdfcleaned] "\\*[pdf:clean]
21181 . el .nop \!.pdfmomclean \\$@
21183 \# vim: ft=groff: encoding=latin1: fileencoding=latin1: nomodified: