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 \# ====================================================================
78 \# ====================================================================
80 \# END MACRO FOR LETTERS
81 \# ---------------------
85 \# The .em macro executed at the end of letters. Turns footers and
86 \# pagination off, terminates and outputs diversion CLOSING, indented with
87 \# the author's name underneath.
93 . if \\n[#DOC_TYPE]=4 \{\
95 . if !'\\n(.z'' \{ .di \}
98 . TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
99 . ALD \\n[#DOC_LEAD]u*2u
101 . if \\n[#CLOSING] \{\
105 . ALD \\n[#DOC_LEAD]u*3u
106 . PRINT \\*[$AUTHOR_1]
112 \# =====================================================================
116 \# Macros that control the physical layout of the page: paper size
122 \# <width of printer sheet (ipPc)>
124 \# Stores user supplied page width in register #PAGE_WIDTH.
126 \# #PAGE_WIDTH is used to establish the default LL (and right margin).
127 \# Requires unit of measure.
131 . nr #PAGE_WIDTH \\$1
132 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
133 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
140 \# <offset from page left (ipPc)>
142 \# Stores user supplied page offset in register #L_MARGIN.
143 \# Sets .po to user supplied offset.
145 \# Requires unit of measure.
149 . nr #L_MARGIN (\\$1)
157 \# <width of right margin (ipPc)>
159 \# Stores user supplied right margin in register #R_MARGIN.
161 \# This is a pseudo-margin. Right margin is actually a function of
162 \# line length. The macro calculates line length from the page offset
163 \# and the value plugged into #R_MARGIN.
165 \# N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
167 \# Requires unit of measure.
171 . nr #R_MARGIN (\\$1)
172 . ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
174 . nr #L_LENGTH \\n(.l
181 \# <distance to advance from top of page (ipPcv)>
183 \# Stores the user supplied top margin in register #T_MARGIN.
184 \# Advances user supplied depth from the top of the page.
186 \# Requires unit of measure.
190 . nr #T_MARGIN (\\$1)
194 . sp |\\n[#T_MARGIN]u-1v
203 \# <space to leave at the bottom of the page (ipPcv)>
205 \# Stores the user supplied bottom margin in register #B_MARGIN.
207 \# Requires unit of measure.
211 . nr #B_MARGIN (\\$1)
212 . wh -\\n[#B_MARGIN]u DO_B_MARGIN
219 \# <pagewidth> [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
221 \# Page set-up. Collects arguments and passes them to the appropriate
224 \# All arguments after pagewidth are optional, but must appear
225 \# in the order given above. (User can fill in as much or as
226 \# little as desired.)
228 \# All arguments require a unit of measure.
234 . ie '\\$3'' \{ .L_MARGIN \\n(.o \}
235 . el \{ .L_MARGIN \\$3 \}
236 . ie '\\$4'' \{ .R_MARGIN 1i \}
237 . el \{ .R_MARGIN \\$4 \}
238 . if !'\\$5'' \{ .T_MARGIN \\$5 \}
239 . if !'\\$6'' \{ .B_MARGIN \\$6 \}
242 \# =====================================================================
244 \# +++PAGE CONTROL+++
246 \# Generic macros for breaking pages.
253 \# Plants the top margin (set in .PAGE) at the top of each page.
255 \# The trap is set in .PAGE
259 . sp |\\n[#T_MARGIN]u-1v
269 \# Plants the bottom margin (set in .PAGE) at the bottom of each page.
271 \# The trap is set in .PAGE.
279 \# =====================================================================
281 \# +++GENERAL STYLE MACROS+++
283 \# Macros that are likely to appear together to define general
284 \# type style: line length, family, font, point size, and line
290 \# <line length (iPpc)>
292 \# Stores user supplied line length in register #L_LENGTH.
293 \# Sets .ll to #L_LENGTHu
295 \# Requires unit of measure.
298 . nr #L_LENGTH (\\$1)
299 . nr #USER_SET_L_LENGTH 1
310 \# Stores user supplied font family in string $FAMILY. Sets .fam
314 . if \\n[#PRINT_STYLE]=1 \{ .return \}
315 . if \\n[#IGNORE] \{ .return \}
326 \# Stores user supplied font in $FONT and sets .ft to $FONT.
329 . if \\n[#PRINT_STYLE]=1 \{\
331 . if \\n[#UNDERLINE_ITALIC]=1 \{\
335 . if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
341 . el \{ .UNDERLINE OFF \}
352 \# <point size of type>
354 \# Sets point size to user supplied value in scaled points.
355 \# If #AUTO_LEAD is on, sets .vs to #AUTOLEAD_VALUE+#PT_SIZE.
357 \# Must NOT use a unit of measure.
360 . if \\n[#PRINT_STYLE]=1 \{ .return \}
361 . if \\n[#IGNORE] \{ .return \}
364 . if \\n[#AUTO_LEAD] \{\
365 . ie \\n[#AUTOLEAD_FACTOR] \{ .vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u \}
366 . el \{ .vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u \}
368 . nr #PT_SIZE_IN_UNITS \\n[.ps]
375 \# <leading between lines of text>
377 \# Turns off #AUTO_LEAD if it's on.
378 \# Sets .vs to user supplied value.
380 \# Does not require unit of measure. LEAD automatically turns off AUTOLEAD.
383 . if \\n[#PRINT_STYLE]=1 \{ .return \}
384 . if \\n[#IGNORE] \{ .return \}
386 . if \\n[#AUTO_LEAD] \{\
388 . rr #AUTOLEAD_FACTOR
391 . if \\n[#T_MARGIN_SET]=1 \{\
392 . sp |\\n[#T_MARGIN]u-1v
401 \# <leading value to add to #PT_SIZE> [FACTOR]
403 \# Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
404 \# Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
405 \# All subsequent PT_SIZE requests reset the leading in the same way until
406 \# AUTOLEAD is turned off.
408 \# With the optional FACTOR argument, the current point size is
409 \# multiplied by #AUTOLEAD_VALUE instead of the two being added
412 \# When AUTOLEAD is turned off, the leading reverts to the leading value
413 \# in effect prior to invoking AUTOLEAD.
416 . if \\n[#PRINT_STYLE]=1 \{ .return \}
417 . if \\n[#IGNORE] \{ .return \}
419 . nr #AUTOLEAD_VALUE (p;\\$1)
420 . ie \\n[#NUM_ARGS]=2 \{\
421 . if '\\$2'FACTOR' \{\
422 . nr #AUTOLEAD_FACTOR 1
423 . vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u
427 . vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u
429 . if \\n[#T_MARGIN_SET] \{\
430 . sp |\\n[#T_MARGIN]u-1v
436 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
437 \# ------------------------------------------------
446 \# =====================================================================
450 \# AUTOMATIC PAIRWISE KERNING
451 \# --------------------------
453 \# <none> | <anything>
455 \# Turns automatic pairwise kerning on or off.
469 \# INLINE KERNING AND HORIZONTAL MOVEMENT
470 \# --------------------------------------
472 \# Inline kerning provides a simple method for users to adjust the
473 \# amount of space between any two letters. It's predicated on a
474 \# unit of measure "U", which is 1/36 of the current point size as
475 \# returned by \n[.ps]. E.g., if the current point size is 18,
476 \# \n[.ps] returns 18000u, therefore U=500u. Since U remains
477 \# proportional relative to the current point size, the amount
478 \# of kerning between two letters as expressed in Us remains
479 \# visually similar regardless of changes in point size.
481 \# N.B.--the amount of inline kerning supplied by \*[BU#] or
482 \# \*[FU#] is added to or subtracted from any kerning that already
483 \# takes place between two characters when automatic kerning is
486 \# In groff v. 1.17.2, it was not possible to pass arguments to macros that
487 \# were executed with inline escapes, nor thence to evaluate conditional
488 \# expressions. Consequently, each pseudo-escape \[BU#] had to be defined
489 \# separately with ".char".
491 \# As of v. 1.18, one can pass arguments to inline strings/macros,
492 \# hence it is now possible to do \*[BU #] where #, inline, is the desired
493 \# number of kern units. The original .char definitions have been left in
494 \# for backward compatibility with documents created prior to mom-1.1.3c.
498 .ds BU \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
499 .ds FU \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
501 .ds BU1 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
502 .ds BU2 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
503 .ds BU3 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
504 .ds BU4 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
505 .ds BU5 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
506 .ds BU6 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
507 .ds BU7 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
508 .ds BU8 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
509 .ds BU9 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
510 .ds BU10 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
511 .ds BU11 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
512 .ds BU12 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
513 .ds BU13 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
514 .ds BU14 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
515 .ds BU15 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
516 .ds BU16 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
517 .ds BU17 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
518 .ds BU18 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
519 .ds BU19 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
520 .ds BU20 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
521 .ds BU21 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
522 .ds BU22 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
523 .ds BU23 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
524 .ds BU24 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
525 .ds BU25 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
526 .ds BU26 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
527 .ds BU27 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
528 .ds BU28 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
529 .ds BU29 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
530 .ds BU30 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
531 .ds BU31 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
532 .ds BU32 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
533 .ds BU33 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
534 .ds BU34 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
535 .ds BU35 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
536 .ds BU36 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
539 .ds FU1 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
540 .ds FU2 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
541 .ds FU3 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
542 .ds FU4 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
543 .ds FU5 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
544 .ds FU6 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
545 .ds FU7 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
546 .ds FU8 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
547 .ds FU9 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
548 .ds FU10 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
549 .ds FU11 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
550 .ds FU12 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
551 .ds FU13 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
552 .ds FU14 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
553 .ds FU15 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
554 .ds FU16 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
555 .ds FU17 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
556 .ds FU18 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
557 .ds FU19 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
558 .ds FU20 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
559 .ds FU21 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
560 .ds FU22 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
561 .ds FU23 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
562 .ds FU24 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
563 .ds FU25 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
564 .ds FU26 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
565 .ds FU27 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
566 .ds FU28 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
567 .ds FU29 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
568 .ds FU30 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
569 .ds FU31 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
570 .ds FU32 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
571 .ds FU33 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
572 .ds FU34 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
573 .ds FU35 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
574 .ds FU36 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
577 \# *Horizontal movements
578 \# BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
579 \# specified number of points.
580 \# Left in for backward compatibility with mom-1.1.3c, the preferred
581 \# methods for inline horizontal movements are now \*[BCK #<unit>] and
584 .ds BCK \h'-\\$1\\$2'
591 .ds BP1.25 \h'-1.25p'
593 .ds BP1.75 \h'-1.75p'
595 .ds BP2.25 \h'-2.25p'
597 .ds BP2.75 \h'-2.75p'
599 .ds BP3.25 \h'-3.25p'
601 .ds BP3.75 \h'-3.75p'
603 .ds BP4.25 \h'-4.25p'
605 .ds BP4.75 \h'-4.75p'
607 .ds BP5.25 \h'-5.25p'
609 .ds BP5.75 \h'-5.75p'
611 .ds BP6.25 \h'-6.25p'
613 .ds BP6.75 \h'-6.75p'
615 .ds BP7.25 \h'-7.25p'
617 .ds BP7.75 \h'-7.75p'
619 .ds BP8.25 \h'-8.25p'
621 .ds BP8.75 \h'-8.75p'
623 .ds BP9.25 \h'-9.25p'
625 .ds BP9.75 \h'-9.75p'
627 .ds BP10.25 \h'-10.25p'
628 .ds BP10.5 \h'-10.5p'
629 .ds BP10.75 \h'-10.75p'
631 .ds BP11.25 \h'-11.25p'
632 .ds BP11.5 \h'-11.5p'
633 .ds BP11.75 \h'-11.75p'
635 .ds BP12.25 \h'-12.25p'
636 .ds BP12.5 \h'-12.5p'
637 .ds BP12.75 \h'-12.75p'
679 .ds FP10.25 \h'10.25p'
681 .ds FP10.75 \h'10.75p'
683 .ds FP11.25 \h'11.25p'
685 .ds FP11.75 \h'11.75p'
687 .ds FP12.25 \h'12.25p'
689 .ds FP12.75 \h'12.75p'
692 \# WHOLE LINE KERNING (RW and EW)
693 \# -----------------------------
694 \# The line kerning macros are special instances of track kerning,
695 \# used where a complete line needs to be tightened (or relaxed) in
696 \# order to accomodate or remove one or two more characters
697 \# than the default justification permits.
700 \# <amount of overall "kerning" (letter spacing) to apply to the line>
702 \# Invokes .tkf (track kerning) for the current font with
703 \# 1 as both the upper and lower point size limits, so that
704 \# the value entered by the user applies regardless of point
705 \# size. RW ("Reduce Whitespace") reduces the amount of space
706 \# between all characters by an equal amount. EW ("Extra
707 \# Whitespace") increases the amount of space.
709 \# Decimal values are acceptable.
711 \# The groff documentation is a tad confusing about what unit of
712 \# measure is used in track kerning, only that the width of each
713 \# character is increased or decreased by the amount(s) passed as
714 \# arguments to .tkf, and something about linear function of point
715 \# size. In fact, with the way I've put this macro together, it
716 \# doesn't matter. All the user needs to know is that a value
717 \# of one will produce an unacceptably tight or loose line at most
718 \# text point sizes; therefore, effective use of RW and EW is in
719 \# the fractional range below 1 (e.g. .25, .5). Given that RW
720 \# and EW are for massaging type, a certain amount of
721 \# experimentation and previewing is expected and necessary.
723 \# \n(.f holds the current font number, which is acceptable to .tkf.
725 \# RW and EW must be reset to 0 to cancel their effect on
726 \# subsequent output lines.
729 . if \\n[#BR_AT_LINE_KERN] \{ .br \}
730 . tkf 1 1 -\\$1 1 -\\$1
731 . tkf 2 1 -\\$1 1 -\\$1
732 . tkf 3 1 -\\$1 1 -\\$1
733 . tkf 4 1 -\\$1 1 -\\$1
738 . if \\n[#BR_AT_LINE_KERN] \{ .br \}
739 . tkf 1 1 \\$1 1 \\$1
740 . tkf 2 1 \\$1 1 \\$1
741 . tkf 3 1 \\$1 1 \\$1
742 . tkf 4 1 \\$1 1 \\$1
746 \# BREAK AT LINE KERN
747 \# ------------------
751 \# Enables/disables .br's before .RW and .EW
753 \# Mostly, users will want .br's before any kind of line kerning, but
754 \# there may be cases where they don't. BR_BEFORE_LINE_KERN is off by
755 \# default and must be invoked explicitly.
757 .MAC BR_AT_LINE_KERN END
758 . ie '\\$1'' \{ .nr #BR_AT_LINE_KERN 1 \}
759 . el \{ .rr #BR_AT_LINE_KERN \}
762 \# =====================================================================
769 \# <none> | <anything> | DEFAULT
771 \# LINES <#> | MARGIN <#> | SPACE <#>
773 \# Turns auto hyphenation on or off, resets the hyphenation style
774 \# to default, or permits the setting of various hyphenation
777 \# HY ON defaults to .hy 14, i.e. no hyphens after the
778 \# first two or before the last two characters of a word, and
779 \# no hyphenation of the last line prior to a trap (e.g.,
780 \# at the bottom of a page).
782 \# HY DEFAULT resets the hyphenation style to .hy 14 (see
783 \# above) if that behaviour is desired after changes have been
784 \# made to LINES, MARGIN, or SPACE.
786 \# HY LINES <#> sets the number of allowable consecutive hyphenated lines.
788 \# HY MARGIN <#> sets the amount of space (ipPcm) allowed at the end
789 \# of a line in QUAD mode before hyphenation is tripped (e.g. if there's
790 \# only 6 points left, groff won't try to hyphenate the next word).
792 \# HY SPACE sets the amount of extra interword space (ipPcm) that can
793 \# be added in JUSTIFY mode to prevent a line from being hyphenated.
801 . if !'\\$1'LINES' \{\
805 . if !'\\$1'MARGIN' \{\
809 . if !'\\$1'SPACE' \{\
813 . if !'\\$1'DEFAULT' \{\
817 . if '\\$1'LINES' \{ .hlm \\$2 \}
818 . if '\\$1'MARGIN' \{ .hym \\$2 \}
819 . if '\\$1'SPACE' \{ .hys \\$2 \}
820 . if '\\$1'DEFAULT' \{\
829 \# HYPHENATION PARAMETERS
830 \# ----------------------
832 \# <# of lines> | <size of margin> | <amount of interword space>
834 \# Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
843 \# =====================================================================
845 \# +++VERTICAL SPACING+++
850 \# <user supplied lead to advance below current baseline>
852 \# Creates or modifies register #ALD. Adds user supplied lead
853 \# below current baseline.
855 \# Requires unit of measure ipPcmv.
866 \# <user supplied lead to reverse above current baseline>
868 \# Creates or modifies register #RLD. Reverses user supplied
869 \# lead above current baseline.
871 \# Requires unit of measure ipPcmv.
880 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding \*[RLD]
881 \# forms have been left in for backward compatibility with documents
882 \# created using mom-1.1.3c or earlier. The prefered methods of advancing
883 \# and reversing on the page inline are \*[UP #<unit>] and \*[DOWN #<unit>].
885 .ds DOWN \v'\\$1\\$2'
892 .ds ALD1.25 \v'1.25p'
894 .ds ALD1.75 \v'1.75p'
896 .ds ALD2.25 \v'2.25p'
898 .ds ALD2.75 \v'2.75p'
900 .ds ALD3.25 \v'3.25p'
902 .ds ALD3.75 \v'3.75p'
904 .ds ALD4.25 \v'4.25p'
906 .ds ALD4.75 \v'4.75p'
908 .ds ALD5.25 \v'5.25p'
910 .ds ALD5.75 \v'5.75p'
912 .ds ALD6.25 \v'6.25p'
914 .ds ALD6.75 \v'6.75p'
916 .ds ALD7.25 \v'7.25p'
918 .ds ALD7.75 \v'7.75p'
920 .ds ALD8.25 \v'8.25p'
922 .ds ALD8.75 \v'8.75p'
924 .ds ALD9.25 \v'9.25p'
926 .ds ALD9.75 \v'9.75p'
928 .ds ALD10.25 \v'10.25p'
929 .ds ALD10.5 \v'10.5p'
930 .ds ALD10.75 \v'10.75p'
932 .ds ALD11.25 \v'11.25p'
933 .ds ALD11.5 \v'11.5p'
934 .ds ALD11.75 \v'11.75p'
936 .ds ALD12.25 \v'12.5p'
937 .ds ALD12.5 \v'12.5p'
938 .ds ALD12.75 \v'12.75p'
944 .ds RLD1.25 \v'-1.25p'
946 .ds RLD1.75 \v'-1.75p'
948 .ds RLD2.25 \v'-2.25p'
950 .ds RLD2.75 \v'-2.75p'
952 .ds RLD3.25 \v'-3.25p'
954 .ds RLD3.75 \v'-3.75p'
956 .ds RLD4.25 \v'-4.25p'
958 .ds RLD4.75 \v'-4.75p'
960 .ds RLD5.25 \v'-5.25p'
962 .ds RLD5.75 \v'-5.75p'
964 .ds RLD6.25 \v'-6.25p'
966 .ds RLD6.75 \v'-6.75p'
968 .ds RLD7.25 \v'-7.25p'
970 .ds RLD7.75 \v'-7.75p'
972 .ds RLD8.25 \v'-8.25p'
974 .ds RLD8.75 \v'-8.75p'
976 .ds RLD9.25 \v'-9.25p'
978 .ds RLD9.75 \v'-9.75p'
980 .ds RLD10.25 \v'-10.25p'
981 .ds RLD10.5 \v'-10.5p'
982 .ds RLD10.75 \v'-10.75p'
984 .ds RLD11.25 \v'-11.25p'
985 .ds RLD11.5 \v'-11.5p'
986 .ds RLD11.75 \v'-11.75p'
988 .ds RLD12.25 \v'-12.5p'
989 .ds RLD12.5 \v'-12.5p'
990 .ds RLD12.75 \v'-12.75p'
992 \# =====================================================================
996 \# AUTOMATIC LIGATURES
997 \# -------------------
999 \# <none> | <anything>
1001 \# Turns automatic ligature generation on or off.
1003 \# Ligatures may be supplied manually with \(fi, \(fl, etc.
1020 \# <none> | <anything>
1022 \# Turns smartquotes on or off.
1024 \# The " character is read outside the macro when mom is
1025 \# processed. The strings for open/close ($QUOTE#) are then
1026 \# defined in the macro. \N'34' is the ASCII code for ". If
1027 \# incompatibilities arise, find the code for " that applies
1028 \# to your system and plug in that code instead.
1030 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1032 .MAC SMARTQUOTES END
1037 . nr #SMART_QUOTES 1
1040 . ds $QUOTE0 \\N'34'
1041 . ds $QUOTE1 \\N'34'
1042 . nr #SMART_QUOTES 0
1049 \# =====================================================================
1051 \# +++LINE BREAKS+++
1058 \# Breaks a line without advancing.
1060 \# EL is the mnemonic used on older, dedicated typesetting machines
1061 \# to indicate "process the line, then return to the left margin
1062 \# without advancing the galley medium." It stands for End Line.
1064 \# Sadly, EL is only a fake. It will work in all instances EXCEPT
1065 \# when the line to be EL'd is the last line before a footer trap.
1066 \# Use TRAP OFF/TRAP to circumvent this.
1073 \# =====================================================================
1075 \# +++FILLING/QUADDING/JUSTIFYING+++
1082 \# Turns fill on and sets .ad to b.
1084 \# Justifies text left and right.
1087 . if \\n[#TAB_ACTIVE]=0 \{\
1089 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1093 . if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1101 \# L | LEFT | R | RIGHT | C | CENTER/CENTRE
1103 \# Turns fill on and sets .ad to l, r, or c.
1105 \# Terminology is a problem here. Some people call quad left
1106 \# left justified, flush left, or flush left/rag right (and the
1107 \# reverse for quad right). Quad center is sometimes called rag
1108 \# both. For our purposes, all "quad" modes mean that groff fill
1112 . ds $QUAD_VALUE \\$1
1113 . if \\n[#TAB_ACTIVE]=0 \{\
1115 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1119 . if '\\*[$QUAD_VALUE]'L' \{ .ad l \}
1120 . if '\\*[$QUAD_VALUE]'LEFT' \{ .ad l \}
1121 . if '\\*[$QUAD_VALUE]'R' \{ .ad r \}
1122 . if '\\*[$QUAD_VALUE]'RIGHT' \{ .ad r \}
1123 . if '\\*[$QUAD_VALUE]'C' \{ .ad c \}
1124 . if '\\*[$QUAD_VALUE]'CENTER' \{ .ad c \}
1125 . if '\\*[$QUAD_VALUE]'CENTRE' \{ .ad c \}
1126 . if '\\*[$QUAD_VALUE]'J' \{ .ad b \}
1127 . if '\\*[$QUAD_VALUE]'JUSTIFY' \{ .ad b \}
1132 \# LEFT, RIGHT, AND CENTER
1133 \# -----------------------
1134 \# The purpose of these macros is to allow the user to enter lines
1135 \# of text that will be quadded LRC *without* the user having to
1136 \# enter .BR or .br between lines. For the sake of consistency,
1137 \# all three appear to behave similarly (from the point of view of the user),
1138 \# although the underlying primitives don't. For this reason, LEFT,
1139 \# RIGHT, and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY
1140 \# to restore text to groff fill mode.
1147 \# Turns fill mode off. Allows user to quad lines left without
1148 \# requiring the .BR or .br macro.
1150 \# LEFT simply turns fill off. Lines that exceed the current LL will
1151 \# not be broken, simply continued (indefinitely) until a return is
1152 \# encountered. Note that this behaviour differs from the RIGHT and
1156 . if \\n[#TAB_ACTIVE]=0 \{\
1158 . ds $RESTORE_QUAD_VALUE LEFT
1171 \# Turns fill on. Allows user to quad lines right without
1172 \# requiring the .BR or .br macro.
1174 \# Lines that exceed the current LL will be broken, with the excess
1175 \# text quadded right.
1178 . if \\n[#TAB_ACTIVE]=0 \{\
1180 . ds $RESTORE_QUAD_VALUE RIGHT
1193 \# Turns fill on. Allows user to center lines without
1194 \# requiring the .BR or .br macro.
1196 \# Lines that exceed the current LL will be broken, with the excess
1200 . if \\n[#TAB_ACTIVE]=0 \{\
1201 . ds $RESTORE_QUAD_VALUE CENTER
1208 \# =====================================================================
1212 \# There are two different kinds of tabs available: typesetting tabs
1215 \# Typesetting tabs are set with TAB_SET, which requires a tab number,
1216 \# an indent (offset) from the left margin and a length (optionally
1217 \# with a quad direction and an instruction to fill lines). After tabs
1218 \# are set with TS, they are called with .TAB <#>, where <#>
1219 \# corresponds to the number passed to TAB_SET as a valid tab number.
1221 \# String tabs allow the user to mark off tab positions inline. Tab
1222 \# indents and lengths are calculated from the beginning and end
1223 \# positions of the marks. Up to 19 string tabs may be created,
1224 \# numbered 1-19. Once created, they are called with .TAB <#>,
1225 \# just like typesetting tabs.
1227 \# Setting up string tabs is a two-step procedure. First, the user
1228 \# enters an input line in which s/he wants to mark off string tabs.
1229 \# The beginning of a tab is marked with \*[ST<#>], where <#> is
1230 \# the desired number of the tab. The end of the the tab is marked
1231 \# with \*[ST<#>X]. All ST's must have a matching STX. String tabs
1234 \# Next, the user invokes .ST <#> for every string tab defined, and
1235 \# optionally passes quad information to it. That done, string tabs
1236 \# can be called just like typesetting tabs.
1238 \# String tabs don't preview properly with gxditview. Use gv instead.
1240 \# Strings for string tab inlines
1241 \# ------------------------------
1243 .ds ST1 \Ek[#ST1_OFFSET]
1244 .ds ST2 \Ek[#ST2_OFFSET]
1245 .ds ST3 \Ek[#ST3_OFFSET]
1246 .ds ST4 \Ek[#ST4_OFFSET]
1247 .ds ST5 \Ek[#ST5_OFFSET]
1248 .ds ST6 \Ek[#ST6_OFFSET]
1249 .ds ST7 \Ek[#ST7_OFFSET]
1250 .ds ST8 \Ek[#ST8_OFFSET]
1251 .ds ST9 \Ek[#ST9_OFFSET]
1252 .ds ST10 \Ek[#ST10_OFFSET]
1253 .ds ST11 \Ek[#ST11_OFFSET]
1254 .ds ST12 \Ek[#ST12_OFFSET]
1255 .ds ST13 \Ek[#ST13_OFFSET]
1256 .ds ST14 \Ek[#ST14_OFFSET]
1257 .ds ST15 \Ek[#ST15_OFFSET]
1258 .ds ST16 \Ek[#ST16_OFFSET]
1259 .ds ST17 \Ek[#ST17_OFFSET]
1260 .ds ST18 \Ek[#ST18_OFFSET]
1261 .ds ST19 \Ek[#ST19_OFFSET]
1263 .ds ST1X \Ek[#ST1_MARK]
1264 .ds ST2X \Ek[#ST2_MARK]
1265 .ds ST3X \Ek[#ST3_MARK]
1266 .ds ST4X \Ek[#ST4_MARK]
1267 .ds ST5X \Ek[#ST5_MARK]
1268 .ds ST6X \Ek[#ST6_MARK]
1269 .ds ST7X \Ek[#ST7_MARK]
1270 .ds ST8X \Ek[#ST8_MARK]
1271 .ds ST9X \Ek[#ST9_MARK]
1272 .ds ST10X \Ek[#ST10_MARK]
1273 .ds ST11X \Ek[#ST11_MARK]
1274 .ds ST12X \Ek[#ST12_MARK]
1275 .ds ST13X \Ek[#ST13_MARK]
1276 .ds ST14X \Ek[#ST14_MARK]
1277 .ds ST15X \Ek[#ST15_MARK]
1278 .ds ST16X \Ek[#ST16_MARK]
1279 .ds ST17X \Ek[#ST17_MARK]
1280 .ds ST18X \Ek[#ST18_MARK]
1281 .ds ST19X \Ek[#ST19_MARK]
1282 \# Reserved ST numbers for internal use
1283 .ds ST100 \Ek[#ST100_OFFSET]
1284 .ds ST100X \Ek[#ST100_MARK]
1285 .ds ST101 \Ek[#ST101_OFFSET]
1286 .ds ST101X \Ek[#ST101_MARK]
1289 \# QUAD AND SET STRING TABS
1290 \# ------------------------
1292 \# <stringtab number> L | R | C | J [QUAD]
1294 \# Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1295 \# tab based on the collected information.
1297 \# Like TS, ST invoked without a quad direction will default to LEFT.
1298 \# If lines should be filled and quadded, use the optional argument QUAD.
1299 \# N.B. -- indents *must* be turned off before setting string tabs
1303 . ds $ST\\$1_QUAD_DIR \\$2
1304 . if \\n[#NUM_ARGS]=3 \{\
1305 . ds $ST\\$1_FILL QUAD
1307 . nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1308 . ie \\n[#IN_TAB] \{\
1309 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1312 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1320 \# <#> ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]]
1322 \# Creates macros TAB<#> and TAB <#>, where # is any arbitrary number.
1323 \# TAB# is a typesetting tab (i.e. a tab defined as an indent
1324 \# from the page left offset plus a line length.)
1326 \# <#> = arbitrary digit to identify the tab
1327 \# indent = indent from left margin; unit of measure required
1328 \# length = length of tab (unit of measure required; can be
1329 \# \w'<string>'u--if more than one word in string, surround
1330 \# with double quotes "\w'<three word string>'"
1331 \# LRCJ = quad for tab (left, right, center, justified)
1332 \# If option QUAD afterwards is not given, quad is line for line
1333 \# (no fill mode), meaning that there's no need for .BR or .br
1335 \# QUAD = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1338 \# N.B. -- indents *must* be turned off before setting tabs
1342 \# .TAB_SET 1 2P+6p 12P C
1344 \# means "create a tab numbered 1 that starts 2 picas and 6 points from
1345 \# the left margin, is 12 picas long, and centre each input line."
1347 \# .TAB_SET 1 2P+6P 12P C QUAD
1349 \# means exactly the same thing, except that input lines are joined and
1350 \# the area delimted by the tab filled with centered text.
1352 \# TAB <#> can be called at any time after being set.
1354 \# Tabs are NOT columnar in behaviour. If the text inside a
1355 \# tab runs to several lines, when you call the next tab a break
1356 \# occurs, meaning that the new tab starts one line below the last
1357 \# line in the previous tab. For columnar behaviour, you must
1358 \# use the multi-column macros in addition to tabs.
1360 \# If you want tabs to line up bottom-line to bottom-line (most likely
1361 \# single line tabs), use .TN (provided the tabs are numbered sequentially).
1362 \# Otherwise, you must use .EL then .TAB # if you want them to align.
1364 \# If you want to reset tabs, you must use .TQ before .TAB_SET.
1366 \# Note that indents are turned off automatically whenever a new
1367 \# tab is called with TAB #.
1369 \# Tabs themselves are user-invoked using the TAB macro with a numeric
1370 \# argument, e.g. TAB 1.
1372 \# Generally, in order not to get confused, it's a good idea
1373 \# to make sure all indents are off before setting tabs.
1377 . nr #TAB_NUMBER \\$1
1378 . ds $CURRENT_TAB \\n[#TAB_NUMBER]
1379 . nr #TAB_OFFSET (\\$2)
1380 . nr #TAB_LENGTH (\\$3)
1381 . MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1385 . nr #CURRENT_TAB \\n[#TAB_NUMBER]
1386 . po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET]u
1387 . nr #ST_OFFSET \\n[#TAB_OFFSET]
1388 . nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1389 . ll \\n[#TAB_LENGTH]u
1391 . ie '\\$5'QUAD' \{\
1392 . if '\\$4'L' \{ .QUAD L \}
1393 . if '\\$4'R' \{ .QUAD R \}
1394 . if '\\$4'C' \{ .QUAD C \}
1395 . if '\\$4'J' \{ .JUSTIFY \}
1398 . if '\\$4'' \{ .LEFT \}
1399 . if '\\$4'L' \{ .LEFT \}
1400 . if '\\$4'R' \{ .RIGHT \}
1401 . if '\\$4'C' \{ .CENTER \}
1402 . if '\\$4'J' \{ .JUSTIFY \}
1412 \# <tab number to tab into>
1414 \# Moves to tab number passed as an argument.
1417 . ds $TAB_NUMBER \\$1
1418 . TAB\\*[$TAB_NUMBER]
1420 . po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET\\*[$TAB_NUMBER]]u
1429 \# Automagically moves to TAB#+1 on the same line as the last
1430 \# line of the previous tab.
1432 \# If the tabs being aligned fall too close to the footer
1433 \# trap, the line entered after .TN will appear on the next page.
1437 . nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1448 \# Sets #TAB_ACTIVE to "0" (off).
1449 \# Resets left margin to value in effect prior to tabs.
1450 \# Resets line length to value in effect prior to tabs.
1451 \# Checks #QUAD to see if we were in flush or quad mode
1452 \# prior to tabs (0=off, 1=on).
1453 \# Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1454 \# in effect prior to tabs.
1456 \# TQ *must* come before setting any new tabs if you want the
1457 \# tabs' indents measured from page left. Otherwise, the tabs'
1458 \# indents are measured from the left margin of the tab you're
1465 . po \\n[#L_MARGIN]u
1466 . ll \\n[#L_LENGTH]u
1469 . ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1470 . el \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1473 . if '\\*[$RESTORE_QUAD_VALUE]'LEFT' \{ .LEFT \}
1474 . if '\\*[$RESTORE_QUAD_VALUE]'RIGHT' \{ .RIGHT \}
1475 . if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1479 \# =====================================================================
1481 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1486 \# <none> | <anything>
1488 \# When on, underlines all letters, words, and digits in a passage,
1489 \# ignoring punctuation and spaces.
1491 \# Only for use when the font family is COURIER, to simulate
1492 \# typewriter-style underlining of italic passages.
1496 . nr #UNDERLINE_ON 1
1523 . char \[`A] _
\b\[`A]
1524 . char \[^A] _
\b\[^A]
1525 . char \['A] _
\b\['A]
1526 . char \[:A] _
\b\[:A]
1527 . char \[oA] _
\b\[oA]
1528 . char \[~A] _
\b\[~A]
1529 . char \[AE] _
\b\[AE]
1530 . char \[`E] _
\b\[`E]
1531 . char \[^E] _
\b\[^E]
1532 . char \['E] _
\b\['E]
1533 . char \[:E] _
\b\[:E]
1534 . char \[`I] _
\b\[`I]
1535 . char \[^I] _
\b\[^I]
1536 . char \['I] _
\b\['I]
1537 . char \[:I] _
\b\[:I]
1538 . char \[`O] _
\b\[`O]
1539 . char \[^O] _
\b\[^O]
1540 . char \['O] _
\b\['O]
1541 . char \[:O] _
\b\[:O]
1542 . char \[~O] _
\b\[~O]
1543 . char \[/O] _
\b\[/O]
1544 . char \[`U] _
\b\[`U]
1545 . char \[^U] _
\b\[^U]
1546 . char \['U] _
\b\['U]
1547 . char \[:U] _
\b\[:U]
1548 . char \[,C] _
\b\[,C]
1549 . char \[-D] _
\b\[-D]
1550 . char \[~N] _
\b\[~N]
1551 . char \[TP] _
\b\[TP]
1552 . char \['Y] _
\b\['Y]
1553 . char \[:Y] _
\b\[:Y]
1580 . char \[`a] _
\b\[`a]
1581 . char \[^a] _
\b\[^a]
1582 . char \['a] _
\b\['a]
1583 . char \[:a] _
\b\[:a]
1584 . char \[oa] _
\b\[oa]
1585 . char \[~a] _
\b\[~a]
1586 . char \[ae] _
\b\[ae]
1587 . char \[`e] _
\b\[`e]
1588 . char \[^e] _
\b\[^e]
1589 . char \['e] _
\b\['e]
1590 . char \[:e] _
\b\[:e]
1591 . char \[`i] _
\b\[`i]
1592 . char \[^i] _
\b\[^i]
1593 . char \['i] _
\b\['i]
1594 . char \[:i] _
\b\[:i]
1595 . char \[`o] _
\b\[`o]
1596 . char \[^o] _
\b\[^o]
1597 . char \['o] _
\b\['o]
1598 . char \[:o] _
\b\[:o]
1599 . char \[~o] _
\b\[~o]
1600 . char \[/o] _
\b\[/o]
1601 . char \[`u] _
\b\[`u]
1602 . char \[^u] _
\b\[^u]
1603 . char \['u] _
\b\['u]
1604 . char \[:u] _
\b\[:u]
1605 . char \[,c] _
\b\[,c]
1606 . char \[Sd] _
\b\[Sd]
1607 . char \[~n] _
\b\[~n]
1608 . char \[Tp] _
\b\[Tp]
1609 . char \['y] _
\b\['y]
1610 . char \[:y] _
\b\[:y]
1611 . char \[ss] _
\b\[ss]
1625 . nr #UNDERLINE_ON 0
1626 . 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 \
1627 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 \
1628 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1629 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1630 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1631 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1632 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1633 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1634 ' 1 2 3 4 5 6 7 8 9 0
1644 \# Underscores all letters, words, and digits in a passage,
1645 \# ignoring punctuation and spaces.
1647 \# Intended to be called with inline escapes \*[UL] (underline
1648 \# on) and \*[ULX] (underline off). Only works when the font family
1649 \# is COURIER, to simulate typewriter-style underlining of italic
1653 \c\R'#UNDERLINE_ON 1'
1680 . char \[`A] _
\b\[`A]
1681 . char \[^A] _
\b\[^A]
1682 . char \['A] _
\b\['A]
1683 . char \[:A] _
\b\[:A]
1684 . char \[oA] _
\b\[oA]
1685 . char \[~A] _
\b\[~A]
1686 . char \[AE] _
\b\[AE]
1687 . char \[`E] _
\b\[`E]
1688 . char \[^E] _
\b\[^E]
1689 . char \['E] _
\b\['E]
1690 . char \[:E] _
\b\[:E]
1691 . char \[`I] _
\b\[`I]
1692 . char \[^I] _
\b\[^I]
1693 . char \['I] _
\b\['I]
1694 . char \[:I] _
\b\[:I]
1695 . char \[`O] _
\b\[`O]
1696 . char \[^O] _
\b\[^O]
1697 . char \['O] _
\b\['O]
1698 . char \[:O] _
\b\[:O]
1699 . char \[~O] _
\b\[~O]
1700 . char \[/O] _
\b\[/O]
1701 . char \[`U] _
\b\[`U]
1702 . char \[^U] _
\b\[^U]
1703 . char \['U] _
\b\['U]
1704 . char \[:U] _
\b\[:U]
1705 . char \[,C] _
\b\[,C]
1706 . char \[-D] _
\b\[-D]
1707 . char \[~N] _
\b\[~N]
1708 . char \[TP] _
\b\[TP]
1709 . char \['Y] _
\b\['Y]
1710 . char \[:Y] _
\b\[:Y]
1737 . char \[`a] _
\b\[`a]
1738 . char \[^a] _
\b\[^a]
1739 . char \['a] _
\b\['a]
1740 . char \[:a] _
\b\[:a]
1741 . char \[oa] _
\b\[oa]
1742 . char \[~a] _
\b\[~a]
1743 . char \[ae] _
\b\[ae]
1744 . char \[`e] _
\b\[`e]
1745 . char \[^e] _
\b\[^e]
1746 . char \['e] _
\b\['e]
1747 . char \[:e] _
\b\[:e]
1748 . char \[`i] _
\b\[`i]
1749 . char \[^i] _
\b\[^i]
1750 . char \['i] _
\b\['i]
1751 . char \[:i] _
\b\[:i]
1752 . char \[`o] _
\b\[`o]
1753 . char \[^o] _
\b\[^o]
1754 . char \['o] _
\b\['o]
1755 . char \[:o] _
\b\[:o]
1756 . char \[~o] _
\b\[~o]
1757 . char \[/o] _
\b\[/o]
1758 . char \[`u] _
\b\[`u]
1759 . char \[^u] _
\b\[^u]
1760 . char \['u] _
\b\['u]
1761 . char \[:u] _
\b\[:u]
1762 . char \[,c] _
\b\[,c]
1763 . char \[Sd] _
\b\[Sd]
1764 . char \[~n] _
\b\[~n]
1765 . char \[Tp] _
\b\[Tp]
1766 . char \['y] _
\b\['y]
1767 . char \[:y] _
\b\[:y]
1768 . char \[ss] _
\b\[ss]
1784 \c\R'#UNDERLINE_ON 0'
1785 . 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 \
1786 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 \
1787 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1788 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1789 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1790 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1791 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1792 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1793 ' 1 2 3 4 5 6 7 8 9 0
1800 \# [points below baseline] "text"
1802 \# Places an underscore 2 points under the string if no lead given,
1803 \# otherwise places underscore under string by user specified amount.
1805 \# When using this macro, the string to be underscored must begin
1806 \# with double-quotes ("), regardless of whether it's the sole
1807 \# argument or the second.
1809 \# .UNDERSCORE "Text to be underscored
1811 \# .UNDERSCORE 2p "Text to be underscored
1813 \# All text is underscored (including punctuation and spaces).
1814 \# This is the primary difference between UNDERLINE and UNDERSCORE,
1815 \# aside from the fact the UNDERLINE only works with Courier.
1817 \# UNDERSCORE does not work across line breaks. Each line of
1818 \# text must be entered separately with UNDERSCORE. If the
1819 \# UNDERSCORE begins in the middle of a line and crosses over a
1820 \# break, the portion before the break must be entered in its own
1821 \# UNDERSCORE, as must the portion that comes after the break.
1824 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1825 . ie \\n[#NUM_ARGS]=1 \{ \\$1\\s(12\\v'+2p'\\l'|0'\\v'-2p'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1826 . el \{ \\$2\\s(12\\v'+(\\$1)'\\l'|0'\\v'-(\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1827 . rr #RESTORE_PT_SIZE
1831 \# DOUBLE UNDERSCORE
1832 \# -----------------
1834 \# [points below baseline] [points distance between rules] "text"
1836 \# Same as UNDERSCORE, except it produces a double underscore. The default
1837 \# distance between the rules is 2 points.
1839 \# The same double-quote requirement as UNDERSCORE.
1841 .MAC UNDERSCORE2 END
1842 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1843 . if \\n[#NUM_ARGS]=1 \{\
1844 . PRINT \\$1\\s(12\\v'+2p'\\l'|0'\\v'+2p'\\l'|0'\\v'-4p'\\s[\\n[#RESTORE_PT_SIZE]u]
1846 . if \\n[#NUM_ARGS]=2 \{\
1847 . PRINT \\$2\\s(12\\v'+\\$1'\\l'|0'\\v'+2p'\\l'|0'\\v'-(2p+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1849 . if \\n[#NUM_ARGS]=3 \{\
1850 . PRINT \\$3\\s(12\\v'+\\$1'\\l'|0'\\v'+\\$2'\\l'|0'\\v'-(\\$2+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1852 . rr #RESTORE_PT_SIZE
1856 \# SUPERSCRIPT INLINES
1857 \# -------------------
1859 \# Prints everything after invocation as superscript.
1861 \# \*[SUP] and \*[SUPX] turn superscript on and off respectively.
1862 \# If running type is pseudo-condensed/expanded, invoke the superscript
1863 \# strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
1864 \# and \*[EXTSUPX] respectively.
1867 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1868 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1869 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]
1871 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'
1874 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1875 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1876 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
1878 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
1881 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1882 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1883 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
1885 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
1894 \# <number of degrees> | RESET
1896 \# Modifies register #DEGREES for use with \*[SLANT], or resets
1897 \# it to the default. Defines string \*[SLANTX]
1899 \# \*[SLANT] permits pseudo-italicizing of a font in cases where
1900 \# no italic font exists in a particular family.
1902 \# Default # of degrees is 15.
1904 \# Do not use unit of measure with arg to SETSLANT.
1906 \# It may be necessary to adjust the spacing on either side of
1907 \# [SLANT] and [SLANTX].
1909 \# In docs, SLANT carries over from para to para.
1912 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1913 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1916 . ie '\\$1'RESET' \{\
1918 . if \\n[#PRINT_STYLE]=1 \{\
1919 . if \\n[#UNDERLINE_SLANT] \{ .return \}
1921 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1925 . if \\n[#PRINT_STYLE]=1 \{\
1926 . if \\n[#UNDERLINE_SLANT] \{ .return \}
1928 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1930 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1940 \# <amount of emboldening> | RESET
1942 \# Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
1943 \# it to the default 700 units.
1945 \# \*[BOLDER] allows pseudo-emboldening of a font where no bold
1946 \# font exists in a particular family.
1948 \# Default for SETBOLDER is 700 units. Do not use unit of measure
1949 \# with arg to SETBOLDER.
1951 .nr #BOLDER_UNITS 700
1954 . if \\n[#IGNORE]=1 \{ .return \}
1955 . ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
1956 . el \{ .nr #BOLDER_UNITS \\$1 \}
1962 .bd \\n(.f \\n[#BOLDER_UNITS]
1971 \# +++CONDENSE/EXTEND+++
1976 \# <percentage to condense/expand type size>
1978 \# Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
1979 \# new point size (for character width) from arg, and defines string
1980 \# COND or EXT, which set the type size to the new character width,
1981 \# and sets the height of type to the value stored in CURRENT_PT_SIZE
1983 \# CONDENSE_OR_EXTEND is invoked from the aliases
1984 \# CONDENSE and EXTEND. CONDENSE implies <100, EXTEND
1985 \# implies >100. Do not use a percent sign in the argument.
1987 \# There is no default setting for CONDENSE or EXTEND.
1988 \# 80 is a good approximation of condensed type, 120 is okay
1991 \# The value set by CONDENSE or EXTEND applies to all
1992 \# subsequent \*[COND] or \*[EXT] escapes until a new value is set.
1994 \# \*[COND] or \*[EXT] must be turned off before all changes of point
1995 \# size and reinvoked afterwards (if so desired). This refers to
1996 \# changes of point size via control lines AND with via inlines.
1998 .MAC CONDENSE_OR_EXTEND END
1999 . if '\\$0'CONDENSE' \{\
2000 . ds $COND_PERCENT \\$1
2001 . if \\n[#PRINT_STYLE]=1 \{\
2003 . ds $COND_PERCENT 100
2006 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2008 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2009 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2011 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2012 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2014 . if '\\$0'EXTEND' \{\
2015 . ds $EXT_PERCENT \\$1
2016 . if \\n[#PRINT_STYLE]=1 \{\
2018 . ds $EXT_PERCENT 100
2021 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2023 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2024 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2026 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2027 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2031 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2032 .ds EXTX \ER'#EXTEND 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2035 \# +++PAD LINES+++ (insert space)
2040 \# <character to use for marking pad points>
2042 \# Defines string $PAD_MARKER, used in PAD
2044 \# $PAD_MARKER is normally # (the pound sign).
2047 . ds $PAD_MARKER \\$1
2054 \# "<string of text with padding markers inserted>"
2056 \# Defines and redefines padding character (default=pound sign
2057 \# unless padding character has been set with PAD_MARKER)
2058 \# several times so that when the string is output at the end
2059 \# of the macro, every # has been converted to an equal-sized
2060 \# amount of padding (blank space) on a line. # is equivalent to
2061 \# CompuGraphic's old <IS>.
2063 \# String tabs may be marked off during PAD.
2066 . if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2068 . if !d$PAD_MARKER \{ .ds $PAD_MARKER # \}
2069 . char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2070 . ds $FAMILY_FOR_PAD \\n[.fam]
2071 . nr #FONT_FOR_PAD \\n(.f
2072 . nr #SIZE_FOR_PAD \\n[.ps]
2073 . ds $PAD_STRING \\$1
2074 . as $PAD_STRING \Ekp
2076 . fam \\*[$FAMILY_FOR_PAD]
2077 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2080 . char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2082 . fam \\*[$FAMILY_FOR_PAD]
2083 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2086 . char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2087 . ie \\n[#SILENT] \{\
2089 . fam \\*[$FAMILY_FOR_PAD]
2090 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2095 . fam \\*[$FAMILY_FOR_PAD]
2096 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2099 . if \\n[#FILL_MODE]=1 \{\
2114 \# The leader mechanism is primitive, but it works. Basically,
2115 \# every macro in this set that includes a line length also sets
2116 \# a single groff tab stop at the right hand end of the line.
2117 \# That way, whenever Ctrl-A is invoked (always at the end of
2118 \# an input line), leader of the correct length gets deposited.
2119 \# Ctrl-A is accessed by the string LEADER (i.e. inline, as
2120 \# \*[LEADER]). Leaders within tabs get their length from the
2123 \# SET LEADER CHARACTER
2124 \# --------------------
2126 \# <character to use whenever \*[LEADER] is invoked>
2128 \# Set leader character.
2130 .MAC LEADER_CHARACTER END
2141 \# <family of drop cap>
2143 \# Creates or modifies string $DC_FAM.
2145 .MAC DROPCAP_FAMILY END
2153 \# <font of drop cap>
2155 \# Creates or modifies string $DC_FT.
2157 .MAC DROPCAP_FONT END
2165 \# <width of gutter between drop cap and indented text>
2167 \# Creates or modifies register #DC_GUT.
2169 \# Requires unit of measure. Default is 3p.
2171 .MAC DROPCAP_GUTTER END
2179 \# <+|- # of points to in/decrease point size of drop cap letter>
2181 \# Creates or modifies string $DC_ADJUST.
2183 \# Despite its best efforts, DROPCAP doesn't always get the point
2184 \# size of the drop cap critically perfect. DROPCAP_ADJUST lets
2185 \# the user add or subtract points (or fractions of points) to
2186 \# get the size right.
2188 \# Requires the + or - sign.
2190 .MAC DROPCAP_ADJUST END
2191 . ds $DC_ADJUST \\$1
2198 \# <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2200 \# Calculates point size of dropcap based on # of lines passed as
2201 \# arg 2. Sets indent for text based on dropcap width+gutter.
2202 \# Advances and prints dropcap; reverses and prints indented text
2203 \# to bottom of dropcap, then resets indent to left margin (plus
2204 \# any indent that was in effect prior to invoking DROPCAP).
2206 \# Drop caps put a strain on on resource-challenged systems.
2208 \# Drop caps when using the doc processing macro PP only work with
2209 \# initial paragraphs (i.e. at doc start, or after heads), only when
2210 \# DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2211 \# is TYPESET. If these conditions aren't met, DROPCAPS is silently
2214 \# The COND or EXT argument are processed separately from all
2215 \# other COND or EXT inlines or macros, hence passing COND or
2216 \# EXT has no effect on running type.
2219 . if #IGNORE \{ .return \}
2222 . if \\n[#PRINT_STYLE]=1 \{ .return \}
2223 . if \\n[#PRINT_STYLE]=2 \{\
2224 . if \\n[#PP_STYLE]=2 \{ .return \}
2225 . if \\n[#PP]>1 \{ .return \}
2230 . nr #DC_LINES \\$2-1
2231 . ds $RESTORE_COND \\*[$COND_PERCENT]
2232 . ds $RESTORE_EXT \\*[$EXT_PERCENT]
2233 . if '\\$3'COND' \{ .CONDENSE \\$4 \}
2234 . if '\\$3'EXT' \{ .EXTEND \\$4 \}
2235 . if !r#DC_GUT \{ .nr #DC_GUT (3p) \}
2236 . ds $RESTORE_FAM \\n[.fam]
2237 . nr #RESTORE_FT \\n(.f
2238 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2239 . nr #RESTORE_INDENT \\n(.i
2241 . nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2242 . ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2243 . el \{ .FAM \\*[$DC_FAM] \}
2244 . ie !d$DC_FT \{ .FT \\n(.f \}
2245 . el \{ .FT \\*[$DC_FT] \}
2246 . while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2247 . ps \\n[#PT_SIZE]u+100u
2249 . nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2251 . if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2253 . sp \\n[#DC_LINES]v
2254 . ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2255 . el \{ .PRINT \\*[$DROPCAP] \}
2256 . if '\\$3'COND' \{ \E*[COND] \}
2257 . if '\\$3'EXT' \{ \E*[EXT] \}
2258 . ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2259 . el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2260 . if '\\$3'COND' \{ \E*[CONDX]\c \}
2261 . if '\\$3'EXT' \{ \E*[EXTX]\c \}
2263 . FAM \\*[$RESTORE_FAM]
2264 . FT \\n[#RESTORE_FT]
2265 . ps \\n[#RESTORE_PT_SIZE]u
2266 . CONDENSE \\*[$RESTORE_COND]
2267 . EXTEND \\*[$RESTORE_EXT]
2268 . ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2269 . el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2276 . rr #RESTORE_PT_SIZE
2277 . rr #RESTORE_INDENT
2283 .MAC DROPCAP_OFF END
2284 ' in \\n[#RESTORE_INDENT]u
2293 \# Draws a rule the length of the current measure.
2298 . ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2301 . ie \\n[#INDENT_ACTIVE] \{\
2302 . nr #RESTORE_L_LENGTH \\n(.l
2303 . if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2304 . if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2305 . PRINT \El'\En(.lu'
2306 . ll \\n[#RESTORE_L_LENGTH]u
2307 . rr #RESTORE_L_LENGTH]u
2310 . PRINT \El'\En(.lu'
2312 . QUAD \\*[$CURRENT_QUAD]
2317 \# =====================================================================
2319 \# +++WORD AND SENTENCE SPACING+++
2321 \# WORD SPACE CONTROL
2322 \# ------------------
2324 \# <+|->wordspace | DEFAULT
2326 \# Increases or decreases interword space by user supplied amount.
2327 \# If DEFAULT, value is set to 12 (groff default).
2329 \# $WS_CONSTANT is the groff default word space.
2330 \# $WS_VAR is the user supplied amount by which to in/decrease word space.
2331 \# $WS is a concatenation of WS_CONSTANT and WS_VAR.
2333 \# Because the user supplied value requires a literal + or - sign,
2334 \# the macro argument is stored in a string.
2336 \# \n[.sss] holds the current sentence space value.
2339 . ds $WS_CONSTANT 12
2341 . ie '\\$1'DEFAULT' \{ .ds $WS_VAR +0 \}
2342 . el \{ .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR]) \}
2343 . ie \\n[.sss]=12 \{ .ss \\*[$WS] 12 \}
2345 . ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
2351 \# SENTENCE SPACE CONTROL
2352 \# ----------------------
2354 \# <+-sentencespace> | 0 | DEFAULT
2356 \# Increases or decreases sentence space by user supplied amount.
2357 \# If 0, sentence spaces are ignored. If DEFAULT, value is
2358 \# set to 12 (groff default).
2360 \# Because the user supplied value requires a literal + or - sign,
2361 \# the macro argument is stored in a string.
2363 \# Sentence space applies only to input where sentences are separated
2364 \# by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
2365 \# Changing .SS when sentences are separated by only one space has
2366 \# no effect on the space between sentences.
2368 \# \n[.ss] holds the current wordspace value.
2369 \# \n[.sss] holds the current sentence space value.
2372 . ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
2374 . ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
2377 . ss \\n[.ss] (0\\*[$SS_VAR])
2383 \# =====================================================================
2387 \# There are five styles of indents: left, right, both, temporary,
2388 \# and hanging. Each is set/invoked with a different macro.
2389 \# Indent macros begin with the letter "I", hence .IL means "indent left,"
2390 \# .IR means "indent right," and so on.
2392 \# The first time any of the indent macros is used, it requires an
2393 \# argument--the size of the indent in ipPcm. The size may also
2394 \# be entered using the \w'#' function--very useful for numbered
2395 \# lists using HI). The unit of measure is required. Subsequent
2396 \# invocations don't require the argument; the indent measure remains the
2397 \# same until it's changed by invoking the macro with an argument again.
2399 \# If no indents are in effect, the arguments passed to indent macros are
2400 \# measured from the left and right margins of the page. If a left indent
2401 \# or a right indent is already in effect, the arguments passed to
2402 \# the indent macros are calculated from the current values; in other words,
2403 \# the arguments are additive. If you quit an indent and later return
2404 \# to it, its value will be the value last in effect, unless you pass
2405 \# it an argument. If you do pass an argument, it is added to the last
2406 \# value in effect, unless you cleared the indent with one of
2421 \# The first .IL 2P indents text 2P from the left margin. The second
2422 \# .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
2423 \# .IQ turns the indent off. The last .IL (which has no argument)
2424 \# takes its value from the total of all arguments passed to .IL (in
2425 \# this case, 2P and 2P), therefore it indents 2P+2P from the left
2426 \# margin, i.e. 4P. If you wanted the last .IL to indent just 2P,
2427 \# you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
2428 \# the last .IL the argument 2P.
2430 \# To reverse the sense of an indent added to an indent, you may use
2433 \# Indents can be turned off individually with ILX, IRX, and IBX.
2434 \# LEFT and RIGHT indents may be combined and manipulated
2435 \# separately, (e.g. you can have an IL of 2P and an IR of 4P
2436 \# operative at the same time, and then change, say, the IL to
2437 \# 4P--thereby left indenting 6P--while the IR remains at 4P.
2439 \# IB automatically turns off IL and IR. They have to be reinvoked
2440 \# again when needed. IL and IR automatically turn IB off; it, too,
2441 \# has to be reinvoked with needed.
2443 \# All indents can be turned off at once with IQ. The ILX, IRX, IBX,
2444 \# and IQ macros simply turn the indents off; the values stored in
2445 \# the respective indent macros (IL, IR, IB) remain in effect. If
2446 \# the user wishes to clear the values, the I<LRB>X macros should be
2447 \# invoked with the single argument CLEAR. IQ CLEAR clears out
2448 \# the values stored for all indent styles.
2450 \# Indents *must* be turned off before settting string tabs
2451 \# inside PAD. Generally, in order not to get confused, it's a
2452 \# good idea to turn all indents off before setting any tabs.
2454 \# TI and HI are special cases. There's no need to turn them off,
2455 \# since they affect only one line--the first after their
2456 \# invocation. Like the other indent styles, the first time
2457 \# they're invoked, they require a value in iPpcm; each subsequent
2458 \# invocation without an argument will use the same value. To
2459 \# change the value, simply pass a new value. Values for TI and HI
2460 \# are *not* additive.
2462 \# HI presupposes that you already have a left or both indent
2463 \# on. HI will never hang a line outside the left margin of a
2464 \# document. In other words, you must have IL or IB on before you
2471 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2472 . nr #INDENT_STYLE_LEFT 1
2473 . nr #INDENT_ACTIVE 1
2474 . nr #INDENT_LEFT_ACTIVE 1
2477 . in \\n[#L_INDENT]u
2478 . ta \\n(.lu-\\n[#L_INDENT]u
2482 . nr #L_INDENT +(\\$1)
2483 . in \\n[#L_INDENT]u
2484 . ta \\n(.lu-\\n[#L_INDENT]u
2489 \# +++INDENT RIGHT+++
2492 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2493 . nr #INDENT_STYLE_RIGHT 1
2494 . nr #INDENT_ACTIVE 1
2495 . nr #INDENT_RIGHT_ACTIVE 1
2498 . ie \\n[#TAB_ACTIVE] \{\
2499 . ll \\n(.lu-\\n[#R_INDENT]u
2500 . ta \\n(.lu-\\n[#L_INDENT]u
2503 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2504 . ta \\n(.lu-\\n[#L_INDENT]u
2509 . nr #R_INDENT +(\\$1)
2510 . ie \\n[#TAB_ACTIVE] \{\
2511 . ll \\n(.lu-\\n[#R_INDENT]u
2512 . ta \\n(.lu-\\n[#L_INDENT]u
2515 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2516 . ta \\n(.lu-\\n[#L_INDENT]u
2522 \# +++INDENT BOTH+++
2525 . if \\n[#INDENT_STYLE_LEFT] \{ .ILX \}
2526 . if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
2527 . nr #INDENT_STYLE_BOTH 1
2528 . nr #INDENT_ACTIVE 1
2529 . nr #INDENT_BOTH_ACTIVE 1
2532 . in \\n[#BL_INDENT]u
2533 . ie \\n[#TAB_ACTIVE] \{\
2534 . ll \\n(.lu-\\n[#BR_INDENT]u
2535 . ta \\n(.lu-\\n[#BR_INDENT]u
2538 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2539 . ta \\n(.lu-\\n[#BR_INDENT]u
2544 . nr #BL_INDENT (\\n[#INDENT]+\\$1)
2545 . ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
2546 . el \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
2547 . ie \\n[#TAB_ACTIVE] \{\
2548 . in \\n[#BL_INDENT]u
2549 . ll \\n(.lu-\\n[#BR_INDENT]u
2550 . ta \\n(.lu-\\n[#BL_INDENT]u
2553 . in \\n[#BL_INDENT]u
2554 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2555 . ta \\n(.lu-\\n[#BR_INDENT]u
2561 \# +++TEMPORARY INDENT+++
2566 . ti \\n[#T_INDENT]u
2567 . if \\n[#INDENT_LEFT_ACTIVE] \{\
2568 . ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
2570 . if \\n[#INDENT_BOTH_ACTIVE] \{\
2571 . ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
2575 . nr #T_INDENT (\\$1)
2576 . ti \\n[#T_INDENT]u
2581 \# +++HANGING INDENT+++
2584 . ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
2586 . nr #HL_INDENT (\\$1)
2587 . ti -\\n[#HL_INDENT]u
2592 \# +++INDENTS OFF+++
2597 . rr #INDENT_LEFT_ACTIVE
2598 . if '\\$1'CLEAR' \{\
2600 . rr #INDENT_STYLE_LEFT
2607 . rr #INDENT_RIGHT_ACTIVE
2608 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2610 . ie \\n[#COLUMNS] \{\
2611 . ll \\n[#COL_L_LENGTH]u
2615 . ll \\n[#L_LENGTH]u
2619 . if '\\$1'CLEAR' \{\
2621 . rr #INDENT_STYLE_RIGHT
2629 . rr #INDENT_BOTH_ACTIVE
2630 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2632 . ie \\n[#COLUMNS] \{\
2633 . ll \\n[#COL_L_LENGTH]u
2637 . ll \\n[#L_LENGTH]u
2641 . if '\\$1'CLEAR' \{\
2644 . rr #INDENT_STYLE_BOTH
2651 . if !\\n[#IX_WARN] \{\
2652 . tm1 "[mom]: Use of .IX is now deprecated. Use .IQ instead.
2653 . tm1 " .IX will continue to behave as before, but to
2654 . tm1 " avoid this message, please update your document.
2660 . rr #INDENT_LEFT_ACTIVE
2661 . rr #INDENT_RIGHT_ACTIVE
2662 . rr #INDENT_BOTH_ACTIVE
2663 . if \\n[#INDENT_STYLE_RIGHT] \{\
2664 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2666 . ie \\n[#COLUMNS] \{\
2667 . ll \\n[#COL_L_LENGTH]u
2671 . ll \\n[#L_LENGTH]u
2676 . if \\n[#INDENT_STYLE_BOTH] \{\
2677 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2679 . ie \\n[#COLUMNS] \{\
2680 . ll \\n[#COL_L_LENGTH]u
2684 . ll \\n[#L_LENGTH]u
2689 . if '\\$1'CLEAR' \{\
2690 . if \\n[#INDENT_STYLE_RIGHT] \{\
2691 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2693 . ie \\n[#COLUMNS] \{\
2694 . ll \\n[#COL_L_LENGTH]u
2698 . ll \\n[#L_LENGTH]u
2703 . if \\n[#INDENT_STYLE_BOTH] \{\
2704 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2706 . ie \\n[#COLUMNS] \{\
2707 . ll \\n[#COL_L_LENGTH]u
2711 . ll \\n[#L_LENGTH]u
2722 . rr #INDENT_STYLE_LEFT
2723 . rr #INDENT_STYLE_RIGHT
2724 . rr #INDENT_STYLE_BOTH
2729 \# =====================================================================
2731 \# +++MULTIPLE COLUMNS+++
2733 \# MULTIPLE COLUMNS ON
2734 \# -------------------
2738 \# Marks the top of a column set
2744 \# MULTIPLE COLUMN RETURN
2745 \# ----------------------
2749 \# Returns to the top of a column set
2755 \# MULTIPLE COLUMNS OFF
2756 \# --------------------
2758 \# <none> | <lead to advance beneath bottom of deepest column>
2760 \# Advances to the end of a column set
2762 \# With no argument, advances to the next baseline (at the current
2763 \# leading value) beneath the longest column. With an argument
2764 \# (which requires a unit of measure), advances arg distance
2765 \# beneath the baseline of the deepest column. If the argument
2766 \# is zero, advances to the baseline of the deepest column.
2774 . nr #MCX_ALD (\\$1)
2776 . ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
2777 . el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
2778 . rr #MCX_ALD (\\$1)
2782 \# =====================================================================
2784 \# +++TYPESETTING SUPPORT MACROS+++
2791 \# Enables/disables traps.
2793 \# EL and TN don't function as advertised on the last line before
2794 \# a trap (when they break the preceding line, they spring the
2795 \# trap, and groff won't back up to the line preceding the trap).
2796 \# TRAP is a kludge to get EL and TN work properly on last lines.
2797 \# The user simply enloses the offending lines in TRAP OFF/TRAP.
2800 . ie '\\$1'' \{ .vpt 1 \}
2808 \# <none> | <anything>
2810 \# Diverts text so that it doesn't print, or turns the function off.
2812 \# Useful for setting up autotabs where you don't want the line with
2813 \# the tab marks to print.
2815 \# Also aliased as COMMENT, in case user wants to input a batch of
2816 \# text that doesn't print.
2820 . if \\n[#QUAD] \{ .br \}
2821 . ie '\\$1'' \{ .di NO_FLASH \}
2836 \# Prints anything. A macro that helps keep my code nicely indented.
2846 \# <none> | <anything>
2848 \# Converts text to caps, or, if OFF, reverts to normal caps/lc.
2852 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
2887 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
2928 \# Gets cap-height, x-height, and descender depth of the
2929 \# current font at the current point size.
2931 \# The routine is diverted so it remains invisible to output.
2935 E\\R'#CAP_HEIGHT \\n[.cht]'
2936 e\\R'#X_HEIGHT \\n[.cht]'
2937 y\\R'#DESCENDER \\n[.cdp]'
2942 \# =====================================================================
2944 \# +++TYPESETTING ALIASES+++
2946 .ALIAS CENTRE CENTER
2947 .ALIAS COMMENT SILENT
2948 .ALIAS CONDENSE CONDENSE_OR_EXTEND
2949 .ALIAS EXTEND CONDENSE_OR_EXTEND
2952 .ALIAS HYPHENATION HY
2954 .ALIAS LIG LIGATURES
2959 .ALIAS PADMARKER PAD_MARKER
2960 .ALIAS TABSET TAB_SET
2962 .ALIAS UNDERSCORE_2 UNDERSCORE2
2965 \# ====================================================================
2967 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
2968 \# ===============================================
2970 \# +++PAGE DIMENSIONS+++
2975 \# LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
2977 \# Sets up margins for different paper sizes.
2981 . if '\\*[$PAPER]'LETTER' \{\
2985 . if '\\*[$PAPER]'LEGAL' \{\
2989 . if '\\*[$PAPER]'STATEMENT' \{\
2993 . if '\\*[$PAPER]'TABLOID' \{\
2997 . if '\\*[$PAPER]'LEDGER' \{\
3001 . if '\\*[$PAPER]'FOLIO' \{\
3005 . if '\\*[$PAPER]'QUARTO' \{\
3009 . if '\\*[$PAPER]'10x14' \{\
3013 . if '\\*[$PAPER]'EXECUTIVE' \{\
3017 . if '\\*[$PAPER]'A3' \{\
3021 . if '\\*[$PAPER]'A4' \{\
3025 . if '\\*[$PAPER]'A5' \{\
3029 . if '\\*[$PAPER]'B4' \{\
3033 . if '\\*[$PAPER]'B5' \{\
3037 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
3038 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
3042 \# ====================================================================
3044 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
3049 \# TYPESET | TYPEWRITE [SINGLESPACE]
3051 \# Sets type specs for typewriter-style or typeset output.
3053 \# Number registers: TYPEWRITE=1, TYPESET=2.
3056 . if !d$PAPER \{ .PAPER LETTER \}
3057 . if '\\$1'TYPEWRITE' \{\
3059 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3060 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3064 . ie '\\$2'SINGLESPACE' \{\
3065 . nr #SINGLE_SPACE 1
3072 . if !\\n[#PP_INDENT] \{\
3073 . in 3P \"Set indent
3074 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
3075 . in 0 \"Remove indent
3078 . nr #BOLDER_UNITS 0
3088 . nr #IGNORE_COLUMNS 1
3091 . if '\\$1'TYPESET' \{\
3093 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3094 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3097 . if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
3098 . if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
3106 . if !\\n[#PP_INDENT] \{\
3107 . in 2m \"Set indent
3108 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
3109 . in 0 \"Remove indent
3112 . rr #IGNORE_COLUMNS
3117 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
3119 \# ITALIC MEANS ITALIC
3120 \# -------------------
3124 \# Instructs TYPEWRITE to treat italics as italics, whether
3125 \# invoked via control lines or inline.
3127 \# ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
3128 \# hence invoking the one automatically turns off the other.
3130 .MAC ITALIC_MEANS_ITALIC END
3131 . if \\n[#PRINT_STYLE]=1 \{\
3132 . nr #ITALIC_MEANS_ITALIC 1
3133 . rr #UNDERLINE_ITALIC
3149 \# Instructs TYPEWRITE to underline italics, whether invoked
3150 \# via control lines or inline.
3152 \# UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
3153 \# hence invoking the one automatically turns off the other.
3155 \# UNDERLINE_ITALIC is the default for TYPEWRITE.
3157 .MAC UNDERLINE_ITALIC END
3158 . if \\n[#PRINT_STYLE]=1 \{\
3159 . nr #UNDERLINE_ITALIC 1
3160 . rr #ITALIC_MEANS_ITALIC
3174 \# <none> | <anything>
3176 \# Instructs TYPEWRITE to underline occurences of \*[SLANT], or
3177 \# turns feature off.
3179 \# Users may want \*[SLANT] to mean slant in TYPEWRITE, although
3180 \# most of the time, \*[SLANT] most likely means the user wanted
3181 \# italic but didn't have it, ergo the need to tell TYPEWRITE to
3182 \# treat \*[SLANT] as italic (i.e. underlined).
3184 \# UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
3185 \# hence invoking the one automatically turns off the other.
3187 \# UNDERLINE_SLANT is the default for TYPEWRITE.
3189 .MAC UNDERLINE_SLANT END
3190 . if \\n[#PRINT_STYLE]=1 \{\
3191 . rr #SLANT_MEANS_SLANT
3192 . nr #UNDERLINE_SLANT 1
3195 . ds SLANT \ER'#SLANT_ON 1'\E*[UL]
3196 . ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
3201 .MAC SLANT_MEANS_SLANT END
3202 . if \\n[#PRINT_STYLE]=1 \{\
3203 . rr #UNDERLINE_SLANT
3204 . nr #SLANT_MEANS_SLANT 1
3207 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
3208 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
3213 .MAC IGNORE_COLUMNS END
3214 . if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
3218 \# ====================================================================
3220 \# +++COPY STYLE -- DRAFT OR FINAL+++
3227 \# Sets registers that are used to determine what to put
3228 \# in the default header, and how to number pages.
3230 \# DOCTYPE must come before COPYSTYLE.
3233 . ds $COPY_STYLE \\$1
3234 . if '\\*[$COPY_STYLE]'DRAFT' \{\
3236 . if !r#DRAFT \{ .DRAFT 1 \}
3238 . if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2 \}
3239 . if !d$CHAPTER_STRING \{ .CHAPTER_STRING "Chapter" \}
3240 . if !d$DRAFT_STRING \{ .DRAFT_STRING "Draft" \}
3241 . if !d$REVISION_STRING \{ .REVISION_STRING "Rev." \}
3243 . if \\n[#DOC_TYPE]=1 \{\
3244 . ie \\n[#COPY_STYLE]=1 \{\
3245 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3246 . el \{ .PAGENUM_STYLE roman \}
3247 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3248 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3252 . ie !\\n[#REVISION] \{\
3253 . ds $HDRFTR_CENTER \
3254 \\*[$DRAFT_STRING] \\n[#DRAFT]
3257 . ds $HDRFTR_CENTER \
3258 \\*[$DRAFT_STRING] \\n[#DRAFT], \
3259 \\*[$REVISION_STRING] \\n[#REVISION]
3265 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3266 . el \{ .PAGENUM_STYLE DIGIT \}
3267 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{ .ds $HDRFTR_CENTER \}
3271 . if \\n[#DOC_TYPE]=2 \{\
3273 . ie \\n[#COPY_STYLE]=1 \{\
3274 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3275 . el \{ .PAGENUM_STYLE roman \}
3276 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3277 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3278 . ie '\\*[$CHAPTER]'' \{\
3279 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3280 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3282 . el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \}
3285 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3286 . ds \\*[$CHAPTER_TITLE]
3288 . el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3292 . ie !\\n[#REVISION] \{\
3293 . ie '\\*[$CHAPTER]'' \{\
3294 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3295 . ds $HDRFTR_CENTER \
3296 \\*[$CHAPTER_TITLE], \
3297 \\*[$DRAFT_STRING] \\n[#DRAFT]
3300 . ds $HDRFTR_CENTER \
3301 \\*[$CHAPTER_STRING], \
3302 \\*[$DRAFT_STRING] \\n[#DRAFT]
3306 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3307 . ds $HDRFTR_CENTER \
3308 \\*[$CHAPTER_TITLE], \
3309 \\*[$DRAFT_STRING] \\n[#DRAFT]
3312 . ds $HDRFTR_CENTER \
3313 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3314 \\*[$DRAFT_STRING] \\n[#DRAFT]
3319 . ie '\\*[$CHAPTER]'' \{\
3320 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3321 . ds $HDRFTR_CENTER \
3322 \\*[$CHAPTER_TITLE], \
3323 \\*[$DRAFT_STRING] \\n[#DRAFT], \
3324 \\*[$REVISION_STRING] \\n[#REVISION]
3327 . ds $HDRFTR_CENTER \
3328 \\*[$CHAPTER_STRING], \
3329 \\*[$DRAFT_STRING] \\n[#DRAFT], \
3330 \\*[$REVISION_STRING] \\n[#REVISION]
3334 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3335 . ds $HDRFTR_CENTER \
3336 \\*[$CHAPTER_TITLE], \
3337 \\*[$DRAFT_STRING] \\n[#DRAFT], \
3338 \\*[$REVISION_STRING] \\n[#REVISION]
3341 . ds $HDRFTR_CENTER \
3342 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3343 \\*[$DRAFT_STRING] \\n[#DRAFT], \
3344 \\*[$REVISION_STRING] \\n[#REVISION]
3353 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3354 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3355 . el \{ .PAGENUM_STYLE DIGIT \}
3356 . ie '\\*[$CHAPTER]'' \{\
3357 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3358 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3361 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
3365 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3366 . ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3369 . ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3376 . if \\n[#DOC_TYPE]=3 \{\
3377 . ie \\n[#COPY_STYLE]=1 \{\
3378 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3379 . el \{ .PAGENUM_STYLE roman \}
3380 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3381 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3384 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3385 . ie !\\n[#REVISION] \{\
3386 . ds $HDRFTR_CENTER \
3388 \\*[$DRAFT_STRING] \\n[#DRAFT]
3391 . ds $HDRFTR_CENTER \
3393 \\*[$DRAFT_STRING] \\n[#DRAFT], \
3394 \\*[$REVISION_STRING] \\n[#REVISION]
3400 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3401 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3402 . el \{ .PAGENUM_STYLE DIGIT \}
3403 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3409 \# ====================================================================
3411 \# +++COLLECT DOC INFO -- STRINGS AND NUMBER REGISTERS+++
3414 \# various string/register arguments
3416 \# Collect information about documents.
3420 . ds $DOC_TITLE \\$1
3423 .MAC TITLE END \"Document title
3428 .MAC SUBTITLE END \"Document sub-title
3433 .MAC CHAPTER END \"If document is a chapter, the chapter number
3438 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
3439 . ds $CHAPTER_TITLE \\$1
3443 .MAC DRAFT END \"Draft number
3448 .MAC REVISION END \"Revision number
3453 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
3454 . nr #DRAFT_WITH_PAGENUM 1
3458 .MAC AUTHOR END \"Author. Enclose all args fully in double quotes.
3459 . nr #AUTHOR_NUM -1 1
3460 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
3461 . ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
3463 . nr #NUM_AUTHORS \\n[#NUM_ARGS]%2 \"Use mod 2 to test if odd or even # of authors
3464 . ie \\n[#NUM_AUTHORS]=1 \{ .nr #AUTHOR_LINES 0 \}
3465 . el \{ .nr #AUTHOR_LINES 1 \}
3469 .MAC PAGENUMBER END \"Page # that appears on page one.
3470 . nr #n%_AT_PAGENUM_SET \\n%
3471 . nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
3472 . rr #n%_AT_PAGENUM_SET
3473 . nr #PAGE_NUM_SET 1
3476 \# ====================================================================
3478 \# +++TYPE OF DOCUMENT+++
3483 \# DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
3485 \# Creates strings and sets registers for document types.
3487 \# Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
3490 . if '\\$1'DEFAULT' \{\
3493 . if '\\$1'CHAPTER' \{\
3496 . if '\\$1'NAMED' \{\
3500 . if '\\$1'LETTER' \{\
3508 . INDENT_FIRST_PARAS
3510 . ds $SUITE \En[#SUITE]
3511 . HEADER_MARGIN 3P+6p
3517 . FOOTER_RIGHT_SIZE +0
3518 . FOOTER_RIGHT ".../\E*[$SUITE]
3519 . FOOTER_ON_FIRST_PAGE
3524 \# +++LETTER MACROS+++
3531 \# Stores date string in string $DATE.
3545 \# Stores "to" info in diversion TO_ADDRESS.
3548 . if !'\\n(.z'' \{ .di \}
3560 \# Stores "from" info in diversion FROM_ADDRESS.
3563 . if !'\\n(.z'' \{ .di \}
3573 \# <greeting string>
3575 \# Stores greeting in string $GREETING.
3578 . if !'\\n(.z'' \{ .di \}
3590 \# Stores greeting in string $CLOSING.
3605 \# Redefines $SUITE to blank so that a suite number doesn't
3606 \# appear at the bottom of letter pages.
3612 \# ====================================================================
3621 \# Sets up defaults if no values are entered prior to START.
3623 \# The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
3624 \# $REVISION_STRING are in the COPYSTYLE macro.
3627 . if !d$PAPER \{ .PAPER LETTER \}
3628 . if !\\n[#DOC_TYPE] \{ .DOCTYPE DEFAULT \}
3629 . if \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3630 . if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
3631 . if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
3632 . if \\n[#DOC_TYPE]=4 \{\
3633 . if !\\n[#USER_SET_L_LENGTH] \{\
3634 . R_MARGIN \\n[#R_MARGIN]u
3635 . rr #USER_SET_L_LENGTH
3637 . if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
3639 . if \\n[#COPY_STYLE]=1 \{\
3643 . if !r#DOC_HEADER \{ .DOCHEADER \}
3644 . if !r#HEADERS_ON \{ .HEADERS \}
3645 . if !r#PAGINATE \{ .PAGINATE \}
3646 . if \\n[#FOOTERS_ON] \{\
3648 . if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
3650 . if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
3651 . if !r#HEADER_GAP \{ .HEADER_GAP 3P \}
3652 . if \\n[#FOOTERS_ON] \{\
3653 . if \\n[#PAGINATE]=0 \{\
3654 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
3657 . if \\n[#HEADERS_ON]=0 \{\
3658 . if \\n[#FOOTERS_ON]=0 \{\
3659 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
3662 . if !r#T_MARGIN \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
3663 . if !r#DOCHEADER_ADVANCE \{ .DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
3664 . if !r#FOOTER_MARGIN \{ .FOOTER_MARGIN 3P \}
3665 . if !r#FOOTER_GAP \{ .FOOTER_GAP 3P \}
3666 . if !r#B_MARGIN \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
3667 . if !r#HDRFTR_RULE_GAP \{\
3668 . if \\n[#HEADERS_ON] \{ .HDRFTR_RULE_GAP 4p \}
3669 . if \\n[#FOOTERS_ON] \{ .HDRFTR_RULE_GAP 4p \}
3671 . if !r#HDRFTR_RULE \{ .HDRFTR_RULE \}
3672 . if !r#PAGE_NUM_SET \{ .PAGENUMBER 1 \}
3673 . ie r#ADJ_DOC_LEAD \{ . \}
3674 . el \{ .DOC_LEAD_ADJUST \}
3675 \# Read in number registers and strings for type parameters
3676 . nr #DOC_L_MARGIN \\n[#L_MARGIN]
3677 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
3678 . nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
3679 . ds $DOC_FAM \\*[$FAMILY]
3680 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
3681 . nr #DOC_LEAD \\n[#LEAD]
3682 . ds $DOC_QUAD \\*[$QUAD_VALUE]
3683 . ds $PP_FT \\*[$FONT]
3688 . nr #FN_COUNT_FOR_COLS 0 1
3690 . RESET_SUBHEAD_NUMBER
3691 . RESET_PARAHEAD_NUMBER
3692 \# General style defaults for both PRINTSTYLEs
3694 . PARA_INDENT \\n[#PP_INDENT]u
3695 . if !d$HDRFTR_FAM \{ .HDRFTR_FAMILY \\*[$DOC_FAM] \}
3696 . if !d$HDRFTR_SIZE_CHANGE \{ .HDRFTR_SIZE +0 \}
3697 . if !d$PAGE_NUM_FAM \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
3698 . if !d$PAGE_NUM_FT \{ .PAGENUM_FONT R \}
3699 . if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE +0 \}
3700 . if !r#PAGE_NUM_POS_SET \{ .PAGENUM_POS BOTTOM CENTER \}
3701 . ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
3702 . if \\n[#PAGE_NUM_HYPHENS]=0 \{ .PAGENUM_HYPHENS OFF \}
3703 . if \\n[#PAGE_NUM_HYPHENS]=1 \{ .PAGENUM_HYPHENS \}
3705 . el \{ .PAGENUM_HYPHENS \}
3706 . if !d$HEAD_QUAD \{ .HEAD_QUAD CENTER \}
3707 . if !r#HEAD_CAPS \{ .HEAD_CAPS \}
3708 . if !r#HEAD_UNDERLINE \{ .HEAD_UNDERLINE \}
3709 . if !d$SH_QUAD \{ .SUBHEAD_QUAD LEFT \}
3710 . if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
3711 . if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
3712 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
3714 . if !d$FN_FAM \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
3715 . if !d$FN_FT \{ .FOOTNOTE_FONT R \}
3716 . if !d$FN_QUAD \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD] \}
3717 . if !r#FN_RULE \{ .FOOTNOTE_RULE \}
3718 . if !r#FN_MARKERS \{ .FOOTNOTE_MARKERS \}
3719 . if !r#FN_MARKER_STYLE \{ .FOOTNOTE_MARKER_STYLE STAR \}
3720 . if !d$EN_PN_STYLE \{ .ENDNOTES_PAGENUM_STYLE digit \}
3721 . if !d$EN_FAM \{ .ENDNOTE_FAMILY \\*[$DOC_FAM] \}
3722 . if !d$EN_FN \{ .ENDNOTE_FONT R \}
3723 . if !d$EN_QUAD \{ .ENDNOTE_QUAD \\*[$DOC_QUAD] \}
3724 . if !d$EN_STRING \{ .ENDNOTE_STRING "Endnotes" \}
3725 . if !d$EN_STRING_FAM \{ .ENDNOTE_STRING_FAMILY \\*[$EN_FAM] \}
3726 . if !d$EN_STRING_QUAD \{ .ENDNOTE_STRING_QUAD CENTER \}
3727 . if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2 \}
3728 . if !r#EN_STRING_CAPS \{ .ENDNOTE_STRING_CAPS \}
3729 . if !d$EN_TITLE \{\
3730 . ie \\n[#DOC_TYPE]=2 \{\
3731 . ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
3732 . el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]" \}
3734 . el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
3736 . if !d$EN_TITLE_FAM \{ .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM] \}
3737 . if !d$EN_TITLE_QUAD \{ .ENDNOTE_TITLE_QUAD LEFT \}
3738 . if !r#EN_TITLE_UNDERSCORE \{ .ENDNOTE_TITLE_UNDERSCORE \}
3739 . if !d$EN_NUMBER_FAM \{ .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] \}
3740 . if !r#EN_NUMBERS_ALIGN_LEFT \{\
3741 . if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2 \}
3743 . if !d$TOC_HEADER_STRING \{ .TOC_HEADER_STRING "Contents" \}
3744 . if !d$TOC_HEADER_QUAD \{ .TOC_HEADER_QUAD LEFT \}
3745 . if !d$TOC_PN_STYLE \{ .TOC_PAGENUM_STYLE roman \}
3746 . if !r#TOC_PN_PADDING \{ .TOC_PADDING 3 \}
3747 . if !r#TOC_TITLE_INDENT \{ .TOC_TITLE_INDENT 0 \}
3748 . if !r#TOC_HEAD_INDENT \{ .TOC_HEAD_INDENT 18p \}
3749 . if !r#TOC_SH_INDENT \{ .TOC_SUBHEAD_INDENT 30p \}
3750 . if !r#TOC_PH_INDENT \{ .TOC_PARAHEAD_INDENT 42p \}
3751 \# String defaults for both PRINTSTYLEs
3752 . if !d$DOC_TITLE \{ .ds $DOC_TITLE \E*[$TITLE] \}
3753 . if !d$ATTRIBUTE_STRING \{ .ATTRIBUTE_STRING "by" \}
3754 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 \{ .ds $HDRFTR_LEFT \\*[$AUTHOR_1] \}
3755 . rr #USER_DEF_HDRFTR_LEFT
3756 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 \{ .ds $HDRFTR_RIGHT \\*[$DOC_TITLE] \}
3757 . rr #USER_DEF_HDRFTR_RIGHT
3758 . if !d$FINIS_STRING \{ .FINIS_STRING "END" \}
3759 \# Defaults for printstyle TYPEWRITE
3760 . if \\n[#PRINT_STYLE]=1 \{\
3761 . if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES \}
3762 . if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF \}
3763 . if !r#Q_OFFSET_VALUE \{ .QUOTE_INDENT 2 \}
3764 . if !r#EPI_OFFSET_VALUE \{ .EPIGRAPH_INDENT 2 \}
3765 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 2p \}
3766 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE +0 \}
3767 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 2i \}
3768 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 6p \}
3769 . if !r#SLANT_MEANS_SLANT \{\
3770 . ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
3771 . el \{ .UNDERLINE_SLANT OFF \}
3773 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3774 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
3776 \# Defaults for printstyle TYPESET
3777 . if \\n[#PRINT_STYLE]=2 \{\
3778 . if !r#DOCHEADER_LEAD_ADJ \{\
3779 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3780 . ie !'\\*[$CHAPTER_STRING]'' \{\
3781 . DOCHEADER_LEAD +4p
3783 . el \{ .DOCHEADER_LEAD +0 \}
3785 . el \{ .DOCHEADER_LEAD +0 \}
3787 . if !d$TITLE_FAM \{ .TITLE_FAMILY \\*[$DOC_FAM] \}
3788 . if !d$TITLE_FT \{ .TITLE_FONT B \}
3789 . if !d$TITLE_SIZE_CHANGE \{\
3790 . ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
3791 . el \{ .TITLE_SIZE +3.5 \}
3793 . if !d$CHAPTER_TITLE_FAM \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
3794 . if !d$CHAPTER_TITLE_FT \{ .CHAPTER_TITLE_FONT BI \}
3795 . if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE +4 \}
3796 . if !d$SUBTITLE_FAM \{ .SUBTITLE_FAMILY \\*[$DOC_FAM] \}
3797 . if !d$SUBTITLE_FT \{ .SUBTITLE_FONT R \}
3798 . if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE +0 \}
3799 . if !d$AUTHOR_FAM \{ .AUTHOR_FAMILY \\*[$DOC_FAM] \}
3800 . if !d$AUTHOR_FT \{ .AUTHOR_FONT I \}
3801 . if !d$AUTHOR_SIZE_CHANGE \{ .AUTHOR_SIZE +0 \}
3802 . if !d$DOCTYPE_FAM \{ .DOCTYPE_FAMILY \\*[$DOC_FAM] \}
3803 . if !d$DOCTYPE_FT \{ .DOCTYPE_FONT BI \}
3804 . if !d$DOCTYPE_SIZE_CHANGE \{ .DOCTYPE_SIZE +3 \}
3805 . if !d$HDRFTR_LEFT_FAM \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
3806 . if !d$HDRFTR_LEFT_FT \{ .HDRFTR_LEFT_FONT R \}
3807 . if \\n[#HDRFTR_LEFT_CAPS] \{\
3808 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -2 \}
3810 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -.5 \}
3811 . if !d$HDRFTR_CENTER_FAM \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
3812 . if !d$HDRFTR_CENTER_FT \{ .HDRFTR_CENTER_FONT I \}
3813 . if \\n[#HDRFTR_CENTER_CAPS] \{\
3814 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
3816 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5 \}
3817 . if !d$HDRFTR_RIGHT_FAM \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] \}
3818 . if !d$HDRFTR_RIGHT_FT \{ .HDRFTR_RIGHT_FONT R \}
3819 . if \\n[#HDRFTR_RIGHT_CAPS] \{\
3820 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
3822 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -.5 \}
3823 . if !d$HEAD_FAM \{ .HEAD_FAMILY \\*[$DOC_FAM] \}
3824 . if !d$HEAD_FT \{ .HEAD_FONT B \}
3825 . if !d$HEAD_SIZE_CHANGE \{ .HEAD_SIZE +1 \}
3826 . if !r#HEAD_SPACE \{ .HEAD_SPACE \}
3827 . if !d$SH_FAM \{ .SUBHEAD_FAMILY \\*[$DOC_FAM] \}
3828 . if !d$SH_FT \{ .SUBHEAD_FONT B \}
3829 . if !d$SH_SIZE_CHANGE \{ .SUBHEAD_SIZE +.5 \}
3830 . if !d$PH_FAM \{ .PARAHEAD_FAMILY \\*[$DOC_FAM] \}
3831 . if !d$PH_FT \{ .PARAHEAD_FONT BI \}
3832 . if !d$PH_SIZE_CHANGE \{ .PARAHEAD_SIZE -.25 \}
3833 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3834 . if !d$QUOTE_FAM \{ .QUOTE_FAMILY \\*[$DOC_FAM] \}
3835 . if !d$QUOTE_FT \{ .QUOTE_FONT I \}
3836 . if !d$QUOTE_SIZE_CHANGE \{ .QUOTE_SIZE +0 \}
3837 . if !r#Q_OFFSET_VALUE \{ .QUOTE_INDENT 3 \}
3838 . if !d$BQUOTE_FAM \{ .BLOCKQUOTE_FAMILY \\*[$DOC_FAM] \}
3839 . if !d$BQUOTE_FT \{ .BLOCKQUOTE_FONT R \}
3840 . if !d$BQUOTE_SIZE_CHANGE \{ .BLOCKQUOTE_SIZE -1 \}
3841 . if !d$BQUOTE_QUAD \{ .BLOCKQUOTE_QUAD LEFT \}
3842 . if !d$EPI_FAM \{ .EPIGRAPH_FAMILY \\*[$DOC_FAM] \}
3843 . if !d$EPI_FT \{ .EPIGRAPH_FONT R \}
3844 . if !d$EPI_SIZE_CHANGE \{ .EPIGRAPH_SIZE -1.5 \}
3845 . if !r#EPI_AUTOLEAD \{ .EPIGRAPH_AUTOLEAD 2 \}
3846 . if !d$EPI_QUAD \{ .EPIGRAPH_QUAD \\*[$DOC_QUAD] \}
3847 . if !r#EPI_OFFSET_VALUE \{ .EPIGRAPH_INDENT 3 \}
3848 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 3p \}
3849 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 4P \}
3850 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 3p \}
3851 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE -2 \}
3852 . if !r#FN_AUTOLEAD \{ .FOOTNOTE_AUTOLEAD 2 \}
3853 . if !r#EN_PS \{ .ENDNOTE_PT_SIZE \\n[#DOC_PT_SIZE]u \}
3854 . if !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
3855 . if !d$EN_STRING_FT \{ .ENDNOTE_STRING_FONT B \}
3856 . if !d$EN_STRING_SIZE_CHANGE \{ .ENDNOTE_STRING_SIZE +1 \}
3857 . if !d$EN_TITLE_FT \{ .ENDNOTE_TITLE_FONT B \}
3858 . if !d$EN_TITLE_SIZE_CHANGE \{ .ENDNOTE_TITLE_SIZE +0 \}
3859 . if !d$EN_NUMBER_FT \{ .ENDNOTE_NUMBER_FONT B \}
3860 . if !$EN_NUMBER_SIZE_CHANGE \{ .ENDNOTE_NUMBER_SIZE +0 \}
3861 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT 1.5m \}
3862 . if !d$TOC_FAM \{ .TOC_FAMILY \\*[$DOC_FAM] \}
3863 . if !r#TOC_PS \{ .TOC_PT_SIZE \\n[#DOC_PT_SIZE]u \}
3864 . if !r#TOC_LEAD \{ .TOC_LEAD \\n[#DOC_LEAD]u ADJUST \}
3865 . if !d$TOC_HEADER_FAM \{ .TOC_HEADER_FAMILY \\*[$TOC_FAM] \}
3866 . if !d$TOC_HEADER_SIZE_CHANGE \{ .TOC_HEADER_SIZE +4 \}
3867 . if !d$TOC_HEADER_FT \{ .TOC_HEADER_FONT B \}
3868 . if !d$TOC_TITLE_FAM \{ .TOC_TITLE_FAMILY \\*[$TOC_FAM] \}
3869 . if !d$TOC_PN_FAM \{ .TOC_PN_FAMILY \\*[$TOC_FAM] \}
3870 . if !d$TOC_HEAD_FAM \{ .TOC_HEAD_FAMILY \\*[$TOC_FAM] \}
3871 . if !d$TOC_SH_FAM \{ .TOC_SUBHEAD_FAMILY \\*[$TOC_FAM] \}
3872 . if !d$TOC_PH_FAM \{ .TOC_PARAHEAD_FAMILY \\*[$TOC_FAM] \}
3873 . if !d$TOC_TITLE_FT \{ .TOC_TITLE_FONT BI \}
3874 . if !d$TOC_PN_FT \{ .TOC_PN_FONT R \}
3875 . if !d$TOC_HEAD_FT \{ .TOC_HEAD_FONT B \}
3876 . if !d$TOC_SH_FT \{ .TOC_SUBHEAD_FONT R \}
3877 . if !d$TOC_PH_FT \{ .TOC_PARAHEAD_FONT I \}
3878 . if !d$TOC_TITLE_SIZE_CHANGE \{ .TOC_TITLE_SIZE +.5 \}
3879 . if !d$TOC_PN_SIZE_CHANGE \{ .TOC_PN_SIZE +0 \}
3880 . if !d$TOC_HEAD_SIZE_CHANGE \{ .TOC_HEAD_SIZE +.5 \}
3881 . if !d$TOC_SH_SIZE_CHANGE \{ .TOC_SUBHEAD_SIZE +0 \}
3882 . if !d$TOC_PH_SIZE_CHANGE \{ .TOC_PARAHEAD_SIZE +0 \}
3884 . if \\n[#PRINT_STYLE]=2 \{\
3885 . ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
3888 . if !\\n[#COLLATE] \{\
3890 \# Endnote and toc leading
3891 . nr #OK_PROCESS_LEAD 1
3892 . nr #RESTORE_DOC_LEAD \\n(.v
3893 . if \\n[#PRINT_STYLE]=1 \{\
3894 . ie \\n[#SINGLE_SPACE] \{\
3895 . ENDNOTE_LEAD 12 ADJUST
3898 . ie \\n[#EN_SINGLESPACE] \{ .ENDNOTE_LEAD 12 ADJUST \}
3899 . el \{ .ENDNOTE_LEAD 24 ADJUST \}
3902 . if \\n[#PRINT_STYLE]=2 \{\
3903 . ie !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
3904 . el \{ .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] \}
3905 . ie !d$TOC_LEAD \{ .TOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
3906 . el \{ .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] \}
3907 . rm $ADJUST_EN_LEAD
3908 . rm $ADJUST_TOC_LEAD
3910 . DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
3912 . if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
3915 \# ====================================================================
3917 \# +++START THE DOCUMENT+++
3924 \# Reads in default document style parameters and any parameter
3925 \# the user has changed before issuing START.
3926 \# Using the information gathered in the opening macros,
3927 \# prints appropriate title (or chapter #), subtitle, author
3928 \# and document type (if appropriate).
3930 \# The .PRINT \& (zero-width character) is required to get the
3931 \# subsequent .sp request to work as advertised.
3933 \# The overall document line length, family, and point-size
3934 \# are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
3935 \# use in the HEADER and FOOTER macros.
3937 \# First, define some strings for point sizes
3939 .ds $TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
3940 .ds $CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
3941 .ds $SUBTITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
3942 .ds $AUTHOR_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
3943 .ds $DOCTYPE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
3945 \# Next, some utility macros for various routines to prevent repetition
3947 .MAC PRINT_AUTHORS END
3948 . nr #AUTHORS \\n[#AUTHOR_NUM]
3949 . nr #NEXT_AUTHOR 0 1
3950 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
3951 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
3955 .MAC DEFAULT_DOCHEADER END
3957 . FAMILY \\*[$TITLE_FAM]
3959 . PT_SIZE \\*[$TITLE_PT_SIZE]
3960 . LS \\n[#DOCHEADER_LEAD]u
3962 . if !'\\*[$SUBTITLE]'' \{\
3963 . FAMILY \\*[$SUBTITLE_FAM]
3964 . FT \\*[$SUBTITLE_FT]
3965 . PT_SIZE \\*[$SUBTITLE_PT_SIZE]
3966 . PRINT \\*[$SUBTITLE]
3968 . if !'\\*[$AUTHOR_1]'' \{\
3969 . FAMILY \\*[$AUTHOR_FAM]
3970 . FT \\*[$AUTHOR_FT]
3971 . PT_SIZE \\*[$AUTHOR_PT_SIZE]
3972 . if !'\\*[$ATTRIBUTE_STRING]'' \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
3978 .MAC CHAPTER_DOCHEADER END
3980 . FAMILY \\*[$TITLE_FAM]
3982 . PT_SIZE \\*[$TITLE_PT_SIZE]
3983 . LS \\n[#DOCHEADER_LEAD]u
3984 . ie '\\*[$CHAPTER]'' \{\
3985 . ie !'\\*[$CHAPTER_TITLE]'' \{\
3986 . if \\n[#PRINT_STYLE]=2 \{\
3987 . FAMILY \\*[$CHAPTER_TITLE_FAM]
3988 . FT \\*[$CHAPTER_TITLE_FT]
3989 . PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
3990 . LS \\n[#DOCHEADER_LEAD]u
3992 . PRINT \\*[$CHAPTER_TITLE]
3995 . PRINT \\*[$CHAPTER_STRING]
3999 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4000 . if !'\\*[$CHAPTER_TITLE]'' \{\
4001 . if \\n[#PRINT_STYLE]=1 \{ .PRINT \\*[$CHAPTER_TITLE] \}
4002 . if \\n[#PRINT_STYLE]=2 \{\
4003 . FAMILY \\*[$CHAPTER_TITLE_FAM]
4004 . FT \\*[$CHAPTER_TITLE_FT]
4005 . PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
4006 . LS \\n[#DOCHEADER_LEAD]u
4007 . PRINT \\*[$CHAPTER_TITLE]
4008 . RLD \\n[#DOC_LEAD]u \" Just looks better this way
4015 .MAC NAMED_DOCHEADER END
4017 . FAMILY \\*[$TITLE_FAM]
4019 . PT_SIZE \\*[$TITLE_PT_SIZE]
4020 . LS \\n[#DOCHEADER_LEAD]u
4022 . if !'\\*[$SUBTITLE]'' \{\
4023 . FAMILY \\*[$SUBTITLE_FAM]
4024 . FT \\*[$SUBTITLE_FT]
4025 . PT_SIZE \\*[$SUBTITLE_PT_SIZE]
4026 . PRINT \\*[$SUBTITLE]
4028 . if !'\\*[$AUTHOR_1]'' \{\
4029 . FAMILY \\*[$AUTHOR_FAM]
4030 . FT \\*[$AUTHOR_FT]
4031 . PT_SIZE \\*[$AUTHOR_PT_SIZE]
4032 . if !'\\*[$ATTRIBUTE_STRING]'' \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
4035 . FAMILY \\*[$DOCTYPE_FAM]
4036 . FT \\*[$DOCTYPE_FT]
4037 . PT_SIZE \\*[$DOCTYPE_PT_SIZE]
4038 . LS \\n[#DOCHEADER_LEAD]u
4039 . ALD \\n[#DOCHEADER_LEAD]u
4040 . UNDERSCORE "\\*[$DOC_TYPE]
4045 . if !\\n[#PRINT_STYLE] \{\
4046 . PRINTSTYLE TYPEWRITE
4053 . PRINT "You neglected to enter a PRINTSTYLE"
4055 . ab PRINTSTYLE missing
4059 . if \\n[#COLLATE] \{\
4060 . COPYSTYLE \\*[$COPY_STYLE]
4061 . nr #HEADERS_ON \\n[#HEADER_STATE]
4062 . if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
4063 . sp |\\n[#HEADER_MARGIN]u
4065 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
4066 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
4067 . rm $RESTORE_PAGENUM_STYLE
4071 . ie \\n[#COLLATED_DOC]=1 \{\
4072 \# Collect TITLE for TOC.
4073 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
4074 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
4075 . ie \\n[#USER_SET_TITLE_ITEM] \{\
4076 . ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]\\|
4077 . rr #USER_SET_TITLE_ITEM
4078 . rm $USER_SET_TITLE_ITEM
4081 . ie \\n[#DOC_TYPE]=2 \{\
4082 . ie '\\*[$CHAPTER_TITLE]'' \{\
4083 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
4086 . ie '\\*[$CHAPTER]'' \{\
4087 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]\\|
4090 . ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
4095 . ds $TOC_TITLE_ITEM \\*[$TITLE]\\|
4098 . if \\n[#TOC_AUTHORS]=1 \{\
4099 . ie '\\*[$TOC_AUTHORS]'' \{\
4100 . as $TOC_TITLE_ITEM /\\|\\*[$AUTHOR_1]\\|
4103 . as $TOC_TITLE_ITEM /\\|\\*[$TOC_AUTHORS]\\|
4107 \# Note the use of \!, which transparently embeds the macros used
4108 \# in the TOC_ENTRIES diversion. The elements they control must be
4109 \# processed literally when the diversion is output.
4112 . if \\n[#PRINT_STYLE]=1 \{\
4117 . if \\n[#PRINT_STYLE]=2 \{\
4118 \!. FAMILY \\*[$TOC_TITLE_FAM]
4119 \!. FT \\*[$TOC_TITLE_FT]
4120 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
4123 . ie \\n[#PRINT_STYLE]=1 \{\
4124 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
4127 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
4132 . if \\n[#PRINT_STYLE]=2 \{\
4133 \!. FAMILY \\*[$TOC_PN_FAM]
4134 \!. FT \\*[$TOC_PN_FT]
4135 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
4138 \!. PRINT \\*[LEADER]
4141 \!. PRINT \\n[#TOC_ENTRY_PN]
4147 . nr #FIRST_DOC_TITLE_PN \\n%+\\n[#PAGE_NUM_ADJ]
4148 . af #FIRST_DOC_TITLE_PN \\g[#PAGENUMBER]
4149 . nr #FIRST_DOC_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
4151 \# End TITLE collection
4152 . if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
4153 . sp |\\n[#HEADER_MARGIN]u
4157 . rr #PAGINATION_STATE
4159 . ie \\n[#DOC_HEADER]=0 \{\
4161 . if \\n[#DOC_TYPE]=4 \{\
4162 . if !'\\n(.z'' \{ .di \}
4165 . ie r#ADVANCE_FROM_TOP \{ .sp |\\n[#ADVANCE_FROM_TOP]u-1v \}
4166 . el \{ .sp |\\n[#T_MARGIN]u-1v \}
4167 . if \\n[#COLUMNS] \{\
4170 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4171 . ll \\n[#COL_L_LENGTH]u
4175 . if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \}
4178 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u+\\n[#DOCHEADER_LEAD_ADJ]u \}
4179 . nr #DOCHEADER_LEAD \\n[#LEAD]
4181 . if \\n[#DOC_TYPE]=1 \{\
4183 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
4185 . L_MARGIN \\n[#DOC_L_MARGIN]u
4186 . LL \\n[#DOC_L_LENGTH]u
4188 . if \\n[#PRINT_STYLE]=1 \{\
4193 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4194 . el \{ .vs \\n[#DOC_LEAD]u \}
4196 . if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
4198 . if !'\\*[$SUBTITLE]'' \{\
4199 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4200 . el \{ .vs \\n[#DOC_LEAD]u \}
4201 . PRINT \\*[$SUBTITLE]
4203 . if '\\*[$SUBTITLE]'' \{\
4204 . ALD \\n[#DOC_LEAD]u
4206 . ie !'\\*[$AUTHOR_1]'' \{\
4207 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4208 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
4209 . if !d$SUBTITLE \{\
4210 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4211 . el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4213 . PRINT \\*[$ATTRIBUTE_STRING]
4214 . nr #AUTHORS \\n[#AUTHOR_NUM]
4215 . nr #NEXT_AUTHOR 0 1
4216 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4217 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4219 . if \\n[#AUTHOR_LINES]=1 \{\
4220 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4221 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
4225 . ie !d$SUBTITLE \{\
4226 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4227 . el \{ .RLD \\n[#DOC_LEAD]u \}
4230 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4231 . el \{ .ALD \\n[#DOC_LEAD]u \}
4235 . if \\n[#PRINT_STYLE]=2 \{\
4237 . di DOCHEADER_DIVERSION \" This diversion is only
4238 . br \" necessary to find the depth of the
4239 . DEFAULT_DOCHEADER \" docheader
4242 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
4243 . \"in #DOCHEADER_DEPTH
4244 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
4249 . if \\n[#DOC_TYPE]=2 \{\
4251 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
4253 . L_MARGIN \\n[#DOC_L_MARGIN]u
4254 . LL \\n[#DOC_L_LENGTH]u
4256 . if \\n[#PRINT_STYLE]=1 \{\
4261 . vs \\n[#DOC_LEAD]u
4262 . ie '\\*[$CHAPTER]'' \{\
4264 . ie !'\\*[$CHAPTER_TITLE]'' \{\
4265 . PRINT \\*[$CHAPTER_TITLE]
4269 . PRINT \\*[$CHAPTER_STRING]
4275 . PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4277 . if !'\\*[$CHAPTER_TITLE]'' \{\
4278 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4279 . UNDERSCORE "\\*[$CHAPTER_TITLE]
4282 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4284 . if \\n[#PRINT_STYLE]=2 \{\
4286 . di DOCHEADER_DIVERSION \" This diversion is only
4287 . br \" necessary to find the depth of the
4288 . CHAPTER_DOCHEADER \" docheader
4291 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
4292 . \" in #DOCHEADER_DEPTH
4293 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
4298 . if \\n[#DOC_TYPE]=3 \{\
4300 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
4302 . L_MARGIN \\n[#DOC_L_MARGIN]u
4303 . LL \\n[#DOC_L_LENGTH]u
4305 . if \\n[#PRINT_STYLE]=1 \{\
4310 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4311 . el \{ .vs \\n[#DOC_LEAD]u \}
4313 . if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
4315 . if !'\\*[$SUBTITLE]'' \{\
4316 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4317 . el \{ .vs \\n[#DOC_LEAD]u \}
4318 . PRINT \\*[$SUBTITLE]
4320 . if '\\*[$SUBTITLE]'' \{\
4321 . ALD \\n[#DOC_LEAD]u
4323 . ie !'\\*[$AUTHOR_1]'' \{\
4324 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4325 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
4326 . if !d$SUBTITLE \{\
4327 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4328 . el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4330 . PRINT \\*[$ATTRIBUTE_STRING]
4331 . nr #AUTHORS \\n[#AUTHOR_NUM]
4332 . nr #NEXT_AUTHOR 0 1
4333 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4334 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4336 . if \\n[#AUTHOR_LINES]=1 \{\
4337 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4338 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
4341 . vs \\n[#DOC_LEAD]u
4343 . ie !d$SUBTITLE \{\
4344 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4345 . el \{ .RLD \\n[#DOC_LEAD]u \}
4348 . ie \\n[#SINGLE_SPACE] \{ . \}
4349 . el \{ .RLD \\n[#DOC_LEAD]u \}
4352 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
4353 . el \{ .ALD \\n[#DOC_LEAD]u \}
4354 . UNDERSCORE2 "\\*[$DOC_TYPE]
4355 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4357 . if \\n[#PRINT_STYLE]=2 \{\
4359 . di DOCHEADER_DIVERSION \" This diversion is only
4360 . br \" necessary to find the depth of the
4361 . NAMED_DOCHEADER \" docheader
4364 . nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
4365 . \"in #DOCHEADER_DEPTH
4366 . rm DOCHEADER_DIVERSION \" Removing the diversion macro
4370 . if !\\n[#DOC_TYPE]=4 \{\
4371 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
4372 . nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD] \"Do we need the units?
4373 . ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]u-\\n[#DOCHEADER_SPACE_ADJ]u \}
4374 . el \{ .nr #DOCHEADER_EXTRA_SPACE 0 \}
4375 . if \\n[#PRINT_STYLE]=2 \{ .ALD (\\n[#DOC_LEAD]u*2u)+\\n[#DOCHEADER_EXTRA_SPACE]u \}
4376 . if \\n[#COLUMNS] \{\
4378 . nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
4379 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4380 . LL \\n[#COL_L_LENGTH]u
4386 . rr #DOCHEADER_LEAD
4387 . rr #DOCHEADER_LEAD_ADJ
4390 . rr #DOCHEADER_ADVANCE
4391 . rr #ADVANCE_FROM_TOP
4392 . rr #DOCHEADER_SPACE_ADJ
4393 . rr #DOCHEADER_EXTRA_SPACE
4398 . rm $TOC_TITLE_ITEM
4400 . nr #START_FOR_FOOTERS 1
4403 \# ====================================================================
4405 \# +++MACROS TO CHANGE SOME DEFAULTS+++
4410 \# <none> | <anything> [distance to advance from top of page]
4412 \# Turns printing of document header on or off. If a second argument
4413 \# in units of measure is given, advances that distance from the
4414 \# top of the page without printing the document header.
4416 \# Default is on. If the 1st argument is <anything> (which turns
4417 \# document headers off), the optional 2nd argument may be given
4418 \# (with a unit of measure).
4421 . ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
4423 . if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
4429 \# DOCUMENT HEADER LEADING
4430 \# -----------------------
4432 \# <+|- amount by which to in/decrease leading of doc header>
4434 \# Stores user supplied lead in/decrease in register #DOCHEADER_LEAD_ADJ.
4436 \# A unit of measure must be supplied. Decimal fractions OK.
4437 \# Default is +0, i.e. same as DOC_LEAD.
4439 .MAC DOCHEADER_LEAD END
4440 . nr #DOCHEADER_LEAD_ADJ (\\$1)
4444 \# DOCHEADER ADVANCE
4445 \# -----------------
4447 \# <docheader start position>
4449 \# Creates register #DOCHEADER_ADVANCE, used in START.
4451 \# Unit of measure required.
4452 \# Default is same as T_MARGIN.
4454 .MAC DOCHEADER_ADVANCE END
4455 . nr #DOCHEADER_ADVANCE (\\$1)
4462 \# <family to use for the document header title>
4464 \# Creates or modifies string $TITLE_FAM.
4466 \# Default is same as running text.
4468 .MAC TITLE_FAMILY END
4469 . ds $TITLE_FAM \\$1
4476 \# <font to use for the document header title>
4478 \# Creates or modifies string $TITLE_FT.
4490 \# <+|- number of points by which to in/decrease title at start
4491 \# of the document (relative to running text)>
4493 \# Creates string $TITLE_SIZE_CHANGE.
4495 \# Must be preceded by a +|- sign, with no space afterwards.
4496 \# Fractional point sizes are allowed.
4497 \# Default is +3.5 for printstyle TYPESET DEFAULT | STORY | NAMED;
4498 \# 4 for TYPESET CHAPTER; +0 for TYPEWRITE.
4501 . ds $TITLE_SIZE_CHANGE \\$1
4505 \# CHAPTER TITLE FAMILY
4506 \# --------------------
4508 \# <family to use for the chapter title, if there is one>
4510 \# Creates or modifies string $CHAPTER_TITLE_FAM.
4512 \# Default isame as running text.
4514 .MAC CHAPTER_TITLE_FAMILY END
4515 . ds $CHAPTER_TITLE_FAM \\$1
4519 \# CHAPTER TITLE FONT
4520 \# ------------------
4522 \# <font to use for the chapter title, if there is one>
4524 \# Creates or modifies string $CHAPTER_TITLE_FT.
4526 \# Default is bold italic for TYPESET; varies in TYPEWRITE between
4527 \# caps and underscored, depending on whether chapter title stands
4528 \# alone or has CHAPTER # above it.
4530 .MAC CHAPTER_TITLE_FONT END
4531 . ds $CHAPTER_TITLE_FT \\$1
4535 \# CHAPTER TITLE SIZE
4536 \# ------------------
4538 \# <+|- number of points by which to in/decrease title at start
4539 \# of the document (relative to running text)>
4541 \# Creates string $CHAPTER_TITLE_SIZE_CHANGE.
4543 \# Must be preceded by a +|- sign, with no space afterwards.
4544 \# Fractional point sizes are allowed.
4545 \# Default is +4 for printstyle TYPESET
4547 .MAC CHAPTER_TITLE_SIZE END
4548 . ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
4555 \# <family to use for the document header title>
4557 \# Creates or modifies string $SUBTITLE_FAM.
4559 \# Default is same as running text.
4561 .MAC SUBTITLE_FAMILY END
4562 . ds $SUBTITLE_FAM \\$1
4569 \# <font to use for the document header title>
4571 \# Creates or modifies string $SUBTITLE_FT.
4573 \# Default is same as running text.
4575 .MAC SUBTITLE_FONT END
4576 . ds $SUBTITLE_FT \\$1
4583 \# <+|- number of points by which to in/decrease subtitle at start
4584 \# of the document (relative to running text)>
4586 \# Creates or modifies string $SUBTITLE_SIZE_CHANGE.
4588 \# Must be preceded by a +|- sign with no space afterwards.
4589 \# Fractional point sizes are allowed.
4592 .MAC SUBTITLE_SIZE END
4593 . ds $SUBTITLE_SIZE_CHANGE \\$1
4600 \# <family to use for author in document header>
4602 \# Creates or modifies string $AUTHOR_FAM.
4604 \# Default is same as running text.
4606 .MAC AUTHOR_FAMILY END
4607 . ds $AUTHOR_FAM \\$1
4614 \# <font to use for author in document header>
4616 \# Creates or modifies string $AUTHOR_FT.
4618 \# Default is italic.
4620 .MAC AUTHOR_FONT END
4621 . ds $AUTHOR_FT \\$1
4628 \# <+|- number of points by which to in/decrease author at start
4631 \# Creates or modifies string $AUTHOR_SIZE_CHANGE.
4633 \# Must be preceded by a +|- sign with no space afterwards.
4634 \# Fractional point sizes are allowed.
4635 \# Default is same as running text.
4637 .MAC AUTHOR_SIZE END
4638 . ds $AUTHOR_SIZE_CHANGE \\$1
4645 \# <family to use for the document type string>
4647 \# Creates or modifies string $DOCTYPE_FAM.
4649 \# Default is same as running text.
4651 .MAC DOCTYPE_FAMILY END
4652 . ds $DOCTYPE_FAM \\$1
4659 \# <font to use for the document type string>
4661 \# Creates or modifies string $DOCTYPE_FT.
4663 \# Default is bold italic.
4665 .MAC DOCTYPE_FONT END
4666 . ds $DOCTYPE_FT \\$1
4673 \# <+|- number of points by which to in/decrease the document
4674 \# type string (relative to running text)>
4676 \# Creates or modifies string $DOCTYPE_SIZE_CHANGE.
4678 \# Must be preceded by a +|- sign with no space afterwards.
4679 \# Fractional point sizes are allowed.
4680 \# Default is +3 for TYPESET; 0 for TYPEWRITE.
4682 .MAC DOCTYPE_SIZE END
4683 . ds $DOCTYPE_SIZE_CHANGE \\$1
4687 \# DOCUMENT LEFT MARGIN
4688 \# --------------------
4690 \# <left margin of document>
4692 \# Creates or modifies register #DOC_L_MARGIN.
4694 \# Affects EVERYTHING on the page.
4696 .MAC DOC_LEFT_MARGIN END
4698 . nr #DOC_L_MARGIN (\\$1)
4699 . L_MARGIN \\n[#DOC_L_MARGIN]u
4703 \# DOCUMENT RIGHT MARGIN
4704 \# ---------------------
4706 \# <right margin of document>
4708 \# Creates or modifies register #DOC_R_MARGIN.
4710 \# Affects EVERYTHING on the page.
4712 .MAC DOC_RIGHT_MARGIN END
4714 . nr #DOC_R_MARGIN (\\$1)
4715 . R_MARGIN \\n[#DOC_R_MARGIN]
4716 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
4720 \# DOCUMENT LINE LENGTH
4721 \# --------------------
4723 \# <line length of document>
4725 \# Creates or modifies string $DOC_L_LENGTH.
4727 \# Affects EVERYTHING on the page.
4729 .MAC DOC_LINE_LENGTH END
4731 . nr #DOC_L_LENGTH (\\$1)
4732 . LL \\n[#DOC_L_LENGTH]u
4740 \# <family of running text>
4742 \# Creates or modifies string $DOC_FAM.
4744 \# Affects everything EXCEPT headers and footers.
4749 . FAMILY \\*[$DOC_FAM]
4750 . TITLE_FAMILY \\*[$DOC_FAM]
4751 . SUBTITLE_FAMILY \\*[$DOC_FAM]
4752 . AUTHOR_FAMILY \\*[$DOC_FAM]
4753 . DOCTYPE_FAMILY \\*[$DOC_FAM]
4754 . HEAD_FAMILY \\*[$DOC_FAM]
4755 . SUBHEAD_FAMILY \\*[$DOC_FAM]
4756 . QUOTE_FAMILY \\*[$DOC_FAM]
4757 . BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
4758 . EPIGRAPH_FAMILY \\*[$DOC_FAM]
4759 . HDRFTR_FAMILY \\*[$DOC_FAM]
4760 . PAGENUM_FAMILY \\*[$DOC_FAM]
4764 \# DOCUMENT POINT SIZE
4765 \# -------------------
4767 \# <point size of running text>
4769 \# Creates or modifies register #DOC_PT_SIZE.
4771 \# DOC_PT_SIZE is the basis for calculating all type sizes in
4774 .MAC DOC_PT_SIZE END
4775 . if \\n[#IGNORE] \{ .return \}
4778 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
4785 \# <lead (".vs") of running text> [ADJUST]
4787 \# Creates or modifies register #DOC_LEAD. If the optional
4788 \# ADJUST argument is given, adjusts leading so that the last
4789 \# line of text falls exactly on #B_MARGIN.
4791 \# DOC_LEAD is the basis for calculating all leading changes in
4792 \# a document. Default for TYPESET is 16; 24 for TYPEWRITE.
4794 \# Because the visible bottom or footer margin of a page depends
4795 \# on the overall document lead supplied by the register #DOC_LEAD,
4796 \# DOC_LEAD, in the body of a document, should always be associated
4797 \# with the start of a new page (in other words, just before or
4798 \# just after a manual NEWPAGE).
4801 . if \\n[#IGNORE] \{ .return \}
4804 . nr #DOC_LEAD \\n[#LEAD]
4805 . if '\\$2'ADJUST' \{ .TRAPS \}
4808 \# ADJUST DOCUMENT LEAD
4809 \# --------------------
4811 \# <none> | <anything>
4813 \# Adjusts document lead so that the last line of text falls exactly
4816 .MAC DOC_LEAD_ADJUST END
4817 . ie '\\$1'' \{ .nr #ADJ_DOC_LEAD 1 \}
4818 . el \{ .nr #ADJ_DOC_LEAD 0 \}
4825 \# L | LEFT | R | RIGHT | C | CENTER | CENTRE | J | JUSTIFY
4827 \# Creates or modifies string $DOC_QUAD.
4829 \# While QUAD (from the typesetting macros) can be used before START
4830 \# to change the default document quad, DOC_QUAD *must* be used after
4831 \# the START macro has been invoked.
4833 \# Default is LEFT for printstyle TYPEWRITE, JUSTIFY for printstyle
4838 . QUAD \\*[$DOC_QUAD]
4841 \# ====================================================================
4843 \# +++INTERNATIONALIZATION+++
4848 \# <what goes in the "by" slot before author in the document header>
4850 \# Creates or modifies string $ATTRIBUTE_STRING.
4852 \# Default is "by". A blank string ("") may be used if no
4853 \# attribution is desired.
4855 .MAC ATTRIBUTE_STRING END
4856 . ds $ATTRIBUTE_STRING \\$1
4863 \# <what to print any time the word "chapter" is required>
4865 \# Creates or modifies string $CHAPTER_STRING.
4867 \# Default is "chapter".
4869 .MAC CHAPTER_STRING END
4870 . ds $CHAPTER_STRING \\$1
4877 \# <what to print any time the word "draft" is required>
4879 \# Creates or modifies string $DRAFT_STRING.
4881 \# Default is "draft".
4883 .MAC DRAFT_STRING END
4884 . ds $DRAFT_STRING \\$1
4891 \# <what to print any time the word "revision" is required>
4893 \# Creates or modifies string $REVISION_STRING.
4895 \# Default is "revision".
4897 .MAC REVISION_STRING END
4898 . ds $REVISION_STRING \\$1
4905 \# <what to print with the finis macro>
4907 \# Creates or modifies string $FINIS_STRING.
4909 \# Default is "END".
4911 .MAC FINIS_STRING END
4914 . ds $FINIS_STRING \\$1
4918 \# ====================================================================
4920 \# +++RECTO/VERSO+++
4925 \# <none> | <anything>
4927 \# Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages. Also
4928 \# switches page numbers left and right if either is chosen rather
4929 \# than the default centered page numbers. Switches left and right
4930 \# margins if differing values have been entered.
4934 .MAC RECTO_VERSO END
4935 . ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
4936 . el \{ .nr #RECTO_VERSO 0 \}
4939 \# ====================================================================
4946 \# <family to use for epigraphs>
4948 \# Creates or modifies string $EPI_FAM.
4950 \# Default is same as running text.
4952 .MAC EPIGRAPH_FAMILY END
4960 \# <font to use for epigraphs>
4962 \# Creates or modifies string $EPI_FT.
4964 \# Default is same as running text.
4966 .MAC EPIGRAPH_FONT END
4974 \# <-|+ number of points by which to de/increase point size of epigraphs
4975 \# (relative to running text)>
4977 \# Creates or modifies string $EPI_SIZE_CHANGE.
4979 \# Must be preceded by a - or + sign with no space afterwards.
4980 \# Fractional point sizes are allowed. Default -1.5 for printstyle
4981 \# TYPESET; +0 for TYPEWRITE.
4983 .MAC EPIGRAPH_SIZE END
4984 . ds $EPI_SIZE_CHANGE \\$1
4991 \# L | LEFT | J | JUSTIFY
4993 \# Creates or modifies string $EPI_QUAD.
4995 \# Default is $DOC_QUAD when BLOCK argument is passed to EPIGRAPH.
4997 .MAC EPIGRAPH_QUAD END
5005 \# <value by which to multiply PP_INDENT for block epigraphs>
5007 \# Creates or modifies register #EPI_OFFSET_VALUE.
5009 \# Default is 2 for TYPEWRITE, 3 for TYPESET.
5011 .MAC EPIGRAPH_INDENT END
5012 . nr #EPI_OFFSET_VALUE \\$1
5016 \# EPIGRAPH AUTOLEAD
5017 \# -----------------
5019 \# <amount of lead to add to the epigraph ps for epigraph leading>
5021 \# Creates or modifies register #EPI_AUTOLEAD.
5023 \# Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
5025 .MAC EPIGRAPH_AUTOLEAD END
5026 . nr #EPI_AUTOLEAD \\$1
5033 \# BLOCK | <anything>
5035 \# Places an epigraph before the document's text, after the
5036 \# document header, or after a HEAD.
5038 \# #EPIGRAPH 1 = centered; 2 = block
5040 \# By default, epigraphs are centered, allowing the user
5041 \# to input them on a line per line basis. To change this
5042 \# behaviour, the user can supply the argument BLOCK, which
5043 \# will produce indented, filled text similar to BLOCKQUOTE.
5045 \# If a block epigraph contains more than one para, ALL paras of
5046 \# the epigraph must be preceded by PP. Otherwise, PP is optional.
5051 . if \\n[#START] \{\
5052 . if \\n[#PRINT_STYLE]=1 \{\
5053 . if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
5059 . ll \\n[#L_LENGTH]u
5062 . if \\n[#COLUMNS] \{\
5063 . ie \\n[#START] \{\
5064 . ll \\n[#DOC_L_LENGTH]u
5068 . ll \\n[#COL_L_LENGTH]u
5073 . if \\n[#PRINT_STYLE]=1 \{\
5076 . if '\\*[$EPI_FT]'I' \{\
5080 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
5081 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
5082 . nr #EPI_LEAD \\n[#LEAD]
5083 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5085 . if \\n[#PRINT_STYLE]=2 \{\
5086 . FAMILY \\*[$EPI_FAM]
5088 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
5089 . AUTOLEAD \\n[#EPI_AUTOLEAD]
5090 . nr #EPI_LEAD \\n[#LEAD]
5091 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5097 . ie '\\$1'BLOCK' \{\
5100 . ie \\n[#START] \{\
5101 . ie \\n[#COLUMNS] \{\
5102 . ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5106 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5111 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5113 . if \\n[#COLUMNS] \{\
5114 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5119 . if \\n[#PRINT_STYLE]=1 \{\
5122 . if '\\*[$EPI_FT]'I' \{\
5126 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
5127 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
5130 . nr #EPI_LEAD \\n[#LEAD]
5131 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5135 . if \\n[#PRINT_STYLE]=2 \{\
5136 . FAMILY \\*[$EPI_FAM]
5138 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
5139 . AUTOLEAD \\n[#EPI_AUTOLEAD]
5140 . QUAD \\*[$EPI_QUAD]
5142 . nr #EPI_LEAD \\n[#LEAD]
5143 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5160 \# Ends diversion started in EPIGRAPH. Makes spacing
5161 \# adjustments to compensate for the difference between epigraph
5162 \# leading and overall document leading, so that the bottom of
5163 \# the pages remain flush.
5165 \# In addition to its usual place at the beginning of a
5166 \# document, EPIGRAPH may also be used after HEAD.
5168 .MAC DO_EPIGRAPH END
5173 . nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
5174 . nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
5175 . ie \\n[#START] \{\
5176 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
5177 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5178 . if \\n[#PRINT_STYLE]=2 \{\
5179 . RLD \\n[#DOC_LEAD]u
5180 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5181 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
5183 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5184 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5189 . ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
5191 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
5192 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5193 . ie \\n[#PRINT_STYLE]=1 \{\
5194 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
5197 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5198 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
5200 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5201 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5206 . nr #EPI_LINES_TO_TRAP 0 1
5207 . while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{ .nr #LOOP 1 \}
5208 . nr #EPI_LINES_TO_TRAP -1
5209 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
5210 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5211 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
5212 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
5215 . if \\n[#EPIGRAPH]=1 \{\
5216 . po \\n[#L_MARGIN]u
5217 . if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
5219 . if \\n[#EPIGRAPH]=2 \{\
5220 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5221 . if \\n[#COLUMNS] \{\
5222 . nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5224 . po \\n[#EPI_OFFSET]u
5229 . ie \\n[#START] \{\
5230 . if \\n[#PRINT_STYLE]=1 \{\
5231 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
5233 . ie \\n[#EPI_LINES]%2=1 \{ .ALD \\n[#DOC_LEAD]u \}
5234 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
5237 . if \\n[#PRINT_STYLE]=2 \{\
5238 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5239 . ALD \\n[#EPI_WHITESPACE]u/2u
5241 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5242 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5248 . ie \\n[#EPI_FITS] \{\
5249 . ie \\n[#FN_FOR_EPI] \{\
5250 . nr #EPI_LINES_TO_END 1
5251 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
5252 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5253 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
5256 . ie \\n[#PRINT_STYLE]=1 \{\
5257 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
5260 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5261 . ALD \\n[#EPI_WHITESPACE]u/2u
5263 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5264 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5270 . nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
5271 . if \\n[#LOOP] \{. nr #EPI_LINES_TO_END +1 \}
5273 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
5274 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5275 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
5276 . if \\n[#PRINT_STYLE]=1 \{\
5277 . if !\\n[#SINGLE_SPACE] \{\
5278 . nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
5279 . ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
5281 . rr #EPI_LINES_EVEN
5288 . ALD \\n[#DOC_LEAD]u
5289 . QUAD \\*[$DOC_QUAD]
5290 . po \\n[#L_MARGIN]u
5291 . if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
5292 . if \\n[#START] \{\
5293 . if \\n[#COLUMNS] \{\
5294 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5300 \# ====================================================================
5302 \# +++FINIS MACRO+++
5309 \# Deposits --END-- at the end of a document.
5313 . if \\n[#TAB_ACTIVE] \{ .TQ \}
5314 . if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
5315 . if \\n[#FOOTERS_ON] \{\
5316 . nr #FOOTERS_WERE_ON 1
5319 . if \\n[#PAGINATE] \{\
5320 . if \\n[#PAGE_NUM_V_POS]=2 \{\
5321 . nr #PAGINATION_WAS_ON 1
5325 . nr #EM_ADJUST (1m/8)
5326 . if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
5327 . ALD \\n[#DOC_LEAD]u
5329 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
5330 . if \\n[#PRINT_STYLE]=2 \{\
5331 . PRINT "\v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em
5335 \# ====================================================================
5337 \# +++HEADERS/FOOTERS+++
5339 \# Define a string so that the current page number can be incorporated
5340 \# into the strings for hdrftr left, right, and center. NOTE: This is
5341 \# not the same thing as using the shortform # in hdrftr strings.
5343 .ds PAGE# \En[#PAGENUMBER]
5349 \# <family to use in header/footers>
5351 \# Creates or modifies string $HDRFTR_FAM.
5353 \# Default is same as running text.
5355 .MAC HDRFTR_FAMILY END
5356 . ds $HDRFTR_FAM \\$1
5363 \# <+|-number of points by which to in/decrease point size of
5364 \# header/footers (relative to running text)>
5366 \# Creates or modifies string $HDRFTR_SIZE_CHANGE.
5368 \# Must be preceded by a +|- sign. No space afterwards.
5369 \# Fractional point sizes are allowed. Default is +0.
5371 \# By default, header/footers print the author .5 points smaller
5372 \# than the base point size of running text, center titles
5373 \# (Chapter, Draft, Revision, etc.) .5 points smaller
5374 \# than running text (in italics), and the document title 2 full
5375 \# points smaller than running text (in caps). The HDRFTR_SIZE
5376 \# macro changes the overall size for all three parts while
5377 \# maintaining the internal size changes.
5379 \# In other words, if the user likes the header/footers but wants
5380 \# them a bit bigger or a bit smaller, s/he should use HDRFTR_SIZE.
5382 .MAC HDRFTR_SIZE END
5383 . ds $HDRFTR_SIZE_CHANGE \\$1
5390 \# <amount of space between header/footer and header/footer rule>
5392 \# Creates or modifies register #HDRFTR_RULE_GAP to hold amount
5393 \# of space between header/footer and header/footer rule.
5397 .MAC HDRFTR_RULE_GAP END
5398 . nr #HDRFTR_RULE_GAP (\\$1)
5405 \# <what to put in the left position of page header/footers>
5407 \# Creates or modifies string $HDRFTR_LEFT.
5408 \# Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
5409 \# overrides the $HDRFTR_LEFT string created by default
5412 \# Especially useful if doc has more than one author, and a list
5413 \# of authors by last name is desired in header/footers.
5414 \# Default is author.
5416 \# If the argument is the # character, simply prints the current
5419 \# If the user wants to *incorporate* the page number into the string,
5420 \# \*[PAGE#] must be used. For example, if the user wants to put
5421 \# an elipsis before the page number in the string, s/he should use
5422 \# ...\*[PAGE#], not ...#
5424 .MAC HDRFTR_LEFT END
5425 . nr #USER_DEF_HDRFTR_LEFT 1
5426 . ds $HDRFTR_LEFT \\$1
5430 \# HDRFTR LEFT FAMILY
5431 \# ------------------
5433 \# <family of header/footer left string>
5435 \# Creates or modifies string $HDRFTR_LEFT_FAM.
5437 .MAC HDRFTR_LEFT_FAMILY END
5438 . ds $HDRFTR_LEFT_FAM \\$1
5445 \# <font of header/footer left string>
5447 \# Creates or modifies string $HDRFTR_LEFT_FT.
5449 .MAC HDRFTR_LEFT_FONT END
5450 . ds $HDRFTR_LEFT_FT \\$1
5457 \# <+|- number of points to in/decrease size of left string in
5458 \# header/footers (relative to running text)>
5460 \# Creates or modifies string HDRFTR_LEFT_SIZE_CHANGE.
5462 \# Must be preceded by a +|- sign. No space afterwards.
5463 \# Fractional point sizes are allowed.
5464 \# Default is -.5 for printstyle TYPESET; if all caps, -2
5465 \# Has no effect in TYPEWRITE.
5467 .MAC HDRFTR_LEFT_SIZE END
5468 . ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5475 \# <none> | <anything>
5477 \# Turns capitalisation of $HDRFTR_LEFT (typically, the author of
5478 \# the document) on or off.
5482 .MAC HDRFTR_LEFT_CAPS END
5484 . nr #HDRFTR_LEFT_CAPS 1
5487 . nr #HDRFTR_LEFT_CAPS 0
5488 . ds $HDRFTR_RIGHT_SIZE_CHANGE +0
5496 \# <what to put in the centre position of page header/footers>
5498 \# Creates or modifies string $HDRFTR_CENTER.
5499 \# Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
5500 \# overrides the $HDRFTR_CENTER string created by default
5503 \# Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
5504 \# CHAPTER, draft and revision number if COPYSTYLE DRAFT.
5506 \# If the argument is the # character, simply prints the current
5509 \# If the user wants to *incorporate* the page number into the string,
5510 \# \*[PAGE#] must be used. For example, if the user wants to put
5511 \# an elipsis before the page number in the string, s/he should use
5512 \# ...\*[PAGE#], not ...#
5514 .MAC HDRFTR_CENTER END
5515 . nr #USER_DEF_HDRFTR_CENTER 1
5516 . if '\\$0'FOOTER_CENTER' \{\
5517 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
5518 . ds $HDRFTR_CENTER_NEW \\$1
5520 . if '\\$0'FOOTER_CENTRE' \{\
5521 . ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
5522 . ds $HDRFTR_CENTER_NEW \\$1
5524 . ds $HDRFTR_CENTER \\$1
5528 \# HDRFTR CENTER FAMILY
5529 \# --------------------
5531 \# <family of header/footer center string>
5533 \# Creates or modifies string $HDRFTR_CENTER_FAM.
5535 .MAC HDRFTR_CENTER_FAMILY END
5536 . ds $HDRFTR_CENTER_FAM \\$1
5540 \# HDRFTR CENTER FONT
5541 \# ------------------
5543 \# <font of header/footer center string>
5545 \# Creates or modifies string $HDRFTR_CENTER_FT.
5547 .MAC HDRFTR_CENTER_FONT END
5548 . ds $HDRFTR_CENTER_FT \\$1
5552 \# HDRFTR CENTER SIZE
5553 \# ------------------
5555 \# <+|- number of points to in/decrease size of centre string in
5556 \# header/footers (relative to header/footer size)>
5558 \# Creates string HDRFTR_CENTER_SIZE_CHANGE.
5560 \# Must be preceded by a +|- sign. No space afterwards.
5561 \# Fractional point sizes are allowed.
5562 \# Default is -.5 for printstyle TYPESET; if all caps, -2
5563 \# Has no effect in TYPEWRITE.
5565 .MAC HDRFTR_CENTER_SIZE END
5566 . ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
5570 \# HDRFTR CENTER CAPS
5571 \# ------------------
5573 \# <none> | <anything>
5575 \# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
5576 \# the document) on or off.
5580 .MAC HDRFTR_CENTER_CAPS END
5582 . nr #HDRFTR_CENTER_CAPS 1
5585 . nr #HDRFTR_CENTER_CAPS 0
5586 . ds $HDRFTR_CENTER_SIZE_CHANGE +0
5591 \# HDRFTR CENTER PADDING
5592 \# ---------------------
5594 \# LEFT | RIGHT <amount of padding to put left or right of hdrftr
5597 \# Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
5598 \# #HDRFTR_CTR_PAD_RIGHT.
5600 \# By default, the HDRFTR_CENTER string is centered on the doc
5601 \# line length. Long titles or long author names can screw up
5602 \# visual centering, or create overprints. This macro allows the
5603 \# user to pad the center string by the specified amount of space
5604 \# to fix these problems. Use only one of LEFT or RIGHT.
5606 \# A unit of measure is required.
5608 .MAC HDRFTR_CENTER_PAD END
5609 . if '\\$1'LEFT' \{\
5610 . nr #HDRFTR_CTR_PAD_LEFT (\\$2)
5612 . if '\\$1'RIGHT' \{\
5613 . nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
5618 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
5619 \# --------------------------------
5623 \# Switches the padding side of hdrftr center padding.
5625 \# Required to keep spacing around hdrftr string constant
5626 \# in recto/verso documents.
5628 .MAC SWITCH_HDRFTR_CENTER_PAD END
5629 . nr #HDRFTR_CTR_PAD_TMP \\n[#HDRFTR_CTR_PAD_LEFT]
5630 . HDRFTR_CENTER_PAD LEFT \\n[#HDRFTR_CTR_PAD_RIGHT]u
5631 . HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
5638 \# <what to put in the right position of page header/footers>
5640 \# Creates or modifies string $HDRFTR_RIGHT.
5641 \# Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
5642 \# overrides the $HDRFTR_RIGHT string created by default
5645 \# Default is document title.
5647 \# If the argument is the # character, simply prints the current
5650 \# If the user wants to *incorporate* the page number into the string,
5651 \# \*[PAGE#] must be used. For example, if the user wants to put
5652 \# an elipsis before the page number in the string, s/he should use
5653 \# ...\*[PAGE#], not ...#
5655 .MAC HDRFTR_RIGHT END
5656 . nr #USER_DEF_HDRFTR_RIGHT 1
5657 . ds $HDRFTR_RIGHT \\$1
5661 \# HDRFTR RIGHT FAMILY
5662 \# -------------------
5664 \# <family of header/footer right string>
5666 \# Creates or modifies string $HDRFTR_RIGHT_FAM.
5668 .MAC HDRFTR_RIGHT_FAMILY END
5669 . ds $HDRFTR_RIGHT_FAM \\$1
5673 \# HDRFTR RIGHT FONT
5674 \# -----------------
5676 \# <font of header/footer right string>
5678 \# Creates or modifies string $HDRFTR_RIGHT_FT.
5680 .MAC HDRFTR_RIGHT_FONT END
5681 . ds $HDRFTR_RIGHT_FT \\$1
5685 \# HDRFTR RIGHT SIZE
5686 \# -----------------
5688 \# <+|- number of points to in/decrease size of right string in
5689 \# header/footers (relative to header/footer size)>
5691 \# Creates or modifies string HDRFTR_RIGHT_SIZE_CHANGE.
5693 \# Must be preceded by a +|- sign. No space afterwards.
5694 \# Fractional point sizes are allowed.
5695 \# Default is -2 for printstyle TYPESET if all caps; otherwise -.5
5696 \# Has no effect in TYPEWRITE.
5698 .MAC HDRFTR_RIGHT_SIZE END
5699 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
5703 \# HDRFTR RIGHT CAPS
5704 \# -----------------
5706 \# <none> | <anything>
5708 \# Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
5709 \# the document) on or off.
5713 .MAC HDRFTR_RIGHT_CAPS END
5715 . nr #HDRFTR_RIGHT_CAPS 1
5718 . nr #HDRFTR_RIGHT_CAPS 0
5719 . ds $HDRFTR_RIGHT_SIZE_CHANGE +0
5726 \# <none> | <anything>
5728 \# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
5729 \# under the header/footer. Otherwise, turns HDRFTR_RULE on or off.
5731 .MAC HDRFTR_RULE END \"To print rule under header/over footer.
5732 . ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
5733 . ie \\n[#USERDEF_HDRFTR] \{\
5734 . nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
5736 . if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
5737 . if \\n[#FOOTERS_ON] \{\
5738 . RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
5740 . PRINT \\l'\\n[#DOC_L_LENGTH]u'
5744 . if \\n[#PRINT_STYLE]=1 \{\
5745 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
5747 . if \\n[#PRINT_STYLE]=2 \{\
5748 . ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
5749 . nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
5751 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
5752 . ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
5753 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
5755 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
5758 . if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
5759 . if \\n[#FOOTERS_ON] \{\
5760 . RLD \\n[#LEAD]u*3u+\\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
5762 . PRINT \\l'\\n[#DOC_L_LENGTH]u'
5767 . ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
5768 . el \{ .nr #HDRFTR_RULE 0 \}
5773 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
5781 \# Sets the family, font, and point size of all strings in
5782 \# header/footers to the same family and point size as running
5783 \# text. Font for the header/footer becomes roman throughout.
5785 .MAC HDRFTR_PLAIN END
5786 . HDRFTR_FAMILY \\*[$DOC_FAM]
5787 . HDRFTR_PT_SIZE \\n[#DOC_PT_SIZE]
5788 . HDRFTR_LEFT_FAMILY \\*[$DOC_FAM]
5789 . HDRFTR_LEFT_FONT R
5790 . HDRFTR_LEFT_SIZE +0
5791 . HDRFTR_LEFT_CAPS OFF
5792 . HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
5793 . HDRFTR_CENTER_FONT R
5794 . HDRFTR_CENTER_SIZE +0
5795 . HDRFTR_CENTER_CAPS OFF
5796 . HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]
5797 . HDRFTR_RIGHT_FONT R
5798 . HDRFTR_RIGHT_SIZE +0
5799 . HDRFTR_RIGHT_CAPS OFF
5806 \# <none> | <anything>
5808 \# Creates or modifies register #SWITCH_HDRFTR, used to switch
5809 \# default location of HDRFTR_LEFT and HDRFTR_RIGHT.
5811 \# Typically, the author string appears at the left of header/footers,
5812 \# and the title string appears at the right. This switches the
5813 \# location of the two. Useful in conjuction with RECTO_VERSO to
5814 \# tweak switches on alternate pages to come out as the user wishes.
5815 \# The assumption of RECTO_VERSO is that the first page of the document
5816 \# (recto) is odd, and even though it has no header/footer, if it did have one,
5817 \# it would print as AUTHOR...CENTER...TITLE (or whatever strings
5818 \# the user has supplied for HDRFTR_LEFT/RIGHT), meaning that the
5819 \# next page, which does have a header/footer, will come out as
5820 \# TITLE...CENTER...AUTHOR (or whatever strings the user has
5821 \# supplied for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user
5822 \# to get the desired string in the desired place on the desired
5823 \# recto/verso page.
5827 .MAC SWITCH_HDRFTR END
5828 . ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
5829 . el \{ .nr #SWITCH_HDRFTR 0 \}
5833 \# USER DEFINED HDRFTR RECTO
5834 \# -------------------------
5836 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
5838 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
5839 \# stores string in $USERDEF_HDRFTR_RECTO.
5841 \# For use when users don't want 3-part headers/footers, but rather
5842 \# want to design their own headers/footers and need different
5843 \# headers/footers on recto and verso pages.
5845 .MAC HDRFTR_RECTO END
5846 . nr #USERDEF_HDRFTR 1
5847 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
5848 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
5849 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5850 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5851 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5852 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
5853 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
5854 . ds $USERDEF_HDRFTR_RECTO \\$2
5858 \# USER DEFINED HDRFTR VERSO
5859 \# -------------------------
5861 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
5863 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
5864 \# stores string in $USERDEF_HDRFTR_VERSO.
5866 \# For use when users don't want 3-part headers/footers, but rather
5867 \# want to design their own headers/footers and need different
5868 \# headers/footers on recto and verso pages.
5870 .MAC HDRFTR_VERSO END
5871 . nr #USERDEF_HDRFTR 1
5872 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
5873 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
5874 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5875 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5876 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5877 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
5878 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
5879 . ds $USERDEF_HDRFTR_VERSO \\$2
5883 \# PRINT FOOTER ON FIRST PAGE
5884 \# --------------------------
5886 \# <none> | <anything>
5888 \# Toggles register #PRINT_FOOTER_ON_PAGE_1
5890 \# Lets user choose whether to print footer on first
5893 .MAC FOOTER_ON_FIRST_PAGE END
5894 . ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
5895 . el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
5899 \# PRINT PAGE NUMBER ON FIRST PAGE
5900 \# -------------------------------
5902 \# <none> | <anything>
5904 \# Toggles register #PRINT_PAGENUM_ON_PAGE_1
5906 \# Lets user choose whether to print page number on first
5907 \# page of doc and after collate when footers are on or page numbering
5908 \# has been user set at top of page.
5910 .MAC PAGENUM_ON_FIRST_PAGE END
5911 . ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
5912 . el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
5916 \# PRINT HEADER/FOOTER
5917 \# -------------------
5921 \# Based on defaults or values entered by user, prints a
5922 \# three-part title at either the top or the bottom of the page.
5924 \# Called from within either HEADER or FOOTER.
5926 .MAC PRINT_HDRFTR END
5927 . if \\n[#DOC_TYPE]=4 \{\
5928 . nr #SUITE \En[.pn]
5930 . if \\n[#FOOTERS_ON] \{\
5931 . if \\n[#START_FOR_FOOTERS] \{\
5932 . rr #START_FOR_FOOTERS
5933 . if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{ .return \}
5936 . if \\n[#HEADERS_ON] \{ .vs 0 \}
5937 . if \\n[#USERDEF_HDRFTR] \{\
5938 . PRINT_USERDEF_HDRFTR
5941 . if \\n[#SWITCH_HDRFTR] \{\
5942 . ds $HDRFTR_TMP_SWITCH \\*[$HDRFTR_LEFT]
5943 . ds $HDRFTR_LEFT \\*[$HDRFTR_RIGHT]
5944 . ds $HDRFTR_RIGHT \\*[$HDRFTR_TMP_SWITCH]
5945 . ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
5946 . ds $HDRFTR_LEFT_SIZE_CHANGE \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
5947 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
5948 . nr #HDRFTR_TMP_CAPS_SWITCH \\n[#HDRFTR_LEFT_CAPS]
5949 . nr #HDRFTR_LEFT_CAPS \\n[#HDRFTR_RIGHT_CAPS]
5950 . nr #HDRFTR_RIGHT_CAPS \\n[#HDRFTR_TMP_CAPS_SWITCH]
5951 . rr #HDRFTR_TMP_CAPS_SWITCH
5952 . rm $HDRFTR_TMP_SWITCH
5953 . rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
5954 . nr #SWITCH_HDRFTR 0
5956 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
5957 . if \\n[#ENDNOTES] \{ .PAGENUM_STYLE \\*[$EN_PN_STYLE] \}
5958 . if \\n[#PRINT_STYLE]=1 \{\
5959 . if \\n[#FOOTERS_ON] \{\
5962 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
5967 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
5968 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
5969 . ie '\\*[$HDRFTR_LEFT]'#' \{\
5970 . PRINT \\n[#PAGENUMBER]
5973 . ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
5974 . el \{ .PRINT \& \}
5976 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
5978 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
5979 . ie '\\*[$HDRFTR_CENTER]'#' \{\
5980 . PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
5983 . ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
5984 . el \{ .PRINT \& \}
5986 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
5989 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
5990 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
5991 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
5992 . PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
5995 . ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
5996 . el \{ .PRINT \& \}
5998 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
6000 . if \\n[#PRINT_STYLE]=2 \{\
6001 . FAMILY \\*[$HDRFTR_LEFT_FAM]
6002 . FT \\*[$HDRFTR_LEFT_FT]
6003 . PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
6004 . if \\n[#FOOTERS_ON] \{\
6007 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6012 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
6013 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
6014 . ie '\\*[$HDRFTR_LEFT]'#' \{ .PRINT \\n[#PAGENUMBER] \}
6016 . ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
6017 . el \{ .PRINT \& \}
6019 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
6020 . FAMILY \\*[$HDRFTR_CENTER_FAM]
6021 . FT \\*[$HDRFTR_CENTER_FT]
6022 . PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
6023 . if \\n[#FOOTERS_ON] \{\
6026 . nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
6030 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
6031 . ie '\\*[$HDRFTR_CENTER]'#' \{\
6032 . PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
6035 . ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
6036 . el \{ .PRINT \& \}
6038 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
6039 . FAMILY \\*[$HDRFTR_RIGHT_FAM]
6040 . FT \\*[$HDRFTR_RIGHT_FT]
6041 . PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
6042 . if \\n[#FOOTERS_ON] \{\
6045 . nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6050 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
6051 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
6052 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
6053 . PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
6056 . ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
6057 . el \{ .PRINT \& \}
6059 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
6061 . if \\n[#HDRFTR_RULE] \{\
6062 . HDRFTR_RULE_INTERNAL
6067 \# PRINT USER DEFINED HEADER/FOOTER
6068 \# --------------------------------
6072 \# Based on defaults or values entered by user, prints a single part
6073 \# (i.e. not 3-part) title at either the top or the bottom of the page.
6075 \# Called from within PRINT_HDRFTR.
6077 .MAC PRINT_USERDEF_HDRFTR END
6078 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
6080 . if \\n[#PRINT_STYLE]=2 \{\
6081 . FAMILY \\*[$HDRFTR_FAM]
6083 . PT_SIZE \\n[#HDRFTR_PT_SIZE]u
6085 . ie \\n[#RECTO_VERSO] \{\
6087 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
6088 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6089 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
6090 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
6092 . if \\n[#FOOTERS_ON] \{\
6095 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6100 . ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
6101 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT \}
6102 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
6103 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT \}
6105 . PRINT \\*[$USERDEF_HDRFTR_VERSO]
6107 . if \\n[#FOOTERS_ON] \{\
6110 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6114 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
6115 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6116 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
6117 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
6119 . if \\n[#FOOTERS_ON] \{\
6122 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6129 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
6130 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6131 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
6132 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
6134 . if \\n[#FOOTERS_ON] \{\
6137 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6142 . if \\n[#HDRFTR_RULE] \{\
6143 . HDRFTR_RULE_INTERNAL
6150 \# HEADERS (off or on)
6151 \# -------------------
6153 \# <none> | <anything>
6155 \# Turns headers at the top of the page off or on.
6160 . ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
6161 . el \{ .nr #HEADERS_ON 0 \}
6168 \# <amount of space between top of page and header>
6170 \# Creates or modifies register #HEADER_MARGIN to hold amount
6171 \# of space between top of page and header.
6173 \# Requires unit of measure. Default is 4P+6p, measured top-of-page
6176 .MAC HEADER_MARGIN END
6177 . nr #HEADER_MARGIN (\\$1)
6184 \# <amount of space between header and running text>
6186 \# Creates or modifies register #HEADER_GAP to hold amount
6187 \# of space between header and running text.
6189 \# Default is 1P+6p.
6192 . nr #HEADER_GAP (\\$1)
6201 \# Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
6203 \# In order to convert the title string to caps in the header (in the
6204 \# event that the user enters .TITLE in caps/lc), I've used
6205 \# quad left, quad centre, and quad right to arrange the three bits
6206 \# of the header, rather than .tl. This allows the use of the CAPS macro.
6207 \# The downside is that I have to add \\v'-(\\n[#LEAD]u*#) in order
6208 \# for -Tlatin1 output to align the header/footer strings on the baseline.
6209 \# The console output still isn't brilliant, but at least it's
6213 . PROCESS_FN_LEFTOVER
6214 . nr #FN_COUNT_FOR_COLS 0 1
6215 . if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
6216 . po \\n[#DOC_L_MARGIN]u
6217 . if \\n[#RECTO_VERSO] \{\
6218 . if !\\n[#TOC_RV_SWITCH] \{\
6219 . nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
6220 . DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u
6221 . DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
6222 . SWITCH_HDRFTR_CENTER_PAD
6227 . if \\n[#PRINT_STYLE]=1 \{ .vs 0 \}
6228 . if \\n[#PRINT_STYLE]=2 \{ .LS 0 \}
6229 . sp |\\n[#HEADER_MARGIN]u-1v
6230 . ll \\n[#DOC_L_LENGTH]u
6232 . if \\n[#PRINT_STYLE]=2 \{\
6233 . FAMILY \\*[$HDRFTR_FAM]
6235 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
6237 . if \\n[#PRINT_STYLE]=1 \{\
6240 . ps 12\\*[$HDRFTR_SIZE_CHANGE]
6242 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
6243 . if \\n[#CAPS_ON] \{\
6247 . if \\n[#UNDERLINE_ON] \{\
6248 . nr #UNDERLINE_WAS_ON 1
6251 . ie \\n[#HEADERS_ON] \{\
6253 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
6256 . ie \\n[#PAGE_NUM_V_POS]=1 \{\
6257 . ie \\n[#PAGINATE] \{\
6259 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
6261 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
6263 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
6265 . nr #PAGE_TOP \\n(nl
6267 . po \\n[#L_MARGIN]u
6268 . if \\n[#RECTO_VERSO] \{\
6269 . nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
6271 . if \\n[#CAPS_WAS_ON] \{\
6275 . if \\n[#UNDERLINE_WAS_ON] \{\
6277 . rr #UNDERLINE_WAS_ON
6279 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6280 . if \\n[#QUOTE] \{\
6281 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6283 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
6284 . po \\n[#Q_OFFSET]u
6287 . if \\n[#EPIGRAPH] \{\
6288 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6290 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6291 . po \\n[#EPI_OFFSET]u
6294 . ie \\n[#EPIGRAPH] \{\
6295 . ie !\\n[#EPI_ACTIVE] \{\
6300 . ie \\n[#EPI_FITS] \{ .ns \}
6301 . el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
6306 . if \\n[#COLUMNS] \{\
6307 . if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
6310 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6311 . ll \\n[#COL_L_LENGTH]u
6313 . if \\n[#QUOTE] \{\
6314 . po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
6316 . if \\n[#EPIGRAPH] \{\
6317 . if \\n[#EPI_ACTIVE] \{\
6318 . ie \\n[#EPI_FITS] \{ . \}
6319 . el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
6321 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
6324 . if \\n[#PRINT_STYLE]=1 \{\
6325 . if \\n[#SLANT_ON] \{\
6326 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
6331 \# ====================================================================
6335 \# FOOTERS (off or on)
6336 \# -------------------
6338 \# <none> | <anything>
6340 \# Turns footers at the bottom of the page off or on.
6342 \# Default is off. If on, page numbers automatically go at
6343 \# the top, centered, unless pagination has been turned off,
6344 \# or the pagenumber position has been changed to left or right.
6349 . PAGE_NUM_POS TOP CENTER
6351 . el \{ .nr #FOOTERS_ON 0 \}
6360 \# Creates or modifies register #FOOTER_MARGIN which holds the
6361 \# amount of space to leave between the page number and the bottom
6364 \# Unit of measure required. Default is 3P.
6366 .MAC FOOTER_MARGIN END
6367 . ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
6375 \# <distance from end of running text to page # or footer>
6377 \# Creates or modifies register #FOOTER_GAP which holds the
6378 \# amount of space to leave between running text and the page number.
6380 \# Requires unit of measure. Default is 3P. Measured baseline to
6384 . ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
6394 \# Places footer at bottom of page if #FOOTERS=1, otherwise
6395 \# places page number at bottom of page (if #PAGINATE=1).
6396 \# Page numbers are in arabic or roman according to COPYSTYLE.
6397 \# DRAFT starts the document at page 1 regardless of PAGENUMBER.
6398 \# FINAL respects PAGENUMBER.
6402 . if \\n[#START]=1 \{\
6406 . nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
6407 . if !\\n[#FN_DEFER] \{\
6409 . if \\n[#FN_COUNT] \{\
6410 . sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u)
6411 . po \\n[#DOC_L_MARGIN]u
6412 . if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
6416 . if '\\n(.z'FN_OVERFLOW' \{\
6418 . nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
6421 . if \\n[#COL_NEXT] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
6424 . ie \\n[#COLUMNS] \{\
6425 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
6427 . ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
6428 . el \{ .sp |\\n(dcu \}
6429 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6430 . PROCESS_FN_LEFTOVER
6431 . if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
6432 . if !\\n[#QUOTE] \{ .rr #COL_NEXT \}
6433 . if \\n[#QUOTE] \{\
6434 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
6435 . if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
6436 . po \\n[#Q_OFFSET]u
6438 . if \\n[#EPIGRAPH] \{\
6439 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6440 . if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
6441 . po \\n[#EPI_OFFSET]u
6443 . ie \\n[#EPIGRAPH] \{\
6444 . ie !\\n[#EPI_ACTIVE] \{\
6449 . sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
6458 . el \{ .DO_FOOTER \}
6467 \# Prints footer (page number, or 3-part footer).
6468 \# Resets CAPS and UNDERLINE if they were on.
6471 . sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
6473 . po \\n[#DOC_L_MARGIN]u
6474 . ll \\n[#DOC_L_LENGTH]u
6476 . FAMILY \\*[$HDRFTR_FAM]
6478 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
6479 . if \\n[#PRINT_STYLE]=1 \{\
6484 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
6485 . if \\n[#CAPS_ON] \{\
6489 . if \\n[#UNDERLINE_ON] \{\
6490 . nr #UNDERLINE_WAS_ON 1
6493 . ie \\n[#FOOTERS_ON] \{\
6497 . if \\n[#PAGINATE] \{\
6498 . if \\n[#PAGE_NUM_V_POS]=2 \{ .PRINT_PAGE_NUMBER \}
6501 . if \\n[#CAPS_WAS_ON] \{\
6505 . if \\n[#UNDERLINE_WAS_ON] \{\
6507 . rr #UNDERLINE_WAS_ON
6514 \# ====================================================================
6518 \# ---Head numbers---
6523 \# <none> | <anything>
6525 \# Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
6529 .MAC NUMBER_HEADS END
6532 . if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
6534 . el \{ .rr #NUMBER_HEAD \}
6538 \# RESET HEAD NUMBER
6539 \# -----------------
6541 \# <none> | <desired head number>
6543 \# Resets incrementing register #HEAD_NUM to 1 or, if there's
6544 \# an argument, to user supplied number.
6546 \# Also resets subhead and parahead numbers. If this is not
6547 \# desired, subhead and parahead numbers may be reset individually.
6549 .MAC RESET_HEAD_NUMBER END
6556 . nr #HEAD_NUM \\$1-1 1
6566 \# <none> | <anything>
6568 \# Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
6572 .MAC NUMBER_SUBHEADS END
6575 . if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
6577 . el \{ .rr #NUMBER_SH \}
6581 \# RESET SUBHEAD NUMBER
6582 \# --------------------
6584 \# <none> | <desired subhead number>
6586 \# Resets incrementing register #SH_NUM to 1 or, if there's
6587 \# an argument, to user supplied number.
6589 \# When the subhead number is reset, it resets the parahead number as
6590 \# well. If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
6591 \# allows the user to set the parahead number to whatever s/he desires.
6593 .MAC RESET_SUBHEAD_NUMBER END
6594 . ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
6596 . nr #SH_NUM \\$1-1 1
6605 \# <none> | <anything>
6607 \# Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
6611 .MAC NUMBER_PARAHEADS END
6614 . if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
6616 . el \{ .rr #NUMBER_PH \}
6620 \# RESET PARAHEAD NUMBER
6621 \# ---------------------
6623 \# <none> | <desired parahead number>
6625 \# Resets incrementing register #PH_NUM to 1 or, if there's
6626 \# an argument, to user supplied number.
6628 \# Resetting the parahead number resets the parahead number
6631 .MAC RESET_PARAHEAD_NUMBER END
6632 . ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
6633 . el \{ nr #SH_NUM \\$1-1 1 \}
6642 \# <family to use for section titles (main heads)>
6644 \# Creates or modifies string $HEAD_FAM.
6646 \# Default is same as running text.
6648 .MAC HEAD_FAMILY END
6656 \# <font to use for section titles (main heads)>
6658 \# Creates or modifies string $HEAD_FT.
6670 \# <+|- number of points by which to in/decrease point size of
6671 \# section titles (relative to running text)>
6673 \# Creates or modifies string $HEAD_SIZE_CHANGE.
6675 \# Must be preceded by a - or + sign with no space afterwards.
6676 \# Fractional point sizes are allowed.
6677 \# Default +1 for printstyle TYPESET; +0 for TYPEWRITE.
6680 . ds $HEAD_SIZE_CHANGE \\$1
6687 \# L | LEFT | R | RIGHT | C | CENTER | CENTRE
6689 \# Creates or modifies string $HEAD_QUAD.
6691 \# Default is CENTER.
6694 . ds $HEAD_QUAD \\$1
6701 \# <none> | <anything>
6703 \# Creates or modifies register #HEAD_CAPS.
6708 . ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
6709 . el \{ .nr #HEAD_CAPS 0 \}
6716 \# <none> | <anything>
6718 \# Creates register #HEAD_SPACE, which toggles whether the space
6719 \# before heads is 1 extra line space ("off") or 2 ("on"). Used only
6720 \# in PRINTSTYLE TYPESET.
6725 . ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
6726 . el \{ .nr #HEAD_SPACE 0 \}
6733 \# <none> | <anything>
6735 \# Creates or modifies register #HEAD_UNDERLINE.
6739 .MAC HEAD_UNDERLINE END
6740 . ie '\\$1'' \{ .nr #HEAD_UNDERLINE 1 \}
6741 . el \{ .nr #HEAD_UNDERLINE 0 \}
6748 \# "text of main head" ["text of main head"] ...
6750 \# In TYPEWRITE, prints main heads centered, all caps, underlined.
6751 \# In TYPESET, prints bold main heads 1 point larger than running
6752 \# text, all caps, underlined.
6754 \# The HEAD macro requires that double-quotes (") surround
6755 \# each line of text.
6759 \# Collect head for TOC.
6761 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
6762 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
6763 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6764 . ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
6765 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\\|
6768 \# Note that in the .as lines, below, \ at the end has a literal
6770 . ie \\n[#NUMBER_HEAD] \{\
6771 . ie \\n[#ARG_NUM]=0 \{\
6772 . as $TOC_HEAD_ITEM \\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\
6773 . nr #HEAD_NUM \\n-[#HEAD_NUM]
6776 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\
6780 . as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\
6784 \# Note the use of \!, which transparently embeds the macros used
6785 \# in the TOC_ENTRIES diversion. The elements they control must be
6786 \# processed literally when the diversion is output.
6789 . if \\n[#PRINT_STYLE]=1 \{\
6794 . if \\n[#PRINT_STYLE]=2 \{\
6795 \!. FAMILY \\*[$TOC_HEAD_FAM]
6796 \!. FT \\*[$TOC_HEAD_FT]
6797 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
6800 . ie \\n[#PRINT_STYLE]=1 \{\
6801 \!. PAD "\\h'2m'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN_TYPEWRITE]"
6804 \!. PAD "\\h'\\n[#TOC_HEAD_INDENT]u'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN]"
6809 . if \\n[#PRINT_STYLE]=2 \{\
6810 \!. FAMILY \\*[$TOC_PN_FAM]
6811 \!. FT \\*[$TOC_PN_FT]
6812 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
6815 \!. PRINT \\*[LEADER]
6818 \!. PRINT \\n[#TOC_ENTRY_PN]
6822 \# End collection of head for TOC
6826 . ll \\n[#L_LENGTH]u
6828 . if \\n[#COLUMNS] \{\
6829 . ll \\n[#COL_L_LENGTH]u
6833 . QUAD \\*[$HEAD_QUAD]
6834 . if \\n[#PRINT_STYLE]=1 \{\
6838 . vs \\n[#DOC_LEAD]u
6841 . if \\n[#PRINT_STYLE]=2 \{\
6842 . FAMILY \\*[$HEAD_FAM]
6844 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
6845 . LS \\n[#DOC_LEAD]u
6847 . if r#QUOTE \{ .rr #QUOTE \}
6848 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
6849 . if \\n[#PRINT_STYLE]=1 \{ .ne 3 \}
6850 . if \\n[#PRINT_STYLE]=2 \{\
6851 . ie \\n[#HEAD_SPACE] \{ .ne 4 \}
6854 . ie \\n[#START] \{\
6855 . if \\n[#DOC_HEADER]=0 \{ . \}
6858 . if \\n[#PRINT_STYLE]=1 \{\
6859 . if !\\n[#LINEBREAK] \{\
6860 . ALD \\n[#DOC_LEAD]u
6861 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6864 . if \\n[#PRINT_STYLE]=2 \{\
6865 . ie \\n[#PP_SPACE] \{\
6866 . ie \\n[#END_QUOTE] \{ . \}
6868 . if !\\n[#LINEBREAK] \{\
6869 . if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6874 . ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
6875 . el \{ .ALD \\n[#DOC_LEAD]u \}
6877 . if \\n[#END_QUOTE] \{\
6878 . if !\\n[#Q_FITS] \{\
6879 . RLD \\n[#DOC_LEAD]u
6880 . if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
6882 . if \\n[#Q_AT_TOP] \{\
6883 . RLD \\n[#DOC_LEAD]u
6884 . if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
6887 . if \\n[#LINEBREAK] \{\
6888 . if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
6894 . if \\n[#HEAD_CAPS] \{ .CAPS \}
6895 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6896 . ie \\n[#NUMBER_HEAD] \{\
6897 . ie \\n[#ARG_NUM]=0 \{\
6899 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
6900 . el \{ .UNDERSCORE "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
6905 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
6906 . el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
6912 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
6913 . el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
6920 . ALD \\n[#DOC_LEAD]u
6921 . RESET_SUBHEAD_NUMBER
6922 . RESET_PARAHEAD_NUMBER
6923 . if r#START \{ .rr #START \}
6924 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
6925 . if r#QUOTE \{ .rr #QUOTE \}
6926 . if r#Q_FITS \{ .rr #Q_FITS \}
6927 . if r#END_QUOTE \{ .rr #END_QUOTE \}
6928 . if r#LINEBREAK \{ .rr #LINEBREAK \}
6929 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
6930 . if r#PP_ACTIVE \{ .rr #PP_ACTIVE \}
6942 \# <family to use in subheads>
6944 \# Creates or modifies string $SH_FAM.
6946 \# Default is same as running text.
6948 .MAC SUBHEAD_FAMILY END
6956 \# <font to use in subheads>
6958 \# Creates or modifies string $SH_FT.
6962 .MAC SUBHEAD_FONT END
6970 \# <+|- number of points by which to in/decrease point size of subheads
6971 \# (relative to running text)>
6973 \# Creates or modifies string $SH_SIZE_CHANGE.
6975 \# Must be preceded by a +|- sign. No space afterwards.
6976 \# Fractional point sizes are allowed.
6977 \# Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
6979 .MAC SUBHEAD_SIZE END
6980 . ds $SH_SIZE_CHANGE \\$1
6987 \# L | LEFT | R | RIGHT | C | CENTER | CENTRE
6989 \# Creates or modifies string $SH_QUAD.
6991 \# Default is LEFT for both TYPESET and TYPEWRITE.
6993 .MAC SUBHEAD_QUAD END
7001 \# "text of subhead" ["text of subhead"] ...
7003 \# In TYPEWRITE, prints subheads underlined.
7004 \# In TYPESET, prints subheads bold, .5 points larger than running
7006 \# In both styles, a line space precedes the subhead, and a small
7007 \# amount of lead comes after.
7009 \# As with the HEAD macro, double-quotes (") must surround
7010 \# each line of text.
7014 \# Collect subhead for TOC.
7016 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7017 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7018 . ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
7019 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\\|
7022 \# Note that in the .as lines, below, \ at the end has a literal
7024 . ie \\n[#NUMBER_SH] \{\
7025 . ie \\n[#ARG_NUM]=0 \{\
7026 . as $TOC_SH_ITEM \\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]\
7027 . nr #SH_NUM \\n-[#SH_NUM]
7030 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\
7034 . as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\
7038 \# Note the use of \!, which transparently embeds the macros used
7039 \# in the TOC_ENTRIES diversion. The elements they control must be
7040 \# processed literally when the diversion is output.
7043 . if \\n[#PRINT_STYLE]=1 \{\
7048 . if \\n[#PRINT_STYLE]=2 \{\
7049 \!. FAMILY \\*[$TOC_SH_FAM]
7050 \!. FT \\*[$TOC_SH_FT]
7051 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
7054 . ie \\n[#PRINT_STYLE]=1 \{\
7055 \!. PAD "\\h'4m'\\*[$TOC_SH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
7058 \!. PAD "\\h'\\n[#TOC_SH_INDENT]u'\\*[$TOC_SH_ITEM]\\*[$TOC_PN]"
7063 . if \\n[#PRINT_STYLE]=2 \{\
7064 \!. FAMILY \\*[$TOC_PN_FAM]
7065 \!. FT \\*[$TOC_PN_FT]
7066 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7069 \!. PRINT \\*[LEADER]
7072 \!. PRINT \\n[#TOC_ENTRY_PN]
7076 \# End collection of head for TOC
7079 . if r#QUOTE \{ .rr #QUOTE \}
7080 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7082 . ll \\n[#L_LENGTH]u
7084 . if \\n[#COLUMNS] \{\
7085 . ll \\n[#COL_L_LENGTH]u
7089 . if \\n[#PRINT_STYLE]=1 \{\
7093 . vs \\n[#DOC_LEAD]u
7094 . QUAD \\*[$SH_QUAD]
7097 . if \\n[#PRINT_STYLE]=2 \{\
7098 . FAMILY \\*[$SH_FAM]
7100 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
7101 . LS \\n[#DOC_LEAD]u
7102 . QUAD \\*[$SH_QUAD]
7104 . if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
7105 . if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
7106 . ie \\n[#START] \{ . \}
7108 . ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]u*2u) ) \{\
7109 . ie \\n[#COLUMNS] \{ .COL_NEXT \}
7113 . ie \\n[#HEAD]=1 \{ . \}
7115 . if \\n[#PRINT_STYLE]=1 \{\
7116 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7118 . if \\n[#PRINT_STYLE]=2 \{\
7119 . ie \\n[#PP_SPACE]=1 \{\
7120 . ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7121 . el \{ .RLD \\n[#DOC_LEAD]u \}
7124 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7131 . if \\n[#PRINT_STYLE]=1 \{\
7132 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7133 . ie \\n[#NUMBER_SH] \{\
7134 . ie \\n[#ARG_NUM]=0 \{\
7135 . ie \\n[#NUMBER_HEAD] \{\
7137 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
7142 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
7148 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
7149 . el \{ .UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
7155 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7160 . if \\n[#PRINT_STYLE]=1 \{\
7161 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
7163 . if \\n[#PRINT_STYLE]=2 \{\
7164 . ie \\n[#PP_SPACE]=0 \{\
7165 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7166 . ie \\n[#NUMBER_SH] \{\
7167 . ie \\n[#ARG_NUM]=0 \{\
7168 . ie \\n[#NUMBER_HEAD] \{\
7170 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
7175 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
7181 . PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7187 . PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7193 . ALD \\n[#DOC_LEAD]u
7194 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
7195 . if \\n[#END_QUOTE] \{ .RLD \\n[#DOC_LEAD]u \}
7196 . if \\n[#EPIGRAPH] \{ .RLD \\n[#DOC_LEAD]u \}
7197 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7198 . PRINT "\\$[\\n+[#ARG_NUM]]
7200 . ALD \\n[#DOC_LEAD]u
7205 . RESET_PARAHEAD_NUMBER
7206 . if r#START \{ .rr #START \}
7207 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
7208 . if r#Q_FITS \{ .rr #Q_FITS \}
7209 . if r#END_QUOTE \{ .rr #END_QUOTE \}
7210 . if r#LINEBREAK \{ .rr #LINEBREAK \}
7216 \# ---Paragraph heads---
7221 \# <family to use in paraheads>
7223 \# Creates or modifies string $PH_FAM.
7225 \# Default is same as running text.
7227 .MAC PARAHEAD_FAMILY END
7235 \# <font to use in paraheads>
7237 \# Creates or modifies string $PH_FT.
7239 \# Default is bold italic for TYPESET; underlined for TYPEWRITE.
7241 .MAC PARAHEAD_FONT END
7249 \# <+|- number of points by which to in/decrease point size of subheads
7250 \# (relative to running text)>
7252 \# Creates or modifies string $PH_SIZE_CHANGE.
7254 \# Must be preceded by a +|- sign. No space afterwards.
7255 \# Fractional point sizes are allowed. No unit of measure, please.
7256 \# Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
7258 .MAC PARAHEAD_SIZE END
7259 . ds $PH_SIZE_CHANGE \\$1
7268 \# Creates or modifies register #PH_INDENT.
7270 \# Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
7272 .MAC PARAHEAD_INDENT END
7273 . nr #PH_INDENT (\\$1)
7282 \# Deposits a paragraph head at the start and into the body of a
7285 \# PARAHEAD *must* come after PP.
7288 \# Collect parahead for TOC.
7289 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7290 . ie \\n[#NUMBER_PH] \{\
7291 . ds $TOC_PH_ITEM \\n+[#PH_NUM].\0\\$1\\|
7292 . nr #PH_NUM \\n-[#PH_NUM]
7295 . ds $TOC_PH_ITEM \\$1\\|
7299 . if \\n[#PRINT_STYLE]=1 \{\
7304 . if \\n[#PRINT_STYLE]=2 \{\
7305 \!. FAMILY \\*[$TOC_PH_FAM]
7306 \!. FT \\*[$TOC_PH_FT]
7307 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PH_SIZE_CHANGE]
7310 . ie \\n[#PRINT_STYLE]=1 \{\
7311 \!. PAD "\\h'6m'\\*[$TOC_PH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
7314 \!. PAD "\\h'\\n[#TOC_PH_INDENT]u'\\*[$TOC_PH_ITEM]\\*[$TOC_PN]"
7319 . if \\n[#PRINT_STYLE]=2 \{\
7320 \!. FAMILY \\*[$TOC_PN_FAM]
7321 \!. FT \\*[$TOC_PN_FT]
7322 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7325 \!. PRINT \\*[LEADER]
7328 \!. PRINT \\n[#TOC_ENTRY_PN]
7332 \# End collection of parahead for TOC
7334 . if \\n[#SLANT_ON] \{\
7335 . nr #SLANT_WAS_ON 1
7339 . if \\n[#INDENT_FIRST_PARAS] \{\
7340 . ti \\n[#PH_INDENT]u
7343 . el \{ .ti \\n[#PH_INDENT]u \}
7344 . if \\n[#PRINT_STYLE]=1 \{\
7349 . ie \\n[#NUMBER_PH] \{\
7350 . if \\n[#NUMBER_HEAD] \{\
7351 . ie \\n[#NUMBER_SH] \{\
7352 . UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
7356 . UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1
7360 . ie \\n[#NUMBER_SH] \{\
7361 . if !\\n[#NUMBERED] \{\
7362 . UNDERSCORE "\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1
7367 . if !\\n[#NUMBERED] \{\
7368 . UNDERSCORE "\\n+[#PH_NUM].\\ \\$1
7377 . if \\n[#SLANT_WAS_ON] \{\
7378 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
7379 . if \\n[#SLANT_MEANS_SLANT] \{\
7385 . if \\n[#PRINT_STYLE]=2 \{\
7388 . PT_SIZE \\*[$PH_SIZE_CHANGE]
7389 . ie \\n[#NUMBER_PH] \{\
7390 . if \\n[#NUMBER_HEAD] \{\
7391 . ie \\n[#NUMBER_SH] \{\
7392 . PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7395 . PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7398 . ie \\n[#NUMBER_SH] \{\
7399 . if !\\n[#NUMBERED] \{\
7400 . PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7404 . if !\\n[#NUMBERED] \{\
7405 . PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7410 . PRINT "\\$1\h'.6m'\c"
7412 . FAMILY \\*[$DOC_FAM]
7414 . PT_SIZE \\n[#DOC_PT_SIZE]u
7415 . if \\n[#SLANT_WAS_ON] \{\
7416 . rr #SLANT_WAS_ON 1
7425 \# ====================================================================
7427 \# +++LINE BREAKS+++
7429 \# LINEBREAK CHARACTER
7430 \# -------------------
7432 \# [character] [iterations] [vertical adjustment]
7434 \# Allows user to specify a line break character and the number
7435 \# of times to repeat it horiontally.
7437 \# Without an argument, LINEBREAK_CHAR will deposit a blank line.
7439 \# Vertical adjustment requires a unit of measure (most likely
7440 \# "p"), and has to be preceded by +|-
7442 .MAC LINEBREAK_CHAR END
7444 . ds $LINEBREAK_CHAR \\$1
7445 . ds $LINEBREAK_CHAR_V_ADJ \\$3
7446 . if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
7447 . ds $LINEBREAK_CHAR_V_ADJ +0
7449 . while \\$2>\\n[#REPEAT] \{\
7450 . as $LINEBREAK_CHAR "\\ \\$1
7451 . nr #REPEAT \\n[#REPEAT]+1
7462 \# Deposits line break character.
7464 \# If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
7467 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7468 . po \\n[#DOC_L_MARGIN]u
7469 . ie '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
7471 . if \\n[#PRINT_STYLE]=1 \{\
7472 . ie \\n[#END_QUOTE] \{ . \}
7473 . el \{ .ALD \\n[#DOC_LEAD]u \}
7475 . if \\n[#PRINT_STYLE]=2 \{\
7476 . ie \\n[#END_QUOTE] \{ . \}
7477 . el \{ .ALD \\n[#DOC_LEAD]u \}
7480 . PRINT \\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'
7481 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
7482 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
7483 . QUAD \\*[$DOC_QUAD]
7486 . if r#QUOTE \{ .rr #QUOTE \}
7487 . if r#END_QUOTE \{ .rr #END_QUOTE \}
7491 \# ====================================================================
7498 \# <font of running text>
7500 \# Creates or modifies string $PP_FT.
7502 \# Affects all paragraphs.
7505 . if \\n[#IGNORE] \{ .return \}
7515 \# <amount to indent paragraphs in running text (ipPcm)>
7517 \# Allows user to change the default para indent. The change will
7518 \# affect the indent of QUOTEs and BLOCKQUOTEs as well.
7520 \# Default for printstyle TYPEWRITE is 1/2-inch. Default for
7521 \# printstyle TYPESET is 2 ems. The defaults are set in
7522 \# PRINTSTYLE, not DEFAULTS.
7524 .MAC PARA_INDENT END
7525 . nr #PP_INDENT (\\$1)
7529 \# INDENT FIRST PARAGRAPHS
7530 \# -----------------------
7532 \# <none> | <anything>
7534 \# By default, the first para of a document, as well as the first
7535 \# paras of blockquotes and block-style epigraphs are not indented.
7536 \# When invoked, this macro will indent all paras.
7540 .MAC INDENT_FIRST_PARAS END
7541 . ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
7542 . el \{ .rr #INDENT_FIRST_PARAS \}
7546 \# INTER-PARAGRAPH SPACING
7547 \# -----------------------
7549 \# <none> | <anything>
7551 \# Adds a line space between paragraphs in body text. Block quotes
7554 \# Default is OFF. PARA_SPACE ON is not recommended for use
7555 \# with PRINTSTYLE TYPEWRITE.
7558 . ie '\\$1'' \{ .nr #PP_SPACE 1 \}
7559 . el \{ .rr #PP_SPACE \}
7568 \# Figures out what to do with paragraphs under differing conditions.
7570 \# For the time being, there's no automatic widow/orphan control.
7571 \# Controlling them isn't just a matter of establishing an arbitrary
7572 \# number of lines needed for a para, since groff doesn't then
7573 \# handle single line paragraphs gracefully. Usually, the whole
7574 \# page needs to be tweaked.
7576 \# Note the use of transparent line break (\!.br) to get
7577 \# PP to work within blockquotes and epigraphs.
7579 \# PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
7583 . if \\n[#DOC_TYPE]=4 \{\
7584 . if !'\\n(.z'' \{ .di \}
7588 . QUAD \\*[$DOC_QUAD]
7589 . ALD \\n[#DOC_LEAD]u*2u
7595 . ALD \\n[#DOC_LEAD]u
7601 . ALD \\n[#DOC_LEAD]u
7604 . if \\n[#GREETING] \{\
7607 . ALD \\n[#DOC_LEAD]u
7612 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7613 . if \\n[#PP_STYLE]=1 \{\
7614 . if \\n[#ENDNOTE] \{\
7615 . nr #RESET_PARA_SPACE \\n[#PP_SPACE]
7616 . ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
7617 . el \{ .PARA_SPACE OFF \}
7620 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
7621 . if \\n[#COLUMNS] \{\
7622 . if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
7624 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7625 . ie \\n[#PRINT_STYLE]=1 \{\
7629 . ie \\n[#ENDNOTE] \{ .vs \\n[#EN_LEAD]u \}
7630 . el \{ .vs \\n[#DOC_LEAD]u \}
7631 . QUAD \\*[$DOC_QUAD]
7633 . if \\n[#SLANT_ON] \{\
7634 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
7638 . ie \\n[#ENDNOTE] \{\
7639 . FAMILY \\*[$EN_FAM]
7641 . PT_SIZE \\n[#EN_PS]u
7643 . QUAD \\*[$EN_QUAD]
7646 . FAMILY \\*[$DOC_FAM]
7648 . PT_SIZE \\n[#DOC_PT_SIZE]u
7649 . LS \\n[#DOC_LEAD]u
7650 . QUAD \\*[$DOC_QUAD]
7654 . if \\n[#INDENT_FIRST_PARAS] \{\
7655 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7656 . el \{ .ti \\n[#PP_INDENT]u \}
7657 . if '\\n(.z'END_NOTES' \{\
7658 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7661 . if r#END_QUOTE \{\
7662 . if \\n[#END_QUOTE] \{\
7663 . if !\\n[#LINEBREAK] \{\
7664 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7665 . el \{ .ti \\n[#PP_INDENT]u \}
7666 . if '\\n(.z'END_NOTES' \{\
7667 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7675 . if \\n[#PP_SPACE] \{\
7676 . if \\n[#PRINT_STYLE]=2 \{\
7677 . ie \\n[#END_QUOTE] \{\
7680 . el \{ .ALD \\n[#DOC_LEAD]u \}
7683 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7684 . el \{ .ti \\n[#PP_INDENT]u \}
7685 . if '\\n(.z'END_NOTES' \{\
7686 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7689 . if r#START \{ .rr #START \}
7690 . if r#QUOTE \{ .rr #QUOTE \}
7691 . if r#END_QUOTE \{ .rr #END_QUOTE \}
7692 . if r#HEAD \{ .rr #HEAD \}
7693 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
7694 . if r#Q_FITS \{ .rr #Q_FITS \}
7695 . if r#LINEBREAK \{ .rr #LINEBREAK \}
7696 . if \\n[#ENDNOTE] \{\
7697 . ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
7698 . el \{ .PARA_SPACE OFF \}
7700 . if \\n[#CONDENSE] \{\
7703 . if \\n[#EXTEND]=1 \{\
7708 . if \\n[#PP_STYLE]=2 \{\
7710 . if \\n[#BROKEN_QUOTE] \{\
7711 . ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
7712 . el \{ .nr #Q_PP 0 \}
7715 . ie \\n[#Q_PP]=0 \{\
7716 . if \\n[#INDENT_FIRST_PARAS] \{\
7717 . ti \\n[#PP_INDENT]u/2u
7719 . if \\n[#ENDNOTE] \{\
7720 . ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
7725 . ti \\n[#PP_INDENT]u/2u
7727 . if \\n[#CONDENSE] \{\
7730 . if \\n[#EXTEND]=1 \{\
7738 \# ====================================================================
7742 \# ---Line for line (poetic) quotes---
7747 \# <family to use in line for line quotes>
7749 \# Creates or modifies string $QUOTE_FAM.
7751 \# Default is same as running text.
7753 .MAC QUOTE_FAMILY END
7754 . ds $QUOTE_FAM \\$1
7761 \# <font to use in line for line quotes>
7763 \# Creates or modifies string $QUOTE_FT.
7765 \# Default is italic for TYPESET.
7775 \# <-|+ number of points by which to de/increase point size of
7776 \# line for line quotes (relative to running text)>
7778 \# Creates or modifies string $QUOTE_SIZE_CHANGE.
7780 \# Must be preceded by a - or + sign with no space afterwards.
7781 \# Fractional point sizes are allowed.
7785 . ds $QUOTE_SIZE_CHANGE \\$1
7792 \# <none> | <anything>
7794 \# Creates or modifies register #UNDERLINE_QUOTES (toggle).
7795 \# If on, line for line quotes are underlined when printstyle
7798 \# Default is ON for printstyle TYPEWRITE.
7800 .MAC UNDERLINE_QUOTES END
7801 . ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
7802 . el \{ .rr #UNDERLINE_QUOTES \}
7809 \# <value by which to multiply PP_INDENT for indented quoted text>
7811 \# Creates or modifies register #Q_OFFSET_VALUE.
7813 \# Default is 3 for typeset; 2 for typewrite
7815 .MAC QUOTE_INDENT END
7816 . nr #Q_OFFSET_VALUE \\$1
7820 \# ALWAYS FULLSPACE QUOTES
7821 \# -----------------------
7823 \# <none> | <anything>
7825 \# Toggles register #FULLSPACE_QUOTES.
7827 \# If user doesn't like the default 1/2 line space above and below
7828 \# quotes, s/he can turn it off here. Has no effect in TYPEWRITE.
7830 .MAC ALWAYS_FULLSPACE_QUOTES END
7831 . if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
7832 . el \{ .rr #FULLSPACE_QUOTES \}
7839 \# <none> | <anything>
7841 \# Indents quoted text on a line for line basis, or turns QUOTE off.
7843 \# Owing to the need to bottom align TYPESET pages, quoted text gets
7844 \# diverted so its depth can be measured (in DO_QUOTE) for determining
7845 \# how much space to put before and after.
7849 \# **Uncomment the next line to prevent orphaned quote lines.
7855 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7857 . if \\n[#COLUMNS] \{\
7858 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7861 . if \\n[#PRINT_STYLE]=1 \{\
7865 . vs \\n[#DOC_LEAD]u
7868 . if \\n[#PRINT_STYLE]=2 \{\
7869 . FAMILY \\*[$QUOTE_FAM]
7871 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
7872 . LS \\n[#DOC_LEAD]u
7876 . if \\n[#PRINT_STYLE]=1 \{\
7877 . if \\n[#UNDERLINE_QUOTES] \{\
7882 . el \{ .DO_QUOTE \}
7886 \# ---Blockquotes---
7888 \# BLOCKQUOTE FAMILY
7889 \# -----------------
7891 \# <family to use in blockquotes>
7893 \# Creates or modifies string $BQUOTE_FAM.
7895 \# Default is same as running text.
7897 .MAC BLOCKQUOTE_FAMILY END
7898 . ds $BQUOTE_FAM \\$1
7905 \# <font to use in blockquotes>
7907 \# Creates or modifies string $BQUOTE_FT.
7909 \# Default is same as running text.
7911 .MAC BLOCKQUOTE_FONT END
7912 . ds $BQUOTE_FT \\$1
7919 \# <-|+ number of points by which to de/increase point size of blockquotes
7920 \# (relative to running text)>
7922 \# Creates or modifies string $BQUOTE_SIZE_CHANGE.
7924 \# Must be preceded by a - or + sign with no space afterwards.
7925 \# Fractional point sizes are allowed.
7926 \# Default is -1 for printstyle TYPESET; +0 for TYPEWRITE.
7928 .MAC BLOCKQUOTE_SIZE END
7929 . ds $BQUOTE_SIZE_CHANGE \\$1
7936 \# <quad to use in blockquotes>
7938 \# Creates or modifies string $BQUOTE_QUAD.
7942 .MAC BLOCKQUOTE_QUAD END
7943 . ds $BQUOTE_QUAD \\$1
7950 \# <none> | <anything>
7952 \# Indents quoted text in fill mode and shortens line length
7953 \# accordingly, or turns BLOCKQUOTE off.
7955 \# Owing to the need to bottom align TYPESET pages, quoted text gets
7956 \# diverted so its depth can be measured (in DO_QUOTE) for determining
7957 \# how much space to put before and after.
7959 \# .PP after blockquote is optional if there's only one para,
7960 \# but REQUIRED if there's more than one.
7970 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7971 . if \\n[#ENDNOTE] \{\
7972 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
7973 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7975 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
7976 . ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7981 . if \\n[#COLUMNS] \{\
7982 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7983 . if \\n[#ENDNOTE] \{\
7984 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
7985 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7987 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
7988 . ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7993 . if \\n[#PRINT_STYLE]=1 \{\
7997 . vs \\n[#DOC_LEAD]u
8001 . if \\n[#PRINT_STYLE]=2 \{\
8002 . FAMILY \\*[$BQUOTE_FAM]
8003 . FT \\*[$BQUOTE_FT]
8004 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
8005 . LS \\n[#DOC_LEAD]u
8006 . if \\n[#ENDNOTE] \{\
8007 . PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
8009 . QUAD \\*[$BQUOTE_QUAD]
8013 . if \\n[#INDENT_FIRST_PARAS] \{\
8014 . ie !\\n[#ENDNOTE] \{\
8015 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
8016 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
8019 . if \\n[#INDENT_FIRSTS]=1 \{\
8020 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
8021 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
8026 . el \{ .DO_QUOTE \}
8035 \# Ends the diversion P_QUOTE or B_QUOTE. Spaces them according to
8036 \# PRINT_STYLE, whether there's inter-paragraph spacing, and page
8037 \# position. TYPEWRITE treats spacing the same way in all circumstance
8038 \# (viz. an extra line space). TYPESET puts in only half
8039 \# line spaces if the entire quote plus 1 line of body under the quote
8040 \# fits on the the page; otherwise it puts in a full extra blank
8041 \# line. (This is to ensure the page remains bottom aligned).
8047 \# **Change *1 to *2 in next line to prevent orphans after quotes
8048 . if \\n[#ENDNOTE] \{\
8049 . nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
8050 . ALWAYS_FULLSPACE_QUOTES
8052 . nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
8053 . if \\n[#PRINT_STYLE]=1 \{\
8054 . if \\n[#START]=1 \{ . \}
8055 . if \\n[#START]=0 \{\
8056 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8059 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
8062 . if \\n[#PRINT_STYLE]=2 \{\
8063 . ie \\n[#PP_SPACE] \{\
8064 . ie \\n[#HEAD]>0 \{ . \}
8066 . ie \\n[#START] \{ . \}
8067 . el \{ .ALD \\n[#DOC_LEAD]u \}
8071 . ie \\n[#Q_DEPTH]<\\n[#TRAP_DISTANCE] \{\
8073 . ie \\n[#HEAD]=1 \{ . \}
8075 . ie \\n[#START] \{ . \}
8077 . ie \\n[#FULLSPACE_QUOTES] \{\
8078 . ie \\n[#ENDNOTE] \{\
8079 . ALD \\n[#EN_LEAD]u
8081 . el \{ .ALD \\n[#DOC_LEAD]u \}
8084 . ie \\n[#ENDNOTE] \{\
8085 . ALD \\n[#EN_LEAD]u/2u
8087 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
8095 . if \\n[#HEAD]=1 \{ . \}
8098 . ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
8099 . el \{ .ALD \\n[#DOC_LEAD]u \}
8104 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8105 . if \\n[#COLUMNS] \{\
8106 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8108 . if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
8109 . if \\n[#ENDNOTE] \{\
8110 . in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
8112 . if \\n[#QUOTE]=1 \{\
8115 . if !\\n[#START] \{ .rr #QUOTE \}
8117 . if \\n[#QUOTE]=2 \{\
8121 . if \\n[#PRINT_STYLE]=1 \{\
8122 . ALD \\n[#DOC_LEAD]u
8124 . if \\n[#PRINT_STYLE]=2 \{\
8125 . ie \\n[#START] \{\
8126 . ie \\n[#PP_SPACE] \{ . \}
8127 . el \{ .ALD \\n[#DOC_LEAD]u \}
8130 . ie \\n[#PP_SPACE] \{ . \}
8132 . ie \\n[#HEAD]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8134 . ie \\n[#Q_FITS] \{\
8135 . ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
8137 . ALD \\n[#DOC_LEAD]u
8140 . ie \\n[#FULLSPACE_QUOTES] \{ .ALD \\n[#DOC_LEAD]u \}
8141 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
8144 . el \{ .ALD \\n[#DOC_LEAD]u \}
8149 . if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
8150 . if r#HEAD \{ .rr #HEAD \}
8151 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8156 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
8157 . if \\n[#ENDNOTE] \{\
8158 . in \\n[#EN_TEXT_INDENT]u
8160 . if \\n[#COLUMNS] \{\
8161 . if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
8162 . if \\n[#ENDNOTE] \{\
8163 . in \\n[#EN_TEXT_INDENT]u
8166 . ie !\\n[#ENDNOTE] \{\
8167 . nr #RESET_PP_INDENT \\n[#PP_INDENT]
8170 . PARA_INDENT \\n[#RESET_PP_INDENT]u
8171 . QUAD \\*[$DOC_QUAD]
8174 . nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
8175 . ENDNOTE_PARA_INDENT 0
8177 . ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
8182 \# ====================================================================
8189 \# Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
8190 \# page, and reinvokes BLOCKQUOTE.
8192 \# Because quotes go into a diversion before they're output,
8193 \# footnotes in quotes that cross pages behave erratically. The footnote
8194 \# isn't processed until the diversion ends, hence the footnote
8195 \# marker in the quote isn't always correct for the new page (it's
8196 \# picked up from the old one). BREAK_QUOTE is a workaround for
8199 .MAC BREAK_QUOTE END
8202 . nr #BROKEN_QUOTE 1
8205 . nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
8206 . if \\n[#PRINT_STYLE]=1 \{\
8207 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8209 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
8212 . if \\n[#PRINT_STYLE]=2 \{\
8213 . ie \\n[#PP_SPACE] \{\
8214 . ie \\n[#HEAD]=1 \{ . \}
8216 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8222 . if \\n[#HEAD]=1 \{ . \}
8224 . el \{ .ALD \\n[#DOC_LEAD]u \}
8227 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8228 . if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
8229 . po \\n[#Q_OFFSET]u
8230 . if \\n[#QUOTE]=1 \{\
8233 . if !\\n[#START] \{ .rr #QUOTE \}
8235 . if \\n[#QUOTE]=2 \{\
8239 . if r#HEAD \{ .rr #HEAD \}
8240 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8245 . if \\n[#PRINT_STYLE]=1 \{\
8246 . if \\n[#UNDERLINE_QUOTES] \{\
8250 . po \\n[#L_MARGIN]u
8251 . if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
8252 . QUAD \\*[$DOC_QUAD]
8253 . sp |\\n[#PAGE_LENGTH]u \" To trip footer/header
8257 \# ====================================================================
8264 \# <none> | <anything>
8266 \# Turns page numbering off or on.
8268 \# Page numbering is on by default with .PAPER.
8272 . ie '\\$1'' \{ .nr #PAGINATE 1 \}
8273 . el \{ .nr #PAGINATE 0 \}
8277 \# SUSPEND PAGINATION (before ENDNOTES)
8278 \# ------------------
8282 \# Creates register #SUSPEND_PAGINATION
8284 \# Useful only to suspend pagination before outputting endnotes.
8286 .MAC SUSPEND_PAGINATION END
8287 . nr #SUSPEND_PAGINATION 1
8290 \# RESTORE PAGINATION (after ENDNOTES)
8291 \# ------------------
8295 \# Removes register #SUSPEND_PAGINATION. Creates register
8296 \# #DEFER_PAGINATION
8298 \# Useful only to restore pagination after outputting endnotes.
8300 .MAC RESTORE_PAGINATION END
8301 . rr #SUSPEND_PAGINATION
8302 . if \\n[#PAGE_NUM_V_POS]=1 \{ .PAGINATE \}
8303 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #DEFER_PAGINATION 1 \}
8307 \# PAGENUMBER FAMILY
8308 \# -----------------
8310 \# <family to use for page numbers>
8312 \# Creates or modifies string $PAGE_NUM_FAM.
8314 \# Default is same as running text.
8316 .MAC PAGENUM_FAMILY END
8317 . ds $PAGE_NUM_FAM \\$1
8324 \# <font to use for page numbers>
8326 \# Creates or modifies string $PAGE_NUM_FT.
8328 \# Default is same as running text.
8330 .MAC PAGENUM_FONT END
8331 . ds $PAGE_NUM_FT \\$1
8338 \# <+|- number of points by which to in/decrease point size of
8339 \# page numbers (relative to running text)>
8341 \# Creates or modifies string $PAGE_NUM_SIZE_CHANGE.
8343 \# Must be preceded by a +|- sign with no space afterward.
8344 \# Fractional point sizes are allowed.
8347 .MAC PAGENUM_SIZE END
8348 . ds $PAGE_NUM_SIZE_CHANGE \\$1
8352 \# PAGE NUMBER FORMAT
8353 \# ------------------
8355 \# DIGIT | ROMAN | roman | ALPHA | alpha
8357 \# Assigns user entered format to #PAGENUMBER.
8359 .MAC PAGENUM_STYLE END
8360 . nr #PAGENUM_STYLE_SET 1
8361 . if '\\$1'DIGIT' \{\
8362 . ds $PAGENUM_STYLE \\$1
8365 . if '\\$1'ROMAN' \{\
8366 . ds $PAGENUM_STYLE \\$1
8369 . if '\\$1'roman' \{\
8370 . ds $PAGENUM_STYLE \\$1
8373 . if '\\$1'ALPHA' \{\
8374 . ds $PAGENUM_STYLE \\$1
8377 . if '\\$1'alpha' \{\
8378 . ds $PAGENUM_STYLE \\$1
8384 \# HYPHENS AROUND PAGE NUMBERS
8385 \# ---------------------------
8387 \# <none> | <anything>
8389 \# Creates or modifies register #PAGE_NUM_HYPHENS.
8390 \# Used to dis/enable hyphens on either side of page numbers.
8394 .MAC PAGENUM_HYPHENS END
8395 . nr #PAGE_NUM_HYPHENS_SET 1
8396 . ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
8397 . el \{ .rr #PAGE_NUM_HYPHENS \}
8401 \# PAGENUMBER POSITION
8402 \# -------------------
8404 \# TOP | BOTTOM LEFT | CENTER | RIGHT
8406 \# Creates or modifies various PAGE_NUM_H | V_POS registers.
8407 \# Used to position page numbers.
8409 \# Default is center/bottom.
8411 .MAC PAGENUM_POS END
8412 . nr #PAGE_NUM_POS_SET 1
8413 . if '\\$1'TOP' \{ .nr #PAGE_NUM_V_POS 1 \}
8414 . if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
8415 . if '\\$2'LEFT' \{ .nr #PAGE_NUM_H_POS 1 \}
8416 . if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
8417 . if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
8418 . if '\\$2'RIGHT' \{ .nr #PAGE_NUM_H_POS 3 \}
8422 \# PRINT PAGE NUMBER
8423 \# -----------------
8427 \# Prints page number if PAGEINATE=1.
8429 .MAC PRINT_PAGE_NUMBER END
8431 . po \\n[#DOC_L_MARGIN]u
8432 . ll \\n[#DOC_L_LENGTH]u
8434 . FAMILY \\*[$PAGE_NUM_FAM]
8435 . FT \\*[$PAGE_NUM_FT]
8436 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
8437 . if \\n[#PRINT_STYLE]=1 \{\
8442 . if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
8444 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
8448 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
8451 . if \\n[#PAGE_NUM_H_POS]=2 \{.CENTER \}
8452 . if \\n[#RECTO_VERSO]=0 \{\
8453 . if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
8454 . if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
8455 . if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT \}
8457 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
8458 . if \\n[#EN_FIRST_PAGE] \{\
8459 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
8462 . if \\n[#TOC_FIRST_PAGE] \{\
8464 . rr #TOC_FIRST_PAGE
8466 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
8467 . ie !\\n[#REVISION] \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT] / \\n[#PAGENUMBER]" \}
8468 . el \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT], \\*[$REVISION_STRING] \\n[#REVISION] / \\n[#PAGENUMBER]" \}
8471 . ie \\n[#PAGE_NUM_HYPHENS] \{ .PRINT "- \\n[#PAGENUMBER] -" \}
8472 . el \{ .PRINT "\\n[#PAGENUMBER]" \}
8477 \# ====================================================================
8484 \# <family to use in footnotes>
8486 \# Creates or modifies string $FN_FAM.
8488 \# Default is same as running text.
8490 .MAC FOOTNOTE_FAMILY END
8498 \# <font to use in footnotes>
8500 \# Creates or modifies string $FN_FT.
8502 \# Default is roman.
8504 .MAC FOOTNOTE_FONT END
8512 \# <+|- number of points by which to in/decrease point size of footnotes
8513 \# (relative to running text)>
8515 \# Creates or modifies string $FN_SIZE_CHANGE.
8517 \# Must be preceded by a +|- sign. No space afterwards.
8518 \# Fractional point sizes are allowed.
8519 \# Default is -2 for printstyle TYPESET; +0 for TYPEWRITE.
8521 .MAC FOOTNOTE_SIZE END
8522 . ds $FN_SIZE_CHANGE \\$1
8526 \# FOOTNOTE AUTOLEAD
8527 \# -----------------
8529 \# <autolead value for footnotes>
8531 \# Creates or modifies register #FN_AUTOLEAD.
8533 \# Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
8535 .MAC FOOTNOTE_AUTOLEAD END
8536 . nr #FN_AUTOLEAD \\$1
8543 \# <quad to use in footnotes>
8545 \# Creates or modifies string $FN_QUAD.
8547 \# Default is same as running text.
8549 .MAC FOOTNOTE_QUAD END
8557 \# <none> | <anything>
8559 \# Turns generation of footnote markers on or off.
8563 .MAC FOOTNOTE_MARKERS END
8564 . ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
8565 . el \{ .nr #FN_MARKERS 0 \}
8569 \# FOOTNOTE MARKER STYLE
8570 \# ---------------------
8574 \# Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
8575 \# the style of footnote markers.
8577 \# 1=STAR; 2=NUMBER. Default is STAR.
8579 .MAC FOOTNOTE_MARKER_STYLE END
8580 . if '\\$1'STAR' \{\
8581 . nr #FN_MARKER_STYLE 1
8583 . if '\\$1'NUMBER' \{\
8584 . nr #FN_MARKER_STYLE 2
8589 \# RESET FOOTNOTE NUMBER
8590 \# ---------------------
8594 \# Resets register #FN_NUMBER to 1. If argument is PAGE, creates
8595 \# toggle #RESET_FN_NUMBER which is checked in HEADER. If 1,
8596 \# numbered footnotes on every page start at 1.
8598 .MAC RESET_FOOTNOTE_NUMBER END
8599 . ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
8600 . el \{ .nr #RESET_FN_NUMBER 1 \}
8604 \# FOOTNOTE RULE LENGTH
8605 \# --------------------
8607 \# <length of rule used to separate footnotes from running text>
8609 \# Creates or modifies registers #FN_RULE_LENGTH.
8611 \# Requires unit of measure (iPpcm).
8612 \# Default is 4P for both PRINTSTYLEs.
8614 .MAC FOOTNOTE_RULE_LENGTH END
8615 . nr #FN_RULE_LENGTH (\\$1)
8619 \# FOOTNOTE_RULE_ADJ
8620 \# -----------------
8622 \# <number of points to raise footnote rule from it's baseline position>
8624 \# Creates or modifies register #FN_RULE_ADJ.
8626 \# Default is 3p for both TYPESTYLES.
8628 \# Requires unit of measure.
8630 .MAC FOOTNOTE_RULE_ADJ END
8631 . nr #FN_RULE_ADJ (\\$1)
8638 \# <none> | <anything>
8640 \# Turns printing of footnote separator rule on or off. If invoked as
8641 \# PRINT_FOOTNOTE_RULE, prints footnote separator rule.
8645 \# Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
8646 \# if the footnote number (#FN_COUNT) is 1.
8648 .MAC FOOTNOTE_RULE END
8649 . ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
8650 . if \\n[#FN_RULE]=0 \{ .RLD 1v \}
8651 \!. PT_SIZE 12 \"Not sure why these have to be transparently embedded, but they do.
8654 . PRINT \\v'-\\n[#FN_RULE_ADJ]u'\\l'\\n[#FN_RULE_LENGTH]u'\\v'+\\n[#FN_RULE_ADJ]u'
8655 \!. PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
8656 . QUAD \\*[$FN_QUAD]
8659 . ie '\\$1'' \{ .nr #FN_RULE 1 \}
8660 . el \{ .nr #FN_RULE 0 \}
8668 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value> > | <anything>
8670 \# Begins collecting and diverting footnote text if no argument
8671 \# given. Otherwise, ends diversion FOOTNOTES, measures footnote
8672 \# depth, and sets footnote trap.
8674 \# The input line preceding a footnote call MUST terminate with \c
8675 \# or the footnote marker will be spaced away from the word it
8676 \# should be joined to.
8678 \# If FOOTNOTES is invoked with INDENT, the footnote will
8679 \# be indented. An indent style and an indent value must be given.
8680 \# Subsequent footnotes will NOT be indented; INDENT must be given
8681 \# for each footnote the user wants indented.
8685 . if \\n[#FN_MARKERS] \{\
8686 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
8687 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
8688 . if \\n[#PRINT_STYLE]=1 \{\
8689 . if \\n[#UNDERLINE_ON] \{\
8690 . nr #UNDERLINE_WAS_ON 1
8694 . if !\\n[#NO_FN_MARKER] \{\
8695 . if \\n[#FN_MARKER_STYLE]=1 \{\
8696 . ie \\n[#FN_COUNT_FOR_COLS] \{\
8697 . if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU3]* \}
8698 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU3]\(dg \}
8699 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \*[BU3]** \}
8700 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
8701 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU3]*** \}
8702 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
8703 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU3]**** \}
8704 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
8705 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \*[BU3]***** \}
8706 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg \}
8709 . if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU3]* \}
8710 . if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU3]\(dg \}
8711 . if \\n[#FN_COUNT]=2 \{ .PRINT \*[BU3]** \}
8712 . if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
8713 . if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU3]*** \}
8714 . if \\n[#FN_COUNT]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
8715 . if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU3]**** \}
8716 . if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
8717 . if \\n[#FN_COUNT]=8 \{ .PRINT \*[BU3]***** \}
8718 . if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg\(dg \}
8721 . if \\n[#FN_MARKER_STYLE]=2 \{\
8722 . 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" \}
8723 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]" \}
8727 . nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-(\\n(nl+1v)
8728 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
8730 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
8731 . INDENT_FIRST_PARAS
8733 . ll \\n[#DOC_L_LENGTH]u
8735 . if \\n[#COLUMNS] \{\
8736 . ll \\n[#COL_L_LENGTH]u
8739 . if \\n[#FN_R_INDENT] \{\
8740 . ll -\\n[#FN_R_INDENT]u
8743 . if \\n[#FN_BR_INDENT] \{\
8744 . ll -\\n[#FN_BR_INDENT]u
8747 . FAMILY \\*[$FN_FAM]
8749 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
8750 . AUTOLEAD \\n[#FN_AUTOLEAD]
8751 . QUAD \\*[$FN_QUAD]
8752 . if \\n[#PRINT_STYLE]=1 \{\
8756 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
8757 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
8761 . nr #FN_LEAD \\n[#LEAD]
8763 . if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
8764 . if \\n[#FN_DEFER_SPACE] \{\
8765 . if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
8766 . if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
8767 . rr #FN_DEFER_SPACE
8769 . if \\n+[#FN_COUNT]=1 \{\
8770 . if !\\n[#FN_DEPTH] \{\
8771 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8772 . ie \\n[#FN_RULE] \{ .PRINT_FOOTNOTE_RULE \}
8776 . if \\n[#FN_MARKERS] \{\
8777 . if !\\n[#NO_FN_MARKER] \{\
8778 . if \\n[#FN_MARKER_STYLE]=1 \{\
8779 . ie \\n+[#FN_COUNT_FOR_COLS] \{\
8780 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT *\c \}
8781 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dg\c \}
8782 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT **\c \}
8783 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \(dg\(dg\c \}
8784 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT ***\c \}
8785 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \(dg\(dg\(dg\c \}
8786 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT ****\c \}
8787 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dg\(dg\(dg\(dg\c \}
8788 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT *****\c \}
8789 . if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
8792 . if \\n[#FN_COUNT]=1 \{ .PRINT *\c \}
8793 . if \\n[#FN_COUNT]=2 \{ .PRINT \(dg\c \}
8794 . if \\n[#FN_COUNT]=3 \{ .PRINT **\c \}
8795 . if \\n[#FN_COUNT]=4 \{ .PRINT \(dg\(dg\c \}
8796 . if \\n[#FN_COUNT]=5 \{ .PRINT ***\c \}
8797 . if \\n[#FN_COUNT]=6 \{ .PRINT \(dg\(dg\(dg\c \}
8798 . if \\n[#FN_COUNT]=7 \{ .PRINT ****\c \}
8799 . if \\n[#FN_COUNT]=8 \{ .PRINT \(dg\(dg\(dg\(dg\c \}
8800 . if \\n[#FN_COUNT]=9 \{ .PRINT *****\c \}
8801 . if \\n[#FN_COUNT]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
8804 . if \\n[#FN_MARKER_STYLE]=2 \{\
8805 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
8806 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\c" \}
8812 . ie '\\$1'INDENT' \{\
8814 . if '\\$2'L' \{ .in (\\$3) \}
8815 . if '\\$2'LEFT' \{ .in (\\$3) \}
8816 . if '\\$2'R' \{ .nr #FN_R_INDENT (\\$3) \}
8817 . if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
8819 . nr #FN_BL_INDENT (\\$3)
8820 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
8821 . el \{ .nr #FN_BR_INDENT (\\$4) \}
8822 . in \\n[#FN_BL_INDENT]u
8824 . if '\\$2'BOTH' \{\
8825 . nr #FN_BL_INDENT (\\$3)
8826 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
8827 . el \{ .nr #FN_BR_INDENT (\\$4) \}
8828 . in \\n[#FN_BL_INDENT]u
8836 . in 0 \"Turn off indent possibly set by FOOTNOTE INDENT...
8837 . if \\n[#PRINT_STYLE]=1 \{\
8838 . if \\n[#UNDERLINE_WAS_ON] \{\
8840 . rr #UNDERLINE_WAS_ON
8846 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
8847 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
8849 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
8850 . if \\n[#FN_DEFER] \{\
8851 . nr #FN_DEFER_SPACE 1
8854 . if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
8855 . ie \\n[#SPACE_REMAINING]<(\\n[#LEAD]*2) \{ .nr #FN_DEFER 1 \}
8858 . while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
8859 . nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
8863 . nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
8864 . if \\n[#FN_COUNT]=1 \{ .nr #VARIABLE_FOOTER_POS -1v \}
8866 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
8867 . if (\\n(nl+1v)>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
8868 . ch FOOTER \\n(nlu+1v
8870 . if \\n[#FN_DEFER] \{\
8871 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
8872 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
8875 . nr #NO_FN_MARKER 0
8879 .MAC FN_OVERFLOW_TRAP END
8880 . if \\n[#FN_COUNT] \{\
8886 .MAC DIVERT_FN_LEFTOVER END
8887 . nr #NO_FN_MARKER 1
8893 . rr #FN_OVERFLOW_DEPTH
8897 .MAC PROCESS_FN_LEFTOVER END
8898 . if !\\n[#FN_DEFER] \{\
8901 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
8903 . if \\n[#FN_DEFER] \{\
8904 . nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]+\\n[#DOC_LEAD])
8906 . nr #SPACE_REMAINING 0
8907 . ch FOOTER -\\n[#B_MARGIN]u
8908 . if \\n[#FN_DEFER] \{\
8909 . nr #NO_FN_MARKER 1
8916 . if !\\n[#FN_DEFER] \{\
8917 . if \\n[#FN_OVERFLOW_DEPTH] \{\
8918 . DIVERT_FN_LEFTOVER
8925 \# ====================================================================
8929 \# When endnotes are output, the spacing between the notes is always 1
8930 \# extra linespace. This can have bottom margin consequences. If this
8931 \# doesn't bother you, don't worry about it. If it does bother you, and
8932 \# you want to adjust the spacing between any two endnotes (as they're
8933 \# output), make the spacing adjustments (.ALD/.RLD) at the *end* of
8934 \# endnotes (i.e. just before .ENDNOTE OFF), not at the top.
8936 \# Endnotes must be output manually with .ENDNOTES. This allows user
8937 \# the flexibility to output endnotes at the end of each collated
8938 \# document, or to output them at the end of the entire document.
8943 \# <family to use in endnotes>
8945 \# Creates or modifies string $EN_FAM.
8947 \# Default is same as running text in body of document.
8949 .MAC ENDNOTE_FAMILY END
8957 \# <font to use in endnotes>
8959 \# Creates or modifies string $EN_FT.
8961 \# Default is roman.
8963 .MAC ENDNOTE_FONT END
8968 \# ENDNOTE POINT SIZE
8969 \# ------------------
8971 \# <base point size for endnotes>
8973 \# Creates or modifies register #EN_PS.
8975 \# Default is same as running text in body of document.
8977 \# This size control macro differs from other size control macros
8978 \# in that it sets an absolute point size, not a relative one. This
8979 \# is because a) endnotes always appear separate from the body of
8980 \# a document and therefore don't need to be relative to the body
8981 \# of the document, and b) there are quite a few elements of the
8982 \# endnotes page(s) that need to be relative to the base point size
8983 \# of that page. If the base endnote point size were relative to
8984 \# the body of the document (i.e. a _SIZE macro taking a +|- value)
8985 \# getting the rest of the endnote elements sized properly could
8986 \# become very confusing.
8988 .MAC ENDNOTE_PT_SIZE END
8989 . nr #EN_PS (p;\\$1)
8996 \# <base leading to use in endnotes> [ ADJUST ]
8998 \# Creates or modifies register #EN_LEAD. Creates or removes
8999 \# register #ADJ_EN_LEAD. Stores arguments in strings if ENDNOTE_LEAD
9000 \# set before START.
9002 \# Default is 14 points for TYPESET, adjusted; 24 for TYPEWRITE.
9004 .MAC ENDNOTE_LEAD END
9005 . if !\\n[#OK_PROCESS_LEAD] \{\
9008 . ds $ADJUST_EN_LEAD \\$2
9013 . nr #EN_LEAD (p;\\$1)
9014 . if '\\$2'ADJUST' \{\
9015 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
9016 . nr #ADJ_DOC_LEAD 1
9018 . nr #NO_TRAP_RESET 1
9019 . DOC_LEAD \\n[#EN_LEAD]u ADJUST
9020 . nr #EN_LEAD \\n[#DOC_LEAD]
9021 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
9032 \# LEFT | L | CENTER | C | RIGHT | R | JUSTIFY | J
9034 \# Creates or modifies string $EN_QUAD.
9036 \# Default is justified for TYPESET, left for TYPEWRITE.
9038 .MAC ENDNOTE_QUAD END
9043 \# ENDNOTES_HDRFTR_CENTER
9044 \# ----------------------
9048 \# Creates or removes toggle register #EN_HDRFTR_CENTER, used to
9049 \# determine whether mom should print a/the hdrftr center string
9050 \# on the endnotes page. Primarily to enable/disable printing of the
9051 \# chapter name in hdrftrs when DOCTYPE CHAPTER.
9055 .MAC ENDNOTES_HDRFTR_CENTER END
9056 . ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
9057 . el \{ .rr #EN_HDRFTR_CENTER \}
9064 \# <title for endnotes page>
9066 \# Creates or modifies string $EN_STRING.
9068 \# Default is "Endnotes"
9070 .MAC ENDNOTE_STRING END
9071 . ds $EN_STRING \\$1
9075 \# ENDNOTE STRING FAMILY
9076 \# ---------------------
9078 \# <family to use for endnote string>
9080 \# Creates or modifies string $EN_STRING_FAM.
9082 \# Default is same as running text in body of document.
9084 .MAC ENDNOTE_STRING_FAMILY END
9085 . ds $EN_STRING_FAM \\$1
9089 \# ENDNOTE STRING FONT
9090 \# -------------------
9092 \# <font to use for endnote string>
9094 \# Creates or modifies string $EN_FT.
9096 \# Default is BOLD for TYPEWRITE; roman for TYPESET
9098 .MAC ENDNOTE_STRING_FONT END
9099 . ds $EN_STRING_FT \\$1
9103 \# ENDNOTE STRING SIZE
9104 \# -------------------
9106 \# <+|- number of points by which to in/decrease endnote string
9107 \# (relative to base endnote size)>
9109 \# Creates or modifies string $EN_STRING_SIZE_CHANGE.
9111 \# Default is +1 for TYPESET.
9113 .MAC ENDNOTE_STRING_SIZE END \"Default for TYPESET is +1
9114 . ds $EN_STRING_SIZE_CHANGE \\$1
9118 \# ENDNOTE STRING QUAD
9119 \# -------------------
9121 \# LEFT | L | CENTER | C | RIGHT | R
9123 \# Creates or modifies string $EN_STRING_QUAD.
9125 \# Default is centered.
9127 .MAC ENDNOTE_STRING_QUAD END
9128 . ds $EN_STRING_QUAD \\$1
9132 \# ENDNOTE STRING UNDERSCORE
9133 \# -------------------------
9137 \# Turns underscoring of endnote main title on or off. If the argument
9138 \# is the digit "2", turns on double-underscoring.
9140 \# Default is double-underscored.
9142 .MAC ENDNOTE_STRING_UNDERSCORE END
9143 . ie '\\$1'' \{ .nr #EN_STRING_UNDERSCORE 1 \}
9145 . ie '\\$1'2' \{ .nr #EN_STRING_UNDERSCORE 2 \}
9146 . el \{ .nr #EN_STRING_UNDERSCORE 0 \}
9151 \# ENDNOTE STRING CAPS
9152 \# -------------------
9154 \# <none> | <anything>
9156 \# Turns capitalization of the endnotes pages title string
9157 \# "Endnotes" on or off.
9159 \# Users may want the endnotes pages title string to be in caps,
9160 \# but the toc entry for endnotes in lower case. If the argument
9161 \# to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
9162 \# turned on, this is exactly what will happen.
9166 .MAC ENDNOTE_STRING_CAPS END
9167 . ie '\\$1'' \{ .nr #EN_STRING_CAPS 1 \}
9168 . el \{ .rr #EN_STRING_CAPS \}
9175 \# <string that appears before the first endnote pertaining to any document>
9177 \# Creates string $EN_TITLE_STRING.
9179 \# Default is the document title, or, if doc is a chapter, "Chapter #"
9181 .MAC ENDNOTE_TITLE END
9186 \# ENDNOTE TITLE FAMILY
9187 \# --------------------
9189 \# <family to use for endnote title>
9191 \# Creates string $EN_TITLE_FAM.
9193 \# Default is same as running text of document.
9195 .MAC ENDNOTE_TITLE_FAMILY END
9196 . ds $EN_TITLE_FAM \\$1
9200 \# ENDNOTE TITLE FONT
9201 \# ------------------
9203 \# <font to use for endnote title>
9205 \# Creates string $EN_TITLE_FT.
9207 \# Default is bold for TYPESET; roman for TYPEWRITE.
9209 .MAC ENDNOTE_TITLE_FONT END
9210 . ds $EN_TITLE_FT \\$1
9214 \# ENDNOTE TITLE SIZE
9215 \# ------------------
9217 \# <+|- number of points by which to in/decrease endnote title
9218 \# (relative to base endnote size)>
9220 \# Creates string $EN_TITLE_SIZE_CHANGE.
9222 \# Default is 0 (i.e. title same size as text of endnotes).
9224 .MAC ENDNOTE_TITLE_SIZE END
9225 . ds $EN_TITLE_SIZE_CHANGE \\$1
9229 \# ENDNOTE TITLE QUAD
9230 \# ------------------
9232 \# <quad direction of endnote title>
9234 \# Creates string $EN_TITLE_QUAD.
9238 .MAC ENDNOTE_TITLE_QUAD END
9239 . ds $EN_TITLE_QUAD \\$1
9243 \# ENDNOTE TITLE UNDERSCORE
9244 \# ------------------------
9248 \# Creates or removes register #EN_TITLE_UNDERSCORE.
9250 \# Default is to underscore the endnote titles.
9252 .MAC ENDNOTE_TITLE_UNDERSCORE END
9253 . ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
9254 . el \{ .rr #EN_TITLE_UNDERSCORE \}
9258 \# ENDNOTE NUMBER FAMILY
9259 \# ---------------------
9261 \# <family to use for endnote numbers on endnotes page>
9263 \# Creates string $EN_NUMBER_FAM.
9265 \# Default is same as running text of document.
9267 \# Family, font, and size of endnote numbers applies only to the
9268 \# numbers as they appear on the endnotes page(s). The superscript
9269 \# numbers that appear in running text are unaffected.
9271 .MAC ENDNOTE_NUMBER_FAMILY END
9272 . ds $EN_NUMBER_FAM \\$1
9276 \# ENDNOTE NUMBER FONT
9277 \# -------------------
9279 \# <font to use for endnote numbers on endnotes page>
9281 \# Creates string $EN_NUMBER_FT.
9283 \# Default is bold for TYPESET; roman for TYPEWRITE.
9285 \# Family, font, and size of endnote numbers applies only to the
9286 \# numbers as they appear on the endnotes page(s). The superscript
9287 \# numbers that appear in running text are unaffected.
9289 .MAC ENDNOTE_NUMBER_FONT END \"Default for TYPESET is bold
9290 . ds $EN_NUMBER_FT \\$1
9294 \# ENDNOTE NUMBER SIZE
9295 \# -------------------
9297 \# <+|- number of points by which to in/decrease endnote numbers
9298 \# (relative to base endnote size)>
9300 \# Creates string $EN_NUMBER_SIZE_CHANGE.
9304 \# Family, font, and size of endnote numbers applies only to the
9305 \# numbers as they appear on the endnotes page(s). The superscript
9306 \# numbers that appear in running text are unaffected.
9308 .MAC ENDNOTE_NUMBER_SIZE END
9309 . ds $EN_NUMBER_SIZE_CHANGE \\$1
9313 \# ENDNOTE NUMBERS ALIGN RIGHT
9314 \# ---------------------------
9316 \# <max. number of digit placeholders that will appear in endnotes>
9318 \# Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
9319 \# #EN_NUMBER_PLACEHOLDERS.
9321 \# Default is for footnote numbers to be right aligned to 2 placeholders.
9323 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
9324 . rr #EN_NUMBERS_ALIGN_LEFT
9325 . nr #EN_NUMBERS_ALIGN_RIGHT 1
9326 . nr #EN_NUMBER_PLACEHOLDERS \\$1
9330 \# ENDNOTE NUMBERS ALIGN LEFT
9331 \# --------------------------
9335 \# Toggles register #EN_NUMBERS_ALIGN_LEFT on.
9337 \# Default is for footnote numbers to be right aligned to 2 placeholders
9338 \# (i.e. not left aligned).
9340 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
9341 . rr #EN_NUMBERS_ALIGN_RIGHT
9342 . nr #EN_NUMBERS_ALIGN_LEFT 1
9346 \# ENDNOTE PARAGRAPH INDENT
9347 \# ------------------------
9349 \# <first line indent of paras subsequent to 1st in endnotes>
9351 \# Creates register #EN_PP_INDENT for use in .PP.
9353 \# Requires a unit of measure.
9355 \# Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
9357 .MAC ENDNOTE_PARA_INDENT END
9358 . nr #EN_PP_INDENT (\\$1)
9362 \# TURN OFF COLUMN MODE FOR ENDNOTES
9363 \# ---------------------------------
9365 \# <none> | <anything>
9367 \# Creates or removes register #EN_NO_COLS
9369 \# Allows user to tell mom not to set endnotes in columnar
9370 \# documents in columns. Default is to set endnotes in columns.
9372 .MAC ENDNOTES_NO_COLUMNS END
9373 . ie '\\$1'' \{ .nr #EN_NO_COLS 1 \}
9374 . el \{ .rr #EN_NO_COLS \}
9378 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
9379 \# -------------------------------------------
9381 \# <none> | <anything>
9383 \# Creates or removes register #EN_NO_FIRST_PN
9385 \# For use if FOOTERS are on. Tells ENDNOTES not to put a page
9386 \# number on the first endnotes page. Some users may want this.
9387 \# Default is to print a page number at the top of the first
9388 \# endnotes page when footers are on.
9390 .MAC ENDNOTES_NO_FIRST_PAGENUM END
9391 . ie '\\$1'' \{ .nr #EN_NO_FIRST_PN 1 \}
9392 . el \{ .rr #EN_NO_FIRST_PN \}
9396 \# PAGE HEADERS ON ENDNOTES PAGES
9397 \# ------------------------------
9401 \# Creates or removes register #EN_ALLOWS_HEADERS or
9402 \# #EN_ALLOWS_HEADERS_ALL
9404 \# Whether ENDNOTES puts a page header at the top of endnotes
9405 \# pages if page headers are used throughout the document.
9406 \# Default is to insert the page headers, but not on the first
9407 \# page. If the optional argument ALL is given, ENDNOTES puts a
9408 \# page header on the first page as well.
9410 .MAC ENDNOTES_ALLOWS_HEADERS END
9411 . ie '\\$1'' \{ .nr #EN_ALLOWS_HEADERS 1 \}
9414 . nr #EN_ALLOWS_HEADERS 1
9415 . nr #EN_ALLOWS_HEADERS_ALL 1
9418 . rr #EN_ALLOWS_HEADERS
9419 . rr #EN_ALLOWS_HEADERS_ALL
9425 \# ENDNOTES PAGES PAGE NUMBERING STYLE
9428 \# DIGIT | ROMAN | roman | ALPHA | alpha
9430 \# Creates or modifies $EN_PN_STYLE.
9432 \# Allows user to define what style should be used for endnotes
9433 \# pages page numbering. Arguments are the same as for
9436 \# Default is DIGIT.
9438 .MAC ENDNOTES_PAGENUM_STYLE END
9439 . ds $EN_PN_STYLE \\$1
9443 \# FIRST PAGE NUMBER FOR ENDNOTES
9444 \# ------------------------------
9446 \# <page number that appears on page 1 of endnotes pages>
9448 \# Creates or modifies string $EN_FIRST_PN
9450 \# To be used with caution, only if all endnotes
9451 \# are to be output at once, i.e. not at the end of the separate
9452 \# docs of a collated doc
9454 .MAC ENDNOTES_FIRST_PAGENUMBER END
9455 . nr #EN_FIRST_PN \\$1
9458 \# SINGLESPACE ENDNOTES
9459 \# --------------------
9461 \# <none> | <anything>
9463 \# Sets lead of endnotes pages in TYPEWRITE to 12 points,
9466 \# Default is to double-space endnotes pages.
9468 .MAC SINGLESPACE_ENDNOTES END
9469 . if \\n[#PRINT_STYLE]=1 \{\
9470 . ie \\n[#SINGLE_SPACE] \{\
9471 . nr #EN_SINGLESPACE 1
9473 . if \\n[#OK_PROCESS_LEAD] \{\
9474 . ENDNOTE_LEAD 12 ADJUST
9480 . nr #EN_SINGLESPACE 1
9482 . if \\n[#OK_PROCESS_LEAD] \{\
9483 . ENDNOTE_LEAD 12 ADJUST
9488 . rr #EN_SINGLESPACE
9490 . if \\n[#OK_PROCESS_LEAD] \{\
9491 . ENDNOTE_LEAD 24 ADJUST
9500 \# ENDNOTE PARAGRAPH SPACE
9501 \# -----------------------
9505 \# Creates toggle register #EN_PP_SPACE for use in .PP.
9507 \# Like PARA_SPACE. Default is not to space endnote paras.
9509 .MAC ENDNOTE_PARA_SPACE END
9510 . ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
9511 . el \{ .rr #EN_PP_SPACE \}
9520 \# Places superscript endnote number in text, then collects and
9521 \# processes endnote in diversion END_NOTES.
9523 \# \c must be appended to the word immediately preceding .ENDNOTE.
9528 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
9529 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
9530 . if \\n[#PRINT_STYLE]=1 \{\
9531 . if \\n[#UNDERLINE_ON] \{\
9532 . nr #UNDERLINE_WAS_ON 1
9535 . if \\n[#SLANT_ON] \{\
9536 . nr #SLANT_WAS_ON 1
9539 . PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2"
9541 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]" \}
9542 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
9544 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
9545 . INDENT_FIRST_PARAS
9548 . LL \\n[#DOC_L_LENGTH]u
9550 . if \\n[#COLUMNS] \{\
9551 . ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
9552 . el \{ .LL \\n[#COL_L_LENGTH]u \}
9556 . if \\n[#EN_NUMBER]=1 \{\
9558 . if \\n[#PRINT_STYLE]=1 \{\
9563 . if \\n[#PRINT_STYLE]=2 \{\
9564 . FAMILY \\*[$EN_TITLE_FAM]
9565 . FT \\*[$EN_TITLE_FT]
9566 . PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
9569 . if !'\\*[$EN_TITLE]'' \{\
9570 . if '\\*[$EN_TITLE_QUAD]'L' \{ .LEFT \}
9571 . if '\\*[$EN_TITLE_QUAD]'LEFT' \{ .LEFT \}
9572 . if '\\*[$EN_TITLE_QUAD]'C' \{ .CENTER \}
9573 . if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
9574 . if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
9575 . if '\\*[$EN_TITLE_QUAD]'R' \{ .RIGHT \}
9576 . if '\\*[$EN_TITLE_QUAD]'RIGHT' \{ .RIGHT \}
9577 . ie \\n[#EN_TITLE_UNDERSCORE] \{\
9578 . UNDERSCORE "\\*[$EN_TITLE]
9581 . PRINT "\\*[$EN_TITLE]
9585 . ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
9586 . ie \\n[#EN_NUMBER]=1 \{\
9587 . if !'\\*[$EN_TITLE]'' \{ .sp \}
9591 . if \\n[#PRINT_STYLE]=1 \{\
9596 . if \\n[#PRINT_STYLE]=2 \{\
9597 . FAMILY \\*[$EN_NUMBER_FAM]
9598 . FT \\*[$EN_NUMBER_FT]
9599 . PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
9601 . nr #RESET_L_LENGTH \\n(.l
9602 . nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
9603 . ll \\n[#EN_NUMBER_L_LENGTH]u
9606 . if \\n[#PRINT_STYLE]=1 \{\
9611 . if \\n[#PRINT_STYLE]=2 \{\
9612 . FAMILY \\*[$EN_FAM]
9614 . PT_SIZE \\n[#EN_PS]u
9617 . ll \\n[#RESET_L_LENGTH]u
9618 . in \\n[#EN_NUMBER_L_LENGTH]u+\w'.\0'u
9619 . nr #EN_TEXT_INDENT \\n(.i
9620 . QUAD \\*[$EN_QUAD]
9624 . ie \\n[#EN_NUMBER]=1 \{\
9625 . if !'\\*[$EN_TITLE]'' \{ .sp \}
9628 . if \\n[#PRINT_STYLE]=1 \{\
9633 . if \\n[#PRINT_STYLE]=2 \{\
9634 . FAMILY \\*[$EN_NUMBER_FAM]
9635 . FT \\*[$EN_NUMBER_FT]
9636 . PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
9638 . QUAD \\*[$EN_QUAD]
9639 \En[#EN_NUMBER].\0\c
9640 . if \\n[#PRINT_STYLE]=2 \{\
9641 . FAMILY \\*[$EN_FAM]
9643 . PT_SIZE \\n[#EN_PS]u
9649 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
9654 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
9655 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
9658 . if \\n[#PRINT_STYLE]=1 \{\
9659 . if \\n[#UNDERLINE_WAS_ON] \{\
9660 . rr #UNDERLINE_WAS_ON
9664 . if \\n[#SLANT_WAS_ON] \{\
9677 \# Sets new document leading from #EN_LEAD, breaks to a new page,
9678 \# sets up an endnotes page based on registers and strings associated
9679 \# with endnotes, then outputs diversion END_NOTES.
9683 . nr #EN_FIRST_PAGE 1
9684 . nr #HEADER_STATE \\n[#HEADERS_ON]
9685 . ds $UR_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
9686 . if \\n[#HEADERS_ON]=1 \{\
9687 . if !\\n[#EN_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
9689 . if \\n[#DOC_TYPE]=2 \{\
9690 . ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
9691 . el \{ .HDRFTR_CENTER \}
9693 . ie !\\n[#SUSPEND_PAGINATION] \{\
9694 . if \\n[#PAGINATE]=1 \{\
9695 . if \\n[#PAGE_NUM_V_POS]=1 \{\
9696 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
9697 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
9698 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN]-1 \}
9699 . if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
9704 . ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
9705 . ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
9706 . el \{ .nr #PAGINATE 0 \}
9708 . if \\n[#FOOTERS_ON]=1 \{\
9709 . if !'\\*[$HDRFTR_CENTER_OLD]'' \{ .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD] \}
9712 . if \\n[#FINIS] \{\
9713 . if \\n[#FOOTERS_WERE_ON] \{\
9715 . rr #FOOTERS_WERE_ON
9717 . if \\n[#PAGINATION_WAS_ON] \{\
9719 . rr #PAGINATION_WAS_ON
9723 . if \\n[#FOOTERS_WERE_ON] \{\
9725 . rr #FOOTERS_WERE_ON
9727 . if \\n[#PAGINATION_WAS_ON] \{\
9729 . rr #PAGINATION_WAS_ON
9731 . if \\n[#FOOTERS_ON]=1 \{\
9732 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
9733 . rm $HDRFTR_CENTER_OLD
9734 . rm $HDRFTR_CENTER_NEW
9736 . ie !\\n[#SUSPEND_PAGINATION] \{\
9737 . if \\n[#PAGE_NUM_V_POS]=1 \{\
9738 . if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 1 \}
9742 . if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
9744 . if '\\*[$RESTORE_PAGENUM_STYLE]'' \{\
9745 . ds $RESTORE_PAGENUM_STYLE \\*[$UR_PAGENUM_STYLE]
9747 . PAGENUM_STYLE \\*[$EN_PN_STYLE]
9748 . if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
9749 . if \\n[#HEADER_STATE]=1 \{\
9750 . if \\n[#EN_ALLOWS_HEADERS] \{ .HEADERS \}
9752 \# Collect endnote title string for TOC
9753 . nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
9754 . af #TOC_ENTRY_PN \\g[#PAGENUMBER]
9755 . ds $TOC_TITLE_ITEM \\*[$EN_STRING]\\|
9758 . if \\n[#PRINT_STYLE]=1 \{\
9763 . if \\n[#PRINT_STYLE]=2 \{\
9764 \!. FAMILY \\*[$TOC_TITLE_FAM]
9765 \!. FT \\*[$TOC_TITLE_FT]
9766 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
9769 . ie \\n[#PRINT_STYLE]=1 \{\
9770 \!. PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]"
9773 \!. PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
9778 . if \\n[#PRINT_STYLE]=2 \{\
9779 \!. FAMILY \\*[$TOC_PN_FAM]
9780 \!. FT \\*[$TOC_PN_FT]
9781 \!. PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
9784 \!. PRINT \\*[LEADER]
9787 \!. PRINT \\n[#TOC_ENTRY_PN]
9791 \# End collection of endnote title string for TOC
9793 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#EN_LEAD]u \}
9794 . if \\n[#PRINT_STYLE]=2 \{\
9795 . if \\n[#EN_NO_COLS] \{\
9796 . if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
9799 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
9800 . ie \\n[#ADJ_EN_LEAD] \{\
9801 . nr #DOC_LEAD \\n[#EN_LEAD]
9803 . el \{ .DOC_LEAD \\n[#EN_LEAD]u \}
9806 . sp |\\n[#T_MARGIN]u
9808 . if \\n[#SLANT_ON] \{\
9812 . if !'\\*[$EN_STRING]'' \{\
9813 . if \\n[#PRINT_STYLE]=1 \{\
9819 . if \\n[#PRINT_STYLE]=2 \{\
9820 . LL \\n[#DOC_L_LENGTH]u
9822 . if \\n[#COLUMNS] \{\
9823 . ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
9824 . el \{ .LL \\n[#COL_L_LENGTH]u \}
9827 . FAMILY \\*[$EN_STRING_FAM]
9828 . FT \\*[$EN_STRING_FT]
9829 . PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
9832 . if '\\*[$EN_STRING_QUAD]'L' \{ .LEFT \}
9833 . if '\\*[$EN_STRING_QUAD]'LEFT' \{ .LEFT \}
9834 . if '\\*[$EN_STRING_QUAD]'C' \{ .CENTER \}
9835 . if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
9836 . if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
9837 . if '\\*[$EN_STRING_QUAD]'R' \{ .RIGHT \}
9838 . if '\\*[$EN_STRING_QUAD]'RIGHT' \{ .RIGHT \}
9840 . if \\n[#EN_STRING_CAPS] \{ .CAPS \}
9841 . ie \\n[#EN_STRING_UNDERSCORE] \{\
9842 . ie \\n[#EN_STRING_UNDERSCORE]=2 \{\
9843 . UNDERSCORE2 "\\*[$EN_STRING]
9846 . UNDERSCORE "\\*[$EN_STRING]
9850 . PRINT "\\*[$EN_STRING]
9854 . ALD \\n[#EN_LEAD]u
9855 . QUAD \\*[$EN_QUAD]
9861 . if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#DOC_LEAD]u \}
9862 . if \\n[#PRINT_STYLE]=2 \{\
9863 . ie \\n[#ADJ_EN_LEAD] \{\
9864 . nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
9866 . el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
9867 . rr #RESTORE_DOC_LEAD
9869 . if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
9870 . if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
9874 \# ====================================================================
9876 \# +++TABLE OF CONTENTS+++
9879 \# Strings to allocate space for leaders and entry page numbers
9881 .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]
9882 .ds $TOC_PN_TYPEWRITE \\*[ST100]#\\*[ST100X]\\*[ST101]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST101X]
9884 \# TOC ENTRIES PAGE NUMBERS PADDING
9885 \# --------------------------------
9887 \# <number of placeholders for toc entries page numbers>
9889 \# Creates or modifies register #TOC_PN_PADDING.
9891 \# "Placeholders" is the maximum number of digits in a page
9896 .MAC TOC_PADDING END
9897 . nr #TOC_PN_PADDING \\$1
9904 \# <none> | <anything>
9906 \# Creates or removes register #PAGINATE_TOC.
9908 \# Default is to paginate toc.
9910 .MAC PAGINATE_TOC END
9911 . ie '\\$1'' \{ .nr #PAGINATE_TOC 1 \}
9912 . el \{ .nr #PAGINATE_TOC 0 \}
9919 \# <overall default family for toc pages>
9921 \# Creates string $TOC_FAM.
9923 \# Default is same as document family.
9933 \# <base point size for toc pages>
9935 \# Creates or modifies register #TOC_PS.
9937 \# This size control macro differs from other size control macros
9938 \# in that it sets an absolute point size, not a relative one.
9939 \# See notes for ENDNOTE_PT_SIZE for explanation. No unit of
9940 \# measure required.
9942 \# No unit of measure required (points assumed). Default is 11.5
9945 .MAC TOC_PT_SIZE END
9946 . nr #TOC_PS (p;\\$1)
9953 \# <leading for toc pages> [ADJUST]
9955 \# Creates or modifies register #TOC_LEAD. If optional ADJUST
9956 \# given, adjusts lead to fill page. If #OK_PROCESS_LEAD doesn't
9957 \# exist, stores arguments for when it's okay to run the macro.
9959 \# No unit of measure required (points assumed).
9961 \# Default is same as DOC_LEAD.
9964 . if !\\n[#OK_PROCESS_LEAD] \{\
9967 . ds $ADJUST_TOC_LEAD \\$2
9972 . nr #TOC_LEAD (p;\\$1)
9973 . if '\\$2'ADJUST' \{\
9974 . nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
9975 . nr #ADJ_DOC_LEAD 1
9976 . nr #ADJ_TOC_LEAD 1
9977 . nr #NO_TRAP_RESET 1
9978 . DOC_LEAD \\n[#TOC_LEAD]u ADJUST
9979 . nr #TOC_LEAD \\n[#DOC_LEAD]
9980 . DOC_LEAD \\n[#ORIG_DOC_LEAD]u
9988 \# TOC PAGES PAGE-NUMBERING STYLE
9989 \# ------------------------------
9991 \# DIGIT | ROMAN | roman | ALPHA | alpha
9993 \# Creates or modifies string $TOC_PN_STYLE
9995 \# Page numbering style for page numbers that appear in the
9996 \# headers/footers of toc pages. See notes for PAGENUM_STYLE.
9998 \# Default is roman.
10000 .MAC TOC_PAGENUM_STYLE END
10001 . ds $TOC_PN_STYLE \\$1
10005 \# TOC RECTO_VERSO SWITCH
10006 \# ----------------------
10008 \# <none> | <anything>
10010 \# Creates or removes register #TOC_RV_SWITCH
10012 \# Allows switching of L/R margins if a doc is recto/verso and
10013 \# the first toc page happens to fall the wrong way
10015 .MAC TOC_RV_SWITCH END
10016 . ie '\\$1'' \{ .nr #TOC_RV_SWITCH 1 \}
10017 . el \{ .rr #TOC_RV_SWITCH \}
10020 \# - for TOC "doc" header (i.e. "Contents")
10022 \# TOC HEADER FAMILY
10023 \# -----------------
10025 \# <family for toc header>
10027 \# Creates or modifies string $TOC_HEADER_FAM
10029 \# Default is same as TOC_FAMILY.
10031 .MAC TOC_HEADER_FAMILY END
10032 . ds $TOC_HEADER_FAM \\$1
10039 \# <font for toc header>
10041 \# Creates or modified string $TOC_HEADER_FT
10043 \# Default is bold for TYPESET.
10045 .MAC TOC_HEADER_FONT END
10046 . ds $TOC_HEADER_FT \\$1
10053 \# <+|- number of points by which to in/decrease toc header
10054 \# (relative to overall toc point size)>
10056 \# Creates or modifies string $TOC_HEADER_SIZE_CHANGE.
10060 .MAC TOC_HEADER_SIZE END
10061 . ds $TOC_HEADER_SIZE_CHANGE \\$1
10068 \# L | LEFT | C | CENTER | CENTRE | R | RIGHT
10070 \# Creates or modifies string $TOC_HEADER_QUAD.
10072 \# Default is LEFT.
10074 .MAC TOC_HEADER_QUAD END
10075 . ds $TOC_HEADER_QUAD \\$1
10079 \# TOC HEADER STRING
10080 \# -----------------
10082 \# <string for "doc" header of first toc page>
10084 \# Creates or modifies string $TOC_HEADER_STRING
10086 \# Default is "Contents".
10088 .MAC TOC_HEADER_STRING END
10089 . ds $TOC_HEADER_STRING \\$1
10092 \# - for TOC entries page number numbers
10094 \# TOC ENTRIES PAGE NUMBER FAMILY
10095 \# ------------------------------
10097 \# <family to use for toc entries page number>
10099 \# Creates or modifies string $TOC_PN_FAM.
10101 \# Default is same as $TOC_FAM.
10103 .MAC TOC_PN_FAMILY END
10104 . ds $TOC_PN_FAM \\$1
10108 \# TOC ENTRIES PAGE NUMBER FONT
10109 \# ----------------------------
10111 \# <font to use for toc entries page number>
10113 \# Creates or modifies string $TOC_PN_FT.
10115 \# Default is roman.
10117 .MAC TOC_PN_FONT END
10118 . ds $TOC_PN_FT \\$1
10122 \# TOC ENTRIES PAGE NUMBER SIZE
10123 \# ----------------------------
10125 \# <+|- number of points by which to in/decrease toc
10126 \# entries page numbers (relative to overall toc point size)>
10128 \# Creates or modifies string $TOC_PN_SIZE_CHANGE.
10132 .MAC TOC_PN_SIZE END
10133 . ds $TOC_PN_SIZE_CHANGE \\$1
10137 \# Control macros for toc doc titles, heads, subheads and paraheads
10138 \# ----------------------------------------------------------------
10140 \# All these control macros behave the same way, setting the family,
10141 \# font, point size and indent from the left margin of the different
10142 \# kinds of entries what can appear in the toc. The way they
10143 \# operate is identical to all other _FAMILY, _FONT and _SIZE
10144 \# control macros. _INDENT takes an absolute value.
10145 \# TOC_APPENDS_AUTHORS is unique in this section.
10147 \# - for title entries
10149 .MAC TOC_TITLE_FAMILY END
10150 . ds $TOC_TITLE_FAM \\$1
10154 .MAC TOC_TITLE_FONT END
10155 . ds $TOC_TITLE_FT \\$1
10159 .MAC TOC_TITLE_SIZE END
10160 . ds $TOC_TITLE_SIZE_CHANGE \\$1
10164 .MAC TOC_TITLE_INDENT END
10165 . nr #TOC_TITLE_INDENT (\\$1)
10169 .MAC TOC_TITLE_ENTRY END
10170 . nr #USER_SET_TITLE_ITEM 1
10171 . ds $USER_SET_TITLE_ITEM \\$1
10175 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
10176 \# -----------------------------------------
10178 \# <none> | <name(s) of author(s) as they should appear in toc doc title entries>
10180 \# Creates register #TOC_AUTHORS (to tell TOC to append authors
10181 \# to toc doc title entries). Optionally creates string
10184 \# Normally, TOC does not append the author(s) to a toc doc title
10185 \# entry. This special macro instructs TOC to do so.
10187 \# If user has multiple authors for each doc when collating,
10188 \# TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
10189 \# COLLATE and START in each doc. Otherwise, mom prints only the
10190 \# first author given to AUTHOR.
10192 .MAC TOC_APPENDS_AUTHOR END
10193 . nr #TOC_AUTHORS 1
10195 . ds $TOC_AUTHORS \\$1
10199 \# - for head entries
10201 .MAC TOC_HEAD_FAMILY END
10202 . ds $TOC_HEAD_FAM \\$1
10206 .MAC TOC_HEAD_FONT END
10207 . ds $TOC_HEAD_FT \\$1
10211 .MAC TOC_HEAD_SIZE END
10212 . ds $TOC_HEAD_SIZE_CHANGE \\$1
10216 .MAC TOC_HEAD_INDENT END
10217 . nr #TOC_HEAD_INDENT (\\$1)
10220 \# - for subhead entries
10222 .MAC TOC_SUBHEAD_FAMILY END
10223 . ds $TOC_SH_FAM \\$1
10227 .MAC TOC_SUBHEAD_FONT END
10228 . ds $TOC_SH_FT \\$1
10232 .MAC TOC_SUBHEAD_SIZE END
10233 . ds $TOC_SH_SIZE_CHANGE \\$1
10237 .MAC TOC_SUBHEAD_INDENT END
10238 . nr #TOC_SH_INDENT (\\$1)
10241 \# - for parahead entries
10243 .MAC TOC_PARAHEAD_FAMILY END
10244 . ds $TOC_PH_FAM \\$1
10248 .MAC TOC_PARAHEAD_FONT END
10249 . ds $TOC_PH_FT \\$1
10253 .MAC TOC_PARAHEAD_SIZE END
10254 . ds $TOC_PH_SIZE_CHANGE \\$1
10258 .MAC TOC_PARAHEAD_INDENT END
10259 . nr #TOC_PH_INDENT (\\$1)
10264 . if !r#PAGINATE_TOC \{ .PAGINATE_TOC \}
10265 . nr #TOC_FIRST_PAGE 1
10266 . if \\n[#FINIS] \{\
10267 . if \\n[#FOOTERS_WERE_ON] \{\
10268 . FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
10271 . if \\n[#FOOTERS_ON]=1 \{\
10272 . if !'\\*[$HDRFTR_CENTER_OLD]'' \{ .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD] \}
10273 . ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
10274 . el \{ .PAGINATION OFF \}
10276 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS OFF \} \" But have to turn FOOTERS off again so they don't print when FINIS was called
10278 . if \\n[#FINIS] \{\
10279 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \} \" Finally, turn footers on if they were on
10280 . rr #FOOTERS_WERE_ON
10281 . if \\n[#PAGINATION_WAS_ON] \{\
10283 . rr #PAGINATION_WAS_ON
10287 . ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
10288 . el \{ .PAGINATION OFF \}
10289 . if \\n[#FOOTERS_ON]=1 \{\
10290 . ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
10291 . rm $HDRFTR_CENTER_OLD
10292 . rm $HDRFTR_CENTER_NEW
10297 . if \\n[#PRINT_STYLE]=1 \{\
10299 . DOC_LEAD 24 ADJUST
10305 . if \\n[#PRINT_STYLE]=2 \{\
10306 . ie r#ADJ_TOC_LEAD \{\
10307 . nr #NO_TRAP_RESET 1
10308 . DOC_LEAD \\n[#TOC_LEAD]u ADJUST
10309 . rr #NO_TRAP_RESET
10311 . el \{ .DOC_LEAD \\n[#TOC_LEAD]u \}
10313 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
10314 . if \\n[#SLANT_ON] \{\
10317 . DOC_LINE_LENGTH \\n[#DOC_L_LENGTH]u
10318 . QUAD \\*[$TOC_HEADER_QUAD]
10319 . PAGENUM_STYLE \\*[$TOC_PN_STYLE]
10320 . if \\n[#PRINT_STYLE]=1 \{\
10325 . if \\n[#PRINT_STYLE]=2 \{\
10326 . FAMILY \\*[$TOC_HEADER_FAM]
10327 . FT \\*[$TOC_HEADER_FT]
10328 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
10330 . ie \\n[#PRINT_STYLE]=1 \{\
10333 . PRINT "\\*[$TOC_HEADER_STRING]"
10338 . PRINT "\\*[$TOC_HEADER_STRING]"
10342 \# In collated docs, this bit inserts the first doc's title
10343 \# underneath the TOC header, before the TOC_ENTRIES diversion
10346 . if d$FIRST_DOC_TITLE \{\
10347 . nr #RESTORE_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
10348 . TOC_PADDING \\n[#FIRST_DOC_TOC_PN_PADDING]
10349 . if \\n[#PRINT_STYLE]=2 \{\
10350 . FAMILY \\*[$TOC_TITLE_FAM]
10351 . FT \\*[$TOC_TITLE_FT]
10352 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
10354 . ie \\n[#PRINT_STYLE]=1 \{\
10355 . PAD "\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN_TYPEWRITE]"
10358 . PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN]"
10363 . if \\n[#PRINT_STYLE]=2 \{\
10364 . FAMILY \\*[$TOC_PN_FAM]
10365 . FT \\*[$TOC_PN_FT]
10366 . PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10369 . PRINT \\*[LEADER]
10371 . PRINT \\n[#FIRST_DOC_TITLE_PN]
10374 . TOC_PADDING \\n[#RESTORE_TOC_PN_PADDING]
10379 \# ====================================================================
10386 \# <number of columns> <width of gutters>
10388 \# Creates registers associated with setting docs in columns.
10389 \# Calculates column line lengths and offsets
10391 \# COLUMNS, if used, s/b the last macro invoked before START.
10394 . if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
10396 . nr #NUM_COLS \\$1
10397 . nr #GUTTER (\\$2)
10398 . nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
10399 . nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
10401 . while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
10402 . nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
10403 . nr #COL_TOTAL \\n+[#COL_TOTAL]
10415 \# Breaks current column and moves to next column.
10416 \# If current column is the last on the page, breaks
10420 . if \\n[#COLUMNS] \{\
10422 . ie '\\$0'COL_NEXT' \{ .br \}
10427 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
10434 \# ====================================================================
10436 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
10443 \# Turns headers off (if on) and saves header state, sets register
10444 \# #COLLATE to 1 (toggle), and breaks to a new page.
10446 \# COLLATE exists primarily to allow putting multiple chapters in
10447 \# a single file, although it can be used for any document type. After
10448 \# COLLATE, any of the macros that normally precede START may be
10449 \# used, and should behave as expected.
10451 \# N.B.--the START macro *must* be used after COLLATE (and any other
10452 \# macros that alter mom's behaviour).
10456 . nr #HEADER_STATE \\n[#HEADERS_ON]
10458 . if \\n[#PAGE_NUM_V_POS]=1 \{\
10459 . nr #PAGINATION_STATE \\n[#PAGINATE]
10464 \# Collect first doc's title for TOC
10465 . if \\n[#COLLATED_DOC]=0 \{\
10466 . ie \\n[#USER_SET_TITLE_ITEM] \{\
10467 . ds $FIRST_DOC_TITLE \\*[$USER_SET_TITLE_ITEM]\\|
10468 . rr #USER_SET_TITLE_ITEM
10469 . rm $USER_SET_TITLE_ITEM
10472 . ie \\n[#DOC_TYPE]=2 \{\
10473 . ie '\\*[$CHAPTER_TITLE]'' \{\
10474 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
10477 . ie '\\*[$CHAPTER]'' \{\
10478 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_TITLE]\\|
10481 . ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
10486 . ds $FIRST_DOC_TITLE \\*[$TITLE]\\|
10489 . if \\n[#TOC_AUTHORS]=1 \{\
10490 . ie '\\*[$TOC_AUTHORS]'' \{\
10491 . as $FIRST_DOC_TITLE /\\|\\*[$AUTHOR_1]\\|
10494 . as $FIRST_DOC_TITLE /\\|\\*[$TOC_AUTHORS]\\|
10498 . nr #COLLATED_DOC 1
10500 \# End title collection for TOC
10501 . LL \\n[#DOC_L_LENGTH]u
10503 . LS \\n[#DOC_LEAD]u
10508 . if \\n[#DEFER_PAGINATION] \{ .PAGINATE \}
10509 . if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
10510 . PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
10511 . rm $RESTORE_PAGENUM_STYLE
10517 \# OUTPUT BLANK PAGES
10518 \# ------------------
10520 \# <number of blank pages to output>
10522 \# Outputs blank pages.
10524 \# If recto/verso, each page is recto/verso, even if there's
10528 . nr #HOW_MANY \\$1
10530 . while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
10531 . if \\n[#HEADERS_ON]=1 \{\
10532 . nr #HEADERS_WERE_ON 1
10535 . if \\n[#PAGE_NUM_V_POS]=1 \{\
10536 . if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
10541 . if \\n[#FOOTERS_ON]=1 \{\
10542 . nr #FOOTERS_WERE_ON 1
10545 . if \\n[#PAGE_NUM_V_POS]=2 \{\
10546 . if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
10549 . if \\n[#HEADERS_WERE_ON] \{ .HEADERS \}
10550 . if \\n[#PAGE_NUM_V_POS]=1 \{\
10551 . if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
10555 . if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \}
10556 . if \\n[#PAGE_NUM_V_POS]=2 \{\
10557 . if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
10559 . rr #HEADERS_WERE_ON
10560 . rr #FOOTERS_WERE_ON
10561 . rr #PAGINATE_WAS_ON
10565 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
10566 \# ---------------------------------------
10570 \# Sets header/footer/footnotes/etc... traps.
10571 \# Calculates the number of lines that actually fit on a
10572 \# page based on #B_MARGIN and resets page bottom trap to coincide
10573 \# with the depth of that number of lines , or, if #ADJ_DOC_LEAD=1,
10574 \# adjusts #DOC_LEAD so that the last line of text on a page falls
10575 \# exactly on #B_MARGIN.
10578 \# *Remove all header/footer traps
10579 . if !\\n[#NO_TRAP_RESET] \{\
10584 \# *Plant header trap
10587 \# *Adjust lead so last line of text falls on B_MARGIN,...
10588 . ie \\n[#ADJ_DOC_LEAD]=1 \{\
10589 . nr #LINES_PER_PAGE 0 1
10590 . nr #DOC_LEAD_ADJ 0 1
10591 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
10592 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
10593 . nr #LINES_PER_PAGE -1
10594 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
10595 . DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
10597 \# *...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
10600 . nr #LINES_PER_PAGE 0 1
10601 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
10602 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
10603 . nr #B_MARGIN \\n[#PAGE_LENGTH]-(\\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n[#LINES_PER_PAGE]))
10605 \# *Set footer and footnote overflow traps
10606 . if !\\n[#NO_TRAP_RESET] \{\
10608 . nr #SPACE_REMAINING 0
10610 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
10612 . wh -\\n[#B_MARGIN]u FN_OVERFLOW_TRAP
10613 . ch FOOTER -\\n[#B_MARGIN]u
10624 \# Adds left, right, or both indent values to document elements
10625 \# like heads and subheads that are processed in environments.
10627 .MAC CHECK_INDENT END
10628 . if \\n[#INDENT_LEFT_ACTIVE] \{\
10629 . in \\n[#L_INDENT]u
10630 . if \\n[#QUOTE] \{\
10631 . in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
10632 . ll -\\n[#L_INDENT]u
10635 . if \\n[#EPIGRAPH] \{\
10636 . in -\\n[#L_INDENT]u
10637 . ll -\\n[#L_INDENT]u
10641 . if \\n[#INDENT_RIGHT_ACTIVE] \{\
10642 . ll -\\n[#R_INDENT]u
10645 . if \\n[#INDENT_BOTH_ACTIVE] \{\
10646 . in \\n[#BL_INDENT]u
10647 . ll -\\n[#BR_INDENT]u
10649 . if \\n[#QUOTE] \{\
10650 . in -\\n[#BL_INDENT]u
10651 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
10652 . ll -\\n[#BR_INDENT]u
10656 . ll -(\\n[#BR_INDENT]u/2u)
10660 . if \\n[#EPIGRAPH] \{\
10661 . in -\\n[#BL_INDENT]u
10662 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
10663 . ll -\\n[#BR_INDENT]u
10667 . ll -(\\n[#BR_INDENT]u/2u)
10680 \# Removes left, right, or both indent values from document elements
10681 \# like heads and subheads that are processed in environments.
10683 .MAC REMOVE_INDENT END
10685 . ll \\n[#L_LENGTH]u
10692 \# ====================================================================
10694 \# +++DOCUMENT PROCESSING ALIASES+++
10696 \# Aliases to make life easier for users: synonyms, short forms
10697 \# and alternate spellings.
10701 .ALIAS BREAK_BLOCKQUOTE BREAK_QUOTE
10702 .ALIAS BREAK_CITATION BREAK_QUOTE
10703 .ALIAS BREAK_CITE BREAK_QUOTE
10704 .ALIAS CITATION BLOCKQUOTE
10705 .ALIAS CITE BLOCKQUOTE
10706 .ALIAS DOC_R_MARGIN DOC_RIGHT_MARGIN
10707 .ALIAS DOC_L_MARGIN DOC_LEFT_MARGIN
10708 .ALIAS DOC_L_LENGTH DOC_LINE_LENGTH
10709 .ALIAS DOC_RMARGIN DOC_RIGHT_MARGIN
10710 .ALIAS DOC_LMARGIN DOC_LEFT_MARGIN
10711 .ALIAS DOC_LLENGTH DOC_LINE_LENGTH
10712 .ALIAS DOC_FAM DOC_FAMILY
10714 .ALIAS PP_FT PP_FONT
10715 .ALIAS DOC_PS DOC_PT_SIZE
10716 .ALIAS DOC_LS DOC_LEAD
10717 .ALIAS PAGENUM PAGENUMBER
10718 .ALIAS PAGINATION PAGINATE
10719 .ALIAS TOC_FAM TOC_FAM
10720 .ALIAS TOC_PS TOC_PT_SIZE
10722 \# HEADER and FOOTER aliases for HDRFTR macros.
10724 .ALIAS ENDNOTES_HEADER_CENTER ENDNOTES_HDRFTR_CENTER
10725 .ALIAS HEADER_FAMILY HDRFTR_FAMILY
10726 .ALIAS HEADER_FAM HDRFTR_FAMILY
10727 .ALIAS HEADER_SIZE HDRFTR_SIZE
10728 .ALIAS HEADER_PLAIN HDRFTR_PLAIN
10729 .ALIAS HEADER_RULE_GAP HDRFTR_RULE_GAP
10730 .ALIAS HEADER_RULE HDRFTR_RULE
10731 .ALIAS HEADER_LEFT HDRFTR_LEFT
10732 .ALIAS HEADER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
10733 .ALIAS HEADER_LEFT_FAM HDRFTR_LEFT_FAMILY
10734 .ALIAS HEADER_LEFT_FONT HDRFTR_LEFT_FONT
10735 .ALIAS HEADER_LEFT_FT HDRFTR_LEFT_FONT
10736 .ALIAS HEADER_LEFT_SIZE HDRFTR_LEFT_SIZE
10737 .ALIAS HEADER_LEFT_PS HDRFTR_LEFT_SIZE
10738 .ALIAS HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS
10739 .ALIAS HEADER_CENTER HDRFTR_CENTER
10740 .ALIAS HEADER_CENTRE HDRFTR_CENTER
10741 .ALIAS HEADER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
10742 .ALIAS HEADER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
10743 .ALIAS HEADER_CENTER_FAM HDRFTR_CENTER_FAMILY
10744 .ALIAS HEADER_CENTRE_FAM HDRFTR_CENTER_FAMILY
10745 .ALIAS HEADER_CENTER_FONT HDRFTR_CENTER_FONT
10746 .ALIAS HEADER_CENTRE_FONT HDRFTR_CENTER_FONT
10747 .ALIAS HEADER_CENTER_FT HDRFTR_CENTER_FONT
10748 .ALIAS HEADER_CENTRE_FT HDRFTR_CENTER_FONT
10749 .ALIAS HEADER_CENTER_SIZE HDRFTR_CENTER_SIZE
10750 .ALIAS HEADER_CENTRE_SIZE HDRFTR_CENTER_SIZE
10751 .ALIAS HEADER_CENTER_PS HDRFTR_CENTER_SIZE
10752 .ALIAS HEADER_CENTRE_PS HDRFTR_CENTER_SIZE
10753 .ALIAS HEADER_CENTER_PAD HDRFTR_CENTER_PAD
10754 .ALIAS HEADER_CENTRE_PAD HDRFTR_CENTER_PAD
10755 .ALIAS HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS
10756 .ALIAS HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS
10757 .ALIAS HEADER_RIGHT HDRFTR_RIGHT
10758 .ALIAS HEADER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
10759 .ALIAS HEADER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
10760 .ALIAS HEADER_RIGHT_FONT HDRFTR_RIGHT_FONT
10761 .ALIAS HEADER_RIGHT_FT HDRFTR_RIGHT_FONT
10762 .ALIAS HEADER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
10763 .ALIAS HEADER_RIGHT_PS HDRFTR_RIGHT_SIZE
10764 .ALIAS HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
10765 .ALIAS HEADER_RECTO HDRFTR_RECTO
10766 .ALIAS HEADER_VERSO HDRFTR_VERSO
10767 .ALIAS ENDNOTES_FOOTER_CENTER ENDNOTES_HDRFTR_CENTER
10768 .ALIAS FOOTER_FAMILY HDRFTR_FAMILY
10769 .ALIAS FOOTER_FAM HDRFTR_FAMILY
10770 .ALIAS FOOTER_SIZE HDRFTR_SIZE
10771 .ALIAS FOOTER_PLAIN HDRFTR_PLAIN
10772 .ALIAS FOOTER_RULE_GAP HDRFTR_RULE_GAP
10773 .ALIAS FOOTER_RULE HDRFTR_RULE
10774 .ALIAS FOOTER_LEFT HDRFTR_LEFT
10775 .ALIAS FOOTER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
10776 .ALIAS FOOTER_LEFT_FAM HDRFTR_LEFT_FAMILY
10777 .ALIAS FOOTER_LEFT_FONT HDRFTR_LEFT_FONT
10778 .ALIAS FOOTER_LEFT_FT HDRFTR_LEFT_FONT
10779 .ALIAS FOOTER_LEFT_SIZE HDRFTR_LEFT_SIZE
10780 .ALIAS FOOTER_LEFT_PS HDRFTR_LEFT_SIZE
10781 .ALIAS FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS
10782 .ALIAS FOOTER_CENTER HDRFTR_CENTER
10783 .ALIAS FOOTER_CENTRE HDRFTR_CENTER
10784 .ALIAS FOOTER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
10785 .ALIAS FOOTER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
10786 .ALIAS FOOTER_CENTER_FAM HDRFTR_CENTER_FAMILY
10787 .ALIAS FOOTER_CENTRE_FAM HDRFTR_CENTER_FAMILY
10788 .ALIAS FOOTER_CENTER_FONT HDRFTR_CENTER_FONT
10789 .ALIAS FOOTER_CENTRE_FONT HDRFTR_CENTER_FONT
10790 .ALIAS FOOTER_CENTER_FT HDRFTR_CENTER_FONT
10791 .ALIAS FOOTER_CENTRE_FT HDRFTR_CENTER_FONT
10792 .ALIAS FOOTER_CENTER_SIZE HDRFTR_CENTER_SIZE
10793 .ALIAS FOOTER_CENTRE_SIZE HDRFTR_CENTER_SIZE
10794 .ALIAS FOOTER_CENTER_PAD HDRFTR_CENTER_PAD
10795 .ALIAS FOOTER_CENTRE_PAD HDRFTR_CENTER_PAD
10796 .ALIAS FOOTER_CENTER_PS HDRFTR_CENTER_SIZE
10797 .ALIAS FOOTER_CENTRE_PS HDRFTR_CENTER_SIZE
10798 .ALIAS FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS
10799 .ALIAS FOOTER_CENTRE_CAPS HDRFTR_CENTER_CAPS
10800 .ALIAS FOOTER_RIGHT HDRFTR_RIGHT
10801 .ALIAS FOOTER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
10802 .ALIAS FOOTER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
10803 .ALIAS FOOTER_RIGHT_FONT HDRFTR_RIGHT_FONT
10804 .ALIAS FOOTER_RIGHT_FT HDRFTR_RIGHT_FONT
10805 .ALIAS FOOTER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
10806 .ALIAS FOOTER_RIGHT_PS HDRFTR_RIGHT_SIZE
10807 .ALIAS FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
10808 .ALIAS FOOTER_RECTO HDRFTR_RECTO
10809 .ALIAS FOOTER_VERSO HDRFTR_VERSO
10810 .ALIAS SWITCH_HEADERS SWITCH_HDRFTR
10811 .ALIAS SWITCH_FOOTERS SWITCH_HDRFTR
10815 .ALIAS COL_BREAK COL_NEXT
10816 .ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE