3 .\" Mom -- a typesetting/document-processing macro set for groff.
5 .\" Copyright (C) 2002 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 \# ------------------------------------------------
445 \# ADDITIONAL STRINGS
446 \# ------------------
447 .ds RULE \El'\En(.lu'
450 \# =====================================================================
454 \# AUTOMATIC PAIRWISE KERNING
455 \# --------------------------
457 \# <none> | <anything>
459 \# Turns automatic pairwise kerning on or off.
473 \# INLINE KERNING AND HORIZONTAL MOVEMENT
474 \# --------------------------------------
476 \# Inline kerning provides a simple method for users to adjust the
477 \# amount of space between any two letters. It's predicated on a
478 \# unit of measure "U", which is 1/36 of the current point size as
479 \# returned by \n[.ps]. E.g., if the current point size is 18,
480 \# \n[.ps] returns 18000u, therefore U=500u. Since U remains
481 \# proportional relative to the current point size, the amount
482 \# of kerning between two letters as expressed in Us remains
483 \# visually similar regardless of changes in point size.
485 \# N.B.--the amount of inline kerning supplied by \*[BU#] or
486 \# \*[FU#] is added to or subtracted from any kerning that already
487 \# takes place between two characters when automatic kerning is
490 \# In groff v. 1.17.2, it was not possible to pass arguments to macros that
491 \# were executed with inline escapes, nor thence to evaluate conditional
492 \# expressions. Consequently, each pseudo-escape \[BU#] had to be defined
493 \# separately with ".char".
495 \# As of v. 1.18, one can pass arguments to inline strings/macros,
496 \# hence it is now possible to do \*[BU #] where #, inline, is the desired
497 \# number of kern units. The original .char definitions have been left in
498 \# for backward compatibility with documents created prior to mom-1.1.3c.
502 .ds BU \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
503 .ds FU \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
505 .ds BU1 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
506 .ds BU2 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
507 .ds BU3 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
508 .ds BU4 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
509 .ds BU5 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
510 .ds BU6 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
511 .ds BU7 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
512 .ds BU8 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
513 .ds BU9 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
514 .ds BU10 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
515 .ds BU11 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
516 .ds BU12 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
517 .ds BU13 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
518 .ds BU14 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
519 .ds BU15 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
520 .ds BU16 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
521 .ds BU17 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
522 .ds BU18 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
523 .ds BU19 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
524 .ds BU20 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
525 .ds BU21 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
526 .ds BU22 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
527 .ds BU23 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
528 .ds BU24 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
529 .ds BU25 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
530 .ds BU26 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
531 .ds BU27 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
532 .ds BU28 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
533 .ds BU29 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
534 .ds BU30 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
535 .ds BU31 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
536 .ds BU32 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
537 .ds BU33 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
538 .ds BU34 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
539 .ds BU35 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
540 .ds BU36 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
543 .ds FU1 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
544 .ds FU2 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
545 .ds FU3 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
546 .ds FU4 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
547 .ds FU5 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
548 .ds FU6 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
549 .ds FU7 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
550 .ds FU8 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
551 .ds FU9 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
552 .ds FU10 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
553 .ds FU11 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
554 .ds FU12 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
555 .ds FU13 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
556 .ds FU14 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
557 .ds FU15 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
558 .ds FU16 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
559 .ds FU17 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
560 .ds FU18 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
561 .ds FU19 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
562 .ds FU20 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
563 .ds FU21 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
564 .ds FU22 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
565 .ds FU23 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
566 .ds FU24 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
567 .ds FU25 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
568 .ds FU26 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
569 .ds FU27 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
570 .ds FU28 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
571 .ds FU29 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
572 .ds FU30 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
573 .ds FU31 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
574 .ds FU32 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
575 .ds FU33 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
576 .ds FU34 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
577 .ds FU35 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
578 .ds FU36 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
581 \# *Horizontal movements
582 \# BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
583 \# specified number of points.
584 \# Left in for backward compatibility with mom-1.1.3c, the preferred
585 \# methods for inline horizontal movements are now \*[BCK #<unit>] and
588 .ds BCK \h'-\\$1\\$2'
595 .ds BP1.25 \h'-1.25p'
597 .ds BP1.75 \h'-1.75p'
599 .ds BP2.25 \h'-2.25p'
601 .ds BP2.75 \h'-2.75p'
603 .ds BP3.25 \h'-3.25p'
605 .ds BP3.75 \h'-3.75p'
607 .ds BP4.25 \h'-4.25p'
609 .ds BP4.75 \h'-4.75p'
611 .ds BP5.25 \h'-5.25p'
613 .ds BP5.75 \h'-5.75p'
615 .ds BP6.25 \h'-6.25p'
617 .ds BP6.75 \h'-6.75p'
619 .ds BP7.25 \h'-7.25p'
621 .ds BP7.75 \h'-7.75p'
623 .ds BP8.25 \h'-8.25p'
625 .ds BP8.75 \h'-8.75p'
627 .ds BP9.25 \h'-9.25p'
629 .ds BP9.75 \h'-9.75p'
631 .ds BP10.25 \h'-10.25p'
632 .ds BP10.5 \h'-10.5p'
633 .ds BP10.75 \h'-10.75p'
635 .ds BP11.25 \h'-11.25p'
636 .ds BP11.5 \h'-11.5p'
637 .ds BP11.75 \h'-11.75p'
639 .ds BP12.25 \h'-12.25p'
640 .ds BP12.5 \h'-12.5p'
641 .ds BP12.75 \h'-12.75p'
683 .ds FP10.25 \h'10.25p'
685 .ds FP10.75 \h'10.75p'
687 .ds FP11.25 \h'11.25p'
689 .ds FP11.75 \h'11.75p'
691 .ds FP12.25 \h'12.25p'
693 .ds FP12.75 \h'12.75p'
696 \# WHOLE LINE KERNING (RW and EW)
697 \# -----------------------------
698 \# The line kerning macros are special instances of track kerning,
699 \# used where a complete line needs to be tightened (or relaxed) in
700 \# order to accomodate or remove one or two more characters
701 \# than the default justification permits.
704 \# <amount of overall "kerning" (letter spacing) to apply to the line>
706 \# Invokes .tkf (track kerning) for the current font with
707 \# 1 as both the upper and lower point size limits, so that
708 \# the value entered by the user applies regardless of point
709 \# size. RW ("Reduce Whitespace") reduces the amount of space
710 \# between all characters by an equal amount. EW ("Extra
711 \# Whitespace") increases the amount of space.
713 \# Decimal values are acceptable.
715 \# The groff documentation is a tad confusing about what unit of
716 \# measure is used in track kerning, only that the width of each
717 \# character is increased or decreased by the amount(s) passed as
718 \# arguments to .tkf, and something about linear function of point
719 \# size. In fact, with the way I've put this macro together, it
720 \# doesn't matter. All the user needs to know is that a value
721 \# of one will produce an unacceptably tight or loose line at most
722 \# text point sizes; therefore, effective use of RW and EW is in
723 \# the fractional range below 1 (e.g. .25, .5). Given that RW
724 \# and EW are for massaging type, a certain amount of
725 \# experimentation and previewing is expected and necessary.
727 \# \n(.f holds the current font number, which is acceptable to .tkf.
729 \# RW and EW must be reset to 0 to cancel their effect on
730 \# subsequent output lines.
733 . if \\n[#BR_AT_LINE_KERN] \{ .br \}
734 . tkf 1 1 -\\$1 1 -\\$1
735 . tkf 2 1 -\\$1 1 -\\$1
736 . tkf 3 1 -\\$1 1 -\\$1
737 . tkf 4 1 -\\$1 1 -\\$1
742 . if \\n[#BR_AT_LINE_KERN] \{ .br \}
743 . tkf 1 1 \\$1 1 \\$1
744 . tkf 2 1 \\$1 1 \\$1
745 . tkf 3 1 \\$1 1 \\$1
746 . tkf 4 1 \\$1 1 \\$1
750 \# BREAK AT LINE KERN
751 \# ------------------
755 \# Enables/disables .br's before .RW and .EW
757 \# Mostly, users will want .br's before any kind of line kerning, but
758 \# there may be cases where they don't. BR_BEFORE_LINE_KERN is off by
759 \# default and must be invoked explicitly.
761 .MAC BR_AT_LINE_KERN END
762 . ie '\\$1'' \{ .nr #BR_AT_LINE_KERN 1 \}
763 . el \{ .rr #BR_AT_LINE_KERN \}
766 \# =====================================================================
773 \# <none> | <anything> | DEFAULT
775 \# LINES <#> | MARGIN <#> | SPACE <#>
777 \# Turns auto hyphenation on or off, resets the hyphenation style
778 \# to default, or permits the setting of various hyphenation
781 \# HY ON defaults to .hy 14, i.e. no hyphens after the
782 \# first two or before the last two characters of a word, and
783 \# no hyphenation of the last line prior to a trap (e.g.,
784 \# at the bottom of a page).
786 \# HY DEFAULT resets the hyphenation style to .hy 14 (see
787 \# above) if that behaviour is desired after changes have been
788 \# made to LINES, MARGIN, or SPACE.
790 \# HY LINES <#> sets the number of allowable consecutive hyphenated lines.
792 \# HY MARGIN <#> sets the amount of space (ipPcm) allowed at the end
793 \# of a line in QUAD mode before hyphenation is tripped (e.g. if there's
794 \# only 6 points left, groff won't try to hyphenate the next word).
796 \# HY SPACE sets the amount of extra interword space (ipPcm) that can
797 \# be added in JUSTIFY mode to prevent a line from being hyphenated.
805 . if !'\\$1'LINES' \{\
809 . if !'\\$1'MARGIN' \{\
813 . if !'\\$1'SPACE' \{\
817 . if !'\\$1'DEFAULT' \{\
821 . if '\\$1'LINES' \{ .hlm \\$2 \}
822 . if '\\$1'MARGIN' \{ .hym \\$2 \}
823 . if '\\$1'SPACE' \{ .hys \\$2 \}
824 . if '\\$1'DEFAULT' \{\
833 \# HYPHENATION PARAMETERS
834 \# ----------------------
836 \# <# of lines> | <size of margin> | <amount of interword space>
838 \# Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
847 \# =====================================================================
849 \# +++VERTICAL SPACING+++
854 \# <user supplied lead to advance below current baseline>
856 \# Creates or modifies register #ALD. Adds user supplied lead
857 \# below current baseline.
859 \# Requires unit of measure ipPcmv.
870 \# <user supplied lead to reverse above current baseline>
872 \# Creates or modifies register #RLD. Reverses user supplied
873 \# lead above current baseline.
875 \# Requires unit of measure ipPcmv.
884 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding \*[RLD]
885 \# forms have been left in for backward compatibility with documents
886 \# created using mom-1.1.3c or earlier. The prefered methods of advancing
887 \# and reversing on the page inline are \*[UP #<unit>] and \*[DOWN #<unit>].
889 .ds DOWN \v'\\$1\\$2'
896 .ds ALD1.25 \v'1.25p'
898 .ds ALD1.75 \v'1.75p'
900 .ds ALD2.25 \v'2.25p'
902 .ds ALD2.75 \v'2.75p'
904 .ds ALD3.25 \v'3.25p'
906 .ds ALD3.75 \v'3.75p'
908 .ds ALD4.25 \v'4.25p'
910 .ds ALD4.75 \v'4.75p'
912 .ds ALD5.25 \v'5.25p'
914 .ds ALD5.75 \v'5.75p'
916 .ds ALD6.25 \v'6.25p'
918 .ds ALD6.75 \v'6.75p'
920 .ds ALD7.25 \v'7.25p'
922 .ds ALD7.75 \v'7.75p'
924 .ds ALD8.25 \v'8.25p'
926 .ds ALD8.75 \v'8.75p'
928 .ds ALD9.25 \v'9.25p'
930 .ds ALD9.75 \v'9.75p'
932 .ds ALD10.25 \v'10.25p'
933 .ds ALD10.5 \v'10.5p'
934 .ds ALD10.75 \v'10.75p'
936 .ds ALD11.25 \v'11.25p'
937 .ds ALD11.5 \v'11.5p'
938 .ds ALD11.75 \v'11.75p'
940 .ds ALD12.25 \v'12.5p'
941 .ds ALD12.5 \v'12.5p'
942 .ds ALD12.75 \v'12.75p'
948 .ds RLD1.25 \v'-1.25p'
950 .ds RLD1.75 \v'-1.75p'
952 .ds RLD2.25 \v'-2.25p'
954 .ds RLD2.75 \v'-2.75p'
956 .ds RLD3.25 \v'-3.25p'
958 .ds RLD3.75 \v'-3.75p'
960 .ds RLD4.25 \v'-4.25p'
962 .ds RLD4.75 \v'-4.75p'
964 .ds RLD5.25 \v'-5.25p'
966 .ds RLD5.75 \v'-5.75p'
968 .ds RLD6.25 \v'-6.25p'
970 .ds RLD6.75 \v'-6.75p'
972 .ds RLD7.25 \v'-7.25p'
974 .ds RLD7.75 \v'-7.75p'
976 .ds RLD8.25 \v'-8.25p'
978 .ds RLD8.75 \v'-8.75p'
980 .ds RLD9.25 \v'-9.25p'
982 .ds RLD9.75 \v'-9.75p'
984 .ds RLD10.25 \v'-10.25p'
985 .ds RLD10.5 \v'-10.5p'
986 .ds RLD10.75 \v'-10.75p'
988 .ds RLD11.25 \v'-11.25p'
989 .ds RLD11.5 \v'-11.5p'
990 .ds RLD11.75 \v'-11.75p'
992 .ds RLD12.25 \v'-12.5p'
993 .ds RLD12.5 \v'-12.5p'
994 .ds RLD12.75 \v'-12.75p'
996 \# =====================================================================
1000 \# AUTOMATIC LIGATURES
1001 \# -------------------
1003 \# <none> | <anything>
1005 \# Turns automatic ligature generation on or off.
1007 \# Ligatures may be supplied manually with \(fi, \(fl, etc.
1024 \# <none> | <anything>
1026 \# Turns smartquotes on or off.
1028 \# The " character is read outside the macro when mom is
1029 \# processed. The strings for open/close ($QUOTE#) are then
1030 \# defined in the macro. \N'34' is the ASCII code for ". If
1031 \# incompatibilities arise, find the code for " that applies
1032 \# to your system and plug in that code instead.
1034 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1036 .MAC SMARTQUOTES END
1041 . nr #SMART_QUOTES 1
1044 . ds $QUOTE0 \\N'34'
1045 . ds $QUOTE1 \\N'34'
1046 . nr #SMART_QUOTES 0
1053 \# =====================================================================
1055 \# +++LINE BREAKS+++
1062 \# Breaks a line without advancing.
1064 \# EL is the mnemonic used on older, dedicated typesetting machines
1065 \# to indicate "process the line, then return to the left margin
1066 \# without advancing the galley medium." It stands for End Line.
1068 \# Sadly, EL is only a fake. It will work in all instances EXCEPT
1069 \# when the line to be EL'd is the last line before a footer trap.
1070 \# Use TRAP OFF/TRAP to circumvent this.
1077 \# =====================================================================
1079 \# +++FILLING/QUADDING/JUSTIFYING+++
1086 \# Turns fill on and sets .ad to b.
1088 \# Justifies text left and right.
1091 . if \\n[#TAB_ACTIVE]=0 \{\
1093 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1097 . if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1105 \# L | LEFT | R | RIGHT | C | CENTER/CENTRE
1107 \# Turns fill on and sets .ad to l, r, or c.
1109 \# Terminology is a problem here. Some people call quad left
1110 \# left justified, flush left, or flush left/rag right (and the
1111 \# reverse for quad right). Quad center is sometimes called rag
1112 \# both. For our purposes, all "quad" modes mean that groff fill
1116 . ds $QUAD_VALUE \\$1
1117 . if \\n[#TAB_ACTIVE]=0 \{\
1119 . ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1123 . if '\\*[$QUAD_VALUE]'L' \{ .ad l \}
1124 . if '\\*[$QUAD_VALUE]'LEFT' \{ .ad l \}
1125 . if '\\*[$QUAD_VALUE]'R' \{ .ad r \}
1126 . if '\\*[$QUAD_VALUE]'RIGHT' \{ .ad r \}
1127 . if '\\*[$QUAD_VALUE]'C' \{ .ad c \}
1128 . if '\\*[$QUAD_VALUE]'CENTER' \{ .ad c \}
1129 . if '\\*[$QUAD_VALUE]'CENTRE' \{ .ad c \}
1130 . if '\\*[$QUAD_VALUE]'J' \{ .ad b \}
1131 . if '\\*[$QUAD_VALUE]'JUSTIFY' \{ .ad b \}
1136 \# LEFT, RIGHT, AND CENTER
1137 \# -----------------------
1138 \# The purpose of these macros is to allow the user to enter lines
1139 \# of text that will be quadded LRC *without* the user having to
1140 \# enter .BR or .br between lines. For the sake of consistency,
1141 \# all three appear to behave similarly (from the point of view of the user),
1142 \# although the underlying primitives don't. For this reason, LEFT,
1143 \# RIGHT, and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY
1144 \# to restore text to groff fill mode.
1151 \# Turns fill mode off. Allows user to quad lines left without
1152 \# requiring the .BR or .br macro.
1154 \# LEFT simply turns fill off. Lines that exceed the current LL will
1155 \# not be broken, simply continued (indefinitely) until a return is
1156 \# encountered. Note that this behaviour differs from the RIGHT and
1160 . if \\n[#TAB_ACTIVE]=0 \{\
1162 . ds $RESTORE_QUAD_VALUE LEFT
1175 \# Turns fill on. Allows user to quad lines right without
1176 \# requiring the .BR or .br macro.
1178 \# Lines that exceed the current LL will be broken, with the excess
1179 \# text quadded right.
1182 . if \\n[#TAB_ACTIVE]=0 \{\
1184 . ds $RESTORE_QUAD_VALUE RIGHT
1197 \# Turns fill on. Allows user to center lines without
1198 \# requiring the .BR or .br macro.
1200 \# Lines that exceed the current LL will be broken, with the excess
1204 . if \\n[#TAB_ACTIVE]=0 \{\
1205 . ds $RESTORE_QUAD_VALUE CENTER
1212 \# =====================================================================
1216 \# There are two different kinds of tabs available: typesetting tabs
1219 \# Typesetting tabs are set with TAB_SET, which requires a tab number,
1220 \# an indent (offset) from the left margin and a length (optionally
1221 \# with a quad direction and an instruction to fill lines). After tabs
1222 \# are set with TS, they are called with .TAB <#>, where <#>
1223 \# corresponds to the number passed to TAB_SET as a valid tab number.
1225 \# String tabs allow the user to mark off tab positions inline. Tab
1226 \# indents and lengths are calculated from the beginning and end
1227 \# positions of the marks. Up to 19 string tabs may be created,
1228 \# numbered 1-19. Once created, they are called with .TAB <#>,
1229 \# just like typesetting tabs.
1231 \# Setting up string tabs is a two-step procedure. First, the user
1232 \# enters an input line in which s/he wants to mark off string tabs.
1233 \# The beginning of a tab is marked with \*[ST<#>], where <#> is
1234 \# the desired number of the tab. The end of the the tab is marked
1235 \# with \*[ST<#>X]. All ST's must have a matching STX. String tabs
1238 \# Next, the user invokes .ST <#> for every string tab defined, and
1239 \# optionally passes quad information to it. That done, string tabs
1240 \# can be called just like typesetting tabs.
1242 \# String tabs don't preview properly with gxditview. Use gv instead.
1244 \# Strings for string tab inlines
1245 \# ------------------------------
1247 .ds ST1 \Ek[#ST1_OFFSET]
1248 .ds ST2 \Ek[#ST2_OFFSET]
1249 .ds ST3 \Ek[#ST3_OFFSET]
1250 .ds ST4 \Ek[#ST4_OFFSET]
1251 .ds ST5 \Ek[#ST5_OFFSET]
1252 .ds ST6 \Ek[#ST6_OFFSET]
1253 .ds ST7 \Ek[#ST7_OFFSET]
1254 .ds ST8 \Ek[#ST8_OFFSET]
1255 .ds ST9 \Ek[#ST9_OFFSET]
1256 .ds ST10 \Ek[#ST10_OFFSET]
1257 .ds ST11 \Ek[#ST11_OFFSET]
1258 .ds ST12 \Ek[#ST12_OFFSET]
1259 .ds ST13 \Ek[#ST13_OFFSET]
1260 .ds ST14 \Ek[#ST14_OFFSET]
1261 .ds ST15 \Ek[#ST15_OFFSET]
1262 .ds ST16 \Ek[#ST16_OFFSET]
1263 .ds ST17 \Ek[#ST17_OFFSET]
1264 .ds ST18 \Ek[#ST18_OFFSET]
1265 .ds ST19 \Ek[#ST19_OFFSET]
1266 .ds ST1X \Ek[#ST1_MARK]
1267 .ds ST2X \Ek[#ST2_MARK]
1268 .ds ST3X \Ek[#ST3_MARK]
1269 .ds ST4X \Ek[#ST4_MARK]
1270 .ds ST5X \Ek[#ST5_MARK]
1271 .ds ST6X \Ek[#ST6_MARK]
1272 .ds ST7X \Ek[#ST7_MARK]
1273 .ds ST8X \Ek[#ST8_MARK]
1274 .ds ST9X \Ek[#ST9_MARK]
1275 .ds ST10X \Ek[#ST10_MARK]
1276 .ds ST11X \Ek[#ST11_MARK]
1277 .ds ST12X \Ek[#ST12_MARK]
1278 .ds ST13X \Ek[#ST13_MARK]
1279 .ds ST14X \Ek[#ST14_MARK]
1280 .ds ST15X \Ek[#ST15_MARK]
1281 .ds ST16X \Ek[#ST16_MARK]
1282 .ds ST17X \Ek[#ST17_MARK]
1283 .ds ST18X \Ek[#ST18_MARK]
1284 .ds ST19X \Ek[#ST19_MARK]
1287 \# QUAD AND SET STRING TABS
1288 \# ------------------------
1290 \# <stringtab number> L | R | C | J [QUAD]
1292 \# Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1293 \# tab based on the collected information.
1295 \# Like TS, ST invoked without a quad direction will default to LEFT.
1296 \# If lines should be filled and quadded, use the optional argument QUAD.
1297 \# N.B. -- indents *must* be turned off before setting string tabs
1301 . ds $ST\\$1_QUAD_DIR \\$2
1302 . if \\n[#NUM_ARGS]=3 \{\
1303 . ds $ST\\$1_FILL QUAD
1305 . nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1306 . ie \\n[#IN_TAB] \{\
1307 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1310 . TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1318 \# <#> ident(ipPcm) length(ipPcm) [L | R | C | J [QUAD]]
1320 \# Creates macros TAB<#> and TAB <#>, where # is any arbitrary number.
1321 \# TAB# is a typesetting tab (i.e. a tab defined as an indent
1322 \# from the page left offset plus a line length.)
1324 \# <#> = arbitrary digit to identify the tab
1325 \# indent = indent from left margin; unit of measure required
1326 \# length = length of tab (unit of measure required; can be
1327 \# \w'<string>'u--if more than one word in string, surround
1328 \# with double quotes "\w'<three word string>'"
1329 \# LRCJ = quad for tab (left, right, center, justified)
1330 \# If option QUAD afterwards is not given, quad is line for line
1331 \# (no fill mode), meaning that there's no need for .BR or .br
1333 \# QUAD = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1336 \# N.B. -- indents *must* be turned off before setting tabs
1340 \# .TAB_SET 1 2P+6p 12P C
1342 \# means "create a tab numbered 1 that starts 2 picas and 6 points from
1343 \# the left margin, is 12 picas long, and centre each input line."
1345 \# .TAB_SET 1 2P+6P 12P C QUAD
1347 \# means exactly the same thing, except that input lines are joined and
1348 \# the area delimted by the tab filled with centered text.
1350 \# TAB <#> can be called at any time after being set.
1352 \# Tabs are NOT columnar in behaviour. If the text inside a
1353 \# tab runs to several lines, when you call the next tab a break
1354 \# occurs, meaning that the new tab starts one line below the last
1355 \# line in the previous tab. For columnar behaviour, you must
1356 \# use the multi-column macros in addition to tabs.
1358 \# If you want tabs to line up bottom-line to bottom-line (most likely
1359 \# single line tabs), use .TN (provided the tabs are numbered sequentially).
1360 \# Otherwise, you must use .EL then .TAB # if you want them to align.
1362 \# If you want to reset tabs, you must use .TQ before .TAB_SET.
1364 \# Note that indents are turned off automatically whenever a new
1365 \# tab is called with TAB #.
1367 \# Tabs themselves are user-invoked using the TAB macro with a numeric
1368 \# argument, e.g. TAB 1.
1370 \# Generally, in order not to get confused, it's a good idea
1371 \# to make sure all indents are off before setting tabs.
1375 . nr #TAB_NUMBER \\$1
1376 . ds $CURRENT_TAB \\n[#TAB_NUMBER]
1377 . nr #TAB_OFFSET (\\$2)
1378 . nr #TAB_LENGTH (\\$3)
1379 . MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1383 . nr #CURRENT_TAB \\n[#TAB_NUMBER]
1384 . po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET]u
1385 . nr #ST_OFFSET \\n[#TAB_OFFSET]
1386 . nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1387 . ll \\n[#TAB_LENGTH]u
1389 . ie '\\$5'QUAD' \{\
1390 . if '\\$4'L' \{ .QUAD L \}
1391 . if '\\$4'R' \{ .QUAD R \}
1392 . if '\\$4'C' \{ .QUAD C \}
1393 . if '\\$4'J' \{ .JUSTIFY \}
1396 . if '\\$4'' \{ .LEFT \}
1397 . if '\\$4'L' \{ .LEFT \}
1398 . if '\\$4'R' \{ .RIGHT \}
1399 . if '\\$4'C' \{ .CENTER \}
1400 . if '\\$4'J' \{ .JUSTIFY \}
1410 \# <tab number to tab into>
1412 \# Moves to tab number passed as an argument.
1415 . ds $TAB_NUMBER \\$1
1416 . TAB\\*[$TAB_NUMBER]
1418 . po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET\\*[$TAB_NUMBER]]u
1427 \# Automagically moves to TAB#+1 on the same line as the last
1428 \# line of the previous tab.
1430 \# If the tabs being aligned fall too close to the footer
1431 \# trap, the line entered after .TN will appear on the next page.
1435 . nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1446 \# Sets #TAB_ACTIVE to "0" (off).
1447 \# Resets left margin to value in effect prior to tabs.
1448 \# Resets line length to value in effect prior to tabs.
1449 \# Checks #QUAD to see if we were in flush or quad mode
1450 \# prior to tabs (0=off, 1=on).
1451 \# Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1452 \# in effect prior to tabs.
1454 \# TQ *must* come before setting any new tabs if you want the
1455 \# tabs' indents measured from page left. Otherwise, the tabs'
1456 \# indents are measured from the left margin of the tab you're
1463 . po \\n[#L_MARGIN]u
1464 . ll \\n[#L_LENGTH]u
1467 . ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1468 . el \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1471 . if '\\*[$RESTORE_QUAD_VALUE]'LEFT' \{ .LEFT \}
1472 . if '\\*[$RESTORE_QUAD_VALUE]'RIGHT' \{ .RIGHT \}
1473 . if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1477 \# =====================================================================
1479 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1484 \# <none> | <anything>
1486 \# When on, underlines all letters, words, and digits in a passage,
1487 \# ignoring punctuation and spaces.
1489 \# Only for use when the font family is COURIER, to simulate
1490 \# typewriter-style underlining of italic passages.
1494 . nr #UNDERLINE_ON 1
1521 . char \[`A] _
\b\[`A]
1522 . char \[^A] _
\b\[^A]
1523 . char \['A] _
\b\['A]
1524 . char \[:A] _
\b\[:A]
1525 . char \[oA] _
\b\[oA]
1526 . char \[~A] _
\b\[~A]
1527 . char \[AE] _
\b\[AE]
1528 . char \[`E] _
\b\[`E]
1529 . char \[^E] _
\b\[^E]
1530 . char \['E] _
\b\['E]
1531 . char \[:E] _
\b\[:E]
1532 . char \[`I] _
\b\[`I]
1533 . char \[^I] _
\b\[^I]
1534 . char \['I] _
\b\['I]
1535 . char \[:I] _
\b\[:I]
1536 . char \[`O] _
\b\[`O]
1537 . char \[^O] _
\b\[^O]
1538 . char \['O] _
\b\['O]
1539 . char \[:O] _
\b\[:O]
1540 . char \[~O] _
\b\[~O]
1541 . char \[/O] _
\b\[/O]
1542 . char \[`U] _
\b\[`U]
1543 . char \[^U] _
\b\[^U]
1544 . char \['U] _
\b\['U]
1545 . char \[:U] _
\b\[:U]
1546 . char \[,C] _
\b\[,C]
1547 . char \[-D] _
\b\[-D]
1548 . char \[~N] _
\b\[~N]
1549 . char \[TP] _
\b\[TP]
1550 . char \['Y] _
\b\['Y]
1551 . char \[:Y] _
\b\[:Y]
1578 . char \[`a] _
\b\[`a]
1579 . char \[^a] _
\b\[^a]
1580 . char \['a] _
\b\['a]
1581 . char \[:a] _
\b\[:a]
1582 . char \[oa] _
\b\[oa]
1583 . char \[~a] _
\b\[~a]
1584 . char \[ae] _
\b\[ae]
1585 . char \[`e] _
\b\[`e]
1586 . char \[^e] _
\b\[^e]
1587 . char \['e] _
\b\['e]
1588 . char \[:e] _
\b\[:e]
1589 . char \[`i] _
\b\[`i]
1590 . char \[^i] _
\b\[^i]
1591 . char \['i] _
\b\['i]
1592 . char \[:i] _
\b\[:i]
1593 . char \[`o] _
\b\[`o]
1594 . char \[^o] _
\b\[^o]
1595 . char \['o] _
\b\['o]
1596 . char \[:o] _
\b\[:o]
1597 . char \[~o] _
\b\[~o]
1598 . char \[/o] _
\b\[/o]
1599 . char \[`u] _
\b\[`u]
1600 . char \[^u] _
\b\[^u]
1601 . char \['u] _
\b\['u]
1602 . char \[:u] _
\b\[:u]
1603 . char \[,c] _
\b\[,c]
1604 . char \[Sd] _
\b\[Sd]
1605 . char \[~n] _
\b\[~n]
1606 . char \[Tp] _
\b\[Tp]
1607 . char \['y] _
\b\['y]
1608 . char \[:y] _
\b\[:y]
1609 . char \[ss] _
\b\[ss]
1623 . nr #UNDERLINE_ON 0
1624 . 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 \
1625 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 \
1626 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1627 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1628 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1629 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1630 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1631 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1642 \# Underscores all letters, words, and digits in a passage,
1643 \# ignoring punctuation and spaces.
1645 \# Intended to be called with inline escapes \*[UL] (underline
1646 \# on) and \*[ULX] (underline off). Only works when the font family
1647 \# is COURIER, to simulate typewriter-style underlining of italic
1651 \c\R'#UNDERLINE_ON 1'
1678 . char \[`A] _
\b\[`A]
1679 . char \[^A] _
\b\[^A]
1680 . char \['A] _
\b\['A]
1681 . char \[:A] _
\b\[:A]
1682 . char \[oA] _
\b\[oA]
1683 . char \[~A] _
\b\[~A]
1684 . char \[AE] _
\b\[AE]
1685 . char \[`E] _
\b\[`E]
1686 . char \[^E] _
\b\[^E]
1687 . char \['E] _
\b\['E]
1688 . char \[:E] _
\b\[:E]
1689 . char \[`I] _
\b\[`I]
1690 . char \[^I] _
\b\[^I]
1691 . char \['I] _
\b\['I]
1692 . char \[:I] _
\b\[:I]
1693 . char \[`O] _
\b\[`O]
1694 . char \[^O] _
\b\[^O]
1695 . char \['O] _
\b\['O]
1696 . char \[:O] _
\b\[:O]
1697 . char \[~O] _
\b\[~O]
1698 . char \[/O] _
\b\[/O]
1699 . char \[`U] _
\b\[`U]
1700 . char \[^U] _
\b\[^U]
1701 . char \['U] _
\b\['U]
1702 . char \[:U] _
\b\[:U]
1703 . char \[,C] _
\b\[,C]
1704 . char \[-D] _
\b\[-D]
1705 . char \[~N] _
\b\[~N]
1706 . char \[TP] _
\b\[TP]
1707 . char \['Y] _
\b\['Y]
1708 . char \[:Y] _
\b\[:Y]
1735 . char \[`a] _
\b\[`a]
1736 . char \[^a] _
\b\[^a]
1737 . char \['a] _
\b\['a]
1738 . char \[:a] _
\b\[:a]
1739 . char \[oa] _
\b\[oa]
1740 . char \[~a] _
\b\[~a]
1741 . char \[ae] _
\b\[ae]
1742 . char \[`e] _
\b\[`e]
1743 . char \[^e] _
\b\[^e]
1744 . char \['e] _
\b\['e]
1745 . char \[:e] _
\b\[:e]
1746 . char \[`i] _
\b\[`i]
1747 . char \[^i] _
\b\[^i]
1748 . char \['i] _
\b\['i]
1749 . char \[:i] _
\b\[:i]
1750 . char \[`o] _
\b\[`o]
1751 . char \[^o] _
\b\[^o]
1752 . char \['o] _
\b\['o]
1753 . char \[:o] _
\b\[:o]
1754 . char \[~o] _
\b\[~o]
1755 . char \[/o] _
\b\[/o]
1756 . char \[`u] _
\b\[`u]
1757 . char \[^u] _
\b\[^u]
1758 . char \['u] _
\b\['u]
1759 . char \[:u] _
\b\[:u]
1760 . char \[,c] _
\b\[,c]
1761 . char \[Sd] _
\b\[Sd]
1762 . char \[~n] _
\b\[~n]
1763 . char \[Tp] _
\b\[Tp]
1764 . char \['y] _
\b\['y]
1765 . char \[:y] _
\b\[:y]
1766 . char \[ss] _
\b\[ss]
1782 \c\R'#UNDERLINE_ON 0'
1783 . 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 \
1784 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 \
1785 \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1786 \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1787 \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1788 \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1789 \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1790 \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1798 \# [points below baseline] "text"
1800 \# Places an underscore 2 points under the string if no lead given,
1801 \# otherwise places underscore under string by user specified amount.
1803 \# When using this macro, the string to be underscored must begin
1804 \# with double-quotes ("), regardless of whether it's the sole
1805 \# argument or the second.
1807 \# .UNDERSCORE "Text to be underscored
1809 \# .UNDERSCORE 2p "Text to be underscored
1811 \# All text is underscored (including punctuation and spaces).
1812 \# This is the primary difference between UNDERLINE and UNDERSCORE,
1813 \# aside from the fact the UNDERLINE only works with Courier.
1815 \# UNDERSCORE does not work across line breaks. Each line of
1816 \# text must be entered separately with UNDERSCORE. If the
1817 \# UNDERSCORE begins in the middle of a line and crosses over a
1818 \# break, the portion before the break must be entered in its own
1819 \# UNDERSCORE, as must the portion that comes after the break.
1822 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1823 . ie \\n[#NUM_ARGS]=1 \{ \\$1\\s(12\\v'+2p'\\l'|0'\\v'-2p'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1824 . el \{ \\$2\\s(12\\v'+(\\$1)'\\l'|0'\\v'-(\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1825 . rr #RESTORE_PT_SIZE
1829 \# DOUBLE UNDERSCORE
1830 \# -----------------
1832 \# [points below baseline] [points distance between rules] "text"
1834 \# Same as UNDERSCORE, except it produces a double underscore. The default
1835 \# distance between the rules is 2 points.
1837 \# The same double-quote requirement as UNDERSCORE.
1839 .MAC UNDERSCORE2 END
1840 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1841 . if \\n[#NUM_ARGS]=1 \{\
1842 . PRINT \\$1\\s(12\\v'+2p'\\l'|0'\\v'+2p'\\l'|0'\\v'-4p'\\s[\\n[#RESTORE_PT_SIZE]u]
1844 . if \\n[#NUM_ARGS]=2 \{\
1845 . PRINT \\$2\\s(12\\v'+\\$1'\\l'|0'\\v'+2p'\\l'|0'\\v'-(2p+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1847 . if \\n[#NUM_ARGS]=3 \{\
1848 . PRINT \\$3\\s(12\\v'+\\$1'\\l'|0'\\v'+\\$2'\\l'|0'\\v'-(\\$2+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1850 . rr #RESTORE_PT_SIZE
1854 \# SUPERSCRIPT INLINES
1855 \# -------------------
1857 \# Prints everything after invocation as superscript.
1859 \# \*[SUP] and \*[SUPX] turn superscript on and off respectively.
1860 \# If running type is pseudo-condensed/expanded, invoke the superscript
1861 \# strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
1862 \# and \*[EXTSUPX] respectively.
1865 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1866 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1867 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]
1869 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'
1872 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1873 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1874 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
1876 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
1879 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1880 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1881 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
1883 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
1892 \# <number of degrees> | RESET
1894 \# Modifies register #DEGREES for use with \*[SLANT], or resets
1895 \# it to the default. Defines string \*[SLANTX]
1897 \# \*[SLANT] permits pseudo-italicizing of a font in cases where
1898 \# no italic font exists in a particular family.
1900 \# Default # of degrees is 15.
1902 \# Do not use unit of measure with arg to SETSLANT.
1904 \# It may be necessary to adjust the spacing on either side of
1905 \# [SLANT] and [SLANTX].
1907 \# In docs, SLANT carries over from para to para.
1910 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1911 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1914 . ie '\\$1'RESET' \{\
1916 . if \\n[#PRINT_STYLE]=1 \{\
1917 . if \\n[#UNDERLINE_SLANT] \{ .return \}
1919 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1923 . if \\n[#PRINT_STYLE]=1 \{\
1924 . if \\n[#UNDERLINE_SLANT] \{ .return \}
1926 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1928 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1938 \# <amount of emboldening> | RESET
1940 \# Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
1941 \# it to the default 700 units.
1943 \# \*[BOLDER] allows pseudo-emboldening of a font where no bold
1944 \# font exists in a particular family.
1946 \# Default for SETBOLDER is 700 units. Do not use unit of measure
1947 \# with arg to SETBOLDER.
1949 .nr #BOLDER_UNITS 700
1952 . if \\n[#IGNORE]=1 \{ .return \}
1953 . ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
1954 . el \{ .nr #BOLDER_UNITS \\$1 \}
1960 .bd \\n(.f \\n[#BOLDER_UNITS]
1969 \# +++CONDENSE/EXTEND+++
1974 \# <percentage to condense/expand type size>
1976 \# Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
1977 \# new point size (for character width) from arg, and defines string
1978 \# COND or EXT, which set the type size to the new character width,
1979 \# and sets the height of type to the value stored in CURRENT_PT_SIZE
1981 \# CONDENSE_OR_EXTEND is invoked from the aliases
1982 \# CONDENSE and EXTEND. CONDENSE implies <100, EXTEND
1983 \# implies >100. Do not use a percent sign in the argument.
1985 \# There is no default setting for CONDENSE or EXTEND.
1986 \# 80 is a good approximation of condensed type, 120 is okay
1989 \# The value set by CONDENSE or EXTEND applies to all
1990 \# subsequent \*[COND] or \*[EXT] escapes until a new value is set.
1992 \# \*[COND] or \*[EXT] must be turned off before all changes of point
1993 \# size and reinvoked afterwards (if so desired). This refers to
1994 \# changes of point size via control lines AND with via inlines.
1996 .MAC CONDENSE_OR_EXTEND END
1997 . if '\\$0'CONDENSE' \{\
1998 . ds $COND_PERCENT \\$1
1999 . if \\n[#PRINT_STYLE]=1 \{\
2001 . ds $COND_PERCENT 100
2004 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2006 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2007 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2009 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2010 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2012 . if '\\$0'EXTEND' \{\
2013 . ds $EXT_PERCENT \\$1
2014 . if \\n[#PRINT_STYLE]=1 \{\
2016 . ds $EXT_PERCENT 100
2019 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2021 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2022 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2024 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2025 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2029 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2030 .ds EXTX \ER'#EXTEND 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2033 \# +++PAD LINES+++ (insert space)
2038 \# <character to use for marking pad points>
2040 \# Defines string $PAD_MARKER, used in PAD
2042 \# $PAD_MARKER is normally # (the pound sign).
2045 . ds $PAD_MARKER \\$1
2052 \# "<string of text with padding markers inserted>"
2054 \# Defines and redefines padding character (default=pound sign unless
2055 \# padding character has been set with PAD_MARKER) several times
2056 \# so that when the string is output at the end of the macro, every #
2057 \# has been converted to an equal-sized amount of padding (blank space)
2058 \# on a line. # is equivalent to CompuGraphic's old <IS>.
2060 \# String tabs may be marked off during PAD.
2063 . if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2065 . if !d$PAD_MARKER \{ .ds $PAD_MARKER # \}
2066 . char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2067 . ds $FAMILY_FOR_PAD \\n[.fam]
2068 . nr #FONT_FOR_PAD \\n(.f
2069 . nr #SIZE_FOR_PAD \\n[.ps]
2070 . ds $PAD_STRING \\$1
2071 . as $PAD_STRING \Ekp
2073 . fam \\*[$FAMILY_FOR_PAD]
2074 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2077 . char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2079 . fam \\*[$FAMILY_FOR_PAD]
2080 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2083 . char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2084 . ie \\n[#SILENT] \{\
2086 . fam \\*[$FAMILY_FOR_PAD]
2087 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2092 . fam \\*[$FAMILY_FOR_PAD]
2093 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2096 . if \\n[#FILL_MODE]=1 \{\
2111 \# The leader mechanism is primitive, but it works. Basically,
2112 \# every macro in this set that includes a line length also sets
2113 \# a single groff tab stop at the right hand end of the line.
2114 \# That way, whenever Ctrl-A is invoked (always at the end of
2115 \# an input line), leader of the correct length gets deposited.
2116 \# Ctrl-A is accessed by the string LEADER (i.e. inline, as
2117 \# \*[LEADER]). Leaders within tabs get their length from the
2120 \# SET LEADER CHARACTER
2121 \# --------------------
2123 \# <character to use whenever \*[LEADER] is invoked>
2125 \# Set leader character.
2127 .MAC LEADER_CHARACTER END
2138 \# <family of drop cap>
2140 \# Creates or modifies string $DC_FAM.
2142 .MAC DROPCAP_FAMILY END
2150 \# <font of drop cap>
2152 \# Creates or modifies string $DC_FT.
2154 .MAC DROPCAP_FONT END
2162 \# <width of gutter between drop cap and indented text>
2164 \# Creates or modifies register #DC_GUT.
2166 \# Requires unit of measure. Default is 3p.
2168 .MAC DROPCAP_GUTTER END
2176 \# <+|- # of points to in/decrease point size of drop cap letter>
2178 \# Creates or modifies string $DC_ADJUST.
2180 \# Despite its best efforts, DROPCAP doesn't always get the point
2181 \# size of the drop cap critically perfect. DROPCAP_ADJUST lets
2182 \# the user add or subtract points (or fractions of points) to
2183 \# get the size right.
2185 \# Requires the + or - sign.
2187 .MAC DROPCAP_ADJUST END
2188 . ds $DC_ADJUST \\$1
2195 \# <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2197 \# Calculates point size of dropcap based on # of lines passed as
2198 \# arg 2. Sets indent for text based on dropcap width+gutter.
2199 \# Advances and prints dropcap; reverses and prints indented text
2200 \# to bottom of dropcap, then resets indent to left margin (plus
2201 \# any indent that was in effect prior to invoking DROPCAP).
2203 \# Drop caps put a strain on on resource-challenged systems.
2205 \# Drop caps when using the doc processing macro PP only work with
2206 \# initial paragraphs (i.e. at doc start, or after heads), only when
2207 \# DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2208 \# is TYPESET. If these conditions aren't met, DROPCAPS is silently
2211 \# The COND or EXT argument are processed separately from all
2212 \# other COND or EXT inlines or macros, hence passing COND or
2213 \# EXT has no effect on running type.
2216 . if #IGNORE \{ .return \}
2219 . if \\n[#PRINT_STYLE]=1 \{ .return \}
2220 . if \\n[#PRINT_STYLE]=2 \{\
2221 . if \\n[#PP_STYLE]=2 \{ .return \}
2222 . if \\n[#PP]>1 \{ .return \}
2227 . nr #DC_LINES \\$2-1
2228 . ds $RESTORE_COND \\*[$COND_PERCENT]
2229 . ds $RESTORE_EXT \\*[$EXT_PERCENT]
2230 . if '\\$3'COND' \{ .CONDENSE \\$4 \}
2231 . if '\\$3'EXT' \{ .EXTEND \\$4 \}
2232 . if !r#DC_GUT \{ .nr #DC_GUT (3p) \}
2233 . ds $RESTORE_FAM \\n[.fam]
2234 . nr #RESTORE_FT \\n(.f
2235 . nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2236 . nr #RESTORE_INDENT \\n(.i
2238 . nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2239 . ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2240 . el \{ .FAM \\*[$DC_FAM] \}
2241 . ie !d$DC_FT \{ .FT \\n(.f \}
2242 . el \{ .FT \\*[$DC_FT] \}
2243 . while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2244 . ps \\n[#PT_SIZE]u+100u
2246 . nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2248 . if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2250 . sp \\n[#DC_LINES]v
2251 . ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2252 . el \{ .PRINT \\*[$DROPCAP] \}
2253 . if '\\$3'COND' \{ \E*[COND] \}
2254 . if '\\$3'EXT' \{ \E*[EXT] \}
2255 . ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2256 . el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2257 . if '\\$3'COND' \{ \E*[CONDX]\c \}
2258 . if '\\$3'EXT' \{ \E*[EXTX]\c \}
2260 . FAM \\*[$RESTORE_FAM]
2261 . FT \\n[#RESTORE_FT]
2262 . ps \\n[#RESTORE_PT_SIZE]u
2263 . CONDENSE \\*[$RESTORE_COND]
2264 . EXTEND \\*[$RESTORE_EXT]
2265 . ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2266 . el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2273 . rr #RESTORE_PT_SIZE
2274 . rr #RESTORE_INDENT
2280 .MAC DROPCAP_OFF END
2281 ' in \\n[#RESTORE_INDENT]u
2285 \# =====================================================================
2287 \# +++WORD AND SENTENCE SPACING+++
2289 \# WORD SPACE CONTROL
2290 \# ------------------
2292 \# <+|->wordspace | DEFAULT
2294 \# Increases or decreases interword space by user supplied amount.
2295 \# If DEFAULT, value is set to 12 (groff default).
2297 \# $WS_CONSTANT is the groff default word space.
2298 \# $WS_VAR is the user supplied amount by which to in/decrease word space.
2299 \# $WS is a concatenation of WS_CONSTANT and WS_VAR.
2301 \# Because the user supplied value requires a literal + or - sign,
2302 \# the macro argument is stored in a string.
2304 \# \n[.sss] holds the current sentence space value.
2307 . ds $WS_CONSTANT 12
2309 . ie '\\$1'DEFAULT' \{ .ds $WS_VAR +0 \}
2310 . el \{ .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR]) \}
2311 . ie \\n[.sss]=12 \{ .ss \\*[$WS] 12 \}
2313 . ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
2319 \# SENTENCE SPACE CONTROL
2320 \# ----------------------
2322 \# <+-sentencespace> | 0 | DEFAULT
2324 \# Increases or decreases sentence space by user supplied amount.
2325 \# If 0, sentence spaces are ignored. If DEFAULT, value is
2326 \# set to 12 (groff default).
2328 \# Because the user supplied value requires a literal + or - sign,
2329 \# the macro argument is stored in a string.
2331 \# Sentence space applies only to input where sentences are separated
2332 \# by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
2333 \# Changing .SS when sentences are separated by only one space has
2334 \# no effect on the space between sentences.
2336 \# \n[.ss] holds the current wordspace value.
2337 \# \n[.sss] holds the current sentence space value.
2340 . ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
2342 . ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
2345 . ss \\n[.ss] (0\\*[$SS_VAR])
2351 \# =====================================================================
2355 \# There are five styles of indents: left, right, both, temporary,
2356 \# and hanging. Each is set/invoked with a different macro.
2357 \# Indent macros begin with the letter "I", hence .IL means "indent left,"
2358 \# .IR means "indent right," and so on.
2360 \# The first time any of the indent macros is used, it requires an
2361 \# argument--the size of the indent in ipPcm. The size may also
2362 \# be entered using the \w'#' function--very useful for numbered
2363 \# lists using HI). The unit of measure is required. Subsequent
2364 \# invocations don't require the argument; the indent measure remains the
2365 \# same until it's changed by invoking the macro with an argument again.
2367 \# If no indents are in effect, the arguments passed to indent macros are
2368 \# measured from the left and right margins of the page. If a left indent
2369 \# or a right indent is already in effect, the arguments passed to
2370 \# the indent macros are calculated from the current values; in other words,
2371 \# the arguments are additive. If you quit an indent and later return
2372 \# to it, its value will be the value last in effect, unless you pass
2373 \# it an argument. If you do pass an argument, it is added to the last
2374 \# value in effect, unless you cleared the indent with one of
2389 \# The first .IL 2P indents text 2P from the left margin. The second
2390 \# .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
2391 \# .IQ turns the indent off. The last .IL (which has no argument)
2392 \# takes its value from the total of all arguments passed to .IL (in
2393 \# this case, 2P and 2P), therefore it indents 2P+2P from the left
2394 \# margin, i.e. 4P. If you wanted the last .IL to indent just 2P,
2395 \# you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
2396 \# the last .IL the argument 2P.
2398 \# To reverse the sense of an indent added to an indent, you may use
2401 \# Indents can be turned off individually with ILX, IRX, and IBX.
2402 \# LEFT and RIGHT indents may be combined and manipulated
2403 \# separately, (e.g. you can have an IL of 2P and an IR of 4P
2404 \# operative at the same time, and then change, say, the IL to
2405 \# 4P--thereby left indenting 6P--while the IR remains at 4P.
2407 \# IB automatically turns off IL and IR. They have to be reinvoked
2408 \# again when needed. IL and IR automatically turn IB off; it, too,
2409 \# has to be reinvoked with needed.
2411 \# All indents can be turned off at once with IQ. The ILX, IRX, IBX,
2412 \# and IQ macros simply turn the indents off; the values stored in
2413 \# the respective indent macros (IL, IR, IB) remain in effect. If
2414 \# the user wishes to clear the values, the I<LRB>X macros should be
2415 \# invoked with the single argument CLEAR. IQ CLEAR clears out
2416 \# the values stored for all indent styles.
2418 \# Indents *must* be turned off before settting string tabs
2419 \# inside PAD. Generally, in order not to get confused, it's a
2420 \# good idea to turn all indents off before setting any tabs.
2422 \# TI and HI are special cases. There's no need to turn them off,
2423 \# since they affect only one line--the first after their
2424 \# invocation. Like the other indent styles, the first time
2425 \# they're invoked, they require a value in iPpcm; each subsequent
2426 \# invocation without an argument will use the same value. To
2427 \# change the value, simply pass a new value. Values for TI and HI
2428 \# are *not* additive.
2430 \# HI presupposes that you already have a left or both indent
2431 \# on. HI will never hang a line outside the left margin of a
2432 \# document. In other words, you must have IL or IB on before you
2439 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2440 . nr #INDENT_STYLE_LEFT 1
2441 . nr #INDENT_ACTIVE 1
2442 . nr #INDENT_LEFT_ACTIVE 1
2445 . in \\n[#L_INDENT]u
2446 . ta \\n(.lu-\\n[#L_INDENT]u
2450 . nr #L_INDENT +(\\$1)
2451 . in \\n[#L_INDENT]u
2452 . ta \\n(.lu-\\n[#L_INDENT]u
2457 \# +++INDENT RIGHT+++
2460 . if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2461 . nr #INDENT_STYLE_RIGHT 1
2462 . nr #INDENT_ACTIVE 1
2463 . nr #INDENT_RIGHT_ACTIVE 1
2466 . ie \\n[#TAB_ACTIVE] \{\
2467 . ll \\n(.lu-\\n[#R_INDENT]u
2468 . ta \\n(.lu-\\n[#L_INDENT]u
2471 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2472 . ta \\n(.lu-\\n[#L_INDENT]u
2477 . nr #R_INDENT +(\\$1)
2478 . ie \\n[#TAB_ACTIVE] \{\
2479 . ll \\n(.lu-\\n[#R_INDENT]u
2480 . ta \\n(.lu-\\n[#L_INDENT]u
2483 . ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2484 . ta \\n(.lu-\\n[#L_INDENT]u
2490 \# +++INDENT BOTH+++
2493 . if \\n[#INDENT_STYLE_LEFT] \{ .ILX \}
2494 . if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
2495 . nr #INDENT_STYLE_BOTH 1
2496 . nr #INDENT_ACTIVE 1
2497 . nr #INDENT_BOTH_ACTIVE 1
2500 . in \\n[#BL_INDENT]u
2501 . ie \\n[#TAB_ACTIVE] \{\
2502 . ll \\n(.lu-\\n[#BR_INDENT]u
2503 . ta \\n(.lu-\\n[#BR_INDENT]u
2506 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2507 . ta \\n(.lu-\\n[#BR_INDENT]u
2512 . nr #BL_INDENT (\\n[#INDENT]+\\$1)
2513 . ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
2514 . el \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
2515 . ie \\n[#TAB_ACTIVE] \{\
2516 . in \\n[#BL_INDENT]u
2517 . ll \\n(.lu-\\n[#BR_INDENT]u
2518 . ta \\n(.lu-\\n[#BL_INDENT]u
2521 . in \\n[#BL_INDENT]u
2522 . ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2523 . ta \\n(.lu-\\n[#BR_INDENT]u
2529 \# +++TEMPORARY INDENT+++
2534 . ti \\n[#T_INDENT]u
2535 . if \\n[#INDENT_LEFT_ACTIVE] \{\
2536 . ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
2538 . if \\n[#INDENT_BOTH_ACTIVE] \{\
2539 . ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
2543 . nr #T_INDENT (\\$1)
2544 . ti \\n[#T_INDENT]u
2549 \# +++HANGING INDENT+++
2552 . ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
2554 . nr #HL_INDENT (\\$1)
2555 . ti -\\n[#HL_INDENT]u
2560 \# +++INDENTS OFF+++
2565 . rr #INDENT_LEFT_ACTIVE
2566 . if '\\$1'CLEAR' \{\
2568 . rr #INDENT_STYLE_LEFT
2575 . rr #INDENT_RIGHT_ACTIVE
2576 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2578 . ie \\n[#COLUMNS] \{\
2579 . ll \\n[#COL_L_LENGTH]u
2583 . ll \\n[#L_LENGTH]u
2587 . if '\\$1'CLEAR' \{\
2589 . rr #INDENT_STYLE_RIGHT
2597 . rr #INDENT_BOTH_ACTIVE
2598 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2600 . ie \\n[#COLUMNS] \{\
2601 . ll \\n[#COL_L_LENGTH]u
2605 . ll \\n[#L_LENGTH]u
2609 . if '\\$1'CLEAR' \{\
2612 . rr #INDENT_STYLE_BOTH
2619 . if !\\n[#IX_WARN] \{\
2620 . tm1 "[mom]: Use of .IX is now deprecated. Use .IQ instead.
2621 . tm1 " .IX will continue to behave as before, but to
2622 . tm1 " avoid this message, please update your document.
2628 . rr #INDENT_LEFT_ACTIVE
2629 . rr #INDENT_RIGHT_ACTIVE
2630 . rr #INDENT_BOTH_ACTIVE
2631 . if \\n[#INDENT_STYLE_RIGHT] \{\
2632 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2634 . ie \\n[#COLUMNS] \{\
2635 . ll \\n[#COL_L_LENGTH]u
2639 . ll \\n[#L_LENGTH]u
2644 . if \\n[#INDENT_STYLE_BOTH] \{\
2645 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2647 . ie \\n[#COLUMNS] \{\
2648 . ll \\n[#COL_L_LENGTH]u
2652 . ll \\n[#L_LENGTH]u
2657 . if '\\$1'CLEAR' \{\
2658 . if \\n[#INDENT_STYLE_RIGHT] \{\
2659 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2661 . ie \\n[#COLUMNS] \{\
2662 . ll \\n[#COL_L_LENGTH]u
2666 . ll \\n[#L_LENGTH]u
2671 . if \\n[#INDENT_STYLE_BOTH] \{\
2672 . ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2674 . ie \\n[#COLUMNS] \{\
2675 . ll \\n[#COL_L_LENGTH]u
2679 . ll \\n[#L_LENGTH]u
2690 . rr #INDENT_STYLE_LEFT
2691 . rr #INDENT_STYLE_RIGHT
2692 . rr #INDENT_STYLE_BOTH
2697 \# =====================================================================
2699 \# +++MULTIPLE COLUMNS+++
2701 \# MULTIPLE COLUMNS ON
2702 \# -------------------
2706 \# Marks the top of a column set
2712 \# MULTIPLE COLUMN RETURN
2713 \# ----------------------
2717 \# Returns to the top of a column set
2723 \# MULTIPLE COLUMNS OFF
2724 \# --------------------
2726 \# <none> | <lead to advance beneath bottom of deepest column>
2728 \# Advances to the end of a column set
2730 \# With no argument, advances to the next baseline (at the current
2731 \# leading value) beneath the longest column. With an argument
2732 \# (which requires a unit of measure), advances arg distance
2733 \# beneath the baseline of the deepest column. If the argument
2734 \# is zero, advances to the baseline of the deepest column.
2742 . nr #MCX_ALD (\\$1)
2744 . ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
2745 . el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
2746 . rr #MCX_ALD (\\$1)
2750 \# =====================================================================
2752 \# +++TYPESETTING SUPPORT MACROS+++
2759 \# Enables/disables traps.
2761 \# EL and TN don't function as advertised on the last line before a
2762 \# trap (when they break the preceding line, they spring the trap, and
2763 \# groff won't back up to the line preceding the trap). TRAP is a kludge
2764 \# to get EL and TN work properly on last lines. The user simply enloses
2765 \# the offending lines in TRAP OFF/TRAP.
2768 . ie '\\$1'' \{ .vpt 1 \}
2776 \# <none> | <anything>
2778 \# Diverts text so that it doesn't print, or turns to function off.
2780 \# Useful for setting up autotabs where you don't want the line with
2781 \# the tab marks to print.
2783 \# Also aliased as COMMENT, in case user wants to input a batch of
2784 \# text that doesn't print.
2788 . if \\n[#QUAD] \{ .br \}
2789 . ie '\\$1'' \{ .di NO_FLASH \}
2803 \# Prints anything. A macro that helps keep my code nicely indented.
2813 \# <none> | <anything>
2815 \# Converts text to caps, or, if OFF, reverts to normal caps/lc.
2819 . tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
2854 . tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
2895 \# Gets cap-height, x-height, and descender depth of the
2896 \# current font at the current point size.
2898 \# The routine is diverted so it remains invisible to output.
2902 E\\R'#CAP_HEIGHT \\n[.cht]'
2903 e\\R'#X_HEIGHT \\n[.cht]'
2904 y\\R'#DESCENDER \\n[.cdp]'
2909 \# =====================================================================
2911 \# +++TYPESETTING ALIASES+++
2913 .ALIAS CENTRE CENTER
2914 .ALIAS COMMENT SILENT
2915 .ALIAS CONDENSE CONDENSE_OR_EXTEND
2916 .ALIAS EXTEND CONDENSE_OR_EXTEND
2919 .ALIAS HYPHENATION HY
2921 .ALIAS LIG LIGATURES
2926 .ALIAS PADMARKER PAD_MARKER
2927 .ALIAS TABSET TAB_SET
2929 .ALIAS UNDERSCORE_2 UNDERSCORE2
2932 \# ====================================================================
2934 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
2935 \# ===============================================
2937 \# +++PAGE DIMENSIONS+++
2942 \# LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
2944 \# Sets up margins for different paper sizes.
2948 . if '\\*[$PAPER]'LETTER' \{\
2952 . if '\\*[$PAPER]'LEGAL' \{\
2956 . if '\\*[$PAPER]'STATEMENT' \{\
2960 . if '\\*[$PAPER]'TABLOID' \{\
2964 . if '\\*[$PAPER]'LEDGER' \{\
2968 . if '\\*[$PAPER]'FOLIO' \{\
2972 . if '\\*[$PAPER]'QUARTO' \{\
2976 . if '\\*[$PAPER]'10x14' \{\
2980 . if '\\*[$PAPER]'EXECUTIVE' \{\
2984 . if '\\*[$PAPER]'A3' \{\
2988 . if '\\*[$PAPER]'A4' \{\
2992 . if '\\*[$PAPER]'A5' \{\
2996 . if '\\*[$PAPER]'B4' \{\
3000 . if '\\*[$PAPER]'B5' \{\
3004 . if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
3005 . if !r#R_MARGIN \{ .R_MARGIN 1i \}
3009 \# ====================================================================
3011 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
3016 \# TYPESET | TYPEWRITE [SINGLESPACE]
3018 \# Sets type specs for typewriter-style or typeset output.
3020 \# Number registers: TYPEWRITE=1, TYPESET=2.
3023 . if !d$PAPER \{ .PAPER LETTER \}
3024 . if '\\$1'TYPEWRITE' \{\
3026 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3027 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3031 . ie '\\$2'SINGLESPACE' \{\
3032 . nr #SINGLE_SPACE 1
3039 . if !\\n[#PP_INDENT] \{\
3040 . in 3P \"Set indent
3041 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
3042 . in 0 \"Remove indent
3045 . nr #BOLDER_UNITS 0
3055 . nr #IGNORE_COLUMNS 1
3057 . if '\\$1'TYPESET' \{\
3059 . if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3060 . if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3063 . if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
3064 . if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
3072 . if !\\n[#PP_INDENT] \{\
3073 . in 2m \"Set indent
3074 . nr #PP_INDENT \\n(.i \"Read into #PP_INDENT
3075 . in 0 \"Remove indent
3078 . rr #IGNORE_COLUMNS
3083 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
3085 \# ITALIC MEANS ITALIC
3086 \# -------------------
3090 \# Instructs TYPEWRITE to treat italics as italics, whether
3091 \# invoked via control lines or inline.
3093 \# ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
3094 \# hence invoking the one automatically turns off the other.
3096 .MAC ITALIC_MEANS_ITALIC END
3097 . if \\n[#PRINT_STYLE]=1 \{\
3098 . nr #ITALIC_MEANS_ITALIC 1
3099 . rr #UNDERLINE_ITALIC
3115 \# Instructs TYPEWRITE to underline italics, whether invoked
3116 \# via control lines or inline.
3118 \# UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
3119 \# hence invoking the one automatically turns off the other.
3121 \# UNDERLINE_ITALIC is the default for TYPEWRITE.
3123 .MAC UNDERLINE_ITALIC END
3124 . if \\n[#PRINT_STYLE]=1 \{\
3125 . nr #UNDERLINE_ITALIC 1
3126 . rr #ITALIC_MEANS_ITALIC
3140 \# <none> | <anything>
3142 \# Instructs TYPEWRITE to underline occurences of \*[SLANT], or
3143 \# turns feature off.
3145 \# Users may want \*[SLANT] to mean slant in TYPEWRITE, although
3146 \# most of the time, \*[SLANT] most likely means the user wanted
3147 \# italic but didn't have it, ergo the need to tell TYPEWRITE to
3148 \# treat \*[SLANT] as italic (i.e. underlined).
3150 \# UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
3151 \# hence invoking the one automatically turns off the other.
3153 \# UNDERLINE_SLANT is the default for TYPEWRITE.
3155 .MAC UNDERLINE_SLANT END
3156 . if \\n[#PRINT_STYLE]=1 \{\
3157 . rr #SLANT_MEANS_SLANT
3158 . nr #UNDERLINE_SLANT 1
3161 . ds SLANT \ER'#SLANT_ON 1'\E*[UL]
3162 . ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
3167 .MAC SLANT_MEANS_SLANT END
3168 . if \\n[#PRINT_STYLE]=1 \{\
3169 . rr #UNDERLINE_SLANT
3170 . nr #SLANT_MEANS_SLANT 1
3173 . ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
3174 . ds SLANTX \ER'#SLANT_ON 0'\ES'0'
3179 .MAC IGNORE_COLUMNS END
3180 . if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
3184 \# ====================================================================
3186 \# +++COPY STYLE -- DRAFT OR FINAL+++
3193 \# Sets registers that are used to determine what to put
3194 \# in the default header, and how to number pages.
3196 \# DOCTYPE must come before COPYSTYLE.
3199 . ds $COPY_STYLE \\$1
3200 . if '\\*[$COPY_STYLE]'DRAFT' \{\
3202 . if !r#DRAFT \{ .DRAFT 1 \}
3204 . if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2 \}
3205 . if !d$CHAPTER_STRING \{ .CHAPTER_STRING "Chapter" \}
3206 . if !d$DRAFT_STRING \{ .DRAFT_STRING "Draft" \}
3207 . if !d$REVISION_STRING \{ .REVISION_STRING "Rev." \}
3209 . if \\n[#DOC_TYPE]=1 \{\
3210 . ie \\n[#COPY_STYLE]=1 \{\
3211 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3212 . el \{ .PAGENUM_STYLE roman \}
3213 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3214 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3218 . ie !\\n[#REVISION] \{\
3219 . ds $HDRFTR_CENTER \
3220 \\*[$DRAFT_STRING] \\n[#DRAFT]
3223 . ds $HDRFTR_CENTER \
3224 \\*[$DRAFT_STRING] \\n[#DRAFT], \
3225 \\*[$REVISION_STRING] \\n[#REVISION]
3231 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3232 . el \{ .PAGENUM_STYLE DIGIT \}
3233 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{ .ds $HDRFTR_CENTER \}
3237 . if \\n[#DOC_TYPE]=2 \{\
3238 . ie \\n[#COPY_STYLE]=1 \{\
3239 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3240 . el \{ .PAGENUM_STYLE roman \}
3241 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3242 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3243 . ie '\\*[$CHAPTER]'' \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3244 . el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \}
3247 . ie !\\n[#REVISION] \{\
3248 . ie '\\*[$CHAPTER]'' \{\
3249 . ds $HDRFTR_CENTER \
3250 \\*[$CHAPTER_STRING], \
3251 \\*[$DRAFT_STRING] \\n[#DRAFT]
3254 . ds $HDRFTR_CENTER \
3255 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3256 \\*[$DRAFT_STRING] \\n[#DRAFT]
3260 . ie '\\*[$CHAPTER]'' \{\
3262 \\*[$CHAPTER_STRING], \
3263 \\*[$DRAFT_STRING] \\n[#DRAFT], \
3264 \\*[$REVISION_STRING] \\n[#REVISION]
3266 . ds $HDRFTR_CENTER \
3267 \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3268 \\*[$DRAFT_STRING] \\n[#DRAFT], \
3269 \\*[$REVISION_STRING] \\n[#REVISION]
3276 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3277 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3278 . el \{ .PAGENUM_STYLE DIGIT \}
3279 . ie '\\*[$CHAPTER]'' \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \}
3280 . el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3285 . if \\n[#DOC_TYPE]=3 \{\
3286 . ie \\n[#COPY_STYLE]=1 \{\
3287 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3288 . el \{ .PAGENUM_STYLE roman \}
3289 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
3290 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3293 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3294 . ie !\\n[#REVISION] \{\
3295 . ds $HDRFTR_CENTER \
3297 \\*[$DRAFT_STRING] \\n[#DRAFT]
3300 . ds $HDRFTR_CENTER \
3302 \\*[$DRAFT_STRING] \\n[#DRAFT], \
3303 \\*[$REVISION_STRING] \\n[#REVISION]
3309 . if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3310 . ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3311 . el \{ .PAGENUM_STYLE DIGIT \}
3312 . ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3318 \# ====================================================================
3320 \# +++COLLECT DOC INFO -- STRINGS AND NUMBER REGISTERS+++
3323 \# various string/register arguments
3325 \# Collect information about documents.
3327 .MAC TITLE END \"Document title
3332 .MAC SUBTITLE END \"Document sub-title
3337 .MAC CHAPTER END \"If document is a chapter, the chapter number
3342 .MAC DRAFT END \"Draft number
3347 .MAC REVISION END \"Revision number
3352 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
3353 . nr #DRAFT_WITH_PAGENUM 1
3357 .MAC AUTHOR END \"Author. Use "..." with this macro.
3358 . nr #AUTHOR_NUM -1 1
3359 . while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
3360 . ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
3362 . nr #NUM_AUTHORS \\n[#NUM_ARGS]%2 \"Use mod 2 to test if odd or even # of authors
3363 . ie \\n[#NUM_AUTHORS]=1 \{ .nr #AUTHOR_LINES 0 \}
3364 . el \{ .nr #AUTHOR_LINES 1 \}
3368 .MAC PAGENUMBER END \"Page # that appears on page one.
3369 . nr #n%_AT_PAGENUM_SET \\n%
3370 . nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
3371 . rr #n%_AT_PAGENUM_SET
3372 . nr #PAGE_NUM_SET 1
3375 \# ====================================================================
3377 \# +++TYPE OF DOCUMENT+++
3382 \# DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
3384 \# Creates strings and sets registers for document types.
3386 \# Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
3389 . if '\\$1'DEFAULT' \{\
3392 . if '\\$1'CHAPTER' \{\
3395 . if '\\$1'NAMED' \{\
3399 . if '\\$1'LETTER' \{\
3407 . INDENT_FIRST_PARAS
3409 . ds $SUITE \En[#SUITE]
3410 . HEADER_MARGIN 3P+6p
3416 . FOOTER_RIGHT_SIZE +0
3417 . FOOTER_RIGHT ".../\E*[$SUITE]
3418 . FOOTER_ON_FIRST_PAGE
3423 \# +++LETTER MACROS+++
3430 \# Stores date string in string $DATE.
3444 \# Stores "to" info in diversion TO_ADDRESS.
3447 . if !'\\n(.z'' \{ .di \}
3459 \# Stores "from" info in diversion FROM_ADDRESS.
3462 . if !'\\n(.z'' \{ .di \}
3472 \# <greeting string>
3474 \# Stores greeting in string $GREETING.
3477 . if !'\\n(.z'' \{ .di \}
3489 \# Stores greeting in string $CLOSING.
3503 \# Redefines $SUITE to blank so that a suite number doesn't
3504 \# appear at the bottom of letter pages.
3510 \# ====================================================================
3519 \# Sets up defaults if no values are entered prior to START.
3521 \# The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
3522 \# $REVISION_STRING are in the COPYSTYLE macro.
3525 . if !d$PAPER \{ .PAPER LETTER \}
3526 . if !\\n[#DOC_TYPE] \{ .DOCTYPE DEFAULT \}
3527 . if \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3528 . if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
3529 . if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
3530 . if \\n[#DOC_TYPE]=4 \{\
3531 . if !\\n[#USER_SET_L_LENGTH] \{\
3532 . R_MARGIN \\n[#R_MARGIN]u
3533 . rr #USER_SET_L_LENGTH
3535 . if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
3537 . if \\n[#COPY_STYLE]=1 \{\
3541 . if !r#DOC_HEADER \{ .DOCHEADER \}
3542 . if !r#HEADERS_ON \{ .HEADERS \}
3543 . if !r#PAGINATE \{ .PAGINATE \}
3544 . if \\n[#FOOTERS_ON] \{\
3546 . if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
3548 . if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
3549 . if !r#HEADER_GAP \{ .HEADER_GAP 3P \}
3550 . if \\n[#FOOTERS_ON] \{\
3551 . if \\n[#PAGINATE]=0 \{\
3552 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
3555 . if \\n[#HEADERS_ON]=0 \{\
3556 . if \\n[#FOOTERS_ON]=0 \{\
3557 . if !r#T_MARGIN \{ .T_MARGIN 6P \}
3560 . if !r#T_MARGIN \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
3561 . if !r#DOCHEADER_ADVANCE \{ .DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
3562 . if !r#FOOTER_MARGIN \{ .FOOTER_MARGIN 3P \}
3563 . if !r#FOOTER_GAP \{ .FOOTER_GAP 3P \}
3564 . if !r#B_MARGIN \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
3565 . if !r#HDRFTR_RULE_GAP \{\
3566 . if \\n[#HEADERS_ON] \{ .HDRFTR_RULE_GAP 4p \}
3567 . if \\n[#FOOTERS_ON] \{ .HDRFTR_RULE_GAP 4p \}
3569 . if !r#HDRFTR_RULE \{ .HDRFTR_RULE \}
3570 . if !r#PAGE_NUM_SET \{ .PAGENUMBER 1 \}
3571 . ie r#ADJ_DOC_LEAD \{ . \}
3572 . el \{ .DOC_LEAD_ADJUST \}
3573 \# Read in number registers and strings for type parameters
3574 . nr #DOC_L_MARGIN \\n[#L_MARGIN]
3575 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
3576 . nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
3577 . ds $DOC_FAM \\*[$FAMILY]
3578 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
3579 . nr #DOC_LEAD \\n[#LEAD]
3580 . ds $DOC_QUAD \\*[$QUAD_VALUE]
3581 . ds $PP_FT \\*[$FONT]
3586 . nr #FN_COUNT_FOR_COLS 0 1
3588 . RESET_SUBHEAD_NUMBER
3589 . RESET_PARAHEAD_NUMBER
3590 \# General style defaults for both PRINTSTYLEs
3592 . PARA_INDENT \\n[#PP_INDENT]u
3593 . if !d$HDRFTR_FAM \{ .HDRFTR_FAMILY \\*[$DOC_FAM] \}
3594 . if !d$HDRFTR_SIZE_CHANGE \{ .HDRFTR_SIZE +0 \}
3595 . if !d$PAGE_NUM_FAM \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
3596 . if !d$PAGE_NUM_FT \{ .PAGENUM_FONT R \}
3597 . if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE +0 \}
3598 . if !r#PAGE_NUM_POS_SET \{ .PAGENUM_POS BOTTOM CENTER \}
3599 . ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
3600 . if \\n[#PAGE_NUM_HYPHENS]=0 \{ .PAGENUM_HYPHENS OFF \}
3601 . if \\n[#PAGE_NUM_HYPHENS]=1 \{ .PAGENUM_HYPHENS \}
3603 . el \{ .PAGENUM_HYPHENS \}
3604 . if !d$HEAD_QUAD \{ .HEAD_QUAD CENTER \}
3605 . if !r#HEAD_CAPS \{ .HEAD_CAPS \}
3606 . if !r#HEAD_UNDERLINE \{ .HEAD_UNDERLINE \}
3607 . if !d$SH_QUAD \{ .SUBHEAD_QUAD LEFT \}
3608 . if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
3609 . if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
3610 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
3612 . if !d$FN_FAM \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
3613 . if !d$FN_FT \{ .FOOTNOTE_FONT R \}
3614 . if !d$FN_QUAD \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD] \}
3615 . if !r#FN_RULE \{ .FOOTNOTE_RULE \}
3616 . if !r#FN_MARKERS \{ .FOOTNOTE_MARKERS \}
3617 . if !r#FN_MARKER_STYLE \{ .FOOTNOTE_MARKER_STYLE STAR \}
3618 . if !d$EN_FAM \{ .ENDNOTE_FAMILY \\*[$DOC_FAM] \}
3619 . if !d$EN_FN \{ .ENDNOTE_FONT R \}
3620 . if !d$EN_QUAD \{ .ENDNOTE_QUAD \\*[$DOC_QUAD] \}
3621 . if !d$EN_STRING \{ .ENDNOTE_STRING "ENDNOTES" \}
3622 . if !d$EN_STRING_FAM \{ .ENDNOTE_STRING_FAMILY \\*[$DOC_FAM] \}
3623 . if !d$EN_STRING_QUAD \{ .ENDNOTE_STRING_QUAD CENTER \}
3624 . if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2 \}
3625 . if !d$EN_TITLE \{\
3626 . ie \\n[#DOC_TYPE]=2 \{\
3627 . ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
3628 . el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]" \}
3630 . el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
3632 . if !d$EN_TITLE_FAM \{ .ENDNOTE_TITLE_FAM \\*[$DOC_FAM] \}
3633 . if !d$EN_TITLE_QUAD \{ .ENDNOTE_TITLE_QUAD LEFT \}
3634 . if !r#EN_TITLE_UNDERSCORE \{ .ENDNOTE_TITLE_UNDERSCORE \}
3635 . if !d$EN_NUMBER_FAM \{ .ENDNOTE_NUMBER_FAMILY \\*[$DOC_FAM] \}
3636 . if !r#EN_NUMBERS_ALIGN_LEFT \{\
3637 . if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2 \}
3639 \# String defaults for both PRINTSTYLEs
3640 . if !d$ATTRIBUTE_STRING \{ .ATTRIBUTE_STRING "by" \}
3641 . if \\n[#USER_DEF_HDRFTR_LEFT]=0 \{ .ds $HDRFTR_LEFT \\*[$AUTHOR_1] \}
3642 . rr #USER_DEF_HDRFTR_LEFT
3643 . if \\n[#USER_DEF_HDRFTR_RIGHT]=0 \{ .ds $HDRFTR_RIGHT \\*[$TITLE] \}
3644 . rr #USER_DEF_HDRFTR_RIGHT
3645 . if !d$FINIS_STRING \{ .FINIS_STRING "END" \}
3646 \# Defaults for printstyle TYPEWRITE
3647 . if \\n[#PRINT_STYLE]=1 \{\
3648 . if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES \}
3649 . if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF \}
3650 . if !r#Q_OFFSET_VALUE \{ .QUOTE_INDENT 2 \}
3651 . if !r#EPI_OFFSET_VALUE \{ .EPIGRAPH_INDENT 2 \}
3652 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 2p \}
3653 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE +0 \}
3654 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 2i \}
3655 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 6p \}
3656 . if !r#SLANT_MEANS_SLANT \{\
3657 . ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
3658 . el \{ .UNDERLINE_SLANT OFF \}
3660 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3661 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
3663 \# Defaults for printstyle TYPESET
3664 . if \\n[#PRINT_STYLE]=2 \{\
3665 . if !#DOCHEADER_LEAD \{ .DOCHEADER_LEAD +0 \}
3666 . if !d$TITLE_FAM \{ .TITLE_FAMILY \\*[$DOC_FAM] \}
3667 . if !d$TITLE_FT \{ .TITLE_FONT B \}
3668 . if !d$TITLE_SIZE_CHANGE \{\
3669 . ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
3670 . el \{ .TITLE_SIZE +3.5 \}
3672 . if !d$SUBTITLE_FAM \{ .SUBTITLE_FAMILY \\*[$DOC_FAM] \}
3673 . if !d$SUBTITLE_FT \{ .SUBTITLE_FONT R \}
3674 . if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE +0 \}
3675 . if !d$AUTHOR_FAM \{ .AUTHOR_FAMILY \\*[$DOC_FAM] \}
3676 . if !d$AUTHOR_FT \{ .AUTHOR_FONT I \}
3677 . if !d$AUTHOR_SIZE_CHANGE \{ .AUTHOR_SIZE +0 \}
3678 . if !d$DOCTYPE_FAM \{ .DOCTYPE_FAMILY \\*[$DOC_FAM] \}
3679 . if !d$DOCTYPE_FT \{ .DOCTYPE_FONT BI \}
3680 . if !d$DOCTYPE_SIZE_CHANGE \{ .DOCTYPE_SIZE +3 \}
3681 . if !d$HDRFTR_LEFT_FAM \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
3682 . if !d$HDRFTR_LEFT_FT \{ .HDRFTR_LEFT_FONT R \}
3683 . if \\n[#HDRFTR_LEFT_CAPS] \{\
3684 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -2 \}
3686 . if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE -.5 \}
3687 . if !d$HDRFTR_CENTER_FAM \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
3688 . if !d$HDRFTR_CENTER_FT \{ .HDRFTR_CENTER_FONT I \}
3689 . if \\n[#HDRFTR_CENTER_CAPS] \{\
3690 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
3692 . if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5 \}
3693 . if !d$HDRFTR_RIGHT_FAM \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM] \}
3694 . if !d$HDRFTR_RIGHT_FT \{ .HDRFTR_RIGHT_FONT R \}
3695 . if \\n[#HDRFTR_RIGHT_CAPS] \{\
3696 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
3698 . if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -.5 \}
3699 . if !d$HEAD_FAM \{ .HEAD_FAMILY \\*[$DOC_FAM] \}
3700 . if !d$HEAD_FT \{ .HEAD_FONT B \}
3701 . if !d$HEAD_SIZE_CHANGE \{ .HEAD_SIZE +1 \}
3702 . if !r#HEAD_SPACE \{ .HEAD_SPACE \}
3703 . if !d$SH_FAM \{ .SUBHEAD_FAMILY \\*[$DOC_FAM] \}
3704 . if !d$SH_FT \{ .SUBHEAD_FONT B \}
3705 . if !d$SH_SIZE_CHANGE \{ .SUBHEAD_SIZE +.5 \}
3706 . if !d$PH_FAM \{ .PARAHEAD_FAMILY \\*[$DOC_FAM] \}
3707 . if !d$PH_FT \{ .PARAHEAD_FONT BI \}
3708 . if !d$PH_SIZE_CHANGE \{ .PARAHEAD_SIZE -.25 \}
3709 . if !r#PH_INDENT \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3710 . if !d$QUOTE_FAM \{ .QUOTE_FAMILY \\*[$DOC_FAM] \}
3711 . if !d$QUOTE_FT \{ .QUOTE_FONT I \}
3712 . if !d$QUOTE_SIZE_CHANGE \{ .QUOTE_SIZE +0 \}
3713 . if !r#Q_OFFSET_VALUE \{ .QUOTE_INDENT 3 \}
3714 . if !d$BQUOTE_FAM \{ .BLOCKQUOTE_FAMILY \\*[$DOC_FAM] \}
3715 . if !d$BQUOTE_FT \{ .BLOCKQUOTE_FONT R \}
3716 . if !d$BQUOTE_SIZE_CHANGE \{ .BLOCKQUOTE_SIZE -1 \}
3717 . if !d$BQUOTE_QUAD \{ .BLOCKQUOTE_QUAD LEFT \}
3718 . if !d$EPI_FAM \{ .EPIGRAPH_FAMILY \\*[$DOC_FAM] \}
3719 . if !d$EPI_FT \{ .EPIGRAPH_FONT R \}
3720 . if !d$EPI_SIZE_CHANGE \{ .EPIGRAPH_SIZE -1.5 \}
3721 . if !r#EPI_AUTOLEAD \{ .EPIGRAPH_AUTOLEAD 2 \}
3722 . if !d$EPI_QUAD \{ .EPIGRAPH_QUAD \\*[$DOC_QUAD] \}
3723 . if !r#EPI_OFFSET_VALUE \{ .EPIGRAPH_INDENT 3 \}
3724 . if !d$LINEBREAK_CHAR \{ .LINEBREAK_CHAR * 3 3p \}
3725 . if !r#FN_RULE_LENGTH \{ .FOOTNOTE_RULE_LENGTH 4P \}
3726 . if !r#FN_RULE_ADJ \{ .FOOTNOTE_RULE_ADJ 3p \}
3727 . if !d$FN_SIZE_CHANGE \{ .FOOTNOTE_SIZE -2 \}
3728 . if !r#FN_AUTOLEAD \{ .FOOTNOTE_AUTOLEAD 2 \}
3729 . if !r#EN_PS \{ .ENDNOTE_PT_SIZE \\n[#DOC_PT_SIZE]u \}
3730 . if !r#EN_LEAD \{ .ENDNOTE_LEAD 13.5p \}
3731 . if !d$EN_STRING_FT \{ .ENDNOTE_STRING_FONT B \}
3732 . if !d$EN_STRING_SIZE_CHANGE \{ .ENDNOTE_STRING_SIZE +1 \}
3733 . if !d$EN_TITLE_FT \{ .ENDNOTE_TITLE_FONT B \}
3734 . if !d$EN_TITLE_SIZE_CHANGE \{ .ENDNOTE_TITLE_SIZE 0 \}
3735 . if !d$EN_NUMBER_FT \{ .ENDNOTE_NUMBER_FONT B \}
3736 . if !$EN_NUMBER_SIZE_CHANGE \{ .ENDNOTE_NUMBER_SIZE 0 \}
3737 . if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT 1.5m \}
3740 . if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
3743 \# ====================================================================
3745 \# +++START THE DOCUMENT+++
3752 \# Reads in default document style parameters and any parameter
3753 \# the user has changed before issuing START.
3754 \# Using the information gathered in the opening macros,
3755 \# prints appropriate title (or chapter #), subtitle, author
3756 \# and document type (if appropriate).
3758 \# The .PRINT \& (zero-width character) is required to get the
3759 \# subsequent .sp request to work as advertised.
3761 \# The overall document line length, family, and point-size
3762 \# are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
3763 \# use in the HEADER and FOOTER macros.
3766 . if !\\n[#PRINT_STYLE] \{\
3767 . PRINTSTYLE TYPEWRITE
3774 . PRINT "You neglected to enter a PRINTSTYLE"
3776 . ab PRINTSTYLE missing
3780 . if \\n[#COLLATE] \{\
3781 . COPYSTYLE \\*[$COPY_STYLE]
3782 . nr #HEADERS_ON \\n[#HEADER_STATE]
3783 . if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
3784 . sp |\\n[#HEADER_MARGIN]u
3788 . if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
3789 . sp |\\n[#HEADER_MARGIN]u
3793 . rr #PAGINATION_STATE
3795 . ie \\n[#DOC_HEADER]=0 \{\
3797 . if \\n[#DOC_TYPE]=4 \{\
3798 . if !'\\n(.z'' \{ .di \}
3800 . ie r#ADVANCE_FROM_TOP \{ .sp |\\n[#ADVANCE_FROM_TOP]u-1v \}
3801 . el \{ .sp |\\n[#T_MARGIN]u-1v \}
3805 . if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \}
3808 . nr #DOCHEADER_LINES 0 1
3809 . if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u+\\n[#DOCHEADER_LEAD_ADJ]u \}
3810 . nr #DOCHEADER_LEAD \\n[#LEAD]
3812 . if \\n[#DOC_TYPE]=1 \{\
3814 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
3817 . L_MARGIN \\n[#DOC_L_MARGIN]u
3818 . LL \\n[#DOC_L_LENGTH]u
3820 . if \\n[#PRINT_STYLE]=1 \{\
3824 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
3825 . el \{ .vs \\n[#DOC_LEAD]u \}
3827 . if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
3830 . if \\n[#PRINT_STYLE]=2 \{\
3831 . FAMILY \\*[$TITLE_FAM]
3833 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
3834 . LS \\n[#DOCHEADER_LEAD]u
3836 . \\n+[#DOCHEADER_LINES]
3842 . L_MARGIN \\n[#DOC_L_MARGIN]u
3843 . LL \\n[#DOC_L_LENGTH]u
3845 . if !'\\*[$SUBTITLE]'' \{\
3846 . if \\n[#PRINT_STYLE]=1 \{\
3850 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
3851 . el \{ .vs \\n[#DOC_LEAD]u \}
3853 . if \\n[#PRINT_STYLE]=2 \{\
3854 . FAMILY \\*[$SUBTITLE_FAM]
3855 . FT \\*[$SUBTITLE_FT]
3856 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
3857 . LS \\n[#DOCHEADER_LEAD]u
3859 . PRINT \\*[$SUBTITLE]
3860 . \\n+[#DOCHEADER_LINES]
3862 . if '\\*[$SUBTITLE]'' \{\
3863 . if \\n[#PRINT_STYLE]=1 \{\
3864 . ALD \\n[#DOC_LEAD]u
3870 . L_MARGIN \\n[#DOC_L_MARGIN]u
3871 . LL \\n[#DOC_L_LENGTH]u
3873 . if !'\\*[$AUTHOR_1]'' \{\
3874 . if \\n[#PRINT_STYLE]=1 \{\
3878 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
3879 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
3880 . if !d$SUBTITLE \{\
3881 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
3882 . el \{ .ALD \\n[#DOC_LEAD]u*2u \}
3885 . if \\n[#PRINT_STYLE]=2 \{\
3886 . FAMILY \\*[$AUTHOR_FAM]
3887 . FT \\*[$AUTHOR_FT]
3888 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
3889 . LS \\n[#DOCHEADER_LEAD]u
3891 . PRINT \\*[$ATTRIBUTE_STRING]
3892 . \\n+[#DOCHEADER_LINES]
3893 . nr #AUTHORS \\n[#AUTHOR_NUM]
3894 . nr #NEXT_AUTHOR 0 1
3895 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
3896 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
3897 . \\n+[#DOCHEADER_LINES]
3899 . if \\n[#PRINT_STYLE]=1 \{\
3900 . if \\n[#AUTHOR_LINES]=1 \{\
3901 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
3902 . el \{ .RLD \\n[#DOC_LEAD]u \}
3909 . if \\n[#DOC_TYPE]=2 \{\
3911 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
3913 . L_MARGIN \\n[#DOC_L_MARGIN]u
3914 . LL \\n[#DOC_L_LENGTH]u
3917 . if \\n[#PRINT_STYLE]=1 \{\
3921 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
3922 . el \{ .vs \\n[#DOC_LEAD]u \}
3924 . if \\n[#PRINT_STYLE]=2 \{\
3925 . FAMILY \\*[$TITLE_FAM]
3927 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
3928 . LS \\n[#DOC_LEAD]u
3930 . if \\n[#PRINT_STYLE]=1 \{\
3932 . ie '\\*[$CHAPTER]'' \{ .PRINT \\*[$CHAPTER_STRING] \}
3933 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3936 . if \\n[#PRINT_STYLE]=2 \{\
3937 . ie '\\*[$CHAPTER]'' \{ .PRINT \\*[$CHAPTER_STRING] \}
3938 . el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3943 . if \\n[#DOC_TYPE]=3 \{\
3945 . sp |\\n[#DOCHEADER_ADVANCE]u-1v
3948 . L_MARGIN \\n[#DOC_L_MARGIN]u
3949 . LL \\n[#DOC_L_LENGTH]u
3951 . if \\n[#PRINT_STYLE]=1 \{\
3955 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
3956 . el \{ .vs \\n[#DOC_LEAD]u \}
3958 . if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
3961 . if \\n[#PRINT_STYLE]=2 \{\
3962 . FAMILY \\*[$TITLE_FAM]
3964 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
3965 . LS \\n[#DOCHEADER_LEAD]u
3967 . \\n+[#DOCHEADER_LINES]
3973 . L_MARGIN \\n[#DOC_L_MARGIN]u
3974 . LL \\n[#DOC_L_LENGTH]u
3976 . if !'\\*[$SUBTITLE]'' \{\
3977 . if \\n[#PRINT_STYLE]=1 \{\
3981 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
3982 . el \{ .vs \\n[#DOC_LEAD]u \}
3984 . if \\n[#PRINT_STYLE]=2 \{\
3985 . FAMILY \\*[$SUBTITLE_FAM]
3986 . FT \\*[$SUBTITLE_FT]
3987 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
3988 . LS \\n[#DOCHEADER_LEAD]u
3990 . PRINT \\*[$SUBTITLE]
3991 . \\n+[#DOCHEADER_LINES]
3993 . if '\\*[$SUBTITLE]'' \{\
3994 . if \\n[#PRINT_STYLE]=1 \{\
3995 . ALD \\n[#DOC_LEAD]u
4001 . L_MARGIN \\n[#DOC_L_MARGIN]u
4002 . LL \\n[#DOC_L_LENGTH]u
4004 . if !'\\*[$AUTHOR_1]'' \{\
4005 . if \\n[#PRINT_STYLE]=1 \{\
4009 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4010 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
4011 . if !d$SUBTITLE \{\
4012 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4013 . el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4016 . if \\n[#PRINT_STYLE]=2 \{\
4017 . FAMILY \\*[$AUTHOR_FAM]
4018 . FT \\*[$AUTHOR_FT]
4019 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
4020 . LS \\n[#DOCHEADER_LEAD]u
4022 . PRINT \\*[$ATTRIBUTE_STRING]
4023 . \\n+[#DOCHEADER_LINES]
4024 . nr #AUTHORS \\n[#AUTHOR_NUM]
4025 . nr #NEXT_AUTHOR 0 1
4026 . while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4027 . PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4028 . \\n+[#DOCHEADER_LINES]
4030 . if \\n[#PRINT_STYLE]=1 \{\
4031 . if \\n[#AUTHOR_LINES]=1 \{\
4032 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4033 . el \{ .RLD \\n[#DOC_LEAD]u \}
4040 . L_MARGIN \\n[#DOC_L_MARGIN]u
4041 . LL \\n[#DOC_L_LENGTH]u
4043 . if \\n[#PRINT_STYLE]=1 \{\
4047 . vs \\n[#DOC_LEAD]u
4048 . if '\\*[$AUTHOR_1]'' \{\
4049 . ie !d$SUBTITLE \{\
4050 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4051 . el \{ .RLD \\n[#DOC_LEAD]u \}
4054 . ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4055 . el \{ .RLD \\n[#DOC_LEAD]u \}
4058 . ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
4059 . el \{ .ALD \\n[#DOC_LEAD]u \}
4060 . UNDERSCORE2 "\\*[$DOC_TYPE]
4061 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4063 . if \\n[#PRINT_STYLE]=2 \{\
4064 . FAMILY \\*[$DOCTYPE_FAM]
4065 . FT \\*[$DOCTYPE_FT]
4066 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
4067 . LS \\n[#DOCHEADER_LEAD]u
4068 . ALD \\n[#DOCHEADER_LEAD]u
4069 . \\n+[#DOCHEADER_LINES]
4070 . UNDERSCORE "\\*[$DOC_TYPE]
4071 . \\n+[#DOCHEADER_LINES]
4075 . if !\\n[#DOC_TYPE]=4 \{\
4076 . if \\n[#PRINT_STYLE]=2 \{\
4077 . nr #DEPTH_1 \\n[#DOCHEADER_LINES]*\\n[#DOCHEADER_LEAD]
4078 . nr #DEPTH_2 \\n[#DOCHEADER_LINES]*\\n[#DOC_LEAD]
4079 . ie \\n[#DEPTH_1]<\\n[#DEPTH_2] \{\
4080 . nr #DOCHEADER_SPACE_ADJ \\n[#DEPTH_2]-\\n[#DEPTH_1]
4083 . nr #DOCHEADER_SPACE_ADJ \\n[#DEPTH_1]-\\n[#DEPTH_2]
4085 . nr #DOCHEADER_EXTRA_SPACE \\n[#DOCHEADER_SPACE_ADJ] \\n[#DOC_LEAD]
4086 . while \\n[#DOCHEADER_EXTRA_SPACE]>\\n[#DOC_LEAD] \{\
4087 . \\n-[#DOCHEADER_EXTRA_SPACE]
4089 . if \\n[#DOCHEADER_EXTRA_SPACE]>0 \{\
4090 . ie \\n[#DOCHEADER_LEAD_ADJ]<0 \{\
4091 . ALD \\n[#DOCHEADER_EXTRA_SPACE]u
4093 . el \{ .ALD \\n[#DOC_LEAD]u-\\n[#DOCHEADER_EXTRA_SPACE]u \}
4096 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
4097 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u*2u \}
4098 . if \\n[#COLUMNS] \{\
4100 . nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
4101 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4102 . LL \\n[#COL_L_LENGTH]u
4108 . rr #DOCHEADER_LEAD
4109 . rr #DOCHEADER_LEAD_ADJ
4112 . rr #DOCHEADER_ADVANCE
4113 . rr #ADVANCE_FROM_TOP
4114 . rr #DOCHEADER_SPACE_ADJ
4115 . rr #DOCHEADER_LINES
4116 . rr #DOCHEADER_EXTRA_SPACE
4122 . nr #START_FOR_FOOTERS 1
4125 \# ====================================================================
4127 \# +++MACROS TO CHANGE SOME DEFAULTS+++
4132 \# <none> | <anything> [distance to advance from top of page]
4134 \# Turns printing of document header on or off. If a second argument
4135 \# in units of measure is given, advances that distance from the
4136 \# top of the page without printing the document header.
4138 \# Default is on. If the 1st argument is <anything> (which turns
4139 \# document headers off), the optional 2nd argument may be given
4140 \# (with a unit of measure).
4143 . ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
4145 . if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
4151 \# DOCUMENT HEADER LEADING
4152 \# -----------------------
4154 \# <+|- amount by which to in/decrease leading of doc header>
4156 \# Stores user supplied lead in/decrease in register #DOCHEADER_LEAD_ADJ.
4158 \# A unit of measure must be supplied. Decimal fractions OK.
4159 \# Default is +0, i.e. same as DOC_LEAD.
4161 .MAC DOCHEADER_LEAD END
4162 . nr #DOCHEADER_LEAD_ADJ (\\$1)
4166 \# DOCHEADER ADVANCE
4167 \# -----------------
4169 \# <docheader start position>
4171 \# Creates register #DOCHEADER_ADVANCE, used in START.
4173 \# Unit of measure required.
4174 \# Default is same as T_MARGIN.
4176 .MAC DOCHEADER_ADVANCE END
4177 . nr #DOCHEADER_ADVANCE (\\$1)
4184 \# <family to use for the document header title>
4186 \# Creates or modifies string $TITLE_FAM.
4188 \# Default is same as running text.
4190 .MAC TITLE_FAMILY END
4191 . ds $TITLE_FAM \\$1
4198 \# <font to use for the document header title>
4200 \# Creates or modifies string $TITLE_FT.
4212 \# <+|- number of points by which to in/decrease title at start
4213 \# of the document (relative to running text)>
4215 \# Creates string $TITLE_SIZE_CHANGE.
4217 \# Must be preceded by a +|- sign, with no space afterwards.
4218 \# Fractional point sizes are allowed.
4219 \# Default is +3.5 for printstyle TYPESET DEFAULT | STORY | NAMED;
4220 \# 4 for TYPESET CHAPTER; +0 for TYPEWRITE.
4223 . ds $TITLE_SIZE_CHANGE \\$1
4230 \# <family to use for the document header title>
4232 \# Creates or modifies string $SUBTITLE_FAM.
4234 \# Default is same as running text.
4236 .MAC SUBTITLE_FAMILY END
4237 . ds $SUBTITLE_FAM \\$1
4244 \# <font to use for the document header title>
4246 \# Creates or modifies string $SUBTITLE_FT.
4248 \# Default is same as running text.
4250 .MAC SUBTITLE_FONT END
4251 . ds $SUBTITLE_FT \\$1
4258 \# <+|- number of points by which to in/decrease subtitle at start
4259 \# of the document (relative to running text)>
4261 \# Creates or modifies string $SUBTITLE_SIZE_CHANGE.
4263 \# Must be preceded by a +|- sign with no space afterwards.
4264 \# Fractional point sizes are allowed.
4267 .MAC SUBTITLE_SIZE END
4268 . ds $SUBTITLE_SIZE_CHANGE \\$1
4275 \# <family to use for author in document header>
4277 \# Creates or modifies string $AUTHOR_FAM.
4279 \# Default is same as running text.
4281 .MAC AUTHOR_FAMILY END
4282 . ds $AUTHOR_FAM \\$1
4289 \# <font to use for author in document header>
4291 \# Creates or modifies string $AUTHOR_FT.
4293 \# Default is italic.
4295 .MAC AUTHOR_FONT END
4296 . ds $AUTHOR_FT \\$1
4303 \# <+|- number of points by which to in/decrease author at start
4306 \# Creates or modifies string $AUTHOR_SIZE_CHANGE.
4308 \# Must be preceded by a +|- sign with no space afterwards.
4309 \# Fractional point sizes are allowed.
4310 \# Default is same as running text.
4312 .MAC AUTHOR_SIZE END
4313 . ds $AUTHOR_SIZE_CHANGE \\$1
4320 \# <family to use for the document type string>
4322 \# Creates or modifies string $DOCTYPE_FAM.
4324 \# Default is same as running text.
4326 .MAC DOCTYPE_FAMILY END
4327 . ds $DOCTYPE_FAM \\$1
4334 \# <font to use for the document type string>
4336 \# Creates or modifies string $DOCTYPE_FT.
4338 \# Default is bold italic.
4340 .MAC DOCTYPE_FONT END
4341 . ds $DOCTYPE_FT \\$1
4348 \# <+|- number of points by which to in/decrease the document
4349 \# type string (relative to running text)>
4351 \# Creates or modifies string $DOCTYPE_SIZE_CHANGE.
4353 \# Must be preceded by a +|- sign with no space afterwards.
4354 \# Fractional point sizes are allowed.
4355 \# Default is +3 for TYPESET; 0 for TYPEWRITE.
4357 .MAC DOCTYPE_SIZE END
4358 . ds $DOCTYPE_SIZE_CHANGE \\$1
4362 \# DOCUMENT LEFT MARGIN
4363 \# --------------------
4365 \# <left margin of document>
4367 \# Creates or modifies register #DOC_L_MARGIN.
4369 \# Affects EVERYTHING on the page.
4371 .MAC DOC_LEFT_MARGIN END
4373 . nr #DOC_L_MARGIN (\\$1)
4374 . L_MARGIN \\n[#DOC_L_MARGIN]u
4378 \# DOCUMENT RIGHT MARGIN
4379 \# ---------------------
4381 \# <right margin of document>
4383 \# Creates or modifies register #DOC_R_MARGIN.
4385 \# Affects EVERYTHING on the page.
4387 .MAC DOC_RIGHT_MARGIN END
4389 . nr #DOC_R_MARGIN (\\$1)
4390 . R_MARGIN \\n[#DOC_R_MARGIN]
4391 . nr #DOC_L_LENGTH \\n[#L_LENGTH]
4395 \# DOCUMENT LINE LENGTH
4396 \# --------------------
4398 \# <line length of document>
4400 \# Creates or modifies string $DOC_L_LENGTH.
4402 \# Affects EVERYTHING on the page.
4404 .MAC DOC_LINE_LENGTH END
4406 . nr #DOC_L_LENGTH (\\$1)
4407 . LL \\n[#DOC_L_LENGTH]u
4415 \# <family of running text>
4417 \# Creates or modifies string $DOC_FAM.
4419 \# Affects everything EXCEPT headers and footers.
4424 . FAMILY \\*[$DOC_FAM]
4425 . TITLE_FAMILY \\*[$DOC_FAM]
4426 . SUBTITLE_FAMILY \\*[$DOC_FAM]
4427 . AUTHOR_FAMILY \\*[$DOC_FAM]
4428 . DOCTYPE_FAMILY \\*[$DOC_FAM]
4429 . HEAD_FAMILY \\*[$DOC_FAM]
4430 . SUBHEAD_FAMILY \\*[$DOC_FAM]
4431 . QUOTE_FAMILY \\*[$DOC_FAM]
4432 . BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
4433 . EPIGRAPH_FAMILY \\*[$DOC_FAM]
4434 . HDRFTR_FAMILY \\*[$DOC_FAM]
4435 . PAGENUM_FAMILY \\*[$DOC_FAM]
4439 \# DOCUMENT POINT SIZE
4440 \# -------------------
4442 \# <point size of running text>
4444 \# Creates or modifies register $DOC_PT_SIZE.
4446 \# DOC_PT_SIZE is the basis for calculating all type sizes in
4449 .MAC DOC_PT_SIZE END
4450 . if \\n[#IGNORE] \{ .return \}
4453 . nr #DOC_PT_SIZE \\n[#PT_SIZE]
4460 \# <lead (".vs") of running text> [ADJUST]
4462 \# Creates or modifies register #DOC_LEAD. If the optional
4463 \# ADJUST argument is given, adjusts leading so that the last
4464 \# line of text falls exactly on #B_MARGIN.
4466 \# DOC_LEAD is the basis for calculating all leading changes in
4467 \# a document. Default for TYPESET is 16; 24 for TYPEWRITE.
4469 \# Because the visible bottom or footer margin of a page depends
4470 \# on the overall document lead supplied by the register #DOC_LEAD,
4471 \# DOC_LEAD, in the body of a document, should always be associated
4472 \# with the start of a new page (in other words, just before or
4473 \# just after a manual NEWPAGE).
4476 . if \\n[#IGNORE] \{ .return \}
4479 . nr #DOC_LEAD \\n[#LEAD]
4480 . if '\\$2'ADJUST' \{ .TRAPS \}
4483 \# ADJUST DOCUMENT LEAD
4484 \# --------------------
4486 \# <none> | <anything>
4488 \# Adjusts document lead so that the last line of text falls exactly
4491 .MAC DOC_LEAD_ADJUST END
4492 . ie '\\$1'' \{ .nr #ADJ_DOC_LEAD 1 \}
4493 . el \{ .nr #ADJ_DOC_LEAD 0 \}
4500 \# L | LEFT | R | RIGHT | C | CENTER | CENTRE | J | JUSTIFY
4502 \# Creates or modifies string $DOC_QUAD.
4504 \# While QUAD (from the typesetting macros) can be used before START
4505 \# to change the default document quad, DOC_QUAD *must* be used after
4506 \# the START macro has been invoked.
4508 \# Default is LEFT for printstyle TYPEWRITE, JUSTIFY for printstyle
4513 . QUAD \\*[$DOC_QUAD]
4516 \# ====================================================================
4518 \# +++INTERNATIONALIZATION+++
4523 \# <what goes in the "by" slot before author in the document header>
4525 \# Creates or modifies string $ATTRIBUTE_STRING.
4527 \# Default is "by". A blank string ("") may be used if no
4528 \# attribution is desired.
4530 .MAC ATTRIBUTE_STRING END
4531 . ds $ATTRIBUTE_STRING \\$1
4538 \# <what to print any time the word "chapter" is required>
4540 \# Creates or modifies string $CHAPTER_STRING.
4542 \# Default is "chapter".
4544 .MAC CHAPTER_STRING END
4545 . ds $CHAPTER_STRING \\$1
4552 \# <what to print any time the word "draft" is required>
4554 \# Creates or modifies string $DRAFT_STRING.
4556 \# Default is "draft".
4558 .MAC DRAFT_STRING END
4559 . ds $DRAFT_STRING \\$1
4566 \# <what to print any time the word "revision" is required>
4568 \# Creates or modifies string $REVISION_STRING.
4570 \# Default is "revision".
4572 .MAC REVISION_STRING END
4573 . ds $REVISION_STRING \\$1
4580 \# <what to print with the finis macro>
4582 \# Creates or modifies string $FINIS_STRING.
4584 \# Default is "END".
4586 .MAC FINIS_STRING END
4589 . ds $FINIS_STRING \\$1
4593 \# ====================================================================
4595 \# +++RECTO/VERSO+++
4600 \# <none> | <anything>
4602 \# Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages. Also
4603 \# switches page numbers left and right if either is chosen rather
4604 \# than the default centered page numbers. Switches left and right
4605 \# margins if differing values have been entered.
4609 .MAC RECTO_VERSO END
4610 . ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
4611 . el \{ .nr #RECTO_VERSO 0 \}
4614 \# ====================================================================
4621 \# <family to use for epigraphs>
4623 \# Creates or modifies string $EPI_FAM.
4625 \# Default is same as running text.
4627 .MAC EPIGRAPH_FAMILY END
4635 \# <font to use for epigraphs>
4637 \# Creates or modifies string $EPI_FT.
4639 \# Default is same as running text.
4641 .MAC EPIGRAPH_FONT END
4649 \# <-|+ number of points by which to de/increase point size of epigraphs
4650 \# (relative to running text)>
4652 \# Creates or modifies string $EPI_SIZE_CHANGE.
4654 \# Must be preceded by a - or + sign with no space afterwards.
4655 \# Fractional point sizes are allowed. Default -1.5 for printstyle
4656 \# TYPESET; +0 for TYPEWRITE.
4658 .MAC EPIGRAPH_SIZE END
4659 . ds $EPI_SIZE_CHANGE \\$1
4666 \# L | LEFT | J | JUSTIFY
4668 \# Creates or modifies string $EPI_QUAD.
4670 \# Default is $DOC_QUAD when BLOCK argument is passed to EPIGRAPH.
4672 .MAC EPIGRAPH_QUAD END
4680 \# <value by which to multiply PP_INDENT for block epigraphs>
4682 \# Creates or modifies register #EPI_OFFSET_VALUE.
4684 \# Default is 2 for TYPEWRITE, 3 for TYPESET.
4686 .MAC EPIGRAPH_INDENT END
4687 . nr #EPI_OFFSET_VALUE \\$1
4691 \# EPIGRAPH AUTOLEAD
4692 \# -----------------
4694 \# <amount of lead to add to the epigraph ps for epigraph leading>
4696 \# Creates or modifies register #EPI_AUTOLEAD.
4698 \# Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
4700 .MAC EPIGRAPH_AUTOLEAD END
4701 . nr #EPI_AUTOLEAD \\$1
4708 \# BLOCK | <anything>
4710 \# Places an epigraph before the document's text, after the
4711 \# document header, or after a HEAD.
4713 \# #EPIGRAPH 1 = centered; 2 = block
4715 \# By default, epigraphs are centered, allowing the user
4716 \# to input them on a line per line basis. To change this
4717 \# behaviour, the user can supply the argument BLOCK, which
4718 \# will produce indented, filled text similar to BLOCKQUOTE.
4720 \# If a block epigraph contains more than one para, ALL paras of
4721 \# the epigraph must be preceded by PP. Otherwise, PP is optional.
4726 . if \\n[#START] \{\
4727 . if \\n[#PRINT_STYLE]=1 \{\
4728 . if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
4734 . ll \\n[#L_LENGTH]u
4737 . if \\n[#COLUMNS] \{\
4738 . ie \\n[#START] \{\
4739 . ll \\n[#DOC_L_LENGTH]u
4743 . ll \\n[#COL_L_LENGTH]u
4748 . if \\n[#PRINT_STYLE]=1 \{\
4751 . if '\\*[$EPI_FT]'I' \{\
4755 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4756 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
4757 . nr #EPI_LEAD \\n[#LEAD]
4758 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
4760 . if \\n[#PRINT_STYLE]=2 \{\
4761 . FAMILY \\*[$EPI_FAM]
4763 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
4764 . AUTOLEAD \\n[#EPI_AUTOLEAD]
4765 . nr #EPI_LEAD \\n[#LEAD]
4766 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
4772 . ie '\\$1'BLOCK' \{\
4775 . ie \\n[#START] \{\
4776 . ie \\n[#COLUMNS] \{\
4777 . ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
4781 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
4786 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
4788 . if \\n[#COLUMNS] \{\
4789 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
4794 . if \\n[#PRINT_STYLE]=1 \{\
4797 . if '\\*[$EPI_FT]'I' \{\
4801 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4802 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
4805 . nr #EPI_LEAD \\n[#LEAD]
4806 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
4810 . if \\n[#PRINT_STYLE]=2 \{\
4811 . FAMILY \\*[$EPI_FAM]
4813 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
4814 . AUTOLEAD \\n[#EPI_AUTOLEAD]
4815 . QUAD \\*[$EPI_QUAD]
4817 . nr #EPI_LEAD \\n[#LEAD]
4818 . nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
4835 \# Ends diversion started in EPIGRAPH. Makes spacing
4836 \# adjustments to compensate for the difference between epigraph
4837 \# leading and overall document leading, so that the bottom of
4838 \# the pages remain flush.
4840 \# In addition to its usual place at the beginning of a
4841 \# document, EPIGRAPH may also be used after HEAD.
4843 .MAC DO_EPIGRAPH END
4848 . nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
4849 . nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
4850 . ie \\n[#START] \{\
4851 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
4852 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
4853 . RLD \\n[#DOC_LEAD]u
4854 . ie \\n[#PRINT_STYLE]=1 \{\
4855 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
4858 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
4859 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
4861 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
4862 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
4867 . ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
4869 . nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
4870 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
4871 . ie \\n[#PRINT_STYLE]=1 \{\
4872 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
4875 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
4876 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
4878 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
4879 . ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
4884 . nr #EPI_LINES_TO_TRAP 0 1
4885 . while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{ .nr #LOOP 1 \}
4886 . nr #EPI_LINES_TO_TRAP -1
4887 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
4888 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
4889 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
4890 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
4893 . if \\n[#EPIGRAPH]=1 \{\
4894 . po \\n[#L_MARGIN]u
4895 . if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
4897 . if \\n[#EPIGRAPH]=2 \{\
4898 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
4899 . if \\n[#COLUMNS] \{\
4900 . nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
4902 . po \\n[#EPI_OFFSET]u
4907 . ie \\n[#START] \{\
4908 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
4909 . ALD \\n[#EPI_WHITESPACE]u/2u
4911 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
4912 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
4917 . ie \\n[#EPI_FITS] \{\
4918 . ie \\n[#FN_FOR_EPI] \{\
4919 . nr #EPI_LINES_TO_END 1
4920 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
4921 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
4922 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
4925 . ie \\n[#PRINT_STYLE]=1 \{\
4926 . if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
4929 . if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
4930 . ALD \\n[#EPI_WHITESPACE]u/2u
4932 . if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
4933 . ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
4939 . nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
4940 . if \\n[#LOOP] \{. nr #EPI_LINES_TO_END +1 \}
4942 . nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
4943 . while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
4944 . ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
4945 . if \\n[#PRINT_STYLE]=1 \{\
4946 . if !\\n[#SINGLE_SPACE] \{\
4947 . nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
4948 . ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
4950 . rr #EPI_LINES_EVEN
4957 . ALD \\n[#DOC_LEAD]u
4958 . QUAD \\*[$DOC_QUAD]
4959 . po \\n[#L_MARGIN]u
4960 . if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
4961 . if \\n[#START] \{\
4962 . if \\n[#COLUMNS] \{\
4963 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
4969 \# ====================================================================
4971 \# +++FINIS MACRO+++
4978 \# Deposits --END-- at the end of a document.
4981 . if \\n[#TAB_ACTIVE] \{ .TQ \}
4982 . if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
4985 . nr #EM_ADJUST (1m/8)
4986 . if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
4987 . ALD \\n[#DOC_LEAD]u
4989 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
4990 . if \\n[#PRINT_STYLE]=2 \{\
4991 . PRINT "\v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em
4995 \# ====================================================================
4997 \# +++HEADERS/FOOTERS+++
4999 \# Define a string so that the current page number can be incorporated
5000 \# into the strings for hdrftr left, right, and center. NOTE: This is
5001 \# not the same thing as using the shortform # in hdrftr strings.
5003 .ds PAGE# \En[#PAGENUMBER]
5009 \# <family to use in header/footers>
5011 \# Creates or modifies string $HDRFTR_FAM.
5013 \# Default is same as running text.
5015 .MAC HDRFTR_FAMILY END
5016 . ds $HDRFTR_FAM \\$1
5023 \# <+|-number of points by which to in/decrease point size of
5024 \# header/footers (relative to running text)>
5026 \# Creates or modifies string $HDRFTR_SIZE_CHANGE.
5028 \# Must be preceded by a +|- sign. No space afterwards.
5029 \# Fractional point sizes are allowed. Default is +0.
5031 \# By default, header/footers print the author .5 points smaller
5032 \# than the base point size of running text, center titles
5033 \# (Chapter, Draft, Revision, etc.) .5 points smaller
5034 \# than running text (in italics), and the document title 2 full
5035 \# points smaller than running text (in caps). The HDRFTR_SIZE
5036 \# macro changes the overall size for all three parts while
5037 \# maintaining the internal size changes.
5039 \# In other words, if the user likes the header/footers but wants
5040 \# them a bit bigger or a bit smaller, s/he should use HDRFTR_SIZE.
5042 .MAC HDRFTR_SIZE END
5043 . ds $HDRFTR_SIZE_CHANGE \\$1
5050 \# <amount of space between header/footer and header/footer rule>
5052 \# Creates or modifies register #HDRFTR_RULE_GAP to hold amount
5053 \# of space between header/footer and header/footer rule.
5057 .MAC HDRFTR_RULE_GAP END
5058 . nr #HDRFTR_RULE_GAP (\\$1)
5065 \# <what to put in the left position of page header/footers>
5067 \# Creates or modifies string $HDRFTR_LEFT.
5068 \# Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
5069 \# overrides the $HDRFTR_LEFT string created by default
5072 \# Especially useful if doc has more than one author, and a list
5073 \# of authors by last name is desired in header/footers.
5074 \# Default is author.
5076 \# If the argument is the # character, simply prints the current
5079 \# If the user wants to *incorporate* the page number into the string,
5080 \# \*[PAGE#] must be used. For example, if the user wants to put
5081 \# an elipsis before the page number in the string, s/he should use
5082 \# ...\*[PAGE#], not ...#
5084 .MAC HDRFTR_LEFT END
5085 . nr #USER_DEF_HDRFTR_LEFT 1
5086 . ds $HDRFTR_LEFT \\$1
5090 \# HDRFTR LEFT FAMILY
5091 \# ------------------
5093 \# <family of header/footer left string>
5095 \# Creates or modifies string $HDRFTR_LEFT_FAM.
5097 .MAC HDRFTR_LEFT_FAMILY END
5098 . ds $HDRFTR_LEFT_FAM \\$1
5105 \# <font of header/footer left string>
5107 \# Creates or modifies string $HDRFTR_LEFT_FT.
5109 .MAC HDRFTR_LEFT_FONT END
5110 . ds $HDRFTR_LEFT_FT \\$1
5117 \# <+|- number of points to in/decrease size of left string in
5118 \# header/footers (relative to running text)>
5120 \# Creates or modifies string HDRFTR_LEFT_SIZE_CHANGE.
5122 \# Must be preceded by a +|- sign. No space afterwards.
5123 \# Fractional point sizes are allowed.
5124 \# Default is -.5 for printstyle TYPESET; if all caps, -2
5125 \# Has no effect in TYPEWRITE.
5127 .MAC HDRFTR_LEFT_SIZE END
5128 . ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5135 \# <none> | <anything>
5137 \# Turns capitalisation of $HDRFTR_LEFT (typically, the author of
5138 \# the document) on or off.
5142 .MAC HDRFTR_LEFT_CAPS END
5144 . nr #HDRFTR_LEFT_CAPS 1
5147 . nr #HDRFTR_LEFT_CAPS 0
5148 . ds $HDRFTR_RIGHT_SIZE_CHANGE +0
5156 \# <what to put in the centre position of page header/footers>
5158 \# Creates or modifies string $HDRFTR_CENTER.
5159 \# Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
5160 \# overrides the $HDRFTR_CENTER string created by default
5163 \# Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
5164 \# CHAPTER, draft and revision number if COPYSTYLE DRAFT.
5166 \# If the argument is the # character, simply prints the current
5169 \# If the user wants to *incorporate* the page number into the string,
5170 \# \*[PAGE#] must be used. For example, if the user wants to put
5171 \# an elipsis before the page number in the string, s/he should use
5172 \# ...\*[PAGE#], not ...#
5174 .MAC HDRFTR_CENTER END
5175 . nr #USER_DEF_HDRFTR_CENTER 1
5176 . ds $HDRFTR_CENTER \\$1
5180 \# HDRFTR CENTER FAMILY
5181 \# --------------------
5183 \# <family of header/footer center string>
5185 \# Creates or modifies string $HDRFTR_CENTER_FAM.
5187 .MAC HDRFTR_CENTER_FAMILY END
5188 . ds $HDRFTR_CENTER_FAM \\$1
5192 \# HDRFTR CENTER FONT
5193 \# ------------------
5195 \# <font of header/footer center string>
5197 \# Creates or modifies string $HDRFTR_CENTER_FT.
5199 .MAC HDRFTR_CENTER_FONT END
5200 . ds $HDRFTR_CENTER_FT \\$1
5204 \# HDRFTR CENTER SIZE
5205 \# ------------------
5207 \# <+|- number of points to in/decrease size of centre string in
5208 \# header/footers (relative to header/footer size)>
5210 \# Creates string HDRFTR_CENTER_SIZE_CHANGE.
5212 \# Must be preceded by a +|- sign. No space afterwards.
5213 \# Fractional point sizes are allowed.
5214 \# Default is -.5 for printstyle TYPESET; if all caps, -2
5215 \# Has no effect in TYPEWRITE.
5217 .MAC HDRFTR_CENTER_SIZE END
5218 . ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
5222 \# HDRFTR CENTER CAPS
5223 \# ------------------
5225 \# <none> | <anything>
5227 \# Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
5228 \# the document) on or off.
5232 .MAC HDRFTR_CENTER_CAPS END
5234 . nr #HDRFTR_CENTER_CAPS 1
5237 . nr #HDRFTR_CENTER_CAPS 0
5238 . ds $HDRFTR_CENTER_SIZE_CHANGE +0
5246 \# <what to put in the right position of page header/footers>
5248 \# Creates or modifies string $HDRFTR_RIGHT.
5249 \# Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
5250 \# overrides the $HDRFTR_RIGHT string created by default
5253 \# Default is document title.
5255 \# If the argument is the # character, simply prints the current
5258 \# If the user wants to *incorporate* the page number into the string,
5259 \# \*[PAGE#] must be used. For example, if the user wants to put
5260 \# an elipsis before the page number in the string, s/he should use
5261 \# ...\*[PAGE#], not ...#
5263 .MAC HDRFTR_RIGHT END
5264 . nr #USER_DEF_HDRFTR_RIGHT 1
5265 . ds $HDRFTR_RIGHT \\$1
5269 \# HDRFTR RIGHT FAMILY
5270 \# -------------------
5272 \# <family of header/footer right string>
5274 \# Creates or modifies string $HDRFTR_RIGHT_FAM.
5276 .MAC HDRFTR_RIGHT_FAMILY END
5277 . ds $HDRFTR_RIGHT_FAM \\$1
5281 \# HDRFTR RIGHT FONT
5282 \# -----------------
5284 \# <font of header/footer right string>
5286 \# Creates or modifies string $HDRFTR_RIGHT_FT.
5288 .MAC HDRFTR_RIGHT_FONT END
5289 . ds $HDRFTR_RIGHT_FT \\$1
5293 \# HDRFTR RIGHT SIZE
5294 \# -----------------
5296 \# <+|- number of points to in/decrease size of right string in
5297 \# header/footers (relative to header/footer size)>
5299 \# Creates or modifies string HDRFTR_RIGHT_SIZE_CHANGE.
5301 \# Must be preceded by a +|- sign. No space afterwards.
5302 \# Fractional point sizes are allowed.
5303 \# Default is -2 for printstyle TYPESET if all caps; otherwise -.5
5304 \# Has no effect in TYPEWRITE.
5306 .MAC HDRFTR_RIGHT_SIZE END
5307 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
5311 \# HDRFTR RIGHT CAPS
5312 \# -----------------
5314 \# <none> | <anything>
5316 \# Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
5317 \# the document) on or off.
5321 .MAC HDRFTR_RIGHT_CAPS END
5323 . nr #HDRFTR_RIGHT_CAPS 1
5326 . nr #HDRFTR_RIGHT_CAPS 0
5327 . ds $HDRFTR_RIGHT_SIZE_CHANGE +0
5334 \# <none> | <anything>
5336 \# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
5337 \# under the header/footer. Otherwise, turns HDRFTR_RULE on or off.
5339 .MAC HDRFTR_RULE END \"To print rule under header/over footer.
5340 . ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
5341 . ie \\n[#USERDEF_HDRFTR] \{\
5342 . nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
5344 . if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
5345 . if \\n[#FOOTERS_ON] \{\
5346 . RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
5348 . PRINT \\l'\\n[#DOC_L_LENGTH]u'
5352 . if \\n[#PRINT_STYLE]=1 \{\
5353 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
5355 . if \\n[#PRINT_STYLE]=2 \{\
5356 . ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
5357 . nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
5359 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
5360 . ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
5361 . nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
5363 . el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
5366 . if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
5367 . if \\n[#FOOTERS_ON] \{\
5368 . RLD \\n[#LEAD]u*3u+\\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
5370 . PRINT \\l'\\n[#DOC_L_LENGTH]u'
5375 . ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
5376 . el \{ .nr #HDRFTR_RULE 0 \}
5381 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
5389 \# Sets the family, font, and point size of all strings in
5390 \# header/footers to the same family and point size as running
5391 \# text. Font for the header/footer becomes roman throughout.
5393 .MAC HDRFTR_PLAIN END
5394 . HDRFTR_FAMILY \\*[$DOC_FAM]
5395 . HDRFTR_PT_SIZE \\n[#DOC_PT_SIZE]
5396 . HDRFTR_LEFT_FAMILY \\*[$DOC_FAM]
5397 . HDRFTR_LEFT_FONT R
5398 . HDRFTR_LEFT_SIZE +0
5399 . HDRFTR_LEFT_CAPS OFF
5400 . HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
5401 . HDRFTR_CENTER_FONT R
5402 . HDRFTR_CENTER_SIZE +0
5403 . HDRFTR_CENTER_CAPS OFF
5404 . HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]
5405 . HDRFTR_RIGHT_FONT R
5406 . HDRFTR_RIGHT_SIZE +0
5407 . HDRFTR_RIGHT_CAPS OFF
5414 \# <none> | <anything>
5416 \# Creates or modifies register #SWITCH_HDRFTR, used to switch
5417 \# default location of HDRFTR_LEFT and HDRFTR_RIGHT.
5419 \# Typically, the author string appears at the left of header/footers,
5420 \# and the title string appears at the right. This switches the
5421 \# location of the two. Useful in conjuction with RECTO_VERSO to
5422 \# tweak switches on alternate pages to come out as the user wishes.
5423 \# The assumption of RECTO_VERSO is that the first page of the document
5424 \# (recto) is odd, and even though it has no header/footer, if it did have one,
5425 \# it would print as AUTHOR...CENTER...TITLE (or whatever strings
5426 \# the user has supplied for HDRFTR_LEFT/RIGHT), meaning that the
5427 \# next page, which does have a header/footer, will come out as
5428 \# TITLE...CENTER...AUTHOR (or whatever strings the user has
5429 \# supplied for HDRFTR_LEFT/RIGHT). SWITCH_HDRFTRS allows the user
5430 \# to get the desired string in the desired place on the desired
5431 \# recto/verso page.
5435 .MAC SWITCH_HDRFTR END
5436 . ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
5437 . el \{ .nr #SWITCH_HDRFTR 0 \}
5441 \# USER DEFINED HDRFTR RECTO
5442 \# -------------------------
5444 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
5446 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
5447 \# stores string in $USERDEF_HDRFTR_RECTO.
5449 \# For use when users don't want 3-part headers/footers, but rather
5450 \# want to design their own headers/footers and need different
5451 \# headers/footers on recto and verso pages.
5453 .MAC HDRFTR_RECTO END
5454 . nr #USERDEF_HDRFTR 1
5455 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
5456 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
5457 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5458 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5459 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5460 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
5461 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
5462 . ds $USERDEF_HDRFTR_RECTO \\$2
5466 \# USER DEFINED HDRFTR VERSO
5467 \# -------------------------
5469 \# L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
5471 \# Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
5472 \# stores string in $USERDEF_HDRFTR_VERSO.
5474 \# For use when users don't want 3-part headers/footers, but rather
5475 \# want to design their own headers/footers and need different
5476 \# headers/footers on recto and verso pages.
5478 .MAC HDRFTR_VERSO END
5479 . nr #USERDEF_HDRFTR 1
5480 . if '\\$1'L' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
5481 . if '\\$1'LEFT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
5482 . if '\\$1'C' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5483 . if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5484 . if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5485 . if '\\$1'R' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
5486 . if '\\$1'RIGHT' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
5487 . ds $USERDEF_HDRFTR_VERSO \\$2
5491 \# PRINT FOOTER ON FIRST PAGE
5492 \# --------------------------
5494 \# <none> | <anything>
5496 \# Toggles register #PRINT_FOOTER_ON_PAGE_1
5498 \# Lets user choose whether to print footer on first
5501 .MAC FOOTER_ON_FIRST_PAGE END
5502 . ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
5503 . el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
5507 \# PRINT PAGE NUMBER ON FIRST PAGE
5508 \# -------------------------------
5510 \# <none> | <anything>
5512 \# Toggles register #PRINT_PAGENUM_ON_PAGE_1
5514 \# Lets user choose whether to print page number on first
5515 \# page of doc and after collate when footers are on or page numbering
5516 \# has been user set at top of page.
5518 .MAC PAGENUM_ON_FIRST_PAGE END
5519 . ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
5520 . el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
5524 \# PRINT HEADER/FOOTER
5525 \# -------------------
5529 \# Based on defaults or values entered by user, prints a
5530 \# three-part title at either the top or the bottom of the page.
5532 \# Called from within either HEADER or FOOTER.
5534 .MAC PRINT_HDRFTR END
5535 . if \\n[#DOC_TYPE]=4 \{\
5536 . nr #SUITE \En[.pn]
5538 . if \\n[#FOOTERS_ON] \{\
5539 . if \\n[#START_FOR_FOOTERS] \{\
5540 . rr #START_FOR_FOOTERS
5541 . if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{ .return \}
5544 . if \\n[#HEADERS_ON] \{ .vs 0 \}
5545 . if \\n[#USERDEF_HDRFTR] \{\
5546 . PRINT_USERDEF_HDRFTR
5549 . if \\n[#SWITCH_HDRFTR] \{\
5550 . ds $HDRFTR_TMP_SWITCH \\*[$HDRFTR_LEFT]
5551 . ds $HDRFTR_LEFT \\*[$HDRFTR_RIGHT]
5552 . ds $HDRFTR_RIGHT \\*[$HDRFTR_TMP_SWITCH]
5553 . ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
5554 . ds $HDRFTR_LEFT_SIZE_CHANGE \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
5555 . ds $HDRFTR_RIGHT_SIZE_CHANGE \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
5556 . nr #HDRFTR_TMP_CAPS_SWITCH \\n[#HDRFTR_LEFT_CAPS]
5557 . nr #HDRFTR_LEFT_CAPS \\n[#HDRFTR_RIGHT_CAPS]
5558 . nr #HDRFTR_RIGHT_CAPS \\n[#HDRFTR_TMP_CAPS_SWITCH]
5559 . rr #HDRFTR_TMP_CAPS_SWITCH
5560 . rm $HDRFTR_TMP_SWITCH
5561 . rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
5562 . nr #SWITCH_HDRFTR 0
5564 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
5565 . if \\n[#PRINT_STYLE]=1 \{\
5566 . if \\n[#FOOTERS_ON] \{\
5569 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
5574 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
5575 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
5576 . ie '\\*[$HDRFTR_LEFT]'#' \{\
5577 . PRINT \\n[#PAGENUMBER]
5580 . ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
5581 . el \{ .PRINT \& \}
5583 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
5585 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
5586 . ie '\\*[$HDRFTR_CENTER]'#' \{\
5587 . PRINT \\v'-(\\n[#LEAD]u*1u)'\\n[#PAGENUMBER]
5590 . ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\*[$HDRFTR_CENTER] \}
5591 . el \{ .PRINT \& \}
5593 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
5596 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
5597 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
5598 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
5599 . PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
5602 . ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
5603 . el \{ .PRINT \& \}
5605 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
5607 . if \\n[#PRINT_STYLE]=2 \{\
5608 . FAMILY \\*[$HDRFTR_LEFT_FAM]
5609 . FT \\*[$HDRFTR_LEFT_FT]
5610 . PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
5611 . if \\n[#FOOTERS_ON] \{\
5614 . nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
5619 . if \\n[#RECTO_VERSO]=0 \{ .LEFT \}
5620 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS \}
5621 . ie '\\*[$HDRFTR_LEFT]'#' \{ .PRINT \\n[#PAGENUMBER] \}
5623 . ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
5624 . el \{ .PRINT \& \}
5626 . if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
5627 . FAMILY \\*[$HDRFTR_CENTER_FAM]
5628 . FT \\*[$HDRFTR_CENTER_FT]
5629 . PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
5630 . if \\n[#FOOTERS_ON] \{\
5633 . nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
5637 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
5638 . ie '\\*[$HDRFTR_CENTER]'#' \{\
5639 . PRINT \\v'-(\\n[#LEAD]u*1u)'\\n[#PAGENUMBER]
5642 . ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\*[$HDRFTR_CENTER] \}
5643 . el \{ .PRINT \& \}
5645 . if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
5646 . FAMILY \\*[$HDRFTR_RIGHT_FAM]
5647 . FT \\*[$HDRFTR_RIGHT_FT]
5648 . PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
5649 . if \\n[#FOOTERS_ON] \{\
5652 . nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
5657 . if \\n[#RECTO_VERSO]=0 \{ .RIGHT \}
5658 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS \}
5659 . ie '\\*[$HDRFTR_RIGHT]'#' \{\
5660 . PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
5663 . ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
5664 . el \{ .PRINT \& \}
5666 . if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
5668 . if \\n[#HDRFTR_RULE] \{\
5669 . HDRFTR_RULE_INTERNAL
5674 \# PRINT USER DEFINED HEADER/FOOTER
5675 \# --------------------------------
5679 \# Based on defaults or values entered by user, prints a single part
5680 \# (i.e. not 3-part) title at either the top or the bottom of the page.
5682 \# Called from within PRINT_HDRFTR.
5684 .MAC PRINT_USERDEF_HDRFTR END
5685 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
5687 . if \\n[#PRINT_STYLE]=2 \{\
5688 . FAMILY \\*[$HDRFTR_FAM]
5690 . PT_SIZE \\n[#HDRFTR_PT_SIZE]u
5692 . ie \\n[#RECTO_VERSO] \{\
5694 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
5695 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
5696 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
5697 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
5699 . if \\n[#FOOTERS_ON] \{\
5702 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
5707 . ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
5708 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT \}
5709 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
5710 . if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT \}
5712 . PRINT \\*[$USERDEF_HDRFTR_VERSO]
5714 . if \\n[#FOOTERS_ON] \{\
5717 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
5721 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
5722 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
5723 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
5724 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
5726 . if \\n[#FOOTERS_ON] \{\
5729 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
5736 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT \}
5737 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
5738 . if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT \}
5739 . PRINT \\*[$USERDEF_HDRFTR_RECTO]
5741 . if \\n[#FOOTERS_ON] \{\
5744 . nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
5749 . if \\n[#HDRFTR_RULE] \{\
5750 . HDRFTR_RULE_INTERNAL
5757 \# HEADERS (off or on)
5758 \# -------------------
5760 \# <none> | <anything>
5762 \# Turns headers at the top of the page off or on.
5767 . ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
5768 . el \{ .nr #HEADERS_ON 0 \}
5775 \# <amount of space between top of page and header>
5777 \# Creates or modifies register #HEADER_MARGIN to hold amount
5778 \# of space between top of page and header.
5780 \# Requires unit of measure. Default is 4P+6p, measured top-of-page
5783 .MAC HEADER_MARGIN END
5784 . nr #HEADER_MARGIN (\\$1)
5791 \# <amount of space between header and running text>
5793 \# Creates or modifies register #HEADER_GAP to hold amount
5794 \# of space between header and running text.
5796 \# Default is 1P+6p.
5799 . nr #HEADER_GAP (\\$1)
5808 \# Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
5810 \# In order to convert the title string to caps in the header (in the
5811 \# event that the user enters .TITLE in caps/lc), I've used
5812 \# quad left, quad centre, and quad right to arrange the three bits
5813 \# of the header, rather than .tl. This allows the use of the CAPS macro.
5814 \# The downside is that I have to add \\v'-(\\n[#LEAD]u*#) in order
5815 \# for -Tlatin1 output to align the header/footer strings on the baseline.
5816 \# The console output still isn't brilliant, but at least it's
5820 . PROCESS_FN_LEFTOVER
5821 . nr #FN_COUNT_FOR_COLS 0 1
5822 . if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
5823 . po \\n[#DOC_L_MARGIN]u
5824 . if \\n[#RECTO_VERSO] \{\
5825 . nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
5826 . DOC_LEFT_MARGIN \\n[#DOC_R_MARGIN]u
5827 . DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
5830 . if \\n[#PRINT_STYLE]=1 \{ .vs 0 \}
5831 . if \\n[#PRINT_STYLE]=2 \{ .LS 0 \}
5832 . sp |\\n[#HEADER_MARGIN]u-1v
5833 . ll \\n[#DOC_L_LENGTH]u
5835 . if \\n[#PRINT_STYLE]=2 \{\
5836 . FAMILY \\*[$HDRFTR_FAM]
5838 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
5840 . if \\n[#PRINT_STYLE]=1 \{\
5843 . ps 12\\*[$HDRFTR_SIZE_CHANGE]
5845 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
5846 . if \\n[#CAPS_ON] \{\
5850 . if \\n[#UNDERLINE_ON] \{\
5851 . nr #UNDERLINE_WAS_ON 1
5854 . ie \\n[#HEADERS_ON] \{\
5856 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
5859 . ie \\n[#PAGE_NUM_V_POS]=1 \{\
5860 . ie \\n[#PAGINATE] \{\
5862 . sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
5864 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
5866 . el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
5868 . nr #PAGE_TOP \\n(nl
5870 . po \\n[#L_MARGIN]u
5871 . if \\n[#RECTO_VERSO] \{\
5872 . nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
5874 . if \\n[#CAPS_WAS_ON] \{\
5878 . if \\n[#UNDERLINE_WAS_ON] \{\
5880 . rr #UNDERLINE_WAS_ON
5882 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
5883 . if \\n[#QUOTE] \{\
5884 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
5886 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
5887 . po \\n[#Q_OFFSET]u
5890 . if \\n[#EPIGRAPH] \{\
5891 . ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
5893 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5894 . po \\n[#EPI_OFFSET]u
5897 . ie \\n[#EPIGRAPH] \{\
5898 . ie !\\n[#EPI_ACTIVE] \{\
5903 . ie \\n[#EPI_FITS] \{ .ns \}
5904 . el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
5909 . if \\n[#COLUMNS] \{\
5910 . if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
5913 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
5914 . ll \\n[#COL_L_LENGTH]u
5916 . if \\n[#QUOTE] \{\
5917 . po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
5919 . if \\n[#EPIGRAPH] \{\
5920 . if \\n[#EPI_ACTIVE] \{\
5921 . ie \\n[#EPI_FITS] \{ . \}
5922 . el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
5924 . po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
5927 . if \\n[#PRINT_STYLE]=1 \{\
5928 . if \\n[#SLANT_ON] \{\
5929 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
5934 \# ====================================================================
5938 \# FOOTERS (off or on)
5939 \# -------------------
5941 \# <none> | <anything>
5943 \# Turns footers at the bottom of the page off or on.
5945 \# Default is off. If on, page numbers automatically go at
5946 \# the top, centered, unless pagination has been turned off,
5947 \# or the pagenumber position has been changed to left or right.
5952 . PAGE_NUM_POS TOP CENTER
5954 . el \{ .nr #FOOTERS_ON 0 \}
5963 \# Creates or modifies register #FOOTER_MARGIN which holds the
5964 \# amount of space to leave between the page number and the bottom
5967 \# Unit of measure required. Default is 3P.
5969 .MAC FOOTER_MARGIN END
5970 . ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
5978 \# <distance from end of running text to page # or footer>
5980 \# Creates or modifies register #FOOTER_GAP which holds the
5981 \# amount of space to leave between running text and the page number.
5983 \# Requires unit of measure. Default is 3P. Measured baseline to
5987 . ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
5997 \# Places footer at bottom of page if #FOOTERS=1, otherwise
5998 \# places page number at bottom of page (if #PAGINATE=1).
5999 \# Page numbers are in arabic or roman according to COPYSTYLE.
6000 \# DRAFT starts the document at page 1 regardless of PAGENUMBER.
6001 \# FINAL respects PAGENUMBER.
6005 . nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
6006 . if !\\n[#FN_DEFER] \{\
6008 . if \\n[#FN_COUNT] \{\
6009 . sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u)
6010 . po \\n[#DOC_L_MARGIN]u
6011 . if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
6015 . if '\\n(.z'FN_OVERFLOW' \{\
6017 . nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
6020 . if \\n[#COL_NEXT] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
6023 . ie \\n[#COLUMNS] \{\
6024 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
6027 . po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6028 . PROCESS_FN_LEFTOVER
6029 . if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
6030 . if !\\n[#QUOTE] \{ .rr #COL_NEXT \}
6031 . if \\n[#QUOTE] \{\
6032 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
6033 . if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
6034 . po \\n[#Q_OFFSET]u
6036 . if \\n[#EPIGRAPH] \{\
6037 . nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6038 . if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
6039 . po \\n[#EPI_OFFSET]u
6041 . ie \\n[#EPIGRAPH] \{\
6042 . ie !\\n[#EPI_ACTIVE] \{\
6047 . sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
6056 . el \{ .DO_FOOTER \}
6065 \# Prints footer (page number, or 3-part footer).
6066 \# Resets CAPS and UNDERLINE if they were on.
6069 . sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
6071 . po \\n[#DOC_L_MARGIN]u
6072 . ll \\n[#DOC_L_LENGTH]u
6074 . FAMILY \\*[$HDRFTR_FAM]
6076 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
6077 . if \\n[#PRINT_STYLE]=1 \{\
6082 . nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
6083 . if \\n[#CAPS_ON] \{\
6087 . if \\n[#UNDERLINE_ON] \{\
6088 . nr #UNDERLINE_WAS_ON 1
6091 . ie \\n[#FOOTERS_ON] \{\
6095 . if \\n[#PAGINATE] \{\
6096 . if \\n[#PAGE_NUM_V_POS]=2 \{ .PRINT_PAGE_NUMBER \}
6099 . if \\n[#CAPS_WAS_ON] \{\
6103 . if \\n[#UNDERLINE_WAS_ON] \{\
6105 . rr #UNDERLINE_WAS_ON
6112 \# ====================================================================
6116 \# ---Head numbers---
6121 \# <none> | <anything>
6123 \# Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
6127 .MAC NUMBER_HEADS END
6130 . if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
6132 . el \{ .rr #NUMBER_HEAD \}
6136 \# RESET HEAD NUMBER
6137 \# -----------------
6139 \# <none> | <desired head number>
6141 \# Resets incrementing register #HEAD_NUM to 1 or, if there's
6142 \# an argument, to user supplied number.
6144 \# Also resets subhead and parahead numbers. If this is not
6145 \# desired, subhead and parahead numbers may be reset individually.
6147 .MAC RESET_HEAD_NUMBER END
6154 . nr #HEAD_NUM \\$1-1 1
6164 \# <none> | <anything>
6166 \# Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
6170 .MAC NUMBER_SUBHEADS END
6173 . if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
6175 . el \{ .rr #NUMBER_SH \}
6179 \# RESET SUBHEAD NUMBER
6180 \# --------------------
6182 \# <none> | <desired subhead number>
6184 \# Resets incrementing register #SH_NUM to 1 or, if there's
6185 \# an argument, to user supplied number.
6187 \# When the subhead number is reset, it resets the parahead number as
6188 \# well. If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
6189 \# allows the user to set the parahead number to whatever s/he desires.
6191 .MAC RESET_SUBHEAD_NUMBER END
6192 . ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
6194 . nr #SH_NUM \\$1-1 1
6203 \# <none> | <anything>
6205 \# Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
6209 .MAC NUMBER_PARAHEADS END
6212 . if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
6214 . el \{ .rr #NUMBER_PH \}
6218 \# RESET PARAHEAD NUMBER
6219 \# ---------------------
6221 \# <none> | <desired parahead number>
6223 \# Resets incrementing register #PH_NUM to 1 or, if there's
6224 \# an argument, to user supplied number.
6226 \# Resetting the parahead number resets the parahead number
6229 .MAC RESET_PARAHEAD_NUMBER END
6230 . ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
6231 . el \{ nr #SH_NUM \\$1-1 1 \}
6240 \# <family to use for section titles (main heads)>
6242 \# Creates or modifies string $HEAD_FAM.
6244 \# Default is same as running text.
6246 .MAC HEAD_FAMILY END
6254 \# <font to use for section titles (main heads)>
6256 \# Creates or modifies string $HEAD_FT.
6268 \# <+|- number of points by which to in/decrease point size of
6269 \# section titles (relative to running text)>
6271 \# Creates or modifies string $HEAD_SIZE_CHANGE.
6273 \# Must be preceded by a - or + sign with no space afterwards.
6274 \# Fractional point sizes are allowed.
6275 \# Default +1 for printstyle TYPESET; +0 for TYPEWRITE.
6278 . ds $HEAD_SIZE_CHANGE \\$1
6285 \# L | LEFT | R | RIGHT | C | CENTER | CENTRE
6287 \# Creates or modifies string $HEAD_QUAD.
6289 \# Default is CENTER.
6292 . ds $HEAD_QUAD \\$1
6299 \# <none> | <anything>
6301 \# Creates or modifies register #HEAD_CAPS.
6306 . ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
6307 . el \{ .nr #HEAD_CAPS 0 \}
6314 \# <none> | <anything>
6316 \# Creates register #HEAD_SPACE, which toggles whether the space
6317 \# before heads is 1 extra line space ("off") or 2 ("on"). Used only
6318 \# in PRINTSTYLE TYPESET.
6323 . ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
6324 . el \{ .nr #HEAD_SPACE 0 \}
6331 \# <none> | <anything>
6333 \# Creates or modifies register #HEAD_UNDERLINE.
6337 .MAC HEAD_UNDERLINE END
6338 . ie '\\$1'' \{ .nr #HEAD_UNDERLINE 1 \}
6339 . el \{ .nr #HEAD_UNDERLINE 0 \}
6346 \# "text of main head" ["text of main head"] ...
6348 \# In TYPEWRITE, prints main heads centered, all caps, underlined.
6349 \# In TYPESET, prints bold main heads 1 point larger than running
6350 \# text, all caps, underlined.
6352 \# The HEAD macro requires that double-quotes (") surround
6353 \# each line of text.
6360 . ll \\n[#L_LENGTH]u
6362 . if \\n[#COLUMNS] \{\
6363 . ll \\n[#COL_L_LENGTH]u
6367 . QUAD \\*[$HEAD_QUAD]
6368 . if \\n[#PRINT_STYLE]=1 \{\
6372 . vs \\n[#DOC_LEAD]u
6375 . if \\n[#PRINT_STYLE]=2 \{\
6376 . FAMILY \\*[$HEAD_FAM]
6378 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
6379 . LS \\n[#DOC_LEAD]u
6381 . if r#QUOTE \{ .rr #QUOTE \}
6382 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
6383 . if \\n[#PRINT_STYLE]=1 \{ .ne 3 \}
6384 . if \\n[#PRINT_STYLE]=2 \{\
6385 . ie \\n[#HEAD_SPACE] \{ .ne 5 \}
6388 . ie \\n[#START] \{\
6389 . if \\n[#DOC_HEADER]=0 \{ . \}
6392 . if \\n[#PRINT_STYLE]=1 \{\
6393 . if !\\n[#LINEBREAK] \{\
6394 . ALD \\n[#DOC_LEAD]u
6395 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6398 . if \\n[#PRINT_STYLE]=2 \{\
6399 . ie \\n[#PP_SPACE] \{\
6400 . ie \\n[#END_QUOTE] \{ . \}
6402 . if !\\n[#LINEBREAK] \{\
6403 . if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6408 . ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
6409 . el \{ .ALD \\n[#DOC_LEAD]u \}
6411 . if \\n[#END_QUOTE] \{\
6412 . if !\\n[#Q_FITS] \{\
6413 . RLD \\n[#DOC_LEAD]u
6414 . if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
6416 . if \\n[#Q_AT_TOP] \{\
6417 . RLD \\n[#DOC_LEAD]u
6418 . if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
6421 . if \\n[#LINEBREAK] \{\
6422 . if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
6426 . if \\n[#HEAD_CAPS] \{ .CAPS \}
6427 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6428 . ie \\n[#NUMBER_HEAD] \{\
6429 . ie \\n[#ARG_NUM]=0 \{\
6431 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
6432 . el \{ .UNDERSCORE "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
6437 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
6438 . el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
6444 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
6445 . el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
6452 . ALD \\n[#DOC_LEAD]u
6453 . RESET_SUBHEAD_NUMBER
6454 . RESET_PARAHEAD_NUMBER
6455 . if r#START \{ .rr #START \}
6456 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
6457 . if r#QUOTE \{ .rr #QUOTE \}
6458 . if r#Q_FITS \{ .rr #Q_FITS \}
6459 . if r#END_QUOTE \{ .rr #END_QUOTE \}
6460 . if r#LINEBREAK \{ .rr #LINEBREAK \}
6461 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
6462 . if r#PP_ACTIVE \{ .rr #PP_ACTIVE \}
6473 \# <family to use in subheads>
6475 \# Creates or modifies string $SH_FAM.
6477 \# Default is same as running text.
6479 .MAC SUBHEAD_FAMILY END
6487 \# <font to use in subheads>
6489 \# Creates or modifies string $SH_FT.
6493 .MAC SUBHEAD_FONT END
6501 \# <+|- number of points by which to in/decrease point size of subheads
6502 \# (relative to running text)>
6504 \# Creates or modifies string $SH_SIZE_CHANGE.
6506 \# Must be preceded by a +|- sign. No space afterwards.
6507 \# Fractional point sizes are allowed.
6508 \# Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
6510 .MAC SUBHEAD_SIZE END
6511 . ds $SH_SIZE_CHANGE \\$1
6518 \# L | LEFT | R | RIGHT | C | CENTER | CENTRE
6520 \# Creates or modifies string $SH_QUAD.
6522 \# Default is LEFT for both TYPESET and TYPEWRITE.
6524 .MAC SUBHEAD_QUAD END
6532 \# "text of subhead" ["text of subhead"] ...
6534 \# In TYPEWRITE, prints subheads underlined.
6535 \# In TYPESET, prints subheads bold, .5 points larger than running
6537 \# In both styles, a line space precedes the subhead, and a small
6538 \# amount of lead comes after.
6540 \# As with the HEAD macro, double-quotes (") must surround
6541 \# each line of text.
6546 . if r#QUOTE \{ .rr #QUOTE \}
6547 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
6549 . ll \\n[#L_LENGTH]u
6551 . if \\n[#COLUMNS] \{\
6552 . ll \\n[#COL_L_LENGTH]u
6556 . if \\n[#PRINT_STYLE]=1 \{\
6560 . vs \\n[#DOC_LEAD]u
6561 . QUAD \\*[$SH_QUAD]
6564 . if \\n[#PRINT_STYLE]=2 \{\
6565 . FAMILY \\*[$SH_FAM]
6567 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
6568 . LS \\n[#DOC_LEAD]u
6569 . QUAD \\*[$SH_QUAD]
6571 . if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
6572 . if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
6573 . ie \\n[#START] \{ . \}
6575 . ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]u*2u) ) \{\
6576 . ie \\n[#COLUMNS] \{ .COL_NEXT \}
6580 . ie \\n[#HEAD]=1 \{ . \}
6582 . if \\n[#PRINT_STYLE]=1 \{\
6583 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
6585 . if \\n[#PRINT_STYLE]=2 \{\
6586 . ie \\n[#PP_SPACE]=1 \{\
6587 . ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
6588 . el \{ .RLD \\n[#DOC_LEAD]u \}
6591 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
6597 . if \\n[#PRINT_STYLE]=1 \{\
6598 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6599 . ie \\n[#NUMBER_SH] \{\
6600 . ie \\n[#ARG_NUM]=0 \{\
6601 . ie \\n[#NUMBER_HEAD] \{\
6603 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
6608 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
6614 . ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
6615 . el \{ .UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
6621 . UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
6626 . if \\n[#PRINT_STYLE]=1 \{\
6627 . if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6629 . if \\n[#PRINT_STYLE]=2 \{\
6630 . ie \\n[#PP_SPACE]=0 \{\
6631 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6632 . ie \\n[#NUMBER_SH] \{\
6633 . ie \\n[#ARG_NUM]=0 \{\
6634 . ie \\n[#NUMBER_HEAD] \{\
6636 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
6641 . PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
6647 . PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
6653 . PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
6659 . ALD \\n[#DOC_LEAD]u
6660 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
6661 . if \\n[#END_QUOTE] \{ .RLD \\n[#DOC_LEAD]u \}
6662 . if \\n[#EPIGRAPH] \{ .RLD \\n[#DOC_LEAD]u \}
6663 . while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6664 . PRINT "\\$[\\n+[#ARG_NUM]]
6666 . ALD \\n[#DOC_LEAD]u
6671 . RESET_PARAHEAD_NUMBER
6672 . if r#START \{ .rr #START \}
6673 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
6674 . if r#Q_FITS \{ .rr #Q_FITS \}
6675 . if r#END_QUOTE \{ .rr #END_QUOTE \}
6676 . if r#LINEBREAK \{ .rr #LINEBREAK \}
6681 \# ---Paragraph heads---
6686 \# <family to use in paraheads>
6688 \# Creates or modifies string $PH_FAM.
6690 \# Default is same as running text.
6692 .MAC PARAHEAD_FAMILY END
6700 \# <font to use in paraheads>
6702 \# Creates or modifies string $PH_FT.
6704 \# Default is bold italic for TYPESET; underlined for TYPEWRITE.
6706 .MAC PARAHEAD_FONT END
6714 \# <+|- number of points by which to in/decrease point size of subheads
6715 \# (relative to running text)>
6717 \# Creates or modifies string $PH_SIZE_CHANGE.
6719 \# Must be preceded by a +|- sign. No space afterwards.
6720 \# Fractional point sizes are allowed. No unit of measure, please.
6721 \# Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
6723 .MAC PARAHEAD_SIZE END
6724 . ds $PH_SIZE_CHANGE \\$1
6733 \# Creates or modifies register #PH_INDENT.
6735 \# Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
6737 .MAC PARAHEAD_INDENT END
6738 . nr #PH_INDENT (\\$1)
6747 \# Deposits a paragraph head at the start and into the body of a
6750 \# PARAHEAD *must* come after PP.
6753 . if \\n[#SLANT_ON] \{\
6754 . nr #SLANT_WAS_ON 1
6758 . if \\n[#INDENT_FIRST_PARAS] \{\
6759 . ti \\n[#PH_INDENT]u
6762 . el \{ .ti \\n[#PH_INDENT]u \}
6763 . if \\n[#PRINT_STYLE]=1 \{\
6768 . ie \\n[#NUMBER_PH] \{\
6769 . if \\n[#NUMBER_HEAD] \{\
6770 . ie \\n[#NUMBER_SH] \{\
6771 . UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
6775 . UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1
6779 . ie \\n[#NUMBER_SH] \{\
6780 . if !\\n[#NUMBERED] \{\
6781 . UNDERSCORE "\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1
6786 . if !\\n[#NUMBERED] \{\
6787 . UNDERSCORE "\\n+[#PH_NUM].\\ \\$1
6796 . if \\n[#SLANT_WAS_ON] \{\
6797 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
6798 . if \\n[#SLANT_MEANS_SLANT] \{\
6804 . if \\n[#PRINT_STYLE]=2 \{\
6807 . PT_SIZE \\*[$PH_SIZE_CHANGE]
6808 . ie \\n[#NUMBER_PH] \{\
6809 . if \\n[#NUMBER_HEAD] \{\
6810 . ie \\n[#NUMBER_SH] \{\
6811 . PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
6814 . PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
6817 . ie \\n[#NUMBER_SH] \{\
6818 . if !\\n[#NUMBERED] \{\
6819 . PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
6823 . if !\\n[#NUMBERED] \{\
6824 . PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
6829 . PRINT "\\$1\h'.6m'\c"
6831 . FAMILY \\*[$DOC_FAM]
6833 . PT_SIZE \\n[#DOC_PT_SIZE]u
6834 . if \\n[#SLANT_WAS_ON] \{\
6835 . rr #SLANT_WAS_ON 1
6843 \# ====================================================================
6845 \# +++LINE BREAKS+++
6847 \# LINEBREAK CHARACTER
6848 \# -------------------
6850 \# [character] [iterations] [vertical adjustment]
6852 \# Allows user to specify a line break character and the number
6853 \# of times to repeat it horiontally.
6855 \# Without an argument, LINEBREAK_CHAR will deposit a blank line.
6857 \# Vertical adjustment requires a unit of measure (most likely
6858 \# "p"), and has to be preceded by +|-
6860 .MAC LINEBREAK_CHAR END
6862 . ds $LINEBREAK_CHAR \\$1
6863 . ds $LINEBREAK_CHAR_V_ADJ \\$3
6864 . if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
6865 . ds $LINEBREAK_CHAR_V_ADJ +0
6867 . while \\$2>\\n[#REPEAT] \{\
6868 . as $LINEBREAK_CHAR "\\ \\$1
6869 . nr #REPEAT \\n[#REPEAT]+1
6880 \# Deposits line break character.
6882 \# If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
6885 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
6886 . po \\n[#DOC_L_MARGIN]u
6887 . ie '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
6889 . if \\n[#PRINT_STYLE]=1 \{\
6890 . ie \\n[#END_QUOTE] \{ . \}
6891 . el \{ .ALD \\n[#DOC_LEAD]u \}
6893 . if \\n[#PRINT_STYLE]=2 \{\
6894 . ie \\n[#END_QUOTE] \{ . \}
6895 . el \{ .ALD \\n[#DOC_LEAD]u \}
6898 . PRINT \\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'
6899 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
6900 . if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
6901 . QUAD \\*[$DOC_QUAD]
6904 . if r#QUOTE \{ .rr #QUOTE \}
6905 . if r#END_QUOTE \{ .rr #END_QUOTE \}
6909 \# ====================================================================
6916 \# <font of running text>
6918 \# Creates or modifies string $PP_FT.
6920 \# Affects all paragraphs.
6923 . if \\n[#IGNORE] \{ .return \}
6933 \# <amount to indent paragraphs in running text (ipPcm)>
6935 \# Allows user to change the default para indent. The change will
6936 \# affect the indent of QUOTEs and BLOCKQUOTEs as well.
6938 \# Default for printstyle TYPEWRITE is 1/2-inch. Default for
6939 \# printstyle TYPESET is 2 ems. The defaults are set in
6940 \# PRINTSTYLE, not DEFAULTS.
6942 .MAC PARA_INDENT END
6943 . nr #PP_INDENT (\\$1)
6947 \# INDENT FIRST PARAGRAPHS
6948 \# -----------------------
6950 \# <none> | <anything>
6952 \# By default, the first para of a document, as well as the first
6953 \# paras of blockquotes and block-style epigraphs are not indented.
6954 \# When invoked, this macro will indent all paras.
6958 .MAC INDENT_FIRST_PARAS END
6959 . ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
6960 . el \{ .rr #INDENT_FIRST_PARAS \}
6964 \# INTER-PARAGRAPH SPACING
6965 \# -----------------------
6967 \# <none> | <anything>
6969 \# Adds a line space between paragraphs in body text. Block quotes
6972 \# Default is OFF. PARA_SPACE ON is not recommended for use
6973 \# with PRINTSTYLE TYPEWRITE.
6976 . ie '\\$1'' \{ .nr #PP_SPACE 1 \}
6977 . el \{ .rr #PP_SPACE \}
6986 \# Figures out what to do with paragraphs under differing conditions.
6988 \# For the time being, there's no automatic widow/orphan control.
6989 \# Controlling them isn't just a matter of establishing an arbitrary
6990 \# number of lines needed for a para, since groff doesn't then
6991 \# handle single line paragraphs gracefully. Usually, the whole
6992 \# page needs to be tweaked.
6994 \# Note the use of transparent line break (\!.br) to get
6995 \# PP to work within blockquotes and epigraphs.
6997 \# PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
7001 . if \\n[#DOC_TYPE]=4 \{\
7002 . if !'\\n(.z'' \{ .di \}
7006 . QUAD \\*[$DOC_QUAD]
7007 . ALD \\n[#DOC_LEAD]u*2u
7013 . ALD \\n[#DOC_LEAD]u
7019 . ALD \\n[#DOC_LEAD]u
7022 . if \\n[#GREETING] \{\
7025 . ALD \\n[#DOC_LEAD]u
7030 . if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7031 . if \\n[#PP_STYLE]=1 \{\
7032 . if \\n[#ENDNOTE] \{\
7033 . nr #RESET_PARA_SPACE \\n[#PP_SPACE]
7034 . ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
7035 . el \{ .PARA_SPACE OFF \}
7038 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
7039 . if \\n[#COLUMNS] \{\
7040 . if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
7042 . if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7043 . ie \\n[#PRINT_STYLE]=1 \{\
7047 . vs \\n[#DOC_LEAD]u
7048 . QUAD \\*[$DOC_QUAD]
7050 . if \\n[#SLANT_ON] \{\
7051 . if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
7055 . ie \\n[#ENDNOTE] \{\
7056 . FAMILY \\*[$EN_FAM]
7058 . PT_SIZE \\n[#EN_PS]u
7059 . LS \\n[#DOC_LEAD]u
7060 . QUAD \\*[$EN_QUAD]
7063 . FAMILY \\*[$DOC_FAM]
7065 . PT_SIZE \\n[#DOC_PT_SIZE]u
7066 . LS \\n[#DOC_LEAD]u
7067 . QUAD \\*[$DOC_QUAD]
7071 . if \\n[#INDENT_FIRST_PARAS] \{\
7072 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7073 . el \{ .ti \\n[#PP_INDENT]u \}
7074 . if '\\n(.z'END_NOTES' \{\
7075 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7078 . if r#END_QUOTE \{\
7079 . if \\n[#END_QUOTE] \{\
7080 . if !\\n[#LINEBREAK] \{\
7081 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7082 . el \{ .ti \\n[#PP_INDENT]u \}
7083 . if '\\n(.z'END_NOTES' \{\
7084 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7092 . if \\n[#PP_SPACE] \{\
7093 . if \\n[#PRINT_STYLE]=2 \{\
7094 . ie \\n[#END_QUOTE] \{\
7097 . el \{ .ALD \\n[#DOC_LEAD]u \}
7100 . ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7101 . el \{ .ti \\n[#PP_INDENT]u \}
7102 . if '\\n(.z'END_NOTES' \{\
7103 . ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7106 . if r#START \{ .rr #START \}
7107 . if r#QUOTE \{ .rr #QUOTE \}
7108 . if r#END_QUOTE \{ .rr #END_QUOTE \}
7109 . if r#HEAD \{ .rr #HEAD \}
7110 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
7111 . if r#Q_FITS \{ .rr #Q_FITS \}
7112 . if r#LINEBREAK \{ .rr #LINEBREAK \}
7113 . if \\n[#ENDNOTE] \{\
7114 . ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
7115 . el \{ .PARA_SPACE OFF \}
7117 . if \\n[#CONDENSE] \{\
7120 . if \\n[#EXTEND]=1 \{\
7125 . if \\n[#PP_STYLE]=2 \{\
7127 . if \\n[#BROKEN_QUOTE] \{\
7128 . ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
7129 . el \{ .nr #Q_PP 0 \}
7132 . ie \\n[#Q_PP]=0 \{\
7133 . if \\n[#INDENT_FIRST_PARAS] \{\
7134 . ti \\n[#PP_INDENT]u/2u
7136 . if \\n[#ENDNOTE] \{\
7137 . ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
7142 . ti \\n[#PP_INDENT]u/2u
7144 . if \\n[#CONDENSE] \{\
7147 . if \\n[#EXTEND]=1 \{\
7155 \# ====================================================================
7159 \# ---Line for line (poetic) quotes---
7164 \# <family to use in line for line quotes>
7166 \# Creates or modifies string $QUOTE_FAM.
7168 \# Default is same as running text.
7170 .MAC QUOTE_FAMILY END
7171 . ds $QUOTE_FAM \\$1
7178 \# <font to use in line for line quotes>
7180 \# Creates or modifies string $QUOTE_FT.
7182 \# Default is italic for TYPESET.
7192 \# <-|+ number of points by which to de/increase point size of
7193 \# line for line quotes (relative to running text)>
7195 \# Creates or modifies string $QUOTE_SIZE_CHANGE.
7197 \# Must be preceded by a - or + sign with no space afterwards.
7198 \# Fractional point sizes are allowed.
7202 . ds $QUOTE_SIZE_CHANGE \\$1
7209 \# <none> | <anything>
7211 \# Creates or modifies register #UNDERLINE_QUOTES (toggle).
7212 \# If on, line for line quotes are underlined when printstyle
7215 \# Default is ON for printstyle TYPEWRITE.
7217 .MAC UNDERLINE_QUOTES END
7218 . ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
7219 . el \{ .rr #UNDERLINE_QUOTES \}
7226 \# <value by which to multiply PP_INDENT for indented quoted text>
7228 \# Creates or modifies register #Q_OFFSET_VALUE.
7230 \# Default is 3 for typeset; 2 for typewrite
7232 .MAC QUOTE_INDENT END
7233 . nr #Q_OFFSET_VALUE \\$1
7237 \# ALWAYS FULLSPACE QUOTES
7238 \# -----------------------
7240 \# <none> | <anything>
7242 \# Toggles register #FULLSPACE_QUOTES.
7244 \# If user doesn't like the default 1/2 line space above and below
7245 \# quotes, s/he can turn it off here. Has no effect in TYPEWRITE.
7247 .MAC ALWAYS_FULLSPACE_QUOTES END
7248 . if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
7249 . el \{ .rr #FULLSPACE_QUOTES \}
7256 \# <none> | <anything>
7258 \# Indents quoted text on a line for line basis, or turns QUOTE off.
7260 \# Owing to the need to bottom align TYPESET pages, quoted text gets
7261 \# diverted so its depth can be measured (in DO_QUOTE) for determining
7262 \# how much space to put before and after.
7266 \# **Uncomment the next line to prevent orphaned quote lines.
7272 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7274 . if \\n[#COLUMNS] \{\
7275 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7278 . if \\n[#PRINT_STYLE]=1 \{\
7282 . vs \\n[#DOC_LEAD]u
7285 . if \\n[#PRINT_STYLE]=2 \{\
7286 . FAMILY \\*[$QUOTE_FAM]
7288 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
7289 . LS \\n[#DOC_LEAD]u
7293 . if \\n[#PRINT_STYLE]=1 \{\
7294 . if \\n[#UNDERLINE_QUOTES] \{\
7299 . el \{ .DO_QUOTE \}
7303 \# ---Blockquotes---
7305 \# BLOCKQUOTE FAMILY
7306 \# -----------------
7308 \# <family to use in blockquotes>
7310 \# Creates or modifies string $BQUOTE_FAM.
7312 \# Default is same as running text.
7314 .MAC BLOCKQUOTE_FAMILY END
7315 . ds $BQUOTE_FAM \\$1
7322 \# <font to use in blockquotes>
7324 \# Creates or modifies string $BQUOTE_FT.
7326 \# Default is same as running text.
7328 .MAC BLOCKQUOTE_FONT END
7329 . ds $BQUOTE_FT \\$1
7336 \# <-|+ number of points by which to de/increase point size of blockquotes
7337 \# (relative to running text)>
7339 \# Creates or modifies string $BQUOTE_SIZE_CHANGE.
7341 \# Must be preceded by a - or + sign with no space afterwards.
7342 \# Fractional point sizes are allowed.
7343 \# Default is -1 for printstyle TYPESET; +0 for TYPEWRITE.
7345 .MAC BLOCKQUOTE_SIZE END
7346 . ds $BQUOTE_SIZE_CHANGE \\$1
7353 \# <quad to use in blockquotes>
7355 \# Creates or modifies string $BQUOTE_QUAD.
7359 .MAC BLOCKQUOTE_QUAD END
7360 . ds $BQUOTE_QUAD \\$1
7367 \# <none> | <anything>
7369 \# Indents quoted text in fill mode and shortens line length
7370 \# accordingly, or turns BLOCKQUOTE off.
7372 \# Owing to the need to bottom align TYPESET pages, quoted text gets
7373 \# diverted so its depth can be measured (in DO_QUOTE) for determining
7374 \# how much space to put before and after.
7376 \# .PP after blockquote is optional if there's only one para,
7377 \# but REQUIRED if there's more than one.
7387 . ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7388 . if \\n[#ENDNOTE] \{\
7389 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
7390 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7392 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
7393 . ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7398 . if \\n[#COLUMNS] \{\
7399 . ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7400 . if \\n[#ENDNOTE] \{\
7401 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
7402 . ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7404 . if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
7405 . ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7410 . if \\n[#PRINT_STYLE]=1 \{\
7414 . vs \\n[#DOC_LEAD]u
7418 . if \\n[#PRINT_STYLE]=2 \{\
7419 . FAMILY \\*[$BQUOTE_FAM]
7420 . FT \\*[$BQUOTE_FT]
7421 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
7422 . LS \\n[#DOC_LEAD]u
7423 . if \\n[#ENDNOTE] \{\
7424 . PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
7426 . QUAD \\*[$BQUOTE_QUAD]
7430 . if \\n[#INDENT_FIRST_PARAS] \{\
7431 . ie !\\n[#ENDNOTE] \{\
7432 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
7433 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
7436 . if \\n[#INDENT_FIRSTS]=1 \{\
7437 . if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
7438 . if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
7443 . el \{ .DO_QUOTE \}
7452 \# Ends the diversion P_QUOTE or B_QUOTE. Spaces them according to
7453 \# PRINT_STYLE, whether there's inter-paragraph spacing, and page
7454 \# position. TYPEWRITE treats spacing the same way in all circumstance
7455 \# (viz. an extra line space). TYPESET puts in only half
7456 \# line spaces if the entire quote plus 1 line of body under the quote
7457 \# fits on the the page; otherwise it puts in a full extra blank
7458 \# line. (This is to ensure the page remains bottom aligned).
7464 \# **Change *1 to *2 in next line to prevent orphans after quotes
7465 . if \\n[#ENDNOTE] \{\
7466 . nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
7467 . ALWAYS_FULLSPACE_QUOTES
7469 . nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
7470 . if \\n[#PRINT_STYLE]=1 \{\
7471 . if \\n[#START]=1 \{ . \}
7472 . if \\n[#START]=0 \{\
7473 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7476 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
7479 . if \\n[#PRINT_STYLE]=2 \{\
7480 . ie \\n[#PP_SPACE] \{\
7481 . ie \\n[#HEAD]>0 \{ . \}
7483 . ie \\n[#START] \{ . \}
7484 . el \{ .ALD \\n[#DOC_LEAD]u \}
7488 . ie \\n[#Q_DEPTH]<\\n[#TRAP_DISTANCE] \{\
7490 . ie \\n[#HEAD]=1 \{ . \}
7492 . ie \\n[#START] \{ . \}
7494 . ie \\n[#FULLSPACE_QUOTES] \{\
7495 . ALD \\n[#DOC_LEAD]u
7497 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
7504 . if \\n[#HEAD]=1 \{ . \}
7506 . el \{ .ALD \\n[#EN_LEAD]u \}
7510 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
7511 . if \\n[#COLUMNS] \{\
7512 . nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
7514 . if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
7515 . if \\n[#ENDNOTE] \{\
7516 . in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
7518 . if \\n[#QUOTE]=1 \{\
7521 . if !\\n[#START] \{ .rr #QUOTE \}
7523 . if \\n[#QUOTE]=2 \{\
7527 . if \\n[#PRINT_STYLE]=1 \{\
7528 . ALD \\n[#DOC_LEAD]u
7530 . if \\n[#PRINT_STYLE]=2 \{\
7531 . ie \\n[#START] \{\
7532 . ie \\n[#PP_SPACE] \{ . \}
7533 . el \{ .ALD \\n[#DOC_LEAD]u \}
7536 . ie \\n[#PP_SPACE] \{ . \}
7538 . ie \\n[#HEAD]=1 \{ .ALD \\n[#DOC_LEAD]u \}
7540 . ie \\n[#Q_FITS] \{\
7541 . ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
7543 . ALD \\n[#DOC_LEAD]u
7546 . ie \\n[#FULLSPACE_QUOTES] \{ .ALD \\n[#DOC_LEAD]u \}
7547 . el \{ .ALD \\n[#DOC_LEAD]u/2u \}
7550 . el \{ .ALD \\n[#DOC_LEAD]u \}
7555 . if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
7556 . if r#HEAD \{ .rr #HEAD \}
7557 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
7562 . if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
7563 . if \\n[#ENDNOTE] \{\
7564 . in \\n[#EN_TEXT_INDENT]u
7566 . if \\n[#COLUMNS] \{\
7567 . if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
7568 . if \\n[#ENDNOTE] \{\
7569 . in \\n[#EN_TEXT_INDENT]u
7572 . ie !\\n[#ENDNOTE] \{\
7573 . nr #RESET_PP_INDENT \\n[#PP_INDENT]
7576 . PARA_INDENT \\n[#RESET_PP_INDENT]u
7577 . QUAD \\*[$DOC_QUAD]
7580 . nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
7581 . ENDNOTE_PARA_INDENT 0
7583 . ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
7588 \# ====================================================================
7595 \# Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
7596 \# page, and reinvokes BLOCKQUOTE.
7598 \# Because quotes go into a diversion before they're output,
7599 \# footnotes in quotes that cross pages behave erratically. The footnote
7600 \# isn't processed until the diversion ends, hence the footnote
7601 \# marker in the quote isn't always correct for the new page (it's
7602 \# picked up from the old one). BREAK_QUOTE is a workaround for
7605 .MAC BREAK_QUOTE END
7608 . nr #BROKEN_QUOTE 1
7611 . nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
7612 . if \\n[#PRINT_STYLE]=1 \{\
7613 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7615 . if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
7618 . if \\n[#PRINT_STYLE]=2 \{\
7619 . ie \\n[#PP_SPACE] \{\
7620 . ie \\n[#HEAD]=1 \{ . \}
7622 . if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7628 . if \\n[#HEAD]=1 \{ . \}
7630 . el \{ .ALD \\n[#DOC_LEAD]u \}
7633 . nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
7634 . if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
7635 . po \\n[#Q_OFFSET]u
7636 . if \\n[#QUOTE]=1 \{\
7639 . if !\\n[#START] \{ .rr #QUOTE \}
7641 . if \\n[#QUOTE]=2 \{\
7645 . if r#HEAD \{ .rr #HEAD \}
7646 . if r#EPIGRAPH \{ .rr #EPIGRAPH \}
7651 . if \\n[#PRINT_STYLE]=1 \{\
7652 . if \\n[#UNDERLINE_QUOTES] \{\
7656 . po \\n[#L_MARGIN]u
7657 . if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
7658 . QUAD \\*[$DOC_QUAD]
7659 . sp |\\n[#PAGE_LENGTH]u \" To trip footer/header
7663 \# ====================================================================
7670 \# <none> | <anything>
7672 \# Turns page numbering off or on.
7674 \# Page numbering is on by default with .PAPER.
7678 . ie '\\$1'' \{ .nr #PAGINATE 1 \}
7679 . el \{ .nr #PAGINATE 0 \}
7683 \# PAGENUMBER FAMILY
7684 \# -----------------
7686 \# <family to use for page numbers>
7688 \# Creates or modifies string $PAGE_NUM_FAM.
7690 \# Default is same as running text.
7692 .MAC PAGENUM_FAMILY END
7693 . ds $PAGE_NUM_FAM \\$1
7700 \# <font to use for page numbers>
7702 \# Creates or modifies string $PAGE_NUM_FT.
7704 \# Default is same as running text.
7706 .MAC PAGENUM_FONT END
7707 . ds $PAGE_NUM_FT \\$1
7714 \# <+|- number of points by which to in/decrease point size of
7715 \# page numbers (relative to running text)>
7717 \# Creates or modifies string $PAGE_NUM_SIZE_CHANGE.
7719 \# Must be preceded by a +|- sign with no space afterward.
7720 \# Fractional point sizes are allowed.
7723 .MAC PAGENUM_SIZE END
7724 . ds $PAGE_NUM_SIZE_CHANGE \\$1
7728 \# PAGE NUMBER FORMAT
7729 \# ------------------
7731 \# DIGIT | ROMAN | roman | ALPHA | alpha
7733 \# Assigns user entered format to #PAGENUMBER.
7735 .MAC PAGENUM_STYLE END
7736 . nr #PAGENUM_STYLE_SET 1
7737 . if '\\$1'DIGIT' \{\
7738 . ds $PAGENUM_STYLE \\$1
7741 . if '\\$1'ROMAN' \{\
7742 . ds $PAGENUM_STYLE \\$1
7745 . if '\\$1'roman' \{\
7746 . ds $PAGENUM_STYLE \\$1
7749 . if '\\$1'ALPHA' \{\
7750 . ds $PAGENUM_STYLE \\$1
7753 . if '\\$1'alpha' \{\
7754 . ds $PAGENUM_STYLE \\$1
7760 \# HYPHENS AROUND PAGE NUMBERS
7761 \# ---------------------------
7763 \# <none> | <anything>
7765 \# Creates or modifies register #PAGE_NUM_HYPHENS.
7766 \# Used to dis/enable hyphens on either side of page numbers.
7770 .MAC PAGENUM_HYPHENS END
7771 . nr #PAGE_NUM_HYPHENS_SET 1
7772 . ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
7773 . el \{ .rr #PAGE_NUM_HYPHENS \}
7777 \# PAGENUMBER POSITION
7778 \# -------------------
7780 \# TOP | BOTTOM LEFT | CENTER | RIGHT
7782 \# Creates or modifies various PAGE_NUM_H | V_POS registers.
7783 \# Used to position page numbers.
7785 \# Default is center/bottom.
7787 .MAC PAGENUM_POS END
7788 . nr #PAGE_NUM_POS_SET 1
7789 . if '\\$1'TOP' \{ .nr #PAGE_NUM_V_POS 1 \}
7790 . if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
7791 . if '\\$2'LEFT' \{ .nr #PAGE_NUM_H_POS 1 \}
7792 . if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
7793 . if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
7794 . if '\\$2'RIGHT' \{ .nr #PAGE_NUM_H_POS 3 \}
7798 \# PRINT PAGE NUMBER
7799 \# -----------------
7803 \# Prints page number if PAGEINATE=1.
7805 .MAC PRINT_PAGE_NUMBER END
7807 . po \\n[#DOC_L_MARGIN]u
7808 . ll \\n[#DOC_L_LENGTH]u
7810 . FAMILY \\*[$PAGE_NUM_FAM]
7811 . FT \\*[$PAGE_NUM_FT]
7812 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
7813 . if \\n[#PRINT_STYLE]=1 \{\
7818 . if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
7820 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
7824 . ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
7827 . if \\n[#PAGE_NUM_H_POS]=2 \{.CENTER \}
7828 . if \\n[#RECTO_VERSO]=0 \{\
7829 . if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT \}
7830 . if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
7831 . if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT \}
7833 . nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
7834 . ie \\n[#DRAFT_WITH_PAGENUM] \{\
7835 . ie !\\n[#REVISION] \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT] / \\n[#PAGENUMBER]" \}
7836 . el \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT], \\*[$REVISION_STRING] \\n[#REVISION] / \\n[#PAGENUMBER]" \}
7839 . ie \\n[#PAGE_NUM_HYPHENS] \{ .PRINT "- \\n[#PAGENUMBER] -" \}
7840 . el \{ .PRINT "\\n[#PAGENUMBER]" \}
7845 \# ====================================================================
7852 \# <family to use in footnotes>
7854 \# Creates or modifies string $FN_FAM.
7856 \# Default is same as running text.
7858 .MAC FOOTNOTE_FAMILY END
7866 \# <font to use in footnotes>
7868 \# Creates or modifies string $FN_FT.
7870 \# Default is roman.
7872 .MAC FOOTNOTE_FONT END
7880 \# <+|- number of points by which to in/decrease point size of footnotes
7881 \# (relative to running text)>
7883 \# Creates or modifies string $FN_SIZE_CHANGE.
7885 \# Must be preceded by a +|- sign. No space afterwards.
7886 \# Fractional point sizes are allowed.
7887 \# Default is -2 for printstyle TYPESET; +0 for TYPEWRITE.
7889 .MAC FOOTNOTE_SIZE END
7890 . ds $FN_SIZE_CHANGE \\$1
7894 \# FOOTNOTE AUTOLEAD
7895 \# -----------------
7897 \# <autolead value for footnotes>
7899 \# Creates or modifies register #FN_AUTOLEAD.
7901 \# Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
7903 .MAC FOOTNOTE_AUTOLEAD END
7904 . nr #FN_AUTOLEAD \\$1
7911 \# <quad to use in footnotes>
7913 \# Creates or modifies string $FN_QUAD.
7915 \# Default is same as running text.
7917 .MAC FOOTNOTE_QUAD END
7925 \# <none> | <anything>
7927 \# Turns generation of footnote markers on or off.
7931 .MAC FOOTNOTE_MARKERS END
7932 . ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
7933 . el \{ .nr #FN_MARKERS 0 \}
7937 \# FOOTNOTE MARKER STYLE
7938 \# ---------------------
7942 \# Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
7943 \# the style of footnote markers.
7945 \# 1=STAR; 2=NUMBER. Default is STAR.
7947 .MAC FOOTNOTE_MARKER_STYLE END
7948 . if '\\$1'STAR' \{\
7949 . nr #FN_MARKER_STYLE 1
7951 . if '\\$1'NUMBER' \{\
7952 . nr #FN_MARKER_STYLE 2
7957 \# RESET FOOTNOTE NUMBER
7958 \# ---------------------
7962 \# Resets register #FN_NUMBER to 1. If argument is PAGE, creates
7963 \# toggle #RESET_FN_NUMBER which is checked in HEADER. If 1,
7964 \# numbered footnotes on every page start at 1.
7966 .MAC RESET_FOOTNOTE_NUMBER END
7967 . ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
7968 . el \{ .nr #RESET_FN_NUMBER 1 \}
7972 \# FOOTNOTE RULE LENGTH
7973 \# --------------------
7975 \# <length of rule used to separate footnotes from running text>
7977 \# Creates or modifies registers #FN_RULE_LENGTH.
7979 \# Requires unit of measure (iPpcm).
7980 \# Default is 4P for both PRINTSTYLEs.
7982 .MAC FOOTNOTE_RULE_LENGTH END
7983 . nr #FN_RULE_LENGTH (\\$1)
7987 \# FOOTNOTE_RULE_ADJ
7988 \# -----------------
7990 \# <number of points to raise footnote rule from it's baseline position>
7992 \# Creates or modifies register #FN_RULE_ADJ.
7994 \# Default is 3p for both TYPESTYLES.
7996 \# Requires unit of measure.
7998 .MAC FOOTNOTE_RULE_ADJ END
7999 . nr #FN_RULE_ADJ (\\$1)
8006 \# <none> | <anything>
8008 \# Turns printing of footnote separator rule on or off. If invoked as
8009 \# PRINT_FOOTNOTE_RULE, prints footnote separator rule.
8013 \# Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
8014 \# if the footnote number (#FN_COUNT) is 1.
8016 .MAC FOOTNOTE_RULE END
8017 . ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
8018 . if \\n[#FN_RULE]=0 \{ .RLD 1v \}
8019 \!. PT_SIZE 12 \"Not sure why these have to be transparently embedded, but they do.
8022 . PRINT \\v'-\\n[#FN_RULE_ADJ]u'\\l'\\n[#FN_RULE_LENGTH]u'\\v'+\\n[#FN_RULE_ADJ]u'
8023 \!. PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
8024 . QUAD \\*[$FN_QUAD]
8027 . ie '\\$1'' \{ .nr #FN_RULE 1 \}
8028 . el \{ .nr #FN_RULE 0 \}
8036 \# <none> | INDENT L|LEFT|R|RIGHT|B|BOTH <indent value> > | <anything>
8038 \# Begins collecting and diverting footnote text if no argument
8039 \# given. Otherwise, ends diversion FOOTNOTES, measures footnote
8040 \# depth, and sets footnote trap.
8042 \# The input line preceding a footnote call MUST terminate with \c
8043 \# or the footnote marker will be spaced away from the word it
8044 \# should be joined to.
8046 \# If FOOTNOTES is invoked with INDENT, the footnote will
8047 \# be indented. An indent style and an indent value must be given.
8048 \# Subsequent footnotes will NOT be indented; INDENT must be given
8049 \# for each footnote the user wants indented.
8053 . if \\n[#FN_MARKERS] \{\
8054 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
8055 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
8056 . if \\n[#PRINT_STYLE]=1 \{\
8057 . if \\n[#UNDERLINE_ON] \{\
8058 . nr #UNDERLINE_WAS_ON 1
8062 . if !\\n[#NO_FN_MARKER] \{\
8063 . if \\n[#FN_MARKER_STYLE]=1 \{\
8064 . ie \\n[#FN_COUNT_FOR_COLS] \{\
8065 . if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU3]* \}
8066 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU3]\(dg \}
8067 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \*[BU3]** \}
8068 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
8069 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU3]*** \}
8070 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
8071 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU3]**** \}
8072 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
8073 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \*[BU3]***** \}
8074 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg \}
8077 . if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU3]* \}
8078 . if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU3]\(dg \}
8079 . if \\n[#FN_COUNT]=2 \{ .PRINT \*[BU3]** \}
8080 . if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
8081 . if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU3]*** \}
8082 . if \\n[#FN_COUNT]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
8083 . if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU3]**** \}
8084 . if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
8085 . if \\n[#FN_COUNT]=8 \{ .PRINT \*[BU3]***** \}
8086 . if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg\(dg \}
8089 . if \\n[#FN_MARKER_STYLE]=2 \{\
8090 . 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" \}
8091 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]" \}
8095 . nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-(\\n(nl+1v)
8096 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
8098 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
8099 . INDENT_FIRST_PARAS
8101 . ll \\n[#DOC_L_LENGTH]u
8103 . if \\n[#COLUMNS] \{\
8104 . ll \\n[#COL_L_LENGTH]u
8107 . if \\n[#FN_R_INDENT] \{\
8108 . ll -\\n[#FN_R_INDENT]u
8111 . if \\n[#FN_BR_INDENT] \{\
8112 . ll -\\n[#FN_BR_INDENT]u
8115 . FAMILY \\*[$FN_FAM]
8117 . PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
8118 . AUTOLEAD \\n[#FN_AUTOLEAD]
8119 . QUAD \\*[$FN_QUAD]
8120 . if \\n[#PRINT_STYLE]=1 \{\
8124 . ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
8125 . el \{ .vs \\n[#DOC_LEAD]u/2u \}
8129 . nr #FN_LEAD \\n[#LEAD]
8131 . if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
8132 . if \\n[#FN_DEFER_SPACE] \{\
8133 . if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
8134 . if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
8135 . rr #FN_DEFER_SPACE
8137 . if \\n+[#FN_COUNT]=1 \{\
8138 . if !\\n[#FN_DEPTH] \{\
8139 . if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8140 . ie \\n[#FN_RULE] \{ .PRINT_FOOTNOTE_RULE \}
8144 . if \\n[#FN_MARKERS] \{\
8145 . if !\\n[#NO_FN_MARKER] \{\
8146 . if \\n[#FN_MARKER_STYLE]=1 \{\
8147 . ie \\n+[#FN_COUNT_FOR_COLS] \{\
8148 . if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT *\c \}
8149 . if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dg\c \}
8150 . if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT **\c \}
8151 . if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \(dg\(dg\c \}
8152 . if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT ***\c \}
8153 . if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \(dg\(dg\(dg\c \}
8154 . if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT ****\c \}
8155 . if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dg\(dg\(dg\(dg\c \}
8156 . if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT *****\c \}
8157 . if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
8160 . if \\n[#FN_COUNT]=1 \{ .PRINT *\c \}
8161 . if \\n[#FN_COUNT]=2 \{ .PRINT \(dg\c \}
8162 . if \\n[#FN_COUNT]=3 \{ .PRINT **\c \}
8163 . if \\n[#FN_COUNT]=4 \{ .PRINT \(dg\(dg\c \}
8164 . if \\n[#FN_COUNT]=5 \{ .PRINT ***\c \}
8165 . if \\n[#FN_COUNT]=6 \{ .PRINT \(dg\(dg\(dg\c \}
8166 . if \\n[#FN_COUNT]=7 \{ .PRINT ****\c \}
8167 . if \\n[#FN_COUNT]=8 \{ .PRINT \(dg\(dg\(dg\(dg\c \}
8168 . if \\n[#FN_COUNT]=9 \{ .PRINT *****\c \}
8169 . if \\n[#FN_COUNT]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
8172 . if \\n[#FN_MARKER_STYLE]=2 \{\
8173 . if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
8174 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\c" \}
8180 . ie '\\$1'INDENT' \{\
8182 . if '\\$2'L' \{ .in (\\$3) \}
8183 . if '\\$2'LEFT' \{ .in (\\$3) \}
8184 . if '\\$2'R' \{ .nr #FN_R_INDENT (\\$3) \}
8185 . if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
8187 . nr #FN_BL_INDENT (\\$3)
8188 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
8189 . el \{ .nr #FN_BR_INDENT (\\$4) \}
8190 . in \\n[#FN_BL_INDENT]u
8192 . if '\\$2'BOTH' \{\
8193 . nr #FN_BL_INDENT (\\$3)
8194 . ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
8195 . el \{ .nr #FN_BR_INDENT (\\$4) \}
8196 . in \\n[#FN_BL_INDENT]u
8204 . in 0 \"Turn off indent possibly set by FOOTNOTE INDENT...
8205 . if \\n[#PRINT_STYLE]=1 \{\
8206 . if \\n[#UNDERLINE_WAS_ON] \{\
8208 . rr #UNDERLINE_WAS_ON
8214 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
8215 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
8217 . nr #FN_DEPTH +\\n[#DIVER_DEPTH]
8218 . if \\n[#FN_DEFER] \{\
8219 . nr #FN_DEFER_SPACE 1
8222 . if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
8223 . ie \\n[#SPACE_REMAINING]<(\\n[#LEAD]*2) \{ .nr #FN_DEFER 1 \}
8226 . while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
8227 . nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
8231 . nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
8232 . if \\n[#FN_COUNT]=1 \{ .nr #VARIABLE_FOOTER_POS -1v \}
8234 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
8235 . if (\\n(nl+1v)>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
8236 . ch FOOTER \\n(nlu+1v
8238 . if \\n[#FN_DEFER] \{\
8239 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
8240 . ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
8243 . nr #NO_FN_MARKER 0
8247 .MAC FN_OVERFLOW_TRAP END
8248 . if \\n[#FN_COUNT] \{\
8254 .MAC DIVERT_FN_LEFTOVER END
8255 . nr #NO_FN_MARKER 1
8261 . rr #FN_OVERFLOW_DEPTH
8265 .MAC PROCESS_FN_LEFTOVER END
8266 . if !\\n[#FN_DEFER] \{\
8269 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
8271 . if \\n[#FN_DEFER] \{\
8272 . nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]+\\n[#DOC_LEAD])
8274 . nr #SPACE_REMAINING 0
8275 . ch FOOTER -\\n[#B_MARGIN]u
8276 . if \\n[#FN_DEFER] \{\
8277 . nr #NO_FN_MARKER 1
8284 . if !\\n[#FN_DEFER] \{\
8285 . if \\n[#FN_OVERFLOW_DEPTH] \{\
8286 . DIVERT_FN_LEFTOVER
8293 \# ====================================================================
8297 \# When endnotes are output, the spacing between the notes is always 1
8298 \# extra linespace. This can have bottom margin consequences. If this
8299 \# doesn't bother you, don't worry about it. If it does bother you, and
8300 \# you want to adjust the spacing between any two endnotes (as they're
8301 \# output), make the spacing adjustments (.ALD/.RLD) at the *end* of
8302 \# endnotes (i.e. just before .ENDNOTE OFF), not at the top.
8304 \# Endnotes must be output manually with .ENDNOTES. This allows user
8305 \# the flexibility to output endnotes at the end of each collated
8306 \# document, or to output them at the end of the entire document.
8311 \# <family to use in endnotes>
8313 \# Creates or modifies string $EN_FAM.
8315 \# Default is same as running text in body of document.
8317 .MAC ENDNOTE_FAMILY END
8325 \# <font to use in endnotes>
8327 \# Creates or modifies string $EN_FT.
8329 \# Default is roman.
8331 .MAC ENDNOTE_FONT END
8336 \# ENDNOTE POINT SIZE
8337 \# ------------------
8339 \# <base point size for endnotes>
8341 \# Creates or modifies register #EN_PS.
8343 \# Default is same as running text in body of document.
8345 \# This size control macro differs from other size control macros
8346 \# in that it sets an absolute point size, not a relative one. This
8347 \# is because a) endnotes always appear separate from the body of
8348 \# a document and therefore don't need to be relative to the body
8349 \# of the document, and b) there are quite a few elements of the
8350 \# endnotes page(s) that need to be relative to the base point size
8351 \# of that page. If the base endnote point size were relative to
8352 \# the body of the document (i.e. a _SIZE macro taking a +|- value)
8353 \# getting the rest of the endnote elements sized properly could
8354 \# become very confusing.
8356 .MAC ENDNOTE_PT_SIZE END
8357 . nr #EN_PS (p;\\$1)
8364 \# <base leading to use in endnotes>
8366 \# Creates or modifies register #EN_LEAD.
8368 \# Default is 13.5 points for TYPESET; 24 for TYPEWRITE.
8370 .MAC ENDNOTE_LEAD END
8371 . nr #EN_LEAD (p;\\$1)
8378 \# LEFT | L | CENTER | C | RIGHT | R | JUSTIFY | J
8380 \# Creates or modifies string $EN_QUAD.
8382 \# Default is justified for TYPESET, left for TYPEWRITE.
8384 .MAC ENDNOTE_QUAD END
8389 \# ENDNOTES_HDRFTR_CENTER
8390 \# ----------------------
8394 \# Creates or removes toggle register #EN_HDRFTR_CENTER, used to
8395 \# determine whether mom should print a/the hdrftr center string
8396 \# on the endnotes page. Primarily to enable/disable printing of the
8397 \# chapter name in hdrftrs when DOCTYPE CHAPTER.
8401 .MAC ENDNOTES_HDRFTR_CENTER END
8402 . ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
8403 . el \{ .rr #EN_HDRFTR_CENTER \}
8410 \# <title for endnotes page>
8412 \# Creates or modifies string $EN_STRING.
8414 \# Default is "ENDNOTES"
8416 .MAC ENDNOTE_STRING END
8417 . ds $EN_STRING \\$1
8421 \# ENDNOTE STRING FAMILY
8422 \# ---------------------
8424 \# <family to use for endnote string>
8426 \# Creates or modifies string $EN_STRING_FAM.
8428 \# Default is same as running text in body of document.
8430 .MAC ENDNOTE_STRING_FAMILY END
8431 . ds $EN_STRING_FAM \\$1
8435 \# ENDNOTE STRING FONT
8436 \# -------------------
8438 \# <font to use for endnote string>
8440 \# Creates or modifies string $EN_FT.
8442 \# Default is BOLD for TYPEWRITE; roman for TYPESET
8444 .MAC ENDNOTE_STRING_FONT END
8445 . ds $EN_STRING_FT \\$1
8449 \# ENDNOTE STRING SIZE
8450 \# -------------------
8452 \# <+|- number of points by which to in/decrease endnote string
8453 \# (relative to base endnote size)>
8455 \# Creates or modifies string $EN_STRING_SIZE_CHANGE.
8457 \# Default is +1 for TYPESET.
8459 .MAC ENDNOTE_STRING_SIZE END \"Default for TYPESET is +1
8460 . ds $EN_STRING_SIZE_CHANGE \\$1
8464 \# ENDNOTE STRING QUAD
8465 \# -------------------
8467 \# LEFT | L | CENTER | C | RIGHT | R
8469 \# Creates or modifies string $EN_STRING_QUAD.
8471 \# Default is centered.
8473 .MAC ENDNOTE_STRING_QUAD END
8474 . ds $EN_STRING_QUAD \\$1
8478 \# ENDNOTE STRING UNDERSCORE
8479 \# -------------------------
8483 \# Turns underscoring of endnote main title on or off. If the argument
8484 \# is the digit "2", turns on double-underscoring.
8486 \# Default is double-underscored.
8488 .MAC ENDNOTE_STRING_UNDERSCORE END
8489 . ie '\\$1'' \{ .nr #EN_STRING_UNDERSCORE 1 \}
8491 . ie '\\$1'2' \{ .nr #EN_STRING_UNDERSCORE 2 \}
8492 . el \{ .rr #EN_STRING_UNDERSCORE \}
8500 \# <string that appears before the first endnote pertaining to any document>
8502 \# Creates string $EN_TITLE_STRING.
8504 \# Default is the document title, or, if doc is a chapter, "Chapter #"
8506 .MAC ENDNOTE_TITLE END
8511 \# ENDNOTE TITLE FAMILY
8512 \# --------------------
8514 \# <family to use for endnote title>
8516 \# Creates string $EN_TITLE_FAM.
8518 \# Default is same as running text of document.
8520 .MAC ENDNOTE_TITLE_FAMILY END
8521 . ds $EN_TITLE_FAM \\$1
8525 \# ENDNOTE TITLE FONT
8526 \# ------------------
8528 \# <font to use for endnote title>
8530 \# Creates string $EN_TITLE_FT.
8532 \# Default is bold for TYPESET; roman for TYPEWRITE.
8534 .MAC ENDNOTE_TITLE_FONT END
8535 . ds $EN_TITLE_FT \\$1
8539 \# ENDNOTE TITLE SIZE
8540 \# ------------------
8542 \# <+|- number of points by which to in/decrease endnote title
8543 \# (relative to base endnote size)>
8545 \# Creates string $EN_TITLE_SIZE_CHANGE.
8547 \# Default is 0 (i.e. title same size as text of endnotes).
8549 .MAC ENDNOTE_TITLE_SIZE END
8550 . ds $EN_TITLE_SIZE_CHANGE \\$1
8554 \# ENDNOTE TITLE QUAD
8555 \# ------------------
8557 \# <quad direction of endnote title>
8559 \# Creates string $EN_TITLE_QUAD.
8563 .MAC ENDNOTE_TITLE_QUAD END
8564 . ds $EN_TITLE_QUAD \\$1
8568 \# ENDNOTE TITLE UNDERSCORE
8569 \# ------------------------
8573 \# Creates or removes register #EN_TITLE_UNDERSCORE.
8575 \# Default is to underscore the endnote titles.
8577 .MAC ENDNOTE_TITLE_UNDERSCORE END
8578 . ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
8579 . el \{ .rr #EN_TITLE_UNDERSCORE \}
8583 \# ENDNOTE NUMBER FAMILY
8584 \# ---------------------
8586 \# <family to use for endnote numbers on endnotes page>
8588 \# Creates string $EN_NUMBER_FAM.
8590 \# Default is same as running text of document.
8592 \# Family, font, and size of endnote numbers applies only to the
8593 \# numbers as they appear on the endnotes page(s). The superscript
8594 \# numbers that appear in running text are unaffected.
8596 .MAC ENDNOTE_NUMBER_FAMILY END
8597 . ds $EN_NUMBER_FAM \\$1
8601 \# ENDNOTE NUMBER FONT
8602 \# -------------------
8604 \# <font to use for endnote numbers on endnotes page>
8606 \# Creates string $EN_NUMBER_FT.
8608 \# Default is bold for TYPESET; roman for TYPEWRITE.
8610 \# Family, font, and size of endnote numbers applies only to the
8611 \# numbers as they appear on the endnotes page(s). The superscript
8612 \# numbers that appear in running text are unaffected.
8614 .MAC ENDNOTE_NUMBER_FONT END \"Default for TYPESET is bold
8615 . ds $EN_NUMBER_FT \\$1
8619 \# ENDNOTE NUMBER SIZE
8620 \# -------------------
8622 \# <+|- number of points by which to in/decrease endnote numbers
8623 \# (relative to base endnote size)>
8625 \# Creates string $EN_NUMBER_SIZE_CHANGE.
8629 \# Family, font, and size of endnote numbers applies only to the
8630 \# numbers as they appear on the endnotes page(s). The superscript
8631 \# numbers that appear in running text are unaffected.
8633 .MAC ENDNOTE_NUMBER_SIZE END \"Default for TYPESET is 0
8634 . ds $EN_NUMBER_SIZE_CHANGE \\$1
8638 \# ENDNOTE NUMBERS ALIGN RIGHT
8639 \# ---------------------------
8641 \# <max. number of digit placeholders that will appear in endnotes>
8643 \# Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
8644 \# #EN_NUMBER_PLACEHOLDERS.
8646 \# Default is for footnote numbers to be right aligned to 2 placeholders.
8648 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
8649 . rr #EN_NUMBERS_ALIGN_LEFT
8650 . nr #EN_NUMBERS_ALIGN_RIGHT 1
8651 . nr #EN_NUMBER_PLACEHOLDERS \\$1
8655 \# ENDNOTE NUMBERS ALIGN LEFT
8656 \# --------------------------
8660 \# Toggles register #EN_NUMBERS_ALIGN_LEFT on.
8662 \# Default is for footnote numbers to be right aligned to 2 placeholders
8663 \# (i.e. not left aligned).
8665 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
8666 . rr #EN_NUMBERS_ALIGN_RIGHT
8667 . nr #EN_NUMBERS_ALIGN_LEFT 1
8671 \# ENDNOTE PARAGRAPH INDENT
8672 \# ------------------------
8674 \# <first line indent of paras subsequent to 1st in endnotes>
8676 \# Creates register #EN_PP_INDENT for use in .PP.
8678 \# Requires a unit of measure.
8680 \# Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
8682 .MAC ENDNOTE_PARA_INDENT END
8683 . nr #EN_PP_INDENT (\\$1)
8687 \# ENDNOTE PARAGRAPH SPACE
8688 \# -----------------------
8692 \# Creates toggle register #EN_PP_SPACE for use in .PP.
8694 \# Like PARA_SPACE. Default is not to space endnote paras.
8696 .MAC ENDNOTE_PARA_SPACE END
8697 . ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
8698 . el \{ .rr #EN_PP_SPACE \}
8707 \# Places superscript endnote number in text, then collects and
8708 \# processes endnote in diversion END_NOTES.
8710 \# \c must be appended to the word immediately preceding .ENDNOTE.
8715 . if \\n[#CONDENSE] \{ \*[CONDX]\c \}
8716 . if \\n[#EXTEND] \{ \*[EXTX]\c \}
8717 . if \\n[#PRINT_STYLE]=1 \{\
8718 . if \\n[#UNDERLINE_ON] \{\
8719 . nr #UNDERLINE_WAS_ON 1
8722 . if \\n[#SLANT_ON] \{\
8723 . nr #SLANT_WAS_ON 1
8726 . PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2"
8728 . if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]" \}
8729 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
8730 . nr #PP_STYLE_PREV \\n[#PP_STYLE]
8732 . if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
8733 . INDENT_FIRST_PARAS
8736 . nr #NO_TRAP_RESET 1
8737 . if \\n[#PRINT_STYLE]=2 \{ .DOC_LEAD \\n[#EN_LEAD]u ADJUST \}
8739 . vs \\n[#DOC_LEAD]u
8740 . LL \\n[#DOC_L_LENGTH]u
8742 . if \\n[#COLUMNS] \{\
8743 . LL \\n[#COL_L_LENGTH]u
8746 . if \\n[#EN_NUMBER]=1 \{\
8748 . if !'\\*[$EN_STRING]'' \{ .sp \}
8749 . if \\n[#PRINT_STYLE]=1 \{\
8754 . if \\n[#PRINT_STYLE]=2 \{\
8755 . FAMILY \\*[$EN_TITLE_FAM]
8756 . FT \\*[$EN_TITLE_FT]
8757 . PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
8759 . if !'\\*[$EN_TITLE]'' \{\
8760 . if '\\*[$EN_TITLE_QUAD]'L' \{ .LEFT \}
8761 . if '\\*[$EN_TITLE_QUAD]'LEFT' \{ .LEFT \}
8762 . if '\\*[$EN_TITLE_QUAD]'C' \{ .CENTER \}
8763 . if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
8764 . if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
8765 . if '\\*[$EN_TITLE_QUAD]'R' \{ .RIGHT \}
8766 . if '\\*[$EN_TITLE_QUAD]'RIGHT' \{ .RIGHT \}
8767 . ie \\n[#EN_TITLE_UNDERSCORE] \{\
8768 . UNDERSCORE "\\*[$EN_TITLE]
8771 . PRINT "\\*[$EN_TITLE]
8775 . ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
8776 . ie \\n[#EN_NUMBER]=1 \{\
8777 . if !'\\*[$EN_TITLE]'' \{ .sp \}
8781 . if \\n[#PRINT_STYLE]=1 \{\
8786 . if \\n[#PRINT_STYLE]=2 \{\
8787 . FAMILY \\*[$EN_NUMBER_FAM]
8788 . FT \\*[$EN_NUMBER_FT]
8789 . PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
8791 . nr #RESET_L_LENGTH \\n(.l
8792 . nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
8793 . ll \\n[#EN_NUMBER_L_LENGTH]u
8796 . if \\n[#PRINT_STYLE]=1 \{\
8801 . if \\n[#PRINT_STYLE]=2 \{\
8802 . FAMILY \\*[$EN_FAM]
8804 . PT_SIZE \\n[#EN_PS]u
8807 . ll \\n[#RESET_L_LENGTH]u
8808 . in \\n[#EN_NUMBER_L_LENGTH]u+\w'.\0'u
8809 . nr #EN_TEXT_INDENT \\n(.i
8810 . QUAD \\*[$EN_QUAD]
8814 . ie \\n[#EN_NUMBER]=1 \{\
8815 . if !'\\*[$EN_TITLE]'' \{ .sp \}
8818 . if \\n[#PRINT_STYLE]=1 \{\
8823 . if \\n[#PRINT_STYLE]=2 \{\
8824 . FAMILY \\*[$EN_NUMBER_FAM]
8825 . FT \\*[$EN_NUMBER_FT]
8826 . PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
8828 . QUAD \\*[$EN_QUAD]
8829 \En[#EN_NUMBER].\0\c
8830 . if \\n[#PRINT_STYLE]=2 \{\
8831 . FAMILY \\*[$EN_FAM]
8833 . PT_SIZE \\n[#EN_PS]u
8839 . if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
8843 . DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
8844 . nr #PP_STYLE \\n[#PP_STYLE_PREV]
8845 . if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
8849 . if \\n[#PRINT_STYLE]=1 \{\
8850 . if \\n[#UNDERLINE_WAS_ON] \{\
8851 . rr #UNDERLINE_WAS_ON
8855 . if \\n[#SLANT_WAS_ON] \{\
8868 \# Sets new document leading from #EN_LEAD, breaks to a new page,
8869 \# sets up an endnotes page based on registers and strings associated
8870 \# with endnotes, then outputs diversion END_NOTES.
8873 . if \\n[#DOC_TYPE]=2 \{\
8874 . ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
8875 . el \{ .HDRFTR_CENTER \}
8878 . nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
8879 . if \\n[#PRINT_STYLE]=2 \{ .DOC_LEAD \\n[#EN_LEAD]u ADJUST \}
8880 . if \\n[#SLANT_ON] \{\
8883 . if !'\\*[$EN_STRING]'' \{\
8884 . if \\n[#PRINT_STYLE]=1 \{\
8889 . if \\n[#PRINT_STYLE]=2 \{\
8890 . FAMILY \\*[$EN_STRING_FAM]
8891 . FT \\*[$EN_STRING_FT]
8892 . PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
8894 . if '\\*[$EN_STRING_QUAD]'L' \{ .LEFT \}
8895 . if '\\*[$EN_STRING_QUAD]'LEFT' \{ .LEFT \}
8896 . if '\\*[$EN_STRING_QUAD]'C' \{ .CENTER \}
8897 . if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
8898 . if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
8899 . if '\\*[$EN_STRING_QUAD]'R' \{ .RIGHT \}
8900 . if '\\*[$EN_STRING_QUAD]'RIGHT' \{ .RIGHT \}
8902 . ie \\n[#EN_STRING_UNDERSCORE] \{\
8903 . ie \\n[#EN_STRING_UNDERSCORE]=2 \{\
8904 . UNDERSCORE2 "\\*[$EN_STRING]
8907 . UNDERSCORE "\\*[$EN_STRING]
8911 . PRINT "\\*[$EN_STRING]
8916 . vs \\n[#DOC_LEAD]u
8921 . DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
8924 \# ====================================================================
8931 \# <number of columns> <width of gutters>
8933 \# Creates registers associated with setting docs in columns.
8934 \# Calculates column line lengths and offsets
8936 \# COLUMNS, if used, s/b the last macro invoked before START.
8939 . if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
8943 . nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
8944 . nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
8946 . while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
8947 . nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
8948 . nr #COL_TOTAL \\n+[#COL_TOTAL]
8960 \# Breaks current column and moves to next column.
8961 \# If current column is the last on the page, breaks
8965 . if \\n[#COLUMNS] \{\
8967 . ie '\\$0'COL_NEXT' \{ .br \}
8972 . ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
8979 \# ====================================================================
8981 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
8988 \# Turns headers off (if on) and saves header state, sets register
8989 \# #COLLATE to 1 (toggle), and breaks to a new page.
8991 \# COLLATE exists primarily to allow putting multiple chapters in
8992 \# a single file, although it can be used for any document type. After
8993 \# COLLATE, any of the macros that normally precede START may be
8994 \# used, and should behave as expected.
8996 \# N.B.--the START macro *must* be used after COLLATE (and any other
8997 \# macros that alter mom's behaviour).
9001 . nr #HEADER_STATE \\n[#HEADERS_ON]
9003 . if \\n[#PAGE_NUM_V_POS]=1 \{\
9004 . nr #PAGINATION_STATE \\n[#PAGINATE]
9009 . LL \\n[#DOC_L_LENGTH]u
9011 . LS \\n[#DOC_LEAD]u
9016 . rr #PAGENUM_STYLE_SET
9021 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
9022 \# ---------------------------------------
9026 \# Sets header/footer/footnotes/etc... traps.
9027 \# Calculates the number of lines that actually fit on a
9028 \# page based on #B_MARGIN and resets page bottom trap to coincide
9029 \# with the depth of that number of lines , or, if #ADJ_DOC_LEAD=1,
9030 \# adjusts #DOC_LEAD so that the last line of text on a page falls
9031 \# exactly on #B_MARGIN.
9034 \# *Remove all header/footer traps
9035 . if !\\n[#NO_TRAP_RESET] \{\
9040 \# *Plant header trap
9043 \# *Adjust lead so last line of text falls on B_MARGIN,...
9044 . ie \\n[#ADJ_DOC_LEAD] \{\
9045 . nr #LINES_PER_PAGE 0 1
9046 . nr #DOC_LEAD_ADJ 0 1
9047 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
9048 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
9049 . nr #LINES_PER_PAGE -1
9050 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
9051 . DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
9053 \# *...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
9056 . nr #LINES_PER_PAGE 0 1
9057 . nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
9058 . while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
9059 . nr #B_MARGIN \\n[#PAGE_LENGTH]-(\\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n[#LINES_PER_PAGE]))
9061 \# *Set footer and footnote overflow traps
9062 . if !\\n[#NO_TRAP_RESET] \{\
9064 . nr #SPACE_REMAINING 0
9066 . nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
9068 . wh -\\n[#B_MARGIN]u FN_OVERFLOW_TRAP
9069 . ch FOOTER -\\n[#B_MARGIN]u
9079 \# Adds left, right, or both indent values to document elements
9080 \# like heads and subheads that are processed in environments.
9082 .MAC CHECK_INDENT END
9083 . if \\n[#INDENT_LEFT_ACTIVE] \{\
9084 . in \\n[#L_INDENT]u
9085 . if \\n[#QUOTE] \{\
9086 . in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
9087 . ll -\\n[#L_INDENT]u
9090 . if \\n[#EPIGRAPH] \{\
9091 . in -\\n[#L_INDENT]u
9092 . ll -\\n[#L_INDENT]u
9096 . if \\n[#INDENT_RIGHT_ACTIVE] \{\
9097 . ll -\\n[#R_INDENT]u
9100 . if \\n[#INDENT_BOTH_ACTIVE] \{\
9101 . in \\n[#BL_INDENT]u
9102 . ll -\\n[#BR_INDENT]u
9104 . if \\n[#QUOTE] \{\
9105 . in -\\n[#BL_INDENT]u
9106 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
9107 . ll -\\n[#BR_INDENT]u
9111 . ll -(\\n[#BR_INDENT]u/2u)
9115 . if \\n[#EPIGRAPH] \{\
9116 . in -\\n[#BL_INDENT]u
9117 . ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
9118 . ll -\\n[#BR_INDENT]u
9122 . ll -(\\n[#BR_INDENT]u/2u)
9135 \# Removes left, right, or both indent values from document elements
9136 \# like heads and subheads that are processed in environments.
9138 .MAC REMOVE_INDENT END
9140 . ll \\n[#L_LENGTH]u
9147 \# ====================================================================
9149 \# +++DOCUMENT PROCESSING ALIASES+++
9151 \# Aliases to make life easier for users: synonyms, short forms
9152 \# and alternate spellings.
9156 .ALIAS BREAK_BLOCKQUOTE BREAK_QUOTE
9157 .ALIAS BREAK_CITATION BREAK_QUOTE
9158 .ALIAS BREAK_CITE BREAK_QUOTE
9159 .ALIAS CITATION BLOCKQUOTE
9160 .ALIAS CITE BLOCKQUOTE
9161 .ALIAS DOC_R_MARGIN DOC_RIGHT_MARGIN
9162 .ALIAS DOC_L_MARGIN DOC_LEFT_MARGIN
9163 .ALIAS DOC_L_LENGTH DOC_LINE_LENGTH
9164 .ALIAS DOC_RMARGIN DOC_RIGHT_MARGIN
9165 .ALIAS DOC_LMARGIN DOC_LEFT_MARGIN
9166 .ALIAS DOC_LLENGTH DOC_LINE_LENGTH
9167 .ALIAS DOC_FAM DOC_FAMILY
9169 .ALIAS PP_FT PP_FONT
9170 .ALIAS DOC_PS DOC_PT_SIZE
9171 .ALIAS DOC_LS DOC_LEAD
9172 .ALIAS PAGENUM PAGENUMBER
9173 .ALIAS PAGINATION PAGINATE
9175 \# HEADER and FOOTER aliases for HDRFTR macros.
9177 .ALIAS ENDNOTES_HEADER_CENTER ENDNOTES_HDRFTR_CENTER
9178 .ALIAS HEADER_FAMILY HDRFTR_FAMILY
9179 .ALIAS HEADER_FAM HDRFTR_FAMILY
9180 .ALIAS HEADER_SIZE HDRFTR_SIZE
9181 .ALIAS HEADER_PLAIN HDRFTR_PLAIN
9182 .ALIAS HEADER_RULE_GAP HDRFTR_RULE_GAP
9183 .ALIAS HEADER_RULE HDRFTR_RULE
9184 .ALIAS HEADER_LEFT HDRFTR_LEFT
9185 .ALIAS HEADER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
9186 .ALIAS HEADER_LEFT_FAM HDRFTR_LEFT_FAMILY
9187 .ALIAS HEADER_LEFT_FONT HDRFTR_LEFT_FONT
9188 .ALIAS HEADER_LEFT_FT HDRFTR_LEFT_FONT
9189 .ALIAS HEADER_LEFT_SIZE HDRFTR_LEFT_SIZE
9190 .ALIAS HEADER_LEFT_PS HDRFTR_LEFT_SIZE
9191 .ALIAS HEADER_LEFT_CAPS HDRFTR_LEFT_CAPS
9192 .ALIAS HEADER_CENTER HDRFTR_CENTER
9193 .ALIAS HEADER_CENTRE HDRFTR_CENTER
9194 .ALIAS HEADER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
9195 .ALIAS HEADER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
9196 .ALIAS HEADER_CENTER_FAM HDRFTR_CENTER_FAMILY
9197 .ALIAS HEADER_CENTRE_FAM HDRFTR_CENTER_FAMILY
9198 .ALIAS HEADER_CENTER_FONT HDRFTR_CENTER_FONT
9199 .ALIAS HEADER_CENTRE_FONT HDRFTR_CENTER_FONT
9200 .ALIAS HEADER_CENTER_FT HDRFTR_CENTER_FONT
9201 .ALIAS HEADER_CENTRE_FT HDRFTR_CENTER_FONT
9202 .ALIAS HEADER_CENTER_SIZE HDRFTR_CENTER_SIZE
9203 .ALIAS HEADER_CENTRE_SIZE HDRFTR_CENTER_SIZE
9204 .ALIAS HEADER_CENTER_PS HDRFTR_CENTER_SIZE
9205 .ALIAS HEADER_CENTRE_PS HDRFTR_CENTER_SIZE
9206 .ALIAS HEADER_CENTER_CAPS HDRFTR_CENTER_CAPS
9207 .ALIAS HEADER_CENTRE_CAPS HDRFTR_CENTER_CAPS
9208 .ALIAS HEADER_RIGHT HDRFTR_RIGHT
9209 .ALIAS HEADER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
9210 .ALIAS HEADER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
9211 .ALIAS HEADER_RIGHT_FONT HDRFTR_RIGHT_FONT
9212 .ALIAS HEADER_RIGHT_FT HDRFTR_RIGHT_FONT
9213 .ALIAS HEADER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
9214 .ALIAS HEADER_RIGHT_PS HDRFTR_RIGHT_SIZE
9215 .ALIAS HEADER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
9216 .ALIAS HEADER_RECTO HDRFTR_RECTO
9217 .ALIAS HEADER_VERSO HDRFTR_VERSO
9218 .ALIAS ENDNOTES_FOOTER_CENTER ENDNOTES_HDRFTR_CENTER
9219 .ALIAS FOOTER_FAMILY HDRFTR_FAMILY
9220 .ALIAS FOOTER_FAM HDRFTR_FAMILY
9221 .ALIAS FOOTER_SIZE HDRFTR_SIZE
9222 .ALIAS FOOTER_PLAIN HDRFTR_PLAIN
9223 .ALIAS FOOTER_RULE_GAP HDRFTR_RULE_GAP
9224 .ALIAS FOOTER_RULE HDRFTR_RULE
9225 .ALIAS FOOTER_LEFT HDRFTR_LEFT
9226 .ALIAS FOOTER_LEFT_FAMILY HDRFTR_LEFT_FAMILY
9227 .ALIAS FOOTER_LEFT_FAM HDRFTR_LEFT_FAMILY
9228 .ALIAS FOOTER_LEFT_FONT HDRFTR_LEFT_FONT
9229 .ALIAS FOOTER_LEFT_FT HDRFTR_LEFT_FONT
9230 .ALIAS FOOTER_LEFT_SIZE HDRFTR_LEFT_SIZE
9231 .ALIAS FOOTER_LEFT_PS HDRFTR_LEFT_SIZE
9232 .ALIAS FOOTER_LEFT_CAPS HDRFTR_LEFT_CAPS
9233 .ALIAS FOOTER_CENTER HDRFTR_CENTER
9234 .ALIAS FOOTER_CENTRE HDRFTR_CENTER
9235 .ALIAS FOOTER_CENTER_FAMILY HDRFTR_CENTER_FAMILY
9236 .ALIAS FOOTER_CENTRE_FAMILY HDRFTR_CENTER_FAMILY
9237 .ALIAS FOOTER_CENTER_FAM HDRFTR_CENTER_FAMILY
9238 .ALIAS FOOTER_CENTRE_FAM HDRFTR_CENTER_FAMILY
9239 .ALIAS FOOTER_CENTER_FONT HDRFTR_CENTER_FONT
9240 .ALIAS FOOTER_CENTRE_FONT HDRFTR_CENTER_FONT
9241 .ALIAS FOOTER_CENTER_FT HDRFTR_CENTER_FONT
9242 .ALIAS FOOTER_CENTRE_FT HDRFTR_CENTER_FONT
9243 .ALIAS FOOTER_CENTER_SIZE HDRFTR_CENTER_SIZE
9244 .ALIAS FOOTER_CENTRE_SIZE HDRFTR_CENTER_SIZE
9245 .ALIAS FOOTER_CENTER_PS HDRFTR_CENTER_SIZE
9246 .ALIAS FOOTER_CENTRE_PS HDRFTR_CENTER_SIZE
9247 .ALIAS FOOTER_CENTER_CAPS HDRFTR_CENTER_CAPS
9248 .ALIAS FOOTER_CENTRE_CAPS HDRFTR_CENTER_CAPS
9249 .ALIAS FOOTER_RIGHT HDRFTR_RIGHT
9250 .ALIAS FOOTER_RIGHT_FAMILY HDRFTR_RIGHT_FAMILY
9251 .ALIAS FOOTER_RIGHT_FAM HDRFTR_RIGHT_FAMILY
9252 .ALIAS FOOTER_RIGHT_FONT HDRFTR_RIGHT_FONT
9253 .ALIAS FOOTER_RIGHT_FT HDRFTR_RIGHT_FONT
9254 .ALIAS FOOTER_RIGHT_SIZE HDRFTR_RIGHT_SIZE
9255 .ALIAS FOOTER_RIGHT_PS HDRFTR_RIGHT_SIZE
9256 .ALIAS FOOTER_RIGHT_CAPS HDRFTR_RIGHT_CAPS
9257 .ALIAS FOOTER_RECTO HDRFTR_RECTO
9258 .ALIAS FOOTER_VERSO HDRFTR_VERSO
9259 .ALIAS SWITCH_HEADERS SWITCH_HDRFTR
9260 .ALIAS SWITCH_FOOTERS SWITCH_HDRFTR
9264 .ALIAS COL_BREAK COL_NEXT
9265 .ALIAS PRINT_FOOTNOTE_RULE FOOTNOTE_RULE