o Added a .bp after .if \\n[#START]=1 in FOOTER. Without it,
[s-roff.git] / contrib / mom / om.tmac
blobbc9cfa165558f3859c904fcf6743aa973869631c
1 .\" om.tmac
2 .\"
3 .\" Mom -- a typesetting/document-processing macro set for groff.
4 .\"
5 .\" Copyright (C) 2002, 2003 Free Software Foundation, Inc.
6 .\"      Written by Peter Schaffter (df191@ncf.ca)
7 .\"
8 .\" This file is part of groff.
9 .\"
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
13 .\" version.
14 .\"
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
18 .\" for more details.
19 .\"
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.
23 .\"
24 .\"
25 .\"
26 \# Version 1.1.6-d
27 \# ---------------
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 \# ========================================
46 \# +++ALIASES+++
48 .als      ALIAS           als   \"Alias .als as ALIAS
49 .als      ALIASN          aln   \"Alias .aln (number registers) as ALIASN
51 .ALIAS    MAC             de
52 .ALIAS    BR              br
53 .ALIAS    SPACE           sp
54 .ALIAS    SP              sp
55 .ALIAS    PAGELENGTH      pl
56 .ALIAS    NEWPAGE         bp
57 .ALIAS    SPREAD          brp
58 .ALIAS    STRING          ds
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 \# ====================================================================
74 \# MISCELLANEOUS
75 \# =============
76 .cflags 4 /\(en      \" So slash and en-dashes get broken
77 .nr #L_MARGIN \n(.o  \" Tabs, etc require #L_MARGIN
79 \# ====================================================================
81 \# END MACRO FOR LETTERS
82 \# ---------------------
83 \# *Arguments:
84 \#   none
85 \# *Function:
86 \#   The .em macro executed at the end of letters.  Turns footers and
87 \#   pagination off, terminates and outputs diversion CLOSING, indented with
88 \#   the author's name underneath.
90 .MAC ALL_DONE END
91 .    br
92 .    FOOTERS OFF
93 .    PAGINATION OFF
94 .    if \\n[#DOC_TYPE]=4 \{\
95 .       br
96 .       if !'\\n(.z'' \{ .di \}
97 .       IQ CLEAR
98 .       TQ
99 .       TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
100 .       ALD \\n[#DOC_LEAD]u*2u
101 .       TAB 1
102 .       if \\n[#CLOSING] \{\
103 .          nf
104 .          CLOSING
105 .       \}
106 .       ALD \\n[#DOC_LEAD]u*3u
107 .       PRINT \\*[$AUTHOR_1]
108 .    \}
109 .    DO_FOOTER
110 .END
113 \# =====================================================================
115 \# +++PAGE LAYOUT+++
117 \# Macros that control the physical layout of the page: paper size
118 \# and margins.
120 \# PAGE WIDTH
121 \# ----------
122 \# *Argument:
123 \#   <width of printer sheet (ipPc)>
124 \# *Function:
125 \#   Stores user supplied page width in register #PAGE_WIDTH.
126 \# *Notes:
127 \#   #PAGE_WIDTH is used to establish the default LL (and right margin).
128 \#   Requires unit of measure.
130 .MAC PAGEWIDTH END
131 .    br
132 .    nr #PAGE_WIDTH \\$1
133 .    if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
134 .    if !r#R_MARGIN \{ .R_MARGIN 1i \}
135 .END
138 \# L_MARGIN
139 \# --------
140 \# *Argument:
141 \#   <offset from page left (ipPc)>
142 \# *Function:
143 \#   Stores user supplied page offset in register #L_MARGIN.
144 \#   Sets .po to user supplied offset.
145 \# *Notes:
146 \#   Requires unit of measure.
148 .MAC L_MARGIN END
149 .    br
150 .    nr #L_MARGIN (\\$1)
151 .    po \\n[#L_MARGIN]u
152 .END
155 \# R_MARGIN
156 \# --------
157 \# *Argument:
158 \#   <width of right margin (ipPc)>
159 \# *Function:
160 \#   Stores user supplied right margin in register #R_MARGIN.
161 \# *Notes:
162 \#   This is a pseudo-margin.  Right margin is actually a function of
163 \#   line length.  The macro calculates line length from the page offset
164 \#   and the value plugged into #R_MARGIN.
166 \#   N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
168 \#   Requires unit of measure.
170 .MAC R_MARGIN END
171 .    br
172 .    nr #R_MARGIN (\\$1)
173 .    ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
174 .    ta \\n(.lu
175 .    nr #L_LENGTH \\n(.l
176 .END
179 \# T_MARGIN
180 \# --------
181 \# *Argument:
182 \#   <distance to advance from top of page (ipPcv)>
183 \# *Function:
184 \#   Stores the user supplied top margin in register #T_MARGIN.
185 \#   Advances user supplied depth from the top of the page.
186 \# *Notes:
187 \#   Requires unit of measure.
189 .MAC T_MARGIN END
190 .    br
191 .    nr #T_MARGIN (\\$1)
192 .    nr #T_MARGIN_SET 1
193 .    if !\\n[#DOCS] \{\
194 .       PRINT \&
195 .       sp |\\n[#T_MARGIN]u-1v
196 .    \}
197 .    wh 0i DO_T_MARGIN
198 .END
201 \# B_MARGIN
202 \# --------
203 \# *Argument:
204 \#   <space to leave at the bottom of the page (ipPcv)>
205 \# *Function:
206 \#   Stores the user supplied bottom margin in register #B_MARGIN.
207 \# *Notes:
208 \#   Requires unit of measure.
210 .MAC B_MARGIN END
211 .    br
212 .    nr #B_MARGIN (\\$1)
213 .    wh -\\n[#B_MARGIN]u DO_B_MARGIN
214 .END
217 \# PAGE
218 \# ----
219 \# *Arguments:
220 \#   <pagewidth>  [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
221 \# *Function:
222 \#   Page set-up.  Collects arguments and passes them to the appropriate
223 \#   macros.
224 \# *Notes:
225 \#   All arguments after pagewidth are optional, but must appear
226 \#   in the order given above.  (User can fill in as much or as
227 \#   little as desired.)
229 \#   All arguments require a unit of measure.
231 .MAC PAGE END
232 .    br
233 .    PAGEWIDTH                \\$1
234 .    PAGELENGTH               \\$2
235 .    ie '\\$3'' \{ .L_MARGIN  \\n(.o \}
236 .    el \{ .L_MARGIN          \\$3 \}
237 .    ie '\\$4'' \{ .R_MARGIN  1i \}
238 .    el \{ .R_MARGIN          \\$4 \}
239 .    if !'\\$5'' \{ .T_MARGIN \\$5 \}
240 .    if !'\\$6'' \{ .B_MARGIN \\$6 \}
241 .END
243 \# =====================================================================
245 \# +++PAGE CONTROL+++
247 \# Generic macros for breaking pages.
249 \# DO_T_MARGIN
250 \# -----------
251 \# *Argument:
252 \#   <none>
253 \# *Function:
254 \#   Plants the top margin (set in .PAGE) at the top of each page.
255 \# *Notes:
256 \#   The trap is set in .PAGE
258 .MAC DO_T_MARGIN END
259 .    ev 1
260 .    sp |\\n[#T_MARGIN]u-1v
261 .    ev
262 .END
265 \# DO_B_MARGIN
266 \# -----------
267 \# *Argument:
268 \#   <none>
269 \# *Function:
270 \#   Plants the bottom margin (set in .PAGE) at the bottom of each page.
271 \# *Notes:
272 \#   The trap is set in .PAGE.
274 .MAC DO_B_MARGIN END
275 .    ev 1
276 .    bp
277 .    ev
278 .END
280 \# =====================================================================
282 \# +++GENERAL STYLE MACROS+++
284 \# Macros that are likely to appear together to define general
285 \# type style: line length, family, font, point size, and line
286 \# spacing.
288 \# LINE LENGTH
289 \# -----------
290 \# *Argument:
291 \#   <line length (iPpc)>
292 \# *Function:
293 \#   Stores user supplied line length in register #L_LENGTH.
294 \#   Sets .ll to #L_LENGTHu
295 \# *Notes:
296 \#   Requires unit of measure.
298 .MAC LL END
299 .    nr #L_LENGTH (\\$1)
300 .    nr #USER_SET_L_LENGTH 1
301 .    ll \\n[#L_LENGTH]u
302 .    ta \\n(.lu
303 .END
306 \# FAMILY
307 \# ------
308 \# *Argument:
309 \#   <font family>
310 \# *Function:
311 \#   Stores user supplied font family in string $FAMILY.  Sets .fam
312 \#   to $FAMILY.
314 .MAC FAMILY END
315 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
316 .    if \\n[#IGNORE]        \{ .return \}
317 .    ds $FAMILY \\$1
318 .    fam \\*[$FAMILY]
319 .END
322 \# FONT
323 \# ----
324 \# *Argument:
325 \#   R | I | B | BI
326 \# *Function:
327 \#  Stores user supplied font in $FONT and sets .ft to $FONT.
329 .MAC FT END
330 .    if \\n[#PRINT_STYLE]=1 \{\
331 .       ie '\\$1'I' \{\
332 .          if \\n[#UNDERLINE_ITALIC]=1 \{\
333 .             UNDERLINE
334 .             return
335 .          \}
336 .          if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
337 .             ds $FONT \\$1
338 .             ft \\*[$FONT]
339 .             return
340 .          \}
341 .       \}
342 .       el \{ .UNDERLINE OFF \}
343 .       return
344 .    \}
345 .    ds $FONT \\$1
346 .    ft \\*[$FONT]
347 .END
350 \# POINT SIZE
351 \# ----------
352 \# *Arguments:
353 \#   <point size of type>
354 \# *Function:
355 \#   Sets point size to user supplied value in scaled points.
356 \#   If #AUTO_LEAD is on, sets .vs to #AUTOLEAD_VALUE+#PT_SIZE.
357 \# *Notes:
358 \#   Must NOT use a unit of measure.
360 .MAC PT_SIZE END
361 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
362 .    if \\n[#IGNORE]        \{ .return \}
363 .    nr #PT_SIZE_SET 1
364 .    ps \\$1
365 .    if \\n[#AUTO_LEAD] \{\
366 .       ie \\n[#AUTOLEAD_FACTOR] \{ .vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u \}
367 .       el \{ .vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u \}
368 .    \}
369 .    nr #PT_SIZE_IN_UNITS \\n[.ps]
370 .END
373 \# LEADING
374 \# -------
375 \# *Argument:
376 \#   <leading between lines of text>
377 \# *Function:
378 \#   Turns off #AUTO_LEAD if it's on.
379 \#   Sets .vs to user supplied value.
380 \# *Notes:
381 \#   Does not require unit of measure.  LEAD automatically turns off AUTOLEAD.
383 .MAC LS END
384 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
385 .    if \\n[#IGNORE]        \{ .return \}
386 .    nr #LEAD_SET 1
387 .    if \\n[#AUTO_LEAD] \{\
388 .       rr #AUTO_LEAD
389 .       rr #AUTOLEAD_FACTOR
390 .    \}
391 .    vs \\$1
392 .    if \\n[#T_MARGIN_SET]=1 \{\
393 .       sp |\\n[#T_MARGIN]u-1v
394 .       rr #T_MARGIN_SET
395 .    \}
396 .END
399 \# AUTOLEAD
400 \# --------
401 \# *Argument:
402 \#   <leading value to add to #PT_SIZE> [FACTOR]
403 \# *Function:
404 \#   Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
405 \#   Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
406 \#   All subsequent PT_SIZE requests reset the leading in the same way until
407 \#   AUTOLEAD is turned off.
408 \# *Notes:
409 \#   With the optional FACTOR argument, the current point size is
410 \#   multiplied by #AUTOLEAD_VALUE instead of the two being added
411 \#   together.
413 \#   When AUTOLEAD is turned off, the leading reverts to the leading value
414 \#   in effect prior to invoking AUTOLEAD.
416 .MAC AUTOLEAD END
417 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
418 .    if \\n[#IGNORE]        \{ .return \}
419 .    nr #AUTO_LEAD 1
420 .    nr #AUTOLEAD_VALUE (p;\\$1)
421 .    ie \\n[#NUM_ARGS]=2 \{\
422 .       if '\\$2'FACTOR' \{\
423 .          nr #AUTOLEAD_FACTOR 1
424 .          vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u
425 .       \}
426 .    \}
427 .    el \{\
428 .       vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u
429 .    \}
430 .    if \\n[#T_MARGIN_SET] \{\
431 .       sp |\\n[#T_MARGIN]u-1v
432 .       rr #T_MARGIN_SET
433 .    \}
434 .END
437 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
438 \# ------------------------------------------------
439 .ds ROM  \EfR
440 .ds IT   \EfI
441 .ds BD   \EfB
442 .ds BDI  \Ef(BI
443 .ds PREV \EfP
444 .ds S    \Es
447 \# =====================================================================
449 \# +++KERNING+++
451 \# AUTOMATIC PAIRWISE KERNING
452 \# --------------------------
453 \# *Arguments:
454 \#   <none> | <anything>
455 \# *Function:
456 \#   Turns automatic pairwise kerning on or off.
458 .MAC KERN END
459 .    ie '\\$1'' \{\
460 .       kern
461 .       nr #KERN 1
462 .    \}
463 .    el \{\
464 .       kern 0
465 .       nr #KERN 0
466 .    \}
467 .END
470 \# INLINE KERNING AND HORIZONTAL MOVEMENT
471 \# --------------------------------------
472 \# *Kerning
473 \#  Inline kerning provides a simple method for users to adjust the
474 \#  amount of space between any two letters.  It's predicated on a
475 \#  unit of measure "U", which is 1/36 of the current point size as
476 \#  returned by \n[.ps].  E.g., if the current point size is 18,
477 \#  \n[.ps] returns 18000u, therefore U=500u.  Since U remains
478 \#  proportional relative to the current point size, the amount
479 \#  of kerning between two letters as expressed in Us remains
480 \#  visually similar regardless of changes in point size.
482 \#  N.B.--the amount of inline kerning supplied by \*[BU#] or
483 \#  \*[FU#] is added to or subtracted from any kerning that already
484 \#  takes place between two characters when automatic kerning is
485 \#  turned on.
487 \#  In groff v. 1.17.2, it was not possible to pass arguments to macros that
488 \#  were executed with inline escapes, nor thence to evaluate conditional
489 \#  expressions.  Consequently, each pseudo-escape \[BU#] had to be defined
490 \#  separately with ".char".
492 \#  As of v. 1.18, one can pass arguments to inline strings/macros,
493 \#  hence it is now possible to do \*[BU #] where #, inline, is the desired
494 \#  number of kern units.  The original .char definitions have been left in
495 \#  for backward compatibility with documents created prior to mom-1.1.3c.
498 .nr #KERN_UNIT 36
499 .ds BU   \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
500 .ds FU   \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
502 .ds BU1  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
503 .ds BU2  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
504 .ds BU3  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
505 .ds BU4  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
506 .ds BU5  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
507 .ds BU6  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
508 .ds BU7  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
509 .ds BU8  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
510 .ds BU9  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
511 .ds BU10 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
512 .ds BU11 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
513 .ds BU12 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
514 .ds BU13 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
515 .ds BU14 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
516 .ds BU15 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
517 .ds BU16 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
518 .ds BU17 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
519 .ds BU18 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
520 .ds BU19 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
521 .ds BU20 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
522 .ds BU21 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
523 .ds BU22 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
524 .ds BU23 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
525 .ds BU24 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
526 .ds BU25 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
527 .ds BU26 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
528 .ds BU27 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
529 .ds BU28 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
530 .ds BU29 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
531 .ds BU30 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
532 .ds BU31 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
533 .ds BU32 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
534 .ds BU33 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
535 .ds BU34 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
536 .ds BU35 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
537 .ds BU36 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
540 .ds FU1  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
541 .ds FU2  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
542 .ds FU3  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
543 .ds FU4  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
544 .ds FU5  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
545 .ds FU6  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
546 .ds FU7  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
547 .ds FU8  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
548 .ds FU9  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
549 .ds FU10 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
550 .ds FU11 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
551 .ds FU12 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
552 .ds FU13 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
553 .ds FU14 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
554 .ds FU15 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
555 .ds FU16 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
556 .ds FU17 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
557 .ds FU18 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
558 .ds FU19 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
559 .ds FU20 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
560 .ds FU21 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
561 .ds FU22 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
562 .ds FU23 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
563 .ds FU24 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
564 .ds FU25 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
565 .ds FU26 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
566 .ds FU27 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
567 .ds FU28 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
568 .ds FU29 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
569 .ds FU30 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
570 .ds FU31 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
571 .ds FU32 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
572 .ds FU33 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
573 .ds FU34 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
574 .ds FU35 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
575 .ds FU36 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
578 \# *Horizontal movements
579 \#  BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
580 \#  specified number of points.
581 \#  Left in for backward compatibility with mom-1.1.3c, the preferred
582 \#  methods for inline horizontal movements are now \*[BCK #<unit>] and
583 \#  \*[FWD #<unit>].
585 .ds BCK  \h'-\\$1\\$2'
586 .ds FWD  \h'\\$1\\$2'
588 .ds BP.25    \h'-.25'
589 .ds BP.5     \h'-.5'
590 .ds BP.75    \h'-.75'
591 .ds BP1      \h'-1p'
592 .ds BP1.25   \h'-1.25p'
593 .ds BP1.5    \h'-1.5p'
594 .ds BP1.75   \h'-1.75p'
595 .ds BP2      \h'-2p'
596 .ds BP2.25   \h'-2.25p'
597 .ds BP2.5    \h'-2.5p'
598 .ds BP2.75   \h'-2.75p'
599 .ds BP3      \h'-3p'
600 .ds BP3.25   \h'-3.25p'
601 .ds BP3.5    \h'-3.5p'
602 .ds BP3.75   \h'-3.75p'
603 .ds BP4      \h'-4p'
604 .ds BP4.25   \h'-4.25p'
605 .ds BP4.5    \h'-4.5p'
606 .ds BP4.75   \h'-4.75p'
607 .ds BP5      \h'-5p'
608 .ds BP5.25   \h'-5.25p'
609 .ds BP5.5    \h'-5.5p'
610 .ds BP5.75   \h'-5.75p'
611 .ds BP6      \h'-6p'
612 .ds BP6.25   \h'-6.25p'
613 .ds BP6.5    \h'-6.5p'
614 .ds BP6.75   \h'-6.75p'
615 .ds BP7      \h'-7p'
616 .ds BP7.25   \h'-7.25p'
617 .ds BP7.5    \h'-7.5p'
618 .ds BP7.75   \h'-7.75p'
619 .ds BP8      \h'-8p'
620 .ds BP8.25   \h'-8.25p'
621 .ds BP8.5    \h'-8.5p'
622 .ds BP8.75   \h'-8.75p'
623 .ds BP9      \h'-9p'
624 .ds BP9.25   \h'-9.25p'
625 .ds BP9.5    \h'-9.5p'
626 .ds BP9.75   \h'-9.75p'
627 .ds BP10     \h'-10p'
628 .ds BP10.25  \h'-10.25p'
629 .ds BP10.5   \h'-10.5p'
630 .ds BP10.75  \h'-10.75p'
631 .ds BP11     \h'-11p'
632 .ds BP11.25  \h'-11.25p'
633 .ds BP11.5   \h'-11.5p'
634 .ds BP11.75  \h'-11.75p'
635 .ds BP12     \h'-12p'
636 .ds BP12.25  \h'-12.25p'
637 .ds BP12.5   \h'-12.5p'
638 .ds BP12.75  \h'-12.75p'
640 .ds FP.25    \h'.25'
641 .ds FP.5     \h'.5'
642 .ds FP.75    \h'.75'
643 .ds FP1      \h'1p'
644 .ds FP1.25   \h'1.25p'
645 .ds FP1.5    \h'1.5p'
646 .ds FP1.75   \h'1.75p'
647 .ds FP2      \h'2p'
648 .ds FP2.25   \h'2.25p'
649 .ds FP2.5    \h'2.5p'
650 .ds FP2.75   \h'2.75p'
651 .ds FP3      \h'3p'
652 .ds FP3.25   \h'3.25p'
653 .ds FP3.5    \h'3.5p'
654 .ds FP3.75   \h'3.75p'
655 .ds FP4      \h'4p'
656 .ds FP4.25   \h'4.25p'
657 .ds FP4.5    \h'4.5p'
658 .ds FP4.75   \h'4.75p'
659 .ds FP5      \h'5p'
660 .ds FP5.25   \h'5.25p'
661 .ds FP5.5    \h'5.5p'
662 .ds FP5.75   \h'5.75p'
663 .ds FP6      \h'6p'
664 .ds FP6.25   \h'6.25p'
665 .ds FP6.5    \h'6.5p'
666 .ds FP6.75   \h'6.75p'
667 .ds FP7      \h'7p'
668 .ds FP7.25   \h'7.25p'
669 .ds FP7.5    \h'7.5p'
670 .ds FP7.75   \h'7.75p'
671 .ds FP8      \h'8p'
672 .ds FP8.25   \h'8.25p'
673 .ds FP8.5    \h'8.5p'
674 .ds FP8.75   \h'8.75p'
675 .ds FP9      \h'9p'
676 .ds FP9.25   \h'9.25p'
677 .ds FP9.5    \h'9.5p'
678 .ds FP9.75   \h'9.75p'
679 .ds FP10     \h'10p'
680 .ds FP10.25  \h'10.25p'
681 .ds FP10.5   \h'10.5p'
682 .ds FP10.75  \h'10.75p'
683 .ds FP11     \h'11p'
684 .ds FP11.25  \h'11.25p'
685 .ds FP11.5   \h'11.5p'
686 .ds FP11.75  \h'11.75p'
687 .ds FP12     \h'12p'
688 .ds FP12.25  \h'12.25p'
689 .ds FP12.5   \h'12.5p'
690 .ds FP12.75  \h'12.75p'
693 \# WHOLE LINE KERNING (RW and EW)
694 \# -----------------------------
695 \# The line kerning macros are special instances of track kerning,
696 \# used where a complete line needs to be tightened (or relaxed) in
697 \# order to accomodate or remove one or two more characters
698 \# than the default justification permits.
700 \# *Argument:
701 \#   <amount of overall "kerning" (letter spacing) to apply to the line>
702 \# *Function:
703 \#   Invokes .tkf (track kerning) for the current font with
704 \#   1 as both the upper and lower point size limits, so that
705 \#   the value entered by the user applies regardless of point
706 \#   size.  RW ("Reduce Whitespace") reduces the amount of space
707 \#   between all characters by an equal amount.  EW ("Extra
708 \#   Whitespace") increases the amount of space.
709 \# *Notes:
710 \#   Decimal values are acceptable.
712 \#   The groff documentation is a tad confusing about what unit of
713 \#   measure is used in track kerning, only that the width of each
714 \#   character is increased or decreased by the amount(s) passed as
715 \#   arguments to .tkf, and something about linear function of point
716 \#   size.  In fact, with the way I've put this macro together, it
717 \#   doesn't matter.  All the user needs to know is that a value
718 \#   of one will produce an unacceptably tight or loose line at most
719 \#   text point sizes; therefore, effective use of RW and EW is in
720 \#   the fractional range below 1 (e.g. .25, .5).  Given that RW
721 \#   and EW are for massaging type, a certain amount of
722 \#   experimentation and previewing is expected and necessary.
724 \#   \n(.f holds the current font number, which is acceptable to .tkf.
726 \#   RW and EW must be reset to 0 to cancel their effect on
727 \#   subsequent output lines.
729 .MAC RW END
730 .    if \\n[#BR_AT_LINE_KERN] \{ .br \}
731 .    tkf 1 1 -\\$1 1 -\\$1
732 .    tkf 2 1 -\\$1 1 -\\$1
733 .    tkf 3 1 -\\$1 1 -\\$1
734 .    tkf 4 1 -\\$1 1 -\\$1
735 .END
738 .MAC EW END
739 .    if \\n[#BR_AT_LINE_KERN] \{ .br \}
740 .    tkf 1 1 \\$1 1 \\$1
741 .    tkf 2 1 \\$1 1 \\$1
742 .    tkf 3 1 \\$1 1 \\$1
743 .    tkf 4 1 \\$1 1 \\$1
744 .END
747 \# BREAK AT LINE KERN
748 \# ------------------
749 \# *Arguments:
750 \#   toggle
751 \# *Function:
752 \#   Enables/disables .br's before .RW and .EW
753 \# *Notes:
754 \#   Mostly, users will want .br's before any kind of line kerning, but
755 \#   there may be cases where they don't.  BR_BEFORE_LINE_KERN is off by
756 \#   default and must be invoked explicitly.
758 .MAC BR_AT_LINE_KERN END
759 .    ie '\\$1'' \{ .nr #BR_AT_LINE_KERN  1 \}
760 .    el         \{ .rr #BR_AT_LINE_KERN \}
761 .END
763 \# =====================================================================
765 \# +++HYPHENATION+++
767 \# AUTO HYPHENATION
768 \# ----------------
769 \# *Arguments:
770 \#   <none> | <anything> | DEFAULT
771 \#                 or
772 \#   LINES <#> | MARGIN <#> | SPACE <#>
773 \# *Function:
774 \#   Turns auto hyphenation on or off, resets the hyphenation style
775 \#   to default, or permits the setting of various hyphenation
776 \#   parameters.
777 \# *Notes:
778 \#   HY ON defaults to .hy 14, i.e. no hyphens after the
779 \#   first two or before the last two characters of a word, and
780 \#   no hyphenation of the last line prior to a trap (e.g.,
781 \#   at the bottom of a page).
783 \#   HY DEFAULT resets the hyphenation style to .hy 14 (see
784 \#   above) if that behaviour is desired after changes have been
785 \#   made to LINES, MARGIN, or SPACE.
787 \#   HY LINES <#> sets the number of allowable consecutive hyphenated lines.
789 \#   HY MARGIN <#> sets the amount of space (ipPcm) allowed at the end
790 \#   of a line in QUAD mode before hyphenation is tripped (e.g. if there's
791 \#   only 6 points left, groff won't try to hyphenate the next word).
793 \#   HY SPACE sets the amount of extra interword space (ipPcm) that can
794 \#   be added in JUSTIFY mode to prevent a line from being hyphenated.
796 .MAC HY END
797 .    ie '\\$1'' \{\
798 .       hy 14
799 .       nr #HYPHENATE 1
800 .    \}
801 .    el \{\
802 .       if !'\\$1'LINES'  \{\
803 .          nh
804 .          nr #HYPHENATE 0
805 .       \}
806 .       if !'\\$1'MARGIN' \{\
807 .          nh
808 .          nr #HYPHENATE 0
809 .       \}
810 .       if !'\\$1'SPACE'  \{\
811 .          nh
812 .          nr #HYPHENATE 0
813 .       \}
814 .       if !'\\$1'DEFAULT'  \{\
815 .          nh
816 .          nr #HYPHENATE 0
817 .       \}
818 .       if '\\$1'LINES'   \{ .hlm \\$2 \}
819 .       if '\\$1'MARGIN'  \{ .hym \\$2 \}
820 .       if '\\$1'SPACE'   \{ .hys \\$2 \}
821 .       if '\\$1'DEFAULT' \{\
822 .          hlm -1
823 .          hym 0
824 .          hys 0
825 .       \}
826 .    \}
827 .END
830 \# HYPHENATION PARAMETERS
831 \# ----------------------
832 \# *Arguments:
833 \#   <# of lines> | <size of margin> | <amount of interword space>
834 \# *Function:
835 \#   Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
837 .MAC HY_SET END
838 .    nr #HY_SET 1
839 .    hlm \\$1
840 .    hym \\$2
841 .    hys \\$3
842 .END
844 \# =====================================================================
846 \# +++VERTICAL SPACING+++
848 \# ADVANCE LEAD
849 \# ------------
850 \# *Argument:
851 \#   <user supplied lead to advance below current baseline>
852 \# *Function:
853 \#   Creates or modifies register #ALD.  Adds user supplied lead
854 \#   below current baseline.
855 \# *Notes:
856 \#   Requires unit of measure ipPcmv.
858 .MAC ALD END
859 .    nr #ALD (\\$1)
860 .    sp \\n[#ALD]u
861 .END
864 \# REVERSE LEAD
865 \# ------------
866 \# *Argument:
867 \#   <user supplied lead to reverse above current baseline>
868 \# *Function:
869 \#   Creates or modifies register #RLD.  Reverses user supplied
870 \#   lead above current baseline.
871 \# *Notes:
872 \#   Requires unit of measure ipPcmv.
874 .MAC RLD END
875 .    nr #RLD (\\$1)
876 .    sp -\\n[#RLD]u
877 .END
879 \# ALD/RLD STRINGS
880 \# ---------------
881 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding \*[RLD]
882 \# forms have been left in for backward compatibility with documents
883 \# created using mom-1.1.3c or earlier.  The prefered methods of advancing
884 \# and reversing on the page inline are \*[UP #<unit>] and \*[DOWN #<unit>].
886 .ds DOWN      \v'\\$1\\$2'
887 .ds UP        \v'-\\$1\\$2'
889 .ds ALD.25    \v'.25p'
890 .ds ALD.5     \v'.5p'
891 .ds ALD.75    \v'.75p'
892 .ds ALD1      \v'1p'
893 .ds ALD1.25   \v'1.25p'
894 .ds ALD1.5    \v'1.5p'
895 .ds ALD1.75   \v'1.75p'
896 .ds ALD2      \v'2p'
897 .ds ALD2.25   \v'2.25p'
898 .ds ALD2.5    \v'2.5p'
899 .ds ALD2.75   \v'2.75p'
900 .ds ALD3      \v'3p'
901 .ds ALD3.25   \v'3.25p'
902 .ds ALD3.5    \v'3.5p'
903 .ds ALD3.75   \v'3.75p'
904 .ds ALD4      \v'4p'
905 .ds ALD4.25   \v'4.25p'
906 .ds ALD4.5    \v'4.5p'
907 .ds ALD4.75   \v'4.75p'
908 .ds ALD5      \v'5p'
909 .ds ALD5.25   \v'5.25p'
910 .ds ALD5.5    \v'5.5p'
911 .ds ALD5.75   \v'5.75p'
912 .ds ALD6      \v'6p'
913 .ds ALD6.25   \v'6.25p'
914 .ds ALD6.5    \v'6.5p'
915 .ds ALD6.75   \v'6.75p'
916 .ds ALD7      \v'7p'
917 .ds ALD7.25   \v'7.25p'
918 .ds ALD7.5    \v'7.5p'
919 .ds ALD7.75   \v'7.75p'
920 .ds ALD8      \v'8p'
921 .ds ALD8.25   \v'8.25p'
922 .ds ALD8.5    \v'8.5p'
923 .ds ALD8.75   \v'8.75p'
924 .ds ALD9      \v'9p'
925 .ds ALD9.25   \v'9.25p'
926 .ds ALD9.5    \v'9.5p'
927 .ds ALD9.75   \v'9.75p'
928 .ds ALD10     \v'10p'
929 .ds ALD10.25  \v'10.25p'
930 .ds ALD10.5   \v'10.5p'
931 .ds ALD10.75  \v'10.75p'
932 .ds ALD11     \v'11p'
933 .ds ALD11.25  \v'11.25p'
934 .ds ALD11.5   \v'11.5p'
935 .ds ALD11.75  \v'11.75p'
936 .ds ALD12     \v'12p'
937 .ds ALD12.25  \v'12.5p'
938 .ds ALD12.5   \v'12.5p'
939 .ds ALD12.75  \v'12.75p'
941 .ds RLD.25    \v'-.25p'
942 .ds RLD.5     \v'-.5p'
943 .ds RLD.75    \v'-.75p'
944 .ds RLD1      \v'-1p'
945 .ds RLD1.25   \v'-1.25p'
946 .ds RLD1.5    \v'-1.5p'
947 .ds RLD1.75   \v'-1.75p'
948 .ds RLD2      \v'-2p'
949 .ds RLD2.25   \v'-2.25p'
950 .ds RLD2.5    \v'-2.5p'
951 .ds RLD2.75   \v'-2.75p'
952 .ds RLD3      \v'-3p'
953 .ds RLD3.25   \v'-3.25p'
954 .ds RLD3.5    \v'-3.5p'
955 .ds RLD3.75   \v'-3.75p'
956 .ds RLD4      \v'-4p'
957 .ds RLD4.25   \v'-4.25p'
958 .ds RLD4.5    \v'-4.5p'
959 .ds RLD4.75   \v'-4.75p'
960 .ds RLD5      \v'-5p'
961 .ds RLD5.25   \v'-5.25p'
962 .ds RLD5.5    \v'-5.5p'
963 .ds RLD5.75   \v'-5.75p'
964 .ds RLD6      \v'-6p'
965 .ds RLD6.25   \v'-6.25p'
966 .ds RLD6.5    \v'-6.5p'
967 .ds RLD6.75   \v'-6.75p'
968 .ds RLD7      \v'-7p'
969 .ds RLD7.25   \v'-7.25p'
970 .ds RLD7.5    \v'-7.5p'
971 .ds RLD7.75   \v'-7.75p'
972 .ds RLD8      \v'-8p'
973 .ds RLD8.25   \v'-8.25p'
974 .ds RLD8.5    \v'-8.5p'
975 .ds RLD8.75   \v'-8.75p'
976 .ds RLD9      \v'-9p'
977 .ds RLD9.25   \v'-9.25p'
978 .ds RLD9.5    \v'-9.5p'
979 .ds RLD9.75   \v'-9.75p'
980 .ds RLD10     \v'-10p'
981 .ds RLD10.25  \v'-10.25p'
982 .ds RLD10.5   \v'-10.5p'
983 .ds RLD10.75  \v'-10.75p'
984 .ds RLD11     \v'-11p'
985 .ds RLD11.25  \v'-11.25p'
986 .ds RLD11.5   \v'-11.5p'
987 .ds RLD11.75  \v'-11.75p'
988 .ds RLD12     \v'-12p'
989 .ds RLD12.25  \v'-12.5p'
990 .ds RLD12.5   \v'-12.5p'
991 .ds RLD12.75  \v'-12.75p'
993 \# =====================================================================
995 \# +++REFINEMENTS+++
997 \# AUTOMATIC LIGATURES
998 \# -------------------
999 \# *Arguments:
1000 \#   <none> | <anything>
1001 \# *Function:
1002 \#   Turns automatic ligature generation on or off.
1003 \# *Notes:
1004 \#   Ligatures may be supplied manually with \(fi, \(fl, etc.
1006 .MAC LIGATURES END
1007 .    ie '\\$1''   \{\
1008 .       lg
1009 .       nr #LIGATURES 1
1010 .    \}
1011 .    el \{\
1012 .       lg 0
1013 .       nr #LIGATURES 0
1014 .    \}
1015 .END
1018 \# SMARTQUOTES
1019 \# -----------
1020 \# *Arguments:
1021 \#   <none> | <anything>
1022 \# *Function:
1023 \#   Turns smartquotes on or off.
1024 \# *Notes:
1025 \#   The " character is read outside the macro when mom is
1026 \#   processed.  The strings for open/close ($QUOTE#) are then
1027 \#   defined in the macro.  \N'34' is the ASCII code for ".  If
1028 \#   incompatibilities arise, find the code for " that applies
1029 \#   to your system and plug in that code instead.
1031 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1033 .MAC SMARTQUOTES END
1034 .    ie '\\$1'' \{\
1035 .       nr #OPEN_CLOSE 0
1036 .       ds $QUOTE0 ``
1037 .       ds $QUOTE1 ''
1038 .       nr #SMART_QUOTES 1
1039 .    \}
1040 .    el \{\
1041 .       ds $QUOTE0 \\N'34'
1042 .       ds $QUOTE1 \\N'34'
1043 .       nr #SMART_QUOTES 0
1044 .    \}
1045 .END
1047 .ds FOOT \(fm
1048 .ds INCH \(fm\(fm
1050 \# =====================================================================
1052 \# +++LINE BREAKS+++
1054 \# NO-SPACE BREAK
1055 \# --------------
1056 \# *Argument:
1057 \#   <none>
1058 \# *Function:
1059 \#   Breaks a line without advancing.
1060 \# *Notes:
1061 \#   EL is the mnemonic used on older, dedicated typesetting machines
1062 \#   to indicate "process the line, then return to the left margin
1063 \#   without advancing the galley medium."  It stands for End Line.
1065 \#   Sadly, EL is only a fake.  It will work in all instances EXCEPT
1066 \#   when the line to be EL'd is the last line before a footer trap.
1067 \#   Use TRAP OFF/TRAP to circumvent this.
1069 .MAC EL END
1070 .    br
1071 .    sp -1v
1072 .END
1074 \# =====================================================================
1076 \# +++FILLING/QUADDING/JUSTIFYING+++
1078 \# JUSTIFY
1079 \# -------
1080 \# *Argument:
1081 \#   <none>
1082 \# *Function:
1083 \#  Turns fill on and sets .ad to b.
1084 \# *Notes:
1085 \#  Justifies text left and right.
1087 .MAC JUSTIFY END
1088 .    if \\n[#TAB_ACTIVE]=0 \{\
1089 .       nr #QUAD 1
1090 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1091 .    \}
1092 '    ce 0
1093 .    QUAD J
1094 .    if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1095 .    nr #FILL 0
1096 .END
1099 \# QUAD
1100 \# ----
1101 \# *Arguments:
1102 \#   L | LEFT | R | RIGHT | C | CENTER/CENTRE
1103 \# *Function:
1104 \#   Turns fill on and sets .ad to l, r, or c.
1105 \# *Notes:
1106 \#   Terminology is a problem here.  Some people call quad left
1107 \#   left justified, flush left, or flush left/rag right (and the
1108 \#   reverse for quad right).  Quad center is sometimes called rag
1109 \#   both.  For our purposes, all "quad" modes mean that groff fill
1110 \#   mode is enabled.
1112 .MAC QUAD END
1113 .    ds $QUAD_VALUE \\$1
1114 .    if \\n[#TAB_ACTIVE]=0 \{\
1115 .       nr #QUAD 1
1116 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1117 .    \}
1118 '    ce 0
1119 '    fi
1120 .    if '\\*[$QUAD_VALUE]'L'       \{ .ad l \}
1121 .    if '\\*[$QUAD_VALUE]'LEFT'    \{ .ad l \}
1122 .    if '\\*[$QUAD_VALUE]'R'       \{ .ad r \}
1123 .    if '\\*[$QUAD_VALUE]'RIGHT'   \{ .ad r \}
1124 .    if '\\*[$QUAD_VALUE]'C'       \{ .ad c \}
1125 .    if '\\*[$QUAD_VALUE]'CENTER'  \{ .ad c \}
1126 .    if '\\*[$QUAD_VALUE]'CENTRE'  \{ .ad c \}
1127 .    if '\\*[$QUAD_VALUE]'J'       \{ .ad b \}
1128 .    if '\\*[$QUAD_VALUE]'JUSTIFY' \{ .ad b \}
1129 .    nr #FILL 0
1130 .END
1133 \# LEFT, RIGHT, AND CENTER
1134 \# -----------------------
1135 \# The purpose of these macros is to allow the user to enter lines
1136 \# of text that will be quadded LRC *without* the user having to
1137 \# enter .BR or .br between lines.  For the sake of consistency,
1138 \# all three appear to behave similarly (from the point of view of the user),
1139 \# although the underlying primitives don't.  For this reason, LEFT,
1140 \# RIGHT, and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY
1141 \# to restore text to groff fill mode.
1143 \# LEFT
1144 \# ----
1145 \# *Argument:
1146 \#   <none>
1147 \# *Function:
1148 \#   Turns fill mode off.  Allows user to quad lines left without
1149 \#   requiring the .BR or .br macro.
1150 \# *Notes:
1151 \#   LEFT simply turns fill off.  Lines that exceed the current LL will
1152 \#   not be broken, simply continued (indefinitely) until a return is
1153 \#   encountered.  Note that this behaviour differs from the RIGHT and
1154 \#   CENTER macros.
1156 .MAC LEFT END
1157 .    if \\n[#TAB_ACTIVE]=0 \{\
1158 .       rr #QUAD
1159 .       ds $RESTORE_QUAD_VALUE LEFT
1160 .    \}
1161 .    ce 0
1162 .    nf
1163 .    nr #FILL 1
1164 .END
1167 \# RIGHT
1168 \# -----
1169 \# *Argument:
1170 \#   <none>
1171 \# *Function:
1172 \#   Turns fill on.  Allows user to quad lines right without
1173 \#   requiring the .BR or .br macro.
1174 \# *Notes:
1175 \#   Lines that exceed the current LL will be broken, with the excess
1176 \#   text quadded right.
1178 .MAC RIGHT END
1179 .    if \\n[#TAB_ACTIVE]=0 \{\
1180 .       rr #QUAD
1181 .       ds $RESTORE_QUAD_VALUE RIGHT
1182 .    \}
1183 .    fi
1184 .    rj 100000
1185 .    nr #FILL 1
1186 .END
1189 \# CENTER
1190 \# ------
1191 \# *Argument:
1192 \#   <none>
1193 \# *Function:
1194 \#   Turns fill on.  Allows user to center lines without
1195 \#   requiring the .BR or .br macro.
1196 \# *Notes:
1197 \#   Lines that exceed the current LL will be broken, with the excess
1198 \#   text centered.
1200 .MAC CENTER END
1201 .    if \\n[#TAB_ACTIVE]=0 \{\
1202 .       ds $RESTORE_QUAD_VALUE CENTER
1203 .    \}
1204 .    fi
1205 .    ce 100000
1206 .    nr #FILL 1
1207 .END
1209 \# =====================================================================
1211 \# +++TABS+++
1213 \#   There are two different kinds of tabs available: typesetting tabs
1214 \#   and string tabs.
1216 \#   Typesetting tabs are set with TAB_SET, which requires a tab number,
1217 \#   an indent (offset) from the left margin and a length (optionally
1218 \#   with a quad direction and an instruction to fill lines).  After tabs
1219 \#   are set with TS, they are called with .TAB <#>, where <#>
1220 \#   corresponds to the number passed to TAB_SET as a valid tab number.
1222 \#   String tabs allow the user to mark off tab positions inline.  Tab
1223 \#   indents and lengths are calculated from the beginning and end
1224 \#   positions of the marks.  Up to 19 string tabs may be created,
1225 \#   numbered 1-19.  Once created, they are called with .TAB <#>,
1226 \#   just like typesetting tabs.
1228 \#   Setting up string tabs is a two-step procedure.  First, the user
1229 \#   enters an input line in which s/he wants to mark off string tabs.
1230 \#   The beginning of a tab is marked with \*[ST<#>], where <#> is
1231 \#   the desired number of the tab.  The end of the the tab is marked
1232 \#   with \*[ST<#>X].  All ST's must have a matching STX.  String tabs
1233 \#   may be nested.
1235 \#   Next, the user invokes .ST <#> for every string tab defined, and
1236 \#   optionally passes quad information to it.  That done, string tabs
1237 \#   can be called just like typesetting tabs.
1239 \#   String tabs don't preview properly with gxditview.  Use gv instead.
1241 \# Strings for string tab inlines
1242 \# ------------------------------
1244 .ds ST1 \Ek[#ST1_OFFSET]
1245 .ds ST2 \Ek[#ST2_OFFSET]
1246 .ds ST3 \Ek[#ST3_OFFSET]
1247 .ds ST4 \Ek[#ST4_OFFSET]
1248 .ds ST5 \Ek[#ST5_OFFSET]
1249 .ds ST6 \Ek[#ST6_OFFSET]
1250 .ds ST7 \Ek[#ST7_OFFSET]
1251 .ds ST8 \Ek[#ST8_OFFSET]
1252 .ds ST9 \Ek[#ST9_OFFSET]
1253 .ds ST10 \Ek[#ST10_OFFSET]
1254 .ds ST11 \Ek[#ST11_OFFSET]
1255 .ds ST12 \Ek[#ST12_OFFSET]
1256 .ds ST13 \Ek[#ST13_OFFSET]
1257 .ds ST14 \Ek[#ST14_OFFSET]
1258 .ds ST15 \Ek[#ST15_OFFSET]
1259 .ds ST16 \Ek[#ST16_OFFSET]
1260 .ds ST17 \Ek[#ST17_OFFSET]
1261 .ds ST18 \Ek[#ST18_OFFSET]
1262 .ds ST19 \Ek[#ST19_OFFSET]
1264 .ds ST1X \Ek[#ST1_MARK]
1265 .ds ST2X \Ek[#ST2_MARK]
1266 .ds ST3X \Ek[#ST3_MARK]
1267 .ds ST4X \Ek[#ST4_MARK]
1268 .ds ST5X \Ek[#ST5_MARK]
1269 .ds ST6X \Ek[#ST6_MARK]
1270 .ds ST7X \Ek[#ST7_MARK]
1271 .ds ST8X \Ek[#ST8_MARK]
1272 .ds ST9X \Ek[#ST9_MARK]
1273 .ds ST10X \Ek[#ST10_MARK]
1274 .ds ST11X \Ek[#ST11_MARK]
1275 .ds ST12X \Ek[#ST12_MARK]
1276 .ds ST13X \Ek[#ST13_MARK]
1277 .ds ST14X \Ek[#ST14_MARK]
1278 .ds ST15X \Ek[#ST15_MARK]
1279 .ds ST16X \Ek[#ST16_MARK]
1280 .ds ST17X \Ek[#ST17_MARK]
1281 .ds ST18X \Ek[#ST18_MARK]
1282 .ds ST19X \Ek[#ST19_MARK]
1283 \# Reserved ST numbers for internal use
1284 .ds ST100  \Ek[#ST100_OFFSET]
1285 .ds ST100X \Ek[#ST100_MARK]
1286 .ds ST101  \Ek[#ST101_OFFSET]
1287 .ds ST101X \Ek[#ST101_MARK]
1290 \# QUAD AND SET STRING TABS
1291 \# ------------------------
1292 \# *Arguments:
1293 \#   <stringtab number>  L | R | C | J  [QUAD]
1294 \# *Function:
1295 \#   Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1296 \#   tab based on the collected information.
1297 \# *Notes:
1298 \#   Like TS, ST invoked without a quad direction will default to LEFT.
1299 \#   If lines should be filled and quadded, use the optional argument QUAD.
1300 \#   N.B. -- indents *must* be turned off before setting string tabs
1301 \#   inside .PAD
1303 .MAC ST END
1304 .    ds $ST\\$1_QUAD_DIR \\$2
1305 .    if \\n[#NUM_ARGS]=3 \{\
1306 .       ds $ST\\$1_FILL QUAD
1307 .    \}
1308 .    nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1309 .    ie \\n[#IN_TAB] \{\
1310 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1311 .    \}
1312 .    el \{\
1313 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1314 .    \}
1315 .END
1318 \# TAB SET
1319 \# -------
1320 \# *Arguments:
1321 \#   <#>  ident(ipPcm)  length(ipPcm)  [L | R | C | J [QUAD]]
1322 \# *Function:
1323 \#   Creates macros TAB<#> and TAB <#>, where # is any arbitrary number.
1324 \#   TAB# is a typesetting tab (i.e. a tab defined as an indent
1325 \#   from the page left offset plus a line length.)
1326 \# *Notes:
1327 \#   <#>    = arbitrary digit to identify the tab
1328 \#   indent = indent from left margin; unit of measure required
1329 \#   length = length of tab (unit of measure required; can be
1330 \#            \w'<string>'u--if more than one word in string, surround
1331 \#            with double quotes "\w'<three word string>'"
1332 \#   LRCJ   = quad for tab (left, right, center, justified)
1333 \#            If option QUAD afterwards is not given, quad is line for line
1334 \#            (no fill mode), meaning that there's no need for .BR or .br
1335 \#            between lines.
1336 \#   QUAD   = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1337 \#            had been given).
1339 \#   N.B. -- indents *must* be turned off before setting tabs
1341 \#   Examples:
1343 \#     .TAB_SET 1 2P+6p 12P C
1345 \#   means "create a tab numbered 1 that starts 2 picas and 6 points from
1346 \#   the left margin, is 12 picas long, and centre each input line."
1348 \#     .TAB_SET 1 2P+6P 12P C QUAD
1350 \#   means exactly the same thing, except that input lines are joined and
1351 \#   the area delimted by the tab filled with centered text.
1353 \#   TAB <#> can be called at any time after being set.
1355 \#   Tabs are NOT columnar in behaviour.  If the text inside a
1356 \#   tab runs to several lines, when you call the next tab a break
1357 \#   occurs, meaning that the new tab starts one line below the last
1358 \#   line in the previous tab.  For columnar behaviour, you must
1359 \#   use the multi-column macros in addition to tabs.
1361 \#   If you want tabs to line up bottom-line to bottom-line (most likely
1362 \#   single line tabs), use .TN (provided the tabs are numbered sequentially).
1363 \#   Otherwise, you must use .EL then .TAB # if you want them to align.
1365 \#   If you want to reset tabs, you must use .TQ before .TAB_SET.
1367 \#   Note that indents are turned off automatically whenever a new
1368 \#   tab is called with TAB #.
1370 \#   Tabs themselves are user-invoked using the TAB macro with a numeric
1371 \#   argument, e.g. TAB 1.
1373 \#   Generally, in order not to get confused, it's a good idea
1374 \#   to make sure all indents are off before setting tabs.
1376 .MAC TAB_SET END
1377 .    br
1378 .    nr #TAB_NUMBER \\$1
1379 .    ds $CURRENT_TAB \\n[#TAB_NUMBER]
1380 .    nr #TAB_OFFSET (\\$2)
1381 .    nr #TAB_LENGTH (\\$3)
1382 .    MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1383 .        br
1384 .        in 0
1385 .        nr #TAB_ACTIVE 1
1386 .        nr #CURRENT_TAB \\n[#TAB_NUMBER]
1387 .        po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET]u
1388 .        nr #ST_OFFSET \\n[#TAB_OFFSET]
1389 .        nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1390 .        ll \\n[#TAB_LENGTH]u
1391 .        ta \En(.lu
1392 .        ie '\\$5'QUAD' \{\
1393 .           if '\\$4'L' \{ .QUAD L  \}
1394 .           if '\\$4'R' \{ .QUAD R  \}
1395 .           if '\\$4'C' \{ .QUAD C  \}
1396 .           if '\\$4'J' \{ .JUSTIFY \}
1397 .        \}
1398 .        el \{\
1399 .           if '\\$4''  \{ .LEFT    \}
1400 .           if '\\$4'L' \{ .LEFT    \}
1401 .           if '\\$4'R' \{ .RIGHT   \}
1402 .           if '\\$4'C' \{ .CENTER  \}
1403 .           if '\\$4'J' \{ .JUSTIFY \}
1404 .        \}
1405 .DONE
1406 .    rr #TAB_ACTIVE
1407 .END
1410 \# TAB
1411 \# ---
1412 \# *Arguments:
1413 \#   <tab number to tab into>
1414 \# *Function:
1415 \#   Moves to tab number passed as an argument.
1417 .MAC TAB END
1418 .    ds $TAB_NUMBER \\$1
1419 .    TAB\\*[$TAB_NUMBER]
1420 .    nr #IN_TAB 1
1421 .    po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET\\*[$TAB_NUMBER]]u
1422 .END
1425 \# TAB NEXT
1426 \# --------
1427 \# *Argument:
1428 \#   <none>
1429 \# *Function:
1430 \#   Automagically moves to TAB#+1 on the same line as the last
1431 \#   line of the previous tab.
1432 \# *Notes:
1433 \#   If the tabs being aligned fall too close to the footer
1434 \#   trap, the line entered after .TN will appear on the next page,
1435 \#   unless TRAP...TRAP OFF is used.
1437 .MAC TN END
1438 .    br
1439 .    nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1440 .    TAB\\n[#NEXT_TAB]
1441 .    sp -1v
1442 .END
1445 \# TAB QUIT
1446 \# --------
1447 \# *Argument:
1448 \#   <none>
1449 \# *Function:
1450 \#   Sets #TAB_ACTIVE to "0" (off).
1451 \#   Resets left margin to value in effect prior to tabs.
1452 \#   Resets line length to value in effect prior to tabs.
1453 \#   Checks #QUAD to see if we were in flush or quad mode
1454 \#   prior to tabs (0=off, 1=on).
1455 \#   Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1456 \#   in effect prior to tabs.
1457 \# *Notes:
1458 \#   TQ *must* come before setting any new tabs if you want the
1459 \#   tabs' indents measured from page left.  Otherwise, the tabs'
1460 \#   indents are measured from the left margin of the tab you're
1461 \#   currently in.
1463 .MAC TQ END
1464 .    br
1465 .    rr #TAB_ACTIVE
1466 .    rr #IN_TAB
1467 .    po \\n[#L_MARGIN]u
1468 .    ll \\n[#L_LENGTH]u
1469 .    ta \\n(.lu
1470 .    ie \\n[#QUAD] \{\
1471 .       ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1472 .       el                              \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1473 .    \}
1474 .    el \{\
1475 .       if '\\*[$RESTORE_QUAD_VALUE]'LEFT'   \{ .LEFT \}
1476 .       if '\\*[$RESTORE_QUAD_VALUE]'RIGHT'  \{ .RIGHT \}
1477 .       if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1478 .    \}
1479 .END
1481 \# =====================================================================
1483 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1485 \# UNDERLINE
1486 \# ---------
1487 \# *Arguments:
1488 \#   <none> | <anything>
1489 \# *Function:
1490 \#   When on, underlines all letters, words, and digits in a passage,
1491 \#   ignoring punctuation and spaces.
1492 \# *Notes:
1493 \#   Only for use when the font family is COURIER, to simulate
1494 \#   typewriter-style underlining of italic  passages.
1496 .MAC UNDERLINE END
1497 .    ie '\\$1'' \{\
1498 .       nr #UNDERLINE_ON 1
1499 .       char A _\bA
1500 .       char B _\bB
1501 .       char C _\bC
1502 .       char D _\bD
1503 .       char E _\bE
1504 .       char F _\bF
1505 .       char G _\bG
1506 .       char H _\bH
1507 .       char I _\bI
1508 .       char J _\bJ
1509 .       char K _\bK
1510 .       char L _\bL
1511 .       char M _\bM
1512 .       char N _\bN
1513 .       char O _\bO
1514 .       char P _\bP
1515 .       char Q _\bQ
1516 .       char R _\bR
1517 .       char S _\bS
1518 .       char T _\bT
1519 .       char U _\bU
1520 .       char V _\bV
1521 .       char W _\bW
1522 .       char X _\bX
1523 .       char Y _\bY
1524 .       char Z _\bZ
1525 .       char \[`A] _\b\[`A]
1526 .       char \[^A] _\b\[^A]
1527 .       char \['A] _\b\['A]
1528 .       char \[:A] _\b\[:A]
1529 .       char \[oA] _\b\[oA]
1530 .       char \[~A] _\b\[~A]
1531 .       char \[AE] _\b\[AE]
1532 .       char \[`E] _\b\[`E]
1533 .       char \[^E] _\b\[^E]
1534 .       char \['E] _\b\['E]
1535 .       char \[:E] _\b\[:E]
1536 .       char \[`I] _\b\[`I]
1537 .       char \[^I] _\b\[^I]
1538 .       char \['I] _\b\['I]
1539 .       char \[:I] _\b\[:I]
1540 .       char \[`O] _\b\[`O]
1541 .       char \[^O] _\b\[^O]
1542 .       char \['O] _\b\['O]
1543 .       char \[:O] _\b\[:O]
1544 .       char \[~O] _\b\[~O]
1545 .       char \[/O] _\b\[/O]
1546 .       char \[`U] _\b\[`U]
1547 .       char \[^U] _\b\[^U]
1548 .       char \['U] _\b\['U]
1549 .       char \[:U] _\b\[:U]
1550 .       char \[,C] _\b\[,C]
1551 .       char \[-D] _\b\[-D]
1552 .       char \[~N] _\b\[~N]
1553 .       char \[TP] _\b\[TP]
1554 .       char \['Y] _\b\['Y]
1555 .       char \[:Y] _\b\[:Y]
1556 .       char a _\ba
1557 .       char b _\bb
1558 .       char c _\bc
1559 .       char d _\bd
1560 .       char e _\be
1561 .       char f _\bf
1562 .       char g _\bg
1563 .       char h _\bh
1564 .       char i _\bi
1565 .       char j _\bj
1566 .       char k _\bk
1567 .       char l _\bl
1568 .       char m _\bm
1569 .       char n _\bn
1570 .       char o _\bo
1571 .       char p _\bp
1572 .       char q _\bq
1573 .       char r _\br
1574 .       char s _\bs
1575 .       char t _\bt
1576 .       char u _\bu
1577 .       char v _\bv
1578 .       char w _\bw
1579 .       char x _\bx
1580 .       char y _\by
1581 .       char z _\bz
1582 .       char \[`a] _\b\[`a]
1583 .       char \[^a] _\b\[^a]
1584 .       char \['a] _\b\['a]
1585 .       char \[:a] _\b\[:a]
1586 .       char \[oa] _\b\[oa]
1587 .       char \[~a] _\b\[~a]
1588 .       char \[ae] _\b\[ae]
1589 .       char \[`e] _\b\[`e]
1590 .       char \[^e] _\b\[^e]
1591 .       char \['e] _\b\['e]
1592 .       char \[:e] _\b\[:e]
1593 .       char \[`i] _\b\[`i]
1594 .       char \[^i] _\b\[^i]
1595 .       char \['i] _\b\['i]
1596 .       char \[:i] _\b\[:i]
1597 .       char \[`o] _\b\[`o]
1598 .       char \[^o] _\b\[^o]
1599 .       char \['o] _\b\['o]
1600 .       char \[:o] _\b\[:o]
1601 .       char \[~o] _\b\[~o]
1602 .       char \[/o] _\b\[/o]
1603 .       char \[`u] _\b\[`u]
1604 .       char \[^u] _\b\[^u]
1605 .       char \['u] _\b\['u]
1606 .       char \[:u] _\b\[:u]
1607 .       char \[,c] _\b\[,c]
1608 .       char \[Sd] _\b\[Sd]
1609 .       char \[~n] _\b\[~n]
1610 .       char \[Tp] _\b\[Tp]
1611 .       char \['y] _\b\['y]
1612 .       char \[:y] _\b\[:y]
1613 .       char \[ss] _\b\[ss]
1614 .       char ' _\b'
1615 .       char 1 _\b1
1616 .       char 2 _\b2
1617 .       char 3 _\b3
1618 .       char 4 _\b4
1619 .       char 5 _\b5
1620 .       char 6 _\b6
1621 .       char 7 _\b7
1622 .       char 8 _\b8
1623 .       char 9 _\b9
1624 .       char 0 _\b0
1625 .    \}
1626 .    el \{\
1627 .       nr #UNDERLINE_ON 0
1628 .       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 \
1629         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 \
1630         \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1631         \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1632         \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1633         \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1634         \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1635         \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1636         ' 1 2 3 4 5 6 7 8 9 0
1637 .    \}
1638 .END
1641 \# UL/ULX
1642 \# ------
1643 \# *Arguments:
1644 \#   <none>
1645 \# *Function:
1646 \#   Underscores all letters, words, and digits in a passage,
1647 \#   ignoring punctuation and spaces.
1648 \# *Notes:
1649 \#   Intended to be called with inline escapes \*[UL] (underline
1650 \#   on) and \*[ULX] (underline off).  Only works when the font family
1651 \#   is COURIER, to simulate typewriter-style underlining of italic
1652 \#   passages.
1654 .MAC UL END
1655 \c\R'#UNDERLINE_ON 1'
1656 .       char A _\bA
1657 .       char B _\bB
1658 .       char C _\bC
1659 .       char D _\bD
1660 .       char E _\bE
1661 .       char F _\bF
1662 .       char G _\bG
1663 .       char H _\bH
1664 .       char I _\bI
1665 .       char J _\bJ
1666 .       char K _\bK
1667 .       char L _\bL
1668 .       char M _\bM
1669 .       char N _\bN
1670 .       char O _\bO
1671 .       char P _\bP
1672 .       char Q _\bQ
1673 .       char R _\bR
1674 .       char S _\bS
1675 .       char T _\bT
1676 .       char U _\bU
1677 .       char V _\bV
1678 .       char W _\bW
1679 .       char X _\bX
1680 .       char Y _\bY
1681 .       char Z _\bZ
1682 .       char \[`A] _\b\[`A]
1683 .       char \[^A] _\b\[^A]
1684 .       char \['A] _\b\['A]
1685 .       char \[:A] _\b\[:A]
1686 .       char \[oA] _\b\[oA]
1687 .       char \[~A] _\b\[~A]
1688 .       char \[AE] _\b\[AE]
1689 .       char \[`E] _\b\[`E]
1690 .       char \[^E] _\b\[^E]
1691 .       char \['E] _\b\['E]
1692 .       char \[:E] _\b\[:E]
1693 .       char \[`I] _\b\[`I]
1694 .       char \[^I] _\b\[^I]
1695 .       char \['I] _\b\['I]
1696 .       char \[:I] _\b\[:I]
1697 .       char \[`O] _\b\[`O]
1698 .       char \[^O] _\b\[^O]
1699 .       char \['O] _\b\['O]
1700 .       char \[:O] _\b\[:O]
1701 .       char \[~O] _\b\[~O]
1702 .       char \[/O] _\b\[/O]
1703 .       char \[`U] _\b\[`U]
1704 .       char \[^U] _\b\[^U]
1705 .       char \['U] _\b\['U]
1706 .       char \[:U] _\b\[:U]
1707 .       char \[,C] _\b\[,C]
1708 .       char \[-D] _\b\[-D]
1709 .       char \[~N] _\b\[~N]
1710 .       char \[TP] _\b\[TP]
1711 .       char \['Y] _\b\['Y]
1712 .       char \[:Y] _\b\[:Y]
1713 .       char a _\ba
1714 .       char b _\bb
1715 .       char c _\bc
1716 .       char d _\bd
1717 .       char e _\be
1718 .       char f _\bf
1719 .       char g _\bg
1720 .       char h _\bh
1721 .       char i _\bi
1722 .       char j _\bj
1723 .       char k _\bk
1724 .       char l _\bl
1725 .       char m _\bm
1726 .       char n _\bn
1727 .       char o _\bo
1728 .       char p _\bp
1729 .       char q _\bq
1730 .       char r _\br
1731 .       char s _\bs
1732 .       char t _\bt
1733 .       char u _\bu
1734 .       char v _\bv
1735 .       char w _\bw
1736 .       char x _\bx
1737 .       char y _\by
1738 .       char z _\bz
1739 .       char \[`a] _\b\[`a]
1740 .       char \[^a] _\b\[^a]
1741 .       char \['a] _\b\['a]
1742 .       char \[:a] _\b\[:a]
1743 .       char \[oa] _\b\[oa]
1744 .       char \[~a] _\b\[~a]
1745 .       char \[ae] _\b\[ae]
1746 .       char \[`e] _\b\[`e]
1747 .       char \[^e] _\b\[^e]
1748 .       char \['e] _\b\['e]
1749 .       char \[:e] _\b\[:e]
1750 .       char \[`i] _\b\[`i]
1751 .       char \[^i] _\b\[^i]
1752 .       char \['i] _\b\['i]
1753 .       char \[:i] _\b\[:i]
1754 .       char \[`o] _\b\[`o]
1755 .       char \[^o] _\b\[^o]
1756 .       char \['o] _\b\['o]
1757 .       char \[:o] _\b\[:o]
1758 .       char \[~o] _\b\[~o]
1759 .       char \[/o] _\b\[/o]
1760 .       char \[`u] _\b\[`u]
1761 .       char \[^u] _\b\[^u]
1762 .       char \['u] _\b\['u]
1763 .       char \[:u] _\b\[:u]
1764 .       char \[,c] _\b\[,c]
1765 .       char \[Sd] _\b\[Sd]
1766 .       char \[~n] _\b\[~n]
1767 .       char \[Tp] _\b\[Tp]
1768 .       char \['y] _\b\['y]
1769 .       char \[:y] _\b\[:y]
1770 .       char \[ss] _\b\[ss]
1771 .       char ' _\b'
1772 .       char 1 _\b1
1773 .       char 2 _\b2
1774 .       char 3 _\b3
1775 .       char 4 _\b4
1776 .       char 5 _\b5
1777 .       char 6 _\b6
1778 .       char 7 _\b7
1779 .       char 8 _\b8
1780 .       char 9 _\b9
1781 .       char 0 _\b0
1782 .END
1785 .MAC ULX END
1786 \c\R'#UNDERLINE_ON 0'
1787 .    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 \
1788      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 \
1789      \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1790      \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1791      \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1792      \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1793      \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1794      \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1795      ' 1 2 3 4 5 6 7 8 9 0
1796 .END
1799 \# UNDERSCORE
1800 \# ----------
1801 \# *Arguments:
1802 \#   [points below baseline] "text"
1803 \# *Function:
1804 \#   Places an underscore 2 points under the string if no lead given,
1805 \#   otherwise places underscore under string by user specified amount.
1806 \# *Notes:
1807 \#   When using this macro, the string to be underscored must begin
1808 \#   with double-quotes ("), regardless of whether it's the sole
1809 \#   argument or the second.
1810 \#   E.g.:
1811 \#      .UNDERSCORE "Text to be underscored
1812 \#         or
1813 \#      .UNDERSCORE 2p "Text to be underscored
1815 \#   All text is underscored (including punctuation and spaces).
1816 \#   This is the primary difference between UNDERLINE and UNDERSCORE,
1817 \#   aside from the fact the UNDERLINE only works with Courier.
1819 \#   UNDERSCORE does not work across line breaks.  Each line of
1820 \#   text must be entered separately with UNDERSCORE.  If the
1821 \#   UNDERSCORE begins in the middle of a line and crosses over a
1822 \#   break, the portion before the break must be entered in its own
1823 \#   UNDERSCORE, as must the portion that comes after the break.
1825 .MAC UNDERSCORE END
1826 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1827 .    ie \\n[#NUM_ARGS]=1 \{ \\$1\\s(12\\v'+2p'\\l'|0'\\v'-2p'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1828 .    el                  \{ \\$2\\s(12\\v'+(\\$1)'\\l'|0'\\v'-(\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1829 .    rr #RESTORE_PT_SIZE
1830 .END
1833 \# DOUBLE UNDERSCORE
1834 \# -----------------
1835 \# *Arguments:
1836 \#   [points below baseline] [points distance between rules] "text"
1837 \# *Function:
1838 \#   Same as UNDERSCORE, except it produces a double underscore.  The default
1839 \#   distance between the rules is 2 points.
1840 \# *Notes:
1841 \#   The same double-quote requirement as UNDERSCORE.
1843 .MAC UNDERSCORE2 END
1844 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1845 .    if \\n[#NUM_ARGS]=1 \{\
1846 .       PRINT \\$1\\s(12\\v'+2p'\\l'|0'\\v'+2p'\\l'|0'\\v'-4p'\\s[\\n[#RESTORE_PT_SIZE]u]
1847 .    \}
1848 .    if \\n[#NUM_ARGS]=2 \{\
1849 .       PRINT \\$2\\s(12\\v'+\\$1'\\l'|0'\\v'+2p'\\l'|0'\\v'-(2p+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1850 .    \}
1851 .    if \\n[#NUM_ARGS]=3 \{\
1852 .       PRINT \\$3\\s(12\\v'+\\$1'\\l'|0'\\v'+\\$2'\\l'|0'\\v'-(\\$2+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1853 .    \}
1854 .    rr #RESTORE_PT_SIZE
1855 .END
1858 \# SUPERSCRIPT INLINES
1859 \# -------------------
1860 \# *Function:
1861 \#   Prints everything after invocation as superscript.
1862 \# *Notes:
1863 \#   \*[SUP] and \*[SUPX] turn superscript on and off respectively.
1864 \#   If running type is pseudo-condensed/expanded, invoke the superscript
1865 \#   strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
1866 \#   and \*[EXTSUPX] respectively.
1868 .ds SUP \
1869 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1870 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1871 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]
1873 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'
1875 .ds CONDSUP \
1876 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1877 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1878 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
1880 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
1882 .ds EXTSUP \
1883 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1884 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1885 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
1887 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
1890 \# SLANT
1891 \# -----
1893 \# SETSLANT
1894 \# --------
1895 \# *Arguments:
1896 \#   <number of degrees> | RESET
1897 \# *Function:
1898 \#   Modifies register #DEGREES for use with \*[SLANT], or resets
1899 \#   it to the default.  Defines string \*[SLANTX]
1900 \# *Notes:
1901 \#   \*[SLANT] permits pseudo-italicizing of a font in cases where
1902 \#   no italic font exists in a particular family.
1904 \#   Default # of degrees is 15.
1906 \#   Do not use unit of measure with arg to SETSLANT.
1908 \#   It may be necessary to adjust the spacing on either side of
1909 \#   [SLANT] and [SLANTX].
1911 \#   In docs, SLANT carries over from para to para.
1913 .nr #DEGREES 15
1914 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1915 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1917 .MAC SETSLANT END
1918 .    ie '\\$1'RESET' \{\
1919 .       nr #DEGREES 15
1920 .       if \\n[#PRINT_STYLE]=1 \{\
1921 .          if \\n[#UNDERLINE_SLANT] \{ .return \}
1922 .       \}
1923 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1924 .    \}
1925 .    el \{\
1926 .       nr #DEGREES \\$1
1927 .       if \\n[#PRINT_STYLE]=1 \{\
1928 .          if \\n[#UNDERLINE_SLANT] \{ .return \}
1929 .       \}
1930 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1931 .    \}
1932 .    ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1933 .END
1936 \# BOLDER
1937 \# ------
1939 \# SETBOLDER
1940 \# ---------
1941 \# *Arguments:
1942 \#   <amount of emboldening> | RESET
1943 \# *Function:
1944 \#   Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
1945 \#   it to the default 700 units.
1946 \# *Notes:
1947 \#   \*[BOLDER] allows pseudo-emboldening of a font where no bold
1948 \#   font exists in a particular family.
1950 \#   Default for SETBOLDER is 700 units.  Do not use unit of measure
1951 \#   with arg to SETBOLDER.
1953 .nr #BOLDER_UNITS 700
1955 .MAC SETBOLDER END
1956 .    if \\n[#IGNORE]=1 \{ .return \}
1957 .    ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
1958 .    el \{ .nr #BOLDER_UNITS \\$1 \}
1959 .END
1962 .MAC BOLDER END
1964 .bd \\n(.f \\n[#BOLDER_UNITS]
1965 .END
1968 .MAC BOLDERX END
1970 .bd \\n(.f
1971 .END
1973 \# +++CONDENSE/EXTEND+++
1975 \# CONDENSE/EXTEND
1976 \# ---------------
1977 \# *Arguments:
1978 \#   <percentage to condense/expand type size>
1979 \# *Function:
1980 \#   Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
1981 \#   new point size (for character width) from arg, and defines string
1982 \#   COND or EXT, which set the type size to the new character width,
1983 \#   and sets the height of type to the value stored in CURRENT_PT_SIZE
1984 \# *Notes:
1985 \#   CONDENSE_OR_EXTEND is invoked from the aliases
1986 \#   CONDENSE and EXTEND.  CONDENSE implies <100, EXTEND
1987 \#   implies >100.  Do not use a percent sign in the argument.
1989 \#   There is no default setting for CONDENSE or EXTEND.
1990 \#   80 is a good approximation of condensed type, 120 is okay
1991 \#   for extended.
1993 \#   The value set by CONDENSE or EXTEND applies to all
1994 \#   subsequent \*[COND] or \*[EXT] escapes until a new value is set.
1996 \#  \*[COND] or \*[EXT] must be turned off before all changes of point
1997 \#  size and reinvoked afterwards (if so desired).  This refers to
1998 \#  changes of point size via control lines AND with via inlines.
2000 .MAC CONDENSE_OR_EXTEND END
2001 .    if '\\$0'CONDENSE' \{\
2002 .       ds $COND_PERCENT \\$1
2003 .       if \\n[#PRINT_STYLE]=1 \{\
2004 .          rm $COND_PERCENT
2005 .          ds $COND_PERCENT 100
2006 .       \}
2007 .       ds COND \
2008 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2009 \R'#CONDENSE 1'\
2010 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2011 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2012 .       ds COND_FOR_SUP \
2013 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2014 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2015 .    \}
2016 .    if '\\$0'EXTEND' \{\
2017 .       ds $EXT_PERCENT \\$1
2018 .       if \\n[#PRINT_STYLE]=1 \{\
2019 .          rm $EXT_PERCENT
2020 .          ds $EXT_PERCENT 100
2021 .       \}
2022 .       ds EXT \
2023 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2024 \R'#EXTEND 1'\
2025 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2026 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2027 .       ds EXT_FOR_SUP \
2028 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2029 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2030 .    \}
2031 .END
2033 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2034 .ds EXTX  \ER'#EXTEND   0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2037 \# +++PAD LINES+++ (insert space)
2039 \# PAD MARKER
2040 \# ----------
2041 \# *Arguments:
2042 \#   <character to use for marking pad points>
2043 \# *Function:
2044 \#   Defines string $PAD_MARKER, used in PAD
2045 \# *Notes:
2046 \#   $PAD_MARKER is normally # (the pound sign).
2048 .MAC PAD_MARKER END
2049 .    ds $PAD_MARKER \\$1
2050 .END
2053 \# PAD
2054 \# ---
2055 \# *Argments:
2056 \#   "<string of text with padding markers inserted>"
2057 \# *Function:
2058 \#   Defines and redefines padding character (default=pound sign
2059 \#   unless padding character has been set with PAD_MARKER)
2060 \#   several times so that when the string is output at the end
2061 \#   of the macro, every # has been converted to an equal-sized
2062 \#   amount of padding (blank space) on a line. # is equivalent to
2063 \#   CompuGraphic's old <IS>.
2064 \# *Notes:
2065 \#   String tabs may be marked off during PAD.
2067 .MAC PAD END
2068 .    if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2069 .    nf
2070 .    if !d$PAD_MARKER \{ .ds $PAD_MARKER # \}
2071 .    char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2072 .    ds $FAMILY_FOR_PAD \\n[.fam]
2073 .    nr #FONT_FOR_PAD   \\n(.f
2074 .    nr #SIZE_FOR_PAD   \\n[.ps]
2075 .    ds $PAD_STRING \\$1
2076 .    as $PAD_STRING \Ekp
2077 .    di PAD_STRING
2078 .    fam \\*[$FAMILY_FOR_PAD]
2079 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2080 .    br
2081 .    di
2082 .    char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2083 .    di PAD_STRING
2084 .    fam \\*[$FAMILY_FOR_PAD]
2085 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2086 .    br
2087 .    di
2088 .    char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2089 .    ie \\n[#SILENT] \{\
2090 .       SILENT
2091 .       fam \\*[$FAMILY_FOR_PAD]
2092 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2093 .       br
2094 .       SILENT OFF
2095 .    \}
2096 .    el \{\
2097 .       fam \\*[$FAMILY_FOR_PAD]
2098 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2099 .       br
2100 .    \}
2101 .    if \\n[#FILL_MODE]=1 \{\
2102 .       fi
2103 .       rr #FILL_MODE
2104 .    \}
2105 .    rr #PAD_COUNT
2106 .    rr #SPACE_TO_END
2107 .    rr #PAD_SPACE
2108 .    rm $PAD_STRING
2109 .    rm PAD_STRING
2110 .    rchar #
2111 .END
2114 \# +++LEADERS+++
2116 \#  The leader mechanism is primitive, but it works.  Basically,
2117 \#  every macro in this set that includes a line length also sets
2118 \#  a single groff tab stop at the right hand end of the line.
2119 \#  That way, whenever Ctrl-A is invoked (always at the end of
2120 \#  an input line), leader of the correct length gets deposited.
2121 \#  Ctrl-A is accessed by the string LEADER (i.e. inline, as
2122 \#  \*[LEADER]).  Leaders within tabs get their length from the
2123 \#  tab line length.
2125 \# SET LEADER CHARACTER
2126 \# --------------------
2127 \# *Arguments:
2128 \#   <character to use whenever \*[LEADER] is invoked>
2129 \# *Function:
2130 \#   Set leader character.
2132 .MAC LEADER_CHARACTER END
2133 .    lc \\$1
2134 .END
2136 .ds LEADER \x01
2138 \# +++DROP CAPS+++
2140 \# DROP CAP FAMILY
2141 \# ---------------
2142 \# *Argument:
2143 \#   <family of drop cap>
2144 \# *Function:
2145 \#   Creates or modifies string $DC_FAM.
2147 .MAC DROPCAP_FAMILY END
2148 .    ds $DC_FAM \\$1
2149 .END
2152 \# DROP CAP FONT
2153 \# -------------
2154 \# *Argument:
2155 \#   <font of drop cap>
2156 \# *Function:
2157 \#   Creates or modifies string $DC_FT.
2159 .MAC DROPCAP_FONT END
2160 .    ds $DC_FT \\$1
2161 .END
2164 \# DROP CAP GUTTER
2165 \# ---------------
2166 \# *Argument:
2167 \#   <width of gutter between drop cap and indented text>
2168 \# *Function:
2169 \#   Creates or modifies register #DC_GUT.
2170 \# *Notes:
2171 \#   Requires unit of measure.  Default is 3p.
2173 .MAC DROPCAP_GUTTER END
2174 .    nr #DC_GUT (\\$1)
2175 .END
2178 \# DROP CAP ADJUST
2179 \# ---------------
2180 \# *Argument:
2181 \#   <+|- # of points to in/decrease point size of drop cap letter>
2182 \# *Function:
2183 \#   Creates or modifies string $DC_ADJUST.
2184 \# *Notes:
2185 \#   Despite its best efforts, DROPCAP doesn't always get the point
2186 \#   size of the drop cap critically perfect.  DROPCAP_ADJUST lets
2187 \#   the user add or subtract points (or fractions of points) to
2188 \#   get the size right.
2190 \#   Requires the + or - sign.
2192 .MAC DROPCAP_ADJUST END
2193 .    ds $DC_ADJUST \\$1
2194 .END
2197 \# DROP CAP
2198 \# --------
2199 \# *Arguments:
2200 \#   <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2201 \# *Function:
2202 \#   Calculates point size of dropcap based on # of lines passed as
2203 \#   arg 2.  Sets indent for text based on dropcap width+gutter.
2204 \#   Advances and prints dropcap; reverses and prints indented text
2205 \#   to bottom of dropcap, then resets indent to left margin (plus
2206 \#   any indent that was in effect prior to invoking DROPCAP).
2207 \# *Notes:
2208 \#   Drop caps put a strain on on resource-challenged systems.
2210 \#   Drop caps when using the doc processing macro PP only work with
2211 \#   initial paragraphs (i.e. at doc start, or after heads), only when
2212 \#   DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2213 \#   is TYPESET.  If these conditions aren't met, DROPCAPS is silently
2214 \#   ignored.
2216 \#   The COND or EXT argument are processed separately from all
2217 \#   other COND or EXT inlines or macros, hence passing COND or
2218 \#   EXT has no effect on running type.
2220 .MAC DROPCAP END
2221 .    if #IGNORE \{ .return \}
2222 .    br
2223 .    if \\n[#DOCS] \{\
2224 .       if \\n[#PRINT_STYLE]=1 \{ .return \}
2225 .       if \\n[#PRINT_STYLE]=2 \{\
2226 .          if \\n[#PP_STYLE]=2 \{ .return \}
2227 .          if \\n[#PP]>1 \{ .return \}
2228 .          ti 0
2229 .       \}
2230 .    \}
2231 .    ds $DROPCAP         \\$1
2232 .    nr #DC_LINES        \\$2-1
2233 .    ds $RESTORE_COND    \\*[$COND_PERCENT]
2234 .    ds $RESTORE_EXT     \\*[$EXT_PERCENT]
2235 .    if '\\$3'COND'      \{ .CONDENSE \\$4 \}
2236 .    if '\\$3'EXT'       \{ .EXTEND \\$4 \}
2237 .    if !r#DC_GUT        \{ .nr #DC_GUT (3p) \}
2238 .    ds $RESTORE_FAM     \\n[.fam]
2239 .    nr #RESTORE_FT      \\n(.f
2240 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2241 .    nr #RESTORE_INDENT  \\n(.i
2242 .    SIZESPECS
2243 .    nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2244 .    ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2245 .    el \{ .FAM \\*[$DC_FAM] \}
2246 .    ie !d$DC_FT \{ .FT \\n(.f \}
2247 .    el \{ .FT \\*[$DC_FT] \}
2248 .    while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2249 .       ps \\n[#PT_SIZE]u+100u
2250 .       SIZESPECS
2251 .       nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2252 .    \}
2253 .    if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2254 .    mk x
2255 .    sp \\n[#DC_LINES]v
2256 .    ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2257 .    el \{ .PRINT \\*[$DROPCAP] \}
2258 .    if '\\$3'COND' \{ \E*[COND] \}
2259 .    if '\\$3'EXT'  \{ \E*[EXT]  \}
2260 .    ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2261 .    el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2262 .    if '\\$3'COND' \{ \E*[CONDX]\c \}
2263 .    if '\\$3'EXT'  \{ \E*[EXTX]\c \}
2264 .    rt \\nxu
2265 .    FAM \\*[$RESTORE_FAM]
2266 .    FT  \\n[#RESTORE_FT]
2267 .    ps \\n[#RESTORE_PT_SIZE]u
2268 .    CONDENSE \\*[$RESTORE_COND]
2269 .    EXTEND   \\*[$RESTORE_EXT]
2270 .    ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2271 .    el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2272 .    rm $DROPCAP
2273 .    rr #DC_LINES
2274 .    rm $RESTORE_COND
2275 .    rm $RESTORE_EXT
2276 .    rm $RESTORE_FAM
2277 .    rr #RESTORE_FT
2278 .    rr #RESTORE_PT_SIZE
2279 .    rr #RESTORE_INDENT
2280 .    rr #DC_HEIGHT
2281 .    rr #GET_DC_HEIGHT
2282 .    rr x
2283 .END
2285 .MAC DROPCAP_OFF END
2286 '    in \\n[#RESTORE_INDENT]u
2287 .END
2290 \# RULE
2291 \# ----
2292 \# *Argument:
2293 \#   <none>
2294 \# *Function:
2295 \#   Draws a rule the length of the current measure.
2296 \# *Notes:
2298 .MAC RULE END
2299 .    if \\n(.j=1 \{\
2300 .       ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2301 .       nf
2302 .    \}
2303 .    ie \\n[#INDENT_ACTIVE] \{\
2304 .       nr #RESTORE_L_LENGTH \\n(.l
2305 .       if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2306 .       if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2307 .       PRINT \El'\En(.lu'
2308 .       ll \\n[#RESTORE_L_LENGTH]u
2309 .       rr #RESTORE_L_LENGTH]u
2310 .    \}
2311 .    el \{\
2312 .       PRINT \El'\En(.lu'
2313 .    \}
2314 .    QUAD \\*[$CURRENT_QUAD]
2315 .    rm $CURRENT_QUAD
2316 .    EL
2317 .END
2319 \# =====================================================================
2321 \# +++WORD AND SENTENCE SPACING+++
2323 \# WORD SPACE CONTROL
2324 \# ------------------
2325 \# *Argument:
2326 \#   <+|->wordspace | DEFAULT
2327 \# *Function:
2328 \#   Increases or decreases interword space by user supplied amount.
2329 \#   If DEFAULT, value is set to 12 (groff default).
2330 \# *Notes:
2331 \#   $WS_CONSTANT is the groff default word space.
2332 \#   $WS_VAR is the user supplied amount by which to in/decrease word space.
2333 \#   $WS is a concatenation of WS_CONSTANT and WS_VAR.
2335 \#   Because the user supplied value requires a literal + or - sign,
2336 \#   the macro argument is stored in a string.
2338 \#   \n[.sss] holds the current sentence space value.
2340 .MAC WS END
2341 .    ds $WS_CONSTANT 12
2342 .    ds $WS_VAR \\$1
2343 .    ie '\\$1'DEFAULT' \{ .ds $WS_VAR +0 \}
2344 .    el                \{ .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR]) \}
2345 .    ie \\n[.sss]=12   \{ .ss \\*[$WS] 12 \}
2346 .    el \{\
2347 .       ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
2348 .       SS \\*[$SS_VAR]
2349 .    \}
2350 .END
2353 \# SENTENCE SPACE CONTROL
2354 \# ----------------------
2355 \# *Argument:
2356 \#   <+-sentencespace> | 0 | DEFAULT
2357 \# *Function:
2358 \#   Increases or decreases sentence space by user supplied amount.
2359 \#   If 0, sentence spaces are ignored.  If DEFAULT, value is
2360 \#   set to 12 (groff default).
2361 \# *Notes:
2362 \#   Because the user supplied value requires a literal + or - sign,
2363 \#   the macro argument is stored in a string.
2365 \#   Sentence space applies only to input where sentences are separated
2366 \#   by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
2367 \#   Changing .SS when sentences are separated by only one space has
2368 \#   no effect on the space between sentences.
2370 \#   \n[.ss] holds the current wordspace value.
2371 \#   \n[.sss] holds the current sentence space value.
2373 .MAC SS END
2374 .    ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
2375 .    el \{\
2376 .       ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
2377 .       el \{\
2378 .          ds $SS_VAR \\$1
2379 .          ss \\n[.ss] (0\\*[$SS_VAR])
2380 .       \}
2381 .    \}
2382 .END
2385 \# =====================================================================
2387 \# +++INDENTS+++
2389 \# There are five styles of indents: left, right, both, temporary,
2390 \# and hanging.  Each is set/invoked with a different macro.
2391 \# Indent macros begin with the letter "I", hence .IL means "indent left,"
2392 \# .IR means "indent right," and so on.
2394 \# The first time any of the indent macros is used, it requires an
2395 \# argument--the size of the indent in ipPcm.  The size may also
2396 \# be entered using the \w'#' function--very useful for numbered
2397 \# lists using HI).  The unit of measure is required.  Subsequent
2398 \# invocations don't require the argument; the indent measure remains the
2399 \# same until it's changed by invoking the macro with an argument again.
2401 \# If no indents are in effect, the arguments passed to indent macros are
2402 \# measured from the left and right margins of the page.  If a left indent
2403 \# or a right indent is already in effect, the arguments passed to
2404 \# the indent macros are calculated from the current values; in other words,
2405 \# the arguments are additive.  If you quit an indent and later return
2406 \# to it, its value will be the value last in effect, unless you pass
2407 \# it an argument.  If you do pass an argument, it is added to the last
2408 \# value in effect, unless you cleared the indent with one of
2409 \# .I<LRB>X macros.
2411 \# Example
2412 \# -------
2414 \# .IL 2P
2415 \# ...some text...
2416 \# .IL 2P
2417 \# ...some text...
2418 \# .IQ
2419 \# ...some text...
2420 \# .IL
2421 \# ...some text...
2423 \# The first .IL 2P indents text 2P from the left margin.  The second
2424 \# .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
2425 \# .IQ turns the indent off.  The last .IL (which has no argument)
2426 \# takes its value from the total of all arguments passed to .IL (in
2427 \# this case, 2P and 2P), therefore it indents 2P+2P from the left
2428 \# margin, i.e. 4P.  If you wanted the last .IL to indent just 2P,
2429 \# you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
2430 \# the last .IL the argument 2P.
2432 \# To reverse the sense of an indent added to an indent, you may use
2433 \# negative values.
2435 \# Indents can be turned off individually with ILX, IRX, and IBX.
2436 \# LEFT and RIGHT indents may be combined and manipulated
2437 \# separately, (e.g. you can have an IL of 2P and an IR of 4P
2438 \# operative at the same time, and then change, say, the IL to
2439 \# 4P--thereby left indenting 6P--while the IR remains at 4P.
2441 \# IB automatically turns off IL and IR.  They have to be reinvoked
2442 \# again when needed. IL and IR automatically turn IB off; it, too,
2443 \# has to be reinvoked with needed.
2445 \# All indents can be turned off at once with IQ.  The ILX, IRX, IBX,
2446 \# and IQ macros simply turn the indents off; the values stored in
2447 \# the respective indent macros (IL, IR, IB) remain in effect.  If
2448 \# the user wishes to clear the values, the I<LRB>X macros should be
2449 \# invoked with the single argument CLEAR.  IQ CLEAR clears out
2450 \# the values stored for all indent styles.
2452 \# Indents *must* be turned off before settting string tabs
2453 \# inside PAD.  Generally, in order not to get confused, it's a
2454 \# good idea to turn all indents off before setting any tabs.
2456 \# TI and HI are special cases.  There's no need to turn them off,
2457 \# since they affect only one line--the first after their
2458 \# invocation.  Like the other indent styles, the first time
2459 \# they're invoked, they require a value in iPpcm; each subsequent
2460 \# invocation without an argument will use the same value.  To
2461 \# change the value, simply pass a new value.  Values for TI and HI
2462 \# are *not* additive.
2464 \# HI presupposes that you already have a left or both indent
2465 \# on.  HI will never hang a line outside the left margin of a
2466 \# document.  In other words, you must have IL or IB on before you
2467 \# can use HI.
2469 \# INDENT LEFT
2470 \# -----------
2472 .MAC IL END
2473 .    if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2474 .    nr #INDENT_STYLE_LEFT  1
2475 .    nr #INDENT_ACTIVE      1
2476 .    nr #INDENT_LEFT_ACTIVE 1
2477 .    ie '\\$1'' \{\
2478 .       br
2479 .       in \\n[#L_INDENT]u
2480 .       ta \\n(.lu-\\n[#L_INDENT]u
2481 .    \}
2482 .    el \{\
2483 .       br
2484 .       nr #L_INDENT +(\\$1)
2485 .       in \\n[#L_INDENT]u
2486 .       ta \\n(.lu-\\n[#L_INDENT]u
2487 .    \}
2488 .END
2491 \# +++INDENT RIGHT+++
2493 .MAC IR END
2494 .    if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2495 .    nr #INDENT_STYLE_RIGHT   1
2496 .    nr #INDENT_ACTIVE        1
2497 .    nr #INDENT_RIGHT_ACTIVE 1
2498 .    ie '\\$1'' \{\
2499 .       br
2500 .       ie \\n[#TAB_ACTIVE] \{\
2501 .          ll \\n(.lu-\\n[#R_INDENT]u
2502 .          ta \\n(.lu-\\n[#L_INDENT]u
2503 .       \}
2504 .       el \{\
2505 .          ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2506 .          ta \\n(.lu-\\n[#L_INDENT]u
2507 .       \}
2508 .    \}
2509 .    el \{\
2510 .       br
2511 .       nr #R_INDENT +(\\$1)
2512 .       ie \\n[#TAB_ACTIVE] \{\
2513 .          ll \\n(.lu-\\n[#R_INDENT]u
2514 .          ta \\n(.lu-\\n[#L_INDENT]u
2515 .       \}
2516 .       el \{\
2517 .          ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2518 .          ta \\n(.lu-\\n[#L_INDENT]u
2519 .       \}
2520 .    \}
2521 .END
2524 \# +++INDENT BOTH+++
2526 .MAC IB END
2527 .    if \\n[#INDENT_STYLE_LEFT]  \{ .ILX \}
2528 .    if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
2529 .    nr #INDENT_STYLE_BOTH  1
2530 .    nr #INDENT_ACTIVE      1
2531 .    nr #INDENT_BOTH_ACTIVE 1
2532 .    ie '\\$1'' \{\
2533 .       br
2534 .       in \\n[#BL_INDENT]u
2535 .       ie \\n[#TAB_ACTIVE] \{\
2536 .          ll \\n(.lu-\\n[#BR_INDENT]u
2537 .          ta \\n(.lu-\\n[#BR_INDENT]u
2538 .       \}
2539 .       el \{\
2540 .          ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2541 .          ta \\n(.lu-\\n[#BR_INDENT]u
2542 .       \}
2543 .    \}
2544 .    el \{\
2545 .       br
2546 .       nr #BL_INDENT (\\n[#INDENT]+\\$1)
2547 .       ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
2548 .       el                  \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
2549 .       ie \\n[#TAB_ACTIVE] \{\
2550 .          in \\n[#BL_INDENT]u
2551 .          ll \\n(.lu-\\n[#BR_INDENT]u
2552 .          ta \\n(.lu-\\n[#BL_INDENT]u
2553 .       \}
2554 .       el \{\
2555 .          in \\n[#BL_INDENT]u
2556 .          ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2557 .          ta \\n(.lu-\\n[#BR_INDENT]u
2558 .       \}
2559 .    \}
2560 .END
2563 \# +++TEMPORARY INDENT+++
2565 .MAC TI END
2566 .    br
2567 .    ie '\\$1'' \{\
2568 .       ti \\n[#T_INDENT]u
2569 .       if \\n[#INDENT_LEFT_ACTIVE] \{\
2570 .          ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
2571 .       \}
2572 .       if \\n[#INDENT_BOTH_ACTIVE] \{\
2573 .          ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
2574 .       \}
2575 .    \}
2576 .    el \{\
2577 .       nr #T_INDENT (\\$1)
2578 .       ti \\n[#T_INDENT]u
2579 .    \}
2580 .END
2583 \# +++HANGING INDENT+++
2585 .MAC HI END
2586 .    ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
2587 .    el \{\
2588 .       nr #HL_INDENT (\\$1)
2589 .       ti -\\n[#HL_INDENT]u
2590 .    \}
2591 .END
2594 \# +++INDENTS OFF+++
2596 .MAC ILX END
2597 .    br
2598 .    in 0
2599 .    rr #INDENT_LEFT_ACTIVE
2600 .    if '\\$1'CLEAR' \{\
2601 .       rr #L_INDENT
2602 .       rr #INDENT_STYLE_LEFT
2603 .    \}
2604 .END
2607 .MAC IRX END
2608 .    br
2609 .    rr #INDENT_RIGHT_ACTIVE
2610 .    ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2611 .    el \{\
2612 .       ie \\n[#COLUMNS] \{\
2613 .          ll \\n[#COL_L_LENGTH]u
2614 .          ta \\n(.lu
2615 .       \}
2616 .       el \{\
2617 .          ll \\n[#L_LENGTH]u
2618 .          ta \\n(.lu
2619 .       \}
2620 .    \}
2621 .    if '\\$1'CLEAR' \{\
2622 .       rr #R_INDENT
2623 .       rr #INDENT_STYLE_RIGHT
2624 .    \}
2625 .END
2628 .MAC IBX END
2629 .    br
2630 .    in 0
2631 .    rr #INDENT_BOTH_ACTIVE
2632 .    ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2633 .    el \{\
2634 .       ie \\n[#COLUMNS] \{\
2635 .          ll \\n[#COL_L_LENGTH]u
2636 .          ta \\n(.lu
2637 .       \}
2638 .       el \{\
2639 .          ll \\n[#L_LENGTH]u
2640 .          ta \\n(.lu
2641 .       \}
2642 .    \}
2643 .    if '\\$1'CLEAR' \{\
2644 .       rr #BL_INDENT
2645 .       rr #BR_INDENT
2646 .       rr #INDENT_STYLE_BOTH
2647 .    \}
2648 .END
2651 .MAC IX END
2652 .    if '\\$0'IX' \{\
2653 .       if !\\n[#IX_WARN] \{\
2654 .          tm1 "[mom]: Use of .IX is now deprecated.  Use .IQ instead.
2655 .          tm1 "      .IX will continue to behave as before, but to
2656 .          tm1 "       avoid this message, please update your document.
2657 .          nr #IX_WARN 1
2658 .       \}
2659 .    \}
2660 .    br
2661 .    in 0
2662 .    rr #INDENT_LEFT_ACTIVE
2663 .    rr #INDENT_RIGHT_ACTIVE
2664 .    rr #INDENT_BOTH_ACTIVE
2665 .    if \\n[#INDENT_STYLE_RIGHT] \{\
2666 .       ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2667 .       el \{\
2668 .          ie \\n[#COLUMNS] \{\
2669 .             ll \\n[#COL_L_LENGTH]u
2670 .             ta \\n(.lu
2671 .          \}
2672 .          el \{\
2673 .             ll \\n[#L_LENGTH]u
2674 .             ta \\n(.lu
2675 .          \}
2676 .       \}
2677 .    \}
2678 .    if \\n[#INDENT_STYLE_BOTH] \{\
2679 .       ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2680 .       el \{\
2681 .          ie \\n[#COLUMNS] \{\
2682 .             ll \\n[#COL_L_LENGTH]u
2683 .             ta \\n(.lu
2684 .          \}
2685 .          el \{\
2686 .             ll \\n[#L_LENGTH]u
2687 .             ta \\n(.lu
2688 .          \}
2689 .       \}
2690 .    \}
2691 .    if '\\$1'CLEAR' \{\
2692 .       if \\n[#INDENT_STYLE_RIGHT] \{\
2693 .          ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2694 .          el \{\
2695 .             ie \\n[#COLUMNS] \{\
2696 .                ll \\n[#COL_L_LENGTH]u
2697 .                ta \\n(.lu
2698 .             \}
2699 .             el \{\
2700 .                ll \\n[#L_LENGTH]u
2701 .                ta \\n(.lu
2702 .             \}
2703 .          \}
2704 .       \}
2705 .       if \\n[#INDENT_STYLE_BOTH] \{\
2706 .          ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2707 .          el \{\
2708 .             ie \\n[#COLUMNS] \{\
2709 .                ll \\n[#COL_L_LENGTH]u
2710 .                ta \\n(.lu
2711 .             \}
2712 .             el \{\
2713 .                ll \\n[#L_LENGTH]u
2714 .                ta \\n(.lu
2715 .             \}
2716 .          \}
2717 .       \}
2718 .       rr #L_INDENT
2719 .       rr #R_INDENT
2720 .       rr #BL_INDENT
2721 .       rr #BR_INDENT
2722 .       rr #T_INDENT
2723 .       rr #H_INDENT
2724 .       rr #INDENT_STYLE_LEFT
2725 .       rr #INDENT_STYLE_RIGHT
2726 .       rr #INDENT_STYLE_BOTH
2727 .    \}
2728 .    rr #INDENT_ACTIVE
2729 .END
2731 \# =====================================================================
2733 \# +++MULTIPLE COLUMNS+++
2735 \# MULTIPLE COLUMNS ON
2736 \# -------------------
2737 \# *Arguments:
2738 \#   <none>
2739 \# *Function:
2740 \#   Marks the top of a column set
2742 .MAC MCO END
2743 .mk c
2744 .END
2746 \# MULTIPLE COLUMN RETURN
2747 \# ----------------------
2748 \# *Arguments:
2749 \#   <none>
2750 \# *Function:
2751 \#   Returns to the top of a column set
2753 .MAC MCR END
2754 .    sp |\\ncu
2755 .END
2757 \# MULTIPLE COLUMNS OFF
2758 \# --------------------
2759 \# *Arguments:
2760 \#   <none> | <lead to advance beneath bottom of deepest column>
2761 \# *Function:
2762 \#   Advances to the end of a column set
2763 \# *Notes:
2764 \#   With no argument, advances to the next baseline (at the current
2765 \#   leading value) beneath the longest column.  With an argument
2766 \#   (which requires a unit of measure), advances arg distance
2767 \#   beneath the baseline of the deepest column.  If the argument
2768 \#   is zero, advances to the baseline of the deepest column.
2770 .MAC MCX END
2771 .    ie '\\$1'' \{\
2772 .       TQ
2773 .       sp |\\n(.hu
2774 .    \}
2775 .    el \{\
2776 .       nr #MCX_ALD (\\$1)
2777 .       TQ
2778 .       ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
2779 .       el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
2780 .       rr #MCX_ALD (\\$1)
2781 .    \}
2782 .END
2784 \# =====================================================================
2786 \# +++TYPESETTING SUPPORT MACROS+++
2788 \# TRAP
2789 \# ----
2790 \# *Arguments:
2791 \#   toggle
2792 \# *Function:
2793 \#   Enables/disables traps.
2794 \# *Notes:
2795 \#   EL and TN don't function as advertised on the last line before
2796 \#   a trap (when they break the preceding line, they spring the
2797 \#   trap, and groff won't back up to the line preceding the trap).
2798 \#   TRAP is a kludge to get EL and TN work properly on last lines.
2799 \#   The user simply enloses the offending lines in TRAP OFF/TRAP.
2801 .MAC TRAP END
2802 .    ie '\\$1'' \{ .vpt 1 \}
2803 .    el \{ .vpt 0 \}
2804 .END
2807 \# SILENT
2808 \# ------
2809 \# *Arguments:
2810 \#   <none> | <anything>
2811 \# *Function:
2812 \#   Diverts text so that it doesn't print, or turns the function off.
2813 \# *Notes:
2814 \#   Useful for setting up autotabs where you don't want the line with
2815 \#   the tab marks to print.
2817 \#   Also aliased as COMMENT, in case user wants to input a batch of
2818 \#   text that doesn't print.
2820 .MAC SILENT END
2821 .    nr #SILENT 1
2822 .    if \\n[#QUAD] \{ .br \}
2823 .    ie '\\$1'' \{ .di NO_FLASH \}
2824 .    el \{\
2825 .       br
2826 .       di
2827 .       rm NO_FLASH
2828 .       rr #SILENT
2829 .    \}
2830 .END
2833 \# PRINT
2834 \# -----
2835 \# *Arguments:
2836 \#   <anything>
2837 \# *Function:
2838 \#   Prints anything.  A macro that helps keep my code nicely indented.
2840 .MAC PRINT END
2841 \\$*
2842 .END
2845 \# CAPS
2846 \# ----
2847 \# *Arguments:
2848 \#   <none> | <anything>
2849 \# *Function:
2850 \#   Converts text to caps, or, if OFF, reverts to normal caps/lc.
2852 .MAC CAPS END
2853 .    ie '\\$1'' \{\
2854 .       tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
2855 .       tr Ã \[`A]
2856 .       tr Ã¢\[^A]
2857 .       tr Ã¡\['A]
2858 .       tr Ã¤\[:A]
2859 .       tr Ã¥\[oA]
2860 .       tr Ã£\[~A]
2861 .       tr Ã¦\[AE]
2862 .       tr Ã¨\[`E]
2863 .       tr Ãª\[^E]
2864 .       tr Ã©\['E]
2865 .       tr Ã«\[:E]
2866 .       tr Ã¬\[`I]
2867 .       tr Ã®\[^I]
2868 .       tr Ã­\['I]
2869 .       tr Ã¯\[:I]
2870 .       tr Ã²\[`O]
2871 .       tr Ã´\[^O]
2872 .       tr Ã³\['O]
2873 .       tr Ã¶\[:O]
2874 .       tr Ãµ\[~O]
2875 .       tr Ã¸\[/O]
2876 .       tr Ã¹\[`U]
2877 .       tr Ã»\[^U]
2878 .       tr Ãº\['U]
2879 .       tr Ã¼\[:U]
2880 .       tr Ã§\[,C]
2881 .       tr Ã°\[-D]
2882 .       tr Ã±\[~N]
2883 .       tr Ã¾\[TP]
2884 .       tr Ã½\['Y]
2885 .       tr Ã¿\[:Y]
2886 .       nr #CAPS_ON 1
2887 .    \}
2888 .    el \{\
2889 .       tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
2890 .       tr Ã \[`a]
2891 .       tr Ã¢\[^a]
2892 .       tr Ã¡\['a]
2893 .       tr Ã¤\[:a]
2894 .       tr Ã¥\[oa]
2895 .       tr Ã£\[~a]
2896 .       tr Ã¦\[ae]
2897 .       tr Ã¨\[`e]
2898 .       tr Ãª\[^e]
2899 .       tr Ã©\['e]
2900 .       tr Ã«\[:e]
2901 .       tr Ã¬\[`i]
2902 .       tr Ã®\[^i]
2903 .       tr Ã­\['i]
2904 .       tr Ã¯\[:i]
2905 .       tr Ã²\[`o]
2906 .       tr Ã´\[^o]
2907 .       tr Ã³\['o]
2908 .       tr Ã¶\[:o]
2909 .       tr Ãµ\[~o]
2910 .       tr Ã¸\[/o]
2911 .       tr Ã¹\[`u]
2912 .       tr Ã»\[^u]
2913 .       tr Ãº\['u]
2914 .       tr Ã¼\[:u]
2915 .       tr Ã§\[,c]
2916 .       tr Ã°\[Sd]
2917 .       tr Ã±\[~n]
2918 .       tr Ã¾\[Tp]
2919 .       tr Ã½\['y]
2920 .       tr Ã¿\[:y]
2921 .       rr #CAPS_ON
2922 .    \}
2923 .END
2925 \# SIZESPECS
2926 \# ---------
2927 \# Argument:
2928 \#   <none>
2929 \# Function:
2930 \#   Gets cap-height, x-height, and descender depth of the
2931 \#   current font at the current point size.
2932 \# *Notes:
2933 \#   The routine is diverted so it remains invisible to output.
2935 .MAC SIZESPECS END
2936 .    di TYPESIZE
2937 E\\R'#CAP_HEIGHT \\n[.cht]'
2938 e\\R'#X_HEIGHT \\n[.cht]'
2939 y\\R'#DESCENDER \\n[.cdp]'
2940 .    br
2941 .    di
2942 .END
2944 \# =====================================================================
2946 \# +++TYPESETTING ALIASES+++
2948 .ALIAS    CENTRE          CENTER
2949 .ALIAS    COMMENT         SILENT
2950 .ALIAS    CONDENSE        CONDENSE_OR_EXTEND
2951 .ALIAS    EXTEND          CONDENSE_OR_EXTEND
2952 .ALIAS    FAM             FAMILY
2953 .ALIAS    HYPHENATE       HY
2954 .ALIAS    HYPHENATION     HY
2955 .ALIAS    HYSET           HY_SET
2956 .ALIAS    LIG             LIGATURES
2957 .ALIAS    IBQ             IBX
2958 .ALIAS    ILQ             ILX
2959 .ALIAS    IQ              IX
2960 .ALIAS    IRQ             IRX
2961 .ALIAS    PADMARKER       PAD_MARKER
2962 .ALIAS    TABSET          TAB_SET
2963 .ALIAS    TB              TAB
2964 .ALIAS    UNDERSCORE_2    UNDERSCORE2
2967 \# ====================================================================
2969 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
2970 \# ===============================================
2972 \# +++PAGE DIMENSIONS+++
2974 \# PAPER SIZE
2975 \# ----------
2976 \# *Arguments:
2977 \#   LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
2978 \# *Function:
2979 \#   Sets up margins for different paper sizes.
2981 .MAC PAPER END
2982 .    ds $PAPER \\$1
2983 .    if '\\*[$PAPER]'LETTER' \{\
2984 .       PAGEWIDTH  8.5i
2985 .       PAGELENGTH 11i
2986 .    \}
2987 .    if '\\*[$PAPER]'LEGAL' \{\
2988 .       PAGEWIDTH  8.5i
2989 .       PAGELENGTH 14i
2990 .    \}
2991 .    if '\\*[$PAPER]'STATEMENT' \{\
2992 .       PAGEWIDTH  5.5i
2993 .       PAGELENGTH 8.5i
2994 .    \}
2995 .    if '\\*[$PAPER]'TABLOID' \{\
2996 .       PAGEWIDTH  11i
2997 .       PAGELENGTH 17i
2998 .    \}
2999 .    if '\\*[$PAPER]'LEDGER' \{\
3000 .       PAGEWIDTH  17i
3001 .       PAGELENGTH 11i
3002 .    \}
3003 .    if '\\*[$PAPER]'FOLIO' \{\
3004 .       PAGEWIDTH  8.5i
3005 .       PAGELENGTH 13i
3006 .    \}
3007 .    if '\\*[$PAPER]'QUARTO' \{\
3008 .       PAGEWIDTH  610p
3009 .       PAGELENGTH 780p
3010 .    \}
3011 .    if '\\*[$PAPER]'10x14' \{\
3012 .       PAGEWIDTH  10i
3013 .       PAGELENGTH 14i
3014 .    \}
3015 .    if '\\*[$PAPER]'EXECUTIVE' \{\
3016 .       PAGEWIDTH  7.25i
3017 .       PAGELENGTH 10.5i
3018 .    \}
3019 .    if '\\*[$PAPER]'A3' \{\
3020 .       PAGEWIDTH  842p
3021 .       PAGELENGTH 1190p
3022 .    \}
3023 .    if '\\*[$PAPER]'A4' \{\
3024 .       PAGEWIDTH  595p
3025 .       PAGELENGTH 842p
3026 .    \}
3027 .    if '\\*[$PAPER]'A5' \{\
3028 .       PAGEWIDTH  421p
3029 .       PAGELENGTH 595p
3030 .    \}
3031 .    if '\\*[$PAPER]'B4' \{\
3032 .       PAGEWIDTH  709p
3033 .       PAGELENGTH 1002p
3034 .    \}
3035 .    if '\\*[$PAPER]'B5' \{\
3036 .       PAGEWIDTH  501p
3037 .       PAGELENGTH 709p
3038 .    \}
3039 .    if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
3040 .    if !r#R_MARGIN \{ .R_MARGIN 1i \}
3041 .END
3044 \# ====================================================================
3046 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
3048 \# PRINTSTYLE
3049 \# ----------
3050 \# *Arguments:
3051 \#   TYPESET | TYPEWRITE [SINGLESPACE]
3052 \# *Function:
3053 \#   Sets type specs for typewriter-style or typeset output.
3054 \# *Notes:
3055 \#   Number registers: TYPEWRITE=1, TYPESET=2.
3057 .MAC PRINTSTYLE END
3058 .    if !d$PAPER \{ .PAPER LETTER \}
3059 .    if '\\$1'TYPEWRITE' \{\
3060 .       nr #PRINT_STYLE 1
3061 .       if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3062 .       if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3063 .       fam  C
3064 .       ft   R
3065 .       ps   12
3066 .       ie '\\$2'SINGLESPACE' \{\
3067 .           nr #SINGLE_SPACE 1
3068 .           vs 12
3069 .       \}
3070 .       el \{ .vs 24 \}
3071 .       QUAD    L
3072 .       HY      OFF
3073 .       SMARTQUOTES OFF
3074 .       if !\\n[#PP_INDENT] \{\
3075 .          in 3P                 \"Set indent
3076 .          nr #PP_INDENT \\n(.i  \"Read into #PP_INDENT
3077 .          in 0                  \"Remove indent
3078 .       \}
3079 .       HDRFTR_RIGHT_CAPS
3080 .       nr #BOLDER_UNITS 0
3081 .       nr #CONDENSE 0
3082 .       nr #EXTEND 0
3083 .       rm IT
3084 .       rm BD
3085 .       rm BDI
3086 .       rm PREV
3087 .       UNDERLINE_SLANT
3088 .       UNDERLINE_ITALIC
3089 .       UNDERLINE_QUOTES
3090 .       nr #IGNORE_COLUMNS 1
3091 .       char \(em --
3092 .    \}
3093 .    if '\\$1'TYPESET' \{\
3094 .       nr #PRINT_STYLE 2
3095 .       if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3096 .       if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3097 .       FAMILY  T
3098 .       FT      R
3099 .       if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
3100 .       if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
3101 .       JUSTIFY
3102 .       HY
3103 .       HY_SET 2 36p 1p
3104 .       KERN
3105 .       LIG
3106 .       SS 0
3107 .       SMARTQUOTES
3108 .       if !\\n[#PP_INDENT] \{\
3109 .          in 2m                 \"Set indent
3110 .          nr #PP_INDENT \\n(.i  \"Read into #PP_INDENT
3111 .          in 0                  \"Remove indent
3112 .       \}
3113 .       HDRFTR_RIGHT_CAPS
3114 .       rr #IGNORE_COLUMNS
3115 .    \}
3116 .END
3119 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
3121 \# ITALIC MEANS ITALIC
3122 \# -------------------
3123 \# *Argument:
3124 \#   <none>
3125 \# *Function:
3126 \#   Instructs TYPEWRITE to treat italics as italics, whether
3127 \#   invoked via control lines or inline.
3128 \# *Notes:
3129 \#   ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
3130 \#   hence invoking the one automatically turns off the other.
3132 .MAC ITALIC_MEANS_ITALIC END
3133 .    if \\n[#PRINT_STYLE]=1 \{\
3134 .       nr #ITALIC_MEANS_ITALIC 1
3135 .       rr #UNDERLINE_ITALIC
3136 .       rm ROM
3137 .       rm IT
3138 .       rm PREV
3139 .       ds ROM  \EfR
3140 .       ds IT   \EfI
3141 .       ds PREV \EfR
3142 .    \}
3143 .END
3146 \# UNDERLINE ITALIC
3147 \# ----------------
3148 \# *Argument:
3149 \#   <none>
3150 \# *Function:
3151 \#   Instructs TYPEWRITE to underline italics, whether invoked
3152 \#   via control lines or inline.
3153 \# *Notes:
3154 \#   UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
3155 \#   hence invoking the one automatically turns off the other.
3157 \#   UNDERLINE_ITALIC is the default for TYPEWRITE.
3159 .MAC UNDERLINE_ITALIC END
3160 .    if \\n[#PRINT_STYLE]=1 \{\
3161 .       nr #UNDERLINE_ITALIC 1
3162 .       rr #ITALIC_MEANS_ITALIC
3163 .       rm ROM
3164 .       rm IT
3165 .       rm PREV
3166 .       ds ROM  \E*[ULX]
3167 .       ds IT   \E*[UL]
3168 .       ds PREV \E*[ULX]
3169 .    \}
3170 .END
3173 \# UNDERLINE SLANT
3174 \# ---------------
3175 \# *Arguments:
3176 \#   <none> | <anything>
3177 \# *Function:
3178 \#   Instructs TYPEWRITE to underline occurences of \*[SLANT], or
3179 \#   turns feature off.
3180 \# *Notes:
3181 \#   Users may want \*[SLANT] to mean slant in TYPEWRITE, although
3182 \#   most of the time, \*[SLANT] most likely means the user wanted
3183 \#   italic but didn't have it, ergo the need to tell TYPEWRITE to
3184 \#   treat \*[SLANT] as italic (i.e. underlined).
3186 \#   UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
3187 \#   hence invoking the one automatically turns off the other.
3189 \#   UNDERLINE_SLANT is the default for TYPEWRITE.
3191 .MAC UNDERLINE_SLANT END
3192 .    if \\n[#PRINT_STYLE]=1 \{\
3193 .       rr #SLANT_MEANS_SLANT
3194 .       nr #UNDERLINE_SLANT 1
3195 .       rm SLANT
3196 .       rm SLANTX
3197 .       ds SLANT  \ER'#SLANT_ON 1'\E*[UL]
3198 .       ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
3199 .    \}
3200 .END
3203 .MAC SLANT_MEANS_SLANT END
3204 .    if \\n[#PRINT_STYLE]=1 \{\
3205 .       rr #UNDERLINE_SLANT
3206 .       nr #SLANT_MEANS_SLANT 1
3207 .       rm SLANT
3208 .       rm SLANTX
3209 .       ds SLANT  \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
3210 .       ds SLANTX \ER'#SLANT_ON 0'\ES'0'
3211 .    \}
3212 .END
3215 .MAC IGNORE_COLUMNS END
3216 .    if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
3217 .END
3220 \# ====================================================================
3222 \# +++COPY STYLE -- DRAFT OR FINAL+++
3224 \# COPY STYLE
3225 \# ----------
3226 \# *Arguments:
3227 \#   DRAFT | FINAL
3228 \# *Function:
3229 \#   Sets registers that are used to determine what to put
3230 \#   in the default header, and how to number pages.
3231 \# *Notes:
3232 \#   DOCTYPE must come before COPYSTYLE.
3234 .MAC COPYSTYLE END
3235 .    ds $COPY_STYLE \\$1
3236 .    if '\\*[$COPY_STYLE]'DRAFT' \{\
3237 .       nr #COPY_STYLE 1
3238 .       if !r#DRAFT \{ .DRAFT 1 \}
3239 .    \}
3240 .    if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2         \}
3241 .    if !d$CHAPTER_STRING        \{ .CHAPTER_STRING "Chapter" \}
3242 .    if !d$DRAFT_STRING          \{ .DRAFT_STRING "Draft"     \}
3243 .    if !d$REVISION_STRING       \{ .REVISION_STRING "Rev."   \}
3244 \# Default
3245 .    if \\n[#DOC_TYPE]=1 \{\
3246 .       ie \\n[#COPY_STYLE]=1 \{\
3247 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3248 .          el \{ .PAGENUM_STYLE roman \}
3249 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3250 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
3251 .                ds $HDRFTR_CENTER
3252 .             \}
3253 .             el \{\
3254 .                ie !\\n[#REVISION] \{\
3255 .                   ds $HDRFTR_CENTER \
3256                     \\*[$DRAFT_STRING] \\n[#DRAFT]
3257 .                \}
3258 .                el \{\
3259 .                   ds $HDRFTR_CENTER \
3260                     \\*[$DRAFT_STRING] \\n[#DRAFT], \
3261                     \\*[$REVISION_STRING] \\n[#REVISION]
3262 .                \}
3263 .             \}
3264 .          \}
3265 .       \}
3266 .       el \{\
3267 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3268 .          el \{ .PAGENUM_STYLE DIGIT \}
3269 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3270 .             ds $HDRFTR_CENTER
3271 .             rr #USER_DEF_HDRFTR_CENTER
3272 .          \}
3273 .       \}
3274 .    \}
3275 \# Chapter
3276 .    if \\n[#DOC_TYPE]=2 \{\
3277 \# Copystyle DRAFT
3278 .       ie \\n[#COPY_STYLE]=1 \{\
3279 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3280 .          el \{ .PAGENUM_STYLE roman \}
3281 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3282 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
3283 .                ie '\\*[$CHAPTER]'' \{\
3284 .                   ie !'\\*[$CHAPTER_TITLE]'' \{\
3285 .                      ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3286 .                   \}
3287 .                   el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \}
3288 .                \}
3289 .                el \{\
3290 .                   ie !'\\*[$CHAPTER_TITLE]'' \{\
3291 .                      ds \\*[$CHAPTER_TITLE]
3292 .                   \}
3293 .                   el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3294 .                \}
3295 .             \}
3296 .             el \{\
3297 .                ie !\\n[#REVISION] \{\
3298 .                   ie '\\*[$CHAPTER]'' \{\
3299 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3300 .                         ds $HDRFTR_CENTER \
3301                           \\*[$CHAPTER_TITLE], \
3302                           \\*[$DRAFT_STRING] \\n[#DRAFT]
3303 .                      \}
3304 .                      el \{\
3305 .                         ds $HDRFTR_CENTER \
3306                           \\*[$CHAPTER_STRING], \
3307                           \\*[$DRAFT_STRING] \\n[#DRAFT]
3308 .                      \}
3309 .                   \}
3310 .                   el \{\
3311 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3312 .                         ds $HDRFTR_CENTER \
3313                           \\*[$CHAPTER_TITLE], \
3314                           \\*[$DRAFT_STRING] \\n[#DRAFT]
3315 .                      \}
3316 .                      el \{\
3317 .                         ds $HDRFTR_CENTER \
3318                           \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3319                           \\*[$DRAFT_STRING] \\n[#DRAFT]
3320 .                      \}
3321 .                   \}
3322 .                \}
3323 .                el \{\
3324 .                   ie '\\*[$CHAPTER]'' \{\
3325 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3326 .                         ds $HDRFTR_CENTER \
3327                           \\*[$CHAPTER_TITLE], \
3328                           \\*[$DRAFT_STRING] \\n[#DRAFT], \
3329                           \\*[$REVISION_STRING] \\n[#REVISION] 
3330 .                      \}
3331 .                      el \{\
3332 .                         ds $HDRFTR_CENTER \
3333                           \\*[$CHAPTER_STRING], \
3334                           \\*[$DRAFT_STRING] \\n[#DRAFT], \
3335                           \\*[$REVISION_STRING] \\n[#REVISION] 
3336 .                      \}
3337 .                   \}
3338 .                   el \{\
3339 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3340 .                         ds $HDRFTR_CENTER \
3341                           \\*[$CHAPTER_TITLE], \
3342                           \\*[$DRAFT_STRING] \\n[#DRAFT], \
3343                           \\*[$REVISION_STRING] \\n[#REVISION] 
3344 .                      \}
3345 .                      el \{\
3346 .                         ds $HDRFTR_CENTER \
3347                           \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3348                           \\*[$DRAFT_STRING] \\n[#DRAFT], \
3349                           \\*[$REVISION_STRING] \\n[#REVISION] 
3350 .                      \}
3351 .                   \}
3352 .                \}
3353 .             \}
3354 .          \}
3355 .       \}
3356 \# Copystyle FINAL
3357 .       el \{\
3358 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3359 .             ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3360 .             el \{ .PAGENUM_STYLE DIGIT \}
3361 .             ie '\\*[$CHAPTER]'' \{\
3362 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
3363 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3364 .                \}
3365 .                el \{\
3366 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
3367 .                \}
3368 .             \}
3369 .             el \{\
3370 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
3371 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3372 .                \}
3373 .                el \{\
3374 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3375 .                \}
3376 .             \}
3377 .          \}
3378 .       \}
3379 .    \}
3380 \# Named
3381 .    if \\n[#DOC_TYPE]=3 \{\
3382 .       ie \\n[#COPY_STYLE]=1 \{\
3383 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3384 .          el \{ .PAGENUM_STYLE roman \}
3385 .          ie \\n[#DRAFT_WITH_PAGENUM] \{\
3386 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3387 .          \}
3388 .          el \{\
3389 .             if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3390 .                ie !\\n[#REVISION] \{\
3391 .                   ds $HDRFTR_CENTER \
3392                     \\*[$DOC_TYPE], \
3393                     \\*[$DRAFT_STRING] \\n[#DRAFT]
3394 .                \}
3395 .                el \{\
3396 .                   ds $HDRFTR_CENTER \
3397                     \\*[$DOC_TYPE], \
3398                     \\*[$DRAFT_STRING] \\n[#DRAFT], \
3399                     \\*[$REVISION_STRING] \\n[#REVISION]
3400 .                \}
3401 .             \}
3402 .          \}
3403 .       \}
3404 .       el \{\
3405 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3406 .             ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3407 .             el \{ .PAGENUM_STYLE DIGIT \}
3408 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3409 .          \}
3410 .       \}
3411 .    \}
3412 .END
3414 \# ====================================================================
3416 \# +++COLLECT DOC INFO -- STRINGS AND NUMBER REGISTERS+++
3418 \# *Arguments:
3419 \#   various string/register arguments
3420 \# *Function:
3421 \#   Collect information about documents.
3424 .MAC DOC_TITLE END
3425 .    ds $DOC_TITLE \\$1
3426 .END
3428 .MAC TITLE END \"Document title
3429 .    ds $TITLE \\$1
3430 .END
3433 .MAC SUBTITLE END \"Document sub-title
3434 .    ds $SUBTITLE \\$1
3435 .END
3438 .MAC CHAPTER END \"If document is a chapter, the chapter number
3439 .    ds $CHAPTER \\$1
3440 .END
3443 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
3444 .    ds $CHAPTER_TITLE \\$1
3445 .END
3448 .MAC DRAFT END \"Draft number
3449 .    nr #DRAFT \\$1
3450 .END
3453 .MAC REVISION END \"Revision number
3454 .    nr #REVISION \\$1
3455 .END
3458 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
3459 .    nr #DRAFT_WITH_PAGENUM 1
3460 .END
3463 .MAC AUTHOR END \"Author.  Enclose all args fully in double quotes.
3464 .    nr #AUTHOR_NUM -1 1
3465 .    while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
3466 .       ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
3467 .    \}
3468 .    nr #NUM_AUTHORS \\n[#NUM_ARGS]%2 \"Use mod 2 to test if odd or even # of authors
3469 .    ie \\n[#NUM_AUTHORS]=1 \{ .nr #AUTHOR_LINES 0  \}
3470 .    el \{ .nr #AUTHOR_LINES 1 \}
3471 .END
3474 .MAC PAGENUMBER END \"Page # that appears on page one.
3475 .    nr #n%_AT_PAGENUM_SET \\n%
3476 .    nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
3477 .    rr #n%_AT_PAGENUM_SET
3478 .    nr #PAGE_NUM_SET 1
3479 .END
3481 \# ====================================================================
3483 \# +++TYPE OF DOCUMENT+++
3485 \# DOCUMENT TYPE
3486 \# -------------
3487 \# *Argument:
3488 \#   DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
3489 \# *Function:
3490 \#   Creates strings and sets registers for document types.
3491 \# *Notes:
3492 \#   Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
3494 .MAC DOCTYPE END
3495 .    if '\\$1'DEFAULT' \{\
3496 .       nr #DOC_TYPE 1
3497 .    \}
3498 .    if '\\$1'CHAPTER' \{\
3499 .       nr #DOC_TYPE 2
3500 .    \}
3501 .    if '\\$1'NAMED' \{\
3502 .       ds $DOC_TYPE \\$2
3503 .       nr #DOC_TYPE 3
3504 .    \}
3505 .    if '\\$1'LETTER' \{\
3506 .       nr #DOC_TYPE 4
3507 .       L_MARGIN 1.125i
3508 .       R_MARGIN 1.125i
3509 .       PT_SIZE 12
3510 .       LS 13.5
3511 .       DOCHEADER OFF
3512 .       PARA_INDENT 3m
3513 .       INDENT_FIRST_PARAS
3514 .       PARA_SPACE
3515 .       ds $SUITE \En[#SUITE]
3516 .       HEADER_MARGIN 3P+6p
3517 .       HEADER_GAP 3P
3518 .       FOOTERS
3519 .       FOOTER_RULE OFF
3520 .       FOOTER_LEFT ""
3521 .       FOOTER_CENTER ""
3522 .       FOOTER_RIGHT_SIZE +0
3523 .       FOOTER_RIGHT ".../\E*[$SUITE]
3524 .       FOOTER_ON_FIRST_PAGE
3525 .       em ALL_DONE
3526 .    \}
3527 .END
3529 \# +++LETTER MACROS+++
3531 \# DATE
3532 \# ----
3533 \# *Arguments:
3534 \#   <date string>
3535 \# *Function:
3536 \#   Stores date string in string $DATE.
3538 .MAC DATE END
3539 .    nr #DATE 1
3540 .    di DATE
3541 .    RIGHT
3542 .END
3545 \# TO
3546 \# --
3547 \# *Arguments:
3548 \#   <none>
3549 \# *Function:
3550 \#  Stores "to" info in diversion TO_ADDRESS.
3552 .MAC TO END
3553 .    if !'\\n(.z'' \{ .di \}
3554 .    nr #TO 1
3555 .    di TO_ADDRESS
3556 .    LEFT
3557 .END
3560 \# FROM
3561 \# ----
3562 \# *Arguments:
3563 \#   <none>
3564 \# *Function:
3565 \#  Stores "from" info in diversion FROM_ADDRESS.
3567 .MAC FROM END
3568 .    if !'\\n(.z'' \{ .di \}
3569 .    nr #FROM 1
3570 .    di FROM_ADDRESS
3571 .    LEFT
3572 .END
3575 \# GREETING
3576 \# --------
3577 \# *Arguments:
3578 \#   <greeting string>
3579 \# *Function:
3580 \#   Stores greeting in string $GREETING.
3582 .MAC GREETING END
3583 .    if !'\\n(.z'' \{ .di \}
3584 .    nr #GREETING 1
3585 .    di GREETING
3586 .    LEFT
3587 .END
3590 \# CLOSING
3591 \# -------
3592 \# *Arguments:
3593 \#   <closing string>
3594 \# *Function:
3595 \#   Stores greeting in string $CLOSING.
3597 .MAC CLOSING END
3598 .    br
3599 .    nr #CLOSING 1
3600 .    di CLOSING
3601 .    LEFT
3602 .END
3605 \# NO SUITE
3606 \# --------
3607 \# *Arguments:
3608 \#   <none>
3609 \# *Function:
3610 \#   Redefines $SUITE to blank so that a suite number doesn't
3611 \#   appear at the bottom of letter pages.
3613 .MAC NO_SUITE END
3614 .    FOOTER_RIGHT ""
3615 .END
3617 \# ====================================================================
3619 \# +++DEFAULTS+++
3621 \# DEFAULTS
3622 \# --------
3623 \# *Arguments:
3624 \#   <none>
3625 \# *Function:
3626 \#   Sets up defaults if no values are entered prior to START.
3627 \# *Notes:
3628 \#   The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
3629 \#   $REVISION_STRING are in the COPYSTYLE macro.
3631 .MAC DEFAULTS END
3632 .    if !d$PAPER \{ .PAPER LETTER \}
3633 .    if !\\n[#DOC_TYPE]   \{ .DOCTYPE DEFAULT \}
3634 .    ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3635 .    el \{\
3636 .       if !\\n[#COPY_STYLE]=1 \{ .PAGENUM_STYLE DIGIT \}
3637 .    \}
3638 .    if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
3639 .    if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
3640 .    if \\n[#DOC_TYPE]=4 \{\
3641 .       if !\\n[#USER_SET_L_LENGTH] \{\
3642 .          R_MARGIN \\n[#R_MARGIN]u
3643 .          rr #USER_SET_L_LENGTH
3644 .       \}
3645 .       if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
3646 .    \}
3647 .    if \\n[#COPY_STYLE]=1 \{\
3648 .       COPYSTYLE DRAFT
3649 .       PAGENUMBER 1
3650 .    \}
3651 .    if !r#DOC_HEADER \{ .DOCHEADER  \}
3652 .    if !r#HEADERS_ON \{ .HEADERS    \}
3653 .    if !r#PAGINATE   \{ .PAGINATE   \}
3654 .    if \\n[#FOOTERS_ON] \{\
3655 .       HEADERS OFF
3656 .       if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
3657 .    \}
3658 .    if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
3659 .    if !r#HEADER_GAP    \{ .HEADER_GAP    3P    \}
3660 .    if \\n[#FOOTERS_ON] \{\
3661 .       if \\n[#PAGINATE]=0 \{\
3662 .          if !r#T_MARGIN \{ .T_MARGIN 6P \}
3663 .       \}
3664 .    \}
3665 .    if \\n[#HEADERS_ON]=0    \{\
3666 .       if \\n[#FOOTERS_ON]=0 \{\
3667 .          if !r#T_MARGIN \{ .T_MARGIN 6P \}
3668 .       \}
3669 .    \}
3670 .    if !r#T_MARGIN          \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
3671 .    if !r#DOCHEADER_ADVANCE \{ .DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
3672 .    if !r#FOOTER_MARGIN     \{ .FOOTER_MARGIN 3P \}
3673 .    if !r#FOOTER_GAP        \{ .FOOTER_GAP    3P \}
3674 .    if !r#B_MARGIN          \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
3675 .    if (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
3676 .       tm1 "[mom]: Your chosen bottom margin for running text is too close to the footer margin.
3677 .       tm1 "       No footers or bottom-of-page page numbers will be printed.
3678 .       tm1 "       Please reset B_MARGIN or FOOTER_MARGIN to allow enough space.
3679 .       tm1 "       If no footers or bottom-of-page page numbers are required,
3680 .       tm1 "       place .FOOTER_MARGIN 0 before .START
3681 .    \}
3682 .    if !r#HDRFTR_RULE_GAP   \{\
3683 .       if \\n[#HEADERS_ON]  \{ .HDRFTR_RULE_GAP 4p \}
3684 .       if \\n[#FOOTERS_ON]  \{ .HDRFTR_RULE_GAP 4p \}
3685 .    \}
3686 .    if !r#HDRFTR_RULE       \{ .HDRFTR_RULE        \}
3687 .    if !r#PAGE_NUM_SET      \{ .PAGENUMBER 1       \}
3688 .    ie r#ADJ_DOC_LEAD \{ . \}
3689 .    el \{ .DOC_LEAD_ADJUST \}
3690 \# Read in number registers and strings for type parameters
3691 .    nr #DOC_L_MARGIN \\n[#L_MARGIN]
3692 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
3693 .    nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
3694 .    ds $DOC_FAM      \\*[$FAMILY]
3695 .    nr #DOC_PT_SIZE  \\n[#PT_SIZE]
3696 .    nr #DOC_LEAD     \\n[#LEAD]
3697 .    ds $DOC_QUAD     \\*[$QUAD_VALUE]
3698 .    ds $PP_FT        \\*[$FONT]
3699 \# Counters
3700 .    nr #PP 0
3701 .    nr #FN_NUMBER 0 1
3702 .    nr #EN_NUMBER 0 1
3703 .    nr #FN_COUNT_FOR_COLS 0 1
3704 .    RESET_HEAD_NUMBER
3705 .    RESET_SUBHEAD_NUMBER
3706 .    RESET_PARAHEAD_NUMBER
3707 \# General style defaults for both PRINTSTYLEs
3708 .    nr #PP_STYLE 1
3709 .    PARA_INDENT \\n[#PP_INDENT]u
3710 .    if !d$HDRFTR_FAM           \{ .HDRFTR_FAMILY  \\*[$DOC_FAM] \}
3711 .    if !d$HDRFTR_SIZE_CHANGE   \{ .HDRFTR_SIZE    +0            \}
3712 .    if !d$PAGE_NUM_FAM         \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
3713 .    if !d$PAGE_NUM_FT          \{ .PAGENUM_FONT   R             \}
3714 .    if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE   +0            \}
3715 .    if !r#PAGE_NUM_POS_SET     \{ .PAGENUM_POS BOTTOM CENTER    \}
3716 .    ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
3717 .       if \\n[#PAGE_NUM_HYPHENS]=0  \{ .PAGENUM_HYPHENS OFF \}
3718 .       if \\n[#PAGE_NUM_HYPHENS]=1  \{ .PAGENUM_HYPHENS     \}
3719 .    \}
3720 .    el \{ .PAGENUM_HYPHENS \}
3721 .    if !d$HEAD_QUAD         \{ .HEAD_QUAD CENTER  \}
3722 .    if !r#HEAD_CAPS         \{ .HEAD_CAPS         \}
3723 .    if !r#HEAD_UNDERLINE    \{ .HEAD_UNDERLINE    \}
3724 .    if !d$SH_QUAD           \{ .SUBHEAD_QUAD LEFT \}
3725 .    if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
3726 .    if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
3727 .       if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
3728 .    \}
3729 .    if !d$FN_FAM          \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
3730 .    if !d$FN_FT           \{ .FOOTNOTE_FONT R               \}
3731 .    if !d$FN_QUAD         \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD]  \}
3732 .    if !r#FN_RULE         \{ .FOOTNOTE_RULE                 \}
3733 .    if !r#FN_MARKERS      \{ .FOOTNOTE_MARKERS              \}
3734 .    if !r#FN_MARKER_STYLE \{ .FOOTNOTE_MARKER_STYLE STAR    \}
3735 .    if !d$EN_PN_STYLE          \{ .ENDNOTES_PAGENUM_STYLE digit        \}
3736 .    if !d$EN_FAM               \{ .ENDNOTE_FAMILY \\*[$DOC_FAM]        \}
3737 .    if !d$EN_FN                \{ .ENDNOTE_FONT R                      \}
3738 .    if !d$EN_QUAD              \{ .ENDNOTE_QUAD \\*[$DOC_QUAD]         \}
3739 .    if !d$EN_STRING            \{ .ENDNOTE_STRING "Endnotes"           \}
3740 .    if !d$EN_STRING_FAM        \{ .ENDNOTE_STRING_FAMILY \\*[$EN_FAM]  \}
3741 .    if !d$EN_STRING_QUAD       \{ .ENDNOTE_STRING_QUAD CENTER          \}
3742 .    if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2         \}
3743 .    if !r#EN_STRING_CAPS       \{ .ENDNOTE_STRING_CAPS                 \}
3744 .    if !d$EN_TITLE \{\
3745 .       ie \\n[#DOC_TYPE]=2 \{\
3746 .          ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
3747 .          el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"    \}
3748 .       \}
3749 .       el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
3750 .    \}
3751 .    if !d$EN_TITLE_FAM          \{ .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM]  \}
3752 .    if !d$EN_TITLE_QUAD         \{ .ENDNOTE_TITLE_QUAD LEFT            \}
3753 .    if !r#EN_TITLE_UNDERSCORE   \{ .ENDNOTE_TITLE_UNDERSCORE           \}
3754 .    if !d$EN_NUMBER_FAM         \{ .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] \}
3755 .    if !r#EN_NUMBERS_ALIGN_LEFT  \{\
3756 .       if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2  \}
3757 .    \}
3758 .    if !d$TOC_HEADER_STRING         \{ .TOC_HEADER_STRING "Contents"  \}
3759 .    if !d$TOC_HEADER_QUAD           \{ .TOC_HEADER_QUAD LEFT          \}
3760 .    if !d$TOC_PN_STYLE              \{ .TOC_PAGENUM_STYLE roman       \}
3761 .    if !r#TOC_PN_PADDING            \{ .TOC_PADDING   3               \}
3762 .    if !r#TOC_TITLE_INDENT          \{ .TOC_TITLE_INDENT    0         \}
3763 .    if !r#TOC_HEAD_INDENT           \{ .TOC_HEAD_INDENT     18p       \}
3764 .    if !r#TOC_SH_INDENT             \{ .TOC_SUBHEAD_INDENT  30p       \}
3765 .    if !r#TOC_PH_INDENT             \{ .TOC_PARAHEAD_INDENT 42p       \}
3766 \# String defaults for both PRINTSTYLEs
3767 .    ie \\n[#DOC_TYPE]=1 \{\
3768 .       ie '\\*[$DOC_TITLE]'' \{\
3769 .          if \\n[#USER_DEF_HDRFTR_LEFT]=0   \{ .ds $HDRFTR_LEFT  \\*[$AUTHOR_1]  \}
3770 .          rr #USER_DEF_HDRFTR_LEFT
3771 .          if \\n[#USER_DEF_HDRFTR_RIGHT]=0  \{ .ds $HDRFTR_RIGHT \\*[$TITLE]     \}
3772 .          rr #USER_DEF_HDRFTR_RIGHT
3773 .       \}
3774 .       el \{\
3775 .          if \\n[#COPY_STYLE]=1 \{ .DRAFT_WITH_PAGENUMBER \}
3776 .          if \\n[#USER_DEF_HDRFTR_LEFT]=0   \{ .ds $HDRFTR_LEFT  \\*[$AUTHOR_1]  \}
3777 .          rr #USER_DEF_HDRFTR_LEFT
3778 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{ .ds $HDRFTR_CENTER \\*[$TITLE]    \}
3779 .          rr #USER_DEF_HDRFTR_CENTER
3780 .          if \\n[#USER_DEF_HDRFTR_RIGHT]=0  \{ .ds $HDRFTR_RIGHT \\*[$DOC_TITLE] \}
3781 .          rr #USER_DEF_HDRFTR_RIGHT
3782 .       \}
3783 .    \}
3784 .    el \{\
3785 .       if \\n[#USER_DEF_HDRFTR_LEFT]=0   \{ .ds $HDRFTR_LEFT  \\*[$AUTHOR_1]  \}
3786 .       rr #USER_DEF_HDRFTR_LEFT
3787 .       if \\n[#USER_DEF_HDRFTR_RIGHT]=0  \{ .ds $HDRFTR_RIGHT \\*[$TITLE]     \}
3788 .       rr #USER_DEF_HDRFTR_RIGHT
3789 .    \}
3790 .    if !d$ATTRIBUTE_STRING           \{ .ATTRIBUTE_STRING "by"            \}
3791 .    if !d$FINIS_STRING               \{ .FINIS_STRING "END"               \}
3792 \# Defaults for printstyle TYPEWRITE
3793 .    if \\n[#PRINT_STYLE]=1 \{\
3794 .       if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES         \}
3795 .       if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF     \}
3796 .       if !r#Q_OFFSET_VALUE        \{ .QUOTE_INDENT      2      \}
3797 .       if !r#EPI_OFFSET_VALUE      \{ .EPIGRAPH_INDENT   2      \}
3798 .       if !d$LINEBREAK_CHAR        \{ .LINEBREAK_CHAR    * 3 2p \}
3799 .       if !d$FN_SIZE_CHANGE        \{ .FOOTNOTE_SIZE     +0     \}
3800 .       if !r#FN_RULE_LENGTH        \{ .FOOTNOTE_RULE_LENGTH 2i  \}
3801 .       if !r#FN_RULE_ADJ           \{ .FOOTNOTE_RULE_ADJ  6p    \}
3802 .       if !r#SLANT_MEANS_SLANT \{\
3803 .          ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
3804 .          el \{ .UNDERLINE_SLANT OFF \}
3805 .       \}
3806 .       if !r#PH_INDENT    \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3807 .       if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
3808 .    \}
3809 \# Defaults for printstyle TYPESET
3810 .    if \\n[#PRINT_STYLE]=2 \{\
3811 .       if !d$DOCHEADER_LEAD_ADJ \{\
3812 .          ie !'\\*[$CHAPTER_TITLE]'' \{\
3813 .             ie !'\\*[$CHAPTER_STRING]'' \{\
3814 .                DOCHEADER_LEAD +4
3815 .             \}
3816 .             el \{ .DOCHEADER_LEAD +0 \}
3817 .          \}
3818 .          el \{ .DOCHEADER_LEAD +0 \}
3819 .       \}
3820 .       if !d$TITLE_FAM     \{ .TITLE_FAMILY   \\*[$DOC_FAM] \}
3821 .       if !d$TITLE_FT      \{ .TITLE_FONT     B             \}
3822 .       if !d$TITLE_SIZE_CHANGE \{\
3823 .          ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
3824 .          el \{ .TITLE_SIZE +3.5 \}
3825 .       \}
3826 .       if !d$CHAPTER_TITLE_FAM         \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
3827 .       if !d$CHAPTER_TITLE_FT          \{ .CHAPTER_TITLE_FONT   BI            \}
3828 .       if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE  +4             \}
3829 .       if !d$SUBTITLE_FAM         \{ .SUBTITLE_FAMILY    \\*[$DOC_FAM] \}
3830 .       if !d$SUBTITLE_FT          \{ .SUBTITLE_FONT      R             \}
3831 .       if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE      +0            \}
3832 .       if !d$AUTHOR_FAM           \{ .AUTHOR_FAMILY      \\*[$DOC_FAM] \}
3833 .       if !d$AUTHOR_FT            \{ .AUTHOR_FONT        I             \}
3834 .       if !d$AUTHOR_SIZE_CHANGE   \{ .AUTHOR_SIZE        +0            \}
3835 .       if !d$DOCTYPE_FAM          \{ .DOCTYPE_FAMILY     \\*[$DOC_FAM] \}
3836 .       if !d$DOCTYPE_FT           \{ .DOCTYPE_FONT       BI            \}
3837 .       if !d$DOCTYPE_SIZE_CHANGE  \{ .DOCTYPE_SIZE       +3            \}
3838 .       if !d$HDRFTR_LEFT_FAM      \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
3839 .       if !d$HDRFTR_LEFT_FT       \{ .HDRFTR_LEFT_FONT   R             \}
3840 .       if \\n[#HDRFTR_LEFT_CAPS]  \{\
3841 .          if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE  -2 \}
3842 .       \}
3843 .       if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE     -.5           \}
3844 .       if !d$HDRFTR_CENTER_FAM       \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
3845 .       if !d$HDRFTR_CENTER_FT        \{ .HDRFTR_CENTER_FONT   I             \}
3846 .       if \\n[#HDRFTR_CENTER_CAPS] \{\
3847 .          if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
3848 .       \}
3849 .       if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5              \}
3850 .       if !d$HDRFTR_RIGHT_FAM          \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]   \}
3851 .       if !d$HDRFTR_RIGHT_FT           \{ .HDRFTR_RIGHT_FONT   R               \}
3852 .       if \\n[#HDRFTR_RIGHT_CAPS] \{\
3853 .          if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
3854 .       \}
3855 .       if !d$HDRFTR_RIGHT_SIZE_CHANGE  \{ .HDRFTR_RIGHT_SIZE  -.5              \}
3856 .       if !d$HEAD_FAM                  \{ .HEAD_FAMILY        \\*[$DOC_FAM]    \}
3857 .       if !d$HEAD_FT                   \{ .HEAD_FONT          B                \}
3858 .       if !d$HEAD_SIZE_CHANGE          \{ .HEAD_SIZE          +1               \}
3859 .       if !r#HEAD_SPACE                \{ .HEAD_SPACE                          \}
3860 .       if !d$SH_FAM                    \{ .SUBHEAD_FAMILY     \\*[$DOC_FAM]    \}
3861 .       if !d$SH_FT                     \{ .SUBHEAD_FONT       B                \}
3862 .       if !d$SH_SIZE_CHANGE            \{ .SUBHEAD_SIZE       +.5              \}
3863 .       if !d$PH_FAM                    \{ .PARAHEAD_FAMILY    \\*[$DOC_FAM]    \}
3864 .       if !d$PH_FT                     \{ .PARAHEAD_FONT      BI               \}
3865 .       if !d$PH_SIZE_CHANGE            \{ .PARAHEAD_SIZE      -.25             \}
3866 .       if !r#PH_INDENT                 \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3867 .       if !d$QUOTE_FAM                 \{ .QUOTE_FAMILY       \\*[$DOC_FAM]    \}
3868 .       if !d$QUOTE_FT                  \{ .QUOTE_FONT         I                \}
3869 .       if !d$QUOTE_SIZE_CHANGE         \{ .QUOTE_SIZE         +0               \}
3870 .       if !r#Q_OFFSET_VALUE            \{ .QUOTE_INDENT       3                \}
3871 .       if !d$BQUOTE_FAM                \{ .BLOCKQUOTE_FAMILY  \\*[$DOC_FAM]    \}
3872 .       if !d$BQUOTE_FT                 \{ .BLOCKQUOTE_FONT    R                \}
3873 .       if !d$BQUOTE_SIZE_CHANGE        \{ .BLOCKQUOTE_SIZE    -1               \}
3874 .       if !d$BQUOTE_QUAD               \{ .BLOCKQUOTE_QUAD    LEFT             \}
3875 .       if !d$EPI_FAM                   \{ .EPIGRAPH_FAMILY    \\*[$DOC_FAM]    \}
3876 .       if !d$EPI_FT                    \{ .EPIGRAPH_FONT      R                \}
3877 .       if !d$EPI_SIZE_CHANGE           \{ .EPIGRAPH_SIZE      -1.5             \}
3878 .       if !r#EPI_AUTOLEAD              \{ .EPIGRAPH_AUTOLEAD  2                \}
3879 .       if !d$EPI_QUAD                  \{ .EPIGRAPH_QUAD      \\*[$DOC_QUAD]   \}
3880 .       if !r#EPI_OFFSET_VALUE          \{ .EPIGRAPH_INDENT    3                \}
3881 .       if !d$LINEBREAK_CHAR            \{ .LINEBREAK_CHAR     * 3 3p           \}
3882 .       if !r#FN_RULE_LENGTH            \{ .FOOTNOTE_RULE_LENGTH 4P             \}
3883 .       if !r#FN_RULE_ADJ               \{ .FOOTNOTE_RULE_ADJ  3p               \}
3884 .       if !d$FN_SIZE_CHANGE            \{ .FOOTNOTE_SIZE      -2               \}
3885 .       if !r#FN_AUTOLEAD               \{ .FOOTNOTE_AUTOLEAD  2                \}
3886 .       if !r#EN_PS                     \{ .ENDNOTE_PT_SIZE \\n[#DOC_PT_SIZE]u  \}
3887 .       if !d$EN_LEAD                   \{ .ENDNOTE_LEAD        14 ADJUST       \}
3888 .       if !d$EN_STRING_FT              \{ .ENDNOTE_STRING_FONT B               \}
3889 .       if !d$EN_STRING_SIZE_CHANGE     \{ .ENDNOTE_STRING_SIZE +1              \}
3890 .       if !d$EN_TITLE_FT               \{ .ENDNOTE_TITLE_FONT  B               \}
3891 .       if !d$EN_TITLE_SIZE_CHANGE      \{ .ENDNOTE_TITLE_SIZE  +0              \}
3892 .       if !d$EN_NUMBER_FT              \{ .ENDNOTE_NUMBER_FONT B               \}
3893 .       if !$EN_NUMBER_SIZE_CHANGE      \{ .ENDNOTE_NUMBER_SIZE +0              \}
3894 .       if !r#EN_PP_INDENT              \{ .ENDNOTE_PARA_INDENT 1.5m            \}
3895 .       if !d$TOC_FAM                   \{ .TOC_FAMILY  \\*[$DOC_FAM]           \}
3896 .       if !r#TOC_PS                    \{ .TOC_PT_SIZE \\n[#DOC_PT_SIZE]u      \}
3897 .       if !r#TOC_LEAD                  \{ .TOC_LEAD    \\n[#DOC_LEAD]u ADJUST  \}
3898 .       if !d$TOC_HEADER_FAM            \{ .TOC_HEADER_FAMILY \\*[$TOC_FAM]     \}
3899 .       if !d$TOC_HEADER_SIZE_CHANGE    \{ .TOC_HEADER_SIZE  +4                 \}
3900 .       if !d$TOC_HEADER_FT             \{ .TOC_HEADER_FONT   B                 \}
3901 .       if !d$TOC_TITLE_FAM             \{ .TOC_TITLE_FAMILY \\*[$TOC_FAM]      \}
3902 .       if !d$TOC_PN_FAM                \{ .TOC_PN_FAMILY \\*[$TOC_FAM]         \}
3903 .       if !d$TOC_HEAD_FAM              \{ .TOC_HEAD_FAMILY \\*[$TOC_FAM]       \}
3904 .       if !d$TOC_SH_FAM                \{ .TOC_SUBHEAD_FAMILY \\*[$TOC_FAM]    \}
3905 .       if !d$TOC_PH_FAM                \{ .TOC_PARAHEAD_FAMILY \\*[$TOC_FAM]   \}
3906 .       if !d$TOC_TITLE_FT              \{ .TOC_TITLE_FONT   BI                 \}
3907 .       if !d$TOC_PN_FT                 \{ .TOC_PN_FONT   R                     \}
3908 .       if !d$TOC_HEAD_FT               \{ .TOC_HEAD_FONT   B                   \}
3909 .       if !d$TOC_SH_FT                 \{ .TOC_SUBHEAD_FONT   R                \}
3910 .       if !d$TOC_PH_FT                 \{ .TOC_PARAHEAD_FONT   I               \}
3911 .       if !d$TOC_TITLE_SIZE_CHANGE     \{ .TOC_TITLE_SIZE   +.5                \}
3912 .       if !d$TOC_PN_SIZE_CHANGE        \{ .TOC_PN_SIZE  +0                     \}
3913 .       if !d$TOC_HEAD_SIZE_CHANGE      \{ .TOC_HEAD_SIZE  +.5                   \}
3914 .       if !d$TOC_SH_SIZE_CHANGE        \{ .TOC_SUBHEAD_SIZE  +0                \}
3915 .       if !d$TOC_PH_SIZE_CHANGE        \{ .TOC_PARAHEAD_SIZE  +0               \}
3916 .    \}
3917 .    if \\n[#PRINT_STYLE]=2 \{\
3918 .       ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
3919 .       el \{ . \}
3920 .    \}
3921 .    if !\\n[#COLLATE] \{\
3922 .       TRAPS
3923 \# Endnote and toc leading
3924 .       nr #OK_PROCESS_LEAD 1
3925 .       nr #RESTORE_DOC_LEAD \\n(.v
3926 .       if \\n[#PRINT_STYLE]=1 \{\
3927 .          ie \\n[#SINGLE_SPACE] \{\
3928 .             ENDNOTE_LEAD 12 ADJUST
3929 .          \}
3930 .          el \{\
3931 .             ie \\n[#EN_SINGLESPACE] \{ .ENDNOTE_LEAD 12 ADJUST \}
3932 .             el \{ .ENDNOTE_LEAD 24 ADJUST \}
3933 .          \}
3934 .       \}
3935 .       if \\n[#PRINT_STYLE]=2 \{\
3936 .          ie !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
3937 .          el \{ .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] \}
3938 .          ie !d$TOC_LEAD \{ .TOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
3939 .          el \{ .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] \}
3940 .          rm $ADJUST_EN_LEAD
3941 .          rm $ADJUST_TOC_LEAD
3942 .       \}
3943 .       DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
3944 .    \}
3945 .    if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
3946 .END
3948 \# ====================================================================
3950 \# +++START THE DOCUMENT+++
3952 \# THE START MACRO
3953 \# ---------------
3954 \# *Arguments:
3955 \#   <none>
3956 \# *Function:
3957 \#   Reads in default document style parameters and any parameter
3958 \#   the user has changed before issuing START.
3959 \#   Using the information gathered in the opening macros,
3960 \#   prints appropriate title (or chapter #), subtitle, author
3961 \#   and document type (if appropriate).
3962 \# *Notes:
3963 \#   The .PRINT \& (zero-width character) is required to get the
3964 \#   subsequent .sp request to work as advertised.
3966 \#   The overall document line length, family, and point-size
3967 \#   are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
3968 \#   use in the HEADER and FOOTER macros.
3970 \#  First, define some strings for point sizes
3972 .ds $TITLE_PT_SIZE         \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
3973 .ds $CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
3974 .ds $SUBTITLE_PT_SIZE      \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
3975 .ds $AUTHOR_PT_SIZE        \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
3976 .ds $DOCTYPE_PT_SIZE       \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
3978 \# Next, some utility macros for various routines to prevent repetition
3980 .MAC PRINT_AUTHORS END
3981 .    nr #AUTHORS \\n[#AUTHOR_NUM]
3982 .    nr #NEXT_AUTHOR 0 1
3983 .    while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
3984 .       PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
3985 .    \}
3986 .END
3988 .MAC DEFAULT_DOCHEADER END
3989 .    CENTER
3990 .    FAMILY  \\*[$TITLE_FAM]
3991 .    FT      \\*[$TITLE_FT]
3992 .    PT_SIZE \\*[$TITLE_PT_SIZE]
3993 .    LS      \\n[#DOCHEADER_LEAD]u
3994 .    PRINT   \\*[$TITLE]
3995 .    if !'\\*[$SUBTITLE]'' \{\
3996 .       FAMILY  \\*[$SUBTITLE_FAM]
3997 .       FT      \\*[$SUBTITLE_FT]
3998 .       PT_SIZE \\*[$SUBTITLE_PT_SIZE]
3999 .       PRINT   \\*[$SUBTITLE]
4000 .    \}
4001 .    if !'\\*[$AUTHOR_1]'' \{\
4002 .       FAMILY  \\*[$AUTHOR_FAM]
4003 .       FT      \\*[$AUTHOR_FT]
4004 .       PT_SIZE \\*[$AUTHOR_PT_SIZE]
4005 .       if !'\\*[$ATTRIBUTE_STRING]'' \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
4006 .       PRINT_AUTHORS
4007 .    \}
4008 .END
4011 .MAC CHAPTER_DOCHEADER END
4012 .    CENTER
4013 .    FAMILY  \\*[$TITLE_FAM]
4014 .    FT      \\*[$TITLE_FT]
4015 .    PT_SIZE \\*[$TITLE_PT_SIZE]
4016 .    LS      \\n[#DOCHEADER_LEAD]u
4017 .    ie '\\*[$CHAPTER]'' \{\
4018 .       ie !'\\*[$CHAPTER_TITLE]'' \{\
4019 .          if \\n[#PRINT_STYLE]=2 \{\
4020 .             FAMILY  \\*[$CHAPTER_TITLE_FAM]
4021 .             FT      \\*[$CHAPTER_TITLE_FT]
4022 .             PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
4023 .             LS      \\n[#DOCHEADER_LEAD]u
4024 .          \}
4025 .          PRINT \\*[$CHAPTER_TITLE]
4026 .       \}
4027 .       el \{\
4028 .          PRINT \\*[$CHAPTER_STRING]
4029 .       \}
4030 .    \}
4031 .    el \{\
4032 .       PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4033 .       if !'\\*[$CHAPTER_TITLE]'' \{\
4034 .       if \\n[#PRINT_STYLE]=1 \{ .PRINT   \\*[$CHAPTER_TITLE] \}
4035 .          if \\n[#PRINT_STYLE]=2 \{\
4036 .             FAMILY  \\*[$CHAPTER_TITLE_FAM]
4037 .             FT      \\*[$CHAPTER_TITLE_FT]
4038 .             PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
4039 .             LS      \\n[#DOCHEADER_LEAD]u
4040 .             PRINT   \\*[$CHAPTER_TITLE]
4041 .             RLD \\n[#DOC_LEAD]u \" Just looks better this way
4042 .          \}
4043 .       \}
4044 .    \}
4045 .END
4048 .MAC NAMED_DOCHEADER END
4049 .    CENTER
4050 .    FAMILY  \\*[$TITLE_FAM]
4051 .    FT      \\*[$TITLE_FT]
4052 .    PT_SIZE \\*[$TITLE_PT_SIZE]
4053 .    LS      \\n[#DOCHEADER_LEAD]u
4054 .    PRINT   \\*[$TITLE]
4055 .    if !'\\*[$SUBTITLE]'' \{\
4056 .       FAMILY  \\*[$SUBTITLE_FAM]
4057 .       FT      \\*[$SUBTITLE_FT]
4058 .       PT_SIZE \\*[$SUBTITLE_PT_SIZE]
4059 .       PRINT   \\*[$SUBTITLE]
4060 .    \}
4061 .    if !'\\*[$AUTHOR_1]'' \{\
4062 .       FAMILY  \\*[$AUTHOR_FAM]
4063 .       FT      \\*[$AUTHOR_FT]
4064 .       PT_SIZE \\*[$AUTHOR_PT_SIZE]
4065 .       if !'\\*[$ATTRIBUTE_STRING]'' \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
4066 .       PRINT_AUTHORS
4067 .    \}
4068 .    FAMILY  \\*[$DOCTYPE_FAM]
4069 .    FT      \\*[$DOCTYPE_FT]
4070 .    PT_SIZE \\*[$DOCTYPE_PT_SIZE]
4071 .    LS      \\n[#DOCHEADER_LEAD]u
4072 .    ALD     \\n[#DOCHEADER_LEAD]u
4073 .    UNDERSCORE "\\*[$DOC_TYPE]
4074 .END
4077 .MAC START END
4078 .    if !\\n[#PRINT_STYLE] \{\
4079 .       PRINTSTYLE TYPEWRITE
4080 .       PRINT \&
4081 .       po 6P
4082 .       ll 39P
4083 .       ta \\n(.lu
4084 .       sp |1i-1v
4085 .       CENTER
4086 .       PRINT "You neglected to enter a PRINTSTYLE"
4087 .       fl
4088 .       ab PRINTSTYLE missing
4089 .    \}
4090 .    nr #DOCS 1
4091 .    if \\n[#COLLATE] \{\
4092 .       COPYSTYLE \\*[$COPY_STYLE]
4093 .       nr #HEADERS_ON \\n[#HEADER_STATE]
4094 .       if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
4095 .       sp |\\n[#HEADER_MARGIN]u
4096 .       PRINT \&
4097 .       if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
4098 .          PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
4099 .          rm $RESTORE_PAGENUM_STYLE
4100 .       \}
4101 .    \}
4102 .    DEFAULTS
4103 \# Collate stuff
4104 .    ie \\n[#COLLATED_DOC]=1 \{\
4105 \# Collect TITLE for TOC.
4106 .       nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
4107 .       af #TOC_ENTRY_PN \\g[#PAGENUMBER]
4108 .       ie \\n[#USER_SET_TITLE_ITEM] \{\
4109 .          ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]\\|
4110 .          rr #USER_SET_TITLE_ITEM
4111 .          rm $USER_SET_TITLE_ITEM
4112 .       \}
4113 .       el \{\
4114 .          ie \\n[#DOC_TYPE]=2 \{\
4115 .             ie '\\*[$CHAPTER_TITLE]'' \{\
4116 .                ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
4117 .             \}
4118 .             el \{\
4119 .                ie '\\*[$CHAPTER]'' \{\
4120 .                   ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]\\|
4121 .                \}
4122 .                el \{\
4123 .                   ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
4124 .                \}
4125 .             \}
4126 .          \}
4127 .          el \{\
4128 .             ds $TOC_TITLE_ITEM \\*[$TITLE]\\|
4129 .          \}
4130 .       \}
4131 .       if \\n[#TOC_AUTHORS]=1 \{\
4132 .          ie '\\*[$TOC_AUTHORS]'' \{\
4133 .             as $TOC_TITLE_ITEM /\\|\\*[$AUTHOR_1]\\|
4134 .          \}
4135 .          el \{\
4136 .             as $TOC_TITLE_ITEM /\\|\\*[$TOC_AUTHORS]\\|
4137 .             rm $TOC_AUTHORS
4138 .          \}
4139 .       \}
4140 \# Note the use of \!, which transparently embeds the macros used
4141 \# in the TOC_ENTRIES diversion.  The elements they control must be
4142 \# processed literally when the diversion is output.
4143 .       ev TOC_EV
4144 .       da TOC_ENTRIES
4145 .       if \\n[#PRINT_STYLE]=1 \{\
4146 \!.        fam C
4147 \!.        ft  R
4148 \!.        ps  12
4149 .       \}
4150 .       if \\n[#PRINT_STYLE]=2 \{\
4151 \!.        FAMILY  \\*[$TOC_TITLE_FAM]
4152 \!.        FT      \\*[$TOC_TITLE_FT]
4153 \!.        PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
4154 .       \}
4155 \!.     TRAP OFF
4156 .       ie \\n[#PRINT_STYLE]=1 \{\
4157 \!.        PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
4158 .       \}
4159 .       el \{\
4160 \!.        PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
4161 .       \}
4162 \!.    EL
4163 \!.    ST 100 L
4164 \!.    ST 101 R
4165 .      if \\n[#PRINT_STYLE]=2 \{\
4166 \!.       FAMILY  \\*[$TOC_PN_FAM]
4167 \!.       FT      \\*[$TOC_PN_FT]
4168 \!.       PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
4169 .      \}
4170 \!.    TAB 100
4171 \!.    PRINT \\*[LEADER]
4172 \!.    TN
4173 \!.    TRAP
4174 \!.    PRINT \\n[#TOC_ENTRY_PN]
4175 \!.    TQ
4176 .      di       
4177 .      ev
4178 .    \}
4179 .    el \{\
4180 .       nr #FIRST_DOC_TITLE_PN \\n%+\\n[#PAGE_NUM_ADJ]
4181 .       af #FIRST_DOC_TITLE_PN \\g[#PAGENUMBER]
4182 .       nr #FIRST_DOC_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
4183 .    \}
4184 \# End TITLE collection
4185 .    if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
4186 .       sp |\\n[#HEADER_MARGIN]u
4187 .       PRINT_PAGE_NUMBER
4188 .    \}
4189 .    rr #COLLATE
4190 .    rr #PAGINATION_STATE
4191 \# End collate stuff
4192 .    ie \\n[#DOC_HEADER]=0 \{\
4193 .       PRINT \&
4194 .       if \\n[#DOC_TYPE]=4 \{\
4195 .          if !'\\n(.z'' \{ .di \}
4196 .       \}
4197 .       PP
4198 .       ie r#ADVANCE_FROM_TOP \{\
4199 .          sp |\\n[#ADVANCE_FROM_TOP]u-1v
4200 .          SHIM
4201 .       \}
4202 .       el \{ .sp |\\n[#T_MARGIN]u-1v \}
4203 .       if \\n[#COLUMNS] \{\
4204 .          mk dc
4205 .          nr #COL_NUM 0 1
4206 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4207 .          ll \\n[#COL_L_LENGTH]u
4208 .       \}
4209 .       nr #PP 0
4210 .       rr #DOC_HEADER
4211 .       if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \}
4212 .    \}
4213 .    el \{\
4214 .       if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u\\*[$DOCHEADER_LEAD_ADJ] \}
4215 .       nr #DOCHEADER_LEAD \\n[#LEAD]
4216 \# Default
4217 .       if \\n[#DOC_TYPE]=1 \{\
4218 .          PRINT \&
4219 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
4220 .          ev TITLE
4221 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4222 .          LL       \\n[#DOC_L_LENGTH]u
4223 .          ta \\n(.lu
4224 .          if \\n[#PRINT_STYLE]=1 \{\
4225 .             CENTER
4226 .             fam C
4227 .             ft  R
4228 .             ps  12
4229 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4230 .             el \{ .vs \\n[#DOC_LEAD]u \}
4231 .             CAPS
4232 .             if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
4233 .             CAPS OFF
4234 .             if !'\\*[$SUBTITLE]'' \{\
4235 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4236 .                el \{ .vs \\n[#DOC_LEAD]u \}
4237 .             PRINT \\*[$SUBTITLE]
4238 .             \}
4239 .             if '\\*[$SUBTITLE]'' \{\
4240 .                ALD \\n[#DOC_LEAD]u
4241 .             \}
4242 .             ie !'\\*[$AUTHOR_1]'' \{\
4243 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4244 .                el \{ .vs \\n[#DOC_LEAD]u/2u \}
4245 .                if !d$SUBTITLE \{\
4246 .                   ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4247 .                   el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4248 .                \}
4249 .                PRINT \\*[$ATTRIBUTE_STRING]
4250 .                nr #AUTHORS \\n[#AUTHOR_NUM]
4251 .                nr #NEXT_AUTHOR 0 1
4252 .                while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4253 .                   PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4254 .                \}
4255 .                if \\n[#AUTHOR_LINES]=1 \{\
4256 .                    ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4257 .                    el \{ .ALD \\n[#DOC_LEAD]u/2u \}
4258 .                \}
4259 .             \}
4260 .             el \{\
4261 .                ie !d$SUBTITLE \{\
4262 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4263 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4264 .                \}
4265 .                el \{\
4266 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4267 .                   el \{ .ALD \\n[#DOC_LEAD]u \}
4268 .                \}
4269 .             \}
4270 .          \}
4271 .          if \\n[#PRINT_STYLE]=2 \{\
4272 .             DEFAULT_DOCHEADER
4273 .             di DOCHEADER_DIVERSION \" This diversion is only
4274 .             br                     \" necessary to find the depth of the
4275 .             DEFAULT_DOCHEADER      \" docheader
4276 .             br
4277 .             di
4278 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
4279 .                                                             \"in #DOCHEADER_DEPTH
4280 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
4281 .          \}
4282 .          ev
4283 .       \}
4284 \# Chapter
4285 .       if \\n[#DOC_TYPE]=2 \{\
4286 .          PRINT \&
4287 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
4288 .          ev TITLE
4289 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4290 .          LL       \\n[#DOC_L_LENGTH]u
4291 .          ta \\n(.lu
4292 .          if \\n[#PRINT_STYLE]=1 \{\
4293 .             CENTER
4294 .             fam C
4295 .             ft  R
4296 .             ps  12
4297 .             vs \\n[#DOC_LEAD]u
4298 .             ie '\\*[$CHAPTER]'' \{\
4299 .                CAPS
4300 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
4301 .                   PRINT \\*[$CHAPTER_TITLE]
4302 .                \}
4303 .                el \{\
4304 .                   CAPS
4305 .                   PRINT \\*[$CHAPTER_STRING]
4306 .                \}
4307 .                CAPS OFF
4308 .             \}
4309 .             el \{\
4310 .                CAPS
4311 .                PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4312 .                CAPS OFF
4313 .                if !'\\*[$CHAPTER_TITLE]'' \{\
4314 .                   if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4315 .                   UNDERSCORE "\\*[$CHAPTER_TITLE]
4316 .                \}
4317 .             \}
4318 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4319 .          \}
4320 .          if \\n[#PRINT_STYLE]=2 \{\
4321 .             CHAPTER_DOCHEADER
4322 .             di DOCHEADER_DIVERSION \" This diversion is only
4323 .             br                     \" necessary to find the depth of the
4324 .             CHAPTER_DOCHEADER      \" docheader
4325 .             br
4326 .             di
4327 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
4328 .                                                             \" in #DOCHEADER_DEPTH
4329 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
4330 .          \}
4331 .          ev
4332 .       \}
4333 \# Named
4334 .       if \\n[#DOC_TYPE]=3 \{\
4335 .          PRINT \&
4336 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
4337 .          ev NAMED
4338 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4339 .          LL       \\n[#DOC_L_LENGTH]u
4340 .          ta \\n(.lu
4341 .          if \\n[#PRINT_STYLE]=1 \{\
4342 .             CENTER
4343 .             fam C
4344 .             ft  R
4345 .             ps  12
4346 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4347 .             el \{ .vs \\n[#DOC_LEAD]u \}
4348 .             CAPS
4349 .             if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
4350 .             CAPS OFF
4351 .             if !'\\*[$SUBTITLE]'' \{\
4352 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4353 .                el \{ .vs \\n[#DOC_LEAD]u \}
4354 .                PRINT \\*[$SUBTITLE]
4355 .             \}
4356 .             if '\\*[$SUBTITLE]'' \{\
4357 .                ALD \\n[#DOC_LEAD]u
4358 .             \}
4359 .             ie !'\\*[$AUTHOR_1]'' \{\
4360 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4361 .                el \{ .vs \\n[#DOC_LEAD]u/2u \}
4362 .                if !d$SUBTITLE \{\
4363 .                   ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4364 .                   el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4365 .                \}
4366 .                PRINT \\*[$ATTRIBUTE_STRING]
4367 .                nr #AUTHORS \\n[#AUTHOR_NUM]
4368 .                nr #NEXT_AUTHOR 0 1
4369 .                while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4370 .                   PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4371 .                \}
4372 .                if \\n[#AUTHOR_LINES]=1 \{\
4373 .                    ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4374 .                    el \{ .ALD \\n[#DOC_LEAD]u/2u \}
4375 .                 \}
4376 .             \}
4377 .             vs  \\n[#DOC_LEAD]u
4378 .             el \{\
4379 .                ie !d$SUBTITLE \{\
4380 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4381 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4382 .                \}
4383 .                el \{\
4384 .                   ie \\n[#SINGLE_SPACE] \{ . \}
4385 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4386 .                \}
4387 .             \}
4388 .             ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
4389 .             el \{ .ALD \\n[#DOC_LEAD]u \}
4390 .             UNDERSCORE2 "\\*[$DOC_TYPE]
4391 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4392 .          \}
4393 .          if \\n[#PRINT_STYLE]=2 \{\
4394 .             NAMED_DOCHEADER
4395 .             di DOCHEADER_DIVERSION \" This diversion is only
4396 .             br                     \" necessary to find the depth of the
4397 .             NAMED_DOCHEADER        \" docheader
4398 .             br
4399 .             di
4400 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
4401 .                                                             \"in #DOCHEADER_DEPTH
4402 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
4403 .          \}
4404 .          ev
4405 .       \}
4406 .       if !\\n[#DOC_TYPE]=4 \{\
4407 .          if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
4408 .          nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD]
4409 .          ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]-\\n[#DOCHEADER_SPACE_ADJ] \}
4410 .          el \{ .nr #DOCHEADER_EXTRA_SPACE 0 \}
4411 .          if \\n[#PRINT_STYLE]=2 \{ .ALD (\\n[#DOC_LEAD]u*2u)+\\n[#DOCHEADER_EXTRA_SPACE]u \}
4412 .          if \\n[#COLUMNS] \{\
4413 .             nr #COL_NUM 0 1
4414 .             nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
4415 .             po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4416 .             LL \\n[#COL_L_LENGTH]u
4417 .             ta \\n(.lu
4418 .             mk dc
4419 .          \}
4420 .       \}
4421 .    \}
4422 .    rr #DOCHEADER_LEAD
4423 .    rr #DOCHEADER_LEAD_ADJ
4424 .    rr #DEPTH_1
4425 .    rr #DEPTH_2
4426 .    rr #DOCHEADER_ADVANCE
4427 .    rr #ADVANCE_FROM_TOP
4428 .    rr #DOCHEADER_SPACE_ADJ
4429 .    rr #DOCHEADER_EXTRA_SPACE
4430 .    rr #AUTHORS
4431 .    rr #NEXT_AUTHOR
4432 .    rr #AUTHOR_NUM
4433 .    rr #NUM_AUTHORS
4434 .    rm $TOC_TITLE_ITEM
4435 .    nr #START 1
4436 .    nr #START_FOR_FOOTERS 1
4437 .END
4439 \# ====================================================================
4441 \# +++MACROS TO CHANGE SOME DEFAULTS+++
4443 \# DOCUMENT HEADER
4444 \# ---------------
4445 \# *Argument:
4446 \#   <none> | <anything> [distance to advance from top of page]
4447 \# *Function:
4448 \#   Turns printing of document header on or off.  If a second argument
4449 \#   in units of measure is given, advances that distance from the
4450 \#   top of the page without printing the document header.
4451 \# *Notes:
4452 \#   Default is on.  If the 1st argument is <anything> (which turns
4453 \#   document headers off), the optional 2nd argument may be given
4454 \#   (with a unit of measure).
4456 .MAC DOCHEADER END
4457 .    ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
4458 .    el \{\
4459 .       if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
4460 .       nr #DOC_HEADER 0
4461 .    \}
4462 .END
4465 \# DOCUMENT HEADER LEADING
4466 \# -----------------------
4467 \# *Arguments:
4468 \#   <+|- amount by which to in/decrease leading of doc header>
4469 \# *Function:
4470 \#   Stores user supplied lead in/decrease in string $DOCHEADER_LEAD_ADJ.
4471 \# *Notes:
4472 \#   A unit of measure must be supplied.  Decimal fractions OK.
4473 \#   Default is +0, i.e. same as DOC_LEAD.
4475 .MAC DOCHEADER_LEAD END
4476 .    ds $DOCHEADER_LEAD_ADJ \\$1
4477 .END
4480 \# DOCHEADER ADVANCE
4481 \# -----------------
4482 \# *Arguments:
4483 \#   <docheader start position>
4484 \# *Function:
4485 \#   Creates register #DOCHEADER_ADVANCE, used in START.
4486 \# *Notes:
4487 \#   Unit of measure required.
4488 \#   Default is same as T_MARGIN.
4490 .MAC DOCHEADER_ADVANCE END
4491 .    nr #DOCHEADER_ADVANCE (\\$1)
4492 .END
4495 \# TITLE FAMILY
4496 \# ------------
4497 \# *Argument:
4498 \#   <family to use for the document header title>
4499 \# *Function:
4500 \#   Creates or modifies string $TITLE_FAM.
4501 \# *Notes:
4502 \#   Default is same as running text.
4504 .MAC TITLE_FAMILY END
4505 .    ds $TITLE_FAM \\$1
4506 .END
4509 \# TITLE FONT
4510 \# ----------
4511 \# *Argument:
4512 \#   <font to use for the document header title>
4513 \# *Function:
4514 \#   Creates or modifies string $TITLE_FT.
4515 \# *Notes:
4516 \#   Default is bold.
4518 .MAC TITLE_FONT END
4519 .    ds $TITLE_FT \\$1
4520 .END
4523 \# TITLE SIZE
4524 \# ----------
4525 \# *Argument:
4526 \#   <+|- number of points by which to in/decrease title at start
4527 \#   of the document (relative to running text)>
4528 \# *Function:
4529 \#   Creates string $TITLE_SIZE_CHANGE.
4530 \# *Notes:
4531 \#   Must be preceded by a +|- sign, with no space afterwards.
4532 \#   Fractional point sizes are allowed.
4533 \#   Default is +3.5 for printstyle TYPESET DEFAULT | STORY | NAMED;
4534 \#   4 for TYPESET CHAPTER; +0 for TYPEWRITE.
4536 .MAC TITLE_SIZE END
4537 .    ds $TITLE_SIZE_CHANGE \\$1
4538 .END
4541 \# CHAPTER TITLE FAMILY
4542 \# --------------------
4543 \# *Argument:
4544 \#   <family to use for the chapter title, if there is one>
4545 \# *Function:
4546 \#   Creates or modifies string $CHAPTER_TITLE_FAM.
4547 \# *Notes:
4548 \#   Default isame as running text.
4550 .MAC CHAPTER_TITLE_FAMILY END
4551 .    ds $CHAPTER_TITLE_FAM \\$1
4552 .END
4555 \# CHAPTER TITLE FONT
4556 \# ------------------
4557 \# *Argument:
4558 \#   <font to use for the chapter title, if there is one>
4559 \# *Function:
4560 \#   Creates or modifies string $CHAPTER_TITLE_FT.
4561 \# *Notes:
4562 \#   Default is bold italic for TYPESET; varies in TYPEWRITE between
4563 \#   caps and underscored, depending on whether chapter title stands
4564 \#   alone or has CHAPTER # above it.
4566 .MAC CHAPTER_TITLE_FONT END
4567 .    ds $CHAPTER_TITLE_FT \\$1
4568 .END
4571 \# CHAPTER TITLE SIZE
4572 \# ------------------
4573 \# *Argument:
4574 \#   <+|- number of points by which to in/decrease title at start
4575 \#   of the document (relative to running text)>
4576 \# *Function:
4577 \#   Creates string $CHAPTER_TITLE_SIZE_CHANGE.
4578 \# *Notes:
4579 \#   Must be preceded by a +|- sign, with no space afterwards.
4580 \#   Fractional point sizes are allowed.
4581 \#   Default is +4 for printstyle TYPESET
4583 .MAC CHAPTER_TITLE_SIZE END
4584 .    ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
4585 .END
4588 \# SUBTITLE FAMILY
4589 \# ---------------
4590 \# *Argument:
4591 \#   <family to use for the document header title>
4592 \# *Function:
4593 \#   Creates or modifies string $SUBTITLE_FAM.
4594 \# *Notes:
4595 \#   Default is same as running text.
4597 .MAC SUBTITLE_FAMILY END
4598 .    ds $SUBTITLE_FAM \\$1
4599 .END
4602 \# SUBTITLE FONT
4603 \# -------------
4604 \# *Argument:
4605 \#   <font to use for the document header title>
4606 \# *Function:
4607 \#   Creates or modifies string $SUBTITLE_FT.
4608 \# *Notes:
4609 \#   Default is same as running text.
4611 .MAC SUBTITLE_FONT END
4612 .    ds $SUBTITLE_FT \\$1
4613 .END
4616 \# SUBTITLE SIZE
4617 \# -------------
4618 \# *Argument:
4619 \#   <+|- number of points by which to in/decrease subtitle at start
4620 \#   of the document (relative to running text)>
4621 \# *Function:
4622 \#   Creates or modifies string $SUBTITLE_SIZE_CHANGE.
4623 \# *Notes:
4624 \#   Must be preceded by a +|- sign with no space afterwards.
4625 \#   Fractional point sizes are allowed.
4626 \#   Default is +0.
4628 .MAC SUBTITLE_SIZE END
4629 .    ds $SUBTITLE_SIZE_CHANGE \\$1
4630 .END
4633 \# AUTHOR FAMILY
4634 \# -------------
4635 \# *Argument:
4636 \#   <family to use for author in document header>
4637 \# *Function:
4638 \#   Creates or modifies string $AUTHOR_FAM.
4639 \# *Notes:
4640 \#   Default is same as running text.
4642 .MAC AUTHOR_FAMILY END
4643 .    ds $AUTHOR_FAM \\$1
4644 .END
4647 \# AUTHOR FONT
4648 \# -----------
4649 \# *Argument:
4650 \#   <font to use for author in document header>
4651 \# *Function:
4652 \#   Creates or modifies string $AUTHOR_FT.
4653 \# *Notes:
4654 \#   Default is italic.
4656 .MAC AUTHOR_FONT END
4657 .    ds $AUTHOR_FT \\$1
4658 .END
4661 \# AUTHOR SIZE
4662 \# -----------
4663 \# *Argument:
4664 \#   <+|- number of points by which to in/decrease author at start
4665 \#   of the document>
4666 \# *Function:
4667 \#   Creates or modifies string $AUTHOR_SIZE_CHANGE.
4668 \# *Notes:
4669 \#   Must be preceded by a +|- sign with no space afterwards.
4670 \#   Fractional point sizes are allowed.
4671 \#   Default is same as running text.
4673 .MAC AUTHOR_SIZE END
4674 .    ds $AUTHOR_SIZE_CHANGE \\$1
4675 .END
4678 \# DOCTYPE FAMILY
4679 \# --------------
4680 \# *Argument:
4681 \#   <family to use for the document type string>
4682 \# *Function:
4683 \#   Creates or modifies string $DOCTYPE_FAM.
4684 \# *Notes:
4685 \#   Default is same as running text.
4687 .MAC DOCTYPE_FAMILY END
4688 .    ds $DOCTYPE_FAM \\$1
4689 .END
4692 \# DOCTYPE FONT
4693 \# ------------
4694 \# *Argument:
4695 \#   <font to use for the document type string>
4696 \# *Function:
4697 \#   Creates or modifies string $DOCTYPE_FT.
4698 \# *Notes:
4699 \#   Default is bold italic.
4701 .MAC DOCTYPE_FONT END
4702 .    ds $DOCTYPE_FT \\$1
4703 .END
4706 \# DOCTYPE SIZE
4707 \# -------------
4708 \# *Argument:
4709 \#   <+|- number of points by which to in/decrease the document
4710 \#   type string (relative to running text)>
4711 \# *Function:
4712 \#   Creates or modifies string $DOCTYPE_SIZE_CHANGE.
4713 \# *Notes:
4714 \#   Must be preceded by a +|- sign with no space afterwards.
4715 \#   Fractional point sizes are allowed.
4716 \#   Default is +3 for TYPESET; 0 for TYPEWRITE.
4718 .MAC DOCTYPE_SIZE END
4719 .    ds $DOCTYPE_SIZE_CHANGE \\$1
4720 .END
4723 \# DOCUMENT LEFT MARGIN
4724 \# --------------------
4725 \# *Argument:
4726 \#   <left margin of document>
4727 \# *Function:
4728 \#   Creates or modifies register #DOC_L_MARGIN.
4729 \# *Notes:
4730 \#   Affects EVERYTHING on the page.
4732 .MAC DOC_LEFT_MARGIN END
4733 .    br
4734 .    nr #DOC_L_MARGIN (\\$1)
4735 .    L_MARGIN \\n[#DOC_L_MARGIN]u
4736 .END
4739 \# DOCUMENT RIGHT MARGIN
4740 \# ---------------------
4741 \# *Argument:
4742 \#   <right margin of document>
4743 \# *Function:
4744 \#   Creates or modifies register #DOC_R_MARGIN.
4745 \# *Notes:
4746 \#   Affects EVERYTHING on the page.
4748 .MAC DOC_RIGHT_MARGIN END
4749 .    br
4750 .    nr #DOC_R_MARGIN (\\$1)
4751 .    R_MARGIN \\n[#DOC_R_MARGIN]
4752 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
4753 .END
4756 \# DOCUMENT LINE LENGTH
4757 \# --------------------
4758 \# *Argument:
4759 \#   <line length of document>
4760 \# *Function:
4761 \#   Creates or modifies string $DOC_L_LENGTH.
4762 \# *Notes:
4763 \#   Affects EVERYTHING on the page.
4765 .MAC DOC_LINE_LENGTH END
4766 .    br
4767 .    nr #DOC_L_LENGTH (\\$1)
4768 .    LL \\n[#DOC_L_LENGTH]u
4769 .    ta \\n(.lu
4770 .END
4773 \# DOCUMENT FAMILY
4774 \# ---------------
4775 \# *Argument:
4776 \#   <family of running text>
4777 \# *Function:
4778 \#   Creates or modifies string $DOC_FAM.
4779 \# *Notes:
4780 \#   Affects everything EXCEPT headers and footers.
4782 .MAC DOC_FAMILY END
4783 .    br
4784 .    ds $DOC_FAM \\$1
4785 .    FAMILY            \\*[$DOC_FAM]
4786 .    TITLE_FAMILY      \\*[$DOC_FAM]
4787 .    SUBTITLE_FAMILY   \\*[$DOC_FAM]
4788 .    AUTHOR_FAMILY     \\*[$DOC_FAM]
4789 .    DOCTYPE_FAMILY    \\*[$DOC_FAM]
4790 .    HEAD_FAMILY       \\*[$DOC_FAM]
4791 .    SUBHEAD_FAMILY    \\*[$DOC_FAM]
4792 .    QUOTE_FAMILY      \\*[$DOC_FAM]
4793 .    BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
4794 .    EPIGRAPH_FAMILY   \\*[$DOC_FAM]
4795 .    HDRFTR_FAMILY     \\*[$DOC_FAM]
4796 .    PAGENUM_FAMILY    \\*[$DOC_FAM]
4797 .END
4800 \# DOCUMENT POINT SIZE
4801 \# -------------------
4802 \# *Argument:
4803 \#   <point size of running text>
4804 \# *Function:
4805 \#   Creates or modifies register #DOC_PT_SIZE.
4806 \# *Notes:
4807 \#   DOC_PT_SIZE is the basis for calculating all type sizes in
4808 \#   a document.
4810 .MAC DOC_PT_SIZE END
4811 .    if \\n[#IGNORE] \{ .return \}
4812 .    br
4813 .    PT_SIZE \\$1
4814 .    nr #DOC_PT_SIZE \\n[#PT_SIZE]
4815 .END
4818 \# DOCUMENT LEAD
4819 \# -------------
4820 \# *Argument:
4821 \#   <lead (".vs") of running text> [ADJUST]
4822 \# *Function:
4823 \#   Creates or modifies register #DOC_LEAD.  If the optional
4824 \#   ADJUST argument is given, adjusts leading so that the last
4825 \#   line of text falls exactly on #B_MARGIN.
4826 \# *Notes:
4827 \#   DOC_LEAD is the basis for calculating all leading changes in
4828 \#   a document.  Default for TYPESET is 16; 24 for TYPEWRITE.
4830 \#   Because the visible bottom or footer margin of a page depends
4831 \#   on the overall document lead supplied by the register #DOC_LEAD,
4832 \#   DOC_LEAD, in the body of a document, should always be associated
4833 \#   with the start of a new page (in other words, just before or
4834 \#   just after a manual NEWPAGE).
4836 .MAC DOC_LEAD END
4837 .    if \\n[#IGNORE] \{ .return \}
4838 .    br
4839 .    vs \\$1
4840 .    nr #DOC_LEAD \\n[#LEAD]
4841 .    if '\\$2'ADJUST' \{ .TRAPS \}
4842 .END
4844 \# ADJUST DOCUMENT LEAD
4845 \# --------------------
4846 \# *Arguments:
4847 \#   <none> | <anything>
4848 \# *Function:
4849 \#   Adjusts document lead so that the last line of text falls exactly
4850 \#   on #B_MARGIN.
4852 .MAC DOC_LEAD_ADJUST END
4853 .    ie '\\$1'' \{ .nr #ADJ_DOC_LEAD 1 \}
4854 .    el \{ .nr #ADJ_DOC_LEAD 0 \}
4855 .END
4858 \# SHIM
4859 \# ----
4860 \# *Argument:
4861 \#   None
4862 \# *Function:
4863 \#   Advances to the next "legal" baseline.
4864 \# *Notes:
4865 \#   If a user plays around with spacing in a doc (say, with ALD),
4866 \#   it isn't easy to get mom back on track so she can achieve
4867 \#   perfectly flush bottom margins.  Any time SHIM is used, it
4868 \#   ensures that the next output line falls on a legal baseline.
4870 .MAC SHIM END
4871 .    nr #CURRENT_V_POS \\n(.d
4872 .    nr #LEGAL_BASELINE \\n[#T_MARGIN] \\n[#DOC_LEAD]
4873 .    while \\n+[#LEGAL_BASELINE]<\\n[#CURRENT_V_POS] \{ . \}
4874 .    nr #SHIM \\n[#LEGAL_BASELINE]-\\n[#CURRENT_V_POS]
4875 .    ALD \\n[#SHIM]u
4876 .END
4879 \# DOCUMENT QUAD
4880 \# -------------
4881 \# *Arguments:
4882 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE | J | JUSTIFY
4883 \# *Function:
4884 \#   Creates or modifies string $DOC_QUAD.
4885 \# *Notes:
4886 \#   While QUAD (from the typesetting macros) can be used before START
4887 \#   to change  the default document quad, DOC_QUAD *must* be used after
4888 \#   the START macro has been invoked.
4890 \#   Default is LEFT for printstyle TYPEWRITE, JUSTIFY for printstyle
4891 \#   TYPESET.
4893 .MAC DOC_QUAD END
4894 .    ds $DOC_QUAD \\$1
4895 .    QUAD \\*[$DOC_QUAD]
4896 .END
4898 \# ====================================================================
4900 \# +++INTERNATIONALIZATION+++
4902 \# ATTRIBUTE STRING
4903 \# ----------------
4904 \# *Argument:
4905 \#   <what goes in the "by" slot before author in the document header>
4906 \# *Function:
4907 \#   Creates or modifies string $ATTRIBUTE_STRING.
4908 \# *Notes:
4909 \#   Default is "by".  A blank string ("") may be used if no
4910 \#   attribution is desired.
4912 .MAC ATTRIBUTE_STRING END
4913 .    ds $ATTRIBUTE_STRING \\$1
4914 .END
4917 \# CHAPTER STRING
4918 \# --------------
4919 \# *Argument:
4920 \#   <what to print any time the word "chapter" is required>
4921 \# *Function:
4922 \#   Creates or modifies string $CHAPTER_STRING.
4923 \# *Notes:
4924 \#   Default is "chapter".
4926 .MAC CHAPTER_STRING END
4927 .    ds $CHAPTER_STRING \\$1
4928 .END
4931 \# DRAFT STRING
4932 \# ------------
4933 \# *Argument:
4934 \#   <what to print any time the word "draft" is required>
4935 \# *Function:
4936 \#   Creates or modifies string $DRAFT_STRING.
4937 \# *Notes:
4938 \#   Default is "draft".
4940 .MAC DRAFT_STRING END
4941 .    ds $DRAFT_STRING \\$1
4942 .END
4945 \# REVISION STRING
4946 \# ---------------
4947 \# *Argument:
4948 \#   <what to print any time the word "revision" is required>
4949 \# *Function:
4950 \#   Creates or modifies string $REVISION_STRING.
4951 \# *Notes:
4952 \#   Default is "revision".
4954 .MAC REVISION_STRING END
4955 .    ds $REVISION_STRING \\$1
4956 .END
4959 \# FINIS STRING
4960 \# ------------
4961 \# *Argument:
4962 \#   <what to print with the finis macro>
4963 \# *Function:
4964 \#   Creates or modifies string $FINIS_STRING.
4965 \# *Notes:
4966 \#   Default is "END".
4968 .MAC FINIS_STRING END
4969 .    nr #FINIS 1
4970 .    CAPS
4971 .    ds $FINIS_STRING \\$1
4972 .    CAPS OFF
4973 .END
4975 \# ====================================================================
4977 \# +++RECTO/VERSO+++
4979 \# RECTO_VERSO
4980 \# -----------
4981 \# *Arguments:
4982 \#   <none> | <anything>
4983 \# *Function:
4984 \#   Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages.  Also
4985 \#   switches page numbers left and right if either is chosen rather
4986 \#   than the default centered page numbers.  Switches left and right
4987 \#   margins if differing values have been entered.
4988 \# *Notes:
4989 \#   Default is OFF.
4991 .MAC RECTO_VERSO END
4992 .    ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
4993 .    el \{ .nr #RECTO_VERSO 0 \}
4994 .END
4996 \# ====================================================================
4998 \# +++EPIGRAPHS+++
5000 \# EPIGRAPH FAMILY
5001 \# ---------------
5002 \# *Argument:
5003 \#   <family to use for epigraphs>
5004 \# *Function:
5005 \#   Creates or modifies string $EPI_FAM.
5006 \# *Notes:
5007 \#   Default is same as running text.
5009 .MAC EPIGRAPH_FAMILY END
5010 .    ds $EPI_FAM \\$1
5011 .END
5014 \# EPIGRAPH FONT
5015 \# -------------
5016 \# *Argument:
5017 \#   <font to use for epigraphs>
5018 \# *Function:
5019 \#   Creates or modifies string $EPI_FT.
5020 \# *Notes:
5021 \#   Default is same as running text.
5023 .MAC EPIGRAPH_FONT END
5024 .    ds $EPI_FT \\$1
5025 .END
5028 \# EPIGRAPH SIZE
5029 \# -------------
5030 \# *Argument:
5031 \#   <-|+ number of points by which to de/increase point size of epigraphs
5032 \#   (relative to running text)>
5033 \# *Function:
5034 \#   Creates or modifies string $EPI_SIZE_CHANGE.
5035 \# *Notes:
5036 \#   Must be preceded by a - or + sign with no space afterwards.
5037 \#   Fractional point sizes are allowed.  Default -1.5 for printstyle
5038 \#   TYPESET; +0 for TYPEWRITE.
5040 .MAC EPIGRAPH_SIZE END
5041 .    ds $EPI_SIZE_CHANGE \\$1
5042 .END
5045 \# EPIGRAPH QUAD
5046 \# -------------
5047 \# *Arguments:
5048 \#   L | LEFT | J | JUSTIFY
5049 \# *Function:
5050 \#   Creates or modifies string $EPI_QUAD.
5051 \# *Notes:
5052 \#   Default is $DOC_QUAD when BLOCK argument is passed to EPIGRAPH.
5054 .MAC EPIGRAPH_QUAD END
5055 .    ds $EPI_QUAD \\$1
5056 .END
5059 \# EPIGRAPH INDENT
5060 \# ---------------
5061 \# *Argument:
5062 \#   <value by which to multiply PP_INDENT for block epigraphs>
5063 \# *Function:
5064 \#   Creates or modifies register #EPI_OFFSET_VALUE.
5065 \# *Notes:
5066 \#   Default is 2 for TYPEWRITE, 3 for TYPESET.
5068 .MAC EPIGRAPH_INDENT END
5069 .    nr #EPI_OFFSET_VALUE \\$1
5070 .END
5073 \# EPIGRAPH AUTOLEAD
5074 \# -----------------
5075 \# *Argument:
5076 \#   <amount of lead to add to the epigraph ps for epigraph leading>
5077 \# *Function:
5078 \#   Creates or modifies register #EPI_AUTOLEAD.
5079 \# *Notes:
5080 \#   Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
5082 .MAC EPIGRAPH_AUTOLEAD END
5083 .    nr #EPI_AUTOLEAD \\$1
5084 .END
5087 \# EPIGRAPH
5088 \# --------
5089 \# *Arguments:
5090 \#   BLOCK | <anything>
5091 \# *Function:
5092 \#   Places an epigraph before the document's text, after the
5093 \#   document header, or after a HEAD.
5094 \# *Notes:
5095 \#   #EPIGRAPH 1 = centered; 2 = block
5097 \#   By default, epigraphs are centered, allowing the user
5098 \#   to input them on a line per line basis.  To change this
5099 \#   behaviour, the user can supply the argument BLOCK, which
5100 \#   will produce indented, filled text similar to BLOCKQUOTE.
5102 \#   If a block epigraph contains more than one para, ALL paras of
5103 \#   the epigraph must be preceded by PP.  Otherwise, PP is optional.
5105 .MAC EPIGRAPH END
5106 .    nr #PP_STYLE 2
5107 .    nr #Q_PP     0
5108 .    if \\n[#START] \{\
5109 .       if \\n[#PRINT_STYLE]=1 \{\
5110 .          if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
5111 .       \}
5112 .    \}
5113 .    ie '\\$1'' \{\
5114 .       nr #EPIGRAPH 1
5115 .       ev EPIGRAPH
5116 .       ll \\n[#L_LENGTH]u
5117 .       ta \\n(.lu
5118 .       CHECK_INDENT
5119 .       if \\n[#COLUMNS] \{\
5120 .          ie \\n[#START] \{\
5121 .              ll \\n[#DOC_L_LENGTH]u
5122 .              ta \\n(.lu
5123 .          \}
5124 .          el \{\
5125 .             ll \\n[#COL_L_LENGTH]u
5126 .             ta \\n(.lu
5127 .          \}
5128 .       \}
5129 .       CENTER
5130 .       if \\n[#PRINT_STYLE]=1 \{\
5131 .          fam C
5132 .          ft  R
5133 .          if '\\*[$EPI_FT]'I' \{\
5134 .             FT I
5135 .          \}
5136 .          ps  12
5137 .          ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
5138 .          el \{ .vs  \\n[#DOC_LEAD]u/2u \}
5139 .          nr #EPI_LEAD      \\n[#LEAD]
5140 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5141 .       \}
5142 .       if \\n[#PRINT_STYLE]=2 \{\
5143 .          FAMILY   \\*[$EPI_FAM]
5144 .          FT       \\*[$EPI_FT]
5145 .          PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
5146 .          AUTOLEAD \\n[#EPI_AUTOLEAD]
5147 .          nr #EPI_LEAD      \\n[#LEAD]
5148 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5149 .       \}
5150 .       di EPI_TEXT
5151 .       nr #EPI_ACTIVE 1
5152 .    \}
5153 .    el \{\
5154 .       ie '\\$1'BLOCK' \{\
5155 .          nr #EPIGRAPH 2
5156 .          ev EPIGRAPH
5157 .          ie \\n[#START] \{\
5158 .             ie \\n[#COLUMNS] \{\
5159 .                ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5160 .                ta \\n(.lu
5161 .             \}
5162 .             el \{\
5163 .                ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5164 .                ta \\n(.lu
5165 .             \}
5166 .          \}
5167 .          el \{\
5168 .             ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5169 .             ta \\n(.lu
5170 .             if \\n[#COLUMNS] \{\
5171 .                ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5172 .                ta \\n(.lu
5173 .             \}
5174 .             CHECK_INDENT
5175 .          \}
5176 .          if \\n[#PRINT_STYLE]=1 \{\
5177 .             fam C
5178 .             ft  R
5179 .             if '\\*[$EPI_FT]'I' \{\
5180 .                FT I
5181 .             \}
5182 .             ps  12
5183 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
5184 .             el \{ .vs  \\n[#DOC_LEAD]u/2u \}
5185 .             QUAD LEFT
5186 .             HY OFF
5187 .             nr #EPI_LEAD \\n[#LEAD]
5188 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5189 .             di EPI_TEXT
5190 .             nr #EPI_ACTIVE 1
5191 .          \}
5192 .          if \\n[#PRINT_STYLE]=2 \{\
5193 .             FAMILY   \\*[$EPI_FAM]
5194 .             FT       \\*[$EPI_FT]
5195 .             PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
5196 .             AUTOLEAD \\n[#EPI_AUTOLEAD]
5197 .             QUAD     \\*[$EPI_QUAD]
5198 .             HY
5199 .             nr #EPI_LEAD \\n[#LEAD]
5200 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5201 .             di EPI_TEXT
5202 .             nr #EPI_ACTIVE 1
5203 .          \}
5204 .       \}
5205 .       el \{\
5206 .          DO_EPIGRAPH
5207 .       \}
5208 .    \}
5209 .END
5212 \# DO EPIGRAPH
5213 \# -----------
5214 \# *Arguments:
5215 \#   <none>
5216 \# *Function:
5217 \#   Ends diversion started in EPIGRAPH.  Makes spacing
5218 \#   adjustments to compensate for the difference between epigraph
5219 \#   leading and overall document leading, so that the bottom of
5220 \#   the pages remain flush.
5221 \# *Notes:
5222 \#   In addition to its usual place at the beginning of a
5223 \#   document, EPIGRAPH may also be used after HEAD.
5225 .MAC DO_EPIGRAPH END
5226 .    br
5227 .    di
5228 .    REMOVE_INDENT
5229 .    ev
5230 .    nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
5231 .    nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
5232 .    ie \\n[#START] \{\
5233 .       nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
5234 .       while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5235 .       if \\n[#PRINT_STYLE]=2 \{\
5236 .          RLD \\n[#DOC_LEAD]u
5237 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5238 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
5239 .          \}
5240 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5241 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5242 .          \}
5243 .       \}
5244 .    \}
5245 .    el \{\
5246 .       ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
5247 .          nr #EPI_FITS 1
5248 .          nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
5249 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5250 .          ie \\n[#PRINT_STYLE]=1 \{\
5251 .             if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
5252 .          \}
5253 .          el \{\
5254 .             if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5255 .                ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
5256 .             \}
5257 .             if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5258 .                ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5259 .             \}
5260 .          \}
5261 .       \}
5262 .       el \{\
5263 .          nr #EPI_LINES_TO_TRAP 0 1
5264 .          while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{ .nr #LOOP 1 \}
5265 .          nr #EPI_LINES_TO_TRAP -1
5266 .          nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
5267 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5268 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
5269 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
5270 .      \}
5271 .    \}
5272 .    if \\n[#EPIGRAPH]=1 \{\
5273 .       po \\n[#L_MARGIN]u
5274 .       if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
5275 .    \}
5276 .    if \\n[#EPIGRAPH]=2 \{\
5277 .       nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5278 .       if \\n[#COLUMNS] \{\
5279 .          nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5280 .       \}
5281 .       po \\n[#EPI_OFFSET]u
5282 .    \}
5283 .    nf
5284 .    EPI_TEXT
5285 .    br
5286 .    ie \\n[#START] \{\
5287 .       if \\n[#PRINT_STYLE]=1 \{\
5288 .          ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
5289 .          el \{\
5290 .             ie \\n[#EPI_LINES]%2=1 \{ .ALD \\n[#DOC_LEAD]u \}
5291 .             el \{ .ALD \\n[#DOC_LEAD]u/2u \}
5292 .          \}
5293 .       \}
5294 .       if \\n[#PRINT_STYLE]=2 \{\
5295 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5296 .             ALD \\n[#EPI_WHITESPACE]u/2u
5297 .          \}
5298 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5299 .             ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5300 .          \}
5301 .       \}
5302 .    \}
5303 .    el \{\
5304 .       rr #EPI_ACTIVE
5305 .       ie \\n[#EPI_FITS] \{\
5306 .          ie \\n[#FN_FOR_EPI] \{\
5307 .             nr #EPI_LINES_TO_END 1
5308 .             nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
5309 .             while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5310 .             ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
5311 .          \}
5312 .          el \{\
5313 .             ie \\n[#PRINT_STYLE]=1 \{\
5314 .                if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
5315 .             \}
5316 .             el \{\
5317 .                if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5318 .                   ALD \\n[#EPI_WHITESPACE]u/2u
5319 .                \}
5320 .                if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5321 .                   ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5322 .                \}
5323 .             \}
5324 .          \}
5325 .       \}
5326 .       el \{\
5327 .          nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
5328 .          if \\n[#LOOP] \{. nr #EPI_LINES_TO_END +1 \}
5329 .          rr #LOOP
5330 .          nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
5331 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5332 .          ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
5333 .          if \\n[#PRINT_STYLE]=1 \{\
5334 .             if !\\n[#SINGLE_SPACE] \{\
5335 .                nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
5336 .                ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
5337 .                el \{ .RLD .5v \}
5338 .                rr #EPI_LINES_EVEN
5339 .             \}
5340 .          \}
5341 .       \}
5342 .    \}
5343 .    nr #PP_STYLE 1
5344 .    rr #EPI_FITS
5345 .    ALD \\n[#DOC_LEAD]u
5346 .    QUAD \\*[$DOC_QUAD]
5347 .    po \\n[#L_MARGIN]u
5348 .    if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
5349 .    if \\n[#START] \{\
5350 .       if \\n[#COLUMNS] \{\
5351 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5352 .          mk dc
5353 .       \}
5354 .    \}
5355 .END
5357 \# ====================================================================
5359 \# +++FINIS MACRO+++
5361 \# FINIS
5362 \# -----
5363 \# *Arguments:
5364 \#   <none>
5365 \# *Function:
5366 \#   Deposits --END-- at the end of a document.
5368 .MAC FINIS END
5369 .    nr #FINIS 1
5370 .    if \\n[#TAB_ACTIVE] \{ .TQ \}
5371 .    if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
5372 .    if \\n[#FOOTERS_ON] \{\
5373 .       nr #FOOTERS_WERE_ON 1
5374 .       FOOTERS OFF
5375 .    \}
5376 .    if \\n[#PAGINATE] \{\
5377 .       if \\n[#PAGE_NUM_V_POS]=2 \{\
5378 .          nr #PAGINATION_WAS_ON 1
5379 .          PAGINATION OFF
5380 .       \}
5381 .    \}
5382 .    nr #EM_ADJUST (1m/8)
5383 .    if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
5384 .    ALD \\n[#DOC_LEAD]u
5385 .    CENTER
5386 .    if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
5387 .    if \\n[#PRINT_STYLE]=2 \{\
5388 .       PRINT "\v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em
5389 .    \}
5390 .END
5392 \# ====================================================================
5394 \# +++HEADERS/FOOTERS+++
5396 \# Define a string so that the current page number can be incorporated
5397 \# into the strings for hdrftr left, right, and center.  NOTE: This is
5398 \# not the same thing as using the shortform # in hdrftr strings.
5400 .ds PAGE# \En[#PAGENUMBER]
5403 \# HDRFTR FAMILY
5404 \# -------------
5405 \# *Argument:
5406 \#   <family to use in header/footers>
5407 \# *Function:
5408 \#   Creates or modifies string $HDRFTR_FAM.
5409 \# *Notes:
5410 \#   Default is same as running text.
5412 .MAC HDRFTR_FAMILY END
5413 .    ds $HDRFTR_FAM \\$1
5414 .END
5417 \# HDRFTR SIZE
5418 \# -----------
5419 \# *Argument:
5420 \#   <+|-number of points by which to in/decrease point size of
5421 \#   header/footers (relative to running text)>
5422 \# *Function:
5423 \#   Creates or modifies string $HDRFTR_SIZE_CHANGE.
5424 \# *Notes:
5425 \#   Must be preceded by a +|- sign.  No space afterwards.
5426 \#   Fractional point sizes are allowed.  Default is +0.
5428 \#   By default, header/footers print the author .5 points smaller
5429 \#   than the base point size of running text, center titles
5430 \#   (Chapter, Draft, Revision, etc.)  .5 points smaller
5431 \#   than running text (in italics), and the document title 2 full
5432 \#   points smaller than running text (in caps).  The HDRFTR_SIZE
5433 \#   macro changes the overall size for all three parts while
5434 \#   maintaining the internal size changes.
5436 \#   In other words, if the user likes the header/footers but wants
5437 \#   them a bit bigger or a bit smaller, s/he should use HDRFTR_SIZE.
5439 .MAC HDRFTR_SIZE END
5440 .    ds $HDRFTR_SIZE_CHANGE \\$1
5441 .END
5444 \# HDRFTR RULE GAP
5445 \# ---------------
5446 \# *Argument:
5447 \#   <amount of space between header/footer and header/footer rule>
5448 \# *Function:
5449 \#   Creates or modifies register #HDRFTR_RULE_GAP to hold amount
5450 \#   of space between header/footer and header/footer rule.
5451 \# *Notes:
5452 \#   Default is 4p.
5454 .MAC HDRFTR_RULE_GAP END
5455 .    nr #HDRFTR_RULE_GAP (\\$1)
5456 .END
5459 \# HDRFTR LEFT
5460 \# -----------
5461 \# *Argument:
5462 \#   <what to put in the left position of page header/footers>
5463 \# *Function:
5464 \#   Creates or modifies string $HDRFTR_LEFT.
5465 \#   Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
5466 \#   overrides the $HDRFTR_LEFT string created by default
5467 \#   in DEFAULTS.
5468 \# *Notes:
5469 \#   Especially useful if doc has more than one author, and a list
5470 \#   of authors by last name is desired in header/footers.
5471 \#   Default is author.
5473 \#   If the argument is the # character, simply prints the current
5474 \#   page number.
5476 \#   If the user wants to *incorporate* the page number into the string,
5477 \#   \*[PAGE#] must be used.  For example, if the user wants to put
5478 \#   an elipsis before the page number in the string, s/he should use
5479 \#   ...\*[PAGE#], not ...#
5481 .MAC HDRFTR_LEFT END
5482 .    nr #USER_DEF_HDRFTR_LEFT 1
5483 .    ds $HDRFTR_LEFT \\$1
5484 .END
5487 \# HDRFTR LEFT FAMILY
5488 \# ------------------
5489 \# *Argument:
5490 \#   <family of header/footer left string>
5491 \# *Function:
5492 \#   Creates or modifies string $HDRFTR_LEFT_FAM.
5494 .MAC HDRFTR_LEFT_FAMILY END
5495 .    ds $HDRFTR_LEFT_FAM \\$1
5496 .END
5499 \# HDRFTR LEFT FONT
5500 \# ----------------
5501 \# *Argument:
5502 \#   <font of header/footer left string>
5503 \# *Function:
5504 \#   Creates or modifies string $HDRFTR_LEFT_FT.
5506 .MAC HDRFTR_LEFT_FONT END
5507 .    ds $HDRFTR_LEFT_FT \\$1
5508 .END
5511 \# HDRFTR LEFT SIZE
5512 \# ----------------
5513 \# *Argument:
5514 \#   <+|- number of points to in/decrease size of left string in
5515 \#   header/footers (relative to running text)>
5516 \# *Function:
5517 \#   Creates or modifies string HDRFTR_LEFT_SIZE_CHANGE.
5518 \# *Notes:
5519 \#   Must be preceded by a +|- sign.  No space afterwards.
5520 \#   Fractional point sizes are allowed.
5521 \#   Default is -.5 for printstyle TYPESET; if all caps, -2
5522 \#   Has no effect in TYPEWRITE.
5524 .MAC HDRFTR_LEFT_SIZE END
5525 .    ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5526 .END
5529 \# HDRFTR LEFT CAPS
5530 \# ----------------
5531 \# *Argument:
5532 \#   <none> | <anything>
5533 \# *Function:
5534 \#   Turns capitalisation of $HDRFTR_LEFT (typically, the author of
5535 \#   the document) on or off.
5536 \# *Notes:
5537 \#   Default is on.
5539 .MAC HDRFTR_LEFT_CAPS END
5540 .    ie '\\$1'' \{\
5541 .        nr #HDRFTR_LEFT_CAPS 1
5542 .    \}
5543 .    el \{\
5544 .       nr #HDRFTR_LEFT_CAPS 0
5545 .       ds $HDRFTR_RIGHT_SIZE_CHANGE +0
5546 .    \}
5547 .END
5550 \# HDRFTR CENTER
5551 \# -------------
5552 \# *Argument:
5553 \#   <what to put in the centre position of page header/footers>
5554 \# *Function:
5555 \#   Creates or modifies string $HDRFTR_CENTER.
5556 \#   Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
5557 \#   overrides the $HDRFTR_CENTER string created by default
5558 \#   in COPYSTYLE.
5559 \# *Notes:
5560 \#   Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
5561 \#   CHAPTER, draft and revision number if COPYSTYLE DRAFT.
5563 \#   If the argument is the # character, simply prints the current
5564 \#   page number.
5566 \#   If the user wants to *incorporate* the page number into the string,
5567 \#   \*[PAGE#] must be used.  For example, if the user wants to put
5568 \#   an elipsis before the page number in the string, s/he should use
5569 \#   ...\*[PAGE#], not ...#
5571 .MAC HDRFTR_CENTER END
5572 .    nr #USER_DEF_HDRFTR_CENTER 1
5573 .    if '\\$0'FOOTER_CENTER' \{\
5574 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
5575 .       ds $HDRFTR_CENTER_NEW \\$1
5576 .    \}
5577 .    if '\\$0'FOOTER_CENTRE' \{\
5578 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
5579 .       ds $HDRFTR_CENTER_NEW \\$1
5580 .    \}
5581 .    ds $HDRFTR_CENTER \\$1
5582 .END
5585 \# HDRFTR CENTER FAMILY
5586 \# --------------------
5587 \# *Argument:
5588 \#   <family of header/footer center string>
5589 \# *Function:
5590 \#   Creates or modifies string $HDRFTR_CENTER_FAM.
5592 .MAC HDRFTR_CENTER_FAMILY END
5593 .    ds $HDRFTR_CENTER_FAM \\$1
5594 .END
5597 \# HDRFTR CENTER FONT
5598 \# ------------------
5599 \# *Argument:
5600 \#   <font of header/footer center string>
5601 \# *Function:
5602 \#   Creates or modifies string $HDRFTR_CENTER_FT.
5604 .MAC HDRFTR_CENTER_FONT END
5605 .    ds $HDRFTR_CENTER_FT \\$1
5606 .END
5609 \# HDRFTR CENTER SIZE
5610 \# ------------------
5611 \# *Argument:
5612 \#   <+|- number of points to in/decrease size of centre string in
5613 \#   header/footers (relative to header/footer size)>
5614 \# *Function:
5615 \#   Creates string HDRFTR_CENTER_SIZE_CHANGE.
5616 \# *Notes:
5617 \#   Must be preceded by a +|- sign.  No space afterwards.
5618 \#   Fractional point sizes are allowed.
5619 \#   Default is -.5 for printstyle TYPESET; if all caps, -2
5620 \#   Has no effect in TYPEWRITE.
5622 .MAC HDRFTR_CENTER_SIZE END
5623 .    ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
5624 .END
5627 \# HDRFTR CENTER CAPS
5628 \# ------------------
5629 \# *Argument:
5630 \#   <none> | <anything>
5631 \# *Function:
5632 \#   Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
5633 \#   the document) on or off.
5634 \# *Notes:
5635 \#   Default is on.
5637 .MAC HDRFTR_CENTER_CAPS END
5638 .    ie '\\$1'' \{\
5639 .       nr #HDRFTR_CENTER_CAPS 1
5640 .    \}
5641 .    el \{\
5642 .       nr #HDRFTR_CENTER_CAPS 0
5643 .       ds $HDRFTR_CENTER_SIZE_CHANGE +0
5644 .    \}
5645 .END
5648 \# HDRFTR CENTER PADDING
5649 \# ---------------------
5650 \# *Argument:
5651 \#   LEFT | RIGHT <amount of padding to put left or right of hdrftr
5652 \#   center string>
5653 \# *Function:
5654 \#   Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
5655 \#   #HDRFTR_CTR_PAD_RIGHT.
5656 \# *Notes:
5657 \#   By default, the HDRFTR_CENTER string is centered on the doc
5658 \#   line length.  Long titles or long author names can screw up
5659 \#   visual centering, or create overprints.  This macro allows the
5660 \#   user to pad the center string by the specified amount of space
5661 \#   to fix these problems.  Use only one of LEFT or RIGHT.
5663 \#   A unit of measure is required.
5665 .MAC HDRFTR_CENTER_PAD END
5666 .    if '\\$1'LEFT' \{\
5667 .       nr #HDRFTR_CTR_PAD_LEFT (\\$2)
5668 .    \}
5669 .    if '\\$1'RIGHT' \{\
5670 .       nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
5671 .    \}
5672 .END
5675 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
5676 \# --------------------------------
5677 \# *Argument:
5678 \#   <none>
5679 \# *Function:
5680 \#   Switches the padding side of hdrftr center padding.
5681 \# *Notes:
5682 \#   Required to keep spacing around hdrftr string constant
5683 \#   in recto/verso documents.
5685 .MAC SWITCH_HDRFTR_CENTER_PAD END
5686 .    nr #HDRFTR_CTR_PAD_TMP  \\n[#HDRFTR_CTR_PAD_LEFT]
5687 .    HDRFTR_CENTER_PAD LEFT  \\n[#HDRFTR_CTR_PAD_RIGHT]u
5688 .    HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
5689 .END
5692 \# HDRFTR RIGHT
5693 \# ------------
5694 \# *Argument:
5695 \#   <what to put in the right position of page header/footers>
5696 \# *Function:
5697 \#   Creates or modifies string $HDRFTR_RIGHT.
5698 \#   Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
5699 \#   overrides the $HDRFTR_RIGHT string created by default
5700 \#   in DEFAULTS.
5701 \# *Notes:
5702 \#   Default is document title.
5704 \#   If the argument is the # character, simply prints the current
5705 \#   page number.
5707 \#   If the user wants to *incorporate* the page number into the string,
5708 \#   \*[PAGE#] must be used.  For example, if the user wants to put
5709 \#   an elipsis before the page number in the string, s/he should use
5710 \#   ...\*[PAGE#], not ...#
5712 .MAC HDRFTR_RIGHT END
5713 .    nr #USER_DEF_HDRFTR_RIGHT 1
5714 .    ds $HDRFTR_RIGHT \\$1
5715 .END
5718 \# HDRFTR RIGHT FAMILY
5719 \# -------------------
5720 \# *Argument:
5721 \#   <family of header/footer right string>
5722 \# *Function:
5723 \#   Creates or modifies string $HDRFTR_RIGHT_FAM.
5725 .MAC HDRFTR_RIGHT_FAMILY END
5726 .    ds $HDRFTR_RIGHT_FAM \\$1
5727 .END
5730 \# HDRFTR RIGHT FONT
5731 \# -----------------
5732 \# *Argument:
5733 \#   <font of header/footer right string>
5734 \# *Function:
5735 \#   Creates or modifies string $HDRFTR_RIGHT_FT.
5737 .MAC HDRFTR_RIGHT_FONT END
5738 .    ds $HDRFTR_RIGHT_FT \\$1
5739 .END
5742 \# HDRFTR RIGHT SIZE
5743 \# -----------------
5744 \# *Argument:
5745 \#   <+|- number of points to in/decrease size of right string in
5746 \#   header/footers (relative to header/footer size)>
5747 \# *Function:
5748 \#   Creates or modifies string HDRFTR_RIGHT_SIZE_CHANGE.
5749 \# *Notes:
5750 \#   Must be preceded by a +|- sign.  No space afterwards.
5751 \#   Fractional point sizes are allowed.
5752 \#   Default is -2 for printstyle TYPESET if all caps; otherwise -.5
5753 \#   Has no effect in TYPEWRITE.
5755 .MAC HDRFTR_RIGHT_SIZE END
5756 .    ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
5757 .END
5760 \# HDRFTR RIGHT CAPS
5761 \# -----------------
5762 \# *Argument:
5763 \#   <none> | <anything>
5764 \# *Function:
5765 \#   Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
5766 \#   the document) on or off.
5767 \# *Notes:
5768 \#   Default is on.
5770 .MAC HDRFTR_RIGHT_CAPS END
5771 .    ie '\\$1'' \{\
5772 .       nr #HDRFTR_RIGHT_CAPS 1
5773 .    \}
5774 .    el \{\
5775 .       nr #HDRFTR_RIGHT_CAPS 0
5776 .       ds $HDRFTR_RIGHT_SIZE_CHANGE +0
5777 .    \}
5778 .END
5780 \# HDRFTR RULE
5781 \# -----------
5782 \# *Arguments:
5783 \#   <none> | <anything>
5784 \# *Function:
5785 \#   If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
5786 \#   under the header/footer.  Otherwise, turns HDRFTR_RULE on or off.
5788 .MAC HDRFTR_RULE END   \"To print rule under header/over footer.
5789 .    ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
5790 .       ie \\n[#USERDEF_HDRFTR] \{\
5791 .          nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
5792 .          PT_SIZE 12
5793 .          if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
5794 .          if \\n[#FOOTERS_ON] \{\
5795 .              RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
5796 .          \}
5797 .          PRINT \\l'\\n[#DOC_L_LENGTH]u'
5798 .          br
5799 .       \}
5800 .       el \{\
5801 .          if \\n[#PRINT_STYLE]=1 \{\
5802 .             nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
5803 .          \}
5804 .          if \\n[#PRINT_STYLE]=2 \{\
5805 .             ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
5806 .                nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
5807 .             \}
5808 .             el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
5809 .             ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
5810 .                nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
5811 .             \}
5812 .             el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
5813 .          \}
5814 .          PT_SIZE 12
5815 .          if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
5816 .          if \\n[#FOOTERS_ON] \{\
5817 .             RLD \\n[#LEAD]u*3u+\\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
5818 .          \}
5819 .          PRINT \\l'\\n[#DOC_L_LENGTH]u'
5820 .          br
5821 .       \}
5822 .    \}
5823 .    el \{\
5824 .       ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
5825 .       el \{ .nr #HDRFTR_RULE 0 \}
5826 .    \}
5827 .END
5830 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
5833 \# HDRFTR PLAIN
5834 \# ------------
5835 \# *Arguments:
5836 \#   <none>
5837 \# *Function:
5838 \#   Sets the family, font, and point size of all strings in
5839 \#   header/footers to the same family and point size as running
5840 \#   text.  Font for the header/footer becomes roman throughout.
5842 .MAC HDRFTR_PLAIN END
5843 .    HDRFTR_FAMILY        \\*[$DOC_FAM]
5844 .    HDRFTR_PT_SIZE       \\n[#DOC_PT_SIZE]
5845 .    HDRFTR_LEFT_FAMILY   \\*[$DOC_FAM]
5846 .    HDRFTR_LEFT_FONT     R
5847 .    HDRFTR_LEFT_SIZE     +0
5848 .    HDRFTR_LEFT_CAPS     OFF
5849 .    HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
5850 .    HDRFTR_CENTER_FONT   R
5851 .    HDRFTR_CENTER_SIZE   +0
5852 .    HDRFTR_CENTER_CAPS   OFF
5853 .    HDRFTR_RIGHT_FAMILY  \\*[$DOC_FAM]
5854 .    HDRFTR_RIGHT_FONT    R
5855 .    HDRFTR_RIGHT_SIZE    +0
5856 .    HDRFTR_RIGHT_CAPS    OFF
5857 .END
5860 \# SWITCH HDRFTR
5861 \# -------------
5862 \# *Arguments:
5863 \#   <none> | <anything>
5864 \# *Function:
5865 \#   Creates or modifies register #SWITCH_HDRFTR, used to switch
5866 \#   default location of HDRFTR_LEFT and HDRFTR_RIGHT.
5867 \# *Notes:
5868 \#   Typically, the author string appears at the left of header/footers,
5869 \#   and the title string appears at the right.  This switches the
5870 \#   location of the two.  Useful in conjuction with RECTO_VERSO to
5871 \#   tweak switches on alternate pages to come out as the user wishes.
5872 \#   The assumption of RECTO_VERSO is that the first page of the document
5873 \#   (recto) is odd, and even though it has no header/footer, if it did have one,
5874 \#   it would print as AUTHOR...CENTER...TITLE (or whatever strings
5875 \#   the user has supplied for HDRFTR_LEFT/RIGHT), meaning that the
5876 \#   next page, which does have a header/footer, will come out as
5877 \#   TITLE...CENTER...AUTHOR (or whatever strings the user has
5878 \#   supplied for HDRFTR_LEFT/RIGHT).  SWITCH_HDRFTRS allows the user
5879 \#   to get the desired string in the desired place on the desired
5880 \#   recto/verso page.
5882 \#   Default is OFF.
5884 .MAC SWITCH_HDRFTR END
5885 .    ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
5886 .    el \{ .nr #SWITCH_HDRFTR 0 \}
5887 .END
5890 \# USER DEFINED HDRFTR RECTO
5891 \# -------------------------
5892 \# *Arguments:
5893 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
5894 \# *Function:
5895 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
5896 \#   stores string in $USERDEF_HDRFTR_RECTO.
5897 \# *Notes:
5898 \#   For use when users don't want 3-part headers/footers, but rather
5899 \#   want to design their own headers/footers and need different
5900 \#   headers/footers on recto and verso pages.  Using just
5901 \#   HEADER_RECTO, even when recto/verso is not on, allows users to
5902 \#   design their own headers/footers for doc pages.
5904 .MAC HDRFTR_RECTO END
5905 .    nr #USERDEF_HDRFTR 1
5906 .    if '\\$1'L'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
5907 .    if '\\$1'LEFT'   \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
5908 .    if '\\$1'C'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5909 .    if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5910 .    if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5911 .    if '\\$1'R'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
5912 .    if '\\$1'RIGHT'  \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
5913 .    ds $USERDEF_HDRFTR_RECTO \\$2
5914 .END
5917 \# USER DEFINED HDRFTR VERSO
5918 \# -------------------------
5919 \# *Arguments:
5920 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
5921 \# *Function:
5922 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
5923 \#   stores string in $USERDEF_HDRFTR_VERSO.
5924 \# *Notes:
5925 \#   For use when users don't want 3-part headers/footers, but rather
5926 \#   want to design their own headers/footers and need different
5927 \#   headers/footers on recto and verso pages.
5929 .MAC HDRFTR_VERSO END
5930 .    nr #USERDEF_HDRFTR 1
5931 .    if '\\$1'L'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
5932 .    if '\\$1'LEFT'   \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
5933 .    if '\\$1'C'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5934 .    if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5935 .    if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5936 .    if '\\$1'R'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
5937 .    if '\\$1'RIGHT'  \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
5938 .    ds $USERDEF_HDRFTR_VERSO \\$2
5939 .END
5942 \# PRINT FOOTER ON FIRST PAGE
5943 \# --------------------------
5944 \# *Arguments:
5945 \#   <none> | <anything>
5946 \# *Function:
5947 \#   Toggles register #PRINT_FOOTER_ON_PAGE_1
5948 \# *Notes:
5949 \#   Lets user choose whether to print footer on first
5950 \#   page of doc.
5952 .MAC FOOTER_ON_FIRST_PAGE END
5953 .    ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
5954 .    el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
5955 .END
5958 \# PRINT PAGE NUMBER ON FIRST PAGE
5959 \# -------------------------------
5960 \# *Arguments:
5961 \#   <none> | <anything>
5962 \# *Function:
5963 \#   Toggles register #PRINT_PAGENUM_ON_PAGE_1
5964 \# *Notes:
5965 \#   Lets user choose whether to print page number on first
5966 \#   page of doc and after collate when footers are on or page numbering
5967 \#   has been user set at top of page.
5969 .MAC PAGENUM_ON_FIRST_PAGE END
5970 .    ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
5971 .    el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
5972 .END
5975 \# PRINT HEADER/FOOTER
5976 \# -------------------
5977 \# *Arguments:
5978 \#   <none>
5979 \# *Function:
5980 \#   Based on defaults or values entered by user, prints a
5981 \#   three-part title at either the top or the bottom of the page.
5982 \# *Notes:
5983 \#   Called from within either HEADER or FOOTER.
5985 .MAC PRINT_HDRFTR END
5986 .    if \\n[#DOC_TYPE]=4 \{\
5987 .       nr #SUITE \En[.pn]
5988 .    \}
5989 .    if \\n[#FOOTERS_ON] \{\
5990 .       if \\n[#START_FOR_FOOTERS] \{\
5991 .          rr #START_FOR_FOOTERS
5992 .          if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{ .return \}
5993 .       \}
5994 .    \}
5995 .    if \\n[#HEADERS_ON] \{ .vs 0 \}
5996 .    if \\n[#USERDEF_HDRFTR] \{\
5997 .       PRINT_USERDEF_HDRFTR
5998 .       return
5999 .    \}
6000 .    if \\n[#SWITCH_HDRFTR] \{\
6001 .       ds $HDRFTR_TMP_SWITCH             \\*[$HDRFTR_LEFT]
6002 .       ds $HDRFTR_LEFT                   \\*[$HDRFTR_RIGHT]
6003 .       ds $HDRFTR_RIGHT                  \\*[$HDRFTR_TMP_SWITCH]
6004 .       ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
6005 .       ds $HDRFTR_LEFT_SIZE_CHANGE       \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
6006 .       ds $HDRFTR_RIGHT_SIZE_CHANGE      \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
6007 .       nr #HDRFTR_TMP_CAPS_SWITCH        \\n[#HDRFTR_LEFT_CAPS]
6008 .       nr #HDRFTR_LEFT_CAPS              \\n[#HDRFTR_RIGHT_CAPS]
6009 .       nr #HDRFTR_RIGHT_CAPS             \\n[#HDRFTR_TMP_CAPS_SWITCH]
6010 .       rr #HDRFTR_TMP_CAPS_SWITCH
6011 .       rm $HDRFTR_TMP_SWITCH
6012 .       rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
6013 .       nr #SWITCH_HDRFTR 0
6014 .    \}
6015 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
6016 .    if \\n[#ENDNOTES] \{ .PAGENUM_STYLE \\*[$EN_PN_STYLE] \}
6017 .    if \\n[#PRINT_STYLE]=1 \{\
6018 .       if \\n[#FOOTERS_ON] \{\
6019 .          di NULL
6020 .          SIZESPECS
6021 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6022 .          di
6023 .       \}
6024 .       if o                        \{ .RIGHT \}
6025 .       if e                        \{ .LEFT  \}
6026 .       if \\n[#RECTO_VERSO]=0      \{ .LEFT  \}
6027 .       if \\n[#HDRFTR_LEFT_CAPS]   \{ .CAPS  \}
6028 .       ie '\\*[$HDRFTR_LEFT]'#' \{\
6029 .           PRINT \\n[#PAGENUMBER]
6030 .       \}
6031 .       el \{\
6032 .          ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
6033 .          el \{ .PRINT \& \}
6034 .       \}
6035 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
6036 .       CENTER
6037 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
6038 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
6039 .           PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
6040 .       \}
6041 .       el \{\
6042 .          ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
6043 .          el \{ .PRINT \& \}
6044 .       \}
6045 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
6046 .       if o                       \{ .LEFT  \}
6047 .       if e                       \{ .RIGHT \}
6048 .       if \\n[#RECTO_VERSO]=0     \{ .RIGHT \}
6049 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS  \}
6050 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
6051 .           PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
6052 .       \}
6053 .       el \{\
6054 .          ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \\v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
6055 .          el \{ .PRINT \& \}
6056 .       \}
6057 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
6058 .    \}
6059 .    if \\n[#PRINT_STYLE]=2 \{\
6060 .       FAMILY  \\*[$HDRFTR_LEFT_FAM]
6061 .       FT      \\*[$HDRFTR_LEFT_FT]
6062 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
6063 .       if \\n[#FOOTERS_ON] \{\
6064 .          di NULL
6065 .          SIZESPECS
6066 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6067 .          di
6068 .       \}
6069 .       if o                      \{ .LEFT  \}
6070 .       if e                      \{ .RIGHT \}
6071 .       if \\n[#RECTO_VERSO]=0    \{ .LEFT  \}
6072 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS  \}
6073 .       ie '\\*[$HDRFTR_LEFT]'#' \{ .PRINT \\n[#PAGENUMBER] \}
6074 .       el \{\
6075 .          ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
6076 .          el \{ .PRINT \& \}
6077 .       \}
6078 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
6079 .       FAMILY  \\*[$HDRFTR_CENTER_FAM]
6080 .       FT      \\*[$HDRFTR_CENTER_FT]
6081 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
6082 .       if \\n[#FOOTERS_ON] \{\
6083 .          di NULL
6084 .          SIZESPECS
6085 .          nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
6086 .          di
6087 .       \}
6088 .       CENTER
6089 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
6090 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
6091 .           PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
6092 .       \}
6093 .       el \{\
6094 .          ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
6095 .          el \{ .PRINT \& \}
6096 .       \}
6097 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
6098 .       FAMILY  \\*[$HDRFTR_RIGHT_FAM]
6099 .       FT      \\*[$HDRFTR_RIGHT_FT]
6100 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
6101 .       if \\n[#FOOTERS_ON] \{\
6102 .          di NULL
6103 .          SIZESPECS
6104 .          nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6105 .          di
6106 .       \}
6107 .       if o                       \{ .RIGHT \}
6108 .       if e                       \{ .LEFT  \}
6109 .       if \\n[#RECTO_VERSO]=0     \{ .RIGHT \}
6110 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS  \}
6111 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
6112 .           PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
6113 .       \}
6114 .       el \{\
6115 .          ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \\v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
6116 .          el \{ .PRINT \& \}
6117 .       \}
6118 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
6119 .    \}
6120 .    if \\n[#HDRFTR_RULE] \{\
6121 .       HDRFTR_RULE_INTERNAL
6122 .    \}
6123 .END
6126 \# PRINT USER DEFINED HEADER/FOOTER
6127 \# --------------------------------
6128 \# *Arguments:
6129 \#   <none>
6130 \# *Function:
6131 \#   Based on defaults or values entered by user, prints a single part
6132 \#   (i.e. not 3-part) title at either the top or the bottom of the page.
6133 \# *Notes:
6134 \#   Called from within PRINT_HDRFTR.
6136 .MAC PRINT_USERDEF_HDRFTR END
6137 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
6138 .    fc ^ #
6139 .    if \\n[#PRINT_STYLE]=2 \{\
6140 .       FAMILY  \\*[$HDRFTR_FAM]
6141 .       FT      R
6142 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u
6143 .    \}
6144 .    ie \\n[#RECTO_VERSO] \{\
6145 .       if o \{\
6146 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
6147 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6148 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
6149 .          PRINT \\*[$USERDEF_HDRFTR_RECTO]
6150 .          EL
6151 .          if \\n[#FOOTERS_ON] \{\
6152 .             di NULL
6153 .             SIZESPECS
6154 .             nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6155 .             di
6156 .          \}
6157 .       \}
6158 .       if e \{\
6159 .          ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
6160 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT   \}
6161 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
6162 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT  \}
6163 .          \}
6164 .          PRINT \\*[$USERDEF_HDRFTR_VERSO]
6165 .          EL
6166 .          if \\n[#FOOTERS_ON] \{\
6167 .             di NULL
6168 .             SIZESPECS
6169 .             nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6170 .             di
6171 .          \}
6172 .          el \{\
6173 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
6174 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6175 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
6176 .             PRINT \\*[$USERDEF_HDRFTR_RECTO]
6177 .             EL
6178 .             if \\n[#FOOTERS_ON] \{\
6179 .                di NULL
6180 .                SIZESPECS
6181 .                nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6182 .                di
6183 .             \}
6184 .          \}
6185 .       \}
6186 .    \}
6187 .    el \{\
6188 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
6189 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6190 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
6191 .       PRINT \\*[$USERDEF_HDRFTR_RECTO]
6192 .       EL
6193 .       if \\n[#FOOTERS_ON] \{\
6194 .          di NULL
6195 .          SIZESPECS
6196 .          nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6197 .          di
6198 .       \}
6199 .    \}
6200 .    fc
6201 .    if \\n[#HDRFTR_RULE] \{\
6202 .       HDRFTR_RULE_INTERNAL
6203 .    \}
6204 .END
6207 \# +++HEADERS+++
6209 \# HEADERS (off or on)
6210 \# -------------------
6211 \# *Arguments:
6212 \#   <none> | <anything>
6213 \# *Function:
6214 \#   Turns headers at the top of the page off or on.
6215 \# *Notes:
6216 \#   Default is on.
6218 .MAC HEADERS END
6219 .    ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
6220 .    el \{ .nr #HEADERS_ON 0 \}
6221 .END
6224 \# HEADER MARGIN
6225 \# -------------
6226 \# *Argument:
6227 \#   <amount of space between top of page and header>
6228 \# *Function:
6229 \#   Creates or modifies register #HEADER_MARGIN to hold amount
6230 \#   of space between top of page and header.
6231 \# *Notes:
6232 \#   Requires unit of measure.  Default is 4P+6p, measured top-of-page
6233 \#   to baseline.
6235 .MAC HEADER_MARGIN END
6236 .    nr #HEADER_MARGIN (\\$1)
6237 .END
6240 \# HEADER GAP
6241 \# ----------
6242 \# *Argument:
6243 \#   <amount of space between header and running text>
6244 \# *Function:
6245 \#   Creates or modifies register #HEADER_GAP to hold amount
6246 \#   of space between header and running text.
6247 \# *Notes:
6248 \#   Default is 1P+6p.
6250 .MAC HEADER_GAP END
6251 .    nr #HEADER_GAP (\\$1)
6252 .END
6255 \# HEADER
6256 \# ------
6257 \# *Arguments:
6258 \#   <none>
6259 \# *Function:
6260 \#   Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
6261 \# *Notes:
6262 \#   In order to convert the title string to caps in the header (in the
6263 \#   event that the user enters .TITLE in caps/lc), I've used
6264 \#   quad left, quad centre, and quad right to arrange the three bits
6265 \#   of the header, rather than .tl.  This allows the use of the CAPS macro.
6266 \#   The downside is that I have to add \\v'-(\\n[#LEAD]u*#) in order
6267 \#   for -Tlatin1 output to align the header/footer strings on the baseline.
6268 \#   The console output still isn't brilliant, but at least it's
6269 \#   comprehensible.
6271 .MAC HEADER END
6272 .    PROCESS_FN_LEFTOVER
6273 .    nr #FN_COUNT_FOR_COLS 0 1
6274 .    if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
6275 .    po \\n[#DOC_L_MARGIN]u
6276 .    if \\n[#RECTO_VERSO] \{\
6277 .       if !\\n[#TOC_RV_SWITCH] \{\
6278 .          nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
6279 .          DOC_LEFT_MARGIN  \\n[#DOC_R_MARGIN]u
6280 .          DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
6281 .          SWITCH_HDRFTR_CENTER_PAD
6282 .       \}
6283 .       rr #TOC_RV_SWITCH
6284 .    \}
6285 .    ev HEADER
6286 .    if \\n[#PRINT_STYLE]=1 \{ .vs 0 \}
6287 .    if \\n[#PRINT_STYLE]=2 \{ .LS 0 \}
6288 .    sp |\\n[#HEADER_MARGIN]u-1v
6289 .    ll \\n[#DOC_L_LENGTH]u
6290 .    ta \\n(.lu
6291 .    if \\n[#PRINT_STYLE]=1 \{\
6292 .       fam C
6293 .       ft  R
6294 .       ps  12\\*[$HDRFTR_SIZE_CHANGE]
6295 .    \}
6296 .    if \\n[#PRINT_STYLE]=2 \{\
6297 .      FAMILY  \\*[$HDRFTR_FAM]
6298 .      FT      R
6299 .      PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
6300 .    \}
6301 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
6302 .    if \\n[#CAPS_ON] \{\
6303 .       nr #CAPS_WAS_ON 1
6304 .       CAPS OFF
6305 .    \}
6306 .    if \\n[#UNDERLINE_ON] \{\
6307 .       nr #UNDERLINE_WAS_ON 1
6308 .       UNDERLINE OFF
6309 .    \}
6310 .    if \\n[#PRINT_STYLE]=1 \{\
6311 .       if \\n[#ENDNOTES]=1 \{\
6312 .          if \\n[#EN_SINGLESPACE] \{\   \"Endnotes s-spaced have different lead
6313 .             nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
6314 .             nr #DOC_LEAD \\n[#EN_LEAD]u
6315 .          \}
6316 .       \}
6317 .    \}
6318 .    ie \\n[#HEADERS_ON] \{\
6319 .       PRINT_HDRFTR
6320 .       sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
6321 .    \}
6322 .    el \{\
6323 .       ie \\n[#PAGE_NUM_V_POS]=1 \{\
6324 .          ie \\n[#PAGINATE] \{\
6325 .             PRINT_PAGE_NUMBER
6326 .             sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
6327 .          \}
6328 .          el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
6329 .       \}
6330 .       el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
6331 .    \}
6332 .    if \\n[#PRINT_STYLE]=1 \{\
6333 .       if \\n[#ENDNOTES]=1 \{\
6334 .          if \\n[#EN_SINGLESPACE] \{\
6335 .             nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
6336 .             rr #RESTORE_DOC_LEAD
6337 .          \}
6338 .       \}
6339 .    \}
6340 .    nr #PAGE_TOP \\n(nl
6341 .    ev
6342 .    po \\n[#L_MARGIN]u
6343 .    if \\n[#RECTO_VERSO] \{\
6344 .       nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
6345 .    \}
6346 .    if \\n[#CAPS_WAS_ON] \{\
6347 .       CAPS
6348 .       rr #CAPS_WAS_ON
6349 .    \}
6350 .    if \\n[#UNDERLINE_WAS_ON] \{\
6351 .       UNDERLINE
6352 .       rr #UNDERLINE_WAS_ON
6353 .    \}
6354 .    if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6355 .    if \\n[#QUOTE] \{\
6356 .       ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6357 .       el \{\
6358 .          nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
6359 .          po \\n[#Q_OFFSET]u
6360 .       \}
6361 .    \}
6362 .    if \\n[#EPIGRAPH] \{\
6363 .       ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6364 .       el \{\
6365 .          nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6366 .          po \\n[#EPI_OFFSET]u
6367 .       \}
6368 .    \}
6369 .    ie \\n[#EPIGRAPH] \{\
6370 .       ie !\\n[#EPI_ACTIVE] \{\
6371 .          ns
6372 .          rr #EPI_ACTIVE
6373 .       \}
6374 .       el \{\
6375 .          ie \\n[#EPI_FITS] \{ .ns \}
6376 .          el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
6377 .          \}
6378 .    \}
6379 .    el \{ .ns \}
6380 .    ns
6381 .    if \\n[#COLUMNS] \{\
6382 .       if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
6383 .       nr #COL_NUM 0 1
6384 .       mk dc
6385 .       po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6386 .       ll \\n[#COL_L_LENGTH]u
6387 .       ta \\n(.lu
6388 .       if \\n[#QUOTE] \{\
6389 .          po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
6390 .       \}
6391 .       if \\n[#EPIGRAPH] \{\
6392 .          if \\n[#EPI_ACTIVE] \{\
6393 .             ie \\n[#EPI_FITS] \{ . \}
6394 .             el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
6395 .          \}
6396 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
6397 .       \}
6398 .    \}
6399 .    if \\n[#PRINT_STYLE]=1 \{\
6400 .       if \\n[#SLANT_ON] \{\
6401 .          if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
6402 .       \}
6403 .    \}
6404 .END
6406 \# ====================================================================
6408 \# +++FOOTERS+++
6410 \# FOOTERS (off or on)
6411 \# -------------------
6412 \# *Arguments:
6413 \#   <none> | <anything>
6414 \# *Function:
6415 \#   Turns footers at the bottom of the page off or on.
6416 \# *Notes:
6417 \#   Default is off.  If on, page numbers automatically go at
6418 \#   the top, centered, unless pagination has been turned off,
6419 \#   or the pagenumber position has been changed to left or right.
6421 .MAC FOOTERS END
6422 .    ie '\\$1''   \{\
6423 .       nr #FOOTERS_ON 1
6424 .       PAGE_NUM_POS TOP CENTER
6425 .    \}
6426 .    el \{ .nr #FOOTERS_ON 0 \}
6427 .END
6430 \# FOOTER MARGIN
6431 \# -------------
6432 \# *Argument:
6433 \#   <footer margin>
6434 \# *Function:
6435 \#   Creates or modifies register #FOOTER_MARGIN which holds the
6436 \#   amount of space to leave between the page number and the bottom
6437 \#   of the page.
6438 \# *Notes:
6439 \#   Unit of measure required.  Default is 3P.
6441 .MAC FOOTER_MARGIN END
6442 .    ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
6443 .    el \{ . \}
6444 .END
6447 \# FOOTER GAP
6448 \# ----------
6449 \# *Argument:
6450 \#   <distance from end of running text to page # or footer>
6451 \# *Function:
6452 \#   Creates or modifies register #FOOTER_GAP which holds the
6453 \#   amount of space to leave between running text and the page number.
6454 \# *Notes:
6455 \#   Requires unit of measure.  Default is 3P.  Measured baseline to
6456 \#   baseline.
6458 .MAC FOOTER_GAP END
6459 .    ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
6460 .    el \{ . \}
6461 .END
6464 \# FOOTER
6465 \# ------
6466 \# *Arguments:
6467 \#   <none>
6468 \# *Function:
6469 \#   Places footer at bottom of page if #FOOTERS=1, otherwise
6470 \#   places page number at bottom of page (if #PAGINATE=1).
6471 \#   Page numbers are in arabic or roman according to COPYSTYLE.
6472 \#   DRAFT starts the document at page 1 regardless of PAGENUMBER.
6473 \#   FINAL respects PAGENUMBER.
6475 .MAC FOOTER END
6476 .    ev PAGE_BOTTOM
6477 .    if \\n[#START]=1 \{\
6478 .       bp
6479 .       ev
6480 .       return
6481 .    \}
6482 .    nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
6483 .    if !\\n[#FN_DEFER] \{\
6484 .       nr #DIVER_DEPTH 0
6485 .       if \\n[#FN_COUNT] \{\
6486 .          sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u)
6487 .          po \\n[#DOC_L_MARGIN]u
6488 .          if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
6489 .          nf
6490 .          FOOTNOTES
6491 .          rm FOOTNOTES
6492 .          if '\\n(.z'FN_OVERFLOW' \{\
6493 .              di
6494 .              nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
6495 .          \}
6496 .          nr #FN_COUNT 0
6497 .          if \\n[#COL_NEXT] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
6498 .       \}
6499 .    \}
6500 .    ie \\n[#COLUMNS] \{\
6501 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
6502 .       el \{\
6503 .          ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
6504 .          el \{ .sp |\\n(dcu \}
6505 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6506 .          PROCESS_FN_LEFTOVER
6507 .          if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
6508 .          if !\\n[#QUOTE]    \{ .rr #COL_NEXT \}
6509 .          if \\n[#QUOTE] \{\
6510 .             nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
6511 .             if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
6512 .             po \\n[#Q_OFFSET]u
6513 .          \}
6514 .          if \\n[#EPIGRAPH] \{\
6515 .             nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6516 .             if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
6517 .             po \\n[#EPI_OFFSET]u
6518 .          \}
6519 .          ie \\n[#EPIGRAPH] \{\
6520 .             ie !\\n[#EPI_ACTIVE] \{\
6521 .                ns
6522 .                rr #EPI_ACTIVE
6523 .             \}
6524 .             el \{\
6525 .                sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
6526 .                rr #EPI_ACTIVE
6527 .             \}
6528 .          \}
6529 .          el \{ .ns \}
6530 .          ev
6531 .       \}
6532 .       ns
6533 .    \}
6534 .    el \{ .DO_FOOTER \}
6535 .END
6538 \# PROCESS FOOTER
6539 \# --------------
6540 \# *Arguments:
6541 \#   <none>
6542 \# *Function:
6543 \#   Prints footer (page number, or 3-part footer).
6544 \#   Resets CAPS and UNDERLINE if they were on.
6546 .MAC DO_FOOTER END
6547 .    ie (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
6548 .       nr #SKIP_FOOTER 1
6549 .    \}
6550 .    el \{\
6551 .       sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
6552 .    \}
6553 .    ev FOOTER
6554 .    po \\n[#DOC_L_MARGIN]u
6555 .    ll \\n[#DOC_L_LENGTH]u
6556 .    ta \\n(.lu
6557 .    FAMILY  \\*[$HDRFTR_FAM]
6558 .    FT      R
6559 .    PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
6560 .    if \\n[#PRINT_STYLE]=1 \{\
6561 .       fam C
6562 .       ft  R
6563 .       ps  12
6564 .    \}
6565 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
6566 .    if \\n[#CAPS_ON] \{\
6567 .       nr #CAPS_WAS_ON 1
6568 .       CAPS OFF
6569 .    \}
6570 .    if \\n[#UNDERLINE_ON] \{\
6571 .       nr #UNDERLINE_WAS_ON 1
6572 .       UNDERLINE OFF
6573 .    \}
6574 .    ie \\n[#FOOTERS_ON] \{\
6575 .       if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_HDRFTR \}
6576 .    \}
6577 .    el \{\
6578 .       if \\n[#PAGINATE] \{\
6579 .          if \\n[#PAGE_NUM_V_POS]=2 \{\
6580 .             if !\\n[#SKIP_FOOTER]=1 \{ .PRINT_PAGE_NUMBER \}
6581 .          \}
6582 .       \}
6583 .    \}
6584 .    rr #SKIP_FOOTER
6585 .    if \\n[#CAPS_WAS_ON] \{\
6586 .       CAPS
6587 .       rr #CAPS_WAS_ON
6588 .    \}
6589 .    if \\n[#UNDERLINE_WAS_ON] \{\
6590 .       UNDERLINE
6591 .       rr #UNDERLINE_WAS_ON
6592 .    \}
6593 .    ev
6594 .    bp
6595 .    ev
6596 .END
6598 \# ====================================================================
6600 \# +++HEADS+++
6602 \# ---Head numbers---
6604 \# NUMBER HEADS
6605 \# ------------
6606 \# *Arguments:
6607 \#   <none> | <anything>
6608 \# *Function:
6609 \#   Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
6610 \# *Notes:
6611 \#   Default is OFF.
6613 .MAC NUMBER_HEADS END
6614 .    ie '\\$1'' \{\
6615 .       nr #NUMBER_HEAD 1
6616 .       if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
6617 .    \}
6618 .    el \{ .rr #NUMBER_HEAD \}
6619 .END
6622 \# RESET HEAD NUMBER
6623 \# -----------------
6624 \# *Arguments:
6625 \#   <none> | <desired head number>
6626 \# *Function:
6627 \#   Resets incrementing register #HEAD_NUM to 1 or, if there's
6628 \#   an argument, to user supplied number.
6629 \# *Notes:
6630 \#   Also resets subhead and parahead numbers.  If this is not
6631 \#   desired, subhead and parahead numbers may be reset individually.
6633 .MAC RESET_HEAD_NUMBER END
6634 .    ie '\\$1'' \{\
6635 .       nr #HEAD_NUM 0 1
6636 .       nr #SH_NUM   0 1
6637 .       nr #PH_NUM   0 1
6638 .    \}
6639 .    el \{\
6640 .       nr #HEAD_NUM \\$1-1 1
6641 .       nr #SH_NUM   0 1
6642 .       nr #PH_NUM   0 1
6643 .    \}
6644 .END
6647 \# NUMBER SUBHEADS
6648 \# ---------------
6649 \# *Arguments:
6650 \#   <none> | <anything>
6651 \# *Function:
6652 \#   Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
6653 \# *Notes:
6654 \#   Default is OFF.
6656 .MAC NUMBER_SUBHEADS END
6657 .    ie '\\$1'' \{\
6658 .       nr #NUMBER_SH 1
6659 .       if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
6660 .    \}
6661 .    el \{ .rr #NUMBER_SH \}
6662 .END
6665 \# RESET SUBHEAD NUMBER
6666 \# --------------------
6667 \# *Arguments:
6668 \#   <none> | <desired subhead number>
6669 \# *Function:
6670 \#   Resets incrementing register #SH_NUM to 1 or, if there's
6671 \#   an argument, to user supplied number.
6672 \# *Notes:
6673 \#   When the subhead number is reset, it resets the parahead number as
6674 \#   well.  If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
6675 \#   allows the user to set the parahead number to whatever s/he desires.
6677 .MAC RESET_SUBHEAD_NUMBER END
6678 .    ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
6679 .    el \{\
6680 .       nr #SH_NUM \\$1-1 1
6681 .       nr #PH_NUM 0 1
6682 .       \}
6683 .END
6686 \# NUMBER PARAHEADS
6687 \# ----------------
6688 \# *Arguments:
6689 \#   <none> | <anything>
6690 \# *Function:
6691 \#   Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
6692 \# *Notes:
6693 \#   Default is OFF.
6695 .MAC NUMBER_PARAHEADS END
6696 .    ie '\\$1'' \{\
6697 .       nr #NUMBER_PH 1
6698 .       if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
6699 .    \}
6700 .    el \{ .rr #NUMBER_PH \}
6701 .END
6704 \# RESET PARAHEAD NUMBER
6705 \# ---------------------
6706 \# *Arguments:
6707 \#   <none> | <desired parahead number>
6708 \# *Function:
6709 \#   Resets incrementing register #PH_NUM to 1 or, if there's
6710 \#   an argument, to user supplied number.
6711 \# *Notes:
6712 \#   Resetting the parahead number resets the parahead number
6713 \#   only.
6715 .MAC RESET_PARAHEAD_NUMBER END
6716 .    ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
6717 .    el \{ nr #SH_NUM \\$1-1 1 \}
6718 .END
6721 \# ---Main heads---
6723 \# HEAD FAMILY
6724 \# -----------
6725 \# *Argument:
6726 \#   <family to use for section titles (main heads)>
6727 \# *Function:
6728 \#   Creates or modifies string $HEAD_FAM.
6729 \# *Notes:
6730 \#   Default is same as running text.
6732 .MAC HEAD_FAMILY END
6733 .    ds $HEAD_FAM \\$1
6734 .END
6737 \# HEAD FONT
6738 \# ---------
6739 \# *Argument:
6740 \#   <font to use for section titles (main heads)>
6741 \# *Function:
6742 \#   Creates or modifies string $HEAD_FT.
6743 \# *Notes:
6744 \#   Default is bold.
6746 .MAC HEAD_FONT END
6747 .    ds $HEAD_FT \\$1
6748 .END
6751 \# HEAD SIZE
6752 \# ---------
6753 \# *Argument:
6754 \#   <+|- number of points by which to in/decrease point size of
6755 \#   section titles (relative to running text)>
6756 \# *Function:
6757 \#   Creates or modifies string $HEAD_SIZE_CHANGE.
6758 \# *Notes:
6759 \#   Must be preceded by a - or + sign with no space afterwards.
6760 \#   Fractional point sizes are allowed.
6761 \#   Default +1 for printstyle TYPESET; +0 for TYPEWRITE.
6763 .MAC HEAD_SIZE END
6764 .    ds $HEAD_SIZE_CHANGE \\$1
6765 .END
6768 \# HEAD QUAD
6769 \# ---------
6770 \# *Arguments:
6771 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE
6772 \# *Function:
6773 \#   Creates or modifies string $HEAD_QUAD.
6774 \# *Notes:
6775 \#   Default is CENTER.
6777 .MAC HEAD_QUAD END
6778 .    ds $HEAD_QUAD \\$1
6779 .END
6782 \# HEAD CAPS
6783 \# ---------
6784 \# *Arguments:
6785 \#   <none> | <anything>
6786 \# *Function:
6787 \#   Creates or modifies register #HEAD_CAPS.
6788 \# *Notes:
6789 \#   Default is on.
6791 .MAC HEAD_CAPS END
6792 .    ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
6793 .    el \{ .nr #HEAD_CAPS 0 \}
6794 .END
6797 \# HEAD SPACE
6798 \# ----------
6799 \# *Arguments:
6800 \#   <none> | <anything>
6801 \# *Function:
6802 \#   Creates register #HEAD_SPACE, which toggles whether the space
6803 \#   before heads is 1 extra line space ("off") or 2 ("on").  Used only
6804 \#   in PRINTSTYLE TYPESET.
6805 \# *Notes:
6806 \#   Default is on.
6808 .MAC HEAD_SPACE END
6809 .    ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
6810 .    el \{ .nr #HEAD_SPACE 0 \}
6811 .END
6814 \# HEAD UNDERLINE
6815 \# --------------
6816 \# *Arguments:
6817 \#   <none> | <anything>
6818 \# *Function:
6819 \#   Creates or modifies register #HEAD_UNDERLINE.
6820 \# *Notes:
6821 \#   Default is on.
6823 .MAC HEAD_UNDERLINE END
6824 .    ie '\\$1'' \{ .nr #HEAD_UNDERLINE 1 \}
6825 .    el \{ .nr #HEAD_UNDERLINE 0 \}
6826 .END
6829 \# MAIN HEAD
6830 \# ---------
6831 \# *Arguments:
6832 \#   "text of main head" ["text of main head"] ...
6833 \# *Function:
6834 \#   In TYPEWRITE, prints main heads centered, all caps, underlined.
6835 \#   In TYPESET, prints bold main heads 1 point larger than running
6836 \#   text, all caps, underlined.
6837 \# *Notes:
6838 \#   The HEAD macro requires that double-quotes (") surround
6839 \#   each line of text.
6841 .MAC HEAD END
6842 .    br
6843 \# Collect head for TOC.
6844 .    nr #ARG_NUM 0 1
6845 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
6846 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
6847 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6848 .       ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
6849 .          as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\\|
6850 .       \}
6851 .       el \{\
6852 \# Note that in the .as lines, below, \ at the end has a literal
6853 \# space after it.
6854 .          ie \\n[#NUMBER_HEAD] \{\
6855 .             ie \\n[#ARG_NUM]=0 \{\
6856 .                as $TOC_HEAD_ITEM \\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\ 
6857 .                nr #HEAD_NUM \\n-[#HEAD_NUM]
6858 .             \}
6859 .             el \{\
6860 .                as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ 
6861 .             \}
6862 .          \}
6863 .          el \{\
6864 .             as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ 
6865 .          \}
6866 .       \}
6867 .    \}
6868 \# Note the use of \!, which transparently embeds the macros used
6869 \# in the TOC_ENTRIES diversion.  The elements they control must be
6870 \# processed literally when the diversion is output.
6871 .    ev TOC_EV
6872 .    da TOC_ENTRIES
6873 .    if \\n[#PRINT_STYLE]=1 \{\
6874 \!.     fam C
6875 \!.     ft  R
6876 \!.     ps  12
6877 .    \}
6878 .    if \\n[#PRINT_STYLE]=2 \{\
6879 \!.     FAMILY  \\*[$TOC_HEAD_FAM]
6880 \!.     FT      \\*[$TOC_HEAD_FT]
6881 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
6882 .    \}
6883 \!.  TRAP OFF
6884 .    ie \\n[#PRINT_STYLE]=1 \{\
6885 \!.     PAD "\\h'2m'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN_TYPEWRITE]"
6886 .    \}
6887 .    el \{\
6888 \!.     PAD "\\h'\\n[#TOC_HEAD_INDENT]u'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN]"
6889 .    \}
6890 \!.  EL
6891 \!.  ST 100 L
6892 \!.  ST 101 R
6893 .    if \\n[#PRINT_STYLE]=2 \{\
6894 \!.     FAMILY  \\*[$TOC_PN_FAM]
6895 \!.     FT      \\*[$TOC_PN_FT]
6896 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
6897 .    \}
6898 \!.  TAB 100
6899 \!.  PRINT \\*[LEADER]
6900 \!.  TN
6901 \!.  TRAP
6902 \!.  PRINT \\n[#TOC_ENTRY_PN]
6903 \!.  TQ
6904 .    di       
6905 .    ev
6906 \# End collection of head for TOC
6907 \# Process head
6908 .    nr #HEAD 1
6909 .    ev HEAD
6910 .    ll \\n[#L_LENGTH]u
6911 .    ta \\n(.lu
6912 .    if \\n[#COLUMNS] \{\
6913 .       ll \\n[#COL_L_LENGTH]u
6914 .       ta \\n(.lu
6915 .    \}
6916 .    CHECK_INDENT
6917 .    QUAD \\*[$HEAD_QUAD]
6918 .    if \\n[#PRINT_STYLE]=1 \{\
6919 .       fam C
6920 .       ft  R
6921 .       ps  12
6922 .       vs  \\n[#DOC_LEAD]u
6923 .       UNDERLINE OFF
6924 .    \}
6925 .    if \\n[#PRINT_STYLE]=2 \{\
6926 .       FAMILY  \\*[$HEAD_FAM]
6927 .       FT      \\*[$HEAD_FT]
6928 .       PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
6929 .       LS      \\n[#DOC_LEAD]u
6930 .    \}
6931 .    if r#QUOTE             \{ .rr #QUOTE \}
6932 .    if r#EPIGRAPH          \{ .rr #EPIGRAPH \}
6933 .    if \\n[#PRINT_STYLE]=1 \{ .ne 3 \}
6934 .    if \\n[#PRINT_STYLE]=2 \{\
6935 .       ie \\n[#HEAD_SPACE] \{ .ne 4 \}
6936 .       el \{ .ne 3 \}
6937 .    \}
6938 .    ie \\n[#START] \{\
6939 .       if \\n[#DOC_HEADER]=0 \{ . \}
6940 .    \}
6941 .    el \{\
6942 .       if \\n[#PRINT_STYLE]=1 \{\
6943 .          if !\\n[#LINEBREAK] \{\
6944 .             ALD \\n[#DOC_LEAD]u
6945 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6946 .          \}
6947 .       \}
6948 .       if \\n[#PRINT_STYLE]=2 \{\
6949 .          ie \\n[#PP_SPACE] \{\
6950 .             ie \\n[#END_QUOTE] \{ . \}
6951 .             el \{\
6952 .                if !\\n[#LINEBREAK] \{\
6953 .                   if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6954 .                \}
6955 .             \}
6956 .          \}
6957 .          el \{\
6958 .             ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
6959 .             el \{ .ALD \\n[#DOC_LEAD]u \}
6960 .          \}
6961 .          if \\n[#END_QUOTE] \{\
6962 .             if !\\n[#Q_FITS] \{\
6963 .                RLD \\n[#DOC_LEAD]u
6964 .                if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
6965 .             \}
6966 .             if \\n[#Q_AT_TOP] \{\
6967 .                RLD \\n[#DOC_LEAD]u
6968 .                if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
6969 .             \}
6970 .          \}
6971 .          if \\n[#LINEBREAK] \{\
6972 .             if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
6973 .          \}
6974 .       \}
6975 .    \}
6976 \# Print head
6977 .    nr #ARG_NUM 0 1
6978 .    if \\n[#HEAD_CAPS] \{ .CAPS \}
6979 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6980 .       ie \\n[#NUMBER_HEAD] \{\
6981 .          ie \\n[#ARG_NUM]=0 \{\
6982 .             br
6983 .             ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
6984 .             el \{ .UNDERSCORE "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
6985 .             br
6986 .          \}
6987 .          el \{\
6988 .             br
6989 .             ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
6990 .             el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
6991 .             br
6992 .          \}
6993 .       \}
6994 .       el \{\
6995 .          br
6996 .          ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
6997 .          el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
6998 .          br
6999 .       \}
7000 .    \}
7001 .    REMOVE_INDENT
7002 .    CAPS OFF
7003 .    ev
7004 .    ALD \\n[#DOC_LEAD]u
7005 .    RESET_SUBHEAD_NUMBER
7006 .    RESET_PARAHEAD_NUMBER
7007 .    if r#START      \{ .rr #START     \}
7008 .    if r#EPIGRAPH   \{ .rr #EPIGRAPH  \}
7009 .    if r#QUOTE      \{ .rr #QUOTE     \}
7010 .    if r#Q_FITS     \{ .rr #Q_FITS    \}
7011 .    if r#END_QUOTE  \{ .rr #END_QUOTE \}
7012 .    if r#LINEBREAK  \{ .rr #LINEBREAK \}
7013 .    if r#Q_AT_TOP   \{ .rr #Q_AT_TOP  \}
7014 .    if r#PP_ACTIVE  \{ .rr #PP_ACTIVE \}
7015 .    rr #ARG_NUM
7016 .    rm $TOC_HEAD_ITEM
7017 .    nr #PP 0
7018 .END
7021 \# ---Subheads---
7023 \# SUBHEAD FAMILY
7024 \# --------------
7025 \# *Argument:
7026 \#   <family to use in subheads>
7027 \# *Function:
7028 \#   Creates or modifies string $SH_FAM.
7029 \# *Notes:
7030 \#   Default is same as running text.
7032 .MAC SUBHEAD_FAMILY END
7033 .    ds $SH_FAM \\$1
7034 .END
7037 \# SUBHEAD FONT
7038 \# --------------
7039 \# *Argument:
7040 \#   <font to use in subheads>
7041 \# *Function:
7042 \#   Creates or modifies string $SH_FT.
7043 \# *Notes:
7044 \#   Default is bold.
7046 .MAC SUBHEAD_FONT END
7047 .    ds $SH_FT \\$1
7048 .END
7051 \# SUBHEAD SIZE
7052 \# ------------
7053 \# *Argument:
7054 \#   <+|- number of points by which to in/decrease point size of subheads
7055 \#   (relative to running text)>
7056 \# *Function:
7057 \#   Creates or modifies string $SH_SIZE_CHANGE.
7058 \# *Notes:
7059 \#   Must be preceded by a +|- sign.  No space afterwards.
7060 \#   Fractional point sizes are allowed.
7061 \#   Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
7063 .MAC SUBHEAD_SIZE END
7064 .    ds $SH_SIZE_CHANGE \\$1
7065 .END
7068 \# SUBHEAD QUAD
7069 \# ------------
7070 \# *Argument:
7071 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE
7072 \# *Function:
7073 \#   Creates or modifies string $SH_QUAD.
7074 \# *Notes:
7075 \#   Default is LEFT for both TYPESET and TYPEWRITE.
7077 .MAC SUBHEAD_QUAD END
7078 .    ds $SH_QUAD \\$1
7079 .END
7082 \# SUBHEAD
7083 \# -------
7084 \# *Arguments:
7085 \#   "text of subhead" ["text of subhead"] ...
7086 \# *Function:
7087 \#   In TYPEWRITE, prints subheads underlined.
7088 \#   In TYPESET, prints subheads bold, .5 points larger than running
7089 \#   text.
7090 \#   In both styles, a line space precedes the subhead, and a small
7091 \#   amount of lead comes after.
7092 \# *Notes:
7093 \#   As with the HEAD macro, double-quotes (") must surround
7094 \#   each line of text.
7096 .MAC SUBHEAD END
7097 .    br
7098 \# Collect subhead for TOC.
7099 .    nr #ARG_NUM 0 1
7100 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7101 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7102 .       ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
7103 .          as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\\|
7104 .       \}
7105 .       el \{\
7106 \# Note that in the .as lines, below, \ at the end has a literal
7107 \# space after it.
7108 .          ie \\n[#NUMBER_SH] \{\
7109 .             ie \\n[#ARG_NUM]=0 \{\
7110 .                as $TOC_SH_ITEM \\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]\ 
7111 .                nr #SH_NUM \\n-[#SH_NUM]
7112 .             \}
7113 .             el \{\
7114 .                as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ 
7115 .             \}
7116 .          \}
7117 .          el \{\
7118 .             as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ 
7119 .          \}
7120 .       \}
7121 .    \}
7122 \# Note the use of \!, which transparently embeds the macros used
7123 \# in the TOC_ENTRIES diversion.  The elements they control must be
7124 \# processed literally when the diversion is output.
7125 .    ev TOC_EV
7126 .    da TOC_ENTRIES
7127 .    if \\n[#PRINT_STYLE]=1 \{\
7128 \!.     fam C
7129 \!.     ft  R
7130 \!.     ps  12
7131 .    \}
7132 .    if \\n[#PRINT_STYLE]=2 \{\
7133 \!.     FAMILY  \\*[$TOC_SH_FAM]
7134 \!.     FT      \\*[$TOC_SH_FT]
7135 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
7136 .    \}
7137 \!.  TRAP OFF
7138 .    ie \\n[#PRINT_STYLE]=1 \{\
7139 \!.     PAD "\\h'4m'\\*[$TOC_SH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
7140 .    \}
7141 .    el \{\
7142 \!.     PAD "\\h'\\n[#TOC_SH_INDENT]u'\\*[$TOC_SH_ITEM]\\*[$TOC_PN]"
7143 .    \}
7144 \!.  EL
7145 \!.  ST 100 L
7146 \!.  ST 101 R
7147 .    if \\n[#PRINT_STYLE]=2 \{\
7148 \!.     FAMILY  \\*[$TOC_PN_FAM]
7149 \!.     FT      \\*[$TOC_PN_FT]
7150 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7151 .    \}
7152 \!.  TAB 100
7153 \!.  PRINT \\*[LEADER]
7154 \!.  TN
7155 \!.  TRAP
7156 \!.  PRINT \\n[#TOC_ENTRY_PN]
7157 \!.  TQ
7158 .    di       
7159 .    ev
7160 \# End collection of head for TOC
7161 \# Process subhead
7162 .    nr #ARG_NUM 0 1
7163 .    if r#QUOTE    \{ .rr #QUOTE    \}
7164 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7165 .    ev SUBHEAD
7166 .    ll \\n[#L_LENGTH]u
7167 .    ta \\n(.lu
7168 .    if \\n[#COLUMNS] \{\
7169 .       ll \\n[#COL_L_LENGTH]u
7170 .       ta \\n(.lu
7171 .    \}
7172 .    CHECK_INDENT
7173 .    if \\n[#PRINT_STYLE]=1 \{\
7174 .       fam C
7175 .       ft  R
7176 .       ps  12
7177 .       vs  \\n[#DOC_LEAD]u
7178 .       QUAD   \\*[$SH_QUAD]
7179 .       UNDERLINE OFF
7180 .    \}
7181 .    if \\n[#PRINT_STYLE]=2 \{\
7182 .       FAMILY  \\*[$SH_FAM]
7183 .       FT      \\*[$SH_FT]
7184 .       PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
7185 .       LS      \\n[#DOC_LEAD]u
7186 .       QUAD    \\*[$SH_QUAD]
7187 .    \}
7188 .    if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
7189 .    if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
7190 .    ie \\n[#START] \{ . \}
7191 .    el \{\
7192 .       ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]u*2u) ) \{\
7193 .          ie \\n[#COLUMNS] \{ .COL_NEXT \}
7194 .          el \{ .bp \}
7195 .       \}
7196 .       el \{\
7197 .          ie \\n[#HEAD]=1 \{ . \}
7198 .          el \{\
7199 .             if \\n[#PRINT_STYLE]=1 \{\
7200 .                if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7201 .             \}
7202 .             if \\n[#PRINT_STYLE]=2 \{\
7203 .                ie \\n[#PP_SPACE]=1 \{\
7204 .                   ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7205 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
7206 .                \}
7207 .                el \{\
7208 .                   if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7209 .                \}
7210 .             \}
7211 .          \}
7212 .       \}
7213 .    \}
7214 \# Print subhead
7215 .    if \\n[#PRINT_STYLE]=1 \{\
7216 .       while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7217 .          ie \\n[#NUMBER_SH] \{\
7218 .             ie \\n[#ARG_NUM]=0 \{\
7219 .                ie \\n[#NUMBER_HEAD] \{\
7220 .                   br
7221 .                   UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
7222 .                   br
7223 .                \}
7224 .                el \{\
7225 .                   br
7226 .                   UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
7227 .                   br
7228 .                \}
7229 .             \}
7230 .             el \{\
7231 .                br
7232 .                ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
7233 .                el \{ .UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
7234 .                br
7235 .             \}
7236 .          \}
7237 .          el \{\
7238 .             br
7239 .             UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7240 .             br
7241 .          \}
7242 .       \}
7243 .    \}
7244 .    if \\n[#PRINT_STYLE]=1 \{\
7245 .       if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
7246 .    \}
7247 .    if \\n[#PRINT_STYLE]=2 \{\
7248 .       ie \\n[#PP_SPACE]=0 \{\
7249 .          while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7250 .             ie \\n[#NUMBER_SH] \{\
7251 .                ie \\n[#ARG_NUM]=0 \{\
7252 .                   ie \\n[#NUMBER_HEAD] \{\
7253 .                      br
7254 .                      PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
7255 .                      br
7256 .                   \}
7257 .                   el \{\
7258 .                      br
7259 .                      PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
7260 .                      br
7261 .                   \}
7262 .                \}
7263 .                el \{\
7264 .                   br
7265 .                   PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7266 .                   br
7267 .                \}
7268 .             \}
7269 .             el \{\
7270 .                br
7271 .                PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7272 .                br
7273 .             \}
7274 .          \}
7275 .       \}
7276 .       el \{\
7277 .          ALD \\n[#DOC_LEAD]u
7278 .          if \\n[#HEAD]=1      \{ .RLD \\n[#DOC_LEAD]u \}
7279 .          if \\n[#END_QUOTE]   \{ .RLD \\n[#DOC_LEAD]u \}
7280 .          if \\n[#EPIGRAPH]    \{ .RLD \\n[#DOC_LEAD]u \}
7281 .          while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7282 .             PRINT "\\$[\\n+[#ARG_NUM]]
7283 .          \}
7284 .          ALD \\n[#DOC_LEAD]u
7285 .       \}
7286 .    \}
7287 .    REMOVE_INDENT
7288 .    ev
7289 .    RESET_PARAHEAD_NUMBER
7290 .    if r#START     \{ .rr #START     \}
7291 .    if r#EPIGRAPH  \{ .rr #EPIGRAPH  \}
7292 .    if r#Q_FITS    \{ .rr #Q_FITS    \}
7293 .    if r#END_QUOTE \{ .rr #END_QUOTE \}
7294 .    if r#LINEBREAK \{ .rr #LINEBREAK \}
7295 .    rm $TOC_SH_ITEM
7296 .    nr #PP 0
7297 .    nr #HEAD 2
7298 .END
7300 \# ---Paragraph heads---
7302 \# PARAHEAD FAMILY
7303 \# ---------------
7304 \# *Argument:
7305 \#   <family to use in paraheads>
7306 \# *Function:
7307 \#   Creates or modifies string $PH_FAM.
7308 \# *Notes:
7309 \#   Default is same as running text.
7311 .MAC PARAHEAD_FAMILY END
7312 .    ds $PH_FAM \\$1
7313 .END
7316 \# PARAHEAD FONT
7317 \# -------------
7318 \# *Argument:
7319 \#   <font to use in paraheads>
7320 \# *Function:
7321 \#   Creates or modifies string $PH_FT.
7322 \# *Notes:
7323 \#   Default is bold italic for TYPESET; underlined for TYPEWRITE.
7325 .MAC PARAHEAD_FONT END
7326 .    ds $PH_FT \\$1
7327 .END
7330 \# PARAHEAD SIZE
7331 \# -------------
7332 \# *Argument:
7333 \#   <+|- number of points by which to in/decrease point size of subheads
7334 \#   (relative to running text)>
7335 \# *Function:
7336 \#   Creates or modifies string $PH_SIZE_CHANGE.
7337 \# *Notes:
7338 \#   Must be preceded by a +|- sign.  No space afterwards.
7339 \#   Fractional point sizes are allowed.  No unit of measure, please.
7340 \#   Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
7342 .MAC PARAHEAD_SIZE END
7343 .    ds $PH_SIZE_CHANGE \\$1
7344 .END
7347 \# PARAHEAD INDENT
7348 \# ---------------
7349 \# *Argument:
7350 \#   <size of indent>
7351 \# *Function:
7352 \#   Creates or modifies register #PH_INDENT.
7353 \# *Notes:
7354 \#   Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
7356 .MAC PARAHEAD_INDENT END
7357 .    nr #PH_INDENT (\\$1)
7358 .END
7361 \# PARAHEAD
7362 \# --------
7363 \# *Arguments:
7364 \#   "<para head>"
7365 \# *Function:
7366 \#   Deposits a paragraph head at the start and into the body of a
7367 \#   paragraph.
7368 \# *Notes:
7369 \#   PARAHEAD *must* come after PP.
7371 .MAC PARAHEAD END
7372 \# Collect parahead for TOC.
7373 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7374 .    ie \\n[#NUMBER_PH] \{\
7375 .       ds $TOC_PH_ITEM \\n+[#PH_NUM].\0\\$1\\|
7376 .       nr #PH_NUM \\n-[#PH_NUM]
7377 .    \}
7378 .    el \{\
7379 .       ds $TOC_PH_ITEM \\$1\\|
7380 .    \}
7381 .    ev TOC_EV
7382 .    da TOC_ENTRIES
7383 .    if \\n[#PRINT_STYLE]=1 \{\
7384 \!.       fam C
7385 \!.       ft  R
7386 \!.       ps  12
7387 .    \}
7388 .    if \\n[#PRINT_STYLE]=2 \{\
7389 \!.     FAMILY  \\*[$TOC_PH_FAM]
7390 \!.     FT      \\*[$TOC_PH_FT]
7391 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PH_SIZE_CHANGE]
7392 .    \}
7393 \!.  TRAP OFF
7394 .    ie \\n[#PRINT_STYLE]=1 \{\
7395 \!.     PAD "\\h'6m'\\*[$TOC_PH_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
7396 .    \}
7397 .    el \{\
7398 \!.     PAD "\\h'\\n[#TOC_PH_INDENT]u'\\*[$TOC_PH_ITEM]\\*[$TOC_PN]"
7399 .    \}
7400 \!.  EL
7401 \!.  ST 100 L
7402 \!.  ST 101 R
7403 .    if \\n[#PRINT_STYLE]=2 \{\
7404 \!.     FAMILY  \\*[$TOC_PN_FAM]
7405 \!.     FT      \\*[$TOC_PN_FT]
7406 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7407 .    \}
7408 \!.  TAB 100
7409 \!.  PRINT \\*[LEADER]
7410 \!.  TN
7411 \!.  TRAP
7412 \!.  PRINT \\n[#TOC_ENTRY_PN]
7413 \!.  TQ
7414 .    di       
7415 .    ev
7416 \# End collection of parahead for TOC
7417 \# Process parahead
7418 .    if \\n[#SLANT_ON] \{\
7419 .       nr #SLANT_WAS_ON 1
7420 \E*[SLANTX]
7421 .    \}
7422 .    ie \\n[#PP]=1 \{\
7423 .       if \\n[#INDENT_FIRST_PARAS] \{\
7424 .          ti \\n[#PH_INDENT]u
7425 .       \}
7426 .    \}
7427 .    el \{ .ti \\n[#PH_INDENT]u \}
7428 .    if \\n[#PRINT_STYLE]=1 \{\
7429 .       fam C
7430 .       ft  R
7431 .       ps  12
7432 .       UNDERLINE OFF
7433 .       ie \\n[#NUMBER_PH] \{\
7434 .          if \\n[#NUMBER_HEAD] \{\
7435 .             ie \\n[#NUMBER_SH] \{\
7436 .                UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
7438 .             \}
7439 .             el \{\
7440 .                UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1
7442 .             \}
7443 .          \}
7444 .          ie \\n[#NUMBER_SH] \{\
7445 .             if !\\n[#NUMBERED] \{\
7446 .                UNDERSCORE "\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1
7448 .             \}
7449 .          \}
7450 .          el \{\
7451 .             if !\\n[#NUMBERED] \{\
7452 .                UNDERSCORE "\\n+[#PH_NUM].\\ \\$1
7454 .             \}
7455 .          \}
7456 .       \}
7457 .       el \{\
7458 .          UNDERSCORE "\\$1
7460 .       \}
7461 .       if \\n[#SLANT_WAS_ON] \{\
7462 .          if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
7463 .          if \\n[#SLANT_MEANS_SLANT] \{\
7464 \E*[SLANT]\c
7465 .          \}
7466 .          rr #SLANT_WAS_ON
7467 .       \}
7468 .    \}
7469 .    if \\n[#PRINT_STYLE]=2 \{\
7470 .       FAM     \\*[$PH_FAM]
7471 .       FT      \\*[$PH_FT]
7472 .       PT_SIZE \\*[$PH_SIZE_CHANGE]
7473 .       ie \\n[#NUMBER_PH] \{\
7474 .          if \\n[#NUMBER_HEAD] \{\
7475 .             ie \\n[#NUMBER_SH] \{\
7476 .                PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7477 .             \}
7478 .             el \{\
7479 .                PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7480 .             \}
7481 .          \}
7482 .          ie \\n[#NUMBER_SH] \{\
7483 .             if !\\n[#NUMBERED] \{\
7484 .                PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7485 .             \}
7486 .          \}
7487 .          el \{\
7488 .             if !\\n[#NUMBERED] \{\
7489 .                PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7490 .             \}
7491 .          \}
7492 .       \}
7493 .       el \{\
7494 .          PRINT "\\$1\h'.6m'\c"
7495 .       \}
7496 .       FAMILY  \\*[$DOC_FAM]
7497 .       FT      \\*[$PP_FT]
7498 .       PT_SIZE \\n[#DOC_PT_SIZE]u
7499 .       if \\n[#SLANT_WAS_ON] \{\
7500 .          rr #SLANT_WAS_ON 1
7501 \E*[SLANT]\c
7502 .       \}
7503 .    \}
7504 .    rr #NUMBERED
7505 .    rm $TOC_PH_ITEM
7506 .END
7509 \# ====================================================================
7511 \# +++LINE BREAKS+++
7513 \# LINEBREAK CHARACTER
7514 \# -------------------
7515 \# *Arguments:
7516 \#   [character] [iterations] [vertical adjustment]
7517 \# *Function:
7518 \#   Allows user to specify a line break character and the number
7519 \#   of times to repeat it horiontally.
7520 \# *Notes:
7521 \#   Without an argument, LINEBREAK_CHAR will deposit a blank line.
7523 \#   Vertical adjustment requires a unit of measure (most likely
7524 \#   "p"), and has to be preceded by +|-
7526 .MAC LINEBREAK_CHAR END
7527 .    nr #REPEAT 1
7528 .    ds $LINEBREAK_CHAR \\$1
7529 .    ds $LINEBREAK_CHAR_V_ADJ \\$3
7530 .    if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
7531 .       ds $LINEBREAK_CHAR_V_ADJ +0
7532 .    \}
7533 .    while \\$2>\\n[#REPEAT] \{\
7534 .       as $LINEBREAK_CHAR "\\ \\$1
7535 .       nr #REPEAT \\n[#REPEAT]+1
7536 .    \}
7537 .   rr #REPEAT
7538 .END
7541 \# LINE BREAK
7542 \# ----------
7543 \# *Arguments:
7544 \#   <none>
7545 \# *Function:
7546 \#   Deposits line break character.
7547 \# *Notes:
7548 \#   If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
7550 .MAC LINEBREAK END
7551 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7552 .    po \\n[#DOC_L_MARGIN]u
7553 .    ie  '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
7554 .    el \{\
7555 .       if \\n[#PRINT_STYLE]=1 \{\
7556 .          ie \\n[#END_QUOTE] \{ . \}
7557 .          el \{ .ALD \\n[#DOC_LEAD]u \}
7558 .       \}
7559 .       if \\n[#PRINT_STYLE]=2 \{\
7560 .          ie \\n[#END_QUOTE] \{ . \}
7561 .          el \{ .ALD \\n[#DOC_LEAD]u \}
7562 .       \}
7563 .       CENTER
7564 .       PRINT \\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'
7565 .       if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
7566 .       if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
7567 .       QUAD \\*[$DOC_QUAD]
7568 .    \}
7569 .    nr #LINEBREAK 1
7570 .    if r#QUOTE     \{ .rr #QUOTE     \}
7571 .    if r#END_QUOTE \{ .rr #END_QUOTE \}
7572 .    nr #PP 0
7573 .END
7575 \# ====================================================================
7577 \# +++PARAGRAPHS+++
7579 \# PARAGRAPH FONT
7580 \# --------------
7581 \# *Argument:
7582 \#   <font of running text>
7583 \# *Function:
7584 \#   Creates or modifies string $PP_FT.
7585 \# *Notes:
7586 \#   Affects all paragraphs.
7588 .MAC PP_FONT END
7589 .    if \\n[#IGNORE] \{ .return \}
7590 .    br
7591 .    ds $PP_FT \\$1
7592 .    FT \\*[$PP_FT]
7593 .END
7596 \# PARAGRAPH INDENT
7597 \# ----------------
7598 \# *Argument:
7599 \#   <amount to indent paragraphs in running text (ipPcm)>
7600 \# *Function:
7601 \#   Allows user to change the default para indent.  The change will
7602 \#   affect the indent of QUOTEs and BLOCKQUOTEs as well.
7603 \# *Notes:
7604 \#   Default for printstyle TYPEWRITE is 1/2-inch.  Default for
7605 \#   printstyle TYPESET is 2 ems.  The defaults are set in
7606 \#   PRINTSTYLE, not DEFAULTS.
7608 .MAC PARA_INDENT END
7609 .    nr #PP_INDENT (\\$1)
7610 .END
7613 \# INDENT FIRST PARAGRAPHS
7614 \# -----------------------
7615 \# *Arguments:
7616 \#   <none> | <anything>
7617 \# *Function:
7618 \#   By default, the first para of a document, as well as the first
7619 \#   paras of blockquotes and block-style epigraphs are not indented.
7620 \#   When invoked, this macro will indent all paras.
7621 \# *Notes:
7622 \#   Default is OFF.
7624 .MAC INDENT_FIRST_PARAS END
7625 .    ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
7626 .    el \{ .rr #INDENT_FIRST_PARAS   \}
7627 .END
7630 \# INTER-PARAGRAPH SPACING
7631 \# -----------------------
7632 \# *Arguments:
7633 \#   <none> | <anything>
7634 \# *Function:
7635 \#   Adds a line space between paragraphs in body text.  Block quotes
7636 \#   are unaffected.
7637 \# *Notes:
7638 \#   Default is OFF.  PARA_SPACE ON is not recommended for use
7639 \#   with PRINTSTYLE TYPEWRITE.
7641 .MAC PARA_SPACE END
7642 .    ie '\\$1'' \{ .nr #PP_SPACE 1 \}
7643 .    el \{ .rr #PP_SPACE   \}
7644 .END
7647 \# PARAGRAPH
7648 \# ---------
7649 \# *Arguments:
7650 \#   <none>
7651 \# *Function:
7652 \#   Figures out what to do with paragraphs under differing conditions.
7653 \# *Notes:
7654 \#   For the time being, there's no automatic widow/orphan control.
7655 \#   Controlling them isn't just a matter of establishing an arbitrary
7656 \#   number of lines needed for a para, since groff doesn't then
7657 \#   handle single line paragraphs gracefully.  Usually, the whole
7658 \#   page needs to be tweaked.
7660 \#   Note the use of transparent line break (\!.br) to get
7661 \#   PP to work within blockquotes and epigraphs.
7663 \#   PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
7665 .MAC PP END
7666 .    br
7667 .    if \\n[#DOC_TYPE]=4 \{\
7668 .       if !'\\n(.z'' \{ .di \}
7669 .       if \\n[#DATE] \{\
7670 .          nf
7671 .          DATE
7672 .          QUAD \\*[$DOC_QUAD]
7673 .          ALD \\n[#DOC_LEAD]u*2u
7674 .          rr #DATE
7675 .       \}
7676 .       if \\n[#TO] \{\
7677 .          nf
7678 .          TO_ADDRESS
7679 .          ALD \\n[#DOC_LEAD]u
7680 .          rr #TO
7681 .       \}
7682 .       if \\n[#FROM] \{\
7683 .          nf
7684 .          FROM_ADDRESS
7685 .          ALD \\n[#DOC_LEAD]u
7686 .          rr #FROM
7687 .       \}
7688 .       if \\n[#GREETING] \{\
7689 .          nf
7690 .          GREETING
7691 .          ALD \\n[#DOC_LEAD]u
7692 .          rr #GREETING
7693 .       \}
7694 .    \}
7695 .    rr #PP_ACTIVE
7696 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7697 .    if \\n[#PP_STYLE]=1 \{\
7698 .       if \\n[#ENDNOTE] \{\
7699 .          nr #RESET_PARA_SPACE \\n[#PP_SPACE]
7700 .          ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
7701 .          el \{ .PARA_SPACE OFF \}
7702 .       \}
7703 .       br
7704 .       if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
7705 .       if \\n[#COLUMNS] \{\
7706 .          if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
7707 .       \}
7708 .       if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7709 .       ie \\n[#PRINT_STYLE]=1 \{\
7710 .          fam C
7711 .          ft  R
7712 .          ps  12
7713 .          ie \\n[#ENDNOTE] \{ .vs \\n[#EN_LEAD]u \}
7714 .          el \{ .vs \\n[#DOC_LEAD]u \}
7715 .          QUAD \\*[$DOC_QUAD]
7716 .          UNDERLINE OFF
7717 .          if \\n[#SLANT_ON] \{\
7718 .             if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
7719 .          \}
7720 .       \}
7721 .       el \{\
7722 .          ie \\n[#ENDNOTE] \{\
7723 .             FAMILY  \\*[$EN_FAM]
7724 .             FT      \\*[$EN_FT]
7725 .             PT_SIZE \\n[#EN_PS]u
7726 .             vs      \\n[#EN_LEAD]u
7727 .             QUAD    \\*[$EN_QUAD]
7728 .          \}
7729 .          el \{\
7730 .             FAMILY  \\*[$DOC_FAM]
7731 .             FT      \\*[$PP_FT]
7732 .             PT_SIZE \\n[#DOC_PT_SIZE]u
7733 .             LS      \\n[#DOC_LEAD]u
7734 .             QUAD    \\*[$DOC_QUAD]
7735 .          \}
7736 .       \}
7737 .       ie \\n[#PP]=0 \{\
7738 .          if \\n[#INDENT_FIRST_PARAS] \{\
7739 .             ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7740 .             el \{ .ti \\n[#PP_INDENT]u \}
7741 .             if '\\n(.z'END_NOTES' \{\
7742 .                ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7743 .             \}
7744 .          \}
7745 .          if r#END_QUOTE \{\
7746 .             if \\n[#END_QUOTE] \{\
7747 .                if !\\n[#LINEBREAK] \{\
7748 .                   ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7749 .                   el \{ .ti \\n[#PP_INDENT]u \}
7750 .                   if '\\n(.z'END_NOTES' \{\
7751 .                      ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7752 .                   \}
7753 .                \}
7754 .             \}
7755 .          \}
7756 .       \}
7757 .       el \{\
7758 .          br
7759 .          if \\n[#PP_SPACE] \{\
7760 .             if \\n[#PRINT_STYLE]=2 \{\
7761 .                ie \\n[#END_QUOTE] \{\
7762 .                   rr #END_QUOTE
7763 .                \}
7764 .                el \{ .ALD \\n[#DOC_LEAD]u \}
7765 .             \}
7766 .          \}
7767 .          ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7768 .          el \{ .ti \\n[#PP_INDENT]u \}
7769 .          if '\\n(.z'END_NOTES' \{\
7770 .             ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7771 .          \}
7772 .       \}
7773 .       if r#START     \{ .rr #START     \}
7774 .       if r#QUOTE     \{ .rr #QUOTE     \}
7775 .       if r#END_QUOTE \{ .rr #END_QUOTE \}
7776 .       if r#HEAD      \{ .rr #HEAD      \}
7777 .       if r#EPIGRAPH  \{ .rr #EPIGRAPH  \}
7778 .       if r#Q_FITS    \{ .rr #Q_FITS    \}
7779 .       if r#LINEBREAK \{ .rr #LINEBREAK \}
7780 .       if \\n[#ENDNOTE] \{\
7781 .          ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
7782 .          el \{ .PARA_SPACE OFF \}
7783 .       \}
7784 .       if \\n[#CONDENSE] \{\
7785 \E*[COND]\c
7786 .       \}
7787 .       if \\n[#EXTEND]=1 \{\
7788 \E*[EXT]\c
7789 .       \}
7790 .       nr #PP +1
7791 .    \}
7792 .    if \\n[#PP_STYLE]=2 \{\
7793 \!.     br
7794 .       if \\n[#BROKEN_QUOTE] \{\
7795 .          ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
7796 .          el \{ .nr #Q_PP 0 \}
7797 .          rr #BROKEN_QUOTE
7798 .       \}
7799 .       ie \\n[#Q_PP]=0 \{\
7800 .          if \\n[#INDENT_FIRST_PARAS] \{\
7801 .             ti \\n[#PP_INDENT]u/2u
7802 .          \}
7803 .          if \\n[#ENDNOTE] \{\
7804 .             ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
7805 .             el \{ .ti 0 \}
7806 .          \}
7807 .       \}
7808 .       el \{\
7809 .          ti \\n[#PP_INDENT]u/2u
7810 .       \}
7811 .       if \\n[#CONDENSE] \{\
7812 \E*[COND]\c
7813 .       \}
7814 .       if \\n[#EXTEND]=1 \{\
7815 \E*[EXT]\c
7816 .       \}
7817 .    nr #Q_PP +1
7818 .    \}
7819 .    nr #PP_ACTIVE 1
7820 .END
7822 \# ====================================================================
7824 \# +++QUOTES+++
7826 \# ---Line for line (poetic) quotes---
7828 \# QUOTE FAMILY
7829 \# ------------
7830 \# *Argument:
7831 \#   <family to use in line for line quotes>
7832 \# *Function:
7833 \#   Creates or modifies string $QUOTE_FAM.
7834 \# *Notes:
7835 \#   Default is same as running text.
7837 .MAC QUOTE_FAMILY END
7838 .    ds $QUOTE_FAM \\$1
7839 .END
7842 \# QUOTE FONT
7843 \# ----------
7844 \# *Argument:
7845 \#   <font to use in line for line quotes>
7846 \# *Function:
7847 \#   Creates or modifies string $QUOTE_FT.
7848 \# *Notes:
7849 \#   Default is italic for TYPESET.
7851 .MAC QUOTE_FONT END
7852 .    ds $QUOTE_FT \\$1
7853 .END
7856 \# QUOTE SIZE
7857 \# ----------
7858 \# *Argument:
7859 \#   <-|+ number of points by which to de/increase point size of
7860 \#   line for line quotes (relative to running text)>
7861 \# *Function:
7862 \#   Creates or modifies string $QUOTE_SIZE_CHANGE.
7863 \# *Notes:
7864 \#   Must be preceded by a - or + sign with no space afterwards.
7865 \#   Fractional point sizes are allowed.
7866 \#   Default is +0.
7868 .MAC QUOTE_SIZE END
7869 .    ds $QUOTE_SIZE_CHANGE \\$1
7870 .END
7873 \# UNDERLINE QUOTES
7874 \# ----------------
7875 \# *Arguments:
7876 \#   <none> | <anything>
7877 \# *Function:
7878 \#   Creates or modifies register #UNDERLINE_QUOTES (toggle).
7879 \#   If on, line for line quotes are underlined when printstyle
7880 \#   is TYPEWRITE.
7881 \# *Notes:
7882 \#   Default is ON for printstyle TYPEWRITE.
7884 .MAC UNDERLINE_QUOTES END
7885 .    ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
7886 .    el \{ .rr #UNDERLINE_QUOTES   \}
7887 .END
7890 \# QUOTE INDENT
7891 \# ------------
7892 \# *Argument:
7893 \#   <value by which to multiply PP_INDENT for indented quoted text>
7894 \# *Function:
7895 \#   Creates or modifies register #Q_OFFSET_VALUE.
7896 \# *Notes:
7897 \#   Default is 3 for typeset; 2 for typewrite
7899 .MAC QUOTE_INDENT END
7900 .    nr #Q_OFFSET_VALUE \\$1
7901 .END
7904 \# ALWAYS FULLSPACE QUOTES
7905 \# -----------------------
7906 \# *Arguments:
7907 \#   <none> | <anything>
7908 \# *Function:
7909 \#   Toggles register #FULLSPACE_QUOTES.
7910 \# *Notes:
7911 \#   If user doesn't like the default 1/2 line space above and below
7912 \#   quotes, s/he can turn it off here.  Has no effect in TYPEWRITE.
7914 .MAC ALWAYS_FULLSPACE_QUOTES END
7915 .    if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
7916 .    el \{ .rr #FULLSPACE_QUOTES \}
7917 .END
7920 \# QUOTE
7921 \# -----
7922 \# *Arguments:
7923 \#   <none> | <anything>
7924 \# *Function:
7925 \#   Indents quoted text on a line for line basis, or turns QUOTE off.
7926 \# *Notes:
7927 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
7928 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
7929 \#   how much space to put before and after.
7931 .MAC QUOTE END
7932 .    br
7933 \# **Uncomment the next line to prevent orphaned quote lines.
7934 \#.  ne 1
7935 .    ie '\\$1'' \{\
7936 .       ev QUOTE
7937 .       nr #QUOTE 1
7938 .       di P_QUOTE
7939 .       ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7940 .       ta \\n(.lu
7941 .       if \\n[#COLUMNS] \{\
7942 .          ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7943 .          ta \\n(.lu
7944 .       \}
7945 .       if \\n[#PRINT_STYLE]=1 \{\
7946 .          fam C
7947 .          ft  R
7948 .          ps 12
7949 .          vs \\n[#DOC_LEAD]u
7950 .          LEFT
7951 .       \}
7952 .       if \\n[#PRINT_STYLE]=2 \{\
7953 .          FAMILY  \\*[$QUOTE_FAM]
7954 .          FT      \\*[$QUOTE_FT]
7955 .          PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
7956 .          LS      \\n[#DOC_LEAD]u
7957 .          LEFT
7958 .       \}
7959 .       nr #Q_TOP \\n(nl
7960 .       if \\n[#PRINT_STYLE]=1 \{\
7961 .          if \\n[#UNDERLINE_QUOTES] \{\
7962 .               FT I
7963 .          \}
7964 .       \}
7965 .    \}
7966 .    el \{ .DO_QUOTE \}
7967 .END
7970 \# ---Blockquotes---
7972 \# BLOCKQUOTE FAMILY
7973 \# -----------------
7974 \# *Argument:
7975 \#   <family to use in blockquotes>
7976 \# *Function:
7977 \#   Creates or modifies string $BQUOTE_FAM.
7978 \# *Notes:
7979 \#   Default is same as running text.
7981 .MAC BLOCKQUOTE_FAMILY END
7982 .    ds $BQUOTE_FAM \\$1
7983 .END
7986 \# BLOCKQUOTE FONT
7987 \# ---------------
7988 \# *Argument:
7989 \#   <font to use in blockquotes>
7990 \# *Function:
7991 \#   Creates or modifies string $BQUOTE_FT.
7992 \# *Notes:
7993 \#   Default is same as running text.
7995 .MAC BLOCKQUOTE_FONT END
7996 .    ds $BQUOTE_FT \\$1
7997 .END
8000 \# BLOCKQUOTE SIZE
8001 \# ---------------
8002 \# *Argument:
8003 \#   <-|+ number of points by which to de/increase point size of blockquotes
8004 \#   (relative to running text)>
8005 \# *Function:
8006 \#   Creates or modifies string $BQUOTE_SIZE_CHANGE.
8007 \# *Notes:
8008 \#   Must be preceded by a - or + sign with no space afterwards.
8009 \#   Fractional point sizes are allowed.
8010 \#   Default is -1 for printstyle TYPESET; +0 for TYPEWRITE.
8012 .MAC BLOCKQUOTE_SIZE END
8013 .    ds $BQUOTE_SIZE_CHANGE \\$1
8014 .END
8017 \# BLOCKQUOTE QUAD
8018 \# ---------------
8019 \# *Arguments:
8020 \#   <quad to use in blockquotes>
8021 \# *Function:
8022 \#   Creates or modifies string $BQUOTE_QUAD.
8023 \# *Notes:
8024 \#   Default is LEFT.
8026 .MAC BLOCKQUOTE_QUAD END
8027 .    ds $BQUOTE_QUAD \\$1
8028 .END
8031 \# BLOCKQUOTE
8032 \# ----------
8033 \# *Arguments:
8034 \#   <none> | <anything>
8035 \# *Function:
8036 \#   Indents quoted text in fill mode and shortens line length
8037 \#   accordingly, or turns BLOCKQUOTE off.
8038 \# *Notes:
8039 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
8040 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
8041 \#   how much space to put before and after.
8043 \#   .PP after blockquote is optional if there's only one para,
8044 \#   but REQUIRED if there's more than one.
8046 .MAC BLOCKQUOTE END
8047 .    br
8048 .    ie '\\$1'' \{\
8049 .       ev BLOCKQUOTE
8050 .       nr #QUOTE    2
8051 .       nr #PP_STYLE 2
8052 .       nr #Q_PP     0
8053 .       di B_QUOTE
8054 .       ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8055 .       if \\n[#ENDNOTE] \{\
8056 .          if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
8057 .             ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8058 .          \}
8059 .          if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
8060 .             ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8061 .          \}
8062 .       \}
8063 .       ta \\n(.lu
8064 .       CHECK_INDENT
8065 .       if \\n[#COLUMNS] \{\
8066 .          ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8067 .          if \\n[#ENDNOTE] \{\
8068 .             if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
8069 .                ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8070 .             \}
8071 .             if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
8072 .                ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
8073 .             \}
8074 .          \}
8075 .          ta \\n(.lu
8076 .       \}
8077 .       if \\n[#PRINT_STYLE]=1 \{\
8078 .          fam C
8079 .          ft  R
8080 .          ps  12
8081 .          vs  \\n[#DOC_LEAD]u
8082 .          QUAD LEFT
8083 .          HY OFF
8084 .       \}
8085 .       if \\n[#PRINT_STYLE]=2 \{\
8086 .          FAMILY  \\*[$BQUOTE_FAM]
8087 .          FT      \\*[$BQUOTE_FT]
8088 .          PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
8089 .          LS      \\n[#DOC_LEAD]u
8090 .          if \\n[#ENDNOTE] \{\
8091 .             PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
8092 .          \}
8093 .          QUAD    \\*[$BQUOTE_QUAD]
8094 .          HY
8095 .       \}
8096 .       nr #Q_TOP \\n(nl
8097 .       if \\n[#INDENT_FIRST_PARAS] \{\
8098 .          ie !\\n[#ENDNOTE] \{\
8099 .             if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
8100 .             if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
8101 .          \}
8102 .          el \{\
8103 .             if \\n[#INDENT_FIRSTS]=1 \{\
8104 .                if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
8105 .                if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
8106 .             \}
8107 .          \}
8108 .       \}
8109 .    \}
8110 .    el \{ .DO_QUOTE \}
8111 .END
8114 \# DO QUOTE
8115 \# --------
8116 \# *Arguments:
8117 \#   <none>
8118 \# *Function:
8119 \#   Ends the diversion P_QUOTE or B_QUOTE.  Spaces them according to
8120 \#   PRINT_STYLE, whether there's inter-paragraph spacing, and page
8121 \#   position.  TYPEWRITE treats spacing the same way in all circumstance
8122 \#   (viz. an extra line space).  TYPESET puts in only half
8123 \#   line spaces if the entire quote plus 1 line of body under the quote
8124 \#   fits on the the page; otherwise it puts in a full extra blank
8125 \#   line.  (This is to ensure the page remains bottom aligned).
8127 .MAC DO_QUOTE END
8128 .    di
8129 .    REMOVE_INDENT
8130 .    ev
8131 \#   **Change *1 to *2 in next line to prevent orphans after quotes
8132 .    if \\n[#ENDNOTE] \{\
8133 .       nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
8134 .       ALWAYS_FULLSPACE_QUOTES
8135 .    \}
8136 .    nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
8137 .    if \\n[#PRINT_STYLE]=1 \{\
8138 .       if \\n[#START]=1 \{ . \}
8139 .       if \\n[#START]=0 \{\
8140 .          if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8141 .       \}
8142 .       if \\n[#HEAD] \{\
8143 .          if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
8144 .       \}
8145 .    \}
8146 .    if \\n[#PRINT_STYLE]=2 \{\
8147 .       ie \\n[#PP_SPACE] \{\
8148 .          ie \\n[#HEAD]>0 \{ . \}
8149 .          el \{\
8150 .             ie \\n[#START] \{ . \}
8151 .             el \{ .ALD \\n[#DOC_LEAD]u \}
8152 .          \}
8153 .       \}
8154 .       el \{\
8155 .          ie \\n[#Q_DEPTH]<\\n[#TRAP_DISTANCE] \{\
8156 .             nr #Q_FITS 1
8157 .             ie \\n[#HEAD]=1 \{ . \}
8158 .             el \{\
8159 .                ie \\n[#START] \{ . \}
8160 .                el \{\
8161 .                   ie \\n[#FULLSPACE_QUOTES] \{\
8162 .                      ie \\n[#ENDNOTE] \{\
8163 .                         ALD \\n[#EN_LEAD]u
8164 .                      \}
8165 .                      el \{ .ALD \\n[#DOC_LEAD]u \}
8166 .                   \}
8167 .                   el \{\
8168 .                      ie \\n[#ENDNOTE] \{\
8169 .                         ALD \\n[#EN_LEAD]u/2u
8170 .                      \}
8171 .                      el \{ .ALD \\n[#DOC_LEAD]u/2u \}
8172 .                   \}
8173 .                \}
8174 .             \}
8175 .          \}
8176 .          el \{\
8177 .             rr #Q_FITS
8178 .             ie r#HEAD \{\
8179 .                if \\n[#HEAD]=1 \{ . \}
8180 .             \}
8181 .             el \{\
8182 .                ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
8183 .                el \{ .ALD \\n[#DOC_LEAD]u \}
8184 .             \}
8185 .          \}
8186 .       \}
8187 .    \}
8188 .    nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8189 .    if \\n[#COLUMNS] \{\
8190 .       nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8191 .    \}
8192 .    if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
8193 .    if \\n[#ENDNOTE] \{\
8194 .       in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
8195 .    \}
8196 .    if \\n[#QUOTE]=1 \{\
8197 .       nf
8198 .       P_QUOTE
8199 .       if !\\n[#START] \{ .rr #QUOTE \}
8200 .    \}
8201 .    if \\n[#QUOTE]=2 \{\
8202 .       nf
8203 .       B_QUOTE
8204 .    \}
8205 .    if \\n[#PRINT_STYLE]=1 \{\
8206 .       ALD \\n[#DOC_LEAD]u
8207 .    \}
8208 .    if \\n[#PRINT_STYLE]=2 \{\
8209 .       ie \\n[#START] \{\
8210 .          ie \\n[#PP_SPACE] \{ . \}
8211 .          el \{ .ALD \\n[#DOC_LEAD]u \}
8212 .       \}
8213 .       el \{\
8214 .          ie \\n[#PP_SPACE] \{ . \}
8215 .          el \{\
8216 .             ie \\n[#HEAD]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8217 .             el \{\
8218 .                ie \\n[#Q_FITS] \{\
8219 .                   ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
8220 .                      nr #Q_AT_TOP 1
8221 .                      ALD \\n[#DOC_LEAD]u
8222 .                   \}
8223 .                   el \{\
8224 .                      ie \\n[#FULLSPACE_QUOTES] \{ .ALD \\n[#DOC_LEAD]u \}
8225 .                      el \{ .ALD \\n[#DOC_LEAD]u/2u \}
8226 .                   \}
8227 .                \}
8228 .                el \{ .ALD \\n[#DOC_LEAD]u \}
8229 .             \}
8230 .          \}
8231 .       \}
8232 .    \}
8233 .    if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
8234 .    if r#HEAD     \{ .rr #HEAD     \}
8235 .    if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8236 .    rr #Q_PP
8237 .    rr #LINEBREAK
8238 .    nr #PP_STYLE  1
8239 .    nr #END_QUOTE 1
8240 .    if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
8241 .    if \\n[#ENDNOTE] \{\
8242 .       in \\n[#EN_TEXT_INDENT]u
8243 .    \}
8244 .    if \\n[#COLUMNS] \{\
8245 .       if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
8246 .       if \\n[#ENDNOTE] \{\
8247 .          in \\n[#EN_TEXT_INDENT]u
8248 .       \}
8249 .    \}
8250 .    ie !\\n[#ENDNOTE] \{\
8251 .       nr #RESET_PP_INDENT \\n[#PP_INDENT]
8252 .       PARA_INDENT 0
8253 .       PP
8254 .       PARA_INDENT \\n[#RESET_PP_INDENT]u
8255 .       QUAD \\*[$DOC_QUAD]
8256 .    \}
8257 .    el \{\
8258 .       nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
8259 .       ENDNOTE_PARA_INDENT 0
8260 .       PP
8261 .       ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
8262 .       QUAD \\*[EN_QUAD]
8263 .    \}
8264 .END
8266 \# ====================================================================
8268 \# BREAK QUOTE
8269 \# -----------
8270 \# *Arguments:
8271 \#   <none>
8272 \# *Function:
8273 \#   Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
8274 \#   page, and reinvokes BLOCKQUOTE.
8275 \# *Notes:
8276 \#   Because quotes go into a diversion before they're output,
8277 \#   footnotes in quotes that cross pages behave erratically.  The footnote
8278 \#   isn't processed until the diversion ends, hence the footnote
8279 \#   marker in the quote isn't always correct for the new page (it's
8280 \#   picked up from the old one).  BREAK_QUOTE is a workaround for
8281 \#   this problem.
8283 .MAC BREAK_QUOTE END
8284 .    br
8285 .    di
8286 .    nr #BROKEN_QUOTE 1
8287 .    REMOVE_INDENT
8288 .    ev
8289 .    nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
8290 .    if \\n[#PRINT_STYLE]=1 \{\
8291 .       if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8292 .       if \\n[#HEAD] \{\
8293 .          if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
8294 .       \}
8295 .    \}
8296 .    if \\n[#PRINT_STYLE]=2 \{\
8297 .       ie \\n[#PP_SPACE] \{\
8298 .          ie \\n[#HEAD]=1 \{ . \}
8299 .          el \{\
8300 .             if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8301 .          \}
8302 .       \}
8303 .       el \{\
8304 .          rr #Q_FITS
8305 .          ie r#HEAD \{\
8306 .             if \\n[#HEAD]=1 \{ . \}
8307 .          \}
8308 .          el \{ .ALD \\n[#DOC_LEAD]u \}
8309 .       \}
8310 .    \}
8311 .    nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8312 .    if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
8313 .    po \\n[#Q_OFFSET]u
8314 .    if \\n[#QUOTE]=1 \{\
8315 .       nf
8316 .       P_QUOTE
8317 .       if !\\n[#START] \{ .rr #QUOTE \}
8318 .    \}
8319 .    if \\n[#QUOTE]=2 \{\
8320 .       nf
8321 .       B_QUOTE
8322 .    \}
8323 .    if r#HEAD     \{ .rr #HEAD     \}
8324 .    if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8325 .    rr #Q_PP
8326 .    rr #LINEBREAK
8327 .    nr #PP_STYLE  1
8328 .    nr #END_QUOTE 1
8329 .    if \\n[#PRINT_STYLE]=1 \{\
8330 .       if \\n[#UNDERLINE_QUOTES] \{\
8331 .          UNDERLINE OFF
8332 .       \}
8333 .    \}
8334 .    po \\n[#L_MARGIN]u
8335 .    if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
8336 .    QUAD \\*[$DOC_QUAD]
8337 .    sp |\\n[#PAGE_LENGTH]u  \" To trip footer/header
8338 .    BLOCKQUOTE
8339 .END
8341 \# ====================================================================
8343 \# +++PAGINATION+++
8345 \# PAGINATE
8346 \# --------
8347 \# *Arguments:
8348 \#   <none> | <anything>
8349 \# *Function:
8350 \#   Turns page numbering off or on.
8351 \# *Notes:
8352 \#   Page numbering is on by default with .PAPER.
8353 \#   Default is on.
8355 .MAC PAGINATE END
8356 .    ie '\\$1'' \{ .nr #PAGINATE 1 \}
8357 .    el \{ .nr #PAGINATE 0 \}
8358 .END
8361 \# SUSPEND PAGINATION (before ENDNOTES)
8362 \# ------------------
8363 \# *Argument:
8364 \#   <none>
8365 \# *Function:
8366 \#   Creates register #SUSPEND_PAGINATION
8367 \# *Notes:
8368 \#   Useful only to suspend pagination before outputting endnotes.
8370 .MAC SUSPEND_PAGINATION END
8371 .    nr #SUSPEND_PAGINATION 1
8372 .END
8374 \# RESTORE PAGINATION (after ENDNOTES)
8375 \# ------------------
8376 \# *Argument:
8377 \#   <none>
8378 \# *Function:
8379 \#   Removes register #SUSPEND_PAGINATION.  Creates register
8380 \#   #DEFER_PAGINATION
8381 \# *Notes:
8382 \#   Useful only to restore pagination after outputting endnotes.
8384 .MAC RESTORE_PAGINATION END
8385 .    rr #SUSPEND_PAGINATION
8386 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .PAGINATE \}
8387 .    if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #DEFER_PAGINATION 1 \}
8388 .END
8391 \# PAGENUMBER FAMILY
8392 \# -----------------
8393 \# *Argument:
8394 \#   <family to use for page numbers>
8395 \# *Function:
8396 \#   Creates or modifies string $PAGE_NUM_FAM.
8397 \# *Notes:
8398 \#   Default is same as running text.
8400 .MAC PAGENUM_FAMILY END
8401 .    ds $PAGE_NUM_FAM \\$1
8402 .END
8405 \# PAGE NUMBER FONT
8406 \# ----------------
8407 \# *Arguments:
8408 \#   <font to use for page numbers>
8409 \# *Function:
8410 \#   Creates or modifies string $PAGE_NUM_FT.
8411 \# *Notes:
8412 \#   Default is same as running text.
8414 .MAC PAGENUM_FONT END
8415 .    ds $PAGE_NUM_FT \\$1
8416 .END
8419 \# PAGE NUMBER SIZE
8420 \# ----------------
8421 \# *Argument:
8422 \#   <+|- number of points by which to in/decrease point size of
8423 \#   page numbers (relative to running text)>
8424 \# *Function:
8425 \#   Creates or modifies string $PAGE_NUM_SIZE_CHANGE.
8426 \# *Notes:
8427 \#   Must be preceded by a +|- sign with no space afterward.
8428 \#   Fractional point sizes are allowed.
8429 \#   Default is +0.
8431 .MAC PAGENUM_SIZE END
8432 .    ds $PAGE_NUM_SIZE_CHANGE \\$1
8433 .END
8436 \# PAGE NUMBER FORMAT
8437 \# ------------------
8438 \# *Arguments:
8439 \#   DIGIT | ROMAN | roman | ALPHA | alpha
8440 \# *Function:
8441 \#   Assigns user entered format to #PAGENUMBER.
8443 .MAC PAGENUM_STYLE END
8444 .    nr #PAGENUM_STYLE_SET 1
8445 .    if '\\$1'DIGIT'  \{\
8446 .       ds $PAGENUM_STYLE \\$1
8447 .       af #PAGENUMBER 1
8448 .    \}
8449 .    if '\\$1'ROMAN'  \{\
8450 .       ds $PAGENUM_STYLE \\$1
8451 .       af #PAGENUMBER I
8452 .    \}
8453 .    if '\\$1'roman'  \{\
8454 .       ds $PAGENUM_STYLE \\$1
8455 .       af #PAGENUMBER i
8456 .    \}
8457 .    if '\\$1'ALPHA'  \{\
8458 .       ds $PAGENUM_STYLE \\$1
8459 .       af #PAGENUMBER A
8460 .    \}
8461 .    if '\\$1'alpha'  \{\
8462 .       ds $PAGENUM_STYLE \\$1
8463 .       af #PAGENUMBER a
8464 .    \}
8465 .END
8468 \# HYPHENS AROUND PAGE NUMBERS
8469 \# ---------------------------
8470 \# *Arguments:
8471 \#   <none> | <anything>
8472 \# *Function:
8473 \#   Creates or modifies register #PAGE_NUM_HYPHENS.
8474 \#   Used to dis/enable hyphens on either side of page numbers.
8475 \# *Notes:
8476 \#   Default is on.
8478 .MAC PAGENUM_HYPHENS END
8479 .    nr #PAGE_NUM_HYPHENS_SET 1
8480 .    ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
8481 .    el \{ .rr #PAGE_NUM_HYPHENS   \}
8482 .END
8485 \# PAGENUMBER POSITION
8486 \# -------------------
8487 \# *Arguments:
8488 \#   TOP | BOTTOM  LEFT | CENTER | RIGHT
8489 \# *Function:
8490 \#   Creates or modifies various PAGE_NUM_H | V_POS registers.
8491 \#   Used to position page numbers.
8492 \# *Notes:
8493 \#   Default is center/bottom.
8495 .MAC PAGENUM_POS END
8496 .    nr #PAGE_NUM_POS_SET 1
8497 .    if '\\$1'TOP'    \{ .nr #PAGE_NUM_V_POS 1 \}
8498 .    if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
8499 .    if '\\$2'LEFT'   \{ .nr #PAGE_NUM_H_POS 1 \}
8500 .    if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
8501 .    if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
8502 .    if '\\$2'RIGHT'  \{ .nr #PAGE_NUM_H_POS 3 \}
8503 .END
8506 \# PRINT PAGE NUMBER
8507 \# -----------------
8508 \# *Arguments:
8509 \#   <none>
8510 \# *Function:
8511 \#   Prints page number if PAGEINATE=1.
8513 .MAC PRINT_PAGE_NUMBER END
8514 .    ev PAGENUMBER
8515 .    po \\n[#DOC_L_MARGIN]u
8516 .    ll \\n[#DOC_L_LENGTH]u
8517 .    ta \\n(.lu
8518 .    FAMILY  \\*[$PAGE_NUM_FAM]
8519 .    FT      \\*[$PAGE_NUM_FT]
8520 .    PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
8521 .    if \\n[#PRINT_STYLE]=1 \{\
8522 .       fam C
8523 .       ft  R
8524 .       ps 12
8525 .    \}
8526 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
8527 .    if o \{\
8528 .       ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT  \}
8529 .       el                        \{ .RIGHT \}
8530 .    \}
8531 .    if e \{\
8532 .       ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
8533 .       el                        \{ .LEFT  \}
8534 .    \}
8535 .    if \\n[#PAGE_NUM_H_POS]=2    \{.CENTER \}
8536 .    if \\n[#RECTO_VERSO]=0 \{\
8537 .       if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT   \}
8538 .       if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
8539 .       if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT  \}
8540 .    \}
8541 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
8542 .    if \\n[#EN_FIRST_PAGE] \{\
8543 .       if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
8544 .       rr #EN_FIRST_PAGE
8545 .    \}
8546 .    if \\n[#TOC_FIRST_PAGE] \{\
8547 .       PAGENUMBER 1
8548 .       rr #TOC_FIRST_PAGE
8549 .    \}
8550 .    ie \\n[#DRAFT_WITH_PAGENUM] \{\
8551 .       ie !\\n[#REVISION] \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT] / \\n[#PAGENUMBER]" \}
8552 .       el \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT], \\*[$REVISION_STRING] \\n[#REVISION] / \\n[#PAGENUMBER]" \}
8553 .    \}
8554 .    el \{\
8555 .       ie \\n[#PAGE_NUM_HYPHENS] \{ .PRINT "- \\n[#PAGENUMBER] -" \}
8556 .       el \{ .PRINT "\\n[#PAGENUMBER]" \}
8557 .    \}
8558 .    ev
8559 .END
8561 \# ====================================================================
8563 \# +++FOOTNOTES+++
8565 \# FOOTNOTE FAMILY
8566 \# --------------
8567 \# *Argument:
8568 \#   <family to use in footnotes>
8569 \# *Function:
8570 \#   Creates or modifies string $FN_FAM.
8571 \# *Notes:
8572 \#   Default is same as running text.
8574 .MAC FOOTNOTE_FAMILY END
8575 .    ds $FN_FAM \\$1
8576 .END
8579 \# FOOTNOTE FONT
8580 \# --------------
8581 \# *Argument:
8582 \#   <font to use in footnotes>
8583 \# *Function:
8584 \#   Creates or modifies string $FN_FT.
8585 \# *Notes:
8586 \#   Default is roman.
8588 .MAC FOOTNOTE_FONT END
8589 .    ds $FN_FT \\$1
8590 .END
8593 \# FOOTNOTE SIZE
8594 \# ------------
8595 \# *Argument:
8596 \#   <+|- number of points by which to in/decrease point size of footnotes
8597 \#   (relative to running text)>
8598 \# *Function:
8599 \#   Creates or modifies string $FN_SIZE_CHANGE.
8600 \# *Notes:
8601 \#   Must be preceded by a +|- sign.  No space afterwards.
8602 \#   Fractional point sizes are allowed.
8603 \#   Default is -2 for printstyle TYPESET; +0 for TYPEWRITE.
8605 .MAC FOOTNOTE_SIZE END
8606 .    ds $FN_SIZE_CHANGE \\$1
8607 .END
8610 \# FOOTNOTE AUTOLEAD
8611 \# -----------------
8612 \# *Arguments:
8613 \#   <autolead value for footnotes>
8614 \# *Function:
8615 \#   Creates or modifies register #FN_AUTOLEAD.
8616 \# *Notes:
8617 \#   Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
8619 .MAC FOOTNOTE_AUTOLEAD END
8620 .    nr #FN_AUTOLEAD \\$1
8621 .END
8624 \# FOOTNOTE QUAD
8625 \# -------------
8626 \# *Arguments:
8627 \#   <quad to use in footnotes>
8628 \# *Function:
8629 \#   Creates or modifies string $FN_QUAD.
8630 \# *Notes:
8631 \#   Default is same as running text.
8633 .MAC FOOTNOTE_QUAD END
8634 .    ds $FN_QUAD \\$1
8635 .END
8638 \# FOOTNOTE MARKERS
8639 \# ----------------
8640 \# *Arguments:
8641 \#   <none> | <anything>
8642 \# *Function:
8643 \#   Turns generation of footnote markers on or off.
8644 \# *Notes:
8645 \#   Default is on.
8647 .MAC FOOTNOTE_MARKERS END
8648 .    ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
8649 .    el \{ .nr #FN_MARKERS 0 \}
8650 .END
8653 \# FOOTNOTE MARKER STYLE
8654 \# ---------------------
8655 \# *Arguments:
8656 \#   STAR | NUMBER
8657 \# *Function:
8658 \#   Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
8659 \#   the style of footnote markers.
8660 \# *Notes:
8661 \#   1=STAR; 2=NUMBER.  Default is STAR.
8663 .MAC FOOTNOTE_MARKER_STYLE END
8664 .    if '\\$1'STAR' \{\
8665 .       nr #FN_MARKER_STYLE 1
8666 .    \}
8667 .    if '\\$1'NUMBER' \{\
8668 .       nr #FN_MARKER_STYLE 2
8669 .    \}
8670 .END
8673 \# RESET FOOTNOTE NUMBER
8674 \# ---------------------
8675 \# *Arguments:
8676 \#   <none> | PAGE
8677 \# *Function:
8678 \#   Resets register #FN_NUMBER to 1.  If argument is PAGE, creates
8679 \#   toggle #RESET_FN_NUMBER which is checked in HEADER.  If 1,
8680 \#   numbered footnotes on every page start at 1.
8682 .MAC RESET_FOOTNOTE_NUMBER END
8683 .    ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
8684 .    el \{ .nr #RESET_FN_NUMBER 1 \}
8685 .END
8688 \# FOOTNOTE RULE LENGTH
8689 \# --------------------
8690 \# *Arguments:
8691 \#   <length of rule used to separate footnotes from running text>
8692 \# *Function:
8693 \#   Creates or modifies registers #FN_RULE_LENGTH.
8694 \# *Notes:
8695 \#   Requires unit of measure (iPpcm).
8696 \#   Default is 4P for both PRINTSTYLEs.
8698 .MAC FOOTNOTE_RULE_LENGTH END
8699 .    nr #FN_RULE_LENGTH (\\$1)
8700 .END
8703 \# FOOTNOTE_RULE_ADJ
8704 \# -----------------
8705 \# *Arguments:
8706 \#   <number of points to raise footnote rule from it's baseline position>
8707 \# *Function:
8708 \#   Creates or modifies register #FN_RULE_ADJ.
8709 \# *Notes:
8710 \#   Default is 3p for both TYPESTYLES.
8712 \#   Requires unit of measure.
8714 .MAC FOOTNOTE_RULE_ADJ END
8715 .    nr #FN_RULE_ADJ (\\$1)
8716 .END
8719 \# FOOTNOTE RULE
8720 \# -------------
8721 \# *Arguments:
8722 \#   <none> | <anything>
8723 \# *Function:
8724 \#   Turns printing of footnote separator rule on or off.  If invoked as
8725 \#   PRINT_FOOTNOTE_RULE, prints footnote separator rule.
8726 \# *Notes:
8727 \#   Default is on.
8729 \#   Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
8730 \#   if the footnote number (#FN_COUNT) is 1.
8732 .MAC FOOTNOTE_RULE END
8733 .    ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
8734 .       if \\n[#FN_RULE]=0 \{ .RLD 1v \}
8735 \!.     PT_SIZE 12  \"Not sure why these have to be transparently embedded, but they do.
8736 .       RLD 1v
8737 .       LEFT
8738 .       PRINT \\v'-\\n[#FN_RULE_ADJ]u'\\l'\\n[#FN_RULE_LENGTH]u'\\v'+\\n[#FN_RULE_ADJ]u'
8739 \!.     PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
8740 .       QUAD \\*[$FN_QUAD]
8741 .    \}
8742 .    el \{\
8743 .       ie '\\$1'' \{ .nr #FN_RULE 1 \}
8744 .       el \{ .nr #FN_RULE 0 \}
8745 .    \}
8746 .END
8749 \# FOOTNOTE
8750 \# --------
8751 \# *Arguments:
8752 \#   <none> | INDENT  L|LEFT|R|RIGHT|B|BOTH  <indent value> > | <anything>
8753 \# *Function:
8754 \#   Begins collecting and diverting footnote text if no argument
8755 \#   given.  Otherwise, ends diversion FOOTNOTES, measures footnote
8756 \#   depth, and sets footnote trap.
8757 \# *Notes:
8758 \#   The input line preceding a footnote call MUST terminate with \c
8759 \#   or the footnote marker will be spaced away from the word it
8760 \#   should be joined to.
8762 \#   If FOOTNOTES is invoked with INDENT, the footnote will
8763 \#   be indented.  An indent style and an indent value must be given.
8764 \#   Subsequent footnotes will NOT be indented; INDENT must be given
8765 \#   for each footnote the user wants indented.
8767 .MAC FOOTNOTE END
8768 .    ie '\\$1'' \{\
8769 .       if \\n[#FN_MARKERS] \{\
8770 .          if \\n[#CONDENSE] \{ \*[CONDX]\c \}
8771 .          if \\n[#EXTEND]   \{ \*[EXTX]\c  \}
8772 .          if \\n[#PRINT_STYLE]=1 \{\
8773 .             if \\n[#UNDERLINE_ON] \{\
8774 .                nr #UNDERLINE_WAS_ON 1
8775 .                UNDERLINE OFF
8776 .             \}
8777 .          \}
8778 .          if !\\n[#NO_FN_MARKER] \{\
8779 .             if \\n[#FN_MARKER_STYLE]=1 \{\
8780 .                ie \\n[#FN_COUNT_FOR_COLS] \{\
8781 .                   if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU3]* \}
8782 .                   if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU3]\(dg \}
8783 .                   if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \*[BU3]** \}
8784 .                   if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
8785 .                   if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU3]*** \}
8786 .                   if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
8787 .                   if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU3]**** \}
8788 .                   if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
8789 .                   if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \*[BU3]***** \}
8790 .                   if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg \}
8791 .                \}
8792 .                el \{\
8793 .                   if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU3]* \}
8794 .                   if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU3]\(dg \}
8795 .                   if \\n[#FN_COUNT]=2 \{ .PRINT \*[BU3]** \}
8796 .                   if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
8797 .                   if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU3]*** \}
8798 .                   if \\n[#FN_COUNT]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
8799 .                   if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU3]**** \}
8800 .                   if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
8801 .                   if \\n[#FN_COUNT]=8 \{ .PRINT \*[BU3]***** \}
8802 .                   if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg\(dg \}
8803 .                \}
8804 .             \}
8805 .             if \\n[#FN_MARKER_STYLE]=2 \{\
8806 .                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" \}
8807 .                if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]" \}
8808 .             \}
8809 .          \}
8810 .       \}
8811 .       nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-(\\n(nl+1v)
8812 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
8813 .       nr #PP_STYLE 2
8814 .       if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
8815 .       INDENT_FIRST_PARAS
8816 .       ev FOOTNOTES
8817 .       ll \\n[#DOC_L_LENGTH]u
8818 .       ta \\n(.lu
8819 .       if \\n[#COLUMNS] \{\
8820 .          ll \\n[#COL_L_LENGTH]u
8821 .          ta \\n(.lu
8822 .       \}
8823 .       if \\n[#FN_R_INDENT]  \{\
8824 .          ll -\\n[#FN_R_INDENT]u
8825 .          ta \\n(.lu
8826 .       \}
8827 .       if \\n[#FN_BR_INDENT] \{\
8828 .          ll -\\n[#FN_BR_INDENT]u
8829 .          ta \\n(.lu
8830 .       \}
8831 .       FAMILY   \\*[$FN_FAM]
8832 .       FT       \\*[$FN_FT]
8833 .       PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
8834 .       AUTOLEAD \\n[#FN_AUTOLEAD]
8835 .       QUAD     \\*[$FN_QUAD]
8836 .       if \\n[#PRINT_STYLE]=1 \{\
8837 .          fam C
8838 .          ft  R
8839 .          ps 12
8840 .          ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
8841 .          el \{ .vs \\n[#DOC_LEAD]u/2u \}
8842 .          QUAD LEFT
8843 .          HY OFF
8844 .       \}
8845 .       nr #FN_LEAD \\n[#LEAD]
8846 .       da FOOTNOTES
8847 .       if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
8848 .       if \\n[#FN_DEFER_SPACE] \{\
8849 .          if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
8850 .          if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
8851 .          rr #FN_DEFER_SPACE
8852 .       \}
8853 .       if \\n+[#FN_COUNT]=1 \{\
8854 .          if !\\n[#FN_DEPTH] \{\
8855 .             if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8856 .             ie \\n[#FN_RULE] \{ .PRINT_FOOTNOTE_RULE \}
8857 .             el \{ .ALD 1v \}
8858 .          \}
8859 .       \}
8860 .       if \\n[#FN_MARKERS] \{\
8861 .          if !\\n[#NO_FN_MARKER] \{\
8862 .             if \\n[#FN_MARKER_STYLE]=1 \{\
8863 .                ie \\n+[#FN_COUNT_FOR_COLS] \{\
8864 .                   if \\n[#FN_COUNT_FOR_COLS]=1  \{ .PRINT *\c \}
8865 .                   if \\n[#FN_COUNT_FOR_COLS]=2  \{ .PRINT \(dg\c \}
8866 .                   if \\n[#FN_COUNT_FOR_COLS]=3  \{ .PRINT **\c \}
8867 .                   if \\n[#FN_COUNT_FOR_COLS]=4  \{ .PRINT \(dg\(dg\c \}
8868 .                   if \\n[#FN_COUNT_FOR_COLS]=5  \{ .PRINT ***\c \}
8869 .                   if \\n[#FN_COUNT_FOR_COLS]=6  \{ .PRINT \(dg\(dg\(dg\c \}
8870 .                   if \\n[#FN_COUNT_FOR_COLS]=7  \{ .PRINT ****\c \}
8871 .                   if \\n[#FN_COUNT_FOR_COLS]=8  \{ .PRINT \(dg\(dg\(dg\(dg\c \}
8872 .                   if \\n[#FN_COUNT_FOR_COLS]=9  \{ .PRINT *****\c \}
8873 .                   if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
8874 .                \}
8875 .                el \{\
8876 .                   if \\n[#FN_COUNT]=1  \{ .PRINT *\c \}
8877 .                   if \\n[#FN_COUNT]=2  \{ .PRINT \(dg\c \}
8878 .                   if \\n[#FN_COUNT]=3  \{ .PRINT **\c \}
8879 .                   if \\n[#FN_COUNT]=4  \{ .PRINT \(dg\(dg\c \}
8880 .                   if \\n[#FN_COUNT]=5  \{ .PRINT ***\c \}
8881 .                   if \\n[#FN_COUNT]=6  \{ .PRINT \(dg\(dg\(dg\c \}
8882 .                   if \\n[#FN_COUNT]=7  \{ .PRINT ****\c \}
8883 .                   if \\n[#FN_COUNT]=8  \{ .PRINT \(dg\(dg\(dg\(dg\c \}
8884 .                   if \\n[#FN_COUNT]=9  \{ .PRINT *****\c \}
8885 .                   if \\n[#FN_COUNT]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
8886 .                \}
8887 .             \}
8888 .             if \\n[#FN_MARKER_STYLE]=2 \{\
8889 .                if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
8890 .                if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\c" \}
8891 .             \}
8892 .         \}
8893 .      \}
8894 .    \}
8895 .    el \{\
8896 .       ie '\\$1'INDENT' \{\
8897 .          ev FOOTNOTES
8898 .          if '\\$2'L'     \{ .in (\\$3)  \}
8899 .          if '\\$2'LEFT'  \{ .in (\\$3)  \}
8900 .          if '\\$2'R'     \{ .nr #FN_R_INDENT (\\$3) \}
8901 .          if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
8902 .          if '\\$2'B' \{\
8903 .             nr #FN_BL_INDENT (\\$3)
8904 .             ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
8905 .             el \{ .nr #FN_BR_INDENT (\\$4) \}
8906 .             in \\n[#FN_BL_INDENT]u
8907 .          \}
8908 .          if '\\$2'BOTH' \{\
8909 .             nr #FN_BL_INDENT (\\$3)
8910 .             ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
8911 .             el \{ .nr #FN_BR_INDENT (\\$4) \}
8912 .             in \\n[#FN_BL_INDENT]u
8913 .          \}
8914 .          ev
8915 .          FOOTNOTE
8916 .       \}
8917 .       el \{\
8918 .          br
8919 .          di
8920 .          in 0 \"Turn off indent possibly set by FOOTNOTE INDENT...
8921 .          if \\n[#PRINT_STYLE]=1 \{\
8922 .             if \\n[#UNDERLINE_WAS_ON] \{\
8923 .                UNDERLINE
8924 .                rr #UNDERLINE_WAS_ON
8925 .             \}
8926 .          \}
8927 .          ev
8928 .          rr #FN_R_INDENT
8929 .          rr #FN_BR_INDENT
8930 .          nr #PP_STYLE \\n[#PP_STYLE_PREV]
8931 .          if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
8932 .          rr #INDENT_FIRSTS
8933 .          nr #FN_DEPTH +\\n[#DIVER_DEPTH]
8934 .          if \\n[#FN_DEFER] \{\
8935 .             nr #FN_DEFER_SPACE 1
8936 .             rr #FN_DEFER
8937 .          \}
8938 .          if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
8939 .             ie \\n[#SPACE_REMAINING]<(\\n[#LEAD]*2) \{ .nr #FN_DEFER 1 \}
8940 .             el \{\
8941 .                nr #FN_LINES 0 1
8942 .                while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
8943 .                   nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
8944 .                \}
8945 .             \}
8946 .          \}
8947 .          nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
8948 .          if \\n[#FN_COUNT]=1 \{ .nr #VARIABLE_FOOTER_POS -1v \}
8949 .          \}
8950 .          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
8951 .          if (\\n(nl+1v)>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
8952 .             ch FOOTER \\n(nlu+1v
8953 .          \}
8954 .          if \\n[#FN_DEFER] \{\
8955 .             nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
8956 .             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
8957 .          \}
8958 .       \}
8959 .    nr #NO_FN_MARKER 0
8960 .END
8963 .MAC FN_OVERFLOW_TRAP END
8964 .    if \\n[#FN_COUNT] \{\
8965 .       di FN_OVERFLOW
8966 .     \}
8967 .END
8970 .MAC DIVERT_FN_LEFTOVER END
8971 .    nr #NO_FN_MARKER 1
8972 .    nr #OVERFLOW 1
8973 .    FOOTNOTE
8974 .    nf
8975 .    FN_OVERFLOW
8976 .    FOOTNOTE OFF
8977 .    rr #FN_OVERFLOW_DEPTH
8978 .END
8981 .MAC PROCESS_FN_LEFTOVER END
8982 .    if !\\n[#FN_DEFER] \{\
8983 .       nr #FN_COUNT 0 1
8984 .       nr #FN_DEPTH 0
8985 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
8986 .    \}
8987 .    if \\n[#FN_DEFER] \{\
8988 .       nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]+\\n[#DOC_LEAD])
8989 .    \}
8990 .    nr #SPACE_REMAINING 0
8991 .    ch FOOTER -\\n[#B_MARGIN]u
8992 .    if \\n[#FN_DEFER] \{\
8993 .       nr #NO_FN_MARKER 1
8994 .       da FOOTNOTES
8995 .       di
8996 .       FOOTNOTE
8997 .       nf
8998 .       FOOTNOTE OFF
8999 .    \}
9000 .    if !\\n[#FN_DEFER] \{\
9001 .       if \\n[#FN_OVERFLOW_DEPTH] \{\
9002 .           DIVERT_FN_LEFTOVER
9003 .       \}
9004 .    \}
9005 .    nr #FN_COUNT 0 1
9006 .END
9009 \# ====================================================================
9011 \# +++ENDNOTES+++
9013 \# When endnotes are output, the spacing between the notes is always 1
9014 \# extra linespace.  This can have bottom margin consequences.  If this
9015 \# doesn't bother you, don't worry about it.  If it does bother you, and
9016 \# you want to adjust the spacing between any two endnotes (as they're
9017 \# output), make the spacing adjustments (.ALD/.RLD) at the *end* of
9018 \# endnotes (i.e. just before .ENDNOTE OFF), not at the top.
9020 \# Endnotes must be output manually with .ENDNOTES.  This allows user
9021 \# the flexibility to output endnotes at the end of each collated
9022 \# document, or to output them at the end of the entire document.
9024 \# ENDNOTE FAMILY
9025 \# --------------
9026 \# *Argument:
9027 \#   <family to use in endnotes>
9028 \# *Function:
9029 \#   Creates or modifies string $EN_FAM.
9030 \# *Notes:
9031 \#   Default is same as running text in body of document.
9033 .MAC ENDNOTE_FAMILY END
9034 .    ds $EN_FAM \\$1
9035 .END
9038 \# ENDNOTE FONT
9039 \# ------------
9040 \# *Argument:
9041 \#   <font to use in endnotes>
9042 \# *Function:
9043 \#   Creates or modifies string $EN_FT.
9044 \# *Notes:
9045 \#   Default is roman.
9047 .MAC ENDNOTE_FONT END
9048 .    ds $EN_FT \\$1
9049 .END
9052 \# ENDNOTE POINT SIZE
9053 \# ------------------
9054 \# *Argument:
9055 \#   <base point size for endnotes>
9056 \# *Function:
9057 \#   Creates or modifies register #EN_PS.
9058 \# *Notes:
9059 \#   Default is same as running text in body of document.
9061 \#   This size control macro differs from other size control macros
9062 \#   in that it sets an absolute point size, not a relative one.  This
9063 \#   is because a) endnotes always appear separate from the body of
9064 \#   a document and therefore don't need to be relative to the body
9065 \#   of the document, and b) there are quite a few elements of the
9066 \#   endnotes page(s) that need to be relative to the base point size
9067 \#   of that page.  If the base endnote point size were relative to
9068 \#   the body of the document (i.e. a _SIZE macro taking a +|- value)
9069 \#   getting the rest of the endnote elements sized properly could
9070 \#   become very confusing.
9072 .MAC ENDNOTE_PT_SIZE END
9073 .    nr #EN_PS (p;\\$1)
9074 .END
9077 \# ENDNOTE LEAD
9078 \# ------------
9079 \# *Argument:
9080 \#   <base leading to use in endnotes> [ ADJUST ]
9081 \# *Function:
9082 \#   Creates or modifies register #EN_LEAD.  Creates or removes
9083 \#   register #ADJ_EN_LEAD.  Stores arguments in strings if ENDNOTE_LEAD
9084 \#   set before START.
9085 \# *Notes:
9086 \#   Default is 14 points for TYPESET, adjusted; 24 for TYPEWRITE.
9088 .MAC ENDNOTE_LEAD END
9089 .    if !\\n[#OK_PROCESS_LEAD] \{\
9090 .       ds $EN_LEAD \\$1
9091 .       if !'\\$2'' \{\
9092 .           ds $ADJUST_EN_LEAD \\$2
9093 .       \}
9094 .       return
9095 .    \}
9096 .    rr #ADJ_EN_LEAD
9097 .    nr #EN_LEAD (p;\\$1)
9098 .    if '\\$2'ADJUST' \{\
9099 .       nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
9100 .       nr #ADJ_DOC_LEAD 1
9101 .       nr #ADJ_EN_LEAD 1
9102 .       nr #NO_TRAP_RESET 1
9103 .       DOC_LEAD \\n[#EN_LEAD]u ADJUST
9104 .       nr #EN_LEAD \\n[#DOC_LEAD]
9105 .       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
9106 .       rr #NO_TRAP_RESET
9107 .       rr #ADJ_DOC_LEAD
9108 .       rr #ORIG_DOC_LEAD
9109 .    \}
9110 .END
9113 \# ENDNOTE QUAD
9114 \# ------------
9115 \# *Argument:
9116 \#   LEFT | L | CENTER | C | RIGHT | R | JUSTIFY | J
9117 \# *Function:
9118 \#   Creates or modifies string $EN_QUAD.
9119 \# *Notes:
9120 \#   Default is justified for TYPESET, left for TYPEWRITE.
9122 .MAC ENDNOTE_QUAD END
9123 .    ds $EN_QUAD \\$1
9124 .END
9127 \# ENDNOTES_HDRFTR_CENTER
9128 \# ----------------------
9129 \# *Argument:
9130 \#   toggle
9131 \# *Function:
9132 \#   Creates or removes toggle register #EN_HDRFTR_CENTER, used to
9133 \#   determine whether mom should print a/the hdrftr center string
9134 \#   on the endnotes page.  Primarily to enable/disable printing of the
9135 \#   chapter name in hdrftrs when DOCTYPE CHAPTER.
9136 \# *Notes:
9137 \#   Default is OFF
9139 .MAC ENDNOTES_HDRFTR_CENTER END
9140 .    ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
9141 .    el         \{ .rr #EN_HDRFTR_CENTER   \}
9142 .END
9145 \# ENDNOTE STRING 
9146 \# --------------
9147 \# *Argument:
9148 \#   <title for endnotes page>
9149 \# *Function:
9150 \#   Creates or modifies string $EN_STRING.
9151 \# *Notes:
9152 \#   Default is "Endnotes"
9154 .MAC ENDNOTE_STRING END
9155 .    ds $EN_STRING \\$1
9156 .END
9159 \# ENDNOTE STRING FAMILY
9160 \# ---------------------
9161 \# *Argument:
9162 \#   <family to use for endnote string>
9163 \# *Function:
9164 \#   Creates or modifies string $EN_STRING_FAM.
9165 \# *Notes:
9166 \#   Default is same as running text in body of document.
9168 .MAC ENDNOTE_STRING_FAMILY END
9169 .    ds $EN_STRING_FAM \\$1
9170 .END
9173 \# ENDNOTE STRING FONT
9174 \# -------------------
9175 \# *Argument:
9176 \#   <font to use for endnote string>
9177 \# *Function:
9178 \#   Creates or modifies string $EN_FT.
9179 \# *Notes:
9180 \#   Default is BOLD for TYPEWRITE; roman for TYPESET
9182 .MAC ENDNOTE_STRING_FONT END
9183 .    ds $EN_STRING_FT \\$1
9184 .END
9187 \# ENDNOTE STRING SIZE
9188 \# -------------------
9189 \# *Argument:
9190 \#   <+|- number of points by which to in/decrease endnote string
9191 \#    (relative to base endnote size)>
9192 \# *Function:
9193 \#   Creates or modifies string $EN_STRING_SIZE_CHANGE.
9194 \# *Notes:
9195 \#   Default is +1 for TYPESET.
9197 .MAC ENDNOTE_STRING_SIZE END \"Default for TYPESET is +1
9198 .    ds $EN_STRING_SIZE_CHANGE \\$1
9199 .END
9202 \# ENDNOTE STRING QUAD
9203 \# -------------------
9204 \# *Argument:
9205 \#   LEFT | L | CENTER | C | RIGHT | R
9206 \# *Function:
9207 \#   Creates or modifies string $EN_STRING_QUAD.
9208 \# *Notes:
9209 \#   Default is centered.
9211 .MAC ENDNOTE_STRING_QUAD END
9212 .    ds $EN_STRING_QUAD \\$1
9213 .END
9216 \# ENDNOTE STRING UNDERSCORE
9217 \# -------------------------
9218 \# *Arguments:
9219 \#   toggle | 2
9220 \# *Function:
9221 \#   Turns underscoring of endnote main title on or off.  If the argument
9222 \#   is the digit "2", turns on double-underscoring.
9223 \# *Notes:
9224 \#   Default is double-underscored.
9226 .MAC ENDNOTE_STRING_UNDERSCORE END
9227 .    ie '\\$1'' \{ .nr #EN_STRING_UNDERSCORE 1 \}
9228 .    el \{\
9229 .       ie '\\$1'2' \{ .nr #EN_STRING_UNDERSCORE 2 \}
9230 .       el \{ .nr #EN_STRING_UNDERSCORE 0 \}
9231 .    \}
9232 .END
9235 \# ENDNOTE STRING CAPS
9236 \# -------------------
9237 \# *Arguments:
9238 \#   <none> | <anything>
9239 \# *Function:
9240 \#   Turns capitalization of the endnotes pages title string
9241 \#   "Endnotes" on or off.
9242 \# *Notes:
9243 \#   Users may want the endnotes pages title string to be in caps,
9244 \#   but the toc entry for endnotes in lower case.  If the argument
9245 \#   to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
9246 \#   turned on, this is exactly what will happen.
9248 \#   Default is on.
9250 .MAC ENDNOTE_STRING_CAPS END
9251 .   ie '\\$1'' \{ .nr #EN_STRING_CAPS 1 \}
9252 .   el \{ .rr #EN_STRING_CAPS \}
9253 .END
9256 \# ENDNOTE TITLE
9257 \# -------------
9258 \# *Argument:
9259 \#   <string that appears before the first endnote pertaining to any document>
9260 \# *Function:
9261 \#   Creates string $EN_TITLE_STRING.
9262 \# *Notes:
9263 \#   Default is the document title, or, if doc is a chapter, "Chapter #"
9265 .MAC ENDNOTE_TITLE END
9266 .    ds $EN_TITLE \\$1
9267 .END
9270 \# ENDNOTE TITLE FAMILY
9271 \# --------------------
9272 \# *Argument:
9273 \#   <family to use for endnote title>
9274 \# *Function:
9275 \#   Creates string $EN_TITLE_FAM.
9276 \# *Notes:
9277 \#   Default is same as running text of document.
9279 .MAC ENDNOTE_TITLE_FAMILY END
9280 .    ds $EN_TITLE_FAM \\$1
9281 .END
9284 \# ENDNOTE TITLE FONT
9285 \# ------------------
9286 \# *Argument:
9287 \#   <font to use for endnote title>
9288 \# *Function:
9289 \#   Creates string $EN_TITLE_FT.
9290 \# *Notes:
9291 \#   Default is bold for TYPESET; roman for TYPEWRITE.
9293 .MAC ENDNOTE_TITLE_FONT END
9294 .    ds $EN_TITLE_FT \\$1
9295 .END
9298 \# ENDNOTE TITLE SIZE
9299 \# ------------------
9300 \# *Argument:
9301 \#   <+|- number of points by which to in/decrease endnote title
9302 \#    (relative to base endnote size)>
9303 \# *Function:
9304 \#   Creates string $EN_TITLE_SIZE_CHANGE.
9305 \# *Notes:
9306 \#   Default is 0 (i.e. title same size as text of endnotes).
9308 .MAC ENDNOTE_TITLE_SIZE END
9309 .    ds $EN_TITLE_SIZE_CHANGE \\$1 
9310 .END
9313 \# ENDNOTE TITLE QUAD
9314 \# ------------------
9315 \# *Argument:
9316 \#   <quad direction of endnote title>
9317 \# *Function:
9318 \#   Creates string $EN_TITLE_QUAD.
9319 \# *Notes:
9320 \#   Default is left.
9322 .MAC ENDNOTE_TITLE_QUAD END
9323 .    ds $EN_TITLE_QUAD \\$1
9324 .END
9327 \# ENDNOTE TITLE UNDERSCORE
9328 \# ------------------------
9329 \# *Argument:
9330 \#   toggle
9331 \# *Function:
9332 \#   Creates or removes register #EN_TITLE_UNDERSCORE.
9333 \# *Notes:
9334 \#   Default is to underscore the endnote titles.
9336 .MAC ENDNOTE_TITLE_UNDERSCORE END
9337 .    ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
9338 .    el \{ .rr #EN_TITLE_UNDERSCORE \}
9339 .END
9342 \# ENDNOTE NUMBER FAMILY
9343 \# ---------------------
9344 \# *Argument:
9345 \#   <family to use for endnote numbers on endnotes page>
9346 \# *Function:
9347 \#   Creates string $EN_NUMBER_FAM.
9348 \# *Notes:
9349 \#   Default is same as running text of document.
9351 \#   Family, font, and size of endnote numbers applies only to the
9352 \#   numbers as they appear on the endnotes page(s).  The superscript
9353 \#   numbers that appear in running text are unaffected.
9355 .MAC ENDNOTE_NUMBER_FAMILY END
9356 .    ds $EN_NUMBER_FAM \\$1
9357 .END
9360 \# ENDNOTE NUMBER FONT
9361 \# -------------------
9362 \# *Argument:
9363 \#   <font to use for endnote numbers on endnotes page>
9364 \# *Function:
9365 \#   Creates string $EN_NUMBER_FT.
9366 \# *Notes:
9367 \#   Default is bold for TYPESET; roman for TYPEWRITE.
9369 \#   Family, font, and size of endnote numbers applies only to the
9370 \#   numbers as they appear on the endnotes page(s).  The superscript
9371 \#   numbers that appear in running text are unaffected.
9373 .MAC ENDNOTE_NUMBER_FONT END \"Default for TYPESET is bold
9374 .    ds $EN_NUMBER_FT \\$1
9375 .END
9378 \# ENDNOTE NUMBER SIZE
9379 \# -------------------
9380 \# *Argument:
9381 \#   <+|- number of points by which to in/decrease endnote numbers
9382 \#    (relative to base endnote size)>
9383 \# *Function:
9384 \#   Creates string $EN_NUMBER_SIZE_CHANGE.
9385 \# *Notes:
9386 \#   Default is 0.
9388 \#   Family, font, and size of endnote numbers applies only to the
9389 \#   numbers as they appear on the endnotes page(s).  The superscript
9390 \#   numbers that appear in running text are unaffected.
9392 .MAC ENDNOTE_NUMBER_SIZE END
9393 .    ds $EN_NUMBER_SIZE_CHANGE \\$1
9394 .END
9397 \# ENDNOTE NUMBERS ALIGN RIGHT
9398 \# ---------------------------
9399 \# *Argument:
9400 \#   <max. number of digit placeholders that will appear in endnotes>
9401 \# *Function:
9402 \#   Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
9403 \#   #EN_NUMBER_PLACEHOLDERS.
9404 \# *Notes:
9405 \#   Default is for footnote numbers to be right aligned to 2 placeholders.
9407 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
9408 .    rr #EN_NUMBERS_ALIGN_LEFT
9409 .    nr #EN_NUMBERS_ALIGN_RIGHT 1
9410 .    nr #EN_NUMBER_PLACEHOLDERS \\$1
9411 .END
9414 \# ENDNOTE NUMBERS ALIGN LEFT
9415 \# --------------------------
9416 \# *Argument:
9417 \#   none
9418 \# *Function:
9419 \#   Toggles register #EN_NUMBERS_ALIGN_LEFT on.
9420 \# *Notes:
9421 \#   Default is for footnote numbers to be right aligned to 2 placeholders
9422 \#   (i.e. not left aligned).
9424 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
9425 .    rr #EN_NUMBERS_ALIGN_RIGHT
9426 .    nr #EN_NUMBERS_ALIGN_LEFT 1
9427 .END
9430 \# ENDNOTE PARAGRAPH INDENT
9431 \# ------------------------
9432 \# *Argument:
9433 \#   <first line indent of paras subsequent to 1st in endnotes>
9434 \# *Function:
9435 \#   Creates register #EN_PP_INDENT for use in .PP.
9436 \# *Notes:
9437 \#   Requires a unit of measure.
9439 \#   Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
9441 .MAC ENDNOTE_PARA_INDENT END
9442 .    nr #EN_PP_INDENT (\\$1)
9443 .END
9446 \# TURN OFF COLUMN MODE FOR ENDNOTES
9447 \# ---------------------------------
9448 \# *Argument:
9449 \#   <none> | <anything>
9450 \# *Function:
9451 \#   Creates or removes register #EN_NO_COLS
9452 \# *Notes:
9453 \#   Allows user to tell mom not to set endnotes in columnar
9454 \#   documents in columns.  Default is to set endnotes in columns.
9456 .MAC ENDNOTES_NO_COLUMNS END
9457 .    ie '\\$1'' \{ .nr #EN_NO_COLS 1 \}
9458 .    el \{ .rr #EN_NO_COLS \}
9459 .END
9462 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
9463 \# -------------------------------------------
9464 \# *Argument:
9465 \#   <none> | <anything>
9466 \# *Function:
9467 \#   Creates or removes register #EN_NO_FIRST_PN
9468 \# *Notes:
9469 \#   For use if FOOTERS are on.  Tells ENDNOTES not to put a page
9470 \#   number on the first endnotes page.  Some users may want this.
9471 \#   Default is to print a page number at the top of the first
9472 \#   endnotes page when footers are on.
9474 .MAC ENDNOTES_NO_FIRST_PAGENUM END
9475 .    ie '\\$1'' \{ .nr #EN_NO_FIRST_PN 1 \}
9476 .    el \{ .rr #EN_NO_FIRST_PN \}
9477 .END
9480 \# PAGE HEADERS ON ENDNOTES PAGES
9481 \# ------------------------------
9482 \# *Argument:
9483 \#   <none> | ALL
9484 \# *Function:
9485 \#   Creates or removes register #EN_ALLOWS_HEADERS or
9486 \#   #EN_ALLOWS_HEADERS_ALL
9487 \# *Notes:
9488 \#   Whether ENDNOTES puts a page header at the top of endnotes
9489 \#   pages if page headers are used throughout the document.
9490 \#   Default is to insert the page headers, but not on the first
9491 \#   page.  If the optional argument ALL is given, ENDNOTES puts a
9492 \#   page header on the first page as well.
9494 .MAC ENDNOTES_ALLOWS_HEADERS END
9495 .    ie '\\$1'' \{ .nr #EN_ALLOWS_HEADERS 1 \}
9496 .    el \{\
9497 .       ie '\\$1'ALL' \{\
9498 .          nr #EN_ALLOWS_HEADERS 1
9499 .          nr #EN_ALLOWS_HEADERS_ALL 1
9500 .       \}
9501 .       el \{\
9502 .          rr #EN_ALLOWS_HEADERS
9503 .          rr #EN_ALLOWS_HEADERS_ALL
9504 .       \}
9505 .    \}
9506 .END
9509 \# ENDNOTES PAGES PAGE NUMBERING STYLE
9510 \# ----
9511 \# *Argument:
9512 \#   DIGIT | ROMAN | roman | ALPHA | alpha
9513 \# *Function:
9514 \#   Creates or modifies $EN_PN_STYLE.
9515 \# *Notes:
9516 \#   Allows user to define what style should be used for endnotes
9517 \#   pages page numbering.  Arguments are the same as for
9518 \#   PAGENUM_STYLE.
9520 \#   Default is DIGIT.
9522 .MAC ENDNOTES_PAGENUM_STYLE END
9523 .    ds $EN_PN_STYLE \\$1
9524 .END
9527 \# FIRST PAGE NUMBER FOR ENDNOTES
9528 \# ------------------------------
9529 \# *Argument:
9530 \#   <page number that appears on page 1 of endnotes pages>
9531 \# *Function:
9532 \#   Creates or modifies string $EN_FIRST_PN
9533 \# *Notes:
9534 \#   To be used with caution, only if all endnotes
9535 \#   are to be output at once, i.e. not at the end of the separate
9536 \#   docs of a collated doc
9538 .MAC ENDNOTES_FIRST_PAGENUMBER END
9539 .    nr #EN_FIRST_PN \\$1
9540 .END
9542 \# SINGLESPACE ENDNOTES
9543 \# --------------------
9544 \# *Argument:
9545 \#   <none> | <anything>
9546 \# *Function:
9547 \#   Sets lead of endnotes pages in TYPEWRITE to 12 points,
9548 \#   adjusted.
9549 \# *Notes:
9550 \#   Default is to double-space endnotes pages.
9552 .MAC SINGLESPACE_ENDNOTES END
9553 .    if \\n[#PRINT_STYLE]=1 \{\
9554 .       ie \\n[#SINGLE_SPACE] \{\
9555 .          nr #EN_SINGLESPACE 1
9556 .          rr #IGNORE
9557 .          if \\n[#OK_PROCESS_LEAD] \{\
9558 .             ENDNOTE_LEAD 12 ADJUST
9559 .             nr #IGNORE 1
9560 .          \}
9561 .       \}
9562 .       el \{\
9563 .          ie '\\$1'' \{\
9564 .             nr #EN_SINGLESPACE 1
9565 .             rr #IGNORE
9566 .             if \\n[#OK_PROCESS_LEAD] \{\
9567 .                ENDNOTE_LEAD 12 ADJUST
9568 .                nr #IGNORE 1
9569 .             \}
9570 .          \}
9571 .          el \{\
9572 .             rr #EN_SINGLESPACE
9573 .             rr #IGNORE
9574 .             if \\n[#OK_PROCESS_LEAD] \{\
9575 .                ENDNOTE_LEAD 24 ADJUST
9576 .                nr #IGNORE 1
9577 .             \}
9578 .          \}
9579 .       \}
9580 .    \}
9581 .END
9584 \# ENDNOTE PARAGRAPH SPACE
9585 \# -----------------------
9586 \# *Argument:
9587 \#   toggle
9588 \# *Function:
9589 \#   Creates toggle register #EN_PP_SPACE for use in .PP.
9590 \# *Notes:
9591 \#   Like PARA_SPACE.  Default is not to space endnote paras.
9593 .MAC ENDNOTE_PARA_SPACE END
9594 .    ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
9595 .    el \{ .rr #EN_PP_SPACE \}
9596 .END
9599 \# ENDNOTE
9600 \# -------
9601 \# *Argument:
9602 \#   toggle
9603 \# *Function:
9604 \#   Places superscript endnote number in text, then collects and
9605 \#   processes endnote in diversion END_NOTES.
9606 \# *Notes:
9607 \#   \c must be appended to the word immediately preceding .ENDNOTE.
9609 .MAC ENDNOTE END
9610 .    ie '\\$1'' \{\
9611 .       nr #ENDNOTE 1
9612 .       if \\n[#CONDENSE] \{ \*[CONDX]\c \}
9613 .       if \\n[#EXTEND]   \{ \*[EXTX]\c  \}
9614 .       if \\n[#PRINT_STYLE]=1 \{\
9615 .          if \\n[#UNDERLINE_ON] \{\
9616 .             nr #UNDERLINE_WAS_ON 1
9617 .             UNDERLINE OFF
9618 .          \}
9619 .          if \\n[#SLANT_ON] \{\
9620 .              nr #SLANT_WAS_ON 1
9621 \*[SLANTX]\c
9622 .          \}
9623 .          PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2"
9624 .       \}
9625 .       if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]" \}
9626 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
9627 .       nr #PP_STYLE 1
9628 .       if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
9629 .       INDENT_FIRST_PARAS
9630 .       ev EN
9631 .       da END_NOTES
9632 .       LL \\n[#DOC_L_LENGTH]u
9633 .       ta \\n(.lu
9634 .       if \\n[#COLUMNS] \{\
9635 .          ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
9636 .          el \{ .LL \\n[#COL_L_LENGTH]u \}
9637 .          ta \\n(.lu
9638 .       \}
9639 .       vs \\n[#EN_LEAD]u
9640 .       if \\n[#EN_NUMBER]=1 \{\
9641 \!.        ne 3
9642 .          if \\n[#PRINT_STYLE]=1 \{\
9643 .             fam C
9644 .             ft  R  
9645 .             ps  12
9646 .          \}
9647 .          if \\n[#PRINT_STYLE]=2 \{\
9648 .             FAMILY  \\*[$EN_TITLE_FAM]
9649 .             FT      \\*[$EN_TITLE_FT]
9650 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
9651 .          \}
9652 .          sp
9653 .          if !'\\*[$EN_TITLE]'' \{\
9654 .             if '\\*[$EN_TITLE_QUAD]'L'      \{ .LEFT   \}
9655 .             if '\\*[$EN_TITLE_QUAD]'LEFT'   \{ .LEFT   \}
9656 .             if '\\*[$EN_TITLE_QUAD]'C'      \{ .CENTER \}
9657 .             if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
9658 .             if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
9659 .             if '\\*[$EN_TITLE_QUAD]'R'      \{ .RIGHT  \}
9660 .             if '\\*[$EN_TITLE_QUAD]'RIGHT'  \{ .RIGHT  \}
9661 .             ie \\n[#EN_TITLE_UNDERSCORE] \{\
9662 .                UNDERSCORE "\\*[$EN_TITLE]
9663 .             \}
9664 .             el \{\
9665 .                PRINT "\\*[$EN_TITLE]
9666 .             \}
9667 .          \}
9668 .       \}
9669 .       ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
9670 .          ie \\n[#EN_NUMBER]=1 \{\
9671 .             if !'\\*[$EN_TITLE]'' \{ .sp \}
9672 .          \}
9673 .          el \{ .sp \}
9674 \!.        TRAP OFF
9675 .          if \\n[#PRINT_STYLE]=1 \{\
9676 .             fam C
9677 .             ft  R
9678 .             ps  12
9679 .          \}
9680 .          if \\n[#PRINT_STYLE]=2 \{\
9681 .             FAMILY  \\*[$EN_NUMBER_FAM]
9682 .             FT      \\*[$EN_NUMBER_FT]
9683 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
9684 .          \}
9685 .          nr #RESET_L_LENGTH \\n(.l
9686 .          nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
9687 .          ll \\n[#EN_NUMBER_L_LENGTH]u
9688 .          RIGHT
9689 \En[#EN_NUMBER].
9690 .          if \\n[#PRINT_STYLE]=1 \{\
9691 .             fam C
9692 .             ft  R
9693 .             ps  12
9694 .          \}
9695 .          if \\n[#PRINT_STYLE]=2 \{\
9696 .             FAMILY  \\*[$EN_FAM]
9697 .             FT      \\*[$EN_FT]
9698 .             PT_SIZE \\n[#EN_PS]u
9699 .          \}
9700 .          EL
9701 .          ll \\n[#RESET_L_LENGTH]u
9702 .          in \\n[#EN_NUMBER_L_LENGTH]u+\w'.\0'u
9703 .          nr #EN_TEXT_INDENT \\n(.i
9704 .          QUAD \\*[$EN_QUAD]
9705 \!.        TRAP
9706 .       \}
9707 .       el \{\
9708 .          ie \\n[#EN_NUMBER]=1 \{\
9709 .             if !'\\*[$EN_TITLE]'' \{ .sp \}
9710 .          \}
9711 .          el \{ .sp \}
9712 .          if \\n[#PRINT_STYLE]=1 \{\
9713 .             fam C
9714 .             ft  R
9715 .             ps  12
9716 .          \}
9717 .          if \\n[#PRINT_STYLE]=2 \{\
9718 .             FAMILY  \\*[$EN_NUMBER_FAM]
9719 .             FT      \\*[$EN_NUMBER_FT]
9720 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
9721 .          \}
9722 .          QUAD \\*[$EN_QUAD]
9723 \En[#EN_NUMBER].\0\c
9724 .          if \\n[#PRINT_STYLE]=2 \{\
9725 .             FAMILY  \\*[$EN_FAM]
9726 .             FT      \\*[$EN_FT]
9727 .             PT_SIZE \\n[#EN_PS]u
9728 .          \}
9729 .       \}
9730 .    \}
9731 .    el \{\
9732 .       br
9733 .       if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
9734 .          in 0
9735 .       \}
9736 .       di
9737 .       ev
9738 .       nr #PP_STYLE \\n[#PP_STYLE_PREV]
9739 .       if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
9740 .       rr #INDENT_FIRSTS
9741 .       rr #ENDNOTE
9742 .       if \\n[#PRINT_STYLE]=1 \{\
9743 .          if \\n[#UNDERLINE_WAS_ON] \{\
9744 .             rr #UNDERLINE_WAS_ON
9745 .             UNDERLINE
9746 .          \}
9747 .       \}
9748 .       if \\n[#SLANT_WAS_ON] \{\
9749 .          rr #SLANT_WAS_ON
9750 \*[SLANT]\c
9751 .       \}
9752 .    \}
9753 .END
9756 \# ENDNOTES
9757 \# --------
9758 \# *Arguments:
9759 \#   none
9760 \# *Function:
9761 \#   Sets new document leading from #EN_LEAD, breaks to a new page,
9762 \#   sets up an endnotes page based on registers and strings associated
9763 \#   with endnotes, then outputs diversion END_NOTES.
9765 .MAC ENDNOTES END
9766 .    nr #ENDNOTES 1
9767 .    nr #PAGINATION_STATE \\n[#PAGINATE]
9768 .    nr #EN_FIRST_PAGE 1
9769 .    nr #HEADER_STATE \\n[#HEADERS_ON]
9770 .    ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
9771 .    if \\n[#HEADERS_ON]=1 \{\
9772 .       if !\\n[#EN_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
9773 .    \}
9774 .    if \\n[#HEADER_STATE]=1 \{\
9775 .       ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
9776 .       el \{ .rm $HDRFTR_CENTER  \}
9777 .    \}
9778 .    ie !\\n[#SUSPEND_PAGINATION] \{\
9779 .       if \\n[#PAGINATE]=1 \{\
9780 .          if \\n[#PAGE_NUM_V_POS]=1 \{\
9781 .             PAGENUM_STYLE \\*[$EN_PN_STYLE]
9782 .             if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN]-1 \}
9783 .             if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
9784 .          \}
9785 .       \}
9786 .    \}
9787 .    el \{\
9788 .       ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
9789 .       el \{ .nr #PAGINATE 0 \}
9790 .    \}
9791 .    if \\n[#FOOTERS_ON]=1 \{\
9792 .       if !'\\*[$HDRFTR_CENTER_OLD]'' \{ .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD] \}
9793 .    \}
9794 .    NEWPAGE
9795 .    if \\n[#FINIS] \{\
9796 .       if \\n[#FOOTERS_WERE_ON] \{\
9797 .          FOOTERS
9798 .          rr #FOOTERS_WERE_ON
9799 .       \}
9800 .       if \\n[#PAGINATION_WAS_ON] \{\ \"This register only set in FINIS
9801 .          if \\n[#PAGINATION_STATE]=1 \{\
9802 .             PAGINATE
9803 .             rr #PAGINATION_WAS_ON
9804 .          \}
9805 .       \}
9806 .       rr #FINIS
9807 .    \}
9808 .    if \\n[#FOOTERS_WERE_ON] \{\
9809 .       FOOTERS
9810 .       rr #FOOTERS_WERE_ON
9811 .    \}
9812 .    if \\n[#PAGINATION_WAS_ON] \{\
9813 .       if \\n[#PAGINATION_STATE]=1 \{\
9814 .          PAGINATE
9815 .          rr #PAGINATION_WAS_ON
9816 .       \}
9817 .    \}
9818 .    if \\n[#FOOTERS_ON]=1 \{\
9819 .       ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
9820 .       rm $HDRFTR_CENTER_OLD
9821 .       rm $HDRFTR_CENTER_NEW
9822 .    \}
9823 .    ie !\\n[#SUSPEND_PAGINATION] \{\
9824 .       if \\n[#PAGE_NUM_V_POS]=1 \{\
9825 .          if r#EN_NO_FIRST_PN \{\
9826 .             if \\n[#PAGINATION_STATE]=1 \{\
9827 .                nr #PAGINATE 1
9828 .             \}
9829 .          \}
9830 .       \}
9831 .    \}
9832 .    el \{\
9833 .       if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
9834 .    \}
9835 .    rr #PAGINATION_STATE
9836 .    PAGENUM_STYLE \\*[$EN_PN_STYLE]
9837 .    if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
9838 .    if \\n[#HEADER_STATE]=1 \{\
9839 .       if \\n[#EN_ALLOWS_HEADERS] \{ .HEADERS \}
9840 .    \}
9841 \# Collect endnote title string for TOC
9842 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
9843 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
9844 .    ds $TOC_TITLE_ITEM \\*[$EN_STRING]\\|
9845 .    ev TOC_EV
9846 .    da TOC_ENTRIES
9847 .    if \\n[#PRINT_STYLE]=1 \{\
9848 .       fam C
9849 .       ft  R
9850 .       ps  12
9851 .    \}
9852 .    if \\n[#PRINT_STYLE]=2 \{\
9853 \!.     FAMILY  \\*[$TOC_TITLE_FAM]
9854 \!.     FT      \\*[$TOC_TITLE_FT]
9855 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
9856 .    \}
9857 \!.  TRAP OFF
9858 .    ie \\n[#PRINT_STYLE]=1 \{\
9859 \!.     PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
9860 .    \}
9861 .    el \{\
9862 \!.     PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
9863 .    \}
9864 \!.  EL
9865 \!.  ST 100 L
9866 \!.  ST 101 R
9867 .    if \\n[#PRINT_STYLE]=2 \{\
9868 \!.     FAMILY  \\*[$TOC_PN_FAM]
9869 \!.     FT      \\*[$TOC_PN_FT]
9870 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
9871 .    \}
9872 \!.  TAB 100
9873 \!.  PRINT \\*[LEADER]
9874 \!.  TN
9875 \!.  TRAP
9876 \!.  PRINT \\n[#TOC_ENTRY_PN]
9877 \!.  TQ
9878 .    di       
9879 .    ev
9880 \# End collection of endnote title string for TOC
9881 \# Process endnote
9882 .    if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#EN_LEAD]u \}
9883 .    if \\n[#PRINT_STYLE]=2 \{\
9884 .       if \\n[#EN_NO_COLS] \{\
9885 .          if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
9886 .          nr #COLUMNS 0
9887 .       \}
9888 .       nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
9889 .       ie \\n[#ADJ_EN_LEAD] \{\
9890 .          nr #DOC_LEAD \\n[#EN_LEAD]
9891 .       \}
9892 .       el \{ .DOC_LEAD \\n[#EN_LEAD]u \}
9893 .    \}
9894 .    PRINT \&
9895 .    sp |\\n[#T_MARGIN]u
9896 .    mk ec
9897 .    if \\n[#SLANT_ON] \{\
9898 \*[SLANTX]\c
9899 .    \}
9900 .    ev ENDNOTES
9901 .    if !'\\*[$EN_STRING]'' \{\
9902 .       if \\n[#PRINT_STYLE]=1 \{\
9903 .          fam C
9904 .          ft  R
9905 .          ps  12
9906 .          vs \\n[#EN_LEAD]u
9907 .       \}
9908 .       if \\n[#PRINT_STYLE]=2 \{\
9909 .          LL \\n[#DOC_L_LENGTH]u
9910 .          ta \\n(.lu
9911 .          if \\n[#COLUMNS] \{\
9912 .             ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
9913 .             el \{ .LL \\n[#COL_L_LENGTH]u \}
9914 .             ta \\n(.lu
9915 .          \}
9916 .          FAMILY  \\*[$EN_STRING_FAM]
9917 .          FT      \\*[$EN_STRING_FT]
9918 .          PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
9919 .          vs      \\n[#EN_LEAD]u
9920 .       \}
9921 .       if '\\*[$EN_STRING_QUAD]'L'      \{ .LEFT   \}
9922 .       if '\\*[$EN_STRING_QUAD]'LEFT'   \{ .LEFT   \}
9923 .       if '\\*[$EN_STRING_QUAD]'C'      \{ .CENTER \}
9924 .       if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
9925 .       if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
9926 .       if '\\*[$EN_STRING_QUAD]'R'      \{ .RIGHT  \}
9927 .       if '\\*[$EN_STRING_QUAD]'RIGHT'  \{ .RIGHT  \}
9928 .       EL
9929 .       if \\n[#EN_STRING_CAPS] \{ .CAPS \}
9930 .       ie \\n[#EN_STRING_UNDERSCORE] \{\
9931 .          ie \\n[#EN_STRING_UNDERSCORE]=2 \{\
9932 .             UNDERSCORE2 "\\*[$EN_STRING]
9933 .          \}
9934 .          el \{\
9935 .             UNDERSCORE "\\*[$EN_STRING]
9936 .          \}
9937 .       \}
9938 .       el \{\
9939 .          PRINT "\\*[$EN_STRING]
9940 .       \}
9941 .    \}
9942 .    CAPS OFF
9943 .    ALD \\n[#EN_LEAD]u
9944 .    QUAD \\*[$EN_QUAD]
9945 .    nf
9946 .    END_NOTES
9947 .    br
9948 .    ev
9949 .    rm END_NOTES
9950 .    if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#DOC_LEAD]u \}
9951 .    if \\n[#PRINT_STYLE]=2 \{\
9952 .       ie \\n[#ADJ_EN_LEAD] \{\
9953 .          nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
9954 .       \}
9955 .       el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
9956 .       rr #RESTORE_DOC_LEAD
9957 .    \}
9958 .    if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
9959 .    if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
9960 .    rr #ENDNOTES
9961 .END
9963 \# ====================================================================
9965 \# +++TABLE OF CONTENTS+++
9967 \# Strings to allocate space for leaders and entry page numbers
9969 .ds $TOC_PN \\*[ST100]\\F[\\*[$TOC_PN_FAM]]\\f[\\*[$TOC_PN_FT]]\\s[\\n[#TOC_PS]u]#\\*[ST100X]\\*[ST101]\\s[\\*[$TOC_PN_SIZE_CHANGE]]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\*[ST101X]
9970 .ds $TOC_PN_TYPEWRITE \\*[ST100]#\\*[ST100X]\\*[ST101]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST101X]
9972 \# TOC ENTRIES PAGE NUMBERS PADDING
9973 \# --------------------------------
9974 \# *Argument:
9975 \#   <number of placeholders for toc entries page numbers>
9976 \# *Function:
9977 \#   Creates or modifies register #TOC_PN_PADDING.
9978 \# *Notes:
9979 \#   "Placeholders" is the maximum number of digits in a page
9980 \#   number numeral.
9982 \#   Default is 3.
9984 .MAC TOC_PADDING END
9985 .    nr #TOC_PN_PADDING \\$1
9986 .END
9989 \# PAGINATE TOC
9990 \# ------------
9991 \# *Argument:
9992 \#   <none> | <anything>
9993 \# *Function:
9994 \#   Creates or removes register #PAGINATE_TOC.
9995 \# *Notes:
9996 \#   Default is to paginate toc.
9998 .MAC PAGINATE_TOC END
9999 .    ie '\\$1'' \{ .nr #PAGINATE_TOC 1 \}
10000 .    el \{ .nr #PAGINATE_TOC 0 \}
10001 .END
10004 \# TOC FAMILY
10005 \# ----------
10006 \# *Argument:
10007 \#   <overall default family for toc pages>
10008 \# *Function:
10009 \#   Creates string $TOC_FAM.
10010 \# *Notes:
10011 \#   Default is same as document family. 
10013 .MAC TOC_FAMILY END
10014 .    ds $TOC_FAM \\$1
10015 .END
10018 \# TOC POINT SIZE
10019 \# --------------
10020 \# *Argument:
10021 \#   <base point size for toc pages>
10022 \# *Function:
10023 \#   Creates or modifies register #TOC_PS.
10024 \# *Notes:
10025 \#   This size control macro differs from other size control macros
10026 \#   in that it sets an absolute point size, not a relative one.
10027 \#   See notes for ENDNOTE_PT_SIZE for explanation.  No unit of
10028 \#   measure required.
10030 \#   No unit of measure required (points assumed).  Default is 11.5
10031 \#   for TYPESET.
10033 .MAC TOC_PT_SIZE END
10034 .    nr #TOC_PS (p;\\$1)
10035 .END
10038 \# TOC LEADING
10039 \# -----------
10040 \# *Argument:
10041 \#   <leading for toc pages> [ADJUST]
10042 \# *Function:
10043 \#   Creates or modifies register #TOC_LEAD. If optional ADJUST
10044 \#   given, adjusts lead to fill page.  If #OK_PROCESS_LEAD doesn't
10045 \#   exist, stores arguments for when it's okay to run the macro.
10046 \# *Notes:
10047 \#   No unit of measure required (points assumed).
10049 \#   Default is same as DOC_LEAD.
10051 .MAC TOC_LEAD END
10052 .    if !\\n[#OK_PROCESS_LEAD] \{\
10053 .       ds $TOC_LEAD \\$1
10054 .       if !'\\$2'' \{\
10055 .           ds $ADJUST_TOC_LEAD \\$2
10056 .       \}
10057 .       return
10058 .    \}
10059 .    rr #ADJ_TOC_LEAD
10060 .    nr #TOC_LEAD (p;\\$1)
10061 .    if '\\$2'ADJUST' \{\
10062 .       nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
10063 .       nr #ADJ_DOC_LEAD 1
10064 .       nr #ADJ_TOC_LEAD 1
10065 .       nr #NO_TRAP_RESET 1
10066 .       DOC_LEAD \\n[#TOC_LEAD]u ADJUST
10067 .       nr #TOC_LEAD \\n[#DOC_LEAD]
10068 .       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
10069 .       rr #NO_TRAP_RESET
10070 .       rr #ADJ_DOC_LEAD
10071 .       rr #ORIG_DOC_LEAD
10072 .    \}
10073 .END
10076 \# TOC PAGES PAGE-NUMBERING STYLE
10077 \# ------------------------------
10078 \# *Argument:
10079 \#   DIGIT | ROMAN | roman | ALPHA | alpha
10080 \# *Function:
10081 \#   Creates or modifies string $TOC_PN_STYLE
10082 \# *Notes:
10083 \#   Page numbering style for page numbers that appear in the
10084 \#   headers/footers of toc pages.  See notes for PAGENUM_STYLE.  
10086 \#   Default is roman.
10088 .MAC TOC_PAGENUM_STYLE END
10089 .    ds $TOC_PN_STYLE \\$1
10090 .END
10093 \# TOC RECTO_VERSO SWITCH
10094 \# ----------------------
10095 \# *Argument:
10096 \#   <none> | <anything>
10097 \# *Function:
10098 \#   Creates or removes register #TOC_RV_SWITCH
10099 \# *Notes:
10100 \#   Allows switching of L/R margins if a doc is recto/verso and
10101 \#   the first toc page happens to fall the wrong way
10103 .MAC TOC_RV_SWITCH END
10104 .    ie '\\$1'' \{ .nr #TOC_RV_SWITCH 1 \}
10105 .    el \{ .rr #TOC_RV_SWITCH \}
10106 .END
10108 \# - for TOC "doc header" (i.e. "Contents")
10110 \# TOC HEADER FAMILY
10111 \# -----------------
10112 \# *Argument:
10113 \#   <family for toc header>
10114 \# *Function:
10115 \#   Creates or modifies string $TOC_HEADER_FAM
10116 \# *Notes:
10117 \#   Default is same as TOC_FAMILY.
10119 .MAC TOC_HEADER_FAMILY END
10120 .    ds $TOC_HEADER_FAM \\$1
10121 .END
10124 \# TOC HEADER FONT
10125 \# ---------------
10126 \# *Argument:
10127 \#   <font for toc header>
10128 \# *Function:
10129 \#   Creates or modified string $TOC_HEADER_FT
10130 \# *Notes:
10131 \#   Default is bold for TYPESET.
10133 .MAC TOC_HEADER_FONT END
10134 .    ds $TOC_HEADER_FT \\$1
10135 .END
10138 \# TOC HEADER SIZE
10139 \# --------------
10140 \# *Argument:
10141 \#   <+|- number of points by which to in/decrease toc header
10142 \#   (relative to overall toc point size)>
10143 \# *Function:
10144 \#   Creates or modifies string $TOC_HEADER_SIZE_CHANGE.
10145 \# *Notes:
10146 \#   Default is +4
10148 .MAC TOC_HEADER_SIZE END
10149 .    ds $TOC_HEADER_SIZE_CHANGE \\$1
10150 .END
10153 \# TOC HEADER QUAD
10154 \# ---------------
10155 \# *Argument:
10156 \#   L | LEFT | C | CENTER | CENTRE | R | RIGHT
10157 \# *Function:
10158 \#   Creates or modifies string $TOC_HEADER_QUAD.
10159 \# *Notes:
10160 \#   Default is LEFT.
10162 .MAC TOC_HEADER_QUAD END
10163 .    ds $TOC_HEADER_QUAD \\$1
10164 .END
10167 \# TOC HEADER STRING
10168 \# -----------------
10169 \# *Argument:
10170 \#   <string for "doc header" of first toc page>
10171 \# *Function:
10172 \#   Creates or modifies string $TOC_HEADER_STRING
10173 \# *Notes:
10174 \#   Default is "Contents".
10176 .MAC TOC_HEADER_STRING END
10177 .    ds $TOC_HEADER_STRING \\$1
10178 .END
10180 \# - for TOC entries page number numerals
10182 \# TOC ENTRIES PAGE NUMBER FAMILY
10183 \# ------------------------------
10184 \# *Argument:
10185 \#   <family to use for toc entries page number>
10186 \# *Function:
10187 \#   Creates or modifies string $TOC_PN_FAM.
10188 \# *Notes:
10189 \#   Default is same as $TOC_FAM.
10191 .MAC TOC_PN_FAMILY END
10192 .    ds $TOC_PN_FAM \\$1
10193 .END
10196 \# TOC ENTRIES PAGE NUMBER FONT
10197 \# ----------------------------
10198 \# *Argument:
10199 \#   <font to use for toc entries page number>
10200 \# *Function:
10201 \#   Creates or modifies string $TOC_PN_FT.
10202 \# *Notes:
10203 \#   Default is roman.
10205 .MAC TOC_PN_FONT END
10206 .    ds $TOC_PN_FT \\$1
10207 .END
10210 \# TOC ENTRIES PAGE NUMBER SIZE
10211 \# ----------------------------
10212 \# *Argument:
10213 \#   <+|- number of points by which to in/decrease toc
10214 \#   entries page numbers (relative to overall toc point size)>
10215 \# *Function:
10216 \#   Creates or modifies string $TOC_PN_SIZE_CHANGE.
10217 \# *Notes:
10218 \#   Default is +0.
10220 .MAC TOC_PN_SIZE END
10221 .    ds $TOC_PN_SIZE_CHANGE \\$1
10222 .END
10225 \# Control macros for toc doc titles, heads, subheads and paraheads 
10226 \# ----------------------------------------------------------------
10228 \# All these control macros behave the same way, setting the family,
10229 \# font, point size and indent from the left margin of the different
10230 \# kinds of entries that can appear in the toc.  The way they
10231 \# operate is identical to all other _FAMILY, _FONT and _SIZE
10232 \# control macros.  _INDENT takes an absolute value.
10233 \# TOC_APPENDS_AUTHORS is unique in this section.
10234 \# 
10235 \# - for title entries
10237 .MAC TOC_TITLE_FAMILY END
10238 .    ds $TOC_TITLE_FAM \\$1
10239 .END
10242 .MAC TOC_TITLE_FONT END
10243 .    ds $TOC_TITLE_FT \\$1
10244 .END
10247 .MAC TOC_TITLE_SIZE END
10248 .    ds $TOC_TITLE_SIZE_CHANGE \\$1
10249 .END
10252 .MAC TOC_TITLE_INDENT END
10253 .    nr #TOC_TITLE_INDENT (\\$1)
10254 .END
10257 .MAC TOC_TITLE_ENTRY END
10258 .    nr #USER_SET_TITLE_ITEM 1
10259 .    ds $USER_SET_TITLE_ITEM \\$1
10260 .END
10263 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
10264 \# -----------------------------------------
10265 \# *Argument:
10266 \#   <none> | <name(s) of author(s) as they should appear in toc doc title entries>
10267 \# *Function:
10268 \#   Creates register #TOC_AUTHORS (to tell TOC to append authors
10269 \#   to toc doc title entries).  Optionally creates string
10270 \#   $TOC_AUTHORS.
10271 \# *Notes:
10272 \#   Normally, TOC does not append the author(s) to a toc doc title
10273 \#   entry.  This special macro instructs TOC to do so.
10275 \#   If user has multiple authors for each doc when collating,
10276 \#   TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
10277 \#   COLLATE and START in each doc.  Otherwise, mom prints only the
10278 \#   first author given to AUTHOR.
10280 .MAC TOC_APPENDS_AUTHOR END
10281 .    nr #TOC_AUTHORS 1
10282 .    if !'\\$1'' \{\
10283 .       ds $TOC_AUTHORS \\$1
10284 .    \}
10285 .END
10287 \# - for head entries
10289 .MAC TOC_HEAD_FAMILY END
10290 .    ds $TOC_HEAD_FAM \\$1
10291 .END
10294 .MAC TOC_HEAD_FONT END
10295 .    ds $TOC_HEAD_FT \\$1
10296 .END
10299 .MAC TOC_HEAD_SIZE END
10300 .    ds $TOC_HEAD_SIZE_CHANGE \\$1
10301 .END
10304 .MAC TOC_HEAD_INDENT END
10305 .    nr #TOC_HEAD_INDENT (\\$1)
10306 .END
10308 \# - for subhead entries
10310 .MAC TOC_SUBHEAD_FAMILY END
10311 .    ds $TOC_SH_FAM \\$1
10312 .END
10315 .MAC TOC_SUBHEAD_FONT END
10316 .    ds $TOC_SH_FT \\$1
10317 .END
10320 .MAC TOC_SUBHEAD_SIZE END
10321 .    ds $TOC_SH_SIZE_CHANGE \\$1
10322 .END
10325 .MAC TOC_SUBHEAD_INDENT END
10326 .    nr #TOC_SH_INDENT (\\$1)
10327 .END
10329 \# - for parahead entries
10331 .MAC TOC_PARAHEAD_FAMILY END
10332 .    ds $TOC_PH_FAM \\$1
10333 .END
10336 .MAC TOC_PARAHEAD_FONT END
10337 .    ds $TOC_PH_FT \\$1
10338 .END
10341 .MAC TOC_PARAHEAD_SIZE END
10342 .    ds $TOC_PH_SIZE_CHANGE \\$1
10343 .END
10346 .MAC TOC_PARAHEAD_INDENT END
10347 .    nr #TOC_PH_INDENT (\\$1)
10348 .END
10351 .MAC TOC END
10352 .    if !r#PAGINATE_TOC \{ .PAGINATE_TOC \}
10353 .    nr #TOC_FIRST_PAGE 1
10354 .    if \\n[#FINIS] \{\
10355 .       if \\n[#FOOTERS_WERE_ON] \{\
10356 .          FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
10357 .       \}
10358 .    \}
10359 .    if \\n[#FOOTERS_ON]=1 \{\
10360 .       if !'\\*[$HDRFTR_CENTER_OLD]'' \{ .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD] \}
10361 .       ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
10362 .       el \{ .PAGINATION OFF \}
10363 .    \}
10364 .    if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS OFF \} \" But have to turn FOOTERS off again so they don't print when FINIS was called
10365 .    COLLATE
10366 .    if \\n[#FINIS] \{\
10367 .       if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \} \" Finally, turn footers on if they were on
10368 .       rr #FOOTERS_WERE_ON
10369 .       if \\n[#PAGINATION_WAS_ON] \{\
10370 .          nr #PAGINATE 1
10371 .          rr #PAGINATION_WAS_ON
10372 .       \}
10373 .       rr #FINIS
10374 .    \}
10375 .    ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
10376 .    el \{ .PAGINATION OFF \}
10377 .    if \\n[#FOOTERS_ON]=1 \{\
10378 .       ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
10379 .       rm $HDRFTR_CENTER_OLD
10380 .       rm $HDRFTR_CENTER_NEW
10381 .    \}
10382 .    rr #COLLATED_DOC
10383 .    DOCHEADER OFF
10384 .    PAGENUMBER 1
10385 .    if \\n[#PRINT_STYLE]=1 \{\
10386 .       rr #IGNORE
10387 .       DOC_LEAD 24 ADJUST
10388 .       nr #IGNORE 1
10389 .    \}
10390 .    START
10391 .    PP
10392 .    nr #COLUMNS 0
10393 .    if \\n[#PRINT_STYLE]=2 \{\
10394 .       ie r#ADJ_TOC_LEAD \{\
10395 .          nr #NO_TRAP_RESET 1
10396 .          DOC_LEAD \\n[#TOC_LEAD]u ADJUST
10397 .          rr #NO_TRAP_RESET
10398 .       \}
10399 .       el \{ .DOC_LEAD \\n[#TOC_LEAD]u \}
10400 .    \}
10401 .    sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
10402 .    if \\n[#SLANT_ON] \{\
10403 \*[SLANTX]\c
10404 .    \}
10405 .    DOC_LINE_LENGTH \\n[#DOC_L_LENGTH]u
10406 .    QUAD \\*[$TOC_HEADER_QUAD]
10407 .    PAGENUM_STYLE \\*[$TOC_PN_STYLE]
10408 .    if \\n[#PRINT_STYLE]=1 \{\
10409 .       fam C
10410 .       ft  R
10411 .       ps  12
10412 .    \}
10413 .    if \\n[#PRINT_STYLE]=2 \{\
10414 .       FAMILY  \\*[$TOC_HEADER_FAM]
10415 .       FT      \\*[$TOC_HEADER_FT]
10416 .       PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
10417 .    \}
10418 .    ie \\n[#PRINT_STYLE]=1 \{\
10419 .       CAPS
10420 .       UNDERLINE
10421 .       PRINT "\\*[$TOC_HEADER_STRING]"
10422 .       UNDERLINE OFF
10423 .       CAPS      OFF
10424 .    \}
10425 .    el \{\
10426 .       PRINT "\\*[$TOC_HEADER_STRING]"
10427 .    \}
10428 .    LEFT
10429 .    SP
10430 \# In collated docs, this bit inserts the first doc's title
10431 \# underneath the TOC header, before the TOC_ENTRIES diversion
10432 \# gets output.
10433 .    nf
10434 .    if d$FIRST_DOC_TITLE \{\
10435 .    nr #RESTORE_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
10436 .    TOC_PADDING \\n[#FIRST_DOC_TOC_PN_PADDING]
10437 .       if \\n[#PRINT_STYLE]=2 \{\
10438 .          FAMILY  \\*[$TOC_TITLE_FAM]
10439 .          FT      \\*[$TOC_TITLE_FT]
10440 .          PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
10441 .       \}
10442 .       ie \\n[#PRINT_STYLE]=1 \{\
10443 .          PAD "\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN_TYPEWRITE]" 
10444 .       \}
10445 .       el \{\
10446 .          PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN]"
10447 .       \}
10448 .       EL
10449 .       ST 100 L
10450 .       ST 101 R
10451 .       if \\n[#PRINT_STYLE]=2 \{\
10452 .          FAMILY  \\*[$TOC_PN_FAM]
10453 .          FT      \\*[$TOC_PN_FT]
10454 .          PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10455 .       \}
10456 .       TAB 100
10457 .       PRINT \\*[LEADER]
10458 .       TN
10459 .       PRINT \\n[#FIRST_DOC_TITLE_PN]
10460 .       TQ
10461 .    \}
10462 .    TOC_PADDING \\n[#RESTORE_TOC_PN_PADDING]
10463 .    nf
10464 .    TOC_ENTRIES
10465 .    br
10466 .    rr #TOC
10467 .END
10468 \# ====================================================================
10470 \# +++COLUMNS+++
10472 \# COLUMNS
10473 \# -------
10474 \# *Arguments:
10475 \#   <number of columns>  <width of gutters>
10476 \# *Function:
10477 \#   Creates registers associated with setting docs in columns.
10478 \#   Calculates column line lengths and offsets
10479 \# *Notes:
10480 \#   COLUMNS, if used, s/b the last macro invoked before START.
10482 .MAC COLUMNS END
10483 .    if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
10484 .    nr #COLUMNS 1
10485 .    nr #NUM_COLS \\$1
10486 .    nr #GUTTER (\\$2)
10487 .    nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
10488 .    nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
10489 .    nr #COL_NUM 0 1
10490 .    while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
10491 .       nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
10492 .       nr #COL_TOTAL \\n+[#COL_TOTAL]
10493 .    \}
10494 .    rr #COL_TOTAL
10495 .    rr #COL_NUM
10496 .END
10499 \# NEXT COLUMN
10500 \# -----------
10501 \# *Arguments:
10502 \#   <none>
10503 \# *Function:
10504 \#   Breaks current column and moves to next column.
10505 \#   If current column is the last on the page, breaks
10506 \#   to a new page.
10508 .MAC COL_NEXT END
10509 .    if \\n[#COLUMNS] \{\
10510 .       nr #COL_NEXT 1
10511 .       ie '\\$0'COL_NEXT' \{ .br  \}
10512 .       el \{\
10513 .          brp
10514 .          RLD 1v
10515 .       \}
10516 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
10517 .          bp
10518 .       \}
10519 .       el \{ .FOOTER \}
10520 .    \}
10521 .END
10523 \# ====================================================================
10525 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
10527 \# COLLATE
10528 \# -------
10529 \# *Arguments:
10530 \#   <none>
10531 \# *Function:
10532 \#   Turns headers off (if on) and saves header state, sets register
10533 \#   #COLLATE to 1 (toggle), and breaks to a new page.
10534 \# *Notes:
10535 \#   COLLATE exists primarily to allow putting multiple chapters in
10536 \#   a single file, although it can be used for any document type.  After
10537 \#   COLLATE, any of the macros that normally precede START may be
10538 \#   used, and should behave as expected.
10540 \#   N.B.--the START macro *must* be used after COLLATE (and any other
10541 \#   macros that alter mom's behaviour).
10543 .MAC COLLATE END
10544 .    nr #COLLATE 1
10545 .    nr #HEADER_STATE \\n[#HEADERS_ON]
10546 .    HEADERS OFF
10547 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
10548 .       nr #PAGINATION_STATE \\n[#PAGINATE]
10549 .       PAGINATION OFF
10550 .    \}
10551 .    IQ CLEAR
10552 .    TQ
10553 \# Collect first doc's title for TOC
10554 .    if \\n[#COLLATED_DOC]=0 \{\
10555 .       ie \\n[#USER_SET_TITLE_ITEM] \{\
10556 .          ds $FIRST_DOC_TITLE \\*[$USER_SET_TITLE_ITEM]\\|
10557 .          rr #USER_SET_TITLE_ITEM
10558 .          rm $USER_SET_TITLE_ITEM
10559 .       \}
10560 .       el \{\
10561 .          ie \\n[#DOC_TYPE]=2 \{\
10562 .             ie '\\*[$CHAPTER_TITLE]'' \{\
10563 .                ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
10564 .             \}
10565 .             el \{\
10566 .                ie '\\*[$CHAPTER]'' \{\
10567 .                   ds $FIRST_DOC_TITLE \\*[$CHAPTER_TITLE]\\|
10568 .                \}
10569 .                el \{\
10570 .                   ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
10571 .                \}
10572 .             \}
10573 .          \}
10574 .          el \{\
10575 .             ds $FIRST_DOC_TITLE \\*[$TITLE]\\|
10576 .          \}
10577 .       \}
10578 .       if \\n[#TOC_AUTHORS]=1 \{\
10579 .          ie '\\*[$TOC_AUTHORS]'' \{\
10580 .             as $FIRST_DOC_TITLE /\\|\\*[$AUTHOR_1]\\|
10581 .          \}
10582 .          el \{\
10583 .             as $FIRST_DOC_TITLE /\\|\\*[$TOC_AUTHORS]\\|
10584 .             rm $TOC_AUTHORS
10585 .          \}
10586 .       \}
10587 .       nr #COLLATED_DOC 1
10588 .    \}
10589 \# End title collection for TOC
10590 .    LL \\n[#DOC_L_LENGTH]u
10591 .    QUAD $DOC_QUAD
10592 .    LS \\n[#DOC_LEAD]u
10593 \*[SLANTX]
10594 \*[CONDX]
10595 \*[EXTX]
10596 '    NEWPAGE
10597 .    if \\n[#DEFER_PAGINATION] \{ .PAGINATE \}
10598 .    if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
10599 .       PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
10600 .       rm $RESTORE_PAGENUM_STYLE
10601 .    \}
10602 .    rm $EN_TITLE
10603 .END
10606 \# OUTPUT BLANK PAGES
10607 \# ------------------
10608 \# *Argument:
10609 \#   <number of blank pages to output>
10610 \# *Function:
10611 \#   Outputs blank pages.
10612 \# *Notes:
10613 \#   If recto/verso, each page is recto/verso, even if there's
10614 \#   nothing on it.
10616 .MAC BLANKPAGE END
10617 .    nr #HOW_MANY \\$1
10618 .    nr #PAGES 0 1
10619 .    while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
10620 .    if \\n[#HEADERS_ON]=1 \{\
10621 .       nr #HEADERS_WERE_ON 1
10622 .       HEADERS OFF
10623 .    \}
10624 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
10625 .       if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
10626 .       PAGINATION OFF
10627 .    \}
10628 .    NEWPAGE
10629 .    PRINT \&
10630 .    if \\n[#FOOTERS_ON]=1 \{\
10631 .       nr #FOOTERS_WERE_ON 1
10632 .       FOOTERS OFF
10633 .    \}
10634 .    if \\n[#PAGE_NUM_V_POS]=2 \{\
10635 .       if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
10636 .       PAGINATION OFF
10637 .    \}
10638 .    if \\n[#HEADERS_WERE_ON] \{ .HEADERS \}
10639 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
10640 .       if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
10641 .    \}
10642 .    \}
10643 .    NEWPAGE
10644 .    if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \}
10645 .    if \\n[#PAGE_NUM_V_POS]=2 \{\
10646 .       if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
10647 .     \}
10648 .    rr #HEADERS_WERE_ON
10649 .    rr #FOOTERS_WERE_ON
10650 .    rr #PAGINATE_WAS_ON
10651 .END
10654 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
10655 \# ---------------------------------------
10656 \# *Arguments:
10657 \#   <none>
10658 \# *Function:
10659 \#   Sets header/footer/footnotes/etc... traps.
10660 \#     Calculates the number of lines that actually fit on a
10661 \#   page based on #B_MARGIN and resets page bottom trap to coincide
10662 \#   with the depth of that number of lines , or, if #ADJ_DOC_LEAD=1,
10663 \#   adjusts #DOC_LEAD so that the last line of text on a page falls
10664 \#   exactly on #B_MARGIN.
10666 .MAC TRAPS END
10667 \#  *Remove all header/footer traps
10668 .    if !\\n[#NO_TRAP_RESET] \{\
10669 .       ch DO_T_MARGIN
10670 .       ch DO_B_MARGIN
10671 .       ch HEADER
10672 .       ch FOOTER
10673 \#  *Plant header trap
10674 .       wh 0 HEADER
10675 .    \}
10676 \#  *Adjust lead so last line of text falls on B_MARGIN,...
10677 .    ie \\n[#ADJ_DOC_LEAD]=1 \{\
10678 .       nr #LINES_PER_PAGE 0 1
10679 .       nr #DOC_LEAD_ADJ 0 1
10680 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
10681 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
10682 .       nr #LINES_PER_PAGE -1
10683 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
10684 .       DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
10685 .    \}
10686 \#  *...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
10687 \#  *on the page.
10688 .    el \{\
10689 .       nr #LINES_PER_PAGE 0 1
10690 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
10691 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
10692 .       nr #B_MARGIN \\n[#PAGE_LENGTH]-(\\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n[#LINES_PER_PAGE]))
10693 .    \}
10694 \#  *Set footer and footnote overflow traps
10695 .    if !\\n[#NO_TRAP_RESET] \{\
10696 .       nr #FN_COUNT 0 1
10697 .       nr #SPACE_REMAINING 0
10698 .       nr #FN_DEPTH 0
10699 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
10700 .       wh 12i FOOTER
10701 .       wh -\\n[#B_MARGIN]u FN_OVERFLOW_TRAP
10702 .       ch FOOTER -\\n[#B_MARGIN]u
10703 .    \}
10704 .    rr #ADJ_DOC_LEAD
10705 .END
10708 \# CHECK INDENT
10709 \# ------------
10710 \# *Arguments:
10711 \#   <none>
10712 \# *Function:
10713 \#   Adds left, right, or both indent values to document elements
10714 \#   like heads and subheads that are processed in environments.
10716 .MAC CHECK_INDENT END
10717 .    if \\n[#INDENT_LEFT_ACTIVE] \{\
10718 .       in \\n[#L_INDENT]u
10719 .       if \\n[#QUOTE] \{\
10720 .          in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
10721 .          ll -\\n[#L_INDENT]u
10722 .          ta \\n(.lu
10723 .       \}
10724 .       if \\n[#EPIGRAPH] \{\
10725 .          in -\\n[#L_INDENT]u
10726 .          ll -\\n[#L_INDENT]u
10727 .          ta \\n(.lu
10728 .       \}
10729 .    \}
10730 .    if \\n[#INDENT_RIGHT_ACTIVE] \{\
10731 .       ll -\\n[#R_INDENT]u
10732 .       ta \\n(.lu
10733 .    \}
10734 .    if \\n[#INDENT_BOTH_ACTIVE] \{\
10735 .       in \\n[#BL_INDENT]u
10736 .       ll -\\n[#BR_INDENT]u
10737 .       ta \\n(.lu
10738 .       if \\n[#QUOTE] \{\
10739 .          in -\\n[#BL_INDENT]u
10740 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
10741 .             ll -\\n[#BR_INDENT]u
10742 .             ta \\n(.lu
10743 .          \}
10744 .          el \{\
10745 .             ll -(\\n[#BR_INDENT]u/2u)
10746 .             ta \\n(.lu
10747 .          \}
10748 .       \}
10749 .       if \\n[#EPIGRAPH] \{\
10750 .          in -\\n[#BL_INDENT]u
10751 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
10752 .             ll -\\n[#BR_INDENT]u
10753 .             ta \\n(.lu
10754 .          \}
10755 .          el \{\
10756 .             ll -(\\n[#BR_INDENT]u/2u)
10757 .             ta \\n(.lu
10758 .          \}
10759 .       \}
10760 .    \}
10761 .END
10764 \# REMOVE INDENT
10765 \# -------------
10766 \# *Arguments:
10767 \#   <none>
10768 \# *Function:
10769 \#   Removes left, right, or both indent values from document elements
10770 \#   like heads and subheads that are processed in environments.
10772 .MAC REMOVE_INDENT END
10773 .    in 0
10774 .    ll \\n[#L_LENGTH]u
10775 .    ta \\n(.lu
10776 .END
10779 \# ====================================================================
10781 \# +++DOCUMENT PROCESSING ALIASES+++
10783 \# Aliases to make life easier for users: synonyms, short forms
10784 \# and alternate spellings.
10786 \# Macros
10787 \# ------
10788 .ALIAS   BREAK_BLOCKQUOTE                BREAK_QUOTE
10789 .ALIAS   BREAK_CITATION                  BREAK_QUOTE
10790 .ALIAS   BREAK_CITE                      BREAK_QUOTE
10791 .ALIAS   CITATION                        BLOCKQUOTE
10792 .ALIAS   CITE                            BLOCKQUOTE
10793 .ALIAS   DOC_R_MARGIN                    DOC_RIGHT_MARGIN
10794 .ALIAS   DOC_L_MARGIN                    DOC_LEFT_MARGIN
10795 .ALIAS   DOC_L_LENGTH                    DOC_LINE_LENGTH
10796 .ALIAS   DOC_RMARGIN                     DOC_RIGHT_MARGIN
10797 .ALIAS   DOC_LMARGIN                     DOC_LEFT_MARGIN
10798 .ALIAS   DOC_LLENGTH                     DOC_LINE_LENGTH
10799 .ALIAS   DOC_FAM                         DOC_FAMILY
10800 .ALIAS   FILL                            QUAD
10801 .ALIAS   PP_FT                           PP_FONT
10802 .ALIAS   DOC_PS                          DOC_PT_SIZE
10803 .ALIAS   DOC_LS                          DOC_LEAD
10804 .ALIAS   PAGENUM                         PAGENUMBER
10805 .ALIAS   PAGINATION                      PAGINATE
10806 .ALIAS   TOC_FAM                         TOC_FAM
10807 .ALIAS   TOC_PS                          TOC_PT_SIZE
10809 \# HEADER and FOOTER aliases for HDRFTR macros.
10811 .ALIAS   ENDNOTES_HEADER_CENTER          ENDNOTES_HDRFTR_CENTER
10812 .ALIAS   HEADER_FAMILY                   HDRFTR_FAMILY
10813 .ALIAS   HEADER_FAM                      HDRFTR_FAMILY
10814 .ALIAS   HEADER_SIZE                     HDRFTR_SIZE
10815 .ALIAS   HEADER_PLAIN                    HDRFTR_PLAIN
10816 .ALIAS   HEADER_RULE_GAP                 HDRFTR_RULE_GAP
10817 .ALIAS   HEADER_RULE                     HDRFTR_RULE
10818 .ALIAS   HEADER_LEFT                     HDRFTR_LEFT
10819 .ALIAS   HEADER_LEFT_FAMILY              HDRFTR_LEFT_FAMILY
10820 .ALIAS   HEADER_LEFT_FAM                 HDRFTR_LEFT_FAMILY
10821 .ALIAS   HEADER_LEFT_FONT                HDRFTR_LEFT_FONT
10822 .ALIAS   HEADER_LEFT_FT                  HDRFTR_LEFT_FONT
10823 .ALIAS   HEADER_LEFT_SIZE                HDRFTR_LEFT_SIZE
10824 .ALIAS   HEADER_LEFT_PS                  HDRFTR_LEFT_SIZE
10825 .ALIAS   HEADER_LEFT_CAPS                HDRFTR_LEFT_CAPS
10826 .ALIAS   HEADER_CENTER                   HDRFTR_CENTER
10827 .ALIAS   HEADER_CENTRE                   HDRFTR_CENTER
10828 .ALIAS   HEADER_CENTER_FAMILY            HDRFTR_CENTER_FAMILY
10829 .ALIAS   HEADER_CENTRE_FAMILY            HDRFTR_CENTER_FAMILY
10830 .ALIAS   HEADER_CENTER_FAM               HDRFTR_CENTER_FAMILY
10831 .ALIAS   HEADER_CENTRE_FAM               HDRFTR_CENTER_FAMILY
10832 .ALIAS   HEADER_CENTER_FONT              HDRFTR_CENTER_FONT
10833 .ALIAS   HEADER_CENTRE_FONT              HDRFTR_CENTER_FONT
10834 .ALIAS   HEADER_CENTER_FT                HDRFTR_CENTER_FONT
10835 .ALIAS   HEADER_CENTRE_FT                HDRFTR_CENTER_FONT
10836 .ALIAS   HEADER_CENTER_SIZE              HDRFTR_CENTER_SIZE
10837 .ALIAS   HEADER_CENTRE_SIZE              HDRFTR_CENTER_SIZE
10838 .ALIAS   HEADER_CENTER_PS                HDRFTR_CENTER_SIZE
10839 .ALIAS   HEADER_CENTRE_PS                HDRFTR_CENTER_SIZE
10840 .ALIAS   HEADER_CENTER_PAD               HDRFTR_CENTER_PAD
10841 .ALIAS   HEADER_CENTRE_PAD               HDRFTR_CENTER_PAD
10842 .ALIAS   HEADER_CENTER_CAPS              HDRFTR_CENTER_CAPS
10843 .ALIAS   HEADER_CENTRE_CAPS              HDRFTR_CENTER_CAPS
10844 .ALIAS   HEADER_RIGHT                    HDRFTR_RIGHT
10845 .ALIAS   HEADER_RIGHT_FAMILY             HDRFTR_RIGHT_FAMILY
10846 .ALIAS   HEADER_RIGHT_FAM                HDRFTR_RIGHT_FAMILY
10847 .ALIAS   HEADER_RIGHT_FONT               HDRFTR_RIGHT_FONT
10848 .ALIAS   HEADER_RIGHT_FT                 HDRFTR_RIGHT_FONT
10849 .ALIAS   HEADER_RIGHT_SIZE               HDRFTR_RIGHT_SIZE
10850 .ALIAS   HEADER_RIGHT_PS                 HDRFTR_RIGHT_SIZE
10851 .ALIAS   HEADER_RIGHT_CAPS               HDRFTR_RIGHT_CAPS
10852 .ALIAS   HEADER_RECTO                    HDRFTR_RECTO
10853 .ALIAS   HEADER_VERSO                    HDRFTR_VERSO
10854 .ALIAS   ENDNOTES_FOOTER_CENTER          ENDNOTES_HDRFTR_CENTER
10855 .ALIAS   FOOTER_FAMILY                   HDRFTR_FAMILY
10856 .ALIAS   FOOTER_FAM                      HDRFTR_FAMILY
10857 .ALIAS   FOOTER_SIZE                     HDRFTR_SIZE
10858 .ALIAS   FOOTER_PLAIN                    HDRFTR_PLAIN
10859 .ALIAS   FOOTER_RULE_GAP                 HDRFTR_RULE_GAP
10860 .ALIAS   FOOTER_RULE                     HDRFTR_RULE
10861 .ALIAS   FOOTER_LEFT                     HDRFTR_LEFT
10862 .ALIAS   FOOTER_LEFT_FAMILY              HDRFTR_LEFT_FAMILY
10863 .ALIAS   FOOTER_LEFT_FAM                 HDRFTR_LEFT_FAMILY
10864 .ALIAS   FOOTER_LEFT_FONT                HDRFTR_LEFT_FONT
10865 .ALIAS   FOOTER_LEFT_FT                  HDRFTR_LEFT_FONT
10866 .ALIAS   FOOTER_LEFT_SIZE                HDRFTR_LEFT_SIZE
10867 .ALIAS   FOOTER_LEFT_PS                  HDRFTR_LEFT_SIZE
10868 .ALIAS   FOOTER_LEFT_CAPS                HDRFTR_LEFT_CAPS
10869 .ALIAS   FOOTER_CENTER                   HDRFTR_CENTER
10870 .ALIAS   FOOTER_CENTRE                   HDRFTR_CENTER
10871 .ALIAS   FOOTER_CENTER_FAMILY            HDRFTR_CENTER_FAMILY
10872 .ALIAS   FOOTER_CENTRE_FAMILY            HDRFTR_CENTER_FAMILY
10873 .ALIAS   FOOTER_CENTER_FAM               HDRFTR_CENTER_FAMILY
10874 .ALIAS   FOOTER_CENTRE_FAM               HDRFTR_CENTER_FAMILY
10875 .ALIAS   FOOTER_CENTER_FONT              HDRFTR_CENTER_FONT
10876 .ALIAS   FOOTER_CENTRE_FONT              HDRFTR_CENTER_FONT
10877 .ALIAS   FOOTER_CENTER_FT                HDRFTR_CENTER_FONT
10878 .ALIAS   FOOTER_CENTRE_FT                HDRFTR_CENTER_FONT
10879 .ALIAS   FOOTER_CENTER_SIZE              HDRFTR_CENTER_SIZE
10880 .ALIAS   FOOTER_CENTRE_SIZE              HDRFTR_CENTER_SIZE
10881 .ALIAS   FOOTER_CENTER_PAD               HDRFTR_CENTER_PAD
10882 .ALIAS   FOOTER_CENTRE_PAD               HDRFTR_CENTER_PAD
10883 .ALIAS   FOOTER_CENTER_PS                HDRFTR_CENTER_SIZE
10884 .ALIAS   FOOTER_CENTRE_PS                HDRFTR_CENTER_SIZE
10885 .ALIAS   FOOTER_CENTER_CAPS              HDRFTR_CENTER_CAPS
10886 .ALIAS   FOOTER_CENTRE_CAPS              HDRFTR_CENTER_CAPS
10887 .ALIAS   FOOTER_RIGHT                    HDRFTR_RIGHT
10888 .ALIAS   FOOTER_RIGHT_FAMILY             HDRFTR_RIGHT_FAMILY
10889 .ALIAS   FOOTER_RIGHT_FAM                HDRFTR_RIGHT_FAMILY
10890 .ALIAS   FOOTER_RIGHT_FONT               HDRFTR_RIGHT_FONT
10891 .ALIAS   FOOTER_RIGHT_FT                 HDRFTR_RIGHT_FONT
10892 .ALIAS   FOOTER_RIGHT_SIZE               HDRFTR_RIGHT_SIZE
10893 .ALIAS   FOOTER_RIGHT_PS                 HDRFTR_RIGHT_SIZE
10894 .ALIAS   FOOTER_RIGHT_CAPS               HDRFTR_RIGHT_CAPS
10895 .ALIAS   FOOTER_RECTO                    HDRFTR_RECTO
10896 .ALIAS   FOOTER_VERSO                    HDRFTR_VERSO
10897 .ALIAS   SWITCH_HEADERS                  SWITCH_HDRFTR
10898 .ALIAS   SWITCH_FOOTERS                  SWITCH_HDRFTR
10900 \# Support aliases
10902 .ALIAS   COL_BREAK                       COL_NEXT
10903 .ALIAS   PRINT_FOOTNOTE_RULE             FOOTNOTE_RULE