Initial import from FreeBSD RELENG_4:
[games.git] / contrib / groff / contrib / mom / om.tmac
1 .\" om.tmac
2 .\"
3 .\" Mom -- a typesetting/document-processing macro set for groff.
4 .\"
5 .\" Copyright (C) 2002 Free Software Foundation, Inc.
6 .\"      Written by Peter Schaffter (df191@ncf.ca)
7 .\"
8 .\" This file is part of groff.
9 .\"
10 .\" groff is free software; you can redistribute it and/or modify it under
11 .\" the terms of the GNU General Public License as published by the Free
12 .\" Software Foundation; either version 2, or (at your option) any later
13 .\" version.
14 .\"
15 .\" groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 .\" WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18 .\" for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public License along
21 .\" with groff; see the file COPYING.  If not, write to the Free Software
22 .\" Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 .\"
24 .
25 .
26 \# Version 1.1.4
27 \# -------------
28 \#
29 .if (\n[.x]\n[.y] < 118) \
30 .  ab You need GNU troff version 1.18 or higher to run this version of mom!
31 \#
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.).
37 \#
38 \# "<anything>" in the description of arguments that can be passed
39 \# to a macro means that any argument turns the feature off.
40 \#
41 \# ====================================================================
42 \#
43 \# TYPESETTING MACROS, STRINGS, AND ALIASES
44 \# ========================================
45 \#
46 \# +++ALIASES+++
47 \#
48 .als      ALIAS           als   \"Alias .als as ALIAS
49 .als      ALIASN          aln   \"Alias .aln (number registers) as ALIASN
50 \#
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
59 \#
60 \# ALIASES FOR NUMBER REGISTERS
61 \# ----------------------------
62 \#
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
71 \#
72 \# ====================================================================
73 \#
74 \# MISCELLANEOUS
75 \# =============
76 .cflags 4 /\(en
77 \#
78 \# ====================================================================
79 \#
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.
88 \#
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
110 \#
111 \#
112 \# =====================================================================
113 \#
114 \# +++PAGE LAYOUT+++
115 \#
116 \# Macros that control the physical layout of the page: paper size
117 \# and margins.
118 \#
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.
128 \#
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
135 \#
136 \#
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.
146 \#
147 .MAC L_MARGIN END
148 .    br
149 .    nr #L_MARGIN (\\$1)
150 .    po \\n[#L_MARGIN]u
151 .END
152 \#
153 \#
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.
164 \#
165 \#   N.B. -- PAGEWIDTH and L_MARGIN have to be defined before R_MARGIN.
166 \#
167 \#   Requires unit of measure.
168 \#
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
176 \#
177 \#
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.
187 \#
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
198 \#
199 \#
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.
208 \#
209 .MAC B_MARGIN END
210 .    br
211 .    nr #B_MARGIN (\\$1)
212 .    wh -\\n[#B_MARGIN]u DO_B_MARGIN
213 .END
214 \#
215 \#
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.)
227 \#
228 \#   All arguments require a unit of measure.
229 \#
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
241 \#
242 \# =====================================================================
243 \#
244 \# +++PAGE CONTROL+++
245 \#
246 \# Generic macros for breaking pages.
247 \#
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
256 \#
257 .MAC DO_T_MARGIN END
258 .    ev 1
259 .    sp |\\n[#T_MARGIN]u-1v
260 .    ev
261 .END
262 \#
263 \#
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.
272 \#
273 .MAC DO_B_MARGIN END
274 .ev 1
275 .    bp
276 .ev
277 .END
278 \#
279 \# =====================================================================
280 \#
281 \# +++GENERAL STYLE MACROS+++
282 \#
283 \# Macros that are likely to appear together to define general
284 \# type style: line length, family, font, point size, and line
285 \# spacing.
286 \#
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.
296 \#
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
303 \#
304 \#
305 \# FAMILY
306 \# ------
307 \# *Argument:
308 \#   <font family>
309 \# *Function:
310 \#   Stores user supplied font family in string $FAMILY.  Sets .fam
311 \#   to $FAMILY.
312 \#
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
319 \#
320 \#
321 \# FONT
322 \# ----
323 \# *Argument:
324 \#   R | I | B | BI
325 \# *Function:
326 \#  Stores user supplied font in $FONT and sets .ft to $FONT.
327 \#
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
347 \#
348 \#
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.
358 \#
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
370 \#
371 \#
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.
381 \#
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
396 \#
397 \#
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.
411 \#
412 \#   When AUTOLEAD is turned off, the leading reverts to the leading value
413 \#   in effect prior to invoking AUTOLEAD.
414 \#
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
434 \#
435 \#
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
444 \#
445 \# ADDITIONAL STRINGS
446 \# ------------------
447 .ds RULE \El'\En(.lu'
448 \#
449 \#
450 \# =====================================================================
451 \#
452 \# +++KERNING+++
453 \#
454 \# AUTOMATIC PAIRWISE KERNING
455 \# --------------------------
456 \# *Arguments:
457 \#   <none> | <anything>
458 \# *Function:
459 \#   Turns automatic pairwise kerning on or off.
460 \#
461 .MAC KERN END
462 .    ie '\\$1'' \{\
463 .       kern
464 .       nr #KERN 1
465 .    \}
466 .    el \{\
467 .      kern 0
468 .      nr #KERN 0
469 .    \}
470 .END
471 \#
472 \#
473 \# INLINE KERNING AND HORIZONTAL MOVEMENT
474 \# --------------------------------------
475 \# *Kerning
476 \#  Inline kerning provides a simple method for users to adjust the
477 \#  amount of space between any two letters.  It's predicated on a
478 \#  unit of measure "U", which is 1/36 of the current point size as
479 \#  returned by \n[.ps].  E.g., if the current point size is 18,
480 \#  \n[.ps] returns 18000u, therefore U=500u.  Since U remains
481 \#  proportional relative to the current point size, the amount
482 \#  of kerning between two letters as expressed in Us remains
483 \#  visually similar regardless of changes in point size.
484 \#
485 \#  N.B.--the amount of inline kerning supplied by \*[BU#] or
486 \#  \*[FU#] is added to or subtracted from any kerning that already
487 \#  takes place between two characters when automatic kerning is
488 \#  turned on.
489 \#
490 \#  In groff v. 1.17.2, it was not possible to pass arguments to macros that
491 \#  were executed with inline escapes, nor thence to evaluate conditional
492 \#  expressions.  Consequently, each pseudo-escape \[BU#] had to be defined
493 \#  separately with ".char".
494 \#
495 \#  As of v. 1.18, one can pass arguments to inline strings/macros,
496 \#  hence it is now possible to do \*[BU #] where #, inline, is the desired
497 \#  number of kern units.  The original .char definitions have been left in
498 \#  for backward compatibility with documents created prior to mom-1.1.3c.
499 \#
500 \#
501 .nr #KERN_UNIT 36
502 .ds BU   \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
503 .ds FU   \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*\\$1u)'
504 \#
505 .ds BU1  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
506 .ds BU2  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
507 .ds BU3  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
508 .ds BU4  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
509 .ds BU5  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
510 .ds BU6  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
511 .ds BU7  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
512 .ds BU8  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
513 .ds BU9  \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
514 .ds BU10 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
515 .ds BU11 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
516 .ds BU12 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
517 .ds BU13 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
518 .ds BU14 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
519 .ds BU15 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
520 .ds BU16 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
521 .ds BU17 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
522 .ds BU18 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
523 .ds BU19 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
524 .ds BU20 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
525 .ds BU21 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
526 .ds BU22 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
527 .ds BU23 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
528 .ds BU24 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
529 .ds BU25 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
530 .ds BU26 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
531 .ds BU27 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
532 .ds BU28 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
533 .ds BU29 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
534 .ds BU30 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
535 .ds BU31 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
536 .ds BU32 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
537 .ds BU33 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
538 .ds BU34 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
539 .ds BU35 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
540 .ds BU36 \h'-(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
541 \#
542 \#
543 .ds FU1  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*1u)'
544 .ds FU2  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*2u)'
545 .ds FU3  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*3u)'
546 .ds FU4  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*4u)'
547 .ds FU5  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*5u)'
548 .ds FU6  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*6u)'
549 .ds FU7  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*7u)'
550 .ds FU8  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*8u)'
551 .ds FU9  \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*9u)'
552 .ds FU10 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*10u)'
553 .ds FU11 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*11u)'
554 .ds FU12 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*12u)'
555 .ds FU13 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*13u)'
556 .ds FU14 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*14u)'
557 .ds FU15 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*15u)'
558 .ds FU16 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*16u)'
559 .ds FU17 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*17u)'
560 .ds FU18 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*18u)'
561 .ds FU19 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*19u)'
562 .ds FU20 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*20u)'
563 .ds FU21 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*21u)'
564 .ds FU22 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*22u)'
565 .ds FU23 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*23u)'
566 .ds FU24 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*24u)'
567 .ds FU25 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*25u)'
568 .ds FU26 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*26u)'
569 .ds FU27 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*27u)'
570 .ds FU28 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*28u)'
571 .ds FU29 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*29u)'
572 .ds FU30 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*30u)'
573 .ds FU31 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*31u)'
574 .ds FU32 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*32u)'
575 .ds FU33 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*33u)'
576 .ds FU34 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*34u)'
577 .ds FU35 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*35u)'
578 .ds FU36 \h'(\En[#PT_SIZE]u/\n[#KERN_UNIT]u*36u)'
579 \#
580 \#
581 \# *Horizontal movements
582 \#  BP1...12.75 and FP1...12.75 move backwards or forwards inline by the
583 \#  specified number of points.
584 \#  Left in for backward compatibility with mom-1.1.3c, the preferred
585 \#  methods for inline horizontal movements are now \*[BCK #<unit>] and
586 \#  \*[FWD #<unit>].
587 \#
588 .ds BCK  \h'-\\$1\\$2'
589 .ds FWD  \h'\\$1\\$2'
590 \#
591 .ds BP.25    \h'-.25'
592 .ds BP.5     \h'-.5'
593 .ds BP.75    \h'-.75'
594 .ds BP1      \h'-1p'
595 .ds BP1.25   \h'-1.25p'
596 .ds BP1.5    \h'-1.5p'
597 .ds BP1.75   \h'-1.75p'
598 .ds BP2      \h'-2p'
599 .ds BP2.25   \h'-2.25p'
600 .ds BP2.5    \h'-2.5p'
601 .ds BP2.75   \h'-2.75p'
602 .ds BP3      \h'-3p'
603 .ds BP3.25   \h'-3.25p'
604 .ds BP3.5    \h'-3.5p'
605 .ds BP3.75   \h'-3.75p'
606 .ds BP4      \h'-4p'
607 .ds BP4.25   \h'-4.25p'
608 .ds BP4.5    \h'-4.5p'
609 .ds BP4.75   \h'-4.75p'
610 .ds BP5      \h'-5p'
611 .ds BP5.25   \h'-5.25p'
612 .ds BP5.5    \h'-5.5p'
613 .ds BP5.75   \h'-5.75p'
614 .ds BP6      \h'-6p'
615 .ds BP6.25   \h'-6.25p'
616 .ds BP6.5    \h'-6.5p'
617 .ds BP6.75   \h'-6.75p'
618 .ds BP7      \h'-7p'
619 .ds BP7.25   \h'-7.25p'
620 .ds BP7.5    \h'-7.5p'
621 .ds BP7.75   \h'-7.75p'
622 .ds BP8      \h'-8p'
623 .ds BP8.25   \h'-8.25p'
624 .ds BP8.5    \h'-8.5p'
625 .ds BP8.75   \h'-8.75p'
626 .ds BP9      \h'-9p'
627 .ds BP9.25   \h'-9.25p'
628 .ds BP9.5    \h'-9.5p'
629 .ds BP9.75   \h'-9.75p'
630 .ds BP10     \h'-10p'
631 .ds BP10.25  \h'-10.25p'
632 .ds BP10.5   \h'-10.5p'
633 .ds BP10.75  \h'-10.75p'
634 .ds BP11     \h'-11p'
635 .ds BP11.25  \h'-11.25p'
636 .ds BP11.5   \h'-11.5p'
637 .ds BP11.75  \h'-11.75p'
638 .ds BP12     \h'-12p'
639 .ds BP12.25  \h'-12.25p'
640 .ds BP12.5   \h'-12.5p'
641 .ds BP12.75  \h'-12.75p'
642 \#
643 .ds FP.25    \h'.25'
644 .ds FP.5     \h'.5'
645 .ds FP.75    \h'.75'
646 .ds FP1      \h'1p'
647 .ds FP1.25   \h'1.25p'
648 .ds FP1.5    \h'1.5p'
649 .ds FP1.75   \h'1.75p'
650 .ds FP2      \h'2p'
651 .ds FP2.25   \h'2.25p'
652 .ds FP2.5    \h'2.5p'
653 .ds FP2.75   \h'2.75p'
654 .ds FP3      \h'3p'
655 .ds FP3.25   \h'3.25p'
656 .ds FP3.5    \h'3.5p'
657 .ds FP3.75   \h'3.75p'
658 .ds FP4      \h'4p'
659 .ds FP4.25   \h'4.25p'
660 .ds FP4.5    \h'4.5p'
661 .ds FP4.75   \h'4.75p'
662 .ds FP5      \h'5p'
663 .ds FP5.25   \h'5.25p'
664 .ds FP5.5    \h'5.5p'
665 .ds FP5.75   \h'5.75p'
666 .ds FP6      \h'6p'
667 .ds FP6.25   \h'6.25p'
668 .ds FP6.5    \h'6.5p'
669 .ds FP6.75   \h'6.75p'
670 .ds FP7      \h'7p'
671 .ds FP7.25   \h'7.25p'
672 .ds FP7.5    \h'7.5p'
673 .ds FP7.75   \h'7.75p'
674 .ds FP8      \h'8p'
675 .ds FP8.25   \h'8.25p'
676 .ds FP8.5    \h'8.5p'
677 .ds FP8.75   \h'8.75p'
678 .ds FP9      \h'9p'
679 .ds FP9.25   \h'9.25p'
680 .ds FP9.5    \h'9.5p'
681 .ds FP9.75   \h'9.75p'
682 .ds FP10     \h'10p'
683 .ds FP10.25  \h'10.25p'
684 .ds FP10.5   \h'10.5p'
685 .ds FP10.75  \h'10.75p'
686 .ds FP11     \h'11p'
687 .ds FP11.25  \h'11.25p'
688 .ds FP11.5   \h'11.5p'
689 .ds FP11.75  \h'11.75p'
690 .ds FP12     \h'12p'
691 .ds FP12.25  \h'12.25p'
692 .ds FP12.5   \h'12.5p'
693 .ds FP12.75  \h'12.75p'
694 \#
695 \#
696 \# WHOLE LINE KERNING (RW and EW)
697 \# -----------------------------
698 \# The line kerning macros are special instances of track kerning,
699 \# used where a complete line needs to be tightened (or relaxed) in
700 \# order to accomodate or remove one or two more characters
701 \# than the default justification permits.
702 \#
703 \# *Argument:
704 \#   <amount of overall "kerning" (letter spacing) to apply to the line>
705 \# *Function:
706 \#   Invokes .tkf (track kerning) for the current font with
707 \#   1 as both the upper and lower point size limits, so that
708 \#   the value entered by the user applies regardless of point
709 \#   size.  RW ("Reduce Whitespace") reduces the amount of space
710 \#   between all characters by an equal amount.  EW ("Extra
711 \#   Whitespace") increases the amount of space.
712 \# *Notes:
713 \#   Decimal values are acceptable.
714 \#
715 \#   The groff documentation is a tad confusing about what unit of
716 \#   measure is used in track kerning, only that the width of each
717 \#   character is increased or decreased by the amount(s) passed as
718 \#   arguments to .tkf, and something about linear function of point
719 \#   size.  In fact, with the way I've put this macro together, it
720 \#   doesn't matter.  All the user needs to know is that a value
721 \#   of one will produce an unacceptably tight or loose line at most
722 \#   text point sizes; therefore, effective use of RW and EW is in
723 \#   the fractional range below 1 (e.g. .25, .5).  Given that RW
724 \#   and EW are for massaging type, a certain amount of
725 \#   experimentation and previewing is expected and necessary.
726 \#
727 \#   \n(.f holds the current font number, which is acceptable to .tkf.
728 \#
729 \#   RW and EW must be reset to 0 to cancel their effect on
730 \#   subsequent output lines.
731 \#
732 .MAC RW END
733 .    if \\n[#BR_AT_LINE_KERN] \{ .br \}
734 .    tkf 1 1 -\\$1 1 -\\$1
735 .    tkf 2 1 -\\$1 1 -\\$1
736 .    tkf 3 1 -\\$1 1 -\\$1
737 .    tkf 4 1 -\\$1 1 -\\$1
738 .END
739 \#
740 \#
741 .MAC EW END
742 .    if \\n[#BR_AT_LINE_KERN] \{ .br \}
743 .    tkf 1 1 \\$1 1 \\$1
744 .    tkf 2 1 \\$1 1 \\$1
745 .    tkf 3 1 \\$1 1 \\$1
746 .    tkf 4 1 \\$1 1 \\$1
747 .END
748 \#
749 \#
750 \# BREAK AT LINE KERN
751 \# ------------------
752 \# *Arguments:
753 \#   toggle
754 \# *Function:
755 \#   Enables/disables .br's before .RW and .EW
756 \# *Notes:
757 \#   Mostly, users will want .br's before any kind of line kerning, but
758 \#   there may be cases where they don't.  BR_BEFORE_LINE_KERN is off by
759 \#   default and must be invoked explicitly.
760 \#
761 .MAC BR_AT_LINE_KERN END
762 .    ie '\\$1'' \{ .nr #BR_AT_LINE_KERN  1 \}
763 .    el         \{ .rr #BR_AT_LINE_KERN \}
764 .END
765 \#
766 \# =====================================================================
767 \#
768 \# +++HYPHENATION+++
769 \#
770 \# AUTO HYPHENATION
771 \# ----------------
772 \# *Arguments:
773 \#   <none> | <anything> | DEFAULT
774 \#                 or
775 \#   LINES <#> | MARGIN <#> | SPACE <#>
776 \# *Function:
777 \#   Turns auto hyphenation on or off, resets the hyphenation style
778 \#   to default, or permits the setting of various hyphenation
779 \#   parameters.
780 \# *Notes:
781 \#   HY ON defaults to .hy 14, i.e. no hyphens after the
782 \#   first two or before the last two characters of a word, and
783 \#   no hyphenation of the last line prior to a trap (e.g.,
784 \#   at the bottom of a page).
785 \#
786 \#   HY DEFAULT resets the hyphenation style to .hy 14 (see
787 \#   above) if that behaviour is desired after changes have been
788 \#   made to LINES, MARGIN, or SPACE.
789 \#
790 \#   HY LINES <#> sets the number of allowable consecutive hyphenated lines.
791 \#
792 \#   HY MARGIN <#> sets the amount of space (ipPcm) allowed at the end
793 \#   of a line in QUAD mode before hyphenation is tripped (e.g. if there's
794 \#   only 6 points left, groff won't try to hyphenate the next word).
795 \#
796 \#   HY SPACE sets the amount of extra interword space (ipPcm) that can
797 \#   be added in JUSTIFY mode to prevent a line from being hyphenated.
798 \#
799 .MAC HY END
800 .    ie '\\$1'' \{\
801 .       hy 14
802 .       nr #HYPHENATE 1
803 .    \}
804 .    el \{\
805 .       if !'\\$1'LINES'  \{\
806 .          nh
807 .          nr #HYPHENATE 0
808 .       \}
809 .       if !'\\$1'MARGIN' \{\
810 .          nh
811 .          nr #HYPHENATE 0
812 .       \}
813 .       if !'\\$1'SPACE'  \{\
814 .          nh
815 .          nr #HYPHENATE 0
816 .       \}
817 .       if !'\\$1'DEFAULT'  \{\
818 .          nh
819 .          nr #HYPHENATE 0
820 .       \}
821 .       if '\\$1'LINES'   \{ .hlm \\$2 \}
822 .       if '\\$1'MARGIN'  \{ .hym \\$2 \}
823 .       if '\\$1'SPACE'   \{ .hys \\$2 \}
824 .       if '\\$1'DEFAULT' \{\
825 .          hlm -1
826 .          hym 0
827 .          hys 0
828 .       \}
829 .    \}
830 .END
831 \#
832 \#
833 \# HYPHENATION PARAMETERS
834 \# ----------------------
835 \# *Arguments:
836 \#   <# of lines> | <size of margin> | <amount of interword space>
837 \# *Function:
838 \#   Allows user to specify .HY LINES, MARGIN, and SPACE with a single command.
839 \#
840 .MAC HY_SET END
841 .    nr #HY_SET 1
842 .    hlm \\$1
843 .    hym \\$2
844 .    hys \\$3
845 .END
846 \#
847 \# =====================================================================
848 \#
849 \# +++VERTICAL SPACING+++
850 \#
851 \# ADVANCE LEAD
852 \# ------------
853 \# *Argument:
854 \#   <user supplied lead to advance below current baseline>
855 \# *Function:
856 \#   Creates or modifies register #ALD.  Adds user supplied lead
857 \#   below current baseline.
858 \# *Notes:
859 \#   Requires unit of measure ipPcmv.
860 \#
861 .MAC ALD END
862 .    nr #ALD (\\$1)
863 .    sp \\n[#ALD]u
864 .END
865 \#
866 \#
867 \# REVERSE LEAD
868 \# ------------
869 \# *Argument:
870 \#   <user supplied lead to reverse above current baseline>
871 \# *Function:
872 \#   Creates or modifies register #RLD.  Reverses user supplied
873 \#   lead above current baseline.
874 \# *Notes:
875 \#   Requires unit of measure ipPcmv.
876 \#
877 .MAC RLD END
878 .    nr #RLD (\\$1)
879 .    sp -\\n[#RLD]u
880 .END
881 \#
882 \# ALD/RLD STRINGS
883 \# ---------------
884 \# The strings \*[ALD.25]...\*[ALD12.75] and their corresponding \*[RLD]
885 \# forms have been left in for backward compatibility with documents
886 \# created using mom-1.1.3c or earlier.  The prefered methods of advancing
887 \# and reversing on the page inline are \*[UP #<unit>] and \*[DOWN #<unit>].
888 \#
889 .ds DOWN      \v'\\$1\\$2'
890 .ds UP        \v'-\\$1\\$2'
891 \#
892 .ds ALD.25    \v'.25p'
893 .ds ALD.5     \v'.5p'
894 .ds ALD.75    \v'.75p'
895 .ds ALD1      \v'1p'
896 .ds ALD1.25   \v'1.25p'
897 .ds ALD1.5    \v'1.5p'
898 .ds ALD1.75   \v'1.75p'
899 .ds ALD2      \v'2p'
900 .ds ALD2.25   \v'2.25p'
901 .ds ALD2.5    \v'2.5p'
902 .ds ALD2.75   \v'2.75p'
903 .ds ALD3      \v'3p'
904 .ds ALD3.25   \v'3.25p'
905 .ds ALD3.5    \v'3.5p'
906 .ds ALD3.75   \v'3.75p'
907 .ds ALD4      \v'4p'
908 .ds ALD4.25   \v'4.25p'
909 .ds ALD4.5    \v'4.5p'
910 .ds ALD4.75   \v'4.75p'
911 .ds ALD5      \v'5p'
912 .ds ALD5.25   \v'5.25p'
913 .ds ALD5.5    \v'5.5p'
914 .ds ALD5.75   \v'5.75p'
915 .ds ALD6      \v'6p'
916 .ds ALD6.25   \v'6.25p'
917 .ds ALD6.5    \v'6.5p'
918 .ds ALD6.75   \v'6.75p'
919 .ds ALD7      \v'7p'
920 .ds ALD7.25   \v'7.25p'
921 .ds ALD7.5    \v'7.5p'
922 .ds ALD7.75   \v'7.75p'
923 .ds ALD8      \v'8p'
924 .ds ALD8.25   \v'8.25p'
925 .ds ALD8.5    \v'8.5p'
926 .ds ALD8.75   \v'8.75p'
927 .ds ALD9      \v'9p'
928 .ds ALD9.25   \v'9.25p'
929 .ds ALD9.5    \v'9.5p'
930 .ds ALD9.75   \v'9.75p'
931 .ds ALD10     \v'10p'
932 .ds ALD10.25  \v'10.25p'
933 .ds ALD10.5   \v'10.5p'
934 .ds ALD10.75  \v'10.75p'
935 .ds ALD11     \v'11p'
936 .ds ALD11.25  \v'11.25p'
937 .ds ALD11.5   \v'11.5p'
938 .ds ALD11.75  \v'11.75p'
939 .ds ALD12     \v'12p'
940 .ds ALD12.25  \v'12.5p'
941 .ds ALD12.5   \v'12.5p'
942 .ds ALD12.75  \v'12.75p'
943 \#
944 .ds RLD.25    \v'-.25p'
945 .ds RLD.5     \v'-.5p'
946 .ds RLD.75    \v'-.75p'
947 .ds RLD1      \v'-1p'
948 .ds RLD1.25   \v'-1.25p'
949 .ds RLD1.5    \v'-1.5p'
950 .ds RLD1.75   \v'-1.75p'
951 .ds RLD2      \v'-2p'
952 .ds RLD2.25   \v'-2.25p'
953 .ds RLD2.5    \v'-2.5p'
954 .ds RLD2.75   \v'-2.75p'
955 .ds RLD3      \v'-3p'
956 .ds RLD3.25   \v'-3.25p'
957 .ds RLD3.5    \v'-3.5p'
958 .ds RLD3.75   \v'-3.75p'
959 .ds RLD4      \v'-4p'
960 .ds RLD4.25   \v'-4.25p'
961 .ds RLD4.5    \v'-4.5p'
962 .ds RLD4.75   \v'-4.75p'
963 .ds RLD5      \v'-5p'
964 .ds RLD5.25   \v'-5.25p'
965 .ds RLD5.5    \v'-5.5p'
966 .ds RLD5.75   \v'-5.75p'
967 .ds RLD6      \v'-6p'
968 .ds RLD6.25   \v'-6.25p'
969 .ds RLD6.5    \v'-6.5p'
970 .ds RLD6.75   \v'-6.75p'
971 .ds RLD7      \v'-7p'
972 .ds RLD7.25   \v'-7.25p'
973 .ds RLD7.5    \v'-7.5p'
974 .ds RLD7.75   \v'-7.75p'
975 .ds RLD8      \v'-8p'
976 .ds RLD8.25   \v'-8.25p'
977 .ds RLD8.5    \v'-8.5p'
978 .ds RLD8.75   \v'-8.75p'
979 .ds RLD9      \v'-9p'
980 .ds RLD9.25   \v'-9.25p'
981 .ds RLD9.5    \v'-9.5p'
982 .ds RLD9.75   \v'-9.75p'
983 .ds RLD10     \v'-10p'
984 .ds RLD10.25  \v'-10.25p'
985 .ds RLD10.5   \v'-10.5p'
986 .ds RLD10.75  \v'-10.75p'
987 .ds RLD11     \v'-11p'
988 .ds RLD11.25  \v'-11.25p'
989 .ds RLD11.5   \v'-11.5p'
990 .ds RLD11.75  \v'-11.75p'
991 .ds RLD12     \v'-12p'
992 .ds RLD12.25  \v'-12.5p'
993 .ds RLD12.5   \v'-12.5p'
994 .ds RLD12.75  \v'-12.75p'
995 \#
996 \# =====================================================================
997 \#
998 \# +++REFINEMENTS+++
999 \#
1000 \# AUTOMATIC LIGATURES
1001 \# -------------------
1002 \# *Arguments:
1003 \#   <none> | <anything>
1004 \# *Function:
1005 \#   Turns automatic ligature generation on or off.
1006 \# *Notes:
1007 \#   Ligatures may be supplied manually with \(fi, \(fl, etc.
1008 \#
1009 .MAC LIGATURES END
1010 .    ie '\\$1''   \{\
1011 .       lg
1012 .       nr #LIGATURES 1
1013 .    \}
1014 .    el \{\
1015 .       lg 0
1016 .       nr #LIGATURES 0
1017 .    \}
1018 .END
1019 \#
1020 \#
1021 \# SMARTQUOTES
1022 \# -----------
1023 \# *Arguments:
1024 \#   <none> | <anything>
1025 \# *Function:
1026 \#   Turns smartquotes on or off.
1027 \# *Notes:
1028 \#   The " character is read outside the macro when mom is
1029 \#   processed.  The strings for open/close ($QUOTE#) are then
1030 \#   defined in the macro.  \N'34' is the ASCII code for ".  If
1031 \#   incompatibilities arise, find the code for " that applies
1032 \#   to your system and plug in that code instead.
1033 \#
1034 .char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
1035 \#
1036 .MAC SMARTQUOTES END
1037 .    ie '\\$1'' \{\
1038 .       nr #OPEN_CLOSE 0
1039 .       ds $QUOTE0 ``
1040 .       ds $QUOTE1 ''
1041 .       nr #SMART_QUOTES 1
1042 .    \}
1043 .    el \{\
1044 .       ds $QUOTE0 \\N'34'
1045 .       ds $QUOTE1 \\N'34'
1046 .       nr #SMART_QUOTES 0
1047 .    \}
1048 .END
1049 \#
1050 .ds FOOT \(fm
1051 .ds INCH \(fm\(fm
1052 \#
1053 \# =====================================================================
1054 \#
1055 \# +++LINE BREAKS+++
1056 \#
1057 \# NO-SPACE BREAK
1058 \# --------------
1059 \# *Argument:
1060 \#   <none>
1061 \# *Function:
1062 \#   Breaks a line without advancing.
1063 \# *Notes:
1064 \#   EL is the mnemonic used on older, dedicated typesetting machines
1065 \#   to indicate "process the line, then return to the left margin
1066 \#   without advancing the galley medium."  It stands for End Line.
1067 \#
1068 \#   Sadly, EL is only a fake.  It will work in all instances EXCEPT
1069 \#   when the line to be EL'd is the last line before a footer trap.
1070 \#   Use TRAP OFF/TRAP to circumvent this.
1071 \#
1072 .MAC EL END
1073 .    br
1074 .    sp -1v
1075 .END
1076 \#
1077 \# =====================================================================
1078 \#
1079 \# +++FILLING/QUADDING/JUSTIFYING+++
1080 \#
1081 \# JUSTIFY
1082 \# -------
1083 \# *Argument:
1084 \#   <none>
1085 \# *Function:
1086 \#  Turns fill on and sets .ad to b.
1087 \# *Notes:
1088 \#  Justifies text left and right.
1089 \#
1090 .MAC JUSTIFY END
1091 .    if \\n[#TAB_ACTIVE]=0 \{\
1092 .       nr #QUAD 1
1093 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1094 .    \}
1095 '    ce 0
1096 .    QUAD J
1097 .    if \\n[#PRINT_STYLE]=1 \{ .QUAD L \}
1098 .    nr #FILL 0
1099 .END
1100 \#
1101 \#
1102 \# QUAD
1103 \# ----
1104 \# *Arguments:
1105 \#   L | LEFT | R | RIGHT | C | CENTER/CENTRE
1106 \# *Function:
1107 \#   Turns fill on and sets .ad to l, r, or c.
1108 \# *Notes:
1109 \#   Terminology is a problem here.  Some people call quad left
1110 \#   left justified, flush left, or flush left/rag right (and the
1111 \#   reverse for quad right).  Quad center is sometimes called rag
1112 \#   both.  For our purposes, all "quad" modes mean that groff fill
1113 \#   mode is enabled.
1114 \#
1115 .MAC QUAD END
1116 .    ds $QUAD_VALUE \\$1
1117 .    if \\n[#TAB_ACTIVE]=0 \{\
1118 .       nr #QUAD 1
1119 .       ds $RESTORE_QUAD_VALUE \\*[$QUAD_VALUE]
1120 .    \}
1121 '    ce 0
1122 '    fi
1123 .    if '\\*[$QUAD_VALUE]'L'       \{ .ad l \}
1124 .    if '\\*[$QUAD_VALUE]'LEFT'    \{ .ad l \}
1125 .    if '\\*[$QUAD_VALUE]'R'       \{ .ad r \}
1126 .    if '\\*[$QUAD_VALUE]'RIGHT'   \{ .ad r \}
1127 .    if '\\*[$QUAD_VALUE]'C'       \{ .ad c \}
1128 .    if '\\*[$QUAD_VALUE]'CENTER'  \{ .ad c \}
1129 .    if '\\*[$QUAD_VALUE]'CENTRE'  \{ .ad c \}
1130 .    if '\\*[$QUAD_VALUE]'J'       \{ .ad b \}
1131 .    if '\\*[$QUAD_VALUE]'JUSTIFY' \{ .ad b \}
1132 .    nr #FILL 0
1133 .END
1134 \#
1135 \#
1136 \# LEFT, RIGHT, AND CENTER
1137 \# -----------------------
1138 \# The purpose of these macros is to allow the user to enter lines
1139 \# of text that will be quadded LRC *without* the user having to
1140 \# enter .BR or .br between lines.  For the sake of consistency,
1141 \# all three appear to behave similarly (from the point of view of the user),
1142 \# although the underlying primitives don't.  For this reason, LEFT,
1143 \# RIGHT, and CENTER must be followed by .QUAD [L R C J] or .JUSTIFY
1144 \# to restore text to groff fill mode.
1145 \#
1146 \# LEFT
1147 \# ----
1148 \# *Argument:
1149 \#   <none>
1150 \# *Function:
1151 \#   Turns fill mode off.  Allows user to quad lines left without
1152 \#   requiring the .BR or .br macro.
1153 \# *Notes:
1154 \#   LEFT simply turns fill off.  Lines that exceed the current LL will
1155 \#   not be broken, simply continued (indefinitely) until a return is
1156 \#   encountered.  Note that this behaviour differs from the RIGHT and
1157 \#   CENTER macros.
1158 \#
1159 .MAC LEFT END
1160 .    if \\n[#TAB_ACTIVE]=0 \{\
1161 .       rr #QUAD
1162 .       ds $RESTORE_QUAD_VALUE LEFT
1163 .    \}
1164 .    ce 0
1165 .    nf
1166 .    nr #FILL 1
1167 .END
1168 \#
1169 \#
1170 \# RIGHT
1171 \# -----
1172 \# *Argument:
1173 \#   <none>
1174 \# *Function:
1175 \#   Turns fill on.  Allows user to quad lines right without
1176 \#   requiring the .BR or .br macro.
1177 \# *Notes:
1178 \#   Lines that exceed the current LL will be broken, with the excess
1179 \#   text quadded right.
1180 \#
1181 .MAC RIGHT END
1182 .    if \\n[#TAB_ACTIVE]=0 \{\
1183 .       rr #QUAD
1184 .       ds $RESTORE_QUAD_VALUE RIGHT
1185 .    \}
1186 .    fi
1187 .    rj 100000
1188 .    nr #FILL 1
1189 .END
1190 \#
1191 \#
1192 \# CENTER
1193 \# ------
1194 \# *Argument:
1195 \#   <none>
1196 \# *Function:
1197 \#   Turns fill on.  Allows user to center lines without
1198 \#   requiring the .BR or .br macro.
1199 \# *Notes:
1200 \#   Lines that exceed the current LL will be broken, with the excess
1201 \#   text centered.
1202 \#
1203 .MAC CENTER END
1204 .    if \\n[#TAB_ACTIVE]=0 \{\
1205 .       ds $RESTORE_QUAD_VALUE CENTER
1206 .    \}
1207 .    fi
1208 .    ce 100000
1209 .    nr #FILL 1
1210 .END
1211 \#
1212 \# =====================================================================
1213 \#
1214 \# +++TABS+++
1215 \#
1216 \#   There are two different kinds of tabs available: typesetting tabs
1217 \#   and string tabs.
1218 \#
1219 \#   Typesetting tabs are set with TAB_SET, which requires a tab number,
1220 \#   an indent (offset) from the left margin and a length (optionally
1221 \#   with a quad direction and an instruction to fill lines).  After tabs
1222 \#   are set with TS, they are called with .TAB <#>, where <#>
1223 \#   corresponds to the number passed to TAB_SET as a valid tab number.
1224 \#
1225 \#   String tabs allow the user to mark off tab positions inline.  Tab
1226 \#   indents and lengths are calculated from the beginning and end
1227 \#   positions of the marks.  Up to 19 string tabs may be created,
1228 \#   numbered 1-19.  Once created, they are called with .TAB <#>,
1229 \#   just like typesetting tabs.
1230 \#
1231 \#   Setting up string tabs is a two-step procedure.  First, the user
1232 \#   enters an input line in which s/he wants to mark off string tabs.
1233 \#   The beginning of a tab is marked with \*[ST<#>], where <#> is
1234 \#   the desired number of the tab.  The end of the the tab is marked
1235 \#   with \*[ST<#>X].  All ST's must have a matching STX.  String tabs
1236 \#   may be nested.
1237 \#
1238 \#   Next, the user invokes .ST <#> for every string tab defined, and
1239 \#   optionally passes quad information to it.  That done, string tabs
1240 \#   can be called just like typesetting tabs.
1241 \#
1242 \#   String tabs don't preview properly with gxditview.  Use gv instead.
1243 \#
1244 \# Strings for string tab inlines
1245 \# ------------------------------
1246 \#
1247 .ds ST1 \Ek[#ST1_OFFSET]
1248 .ds ST2 \Ek[#ST2_OFFSET]
1249 .ds ST3 \Ek[#ST3_OFFSET]
1250 .ds ST4 \Ek[#ST4_OFFSET]
1251 .ds ST5 \Ek[#ST5_OFFSET]
1252 .ds ST6 \Ek[#ST6_OFFSET]
1253 .ds ST7 \Ek[#ST7_OFFSET]
1254 .ds ST8 \Ek[#ST8_OFFSET]
1255 .ds ST9 \Ek[#ST9_OFFSET]
1256 .ds ST10 \Ek[#ST10_OFFSET]
1257 .ds ST11 \Ek[#ST11_OFFSET]
1258 .ds ST12 \Ek[#ST12_OFFSET]
1259 .ds ST13 \Ek[#ST13_OFFSET]
1260 .ds ST14 \Ek[#ST14_OFFSET]
1261 .ds ST15 \Ek[#ST15_OFFSET]
1262 .ds ST16 \Ek[#ST16_OFFSET]
1263 .ds ST17 \Ek[#ST17_OFFSET]
1264 .ds ST18 \Ek[#ST18_OFFSET]
1265 .ds ST19 \Ek[#ST19_OFFSET]
1266 .ds ST1X \Ek[#ST1_MARK]
1267 .ds ST2X \Ek[#ST2_MARK]
1268 .ds ST3X \Ek[#ST3_MARK]
1269 .ds ST4X \Ek[#ST4_MARK]
1270 .ds ST5X \Ek[#ST5_MARK]
1271 .ds ST6X \Ek[#ST6_MARK]
1272 .ds ST7X \Ek[#ST7_MARK]
1273 .ds ST8X \Ek[#ST8_MARK]
1274 .ds ST9X \Ek[#ST9_MARK]
1275 .ds ST10X \Ek[#ST10_MARK]
1276 .ds ST11X \Ek[#ST11_MARK]
1277 .ds ST12X \Ek[#ST12_MARK]
1278 .ds ST13X \Ek[#ST13_MARK]
1279 .ds ST14X \Ek[#ST14_MARK]
1280 .ds ST15X \Ek[#ST15_MARK]
1281 .ds ST16X \Ek[#ST16_MARK]
1282 .ds ST17X \Ek[#ST17_MARK]
1283 .ds ST18X \Ek[#ST18_MARK]
1284 .ds ST19X \Ek[#ST19_MARK]
1285 \#
1286 \#
1287 \# QUAD AND SET STRING TABS
1288 \# ------------------------
1289 \# *Arguments:
1290 \#   <stringtab number>  L | R | C | J  [QUAD]
1291 \# *Function:
1292 \#   Creates strings $ST<#>_QUAD_DIR and $ST<#>_FILL, then sets up a
1293 \#   tab based on the collected information.
1294 \# *Notes:
1295 \#   Like TS, ST invoked without a quad direction will default to LEFT.
1296 \#   If lines should be filled and quadded, use the optional argument QUAD.
1297 \#   N.B. -- indents *must* be turned off before setting string tabs
1298 \#   inside .PAD
1299 \#
1300 .MAC ST END
1301 .    ds $ST\\$1_QUAD_DIR \\$2
1302 .    if \\n[#NUM_ARGS]=3 \{\
1303 .       ds $ST\\$1_FILL QUAD
1304 .    \}
1305 .    nr #ST\\$1_LENGTH \\n[#ST\\$1_MARK]-\\n[#ST\\$1_OFFSET]
1306 .    ie \\n[#IN_TAB] \{\
1307 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u+\\n[#ST_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1308 .    \}
1309 .    el \{\
1310 .       TAB_SET \\$1 \\n[#ST\\$1_OFFSET]u \\n[#ST\\$1_LENGTH]u \\*[$ST\\$1_QUAD_DIR] \\*[$ST\\$1_FILL]
1311 .    \}
1312 .END
1313 \#
1314 \#
1315 \# TAB SET
1316 \# -------
1317 \# *Arguments:
1318 \#   <#>  ident(ipPcm)  length(ipPcm)  [L | R | C | J [QUAD]]
1319 \# *Function:
1320 \#   Creates macros TAB<#> and TAB <#>, where # is any arbitrary number.
1321 \#   TAB# is a typesetting tab (i.e. a tab defined as an indent
1322 \#   from the page left offset plus a line length.)
1323 \# *Notes:
1324 \#   <#>    = arbitrary digit to identify the tab
1325 \#   indent = indent from left margin; unit of measure required
1326 \#   length = length of tab (unit of measure required; can be
1327 \#            \w'<string>'u--if more than one word in string, surround
1328 \#            with double quotes "\w'<three word string>'"
1329 \#   LRCJ   = quad for tab (left, right, center, justified)
1330 \#            If option QUAD afterwards is not given, quad is line for line
1331 \#            (no fill mode), meaning that there's no need for .BR or .br
1332 \#            between lines.
1333 \#   QUAD   = fill tab (so it behaves as if .QUAD LRC or .JUSTIFY
1334 \#            had been given).
1335 \#
1336 \#   N.B. -- indents *must* be turned off before setting tabs
1337 \#
1338 \#   Examples:
1339 \#
1340 \#     .TAB_SET 1 2P+6p 12P C
1341 \#
1342 \#   means "create a tab numbered 1 that starts 2 picas and 6 points from
1343 \#   the left margin, is 12 picas long, and centre each input line."
1344 \#
1345 \#     .TAB_SET 1 2P+6P 12P C QUAD
1346 \#
1347 \#   means exactly the same thing, except that input lines are joined and
1348 \#   the area delimted by the tab filled with centered text.
1349 \#
1350 \#   TAB <#> can be called at any time after being set.
1351 \#
1352 \#   Tabs are NOT columnar in behaviour.  If the text inside a
1353 \#   tab runs to several lines, when you call the next tab a break
1354 \#   occurs, meaning that the new tab starts one line below the last
1355 \#   line in the previous tab.  For columnar behaviour, you must
1356 \#   use the multi-column macros in addition to tabs.
1357 \#
1358 \#   If you want tabs to line up bottom-line to bottom-line (most likely
1359 \#   single line tabs), use .TN (provided the tabs are numbered sequentially).
1360 \#   Otherwise, you must use .EL then .TAB # if you want them to align.
1361 \#
1362 \#   If you want to reset tabs, you must use .TQ before .TAB_SET.
1363 \#
1364 \#   Note that indents are turned off automatically whenever a new
1365 \#   tab is called with TAB #.
1366 \#
1367 \#   Tabs themselves are user-invoked using the TAB macro with a numeric
1368 \#   argument, e.g. TAB 1.
1369 \#
1370 \#   Generally, in order not to get confused, it's a good idea
1371 \#   to make sure all indents are off before setting tabs.
1372 \#
1373 .MAC TAB_SET END
1374 .    br
1375 .    nr #TAB_NUMBER \\$1
1376 .    ds $CURRENT_TAB \\n[#TAB_NUMBER]
1377 .    nr #TAB_OFFSET (\\$2)
1378 .    nr #TAB_LENGTH (\\$3)
1379 .    MAC TAB\\n[#TAB_NUMBER] DONE \"Define TAB macro
1380 .        br
1381 .        in 0
1382 .        nr #TAB_ACTIVE 1
1383 .        nr #CURRENT_TAB \\n[#TAB_NUMBER]
1384 .        po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET]u
1385 .        nr #ST_OFFSET \\n[#TAB_OFFSET]
1386 .        nr #TAB_OFFSET\\*[$CURRENT_TAB] \\n[#TAB_OFFSET]
1387 .        ll \\n[#TAB_LENGTH]u
1388 .        ta \En(.lu
1389 .        ie '\\$5'QUAD' \{\
1390 .           if '\\$4'L' \{ .QUAD L  \}
1391 .           if '\\$4'R' \{ .QUAD R  \}
1392 .           if '\\$4'C' \{ .QUAD C  \}
1393 .           if '\\$4'J' \{ .JUSTIFY \}
1394 .        \}
1395 .        el \{\
1396 .           if '\\$4''  \{ .LEFT    \}
1397 .           if '\\$4'L' \{ .LEFT    \}
1398 .           if '\\$4'R' \{ .RIGHT   \}
1399 .           if '\\$4'C' \{ .CENTER  \}
1400 .           if '\\$4'J' \{ .JUSTIFY \}
1401 .        \}
1402 .DONE
1403 .    rr #TAB_ACTIVE
1404 .END
1405 \#
1406 \#
1407 \# TAB
1408 \# ---
1409 \# *Arguments:
1410 \#   <tab number to tab into>
1411 \# *Function:
1412 \#   Moves to tab number passed as an argument.
1413 \#
1414 .MAC TAB END
1415 .    ds $TAB_NUMBER \\$1
1416 .    TAB\\*[$TAB_NUMBER]
1417 .    nr #IN_TAB 1
1418 .    po \\n[#L_MARGIN]u+\\n[#TAB_OFFSET\\*[$TAB_NUMBER]]u
1419 .END
1420 \#
1421 \#
1422 \# TAB NEXT
1423 \# --------
1424 \# *Argument:
1425 \#   <none>
1426 \# *Function:
1427 \#   Automagically moves to TAB#+1 on the same line as the last
1428 \#   line of the previous tab.
1429 \# *Notes:
1430 \#   If the tabs being aligned fall too close to the footer
1431 \#   trap,  the line entered after .TN will appear on the next page.
1432 \#
1433 .MAC TN END
1434 .    br
1435 .    nr #NEXT_TAB \\n[#CURRENT_TAB]+1
1436 .    TAB\\n[#NEXT_TAB]
1437 .    sp -1v
1438 .END
1439 \#
1440 \#
1441 \# TAB QUIT
1442 \# --------
1443 \# *Argument:
1444 \#   <none>
1445 \# *Function:
1446 \#   Sets #TAB_ACTIVE to "0" (off).
1447 \#   Resets left margin to value in effect prior to tabs.
1448 \#   Resets line length to value in effect prior to tabs.
1449 \#   Checks #QUAD to see if we were in flush or quad mode
1450 \#   prior to tabs (0=off, 1=on).
1451 \#   Resets QUAD [ L|R|C ], LEFT, RIGHT, CENTER, or JUSTIFY
1452 \#   in effect prior to tabs.
1453 \# *Notes:
1454 \#   TQ *must* come before setting any new tabs if you want the
1455 \#   tabs' indents measured from page left.  Otherwise, the tabs'
1456 \#   indents are measured from the left margin of the tab you're
1457 \#   currently in.
1458 \#
1459 .MAC TQ END
1460 .    br
1461 .    rr #TAB_ACTIVE
1462 .    rr #IN_TAB
1463 .    po \\n[#L_MARGIN]u
1464 .    ll \\n[#L_LENGTH]u
1465 .    ta \\n(.lu
1466 .    ie \\n[#QUAD] \{\
1467 .       ie '\\*[$RESTORE_QUAD_VALUE]'J' \{ .JUSTIFY \}
1468 .       el                              \{ .QUAD \\*[$RESTORE_QUAD_VALUE] \}
1469 .    \}
1470 .    el \{\
1471 .       if '\\*[$RESTORE_QUAD_VALUE]'LEFT'   \{ .LEFT \}
1472 .       if '\\*[$RESTORE_QUAD_VALUE]'RIGHT'  \{ .RIGHT \}
1473 .       if '\\*[$RESTORE_QUAD_VALUE]'CENTER' \{ .CENTER \}
1474 .    \}
1475 .END
1476 \#
1477 \# =====================================================================
1478 \#
1479 \# +++MISCELLANEOUS USEFUL MACROS AND STRINGS+++
1480 \#
1481 \# UNDERLINE
1482 \# ---------
1483 \# *Arguments:
1484 \#   <none> | <anything>
1485 \# *Function:
1486 \#   When on, underlines all letters, words, and digits in a passage,
1487 \#   ignoring punctuation and spaces.
1488 \# *Notes:
1489 \#   Only for use when the font family is COURIER, to simulate
1490 \#   typewriter-style underlining of italic  passages.
1491 \#
1492 .MAC UNDERLINE END
1493 .    ie '\\$1'' \{\
1494 .       nr #UNDERLINE_ON 1
1495 .       char A _\bA
1496 .       char B _\bB
1497 .       char C _\bC
1498 .       char D _\bD
1499 .       char E _\bE
1500 .       char F _\bF
1501 .       char G _\bG
1502 .       char H _\bH
1503 .       char I _\bI
1504 .       char J _\bJ
1505 .       char K _\bK
1506 .       char L _\bL
1507 .       char M _\bM
1508 .       char N _\bN
1509 .       char O _\bO
1510 .       char P _\bP
1511 .       char Q _\bQ
1512 .       char R _\bR
1513 .       char S _\bS
1514 .       char T _\bT
1515 .       char U _\bU
1516 .       char V _\bV
1517 .       char W _\bW
1518 .       char X _\bX
1519 .       char Y _\bY
1520 .       char Z _\bZ
1521 .       char \[`A] _\b\[`A]
1522 .       char \[^A] _\b\[^A]
1523 .       char \['A] _\b\['A]
1524 .       char \[:A] _\b\[:A]
1525 .       char \[oA] _\b\[oA]
1526 .       char \[~A] _\b\[~A]
1527 .       char \[AE] _\b\[AE]
1528 .       char \[`E] _\b\[`E]
1529 .       char \[^E] _\b\[^E]
1530 .       char \['E] _\b\['E]
1531 .       char \[:E] _\b\[:E]
1532 .       char \[`I] _\b\[`I]
1533 .       char \[^I] _\b\[^I]
1534 .       char \['I] _\b\['I]
1535 .       char \[:I] _\b\[:I]
1536 .       char \[`O] _\b\[`O]
1537 .       char \[^O] _\b\[^O]
1538 .       char \['O] _\b\['O]
1539 .       char \[:O] _\b\[:O]
1540 .       char \[~O] _\b\[~O]
1541 .       char \[/O] _\b\[/O]
1542 .       char \[`U] _\b\[`U]
1543 .       char \[^U] _\b\[^U]
1544 .       char \['U] _\b\['U]
1545 .       char \[:U] _\b\[:U]
1546 .       char \[,C] _\b\[,C]
1547 .       char \[-D] _\b\[-D]
1548 .       char \[~N] _\b\[~N]
1549 .       char \[TP] _\b\[TP]
1550 .       char \['Y] _\b\['Y]
1551 .       char \[:Y] _\b\[:Y]
1552 .       char a _\ba
1553 .       char b _\bb
1554 .       char c _\bc
1555 .       char d _\bd
1556 .       char e _\be
1557 .       char f _\bf
1558 .       char g _\bg
1559 .       char h _\bh
1560 .       char i _\bi
1561 .       char j _\bj
1562 .       char k _\bk
1563 .       char l _\bl
1564 .       char m _\bm
1565 .       char n _\bn
1566 .       char o _\bo
1567 .       char p _\bp
1568 .       char q _\bq
1569 .       char r _\br
1570 .       char s _\bs
1571 .       char t _\bt
1572 .       char u _\bu
1573 .       char v _\bv
1574 .       char w _\bw
1575 .       char x _\bx
1576 .       char y _\by
1577 .       char z _\bz
1578 .       char \[`a] _\b\[`a]
1579 .       char \[^a] _\b\[^a]
1580 .       char \['a] _\b\['a]
1581 .       char \[:a] _\b\[:a]
1582 .       char \[oa] _\b\[oa]
1583 .       char \[~a] _\b\[~a]
1584 .       char \[ae] _\b\[ae]
1585 .       char \[`e] _\b\[`e]
1586 .       char \[^e] _\b\[^e]
1587 .       char \['e] _\b\['e]
1588 .       char \[:e] _\b\[:e]
1589 .       char \[`i] _\b\[`i]
1590 .       char \[^i] _\b\[^i]
1591 .       char \['i] _\b\['i]
1592 .       char \[:i] _\b\[:i]
1593 .       char \[`o] _\b\[`o]
1594 .       char \[^o] _\b\[^o]
1595 .       char \['o] _\b\['o]
1596 .       char \[:o] _\b\[:o]
1597 .       char \[~o] _\b\[~o]
1598 .       char \[/o] _\b\[/o]
1599 .       char \[`u] _\b\[`u]
1600 .       char \[^u] _\b\[^u]
1601 .       char \['u] _\b\['u]
1602 .       char \[:u] _\b\[:u]
1603 .       char \[,c] _\b\[,c]
1604 .       char \[Sd] _\b\[Sd]
1605 .       char \[~n] _\b\[~n]
1606 .       char \[Tp] _\b\[Tp]
1607 .       char \['y] _\b\['y]
1608 .       char \[:y] _\b\[:y]
1609 .       char \[ss] _\b\[ss]
1610 .       char ' _\b'
1611 .       char 1 _\b1
1612 .       char 2 _\b2
1613 .       char 3 _\b3
1614 .       char 4 _\b4
1615 .       char 5 _\b5
1616 .       char 6 _\b6
1617 .       char 7 _\b7
1618 .       char 8 _\b8
1619 .       char 9 _\b9
1620 .       char 0 _\b0
1621 .    \}
1622 .    el \{\
1623 .       nr #UNDERLINE_ON 0
1624 .       rchar A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
1625         a b c d e f g h i j k l m n o p q r s t u v w x y z \
1626         \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1627         \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1628         \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1629         \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1630         \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1631         \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1632         1 2 3 4 5 6 7 8 9 0
1633 .    \}
1634 .END
1635 \#
1636 \#
1637 \# UL/ULX
1638 \# ------
1639 \# *Arguments:
1640 \#   <none>
1641 \# *Function:
1642 \#   Underscores all letters, words, and digits in a passage,
1643 \#   ignoring punctuation and spaces.
1644 \# *Notes:
1645 \#   Intended to be called with inline escapes \*[UL] (underline
1646 \#   on) and \*[ULX] (underline off).  Only works when the font family
1647 \#   is COURIER, to simulate typewriter-style underlining of italic
1648 \#   passages.
1649 \#
1650 .MAC UL END
1651 \c\R'#UNDERLINE_ON 1'
1652 .       char A _\bA
1653 .       char B _\bB
1654 .       char C _\bC
1655 .       char D _\bD
1656 .       char E _\bE
1657 .       char F _\bF
1658 .       char G _\bG
1659 .       char H _\bH
1660 .       char I _\bI
1661 .       char J _\bJ
1662 .       char K _\bK
1663 .       char L _\bL
1664 .       char M _\bM
1665 .       char N _\bN
1666 .       char O _\bO
1667 .       char P _\bP
1668 .       char Q _\bQ
1669 .       char R _\bR
1670 .       char S _\bS
1671 .       char T _\bT
1672 .       char U _\bU
1673 .       char V _\bV
1674 .       char W _\bW
1675 .       char X _\bX
1676 .       char Y _\bY
1677 .       char Z _\bZ
1678 .       char \[`A] _\b\[`A]
1679 .       char \[^A] _\b\[^A]
1680 .       char \['A] _\b\['A]
1681 .       char \[:A] _\b\[:A]
1682 .       char \[oA] _\b\[oA]
1683 .       char \[~A] _\b\[~A]
1684 .       char \[AE] _\b\[AE]
1685 .       char \[`E] _\b\[`E]
1686 .       char \[^E] _\b\[^E]
1687 .       char \['E] _\b\['E]
1688 .       char \[:E] _\b\[:E]
1689 .       char \[`I] _\b\[`I]
1690 .       char \[^I] _\b\[^I]
1691 .       char \['I] _\b\['I]
1692 .       char \[:I] _\b\[:I]
1693 .       char \[`O] _\b\[`O]
1694 .       char \[^O] _\b\[^O]
1695 .       char \['O] _\b\['O]
1696 .       char \[:O] _\b\[:O]
1697 .       char \[~O] _\b\[~O]
1698 .       char \[/O] _\b\[/O]
1699 .       char \[`U] _\b\[`U]
1700 .       char \[^U] _\b\[^U]
1701 .       char \['U] _\b\['U]
1702 .       char \[:U] _\b\[:U]
1703 .       char \[,C] _\b\[,C]
1704 .       char \[-D] _\b\[-D]
1705 .       char \[~N] _\b\[~N]
1706 .       char \[TP] _\b\[TP]
1707 .       char \['Y] _\b\['Y]
1708 .       char \[:Y] _\b\[:Y]
1709 .       char a _\ba
1710 .       char b _\bb
1711 .       char c _\bc
1712 .       char d _\bd
1713 .       char e _\be
1714 .       char f _\bf
1715 .       char g _\bg
1716 .       char h _\bh
1717 .       char i _\bi
1718 .       char j _\bj
1719 .       char k _\bk
1720 .       char l _\bl
1721 .       char m _\bm
1722 .       char n _\bn
1723 .       char o _\bo
1724 .       char p _\bp
1725 .       char q _\bq
1726 .       char r _\br
1727 .       char s _\bs
1728 .       char t _\bt
1729 .       char u _\bu
1730 .       char v _\bv
1731 .       char w _\bw
1732 .       char x _\bx
1733 .       char y _\by
1734 .       char z _\bz
1735 .       char \[`a] _\b\[`a]
1736 .       char \[^a] _\b\[^a]
1737 .       char \['a] _\b\['a]
1738 .       char \[:a] _\b\[:a]
1739 .       char \[oa] _\b\[oa]
1740 .       char \[~a] _\b\[~a]
1741 .       char \[ae] _\b\[ae]
1742 .       char \[`e] _\b\[`e]
1743 .       char \[^e] _\b\[^e]
1744 .       char \['e] _\b\['e]
1745 .       char \[:e] _\b\[:e]
1746 .       char \[`i] _\b\[`i]
1747 .       char \[^i] _\b\[^i]
1748 .       char \['i] _\b\['i]
1749 .       char \[:i] _\b\[:i]
1750 .       char \[`o] _\b\[`o]
1751 .       char \[^o] _\b\[^o]
1752 .       char \['o] _\b\['o]
1753 .       char \[:o] _\b\[:o]
1754 .       char \[~o] _\b\[~o]
1755 .       char \[/o] _\b\[/o]
1756 .       char \[`u] _\b\[`u]
1757 .       char \[^u] _\b\[^u]
1758 .       char \['u] _\b\['u]
1759 .       char \[:u] _\b\[:u]
1760 .       char \[,c] _\b\[,c]
1761 .       char \[Sd] _\b\[Sd]
1762 .       char \[~n] _\b\[~n]
1763 .       char \[Tp] _\b\[Tp]
1764 .       char \['y] _\b\['y]
1765 .       char \[:y] _\b\[:y]
1766 .       char \[ss] _\b\[ss]
1767 .       char ' _\b'
1768 .       char 1 _\b1
1769 .       char 2 _\b2
1770 .       char 3 _\b3
1771 .       char 4 _\b4
1772 .       char 5 _\b5
1773 .       char 6 _\b6
1774 .       char 7 _\b7
1775 .       char 8 _\b8
1776 .       char 9 _\b9
1777 .       char 0 _\b0
1778 .END
1779 \#
1780 \#
1781 .MAC ULX END
1782 \c\R'#UNDERLINE_ON 0'
1783 .    rchar A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
1784      a b c d e f g h i j k l m n o p q r s t u v w x y z \
1785      \[`A] \[^A] \['A] \[:A] \[oA] \[~A] \[AE] \[`E] \[^E] \['E] \[:E] \
1786      \[`I] \[^I] \['I] \[:I] \[`O] \[^O] \['O] \[:O] \[~O] \[/O] \[`U] \
1787      \[^U] \['U] \[:U] \[,C] \[-D] \[~N] \[TP] \['Y] \[:Y] \
1788      \[`a] \[^a] \['a] \[:a] \[oa] \[~a] \[ae] \[`e] \[^e] \['e] \[:e] \[`i] \
1789      \[^i] \['i] \[:i] \[`o] \[^o] \['o] \[:o] \[~o] \[/o] \[`u] \[^u] \['u] \
1790      \[:u] \[,c] \[Sd] \[~n] \[Tp] \['y] \[:y] \[ss] \
1791      1 2 3 4 5 6 7 8 9 0
1792 .END
1793 \#
1794 \#
1795 \# UNDERSCORE
1796 \# ----------
1797 \# *Arguments:
1798 \#   [points below baseline] "text"
1799 \# *Function:
1800 \#   Places an underscore 2 points under the string if no lead given,
1801 \#   otherwise places underscore under string by user specified amount.
1802 \# *Notes:
1803 \#   When using this macro, the string to be underscored must begin
1804 \#   with double-quotes ("), regardless of whether it's the sole
1805 \#   argument or the second.
1806 \#   E.g.:
1807 \#      .UNDERSCORE "Text to be underscored
1808 \#         or
1809 \#      .UNDERSCORE 2p "Text to be underscored
1810 \#
1811 \#   All text is underscored (including punctuation and spaces).
1812 \#   This is the primary difference between UNDERLINE and UNDERSCORE,
1813 \#   aside from the fact the UNDERLINE only works with Courier.
1814 \#
1815 \#   UNDERSCORE does not work across line breaks.  Each line of
1816 \#   text must be entered separately with UNDERSCORE.  If the
1817 \#   UNDERSCORE begins in the middle of a line and crosses over a
1818 \#   break, the portion before the break must be entered in its own
1819 \#   UNDERSCORE, as must the portion that comes after the break.
1820 \#
1821 .MAC UNDERSCORE END
1822 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1823 .    ie \\n[#NUM_ARGS]=1 \{ \\$1\\s(12\\v'+2p'\\l'|0'\\v'-2p'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1824 .    el                  \{ \\$2\\s(12\\v'+(\\$1)'\\l'|0'\\v'-(\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u] \}
1825 .    rr #RESTORE_PT_SIZE
1826 .END
1827 \#
1828 \#
1829 \# DOUBLE UNDERSCORE
1830 \# -----------------
1831 \# *Arguments:
1832 \#   [points below baseline] [points distance between rules] "text"
1833 \# *Function:
1834 \#   Same as UNDERSCORE, except it produces a double underscore.  The default
1835 \#   distance between the rules is 2 points.
1836 \# *Notes:
1837 \#   The same double-quote requirement as UNDERSCORE.
1838 \#
1839 .MAC UNDERSCORE2 END
1840 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
1841 .    if \\n[#NUM_ARGS]=1 \{\
1842 .       PRINT \\$1\\s(12\\v'+2p'\\l'|0'\\v'+2p'\\l'|0'\\v'-4p'\\s[\\n[#RESTORE_PT_SIZE]u]
1843 .    \}
1844 .    if \\n[#NUM_ARGS]=2 \{\
1845 .       PRINT \\$2\\s(12\\v'+\\$1'\\l'|0'\\v'+2p'\\l'|0'\\v'-(2p+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1846 .    \}
1847 .    if \\n[#NUM_ARGS]=3 \{\
1848 .       PRINT \\$3\\s(12\\v'+\\$1'\\l'|0'\\v'+\\$2'\\l'|0'\\v'-(\\$2+\\$1)'\\s[\\n[#RESTORE_PT_SIZE]u]
1849 .    \}
1850 .    rr #RESTORE_PT_SIZE
1851 .END
1852 \#
1853 \#
1854 \# SUPERSCRIPT INLINES
1855 \# -------------------
1856 \# *Function:
1857 \#   Prints everything after invocation as superscript.
1858 \# *Notes:
1859 \#   \*[SUP] and \*[SUPX] turn superscript on and off respectively.
1860 \#   If running type is pseudo-condensed/expanded, invoke the superscript
1861 \#   strings as \*[CONDSUP] or \*[EXTSUP] and turn off with \*[CONDSUPX]
1862 \#   and \*[EXTSUPX] respectively.
1863 \#
1864 .ds SUP \
1865 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1866 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1867 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]
1868 \#
1869 .ds SUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'
1870 \#
1871 .ds CONDSUP \
1872 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1873 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1874 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[COND_FOR_SUP]
1875 \#
1876 .ds CONDSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[COND]
1877 \#
1878 .ds EXTSUP \
1879 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
1880 \R'#SUP_PT_SIZE \En[#PT_SIZE_IN_UNITS]u*6u/10u'\
1881 \s[\En[#PT_SIZE_IN_UNITS]u]\v'-.3m'\s[\En[#SUP_PT_SIZE]u]\E*[EXT_FOR_SUP]
1882 \#
1883 .ds EXTSUPX \s[\En[#PT_SIZE_IN_UNITS]u]\v'.3m'\E*[EXT]
1884 \#
1885 \#
1886 \# SLANT
1887 \# -----
1888 \#
1889 \# SETSLANT
1890 \# --------
1891 \# *Arguments:
1892 \#   <number of degrees> | RESET
1893 \# *Function:
1894 \#   Modifies register #DEGREES for use with \*[SLANT], or resets
1895 \#   it to the default.  Defines string \*[SLANTX]
1896 \# *Notes:
1897 \#   \*[SLANT] permits pseudo-italicizing of a font in cases where
1898 \#   no italic font exists in a particular family.
1899 \#
1900 \#   Default # of degrees is 15.
1901 \#
1902 \#   Do not use unit of measure with arg to SETSLANT.
1903 \#
1904 \#   It may be necessary to adjust the spacing on either side of
1905 \#   [SLANT] and [SLANTX].
1906 \#
1907 \#   In docs, SLANT carries over from para to para.
1908 \#
1909 .nr #DEGREES 15
1910 .ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1911 .ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1912 \#
1913 .MAC SETSLANT END
1914 .    ie '\\$1'RESET' \{\
1915 .       nr #DEGREES 15
1916 .       if \\n[#PRINT_STYLE]=1 \{\
1917 .          if \\n[#UNDERLINE_SLANT] \{ .return \}
1918 .       \}
1919 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1920 .    \}
1921 .    el \{\
1922 .       nr #DEGREES \\$1
1923 .       if \\n[#PRINT_STYLE]=1 \{\
1924 .          if \\n[#UNDERLINE_SLANT] \{ .return \}
1925 .       \}
1926 .       ds SLANT \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
1927 .    \}
1928 .    ds SLANTX \ER'#SLANT_ON 0'\ES'0'
1929 .END
1930 \#
1931 \#
1932 \# BOLDER
1933 \# ------
1934 \#
1935 \# SETBOLDER
1936 \# ---------
1937 \# *Arguments:
1938 \#   <amount of emboldening> | RESET
1939 \# *Function:
1940 \#   Modifies register #BOLDER_UNITS for use with \*[BOLDER], or resets
1941 \#   it to the default 700 units.
1942 \# *Notes:
1943 \#   \*[BOLDER] allows pseudo-emboldening of a font where no bold
1944 \#   font exists in a particular family.
1945 \#
1946 \#   Default for SETBOLDER is 700 units.  Do not use unit of measure
1947 \#   with arg to SETBOLDER.
1948 \#
1949 .nr #BOLDER_UNITS 700
1950 \#
1951 .MAC SETBOLDER END
1952 .    if \\n[#IGNORE]=1 \{ .return \}
1953 .    ie '\\$1'RESET' \{ .nr #BOLDER_UNITS 700 \}
1954 .    el \{ .nr #BOLDER_UNITS \\$1 \}
1955 .END
1956 \#
1957 \#
1958 .MAC BOLDER END
1959 \c
1960 .bd \\n(.f \\n[#BOLDER_UNITS]
1961 .END
1962 \#
1963 \#
1964 .MAC BOLDERX END
1965 \c
1966 .bd \\n(.f
1967 .END
1968 \#
1969 \# +++CONDENSE/EXTEND+++
1970 \#
1971 \# CONDENSE/EXTEND
1972 \# ---------------
1973 \# *Arguments:
1974 \#   <percentage to condense/expand type size>
1975 \# *Function:
1976 \#   Stores current point size in z's in #PT_SIZE_IN_UNITS, figures out
1977 \#   new point size (for character width) from arg, and defines string
1978 \#   COND or EXT, which set the type size to the new character width,
1979 \#   and sets the height of type to the value stored in CURRENT_PT_SIZE
1980 \# *Notes:
1981 \#   CONDENSE_OR_EXTEND is invoked from the aliases
1982 \#   CONDENSE and EXTEND.  CONDENSE implies <100, EXTEND
1983 \#   implies >100.  Do not use a percent sign in the argument.
1984 \#
1985 \#   There is no default setting for CONDENSE or EXTEND.
1986 \#   80 is a good approximation of condensed type, 120 is okay
1987 \#   for extended.
1988 \#
1989 \#   The value set by CONDENSE or EXTEND applies to all
1990 \#   subsequent \*[COND] or \*[EXT] escapes until a new value is set.
1991 \#
1992 \#  \*[COND] or \*[EXT] must be turned off before all changes of point
1993 \#  size and reinvoked afterwards (if so desired).  This refers to
1994 \#  changes of point size via control lines AND with via inlines.
1995 \#
1996 .MAC CONDENSE_OR_EXTEND END
1997 .    if '\\$0'CONDENSE' \{\
1998 .       ds $COND_PERCENT \\$1
1999 .       if \\n[#PRINT_STYLE]=1 \{\
2000 .          rm $COND_PERCENT
2001 .          ds $COND_PERCENT 100
2002 .       \}
2003 .       ds COND \
2004 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2005 \R'#CONDENSE 1'\
2006 \R'#COND_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$COND_PERCENT]u)/100'\
2007 \Es[\En[#COND_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2008 .       ds COND_FOR_SUP \
2009 \R'#COND_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$COND_PERCENT]u)/100'\
2010 \Es[\En[#COND_WIDTH]u]\H'\En[#SUP_PT_SIZE]u'
2011 .    \}
2012 .    if '\\$0'EXTEND' \{\
2013 .       ds $EXT_PERCENT \\$1
2014 .       if \\n[#PRINT_STYLE]=1 \{\
2015 .          rm $EXT_PERCENT
2016 .          ds $EXT_PERCENT 100
2017 .       \}
2018 .       ds EXT \
2019 \R'#PT_SIZE_IN_UNITS \En[.ps]'\
2020 \R'#EXTEND 1'\
2021 \R'#EXT_WIDTH (\En[#PT_SIZE_IN_UNITS]u*\E*[$EXT_PERCENT]u)/100'\
2022 \Es[\En[#EXT_WIDTH]u]\EH'\En[#PT_SIZE_IN_UNITS]u'
2023 .       ds EXT_FOR_SUP \
2024 \R'#EXT_WIDTH (\En[#SUP_PT_SIZE]u*\E*[$EXT_PERCENT]u)/100'\
2025 \Es[\En[#EXT_WIDTH]u]\H'\En[#EXT_PT_SIZE]u'
2026 .    \}
2027 .END
2028 \#
2029 .ds CONDX \ER'#CONDENSE 0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2030 .ds EXTX  \ER'#EXTEND   0'\Es0\R'#PT_SIZE_IN_UNITS \En[.ps]'\H'\En[#PT_SIZE_IN_UNITS]u'
2031 \#
2032 \#
2033 \# +++PAD LINES+++ (insert space)
2034 \#
2035 \# PAD MARKER
2036 \# ----------
2037 \# *Arguments:
2038 \#   <character to use for marking pad points>
2039 \# *Function:
2040 \#   Defines string $PAD_MARKER, used in PAD
2041 \# *Notes:
2042 \#   $PAD_MARKER is normally # (the pound sign).
2043 \#
2044 .MAC PAD_MARKER END
2045 .    ds $PAD_MARKER \\$1
2046 .END
2047 \#
2048 \#
2049 \# PAD
2050 \# ---
2051 \# *Argments:
2052 \#   "<string of text with padding markers inserted>"
2053 \# *Function:
2054 \#   Defines and redefines padding character (default=pound sign unless
2055 \#   padding character has been set with PAD_MARKER) several times
2056 \#   so that when the string is output at the end of the macro, every #
2057 \#   has been converted to an equal-sized amount of padding (blank space)
2058 \#   on a line.  # is equivalent to CompuGraphic's old <IS>.
2059 \# *Notes:
2060 \#   String tabs may be marked off during PAD.
2061 \#
2062 .MAC PAD END
2063 .    if \\n(.u=1 \{ .nr #FILL_MODE 1 \}
2064 .    nf
2065 .    if !d$PAD_MARKER \{ .ds $PAD_MARKER # \}
2066 .    char \\*[$PAD_MARKER] \R'#PAD_COUNT \En[#PAD_COUNT]+1'
2067 .    ds $FAMILY_FOR_PAD \\n[.fam]
2068 .    nr #FONT_FOR_PAD   \\n(.f
2069 .    nr #SIZE_FOR_PAD   \\n[.ps]
2070 .    ds $PAD_STRING \\$1
2071 .    as $PAD_STRING \Ekp
2072 .    di PAD_STRING
2073 .    fam \\*[$FAMILY_FOR_PAD]
2074 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2075 .    br
2076 .    di
2077 .    char \\*[$PAD_MARKER] \R'#SPACE_TO_END \En(.l-\Enp'\R'#PAD_SPACE \En[#SPACE_TO_END]/\En[#PAD_COUNT]'
2078 .    di PAD_STRING
2079 .    fam \\*[$FAMILY_FOR_PAD]
2080 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2081 .    br
2082 .    di
2083 .    char \\*[$PAD_MARKER] \h'\En[#PAD_SPACE]u'
2084 .    ie \\n[#SILENT] \{\
2085 .       SILENT
2086 .       fam \\*[$FAMILY_FOR_PAD]
2087 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2088 .       br
2089 .       SILENT OFF
2090 .    \}
2091 .    el \{\
2092 .       fam \\*[$FAMILY_FOR_PAD]
2093 \\f\\n[#FONT_FOR_PAD]\\s[\\n[#SIZE_FOR_PAD]u]\\*[$PAD_STRING]
2094 .       br
2095 .    \}
2096 .    if \\n[#FILL_MODE]=1 \{\
2097 .       fi
2098 .       rr #FILL_MODE
2099 .    \}
2100 .    rr #PAD_COUNT
2101 .    rr #SPACE_TO_END
2102 .    rr #PAD_SPACE
2103 .    rm $PAD_STRING
2104 .    rm PAD_STRING
2105 .    rchar #
2106 .END
2107 \#
2108 \#
2109 \# +++LEADERS+++
2110 \#
2111 \#  The leader mechanism is primitive, but it works.  Basically,
2112 \#  every macro in this set that includes a line length also sets
2113 \#  a single groff tab stop at the right hand end of the line.
2114 \#  That way, whenever Ctrl-A is invoked (always at the end of
2115 \#  an input line), leader of the correct length gets deposited.
2116 \#  Ctrl-A is accessed by the string LEADER (i.e. inline, as
2117 \#  \*[LEADER]).  Leaders within tabs get their length from the
2118 \#  tab line length.
2119 \#
2120 \# SET LEADER CHARACTER
2121 \# --------------------
2122 \# *Arguments:
2123 \#   <character to use whenever \*[LEADER] is invoked>
2124 \# *Function:
2125 \#   Set leader character.
2126 \#
2127 .MAC LEADER_CHARACTER END
2128 .    lc \\$1
2129 .END
2130 \#
2131 .ds LEADER \ 1
2132 \#
2133 \# +++DROP CAPS+++
2134 \#
2135 \# DROP CAP FAMILY
2136 \# ---------------
2137 \# *Argument:
2138 \#   <family of drop cap>
2139 \# *Function:
2140 \#   Creates or modifies string $DC_FAM.
2141 \#
2142 .MAC DROPCAP_FAMILY END
2143 .    ds $DC_FAM \\$1
2144 .END
2145 \#
2146 \#
2147 \# DROP CAP FONT
2148 \# -------------
2149 \# *Argument:
2150 \#   <font of drop cap>
2151 \# *Function:
2152 \#   Creates or modifies string $DC_FT.
2153 \#
2154 .MAC DROPCAP_FONT END
2155 .    ds $DC_FT \\$1
2156 .END
2157 \#
2158 \#
2159 \# DROP CAP GUTTER
2160 \# ---------------
2161 \# *Argument:
2162 \#   <width of gutter between drop cap and indented text>
2163 \# *Function:
2164 \#   Creates or modifies register #DC_GUT.
2165 \# *Notes:
2166 \#   Requires unit of measure.  Default is 3p.
2167 \#
2168 .MAC DROPCAP_GUTTER END
2169 .    nr #DC_GUT (\\$1)
2170 .END
2171 \#
2172 \#
2173 \# DROP CAP ADJUST
2174 \# ---------------
2175 \# *Argument:
2176 \#   <+|- # of points to in/decrease point size of drop cap letter>
2177 \# *Function:
2178 \#   Creates or modifies string $DC_ADJUST.
2179 \# *Notes:
2180 \#   Despite its best efforts, DROPCAP doesn't always get the point
2181 \#   size of the drop cap critically perfect.  DROPCAP_ADJUST lets
2182 \#   the user add or subtract points (or fractions of points) to
2183 \#   get the size right.
2184 \#
2185 \#   Requires the + or - sign.
2186 \#
2187 .MAC DROPCAP_ADJUST END
2188 .    ds $DC_ADJUST \\$1
2189 .END
2190 \#
2191 \#
2192 \# DROP CAP
2193 \# --------
2194 \# *Arguments:
2195 \#   <dropcap letter> <# of lines> [COND <% to condense> | EXT <% to extend>]
2196 \# *Function:
2197 \#   Calculates point size of dropcap based on # of lines passed as
2198 \#   arg 2.  Sets indent for text based on dropcap width+gutter.
2199 \#   Advances and prints dropcap; reverses and prints indented text
2200 \#   to bottom of dropcap, then resets indent to left margin (plus
2201 \#   any indent that was in effect prior to invoking DROPCAP).
2202 \# *Notes:
2203 \#   Drop caps put a strain on on resource-challenged systems.
2204 \#
2205 \#   Drop caps when using the doc processing macro PP only work with
2206 \#   initial paragraphs (i.e. at doc start, or after heads), only when
2207 \#   DROPCAPS comes immediately after PP, and only when the PRINTSTYLE
2208 \#   is TYPESET.  If these conditions aren't met, DROPCAPS is silently
2209 \#   ignored.
2210 \#
2211 \#   The COND or EXT argument are processed separately from all
2212 \#   other COND or EXT inlines or macros, hence passing COND or
2213 \#   EXT has no effect on running type.
2214 \#
2215 .MAC DROPCAP END
2216 .    if #IGNORE \{ .return \}
2217 .    br
2218 .    if \\n[#DOCS] \{\
2219 .       if \\n[#PRINT_STYLE]=1 \{ .return \}
2220 .       if \\n[#PRINT_STYLE]=2 \{\
2221 .          if \\n[#PP_STYLE]=2 \{ .return \}
2222 .          if \\n[#PP]>1 \{ .return \}
2223 .          ti 0
2224 .       \}
2225 .    \}
2226 .    ds $DROPCAP         \\$1
2227 .    nr #DC_LINES        \\$2-1
2228 .    ds $RESTORE_COND    \\*[$COND_PERCENT]
2229 .    ds $RESTORE_EXT     \\*[$EXT_PERCENT]
2230 .    if '\\$3'COND'      \{ .CONDENSE \\$4 \}
2231 .    if '\\$3'EXT'       \{ .EXTEND \\$4 \}
2232 .    if !r#DC_GUT        \{ .nr #DC_GUT (3p) \}
2233 .    ds $RESTORE_FAM     \\n[.fam]
2234 .    nr #RESTORE_FT      \\n(.f
2235 .    nr #RESTORE_PT_SIZE \\n[#PT_SIZE]
2236 .    nr #RESTORE_INDENT  \\n(.i
2237 .    SIZESPECS
2238 .    nr #DC_HEIGHT \\n[#DC_LINES]*\\n[#LEAD]+\\n[#CAP_HEIGHT]
2239 .    ie !d$DC_FAM \{ .FAM \\n[.fam] \}
2240 .    el \{ .FAM \\*[$DC_FAM] \}
2241 .    ie !d$DC_FT \{ .FT \\n(.f \}
2242 .    el \{ .FT \\*[$DC_FT] \}
2243 .    while \\n[#GET_DC_HEIGHT]<\\n[#DC_HEIGHT] \{\
2244 .       ps \\n[#PT_SIZE]u+100u
2245 .       SIZESPECS
2246 .       nr #GET_DC_HEIGHT \\n[#CAP_HEIGHT]
2247 .    \}
2248 .    if d$DC_ADJUST \{ .ps \\*[$DC_ADJUST]p \}
2249 .    mk x
2250 .    sp \\n[#DC_LINES]v
2251 .    ie '\\$3'COND' \{ .PRINT \\*[COND]\\*[$DROPCAP]\\*[CONDX] \}
2252 .    el \{ .PRINT \\*[$DROPCAP] \}
2253 .    if '\\$3'COND' \{ \E*[COND] \}
2254 .    if '\\$3'EXT'  \{ \E*[EXT]  \}
2255 .    ie \\n(.i \{ .in +\w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2256 .    el \{ .in \w'\\*[$DROPCAP]'u+\\n[#DC_GUT]u \}
2257 .    if '\\$3'COND' \{ \E*[CONDX]\c \}
2258 .    if '\\$3'EXT'  \{ \E*[EXTX]\c \}
2259 .    rt \\nxu
2260 .    FAM \\*[$RESTORE_FAM]
2261 .    FT  \\n[#RESTORE_FT]
2262 .    ps \\n[#RESTORE_PT_SIZE]u
2263 .    CONDENSE \\*[$RESTORE_COND]
2264 .    EXTEND   \\*[$RESTORE_EXT]
2265 .    ie \\n(.u \{ .wh \\n(.du+\\n[#DC_HEIGHT]u-1v DROPCAP_OFF \}
2266 .    el \{ .wh \\n(.du+\\n[#DC_HEIGHT]u DROPCAP_OFF \}
2267 .    rm $DROPCAP
2268 .    rr #DC_LINES
2269 .    rm $RESTORE_COND
2270 .    rm $RESTORE_EXT
2271 .    rm $RESTORE_FAM
2272 .    rr #RESTORE_FT
2273 .    rr #RESTORE_PT_SIZE
2274 .    rr #RESTORE_INDENT
2275 .    rr #DC_HEIGHT
2276 .    rr #GET_DC_HEIGHT
2277 .    rr x
2278 .END
2279 \#
2280 .MAC DROPCAP_OFF END
2281 '    in \\n[#RESTORE_INDENT]u
2282 .END
2283 \#
2284 \#
2285 \# =====================================================================
2286 \#
2287 \# +++WORD AND SENTENCE SPACING+++
2288 \#
2289 \# WORD SPACE CONTROL
2290 \# ------------------
2291 \# *Argument:
2292 \#   <+|->wordspace | DEFAULT
2293 \# *Function:
2294 \#   Increases or decreases interword space by user supplied amount.
2295 \#   If DEFAULT, value is set to 12 (groff default).
2296 \# *Notes:
2297 \#   $WS_CONSTANT is the groff default word space.
2298 \#   $WS_VAR is the user supplied amount by which to in/decrease word space.
2299 \#   $WS is a concatenation of WS_CONSTANT and WS_VAR.
2300 \#
2301 \#   Because the user supplied value requires a literal + or - sign,
2302 \#   the macro argument is stored in a string.
2303 \#
2304 \#   \n[.sss] holds the current sentence space value.
2305 \#
2306 .MAC WS END
2307 .    ds $WS_CONSTANT 12
2308 .    ds $WS_VAR \\$1
2309 .    ie '\\$1'DEFAULT' \{ .ds $WS_VAR +0 \}
2310 .    el                \{ .ds $WS (\\*[$WS_CONSTANT]\\*[$WS_VAR]) \}
2311 .    ie \\n[.sss]=12   \{ .ss \\*[$WS] 12 \}
2312 .    el \{\
2313 .       ss \\*[$WS] (\\*[$WS]\\*[$SS_VAR])
2314 .       SS \\*[$SS_VAR]
2315 .    \}
2316 .END
2317 \#
2318 \#
2319 \# SENTENCE SPACE CONTROL
2320 \# ----------------------
2321 \# *Argument:
2322 \#   <+-sentencespace> | 0 | DEFAULT
2323 \# *Function:
2324 \#   Increases or decreases sentence space by user supplied amount.
2325 \#   If 0, sentence spaces are ignored.  If DEFAULT, value is
2326 \#   set to 12 (groff default).
2327 \# *Notes:
2328 \#   Because the user supplied value requires a literal + or - sign,
2329 \#   the macro argument is stored in a string.
2330 \#
2331 \#   Sentence space applies only to input where sentences are separated
2332 \#   by two spaces (and/or, in fill mode [FLUSH L|R|C or JUSTIFY], an EOL).
2333 \#   Changing .SS when sentences are separated by only one space has
2334 \#   no effect on the space between sentences.
2335 \#
2336 \#   \n[.ss] holds the current wordspace value.
2337 \#   \n[.sss] holds the current sentence space value.
2338 \#
2339 .MAC SS END
2340 .    ie '\\$1'0' \{ .ss \\n[.ss] (\\n[.ss]-\\n[.ss]) \}
2341 .    el \{\
2342 .       ie '\\$1'DEFAULT' \{ .ss \\n[.ss] \}
2343 .       el \{\
2344 .          ds $SS_VAR \\$1
2345 .          ss \\n[.ss] (0\\*[$SS_VAR])
2346 .       \}
2347 .    \}
2348 .END
2349 \#
2350 \#
2351 \# =====================================================================
2352 \#
2353 \# +++INDENTS+++
2354 \#
2355 \# There are five styles of indents: left, right, both, temporary,
2356 \# and hanging.  Each is set/invoked with a different macro.
2357 \# Indent macros begin with the letter "I", hence .IL means "indent left,"
2358 \# .IR means "indent right," and so on.
2359 \#
2360 \# The first time any of the indent macros is used, it requires an
2361 \# argument--the size of the indent in ipPcm.  The size may also
2362 \# be entered using the \w'#' function--very useful for numbered
2363 \# lists using HI).  The unit of measure is required.  Subsequent
2364 \# invocations don't require the argument; the indent measure remains the
2365 \# same until it's changed by invoking the macro with an argument again.
2366 \#
2367 \# If no indents are in effect, the arguments passed to indent macros are
2368 \# measured from the left and right margins of the page.  If a left indent
2369 \# or a right indent is already in effect, the arguments passed to
2370 \# the indent macros are calculated from the current values; in other words,
2371 \# the arguments are additive.  If you quit an indent and later return
2372 \# to it, its value will be the value last in effect, unless you pass
2373 \# it an argument.  If you do pass an argument, it is added to the last
2374 \# value in effect, unless you cleared the indent with one of
2375 \# .I<LRB>X macros.
2376 \#
2377 \# Example
2378 \# -------
2379 \#
2380 \# .IL 2P
2381 \# ...some text...
2382 \# .IL 2P
2383 \# ...some text...
2384 \# .IQ
2385 \# ...some text...
2386 \# .IL
2387 \# ...some text...
2388 \#
2389 \# The first .IL 2P indents text 2P from the left margin.  The second
2390 \# .IL 2P indents text by an additional 2P, i.e. 4P from the left margin.
2391 \# .IQ turns the indent off.  The last .IL (which has no argument)
2392 \# takes its value from the total of all arguments passed to .IL (in
2393 \# this case, 2P and 2P), therefore it indents 2P+2P from the left
2394 \# margin, i.e. 4P.  If you wanted the last .IL to indent just 2P,
2395 \# you'd either have to reset the .IL prior to .IQ (.IL -2P), or pass
2396 \# the last .IL the argument 2P.
2397 \#
2398 \# To reverse the sense of an indent added to an indent, you may use
2399 \# negative values.
2400 \#
2401 \# Indents can be turned off individually with ILX, IRX, and IBX.
2402 \# LEFT and RIGHT indents may be combined and manipulated
2403 \# separately, (e.g. you can have an IL of 2P and an IR of 4P
2404 \# operative at the same time, and then change, say, the IL to
2405 \# 4P--thereby left indenting 6P--while the IR remains at 4P.
2406 \#
2407 \# IB automatically turns off IL and IR.  They have to be reinvoked
2408 \# again when needed. IL and IR automatically turn IB off; it, too,
2409 \# has to be reinvoked with needed.
2410 \#
2411 \# All indents can be turned off at once with IQ.  The ILX, IRX, IBX,
2412 \# and IQ macros simply turn the indents off; the values stored in
2413 \# the respective indent macros (IL, IR, IB) remain in effect.  If
2414 \# the user wishes to clear the values, the I<LRB>X macros should be
2415 \# invoked with the single argument CLEAR.  IQ CLEAR clears out
2416 \# the values stored for all indent styles.
2417 \#
2418 \# Indents *must* be turned off before settting string tabs
2419 \# inside PAD.  Generally, in order not to get confused, it's a
2420 \# good idea to turn all indents off before setting any tabs.
2421 \#
2422 \# TI and HI are special cases.  There's no need to turn them off,
2423 \# since they affect only one line--the first after their
2424 \# invocation.  Like the other indent styles, the first time
2425 \# they're invoked, they require a value in iPpcm; each subsequent
2426 \# invocation without an argument will use the same value.  To
2427 \# change the value, simply pass a new value.  Values for TI and HI
2428 \# are *not* additive.
2429 \#
2430 \# HI presupposes that you already have a left or both indent
2431 \# on.  HI will never hang a line outside the left margin of a
2432 \# document.  In other words, you must have IL or IB on before you
2433 \# can use HI.
2434 \#
2435 \# INDENT LEFT
2436 \# -----------
2437 \#
2438 .MAC IL END
2439 .    if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2440 .    nr #INDENT_STYLE_LEFT  1
2441 .    nr #INDENT_ACTIVE      1
2442 .    nr #INDENT_LEFT_ACTIVE 1
2443 .    ie '\\$1'' \{\
2444 .       br
2445 .       in \\n[#L_INDENT]u
2446 .       ta \\n(.lu-\\n[#L_INDENT]u
2447 .    \}
2448 .    el \{\
2449 .       br
2450 .       nr #L_INDENT +(\\$1)
2451 .       in \\n[#L_INDENT]u
2452 .       ta \\n(.lu-\\n[#L_INDENT]u
2453 .    \}
2454 .END
2455 \#
2456 \#
2457 \# +++INDENT RIGHT+++
2458 \#
2459 .MAC IR END
2460 .    if \\n[#INDENT_STYLE_BOTH] \{ .IBX \}
2461 .    nr #INDENT_STYLE_RIGHT   1
2462 .    nr #INDENT_ACTIVE        1
2463 .    nr #INDENT_RIGHT_ACTIVE 1
2464 .    ie '\\$1'' \{\
2465 .       br
2466 .       ie \\n[#TAB_ACTIVE] \{\
2467 .          ll \\n(.lu-\\n[#R_INDENT]u
2468 .          ta \\n(.lu-\\n[#L_INDENT]u
2469 .       \}
2470 .       el \{\
2471 .          ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2472 .          ta \\n(.lu-\\n[#L_INDENT]u
2473 .       \}
2474 .    \}
2475 .    el \{\
2476 .       br
2477 .       nr #R_INDENT +(\\$1)
2478 .       ie \\n[#TAB_ACTIVE] \{\
2479 .          ll \\n(.lu-\\n[#R_INDENT]u
2480 .          ta \\n(.lu-\\n[#L_INDENT]u
2481 .       \}
2482 .       el \{\
2483 .          ll \\n[#L_LENGTH]u-\\n[#R_INDENT]u
2484 .          ta \\n(.lu-\\n[#L_INDENT]u
2485 .       \}
2486 .    \}
2487 .END
2488 \#
2489 \#
2490 \# +++INDENT BOTH+++
2491 \#
2492 .MAC IB END
2493 .    if \\n[#INDENT_STYLE_LEFT]  \{ .ILX \}
2494 .    if \\n[#INDENT_STYLE_RIGHT] \{ .IRX \}
2495 .    nr #INDENT_STYLE_BOTH  1
2496 .    nr #INDENT_ACTIVE      1
2497 .    nr #INDENT_BOTH_ACTIVE 1
2498 .    ie '\\$1'' \{\
2499 .       br
2500 .       in \\n[#BL_INDENT]u
2501 .       ie \\n[#TAB_ACTIVE] \{\
2502 .          ll \\n(.lu-\\n[#BR_INDENT]u
2503 .          ta \\n(.lu-\\n[#BR_INDENT]u
2504 .       \}
2505 .       el \{\
2506 .          ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2507 .          ta \\n(.lu-\\n[#BR_INDENT]u
2508 .       \}
2509 .    \}
2510 .    el \{\
2511 .       br
2512 .       nr #BL_INDENT (\\n[#INDENT]+\\$1)
2513 .       ie \\n[#NUM_ARGS]=2 \{ .nr #BR_INDENT +(\\$2) \}
2514 .       el                  \{ .nr #BR_INDENT \\n[#BL_INDENT] \}
2515 .       ie \\n[#TAB_ACTIVE] \{\
2516 .          in \\n[#BL_INDENT]u
2517 .          ll \\n(.lu-\\n[#BR_INDENT]u
2518 .          ta \\n(.lu-\\n[#BL_INDENT]u
2519 .       \}
2520 .       el \{\
2521 .          in \\n[#BL_INDENT]u
2522 .          ll \\n[#L_LENGTH]u-\\n[#BR_INDENT]u
2523 .          ta \\n(.lu-\\n[#BR_INDENT]u
2524 .       \}
2525 .    \}
2526 .END
2527 \#
2528 \#
2529 \# +++TEMPORARY INDENT+++
2530 \#
2531 .MAC TI END
2532 .    br
2533 .    ie '\\$1'' \{\
2534 .       ti \\n[#T_INDENT]u
2535 .       if \\n[#INDENT_LEFT_ACTIVE] \{\
2536 .          ti \\n[#T_INDENT]u+\\n[#L_INDENT]u
2537 .       \}
2538 .       if \\n[#INDENT_BOTH_ACTIVE] \{\
2539 .          ti \\n[#T_INDENT]u+\\n[#BL_INDENT]u
2540 .       \}
2541 .    \}
2542 .    el \{\
2543 .       nr #T_INDENT (\\$1)
2544 .       ti \\n[#T_INDENT]u
2545 .    \}
2546 .END
2547 \#
2548 \#
2549 \# +++HANGING INDENT+++
2550 \#
2551 .MAC HI END
2552 .    ie '\\$1'' \{ .ti -\\n[#HL_INDENT]u \}
2553 .    el \{\
2554 .       nr #HL_INDENT (\\$1)
2555 .       ti -\\n[#HL_INDENT]u
2556 .    \}
2557 .END
2558 \#
2559 \#
2560 \# +++INDENTS OFF+++
2561 \#
2562 .MAC ILX END
2563 .    br
2564 .    in 0
2565 .    rr #INDENT_LEFT_ACTIVE
2566 .    if '\\$1'CLEAR' \{\
2567 .       rr #L_INDENT
2568 .       rr #INDENT_STYLE_LEFT
2569 .     \}
2570 .END
2571 \#
2572 \#
2573 .MAC IRX END
2574 .    br
2575 .    rr #INDENT_RIGHT_ACTIVE
2576 .    ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2577 .    el \{\
2578 .       ie \\n[#COLUMNS] \{\
2579 .          ll \\n[#COL_L_LENGTH]u
2580 .          ta \\n(.lu
2581 .       \}
2582 .       el \{\
2583 .          ll \\n[#L_LENGTH]u
2584 .          ta \\n(.lu
2585 .       \}
2586 .    \}
2587 .    if '\\$1'CLEAR'     \{\
2588 .       rr #R_INDENT
2589 .       rr #INDENT_STYLE_RIGHT
2590 .    \}
2591 .END
2592 \#
2593 \#
2594 .MAC IBX END
2595 .    br
2596 .    in 0
2597 .    rr #INDENT_BOTH_ACTIVE
2598 .    ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2599 .    el \{\
2600 .       ie \\n[#COLUMNS] \{\
2601 .          ll \\n[#COL_L_LENGTH]u
2602 .          ta \\n(.lu
2603 .       \}
2604 .       el \{\
2605 .          ll \\n[#L_LENGTH]u
2606 .          ta \\n(.lu
2607 .       \}
2608 .    \}
2609 .    if '\\$1'CLEAR' \{\
2610 .       rr #BL_INDENT
2611 .       rr #BR_INDENT
2612 .       rr #INDENT_STYLE_BOTH
2613 .    \}
2614 .END
2615 \#
2616 \#
2617 .MAC IX END
2618 .    if '\\$0'IX' \{\
2619 .       if !\\n[#IX_WARN] \{\
2620 .          tm1 "[mom]: Use of .IX is now deprecated.  Use .IQ instead.
2621 .          tm1 "      .IX will continue to behave as before, but to
2622 .          tm1 "       avoid this message, please update your document.
2623 .          nr #IX_WARN 1
2624 .       \}
2625 .    \}
2626 .    br
2627 .    in 0
2628 .    rr #INDENT_LEFT_ACTIVE
2629 .    rr #INDENT_RIGHT_ACTIVE
2630 .    rr #INDENT_BOTH_ACTIVE
2631 .    if \\n[#INDENT_STYLE_RIGHT] \{\
2632 .       ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2633 .       el \{\
2634 .          ie \\n[#COLUMNS] \{\
2635 .             ll \\n[#COL_L_LENGTH]u
2636 .             ta \\n(.lu
2637 .          \}
2638 .          el \{\
2639 .             ll \\n[#L_LENGTH]u
2640 .             ta \\n(.lu
2641 .          \}
2642 .       \}
2643 .    \}
2644 .    if \\n[#INDENT_STYLE_BOTH] \{\
2645 .       ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2646 .       el \{\
2647 .          ie \\n[#COLUMNS] \{\
2648 .             ll \\n[#COL_L_LENGTH]u
2649 .             ta \\n(.lu
2650 .          \}
2651 .          el \{\
2652 .             ll \\n[#L_LENGTH]u
2653 .             ta \\n(.lu
2654 .          \}
2655 .       \}
2656 .    \}
2657 .    if '\\$1'CLEAR' \{\
2658 .       if \\n[#INDENT_STYLE_RIGHT] \{\
2659 .          ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2660 .          el \{\
2661 .             ie \\n[#COLUMNS] \{\
2662 .                ll \\n[#COL_L_LENGTH]u
2663 .                ta \\n(.lu
2664 .             \}
2665 .             el \{\
2666 .                ll \\n[#L_LENGTH]u
2667 .                ta \\n(.lu
2668 .             \}
2669 .          \}
2670 .       \}
2671 .       if \\n[#INDENT_STYLE_BOTH] \{\
2672 .          ie \\n[#TAB_ACTIVE] \{ .TAB\\n[#CURRENT_TAB] \}
2673 .          el \{\
2674 .             ie \\n[#COLUMNS] \{\
2675 .                ll \\n[#COL_L_LENGTH]u
2676 .                ta \\n(.lu
2677 .              \}
2678 .             el \{\
2679 .                ll \\n[#L_LENGTH]u
2680 .                ta \\n(.lu
2681 .             \}
2682 .          \}
2683 .       \}
2684 .       rr #L_INDENT
2685 .       rr #R_INDENT
2686 .       rr #BL_INDENT
2687 .       rr #BR_INDENT
2688 .       rr #T_INDENT
2689 .       rr #H_INDENT
2690 .       rr #INDENT_STYLE_LEFT
2691 .       rr #INDENT_STYLE_RIGHT
2692 .       rr #INDENT_STYLE_BOTH
2693 .    \}
2694 .    rr #INDENT_ACTIVE
2695 .END
2696 \#
2697 \# =====================================================================
2698 \#
2699 \# +++MULTIPLE COLUMNS+++
2700 \#
2701 \# MULTIPLE COLUMNS ON
2702 \# -------------------
2703 \# *Arguments:
2704 \#   <none>
2705 \# *Function:
2706 \#   Marks the top of a column set
2707 \#
2708 .MAC MCO END
2709 .mk c
2710 .END
2711 \#
2712 \# MULTIPLE COLUMN RETURN
2713 \# ----------------------
2714 \# *Arguments:
2715 \#   <none>
2716 \# *Function:
2717 \#   Returns to the top of a column set
2718 \#
2719 .MAC MCR END
2720 .    sp |\\ncu
2721 .END
2722 \#
2723 \# MULTIPLE COLUMNS OFF
2724 \# --------------------
2725 \# *Arguments:
2726 \#   <none> | <lead to advance beneath bottom of deepest column>
2727 \# *Function:
2728 \#   Advances to the end of a column set
2729 \# *Notes:
2730 \#   With no argument, advances to the next baseline (at the current
2731 \#   leading value) beneath the longest column.  With an argument
2732 \#   (which requires a unit of measure), advances arg distance
2733 \#   beneath the baseline of the deepest column.  If the argument
2734 \#   is zero, advances to the baseline of the deepest column.
2735 \#
2736 .MAC MCX END
2737 .    ie '\\$1'' \{\
2738 .       TQ
2739 .       sp |\\n(.hu
2740 .    \}
2741 .    el \{\
2742 .       nr #MCX_ALD (\\$1)
2743 .       TQ
2744 .       ie \\n[#MCX_ALD]=0 \{ .sp |\\n(.hu-1v \}
2745 .       el \{ .sp |\\n(.hu+\\n[#MCX_ALD]u \}
2746 .       rr #MCX_ALD (\\$1)
2747 .    \}
2748 .END
2749 \#
2750 \# =====================================================================
2751 \#
2752 \# +++TYPESETTING SUPPORT MACROS+++
2753 \#
2754 \# TRAP
2755 \# ----
2756 \# *Arguments:
2757 \#   toggle
2758 \# *Function:
2759 \#   Enables/disables traps.
2760 \# *Notes:
2761 \#   EL and TN don't function as advertised on the last line before a
2762 \#   trap (when they break the preceding line, they spring the trap, and
2763 \#   groff won't back up to the line preceding the trap).  TRAP is a kludge
2764 \#   to get EL and TN work properly on last lines.  The user simply enloses
2765 \#   the offending lines in TRAP OFF/TRAP.
2766 \#
2767 .MAC TRAP END
2768 .    ie '\\$1'' \{ .vpt 1 \}
2769 .    el \{ .vpt 0 \}
2770 .END
2771 \#
2772 \#
2773 \# SILENT
2774 \# ------
2775 \# *Arguments:
2776 \#   <none> | <anything>
2777 \# *Function:
2778 \#   Diverts text so that it doesn't print, or turns to function off.
2779 \# *Notes:
2780 \#   Useful for setting up autotabs where you don't want the line with
2781 \#   the tab marks to print.
2782 \#
2783 \#   Also aliased as COMMENT, in case user wants to input a batch of
2784 \#   text that doesn't print.
2785 \#
2786 .MAC SILENT END
2787 .    nr #SILENT 1
2788 .    if \\n[#QUAD] \{ .br \}
2789 .    ie '\\$1'' \{ .di NO_FLASH \}
2790 .    el \{\
2791 .       br
2792 .       di
2793 .       rm NO_FLASH
2794 .       rr #SILENT
2795 .    \}
2796 .END
2797 \#
2798 \# PRINT
2799 \# -----
2800 \# *Arguments:
2801 \#   <anything>
2802 \# *Function:
2803 \#   Prints anything.  A macro that helps keep my code nicely indented.
2804 \#
2805 .MAC PRINT END
2806 \\$*
2807 .END
2808 \#
2809 \#
2810 \# CAPS
2811 \# ----
2812 \# *Arguments:
2813 \#   <none> | <anything>
2814 \# *Function:
2815 \#   Converts text to caps, or, if OFF, reverts to normal caps/lc.
2816 \#
2817 .MAC CAPS END
2818 .    ie '\\$1'' \{\
2819 .       tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
2820 .       tr Ã \[`A]
2821 .       tr Ã¢\[^A]
2822 .       tr Ã¡\['A]
2823 .       tr Ã¤\[:A]
2824 .       tr Ã¥\[oA]
2825 .       tr Ã£\[~A]
2826 .       tr Ã¦\[AE]
2827 .       tr Ã¨\[`E]
2828 .       tr Ãª\[^E]
2829 .       tr Ã©\['E]
2830 .       tr Ã«\[:E]
2831 .       tr Ã¬\[`I]
2832 .       tr Ã®\[^I]
2833 .       tr Ã­\['I]
2834 .       tr Ã¯\[:I]
2835 .       tr Ã²\[`O]
2836 .       tr Ã´\[^O]
2837 .       tr Ã³\['O]
2838 .       tr Ã¶\[:O]
2839 .       tr Ãµ\[~O]
2840 .       tr Ã¸\[/O]
2841 .       tr Ã¹\[`U]
2842 .       tr Ã»\[^U]
2843 .       tr Ãº\['U]
2844 .       tr Ã¼\[:U]
2845 .       tr Ã§\[,C]
2846 .       tr Ã°\[-D]
2847 .       tr Ã±\[~N]
2848 .       tr Ã¾\[TP]
2849 .       tr Ã½\['Y]
2850 .       tr Ã¿\[:Y]
2851 .       nr #CAPS_ON 1
2852 .    \}
2853 .    el \{\
2854 .       tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
2855 .       tr Ã \[`a]
2856 .       tr Ã¢\[^a]
2857 .       tr Ã¡\['a]
2858 .       tr Ã¤\[:a]
2859 .       tr Ã¥\[oa]
2860 .       tr Ã£\[~a]
2861 .       tr Ã¦\[ae]
2862 .       tr Ã¨\[`e]
2863 .       tr Ãª\[^e]
2864 .       tr Ã©\['e]
2865 .       tr Ã«\[:e]
2866 .       tr Ã¬\[`i]
2867 .       tr Ã®\[^i]
2868 .       tr Ã­\['i]
2869 .       tr Ã¯\[:i]
2870 .       tr Ã²\[`o]
2871 .       tr Ã´\[^o]
2872 .       tr Ã³\['o]
2873 .       tr Ã¶\[:o]
2874 .       tr Ãµ\[~o]
2875 .       tr Ã¸\[/o]
2876 .       tr Ã¹\[`u]
2877 .       tr Ã»\[^u]
2878 .       tr Ãº\['u]
2879 .       tr Ã¼\[:u]
2880 .       tr Ã§\[,c]
2881 .       tr Ã°\[Sd]
2882 .       tr Ã±\[~n]
2883 .       tr Ã¾\[Tp]
2884 .       tr Ã½\['y]
2885 .       tr Ã¿\[:y]
2886 .       rr #CAPS_ON
2887 .    \}
2888 .END
2889 \#
2890 \# SIZESPECS
2891 \# ---------
2892 \# Argument:
2893 \#   <none>
2894 \# Function:
2895 \#   Gets cap-height, x-height, and descender depth of the
2896 \#   current font at the current point size.
2897 \# *Notes:
2898 \#   The routine is diverted so it remains invisible to output.
2899 \#
2900 .MAC SIZESPECS END
2901 .    di TYPESIZE
2902 E\\R'#CAP_HEIGHT \\n[.cht]'
2903 e\\R'#X_HEIGHT \\n[.cht]'
2904 y\\R'#DESCENDER \\n[.cdp]'
2905 .    br
2906 .    di
2907 .END
2908 \#
2909 \# =====================================================================
2910 \#
2911 \# +++TYPESETTING ALIASES+++
2912 \#
2913 .ALIAS    CENTRE          CENTER
2914 .ALIAS    COMMENT         SILENT
2915 .ALIAS    CONDENSE        CONDENSE_OR_EXTEND
2916 .ALIAS    EXTEND          CONDENSE_OR_EXTEND
2917 .ALIAS    FAM             FAMILY
2918 .ALIAS    HYPHENATE       HY
2919 .ALIAS    HYPHENATION     HY
2920 .ALIAS    HYSET           HY_SET
2921 .ALIAS    LIG             LIGATURES
2922 .ALIAS    IBQ             IBX
2923 .ALIAS    ILQ             ILX
2924 .ALIAS    IQ              IX
2925 .ALIAS    IRQ             IRX
2926 .ALIAS    PADMARKER       PAD_MARKER
2927 .ALIAS    TABSET          TAB_SET
2928 .ALIAS    TB              TAB
2929 .ALIAS    UNDERSCORE_2    UNDERSCORE2
2930 \#
2931 \#
2932 \# ====================================================================
2933 \#
2934 \# DOCUMENT PROCESSING MACROS, STRINGS AND ALIASES
2935 \# ===============================================
2936 \#
2937 \# +++PAGE DIMENSIONS+++
2938 \#
2939 \# PAPER SIZE
2940 \# ----------
2941 \# *Arguments:
2942 \#   LETTER | LEGAL | STATEMENT | TABLOID | LEDGER | FOLIO | QUARTO | 10x14 | EXECUTIVE | A3 | A4 | A5 | B4 | B5
2943 \# *Function:
2944 \#   Sets up margins for different paper sizes.
2945 \#
2946 .MAC PAPER END
2947 .    ds $PAPER \\$1
2948 .    if '\\*[$PAPER]'LETTER' \{\
2949 .       PAGEWIDTH  8.5i
2950 .       PAGELENGTH 11i
2951 .    \}
2952 .    if '\\*[$PAPER]'LEGAL' \{\
2953 .       PAGEWIDTH  8.5i
2954 .       PAGELENGTH 14i
2955 .    \}
2956 .    if '\\*[$PAPER]'STATEMENT' \{\
2957 .       PAGEWIDTH  5.5i
2958 .       PAGELENGTH 8.5i
2959 .    \}
2960 .    if '\\*[$PAPER]'TABLOID' \{\
2961 .       PAGEWIDTH  11i
2962 .       PAGELENGTH 17i
2963 .    \}
2964 .    if '\\*[$PAPER]'LEDGER' \{\
2965 .       PAGEWIDTH  17i
2966 .       PAGELENGTH 11i
2967 .    \}
2968 .    if '\\*[$PAPER]'FOLIO' \{\
2969 .       PAGEWIDTH  8.5i
2970 .       PAGELENGTH 13i
2971 .    \}
2972 .    if '\\*[$PAPER]'QUARTO' \{\
2973 .       PAGEWIDTH  610p
2974 .       PAGELENGTH 780p
2975 .    \}
2976 .    if '\\*[$PAPER]'10x14' \{\
2977 .       PAGEWIDTH  10i
2978 .       PAGELENGTH 14i
2979 .    \}
2980 .    if '\\*[$PAPER]'EXECUTIVE' \{\
2981 .       PAGEWIDTH  7.25i
2982 .       PAGELENGTH 10.5i
2983 .    \}
2984 .    if '\\*[$PAPER]'A3' \{\
2985 .       PAGEWIDTH  842p
2986 .       PAGELENGTH 1190p
2987 .    \}
2988 .    if '\\*[$PAPER]'A4' \{\
2989 .       PAGEWIDTH  595p
2990 .       PAGELENGTH 842p
2991 .    \}
2992 .    if '\\*[$PAPER]'A5' \{\
2993 .       PAGEWIDTH  421p
2994 .       PAGELENGTH 595p
2995 .    \}
2996 .    if '\\*[$PAPER]'B4' \{\
2997 .       PAGEWIDTH  709p
2998 .       PAGELENGTH 1002p
2999 .    \}
3000 .    if '\\*[$PAPER]'B5' \{\
3001 .       PAGEWIDTH  501p
3002 .       PAGELENGTH 709p
3003 .    \}
3004 .    if !r#L_MARGIN \{ .L_MARGIN \\n(.o \}
3005 .    if !r#R_MARGIN \{ .R_MARGIN 1i \}
3006 .END
3007 \#
3008 \#
3009 \# ====================================================================
3010 \#
3011 \# +++PRINTSTYLE -- TYPEWRITE OR TYPESET+++
3012 \#
3013 \# PRINTSTYLE
3014 \# ----------
3015 \# *Arguments:
3016 \#   TYPESET | TYPEWRITE [SINGLESPACE]
3017 \# *Function:
3018 \#   Sets type specs for typewriter-style or typeset output.
3019 \# *Notes:
3020 \#   Number registers: TYPEWRITE=1, TYPESET=2.
3021 \#
3022 .MAC PRINTSTYLE END
3023 .    if !d$PAPER \{ .PAPER LETTER \}
3024 .    if '\\$1'TYPEWRITE' \{\
3025 .       nr #PRINT_STYLE 1
3026 .       if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3027 .       if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3028 .       fam  C
3029 .       ft   R
3030 .       ps   12
3031 .       ie '\\$2'SINGLESPACE' \{\
3032 .           nr #SINGLE_SPACE 1
3033 .           vs 12
3034 .       \}
3035 .       el \{ .vs 24 \}
3036 .       QUAD    L
3037 .       HY      OFF
3038 .       SMARTQUOTES OFF
3039 .       if !\\n[#PP_INDENT] \{\
3040 .          in 3P                 \"Set indent
3041 .          nr #PP_INDENT \\n(.i  \"Read into #PP_INDENT
3042 .          in 0                  \"Remove indent
3043 .       \}
3044 .       HDRFTR_RIGHT_CAPS
3045 .       nr #BOLDER_UNITS 0
3046 .       nr #CONDENSE 0
3047 .       nr #EXTEND 0
3048 .       rm IT
3049 .       rm BD
3050 .       rm BDI
3051 .       rm PREV
3052 .       UNDERLINE_SLANT
3053 .       UNDERLINE_ITALIC
3054 .       UNDERLINE_QUOTES
3055 .       nr #IGNORE_COLUMNS 1
3056 .    \}
3057 .    if '\\$1'TYPESET' \{\
3058 .       nr #PRINT_STYLE 2
3059 .       if !\\n[#DOC_TYPE]=4 \{ .L_MARGIN 6P \}
3060 .       if !\\n[#DOC_TYPE]=4 \{ .R_MARGIN 6P \}
3061 .       FAMILY  T
3062 .       FT      R
3063 .       if !\\n[#DOC_TYPE]=4 \{ .PT_SIZE 12.5 \}
3064 .       if !\\n[#DOC_TYPE]=4 \{ .LS 16 \}
3065 .       JUSTIFY
3066 .       HY
3067 .       HY_SET 2 36p 1p
3068 .       KERN
3069 .       LIG
3070 .       SS 0
3071 .       SMARTQUOTES
3072 .       if !\\n[#PP_INDENT] \{\
3073 .          in 2m                 \"Set indent
3074 .          nr #PP_INDENT \\n(.i  \"Read into #PP_INDENT
3075 .          in 0                  \"Remove indent
3076 .       \}
3077 .       HDRFTR_RIGHT_CAPS
3078 .       rr #IGNORE_COLUMNS
3079 .    \}
3080 .END
3081 \#
3082 \#
3083 \# Macros to control behaviour of PRINTSTYLE TYPEWRITE
3084 \#
3085 \# ITALIC MEANS ITALIC
3086 \# -------------------
3087 \# *Argument:
3088 \#   <none>
3089 \# *Function:
3090 \#   Instructs TYPEWRITE to treat italics as italics, whether
3091 \#   invoked via control lines or inline.
3092 \# *Notes:
3093 \#   ITALIC_MEANS_ITALIC and UNDERLINE_ITALIC are mututally exclusive,
3094 \#   hence invoking the one automatically turns off the other.
3095 \#
3096 .MAC ITALIC_MEANS_ITALIC END
3097 .    if \\n[#PRINT_STYLE]=1 \{\
3098 .       nr #ITALIC_MEANS_ITALIC 1
3099 .       rr #UNDERLINE_ITALIC
3100 .       rm ROM
3101 .       rm IT
3102 .       rm PREV
3103 .       ds ROM  \EfR
3104 .       ds IT   \EfI
3105 .       ds PREV \EfR
3106 .    \}
3107 .END
3108 \#
3109 \#
3110 \# UNDERLINE ITALIC
3111 \# ----------------
3112 \# *Argument:
3113 \#   <none>
3114 \# *Function:
3115 \#   Instructs TYPEWRITE to underline italics, whether invoked
3116 \#   via control lines or inline.
3117 \# *Notes:
3118 \#   UNDERLINE_ITALIC and ITALIC_MEANS_ITALIC are mututally exclusive,
3119 \#   hence invoking the one automatically turns off the other.
3120 \#
3121 \#   UNDERLINE_ITALIC is the default for TYPEWRITE.
3122 \#
3123 .MAC UNDERLINE_ITALIC END
3124 .    if \\n[#PRINT_STYLE]=1 \{\
3125 .       nr #UNDERLINE_ITALIC 1
3126 .       rr #ITALIC_MEANS_ITALIC
3127 .       rm ROM
3128 .       rm IT
3129 .       rm PREV
3130 .       ds ROM  \E*[ULX]
3131 .       ds IT   \E*[UL]
3132 .       ds PREV \E*[ULX]
3133 .    \}
3134 .END
3135 \#
3136 \#
3137 \# UNDERLINE SLANT
3138 \# ---------------
3139 \# *Arguments:
3140 \#   <none> | <anything>
3141 \# *Function:
3142 \#   Instructs TYPEWRITE to underline occurences of \*[SLANT], or
3143 \#   turns feature off.
3144 \# *Notes:
3145 \#   Users may want \*[SLANT] to mean slant in TYPEWRITE, although
3146 \#   most of the time, \*[SLANT] most likely means the user wanted
3147 \#   italic but didn't have it, ergo the need to tell TYPEWRITE to
3148 \#   treat \*[SLANT] as italic (i.e. underlined).
3149 \#
3150 \#   UNDERLINE_SLANT and SLANT_MEANS_SLANT are mututally exclusive,
3151 \#   hence invoking the one automatically turns off the other.
3152 \#
3153 \#   UNDERLINE_SLANT is the default for TYPEWRITE.
3154 \#
3155 .MAC UNDERLINE_SLANT END
3156 .    if \\n[#PRINT_STYLE]=1 \{\
3157 .       rr #SLANT_MEANS_SLANT
3158 .       nr #UNDERLINE_SLANT 1
3159 .       rm SLANT
3160 .       rm SLANTX
3161 .       ds SLANT  \ER'#SLANT_ON 1'\E*[UL]
3162 .       ds SLANTX \ER'#SLANT_ON 0'\E*[ULX]
3163 .    \}
3164 .END
3165 \#
3166 \#
3167 .MAC SLANT_MEANS_SLANT END
3168 .    if \\n[#PRINT_STYLE]=1 \{\
3169 .       rr #UNDERLINE_SLANT
3170 .       nr #SLANT_MEANS_SLANT 1
3171 .       rm SLANT
3172 .       rm SLANTX
3173 .       ds SLANT  \ER'#SLANT_ON 1'\ES'\En[#DEGREES]'
3174 .       ds SLANTX \ER'#SLANT_ON 0'\ES'0'
3175 .    \}
3176 .END
3177 \#
3178 \#
3179 .MAC IGNORE_COLUMNS END
3180 .    if \\n[#PRINT_STYLE]=1 \{ .nr #NO_COLUMNS 1 \}
3181 .END
3182 \#
3183 \#
3184 \# ====================================================================
3185 \#
3186 \# +++COPY STYLE -- DRAFT OR FINAL+++
3187 \#
3188 \# COPY STYLE
3189 \# ----------
3190 \# *Arguments:
3191 \#   DRAFT | FINAL
3192 \# *Function:
3193 \#   Sets registers that are used to determine what to put
3194 \#   in the default header, and how to number pages.
3195 \# *Notes:
3196 \#   DOCTYPE must come before COPYSTYLE.
3197 \#
3198 .MAC COPYSTYLE END
3199 .    ds $COPY_STYLE \\$1
3200 .    if '\\*[$COPY_STYLE]'DRAFT' \{\
3201 .       nr #COPY_STYLE 1
3202 .       if !r#DRAFT \{ .DRAFT 1 \}
3203 .    \}
3204 .    if '\\*[$COPY_STYLE]'FINAL' \{ .nr #COPY_STYLE 2 \}
3205 .    if !d$CHAPTER_STRING        \{ .CHAPTER_STRING "Chapter" \}
3206 .    if !d$DRAFT_STRING          \{ .DRAFT_STRING "Draft"     \}
3207 .    if !d$REVISION_STRING       \{ .REVISION_STRING "Rev."   \}
3208 \# Default
3209 .    if \\n[#DOC_TYPE]=1 \{\
3210 .       ie \\n[#COPY_STYLE]=1 \{\
3211 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3212 .          el \{ .PAGENUM_STYLE roman \}
3213 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3214 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
3215 .                ds $HDRFTR_CENTER
3216 .             \}
3217 .             el \{\
3218 .                ie !\\n[#REVISION] \{\
3219 .                   ds $HDRFTR_CENTER \
3220                     \\*[$DRAFT_STRING] \\n[#DRAFT]
3221 .                \}
3222 .                el \{\
3223 .                   ds $HDRFTR_CENTER \
3224                     \\*[$DRAFT_STRING] \\n[#DRAFT], \
3225                     \\*[$REVISION_STRING] \\n[#REVISION]
3226 .                \}
3227 .             \}
3228 .          \}
3229 .       \}
3230 .       el \{\
3231 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3232 .          el \{ .PAGENUM_STYLE DIGIT \}
3233 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{ .ds $HDRFTR_CENTER \}
3234 .       \}
3235 .    \}
3236 \# Chapter
3237 .    if \\n[#DOC_TYPE]=2 \{\
3238 .       ie \\n[#COPY_STYLE]=1 \{\
3239 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3240 .          el \{ .PAGENUM_STYLE roman \}
3241 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3242 .             ie \\n[#DRAFT_WITH_PAGENUM] \{\
3243 .                ie '\\*[$CHAPTER]'' \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3244 .                el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \}
3245 .             \}
3246 .             el \{\
3247 .                ie !\\n[#REVISION] \{\
3248 .                   ie '\\*[$CHAPTER]'' \{\
3249 .                      ds $HDRFTR_CENTER \
3250                        \\*[$CHAPTER_STRING], \
3251                        \\*[$DRAFT_STRING] \\n[#DRAFT]
3252 .                   \}
3253 .                   el \{\
3254 .                      ds $HDRFTR_CENTER \
3255                        \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3256                        \\*[$DRAFT_STRING] \\n[#DRAFT]
3257 .                   \}
3258 .                \}
3259 .                el \{\
3260 .                   ie '\\*[$CHAPTER]'' \{\
3261 .                   el \{\
3262                        \\*[$CHAPTER_STRING], \
3263                        \\*[$DRAFT_STRING] \\n[#DRAFT], \
3264                        \\*[$REVISION_STRING] \\n[#REVISION]
3265 .                   \}
3266 .                   ds $HDRFTR_CENTER \
3267                        \\*[$CHAPTER_STRING] \\*[$CHAPTER], \
3268                        \\*[$DRAFT_STRING] \\n[#DRAFT], \
3269                        \\*[$REVISION_STRING] \\n[#REVISION]
3270 .                   \}
3271 .                \}
3272 .             \}
3273 .          \}
3274 .       \}
3275 .       el \{\
3276 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3277 .             ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3278 .             el \{ .PAGENUM_STYLE DIGIT \}
3279 .             ie '\\*[$CHAPTER]'' \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \}
3280 .             el \{ .ds $HDRFTR_CENTER \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3281 .          \}
3282 .       \}
3283 .    \}
3284 \# Named
3285 .    if \\n[#DOC_TYPE]=3 \{\
3286 .       ie \\n[#COPY_STYLE]=1 \{\
3287 .          ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3288 .          el \{ .PAGENUM_STYLE roman \}
3289 .          ie \\n[#DRAFT_WITH_PAGENUM] \{\
3290 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3291 .          \}
3292 .          el \{\
3293 .             if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3294 .                ie !\\n[#REVISION] \{\
3295 .                   ds $HDRFTR_CENTER \
3296                     \\*[$DOC_TYPE], \
3297                     \\*[$DRAFT_STRING] \\n[#DRAFT]
3298 .                \}
3299 .                el \{\
3300 .                   ds $HDRFTR_CENTER \
3301                     \\*[$DOC_TYPE], \
3302                     \\*[$DRAFT_STRING] \\n[#DRAFT], \
3303                     \\*[$REVISION_STRING] \\n[#REVISION]
3304 .                \}
3305 .             \}
3306 .          \}
3307 .       \}
3308 .       el \{\
3309 .          if \\n[#USER_DEF_HDRFTR_CENTER]=0 \{\
3310 .             ie \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3311 .             el \{ .PAGENUM_STYLE DIGIT \}
3312 .             ds $HDRFTR_CENTER \\*[$DOC_TYPE]
3313 .          \}
3314 .       \}
3315 .    \}
3316 .END
3317 \#
3318 \# ====================================================================
3319 \#
3320 \# +++COLLECT DOC INFO -- STRINGS AND NUMBER REGISTERS+++
3321 \#
3322 \# *Arguments:
3323 \#   various string/register arguments
3324 \# *Function:
3325 \#   Collect information about documents.
3326 \#
3327 .MAC TITLE END \"Document title
3328 .    ds $TITLE \\$1
3329 .END
3330 \#
3331 \#
3332 .MAC SUBTITLE END \"Document sub-title
3333 .    ds $SUBTITLE \\$1
3334 .END
3335 \#
3336 \#
3337 .MAC CHAPTER END \"If document is a chapter, the chapter number
3338 .    ds $CHAPTER \\$1
3339 .END
3340 \#
3341 \#
3342 .MAC DRAFT END \"Draft number
3343 .    nr #DRAFT \\$1
3344 .END
3345 \#
3346 \#
3347 .MAC REVISION END \"Revision number
3348 .    nr #REVISION \\$1
3349 .END
3350 \#
3351 \#
3352 .MAC DRAFT_WITH_PAGENUMBER END \"Attach draft/revision strings to page number
3353 .    nr #DRAFT_WITH_PAGENUM 1
3354 .END
3355 \#
3356 \#
3357 .MAC AUTHOR END \"Author.  Use "..." with this macro.
3358 .    nr #AUTHOR_NUM -1 1
3359 .    while \\n[#NUM_ARGS]>\\n[#AUTHOR_NUM] \{\
3360 .       ds $AUTHOR_\\n+[#AUTHOR_NUM] \\$\\n[#AUTHOR_NUM]
3361 .    \}
3362 .    nr #NUM_AUTHORS \\n[#NUM_ARGS]%2 \"Use mod 2 to test if odd or even # of authors
3363 .    ie \\n[#NUM_AUTHORS]=1 \{ .nr #AUTHOR_LINES 0  \}
3364 .    el \{ .nr #AUTHOR_LINES 1 \}
3365 .END
3366 \#
3367 \#
3368 .MAC PAGENUMBER END \"Page # that appears on page one.
3369 .    nr #n%_AT_PAGENUM_SET \\n%
3370 .    nr #PAGE_NUM_ADJ \\$1-\\n[#n%_AT_PAGENUM_SET]
3371 .    rr #n%_AT_PAGENUM_SET
3372 .    nr #PAGE_NUM_SET 1
3373 .END
3374 \#
3375 \# ====================================================================
3376 \#
3377 \# +++TYPE OF DOCUMENT+++
3378 \#
3379 \# DOCUMENT TYPE
3380 \# -------------
3381 \# *Argument:
3382 \#   DEFAULT | CHAPTER | NAMED "<whatever> | LETTER
3383 \# *Function:
3384 \#   Creates strings and sets registers for document types.
3385 \# *Notes:
3386 \#   Number registers: DEFAULT=1, CHAPTER=2, NAMED=3, LETTER=4
3387 \#
3388 .MAC DOCTYPE END
3389 .    if '\\$1'DEFAULT' \{\
3390 .       nr #DOC_TYPE 1
3391 .    \}
3392 .    if '\\$1'CHAPTER' \{\
3393 .       nr #DOC_TYPE 2
3394 .    \}
3395 .    if '\\$1'NAMED' \{\
3396 .       ds $DOC_TYPE \\$2
3397 .       nr #DOC_TYPE 3
3398 .    \}
3399 .    if '\\$1'LETTER' \{\
3400 .       nr #DOC_TYPE 4
3401 .       L_MARGIN 1.125i
3402 .       R_MARGIN 1.125i
3403 .       PT_SIZE 12
3404 .       LS 13.5
3405 .       DOCHEADER OFF
3406 .       PARA_INDENT 3m
3407 .       INDENT_FIRST_PARAS
3408 .       PARA_SPACE
3409 .       ds $SUITE \En[#SUITE]
3410 .       HEADER_MARGIN 3P+6p
3411 .       HEADER_GAP 3P
3412 .       FOOTERS
3413 .       FOOTER_RULE OFF
3414 .       FOOTER_LEFT ""
3415 .       FOOTER_CENTER ""
3416 .       FOOTER_RIGHT_SIZE +0
3417 .       FOOTER_RIGHT ".../\E*[$SUITE]
3418 .       FOOTER_ON_FIRST_PAGE
3419 .       em ALL_DONE
3420 .    \}
3421 .END
3422 \#
3423 \# +++LETTER MACROS+++
3424 \#
3425 \# DATE
3426 \# ----
3427 \# *Arguments:
3428 \#   <date string>
3429 \# *Function:
3430 \#   Stores date string in string $DATE.
3431 \#
3432 .MAC DATE END
3433 .    nr #DATE 1
3434 .    di DATE
3435 .    RIGHT
3436 .END
3437 \#
3438 \#
3439 \# TO
3440 \# --
3441 \# *Arguments:
3442 \#   <none>
3443 \# *Function:
3444 \#  Stores "to" info in diversion TO_ADDRESS.
3445 \#
3446 .MAC TO END
3447 .    if !'\\n(.z'' \{ .di \}
3448 .    nr #TO 1
3449 .    di TO_ADDRESS
3450 .    LEFT
3451 .END
3452 \#
3453 \#
3454 \# FROM
3455 \# ----
3456 \# *Arguments:
3457 \#   <none>
3458 \# *Function:
3459 \#  Stores "from" info in diversion FROM_ADDRESS.
3460 \#
3461 .MAC FROM END
3462 .    if !'\\n(.z'' \{ .di \}
3463 .    nr #FROM 1
3464 .    di FROM_ADDRESS
3465 .    LEFT
3466 .END
3467 \#
3468 \#
3469 \# GREETING
3470 \# --------
3471 \# *Arguments:
3472 \#   <greeting string>
3473 \# *Function:
3474 \#   Stores greeting in string $GREETING.
3475 \#
3476 .MAC GREETING END
3477 .    if !'\\n(.z'' \{ .di \}
3478 .    nr #GREETING 1
3479 .    di GREETING
3480 .    LEFT
3481 .END
3482 \#
3483 \#
3484 \# CLOSING
3485 \# -------
3486 \# *Arguments:
3487 \#   <closing string>
3488 \# *Function:
3489 \#   Stores greeting in string $CLOSING.
3490 \#
3491 .MAC CLOSING END
3492 .    br
3493 .    nr #CLOSING 1
3494 .    di CLOSING
3495 .END
3496 \#
3497 \#
3498 \# NO SUITE
3499 \# --------
3500 \# *Arguments:
3501 \#   <none>
3502 \# *Function:
3503 \#   Redefines $SUITE to blank so that a suite number doesn't
3504 \#   appear at the bottom of letter pages.
3505 \#
3506 .MAC NO_SUITE END
3507 .    FOOTER_RIGHT ""
3508 .END
3509 \#
3510 \# ====================================================================
3511 \#
3512 \# +++DEFAULTS+++
3513 \#
3514 \# DEFAULTS
3515 \# --------
3516 \# *Arguments:
3517 \#   <none>
3518 \# *Function:
3519 \#   Sets up defaults if no values are entered prior to START.
3520 \# *Notes:
3521 \#   The defaults for $CHAPTER_STRING, $DRAFT_STRING, and
3522 \#   $REVISION_STRING are in the COPYSTYLE macro.
3523 \#
3524 .MAC DEFAULTS END
3525 .    if !d$PAPER \{ .PAPER LETTER \}
3526 .    if !\\n[#DOC_TYPE]   \{ .DOCTYPE DEFAULT \}
3527 .    if \\n[#PAGENUM_STYLE_SET] \{ .PAGENUM_STYLE \\*[$PAGENUM_STYLE] \}
3528 .    if !\\n[#COPY_STYLE] \{ .COPYSTYLE FINAL \}
3529 .    if \\n[#DRAFT_WITH_PAGENUM] \{ .COPYSTYLE \\*[$COPY_STYLE] \}
3530 .    if \\n[#DOC_TYPE]=4 \{\
3531 .       if !\\n[#USER_SET_L_LENGTH] \{\
3532 .          R_MARGIN \\n[#R_MARGIN]u
3533 .          rr #USER_SET_L_LENGTH
3534 .       \}
3535 .       if \\n[#PRINT_STYLE]=1 \{ .PRINTSTYLE TYPEWRITE SINGLESPACE \}
3536 .    \}
3537 .    if \\n[#COPY_STYLE]=1 \{\
3538 .       COPYSTYLE DRAFT
3539 .       PAGENUMBER 1
3540 .    \}
3541 .    if !r#DOC_HEADER \{ .DOCHEADER  \}
3542 .    if !r#HEADERS_ON \{ .HEADERS    \}
3543 .    if !r#PAGINATE   \{ .PAGINATE   \}
3544 .    if \\n[#FOOTERS_ON] \{\
3545 .       HEADERS OFF
3546 .       if \\n[#PAGE_NUM_POS_SET]=0 \{ .PAGENUM_POS TOP CENTER \}
3547 .    \}
3548 .    if !r#HEADER_MARGIN \{ .HEADER_MARGIN 4P+6p \}
3549 .    if !r#HEADER_GAP    \{ .HEADER_GAP    3P    \}
3550 .    if \\n[#FOOTERS_ON] \{\
3551 .       if \\n[#PAGINATE]=0 \{\
3552 .          if !r#T_MARGIN \{ .T_MARGIN 6P \}
3553 .       \}
3554 .    \}
3555 .    if \\n[#HEADERS_ON]=0    \{\
3556 .       if \\n[#FOOTERS_ON]=0 \{\
3557 .          if !r#T_MARGIN \{ .T_MARGIN 6P \}
3558 .       \}
3559 .    \}
3560 .    if !r#T_MARGIN          \{ .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP] \}
3561 .    if !r#DOCHEADER_ADVANCE \{ .DOCHEADER_ADVANCE \\n[#T_MARGIN] \}
3562 .    if !r#FOOTER_MARGIN     \{ .FOOTER_MARGIN 3P \}
3563 .    if !r#FOOTER_GAP        \{ .FOOTER_GAP    3P \}
3564 .    if !r#B_MARGIN          \{ .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u \}
3565 .    if !r#HDRFTR_RULE_GAP   \{\
3566 .       if \\n[#HEADERS_ON]  \{ .HDRFTR_RULE_GAP 4p \}
3567 .       if \\n[#FOOTERS_ON]  \{ .HDRFTR_RULE_GAP 4p \}
3568 .    \}
3569 .    if !r#HDRFTR_RULE        \{ .HDRFTR_RULE            \}
3570 .    if !r#PAGE_NUM_SET       \{ .PAGENUMBER         1   \}
3571 .    ie r#ADJ_DOC_LEAD \{ . \}
3572 .    el \{ .DOC_LEAD_ADJUST \}
3573 \# Read in number registers and strings for type parameters
3574 .    nr #DOC_L_MARGIN \\n[#L_MARGIN]
3575 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
3576 .    nr #DOC_R_MARGIN \\n[#PAGE_WIDTH]-(\\n[#DOC_L_MARGIN]+\\n[#L_LENGTH])
3577 .    ds $DOC_FAM      \\*[$FAMILY]
3578 .    nr #DOC_PT_SIZE  \\n[#PT_SIZE]
3579 .    nr #DOC_LEAD     \\n[#LEAD]
3580 .    ds $DOC_QUAD     \\*[$QUAD_VALUE]
3581 .    ds $PP_FT        \\*[$FONT]
3582 \# Counters
3583 .    nr #PP 0
3584 .    nr #FN_NUMBER 0 1
3585 .    nr #EN_NUMBER 0 1
3586 .    nr #FN_COUNT_FOR_COLS 0 1
3587 .    RESET_HEAD_NUMBER
3588 .    RESET_SUBHEAD_NUMBER
3589 .    RESET_PARAHEAD_NUMBER
3590 \# General style defaults for both PRINTSTYLEs
3591 .    nr #PP_STYLE 1
3592 .    PARA_INDENT \\n[#PP_INDENT]u
3593 .    if !d$HDRFTR_FAM           \{ .HDRFTR_FAMILY  \\*[$DOC_FAM] \}
3594 .    if !d$HDRFTR_SIZE_CHANGE   \{ .HDRFTR_SIZE    +0            \}
3595 .    if !d$PAGE_NUM_FAM         \{ .PAGENUM_FAMILY \\*[$DOC_FAM] \}
3596 .    if !d$PAGE_NUM_FT          \{ .PAGENUM_FONT   R             \}
3597 .    if !d$PAGE_NUM_SIZE_CHANGE \{ .PAGENUM_SIZE   +0            \}
3598 .    if !r#PAGE_NUM_POS_SET     \{ .PAGENUM_POS BOTTOM CENTER    \}
3599 .    ie \\n[#PAGE_NUM_HYPHENS_SET] \{\
3600 .       if \\n[#PAGE_NUM_HYPHENS]=0  \{ .PAGENUM_HYPHENS OFF \}
3601 .       if \\n[#PAGE_NUM_HYPHENS]=1  \{ .PAGENUM_HYPHENS     \}
3602 .    \}
3603 .    el \{ .PAGENUM_HYPHENS \}
3604 .    if !d$HEAD_QUAD         \{ .HEAD_QUAD CENTER  \}
3605 .    if !r#HEAD_CAPS         \{ .HEAD_CAPS         \}
3606 .    if !r#HEAD_UNDERLINE    \{ .HEAD_UNDERLINE    \}
3607 .    if !d$SH_QUAD           \{ .SUBHEAD_QUAD LEFT \}
3608 .    if !r#HDRFTR_RIGHT_CAPS \{ .HDRFTR_RIGHT_CAPS \}
3609 .    if \\n[#HDRFTR_RIGHT_CAPS]=0 \{\
3610 .       if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE +0 \}
3611 .    \}
3612 .    if !d$FN_FAM          \{ .FOOTNOTE_FAMILY \\*[$DOC_FAM] \}
3613 .    if !d$FN_FT           \{ .FOOTNOTE_FONT R               \}
3614 .    if !d$FN_QUAD         \{ .FOOTNOTE_QUAD \\*[$DOC_QUAD]  \}
3615 .    if !r#FN_RULE         \{ .FOOTNOTE_RULE                 \}
3616 .    if !r#FN_MARKERS      \{ .FOOTNOTE_MARKERS              \}
3617 .    if !r#FN_MARKER_STYLE \{ .FOOTNOTE_MARKER_STYLE STAR    \}
3618 .    if !d$EN_FAM               \{ .ENDNOTE_FAMILY \\*[$DOC_FAM]        \}
3619 .    if !d$EN_FN                \{ .ENDNOTE_FONT R                      \}
3620 .    if !d$EN_QUAD              \{ .ENDNOTE_QUAD \\*[$DOC_QUAD]         \}
3621 .    if !d$EN_STRING            \{ .ENDNOTE_STRING "ENDNOTES"           \}
3622 .    if !d$EN_STRING_FAM        \{ .ENDNOTE_STRING_FAMILY \\*[$DOC_FAM] \}
3623 .    if !d$EN_STRING_QUAD       \{ .ENDNOTE_STRING_QUAD CENTER          \}
3624 .    if !r#EN_STRING_UNDERSCORE \{ .ENDNOTE_STRING_UNDERSCORE 2         \}
3625 .    if !d$EN_TITLE \{\
3626 .       ie \\n[#DOC_TYPE]=2 \{\
3627 .          ie '\\*[$CHAPTER]'' \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING]" \}
3628 .          el \{ .ENDNOTE_TITLE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"    \}
3629 .       \}
3630 .       el \{ .ENDNOTE_TITLE "\\*[$TITLE]" \}
3631 .    \}
3632 .   if !d$EN_TITLE_FAM          \{ .ENDNOTE_TITLE_FAM \\*[$DOC_FAM]     \}
3633 .   if !d$EN_TITLE_QUAD         \{ .ENDNOTE_TITLE_QUAD LEFT             \}
3634 .   if !r#EN_TITLE_UNDERSCORE   \{ .ENDNOTE_TITLE_UNDERSCORE            \}
3635 .   if !d$EN_NUMBER_FAM         \{ .ENDNOTE_NUMBER_FAMILY \\*[$DOC_FAM] \}
3636 .   if !r#EN_NUMBERS_ALIGN_LEFT  \{\
3637 .      if !r#EN_NUMBERS_ALIGN_RIGHT \{ .ENDNOTE_NUMBERS_ALIGN_RIGHT 2   \}
3638 .   \}
3639 \# String defaults for both PRINTSTYLEs
3640 .    if !d$ATTRIBUTE_STRING           \{ .ATTRIBUTE_STRING "by"           \}
3641 .    if \\n[#USER_DEF_HDRFTR_LEFT]=0  \{ .ds $HDRFTR_LEFT  \\*[$AUTHOR_1] \}
3642 .    rr #USER_DEF_HDRFTR_LEFT
3643 .    if \\n[#USER_DEF_HDRFTR_RIGHT]=0 \{ .ds $HDRFTR_RIGHT \\*[$TITLE]    \}
3644 .    rr #USER_DEF_HDRFTR_RIGHT
3645 .    if !d$FINIS_STRING               \{ .FINIS_STRING     "END"          \}
3646 \# Defaults for printstyle TYPEWRITE
3647 .    if \\n[#PRINT_STYLE]=1 \{\
3648 .       if \\n[#UNDERLINE_QUOTES]=1 \{ .UNDERLINE_QUOTES         \}
3649 .       if \\n[#UNDERLINE_QUOTES]=0 \{ .UNDERLINE_QUOTES OFF     \}
3650 .       if !r#Q_OFFSET_VALUE        \{ .QUOTE_INDENT      2      \}
3651 .       if !r#EPI_OFFSET_VALUE      \{ .EPIGRAPH_INDENT   2      \}
3652 .       if !d$LINEBREAK_CHAR        \{ .LINEBREAK_CHAR    * 3 2p \}
3653 .       if !d$FN_SIZE_CHANGE        \{ .FOOTNOTE_SIZE     +0     \}
3654 .       if !r#FN_RULE_LENGTH        \{ .FOOTNOTE_RULE_LENGTH 2i  \}
3655 .       if !r#FN_RULE_ADJ           \{ .FOOTNOTE_RULE_ADJ  6p    \}
3656 .       if !r#SLANT_MEANS_SLANT \{\
3657 .          ie \\n[#UNDERLINE_SLANT]=1 \{ .UNDERLINE_SLANT \}
3658 .          el \{ .UNDERLINE_SLANT OFF \}
3659 .       \}
3660 .       if !r#PH_INDENT    \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3661 .       if !r#EN_PP_INDENT \{ .ENDNOTE_PARA_INDENT \\n[#PP_INDENT] \}
3662 .    \}
3663 \# Defaults for printstyle TYPESET
3664 .    if \\n[#PRINT_STYLE]=2 \{\
3665 .       if !#DOCHEADER_LEAD \{ .DOCHEADER_LEAD +0            \}
3666 .       if !d$TITLE_FAM     \{ .TITLE_FAMILY   \\*[$DOC_FAM] \}
3667 .       if !d$TITLE_FT      \{ .TITLE_FONT     B             \}
3668 .       if !d$TITLE_SIZE_CHANGE \{\
3669 .          ie \\n[#DOC_TYPE]=2 \{ .TITLE_SIZE +4 \}
3670 .          el \{ .TITLE_SIZE +3.5 \}
3671 .       \}
3672 .       if !d$SUBTITLE_FAM         \{ .SUBTITLE_FAMILY    \\*[$DOC_FAM] \}
3673 .       if !d$SUBTITLE_FT          \{ .SUBTITLE_FONT      R             \}
3674 .       if !d$SUBTITLE_SIZE_CHANGE \{ .SUBTITLE_SIZE      +0            \}
3675 .       if !d$AUTHOR_FAM           \{ .AUTHOR_FAMILY      \\*[$DOC_FAM] \}
3676 .       if !d$AUTHOR_FT            \{ .AUTHOR_FONT        I             \}
3677 .       if !d$AUTHOR_SIZE_CHANGE   \{ .AUTHOR_SIZE        +0            \}
3678 .       if !d$DOCTYPE_FAM          \{ .DOCTYPE_FAMILY     \\*[$DOC_FAM] \}
3679 .       if !d$DOCTYPE_FT           \{ .DOCTYPE_FONT       BI            \}
3680 .       if !d$DOCTYPE_SIZE_CHANGE  \{ .DOCTYPE_SIZE       +3            \}
3681 .       if !d$HDRFTR_LEFT_FAM      \{ .HDRFTR_LEFT_FAMILY \\*[$DOC_FAM] \}
3682 .       if !d$HDRFTR_LEFT_FT       \{ .HDRFTR_LEFT_FONT   R             \}
3683 .       if \\n[#HDRFTR_LEFT_CAPS]  \{\
3684 .          if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE  -2 \}
3685 .       \}
3686 .       if !d$HDRFTR_LEFT_SIZE_CHANGE \{ .HDRFTR_LEFT_SIZE     -.5           \}
3687 .       if !d$HDRFTR_CENTER_FAM       \{ .HDRFTR_CENTER_FAMILY \\*[$DOC_FAM] \}
3688 .       if !d$HDRFTR_CENTER_FT        \{ .HDRFTR_CENTER_FONT   I             \}
3689 .       if \\n[#HDRFTR_CENTER_CAPS] \{\
3690 .          if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -2 \}
3691 .       \}
3692 .       if !d$HDRFTR_CENTER_SIZE_CHANGE \{ .HDRFTR_CENTER_SIZE -.5              \}
3693 .       if !d$HDRFTR_RIGHT_FAM          \{ .HDRFTR_RIGHT_FAMILY \\*[$DOC_FAM]   \}
3694 .       if !d$HDRFTR_RIGHT_FT           \{ .HDRFTR_RIGHT_FONT   R               \}
3695 .       if \\n[#HDRFTR_RIGHT_CAPS] \{\
3696 .          if !d$HDRFTR_RIGHT_SIZE_CHANGE \{ .HDRFTR_RIGHT_SIZE -2 \}
3697 .       \}
3698 .       if !d$HDRFTR_RIGHT_SIZE_CHANGE  \{ .HDRFTR_RIGHT_SIZE  -.5              \}
3699 .       if !d$HEAD_FAM                  \{ .HEAD_FAMILY        \\*[$DOC_FAM]    \}
3700 .       if !d$HEAD_FT                   \{ .HEAD_FONT          B                \}
3701 .       if !d$HEAD_SIZE_CHANGE          \{ .HEAD_SIZE          +1               \}
3702 .       if !r#HEAD_SPACE                \{ .HEAD_SPACE                          \}
3703 .       if !d$SH_FAM                    \{ .SUBHEAD_FAMILY     \\*[$DOC_FAM]    \}
3704 .       if !d$SH_FT                     \{ .SUBHEAD_FONT       B                \}
3705 .       if !d$SH_SIZE_CHANGE            \{ .SUBHEAD_SIZE       +.5              \}
3706 .       if !d$PH_FAM                    \{ .PARAHEAD_FAMILY    \\*[$DOC_FAM]    \}
3707 .       if !d$PH_FT                     \{ .PARAHEAD_FONT      BI               \}
3708 .       if !d$PH_SIZE_CHANGE            \{ .PARAHEAD_SIZE      -.25             \}
3709 .       if !r#PH_INDENT                 \{ .PARAHEAD_INDENT \\n[#PP_INDENT]u/2u \}
3710 .       if !d$QUOTE_FAM                 \{ .QUOTE_FAMILY       \\*[$DOC_FAM]    \}
3711 .       if !d$QUOTE_FT                  \{ .QUOTE_FONT         I                \}
3712 .       if !d$QUOTE_SIZE_CHANGE         \{ .QUOTE_SIZE         +0               \}
3713 .       if !r#Q_OFFSET_VALUE            \{ .QUOTE_INDENT       3                \}
3714 .       if !d$BQUOTE_FAM                \{ .BLOCKQUOTE_FAMILY  \\*[$DOC_FAM]    \}
3715 .       if !d$BQUOTE_FT                 \{ .BLOCKQUOTE_FONT    R                \}
3716 .       if !d$BQUOTE_SIZE_CHANGE        \{ .BLOCKQUOTE_SIZE    -1               \}
3717 .       if !d$BQUOTE_QUAD               \{ .BLOCKQUOTE_QUAD    LEFT             \}
3718 .       if !d$EPI_FAM                   \{ .EPIGRAPH_FAMILY    \\*[$DOC_FAM]    \}
3719 .       if !d$EPI_FT                    \{ .EPIGRAPH_FONT      R                \}
3720 .       if !d$EPI_SIZE_CHANGE           \{ .EPIGRAPH_SIZE      -1.5             \}
3721 .       if !r#EPI_AUTOLEAD              \{ .EPIGRAPH_AUTOLEAD  2                \}
3722 .       if !d$EPI_QUAD                  \{ .EPIGRAPH_QUAD      \\*[$DOC_QUAD]   \}
3723 .       if !r#EPI_OFFSET_VALUE          \{ .EPIGRAPH_INDENT    3                \}
3724 .       if !d$LINEBREAK_CHAR            \{ .LINEBREAK_CHAR     * 3 3p           \}
3725 .       if !r#FN_RULE_LENGTH            \{ .FOOTNOTE_RULE_LENGTH 4P             \}
3726 .       if !r#FN_RULE_ADJ               \{ .FOOTNOTE_RULE_ADJ  3p               \}
3727 .       if !d$FN_SIZE_CHANGE            \{ .FOOTNOTE_SIZE      -2               \}
3728 .       if !r#FN_AUTOLEAD               \{ .FOOTNOTE_AUTOLEAD  2                \}
3729 .       if !r#EN_PS                     \{ .ENDNOTE_PT_SIZE \\n[#DOC_PT_SIZE]u  \}
3730 .       if !r#EN_LEAD                   \{ .ENDNOTE_LEAD        13.5p           \}
3731 .       if !d$EN_STRING_FT              \{ .ENDNOTE_STRING_FONT B               \}
3732 .       if !d$EN_STRING_SIZE_CHANGE     \{ .ENDNOTE_STRING_SIZE +1              \}
3733 .       if !d$EN_TITLE_FT               \{ .ENDNOTE_TITLE_FONT  B               \}
3734 .       if !d$EN_TITLE_SIZE_CHANGE      \{ .ENDNOTE_TITLE_SIZE  0               \}
3735 .       if !d$EN_NUMBER_FT              \{ .ENDNOTE_NUMBER_FONT B               \}
3736 .       if !$EN_NUMBER_SIZE_CHANGE      \{ .ENDNOTE_NUMBER_SIZE 0               \}
3737 .       if !r#EN_PP_INDENT              \{ .ENDNOTE_PARA_INDENT 1.5m            \}
3738 .    \}
3739 .    TRAPS
3740 .    if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
3741 .END
3742 \#
3743 \# ====================================================================
3744 \#
3745 \# +++START THE DOCUMENT+++
3746 \#
3747 \# THE START MACRO
3748 \# ---------------
3749 \# *Arguments:
3750 \#   <none>
3751 \# *Function:
3752 \#   Reads in default document style parameters and any parameter
3753 \#   the user has changed before issuing START.
3754 \#   Using the information gathered in the opening macros,
3755 \#   prints appropriate title (or chapter #), subtitle, author
3756 \#   and document type (if appropriate).
3757 \# *Notes:
3758 \#   The .PRINT \& (zero-width character) is required to get the
3759 \#   subsequent .sp request to work as advertised.
3760 \#
3761 \#   The overall document line length, family, and point-size
3762 \#   are stored in #DOC_L_LENGTH, $DOC_FAM, and #DOC_PT_SIZE for
3763 \#   use in the HEADER and FOOTER macros.
3764 \#
3765 .MAC START END
3766 .    if !\\n[#PRINT_STYLE] \{\
3767 .       PRINTSTYLE TYPEWRITE
3768 .       PRINT \&
3769 .       po 6P
3770 .       ll 39P
3771 .       ta \\n(.lu
3772 .       sp |1i-1v
3773 .       CENTER
3774 .       PRINT "You neglected to enter a PRINTSTYLE"
3775 .       fl
3776 .       ab PRINTSTYLE missing
3777 .    \}
3778 .    nr #DOCS 1
3779 .    DEFAULTS
3780 .    if \\n[#COLLATE] \{\
3781 .       COPYSTYLE \\*[$COPY_STYLE]
3782 .       nr #HEADERS_ON \\n[#HEADER_STATE]
3783 .       if \\n[#PAGE_NUM_V_POS]=1 \{ .nr #PAGINATE \\n[#PAGINATION_STATE] \}
3784 .       sp |\\n[#HEADER_MARGIN]u
3785 .       PRINT \&
3786 .    \}
3787 \#
3788 .    if \\n[#PRINT_PAGENUM_ON_PAGE_1] \{\
3789 .       sp |\\n[#HEADER_MARGIN]u
3790 .       PRINT_PAGE_NUMBER
3791 .    \}
3792 .    rr #COLLATE
3793 .    rr #PAGINATION_STATE
3794 \#
3795 .    ie \\n[#DOC_HEADER]=0 \{\
3796 .       PRINT \&
3797 .       if \\n[#DOC_TYPE]=4 \{\
3798 .          if !'\\n(.z'' \{ .di \}
3799 .       \}
3800 .       ie r#ADVANCE_FROM_TOP \{ .sp |\\n[#ADVANCE_FROM_TOP]u-1v \}
3801 .       el \{ .sp |\\n[#T_MARGIN]u-1v \}
3802 .       PP
3803 .       nr #PP 0
3804 .       rr #DOC_HEADER
3805 .       if r#ADVANCE_FROM_TOP \{ .rr #ADVANCE_FROM_TOP \}
3806 .    \}
3807 .    el \{\
3808 .       nr #DOCHEADER_LINES 0 1
3809 .       if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u+\\n[#DOCHEADER_LEAD_ADJ]u \}
3810 .       nr #DOCHEADER_LEAD \\n[#LEAD]
3811 \# Default
3812 .       if \\n[#DOC_TYPE]=1 \{\
3813 .          PRINT \&
3814 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
3815 .          ev TITLE
3816 .          CENTER
3817 .          L_MARGIN \\n[#DOC_L_MARGIN]u
3818 .          LL       \\n[#DOC_L_LENGTH]u
3819 .          ta \\n(.lu
3820 .          if \\n[#PRINT_STYLE]=1 \{\
3821 .             fam C
3822 .             ft  R
3823 .             ps  12
3824 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
3825 .             el \{ .vs \\n[#DOC_LEAD]u \}
3826 .             CAPS
3827 .             if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
3828 .             CAPS OFF
3829 .          \}
3830 .          if \\n[#PRINT_STYLE]=2 \{\
3831 .             FAMILY  \\*[$TITLE_FAM]
3832 .             FT      \\*[$TITLE_FT]
3833 .             PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
3834 .             LS      \\n[#DOCHEADER_LEAD]u
3835 .             PRINT   \\*[$TITLE]
3836 .             \\n+[#DOCHEADER_LINES]
3837 .             CAPS OFF
3838 .          \}
3839 .          ev
3840 .          ev SUBTITLE
3841 .          CENTER
3842 .          L_MARGIN \\n[#DOC_L_MARGIN]u
3843 .          LL       \\n[#DOC_L_LENGTH]u
3844 .          ta \\n(.lu
3845 .          if !'\\*[$SUBTITLE]'' \{\
3846 .             if \\n[#PRINT_STYLE]=1 \{\
3847 .                fam C
3848 .                ft  R
3849 .                ps  12
3850 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
3851 .                el \{ .vs \\n[#DOC_LEAD]u \}
3852 .             \}
3853 .             if \\n[#PRINT_STYLE]=2 \{\
3854 .                FAMILY  \\*[$SUBTITLE_FAM]
3855 .                FT      \\*[$SUBTITLE_FT]
3856 .                PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
3857 .                LS      \\n[#DOCHEADER_LEAD]u
3858 .             \}
3859 .             PRINT \\*[$SUBTITLE]
3860 .             \\n+[#DOCHEADER_LINES]
3861 .          \}
3862 .          if '\\*[$SUBTITLE]'' \{\
3863 .             if \\n[#PRINT_STYLE]=1 \{\
3864 .                ALD \\n[#DOC_LEAD]u
3865 .             \}
3866 .          \}
3867 .          ev
3868 .          ev AUTHOR
3869 .          CENTER
3870 .          L_MARGIN \\n[#DOC_L_MARGIN]u
3871 .          LL       \\n[#DOC_L_LENGTH]u
3872 .          ta \\n(.lu
3873 .          if !'\\*[$AUTHOR_1]'' \{\
3874 .             if \\n[#PRINT_STYLE]=1 \{\
3875 .                fam C
3876 .                ft  R
3877 .                ps  12
3878 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
3879 .                el \{ .vs \\n[#DOC_LEAD]u/2u \}
3880 .                if !d$SUBTITLE \{\
3881 .                ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
3882 .                el \{ .ALD \\n[#DOC_LEAD]u*2u \}
3883 .                \}
3884 .             \}
3885 .             if \\n[#PRINT_STYLE]=2 \{\
3886 .                FAMILY  \\*[$AUTHOR_FAM]
3887 .                FT      \\*[$AUTHOR_FT]
3888 .                PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
3889 .                LS      \\n[#DOCHEADER_LEAD]u
3890 .             \}
3891 .             PRINT \\*[$ATTRIBUTE_STRING]
3892 .             \\n+[#DOCHEADER_LINES]
3893 .             nr #AUTHORS \\n[#AUTHOR_NUM]
3894 .             nr #NEXT_AUTHOR 0 1
3895 .             while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
3896 .                PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
3897 .                \\n+[#DOCHEADER_LINES]
3898 .             \}
3899 .             if \\n[#PRINT_STYLE]=1 \{\
3900 .                if \\n[#AUTHOR_LINES]=1 \{\
3901 .                    ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
3902 .                    el \{ .RLD \\n[#DOC_LEAD]u \}
3903 .                 \}
3904 .             \}
3905 .          \}
3906 .          ev
3907 .       \}
3908 \# Chapter
3909 .       if \\n[#DOC_TYPE]=2 \{\
3910 .          PRINT \&
3911 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
3912 .          ev TITLE
3913 .          L_MARGIN \\n[#DOC_L_MARGIN]u
3914 .          LL       \\n[#DOC_L_LENGTH]u
3915 .          ta \\n(.lu
3916 .          CENTER
3917 .          if \\n[#PRINT_STYLE]=1 \{\
3918 .             fam C
3919 .             ft  R
3920 .             ps  12
3921 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
3922 .             el \{ .vs \\n[#DOC_LEAD]u \}
3923 .          \}
3924 .          if \\n[#PRINT_STYLE]=2 \{\
3925 .             FAMILY  \\*[$TITLE_FAM]
3926 .             FT      \\*[$TITLE_FT]
3927 .             PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
3928 .             LS      \\n[#DOC_LEAD]u
3929 .          \}
3930 .          if \\n[#PRINT_STYLE]=1 \{\
3931 .             CAPS
3932 .             ie '\\*[$CHAPTER]'' \{ .PRINT \\*[$CHAPTER_STRING] \}
3933 .             el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3934 .             CAPS OFF
3935 .          \}
3936 .          if \\n[#PRINT_STYLE]=2 \{\
3937 .             ie '\\*[$CHAPTER]'' \{ .PRINT \\*[$CHAPTER_STRING] \}
3938 .             el \{ .PRINT \\*[$CHAPTER_STRING] \\*[$CHAPTER] \}
3939 .          \}
3940 .          ev
3941 .       \}
3942 \# Named
3943 .       if \\n[#DOC_TYPE]=3 \{\
3944 .          PRINT \&
3945 .          sp |\\n[#DOCHEADER_ADVANCE]u-1v
3946 .          ev TITLE
3947 .          CENTER
3948 .          L_MARGIN \\n[#DOC_L_MARGIN]u
3949 .          LL       \\n[#DOC_L_LENGTH]u
3950 .          ta \\n(.lu
3951 .          if \\n[#PRINT_STYLE]=1 \{\
3952 .             fam C
3953 .             ft  R
3954 .             ps  12
3955 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
3956 .             el \{ .vs \\n[#DOC_LEAD]u \}
3957 .             CAPS
3958 .             if !'\\*[$TITLE]'' \{ .UNDERSCORE "\\*[$TITLE]\}
3959 .             CAPS OFF
3960 .          \}
3961 .          if \\n[#PRINT_STYLE]=2 \{\
3962 .             FAMILY  \\*[$TITLE_FAM]
3963 .             FT      \\*[$TITLE_FT]
3964 .             PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$TITLE_SIZE_CHANGE]
3965 .             LS      \\n[#DOCHEADER_LEAD]u
3966 .             PRINT \\*[$TITLE]
3967 .             \\n+[#DOCHEADER_LINES]
3968 .             CAPS OFF
3969 .          \}
3970 .          ev
3971 .          ev SUBTITLE
3972 .          CENTER
3973 .          L_MARGIN \\n[#DOC_L_MARGIN]u
3974 .          LL       \\n[#DOC_L_LENGTH]u
3975 .          ta \\n(.lu
3976 .          if !'\\*[$SUBTITLE]'' \{\
3977 .             if \\n[#PRINT_STYLE]=1 \{\
3978 .                fam C
3979 .                ft  R
3980 .                ps  12
3981 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u*2u \}
3982 .                el \{ .vs \\n[#DOC_LEAD]u \}
3983 .             \}
3984 .             if \\n[#PRINT_STYLE]=2 \{\
3985 .                FAMILY  \\*[$SUBTITLE_FAM]
3986 .                FT      \\*[$SUBTITLE_FT]
3987 .                PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SUBTITLE_SIZE_CHANGE]
3988 .                LS      \\n[#DOCHEADER_LEAD]u
3989 .             \}
3990 .             PRINT \\*[$SUBTITLE]
3991 .             \\n+[#DOCHEADER_LINES]
3992 .          \}
3993 .          if '\\*[$SUBTITLE]'' \{\
3994 .             if \\n[#PRINT_STYLE]=1 \{\
3995 .                ALD \\n[#DOC_LEAD]u
3996 .             \}
3997 .          \}
3998 .          ev
3999 .          ev AUTHOR
4000 .          CENTER
4001 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4002 .          LL       \\n[#DOC_L_LENGTH]u
4003 .          ta \\n(.lu
4004 .          if !'\\*[$AUTHOR_1]'' \{\
4005 .             if \\n[#PRINT_STYLE]=1 \{\
4006 .                fam C
4007 .                ft  R
4008 .                ps  12
4009 .                ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4010 .                el \{ .vs \\n[#DOC_LEAD]u/2u \}
4011 .                if !d$SUBTITLE \{\
4012 .                ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4013 .                el \{ .ALD \\n[#DOC_LEAD]u*2u \}
4014 .                \}
4015 .             \}
4016 .             if \\n[#PRINT_STYLE]=2 \{\
4017 .                FAMILY  \\*[$AUTHOR_FAM]
4018 .                FT      \\*[$AUTHOR_FT]
4019 .                PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$AUTHOR_SIZE_CHANGE]
4020 .                LS      \\n[#DOCHEADER_LEAD]u
4021 .             \}
4022 .             PRINT \\*[$ATTRIBUTE_STRING]
4023 .             \\n+[#DOCHEADER_LINES]
4024 .             nr #AUTHORS \\n[#AUTHOR_NUM]
4025 .             nr #NEXT_AUTHOR 0 1
4026 .             while \\n[#AUTHORS]>\\n[#NEXT_AUTHOR] \{\
4027 .                PRINT \\*[$AUTHOR_\\n+[#NEXT_AUTHOR]]
4028 .                \\n+[#DOCHEADER_LINES]
4029 .             \}
4030 .             if \\n[#PRINT_STYLE]=1 \{\
4031 .                if \\n[#AUTHOR_LINES]=1 \{\
4032 .                    ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
4033 .                    el \{ .RLD \\n[#DOC_LEAD]u \}
4034 .                 \}
4035 .             \}
4036 .          \}
4037 .          ev
4038 .          ev DOCTYPE
4039 .          CENTER
4040 .          L_MARGIN \\n[#DOC_L_MARGIN]u
4041 .          LL       \\n[#DOC_L_LENGTH]u
4042 .          ta \\n(.lu
4043 .          if \\n[#PRINT_STYLE]=1 \{\
4044 .             fam C
4045 .             ft  R
4046 .             ps  12
4047 .             vs  \\n[#DOC_LEAD]u
4048 .             if '\\*[$AUTHOR_1]'' \{\
4049 .                ie !d$SUBTITLE \{\
4050 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4051 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4052 .             \}
4053 .                el \{\
4054 .                   ie \\n[#SINGLE_SPACE] \{ .RLD \\n[#DOC_LEAD]u*2u \}
4055 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
4056 .                \}
4057 .             \}
4058 .             ie \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
4059 .             el \{ .ALD \\n[#DOC_LEAD]u \}
4060 .             UNDERSCORE2 "\\*[$DOC_TYPE]
4061 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
4062 .          \}
4063 .          if \\n[#PRINT_STYLE]=2 \{\
4064 .             FAMILY  \\*[$DOCTYPE_FAM]
4065 .             FT      \\*[$DOCTYPE_FT]
4066 .             PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$DOCTYPE_SIZE_CHANGE]
4067 .             LS      \\n[#DOCHEADER_LEAD]u
4068 .             ALD \\n[#DOCHEADER_LEAD]u
4069 .             \\n+[#DOCHEADER_LINES]
4070 .             UNDERSCORE   "\\*[$DOC_TYPE]
4071 .             \\n+[#DOCHEADER_LINES]
4072 .          \}
4073 .          ev
4074 .       \}
4075 .       if !\\n[#DOC_TYPE]=4 \{\
4076 .          if \\n[#PRINT_STYLE]=2 \{\
4077 .             nr #DEPTH_1 \\n[#DOCHEADER_LINES]*\\n[#DOCHEADER_LEAD]
4078 .             nr #DEPTH_2 \\n[#DOCHEADER_LINES]*\\n[#DOC_LEAD]
4079 .             ie \\n[#DEPTH_1]<\\n[#DEPTH_2] \{\
4080 .                 nr #DOCHEADER_SPACE_ADJ \\n[#DEPTH_2]-\\n[#DEPTH_1]
4081 .             \}
4082 .             el \{\
4083 .                 nr #DOCHEADER_SPACE_ADJ \\n[#DEPTH_1]-\\n[#DEPTH_2]
4084 .             \}
4085 .             nr #DOCHEADER_EXTRA_SPACE \\n[#DOCHEADER_SPACE_ADJ] \\n[#DOC_LEAD]
4086 .             while \\n[#DOCHEADER_EXTRA_SPACE]>\\n[#DOC_LEAD] \{\
4087 .                \\n-[#DOCHEADER_EXTRA_SPACE]
4088 .             \}
4089 .             if \\n[#DOCHEADER_EXTRA_SPACE]>0 \{\
4090 .                ie \\n[#DOCHEADER_LEAD_ADJ]<0 \{\
4091 .                   ALD \\n[#DOCHEADER_EXTRA_SPACE]u
4092 .                \}
4093 .                el \{ .ALD \\n[#DOC_LEAD]u-\\n[#DOCHEADER_EXTRA_SPACE]u \}
4094 .             \}
4095 .          \}
4096 .          if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u    \}
4097 .          if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u*2u \}
4098 .          if \\n[#COLUMNS] \{\
4099 .             nr #COL_NUM 0 1
4100 .             nr #L_LENGTH_FOR_EPI \\n[#L_LENGTH]
4101 .             po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
4102 .             LL \\n[#COL_L_LENGTH]u
4103 .             ta \\n(.lu
4104 .             mk dc
4105 .          \}
4106 .       \}
4107 .    \}
4108 .    rr #DOCHEADER_LEAD
4109 .    rr #DOCHEADER_LEAD_ADJ
4110 .    rr #DEPTH_1
4111 .    rr #DEPTH_2
4112 .    rr #DOCHEADER_ADVANCE
4113 .    rr #ADVANCE_FROM_TOP
4114 .    rr #DOCHEADER_SPACE_ADJ
4115 .    rr #DOCHEADER_LINES
4116 .    rr #DOCHEADER_EXTRA_SPACE
4117 .    rr #AUTHORS
4118 .    rr #NEXT_AUTHOR
4119 .    rr #AUTHOR_NUM
4120 .    rr #NUM_AUTHORS
4121 .    nr #START 1
4122 .    nr #START_FOR_FOOTERS 1
4123 .END
4124 \#
4125 \# ====================================================================
4126 \#
4127 \# +++MACROS TO CHANGE SOME DEFAULTS+++
4128 \#
4129 \# DOCUMENT HEADER
4130 \# ---------------
4131 \# *Argument:
4132 \#   <none> | <anything> [distance to advance from top of page]
4133 \# *Function:
4134 \#   Turns printing of document header on or off.  If a second argument
4135 \#   in units of measure is given, advances that distance from the
4136 \#   top of the page without printing the document header.
4137 \# *Notes:
4138 \#   Default is on.  If the 1st argument is <anything> (which turns
4139 \#   document headers off), the optional 2nd argument may be given
4140 \#   (with a unit of measure).
4141 \#
4142 .MAC DOCHEADER END
4143 .    ie '\\$1'' \{ .nr #DOC_HEADER 1 \}
4144 .    el \{\
4145 .       if !'\\$2'' \{ .nr #ADVANCE_FROM_TOP (\\$2) \}
4146 .       nr #DOC_HEADER 0
4147 .    \}
4148 .END
4149 \#
4150 \#
4151 \# DOCUMENT HEADER LEADING
4152 \# -----------------------
4153 \# *Arguments:
4154 \#   <+|- amount by which to in/decrease leading of doc header>
4155 \# *Function:
4156 \#   Stores user supplied lead in/decrease in register #DOCHEADER_LEAD_ADJ.
4157 \# *Notes:
4158 \#   A unit of measure must be supplied.  Decimal fractions OK.
4159 \#   Default is +0, i.e. same as DOC_LEAD.
4160 \#
4161 .MAC DOCHEADER_LEAD END
4162 .    nr #DOCHEADER_LEAD_ADJ (\\$1)
4163 .END
4164 \#
4165 \#
4166 \# DOCHEADER ADVANCE
4167 \# -----------------
4168 \# *Arguments:
4169 \#   <docheader start position>
4170 \# *Function:
4171 \#   Creates register #DOCHEADER_ADVANCE, used in START.
4172 \# *Notes:
4173 \#   Unit of measure required.
4174 \#   Default is same as T_MARGIN.
4175 \#
4176 .MAC DOCHEADER_ADVANCE END
4177 .    nr #DOCHEADER_ADVANCE (\\$1)
4178 .END
4179 \#
4180 \#
4181 \# TITLE FAMILY
4182 \# ------------
4183 \# *Argument:
4184 \#   <family to use for the document header title>
4185 \# *Function:
4186 \#   Creates or modifies string $TITLE_FAM.
4187 \# *Notes:
4188 \#   Default is same as running text.
4189 \#
4190 .MAC TITLE_FAMILY END
4191 .    ds $TITLE_FAM \\$1
4192 .END
4193 \#
4194 \#
4195 \# TITLE FONT
4196 \# ----------
4197 \# *Argument:
4198 \#   <font to use for the document header title>
4199 \# *Function:
4200 \#   Creates or modifies string $TITLE_FT.
4201 \# *Notes:
4202 \#   Default is bold.
4203 \#
4204 .MAC TITLE_FONT END
4205 .    ds $TITLE_FT \\$1
4206 .END
4207 \#
4208 \#
4209 \# TITLE SIZE
4210 \# ----------
4211 \# *Argument:
4212 \#   <+|- number of points by which to in/decrease title at start
4213 \#   of the document (relative to running text)>
4214 \# *Function:
4215 \#   Creates string $TITLE_SIZE_CHANGE.
4216 \# *Notes:
4217 \#   Must be preceded by a +|- sign, with no space afterwards.
4218 \#   Fractional point sizes are allowed.
4219 \#   Default is +3.5 for printstyle TYPESET DEFAULT | STORY | NAMED;
4220 \#   4 for TYPESET CHAPTER; +0 for TYPEWRITE.
4221 \#
4222 .MAC TITLE_SIZE END
4223 .    ds $TITLE_SIZE_CHANGE \\$1
4224 .END
4225 \#
4226 \#
4227 \# SUBTITLE FAMILY
4228 \# ---------------
4229 \# *Argument:
4230 \#   <family to use for the document header title>
4231 \# *Function:
4232 \#   Creates or modifies string $SUBTITLE_FAM.
4233 \# *Notes:
4234 \#   Default is same as running text.
4235 \#
4236 .MAC SUBTITLE_FAMILY END
4237 .    ds $SUBTITLE_FAM \\$1
4238 .END
4239 \#
4240 \#
4241 \# SUBTITLE FONT
4242 \# -------------
4243 \# *Argument:
4244 \#   <font to use for the document header title>
4245 \# *Function:
4246 \#   Creates or modifies string $SUBTITLE_FT.
4247 \# *Notes:
4248 \#   Default is same as running text.
4249 \#
4250 .MAC SUBTITLE_FONT END
4251 .    ds $SUBTITLE_FT \\$1
4252 .END
4253 \#
4254 \#
4255 \# SUBTITLE SIZE
4256 \# -------------
4257 \# *Argument:
4258 \#   <+|- number of points by which to in/decrease subtitle at start
4259 \#   of the document (relative to running text)>
4260 \# *Function:
4261 \#   Creates or modifies string $SUBTITLE_SIZE_CHANGE.
4262 \# *Notes:
4263 \#   Must be preceded by a +|- sign with no space afterwards.
4264 \#   Fractional point sizes are allowed.
4265 \#   Default is +0.
4266 \#
4267 .MAC SUBTITLE_SIZE END
4268 .    ds $SUBTITLE_SIZE_CHANGE \\$1
4269 .END
4270 \#
4271 \#
4272 \# AUTHOR FAMILY
4273 \# -------------
4274 \# *Argument:
4275 \#   <family to use for author in document header>
4276 \# *Function:
4277 \#   Creates or modifies string $AUTHOR_FAM.
4278 \# *Notes:
4279 \#   Default is same as running text.
4280 \#
4281 .MAC AUTHOR_FAMILY END
4282 .    ds $AUTHOR_FAM \\$1
4283 .END
4284 \#
4285 \#
4286 \# AUTHOR FONT
4287 \# -----------
4288 \# *Argument:
4289 \#   <font to use for author in document header>
4290 \# *Function:
4291 \#   Creates or modifies string $AUTHOR_FT.
4292 \# *Notes:
4293 \#   Default is italic.
4294 \#
4295 .MAC AUTHOR_FONT END
4296 .    ds $AUTHOR_FT \\$1
4297 .END
4298 \#
4299 \#
4300 \# AUTHOR SIZE
4301 \# -----------
4302 \# *Argument:
4303 \#   <+|- number of points by which to in/decrease author at start
4304 \#   of the document>
4305 \# *Function:
4306 \#   Creates or modifies string $AUTHOR_SIZE_CHANGE.
4307 \# *Notes:
4308 \#   Must be preceded by a +|- sign with no space afterwards.
4309 \#   Fractional point sizes are allowed.
4310 \#   Default is same as running text.
4311 \#
4312 .MAC AUTHOR_SIZE END
4313 .    ds $AUTHOR_SIZE_CHANGE \\$1
4314 .END
4315 \#
4316 \#
4317 \# DOCTYPE FAMILY
4318 \# --------------
4319 \# *Argument:
4320 \#   <family to use for the document type string>
4321 \# *Function:
4322 \#   Creates or modifies string $DOCTYPE_FAM.
4323 \# *Notes:
4324 \#   Default is same as running text.
4325 \#
4326 .MAC DOCTYPE_FAMILY END
4327 .    ds $DOCTYPE_FAM \\$1
4328 .END
4329 \#
4330 \#
4331 \# DOCTYPE FONT
4332 \# ------------
4333 \# *Argument:
4334 \#   <font to use for the document type string>
4335 \# *Function:
4336 \#   Creates or modifies string $DOCTYPE_FT.
4337 \# *Notes:
4338 \#   Default is bold italic.
4339 \#
4340 .MAC DOCTYPE_FONT END
4341 .    ds $DOCTYPE_FT \\$1
4342 .END
4343 \#
4344 \#
4345 \# DOCTYPE SIZE
4346 \# -------------
4347 \# *Argument:
4348 \#   <+|- number of points by which to in/decrease the document
4349 \#   type string (relative to running text)>
4350 \# *Function:
4351 \#   Creates or modifies string $DOCTYPE_SIZE_CHANGE.
4352 \# *Notes:
4353 \#   Must be preceded by a +|- sign with no space afterwards.
4354 \#   Fractional point sizes are allowed.
4355 \#   Default is +3 for TYPESET; 0 for TYPEWRITE.
4356 \#
4357 .MAC DOCTYPE_SIZE END
4358 .    ds $DOCTYPE_SIZE_CHANGE \\$1
4359 .END
4360 \#
4361 \#
4362 \# DOCUMENT LEFT MARGIN
4363 \# --------------------
4364 \# *Argument:
4365 \#   <left margin of document>
4366 \# *Function:
4367 \#   Creates or modifies register #DOC_L_MARGIN.
4368 \# *Notes:
4369 \#   Affects EVERYTHING on the page.
4370 \#
4371 .MAC DOC_LEFT_MARGIN END
4372 .    br
4373 .    nr #DOC_L_MARGIN (\\$1)
4374 .    L_MARGIN \\n[#DOC_L_MARGIN]u
4375 .END
4376 \#
4377 \#
4378 \# DOCUMENT RIGHT MARGIN
4379 \# ---------------------
4380 \# *Argument:
4381 \#   <right margin of document>
4382 \# *Function:
4383 \#   Creates or modifies register #DOC_R_MARGIN.
4384 \# *Notes:
4385 \#   Affects EVERYTHING on the page.
4386 \#
4387 .MAC DOC_RIGHT_MARGIN END
4388 .    br
4389 .    nr #DOC_R_MARGIN (\\$1)
4390 .    R_MARGIN \\n[#DOC_R_MARGIN]
4391 .    nr #DOC_L_LENGTH \\n[#L_LENGTH]
4392 .END
4393 \#
4394 \#
4395 \# DOCUMENT LINE LENGTH
4396 \# --------------------
4397 \# *Argument:
4398 \#   <line length of document>
4399 \# *Function:
4400 \#   Creates or modifies string $DOC_L_LENGTH.
4401 \# *Notes:
4402 \#   Affects EVERYTHING on the page.
4403 \#
4404 .MAC DOC_LINE_LENGTH END
4405 .    br
4406 .    nr #DOC_L_LENGTH (\\$1)
4407 .    LL \\n[#DOC_L_LENGTH]u
4408 .    ta \\n(.lu
4409 .END
4410 \#
4411 \#
4412 \# DOCUMENT FAMILY
4413 \# ---------------
4414 \# *Argument:
4415 \#   <family of running text>
4416 \# *Function:
4417 \#   Creates or modifies string $DOC_FAM.
4418 \# *Notes:
4419 \#   Affects everything EXCEPT headers and footers.
4420 \#
4421 .MAC DOC_FAMILY END
4422 .    br
4423 .    ds $DOC_FAM \\$1
4424 .    FAMILY            \\*[$DOC_FAM]
4425 .    TITLE_FAMILY      \\*[$DOC_FAM]
4426 .    SUBTITLE_FAMILY   \\*[$DOC_FAM]
4427 .    AUTHOR_FAMILY     \\*[$DOC_FAM]
4428 .    DOCTYPE_FAMILY    \\*[$DOC_FAM]
4429 .    HEAD_FAMILY       \\*[$DOC_FAM]
4430 .    SUBHEAD_FAMILY    \\*[$DOC_FAM]
4431 .    QUOTE_FAMILY      \\*[$DOC_FAM]
4432 .    BLOCKQUOTE_FAMILY \\*[$DOC_FAM]
4433 .    EPIGRAPH_FAMILY   \\*[$DOC_FAM]
4434 .    HDRFTR_FAMILY     \\*[$DOC_FAM]
4435 .    PAGENUM_FAMILY    \\*[$DOC_FAM]
4436 .END
4437 \#
4438 \#
4439 \# DOCUMENT POINT SIZE
4440 \# -------------------
4441 \# *Argument:
4442 \#   <point size of running text>
4443 \# *Function:
4444 \#   Creates or modifies register $DOC_PT_SIZE.
4445 \# *Notes:
4446 \#   DOC_PT_SIZE is the basis for calculating all type sizes in
4447 \#   a document.
4448 \#
4449 .MAC DOC_PT_SIZE END
4450 .    if \\n[#IGNORE] \{ .return \}
4451 .    br
4452 .    PT_SIZE \\$1
4453 .    nr #DOC_PT_SIZE \\n[#PT_SIZE]
4454 .END
4455 \#
4456 \#
4457 \# DOCUMENT LEAD
4458 \# -------------
4459 \# *Argument:
4460 \#   <lead (".vs") of running text> [ADJUST]
4461 \# *Function:
4462 \#   Creates or modifies register #DOC_LEAD.  If the optional
4463 \#   ADJUST argument is given, adjusts leading so that the last
4464 \#   line of text falls exactly on #B_MARGIN.
4465 \# *Notes:
4466 \#   DOC_LEAD is the basis for calculating all leading changes in
4467 \#   a document.  Default for TYPESET is 16; 24 for TYPEWRITE.
4468 \#
4469 \#   Because the visible bottom or footer margin of a page depends
4470 \#   on the overall document lead supplied by the register #DOC_LEAD,
4471 \#   DOC_LEAD, in the body of a document, should always be associated
4472 \#   with the start of a new page (in other words, just before or
4473 \#   just after a manual NEWPAGE).
4474 \#
4475 .MAC DOC_LEAD END
4476 .    if \\n[#IGNORE] \{ .return \}
4477 .    br
4478 .    vs \\$1
4479 .    nr #DOC_LEAD \\n[#LEAD]
4480 .    if '\\$2'ADJUST' \{ .TRAPS \}
4481 .END
4482 \#
4483 \# ADJUST DOCUMENT LEAD
4484 \# --------------------
4485 \# *Arguments:
4486 \#   <none> | <anything>
4487 \# *Function:
4488 \#   Adjusts document lead so that the last line of text falls exactly
4489 \#   on #B_MARGIN.
4490 \#
4491 .MAC DOC_LEAD_ADJUST END
4492 .    ie '\\$1'' \{ .nr #ADJ_DOC_LEAD 1 \}
4493 .    el \{ .nr #ADJ_DOC_LEAD 0 \}
4494 .END
4495 \#
4496 \#
4497 \# DOCUMENT QUAD
4498 \# -------------
4499 \# *Arguments:
4500 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE | J | JUSTIFY
4501 \# *Function:
4502 \#   Creates or modifies string $DOC_QUAD.
4503 \# *Notes:
4504 \#   While QUAD (from the typesetting macros) can be used before START
4505 \#   to change  the default document quad, DOC_QUAD *must* be used after
4506 \#   the START macro has been invoked.
4507 \#
4508 \#   Default is LEFT for printstyle TYPEWRITE, JUSTIFY for printstyle
4509 \#   TYPESET.
4510 \#
4511 .MAC DOC_QUAD END
4512 .    ds $DOC_QUAD \\$1
4513 .    QUAD \\*[$DOC_QUAD]
4514 .END
4515 \#
4516 \# ====================================================================
4517 \#
4518 \# +++INTERNATIONALIZATION+++
4519 \#
4520 \# ATTRIBUTE STRING
4521 \# ----------------
4522 \# *Argument:
4523 \#   <what goes in the "by" slot before author in the document header>
4524 \# *Function:
4525 \#   Creates or modifies string $ATTRIBUTE_STRING.
4526 \# *Notes:
4527 \#   Default is "by".  A blank string ("") may be used if no
4528 \#   attribution is desired.
4529 \#
4530 .MAC ATTRIBUTE_STRING END
4531 .    ds $ATTRIBUTE_STRING \\$1
4532 .END
4533 \#
4534 \#
4535 \# CHAPTER STRING
4536 \# --------------
4537 \# *Argument:
4538 \#   <what to print any time the word "chapter" is required>
4539 \# *Function:
4540 \#   Creates or modifies string $CHAPTER_STRING.
4541 \# *Notes:
4542 \#   Default is "chapter".
4543 \#
4544 .MAC CHAPTER_STRING END
4545 .    ds $CHAPTER_STRING \\$1
4546 .END
4547 \#
4548 \#
4549 \# DRAFT STRING
4550 \# ------------
4551 \# *Argument:
4552 \#   <what to print any time the word "draft" is required>
4553 \# *Function:
4554 \#   Creates or modifies string $DRAFT_STRING.
4555 \# *Notes:
4556 \#   Default is "draft".
4557 \#
4558 .MAC DRAFT_STRING END
4559 .    ds $DRAFT_STRING \\$1
4560 .END
4561 \#
4562 \#
4563 \# REVISION STRING
4564 \# ---------------
4565 \# *Argument:
4566 \#   <what to print any time the word "revision" is required>
4567 \# *Function:
4568 \#   Creates or modifies string $REVISION_STRING.
4569 \# *Notes:
4570 \#   Default is "revision".
4571 \#
4572 .MAC REVISION_STRING END
4573 .    ds $REVISION_STRING \\$1
4574 .END
4575 \#
4576 \#
4577 \# FINIS STRING
4578 \# ------------
4579 \# *Argument:
4580 \#   <what to print with the finis macro>
4581 \# *Function:
4582 \#   Creates or modifies string $FINIS_STRING.
4583 \# *Notes:
4584 \#   Default is "END".
4585 \#
4586 .MAC FINIS_STRING END
4587 .    nr #FINIS 1
4588 .    CAPS
4589 .    ds $FINIS_STRING \\$1
4590 .    CAPS OFF
4591 .END
4592 \#
4593 \# ====================================================================
4594 \#
4595 \# +++RECTO/VERSO+++
4596 \#
4597 \# RECTO_VERSO
4598 \# -----------
4599 \# *Arguments:
4600 \#   <none> | <anything>
4601 \# *Function:
4602 \#   Switches HDRFTR_LEFT and HDRFTR_RIGHT on alternate pages.  Also
4603 \#   switches page numbers left and right if either is chosen rather
4604 \#   than the default centered page numbers.  Switches left and right
4605 \#   margins if differing values have been entered.
4606 \# *Notes:
4607 \#   Default is OFF.
4608 \#
4609 .MAC RECTO_VERSO END
4610 .    ie '\\$1'' \{ .nr #RECTO_VERSO 1 \}
4611 .    el \{ .nr #RECTO_VERSO 0 \}
4612 .END
4613 \#
4614 \# ====================================================================
4615 \#
4616 \# +++EPIGRAPHS+++
4617 \#
4618 \# EPIGRAPH FAMILY
4619 \# ---------------
4620 \# *Argument:
4621 \#   <family to use for epigraphs>
4622 \# *Function:
4623 \#   Creates or modifies string $EPI_FAM.
4624 \# *Notes:
4625 \#   Default is same as running text.
4626 \#
4627 .MAC EPIGRAPH_FAMILY END
4628 .    ds $EPI_FAM \\$1
4629 .END
4630 \#
4631 \#
4632 \# EPIGRAPH FONT
4633 \# -------------
4634 \# *Argument:
4635 \#   <font to use for epigraphs>
4636 \# *Function:
4637 \#   Creates or modifies string $EPI_FT.
4638 \# *Notes:
4639 \#   Default is same as running text.
4640 \#
4641 .MAC EPIGRAPH_FONT END
4642 .    ds $EPI_FT \\$1
4643 .END
4644 \#
4645 \#
4646 \# EPIGRAPH SIZE
4647 \# -------------
4648 \# *Argument:
4649 \#   <-|+ number of points by which to de/increase point size of epigraphs
4650 \#   (relative to running text)>
4651 \# *Function:
4652 \#   Creates or modifies string $EPI_SIZE_CHANGE.
4653 \# *Notes:
4654 \#   Must be preceded by a - or + sign with no space afterwards.
4655 \#   Fractional point sizes are allowed.  Default -1.5 for printstyle
4656 \#   TYPESET; +0 for TYPEWRITE.
4657 \#
4658 .MAC EPIGRAPH_SIZE END
4659 .    ds $EPI_SIZE_CHANGE \\$1
4660 .END
4661 \#
4662 \#
4663 \# EPIGRAPH QUAD
4664 \# -------------
4665 \# *Arguments:
4666 \#   L | LEFT | J | JUSTIFY
4667 \# *Function:
4668 \#   Creates or modifies string $EPI_QUAD.
4669 \# *Notes:
4670 \#   Default is $DOC_QUAD when BLOCK argument is passed to EPIGRAPH.
4671 \#
4672 .MAC EPIGRAPH_QUAD END
4673 .    ds $EPI_QUAD \\$1
4674 .END
4675 \#
4676 \#
4677 \# EPIGRAPH INDENT
4678 \# ---------------
4679 \# *Argument:
4680 \#   <value by which to multiply PP_INDENT for block epigraphs>
4681 \# *Function:
4682 \#   Creates or modifies register #EPI_OFFSET_VALUE.
4683 \# *Notes:
4684 \#   Default is 2 for TYPEWRITE, 3 for TYPESET.
4685 \#
4686 .MAC EPIGRAPH_INDENT END
4687 .    nr #EPI_OFFSET_VALUE \\$1
4688 .END
4689 \#
4690 \#
4691 \# EPIGRAPH AUTOLEAD
4692 \# -----------------
4693 \# *Argument:
4694 \#   <amount of lead to add to the epigraph ps for epigraph leading>
4695 \# *Function:
4696 \#   Creates or modifies register #EPI_AUTOLEAD.
4697 \# *Notes:
4698 \#   Default is 2 (for TYPESET; TYPEWRITE doesn't require this).
4699 \#
4700 .MAC EPIGRAPH_AUTOLEAD END
4701 .    nr #EPI_AUTOLEAD \\$1
4702 .END
4703 \#
4704 \#
4705 \# EPIGRAPH
4706 \# --------
4707 \# *Arguments:
4708 \#   BLOCK | <anything>
4709 \# *Function:
4710 \#   Places an epigraph before the document's text, after the
4711 \#   document header, or after a HEAD.
4712 \# *Notes:
4713 \#   #EPIGRAPH 1 = centered; 2 = block
4714 \#
4715 \#   By default, epigraphs are centered, allowing the user
4716 \#   to input them on a line per line basis.  To change this
4717 \#   behaviour, the user can supply the argument BLOCK, which
4718 \#   will produce indented, filled text similar to BLOCKQUOTE.
4719 \#
4720 \#   If a block epigraph contains more than one para, ALL paras of
4721 \#   the epigraph must be preceded by PP.  Otherwise, PP is optional.
4722 \#
4723 .MAC EPIGRAPH END
4724 .    nr #PP_STYLE 2
4725 .    nr #Q_PP     0
4726 .    if \\n[#START] \{\
4727 .       if \\n[#PRINT_STYLE]=1 \{\
4728 .          if \\n[#AUTHOR_LINES]=1 \{ .ALD \\n[#DOC_LEAD]u \}
4729 .       \}
4730 .    \}
4731 .    ie '\\$1'' \{\
4732 .       nr #EPIGRAPH 1
4733 .       ev EPIGRAPH
4734 .       ll \\n[#L_LENGTH]u
4735 .       ta \\n(.lu
4736 .       CHECK_INDENT
4737 .       if \\n[#COLUMNS] \{\
4738 .          ie \\n[#START] \{\
4739 .              ll \\n[#DOC_L_LENGTH]u
4740 .              ta \\n(.lu
4741 .          \}
4742 .          el \{\
4743 .             ll \\n[#COL_L_LENGTH]u
4744 .             ta \\n(.lu
4745 .          \}
4746 .       \}
4747 .       CENTER
4748 .       if \\n[#PRINT_STYLE]=1 \{\
4749 .          fam C
4750 .          ft  R
4751 .          if '\\*[$EPI_FT]'I' \{\
4752 .             FT I
4753 .          \}
4754 .          ps  12
4755 .          ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4756 .          el \{ .vs  \\n[#DOC_LEAD]u/2u \}
4757 .          nr #EPI_LEAD      \\n[#LEAD]
4758 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
4759 .       \}
4760 .       if \\n[#PRINT_STYLE]=2 \{\
4761 .          FAMILY   \\*[$EPI_FAM]
4762 .          FT       \\*[$EPI_FT]
4763 .          PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
4764 .          AUTOLEAD \\n[#EPI_AUTOLEAD]
4765 .          nr #EPI_LEAD      \\n[#LEAD]
4766 .          nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
4767 .       \}
4768 .       di EPI_TEXT
4769 .       nr #EPI_ACTIVE 1
4770 .    \}
4771 .    el \{\
4772 .       ie '\\$1'BLOCK' \{\
4773 .          nr #EPIGRAPH 2
4774 .          ev EPIGRAPH
4775 .          ie \\n[#START] \{\
4776 .             ie \\n[#COLUMNS] \{\
4777 .                ll \\n[#L_LENGTH_FOR_EPI]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
4778 .                ta \\n(.lu
4779 .             \}
4780 .             el \{\
4781 .                ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
4782 .                ta \\n(.lu
4783 .             \}
4784 .          \}
4785 .          el \{\
4786 .             ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
4787 .             ta \\n(.lu
4788 .             if \\n[#COLUMNS] \{\
4789 .                ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#EPI_OFFSET_VALUE]u*2u))
4790 .                ta \\n(.lu
4791 .             \}
4792 .             CHECK_INDENT
4793 .          \}
4794 .          if \\n[#PRINT_STYLE]=1 \{\
4795 .             fam C
4796 .             ft  R
4797 .             if '\\*[$EPI_FT]'I' \{\
4798 .                FT I
4799 .             \}
4800 .             ps  12
4801 .             ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
4802 .             el \{ .vs  \\n[#DOC_LEAD]u/2u \}
4803 .             QUAD LEFT
4804 .             HY OFF
4805 .             nr #EPI_LEAD \\n[#LEAD]
4806 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
4807 .             di EPI_TEXT
4808 .             nr #EPI_ACTIVE 1
4809 .          \}
4810 .          if \\n[#PRINT_STYLE]=2 \{\
4811 .             FAMILY   \\*[$EPI_FAM]
4812 .             FT       \\*[$EPI_FT]
4813 .             PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$EPI_SIZE_CHANGE]
4814 .             AUTOLEAD \\n[#EPI_AUTOLEAD]
4815 .             QUAD     \\*[$EPI_QUAD]
4816 .             HY
4817 .             nr #EPI_LEAD \\n[#LEAD]
4818 .             nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
4819 .             di EPI_TEXT
4820 .             nr #EPI_ACTIVE 1
4821 .          \}
4822 .       \}
4823 .       el \{\
4824 .          DO_EPIGRAPH
4825 .       \}
4826 .    \}
4827 .END
4828 \#
4829 \#
4830 \# DO EPIGRAPH
4831 \# -----------
4832 \# *Arguments:
4833 \#   <none>
4834 \# *Function:
4835 \#   Ends diversion started in EPIGRAPH.  Makes spacing
4836 \#   adjustments to compensate for the difference between epigraph
4837 \#   leading and overall document leading, so that the bottom of
4838 \#   the pages remain flush.
4839 \# *Notes:
4840 \#   In addition to its usual place at the beginning of a
4841 \#   document, EPIGRAPH may also be used after HEAD.
4842 \#
4843 .MAC DO_EPIGRAPH END
4844 .    br
4845 .    di
4846 .    REMOVE_INDENT
4847 .    ev
4848 .    nr #EPI_DEPTH \\n[#DIVER_DEPTH]-\\n[#EPI_LEAD]
4849 .    nr #EPI_LINES \\n[#EPI_DEPTH]/\\n[#EPI_LEAD]
4850 .    ie \\n[#START] \{\
4851 .       nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
4852 .       while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
4853 .       RLD \\n[#DOC_LEAD]u
4854 .       ie \\n[#PRINT_STYLE]=1 \{\
4855 .          if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
4856 .       \}
4857 .       el \{\
4858 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
4859 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
4860 .          \}
4861 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
4862 .             ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
4863 .          \}
4864 .       \}
4865 .    \}
4866 .    el \{\
4867 .       ie \\n[#EPI_DEPTH]<\\n[#TRAP_DISTANCE] \{\
4868 .          nr #EPI_FITS 1
4869 .          nr #EPI_WHITESPACE (\\n[#DOC_LEAD]*\\n[#EPI_LINES])-\\n[#EPI_DEPTH]
4870 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
4871 .          ie \\n[#PRINT_STYLE]=1 \{\
4872 .             if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u/2u \}
4873 .          \}
4874 .          el \{\
4875 .             if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
4876 .                ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)
4877 .             \}
4878 .             if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
4879 .                ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
4880 .             \}
4881 .          \}
4882 .       \}
4883 .       el \{\
4884 .          nr #EPI_LINES_TO_TRAP 0 1
4885 .          while \\n[#EPI_LEAD]*\\n+[#EPI_LINES_TO_TRAP]<\\n[#TRAP_DISTANCE] \{ .nr #LOOP 1 \}
4886 .          nr #EPI_LINES_TO_TRAP -1
4887 .          nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_TRAP]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_TRAP]*\\n[#EPI_LEAD])
4888 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
4889 .          if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
4890 .          if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u-\\n[#DOC_LEAD]u \}
4891 .      \}
4892 .    \}
4893 .    if \\n[#EPIGRAPH]=1 \{\
4894 .       po \\n[#L_MARGIN]u
4895 .       if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
4896 .    \}
4897 .    if \\n[#EPIGRAPH]=2 \{\
4898 .       nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
4899 .       if \\n[#COLUMNS] \{\
4900 .          nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
4901 .       \}
4902 .       po \\n[#EPI_OFFSET]u
4903 .    \}
4904 .    nf
4905 .    EPI_TEXT
4906 .    br
4907 .    ie \\n[#START] \{\
4908 .       if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
4909 .          ALD \\n[#EPI_WHITESPACE]u/2u
4910 .       \}
4911 .       if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
4912 .          ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
4913 .       \}
4914 .    \}
4915 .    el \{\
4916 .       rr #EPI_ACTIVE
4917 .       ie \\n[#EPI_FITS] \{\
4918 .          ie \\n[#FN_FOR_EPI] \{\
4919 .             nr #EPI_LINES_TO_END 1
4920 .             nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
4921 .             while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
4922 .             ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
4923 .          \}
4924 .          el \{\
4925 .             ie \\n[#PRINT_STYLE]=1 \{\
4926 .                if \\n[#EPI_WHITESPACE]=\\n[#DOC_LEAD] \{ .ALD \\n[#EPI_WHITESPACE]u \}
4927 .             \}
4928 .             el \{\
4929 .                if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
4930 .                   ALD \\n[#EPI_WHITESPACE]u/2u
4931 .                \}
4932 .                if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
4933 .                   ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
4934 .                \}
4935 .             \}
4936 .          \}
4937 .       \}
4938 .       el \{\
4939 .          nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
4940 .          if \\n[#LOOP] \{. nr #EPI_LINES_TO_END +1 \}
4941 .          rr #LOOP
4942 .          nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
4943 .          while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{ .nr #EPI_WHITESPACE -\\n[#DOC_LEAD] \}
4944 .          ALD \\n[#EPI_WHITESPACE]u-(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
4945 .          if \\n[#PRINT_STYLE]=1 \{\
4946 .             if !\\n[#SINGLE_SPACE] \{\
4947 .                nr #EPI_LINES_EVEN \\n[#EPI_LINES_TO_END]%2
4948 .                ie \\n[#EPI_LINES_EVEN] \{ .ALD .5v \}
4949 .                el \{ .RLD .5v \}
4950 .                rr #EPI_LINES_EVEN
4951 .             \}
4952 .          \}
4953 .       \}
4954 .    \}
4955 .    nr #PP_STYLE 1
4956 .    rr #EPI_FITS
4957 .    ALD \\n[#DOC_LEAD]u
4958 .    QUAD \\*[$DOC_QUAD]
4959 .    po \\n[#L_MARGIN]u
4960 .    if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
4961 .    if \\n[#START] \{\
4962 .       if \\n[#COLUMNS] \{\
4963 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
4964 .          mk dc
4965 .       \}
4966 .    \}
4967 .END
4968 \#
4969 \# ====================================================================
4970 \#
4971 \# +++FINIS MACRO+++
4972 \#
4973 \# FINIS
4974 \# -----
4975 \# *Arguments:
4976 \#   <none>
4977 \# *Function:
4978 \#   Deposits --END-- at the end of a document.
4979 \#
4980 .MAC FINIS END
4981 .    if \\n[#TAB_ACTIVE] \{ .TQ \}
4982 .    if \\n[#INDENT_ACTIVE] \{ .IQ CLEAR \}
4983 .    FOOTERS OFF
4984 .    PAGINATION OFF
4985 .    nr #EM_ADJUST (1m/8)
4986 .    if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
4987 .    ALD \\n[#DOC_LEAD]u
4988 .    CENTER
4989 .    if \\n[#PRINT_STYLE]=1 \{ .PRINT "--\\*[$FINIS_STRING]--\}
4990 .    if \\n[#PRINT_STYLE]=2 \{\
4991 .       PRINT "\v'-\\n[#EM_ADJUST]u'\(em\v'+\\n[#EM_ADJUST]u'\\*[$FINIS_STRING]\v'-\\n[#EM_ADJUST]u'\*[FU1]\(em
4992 .    \}
4993 .END
4994 \#
4995 \# ====================================================================
4996 \#
4997 \# +++HEADERS/FOOTERS+++
4998 \#
4999 \# Define a string so that the current page number can be incorporated
5000 \# into the strings for hdrftr left, right, and center.  NOTE: This is
5001 \# not the same thing as using the shortform # in hdrftr strings.
5002 \#
5003 .ds PAGE# \En[#PAGENUMBER]
5004 \#
5005 \#
5006 \# HDRFTR FAMILY
5007 \# -------------
5008 \# *Argument:
5009 \#   <family to use in header/footers>
5010 \# *Function:
5011 \#   Creates or modifies string $HDRFTR_FAM.
5012 \# *Notes:
5013 \#   Default is same as running text.
5014 \#
5015 .MAC HDRFTR_FAMILY END
5016 .    ds $HDRFTR_FAM \\$1
5017 .END
5018 \#
5019 \#
5020 \# HDRFTR SIZE
5021 \# -----------
5022 \# *Argument:
5023 \#   <+|-number of points by which to in/decrease point size of
5024 \#   header/footers (relative to running text)>
5025 \# *Function:
5026 \#   Creates or modifies string $HDRFTR_SIZE_CHANGE.
5027 \# *Notes:
5028 \#   Must be preceded by a +|- sign.  No space afterwards.
5029 \#   Fractional point sizes are allowed.  Default is +0.
5030 \#
5031 \#   By default, header/footers print the author .5 points smaller
5032 \#   than the base point size of running text, center titles
5033 \#   (Chapter, Draft, Revision, etc.)  .5 points smaller
5034 \#   than running text (in italics), and the document title 2 full
5035 \#   points smaller than running text (in caps).  The HDRFTR_SIZE
5036 \#   macro changes the overall size for all three parts while
5037 \#   maintaining the internal size changes.
5038 \#
5039 \#   In other words, if the user likes the header/footers but wants
5040 \#   them a bit bigger or a bit smaller, s/he should use HDRFTR_SIZE.
5041 \#
5042 .MAC HDRFTR_SIZE END
5043 .    ds $HDRFTR_SIZE_CHANGE \\$1
5044 .END
5045 \#
5046 \#
5047 \# HDRFTR RULE GAP
5048 \# ---------------
5049 \# *Argument:
5050 \#   <amount of space between header/footer and header/footer rule>
5051 \# *Function:
5052 \#   Creates or modifies register #HDRFTR_RULE_GAP to hold amount
5053 \#   of space between header/footer and header/footer rule.
5054 \# *Notes:
5055 \#   Default is 4p.
5056 \#
5057 .MAC HDRFTR_RULE_GAP END
5058 .    nr #HDRFTR_RULE_GAP (\\$1)
5059 .END
5060 \#
5061 \#
5062 \# HDRFTR LEFT
5063 \# -----------
5064 \# *Argument:
5065 \#   <what to put in the left position of page header/footers>
5066 \# *Function:
5067 \#   Creates or modifies string $HDRFTR_LEFT.
5068 \#   Creates register #USER_DEF_HDRFTR_LEFT, which, if 1,
5069 \#   overrides the $HDRFTR_LEFT string created by default
5070 \#   in DEFAULTS.
5071 \# *Notes:
5072 \#   Especially useful if doc has more than one author, and a list
5073 \#   of authors by last name is desired in header/footers.
5074 \#   Default is author.
5075 \#
5076 \#   If the argument is the # character, simply prints the current
5077 \#   page number.
5078 \#
5079 \#   If the user wants to *incorporate* the page number into the string,
5080 \#   \*[PAGE#] must be used.  For example, if the user wants to put
5081 \#   an elipsis before the page number in the string, s/he should use
5082 \#   ...\*[PAGE#], not ...#
5083 \#
5084 .MAC HDRFTR_LEFT END
5085 .    nr #USER_DEF_HDRFTR_LEFT 1
5086 .    ds $HDRFTR_LEFT \\$1
5087 .END
5088 \#
5089 \#
5090 \# HDRFTR LEFT FAMILY
5091 \# ------------------
5092 \# *Argument:
5093 \#   <family of header/footer left string>
5094 \# *Function:
5095 \#   Creates or modifies string $HDRFTR_LEFT_FAM.
5096 \#
5097 .MAC HDRFTR_LEFT_FAMILY END
5098 .    ds $HDRFTR_LEFT_FAM \\$1
5099 .END
5100 \#
5101 \#
5102 \# HDRFTR LEFT FONT
5103 \# ----------------
5104 \# *Argument:
5105 \#   <font of header/footer left string>
5106 \# *Function:
5107 \#   Creates or modifies string $HDRFTR_LEFT_FT.
5108 \#
5109 .MAC HDRFTR_LEFT_FONT END
5110 .    ds $HDRFTR_LEFT_FT \\$1
5111 .END
5112 \#
5113 \#
5114 \# HDRFTR LEFT SIZE
5115 \# ----------------
5116 \# *Argument:
5117 \#   <+|- number of points to in/decrease size of left string in
5118 \#   header/footers (relative to running text)>
5119 \# *Function:
5120 \#   Creates or modifies string HDRFTR_LEFT_SIZE_CHANGE.
5121 \# *Notes:
5122 \#   Must be preceded by a +|- sign.  No space afterwards.
5123 \#   Fractional point sizes are allowed.
5124 \#   Default is -.5 for printstyle TYPESET; if all caps, -2
5125 \#   Has no effect in TYPEWRITE.
5126 \#
5127 .MAC HDRFTR_LEFT_SIZE END
5128 .    ds $HDRFTR_LEFT_SIZE_CHANGE \\$1
5129 .END
5130 \#
5131 \#
5132 \# HDRFTR LEFT CAPS
5133 \# ----------------
5134 \# *Argument:
5135 \#   <none> | <anything>
5136 \# *Function:
5137 \#   Turns capitalisation of $HDRFTR_LEFT (typically, the author of
5138 \#   the document) on or off.
5139 \# *Notes:
5140 \#   Default is on.
5141 \#
5142 .MAC HDRFTR_LEFT_CAPS END
5143 .    ie '\\$1'' \{\
5144 .        nr #HDRFTR_LEFT_CAPS 1
5145 .    \}
5146 .    el \{\
5147 .       nr #HDRFTR_LEFT_CAPS 0
5148 .       ds $HDRFTR_RIGHT_SIZE_CHANGE +0
5149 .    \}
5150 .END
5151 \#
5152 \#
5153 \# HDRFTR CENTER
5154 \# -------------
5155 \# *Argument:
5156 \#   <what to put in the centre position of page header/footers>
5157 \# *Function:
5158 \#   Creates or modifies string $HDRFTR_CENTER.
5159 \#   Creates register #USER_DEF_HDRFTR_CENTER, which, if 1,
5160 \#   overrides the $HDRFTR_CENTER string created by default
5161 \#   in COPYSTYLE.
5162 \# *Notes:
5163 \#   Default is document type if DOCTYPE NAMED, Chapter # if DOCTYPE
5164 \#   CHAPTER, draft and revision number if COPYSTYLE DRAFT.
5165 \#
5166 \#   If the argument is the # character, simply prints the current
5167 \#   page number.
5168 \#
5169 \#   If the user wants to *incorporate* the page number into the string,
5170 \#   \*[PAGE#] must be used.  For example, if the user wants to put
5171 \#   an elipsis before the page number in the string, s/he should use
5172 \#   ...\*[PAGE#], not ...#
5173 \#
5174 .MAC HDRFTR_CENTER END
5175 .    nr #USER_DEF_HDRFTR_CENTER 1
5176 .    ds $HDRFTR_CENTER \\$1
5177 .END
5178 \#
5179 \#
5180 \# HDRFTR CENTER FAMILY
5181 \# --------------------
5182 \# *Argument:
5183 \#   <family of header/footer center string>
5184 \# *Function:
5185 \#   Creates or modifies string $HDRFTR_CENTER_FAM.
5186 \#
5187 .MAC HDRFTR_CENTER_FAMILY END
5188 .    ds $HDRFTR_CENTER_FAM \\$1
5189 .END
5190 \#
5191 \#
5192 \# HDRFTR CENTER FONT
5193 \# ------------------
5194 \# *Argument:
5195 \#   <font of header/footer center string>
5196 \# *Function:
5197 \#   Creates or modifies string $HDRFTR_CENTER_FT.
5198 \#
5199 .MAC HDRFTR_CENTER_FONT END
5200 .    ds $HDRFTR_CENTER_FT \\$1
5201 .END
5202 \#
5203 \#
5204 \# HDRFTR CENTER SIZE
5205 \# ------------------
5206 \# *Argument:
5207 \#   <+|- number of points to in/decrease size of centre string in
5208 \#   header/footers (relative to header/footer size)>
5209 \# *Function:
5210 \#   Creates string HDRFTR_CENTER_SIZE_CHANGE.
5211 \# *Notes:
5212 \#   Must be preceded by a +|- sign.  No space afterwards.
5213 \#   Fractional point sizes are allowed.
5214 \#   Default is -.5 for printstyle TYPESET; if all caps, -2
5215 \#   Has no effect in TYPEWRITE.
5216 \#
5217 .MAC HDRFTR_CENTER_SIZE END
5218 .    ds $HDRFTR_CENTER_SIZE_CHANGE \\$1
5219 .END
5220 \#
5221 \#
5222 \# HDRFTR CENTER CAPS
5223 \# ------------------
5224 \# *Argument:
5225 \#   <none> | <anything>
5226 \# *Function:
5227 \#   Turns capitalisation of $HDRFTR_CENTER (typically, doctype of
5228 \#   the document) on or off.
5229 \# *Notes:
5230 \#   Default is on.
5231 \#
5232 .MAC HDRFTR_CENTER_CAPS END
5233 .    ie '\\$1'' \{\
5234 .        nr #HDRFTR_CENTER_CAPS 1
5235 .    \}
5236 .    el \{\
5237 .       nr #HDRFTR_CENTER_CAPS 0
5238 .       ds $HDRFTR_CENTER_SIZE_CHANGE +0
5239 .    \}
5240 .END
5241 \#
5242 \#
5243 \# HDRFTR RIGHT
5244 \# ------------
5245 \# *Argument:
5246 \#   <what to put in the right position of page header/footers>
5247 \# *Function:
5248 \#   Creates or modifies string $HDRFTR_RIGHT.
5249 \#   Creates register #USER_DEF_HDRFTR_RIGHT, which, if 1,
5250 \#   overrides the $HDRFTR_RIGHT string created by default
5251 \#   in DEFAULTS.
5252 \# *Notes:
5253 \#   Default is document title.
5254 \#
5255 \#   If the argument is the # character, simply prints the current
5256 \#   page number.
5257 \#
5258 \#   If the user wants to *incorporate* the page number into the string,
5259 \#   \*[PAGE#] must be used.  For example, if the user wants to put
5260 \#   an elipsis before the page number in the string, s/he should use
5261 \#   ...\*[PAGE#], not ...#
5262 \#
5263 .MAC HDRFTR_RIGHT END
5264 .    nr #USER_DEF_HDRFTR_RIGHT 1
5265 .    ds $HDRFTR_RIGHT \\$1
5266 .END
5267 \#
5268 \#
5269 \# HDRFTR RIGHT FAMILY
5270 \# -------------------
5271 \# *Argument:
5272 \#   <family of header/footer right string>
5273 \# *Function:
5274 \#   Creates or modifies string $HDRFTR_RIGHT_FAM.
5275 \#
5276 .MAC HDRFTR_RIGHT_FAMILY END
5277 .    ds $HDRFTR_RIGHT_FAM \\$1
5278 .END
5279 \#
5280 \#
5281 \# HDRFTR RIGHT FONT
5282 \# -----------------
5283 \# *Argument:
5284 \#   <font of header/footer right string>
5285 \# *Function:
5286 \#   Creates or modifies string $HDRFTR_RIGHT_FT.
5287 \#
5288 .MAC HDRFTR_RIGHT_FONT END
5289 .    ds $HDRFTR_RIGHT_FT \\$1
5290 .END
5291 \#
5292 \#
5293 \# HDRFTR RIGHT SIZE
5294 \# -----------------
5295 \# *Argument:
5296 \#   <+|- number of points to in/decrease size of right string in
5297 \#   header/footers (relative to header/footer size)>
5298 \# *Function:
5299 \#   Creates or modifies string HDRFTR_RIGHT_SIZE_CHANGE.
5300 \# *Notes:
5301 \#   Must be preceded by a +|- sign.  No space afterwards.
5302 \#   Fractional point sizes are allowed.
5303 \#   Default is -2 for printstyle TYPESET if all caps; otherwise -.5
5304 \#   Has no effect in TYPEWRITE.
5305 \#
5306 .MAC HDRFTR_RIGHT_SIZE END
5307 .    ds $HDRFTR_RIGHT_SIZE_CHANGE \\$1
5308 .END
5309 \#
5310 \#
5311 \# HDRFTR RIGHT CAPS
5312 \# -----------------
5313 \# *Argument:
5314 \#   <none> | <anything>
5315 \# *Function:
5316 \#   Turns capitalisation of $HDRFTR_RIGHT (typically, the title of
5317 \#   the document) on or off.
5318 \# *Notes:
5319 \#   Default is on.
5320 \#
5321 .MAC HDRFTR_RIGHT_CAPS END
5322 .    ie '\\$1'' \{\
5323 .        nr #HDRFTR_RIGHT_CAPS 1
5324 .    \}
5325 .    el \{\
5326 .       nr #HDRFTR_RIGHT_CAPS 0
5327 .       ds $HDRFTR_RIGHT_SIZE_CHANGE +0
5328 .    \}
5329 .END
5330 \#
5331 \# HDRFTR RULE
5332 \# -----------
5333 \# *Arguments:
5334 \#   <none> | <anything>
5335 \# *Function:
5336 \#   If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
5337 \#   under the header/footer.  Otherwise, turns HDRFTR_RULE on or off.
5338 \#
5339 .MAC HDRFTR_RULE END   \"To print rule under header/over footer.
5340 .    ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
5341 .       ie \\n[#USERDEF_HDRFTR] \{\
5342 .          nr #CAP_HEIGHT_ADJUST \\n[#HDRFTR_HEIGHT]
5343 .          PT_SIZE 12
5344 .          if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
5345 .          if \\n[#FOOTERS_ON] \{\
5346 .              RLD \\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
5347 .          \}
5348 .          PRINT \\l'\\n[#DOC_L_LENGTH]u'
5349 .          br
5350 .       \}
5351 .       el \{\
5352 .          if \\n[#PRINT_STYLE]=1 \{\
5353 .             nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT]
5354 .          \}
5355 .          if \\n[#PRINT_STYLE]=2 \{\
5356 .             ie \\n[#LEFT_CAP_HEIGHT]>\\n[#CENTER_CAP_HEIGHT] \{\
5357 .                nr #CAP_HEIGHT_ADJUST \\n[#LEFT_CAP_HEIGHT]
5358 .             \}
5359 .             el \{ .nr #CAP_HEIGHT_ADJUST \\n[#CENTER_CAP_HEIGHT] \}
5360 .             ie \\n[#CAP_HEIGHT_ADJUST]>\\n[#RIGHT_CAP_HEIGHT] \{\
5361 .                nr #CAP_HEIGHT_ADJUST \\n[#CAP_HEIGHT_ADJUST]
5362 .             \}
5363 .             el \{ .nr #CAP_HEIGHT_ADJUST \\n[#RIGHT_CAP_HEIGHT] \}
5364 .          \}
5365 .          PT_SIZE 12
5366 .          if \\n[#HEADERS_ON] \{ .ALD \\n[#HDRFTR_RULE_GAP]u \}
5367 .          if \\n[#FOOTERS_ON] \{\
5368 .              RLD \\n[#LEAD]u*3u+\\n[#HDRFTR_RULE_GAP]u+\\n[#CAP_HEIGHT_ADJUST]u+1p
5369 .          \}
5370 .          PRINT \\l'\\n[#DOC_L_LENGTH]u'
5371 .          br
5372 .       \}
5373 .    \}
5374 .    el \{\
5375 .       ie '\\$1'' \{ .nr #HDRFTR_RULE 1 \}
5376 .       el \{ .nr #HDRFTR_RULE 0 \}
5377 .    \}
5378 .END
5379 \#
5380 \#
5381 .ALIAS HDRFTR_RULE_INTERNAL HDRFTR_RULE
5382 \#
5383 \#
5384 \# HDRFTR PLAIN
5385 \# ------------
5386 \# *Arguments:
5387 \#   <none>
5388 \# *Function:
5389 \#   Sets the family, font, and point size of all strings in
5390 \#   header/footers to the same family and point size as running
5391 \#   text.  Font for the header/footer becomes roman throughout.
5392 \#
5393 .MAC HDRFTR_PLAIN END
5394 .    HDRFTR_FAMILY        \\*[$DOC_FAM]
5395 .    HDRFTR_PT_SIZE       \\n[#DOC_PT_SIZE]
5396 .    HDRFTR_LEFT_FAMILY   \\*[$DOC_FAM]
5397 .    HDRFTR_LEFT_FONT     R
5398 .    HDRFTR_LEFT_SIZE     +0
5399 .    HDRFTR_LEFT_CAPS     OFF
5400 .    HDRFTR_CENTER_FAMILY \\*[$DOC_FAM]
5401 .    HDRFTR_CENTER_FONT   R
5402 .    HDRFTR_CENTER_SIZE   +0
5403 .    HDRFTR_CENTER_CAPS   OFF
5404 .    HDRFTR_RIGHT_FAMILY  \\*[$DOC_FAM]
5405 .    HDRFTR_RIGHT_FONT    R
5406 .    HDRFTR_RIGHT_SIZE    +0
5407 .    HDRFTR_RIGHT_CAPS    OFF
5408 .END
5409 \#
5410 \#
5411 \# SWITCH HDRFTR
5412 \# -------------
5413 \# *Arguments:
5414 \#   <none> | <anything>
5415 \# *Function:
5416 \#   Creates or modifies register #SWITCH_HDRFTR, used to switch
5417 \#   default location of HDRFTR_LEFT and HDRFTR_RIGHT.
5418 \# *Notes:
5419 \#   Typically, the author string appears at the left of header/footers,
5420 \#   and the title string appears at the right.  This switches the
5421 \#   location of the two.  Useful in conjuction with RECTO_VERSO to
5422 \#   tweak switches on alternate pages to come out as the user wishes.
5423 \#   The assumption of RECTO_VERSO is that the first page of the document
5424 \#   (recto) is odd, and even though it has no header/footer, if it did have one,
5425 \#   it would print as AUTHOR...CENTER...TITLE (or whatever strings
5426 \#   the user has supplied for HDRFTR_LEFT/RIGHT), meaning that the
5427 \#   next page, which does have a header/footer, will come out as
5428 \#   TITLE...CENTER...AUTHOR (or whatever strings the user has
5429 \#   supplied for HDRFTR_LEFT/RIGHT).  SWITCH_HDRFTRS allows the user
5430 \#   to get the desired string in the desired place on the desired
5431 \#   recto/verso page.
5432 \#
5433 \#   Default is OFF.
5434 \#
5435 .MAC SWITCH_HDRFTR END
5436 .    ie '\\$1'' \{ .nr #SWITCH_HDRFTR 1 \}
5437 .    el \{ .nr #SWITCH_HDRFTR 0 \}
5438 .END
5439 \#
5440 \#
5441 \# USER DEFINED HDRFTR RECTO
5442 \# -------------------------
5443 \# *Arguments:
5444 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_recto_string>
5445 \# *Function:
5446 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_RECTO_QUAD,
5447 \#   stores string in $USERDEF_HDRFTR_RECTO.
5448 \# *Notes:
5449 \#   For use when users don't want 3-part headers/footers, but rather
5450 \#   want to design their own headers/footers and need different
5451 \#   headers/footers on recto and verso pages.
5452 \#
5453 .MAC HDRFTR_RECTO END
5454 .    nr #USERDEF_HDRFTR 1
5455 .    if '\\$1'L'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
5456 .    if '\\$1'LEFT'   \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 1 \}
5457 .    if '\\$1'C'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5458 .    if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5459 .    if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 2 \}
5460 .    if '\\$1'R'      \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
5461 .    if '\\$1'RIGHT'  \{ .nr #USERDEF_HDRFTR_RECTO_QUAD 3 \}
5462 .    ds $USERDEF_HDRFTR_RECTO \\$2
5463 .END
5464 \#
5465 \#
5466 \# USER DEFINED HDRFTR VERSO
5467 \# -------------------------
5468 \# *Arguments:
5469 \#   L | LEFT | C | CENTER | CENTER | R | RIGHT <hdrftr_verso_string>
5470 \# *Function:
5471 \#   Toggles #USERDEF_HDRFTR on, stores quad as #USERDEF_HDRFTR_VERSO_QUAD,
5472 \#   stores string in $USERDEF_HDRFTR_VERSO.
5473 \# *Notes:
5474 \#   For use when users don't want 3-part headers/footers, but rather
5475 \#   want to design their own headers/footers and need different
5476 \#   headers/footers on recto and verso pages.
5477 \#
5478 .MAC HDRFTR_VERSO END
5479 .    nr #USERDEF_HDRFTR 1
5480 .    if '\\$1'L'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
5481 .    if '\\$1'LEFT'   \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 1 \}
5482 .    if '\\$1'C'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5483 .    if '\\$1'CENTER' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5484 .    if '\\$1'CENTRE' \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 2 \}
5485 .    if '\\$1'R'      \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
5486 .    if '\\$1'RIGHT'  \{ .nr #USERDEF_HDRFTR_VERSO_QUAD 3 \}
5487 .    ds $USERDEF_HDRFTR_VERSO \\$2
5488 .END
5489 \#
5490 \#
5491 \# PRINT FOOTER ON FIRST PAGE
5492 \# --------------------------
5493 \# *Arguments:
5494 \#   <none> | <anything>
5495 \# *Function:
5496 \#   Toggles register #PRINT_FOOTER_ON_PAGE_1
5497 \# *Notes:
5498 \#   Lets user choose whether to print footer on first
5499 \#   page of doc.
5500 \#
5501 .MAC FOOTER_ON_FIRST_PAGE END
5502 .    ie '\\$1'' \{ .nr #PRINT_FOOTER_ON_PAGE_1 1 \}
5503 .    el \{ .rr #PRINT_FOOTER_ON_PAGE_1 \}
5504 .END
5505 \#
5506 \#
5507 \# PRINT PAGE NUMBER ON FIRST PAGE
5508 \# -------------------------------
5509 \# *Arguments:
5510 \#   <none> | <anything>
5511 \# *Function:
5512 \#   Toggles register #PRINT_PAGENUM_ON_PAGE_1
5513 \# *Notes:
5514 \#   Lets user choose whether to print page number on first
5515 \#   page of doc and after collate when footers are on or page numbering
5516 \#   has been user set at top of page.
5517 \#
5518 .MAC PAGENUM_ON_FIRST_PAGE END
5519 .    ie '\\$1'' \{ .nr #PRINT_PAGENUM_ON_PAGE_1 1 \}
5520 .    el \{ .rr #PRINT_PAGENUM_ON_PAGE_1 \}
5521 .END
5522 \#
5523 \#
5524 \# PRINT HEADER/FOOTER
5525 \# -------------------
5526 \# *Arguments:
5527 \#   <none>
5528 \# *Function:
5529 \#   Based on defaults or values entered by user, prints a
5530 \#   three-part title at either the top or the bottom of the page.
5531 \# *Notes:
5532 \#   Called from within either HEADER or FOOTER.
5533 \#
5534 .MAC PRINT_HDRFTR END
5535 .    if \\n[#DOC_TYPE]=4 \{\
5536 .       nr #SUITE \En[.pn]
5537 .    \}
5538 .    if \\n[#FOOTERS_ON] \{\
5539 .       if \\n[#START_FOR_FOOTERS] \{\
5540 .          rr #START_FOR_FOOTERS
5541 .          if !\\n[#PRINT_FOOTER_ON_PAGE_1] \{ .return \}
5542 .       \}
5543 .    \}
5544 .    if \\n[#HEADERS_ON] \{ .vs 0 \}
5545 .    if \\n[#USERDEF_HDRFTR] \{\
5546 .       PRINT_USERDEF_HDRFTR
5547 .       return
5548 .    \}
5549 .    if \\n[#SWITCH_HDRFTR] \{\
5550 .       ds $HDRFTR_TMP_SWITCH             \\*[$HDRFTR_LEFT]
5551 .       ds $HDRFTR_LEFT                   \\*[$HDRFTR_RIGHT]
5552 .       ds $HDRFTR_RIGHT                  \\*[$HDRFTR_TMP_SWITCH]
5553 .       ds $HDRFTR_TMP_SIZE_CHANGE_SWITCH \\*[$HDRFTR_LEFT_SIZE_CHANGE]
5554 .       ds $HDRFTR_LEFT_SIZE_CHANGE       \\*[$HDRFTR_RIGHT_SIZE_CHANGE]
5555 .       ds $HDRFTR_RIGHT_SIZE_CHANGE      \\*[$HDRFTR_TMP_SIZE_CHANGE_SWITCH]
5556 .       nr #HDRFTR_TMP_CAPS_SWITCH        \\n[#HDRFTR_LEFT_CAPS]
5557 .       nr #HDRFTR_LEFT_CAPS              \\n[#HDRFTR_RIGHT_CAPS]
5558 .       nr #HDRFTR_RIGHT_CAPS             \\n[#HDRFTR_TMP_CAPS_SWITCH]
5559 .       rr #HDRFTR_TMP_CAPS_SWITCH
5560 .       rm $HDRFTR_TMP_SWITCH
5561 .       rm $HDRFTR_TMP_SIZE_CHANGE_SWITCH
5562 .       nr #SWITCH_HDRFTR 0
5563 .    \}
5564 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
5565 .    if \\n[#PRINT_STYLE]=1 \{\
5566 .       if \\n[#FOOTERS_ON] \{\
5567 .          di NULL
5568 .          SIZESPECS
5569 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
5570 .          di
5571 .       \}
5572 .       if o                        \{ .RIGHT \}
5573 .       if e                        \{ .LEFT  \}
5574 .       if \\n[#RECTO_VERSO]=0      \{ .LEFT  \}
5575 .       if \\n[#HDRFTR_LEFT_CAPS]   \{ .CAPS  \}
5576 .       ie '\\*[$HDRFTR_LEFT]'#' \{\
5577 .           PRINT \\n[#PAGENUMBER]
5578 .       \}
5579 .       el \{\
5580 .          ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
5581 .          el \{ .PRINT \& \}
5582 .       \}
5583 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
5584 .       CENTER
5585 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
5586 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
5587 .           PRINT \\v'-(\\n[#LEAD]u*1u)'\\n[#PAGENUMBER]
5588 .       \}
5589 .       el \{\
5590 .          ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\*[$HDRFTR_CENTER] \}
5591 .          el \{ .PRINT \& \}
5592 .       \}
5593 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
5594 .       if o                       \{ .LEFT  \}
5595 .       if e                       \{ .RIGHT \}
5596 .       if \\n[#RECTO_VERSO]=0     \{ .RIGHT \}
5597 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS  \}
5598 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
5599 .           PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
5600 .       \}
5601 .       el \{\
5602 .          ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
5603 .          el \{ .PRINT \& \}
5604 .       \}
5605 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
5606 .    \}
5607 .    if \\n[#PRINT_STYLE]=2 \{\
5608 .       FAMILY  \\*[$HDRFTR_LEFT_FAM]
5609 .       FT      \\*[$HDRFTR_LEFT_FT]
5610 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_LEFT_SIZE_CHANGE]
5611 .       if \\n[#FOOTERS_ON] \{\
5612 .          di NULL
5613 .          SIZESPECS
5614 .          nr #LEFT_CAP_HEIGHT \\n[#CAP_HEIGHT]
5615 .          di
5616 .       \}
5617 .       if o                      \{ .LEFT  \}
5618 .       if e                      \{ .RIGHT \}
5619 .       if \\n[#RECTO_VERSO]=0    \{ .LEFT  \}
5620 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS  \}
5621 .       ie '\\*[$HDRFTR_LEFT]'#' \{ .PRINT \\n[#PAGENUMBER] \}
5622 .       el \{\
5623 .          ie !'\\*[$HDRFTR_LEFT]'' \{ . PRINT \\*[$HDRFTR_LEFT] \}
5624 .          el \{ .PRINT \& \}
5625 .       \}
5626 .       if \\n[#HDRFTR_LEFT_CAPS] \{ .CAPS OFF \}
5627 .       FAMILY  \\*[$HDRFTR_CENTER_FAM]
5628 .       FT      \\*[$HDRFTR_CENTER_FT]
5629 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_CENTER_SIZE_CHANGE]
5630 .       if \\n[#FOOTERS_ON] \{\
5631 .          di NULL
5632 .          SIZESPECS
5633 .          nr #CENTER_CAP_HEIGHT \\n[#CAP_HEIGHT]
5634 .          di
5635 .       \}
5636 .       CENTER
5637 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS \}
5638 .       ie '\\*[$HDRFTR_CENTER]'#' \{\
5639 .           PRINT \\v'-(\\n[#LEAD]u*1u)'\\n[#PAGENUMBER]
5640 .       \}
5641 .       el \{\
5642 .          ie !'\\*[$HDRFTR_CENTER]'' \{ .PRINT \\v'-(\\n[#LEAD]u*1u)'\\*[$HDRFTR_CENTER] \}
5643 .          el \{ .PRINT \& \}
5644 .       \}
5645 .       if \\n[#HDRFTR_CENTER_CAPS] \{ .CAPS OFF \}
5646 .       FAMILY  \\*[$HDRFTR_RIGHT_FAM]
5647 .       FT      \\*[$HDRFTR_RIGHT_FT]
5648 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u\\*[$HDRFTR_RIGHT_SIZE_CHANGE]
5649 .       if \\n[#FOOTERS_ON] \{\
5650 .          di NULL
5651 .          SIZESPECS
5652 .          nr #RIGHT_CAP_HEIGHT \\n[#CAP_HEIGHT]
5653 .          di
5654 .       \}
5655 .       if o                       \{ .RIGHT \}
5656 .       if e                       \{ .LEFT  \}
5657 .       if \\n[#RECTO_VERSO]=0     \{ .RIGHT \}
5658 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS  \}
5659 .       ie '\\*[$HDRFTR_RIGHT]'#' \{\
5660 .           PRINT \\v'-(\\n[#LEAD]u*2u)'\\n[#PAGENUMBER]
5661 .       \}
5662 .       el \{\
5663 .          ie !'\\*[$HDRFTR_RIGHT]'' \{ .PRINT \v'-(\\n[#LEAD]u*2u)'\\*[$HDRFTR_RIGHT] \}
5664 .          el \{ .PRINT \& \}
5665 .       \}
5666 .       if \\n[#HDRFTR_RIGHT_CAPS] \{ .CAPS OFF \}
5667 .    \}
5668 .    if \\n[#HDRFTR_RULE] \{\
5669 .       HDRFTR_RULE_INTERNAL
5670 .    \}
5671 .END
5672 \#
5673 \#
5674 \# PRINT USER DEFINED HEADER/FOOTER
5675 \# --------------------------------
5676 \# *Arguments:
5677 \#   <none>
5678 \# *Function:
5679 \#   Based on defaults or values entered by user, prints a single part
5680 \#   (i.e. not 3-part) title at either the top or the bottom of the page.
5681 \# *Notes:
5682 \#   Called from within PRINT_HDRFTR.
5683 \#
5684 .MAC PRINT_USERDEF_HDRFTR END
5685 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
5686 .    fc ^ #
5687 .    if \\n[#PRINT_STYLE]=2 \{\
5688 .       FAMILY  \\*[$HDRFTR_FAM]
5689 .       FT      R
5690 .       PT_SIZE \\n[#HDRFTR_PT_SIZE]u
5691 .    \}
5692 .    ie \\n[#RECTO_VERSO] \{\
5693 .       if o \{\
5694 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
5695 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
5696 .          if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
5697 .          PRINT \\*[$USERDEF_HDRFTR_RECTO]
5698 .          EL
5699 .          if \\n[#FOOTERS_ON] \{\
5700 .             di NULL
5701 .             SIZESPECS
5702 .             nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
5703 .             di
5704 .          \}
5705 .       \}
5706 .       if e \{\
5707 .          ie !'\\*[$USERDEF_HDRFTR_VERSO]'' \{\
5708 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=1 \{ .LEFT   \}
5709 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=2 \{ .CENTER \}
5710 .             if \\n[#USERDEF_HDRFTR_VERSO_QUAD]=3 \{ .RIGHT  \}
5711 .          \}
5712 .          PRINT \\*[$USERDEF_HDRFTR_VERSO]
5713 .          EL
5714 .          if \\n[#FOOTERS_ON] \{\
5715 .             di NULL
5716 .             SIZESPECS
5717 .             nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
5718 .             di
5719 .          \}
5720 .          el \{\
5721 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
5722 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
5723 .             if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
5724 .             PRINT \\*[$USERDEF_HDRFTR_RECTO]
5725 .             EL
5726 .             if \\n[#FOOTERS_ON] \{\
5727 .                di NULL
5728 .                SIZESPECS
5729 .                nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
5730 .                di
5731 .             \}
5732 .          \}
5733 .       \}
5734 .    \}
5735 .    el \{\
5736 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=1 \{ .LEFT   \}
5737 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=2 \{ .CENTER \}
5738 .       if \\n[#USERDEF_HDRFTR_RECTO_QUAD]=3 \{ .RIGHT  \}
5739 .       PRINT \\*[$USERDEF_HDRFTR_RECTO]
5740 .       EL
5741 .       if \\n[#FOOTERS_ON] \{\
5742 .          di NULL
5743 .          SIZESPECS
5744 .          nr #HDRFTR_HEIGHT \\n[#CAP_HEIGHT]
5745 .          di
5746 .       \}
5747 .    \}
5748 .    fc
5749 .    if \\n[#HDRFTR_RULE] \{\
5750 .       HDRFTR_RULE_INTERNAL
5751 .    \}
5752 .END
5753 \#
5754 \#
5755 \# +++HEADERS+++
5756 \#
5757 \# HEADERS (off or on)
5758 \# -------------------
5759 \# *Arguments:
5760 \#   <none> | <anything>
5761 \# *Function:
5762 \#   Turns headers at the top of the page off or on.
5763 \# *Notes:
5764 \#   Default is on.
5765 \#
5766 .MAC HEADERS END
5767 .    ie '\\$1'' \{ .nr #HEADERS_ON 1 \}
5768 .    el \{ .nr #HEADERS_ON 0 \}
5769 .END
5770 \#
5771 \#
5772 \# HEADER MARGIN
5773 \# -------------
5774 \# *Argument:
5775 \#   <amount of space between top of page and header>
5776 \# *Function:
5777 \#   Creates or modifies register #HEADER_MARGIN to hold amount
5778 \#   of space between top of page and header.
5779 \# *Notes:
5780 \#   Requires unit of measure.  Default is 4P+6p, measured top-of-page
5781 \#   to baseline.
5782 \#
5783 .MAC HEADER_MARGIN END
5784 .    nr #HEADER_MARGIN (\\$1)
5785 .END
5786 \#
5787 \#
5788 \# HEADER GAP
5789 \# ----------
5790 \# *Argument:
5791 \#   <amount of space between header and running text>
5792 \# *Function:
5793 \#   Creates or modifies register #HEADER_GAP to hold amount
5794 \#   of space between header and running text.
5795 \# *Notes:
5796 \#   Default is 1P+6p.
5797 \#
5798 .MAC HEADER_GAP END
5799 .    nr #HEADER_GAP (\\$1)
5800 .END
5801 \#
5802 \#
5803 \# HEADER
5804 \# ------
5805 \# *Arguments:
5806 \#   <none>
5807 \# *Function:
5808 \#   Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
5809 \# *Notes:
5810 \#   In order to convert the title string to caps in the header (in the
5811 \#   event that the user enters .TITLE in caps/lc), I've used
5812 \#   quad left, quad centre, and quad right to arrange the three bits
5813 \#   of the header, rather than .tl.  This allows the use of the CAPS macro.
5814 \#   The downside is that I have to add \\v'-(\\n[#LEAD]u*#) in order
5815 \#   for -Tlatin1 output to align the header/footer strings on the baseline.
5816 \#   The console output still isn't brilliant, but at least it's
5817 \#   comprehensible.
5818 \#
5819 .MAC HEADER END
5820 .    PROCESS_FN_LEFTOVER
5821 .    nr #FN_COUNT_FOR_COLS 0 1
5822 .    if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
5823 .    po \\n[#DOC_L_MARGIN]u
5824 .    if \\n[#RECTO_VERSO] \{\
5825 .       nr #DOC_LR_MARGIN_TMP \\n[#DOC_L_MARGIN]
5826 .       DOC_LEFT_MARGIN  \\n[#DOC_R_MARGIN]u
5827 .       DOC_RIGHT_MARGIN \\n[#DOC_LR_MARGIN_TMP]u
5828 .    \}
5829 .    ev HEADER
5830 .    if \\n[#PRINT_STYLE]=1 \{ .vs 0 \}
5831 .    if \\n[#PRINT_STYLE]=2 \{ .LS 0 \}
5832 .    sp |\\n[#HEADER_MARGIN]u-1v
5833 .    ll \\n[#DOC_L_LENGTH]u
5834 .    ta \\n(.lu
5835 .    if \\n[#PRINT_STYLE]=2 \{\
5836 .      FAMILY  \\*[$HDRFTR_FAM]
5837 .      FT      R
5838 .      PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
5839 .    \}
5840 .    if \\n[#PRINT_STYLE]=1 \{\
5841 .       fam C
5842 .       ft  R
5843 .       ps  12\\*[$HDRFTR_SIZE_CHANGE]
5844 .    \}
5845 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
5846 .    if \\n[#CAPS_ON] \{\
5847 .       nr #CAPS_WAS_ON 1
5848 .       CAPS OFF
5849 .    \}
5850 .    if \\n[#UNDERLINE_ON] \{\
5851 .       nr #UNDERLINE_WAS_ON 1
5852 .       UNDERLINE OFF
5853 .    \}
5854 .    ie \\n[#HEADERS_ON] \{\
5855 .       PRINT_HDRFTR
5856 .       sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
5857 .    \}
5858 .    el \{\
5859 .       ie \\n[#PAGE_NUM_V_POS]=1 \{\
5860 .          ie \\n[#PAGINATE] \{\
5861 .             PRINT_PAGE_NUMBER
5862 .             sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
5863 .          \}
5864 .          el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
5865 .       \}
5866 .       el \{ .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u \}
5867 .    \}
5868 .    nr #PAGE_TOP \\n(nl
5869 .    ev
5870 .    po \\n[#L_MARGIN]u
5871 .    if \\n[#RECTO_VERSO] \{\
5872 .       nr #L_MARGIN +\\n[#L_MARGIN_DIFF]
5873 .    \}
5874 .    if \\n[#CAPS_WAS_ON] \{\
5875 .       CAPS
5876 .       rr #CAPS_WAS_ON
5877 .    \}
5878 .    if \\n[#UNDERLINE_WAS_ON] \{\
5879 .       UNDERLINE
5880 .       rr #UNDERLINE_WAS_ON
5881 .    \}
5882 .    if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
5883 .    if \\n[#QUOTE] \{\
5884 .       ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
5885 .       el \{\
5886 .          nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
5887 .          po \\n[#Q_OFFSET]u
5888 .       \}
5889 .    \}
5890 .    if \\n[#EPIGRAPH] \{\
5891 .       ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
5892 .       el \{\
5893 .          nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
5894 .          po \\n[#EPI_OFFSET]u
5895 .       \}
5896 .    \}
5897 .    ie \\n[#EPIGRAPH] \{\
5898 .       ie !\\n[#EPI_ACTIVE] \{\
5899 .          ns
5900 .          rr #EPI_ACTIVE
5901 .       \}
5902 .       el \{\
5903 .          ie \\n[#EPI_FITS] \{ .ns \}
5904 .          el \{ .ALD \\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u \}
5905 .          \}
5906 .    \}
5907 .    el \{ .ns \}
5908 .    ns
5909 .    if \\n[#COLUMNS] \{\
5910 .       if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
5911 .       nr #COL_NUM 0 1
5912 .       mk dc
5913 .       po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
5914 .       ll \\n[#COL_L_LENGTH]u
5915 .       ta \\n(.lu
5916 .       if \\n[#QUOTE] \{\
5917 .          po +(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
5918 .       \}
5919 .       if \\n[#EPIGRAPH] \{\
5920 .          if \\n[#EPI_ACTIVE] \{\
5921 .             ie \\n[#EPI_FITS] \{ . \}
5922 .             el \{ .nr dc -\\n[#EPI_LEAD_DIFF] \}
5923 .          \}
5924 .          po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u+(\\n[#PP_INDENT]u*\\n[#EPI_OFFSET_VALUE]u)
5925 .       \}
5926 .    \}
5927 .    if \\n[#PRINT_STYLE]=1 \{\
5928 .       if \\n[#SLANT_ON] \{\
5929 .          if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
5930 .       \}
5931 .    \}
5932 .END
5933 \#
5934 \# ====================================================================
5935 \#
5936 \# +++FOOTERS+++
5937 \#
5938 \# FOOTERS (off or on)
5939 \# -------------------
5940 \# *Arguments:
5941 \#   <none> | <anything>
5942 \# *Function:
5943 \#   Turns footers at the bottom of the page off or on.
5944 \# *Notes:
5945 \#   Default is off.  If on, page numbers automatically go at
5946 \#   the top, centered, unless pagination has been turned off,
5947 \#   or the pagenumber position has been changed to left or right.
5948 \#
5949 .MAC FOOTERS END
5950 .    ie '\\$1''   \{\
5951 .       nr #FOOTERS_ON 1
5952 .       PAGE_NUM_POS TOP CENTER
5953 .    \}
5954 .    el \{ .nr #FOOTERS_ON 0 \}
5955 .END
5956 \#
5957 \#
5958 \# FOOTER MARGIN
5959 \# -------------
5960 \# *Argument:
5961 \#   <footer margin>
5962 \# *Function:
5963 \#   Creates or modifies register #FOOTER_MARGIN which holds the
5964 \#   amount of space to leave between the page number and the bottom
5965 \#   of the page.
5966 \# *Notes:
5967 \#   Unit of measure required.  Default is 3P.
5968 \#
5969 .MAC FOOTER_MARGIN END
5970 .    ie \\n%>0 \{ .nr #FOOTER_MARGIN (\\$1) \}
5971 .    el \{ . \}
5972 .END
5973 \#
5974 \#
5975 \# FOOTER GAP
5976 \# ----------
5977 \# *Argument:
5978 \#   <distance from end of running text to page # or footer>
5979 \# *Function:
5980 \#   Creates or modifies register #FOOTER_GAP which holds the
5981 \#   amount of space to leave between running text and the page number.
5982 \# *Notes:
5983 \#   Requires unit of measure.  Default is 3P.  Measured baseline to
5984 \#   baseline.
5985 \#
5986 .MAC FOOTER_GAP END
5987 .    ie \\n%>0 \{ .nr #FOOTER_GAP (\\$1) \}
5988 .    el \{ . \}
5989 .END
5990 \#
5991 \#
5992 \# FOOTER
5993 \# ------
5994 \# *Arguments:
5995 \#   <none>
5996 \# *Function:
5997 \#   Places footer at bottom of page if #FOOTERS=1, otherwise
5998 \#   places page number at bottom of page (if #PAGINATE=1).
5999 \#   Page numbers are in arabic or roman according to COPYSTYLE.
6000 \#   DRAFT starts the document at page 1 regardless of PAGENUMBER.
6001 \#   FINAL respects PAGENUMBER.
6002 \#
6003 .MAC FOOTER END
6004 .    ev PAGE_BOTTOM
6005 .    nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
6006 .    if !\\n[#FN_DEFER] \{\
6007 .       nr #DIVER_DEPTH 0
6008 .       if \\n[#FN_COUNT] \{\
6009 .          sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u)
6010 .          po \\n[#DOC_L_MARGIN]u
6011 .          if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
6012 .          nf
6013 .          FOOTNOTES
6014 .          rm FOOTNOTES
6015 .          if '\\n(.z'FN_OVERFLOW' \{\
6016 .              di
6017 .              nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
6018 .          \}
6019 .          nr #FN_COUNT 0
6020 .          if \\n[#COL_NEXT] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
6021 .       \}
6022 .    \}
6023 .    ie \\n[#COLUMNS] \{\
6024 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
6025 .       el \{\
6026 .          sp |\\n(dcu
6027 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
6028 .          PROCESS_FN_LEFTOVER
6029 .          if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
6030 .          if !\\n[#QUOTE]    \{ .rr #COL_NEXT \}
6031 .          if \\n[#QUOTE] \{\
6032 .             nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
6033 .             if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
6034 .             po \\n[#Q_OFFSET]u
6035 .          \}
6036 .          if \\n[#EPIGRAPH] \{\
6037 .             nr #EPI_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE])
6038 .             if \\n[#COLUMNS] \{ .nr #EPI_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#EPI_OFFSET_VALUE]) \}
6039 .             po \\n[#EPI_OFFSET]u
6040 .          \}
6041 .          ie \\n[#EPIGRAPH] \{\
6042 .             ie !\\n[#EPI_ACTIVE] \{\
6043 .                ns
6044 .                rr #EPI_ACTIVE
6045 .             \}
6046 .             el \{\
6047 .                sp |\\n(dcu+(\\n[#DOC_LEAD]u-\\n[#EPI_LEAD]u)
6048 .                rr #EPI_ACTIVE
6049 .             \}
6050 .          \}
6051 .          el \{ .ns \}
6052 .          ev
6053 .       \}
6054 .       ns
6055 .    \}
6056 .    el \{ .DO_FOOTER \}
6057 .END
6058 \#
6059 \#
6060 \# PROCESS FOOTER
6061 \# --------------
6062 \# *Arguments:
6063 \#   <none>
6064 \# *Function:
6065 \#   Prints footer (page number, or 3-part footer).
6066 \#   Resets CAPS and UNDERLINE if they were on.
6067 \#
6068 .MAC DO_FOOTER END
6069 .    sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
6070 .    ev FOOTER
6071 .    po \\n[#DOC_L_MARGIN]u
6072 .    ll \\n[#DOC_L_LENGTH]u
6073 .    ta \\n(.lu
6074 .    FAMILY  \\*[$HDRFTR_FAM]
6075 .    FT      R
6076 .    PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
6077 .    if \\n[#PRINT_STYLE]=1 \{\
6078 .       fam C
6079 .       ft  R
6080 .       ps  12
6081 .    \}
6082 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
6083 .    if \\n[#CAPS_ON] \{\
6084 .       nr #CAPS_WAS_ON 1
6085 .       CAPS OFF
6086 .    \}
6087 .    if \\n[#UNDERLINE_ON] \{\
6088 .       nr #UNDERLINE_WAS_ON 1
6089 .       UNDERLINE OFF
6090 .    \}
6091 .    ie \\n[#FOOTERS_ON] \{\
6092 .       PRINT_HDRFTR
6093 .    \}
6094 .    el \{\
6095 .       if \\n[#PAGINATE] \{\
6096 .          if \\n[#PAGE_NUM_V_POS]=2 \{ .PRINT_PAGE_NUMBER \}
6097 .       \}
6098 .    \}
6099 .    if \\n[#CAPS_WAS_ON] \{\
6100 .       CAPS
6101 .       rr #CAPS_WAS_ON
6102 .    \}
6103 .    if \\n[#UNDERLINE_WAS_ON] \{\
6104 .       UNDERLINE
6105 .       rr #UNDERLINE_WAS_ON
6106 .    \}
6107 .    ev
6108 .    bp
6109 .    ev
6110 .END
6111 \#
6112 \# ====================================================================
6113 \#
6114 \# +++HEADS+++
6115 \#
6116 \# ---Head numbers---
6117 \#
6118 \# NUMBER HEADS
6119 \# ------------
6120 \# *Arguments:
6121 \#   <none> | <anything>
6122 \# *Function:
6123 \#   Toggles register #NUMBER_HEAD; sets incrementing register #HEAD_NUM.
6124 \# *Notes:
6125 \#   Default is OFF.
6126 \#
6127 .MAC NUMBER_HEADS END
6128 .    ie '\\$1'' \{\
6129 .       nr #NUMBER_HEAD 1
6130 .       if !\\n[#HEAD_NUM] \{ .nr #HEAD_NUM 0 1 \}
6131 .    \}
6132 .    el \{ .rr #NUMBER_HEAD \}
6133 .END
6134 \#
6135 \#
6136 \# RESET HEAD NUMBER
6137 \# -----------------
6138 \# *Arguments:
6139 \#   <none> | <desired head number>
6140 \# *Function:
6141 \#   Resets incrementing register #HEAD_NUM to 1 or, if there's
6142 \#   an argument, to user supplied number.
6143 \# *Notes:
6144 \#   Also resets subhead and parahead numbers.  If this is not
6145 \#   desired, subhead and parahead numbers may be reset individually.
6146 \#
6147 .MAC RESET_HEAD_NUMBER END
6148 .    ie '\\$1'' \{\
6149 .       nr #HEAD_NUM 0 1
6150 .       nr #SH_NUM   0 1
6151 .       nr #PH_NUM   0 1
6152 .    \}
6153 .    el \{\
6154 .       nr #HEAD_NUM \\$1-1 1
6155 .       nr #SH_NUM   0 1
6156 .       nr #PH_NUM   0 1
6157 .    \}
6158 .END
6159 \#
6160 \#
6161 \# NUMBER SUBHEADS
6162 \# ---------------
6163 \# *Arguments:
6164 \#   <none> | <anything>
6165 \# *Function:
6166 \#   Toggles register #NUMBER_SH; sets incrementing register #SH_NUM.
6167 \# *Notes:
6168 \#   Default is OFF.
6169 \#
6170 .MAC NUMBER_SUBHEADS END
6171 .    ie '\\$1'' \{\
6172 .       nr #NUMBER_SH 1
6173 .       if !\\n[#SH_NUM] \{ .nr #SH_NUM 0 1 \}
6174 .    \}
6175 .    el \{ .rr #NUMBER_SH \}
6176 .END
6177 \#
6178 \#
6179 \# RESET SUBHEAD NUMBER
6180 \# --------------------
6181 \# *Arguments:
6182 \#   <none> | <desired subhead number>
6183 \# *Function:
6184 \#   Resets incrementing register #SH_NUM to 1 or, if there's
6185 \#   an argument, to user supplied number.
6186 \# *Notes:
6187 \#   When the subhead number is reset, it resets the parahead number as
6188 \#   well.  If this behaviour is not what's wanted, RESET_SUBHEAD_NUMBER
6189 \#   allows the user to set the parahead number to whatever s/he desires.
6190 \#
6191 .MAC RESET_SUBHEAD_NUMBER END
6192 .    ie '\\$1'' \{ .nr #SH_NUM 0 1 \}
6193 .    el \{\
6194 .       nr #SH_NUM \\$1-1 1
6195 .       nr #PH_NUM 0 1
6196 .       \}
6197 .END
6198 \#
6199 \#
6200 \# NUMBER PARAHEADS
6201 \# ----------------
6202 \# *Arguments:
6203 \#   <none> | <anything>
6204 \# *Function:
6205 \#   Toggles register #NUMBER_PH; sets incrementing register #PH_NUM.
6206 \# *Notes:
6207 \#   Default is OFF.
6208 \#
6209 .MAC NUMBER_PARAHEADS END
6210 .    ie '\\$1'' \{\
6211 .       nr #NUMBER_PH 1
6212 .       if !\\n[#PH_NUM] \{ .nr #PH_NUM 0 1 \}
6213 .    \}
6214 .    el \{ .rr #NUMBER_PH \}
6215 .END
6216 \#
6217 \#
6218 \# RESET PARAHEAD NUMBER
6219 \# ---------------------
6220 \# *Arguments:
6221 \#   <none> | <desired parahead number>
6222 \# *Function:
6223 \#   Resets incrementing register #PH_NUM to 1 or, if there's
6224 \#   an argument, to user supplied number.
6225 \# *Notes:
6226 \#   Resetting the parahead number resets the parahead number
6227 \#   only.
6228 \#
6229 .MAC RESET_PARAHEAD_NUMBER END
6230 .    ie '\\$1'' \{ .nr #PH_NUM 0 1 \}
6231 .    el \{ nr #SH_NUM \\$1-1 1 \}
6232 .END
6233 \#
6234 \#
6235 \# ---Main heads---
6236 \#
6237 \# HEAD FAMILY
6238 \# -----------
6239 \# *Argument:
6240 \#   <family to use for section titles (main heads)>
6241 \# *Function:
6242 \#   Creates or modifies string $HEAD_FAM.
6243 \# *Notes:
6244 \#   Default is same as running text.
6245 \#
6246 .MAC HEAD_FAMILY END
6247 .    ds $HEAD_FAM \\$1
6248 .END
6249 \#
6250 \#
6251 \# HEAD FONT
6252 \# ---------
6253 \# *Argument:
6254 \#   <font to use for section titles (main heads)>
6255 \# *Function:
6256 \#   Creates or modifies string $HEAD_FT.
6257 \# *Notes:
6258 \#   Default is bold.
6259 \#
6260 .MAC HEAD_FONT END
6261 .    ds $HEAD_FT \\$1
6262 .END
6263 \#
6264 \#
6265 \# HEAD SIZE
6266 \# ---------
6267 \# *Argument:
6268 \#   <+|- number of points by which to in/decrease point size of
6269 \#   section titles (relative to running text)>
6270 \# *Function:
6271 \#   Creates or modifies string $HEAD_SIZE_CHANGE.
6272 \# *Notes:
6273 \#   Must be preceded by a - or + sign with no space afterwards.
6274 \#   Fractional point sizes are allowed.
6275 \#   Default +1 for printstyle TYPESET; +0 for TYPEWRITE.
6276 \#
6277 .MAC HEAD_SIZE END
6278 .    ds $HEAD_SIZE_CHANGE \\$1
6279 .END
6280 \#
6281 \#
6282 \# HEAD QUAD
6283 \# ---------
6284 \# *Arguments:
6285 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE
6286 \# *Function:
6287 \#   Creates or modifies string $HEAD_QUAD.
6288 \# *Notes:
6289 \#   Default is CENTER.
6290 \#
6291 .MAC HEAD_QUAD END
6292 .    ds $HEAD_QUAD \\$1
6293 .END
6294 \#
6295 \#
6296 \# HEAD CAPS
6297 \# ---------
6298 \# *Arguments:
6299 \#   <none> | <anything>
6300 \# *Function:
6301 \#   Creates or modifies register #HEAD_CAPS.
6302 \# *Notes:
6303 \#   Default is on.
6304 \#
6305 .MAC HEAD_CAPS END
6306 .    ie '\\$1'' \{ .nr #HEAD_CAPS 1 \}
6307 .    el \{ .nr #HEAD_CAPS 0 \}
6308 .END
6309 \#
6310 \#
6311 \# HEAD SPACE
6312 \# ----------
6313 \# *Arguments:
6314 \#   <none> | <anything>
6315 \# *Function:
6316 \#   Creates register #HEAD_SPACE, which toggles whether the space
6317 \#   before heads is 1 extra line space ("off") or 2 ("on").  Used only
6318 \#   in PRINTSTYLE TYPESET.
6319 \# *Notes:
6320 \#   Default is on.
6321 \#
6322 .MAC HEAD_SPACE END
6323 .    ie '\\$1'' \{ .nr #HEAD_SPACE 1 \}
6324 .    el \{ .nr #HEAD_SPACE 0 \}
6325 .END
6326 \#
6327 \#
6328 \# HEAD UNDERLINE
6329 \# --------------
6330 \# *Arguments:
6331 \#   <none> | <anything>
6332 \# *Function:
6333 \#   Creates or modifies register #HEAD_UNDERLINE.
6334 \# *Notes:
6335 \#   Default is on.
6336 \#
6337 .MAC HEAD_UNDERLINE END
6338 .    ie '\\$1'' \{ .nr #HEAD_UNDERLINE 1 \}
6339 .    el \{ .nr #HEAD_UNDERLINE 0 \}
6340 .END
6341 \#
6342 \#
6343 \# MAIN HEAD
6344 \# ---------
6345 \# *Arguments:
6346 \#   "text of main head" ["text of main head"] ...
6347 \# *Function:
6348 \#   In TYPEWRITE, prints main heads centered, all caps, underlined.
6349 \#   In TYPESET, prints bold main heads 1 point larger than running
6350 \#   text, all caps, underlined.
6351 \# *Notes:
6352 \#   The HEAD macro requires that double-quotes (") surround
6353 \#   each line of text.
6354 \#
6355 .MAC HEAD END
6356 .    br
6357 .    nr #ARG_NUM 0 1
6358 .    nr #HEAD 1
6359 .    ev HEAD
6360 .    ll \\n[#L_LENGTH]u
6361 .    ta \\n(.lu
6362 .    if \\n[#COLUMNS] \{\
6363 .       ll \\n[#COL_L_LENGTH]u
6364 .       ta \\n(.lu
6365 .    \}
6366 .    CHECK_INDENT
6367 .    QUAD \\*[$HEAD_QUAD]
6368 .    if \\n[#PRINT_STYLE]=1 \{\
6369 .       fam C
6370 .       ft  R
6371 .       ps  12
6372 .       vs  \\n[#DOC_LEAD]u
6373 .       UNDERLINE OFF
6374 .    \}
6375 .    if \\n[#PRINT_STYLE]=2 \{\
6376 .       FAMILY  \\*[$HEAD_FAM]
6377 .       FT      \\*[$HEAD_FT]
6378 .       PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$HEAD_SIZE_CHANGE]
6379 .       LS      \\n[#DOC_LEAD]u
6380 .    \}
6381 .    if r#QUOTE             \{ .rr #QUOTE \}
6382 .    if r#EPIGRAPH          \{ .rr #EPIGRAPH \}
6383 .    if \\n[#PRINT_STYLE]=1 \{ .ne 3 \}
6384 .    if \\n[#PRINT_STYLE]=2 \{\
6385 .        ie \\n[#HEAD_SPACE] \{ .ne 5 \}
6386 .        el \{ .ne 3 \}
6387 .    \}
6388 .    ie \\n[#START] \{\
6389 .       if \\n[#DOC_HEADER]=0 \{ . \}
6390 .    \}
6391 .    el \{\
6392 .       if \\n[#PRINT_STYLE]=1 \{\
6393 .          if !\\n[#LINEBREAK] \{\
6394 .             ALD \\n[#DOC_LEAD]u
6395 .             if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6396 .          \}
6397 .       \}
6398 .       if \\n[#PRINT_STYLE]=2 \{\
6399 .          ie \\n[#PP_SPACE] \{\
6400 .             ie \\n[#END_QUOTE] \{ . \}
6401 .             el \{\
6402 .                if !\\n[#LINEBREAK] \{\
6403 .                   if \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6404 .                \}
6405 .             \}
6406 .          \}
6407 .          el \{\
6408 .             ie \\n[#HEAD_SPACE] \{ .ALD \\n[#DOC_LEAD]u*2u \}
6409 .             el \{ .ALD \\n[#DOC_LEAD]u \}
6410 .          \}
6411 .          if \\n[#END_QUOTE] \{\
6412 .             if !\\n[#Q_FITS]  \{\
6413 .                RLD \\n[#DOC_LEAD]u
6414 .                if \\n[#PP_ACTIVE] \{ .ALD \\n[#DOC_LEAD]u \}
6415 .             \}
6416 .             if \\n[#Q_AT_TOP] \{\
6417 .                RLD \\n[#DOC_LEAD]u
6418 .                if \\n[#Q_AT_TOP] \{ .ALD \\n[#DOC_LEAD]u \}
6419 .             \}
6420 .          \}
6421 .          if \\n[#LINEBREAK] \{\
6422 .             if \\n[#HEAD_SPACE] \{ .RLD \\n[#DOC_LEAD]u \}
6423 .          \}
6424 .       \}
6425 .    \}
6426 .    if \\n[#HEAD_CAPS] \{ .CAPS \}
6427 .    while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6428 .       ie \\n[#NUMBER_HEAD] \{\
6429 .          ie \\n[#ARG_NUM]=0 \{\
6430 .             br
6431 .             ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
6432 .             el \{ .UNDERSCORE "\\n+[#HEAD_NUM].\0\\$[\\n+[#ARG_NUM]]\}
6433 .             br
6434 .          \}
6435 .          el \{\
6436 .             br
6437 .             ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
6438 .             el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
6439 .             br
6440 .          \}
6441 .       \}
6442 .       el \{\
6443 .          br
6444 .          ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\\$[\\n+[#ARG_NUM]]\}
6445 .          el \{ .UNDERSCORE "\\$[\\n+[#ARG_NUM]]\}
6446 .          br
6447 .       \}
6448 .    \}
6449 .    REMOVE_INDENT
6450 .    CAPS OFF
6451 .    ev
6452 .    ALD \\n[#DOC_LEAD]u
6453 .    RESET_SUBHEAD_NUMBER
6454 .    RESET_PARAHEAD_NUMBER
6455 .    if r#START      \{ .rr #START     \}
6456 .    if r#EPIGRAPH   \{ .rr #EPIGRAPH  \}
6457 .    if r#QUOTE      \{ .rr #QUOTE     \}
6458 .    if r#Q_FITS     \{ .rr #Q_FITS    \}
6459 .    if r#END_QUOTE  \{ .rr #END_QUOTE \}
6460 .    if r#LINEBREAK  \{ .rr #LINEBREAK \}
6461 .    if r#Q_AT_TOP   \{ .rr #Q_AT_TOP  \}
6462 .    if r#PP_ACTIVE  \{ .rr #PP_ACTIVE \}
6463 .    rr #ARG_NUM
6464 .    nr #PP 0
6465 .END
6466 \#
6467 \#
6468 \# ---Subheads---
6469 \#
6470 \# SUBHEAD FAMILY
6471 \# --------------
6472 \# *Argument:
6473 \#   <family to use in subheads>
6474 \# *Function:
6475 \#   Creates or modifies string $SH_FAM.
6476 \# *Notes:
6477 \#   Default is same as running text.
6478 \#
6479 .MAC SUBHEAD_FAMILY END
6480 .    ds $SH_FAM \\$1
6481 .END
6482 \#
6483 \#
6484 \# SUBHEAD FONT
6485 \# --------------
6486 \# *Argument:
6487 \#   <font to use in subheads>
6488 \# *Function:
6489 \#   Creates or modifies string $SH_FT.
6490 \# *Notes:
6491 \#   Default is bold.
6492 \#
6493 .MAC SUBHEAD_FONT END
6494 .    ds $SH_FT \\$1
6495 .END
6496 \#
6497 \#
6498 \# SUBHEAD SIZE
6499 \# ------------
6500 \# *Argument:
6501 \#   <+|- number of points by which to in/decrease point size of subheads
6502 \#   (relative to running text)>
6503 \# *Function:
6504 \#   Creates or modifies string $SH_SIZE_CHANGE.
6505 \# *Notes:
6506 \#   Must be preceded by a +|- sign.  No space afterwards.
6507 \#   Fractional point sizes are allowed.
6508 \#   Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
6509 \#
6510 .MAC SUBHEAD_SIZE END
6511 .    ds $SH_SIZE_CHANGE \\$1
6512 .END
6513 \#
6514 \#
6515 \# SUBHEAD QUAD
6516 \# ------------
6517 \# *Argument:
6518 \#   L | LEFT | R | RIGHT | C | CENTER | CENTRE
6519 \# *Function:
6520 \#   Creates or modifies string $SH_QUAD.
6521 \# *Notes:
6522 \#   Default is LEFT for both TYPESET and TYPEWRITE.
6523 \#
6524 .MAC SUBHEAD_QUAD END
6525 .    ds $SH_QUAD \\$1
6526 .END
6527 \#
6528 \#
6529 \# SUBHEAD
6530 \# -------
6531 \# *Arguments:
6532 \#   "text of subhead" ["text of subhead"] ...
6533 \# *Function:
6534 \#   In TYPEWRITE, prints subheads underlined.
6535 \#   In TYPESET, prints subheads bold, .5 points larger than running
6536 \#   text.
6537 \#   In both styles, a line space precedes the subhead, and a small
6538 \#   amount of lead comes after.
6539 \# *Notes:
6540 \#   As with the HEAD macro, double-quotes (") must surround
6541 \#   each line of text.
6542 \#
6543 .MAC SUBHEAD END
6544 .    br
6545 .    nr #ARG_NUM 0 1
6546 .    if r#QUOTE    \{ .rr #QUOTE    \}
6547 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
6548 .    ev SUBHEAD
6549 .    ll \\n[#L_LENGTH]u
6550 .    ta \\n(.lu
6551 .    if \\n[#COLUMNS] \{\
6552 .       ll \\n[#COL_L_LENGTH]u
6553 .       ta \\n(.lu
6554 .    \}
6555 .    CHECK_INDENT
6556 .    if \\n[#PRINT_STYLE]=1 \{\
6557 .       fam C
6558 .       ft  R
6559 .       ps  12
6560 .       vs  \\n[#DOC_LEAD]u
6561 .       QUAD   \\*[$SH_QUAD]
6562 .       UNDERLINE OFF
6563 .    \}
6564 .    if \\n[#PRINT_STYLE]=2 \{\
6565 .       FAMILY  \\*[$SH_FAM]
6566 .       FT      \\*[$SH_FT]
6567 .       PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$SH_SIZE_CHANGE]
6568 .       LS      \\n[#DOC_LEAD]u
6569 .       QUAD    \\*[$SH_QUAD]
6570 .    \}
6571 .    if \\n[#PRINT_STYLE]=1 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/5 \}
6572 .    if \\n[#PRINT_STYLE]=2 \{ .nr #SH_LEAD_ADJUST \\n[#LEAD]/8 \}
6573 .    ie \\n[#START] \{ . \}
6574 .    el \{\
6575 .       ie ( \\n[#TRAP_DISTANCE] < (\\n[#DOC_LEAD]u*2u) ) \{\
6576 .          ie \\n[#COLUMNS] \{ .COL_NEXT \}
6577 .          el \{ .bp \}
6578 .       \}
6579 .       el \{\
6580 .          ie \\n[#HEAD]=1 \{ . \}
6581 .          el \{\
6582 .             if \\n[#PRINT_STYLE]=1 \{\
6583 .                if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
6584 .             \}
6585 .             if \\n[#PRINT_STYLE]=2 \{\
6586 .                ie \\n[#PP_SPACE]=1 \{\
6587 .                   ie !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
6588 .                   el \{ .RLD \\n[#DOC_LEAD]u \}
6589 .                \}
6590 .                el \{\
6591 .                   if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
6592 .                \}
6593 .             \}
6594 .          \}
6595 .       \}
6596 .    \}
6597 .    if \\n[#PRINT_STYLE]=1 \{\
6598 .       while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6599 .          ie \\n[#NUMBER_SH] \{\
6600 .             ie \\n[#ARG_NUM]=0 \{\
6601 .                ie \\n[#NUMBER_HEAD] \{\
6602 .                   br
6603 .                   UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
6604 .                   br
6605 .                \}
6606 .                el \{\
6607 .                   br
6608 .                   UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
6609 .                   br
6610 .                \}
6611 .             \}
6612 .             el \{\
6613 .                br
6614 .                ie \\n[#HEAD_UNDERLINE]=0 \{ .PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
6615 .                el \{ .UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]\}
6616 .                br
6617 .             \}
6618 .          \}
6619 .          el \{\
6620 .             br
6621 .             UNDERSCORE "\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
6622 .             br
6623 .          \}
6624 .       \}
6625 .    \}
6626 .    if \\n[#PRINT_STYLE]=1 \{\
6627 .       if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
6628 .    \}
6629 .    if \\n[#PRINT_STYLE]=2 \{\
6630 .       ie \\n[#PP_SPACE]=0 \{\
6631 .          while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6632 .             ie \\n[#NUMBER_SH] \{\
6633 .                ie \\n[#ARG_NUM]=0 \{\
6634 .                   ie \\n[#NUMBER_HEAD] \{\
6635 .                      br
6636 .                      PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n[#HEAD_NUM].\\n+[#SH_NUM]\0\\$[\\n+[#ARG_NUM]]
6637 .                      br
6638 .                   \}
6639 .                   el \{\
6640 .                      br
6641 .                      PRINT "\v'-\\n[#SH_LEAD_ADJUST]u'\\n+[#SH_NUM].\0\\$[\\n+[#ARG_NUM]]
6642 .                      br
6643 .                   \}
6644 .                \}
6645 .                el \{\
6646 .                   br
6647 .                   PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
6648 .                   br
6649 .                \}
6650 .             \}
6651 .             el \{\
6652 .                br
6653 .                PRINT "\\v'-\\n[#SH_LEAD_ADJUST]u'\\$[\\n+[#ARG_NUM]]
6654 .                br
6655 .             \}
6656 .          \}
6657 .       \}
6658 .       el \{\
6659 .          ALD \\n[#DOC_LEAD]u
6660 .          if \\n[#HEAD]=1      \{ .RLD \\n[#DOC_LEAD]u \}
6661 .          if \\n[#END_QUOTE]   \{ .RLD \\n[#DOC_LEAD]u \}
6662 .          if \\n[#EPIGRAPH]    \{ .RLD \\n[#DOC_LEAD]u \}
6663 .          while \\n[#ARG_NUM]<\\n[#NUM_ARGS] \{\
6664 .             PRINT "\\$[\\n+[#ARG_NUM]]
6665 .          \}
6666 .          ALD \\n[#DOC_LEAD]u
6667 .       \}
6668 .    \}
6669 .    REMOVE_INDENT
6670 .    ev
6671 .    RESET_PARAHEAD_NUMBER
6672 .    if r#START     \{ .rr #START     \}
6673 .    if r#EPIGRAPH  \{ .rr #EPIGRAPH  \}
6674 .    if r#Q_FITS    \{ .rr #Q_FITS    \}
6675 .    if r#END_QUOTE \{ .rr #END_QUOTE \}
6676 .    if r#LINEBREAK \{ .rr #LINEBREAK \}
6677 .    nr #PP 0
6678 .    nr #HEAD 2
6679 .END
6680 \#
6681 \# ---Paragraph heads---
6682 \#
6683 \# PARAHEAD FAMILY
6684 \# ---------------
6685 \# *Argument:
6686 \#   <family to use in paraheads>
6687 \# *Function:
6688 \#   Creates or modifies string $PH_FAM.
6689 \# *Notes:
6690 \#   Default is same as running text.
6691 \#
6692 .MAC PARAHEAD_FAMILY END
6693 .    ds $PH_FAM \\$1
6694 .END
6695 \#
6696 \#
6697 \# PARAHEAD FONT
6698 \# -------------
6699 \# *Argument:
6700 \#   <font to use in paraheads>
6701 \# *Function:
6702 \#   Creates or modifies string $PH_FT.
6703 \# *Notes:
6704 \#   Default is bold italic for TYPESET; underlined for TYPEWRITE.
6705 \#
6706 .MAC PARAHEAD_FONT END
6707 .    ds $PH_FT \\$1
6708 .END
6709 \#
6710 \#
6711 \# PARAHEAD SIZE
6712 \# -------------
6713 \# *Argument:
6714 \#   <+|- number of points by which to in/decrease point size of subheads
6715 \#   (relative to running text)>
6716 \# *Function:
6717 \#   Creates or modifies string $PH_SIZE_CHANGE.
6718 \# *Notes:
6719 \#   Must be preceded by a +|- sign.  No space afterwards.
6720 \#   Fractional point sizes are allowed.  No unit of measure, please.
6721 \#   Default is +.5 for printstyle TYPESET; +0 for TYPEWRITE.
6722 \#
6723 .MAC PARAHEAD_SIZE END
6724 .    ds $PH_SIZE_CHANGE \\$1
6725 .END
6726 \#
6727 \#
6728 \# PARAHEAD INDENT
6729 \# ---------------
6730 \# *Argument:
6731 \#   <size of indent>
6732 \# *Function:
6733 \#   Creates or modifies register #PH_INDENT.
6734 \# *Notes:
6735 \#   Default is 1/2 #PP_INDENT for TYPESET and TYPEWRITE.
6736 \#
6737 .MAC PARAHEAD_INDENT END
6738 .    nr #PH_INDENT (\\$1)
6739 .END
6740 \#
6741 \#
6742 \# PARAHEAD
6743 \# --------
6744 \# *Arguments:
6745 \#   "<para head>"
6746 \# *Function:
6747 \#   Deposits a paragraph head at the start and into the body of a
6748 \#   paragraph.
6749 \# *Notes:
6750 \#   PARAHEAD *must* come after PP.
6751 \#
6752 .MAC PARAHEAD END
6753 .    if \\n[#SLANT_ON] \{\
6754 .       nr #SLANT_WAS_ON 1
6755 \E*[SLANTX]
6756 .    \}
6757 .    ie \\n[#PP]=1 \{\
6758 .       if \\n[#INDENT_FIRST_PARAS] \{\
6759 .          ti \\n[#PH_INDENT]u
6760 .       \}
6761 .    \}
6762 .    el \{ .ti \\n[#PH_INDENT]u \}
6763 .    if \\n[#PRINT_STYLE]=1 \{\
6764 .       fam C
6765 .       ft  R
6766 .       ps  12
6767 .       UNDERLINE OFF
6768 .       ie \\n[#NUMBER_PH] \{\
6769 .          if \\n[#NUMBER_HEAD] \{\
6770 .             ie \\n[#NUMBER_SH] \{\
6771 .                UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1"
6772 \0
6773 .             \}
6774 .             el \{\
6775 .                UNDERSCORE "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\\ \\$1
6776 \0
6777 .             \}
6778 .          \}
6779 .          ie \\n[#NUMBER_SH] \{\
6780 .             if !\\n[#NUMBERED] \{\
6781 .                UNDERSCORE "\\n[#SH_NUM].\\n+[#PH_NUM].\\ \\$1
6782 \0
6783 .             \}
6784 .          \}
6785 .          el \{\
6786 .             if !\\n[#NUMBERED] \{\
6787 .                UNDERSCORE "\\n+[#PH_NUM].\\ \\$1
6788 \0
6789 .             \}
6790 .          \}
6791 .       \}
6792 .       el \{\
6793 .          UNDERSCORE "\\$1
6794 \0
6795 .       \}
6796 .       if \\n[#SLANT_WAS_ON] \{\
6797 .          if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
6798 .          if \\n[#SLANT_MEANS_SLANT] \{\
6799 \E*[SLANT]\c
6800 .          \}
6801 .          rr #SLANT_WAS_ON
6802 .       \}
6803 .    \}
6804 .    if \\n[#PRINT_STYLE]=2 \{\
6805 .       FAM     \\*[$PH_FAM]
6806 .       FT      \\*[$PH_FT]
6807 .       PT_SIZE \\*[$PH_SIZE_CHANGE]
6808 .       ie \\n[#NUMBER_PH] \{\
6809 .          if \\n[#NUMBER_HEAD] \{\
6810 .             ie \\n[#NUMBER_SH] \{\
6811 .                PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
6812 .             \}
6813 .             el \{\
6814 .                PRINT "\R'#NUMBERED 1'\\n[#HEAD_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
6815 .             \}
6816 .          \}
6817 .          ie \\n[#NUMBER_SH] \{\
6818 .             if !\\n[#NUMBERED] \{\
6819 .                PRINT "\\n[#SH_NUM].\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
6820 .             \}
6821 .          \}
6822 .          el \{\
6823 .             if !\\n[#NUMBERED] \{\
6824 .                PRINT "\\n+[#PH_NUM].\0\\$1\h'.6m'\c"
6825 .             \}
6826 .          \}
6827 .       \}
6828 .       el \{\
6829 .          PRINT "\\$1\h'.6m'\c"
6830 .       \}
6831 .       FAMILY  \\*[$DOC_FAM]
6832 .       FT      \\*[$PP_FT]
6833 .       PT_SIZE \\n[#DOC_PT_SIZE]u
6834 .       if \\n[#SLANT_WAS_ON] \{\
6835 .          rr #SLANT_WAS_ON 1
6836 \E*[SLANT]\c
6837 .       \}
6838 .    \}
6839 .    rr #NUMBERED
6840 .END
6841 \#
6842 \#
6843 \# ====================================================================
6844 \#
6845 \# +++LINE BREAKS+++
6846 \#
6847 \# LINEBREAK CHARACTER
6848 \# -------------------
6849 \# *Arguments:
6850 \#   [character] [iterations] [vertical adjustment]
6851 \# *Function:
6852 \#   Allows user to specify a line break character and the number
6853 \#   of times to repeat it horiontally.
6854 \# *Notes:
6855 \#   Without an argument, LINEBREAK_CHAR will deposit a blank line.
6856 \#
6857 \#   Vertical adjustment requires a unit of measure (most likely
6858 \#   "p"), and has to be preceded by +|-
6859 \#
6860 .MAC LINEBREAK_CHAR END
6861 .    nr #REPEAT 1
6862 .    ds $LINEBREAK_CHAR \\$1
6863 .    ds $LINEBREAK_CHAR_V_ADJ \\$3
6864 .    if '\\*[$LINEBREAK_CHAR_V_ADJ]'' \{\
6865 .       ds $LINEBREAK_CHAR_V_ADJ +0
6866 .    \}
6867 .    while \\$2>\\n[#REPEAT] \{\
6868 .       as $LINEBREAK_CHAR "\\ \\$1
6869 .       nr #REPEAT \\n[#REPEAT]+1
6870 .    \}
6871 .   rr #REPEAT
6872 .END
6873 \#
6874 \#
6875 \# LINE BREAK
6876 \# ----------
6877 \# *Arguments:
6878 \#   <none>
6879 \# *Function:
6880 \#   Deposits line break character.
6881 \# *Notes:
6882 \#   If $LINEBREAK_CHAR is blank, simply advances 2 line spaces.
6883 \#
6884 .MAC LINEBREAK END
6885 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
6886 .    po \\n[#DOC_L_MARGIN]u
6887 .    ie  '\\*[$LINEBREAK_CHAR]'' \{ .ALD \\n[#DOC_LEAD]u*2 \}
6888 .    el \{\
6889 .       if \\n[#PRINT_STYLE]=1 \{\
6890 .          ie \\n[#END_QUOTE] \{ . \}
6891 .          el \{ .ALD \\n[#DOC_LEAD]u \}
6892 .       \}
6893 .       if \\n[#PRINT_STYLE]=2 \{\
6894 .          ie \\n[#END_QUOTE] \{ . \}
6895 .          el \{ .ALD \\n[#DOC_LEAD]u \}
6896 .       \}
6897 .       CENTER
6898 .       PRINT \\v'\\*[$LINEBREAK_CHAR_V_ADJ]'\\*[$LINEBREAK_CHAR]\\v'\\*[$LINEBREAK_CHAR_V_ADJ]'
6899 .       if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
6900 .       if \\n[#PRINT_STYLE]=2 \{ .ALD \\n[#DOC_LEAD]u \}
6901 .       QUAD \\*[$DOC_QUAD]
6902 .    \}
6903 .    nr #LINEBREAK 1
6904 .    if r#QUOTE     \{ .rr #QUOTE     \}
6905 .    if r#END_QUOTE \{ .rr #END_QUOTE \}
6906 .    nr #PP 0
6907 .END
6908 \#
6909 \# ====================================================================
6910 \#
6911 \# +++PARAGRAPHS+++
6912 \#
6913 \# PARAGRAPH FONT
6914 \# --------------
6915 \# *Argument:
6916 \#   <font of running text>
6917 \# *Function:
6918 \#   Creates or modifies string $PP_FT.
6919 \# *Notes:
6920 \#   Affects all paragraphs.
6921 \#
6922 .MAC PP_FONT END
6923 .    if \\n[#IGNORE] \{ .return \}
6924 .    br
6925 .    ds $PP_FT \\$1
6926 .    FT \\*[$PP_FT]
6927 .END
6928 \#
6929 \#
6930 \# PARAGRAPH INDENT
6931 \# ----------------
6932 \# *Argument:
6933 \#   <amount to indent paragraphs in running text (ipPcm)>
6934 \# *Function:
6935 \#   Allows user to change the default para indent.  The change will
6936 \#   affect the indent of QUOTEs and BLOCKQUOTEs as well.
6937 \# *Notes:
6938 \#   Default for printstyle TYPEWRITE is 1/2-inch.  Default for
6939 \#   printstyle TYPESET is 2 ems.  The defaults are set in
6940 \#   PRINTSTYLE, not DEFAULTS.
6941 \#
6942 .MAC PARA_INDENT END
6943 .    nr #PP_INDENT (\\$1)
6944 .END
6945 \#
6946 \#
6947 \# INDENT FIRST PARAGRAPHS
6948 \# -----------------------
6949 \# *Arguments:
6950 \#   <none> | <anything>
6951 \# *Function:
6952 \#   By default, the first para of a document, as well as the first
6953 \#   paras of blockquotes and block-style epigraphs are not indented.
6954 \#   When invoked, this macro will indent all paras.
6955 \# *Notes:
6956 \#   Default is OFF.
6957 \#
6958 .MAC INDENT_FIRST_PARAS END
6959 .    ie '\\$1'' \{ .nr #INDENT_FIRST_PARAS 1 \}
6960 .    el \{ .rr #INDENT_FIRST_PARAS   \}
6961 .END
6962 \#
6963 \#
6964 \# INTER-PARAGRAPH SPACING
6965 \# -----------------------
6966 \# *Arguments:
6967 \#   <none> | <anything>
6968 \# *Function:
6969 \#   Adds a line space between paragraphs in body text.  Block quotes
6970 \#   are unaffected.
6971 \# *Notes:
6972 \#   Default is OFF.  PARA_SPACE ON is not recommended for use
6973 \#   with PRINTSTYLE TYPEWRITE.
6974 \#
6975 .MAC PARA_SPACE END
6976 .    ie '\\$1'' \{ .nr #PP_SPACE 1 \}
6977 .    el \{ .rr #PP_SPACE   \}
6978 .END
6979 \#
6980 \#
6981 \# PARAGRAPH
6982 \# ---------
6983 \# *Arguments:
6984 \#   <none>
6985 \# *Function:
6986 \#   Figures out what to do with paragraphs under differing conditions.
6987 \# *Notes:
6988 \#   For the time being, there's no automatic widow/orphan control.
6989 \#   Controlling them isn't just a matter of establishing an arbitrary
6990 \#   number of lines needed for a para, since groff doesn't then
6991 \#   handle single line paragraphs gracefully.  Usually, the whole
6992 \#   page needs to be tweaked.
6993 \#
6994 \#   Note the use of transparent line break (\!.br) to get
6995 \#   PP to work within blockquotes and epigraphs.
6996 \#
6997 \#   PP_STYLE 1 = regular paras; 2 = blockquotes, epigraphs
6998 \#
6999 .MAC PP END
7000 .    br
7001 .    if \\n[#DOC_TYPE]=4 \{\
7002 .       if !'\\n(.z'' \{ .di \}
7003 .       if \\n[#DATE] \{\
7004 .          nf
7005 .          DATE
7006 .          QUAD \\*[$DOC_QUAD]
7007 .          ALD \\n[#DOC_LEAD]u*2u
7008 .          rr #DATE
7009 .       \}
7010 .       if \\n[#TO] \{\
7011 .          nf
7012 .          TO_ADDRESS
7013 .          ALD \\n[#DOC_LEAD]u
7014 .          rr #TO
7015 .       \}
7016 .       if \\n[#FROM] \{\
7017 .          nf
7018 .          FROM_ADDRESS
7019 .          ALD \\n[#DOC_LEAD]u
7020 .          rr #FROM
7021 .       \}
7022 .       if \\n[#GREETING] \{\
7023 .          nf
7024 .          GREETING
7025 .          ALD \\n[#DOC_LEAD]u
7026 .          rr #GREETING
7027 .       \}
7028 .    \}
7029 .    rr #PP_ACTIVE
7030 .    if r#Q_AT_TOP \{ .rr #Q_AT_TOP \}
7031 .    if \\n[#PP_STYLE]=1 \{\
7032 .       if \\n[#ENDNOTE] \{\
7033 .          nr #RESET_PARA_SPACE \\n[#PP_SPACE]
7034 .          ie \\n[#EN_PP_SPACE] \{ .PARA_SPACE \}
7035 .          el \{ .PARA_SPACE OFF \}
7036 .       \}
7037 .       br
7038 .       if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
7039 .       if \\n[#COLUMNS] \{\
7040 .          if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
7041 .       \}
7042 .       if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
7043 .       ie \\n[#PRINT_STYLE]=1 \{\
7044 .          fam C
7045 .          ft  R
7046 .          ps  12
7047 .          vs   \\n[#DOC_LEAD]u
7048 .          QUAD \\*[$DOC_QUAD]
7049 .          UNDERLINE OFF
7050 .          if \\n[#SLANT_ON] \{\
7051 .             if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
7052 .          \}
7053 .       \}
7054 .       el \{\
7055 .          ie \\n[#ENDNOTE] \{\
7056 .             FAMILY  \\*[$EN_FAM]
7057 .             FT      \\*[$EN_FT]
7058 .             PT_SIZE \\n[#EN_PS]u
7059 .             LS      \\n[#DOC_LEAD]u
7060 .             QUAD    \\*[$EN_QUAD]
7061 .          \}
7062 .          el \{\
7063 .             FAMILY  \\*[$DOC_FAM]
7064 .             FT      \\*[$PP_FT]
7065 .             PT_SIZE \\n[#DOC_PT_SIZE]u
7066 .             LS      \\n[#DOC_LEAD]u
7067 .             QUAD    \\*[$DOC_QUAD]
7068 .          \}
7069 .       \}
7070 .       ie \\n[#PP]=0 \{\
7071 .          if \\n[#INDENT_FIRST_PARAS] \{\
7072 .             ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7073 .             el \{ .ti \\n[#PP_INDENT]u \}
7074 .             if '\\n(.z'END_NOTES' \{\
7075 .                ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7076 .             \}
7077 .          \}
7078 .          if r#END_QUOTE \{\
7079 .             if \\n[#END_QUOTE] \{\
7080 .                if !\\n[#LINEBREAK] \{\
7081 .                   ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7082 .                   el \{ .ti \\n[#PP_INDENT]u \}
7083 .                   if '\\n(.z'END_NOTES' \{\
7084 .                      ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7085 .                   \}
7086 .                \}
7087 .             \}
7088 .          \}
7089 .       \}
7090 .       el \{\
7091 .          br
7092 .          if \\n[#PP_SPACE] \{\
7093 .             if \\n[#PRINT_STYLE]=2 \{\
7094 .                ie \\n[#END_QUOTE] \{\
7095 .                   rr #END_QUOTE
7096 .                \}
7097 .                el \{ .ALD \\n[#DOC_LEAD]u \}
7098 .             \}
7099 .          \}
7100 .          ie \\n[#INDENT_ACTIVE] \{ .ti \\n[#INDENT]u+\\n[#PP_INDENT]u \}
7101 .          el \{ .ti \\n[#PP_INDENT]u \}
7102 .          if '\\n(.z'END_NOTES' \{\
7103 .             ti \\n[#EN_PP_INDENT]u+\\n[#EN_TEXT_INDENT]u
7104 .          \}
7105 .       \}
7106 .       if r#START     \{ .rr #START     \}
7107 .       if r#QUOTE     \{ .rr #QUOTE     \}
7108 .       if r#END_QUOTE \{ .rr #END_QUOTE \}
7109 .       if r#HEAD      \{ .rr #HEAD      \}
7110 .       if r#EPIGRAPH  \{ .rr #EPIGRAPH  \}
7111 .       if r#Q_FITS    \{ .rr #Q_FITS    \}
7112 .       if r#LINEBREAK \{ .rr #LINEBREAK \}
7113 .       if \\n[#ENDNOTE] \{\
7114 .           ie \\n[#RESET_PARA_SPACE] \{ .PARA_SPACE \}
7115 .           el \{ .PARA_SPACE OFF \}
7116 .       \}
7117 .       if \\n[#CONDENSE] \{\
7118 \E*[COND]\c
7119 .       \}
7120 .       if \\n[#EXTEND]=1 \{\
7121 \E*[EXT]\c
7122 .       \}
7123 .       nr #PP +1
7124 .    \}
7125 .    if \\n[#PP_STYLE]=2 \{\
7126 \!.     br
7127 .       if \\n[#BROKEN_QUOTE] \{\
7128 .          ie \\n(nl=\\n[#PAGE_TOP] \{ .nr #Q_PP 1 \}
7129 .          el \{ .nr #Q_PP 0 \}
7130 .          rr #BROKEN_QUOTE
7131 .       \}
7132 .       ie \\n[#Q_PP]=0 \{\
7133 .          if \\n[#INDENT_FIRST_PARAS] \{\
7134 .             ti \\n[#PP_INDENT]u/2u
7135 .          \}
7136 .          if \\n[#ENDNOTE] \{\
7137 .             ie \\n[#INDENT_FIRSTS] \{ .ti \\n[#PP_INDENT]u/2u \}
7138 .             el \{ .ti 0 \}
7139 .          \}
7140 .       \}
7141 .       el \{\
7142 .          ti \\n[#PP_INDENT]u/2u
7143 .       \}
7144 .       if \\n[#CONDENSE] \{\
7145 \E*[COND]\c
7146 .       \}
7147 .       if \\n[#EXTEND]=1 \{\
7148 \E*[EXT]\c
7149 .       \}
7150 .    nr #Q_PP +1
7151 .    \}
7152 .    nr #PP_ACTIVE 1
7153 .END
7154 \#
7155 \# ====================================================================
7156 \#
7157 \# +++QUOTES+++
7158 \#
7159 \# ---Line for line (poetic) quotes---
7160 \#
7161 \# QUOTE FAMILY
7162 \# ------------
7163 \# *Argument:
7164 \#   <family to use in line for line quotes>
7165 \# *Function:
7166 \#   Creates or modifies string $QUOTE_FAM.
7167 \# *Notes:
7168 \#   Default is same as running text.
7169 \#
7170 .MAC QUOTE_FAMILY END
7171 .    ds $QUOTE_FAM \\$1
7172 .END
7173 \#
7174 \#
7175 \# QUOTE FONT
7176 \# ----------
7177 \# *Argument:
7178 \#   <font to use in line for line quotes>
7179 \# *Function:
7180 \#   Creates or modifies string $QUOTE_FT.
7181 \# *Notes:
7182 \#   Default is italic for TYPESET.
7183 \#
7184 .MAC QUOTE_FONT END
7185 .    ds $QUOTE_FT \\$1
7186 .END
7187 \#
7188 \#
7189 \# QUOTE SIZE
7190 \# ----------
7191 \# *Argument:
7192 \#   <-|+ number of points by which to de/increase point size of
7193 \#   line for line quotes (relative to running text)>
7194 \# *Function:
7195 \#   Creates or modifies string $QUOTE_SIZE_CHANGE.
7196 \# *Notes:
7197 \#   Must be preceded by a - or + sign with no space afterwards.
7198 \#   Fractional point sizes are allowed.
7199 \#   Default is +0.
7200 \#
7201 .MAC QUOTE_SIZE END
7202 .    ds $QUOTE_SIZE_CHANGE \\$1
7203 .END
7204 \#
7205 \#
7206 \# UNDERLINE QUOTES
7207 \# ----------------
7208 \# *Arguments:
7209 \#   <none> | <anything>
7210 \# *Function:
7211 \#   Creates or modifies register #UNDERLINE_QUOTES (toggle).
7212 \#   If on, line for line quotes are underlined when printstyle
7213 \#   is TYPEWRITE.
7214 \# *Notes:
7215 \#   Default is ON for printstyle TYPEWRITE.
7216 \#
7217 .MAC UNDERLINE_QUOTES END
7218 .    ie '\\$1'' \{ .nr #UNDERLINE_QUOTES 1 \}
7219 .    el \{ .rr #UNDERLINE_QUOTES   \}
7220 .END
7221 \#
7222 \#
7223 \# QUOTE INDENT
7224 \# ------------
7225 \# *Argument:
7226 \#   <value by which to multiply PP_INDENT for indented quoted text>
7227 \# *Function:
7228 \#   Creates or modifies register #Q_OFFSET_VALUE.
7229 \# *Notes:
7230 \#   Default is 3 for typeset; 2 for typewrite
7231 \#
7232 .MAC QUOTE_INDENT END
7233 .    nr #Q_OFFSET_VALUE \\$1
7234 .END
7235 \#
7236 \#
7237 \# ALWAYS FULLSPACE QUOTES
7238 \# -----------------------
7239 \# *Arguments:
7240 \#   <none> | <anything>
7241 \# *Function:
7242 \#   Toggles register #FULLSPACE_QUOTES.
7243 \# *Notes:
7244 \#   If user doesn't like the default 1/2 line space above and below
7245 \#   quotes, s/he can turn it off here.  Has no effect in TYPEWRITE.
7246 \#
7247 .MAC ALWAYS_FULLSPACE_QUOTES END
7248 .    if '\\$1'' \{ .nr #FULLSPACE_QUOTES 1 \}
7249 .    el \{ .rr #FULLSPACE_QUOTES \}
7250 .END
7251 \#
7252 \#
7253 \# QUOTE
7254 \# -----
7255 \# *Arguments:
7256 \#   <none> | <anything>
7257 \# *Function:
7258 \#   Indents quoted text on a line for line basis, or turns QUOTE off.
7259 \# *Notes:
7260 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
7261 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
7262 \#   how much space to put before and after.
7263 \#
7264 .MAC QUOTE END
7265 .    br
7266 \# **Uncomment the next line to prevent orphaned quote lines.
7267 \#.  ne 1
7268 .    ie '\\$1'' \{\
7269 .       ev QUOTE
7270 .       nr #QUOTE 1
7271 .       di P_QUOTE
7272 .       ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7273 .       ta \\n(.lu
7274 .       if \\n[#COLUMNS] \{\
7275 .          ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u)
7276 .          ta \\n(.lu
7277 .       \}
7278 .       if \\n[#PRINT_STYLE]=1 \{\
7279 .          fam C
7280 .          ft  R
7281 .          ps 12
7282 .          vs \\n[#DOC_LEAD]u
7283 .          LEFT
7284 .       \}
7285 .       if \\n[#PRINT_STYLE]=2 \{\
7286 .          FAMILY  \\*[$QUOTE_FAM]
7287 .          FT      \\*[$QUOTE_FT]
7288 .          PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$QUOTE_SIZE_CHANGE]
7289 .          LS      \\n[#DOC_LEAD]u
7290 .          LEFT
7291 .       \}
7292 .       nr #Q_TOP \\n(nl
7293 .       if \\n[#PRINT_STYLE]=1 \{\
7294 .          if \\n[#UNDERLINE_QUOTES] \{\
7295 .               FT I
7296 .          \}
7297 .       \}
7298 .    \}
7299 .    el \{ .DO_QUOTE \}
7300 .END
7301 \#
7302 \#
7303 \# ---Blockquotes---
7304 \#
7305 \# BLOCKQUOTE FAMILY
7306 \# -----------------
7307 \# *Argument:
7308 \#   <family to use in blockquotes>
7309 \# *Function:
7310 \#   Creates or modifies string $BQUOTE_FAM.
7311 \# *Notes:
7312 \#   Default is same as running text.
7313 \#
7314 .MAC BLOCKQUOTE_FAMILY END
7315 .    ds $BQUOTE_FAM \\$1
7316 .END
7317 \#
7318 \#
7319 \# BLOCKQUOTE FONT
7320 \# ---------------
7321 \# *Argument:
7322 \#   <font to use in blockquotes>
7323 \# *Function:
7324 \#   Creates or modifies string $BQUOTE_FT.
7325 \# *Notes:
7326 \#   Default is same as running text.
7327 \#
7328 .MAC BLOCKQUOTE_FONT END
7329 .    ds $BQUOTE_FT \\$1
7330 .END
7331 \#
7332 \#
7333 \# BLOCKQUOTE SIZE
7334 \# ---------------
7335 \# *Argument:
7336 \#   <-|+ number of points by which to de/increase point size of blockquotes
7337 \#   (relative to running text)>
7338 \# *Function:
7339 \#   Creates or modifies string $BQUOTE_SIZE_CHANGE.
7340 \# *Notes:
7341 \#   Must be preceded by a - or + sign with no space afterwards.
7342 \#   Fractional point sizes are allowed.
7343 \#   Default is -1 for printstyle TYPESET; +0 for TYPEWRITE.
7344 \#
7345 .MAC BLOCKQUOTE_SIZE END
7346 .    ds $BQUOTE_SIZE_CHANGE \\$1
7347 .END
7348 \#
7349 \#
7350 \# BLOCKQUOTE QUAD
7351 \# ---------------
7352 \# *Arguments:
7353 \#   <quad to use in blockquotes>
7354 \# *Function:
7355 \#   Creates or modifies string $BQUOTE_QUAD.
7356 \# *Notes:
7357 \#   Default is LEFT.
7358 \#
7359 .MAC BLOCKQUOTE_QUAD END
7360 .    ds $BQUOTE_QUAD \\$1
7361 .END
7362 \#
7363 \#
7364 \# BLOCKQUOTE
7365 \# ----------
7366 \# *Arguments:
7367 \#   <none> | <anything>
7368 \# *Function:
7369 \#   Indents quoted text in fill mode and shortens line length
7370 \#   accordingly, or turns BLOCKQUOTE off.
7371 \# *Notes:
7372 \#   Owing to the need to bottom align TYPESET pages, quoted text gets
7373 \#   diverted so its depth can be measured (in DO_QUOTE) for determining
7374 \#   how much space to put before and after.
7375 \#
7376 \#   .PP after blockquote is optional if there's only one para,
7377 \#   but REQUIRED if there's more than one.
7378 \#
7379 .MAC BLOCKQUOTE END
7380 .    br
7381 .    ie '\\$1'' \{\
7382 .       ev BLOCKQUOTE
7383 .       nr #QUOTE    2
7384 .       nr #PP_STYLE 2
7385 .       nr #Q_PP     0
7386 .       di B_QUOTE
7387 .       ll \\n[#L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7388 .       if \\n[#ENDNOTE] \{\
7389 .          if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
7390 .             ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7391 .          \}
7392 .          if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
7393 .             ll \\n[#L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7394 .          \}
7395 .       \}
7396 .       ta \\n(.lu
7397 .       CHECK_INDENT
7398 .       if \\n[#COLUMNS] \{\
7399 .          ll \\n[#COL_L_LENGTH]u-(\\n[#PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7400 .          if \\n[#ENDNOTE] \{\
7401 .             if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
7402 .                ll \\n[#RESET_L_LENGTH]u-\\n[#EN_TEXT_INDENT]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7403 .             \}
7404 .             if \\n[#EN_NUMBERS_ALIGN_LEFT] \{\
7405 .                ll \\n[#COL_L_LENGTH]u-(\\n[#EN_PP_INDENT]u*(\\n[#Q_OFFSET_VALUE]u*2u))
7406 .             \}
7407 .          \}
7408 .          ta \\n(.lu
7409 .       \}
7410 .       if \\n[#PRINT_STYLE]=1 \{\
7411 .          fam C
7412 .          ft  R
7413 .          ps  12
7414 .          vs  \\n[#DOC_LEAD]u
7415 .          QUAD LEFT
7416 .          HY OFF
7417 .       \}
7418 .       if \\n[#PRINT_STYLE]=2 \{\
7419 .          FAMILY  \\*[$BQUOTE_FAM]
7420 .          FT      \\*[$BQUOTE_FT]
7421 .          PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$BQUOTE_SIZE_CHANGE]
7422 .          LS      \\n[#DOC_LEAD]u
7423 .          if \\n[#ENDNOTE] \{\
7424 .             PT_SIZE \\n[#EN_PS]u\\*[$BQUOTE_SIZE_CHANGE]
7425 .          \}
7426 .          QUAD    \\*[$BQUOTE_QUAD]
7427 .          HY
7428 .       \}
7429 .       nr #Q_TOP \\n(nl
7430 .       if \\n[#INDENT_FIRST_PARAS] \{\
7431 .          ie !\\n[#ENDNOTE] \{\
7432 .             if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#PP_INDENT]u/2u \}
7433 .             if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#PP_INDENT]u/2u \}
7434 .          \}
7435 .          el \{\
7436 .             if \\n[#INDENT_FIRSTS]=1 \{\
7437 .                if \\n[#PRINT_STYLE]=1 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
7438 .                if \\n[#PRINT_STYLE]=2 \{ .ti \\n[#EN_PP_INDENT]u/2u \}
7439 .             \}
7440 .          \}
7441 .       \}
7442 .    \}
7443 .    el \{ .DO_QUOTE \}
7444 .END
7445 \#
7446 \#
7447 \# DO QUOTE
7448 \# --------
7449 \# *Arguments:
7450 \#   <none>
7451 \# *Function:
7452 \#   Ends the diversion P_QUOTE or B_QUOTE.  Spaces them according to
7453 \#   PRINT_STYLE, whether there's inter-paragraph spacing, and page
7454 \#   position.  TYPEWRITE treats spacing the same way in all circumstance
7455 \#   (viz. an extra line space).  TYPESET puts in only half
7456 \#   line spaces if the entire quote plus 1 line of body under the quote
7457 \#   fits on the the page; otherwise it puts in a full extra blank
7458 \#   line.  (This is to ensure the page remains bottom aligned).
7459 \#
7460 .MAC DO_QUOTE END
7461 .    di
7462 .    REMOVE_INDENT
7463 .    ev
7464 \#   **Change *1 to *2 in next line to prevent orphans after quotes
7465 .    if \\n[#ENDNOTE] \{\
7466 .       nr #RESET_QUOTE_SPACING \\n[#FULLSPACE_QUOTES]
7467 .       ALWAYS_FULLSPACE_QUOTES
7468 .    \}
7469 .    nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
7470 .    if \\n[#PRINT_STYLE]=1 \{\
7471 .       if \\n[#START]=1 \{ . \}
7472 .       if \\n[#START]=0 \{\
7473 .          if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7474 .       \}
7475 .       if \\n[#HEAD] \{\
7476 .          if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
7477 .       \}
7478 .    \}
7479 .    if \\n[#PRINT_STYLE]=2 \{\
7480 .       ie \\n[#PP_SPACE] \{\
7481 .          ie \\n[#HEAD]>0 \{ . \}
7482 .          el \{\
7483 .             ie \\n[#START] \{ . \}
7484 .             el \{ .ALD \\n[#DOC_LEAD]u \}
7485 .          \}
7486 .       \}
7487 .       el \{\
7488 .          ie \\n[#Q_DEPTH]<\\n[#TRAP_DISTANCE] \{\
7489 .             nr #Q_FITS 1
7490 .             ie \\n[#HEAD]=1 \{ . \}
7491 .             el \{\
7492 .                ie \\n[#START] \{ . \}
7493 .                el \{\
7494 .                   ie \\n[#FULLSPACE_QUOTES] \{\
7495 .                      ALD \\n[#DOC_LEAD]u
7496 .                   \}
7497 .                   el \{ .ALD \\n[#DOC_LEAD]u/2u \}
7498 .                \}
7499 .             \}
7500 .          \}
7501 .          el \{\
7502 .             rr #Q_FITS
7503 .             ie r#HEAD \{\
7504 .                if \\n[#HEAD]=1 \{ . \}
7505 .             \}
7506 .             el \{ .ALD \\n[#EN_LEAD]u \}
7507 .          \}
7508 .       \}
7509 .    \}
7510 .    nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
7511 .    if \\n[#COLUMNS] \{\
7512 .       nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
7513 .    \}
7514 .    if !\\n[#ENDNOTE] \{ .po \\n[#Q_OFFSET]u \}
7515 .    if \\n[#ENDNOTE] \{\
7516 .       in +\\n[#EN_PP_INDENT]u*\\n[#Q_OFFSET_VALUE]u
7517 .    \}
7518 .    if \\n[#QUOTE]=1 \{\
7519 .       nf
7520 .       P_QUOTE
7521 .       if !\\n[#START] \{ .rr #QUOTE \}
7522 .    \}
7523 .    if \\n[#QUOTE]=2 \{\
7524 .       nf
7525 .       B_QUOTE
7526 .    \}
7527 .    if \\n[#PRINT_STYLE]=1 \{\
7528 .       ALD \\n[#DOC_LEAD]u
7529 .    \}
7530 .    if \\n[#PRINT_STYLE]=2 \{\
7531 .       ie \\n[#START] \{\
7532 .          ie \\n[#PP_SPACE] \{ . \}
7533 .          el \{ .ALD \\n[#DOC_LEAD]u \}
7534 .       \}
7535 .       el \{\
7536 .          ie \\n[#PP_SPACE] \{ . \}
7537 .          el \{\
7538 .             ie \\n[#HEAD]=1 \{ .ALD \\n[#DOC_LEAD]u \}
7539 .             el \{\
7540 .                ie \\n[#Q_FITS] \{\
7541 .                    ie \\n[#Q_TOP]=\\n[#PAGE_TOP] \{\
7542 .                       nr #Q_AT_TOP 1
7543 .                       ALD \\n[#DOC_LEAD]u
7544 .                    \}
7545 .                    el \{\
7546 .                       ie \\n[#FULLSPACE_QUOTES] \{ .ALD \\n[#DOC_LEAD]u \}
7547 .                       el \{ .ALD \\n[#DOC_LEAD]u/2u \}
7548 .                    \}
7549 .                \}
7550 .                el \{ .ALD \\n[#DOC_LEAD]u \}
7551 .             \}
7552 .          \}
7553 .       \}
7554 .    \}
7555 .    if \\n[#ENDNOTE] \{ .nr #FULLSPACE_QUOTES \\n[#RESET_QUOTE_SPACING] \}
7556 .    if r#HEAD     \{ .rr #HEAD     \}
7557 .    if r#EPIGRAPH \{ .rr #EPIGRAPH \}
7558 .    rr #Q_PP
7559 .    rr #LINEBREAK
7560 .    nr #PP_STYLE  1
7561 .    nr #END_QUOTE 1
7562 .    if !\\n[#ENDNOTE] \{ .po \\n[#L_MARGIN]u \}
7563 .    if \\n[#ENDNOTE] \{\
7564 .       in \\n[#EN_TEXT_INDENT]u
7565 .    \}
7566 .    if \\n[#COLUMNS] \{\
7567 .       if !\\n[#ENDNOTE] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
7568 .       if \\n[#ENDNOTE] \{\
7569 .          in \\n[#EN_TEXT_INDENT]u
7570 .       \}
7571 .    \}
7572 .    ie !\\n[#ENDNOTE] \{\
7573 .       nr #RESET_PP_INDENT \\n[#PP_INDENT]
7574 .       PARA_INDENT 0
7575 .       PP
7576 .       PARA_INDENT \\n[#RESET_PP_INDENT]u
7577 .       QUAD \\*[$DOC_QUAD]
7578 .    \}
7579 .    el \{\
7580 .       nr #RESET_EN_PP_INDENT \\n[#EN_PP_INDENT]
7581 .       ENDNOTE_PARA_INDENT 0
7582 .       PP
7583 .       ENDNOTE_PARA_INDENT \\n[#RESET_EN_PP_INDENT]u
7584 .       QUAD \\*[EN_QUAD]
7585 .    \}
7586 .END
7587 \#
7588 \# ====================================================================
7589 \#
7590 \# BREAK QUOTE
7591 \# -----------
7592 \# *Arguments:
7593 \#   <none>
7594 \# *Function:
7595 \#   Ends the diversion P_QUOTE or B_QUOTE, breaks to a new
7596 \#   page, and reinvokes BLOCKQUOTE.
7597 \# *Notes:
7598 \#   Because quotes go into a diversion before they're output,
7599 \#   footnotes in quotes that cross pages behave erratically.  The footnote
7600 \#   isn't processed until the diversion ends, hence the footnote
7601 \#   marker in the quote isn't always correct for the new page (it's
7602 \#   picked up from the old one).  BREAK_QUOTE is a workaround for
7603 \#   this problem.
7604 \#
7605 .MAC BREAK_QUOTE END
7606 .    br
7607 .    di
7608 .    nr #BROKEN_QUOTE 1
7609 .    REMOVE_INDENT
7610 .    ev
7611 .    nr #Q_DEPTH \\n[#DIVER_DEPTH]+(\\n[#LEAD]*1)
7612 .    if \\n[#PRINT_STYLE]=1 \{\
7613 .       if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7614 .       if \\n[#HEAD] \{\
7615 .          if \\n[#HEAD]=1 \{ .RLD \\n[#DOC_LEAD]u \}
7616 .       \}
7617 .    \}
7618 .    if \\n[#PRINT_STYLE]=2 \{\
7619 .       ie \\n[#PP_SPACE] \{\
7620 .          ie \\n[#HEAD]=1 \{ . \}
7621 .          el \{\
7622 .             if !\\n[#LINEBREAK] \{ .ALD \\n[#DOC_LEAD]u \}
7623 .          \}
7624 .       \}
7625 .       el \{\
7626 .          rr #Q_FITS
7627 .          ie r#HEAD \{\
7628 .             if \\n[#HEAD]=1 \{ . \}
7629 .          \}
7630 .          el \{ .ALD \\n[#DOC_LEAD]u \}
7631 .       \}
7632 .    \}
7633 .    nr #Q_OFFSET \\n[#L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE])
7634 .    if \\n[#COLUMNS] \{ .nr #Q_OFFSET \\n[#COL_\\n[#COL_NUM]_L_MARGIN]+(\\n[#PP_INDENT]*\\n[#Q_OFFSET_VALUE]) \}
7635 .    po \\n[#Q_OFFSET]u
7636 .    if \\n[#QUOTE]=1 \{\
7637 .       nf
7638 .       P_QUOTE
7639 .       if !\\n[#START] \{ .rr #QUOTE \}
7640 .    \}
7641 .    if \\n[#QUOTE]=2 \{\
7642 .       nf
7643 .       B_QUOTE
7644 .    \}
7645 .    if r#HEAD     \{ .rr #HEAD     \}
7646 .    if r#EPIGRAPH \{ .rr #EPIGRAPH \}
7647 .    rr #Q_PP
7648 .    rr #LINEBREAK
7649 .    nr #PP_STYLE  1
7650 .    nr #END_QUOTE 1
7651 .    if \\n[#PRINT_STYLE]=1 \{\
7652 .       if \\n[#UNDERLINE_QUOTES] \{\
7653 .          UNDERLINE OFF
7654 .       \}
7655 .    \}
7656 .    po \\n[#L_MARGIN]u
7657 .    if \\n[#COLUMNS] \{ .po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u \}
7658 .    QUAD \\*[$DOC_QUAD]
7659 .    sp |\\n[#PAGE_LENGTH]u  \" To trip footer/header
7660 .    BLOCKQUOTE
7661 .END
7662 \#
7663 \# ====================================================================
7664 \#
7665 \# +++PAGINATION+++
7666 \#
7667 \# PAGINATE
7668 \# --------
7669 \# *Arguments:
7670 \#   <none> | <anything>
7671 \# *Function:
7672 \#   Turns page numbering off or on.
7673 \# *Notes:
7674 \#   Page numbering is on by default with .PAPER.
7675 \#   Default is on.
7676 \#
7677 .MAC PAGINATE END
7678 .    ie '\\$1'' \{ .nr #PAGINATE 1 \}
7679 .    el \{ .nr #PAGINATE 0 \}
7680 .END
7681 \#
7682 \#
7683 \# PAGENUMBER FAMILY
7684 \# -----------------
7685 \# *Argument:
7686 \#   <family to use for page numbers>
7687 \# *Function:
7688 \#   Creates or modifies string $PAGE_NUM_FAM.
7689 \# *Notes:
7690 \#   Default is same as running text.
7691 \#
7692 .MAC PAGENUM_FAMILY END
7693 .    ds $PAGE_NUM_FAM \\$1
7694 .END
7695 \#
7696 \#
7697 \# PAGE NUMBER FONT
7698 \# ----------------
7699 \# *Arguments:
7700 \#   <font to use for page numbers>
7701 \# *Function:
7702 \#   Creates or modifies string $PAGE_NUM_FT.
7703 \# *Notes:
7704 \#   Default is same as running text.
7705 \#
7706 .MAC PAGENUM_FONT END
7707 .    ds $PAGE_NUM_FT \\$1
7708 .END
7709 \#
7710 \#
7711 \# PAGE NUMBER SIZE
7712 \# ----------------
7713 \# *Argument:
7714 \#   <+|- number of points by which to in/decrease point size of
7715 \#   page numbers (relative to running text)>
7716 \# *Function:
7717 \#   Creates or modifies string $PAGE_NUM_SIZE_CHANGE.
7718 \# *Notes:
7719 \#   Must be preceded by a +|- sign with no space afterward.
7720 \#   Fractional point sizes are allowed.
7721 \#   Default is +0.
7722 \#
7723 .MAC PAGENUM_SIZE END
7724 .    ds $PAGE_NUM_SIZE_CHANGE \\$1
7725 .END
7726 \#
7727 \#
7728 \# PAGE NUMBER FORMAT
7729 \# ------------------
7730 \# *Arguments:
7731 \#   DIGIT | ROMAN | roman | ALPHA | alpha
7732 \# *Function:
7733 \#   Assigns user entered format to #PAGENUMBER.
7734 \#
7735 .MAC PAGENUM_STYLE END
7736 .    nr #PAGENUM_STYLE_SET 1
7737 .    if '\\$1'DIGIT'  \{\
7738 .       ds $PAGENUM_STYLE \\$1
7739 .       af #PAGENUMBER 1
7740 .    \}
7741 .    if '\\$1'ROMAN'  \{\
7742 .       ds $PAGENUM_STYLE \\$1
7743 .       af #PAGENUMBER I
7744 .    \}
7745 .    if '\\$1'roman'  \{\
7746 .       ds $PAGENUM_STYLE \\$1
7747 .       af #PAGENUMBER i
7748 .    \}
7749 .    if '\\$1'ALPHA'  \{\
7750 .       ds $PAGENUM_STYLE \\$1
7751 .       af #PAGENUMBER A
7752 .    \}
7753 .    if '\\$1'alpha'  \{\
7754 .       ds $PAGENUM_STYLE \\$1
7755 .       af #PAGENUMBER a
7756 .    \}
7757 .END
7758 \#
7759 \#
7760 \# HYPHENS AROUND PAGE NUMBERS
7761 \# ---------------------------
7762 \# *Arguments:
7763 \#   <none> | <anything>
7764 \# *Function:
7765 \#   Creates or modifies register #PAGE_NUM_HYPHENS.
7766 \#   Used to dis/enable hyphens on either side of page numbers.
7767 \# *Notes:
7768 \#   Default is on.
7769 \#
7770 .MAC PAGENUM_HYPHENS END
7771 .    nr #PAGE_NUM_HYPHENS_SET 1
7772 .    ie '\\$1'' \{ .nr #PAGE_NUM_HYPHENS 1 \}
7773 .    el \{ .rr #PAGE_NUM_HYPHENS   \}
7774 .END
7775 \#
7776 \#
7777 \# PAGENUMBER POSITION
7778 \# -------------------
7779 \# *Arguments:
7780 \#   TOP | BOTTOM  LEFT | CENTER | RIGHT
7781 \# *Function:
7782 \#   Creates or modifies various PAGE_NUM_H | V_POS registers.
7783 \#   Used to position page numbers.
7784 \# *Notes:
7785 \#   Default is center/bottom.
7786 \#
7787 .MAC PAGENUM_POS END
7788 .    nr #PAGE_NUM_POS_SET 1
7789 .    if '\\$1'TOP'    \{ .nr #PAGE_NUM_V_POS 1 \}
7790 .    if '\\$1'BOTTOM' \{ .nr #PAGE_NUM_V_POS 2 \}
7791 .    if '\\$2'LEFT'   \{ .nr #PAGE_NUM_H_POS 1 \}
7792 .    if '\\$2'CENTER' \{ .nr #PAGE_NUM_H_POS 2 \}
7793 .    if '\\$2'CENTRE' \{ .nr #PAGE_NUM_H_POS 2 \}
7794 .    if '\\$2'RIGHT'  \{ .nr #PAGE_NUM_H_POS 3 \}
7795 .END
7796 \#
7797 \#
7798 \# PRINT PAGE NUMBER
7799 \# -----------------
7800 \# *Arguments:
7801 \#   <none>
7802 \# *Function:
7803 \#   Prints page number if PAGEINATE=1.
7804 \#
7805 .MAC PRINT_PAGE_NUMBER END
7806 .    ev PAGENUMBER
7807 .    po \\n[#DOC_L_MARGIN]u
7808 .    ll \\n[#DOC_L_LENGTH]u
7809 .    ta \\n(.lu
7810 .    FAMILY  \\*[$PAGE_NUM_FAM]
7811 .    FT      \\*[$PAGE_NUM_FT]
7812 .    PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$PAGE_NUM_SIZE_CHANGE]
7813 .    if \\n[#PRINT_STYLE]=1 \{\
7814 .       fam C
7815 .       ft  R
7816 .       ps 12
7817 .    \}
7818 .    if \\n[#PAGE_NUM_V_POS]=1 \{ .vs 0 \}
7819 .    if o \{\
7820 .       ie \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT  \}
7821 .       el                        \{ .RIGHT \}
7822 .    \}
7823 .    if e \{\
7824 .       ie \\n[#PAGE_NUM_H_POS]=1 \{ .RIGHT \}
7825 .       el                        \{ .LEFT  \}
7826 .    \}
7827 .    if \\n[#PAGE_NUM_H_POS]=2    \{.CENTER \}
7828 .    if \\n[#RECTO_VERSO]=0 \{\
7829 .       if \\n[#PAGE_NUM_H_POS]=1 \{ .LEFT   \}
7830 .       if \\n[#PAGE_NUM_H_POS]=2 \{ .CENTER \}
7831 .       if \\n[#PAGE_NUM_H_POS]=3 \{ .RIGHT  \}
7832 .    \}
7833 .    nr #PAGENUMBER \\n%+\\n[#PAGE_NUM_ADJ]
7834 .    ie \\n[#DRAFT_WITH_PAGENUM] \{\
7835 .       ie !\\n[#REVISION] \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT] / \\n[#PAGENUMBER]" \}
7836 .       el \{ .PRINT "\\*[$DRAFT_STRING] \\n[#DRAFT], \\*[$REVISION_STRING] \\n[#REVISION] / \\n[#PAGENUMBER]" \}
7837 .    \}
7838 .    el \{\
7839 .       ie \\n[#PAGE_NUM_HYPHENS] \{ .PRINT "- \\n[#PAGENUMBER] -" \}
7840 .       el \{ .PRINT "\\n[#PAGENUMBER]" \}
7841 .    \}
7842 .    ev
7843 .END
7844 \#
7845 \# ====================================================================
7846 \#
7847 \# +++FOOTNOTES+++
7848 \#
7849 \# FOOTNOTE FAMILY
7850 \# --------------
7851 \# *Argument:
7852 \#   <family to use in footnotes>
7853 \# *Function:
7854 \#   Creates or modifies string $FN_FAM.
7855 \# *Notes:
7856 \#   Default is same as running text.
7857 \#
7858 .MAC FOOTNOTE_FAMILY END
7859 .    ds $FN_FAM \\$1
7860 .END
7861 \#
7862 \#
7863 \# FOOTNOTE FONT
7864 \# --------------
7865 \# *Argument:
7866 \#   <font to use in footnotes>
7867 \# *Function:
7868 \#   Creates or modifies string $FN_FT.
7869 \# *Notes:
7870 \#   Default is roman.
7871 \#
7872 .MAC FOOTNOTE_FONT END
7873 .    ds $FN_FT \\$1
7874 .END
7875 \#
7876 \#
7877 \# FOOTNOTE SIZE
7878 \# ------------
7879 \# *Argument:
7880 \#   <+|- number of points by which to in/decrease point size of footnotes
7881 \#   (relative to running text)>
7882 \# *Function:
7883 \#   Creates or modifies string $FN_SIZE_CHANGE.
7884 \# *Notes:
7885 \#   Must be preceded by a +|- sign.  No space afterwards.
7886 \#   Fractional point sizes are allowed.
7887 \#   Default is -2 for printstyle TYPESET; +0 for TYPEWRITE.
7888 \#
7889 .MAC FOOTNOTE_SIZE END
7890 .    ds $FN_SIZE_CHANGE \\$1
7891 .END
7892 \#
7893 \#
7894 \# FOOTNOTE AUTOLEAD
7895 \# -----------------
7896 \# *Arguments:
7897 \#   <autolead value for footnotes>
7898 \# *Function:
7899 \#   Creates or modifies register #FN_AUTOLEAD.
7900 \# *Notes:
7901 \#   Default is #DOC_LEAD/2 for TYPEWRITE; 2 for TYPESET
7902 \#
7903 .MAC FOOTNOTE_AUTOLEAD END
7904 .    nr #FN_AUTOLEAD \\$1
7905 .END
7906 \#
7907 \#
7908 \# FOOTNOTE QUAD
7909 \# -------------
7910 \# *Arguments:
7911 \#   <quad to use in footnotes>
7912 \# *Function:
7913 \#   Creates or modifies string $FN_QUAD.
7914 \# *Notes:
7915 \#   Default is same as running text.
7916 \#
7917 .MAC FOOTNOTE_QUAD END
7918 .    ds $FN_QUAD \\$1
7919 .END
7920 \#
7921 \#
7922 \# FOOTNOTE MARKERS
7923 \# ----------------
7924 \# *Arguments:
7925 \#   <none> | <anything>
7926 \# *Function:
7927 \#   Turns generation of footnote markers on or off.
7928 \# *Notes:
7929 \#   Default is on.
7930 \#
7931 .MAC FOOTNOTE_MARKERS END
7932 .    ie '\\$1'' \{ .nr #FN_MARKERS 1 \}
7933 .    el \{ .nr #FN_MARKERS 0 \}
7934 .END
7935 \#
7936 \#
7937 \# FOOTNOTE MARKER STYLE
7938 \# ---------------------
7939 \# *Arguments:
7940 \#   STAR | NUMBER
7941 \# *Function:
7942 \#   Sets register #FN_MARKER_STYLE, used in FOOTNOTE to determine
7943 \#   the style of footnote markers.
7944 \# *Notes:
7945 \#   1=STAR; 2=NUMBER.  Default is STAR.
7946 \#
7947 .MAC FOOTNOTE_MARKER_STYLE END
7948 .    if '\\$1'STAR' \{\
7949 .       nr #FN_MARKER_STYLE 1
7950 .    \}
7951 .    if '\\$1'NUMBER' \{\
7952 .       nr #FN_MARKER_STYLE 2
7953 .    \}
7954 .END
7955 \#
7956 \#
7957 \# RESET FOOTNOTE NUMBER
7958 \# ---------------------
7959 \# *Arguments:
7960 \#   <none> | PAGE
7961 \# *Function:
7962 \#   Resets register #FN_NUMBER to 1.  If argument is PAGE, creates
7963 \#   toggle #RESET_FN_NUMBER which is checked in HEADER.  If 1,
7964 \#   numbered footnotes on every page start at 1.
7965 \#
7966 .MAC RESET_FOOTNOTE_NUMBER END
7967 .    ie '\\$1'' \{ .nr #FN_NUMBER 0 1 \}
7968 .    el \{ .nr #RESET_FN_NUMBER 1 \}
7969 .END
7970 \#
7971 \#
7972 \# FOOTNOTE RULE LENGTH
7973 \# --------------------
7974 \# *Arguments:
7975 \#   <length of rule used to separate footnotes from running text>
7976 \# *Function:
7977 \#   Creates or modifies registers #FN_RULE_LENGTH.
7978 \# *Notes:
7979 \#   Requires unit of measure (iPpcm).
7980 \#   Default is 4P for both PRINTSTYLEs.
7981 \#
7982 .MAC FOOTNOTE_RULE_LENGTH END
7983 .    nr #FN_RULE_LENGTH (\\$1)
7984 .END
7985 \#
7986 \#
7987 \# FOOTNOTE_RULE_ADJ
7988 \# -----------------
7989 \# *Arguments:
7990 \#   <number of points to raise footnote rule from it's baseline position>
7991 \# *Function:
7992 \#   Creates or modifies register #FN_RULE_ADJ.
7993 \# *Notes:
7994 \#   Default is 3p for both TYPESTYLES.
7995 \#
7996 \#   Requires unit of measure.
7997 \#
7998 .MAC FOOTNOTE_RULE_ADJ END
7999 .    nr #FN_RULE_ADJ (\\$1)
8000 .END
8001 \#
8002 \#
8003 \# FOOTNOTE RULE
8004 \# -------------
8005 \# *Arguments:
8006 \#   <none> | <anything>
8007 \# *Function:
8008 \#   Turns printing of footnote separator rule on or off.  If invoked as
8009 \#   PRINT_FOOTNOTE_RULE, prints footnote separator rule.
8010 \# *Notes:
8011 \#   Default is on.
8012 \#
8013 \#   Invoked in FOOTNOTE (as PRINT_FOOTNOTE_RULE) as 1st line of a footnote
8014 \#   if the footnote number (#FN_COUNT) is 1.
8015 \#
8016 .MAC FOOTNOTE_RULE END
8017 .    ie '\\$0'PRINT_FOOTNOTE_RULE' \{\
8018 .       if \\n[#FN_RULE]=0 \{ .RLD 1v \}
8019 \!.     PT_SIZE 12  \"Not sure why these have to be transparently embedded, but they do.
8020 .       RLD 1v
8021 .       LEFT
8022 .       PRINT \\v'-\\n[#FN_RULE_ADJ]u'\\l'\\n[#FN_RULE_LENGTH]u'\\v'+\\n[#FN_RULE_ADJ]u'
8023 \!.     PT_SIZE \\n[#DOC_PT_SIZE]u\\*$[FN_SIZE_CHANGE]
8024 .       QUAD \\*[$FN_QUAD]
8025 .    \}
8026 .    el \{\
8027 .       ie '\\$1'' \{ .nr #FN_RULE 1 \}
8028 .       el \{ .nr #FN_RULE 0 \}
8029 .    \}
8030 .END
8031 \#
8032 \#
8033 \# FOOTNOTE
8034 \# --------
8035 \# *Arguments:
8036 \#   <none> | INDENT  L|LEFT|R|RIGHT|B|BOTH  <indent value> > | <anything>
8037 \# *Function:
8038 \#   Begins collecting and diverting footnote text if no argument
8039 \#   given.  Otherwise, ends diversion FOOTNOTES, measures footnote
8040 \#   depth, and sets footnote trap.
8041 \# *Notes:
8042 \#   The input line preceding a footnote call MUST terminate with \c
8043 \#   or the footnote marker will be spaced away from the word it
8044 \#   should be joined to.
8045 \#
8046 \#   If FOOTNOTES is invoked with INDENT, the footnote will
8047 \#   be indented.  An indent style and an indent value must be given.
8048 \#   Subsequent footnotes will NOT be indented; INDENT must be given
8049 \#   for each footnote the user wants indented.
8050 \#
8051 .MAC FOOTNOTE END
8052 .    ie '\\$1'' \{\
8053 .       if \\n[#FN_MARKERS] \{\
8054 .          if \\n[#CONDENSE] \{ \*[CONDX]\c \}
8055 .          if \\n[#EXTEND]   \{ \*[EXTX]\c  \}
8056 .          if \\n[#PRINT_STYLE]=1 \{\
8057 .             if \\n[#UNDERLINE_ON] \{\
8058 .                nr #UNDERLINE_WAS_ON 1
8059 .                UNDERLINE OFF
8060 .             \}
8061 .          \}
8062 .          if !\\n[#NO_FN_MARKER] \{\
8063 .            if \\n[#FN_MARKER_STYLE]=1 \{\
8064 .               ie \\n[#FN_COUNT_FOR_COLS] \{\
8065 .                  if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU3]* \}
8066 .                  if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU3]\(dg \}
8067 .                  if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \*[BU3]** \}
8068 .                  if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
8069 .                  if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU3]*** \}
8070 .                  if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
8071 .                  if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU3]**** \}
8072 .                  if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
8073 .                  if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \*[BU3]***** \}
8074 .                  if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg \}
8075 .               \}
8076 .               el \{\
8077 .                  if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU3]* \}
8078 .                  if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU3]\(dg \}
8079 .                  if \\n[#FN_COUNT]=2 \{ .PRINT \*[BU3]** \}
8080 .                  if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU3]\(dg\(dg \}
8081 .                  if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU3]*** \}
8082 .                  if \\n[#FN_COUNT]=5 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
8083 .                  if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU3]**** \}
8084 .                  if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg \}
8085 .                  if \\n[#FN_COUNT]=8 \{ .PRINT \*[BU3]***** \}
8086 .                  if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU3]\(dg\(dg\(dg\(dg\(dg\(dg \}
8087 .               \}
8088 .            \}
8089 .            if \\n[#FN_MARKER_STYLE]=2 \{\
8090 .                if \\n[#PRINT_STYLE]=1 \{ .PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#FN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2" \}
8091 .                if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]" \}
8092 .            \}
8093 .         \}
8094 .       \}
8095 .       nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-(\\n(nl+1v)
8096 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
8097 .       nr #PP_STYLE 2
8098 .       if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
8099 .       INDENT_FIRST_PARAS
8100 .       ev FOOTNOTES
8101 .       ll \\n[#DOC_L_LENGTH]u
8102 .       ta \\n(.lu
8103 .       if \\n[#COLUMNS] \{\
8104 .          ll \\n[#COL_L_LENGTH]u
8105 .          ta \\n(.lu
8106 .       \}
8107 .       if \\n[#FN_R_INDENT]  \{\
8108 .          ll -\\n[#FN_R_INDENT]u
8109 .          ta \\n(.lu
8110 .       \}
8111 .       if \\n[#FN_BR_INDENT] \{\
8112 .          ll -\\n[#FN_BR_INDENT]u
8113 .          ta \\n(.lu
8114 .       \}
8115 .       FAMILY   \\*[$FN_FAM]
8116 .       FT       \\*[$FN_FT]
8117 .       PT_SIZE  \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
8118 .       AUTOLEAD \\n[#FN_AUTOLEAD]
8119 .       QUAD     \\*[$FN_QUAD]
8120 .       if \\n[#PRINT_STYLE]=1 \{\
8121 .          fam C
8122 .          ft  R
8123 .          ps 12
8124 .          ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
8125 .          el \{ .vs \\n[#DOC_LEAD]u/2u \}
8126 .          QUAD LEFT
8127 .          HY OFF
8128 .       \}
8129 .       nr #FN_LEAD \\n[#LEAD]
8130 .       da FOOTNOTES
8131 .       if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
8132 .       if \\n[#FN_DEFER_SPACE] \{\
8133 .          if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
8134 .          if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
8135 .          rr #FN_DEFER_SPACE
8136 .       \}
8137 .       if \\n+[#FN_COUNT]=1 \{\
8138 .          if !\\n[#FN_DEPTH] \{\
8139 .             if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
8140 .             ie \\n[#FN_RULE] \{ .PRINT_FOOTNOTE_RULE \}
8141 .             el \{ .ALD 1v \}
8142 .          \}
8143 .       \}
8144 .       if \\n[#FN_MARKERS] \{\
8145 .          if !\\n[#NO_FN_MARKER] \{\
8146 .            if \\n[#FN_MARKER_STYLE]=1 \{\
8147 .               ie \\n+[#FN_COUNT_FOR_COLS] \{\
8148 .                  if \\n[#FN_COUNT_FOR_COLS]=1  \{ .PRINT *\c \}
8149 .                  if \\n[#FN_COUNT_FOR_COLS]=2  \{ .PRINT \(dg\c \}
8150 .                  if \\n[#FN_COUNT_FOR_COLS]=3  \{ .PRINT **\c \}
8151 .                  if \\n[#FN_COUNT_FOR_COLS]=4  \{ .PRINT \(dg\(dg\c \}
8152 .                  if \\n[#FN_COUNT_FOR_COLS]=5  \{ .PRINT ***\c \}
8153 .                  if \\n[#FN_COUNT_FOR_COLS]=6  \{ .PRINT \(dg\(dg\(dg\c \}
8154 .                  if \\n[#FN_COUNT_FOR_COLS]=7  \{ .PRINT ****\c \}
8155 .                  if \\n[#FN_COUNT_FOR_COLS]=8  \{ .PRINT \(dg\(dg\(dg\(dg\c \}
8156 .                  if \\n[#FN_COUNT_FOR_COLS]=9  \{ .PRINT *****\c \}
8157 .                  if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
8158 .               \}
8159 .               el \{\
8160 .                  if \\n[#FN_COUNT]=1  \{ .PRINT *\c \}
8161 .                  if \\n[#FN_COUNT]=2  \{ .PRINT \(dg\c \}
8162 .                  if \\n[#FN_COUNT]=3  \{ .PRINT **\c \}
8163 .                  if \\n[#FN_COUNT]=4  \{ .PRINT \(dg\(dg\c \}
8164 .                  if \\n[#FN_COUNT]=5  \{ .PRINT ***\c \}
8165 .                  if \\n[#FN_COUNT]=6  \{ .PRINT \(dg\(dg\(dg\c \}
8166 .                  if \\n[#FN_COUNT]=7  \{ .PRINT ****\c \}
8167 .                  if \\n[#FN_COUNT]=8  \{ .PRINT \(dg\(dg\(dg\(dg\c \}
8168 .                  if \\n[#FN_COUNT]=9  \{ .PRINT *****\c \}
8169 .                  if \\n[#FN_COUNT]=10 \{ .PRINT \(dg\(dg\(dg\(dg\(dg\c \}
8170 .               \}
8171 .            \}
8172 .            if \\n[#FN_MARKER_STYLE]=2 \{\
8173 .               if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
8174 .               if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\c" \}
8175 .            \}
8176 .         \}
8177 .      \}
8178 .    \}
8179 .    el \{\
8180 .       ie '\\$1'INDENT' \{\
8181 .          ev FOOTNOTES
8182 .          if '\\$2'L'     \{ .in (\\$3)  \}
8183 .          if '\\$2'LEFT'  \{ .in (\\$3)  \}
8184 .          if '\\$2'R'     \{ .nr #FN_R_INDENT (\\$3) \}
8185 .          if '\\$2'RIGHT' \{ .nr #FN_R_INDENT (\\$3) \}
8186 .          if '\\$2'B' \{\
8187 .             nr #FN_BL_INDENT (\\$3)
8188 .             ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
8189 .             el \{ .nr #FN_BR_INDENT (\\$4) \}
8190 .             in \\n[#FN_BL_INDENT]u
8191 .          \}
8192 .          if '\\$2'BOTH' \{\
8193 .             nr #FN_BL_INDENT (\\$3)
8194 .             ie '\\$4'' \{ .nr #FN_BR_INDENT \\n[#FN_BL_INDENT] \}
8195 .             el \{ .nr #FN_BR_INDENT (\\$4) \}
8196 .             in \\n[#FN_BL_INDENT]u
8197 .          \}
8198 .          ev
8199 .          FOOTNOTE
8200 .       \}
8201 .       el \{\
8202 .          br
8203 .          di
8204 .          in 0 \"Turn off indent possibly set by FOOTNOTE INDENT...
8205 .          if \\n[#PRINT_STYLE]=1 \{\
8206 .             if \\n[#UNDERLINE_WAS_ON] \{\
8207 .                UNDERLINE
8208 .                rr #UNDERLINE_WAS_ON
8209 .             \}
8210 .          \}
8211 .          ev
8212 .          rr #FN_R_INDENT
8213 .          rr #FN_BR_INDENT
8214 .          nr #PP_STYLE \\n[#PP_STYLE_PREV]
8215 .          if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
8216 .          rr #INDENT_FIRSTS
8217 .          nr #FN_DEPTH +\\n[#DIVER_DEPTH]
8218 .          if \\n[#FN_DEFER] \{\
8219 .             nr #FN_DEFER_SPACE 1
8220 .             rr #FN_DEFER
8221 .          \}
8222 .          if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
8223 .             ie \\n[#SPACE_REMAINING]<(\\n[#LEAD]*2) \{ .nr #FN_DEFER 1 \}
8224 .             el \{\
8225 .                nr #FN_LINES 0 1
8226 .                while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
8227 .                   nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
8228 .                \}
8229 .             \}
8230 .          \}
8231 .          nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
8232 .          if \\n[#FN_COUNT]=1 \{ .nr #VARIABLE_FOOTER_POS -1v \}
8233 .          \}
8234 .          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
8235 .          if (\\n(nl+1v)>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
8236 .             ch FOOTER \\n(nlu+1v
8237 .          \}
8238 .          if \\n[#FN_DEFER] \{\
8239 .             nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
8240 .             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
8241 .          \}
8242 .       \}
8243 .    nr #NO_FN_MARKER 0
8244 .END
8245 \#
8246 \#
8247 .MAC FN_OVERFLOW_TRAP END
8248 .    if \\n[#FN_COUNT] \{\
8249 .       di FN_OVERFLOW
8250 .     \}
8251 .END
8252 \#
8253 \#
8254 .MAC DIVERT_FN_LEFTOVER END
8255 .    nr #NO_FN_MARKER 1
8256 .    nr #OVERFLOW 1
8257 .    FOOTNOTE
8258 .    nf
8259 .    FN_OVERFLOW
8260 .    FOOTNOTE OFF
8261 .    rr #FN_OVERFLOW_DEPTH
8262 .END
8263 \#
8264 \#
8265 .MAC PROCESS_FN_LEFTOVER END
8266 .    if !\\n[#FN_DEFER] \{\
8267 .       nr #FN_COUNT 0 1
8268 .       nr #FN_DEPTH 0
8269 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
8270 .    \}
8271 .    if \\n[#FN_DEFER] \{\
8272 .       nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]+\\n[#DOC_LEAD])
8273 .    \}
8274 .    nr #SPACE_REMAINING 0
8275 .    ch FOOTER -\\n[#B_MARGIN]u
8276 .    if \\n[#FN_DEFER] \{\
8277 .       nr #NO_FN_MARKER 1
8278 .       da FOOTNOTES
8279 .       di
8280 .       FOOTNOTE
8281 .       nf
8282 .       FOOTNOTE OFF
8283 .    \}
8284 .    if !\\n[#FN_DEFER] \{\
8285 .       if \\n[#FN_OVERFLOW_DEPTH] \{\
8286 .           DIVERT_FN_LEFTOVER
8287 .       \}
8288 .    \}
8289 .    nr #FN_COUNT 0 1
8290 .END
8291 \#
8292 \#
8293 \# ====================================================================
8294 \#
8295 \# +++ENDNOTES+++
8296 \#
8297 \# When endnotes are output, the spacing between the notes is always 1
8298 \# extra linespace.  This can have bottom margin consequences.  If this
8299 \# doesn't bother you, don't worry about it.  If it does bother you, and
8300 \# you want to adjust the spacing between any two endnotes (as they're
8301 \# output), make the spacing adjustments (.ALD/.RLD) at the *end* of
8302 \# endnotes (i.e. just before .ENDNOTE OFF), not at the top.
8303 \#
8304 \# Endnotes must be output manually with .ENDNOTES.  This allows user
8305 \# the flexibility to output endnotes at the end of each collated
8306 \# document, or to output them at the end of the entire document.
8307 \#
8308 \# ENDNOTE FAMILY
8309 \# --------------
8310 \# *Argument:
8311 \#   <family to use in endnotes>
8312 \# *Function:
8313 \#   Creates or modifies string $EN_FAM.
8314 \# *Notes:
8315 \#   Default is same as running text in body of document.
8316 \#
8317 .MAC ENDNOTE_FAMILY END
8318 .    ds $EN_FAM \\$1
8319 .END
8320 \#
8321 \#
8322 \# ENDNOTE FONT
8323 \# ------------
8324 \# *Argument:
8325 \#   <font to use in endnotes>
8326 \# *Function:
8327 \#   Creates or modifies string $EN_FT.
8328 \# *Notes:
8329 \#   Default is roman.
8330 \#
8331 .MAC ENDNOTE_FONT END
8332 .    ds $EN_FT \\$1
8333 .END
8334 \#
8335 \#
8336 \# ENDNOTE POINT SIZE
8337 \# ------------------
8338 \# *Argument:
8339 \#   <base point size for endnotes>
8340 \# *Function:
8341 \#   Creates or modifies register #EN_PS.
8342 \# *Notes:
8343 \#   Default is same as running text in body of document.
8344 \#
8345 \#   This size control macro differs from other size control macros
8346 \#   in that it sets an absolute point size, not a relative one.  This
8347 \#   is because a) endnotes always appear separate from the body of
8348 \#   a document and therefore don't need to be relative to the body
8349 \#   of the document, and b) there are quite a few elements of the
8350 \#   endnotes page(s) that need to be relative to the base point size
8351 \#   of that page.  If the base endnote point size were relative to
8352 \#   the body of the document (i.e. a _SIZE macro taking a +|- value)
8353 \#   getting the rest of the endnote elements sized properly could
8354 \#   become very confusing.
8355 \#
8356 .MAC ENDNOTE_PT_SIZE END
8357 .    nr #EN_PS (p;\\$1)
8358 .END
8359 \#
8360 \#
8361 \# ENDNOTE LEAD
8362 \# ------------
8363 \# *Argument:
8364 \#   <base leading to use in endnotes>
8365 \# *Function:
8366 \#   Creates or modifies register #EN_LEAD.
8367 \# *Notes:
8368 \#   Default is 13.5 points for TYPESET; 24 for TYPEWRITE.
8369 \#
8370 .MAC ENDNOTE_LEAD END
8371 .    nr #EN_LEAD (p;\\$1)
8372 .END
8373 \#
8374 \#
8375 \# ENDNOTE QUAD
8376 \# ------------
8377 \# *Argument:
8378 \#   LEFT | L | CENTER | C | RIGHT | R | JUSTIFY | J
8379 \# *Function:
8380 \#   Creates or modifies string $EN_QUAD.
8381 \# *Notes:
8382 \#   Default is justified for TYPESET, left for TYPEWRITE.
8383 \#
8384 .MAC ENDNOTE_QUAD END
8385 .    ds $EN_QUAD \\$1
8386 .END
8387 \#
8388 \#
8389 \# ENDNOTES_HDRFTR_CENTER
8390 \# ----------------------
8391 \# *Argument:
8392 \#   toggle
8393 \# *Function:
8394 \#   Creates or removes toggle register #EN_HDRFTR_CENTER, used to
8395 \#   determine whether mom should print a/the hdrftr center string
8396 \#   on the endnotes page.  Primarily to enable/disable printing of the
8397 \#   chapter name in hdrftrs when DOCTYPE CHAPTER.
8398 \# *Notes:
8399 \#   Default is OFF
8400 \#
8401 .MAC ENDNOTES_HDRFTR_CENTER END
8402 .    ie '\\$1'' \{ .nr #EN_HDRFTR_CENTER 1 \}
8403 .    el         \{ .rr #EN_HDRFTR_CENTER   \}
8404 .END
8405 \#
8406 \#
8407 \# ENDNOTE STRING 
8408 \# --------------
8409 \# *Argument:
8410 \#   <title for endnotes page>
8411 \# *Function:
8412 \#   Creates or modifies string $EN_STRING.
8413 \# *Notes:
8414 \#   Default is "ENDNOTES"
8415 \#
8416 .MAC ENDNOTE_STRING END
8417 .    ds $EN_STRING \\$1
8418 .END
8419 \#
8420 \#
8421 \# ENDNOTE STRING FAMILY
8422 \# ---------------------
8423 \# *Argument:
8424 \#   <family to use for endnote string>
8425 \# *Function:
8426 \#   Creates or modifies string $EN_STRING_FAM.
8427 \# *Notes:
8428 \#   Default is same as running text in body of document.
8429 \#
8430 .MAC ENDNOTE_STRING_FAMILY END
8431 .    ds $EN_STRING_FAM \\$1
8432 .END
8433 \#
8434 \#
8435 \# ENDNOTE STRING FONT
8436 \# -------------------
8437 \# *Argument:
8438 \#   <font to use for endnote string>
8439 \# *Function:
8440 \#   Creates or modifies string $EN_FT.
8441 \# *Notes:
8442 \#   Default is BOLD for TYPEWRITE; roman for TYPESET
8443 \#
8444 .MAC ENDNOTE_STRING_FONT END
8445 .    ds $EN_STRING_FT \\$1
8446 .END
8447 \#
8448 \#
8449 \# ENDNOTE STRING SIZE
8450 \# -------------------
8451 \# *Argument:
8452 \#   <+|- number of points by which to in/decrease endnote string
8453 \#    (relative to base endnote size)>
8454 \# *Function:
8455 \#   Creates or modifies string $EN_STRING_SIZE_CHANGE.
8456 \# *Notes:
8457 \#   Default is +1 for TYPESET.
8458 \#
8459 .MAC ENDNOTE_STRING_SIZE END \"Default for TYPESET is +1
8460 .    ds $EN_STRING_SIZE_CHANGE \\$1
8461 .END
8462 \#
8463 \#
8464 \# ENDNOTE STRING QUAD
8465 \# -------------------
8466 \# *Argument:
8467 \#   LEFT | L | CENTER | C | RIGHT | R
8468 \# *Function:
8469 \#   Creates or modifies string $EN_STRING_QUAD.
8470 \# *Notes:
8471 \#   Default is centered.
8472 \#
8473 .MAC ENDNOTE_STRING_QUAD END
8474 .    ds $EN_STRING_QUAD \\$1
8475 .END
8476 \#
8477 \#
8478 \# ENDNOTE STRING UNDERSCORE
8479 \# -------------------------
8480 \# *Arguments:
8481 \#   toggle | 2
8482 \# *Function:
8483 \#   Turns underscoring of endnote main title on or off.  If the argument
8484 \#   is the digit "2", turns on double-underscoring.
8485 \# *Notes:
8486 \#   Default is double-underscored.
8487 \#
8488 .MAC ENDNOTE_STRING_UNDERSCORE END
8489 .    ie '\\$1'' \{ .nr #EN_STRING_UNDERSCORE 1 \}
8490 .    el \{\
8491 .       ie '\\$1'2' \{ .nr #EN_STRING_UNDERSCORE 2 \}
8492 .       el \{ .rr #EN_STRING_UNDERSCORE \}
8493 .    \}
8494 .END
8495 \#
8496 \#
8497 \# ENDNOTE TITLE
8498 \# -------------
8499 \# *Argument:
8500 \#   <string that appears before the first endnote pertaining to any document>
8501 \# *Function:
8502 \#   Creates string $EN_TITLE_STRING.
8503 \# *Notes:
8504 \#   Default is the document title, or, if doc is a chapter, "Chapter #"
8505 \#
8506 .MAC ENDNOTE_TITLE END
8507 .    ds $EN_TITLE \\$1
8508 .END
8509 \#
8510 \#
8511 \# ENDNOTE TITLE FAMILY
8512 \# --------------------
8513 \# *Argument:
8514 \#   <family to use for endnote title>
8515 \# *Function:
8516 \#   Creates string $EN_TITLE_FAM.
8517 \# *Notes:
8518 \#   Default is same as running text of document.
8519 \#
8520 .MAC ENDNOTE_TITLE_FAMILY END
8521 .    ds $EN_TITLE_FAM \\$1
8522 .END
8523 \#
8524 \#
8525 \# ENDNOTE TITLE FONT
8526 \# ------------------
8527 \# *Argument:
8528 \#   <font to use for endnote title>
8529 \# *Function:
8530 \#   Creates string $EN_TITLE_FT.
8531 \# *Notes:
8532 \#   Default is bold for TYPESET; roman for TYPEWRITE.
8533 \#
8534 .MAC ENDNOTE_TITLE_FONT END
8535 .    ds $EN_TITLE_FT \\$1
8536 .END
8537 \#
8538 \#
8539 \# ENDNOTE TITLE SIZE
8540 \# ------------------
8541 \# *Argument:
8542 \#   <+|- number of points by which to in/decrease endnote title
8543 \#    (relative to base endnote size)>
8544 \# *Function:
8545 \#   Creates string $EN_TITLE_SIZE_CHANGE.
8546 \# *Notes:
8547 \#   Default is 0 (i.e. title same size as text of endnotes).
8548 \#
8549 .MAC ENDNOTE_TITLE_SIZE END
8550 .    ds $EN_TITLE_SIZE_CHANGE \\$1 
8551 .END
8552 \#
8553 \#
8554 \# ENDNOTE TITLE QUAD
8555 \# ------------------
8556 \# *Argument:
8557 \#   <quad direction of endnote title>
8558 \# *Function:
8559 \#   Creates string $EN_TITLE_QUAD.
8560 \# *Notes:
8561 \#   Default is left.
8562 \#
8563 .MAC ENDNOTE_TITLE_QUAD END
8564 .    ds $EN_TITLE_QUAD \\$1
8565 .END
8566 \#
8567 \#
8568 \# ENDNOTE TITLE UNDERSCORE
8569 \# ------------------------
8570 \# *Argument:
8571 \#   toggle
8572 \# *Function:
8573 \#   Creates or removes register #EN_TITLE_UNDERSCORE.
8574 \# *Notes:
8575 \#   Default is to underscore the endnote titles.
8576 \#
8577 .MAC ENDNOTE_TITLE_UNDERSCORE END
8578 .    ie '\\$1'' \{ .nr #EN_TITLE_UNDERSCORE 1 \}
8579 .    el \{ .rr #EN_TITLE_UNDERSCORE \}
8580 .END
8581 \#
8582 \#
8583 \# ENDNOTE NUMBER FAMILY
8584 \# ---------------------
8585 \# *Argument:
8586 \#   <family to use for endnote numbers on endnotes page>
8587 \# *Function:
8588 \#   Creates string $EN_NUMBER_FAM.
8589 \# *Notes:
8590 \#   Default is same as running text of document.
8591 \#
8592 \#   Family, font, and size of endnote numbers applies only to the
8593 \#   numbers as they appear on the endnotes page(s).  The superscript
8594 \#   numbers that appear in running text are unaffected.
8595 \#
8596 .MAC ENDNOTE_NUMBER_FAMILY END
8597 .    ds $EN_NUMBER_FAM \\$1
8598 .END
8599 \#
8600 \#
8601 \# ENDNOTE NUMBER FONT
8602 \# -------------------
8603 \# *Argument:
8604 \#   <font to use for endnote numbers on endnotes page>
8605 \# *Function:
8606 \#   Creates string $EN_NUMBER_FT.
8607 \# *Notes:
8608 \#   Default is bold for TYPESET; roman for TYPEWRITE.
8609 \#
8610 \#   Family, font, and size of endnote numbers applies only to the
8611 \#   numbers as they appear on the endnotes page(s).  The superscript
8612 \#   numbers that appear in running text are unaffected.
8613 \#
8614 .MAC ENDNOTE_NUMBER_FONT END \"Default for TYPESET is bold
8615 .    ds $EN_NUMBER_FT \\$1
8616 .END
8617 \#
8618 \#
8619 \# ENDNOTE NUMBER SIZE
8620 \# -------------------
8621 \# *Argument:
8622 \#   <+|- number of points by which to in/decrease endnote numbers
8623 \#    (relative to base endnote size)>
8624 \# *Function:
8625 \#   Creates string $EN_NUMBER_SIZE_CHANGE.
8626 \# *Notes:
8627 \#   Default is 0.
8628 \#
8629 \#   Family, font, and size of endnote numbers applies only to the
8630 \#   numbers as they appear on the endnotes page(s).  The superscript
8631 \#   numbers that appear in running text are unaffected.
8632 \#
8633 .MAC ENDNOTE_NUMBER_SIZE END \"Default for TYPESET is 0
8634 .    ds $EN_NUMBER_SIZE_CHANGE \\$1
8635 .END
8636 \#
8637 \#
8638 \# ENDNOTE NUMBERS ALIGN RIGHT
8639 \# ---------------------------
8640 \# *Argument:
8641 \#   <max. number of digit placeholders that will appear in endnotes>
8642 \# *Function:
8643 \#   Toggles register #EN_NUMBERS_ALIGN_RIGHT on; creates register
8644 \#   #EN_NUMBER_PLACEHOLDERS.
8645 \# *Notes:
8646 \#   Default is for footnote numbers to be right aligned to 2 placeholders.
8647 \#
8648 .MAC ENDNOTE_NUMBERS_ALIGN_RIGHT END
8649 .    rr #EN_NUMBERS_ALIGN_LEFT
8650 .    nr #EN_NUMBERS_ALIGN_RIGHT 1
8651 .    nr #EN_NUMBER_PLACEHOLDERS \\$1
8652 .END
8653 \#
8654 \#
8655 \# ENDNOTE NUMBERS ALIGN LEFT
8656 \# --------------------------
8657 \# *Argument:
8658 \#   none
8659 \# *Function:
8660 \#   Toggles register #EN_NUMBERS_ALIGN_LEFT on.
8661 \# *Notes:
8662 \#   Default is for footnote numbers to be right aligned to 2 placeholders
8663 \#   (i.e. not left aligned).
8664 \#
8665 .MAC ENDNOTE_NUMBERS_ALIGN_LEFT END
8666 .    rr #EN_NUMBERS_ALIGN_RIGHT
8667 .    nr #EN_NUMBERS_ALIGN_LEFT 1
8668 .END
8669 \#
8670 \#
8671 \# ENDNOTE PARAGRAPH INDENT
8672 \# ------------------------
8673 \# *Argument:
8674 \#   <first line indent of paras subsequent to 1st in endnotes>
8675 \# *Function:
8676 \#   Creates register #EN_PP_INDENT for use in .PP.
8677 \# *Notes:
8678 \#   Requires a unit of measure.
8679 \#
8680 \#   Default is 1.5m for TYPESET; same indent as PARA_INDENT for TYPEWRITE.
8681 \#
8682 .MAC ENDNOTE_PARA_INDENT END
8683 .    nr #EN_PP_INDENT (\\$1)
8684 .END
8685 \#
8686 \#
8687 \# ENDNOTE PARAGRAPH SPACE
8688 \# -----------------------
8689 \# *Argument:
8690 \#   toggle
8691 \# *Function:
8692 \#   Creates toggle register #EN_PP_SPACE for use in .PP.
8693 \# *Notes:
8694 \#   Like PARA_SPACE.  Default is not to space endnote paras.
8695 \#
8696 .MAC ENDNOTE_PARA_SPACE END
8697 .    ie '\\$1'' \{ .nr #EN_PP_SPACE 1 \}
8698 .    el \{ .rr #EN_PP_SPACE \}
8699 .END
8700 \#
8701 \#
8702 \# ENDNOTE
8703 \# -------
8704 \# *Argument:
8705 \#   toggle
8706 \# *Function:
8707 \#   Places superscript endnote number in text, then collects and
8708 \#   processes endnote in diversion END_NOTES.
8709 \# *Notes:
8710 \#   \c must be appended to the word immediately preceding .ENDNOTE.
8711 \#
8712 .MAC ENDNOTE END
8713 .    ie '\\$1'' \{\
8714 .       nr #ENDNOTE 1
8715 .       if \\n[#CONDENSE] \{ \*[CONDX]\c \}
8716 .       if \\n[#EXTEND]   \{ \*[EXTX]\c  \}
8717 .       if \\n[#PRINT_STYLE]=1 \{\
8718 .          if \\n[#UNDERLINE_ON] \{\
8719 .             nr #UNDERLINE_WAS_ON 1
8720 .             UNDERLINE OFF
8721 .          \}
8722 .          if \\n[#SLANT_ON] \{\
8723 .              nr #SLANT_WAS_ON 1
8724 \*[SLANTX]\c
8725 .          \}
8726 .          PRINT "\s-2\v'-\\n[#DOC_LEAD]u/5u'\\n+[#EN_NUMBER]\v'+\\n[#DOC_LEAD]u/5u'\s+2"
8727 .       \}
8728 .       if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#EN_NUMBER]\*[SUPX]" \}
8729 .       nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
8730 .       nr #PP_STYLE_PREV \\n[#PP_STYLE]
8731 .       nr #PP_STYLE 1
8732 .       if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
8733 .       INDENT_FIRST_PARAS
8734 .       ev EN
8735 .       da END_NOTES
8736 .       nr #NO_TRAP_RESET 1
8737 .       if \\n[#PRINT_STYLE]=2 \{ .DOC_LEAD \\n[#EN_LEAD]u ADJUST \}
8738 .       rr #NO_TRAP_RESET
8739 .       vs \\n[#DOC_LEAD]u
8740 .       LL \\n[#DOC_L_LENGTH]u
8741 .       ta \\n(.lu
8742 .       if \\n[#COLUMNS] \{\
8743 .          LL \\n[#COL_L_LENGTH]u
8744 .          ta \\n(.lu
8745 .       \}
8746 .       if \\n[#EN_NUMBER]=1 \{\
8747 \!.       ne 3
8748 .          if !'\\*[$EN_STRING]'' \{ .sp \}
8749 .          if \\n[#PRINT_STYLE]=1 \{\
8750 .             fam C
8751 .             ft  R  
8752 .             ps  12
8753 .          \}
8754 .          if \\n[#PRINT_STYLE]=2 \{\
8755 .             FAMILY  \\*[$EN_TITLE_FAM]
8756 .             FT      \\*[$EN_TITLE_FT]
8757 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_TITLE_SIZE_CHANGE]
8758 .          \}
8759 .          if !'\\*[$EN_TITLE]'' \{\
8760 .             if '\\*[$EN_TITLE_QUAD]'L'      \{ .LEFT   \}
8761 .             if '\\*[$EN_TITLE_QUAD]'LEFT'   \{ .LEFT   \}
8762 .             if '\\*[$EN_TITLE_QUAD]'C'      \{ .CENTER \}
8763 .             if '\\*[$EN_TITLE_QUAD]'CENTER' \{ .CENTER \}
8764 .             if '\\*[$EN_TITLE_QUAD]'CENTRE' \{ .CENTER \}
8765 .             if '\\*[$EN_TITLE_QUAD]'R'      \{ .RIGHT  \}
8766 .             if '\\*[$EN_TITLE_QUAD]'RIGHT'  \{ .RIGHT  \}
8767 .             ie \\n[#EN_TITLE_UNDERSCORE] \{\
8768 .                UNDERSCORE "\\*[$EN_TITLE]
8769 .             \}
8770 .             el \{\
8771 .                PRINT "\\*[$EN_TITLE]
8772 .             \}
8773 .          \}
8774 .       \}
8775 .       ie \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
8776 .          ie \\n[#EN_NUMBER]=1 \{\
8777 .             if !'\\*[$EN_TITLE]'' \{ .sp \}
8778 .          \}
8779 .          el \{ .sp \}
8780 \!.        TRAP OFF
8781 .          if \\n[#PRINT_STYLE]=1 \{\
8782 .             fam C
8783 .             ft  R
8784 .             ps  12
8785 .          \}
8786 .          if \\n[#PRINT_STYLE]=2 \{\
8787 .             FAMILY  \\*[$EN_NUMBER_FAM]
8788 .             FT      \\*[$EN_NUMBER_FT]
8789 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
8790 .          \}
8791 .          nr #RESET_L_LENGTH \\n(.l
8792 .          nr #EN_NUMBER_L_LENGTH \w'\0'*\\n[#EN_NUMBER_PLACEHOLDERS]+\w'.'
8793 .          ll \\n[#EN_NUMBER_L_LENGTH]u
8794 .          RIGHT
8795 \En[#EN_NUMBER].
8796 .          if \\n[#PRINT_STYLE]=1 \{\
8797 .             fam C
8798 .             ft  R
8799 .             ps  12
8800 .          \}
8801 .          if \\n[#PRINT_STYLE]=2 \{\
8802 .             FAMILY  \\*[$EN_FAM]
8803 .             FT      \\*[$EN_FT]
8804 .             PT_SIZE \\n[#EN_PS]u
8805 .          \}
8806 .          EL
8807 .          ll \\n[#RESET_L_LENGTH]u
8808 .          in \\n[#EN_NUMBER_L_LENGTH]u+\w'.\0'u
8809 .          nr #EN_TEXT_INDENT \\n(.i
8810 .          QUAD \\*[$EN_QUAD]
8811 \!.        TRAP
8812 .       \}
8813 .       el \{\
8814 .          ie \\n[#EN_NUMBER]=1 \{\
8815 .             if !'\\*[$EN_TITLE]'' \{ .sp \}
8816 .          \}
8817 .          el \{ .sp \}
8818 .          if \\n[#PRINT_STYLE]=1 \{\
8819 .             fam C
8820 .             ft  R
8821 .             ps  12
8822 .          \}
8823 .          if \\n[#PRINT_STYLE]=2 \{\
8824 .             FAMILY  \\*[$EN_NUMBER_FAM]
8825 .             FT      \\*[$EN_NUMBER_FT]
8826 .             PT_SIZE \\n[#EN_PS]u\\*[$EN_NUMBER_SIZE_CHANGE]
8827 .          \}
8828 .          QUAD \\*[$EN_QUAD]
8829 \En[#EN_NUMBER].\0\c
8830 .          if \\n[#PRINT_STYLE]=2 \{\
8831 .             FAMILY  \\*[$EN_FAM]
8832 .             FT      \\*[$EN_FT]
8833 .             PT_SIZE \\n[#EN_PS]u
8834 .          \}
8835 .       \}
8836 .    \}
8837 .    el \{\
8838 .       br
8839 .       if \\n[#EN_NUMBERS_ALIGN_RIGHT] \{\
8840 .          in 0
8841 .       \}
8842 .       di
8843 .       DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
8844 .       nr #PP_STYLE \\n[#PP_STYLE_PREV]
8845 .       if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
8846 .       rr #INDENT_FIRSTS
8847 .       rr #ENDNOTE
8848 .       ev
8849 .       if \\n[#PRINT_STYLE]=1 \{\
8850 .          if \\n[#UNDERLINE_WAS_ON] \{\
8851 .             rr #UNDERLINE_WAS_ON
8852 .             UNDERLINE
8853 .          \}
8854 .       \}
8855 .       if \\n[#SLANT_WAS_ON] \{\
8856 .          rr #SLANT_WAS_ON
8857 \*[SLANT]\c
8858 .       \}
8859 .    \}
8860 .END
8861 \#
8862 \#
8863 \# ENDNOTES
8864 \# --------
8865 \# *Arguments:
8866 \#   none
8867 \# *Function:
8868 \#   Sets new document leading from #EN_LEAD, breaks to a new page,
8869 \#   sets up an endnotes page based on registers and strings associated
8870 \#   with endnotes, then outputs diversion END_NOTES.
8871 \#
8872 .MAC ENDNOTES END
8873 .    if \\n[#DOC_TYPE]=2 \{\
8874 .       ie \\n[#EN_HDRFTR_CENTER]=1 \{ . \}
8875 .       el \{ .HDRFTR_CENTER \}
8876 .    \}
8877 .    NEWPAGE
8878 .    nr #RESTORE_DOC_LEAD \\n[#DOC_LEAD]
8879 .    if \\n[#PRINT_STYLE]=2 \{ .DOC_LEAD \\n[#EN_LEAD]u ADJUST \}
8880 .    if \\n[#SLANT_ON] \{\
8881 \*[SLANTX]\c
8882 .    \}
8883 .    if !'\\*[$EN_STRING]'' \{\
8884 .       if \\n[#PRINT_STYLE]=1 \{\
8885 .          fam C
8886 .          ft  R
8887 .          ps  12
8888 .       \}
8889 .       if \\n[#PRINT_STYLE]=2 \{\
8890 .          FAMILY  \\*[$EN_STRING_FAM]
8891 .          FT      \\*[$EN_STRING_FT]
8892 .          PT_SIZE \\n[#EN_PS]u\\*[$EN_STRING_SIZE_CHANGE]
8893 .       \}
8894 .       if '\\*[$EN_STRING_QUAD]'L'      \{ .LEFT   \}
8895 .       if '\\*[$EN_STRING_QUAD]'LEFT'   \{ .LEFT   \}
8896 .       if '\\*[$EN_STRING_QUAD]'C'      \{ .CENTER \}
8897 .       if '\\*[$EN_STRING_QUAD]'CENTER' \{ .CENTER \}
8898 .       if '\\*[$EN_STRING_QUAD]'CENTRE' \{ .CENTER \}
8899 .       if '\\*[$EN_STRING_QUAD]'R'      \{ .RIGHT  \}
8900 .       if '\\*[$EN_STRING_QUAD]'RIGHT'  \{ .RIGHT  \}
8901 .       EL
8902 .       ie \\n[#EN_STRING_UNDERSCORE] \{\
8903 .          ie \\n[#EN_STRING_UNDERSCORE]=2 \{\
8904 .             UNDERSCORE2 "\\*[$EN_STRING]
8905 .          \}
8906 .          el \{\
8907 .             UNDERSCORE "\\*[$EN_STRING]
8908 .          \}
8909 .       \}
8910 .       el \{\
8911 .          PRINT "\\*[$EN_STRING]
8912 .       \}
8913 .    \}
8914 .    ev EN
8915 .    nf
8916 .    vs \\n[#DOC_LEAD]u
8917 .    END_NOTES
8918 .    br
8919 .    ev
8920 .    rm END_NOTES
8921 .    DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
8922 .END
8923 \#
8924 \# ====================================================================
8925 \#
8926 \# +++COLUMNS+++
8927 \#
8928 \# COLUMNS
8929 \# -------
8930 \# *Arguments:
8931 \#   <number of columns>  <width of gutters>
8932 \# *Function:
8933 \#   Creates registers associated with setting docs in columns.
8934 \#   Calculates column line lengths and offsets
8935 \# *Notes:
8936 \#   COLUMNS, if used, s/b the last macro invoked before START.
8937 \#
8938 .MAC COLUMNS END
8939 .    if \\n[#IGNORE_COLUMNS]=1 \{ .return \}
8940 .    nr #COLUMNS 1
8941 .    nr #NUM_COLS \\$1
8942 .    nr #GUTTER (\\$2)
8943 .    nr #COL_L_LENGTH \\n[#L_LENGTH]-(\\n[#GUTTER]*(\\n[#NUM_COLS]-1))/\\n[#NUM_COLS]
8944 .    nr #COL_TOTAL 0 \\n[#COL_L_LENGTH]+\\n[#GUTTER]
8945 .    nr #COL_NUM 0 1
8946 .    while !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
8947 .       nr #COL_\\n+[#COL_NUM]_L_MARGIN \\n[#L_MARGIN]+\\n[#COL_TOTAL]
8948 .       nr #COL_TOTAL \\n+[#COL_TOTAL]
8949 .    \}
8950 .    rr #COL_TOTAL
8951 .    rr #COL_NUM
8952 .END
8953 \#
8954 \#
8955 \# NEXT COLUMN
8956 \# -----------
8957 \# *Arguments:
8958 \#   <none>
8959 \# *Function:
8960 \#   Breaks current column and moves to next column.
8961 \#   If current column is the last on the page, breaks
8962 \#   to a new page.
8963 \#
8964 .MAC COL_NEXT END
8965 .    if \\n[#COLUMNS] \{\
8966 .       nr #COL_NEXT 1
8967 .       ie '\\$0'COL_NEXT' \{ .br  \}
8968 .       el \{\
8969 .          brp
8970 .          RLD 1v
8971 .       \}
8972 .       ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
8973 .          bp
8974 .       \}
8975 .       el \{ .FOOTER \}
8976 .    \}
8977 .END
8978 \#
8979 \# ====================================================================
8980 \#
8981 \# +++DOCUMENT PROCESSING MISC AND SUPPORT MACROS+++
8982 \#
8983 \# COLLATE
8984 \# -------
8985 \# *Arguments:
8986 \#   <none>
8987 \# *Function:
8988 \#   Turns headers off (if on) and saves header state, sets register
8989 \#   #COLLATE to 1 (toggle), and breaks to a new page.
8990 \# *Notes:
8991 \#   COLLATE exists primarily to allow putting multiple chapters in
8992 \#   a single file, although it can be used for any document type.  After
8993 \#   COLLATE, any of the macros that normally precede START may be
8994 \#   used, and should behave as expected.
8995 \#
8996 \#   N.B.--the START macro *must* be used after COLLATE (and any other
8997 \#   macros that alter mom's behaviour).
8998 \#
8999 .MAC COLLATE END
9000 .    nr #COLLATE 1
9001 .    nr #HEADER_STATE \\n[#HEADERS_ON]
9002 .    HEADERS OFF
9003 .    if \\n[#PAGE_NUM_V_POS]=1 \{\
9004 .       nr #PAGINATION_STATE \\n[#PAGINATE]
9005 .       PAGINATION OFF
9006 .    \}
9007 .    IQ CLEAR
9008 .    TQ
9009 .    LL \\n[#DOC_L_LENGTH]u
9010 .    QUAD $DOC_QUAD
9011 .    LS \\n[#DOC_LEAD]u
9012 \*[SLANTX]
9013 \*[CONDX]
9014 \*[EXTX]
9015 '    NEWPAGE
9016 .    rr #PAGENUM_STYLE_SET
9017 .    rm $EN_TITLE
9018 .END
9019 \#
9020 \#
9021 \# SET TRAPS FOR HEADERS/FOOTERS/FOOTNOTES
9022 \# ---------------------------------------
9023 \# *Arguments:
9024 \#   <none>
9025 \# *Function:
9026 \#   Sets header/footer/footnotes/etc... traps.
9027 \#     Calculates the number of lines that actually fit on a
9028 \#   page based on #B_MARGIN and resets page bottom trap to coincide
9029 \#   with the depth of that number of lines , or, if #ADJ_DOC_LEAD=1,
9030 \#   adjusts #DOC_LEAD so that the last line of text on a page falls
9031 \#   exactly on #B_MARGIN.
9032 \#
9033 .MAC TRAPS END
9034 \#  *Remove all header/footer traps
9035 .    if !\\n[#NO_TRAP_RESET] \{\
9036 .       ch DO_T_MARGIN
9037 .       ch DO_B_MARGIN
9038 .       ch HEADER
9039 .       ch FOOTER
9040 \#  *Plant header trap
9041 .       wh 0 HEADER
9042 .    \}
9043 \#  *Adjust lead so last line of text falls on B_MARGIN,...
9044 .    ie \\n[#ADJ_DOC_LEAD] \{\
9045 .       nr #LINES_PER_PAGE 0 1
9046 .       nr #DOC_LEAD_ADJ 0 1
9047 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
9048 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
9049 .       nr #LINES_PER_PAGE -1
9050 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
9051 .       DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
9052 .    \}
9053 \#  *...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
9054 \#  *on the page.
9055 .    el \{\
9056 .       nr #LINES_PER_PAGE 0 1
9057 .       nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
9058 .       while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{ . \}
9059 .       nr #B_MARGIN \\n[#PAGE_LENGTH]-(\\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n[#LINES_PER_PAGE]))
9060 .    \}
9061 \#  *Set footer and footnote overflow traps
9062 .    if !\\n[#NO_TRAP_RESET] \{\
9063 .       nr #FN_COUNT 0 1
9064 .       nr #SPACE_REMAINING 0
9065 .       nr #FN_DEPTH 0
9066 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
9067 .       wh 12i FOOTER
9068 .       wh -\\n[#B_MARGIN]u FN_OVERFLOW_TRAP
9069 .       ch FOOTER -\\n[#B_MARGIN]u
9070 .    \}
9071 .END
9072 \#
9073 \#
9074 \# CHECK INDENT
9075 \# ------------
9076 \# *Arguments:
9077 \#   <none>
9078 \# *Function:
9079 \#   Adds left, right, or both indent values to document elements
9080 \#   like heads and subheads that are processed in environments.
9081 \#
9082 .MAC CHECK_INDENT END
9083 .    if \\n[#INDENT_LEFT_ACTIVE] \{\
9084 .       in \\n[#L_INDENT]u
9085 .       if \\n[#QUOTE] \{\
9086 .          in -\\n[#L_INDENT]u \"Because you added an indent in 2nd line of macro
9087 .          ll -\\n[#L_INDENT]u
9088 .          ta \\n(.lu
9089 .       \}
9090 .       if \\n[#EPIGRAPH] \{\
9091 .          in -\\n[#L_INDENT]u
9092 .          ll -\\n[#L_INDENT]u
9093 .          ta \\n(.lu
9094 .       \}
9095 .    \}
9096 .    if \\n[#INDENT_RIGHT_ACTIVE] \{\
9097 .       ll -\\n[#R_INDENT]u
9098 .       ta \\n(.lu
9099 .    \}
9100 .    if \\n[#INDENT_BOTH_ACTIVE] \{\
9101 .       in \\n[#BL_INDENT]u
9102 .       ll -\\n[#BR_INDENT]u
9103 .       ta \\n(.lu
9104 .       if \\n[#QUOTE] \{\
9105 .          in -\\n[#BL_INDENT]u
9106 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
9107 .             ll -\\n[#BR_INDENT]u
9108 .             ta \\n(.lu
9109 .           \}
9110 .          el \{\
9111 .             ll -(\\n[#BR_INDENT]u/2u)
9112 .             ta \\n(.lu
9113 .          \}
9114 .       \}
9115 .       if \\n[#EPIGRAPH] \{\
9116 .          in -\\n[#BL_INDENT]u
9117 .          ie \\n[#BR_INDENT]=\\n[#BL_INDENT] \{\
9118 .             ll -\\n[#BR_INDENT]u
9119 .             ta \\n(.lu
9120 .          \}
9121 .          el \{\
9122 .             ll -(\\n[#BR_INDENT]u/2u)
9123 .             ta \\n(.lu
9124 .          \}
9125 .       \}
9126 .    \}
9127 .END
9128 \#
9129 \#
9130 \# REMOVE INDENT
9131 \# -------------
9132 \# *Arguments:
9133 \#   <none>
9134 \# *Function:
9135 \#   Removes left, right, or both indent values from document elements
9136 \#   like heads and subheads that are processed in environments.
9137 \#
9138 .MAC REMOVE_INDENT END
9139 .    in 0
9140 .    ll \\n[#L_LENGTH]u
9141 .    ta \\n(.lu
9142 .END
9143 \#
9144 \#
9145 \#
9146 \#
9147 \# ====================================================================
9148 \#
9149 \# +++DOCUMENT PROCESSING ALIASES+++
9150 \#
9151 \# Aliases to make life easier for users: synonyms, short forms
9152 \# and alternate spellings.
9153 \#
9154 \# Macros
9155 \# ------
9156 .ALIAS   BREAK_BLOCKQUOTE                BREAK_QUOTE
9157 .ALIAS   BREAK_CITATION                  BREAK_QUOTE
9158 .ALIAS   BREAK_CITE                      BREAK_QUOTE
9159 .ALIAS   CITATION                        BLOCKQUOTE
9160 .ALIAS   CITE                            BLOCKQUOTE
9161 .ALIAS   DOC_R_MARGIN                    DOC_RIGHT_MARGIN
9162 .ALIAS   DOC_L_MARGIN                    DOC_LEFT_MARGIN
9163 .ALIAS   DOC_L_LENGTH                    DOC_LINE_LENGTH
9164 .ALIAS   DOC_RMARGIN                     DOC_RIGHT_MARGIN
9165 .ALIAS   DOC_LMARGIN                     DOC_LEFT_MARGIN
9166 .ALIAS   DOC_LLENGTH                     DOC_LINE_LENGTH
9167 .ALIAS   DOC_FAM                         DOC_FAMILY
9168 .ALIAS   FILL                            QUAD
9169 .ALIAS   PP_FT                           PP_FONT
9170 .ALIAS   DOC_PS                          DOC_PT_SIZE
9171 .ALIAS   DOC_LS                          DOC_LEAD
9172 .ALIAS   PAGENUM                         PAGENUMBER
9173 .ALIAS   PAGINATION                      PAGINATE
9174 \#
9175 \# HEADER and FOOTER aliases for HDRFTR macros.
9176 \#
9177 .ALIAS   ENDNOTES_HEADER_CENTER          ENDNOTES_HDRFTR_CENTER
9178 .ALIAS   HEADER_FAMILY                   HDRFTR_FAMILY
9179 .ALIAS   HEADER_FAM                      HDRFTR_FAMILY
9180 .ALIAS   HEADER_SIZE                     HDRFTR_SIZE
9181 .ALIAS   HEADER_PLAIN                    HDRFTR_PLAIN
9182 .ALIAS   HEADER_RULE_GAP                 HDRFTR_RULE_GAP
9183 .ALIAS   HEADER_RULE                     HDRFTR_RULE
9184 .ALIAS   HEADER_LEFT                     HDRFTR_LEFT
9185 .ALIAS   HEADER_LEFT_FAMILY              HDRFTR_LEFT_FAMILY
9186 .ALIAS   HEADER_LEFT_FAM                 HDRFTR_LEFT_FAMILY
9187 .ALIAS   HEADER_LEFT_FONT                HDRFTR_LEFT_FONT
9188 .ALIAS   HEADER_LEFT_FT                  HDRFTR_LEFT_FONT
9189 .ALIAS   HEADER_LEFT_SIZE                HDRFTR_LEFT_SIZE
9190 .ALIAS   HEADER_LEFT_PS                  HDRFTR_LEFT_SIZE
9191 .ALIAS   HEADER_LEFT_CAPS                HDRFTR_LEFT_CAPS
9192 .ALIAS   HEADER_CENTER                   HDRFTR_CENTER
9193 .ALIAS   HEADER_CENTRE                   HDRFTR_CENTER
9194 .ALIAS   HEADER_CENTER_FAMILY            HDRFTR_CENTER_FAMILY
9195 .ALIAS   HEADER_CENTRE_FAMILY            HDRFTR_CENTER_FAMILY
9196 .ALIAS   HEADER_CENTER_FAM               HDRFTR_CENTER_FAMILY
9197 .ALIAS   HEADER_CENTRE_FAM               HDRFTR_CENTER_FAMILY
9198 .ALIAS   HEADER_CENTER_FONT              HDRFTR_CENTER_FONT
9199 .ALIAS   HEADER_CENTRE_FONT              HDRFTR_CENTER_FONT
9200 .ALIAS   HEADER_CENTER_FT                HDRFTR_CENTER_FONT
9201 .ALIAS   HEADER_CENTRE_FT                HDRFTR_CENTER_FONT
9202 .ALIAS   HEADER_CENTER_SIZE              HDRFTR_CENTER_SIZE
9203 .ALIAS   HEADER_CENTRE_SIZE              HDRFTR_CENTER_SIZE
9204 .ALIAS   HEADER_CENTER_PS                HDRFTR_CENTER_SIZE
9205 .ALIAS   HEADER_CENTRE_PS                HDRFTR_CENTER_SIZE
9206 .ALIAS   HEADER_CENTER_CAPS              HDRFTR_CENTER_CAPS
9207 .ALIAS   HEADER_CENTRE_CAPS              HDRFTR_CENTER_CAPS
9208 .ALIAS   HEADER_RIGHT                    HDRFTR_RIGHT
9209 .ALIAS   HEADER_RIGHT_FAMILY             HDRFTR_RIGHT_FAMILY
9210 .ALIAS   HEADER_RIGHT_FAM                HDRFTR_RIGHT_FAMILY
9211 .ALIAS   HEADER_RIGHT_FONT               HDRFTR_RIGHT_FONT
9212 .ALIAS   HEADER_RIGHT_FT                 HDRFTR_RIGHT_FONT
9213 .ALIAS   HEADER_RIGHT_SIZE               HDRFTR_RIGHT_SIZE
9214 .ALIAS   HEADER_RIGHT_PS                 HDRFTR_RIGHT_SIZE
9215 .ALIAS   HEADER_RIGHT_CAPS               HDRFTR_RIGHT_CAPS
9216 .ALIAS   HEADER_RECTO                    HDRFTR_RECTO
9217 .ALIAS   HEADER_VERSO                    HDRFTR_VERSO
9218 .ALIAS   ENDNOTES_FOOTER_CENTER          ENDNOTES_HDRFTR_CENTER
9219 .ALIAS   FOOTER_FAMILY                   HDRFTR_FAMILY
9220 .ALIAS   FOOTER_FAM                      HDRFTR_FAMILY
9221 .ALIAS   FOOTER_SIZE                     HDRFTR_SIZE
9222 .ALIAS   FOOTER_PLAIN                    HDRFTR_PLAIN
9223 .ALIAS   FOOTER_RULE_GAP                 HDRFTR_RULE_GAP
9224 .ALIAS   FOOTER_RULE                     HDRFTR_RULE
9225 .ALIAS   FOOTER_LEFT                     HDRFTR_LEFT
9226 .ALIAS   FOOTER_LEFT_FAMILY              HDRFTR_LEFT_FAMILY
9227 .ALIAS   FOOTER_LEFT_FAM                 HDRFTR_LEFT_FAMILY
9228 .ALIAS   FOOTER_LEFT_FONT                HDRFTR_LEFT_FONT
9229 .ALIAS   FOOTER_LEFT_FT                  HDRFTR_LEFT_FONT
9230 .ALIAS   FOOTER_LEFT_SIZE                HDRFTR_LEFT_SIZE
9231 .ALIAS   FOOTER_LEFT_PS                  HDRFTR_LEFT_SIZE
9232 .ALIAS   FOOTER_LEFT_CAPS                HDRFTR_LEFT_CAPS
9233 .ALIAS   FOOTER_CENTER                   HDRFTR_CENTER
9234 .ALIAS   FOOTER_CENTRE                   HDRFTR_CENTER
9235 .ALIAS   FOOTER_CENTER_FAMILY            HDRFTR_CENTER_FAMILY
9236 .ALIAS   FOOTER_CENTRE_FAMILY            HDRFTR_CENTER_FAMILY
9237 .ALIAS   FOOTER_CENTER_FAM               HDRFTR_CENTER_FAMILY
9238 .ALIAS   FOOTER_CENTRE_FAM               HDRFTR_CENTER_FAMILY
9239 .ALIAS   FOOTER_CENTER_FONT              HDRFTR_CENTER_FONT
9240 .ALIAS   FOOTER_CENTRE_FONT              HDRFTR_CENTER_FONT
9241 .ALIAS   FOOTER_CENTER_FT                HDRFTR_CENTER_FONT
9242 .ALIAS   FOOTER_CENTRE_FT                HDRFTR_CENTER_FONT
9243 .ALIAS   FOOTER_CENTER_SIZE              HDRFTR_CENTER_SIZE
9244 .ALIAS   FOOTER_CENTRE_SIZE              HDRFTR_CENTER_SIZE
9245 .ALIAS   FOOTER_CENTER_PS                HDRFTR_CENTER_SIZE
9246 .ALIAS   FOOTER_CENTRE_PS                HDRFTR_CENTER_SIZE
9247 .ALIAS   FOOTER_CENTER_CAPS              HDRFTR_CENTER_CAPS
9248 .ALIAS   FOOTER_CENTRE_CAPS              HDRFTR_CENTER_CAPS
9249 .ALIAS   FOOTER_RIGHT                    HDRFTR_RIGHT
9250 .ALIAS   FOOTER_RIGHT_FAMILY             HDRFTR_RIGHT_FAMILY
9251 .ALIAS   FOOTER_RIGHT_FAM                HDRFTR_RIGHT_FAMILY
9252 .ALIAS   FOOTER_RIGHT_FONT               HDRFTR_RIGHT_FONT
9253 .ALIAS   FOOTER_RIGHT_FT                 HDRFTR_RIGHT_FONT
9254 .ALIAS   FOOTER_RIGHT_SIZE               HDRFTR_RIGHT_SIZE
9255 .ALIAS   FOOTER_RIGHT_PS                 HDRFTR_RIGHT_SIZE
9256 .ALIAS   FOOTER_RIGHT_CAPS               HDRFTR_RIGHT_CAPS
9257 .ALIAS   FOOTER_RECTO                    HDRFTR_RECTO
9258 .ALIAS   FOOTER_VERSO                    HDRFTR_VERSO
9259 .ALIAS   SWITCH_HEADERS                  SWITCH_HDRFTR
9260 .ALIAS   SWITCH_FOOTERS                  SWITCH_HDRFTR
9261 \#
9262 \# SUPPORT ALIASES
9263 \#
9264 .ALIAS   COL_BREAK                       COL_NEXT
9265 .ALIAS   PRINT_FOOTNOTE_RULE             FOOTNOTE_RULE