o Added TOC (finally) and a nearly complete set of associated
[s-roff.git] / contrib / mom / om.tmac
blobab09d36f433420dcd27d12d5d75e50932adbfbf7
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 .\"
26 \# Version 1.1.6
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
78 \# ====================================================================
80 \# END MACRO FOR LETTERS
81 \# ---------------------
82 \# *Arguments:
83 \#   none
84 \# *Function:
85 \#   The .em macro executed at the end of letters.  Turns footers and
86 \#   pagination off, terminates and outputs diversion CLOSING, indented with
87 \#   the author's name underneath.
89 .MAC ALL_DONE END
90 .    br
91 .    FOOTERS OFF
92 .    PAGINATION OFF
93 .    if \\n[#DOC_TYPE]=4 \{\
94 .       br
95 .       if !'\\n(.z'' \{ .di \}
96 .       IQ CLEAR
97 .       TQ
98 .       TAB_SET 1 \\n[#DOC_L_LENGTH]u/2u \\n[#DOC_L_LENGTH]u/2u LEFT
99 .       ALD \\n[#DOC_LEAD]u*2u
100 .       TAB 1
101 .       if \\n[#CLOSING] \{\
102 .          nf
103 .          CLOSING
104 .       \}
105 .       ALD \\n[#DOC_LEAD]u*3u
106 .       PRINT \\*[$AUTHOR_1]
107 .    \}
108 .DO_FOOTER
109 .END
112 \# =====================================================================
114 \# +++PAGE LAYOUT+++
116 \# Macros that control the physical layout of the page: paper size
117 \# and margins.
119 \# PAGE WIDTH
120 \# ----------
121 \# *Argument:
122 \#   <width of printer sheet (ipPc)>
123 \# *Function:
124 \#   Stores user supplied page width in register #PAGE_WIDTH.
125 \# *Notes:
126 \#   #PAGE_WIDTH is used to establish the default LL (and right margin).
127 \#   Requires unit of measure.
129 .MAC PAGEWIDTH END
130 .    br
131 .    nr #PAGE_WIDTH \\$1
132 .    if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
133 .    if !r#R_MARGIN \{ .R_MARGIN 1i \}
134 .END
137 \# L_MARGIN
138 \# --------
139 \# *Argument:
140 \#   <offset from page left (ipPc)>
141 \# *Function:
142 \#   Stores user supplied page offset in register #L_MARGIN.
143 \#   Sets .po to user supplied offset.
144 \# *Notes:
145 \#   Requires unit of measure.
147 .MAC L_MARGIN END
148 .    br
149 .    nr #L_MARGIN (\\$1)
150 .    po \\n[#L_MARGIN]u
151 .END
154 \# R_MARGIN
155 \# --------
156 \# *Argument:
157 \#   <width of right margin (ipPc)>
158 \# *Function:
159 \#   Stores user supplied right margin in register #R_MARGIN.
160 \# *Notes:
161 \#   This is a pseudo-margin.  Right margin is actually a function of
162 \#   line length.  The macro calculates line length from the page offset
163 \#   and the value plugged into #R_MARGIN.
165 \#   N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
167 \#   Requires unit of measure.
169 .MAC R_MARGIN END
170 .    br
171 .    nr #R_MARGIN (\\$1)
172 .    ll \\n[#PAGE_WIDTH]u-\\n[#L_MARGIN]u-\\n[#R_MARGIN]u
173 .    ta \\n(.lu
174 .    nr #L_LENGTH \\n(.l
175 .END
178 \# T_MARGIN
179 \# --------
180 \# *Argument:
181 \#   <distance to advance from top of page (ipPcv)>
182 \# *Function:
183 \#   Stores the user supplied top margin in register #T_MARGIN.
184 \#   Advances user supplied depth from the top of the page.
185 \# *Notes:
186 \#   Requires unit of measure.
188 .MAC T_MARGIN END
189 .    br
190 .    nr #T_MARGIN (\\$1)
191 .    nr #T_MARGIN_SET 1
192 .    if !\\n[#DOCS] \{\
193 .       PRINT \&
194 .       sp |\\n[#T_MARGIN]u-1v
195 .    \}
196 .    wh 0i DO_T_MARGIN
197 .END
200 \# B_MARGIN
201 \# --------
202 \# *Argument:
203 \#   <space to leave at the bottom of the page (ipPcv)>
204 \# *Function:
205 \#   Stores the user supplied bottom margin in register #B_MARGIN.
206 \# *Notes:
207 \#   Requires unit of measure.
209 .MAC B_MARGIN END
210 .    br
211 .    nr #B_MARGIN (\\$1)
212 .    wh -\\n[#B_MARGIN]u DO_B_MARGIN
213 .END
216 \# PAGE
217 \# ----
218 \# *Arguments:
219 \#   <pagewidth>  [pagelength [leftmargin [rightmargin [topmargin [bottommargin]]]]]
220 \# *Function:
221 \#   Page set-up.  Collects arguments and passes them to the appropriate
222 \#   macros.
223 \# *Notes:
224 \#   All arguments after pagewidth are optional, but must appear
225 \#   in the order given above.  (User can fill in as much or as
226 \#   little as desired.)
228 \#   All arguments require a unit of measure.
230 .MAC PAGE END
231 .    br
232 .    PAGEWIDTH                \\$1
233 .    PAGELENGTH               \\$2
234 .    ie '\\$3'' \{ .L_MARGIN  \\n(.o \}
235 .    el \{ .L_MARGIN          \\$3 \}
236 .    ie '\\$4'' \{ .R_MARGIN  1i \}
237 .    el \{ .R_MARGIN          \\$4 \}
238 .    if !'\\$5'' \{ .T_MARGIN \\$5 \}
239 .    if !'\\$6'' \{ .B_MARGIN \\$6 \}
240 .END
242 \# =====================================================================
244 \# +++PAGE CONTROL+++
246 \# Generic macros for breaking pages.
248 \# DO_T_MARGIN
249 \# -----------
250 \# *Argument:
251 \#   <none>
252 \# *Function:
253 \#   Plants the top margin (set in .PAGE) at the top of each page.
254 \# *Notes:
255 \#   The trap is set in .PAGE
257 .MAC DO_T_MARGIN END
258 .    ev 1
259 .    sp |\\n[#T_MARGIN]u-1v
260 .    ev
261 .END
264 \# DO_B_MARGIN
265 \# -----------
266 \# *Argument:
267 \#   <none>
268 \# *Function:
269 \#   Plants the bottom margin (set in .PAGE) at the bottom of each page.
270 \# *Notes:
271 \#   The trap is set in .PAGE.
273 .MAC DO_B_MARGIN END
274 .ev 1
275 .    bp
277 .END
279 \# =====================================================================
281 \# +++GENERAL STYLE MACROS+++
283 \# Macros that are likely to appear together to define general
284 \# type style: line length, family, font, point size, and line
285 \# spacing.
287 \# LINE LENGTH
288 \# -----------
289 \# *Argument:
290 \#   <line length (iPpc)>
291 \# *Function:
292 \#   Stores user supplied line length in register #L_LENGTH.
293 \#   Sets .ll to #L_LENGTHu
294 \# *Notes:
295 \#   Requires unit of measure.
297 .MAC LL END
298 .    nr #L_LENGTH (\\$1)
299 .    nr #USER_SET_L_LENGTH 1
300 .    ll \\n[#L_LENGTH]u
301 .    ta \\n(.lu
302 .END
305 \# FAMILY
306 \# ------
307 \# *Argument:
308 \#   <font family>
309 \# *Function:
310 \#   Stores user supplied font family in string $FAMILY.  Sets .fam
311 \#   to $FAMILY.
313 .MAC FAMILY END
314 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
315 .    if \\n[#IGNORE]        \{ .return \}
316 .    ds $FAMILY \\$1
317 .    fam \\*[$FAMILY]
318 .END
321 \# FONT
322 \# ----
323 \# *Argument:
324 \#   R | I | B | BI
325 \# *Function:
326 \#  Stores user supplied font in $FONT and sets .ft to $FONT.
328 .MAC FT END
329 .    if \\n[#PRINT_STYLE]=1 \{\
330 .       ie '\\$1'I' \{\
331 .          if \\n[#UNDERLINE_ITALIC]=1 \{\
332 .             UNDERLINE
333 .             return
334 .          \}
335 .          if \\n[#ITALIC_MEANS_ITALIC]=1 \{\
336 .             ds $FONT \\$1
337 .             ft \\*[$FONT]
338 .             return
339 .          \}
340 .       \}
341 .       el \{ .UNDERLINE OFF \}
342 .       return
343 .    \}
344 .    ds $FONT \\$1
345 .    ft \\*[$FONT]
346 .END
349 \# POINT SIZE
350 \# ----------
351 \# *Arguments:
352 \#   <point size of type>
353 \# *Function:
354 \#   Sets point size to user supplied value in scaled points.
355 \#   If #AUTO_LEAD is on, sets .vs to #AUTOLEAD_VALUE+#PT_SIZE.
356 \# *Notes:
357 \#   Must NOT use a unit of measure.
359 .MAC PT_SIZE END
360 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
361 .    if \\n[#IGNORE]        \{ .return \}
362 .    nr #PT_SIZE_SET 1
363 .    ps \\$1
364 .    if \\n[#AUTO_LEAD] \{\
365 .       ie \\n[#AUTOLEAD_FACTOR] \{ .vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u \}
366 .       el \{ .vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u \}
367 .    \}
368 .    nr #PT_SIZE_IN_UNITS \\n[.ps]
369 .END
372 \# LEADING
373 \# -------
374 \# *Argument:
375 \#   <leading between lines of text>
376 \# *Function:
377 \#   Turns off #AUTO_LEAD if it's on.
378 \#   Sets .vs to user supplied value.
379 \# *Notes:
380 \#   Does not require unit of measure.  LEAD automatically turns off AUTOLEAD.
382 .MAC LS END
383 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
384 .    if \\n[#IGNORE]        \{ .return \}
385 .    nr #LEAD_SET 1
386 .    if \\n[#AUTO_LEAD] \{\
387 .       rr #AUTO_LEAD
388 .       rr #AUTOLEAD_FACTOR
389 .    \}
390 .    vs \\$1
391 .    if \\n[#T_MARGIN_SET]=1 \{\
392 .       sp |\\n[#T_MARGIN]u-1v
393 .       rr #T_MARGIN_SET
394 .    \}
395 .END
398 \# AUTOLEAD
399 \# --------
400 \# *Argument:
401 \#   <leading value to add to #PT_SIZE> [FACTOR]
402 \# *Function:
403 \#   Stores user supplied auto-lead value in register #AUTOLEAD_VALUE.
404 \#   Adds #AUT0LEAD_VALUE to #PT_SIZE when invoked to set leading.
405 \#   All subsequent PT_SIZE requests reset the leading in the same way until
406 \#   AUTOLEAD is turned off.
407 \# *Notes:
408 \#   With the optional FACTOR argument, the current point size is
409 \#   multiplied by #AUTOLEAD_VALUE instead of the two being added
410 \#   together.
412 \#   When AUTOLEAD is turned off, the leading reverts to the leading value
413 \#   in effect prior to invoking AUTOLEAD.
415 .MAC AUTOLEAD END
416 .    if \\n[#PRINT_STYLE]=1 \{ .return \}
417 .    if \\n[#IGNORE]        \{ .return \}
418 .    nr #AUTO_LEAD 1
419 .    nr #AUTOLEAD_VALUE (p;\\$1)
420 .    ie \\n[#NUM_ARGS]=2 \{\
421 .       if '\\$2'FACTOR' \{\
422 .          nr #AUTOLEAD_FACTOR 1
423 .          vs \\n[#PT_SIZE]u*\\n[#AUTOLEAD_VALUE]u/1000u
424 .       \}
425 .    \}
426 .    el \{\
427 .       vs \\n[#PT_SIZE]u+\\n[#AUTOLEAD_VALUE]u
428 .    \}
429 .    if \\n[#T_MARGIN_SET] \{\
430 .       sp |\\n[#T_MARGIN]u-1v
431 .       rr #T_MARGIN_SET
432 .    \}
433 .END
436 \# STRINGS FOR INLINE CONTROL OF GENERAL TYPE STYLE
437 \# ------------------------------------------------
438 .ds ROM  \EfR
439 .ds IT   \EfI
440 .ds BD   \EfB
441 .ds BDI  \Ef(BI
442 .ds PREV \EfP
443 .ds S    \Es
446 \# =====================================================================
448 \# +++KERNING+++
450 \# AUTOMATIC PAIRWISE KERNING
451 \# --------------------------
452 \# *Arguments:
453 \#   <none> | <anything>
454 \# *Function:
455 \#   Turns automatic pairwise kerning on or off.
457 .MAC KERN END
458 .    ie '\\$1'' \{\
459 .       kern
460 .       nr #KERN 1
461 .    \}
462 .    el \{\
463 .       kern 0
464 .       nr #KERN 0
465 .    \}
466 .END
469 \# INLINE KERNING AND HORIZONTAL MOVEMENT
470 \# --------------------------------------
471 \# *Kerning
472 \#  Inline kerning provides a simple method for users to adjust the
473 \#  amount of space between any two letters.  It's predicated on a
474 \#  unit of measure "U", which is 1/36 of the current point size as
475 \#  returned by \n[.ps].  E.g., if the current point size is 18,
476 \#  \n[.ps] returns 18000u, therefore U=500u.  Since U remains
477 \#  proportional relative to the current point size, the amount
478 \#  of kerning between two letters as expressed in Us remains
479 \#  visually similar regardless of changes in point size.
481 \#  N.B.--the amount of inline kerning supplied by \*[BU#] or
482 \#  \*[FU#] is added to or subtracted from any kerning that already
483 \#  takes place between two characters when automatic kerning is
484 \#  turned on.
486 \#  In groff v. 1.17.2, it was not possible to pass arguments to macros that
487 \#  were executed with inline escapes, nor thence to evaluate conditional
488 \#  expressions.  Consequently, each pseudo-escape \[BU#] had to be defined
489 \#  separately with ".char".
491 \#  As of v. 1.18, one can pass arguments to inline strings/macros,
492 \#  hence it is now possible to do \*[BU #] where #, inline, is the desired
493 \#  number of kern units.  The original .char definitions have been left in
494 \#  for backward compatibility with documents created prior to mom-1.1.3c.
497 .nr #KERN_UNIT 36
498 .ds BU   \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
499 .ds FU   \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
501 .ds BU1  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
502 .ds BU2  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
503 .ds BU3  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
504 .ds BU4  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
505 .ds BU5  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
506 .ds BU6  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
507 .ds BU7  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
508 .ds BU8  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
509 .ds BU9  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
510 .ds BU10 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
511 .ds BU11 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
512 .ds BU12 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
513 .ds BU13 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
514 .ds BU14 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
515 .ds BU15 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
516 .ds BU16 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
517 .ds BU17 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
518 .ds BU18 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
519 .ds BU19 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
520 .ds BU20 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
521 .ds BU21 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
522 .ds BU22 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
523 .ds BU23 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
524 .ds BU24 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
525 .ds BU25 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
526 .ds BU26 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
527 .ds BU27 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
528 .ds BU28 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
529 .ds BU29 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
530 .ds BU30 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
531 .ds BU31 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
532 .ds BU32 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
533 .ds BU33 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
534 .ds BU34 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
535 .ds BU35 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
536 .ds BU36 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
539 .ds FU1  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
540 .ds FU2  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
541 .ds FU3  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
542 .ds FU4  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
543 .ds FU5  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
544 .ds FU6  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
545 .ds FU7  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
546 .ds FU8  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
547 .ds FU9  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
548 .ds FU10 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
549 .ds FU11 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
550 .ds FU12 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
551 .ds FU13 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
552 .ds FU14 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
553 .ds FU15 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
554 .ds FU16 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
555 .ds FU17 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
556 .ds FU18 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
557 .ds FU19 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
558 .ds FU20 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
559 .ds FU21 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
560 .ds FU22 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
561 .ds FU23 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
562 .ds FU24 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
563 .ds FU25 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
564 .ds FU26 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
565 .ds FU27 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
566 .ds FU28 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
567 .ds FU29 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
568 .ds FU30 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
569 .ds FU31 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
570 .ds FU32 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
571 .ds FU33 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
572 .ds FU34 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
573 .ds FU35 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
574 .ds FU36 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
577 \# *Horizontal movements
578 \#  BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
579 \#  specified number of points.
580 \#  Left in for backward compatibility with mom-1.1.3c, the preferred
581 \#  methods for inline horizontal movements are now \*[BCK #<unit>] and
582 \#  \*[FWD #<unit>].
584 .ds BCK  \h'-\\$1\\$2'
585 .ds FWD  \h'\\$1\\$2'
587 .ds BP.25    \h'-.25'
588 .ds BP.5     \h'-.5'
589 .ds BP.75    \h'-.75'
590 .ds BP1      \h'-1p'
591 .ds BP1.25   \h'-1.25p'
592 .ds BP1.5    \h'-1.5p'
593 .ds BP1.75   \h'-1.75p'
594 .ds BP2      \h'-2p'
595 .ds BP2.25   \h'-2.25p'
596 .ds BP2.5    \h'-2.5p'
597 .ds BP2.75   \h'-2.75p'
598 .ds BP3      \h'-3p'
599 .ds BP3.25   \h'-3.25p'
600 .ds BP3.5    \h'-3.5p'
601 .ds BP3.75   \h'-3.75p'
602 .ds BP4      \h'-4p'
603 .ds BP4.25   \h'-4.25p'
604 .ds BP4.5    \h'-4.5p'
605 .ds BP4.75   \h'-4.75p'
606 .ds BP5      \h'-5p'
607 .ds BP5.25   \h'-5.25p'
608 .ds BP5.5    \h'-5.5p'
609 .ds BP5.75   \h'-5.75p'
610 .ds BP6      \h'-6p'
611 .ds BP6.25   \h'-6.25p'
612 .ds BP6.5    \h'-6.5p'
613 .ds BP6.75   \h'-6.75p'
614 .ds BP7      \h'-7p'
615 .ds BP7.25   \h'-7.25p'
616 .ds BP7.5    \h'-7.5p'
617 .ds BP7.75   \h'-7.75p'
618 .ds BP8      \h'-8p'
619 .ds BP8.25   \h'-8.25p'
620 .ds BP8.5    \h'-8.5p'
621 .ds BP8.75   \h'-8.75p'
622 .ds BP9      \h'-9p'
623 .ds BP9.25   \h'-9.25p'
624 .ds BP9.5    \h'-9.5p'
625 .ds BP9.75   \h'-9.75p'
626 .ds BP10     \h'-10p'
627 .ds BP10.25  \h'-10.25p'
628 .ds BP10.5   \h'-10.5p'
629 .ds BP10.75  \h'-10.75p'
630 .ds BP11     \h'-11p'
631 .ds BP11.25  \h'-11.25p'
632 .ds BP11.5   \h'-11.5p'
633 .ds BP11.75  \h'-11.75p'
634 .ds BP12     \h'-12p'
635 .ds BP12.25  \h'-12.25p'
636 .ds BP12.5   \h'-12.5p'
637 .ds BP12.75  \h'-12.75p'
639 .ds FP.25    \h'.25'
640 .ds FP.5     \h'.5'
641 .ds FP.75    \h'.75'
642 .ds FP1      \h'1p'
643 .ds FP1.25   \h'1.25p'
644 .ds FP1.5    \h'1.5p'
645 .ds FP1.75   \h'1.75p'
646 .ds FP2      \h'2p'
647 .ds FP2.25   \h'2.25p'
648 .ds FP2.5    \h'2.5p'
649 .ds FP2.75   \h'2.75p'
650 .ds FP3      \h'3p'
651 .ds FP3.25   \h'3.25p'
652 .ds FP3.5    \h'3.5p'
653 .ds FP3.75   \h'3.75p'
654 .ds FP4      \h'4p'
655 .ds FP4.25   \h'4.25p'
656 .ds FP4.5    \h'4.5p'
657 .ds FP4.75   \h'4.75p'
658 .ds FP5      \h'5p'
659 .ds FP5.25   \h'5.25p'
660 .ds FP5.5    \h'5.5p'
661 .ds FP5.75   \h'5.75p'
662 .ds FP6      \h'6p'
663 .ds FP6.25   \h'6.25p'
664 .ds FP6.5    \h'6.5p'
665 .ds FP6.75   \h'6.75p'
666 .ds FP7      \h'7p'
667 .ds FP7.25   \h'7.25p'
668 .ds FP7.5    \h'7.5p'
669 .ds FP7.75   \h'7.75p'
670 .ds FP8      \h'8p'
671 .ds FP8.25   \h'8.25p'
672 .ds FP8.5    \h'8.5p'
673 .ds FP8.75   \h'8.75p'
674 .ds FP9      \h'9p'
675 .ds FP9.25   \h'9.25p'
676 .ds FP9.5    \h'9.5p'
677 .ds FP9.75   \h'9.75p'
678 .ds FP10     \h'10p'
679 .ds FP10.25  \h'10.25p'
680 .ds FP10.5   \h'10.5p'
681 .ds FP10.75  \h'10.75p'
682 .ds FP11     \h'11p'
683 .ds FP11.25  \h'11.25p'
684 .ds FP11.5   \h'11.5p'
685 .ds FP11.75  \h'11.75p'
686 .ds FP12     \h'12p'
687 .ds FP12.25  \h'12.25p'
688 .ds FP12.5   \h'12.5p'
689 .ds FP12.75  \h'12.75p'
692 \# WHOLE LINE KERNING (RW and EW)
693 \# -----------------------------
694 \# The line kerning macros are special instances of track kerning,
695 \# used where a complete line needs to be tightened (or relaxed) in
696 \# order to accomodate or remove one or two more characters
697 \# than the default justification permits.
699 \# *Argument:
700 \#   <amount of overall "kerning" (letter spacing) to apply to the line>
701 \# *Function:
702 \#   Invokes .tkf (track kerning) for the current font with
703 \#   1 as both the upper and lower point size limits, so that
704 \#   the value entered by the user applies regardless of point
705 \#   size.  RW ("Reduce Whitespace") reduces the amount of space
706 \#   between all characters by an equal amount.  EW ("Extra
707 \#   Whitespace") increases the amount of space.
708 \# *Notes:
709 \#   Decimal values are acceptable.
711 \#   The groff documentation is a tad confusing about what unit of
712 \#   measure is used in track kerning, only that the width of each
713 \#   character is increased or decreased by the amount(s) passed as
714 \#   arguments to .tkf, and something about linear function of point
715 \#   size.  In fact, with the way I've put this macro together, it
716 \#   doesn't matter.  All the user needs to know is that a value
717 \#   of one will produce an unacceptably tight or loose line at most
718 \#   text point sizes; therefore, effective use of RW and EW is in
719 \#   the fractional range below 1 (e.g. .25, .5).  Given that RW
720 \#   and EW are for massaging type, a certain amount of
721 \#   experimentation and previewing is expected and necessary.
723 \#   \n(.f holds the current font number, which is acceptable to .tkf.
725 \#   RW and EW must be reset to 0 to cancel their effect on
726 \#   subsequent output lines.
728 .MAC RW END
729 .    if \\n[#BR_AT_LINE_KERN] \{ .br \}
730 .    tkf 1 1 -\\$1 1 -\\$1
731 .    tkf 2 1 -\\$1 1 -\\$1
732 .    tkf 3 1 -\\$1 1 -\\$1
733 .    tkf 4 1 -\\$1 1 -\\$1
734 .END
737 .MAC EW END
738 .    if \\n[#BR_AT_LINE_KERN] \{ .br \}
739 .    tkf 1 1 \\$1 1 \\$1
740 .    tkf 2 1 \\$1 1 \\$1
741 .    tkf 3 1 \\$1 1 \\$1
742 .    tkf 4 1 \\$1 1 \\$1
743 .END
746 \# BREAK AT LINE KERN
747 \# ------------------
748 \# *Arguments:
749 \#   toggle
750 \# *Function:
751 \#   Enables/disables .br's before .RW and .EW
752 \# *Notes:
753 \#   Mostly, users will want .br's before any kind of line kerning, but
754 \#   there may be cases where they don't.  BR_BEFORE_LINE_KERN is off by
755 \#   default and must be invoked explicitly.
757 .MAC BR_AT_LINE_KERN END
758 .    ie '\\$1'' \{ .nr #BR_AT_LINE_KERN  1 \}
759 .    el         \{ .rr #BR_AT_LINE_KERN \}
760 .END
762 \# =====================================================================
764 \# +++HYPHENATION+++
766 \# AUTO HYPHENATION
767 \# ----------------
768 \# *Arguments:
769 \#   <none> | <anything> | DEFAULT
770 \#                 or
771 \#   LINES <#> | MARGIN <#> | SPACE <#>
772 \# *Function:
773 \#   Turns auto hyphenation on or off, resets the hyphenation style
774 \#   to default, or permits the setting of various hyphenation
775 \#   parameters.
776 \# *Notes:
777 \#   HY ON defaults to .hy 14, i.e. no hyphens after the
778 \#   first two or before the last two characters of a word, and
779 \#   no hyphenation of the last line prior to a trap (e.g.,
780 \#   at the bottom of a page).
782 \#   HY DEFAULT resets the hyphenation style to .hy 14 (see
783 \#   above) if that behaviour is desired after changes have been
784 \#   made to LINES, MARGIN, or SPACE.
786 \#   HY LINES <#> sets the number of allowable consecutive hyphenated lines.
788 \#   HY MARGIN <#> sets the amount of space (ipPcm) allowed at the end
789 \#   of a line in QUAD mode before hyphenation is tripped (e.g. if there's
790 \#   only 6 points left, groff won't try to hyphenate the next word).
792 \#   HY SPACE sets the amount of extra interword space (ipPcm) that can
793 \#   be added in JUSTIFY mode to prevent a line from being hyphenated.
795 .MAC HY END
796 .    ie '\\$1'' \{\
797 .       hy 14
798 .       nr #HYPHENATE 1
799 .    \}
800 .    el \{\
801 .       if !'\\$1'LINES'  \{\
802 .          nh
803 .          nr #HYPHENATE 0
804 .       \}
805 .       if !'\\$1'MARGIN' \{\
806 .          nh
807 .          nr #HYPHENATE 0
808 .       \}
809 .       if !'\\$1'SPACE'  \{\
810 .          nh
811 .          nr #HYPHENATE 0
812 .       \}
813 .       if !'\\$1'DEFAULT'  \{\
814 .          nh
815 .          nr #HYPHENATE 0
816 .       \}
817 .       if '\\$1'LINES'   \{ .hlm \\$2 \}
818 .       if '\\$1'MARGIN'  \{ .hym \\$2 \}
819 .       if '\\$1'SPACE'   \{ .hys \\$2 \}
820 .       if '\\$1'DEFAULT' \{\
821 .          hlm -1
822 .          hym 0
823 .          hys 0
824 .       \}
825 .    \}
826 .END
829 \# HYPHENATION PARAMETERS
830 \# ----------------------
831 \# *Arguments:
832 \#   <# of lines> | <size of margin> | <amount of interword space>
833 \# *Function:
834 \#   Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
836 .MAC HY_SET END
837 .    nr #HY_SET 1
838 .    hlm \\$1
839 .    hym \\$2
840 .    hys \\$3
841 .END
843 \# =====================================================================
845 \# +++VERTICAL SPACING+++
847 \# ADVANCE LEAD
848 \# ------------
849 \# *Argument:
850 \#   <user supplied lead to advance below current baseline>
851 \# *Function:
852 \#   Creates or modifies register #ALD.  Adds user supplied lead
853 \#   below current baseline.
854 \# *Notes:
855 \#   Requires unit of measure ipPcmv.
857 .MAC ALD END
858 .    nr #ALD (\\$1)
859 .    sp \\n[#ALD]u
860 .END
863 \# REVERSE LEAD
864 \# ------------
865 \# *Argument:
866 \#   <user supplied lead to reverse above current baseline>
867 \# *Function:
868 \#   Creates or modifies register #RLD.  Reverses user supplied
869 \#   lead above current baseline.
870 \# *Notes:
871 \#   Requires unit of measure ipPcmv.
873 .MAC RLD END
874 .    nr #RLD (\\$1)
875 .    sp -\\n[#RLD]u
876 .END
878 \# ALD/RLD STRINGS
879 \# ---------------
880 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding \*[RLD]
881 \# forms have been left in for backward compatibility with documents
882 \# created using mom-1.1.3c or earlier.  The prefered methods of advancing
883 \# and reversing on the page inline are \*[UP #<unit>] and \*[DOWN #<unit>].
885 .ds DOWN      \v'\\$1\\$2'
886 .ds UP        \v'-\\$1\\$2'
888 .ds ALD.25    \v'.25p'
889 .ds ALD.5     \v'.5p'
890 .ds ALD.75    \v'.75p'
891 .ds ALD1      \v'1p'
892 .ds ALD1.25   \v'1.25p'
893 .ds ALD1.5    \v'1.5p'
894 .ds ALD1.75   \v'1.75p'
895 .ds ALD2      \v'2p'
896 .ds ALD2.25   \v'2.25p'
897 .ds ALD2.5    \v'2.5p'
898 .ds ALD2.75   \v'2.75p'
899 .ds ALD3      \v'3p'
900 .ds ALD3.25   \v'3.25p'
901 .ds ALD3.5    \v'3.5p'
902 .ds ALD3.75   \v'3.75p'
903 .ds ALD4      \v'4p'
904 .ds ALD4.25   \v'4.25p'
905 .ds ALD4.5    \v'4.5p'
906 .ds ALD4.75   \v'4.75p'
907 .ds ALD5      \v'5p'
908 .ds ALD5.25   \v'5.25p'
909 .ds ALD5.5    \v'5.5p'
910 .ds ALD5.75   \v'5.75p'
911 .ds ALD6      \v'6p'
912 .ds ALD6.25   \v'6.25p'
913 .ds ALD6.5    \v'6.5p'
914 .ds ALD6.75   \v'6.75p'
915 .ds ALD7      \v'7p'
916 .ds ALD7.25   \v'7.25p'
917 .ds ALD7.5    \v'7.5p'
918 .ds ALD7.75   \v'7.75p'
919 .ds ALD8      \v'8p'
920 .ds ALD8.25   \v'8.25p'
921 .ds ALD8.5    \v'8.5p'
922 .ds ALD8.75   \v'8.75p'
923 .ds ALD9      \v'9p'
924 .ds ALD9.25   \v'9.25p'
925 .ds ALD9.5    \v'9.5p'
926 .ds ALD9.75   \v'9.75p'
927 .ds ALD10     \v'10p'
928 .ds ALD10.25  \v'10.25p'
929 .ds ALD10.5   \v'10.5p'
930 .ds ALD10.75  \v'10.75p'
931 .ds ALD11     \v'11p'
932 .ds ALD11.25  \v'11.25p'
933 .ds ALD11.5   \v'11.5p'
934 .ds ALD11.75  \v'11.75p'
935 .ds ALD12     \v'12p'
936 .ds ALD12.25  \v'12.5p'
937 .ds ALD12.5   \v'12.5p'
938 .ds ALD12.75  \v'12.75p'
940 .ds RLD.25    \v'-.25p'
941 .ds RLD.5     \v'-.5p'
942 .ds RLD.75    \v'-.75p'
943 .ds RLD1      \v'-1p'
944 .ds RLD1.25   \v'-1.25p'
945 .ds RLD1.5    \v'-1.5p'
946 .ds RLD1.75   \v'-1.75p'
947 .ds RLD2      \v'-2p'
948 .ds RLD2.25   \v'-2.25p'
949 .ds RLD2.5    \v'-2.5p'
950 .ds RLD2.75   \v'-2.75p'
951 .ds RLD3      \v'-3p'
952 .ds RLD3.25   \v'-3.25p'
953 .ds RLD3.5    \v'-3.5p'
954 .ds RLD3.75   \v'-3.75p'
955 .ds RLD4      \v'-4p'
956 .ds RLD4.25   \v'-4.25p'
957 .ds RLD4.5    \v'-4.5p'
958 .ds RLD4.75   \v'-4.75p'
959 .ds RLD5      \v'-5p'
960 .ds RLD5.25   \v'-5.25p'
961 .ds RLD5.5    \v'-5.5p'
962 .ds RLD5.75   \v'-5.75p'
963 .ds RLD6      \v'-6p'
964 .ds RLD6.25   \v'-6.25p'
965 .ds RLD6.5    \v'-6.5p'
966 .ds RLD6.75   \v'-6.75p'
967 .ds RLD7      \v'-7p'
968 .ds RLD7.25   \v'-7.25p'
969 .ds RLD7.5    \v'-7.5p'
970 .ds RLD7.75   \v'-7.75p'
971 .ds RLD8      \v'-8p'
972 .ds RLD8.25   \v'-8.25p'
973 .ds RLD8.5    \v'-8.5p'
974 .ds RLD8.75   \v'-8.75p'
975 .ds RLD9      \v'-9p'
976 .ds RLD9.25   \v'-9.25p'
977 .ds RLD9.5    \v'-9.5p'
978 .ds RLD9.75   \v'-9.75p'
979 .ds RLD10     \v'-10p'
980 .ds RLD10.25  \v'-10.25p'
981 .ds RLD10.5   \v'-10.5p'
982 .ds RLD10.75  \v'-10.75p'
983 .ds RLD11     \v'-11p'
984 .ds RLD11.25  \v'-11.25p'
985 .ds RLD11.5   \v'-11.5p'
986 .ds RLD11.75  \v'-11.75p'
987 .ds RLD12     \v'-12p'
988 .ds RLD12.25  \v'-12.5p'
989 .ds RLD12.5   \v'-12.5p'
990 .ds RLD12.75  \v'-12.75p'
992 \# =====================================================================
994 \# +++REFINEMENTS+++
996 \# AUTOMATIC LIGATURES
997 \# -------------------
998 \# *Arguments:
999 \#   <none> | <anything>
1000 \# *Function:
1001 \#   Turns automatic ligature generation on or off.
1002 \# *Notes:
1003 \#   Ligatures may be supplied manually with \(fi, \(fl, etc.
1005 .MAC LIGATURES END
1006 .    ie '\\$1''   \{\
1007 .       lg
1008 .       nr #LIGATURES 1
1009 .    \}
1010 .    el \{\
1011 .       lg 0
1012 .       nr #LIGATURES 0
1013 .    \}
1014 .END
1017 \# SMARTQUOTES
1018 \# -----------
1019 \# *Arguments:
1020 \#   <none> | <anything>
1021 \# *Function:
1022 \#   Turns smartquotes on or off.
1023 \# *Notes:
1024 \#   The " character is read outside the macro when mom is
1025 \#   processed.  The strings for open/close ($QUOTE#) are then
1026 \#   defined in the macro.  \N'34' is the ASCII code for ".  If
1027 \#   incompatibilities arise, find the code for " that applies
1028 \#   to your system and plug in that code instead.
1030 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1032 .MAC SMARTQUOTES END
1033 .    ie '\\$1'' \{\
1034 .       nr #OPEN_CLOSE 0
1035 .       ds $QUOTE0 ``
1036 .       ds $QUOTE1 ''
1037 .       nr #SMART_QUOTES 1
1038 .    \}
1039 .    el \{\
1040 .       ds $QUOTE0 \\N'34'
1041 .       ds $QUOTE1 \\N'34'
1042 .       nr #SMART_QUOTES 0
1043 .    \}
1044 .END
1046 .ds FOOT \(fm
1047 .ds INCH \(fm\(fm
1049 \# =====================================================================
1051 \# +++LINE BREAKS+++
1053 \# NO-SPACE BREAK
1054 \# --------------
1055 \# *Argument:
1056 \#   <none>
1057 \# *Function:
1058 \#   Breaks a line without advancing.
1059 \# *Notes:
1060 \#   EL is the mnemonic used on older, dedicated typesetting machines
1061 \#   to indicate "process the line, then return to the left margin
1062 \#   without advancing the galley medium."  It stands for End Line.
1064 \#   Sadly, EL is only a fake.  It will work in all instances EXCEPT
1065 \#   when the line to be EL'd is the last line before a footer trap.
1066 \#   Use TRAP OFF/TRAP to circumvent this.
1068 .MAC EL END
1069 .    br
1070 .    sp -1v
1071 .END
1073 \# =====================================================================
1075 \# +++FILLING/QUADDING/JUSTIFYING+++
1077 \# JUSTIFY
1078 \# -------
1079 \# *Argument:
1080 \#   <none>
1081 \# *Function:
1082 \#  Turns fill on and sets .ad to b.
1083 \# *Notes:
1084 \#  Justifies text left and right.
1086 .MAC JUSTIFY END
1087 .    if \\n[#TAB_ACTIVE]=0 \{\
1088 .       nr #QUAD 1
1089 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1090 .    \}
1091 '    ce 0
1092 .    QUAD J
1093 .    if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1094 .    nr #FILL 0
1095 .END
1098 \# QUAD
1099 \# ----
1100 \# *Arguments:
1101 \#   L | LEFT | R | RIGHT | C | CENTER/CENTRE
1102 \# *Function:
1103 \#   Turns fill on and sets .ad to l, r, or c.
1104 \# *Notes:
1105 \#   Terminology is a problem here.  Some people call quad left
1106 \#   left justified, flush left, or flush left/rag right (and the
1107 \#   reverse for quad right).  Quad center is sometimes called rag
1108 \#   both.  For our purposes, all "quad" modes mean that groff fill
1109 \#   mode is enabled.
1111 .MAC QUAD END
1112 .    ds $QUAD_VALUE \\$1
1113 .    if \\n[#TAB_ACTIVE]=0 \{\
1114 .       nr #QUAD 1
1115 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1116 .    \}
1117 '    ce 0
1118 '    fi
1119 .    if '\\*[$QUAD_VALUE]'L'       \{ .ad l \}
1120 .    if '\\*[$QUAD_VALUE]'LEFT'    \{ .ad l \}
1121 .    if '\\*[$QUAD_VALUE]'R'       \{ .ad r \}
1122 .    if '\\*[$QUAD_VALUE]'RIGHT'   \{ .ad r \}
1123 .    if '\\*[$QUAD_VALUE]'C'       \{ .ad c \}
1124 .    if '\\*[$QUAD_VALUE]'CENTER'  \{ .ad c \}
1125 .    if '\\*[$QUAD_VALUE]'CENTRE'  \{ .ad c \}
1126 .    if '\\*[$QUAD_VALUE]'J'       \{ .ad b \}
1127 .    if '\\*[$QUAD_VALUE]'JUSTIFY' \{ .ad b \}
1128 .    nr #FILL 0
1129 .END
1132 \# LEFT, RIGHT, AND CENTER
1133 \# -----------------------
1134 \# The purpose of these macros is to allow the user to enter lines
1135 \# of text that will be quadded LRC *without* the user having to
1136 \# enter .BR or .br between lines.  For the sake of consistency,
1137 \# all three appear to behave similarly (from the point of view of the user),
1138 \# although the underlying primitives don't.  For this reason, LEFT,
1139 \# RIGHT, and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY
1140 \# to restore text to groff fill mode.
1142 \# LEFT
1143 \# ----
1144 \# *Argument:
1145 \#   <none>
1146 \# *Function:
1147 \#   Turns fill mode off.  Allows user to quad lines left without
1148 \#   requiring the .BR or .br macro.
1149 \# *Notes:
1150 \#   LEFT simply turns fill off.  Lines that exceed the current LL will
1151 \#   not be broken, simply continued (indefinitely) until a return is
1152 \#   encountered.  Note that this behaviour differs from the RIGHT and
1153 \#   CENTER macros.
1155 .MAC LEFT END
1156 .    if \\n[#TAB_ACTIVE]=0 \{\
1157 .       rr #QUAD
1158 .       ds $RESTORE_QUAD_VALUE LEFT
1159 .    \}
1160 .    ce 0
1161 .    nf
1162 .    nr #FILL 1
1163 .END
1166 \# RIGHT
1167 \# -----
1168 \# *Argument:
1169 \#   <none>
1170 \# *Function:
1171 \#   Turns fill on.  Allows user to quad lines right without
1172 \#   requiring the .BR or .br macro.
1173 \# *Notes:
1174 \#   Lines that exceed the current LL will be broken, with the excess
1175 \#   text quadded right.
1177 .MAC RIGHT END
1178 .    if \\n[#TAB_ACTIVE]=0 \{\
1179 .       rr #QUAD
1180 .       ds $RESTORE_QUAD_VALUE RIGHT
1181 .    \}
1182 .    fi
1183 .    rj 100000
1184 .    nr #FILL 1
1185 .END
1188 \# CENTER
1189 \# ------
1190 \# *Argument:
1191 \#   <none>
1192 \# *Function:
1193 \#   Turns fill on.  Allows user to center lines without
1194 \#   requiring the .BR or .br macro.
1195 \# *Notes:
1196 \#   Lines that exceed the current LL will be broken, with the excess
1197 \#   text centered.
1199 .MAC CENTER END
1200 .    if \\n[#TAB_ACTIVE]=0 \{\
1201 .       ds $RESTORE_QUAD_VALUE CENTER
1202 .    \}
1203 .    fi
1204 .    ce 100000
1205 .    nr #FILL 1
1206 .END
1208 \# =====================================================================
1210 \# +++TABS+++
1212 \#   There are two different kinds of tabs available: typesetting tabs
1213 \#   and string tabs.
1215 \#   Typesetting tabs are set with TAB_SET, which requires a tab number,
1216 \#   an indent (offset) from the left margin and a length (optionally
1217 \#   with a quad direction and an instruction to fill lines).  After tabs
1218 \#   are set with TS, they are called with .TAB <#>, where <#>
1219 \#   corresponds to the number passed to TAB_SET as a valid tab number.
1221 \#   String tabs allow the user to mark off tab positions inline.  Tab
1222 \#   indents and lengths are calculated from the beginning and end
1223 \#   positions of the marks.  Up to 19 string tabs may be created,
1224 \#   numbered 1-19.  Once created, they are called with .TAB <#>,
1225 \#   just like typesetting tabs.
1227 \#   Setting up string tabs is a two-step procedure.  First, the user
1228 \#   enters an input line in which s/he wants to mark off string tabs.
1229 \#   The beginning of a tab is marked with \*[ST<#>], where <#> is
1230 \#   the desired number of the tab.  The end of the the tab is marked
1231 \#   with \*[ST<#>X].  All ST's must have a matching STX.  String tabs
1232 \#   may be nested.
1234 \#   Next, the user invokes .ST <#> for every string tab defined, and
1235 \#   optionally passes quad information to it.  That done, string tabs
1236 \#   can be called just like typesetting tabs.
1238 \#   String tabs don't preview properly with gxditview.  Use gv instead.
1240 \# Strings for string tab inlines
1241 \# ------------------------------
1243 .ds ST1 \Ek[#ST1_OFFSET]
1244 .ds ST2 \Ek[#ST2_OFFSET]
1245 .ds ST3 \Ek[#ST3_OFFSET]
1246 .ds ST4 \Ek[#ST4_OFFSET]
1247 .ds ST5 \Ek[#ST5_OFFSET]
1248 .ds ST6 \Ek[#ST6_OFFSET]
1249 .ds ST7 \Ek[#ST7_OFFSET]
1250 .ds ST8 \Ek[#ST8_OFFSET]
1251 .ds ST9 \Ek[#ST9_OFFSET]
1252 .ds ST10 \Ek[#ST10_OFFSET]
1253 .ds ST11 \Ek[#ST11_OFFSET]
1254 .ds ST12 \Ek[#ST12_OFFSET]
1255 .ds ST13 \Ek[#ST13_OFFSET]
1256 .ds ST14 \Ek[#ST14_OFFSET]
1257 .ds ST15 \Ek[#ST15_OFFSET]
1258 .ds ST16 \Ek[#ST16_OFFSET]
1259 .ds ST17 \Ek[#ST17_OFFSET]
1260 .ds ST18 \Ek[#ST18_OFFSET]
1261 .ds ST19 \Ek[#ST19_OFFSET]
1263 .ds ST1X \Ek[#ST1_MARK]
1264 .ds ST2X \Ek[#ST2_MARK]
1265 .ds ST3X \Ek[#ST3_MARK]
1266 .ds ST4X \Ek[#ST4_MARK]
1267 .ds ST5X \Ek[#ST5_MARK]
1268 .ds ST6X \Ek[#ST6_MARK]
1269 .ds ST7X \Ek[#ST7_MARK]
1270 .ds ST8X \Ek[#ST8_MARK]
1271 .ds ST9X \Ek[#ST9_MARK]
1272 .ds ST10X \Ek[#ST10_MARK]
1273 .ds ST11X \Ek[#ST11_MARK]
1274 .ds ST12X \Ek[#ST12_MARK]
1275 .ds ST13X \Ek[#ST13_MARK]
1276 .ds ST14X \Ek[#ST14_MARK]
1277 .ds ST15X \Ek[#ST15_MARK]
1278 .ds ST16X \Ek[#ST16_MARK]
1279 .ds ST17X \Ek[#ST17_MARK]
1280 .ds ST18X \Ek[#ST18_MARK]
1281 .ds ST19X \Ek[#ST19_MARK]
1282 \# Reserved ST numbers for internal use
1283 .ds ST100  \Ek[#ST100_OFFSET]
1284 .ds ST100X \Ek[#ST100_MARK]
1285 .ds ST101  \Ek[#ST101_OFFSET]
1286 .ds ST101X \Ek[#ST101_MARK]
1289 \# QUAD AND SET STRING TABS
1290 \# ------------------------
1291 \# *Arguments:
1292 \#   <stringtab number>  L | R | C | J  [QUAD]
1293 \# *Function:
1294 \#   Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1295 \#   tab based on the collected information.
1296 \# *Notes:
1297 \#   Like TS, ST invoked without a quad direction will default to LEFT.
1298 \#   If lines should be filled and quadded, use the optional argument QUAD.
1299 \#   N.B. -- indents *must* be turned off before setting string tabs
1300 \#   inside .PAD
1302 .MAC ST END
1303 .    ds $ST\\$1_QUAD_DIR \\$2
1304 .    if \\n[#NUM_ARGS]=3 \{\
1305 .       ds $ST\\$1_FILL QUAD
1306 .    \}
1307 .    nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1308 .    ie \\n[#IN_TAB] \{\
1309 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1310 .    \}
1311 .    el \{\
1312 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1313 .    \}
1314 .END
1317 \# TAB SET
1318 \# -------
1319 \# *Arguments:
1320 \#   <#>  ident(ipPcm)  length(ipPcm)  [L | R | C | J [QUAD]]
1321 \# *Function:
1322 \#   Creates macros TAB<#> and TAB <#>, where # is any arbitrary number.
1323 \#   TAB# is a typesetting tab (i.e. a tab defined as an indent
1324 \#   from the page left offset plus a line length.)
1325 \# *Notes:
1326 \#   <#>    = arbitrary digit to identify the tab
1327 \#   indent = indent from left margin; unit of measure required
1328 \#   length = length of tab (unit of measure required; can be
1329 \#            \w'<string>'u--if more than one word in string, surround
1330 \#            with double quotes "\w'<three word string>'"
1331 \#   LRCJ   = quad for tab (left, right, center, justified)
1332 \#            If option QUAD afterwards is not given, quad is line for line
1333 \#            (no fill mode), meaning that there's no need for .BR or .br
1334 \#            between lines.
1335 \#   QUAD   = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1336 \#            had been given).
1338 \#   N.B. -- indents *must* be turned off before setting tabs
1340 \#   Examples:
1342 \#     .TAB_SET 1 2P+6p 12P C
1344 \#   means "create a tab numbered 1 that starts 2 picas and 6 points from
1345 \#   the left margin, is 12 picas long, and centre each input line."
1347 \#     .TAB_SET 1 2P+6P 12P C QUAD
1349 \#   means exactly the same thing, except that input lines are joined and
1350 \#   the area delimted by the tab filled with centered text.
1352 \#   TAB <#> can be called at any time after being set.
1354 \#   Tabs are NOT columnar in behaviour.  If the text inside a
1355 \#   tab runs to several lines, when you call the next tab a break
1356 \#   occurs, meaning that the new tab starts one line below the last
1357 \#   line in the previous tab.  For columnar behaviour, you must
1358 \#   use the multi-column macros in addition to tabs.
1360 \#   If you want tabs to line up bottom-line to bottom-line (most likely
1361 \#   single line tabs), use .TN (provided the tabs are numbered sequentially).
1362 \#   Otherwise, you must use .EL then .TAB # if you want them to align.
1364 \#   If you want to reset tabs, you must use .TQ before .TAB_SET.
1366 \#   Note that indents are turned off automatically whenever a new
1367 \#   tab is called with TAB #.
1369 \#   Tabs themselves are user-invoked using the TAB macro with a numeric
1370 \#   argument, e.g. TAB 1.
1372 \#   Generally, in order not to get confused, it's a good idea
1373 \#   to make sure all indents are off before setting tabs.
1375 .MAC TAB_SET END
1376 .    br
1377 .    nr #TAB_NUMBER \\$1
1378 .    ds $CURRENT_TAB \\n[#TAB_NUMBER]
1379 .    nr #TAB_OFFSET (\\$2)
1380 .    nr #TAB_LENGTH (\\$3)
1381 .    MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1382 .        br
1383 .        in 0
1384 .        nr #TAB_ACTIVE 1
1385 .        nr #CURRENT_TAB \\n[#TAB_NUMBER]
1386 .        po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET]u
1387 .        nr #ST_OFFSET \\n[#TAB_OFFSET]
1388 .        nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1389 .        ll \\n[#TAB_LENGTH]u
1390 .        ta \En(.lu
1391 .        ie '\\$5'QUAD' \{\
1392 .           if '\\$4'L' \{ .QUAD L  \}
1393 .           if '\\$4'R' \{ .QUAD R  \}
1394 .           if '\\$4'C' \{ .QUAD C  \}
1395 .           if '\\$4'J' \{ .JUSTIFY \}
1396 .        \}
1397 .        el \{\
1398 .           if '\\$4''  \{ .LEFT    \}
1399 .           if '\\$4'L' \{ .LEFT    \}
1400 .           if '\\$4'R' \{ .RIGHT   \}
1401 .           if '\\$4'C' \{ .CENTER  \}
1402 .           if '\\$4'J' \{ .JUSTIFY \}
1403 .        \}
1404 .DONE
1405 .    rr #TAB_ACTIVE
1406 .END
1409 \# TAB
1410 \# ---
1411 \# *Arguments:
1412 \#   <tab number to tab into>
1413 \# *Function:
1414 \#   Moves to tab number passed as an argument.
1416 .MAC TAB END
1417 .    ds $TAB_NUMBER \\$1
1418 .    TAB\\*[$TAB_NUMBER]
1419 .    nr #IN_TAB 1
1420 .    po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET\\*[$TAB_NUMBER]]u
1421 .END
1424 \# TAB NEXT
1425 \# --------
1426 \# *Argument:
1427 \#   <none>
1428 \# *Function:
1429 \#   Automagically moves to TAB#+1 on the same line as the last
1430 \#   line of the previous tab.
1431 \# *Notes:
1432 \#   If the tabs being aligned fall too close to the footer
1433 \#   trap, the line entered after .TN will appear on the next page.
1435 .MAC TN END
1436 .    br
1437 .    nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1438 .    TAB\\n[#NEXT_TAB]
1439 .    sp -1v
1440 .END
1443 \# TAB QUIT
1444 \# --------
1445 \# *Argument:
1446 \#   <none>
1447 \# *Function:
1448 \#   Sets #TAB_ACTIVE to "0" (off).
1449 \#   Resets left margin to value in effect prior to tabs.
1450 \#   Resets line length to value in effect prior to tabs.
1451 \#   Checks #QUAD to see if we were in flush or quad mode
1452 \#   prior to tabs (0=off, 1=on).
1453 \#   Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1454 \#   in effect prior to tabs.
1455 \# *Notes:
1456 \#   TQ *must* come before setting any new tabs if you want the
1457 \#   tabs' indents measured from page left.  Otherwise, the tabs'
1458 \#   indents are measured from the left margin of the tab you're
1459 \#   currently in.
1461 .MAC TQ END
1462 .    br
1463 .    rr #TAB_ACTIVE
1464 .    rr #IN_TAB
1465 .    po \\n[#L_MARGIN]u
1466 .    ll \\n[#L_LENGTH]u
1467 .    ta \\n(.lu
1468 .    ie \\n[#QUAD] \{\
1469 .       ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1470 .       el                              \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1471 .    \}
1472 .    el \{\
1473 .       if '\\*[$RESTORE_QUAD_VALUE]'LEFT'   \{ .LEFT \}
1474 .       if '\\*[$RESTORE_QUAD_VALUE]'RIGHT'  \{ .RIGHT \}
1475 .       if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1476 .    \}
1477 .END
1479 \# =====================================================================
1481 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1483 \# UNDERLINE
1484 \# ---------
1485 \# *Arguments:
1486 \#   <none> | <anything>
1487 \# *Function:
1488 \#   When on, underlines all letters, words, and digits in a passage,
1489 \#   ignoring punctuation and spaces.
1490 \# *Notes:
1491 \#   Only for use when the font family is COURIER, to simulate
1492 \#   typewriter-style underlining of italic  passages.
1494 .MAC UNDERLINE END
1495 .    ie '\\$1'' \{\
1496 .       nr #UNDERLINE_ON 1
1497 .       char A _\bA
1498 .       char B _\bB
1499 .       char C _\bC
1500 .       char D _\bD
1501 .       char E _\bE
1502 .       char F _\bF
1503 .       char G _\bG
1504 .       char H _\bH
1505 .       char I _\bI
1506 .       char J _\bJ
1507 .       char K _\bK
1508 .       char L _\bL
1509 .       char M _\bM
1510 .       char N _\bN
1511 .       char O _\bO
1512 .       char P _\bP
1513 .       char Q _\bQ
1514 .       char R _\bR
1515 .       char S _\bS
1516 .       char T _\bT
1517 .       char U _\bU
1518 .       char V _\bV
1519 .       char W _\bW
1520 .       char X _\bX
1521 .       char Y _\bY
1522 .       char Z _\bZ
1523 .       char \[`A] _\b\[`A]
1524 .       char \[^A] _\b\[^A]
1525 .       char \['A] _\b\['A]
1526 .       char \[:A] _\b\[:A]
1527 .       char \[oA] _\b\[oA]
1528 .       char \[~A] _\b\[~A]
1529 .       char \[AE] _\b\[AE]
1530 .       char \[`E] _\b\[`E]
1531 .       char \[^E] _\b\[^E]
1532 .       char \['E] _\b\['E]
1533 .       char \[:E] _\b\[:E]
1534 .       char \[`I] _\b\[`I]
1535 .       char \[^I] _\b\[^I]
1536 .       char \['I] _\b\['I]
1537 .       char \[:I] _\b\[:I]
1538 .       char \[`O] _\b\[`O]
1539 .       char \[^O] _\b\[^O]
1540 .       char \['O] _\b\['O]
1541 .       char \[:O] _\b\[:O]
1542 .       char \[~O] _\b\[~O]
1543 .       char \[/O] _\b\[/O]
1544 .       char \[`U] _\b\[`U]
1545 .       char \[^U] _\b\[^U]
1546 .       char \['U] _\b\['U]
1547 .       char \[:U] _\b\[:U]
1548 .       char \[,C] _\b\[,C]
1549 .       char \[-D] _\b\[-D]
1550 .       char \[~N] _\b\[~N]
1551 .       char \[TP] _\b\[TP]
1552 .       char \['Y] _\b\['Y]
1553 .       char \[:Y] _\b\[:Y]
1554 .       char a _\ba
1555 .       char b _\bb
1556 .       char c _\bc
1557 .       char d _\bd
1558 .       char e _\be
1559 .       char f _\bf
1560 .       char g _\bg
1561 .       char h _\bh
1562 .       char i _\bi
1563 .       char j _\bj
1564 .       char k _\bk
1565 .       char l _\bl
1566 .       char m _\bm
1567 .       char n _\bn
1568 .       char o _\bo
1569 .       char p _\bp
1570 .       char q _\bq
1571 .       char r _\br
1572 .       char s _\bs
1573 .       char t _\bt
1574 .       char u _\bu
1575 .       char v _\bv
1576 .       char w _\bw
1577 .       char x _\bx
1578 .       char y _\by
1579 .       char z _\bz
1580 .       char \[`a] _\b\[`a]
1581 .       char \[^a] _\b\[^a]
1582 .       char \['a] _\b\['a]
1583 .       char \[:a] _\b\[:a]
1584 .       char \[oa] _\b\[oa]
1585 .       char \[~a] _\b\[~a]
1586 .       char \[ae] _\b\[ae]
1587 .       char \[`e] _\b\[`e]
1588 .       char \[^e] _\b\[^e]
1589 .       char \['e] _\b\['e]
1590 .       char \[:e] _\b\[:e]
1591 .       char \[`i] _\b\[`i]
1592 .       char \[^i] _\b\[^i]
1593 .       char \['i] _\b\['i]
1594 .       char \[:i] _\b\[:i]
1595 .       char \[`o] _\b\[`o]
1596 .       char \[^o] _\b\[^o]
1597 .       char \['o] _\b\['o]
1598 .       char \[:o] _\b\[:o]
1599 .       char \[~o] _\b\[~o]
1600 .       char \[/o] _\b\[/o]
1601 .       char \[`u] _\b\[`u]
1602 .       char \[^u] _\b\[^u]
1603 .       char \['u] _\b\['u]
1604 .       char \[:u] _\b\[:u]
1605 .       char \[,c] _\b\[,c]
1606 .       char \[Sd] _\b\[Sd]
1607 .       char \[~n] _\b\[~n]
1608 .       char \[Tp] _\b\[Tp]
1609 .       char \['y] _\b\['y]
1610 .       char \[:y] _\b\[:y]
1611 .       char \[ss] _\b\[ss]
1612 .       char ' _\b'
1613 .       char 1 _\b1
1614 .       char 2 _\b2
1615 .       char 3 _\b3
1616 .       char 4 _\b4
1617 .       char 5 _\b5
1618 .       char 6 _\b6
1619 .       char 7 _\b7
1620 .       char 8 _\b8
1621 .       char 9 _\b9
1622 .       char 0 _\b0
1623 .    \}
1624 .    el \{\
1625 .       nr #UNDERLINE_ON 0
1626 .       rchar A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
1627         a b c d e f g h i j k l m n o p q r s t u v w x y z \
1628         \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1629         \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1630         \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1631         \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1632         \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1633         \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1634         ' 1 2 3 4 5 6 7 8 9 0
1635 .    \}
1636 .END
1639 \# UL/ULX
1640 \# ------
1641 \# *Arguments:
1642 \#   <none>
1643 \# *Function:
1644 \#   Underscores all letters, words, and digits in a passage,
1645 \#   ignoring punctuation and spaces.
1646 \# *Notes:
1647 \#   Intended to be called with inline escapes \*[UL] (underline
1648 \#   on) and \*[ULX] (underline off).  Only works when the font family
1649 \#   is COURIER, to simulate typewriter-style underlining of italic
1650 \#   passages.
1652 .MAC UL END
1653 \c\R'#UNDERLINE_ON 1'
1654 .       char A _\bA
1655 .       char B _\bB
1656 .       char C _\bC
1657 .       char D _\bD
1658 .       char E _\bE
1659 .       char F _\bF
1660 .       char G _\bG
1661 .       char H _\bH
1662 .       char I _\bI
1663 .       char J _\bJ
1664 .       char K _\bK
1665 .       char L _\bL
1666 .       char M _\bM
1667 .       char N _\bN
1668 .       char O _\bO
1669 .       char P _\bP
1670 .       char Q _\bQ
1671 .       char R _\bR
1672 .       char S _\bS
1673 .       char T _\bT
1674 .       char U _\bU
1675 .       char V _\bV
1676 .       char W _\bW
1677 .       char X _\bX
1678 .       char Y _\bY
1679 .       char Z _\bZ
1680 .       char \[`A] _\b\[`A]
1681 .       char \[^A] _\b\[^A]
1682 .       char \['A] _\b\['A]
1683 .       char \[:A] _\b\[:A]
1684 .       char \[oA] _\b\[oA]
1685 .       char \[~A] _\b\[~A]
1686 .       char \[AE] _\b\[AE]
1687 .       char \[`E] _\b\[`E]
1688 .       char \[^E] _\b\[^E]
1689 .       char \['E] _\b\['E]
1690 .       char \[:E] _\b\[:E]
1691 .       char \[`I] _\b\[`I]
1692 .       char \[^I] _\b\[^I]
1693 .       char \['I] _\b\['I]
1694 .       char \[:I] _\b\[:I]
1695 .       char \[`O] _\b\[`O]
1696 .       char \[^O] _\b\[^O]
1697 .       char \['O] _\b\['O]
1698 .       char \[:O] _\b\[:O]
1699 .       char \[~O] _\b\[~O]
1700 .       char \[/O] _\b\[/O]
1701 .       char \[`U] _\b\[`U]
1702 .       char \[^U] _\b\[^U]
1703 .       char \['U] _\b\['U]
1704 .       char \[:U] _\b\[:U]
1705 .       char \[,C] _\b\[,C]
1706 .       char \[-D] _\b\[-D]
1707 .       char \[~N] _\b\[~N]
1708 .       char \[TP] _\b\[TP]
1709 .       char \['Y] _\b\['Y]
1710 .       char \[:Y] _\b\[:Y]
1711 .       char a _\ba
1712 .       char b _\bb
1713 .       char c _\bc
1714 .       char d _\bd
1715 .       char e _\be
1716 .       char f _\bf
1717 .       char g _\bg
1718 .       char h _\bh
1719 .       char i _\bi
1720 .       char j _\bj
1721 .       char k _\bk
1722 .       char l _\bl
1723 .       char m _\bm
1724 .       char n _\bn
1725 .       char o _\bo
1726 .       char p _\bp
1727 .       char q _\bq
1728 .       char r _\br
1729 .       char s _\bs
1730 .       char t _\bt
1731 .       char u _\bu
1732 .       char v _\bv
1733 .       char w _\bw
1734 .       char x _\bx
1735 .       char y _\by
1736 .       char z _\bz
1737 .       char \[`a] _\b\[`a]
1738 .       char \[^a] _\b\[^a]
1739 .       char \['a] _\b\['a]
1740 .       char \[:a] _\b\[:a]
1741 .       char \[oa] _\b\[oa]
1742 .       char \[~a] _\b\[~a]
1743 .       char \[ae] _\b\[ae]
1744 .       char \[`e] _\b\[`e]
1745 .       char \[^e] _\b\[^e]
1746 .       char \['e] _\b\['e]
1747 .       char \[:e] _\b\[:e]
1748 .       char \[`i] _\b\[`i]
1749 .       char \[^i] _\b\[^i]
1750 .       char \['i] _\b\['i]
1751 .       char \[:i] _\b\[:i]
1752 .       char \[`o] _\b\[`o]
1753 .       char \[^o] _\b\[^o]
1754 .       char \['o] _\b\['o]
1755 .       char \[:o] _\b\[:o]
1756 .       char \[~o] _\b\[~o]
1757 .       char \[/o] _\b\[/o]
1758 .       char \[`u] _\b\[`u]
1759 .       char \[^u] _\b\[^u]
1760 .       char \['u] _\b\['u]
1761 .       char \[:u] _\b\[:u]
1762 .       char \[,c] _\b\[,c]
1763 .       char \[Sd] _\b\[Sd]
1764 .       char \[~n] _\b\[~n]
1765 .       char \[Tp] _\b\[Tp]
1766 .       char \['y] _\b\['y]
1767 .       char \[:y] _\b\[:y]
1768 .       char \[ss] _\b\[ss]
1769 .       char ' _\b'
1770 .       char 1 _\b1
1771 .       char 2 _\b2
1772 .       char 3 _\b3
1773 .       char 4 _\b4
1774 .       char 5 _\b5
1775 .       char 6 _\b6
1776 .       char 7 _\b7
1777 .       char 8 _\b8
1778 .       char 9 _\b9
1779 .       char 0 _\b0
1780 .END
1783 .MAC ULX END
1784 \c\R'#UNDERLINE_ON 0'
1785 .    rchar A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
1786      a b c d e f g h i j k l m n o p q r s t u v w x y z \
1787      \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1788      \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1789      \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1790      \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1791      \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1792      \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1793      ' 1 2 3 4 5 6 7 8 9 0
1794 .END
1797 \# UNDERSCORE
1798 \# ----------
1799 \# *Arguments:
1800 \#   [points below baseline] "text"
1801 \# *Function:
1802 \#   Places an underscore 2 points under the string if no lead given,
1803 \#   otherwise places underscore under string by user specified amount.
1804 \# *Notes:
1805 \#   When using this macro, the string to be underscored must begin
1806 \#   with double-quotes ("), regardless of whether it's the sole
1807 \#   argument or the second.
1808 \#   E.g.:
1809 \#      .UNDERSCORE "Text to be underscored
1810 \#         or
1811 \#      .UNDERSCORE 2p "Text to be underscored
1813 \#   All text is underscored (including punctuation and spaces).
1814 \#   This is the primary difference between UNDERLINE and UNDERSCORE,
1815 \#   aside from the fact the UNDERLINE only works with Courier.
1817 \#   UNDERSCORE does not work across line breaks.  Each line of
1818 \#   text must be entered separately with UNDERSCORE.  If the
1819 \#   UNDERSCORE begins in the middle of a line and crosses over a
1820 \#   break, the portion before the break must be entered in its own
1821 \#   UNDERSCORE, as must the portion that comes after the break.
1823 .MAC UNDERSCORE END
1824 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1825 .    ie \\n[#NUM_ARGS]=1 \{ \\$1\\s(12\\v'+2p'\\l'|0'\\v'-2p'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1826 .    el                  \{ \\$2\\s(12\\v'+(\\$1)'\\l'|0'\\v'-(\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1827 .    rr #RESTORE_PT_SIZE
1828 .END
1831 \# DOUBLE UNDERSCORE
1832 \# -----------------
1833 \# *Arguments:
1834 \#   [points below baseline] [points distance between rules] "text"
1835 \# *Function:
1836 \#   Same as UNDERSCORE, except it produces a double underscore.  The default
1837 \#   distance between the rules is 2 points.
1838 \# *Notes:
1839 \#   The same double-quote requirement as UNDERSCORE.
1841 .MAC UNDERSCORE2 END
1842 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1843 .    if \\n[#NUM_ARGS]=1 \{\
1844 .       PRINT \\$1\\s(12\\v'+2p'\\l'|0'\\v'+2p'\\l'|0'\\v'-4p'\\s[\\n[#RESTORE_PT_SIZE]u]
1845 .    \}
1846 .    if \\n[#NUM_ARGS]=2 \{\
1847 .       PRINT \\$2\\s(12\\v'+\\$1'\\l'|0'\\v'+2p'\\l'|0'\\v'-(2p+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1848 .    \}
1849 .    if \\n[#NUM_ARGS]=3 \{\
1850 .       PRINT \\$3\\s(12\\v'+\\$1'\\l'|0'\\v'+\\$2'\\l'|0'\\v'-(\\$2+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1851 .    \}
1852 .    rr #RESTORE_PT_SIZE
1853 .END
1856 \# SUPERSCRIPT INLINES
1857 \# -------------------
1858 \# *Function:
1859 \#   Prints everything after invocation as superscript.
1860 \# *Notes:
1861 \#   \*[SUP] and \*[SUPX] turn superscript on and off respectively.
1862 \#   If running type is pseudo-condensed/expanded, invoke the superscript
1863 \#   strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
1864 \#   and \*[EXTSUPX] respectively.
1866 .ds SUP \
1867 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1868 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1869 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]
1871 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'
1873 .ds CONDSUP \
1874 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1875 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1876 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
1878 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
1880 .ds EXTSUP \
1881 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1882 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1883 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
1885 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
1888 \# SLANT
1889 \# -----
1891 \# SETSLANT
1892 \# --------
1893 \# *Arguments:
1894 \#   <number of degrees> | RESET
1895 \# *Function:
1896 \#   Modifies register #DEGREES for use with \*[SLANT], or resets
1897 \#   it to the default.  Defines string \*[SLANTX]
1898 \# *Notes:
1899 \#   \*[SLANT] permits pseudo-italicizing of a font in cases where
1900 \#   no italic font exists in a particular family.
1902 \#   Default # of degrees is 15.
1904 \#   Do not use unit of measure with arg to SETSLANT.
1906 \#   It may be necessary to adjust the spacing on either side of
1907 \#   [SLANT] and [SLANTX].
1909 \#   In docs, SLANT carries over from para to para.
1911 .nr #DEGREES 15
1912 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1913 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1915 .MAC SETSLANT END
1916 .    ie '\\$1'RESET' \{\
1917 .       nr #DEGREES 15
1918 .       if \\n[#PRINT_STYLE]=1 \{\
1919 .          if \\n[#UNDERLINE_SLANT] \{ .return \}
1920 .       \}
1921 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1922 .    \}
1923 .    el \{\
1924 .       nr #DEGREES \\$1
1925 .       if \\n[#PRINT_STYLE]=1 \{\
1926 .          if \\n[#UNDERLINE_SLANT] \{ .return \}
1927 .       \}
1928 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1929 .    \}
1930 .    ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1931 .END
1934 \# BOLDER
1935 \# ------
1937 \# SETBOLDER
1938 \# ---------
1939 \# *Arguments:
1940 \#   <amount of emboldening> | RESET
1941 \# *Function:
1942 \#   Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
1943 \#   it to the default 700 units.
1944 \# *Notes:
1945 \#   \*[BOLDER] allows pseudo-emboldening of a font where no bold
1946 \#   font exists in a particular family.
1948 \#   Default for SETBOLDER is 700 units.  Do not use unit of measure
1949 \#   with arg to SETBOLDER.
1951 .nr #BOLDER_UNITS 700
1953 .MAC SETBOLDER END
1954 .    if \\n[#IGNORE]=1 \{ .return \}
1955 .    ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
1956 .    el \{ .nr #BOLDER_UNITS \\$1 \}
1957 .END
1960 .MAC BOLDER END
1962 .bd \\n(.f \\n[#BOLDER_UNITS]
1963 .END
1966 .MAC BOLDERX END
1968 .bd \\n(.f
1969 .END
1971 \# +++CONDENSE/EXTEND+++
1973 \# CONDENSE/EXTEND
1974 \# ---------------
1975 \# *Arguments:
1976 \#   <percentage to condense/expand type size>
1977 \# *Function:
1978 \#   Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
1979 \#   new point size (for character width) from arg, and defines string
1980 \#   COND or EXT, which set the type size to the new character width,
1981 \#   and sets the height of type to the value stored in CURRENT_PT_SIZE
1982 \# *Notes:
1983 \#   CONDENSE_OR_EXTEND is invoked from the aliases
1984 \#   CONDENSE and EXTEND.  CONDENSE implies <100, EXTEND
1985 \#   implies >100.  Do not use a percent sign in the argument.
1987 \#   There is no default setting for CONDENSE or EXTEND.
1988 \#   80 is a good approximation of condensed type, 120 is okay
1989 \#   for extended.
1991 \#   The value set by CONDENSE or EXTEND applies to all
1992 \#   subsequent \*[COND] or \*[EXT] escapes until a new value is set.
1994 \#  \*[COND] or \*[EXT] must be turned off before all changes of point
1995 \#  size and reinvoked afterwards (if so desired).  This refers to
1996 \#  changes of point size via control lines AND with via inlines.
1998 .MAC CONDENSE_OR_EXTEND END
1999 .    if '\\$0'CONDENSE' \{\
2000 .       ds $COND_PERCENT \\$1
2001 .       if \\n[#PRINT_STYLE]=1 \{\
2002 .          rm $COND_PERCENT
2003 .          ds $COND_PERCENT 100
2004 .       \}
2005 .       ds COND \
2006 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2007 \R'#CONDENSE 1'\
2008 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2009 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2010 .       ds COND_FOR_SUP \
2011 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2012 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2013 .    \}
2014 .    if '\\$0'EXTEND' \{\
2015 .       ds $EXT_PERCENT \\$1
2016 .       if \\n[#PRINT_STYLE]=1 \{\
2017 .          rm $EXT_PERCENT
2018 .          ds $EXT_PERCENT 100
2019 .       \}
2020 .       ds EXT \
2021 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2022 \R'#EXTEND 1'\
2023 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2024 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2025 .       ds EXT_FOR_SUP \
2026 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2027 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2028 .    \}
2029 .END
2031 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2032 .ds EXTX  \ER'#EXTEND   0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2035 \# +++PAD LINES+++ (insert space)
2037 \# PAD MARKER
2038 \# ----------
2039 \# *Arguments:
2040 \#   <character to use for marking pad points>
2041 \# *Function:
2042 \#   Defines string $PAD_MARKER, used in PAD
2043 \# *Notes:
2044 \#   $PAD_MARKER is normally # (the pound sign).
2046 .MAC PAD_MARKER END
2047 .    ds $PAD_MARKER \\$1
2048 .END
2051 \# PAD
2052 \# ---
2053 \# *Argments:
2054 \#   "<string of text with padding markers inserted>"
2055 \# *Function:
2056 \#   Defines and redefines padding character (default=pound sign
2057 \#   unless padding character has been set with PAD_MARKER)
2058 \#   several times so that when the string is output at the end
2059 \#   of the macro, every # has been converted to an equal-sized
2060 \#   amount of padding (blank space) on a line. # is equivalent to
2061 \#   CompuGraphic's old <IS>.
2062 \# *Notes:
2063 \#   String tabs may be marked off during PAD.
2065 .MAC PAD END
2066 .    if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2067 .    nf
2068 .    if !d$PAD_MARKER \{ .ds $PAD_MARKER # \}
2069 .    char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2070 .    ds $FAMILY_FOR_PAD \\n[.fam]
2071 .    nr #FONT_FOR_PAD   \\n(.f
2072 .    nr #SIZE_FOR_PAD   \\n[.ps]
2073 .    ds $PAD_STRING \\$1
2074 .    as $PAD_STRING \Ekp
2075 .    di PAD_STRING
2076 .    fam \\*[$FAMILY_FOR_PAD]
2077 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2078 .    br
2079 .    di
2080 .    char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2081 .    di PAD_STRING
2082 .    fam \\*[$FAMILY_FOR_PAD]
2083 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2084 .    br
2085 .    di
2086 .    char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2087 .    ie \\n[#SILENT] \{\
2088 .       SILENT
2089 .       fam \\*[$FAMILY_FOR_PAD]
2090 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2091 .       br
2092 .       SILENT OFF
2093 .    \}
2094 .    el \{\
2095 .       fam \\*[$FAMILY_FOR_PAD]
2096 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2097 .       br
2098 .    \}
2099 .    if \\n[#FILL_MODE]=1 \{\
2100 .       fi
2101 .       rr #FILL_MODE
2102 .    \}
2103 .    rr #PAD_COUNT
2104 .    rr #SPACE_TO_END
2105 .    rr #PAD_SPACE
2106 .    rm $PAD_STRING
2107 .    rm PAD_STRING
2108 .    rchar #
2109 .END
2112 \# +++LEADERS+++
2114 \#  The leader mechanism is primitive, but it works.  Basically,
2115 \#  every macro in this set that includes a line length also sets
2116 \#  a single groff tab stop at the right hand end of the line.
2117 \#  That way, whenever Ctrl-A is invoked (always at the end of
2118 \#  an input line), leader of the correct length gets deposited.
2119 \#  Ctrl-A is accessed by the string LEADER (i.e. inline, as
2120 \#  \*[LEADER]).  Leaders within tabs get their length from the
2121 \#  tab line length.
2123 \# SET LEADER CHARACTER
2124 \# --------------------
2125 \# *Arguments:
2126 \#   <character to use whenever \*[LEADER] is invoked>
2127 \# *Function:
2128 \#   Set leader character.
2130 .MAC LEADER_CHARACTER END
2131 .    lc \\$1
2132 .END
2134 .ds LEADER \x01
2136 \# +++DROP CAPS+++
2138 \# DROP CAP FAMILY
2139 \# ---------------
2140 \# *Argument:
2141 \#   <family of drop cap>
2142 \# *Function:
2143 \#   Creates or modifies string $DC_FAM.
2145 .MAC DROPCAP_FAMILY END
2146 .    ds $DC_FAM \\$1
2147 .END
2150 \# DROP CAP FONT
2151 \# -------------
2152 \# *Argument:
2153 \#   <font of drop cap>
2154 \# *Function:
2155 \#   Creates or modifies string $DC_FT.
2157 .MAC DROPCAP_FONT END
2158 .    ds $DC_FT \\$1
2159 .END
2162 \# DROP CAP GUTTER
2163 \# ---------------
2164 \# *Argument:
2165 \#   <width of gutter between drop cap and indented text>
2166 \# *Function:
2167 \#   Creates or modifies register #DC_GUT.
2168 \# *Notes:
2169 \#   Requires unit of measure.  Default is 3p.
2171 .MAC DROPCAP_GUTTER END
2172 .    nr #DC_GUT (\\$1)
2173 .END
2176 \# DROP CAP ADJUST
2177 \# ---------------
2178 \# *Argument:
2179 \#   <+|- # of points to in/decrease point size of drop cap letter>
2180 \# *Function:
2181 \#   Creates or modifies string $DC_ADJUST.
2182 \# *Notes:
2183 \#   Despite its best efforts, DROPCAP doesn't always get the point
2184 \#   size of the drop cap critically perfect.  DROPCAP_ADJUST lets
2185 \#   the user add or subtract points (or fractions of points) to
2186 \#   get the size right.
2188 \#   Requires the + or - sign.
2190 .MAC DROPCAP_ADJUST END
2191 .    ds $DC_ADJUST \\$1
2192 .END
2195 \# DROP CAP
2196 \# --------
2197 \# *Arguments:
2198 \#   <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2199 \# *Function:
2200 \#   Calculates point size of dropcap based on # of lines passed as
2201 \#   arg 2.  Sets indent for text based on dropcap width+gutter.
2202 \#   Advances and prints dropcap; reverses and prints indented text
2203 \#   to bottom of dropcap, then resets indent to left margin (plus
2204 \#   any indent that was in effect prior to invoking DROPCAP).
2205 \# *Notes:
2206 \#   Drop caps put a strain on on resource-challenged systems.
2208 \#   Drop caps when using the doc processing macro PP only work with
2209 \#   initial paragraphs (i.e. at doc start, or after heads), only when
2210 \#   DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2211 \#   is TYPESET.  If these conditions aren't met, DROPCAPS is silently
2212 \#   ignored.
2214 \#   The COND or EXT argument are processed separately from all
2215 \#   other COND or EXT inlines or macros, hence passing COND or
2216 \#   EXT has no effect on running type.
2218 .MAC DROPCAP END
2219 .    if #IGNORE \{ .return \}
2220 .    br
2221 .    if \\n[#DOCS] \{\
2222 .       if \\n[#PRINT_STYLE]=1 \{ .return \}
2223 .       if \\n[#PRINT_STYLE]=2 \{\
2224 .          if \\n[#PP_STYLE]=2 \{ .return \}
2225 .          if \\n[#PP]>1 \{ .return \}
2226 .          ti 0
2227 .       \}
2228 .    \}
2229 .    ds $DROPCAP         \\$1
2230 .    nr #DC_LINES        \\$2-1
2231 .    ds $RESTORE_COND    \\*[$COND_PERCENT]
2232 .    ds $RESTORE_EXT     \\*[$EXT_PERCENT]
2233 .    if '\\$3'COND'      \{ .CONDENSE \\$4 \}
2234 .    if '\\$3'EXT'       \{ .EXTEND \\$4 \}
2235 .    if !r#DC_GUT        \{ .nr #DC_GUT (3p) \}
2236 .    ds $RESTORE_FAM     \\n[.fam]
2237 .    nr #RESTORE_FT      \\n(.f
2238 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2239 .    nr #RESTORE_INDENT  \\n(.i
2240 .    SIZESPECS
2241 .    nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2242 .    ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2243 .    el \{ .FAM \\*[$DC_FAM] \}
2244 .    ie !d$DC_FT \{ .FT \\n(.f \}
2245 .    el \{ .FT \\*[$DC_FT] \}
2246 .    while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2247 .       ps \\n[#PT_SIZE]u+100u
2248 .       SIZESPECS
2249 .       nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2250 .    \}
2251 .    if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2252 .    mk x
2253 .    sp \\n[#DC_LINES]v
2254 .    ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2255 .    el \{ .PRINT \\*[$DROPCAP] \}
2256 .    if '\\$3'COND' \{ \E*[COND] \}
2257 .    if '\\$3'EXT'  \{ \E*[EXT]  \}
2258 .    ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2259 .    el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2260 .    if '\\$3'COND' \{ \E*[CONDX]\c \}
2261 .    if '\\$3'EXT'  \{ \E*[EXTX]\c \}
2262 .    rt \\nxu
2263 .    FAM \\*[$RESTORE_FAM]
2264 .    FT  \\n[#RESTORE_FT]
2265 .    ps \\n[#RESTORE_PT_SIZE]u
2266 .    CONDENSE \\*[$RESTORE_COND]
2267 .    EXTEND   \\*[$RESTORE_EXT]
2268 .    ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2269 .    el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2270 .    rm $DROPCAP
2271 .    rr #DC_LINES
2272 .    rm $RESTORE_COND
2273 .    rm $RESTORE_EXT
2274 .    rm $RESTORE_FAM
2275 .    rr #RESTORE_FT
2276 .    rr #RESTORE_PT_SIZE
2277 .    rr #RESTORE_INDENT
2278 .    rr #DC_HEIGHT
2279 .    rr #GET_DC_HEIGHT
2280 .    rr x
2281 .END
2283 .MAC DROPCAP_OFF END
2284 '    in \\n[#RESTORE_INDENT]u
2285 .END
2288 \# RULE
2289 \# ----
2290 \# *Argument:
2291 \#   <none>
2292 \# *Function:
2293 \#   Draws a rule the length of the current measure.
2294 \# *Notes:
2296 .MAC RULE END
2297 .    if \\n(.j=1 \{\
2298 .       ds $CURRENT_QUAD \\*[$QUAD_VALUE]
2299 .       nf
2300 .    \}
2301 .    ie \\n[#INDENT_ACTIVE] \{\
2302 .       nr #RESTORE_L_LENGTH \\n(.l
2303 .       if \\n[#INDENT_BOTH_ACTIVE] \{ .ll \\n(.lu-\\n[#BL_INDENT]u \}
2304 .       if \\n[#INDENT_LEFT_ACTIVE] \{ .ll \\n(.lu-\\n[#L_INDENT]u \}
2305 .       PRINT \El'\En(.lu'
2306 .       ll \\n[#RESTORE_L_LENGTH]u
2307 .       rr #RESTORE_L_LENGTH]u
2308 .    \}
2309 .    el \{\
2310 .       PRINT \El'\En(.lu'
2311 .    \}
2312 .    QUAD \\*[$CURRENT_QUAD]
2313 .    rm $CURRENT_QUAD
2314 .    EL
2315 .END
2317 \# =====================================================================
2319 \# +++WORD AND SENTENCE SPACING+++
2321 \# WORD SPACE CONTROL
2322 \# ------------------
2323 \# *Argument:
2324 \#   <+|->wordspace | DEFAULT
2325 \# *Function:
2326 \#   Increases or decreases interword space by user supplied amount.
2327 \#   If DEFAULT, value is set to 12 (groff default).
2328 \# *Notes:
2329 \#   $WS_CONSTANT is the groff default word space.
2330 \#   $WS_VAR is the user supplied amount by which to in/decrease word space.
2331 \#   $WS is a concatenation of WS_CONSTANT and WS_VAR.
2333 \#   Because the user supplied value requires a literal + or - sign,
2334 \#   the macro argument is stored in a string.
2336 \#   \n[.sss] holds the current sentence space value.
2338 .MAC WS END
2339 .    ds $WS_CONSTANT 12
2340 .    ds $WS_VAR \\$1
2341 .    ie '\\$1'DEFAULT' \{ .ds $WS_VAR +0 \}
2342 .    el                \{ .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR]) \}
2343 .    ie \\n[.sss]=12   \{ .ss \\*[$WS] 12 \}
2344 .    el \{\
2345 .       ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
2346 .       SS \\*[$SS_VAR]
2347 .    \}
2348 .END
2351 \# SENTENCE SPACE CONTROL
2352 \# ----------------------
2353 \# *Argument:
2354 \#   <+-sentencespace> | 0 | DEFAULT
2355 \# *Function:
2356 \#   Increases or decreases sentence space by user supplied amount.
2357 \#   If 0, sentence spaces are ignored.  If DEFAULT, value is
2358 \#   set to 12 (groff default).
2359 \# *Notes:
2360 \#   Because the user supplied value requires a literal + or - sign,
2361 \#   the macro argument is stored in a string.
2363 \#   Sentence space applies only to input where sentences are separated
2364 \#   by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
2365 \#   Changing .SS when sentences are separated by only one space has
2366 \#   no effect on the space between sentences.
2368 \#   \n[.ss] holds the current wordspace value.
2369 \#   \n[.sss] holds the current sentence space value.
2371 .MAC SS END
2372 .    ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
2373 .    el \{\
2374 .       ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
2375 .       el \{\
2376 .          ds $SS_VAR \\$1
2377 .          ss \\n[.ss] (0\\*[$SS_VAR])
2378 .       \}
2379 .    \}
2380 .END
2383 \# =====================================================================
2385 \# +++INDENTS+++
2387 \# There are five styles of indents: left, right, both, temporary,
2388 \# and hanging.  Each is set/invoked with a different macro.
2389 \# Indent macros begin with the letter "I", hence .IL means "indent left,"
2390 \# .IR means "indent right," and so on.
2392 \# The first time any of the indent macros is used, it requires an
2393 \# argument--the size of the indent in ipPcm.  The size may also
2394 \# be entered using the \w'#' function--very useful for numbered
2395 \# lists using HI).  The unit of measure is required.  Subsequent
2396 \# invocations don't require the argument; the indent measure remains the
2397 \# same until it's changed by invoking the macro with an argument again.
2399 \# If no indents are in effect, the arguments passed to indent macros are
2400 \# measured from the left and right margins of the page.  If a left indent
2401 \# or a right indent is already in effect, the arguments passed to
2402 \# the indent macros are calculated from the current values; in other words,
2403 \# the arguments are additive.  If you quit an indent and later return
2404 \# to it, its value will be the value last in effect, unless you pass
2405 \# it an argument.  If you do pass an argument, it is added to the last
2406 \# value in effect, unless you cleared the indent with one of
2407 \# .I<LRB>X macros.
2409 \# Example
2410 \# -------
2412 \# .IL 2P
2413 \# ...some text...
2414 \# .IL 2P
2415 \# ...some text...
2416 \# .IQ
2417 \# ...some text...
2418 \# .IL
2419 \# ...some text...
2421 \# The first .IL 2P indents text 2P from the left margin.  The second
2422 \# .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
2423 \# .IQ turns the indent off.  The last .IL (which has no argument)
2424 \# takes its value from the total of all arguments passed to .IL (in
2425 \# this case, 2P and 2P), therefore it indents 2P+2P from the left
2426 \# margin, i.e. 4P.  If you wanted the last .IL to indent just 2P,
2427 \# you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
2428 \# the last .IL the argument 2P.
2430 \# To reverse the sense of an indent added to an indent, you may use
2431 \# negative values.
2433 \# Indents can be turned off individually with ILX, IRX, and IBX.
2434 \# LEFT and RIGHT indents may be combined and manipulated
2435 \# separately, (e.g. you can have an IL of 2P and an IR of 4P
2436 \# operative at the same time, and then change, say, the IL to
2437 \# 4P--thereby left indenting 6P--while the IR remains at 4P.
2439 \# IB automatically turns off IL and IR.  They have to be reinvoked
2440 \# again when needed. IL and IR automatically turn IB off; it, too,
2441 \# has to be reinvoked with needed.
2443 \# All indents can be turned off at once with IQ.  The ILX, IRX, IBX,
2444 \# and IQ macros simply turn the indents off; the values stored in
2445 \# the respective indent macros (IL, IR, IB) remain in effect.  If
2446 \# the user wishes to clear the values, the I<LRB>X macros should be
2447 \# invoked with the single argument CLEAR.  IQ CLEAR clears out
2448 \# the values stored for all indent styles.
2450 \# Indents *must* be turned off before settting string tabs
2451 \# inside PAD.  Generally, in order not to get confused, it's a
2452 \# good idea to turn all indents off before setting any tabs.
2454 \# TI and HI are special cases.  There's no need to turn them off,
2455 \# since they affect only one line--the first after their
2456 \# invocation.  Like the other indent styles, the first time
2457 \# they're invoked, they require a value in iPpcm; each subsequent
2458 \# invocation without an argument will use the same value.  To
2459 \# change the value, simply pass a new value.  Values for TI and HI
2460 \# are *not* additive.
2462 \# HI presupposes that you already have a left or both indent
2463 \# on.  HI will never hang a line outside the left margin of a
2464 \# document.  In other words, you must have IL or IB on before you
2465 \# can use HI.
2467 \# INDENT LEFT
2468 \# -----------
2470 .MAC IL END
2471 .    if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2472 .    nr #INDENT_STYLE_LEFT  1
2473 .    nr #INDENT_ACTIVE      1
2474 .    nr #INDENT_LEFT_ACTIVE 1
2475 .    ie '\\$1'' \{\
2476 .       br
2477 .       in \\n[#L_INDENT]u
2478 .       ta \\n(.lu-\\n[#L_INDENT]u
2479 .    \}
2480 .    el \{\
2481 .       br
2482 .       nr #L_INDENT +(\\$1)
2483 .       in \\n[#L_INDENT]u
2484 .       ta \\n(.lu-\\n[#L_INDENT]u
2485 .    \}
2486 .END
2489 \# +++INDENT RIGHT+++
2491 .MAC IR END
2492 .    if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2493 .    nr #INDENT_STYLE_RIGHT   1
2494 .    nr #INDENT_ACTIVE        1
2495 .    nr #INDENT_RIGHT_ACTIVE 1
2496 .    ie '\\$1'' \{\
2497 .       br
2498 .       ie \\n[#TAB_ACTIVE] \{\
2499 .          ll \\n(.lu-\\n[#R_INDENT]u
2500 .          ta \\n(.lu-\\n[#L_INDENT]u
2501 .       \}
2502 .       el \{\
2503 .          ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2504 .          ta \\n(.lu-\\n[#L_INDENT]u
2505 .       \}
2506 .    \}
2507 .    el \{\
2508 .       br
2509 .       nr #R_INDENT +(\\$1)
2510 .       ie \\n[#TAB_ACTIVE] \{\
2511 .          ll \\n(.lu-\\n[#R_INDENT]u
2512 .          ta \\n(.lu-\\n[#L_INDENT]u
2513 .       \}
2514 .       el \{\
2515 .          ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2516 .          ta \\n(.lu-\\n[#L_INDENT]u
2517 .       \}
2518 .    \}
2519 .END
2522 \# +++INDENT BOTH+++
2524 .MAC IB END
2525 .    if \\n[#INDENT_STYLE_LEFT]  \{ .ILX \}
2526 .    if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
2527 .    nr #INDENT_STYLE_BOTH  1
2528 .    nr #INDENT_ACTIVE      1
2529 .    nr #INDENT_BOTH_ACTIVE 1
2530 .    ie '\\$1'' \{\
2531 .       br
2532 .       in \\n[#BL_INDENT]u
2533 .       ie \\n[#TAB_ACTIVE] \{\
2534 .          ll \\n(.lu-\\n[#BR_INDENT]u
2535 .          ta \\n(.lu-\\n[#BR_INDENT]u
2536 .       \}
2537 .       el \{\
2538 .          ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2539 .          ta \\n(.lu-\\n[#BR_INDENT]u
2540 .       \}
2541 .    \}
2542 .    el \{\
2543 .       br
2544 .       nr #BL_INDENT (\\n[#INDENT]+\\$1)
2545 .       ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
2546 .       el                  \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
2547 .       ie \\n[#TAB_ACTIVE] \{\
2548 .          in \\n[#BL_INDENT]u
2549 .          ll \\n(.lu-\\n[#BR_INDENT]u
2550 .          ta \\n(.lu-\\n[#BL_INDENT]u
2551 .       \}
2552 .       el \{\
2553 .          in \\n[#BL_INDENT]u
2554 .          ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2555 .          ta \\n(.lu-\\n[#BR_INDENT]u
2556 .       \}
2557 .    \}
2558 .END
2561 \# +++TEMPORARY INDENT+++
2563 .MAC TI END
2564 .    br
2565 .    ie '\\$1'' \{\
2566 .       ti \\n[#T_INDENT]u
2567 .       if \\n[#INDENT_LEFT_ACTIVE] \{\
2568 .          ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
2569 .       \}
2570 .       if \\n[#INDENT_BOTH_ACTIVE] \{\
2571 .          ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
2572 .       \}
2573 .    \}
2574 .    el \{\
2575 .       nr #T_INDENT (\\$1)
2576 .       ti \\n[#T_INDENT]u
2577 .    \}
2578 .END
2581 \# +++HANGING INDENT+++
2583 .MAC HI END
2584 .    ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
2585 .    el \{\
2586 .       nr #HL_INDENT (\\$1)
2587 .       ti -\\n[#HL_INDENT]u
2588 .    \}
2589 .END
2592 \# +++INDENTS OFF+++
2594 .MAC ILX END
2595 .    br
2596 .    in 0
2597 .    rr #INDENT_LEFT_ACTIVE
2598 .    if '\\$1'CLEAR' \{\
2599 .       rr #L_INDENT
2600 .       rr #INDENT_STYLE_LEFT
2601 .    \}
2602 .END
2605 .MAC IRX END
2606 .    br
2607 .    rr #INDENT_RIGHT_ACTIVE
2608 .    ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2609 .    el \{\
2610 .       ie \\n[#COLUMNS] \{\
2611 .          ll \\n[#COL_L_LENGTH]u
2612 .          ta \\n(.lu
2613 .       \}
2614 .       el \{\
2615 .          ll \\n[#L_LENGTH]u
2616 .          ta \\n(.lu
2617 .       \}
2618 .    \}
2619 .    if '\\$1'CLEAR' \{\
2620 .       rr #R_INDENT
2621 .       rr #INDENT_STYLE_RIGHT
2622 .    \}
2623 .END
2626 .MAC IBX END
2627 .    br
2628 .    in 0
2629 .    rr #INDENT_BOTH_ACTIVE
2630 .    ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2631 .    el \{\
2632 .       ie \\n[#COLUMNS] \{\
2633 .          ll \\n[#COL_L_LENGTH]u
2634 .          ta \\n(.lu
2635 .       \}
2636 .       el \{\
2637 .          ll \\n[#L_LENGTH]u
2638 .          ta \\n(.lu
2639 .       \}
2640 .    \}
2641 .    if '\\$1'CLEAR' \{\
2642 .       rr #BL_INDENT
2643 .       rr #BR_INDENT
2644 .       rr #INDENT_STYLE_BOTH
2645 .    \}
2646 .END
2649 .MAC IX END
2650 .    if '\\$0'IX' \{\
2651 .       if !\\n[#IX_WARN] \{\
2652 .          tm1 "[mom]: Use of .IX is now deprecated.  Use .IQ instead.
2653 .          tm1 "      .IX will continue to behave as before, but to
2654 .          tm1 "       avoid this message, please update your document.
2655 .          nr #IX_WARN 1
2656 .       \}
2657 .    \}
2658 .    br
2659 .    in 0
2660 .    rr #INDENT_LEFT_ACTIVE
2661 .    rr #INDENT_RIGHT_ACTIVE
2662 .    rr #INDENT_BOTH_ACTIVE
2663 .    if \\n[#INDENT_STYLE_RIGHT] \{\
2664 .       ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2665 .       el \{\
2666 .          ie \\n[#COLUMNS] \{\
2667 .             ll \\n[#COL_L_LENGTH]u
2668 .             ta \\n(.lu
2669 .          \}
2670 .          el \{\
2671 .             ll \\n[#L_LENGTH]u
2672 .             ta \\n(.lu
2673 .          \}
2674 .       \}
2675 .    \}
2676 .    if \\n[#INDENT_STYLE_BOTH] \{\
2677 .       ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2678 .       el \{\
2679 .          ie \\n[#COLUMNS] \{\
2680 .             ll \\n[#COL_L_LENGTH]u
2681 .             ta \\n(.lu
2682 .          \}
2683 .          el \{\
2684 .             ll \\n[#L_LENGTH]u
2685 .             ta \\n(.lu
2686 .          \}
2687 .       \}
2688 .    \}
2689 .    if '\\$1'CLEAR' \{\
2690 .       if \\n[#INDENT_STYLE_RIGHT] \{\
2691 .          ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2692 .          el \{\
2693 .             ie \\n[#COLUMNS] \{\
2694 .                ll \\n[#COL_L_LENGTH]u
2695 .                ta \\n(.lu
2696 .             \}
2697 .             el \{\
2698 .                ll \\n[#L_LENGTH]u
2699 .                ta \\n(.lu
2700 .             \}
2701 .          \}
2702 .       \}
2703 .       if \\n[#INDENT_STYLE_BOTH] \{\
2704 .          ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2705 .          el \{\
2706 .             ie \\n[#COLUMNS] \{\
2707 .                ll \\n[#COL_L_LENGTH]u
2708 .                ta \\n(.lu
2709 .             \}
2710 .             el \{\
2711 .                ll \\n[#L_LENGTH]u
2712 .                ta \\n(.lu
2713 .             \}
2714 .          \}
2715 .       \}
2716 .       rr #L_INDENT
2717 .       rr #R_INDENT
2718 .       rr #BL_INDENT
2719 .       rr #BR_INDENT
2720 .       rr #T_INDENT
2721 .       rr #H_INDENT
2722 .       rr #INDENT_STYLE_LEFT
2723 .       rr #INDENT_STYLE_RIGHT
2724 .       rr #INDENT_STYLE_BOTH
2725 .    \}
2726 .    rr #INDENT_ACTIVE
2727 .END
2729 \# =====================================================================
2731 \# +++MULTIPLE COLUMNS+++
2733 \# MULTIPLE COLUMNS ON
2734 \# -------------------
2735 \# *Arguments:
2736 \#   <none>
2737 \# *Function:
2738 \#   Marks the top of a column set
2740 .MAC MCO END
2741 .mk c
2742 .END
2744 \# MULTIPLE COLUMN RETURN
2745 \# ----------------------
2746 \# *Arguments:
2747 \#   <none>
2748 \# *Function:
2749 \#   Returns to the top of a column set
2751 .MAC MCR END
2752 .    sp |\\ncu
2753 .END
2755 \# MULTIPLE COLUMNS OFF
2756 \# --------------------
2757 \# *Arguments:
2758 \#   <none> | <lead to advance beneath bottom of deepest column>
2759 \# *Function:
2760 \#   Advances to the end of a column set
2761 \# *Notes:
2762 \#   With no argument, advances to the next baseline (at the current
2763 \#   leading value) beneath the longest column.  With an argument
2764 \#   (which requires a unit of measure), advances arg distance
2765 \#   beneath the baseline of the deepest column.  If the argument
2766 \#   is zero, advances to the baseline of the deepest column.
2768 .MAC MCX END
2769 .    ie '\\$1'' \{\
2770 .       TQ
2771 .       sp |\\n(.hu
2772 .    \}
2773 .    el \{\
2774 .       nr #MCX_ALD (\\$1)
2775 .       TQ
2776 .       ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
2777 .       el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
2778 .       rr #MCX_ALD (\\$1)
2779 .    \}
2780 .END
2782 \# =====================================================================
2784 \# +++TYPESETTING SUPPORT MACROS+++
2786 \# TRAP
2787 \# ----
2788 \# *Arguments:
2789 \#   toggle
2790 \# *Function:
2791 \#   Enables/disables traps.
2792 \# *Notes:
2793 \#   EL and TN don't function as advertised on the last line before
2794 \#   a trap (when they break the preceding line, they spring the
2795 \#   trap, and groff won't back up to the line preceding the trap).
2796 \#   TRAP is a kludge to get EL and TN work properly on last lines.
2797 \#   The user simply enloses the offending lines in TRAP OFF/TRAP.
2799 .MAC TRAP END
2800 .    ie '\\$1'' \{ .vpt 1 \}
2801 .    el \{ .vpt 0 \}
2802 .END
2805 \# SILENT
2806 \# ------
2807 \# *Arguments:
2808 \#   <none> | <anything>
2809 \# *Function:
2810 \#   Diverts text so that it doesn't print, or turns the function off.
2811 \# *Notes:
2812 \#   Useful for setting up autotabs where you don't want the line with
2813 \#   the tab marks to print.
2815 \#   Also aliased as COMMENT, in case user wants to input a batch of
2816 \#   text that doesn't print.
2818 .MAC SILENT END
2819 .    nr #SILENT 1
2820 .    if \\n[#QUAD] \{ .br \}
2821 .    ie '\\$1'' \{ .di NO_FLASH \}
2822 .    el \{\
2823 .       br
2824 .       di
2825 .       rm NO_FLASH
2826 .       rr #SILENT
2827 .    \}
2828 .END
2831 \# PRINT
2832 \# -----
2833 \# *Arguments:
2834 \#   <anything>
2835 \# *Function:
2836 \#   Prints anything.  A macro that helps keep my code nicely indented.
2838 .MAC PRINT END
2839 \\$*
2840 .END
2843 \# CAPS
2844 \# ----
2845 \# *Arguments:
2846 \#   <none> | <anything>
2847 \# *Function:
2848 \#   Converts text to caps, or, if OFF, reverts to normal caps/lc.
2850 .MAC CAPS END
2851 .    ie '\\$1'' \{\
2852 .       tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
2853 .       tr Ã \[`A]
2854 .       tr Ã¢\[^A]
2855 .       tr Ã¡\['A]
2856 .       tr Ã¤\[:A]
2857 .       tr Ã¥\[oA]
2858 .       tr Ã£\[~A]
2859 .       tr Ã¦\[AE]
2860 .       tr Ã¨\[`E]
2861 .       tr Ãª\[^E]
2862 .       tr Ã©\['E]
2863 .       tr Ã«\[:E]
2864 .       tr Ã¬\[`I]
2865 .       tr Ã®\[^I]
2866 .       tr Ã­\['I]
2867 .       tr Ã¯\[:I]
2868 .       tr Ã²\[`O]
2869 .       tr Ã´\[^O]
2870 .       tr Ã³\['O]
2871 .       tr Ã¶\[:O]
2872 .       tr Ãµ\[~O]
2873 .       tr Ã¸\[/O]
2874 .       tr Ã¹\[`U]
2875 .       tr Ã»\[^U]
2876 .       tr Ãº\['U]
2877 .       tr Ã¼\[:U]
2878 .       tr Ã§\[,C]
2879 .       tr Ã°\[-D]
2880 .       tr Ã±\[~N]
2881 .       tr Ã¾\[TP]
2882 .       tr Ã½\['Y]
2883 .       tr Ã¿\[:Y]
2884 .       nr #CAPS_ON 1
2885 .    \}
2886 .    el \{\
2887 .       tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
2888 .       tr Ã \[`a]
2889 .       tr Ã¢\[^a]
2890 .       tr Ã¡\['a]
2891 .       tr Ã¤\[:a]
2892 .       tr Ã¥\[oa]
2893 .       tr Ã£\[~a]
2894 .       tr Ã¦\[ae]
2895 .       tr Ã¨\[`e]
2896 .       tr Ãª\[^e]
2897 .       tr Ã©\['e]
2898 .       tr Ã«\[:e]
2899 .       tr Ã¬\[`i]
2900 .       tr Ã®\[^i]
2901 .       tr Ã­\['i]
2902 .       tr Ã¯\[:i]
2903 .       tr Ã²\[`o]
2904 .       tr Ã´\[^o]
2905 .       tr Ã³\['o]
2906 .       tr Ã¶\[:o]
2907 .       tr Ãµ\[~o]
2908 .       tr Ã¸\[/o]
2909 .       tr Ã¹\[`u]
2910 .       tr Ã»\[^u]
2911 .       tr Ãº\['u]
2912 .       tr Ã¼\[:u]
2913 .       tr Ã§\[,c]
2914 .       tr Ã°\[Sd]
2915 .       tr Ã±\[~n]
2916 .       tr Ã¾\[Tp]
2917 .       tr Ã½\['y]
2918 .       tr Ã¿\[:y]
2919 .       rr #CAPS_ON
2920 .    \}
2921 .END
2923 \# SIZESPECS
2924 \# ---------
2925 \# Argument:
2926 \#   <none>
2927 \# Function:
2928 \#   Gets cap-height, x-height, and descender depth of the
2929 \#   current font at the current point size.
2930 \# *Notes:
2931 \#   The routine is diverted so it remains invisible to output.
2933 .MAC SIZESPECS END
2934 .    di TYPESIZE
2935 E\\R'#CAP_HEIGHT \\n[.cht]'
2936 e\\R'#X_HEIGHT \\n[.cht]'
2937 y\\R'#DESCENDER \\n[.cdp]'
2938 .    br
2939 .    di
2940 .END
2942 \# =====================================================================
2944 \# +++TYPESETTING ALIASES+++
2946 .ALIAS    CENTRE          CENTER
2947 .ALIAS    COMMENT         SILENT
2948 .ALIAS    CONDENSE        CONDENSE_OR_EXTEND
2949 .ALIAS    EXTEND          CONDENSE_OR_EXTEND
2950 .ALIAS    FAM             FAMILY
2951 .ALIAS    HYPHENATE       HY
2952 .ALIAS    HYPHENATION     HY
2953 .ALIAS    HYSET           HY_SET
2954 .ALIAS    LIG             LIGATURES
2955 .ALIAS    IBQ             IBX
2956 .ALIAS    ILQ             ILX
2957 .ALIAS    IQ              IX
2958 .ALIAS    IRQ             IRX
2959 .ALIAS    PADMARKER       PAD_MARKER
2960 .ALIAS    TABSET          TAB_SET
2961 .ALIAS    TB              TAB
2962 .ALIAS    UNDERSCORE_2    UNDERSCORE2
2965 \# ====================================================================
2967 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
2968 \# ===============================================
2970 \# +++PAGE DIMENSIONS+++
2972 \# PAPER SIZE
2973 \# ----------
2974 \# *Arguments:
2975 \#   LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
2976 \# *Function:
2977 \#   Sets up margins for different paper sizes.
2979 .MAC PAPER END
2980 .    ds $PAPER \\$1
2981 .    if '\\*[$PAPER]'LETTER' \{\
2982 .       PAGEWIDTH  8.5i
2983 .       PAGELENGTH 11i
2984 .    \}
2985 .    if '\\*[$PAPER]'LEGAL' \{\
2986 .       PAGEWIDTH  8.5i
2987 .       PAGELENGTH 14i
2988 .    \}
2989 .    if '\\*[$PAPER]'STATEMENT' \{\
2990 .       PAGEWIDTH  5.5i
2991 .       PAGELENGTH 8.5i
2992 .    \}
2993 .    if '\\*[$PAPER]'TABLOID' \{\
2994 .       PAGEWIDTH  11i
2995 .       PAGELENGTH 17i
2996 .    \}
2997 .    if '\\*[$PAPER]'LEDGER' \{\
2998 .       PAGEWIDTH  17i
2999 .       PAGELENGTH 11i
3000 .    \}
3001 .    if '\\*[$PAPER]'FOLIO' \{\
3002 .       PAGEWIDTH  8.5i
3003 .       PAGELENGTH 13i
3004 .    \}
3005 .    if '\\*[$PAPER]'QUARTO' \{\
3006 .       PAGEWIDTH  610p
3007 .       PAGELENGTH 780p
3008 .    \}
3009 .    if '\\*[$PAPER]'10x14' \{\
3010 .       PAGEWIDTH  10i
3011 .       PAGELENGTH 14i
3012 .    \}
3013 .    if '\\*[$PAPER]'EXECUTIVE' \{\
3014 .       PAGEWIDTH  7.25i
3015 .       PAGELENGTH 10.5i
3016 .    \}
3017 .    if '\\*[$PAPER]'A3' \{\
3018 .       PAGEWIDTH  842p
3019 .       PAGELENGTH 1190p
3020 .    \}
3021 .    if '\\*[$PAPER]'A4' \{\
3022 .       PAGEWIDTH  595p
3023 .       PAGELENGTH 842p
3024 .    \}
3025 .    if '\\*[$PAPER]'A5' \{\
3026 .       PAGEWIDTH  421p
3027 .       PAGELENGTH 595p
3028 .    \}
3029 .    if '\\*[$PAPER]'B4' \{\
3030 .       PAGEWIDTH  709p
3031 .       PAGELENGTH 1002p
3032 .    \}
3033 .    if '\\*[$PAPER]'B5' \{\
3034 .       PAGEWIDTH  501p
3035 .       PAGELENGTH 709p
3036 .    \}
3037 .    if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
3038 .    if !r#R_MARGIN \{ .R_MARGIN 1i \}
3039 .END
3042 \# ====================================================================
3044 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
3046 \# PRINTSTYLE
3047 \# ----------
3048 \# *Arguments:
3049 \#   TYPESET | TYPEWRITE [SINGLESPACE]
3050 \# *Function:
3051 \#   Sets type specs for typewriter-style or typeset output.
3052 \# *Notes:
3053 \#   Number registers: TYPEWRITE=1, TYPESET=2.
3055 .MAC PRINTSTYLE END
3056 .    if !d$PAPER \{ .PAPER LETTER \}
3057 .    if '\\$1'TYPEWRITE' \{\
3058 .       nr #PRINT_STYLE 1
3059 .       if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3060 .       if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3061 .       fam  C
3062 .       ft   R
3063 .       ps   12
3064 .       ie '\\$2'SINGLESPACE' \{\
3065 .           nr #SINGLE_SPACE 1
3066 .           vs 12
3067 .       \}
3068 .       el \{ .vs 24 \}
3069 .       QUAD    L
3070 .       HY      OFF
3071 .       SMARTQUOTES OFF
3072 .       if !\\n[#PP_INDENT] \{\
3073 .          in 3P                 \"Set indent
3074 .          nr #PP_INDENT \\n(.i  \"Read into #PP_INDENT
3075 .          in 0                  \"Remove indent
3076 .       \}
3077 .       HDRFTR_RIGHT_CAPS
3078 .       nr #BOLDER_UNITS 0
3079 .       nr #CONDENSE 0
3080 .       nr #EXTEND 0
3081 .       rm IT
3082 .       rm BD
3083 .       rm BDI
3084 .       rm PREV
3085 .       UNDERLINE_SLANT
3086 .       UNDERLINE_ITALIC
3087 .       UNDERLINE_QUOTES
3088 .       nr #IGNORE_COLUMNS 1
3089 .       char \(em --
3090 .    \}
3091 .    if '\\$1'TYPESET' \{\
3092 .       nr #PRINT_STYLE 2
3093 .       if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3094 .       if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3095 .       FAMILY  T
3096 .       FT      R
3097 .       if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
3098 .       if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
3099 .       JUSTIFY
3100 .       HY
3101 .       HY_SET 2 36p 1p
3102 .       KERN
3103 .       LIG
3104 .       SS 0
3105 .       SMARTQUOTES
3106 .       if !\\n[#PP_INDENT] \{\
3107 .          in 2m                 \"Set indent
3108 .          nr #PP_INDENT \\n(.i  \"Read into #PP_INDENT
3109 .          in 0                  \"Remove indent
3110 .       \}
3111 .       HDRFTR_RIGHT_CAPS
3112 .       rr #IGNORE_COLUMNS
3113 .    \}
3114 .END
3117 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
3119 \# ITALIC MEANS ITALIC
3120 \# -------------------
3121 \# *Argument:
3122 \#   <none>
3123 \# *Function:
3124 \#   Instructs TYPEWRITE to treat italics as italics, whether
3125 \#   invoked via control lines or inline.
3126 \# *Notes:
3127 \#   ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
3128 \#   hence invoking the one automatically turns off the other.
3130 .MAC ITALIC_MEANS_ITALIC END
3131 .    if \\n[#PRINT_STYLE]=1 \{\
3132 .       nr #ITALIC_MEANS_ITALIC 1
3133 .       rr #UNDERLINE_ITALIC
3134 .       rm ROM
3135 .       rm IT
3136 .       rm PREV
3137 .       ds ROM  \EfR
3138 .       ds IT   \EfI
3139 .       ds PREV \EfR
3140 .    \}
3141 .END
3144 \# UNDERLINE ITALIC
3145 \# ----------------
3146 \# *Argument:
3147 \#   <none>
3148 \# *Function:
3149 \#   Instructs TYPEWRITE to underline italics, whether invoked
3150 \#   via control lines or inline.
3151 \# *Notes:
3152 \#   UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
3153 \#   hence invoking the one automatically turns off the other.
3155 \#   UNDERLINE_ITALIC is the default for TYPEWRITE.
3157 .MAC UNDERLINE_ITALIC END
3158 .    if \\n[#PRINT_STYLE]=1 \{\
3159 .       nr #UNDERLINE_ITALIC 1
3160 .       rr #ITALIC_MEANS_ITALIC
3161 .       rm ROM
3162 .       rm IT
3163 .       rm PREV
3164 .       ds ROM  \E*[ULX]
3165 .       ds IT   \E*[UL]
3166 .       ds PREV \E*[ULX]
3167 .    \}
3168 .END
3171 \# UNDERLINE SLANT
3172 \# ---------------
3173 \# *Arguments:
3174 \#   <none> | <anything>
3175 \# *Function:
3176 \#   Instructs TYPEWRITE to underline occurences of \*[SLANT], or
3177 \#   turns feature off.
3178 \# *Notes:
3179 \#   Users may want \*[SLANT] to mean slant in TYPEWRITE, although
3180 \#   most of the time, \*[SLANT] most likely means the user wanted
3181 \#   italic but didn't have it, ergo the need to tell TYPEWRITE to
3182 \#   treat \*[SLANT] as italic (i.e. underlined).
3184 \#   UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
3185 \#   hence invoking the one automatically turns off the other.
3187 \#   UNDERLINE_SLANT is the default for TYPEWRITE.
3189 .MAC UNDERLINE_SLANT END
3190 .    if \\n[#PRINT_STYLE]=1 \{\
3191 .       rr #SLANT_MEANS_SLANT
3192 .       nr #UNDERLINE_SLANT 1
3193 .       rm SLANT
3194 .       rm SLANTX
3195 .       ds SLANT  \ER'#SLANT_ON 1'\E*[UL]
3196 .       ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
3197 .    \}
3198 .END
3201 .MAC SLANT_MEANS_SLANT END
3202 .    if \\n[#PRINT_STYLE]=1 \{\
3203 .       rr #UNDERLINE_SLANT
3204 .       nr #SLANT_MEANS_SLANT 1
3205 .       rm SLANT
3206 .       rm SLANTX
3207 .       ds SLANT  \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
3208 .       ds SLANTX \ER'#SLANT_ON 0'\ES'0'
3209 .    \}
3210 .END
3213 .MAC IGNORE_COLUMNS END
3214 .    if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
3215 .END
3218 \# ====================================================================
3220 \# +++COPY STYLE -- DRAFT OR FINAL+++
3222 \# COPY STYLE
3223 \# ----------
3224 \# *Arguments:
3225 \#   DRAFT | FINAL
3226 \# *Function:
3227 \#   Sets registers that are used to determine what to put
3228 \#   in the default header, and how to number pages.
3229 \# *Notes:
3230 \#   DOCTYPE must come before COPYSTYLE.
3232 .MAC COPYSTYLE END
3233 .    ds $COPY_STYLE \\$1
3234 .    if '\\*[$COPY_STYLE]'DRAFT' \{\
3235 .       nr #COPY_STYLE 1
3236 .       if !r#DRAFT \{ .DRAFT 1 \}
3237 .    \}
3238 .    if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2         \}
3239 .    if !d$CHAPTER_STRING        \{ .CHAPTER_STRING "Chapter" \}
3240 .    if !d$DRAFT_STRING          \{ .DRAFT_STRING "Draft"     \}
3241 .    if !d$REVISION_STRING       \{ .REVISION_STRING "Rev."   \}
3242 \# Default
3243 .    if \\n[#DOC_TYPE]=1 \{\
3244 .       ie \\n[#COPY_STYLE]=1 \{\
3245 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3246 .          el \{ .PAGENUM_STYLE roman \}
3247 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3248 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
3249 .                ds $HDRFTR_CENTER
3250 .             \}
3251 .             el \{\
3252 .                ie !\\n[#REVISION] \{\
3253 .                   ds $HDRFTR_CENTER \
3254                     \\*[$DRAFT_STRING] \\n[#DRAFT]
3255 .                \}
3256 .                el \{\
3257 .                   ds $HDRFTR_CENTER \
3258                     \\*[$DRAFT_STRING] \\n[#DRAFT], \
3259                     \\*[$REVISION_STRING] \\n[#REVISION]
3260 .                \}
3261 .             \}
3262 .          \}
3263 .       \}
3264 .       el \{\
3265 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3266 .          el \{ .PAGENUM_STYLE DIGIT \}
3267 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{ .ds $HDRFTR_CENTER \}
3268 .       \}
3269 .    \}
3270 \# Chapter
3271 .    if \\n[#DOC_TYPE]=2 \{\
3272 \# Copystyle DRAFT
3273 .       ie \\n[#COPY_STYLE]=1 \{\
3274 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3275 .          el \{ .PAGENUM_STYLE roman \}
3276 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3277 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
3278 .                ie '\\*[$CHAPTER]'' \{\
3279 .                   ie !'\\*[$CHAPTER_TITLE]'' \{\
3280 .                      ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3281 .                   \}
3282 .                   el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \}
3283 .                \}
3284 .                el \{\
3285 .                   ie !'\\*[$CHAPTER_TITLE]'' \{\
3286 .                      ds \\*[$CHAPTER_TITLE]
3287 .                   \}
3288 .                   el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3289 .                \}
3290 .             \}
3291 .             el \{\
3292 .                ie !\\n[#REVISION] \{\
3293 .                   ie '\\*[$CHAPTER]'' \{\
3294 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3295 .                         ds $HDRFTR_CENTER \
3296                           \\*[$CHAPTER_TITLE], \
3297                           \\*[$DRAFT_STRING] \\n[#DRAFT]
3298 .                      \}
3299 .                      el \{\
3300 .                         ds $HDRFTR_CENTER \
3301                           \\*[$CHAPTER_STRING], \
3302                           \\*[$DRAFT_STRING] \\n[#DRAFT]
3303 .                      \}
3304 .                   \}
3305 .                   el \{\
3306 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3307 .                         ds $HDRFTR_CENTER \
3308                           \\*[$CHAPTER_TITLE], \
3309                           \\*[$DRAFT_STRING] \\n[#DRAFT]
3310 .                      \}
3311 .                      el \{\
3312 .                         ds $HDRFTR_CENTER \
3313                           \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3314                           \\*[$DRAFT_STRING] \\n[#DRAFT]
3315 .                      \}
3316 .                   \}
3317 .                \}
3318 .                el \{\
3319 .                   ie '\\*[$CHAPTER]'' \{\
3320 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3321 .                         ds $HDRFTR_CENTER \
3322                           \\*[$CHAPTER_TITLE], \
3323                           \\*[$DRAFT_STRING] \\n[#DRAFT], \
3324                           \\*[$REVISION_STRING] \\n[#REVISION] 
3325 .                      \}
3326 .                      el \{\
3327 .                         ds $HDRFTR_CENTER \
3328                           \\*[$CHAPTER_STRING], \
3329                           \\*[$DRAFT_STRING] \\n[#DRAFT], \
3330                           \\*[$REVISION_STRING] \\n[#REVISION] 
3331 .                      \}
3332 .                   \}
3333 .                   el \{\
3334 .                      ie !'\\*[$CHAPTER_TITLE]'' \{\
3335 .                         ds $HDRFTR_CENTER \
3336                           \\*[$CHAPTER_TITLE], \
3337                           \\*[$DRAFT_STRING] \\n[#DRAFT], \
3338                           \\*[$REVISION_STRING] \\n[#REVISION] 
3339 .                      \}
3340 .                      el \{\
3341 .                         ds $HDRFTR_CENTER \
3342                           \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3343                           \\*[$DRAFT_STRING] \\n[#DRAFT], \
3344                           \\*[$REVISION_STRING] \\n[#REVISION] 
3345 .                      \}
3346 .                   \}
3347 .                \}
3348 .             \}
3349 .          \}
3350 .       \}
3351 \# Copystyle FINAL
3352 .       el \{\
3353 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3354 .             ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3355 .             el \{ .PAGENUM_STYLE DIGIT \}
3356 .             ie '\\*[$CHAPTER]'' \{\
3357 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
3358 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3359 .                \}
3360 .                el \{\
3361 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_STRING]
3362 .                \}
3363 .             \}
3364 .             el \{\
3365 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
3366 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_TITLE]
3367 .                \}
3368 .                el \{\
3369 .                   ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER]
3370 .                \}
3371 .             \}
3372 .          \}
3373 .       \}
3374 .    \}
3375 \# Named
3376 .    if \\n[#DOC_TYPE]=3 \{\
3377 .       ie \\n[#COPY_STYLE]=1 \{\
3378 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3379 .          el \{ .PAGENUM_STYLE roman \}
3380 .          ie \\n[#DRAFT_WITH_PAGENUM] \{\
3381 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3382 .          \}
3383 .          el \{\
3384 .             if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3385 .                ie !\\n[#REVISION] \{\
3386 .                   ds $HDRFTR_CENTER \
3387                     \\*[$DOC_TYPE], \
3388                     \\*[$DRAFT_STRING] \\n[#DRAFT]
3389 .                \}
3390 .                el \{\
3391 .                   ds $HDRFTR_CENTER \
3392                     \\*[$DOC_TYPE], \
3393                     \\*[$DRAFT_STRING] \\n[#DRAFT], \
3394                     \\*[$REVISION_STRING] \\n[#REVISION]
3395 .                \}
3396 .             \}
3397 .          \}
3398 .       \}
3399 .       el \{\
3400 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3401 .             ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3402 .             el \{ .PAGENUM_STYLE DIGIT \}
3403 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3404 .          \}
3405 .       \}
3406 .    \}
3407 .END
3409 \# ====================================================================
3411 \# +++COLLECT DOC INFO -- STRINGS AND NUMBER REGISTERS+++
3413 \# *Arguments:
3414 \#   various string/register arguments
3415 \# *Function:
3416 \#   Collect information about documents.
3419 .MAC DOC_TITLE END
3420 .    ds $DOC_TITLE \\$1
3421 .END
3423 .MAC TITLE END \"Document title
3424 .    ds $TITLE \\$1
3425 .END
3428 .MAC SUBTITLE END \"Document sub-title
3429 .    ds $SUBTITLE \\$1
3430 .END
3433 .MAC CHAPTER END \"If document is a chapter, the chapter number
3434 .    ds $CHAPTER \\$1
3435 .END
3438 .MAC CHAPTER_TITLE END \" This defines what comes after Chapter #
3439 .    ds $CHAPTER_TITLE \\$1
3440 .END
3443 .MAC DRAFT END \"Draft number
3444 .    nr #DRAFT \\$1
3445 .END
3448 .MAC REVISION END \"Revision number
3449 .    nr #REVISION \\$1
3450 .END
3453 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
3454 .    nr #DRAFT_WITH_PAGENUM 1
3455 .END
3458 .MAC AUTHOR END \"Author.  Enclose all args fully in double quotes.
3459 .    nr #AUTHOR_NUM -1 1
3460 .    while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
3461 .       ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
3462 .    \}
3463 .    nr #NUM_AUTHORS \\n[#NUM_ARGS]%2 \"Use mod 2 to test if odd or even # of authors
3464 .    ie \\n[#NUM_AUTHORS]=1 \{ .nr #AUTHOR_LINES 0  \}
3465 .    el \{ .nr #AUTHOR_LINES 1 \}
3466 .END
3469 .MAC PAGENUMBER END \"Page # that appears on page one.
3470 .    nr #n%_AT_PAGENUM_SET \\n%
3471 .    nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
3472 .    rr #n%_AT_PAGENUM_SET
3473 .    nr #PAGE_NUM_SET 1
3474 .END
3476 \# ====================================================================
3478 \# +++TYPE OF DOCUMENT+++
3480 \# DOCUMENT TYPE
3481 \# -------------
3482 \# *Argument:
3483 \#   DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
3484 \# *Function:
3485 \#   Creates strings and sets registers for document types.
3486 \# *Notes:
3487 \#   Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
3489 .MAC DOCTYPE END
3490 .    if '\\$1'DEFAULT' \{\
3491 .       nr #DOC_TYPE 1
3492 .    \}
3493 .    if '\\$1'CHAPTER' \{\
3494 .       nr #DOC_TYPE 2
3495 .    \}
3496 .    if '\\$1'NAMED' \{\
3497 .       ds $DOC_TYPE \\$2
3498 .       nr #DOC_TYPE 3
3499 .    \}
3500 .    if '\\$1'LETTER' \{\
3501 .       nr #DOC_TYPE 4
3502 .       L_MARGIN 1.125i
3503 .       R_MARGIN 1.125i
3504 .       PT_SIZE 12
3505 .       LS 13.5
3506 .       DOCHEADER OFF
3507 .       PARA_INDENT 3m
3508 .       INDENT_FIRST_PARAS
3509 .       PARA_SPACE
3510 .       ds $SUITE \En[#SUITE]
3511 .       HEADER_MARGIN 3P+6p
3512 .       HEADER_GAP 3P
3513 .       FOOTERS
3514 .       FOOTER_RULE OFF
3515 .       FOOTER_LEFT ""
3516 .       FOOTER_CENTER ""
3517 .       FOOTER_RIGHT_SIZE +0
3518 .       FOOTER_RIGHT ".../\E*[$SUITE]
3519 .       FOOTER_ON_FIRST_PAGE
3520 .       em ALL_DONE
3521 .    \}
3522 .END
3524 \# +++LETTER MACROS+++
3526 \# DATE
3527 \# ----
3528 \# *Arguments:
3529 \#   <date string>
3530 \# *Function:
3531 \#   Stores date string in string $DATE.
3533 .MAC DATE END
3534 .    nr #DATE 1
3535 .    di DATE
3536 .    RIGHT
3537 .END
3540 \# TO
3541 \# --
3542 \# *Arguments:
3543 \#   <none>
3544 \# *Function:
3545 \#  Stores "to" info in diversion TO_ADDRESS.
3547 .MAC TO END
3548 .    if !'\\n(.z'' \{ .di \}
3549 .    nr #TO 1
3550 .    di TO_ADDRESS
3551 .    LEFT
3552 .END
3555 \# FROM
3556 \# ----
3557 \# *Arguments:
3558 \#   <none>
3559 \# *Function:
3560 \#  Stores "from" info in diversion FROM_ADDRESS.
3562 .MAC FROM END
3563 .    if !'\\n(.z'' \{ .di \}
3564 .    nr #FROM 1
3565 .    di FROM_ADDRESS
3566 .    LEFT
3567 .END
3570 \# GREETING
3571 \# --------
3572 \# *Arguments:
3573 \#   <greeting string>
3574 \# *Function:
3575 \#   Stores greeting in string $GREETING.
3577 .MAC GREETING END
3578 .    if !'\\n(.z'' \{ .di \}
3579 .    nr #GREETING 1
3580 .    di GREETING
3581 .    LEFT
3582 .END
3585 \# CLOSING
3586 \# -------
3587 \# *Arguments:
3588 \#   <closing string>
3589 \# *Function:
3590 \#   Stores greeting in string $CLOSING.
3592 .MAC CLOSING END
3593 .    br
3594 .    nr #CLOSING 1
3595 .    di CLOSING
3596 .    LEFT
3597 .END
3600 \# NO SUITE
3601 \# --------
3602 \# *Arguments:
3603 \#   <none>
3604 \# *Function:
3605 \#   Redefines $SUITE to blank so that a suite number doesn't
3606 \#   appear at the bottom of letter pages.
3608 .MAC NO_SUITE END
3609 .    FOOTER_RIGHT ""
3610 .END
3612 \# ====================================================================
3614 \# +++DEFAULTS+++
3616 \# DEFAULTS
3617 \# --------
3618 \# *Arguments:
3619 \#   <none>
3620 \# *Function:
3621 \#   Sets up defaults if no values are entered prior to START.
3622 \# *Notes:
3623 \#   The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
3624 \#   $REVISION_STRING are in the COPYSTYLE macro.
3626 .MAC DEFAULTS END
3627 .    if !d$PAPER \{ .PAPER LETTER \}
3628 .    if !\\n[#DOC_TYPE]   \{ .DOCTYPE DEFAULT \}
3629 .    if \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3630 .    if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
3631 .    if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
3632 .    if \\n[#DOC_TYPE]=4 \{\
3633 .       if !\\n[#USER_SET_L_LENGTH] \{\
3634 .          R_MARGIN \\n[#R_MARGIN]u
3635 .          rr #USER_SET_L_LENGTH
3636 .       \}
3637 .       if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
3638 .    \}
3639 .    if \\n[#COPY_STYLE]=1 \{\
3640 .       COPYSTYLE DRAFT
3641 .       PAGENUMBER 1
3642 .    \}
3643 .    if !r#DOC_HEADER \{ .DOCHEADER  \}
3644 .    if !r#HEADERS_ON \{ .HEADERS    \}
3645 .    if !r#PAGINATE   \{ .PAGINATE   \}
3646 .    if \\n[#FOOTERS_ON] \{\
3647 .       HEADERS OFF
3648 .       if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
3649 .    \}
3650 .    if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
3651 .    if !r#HEADER_GAP    \{ .HEADER_GAP    3P    \}
3652 .    if \\n[#FOOTERS_ON] \{\
3653 .       if \\n[#PAGINATE]=0 \{\
3654 .          if !r#T_MARGIN \{ .T_MARGIN 6P \}
3655 .       \}
3656 .    \}
3657 .    if \\n[#HEADERS_ON]=0    \{\
3658 .       if \\n[#FOOTERS_ON]=0 \{\
3659 .          if !r#T_MARGIN \{ .T_MARGIN 6P \}
3660 .       \}
3661 .    \}
3662 .    if !r#T_MARGIN          \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
3663 .    if !r#DOCHEADER_ADVANCE \{ .DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
3664 .    if !r#FOOTER_MARGIN     \{ .FOOTER_MARGIN 3P \}
3665 .    if !r#FOOTER_GAP        \{ .FOOTER_GAP    3P \}
3666 .    if !r#B_MARGIN          \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
3667 .    if !r#HDRFTR_RULE_GAP   \{\
3668 .       if \\n[#HEADERS_ON]  \{ .HDRFTR_RULE_GAP 4p \}
3669 .       if \\n[#FOOTERS_ON]  \{ .HDRFTR_RULE_GAP 4p \}
3670 .    \}
3671 .    if !r#HDRFTR_RULE       \{ .HDRFTR_RULE        \}
3672 .    if !r#PAGE_NUM_SET      \{ .PAGENUMBER 1       \}
3673 .    ie r#ADJ_DOC_LEAD \{ . \}
3674 .    el \{ .DOC_LEAD_ADJUST \}
3675 \# Read in number registers and strings for type parameters
3676 .    nr #DOC_L_MARGIN \\n[#L_MARGIN]
3677 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
3678 .    nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
3679 .    ds $DOC_FAM      \\*[$FAMILY]
3680 .    nr #DOC_PT_SIZE  \\n[#PT_SIZE]
3681 .    nr #DOC_LEAD     \\n[#LEAD]
3682 .    ds $DOC_QUAD     \\*[$QUAD_VALUE]
3683 .    ds $PP_FT        \\*[$FONT]
3684 \# Counters
3685 .    nr #PP 0
3686 .    nr #FN_NUMBER 0 1
3687 .    nr #EN_NUMBER 0 1
3688 .    nr #FN_COUNT_FOR_COLS 0 1
3689 .    RESET_HEAD_NUMBER
3690 .    RESET_SUBHEAD_NUMBER
3691 .    RESET_PARAHEAD_NUMBER
3692 \# General style defaults for both PRINTSTYLEs
3693 .    nr #PP_STYLE 1
3694 .    PARA_INDENT \\n[#PP_INDENT]u
3695 .    if !d$HDRFTR_FAM           \{ .HDRFTR_FAMILY  \\*[$DOC_FAM] \}
3696 .    if !d$HDRFTR_SIZE_CHANGE   \{ .HDRFTR_SIZE    +0            \}
3697 .    if !d$PAGE_NUM_FAM         \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
3698 .    if !d$PAGE_NUM_FT          \{ .PAGENUM_FONT   R             \}
3699 .    if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE   +0            \}
3700 .    if !r#PAGE_NUM_POS_SET     \{ .PAGENUM_POS BOTTOM CENTER    \}
3701 .    ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
3702 .       if \\n[#PAGE_NUM_HYPHENS]=0  \{ .PAGENUM_HYPHENS OFF \}
3703 .       if \\n[#PAGE_NUM_HYPHENS]=1  \{ .PAGENUM_HYPHENS     \}
3704 .    \}
3705 .    el \{ .PAGENUM_HYPHENS \}
3706 .    if !d$HEAD_QUAD         \{ .HEAD_QUAD CENTER  \}
3707 .    if !r#HEAD_CAPS         \{ .HEAD_CAPS         \}
3708 .    if !r#HEAD_UNDERLINE    \{ .HEAD_UNDERLINE    \}
3709 .    if !d$SH_QUAD           \{ .SUBHEAD_QUAD LEFT \}
3710 .    if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
3711 .    if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
3712 .       if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
3713 .    \}
3714 .    if !d$FN_FAM          \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
3715 .    if !d$FN_FT           \{ .FOOTNOTE_FONT R               \}
3716 .    if !d$FN_QUAD         \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD]  \}
3717 .    if !r#FN_RULE         \{ .FOOTNOTE_RULE                 \}
3718 .    if !r#FN_MARKERS      \{ .FOOTNOTE_MARKERS              \}
3719 .    if !r#FN_MARKER_STYLE \{ .FOOTNOTE_MARKER_STYLE STAR    \}
3720 .    if !d$EN_PN_STYLE          \{ .ENDNOTES_PAGENUM_STYLE digit        \}
3721 .    if !d$EN_FAM               \{ .ENDNOTE_FAMILY \\*[$DOC_FAM]        \}
3722 .    if !d$EN_FN                \{ .ENDNOTE_FONT R                      \}
3723 .    if !d$EN_QUAD              \{ .ENDNOTE_QUAD \\*[$DOC_QUAD]         \}
3724 .    if !d$EN_STRING            \{ .ENDNOTE_STRING "Endnotes"           \}
3725 .    if !d$EN_STRING_FAM        \{ .ENDNOTE_STRING_FAMILY \\*[$EN_FAM]  \}
3726 .    if !d$EN_STRING_QUAD       \{ .ENDNOTE_STRING_QUAD CENTER          \}
3727 .    if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2         \}
3728 .    if !r#EN_STRING_CAPS       \{ .ENDNOTE_STRING_CAPS                 \}
3729 .    if !d$EN_TITLE \{\
3730 .       ie \\n[#DOC_TYPE]=2 \{\
3731 .          ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
3732 .          el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"    \}
3733 .       \}
3734 .       el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
3735 .    \}
3736 .    if !d$EN_TITLE_FAM          \{ .ENDNOTE_TITLE_FAMILY \\*[$EN_FAM]  \}
3737 .    if !d$EN_TITLE_QUAD         \{ .ENDNOTE_TITLE_QUAD LEFT            \}
3738 .    if !r#EN_TITLE_UNDERSCORE   \{ .ENDNOTE_TITLE_UNDERSCORE           \}
3739 .    if !d$EN_NUMBER_FAM         \{ .ENDNOTE_NUMBER_FAMILY \\*[$EN_FAM] \}
3740 .    if !r#EN_NUMBERS_ALIGN_LEFT  \{\
3741 .       if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2  \}
3742 .    \}
3743 .    if !d$TOC_HEADER_STRING         \{ .TOC_HEADER_STRING "Contents"  \}
3744 .    if !d$TOC_HEADER_QUAD           \{ .TOC_HEADER_QUAD LEFT          \}
3745 .    if !d$TOC_PN_STYLE              \{ .TOC_PAGENUM_STYLE roman       \}
3746 .    if !r#TOC_PN_PADDING            \{ .TOC_PADDING   3               \}
3747 .    if !r#TOC_TITLE_INDENT          \{ .TOC_TITLE_INDENT    0         \}
3748 .    if !r#TOC_HEAD_INDENT           \{ .TOC_HEAD_INDENT     18p       \}
3749 .    if !r#TOC_SH_INDENT             \{ .TOC_SUBHEAD_INDENT  30p       \}
3750 .    if !r#TOC_PH_INDENT             \{ .TOC_PARAHEAD_INDENT 42p       \}
3751 \# String defaults for both PRINTSTYLEs
3752 .    if !d$DOC_TITLE                  \{ .ds $DOC_TITLE \E*[$TITLE]        \}
3753 .    if !d$ATTRIBUTE_STRING           \{ .ATTRIBUTE_STRING "by"            \}
3754 .    if \\n[#USER_DEF_HDRFTR_LEFT]=0  \{ .ds $HDRFTR_LEFT  \\*[$AUTHOR_1]  \}
3755 .    rr #USER_DEF_HDRFTR_LEFT
3756 .    if \\n[#USER_DEF_HDRFTR_RIGHT]=0 \{ .ds $HDRFTR_RIGHT \\*[$DOC_TITLE] \}
3757 .    rr #USER_DEF_HDRFTR_RIGHT
3758 .    if !d$FINIS_STRING               \{ .FINIS_STRING "END"               \}
3759 \# Defaults for printstyle TYPEWRITE
3760 .    if \\n[#PRINT_STYLE]=1 \{\
3761 .       if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES         \}
3762 .       if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF     \}
3763 .       if !r#Q_OFFSET_VALUE        \{ .QUOTE_INDENT      2      \}
3764 .       if !r#EPI_OFFSET_VALUE      \{ .EPIGRAPH_INDENT   2      \}
3765 .       if !d$LINEBREAK_CHAR        \{ .LINEBREAK_CHAR    * 3 2p \}
3766 .       if !d$FN_SIZE_CHANGE        \{ .FOOTNOTE_SIZE     +0     \}
3767 .       if !r#FN_RULE_LENGTH        \{ .FOOTNOTE_RULE_LENGTH 2i  \}
3768 .       if !r#FN_RULE_ADJ           \{ .FOOTNOTE_RULE_ADJ  6p    \}
3769 .       if !r#SLANT_MEANS_SLANT \{\
3770 .          ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
3771 .          el \{ .UNDERLINE_SLANT OFF \}
3772 .       \}
3773 .       if !r#PH_INDENT    \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3774 .       if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
3775 .    \}
3776 \# Defaults for printstyle TYPESET
3777 .    if \\n[#PRINT_STYLE]=2 \{\
3778 .       if !r#DOCHEADER_LEAD_ADJ \{\
3779 .          ie !'\\*[$CHAPTER_TITLE]'' \{\
3780 .             ie !'\\*[$CHAPTER_STRING]'' \{\
3781 .                DOCHEADER_LEAD +4p
3782 .             \}
3783 .             el \{ .DOCHEADER_LEAD +0 \}
3784 .          \}
3785 .          el \{ .DOCHEADER_LEAD +0 \}
3786 .       \}
3787 .       if !d$TITLE_FAM     \{ .TITLE_FAMILY   \\*[$DOC_FAM] \}
3788 .       if !d$TITLE_FT      \{ .TITLE_FONT     B             \}
3789 .       if !d$TITLE_SIZE_CHANGE \{\
3790 .          ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
3791 .          el \{ .TITLE_SIZE +3.5 \}
3792 .       \}
3793 .       if !d$CHAPTER_TITLE_FAM         \{ .CHAPTER_TITLE_FAMILY \\*[$DOC_FAM] \}
3794 .       if !d$CHAPTER_TITLE_FT          \{ .CHAPTER_TITLE_FONT   BI            \}
3795 .       if !d$CHAPTER_TITLE_SIZE_CHANGE \{ .CHAPTER_TITLE_SIZE  +4             \}
3796 .       if !d$SUBTITLE_FAM         \{ .SUBTITLE_FAMILY    \\*[$DOC_FAM] \}
3797 .       if !d$SUBTITLE_FT          \{ .SUBTITLE_FONT      R             \}
3798 .       if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE      +0            \}
3799 .       if !d$AUTHOR_FAM           \{ .AUTHOR_FAMILY      \\*[$DOC_FAM] \}
3800 .       if !d$AUTHOR_FT            \{ .AUTHOR_FONT        I             \}
3801 .       if !d$AUTHOR_SIZE_CHANGE   \{ .AUTHOR_SIZE        +0            \}
3802 .       if !d$DOCTYPE_FAM          \{ .DOCTYPE_FAMILY     \\*[$DOC_FAM] \}
3803 .       if !d$DOCTYPE_FT           \{ .DOCTYPE_FONT       BI            \}
3804 .       if !d$DOCTYPE_SIZE_CHANGE  \{ .DOCTYPE_SIZE       +3            \}
3805 .       if !d$HDRFTR_LEFT_FAM      \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
3806 .       if !d$HDRFTR_LEFT_FT       \{ .HDRFTR_LEFT_FONT   R             \}
3807 .       if \\n[#HDRFTR_LEFT_CAPS]  \{\
3808 .          if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE  -2 \}
3809 .       \}
3810 .       if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE     -.5           \}
3811 .       if !d$HDRFTR_CENTER_FAM       \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
3812 .       if !d$HDRFTR_CENTER_FT        \{ .HDRFTR_CENTER_FONT   I             \}
3813 .       if \\n[#HDRFTR_CENTER_CAPS] \{\
3814 .          if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
3815 .       \}
3816 .       if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5              \}
3817 .       if !d$HDRFTR_RIGHT_FAM          \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]   \}
3818 .       if !d$HDRFTR_RIGHT_FT           \{ .HDRFTR_RIGHT_FONT   R               \}
3819 .       if \\n[#HDRFTR_RIGHT_CAPS] \{\
3820 .          if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
3821 .       \}
3822 .       if !d$HDRFTR_RIGHT_SIZE_CHANGE  \{ .HDRFTR_RIGHT_SIZE  -.5              \}
3823 .       if !d$HEAD_FAM                  \{ .HEAD_FAMILY        \\*[$DOC_FAM]    \}
3824 .       if !d$HEAD_FT                   \{ .HEAD_FONT          B                \}
3825 .       if !d$HEAD_SIZE_CHANGE          \{ .HEAD_SIZE          +1               \}
3826 .       if !r#HEAD_SPACE                \{ .HEAD_SPACE                          \}
3827 .       if !d$SH_FAM                    \{ .SUBHEAD_FAMILY     \\*[$DOC_FAM]    \}
3828 .       if !d$SH_FT                     \{ .SUBHEAD_FONT       B                \}
3829 .       if !d$SH_SIZE_CHANGE            \{ .SUBHEAD_SIZE       +.5              \}
3830 .       if !d$PH_FAM                    \{ .PARAHEAD_FAMILY    \\*[$DOC_FAM]    \}
3831 .       if !d$PH_FT                     \{ .PARAHEAD_FONT      BI               \}
3832 .       if !d$PH_SIZE_CHANGE            \{ .PARAHEAD_SIZE      -.25             \}
3833 .       if !r#PH_INDENT                 \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3834 .       if !d$QUOTE_FAM                 \{ .QUOTE_FAMILY       \\*[$DOC_FAM]    \}
3835 .       if !d$QUOTE_FT                  \{ .QUOTE_FONT         I                \}
3836 .       if !d$QUOTE_SIZE_CHANGE         \{ .QUOTE_SIZE         +0               \}
3837 .       if !r#Q_OFFSET_VALUE            \{ .QUOTE_INDENT       3                \}
3838 .       if !d$BQUOTE_FAM                \{ .BLOCKQUOTE_FAMILY  \\*[$DOC_FAM]    \}
3839 .       if !d$BQUOTE_FT                 \{ .BLOCKQUOTE_FONT    R                \}
3840 .       if !d$BQUOTE_SIZE_CHANGE        \{ .BLOCKQUOTE_SIZE    -1               \}
3841 .       if !d$BQUOTE_QUAD               \{ .BLOCKQUOTE_QUAD    LEFT             \}
3842 .       if !d$EPI_FAM                   \{ .EPIGRAPH_FAMILY    \\*[$DOC_FAM]    \}
3843 .       if !d$EPI_FT                    \{ .EPIGRAPH_FONT      R                \}
3844 .       if !d$EPI_SIZE_CHANGE           \{ .EPIGRAPH_SIZE      -1.5             \}
3845 .       if !r#EPI_AUTOLEAD              \{ .EPIGRAPH_AUTOLEAD  2                \}
3846 .       if !d$EPI_QUAD                  \{ .EPIGRAPH_QUAD      \\*[$DOC_QUAD]   \}
3847 .       if !r#EPI_OFFSET_VALUE          \{ .EPIGRAPH_INDENT    3                \}
3848 .       if !d$LINEBREAK_CHAR            \{ .LINEBREAK_CHAR     * 3 3p           \}
3849 .       if !r#FN_RULE_LENGTH            \{ .FOOTNOTE_RULE_LENGTH 4P             \}
3850 .       if !r#FN_RULE_ADJ               \{ .FOOTNOTE_RULE_ADJ  3p               \}
3851 .       if !d$FN_SIZE_CHANGE            \{ .FOOTNOTE_SIZE      -2               \}
3852 .       if !r#FN_AUTOLEAD               \{ .FOOTNOTE_AUTOLEAD  2                \}
3853 .       if !r#EN_PS                     \{ .ENDNOTE_PT_SIZE \\n[#DOC_PT_SIZE]u  \}
3854 .       if !d$EN_LEAD                   \{ .ENDNOTE_LEAD        14 ADJUST       \}
3855 .       if !d$EN_STRING_FT              \{ .ENDNOTE_STRING_FONT B               \}
3856 .       if !d$EN_STRING_SIZE_CHANGE     \{ .ENDNOTE_STRING_SIZE +1              \}
3857 .       if !d$EN_TITLE_FT               \{ .ENDNOTE_TITLE_FONT  B               \}
3858 .       if !d$EN_TITLE_SIZE_CHANGE      \{ .ENDNOTE_TITLE_SIZE  +0              \}
3859 .       if !d$EN_NUMBER_FT              \{ .ENDNOTE_NUMBER_FONT B               \}
3860 .       if !$EN_NUMBER_SIZE_CHANGE      \{ .ENDNOTE_NUMBER_SIZE +0              \}
3861 .       if !r#EN_PP_INDENT              \{ .ENDNOTE_PARA_INDENT 1.5m            \}
3862 .       if !d$TOC_FAM                   \{ .TOC_FAMILY  \\*[$DOC_FAM]           \}
3863 .       if !r#TOC_PS                    \{ .TOC_PT_SIZE \\n[#DOC_PT_SIZE]u      \}
3864 .       if !r#TOC_LEAD                  \{ .TOC_LEAD    \\n[#DOC_LEAD]u ADJUST  \}
3865 .       if !d$TOC_HEADER_FAM            \{ .TOC_HEADER_FAMILY \\*[$TOC_FAM]     \}
3866 .       if !d$TOC_HEADER_SIZE_CHANGE    \{ .TOC_HEADER_SIZE  +4                 \}
3867 .       if !d$TOC_HEADER_FT             \{ .TOC_HEADER_FONT   B                 \}
3868 .       if !d$TOC_TITLE_FAM             \{ .TOC_TITLE_FAMILY \\*[$TOC_FAM]      \}
3869 .       if !d$TOC_PN_FAM                \{ .TOC_PN_FAMILY \\*[$TOC_FAM]         \}
3870 .       if !d$TOC_HEAD_FAM              \{ .TOC_HEAD_FAMILY \\*[$TOC_FAM]       \}
3871 .       if !d$TOC_SH_FAM                \{ .TOC_SUBHEAD_FAMILY \\*[$TOC_FAM]    \}
3872 .       if !d$TOC_PH_FAM                \{ .TOC_PARAHEAD_FAMILY \\*[$TOC_FAM]   \}
3873 .       if !d$TOC_TITLE_FT              \{ .TOC_TITLE_FONT   BI                 \}
3874 .       if !d$TOC_PN_FT                 \{ .TOC_PN_FONT   R                     \}
3875 .       if !d$TOC_HEAD_FT               \{ .TOC_HEAD_FONT   B                   \}
3876 .       if !d$TOC_SH_FT                 \{ .TOC_SUBHEAD_FONT   R                \}
3877 .       if !d$TOC_PH_FT                 \{ .TOC_PARAHEAD_FONT   I               \}
3878 .       if !d$TOC_TITLE_SIZE_CHANGE     \{ .TOC_TITLE_SIZE   +.5                \}
3879 .       if !d$TOC_PN_SIZE_CHANGE        \{ .TOC_PN_SIZE  +0                     \}
3880 .       if !d$TOC_HEAD_SIZE_CHANGE      \{ .TOC_HEAD_SIZE  +.5                   \}
3881 .       if !d$TOC_SH_SIZE_CHANGE        \{ .TOC_SUBHEAD_SIZE  +0                \}
3882 .       if !d$TOC_PH_SIZE_CHANGE        \{ .TOC_PARAHEAD_SIZE  +0               \}
3883 .    \}
3884 .    if \\n[#PRINT_STYLE]=2 \{\
3885 .       ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
3886 .       el \{ . \}
3887 .    \}
3888 .    if !\\n[#COLLATE] \{\
3889 .       TRAPS
3890 \# Endnote and toc leading
3891 .       nr #OK_PROCESS_LEAD 1
3892 .       nr #RESTORE_DOC_LEAD \\n(.v
3893 .       if \\n[#PRINT_STYLE]=1 \{\
3894 .          ie \\n[#SINGLE_SPACE] \{\
3895 .             ENDNOTE_LEAD 12 ADJUST
3896 .          \}
3897 .          el \{\
3898 .             ie \\n[#EN_SINGLESPACE] \{ .ENDNOTE_LEAD 12 ADJUST \}
3899 .             el \{ .ENDNOTE_LEAD 24 ADJUST \}
3900 .          \}
3901 .       \}
3902 .       if \\n[#PRINT_STYLE]=2 \{\
3903 .          ie !d$EN_LEAD \{ .ENDNOTE_LEAD 14 ADJUST \}
3904 .          el \{ .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD] \}
3905 .          ie !d$TOC_LEAD \{ .TOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
3906 .          el \{ .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD] \}
3907 .          rm $ADJUST_EN_LEAD
3908 .          rm $ADJUST_TOC_LEAD
3909 .       \}
3910 .       DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
3911 .    \}
3912 .    if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
3913 .END
3915 \# ====================================================================
3917 \# +++START THE DOCUMENT+++
3919 \# THE START MACRO
3920 \# ---------------
3921 \# *Arguments:
3922 \#   <none>
3923 \# *Function:
3924 \#   Reads in default document style parameters and any parameter
3925 \#   the user has changed before issuing START.
3926 \#   Using the information gathered in the opening macros,
3927 \#   prints appropriate title (or chapter #), subtitle, author
3928 \#   and document type (if appropriate).
3929 \# *Notes:
3930 \#   The .PRINT \& (zero-width character) is required to get the
3931 \#   subsequent .sp request to work as advertised.
3933 \#   The overall document line length, family, and point-size
3934 \#   are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
3935 \#   use in the HEADER and FOOTER macros.
3937 \#  First, define some strings for point sizes
3939 .ds $TITLE_PT_SIZE         \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
3940 .ds $CHAPTER_TITLE_PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$CHAPTER_TITLE_SIZE_CHANGE]
3941 .ds $SUBTITLE_PT_SIZE      \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
3942 .ds $AUTHOR_PT_SIZE        \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
3943 .ds $DOCTYPE_PT_SIZE       \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
3945 \# Next, some utility macros for various routines to prevent repetition
3947 .MAC PRINT_AUTHORS END
3948 .    nr #AUTHORS \\n[#AUTHOR_NUM]
3949 .    nr #NEXT_AUTHOR 0 1
3950 .    while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
3951 .       PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
3952 .    \}
3953 .END
3955 .MAC DEFAULT_DOCHEADER END
3956 .    CENTER
3957 .    FAMILY  \\*[$TITLE_FAM]
3958 .    FT      \\*[$TITLE_FT]
3959 .    PT_SIZE \\*[$TITLE_PT_SIZE]
3960 .    LS      \\n[#DOCHEADER_LEAD]u
3961 .    PRINT   \\*[$TITLE]
3962 .    if !'\\*[$SUBTITLE]'' \{\
3963 .       FAMILY  \\*[$SUBTITLE_FAM]
3964 .       FT      \\*[$SUBTITLE_FT]
3965 .       PT_SIZE \\*[$SUBTITLE_PT_SIZE]
3966 .       PRINT   \\*[$SUBTITLE]
3967 .    \}
3968 .    if !'\\*[$AUTHOR_1]'' \{\
3969 .       FAMILY  \\*[$AUTHOR_FAM]
3970 .       FT      \\*[$AUTHOR_FT]
3971 .       PT_SIZE \\*[$AUTHOR_PT_SIZE]
3972 .       if !'\\*[$ATTRIBUTE_STRING]'' \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
3973 .       PRINT_AUTHORS
3974 .    \}
3975 .END
3978 .MAC CHAPTER_DOCHEADER END
3979 .    CENTER
3980 .    FAMILY  \\*[$TITLE_FAM]
3981 .    FT      \\*[$TITLE_FT]
3982 .    PT_SIZE \\*[$TITLE_PT_SIZE]
3983 .    LS      \\n[#DOCHEADER_LEAD]u
3984 .    ie '\\*[$CHAPTER]'' \{\
3985 .       ie !'\\*[$CHAPTER_TITLE]'' \{\
3986 .          if \\n[#PRINT_STYLE]=2 \{\
3987 .             FAMILY  \\*[$CHAPTER_TITLE_FAM]
3988 .             FT      \\*[$CHAPTER_TITLE_FT]
3989 .             PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
3990 .             LS      \\n[#DOCHEADER_LEAD]u
3991 .          \}
3992 .          PRINT \\*[$CHAPTER_TITLE]
3993 .       \}
3994 .       el \{\
3995 .          PRINT \\*[$CHAPTER_STRING]
3996 .       \}
3997 .    \}
3998 .    el \{\
3999 .       PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4000 .       if !'\\*[$CHAPTER_TITLE]'' \{\
4001 .       if \\n[#PRINT_STYLE]=1 \{ .PRINT   \\*[$CHAPTER_TITLE] \}
4002 .          if \\n[#PRINT_STYLE]=2 \{\
4003 .             FAMILY  \\*[$CHAPTER_TITLE_FAM]
4004 .             FT      \\*[$CHAPTER_TITLE_FT]
4005 .             PT_SIZE \\*[$CHAPTER_TITLE_PT_SIZE]
4006 .             LS      \\n[#DOCHEADER_LEAD]u
4007 .             PRINT   \\*[$CHAPTER_TITLE]
4008 .             RLD \\n[#DOC_LEAD]u \" Just looks better this way
4009 .          \}
4010 .       \}
4011 .    \}
4012 .END
4015 .MAC NAMED_DOCHEADER END
4016 .    CENTER
4017 .    FAMILY  \\*[$TITLE_FAM]
4018 .    FT      \\*[$TITLE_FT]
4019 .    PT_SIZE \\*[$TITLE_PT_SIZE]
4020 .    LS      \\n[#DOCHEADER_LEAD]u
4021 .    PRINT   \\*[$TITLE]
4022 .    if !'\\*[$SUBTITLE]'' \{\
4023 .       FAMILY  \\*[$SUBTITLE_FAM]
4024 .       FT      \\*[$SUBTITLE_FT]
4025 .       PT_SIZE \\*[$SUBTITLE_PT_SIZE]
4026 .       PRINT   \\*[$SUBTITLE]
4027 .    \}
4028 .    if !'\\*[$AUTHOR_1]'' \{\
4029 .       FAMILY  \\*[$AUTHOR_FAM]
4030 .       FT      \\*[$AUTHOR_FT]
4031 .       PT_SIZE \\*[$AUTHOR_PT_SIZE]
4032 .       if !'\\*[$ATTRIBUTE_STRING]'' \{ .PRINT \\*[$ATTRIBUTE_STRING] \}
4033 .       PRINT_AUTHORS
4034 .    \}
4035 .    FAMILY  \\*[$DOCTYPE_FAM]
4036 .    FT      \\*[$DOCTYPE_FT]
4037 .    PT_SIZE \\*[$DOCTYPE_PT_SIZE]
4038 .    LS      \\n[#DOCHEADER_LEAD]u
4039 .    ALD     \\n[#DOCHEADER_LEAD]u
4040 .    UNDERSCORE "\\*[$DOC_TYPE]
4041 .END
4044 .MAC START END
4045 .    if !\\n[#PRINT_STYLE] \{\
4046 .       PRINTSTYLE TYPEWRITE
4047 .       PRINT \&
4048 .       po 6P
4049 .       ll 39P
4050 .       ta \\n(.lu
4051 .       sp |1i-1v
4052 .       CENTER
4053 .       PRINT "You neglected to enter a PRINTSTYLE"
4054 .       fl
4055 .       ab PRINTSTYLE missing
4056 .    \}
4057 .    nr #DOCS 1
4058 .    DEFAULTS
4059 .    if \\n[#COLLATE] \{\
4060 .       COPYSTYLE \\*[$COPY_STYLE]
4061 .       nr #HEADERS_ON \\n[#HEADER_STATE]
4062 .       if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
4063 .       sp |\\n[#HEADER_MARGIN]u
4064 .       PRINT \&
4065 .       if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
4066 .          PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
4067 .          rm $RESTORE_PAGENUM_STYLE
4068 .       \}
4069 .    \}
4071 .    ie \\n[#COLLATED_DOC]=1 \{\
4072 \# Collect TITLE for TOC.
4073 .       nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
4074 .       af #TOC_ENTRY_PN \\g[#PAGENUMBER]
4075 .       ie \\n[#USER_SET_TITLE_ITEM] \{\
4076 .          ds $TOC_TITLE_ITEM \\*[$USER_SET_TITLE_ITEM]\\|
4077 .          rr #USER_SET_TITLE_ITEM
4078 .          rm $USER_SET_TITLE_ITEM
4079 .       \}
4080 .       el \{\
4081 .          ie \\n[#DOC_TYPE]=2 \{\
4082 .             ie '\\*[$CHAPTER_TITLE]'' \{\
4083 .                ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
4084 .             \}
4085 .             el \{\
4086 .                ie '\\*[$CHAPTER]'' \{\
4087 .                   ds $TOC_TITLE_ITEM \\*[$CHAPTER_TITLE]\\|
4088 .                \}
4089 .                el \{\
4090 .                   ds $TOC_TITLE_ITEM \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
4091 .                \}
4092 .             \}
4093 .          \}
4094 .          el \{\
4095 .             ds $TOC_TITLE_ITEM \\*[$TITLE]\\|
4096 .          \}
4097 .       \}
4098 .       if \\n[#TOC_AUTHORS]=1 \{\
4099 .          ie '\\*[$TOC_AUTHORS]'' \{\
4100 .             as $TOC_TITLE_ITEM /\\|\\*[$AUTHOR_1]\\|
4101 .          \}
4102 .          el \{\
4103 .             as $TOC_TITLE_ITEM /\\|\\*[$TOC_AUTHORS]\\|
4104 .             rm $TOC_AUTHORS
4105 .          \}
4106 .       \}
4107 \# Note the use of \!, which transparently embeds the macros used
4108 \# in the TOC_ENTRIES diversion.  The elements they control must be
4109 \# processed literally when the diversion is output.
4110 .       ev TOC_EV
4111 .       da TOC_ENTRIES
4112 .       if \\n[#PRINT_STYLE]=1 \{\
4113 \!.        fam C
4114 \!.        ft  R
4115 \!.        ps  12
4116 .       \}
4117 .       if \\n[#PRINT_STYLE]=2 \{\
4118 \!.        FAMILY  \\*[$TOC_TITLE_FAM]
4119 \!.        FT      \\*[$TOC_TITLE_FT]
4120 \!.        PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
4121 .       \}
4122 \!.     TRAP OFF
4123 .       ie \\n[#PRINT_STYLE]=1 \{\
4124 \!.        PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
4125 .       \}
4126 .       el \{\
4127 \!.        PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
4128 .       \}
4129 \!.    EL
4130 \!.    ST 100 L
4131 \!.    ST 101 R
4132 .      if \\n[#PRINT_STYLE]=2 \{\
4133 \!.       FAMILY  \\*[$TOC_PN_FAM]
4134 \!.       FT      \\*[$TOC_PN_FT]
4135 \!.       PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
4136 .      \}
4137 \!.    TAB 100
4138 \!.    PRINT \\*[LEADER]
4139 \!.    TN
4140 \!.    TRAP
4141 \!.    PRINT \\n[#TOC_ENTRY_PN]
4142 \!.    TQ
4143 .      di       
4144 .      ev
4145 .    \}
4146 .    el \{\
4147 .       nr #FIRST_DOC_TITLE_PN \\n%+\\n[#PAGE_NUM_ADJ]
4148 .       af #FIRST_DOC_TITLE_PN \\g[#PAGENUMBER]
4149 .       nr #FIRST_DOC_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
4150 .    \}
4151 \# End TITLE collection
4152 .    if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
4153 .       sp |\\n[#HEADER_MARGIN]u
4154 .       PRINT_PAGE_NUMBER
4155 .    \}
4156 .    rr #COLLATE
4157 .    rr #PAGINATION_STATE
4159 .    ie \\n[#DOC_HEADER]=0 \{\
4160 .       PRINT \&
4161 .       if \\n[#DOC_TYPE]=4 \{\
4162 .          if !'\\n(.z'' \{ .di \}
4163 .       \}
4164 .       PP
4165 .       ie r#ADVANCE_FROM_TOP \{ .sp |\\n[#ADVANCE_FROM_TOP]u-1v \}
4166 .       el \{ .sp |\\n[#T_MARGIN]u-1v \}
4167 .       if \\n[#COLUMNS] \{\
4168 .          mk dc
4169 .          nr #COL_NUM 0 1
4170 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4171 .          ll \\n[#COL_L_LENGTH]u
4172 .       \}
4173 .       nr #PP 0
4174 .       rr #DOC_HEADER
4175 .       if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \}
4176 .    \}
4177 .    el \{\
4178 .       if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u+\\n[#DOCHEADER_LEAD_ADJ]u \}
4179 .       nr #DOCHEADER_LEAD \\n[#LEAD]
4180 \# Default
4181 .       if \\n[#DOC_TYPE]=1 \{\
4182 .          PRINT \&
4183 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
4184 .          ev TITLE
4185 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4186 .          LL       \\n[#DOC_L_LENGTH]u
4187 .          ta \\n(.lu
4188 .          if \\n[#PRINT_STYLE]=1 \{\
4189 .             CENTER
4190 .             fam C
4191 .             ft  R
4192 .             ps  12
4193 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4194 .             el \{ .vs \\n[#DOC_LEAD]u \}
4195 .             CAPS
4196 .             if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
4197 .             CAPS OFF
4198 .             if !'\\*[$SUBTITLE]'' \{\
4199 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4200 .                el \{ .vs \\n[#DOC_LEAD]u \}
4201 .             PRINT \\*[$SUBTITLE]
4202 .             \}
4203 .             if '\\*[$SUBTITLE]'' \{\
4204 .                ALD \\n[#DOC_LEAD]u
4205 .             \}
4206 .             ie !'\\*[$AUTHOR_1]'' \{\
4207 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4208 .                el \{ .vs \\n[#DOC_LEAD]u/2u \}
4209 .                if !d$SUBTITLE \{\
4210 .                   ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4211 .                   el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4212 .                \}
4213 .                PRINT \\*[$ATTRIBUTE_STRING]
4214 .                nr #AUTHORS \\n[#AUTHOR_NUM]
4215 .                nr #NEXT_AUTHOR 0 1
4216 .                while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4217 .                   PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4218 .                \}
4219 .                if \\n[#AUTHOR_LINES]=1 \{\
4220 .                    ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4221 .                    el \{ .ALD \\n[#DOC_LEAD]u/2u \}
4222 .                \}
4223 .             \}
4224 .             el \{\
4225 .                ie !d$SUBTITLE \{\
4226 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4227 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4228 .                \}
4229 .                el \{\
4230 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4231 .                   el \{ .ALD \\n[#DOC_LEAD]u \}
4232 .                \}
4233 .             \}
4234 .          \}
4235 .          if \\n[#PRINT_STYLE]=2 \{\
4236 .             DEFAULT_DOCHEADER
4237 .             di DOCHEADER_DIVERSION \" This diversion is only
4238 .             br                     \" necessary to find the depth of the
4239 .             DEFAULT_DOCHEADER      \" docheader
4240 .             br
4241 .             di
4242 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
4243 .                                                             \"in #DOCHEADER_DEPTH
4244 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
4245 .          \}
4246 .          ev
4247 .       \}
4248 \# Chapter
4249 .       if \\n[#DOC_TYPE]=2 \{\
4250 .          PRINT \&
4251 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
4252 .          ev TITLE
4253 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4254 .          LL       \\n[#DOC_L_LENGTH]u
4255 .          ta \\n(.lu
4256 .          if \\n[#PRINT_STYLE]=1 \{\
4257 .             CENTER
4258 .             fam C
4259 .             ft  R
4260 .             ps  12
4261 .             vs \\n[#DOC_LEAD]u
4262 .             ie '\\*[$CHAPTER]'' \{\
4263 .                CAPS
4264 .                ie !'\\*[$CHAPTER_TITLE]'' \{\
4265 .                   PRINT \\*[$CHAPTER_TITLE]
4266 .                \}
4267 .                el \{\
4268 .                   CAPS
4269 .                   PRINT \\*[$CHAPTER_STRING]
4270 .                \}
4271 .                CAPS OFF
4272 .             \}
4273 .             el \{\
4274 .                CAPS
4275 .                PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER]
4276 .                CAPS OFF
4277 .                if !'\\*[$CHAPTER_TITLE]'' \{\
4278 .                   if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4279 .                   UNDERSCORE "\\*[$CHAPTER_TITLE]
4280 .                \}
4281 .             \}
4282 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4283 .          \}
4284 .          if \\n[#PRINT_STYLE]=2 \{\
4285 .             CHAPTER_DOCHEADER
4286 .             di DOCHEADER_DIVERSION \" This diversion is only
4287 .             br                     \" necessary to find the depth of the
4288 .             CHAPTER_DOCHEADER      \" docheader
4289 .             br
4290 .             di
4291 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
4292 .                                                             \" in #DOCHEADER_DEPTH
4293 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
4294 .          \}
4295 .          ev
4296 .       \}
4297 \# Named
4298 .       if \\n[#DOC_TYPE]=3 \{\
4299 .          PRINT \&
4300 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
4301 .          ev NAMED
4302 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4303 .          LL       \\n[#DOC_L_LENGTH]u
4304 .          ta \\n(.lu
4305 .          if \\n[#PRINT_STYLE]=1 \{\
4306 .             CENTER
4307 .             fam C
4308 .             ft  R
4309 .             ps  12
4310 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4311 .             el \{ .vs \\n[#DOC_LEAD]u \}
4312 .             CAPS
4313 .             if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
4314 .             CAPS OFF
4315 .             if !'\\*[$SUBTITLE]'' \{\
4316 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
4317 .                el \{ .vs \\n[#DOC_LEAD]u \}
4318 .                PRINT \\*[$SUBTITLE]
4319 .             \}
4320 .             if '\\*[$SUBTITLE]'' \{\
4321 .                ALD \\n[#DOC_LEAD]u
4322 .             \}
4323 .             ie !'\\*[$AUTHOR_1]'' \{\
4324 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4325 .                el \{ .vs \\n[#DOC_LEAD]u/2u \}
4326 .                if !d$SUBTITLE \{\
4327 .                   ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4328 .                   el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4329 .                \}
4330 .                PRINT \\*[$ATTRIBUTE_STRING]
4331 .                nr #AUTHORS \\n[#AUTHOR_NUM]
4332 .                nr #NEXT_AUTHOR 0 1
4333 .                while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4334 .                   PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4335 .                \}
4336 .                if \\n[#AUTHOR_LINES]=1 \{\
4337 .                    ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4338 .                    el \{ .ALD \\n[#DOC_LEAD]u/2u \}
4339 .                 \}
4340 .             \}
4341 .             vs  \\n[#DOC_LEAD]u
4342 .             el \{\
4343 .                ie !d$SUBTITLE \{\
4344 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4345 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4346 .                \}
4347 .                el \{\
4348 .                   ie \\n[#SINGLE_SPACE] \{ . \}
4349 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4350 .                \}
4351 .             \}
4352 .             ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
4353 .             el \{ .ALD \\n[#DOC_LEAD]u \}
4354 .             UNDERSCORE2 "\\*[$DOC_TYPE]
4355 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4356 .          \}
4357 .          if \\n[#PRINT_STYLE]=2 \{\
4358 .             NAMED_DOCHEADER
4359 .             di DOCHEADER_DIVERSION \" This diversion is only
4360 .             br                     \" necessary to find the depth of the
4361 .             NAMED_DOCHEADER        \" docheader
4362 .             br
4363 .             di
4364 .             nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
4365 .                                                             \"in #DOCHEADER_DEPTH
4366 .             rm DOCHEADER_DIVERSION                          \" Removing the diversion macro
4367 .          \}
4368 .          ev
4369 .       \}
4370 .       if !\\n[#DOC_TYPE]=4 \{\
4371 .          if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
4372 .          nr #DOCHEADER_SPACE_ADJ \\n[#DOCHEADER_DEPTH]%\\n[#DOC_LEAD] \"Do we need the units?
4373 .          ie !\\n[#DOCHEADER_SPACE_ADJ]=0 \{ .nr #DOCHEADER_EXTRA_SPACE \\n[#DOC_LEAD]u-\\n[#DOCHEADER_SPACE_ADJ]u \}
4374 .          el \{ .nr #DOCHEADER_EXTRA_SPACE 0 \}
4375 .          if \\n[#PRINT_STYLE]=2 \{ .ALD (\\n[#DOC_LEAD]u*2u)+\\n[#DOCHEADER_EXTRA_SPACE]u \}
4376 .          if \\n[#COLUMNS] \{\
4377 .             nr #COL_NUM 0 1
4378 .             nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
4379 .             po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4380 .             LL \\n[#COL_L_LENGTH]u
4381 .             ta \\n(.lu
4382 .             mk dc
4383 .          \}
4384 .       \}
4385 .    \}
4386 .    rr #DOCHEADER_LEAD
4387 .    rr #DOCHEADER_LEAD_ADJ
4388 .    rr #DEPTH_1
4389 .    rr #DEPTH_2
4390 .    rr #DOCHEADER_ADVANCE
4391 .    rr #ADVANCE_FROM_TOP
4392 .    rr #DOCHEADER_SPACE_ADJ
4393 .    rr #DOCHEADER_EXTRA_SPACE
4394 .    rr #AUTHORS
4395 .    rr #NEXT_AUTHOR
4396 .    rr #AUTHOR_NUM
4397 .    rr #NUM_AUTHORS
4398 .    rm $TOC_TITLE_ITEM
4399 .    nr #START 1
4400 .    nr #START_FOR_FOOTERS 1
4401 .END
4403 \# ====================================================================
4405 \# +++MACROS TO CHANGE SOME DEFAULTS+++
4407 \# DOCUMENT HEADER
4408 \# ---------------
4409 \# *Argument:
4410 \#   <none> | <anything> [distance to advance from top of page]
4411 \# *Function:
4412 \#   Turns printing of document header on or off.  If a second argument
4413 \#   in units of measure is given, advances that distance from the
4414 \#   top of the page without printing the document header.
4415 \# *Notes:
4416 \#   Default is on.  If the 1st argument is <anything> (which turns
4417 \#   document headers off), the optional 2nd argument may be given
4418 \#   (with a unit of measure).
4420 .MAC DOCHEADER END
4421 .    ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
4422 .    el \{\
4423 .       if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
4424 .       nr #DOC_HEADER 0
4425 .    \}
4426 .END
4429 \# DOCUMENT HEADER LEADING
4430 \# -----------------------
4431 \# *Arguments:
4432 \#   <+|- amount by which to in/decrease leading of doc header>
4433 \# *Function:
4434 \#   Stores user supplied lead in/decrease in register #DOCHEADER_LEAD_ADJ.
4435 \# *Notes:
4436 \#   A unit of measure must be supplied.  Decimal fractions OK.
4437 \#   Default is +0, i.e. same as DOC_LEAD.
4439 .MAC DOCHEADER_LEAD END
4440 .    nr #DOCHEADER_LEAD_ADJ (\\$1)
4441 .END
4444 \# DOCHEADER ADVANCE
4445 \# -----------------
4446 \# *Arguments:
4447 \#   <docheader start position>
4448 \# *Function:
4449 \#   Creates register #DOCHEADER_ADVANCE, used in START.
4450 \# *Notes:
4451 \#   Unit of measure required.
4452 \#   Default is same as T_MARGIN.
4454 .MAC DOCHEADER_ADVANCE END
4455 .    nr #DOCHEADER_ADVANCE (\\$1)
4456 .END
4459 \# TITLE FAMILY
4460 \# ------------
4461 \# *Argument:
4462 \#   <family to use for the document header title>
4463 \# *Function:
4464 \#   Creates or modifies string $TITLE_FAM.
4465 \# *Notes:
4466 \#   Default is same as running text.
4468 .MAC TITLE_FAMILY END
4469 .    ds $TITLE_FAM \\$1
4470 .END
4473 \# TITLE FONT
4474 \# ----------
4475 \# *Argument:
4476 \#   <font to use for the document header title>
4477 \# *Function:
4478 \#   Creates or modifies string $TITLE_FT.
4479 \# *Notes:
4480 \#   Default is bold.
4482 .MAC TITLE_FONT END
4483 .    ds $TITLE_FT \\$1
4484 .END
4487 \# TITLE SIZE
4488 \# ----------
4489 \# *Argument:
4490 \#   <+|- number of points by which to in/decrease title at start
4491 \#   of the document (relative to running text)>
4492 \# *Function:
4493 \#   Creates string $TITLE_SIZE_CHANGE.
4494 \# *Notes:
4495 \#   Must be preceded by a +|- sign, with no space afterwards.
4496 \#   Fractional point sizes are allowed.
4497 \#   Default is +3.5 for printstyle TYPESET DEFAULT | STORY | NAMED;
4498 \#   4 for TYPESET CHAPTER; +0 for TYPEWRITE.
4500 .MAC TITLE_SIZE END
4501 .    ds $TITLE_SIZE_CHANGE \\$1
4502 .END
4505 \# CHAPTER TITLE FAMILY
4506 \# --------------------
4507 \# *Argument:
4508 \#   <family to use for the chapter title, if there is one>
4509 \# *Function:
4510 \#   Creates or modifies string $CHAPTER_TITLE_FAM.
4511 \# *Notes:
4512 \#   Default isame as running text.
4514 .MAC CHAPTER_TITLE_FAMILY END
4515 .    ds $CHAPTER_TITLE_FAM \\$1
4516 .END
4519 \# CHAPTER TITLE FONT
4520 \# ------------------
4521 \# *Argument:
4522 \#   <font to use for the chapter title, if there is one>
4523 \# *Function:
4524 \#   Creates or modifies string $CHAPTER_TITLE_FT.
4525 \# *Notes:
4526 \#   Default is bold italic for TYPESET; varies in TYPEWRITE between
4527 \#   caps and underscored, depending on whether chapter title stands
4528 \#   alone or has CHAPTER # above it.
4530 .MAC CHAPTER_TITLE_FONT END
4531 .    ds $CHAPTER_TITLE_FT \\$1
4532 .END
4535 \# CHAPTER TITLE SIZE
4536 \# ------------------
4537 \# *Argument:
4538 \#   <+|- number of points by which to in/decrease title at start
4539 \#   of the document (relative to running text)>
4540 \# *Function:
4541 \#   Creates string $CHAPTER_TITLE_SIZE_CHANGE.
4542 \# *Notes:
4543 \#   Must be preceded by a +|- sign, with no space afterwards.
4544 \#   Fractional point sizes are allowed.
4545 \#   Default is +4 for printstyle TYPESET
4547 .MAC CHAPTER_TITLE_SIZE END
4548 .    ds $CHAPTER_TITLE_SIZE_CHANGE \\$1
4549 .END
4552 \# SUBTITLE FAMILY
4553 \# ---------------
4554 \# *Argument:
4555 \#   <family to use for the document header title>
4556 \# *Function:
4557 \#   Creates or modifies string $SUBTITLE_FAM.
4558 \# *Notes:
4559 \#   Default is same as running text.
4561 .MAC SUBTITLE_FAMILY END
4562 .    ds $SUBTITLE_FAM \\$1
4563 .END
4566 \# SUBTITLE FONT
4567 \# -------------
4568 \# *Argument:
4569 \#   <font to use for the document header title>
4570 \# *Function:
4571 \#   Creates or modifies string $SUBTITLE_FT.
4572 \# *Notes:
4573 \#   Default is same as running text.
4575 .MAC SUBTITLE_FONT END
4576 .    ds $SUBTITLE_FT \\$1
4577 .END
4580 \# SUBTITLE SIZE
4581 \# -------------
4582 \# *Argument:
4583 \#   <+|- number of points by which to in/decrease subtitle at start
4584 \#   of the document (relative to running text)>
4585 \# *Function:
4586 \#   Creates or modifies string $SUBTITLE_SIZE_CHANGE.
4587 \# *Notes:
4588 \#   Must be preceded by a +|- sign with no space afterwards.
4589 \#   Fractional point sizes are allowed.
4590 \#   Default is +0.
4592 .MAC SUBTITLE_SIZE END
4593 .    ds $SUBTITLE_SIZE_CHANGE \\$1
4594 .END
4597 \# AUTHOR FAMILY
4598 \# -------------
4599 \# *Argument:
4600 \#   <family to use for author in document header>
4601 \# *Function:
4602 \#   Creates or modifies string $AUTHOR_FAM.
4603 \# *Notes:
4604 \#   Default is same as running text.
4606 .MAC AUTHOR_FAMILY END
4607 .    ds $AUTHOR_FAM \\$1
4608 .END
4611 \# AUTHOR FONT
4612 \# -----------
4613 \# *Argument:
4614 \#   <font to use for author in document header>
4615 \# *Function:
4616 \#   Creates or modifies string $AUTHOR_FT.
4617 \# *Notes:
4618 \#   Default is italic.
4620 .MAC AUTHOR_FONT END
4621 .    ds $AUTHOR_FT \\$1
4622 .END
4625 \# AUTHOR SIZE
4626 \# -----------
4627 \# *Argument:
4628 \#   <+|- number of points by which to in/decrease author at start
4629 \#   of the document>
4630 \# *Function:
4631 \#   Creates or modifies string $AUTHOR_SIZE_CHANGE.
4632 \# *Notes:
4633 \#   Must be preceded by a +|- sign with no space afterwards.
4634 \#   Fractional point sizes are allowed.
4635 \#   Default is same as running text.
4637 .MAC AUTHOR_SIZE END
4638 .    ds $AUTHOR_SIZE_CHANGE \\$1
4639 .END
4642 \# DOCTYPE FAMILY
4643 \# --------------
4644 \# *Argument:
4645 \#   <family to use for the document type string>
4646 \# *Function:
4647 \#   Creates or modifies string $DOCTYPE_FAM.
4648 \# *Notes:
4649 \#   Default is same as running text.
4651 .MAC DOCTYPE_FAMILY END
4652 .    ds $DOCTYPE_FAM \\$1
4653 .END
4656 \# DOCTYPE FONT
4657 \# ------------
4658 \# *Argument:
4659 \#   <font to use for the document type string>
4660 \# *Function:
4661 \#   Creates or modifies string $DOCTYPE_FT.
4662 \# *Notes:
4663 \#   Default is bold italic.
4665 .MAC DOCTYPE_FONT END
4666 .    ds $DOCTYPE_FT \\$1
4667 .END
4670 \# DOCTYPE SIZE
4671 \# -------------
4672 \# *Argument:
4673 \#   <+|- number of points by which to in/decrease the document
4674 \#   type string (relative to running text)>
4675 \# *Function:
4676 \#   Creates or modifies string $DOCTYPE_SIZE_CHANGE.
4677 \# *Notes:
4678 \#   Must be preceded by a +|- sign with no space afterwards.
4679 \#   Fractional point sizes are allowed.
4680 \#   Default is +3 for TYPESET; 0 for TYPEWRITE.
4682 .MAC DOCTYPE_SIZE END
4683 .    ds $DOCTYPE_SIZE_CHANGE \\$1
4684 .END
4687 \# DOCUMENT LEFT MARGIN
4688 \# --------------------
4689 \# *Argument:
4690 \#   <left margin of document>
4691 \# *Function:
4692 \#   Creates or modifies register #DOC_L_MARGIN.
4693 \# *Notes:
4694 \#   Affects EVERYTHING on the page.
4696 .MAC DOC_LEFT_MARGIN END
4697 .    br
4698 .    nr #DOC_L_MARGIN (\\$1)
4699 .    L_MARGIN \\n[#DOC_L_MARGIN]u
4700 .END
4703 \# DOCUMENT RIGHT MARGIN
4704 \# ---------------------
4705 \# *Argument:
4706 \#   <right margin of document>
4707 \# *Function:
4708 \#   Creates or modifies register #DOC_R_MARGIN.
4709 \# *Notes:
4710 \#   Affects EVERYTHING on the page.
4712 .MAC DOC_RIGHT_MARGIN END
4713 .    br
4714 .    nr #DOC_R_MARGIN (\\$1)
4715 .    R_MARGIN \\n[#DOC_R_MARGIN]
4716 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
4717 .END
4720 \# DOCUMENT LINE LENGTH
4721 \# --------------------
4722 \# *Argument:
4723 \#   <line length of document>
4724 \# *Function:
4725 \#   Creates or modifies string $DOC_L_LENGTH.
4726 \# *Notes:
4727 \#   Affects EVERYTHING on the page.
4729 .MAC DOC_LINE_LENGTH END
4730 .    br
4731 .    nr #DOC_L_LENGTH (\\$1)
4732 .    LL \\n[#DOC_L_LENGTH]u
4733 .    ta \\n(.lu
4734 .END
4737 \# DOCUMENT FAMILY
4738 \# ---------------
4739 \# *Argument:
4740 \#   <family of running text>
4741 \# *Function:
4742 \#   Creates or modifies string $DOC_FAM.
4743 \# *Notes:
4744 \#   Affects everything EXCEPT headers and footers.
4746 .MAC DOC_FAMILY END
4747 .    br
4748 .    ds $DOC_FAM \\$1
4749 .    FAMILY            \\*[$DOC_FAM]
4750 .    TITLE_FAMILY      \\*[$DOC_FAM]
4751 .    SUBTITLE_FAMILY   \\*[$DOC_FAM]
4752 .    AUTHOR_FAMILY     \\*[$DOC_FAM]
4753 .    DOCTYPE_FAMILY    \\*[$DOC_FAM]
4754 .    HEAD_FAMILY       \\*[$DOC_FAM]
4755 .    SUBHEAD_FAMILY    \\*[$DOC_FAM]
4756 .    QUOTE_FAMILY      \\*[$DOC_FAM]
4757 .    BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
4758 .    EPIGRAPH_FAMILY   \\*[$DOC_FAM]
4759 .    HDRFTR_FAMILY     \\*[$DOC_FAM]
4760 .    PAGENUM_FAMILY    \\*[$DOC_FAM]
4761 .END
4764 \# DOCUMENT POINT SIZE
4765 \# -------------------
4766 \# *Argument:
4767 \#   <point size of running text>
4768 \# *Function:
4769 \#   Creates or modifies register #DOC_PT_SIZE.
4770 \# *Notes:
4771 \#   DOC_PT_SIZE is the basis for calculating all type sizes in
4772 \#   a document.
4774 .MAC DOC_PT_SIZE END
4775 .    if \\n[#IGNORE] \{ .return \}
4776 .    br
4777 .    PT_SIZE \\$1
4778 .    nr #DOC_PT_SIZE \\n[#PT_SIZE]
4779 .END
4782 \# DOCUMENT LEAD
4783 \# -------------
4784 \# *Argument:
4785 \#   <lead (".vs") of running text> [ADJUST]
4786 \# *Function:
4787 \#   Creates or modifies register #DOC_LEAD.  If the optional
4788 \#   ADJUST argument is given, adjusts leading so that the last
4789 \#   line of text falls exactly on #B_MARGIN.
4790 \# *Notes:
4791 \#   DOC_LEAD is the basis for calculating all leading changes in
4792 \#   a document.  Default for TYPESET is 16; 24 for TYPEWRITE.
4794 \#   Because the visible bottom or footer margin of a page depends
4795 \#   on the overall document lead supplied by the register #DOC_LEAD,
4796 \#   DOC_LEAD, in the body of a document, should always be associated
4797 \#   with the start of a new page (in other words, just before or
4798 \#   just after a manual NEWPAGE).
4800 .MAC DOC_LEAD END
4801 .    if \\n[#IGNORE] \{ .return \}
4802 .    br
4803 .    vs \\$1
4804 .    nr #DOC_LEAD \\n[#LEAD]
4805 .    if '\\$2'ADJUST' \{ .TRAPS \}
4806 .END
4808 \# ADJUST DOCUMENT LEAD
4809 \# --------------------
4810 \# *Arguments:
4811 \#   <none> | <anything>
4812 \# *Function:
4813 \#   Adjusts document lead so that the last line of text falls exactly
4814 \#   on #B_MARGIN.
4816 .MAC DOC_LEAD_ADJUST END
4817 .    ie '\\$1'' \{ .nr #ADJ_DOC_LEAD 1 \}
4818 .    el \{ .nr #ADJ_DOC_LEAD 0 \}
4819 .END
4822 \# DOCUMENT QUAD
4823 \# -------------
4824 \# *Arguments:
4825 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE | J | JUSTIFY
4826 \# *Function:
4827 \#   Creates or modifies string $DOC_QUAD.
4828 \# *Notes:
4829 \#   While QUAD (from the typesetting macros) can be used before START
4830 \#   to change  the default document quad, DOC_QUAD *must* be used after
4831 \#   the START macro has been invoked.
4833 \#   Default is LEFT for printstyle TYPEWRITE, JUSTIFY for printstyle
4834 \#   TYPESET.
4836 .MAC DOC_QUAD END
4837 .    ds $DOC_QUAD \\$1
4838 .    QUAD \\*[$DOC_QUAD]
4839 .END
4841 \# ====================================================================
4843 \# +++INTERNATIONALIZATION+++
4845 \# ATTRIBUTE STRING
4846 \# ----------------
4847 \# *Argument:
4848 \#   <what goes in the "by" slot before author in the document header>
4849 \# *Function:
4850 \#   Creates or modifies string $ATTRIBUTE_STRING.
4851 \# *Notes:
4852 \#   Default is "by".  A blank string ("") may be used if no
4853 \#   attribution is desired.
4855 .MAC ATTRIBUTE_STRING END
4856 .    ds $ATTRIBUTE_STRING \\$1
4857 .END
4860 \# CHAPTER STRING
4861 \# --------------
4862 \# *Argument:
4863 \#   <what to print any time the word "chapter" is required>
4864 \# *Function:
4865 \#   Creates or modifies string $CHAPTER_STRING.
4866 \# *Notes:
4867 \#   Default is "chapter".
4869 .MAC CHAPTER_STRING END
4870 .    ds $CHAPTER_STRING \\$1
4871 .END
4874 \# DRAFT STRING
4875 \# ------------
4876 \# *Argument:
4877 \#   <what to print any time the word "draft" is required>
4878 \# *Function:
4879 \#   Creates or modifies string $DRAFT_STRING.
4880 \# *Notes:
4881 \#   Default is "draft".
4883 .MAC DRAFT_STRING END
4884 .    ds $DRAFT_STRING \\$1
4885 .END
4888 \# REVISION STRING
4889 \# ---------------
4890 \# *Argument:
4891 \#   <what to print any time the word "revision" is required>
4892 \# *Function:
4893 \#   Creates or modifies string $REVISION_STRING.
4894 \# *Notes:
4895 \#   Default is "revision".
4897 .MAC REVISION_STRING END
4898 .    ds $REVISION_STRING \\$1
4899 .END
4902 \# FINIS STRING
4903 \# ------------
4904 \# *Argument:
4905 \#   <what to print with the finis macro>
4906 \# *Function:
4907 \#   Creates or modifies string $FINIS_STRING.
4908 \# *Notes:
4909 \#   Default is "END".
4911 .MAC FINIS_STRING END
4912 .    nr #FINIS 1
4913 .    CAPS
4914 .    ds $FINIS_STRING \\$1
4915 .    CAPS OFF
4916 .END
4918 \# ====================================================================
4920 \# +++RECTO/VERSO+++
4922 \# RECTO_VERSO
4923 \# -----------
4924 \# *Arguments:
4925 \#   <none> | <anything>
4926 \# *Function:
4927 \#   Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages.  Also
4928 \#   switches page numbers left and right if either is chosen rather
4929 \#   than the default centered page numbers.  Switches left and right
4930 \#   margins if differing values have been entered.
4931 \# *Notes:
4932 \#   Default is OFF.
4934 .MAC RECTO_VERSO END
4935 .    ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
4936 .    el \{ .nr #RECTO_VERSO 0 \}
4937 .END
4939 \# ====================================================================
4941 \# +++EPIGRAPHS+++
4943 \# EPIGRAPH FAMILY
4944 \# ---------------
4945 \# *Argument:
4946 \#   <family to use for epigraphs>
4947 \# *Function:
4948 \#   Creates or modifies string $EPI_FAM.
4949 \# *Notes:
4950 \#   Default is same as running text.
4952 .MAC EPIGRAPH_FAMILY END
4953 .    ds $EPI_FAM \\$1
4954 .END
4957 \# EPIGRAPH FONT
4958 \# -------------
4959 \# *Argument:
4960 \#   <font to use for epigraphs>
4961 \# *Function:
4962 \#   Creates or modifies string $EPI_FT.
4963 \# *Notes:
4964 \#   Default is same as running text.
4966 .MAC EPIGRAPH_FONT END
4967 .    ds $EPI_FT \\$1
4968 .END
4971 \# EPIGRAPH SIZE
4972 \# -------------
4973 \# *Argument:
4974 \#   <-|+ number of points by which to de/increase point size of epigraphs
4975 \#   (relative to running text)>
4976 \# *Function:
4977 \#   Creates or modifies string $EPI_SIZE_CHANGE.
4978 \# *Notes:
4979 \#   Must be preceded by a - or + sign with no space afterwards.
4980 \#   Fractional point sizes are allowed.  Default -1.5 for printstyle
4981 \#   TYPESET; +0 for TYPEWRITE.
4983 .MAC EPIGRAPH_SIZE END
4984 .    ds $EPI_SIZE_CHANGE \\$1
4985 .END
4988 \# EPIGRAPH QUAD
4989 \# -------------
4990 \# *Arguments:
4991 \#   L | LEFT | J | JUSTIFY
4992 \# *Function:
4993 \#   Creates or modifies string $EPI_QUAD.
4994 \# *Notes:
4995 \#   Default is $DOC_QUAD when BLOCK argument is passed to EPIGRAPH.
4997 .MAC EPIGRAPH_QUAD END
4998 .    ds $EPI_QUAD \\$1
4999 .END
5002 \# EPIGRAPH INDENT
5003 \# ---------------
5004 \# *Argument:
5005 \#   <value by which to multiply PP_INDENT for block epigraphs>
5006 \# *Function:
5007 \#   Creates or modifies register #EPI_OFFSET_VALUE.
5008 \# *Notes:
5009 \#   Default is 2 for TYPEWRITE, 3 for TYPESET.
5011 .MAC EPIGRAPH_INDENT END
5012 .    nr #EPI_OFFSET_VALUE \\$1
5013 .END
5016 \# EPIGRAPH AUTOLEAD
5017 \# -----------------
5018 \# *Argument:
5019 \#   <amount of lead to add to the epigraph ps for epigraph leading>
5020 \# *Function:
5021 \#   Creates or modifies register #EPI_AUTOLEAD.
5022 \# *Notes:
5023 \#   Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
5025 .MAC EPIGRAPH_AUTOLEAD END
5026 .    nr #EPI_AUTOLEAD \\$1
5027 .END
5030 \# EPIGRAPH
5031 \# --------
5032 \# *Arguments:
5033 \#   BLOCK | <anything>
5034 \# *Function:
5035 \#   Places an epigraph before the document's text, after the
5036 \#   document header, or after a HEAD.
5037 \# *Notes:
5038 \#   #EPIGRAPH 1 = centered; 2 = block
5040 \#   By default, epigraphs are centered, allowing the user
5041 \#   to input them on a line per line basis.  To change this
5042 \#   behaviour, the user can supply the argument BLOCK, which
5043 \#   will produce indented, filled text similar to BLOCKQUOTE.
5045 \#   If a block epigraph contains more than one para, ALL paras of
5046 \#   the epigraph must be preceded by PP.  Otherwise, PP is optional.
5048 .MAC EPIGRAPH END
5049 .    nr #PP_STYLE 2
5050 .    nr #Q_PP     0
5051 .    if \\n[#START] \{\
5052 .       if \\n[#PRINT_STYLE]=1 \{\
5053 .          if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
5054 .       \}
5055 .    \}
5056 .    ie '\\$1'' \{\
5057 .       nr #EPIGRAPH 1
5058 .       ev EPIGRAPH
5059 .       ll \\n[#L_LENGTH]u
5060 .       ta \\n(.lu
5061 .       CHECK_INDENT
5062 .       if \\n[#COLUMNS] \{\
5063 .          ie \\n[#START] \{\
5064 .              ll \\n[#DOC_L_LENGTH]u
5065 .              ta \\n(.lu
5066 .          \}
5067 .          el \{\
5068 .             ll \\n[#COL_L_LENGTH]u
5069 .             ta \\n(.lu
5070 .          \}
5071 .       \}
5072 .       CENTER
5073 .       if \\n[#PRINT_STYLE]=1 \{\
5074 .          fam C
5075 .          ft  R
5076 .          if '\\*[$EPI_FT]'I' \{\
5077 .             FT I
5078 .          \}
5079 .          ps  12
5080 .          ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
5081 .          el \{ .vs  \\n[#DOC_LEAD]u/2u \}
5082 .          nr #EPI_LEAD      \\n[#LEAD]
5083 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5084 .       \}
5085 .       if \\n[#PRINT_STYLE]=2 \{\
5086 .          FAMILY   \\*[$EPI_FAM]
5087 .          FT       \\*[$EPI_FT]
5088 .          PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
5089 .          AUTOLEAD \\n[#EPI_AUTOLEAD]
5090 .          nr #EPI_LEAD      \\n[#LEAD]
5091 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5092 .       \}
5093 .       di EPI_TEXT
5094 .       nr #EPI_ACTIVE 1
5095 .    \}
5096 .    el \{\
5097 .       ie '\\$1'BLOCK' \{\
5098 .          nr #EPIGRAPH 2
5099 .          ev EPIGRAPH
5100 .          ie \\n[#START] \{\
5101 .             ie \\n[#COLUMNS] \{\
5102 .                ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5103 .                ta \\n(.lu
5104 .             \}
5105 .             el \{\
5106 .                ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5107 .                ta \\n(.lu
5108 .             \}
5109 .          \}
5110 .          el \{\
5111 .             ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5112 .             ta \\n(.lu
5113 .             if \\n[#COLUMNS] \{\
5114 .                ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
5115 .                ta \\n(.lu
5116 .             \}
5117 .             CHECK_INDENT
5118 .          \}
5119 .          if \\n[#PRINT_STYLE]=1 \{\
5120 .             fam C
5121 .             ft  R
5122 .             if '\\*[$EPI_FT]'I' \{\
5123 .                FT I
5124 .             \}
5125 .             ps  12
5126 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
5127 .             el \{ .vs  \\n[#DOC_LEAD]u/2u \}
5128 .             QUAD LEFT
5129 .             HY OFF
5130 .             nr #EPI_LEAD \\n[#LEAD]
5131 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5132 .             di EPI_TEXT
5133 .             nr #EPI_ACTIVE 1
5134 .          \}
5135 .          if \\n[#PRINT_STYLE]=2 \{\
5136 .             FAMILY   \\*[$EPI_FAM]
5137 .             FT       \\*[$EPI_FT]
5138 .             PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
5139 .             AUTOLEAD \\n[#EPI_AUTOLEAD]
5140 .             QUAD     \\*[$EPI_QUAD]
5141 .             HY
5142 .             nr #EPI_LEAD \\n[#LEAD]
5143 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
5144 .             di EPI_TEXT
5145 .             nr #EPI_ACTIVE 1
5146 .          \}
5147 .       \}
5148 .       el \{\
5149 .          DO_EPIGRAPH
5150 .       \}
5151 .    \}
5152 .END
5155 \# DO EPIGRAPH
5156 \# -----------
5157 \# *Arguments:
5158 \#   <none>
5159 \# *Function:
5160 \#   Ends diversion started in EPIGRAPH.  Makes spacing
5161 \#   adjustments to compensate for the difference between epigraph
5162 \#   leading and overall document leading, so that the bottom of
5163 \#   the pages remain flush.
5164 \# *Notes:
5165 \#   In addition to its usual place at the beginning of a
5166 \#   document, EPIGRAPH may also be used after HEAD.
5168 .MAC DO_EPIGRAPH END
5169 .    br
5170 .    di
5171 .    REMOVE_INDENT
5172 .    ev
5173 .    nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
5174 .    nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
5175 .    ie \\n[#START] \{\
5176 .       nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
5177 .       while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5178 .       if \\n[#PRINT_STYLE]=2 \{\
5179 .          RLD \\n[#DOC_LEAD]u
5180 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5181 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
5182 .          \}
5183 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5184 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5185 .          \}
5186 .       \}
5187 .    \}
5188 .    el \{\
5189 .       ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
5190 .          nr #EPI_FITS 1
5191 .          nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
5192 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5193 .          ie \\n[#PRINT_STYLE]=1 \{\
5194 .             if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
5195 .          \}
5196 .          el \{\
5197 .             if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5198 .                ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
5199 .             \}
5200 .             if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5201 .                ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5202 .             \}
5203 .          \}
5204 .       \}
5205 .       el \{\
5206 .          nr #EPI_LINES_TO_TRAP 0 1
5207 .          while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{ .nr #LOOP 1 \}
5208 .          nr #EPI_LINES_TO_TRAP -1
5209 .          nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
5210 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5211 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
5212 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
5213 .      \}
5214 .    \}
5215 .    if \\n[#EPIGRAPH]=1 \{\
5216 .       po \\n[#L_MARGIN]u
5217 .       if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
5218 .    \}
5219 .    if \\n[#EPIGRAPH]=2 \{\
5220 .       nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5221 .       if \\n[#COLUMNS] \{\
5222 .          nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5223 .       \}
5224 .       po \\n[#EPI_OFFSET]u
5225 .    \}
5226 .    nf
5227 .    EPI_TEXT
5228 .    br
5229 .    ie \\n[#START] \{\
5230 .       if \\n[#PRINT_STYLE]=1 \{\
5231 .          ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
5232 .          el \{\
5233 .             ie \\n[#EPI_LINES]%2=1 \{ .ALD \\n[#DOC_LEAD]u \}
5234 .             el \{ .ALD \\n[#DOC_LEAD]u/2u \}
5235 .          \}
5236 .       \}
5237 .       if \\n[#PRINT_STYLE]=2 \{\
5238 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5239 .             ALD \\n[#EPI_WHITESPACE]u/2u
5240 .          \}
5241 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5242 .             ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5243 .          \}
5244 .       \}
5245 .    \}
5246 .    el \{\
5247 .       rr #EPI_ACTIVE
5248 .       ie \\n[#EPI_FITS] \{\
5249 .          ie \\n[#FN_FOR_EPI] \{\
5250 .             nr #EPI_LINES_TO_END 1
5251 .             nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
5252 .             while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5253 .             ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
5254 .          \}
5255 .          el \{\
5256 .             ie \\n[#PRINT_STYLE]=1 \{\
5257 .                if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
5258 .             \}
5259 .             el \{\
5260 .                if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
5261 .                   ALD \\n[#EPI_WHITESPACE]u/2u
5262 .                \}
5263 .                if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
5264 .                   ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
5265 .                \}
5266 .             \}
5267 .          \}
5268 .       \}
5269 .       el \{\
5270 .          nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
5271 .          if \\n[#LOOP] \{. nr #EPI_LINES_TO_END +1 \}
5272 .          rr #LOOP
5273 .          nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
5274 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
5275 .          ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
5276 .          if \\n[#PRINT_STYLE]=1 \{\
5277 .             if !\\n[#SINGLE_SPACE] \{\
5278 .                nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
5279 .                ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
5280 .                el \{ .RLD .5v \}
5281 .                rr #EPI_LINES_EVEN
5282 .             \}
5283 .          \}
5284 .       \}
5285 .    \}
5286 .    nr #PP_STYLE 1
5287 .    rr #EPI_FITS
5288 .    ALD \\n[#DOC_LEAD]u
5289 .    QUAD \\*[$DOC_QUAD]
5290 .    po \\n[#L_MARGIN]u
5291 .    if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
5292 .    if \\n[#START] \{\
5293 .       if \\n[#COLUMNS] \{\
5294 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
5295 .          mk dc
5296 .       \}
5297 .    \}
5298 .END
5300 \# ====================================================================
5302 \# +++FINIS MACRO+++
5304 \# FINIS
5305 \# -----
5306 \# *Arguments:
5307 \#   <none>
5308 \# *Function:
5309 \#   Deposits --END-- at the end of a document.
5311 .MAC FINIS END
5312 .    nr #FINIS 1
5313 .    if \\n[#TAB_ACTIVE] \{ .TQ \}
5314 .    if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
5315 .    if \\n[#FOOTERS_ON] \{\
5316 .       nr #FOOTERS_WERE_ON 1
5317 .       FOOTERS OFF
5318 .    \}
5319 .    if \\n[#PAGINATE] \{\
5320 .       if \\n[#PAGE_NUM_V_POS]=2 \{\
5321 .          nr #PAGINATION_WAS_ON 1
5322 .          PAGINATION OFF
5323 .       \}
5324 .    \}
5325 .    nr #EM_ADJUST (1m/8)
5326 .    if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
5327 .    ALD \\n[#DOC_LEAD]u
5328 .    CENTER
5329 .    if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
5330 .    if \\n[#PRINT_STYLE]=2 \{\
5331 .       PRINT "\v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em
5332 .    \}
5333 .END
5335 \# ====================================================================
5337 \# +++HEADERS/FOOTERS+++
5339 \# Define a string so that the current page number can be incorporated
5340 \# into the strings for hdrftr left, right, and center.  NOTE: This is
5341 \# not the same thing as using the shortform # in hdrftr strings.
5343 .ds PAGE# \En[#PAGENUMBER]
5346 \# HDRFTR FAMILY
5347 \# -------------
5348 \# *Argument:
5349 \#   <family to use in header/footers>
5350 \# *Function:
5351 \#   Creates or modifies string $HDRFTR_FAM.
5352 \# *Notes:
5353 \#   Default is same as running text.
5355 .MAC HDRFTR_FAMILY END
5356 .    ds $HDRFTR_FAM \\$1
5357 .END
5360 \# HDRFTR SIZE
5361 \# -----------
5362 \# *Argument:
5363 \#   <+|-number of points by which to in/decrease point size of
5364 \#   header/footers (relative to running text)>
5365 \# *Function:
5366 \#   Creates or modifies string $HDRFTR_SIZE_CHANGE.
5367 \# *Notes:
5368 \#   Must be preceded by a +|- sign.  No space afterwards.
5369 \#   Fractional point sizes are allowed.  Default is +0.
5371 \#   By default, header/footers print the author .5 points smaller
5372 \#   than the base point size of running text, center titles
5373 \#   (Chapter, Draft, Revision, etc.)  .5 points smaller
5374 \#   than running text (in italics), and the document title 2 full
5375 \#   points smaller than running text (in caps).  The HDRFTR_SIZE
5376 \#   macro changes the overall size for all three parts while
5377 \#   maintaining the internal size changes.
5379 \#   In other words, if the user likes the header/footers but wants
5380 \#   them a bit bigger or a bit smaller, s/he should use HDRFTR_SIZE.
5382 .MAC HDRFTR_SIZE END
5383 .    ds $HDRFTR_SIZE_CHANGE \\$1
5384 .END
5387 \# HDRFTR RULE GAP
5388 \# ---------------
5389 \# *Argument:
5390 \#   <amount of space between header/footer and header/footer rule>
5391 \# *Function:
5392 \#   Creates or modifies register #HDRFTR_RULE_GAP to hold amount
5393 \#   of space between header/footer and header/footer rule.
5394 \# *Notes:
5395 \#   Default is 4p.
5397 .MAC HDRFTR_RULE_GAP END
5398 .    nr #HDRFTR_RULE_GAP (\\$1)
5399 .END
5402 \# HDRFTR LEFT
5403 \# -----------
5404 \# *Argument:
5405 \#   <what to put in the left position of page header/footers>
5406 \# *Function:
5407 \#   Creates or modifies string $HDRFTR_LEFT.
5408 \#   Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
5409 \#   overrides the $HDRFTR_LEFT string created by default
5410 \#   in DEFAULTS.
5411 \# *Notes:
5412 \#   Especially useful if doc has more than one author, and a list
5413 \#   of authors by last name is desired in header/footers.
5414 \#   Default is author.
5416 \#   If the argument is the # character, simply prints the current
5417 \#   page number.
5419 \#   If the user wants to *incorporate* the page number into the string,
5420 \#   \*[PAGE#] must be used.  For example, if the user wants to put
5421 \#   an elipsis before the page number in the string, s/he should use
5422 \#   ...\*[PAGE#], not ...#
5424 .MAC HDRFTR_LEFT END
5425 .    nr #USER_DEF_HDRFTR_LEFT 1
5426 .    ds $HDRFTR_LEFT \\$1
5427 .END
5430 \# HDRFTR LEFT FAMILY
5431 \# ------------------
5432 \# *Argument:
5433 \#   <family of header/footer left string>
5434 \# *Function:
5435 \#   Creates or modifies string $HDRFTR_LEFT_FAM.
5437 .MAC HDRFTR_LEFT_FAMILY END
5438 .    ds $HDRFTR_LEFT_FAM \\$1
5439 .END
5442 \# HDRFTR LEFT FONT
5443 \# ----------------
5444 \# *Argument:
5445 \#   <font of header/footer left string>
5446 \# *Function:
5447 \#   Creates or modifies string $HDRFTR_LEFT_FT.
5449 .MAC HDRFTR_LEFT_FONT END
5450 .    ds $HDRFTR_LEFT_FT \\$1
5451 .END
5454 \# HDRFTR LEFT SIZE
5455 \# ----------------
5456 \# *Argument:
5457 \#   <+|- number of points to in/decrease size of left string in
5458 \#   header/footers (relative to running text)>
5459 \# *Function:
5460 \#   Creates or modifies string HDRFTR_LEFT_SIZE_CHANGE.
5461 \# *Notes:
5462 \#   Must be preceded by a +|- sign.  No space afterwards.
5463 \#   Fractional point sizes are allowed.
5464 \#   Default is -.5 for printstyle TYPESET; if all caps, -2
5465 \#   Has no effect in TYPEWRITE.
5467 .MAC HDRFTR_LEFT_SIZE END
5468 .    ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5469 .END
5472 \# HDRFTR LEFT CAPS
5473 \# ----------------
5474 \# *Argument:
5475 \#   <none> | <anything>
5476 \# *Function:
5477 \#   Turns capitalisation of $HDRFTR_LEFT (typically, the author of
5478 \#   the document) on or off.
5479 \# *Notes:
5480 \#   Default is on.
5482 .MAC HDRFTR_LEFT_CAPS END
5483 .    ie '\\$1'' \{\
5484 .        nr #HDRFTR_LEFT_CAPS 1
5485 .    \}
5486 .    el \{\
5487 .       nr #HDRFTR_LEFT_CAPS 0
5488 .       ds $HDRFTR_RIGHT_SIZE_CHANGE +0
5489 .    \}
5490 .END
5493 \# HDRFTR CENTER
5494 \# -------------
5495 \# *Argument:
5496 \#   <what to put in the centre position of page header/footers>
5497 \# *Function:
5498 \#   Creates or modifies string $HDRFTR_CENTER.
5499 \#   Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
5500 \#   overrides the $HDRFTR_CENTER string created by default
5501 \#   in COPYSTYLE.
5502 \# *Notes:
5503 \#   Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
5504 \#   CHAPTER, draft and revision number if COPYSTYLE DRAFT.
5506 \#   If the argument is the # character, simply prints the current
5507 \#   page number.
5509 \#   If the user wants to *incorporate* the page number into the string,
5510 \#   \*[PAGE#] must be used.  For example, if the user wants to put
5511 \#   an elipsis before the page number in the string, s/he should use
5512 \#   ...\*[PAGE#], not ...#
5514 .MAC HDRFTR_CENTER END
5515 .    nr #USER_DEF_HDRFTR_CENTER 1
5516 .    if '\\$0'FOOTER_CENTER' \{\
5517 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
5518 .       ds $HDRFTR_CENTER_NEW \\$1
5519 .    \}
5520 .    if '\\$0'FOOTER_CENTRE' \{\
5521 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
5522 .       ds $HDRFTR_CENTER_NEW \\$1
5523 .    \}
5524 .    ds $HDRFTR_CENTER \\$1
5525 .END
5528 \# HDRFTR CENTER FAMILY
5529 \# --------------------
5530 \# *Argument:
5531 \#   <family of header/footer center string>
5532 \# *Function:
5533 \#   Creates or modifies string $HDRFTR_CENTER_FAM.
5535 .MAC HDRFTR_CENTER_FAMILY END
5536 .    ds $HDRFTR_CENTER_FAM \\$1
5537 .END
5540 \# HDRFTR CENTER FONT
5541 \# ------------------
5542 \# *Argument:
5543 \#   <font of header/footer center string>
5544 \# *Function:
5545 \#   Creates or modifies string $HDRFTR_CENTER_FT.
5547 .MAC HDRFTR_CENTER_FONT END
5548 .    ds $HDRFTR_CENTER_FT \\$1
5549 .END
5552 \# HDRFTR CENTER SIZE
5553 \# ------------------
5554 \# *Argument:
5555 \#   <+|- number of points to in/decrease size of centre string in
5556 \#   header/footers (relative to header/footer size)>
5557 \# *Function:
5558 \#   Creates string HDRFTR_CENTER_SIZE_CHANGE.
5559 \# *Notes:
5560 \#   Must be preceded by a +|- sign.  No space afterwards.
5561 \#   Fractional point sizes are allowed.
5562 \#   Default is -.5 for printstyle TYPESET; if all caps, -2
5563 \#   Has no effect in TYPEWRITE.
5565 .MAC HDRFTR_CENTER_SIZE END
5566 .    ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
5567 .END
5570 \# HDRFTR CENTER CAPS
5571 \# ------------------
5572 \# *Argument:
5573 \#   <none> | <anything>
5574 \# *Function:
5575 \#   Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
5576 \#   the document) on or off.
5577 \# *Notes:
5578 \#   Default is on.
5580 .MAC HDRFTR_CENTER_CAPS END
5581 .    ie '\\$1'' \{\
5582 .       nr #HDRFTR_CENTER_CAPS 1
5583 .    \}
5584 .    el \{\
5585 .       nr #HDRFTR_CENTER_CAPS 0
5586 .       ds $HDRFTR_CENTER_SIZE_CHANGE +0
5587 .    \}
5588 .END
5591 \# HDRFTR CENTER PADDING
5592 \# ---------------------
5593 \# *Argument:
5594 \#   LEFT | RIGHT <amount of padding to put left or right of hdrftr
5595 \#   center string>
5596 \# *Function:
5597 \#   Creates or modifies registers #HDRFTR_CTR_PAD_LEFT or
5598 \#   #HDRFTR_CTR_PAD_RIGHT.
5599 \# *Notes:
5600 \#   By default, the HDRFTR_CENTER string is centered on the doc
5601 \#   line length.  Long titles or long author names can screw up
5602 \#   visual centering, or create overprints.  This macro allows the
5603 \#   user to pad the center string by the specified amount of space
5604 \#   to fix these problems.  Use only one of LEFT or RIGHT.
5606 \#   A unit of measure is required.
5608 .MAC HDRFTR_CENTER_PAD END
5609 .    if '\\$1'LEFT' \{\
5610 .       nr #HDRFTR_CTR_PAD_LEFT (\\$2)
5611 .    \}
5612 .    if '\\$1'RIGHT' \{\
5613 .       nr #HDRFTR_CTR_PAD_RIGHT (\\$2)
5614 .    \}
5615 .END
5618 \# SWITCH HDRFTR CENTER PADDING SIDE - support macro
5619 \# --------------------------------
5620 \# *Argument:
5621 \#   <none>
5622 \# *Function:
5623 \#   Switches the padding side of hdrftr center padding.
5624 \# *Notes:
5625 \#   Required to keep spacing around hdrftr string constant
5626 \#   in recto/verso documents.
5628 .MAC SWITCH_HDRFTR_CENTER_PAD END
5629 .    nr #HDRFTR_CTR_PAD_TMP  \\n[#HDRFTR_CTR_PAD_LEFT]
5630 .    HDRFTR_CENTER_PAD LEFT  \\n[#HDRFTR_CTR_PAD_RIGHT]u
5631 .    HDRFTR_CENTER_PAD RIGHT \\n[#HDRFTR_CTR_PAD_TMP]u
5632 .END
5635 \# HDRFTR RIGHT
5636 \# ------------
5637 \# *Argument:
5638 \#   <what to put in the right position of page header/footers>
5639 \# *Function:
5640 \#   Creates or modifies string $HDRFTR_RIGHT.
5641 \#   Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
5642 \#   overrides the $HDRFTR_RIGHT string created by default
5643 \#   in DEFAULTS.
5644 \# *Notes:
5645 \#   Default is document title.
5647 \#   If the argument is the # character, simply prints the current
5648 \#   page number.
5650 \#   If the user wants to *incorporate* the page number into the string,
5651 \#   \*[PAGE#] must be used.  For example, if the user wants to put
5652 \#   an elipsis before the page number in the string, s/he should use
5653 \#   ...\*[PAGE#], not ...#
5655 .MAC HDRFTR_RIGHT END
5656 .    nr #USER_DEF_HDRFTR_RIGHT 1
5657 .    ds $HDRFTR_RIGHT \\$1
5658 .END
5661 \# HDRFTR RIGHT FAMILY
5662 \# -------------------
5663 \# *Argument:
5664 \#   <family of header/footer right string>
5665 \# *Function:
5666 \#   Creates or modifies string $HDRFTR_RIGHT_FAM.
5668 .MAC HDRFTR_RIGHT_FAMILY END
5669 .    ds $HDRFTR_RIGHT_FAM \\$1
5670 .END
5673 \# HDRFTR RIGHT FONT
5674 \# -----------------
5675 \# *Argument:
5676 \#   <font of header/footer right string>
5677 \# *Function:
5678 \#   Creates or modifies string $HDRFTR_RIGHT_FT.
5680 .MAC HDRFTR_RIGHT_FONT END
5681 .    ds $HDRFTR_RIGHT_FT \\$1
5682 .END
5685 \# HDRFTR RIGHT SIZE
5686 \# -----------------
5687 \# *Argument:
5688 \#   <+|- number of points to in/decrease size of right string in
5689 \#   header/footers (relative to header/footer size)>
5690 \# *Function:
5691 \#   Creates or modifies string HDRFTR_RIGHT_SIZE_CHANGE.
5692 \# *Notes:
5693 \#   Must be preceded by a +|- sign.  No space afterwards.
5694 \#   Fractional point sizes are allowed.
5695 \#   Default is -2 for printstyle TYPESET if all caps; otherwise -.5
5696 \#   Has no effect in TYPEWRITE.
5698 .MAC HDRFTR_RIGHT_SIZE END
5699 .    ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
5700 .END
5703 \# HDRFTR RIGHT CAPS
5704 \# -----------------
5705 \# *Argument:
5706 \#   <none> | <anything>
5707 \# *Function:
5708 \#   Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
5709 \#   the document) on or off.
5710 \# *Notes:
5711 \#   Default is on.
5713 .MAC HDRFTR_RIGHT_CAPS END
5714 .    ie '\\$1'' \{\
5715 .       nr #HDRFTR_RIGHT_CAPS 1
5716 .    \}
5717 .    el \{\
5718 .       nr #HDRFTR_RIGHT_CAPS 0
5719 .       ds $HDRFTR_RIGHT_SIZE_CHANGE +0
5720 .    \}
5721 .END
5723 \# HDRFTR RULE
5724 \# -----------
5725 \# *Arguments:
5726 \#   <none> | <anything>
5727 \# *Function:
5728 \#   If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
5729 \#   under the header/footer.  Otherwise, turns HDRFTR_RULE on or off.
5731 .MAC HDRFTR_RULE END   \"To print rule under header/over footer.
5732 .    ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
5733 .       ie \\n[#USERDEF_HDRFTR] \{\
5734 .          nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
5735 .          PT_SIZE 12
5736 .          if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
5737 .          if \\n[#FOOTERS_ON] \{\
5738 .              RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
5739 .          \}
5740 .          PRINT \\l'\\n[#DOC_L_LENGTH]u'
5741 .          br
5742 .       \}
5743 .       el \{\
5744 .          if \\n[#PRINT_STYLE]=1 \{\
5745 .             nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
5746 .          \}
5747 .          if \\n[#PRINT_STYLE]=2 \{\
5748 .             ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
5749 .                nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
5750 .             \}
5751 .             el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
5752 .             ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
5753 .                nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
5754 .             \}
5755 .             el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
5756 .          \}
5757 .          PT_SIZE 12
5758 .          if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
5759 .          if \\n[#FOOTERS_ON] \{\
5760 .             RLD \\n[#LEAD]u*3u+\\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
5761 .          \}
5762 .          PRINT \\l'\\n[#DOC_L_LENGTH]u'
5763 .          br
5764 .       \}
5765 .    \}
5766 .    el \{\
5767 .       ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
5768 .       el \{ .nr #HDRFTR_RULE 0 \}
5769 .    \}
5770 .END
5773 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
5776 \# HDRFTR PLAIN
5777 \# ------------
5778 \# *Arguments:
5779 \#   <none>
5780 \# *Function:
5781 \#   Sets the family, font, and point size of all strings in
5782 \#   header/footers to the same family and point size as running
5783 \#   text.  Font for the header/footer becomes roman throughout.
5785 .MAC HDRFTR_PLAIN END
5786 .    HDRFTR_FAMILY        \\*[$DOC_FAM]
5787 .    HDRFTR_PT_SIZE       \\n[#DOC_PT_SIZE]
5788 .    HDRFTR_LEFT_FAMILY   \\*[$DOC_FAM]
5789 .    HDRFTR_LEFT_FONT     R
5790 .    HDRFTR_LEFT_SIZE     +0
5791 .    HDRFTR_LEFT_CAPS     OFF
5792 .    HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
5793 .    HDRFTR_CENTER_FONT   R
5794 .    HDRFTR_CENTER_SIZE   +0
5795 .    HDRFTR_CENTER_CAPS   OFF
5796 .    HDRFTR_RIGHT_FAMILY  \\*[$DOC_FAM]
5797 .    HDRFTR_RIGHT_FONT    R
5798 .    HDRFTR_RIGHT_SIZE    +0
5799 .    HDRFTR_RIGHT_CAPS    OFF
5800 .END
5803 \# SWITCH HDRFTR
5804 \# -------------
5805 \# *Arguments:
5806 \#   <none> | <anything>
5807 \# *Function:
5808 \#   Creates or modifies register #SWITCH_HDRFTR, used to switch
5809 \#   default location of HDRFTR_LEFT and HDRFTR_RIGHT.
5810 \# *Notes:
5811 \#   Typically, the author string appears at the left of header/footers,
5812 \#   and the title string appears at the right.  This switches the
5813 \#   location of the two.  Useful in conjuction with RECTO_VERSO to
5814 \#   tweak switches on alternate pages to come out as the user wishes.
5815 \#   The assumption of RECTO_VERSO is that the first page of the document
5816 \#   (recto) is odd, and even though it has no header/footer, if it did have one,
5817 \#   it would print as AUTHOR...CENTER...TITLE (or whatever strings
5818 \#   the user has supplied for HDRFTR_LEFT/RIGHT), meaning that the
5819 \#   next page, which does have a header/footer, will come out as
5820 \#   TITLE...CENTER...AUTHOR (or whatever strings the user has
5821 \#   supplied for HDRFTR_LEFT/RIGHT).  SWITCH_HDRFTRS allows the user
5822 \#   to get the desired string in the desired place on the desired
5823 \#   recto/verso page.
5825 \#   Default is OFF.
5827 .MAC SWITCH_HDRFTR END
5828 .    ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
5829 .    el \{ .nr #SWITCH_HDRFTR 0 \}
5830 .END
5833 \# USER DEFINED HDRFTR RECTO
5834 \# -------------------------
5835 \# *Arguments:
5836 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
5837 \# *Function:
5838 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
5839 \#   stores string in $USERDEF_HDRFTR_RECTO.
5840 \# *Notes:
5841 \#   For use when users don't want 3-part headers/footers, but rather
5842 \#   want to design their own headers/footers and need different
5843 \#   headers/footers on recto and verso pages.
5845 .MAC HDRFTR_RECTO END
5846 .    nr #USERDEF_HDRFTR 1
5847 .    if '\\$1'L'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
5848 .    if '\\$1'LEFT'   \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
5849 .    if '\\$1'C'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5850 .    if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5851 .    if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5852 .    if '\\$1'R'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
5853 .    if '\\$1'RIGHT'  \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
5854 .    ds $USERDEF_HDRFTR_RECTO \\$2
5855 .END
5858 \# USER DEFINED HDRFTR VERSO
5859 \# -------------------------
5860 \# *Arguments:
5861 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
5862 \# *Function:
5863 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
5864 \#   stores string in $USERDEF_HDRFTR_VERSO.
5865 \# *Notes:
5866 \#   For use when users don't want 3-part headers/footers, but rather
5867 \#   want to design their own headers/footers and need different
5868 \#   headers/footers on recto and verso pages.
5870 .MAC HDRFTR_VERSO END
5871 .    nr #USERDEF_HDRFTR 1
5872 .    if '\\$1'L'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
5873 .    if '\\$1'LEFT'   \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
5874 .    if '\\$1'C'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5875 .    if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5876 .    if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5877 .    if '\\$1'R'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
5878 .    if '\\$1'RIGHT'  \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
5879 .    ds $USERDEF_HDRFTR_VERSO \\$2
5880 .END
5883 \# PRINT FOOTER ON FIRST PAGE
5884 \# --------------------------
5885 \# *Arguments:
5886 \#   <none> | <anything>
5887 \# *Function:
5888 \#   Toggles register #PRINT_FOOTER_ON_PAGE_1
5889 \# *Notes:
5890 \#   Lets user choose whether to print footer on first
5891 \#   page of doc.
5893 .MAC FOOTER_ON_FIRST_PAGE END
5894 .    ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
5895 .    el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
5896 .END
5899 \# PRINT PAGE NUMBER ON FIRST PAGE
5900 \# -------------------------------
5901 \# *Arguments:
5902 \#   <none> | <anything>
5903 \# *Function:
5904 \#   Toggles register #PRINT_PAGENUM_ON_PAGE_1
5905 \# *Notes:
5906 \#   Lets user choose whether to print page number on first
5907 \#   page of doc and after collate when footers are on or page numbering
5908 \#   has been user set at top of page.
5910 .MAC PAGENUM_ON_FIRST_PAGE END
5911 .    ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
5912 .    el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
5913 .END
5916 \# PRINT HEADER/FOOTER
5917 \# -------------------
5918 \# *Arguments:
5919 \#   <none>
5920 \# *Function:
5921 \#   Based on defaults or values entered by user, prints a
5922 \#   three-part title at either the top or the bottom of the page.
5923 \# *Notes:
5924 \#   Called from within either HEADER or FOOTER.
5926 .MAC PRINT_HDRFTR END
5927 .    if \\n[#DOC_TYPE]=4 \{\
5928 .       nr #SUITE \En[.pn]
5929 .    \}
5930 .    if \\n[#FOOTERS_ON] \{\
5931 .       if \\n[#START_FOR_FOOTERS] \{\
5932 .          rr #START_FOR_FOOTERS
5933 .          if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{ .return \}
5934 .       \}
5935 .    \}
5936 .    if \\n[#HEADERS_ON] \{ .vs 0 \}
5937 .    if \\n[#USERDEF_HDRFTR] \{\
5938 .       PRINT_USERDEF_HDRFTR
5939 .       return
5940 .    \}
5941 .    if \\n[#SWITCH_HDRFTR] \{\
5942 .       ds $HDRFTR_TMP_SWITCH             \\*[$HDRFTR_LEFT]
5943 .       ds $HDRFTR_LEFT                   \\*[$HDRFTR_RIGHT]
5944 .       ds $HDRFTR_RIGHT                  \\*[$HDRFTR_TMP_SWITCH]
5945 .       ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
5946 .       ds $HDRFTR_LEFT_SIZE_CHANGE       \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
5947 .       ds $HDRFTR_RIGHT_SIZE_CHANGE      \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
5948 .       nr #HDRFTR_TMP_CAPS_SWITCH        \\n[#HDRFTR_LEFT_CAPS]
5949 .       nr #HDRFTR_LEFT_CAPS              \\n[#HDRFTR_RIGHT_CAPS]
5950 .       nr #HDRFTR_RIGHT_CAPS             \\n[#HDRFTR_TMP_CAPS_SWITCH]
5951 .       rr #HDRFTR_TMP_CAPS_SWITCH
5952 .       rm $HDRFTR_TMP_SWITCH
5953 .       rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
5954 .       nr #SWITCH_HDRFTR 0
5955 .    \}
5956 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
5957 .    if \\n[#ENDNOTES] \{ .PAGENUM_STYLE \\*[$EN_PN_STYLE] \}
5958 .    if \\n[#PRINT_STYLE]=1 \{\
5959 .       if \\n[#FOOTERS_ON] \{\
5960 .          di NULL
5961 .          SIZESPECS
5962 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
5963 .          di
5964 .       \}
5965 .       if o                        \{ .RIGHT \}
5966 .       if e                        \{ .LEFT  \}
5967 .       if \\n[#RECTO_VERSO]=0      \{ .LEFT  \}
5968 .       if \\n[#HDRFTR_LEFT_CAPS]   \{ .CAPS  \}
5969 .       ie '\\*[$HDRFTR_LEFT]'#' \{\
5970 .           PRINT \\n[#PAGENUMBER]
5971 .       \}
5972 .       el \{\
5973 .          ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
5974 .          el \{ .PRINT \& \}
5975 .       \}
5976 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
5977 .       CENTER
5978 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
5979 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
5980 .           PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
5981 .       \}
5982 .       el \{\
5983 .          ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
5984 .          el \{ .PRINT \& \}
5985 .       \}
5986 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
5987 .       if o                       \{ .LEFT  \}
5988 .       if e                       \{ .RIGHT \}
5989 .       if \\n[#RECTO_VERSO]=0     \{ .RIGHT \}
5990 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS  \}
5991 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
5992 .           PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
5993 .       \}
5994 .       el \{\
5995 .          ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
5996 .          el \{ .PRINT \& \}
5997 .       \}
5998 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
5999 .    \}
6000 .    if \\n[#PRINT_STYLE]=2 \{\
6001 .       FAMILY  \\*[$HDRFTR_LEFT_FAM]
6002 .       FT      \\*[$HDRFTR_LEFT_FT]
6003 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
6004 .       if \\n[#FOOTERS_ON] \{\
6005 .          di NULL
6006 .          SIZESPECS
6007 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6008 .          di
6009 .       \}
6010 .       if o                      \{ .LEFT  \}
6011 .       if e                      \{ .RIGHT \}
6012 .       if \\n[#RECTO_VERSO]=0    \{ .LEFT  \}
6013 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS  \}
6014 .       ie '\\*[$HDRFTR_LEFT]'#' \{ .PRINT \\n[#PAGENUMBER] \}
6015 .       el \{\
6016 .          ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
6017 .          el \{ .PRINT \& \}
6018 .       \}
6019 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
6020 .       FAMILY  \\*[$HDRFTR_CENTER_FAM]
6021 .       FT      \\*[$HDRFTR_CENTER_FT]
6022 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
6023 .       if \\n[#FOOTERS_ON] \{\
6024 .          di NULL
6025 .          SIZESPECS
6026 .          nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
6027 .          di
6028 .       \}
6029 .       CENTER
6030 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
6031 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
6032 .           PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\n[#PAGENUMBER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u'
6033 .       \}
6034 .       el \{\
6035 .          ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\h'\\n[#HDRFTR_CTR_PAD_LEFT]u'\\*[$HDRFTR_CENTER]\\h'\\n[#HDRFTR_CTR_PAD_RIGHT]u' \}
6036 .          el \{ .PRINT \& \}
6037 .       \}
6038 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
6039 .       FAMILY  \\*[$HDRFTR_RIGHT_FAM]
6040 .       FT      \\*[$HDRFTR_RIGHT_FT]
6041 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
6042 .       if \\n[#FOOTERS_ON] \{\
6043 .          di NULL
6044 .          SIZESPECS
6045 .          nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
6046 .          di
6047 .       \}
6048 .       if o                       \{ .RIGHT \}
6049 .       if e                       \{ .LEFT  \}
6050 .       if \\n[#RECTO_VERSO]=0     \{ .RIGHT \}
6051 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS  \}
6052 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
6053 .           PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
6054 .       \}
6055 .       el \{\
6056 .          ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
6057 .          el \{ .PRINT \& \}
6058 .       \}
6059 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
6060 .    \}
6061 .    if \\n[#HDRFTR_RULE] \{\
6062 .       HDRFTR_RULE_INTERNAL
6063 .    \}
6064 .END
6067 \# PRINT USER DEFINED HEADER/FOOTER
6068 \# --------------------------------
6069 \# *Arguments:
6070 \#   <none>
6071 \# *Function:
6072 \#   Based on defaults or values entered by user, prints a single part
6073 \#   (i.e. not 3-part) title at either the top or the bottom of the page.
6074 \# *Notes:
6075 \#   Called from within PRINT_HDRFTR.
6077 .MAC PRINT_USERDEF_HDRFTR END
6078 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
6079 .    fc ^ #
6080 .    if \\n[#PRINT_STYLE]=2 \{\
6081 .       FAMILY  \\*[$HDRFTR_FAM]
6082 .       FT      R
6083 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u
6084 .    \}
6085 .    ie \\n[#RECTO_VERSO] \{\
6086 .       if o \{\
6087 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
6088 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6089 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
6090 .          PRINT \\*[$USERDEF_HDRFTR_RECTO]
6091 .          EL
6092 .          if \\n[#FOOTERS_ON] \{\
6093 .             di NULL
6094 .             SIZESPECS
6095 .             nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6096 .             di
6097 .          \}
6098 .       \}
6099 .       if e \{\
6100 .          ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
6101 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT   \}
6102 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
6103 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT  \}
6104 .          \}
6105 .          PRINT \\*[$USERDEF_HDRFTR_VERSO]
6106 .          EL
6107 .          if \\n[#FOOTERS_ON] \{\
6108 .             di NULL
6109 .             SIZESPECS
6110 .             nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6111 .             di
6112 .          \}
6113 .          el \{\
6114 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
6115 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6116 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
6117 .             PRINT \\*[$USERDEF_HDRFTR_RECTO]
6118 .             EL
6119 .             if \\n[#FOOTERS_ON] \{\
6120 .                di NULL
6121 .                SIZESPECS
6122 .                nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6123 .                di
6124 .             \}
6125 .          \}
6126 .       \}
6127 .    \}
6128 .    el \{\
6129 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
6130 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
6131 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
6132 .       PRINT \\*[$USERDEF_HDRFTR_RECTO]
6133 .       EL
6134 .       if \\n[#FOOTERS_ON] \{\
6135 .          di NULL
6136 .          SIZESPECS
6137 .          nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
6138 .          di
6139 .       \}
6140 .    \}
6141 .    fc
6142 .    if \\n[#HDRFTR_RULE] \{\
6143 .       HDRFTR_RULE_INTERNAL
6144 .    \}
6145 .END
6148 \# +++HEADERS+++
6150 \# HEADERS (off or on)
6151 \# -------------------
6152 \# *Arguments:
6153 \#   <none> | <anything>
6154 \# *Function:
6155 \#   Turns headers at the top of the page off or on.
6156 \# *Notes:
6157 \#   Default is on.
6159 .MAC HEADERS END
6160 .    ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
6161 .    el \{ .nr #HEADERS_ON 0 \}
6162 .END
6165 \# HEADER MARGIN
6166 \# -------------
6167 \# *Argument:
6168 \#   <amount of space between top of page and header>
6169 \# *Function:
6170 \#   Creates or modifies register #HEADER_MARGIN to hold amount
6171 \#   of space between top of page and header.
6172 \# *Notes:
6173 \#   Requires unit of measure.  Default is 4P+6p, measured top-of-page
6174 \#   to baseline.
6176 .MAC HEADER_MARGIN END
6177 .    nr #HEADER_MARGIN (\\$1)
6178 .END
6181 \# HEADER GAP
6182 \# ----------
6183 \# *Argument:
6184 \#   <amount of space between header and running text>
6185 \# *Function:
6186 \#   Creates or modifies register #HEADER_GAP to hold amount
6187 \#   of space between header and running text.
6188 \# *Notes:
6189 \#   Default is 1P+6p.
6191 .MAC HEADER_GAP END
6192 .    nr #HEADER_GAP (\\$1)
6193 .END
6196 \# HEADER
6197 \# ------
6198 \# *Arguments:
6199 \#   <none>
6200 \# *Function:
6201 \#   Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
6202 \# *Notes:
6203 \#   In order to convert the title string to caps in the header (in the
6204 \#   event that the user enters .TITLE in caps/lc), I've used
6205 \#   quad left, quad centre, and quad right to arrange the three bits
6206 \#   of the header, rather than .tl.  This allows the use of the CAPS macro.
6207 \#   The downside is that I have to add \\v'-(\\n[#LEAD]u*#) in order
6208 \#   for -Tlatin1 output to align the header/footer strings on the baseline.
6209 \#   The console output still isn't brilliant, but at least it's
6210 \#   comprehensible.
6212 .MAC HEADER END
6213 .    PROCESS_FN_LEFTOVER
6214 .    nr #FN_COUNT_FOR_COLS 0 1
6215 .    if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
6216 .    po \\n[#DOC_L_MARGIN]u
6217 .    if \\n[#RECTO_VERSO] \{\
6218 .       if !\\n[#TOC_RV_SWITCH] \{\
6219 .          nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
6220 .          DOC_LEFT_MARGIN  \\n[#DOC_R_MARGIN]u
6221 .          DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
6222 .          SWITCH_HDRFTR_CENTER_PAD
6223 .       \}
6224 .       rr #TOC_RV_SWITCH
6225 .    \}
6226 .    ev HEADER
6227 .    if \\n[#PRINT_STYLE]=1 \{ .vs 0 \}
6228 .    if \\n[#PRINT_STYLE]=2 \{ .LS 0 \}
6229 .    sp |\\n[#HEADER_MARGIN]u-1v
6230 .    ll \\n[#DOC_L_LENGTH]u
6231 .    ta \\n(.lu
6232 .    if \\n[#PRINT_STYLE]=2 \{\
6233 .      FAMILY  \\*[$HDRFTR_FAM]
6234 .      FT      R
6235 .      PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
6236 .    \}
6237 .    if \\n[#PRINT_STYLE]=1 \{\
6238 .       fam C
6239 .       ft  R
6240 .       ps  12\\*[$HDRFTR_SIZE_CHANGE]
6241 .    \}
6242 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
6243 .    if \\n[#CAPS_ON] \{\
6244 .       nr #CAPS_WAS_ON 1
6245 .       CAPS OFF
6246 .    \}
6247 .    if \\n[#UNDERLINE_ON] \{\
6248 .       nr #UNDERLINE_WAS_ON 1
6249 .       UNDERLINE OFF
6250 .    \}
6251 .    ie \\n[#HEADERS_ON] \{\
6252 .       PRINT_HDRFTR
6253 .       sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
6254 .    \}
6255 .    el \{\
6256 .       ie \\n[#PAGE_NUM_V_POS]=1 \{\
6257 .          ie \\n[#PAGINATE] \{\
6258 .             PRINT_PAGE_NUMBER
6259 .             sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
6260 .          \}
6261 .          el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
6262 .       \}
6263 .       el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
6264 .    \}
6265 .    nr #PAGE_TOP \\n(nl
6266 .    ev
6267 .    po \\n[#L_MARGIN]u
6268 .    if \\n[#RECTO_VERSO] \{\
6269 .       nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
6270 .    \}
6271 .    if \\n[#CAPS_WAS_ON] \{\
6272 .       CAPS
6273 .       rr #CAPS_WAS_ON
6274 .    \}
6275 .    if \\n[#UNDERLINE_WAS_ON] \{\
6276 .       UNDERLINE
6277 .       rr #UNDERLINE_WAS_ON
6278 .    \}
6279 .    if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6280 .    if \\n[#QUOTE] \{\
6281 .       ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6282 .       el \{\
6283 .          nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
6284 .          po \\n[#Q_OFFSET]u
6285 .       \}
6286 .    \}
6287 .    if \\n[#EPIGRAPH] \{\
6288 .       ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
6289 .       el \{\
6290 .          nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6291 .          po \\n[#EPI_OFFSET]u
6292 .       \}
6293 .    \}
6294 .    ie \\n[#EPIGRAPH] \{\
6295 .       ie !\\n[#EPI_ACTIVE] \{\
6296 .          ns
6297 .          rr #EPI_ACTIVE
6298 .       \}
6299 .       el \{\
6300 .          ie \\n[#EPI_FITS] \{ .ns \}
6301 .          el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
6302 .          \}
6303 .    \}
6304 .    el \{ .ns \}
6305 .    ns
6306 .    if \\n[#COLUMNS] \{\
6307 .       if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
6308 .       nr #COL_NUM 0 1
6309 .       mk dc
6310 .       po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6311 .       ll \\n[#COL_L_LENGTH]u
6312 .       ta \\n(.lu
6313 .       if \\n[#QUOTE] \{\
6314 .          po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
6315 .       \}
6316 .       if \\n[#EPIGRAPH] \{\
6317 .          if \\n[#EPI_ACTIVE] \{\
6318 .             ie \\n[#EPI_FITS] \{ . \}
6319 .             el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
6320 .          \}
6321 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
6322 .       \}
6323 .    \}
6324 .    if \\n[#PRINT_STYLE]=1 \{\
6325 .       if \\n[#SLANT_ON] \{\
6326 .          if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
6327 .       \}
6328 .    \}
6329 .END
6331 \# ====================================================================
6333 \# +++FOOTERS+++
6335 \# FOOTERS (off or on)
6336 \# -------------------
6337 \# *Arguments:
6338 \#   <none> | <anything>
6339 \# *Function:
6340 \#   Turns footers at the bottom of the page off or on.
6341 \# *Notes:
6342 \#   Default is off.  If on, page numbers automatically go at
6343 \#   the top, centered, unless pagination has been turned off,
6344 \#   or the pagenumber position has been changed to left or right.
6346 .MAC FOOTERS END
6347 .    ie '\\$1''   \{\
6348 .       nr #FOOTERS_ON 1
6349 .       PAGE_NUM_POS TOP CENTER
6350 .    \}
6351 .    el \{ .nr #FOOTERS_ON 0 \}
6352 .END
6355 \# FOOTER MARGIN
6356 \# -------------
6357 \# *Argument:
6358 \#   <footer margin>
6359 \# *Function:
6360 \#   Creates or modifies register #FOOTER_MARGIN which holds the
6361 \#   amount of space to leave between the page number and the bottom
6362 \#   of the page.
6363 \# *Notes:
6364 \#   Unit of measure required.  Default is 3P.
6366 .MAC FOOTER_MARGIN END
6367 .    ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
6368 .    el \{ . \}
6369 .END
6372 \# FOOTER GAP
6373 \# ----------
6374 \# *Argument:
6375 \#   <distance from end of running text to page # or footer>
6376 \# *Function:
6377 \#   Creates or modifies register #FOOTER_GAP which holds the
6378 \#   amount of space to leave between running text and the page number.
6379 \# *Notes:
6380 \#   Requires unit of measure.  Default is 3P.  Measured baseline to
6381 \#   baseline.
6383 .MAC FOOTER_GAP END
6384 .    ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
6385 .    el \{ . \}
6386 .END
6389 \# FOOTER
6390 \# ------
6391 \# *Arguments:
6392 \#   <none>
6393 \# *Function:
6394 \#   Places footer at bottom of page if #FOOTERS=1, otherwise
6395 \#   places page number at bottom of page (if #PAGINATE=1).
6396 \#   Page numbers are in arabic or roman according to COPYSTYLE.
6397 \#   DRAFT starts the document at page 1 regardless of PAGENUMBER.
6398 \#   FINAL respects PAGENUMBER.
6400 .MAC FOOTER END
6401 .    ev PAGE_BOTTOM
6402 .    if \\n[#START]=1 \{\
6403 .       ev
6404 .       return
6405 .    \}
6406 .    nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
6407 .    if !\\n[#FN_DEFER] \{\
6408 .       nr #DIVER_DEPTH 0
6409 .       if \\n[#FN_COUNT] \{\
6410 .          sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u)
6411 .          po \\n[#DOC_L_MARGIN]u
6412 .          if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
6413 .          nf
6414 .          FOOTNOTES
6415 .          rm FOOTNOTES
6416 .          if '\\n(.z'FN_OVERFLOW' \{\
6417 .              di
6418 .              nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
6419 .          \}
6420 .          nr #FN_COUNT 0
6421 .          if \\n[#COL_NEXT] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
6422 .       \}
6423 .    \}
6424 .    ie \\n[#COLUMNS] \{\
6425 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
6426 .       el \{\
6427 .          ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
6428 .          el \{ .sp |\\n(dcu \}
6429 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6430 .          PROCESS_FN_LEFTOVER
6431 .          if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
6432 .          if !\\n[#QUOTE]    \{ .rr #COL_NEXT \}
6433 .          if \\n[#QUOTE] \{\
6434 .             nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
6435 .             if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
6436 .             po \\n[#Q_OFFSET]u
6437 .          \}
6438 .          if \\n[#EPIGRAPH] \{\
6439 .             nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6440 .             if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
6441 .             po \\n[#EPI_OFFSET]u
6442 .          \}
6443 .          ie \\n[#EPIGRAPH] \{\
6444 .             ie !\\n[#EPI_ACTIVE] \{\
6445 .                ns
6446 .                rr #EPI_ACTIVE
6447 .             \}
6448 .             el \{\
6449 .                sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
6450 .                rr #EPI_ACTIVE
6451 .             \}
6452 .          \}
6453 .          el \{ .ns \}
6454 .          ev
6455 .       \}
6456 .       ns
6457 .    \}
6458 .    el \{ .DO_FOOTER \}
6459 .END
6462 \# PROCESS FOOTER
6463 \# --------------
6464 \# *Arguments:
6465 \#   <none>
6466 \# *Function:
6467 \#   Prints footer (page number, or 3-part footer).
6468 \#   Resets CAPS and UNDERLINE if they were on.
6470 .MAC DO_FOOTER END
6471 .    sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
6472 .    ev FOOTER
6473 .    po \\n[#DOC_L_MARGIN]u
6474 .    ll \\n[#DOC_L_LENGTH]u
6475 .    ta \\n(.lu
6476 .    FAMILY  \\*[$HDRFTR_FAM]
6477 .    FT      R
6478 .    PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
6479 .    if \\n[#PRINT_STYLE]=1 \{\
6480 .       fam C
6481 .       ft  R
6482 .       ps  12
6483 .    \}
6484 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
6485 .    if \\n[#CAPS_ON] \{\
6486 .       nr #CAPS_WAS_ON 1
6487 .       CAPS OFF
6488 .    \}
6489 .    if \\n[#UNDERLINE_ON] \{\
6490 .       nr #UNDERLINE_WAS_ON 1
6491 .       UNDERLINE OFF
6492 .    \}
6493 .    ie \\n[#FOOTERS_ON] \{\
6494 .       PRINT_HDRFTR
6495 .    \}
6496 .    el \{\
6497 .       if \\n[#PAGINATE] \{\
6498 .          if \\n[#PAGE_NUM_V_POS]=2 \{ .PRINT_PAGE_NUMBER \}
6499 .       \}
6500 .    \}
6501 .    if \\n[#CAPS_WAS_ON] \{\
6502 .       CAPS
6503 .       rr #CAPS_WAS_ON
6504 .    \}
6505 .    if \\n[#UNDERLINE_WAS_ON] \{\
6506 .       UNDERLINE
6507 .       rr #UNDERLINE_WAS_ON
6508 .    \}
6509 .    ev
6510 .    bp
6511 .    ev
6512 .END
6514 \# ====================================================================
6516 \# +++HEADS+++
6518 \# ---Head numbers---
6520 \# NUMBER HEADS
6521 \# ------------
6522 \# *Arguments:
6523 \#   <none> | <anything>
6524 \# *Function:
6525 \#   Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
6526 \# *Notes:
6527 \#   Default is OFF.
6529 .MAC NUMBER_HEADS END
6530 .    ie '\\$1'' \{\
6531 .       nr #NUMBER_HEAD 1
6532 .       if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
6533 .    \}
6534 .    el \{ .rr #NUMBER_HEAD \}
6535 .END
6538 \# RESET HEAD NUMBER
6539 \# -----------------
6540 \# *Arguments:
6541 \#   <none> | <desired head number>
6542 \# *Function:
6543 \#   Resets incrementing register #HEAD_NUM to 1 or, if there's
6544 \#   an argument, to user supplied number.
6545 \# *Notes:
6546 \#   Also resets subhead and parahead numbers.  If this is not
6547 \#   desired, subhead and parahead numbers may be reset individually.
6549 .MAC RESET_HEAD_NUMBER END
6550 .    ie '\\$1'' \{\
6551 .       nr #HEAD_NUM 0 1
6552 .       nr #SH_NUM   0 1
6553 .       nr #PH_NUM   0 1
6554 .    \}
6555 .    el \{\
6556 .       nr #HEAD_NUM \\$1-1 1
6557 .       nr #SH_NUM   0 1
6558 .       nr #PH_NUM   0 1
6559 .    \}
6560 .END
6563 \# NUMBER SUBHEADS
6564 \# ---------------
6565 \# *Arguments:
6566 \#   <none> | <anything>
6567 \# *Function:
6568 \#   Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
6569 \# *Notes:
6570 \#   Default is OFF.
6572 .MAC NUMBER_SUBHEADS END
6573 .    ie '\\$1'' \{\
6574 .       nr #NUMBER_SH 1
6575 .       if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
6576 .    \}
6577 .    el \{ .rr #NUMBER_SH \}
6578 .END
6581 \# RESET SUBHEAD NUMBER
6582 \# --------------------
6583 \# *Arguments:
6584 \#   <none> | <desired subhead number>
6585 \# *Function:
6586 \#   Resets incrementing register #SH_NUM to 1 or, if there's
6587 \#   an argument, to user supplied number.
6588 \# *Notes:
6589 \#   When the subhead number is reset, it resets the parahead number as
6590 \#   well.  If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
6591 \#   allows the user to set the parahead number to whatever s/he desires.
6593 .MAC RESET_SUBHEAD_NUMBER END
6594 .    ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
6595 .    el \{\
6596 .       nr #SH_NUM \\$1-1 1
6597 .       nr #PH_NUM 0 1
6598 .       \}
6599 .END
6602 \# NUMBER PARAHEADS
6603 \# ----------------
6604 \# *Arguments:
6605 \#   <none> | <anything>
6606 \# *Function:
6607 \#   Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
6608 \# *Notes:
6609 \#   Default is OFF.
6611 .MAC NUMBER_PARAHEADS END
6612 .    ie '\\$1'' \{\
6613 .       nr #NUMBER_PH 1
6614 .       if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
6615 .    \}
6616 .    el \{ .rr #NUMBER_PH \}
6617 .END
6620 \# RESET PARAHEAD NUMBER
6621 \# ---------------------
6622 \# *Arguments:
6623 \#   <none> | <desired parahead number>
6624 \# *Function:
6625 \#   Resets incrementing register #PH_NUM to 1 or, if there's
6626 \#   an argument, to user supplied number.
6627 \# *Notes:
6628 \#   Resetting the parahead number resets the parahead number
6629 \#   only.
6631 .MAC RESET_PARAHEAD_NUMBER END
6632 .    ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
6633 .    el \{ nr #SH_NUM \\$1-1 1 \}
6634 .END
6637 \# ---Main heads---
6639 \# HEAD FAMILY
6640 \# -----------
6641 \# *Argument:
6642 \#   <family to use for section titles (main heads)>
6643 \# *Function:
6644 \#   Creates or modifies string $HEAD_FAM.
6645 \# *Notes:
6646 \#   Default is same as running text.
6648 .MAC HEAD_FAMILY END
6649 .    ds $HEAD_FAM \\$1
6650 .END
6653 \# HEAD FONT
6654 \# ---------
6655 \# *Argument:
6656 \#   <font to use for section titles (main heads)>
6657 \# *Function:
6658 \#   Creates or modifies string $HEAD_FT.
6659 \# *Notes:
6660 \#   Default is bold.
6662 .MAC HEAD_FONT END
6663 .    ds $HEAD_FT \\$1
6664 .END
6667 \# HEAD SIZE
6668 \# ---------
6669 \# *Argument:
6670 \#   <+|- number of points by which to in/decrease point size of
6671 \#   section titles (relative to running text)>
6672 \# *Function:
6673 \#   Creates or modifies string $HEAD_SIZE_CHANGE.
6674 \# *Notes:
6675 \#   Must be preceded by a - or + sign with no space afterwards.
6676 \#   Fractional point sizes are allowed.
6677 \#   Default +1 for printstyle TYPESET; +0 for TYPEWRITE.
6679 .MAC HEAD_SIZE END
6680 .    ds $HEAD_SIZE_CHANGE \\$1
6681 .END
6684 \# HEAD QUAD
6685 \# ---------
6686 \# *Arguments:
6687 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE
6688 \# *Function:
6689 \#   Creates or modifies string $HEAD_QUAD.
6690 \# *Notes:
6691 \#   Default is CENTER.
6693 .MAC HEAD_QUAD END
6694 .    ds $HEAD_QUAD \\$1
6695 .END
6698 \# HEAD CAPS
6699 \# ---------
6700 \# *Arguments:
6701 \#   <none> | <anything>
6702 \# *Function:
6703 \#   Creates or modifies register #HEAD_CAPS.
6704 \# *Notes:
6705 \#   Default is on.
6707 .MAC HEAD_CAPS END
6708 .    ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
6709 .    el \{ .nr #HEAD_CAPS 0 \}
6710 .END
6713 \# HEAD SPACE
6714 \# ----------
6715 \# *Arguments:
6716 \#   <none> | <anything>
6717 \# *Function:
6718 \#   Creates register #HEAD_SPACE, which toggles whether the space
6719 \#   before heads is 1 extra line space ("off") or 2 ("on").  Used only
6720 \#   in PRINTSTYLE TYPESET.
6721 \# *Notes:
6722 \#   Default is on.
6724 .MAC HEAD_SPACE END
6725 .    ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
6726 .    el \{ .nr #HEAD_SPACE 0 \}
6727 .END
6730 \# HEAD UNDERLINE
6731 \# --------------
6732 \# *Arguments:
6733 \#   <none> | <anything>
6734 \# *Function:
6735 \#   Creates or modifies register #HEAD_UNDERLINE.
6736 \# *Notes:
6737 \#   Default is on.
6739 .MAC HEAD_UNDERLINE END
6740 .    ie '\\$1'' \{ .nr #HEAD_UNDERLINE 1 \}
6741 .    el \{ .nr #HEAD_UNDERLINE 0 \}
6742 .END
6745 \# MAIN HEAD
6746 \# ---------
6747 \# *Arguments:
6748 \#   "text of main head" ["text of main head"] ...
6749 \# *Function:
6750 \#   In TYPEWRITE, prints main heads centered, all caps, underlined.
6751 \#   In TYPESET, prints bold main heads 1 point larger than running
6752 \#   text, all caps, underlined.
6753 \# *Notes:
6754 \#   The HEAD macro requires that double-quotes (") surround
6755 \#   each line of text.
6757 .MAC HEAD END
6758 .    br
6759 \# Collect head for TOC.
6760 .    nr #ARG_NUM 0 1
6761 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
6762 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
6763 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6764 .       ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
6765 .          as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\\|
6766 .       \}
6767 .       el \{\
6768 \# Note that in the .as lines, below, \ at the end has a literal
6769 \# space after it.
6770 .          ie \\n[#NUMBER_HEAD] \{\
6771 .             ie \\n[#ARG_NUM]=0 \{\
6772 .                as $TOC_HEAD_ITEM \\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\ 
6773 .                nr #HEAD_NUM \\n-[#HEAD_NUM]
6774 .             \}
6775 .             el \{\
6776 .                as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ 
6777 .             \}
6778 .          \}
6779 .          el \{\
6780 .             as $TOC_HEAD_ITEM \\$[\\n+[#ARG_NUM]]\ 
6781 .          \}
6782 .       \}
6783 .    \}
6784 \# Note the use of \!, which transparently embeds the macros used
6785 \# in the TOC_ENTRIES diversion.  The elements they control must be
6786 \# processed literally when the diversion is output.
6787 .    ev TOC_EV
6788 .    da TOC_ENTRIES
6789 .    if \\n[#PRINT_STYLE]=1 \{\
6790 \!.     fam C
6791 \!.     ft  R
6792 \!.     ps  12
6793 .    \}
6794 .    if \\n[#PRINT_STYLE]=2 \{\
6795 \!.     FAMILY  \\*[$TOC_HEAD_FAM]
6796 \!.     FT      \\*[$TOC_HEAD_FT]
6797 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEAD_SIZE_CHANGE]
6798 .    \}
6799 \!.  TRAP OFF
6800 .    ie \\n[#PRINT_STYLE]=1 \{\
6801 \!.     PAD "\\h'2m'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN_TYPEWRITE]"
6802 .    \}
6803 .    el \{\
6804 \!.     PAD "\\h'\\n[#TOC_HEAD_INDENT]u'\\*[$TOC_HEAD_ITEM]\\*[$TOC_PN]"
6805 .    \}
6806 \!.  EL
6807 \!.  ST 100 L
6808 \!.  ST 101 R
6809 .    if \\n[#PRINT_STYLE]=2 \{\
6810 \!.     FAMILY  \\*[$TOC_PN_FAM]
6811 \!.     FT      \\*[$TOC_PN_FT]
6812 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
6813 .    \}
6814 \!.  TAB 100
6815 \!.  PRINT \\*[LEADER]
6816 \!.  TN
6817 \!.  TRAP
6818 \!.  PRINT \\n[#TOC_ENTRY_PN]
6819 \!.  TQ
6820 .    di       
6821 .    ev
6822 \# End collection of head for TOC
6823 \# Process head
6824 .    nr #HEAD 1
6825 .    ev HEAD
6826 .    ll \\n[#L_LENGTH]u
6827 .    ta \\n(.lu
6828 .    if \\n[#COLUMNS] \{\
6829 .       ll \\n[#COL_L_LENGTH]u
6830 .       ta \\n(.lu
6831 .    \}
6832 .    CHECK_INDENT
6833 .    QUAD \\*[$HEAD_QUAD]
6834 .    if \\n[#PRINT_STYLE]=1 \{\
6835 .       fam C
6836 .       ft  R
6837 .       ps  12
6838 .       vs  \\n[#DOC_LEAD]u
6839 .       UNDERLINE OFF
6840 .    \}
6841 .    if \\n[#PRINT_STYLE]=2 \{\
6842 .       FAMILY  \\*[$HEAD_FAM]
6843 .       FT      \\*[$HEAD_FT]
6844 .       PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
6845 .       LS      \\n[#DOC_LEAD]u
6846 .    \}
6847 .    if r#QUOTE             \{ .rr #QUOTE \}
6848 .    if r#EPIGRAPH          \{ .rr #EPIGRAPH \}
6849 .    if \\n[#PRINT_STYLE]=1 \{ .ne 3 \}
6850 .    if \\n[#PRINT_STYLE]=2 \{\
6851 .       ie \\n[#HEAD_SPACE] \{ .ne 4 \}
6852 .       el \{ .ne 3 \}
6853 .    \}
6854 .    ie \\n[#START] \{\
6855 .       if \\n[#DOC_HEADER]=0 \{ . \}
6856 .    \}
6857 .    el \{\
6858 .       if \\n[#PRINT_STYLE]=1 \{\
6859 .          if !\\n[#LINEBREAK] \{\
6860 .             ALD \\n[#DOC_LEAD]u
6861 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6862 .          \}
6863 .       \}
6864 .       if \\n[#PRINT_STYLE]=2 \{\
6865 .          ie \\n[#PP_SPACE] \{\
6866 .             ie \\n[#END_QUOTE] \{ . \}
6867 .             el \{\
6868 .                if !\\n[#LINEBREAK] \{\
6869 .                   if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6870 .                \}
6871 .             \}
6872 .          \}
6873 .          el \{\
6874 .             ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
6875 .             el \{ .ALD \\n[#DOC_LEAD]u \}
6876 .          \}
6877 .          if \\n[#END_QUOTE] \{\
6878 .             if !\\n[#Q_FITS] \{\
6879 .                RLD \\n[#DOC_LEAD]u
6880 .                if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
6881 .             \}
6882 .             if \\n[#Q_AT_TOP] \{\
6883 .                RLD \\n[#DOC_LEAD]u
6884 .                if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
6885 .             \}
6886 .          \}
6887 .          if \\n[#LINEBREAK] \{\
6888 .             if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
6889 .          \}
6890 .       \}
6891 .    \}
6892 \# Print head
6893 .    nr #ARG_NUM 0 1
6894 .    if \\n[#HEAD_CAPS] \{ .CAPS \}
6895 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6896 .       ie \\n[#NUMBER_HEAD] \{\
6897 .          ie \\n[#ARG_NUM]=0 \{\
6898 .             br
6899 .             ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
6900 .             el \{ .UNDERSCORE "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
6901 .             br
6902 .          \}
6903 .          el \{\
6904 .             br
6905 .             ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
6906 .             el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
6907 .             br
6908 .          \}
6909 .       \}
6910 .       el \{\
6911 .          br
6912 .          ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
6913 .          el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
6914 .          br
6915 .       \}
6916 .    \}
6917 .    REMOVE_INDENT
6918 .    CAPS OFF
6919 .    ev
6920 .    ALD \\n[#DOC_LEAD]u
6921 .    RESET_SUBHEAD_NUMBER
6922 .    RESET_PARAHEAD_NUMBER
6923 .    if r#START      \{ .rr #START     \}
6924 .    if r#EPIGRAPH   \{ .rr #EPIGRAPH  \}
6925 .    if r#QUOTE      \{ .rr #QUOTE     \}
6926 .    if r#Q_FITS     \{ .rr #Q_FITS    \}
6927 .    if r#END_QUOTE  \{ .rr #END_QUOTE \}
6928 .    if r#LINEBREAK  \{ .rr #LINEBREAK \}
6929 .    if r#Q_AT_TOP   \{ .rr #Q_AT_TOP  \}
6930 .    if r#PP_ACTIVE  \{ .rr #PP_ACTIVE \}
6931 .    rr #ARG_NUM
6932 .    rm $TOC_HEAD_ITEM
6933 .    nr #PP 0
6934 .END
6937 \# ---Subheads---
6939 \# SUBHEAD FAMILY
6940 \# --------------
6941 \# *Argument:
6942 \#   <family to use in subheads>
6943 \# *Function:
6944 \#   Creates or modifies string $SH_FAM.
6945 \# *Notes:
6946 \#   Default is same as running text.
6948 .MAC SUBHEAD_FAMILY END
6949 .    ds $SH_FAM \\$1
6950 .END
6953 \# SUBHEAD FONT
6954 \# --------------
6955 \# *Argument:
6956 \#   <font to use in subheads>
6957 \# *Function:
6958 \#   Creates or modifies string $SH_FT.
6959 \# *Notes:
6960 \#   Default is bold.
6962 .MAC SUBHEAD_FONT END
6963 .    ds $SH_FT \\$1
6964 .END
6967 \# SUBHEAD SIZE
6968 \# ------------
6969 \# *Argument:
6970 \#   <+|- number of points by which to in/decrease point size of subheads
6971 \#   (relative to running text)>
6972 \# *Function:
6973 \#   Creates or modifies string $SH_SIZE_CHANGE.
6974 \# *Notes:
6975 \#   Must be preceded by a +|- sign.  No space afterwards.
6976 \#   Fractional point sizes are allowed.
6977 \#   Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
6979 .MAC SUBHEAD_SIZE END
6980 .    ds $SH_SIZE_CHANGE \\$1
6981 .END
6984 \# SUBHEAD QUAD
6985 \# ------------
6986 \# *Argument:
6987 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE
6988 \# *Function:
6989 \#   Creates or modifies string $SH_QUAD.
6990 \# *Notes:
6991 \#   Default is LEFT for both TYPESET and TYPEWRITE.
6993 .MAC SUBHEAD_QUAD END
6994 .    ds $SH_QUAD \\$1
6995 .END
6998 \# SUBHEAD
6999 \# -------
7000 \# *Arguments:
7001 \#   "text of subhead" ["text of subhead"] ...
7002 \# *Function:
7003 \#   In TYPEWRITE, prints subheads underlined.
7004 \#   In TYPESET, prints subheads bold, .5 points larger than running
7005 \#   text.
7006 \#   In both styles, a line space precedes the subhead, and a small
7007 \#   amount of lead comes after.
7008 \# *Notes:
7009 \#   As with the HEAD macro, double-quotes (") must surround
7010 \#   each line of text.
7012 .MAC SUBHEAD END
7013 .    br
7014 \# Collect subhead for TOC.
7015 .    nr #ARG_NUM 0 1
7016 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7017 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7018 .       ie \\n[#ARG_NUM]=\\n[#NUM_ARGS] \{\
7019 .          as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\\|
7020 .       \}
7021 .       el \{\
7022 \# Note that in the .as lines, below, \ at the end has a literal
7023 \# space after it.
7024 .          ie \\n[#NUMBER_SH] \{\
7025 .             ie \\n[#ARG_NUM]=0 \{\
7026 .                as $TOC_SH_ITEM \\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]\ 
7027 .                nr #SH_NUM \\n-[#SH_NUM]
7028 .             \}
7029 .             el \{\
7030 .                as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ 
7031 .             \}
7032 .          \}
7033 .          el \{\
7034 .             as $TOC_SH_ITEM \\$[\\n+[#ARG_NUM]]\ 
7035 .          \}
7036 .       \}
7037 .    \}
7038 \# Note the use of \!, which transparently embeds the macros used
7039 \# in the TOC_ENTRIES diversion.  The elements they control must be
7040 \# processed literally when the diversion is output.
7041 .    ev TOC_EV
7042 .    da TOC_ENTRIES
7043 .    if \\n[#PRINT_STYLE]=1 \{\
7044 \!.     fam C
7045 \!.     ft  R
7046 \!.     ps  12
7047 .    \}
7048 .    if \\n[#PRINT_STYLE]=2 \{\
7049 \!.     FAMILY  \\*[$TOC_SH_FAM]
7050 \!.     FT      \\*[$TOC_SH_FT]
7051 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_SH_SIZE_CHANGE]
7052 .    \}
7053 \!.  TRAP OFF
7054 .    ie \\n[#PRINT_STYLE]=1 \{\
7055 \!.     PAD "\\h'4m'\\*[$TOC_SH_ITEM]\\*[$TOC_PN_TYPEWRITE]"
7056 .    \}
7057 .    el \{\
7058 \!.     PAD "\\h'\\n[#TOC_SH_INDENT]u'\\*[$TOC_SH_ITEM]\\*[$TOC_PN]"
7059 .    \}
7060 \!.  EL
7061 \!.  ST 100 L
7062 \!.  ST 101 R
7063 .    if \\n[#PRINT_STYLE]=2 \{\
7064 \!.     FAMILY  \\*[$TOC_PN_FAM]
7065 \!.     FT      \\*[$TOC_PN_FT]
7066 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7067 .    \}
7068 \!.  TAB 100
7069 \!.  PRINT \\*[LEADER]
7070 \!.  TN
7071 \!.  TRAP
7072 \!.  PRINT \\n[#TOC_ENTRY_PN]
7073 \!.  TQ
7074 .    di       
7075 .    ev
7076 \# End collection of head for TOC
7077 \# Process subhead
7078 .    nr #ARG_NUM 0 1
7079 .    if r#QUOTE    \{ .rr #QUOTE    \}
7080 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7081 .    ev SUBHEAD
7082 .    ll \\n[#L_LENGTH]u
7083 .    ta \\n(.lu
7084 .    if \\n[#COLUMNS] \{\
7085 .       ll \\n[#COL_L_LENGTH]u
7086 .       ta \\n(.lu
7087 .    \}
7088 .    CHECK_INDENT
7089 .    if \\n[#PRINT_STYLE]=1 \{\
7090 .       fam C
7091 .       ft  R
7092 .       ps  12
7093 .       vs  \\n[#DOC_LEAD]u
7094 .       QUAD   \\*[$SH_QUAD]
7095 .       UNDERLINE OFF
7096 .    \}
7097 .    if \\n[#PRINT_STYLE]=2 \{\
7098 .       FAMILY  \\*[$SH_FAM]
7099 .       FT      \\*[$SH_FT]
7100 .       PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
7101 .       LS      \\n[#DOC_LEAD]u
7102 .       QUAD    \\*[$SH_QUAD]
7103 .    \}
7104 .    if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
7105 .    if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
7106 .    ie \\n[#START] \{ . \}
7107 .    el \{\
7108 .       ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]u*2u) ) \{\
7109 .          ie \\n[#COLUMNS] \{ .COL_NEXT \}
7110 .          el \{ .bp \}
7111 .       \}
7112 .       el \{\
7113 .          ie \\n[#HEAD]=1 \{ . \}
7114 .          el \{\
7115 .             if \\n[#PRINT_STYLE]=1 \{\
7116 .                if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7117 .             \}
7118 .             if \\n[#PRINT_STYLE]=2 \{\
7119 .                ie \\n[#PP_SPACE]=1 \{\
7120 .                   ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7121 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
7122 .                \}
7123 .                el \{\
7124 .                   if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7125 .                \}
7126 .             \}
7127 .          \}
7128 .       \}
7129 .    \}
7130 \# Print subhead
7131 .    if \\n[#PRINT_STYLE]=1 \{\
7132 .       while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7133 .          ie \\n[#NUMBER_SH] \{\
7134 .             ie \\n[#ARG_NUM]=0 \{\
7135 .                ie \\n[#NUMBER_HEAD] \{\
7136 .                   br
7137 .                   UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
7138 .                   br
7139 .                \}
7140 .                el \{\
7141 .                   br
7142 .                   UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
7143 .                   br
7144 .                \}
7145 .             \}
7146 .             el \{\
7147 .                br
7148 .                ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
7149 .                el \{ .UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
7150 .                br
7151 .             \}
7152 .          \}
7153 .          el \{\
7154 .             br
7155 .             UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7156 .             br
7157 .          \}
7158 .       \}
7159 .    \}
7160 .    if \\n[#PRINT_STYLE]=1 \{\
7161 .       if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
7162 .    \}
7163 .    if \\n[#PRINT_STYLE]=2 \{\
7164 .       ie \\n[#PP_SPACE]=0 \{\
7165 .          while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7166 .             ie \\n[#NUMBER_SH] \{\
7167 .                ie \\n[#ARG_NUM]=0 \{\
7168 .                   ie \\n[#NUMBER_HEAD] \{\
7169 .                      br
7170 .                      PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
7171 .                      br
7172 .                   \}
7173 .                   el \{\
7174 .                      br
7175 .                      PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
7176 .                      br
7177 .                   \}
7178 .                \}
7179 .                el \{\
7180 .                   br
7181 .                   PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7182 .                   br
7183 .                \}
7184 .             \}
7185 .             el \{\
7186 .                br
7187 .                PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
7188 .                br
7189 .             \}
7190 .          \}
7191 .       \}
7192 .       el \{\
7193 .          ALD \\n[#DOC_LEAD]u
7194 .          if \\n[#HEAD]=1      \{ .RLD \\n[#DOC_LEAD]u \}
7195 .          if \\n[#END_QUOTE]   \{ .RLD \\n[#DOC_LEAD]u \}
7196 .          if \\n[#EPIGRAPH]    \{ .RLD \\n[#DOC_LEAD]u \}
7197 .          while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
7198 .             PRINT "\\$[\\n+[#ARG_NUM]]
7199 .          \}
7200 .          ALD \\n[#DOC_LEAD]u
7201 .       \}
7202 .    \}
7203 .    REMOVE_INDENT
7204 .    ev
7205 .    RESET_PARAHEAD_NUMBER
7206 .    if r#START     \{ .rr #START     \}
7207 .    if r#EPIGRAPH  \{ .rr #EPIGRAPH  \}
7208 .    if r#Q_FITS    \{ .rr #Q_FITS    \}
7209 .    if r#END_QUOTE \{ .rr #END_QUOTE \}
7210 .    if r#LINEBREAK \{ .rr #LINEBREAK \}
7211 .    rm $TOC_SH_ITEM
7212 .    nr #PP 0
7213 .    nr #HEAD 2
7214 .END
7216 \# ---Paragraph heads---
7218 \# PARAHEAD FAMILY
7219 \# ---------------
7220 \# *Argument:
7221 \#   <family to use in paraheads>
7222 \# *Function:
7223 \#   Creates or modifies string $PH_FAM.
7224 \# *Notes:
7225 \#   Default is same as running text.
7227 .MAC PARAHEAD_FAMILY END
7228 .    ds $PH_FAM \\$1
7229 .END
7232 \# PARAHEAD FONT
7233 \# -------------
7234 \# *Argument:
7235 \#   <font to use in paraheads>
7236 \# *Function:
7237 \#   Creates or modifies string $PH_FT.
7238 \# *Notes:
7239 \#   Default is bold italic for TYPESET; underlined for TYPEWRITE.
7241 .MAC PARAHEAD_FONT END
7242 .    ds $PH_FT \\$1
7243 .END
7246 \# PARAHEAD SIZE
7247 \# -------------
7248 \# *Argument:
7249 \#   <+|- number of points by which to in/decrease point size of subheads
7250 \#   (relative to running text)>
7251 \# *Function:
7252 \#   Creates or modifies string $PH_SIZE_CHANGE.
7253 \# *Notes:
7254 \#   Must be preceded by a +|- sign.  No space afterwards.
7255 \#   Fractional point sizes are allowed.  No unit of measure, please.
7256 \#   Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
7258 .MAC PARAHEAD_SIZE END
7259 .    ds $PH_SIZE_CHANGE \\$1
7260 .END
7263 \# PARAHEAD INDENT
7264 \# ---------------
7265 \# *Argument:
7266 \#   <size of indent>
7267 \# *Function:
7268 \#   Creates or modifies register #PH_INDENT.
7269 \# *Notes:
7270 \#   Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
7272 .MAC PARAHEAD_INDENT END
7273 .    nr #PH_INDENT (\\$1)
7274 .END
7277 \# PARAHEAD
7278 \# --------
7279 \# *Arguments:
7280 \#   "<para head>"
7281 \# *Function:
7282 \#   Deposits a paragraph head at the start and into the body of a
7283 \#   paragraph.
7284 \# *Notes:
7285 \#   PARAHEAD *must* come after PP.
7287 .MAC PARAHEAD END
7288 \# Collect parahead for TOC.
7289 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
7290 .    ie \\n[#NUMBER_PH] \{\
7291 .       ds $TOC_PH_ITEM \\n+[#PH_NUM].\0\\$1\\|
7292 .       nr #PH_NUM \\n-[#PH_NUM]
7293 .    \}
7294 .    el \{\
7295 .       ds $TOC_PH_ITEM \\$1\\|
7296 .    \}
7297 .    ev TOC_EV
7298 .    da TOC_ENTRIES
7299 .    if \\n[#PRINT_STYLE]=1 \{\
7300 \!.       fam C
7301 \!.       ft  R
7302 \!.       ps  12
7303 .    \}
7304 .    if \\n[#PRINT_STYLE]=2 \{\
7305 \!.     FAMILY  \\*[$TOC_PH_FAM]
7306 \!.     FT      \\*[$TOC_PH_FT]
7307 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PH_SIZE_CHANGE]
7308 .    \}
7309 \!.  TRAP OFF
7310 .    ie \\n[#PRINT_STYLE]=1 \{\
7311 \!.     PAD "\\h'6m'\\*[$TOC_PH_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
7312 .    \}
7313 .    el \{\
7314 \!.     PAD "\\h'\\n[#TOC_PH_INDENT]u'\\*[$TOC_PH_ITEM]\\*[$TOC_PN]"
7315 .    \}
7316 \!.  EL
7317 \!.  ST 100 L
7318 \!.  ST 101 R
7319 .    if \\n[#PRINT_STYLE]=2 \{\
7320 \!.     FAMILY  \\*[$TOC_PN_FAM]
7321 \!.     FT      \\*[$TOC_PN_FT]
7322 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
7323 .    \}
7324 \!.  TAB 100
7325 \!.  PRINT \\*[LEADER]
7326 \!.  TN
7327 \!.  TRAP
7328 \!.  PRINT \\n[#TOC_ENTRY_PN]
7329 \!.  TQ
7330 .    di       
7331 .    ev
7332 \# End collection of parahead for TOC
7333 \# Process parahead
7334 .    if \\n[#SLANT_ON] \{\
7335 .       nr #SLANT_WAS_ON 1
7336 \E*[SLANTX]
7337 .    \}
7338 .    ie \\n[#PP]=1 \{\
7339 .       if \\n[#INDENT_FIRST_PARAS] \{\
7340 .          ti \\n[#PH_INDENT]u
7341 .       \}
7342 .    \}
7343 .    el \{ .ti \\n[#PH_INDENT]u \}
7344 .    if \\n[#PRINT_STYLE]=1 \{\
7345 .       fam C
7346 .       ft  R
7347 .       ps  12
7348 .       UNDERLINE OFF
7349 .       ie \\n[#NUMBER_PH] \{\
7350 .          if \\n[#NUMBER_HEAD] \{\
7351 .             ie \\n[#NUMBER_SH] \{\
7352 .                UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
7354 .             \}
7355 .             el \{\
7356 .                UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1
7358 .             \}
7359 .          \}
7360 .          ie \\n[#NUMBER_SH] \{\
7361 .             if !\\n[#NUMBERED] \{\
7362 .                UNDERSCORE "\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1
7364 .             \}
7365 .          \}
7366 .          el \{\
7367 .             if !\\n[#NUMBERED] \{\
7368 .                UNDERSCORE "\\n+[#PH_NUM].\\ \\$1
7370 .             \}
7371 .          \}
7372 .       \}
7373 .       el \{\
7374 .          UNDERSCORE "\\$1
7376 .       \}
7377 .       if \\n[#SLANT_WAS_ON] \{\
7378 .          if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
7379 .          if \\n[#SLANT_MEANS_SLANT] \{\
7380 \E*[SLANT]\c
7381 .          \}
7382 .          rr #SLANT_WAS_ON
7383 .       \}
7384 .    \}
7385 .    if \\n[#PRINT_STYLE]=2 \{\
7386 .       FAM     \\*[$PH_FAM]
7387 .       FT      \\*[$PH_FT]
7388 .       PT_SIZE \\*[$PH_SIZE_CHANGE]
7389 .       ie \\n[#NUMBER_PH] \{\
7390 .          if \\n[#NUMBER_HEAD] \{\
7391 .             ie \\n[#NUMBER_SH] \{\
7392 .                PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7393 .             \}
7394 .             el \{\
7395 .                PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7396 .             \}
7397 .          \}
7398 .          ie \\n[#NUMBER_SH] \{\
7399 .             if !\\n[#NUMBERED] \{\
7400 .                PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7401 .             \}
7402 .          \}
7403 .          el \{\
7404 .             if !\\n[#NUMBERED] \{\
7405 .                PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
7406 .             \}
7407 .          \}
7408 .       \}
7409 .       el \{\
7410 .          PRINT "\\$1\h'.6m'\c"
7411 .       \}
7412 .       FAMILY  \\*[$DOC_FAM]
7413 .       FT      \\*[$PP_FT]
7414 .       PT_SIZE \\n[#DOC_PT_SIZE]u
7415 .       if \\n[#SLANT_WAS_ON] \{\
7416 .          rr #SLANT_WAS_ON 1
7417 \E*[SLANT]\c
7418 .       \}
7419 .    \}
7420 .    rr #NUMBERED
7421 .    rm $TOC_PH_ITEM
7422 .END
7425 \# ====================================================================
7427 \# +++LINE BREAKS+++
7429 \# LINEBREAK CHARACTER
7430 \# -------------------
7431 \# *Arguments:
7432 \#   [character] [iterations] [vertical adjustment]
7433 \# *Function:
7434 \#   Allows user to specify a line break character and the number
7435 \#   of times to repeat it horiontally.
7436 \# *Notes:
7437 \#   Without an argument, LINEBREAK_CHAR will deposit a blank line.
7439 \#   Vertical adjustment requires a unit of measure (most likely
7440 \#   "p"), and has to be preceded by +|-
7442 .MAC LINEBREAK_CHAR END
7443 .    nr #REPEAT 1
7444 .    ds $LINEBREAK_CHAR \\$1
7445 .    ds $LINEBREAK_CHAR_V_ADJ \\$3
7446 .    if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
7447 .       ds $LINEBREAK_CHAR_V_ADJ +0
7448 .    \}
7449 .    while \\$2>\\n[#REPEAT] \{\
7450 .       as $LINEBREAK_CHAR "\\ \\$1
7451 .       nr #REPEAT \\n[#REPEAT]+1
7452 .    \}
7453 .   rr #REPEAT
7454 .END
7457 \# LINE BREAK
7458 \# ----------
7459 \# *Arguments:
7460 \#   <none>
7461 \# *Function:
7462 \#   Deposits line break character.
7463 \# *Notes:
7464 \#   If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
7466 .MAC LINEBREAK END
7467 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7468 .    po \\n[#DOC_L_MARGIN]u
7469 .    ie  '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
7470 .    el \{\
7471 .       if \\n[#PRINT_STYLE]=1 \{\
7472 .          ie \\n[#END_QUOTE] \{ . \}
7473 .          el \{ .ALD \\n[#DOC_LEAD]u \}
7474 .       \}
7475 .       if \\n[#PRINT_STYLE]=2 \{\
7476 .          ie \\n[#END_QUOTE] \{ . \}
7477 .          el \{ .ALD \\n[#DOC_LEAD]u \}
7478 .       \}
7479 .       CENTER
7480 .       PRINT \\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'
7481 .       if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
7482 .       if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
7483 .       QUAD \\*[$DOC_QUAD]
7484 .    \}
7485 .    nr #LINEBREAK 1
7486 .    if r#QUOTE     \{ .rr #QUOTE     \}
7487 .    if r#END_QUOTE \{ .rr #END_QUOTE \}
7488 .    nr #PP 0
7489 .END
7491 \# ====================================================================
7493 \# +++PARAGRAPHS+++
7495 \# PARAGRAPH FONT
7496 \# --------------
7497 \# *Argument:
7498 \#   <font of running text>
7499 \# *Function:
7500 \#   Creates or modifies string $PP_FT.
7501 \# *Notes:
7502 \#   Affects all paragraphs.
7504 .MAC PP_FONT END
7505 .    if \\n[#IGNORE] \{ .return \}
7506 .    br
7507 .    ds $PP_FT \\$1
7508 .    FT \\*[$PP_FT]
7509 .END
7512 \# PARAGRAPH INDENT
7513 \# ----------------
7514 \# *Argument:
7515 \#   <amount to indent paragraphs in running text (ipPcm)>
7516 \# *Function:
7517 \#   Allows user to change the default para indent.  The change will
7518 \#   affect the indent of QUOTEs and BLOCKQUOTEs as well.
7519 \# *Notes:
7520 \#   Default for printstyle TYPEWRITE is 1/2-inch.  Default for
7521 \#   printstyle TYPESET is 2 ems.  The defaults are set in
7522 \#   PRINTSTYLE, not DEFAULTS.
7524 .MAC PARA_INDENT END
7525 .    nr #PP_INDENT (\\$1)
7526 .END
7529 \# INDENT FIRST PARAGRAPHS
7530 \# -----------------------
7531 \# *Arguments:
7532 \#   <none> | <anything>
7533 \# *Function:
7534 \#   By default, the first para of a document, as well as the first
7535 \#   paras of blockquotes and block-style epigraphs are not indented.
7536 \#   When invoked, this macro will indent all paras.
7537 \# *Notes:
7538 \#   Default is OFF.
7540 .MAC INDENT_FIRST_PARAS END
7541 .    ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
7542 .    el \{ .rr #INDENT_FIRST_PARAS   \}
7543 .END
7546 \# INTER-PARAGRAPH SPACING
7547 \# -----------------------
7548 \# *Arguments:
7549 \#   <none> | <anything>
7550 \# *Function:
7551 \#   Adds a line space between paragraphs in body text.  Block quotes
7552 \#   are unaffected.
7553 \# *Notes:
7554 \#   Default is OFF.  PARA_SPACE ON is not recommended for use
7555 \#   with PRINTSTYLE TYPEWRITE.
7557 .MAC PARA_SPACE END
7558 .    ie '\\$1'' \{ .nr #PP_SPACE 1 \}
7559 .    el \{ .rr #PP_SPACE   \}
7560 .END
7563 \# PARAGRAPH
7564 \# ---------
7565 \# *Arguments:
7566 \#   <none>
7567 \# *Function:
7568 \#   Figures out what to do with paragraphs under differing conditions.
7569 \# *Notes:
7570 \#   For the time being, there's no automatic widow/orphan control.
7571 \#   Controlling them isn't just a matter of establishing an arbitrary
7572 \#   number of lines needed for a para, since groff doesn't then
7573 \#   handle single line paragraphs gracefully.  Usually, the whole
7574 \#   page needs to be tweaked.
7576 \#   Note the use of transparent line break (\!.br) to get
7577 \#   PP to work within blockquotes and epigraphs.
7579 \#   PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
7581 .MAC PP END
7582 .    br
7583 .    if \\n[#DOC_TYPE]=4 \{\
7584 .       if !'\\n(.z'' \{ .di \}
7585 .       if \\n[#DATE] \{\
7586 .          nf
7587 .          DATE
7588 .          QUAD \\*[$DOC_QUAD]
7589 .          ALD \\n[#DOC_LEAD]u*2u
7590 .          rr #DATE
7591 .       \}
7592 .       if \\n[#TO] \{\
7593 .          nf
7594 .          TO_ADDRESS
7595 .          ALD \\n[#DOC_LEAD]u
7596 .          rr #TO
7597 .       \}
7598 .       if \\n[#FROM] \{\
7599 .          nf
7600 .          FROM_ADDRESS
7601 .          ALD \\n[#DOC_LEAD]u
7602 .          rr #FROM
7603 .       \}
7604 .       if \\n[#GREETING] \{\
7605 .          nf
7606 .          GREETING
7607 .          ALD \\n[#DOC_LEAD]u
7608 .          rr #GREETING
7609 .       \}
7610 .    \}
7611 .    rr #PP_ACTIVE
7612 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7613 .    if \\n[#PP_STYLE]=1 \{\
7614 .       if \\n[#ENDNOTE] \{\
7615 .          nr #RESET_PARA_SPACE \\n[#PP_SPACE]
7616 .          ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
7617 .          el \{ .PARA_SPACE OFF \}
7618 .       \}
7619 .       br
7620 .       if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
7621 .       if \\n[#COLUMNS] \{\
7622 .          if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
7623 .       \}
7624 .       if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7625 .       ie \\n[#PRINT_STYLE]=1 \{\
7626 .          fam C
7627 .          ft  R
7628 .          ps  12
7629 .          ie \\n[#ENDNOTE] \{ .vs \\n[#EN_LEAD]u \}
7630 .          el \{ .vs \\n[#DOC_LEAD]u \}
7631 .          QUAD \\*[$DOC_QUAD]
7632 .          UNDERLINE OFF
7633 .          if \\n[#SLANT_ON] \{\
7634 .             if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
7635 .          \}
7636 .       \}
7637 .       el \{\
7638 .          ie \\n[#ENDNOTE] \{\
7639 .             FAMILY  \\*[$EN_FAM]
7640 .             FT      \\*[$EN_FT]
7641 .             PT_SIZE \\n[#EN_PS]u
7642 .             vs      \\n[#EN_LEAD]u
7643 .             QUAD    \\*[$EN_QUAD]
7644 .          \}
7645 .          el \{\
7646 .             FAMILY  \\*[$DOC_FAM]
7647 .             FT      \\*[$PP_FT]
7648 .             PT_SIZE \\n[#DOC_PT_SIZE]u
7649 .             LS      \\n[#DOC_LEAD]u
7650 .             QUAD    \\*[$DOC_QUAD]
7651 .          \}
7652 .       \}
7653 .       ie \\n[#PP]=0 \{\
7654 .          if \\n[#INDENT_FIRST_PARAS] \{\
7655 .             ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7656 .             el \{ .ti \\n[#PP_INDENT]u \}
7657 .             if '\\n(.z'END_NOTES' \{\
7658 .                ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7659 .             \}
7660 .          \}
7661 .          if r#END_QUOTE \{\
7662 .             if \\n[#END_QUOTE] \{\
7663 .                if !\\n[#LINEBREAK] \{\
7664 .                   ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7665 .                   el \{ .ti \\n[#PP_INDENT]u \}
7666 .                   if '\\n(.z'END_NOTES' \{\
7667 .                      ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7668 .                   \}
7669 .                \}
7670 .             \}
7671 .          \}
7672 .       \}
7673 .       el \{\
7674 .          br
7675 .          if \\n[#PP_SPACE] \{\
7676 .             if \\n[#PRINT_STYLE]=2 \{\
7677 .                ie \\n[#END_QUOTE] \{\
7678 .                   rr #END_QUOTE
7679 .                \}
7680 .                el \{ .ALD \\n[#DOC_LEAD]u \}
7681 .             \}
7682 .          \}
7683 .          ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7684 .          el \{ .ti \\n[#PP_INDENT]u \}
7685 .          if '\\n(.z'END_NOTES' \{\
7686 .             ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7687 .          \}
7688 .       \}
7689 .       if r#START     \{ .rr #START     \}
7690 .       if r#QUOTE     \{ .rr #QUOTE     \}
7691 .       if r#END_QUOTE \{ .rr #END_QUOTE \}
7692 .       if r#HEAD      \{ .rr #HEAD      \}
7693 .       if r#EPIGRAPH  \{ .rr #EPIGRAPH  \}
7694 .       if r#Q_FITS    \{ .rr #Q_FITS    \}
7695 .       if r#LINEBREAK \{ .rr #LINEBREAK \}
7696 .       if \\n[#ENDNOTE] \{\
7697 .          ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
7698 .          el \{ .PARA_SPACE OFF \}
7699 .       \}
7700 .       if \\n[#CONDENSE] \{\
7701 \E*[COND]\c
7702 .       \}
7703 .       if \\n[#EXTEND]=1 \{\
7704 \E*[EXT]\c
7705 .       \}
7706 .       nr #PP +1
7707 .    \}
7708 .    if \\n[#PP_STYLE]=2 \{\
7709 \!.     br
7710 .       if \\n[#BROKEN_QUOTE] \{\
7711 .          ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
7712 .          el \{ .nr #Q_PP 0 \}
7713 .          rr #BROKEN_QUOTE
7714 .       \}
7715 .       ie \\n[#Q_PP]=0 \{\
7716 .          if \\n[#INDENT_FIRST_PARAS] \{\
7717 .             ti \\n[#PP_INDENT]u/2u
7718 .          \}
7719 .          if \\n[#ENDNOTE] \{\
7720 .             ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
7721 .             el \{ .ti 0 \}
7722 .          \}
7723 .       \}
7724 .       el \{\
7725 .          ti \\n[#PP_INDENT]u/2u
7726 .       \}
7727 .       if \\n[#CONDENSE] \{\
7728 \E*[COND]\c
7729 .       \}
7730 .       if \\n[#EXTEND]=1 \{\
7731 \E*[EXT]\c
7732 .       \}
7733 .    nr #Q_PP +1
7734 .    \}
7735 .    nr #PP_ACTIVE 1
7736 .END
7738 \# ====================================================================
7740 \# +++QUOTES+++
7742 \# ---Line for line (poetic) quotes---
7744 \# QUOTE FAMILY
7745 \# ------------
7746 \# *Argument:
7747 \#   <family to use in line for line quotes>
7748 \# *Function:
7749 \#   Creates or modifies string $QUOTE_FAM.
7750 \# *Notes:
7751 \#   Default is same as running text.
7753 .MAC QUOTE_FAMILY END
7754 .    ds $QUOTE_FAM \\$1
7755 .END
7758 \# QUOTE FONT
7759 \# ----------
7760 \# *Argument:
7761 \#   <font to use in line for line quotes>
7762 \# *Function:
7763 \#   Creates or modifies string $QUOTE_FT.
7764 \# *Notes:
7765 \#   Default is italic for TYPESET.
7767 .MAC QUOTE_FONT END
7768 .    ds $QUOTE_FT \\$1
7769 .END
7772 \# QUOTE SIZE
7773 \# ----------
7774 \# *Argument:
7775 \#   <-|+ number of points by which to de/increase point size of
7776 \#   line for line quotes (relative to running text)>
7777 \# *Function:
7778 \#   Creates or modifies string $QUOTE_SIZE_CHANGE.
7779 \# *Notes:
7780 \#   Must be preceded by a - or + sign with no space afterwards.
7781 \#   Fractional point sizes are allowed.
7782 \#   Default is +0.
7784 .MAC QUOTE_SIZE END
7785 .    ds $QUOTE_SIZE_CHANGE \\$1
7786 .END
7789 \# UNDERLINE QUOTES
7790 \# ----------------
7791 \# *Arguments:
7792 \#   <none> | <anything>
7793 \# *Function:
7794 \#   Creates or modifies register #UNDERLINE_QUOTES (toggle).
7795 \#   If on, line for line quotes are underlined when printstyle
7796 \#   is TYPEWRITE.
7797 \# *Notes:
7798 \#   Default is ON for printstyle TYPEWRITE.
7800 .MAC UNDERLINE_QUOTES END
7801 .    ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
7802 .    el \{ .rr #UNDERLINE_QUOTES   \}
7803 .END
7806 \# QUOTE INDENT
7807 \# ------------
7808 \# *Argument:
7809 \#   <value by which to multiply PP_INDENT for indented quoted text>
7810 \# *Function:
7811 \#   Creates or modifies register #Q_OFFSET_VALUE.
7812 \# *Notes:
7813 \#   Default is 3 for typeset; 2 for typewrite
7815 .MAC QUOTE_INDENT END
7816 .    nr #Q_OFFSET_VALUE \\$1
7817 .END
7820 \# ALWAYS FULLSPACE QUOTES
7821 \# -----------------------
7822 \# *Arguments:
7823 \#   <none> | <anything>
7824 \# *Function:
7825 \#   Toggles register #FULLSPACE_QUOTES.
7826 \# *Notes:
7827 \#   If user doesn't like the default 1/2 line space above and below
7828 \#   quotes, s/he can turn it off here.  Has no effect in TYPEWRITE.
7830 .MAC ALWAYS_FULLSPACE_QUOTES END
7831 .    if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
7832 .    el \{ .rr #FULLSPACE_QUOTES \}
7833 .END
7836 \# QUOTE
7837 \# -----
7838 \# *Arguments:
7839 \#   <none> | <anything>
7840 \# *Function:
7841 \#   Indents quoted text on a line for line basis, or turns QUOTE off.
7842 \# *Notes:
7843 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
7844 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
7845 \#   how much space to put before and after.
7847 .MAC QUOTE END
7848 .    br
7849 \# **Uncomment the next line to prevent orphaned quote lines.
7850 \#.  ne 1
7851 .    ie '\\$1'' \{\
7852 .       ev QUOTE
7853 .       nr #QUOTE 1
7854 .       di P_QUOTE
7855 .       ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7856 .       ta \\n(.lu
7857 .       if \\n[#COLUMNS] \{\
7858 .          ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7859 .          ta \\n(.lu
7860 .       \}
7861 .       if \\n[#PRINT_STYLE]=1 \{\
7862 .          fam C
7863 .          ft  R
7864 .          ps 12
7865 .          vs \\n[#DOC_LEAD]u
7866 .          LEFT
7867 .       \}
7868 .       if \\n[#PRINT_STYLE]=2 \{\
7869 .          FAMILY  \\*[$QUOTE_FAM]
7870 .          FT      \\*[$QUOTE_FT]
7871 .          PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
7872 .          LS      \\n[#DOC_LEAD]u
7873 .          LEFT
7874 .       \}
7875 .       nr #Q_TOP \\n(nl
7876 .       if \\n[#PRINT_STYLE]=1 \{\
7877 .          if \\n[#UNDERLINE_QUOTES] \{\
7878 .               FT I
7879 .          \}
7880 .       \}
7881 .    \}
7882 .    el \{ .DO_QUOTE \}
7883 .END
7886 \# ---Blockquotes---
7888 \# BLOCKQUOTE FAMILY
7889 \# -----------------
7890 \# *Argument:
7891 \#   <family to use in blockquotes>
7892 \# *Function:
7893 \#   Creates or modifies string $BQUOTE_FAM.
7894 \# *Notes:
7895 \#   Default is same as running text.
7897 .MAC BLOCKQUOTE_FAMILY END
7898 .    ds $BQUOTE_FAM \\$1
7899 .END
7902 \# BLOCKQUOTE FONT
7903 \# ---------------
7904 \# *Argument:
7905 \#   <font to use in blockquotes>
7906 \# *Function:
7907 \#   Creates or modifies string $BQUOTE_FT.
7908 \# *Notes:
7909 \#   Default is same as running text.
7911 .MAC BLOCKQUOTE_FONT END
7912 .    ds $BQUOTE_FT \\$1
7913 .END
7916 \# BLOCKQUOTE SIZE
7917 \# ---------------
7918 \# *Argument:
7919 \#   <-|+ number of points by which to de/increase point size of blockquotes
7920 \#   (relative to running text)>
7921 \# *Function:
7922 \#   Creates or modifies string $BQUOTE_SIZE_CHANGE.
7923 \# *Notes:
7924 \#   Must be preceded by a - or + sign with no space afterwards.
7925 \#   Fractional point sizes are allowed.
7926 \#   Default is -1 for printstyle TYPESET; +0 for TYPEWRITE.
7928 .MAC BLOCKQUOTE_SIZE END
7929 .    ds $BQUOTE_SIZE_CHANGE \\$1
7930 .END
7933 \# BLOCKQUOTE QUAD
7934 \# ---------------
7935 \# *Arguments:
7936 \#   <quad to use in blockquotes>
7937 \# *Function:
7938 \#   Creates or modifies string $BQUOTE_QUAD.
7939 \# *Notes:
7940 \#   Default is LEFT.
7942 .MAC BLOCKQUOTE_QUAD END
7943 .    ds $BQUOTE_QUAD \\$1
7944 .END
7947 \# BLOCKQUOTE
7948 \# ----------
7949 \# *Arguments:
7950 \#   <none> | <anything>
7951 \# *Function:
7952 \#   Indents quoted text in fill mode and shortens line length
7953 \#   accordingly, or turns BLOCKQUOTE off.
7954 \# *Notes:
7955 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
7956 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
7957 \#   how much space to put before and after.
7959 \#   .PP after blockquote is optional if there's only one para,
7960 \#   but REQUIRED if there's more than one.
7962 .MAC BLOCKQUOTE END
7963 .    br
7964 .    ie '\\$1'' \{\
7965 .       ev BLOCKQUOTE
7966 .       nr #QUOTE    2
7967 .       nr #PP_STYLE 2
7968 .       nr #Q_PP     0
7969 .       di B_QUOTE
7970 .       ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7971 .       if \\n[#ENDNOTE] \{\
7972 .          if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
7973 .             ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7974 .          \}
7975 .          if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
7976 .             ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7977 .          \}
7978 .       \}
7979 .       ta \\n(.lu
7980 .       CHECK_INDENT
7981 .       if \\n[#COLUMNS] \{\
7982 .          ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7983 .          if \\n[#ENDNOTE] \{\
7984 .             if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
7985 .                ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7986 .             \}
7987 .             if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
7988 .                ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7989 .             \}
7990 .          \}
7991 .          ta \\n(.lu
7992 .       \}
7993 .       if \\n[#PRINT_STYLE]=1 \{\
7994 .          fam C
7995 .          ft  R
7996 .          ps  12
7997 .          vs  \\n[#DOC_LEAD]u
7998 .          QUAD LEFT
7999 .          HY OFF
8000 .       \}
8001 .       if \\n[#PRINT_STYLE]=2 \{\
8002 .          FAMILY  \\*[$BQUOTE_FAM]
8003 .          FT      \\*[$BQUOTE_FT]
8004 .          PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
8005 .          LS      \\n[#DOC_LEAD]u
8006 .          if \\n[#ENDNOTE] \{\
8007 .             PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
8008 .          \}
8009 .          QUAD    \\*[$BQUOTE_QUAD]
8010 .          HY
8011 .       \}
8012 .       nr #Q_TOP \\n(nl
8013 .       if \\n[#INDENT_FIRST_PARAS] \{\
8014 .          ie !\\n[#ENDNOTE] \{\
8015 .             if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
8016 .             if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
8017 .          \}
8018 .          el \{\
8019 .             if \\n[#INDENT_FIRSTS]=1 \{\
8020 .                if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
8021 .                if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
8022 .             \}
8023 .          \}
8024 .       \}
8025 .    \}
8026 .    el \{ .DO_QUOTE \}
8027 .END
8030 \# DO QUOTE
8031 \# --------
8032 \# *Arguments:
8033 \#   <none>
8034 \# *Function:
8035 \#   Ends the diversion P_QUOTE or B_QUOTE.  Spaces them according to
8036 \#   PRINT_STYLE, whether there's inter-paragraph spacing, and page
8037 \#   position.  TYPEWRITE treats spacing the same way in all circumstance
8038 \#   (viz. an extra line space).  TYPESET puts in only half
8039 \#   line spaces if the entire quote plus 1 line of body under the quote
8040 \#   fits on the the page; otherwise it puts in a full extra blank
8041 \#   line.  (This is to ensure the page remains bottom aligned).
8043 .MAC DO_QUOTE END
8044 .    di
8045 .    REMOVE_INDENT
8046 .    ev
8047 \#   **Change *1 to *2 in next line to prevent orphans after quotes
8048 .    if \\n[#ENDNOTE] \{\
8049 .       nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
8050 .       ALWAYS_FULLSPACE_QUOTES
8051 .    \}
8052 .    nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
8053 .    if \\n[#PRINT_STYLE]=1 \{\
8054 .       if \\n[#START]=1 \{ . \}
8055 .       if \\n[#START]=0 \{\
8056 .          if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8057 .       \}
8058 .       if \\n[#HEAD] \{\
8059 .          if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
8060 .       \}
8061 .    \}
8062 .    if \\n[#PRINT_STYLE]=2 \{\
8063 .       ie \\n[#PP_SPACE] \{\
8064 .          ie \\n[#HEAD]>0 \{ . \}
8065 .          el \{\
8066 .             ie \\n[#START] \{ . \}
8067 .             el \{ .ALD \\n[#DOC_LEAD]u \}
8068 .          \}
8069 .       \}
8070 .       el \{\
8071 .          ie \\n[#Q_DEPTH]<\\n[#TRAP_DISTANCE] \{\
8072 .             nr #Q_FITS 1
8073 .             ie \\n[#HEAD]=1 \{ . \}
8074 .             el \{\
8075 .                ie \\n[#START] \{ . \}
8076 .                el \{\
8077 .                   ie \\n[#FULLSPACE_QUOTES] \{\
8078 .                      ie \\n[#ENDNOTE] \{\
8079 .                         ALD \\n[#EN_LEAD]u
8080 .                      \}
8081 .                      el \{ .ALD \\n[#DOC_LEAD]u \}
8082 .                   \}
8083 .                   el \{\
8084 .                      ie \\n[#ENDNOTE] \{\
8085 .                         ALD \\n[#EN_LEAD]u/2u
8086 .                      \}
8087 .                      el \{ .ALD \\n[#DOC_LEAD]u/2u \}
8088 .                   \}
8089 .                \}
8090 .             \}
8091 .          \}
8092 .          el \{\
8093 .             rr #Q_FITS
8094 .             ie r#HEAD \{\
8095 .                if \\n[#HEAD]=1 \{ . \}
8096 .             \}
8097 .             el \{\
8098 .                ie \\n[#ENDNOTE] \{ .ALD \\n[#EN_LEAD]u \}
8099 .                el \{ .ALD \\n[#DOC_LEAD]u \}
8100 .             \}
8101 .          \}
8102 .       \}
8103 .    \}
8104 .    nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8105 .    if \\n[#COLUMNS] \{\
8106 .       nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8107 .    \}
8108 .    if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
8109 .    if \\n[#ENDNOTE] \{\
8110 .       in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
8111 .    \}
8112 .    if \\n[#QUOTE]=1 \{\
8113 .       nf
8114 .       P_QUOTE
8115 .       if !\\n[#START] \{ .rr #QUOTE \}
8116 .    \}
8117 .    if \\n[#QUOTE]=2 \{\
8118 .       nf
8119 .       B_QUOTE
8120 .    \}
8121 .    if \\n[#PRINT_STYLE]=1 \{\
8122 .       ALD \\n[#DOC_LEAD]u
8123 .    \}
8124 .    if \\n[#PRINT_STYLE]=2 \{\
8125 .       ie \\n[#START] \{\
8126 .          ie \\n[#PP_SPACE] \{ . \}
8127 .          el \{ .ALD \\n[#DOC_LEAD]u \}
8128 .       \}
8129 .       el \{\
8130 .          ie \\n[#PP_SPACE] \{ . \}
8131 .          el \{\
8132 .             ie \\n[#HEAD]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8133 .             el \{\
8134 .                ie \\n[#Q_FITS] \{\
8135 .                   ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
8136 .                      nr #Q_AT_TOP 1
8137 .                      ALD \\n[#DOC_LEAD]u
8138 .                   \}
8139 .                   el \{\
8140 .                      ie \\n[#FULLSPACE_QUOTES] \{ .ALD \\n[#DOC_LEAD]u \}
8141 .                      el \{ .ALD \\n[#DOC_LEAD]u/2u \}
8142 .                   \}
8143 .                \}
8144 .                el \{ .ALD \\n[#DOC_LEAD]u \}
8145 .             \}
8146 .          \}
8147 .       \}
8148 .    \}
8149 .    if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
8150 .    if r#HEAD     \{ .rr #HEAD     \}
8151 .    if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8152 .    rr #Q_PP
8153 .    rr #LINEBREAK
8154 .    nr #PP_STYLE  1
8155 .    nr #END_QUOTE 1
8156 .    if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
8157 .    if \\n[#ENDNOTE] \{\
8158 .       in \\n[#EN_TEXT_INDENT]u
8159 .    \}
8160 .    if \\n[#COLUMNS] \{\
8161 .       if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
8162 .       if \\n[#ENDNOTE] \{\
8163 .          in \\n[#EN_TEXT_INDENT]u
8164 .       \}
8165 .    \}
8166 .    ie !\\n[#ENDNOTE] \{\
8167 .       nr #RESET_PP_INDENT \\n[#PP_INDENT]
8168 .       PARA_INDENT 0
8169 .       PP
8170 .       PARA_INDENT \\n[#RESET_PP_INDENT]u
8171 .       QUAD \\*[$DOC_QUAD]
8172 .    \}
8173 .    el \{\
8174 .       nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
8175 .       ENDNOTE_PARA_INDENT 0
8176 .       PP
8177 .       ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
8178 .       QUAD \\*[EN_QUAD]
8179 .    \}
8180 .END
8182 \# ====================================================================
8184 \# BREAK QUOTE
8185 \# -----------
8186 \# *Arguments:
8187 \#   <none>
8188 \# *Function:
8189 \#   Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
8190 \#   page, and reinvokes BLOCKQUOTE.
8191 \# *Notes:
8192 \#   Because quotes go into a diversion before they're output,
8193 \#   footnotes in quotes that cross pages behave erratically.  The footnote
8194 \#   isn't processed until the diversion ends, hence the footnote
8195 \#   marker in the quote isn't always correct for the new page (it's
8196 \#   picked up from the old one).  BREAK_QUOTE is a workaround for
8197 \#   this problem.
8199 .MAC BREAK_QUOTE END
8200 .    br
8201 .    di
8202 .    nr #BROKEN_QUOTE 1
8203 .    REMOVE_INDENT
8204 .    ev
8205 .    nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
8206 .    if \\n[#PRINT_STYLE]=1 \{\
8207 .       if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8208 .       if \\n[#HEAD] \{\
8209 .          if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
8210 .       \}
8211 .    \}
8212 .    if \\n[#PRINT_STYLE]=2 \{\
8213 .       ie \\n[#PP_SPACE] \{\
8214 .          ie \\n[#HEAD]=1 \{ . \}
8215 .          el \{\
8216 .             if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
8217 .          \}
8218 .       \}
8219 .       el \{\
8220 .          rr #Q_FITS
8221 .          ie r#HEAD \{\
8222 .             if \\n[#HEAD]=1 \{ . \}
8223 .          \}
8224 .          el \{ .ALD \\n[#DOC_LEAD]u \}
8225 .       \}
8226 .    \}
8227 .    nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
8228 .    if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
8229 .    po \\n[#Q_OFFSET]u
8230 .    if \\n[#QUOTE]=1 \{\
8231 .       nf
8232 .       P_QUOTE
8233 .       if !\\n[#START] \{ .rr #QUOTE \}
8234 .    \}
8235 .    if \\n[#QUOTE]=2 \{\
8236 .       nf
8237 .       B_QUOTE
8238 .    \}
8239 .    if r#HEAD     \{ .rr #HEAD     \}
8240 .    if r#EPIGRAPH \{ .rr #EPIGRAPH \}
8241 .    rr #Q_PP
8242 .    rr #LINEBREAK
8243 .    nr #PP_STYLE  1
8244 .    nr #END_QUOTE 1
8245 .    if \\n[#PRINT_STYLE]=1 \{\
8246 .       if \\n[#UNDERLINE_QUOTES] \{\
8247 .          UNDERLINE OFF
8248 .       \}
8249 .    \}
8250 .    po \\n[#L_MARGIN]u
8251 .    if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
8252 .    QUAD \\*[$DOC_QUAD]
8253 .    sp |\\n[#PAGE_LENGTH]u  \" To trip footer/header
8254 .    BLOCKQUOTE
8255 .END
8257 \# ====================================================================
8259 \# +++PAGINATION+++
8261 \# PAGINATE
8262 \# --------
8263 \# *Arguments:
8264 \#   <none> | <anything>
8265 \# *Function:
8266 \#   Turns page numbering off or on.
8267 \# *Notes:
8268 \#   Page numbering is on by default with .PAPER.
8269 \#   Default is on.
8271 .MAC PAGINATE END
8272 .    ie '\\$1'' \{ .nr #PAGINATE 1 \}
8273 .    el \{ .nr #PAGINATE 0 \}
8274 .END
8277 \# SUSPEND PAGINATION (before ENDNOTES)
8278 \# ------------------
8279 \# *Argument:
8280 \#   <none>
8281 \# *Function:
8282 \#   Creates register #SUSPEND_PAGINATION
8283 \# *Notes:
8284 \#   Useful only to suspend pagination before outputting endnotes.
8286 .MAC SUSPEND_PAGINATION END
8287 .    nr #SUSPEND_PAGINATION 1
8288 .END
8290 \# RESTORE PAGINATION (after ENDNOTES)
8291 \# ------------------
8292 \# *Argument:
8293 \#   <none>
8294 \# *Function:
8295 \#   Removes register #SUSPEND_PAGINATION.  Creates register
8296 \#   #DEFER_PAGINATION
8297 \# *Notes:
8298 \#   Useful only to restore pagination after outputting endnotes.
8300 .MAC RESTORE_PAGINATION END
8301 .    rr #SUSPEND_PAGINATION
8302 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .PAGINATE \}
8303 .    if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #DEFER_PAGINATION 1 \}
8304 .END
8307 \# PAGENUMBER FAMILY
8308 \# -----------------
8309 \# *Argument:
8310 \#   <family to use for page numbers>
8311 \# *Function:
8312 \#   Creates or modifies string $PAGE_NUM_FAM.
8313 \# *Notes:
8314 \#   Default is same as running text.
8316 .MAC PAGENUM_FAMILY END
8317 .    ds $PAGE_NUM_FAM \\$1
8318 .END
8321 \# PAGE NUMBER FONT
8322 \# ----------------
8323 \# *Arguments:
8324 \#   <font to use for page numbers>
8325 \# *Function:
8326 \#   Creates or modifies string $PAGE_NUM_FT.
8327 \# *Notes:
8328 \#   Default is same as running text.
8330 .MAC PAGENUM_FONT END
8331 .    ds $PAGE_NUM_FT \\$1
8332 .END
8335 \# PAGE NUMBER SIZE
8336 \# ----------------
8337 \# *Argument:
8338 \#   <+|- number of points by which to in/decrease point size of
8339 \#   page numbers (relative to running text)>
8340 \# *Function:
8341 \#   Creates or modifies string $PAGE_NUM_SIZE_CHANGE.
8342 \# *Notes:
8343 \#   Must be preceded by a +|- sign with no space afterward.
8344 \#   Fractional point sizes are allowed.
8345 \#   Default is +0.
8347 .MAC PAGENUM_SIZE END
8348 .    ds $PAGE_NUM_SIZE_CHANGE \\$1
8349 .END
8352 \# PAGE NUMBER FORMAT
8353 \# ------------------
8354 \# *Arguments:
8355 \#   DIGIT | ROMAN | roman | ALPHA | alpha
8356 \# *Function:
8357 \#   Assigns user entered format to #PAGENUMBER.
8359 .MAC PAGENUM_STYLE END
8360 .    nr #PAGENUM_STYLE_SET 1
8361 .    if '\\$1'DIGIT'  \{\
8362 .       ds $PAGENUM_STYLE \\$1
8363 .       af #PAGENUMBER 1
8364 .    \}
8365 .    if '\\$1'ROMAN'  \{\
8366 .       ds $PAGENUM_STYLE \\$1
8367 .       af #PAGENUMBER I
8368 .    \}
8369 .    if '\\$1'roman'  \{\
8370 .       ds $PAGENUM_STYLE \\$1
8371 .       af #PAGENUMBER i
8372 .    \}
8373 .    if '\\$1'ALPHA'  \{\
8374 .       ds $PAGENUM_STYLE \\$1
8375 .       af #PAGENUMBER A
8376 .    \}
8377 .    if '\\$1'alpha'  \{\
8378 .       ds $PAGENUM_STYLE \\$1
8379 .       af #PAGENUMBER a
8380 .    \}
8381 .END
8384 \# HYPHENS AROUND PAGE NUMBERS
8385 \# ---------------------------
8386 \# *Arguments:
8387 \#   <none> | <anything>
8388 \# *Function:
8389 \#   Creates or modifies register #PAGE_NUM_HYPHENS.
8390 \#   Used to dis/enable hyphens on either side of page numbers.
8391 \# *Notes:
8392 \#   Default is on.
8394 .MAC PAGENUM_HYPHENS END
8395 .    nr #PAGE_NUM_HYPHENS_SET 1
8396 .    ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
8397 .    el \{ .rr #PAGE_NUM_HYPHENS   \}
8398 .END
8401 \# PAGENUMBER POSITION
8402 \# -------------------
8403 \# *Arguments:
8404 \#   TOP | BOTTOM  LEFT | CENTER | RIGHT
8405 \# *Function:
8406 \#   Creates or modifies various PAGE_NUM_H | V_POS registers.
8407 \#   Used to position page numbers.
8408 \# *Notes:
8409 \#   Default is center/bottom.
8411 .MAC PAGENUM_POS END
8412 .    nr #PAGE_NUM_POS_SET 1
8413 .    if '\\$1'TOP'    \{ .nr #PAGE_NUM_V_POS 1 \}
8414 .    if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
8415 .    if '\\$2'LEFT'   \{ .nr #PAGE_NUM_H_POS 1 \}
8416 .    if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
8417 .    if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
8418 .    if '\\$2'RIGHT'  \{ .nr #PAGE_NUM_H_POS 3 \}
8419 .END
8422 \# PRINT PAGE NUMBER
8423 \# -----------------
8424 \# *Arguments:
8425 \#   <none>
8426 \# *Function:
8427 \#   Prints page number if PAGEINATE=1.
8429 .MAC PRINT_PAGE_NUMBER END
8430 .    ev PAGENUMBER
8431 .    po \\n[#DOC_L_MARGIN]u
8432 .    ll \\n[#DOC_L_LENGTH]u
8433 .    ta \\n(.lu
8434 .    FAMILY  \\*[$PAGE_NUM_FAM]
8435 .    FT      \\*[$PAGE_NUM_FT]
8436 .    PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
8437 .    if \\n[#PRINT_STYLE]=1 \{\
8438 .       fam C
8439 .       ft  R
8440 .       ps 12
8441 .    \}
8442 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
8443 .    if o \{\
8444 .       ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT  \}
8445 .       el                        \{ .RIGHT \}
8446 .    \}
8447 .    if e \{\
8448 .       ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
8449 .       el                        \{ .LEFT  \}
8450 .    \}
8451 .    if \\n[#PAGE_NUM_H_POS]=2    \{.CENTER \}
8452 .    if \\n[#RECTO_VERSO]=0 \{\
8453 .       if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT   \}
8454 .       if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
8455 .       if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT  \}
8456 .    \}
8457 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
8458 .    if \\n[#EN_FIRST_PAGE] \{\
8459 .       if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
8460 .       rr #EN_FIRST_PAGE
8461 .    \}
8462 .    if \\n[#TOC_FIRST_PAGE] \{\
8463 .       PAGENUMBER 1
8464 .       rr #TOC_FIRST_PAGE
8465 .    \}
8466 .    ie \\n[#DRAFT_WITH_PAGENUM] \{\
8467 .       ie !\\n[#REVISION] \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT] / \\n[#PAGENUMBER]" \}
8468 .       el \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT], \\*[$REVISION_STRING] \\n[#REVISION] / \\n[#PAGENUMBER]" \}
8469 .    \}
8470 .    el \{\
8471 .       ie \\n[#PAGE_NUM_HYPHENS] \{ .PRINT "- \\n[#PAGENUMBER] -" \}
8472 .       el \{ .PRINT "\\n[#PAGENUMBER]" \}
8473 .    \}
8474 .    ev
8475 .END
8477 \# ====================================================================
8479 \# +++FOOTNOTES+++
8481 \# FOOTNOTE FAMILY
8482 \# --------------
8483 \# *Argument:
8484 \#   <family to use in footnotes>
8485 \# *Function:
8486 \#   Creates or modifies string $FN_FAM.
8487 \# *Notes:
8488 \#   Default is same as running text.
8490 .MAC FOOTNOTE_FAMILY END
8491 .    ds $FN_FAM \\$1
8492 .END
8495 \# FOOTNOTE FONT
8496 \# --------------
8497 \# *Argument:
8498 \#   <font to use in footnotes>
8499 \# *Function:
8500 \#   Creates or modifies string $FN_FT.
8501 \# *Notes:
8502 \#   Default is roman.
8504 .MAC FOOTNOTE_FONT END
8505 .    ds $FN_FT \\$1
8506 .END
8509 \# FOOTNOTE SIZE
8510 \# ------------
8511 \# *Argument:
8512 \#   <+|- number of points by which to in/decrease point size of footnotes
8513 \#   (relative to running text)>
8514 \# *Function:
8515 \#   Creates or modifies string $FN_SIZE_CHANGE.
8516 \# *Notes:
8517 \#   Must be preceded by a +|- sign.  No space afterwards.
8518 \#   Fractional point sizes are allowed.
8519 \#   Default is -2 for printstyle TYPESET; +0 for TYPEWRITE.
8521 .MAC FOOTNOTE_SIZE END
8522 .    ds $FN_SIZE_CHANGE \\$1
8523 .END
8526 \# FOOTNOTE AUTOLEAD
8527 \# -----------------
8528 \# *Arguments:
8529 \#   <autolead value for footnotes>
8530 \# *Function:
8531 \#   Creates or modifies register #FN_AUTOLEAD.
8532 \# *Notes:
8533 \#   Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
8535 .MAC FOOTNOTE_AUTOLEAD END
8536 .    nr #FN_AUTOLEAD \\$1
8537 .END
8540 \# FOOTNOTE QUAD
8541 \# -------------
8542 \# *Arguments:
8543 \#   <quad to use in footnotes>
8544 \# *Function:
8545 \#   Creates or modifies string $FN_QUAD.
8546 \# *Notes:
8547 \#   Default is same as running text.
8549 .MAC FOOTNOTE_QUAD END
8550 .    ds $FN_QUAD \\$1
8551 .END
8554 \# FOOTNOTE MARKERS
8555 \# ----------------
8556 \# *Arguments:
8557 \#   <none> | <anything>
8558 \# *Function:
8559 \#   Turns generation of footnote markers on or off.
8560 \# *Notes:
8561 \#   Default is on.
8563 .MAC FOOTNOTE_MARKERS END
8564 .    ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
8565 .    el \{ .nr #FN_MARKERS 0 \}
8566 .END
8569 \# FOOTNOTE MARKER STYLE
8570 \# ---------------------
8571 \# *Arguments:
8572 \#   STAR | NUMBER
8573 \# *Function:
8574 \#   Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
8575 \#   the style of footnote markers.
8576 \# *Notes:
8577 \#   1=STAR; 2=NUMBER.  Default is STAR.
8579 .MAC FOOTNOTE_MARKER_STYLE END
8580 .    if '\\$1'STAR' \{\
8581 .       nr #FN_MARKER_STYLE 1
8582 .    \}
8583 .    if '\\$1'NUMBER' \{\
8584 .       nr #FN_MARKER_STYLE 2
8585 .    \}
8586 .END
8589 \# RESET FOOTNOTE NUMBER
8590 \# ---------------------
8591 \# *Arguments:
8592 \#   <none> | PAGE
8593 \# *Function:
8594 \#   Resets register #FN_NUMBER to 1.  If argument is PAGE, creates
8595 \#   toggle #RESET_FN_NUMBER which is checked in HEADER.  If 1,
8596 \#   numbered footnotes on every page start at 1.
8598 .MAC RESET_FOOTNOTE_NUMBER END
8599 .    ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
8600 .    el \{ .nr #RESET_FN_NUMBER 1 \}
8601 .END
8604 \# FOOTNOTE RULE LENGTH
8605 \# --------------------
8606 \# *Arguments:
8607 \#   <length of rule used to separate footnotes from running text>
8608 \# *Function:
8609 \#   Creates or modifies registers #FN_RULE_LENGTH.
8610 \# *Notes:
8611 \#   Requires unit of measure (iPpcm).
8612 \#   Default is 4P for both PRINTSTYLEs.
8614 .MAC FOOTNOTE_RULE_LENGTH END
8615 .    nr #FN_RULE_LENGTH (\\$1)
8616 .END
8619 \# FOOTNOTE_RULE_ADJ
8620 \# -----------------
8621 \# *Arguments:
8622 \#   <number of points to raise footnote rule from it's baseline position>
8623 \# *Function:
8624 \#   Creates or modifies register #FN_RULE_ADJ.
8625 \# *Notes:
8626 \#   Default is 3p for both TYPESTYLES.
8628 \#   Requires unit of measure.
8630 .MAC FOOTNOTE_RULE_ADJ END
8631 .    nr #FN_RULE_ADJ (\\$1)
8632 .END
8635 \# FOOTNOTE RULE
8636 \# -------------
8637 \# *Arguments:
8638 \#   <none> | <anything>
8639 \# *Function:
8640 \#   Turns printing of footnote separator rule on or off.  If invoked as
8641 \#   PRINT_FOOTNOTE_RULE, prints footnote separator rule.
8642 \# *Notes:
8643 \#   Default is on.
8645 \#   Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
8646 \#   if the footnote number (#FN_COUNT) is 1.
8648 .MAC FOOTNOTE_RULE END
8649 .    ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
8650 .       if \\n[#FN_RULE]=0 \{ .RLD 1v \}
8651 \!.     PT_SIZE 12  \"Not sure why these have to be transparently embedded, but they do.
8652 .       RLD 1v
8653 .       LEFT
8654 .       PRINT \\v'-\\n[#FN_RULE_ADJ]u'\\l'\\n[#FN_RULE_LENGTH]u'\\v'+\\n[#FN_RULE_ADJ]u'
8655 \!.     PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
8656 .       QUAD \\*[$FN_QUAD]
8657 .    \}
8658 .    el \{\
8659 .       ie '\\$1'' \{ .nr #FN_RULE 1 \}
8660 .       el \{ .nr #FN_RULE 0 \}
8661 .    \}
8662 .END
8665 \# FOOTNOTE
8666 \# --------
8667 \# *Arguments:
8668 \#   <none> | INDENT  L|LEFT|R|RIGHT|B|BOTH  <indent value> > | <anything>
8669 \# *Function:
8670 \#   Begins collecting and diverting footnote text if no argument
8671 \#   given.  Otherwise, ends diversion FOOTNOTES, measures footnote
8672 \#   depth, and sets footnote trap.
8673 \# *Notes:
8674 \#   The input line preceding a footnote call MUST terminate with \c
8675 \#   or the footnote marker will be spaced away from the word it
8676 \#   should be joined to.
8678 \#   If FOOTNOTES is invoked with INDENT, the footnote will
8679 \#   be indented.  An indent style and an indent value must be given.
8680 \#   Subsequent footnotes will NOT be indented; INDENT must be given
8681 \#   for each footnote the user wants indented.
8683 .MAC FOOTNOTE END
8684 .    ie '\\$1'' \{\
8685 .       if \\n[#FN_MARKERS] \{\
8686 .          if \\n[#CONDENSE] \{ \*[CONDX]\c \}
8687 .          if \\n[#EXTEND]   \{ \*[EXTX]\c  \}
8688 .          if \\n[#PRINT_STYLE]=1 \{\
8689 .             if \\n[#UNDERLINE_ON] \{\
8690 .                nr #UNDERLINE_WAS_ON 1
8691 .                UNDERLINE OFF
8692 .             \}
8693 .          \}
8694 .          if !\\n[#NO_FN_MARKER] \{\
8695 .             if \\n[#FN_MARKER_STYLE]=1 \{\
8696 .                ie \\n[#FN_COUNT_FOR_COLS] \{\
8697 .                   if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU3]* \}
8698 .                   if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU3]\(dg \}
8699 .                   if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \*[BU3]** \}
8700 .                   if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
8701 .                   if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU3]*** \}
8702 .                   if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
8703 .                   if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU3]**** \}
8704 .                   if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
8705 .                   if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \*[BU3]***** \}
8706 .                   if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg \}
8707 .                \}
8708 .                el \{\
8709 .                   if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU3]* \}
8710 .                   if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU3]\(dg \}
8711 .                   if \\n[#FN_COUNT]=2 \{ .PRINT \*[BU3]** \}
8712 .                   if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
8713 .                   if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU3]*** \}
8714 .                   if \\n[#FN_COUNT]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
8715 .                   if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU3]**** \}
8716 .                   if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
8717 .                   if \\n[#FN_COUNT]=8 \{ .PRINT \*[BU3]***** \}
8718 .                   if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg\(dg \}
8719 .                \}
8720 .             \}
8721 .             if \\n[#FN_MARKER_STYLE]=2 \{\
8722 .                if \\n[#PRINT_STYLE]=1 \{ .PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#FN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2" \}
8723 .                if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]" \}
8724 .             \}
8725 .          \}
8726 .       \}
8727 .       nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-(\\n(nl+1v)
8728 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
8729 .       nr #PP_STYLE 2
8730 .       if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
8731 .       INDENT_FIRST_PARAS
8732 .       ev FOOTNOTES
8733 .       ll \\n[#DOC_L_LENGTH]u
8734 .       ta \\n(.lu
8735 .       if \\n[#COLUMNS] \{\
8736 .          ll \\n[#COL_L_LENGTH]u
8737 .          ta \\n(.lu
8738 .       \}
8739 .       if \\n[#FN_R_INDENT]  \{\
8740 .          ll -\\n[#FN_R_INDENT]u
8741 .          ta \\n(.lu
8742 .       \}
8743 .       if \\n[#FN_BR_INDENT] \{\
8744 .          ll -\\n[#FN_BR_INDENT]u
8745 .          ta \\n(.lu
8746 .       \}
8747 .       FAMILY   \\*[$FN_FAM]
8748 .       FT       \\*[$FN_FT]
8749 .       PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
8750 .       AUTOLEAD \\n[#FN_AUTOLEAD]
8751 .       QUAD     \\*[$FN_QUAD]
8752 .       if \\n[#PRINT_STYLE]=1 \{\
8753 .          fam C
8754 .          ft  R
8755 .          ps 12
8756 .          ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
8757 .          el \{ .vs \\n[#DOC_LEAD]u/2u \}
8758 .          QUAD LEFT
8759 .          HY OFF
8760 .       \}
8761 .       nr #FN_LEAD \\n[#LEAD]
8762 .       da FOOTNOTES
8763 .       if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
8764 .       if \\n[#FN_DEFER_SPACE] \{\
8765 .          if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
8766 .          if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
8767 .          rr #FN_DEFER_SPACE
8768 .       \}
8769 .       if \\n+[#FN_COUNT]=1 \{\
8770 .          if !\\n[#FN_DEPTH] \{\
8771 .             if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8772 .             ie \\n[#FN_RULE] \{ .PRINT_FOOTNOTE_RULE \}
8773 .             el \{ .ALD 1v \}
8774 .          \}
8775 .       \}
8776 .       if \\n[#FN_MARKERS] \{\
8777 .          if !\\n[#NO_FN_MARKER] \{\
8778 .             if \\n[#FN_MARKER_STYLE]=1 \{\
8779 .                ie \\n+[#FN_COUNT_FOR_COLS] \{\
8780 .                   if \\n[#FN_COUNT_FOR_COLS]=1  \{ .PRINT *\c \}
8781 .                   if \\n[#FN_COUNT_FOR_COLS]=2  \{ .PRINT \(dg\c \}
8782 .                   if \\n[#FN_COUNT_FOR_COLS]=3  \{ .PRINT **\c \}
8783 .                   if \\n[#FN_COUNT_FOR_COLS]=4  \{ .PRINT \(dg\(dg\c \}
8784 .                   if \\n[#FN_COUNT_FOR_COLS]=5  \{ .PRINT ***\c \}
8785 .                   if \\n[#FN_COUNT_FOR_COLS]=6  \{ .PRINT \(dg\(dg\(dg\c \}
8786 .                   if \\n[#FN_COUNT_FOR_COLS]=7  \{ .PRINT ****\c \}
8787 .                   if \\n[#FN_COUNT_FOR_COLS]=8  \{ .PRINT \(dg\(dg\(dg\(dg\c \}
8788 .                   if \\n[#FN_COUNT_FOR_COLS]=9  \{ .PRINT *****\c \}
8789 .                   if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
8790 .                \}
8791 .                el \{\
8792 .                   if \\n[#FN_COUNT]=1  \{ .PRINT *\c \}
8793 .                   if \\n[#FN_COUNT]=2  \{ .PRINT \(dg\c \}
8794 .                   if \\n[#FN_COUNT]=3  \{ .PRINT **\c \}
8795 .                   if \\n[#FN_COUNT]=4  \{ .PRINT \(dg\(dg\c \}
8796 .                   if \\n[#FN_COUNT]=5  \{ .PRINT ***\c \}
8797 .                   if \\n[#FN_COUNT]=6  \{ .PRINT \(dg\(dg\(dg\c \}
8798 .                   if \\n[#FN_COUNT]=7  \{ .PRINT ****\c \}
8799 .                   if \\n[#FN_COUNT]=8  \{ .PRINT \(dg\(dg\(dg\(dg\c \}
8800 .                   if \\n[#FN_COUNT]=9  \{ .PRINT *****\c \}
8801 .                   if \\n[#FN_COUNT]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
8802 .                \}
8803 .             \}
8804 .             if \\n[#FN_MARKER_STYLE]=2 \{\
8805 .                if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
8806 .                if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\c" \}
8807 .             \}
8808 .         \}
8809 .      \}
8810 .    \}
8811 .    el \{\
8812 .       ie '\\$1'INDENT' \{\
8813 .          ev FOOTNOTES
8814 .          if '\\$2'L'     \{ .in (\\$3)  \}
8815 .          if '\\$2'LEFT'  \{ .in (\\$3)  \}
8816 .          if '\\$2'R'     \{ .nr #FN_R_INDENT (\\$3) \}
8817 .          if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
8818 .          if '\\$2'B' \{\
8819 .             nr #FN_BL_INDENT (\\$3)
8820 .             ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
8821 .             el \{ .nr #FN_BR_INDENT (\\$4) \}
8822 .             in \\n[#FN_BL_INDENT]u
8823 .          \}
8824 .          if '\\$2'BOTH' \{\
8825 .             nr #FN_BL_INDENT (\\$3)
8826 .             ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
8827 .             el \{ .nr #FN_BR_INDENT (\\$4) \}
8828 .             in \\n[#FN_BL_INDENT]u
8829 .          \}
8830 .          ev
8831 .          FOOTNOTE
8832 .       \}
8833 .       el \{\
8834 .          br
8835 .          di
8836 .          in 0 \"Turn off indent possibly set by FOOTNOTE INDENT...
8837 .          if \\n[#PRINT_STYLE]=1 \{\
8838 .             if \\n[#UNDERLINE_WAS_ON] \{\
8839 .                UNDERLINE
8840 .                rr #UNDERLINE_WAS_ON
8841 .             \}
8842 .          \}
8843 .          ev
8844 .          rr #FN_R_INDENT
8845 .          rr #FN_BR_INDENT
8846 .          nr #PP_STYLE \\n[#PP_STYLE_PREV]
8847 .          if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
8848 .          rr #INDENT_FIRSTS
8849 .          nr #FN_DEPTH +\\n[#DIVER_DEPTH]
8850 .          if \\n[#FN_DEFER] \{\
8851 .             nr #FN_DEFER_SPACE 1
8852 .             rr #FN_DEFER
8853 .          \}
8854 .          if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
8855 .             ie \\n[#SPACE_REMAINING]<(\\n[#LEAD]*2) \{ .nr #FN_DEFER 1 \}
8856 .             el \{\
8857 .                nr #FN_LINES 0 1
8858 .                while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
8859 .                   nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
8860 .                \}
8861 .             \}
8862 .          \}
8863 .          nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
8864 .          if \\n[#FN_COUNT]=1 \{ .nr #VARIABLE_FOOTER_POS -1v \}
8865 .          \}
8866 .          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
8867 .          if (\\n(nl+1v)>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
8868 .             ch FOOTER \\n(nlu+1v
8869 .          \}
8870 .          if \\n[#FN_DEFER] \{\
8871 .             nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
8872 .             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
8873 .          \}
8874 .       \}
8875 .    nr #NO_FN_MARKER 0
8876 .END
8879 .MAC FN_OVERFLOW_TRAP END
8880 .    if \\n[#FN_COUNT] \{\
8881 .       di FN_OVERFLOW
8882 .     \}
8883 .END
8886 .MAC DIVERT_FN_LEFTOVER END
8887 .    nr #NO_FN_MARKER 1
8888 .    nr #OVERFLOW 1
8889 .    FOOTNOTE
8890 .    nf
8891 .    FN_OVERFLOW
8892 .    FOOTNOTE OFF
8893 .    rr #FN_OVERFLOW_DEPTH
8894 .END
8897 .MAC PROCESS_FN_LEFTOVER END
8898 .    if !\\n[#FN_DEFER] \{\
8899 .       nr #FN_COUNT 0 1
8900 .       nr #FN_DEPTH 0
8901 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
8902 .    \}
8903 .    if \\n[#FN_DEFER] \{\
8904 .       nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]+\\n[#DOC_LEAD])
8905 .    \}
8906 .    nr #SPACE_REMAINING 0
8907 .    ch FOOTER -\\n[#B_MARGIN]u
8908 .    if \\n[#FN_DEFER] \{\
8909 .       nr #NO_FN_MARKER 1
8910 .       da FOOTNOTES
8911 .       di
8912 .       FOOTNOTE
8913 .       nf
8914 .       FOOTNOTE OFF
8915 .    \}
8916 .    if !\\n[#FN_DEFER] \{\
8917 .       if \\n[#FN_OVERFLOW_DEPTH] \{\
8918 .           DIVERT_FN_LEFTOVER
8919 .       \}
8920 .    \}
8921 .    nr #FN_COUNT 0 1
8922 .END
8925 \# ====================================================================
8927 \# +++ENDNOTES+++
8929 \# When endnotes are output, the spacing between the notes is always 1
8930 \# extra linespace.  This can have bottom margin consequences.  If this
8931 \# doesn't bother you, don't worry about it.  If it does bother you, and
8932 \# you want to adjust the spacing between any two endnotes (as they're
8933 \# output), make the spacing adjustments (.ALD/.RLD) at the *end* of
8934 \# endnotes (i.e. just before .ENDNOTE OFF), not at the top.
8936 \# Endnotes must be output manually with .ENDNOTES.  This allows user
8937 \# the flexibility to output endnotes at the end of each collated
8938 \# document, or to output them at the end of the entire document.
8940 \# ENDNOTE FAMILY
8941 \# --------------
8942 \# *Argument:
8943 \#   <family to use in endnotes>
8944 \# *Function:
8945 \#   Creates or modifies string $EN_FAM.
8946 \# *Notes:
8947 \#   Default is same as running text in body of document.
8949 .MAC ENDNOTE_FAMILY END
8950 .    ds $EN_FAM \\$1
8951 .END
8954 \# ENDNOTE FONT
8955 \# ------------
8956 \# *Argument:
8957 \#   <font to use in endnotes>
8958 \# *Function:
8959 \#   Creates or modifies string $EN_FT.
8960 \# *Notes:
8961 \#   Default is roman.
8963 .MAC ENDNOTE_FONT END
8964 .    ds $EN_FT \\$1
8965 .END
8968 \# ENDNOTE POINT SIZE
8969 \# ------------------
8970 \# *Argument:
8971 \#   <base point size for endnotes>
8972 \# *Function:
8973 \#   Creates or modifies register #EN_PS.
8974 \# *Notes:
8975 \#   Default is same as running text in body of document.
8977 \#   This size control macro differs from other size control macros
8978 \#   in that it sets an absolute point size, not a relative one.  This
8979 \#   is because a) endnotes always appear separate from the body of
8980 \#   a document and therefore don't need to be relative to the body
8981 \#   of the document, and b) there are quite a few elements of the
8982 \#   endnotes page(s) that need to be relative to the base point size
8983 \#   of that page.  If the base endnote point size were relative to
8984 \#   the body of the document (i.e. a _SIZE macro taking a +|- value)
8985 \#   getting the rest of the endnote elements sized properly could
8986 \#   become very confusing.
8988 .MAC ENDNOTE_PT_SIZE END
8989 .    nr #EN_PS (p;\\$1)
8990 .END
8993 \# ENDNOTE LEAD
8994 \# ------------
8995 \# *Argument:
8996 \#   <base leading to use in endnotes> [ ADJUST ]
8997 \# *Function:
8998 \#   Creates or modifies register #EN_LEAD.  Creates or removes
8999 \#   register #ADJ_EN_LEAD.  Stores arguments in strings if ENDNOTE_LEAD
9000 \#   set before START.
9001 \# *Notes:
9002 \#   Default is 14 points for TYPESET, adjusted; 24 for TYPEWRITE.
9004 .MAC ENDNOTE_LEAD END
9005 .    if !\\n[#OK_PROCESS_LEAD] \{\
9006 .       ds $EN_LEAD \\$1
9007 .       if !'\\$2'' \{\
9008 .           ds $ADJUST_EN_LEAD \\$2
9009 .       \}
9010 .       return
9011 .    \}
9012 .    rr #ADJ_EN_LEAD
9013 .    nr #EN_LEAD (p;\\$1)
9014 .    if '\\$2'ADJUST' \{\
9015 .       nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
9016 .       nr #ADJ_DOC_LEAD 1
9017 .       nr #ADJ_EN_LEAD 1
9018 .       nr #NO_TRAP_RESET 1
9019 .       DOC_LEAD \\n[#EN_LEAD]u ADJUST
9020 .       nr #EN_LEAD \\n[#DOC_LEAD]
9021 .       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
9022 .       rr #NO_TRAP_RESET
9023 .       rr #ADJ_DOC_LEAD
9024 .       rr #ORIG_DOC_LEAD
9025 .    \}
9026 .END
9029 \# ENDNOTE QUAD
9030 \# ------------
9031 \# *Argument:
9032 \#   LEFT | L | CENTER | C | RIGHT | R | JUSTIFY | J
9033 \# *Function:
9034 \#   Creates or modifies string $EN_QUAD.
9035 \# *Notes:
9036 \#   Default is justified for TYPESET, left for TYPEWRITE.
9038 .MAC ENDNOTE_QUAD END
9039 .    ds $EN_QUAD \\$1
9040 .END
9043 \# ENDNOTES_HDRFTR_CENTER
9044 \# ----------------------
9045 \# *Argument:
9046 \#   toggle
9047 \# *Function:
9048 \#   Creates or removes toggle register #EN_HDRFTR_CENTER, used to
9049 \#   determine whether mom should print a/the hdrftr center string
9050 \#   on the endnotes page.  Primarily to enable/disable printing of the
9051 \#   chapter name in hdrftrs when DOCTYPE CHAPTER.
9052 \# *Notes:
9053 \#   Default is OFF
9055 .MAC ENDNOTES_HDRFTR_CENTER END
9056 .    ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
9057 .    el         \{ .rr #EN_HDRFTR_CENTER   \}
9058 .END
9061 \# ENDNOTE STRING 
9062 \# --------------
9063 \# *Argument:
9064 \#   <title for endnotes page>
9065 \# *Function:
9066 \#   Creates or modifies string $EN_STRING.
9067 \# *Notes:
9068 \#   Default is "Endnotes"
9070 .MAC ENDNOTE_STRING END
9071 .    ds $EN_STRING \\$1
9072 .END
9075 \# ENDNOTE STRING FAMILY
9076 \# ---------------------
9077 \# *Argument:
9078 \#   <family to use for endnote string>
9079 \# *Function:
9080 \#   Creates or modifies string $EN_STRING_FAM.
9081 \# *Notes:
9082 \#   Default is same as running text in body of document.
9084 .MAC ENDNOTE_STRING_FAMILY END
9085 .    ds $EN_STRING_FAM \\$1
9086 .END
9089 \# ENDNOTE STRING FONT
9090 \# -------------------
9091 \# *Argument:
9092 \#   <font to use for endnote string>
9093 \# *Function:
9094 \#   Creates or modifies string $EN_FT.
9095 \# *Notes:
9096 \#   Default is BOLD for TYPEWRITE; roman for TYPESET
9098 .MAC ENDNOTE_STRING_FONT END
9099 .    ds $EN_STRING_FT \\$1
9100 .END
9103 \# ENDNOTE STRING SIZE
9104 \# -------------------
9105 \# *Argument:
9106 \#   <+|- number of points by which to in/decrease endnote string
9107 \#    (relative to base endnote size)>
9108 \# *Function:
9109 \#   Creates or modifies string $EN_STRING_SIZE_CHANGE.
9110 \# *Notes:
9111 \#   Default is +1 for TYPESET.
9113 .MAC ENDNOTE_STRING_SIZE END \"Default for TYPESET is +1
9114 .    ds $EN_STRING_SIZE_CHANGE \\$1
9115 .END
9118 \# ENDNOTE STRING QUAD
9119 \# -------------------
9120 \# *Argument:
9121 \#   LEFT | L | CENTER | C | RIGHT | R
9122 \# *Function:
9123 \#   Creates or modifies string $EN_STRING_QUAD.
9124 \# *Notes:
9125 \#   Default is centered.
9127 .MAC ENDNOTE_STRING_QUAD END
9128 .    ds $EN_STRING_QUAD \\$1
9129 .END
9132 \# ENDNOTE STRING UNDERSCORE
9133 \# -------------------------
9134 \# *Arguments:
9135 \#   toggle | 2
9136 \# *Function:
9137 \#   Turns underscoring of endnote main title on or off.  If the argument
9138 \#   is the digit "2", turns on double-underscoring.
9139 \# *Notes:
9140 \#   Default is double-underscored.
9142 .MAC ENDNOTE_STRING_UNDERSCORE END
9143 .    ie '\\$1'' \{ .nr #EN_STRING_UNDERSCORE 1 \}
9144 .    el \{\
9145 .       ie '\\$1'2' \{ .nr #EN_STRING_UNDERSCORE 2 \}
9146 .       el \{ .nr #EN_STRING_UNDERSCORE 0 \}
9147 .    \}
9148 .END
9151 \# ENDNOTE STRING CAPS
9152 \# -------------------
9153 \# *Arguments:
9154 \#   <none> | <anything>
9155 \# *Function:
9156 \#   Turns capitalization of the endnotes pages title string
9157 \#   "Endnotes" on or off.
9158 \# *Notes:
9159 \#   Users may want the endnotes pages title string to be in caps,
9160 \#   but the toc entry for endnotes in lower case.  If the argument
9161 \#   to ENDNOTE_STRING is in lower case and ENDNOTE_STRING_CAPS is
9162 \#   turned on, this is exactly what will happen.
9164 \#   Default is on.
9166 .MAC ENDNOTE_STRING_CAPS END
9167 .   ie '\\$1'' \{ .nr #EN_STRING_CAPS 1 \}
9168 .   el \{ .rr #EN_STRING_CAPS \}
9169 .END
9172 \# ENDNOTE TITLE
9173 \# -------------
9174 \# *Argument:
9175 \#   <string that appears before the first endnote pertaining to any document>
9176 \# *Function:
9177 \#   Creates string $EN_TITLE_STRING.
9178 \# *Notes:
9179 \#   Default is the document title, or, if doc is a chapter, "Chapter #"
9181 .MAC ENDNOTE_TITLE END
9182 .    ds $EN_TITLE \\$1
9183 .END
9186 \# ENDNOTE TITLE FAMILY
9187 \# --------------------
9188 \# *Argument:
9189 \#   <family to use for endnote title>
9190 \# *Function:
9191 \#   Creates string $EN_TITLE_FAM.
9192 \# *Notes:
9193 \#   Default is same as running text of document.
9195 .MAC ENDNOTE_TITLE_FAMILY END
9196 .    ds $EN_TITLE_FAM \\$1
9197 .END
9200 \# ENDNOTE TITLE FONT
9201 \# ------------------
9202 \# *Argument:
9203 \#   <font to use for endnote title>
9204 \# *Function:
9205 \#   Creates string $EN_TITLE_FT.
9206 \# *Notes:
9207 \#   Default is bold for TYPESET; roman for TYPEWRITE.
9209 .MAC ENDNOTE_TITLE_FONT END
9210 .    ds $EN_TITLE_FT \\$1
9211 .END
9214 \# ENDNOTE TITLE SIZE
9215 \# ------------------
9216 \# *Argument:
9217 \#   <+|- number of points by which to in/decrease endnote title
9218 \#    (relative to base endnote size)>
9219 \# *Function:
9220 \#   Creates string $EN_TITLE_SIZE_CHANGE.
9221 \# *Notes:
9222 \#   Default is 0 (i.e. title same size as text of endnotes).
9224 .MAC ENDNOTE_TITLE_SIZE END
9225 .    ds $EN_TITLE_SIZE_CHANGE \\$1 
9226 .END
9229 \# ENDNOTE TITLE QUAD
9230 \# ------------------
9231 \# *Argument:
9232 \#   <quad direction of endnote title>
9233 \# *Function:
9234 \#   Creates string $EN_TITLE_QUAD.
9235 \# *Notes:
9236 \#   Default is left.
9238 .MAC ENDNOTE_TITLE_QUAD END
9239 .    ds $EN_TITLE_QUAD \\$1
9240 .END
9243 \# ENDNOTE TITLE UNDERSCORE
9244 \# ------------------------
9245 \# *Argument:
9246 \#   toggle
9247 \# *Function:
9248 \#   Creates or removes register #EN_TITLE_UNDERSCORE.
9249 \# *Notes:
9250 \#   Default is to underscore the endnote titles.
9252 .MAC ENDNOTE_TITLE_UNDERSCORE END
9253 .    ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
9254 .    el \{ .rr #EN_TITLE_UNDERSCORE \}
9255 .END
9258 \# ENDNOTE NUMBER FAMILY
9259 \# ---------------------
9260 \# *Argument:
9261 \#   <family to use for endnote numbers on endnotes page>
9262 \# *Function:
9263 \#   Creates string $EN_NUMBER_FAM.
9264 \# *Notes:
9265 \#   Default is same as running text of document.
9267 \#   Family, font, and size of endnote numbers applies only to the
9268 \#   numbers as they appear on the endnotes page(s).  The superscript
9269 \#   numbers that appear in running text are unaffected.
9271 .MAC ENDNOTE_NUMBER_FAMILY END
9272 .    ds $EN_NUMBER_FAM \\$1
9273 .END
9276 \# ENDNOTE NUMBER FONT
9277 \# -------------------
9278 \# *Argument:
9279 \#   <font to use for endnote numbers on endnotes page>
9280 \# *Function:
9281 \#   Creates string $EN_NUMBER_FT.
9282 \# *Notes:
9283 \#   Default is bold for TYPESET; roman for TYPEWRITE.
9285 \#   Family, font, and size of endnote numbers applies only to the
9286 \#   numbers as they appear on the endnotes page(s).  The superscript
9287 \#   numbers that appear in running text are unaffected.
9289 .MAC ENDNOTE_NUMBER_FONT END \"Default for TYPESET is bold
9290 .    ds $EN_NUMBER_FT \\$1
9291 .END
9294 \# ENDNOTE NUMBER SIZE
9295 \# -------------------
9296 \# *Argument:
9297 \#   <+|- number of points by which to in/decrease endnote numbers
9298 \#    (relative to base endnote size)>
9299 \# *Function:
9300 \#   Creates string $EN_NUMBER_SIZE_CHANGE.
9301 \# *Notes:
9302 \#   Default is 0.
9304 \#   Family, font, and size of endnote numbers applies only to the
9305 \#   numbers as they appear on the endnotes page(s).  The superscript
9306 \#   numbers that appear in running text are unaffected.
9308 .MAC ENDNOTE_NUMBER_SIZE END
9309 .    ds $EN_NUMBER_SIZE_CHANGE \\$1
9310 .END
9313 \# ENDNOTE NUMBERS ALIGN RIGHT
9314 \# ---------------------------
9315 \# *Argument:
9316 \#   <max. number of digit placeholders that will appear in endnotes>
9317 \# *Function:
9318 \#   Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
9319 \#   #EN_NUMBER_PLACEHOLDERS.
9320 \# *Notes:
9321 \#   Default is for footnote numbers to be right aligned to 2 placeholders.
9323 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
9324 .    rr #EN_NUMBERS_ALIGN_LEFT
9325 .    nr #EN_NUMBERS_ALIGN_RIGHT 1
9326 .    nr #EN_NUMBER_PLACEHOLDERS \\$1
9327 .END
9330 \# ENDNOTE NUMBERS ALIGN LEFT
9331 \# --------------------------
9332 \# *Argument:
9333 \#   none
9334 \# *Function:
9335 \#   Toggles register #EN_NUMBERS_ALIGN_LEFT on.
9336 \# *Notes:
9337 \#   Default is for footnote numbers to be right aligned to 2 placeholders
9338 \#   (i.e. not left aligned).
9340 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
9341 .    rr #EN_NUMBERS_ALIGN_RIGHT
9342 .    nr #EN_NUMBERS_ALIGN_LEFT 1
9343 .END
9346 \# ENDNOTE PARAGRAPH INDENT
9347 \# ------------------------
9348 \# *Argument:
9349 \#   <first line indent of paras subsequent to 1st in endnotes>
9350 \# *Function:
9351 \#   Creates register #EN_PP_INDENT for use in .PP.
9352 \# *Notes:
9353 \#   Requires a unit of measure.
9355 \#   Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
9357 .MAC ENDNOTE_PARA_INDENT END
9358 .    nr #EN_PP_INDENT (\\$1)
9359 .END
9362 \# TURN OFF COLUMN MODE FOR ENDNOTES
9363 \# ---------------------------------
9364 \# *Argument:
9365 \#   <none> | <anything>
9366 \# *Function:
9367 \#   Creates or removes register #EN_NO_COLS
9368 \# *Notes:
9369 \#   Allows user to tell mom not to set endnotes in columnar
9370 \#   documents in columns.  Default is to set endnotes in columns.
9372 .MAC ENDNOTES_NO_COLUMNS END
9373 .    ie '\\$1'' \{ .nr #EN_NO_COLS 1 \}
9374 .    el \{ .rr #EN_NO_COLS \}
9375 .END
9378 \# NO FIRST PAGE NUMBER ON ENDNOTES FIRST PAGE
9379 \# -------------------------------------------
9380 \# *Argument:
9381 \#   <none> | <anything>
9382 \# *Function:
9383 \#   Creates or removes register #EN_NO_FIRST_PN
9384 \# *Notes:
9385 \#   For use if FOOTERS are on.  Tells ENDNOTES not to put a page
9386 \#   number on the first endnotes page.  Some users may want this.
9387 \#   Default is to print a page number at the top of the first
9388 \#   endnotes page when footers are on.
9390 .MAC ENDNOTES_NO_FIRST_PAGENUM END
9391 .    ie '\\$1'' \{ .nr #EN_NO_FIRST_PN 1 \}
9392 .    el \{ .rr #EN_NO_FIRST_PN \}
9393 .END
9396 \# PAGE HEADERS ON ENDNOTES PAGES
9397 \# ------------------------------
9398 \# *Argument:
9399 \#   <none> | ALL
9400 \# *Function:
9401 \#   Creates or removes register #EN_ALLOWS_HEADERS or
9402 \#   #EN_ALLOWS_HEADERS_ALL
9403 \# *Notes:
9404 \#   Whether ENDNOTES puts a page header at the top of endnotes
9405 \#   pages if page headers are used throughout the document.
9406 \#   Default is to insert the page headers, but not on the first
9407 \#   page.  If the optional argument ALL is given, ENDNOTES puts a
9408 \#   page header on the first page as well.
9410 .MAC ENDNOTES_ALLOWS_HEADERS END
9411 .    ie '\\$1'' \{ .nr #EN_ALLOWS_HEADERS 1 \}
9412 .    el \{\
9413 .       ie '\\$1'ALL' \{\
9414 .          nr #EN_ALLOWS_HEADERS 1
9415 .          nr #EN_ALLOWS_HEADERS_ALL 1
9416 .       \}
9417 .       el \{\
9418 .          rr #EN_ALLOWS_HEADERS
9419 .          rr #EN_ALLOWS_HEADERS_ALL
9420 .       \}
9421 .    \}
9422 .END
9425 \# ENDNOTES PAGES PAGE NUMBERING STYLE
9426 \# ----
9427 \# *Argument:
9428 \#   DIGIT | ROMAN | roman | ALPHA | alpha
9429 \# *Function:
9430 \#   Creates or modifies $EN_PN_STYLE.
9431 \# *Notes:
9432 \#   Allows user to define what style should be used for endnotes
9433 \#   pages page numbering.  Arguments are the same as for
9434 \#   PAGENUM_STYLE.
9436 \#   Default is DIGIT.
9438 .MAC ENDNOTES_PAGENUM_STYLE END
9439 .    ds $EN_PN_STYLE \\$1
9440 .END
9443 \# FIRST PAGE NUMBER FOR ENDNOTES
9444 \# ------------------------------
9445 \# *Argument:
9446 \#   <page number that appears on page 1 of endnotes pages>
9447 \# *Function:
9448 \#   Creates or modifies string $EN_FIRST_PN
9449 \# *Notes:
9450 \#   To be used with caution, only if all endnotes
9451 \#   are to be output at once, i.e. not at the end of the separate
9452 \#   docs of a collated doc
9454 .MAC ENDNOTES_FIRST_PAGENUMBER END
9455 .    nr #EN_FIRST_PN \\$1
9456 .END
9458 \# SINGLESPACE ENDNOTES
9459 \# --------------------
9460 \# *Argument:
9461 \#   <none> | <anything>
9462 \# *Function:
9463 \#   Sets lead of endnotes pages in TYPEWRITE to 12 points,
9464 \#   adjusted.
9465 \# *Notes:
9466 \#   Default is to double-space endnotes pages.
9468 .MAC SINGLESPACE_ENDNOTES END
9469 .    if \\n[#PRINT_STYLE]=1 \{\
9470 .       ie \\n[#SINGLE_SPACE] \{\
9471 .          nr #EN_SINGLESPACE 1
9472 .          rr #IGNORE
9473 .          if \\n[#OK_PROCESS_LEAD] \{\
9474 .             ENDNOTE_LEAD 12 ADJUST
9475 .             nr #IGNORE 1
9476 .          \}
9477 .       \}
9478 .       el \{\
9479 .          ie '\\$1'' \{\
9480 .             nr #EN_SINGLESPACE 1
9481 .             rr #IGNORE
9482 .             if \\n[#OK_PROCESS_LEAD] \{\
9483 .                ENDNOTE_LEAD 12 ADJUST
9484 .                nr #IGNORE 1
9485 .             \}
9486 .          \}
9487 .          el \{\
9488 .             rr #EN_SINGLESPACE
9489 .             rr #IGNORE
9490 .             if \\n[#OK_PROCESS_LEAD] \{\
9491 .                ENDNOTE_LEAD 24 ADJUST
9492 .                nr #IGNORE 1
9493 .             \}
9494 .          \}
9495 .       \}
9496 .    \}
9497 .END
9500 \# ENDNOTE PARAGRAPH SPACE
9501 \# -----------------------
9502 \# *Argument:
9503 \#   toggle
9504 \# *Function:
9505 \#   Creates toggle register #EN_PP_SPACE for use in .PP.
9506 \# *Notes:
9507 \#   Like PARA_SPACE.  Default is not to space endnote paras.
9509 .MAC ENDNOTE_PARA_SPACE END
9510 .    ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
9511 .    el \{ .rr #EN_PP_SPACE \}
9512 .END
9515 \# ENDNOTE
9516 \# -------
9517 \# *Argument:
9518 \#   toggle
9519 \# *Function:
9520 \#   Places superscript endnote number in text, then collects and
9521 \#   processes endnote in diversion END_NOTES.
9522 \# *Notes:
9523 \#   \c must be appended to the word immediately preceding .ENDNOTE.
9525 .MAC ENDNOTE END
9526 .    ie '\\$1'' \{\
9527 .       nr #ENDNOTE 1
9528 .       if \\n[#CONDENSE] \{ \*[CONDX]\c \}
9529 .       if \\n[#EXTEND]   \{ \*[EXTX]\c  \}
9530 .       if \\n[#PRINT_STYLE]=1 \{\
9531 .          if \\n[#UNDERLINE_ON] \{\
9532 .             nr #UNDERLINE_WAS_ON 1
9533 .             UNDERLINE OFF
9534 .          \}
9535 .          if \\n[#SLANT_ON] \{\
9536 .              nr #SLANT_WAS_ON 1
9537 \*[SLANTX]\c
9538 .          \}
9539 .          PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2"
9540 .       \}
9541 .       if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]" \}
9542 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
9543 .       nr #PP_STYLE 1
9544 .       if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
9545 .       INDENT_FIRST_PARAS
9546 .       ev EN
9547 .       da END_NOTES
9548 .       LL \\n[#DOC_L_LENGTH]u
9549 .       ta \\n(.lu
9550 .       if \\n[#COLUMNS] \{\
9551 .          ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
9552 .          el \{ .LL \\n[#COL_L_LENGTH]u \}
9553 .          ta \\n(.lu
9554 .       \}
9555 .       vs \\n[#EN_LEAD]u
9556 .       if \\n[#EN_NUMBER]=1 \{\
9557 \!.        ne 3
9558 .          if \\n[#PRINT_STYLE]=1 \{\
9559 .             fam C
9560 .             ft  R  
9561 .             ps  12
9562 .          \}
9563 .          if \\n[#PRINT_STYLE]=2 \{\
9564 .             FAMILY  \\*[$EN_TITLE_FAM]
9565 .             FT      \\*[$EN_TITLE_FT]
9566 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
9567 .          \}
9568 .          sp
9569 .          if !'\\*[$EN_TITLE]'' \{\
9570 .             if '\\*[$EN_TITLE_QUAD]'L'      \{ .LEFT   \}
9571 .             if '\\*[$EN_TITLE_QUAD]'LEFT'   \{ .LEFT   \}
9572 .             if '\\*[$EN_TITLE_QUAD]'C'      \{ .CENTER \}
9573 .             if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
9574 .             if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
9575 .             if '\\*[$EN_TITLE_QUAD]'R'      \{ .RIGHT  \}
9576 .             if '\\*[$EN_TITLE_QUAD]'RIGHT'  \{ .RIGHT  \}
9577 .             ie \\n[#EN_TITLE_UNDERSCORE] \{\
9578 .                UNDERSCORE "\\*[$EN_TITLE]
9579 .             \}
9580 .             el \{\
9581 .                PRINT "\\*[$EN_TITLE]
9582 .             \}
9583 .          \}
9584 .       \}
9585 .       ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
9586 .          ie \\n[#EN_NUMBER]=1 \{\
9587 .             if !'\\*[$EN_TITLE]'' \{ .sp \}
9588 .          \}
9589 .          el \{ .sp \}
9590 \!.        TRAP OFF
9591 .          if \\n[#PRINT_STYLE]=1 \{\
9592 .             fam C
9593 .             ft  R
9594 .             ps  12
9595 .          \}
9596 .          if \\n[#PRINT_STYLE]=2 \{\
9597 .             FAMILY  \\*[$EN_NUMBER_FAM]
9598 .             FT      \\*[$EN_NUMBER_FT]
9599 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
9600 .          \}
9601 .          nr #RESET_L_LENGTH \\n(.l
9602 .          nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
9603 .          ll \\n[#EN_NUMBER_L_LENGTH]u
9604 .          RIGHT
9605 \En[#EN_NUMBER].
9606 .          if \\n[#PRINT_STYLE]=1 \{\
9607 .             fam C
9608 .             ft  R
9609 .             ps  12
9610 .          \}
9611 .          if \\n[#PRINT_STYLE]=2 \{\
9612 .             FAMILY  \\*[$EN_FAM]
9613 .             FT      \\*[$EN_FT]
9614 .             PT_SIZE \\n[#EN_PS]u
9615 .          \}
9616 .          EL
9617 .          ll \\n[#RESET_L_LENGTH]u
9618 .          in \\n[#EN_NUMBER_L_LENGTH]u+\w'.\0'u
9619 .          nr #EN_TEXT_INDENT \\n(.i
9620 .          QUAD \\*[$EN_QUAD]
9621 \!.        TRAP
9622 .       \}
9623 .       el \{\
9624 .          ie \\n[#EN_NUMBER]=1 \{\
9625 .             if !'\\*[$EN_TITLE]'' \{ .sp \}
9626 .          \}
9627 .          el \{ .sp \}
9628 .          if \\n[#PRINT_STYLE]=1 \{\
9629 .             fam C
9630 .             ft  R
9631 .             ps  12
9632 .          \}
9633 .          if \\n[#PRINT_STYLE]=2 \{\
9634 .             FAMILY  \\*[$EN_NUMBER_FAM]
9635 .             FT      \\*[$EN_NUMBER_FT]
9636 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
9637 .          \}
9638 .          QUAD \\*[$EN_QUAD]
9639 \En[#EN_NUMBER].\0\c
9640 .          if \\n[#PRINT_STYLE]=2 \{\
9641 .             FAMILY  \\*[$EN_FAM]
9642 .             FT      \\*[$EN_FT]
9643 .             PT_SIZE \\n[#EN_PS]u
9644 .          \}
9645 .       \}
9646 .    \}
9647 .    el \{\
9648 .       br
9649 .       if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
9650 .          in 0
9651 .       \}
9652 .       di
9653 .       ev
9654 .       nr #PP_STYLE \\n[#PP_STYLE_PREV]
9655 .       if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
9656 .       rr #INDENT_FIRSTS
9657 .       rr #ENDNOTE
9658 .       if \\n[#PRINT_STYLE]=1 \{\
9659 .          if \\n[#UNDERLINE_WAS_ON] \{\
9660 .             rr #UNDERLINE_WAS_ON
9661 .             UNDERLINE
9662 .          \}
9663 .       \}
9664 .       if \\n[#SLANT_WAS_ON] \{\
9665 .          rr #SLANT_WAS_ON
9666 \*[SLANT]\c
9667 .       \}
9668 .    \}
9669 .END
9672 \# ENDNOTES
9673 \# --------
9674 \# *Arguments:
9675 \#   none
9676 \# *Function:
9677 \#   Sets new document leading from #EN_LEAD, breaks to a new page,
9678 \#   sets up an endnotes page based on registers and strings associated
9679 \#   with endnotes, then outputs diversion END_NOTES.
9681 .MAC ENDNOTES END
9682 .    nr #ENDNOTES 1
9683 .    nr #EN_FIRST_PAGE 1
9684 .    nr #HEADER_STATE \\n[#HEADERS_ON]
9685 .    ds $UR_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
9686 .    if \\n[#HEADERS_ON]=1 \{\
9687 .       if !\\n[#EN_ALLOWS_HEADERS_ALL] \{ .HEADERS OFF \}
9688 .    \}
9689 .    if \\n[#DOC_TYPE]=2 \{\
9690 .       ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
9691 .       el \{ .HDRFTR_CENTER \}
9692 .    \}
9693 .    ie !\\n[#SUSPEND_PAGINATION] \{\
9694 .       if \\n[#PAGINATE]=1 \{\
9695 .          if \\n[#PAGE_NUM_V_POS]=1 \{\
9696 .             ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
9697 .             PAGENUM_STYLE \\*[$EN_PN_STYLE]
9698 .             if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN]-1 \}
9699 .             if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 0 \}
9700 .          \}
9701 .       \}
9702 .    \}
9703 .    el \{\
9704 .       ds $RESTORE_PAGENUM_STYLE \\*[$PAGENUM_STYLE]
9705 .          ie \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 1 \}
9706 .          el \{ .nr #PAGINATE 0 \}
9707 .    \}
9708 .    if \\n[#FOOTERS_ON]=1 \{\
9709 .       if !'\\*[$HDRFTR_CENTER_OLD]'' \{ .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD] \}
9710 .    \}
9711 .    NEWPAGE
9712 .    if \\n[#FINIS] \{\
9713 .       if \\n[#FOOTERS_WERE_ON] \{\
9714 .          FOOTERS
9715 .          rr #FOOTERS_WERE_ON
9716 .       \}
9717 .       if \\n[#PAGINATION_WAS_ON] \{\
9718 .          PAGINATE
9719 .          rr #PAGINATION_WAS_ON
9720 .       \}
9721 .       rr #FINIS
9722 .    \}
9723 .    if \\n[#FOOTERS_WERE_ON] \{\
9724 .       FOOTERS
9725 .       rr #FOOTERS_WERE_ON
9726 .    \}
9727 .    if \\n[#PAGINATION_WAS_ON] \{\
9728 .       PAGINATE
9729 .       rr #PAGINATION_WAS_ON
9730 .    \}
9731 .    if \\n[#FOOTERS_ON]=1 \{\
9732 .       ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
9733 .       rm $HDRFTR_CENTER_OLD
9734 .       rm $HDRFTR_CENTER_NEW
9735 .    \}
9736 .    ie !\\n[#SUSPEND_PAGINATION] \{\
9737 .       if \\n[#PAGE_NUM_V_POS]=1 \{\
9738 .          if r#EN_NO_FIRST_PN \{ .nr #PAGINATE 1 \}
9739 .       \}
9740 .    \}
9741 .    el \{\
9742 .       if \\n[#PAGE_NUM_V_POS]=2 \{ .nr #PAGINATE 0 \}
9743 .    \}
9744 .    if '\\*[$RESTORE_PAGENUM_STYLE]'' \{\
9745 .       ds $RESTORE_PAGENUM_STYLE \\*[$UR_PAGENUM_STYLE]
9746 .    \}
9747 .    PAGENUM_STYLE \\*[$EN_PN_STYLE]
9748 .    if \\n[#EN_FIRST_PN] \{ .PAGENUMBER \\n[#EN_FIRST_PN] \}
9749 .    if \\n[#HEADER_STATE]=1 \{\
9750 .       if \\n[#EN_ALLOWS_HEADERS] \{ .HEADERS \}
9751 .    \}
9752 \# Collect endnote title string for TOC
9753 .    nr #TOC_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
9754 .    af #TOC_ENTRY_PN \\g[#PAGENUMBER]
9755 .    ds $TOC_TITLE_ITEM \\*[$EN_STRING]\\|
9756 .    ev TOC_EV
9757 .    da TOC_ENTRIES
9758 .    if \\n[#PRINT_STYLE]=1 \{\
9759 .       fam C
9760 .       ft  R
9761 .       ps  12
9762 .    \}
9763 .    if \\n[#PRINT_STYLE]=2 \{\
9764 \!.     FAMILY  \\*[$TOC_TITLE_FAM]
9765 \!.     FT      \\*[$TOC_TITLE_FT]
9766 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
9767 .    \}
9768 \!.  TRAP OFF
9769 .    ie \\n[#PRINT_STYLE]=1 \{\
9770 \!.     PAD "\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN_TYPEWRITE]" 
9771 .    \}
9772 .    el \{\
9773 \!.     PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$TOC_TITLE_ITEM]\\*[$TOC_PN]"
9774 .    \}
9775 \!.  EL
9776 \!.  ST 100 L
9777 \!.  ST 101 R
9778 .    if \\n[#PRINT_STYLE]=2 \{\
9779 \!.     FAMILY  \\*[$TOC_PN_FAM]
9780 \!.     FT      \\*[$TOC_PN_FT]
9781 \!.     PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
9782 .    \}
9783 \!.  TAB 100
9784 \!.  PRINT \\*[LEADER]
9785 \!.  TN
9786 \!.  TRAP
9787 \!.  PRINT \\n[#TOC_ENTRY_PN]
9788 \!.  TQ
9789 .    di       
9790 .    ev
9791 \# End collection of endnote title string for TOC
9792 \# Process endnote
9793 .    if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#EN_LEAD]u \}
9794 .    if \\n[#PRINT_STYLE]=2 \{\
9795 .       if \\n[#EN_NO_COLS] \{\
9796 .          if \\n[#COLUMNS] \{ .nr #COLUMNS_WERE_ON 1 \}
9797 .          nr #COLUMNS 0
9798 .       \}
9799 .       nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
9800 .       ie \\n[#ADJ_EN_LEAD] \{\
9801 .          nr #DOC_LEAD \\n[#EN_LEAD]
9802 .       \}
9803 .       el \{ .DOC_LEAD \\n[#EN_LEAD]u \}
9804 .    \}
9805 .    PRINT \&
9806 .    sp |\\n[#T_MARGIN]u
9807 .    mk ec
9808 .    if \\n[#SLANT_ON] \{\
9809 \*[SLANTX]\c
9810 .    \}
9811 .    ev ENDNOTES
9812 .    if !'\\*[$EN_STRING]'' \{\
9813 .       if \\n[#PRINT_STYLE]=1 \{\
9814 .          fam C
9815 .          ft  R
9816 .          ps  12
9817 .          vs \\n[#EN_LEAD]u
9818 .       \}
9819 .       if \\n[#PRINT_STYLE]=2 \{\
9820 .          LL \\n[#DOC_L_LENGTH]u
9821 .          ta \\n(.lu
9822 .          if \\n[#COLUMNS] \{\
9823 .             ie \\n[#EN_NO_COLS] \{ .LL \\n[#DOC_L_LENGTH]u \}
9824 .             el \{ .LL \\n[#COL_L_LENGTH]u \}
9825 .             ta \\n(.lu
9826 .          \}
9827 .          FAMILY  \\*[$EN_STRING_FAM]
9828 .          FT      \\*[$EN_STRING_FT]
9829 .          PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
9830 .          vs      \\n[#EN_LEAD]u
9831 .       \}
9832 .       if '\\*[$EN_STRING_QUAD]'L'      \{ .LEFT   \}
9833 .       if '\\*[$EN_STRING_QUAD]'LEFT'   \{ .LEFT   \}
9834 .       if '\\*[$EN_STRING_QUAD]'C'      \{ .CENTER \}
9835 .       if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
9836 .       if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
9837 .       if '\\*[$EN_STRING_QUAD]'R'      \{ .RIGHT  \}
9838 .       if '\\*[$EN_STRING_QUAD]'RIGHT'  \{ .RIGHT  \}
9839 .       EL
9840 .       if \\n[#EN_STRING_CAPS] \{ .CAPS \}
9841 .       ie \\n[#EN_STRING_UNDERSCORE] \{\
9842 .          ie \\n[#EN_STRING_UNDERSCORE]=2 \{\
9843 .             UNDERSCORE2 "\\*[$EN_STRING]
9844 .          \}
9845 .          el \{\
9846 .             UNDERSCORE "\\*[$EN_STRING]
9847 .          \}
9848 .       \}
9849 .       el \{\
9850 .          PRINT "\\*[$EN_STRING]
9851 .       \}
9852 .    \}
9853 .    CAPS OFF
9854 .    ALD \\n[#EN_LEAD]u
9855 .    QUAD \\*[$EN_QUAD]
9856 .    nf
9857 .    END_NOTES
9858 .    br
9859 .    ev
9860 .    rm END_NOTES
9861 .    if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#DOC_LEAD]u \}
9862 .    if \\n[#PRINT_STYLE]=2 \{\
9863 .       ie \\n[#ADJ_EN_LEAD] \{\
9864 .          nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]
9865 .       \}
9866 .       el \{ .DOC_LEAD \\n[#RESTORE_DOC_LEAD]u \}
9867 .       rr #RESTORE_DOC_LEAD
9868 .    \}
9869 .    if \\n[#COLUMNS_WERE_ON] \{ .nr #COLUMNS 1 \}
9870 .    if \\n[#HEADER_STATE]=1 \{ .HEADERS \}
9871 .    rr #ENDNOTES
9872 .END
9874 \# ====================================================================
9876 \# +++TABLE OF CONTENTS+++
9879 \# Strings to allocate space for leaders and entry page numbers
9881 .ds $TOC_PN \\*[ST100]\\F[\\*[$TOC_PN_FAM]]\\f[\\*[$TOC_PN_FT]]\\s[\\n[#TOC_PS]u]#\\*[ST100X]\\*[ST101]\\s[\\*[$TOC_PN_SIZE_CHANGE]]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\*[ST101X]
9882 .ds $TOC_PN_TYPEWRITE \\*[ST100]#\\*[ST100X]\\*[ST101]\\|\\h'\\w'0'u*\\n[#TOC_PN_PADDING]u'\\*[ST101X]
9884 \# TOC ENTRIES PAGE NUMBERS PADDING
9885 \# --------------------------------
9886 \# *Argument:
9887 \#   <number of placeholders for toc entries page numbers>
9888 \# *Function:
9889 \#   Creates or modifies register #TOC_PN_PADDING.
9890 \# *Notes:
9891 \#   "Placeholders" is the maximum number of digits in a page
9892 \#   number numeral.
9894 \#   Default is 3.
9896 .MAC TOC_PADDING END
9897 .    nr #TOC_PN_PADDING \\$1
9898 .END
9901 \# PAGINATE TOC
9902 \# ------------
9903 \# *Argument:
9904 \#   <none> | <anything>
9905 \# *Function:
9906 \#   Creates or removes register #PAGINATE_TOC.
9907 \# *Notes:
9908 \#   Default is to paginate toc.
9910 .MAC PAGINATE_TOC END
9911 .    ie '\\$1'' \{ .nr #PAGINATE_TOC 1 \}
9912 .    el \{ .nr #PAGINATE_TOC 0 \}
9913 .END
9916 \# TOC FAMILY
9917 \# ----------
9918 \# *Argument:
9919 \#   <overall default family for toc pages>
9920 \# *Function:
9921 \#   Creates string $TOC_FAM.
9922 \# *Notes:
9923 \#   Default is same as document family. 
9925 .MAC TOC_FAMILY END
9926 .    ds $TOC_FAM \\$1
9927 .END
9930 \# TOC POINT SIZE
9931 \# --------------
9932 \# *Argument:
9933 \#   <base point size for toc pages>
9934 \# *Function:
9935 \#   Creates or modifies register #TOC_PS.
9936 \# *Notes:
9937 \#   This size control macro differs from other size control macros
9938 \#   in that it sets an absolute point size, not a relative one.
9939 \#   See notes for ENDNOTE_PT_SIZE for explanation.  No unit of
9940 \#   measure required.
9942 \#   No unit of measure required (points assumed).  Default is 11.5
9943 \#   for TYPEWRITE.
9945 .MAC TOC_PT_SIZE END
9946 .    nr #TOC_PS (p;\\$1)
9947 .END
9950 \# TOC LEADING
9951 \# -----------
9952 \# *Argument:
9953 \#   <leading for toc pages> [ADJUST]
9954 \# *Function:
9955 \#   Creates or modifies register #TOC_LEAD. If optional ADJUST
9956 \#   given, adjusts lead to fill page.  If #OK_PROCESS_LEAD doesn't
9957 \#   exist, stores arguments for when it's okay to run the macro.
9958 \# *Notes:
9959 \#   No unit of measure required (points assumed).
9961 \#   Default is same as DOC_LEAD.
9963 .MAC TOC_LEAD END
9964 .    if !\\n[#OK_PROCESS_LEAD] \{\
9965 .       ds $TOC_LEAD \\$1
9966 .       if !'\\$2'' \{\
9967 .           ds $ADJUST_TOC_LEAD \\$2
9968 .       \}
9969 .       return
9970 .    \}
9971 .    rr #ADJ_TOC_LEAD
9972 .    nr #TOC_LEAD (p;\\$1)
9973 .    if '\\$2'ADJUST' \{\
9974 .       nr #ORIG_DOC_LEAD \\n[#DOC_LEAD]
9975 .       nr #ADJ_DOC_LEAD 1
9976 .       nr #ADJ_TOC_LEAD 1
9977 .       nr #NO_TRAP_RESET 1
9978 .       DOC_LEAD \\n[#TOC_LEAD]u ADJUST
9979 .       nr #TOC_LEAD \\n[#DOC_LEAD]
9980 .       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
9981 .       rr #NO_TRAP_RESET
9982 .       rr #ADJ_DOC_LEAD
9983 .       rr #ORIG_DOC_LEAD
9984 .    \}
9985 .END
9988 \# TOC PAGES PAGE-NUMBERING STYLE
9989 \# ------------------------------
9990 \# *Argument:
9991 \#   DIGIT | ROMAN | roman | ALPHA | alpha
9992 \# *Function:
9993 \#   Creates or modifies string $TOC_PN_STYLE
9994 \# *Notes:
9995 \#   Page numbering style for page numbers that appear in the
9996 \#   headers/footers of toc pages.  See notes for PAGENUM_STYLE.  
9998 \#   Default is roman.
10000 .MAC TOC_PAGENUM_STYLE END
10001 .    ds $TOC_PN_STYLE \\$1
10002 .END
10005 \# TOC RECTO_VERSO SWITCH
10006 \# ----------------------
10007 \# *Argument:
10008 \#   <none> | <anything>
10009 \# *Function:
10010 \#   Creates or removes register #TOC_RV_SWITCH
10011 \# *Notes:
10012 \#   Allows switching of L/R margins if a doc is recto/verso and
10013 \#   the first toc page happens to fall the wrong way
10015 .MAC TOC_RV_SWITCH END
10016 .    ie '\\$1'' \{ .nr #TOC_RV_SWITCH 1 \}
10017 .    el \{ .rr #TOC_RV_SWITCH \}
10018 .END
10020 \# - for TOC "doc" header (i.e. "Contents")
10022 \# TOC HEADER FAMILY
10023 \# -----------------
10024 \# *Argument:
10025 \#   <family for toc header>
10026 \# *Function:
10027 \#   Creates or modifies string $TOC_HEADER_FAM
10028 \# *Notes:
10029 \#   Default is same as TOC_FAMILY.
10031 .MAC TOC_HEADER_FAMILY END
10032 .    ds $TOC_HEADER_FAM \\$1
10033 .END
10036 \# TOC HEADER FONT
10037 \# ---------------
10038 \# *Argument:
10039 \#   <font for toc header>
10040 \# *Function:
10041 \#   Creates or modified string $TOC_HEADER_FT
10042 \# *Notes:
10043 \#   Default is bold for TYPESET.
10045 .MAC TOC_HEADER_FONT END
10046 .    ds $TOC_HEADER_FT \\$1
10047 .END
10050 \# TOC HEADER SIZE
10051 \# --------------
10052 \# *Argument:
10053 \#   <+|- number of points by which to in/decrease toc header
10054 \#   (relative to overall toc point size)>
10055 \# *Function:
10056 \#   Creates or modifies string $TOC_HEADER_SIZE_CHANGE.
10057 \# *Notes:
10058 \#   Default is +4
10060 .MAC TOC_HEADER_SIZE END
10061 .    ds $TOC_HEADER_SIZE_CHANGE \\$1
10062 .END
10065 \# TOC HEADER QUAD
10066 \# ---------------
10067 \# *Argument:
10068 \#   L | LEFT | C | CENTER | CENTRE | R | RIGHT
10069 \# *Function:
10070 \#   Creates or modifies string $TOC_HEADER_QUAD.
10071 \# *Notes:
10072 \#   Default is LEFT.
10074 .MAC TOC_HEADER_QUAD END
10075 .    ds $TOC_HEADER_QUAD \\$1
10076 .END
10079 \# TOC HEADER STRING
10080 \# -----------------
10081 \# *Argument:
10082 \#   <string for "doc" header of first toc page>
10083 \# *Function:
10084 \#   Creates or modifies string $TOC_HEADER_STRING
10085 \# *Notes:
10086 \#   Default is "Contents".
10088 .MAC TOC_HEADER_STRING END
10089 .    ds $TOC_HEADER_STRING \\$1
10090 .END
10092 \# - for TOC entries page number numbers
10094 \# TOC ENTRIES PAGE NUMBER FAMILY
10095 \# ------------------------------
10096 \# *Argument:
10097 \#   <family to use for toc entries page number>
10098 \# *Function:
10099 \#   Creates or modifies string $TOC_PN_FAM.
10100 \# *Notes:
10101 \#   Default is same as $TOC_FAM.
10103 .MAC TOC_PN_FAMILY END
10104 .    ds $TOC_PN_FAM \\$1
10105 .END
10108 \# TOC ENTRIES PAGE NUMBER FONT
10109 \# ----------------------------
10110 \# *Argument:
10111 \#   <font to use for toc entries page number>
10112 \# *Function:
10113 \#   Creates or modifies string $TOC_PN_FT.
10114 \# *Notes:
10115 \#   Default is roman.
10117 .MAC TOC_PN_FONT END
10118 .    ds $TOC_PN_FT \\$1
10119 .END
10122 \# TOC ENTRIES PAGE NUMBER SIZE
10123 \# ----------------------------
10124 \# *Argument:
10125 \#   <+|- number of points by which to in/decrease toc
10126 \#   entries page numbers (relative to overall toc point size)>
10127 \# *Function:
10128 \#   Creates or modifies string $TOC_PN_SIZE_CHANGE.
10129 \# *Notes:
10130 \#   Default is +0.
10132 .MAC TOC_PN_SIZE END
10133 .    ds $TOC_PN_SIZE_CHANGE \\$1
10134 .END
10137 \# Control macros for toc doc titles, heads, subheads and paraheads 
10138 \# ----------------------------------------------------------------
10140 \# All these control macros behave the same way, setting the family,
10141 \# font, point size and indent from the left margin of the different
10142 \# kinds of entries what can appear in the toc.  The way they
10143 \# operate is identical to all other _FAMILY, _FONT and _SIZE
10144 \# control macros.  _INDENT takes an absolute value.
10145 \# TOC_APPENDS_AUTHORS is unique in this section.
10146 \# 
10147 \# - for title entries
10149 .MAC TOC_TITLE_FAMILY END
10150 .    ds $TOC_TITLE_FAM \\$1
10151 .END
10154 .MAC TOC_TITLE_FONT END
10155 .    ds $TOC_TITLE_FT \\$1
10156 .END
10159 .MAC TOC_TITLE_SIZE END
10160 .    ds $TOC_TITLE_SIZE_CHANGE \\$1
10161 .END
10164 .MAC TOC_TITLE_INDENT END
10165 .    nr #TOC_TITLE_INDENT (\\$1)
10166 .END
10169 .MAC TOC_TITLE_ENTRY END
10170 .    nr #USER_SET_TITLE_ITEM 1
10171 .    ds $USER_SET_TITLE_ITEM \\$1
10172 .END
10175 \# APPEND AUTHOR(S) TO TOC DOC TITLE ENTRIES
10176 \# -----------------------------------------
10177 \# *Argument:
10178 \#   <none> | <name(s) of author(s) as they should appear in toc doc title entries>
10179 \# *Function:
10180 \#   Creates register #TOC_AUTHORS (to tell TOC to append authors
10181 \#   to toc doc title entries).  Optionally creates string
10182 \#   $TOC_AUTHORS.
10183 \# *Notes:
10184 \#   Normally, TOC does not append the author(s) to a toc doc title
10185 \#   entry.  This special macro instructs TOC to do so.
10187 \#   If user has multiple authors for each doc when collating,
10188 \#   TOC_APPENDS_AUTHOR "<string>" must be inserted somewhere between
10189 \#   COLLATE and START in each doc.  Otherwise, mom prints only the
10190 \#   first author given to AUTHOR.
10192 .MAC TOC_APPENDS_AUTHOR END
10193 .    nr #TOC_AUTHORS 1
10194 .    if !'\\$1'' \{\
10195 .       ds $TOC_AUTHORS \\$1
10196 .    \}
10197 .END
10199 \# - for head entries
10201 .MAC TOC_HEAD_FAMILY END
10202 .    ds $TOC_HEAD_FAM \\$1
10203 .END
10206 .MAC TOC_HEAD_FONT END
10207 .    ds $TOC_HEAD_FT \\$1
10208 .END
10211 .MAC TOC_HEAD_SIZE END
10212 .    ds $TOC_HEAD_SIZE_CHANGE \\$1
10213 .END
10216 .MAC TOC_HEAD_INDENT END
10217 .    nr #TOC_HEAD_INDENT (\\$1)
10218 .END
10220 \# - for subhead entries
10222 .MAC TOC_SUBHEAD_FAMILY END
10223 .    ds $TOC_SH_FAM \\$1
10224 .END
10227 .MAC TOC_SUBHEAD_FONT END
10228 .    ds $TOC_SH_FT \\$1
10229 .END
10232 .MAC TOC_SUBHEAD_SIZE END
10233 .    ds $TOC_SH_SIZE_CHANGE \\$1
10234 .END
10237 .MAC TOC_SUBHEAD_INDENT END
10238 .    nr #TOC_SH_INDENT (\\$1)
10239 .END
10241 \# - for parahead entries
10243 .MAC TOC_PARAHEAD_FAMILY END
10244 .    ds $TOC_PH_FAM \\$1
10245 .END
10248 .MAC TOC_PARAHEAD_FONT END
10249 .    ds $TOC_PH_FT \\$1
10250 .END
10253 .MAC TOC_PARAHEAD_SIZE END
10254 .    ds $TOC_PH_SIZE_CHANGE \\$1
10255 .END
10258 .MAC TOC_PARAHEAD_INDENT END
10259 .    nr #TOC_PH_INDENT (\\$1)
10260 .END
10263 .MAC TOC END
10264 .    if !r#PAGINATE_TOC \{ .PAGINATE_TOC \}
10265 .    nr #TOC_FIRST_PAGE 1
10266 .    if \\n[#FINIS] \{\
10267 .       if \\n[#FOOTERS_WERE_ON] \{\
10268 .          FOOTERS \" Have to turn FOOTERS on for next bit to work, so we can't skip this step
10269 .       \}
10270 .    \}
10271 .    if \\n[#FOOTERS_ON]=1 \{\
10272 .       if !'\\*[$HDRFTR_CENTER_OLD]'' \{ .ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_OLD] \}
10273 .       ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
10274 .       el \{ .PAGINATION OFF \}
10275 .    \}
10276 .    if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS OFF \} \" But have to turn FOOTERS off again so they don't print when FINIS was called
10277 .    COLLATE
10278 .    if \\n[#FINIS] \{\
10279 .       if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \} \" Finally, turn footers on if they were on
10280 .       rr #FOOTERS_WERE_ON
10281 .       if \\n[#PAGINATION_WAS_ON] \{\
10282 .          nr #PAGINATE 1
10283 .          rr #PAGINATION_WAS_ON
10284 .       \}
10285 .       rr #FINIS
10286 .    \}
10287 .    ie \\n[#PAGINATE_TOC]=1 \{ .PAGINATE \}
10288 .    el \{ .PAGINATION OFF \}
10289 .    if \\n[#FOOTERS_ON]=1 \{\
10290 .       ds $HDRFTR_CENTER \\*[$HDRFTR_CENTER_NEW]
10291 .       rm $HDRFTR_CENTER_OLD
10292 .       rm $HDRFTR_CENTER_NEW
10293 .    \}
10294 .    rr #COLLATED_DOC
10295 .    DOCHEADER OFF
10296 .    PAGENUMBER 1
10297 .    if \\n[#PRINT_STYLE]=1 \{\
10298 .       rr #IGNORE
10299 .       DOC_LEAD 24 ADJUST
10300 .       nr #IGNORE 1
10301 .    \}
10302 .    START
10303 .    PP
10304 .    nr #COLUMNS 0
10305 .    if \\n[#PRINT_STYLE]=2 \{\
10306 .       ie r#ADJ_TOC_LEAD \{\
10307 .          nr #NO_TRAP_RESET 1
10308 .          DOC_LEAD \\n[#TOC_LEAD]u ADJUST
10309 .          rr #NO_TRAP_RESET
10310 .       \}
10311 .       el \{ .DOC_LEAD \\n[#TOC_LEAD]u \}
10312 .    \}
10313 .    sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
10314 .    if \\n[#SLANT_ON] \{\
10315 \*[SLANTX]\c
10316 .    \}
10317 .    DOC_LINE_LENGTH \\n[#DOC_L_LENGTH]u
10318 .    QUAD \\*[$TOC_HEADER_QUAD]
10319 .    PAGENUM_STYLE \\*[$TOC_PN_STYLE]
10320 .    if \\n[#PRINT_STYLE]=1 \{\
10321 .       fam C
10322 .       ft  R
10323 .       ps  12
10324 .    \}
10325 .    if \\n[#PRINT_STYLE]=2 \{\
10326 .       FAMILY  \\*[$TOC_HEADER_FAM]
10327 .       FT      \\*[$TOC_HEADER_FT]
10328 .       PT_SIZE \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
10329 .    \}
10330 .    ie \\n[#PRINT_STYLE]=1 \{\
10331 .       CAPS
10332 .       UNDERLINE
10333 .       PRINT "\\*[$TOC_HEADER_STRING]"
10334 .       UNDERLINE OFF
10335 .       CAPS      OFF
10336 .    \}
10337 .    el \{\
10338 .       PRINT "\\*[$TOC_HEADER_STRING]"
10339 .    \}
10340 .    LEFT
10341 .    SP
10342 \# In collated docs, this bit inserts the first doc's title
10343 \# underneath the TOC header, before the TOC_ENTRIES diversion
10344 \# gets output.
10345 .    nf
10346 .    if d$FIRST_DOC_TITLE \{\
10347 .    nr #RESTORE_TOC_PN_PADDING \\n[#TOC_PN_PADDING]
10348 .    TOC_PADDING \\n[#FIRST_DOC_TOC_PN_PADDING]
10349 .       if \\n[#PRINT_STYLE]=2 \{\
10350 .          FAMILY  \\*[$TOC_TITLE_FAM]
10351 .          FT      \\*[$TOC_TITLE_FT]
10352 .          PT_SIZE \\n[#TOC_PS]u\\*[$TOC_TITLE_SIZE_CHANGE]
10353 .       \}
10354 .       ie \\n[#PRINT_STYLE]=1 \{\
10355 .          PAD "\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN_TYPEWRITE]" 
10356 .       \}
10357 .       el \{\
10358 .          PAD "\\h'\\n[#TOC_TITLE_INDENT]u'\\*[$FIRST_DOC_TITLE]\\*[$TOC_PN]"
10359 .       \}
10360 .       EL
10361 .       ST 100 L
10362 .       ST 101 R
10363 .       if \\n[#PRINT_STYLE]=2 \{\
10364 .          FAMILY  \\*[$TOC_PN_FAM]
10365 .          FT      \\*[$TOC_PN_FT]
10366 .          PT_SIZE \\n[#TOC_PS]u\\*[$TOC_PN_SIZE_CHANGE]
10367 .       \}
10368 .       TAB 100
10369 .       PRINT \\*[LEADER]
10370 .       TN
10371 .       PRINT \\n[#FIRST_DOC_TITLE_PN]
10372 .       TQ
10373 .    \}
10374 .    TOC_PADDING \\n[#RESTORE_TOC_PN_PADDING]
10375 .    nf
10376 .    TOC_ENTRIES
10377 .    br
10378 .END
10379 \# ====================================================================
10381 \# +++COLUMNS+++
10383 \# COLUMNS
10384 \# -------
10385 \# *Arguments:
10386 \#   <number of columns>  <width of gutters>
10387 \# *Function:
10388 \#   Creates registers associated with setting docs in columns.
10389 \#   Calculates column line lengths and offsets
10390 \# *Notes:
10391 \#   COLUMNS, if used, s/b the last macro invoked before START.
10393 .MAC COLUMNS END
10394 .    if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
10395 .    nr #COLUMNS 1
10396 .    nr #NUM_COLS \\$1
10397 .    nr #GUTTER (\\$2)
10398 .    nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
10399 .    nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
10400 .    nr #COL_NUM 0 1
10401 .    while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
10402 .       nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
10403 .       nr #COL_TOTAL \\n+[#COL_TOTAL]
10404 .    \}
10405 .    rr #COL_TOTAL
10406 .    rr #COL_NUM
10407 .END
10410 \# NEXT COLUMN
10411 \# -----------
10412 \# *Arguments:
10413 \#   <none>
10414 \# *Function:
10415 \#   Breaks current column and moves to next column.
10416 \#   If current column is the last on the page, breaks
10417 \#   to a new page.
10419 .MAC COL_NEXT END
10420 .    if \\n[#COLUMNS] \{\
10421 .       nr #COL_NEXT 1
10422 .       ie '\\$0'COL_NEXT' \{ .br  \}
10423 .       el \{\
10424 .          brp
10425 .          RLD 1v
10426 .       \}
10427 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
10428 .          bp
10429 .       \}
10430 .       el \{ .FOOTER \}
10431 .    \}
10432 .END
10434 \# ====================================================================
10436 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
10438 \# COLLATE
10439 \# -------
10440 \# *Arguments:
10441 \#   <none>
10442 \# *Function:
10443 \#   Turns headers off (if on) and saves header state, sets register
10444 \#   #COLLATE to 1 (toggle), and breaks to a new page.
10445 \# *Notes:
10446 \#   COLLATE exists primarily to allow putting multiple chapters in
10447 \#   a single file, although it can be used for any document type.  After
10448 \#   COLLATE, any of the macros that normally precede START may be
10449 \#   used, and should behave as expected.
10451 \#   N.B.--the START macro *must* be used after COLLATE (and any other
10452 \#   macros that alter mom's behaviour).
10454 .MAC COLLATE END
10455 .    nr #COLLATE 1
10456 .    nr #HEADER_STATE \\n[#HEADERS_ON]
10457 .    HEADERS OFF
10458 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
10459 .       nr #PAGINATION_STATE \\n[#PAGINATE]
10460 .       PAGINATION OFF
10461 .    \}
10462 .    IQ CLEAR
10463 .    TQ
10464 \# Collect first doc's title for TOC
10465 .    if \\n[#COLLATED_DOC]=0 \{\
10466 .       ie \\n[#USER_SET_TITLE_ITEM] \{\
10467 .          ds $FIRST_DOC_TITLE \\*[$USER_SET_TITLE_ITEM]\\|
10468 .          rr #USER_SET_TITLE_ITEM
10469 .          rm $USER_SET_TITLE_ITEM
10470 .       \}
10471 .       el \{\
10472 .          ie \\n[#DOC_TYPE]=2 \{\
10473 .             ie '\\*[$CHAPTER_TITLE]'' \{\
10474 .                ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]\\|
10475 .             \}
10476 .             el \{\
10477 .                ie '\\*[$CHAPTER]'' \{\
10478 .                   ds $FIRST_DOC_TITLE \\*[$CHAPTER_TITLE]\\|
10479 .                \}
10480 .                el \{\
10481 .                   ds $FIRST_DOC_TITLE \\*[$CHAPTER_STRING] \\*[$CHAPTER]: \\*[$CHAPTER_TITLE]\\|
10482 .                \}
10483 .             \}
10484 .          \}
10485 .          el \{\
10486 .             ds $FIRST_DOC_TITLE \\*[$TITLE]\\|
10487 .          \}
10488 .       \}
10489 .       if \\n[#TOC_AUTHORS]=1 \{\
10490 .          ie '\\*[$TOC_AUTHORS]'' \{\
10491 .             as $FIRST_DOC_TITLE /\\|\\*[$AUTHOR_1]\\|
10492 .          \}
10493 .          el \{\
10494 .             as $FIRST_DOC_TITLE /\\|\\*[$TOC_AUTHORS]\\|
10495 .             rm $TOC_AUTHORS
10496 .          \}
10497 .       \}
10498 .       nr #COLLATED_DOC 1
10499 .    \}
10500 \# End title collection for TOC
10501 .    LL \\n[#DOC_L_LENGTH]u
10502 .    QUAD $DOC_QUAD
10503 .    LS \\n[#DOC_LEAD]u
10504 \*[SLANTX]
10505 \*[CONDX]
10506 \*[EXTX]
10507 '    NEWPAGE
10508 .    if \\n[#DEFER_PAGINATION] \{ .PAGINATE \}
10509 .    if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
10510 .       PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
10511 .       rm $RESTORE_PAGENUM_STYLE
10512 .    \}
10513 .    rm $EN_TITLE
10514 .END
10517 \# OUTPUT BLANK PAGES
10518 \# ------------------
10519 \# *Argument:
10520 \#   <number of blank pages to output>
10521 \# *Function:
10522 \#   Outputs blank pages.
10523 \# *Notes:
10524 \#   If recto/verso, each page is recto/verso, even if there's
10525 \#   nothing on it.
10527 .MAC BLANKPAGE END
10528 .    nr #HOW_MANY \\$1
10529 .    nr #PAGES 0 1
10530 .    while \\n+[#PAGES]<=\\n[#HOW_MANY] \{\
10531 .    if \\n[#HEADERS_ON]=1 \{\
10532 .       nr #HEADERS_WERE_ON 1
10533 .       HEADERS OFF
10534 .    \}
10535 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
10536 .       if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
10537 .       PAGINATION OFF
10538 .    \}
10539 .    NEWPAGE
10540 .    PRINT \&
10541 .    if \\n[#FOOTERS_ON]=1 \{\
10542 .       nr #FOOTERS_WERE_ON 1
10543 .       FOOTERS OFF
10544 .    \}
10545 .    if \\n[#PAGE_NUM_V_POS]=2 \{\
10546 .       if \\n[#PAGINATE]=1 \{ .nr #PAGINATE_WAS_ON 1 \}
10547 .       PAGINATION OFF
10548 .    \}
10549 .    if \\n[#HEADERS_WERE_ON] \{ .HEADERS \}
10550 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
10551 .       if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
10552 .    \}
10553 .    \}
10554 .    NEWPAGE
10555 .    if \\n[#FOOTERS_WERE_ON] \{ .FOOTERS \}
10556 .    if \\n[#PAGE_NUM_V_POS]=2 \{\
10557 .       if \\n[#PAGINATE_WAS_ON] \{ .PAGINATE \}
10558 .     \}
10559 .    rr #HEADERS_WERE_ON
10560 .    rr #FOOTERS_WERE_ON
10561 .    rr #PAGINATE_WAS_ON
10562 .END
10565 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
10566 \# ---------------------------------------
10567 \# *Arguments:
10568 \#   <none>
10569 \# *Function:
10570 \#   Sets header/footer/footnotes/etc... traps.
10571 \#     Calculates the number of lines that actually fit on a
10572 \#   page based on #B_MARGIN and resets page bottom trap to coincide
10573 \#   with the depth of that number of lines , or, if #ADJ_DOC_LEAD=1,
10574 \#   adjusts #DOC_LEAD so that the last line of text on a page falls
10575 \#   exactly on #B_MARGIN.
10577 .MAC TRAPS END
10578 \#  *Remove all header/footer traps
10579 .    if !\\n[#NO_TRAP_RESET] \{\
10580 .       ch DO_T_MARGIN
10581 .       ch DO_B_MARGIN
10582 .       ch HEADER
10583 .       ch FOOTER
10584 \#  *Plant header trap
10585 .       wh 0 HEADER
10586 .    \}
10587 \#  *Adjust lead so last line of text falls on B_MARGIN,...
10588 .    ie \\n[#ADJ_DOC_LEAD]=1 \{\
10589 .       nr #LINES_PER_PAGE 0 1
10590 .       nr #DOC_LEAD_ADJ 0 1
10591 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
10592 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
10593 .       nr #LINES_PER_PAGE -1
10594 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
10595 .       DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
10596 .    \}
10597 \#  *...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
10598 \#  *on the page.
10599 .    el \{\
10600 .       nr #LINES_PER_PAGE 0 1
10601 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
10602 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
10603 .       nr #B_MARGIN \\n[#PAGE_LENGTH]-(\\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n[#LINES_PER_PAGE]))
10604 .    \}
10605 \#  *Set footer and footnote overflow traps
10606 .    if !\\n[#NO_TRAP_RESET] \{\
10607 .       nr #FN_COUNT 0 1
10608 .       nr #SPACE_REMAINING 0
10609 .       nr #FN_DEPTH 0
10610 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
10611 .       wh 12i FOOTER
10612 .       wh -\\n[#B_MARGIN]u FN_OVERFLOW_TRAP
10613 .       ch FOOTER -\\n[#B_MARGIN]u
10614 .    \}
10615 .    rr #ADJ_DOC_LEAD
10616 .END
10619 \# CHECK INDENT
10620 \# ------------
10621 \# *Arguments:
10622 \#   <none>
10623 \# *Function:
10624 \#   Adds left, right, or both indent values to document elements
10625 \#   like heads and subheads that are processed in environments.
10627 .MAC CHECK_INDENT END
10628 .    if \\n[#INDENT_LEFT_ACTIVE] \{\
10629 .       in \\n[#L_INDENT]u
10630 .       if \\n[#QUOTE] \{\
10631 .          in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
10632 .          ll -\\n[#L_INDENT]u
10633 .          ta \\n(.lu
10634 .       \}
10635 .       if \\n[#EPIGRAPH] \{\
10636 .          in -\\n[#L_INDENT]u
10637 .          ll -\\n[#L_INDENT]u
10638 .          ta \\n(.lu
10639 .       \}
10640 .    \}
10641 .    if \\n[#INDENT_RIGHT_ACTIVE] \{\
10642 .       ll -\\n[#R_INDENT]u
10643 .       ta \\n(.lu
10644 .    \}
10645 .    if \\n[#INDENT_BOTH_ACTIVE] \{\
10646 .       in \\n[#BL_INDENT]u
10647 .       ll -\\n[#BR_INDENT]u
10648 .       ta \\n(.lu
10649 .       if \\n[#QUOTE] \{\
10650 .          in -\\n[#BL_INDENT]u
10651 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
10652 .             ll -\\n[#BR_INDENT]u
10653 .             ta \\n(.lu
10654 .          \}
10655 .          el \{\
10656 .             ll -(\\n[#BR_INDENT]u/2u)
10657 .             ta \\n(.lu
10658 .          \}
10659 .       \}
10660 .       if \\n[#EPIGRAPH] \{\
10661 .          in -\\n[#BL_INDENT]u
10662 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
10663 .             ll -\\n[#BR_INDENT]u
10664 .             ta \\n(.lu
10665 .          \}
10666 .          el \{\
10667 .             ll -(\\n[#BR_INDENT]u/2u)
10668 .             ta \\n(.lu
10669 .          \}
10670 .       \}
10671 .    \}
10672 .END
10675 \# REMOVE INDENT
10676 \# -------------
10677 \# *Arguments:
10678 \#   <none>
10679 \# *Function:
10680 \#   Removes left, right, or both indent values from document elements
10681 \#   like heads and subheads that are processed in environments.
10683 .MAC REMOVE_INDENT END
10684 .    in 0
10685 .    ll \\n[#L_LENGTH]u
10686 .    ta \\n(.lu
10687 .END
10692 \# ====================================================================
10694 \# +++DOCUMENT PROCESSING ALIASES+++
10696 \# Aliases to make life easier for users: synonyms, short forms
10697 \# and alternate spellings.
10699 \# Macros
10700 \# ------
10701 .ALIAS   BREAK_BLOCKQUOTE                BREAK_QUOTE
10702 .ALIAS   BREAK_CITATION                  BREAK_QUOTE
10703 .ALIAS   BREAK_CITE                      BREAK_QUOTE
10704 .ALIAS   CITATION                        BLOCKQUOTE
10705 .ALIAS   CITE                            BLOCKQUOTE
10706 .ALIAS   DOC_R_MARGIN                    DOC_RIGHT_MARGIN
10707 .ALIAS   DOC_L_MARGIN                    DOC_LEFT_MARGIN
10708 .ALIAS   DOC_L_LENGTH                    DOC_LINE_LENGTH
10709 .ALIAS   DOC_RMARGIN                     DOC_RIGHT_MARGIN
10710 .ALIAS   DOC_LMARGIN                     DOC_LEFT_MARGIN
10711 .ALIAS   DOC_LLENGTH                     DOC_LINE_LENGTH
10712 .ALIAS   DOC_FAM                         DOC_FAMILY
10713 .ALIAS   FILL                            QUAD
10714 .ALIAS   PP_FT                           PP_FONT
10715 .ALIAS   DOC_PS                          DOC_PT_SIZE
10716 .ALIAS   DOC_LS                          DOC_LEAD
10717 .ALIAS   PAGENUM                         PAGENUMBER
10718 .ALIAS   PAGINATION                      PAGINATE
10719 .ALIAS   TOC_FAM                         TOC_FAM
10720 .ALIAS   TOC_PS                          TOC_PT_SIZE
10722 \# HEADER and FOOTER aliases for HDRFTR macros.
10724 .ALIAS   ENDNOTES_HEADER_CENTER          ENDNOTES_HDRFTR_CENTER
10725 .ALIAS   HEADER_FAMILY                   HDRFTR_FAMILY
10726 .ALIAS   HEADER_FAM                      HDRFTR_FAMILY
10727 .ALIAS   HEADER_SIZE                     HDRFTR_SIZE
10728 .ALIAS   HEADER_PLAIN                    HDRFTR_PLAIN
10729 .ALIAS   HEADER_RULE_GAP                 HDRFTR_RULE_GAP
10730 .ALIAS   HEADER_RULE                     HDRFTR_RULE
10731 .ALIAS   HEADER_LEFT                     HDRFTR_LEFT
10732 .ALIAS   HEADER_LEFT_FAMILY              HDRFTR_LEFT_FAMILY
10733 .ALIAS   HEADER_LEFT_FAM                 HDRFTR_LEFT_FAMILY
10734 .ALIAS   HEADER_LEFT_FONT                HDRFTR_LEFT_FONT
10735 .ALIAS   HEADER_LEFT_FT                  HDRFTR_LEFT_FONT
10736 .ALIAS   HEADER_LEFT_SIZE                HDRFTR_LEFT_SIZE
10737 .ALIAS   HEADER_LEFT_PS                  HDRFTR_LEFT_SIZE
10738 .ALIAS   HEADER_LEFT_CAPS                HDRFTR_LEFT_CAPS
10739 .ALIAS   HEADER_CENTER                   HDRFTR_CENTER
10740 .ALIAS   HEADER_CENTRE                   HDRFTR_CENTER
10741 .ALIAS   HEADER_CENTER_FAMILY            HDRFTR_CENTER_FAMILY
10742 .ALIAS   HEADER_CENTRE_FAMILY            HDRFTR_CENTER_FAMILY
10743 .ALIAS   HEADER_CENTER_FAM               HDRFTR_CENTER_FAMILY
10744 .ALIAS   HEADER_CENTRE_FAM               HDRFTR_CENTER_FAMILY
10745 .ALIAS   HEADER_CENTER_FONT              HDRFTR_CENTER_FONT
10746 .ALIAS   HEADER_CENTRE_FONT              HDRFTR_CENTER_FONT
10747 .ALIAS   HEADER_CENTER_FT                HDRFTR_CENTER_FONT
10748 .ALIAS   HEADER_CENTRE_FT                HDRFTR_CENTER_FONT
10749 .ALIAS   HEADER_CENTER_SIZE              HDRFTR_CENTER_SIZE
10750 .ALIAS   HEADER_CENTRE_SIZE              HDRFTR_CENTER_SIZE
10751 .ALIAS   HEADER_CENTER_PS                HDRFTR_CENTER_SIZE
10752 .ALIAS   HEADER_CENTRE_PS                HDRFTR_CENTER_SIZE
10753 .ALIAS   HEADER_CENTER_PAD               HDRFTR_CENTER_PAD
10754 .ALIAS   HEADER_CENTRE_PAD               HDRFTR_CENTER_PAD
10755 .ALIAS   HEADER_CENTER_CAPS              HDRFTR_CENTER_CAPS
10756 .ALIAS   HEADER_CENTRE_CAPS              HDRFTR_CENTER_CAPS
10757 .ALIAS   HEADER_RIGHT                    HDRFTR_RIGHT
10758 .ALIAS   HEADER_RIGHT_FAMILY             HDRFTR_RIGHT_FAMILY
10759 .ALIAS   HEADER_RIGHT_FAM                HDRFTR_RIGHT_FAMILY
10760 .ALIAS   HEADER_RIGHT_FONT               HDRFTR_RIGHT_FONT
10761 .ALIAS   HEADER_RIGHT_FT                 HDRFTR_RIGHT_FONT
10762 .ALIAS   HEADER_RIGHT_SIZE               HDRFTR_RIGHT_SIZE
10763 .ALIAS   HEADER_RIGHT_PS                 HDRFTR_RIGHT_SIZE
10764 .ALIAS   HEADER_RIGHT_CAPS               HDRFTR_RIGHT_CAPS
10765 .ALIAS   HEADER_RECTO                    HDRFTR_RECTO
10766 .ALIAS   HEADER_VERSO                    HDRFTR_VERSO
10767 .ALIAS   ENDNOTES_FOOTER_CENTER          ENDNOTES_HDRFTR_CENTER
10768 .ALIAS   FOOTER_FAMILY                   HDRFTR_FAMILY
10769 .ALIAS   FOOTER_FAM                      HDRFTR_FAMILY
10770 .ALIAS   FOOTER_SIZE                     HDRFTR_SIZE
10771 .ALIAS   FOOTER_PLAIN                    HDRFTR_PLAIN
10772 .ALIAS   FOOTER_RULE_GAP                 HDRFTR_RULE_GAP
10773 .ALIAS   FOOTER_RULE                     HDRFTR_RULE
10774 .ALIAS   FOOTER_LEFT                     HDRFTR_LEFT
10775 .ALIAS   FOOTER_LEFT_FAMILY              HDRFTR_LEFT_FAMILY
10776 .ALIAS   FOOTER_LEFT_FAM                 HDRFTR_LEFT_FAMILY
10777 .ALIAS   FOOTER_LEFT_FONT                HDRFTR_LEFT_FONT
10778 .ALIAS   FOOTER_LEFT_FT                  HDRFTR_LEFT_FONT
10779 .ALIAS   FOOTER_LEFT_SIZE                HDRFTR_LEFT_SIZE
10780 .ALIAS   FOOTER_LEFT_PS                  HDRFTR_LEFT_SIZE
10781 .ALIAS   FOOTER_LEFT_CAPS                HDRFTR_LEFT_CAPS
10782 .ALIAS   FOOTER_CENTER                   HDRFTR_CENTER
10783 .ALIAS   FOOTER_CENTRE                   HDRFTR_CENTER
10784 .ALIAS   FOOTER_CENTER_FAMILY            HDRFTR_CENTER_FAMILY
10785 .ALIAS   FOOTER_CENTRE_FAMILY            HDRFTR_CENTER_FAMILY
10786 .ALIAS   FOOTER_CENTER_FAM               HDRFTR_CENTER_FAMILY
10787 .ALIAS   FOOTER_CENTRE_FAM               HDRFTR_CENTER_FAMILY
10788 .ALIAS   FOOTER_CENTER_FONT              HDRFTR_CENTER_FONT
10789 .ALIAS   FOOTER_CENTRE_FONT              HDRFTR_CENTER_FONT
10790 .ALIAS   FOOTER_CENTER_FT                HDRFTR_CENTER_FONT
10791 .ALIAS   FOOTER_CENTRE_FT                HDRFTR_CENTER_FONT
10792 .ALIAS   FOOTER_CENTER_SIZE              HDRFTR_CENTER_SIZE
10793 .ALIAS   FOOTER_CENTRE_SIZE              HDRFTR_CENTER_SIZE
10794 .ALIAS   FOOTER_CENTER_PAD               HDRFTR_CENTER_PAD
10795 .ALIAS   FOOTER_CENTRE_PAD               HDRFTR_CENTER_PAD
10796 .ALIAS   FOOTER_CENTER_PS                HDRFTR_CENTER_SIZE
10797 .ALIAS   FOOTER_CENTRE_PS                HDRFTR_CENTER_SIZE
10798 .ALIAS   FOOTER_CENTER_CAPS              HDRFTR_CENTER_CAPS
10799 .ALIAS   FOOTER_CENTRE_CAPS              HDRFTR_CENTER_CAPS
10800 .ALIAS   FOOTER_RIGHT                    HDRFTR_RIGHT
10801 .ALIAS   FOOTER_RIGHT_FAMILY             HDRFTR_RIGHT_FAMILY
10802 .ALIAS   FOOTER_RIGHT_FAM                HDRFTR_RIGHT_FAMILY
10803 .ALIAS   FOOTER_RIGHT_FONT               HDRFTR_RIGHT_FONT
10804 .ALIAS   FOOTER_RIGHT_FT                 HDRFTR_RIGHT_FONT
10805 .ALIAS   FOOTER_RIGHT_SIZE               HDRFTR_RIGHT_SIZE
10806 .ALIAS   FOOTER_RIGHT_PS                 HDRFTR_RIGHT_SIZE
10807 .ALIAS   FOOTER_RIGHT_CAPS               HDRFTR_RIGHT_CAPS
10808 .ALIAS   FOOTER_RECTO                    HDRFTR_RECTO
10809 .ALIAS   FOOTER_VERSO                    HDRFTR_VERSO
10810 .ALIAS   SWITCH_HEADERS                  SWITCH_HDRFTR
10811 .ALIAS   SWITCH_FOOTERS                  SWITCH_HDRFTR
10813 \# SUPPORT ALIASES
10815 .ALIAS   COL_BREAK                       COL_NEXT
10816 .ALIAS   PRINT_FOOTNOTE_RULE             FOOTNOTE_RULE