3 .\" Mom -- a typesetting/document-processing macro set for groff.
5 .\" Copyright (C) 2002, 2003 Free Software Foundation, Inc.
6 .\" Written by Peter Schaffter (df191@ncf.ca)
8 .\" This file is part of groff.
10 .\" groff is free software; you can redistribute it and/or modify it under
11 .\" the terms of the GNU General Public License as published by the Free
12 .\" Software Foundation; either version 2, or (at your option) any later
15 .\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 .\" You should have received a copy of the GNU General Public License along
21 .\" with groff; see the file COPYING. If not, write to the Free Software
22 .\" Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 .if (\n[.x]\n[.y] < 118) \
30 . ab You need GNU troff version 1.18 or higher to run this version of mom!
32 \# Inasmuch as possible, macros that turn a feature on or off follow
33 \# a similar style. Invoking the macro without an argument turns
34 \# the feature on. Invoking it with any other argument turns it off.
35 \# Use of the argument OFF is recommended, but not required; users
36 \# may find other conventions preferable (e.g. NO, X, END, QUIT, etc.).
38 \# "<anything>" in the description of arguments that can be passed
39 \# to a macro means that any argument turns the feature off.
41 \# ====================================================================
43 \# TYPESETTING MACROS, STRINGS, AND ALIASES
44 \# ========================================
48 .als ALIAS als \"Alias .als as ALIAS
49 .als ALIASN aln \"Alias .aln (number registers) as ALIASN
60 \# ALIASES FOR NUMBER REGISTERS
61 \# ----------------------------
63 .ALIASN #PT_SIZE .ps \"fractional point size in units
64 .ALIASN #DIVER_DEPTH dn \"diversion depth
65 .ALIASN #DIVER_WIDTH dl \"diversion width
66 .ALIASN #TRAP_DISTANCE .t \"distance to next trap
67 .ALIASN #LEAD .v \"line space (.vs, not .ls)
68 .ALIASN #PAGE_LENGTH .p \"page length
69 .ALIASN #NUM_ARGS .$ \"number of arguments passed to a macro
70 .ALIASN #INDENT .i \"value of current indent
72 \# ====================================================================
76 .cflags 4 /\(en \" So slash and en-dashes get broken
77 .nr #L_MARGIN \n(.o \" Tabs, etc require #L_MARGIN
79 \# ====================================================================
81 \# END MACRO FOR LETTERS
82 \# ---------------------
86 \# The .em macro executed at the end of letters. Turns footers
87 \# and pagination off, terminates and outputs diversion CLOSING
88 \# (indented with the author's name underneath).
94 . if \\n[#DOC_TYPE]=4 \{\
96 . if !'\\n(.z'' \{ .di \}
99 . TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
100 . ALD \\n[#DOC_LEAD]u*2u
102 . if \\n[#CLOSING] \{\
106 . ALD \\n[#DOC_LEAD]u*3u
107 . PRINT \\*[$AUTHOR_1]
113 \# =====================================================================
117 \# Macros that control the physical layout of the page: paper size
123 \# <width of printer sheet>
125 \# Stores user supplied page width in register #PAGE_WIDTH.
127 \# #PAGE_WIDTH is used to establish the default LL (and right margin).
128 \# Requires unit of measure.
132 . nr #PAGE_WIDTH \\$1
133 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
134 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
141 \# <offset from page left>
143 \# Stores user supplied page offset in register #L_MARGIN.
144 \# Sets .po to user supplied offset.
146 \# Requires unit of measure.
150 . nr #L_MARGIN (\\$1)
158 \# <width of right margin>
160 \# Stores user supplied right margin in register #R_MARGIN.
162 \# This is a pseudo-margin. Right margin is actually a function of
163 \# line length. The macro calculates line length from the page offset
164 \# and the value plugged into #R_MARGIN.
166 \# N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
168 \# Requires unit of measure.
172 . nr #R_MARGIN (\\$1)
173 . ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
175 . nr #L_LENGTH \\n(.l
182 \# <distance to advance from top of page>
184 \# Stores the user supplied top margin in register #T_MARGIN.
185 \# Advances user supplied depth from the top of the page.
187 \# Requires unit of measure.
191 . nr #T_MARGIN (\\$1)
195 . sp |\\n[#T_MARGIN]u-1v
204 \# <space to leave at the bottom of the page>
206 \# Stores the user supplied bottom margin in register #B_MARGIN.
208 \# Requires unit of measure.
212 . nr #B_MARGIN (\\$1)
213 . wh -\\n[#B_MARGIN]u DO_B_MARGIN
220 \# <pagewidth> [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
222 \# Page set-up. Collects arguments and passes them to the appropriate
225 \# All arguments after pagewidth are optional, but must appear
226 \# in the order given above. (User can fill in as much or as
227 \# little as desired.)
229 \# All arguments require a unit of measure.
235 . ie '\\$3'' \{ .L_MARGIN \\n(.o \}
236 . el \{ .L_MARGIN \\$3 \}
237 . ie '\\$4'' \{ .R_MARGIN 1i \}
238 . el \{ .R_MARGIN \\$4 \}
239 . if !'\\$5'' \{ .T_MARGIN \\$5 \}
240 . if !'\\$6'' \{ .B_MARGIN \\$6 \}
243 \# =====================================================================
245 \# +++PAGE CONTROL+++
247 \# Generic macros for breaking pages.
254 \# Plants the top margin (set in .PAGE) at the top of each page.
256 \# The trap is set in .PAGE
260 . sp |\\n[#T_MARGIN]u-1v
270 \# Plants the bottom margin (set in .PAGE) at the bottom of each page.
272 \# The trap is set in .PAGE.
280 \# =====================================================================
282 \# +++GENERAL STYLE MACROS+++
284 \# Macros that are likely to appear together to define general
285 \# type style: line length, family, font, point size, and line
293 \# Stores user supplied line length in register #L_LENGTH.
294 \# Sets .ll to #L_LENGTHu
296 \# Requires unit of measure.
299 . nr #L_LENGTH (\\$1)
300 . nr #USER_SET_L_LENGTH 1
311 \# Stores user supplied font family in string $FAMILY. Sets .fam
315 . if \\n[#PRINT_STYLE]=1 \{ .return \}
316 . if \\n[#IGNORE] \{ .return \}
327 \# Stores user supplied font in $FONT and sets .ft to $FONT.
330 . if \\n[#PRINT_STYLE]=1 \{\
332 . if \\n[#UNDERLINE_ITALIC]=1 \{\
336 . if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
342 . el \{ .UNDERLINE OFF \}
353 \# <point size of type>
355 \# Sets point size to user supplied value in scaled points.
356 \# If #AUTO_LEAD is on, sets .vs to #AUTOLEAD_VALUE+#PT_SIZE.
358 \# Must NOT use a unit of measure.
361 . if \\n[#PRINT_STYLE]=1 \{ .return \}
362 . if \\n[#IGNORE] \{ .return \}
365 . if \\n[#AUTO_LEAD] \{\
366 . ie \\n[#AUTOLEAD_FACTOR] \{ .vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u \}
367 . el \{ .vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u \}
369 . nr #PT_SIZE_IN_UNITS \\n[.ps]
376 \# <point size of type>
378 \# Sets point size to user supplied value in scaled points.
379 \# Intended to be called inline with \*[SIZE <n><unit>]
381 \# Can be used with a unit of measure or not.
392 \# <leading between lines of text>
394 \# Turns off #AUTO_LEAD if it's on.
395 \# Sets .vs to user supplied value.
397 \# Does not require unit of measure. LEAD automatically turns off AUTOLEAD.
400 . if \\n[#PRINT_STYLE]=1 \{ .return \}
401 . if \\n[#IGNORE] \{ .return \}
403 . if \\n[#AUTO_LEAD] \{\
405 . rr #AUTOLEAD_FACTOR
408 . if \\n[#T_MARGIN_SET]=1 \{\
409 . sp |\\n[#T_MARGIN]u-1v
418 \# <leading value to add to #PT_SIZE> [FACTOR]
420 \# Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
421 \# Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
422 \# All subsequent PT_SIZE requests reset the leading in the same way until
423 \# AUTOLEAD is turned off.
425 \# With the optional FACTOR argument, the current point size is
426 \# multiplied by #AUTOLEAD_VALUE instead of the two being added
430 . if \\n[#PRINT_STYLE]=1 \{ .return \}
431 . if \\n[#IGNORE] \{ .return \}
433 . nr #AUTOLEAD_VALUE (p;\\$1)
434 . ie \\n[#NUM_ARGS]=2 \{\
435 . if '\\$2'FACTOR' \{\
436 . nr #AUTOLEAD_FACTOR 1
437 . vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u
441 . vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u
443 . if \\n[#T_MARGIN_SET] \{\
444 . sp |\\n[#T_MARGIN]u-1v
450 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
451 \# ------------------------------------------------
459 \# =====================================================================
463 \# AUTOMATIC PAIRWISE KERNING
464 \# --------------------------
466 \# <none> | <anything>
468 \# Turns automatic pairwise kerning on or off.
482 \# INLINE KERNING AND HORIZONTAL MOVEMENT
483 \# --------------------------------------
485 \# Inline kerning provides a simple method for users to adjust the
486 \# amount of space between any two letters. It's predicated on a
487 \# unit of measure "U", which is 1/36 of the current point size as
488 \# returned by \n[.ps]. E.g., if the current point size is 18,
489 \# \n[.ps] returns 18000u, therefore U=500u. Since U remains
490 \# proportional relative to the current point size, the amount
491 \# of kerning between two letters as expressed in Us remains
492 \# visually similar regardless of changes in point size.
494 \# N.B.--the amount of inline kerning supplied by \*[BU<n>] or
495 \# \*[FU<n>] is added to or subtracted from any kerning that already
496 \# takes place between two characters when automatic kerning is
499 \# In groff v. 1.17.2, it was not possible to pass arguments to macros that
500 \# were called with inline escapes, nor thence to evaluate conditional
501 \# expressions. Consequently, each pseudo-escape \[BU<n>] had to be defined
502 \# separately with ".char".
504 \# As of v. 1.18, one can pass arguments to inline strings/macros,
505 \# hence it is now possible to do \*[BU n] where n, inline, is the desired
506 \# number of kern units. The original .char definitions have been left in
507 \# for backward compatibility with documents created prior to mom-1.1.3c.
511 .ds BU \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
512 .ds FU \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
514 \# Initialize strings for pre-1.1.3c-style BU and FU
517 .while \n+[#LOOP]<37 \{\
518 . ds BU\n[#LOOP] \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
522 .while \n+[#LOOP]<37 \{\
523 . ds FU\n[#LOOP] \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\n[#LOOP]u)'
528 \# *Horizontal movements
529 \# BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
530 \# specified number of points.
531 \# Left in for backward compatibility with mom-1.1.3c, the
532 \# preferred methods for inline horizontal movements are now
533 \# \*[BCK <n><unit>] and \*[FWD <n><unit>].
535 .ds BCK \h'-\\$1\\$2'
542 .ds BP1.25 \h'-1.25p'
544 .ds BP1.75 \h'-1.75p'
546 .ds BP2.25 \h'-2.25p'
548 .ds BP2.75 \h'-2.75p'
550 .ds BP3.25 \h'-3.25p'
552 .ds BP3.75 \h'-3.75p'
554 .ds BP4.25 \h'-4.25p'
556 .ds BP4.75 \h'-4.75p'
558 .ds BP5.25 \h'-5.25p'
560 .ds BP5.75 \h'-5.75p'
562 .ds BP6.25 \h'-6.25p'
564 .ds BP6.75 \h'-6.75p'
566 .ds BP7.25 \h'-7.25p'
568 .ds BP7.75 \h'-7.75p'
570 .ds BP8.25 \h'-8.25p'
572 .ds BP8.75 \h'-8.75p'
574 .ds BP9.25 \h'-9.25p'
576 .ds BP9.75 \h'-9.75p'
578 .ds BP10.25 \h'-10.25p'
579 .ds BP10.5 \h'-10.5p'
580 .ds BP10.75 \h'-10.75p'
582 .ds BP11.25 \h'-11.25p'
583 .ds BP11.5 \h'-11.5p'
584 .ds BP11.75 \h'-11.75p'
586 .ds BP12.25 \h'-12.25p'
587 .ds BP12.5 \h'-12.5p'
588 .ds BP12.75 \h'-12.75p'
630 .ds FP10.25 \h'10.25p'
632 .ds FP10.75 \h'10.75p'
634 .ds FP11.25 \h'11.25p'
636 .ds FP11.75 \h'11.75p'
638 .ds FP12.25 \h'12.25p'
640 .ds FP12.75 \h'12.75p'
643 \# WHOLE LINE KERNING (RW and EW)
644 \# -----------------------------
645 \# The line kerning macros are special instances of track kerning,
646 \# used where a complete line needs to be tightened (or relaxed) in
647 \# order to accomodate or remove one or two more characters
648 \# than the default justification permits.
651 \# <amount of overall "kerning" (letter spacing) to apply to the line>
653 \# Invokes .tkf (track kerning) for the current font with
654 \# 1 as both the upper and lower point size limits, so that
655 \# the value entered by the user applies regardless of point
656 \# size. RW ("Reduce Whitespace") reduces the amount of space
657 \# between all characters by an equal amount. EW ("Extra
658 \# Whitespace") increases the amount of space.
660 \# Decimal values are acceptable.
662 \# The groff documentation is a tad confusing about what unit of
663 \# measure is used in track kerning, only that the width of each
664 \# character is increased or decreased by the amount(s) passed as
665 \# arguments to .tkf, and something about linear function of point
666 \# size. In fact, with the way I've put this macro together, it
667 \# doesn't matter. All the user needs to know is that a value
668 \# of one will produce an unacceptably tight or loose line at most
669 \# text point sizes; therefore, effective use of RW and EW is in
670 \# the fractional range below 1 (e.g. .25, .5). Given that RW
671 \# and EW are for massaging type, a certain amount of
672 \# experimentation and previewing is expected and necessary.
674 \# \n(.f holds the current font number, which is acceptable to .tkf.
676 \# RW and EW must be reset to 0 to cancel their effect on
677 \# subsequent output lines.
680 . if \\n[#BR_AT_LINE_KERN] \{ .br \}
681 . tkf 1 1 -\\$1 1 -\\$1
682 . tkf 2 1 -\\$1 1 -\\$1
683 . tkf 3 1 -\\$1 1 -\\$1
684 . tkf 4 1 -\\$1 1 -\\$1
689 . if \\n[#BR_AT_LINE_KERN] \{ .br \}
690 . tkf 1 1 \\$1 1 \\$1
691 . tkf 2 1 \\$1 1 \\$1
692 . tkf 3 1 \\$1 1 \\$1
693 . tkf 4 1 \\$1 1 \\$1
697 \# BREAK AT LINE KERN
698 \# ------------------
702 \# Enables/disables .br's before .RW and .EW
704 \# Mostly, users will want .br's before any kind of line kerning, but
705 \# there may be cases where they don't. BR_BEFORE_LINE_KERN is off by
706 \# default and must be invoked explicitly.
708 .MAC BR_AT_LINE_KERN END
709 . ie '\\$1'' \{ .nr #BR_AT_LINE_KERN 1 \}
710 . el \{ .rr #BR_AT_LINE_KERN \}
713 \# =====================================================================
720 \# <none> | <anything> | DEFAULT
722 \# LINES <n> | MARGIN <n> | SPACE <n>
724 \# Turns auto hyphenation on or off, resets the hyphenation style
725 \# to default, or permits the setting of various hyphenation
728 \# HY ON defaults to .hy 14, i.e. no hyphens after the
729 \# first two or before the last two characters of a word, and
730 \# no hyphenation of the last line prior to a trap (e.g.,
731 \# at the bottom of a page).
733 \# HY DEFAULT resets the hyphenation style to .hy 14 (see
734 \# above) if that behaviour is desired after changes have been
735 \# made to LINES, MARGIN, or SPACE.
737 \# HY LINES <n> sets the number of allowable consecutive hyphenated lines.
739 \# HY MARGIN <n> sets the amount of space (ipPcm) allowed at the end
740 \# of a line in QUAD mode before hyphenation is tripped (e.g. if there's
741 \# only 6 points left, groff won't try to hyphenate the next word).
743 \# HY SPACE sets the amount of extra interword space (ipPcm) that can
744 \# be added in JUSTIFY mode to prevent a line from being hyphenated.
752 . if !'\\$1'LINES' \{\
756 . if !'\\$1'MARGIN' \{\
760 . if !'\\$1'SPACE' \{\
764 . if !'\\$1'DEFAULT' \{\
768 . if '\\$1'LINES' \{ .hlm \\$2 \}
769 . if '\\$1'MARGIN' \{ .hym \\$2 \}
770 . if '\\$1'SPACE' \{ .hys \\$2 \}
771 . if '\\$1'DEFAULT' \{\
780 \# HYPHENATION PARAMETERS
781 \# ----------------------
783 \# <# of lines> | <size of margin> | <amount of interword space>
785 \# Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
794 \# =====================================================================
796 \# +++VERTICAL SPACING+++
801 \# <user supplied lead to advance below current baseline>
803 \# Creates or modifies register #ALD. Adds user supplied lead
804 \# below current baseline.
806 \# Requires a unit of measure.
817 \# <user supplied lead to reverse above current baseline>
819 \# Creates or modifies register #RLD. Reverses user supplied
820 \# lead above current baseline.
822 \# Requires a unit of measure.
831 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding
832 \# \*[RLD] forms have been left in for backward compatibility with
833 \# documents created using mom-1.1.3c or earlier. The prefered
834 \# methods of advancing and reversing on the page inline are \*[UP <n><unit>]
835 \# and \*[DOWN <n><unit>].
837 .ds DOWN \v'\\$1\\$2'
844 .ds ALD1.25 \v'1.25p'
846 .ds ALD1.75 \v'1.75p'
848 .ds ALD2.25 \v'2.25p'
850 .ds ALD2.75 \v'2.75p'
852 .ds ALD3.25 \v'3.25p'
854 .ds ALD3.75 \v'3.75p'
856 .ds ALD4.25 \v'4.25p'
858 .ds ALD4.75 \v'4.75p'
860 .ds ALD5.25 \v'5.25p'
862 .ds ALD5.75 \v'5.75p'
864 .ds ALD6.25 \v'6.25p'
866 .ds ALD6.75 \v'6.75p'
868 .ds ALD7.25 \v'7.25p'
870 .ds ALD7.75 \v'7.75p'
872 .ds ALD8.25 \v'8.25p'
874 .ds ALD8.75 \v'8.75p'
876 .ds ALD9.25 \v'9.25p'
878 .ds ALD9.75 \v'9.75p'
880 .ds ALD10.25 \v'10.25p'
881 .ds ALD10.5 \v'10.5p'
882 .ds ALD10.75 \v'10.75p'
884 .ds ALD11.25 \v'11.25p'
885 .ds ALD11.5 \v'11.5p'
886 .ds ALD11.75 \v'11.75p'
888 .ds ALD12.25 \v'12.5p'
889 .ds ALD12.5 \v'12.5p'
890 .ds ALD12.75 \v'12.75p'
896 .ds RLD1.25 \v'-1.25p'
898 .ds RLD1.75 \v'-1.75p'
900 .ds RLD2.25 \v'-2.25p'
902 .ds RLD2.75 \v'-2.75p'
904 .ds RLD3.25 \v'-3.25p'
906 .ds RLD3.75 \v'-3.75p'
908 .ds RLD4.25 \v'-4.25p'
910 .ds RLD4.75 \v'-4.75p'
912 .ds RLD5.25 \v'-5.25p'
914 .ds RLD5.75 \v'-5.75p'
916 .ds RLD6.25 \v'-6.25p'
918 .ds RLD6.75 \v'-6.75p'
920 .ds RLD7.25 \v'-7.25p'
922 .ds RLD7.75 \v'-7.75p'
924 .ds RLD8.25 \v'-8.25p'
926 .ds RLD8.75 \v'-8.75p'
928 .ds RLD9.25 \v'-9.25p'
930 .ds RLD9.75 \v'-9.75p'
932 .ds RLD10.25 \v'-10.25p'
933 .ds RLD10.5 \v'-10.5p'
934 .ds RLD10.75 \v'-10.75p'
936 .ds RLD11.25 \v'-11.25p'
937 .ds RLD11.5 \v'-11.5p'
938 .ds RLD11.75 \v'-11.75p'
940 .ds RLD12.25 \v'-12.5p'
941 .ds RLD12.5 \v'-12.5p'
942 .ds RLD12.75 \v'-12.75p'
944 \# =====================================================================
948 \# AUTOMATIC LIGATURES
949 \# -------------------
951 \# <none> | <anything>
953 \# Turns automatic ligature generation on or off.
955 \# Ligatures may be supplied manually with \(fi, \(fl, etc.
972 \# [ ,, ] | [ << ] | [ >> ] | <anything>
974 \# [ DA | DE | ES | FR | IT | NL | NO | PT | SV ] | <anything>
976 \# Turns smartquotes on (optionally with a quoting style from the
977 \# argument list, or off).
979 \# The " character is read outside the macro when mom is
980 \# processed. The strings for open/close ($QUOTE<n>) are then
981 \# defined in the macro.
983 \# (Note to myself: ascii code for " is \N'34'.)
985 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1027 . ds $QUOTE0 \\[Fo]\\|
1028 . ds $QUOTE1 \\|\\[Fc]
1032 . ds $QUOTE0 \\[Fo]\\|
1033 . ds $QUOTE1 \\|\\[Fc]
1055 . if !r#ARGS_TO_SQ \{\
1065 \# Strings for foot and inch marks
1070 \# =====================================================================
1072 \# +++LINE BREAKS+++
1079 \# Breaks a line without advancing.
1081 \# EL is the mnemonic used on older, dedicated typesetting machines
1082 \# to indicate "process the line, then return to the left margin
1083 \# without advancing the galley medium." It stands for End Line.
1085 \# Sadly, EL is only a fake. It will work in all instances EXCEPT
1086 \# when the line to be EL'd is the last line before a footer trap.
1087 \# Use TRAP OFF/TRAP to circumvent this.
1094 \# =====================================================================
1096 \# +++FILLING/QUADDING/JUSTIFYING+++
1103 \# Turns fill on and sets .ad to b.
1105 \# Justifies text left and right.
1108 . if \\n[#TAB_ACTIVE]=0 \{\
1110 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1114 . if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1122 \# L | LEFT | R | RIGHT | C | CENTER/CENTRE
1124 \# Turns fill on and sets .ad to l, r, or c.
1126 \# Terminology is a problem here. Some people call quad left
1127 \# left justified, flush left, or flush left/rag right (and the
1128 \# reverse for quad right). Quad center is sometimes called rag
1129 \# both. For our purposes, all "quad" modes mean that groff fill
1133 . ds $QUAD_VALUE \\$1
1134 . if \\n[#TAB_ACTIVE]=0 \{\
1136 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1140 . if '\\*[$QUAD_VALUE]'L' \{ .ad l \}
1141 . if '\\*[$QUAD_VALUE]'LEFT' \{ .ad l \}
1142 . if '\\*[$QUAD_VALUE]'R' \{ .ad r \}
1143 . if '\\*[$QUAD_VALUE]'RIGHT' \{ .ad r \}
1144 . if '\\*[$QUAD_VALUE]'C' \{ .ad c \}
1145 . if '\\*[$QUAD_VALUE]'CENTER' \{ .ad c \}
1146 . if '\\*[$QUAD_VALUE]'CENTRE' \{ .ad c \}
1147 . if '\\*[$QUAD_VALUE]'J' \{ .ad b \}
1148 . if '\\*[$QUAD_VALUE]'JUSTIFY' \{ .ad b \}
1153 \# LEFT, RIGHT, AND CENTER
1154 \# -----------------------
1155 \# The purpose of these macros is to allow the user to enter lines
1156 \# of text that will be quadded LRC *without* the user having to
1157 \# enter .BR or .br between lines. For the sake of consistency,
1158 \# all three appear to behave similarly (from the point of view of the user),
1159 \# although the underlying primitives don't. For this reason, LEFT,
1160 \# RIGHT, and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY
1161 \# to restore text to groff fill mode.
1168 \# Turns fill mode off. Allows user to quad lines left without
1169 \# requiring the .BR or .br macro.
1171 \# LEFT simply turns fill off. Lines that exceed the current LL will
1172 \# not be broken, simply continued (indefinitely) until a return is
1173 \# encountered. Note that this behaviour differs from the RIGHT and
1177 . if \\n[#TAB_ACTIVE]=0 \{\
1179 . ds $RESTORE_QUAD_VALUE LEFT
1184 . if '\\n(.z'LETTERHEAD1' \{ .rr #DATE_FIRST \}
1193 \# Turns fill on. Allows user to quad lines right without
1194 \# requiring the .BR or .br macro.
1196 \# Lines that exceed the current LL will be broken, with the excess
1197 \# text quadded right.
1200 . if \\n[#TAB_ACTIVE]=0 \{\
1202 . ds $RESTORE_QUAD_VALUE RIGHT
1215 \# Turns fill on. Allows user to center lines without
1216 \# requiring the .BR or .br macro.
1218 \# Lines that exceed the current LL will be broken, with the excess
1222 . if \\n[#TAB_ACTIVE]=0 \{\
1223 . ds $RESTORE_QUAD_VALUE CENTER
1230 \# =====================================================================
1234 \# There are two different kinds of tabs available: typesetting tabs
1237 \# Typesetting tabs are set with TAB_SET, which requires a tab number,
1238 \# an indent (offset) from the left margin and a length (optionally
1239 \# with a quad direction and an instruction to fill lines). After tabs
1240 \# are set with TS, they are called with .TAB n, where "n"
1241 \# corresponds to the number passed to TAB_SET as a valid tab number.
1243 \# String tabs allow the user to mark off tab positions inline. Tab
1244 \# indents and lengths are calculated from the beginning and end
1245 \# positions of the marks. Up to 19 string tabs may be created,
1246 \# numbered 1-19. Once created, they are called with .TAB n,
1247 \# just like typesetting tabs.
1249 \# Setting up string tabs is a two-step procedure. First, the user
1250 \# enters an input line in which s/he wants to mark off string tabs.
1251 \# The beginning of a tab is marked with \*[STn], where "n" is
1252 \# the desired number of the tab. The end of the the tab is marked
1253 \# with \*[STnX]. All ST's must have a matching STX. String tabs
1256 \# Next, the user invokes .ST n for every string tab defined, and
1257 \# optionally passes quad information to it. That done, string tabs
1258 \# can be called just like typesetting tabs.
1260 \# String tabs don't preview properly with gxditview. Use gv instead.
1262 \# Strings for string tab inlines
1263 \# ------------------------------
1265 \# Initialize string tab markers numbered 1 to 19.
1268 .while \n+[#LOOP]<20 \{\
1269 . ds ST\n[#LOOP] \Ek[#ST\n[#LOOP]_OFFSET]
1273 .while \n+[#LOOP]<20 \{\
1274 . ds ST\n[#LOOP]X \Ek[#ST\n[#LOOP]_MARK]
1279 \# These are reserved ST numbers for internal use
1280 .ds ST100 \Ek[#ST100_OFFSET]
1281 .ds ST100X \Ek[#ST100_MARK]
1282 .ds ST101 \Ek[#ST101_OFFSET]
1283 .ds ST101X \Ek[#ST101_MARK]
1286 \# QUAD AND SET STRING TABS
1287 \# ------------------------
1289 \# <stringtab number> L | R | C | J [QUAD]
1291 \# Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1292 \# tab based on the collected information.
1294 \# Like TS, ST invoked without a quad direction will default to LEFT.
1295 \# If lines should be filled and quadded, use the optional argument QUAD.
1296 \# N.B. -- indents *must* be turned off before setting string tabs
1300 . ds $ST\\$1_QUAD_DIR \\$2
1301 . if \\n[#NUM_ARGS]=3 \{\
1302 . ds $ST\\$1_FILL QUAD
1304 . nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1305 . ie \\n[#IN_TAB] \{\
1306 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1309 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1317 \# <n> ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]]
1319 \# Creates macros TABn and TAB n, where "n" is any arbitrary number.
1320 \# TABn is a typesetting tab (i.e. a tab defined as an indent
1321 \# from the page left offset plus a line length.)
1323 \# n = arbitrary digit to identify the tab
1324 \# indent = indent from left margin; unit of measure required
1325 \# length = length of tab (unit of measure required; can be
1326 \# \w'<string>'u--if more than one word in string, surround
1327 \# with double quotes "\w'<three word string>'"
1328 \# LRCJ = quad for tab (left, right, center, justified)
1329 \# If option QUAD afterwards is not given, quad is line for line
1330 \# (no fill mode), meaning that there's no need for .BR or .br
1332 \# QUAD = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1335 \# N.B. -- indents *must* be turned off before setting tabs
1339 \# .TAB_SET 1 2P+6p 12P C
1341 \# means "create a tab numbered 1 that starts 2 picas and 6 points from
1342 \# the left margin, is 12 picas long, and centre each input line."
1344 \# .TAB_SET 1 2P+6P 12P C QUAD
1346 \# means exactly the same thing, except that input lines are joined and
1347 \# the area delimted by the tab filled with centered text.
1349 \# TAB n can be called at any time after being set.
1351 \# Tabs are NOT columnar in behaviour. If the text inside a
1352 \# tab runs to several lines, when you call the next tab a break
1353 \# occurs, meaning that the new tab starts one line below the last
1354 \# line in the previous tab. For columnar behaviour, you must
1355 \# use the multi-column macros in addition to tabs.
1357 \# If you want tabs to line up bottom-line to bottom-line (most likely
1358 \# single line tabs), use .TN (provided the tabs are numbered sequentially).
1359 \# Otherwise, you must use .EL then .TAB <n> if you want them to align.
1361 \# If you want to reset tabs, you must use .TQ before .TAB_SET.
1363 \# Note that indents are turned off automatically whenever a new
1364 \# tab is called with TAB <n>.
1366 \# Tabs themselves are user-invoked using the TAB macro with a numeric
1367 \# argument, e.g. TAB 1.
1369 \# Generally, in order not to get confused, it's a good idea
1370 \# to make sure all indents are off before setting tabs.
1374 . nr #TAB_NUMBER \\$1
1375 . ds $CURRENT_TAB \\n[#TAB_NUMBER]
1376 . nr #TAB_OFFSET (\\$2)
1377 . nr #TAB_LENGTH (\\$3)
1378 . MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1382 . nr #CURRENT_TAB \\n[#TAB_NUMBER]
1383 . ds $CURRENT_TAB \\*[$CURRENT_TAB]
1384 . nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1385 . nr #ST_OFFSET \\n[#TAB_OFFSET]
1386 . po \\\\n[#L_MARGIN]u+\\\\n[#TAB_OFFSET\\\\*[$CURRENT_TAB]]u
1387 . ll \\n[#TAB_LENGTH]u
1389 . ie '\\$5'QUAD' \{\
1390 . if '\\$4'L' \{ .QUAD L \}
1391 . if '\\$4'R' \{ .QUAD R \}
1392 . if '\\$4'C' \{ .QUAD C \}
1393 . if '\\$4'J' \{ .JUSTIFY \}
1396 . if '\\$4'' \{ .LEFT \}
1397 . if '\\$4'L' \{ .LEFT \}
1398 . if '\\$4'R' \{ .RIGHT \}
1399 . if '\\$4'C' \{ .CENTER \}
1400 . if '\\$4'J' \{ .JUSTIFY \}
1410 \# <tab number to tab into>
1412 \# Moves to tab number passed as an argument.
1415 . ds $TAB_NUMBER \\$1
1416 . TAB\\*[$TAB_NUMBER]
1426 \# Automagically moves to TAB<n+1> on the same line as the last
1427 \# line of the previous tab.
1429 \# If the tabs being aligned fall too close to the footer
1430 \# trap, the line entered after .TN will appear on the next page,
1431 \# unless TRAP...TRAP OFF is used.
1435 . nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1445 \# Sets #TAB_ACTIVE to "0" (off).
1446 \# Resets left margin to value in effect prior to tabs.
1447 \# Resets line length to value in effect prior to tabs.
1448 \# Checks #QUAD to see if we were in flush or quad mode
1449 \# prior to tabs (0=off, 1=on).
1450 \# Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1451 \# in effect prior to tabs.
1453 \# TQ *must* come before setting any new tabs if you want the
1454 \# tabs' indents measured from page left. Otherwise, the tabs'
1455 \# indents are measured from the left margin of the tab you're
1462 . po \\n[#L_MARGIN]u
1463 . ll \\n[#L_LENGTH]u
1466 . ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1467 . el \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1470 . if '\\*[$RESTORE_QUAD_VALUE]'LEFT' \{ .LEFT \}
1471 . if '\\*[$RESTORE_QUAD_VALUE]'RIGHT' \{ .RIGHT \}
1472 . if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1476 \# ====================================================================
1484 \# <pre-defined NEWCOLOR or XCOLOR>
1486 \# Allows the inline escape for setting color to be called
1501 \# <color name> [<color scheme>] <color definition>
1503 \# Based on .defcolor, allows users to name and define colors using
1504 \# one of the four color schemes rgb, cmy, cmyk and grey. The new
1505 \# color is then defined as a string so that it can be called inline
1506 \# with \*[COLORNAME] or with .COLOR.
1508 \# With only two args, the default color scheme is rgb.
1510 \# It is highly recommended that users define new colors as
1511 \# all-cap strings, to differentiate them from x colors, which must
1512 \# be in lower case.
1515 . if \\n[#NUM_ARGS]=2 \{\
1516 . defcolor \\$1 rgb \\$2
1518 . if \\n[#NUM_ARGS]=3 \{\
1519 . if '\\$2'RGB' .ds $COLOR_SCHEME rgb
1520 . if '\\$2'CYM' .ds $COLOR_SCHEME cym
1521 . if '\\$2'CMYK' .ds $COLOR_SCHEME cmyk
1522 . if '\\$2'GRAY' .ds $COLOR_SCHEME gray
1523 . if '\\$2'GREY' .ds $COLOR_SCHEME gray
1524 . defcolor \\$1 \\*[$COLOR_SCHEME] \\$3
1533 \# <x color name> [<alias>]
1535 \# Defines a string of x color name (i.e. a predefined x
1536 \# color). If <alias> is given, creates a string of <alias name>
1537 \# that references the x color name of the first argument.
1539 \# The color name must be a legal color name from rgb.txt, and
1540 \# must be given entirely in lower case, all one word.
1544 . if \\n[#NUM_ARGS]=2 .ds \\$2 \m[\\$1]
1548 \# Pre-define xcolors black and white
1555 \# =====================================================================
1557 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1562 \# <none> | <anything>
1564 \# When on, underlines all letters, words, and digits in a passage,
1565 \# ignoring punctuation and spaces.
1567 \# Only for use when the font family is COURIER, to simulate
1568 \# typewriter-style underlining of italic passages.
1572 . nr #UNDERLINE_ON 1
1599 . char \[`A] _
\b\[`A]
1600 . char \[^A] _
\b\[^A]
1601 . char \['A] _
\b\['A]
1602 . char \[:A] _
\b\[:A]
1603 . char \[oA] _
\b\[oA]
1604 . char \[~A] _
\b\[~A]
1605 . char \[AE] _
\b\[AE]
1606 . char \[`E] _
\b\[`E]
1607 . char \[^E] _
\b\[^E]
1608 . char \['E] _
\b\['E]
1609 . char \[:E] _
\b\[:E]
1610 . char \[`I] _
\b\[`I]
1611 . char \[^I] _
\b\[^I]
1612 . char \['I] _
\b\['I]
1613 . char \[:I] _
\b\[:I]
1614 . char \[`O] _
\b\[`O]
1615 . char \[^O] _
\b\[^O]
1616 . char \['O] _
\b\['O]
1617 . char \[:O] _
\b\[:O]
1618 . char \[~O] _
\b\[~O]
1619 . char \[/O] _
\b\[/O]
1620 . char \[`U] _
\b\[`U]
1621 . char \[^U] _
\b\[^U]
1622 . char \['U] _
\b\['U]
1623 . char \[:U] _
\b\[:U]
1624 . char \[,C] _
\b\[,C]
1625 . char \[-D] _
\b\[-D]
1626 . char \[~N] _
\b\[~N]
1627 . char \[TP] _
\b\[TP]
1628 . char \['Y] _
\b\['Y]
1629 . char \[:Y] _
\b\[:Y]
1656 . char \[`a] _
\b\[`a]
1657 . char \[^a] _
\b\[^a]
1658 . char \['a] _
\b\['a]
1659 . char \[:a] _
\b\[:a]
1660 . char \[oa] _
\b\[oa]
1661 . char \[~a] _
\b\[~a]
1662 . char \[ae] _
\b\[ae]
1663 . char \[`e] _
\b\[`e]
1664 . char \[^e] _
\b\[^e]
1665 . char \['e] _
\b\['e]
1666 . char \[:e] _
\b\[:e]
1667 . char \[`i] _
\b\[`i]
1668 . char \[^i] _
\b\[^i]
1669 . char \['i] _
\b\['i]
1670 . char \[:i] _
\b\[:i]
1671 . char \[`o] _
\b\[`o]
1672 . char \[^o] _
\b\[^o]
1673 . char \['o] _
\b\['o]
1674 . char \[:o] _
\b\[:o]
1675 . char \[~o] _
\b\[~o]
1676 . char \[/o] _
\b\[/o]
1677 . char \[`u] _
\b\[`u]
1678 . char \[^u] _
\b\[^u]
1679 . char \['u] _
\b\['u]
1680 . char \[:u] _
\b\[:u]
1681 . char \[,c] _
\b\[,c]
1682 . char \[Sd] _
\b\[Sd]
1683 . char \[~n] _
\b\[~n]
1684 . char \[Tp] _
\b\[Tp]
1685 . char \['y] _
\b\['y]
1686 . char \[:y] _
\b\[:y]
1687 . char \[ss] _
\b\[ss]
1701 . nr #UNDERLINE_ON 0
1702 . rchar A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
1703 a b c d e f g h i j k l m n o p q r s t u v w x y z \
1704 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1705 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1706 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1707 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1708 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1709 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1710 ' 1 2 3 4 5 6 7 8 9 0
1720 \# Underscores all letters, words, and digits in a passage,
1721 \# ignoring punctuation and spaces.
1723 \# Intended to be called with inline escapes \*[UL] (underline
1724 \# on) and \*[ULX] (underline off). Only works when the font family
1725 \# is COURIER, to simulate typewriter-style underlining of italic
1729 \c\R'#UNDERLINE_ON 1'
1756 . char \[`A] _
\b\[`A]
1757 . char \[^A] _
\b\[^A]
1758 . char \['A] _
\b\['A]
1759 . char \[:A] _
\b\[:A]
1760 . char \[oA] _
\b\[oA]
1761 . char \[~A] _
\b\[~A]
1762 . char \[AE] _
\b\[AE]
1763 . char \[`E] _
\b\[`E]
1764 . char \[^E] _
\b\[^E]
1765 . char \['E] _
\b\['E]
1766 . char \[:E] _
\b\[:E]
1767 . char \[`I] _
\b\[`I]
1768 . char \[^I] _
\b\[^I]
1769 . char \['I] _
\b\['I]
1770 . char \[:I] _
\b\[:I]
1771 . char \[`O] _
\b\[`O]
1772 . char \[^O] _
\b\[^O]
1773 . char \['O] _
\b\['O]
1774 . char \[:O] _
\b\[:O]
1775 . char \[~O] _
\b\[~O]
1776 . char \[/O] _
\b\[/O]
1777 . char \[`U] _
\b\[`U]
1778 . char \[^U] _
\b\[^U]
1779 . char \['U] _
\b\['U]
1780 . char \[:U] _
\b\[:U]
1781 . char \[,C] _
\b\[,C]
1782 . char \[-D] _
\b\[-D]
1783 . char \[~N] _
\b\[~N]
1784 . char \[TP] _
\b\[TP]
1785 . char \['Y] _
\b\['Y]
1786 . char \[:Y] _
\b\[:Y]
1813 . char \[`a] _
\b\[`a]
1814 . char \[^a] _
\b\[^a]
1815 . char \['a] _
\b\['a]
1816 . char \[:a] _
\b\[:a]
1817 . char \[oa] _
\b\[oa]
1818 . char \[~a] _
\b\[~a]
1819 . char \[ae] _
\b\[ae]
1820 . char \[`e] _
\b\[`e]
1821 . char \[^e] _
\b\[^e]
1822 . char \['e] _
\b\['e]
1823 . char \[:e] _
\b\[:e]
1824 . char \[`i] _
\b\[`i]
1825 . char \[^i] _
\b\[^i]
1826 . char \['i] _
\b\['i]
1827 . char \[:i] _
\b\[:i]
1828 . char \[`o] _
\b\[`o]
1829 . char \[^o] _
\b\[^o]
1830 . char \['o] _
\b\['o]
1831 . char \[:o] _
\b\[:o]
1832 . char \[~o] _
\b\[~o]
1833 . char \[/o] _
\b\[/o]
1834 . char \[`u] _
\b\[`u]
1835 . char \[^u] _
\b\[^u]
1836 . char \['u] _
\b\['u]
1837 . char \[:u] _
\b\[:u]
1838 . char \[,c] _
\b\[,c]
1839 . char \[Sd] _
\b\[Sd]
1840 . char \[~n] _
\b\[~n]
1841 . char \[Tp] _
\b\[Tp]
1842 . char \['y] _
\b\['y]
1843 . char \[:y] _
\b\[:y]
1844 . char \[ss] _
\b\[ss]
1860 \c\R'#UNDERLINE_ON 0'
1861 . rchar A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
1862 a b c d e f g h i j k l m n o p q r s t u v w x y z \
1863 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1864 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1865 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1866 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1867 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1868 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1869 ' 1 2 3 4 5 6 7 8 9 0
1876 \# [points below baseline] "text"
1878 \# Places an underscore 2 points under the string if no lead given,
1879 \# otherwise places underscore under string by user specified amount.
1881 \# When using this macro, the string to be underscored must begin
1882 \# with double-quotes ("), regardless of whether it's the sole
1883 \# argument or the second.
1885 \# .UNDERSCORE "Text to be underscored
1887 \# .UNDERSCORE 2p "Text to be underscored
1889 \# All text is underscored (including punctuation and spaces).
1890 \# This is the primary difference between UNDERLINE and UNDERSCORE,
1891 \# aside from the fact the UNDERLINE only works with Courier.
1893 \# UNDERSCORE does not work across line breaks. Each line of
1894 \# text must be entered separately with UNDERSCORE. If the
1895 \# UNDERSCORE begins in the middle of a line and crosses over a
1896 \# break, the portion before the break must be entered in its own
1897 \# UNDERSCORE, as must the portion that comes after the break.
1900 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1901 . ie \\n[#NUM_ARGS]=1 \{ \\$1\\s(12\\v'+2p'\\l'|0'\\v'-2p'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1902 . el \{ \\$2\\s(12\\v'+(\\$1)'\\l'|0'\\v'-(\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1903 . rr #RESTORE_PT_SIZE
1907 \# DOUBLE UNDERSCORE
1908 \# -----------------
1910 \# [points below baseline] [points distance between rules] "text"
1912 \# Same as UNDERSCORE, except it produces a double underscore. The default
1913 \# distance between the rules is 2 points.
1915 \# The same double-quote requirement as UNDERSCORE.
1917 .MAC UNDERSCORE2 END
1918 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1919 . if \\n[#NUM_ARGS]=1 \{\
1920 . PRINT \\$1\\s(12\\v'+2p'\\l'|0'\\v'+2p'\\l'|0'\\v'-4p'\\s[\\n[#RESTORE_PT_SIZE]u]
1922 . if \\n[#NUM_ARGS]=2 \{\
1923 . PRINT \\$2\\s(12\\v'+\\$1'\\l'|0'\\v'+2p'\\l'|0'\\v'-(2p+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1925 . if \\n[#NUM_ARGS]=3 \{\
1926 . PRINT \\$3\\s(12\\v'+\\$1'\\l'|0'\\v'+\\$2'\\l'|0'\\v'-(\\$2+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1928 . rr #RESTORE_PT_SIZE
1932 \# SUPERSCRIPT INLINES
1933 \# -------------------
1935 \# Prints everything after invocation as superscript.
1937 \# \*[SUP] and \*[SUPX] turn superscript on and off respectively.
1938 \# If running type is pseudo-condensed/expanded, invoke the superscript
1939 \# strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
1940 \# and \*[EXTSUPX] respectively.
1943 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1944 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1945 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]
1947 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'
1950 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1951 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1952 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
1954 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
1957 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1958 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1959 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
1961 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
1970 \# <number of degrees> | RESET
1972 \# Modifies register #DEGREES for use with \*[SLANT], or resets
1973 \# it to the default. Defines string \*[SLANTX]
1975 \# \*[SLANT] permits pseudo-italicizing of a font in cases where
1976 \# no italic font exists in a particular family.
1978 \# Default # of degrees is 15.
1980 \# Do not use unit of measure with arg to SETSLANT.
1982 \# It may be necessary to adjust the spacing on either side of
1983 \# [SLANT] and [SLANTX].
1985 \# In docs, SLANT carries over from para to para.
1988 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1989 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1992 . ie '\\$1'RESET' \{\
1994 . if \\n[#PRINT_STYLE]=1 \{\
1995 . if \\n[#UNDERLINE_SLANT] \{ .return \}
1997 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2001 . if \\n[#PRINT_STYLE]=1 \{\
2002 . if \\n[#UNDERLINE_SLANT] \{ .return \}
2004 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
2006 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
2016 \# <amount of emboldening> | RESET
2018 \# Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
2019 \# it to the default 700 units.
2021 \# \*[BOLDER] allows pseudo-emboldening of a font where no bold
2022 \# font exists in a particular family.
2024 \# Default for SETBOLDER is 700 units. Do not use unit of measure
2025 \# with arg to SETBOLDER.
2027 .nr #BOLDER_UNITS 700
2030 . if \\n[#IGNORE]=1 \{ .return \}
2031 . ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
2032 . el \{ .nr #BOLDER_UNITS \\$1 \}
2038 .bd \\n(.f \\n[#BOLDER_UNITS]
2047 \# +++CONDENSE/EXTEND+++
2052 \# <percentage to condense/expand type size>
2054 \# Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
2055 \# new point size (for character width) from arg, and defines string
2056 \# COND or EXT, which set the type size to the new character width,
2057 \# and sets the height of type to the value stored in CURRENT_PT_SIZE
2059 \# CONDENSE_OR_EXTEND is invoked from the aliases
2060 \# CONDENSE and EXTEND. CONDENSE implies <100, EXTEND
2061 \# implies >100. Do not use a percent sign in the argument.
2063 \# There is no default setting for CONDENSE or EXTEND.
2064 \# 80 is a good approximation of condensed type, 120 is okay
2067 \# The value set by CONDENSE or EXTEND applies to all
2068 \# subsequent \*[COND] or \*[EXT] escapes until a new value is set.
2070 \# \*[COND] or \*[EXT] must be turned off before all changes of point
2071 \# size and reinvoked afterwards (if so desired). This refers to
2072 \# changes of point size via control lines AND with via inlines.
2074 .MAC CONDENSE_OR_EXTEND END
2075 . if '\\$0'CONDENSE' \{\
2076 . ds $COND_PERCENT \\$1
2077 . if \\n[#PRINT_STYLE]=1 \{\
2079 . ds $COND_PERCENT 100
2082 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2084 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2085 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2087 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2088 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2090 . if '\\$0'EXTEND' \{\
2091 . ds $EXT_PERCENT \\$1
2092 . if \\n[#PRINT_STYLE]=1 \{\
2094 . ds $EXT_PERCENT 100
2097 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2099 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2100 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2102 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2103 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2107 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2108 .ds EXTX \ER'#EXTEND 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2111 \# +++PAD LINES+++ (insert space)
2116 \# <character to use for marking pad points>
2118 \# Defines string $PAD_MARKER, used in PAD
2120 \# $PAD_MARKER is normally # (the pound sign).
2123 . ds $PAD_MARKER \\$1
2130 \# "<string of text with padding markers inserted>"
2132 \# Defines and redefines padding character (default=pound sign
2133 \# unless padding character has been set with PAD_MARKER)
2134 \# several times so that when the string is output at the end
2135 \# of the macro, every # has been converted to an equal-sized
2136 \# amount of padding (blank space) on a line. # is equivalent to
2137 \# CompuGraphic's old <IS>.
2139 \# String tabs may be marked off during PAD.
2142 . if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2144 . if !d$PAD_MARKER \{ .ds $PAD_MARKER # \}
2145 . char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2146 . ds $FAMILY_FOR_PAD \\n[.fam]
2147 . nr #FONT_FOR_PAD \\n(.f
2148 . nr #SIZE_FOR_PAD \\n[.ps]
2149 . ds $PAD_STRING \\$1
2150 . as $PAD_STRING \Ekp
2152 . fam \\*[$FAMILY_FOR_PAD]
2153 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2156 . char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2158 . fam \\*[$FAMILY_FOR_PAD]
2159 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2162 . char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2163 . ie \\n[#SILENT] \{\
2165 . fam \\*[$FAMILY_FOR_PAD]
2166 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2171 . fam \\*[$FAMILY_FOR_PAD]
2172 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2175 . if \\n[#FILL_MODE]=1 \{\
2190 \# The leader mechanism is primitive, but it works. Basically,
2191 \# every macro in this set that includes a line length also sets
2192 \# a single groff tab stop at the right hand end of the line.
2193 \# That way, whenever Ctrl-A is invoked (always at the end of
2194 \# an input line), leader of the correct length gets deposited.
2195 \# Ctrl-A is accessed by the string LEADER (i.e. inline, as
2196 \# \*[LEADER]). Leaders within tabs get their length from the
2199 \# SET LEADER CHARACTER
2200 \# --------------------
2202 \# <character to use whenever \*[LEADER] is invoked>
2204 \# Set leader character.
2206 .MAC LEADER_CHARACTER END
2217 \# <family of drop cap>
2219 \# Creates or modifies string $DC_FAM.
2221 .MAC DROPCAP_FAMILY END
2229 \# <font of drop cap>
2231 \# Creates or modifies string $DC_FT.
2233 .MAC DROPCAP_FONT END
2241 \# <pre-defined XCOLOR or NEWCOLOR>
2243 \# Defines string $DC_COLOR to argument.
2245 \# User must define an XCOLOR or NEWCOLOR before using
2248 .MAC DROPCAP_COLOR END
2249 . if \\n[#PRINT_STYLE]=1 \{ .return \}
2258 \# <width of gutter between drop cap and indented text>
2260 \# Creates or modifies register #DC_GUT.
2262 \# Requires unit of measure. Default is 3p.
2264 .MAC DROPCAP_GUTTER END
2272 \# <+|- # of points to in/decrease point size of drop cap letter>
2274 \# Creates or modifies string $DC_ADJUST.
2276 \# Despite its best efforts, DROPCAP doesn't always get the point
2277 \# size of the drop cap critically perfect. DROPCAP_ADJUST lets
2278 \# the user add or subtract points (or fractions of points) to
2279 \# get the size right.
2281 \# Requires the + or - sign.
2283 .MAC DROPCAP_ADJUST END
2284 . ds $DC_ADJUST \\$1
2291 \# <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2293 \# Calculates point size of dropcap based on # of lines passed as
2294 \# arg 2. Sets indent for text based on dropcap width+gutter.
2295 \# Advances and prints dropcap; reverses and prints indented text
2296 \# to bottom of dropcap, then resets indent to left margin (plus
2297 \# any indent that was in effect prior to invoking DROPCAP).
2299 \# Drop caps put a strain on on resource-challenged systems.
2301 \# Drop caps when using the doc processing macro PP only work with
2302 \# initial paragraphs (i.e. at doc start, or after heads), only when
2303 \# DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2304 \# is TYPESET. If these conditions aren't met, DROPCAPS is silently
2307 \# The COND or EXT argument are processed separately from all
2308 \# other COND or EXT inlines or macros, hence passing COND or
2309 \# EXT has no effect on running type.
2312 . if #IGNORE \{ .return \}
2315 . if \\n[#PRINT_STYLE]=1 \{ .return \}
2316 . if \\n[#PRINT_STYLE]=2 \{\
2317 . if \\n[#PP_STYLE]=2 \{ .return \}
2318 . if \\n[#PP]>1 \{ .return \}
2323 . nr #DC_LINES \\$2-1
2324 . ds $RESTORE_COND \\*[$COND_PERCENT]
2325 . if '\\$3'COND' \{ .CONDENSE \\$4 \}
2326 . if '\\$3'EXT' \{ .EXTEND \\$4 \}
2327 . if !r#DC_GUT \{ .nr #DC_GUT (3p) \}
2328 . ds $RESTORE_FAM \\n[.fam]
2329 . nr #RESTORE_FT \\n(.f
2330 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2331 . nr #RESTORE_INDENT \\n(.i
2333 . nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2334 . ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2335 . el \{ .FAM \\*[$DC_FAM] \}
2336 . ie !d$DC_FT \{ .FT \\n(.f \}
2337 . el \{ .FT \\*[$DC_FT] \}
2338 . while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2339 . ps \\n[#PT_SIZE]u+100u
2341 . nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2343 . if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2345 . sp \\n[#DC_LINES]v
2346 . ie \\n[#DC_COLOR]=1 \{\
2348 . ie '\\$3'COND' \{ .PRINT \m[\\*[$DC_COLOR]]\\*[COND]\\*[$DROPCAP]\\*[CONDX]\m[] \}
2349 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[EXT]\\*[$DROPCAP]\\*[EXTX]\m[] \}
2351 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2355 . ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2356 . el \{ .PRINT \\*[EXT]\\*[$DROPCAP]\\*[EXTX] \}
2358 . el \{ .PRINT \m[\\*[$DC_COLOR]]\\*[$DROPCAP]\m[] \}
2360 . if '\\$3'COND' \{ \E*[COND] \}
2361 . if '\\$3'EXT' \{ \E*[EXT] \}
2362 . ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2363 . el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2364 . if '\\$3'COND' \{ \E*[CONDX]\c \}
2365 . if '\\$3'EXT' \{ \E*[EXTX]\c \}
2367 . FAM \\*[$RESTORE_FAM]
2368 . FT \\n[#RESTORE_FT]
2369 . ps \\n[#RESTORE_PT_SIZE]u
2370 . CONDENSE \\*[$RESTORE_COND]
2371 . EXTEND \\*[$RESTORE_EXT]
2372 . ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2373 . el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2380 . rr #RESTORE_PT_SIZE
2381 . rr #RESTORE_INDENT
2387 .MAC DROPCAP_OFF END
2388 ' in \\n[#RESTORE_INDENT]u
2397 \# Draws a rule the length of the current measure.
2404 . ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2407 . ie \\n[#INDENT_ACTIVE] \{\
2408 . nr #RESTORE_L_LENGTH \\n(.l
2409 . if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2410 . if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2411 . PRINT \El'\En(.lu'
2412 . ll \\n[#RESTORE_L_LENGTH]u
2413 . rr #RESTORE_L_LENGTH
2416 . PRINT \El'\En(.lu'
2418 . QUAD \\*[$CURRENT_QUAD]
2423 \# =====================================================================
2425 \# +++WORD AND SENTENCE SPACING+++
2427 \# WORD SPACE CONTROL
2428 \# ------------------
2430 \# <+|->wordspace | DEFAULT
2432 \# Increases or decreases interword space by user supplied amount.
2433 \# If DEFAULT, value is set to 12 (groff default).
2435 \# $WS_CONSTANT is the groff default word space.
2436 \# $WS_VAR is the user supplied amount by which to in/decrease word space.
2437 \# $WS is a concatenation of WS_CONSTANT and WS_VAR.
2439 \# Because the user supplied value requires a literal + or - sign,
2440 \# the macro argument is stored in a string.
2442 \# \n[.sss] holds the current sentence space value.
2445 . ds $WS_CONSTANT 12
2447 . ie '\\$1'DEFAULT' \{ .ds $WS_VAR +0 \}
2448 . el \{ .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR]) \}
2449 . ie \\n[.sss]=12 \{ .ss \\*[$WS] 12 \}
2451 . ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
2457 \# SENTENCE SPACE CONTROL
2458 \# ----------------------
2460 \# <+-sentencespace> | 0 | DEFAULT
2462 \# Increases or decreases sentence space by user supplied amount.
2463 \# If 0, sentence spaces are ignored. If DEFAULT, value is
2464 \# set to 12 (groff default).
2466 \# Because the user supplied value requires a literal + or - sign,
2467 \# the macro argument is stored in a string.
2469 \# Sentence space applies only to input where sentences are separated
2470 \# by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
2471 \# Changing .SS when sentences are separated by only one space has
2472 \# no effect on the space between sentences.
2474 \# \n[.ss] holds the current wordspace value.
2475 \# \n[.sss] holds the current sentence space value.
2478 . ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
2480 . ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
2483 . ss \\n[.ss] (0\\*[$SS_VAR])
2489 \# =====================================================================
2493 \# There are five styles of indents: left, right, both, temporary,
2494 \# and hanging. Each is set/invoked with a different macro.
2495 \# Indent macros begin with the letter "I", hence .IL means "indent left,"
2496 \# .IR means "indent right," and so on.
2498 \# The first time any of the indent macros is used, it requires an
2499 \# argument--the size of the indent (with a unit of measure). The
2500 \# size may also be entered using the \w escape--very useful
2501 \# for numbered lists using HI. The unit of measure is required.
2502 \# Subsequent invocations don't require the argument; the indent
2503 \# measure remains the same until it's changed by invoking the macro
2504 \# with an argument again.
2506 \# If no indents are in effect, the arguments passed to indent macros are
2507 \# measured from the left and right margins of the page. If a left indent
2508 \# or a right indent is already in effect, the arguments passed to
2509 \# the indent macros are calculated from the current values; in other words,
2510 \# the arguments are additive. If you quit an indent and later return
2511 \# to it, its value will be the value last in effect, unless you pass
2512 \# it an argument. If you do pass an argument, it is added to the last
2513 \# value in effect, unless you cleared the indent with one of
2514 \# .I<LRB>X/Q macros.
2528 \# The first .IL 2P indents text 2P from the left margin. The second
2529 \# .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
2530 \# .IQ turns the indent off. The last .IL (which has no argument)
2531 \# takes its value from the total of all arguments passed to .IL (in
2532 \# this case, 2P and 2P), therefore it indents 2P+2P from the left
2533 \# margin, i.e. 4P. If you wanted the last .IL to indent just 2P,
2534 \# you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
2535 \# the last .IL the argument 2P.
2537 \# To reverse the sense of an indent added to an indent, you may use
2540 \# Indents can be turned off individually with ILX, IRX, and IBX.
2541 \# LEFT and RIGHT indents may be combined and manipulated
2542 \# separately, (e.g. you can have an IL of 2P and an IR of 4P
2543 \# operative at the same time, and then change, say, the IL to
2544 \# 4P--thereby left indenting 6P--while the IR remains at 4P.
2546 \# IB automatically turns off IL and IR. They have to be reinvoked
2547 \# again when needed. IL and IR automatically turn IB off; it, too,
2548 \# has to be reinvoked with needed.
2550 \# All indents can be turned off at once with IQ. The ILX, IRX, IBX,
2551 \# and IQ macros simply turn the indents off; the values stored in
2552 \# the respective indent macros (IL, IR, IB) remain in effect. If
2553 \# the user wishes to clear the values, the I<LRB>X macros should be
2554 \# invoked with the single argument CLEAR. IQ CLEAR clears out
2555 \# the values stored for all indent styles.
2557 \# Indents *must* be turned off before settting string tabs
2558 \# inside PAD. Generally, in order not to get confused, it's a
2559 \# good idea to turn all indents off before setting any tabs.
2561 \# TI and HI are special cases. There's no need to turn them off,
2562 \# since they affect only one line--the first after their
2563 \# invocation. Like the other indent styles, the first time
2564 \# they're invoked, they require a value in iPpcm; each subsequent
2565 \# invocation without an argument will use the same value. To
2566 \# change the value, simply pass a new value. Values for TI and HI
2567 \# are *not* additive.
2569 \# HI presupposes that you already have a left or both indent on.
2570 \# HI will never hang a line outside the left margin of a document
2571 \# or column. In other words, you must have IL or IB on before you
2578 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2579 . nr #INDENT_STYLE_LEFT 1
2580 . nr #INDENT_ACTIVE 1
2581 . nr #INDENT_LEFT_ACTIVE 1
2584 . in \\n[#L_INDENT]u
2585 . ta \\n(.lu-\\n[#L_INDENT]u
2589 . nr #L_INDENT +(\\$1)
2590 . in \\n[#L_INDENT]u
2591 . ta \\n(.lu-\\n[#L_INDENT]u
2596 \# +++INDENT RIGHT+++
2599 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2600 . nr #INDENT_STYLE_RIGHT 1
2601 . nr #INDENT_ACTIVE 1
2602 . nr #INDENT_RIGHT_ACTIVE 1
2605 . ie \\n[#TAB_ACTIVE] \{\
2606 . ll \\n(.lu-\\n[#R_INDENT]u
2607 . ta \\n(.lu-\\n[#L_INDENT]u
2610 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2611 . ta \\n(.lu-\\n[#L_INDENT]u
2616 . nr #R_INDENT +(\\$1)
2617 . ie \\n[#TAB_ACTIVE] \{\
2618 . ll \\n(.lu-\\n[#R_INDENT]u
2619 . ta \\n(.lu-\\n[#L_INDENT]u
2622 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2623 . ta \\n(.lu-\\n[#L_INDENT]u
2629 \# +++INDENT BOTH+++
2632 . if \\n[#INDENT_STYLE_LEFT] \{ .ILX \}
2633 . if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
2634 . nr #INDENT_STYLE_BOTH 1
2635 . nr #INDENT_ACTIVE 1
2636 . nr #INDENT_BOTH_ACTIVE 1
2639 . in \\n[#BL_INDENT]u
2640 . ie \\n[#TAB_ACTIVE] \{\
2641 . ll \\n(.lu-\\n[#BR_INDENT]u
2642 . ta \\n(.lu-\\n[#BR_INDENT]u
2645 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2646 . ta \\n(.lu-\\n[#BR_INDENT]u
2651 . nr #BL_INDENT (\\n[#INDENT]+\\$1)
2652 . ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
2653 . el \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
2654 . ie \\n[#TAB_ACTIVE] \{\
2655 . in \\n[#BL_INDENT]u
2656 . ll \\n(.lu-\\n[#BR_INDENT]u
2657 . ta \\n(.lu-\\n[#BL_INDENT]u
2660 . in \\n[#BL_INDENT]u
2661 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2662 . ta \\n(.lu-\\n[#BR_INDENT]u
2668 \# +++TEMPORARY INDENT+++
2673 . ti \\n[#T_INDENT]u
2674 . if \\n[#INDENT_LEFT_ACTIVE] \{\
2675 . ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
2677 . if \\n[#INDENT_BOTH_ACTIVE] \{\
2678 . ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
2682 . nr #T_INDENT (\\$1)
2683 . ti \\n[#T_INDENT]u
2688 \# +++HANGING INDENT+++
2691 . ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
2693 . nr #HL_INDENT (\\$1)
2694 . ti -\\n[#HL_INDENT]u
2699 \# +++INDENTS OFF+++
2704 . rr #INDENT_LEFT_ACTIVE
2705 . if '\\$1'CLEAR' \{\
2707 . rr #INDENT_STYLE_LEFT
2714 . rr #INDENT_RIGHT_ACTIVE
2715 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2717 . ie \\n[#COLUMNS] \{\
2718 . ll \\n[#COL_L_LENGTH]u
2722 . ll \\n[#L_LENGTH]u
2726 . if '\\$1'CLEAR' \{\
2728 . rr #INDENT_STYLE_RIGHT
2736 . rr #INDENT_BOTH_ACTIVE
2737 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2739 . ie \\n[#COLUMNS] \{\
2740 . ll \\n[#COL_L_LENGTH]u
2744 . ll \\n[#L_LENGTH]u
2748 . if '\\$1'CLEAR' \{\
2751 . rr #INDENT_STYLE_BOTH
2758 . if !\\n[#IX_WARN] \{\
2759 . tm1 "[mom]: Use of .IX is now deprecated. Use .IQ instead.
2760 . tm1 " .IX will continue to behave as before, but to
2761 . tm1 " avoid this message, please update your document.
2767 . rr #INDENT_LEFT_ACTIVE
2768 . rr #INDENT_RIGHT_ACTIVE
2769 . rr #INDENT_BOTH_ACTIVE
2770 . if \\n[#INDENT_STYLE_RIGHT] \{\
2771 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2773 . ie \\n[#COLUMNS] \{\
2774 . ll \\n[#COL_L_LENGTH]u
2778 . ll \\n[#L_LENGTH]u
2783 . if \\n[#INDENT_STYLE_BOTH] \{\
2784 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2786 . ie \\n[#COLUMNS] \{\
2787 . ll \\n[#COL_L_LENGTH]u
2791 . ll \\n[#L_LENGTH]u
2796 . if '\\$1'CLEAR' \{\
2797 . if \\n[#INDENT_STYLE_RIGHT] \{\
2798 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2800 . ie \\n[#COLUMNS] \{\
2801 . ll \\n[#COL_L_LENGTH]u
2805 . ll \\n[#L_LENGTH]u
2810 . if \\n[#INDENT_STYLE_BOTH] \{\
2811 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2813 . ie \\n[#COLUMNS] \{\
2814 . ll \\n[#COL_L_LENGTH]u
2818 . ll \\n[#L_LENGTH]u
2829 . rr #INDENT_STYLE_LEFT
2830 . rr #INDENT_STYLE_RIGHT
2831 . rr #INDENT_STYLE_BOTH
2836 \# =====================================================================
2838 \# +++MULTIPLE COLUMNS+++
2840 \# MULTIPLE COLUMNS ON
2841 \# -------------------
2845 \# Marks the top of a column set
2851 \# MULTIPLE COLUMN RETURN
2852 \# ----------------------
2856 \# Returns to the top of a column set
2862 \# MULTIPLE COLUMNS OFF
2863 \# --------------------
2865 \# <none> | <lead to advance beneath bottom of deepest column>
2867 \# Advances to the end of a column set
2869 \# With no argument, advances to the next baseline (at the current
2870 \# leading value) beneath the longest column. With an argument
2871 \# (which requires a unit of measure), advances arg distance
2872 \# beneath the baseline of the deepest column. If the argument
2873 \# is zero, advances to the baseline of the deepest column.
2881 . nr #MCX_ALD (\\$1)
2883 . ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
2884 . el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
2885 . rr #MCX_ALD (\\$1)
2889 \# =====================================================================
2891 \# +++TYPESETTING SUPPORT MACROS+++
2898 \# Enables/disables traps.
2900 \# EL and TN don't function as advertised on the last line before
2901 \# a trap (when they break the preceding line, they spring the
2902 \# trap, and groff won't back up to the line preceding the trap).
2903 \# TRAP is a kludge to get EL and TN work properly on last lines.
2904 \# The user simply enloses the offending lines in TRAP OFF/TRAP.
2907 . ie '\\$1'' \{ .vpt 1 \}
2915 \# <none> | <anything>
2917 \# Diverts text so that it doesn't print, or turns the function off.
2919 \# Useful for setting up autotabs where you don't want the line with
2920 \# the tab marks to print.
2922 \# Also aliased as COMMENT, in case user wants to input a batch of
2923 \# text that doesn't print.
2927 . if \\n[#QUAD] \{ .br \}
2928 . ie '\\$1'' \{ .di NO_FLASH \}
2943 \# Prints anything. A macro that helps keep my code nicely indented.
2953 \# <none> | <anything>
2955 \# Converts text to caps, or, if OFF, reverts to normal caps/lc.
2959 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
2994 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
3035 \# Gets cap-height, x-height, and descender depth of the
3036 \# current font at the current point size.
3038 \# The routine is diverted so it remains invisible to output.
3042 E\\R'#CAP_HEIGHT \\n[.cht]'
3043 e\\R'#X_HEIGHT \\n[.cht]'
3044 y\\R'#DESCENDER \\n[.cdp]'
3049 \# =====================================================================
3051 \# +++TYPESETTING ALIASES+++
3053 .ALIAS CENTRE CENTER
3055 .ALIAS COMMENT SILENT
3056 .ALIAS CONDENSE CONDENSE_OR_EXTEND
3057 .ALIAS EXTEND CONDENSE_OR_EXTEND
3060 .ALIAS HYPHENATION HY
3066 .ALIAS LIG LIGATURES
3067 .ALIAS NEWCOLOUR NEWCOLOR
3068 .ALIAS PADMARKER PAD_MARKER
3069 .ALIAS TABSET TAB_SET
3071 .ALIAS UNDERSCORE_2 UNDERSCORE2
3072 .ALIAS XCOLOUR XCOLOUR
3075 \# ====================================================================
3077 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
3078 \# ===============================================
3080 \# +++PAGE DIMENSIONS+++
3085 \# LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
3087 \# Sets up margins for different paper sizes.
3091 . if '\\*[$PAPER]'LETTER' \{\
3095 . if '\\*[$PAPER]'LEGAL' \{\
3099 . if '\\*[$PAPER]'STATEMENT' \{\
3103 . if '\\*[$PAPER]'TABLOID' \{\
3107 . if '\\*[$PAPER]'LEDGER' \{\
3111 . if '\\*[$PAPER]'FOLIO' \{\
3115 . if '\\*[$PAPER]'QUARTO' \{\
3119 . if '\\*[$PAPER]'10x14' \{\
3123 . if '\\*[$PAPER]'EXECUTIVE' \{\
3127 . if '\\*[$PAPER]'A3' \{\
3131 . if '\\*[$PAPER]'A4' \{\
3135 . if '\\*[$PAPER]'A5' \{\
3139 . if '\\*[$PAPER]'B4' \{\
3143 . if '\\*[$PAPER]'B5' \{\
3147 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
3148 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
3152 \# ====================================================================
3154 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
3159 \# TYPESET | TYPEWRITE [SINGLESPACE]
3161 \# Sets type specs for typewriter-style or typeset output.
3163 \# Number registers: TYPEWRITE=1, TYPESET=2.
3166 . if !d$PAPER \{ .PAPER LETTER \}
3167 . if '\\$1'TYPEWRITE' \{\
3169 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3170 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3175 . ie '\\$2'SINGLESPACE' \{\
3176 . nr #SINGLE_SPACE 1
3183 . if !\\n[#PP_INDENT] \{\
3184 . in 3P \"Set indent
3185 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
3186 . in 0 \"Remove indent
3189 . nr #BOLDER_UNITS 0
3199 . nr #IGNORE_COLUMNS 1
3202 . if '\\$1'TYPESET' \{\
3204 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3205 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3208 . if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
3209 . if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
3217 . if !\\n[#PP_INDENT] \{\
3218 . in 2m \"Set indent
3219 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
3220 . in 0 \"Remove indent
3223 . rr #IGNORE_COLUMNS
3228 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
3230 \# ITALIC MEANS ITALIC
3231 \# -------------------
3235 \# Instructs TYPEWRITE to treat italics as italics, whether
3236 \# invoked via control lines or inline.
3238 \# ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
3239 \# hence invoking the one automatically turns off the other.
3241 .MAC ITALIC_MEANS_ITALIC END
3242 . if \\n[#PRINT_STYLE]=1 \{\
3243 . nr #ITALIC_MEANS_ITALIC 1
3244 . rr #UNDERLINE_ITALIC
3260 \# Instructs TYPEWRITE to underline italics, whether invoked
3261 \# via control lines or inline.
3263 \# UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
3264 \# hence invoking the one automatically turns off the other.
3266 \# UNDERLINE_ITALIC is the default for TYPEWRITE.
3268 .MAC UNDERLINE_ITALIC END
3269 . if \\n[#PRINT_STYLE]=1 \{\
3270 . nr #UNDERLINE_ITALIC 1
3271 . rr #ITALIC_MEANS_ITALIC
3285 \# <none> | <anything>
3287 \# Instructs TYPEWRITE to underline occurences of \*[SLANT], or
3288 \# turns feature off.
3290 \# Users may want \*[SLANT] to mean slant in TYPEWRITE, although
3291 \# most of the time, \*[SLANT] most likely means the user wanted
3292 \# italic but didn't have it, ergo the need to tell TYPEWRITE to
3293 \# treat \*[SLANT] as italic (i.e. underlined).
3295 \# UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
3296 \# hence invoking the one automatically turns off the other.
3298 \# UNDERLINE_SLANT is the default for TYPEWRITE.
3300 .MAC UNDERLINE_SLANT END
3301 . if \\n[#PRINT_STYLE]=1 \{\
3302 . rr #SLANT_MEANS_SLANT
3303 . nr #UNDERLINE_SLANT 1
3306 . ds SLANT \ER'#SLANT_ON 1'\E*[UL]
3307 . ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
3312 .MAC SLANT_MEANS_SLANT END
3313 . if \\n[#PRINT_STYLE]=1 \{\
3314 . rr #UNDERLINE_SLANT
3315 . nr #SLANT_MEANS_SLANT 1
3318 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
3319 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
3324 .MAC IGNORE_COLUMNS END
3325 . if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
3329 \# ====================================================================
3331 \# +++COPY STYLE -- DRAFT OR FINAL+++
3338 \# Sets registers that are used to determine what to put
3339 \# in the default header, and how to number pages.
3341 \# DOCTYPE must come before COPYSTYLE.
3344 . ds $COPY_STYLE \\$1
3345 . if '\\*[$COPY_STYLE]'DRAFT' \{\
3347 . if !d$DRAFT \{ .DRAFT 1 \}
3349 . if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2 \}
3350 . if !d$CHAPTER_STRING \{ .CHAPTER_STRING "Chapter" \}
3351 . if !d$DRAFT_STRING \{ .DRAFT_STRING "Draft" \}
3352 . if !d$REVISION_STRING \{ .REVISION_STRING "Rev." \}
3354 . if \\n[#DOC_TYPE]=1 \{\
3355 . ie \\n[#COPY_STYLE]=1 \{\
3356 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3357 . el \{ .PAGENUM_STYLE roman \}
3358 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3359 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3363 . ie '\\*[$REVISION]'' \{\
3364 . ds $HDRFTR_CENTER \
3365 \\*[$DRAFT_STRING]\\*[$DRAFT]
3368 . ds $HDRFTR_CENTER \
3369 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3370 \\*[$REVISION_STRING] \\*[$REVISION]
3376 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3377 . el \{ .PAGENUM_STYLE DIGIT \}
3378 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3380 . rr #USER_DEF_HDRFTR_CENTER
3385 . if \\n[#DOC_TYPE]=2 \{\
3387 . ie \\n[#COPY_STYLE]=1 \{\
3388 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3389 . el \{ .PAGENUM_STYLE roman \}
3390 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3391 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3392 . ie '\\*[$CHAPTER]'' \{\
3393 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3394 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3396 . el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \}
3399 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3400 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3402 . el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3406 . ie '\\*[$REVISION]'' \{\
3407 . ie '\\*[$CHAPTER]'' \{\
3408 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3409 . ie '\\*[$DRAFT]'' \{\
3410 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3413 . ds $HDRFTR_CENTER \
3414 \\*[$CHAPTER_TITLE], \
3415 \\*[$DRAFT_STRING]\\*[$DRAFT]
3419 . ie '\\*[$DRAFT]'' \{\
3420 . ds $HDRFTR_CENTER \
3421 \\*[$CHAPTER_STRING]
3424 . ds $HDRFTR_CENTER \
3425 \\*[$CHAPTER_STRING], \
3426 \\*[$DRAFT_STRING]\\*[$DRAFT]
3431 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3432 . ie '\\*[$DRAFT]'' \{\
3433 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3436 . ds $HDRFTR_CENTER \
3437 \\*[$CHAPTER_TITLE], \
3438 \\*[$DRAFT_STRING]\\*[$DRAFT]
3442 . ie '\\*[$DRAFT]'' \{\
3443 . ds $HDRFTR_CENTER \
3444 \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3447 . ds $HDRFTR_CENTER \
3448 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3449 \\*[$DRAFT_STRING]\\*[$DRAFT]
3455 . ie '\\*[$CHAPTER]'' \{\
3456 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3457 . ie '\\*[$DRAFT]'' \{\
3458 . ds $HDRFTR_CENTER \
3459 \\*[$CHAPTER_TITLE], \
3460 \\*[$REVISION_STRING] \\*[$REVISION]
3463 . ds $HDRFTR_CENTER \
3464 \\*[$CHAPTER_TITLE], \
3465 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3466 \\*[$REVISION_STRING] \\*[$REVISION]
3470 . ie '\\*[$DRAFT]'' \{\
3471 . ds $HDRFTR_CENTER \
3472 \\*[$CHAPTER_STRING], \
3473 \\*[$REVISION_STRING] \\*[$REVISION]
3476 . ds $HDRFTR_CENTER \
3477 \\*[$CHAPTER_STRING], \
3478 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3479 \\*[$REVISION_STRING] \\*[$REVISION]
3484 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3485 . ie '\\*[$DRAFT]'' \{\
3486 . ds $HDRFTR_CENTER \
3487 \\*[$CHAPTER_TITLE], \
3488 \\*[$REVISION_STRING] \\*[$REVISION]
3491 . ds $HDRFTR_CENTER \
3492 \\*[$CHAPTER_TITLE], \
3493 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3494 \\*[$REVISION_STRING] \\*[$REVISION]
3498 . ie '\\*[$DRAFT]'' \{\
3499 . ds $HDRFTR_CENTER \
3500 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3501 \\*[$REVISION_STRING] \\*[$REVISION]
3504 . ds $HDRFTR_CENTER \
3505 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3506 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3507 \\*[$REVISION_STRING] \\*[$REVISION]
3517 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3518 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3519 . el \{ .PAGENUM_STYLE DIGIT \}
3520 . ie '\\*[$CHAPTER]'' \{\
3521 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3522 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3525 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
3529 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3530 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3533 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3540 . if \\n[#DOC_TYPE]=3 \{\
3541 . ie \\n[#COPY_STYLE]=1 \{\
3542 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3543 . el \{ .PAGENUM_STYLE roman \}
3544 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3545 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3548 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3549 . ie '\\*[$REVISION]'' \{\
3550 . ie '\\*[$DRAFT]'' \{\
3551 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3554 . ds $HDRFTR_CENTER \
3556 \\*[$DRAFT_STRING]\\*[$DRAFT]
3560 . ie '\\*[$DRAFT]'' \{\
3561 . ds $HDRFTR_CENTER \
3563 \\*[$REVISION_STRING] \\*[$REVISION]
3566 . ds $HDRFTR_CENTER \
3568 \\*[$DRAFT_STRING]\\*[$DRAFT], \
3569 \\*[$REVISION_STRING] \\*[$REVISION]
3576 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3577 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3578 . el \{ .PAGENUM_STYLE DIGIT \}
3579 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3585 \# ====================================================================
3587 \# +++COLLECT DOC INFO -- STRINGS AND NUMBER REGISTERS+++
3590 \# various string/register arguments
3592 \# Collect information about documents.
3596 . ds $DOC_TITLE \\$1
3599 .MAC TITLE END \"Document title
3604 .MAC SUBTITLE END \"Document sub-title
3609 .MAC CHAPTER END \"If document is a chapter, the chapter number
3614 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
3615 . ds $CHAPTER_TITLE \\$1
3619 .MAC DRAFT END \"Draft number
3620 . ie '\\$1'' \{ .ds $DRAFT \}
3621 . el \{ .ds $DRAFT " \\$1\}
3625 .MAC REVISION END \"Revision number
3630 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
3631 . nr #DRAFT_WITH_PAGENUM 1
3635 .MAC AUTHOR END \"Author. Enclose all args fully in double quotes.
3636 . nr #AUTHOR_NUM -1 1
3637 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
3638 . ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
3640 . nr #NUM_AUTHORS \\n[#NUM_ARGS]%2 \"Use mod 2 to test if odd or even # of authors
3641 . ie \\n[#NUM_AUTHORS]=1 \{ .nr #AUTHOR_LINES 0 \}
3642 . el \{ .nr #AUTHOR_LINES 1 \}
3646 .MAC PAGENUMBER END \"Page # that appears on page one.
3647 . nr #n%_AT_PAGENUM_SET \\n%
3648 . nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
3649 . rr #n%_AT_PAGENUM_SET
3650 . nr #PAGE_NUM_SET 1
3653 \# ====================================================================
3655 \# +++TYPE OF DOCUMENT+++
3660 \# DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
3662 \# Creates strings and sets registers for document types.
3664 \# Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
3667 . if '\\$1'DEFAULT' \{\
3670 . if '\\$1'CHAPTER' \{\
3673 . if '\\$1'NAMED' \{\
3677 . if '\\$1'LETTER' \{\
3685 . INDENT_FIRST_PARAS
3687 . ds $SUITE \En[#SUITE]
3688 . HEADER_MARGIN 3P+6p
3694 . FOOTER_RIGHT_SIZE +0
3695 . FOOTER_RIGHT "\&.../\E*[$SUITE]
3696 . FOOTER_ON_FIRST_PAGE
3701 \# +++LETTER MACROS+++
3703 \# First, create a register to hold incrementing numbers to be
3704 \# appended to LETTERHEAD.
3713 \# Stores date (entered on the line after .DATE) in diversion
3717 . if !'\\n(.z'' \{ .di \}
3718 . di LETTERHEAD\\n+[#FIELD]
3719 . ie \\n[#FIELD]=1 \{\
3734 \# Stores addressee address (entered on the line after .TO) in
3735 \# diversion LETTERHEAD<n>
3738 . if !'\\n(.z'' \{ .di \}
3739 . di LETTERHEAD\\n+[#FIELD]
3749 \# Stores addresser address (entered on the line after .FROM) in
3750 \# diversion LETTERHEAD<n>
3753 . if !'\\n(.z'' \{ .di \}
3754 . di LETTERHEAD\\n+[#FIELD]
3764 \# Stores greeting (entered on the line after .GREETING) in
3765 \# diversion LETTERHEAD<n>
3768 . if !'\\n(.z'' \{ .di \}
3769 . di LETTERHEAD\\n+[#FIELD]
3779 \# Stores greeting in diversion CLOSING.
3794 \# Redefines $FOOTER_RIGHT to blank so that a suite number doesn't
3795 \# appear at the bottom of letter pages.
3801 \# ====================================================================
3810 \# Sets up defaults if no values are entered prior to START.
3812 \# The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
3813 \# $REVISION_STRING are in the COPYSTYLE macro.
3816 . if !d$PAPER \{ .PAPER LETTER \}
3817 . if !\\n[#DOC_TYPE] \{ .DOCTYPE DEFAULT \}
3818 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3820 . if !\\n[#COPY_STYLE]=1 \{ .PAGENUM_STYLE DIGIT \}
3822 . if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
3823 . if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
3824 . if \\n[#DOC_TYPE]=4 \{\
3825 . if !\\n[#USER_SET_L_LENGTH] \{\
3826 . R_MARGIN \\n[#R_MARGIN]u
3827 . rr #USER_SET_L_LENGTH
3829 . if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
3831 . if \\n[#COPY_STYLE]=1 \{\
3835 . if !r#DOC_HEADER \{ .DOCHEADER \}
3836 . if !r#HEADERS_ON \{ .HEADERS \}
3837 . if !r#PAGINATE \{ .PAGINATE \}
3838 . if \\n[#FOOTERS_ON] \{\
3840 . if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
3842 . if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
3843 . if !r#HEADER_GAP \{ .HEADER_GAP 3P \}
3844 . if \\n[#FOOTERS_ON] \{\
3845 . if \\n[#PAGINATE]=0 \{\
3846 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
3849 . if \\n[#HEADERS_ON]=0 \{\
3850 . if \\n[#FOOTERS_ON]=0 \{\
3851 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
3854 . if !r#T_MARGIN \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
3855 . if !r#DOCHEADER_ADVANCE \{ .DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
3856 . if !r#FOOTER_MARGIN \{ .FOOTER_MARGIN 3P \}
3857 . if !r#FOOTER_GAP \{ .FOOTER_GAP 3P \}
3858 . if !r#B_MARGIN \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
3859 . if (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
3860 . tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
3861 . tm1 " No footers or bottom-of-page page numbers will be printed.
3862 . tm1 " Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
3863 . tm1 " If no footers or bottom-of-page page numbers are required,
3864 . tm1 " place .FOOTER_MARGIN 0 before .START
3866 . if !r#HDRFTR_RULE_GAP \{\
3867 . if \\n[#HEADERS_ON] \{ .HDRFTR_RULE_GAP 4p \}
3868 . if \\n[#FOOTERS_ON] \{ .HDRFTR_RULE_GAP 4p \}
3870 . if !r#HDRFTR_RULE \{ .HDRFTR_RULE \}
3871 . if !r#PAGE_NUM_SET \{ .PAGENUMBER 1 \}
3872 . ie r#ADJ_DOC_LEAD \{ . \}
3873 . el \{ .DOC_LEAD_ADJUST \}
3874 \# Read in number registers and strings for type parameters
3875 . nr #DOC_L_MARGIN \\n[#L_MARGIN]
3876 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
3877 . nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
3878 . ds $DOC_FAM \\*[$FAMILY]
3879 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
3880 . nr #DOC_LEAD \\n[#LEAD]
3881 . ds $DOC_QUAD \\*[$QUAD_VALUE]
3882 . ds $PP_FT \\*[$FONT]
3887 . nr #FN_COUNT_FOR_COLS 0 1
3889 . RESET_SUBHEAD_NUMBER
3890 . RESET_PARAHEAD_NUMBER
3891 \# General style defaults for both PRINTSTYLEs
3893 . PARA_INDENT \\n[#PP_INDENT]u
3894 . if !d$HDRFTR_FAM \{ .HDRFTR_FAMILY \\*[$DOC_FAM] \}
3895 . if !d$HDRFTR_SIZE_CHANGE \{ .HDRFTR_SIZE +0 \}
3896 . if !d$PAGE_NUM_FAM \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
3897 . if !d$PAGE_NUM_FT \{ .PAGENUM_FONT R \}
3898 . if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE +0 \}
3899 . if !r#PAGE_NUM_POS_SET \{ .PAGENUM_POS BOTTOM CENTER \}
3900 . ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
3901 . if \\n[#PAGE_NUM_HYPHENS]=0 \{ .PAGENUM_HYPHENS OFF \}
3902 . if \\n[#PAGE_NUM_HYPHENS]=1 \{ .PAGENUM_HYPHENS \}
3904 . el \{ .PAGENUM_HYPHENS \}
3905 . if !d$HEAD_QUAD \{ .HEAD_QUAD CENTER \}
3906 . if !r#HEAD_CAPS \{ .HEAD_CAPS \}
3907 . if !r#HEAD_UNDERLINE \{ .HEAD_UNDERLINE \}
3908 . if !d$SH_QUAD \{ .SUBHEAD_QUAD LEFT \}
3909 . if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
3910 . if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
3911 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
3913 . if !d$FN_FAM \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
3914 . if !d$FN_FT \{ .FOOTNOTE_FONT R \}
3915 . if !d$FN_QUAD \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD] \}
3916 . if !r#FN_RULE \{ .FOOTNOTE_RULE \}
3917 . if !r#FN_MARKERS \{ .FOOTNOTE_MARKERS \}
3918 . if !r#FN_MARKER_STYLE \{ .FOOTNOTE_MARKER_STYLE STAR \}
3919 . if !d$EN_PN_STYLE \{ .ENDNOTES_PAGENUM_STYLE digit \}
3920 . if !d$EN_FAM \{ .ENDNOTE_FAMILY \\*[$DOC_FAM] \}
3921 . if !d$EN_FN \{ .ENDNOTE_FONT R \}
3922 . if !d$EN_QUAD \{ .ENDNOTE_QUAD \\*[$DOC_QUAD] \}
3923 . if !d$EN_STRING \{ .ENDNOTE_STRING "Endnotes" \}
3924 . if !d$EN_STRING_FAM \{ .ENDNOTE_STRING_FAMILY \\*[$EN_FAM] \}
3925 . if !d$EN_STRING_QUAD \{ .ENDNOTE_STRING_QUAD CENTER \}
3926 . if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2 \}
3927 . if !r#EN_STRING_CAPS \{ .ENDNOTE_STRING_CAPS \}
3928 . if !d$EN_TITLE \{\
3929 . ie \\n[#DOC_TYPE]=2 \{\
3930 . ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
3931 . el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]" \}
3933 . el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
3935 . if !d$EN_TITLE_FAM \{ .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM] \}
3936 . if !d$EN_TITLE_QUAD \{ .ENDNOTE_TITLE_QUAD LEFT \}
3937 . if !r#EN_TITLE_UNDERSCORE \{ .ENDNOTE_TITLE_UNDERSCORE \}
3938 . if !d$EN_NUMBER_FAM \{ .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] \}
3939 . if !r#EN_NUMBERS_ALIGN_LEFT \{\
3940 . if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2 \}
3942 . if !d$TOC_HEADER_STRING \{ .TOC_HEADER_STRING "Contents" \}
3943 . if !d$TOC_HEADER_QUAD \{ .TOC_HEADER_QUAD LEFT \}
3944 . if !d$TOC_PN_STYLE \{ .TOC_PAGENUM_STYLE roman \}
3945 . if !r#TOC_PN_PADDING \{ .TOC_PADDING 3 \}
3946 . if !r#TOC_TITLE_INDENT \{ .TOC_TITLE_INDENT 0 \}
3947 . if !r#TOC_HEAD_INDENT \{ .TOC_HEAD_INDENT 18p \}
3948 . if !r#TOC_SH_INDENT \{ .TOC_SUBHEAD_INDENT 30p \}
3949 . if !r#TOC_PH_INDENT \{ .TOC_PARAHEAD_INDENT 42p \}
3950 \# String defaults for both PRINTSTYLEs
3951 . ie \\n[#DOC_TYPE]=1 \{\
3952 . ie '\\*[$DOC_TITLE]'' \{\
3953 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 \{ .ds $HDRFTR_LEFT \\*[$AUTHOR_1] \}
3954 . rr #USER_DEF_HDRFTR_LEFT
3955 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 \{ .ds $HDRFTR_RIGHT \\*[$TITLE] \}
3956 . rr #USER_DEF_HDRFTR_RIGHT
3959 . if \\n[#COPY_STYLE]=1 \{ .DRAFT_WITH_PAGENUMBER \}
3960 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 \{ .ds $HDRFTR_LEFT \\*[$AUTHOR_1] \}
3961 . rr #USER_DEF_HDRFTR_LEFT
3962 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{ .ds $HDRFTR_CENTER \\*[$TITLE] \}
3963 . rr #USER_DEF_HDRFTR_CENTER
3964 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 \{ .ds $HDRFTR_RIGHT \\*[$DOC_TITLE] \}
3965 . rr #USER_DEF_HDRFTR_RIGHT
3969 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 \{ .ds $HDRFTR_LEFT \\*[$AUTHOR_1] \}
3970 . rr #USER_DEF_HDRFTR_LEFT
3971 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 \{ .ds $HDRFTR_RIGHT \\*[$TITLE] \}
3972 . rr #USER_DEF_HDRFTR_RIGHT
3974 . if !d$ATTRIBUTE_STRING \{ .ATTRIBUTE_STRING "by" \}
3975 . if !d$FINIS_STRING \{ .FINIS_STRING "END" \}
3976 \# Defaults for printstyle TYPEWRITE
3977 . if \\n[#PRINT_STYLE]=1 \{\
3978 . if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES \}
3979 . if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF \}
3980 . if !r#Q_OFFSET_VALUE \{ .QUOTE_INDENT 2 \}
3981 . if !r#EPI_OFFSET_VALUE \{ .EPIGRAPH_INDENT 2 \}
3982 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 2p \}
3983 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE +0 \}
3984 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 2i \}
3985 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 6p \}
3986 . if !r#SLANT_MEANS_SLANT \{\
3987 . ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
3988 . el \{ .UNDERLINE_SLANT OFF \}
3990 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3991 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
3993 \# Defaults for printstyle TYPESET
3994 . if \\n[#PRINT_STYLE]=2 \{\
3995 . if !d$DOCHEADER_LEAD_ADJ \{\
3996 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3997 . ie !'\\*[$CHAPTER_STRING]'' \{\
4000 . el \{ .DOCHEADER_LEAD +0 \}
4002 . el \{ .DOCHEADER_LEAD +0 \}
4004 . if !d$TITLE_FAM \{ .TITLE_FAMILY \\*[$DOC_FAM] \}
4005 . if !d$TITLE_FT \{ .TITLE_FONT B \}
4006 . if !d$TITLE_SIZE_CHANGE \{\
4007 . ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
4008 . el \{ .TITLE_SIZE +3.5 \}
4010 . if !d$CHAPTER_TITLE_FAM \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
4011 . if !d$CHAPTER_TITLE_FT \{ .CHAPTER_TITLE_FONT BI \}
4012 . if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE +4 \}
4013 . if !d$SUBTITLE_FAM \{ .SUBTITLE_FAMILY \\*[$DOC_FAM] \}
4014 . if !d$SUBTITLE_FT \{ .SUBTITLE_FONT R \}
4015 . if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE +0 \}
4016 . if !d$AUTHOR_FAM \{ .AUTHOR_FAMILY \\*[$DOC_FAM] \}
4017 . if !d$AUTHOR_FT \{ .AUTHOR_FONT I \}
4018 . if !d$AUTHOR_SIZE_CHANGE \{ .AUTHOR_SIZE +0 \}
4019 . if !d$DOCTYPE_FAM \{ .DOCTYPE_FAMILY \\*[$DOC_FAM] \}
4020 . if !d$DOCTYPE_FT \{ .DOCTYPE_FONT BI \}
4021 . if !d$DOCTYPE_SIZE_CHANGE \{ .DOCTYPE_SIZE +3 \}
4022 . if !d$HDRFTR_LEFT_FAM \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
4023 . if !d$HDRFTR_LEFT_FT \{ .HDRFTR_LEFT_FONT R \}
4024 . if \\n[#HDRFTR_LEFT_CAPS] \{\
4025 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -2 \}
4027 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -.5 \}
4028 . if !d$HDRFTR_CENTER_FAM \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
4029 . if !d$HDRFTR_CENTER_FT \{ .HDRFTR_CENTER_FONT I \}
4030 . if \\n[#HDRFTR_CENTER_CAPS] \{\
4031 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
4033 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5 \}
4034 . if !d$HDRFTR_RIGHT_FAM \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] \}
4035 . if !d$HDRFTR_RIGHT_FT \{ .HDRFTR_RIGHT_FONT R \}
4036 . if \\n[#HDRFTR_RIGHT_CAPS] \{\
4037 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
4039 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -.5 \}
4040 . if !d$HEAD_FAM \{ .HEAD_FAMILY \\*[$DOC_FAM] \}
4041 . if !d$HEAD_FT \{ .HEAD_FONT B \}
4042 . if !d$HEAD_SIZE_CHANGE \{ .HEAD_SIZE +1 \}
4043 . if !r#HEAD_SPACE \{ .HEAD_SPACE \}
4044 . if !d$SH_FAM \{ .SUBHEAD_FAMILY \\*[$DOC_FAM] \}
4045 . if !d$SH_FT \{ .SUBHEAD_FONT B \}
4046 . if !d$SH_SIZE_CHANGE \{ .SUBHEAD_SIZE +.5 \}
4047 . if !d$PH_FAM \{ .PARAHEAD_FAMILY \\*[$DOC_FAM] \}
4048 . if !d$PH_FT \{ .PARAHEAD_FONT BI \}
4049 . if !d$PH_SIZE_CHANGE \{ .PARAHEAD_SIZE -.25 \}
4050 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
4051 . if !d$QUOTE_FAM \{ .QUOTE_FAMILY \\*[$DOC_FAM] \}
4052 . if !d$QUOTE_FT \{ .QUOTE_FONT I \}
4053 . if !d$QUOTE_SIZE_CHANGE \{ .QUOTE_SIZE +0 \}
4054 . if !r#Q_OFFSET_VALUE \{ .QUOTE_INDENT 3 \}
4055 . if !d$BQUOTE_FAM \{ .BLOCKQUOTE_FAMILY \\*[$DOC_FAM] \}
4056 . if !d$BQUOTE_FT \{ .BLOCKQUOTE_FONT R \}
4057 . if !d$BQUOTE_SIZE_CHANGE \{ .BLOCKQUOTE_SIZE -1 \}
4058 . if !d$BQUOTE_QUAD \{ .BLOCKQUOTE_QUAD LEFT \}
4059 . if !d$EPI_FAM \{ .EPIGRAPH_FAMILY \\*[$DOC_FAM] \}
4060 . if !d$EPI_FT \{ .EPIGRAPH_FONT R \}
4061 . if !d$EPI_SIZE_CHANGE \{ .EPIGRAPH_SIZE -1.5 \}
4062 . if !r#EPI_AUTOLEAD \{ .EPIGRAPH_AUTOLEAD 2 \}
4063 . if !d$EPI_QUAD \{ .EPIGRAPH_QUAD \\*[$DOC_QUAD] \}
4064 . if !r#EPI_OFFSET_VALUE \{ .EPIGRAPH_INDENT 3 \}
4065 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 3p \}
4066 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 4P \}
4067 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 3p \}
4068 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE -2 \}
4069 . if !r#FN_AUTOLEAD \{ .FOOTNOTE_AUTOLEAD 2 \}
4070 . if !r#EN_PS \{ .ENDNOTE_PT_SIZE \\n[#DOC_PT_SIZE]u \}
4071 . if !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
4072 . if !d$EN_STRING_FT \{ .ENDNOTE_STRING_FONT B \}
4073 . if !d$EN_STRING_SIZE_CHANGE \{ .ENDNOTE_STRING_SIZE +1 \}
4074 . if !d$EN_TITLE_FT \{ .ENDNOTE_TITLE_FONT B \}
4075 . if !d$EN_TITLE_SIZE_CHANGE \{ .ENDNOTE_TITLE_SIZE +0 \}
4076 . if !d$EN_NUMBER_FT \{ .ENDNOTE_NUMBER_FONT B \}
4077 . if !d$EN_NUMBER_SIZE_CHANGE \{ .ENDNOTE_NUMBER_SIZE +0 \}
4078 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT 1.5m \}
4079 . if !d$TOC_FAM \{ .TOC_FAMILY \\*[$DOC_FAM] \}
4080 . if !r#TOC_PS \{ .TOC_PT_SIZE \\n[#DOC_PT_SIZE]u \}
4081 . if !r#TOC_LEAD \{ .TOC_LEAD \\n[#DOC_LEAD]u ADJUST \}
4082 . if !d$TOC_HEADER_FAM \{ .TOC_HEADER_FAMILY \\*[$TOC_FAM] \}
4083 . if !d$TOC_HEADER_SIZE_CHANGE \{ .TOC_HEADER_SIZE +4 \}
4084 . if !d$TOC_HEADER_FT \{ .TOC_HEADER_FONT B \}
4085 . if !d$TOC_TITLE_FAM \{ .TOC_TITLE_FAMILY \\*[$TOC_FAM] \}
4086 . if !d$TOC_PN_FAM \{ .TOC_PN_FAMILY \\*[$TOC_FAM] \}
4087 . if !d$TOC_HEAD_FAM \{ .TOC_HEAD_FAMILY \\*[$TOC_FAM] \}
4088 . if !d$TOC_SH_FAM \{ .TOC_SUBHEAD_FAMILY \\*[$TOC_FAM] \}
4089 . if !d$TOC_PH_FAM \{ .TOC_PARAHEAD_FAMILY \\*[$TOC_FAM] \}
4090 . if !d$TOC_TITLE_FT \{ .TOC_TITLE_FONT BI \}
4091 . if !d$TOC_PN_FT \{ .TOC_PN_FONT R \}
4092 . if !d$TOC_HEAD_FT \{ .TOC_HEAD_FONT B \}
4093 . if !d$TOC_SH_FT \{ .TOC_SUBHEAD_FONT R \}
4094 . if !d$TOC_PH_FT \{ .TOC_PARAHEAD_FONT I \}
4095 . if !d$TOC_TITLE_SIZE_CHANGE \{ .TOC_TITLE_SIZE +.5 \}
4096 . if !d$TOC_PN_SIZE_CHANGE \{ .TOC_PN_SIZE +0 \}
4097 . if !d$TOC_HEAD_SIZE_CHANGE \{ .TOC_HEAD_SIZE +.5 \}
4098 . if !d$TOC_SH_SIZE_CHANGE \{ .TOC_SUBHEAD_SIZE +0 \}
4099 . if !d$TOC_PH_SIZE_CHANGE \{ .TOC_PARAHEAD_SIZE +0 \}
4101 . if \\n[#PRINT_STYLE]=2 \{\
4102 . ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
4105 . if !\\n[#COLLATE] \{\
4107 \# Endnote and toc leading
4108 . nr #OK_PROCESS_LEAD 1
4109 . nr #RESTORE_DOC_LEAD \\n(.v
4110 . if \\n[#PRINT_STYLE]=1 \{\
4111 . ie \\n[#SINGLE_SPACE] \{\
4112 . ENDNOTE_LEAD 12 ADJUST
4115 . ie \\n[#EN_SINGLESPACE] \{ .ENDNOTE_LEAD 12 ADJUST \}
4116 . el \{ .ENDNOTE_LEAD 24 ADJUST \}
4119 . if \\n[#PRINT_STYLE]=2 \{\
4120 . ie !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
4121 . el \{ .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] \}
4122 . ie !d$TOC_LEAD \{ .TOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
4123 . el \{ .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] \}
4124 . rm $ADJUST_EN_LEAD
4125 . rm $ADJUST_TOC_LEAD
4127 . DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
4129 . if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
4132 \# ====================================================================
4134 \# +++START THE DOCUMENT+++
4141 \# Reads in default document style parameters and any parameter
4142 \# the user has changed before issuing START.
4143 \# Using the information gathered in the opening macros,
4144 \# prints appropriate title (or chapter #), subtitle, author
4145 \# and document type (if appropriate).
4147 \# The .PRINT \& (zero-width character) is required to get the
4148 \# subsequent .sp request to work as advertised.
4150 \# The overall document line length, family, and point-size
4151 \# are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
4152 \# use in the HEADER and FOOTER macros.
4154 \# First, define some strings for point sizes
4156 .ds $TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
4157 .ds $CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
4158 .ds $SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
4159 .ds $AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
4160 .ds $DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
4162 \# Next, some utility macros for various routines to prevent repetition
4164 .MAC PRINT_AUTHORS END
4165 . nr #AUTHORS \\n[#AUTHOR_NUM]
4166 . nr #NEXT_AUTHOR 0 1
4167 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4168 . ie \\n[#AUTHOR_COLOR]=1 \{\
4169 . PRINT \m[\\*[$AUTHOR_COLOR]]\\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]\m[]
4171 . el \{ .PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]] \}
4175 .MAC DEFAULT_DOCHEADER END
4177 . FAMILY \\*[$TITLE_FAM]
4179 . PT_SIZE \\*[$TITLE_PT_SIZE]
4180 . LS \\n[#DOCHEADER_LEAD]u
4181 . ie \\n[#TITLE_COLOR]=1 \{\
4182 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$TITLE]\m[]
4184 . el \{ .PRINT \\*[$TITLE] \}
4185 . if !'\\*[$SUBTITLE]'' \{\
4186 . FAMILY \\*[$SUBTITLE_FAM]
4187 . FT \\*[$SUBTITLE_FT]
4188 . PT_SIZE \\*[$SUBTITLE_PT_SIZE]
4189 . ie \\n[#SUBTITLE_COLOR]=1 \{\
4190 . PRINT \m[\\*[$SUBTITLE_COLOR]]\\*[$TITLE]\m[]
4192 . el \{ .PRINT \\*[$SUBTITLE] \}
4194 . if !'\\*[$AUTHOR_1]'' \{\
4195 . FAMILY \\*[$AUTHOR_FAM]
4196 . FT \\*[$AUTHOR_FT]
4197 . PT_SIZE \\*[$AUTHOR_PT_SIZE]
4198 . if !'\\*[$ATTRIBUTE_STRING]'' \{\
4199 . ie \\n[#ATTRIBUTE_COLOR]=1 \{\
4200 . PRINT \m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
4202 . el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
4209 .MAC CHAPTER_DOCHEADER END
4211 . FAMILY \\*[$TITLE_FAM]
4213 . PT_SIZE \\*[$TITLE_PT_SIZE]
4214 . LS \\n[#DOCHEADER_LEAD]u
4215 \# Chapter title only
4216 . ie '\\*[$CHAPTER]'' \{\
4217 . ie !'\\*[$CHAPTER_TITLE]'' \{\
4218 . if \\n[#PRINT_STYLE]=2 \{\
4219 . FAMILY \\*[$CHAPTER_TITLE_FAM]
4220 . FT \\*[$CHAPTER_TITLE_FT]
4221 . PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
4222 . LS \\n[#DOCHEADER_LEAD]u
4224 . ie \\n[#TITLE_COLOR]=1 \{\
4225 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
4227 . el \{ .PRINT \\*[$CHAPTER_TITLE] \}
4230 . ie \\n[#TITLE_COLOR]=1 \{\
4231 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING]\m[]
4233 . el \{ .PRINT \\*[$CHAPTER_STRING] \}
4236 \# Chapter string, possibly with a chapter title
4238 . ie \\n[#TITLE_COLOR]=1 \{\
4239 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_STRING] \\*[$CHAPTER]\m[]
4241 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
4242 . if !'\\*[$CHAPTER_TITLE]'' \{\
4243 . if \\n[#PRINT_STYLE]=1 \{ .PRINT \\*[$CHAPTER_TITLE] \}
4244 . if \\n[#PRINT_STYLE]=2 \{\
4245 . FAMILY \\*[$CHAPTER_TITLE_FAM]
4246 . FT \\*[$CHAPTER_TITLE_FT]
4247 . PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
4248 . LS \\n[#DOCHEADER_LEAD]u
4249 . ie \\n[#TITLE_COLOR]=1 \{\
4250 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$CHAPTER_TITLE]\m[]
4252 . el \{ .PRINT \\*[$CHAPTER_TITLE] \}
4253 . RLD \\n[#DOC_LEAD]u \" Just looks better this way
4260 .MAC NAMED_DOCHEADER END
4262 . FAMILY \\*[$TITLE_FAM]
4264 . PT_SIZE \\*[$TITLE_PT_SIZE]
4265 . LS \\n[#DOCHEADER_LEAD]u
4266 . ie \\n[#TITLE_COLOR]=1 \{\
4267 . PRINT \m[\\*[$TITLE_COLOR]]\\*[$TITLE]\m[]
4269 . el \{ .PRINT \\*[$TITLE] \}
4270 . if !'\\*[$SUBTITLE]'' \{\
4271 . FAMILY \\*[$SUBTITLE_FAM]
4272 . FT \\*[$SUBTITLE_FT]
4273 . PT_SIZE \\*[$SUBTITLE_PT_SIZE]
4274 . ie \\n[#SUBTITLE_COLOR]=1 \{\
4275 . PRINT \m[\\*[$SUBTITLE_COLOR]]\\*[$TITLE]\m[]
4277 . el \{ .PRINT \\*[$SUBTITLE] \}
4279 . if !'\\*[$AUTHOR_1]'' \{\
4280 . FAMILY \\*[$AUTHOR_FAM]
4281 . FT \\*[$AUTHOR_FT]
4282 . PT_SIZE \\*[$AUTHOR_PT_SIZE]
4283 . if !'\\*[$ATTRIBUTE_STRING]'' \{\
4284 . ie \\n[#ATTRIBUTE_COLOR]=1 \{\
4285 . PRINT \m[\\*[$ATTRIBUTE_COLOR]]\\*[$ATTRIBUTE_STRING]\m[]
4287 . el \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
4292 . FAMILY \\*[$DOCTYPE_FAM]
4293 . FT \\*[$DOCTYPE_FT]
4294 . PT_SIZE \\*[$DOCTYPE_PT_SIZE]
4295 . LS \\n[#DOCHEADER_LEAD]u
4296 . ALD \\n[#DOCHEADER_LEAD]u
4297 . ie \\n[#DOCTYPE_COLOR]=1 \{\
4298 . COLOR \\*[$DOCTYPE_COLOR]
4299 . UNDERSCORE "\\*[$DOC_TYPE]
4301 . el .UNDERSCORE "\\*[$DOC_TYPE]
4306 . if !\\n[#PRINT_STYLE] \{\
4307 . PRINTSTYLE TYPEWRITE
4314 . PRINT "You neglected to enter a PRINTSTYLE"
4316 . ab PRINTSTYLE missing
4319 . if \\n[#COLLATE] \{\
4320 . COPYSTYLE \\*[$COPY_STYLE]
4321 . nr #HEADERS_ON \\n[#HEADER_STATE]
4322 . if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
4323 . sp |\\n[#HEADER_MARGIN]u
4325 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
4326 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
4327 . rm $RESTORE_PAGENUM_STYLE
4332 . ie \\n[#COLLATED_DOC]=1 \{\
4333 \# Collect TITLE for TOC.
4334 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
4335 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
4336 . ie \\n[#USER_SET_TITLE_ITEM] \{\
4337 . ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]\\|
4338 . rr #USER_SET_TITLE_ITEM
4339 . rm $USER_SET_TITLE_ITEM
4342 . ie \\n[#DOC_TYPE]=2 \{\
4343 . ie '\\*[$CHAPTER_TITLE]'' \{\
4344 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
4347 . ie '\\*[$CHAPTER]'' \{\
4348 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]\\|
4351 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
4356 . ds $TOC_TITLE_ITEM \\*[$TITLE]\\|
4359 . if \\n[#TOC_AUTHORS]=1 \{\
4360 . ie '\\*[$TOC_AUTHORS]'' \{\
4361 . as $TOC_TITLE_ITEM /\\|\\*[$AUTHOR_1]\\|
4364 . as $TOC_TITLE_ITEM /\\|\\*[$TOC_AUTHORS]\\|
4368 \# Note the use of \!, which transparently embeds the macros used
4369 \# in the TOC_ENTRIES diversion. The elements they control must be
4370 \# processed literally when the diversion is output.
4373 . if \\n[#PRINT_STYLE]=1 \{\
4378 . if \\n[#PRINT_STYLE]=2 \{\
4379 \!. FAMILY \\*[$TOC_TITLE_FAM]
4380 \!. FT \\*[$TOC_TITLE_FT]
4381 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
4384 . ie \\n[#PRINT_STYLE]=1 \{\
4385 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
4388 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
4393 . if \\n[#PRINT_STYLE]=2 \{\
4394 \!. FAMILY \\*[$TOC_PN_FAM]
4395 \!. FT \\*[$TOC_PN_FT]
4396 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
4399 \!. PRINT \\*[LEADER]
4402 \!. PRINT \\n[#TOC_ENTRY_PN]
4408 . nr #FIRST_DOC_TITLE_PN \\n%+\\n[#PAGE_NUM_ADJ]
4409 . af #FIRST_DOC_TITLE_PN \\g[#PAGENUMBER]
4410 . nr #FIRST_DOC_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
4412 \# End TITLE collection
4413 . if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
4414 . sp |\\n[#HEADER_MARGIN]u
4418 . rr #PAGINATION_STATE
4419 \# End collate stuff
4420 . ie \\n[#DOC_HEADER]=0 \{\
4422 . if \\n[#DOC_TYPE]=4 \{\
4423 . if !'\\n(.z'' \{ .di \}
4425 . nr #STORED_PP_INDENT \\n[#PP_INDENT]
4428 . PARA_INDENT \\n[#STORED_PP_INDENT]u
4429 . rr #STORED_PP_INDENT
4430 . ie r#ADVANCE_FROM_TOP \{\
4431 . sp |\\n[#ADVANCE_FROM_TOP]u-1v
4434 . el \{ .sp |\\n[#T_MARGIN]u-1v \}
4435 . if \\n[#COLUMNS] \{\
4438 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4439 . nr #L_MARGIN \\n(.o
4440 . ll \\n[#COL_L_LENGTH]u
4444 . if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \}
4447 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ] \}
4448 . nr #DOCHEADER_LEAD \\n[#LEAD]
4450 . if \\n[#DOC_TYPE]=1 \{\
4452 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
4454 . if \\n[#DOCHEADER_COLOR]=1 \{\
4456 \m[\\*[$DOCHEADER_COLOR]]
4459 . L_MARGIN \\n[#DOC_L_MARGIN]u
4460 . LL \\n[#DOC_L_LENGTH]u
4462 . if \\n[#PRINT_STYLE]=1 \{\
4467 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4468 . el \{ .vs \\n[#DOC_LEAD]u \}
4470 . if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
4472 . if !'\\*[$SUBTITLE]'' \{\
4473 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4474 . el \{ .vs \\n[#DOC_LEAD]u \}
4475 . PRINT \\*[$SUBTITLE]
4477 . if '\\*[$SUBTITLE]'' \{\
4478 . ALD \\n[#DOC_LEAD]u
4480 . ie !'\\*[$AUTHOR_1]'' \{\
4481 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4482 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
4483 . if !d$SUBTITLE \{\
4484 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4485 . el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4487 . PRINT \\*[$ATTRIBUTE_STRING]
4488 . nr #AUTHORS \\n[#AUTHOR_NUM]
4489 . nr #NEXT_AUTHOR 0 1
4490 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4491 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4493 . if \\n[#AUTHOR_LINES]=1 \{\
4494 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4495 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
4499 . ie !d$SUBTITLE \{\
4500 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4501 . el \{ .RLD \\n[#DOC_LEAD]u \}
4504 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4505 . el \{ .ALD \\n[#DOC_LEAD]u \}
4509 . if \\n[#PRINT_STYLE]=2 \{\
4511 . di DOCHEADER_DIVERSION \" This diversion is only
4512 . br \" necessary to find the depth of the
4513 . DEFAULT_DOCHEADER \" docheader
4516 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
4517 . \"in #DOCHEADER_DEPTH
4518 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
4523 . if \\n[#DOC_TYPE]=2 \{\
4525 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
4527 . if \\n[#DOCHEADER_COLOR]=1 \{\
4529 \m[\\*[$DOCHEADER_COLOR]]
4532 . L_MARGIN \\n[#DOC_L_MARGIN]u
4533 . LL \\n[#DOC_L_LENGTH]u
4535 . if \\n[#PRINT_STYLE]=1 \{\
4540 . vs \\n[#DOC_LEAD]u
4541 . ie '\\*[$CHAPTER]'' \{\
4543 . ie !'\\*[$CHAPTER_TITLE]'' \{\
4544 . PRINT \\*[$CHAPTER_TITLE]
4548 . PRINT \\*[$CHAPTER_STRING]
4554 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4556 . if !'\\*[$CHAPTER_TITLE]'' \{\
4557 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4558 . UNDERSCORE "\\*[$CHAPTER_TITLE]
4561 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4563 . if \\n[#PRINT_STYLE]=2 \{\
4565 . di DOCHEADER_DIVERSION \" This diversion is only
4566 . br \" necessary to find the depth of the
4567 . CHAPTER_DOCHEADER \" docheader
4570 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
4571 . \" in #DOCHEADER_DEPTH
4572 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
4577 . if \\n[#DOC_TYPE]=3 \{\
4579 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
4581 . if \\n[#DOCHEADER_COLOR]=1 \{\
4583 \m[\\*[$DOCHEADER_COLOR]]
4586 . L_MARGIN \\n[#DOC_L_MARGIN]u
4587 . LL \\n[#DOC_L_LENGTH]u
4589 . if \\n[#PRINT_STYLE]=1 \{\
4594 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4595 . el \{ .vs \\n[#DOC_LEAD]u \}
4597 . if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
4599 . if !'\\*[$SUBTITLE]'' \{\
4600 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4601 . el \{ .vs \\n[#DOC_LEAD]u \}
4602 . PRINT \\*[$SUBTITLE]
4604 . if '\\*[$SUBTITLE]'' \{\
4605 . ALD \\n[#DOC_LEAD]u
4607 . ie !'\\*[$AUTHOR_1]'' \{\
4608 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4609 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
4610 . if !d$SUBTITLE \{\
4611 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4612 . el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4614 . PRINT \\*[$ATTRIBUTE_STRING]
4615 . nr #AUTHORS \\n[#AUTHOR_NUM]
4616 . nr #NEXT_AUTHOR 0 1
4617 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4618 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4620 . if \\n[#AUTHOR_LINES]=1 \{\
4621 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4622 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
4624 . vs \\n[#DOC_LEAD]u
4627 . ie !d$SUBTITLE \{\
4628 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4629 . el \{ .RLD \\n[#DOC_LEAD]u \}
4632 . ie \\n[#SINGLE_SPACE] \{ . \}
4633 . el \{ .RLD \\n[#DOC_LEAD]u \}
4636 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
4637 . el \{ .ALD \\n[#DOC_LEAD]u \}
4638 . UNDERSCORE2 "\\*[$DOC_TYPE]
4639 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4641 . if \\n[#PRINT_STYLE]=2 \{\
4643 . di DOCHEADER_DIVERSION \" This diversion is only
4644 . br \" necessary to find the depth of the
4645 . NAMED_DOCHEADER \" docheader
4648 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
4649 . \"in #DOCHEADER_DEPTH
4650 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
4654 . if !\\n[#DOC_TYPE]=4 \{\
4655 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
4656 . nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD]
4657 . ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]-\\n[#DOCHEADER_SPACE_ADJ] \}
4658 . el \{ .nr #DOCHEADER_EXTRA_SPACE 0 \}
4659 . if \\n[#PRINT_STYLE]=2 \{ .ALD (\\n[#DOC_LEAD]u*2u)+\\n[#DOCHEADER_EXTRA_SPACE]u \}
4660 . if \\n[#COLUMNS] \{\
4662 . nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
4663 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4664 . nr #L_MARGIN \\n(.o
4665 . LL \\n[#COL_L_LENGTH]u
4671 . QUAD \\*[$DOC_QUAD]
4672 . rr #DOCHEADER_LEAD
4673 . rr #DOCHEADER_LEAD_ADJ
4676 . rr #DOCHEADER_ADVANCE
4677 . rr #ADVANCE_FROM_TOP
4678 . rr #DOCHEADER_SPACE_ADJ
4679 . rr #DOCHEADER_EXTRA_SPACE
4684 . rm $TOC_TITLE_ITEM
4686 . nr #START_FOR_FOOTERS 1
4689 \# ====================================================================
4691 \# +++MACROS TO CHANGE SOME DEFAULTS+++
4696 \# <none> | <anything> [distance to advance from top of page]
4698 \# Turns printing of document header on or off. If a second argument
4699 \# in units of measure is given, advances that distance from the
4700 \# top of the page without printing the document header.
4702 \# Default is on. If the 1st argument is <anything> (which turns
4703 \# document headers off), the optional 2nd argument may be given
4704 \# (with a unit of measure).
4707 . ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
4709 . if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
4715 \# DOCUMENT HEADER LEADING
4716 \# -----------------------
4718 \# <+|- amount by which to in/decrease leading of doc header>
4720 \# Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
4722 \# A unit of measure must be supplied. Decimal fractions OK.
4723 \# Default is +0, i.e. same as DOC_LEAD.
4725 .MAC DOCHEADER_LEAD END
4726 . ds $DOCHEADER_LEAD_ADJ \\$1
4730 \# DOCHEADER ADVANCE
4731 \# -----------------
4733 \# <docheader start position>
4735 \# Creates register #DOCHEADER_ADVANCE, used in START.
4737 \# Unit of measure required.
4738 \# Default is same as T_MARGIN.
4740 .MAC DOCHEADER_ADVANCE END
4741 . nr #DOCHEADER_ADVANCE (\\$1)
4748 \# <pre-defined XCOLOR or NEWCOLOR>
4750 \# Sets register #DOCHEADER_COLOR to 1; defines string
4751 \# $DOCHEADER_COLOR to argument.
4753 \# User must define an XCOLOR or NEWCOLOR before using
4756 .MAC DOCHEADER_COLOR END
4757 . if \\n[#PRINT_STYLE]=1 \{ .return \}
4758 . nr #DOCHEADER_COLOR 1
4759 . ds $DOCHEADER_COLOR \\$1
4766 \# <family to use for the document header title>
4768 \# Creates or modifies string $TITLE_FAM.
4770 \# Default is same as running text.
4772 .MAC TITLE_FAMILY END
4773 . ds $TITLE_FAM \\$1
4780 \# <font to use for the document header title>
4782 \# Creates or modifies string $TITLE_FT.
4794 \# <+|- number of points by which to in/decrease title at start
4795 \# of the document (relative to running text)>
4797 \# Creates string $TITLE_SIZE_CHANGE.
4799 \# Must be preceded by a +|- sign, with no space afterwards.
4800 \# Fractional point sizes are allowed.
4801 \# Default is +3.5 for printstyle TYPESET DEFAULT | STORY | NAMED;
4802 \# 4 for TYPESET CHAPTER; +0 for TYPEWRITE.
4805 . ds $TITLE_SIZE_CHANGE \\$1
4812 \# <pre-defined color name>
4814 \# Sets register #TITLE_COLOR to 1; creates string $TITLE_COLOR
4816 \# The color name must be pre-defined with NEWCOLOR or XCOLOR.
4818 .MAC TITLE_COLOR END
4820 . ds $TITLE_COLOR \\$1
4824 \# CHAPTER TITLE FAMILY
4825 \# --------------------
4827 \# <family to use for the chapter title, if there is one>
4829 \# Creates or modifies string $CHAPTER_TITLE_FAM.
4831 \# Default isame as running text.
4833 .MAC CHAPTER_TITLE_FAMILY END
4834 . ds $CHAPTER_TITLE_FAM \\$1
4838 \# CHAPTER TITLE FONT
4839 \# ------------------
4841 \# <font to use for the chapter title, if there is one>
4843 \# Creates or modifies string $CHAPTER_TITLE_FT.
4845 \# Default is bold italic for TYPESET; varies in TYPEWRITE between
4846 \# caps and underscored, depending on whether chapter title stands
4847 \# alone or has CHAPTER # above it.
4849 .MAC CHAPTER_TITLE_FONT END
4850 . ds $CHAPTER_TITLE_FT \\$1
4854 \# CHAPTER TITLE SIZE
4855 \# ------------------
4857 \# <+|- number of points by which to in/decrease title at start
4858 \# of the document (relative to running text)>
4860 \# Creates string $CHAPTER_TITLE_SIZE_CHANGE.
4862 \# Must be preceded by a +|- sign, with no space afterwards.
4863 \# Fractional point sizes are allowed.
4864 \# Default is +4 for printstyle TYPESET
4866 .MAC CHAPTER_TITLE_SIZE END
4867 . ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
4874 \# <family to use for the document header title>
4876 \# Creates or modifies string $SUBTITLE_FAM.
4878 \# Default is same as running text.
4880 .MAC SUBTITLE_FAMILY END
4881 . ds $SUBTITLE_FAM \\$1
4888 \# <font to use for the document header title>
4890 \# Creates or modifies string $SUBTITLE_FT.
4892 \# Default is same as running text.
4894 .MAC SUBTITLE_FONT END
4895 . ds $SUBTITLE_FT \\$1
4902 \# <+|- number of points by which to in/decrease subtitle at start
4903 \# of the document (relative to running text)>
4905 \# Creates or modifies string $SUBTITLE_SIZE_CHANGE.
4907 \# Must be preceded by a +|- sign with no space afterwards.
4908 \# Fractional point sizes are allowed.
4911 .MAC SUBTITLE_SIZE END
4912 . ds $SUBTITLE_SIZE_CHANGE \\$1
4919 \# <pre-defined color name>
4921 \# Sets register #SUBTITLE_COLOR to 1; creates string
4924 \# The color name must be pre-defined with NEWCOLOR or XCOLOR.
4926 .MAC SUBTITLE_COLOR END
4927 . nr #SUBTITLE_COLOR 1
4928 . ds $SUBTITLE_COLOR \\$1
4935 \# <pre-defined color name>
4937 \# Sets register #ATTRIBUTE_COLOR to 1; creates string $ATTRIBUTE_COLOR
4939 \# The color name must be pre-defined with NEWCOLOR or XCOLOR.
4941 .MAC ATTRIBUTE_COLOR END
4942 . nr #ATTRIBUTE_COLOR 1
4943 . ds $ATTRIBUTE_COLOR \\$1
4950 \# <family to use for author in document header>
4952 \# Creates or modifies string $AUTHOR_FAM.
4954 \# Default is same as running text.
4956 .MAC AUTHOR_FAMILY END
4957 . ds $AUTHOR_FAM \\$1
4964 \# <font to use for author in document header>
4966 \# Creates or modifies string $AUTHOR_FT.
4968 \# Default is italic.
4970 .MAC AUTHOR_FONT END
4971 . ds $AUTHOR_FT \\$1
4978 \# <+|- number of points by which to in/decrease author at start
4981 \# Creates or modifies string $AUTHOR_SIZE_CHANGE.
4983 \# Must be preceded by a +|- sign with no space afterwards.
4984 \# Fractional point sizes are allowed.
4985 \# Default is same as running text.
4987 .MAC AUTHOR_SIZE END
4988 . ds $AUTHOR_SIZE_CHANGE \\$1
4995 \# <pre-defined color name>
4997 \# Sets register #AUTHOR_COLOR to 1; creates string $AUTHOR_COLOR
4999 \# The color name must be pre-defined with NEWCOLOR or XCOLOR.
5001 .MAC AUTHOR_COLOR END
5002 . nr #AUTHOR_COLOR 1
5003 . ds $AUTHOR_COLOR \\$1
5010 \# <family to use for the document type string>
5012 \# Creates or modifies string $DOCTYPE_FAM.
5014 \# Default is same as running text.
5016 .MAC DOCTYPE_FAMILY END
5017 . ds $DOCTYPE_FAM \\$1
5024 \# <font to use for the document type string>
5026 \# Creates or modifies string $DOCTYPE_FT.
5028 \# Default is bold italic.
5030 .MAC DOCTYPE_FONT END
5031 . ds $DOCTYPE_FT \\$1
5038 \# <+|- number of points by which to in/decrease the document
5039 \# type string (relative to running text)>
5041 \# Creates or modifies string $DOCTYPE_SIZE_CHANGE.
5043 \# Must be preceded by a +|- sign with no space afterwards.
5044 \# Fractional point sizes are allowed.
5045 \# Default is +3 for TYPESET; 0 for TYPEWRITE.
5047 .MAC DOCTYPE_SIZE END
5048 . ds $DOCTYPE_SIZE_CHANGE \\$1
5055 \# <pre-defined color name>
5057 \# Sets register #DOCTYPE_COLOR to 1; creates string $DOCTYPE_COLOR
5059 \# The color name must be pre-defined with NEWCOLOR or XCOLOR.
5061 .MAC DOCTYPE_COLOR END
5062 . nr #DOCTYPE_COLOR 1
5063 . ds $DOCTYPE_COLOR \\$1
5067 \# DOCUMENT LEFT MARGIN
5068 \# --------------------
5070 \# <left margin of document>
5072 \# Creates or modifies register #DOC_L_MARGIN.
5074 \# Affects EVERYTHING on the page.
5076 .MAC DOC_LEFT_MARGIN END
5078 . nr #DOC_L_MARGIN (\\$1)
5079 . L_MARGIN \\n[#DOC_L_MARGIN]u
5083 \# DOCUMENT RIGHT MARGIN
5084 \# ---------------------
5086 \# <right margin of document>
5088 \# Creates or modifies register #DOC_R_MARGIN.
5090 \# Affects EVERYTHING on the page.
5092 .MAC DOC_RIGHT_MARGIN END
5094 . nr #DOC_R_MARGIN (\\$1)
5095 . R_MARGIN \\n[#DOC_R_MARGIN]
5096 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
5100 \# DOCUMENT LINE LENGTH
5101 \# --------------------
5103 \# <line length of document>
5105 \# Creates or modifies string $DOC_L_LENGTH.
5107 \# Affects EVERYTHING on the page.
5109 .MAC DOC_LINE_LENGTH END
5111 . nr #DOC_L_LENGTH (\\$1)
5112 . LL \\n[#DOC_L_LENGTH]u
5120 \# <family of running text>
5122 \# Creates or modifies string $DOC_FAM.
5124 \# Affects everything EXCEPT headers and footers.
5129 . FAMILY \\*[$DOC_FAM]
5130 . TITLE_FAMILY \\*[$DOC_FAM]
5131 . SUBTITLE_FAMILY \\*[$DOC_FAM]
5132 . AUTHOR_FAMILY \\*[$DOC_FAM]
5133 . DOCTYPE_FAMILY \\*[$DOC_FAM]
5134 . HEAD_FAMILY \\*[$DOC_FAM]
5135 . SUBHEAD_FAMILY \\*[$DOC_FAM]
5136 . QUOTE_FAMILY \\*[$DOC_FAM]
5137 . BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
5138 . EPIGRAPH_FAMILY \\*[$DOC_FAM]
5139 . HDRFTR_FAMILY \\*[$DOC_FAM]
5140 . PAGENUM_FAMILY \\*[$DOC_FAM]
5144 \# DOCUMENT POINT SIZE
5145 \# -------------------
5147 \# <point size of running text>
5149 \# Creates or modifies register #DOC_PT_SIZE.
5151 \# DOC_PT_SIZE is the basis for calculating all type sizes in
5154 .MAC DOC_PT_SIZE END
5155 . if \\n[#IGNORE] \{ .return \}
5158 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
5165 \# <lead (".vs") of running text> [ADJUST]
5167 \# Creates or modifies register #DOC_LEAD. If the optional
5168 \# ADJUST argument is given, adjusts leading so that the last
5169 \# line of text falls exactly on #B_MARGIN.
5171 \# DOC_LEAD is the basis for calculating all leading changes in
5172 \# a document. Default for TYPESET is 16; 24 for TYPEWRITE.
5174 \# Because the visible bottom or footer margin of a page depends
5175 \# on the overall document lead supplied by the register #DOC_LEAD,
5176 \# DOC_LEAD, in the body of a document, should always be associated
5177 \# with the start of a new page (in other words, just before or
5178 \# just after a manual NEWPAGE).
5181 . if \\n[#IGNORE] \{ .return \}
5184 . nr #DOC_LEAD \\n[#LEAD]
5185 . if '\\$2'ADJUST' \{ .TRAPS \}
5189 \# ADJUST DOCUMENT LEAD
5190 \# --------------------
5192 \# <none> | <anything>
5194 \# Adjusts document lead so that the last line of text falls exactly
5197 .MAC DOC_LEAD_ADJUST END
5198 . ie '\\$1'' \{ .nr #ADJ_DOC_LEAD 1 \}
5199 . el \{ .nr #ADJ_DOC_LEAD 0 \}
5208 \# Advances to the next "legal" baseline.
5210 \# If a user plays around with spacing in a doc (say, with ALD),
5211 \# it isn't easy to get mom back on track so she can achieve
5212 \# perfectly flush bottom margins. Any time SHIM is used, it
5213 \# ensures that the next output line falls on a legal baseline.
5215 \# First, a little convenience macro
5217 .MAC PROCESS_SHIM END
5218 . while \\n+[#LEGAL_BASELINE]<\\n[#CURRENT_V_POS] \{\
5221 . nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
5225 . nr #CURRENT_V_POS \\n(.d
5226 . nr #LEGAL_BASELINE \\n[#T_MARGIN]-1v \\n[#DOC_LEAD]
5227 . ie r#ADVANCE_FROM_TOP \{\
5228 . ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
5229 . while \\n-[#LEGAL_BASELINE]>\\n[#CURRENT_V_POS] \{\
5232 . nr #LEGAL_BASELINE +\\n[#DOC_LEAD]
5233 . nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
5249 \# L | LEFT | R | RIGHT | C | CENTER | CENTRE | J | JUSTIFY
5251 \# Creates or modifies string $DOC_QUAD.
5253 \# While QUAD (from the typesetting macros) can be used before START
5254 \# to change the default document quad, DOC_QUAD *must* be used after
5255 \# the START macro has been invoked.
5257 \# Default is LEFT for printstyle TYPEWRITE, JUSTIFY for printstyle
5262 . QUAD \\*[$DOC_QUAD]
5265 \# ====================================================================
5267 \# +++INTERNATIONALIZATION+++
5272 \# <what goes in the "by" slot before author in the document header>
5274 \# Creates or modifies string $ATTRIBUTE_STRING.
5276 \# Default is "by". A blank string ("") may be used if no
5277 \# attribution is desired.
5279 .MAC ATTRIBUTE_STRING END
5280 . ds $ATTRIBUTE_STRING \\$1
5287 \# <what to print any time the word "chapter" is required>
5289 \# Creates or modifies string $CHAPTER_STRING.
5291 \# Default is "chapter".
5293 .MAC CHAPTER_STRING END
5294 . ds $CHAPTER_STRING \\$1
5301 \# <what to print any time the word "draft" is required>
5303 \# Creates or modifies string $DRAFT_STRING.
5305 \# Default is "draft".
5307 .MAC DRAFT_STRING END
5308 . ds $DRAFT_STRING \\$1
5315 \# <what to print any time the word "revision" is required>
5317 \# Creates or modifies string $REVISION_STRING.
5319 \# Default is "revision".
5321 .MAC REVISION_STRING END
5322 . ds $REVISION_STRING \\$1
5329 \# <what to print with the finis macro>
5331 \# Creates or modifies string $FINIS_STRING.
5333 \# Default is "END".
5335 .MAC FINIS_STRING END
5338 . ds $FINIS_STRING \\$1
5345 \# <pre-defined XCOLOR or NEWCOLOR>
5347 \# Defines string $FINIS_COLOR to argument.
5349 \# User must define an XCOLOR or NEWCOLOR before using
5352 .MAC FINIS_COLOR END
5353 . if \\n[#PRINT_STYLE]=1 \{ .return \}
5354 . ds $FINIS_COLOR \\$1
5358 \# ====================================================================
5360 \# +++RECTO/VERSO+++
5365 \# <none> | <anything>
5367 \# Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages. Also
5368 \# switches page numbers left and right if either is chosen rather
5369 \# than the default centered page numbers. Switches left and right
5370 \# margins if differing values have been entered.
5374 .MAC RECTO_VERSO END
5375 . ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
5376 . el \{ .nr #RECTO_VERSO 0 \}
5379 \# ====================================================================
5386 \# <family to use for epigraphs>
5388 \# Creates or modifies string $EPI_FAM.
5390 \# Default is same as running text.
5392 .MAC EPIGRAPH_FAMILY END
5400 \# <font to use for epigraphs>
5402 \# Creates or modifies string $EPI_FT.
5404 \# Default is same as running text.
5406 .MAC EPIGRAPH_FONT END
5414 \# <-|+ number of points by which to de/increase point size of epigraphs
5415 \# (relative to running text)>
5417 \# Creates or modifies string $EPI_SIZE_CHANGE.
5419 \# Must be preceded by a - or + sign with no space afterwards.
5420 \# Fractional point sizes are allowed. Default -1.5 for printstyle
5421 \# TYPESET; +0 for TYPEWRITE.
5423 .MAC EPIGRAPH_SIZE END
5424 . ds $EPI_SIZE_CHANGE \\$1
5431 \# <pre-defined XCOLOR or NEWCOLOR>
5433 \# Sets register #EPI_COLOR to 1; defines string
5434 \# $EPI_COLOR to argument.
5436 \# User must define an XCOLOR or NEWCOLOR before using
5439 .MAC EPIGRAPH_COLOR END
5440 . if \\n[#PRINT_STYLE]=1 \{ .return \}
5442 . ds $EPI_COLOR \\$1
5449 \# L | LEFT | J | JUSTIFY
5451 \# Creates or modifies string $EPI_QUAD.
5453 \# Default is $DOC_QUAD when BLOCK argument is passed to EPIGRAPH.
5455 .MAC EPIGRAPH_QUAD END
5463 \# <value by which to multiply PP_INDENT for block epigraphs>
5465 \# Creates or modifies register #EPI_OFFSET_VALUE.
5467 \# Default is 2 for TYPEWRITE, 3 for TYPESET.
5469 .MAC EPIGRAPH_INDENT END
5470 . nr #EPI_OFFSET_VALUE \\$1
5474 \# EPIGRAPH AUTOLEAD
5475 \# -----------------
5477 \# <amount of lead to add to the epigraph ps for epigraph leading>
5479 \# Creates or modifies register #EPI_AUTOLEAD.
5481 \# Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
5483 .MAC EPIGRAPH_AUTOLEAD END
5484 . nr #EPI_AUTOLEAD \\$1
5491 \# BLOCK | <anything>
5493 \# Places an epigraph before the document's text, after the
5494 \# document header, or after a HEAD.
5496 \# #EPIGRAPH 1 = centered; 2 = block
5498 \# By default, epigraphs are centered, allowing the user
5499 \# to input them on a line per line basis. To change this
5500 \# behaviour, the user can supply the argument BLOCK, which
5501 \# will produce indented, filled text similar to BLOCKQUOTE.
5503 \# If a block epigraph contains more than one para, ALL paras of
5504 \# the epigraph must be preceded by PP. Otherwise, PP is optional.
5509 . if \\n[#START] \{\
5510 . if \\n[#PRINT_STYLE]=1 \{\
5511 . if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
5517 . ll \\n[#L_LENGTH]u
5520 . if \\n[#COLUMNS] \{\
5521 . ie \\n[#START] \{\
5522 . ll \\n[#DOC_L_LENGTH]u
5526 . ll \\n[#COL_L_LENGTH]u
5531 . if \\n[#PRINT_STYLE]=1 \{\
5534 . if '\\*[$EPI_FT]'I' \{\
5538 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
5539 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
5540 . nr #EPI_LEAD \\n[#LEAD]
5541 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5543 . if \\n[#PRINT_STYLE]=2 \{\
5544 . FAMILY \\*[$EPI_FAM]
5546 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
5547 . if \\n[#EPI_COLOR]=1 \{\
5552 . AUTOLEAD \\n[#EPI_AUTOLEAD]
5553 . nr #EPI_LEAD \\n[#LEAD]
5554 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5560 . ie '\\$1'BLOCK' \{\
5563 . ie \\n[#START] \{\
5564 . ie \\n[#COLUMNS] \{\
5565 . ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5569 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5574 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5576 . if \\n[#COLUMNS] \{\
5577 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5582 . if \\n[#PRINT_STYLE]=1 \{\
5585 . if '\\*[$EPI_FT]'I' \{\
5589 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
5590 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
5593 . nr #EPI_LEAD \\n[#LEAD]
5594 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5598 . if \\n[#PRINT_STYLE]=2 \{\
5599 . FAMILY \\*[$EPI_FAM]
5601 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
5602 . if \\n[#EPI_COLOR]=1 \{\
5607 . AUTOLEAD \\n[#EPI_AUTOLEAD]
5608 . QUAD \\*[$EPI_QUAD]
5610 . nr #EPI_LEAD \\n[#LEAD]
5611 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5628 \# Ends diversion started in EPIGRAPH. Makes spacing
5629 \# adjustments to compensate for the difference between epigraph
5630 \# leading and overall document leading, so that the bottom of
5631 \# the pages remain flush.
5633 \# In addition to its usual place at the beginning of a
5634 \# document, EPIGRAPH may also be used after HEAD.
5636 .MAC DO_EPIGRAPH END
5641 . nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
5642 . nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
5643 . ie \\n[#START] \{\
5644 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
5645 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5646 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
5648 . if \\n[#PRINT_STYLE]=2 \{\
5649 . RLD \\n[#DOC_LEAD]u
5650 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5651 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
5653 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5654 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5659 . ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
5661 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
5662 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5663 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
5665 . ie \\n[#PRINT_STYLE]=1 \{\
5666 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
5669 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5670 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
5672 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5673 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5678 . nr #EPI_LINES_TO_TRAP 0 1
5679 . while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{\
5682 . nr #EPI_LINES_TO_TRAP -1
5683 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
5684 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5685 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
5687 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
5688 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
5691 . if \\n[#EPIGRAPH]=1 \{\
5692 . po \\n[#L_MARGIN]u
5693 . if \\n[#COLUMNS] \{\
5694 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5695 . nr #L_MARGIN \\n(.o
5698 . if \\n[#EPIGRAPH]=2 \{\
5699 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5700 . if \\n[#COLUMNS] \{\
5701 . nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5703 . po \\n[#EPI_OFFSET]u
5708 . ie \\n[#START] \{\
5709 . if \\n[#PRINT_STYLE]=1 \{\
5710 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
5712 . ie \\n[#EPI_LINES]%2=1 \{ .ALD \\n[#DOC_LEAD]u \}
5713 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
5716 . if \\n[#PRINT_STYLE]=2 \{\
5717 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5718 . ALD \\n[#EPI_WHITESPACE]u/2u
5720 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5721 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5727 . ie \\n[#EPI_FITS] \{\
5728 . ie \\n[#FN_FOR_EPI] \{\
5729 . nr #EPI_LINES_TO_END 1
5730 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
5731 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5732 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
5734 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
5737 . ie \\n[#PRINT_STYLE]=1 \{\
5738 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
5741 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5742 . ALD \\n[#EPI_WHITESPACE]u/2u
5744 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5745 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5751 . nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
5752 . if \\n[#LOOP] \{. nr #EPI_LINES_TO_END +1 \}
5754 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
5755 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5756 . nr #EPI_WHITESPACE -\\n[#DOC_LEAD]
5758 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
5759 . if \\n[#PRINT_STYLE]=1 \{\
5760 . if !\\n[#SINGLE_SPACE] \{\
5761 . nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
5762 . ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
5764 . rr #EPI_LINES_EVEN
5771 . ALD \\n[#DOC_LEAD]u
5772 . QUAD \\*[$DOC_QUAD]
5773 . po \\n[#L_MARGIN]u
5774 . if \\n[#COLUMNS] \{\
5775 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5776 . nr #L_MARGIN \\n(.o
5778 . if \\n[#START] \{\
5779 . if \\n[#COLUMNS] \{\
5780 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5781 . nr #L_MARGIN \\n(.o
5787 \# ====================================================================
5789 \# +++FINIS MACRO+++
5796 \# Deposits --END-- at the end of a document.
5802 . if \\n[#TAB_ACTIVE] \{ .TQ \}
5803 . if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
5804 . if \\n[#FOOTERS_ON] \{\
5805 . nr #FOOTERS_WERE_ON 1
5808 . if \\n[#PAGINATE] \{\
5809 . if \\n[#PAGE_NUM_V_POS]=2 \{\
5810 . nr #PAGINATION_WAS_ON 1
5814 . nr #EM_ADJUST (1m/8)
5815 . if \\n[#COLUMNS] \{\
5816 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5817 . nr #L_MARGIN \\n(.o
5819 . ALD \\n[#DOC_LEAD]u
5821 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
5822 . if \\n[#PRINT_STYLE]=2 \{\
5823 . PRINT "\m[\\*[$FINIS_COLOR]]\v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em\m[]
5828 \# ====================================================================
5830 \# +++HEADERS/FOOTERS+++
5832 \# Define a string so that the current page number can be incorporated
5833 \# into the strings for hdrftr left, right, and center. NOTE: This is
5834 \# not the same thing as using the shortform # in hdrftr strings.
5836 .ds PAGE# \En[#PAGENUMBER]
5842 \# <family to use in header/footers>
5844 \# Creates or modifies string $HDRFTR_FAM.
5846 \# Default is same as running text.
5848 .MAC HDRFTR_FAMILY END
5849 . ds $HDRFTR_FAM \\$1
5856 \# <+|-number of points by which to in/decrease point size of
5857 \# header/footers (relative to running text)>
5859 \# Creates or modifies string $HDRFTR_SIZE_CHANGE.
5861 \# Must be preceded by a +|- sign. No space afterwards.
5862 \# Fractional point sizes are allowed. Default is +0.
5864 \# By default, header/footers print the author .5 points smaller
5865 \# than the base point size of running text, center titles
5866 \# (Chapter, Draft, Revision, etc.) .5 points smaller
5867 \# than running text (in italics), and the document title 2 full
5868 \# points smaller than running text (in caps). The HDRFTR_SIZE
5869 \# macro changes the overall size for all three parts while
5870 \# maintaining the internal size changes.
5872 \# In other words, if the user likes the header/footers but wants
5873 \# them a bit bigger or a bit smaller, s/he should use HDRFTR_SIZE.
5875 .MAC HDRFTR_SIZE END
5876 . ds $HDRFTR_SIZE_CHANGE \\$1
5883 \# <pre-defined XCOLOR or NEWCOLOR>
5885 \# Sets register #HDRFTR_COLOR to 1; defines string $HDRFTR_COLOR to
5888 \# User must define an XCOLOR or NEWCOLOR before using
5891 .MAC HDRFTR_COLOR END
5892 . if \\n[#PRINT_STYLE]=1 \{ .return \}
5893 . nr #HDRFTR_COLOR 1
5894 . ds $HDRFTR_COLOR \\$1
5901 \# <amount of space between header/footer and header/footer rule>
5903 \# Creates or modifies register #HDRFTR_RULE_GAP to hold amount
5904 \# of space between header/footer and header/footer rule.
5908 .MAC HDRFTR_RULE_GAP END
5909 . nr #HDRFTR_RULE_GAP (\\$1)
5916 \# <what to put in the left position of page header/footers>
5918 \# Creates or modifies string $HDRFTR_LEFT.
5919 \# Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
5920 \# overrides the $HDRFTR_LEFT string created by default
5923 \# Especially useful if doc has more than one author, and a list
5924 \# of authors by last name is desired in header/footers.
5925 \# Default is author.
5927 \# If the argument is the # character, simply prints the current
5930 \# If the user wants to *incorporate* the page number into the string,
5931 \# \*[PAGE#] must be used. For example, if the user wants to put
5932 \# an elipsis before the page number in the string, s/he should use
5933 \# ...\*[PAGE#], not ...#
5935 .MAC HDRFTR_LEFT END
5936 . nr #USER_DEF_HDRFTR_LEFT 1
5937 . ds $HDRFTR_LEFT \\$1
5941 \# HDRFTR LEFT FAMILY
5942 \# ------------------
5944 \# <family of header/footer left string>
5946 \# Creates or modifies string $HDRFTR_LEFT_FAM.
5948 .MAC HDRFTR_LEFT_FAMILY END
5949 . ds $HDRFTR_LEFT_FAM \\$1
5956 \# <font of header/footer left string>
5958 \# Creates or modifies string $HDRFTR_LEFT_FT.
5960 .MAC HDRFTR_LEFT_FONT END
5961 . ds $HDRFTR_LEFT_FT \\$1
5968 \# <+|- number of points to in/decrease size of left string in
5969 \# header/footers (relative to running text)>
5971 \# Creates or modifies string HDRFTR_LEFT_SIZE_CHANGE.
5973 \# Must be preceded by a +|- sign. No space afterwards.
5974 \# Fractional point sizes are allowed.
5975 \# Default is -.5 for printstyle TYPESET; if all caps, -2
5976 \# Has no effect in TYPEWRITE.
5978 .MAC HDRFTR_LEFT_SIZE END
5979 . ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5983 \# HDRFTR LEFT COLOR
5984 \# -----------------
5986 \# <pre-defined color name>
5988 \# Sets register #HDRFTR_LEFT_COLOR to 1; creates string
5989 \# $HDRFTR_LEFT_COLOR
5991 \# The color name must be pre-defined with NEWCOLOR or XCOLOR.
5993 .MAC HDRFTR_LEFT_COLOR END
5994 . nr #HDRFTR_LEFT_COLOR 1
5995 . ds $HDRFTR_LEFT_COLOR \\$1
6002 \# <none> | <anything>
6004 \# Turns capitalisation of $HDRFTR_LEFT (typically, the author of
6005 \# the document) on or off.
6009 .MAC HDRFTR_LEFT_CAPS END
6011 . nr #HDRFTR_LEFT_CAPS 1
6014 . nr #HDRFTR_LEFT_CAPS 0
6015 . ds $HDRFTR_LEFT_SIZE_CHANGE +0
6023 \# <what to put in the centre position of page header/footers>
6025 \# Creates or modifies string $HDRFTR_CENTER.
6026 \# Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
6027 \# overrides the $HDRFTR_CENTER string created by default
6030 \# Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
6031 \# CHAPTER, draft and revision number if COPYSTYLE DRAFT.
6033 \# If the argument is the # character, simply prints the current
6036 \# If the user wants to *incorporate* the page number into the string,
6037 \# \*[PAGE#] must be used. For example, if the user wants to put
6038 \# an elipsis before the page number in the string, s/he should use
6039 \# ...\*[PAGE#], not ...#
6041 .MAC HDRFTR_CENTER END
6042 . nr #USER_DEF_HDRFTR_CENTER 1
6043 . if '\\$0'FOOTER_CENTER' \{\
6044 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
6045 . ds $HDRFTR_CENTER_NEW \\$1
6047 . if '\\$0'FOOTER_CENTRE' \{\
6048 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
6049 . ds $HDRFTR_CENTER_NEW \\$1
6051 . ds $HDRFTR_CENTER \\$1
6055 \# HDRFTR CENTER FAMILY
6056 \# --------------------
6058 \# <family of header/footer center string>
6060 \# Creates or modifies string $HDRFTR_CENTER_FAM.
6062 .MAC HDRFTR_CENTER_FAMILY END
6063 . ds $HDRFTR_CENTER_FAM \\$1
6067 \# HDRFTR CENTER FONT
6068 \# ------------------
6070 \# <font of header/footer center string>
6072 \# Creates or modifies string $HDRFTR_CENTER_FT.
6074 .MAC HDRFTR_CENTER_FONT END
6075 . ds $HDRFTR_CENTER_FT \\$1
6079 \# HDRFTR CENTER SIZE
6080 \# ------------------
6082 \# <+|- number of points to in/decrease size of centre string in
6083 \# header/footers (relative to header/footer size)>
6085 \# Creates string HDRFTR_CENTER_SIZE_CHANGE.
6087 \# Must be preceded by a +|- sign. No space afterwards.
6088 \# Fractional point sizes are allowed.
6089 \# Default is -.5 for printstyle TYPESET; if all caps, -2
6090 \# Has no effect in TYPEWRITE.
6092 .MAC HDRFTR_CENTER_SIZE END
6093 . ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
6097 \# HDRFTR CENTER COLOR
6098 \# -------------------
6100 \# <pre-defined color name>
6102 \# Sets register #HDRFTR_CENTER_COLOR to 1; creates string
6103 \# $HDRFTR_CENTER_COLOR
6105 \# The color name must be pre-defined with NEWCOLOR or XCOLOR.
6107 .MAC HDRFTR_CENTER_COLOR END
6108 . nr #HDRFTR_CENTER_COLOR 1
6109 . ds $HDRFTR_CENTER_COLOR \\$1
6113 \# HDRFTR CENTER CAPS
6114 \# ------------------
6116 \# <none> | <anything>
6118 \# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
6119 \# the document) on or off.
6123 .MAC HDRFTR_CENTER_CAPS END
6125 . nr #HDRFTR_CENTER_CAPS 1
6128 . nr #HDRFTR_CENTER_CAPS 0
6129 . ds $HDRFTR_CENTER_SIZE_CHANGE +0
6134 \# HDRFTR CENTER PADDING
6135 \# ---------------------
6137 \# LEFT | RIGHT <amount of padding to put left or right of hdrftr
6140 \# Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
6141 \# #HDRFTR_CTR_PAD_RIGHT.
6143 \# By default, the HDRFTR_CENTER string is centered on the doc
6144 \# line length. Long titles or long author names can screw up
6145 \# visual centering, or create overprints. This macro allows the
6146 \# user to pad the center string by the specified amount of space
6147 \# to fix these problems. Use only one of LEFT or RIGHT.
6149 \# A unit of measure is required.
6151 .MAC HDRFTR_CENTER_PAD END
6152 . if '\\$1'LEFT' \{\
6153 . nr #HDRFTR_CTR_PAD_LEFT (\\$2)
6155 . if '\\$1'RIGHT' \{\
6156 . nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
6161 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
6162 \# --------------------------------
6166 \# Switches the padding side of hdrftr center padding.
6168 \# Required to keep spacing around hdrftr string constant
6169 \# in recto/verso documents.
6171 .MAC SWITCH_HDRFTR_CENTER_PAD END
6172 . nr #HDRFTR_CTR_PAD_TMP \\n[#HDRFTR_CTR_PAD_LEFT]
6173 . HDRFTR_CENTER_PAD LEFT \\n[#HDRFTR_CTR_PAD_RIGHT]u
6174 . HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
6181 \# <what to put in the right position of page header/footers>
6183 \# Creates or modifies string $HDRFTR_RIGHT.
6184 \# Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
6185 \# overrides the $HDRFTR_RIGHT string created by default
6188 \# Default is document title.
6190 \# If the argument is the # character, simply prints the current
6193 \# If the user wants to *incorporate* the page number into the string,
6194 \# \*[PAGE#] must be used. For example, if the user wants to put
6195 \# an elipsis before the page number in the string, s/he should use
6196 \# ...\*[PAGE#], not ...#
6198 .MAC HDRFTR_RIGHT END
6199 . nr #USER_DEF_HDRFTR_RIGHT 1
6200 . ds $HDRFTR_RIGHT \\$1
6204 \# HDRFTR RIGHT FAMILY
6205 \# -------------------
6207 \# <family of header/footer right string>
6209 \# Creates or modifies string $HDRFTR_RIGHT_FAM.
6211 .MAC HDRFTR_RIGHT_FAMILY END
6212 . ds $HDRFTR_RIGHT_FAM \\$1
6216 \# HDRFTR RIGHT FONT
6217 \# -----------------
6219 \# <font of header/footer right string>
6221 \# Creates or modifies string $HDRFTR_RIGHT_FT.
6223 .MAC HDRFTR_RIGHT_FONT END
6224 . ds $HDRFTR_RIGHT_FT \\$1
6228 \# HDRFTR RIGHT SIZE
6229 \# -----------------
6231 \# <+|- number of points to in/decrease size of right string in
6232 \# header/footers (relative to header/footer size)>
6234 \# Creates or modifies string HDRFTR_RIGHT_SIZE_CHANGE.
6236 \# Must be preceded by a +|- sign. No space afterwards.
6237 \# Fractional point sizes are allowed.
6238 \# Default is -2 for printstyle TYPESET if all caps; otherwise -.5
6239 \# Has no effect in TYPEWRITE.
6241 .MAC HDRFTR_RIGHT_SIZE END
6242 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
6246 \# HDRFTR RIGHT COLOR
6247 \# ------------------
6249 \# <pre-defined color name>
6251 \# Sets register #HDRFTR_RIGHT_COLOR to 1; creates string
6252 \# $HDRFTR_RIGHT_COLOR
6254 \# The color name must be pre-defined with NEWCOLOR or XCOLOR.
6256 .MAC HDRFTR_RIGHT_COLOR END
6257 . nr #HDRFTR_RIGHT_COLOR 1
6258 . ds $HDRFTR_RIGHT_COLOR \\$1
6262 \# HDRFTR RIGHT CAPS
6263 \# -----------------
6265 \# <none> | <anything>
6267 \# Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
6268 \# the document) on or off.
6272 .MAC HDRFTR_RIGHT_CAPS END
6274 . nr #HDRFTR_RIGHT_CAPS 1
6277 . nr #HDRFTR_RIGHT_CAPS 0
6278 . ds $HDRFTR_RIGHT_SIZE_CHANGE +0
6283 \# HDRFTR RULE COLOR
6284 \# -----------------
6286 \# <pre-defined XCOLOR or NEWCOLOR>
6288 \# Sets register #HDRFTR_COLOR to 1; defines string
6289 \# $HDRFTR_RULE_COLOR to argument.
6291 \# User must define an XCOLOR or NEWCOLOR before using
6292 \# HDRFTR_RULE_COLOR.
6294 .MAC HDRFTR_RULE_COLOR END
6295 . if \\n[#PRINT_STYLE]=1 \{ .return \}
6296 . nr #HDRFTR_RULE_COLOR 1
6297 . ds $HDRFTR_RULE_COLOR \\$1
6304 \# <none> | <anything>
6306 \# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
6307 \# under the header/footer. Otherwise, turns HDRFTR_RULE on or off.
6309 .MAC HDRFTR_RULE END \"To print rule under header/over footer.
6310 . ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
6311 . ie \\n[#USERDEF_HDRFTR] \{\
6312 . nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
6314 . if \\n[#HEADERS_ON] \{\
6316 . ALD \\n[#HDRFTR_RULE_GAP]u
6318 . if \\n[#FOOTERS_ON] \{\
6320 . RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
6322 . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
6323 . PRINT \m[\\*[$HDRFTR_RULE_COLOR]]\\l'\\n[#DOC_L_LENGTH]u'\m[]
6326 . PRINT \\l'\\n[#DOC_L_LENGTH]u'
6331 . if \\n[#PRINT_STYLE]=1 \{\
6332 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
6334 . if \\n[#PRINT_STYLE]=2 \{\
6335 . ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
6336 . nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
6338 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
6339 . ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
6340 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
6342 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
6345 . if \\n[#HEADERS_ON] \{\
6347 . ALD \\n[#HDRFTR_RULE_GAP]u
6349 . if \\n[#FOOTERS_ON] \{\
6351 . RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
6353 . ie \\n[#HDRFTR_RULE_COLOR]=1 \{\
6354 . PRINT \m[\\*[$HDRFTR_RULE_COLOR]]\\l'\\n[#DOC_L_LENGTH]u'\m[]
6357 . PRINT \\l'\\n[#DOC_L_LENGTH]u'
6363 . ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
6364 . el \{ .nr #HDRFTR_RULE 0 \}
6369 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
6377 \# Sets the family, font, and point size of all strings in
6378 \# header/footers to the same family and point size as running
6379 \# text. Font for the header/footer becomes roman throughout.
6381 .MAC HDRFTR_PLAIN END
6382 . HDRFTR_FAMILY \\*[$DOC_FAM]
6383 . HDRFTR_PT_SIZE \\n[#DOC_PT_SIZE]
6384 . HDRFTR_LEFT_FAMILY \\*[$DOC_FAM]
6385 . HDRFTR_LEFT_FONT R
6386 . HDRFTR_LEFT_SIZE +0
6387 . HDRFTR_LEFT_CAPS OFF
6388 . HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
6389 . HDRFTR_CENTER_FONT R
6390 . HDRFTR_CENTER_SIZE +0
6391 . HDRFTR_CENTER_CAPS OFF
6392 . HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]
6393 . HDRFTR_RIGHT_FONT R
6394 . HDRFTR_RIGHT_SIZE +0
6395 . HDRFTR_RIGHT_CAPS OFF
6402 \# <none> | <anything>
6404 \# Creates or modifies register #SWITCH_HDRFTR, used to switch
6405 \# default location of HDRFTR_LEFT and HDRFTR_RIGHT.
6407 \# Typically, the author string appears at the left of header/footers,
6408 \# and the title string appears at the right. This switches the
6409 \# location of the two. Useful in conjuction with RECTO_VERSO to
6410 \# tweak switches on alternate pages to come out as the user wishes.
6411 \# The assumption of RECTO_VERSO is that the first page of the document
6412 \# (recto) is odd, and even though it has no header/footer, if it did have one,
6413 \# it would print as AUTHOR...CENTER...TITLE (or whatever strings
6414 \# the user has supplied for HDRFTR_LEFT/RIGHT), meaning that the
6415 \# next page, which does have a header/footer, will come out as
6416 \# TITLE...CENTER...AUTHOR (or whatever strings the user has
6417 \# supplied for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user
6418 \# to get the desired string in the desired place on the desired
6419 \# recto/verso page.
6423 .MAC SWITCH_HDRFTR END
6424 . ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
6425 . el \{ .nr #SWITCH_HDRFTR 0 \}
6429 \# USER DEFINED HDRFTR RECTO
6430 \# -------------------------
6432 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
6434 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
6435 \# stores string in $USERDEF_HDRFTR_RECTO.
6437 \# For use when users don't want 3-part headers/footers, but rather
6438 \# want to design their own headers/footers and need different
6439 \# headers/footers on recto and verso pages. Using just
6440 \# HEADER_RECTO, even when recto/verso is not on, allows users to
6441 \# design their own headers/footers for doc pages.
6443 .MAC HDRFTR_RECTO END
6444 . nr #USERDEF_HDRFTR 1
6445 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
6446 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
6447 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
6448 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
6449 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
6450 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
6451 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
6452 . ds $USERDEF_HDRFTR_RECTO \\$2
6456 \# USER DEFINED HDRFTR VERSO
6457 \# -------------------------
6459 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
6461 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
6462 \# stores string in $USERDEF_HDRFTR_VERSO.
6464 \# For use when users don't want 3-part headers/footers, but rather
6465 \# want to design their own headers/footers and need different
6466 \# headers/footers on recto and verso pages.
6468 .MAC HDRFTR_VERSO END
6469 . nr #USERDEF_HDRFTR 1
6470 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
6471 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
6472 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
6473 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
6474 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
6475 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
6476 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
6477 . ds $USERDEF_HDRFTR_VERSO \\$2
6481 \# PRINT FOOTER ON FIRST PAGE
6482 \# --------------------------
6484 \# <none> | <anything>
6486 \# Toggles register #PRINT_FOOTER_ON_PAGE_1
6488 \# Lets user choose whether to print footer on first
6491 .MAC FOOTER_ON_FIRST_PAGE END
6492 . ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
6493 . el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
6497 \# PRINT PAGE NUMBER ON FIRST PAGE
6498 \# -------------------------------
6500 \# <none> | <anything>
6502 \# Toggles register #PRINT_PAGENUM_ON_PAGE_1
6504 \# Lets user choose whether to print page number on first
6505 \# page of doc and after collate when footers are on or page numbering
6506 \# has been user set at top of page.
6508 .MAC PAGENUM_ON_FIRST_PAGE END
6509 . ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
6510 . el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
6514 \# PRINT HEADER/FOOTER
6515 \# -------------------
6519 \# Based on defaults or values entered by user, prints a
6520 \# three-part title at either the top or the bottom of the page.
6522 \# Called from within either HEADER or FOOTER.
6524 .MAC PRINT_HDRFTR END
6525 . if \\n[#DOC_TYPE]=4 \{\
6526 . nr #SUITE \En[.pn]
6528 . if \\n[#FOOTERS_ON] \{\
6529 . if \\n[#START_FOR_FOOTERS] \{\
6530 . rr #START_FOR_FOOTERS
6531 . if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{ .return \}
6534 . if \\n[#USERDEF_HDRFTR] \{\
6535 . PRINT_USERDEF_HDRFTR
6538 . if \\n[#SWITCH_HDRFTR] \{\
6539 . ds $HDRFTR_TMP_SWITCH \\*[$HDRFTR_LEFT]
6540 . ds $HDRFTR_LEFT \\*[$HDRFTR_RIGHT]
6541 . ds $HDRFTR_RIGHT \\*[$HDRFTR_TMP_SWITCH]
6542 . ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
6543 . ds $HDRFTR_LEFT_SIZE_CHANGE \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
6544 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
6545 . nr #HDRFTR_TMP_CAPS_SWITCH \\n[#HDRFTR_LEFT_CAPS]
6546 . nr #HDRFTR_LEFT_CAPS \\n[#HDRFTR_RIGHT_CAPS]
6547 . nr #HDRFTR_RIGHT_CAPS \\n[#HDRFTR_TMP_CAPS_SWITCH]
6548 . ds $HDRFTR_TMP_COLOR_SWITCH \\*[$HDRFTR_LEFT_COLOR]
6549 . ds $HDRFTR_LEFT_COLOR \\*[$HDRFTR_RIGHT_COLOR]
6550 . ds $HDRFTR_RIGHT_COLOR \\*[$HDRFTR_TMP_COLOR_SWITCH]
6551 . rr #HDRFTR_TMP_CAPS_SWITCH
6552 . rm $HDRFTR_TMP_SWITCH
6553 . rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
6554 . rm $HDRFTR_TMP_COLOR_SWITCH
6555 . nr #SWITCH_HDRFTR 0
6557 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
6558 . if \\n[#ENDNOTES] \{ .PAGENUM_STYLE \\*[$EN_PN_STYLE] \}
6559 . if \\n[#PRINT_STYLE]=1 \{\
6560 . if \\n[#FOOTERS_ON] \{\
6563 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6568 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
6569 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
6570 . ie '\\*[$HDRFTR_LEFT]'#' \{\
6571 . PRINT \\n[#PAGENUMBER]
6574 . ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
6575 . el \{ .PRINT \& \}
6577 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
6579 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
6581 . ie '\\*[$HDRFTR_CENTER]'#' \{\
6582 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
6585 . ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
6586 . el \{ .PRINT \& \}
6588 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
6591 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
6592 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
6594 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
6595 . PRINT \\n[#PAGENUMBER]
6598 . ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \\*[$HDRFTR_RIGHT] \}
6599 . el \{ .PRINT \& \}
6601 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
6603 . if \\n[#PRINT_STYLE]=2 \{\
6604 . if \\n[#HDRFTR_COLOR]=1 \{\
6606 \m[\\*[$HDRFTR_COLOR]]
6609 . fam \\*[$HDRFTR_LEFT_FAM]
6610 . ft \\*[$HDRFTR_LEFT_FT]
6611 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
6613 . if \\n[#FOOTERS_ON] \{\
6616 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6621 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
6622 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
6623 . ie '\\*[$HDRFTR_LEFT]'#' \{\
6624 . ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
6625 . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\n[#PAGENUMBER]\m[]
6628 . PRINT \\n[#PAGENUMBER]
6632 . ie !'\\*[$HDRFTR_LEFT]'' \{\
6633 . ie \\n[#HDRFTR_LEFT_COLOR]=1 \{\
6634 . PRINT \m[\\*[$HDRFTR_LEFT_COLOR]]\\*[$HDRFTR_LEFT]\m[]
6637 . PRINT \\*[$HDRFTR_LEFT]
6640 . el \{ .PRINT \& \}
6642 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
6643 . fam \\*[$HDRFTR_CENTER_FAM]
6644 . ft \\*[$HDRFTR_CENTER_FT]
6645 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
6647 . if \\n[#FOOTERS_ON] \{\
6650 . nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
6654 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
6656 . ie '\\*[$HDRFTR_CENTER]'#' \{\
6657 . ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
6658 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
6661 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
6665 . ie !'\\*[$HDRFTR_CENTER]'' \{\
6666 . ie \\n[#HDRFTR_CENTER_COLOR]=1 \{\
6667 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\m[\\*[$HDRFTR_CENTER_COLOR]]\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'\m[]
6670 . PRINT \\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
6673 . el \{ .PRINT \& \}
6675 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
6676 . fam \\*[$HDRFTR_RIGHT_FAM]
6677 . ft \\*[$HDRFTR_RIGHT_FT]
6678 . ps \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
6680 . if \\n[#FOOTERS_ON] \{\
6683 . nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6688 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
6689 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
6691 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
6692 . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
6693 . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\n[#PAGENUMBER]\m[]
6696 . PRINT \\n[#PAGENUMBER]
6700 . ie !'\\*[$HDRFTR_RIGHT]'' \{\
6701 . ie \\n[#HDRFTR_RIGHT_COLOR]=1 \{\
6702 . PRINT \m[\\*[$HDRFTR_RIGHT_COLOR]]\\*[$HDRFTR_RIGHT]\m[]
6705 . PRINT \\*[$HDRFTR_RIGHT]
6708 . el \{ .PRINT \& \}
6710 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
6712 . if \\n[#HDRFTR_RULE] \{\
6713 . HDRFTR_RULE_INTERNAL
6718 \# PRINT USER DEFINED HEADER/FOOTER
6719 \# --------------------------------
6723 \# Based on defaults or values entered by user, prints a single part
6724 \# (i.e. not 3-part) title at either the top or the bottom of the page.
6726 \# Called from within PRINT_HDRFTR.
6728 .MAC PRINT_USERDEF_HDRFTR END
6729 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
6731 . if \\n[#PRINT_STYLE]=2 \{\
6732 . FAMILY \\*[$HDRFTR_FAM]
6734 . PT_SIZE \\n[#HDRFTR_PT_SIZE]u
6735 . if \\n[#HDRFTR_COLOR]=1 \{\
6737 . COLOR \\*[$HDRFTR_COLOR]
6740 . ie \\n[#RECTO_VERSO] \{\
6742 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
6743 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6744 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
6745 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
6747 . if \\n[#FOOTERS_ON] \{\
6750 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6755 . ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
6756 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT \}
6757 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
6758 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT \}
6759 . PRINT \\*[$USERDEF_HDRFTR_VERSO]
6761 . if \\n[#FOOTERS_ON] \{\
6764 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6769 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
6770 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6771 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
6772 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
6774 . if \\n[#FOOTERS_ON] \{\
6777 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6784 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
6785 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6786 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
6787 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
6789 . if \\n[#FOOTERS_ON] \{\
6792 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6797 . if \\n[#PRINT_STYLE]=2 \{\
6798 . ie \\n[#HDRFTR_COLOR]=1 \m[\\*[$HDRFTR_COLOR]]
6801 . if \\n[#HDRFTR_RULE] \{\
6802 . HDRFTR_RULE_INTERNAL
6809 \# HEADERS (off or on)
6810 \# -------------------
6812 \# <none> | <anything>
6814 \# Turns headers at the top of the page off or on.
6819 . ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
6820 . el \{ .nr #HEADERS_ON 0 \}
6827 \# <amount of space between top of page and header>
6829 \# Creates or modifies register #HEADER_MARGIN to hold amount
6830 \# of space between top of page and header.
6832 \# Requires unit of measure. Default is 4P+6p, measured top-of-page
6835 .MAC HEADER_MARGIN END
6836 . nr #HEADER_MARGIN (\\$1)
6843 \# <amount of space between header and running text>
6845 \# Creates or modifies register #HEADER_GAP to hold amount
6846 \# of space between header and running text.
6848 \# Default is 1P+6p.
6851 . nr #HEADER_GAP (\\$1)
6860 \# Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
6862 \# In order to convert the title string to caps in the header (in the
6863 \# event that the user enters .TITLE in caps/lc), I've used
6864 \# quad left, quad centre, and quad right to arrange the three bits
6865 \# of the header, rather than .tl. This allows the use of the CAPS macro.
6866 \# The downside is that I have to add \\v'-(\\n[#LEAD]u*#) in order
6867 \# for -Tlatin1 output to align the header/footer strings on the baseline.
6868 \# The console output still isn't brilliant, but at least it's
6872 . PROCESS_FN_LEFTOVER
6873 . nr #FN_COUNT_FOR_COLS 0 1
6874 . if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
6875 . po \\n[#DOC_L_MARGIN]u
6876 . if \\n[#RECTO_VERSO] \{\
6877 . if !\\n[#TOC_RV_SWITCH] \{\
6878 . nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
6879 . DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u
6880 . DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
6881 . SWITCH_HDRFTR_CENTER_PAD
6886 . if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
6887 . sp |\\n[#HEADER_MARGIN]u-1v
6889 . ll \\n[#DOC_L_LENGTH]u
6891 . if \\n[#PRINT_STYLE]=1 \{\
6894 . ps 12\\*[$HDRFTR_SIZE_CHANGE]
6896 . if \\n[#PRINT_STYLE]=2 \{\
6897 . fam \\*[$HDRFTR_FAM]
6899 . ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
6902 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
6903 . if \\n[#CAPS_ON] \{\
6907 . if \\n[#UNDERLINE_ON] \{\
6908 . nr #UNDERLINE_WAS_ON 1
6911 . if \\n[#PRINT_STYLE]=1 \{\
6912 . if \\n[#ENDNOTES]=1 \{\
6913 . if \\n[#EN_SINGLESPACE] \{\ \"Endnotes s-spaced have different lead
6914 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
6915 . nr #DOC_LEAD \\n[#EN_LEAD]u
6919 . ie \\n[#HEADERS_ON] \{\
6921 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
6924 . ie \\n[#PAGE_NUM_V_POS]=1 \{\
6925 . ie \\n[#PAGINATE] \{\
6927 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
6929 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
6931 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
6933 . if \\n[#PRINT_STYLE]=1 \{\
6934 . if \\n[#ENDNOTES]=1 \{\
6935 . if \\n[#EN_SINGLESPACE] \{\
6936 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
6937 . rr #RESTORE_DOC_LEAD
6941 . nr #PAGE_TOP \\n(nl
6943 . po \\n[#L_MARGIN]u
6944 . if \\n[#RECTO_VERSO] \{\
6945 . nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
6947 . if \\n[#CAPS_WAS_ON] \{\
6951 . if \\n[#UNDERLINE_WAS_ON] \{\
6953 . rr #UNDERLINE_WAS_ON
6955 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6956 . if \\n[#QUOTE] \{\
6957 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6959 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
6960 . po \\n[#Q_OFFSET]u
6963 . if \\n[#EPIGRAPH] \{\
6964 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6966 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6967 . po \\n[#EPI_OFFSET]u
6970 . ie \\n[#EPIGRAPH] \{\
6971 . ie !\\n[#EPI_ACTIVE] \{\
6976 . ie \\n[#EPI_FITS] \{ .ns \}
6977 . el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
6982 . if \\n[#COLUMNS] \{\
6983 . nr #L_MARGIN \\n[#DOC_L_MARGIN]
6984 . if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
6987 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6988 . nr #L_MARGIN \\n(.o
6989 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6990 . ll \\n[#COL_L_LENGTH]u
6992 . if \\n[#QUOTE] \{\
6993 . po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
6995 . if \\n[#EPIGRAPH] \{\
6996 . if \\n[#EPI_ACTIVE] \{\
6997 . ie \\n[#EPI_FITS] \{ . \}
6998 . el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
7000 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
7003 . if \\n[#PRINT_STYLE]=1 \{\
7004 . if \\n[#SLANT_ON] \{\
7005 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
7010 \# ====================================================================
7014 \# FOOTERS (off or on)
7015 \# -------------------
7017 \# <none> | <anything>
7019 \# Turns footers at the bottom of the page off or on.
7021 \# Default is off. If on, page numbers automatically go at
7022 \# the top, centered, unless pagination has been turned off,
7023 \# or the pagenumber position has been changed to left or right.
7028 . PAGE_NUM_POS TOP CENTER
7030 . el \{ .nr #FOOTERS_ON 0 \}
7039 \# Creates or modifies register #FOOTER_MARGIN which holds the
7040 \# amount of space to leave between the page number and the bottom
7043 \# Unit of measure required. Default is 3P.
7045 .MAC FOOTER_MARGIN END
7046 . ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
7054 \# <distance from end of running text to page # or footer>
7056 \# Creates or modifies register #FOOTER_GAP which holds the
7057 \# amount of space to leave between running text and the page number.
7059 \# Requires unit of measure. Default is 3P. Measured baseline to
7063 . ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
7073 \# Places footer at bottom of page if #FOOTERS=1, otherwise
7074 \# places page number at bottom of page (if #PAGINATE=1).
7075 \# Page numbers are in arabic or roman according to COPYSTYLE.
7076 \# DRAFT starts the document at page 1 regardless of PAGENUMBER.
7077 \# FINAL respects PAGENUMBER.
7081 \# Removed this next bit; can't figure out why I needed it.
7082 \#. if \\n[#START]=1 \{\
7088 . nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
7089 . if !\\n[#FN_DEFER] \{\
7091 . if \\n[#FN_COUNT] \{\
7092 . sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u)
7093 . po \\n[#DOC_L_MARGIN]u
7094 . if \\n[#COLUMNS] \{\
7095 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
7096 . nr #L_MARGIN \\n(.o
7101 . if '\\n(.z'FN_OVERFLOW' \{\
7103 . nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
7106 . if \\n[#COL_NEXT] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
7109 . ie \\n[#COLUMNS] \{\
7110 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
7112 . ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
7113 . el \{ .sp |\\n(dcu \}
7114 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
7115 . nr #L_MARGIN \\n(.o
7116 . PROCESS_FN_LEFTOVER
7117 . if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
7118 . if !\\n[#QUOTE] \{ .rr #COL_NEXT \}
7119 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7120 . if \\n[#QUOTE] \{\
7121 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7123 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
7124 . if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
7125 . po \\n[#Q_OFFSET]u
7128 . if \\n[#EPIGRAPH] \{\
7129 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7131 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
7132 . if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
7133 . po \\n[#EPI_OFFSET]u
7136 . ie \\n[#EPIGRAPH] \{\
7137 . ie !\\n[#EPI_ACTIVE] \{\
7142 . sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
7151 . el \{ .DO_FOOTER \}
7160 \# Prints footer (page number, or 3-part footer).
7161 \# Resets CAPS and UNDERLINE if they were on.
7164 . ie (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
7169 . sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
7173 . po \\n[#DOC_L_MARGIN]u
7174 . ll \\n[#DOC_L_LENGTH]u
7176 . FAMILY \\*[$HDRFTR_FAM]
7178 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
7179 . if \\n[#PRINT_STYLE]=1 \{\
7184 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
7185 . if \\n[#CAPS_ON] \{\
7189 . if \\n[#UNDERLINE_ON] \{\
7190 . nr #UNDERLINE_WAS_ON 1
7193 . ie \\n[#FOOTERS_ON] \{\
7194 . if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_HDRFTR \}
7197 . if \\n[#PAGINATE] \{\
7198 . if \\n[#PAGE_NUM_V_POS]=2 \{\
7199 . if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_PAGE_NUMBER \}
7204 . if \\n[#CAPS_WAS_ON] \{\
7208 . if \\n[#UNDERLINE_WAS_ON] \{\
7210 . rr #UNDERLINE_WAS_ON
7217 \# ====================================================================
7221 \# ---Head numbers---
7226 \# <none> | <anything>
7228 \# Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
7232 .MAC NUMBER_HEADS END
7235 . if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
7237 . el \{ .rr #NUMBER_HEAD \}
7241 \# RESET HEAD NUMBER
7242 \# -----------------
7244 \# <none> | <desired head number>
7246 \# Resets incrementing register #HEAD_NUM to 1 or, if there's
7247 \# an argument, to user supplied number.
7249 \# Also resets subhead and parahead numbers. If this is not
7250 \# desired, subhead and parahead numbers may be reset individually.
7252 .MAC RESET_HEAD_NUMBER END
7259 . nr #HEAD_NUM \\$1-1 1
7269 \# <none> | <anything>
7271 \# Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
7275 .MAC NUMBER_SUBHEADS END
7278 . if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
7280 . el \{ .rr #NUMBER_SH \}
7284 \# RESET SUBHEAD NUMBER
7285 \# --------------------
7287 \# <none> | <desired subhead number>
7289 \# Resets incrementing register #SH_NUM to 1 or, if there's
7290 \# an argument, to user supplied number.
7292 \# When the subhead number is reset, it resets the parahead number as
7293 \# well. If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
7294 \# allows the user to set the parahead number to whatever s/he desires.
7296 .MAC RESET_SUBHEAD_NUMBER END
7297 . ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
7299 . nr #SH_NUM \\$1-1 1
7308 \# <none> | <anything>
7310 \# Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
7314 .MAC NUMBER_PARAHEADS END
7317 . if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
7319 . el \{ .rr #NUMBER_PH \}
7323 \# RESET PARAHEAD NUMBER
7324 \# ---------------------
7326 \# <none> | <desired parahead number>
7328 \# Resets incrementing register #PH_NUM to 1 or, if there's
7329 \# an argument, to user supplied number.
7331 \# Resetting the parahead number resets the parahead number
7334 .MAC RESET_PARAHEAD_NUMBER END
7335 . ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
7336 . el \{ nr #SH_NUM \\$1-1 1 \}
7345 \# <family to use for section titles (main heads)>
7347 \# Creates or modifies string $HEAD_FAM.
7349 \# Default is same as running text.
7351 .MAC HEAD_FAMILY END
7359 \# <font to use for section titles (main heads)>
7361 \# Creates or modifies string $HEAD_FT.
7373 \# <+|- number of points by which to in/decrease point size of
7374 \# section titles (relative to running text)>
7376 \# Creates or modifies string $HEAD_SIZE_CHANGE.
7378 \# Must be preceded by a - or + sign with no space afterwards.
7379 \# Fractional point sizes are allowed.
7380 \# Default +1 for printstyle TYPESET; +0 for TYPEWRITE.
7383 . ds $HEAD_SIZE_CHANGE \\$1
7390 \# L | LEFT | R | RIGHT | C | CENTER | CENTRE
7392 \# Creates or modifies string $HEAD_QUAD.
7394 \# Default is CENTER.
7397 . ds $HEAD_QUAD \\$1
7404 \# <none> | <anything>
7406 \# Creates or modifies register #HEAD_CAPS.
7411 . ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
7412 . el \{ .nr #HEAD_CAPS 0 \}
7419 \# <pre-defined XCOLOR or NEWCOLOR>
7421 \# Defines string $HEAD_COLOR to argument.
7423 \# User must define an XCOLOR or NEWCOLOR before using
7427 . if \\n[#PRINT_STYLE]=1 \{ .return \}
7429 . ds $HEAD_COLOR \\$1
7436 \# <none> | <anything>
7438 \# Creates register #HEAD_SPACE, which toggles whether the space
7439 \# before heads is 1 extra line space ("off") or 2 ("on"). Used only
7440 \# in PRINTSTYLE TYPESET.
7445 . ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
7446 . el \{ .nr #HEAD_SPACE 0 \}
7453 \# <none> | <anything>
7455 \# Creates or modifies register #HEAD_UNDERLINE.
7459 .MAC HEAD_UNDERLINE END
7460 . ie '\\$1'' \{ .nr #HEAD_UNDERLINE 1 \}
7461 . el \{ .nr #HEAD_UNDERLINE 0 \}
7468 \# "text of main head" ["text of main head"] ...
7470 \# In TYPEWRITE, prints main heads centered, all caps, underlined.
7471 \# In TYPESET, prints bold main heads 1 point larger than running
7472 \# text, all caps, underlined.
7474 \# The HEAD macro requires that double-quotes (") surround
7475 \# each line of text.
7479 \# Collect head for TOC.
7481 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7482 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
7483 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7484 . ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
7485 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\\|
7488 \# Note that in the .as lines, below, \ at the end has a literal
7490 . ie \\n[#NUMBER_HEAD] \{\
7491 . ie \\n[#ARG_NUM]=0 \{\
7492 . as $TOC_HEAD_ITEM \\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\
7493 . nr #HEAD_NUM \\n-[#HEAD_NUM]
7496 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\
7500 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\
7504 \# Note the use of \!, which transparently embeds the macros used
7505 \# in the TOC_ENTRIES diversion. The elements they control must be
7506 \# processed literally when the diversion is output.
7509 . if \\n[#PRINT_STYLE]=1 \{\
7514 . if \\n[#PRINT_STYLE]=2 \{\
7515 \!. FAMILY \\*[$TOC_HEAD_FAM]
7516 \!. FT \\*[$TOC_HEAD_FT]
7517 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
7520 . ie \\n[#PRINT_STYLE]=1 \{\
7521 \!. PAD "\\h'2m'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN_TYPEWRITE]"
7524 \!. PAD "\\h'\\n[#TOC_HEAD_INDENT]u'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN]"
7529 . if \\n[#PRINT_STYLE]=2 \{\
7530 \!. FAMILY \\*[$TOC_PN_FAM]
7531 \!. FT \\*[$TOC_PN_FT]
7532 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7535 \!. PRINT \\*[LEADER]
7538 \!. PRINT \\n[#TOC_ENTRY_PN]
7542 \# End collection of head for TOC
7546 . ll \\n[#L_LENGTH]u
7548 . if \\n[#COLUMNS] \{\
7549 . ll \\n[#COL_L_LENGTH]u
7553 . QUAD \\*[$HEAD_QUAD]
7554 . if \\n[#PRINT_STYLE]=1 \{\
7558 . vs \\n[#DOC_LEAD]u
7561 . if \\n[#PRINT_STYLE]=2 \{\
7562 . FAMILY \\*[$HEAD_FAM]
7564 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
7565 . LS \\n[#DOC_LEAD]u
7567 . if r#QUOTE \{ .rr #QUOTE \}
7568 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
7569 . if \\n[#PRINT_STYLE]=1 \{ .ne 3 \}
7570 . if \\n[#PRINT_STYLE]=2 \{\
7571 . ie \\n[#HEAD_SPACE] \{ .ne 4 \}
7574 . ie \\n[#START] \{\
7575 . if \\n[#DOC_HEADER]=0 \{ . \}
7578 . if \\n[#PRINT_STYLE]=1 \{\
7579 . if !\\n[#LINEBREAK] \{\
7580 . ALD \\n[#DOC_LEAD]u
7581 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
7584 . if \\n[#PRINT_STYLE]=2 \{\
7585 . ie \\n[#PP_SPACE] \{\
7586 . ie \\n[#END_QUOTE] \{ . \}
7588 . if !\\n[#LINEBREAK] \{\
7589 . if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
7594 . ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
7595 . el \{ .ALD \\n[#DOC_LEAD]u \}
7597 . if \\n[#END_QUOTE] \{\
7598 . if !\\n[#Q_FITS] \{\
7599 . RLD \\n[#DOC_LEAD]u
7600 . if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
7602 . if \\n[#Q_AT_TOP] \{\
7603 . RLD \\n[#DOC_LEAD]u
7604 . if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
7607 . if \\n[#LINEBREAK] \{\
7608 . if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
7614 . if \\n[#HEAD_CAPS] \{ .CAPS \}
7615 . if \\n[#PRINT_STYLE]=2 \{\
7616 . if \\n[#HEAD_COLOR]=1 \{\
7618 . COLOR \\*[$HEAD_COLOR]
7623 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7624 . ie \\n[#NUMBER_HEAD] \{\
7625 . ie \\n[#ARG_NUM]=0 \{\
7627 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
7628 . el \{ .UNDERSCORE "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
7633 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
7634 . el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
7640 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
7641 . el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
7648 . ALD \\n[#DOC_LEAD]u
7649 . RESET_SUBHEAD_NUMBER
7650 . RESET_PARAHEAD_NUMBER
7651 . if r#START \{ .rr #START \}
7652 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
7653 . if r#QUOTE \{ .rr #QUOTE \}
7654 . if r#Q_FITS \{ .rr #Q_FITS \}
7655 . if r#END_QUOTE \{ .rr #END_QUOTE \}
7656 . if r#LINEBREAK \{ .rr #LINEBREAK \}
7657 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7658 . if r#PP_ACTIVE \{ .rr #PP_ACTIVE \}
7670 \# <family to use in subheads>
7672 \# Creates or modifies string $SH_FAM.
7674 \# Default is same as running text.
7676 .MAC SUBHEAD_FAMILY END
7684 \# <font to use in subheads>
7686 \# Creates or modifies string $SH_FT.
7690 .MAC SUBHEAD_FONT END
7698 \# <+|- number of points by which to in/decrease point size of subheads
7699 \# (relative to running text)>
7701 \# Creates or modifies string $SH_SIZE_CHANGE.
7703 \# Must be preceded by a +|- sign. No space afterwards.
7704 \# Fractional point sizes are allowed.
7705 \# Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
7707 .MAC SUBHEAD_SIZE END
7708 . ds $SH_SIZE_CHANGE \\$1
7715 \# <pre-defined XCOLOR or NEWCOLOR>
7717 \# Defines string $SH_COLOR to argument.
7719 \# User must define an XCOLOR or NEWCOLOR before using
7722 .MAC SUBHEAD_COLOR END
7723 . if \\n[#PRINT_STYLE]=1 \{ .return \}
7732 \# L | LEFT | R | RIGHT | C | CENTER | CENTRE
7734 \# Creates or modifies string $SH_QUAD.
7736 \# Default is LEFT for both TYPESET and TYPEWRITE.
7738 .MAC SUBHEAD_QUAD END
7746 \# "text of subhead" ["text of subhead"] ...
7748 \# In TYPEWRITE, prints subheads underlined.
7749 \# In TYPESET, prints subheads bold, .5 points larger than running
7751 \# In both styles, a line space precedes the subhead, and a small
7752 \# amount of lead comes after.
7754 \# As with the HEAD macro, double-quotes (") must surround
7755 \# each line of text.
7759 \# Collect subhead for TOC.
7761 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7762 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7763 . ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
7764 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\\|
7767 \# Note that in the .as lines, below, \ at the end has a literal
7769 . ie \\n[#NUMBER_SH] \{\
7770 . ie \\n[#ARG_NUM]=0 \{\
7771 . as $TOC_SH_ITEM \\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]\
7772 . nr #SH_NUM \\n-[#SH_NUM]
7775 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\
7779 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\
7783 \# Note the use of \!, which transparently embeds the macros used
7784 \# in the TOC_ENTRIES diversion. The elements they control must be
7785 \# processed literally when the diversion is output.
7788 . if \\n[#PRINT_STYLE]=1 \{\
7793 . if \\n[#PRINT_STYLE]=2 \{\
7794 \!. FAMILY \\*[$TOC_SH_FAM]
7795 \!. FT \\*[$TOC_SH_FT]
7796 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
7799 . ie \\n[#PRINT_STYLE]=1 \{\
7800 \!. PAD "\\h'4m'\\*[$TOC_SH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
7803 \!. PAD "\\h'\\n[#TOC_SH_INDENT]u'\\*[$TOC_SH_ITEM]\\*[$TOC_PN]"
7808 . if \\n[#PRINT_STYLE]=2 \{\
7809 \!. FAMILY \\*[$TOC_PN_FAM]
7810 \!. FT \\*[$TOC_PN_FT]
7811 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7814 \!. PRINT \\*[LEADER]
7817 \!. PRINT \\n[#TOC_ENTRY_PN]
7821 \# End collection of head for TOC
7824 . if r#QUOTE \{ .rr #QUOTE \}
7825 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7827 . ll \\n[#L_LENGTH]u
7829 . if \\n[#COLUMNS] \{\
7830 . ll \\n[#COL_L_LENGTH]u
7834 . if \\n[#PRINT_STYLE]=1 \{\
7838 . vs \\n[#DOC_LEAD]u
7839 . QUAD \\*[$SH_QUAD]
7842 . if \\n[#PRINT_STYLE]=2 \{\
7843 . FAMILY \\*[$SH_FAM]
7845 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
7846 . LS \\n[#DOC_LEAD]u
7847 . QUAD \\*[$SH_QUAD]
7849 . if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
7850 . if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
7851 . ie \\n[#START] \{ . \}
7853 . ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]u*2u) ) \{\
7854 . ie \\n[#COLUMNS] \{ .COL_NEXT \}
7858 . ie \\n[#HEAD]=1 \{ . \}
7860 . if \\n[#PRINT_STYLE]=1 \{\
7861 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7863 . if \\n[#PRINT_STYLE]=2 \{\
7864 . ie \\n[#PP_SPACE]=1 \{\
7865 . ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7866 . el \{ .RLD \\n[#DOC_LEAD]u \}
7869 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7876 . if \\n[#PRINT_STYLE]=1 \{\
7877 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7878 . ie \\n[#NUMBER_SH] \{\
7879 . ie \\n[#ARG_NUM]=0 \{\
7880 . ie \\n[#NUMBER_HEAD] \{\
7882 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
7887 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
7893 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
7894 . el \{ .UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
7900 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7905 . if \\n[#PRINT_STYLE]=1 \{\
7906 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
7908 . if \\n[#PRINT_STYLE]=2 \{\
7909 . if \\n[#SH_COLOR]=1 \{ .COLOR \\*[$SH_COLOR] \}
7910 . ie \\n[#PP_SPACE]=0 \{\
7911 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7912 . ie \\n[#NUMBER_SH] \{\
7913 . ie \\n[#ARG_NUM]=0 \{\
7914 . ie \\n[#NUMBER_HEAD] \{\
7916 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
7921 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
7927 . PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7933 . PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7939 . ALD \\n[#DOC_LEAD]u
7940 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
7941 . if \\n[#END_QUOTE] \{ .RLD \\n[#DOC_LEAD]u \}
7942 . if \\n[#EPIGRAPH] \{ .RLD \\n[#DOC_LEAD]u \}
7943 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7944 . PRINT "\\$[\\n+[#ARG_NUM]]
7946 . ALD \\n[#DOC_LEAD]u
7951 . RESET_PARAHEAD_NUMBER
7952 . if r#START \{ .rr #START \}
7953 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
7954 . if r#Q_FITS \{ .rr #Q_FITS \}
7955 . if r#END_QUOTE \{ .rr #END_QUOTE \}
7956 . if r#LINEBREAK \{ .rr #LINEBREAK \}
7962 \# ---Paragraph heads---
7967 \# <family to use in paraheads>
7969 \# Creates or modifies string $PH_FAM.
7971 \# Default is same as running text.
7973 .MAC PARAHEAD_FAMILY END
7981 \# <font to use in paraheads>
7983 \# Creates or modifies string $PH_FT.
7985 \# Default is bold italic for TYPESET; underlined for TYPEWRITE.
7987 .MAC PARAHEAD_FONT END
7995 \# <+|- number of points by which to in/decrease point size of subheads
7996 \# (relative to running text)>
7998 \# Creates or modifies string $PH_SIZE_CHANGE.
8000 \# Must be preceded by a +|- sign. No space afterwards.
8001 \# Fractional point sizes are allowed. No unit of measure, please.
8002 \# Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
8004 .MAC PARAHEAD_SIZE END
8005 . ds $PH_SIZE_CHANGE \\$1
8012 \# <pre-defined XCOLOR or NEWCOLOR>
8014 \# Defines string $PH_COLOR to argument.
8016 \# User must define an XCOLOR or NEWCOLOR before using
8019 .MAC PARAHEAD_COLOR END
8020 . if \\n[#PRINT_STYLE]=1 \{ .return \}
8031 \# Creates or modifies register #PH_INDENT.
8033 \# Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
8035 .MAC PARAHEAD_INDENT END
8036 . nr #PH_INDENT (\\$1)
8045 \# Deposits a paragraph head at the start and into the body of a
8048 \# PARAHEAD *must* come after PP.
8051 \# Collect parahead for TOC.
8052 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
8053 . ie \\n[#NUMBER_PH] \{\
8054 . ds $TOC_PH_ITEM \\n+[#PH_NUM].\0\\$1\\|
8055 . nr #PH_NUM \\n-[#PH_NUM]
8058 . ds $TOC_PH_ITEM \\$1\\|
8062 . if \\n[#PRINT_STYLE]=1 \{\
8067 . if \\n[#PRINT_STYLE]=2 \{\
8068 \!. FAMILY \\*[$TOC_PH_FAM]
8069 \!. FT \\*[$TOC_PH_FT]
8070 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PH_SIZE_CHANGE]
8073 . ie \\n[#PRINT_STYLE]=1 \{\
8074 \!. PAD "\\h'6m'\\*[$TOC_PH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
8077 \!. PAD "\\h'\\n[#TOC_PH_INDENT]u'\\*[$TOC_PH_ITEM]\\*[$TOC_PN]"
8082 . if \\n[#PRINT_STYLE]=2 \{\
8083 \!. FAMILY \\*[$TOC_PN_FAM]
8084 \!. FT \\*[$TOC_PN_FT]
8085 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
8088 \!. PRINT \\*[LEADER]
8091 \!. PRINT \\n[#TOC_ENTRY_PN]
8095 \# End collection of parahead for TOC
8097 . if \\n[#SLANT_ON] \{\
8098 . nr #SLANT_WAS_ON 1
8102 . if \\n[#INDENT_FIRST_PARAS] \{\
8103 . ti \\n[#PH_INDENT]u
8106 . el \{ .ti \\n[#PH_INDENT]u \}
8107 . if \\n[#PRINT_STYLE]=1 \{\
8112 . ie \\n[#NUMBER_PH] \{\
8113 . if \\n[#NUMBER_HEAD] \{\
8114 . ie \\n[#NUMBER_SH] \{\
8115 . UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
8119 . UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1
8123 . ie \\n[#NUMBER_SH] \{\
8124 . if !\\n[#NUMBERED] \{\
8125 . UNDERSCORE "\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1
8130 . if !\\n[#NUMBERED] \{\
8131 . UNDERSCORE "\\n+[#PH_NUM].\\ \\$1
8140 . if \\n[#SLANT_WAS_ON] \{\
8141 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
8142 . if \\n[#SLANT_MEANS_SLANT] \{\
8148 . if \\n[#PRINT_STYLE]=2 \{\
8151 . PT_SIZE \\*[$PH_SIZE_CHANGE]
8152 . if \\n[#PH_COLOR]=1 \{ .COLOR \\*[$PH_COLOR] \}
8153 . ie \\n[#NUMBER_PH] \{\
8154 . if \\n[#NUMBER_HEAD] \{\
8155 . ie \\n[#NUMBER_SH] \{\
8156 . PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
8159 . PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
8162 . ie \\n[#NUMBER_SH] \{\
8163 . if !\\n[#NUMBERED] \{\
8164 . PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
8168 . if !\\n[#NUMBERED] \{\
8169 . PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
8174 . PRINT "\\$1\h'.6m'\c"
8177 . FAMILY \\*[$DOC_FAM]
8179 . PT_SIZE \\n[#DOC_PT_SIZE]u
8180 . if \\n[#PH_COLOR]=1 \m[]\c
8181 . if \\n[#SLANT_WAS_ON] \{\
8182 . rr #SLANT_WAS_ON 1
8191 \# ====================================================================
8193 \# +++LINE BREAKS+++
8195 \# LINEBREAK CHARACTER
8196 \# -------------------
8198 \# [character] [iterations] [vertical adjustment]
8200 \# Allows user to specify a line break character and the number
8201 \# of times to repeat it horiontally.
8203 \# Without an argument, LINEBREAK_CHAR will deposit a blank line.
8205 \# Vertical adjustment requires a unit of measure (most likely
8206 \# "p"), and has to be preceded by +|-
8208 .MAC LINEBREAK_CHAR END
8210 . ds $LINEBREAK_CHAR \\$1
8211 . ds $LINEBREAK_CHAR_V_ADJ \\$3
8212 . if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
8213 . ds $LINEBREAK_CHAR_V_ADJ +0
8215 . while \\$2>\\n[#REPEAT] \{\
8216 . as $LINEBREAK_CHAR "\\ \\$1
8217 . nr #REPEAT \\n[#REPEAT]+1
8226 \# <pre-defined XCOLOR or NEWCOLOR>
8228 \# Defines string $LINEBREAK_COLOR to argument.
8230 \# User must define an XCOLOR or NEWCOLOR before using
8233 .MAC LINEBREAK_COLOR END
8234 . if \\n[#PRINT_STYLE]=1 \{ .return \}
8235 . ds $LINEBREAK_COLOR \\$1
8244 \# Deposits line break character.
8246 \# If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
8249 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
8250 . po \\n[#DOC_L_MARGIN]u
8251 . ie '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
8253 . if \\n[#PRINT_STYLE]=1 \{\
8254 . ie \\n[#END_QUOTE] \{ . \}
8255 . el \{ .ALD \\n[#DOC_LEAD]u \}
8257 . if \\n[#PRINT_STYLE]=2 \{\
8258 . ie \\n[#END_QUOTE] \{ . \}
8259 . el \{ .ALD \\n[#DOC_LEAD]u \}
8264 . PRINT \m[\\*[$LINEBREAK_COLOR]]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\m[]
8265 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8266 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
8268 . QUAD \\*[$DOC_QUAD]
8271 . if r#QUOTE \{ .rr #QUOTE \}
8272 . if r#END_QUOTE \{ .rr #END_QUOTE \}
8276 \# ====================================================================
8283 \# <font of running text>
8285 \# Creates or modifies string $PP_FT.
8287 \# Affects all paragraphs.
8290 . if \\n[#IGNORE] \{ .return \}
8300 \# <amount to indent paragraphs in running text (ipPcm)>
8302 \# Allows user to change the default para indent. The change will
8303 \# affect the indent of QUOTEs and BLOCKQUOTEs as well.
8305 \# Default for printstyle TYPEWRITE is 1/2-inch. Default for
8306 \# printstyle TYPESET is 2 ems. The defaults are set in
8307 \# PRINTSTYLE, not DEFAULTS.
8309 .MAC PARA_INDENT END
8310 . nr #PP_INDENT (\\$1)
8314 \# INDENT FIRST PARAGRAPHS
8315 \# -----------------------
8317 \# <none> | <anything>
8319 \# By default, the first para of a document, as well as the first
8320 \# paras of blockquotes and block-style epigraphs are not indented.
8321 \# When invoked, this macro will indent all paras.
8325 .MAC INDENT_FIRST_PARAS END
8326 . ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
8327 . el \{ .rr #INDENT_FIRST_PARAS \}
8331 \# INTER-PARAGRAPH SPACING
8332 \# -----------------------
8334 \# <none> | <anything>
8336 \# Adds a line space between paragraphs in body text. Block quotes
8339 \# Default is OFF. PARA_SPACE ON is not recommended for use
8340 \# with PRINTSTYLE TYPEWRITE.
8343 . ie '\\$1'' \{ .nr #PP_SPACE 1 \}
8344 . el \{ .rr #PP_SPACE \}
8353 \# Figures out what to do with paragraphs under differing conditions.
8355 \# For the time being, there's no automatic widow/orphan control.
8356 \# Controlling them isn't just a matter of establishing an arbitrary
8357 \# number of lines needed for a para, since groff doesn't then
8358 \# handle single line paragraphs gracefully. Usually, the whole
8359 \# page needs to be tweaked.
8361 \# Note the use of transparent line break (\!.br) to get
8362 \# PP to work within blockquotes and epigraphs.
8364 \# PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
8368 . if \\n[#DOC_TYPE]=4 \{\
8369 . if !'\\n(.z'' \{ .di \}
8370 . nr #TOTAL_FIELDS \\n[#FIELD]
8372 . nr #NUM_FIELDS 0 1
8373 . if \\n[#TOTAL_FIELDS]>0 \{\
8374 . while \\n+[#NUM_FIELDS]<=\\n[#TOTAL_FIELDS] \{\
8376 . LETTERHEAD\\n+[#FIELD]
8377 . QUAD \\*[$DOC_QUAD]
8378 . ALD \\n[#DOC_LEAD]u
8379 . if \\n[#DATE_FIRST]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8381 . rm LETTERHEAD\\n[#FIELD]
8389 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
8390 . if \\n[#PP_STYLE]=1 \{\
8391 . if \\n[#ENDNOTE] \{\
8392 . nr #RESET_PARA_SPACE \\n[#PP_SPACE]
8393 . ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
8394 . el \{ .PARA_SPACE OFF \}
8397 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
8398 . if \\n[#COLUMNS] \{\
8399 . if !\\n[#ENDNOTE] \{\
8400 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8401 . nr #L_MARGIN \\n(.o
8404 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
8405 . ie \\n[#PRINT_STYLE]=1 \{\
8409 . ie \\n[#ENDNOTE] \{ .vs \\n[#EN_LEAD]u \}
8410 . el \{ .vs \\n[#DOC_LEAD]u \}
8411 . QUAD \\*[$DOC_QUAD]
8413 . if \\n[#SLANT_ON] \{\
8414 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
8418 . ie \\n[#ENDNOTE] \{\
8419 . FAMILY \\*[$EN_FAM]
8421 . PT_SIZE \\n[#EN_PS]u
8423 . QUAD \\*[$EN_QUAD]
8426 . FAMILY \\*[$DOC_FAM]
8428 . PT_SIZE \\n[#DOC_PT_SIZE]u
8429 . LS \\n[#DOC_LEAD]u
8430 . QUAD \\*[$DOC_QUAD]
8434 . if \\n[#INDENT_FIRST_PARAS] \{\
8435 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
8436 . el \{ .ti \\n[#PP_INDENT]u \}
8437 . if '\\n(.z'END_NOTES' \{\
8438 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
8441 . if r#END_QUOTE \{\
8442 . if \\n[#END_QUOTE] \{\
8443 . if !\\n[#LINEBREAK] \{\
8444 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
8445 . el \{ .ti \\n[#PP_INDENT]u \}
8446 . if '\\n(.z'END_NOTES' \{\
8447 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
8455 . if \\n[#PP_SPACE] \{\
8456 . if \\n[#PRINT_STYLE]=2 \{\
8457 . ie \\n[#END_QUOTE] \{\
8460 . el \{ .ALD \\n[#DOC_LEAD]u \}
8463 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
8464 . el \{ .ti \\n[#PP_INDENT]u \}
8465 . if '\\n(.z'END_NOTES' \{\
8466 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
8469 . if r#START \{ .rr #START \}
8470 . if r#QUOTE \{ .rr #QUOTE \}
8471 . if r#END_QUOTE \{ .rr #END_QUOTE \}
8472 . if r#HEAD \{ .rr #HEAD \}
8473 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8474 . if r#Q_FITS \{ .rr #Q_FITS \}
8475 . if r#LINEBREAK \{ .rr #LINEBREAK \}
8476 . if \\n[#ENDNOTE] \{\
8477 . ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
8478 . el \{ .PARA_SPACE OFF \}
8480 . if \\n[#CONDENSE] \{\
8483 . if \\n[#EXTEND]=1 \{\
8488 . if \\n[#PP_STYLE]=2 \{\
8490 . if \\n[#BROKEN_QUOTE] \{\
8491 . ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
8492 . el \{ .nr #Q_PP 0 \}
8495 . ie \\n[#Q_PP]=0 \{\
8496 . if \\n[#INDENT_FIRST_PARAS] \{\
8497 . ti \\n[#PP_INDENT]u/2u
8499 . if \\n[#ENDNOTE] \{\
8500 . ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
8505 . ti \\n[#PP_INDENT]u/2u
8507 . if \\n[#CONDENSE] \{\
8510 . if \\n[#EXTEND]=1 \{\
8518 \# ====================================================================
8522 \# ---Line for line (poetic) quotes---
8527 \# <family to use in line for line quotes>
8529 \# Creates or modifies string $QUOTE_FAM.
8531 \# Default is same as running text.
8533 .MAC QUOTE_FAMILY END
8534 . ds $QUOTE_FAM \\$1
8541 \# <font to use in line for line quotes>
8543 \# Creates or modifies string $QUOTE_FT.
8545 \# Default is italic for TYPESET.
8555 \# <-|+ number of points by which to de/increase point size of
8556 \# line for line quotes (relative to running text)>
8558 \# Creates or modifies string $QUOTE_SIZE_CHANGE.
8560 \# Must be preceded by a - or + sign with no space afterwards.
8561 \# Fractional point sizes are allowed.
8565 . ds $QUOTE_SIZE_CHANGE \\$1
8572 \# <pre-defined XCOLOR or NEWCOLOR>
8574 \# Sets register #QUOTE_COLOR to 1; defines string $QUOTE_COLOR to
8577 \# User must define an XCOLOR or NEWCOLOR before using
8580 .MAC QUOTE_COLOR END
8581 . if \\n[#PRINT_STYLE]=1 \{ .return \}
8583 . ds $QUOTE_COLOR \\$1
8590 \# <none> | <anything>
8592 \# Creates or modifies register #UNDERLINE_QUOTES (toggle).
8593 \# If on, line for line quotes are underlined when printstyle
8596 \# Default is ON for printstyle TYPEWRITE.
8598 .MAC UNDERLINE_QUOTES END
8599 . ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
8600 . el \{ .rr #UNDERLINE_QUOTES \}
8607 \# <value by which to multiply PP_INDENT for indented quoted text>
8609 \# Creates or modifies register #Q_OFFSET_VALUE.
8611 \# Default is 3 for typeset; 2 for typewrite
8613 .MAC QUOTE_INDENT END
8614 . nr #Q_OFFSET_VALUE \\$1
8618 \# ALWAYS FULLSPACE QUOTES
8619 \# -----------------------
8621 \# <none> | <anything>
8623 \# Toggles register #FULLSPACE_QUOTES.
8625 \# If user doesn't like the default 1/2 line space above and below
8626 \# quotes, s/he can turn it off here. Has no effect in TYPEWRITE.
8628 .MAC ALWAYS_FULLSPACE_QUOTES END
8629 . if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
8630 . el \{ .rr #FULLSPACE_QUOTES \}
8637 \# <none> | <anything>
8639 \# Indents quoted text on a line for line basis, or turns QUOTE off.
8641 \# Owing to the need to bottom align TYPESET pages, quoted text gets
8642 \# diverted so its depth can be measured (in DO_QUOTE) for determining
8643 \# how much space to put before and after.
8647 \# **Uncomment the next line to prevent orphaned quote lines.
8653 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
8655 . if \\n[#COLUMNS] \{\
8656 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
8659 . if \\n[#PRINT_STYLE]=1 \{\
8663 . vs \\n[#DOC_LEAD]u
8666 . if \\n[#PRINT_STYLE]=2 \{\
8667 . FAMILY \\*[$QUOTE_FAM]
8669 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
8670 . LS \\n[#DOC_LEAD]u
8672 . if \\n[#QUOTE_COLOR]=1 \{\
8674 \m[\\*[$QUOTE_COLOR]]
8679 . if \\n[#PRINT_STYLE]=1 \{\
8680 . if \\n[#UNDERLINE_QUOTES] \{\
8685 . el \{ .DO_QUOTE \}
8689 \# ---Blockquotes---
8691 \# BLOCKQUOTE FAMILY
8692 \# -----------------
8694 \# <family to use in blockquotes>
8696 \# Creates or modifies string $BQUOTE_FAM.
8698 \# Default is same as running text.
8700 .MAC BLOCKQUOTE_FAMILY END
8701 . ds $BQUOTE_FAM \\$1
8708 \# <font to use in blockquotes>
8710 \# Creates or modifies string $BQUOTE_FT.
8712 \# Default is same as running text.
8714 .MAC BLOCKQUOTE_FONT END
8715 . ds $BQUOTE_FT \\$1
8722 \# <-|+ number of points by which to de/increase point size of blockquotes
8723 \# (relative to running text)>
8725 \# Creates or modifies string $BQUOTE_SIZE_CHANGE.
8727 \# Must be preceded by a - or + sign with no space afterwards.
8728 \# Fractional point sizes are allowed.
8729 \# Default is -1 for printstyle TYPESET; +0 for TYPEWRITE.
8731 .MAC BLOCKQUOTE_SIZE END
8732 . ds $BQUOTE_SIZE_CHANGE \\$1
8739 \# <pre-defined XCOLOR or NEWCOLOR>
8741 \# Sets register #BQUOTE_COLOR to 1; defines string
8742 \# $BQUOTE_COLOR to argument.
8744 \# User must define an XCOLOR or NEWCOLOR before using
8745 \# BLOCKQUOTE_COLOR.
8747 .MAC BLOCKQUOTE_COLOR END
8748 . if \\n[#PRINT_STYLE]=1 \{ .return \}
8749 . nr #BQUOTE_COLOR 1
8750 . ds $BQUOTE_COLOR \\$1
8757 \# <quad to use in blockquotes>
8759 \# Creates or modifies string $BQUOTE_QUAD.
8763 .MAC BLOCKQUOTE_QUAD END
8764 . ds $BQUOTE_QUAD \\$1
8771 \# <none> | <anything>
8773 \# Indents quoted text in fill mode and shortens line length
8774 \# accordingly, or turns BLOCKQUOTE off.
8776 \# Owing to the need to bottom align TYPESET pages, quoted text gets
8777 \# diverted so its depth can be measured (in DO_QUOTE) for determining
8778 \# how much space to put before and after.
8780 \# .PP after blockquote is optional if there's only one para,
8781 \# but REQUIRED if there's more than one.
8791 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8792 . if \\n[#ENDNOTE] \{\
8793 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
8794 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8796 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
8797 . ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8802 . if \\n[#COLUMNS] \{\
8803 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8804 . if \\n[#ENDNOTE] \{\
8805 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
8806 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8808 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
8809 . ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8814 . if \\n[#PRINT_STYLE]=1 \{\
8818 . vs \\n[#DOC_LEAD]u
8822 . if \\n[#PRINT_STYLE]=2 \{\
8823 . FAMILY \\*[$BQUOTE_FAM]
8824 . FT \\*[$BQUOTE_FT]
8825 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
8826 . LS \\n[#DOC_LEAD]u
8827 . if \\n[#ENDNOTE] \{\
8828 . PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
8830 . if \\n[#BQUOTE_COLOR]=1 \{\
8832 \m[\\*[$BQUOTE_COLOR]]
8835 . QUAD \\*[$BQUOTE_QUAD]
8839 . if \\n[#INDENT_FIRST_PARAS] \{\
8840 . ie !\\n[#ENDNOTE] \{\
8841 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
8842 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
8845 . if \\n[#INDENT_FIRSTS]=1 \{\
8846 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
8847 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
8852 . el \{ .DO_QUOTE \}
8861 \# Ends the diversion P_QUOTE or B_QUOTE. Spaces them according to
8862 \# PRINTSTYLE, whether there's inter-paragraph spacing, and page
8863 \# position. TYPEWRITE treats spacing the same way in all circumstance
8864 \# (viz. an extra line space). TYPESET puts in only half
8865 \# line spaces if the entire quote plus 1 line of body under the quote
8866 \# fits on the the page; otherwise it puts in a full extra blank
8867 \# line. (This is to ensure the page remains bottom aligned).
8873 \# **Change *1 to *2 in next line to prevent orphans after quotes
8874 . if \\n[#ENDNOTE] \{\
8875 . nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
8876 . ALWAYS_FULLSPACE_QUOTES
8878 . nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
8879 . if \\n[#PRINT_STYLE]=1 \{\
8880 . if \\n[#START]=1 \{ . \}
8881 . if \\n[#START]=0 \{\
8882 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8885 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
8888 . if \\n[#PRINT_STYLE]=2 \{\
8889 . ie \\n[#PP_SPACE] \{\
8890 . ie \\n[#HEAD]>0 \{ . \}
8892 . ie \\n[#START] \{ . \}
8893 . el \{ .ALD \\n[#DOC_LEAD]u \}
8897 . ie \\n[#Q_DEPTH]<\\n[#TRAP_DISTANCE] \{\
8899 . ie \\n[#HEAD]=1 \{ . \}
8901 . ie \\n[#START] \{ . \}
8903 . ie \\n[#FULLSPACE_QUOTES] \{\
8904 . ie \\n[#ENDNOTE] \{\
8905 . ALD \\n[#EN_LEAD]u
8907 . el \{ .ALD \\n[#DOC_LEAD]u \}
8910 . ie \\n[#ENDNOTE] \{\
8911 . ALD \\n[#EN_LEAD]u/2u
8913 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
8921 . if \\n[#HEAD]=1 \{ . \}
8924 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
8925 . el \{ .ALD \\n[#DOC_LEAD]u \}
8930 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8931 . if \\n[#COLUMNS] \{\
8932 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8934 . if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
8935 . if \\n[#ENDNOTE] \{\
8936 . in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
8938 . if \\n[#QUOTE]=1 \{\
8941 . if !\\n[#START] \{ .rr #QUOTE \}
8943 . if \\n[#QUOTE]=2 \{\
8947 . if \\n[#PRINT_STYLE]=1 \{\
8948 . ALD \\n[#DOC_LEAD]u
8950 . if \\n[#PRINT_STYLE]=2 \{\
8951 . ie \\n[#START] \{\
8952 . ie \\n[#PP_SPACE] \{ . \}
8953 . el \{ .ALD \\n[#DOC_LEAD]u \}
8956 . ie \\n[#PP_SPACE] \{ . \}
8958 . ie \\n[#HEAD]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8960 . ie \\n[#Q_FITS] \{\
8961 . ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
8963 . ALD \\n[#DOC_LEAD]u
8966 . ie \\n[#FULLSPACE_QUOTES] \{ .ALD \\n[#DOC_LEAD]u \}
8967 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
8970 . el \{ .ALD \\n[#DOC_LEAD]u \}
8975 . if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
8976 . if r#HEAD \{ .rr #HEAD \}
8977 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8982 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
8983 . if \\n[#ENDNOTE] \{\
8984 . in \\n[#EN_TEXT_INDENT]u
8986 . if \\n[#COLUMNS] \{\
8987 . if !\\n[#ENDNOTE] \{\
8988 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
8989 . nr #L_MARGIN \\n(.o
8991 . if \\n[#ENDNOTE] \{\
8992 . in \\n[#EN_TEXT_INDENT]u
8995 . ie !\\n[#ENDNOTE] \{\
8996 . nr #RESET_PP_INDENT \\n[#PP_INDENT]
8999 . PARA_INDENT \\n[#RESET_PP_INDENT]u
9000 . QUAD \\*[$DOC_QUAD]
9003 . nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
9004 . ENDNOTE_PARA_INDENT 0
9006 . ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
9011 \# ====================================================================
9018 \# Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
9019 \# page, and reinvokes BLOCKQUOTE.
9021 \# Because quotes go into a diversion before they're output,
9022 \# footnotes in quotes that cross pages behave erratically. The footnote
9023 \# isn't processed until the diversion ends, hence the footnote
9024 \# marker in the quote isn't always correct for the new page (it's
9025 \# picked up from the old one). BREAK_QUOTE is a workaround for
9028 .MAC BREAK_QUOTE END
9031 . nr #BROKEN_QUOTE 1
9034 . nr #Q_DEPTH \\n[#DIVER_DEPTH]+\\n[#LEAD]
9035 . if \\n[#PRINT_STYLE]=1 \{\
9036 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
9038 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
9041 . if \\n[#PRINT_STYLE]=2 \{\
9042 . ie \\n[#PP_SPACE] \{\
9043 . ie \\n[#HEAD]=1 \{ . \}
9045 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
9051 . if \\n[#HEAD]=1 \{ . \}
9053 . el \{ .ALD \\n[#DOC_LEAD]u \}
9056 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
9057 . if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
9058 . po \\n[#Q_OFFSET]u
9059 . if \\n[#QUOTE]=1 \{\
9062 . if !\\n[#START] \{ .rr #QUOTE \}
9064 . if \\n[#QUOTE]=2 \{\
9068 . if r#HEAD \{ .rr #HEAD \}
9069 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
9074 . if \\n[#PRINT_STYLE]=1 \{\
9075 . if \\n[#UNDERLINE_QUOTES] \{\
9079 . po \\n[#L_MARGIN]u
9080 . if \\n[#COLUMNS] \{\
9081 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
9082 . nr #L_MARGIN \\n(.o
9084 . QUAD \\*[$DOC_QUAD]
9085 . sp |\\n[#PAGE_LENGTH]u \" To trip footer/header
9089 \# ====================================================================
9096 \# <none> | <anything>
9098 \# Turns page numbering off or on during document processing.
9103 . ie '\\$1'' \{ .nr #PAGINATE 1 \}
9104 . el \{ .nr #PAGINATE 0 \}
9108 \# SUSPEND PAGINATION (before ENDNOTES)
9109 \# ------------------
9113 \# Creates register #SUSPEND_PAGINATION
9115 \# Useful only to suspend pagination before outputting endnotes.
9117 .MAC SUSPEND_PAGINATION END
9118 . nr #SUSPEND_PAGINATION 1
9121 \# RESTORE PAGINATION (after ENDNOTES)
9122 \# ------------------
9126 \# Removes register #SUSPEND_PAGINATION. Creates register
9127 \# #DEFER_PAGINATION
9129 \# Useful only to restore pagination after outputting endnotes.
9131 .MAC RESTORE_PAGINATION END
9132 . rr #SUSPEND_PAGINATION
9133 . if \\n[#PAGE_NUM_V_POS]=1 \{ .PAGINATE \}
9134 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #DEFER_PAGINATION 1 \}
9138 \# PAGENUMBER FAMILY
9139 \# -----------------
9141 \# <family to use for page numbers>
9143 \# Creates or modifies string $PAGE_NUM_FAM.
9145 \# Default is same as running text.
9147 .MAC PAGENUM_FAMILY END
9148 . ds $PAGE_NUM_FAM \\$1
9155 \# <font to use for page numbers>
9157 \# Creates or modifies string $PAGE_NUM_FT.
9159 \# Default is same as running text.
9161 .MAC PAGENUM_FONT END
9162 . ds $PAGE_NUM_FT \\$1
9169 \# <+|- number of points by which to in/decrease point size of
9170 \# page numbers (relative to running text)>
9172 \# Creates or modifies string $PAGE_NUM_SIZE_CHANGE.
9174 \# Must be preceded by a +|- sign with no space afterward.
9175 \# Fractional point sizes are allowed.
9178 .MAC PAGENUM_SIZE END
9179 . ds $PAGE_NUM_SIZE_CHANGE \\$1
9186 \# <pre-defined XCOLOR or NEWCOLOR>
9188 \# Defines string $PAGENUM_COLOR to argument.
9190 \# User must define an XCOLOR or NEWCOLOR before using
9193 .MAC PAGENUM_COLOR END
9194 . if \\n[#PRINT_STYLE]=1 \{ .return \}
9195 . ds $PAGENUM_COLOR \\$1
9199 \# PAGE NUMBER FORMAT
9200 \# ------------------
9202 \# DIGIT | ROMAN | roman | ALPHA | alpha
9204 \# Assigns user entered format to #PAGENUMBER.
9206 .MAC PAGENUM_STYLE END
9207 . nr #PAGENUM_STYLE_SET 1
9208 . if '\\$1'DIGIT' \{\
9209 . ds $PAGENUM_STYLE \\$1
9212 . if '\\$1'ROMAN' \{\
9213 . ds $PAGENUM_STYLE \\$1
9216 . if '\\$1'roman' \{\
9217 . ds $PAGENUM_STYLE \\$1
9220 . if '\\$1'ALPHA' \{\
9221 . ds $PAGENUM_STYLE \\$1
9224 . if '\\$1'alpha' \{\
9225 . ds $PAGENUM_STYLE \\$1
9231 \# HYPHENS AROUND PAGE NUMBERS
9232 \# ---------------------------
9234 \# <none> | <anything>
9236 \# Creates or modifies register #PAGE_NUM_HYPHENS.
9237 \# Used to dis/enable hyphens on either side of page numbers.
9241 .MAC PAGENUM_HYPHENS END
9242 . nr #PAGE_NUM_HYPHENS_SET 1
9243 . ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
9244 . el \{ .rr #PAGE_NUM_HYPHENS \}
9248 \# PAGENUMBER POSITION
9249 \# -------------------
9251 \# TOP | BOTTOM LEFT | CENTER | RIGHT
9253 \# Creates or modifies various PAGE_NUM_H | V_POS registers.
9254 \# Used to position page numbers.
9256 \# Default is center/bottom.
9258 .MAC PAGENUM_POS END
9259 . nr #PAGE_NUM_POS_SET 1
9260 . if '\\$1'TOP' \{ .nr #PAGE_NUM_V_POS 1 \}
9261 . if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
9262 . if '\\$2'LEFT' \{ .nr #PAGE_NUM_H_POS 1 \}
9263 . if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
9264 . if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
9265 . if '\\$2'RIGHT' \{ .nr #PAGE_NUM_H_POS 3 \}
9269 .MAC PN_WITH_HYPHENS END
9270 . nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
9271 . ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
9272 . PRINT \m[\\*[$PAGENUM_COLOR]]\\*[$HYPHEN]\|\\n[#PAGENUMBER]\|\\*[$HYPHEN]
9276 \# PRINT PAGE NUMBER
9277 \# -----------------
9281 \# Prints page number if PAGINATE=1.
9283 .MAC PRINT_PAGE_NUMBER END
9287 . po \\n[#DOC_L_MARGIN]u
9288 . ll \\n[#DOC_L_LENGTH]u
9290 . FAMILY \\*[$PAGE_NUM_FAM]
9291 . FT \\*[$PAGE_NUM_FT]
9292 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
9293 . if \\n[#PRINT_STYLE]=1 \{\
9298 . if \\n[#PAGE_NUM_V_POS]=1 \{ .EL \}
9300 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
9304 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
9307 . if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
9308 . if \\n[#RECTO_VERSO]=0 \{\
9309 . if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
9310 . if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
9311 . if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT \}
9313 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
9314 . if \\n[#EN_FIRST_PAGE] \{\
9315 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
9318 . if \\n[#TOC_FIRST_PAGE] \{\
9320 . rr #TOC_FIRST_PAGE
9322 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
9323 . ie '\\*[$REVISION]'' \{\
9324 . PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT] / \\n[#PAGENUMBER]"
9327 . ie '\\*[$DRAFT]'' \{\
9328 . PRINT "\\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
9331 . PRINT "\\*[$DRAFT_STRING]\\*[$DRAFT], \\*[$REVISION_STRING] \\*[$REVISION] / \\n[#PAGENUMBER]"
9336 . ie \\n[#PAGE_NUM_HYPHENS] \{\
9337 . if '\\*[$PAGENUM_STYLE]'DIGIT' \{\
9339 1\\R'#CAP_HEIGHT \\n[.cht]'
9343 . if '\\*[$PAGENUM_STYLE]'ROMAN' \{\
9345 I\\R'#CAP_HEIGHT \\n[.cht]'
9349 . if '\\*[$PAGENUM_STYLE]'ALPHA' \{\
9351 E\\R'#CAP_HEIGHT \\n[.cht]'
9355 . if '\\*[$PAGENUM_STYLE]'roman' \{\
9356 . PRINT \m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-
9358 . if '\\*[$PAGENUM_STYLE]'alpha' \{\
9359 . PRINT "\m[\\*[$PAGENUM_COLOR]]-\|\\n[#PAGENUMBER]\|-"
9362 . el \{ .PRINT "\m[\\*[$PAGENUM_COLOR]]\\n[#PAGENUMBER]" \}
9367 \# ====================================================================
9374 \# <family to use in footnotes>
9376 \# Creates or modifies string $FN_FAM.
9378 \# Default is same as running text.
9380 .MAC FOOTNOTE_FAMILY END
9388 \# <font to use in footnotes>
9390 \# Creates or modifies string $FN_FT.
9392 \# Default is roman.
9394 .MAC FOOTNOTE_FONT END
9402 \# <+|- number of points by which to in/decrease point size of footnotes
9403 \# (relative to running text)>
9405 \# Creates or modifies string $FN_SIZE_CHANGE.
9407 \# Must be preceded by a +|- sign. No space afterwards.
9408 \# Fractional point sizes are allowed.
9409 \# Default is -2 for printstyle TYPESET; +0 for TYPEWRITE.
9411 .MAC FOOTNOTE_SIZE END
9412 . ds $FN_SIZE_CHANGE \\$1
9419 \# <pre-defined XCOLOR or NEWCOLOR>
9421 \# Sets register #FOOTNOTE_COLOR to 1; defines string
9422 \# $FOOTNOTE_COLOR to argument.
9424 \# User must define an XCOLOR or NEWCOLOR before using
9427 .MAC FOOTNOTE_COLOR END
9428 . if \\n[#PRINT_STYLE]=1 \{ .return \}
9429 . nr #FOOTNOTE_COLOR 1
9430 . ds $FOOTNOTE_COLOR \\$1
9434 \# FOOTNOTE AUTOLEAD
9435 \# -----------------
9437 \# <autolead value for footnotes>
9439 \# Creates or modifies register #FN_AUTOLEAD.
9441 \# Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
9443 .MAC FOOTNOTE_AUTOLEAD END
9444 . nr #FN_AUTOLEAD \\$1
9451 \# <quad to use in footnotes>
9453 \# Creates or modifies string $FN_QUAD.
9455 \# Default is same as running text.
9457 .MAC FOOTNOTE_QUAD END
9465 \# <none> | <anything>
9467 \# Turns generation of footnote markers on or off.
9471 .MAC FOOTNOTE_MARKERS END
9472 . ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
9473 . el \{ .nr #FN_MARKERS 0 \}
9477 \# FOOTNOTE MARKER STYLE
9478 \# ---------------------
9482 \# Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
9483 \# the style of footnote markers.
9485 \# 1=STAR; 2=NUMBER. Default is STAR.
9487 .MAC FOOTNOTE_MARKER_STYLE END
9488 . if '\\$1'STAR' \{\
9489 . nr #FN_MARKER_STYLE 1
9491 . if '\\$1'NUMBER' \{\
9492 . nr #FN_MARKER_STYLE 2
9497 \# RESET FOOTNOTE NUMBER
9498 \# ---------------------
9502 \# Resets register #FN_NUMBER to 1. If argument is PAGE, creates
9503 \# toggle #RESET_FN_NUMBER which is checked in HEADER. If 1,
9504 \# numbered footnotes on every page start at 1.
9506 .MAC RESET_FOOTNOTE_NUMBER END
9507 . ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
9508 . el \{ .nr #RESET_FN_NUMBER 1 \}
9512 \# FOOTNOTE RULE LENGTH
9513 \# --------------------
9515 \# <length of rule used to separate footnotes from running text>
9517 \# Creates or modifies registers #FN_RULE_LENGTH.
9519 \# Requires unit of measure (iPpcm).
9520 \# Default is 4P for both PRINTSTYLEs.
9522 .MAC FOOTNOTE_RULE_LENGTH END
9523 . nr #FN_RULE_LENGTH (\\$1)
9527 \# FOOTNOTE_RULE_ADJ
9528 \# -----------------
9530 \# <number of points to raise footnote rule from it's baseline position>
9532 \# Creates or modifies register #FN_RULE_ADJ.
9534 \# Default is 3p for both TYPESTYLES.
9536 \# Requires unit of measure.
9538 .MAC FOOTNOTE_RULE_ADJ END
9539 . nr #FN_RULE_ADJ (\\$1)
9546 \# <none> | <anything>
9548 \# Turns printing of footnote separator rule on or off. If invoked as
9549 \# PRINT_FOOTNOTE_RULE, prints footnote separator rule.
9553 \# Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
9554 \# if the footnote number (#FN_COUNT) is 1.
9556 .MAC FOOTNOTE_RULE END
9557 . ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
9558 . if \\n[#FN_RULE]=0 \{ .RLD 1v \}
9559 \!. PT_SIZE 12 \"Not sure why these have to be transparently embedded, but they do.
9562 . PRINT \\v'-\\n[#FN_RULE_ADJ]u'\\l'\\n[#FN_RULE_LENGTH]u'\\v'+\\n[#FN_RULE_ADJ]u'
9563 \!. PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
9564 . QUAD \\*[$FN_QUAD]
9567 . ie '\\$1'' \{ .nr #FN_RULE 1 \}
9568 . el \{ .nr #FN_RULE 0 \}
9576 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value> > | <anything>
9578 \# Begins collecting and diverting footnote text if no argument
9579 \# given. Otherwise, ends diversion FOOTNOTES, measures footnote
9580 \# depth, and sets footnote trap.
9582 \# The input line preceding a footnote call MUST terminate with \c
9583 \# or the footnote marker will be spaced away from the word it
9584 \# should be joined to.
9586 \# If FOOTNOTES is invoked with INDENT, the footnote will
9587 \# be indented. An indent style and an indent value must be given.
9588 \# Subsequent footnotes will NOT be indented; INDENT must be given
9589 \# for each footnote the user wants indented.
9593 . if \\n[#FN_MARKERS] \{\
9594 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
9595 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
9596 . if \\n[#PRINT_STYLE]=1 \{\
9597 . if \\n[#UNDERLINE_ON] \{\
9598 . nr #UNDERLINE_WAS_ON 1
9602 . if !\\n[#NO_FN_MARKER] \{\
9603 . if \\n[#FN_MARKER_STYLE]=1 \{\
9604 . ie \\n[#FN_COUNT_FOR_COLS] \{\
9605 . if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU3]* \}
9606 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU3]\(dg \}
9607 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \*[BU3]** \}
9608 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
9609 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU3]*** \}
9610 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
9611 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU3]**** \}
9612 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
9613 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \*[BU3]***** \}
9614 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg \}
9617 . if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU3]* \}
9618 . if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU3]\(dg \}
9619 . if \\n[#FN_COUNT]=2 \{ .PRINT \*[BU3]** \}
9620 . if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
9621 . if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU3]*** \}
9622 . if \\n[#FN_COUNT]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
9623 . if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU3]**** \}
9624 . if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
9625 . if \\n[#FN_COUNT]=8 \{ .PRINT \*[BU3]***** \}
9626 . if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg\(dg \}
9629 . if \\n[#FN_MARKER_STYLE]=2 \{\
9630 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#FN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2" \}
9631 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]" \}
9635 . nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-(\\n(nl+1v)
9636 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
9638 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
9639 . INDENT_FIRST_PARAS
9641 . ll \\n[#DOC_L_LENGTH]u
9643 . if \\n[#COLUMNS] \{\
9644 . ll \\n[#COL_L_LENGTH]u
9647 . if \\n[#FN_R_INDENT] \{\
9648 . ll -\\n[#FN_R_INDENT]u
9651 . if \\n[#FN_BR_INDENT] \{\
9652 . ll -\\n[#FN_BR_INDENT]u
9655 . FAMILY \\*[$FN_FAM]
9657 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
9658 . AUTOLEAD \\n[#FN_AUTOLEAD]
9659 . QUAD \\*[$FN_QUAD]
9660 . if \\n[#PRINT_STYLE]=1 \{\
9664 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
9665 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
9669 . nr #FN_LEAD \\n[#LEAD]
9671 . if \\n[#FOOTNOTE_COLOR]=1 \{\
9674 \m[\\*[$FOOTNOTE_COLOR]]
9679 . if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
9680 . if \\n[#FN_DEFER_SPACE] \{\
9681 . if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
9682 . if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
9683 . rr #FN_DEFER_SPACE
9685 . if \\n+[#FN_COUNT]=1 \{\
9686 . if !\\n[#FN_DEPTH] \{\
9687 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
9688 . ie \\n[#FN_RULE] \{ .PRINT_FOOTNOTE_RULE \}
9692 . if \\n[#FN_MARKERS] \{\
9693 . if !\\n[#NO_FN_MARKER] \{\
9694 . if \\n[#FN_MARKER_STYLE]=1 \{\
9695 . ie \\n+[#FN_COUNT_FOR_COLS] \{\
9696 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT *\c \}
9697 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dg\c \}
9698 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT **\c \}
9699 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \(dg\(dg\c \}
9700 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT ***\c \}
9701 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \(dg\(dg\(dg\c \}
9702 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT ****\c \}
9703 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dg\(dg\(dg\(dg\c \}
9704 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT *****\c \}
9705 . if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
9708 . if \\n[#FN_COUNT]=1 \{ .PRINT *\c \}
9709 . if \\n[#FN_COUNT]=2 \{ .PRINT \(dg\c \}
9710 . if \\n[#FN_COUNT]=3 \{ .PRINT **\c \}
9711 . if \\n[#FN_COUNT]=4 \{ .PRINT \(dg\(dg\c \}
9712 . if \\n[#FN_COUNT]=5 \{ .PRINT ***\c \}
9713 . if \\n[#FN_COUNT]=6 \{ .PRINT \(dg\(dg\(dg\c \}
9714 . if \\n[#FN_COUNT]=7 \{ .PRINT ****\c \}
9715 . if \\n[#FN_COUNT]=8 \{ .PRINT \(dg\(dg\(dg\(dg\c \}
9716 . if \\n[#FN_COUNT]=9 \{ .PRINT *****\c \}
9717 . if \\n[#FN_COUNT]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
9720 . if \\n[#FN_MARKER_STYLE]=2 \{\
9721 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
9722 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\c" \}
9728 . ie '\\$1'INDENT' \{\
9730 . if '\\$2'L' \{ .in (\\$3) \}
9731 . if '\\$2'LEFT' \{ .in (\\$3) \}
9732 . if '\\$2'R' \{ .nr #FN_R_INDENT (\\$3) \}
9733 . if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
9735 . nr #FN_BL_INDENT (\\$3)
9736 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
9737 . el \{ .nr #FN_BR_INDENT (\\$4) \}
9738 . in \\n[#FN_BL_INDENT]u
9740 . if '\\$2'BOTH' \{\
9741 . nr #FN_BL_INDENT (\\$3)
9742 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
9743 . el \{ .nr #FN_BR_INDENT (\\$4) \}
9744 . in \\n[#FN_BL_INDENT]u
9752 . in 0 \"Turn off indent possibly set by FOOTNOTE INDENT...
9753 . if \\n[#PRINT_STYLE]=1 \{\
9754 . if \\n[#UNDERLINE_WAS_ON] \{\
9756 . rr #UNDERLINE_WAS_ON
9762 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
9763 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
9765 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
9766 . if \\n[#FN_DEFER] \{\
9767 . nr #FN_DEFER_SPACE 1
9770 . if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
9771 . ie \\n[#SPACE_REMAINING]<(\\n[#LEAD]*2) \{ .nr #FN_DEFER 1 \}
9774 . while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
9775 . nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
9779 . nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
9780 . if \\n[#FN_COUNT]=1 \{ .nr #VARIABLE_FOOTER_POS -1v \}
9782 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
9783 . if (\\n(nl+1v)>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
9784 . ch FOOTER \\n(nlu+1v
9786 . if \\n[#FN_DEFER] \{\
9787 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
9788 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
9791 . nr #NO_FN_MARKER 0
9795 .MAC FN_OVERFLOW_TRAP END
9796 . if \\n[#FN_COUNT] \{\
9802 .MAC DIVERT_FN_LEFTOVER END
9803 . nr #NO_FN_MARKER 1
9809 . rr #FN_OVERFLOW_DEPTH
9813 .MAC PROCESS_FN_LEFTOVER END
9814 . if !\\n[#FN_DEFER] \{\
9817 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
9819 . if \\n[#FN_DEFER] \{\
9820 . nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]+\\n[#DOC_LEAD])
9822 . nr #SPACE_REMAINING 0
9823 . ch FOOTER -\\n[#B_MARGIN]u
9824 . if \\n[#FN_DEFER] \{\
9825 . nr #NO_FN_MARKER 1
9832 . if !\\n[#FN_DEFER] \{\
9833 . if \\n[#FN_OVERFLOW_DEPTH] \{\
9834 . DIVERT_FN_LEFTOVER
9841 \# ====================================================================
9845 \# When endnotes are output, the spacing between the notes is always 1
9846 \# extra linespace. This can have bottom margin consequences. If this
9847 \# doesn't bother you, don't worry about it. If it does bother you, and
9848 \# you want to adjust the spacing between any two endnotes (as they're
9849 \# output), make the spacing adjustments (.ALD/.RLD) at the *end* of
9850 \# endnotes (i.e. just before .ENDNOTE OFF), not at the top.
9852 \# Endnotes must be output manually with .ENDNOTES. This allows user
9853 \# the flexibility to output endnotes at the end of each collated
9854 \# document, or to output them at the end of the entire document.
9859 \# <family to use in endnotes>
9861 \# Creates or modifies string $EN_FAM.
9863 \# Default is same as running text in body of document.
9865 .MAC ENDNOTE_FAMILY END
9873 \# <font to use in endnotes>
9875 \# Creates or modifies string $EN_FT.
9877 \# Default is roman.
9879 .MAC ENDNOTE_FONT END
9884 \# ENDNOTE POINT SIZE
9885 \# ------------------
9887 \# <base point size for endnotes>
9889 \# Creates or modifies register #EN_PS.
9891 \# Default is same as running text in body of document.
9893 \# This size control macro differs from other size control macros
9894 \# in that it sets an absolute point size, not a relative one. This
9895 \# is because a) endnotes always appear separate from the body of
9896 \# a document and therefore don't need to be relative to the body
9897 \# of the document, and b) there are quite a few elements of the
9898 \# endnotes page(s) that need to be relative to the base point size
9899 \# of that page. If the base endnote point size were relative to
9900 \# the body of the document (i.e. a _SIZE macro taking a +|- value)
9901 \# getting the rest of the endnote elements sized properly could
9902 \# become very confusing.
9904 .MAC ENDNOTE_PT_SIZE END
9905 . nr #EN_PS (p;\\$1)
9912 \# <base leading to use in endnotes> [ ADJUST ]
9914 \# Creates or modifies register #EN_LEAD. Creates or removes
9915 \# register #ADJ_EN_LEAD. Stores arguments in strings if ENDNOTE_LEAD
9916 \# set before START.
9918 \# Default is 14 points for TYPESET, adjusted; 24 for TYPEWRITE.
9920 .MAC ENDNOTE_LEAD END
9921 . if !\\n[#OK_PROCESS_LEAD] \{\
9924 . ds $ADJUST_EN_LEAD \\$2
9929 . nr #EN_LEAD (p;\\$1)
9930 . if '\\$2'ADJUST' \{\
9931 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
9932 . nr #ADJ_DOC_LEAD 1
9934 . nr #NO_TRAP_RESET 1
9935 . DOC_LEAD \\n[#EN_LEAD]u ADJUST
9936 . nr #EN_LEAD \\n[#DOC_LEAD]
9937 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
9948 \# LEFT | L | CENTER | C | RIGHT | R | JUSTIFY | J
9950 \# Creates or modifies string $EN_QUAD.
9952 \# Default is justified for TYPESET, left for TYPEWRITE.
9954 .MAC ENDNOTE_QUAD END
9959 \# ENDNOTES_HDRFTR_CENTER
9960 \# ----------------------
9964 \# Creates or removes toggle register #EN_HDRFTR_CENTER, used to
9965 \# determine whether mom should print a/the hdrftr center string
9966 \# on the endnotes page. Primarily to enable/disable printing of the
9967 \# chapter name in hdrftrs when DOCTYPE CHAPTER.
9971 .MAC ENDNOTES_HDRFTR_CENTER END
9972 . ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
9973 . el \{ .rr #EN_HDRFTR_CENTER \}
9980 \# <title for endnotes page>
9982 \# Creates or modifies string $EN_STRING.
9984 \# Default is "Endnotes"
9986 .MAC ENDNOTE_STRING END
9987 . ds $EN_STRING \\$1
9991 \# ENDNOTE STRING FAMILY
9992 \# ---------------------
9994 \# <family to use for endnote string>
9996 \# Creates or modifies string $EN_STRING_FAM.
9998 \# Default is same as running text in body of document.
10000 .MAC ENDNOTE_STRING_FAMILY END
10001 . ds $EN_STRING_FAM \\$1
10005 \# ENDNOTE STRING FONT
10006 \# -------------------
10008 \# <font to use for endnote string>
10010 \# Creates or modifies string $EN_FT.
10012 \# Default is BOLD for TYPEWRITE; roman for TYPESET
10014 .MAC ENDNOTE_STRING_FONT END
10015 . ds $EN_STRING_FT \\$1
10019 \# ENDNOTE STRING SIZE
10020 \# -------------------
10022 \# <+|- number of points by which to in/decrease endnote string
10023 \# (relative to base endnote size)>
10025 \# Creates or modifies string $EN_STRING_SIZE_CHANGE.
10027 \# Default is +1 for TYPESET.
10029 .MAC ENDNOTE_STRING_SIZE END \"Default for TYPESET is +1
10030 . ds $EN_STRING_SIZE_CHANGE \\$1
10034 \# ENDNOTE STRING QUAD
10035 \# -------------------
10037 \# LEFT | L | CENTER | C | RIGHT | R
10039 \# Creates or modifies string $EN_STRING_QUAD.
10041 \# Default is centered.
10043 .MAC ENDNOTE_STRING_QUAD END
10044 . ds $EN_STRING_QUAD \\$1
10048 \# ENDNOTE STRING UNDERSCORE
10049 \# -------------------------
10053 \# Turns underscoring of endnote main title on or off. If the argument
10054 \# is the digit "2", turns on double-underscoring.
10056 \# Default is double-underscored.
10058 .MAC ENDNOTE_STRING_UNDERSCORE END
10059 . ie '\\$1'' \{ .nr #EN_STRING_UNDERSCORE 1 \}
10061 . ie '\\$1'2' \{ .nr #EN_STRING_UNDERSCORE 2 \}
10062 . el \{ .nr #EN_STRING_UNDERSCORE 0 \}
10067 \# ENDNOTE STRING CAPS
10068 \# -------------------
10070 \# <none> | <anything>
10072 \# Turns capitalization of the endnotes pages title string
10073 \# "Endnotes" on or off.
10075 \# Users may want the endnotes pages title string to be in caps,
10076 \# but the toc entry for endnotes in lower case. If the argument
10077 \# to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
10078 \# turned on, this is exactly what will happen.
10082 .MAC ENDNOTE_STRING_CAPS END
10083 . ie '\\$1'' \{ .nr #EN_STRING_CAPS 1 \}
10084 . el \{ .rr #EN_STRING_CAPS \}
10091 \# <string that appears before the first endnote pertaining to any document>
10093 \# Creates string $EN_TITLE_STRING.
10095 \# Default is the document title, or, if doc is a chapter, "Chapter #"
10097 .MAC ENDNOTE_TITLE END
10098 . ds $EN_TITLE \\$1
10102 \# ENDNOTE TITLE FAMILY
10103 \# --------------------
10105 \# <family to use for endnote title>
10107 \# Creates string $EN_TITLE_FAM.
10109 \# Default is same as running text of document.
10111 .MAC ENDNOTE_TITLE_FAMILY END
10112 . ds $EN_TITLE_FAM \\$1
10116 \# ENDNOTE TITLE FONT
10117 \# ------------------
10119 \# <font to use for endnote title>
10121 \# Creates string $EN_TITLE_FT.
10123 \# Default is bold for TYPESET; roman for TYPEWRITE.
10125 .MAC ENDNOTE_TITLE_FONT END
10126 . ds $EN_TITLE_FT \\$1
10130 \# ENDNOTE TITLE SIZE
10131 \# ------------------
10133 \# <+|- number of points by which to in/decrease endnote title
10134 \# (relative to base endnote size)>
10136 \# Creates string $EN_TITLE_SIZE_CHANGE.
10138 \# Default is 0 (i.e. title same size as text of endnotes).
10140 .MAC ENDNOTE_TITLE_SIZE END
10141 . ds $EN_TITLE_SIZE_CHANGE \\$1
10145 \# ENDNOTE TITLE QUAD
10146 \# ------------------
10148 \# <quad direction of endnote title>
10150 \# Creates string $EN_TITLE_QUAD.
10152 \# Default is left.
10154 .MAC ENDNOTE_TITLE_QUAD END
10155 . ds $EN_TITLE_QUAD \\$1
10159 \# ENDNOTE TITLE UNDERSCORE
10160 \# ------------------------
10164 \# Creates or removes register #EN_TITLE_UNDERSCORE.
10166 \# Default is to underscore the endnote titles.
10168 .MAC ENDNOTE_TITLE_UNDERSCORE END
10169 . ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
10170 . el \{ .rr #EN_TITLE_UNDERSCORE \}
10174 \# ENDNOTE NUMBER FAMILY
10175 \# ---------------------
10177 \# <family to use for endnote numbers on endnotes page>
10179 \# Creates string $EN_NUMBER_FAM.
10181 \# Default is same as running text of document.
10183 \# Family, font, and size of endnote numbers applies only to the
10184 \# numbers as they appear on the endnotes page(s). The superscript
10185 \# numbers that appear in running text are unaffected.
10187 .MAC ENDNOTE_NUMBER_FAMILY END
10188 . ds $EN_NUMBER_FAM \\$1
10192 \# ENDNOTE NUMBER FONT
10193 \# -------------------
10195 \# <font to use for endnote numbers on endnotes page>
10197 \# Creates string $EN_NUMBER_FT.
10199 \# Default is bold for TYPESET; roman for TYPEWRITE.
10201 \# Family, font, and size of endnote numbers applies only to the
10202 \# numbers as they appear on the endnotes page(s). The superscript
10203 \# numbers that appear in running text are unaffected.
10205 .MAC ENDNOTE_NUMBER_FONT END \"Default for TYPESET is bold
10206 . ds $EN_NUMBER_FT \\$1
10210 \# ENDNOTE NUMBER SIZE
10211 \# -------------------
10213 \# <+|- number of points by which to in/decrease endnote numbers
10214 \# (relative to base endnote size)>
10216 \# Creates string $EN_NUMBER_SIZE_CHANGE.
10220 \# Family, font, and size of endnote numbers applies only to the
10221 \# numbers as they appear on the endnotes page(s). The superscript
10222 \# numbers that appear in running text are unaffected.
10224 .MAC ENDNOTE_NUMBER_SIZE END
10225 . ds $EN_NUMBER_SIZE_CHANGE \\$1
10229 \# ENDNOTE NUMBERS ALIGN RIGHT
10230 \# ---------------------------
10232 \# <max. number of digit placeholders that will appear in endnotes>
10234 \# Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
10235 \# #EN_NUMBER_PLACEHOLDERS.
10237 \# Default is for footnote numbers to be right aligned to 2 placeholders.
10239 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
10240 . rr #EN_NUMBERS_ALIGN_LEFT
10241 . nr #EN_NUMBERS_ALIGN_RIGHT 1
10242 . nr #EN_NUMBER_PLACEHOLDERS \\$1
10246 \# ENDNOTE NUMBERS ALIGN LEFT
10247 \# --------------------------
10251 \# Toggles register #EN_NUMBERS_ALIGN_LEFT on.
10253 \# Default is for footnote numbers to be right aligned to 2 placeholders
10254 \# (i.e. not left aligned).
10256 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
10257 . rr #EN_NUMBERS_ALIGN_RIGHT
10258 . nr #EN_NUMBERS_ALIGN_LEFT 1
10262 \# ENDNOTE PARAGRAPH INDENT
10263 \# ------------------------
10265 \# <first line indent of paras subsequent to 1st in endnotes>
10267 \# Creates register #EN_PP_INDENT for use in .PP.
10269 \# Requires a unit of measure.
10271 \# Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
10273 .MAC ENDNOTE_PARA_INDENT END
10274 . nr #EN_PP_INDENT (\\$1)
10278 \# TURN OFF COLUMN MODE FOR ENDNOTES
10279 \# ---------------------------------
10281 \# <none> | <anything>
10283 \# Creates or removes register #EN_NO_COLS
10285 \# Allows user to tell mom not to set endnotes in columnar
10286 \# documents in columns. Default is to set endnotes in columns.
10288 .MAC ENDNOTES_NO_COLUMNS END
10289 . ie '\\$1'' \{ .nr #EN_NO_COLS 1 \}
10290 . el \{ .rr #EN_NO_COLS \}
10294 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
10295 \# -------------------------------------------
10297 \# <none> | <anything>
10299 \# Creates or removes register #EN_NO_FIRST_PN
10301 \# For use if FOOTERS are on. Tells ENDNOTES not to put a page
10302 \# number on the first endnotes page. Some users may want this.
10303 \# Default is to print a page number at the top of the first
10304 \# endnotes page when footers are on.
10306 .MAC ENDNOTES_NO_FIRST_PAGENUM END
10307 . ie '\\$1'' \{ .nr #EN_NO_FIRST_PN 1 \}
10308 . el \{ .rr #EN_NO_FIRST_PN \}
10312 \# PAGE HEADERS ON ENDNOTES PAGES
10313 \# ------------------------------
10317 \# Creates or removes register #EN_ALLOWS_HEADERS or
10318 \# #EN_ALLOWS_HEADERS_ALL
10320 \# Whether ENDNOTES puts a page header at the top of endnotes
10321 \# pages if page headers are used throughout the document.
10322 \# Default is to insert the page headers, but not on the first
10323 \# page. If the optional argument ALL is given, ENDNOTES puts a
10324 \# page header on the first page as well.
10326 .MAC ENDNOTES_ALLOWS_HEADERS END
10327 . ie '\\$1'' \{ .nr #EN_ALLOWS_HEADERS 1 \}
10329 . ie '\\$1'ALL' \{\
10330 . nr #EN_ALLOWS_HEADERS 1
10331 . nr #EN_ALLOWS_HEADERS_ALL 1
10334 . rr #EN_ALLOWS_HEADERS
10335 . rr #EN_ALLOWS_HEADERS_ALL
10341 \# ENDNOTES PAGES PAGE NUMBERING STYLE
10342 \# -----------------------------------
10344 \# DIGIT | ROMAN | roman | ALPHA | alpha
10346 \# Creates or modifies $EN_PN_STYLE.
10348 \# Allows user to define what style should be used for endnotes
10349 \# pages page numbering. Arguments are the same as for
10352 \# Default is DIGIT.
10354 .MAC ENDNOTES_PAGENUM_STYLE END
10355 . ds $EN_PN_STYLE \\$1
10359 \# FIRST PAGE NUMBER FOR ENDNOTES
10360 \# ------------------------------
10362 \# <page number that appears on page 1 of endnotes pages>
10364 \# Creates or modifies string $EN_FIRST_PN
10366 \# To be used with caution, only if all endnotes
10367 \# are to be output at once, i.e. not at the end of the separate
10368 \# docs of a collated doc
10370 .MAC ENDNOTES_FIRST_PAGENUMBER END
10371 . nr #EN_FIRST_PN \\$1
10374 \# SINGLESPACE ENDNOTES
10375 \# --------------------
10377 \# <none> | <anything>
10379 \# Sets lead of endnotes pages in TYPEWRITE to 12 points,
10382 \# Default is to double-space endnotes pages.
10384 .MAC SINGLESPACE_ENDNOTES END
10385 . if \\n[#PRINT_STYLE]=1 \{\
10386 . ie \\n[#SINGLE_SPACE] \{\
10387 . nr #EN_SINGLESPACE 1
10389 . if \\n[#OK_PROCESS_LEAD] \{\
10390 . ENDNOTE_LEAD 12 ADJUST
10396 . nr #EN_SINGLESPACE 1
10398 . if \\n[#OK_PROCESS_LEAD] \{\
10399 . ENDNOTE_LEAD 12 ADJUST
10404 . rr #EN_SINGLESPACE
10406 . if \\n[#OK_PROCESS_LEAD] \{\
10407 . ENDNOTE_LEAD 24 ADJUST
10416 \# ENDNOTE PARAGRAPH SPACE
10417 \# -----------------------
10421 \# Creates toggle register #EN_PP_SPACE for use in .PP.
10423 \# Like PARA_SPACE. Default is not to space endnote paras.
10425 .MAC ENDNOTE_PARA_SPACE END
10426 . ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
10427 . el \{ .rr #EN_PP_SPACE \}
10436 \# Places superscript endnote number in text, then collects and
10437 \# processes endnote in diversion END_NOTES.
10439 \# \c must be appended to the word immediately preceding .ENDNOTE.
10444 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
10445 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
10446 . if \\n[#PRINT_STYLE]=1 \{\
10447 . if \\n[#UNDERLINE_ON] \{\
10448 . nr #UNDERLINE_WAS_ON 1
10451 . if \\n[#SLANT_ON] \{\
10452 . nr #SLANT_WAS_ON 1
10455 . PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2"
10457 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]" \}
10458 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
10460 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
10461 . INDENT_FIRST_PARAS
10464 . LL \\n[#DOC_L_LENGTH]u
10466 . if \\n[#COLUMNS] \{\
10467 . ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
10468 . el \{ .LL \\n[#COL_L_LENGTH]u \}
10471 . vs \\n[#EN_LEAD]u
10472 . if \\n[#EN_NUMBER]=1 \{\
10474 . if \\n[#PRINT_STYLE]=1 \{\
10479 . if \\n[#PRINT_STYLE]=2 \{\
10480 . FAMILY \\*[$EN_TITLE_FAM]
10481 . FT \\*[$EN_TITLE_FT]
10482 . PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
10485 . if !'\\*[$EN_TITLE]'' \{\
10486 . if '\\*[$EN_TITLE_QUAD]'L' \{ .LEFT \}
10487 . if '\\*[$EN_TITLE_QUAD]'LEFT' \{ .LEFT \}
10488 . if '\\*[$EN_TITLE_QUAD]'C' \{ .CENTER \}
10489 . if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
10490 . if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
10491 . if '\\*[$EN_TITLE_QUAD]'R' \{ .RIGHT \}
10492 . if '\\*[$EN_TITLE_QUAD]'RIGHT' \{ .RIGHT \}
10493 . ie \\n[#EN_TITLE_UNDERSCORE] \{\
10494 . UNDERSCORE "\\*[$EN_TITLE]
10497 . PRINT "\\*[$EN_TITLE]
10501 . ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
10502 . ie \\n[#EN_NUMBER]=1 \{\
10503 . if !'\\*[$EN_TITLE]'' \{ .sp \}
10507 . if \\n[#PRINT_STYLE]=1 \{\
10512 . if \\n[#PRINT_STYLE]=2 \{\
10513 . FAMILY \\*[$EN_NUMBER_FAM]
10514 . FT \\*[$EN_NUMBER_FT]
10515 . PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
10517 . nr #RESET_L_LENGTH \\n(.l
10518 . nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
10519 . ll \\n[#EN_NUMBER_L_LENGTH]u
10522 . if \\n[#PRINT_STYLE]=1 \{\
10527 . if \\n[#PRINT_STYLE]=2 \{\
10528 . FAMILY \\*[$EN_FAM]
10530 . PT_SIZE \\n[#EN_PS]u
10533 . ll \\n[#RESET_L_LENGTH]u
10534 . in \\n[#EN_NUMBER_L_LENGTH]u+\w'.\0'u
10535 . nr #EN_TEXT_INDENT \\n(.i
10536 . QUAD \\*[$EN_QUAD]
10540 . ie \\n[#EN_NUMBER]=1 \{\
10541 . if !'\\*[$EN_TITLE]'' \{ .sp \}
10544 . if \\n[#PRINT_STYLE]=1 \{\
10549 . if \\n[#PRINT_STYLE]=2 \{\
10550 . FAMILY \\*[$EN_NUMBER_FAM]
10551 . FT \\*[$EN_NUMBER_FT]
10552 . PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
10554 . QUAD \\*[$EN_QUAD]
10555 \En[#EN_NUMBER].\0\c
10556 . if \\n[#PRINT_STYLE]=2 \{\
10557 . FAMILY \\*[$EN_FAM]
10559 . PT_SIZE \\n[#EN_PS]u
10565 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
10570 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
10571 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
10572 . rr #INDENT_FIRSTS
10574 . if \\n[#PRINT_STYLE]=1 \{\
10575 . if \\n[#UNDERLINE_WAS_ON] \{\
10576 . rr #UNDERLINE_WAS_ON
10580 . if \\n[#SLANT_WAS_ON] \{\
10593 \# Sets new document leading from #EN_LEAD, breaks to a new page,
10594 \# sets up an endnotes page based on registers and strings associated
10595 \# with endnotes, then outputs diversion END_NOTES.
10599 . nr #PAGINATION_STATE \\n[#PAGINATE]
10600 . nr #EN_FIRST_PAGE 1
10601 . nr #HEADER_STATE \\n[#HEADERS_ON]
10602 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
10603 . if \\n[#HEADERS_ON]=1 \{\
10604 . if !\\n[#EN_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
10606 . if \\n[#HEADER_STATE]=1 \{\
10607 . ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
10608 . el \{ .rm $HDRFTR_CENTER \}
10610 . ie !\\n[#SUSPEND_PAGINATION] \{\
10611 . if \\n[#PAGINATE]=1 \{\
10612 . if \\n[#PAGE_NUM_V_POS]=1 \{\
10613 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
10614 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN]-1 \}
10615 . if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
10620 . ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
10621 . el \{ .nr #PAGINATE 0 \}
10623 . if \\n[#FOOTERS_ON]=1 \{\
10624 . if !'\\*[$HDRFTR_CENTER_OLD]'' \{ .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD] \}
10627 . if \\n[#FINIS] \{\
10628 . if \\n[#FOOTERS_WERE_ON] \{\
10630 . rr #FOOTERS_WERE_ON
10632 . if \\n[#PAGINATION_WAS_ON] \{\ \"This register only set in FINIS
10633 . if \\n[#PAGINATION_STATE]=1 \{\
10635 . rr #PAGINATION_WAS_ON
10640 . if \\n[#FOOTERS_WERE_ON] \{\
10642 . rr #FOOTERS_WERE_ON
10644 . if \\n[#PAGINATION_WAS_ON] \{\
10645 . if \\n[#PAGINATION_STATE]=1 \{\
10647 . rr #PAGINATION_WAS_ON
10650 . if \\n[#FOOTERS_ON]=1 \{\
10651 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
10652 . rm $HDRFTR_CENTER_OLD
10653 . rm $HDRFTR_CENTER_NEW
10655 . ie !\\n[#SUSPEND_PAGINATION] \{\
10656 . if \\n[#PAGE_NUM_V_POS]=1 \{\
10657 . if r#EN_NO_FIRST_PN \{\
10658 . if \\n[#PAGINATION_STATE]=1 \{\
10665 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
10667 . rr #PAGINATION_STATE
10668 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
10669 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
10670 . if \\n[#HEADER_STATE]=1 \{\
10671 . if \\n[#EN_ALLOWS_HEADERS] \{ .HEADERS \}
10673 \# Collect endnote title string for TOC
10674 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
10675 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
10676 . ds $TOC_TITLE_ITEM \\*[$EN_STRING]\\|
10679 . if \\n[#PRINT_STYLE]=1 \{\
10684 . if \\n[#PRINT_STYLE]=2 \{\
10685 \!. FAMILY \\*[$TOC_TITLE_FAM]
10686 \!. FT \\*[$TOC_TITLE_FT]
10687 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
10690 . ie \\n[#PRINT_STYLE]=1 \{\
10691 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
10694 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
10699 . if \\n[#PRINT_STYLE]=2 \{\
10700 \!. FAMILY \\*[$TOC_PN_FAM]
10701 \!. FT \\*[$TOC_PN_FT]
10702 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10705 \!. PRINT \\*[LEADER]
10708 \!. PRINT \\n[#TOC_ENTRY_PN]
10712 \# End collection of endnote title string for TOC
10714 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#EN_LEAD]u \}
10715 . if \\n[#PRINT_STYLE]=2 \{\
10716 . if \\n[#EN_NO_COLS] \{\
10717 . if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
10720 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
10721 . ie \\n[#ADJ_EN_LEAD] \{\
10722 . nr #DOC_LEAD \\n[#EN_LEAD]
10724 . el \{ .DOC_LEAD \\n[#EN_LEAD]u \}
10727 . sp |\\n[#T_MARGIN]u
10729 . if \\n[#SLANT_ON] \{\
10733 . if !'\\*[$EN_STRING]'' \{\
10734 . if \\n[#PRINT_STYLE]=1 \{\
10738 . vs \\n[#EN_LEAD]u
10740 . if \\n[#PRINT_STYLE]=2 \{\
10741 . LL \\n[#DOC_L_LENGTH]u
10743 . if \\n[#COLUMNS] \{\
10744 . ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
10745 . el \{ .LL \\n[#COL_L_LENGTH]u \}
10748 . FAMILY \\*[$EN_STRING_FAM]
10749 . FT \\*[$EN_STRING_FT]
10750 . PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
10751 . vs \\n[#EN_LEAD]u
10753 . if '\\*[$EN_STRING_QUAD]'L' \{ .LEFT \}
10754 . if '\\*[$EN_STRING_QUAD]'LEFT' \{ .LEFT \}
10755 . if '\\*[$EN_STRING_QUAD]'C' \{ .CENTER \}
10756 . if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
10757 . if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
10758 . if '\\*[$EN_STRING_QUAD]'R' \{ .RIGHT \}
10759 . if '\\*[$EN_STRING_QUAD]'RIGHT' \{ .RIGHT \}
10761 . if \\n[#EN_STRING_CAPS] \{ .CAPS \}
10762 . ie \\n[#EN_STRING_UNDERSCORE] \{\
10763 . ie \\n[#EN_STRING_UNDERSCORE]=2 \{\
10764 . UNDERSCORE2 "\\*[$EN_STRING]
10767 . UNDERSCORE "\\*[$EN_STRING]
10771 . PRINT "\\*[$EN_STRING]
10775 . ALD \\n[#EN_LEAD]u
10776 . QUAD \\*[$EN_QUAD]
10782 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#DOC_LEAD]u \}
10783 . if \\n[#PRINT_STYLE]=2 \{\
10784 . ie \\n[#ADJ_EN_LEAD] \{\
10785 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
10787 . el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
10788 . rr #RESTORE_DOC_LEAD
10790 . if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
10791 . if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
10795 \# ====================================================================
10797 \# +++TABLE OF CONTENTS+++
10799 \# Strings to allocate space for leaders and entry page numbers
10801 .ds $TOC_PN \\*[ST100]\\F[\\*[$TOC_PN_FAM]]\\f[\\*[$TOC_PN_FT]]\\s[\\n[#TOC_PS]u]#\\*[ST100X]\\*[ST101]\\s[\\*[$TOC_PN_SIZE_CHANGE]]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\*[ST101X]
10802 .ds $TOC_PN_TYPEWRITE \\*[ST100]#\\*[ST100X]\\*[ST101]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST101X]
10804 \# TOC ENTRIES PAGE NUMBERS PADDING
10805 \# --------------------------------
10807 \# <number of placeholders for toc entries page numbers>
10809 \# Creates or modifies register #TOC_PN_PADDING.
10811 \# "Placeholders" is the maximum number of digits in a page
10816 .MAC TOC_PADDING END
10817 . nr #TOC_PN_PADDING \\$1
10824 \# <none> | <anything>
10826 \# Creates or removes register #PAGINATE_TOC.
10828 \# Default is to paginate toc.
10830 .MAC PAGINATE_TOC END
10831 . ie '\\$1'' \{ .nr #PAGINATE_TOC 1 \}
10832 . el \{ .nr #PAGINATE_TOC 0 \}
10839 \# <overall default family for toc pages>
10841 \# Creates string $TOC_FAM.
10843 \# Default is same as document family.
10845 .MAC TOC_FAMILY END
10853 \# <base point size for toc pages>
10855 \# Creates or modifies register #TOC_PS.
10857 \# This size control macro differs from other size control macros
10858 \# in that it sets an absolute point size, not a relative one.
10859 \# See notes for ENDNOTE_PT_SIZE for explanation. No unit of
10860 \# measure required.
10862 \# No unit of measure required (points assumed). Default is 11.5
10865 .MAC TOC_PT_SIZE END
10866 . nr #TOC_PS (p;\\$1)
10873 \# <leading for toc pages> [ADJUST]
10875 \# Creates or modifies register #TOC_LEAD. If optional ADJUST
10876 \# given, adjusts lead to fill page. If #OK_PROCESS_LEAD doesn't
10877 \# exist, stores arguments for when it's okay to run the macro.
10879 \# No unit of measure required (points assumed).
10881 \# Default is same as DOC_LEAD.
10884 . if !\\n[#OK_PROCESS_LEAD] \{\
10885 . ds $TOC_LEAD \\$1
10887 . ds $ADJUST_TOC_LEAD \\$2
10892 . nr #TOC_LEAD (p;\\$1)
10893 . if '\\$2'ADJUST' \{\
10894 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
10895 . nr #ADJ_DOC_LEAD 1
10896 . nr #ADJ_TOC_LEAD 1
10897 . nr #NO_TRAP_RESET 1
10898 . DOC_LEAD \\n[#TOC_LEAD]u ADJUST
10899 . nr #TOC_LEAD \\n[#DOC_LEAD]
10900 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
10901 . rr #NO_TRAP_RESET
10903 . rr #ORIG_DOC_LEAD
10908 \# TOC PAGES PAGE-NUMBERING STYLE
10909 \# ------------------------------
10911 \# DIGIT | ROMAN | roman | ALPHA | alpha
10913 \# Creates or modifies string $TOC_PN_STYLE
10915 \# Page numbering style for page numbers that appear in the
10916 \# headers/footers of toc pages. See notes for PAGENUM_STYLE.
10918 \# Default is roman.
10920 .MAC TOC_PAGENUM_STYLE END
10921 . ds $TOC_PN_STYLE \\$1
10925 \# TOC RECTO_VERSO SWITCH
10926 \# ----------------------
10928 \# <none> | <anything>
10930 \# Creates or removes register #TOC_RV_SWITCH
10932 \# Allows switching of L/R margins if a doc is recto/verso and
10933 \# the first toc page happens to fall the wrong way
10935 .MAC TOC_RV_SWITCH END
10936 . ie '\\$1'' \{ .nr #TOC_RV_SWITCH 1 \}
10937 . el \{ .rr #TOC_RV_SWITCH \}
10940 \# - for TOC "doc header" (i.e. "Contents")
10942 \# TOC HEADER FAMILY
10943 \# -----------------
10945 \# <family for toc header>
10947 \# Creates or modifies string $TOC_HEADER_FAM
10949 \# Default is same as TOC_FAMILY.
10951 .MAC TOC_HEADER_FAMILY END
10952 . ds $TOC_HEADER_FAM \\$1
10959 \# <font for toc header>
10961 \# Creates or modified string $TOC_HEADER_FT
10963 \# Default is bold for TYPESET.
10965 .MAC TOC_HEADER_FONT END
10966 . ds $TOC_HEADER_FT \\$1
10973 \# <+|- number of points by which to in/decrease toc header
10974 \# (relative to overall toc point size)>
10976 \# Creates or modifies string $TOC_HEADER_SIZE_CHANGE.
10980 .MAC TOC_HEADER_SIZE END
10981 . ds $TOC_HEADER_SIZE_CHANGE \\$1
10988 \# L | LEFT | C | CENTER | CENTRE | R | RIGHT
10990 \# Creates or modifies string $TOC_HEADER_QUAD.
10992 \# Default is LEFT.
10994 .MAC TOC_HEADER_QUAD END
10995 . ds $TOC_HEADER_QUAD \\$1
10999 \# TOC HEADER STRING
11000 \# -----------------
11002 \# <string for "doc header" of first toc page>
11004 \# Creates or modifies string $TOC_HEADER_STRING
11006 \# Default is "Contents".
11008 .MAC TOC_HEADER_STRING END
11009 . ds $TOC_HEADER_STRING \\$1
11012 \# - for TOC entries page number numerals
11014 \# TOC ENTRIES PAGE NUMBER FAMILY
11015 \# ------------------------------
11017 \# <family to use for toc entries page number>
11019 \# Creates or modifies string $TOC_PN_FAM.
11021 \# Default is same as $TOC_FAM.
11023 .MAC TOC_PN_FAMILY END
11024 . ds $TOC_PN_FAM \\$1
11028 \# TOC ENTRIES PAGE NUMBER FONT
11029 \# ----------------------------
11031 \# <font to use for toc entries page number>
11033 \# Creates or modifies string $TOC_PN_FT.
11035 \# Default is roman.
11037 .MAC TOC_PN_FONT END
11038 . ds $TOC_PN_FT \\$1
11042 \# TOC ENTRIES PAGE NUMBER SIZE
11043 \# ----------------------------
11045 \# <+|- number of points by which to in/decrease toc
11046 \# entries page numbers (relative to overall toc point size)>
11048 \# Creates or modifies string $TOC_PN_SIZE_CHANGE.
11052 .MAC TOC_PN_SIZE END
11053 . ds $TOC_PN_SIZE_CHANGE \\$1
11057 \# Control macros for toc doc titles, heads, subheads and paraheads
11058 \# ----------------------------------------------------------------
11060 \# All these control macros behave the same way, setting the family,
11061 \# font, point size and indent from the left margin of the different
11062 \# kinds of entries that can appear in the toc. The way they
11063 \# operate is identical to all other _FAMILY, _FONT and _SIZE
11064 \# control macros. _INDENT takes an absolute value.
11065 \# TOC_APPENDS_AUTHORS is unique in this section.
11067 \# - for title entries
11069 .MAC TOC_TITLE_FAMILY END
11070 . ds $TOC_TITLE_FAM \\$1
11074 .MAC TOC_TITLE_FONT END
11075 . ds $TOC_TITLE_FT \\$1
11079 .MAC TOC_TITLE_SIZE END
11080 . ds $TOC_TITLE_SIZE_CHANGE \\$1
11084 .MAC TOC_TITLE_INDENT END
11085 . nr #TOC_TITLE_INDENT (\\$1)
11089 .MAC TOC_TITLE_ENTRY END
11090 . nr #USER_SET_TITLE_ITEM 1
11091 . ds $USER_SET_TITLE_ITEM \\$1
11095 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
11096 \# -----------------------------------------
11098 \# <none> | <name(s) of author(s) as they should appear in toc doc title entries>
11100 \# Creates register #TOC_AUTHORS (to tell TOC to append authors
11101 \# to toc doc title entries). Optionally creates string
11104 \# Normally, TOC does not append the author(s) to a toc doc title
11105 \# entry. This special macro instructs TOC to do so.
11107 \# If user has multiple authors for each doc when collating,
11108 \# TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
11109 \# COLLATE and START in each doc. Otherwise, mom prints only the
11110 \# first author given to AUTHOR.
11112 .MAC TOC_APPENDS_AUTHOR END
11113 . nr #TOC_AUTHORS 1
11115 . ds $TOC_AUTHORS \\$1
11119 \# - for head entries
11121 .MAC TOC_HEAD_FAMILY END
11122 . ds $TOC_HEAD_FAM \\$1
11126 .MAC TOC_HEAD_FONT END
11127 . ds $TOC_HEAD_FT \\$1
11131 .MAC TOC_HEAD_SIZE END
11132 . ds $TOC_HEAD_SIZE_CHANGE \\$1
11136 .MAC TOC_HEAD_INDENT END
11137 . nr #TOC_HEAD_INDENT (\\$1)
11140 \# - for subhead entries
11142 .MAC TOC_SUBHEAD_FAMILY END
11143 . ds $TOC_SH_FAM \\$1
11147 .MAC TOC_SUBHEAD_FONT END
11148 . ds $TOC_SH_FT \\$1
11152 .MAC TOC_SUBHEAD_SIZE END
11153 . ds $TOC_SH_SIZE_CHANGE \\$1
11157 .MAC TOC_SUBHEAD_INDENT END
11158 . nr #TOC_SH_INDENT (\\$1)
11161 \# - for parahead entries
11163 .MAC TOC_PARAHEAD_FAMILY END
11164 . ds $TOC_PH_FAM \\$1
11168 .MAC TOC_PARAHEAD_FONT END
11169 . ds $TOC_PH_FT \\$1
11173 .MAC TOC_PARAHEAD_SIZE END
11174 . ds $TOC_PH_SIZE_CHANGE \\$1
11178 .MAC TOC_PARAHEAD_INDENT END
11179 . nr #TOC_PH_INDENT (\\$1)
11184 . if !r#PAGINATE_TOC \{ .PAGINATE_TOC \}
11185 . nr #TOC_FIRST_PAGE 1
11186 . if \\n[#FINIS] \{\
11187 . if \\n[#FOOTERS_WERE_ON] \{\
11188 . FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
11191 . if \\n[#FOOTERS_ON]=1 \{\
11192 . if !'\\*[$HDRFTR_CENTER_OLD]'' \{ .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD] \}
11193 . ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
11194 . el \{ .PAGINATION OFF \}
11196 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS OFF \} \" But have to turn FOOTERS off again so they don't print when FINIS was called
11198 . if \\n[#FINIS] \{\
11199 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \} \" Finally, turn footers on if they were on
11200 . rr #FOOTERS_WERE_ON
11201 . if \\n[#PAGINATION_WAS_ON] \{\
11203 . rr #PAGINATION_WAS_ON
11207 . ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
11208 . el \{ .PAGINATION OFF \}
11209 . if \\n[#FOOTERS_ON]=1 \{\
11210 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
11211 . rm $HDRFTR_CENTER_OLD
11212 . rm $HDRFTR_CENTER_NEW
11217 . if \\n[#PRINT_STYLE]=1 \{\
11219 . DOC_LEAD 24 ADJUST
11225 . if \\n[#PRINT_STYLE]=2 \{\
11226 . ie r#ADJ_TOC_LEAD \{\
11227 . nr #NO_TRAP_RESET 1
11228 . DOC_LEAD \\n[#TOC_LEAD]u ADJUST
11229 . rr #NO_TRAP_RESET
11231 . el \{ .DOC_LEAD \\n[#TOC_LEAD]u \}
11233 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
11234 . if \\n[#SLANT_ON] \{\
11237 . DOC_LINE_LENGTH \\n[#DOC_L_LENGTH]u
11238 . QUAD \\*[$TOC_HEADER_QUAD]
11239 . PAGENUM_STYLE \\*[$TOC_PN_STYLE]
11240 . if \\n[#PRINT_STYLE]=1 \{\
11245 . if \\n[#PRINT_STYLE]=2 \{\
11246 . FAMILY \\*[$TOC_HEADER_FAM]
11247 . FT \\*[$TOC_HEADER_FT]
11248 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
11250 . ie \\n[#PRINT_STYLE]=1 \{\
11253 . PRINT "\\*[$TOC_HEADER_STRING]"
11258 . PRINT "\\*[$TOC_HEADER_STRING]"
11262 \# In collated docs, this bit inserts the first doc's title
11263 \# underneath the TOC header, before the TOC_ENTRIES diversion
11266 . if d$FIRST_DOC_TITLE \{\
11267 . nr #RESTORE_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
11268 . TOC_PADDING \\n[#FIRST_DOC_TOC_PN_PADDING]
11269 . if \\n[#PRINT_STYLE]=2 \{\
11270 . FAMILY \\*[$TOC_TITLE_FAM]
11271 . FT \\*[$TOC_TITLE_FT]
11272 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
11274 . ie \\n[#PRINT_STYLE]=1 \{\
11275 . PAD "\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN_TYPEWRITE]"
11278 . PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN]"
11283 . if \\n[#PRINT_STYLE]=2 \{\
11284 . FAMILY \\*[$TOC_PN_FAM]
11285 . FT \\*[$TOC_PN_FT]
11286 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
11289 . PRINT \\*[LEADER]
11291 . PRINT \\n[#FIRST_DOC_TITLE_PN]
11294 . TOC_PADDING \\n[#RESTORE_TOC_PN_PADDING]
11301 \# ====================================================================
11308 \# <number of columns> <width of gutters>
11310 \# Creates registers associated with setting docs in columns.
11311 \# Calculates column line lengths and offsets
11313 \# COLUMNS, if used, s/b the last macro invoked before START.
11316 . if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
11318 . nr #NUM_COLS \\$1
11319 . nr #GUTTER (\\$2)
11320 . nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
11321 . nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
11323 . while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11324 . nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
11325 . nr #COL_TOTAL \\n+[#COL_TOTAL]
11337 \# Breaks current column and moves to next column.
11338 \# If current column is the last on the page, breaks
11342 . if \\n[#COLUMNS] \{\
11344 . ie '\\$0'COL_NEXT' \{ .br \}
11349 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
11356 \# ====================================================================
11363 \# [ BULLET | DASH | DIGIT | ALPHA | USER ] [ <separator> ] [ <anything> ]
11365 \# Stores indent information in effect prior to invocation and
11366 \# initializes a list with the supplied enumerator (and separator).
11368 \# Default enumerator is a bullet.
11370 \# Enumerator *must* be supplied for every list that's to the
11371 \# right of another list, every time, unless the default bullet is
11374 \# <anything> moves back one list level intuitively, or exits lists
11375 \# completely if the level at which it's invoked is the first.
11379 . nr #STORED_HL_INDENT \\n[#HL_INDENT]
11380 . nr #STORED_T_INDENT \\n[#T_INDENT]
11381 . nr #CURRENT_L_LENGTH \\n(.l
11383 . if \\n[#INDENT_ACTIVE]=1 \{\
11384 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
11385 . nr #STORED_L_INDENT \\n[#L_INDENT]
11386 . nr #RESTORE_PREV_INDENT 1
11388 . if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
11389 . nr #STORED_BL_INDENT \\n[#BL_INDENT]
11390 . nr #STORED_BR_INDENT \\n[#BR_INDENT]
11392 . nr #ORIG_L_LENGTH \\n(.l
11394 . nr #RESTORE_PREV_INDENT 2
11396 . if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
11397 . nr #STORED_R_INDENT \\n[#R_INDENT]
11399 . nr #ORIG_L_LENGTH \\n(.l
11401 . nr #RESTORE_PREV_INDENT 3
11402 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{ .nr #RESTORE_PREV_INDENT 4 \}
11406 . if \\n[#NUM_ARGS]=0 \{\
11407 . nr #ARGS_TO_LIST 1 \" So default behaves as if LIST BULLET
11408 . ds $ENUMERATOR\\n+[#DEPTH] \(bu
11411 . if \\n[#NUM_ARGS]>0 \{\
11412 . rr #ARGS_TO_LIST \" Clear this before processing arg 1.
11413 . if '\\$1'DASH' \{\
11414 . nr #ARGS_TO_LIST 1
11415 . ds $ENUMERATOR\\n+[#DEPTH] \(en
11416 . ds $SEPARATOR\\n[#DEPTH]
11418 . if '\\$1'BULLET' \{\
11419 . nr #ARGS_TO_LIST 1
11420 . ds $ENUMERATOR\\n+[#DEPTH] \(bu
11421 . ds $SEPARATOR\\n[#DEPTH]
11423 . if '\\$1'DIGIT' \{\
11424 . nr #ARGS_TO_LIST 1
11425 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
11426 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
11427 . ds $SEPARATOR\\n[#DEPTH] .
11428 . if \\n[#NUM_ARGS]=2 \{\
11429 . ie '\\$2'NONE' \{ .ds $SEPARATOR\\n[#DEPTH]\}
11430 . el \{ .ds $SEPARATOR\\n[#DEPTH] \\$2\}
11433 . if '\\$1'ALPHA' \{\
11434 . nr #ARGS_TO_LIST 1
11435 . nr #ENUMERATOR\\n+[#DEPTH] 0 1
11436 . af #ENUMERATOR\\n[#DEPTH] a
11437 . ds $ENUMERATOR_TYPE\\n[#DEPTH] register
11438 . ds $SEPARATOR\\n[#DEPTH] )
11439 . if \\n[#NUM_ARGS]=2 \{\
11440 . ie '\\$2'NONE' \{ .ds $SEPARATOR\\n[#DEPTH]\}
11441 . el \{ .ds $SEPARATOR\\n[#DEPTH] \\$2\}
11444 . if '\\$1'USER' \{\
11445 . nr #ARGS_TO_LIST 1
11446 . ds $ENUMERATOR\\n+[#DEPTH] \\$2
11447 . ds $SEPARATOR\\n[#DEPTH]
11449 . if \\n[#NUM_ARGS]=1 \{\
11450 . if !r#ARGS_TO_LIST \{\
11451 . ie \\n[#DEPTH]=1 \{\
11452 . ie \\n[#NEXT_DEPTH_BACK]=0 \{\
11454 . if \\n[#QUIT]=1 \{\
11472 . nr #TOTAL_LISTS \\n[#DEPTH]
11473 . ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
11474 . nr #LIST_INDENT\\n[#DEPTH] \\w'm\\*[$SEPARATOR\\n[#DEPTH]]\\ '
11477 . nr #LIST_INDENT\\n[#DEPTH] \\w'\\*[$ENUMERATOR\\n[#DEPTH]]\\0'
11479 . LL \\n[#CURRENT_L_LENGTH]u
11480 . ie \\n[#DEPTH]=1 \{\
11481 . ie \\n[#INDENT_ACTIVE]=1 \{\
11482 . if \\n[#INDENT_LEFT_ACTIVE]=1 \{\
11483 . nr #L_INDENT \\n[#L_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
11484 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
11485 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
11487 . if \\n[#INDENT_BOTH_ACTIVE]=1 \{\
11488 . nr #L_INDENT \\n[#BL_INDENT]+\\n[#LIST_INDENT\\n[#DEPTH]]
11489 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
11490 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]
11492 . if \\n[#INDENT_RIGHT_ACTIVE]=1 \{\
11493 . ie \\n[#INDENT_LEFT_ACTIVE]=1 \{\
11494 . \" Don't do anything; we already have a left indent
11497 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
11498 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
11503 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
11504 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
11508 . nr #L_INDENT +\\n[#LIST_INDENT\\n[#DEPTH]]
11509 . nr #HL_INDENT\\n[#DEPTH] \\n[#LIST_INDENT\\n[#DEPTH]]
11519 \# Prints enumerator for a given list depth and prepares mom to
11520 \# receive the text of an item.
11525 . ll \\n[#CURRENT_L_LENGTH]u \" Set ll again because IL turns IB off.
11527 . HI \\n[#HL_INDENT\\n[#DEPTH]]u
11528 . ie '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'register' \{\
11529 . ie '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
11530 . ie \\n[#PAD_LIST_DIGITS\\n[#DEPTH]]=1 \{\
11531 . ie \\n[#ENUMERATOR\\n[#DEPTH]]<9 \{\
11532 . PRINT \\0\\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
11535 . PRINT \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
11539 . PRINT \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
11543 . PRINT \\n+[#ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
11547 . PRINT \\*[$ENUMERATOR\\n[#DEPTH]]\\*[$SEPARATOR\\n[#DEPTH]]
11558 \# <amount by which to indent a list to the right>
11560 \# Adds the value of the arg to the current list's indent.
11562 \# Requires a unit of measure.
11564 .MAC SHIFT_LIST END
11565 . nr #LIST_INDENT\\n[#DEPTH] \\n[#L_INDENT]+(\\$1)
11566 . nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]
11575 \# Adds a figure space to a list's hanging and left indent. If
11576 \# LEFT is given, sets reg. #PAD_LIST_DIGITS to 1 for use in ITEM.
11578 .MAC PAD_LIST_DIGITS END
11579 . if '\\g[#ENUMERATOR\\n[#DEPTH]]'0' \{\
11580 . nr #LIST_INDENT\\n[#DEPTH] +\\w'\\0'
11581 . nr #L_INDENT \\n[#LIST_INDENT\\n[#DEPTH]]+\\n[#LIST_INDENT\\n-[#DEPTH]]
11582 . nr #HL_INDENT\\n+[#DEPTH] +\\w'\\n[#ENUMERATOR\\n[#DEPTH]]'
11583 . if '\\$1'LEFT' \{ .nr #PAD_LIST_DIGITS\\n[#DEPTH] 1 \}
11593 \# Resets register enumerators to 1 or a.
11595 .MAC RESET_LIST END
11596 . nr #ENUMERATOR\\n[#DEPTH] 0 1
11605 \# Exits lists cleanly and restores any indents that were in
11606 \# effect prior to LIST.
11608 .MAC QUIT_LISTS END
11610 . nr #HL_INDENT \\n[#STORED_HL_INDENT]
11611 . nr #T_INDENT \\n[#STORED_T_INDENT]
11612 . rr #STORED_HL_INDENT
11613 . if \\n[#RESTORE_PREV_INDENT]=1 \{\
11614 . nr #L_INDENT \\n[#STORED_L_INDENT]
11616 . rr #STORED_L_INDENT
11618 . if \\n[#RESTORE_PREV_INDENT]=2 \{\
11619 . nr #BL_INDENT \\n[#STORED_BL_INDENT]
11620 . nr #BR_INDENT \\n[#STORED_BR_INDENT]
11621 . LL \\n[#ORIG_L_LENGTH]u
11623 . rr #STORED_BL_INDENT
11624 . rr #STORED_BR_INDENT
11626 . if \\n[#RESTORE_PREV_INDENT]=3 \{\
11627 . nr #R_INDENT \\n[#STORED_R_INDENT]
11628 . LL \\n[#ORIG_L_LENGTH]u
11630 . rr #STORED_R_INDENT
11632 . if \\n[#RESTORE_PREV_INDENT]=4 \{\
11633 . nr #R_INDENT \\n[#STORED_R_INDENT]
11634 . nr #L_INDENT \\n[#STORED_L_INDENT]
11635 . LL \\n[#ORIG_L_LENGTH]u
11638 . rr #STORED_R_INDENT
11639 . rr #STORED_L_INDENT
11641 .\" Clean up after exiting last depth of list
11643 . while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\
11644 . rr #LIST_INDENT\\n[#REMOVE]
11645 . rr #ENUMERATOR\\n[#REMOVE]
11646 . rm $ENUMERATOR\\n[#REMOVE]
11647 . rr #SEPARATOR\\n[#REMOVE]
11648 . rm $ENUMERATOR_TYPE\\n[#REMOVE]
11649 . rr #PAD_LIST_DIGITS\\n[#REMOVE]
11655 . rr #NEXT_DEPTH_BACK
11656 . rr #RESTORE_PREV_INDENT
11657 . rr #ORIG_L_LENGTH
11658 . rr #CURRENT_L_LENGTH
11667 \# Restores indent of prev. list in nested lists. Also sets the
11668 \# #QUIT register if an invocation of LIST OFF applies to the first
11671 .MAC SET_LIST_INDENT END
11672 . nr #NEXT_DEPTH_BACK \\n[#DEPTH]-1
11673 . if \\n[#NEXT_DEPTH_BACK]=0 \{\
11677 . ie \\n[#NEXT_DEPTH_BACK]=1 \{ .nr #L_INDENT \\n[#LIST_INDENT1] \}
11678 . el \{ .nr #L_INDENT -\\n[#LIST_INDENT\\n[#DEPTH]] \}
11679 . nr #HL_INDENT \\n[#HL_INDENT\\n-[#DEPTH]]
11682 \# ====================================================================
11684 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
11691 \# Turns headers off (if on) and saves header state, sets register
11692 \# #COLLATE to 1 (toggle), and breaks to a new page.
11694 \# COLLATE exists primarily to allow putting multiple chapters in
11695 \# a single file, although it can be used for any document type. After
11696 \# COLLATE, any of the macros that normally precede START may be
11697 \# used, and should behave as expected.
11699 \# N.B.--the START macro *must* be used after COLLATE (and any other
11700 \# macros that alter mom's behaviour).
11704 . nr #HEADER_STATE \\n[#HEADERS_ON]
11706 . if \\n[#PAGE_NUM_V_POS]=1 \{\
11707 . nr #PAGINATION_STATE \\n[#PAGINATE]
11712 \# Collect first doc's title for TOC
11713 . if \\n[#COLLATED_DOC]=0 \{\
11714 . ie \\n[#USER_SET_TITLE_ITEM] \{\
11715 . ds $FIRST_DOC_TITLE \\*[$USER_SET_TITLE_ITEM]\\|
11716 . rr #USER_SET_TITLE_ITEM
11717 . rm $USER_SET_TITLE_ITEM
11720 . ie \\n[#DOC_TYPE]=2 \{\
11721 . ie '\\*[$CHAPTER_TITLE]'' \{\
11722 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
11725 . ie '\\*[$CHAPTER]'' \{\
11726 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_TITLE]\\|
11729 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
11734 . ds $FIRST_DOC_TITLE \\*[$TITLE]\\|
11737 . if \\n[#TOC_AUTHORS]=1 \{\
11738 . ie '\\*[$TOC_AUTHORS]'' \{\
11739 . as $FIRST_DOC_TITLE /\\|\\*[$AUTHOR_1]\\|
11742 . as $FIRST_DOC_TITLE /\\|\\*[$TOC_AUTHORS]\\|
11746 . nr #COLLATED_DOC 1
11748 \# End title collection for TOC
11749 . LL \\n[#DOC_L_LENGTH]u
11751 . LS \\n[#DOC_LEAD]u
11756 . if \\n[#DEFER_PAGINATION] \{ .PAGINATE \}
11757 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
11758 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
11759 . rm $RESTORE_PAGENUM_STYLE
11762 . rr #PAGENUM_STYLE_SET
11766 \# OUTPUT BLANK PAGES
11767 \# ------------------
11769 \# <number of blank pages to output>
11771 \# Outputs blank pages.
11773 \# If recto/verso, each page is recto/verso, even if there's
11777 . nr #HOW_MANY \\$1
11779 . while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
11780 . if \\n[#HEADERS_ON]=1 \{\
11781 . nr #HEADERS_WERE_ON 1
11784 . if \\n[#PAGE_NUM_V_POS]=1 \{\
11785 . if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
11790 . if \\n[#FOOTERS_ON]=1 \{\
11791 . nr #FOOTERS_WERE_ON 1
11794 . if \\n[#PAGE_NUM_V_POS]=2 \{\
11795 . if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
11798 . if \\n[#HEADERS_WERE_ON] \{ .HEADERS \}
11799 . if \\n[#PAGE_NUM_V_POS]=1 \{\
11800 . if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
11804 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \}
11805 . if \\n[#PAGE_NUM_V_POS]=2 \{\
11806 . if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
11808 . rr #HEADERS_WERE_ON
11809 . rr #FOOTERS_WERE_ON
11810 . rr #PAGINATE_WAS_ON
11814 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
11815 \# ---------------------------------------
11819 \# Sets header/footer/footnotes/etc... traps.
11820 \# Calculates the number of lines that actually fit on a
11821 \# page based on #B_MARGIN and resets page bottom trap to coincide
11822 \# with the depth of that number of lines, or, if #ADJ_DOC_LEAD=1,
11823 \# adjusts #DOC_LEAD so that the last line of text on a page falls
11824 \# exactly on #B_MARGIN.
11827 \# *Remove all header/footer traps
11828 . if !\\n[#NO_TRAP_RESET] \{\
11833 \# *Plant header trap
11836 \# *Adjust lead so last line of text falls on B_MARGIN,...
11837 . ie \\n[#ADJ_DOC_LEAD]=1 \{\
11838 . nr #LINES_PER_PAGE 0 1
11839 . nr #DOC_LEAD_ADJ 0 1
11840 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
11841 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
11844 . nr #LINES_PER_PAGE -1
11845 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
11848 . DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
11850 \# *...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
11853 . nr #LINES_PER_PAGE 0 1
11854 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
11855 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
11858 . nr #B_MARGIN \\n[#PAGE_LENGTH]-(\\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n[#LINES_PER_PAGE]))
11860 \# *Set footer and footnote overflow traps
11861 . if !\\n[#NO_TRAP_RESET] \{\
11863 . nr #SPACE_REMAINING 0
11865 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
11867 . wh -\\n[#B_MARGIN]u FN_OVERFLOW_TRAP
11868 . ch FOOTER -\\n[#B_MARGIN]u
11879 \# Adds left, right, or both indent values to document elements
11880 \# like heads and subheads that are processed in environments.
11882 .MAC CHECK_INDENT END
11883 . if \\n[#INDENT_LEFT_ACTIVE] \{\
11884 . in \\n[#L_INDENT]u
11885 . if \\n[#QUOTE] \{\
11886 . in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
11887 . ll -\\n[#L_INDENT]u
11890 . if \\n[#EPIGRAPH] \{\
11891 . in -\\n[#L_INDENT]u
11892 . ll -\\n[#L_INDENT]u
11896 . if \\n[#INDENT_RIGHT_ACTIVE] \{\
11897 . ll -\\n[#R_INDENT]u
11900 . if \\n[#INDENT_BOTH_ACTIVE] \{\
11901 . in \\n[#BL_INDENT]u
11902 . ll -\\n[#BR_INDENT]u
11904 . if \\n[#QUOTE] \{\
11905 . in -\\n[#BL_INDENT]u
11906 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
11907 . ll -\\n[#BR_INDENT]u
11911 . ll -(\\n[#BR_INDENT]u/2u)
11915 . if \\n[#EPIGRAPH] \{\
11916 . in -\\n[#BL_INDENT]u
11917 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
11918 . ll -\\n[#BR_INDENT]u
11922 . ll -(\\n[#BR_INDENT]u/2u)
11935 \# Removes left, right, or both indent values from document elements
11936 \# like heads and subheads that are processed in environments.
11938 .MAC REMOVE_INDENT END
11940 . ll \\n[#L_LENGTH]u
11945 \# Set up a default papersize of US letter
11949 \# ====================================================================
11951 \# +++DOCUMENT PROCESSING ALIASES+++
11953 \# Aliases to make life easier for users: synonyms, short forms
11954 \# and alternate spellings.
11958 .ALIAS BLOCKQUOTE_COLOUR BLOCKQUOTE_COLOR
11959 .ALIAS BREAK_BLOCKQUOTE BREAK_QUOTE
11960 .ALIAS BREAK_CITATION BREAK_QUOTE
11961 .ALIAS BREAK_CITE BREAK_QUOTE
11962 .ALIAS CITATION BLOCKQUOTE
11963 .ALIAS CITATION_COLOUR CITATION_COLOR
11964 .ALIAS CITATION_FAMILY BLOCKQUOTE_FAMILY
11965 .ALIAS CITATION_FONT BLOCKQUOTE_FONT
11966 .ALIAS CITATION_SIZE BLOCKQUOTE_SIZE
11967 .ALIAS CITATION_COLOR BLOCKQUOTE_COLOR
11968 .ALIAS CITATION_QUAD BLOCKQUOTE_QUAD
11969 .ALIAS CITE BLOCKQUOTE
11970 .ALIAS CITE_COLOUR CITE_COLOR
11971 .ALIAS CITE_FAMILY BLOCKQUOTE_FAMILY
11972 .ALIAS CITE_FONT BLOCKQUOTE_FONT
11973 .ALIAS CITE_SIZE BLOCKQUOTE_SIZE
11974 .ALIAS CITE_COLOR BLOCKQUOTE_COLOR
11975 .ALIAS CITE_QUAD BLOCKQUOTE_QUAD
11976 .ALIAS DOC_R_MARGIN DOC_RIGHT_MARGIN
11977 .ALIAS DOC_L_MARGIN DOC_LEFT_MARGIN
11978 .ALIAS DOC_L_LENGTH DOC_LINE_LENGTH
11979 .ALIAS DOC_RMARGIN DOC_RIGHT_MARGIN
11980 .ALIAS DOC_LMARGIN DOC_LEFT_MARGIN
11981 .ALIAS DOC_LLENGTH DOC_LINE_LENGTH
11982 .ALIAS DOC_FAM DOC_FAMILY
11983 .ALIAS DOC_LS DOC_LEAD
11984 .ALIAS DOC_PS DOC_PT_SIZE
11985 .ALIAS DOCHEADER_COLOUR DOCHEADER_COLOUR
11986 .ALIAS EPIGRAPH_COLOUR EPIGRAPH_COLOR
11988 .ALIAS FINIS_COLOUR FINIS_COLOR
11989 .ALIAS HEAD_COLOUR HEAD_COLOR
11990 .ALIAS LINEBREAK_COLOUR LINEBREAK_COLOR
11991 .ALIAS PAGENUM PAGENUMBER
11992 .ALIAS PAGENUM_COLOUR PAGENUM_COLOR
11993 .ALIAS PAGINATION PAGINATE
11994 .ALIAS PARAHEAD_COLOUR PARAHEAD_COLOR
11995 .ALIAS PP_FT PP_FONT
11996 .ALIAS QUOTE_COLOUR QUOTE_COLOR
11997 .ALIAS SUBHEAD_COLOUR SUBHEAD_COLOR
11998 .ALIAS TOC_FAM TOC_FAM
11999 .ALIAS TOC_PS TOC_PT_SIZE
12001 \# HEADER and FOOTER aliases for HDRFTR macros.
12003 .ALIAS ENDNOTES_FOOTER_CENTER ENDNOTES_HDRFTR_CENTER
12004 .ALIAS ENDNOTES_HEADER_CENTER ENDNOTES_HDRFTR_CENTER
12005 .ALIAS ENDNOTES_FOOTER_CENTRE ENDNOTES_HDRFTR_CENTRE
12006 .ALIAS ENDNOTES_HEADER_CENTRE ENDNOTES_HDRFTR_CENTRE
12007 .ALIAS FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS
12008 .ALIAS FOOTER_CENTER_COLOR HDRFTR_CENTER_COLOR
12009 .ALIAS FOOTER_CENTER_COLOUR HDRFTR_CENTER_COLOUR
12010 .ALIAS FOOTER_CENTER_FAM HDRFTR_CENTER_FAMILY
12011 .ALIAS FOOTER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
12012 .ALIAS FOOTER_CENTER_FONT HDRFTR_CENTER_FONT
12013 .ALIAS FOOTER_CENTER_FT HDRFTR_CENTER_FONT
12014 .ALIAS FOOTER_CENTER HDRFTR_CENTER
12015 .ALIAS FOOTER_CENTER_PAD HDRFTR_CENTER_PAD
12016 .ALIAS FOOTER_CENTER_PS HDRFTR_CENTER_SIZE
12017 .ALIAS FOOTER_CENTER_SIZE HDRFTR_CENTER_SIZE
12018 .ALIAS FOOTER_CENTRE_CAPS HDRFTR_CENTER_CAPS
12019 .ALIAS FOOTER_CENTRE_COLOR HDRFTR_CENTRE_COLOR
12020 .ALIAS FOOTER_CENTRE_COLOUR HDRFTR_CENTRE_COLOUR
12021 .ALIAS FOOTER_CENTRE_FAM HDRFTR_CENTER_FAMILY
12022 .ALIAS FOOTER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
12023 .ALIAS FOOTER_CENTRE_FONT HDRFTR_CENTER_FONT
12024 .ALIAS FOOTER_CENTRE_FT HDRFTR_CENTER_FONT
12025 .ALIAS FOOTER_CENTRE HDRFTR_CENTER
12026 .ALIAS FOOTER_CENTRE_PAD HDRFTR_CENTER_PAD
12027 .ALIAS FOOTER_CENTRE_PS HDRFTR_CENTER_SIZE
12028 .ALIAS FOOTER_CENTRE_SIZE HDRFTR_CENTER_SIZE
12029 .ALIAS FOOTER_COLOR HDRFTR_COLOR
12030 .ALIAS FOOTER_COLOUR HDRFTR_COLOR
12031 .ALIAS FOOTER_FAM HDRFTR_FAMILY
12032 .ALIAS FOOTER_FAMILY HDRFTR_FAMILY
12033 .ALIAS FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS
12034 .ALIAS FOOTER_LEFT_COLOR HDRFTR_LEFT_COLOR
12035 .ALIAS FOOTER_LEFT_COLOUR HDRFTR_LEFT_COLOUR
12036 .ALIAS FOOTER_LEFT_FAM HDRFTR_LEFT_FAMILY
12037 .ALIAS FOOTER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
12038 .ALIAS FOOTER_LEFT_FONT HDRFTR_LEFT_FONT
12039 .ALIAS FOOTER_LEFT_FT HDRFTR_LEFT_FONT
12040 .ALIAS FOOTER_LEFT HDRFTR_LEFT
12041 .ALIAS FOOTER_LEFT_PS HDRFTR_LEFT_SIZE
12042 .ALIAS FOOTER_LEFT_SIZE HDRFTR_LEFT_SIZE
12043 .ALIAS FOOTER_PLAIN HDRFTR_PLAIN
12044 .ALIAS FOOTER_RECTO HDRFTR_RECTO
12045 .ALIAS FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
12046 .ALIAS FOOTER_RIGHT_COLOR HDRFTR_RIGHT_COLOR
12047 .ALIAS FOOTER_RIGHT_COLOUR HDRFTR_RIGHT_COLOUR
12048 .ALIAS FOOTER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
12049 .ALIAS FOOTER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
12050 .ALIAS FOOTER_RIGHT_FONT HDRFTR_RIGHT_FONT
12051 .ALIAS FOOTER_RIGHT_FT HDRFTR_RIGHT_FONT
12052 .ALIAS FOOTER_RIGHT HDRFTR_RIGHT
12053 .ALIAS FOOTER_RIGHT_PS HDRFTR_RIGHT_SIZE
12054 .ALIAS FOOTER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
12055 .ALIAS FOOTER_RULE_COLOR HDRFTR_RULE_COLOR
12056 .ALIAS FOOTER_RULE_GAP HDRFTR_RULE_GAP
12057 .ALIAS FOOTER_RULE HDRFTR_RULE
12058 .ALIAS FOOTER_SIZE HDRFTR_SIZE
12059 .ALIAS FOOTER_VERSO HDRFTR_VERSO
12060 .ALIAS HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS
12061 .ALIAS HEADER_CENTER_COLOR HDRFTR_CENTER_COLOR
12062 .ALIAS HEADER_CENTER_COLOUR HDRFTR_CENTER_COLOUR
12063 .ALIAS HEADER_CENTER_FAM HDRFTR_CENTER_FAMILY
12064 .ALIAS HEADER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
12065 .ALIAS HEADER_CENTER_FONT HDRFTR_CENTER_FONT
12066 .ALIAS HEADER_CENTER_FT HDRFTR_CENTER_FONT
12067 .ALIAS HEADER_CENTER HDRFTR_CENTER
12068 .ALIAS HEADER_CENTER_PAD HDRFTR_CENTER_PAD
12069 .ALIAS HEADER_CENTER_PS HDRFTR_CENTER_SIZE
12070 .ALIAS HEADER_CENTER_SIZE HDRFTR_CENTER_SIZE
12071 .ALIAS HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS
12072 .ALIAS HEADER_CENTRE_COLOR HDRFTR_CENTRE_COLOR
12073 .ALIAS HEADER_CENTRE_COLOUR HDRFTR_CENTRE_COLOUR
12074 .ALIAS HEADER_CENTRE_FAM HDRFTR_CENTER_FAMILY
12075 .ALIAS HEADER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
12076 .ALIAS HEADER_CENTRE_FONT HDRFTR_CENTER_FONT
12077 .ALIAS HEADER_CENTRE_FT HDRFTR_CENTER_FONT
12078 .ALIAS HEADER_CENTRE HDRFTR_CENTER
12079 .ALIAS HEADER_CENTRE_PAD HDRFTR_CENTER_PAD
12080 .ALIAS HEADER_CENTRE_PS HDRFTR_CENTER_SIZE
12081 .ALIAS HEADER_CENTRE_SIZE HDRFTR_CENTER_SIZE
12082 .ALIAS HEADER_COLOR HDRFTR_COLOR
12083 .ALIAS HEADER_COLOUR HDRFTR_COLOR
12084 .ALIAS HEADER_FAM HDRFTR_FAMILY
12085 .ALIAS HEADER_FAMILY HDRFTR_FAMILY
12086 .ALIAS HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS
12087 .ALIAS HEADER_LEFT_COLOR HDRFTR_LEFT_COLOR
12088 .ALIAS HEADER_LEFT_COLOUR HDRFTR_LEFT_COLOUR
12089 .ALIAS HEADER_LEFT_FAM HDRFTR_LEFT_FAMILY
12090 .ALIAS HEADER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
12091 .ALIAS HEADER_LEFT_FONT HDRFTR_LEFT_FONT
12092 .ALIAS HEADER_LEFT_FT HDRFTR_LEFT_FONT
12093 .ALIAS HEADER_LEFT HDRFTR_LEFT
12094 .ALIAS HEADER_LEFT_PS HDRFTR_LEFT_SIZE
12095 .ALIAS HEADER_LEFT_SIZE HDRFTR_LEFT_SIZE
12096 .ALIAS HEADER_PLAIN HDRFTR_PLAIN
12097 .ALIAS HEADER_RECTO HDRFTR_RECTO
12098 .ALIAS HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
12099 .ALIAS HEADER_RIGHT_COLOR HDRFTR_RIGHT_COLOR
12100 .ALIAS HEADER_RIGHT_COLOUR HDRFTR_RIGHT_COLOUR
12101 .ALIAS HEADER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
12102 .ALIAS HEADER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
12103 .ALIAS HEADER_RIGHT_FONT HDRFTR_RIGHT_FONT
12104 .ALIAS HEADER_RIGHT_FT HDRFTR_RIGHT_FONT
12105 .ALIAS HEADER_RIGHT HDRFTR_RIGHT
12106 .ALIAS HEADER_RIGHT_PS HDRFTR_RIGHT_SIZE
12107 .ALIAS HEADER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
12108 .ALIAS HEADER_RULE_COLOR HDRFTR_RULE_COLOR
12109 .ALIAS HEADER_RULE_GAP HDRFTR_RULE_GAP
12110 .ALIAS HEADER_RULE HDRFTR_RULE
12111 .ALIAS HEADER_SIZE HDRFTR_SIZE
12112 .ALIAS HEADER_VERSO HDRFTR_VERSO
12113 .ALIAS SWITCH_FOOTERS SWITCH_HDRFTR
12114 .ALIAS SWITCH_HEADERS SWITCH_HDRFTR
12118 .ALIAS COL_BREAK COL_NEXT
12119 .ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE