summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/mom/BUGS24
-rw-r--r--contrib/mom/ChangeLog58
-rw-r--r--contrib/mom/NEWS37
-rw-r--r--contrib/mom/TODO4
-rw-r--r--contrib/mom/examples/README.txt39
-rw-r--r--contrib/mom/examples/elvis_syntax.new87
-rw-r--r--contrib/mom/examples/sample_docs.mom17
-rw-r--r--contrib/mom/momdoc/appendices.html515
-rw-r--r--contrib/mom/momdoc/cover.html2
-rw-r--r--contrib/mom/momdoc/definitions.html55
-rw-r--r--contrib/mom/momdoc/docelement.html32
-rw-r--r--contrib/mom/momdoc/docprocessing.html24
-rw-r--r--contrib/mom/momdoc/goodies.html2
-rw-r--r--contrib/mom/momdoc/inlines.html10
-rw-r--r--contrib/mom/momdoc/intro.html11
-rw-r--r--contrib/mom/momdoc/letters.html7
-rw-r--r--contrib/mom/momdoc/macrolist.html7
-rw-r--r--contrib/mom/momdoc/reserved.html154
-rw-r--r--contrib/mom/momdoc/toc.html29
-rw-r--r--contrib/mom/momdoc/typesetting.html319
-rw-r--r--contrib/mom/momdoc/using.html8
-rw-r--r--contrib/mom/om.tmac1382
22 files changed, 2285 insertions, 538 deletions
diff --git a/contrib/mom/BUGS b/contrib/mom/BUGS
index c8da4f74..8afa9eab 100644
--- a/contrib/mom/BUGS
+++ b/contrib/mom/BUGS
@@ -15,6 +15,30 @@ Also, please--no html email. That, too, gets nuked.
========================================================================
+Version 1.1.9
+=============
+
+Footnote markers not resetting properly on new pages when COLUMNS
+is enabled.
+---Fixed---
+
+When overflowed footnote material is the only footnote material on
+the page or in the column, no footnotes are output.
+---Fixed---
+
+The AUTOLEAD used in FOOTNOTE not being disabled after FOOTNOTES
+are output, or after PROCESS_FN_LEFTOVER/PROCESS_FN_IN_DIVER.
+---Fixed---
+
+COL_NEXT and COL_BREAK, when invoked during the last column on a
+page, are overprinting the last column instead of breaking to a new
+page when there are footnotes in the column.
+---Fixed---
+
+BR_AT_LINE_KERN not "break-and-spreading" text when used in
+justified copy.
+---Fixed---
+
Version 1.1.8
=============
diff --git a/contrib/mom/ChangeLog b/contrib/mom/ChangeLog
index c4a237bd..e7f4ec19 100644
--- a/contrib/mom/ChangeLog
+++ b/contrib/mom/ChangeLog
@@ -1,3 +1,61 @@
+*Aug 8 2004
+
+o Version changed from the 1.1.x series to 1.2. All of the
+ features I originally wanted mom to have originally have been
+ implemented, and appear to be stable.
+
+o Major overhaul to the setting of page traps and the handling of
+ footnotes, both "normal" footnotes and footnotes that occur
+ inside QUOTE, BLOCKQUOTE and EPIGRAPH.
+
+o Addtion of font "styles" to om.tmac, plus changes to the FAMILY
+ and FT macros to manage them. New section in the doc appendices
+ on adding fonts and managing the new font styles.
+
+o Mom now uses a "fallback font" whenever there's an illegal call
+ to FAMILY.
+
+o RW and EW now affect only the font in effect. A change of family
+ or font disables them.
+
+o BR_AT_LINE_KERN now properly does a .brp (spread and break) when
+ used in justified text.
+
+o NEWPAGE, which used to be an alias for .bp, has been moved into
+ its own macro, in order to make it more responsive to some unusal
+ situations.
+
+o Some changes to elvis_syn.new, including that the file extensions
+ recognized by elvis now include both .mom and .tmac. This makes
+ om.tmac much easier to read.
+
+*Jul 6 2004
+
+o FT and FAM(ILY) reworked to take advantage of if S, if F and
+ \n[.sty] additions to groff (1.19.2). Warnings are emitted if a
+ style hasn't been registered, or if a font style doesn't exist in
+ the current family. Invalid .FAM(ILY) calls now use a "fallback"
+ font" (although no warning is issued); fallback is user-settable
+
+o New macro, FALLBACK_FONT. Not only controls the fallback font
+ for invalid family calls, but also controls whether mom aborts on
+ invalid .FT calls after issuing a warning.
+
+o RW/EW now affect only the current font (or font style)
+
+o BR_AT_LINE_KERN now (properly) does a break-and-spread when text
+ is justified.
+
+o Fairly extensive list of .sty's added to om.tmac. Hopefully,
+ this will make life easier for users wishing to add new fonts
+ and/or entire new families to their groff site-font/devps
+ directory.
+
+*Jun 6 2004
+
+o Altered kerning slightly for footnote markers in text. Daggers
+ and double-daggers were getting a bit jammed
+
*Fri Jun 4 2004
o Makefile.sub (HTMLDOCFILES, EXAMPLEFILES, PROCESSEDEXAMPLEFILES): Updated.
diff --git a/contrib/mom/NEWS b/contrib/mom/NEWS
index d987742a..dcb96b9b 100644
--- a/contrib/mom/NEWS
+++ b/contrib/mom/NEWS
@@ -1,3 +1,40 @@
+Release 1.2
+-----------
+
+As of 1.2, the recommended version of groff to use with mom has
+been bumped up from groff, 1.18 to groff, 1.19.2. Although mom will
+continue to work with groff, 1.18, her handling of .FAM(ILY) and .FT
+is now slightly different, therefore users of groff 1.18 may have to
+update documents created with mom so that every .FAM(ILY) request is
+followed by a .FT request before any text is input, otherwise mom
+will set the text after .FAM(ILY) in Courier (until she encounters a
+.FT request). People running groff, >= 1.19.2 don't have to worry
+about this, but I recommend that, regardless of which version you're
+running, you have a look at the document entries for FAMILY and FT
+in order to see how mom will be handling .FAMILY and .FT from now
+on.
+
+When used with groff >=1.19.2, mom now emits warnings if a style
+hasn't been registered, or if a font style doesn't exist in the
+current family. Invalid .FAM(ILY) calls now use a "fallback" font"
+(although no warning is issued). The fallback is user-settable.
+
+Mom's macro file, om.tmac, now sets up a fairly extensive list of
+font "styles," thus expanding the range of arguments that can be
+passed to .FT (formerly, just R, I, B and BI, unless users had
+already rolled their own solution to the problem of extensive type
+families containing fonts like condensed, demibold, black, light, etc).
+Users are advised to read the documentation sections on FAM(ILY),
+FT and FALLBACK_FONT, as well as the new appendix section, "Adding
+PostScript fonts to groff", for information on using mom's style
+extensions (and how to disable them, should they conflict with a
+user's present groff site-font/devps setup).
+
+A new macro, FALLBACK_FONT, has been added. It controls not only
+the fallback font for invalid .FAMILY calls, but also whether mom
+aborts on invalid .FT calls after issuing a warning, or continues
+processing using the fallback.
+
Release 1.1.9
-------------
diff --git a/contrib/mom/TODO b/contrib/mom/TODO
index 4e1a33d1..1297bbd6 100644
--- a/contrib/mom/TODO
+++ b/contrib/mom/TODO
@@ -1,4 +1,4 @@
-As of version 1.1.9, the items on this TODO list will only be dealt
+As of version 1.2, the items on this TODO list will only be dealt
with if users request they be implemented.
UNDERLINING
@@ -15,8 +15,6 @@ FOOTNOTES
In columnar docs, maybe give user the choice of gathering all
footnotes at the bottom of the last column?
-Figure out a way to bypass the \c requirement before .FOOTNOTE.
-
CONTROL MACROS -- _INDENT
--------------
Let user be able to enter decimal fractions as the argument to _INDENT
diff --git a/contrib/mom/examples/README.txt b/contrib/mom/examples/README.txt
index 6cdccaa2..c38aaba6 100644
--- a/contrib/mom/examples/README.txt
+++ b/contrib/mom/examples/README.txt
@@ -1,6 +1,11 @@
The files in this directory show mom in action.
-I haven't included their PostScript output because I want to
+If you have downloaded and untarrred a version of mom from her
+homepage, you'll see that none of the example files come with
+corresponding PostScript (.ps) files, as they do with pre-compiled
+versions of groff, or groff built from source.
+
+I haven't included the PostScript output because I want to
keep the mom archive as lean as possible. To view the PostScript
output, process the files with groff and either
@@ -9,20 +14,20 @@ output, process the files with groff and either
b) to your printer.
-Using the file typeset_doc.mom as an example, you would
+Using the file sample_docs.mom as an example, you would
accomplish a) like this:
- groff -mom -Tps typeset_doc.mom > typeset_doc.ps
- gv typeset_doc.ps
+ groff -mom -Tps sample_docs.mom > sample_docs.ps
+ gv sample_docs.ps
-How you would accomplish b) depends on your printer setup, but a
-fairly standard way to do it would be
+Accomplishing b) depends on your printer setup, but a fairly
+standard way to do it would be
- groff -mom -Tps typeset_doc.mom | lpr
+ groff -mom -Tps sample_docs.mom | lpr
or
- groff -mom -Tps -l typeset_doc.mom
+ groff -mom -Tps -l sample_docs.mom
Note: I don't recommend previewing with gxditview because it doesn't
render some of mom's effects properly.
@@ -43,9 +48,9 @@ Because the file also demonstrates a "cutaround" using a small
picture (of everybody's favourite mascot, Tux), the PostScript file,
penguin.ps has been included in the directory.
-***typeset_doc.mom***
+***sample_docs.mom***
-The file, typeset_doc.mom, shows examples of three of the document
+The file, sample_docs.mom, shows examples of three of the document
styles available with the mom's document processing macros, as well
as demonstrating the use of COLLATE.
@@ -55,11 +60,17 @@ default behaviour when typesetting a document.
The last sample, set in 2 columns, shows off mom's flexibility
when it comes to designing documents.
-***typewrite_doc.mom***
+If you'd like to see how mom handles exactly the same file when the
+PRINTSTYLE is TYPEWRITE (i.e. typewritten, double-spaced), simply
+change
+
+ .PRINTSTYLE TYPESET
+
+to
+
+ .PRINTSTYLE TYPEWRITE
-Using the first two samples from typeset.mom, typewrite_doc.mom
-shows what "typewritten, double-spaced" documents (PRINTSTYLE
-TYPEWRITE) look like.
+near the top of the file.
***letter.mom***
diff --git a/contrib/mom/examples/elvis_syntax.new b/contrib/mom/examples/elvis_syntax.new
index 777c0915..ec3368fd 100644
--- a/contrib/mom/examples/elvis_syntax.new
+++ b/contrib/mom/examples/elvis_syntax.new
@@ -16,7 +16,7 @@
#Mom
language mom
-extension .mom
+extension .mom .tmac
startword .
color startword normal
@@ -27,12 +27,23 @@ color inword normal
other initialpunct
mostly normal
-color args like fixed
-color chars like emphasized
-color decimals normal
-color ellipsis normal
-color escapes like keyword
-color misc green
+backslash none
+
+color args like fixed
+color braces like char
+color brackets like underlined
+color chars like emphasized
+color decimals normal
+color ellipsis normal
+color escapes like keyword
+color math like cursor
+color misc like string
+color operators like string
+color parens like comment
+color reg_string like math
+color tmac_escapes like keyword
+color single_slash like char
+
font args DA DE EN ES FR IT NL NO PT SV
font args DEFAULT CHAPTER NAMED LETTER
font args TYPESET TYPEWRITE
@@ -48,25 +59,45 @@ font args SINGLESPACE
font args FACTOR
font args DASH BULLET ALPHA DIGIT USER
font args RGB CYM CMYK GRAY GREY
-prefix \/ \/. \/? \/! \/, \/; \/:
-font escapes \/ \/. \/? \/! \/, \/; \/:
-prefix \, \,. \,? \,! \,, \,; \,:
-font escapes \, \,. \,? \,! \,, \,; \,:
-prefix \\ \~ \0 \: \| \^ \& \% \!
-font escapes \\ \~ \0 \: \| \^ \& \% \!
-prefix \b \c \C \d \D \e \f \f( \h \l \L \p \r \s \s+ \s- \S \u \v \w
-font escapes \b \c \C \d \D \e \f \f( \h \l \L \p \r \s \s+ \s- \S \u \v \w
-prefix \(bu \(co \(ct \(de \(dg \(di \(em \(en \(mu \(pl \(rg \(sc \(sq \(lq \(rq
-font chars \(bu \(co \(ct \(de \(dg \(di \(em \(en \(mu \(pl \(rg \(sc \(sq \(lq \(rq
-prefix \(14 \(12 \(34 \(+-
-font chars \(14 \(12 \(34 \(+-
-prefix \fR \fB \fI \fP \f0 \f1 \f2 \f3
-font chars \fR \fB \fI \fP \f0 \f1 \f2 \f3
-prefix ...
-font ellipsis ...
-prefix .0 .1 .2 .3 .4 .5 .6 .7 .8 .9
-font decimals . .0 .1 .2 .3 .4 .5 .6 .7 .8 .9
+
+prefix { \{ \{\
+font braces { \{ \{\
+prefix [ ]
+font brackets [ ]
+prefix \(bu \(co \(ct \(de \(dg \(di \(em \(en \(mu \(pl \(rg \(sc \(sq \(lq \(rq
+font chars \(bu \(co \(ct \(de \(dg \(di \(em \(en \(mu \(pl \(rg \(sc \(sq \(lq \(rq
+prefix \(14 \(12 \(34 \(+-
+font chars \(14 \(12 \(34 \(+-
+prefix \fR \fB \fI \fP \f0 \f1 \f2 \f3
+font chars \fR \fB \fI \fP \f0 \f1 \f2 \f3
+prefix .0 .1 .2 .3 .4 .5 .6 .7 .8 .9
+font decimals . .0 .1 .2 .3 .4 .5 .6 .7 .8 .9
+prefix \/ \/. \/? \/! \/, \/; \/:
+font escapes \/ \/. \/? \/! \/, \/; \/:
+prefix \, \,. \,? \,! \,, \,; \,:
+font escapes \, \,. \,? \,! \,, \,; \,:
+prefix \~ \0 \: \| \^ \& \% \!
+font escapes \~ \0 \: \| \^ \& \% \!
+prefix \b \c \C \d \D \e \f \f( \h \l \L \p \r \s \s+ \s- \S \u \v \w
+font escapes \b \c \C \d \D \e \f \f( \h \l \L \p \r \s \s+ \s- \S \u \v \w
+prefix ...
+font ellipsis ...
+prefix + - * / = == < > <= >= <? >? %
+font math + - * / = == < > <= >= <? >? %
+prefix |
+font misc |
+prefix ! : &
+font operators ! : &
+prefix ( )
+font parens ( )
+prefix # * $
+font reg_string # * $
+prefix \n \*
+font single_slash \n \*
+prefix \\n \\* \\$
+font tmac_escapes \\n \\* \\$
+
character \]
-string '
-comment \#
-comment \"
+string '
+comment \#
+comment \"
diff --git a/contrib/mom/examples/sample_docs.mom b/contrib/mom/examples/sample_docs.mom
index 564df99d..2960dc88 100644
--- a/contrib/mom/examples/sample_docs.mom
+++ b/contrib/mom/examples/sample_docs.mom
@@ -15,7 +15,8 @@
\# The PRINTSTYLE is TYPESET. If you'd like to see what mom does
\# with the documents when the PRINTSTYLE is TYPEWRITE, change
\# PRINTSTYLE TYPESET, below, to PRINTSTYLE TYPEWRITE. Also, in the
-\# third example, comment out PARA_INDENT and QUOTE_INDENT.
+\# third example, comment out PARA_INDENT and QUOTE_INDENT (lines
+\# 332 and 333).
\#
\# ===================================================================
\#
@@ -357,7 +358,7 @@ eirmod tempor. Invidunt ut labore et do\%lo\%re magna ali\%quyam erat,
sed diam voluptua at vero. Eos et accusam et justo duo do\%lo\%res et
ea rebum stet clita.\c
.FOOTNOTE \" Note the use of \c, above, to keep the word and footnote marker together.
-Lorem ipsum dolor sit amet, consetetur sadipscing elitr.
+Clita ipsum dolor sit amet, consetetur sadipscing elitr.
.FOOTNOTE OFF
.BLOCKQUOTE OFF
\#
@@ -374,7 +375,7 @@ erat? At vero eos et accusam et justo duo do\%lo\%res et ea. Rebum stet
clita kasd gubergren no sea takimata sanctus. Est lorem ipsum dolor
sit amet. Sadipscing\c
.FOOTNOTE
-Sed diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
+Sadipscing diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
ali\%quyam erat, sed diam voluptua.
.FOOTNOTE OFF
elitr sed diam nonumy eirmod tempor invidunt. Ut labore et do\%lo\%re
@@ -404,7 +405,7 @@ kasd gubergren.
.PP
No sea takimata\c
.FOOTNOTE
-Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
+Takimata sadipscing elitr, sed diam nonumy eirmod tempor invidunt
ut labore et do\%lo\%re magna ali\%quyam erat, sed diam voluptua.
.FOOTNOTE OFF
sanctus est lorem. Ipsum dolor sit amet, consetetur
@@ -441,7 +442,7 @@ ali\%quyam. Erat sed diam voluptua, at vero eos et accusam et justo
rebum amet. Consetetur sadipsc\%ing elitr sed diam nonumy eirmod
sed diam nonumy, eirmod tempor. Invidunt tempor invidunt ut labore.\c
.FOOTNOTE
-Sed diam nonumy eirmod tempor, invidunt ut labore et do\%lo\%re
+Labore diam nonumy eirmod tempor, invidunt ut labore et do\%lo\%re
magna ali\%quyam. Erat sed diam voluptua, at vero eos et accusam et
justo.
.FOOTNOTE OFF
@@ -492,7 +493,7 @@ Stet clita kasd gubergren no sea. Takimata sanctus est lorem ipsum
dolor sit amet. Consetetur sadipscing elitr sed diam nonumy eirmod
tempor invidunt ut labore et do\%lo\%re. Magna ali\%quyam\c
.FOOTNOTE
-Diam nonumy eirmod tempor invidunt ut labore.
+Aliquyam nonumy eirmod tempor invidunt ut labore.
.FOOTNOTE OFF
erat, sed diam
voluptua at vero eos et accusam. Et justo duo do\%lo\%res et ea rebum,
@@ -509,7 +510,7 @@ Sed diam, nonumy eirmod tempor, invidunt ut labore et do\%lo\%re magna.
Aliquyam erat sed diam voluptua. At vero eos et accusam et
justo.\c
.FOOTNOTE
-At vero eos et accusam et justo duo.
+Justo vero eos et accusam et justo duo.
.FOOTNOTE OFF
.BLOCKQUOTE OFF
\#
@@ -551,7 +552,7 @@ erat? At vero eos et accusam et justo duo do\%lo\%res et ea. Rebum stet
clita kasd gubergren no sea takimata sanctus. Est lorem ipsum dolor
sit amet. Sadipscing\c
.FOOTNOTE
-Sed diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
+Sadipscing diam nonumy eirmod tempor invidunt ut labore et do\%lo\%re magna
ali\%quyam erat, sed diam voluptua.
.FOOTNOTE OFF
elitr sed diam nonumy eirmod tempor invidunt. Ut labore et do\%lo\%re
diff --git a/contrib/mom/momdoc/appendices.html b/contrib/mom/momdoc/appendices.html
index 259e3408..12c243e8 100644
--- a/contrib/mom/momdoc/appendices.html
+++ b/contrib/mom/momdoc/appendices.html
@@ -20,6 +20,10 @@
<ul>
<li><a href="#MOREDOC">Further notes on this documentation</a>
+ <li><a href="#FONTS">Adding PostScript fonts to groff</a>
+ <ul>
+ <li><a href="#HOWTO">How to create a PostScript font for use with groff</a>
+ </ul>
<li><a href="#CODENOTES">Some reflections on mom, with an apology</a>
<li><a href="#CONTACT">Contact the author</a>
<li><a href="reserved.html">List of reserved words</a>
@@ -68,23 +72,510 @@ Not everyone, of course, uses an editor with html capabilities.
For them, firing up a browser is obviously necessary for reading
<strong>mom</strong>'s documentation. Browsers being what they are,
and not everyone on the globe having the cash for muscle machines
-to run Galeon, or Konqueror, or Mozilla, or Netscape, their browser
-needs to be one that's fast and light -- Lynx, in other words.
+to run Galeon, or Konqueror or Mozilla, their browser
+needs to be fast and light--and probably &quot;text-only&quot;.
<p>
Some <strong>mom</strong> users may notice the absence of graphics,
-frames, and (for the most part) tables in this documentation.
-The reason is simple: Lynx. People who, for whatever reason (choice
-or necessity), use Lynx to read the documentation must be able to make
-sense of it. All of it. Graphical examples of <strong>mom</strong>
-in action might have made some parts of the documentation easier to
-write, but would have excluded Lynx-only users. And it goes
-without saying that the documentation looks fine if you're
-reading it in a graphical browser.
+frames, and (for the most part) tables in this documentation. The
+reason is simple: text-only browsers. People who, for whatever
+reason (choice or necessity), use lynx, or links or w3m to read
+the documentation must be able to make sense of it. All of it.
+Graphical examples of <strong>mom</strong> in action might have made
+some parts of the documentation easier to write, but would have
+excluded text-only browser users. And it goes without saying that
+the documentation looks fine if you're reading it in a graphical
+browser.
<br>
<hr>
<!=====================================================================>
+<a name="FONTS">
+ <h2><u>Adding PostScript fonts to groff</u></h2>
+</a>
+
+<a name="SMALL_NOTE"></a>
+<em><strong>Small note:</strong> the term &lt;prefix&gt; in this
+section refers to the directory in which groff is installed,
+typically something like /usr/share/groff/&lt;version#&gt;
+(for distro-specific, pre-compiled groff packages) or
+/usr/local/share/groff/&lt;version#&gt; (if you've built groff
+from source).</em>
+<p>
+Groff comes with a small library of PostScript
+<a href="definitions.html#TERMS_FAMILY">families</a>
+(see the
+<a href="typesetting.html#FAMILY">FAMILY</a>
+macro for a list). The families have four
+<a href="definitions.html#TERMS_FONT">fonts</a>
+associated with them. These fonts are a combination of
+<a href="definitions.html#TERMS_WEIGHT">weight</a>
+and
+<a href="definitions.html#TERMS_SHAPE">shape</a>:
+<br>
+<ul>
+ <li><strong>R</strong> (Roman, usually Medium weight),
+ <li><strong>I</strong> (Italic, usually Medium weight),
+ <li><strong>B</strong> (Bold, usually Roman shape) and
+ <li><strong>BI</strong> (Bold Italic).
+</ul>
+<p>
+If you do a lot of document processing or typesetting with
+<strong>mom</strong>, you'll find, sooner or later, that these
+families and their associated fonts aren't sufficient. You'll want
+to supplement them, either with more fonts for the families already
+provided--"Damn! I need Helvetica Bold Condensed Italic!"--or with
+entire new families.
+<p>
+Without going into the gory details (yet), while it's true that
+adding fonts to groff is a relatively straightforward
+process, extending existing families or adding new ones requires
+some planning.
+<p>
+The traditional approach to extending groff families has been
+to create new families for non-default weights and
+shapes (e.g. Light, which is a weight; Condensed, which is a
+shape), then to associate them with groff's predefined <strong>R,
+I, B</strong> and <strong>BI</strong> font styles. An example
+of this can be seen in the groff PostScript font library itself
+(&lt;prefix&gt;/font/devps/): there's one &quot;family&quot; for
+Helvetica (HR, HI, HB, HBI) and another for Helvetica Narrow (HNR,
+HNI, HNB, HNBI).
+<p>
+The difficulty with this approach is that typographers
+tend to think of &quot;families&quot; as referring to the
+entire set of font weights and shapes associated with a
+particular family name. For example, when a typesetter says
+&quot;the Helvetica family&quot;, s/he is including the <a
+href="definitions.html#TERMS_WEIGHT">weights</a> Helvetica Thin,
+Helvetic Light, Helvetica Regular, Helvetica Bold, Helvetica Heavy,
+etc, and all their associated
+<a href="definitions.html#TERMS_SHAPE">shapes</a>
+(Roman,
+Italic, Condensed, Narrow, Extended, Outline, etc).
+<p>
+Thus, intuitively, when a typesetter gives <strong>mom</strong> a
+<kbd>.FAM(ILY)</kbd> directive, s/he reasonably expects that any
+subsequent <kbd>.FT</kbd> directive will access the desired font
+from the Helvetica family--without the need to state explicitly both
+family and font to <kbd>.FT</kbd>, as it is explained one can do in
+the
+<a href="typesetting.html#FAMILY">FAMILY</a>
+and
+<a href="typesetting.html#FONT">FT</a>
+sections of these documents.
+<p>
+If one had, say, the fonts, Helvetica Light Roman
+and Helvetica Light Italic as well as Helvetica Light Condensed
+Roman and Helvetica Light Condensed Italic, the traditional
+approach would require two &quot;partial&quot; families: HLR/HLI and
+HLCDR/HLCDI. Accessing these family/font combos
+routinely throughout a document would then require
+changing family (with <kbd>.FAM(ILY)</kbd>) and selecting the
+desired font (with <kbd>.FT R</kbd> or <kbd>.FT I</kbd>), or
+passing <kbd>.FT</kbd> the lengthy family+fontname (.e.g. <kbd>.FT
+HLCDI</kbd>).
+<p>
+Fortunately, groff provides a mechanism whereby it's possible to
+extend the basic <strong>R, I, B</strong> and <strong>BI</strong>
+fonts (&quot;styles&quot; in groff-speak) so that one can, in
+fact, create extensive type families, and access all the fonts
+in them with <kbd>.ft</kbd> (groff) or <kbd>.FT</kbd> (mom).
+<p>
+<strong>mom</strong> uses this mechanism to offer, in addition to
+groff's default PostScript font styles, the following:
+<p>
+<a name="STYLE_EXTENSIONS"></a>
+<pre>
+Mom's extensions to groff's basic font styles
+=============================================
+
+ L = Light Roman
+ LI = Light Italic
+ LCD = Light Condensed Roman
+ LCDI = Light Condensed Italic
+ LEX = Light Extended Roman
+ LEXI = Light Extended Italic
+ CD = Medium/Book Condensed Roman
+ CDI = Medium/Book Condensed Italic
+ EX = Medium/Book Extended Roman
+ EXI = Medium/Book Extended Italic
+ DB = DemiBold Roman
+ DBI = DemiBold Italic
+ BCD = Bold Condensed Roman
+ BCDI = Bold Condensed Italic
+ BEX = Bold Extended Roman
+ BEXI = Bold Extended Italic
+ HV = Heavy Roman
+ HVI = Heavy Italic
+ HVCD = Heavy Condensed Roman
+ HVCDI = Heavy Condensed Italic
+ HVEX = Heavy Extended Roman
+ HVEXI = Heavy Extended Italic
+ BL = Black Roman
+ BLI = Black Italic
+ BLCD = Black Condensed Roman
+ BLCDI = Black Condensed Italic
+ BLEX = Black Extended Roman
+ BLEXI = Black Extended Italic
+ UBL = Ultra-Black Roman
+ UBLI = Ultra-Black Italic
+</pre>
+
+Thus, with <strong>mom</strong>, if you've installed, say, some
+extra Helvetica fonts and named them according to the convention FS
+(where &quot;F&quot; means family and &quot;S&quot; means font
+style), once having entered
+<p>
+<pre>
+ .FAMILY H
+ or
+ .FAM H
+</pre>
+
+you can access any of those Helvetica fonts simply by
+passing the correct argument from the list above to
+<a href="typesetting.html#FONT">FT</a>.
+<p>
+For example, if you were working in Medium Roman (<kbd>.FT R</kbd>)
+and you needed Medium Condensed Italic for a while (assuming it's
+installed), you'd just type
+<p>
+<pre>
+ .FT CDI
+</pre>
+
+to access the Medium Condensed Italic font from the Helvetica
+family.
+<p>
+<strong>Mom</strong>'s list of font styles doesn't pretend to
+be exhaustive, but rather tries to cover the basic weight/shape
+combinations likely to be found in any reasonably complete type
+family.
+<p>
+The actual extension names are arbitrary and can be used in a
+flexible manner. For example, if you create a family that has a
+DemiBold font (DB) but no Bold font (B), you might find it more
+convenient to give the DemiBold font the extension &quot;B&quot;.
+Equally, if the family has an ExtraBold font, you might find it more
+convenient to use the extension &quot;HV&quot; (Heavy).
+<a name="REGISTER_STYLE"></a>
+<p>
+However, you may, at needs, want to add to <strong>mom</strong>'s
+list of font styles. You can do this by editing the file, om.tmac.
+Near the top, you'll see lines of the form
+<p>
+<pre>
+ .sty \n[.fp] L \" Light Roman
+ .sty \n[.fp] LI \" Light Italic
+ .sty \n[.fp] LCD \" Light Condensed Roman
+</pre>
+
+Simply add your new font style by imitating what you see and
+plugging in your new font style (having, of course, first created the
+font, correctly named, in groff's PostScript font directory; see
+<a href="#HOWTO">How to create a PostScript font for use with groff</a>).
+<p>
+For example, if you already have some fonts from the Univers
+family installed and have called the family UN, you might decide at
+some point to add the Bold Outline font (UNBO). In which case,
+you'd add
+<p>
+<pre>
+ .sty \n[.fp] BO \" Bold Outline
+</pre>
+
+to the <kbd>.sty \n[.fp] &lt;font style&gt;</kbd> list in om.tmac.
+<p>
+Be careful, though, that any styles you add do not conflict
+with <strong><u>family</u></strong> names that already exist.
+&quot;C&quot;, for example, conflicts with the Courier family
+(CR, CI, CB, CI). Were you to create a font style &quot;C&quot;,
+thinking that <kbd>.FT C</kbd> would give you access to font style
+once you'd given a <kbd>.FAM(ILY)</kbd> directive, you'd get a nasty
+surprise: your type would come out in Courier Roman!
+<p>
+<strong>VERY IMPORTANT NOTE: mom</strong>'s font extensions are
+not &quot;user-space&quot; controllable via a macro. If you've
+been using groff for a long time, and have already rolled your own
+solution to adding PostScript families, fonts, weights, shapes, etc. to
+groff, you may find that <strong>mom</strong>'s font extensions
+conflict with your own scheme. Should that be the case, comment out
+the <kbd>.sty \n[.fp] &lt;font style&gt;</kbd> lines found near the
+top of the om.tmac file.
+
+<a name="HOWTO"><h3><u>How to create a PostScript font for use with groff</u></h3></a>
+These instructions aren't meant to cover all possibilities, merely
+to present one way of making PostScript families/fonts available to
+groff and <strong>mom</strong>.
+<p>
+GNU/Linux distributions being what they are, directory locations may
+differ and the presence of some executables can't be guaranteed.
+I run a Debian system. The instructions reflect that. Users of
+other distros will have to interpret them according to the way their
+distro operates.
+<p>
+What you need before you start:
+<br>
+<ul>
+ <li>groff, version 1.18 or higher
+ <br>
+ (Debian package: groff)
+ <li>a full installation of gs and associated tools
+ <br>
+ (Debian package: gs or gs-gpl)
+ <li>a library of gs fonts
+ <br>
+ (Debian package: gsfonts)
+ <li>a utility for converting TrueType fonts to Type1 fonts
+ <br>
+ (Debian package: ttf2pt1)
+ <li>a font manager
+ <br>
+ (Debian packages: defoma, psfontmgr, dfontmgr)
+ <li>perl
+ <br>
+ (Debian package: perl)
+</ul>
+<br>
+A reasonably complete installation of any major GNU/Linux distro
+should already have these on your system, except perhaps for the
+utility to convert TrueType fonts to Type1 fonts.
+<p>
+Initial preparation (you only have to do this once):
+<br>
+<ol>
+ <li>If you don't already have one, create a directory in your
+ home directory to hold new fonts. Any directory name will do.
+ I use ~/Fonts, with subdirectories for Type1, TrueType and Groff
+ fonts.
+<a name="SITE-FONT"></a>
+ <li>Locate the groff directory, site-font. The exact location is
+ difficult to predict, owing to differences between distros
+ and whether you're using a pre-packaged groff or have built
+ it from source. Some typical locations are
+ <br>
+ <ul>
+ <li>/usr/share/groff,
+ <li>/usr/local/share/groff
+ <li>/etc/groff
+ </ul>
+ <p>
+ If you can't find the site-font directory, locate
+ groff's site-tmac directory, and, as root, create site-font
+ in the same directory as the one that holds site-tmac.
+ E.g., if you find site-tmac in /usr/share/groff, create
+ site-font in /usr/share/groff.
+ <li>Locate the file <kbd>&lt;prefix&gt;/font/devps/generate/textmap</kbd>
+ and symlink it to <kbd>textmap</kbd> in the directory that
+ contains your personal collection of PostScript fonts. (See the
+ <a href="#SMALL_NOTE">Small Note</a>,
+ above, for the meaning of &lt;prefix&gt;). On my system,
+ at the time of writing, &lt;prefix&gt; is
+ /usr/local/share/groff/1.19.2/, therefore, I symlink it in
+ ~/Fonts/Type1 with
+ <br>
+ <pre>
+ln -s /usr/local/share/groff/1.19.2/font/devps/generate/textmap textmap
+ </pre>
+ <li>Locate the file &lt;prefix&gt;/font/devps/text.enc and
+ symlink it to <kbd>text.enc</kbd> in your personal font
+ directory. On my system, in ~/Fonts/Type1
+ <pre>
+ln -s /usr/local/share/groff/1.19.2/font/devps/text.enc text.enc
+ </pre>
+ <li>Make sure you know which directory/ies holds your gs fonts.
+ You'll need the information later. On a Debian box, some
+ typical locations are
+ <br>
+ <ul>
+ <li>/usr/lib/ghostscript/fonts
+ <li>/usr/share/ghostscript/fonts
+ <li>/usr/share/fonts/type1/gsfonts
+ </ul>
+</ol>
+<br>
+Font creation/installation:
+<br>
+<ol>
+ <li>Acquire the font in either Type1 (.pfb) or TrueType
+ (.ttf) format.
+ <li>Place the font in your personal font directory; for me,
+ that's ~/Fonts/Type1 or ~/Fonts/TrueType.
+ <li>In your personal font directory, run one of the following:
+ <br>
+ <ul>
+ <li>For Type1 fonts
+ <br>
+ <ul>
+ <li><kbd>getafm fontfilename.pfb | gsnd - > fontfilename.afm</kbd>
+ <br>
+ For Type1 fonts, this will generate something called
+ an .afm (Adobe Font Metrics) file, which is
+ required to create PostScript fonts for groff.
+ </ul>
+ <li>For TrueType fonts
+ <br>
+ <ul>
+ <li><kbd>ttf2pt1 \-b fontfilename.ttf</kbd>
+ <br>
+ For TrueType fonts, this will generate a PostScript
+ .pfb file as well as an .afm file.
+ </ul>
+ </ul>
+ <li>Still in your personal font directory, run
+ <br>
+ <ul>
+ <li><kbd>afmtodit -e text.enc fontfilename.afm textmap GROFF_FONTNAME</kbd>
+ </ul>
+ <p>
+ Q: <em>How do I choose a GROFF_FONTNAME?</em>
+ <p>
+ A: Start by considering the
+ <a href="definitions.html#TERMS_FAMILY">family</a>
+ to which the font belongs. If you're adding to a family that
+ already exists in groff's &lt;prefix&gt;/font/devps
+ directory, that will be the first part of the font name.
+ (See
+ <a href="typesetting.html#FAMILY">here</a>
+ for a list of families already installed, along with their groff
+ names.) Add to that name the appropriate weight/style extension,
+ listed
+ <a href="#STYLE_EXTENSIONS">here</a>.
+ <p>
+ For example, if you're adding Helvetica Light Roman, your
+ GROFF_FONTNAME would be <strong>HL</strong>. If you're
+ adding Helvetica Light Italic, your GROFF_FONTNAME would be
+ <strong>HLI</strong>.
+ <p>
+ If you're adding a font not already in groff's PostScript
+ families, first choose a meaningful name for the
+ <a name="definitions.html#TERMS_FAMILY">family</a>
+ to which the font belongs. The name can be anything you like. If,
+ for example, the family is Garamond, you could choose GARAMOND,
+ GARA, GD, or even just plain G as the family name. Then tack on the
+ appropriate style/weight extension. Thus, if you were installing
+ Garamond Bold Condensed Italic and had chosen <strong>GD</strong>
+ as the family name for Garamond, your GROFF_FONTNAME would be
+ <strong>GDBCDI</strong>.
+ <p>
+ In <strong>mom</strong>, you can then access the Garamond
+ family with <kbd>.FAM GD</kbd>, and the Bold Condensed
+ Italic font wth <kbd>.FT BCDI</kbd>.
+ <p>
+ <strong>Note:</strong> The family name need not be in upper
+ case, and there's no limit to the length of the name.
+ &quot;Garamond&quot;, for example, could be the name you
+ give the Garamond family. In fact, you might find it
+ preferable, since a) you wouldn't have to remember how
+ you'd named the family, and b) should you be scanning
+ your
+ <a href="#SITE-FONT">site-font directory</a>,
+ something like GaramondBCDI will be more meaningful than,
+ say, GDBCDI.
+ <li>Copy or move GROFF_FONTNAME to your
+ <a href="#SITE-FONT">site-font directory</a>,
+ or change to the site-font directory and make a symlink to
+ GROFF_FONTNAME in your personal directory.
+ <li>Copy or move the .pfb file to the directory that
+ holds your gs fonts, or change to that directory and make a
+ symlink to the .pfb file in your personal directory.
+ <li>Do whatever your system or distro requires in order to
+ register the new PostScript font (the .pfb file). On a
+ Debian system, as root, you can run dfontmgr for a
+ graphical interface that will take care of registering the
+ font.
+</ol>
+<p>
+Written out in full, adding fonts looks like a lot of work. It
+isn't. Basically, it's just:
+<br>
+<ul>
+ <li>acquire the font
+ <li>generate an .afm file for the font
+ <li>create the groff font
+ <li>put the groff font in &lt;prefix&gt;/font/devps
+ <li>make sure gs knows about the font
+</ul>
+<br>
+After you've done it a couple of times, it all makes sense, and is
+really quite easy. Not to mention that once you understand the
+process, you can write a bash script to automate the process.
+Here's an example, which you can adapt to your own needs. The
+script requires an argument (the .pfb filename), then prompts for
+the GROFF_FONTNAME.
+<p>
+<pre>
+#!/bin/bash
+
+# A script for installing Type1 fonts.
+#
+# Builds .afm files from .pfb files, generates a groff font from the
+# .afm file, makes a symlink in /usr/lib/ghostscript/font/ to the
+# .pfb file, and a symlink in site-font to the groff font
+
+# .pfb filename, stripped of .pfb extension
+FONT=`basename $1 .pfb`
+
+# Directory holding my personal collection of type1 fonts
+FONTDIR="$HOME/Fonts/Type1"
+
+# Directory holding system ghostscript fonts
+GS_FONTDIR="/usr/lib/ghostscript/fonts"
+
+# Location of site-font/devps
+GROFF_SITE_FONTDIR="/usr/local/share/groff/site-font/devps"
+
+# Personal groff fonts directory
+GROFF_FONTS="$HOME/Fonts/Groff"
+
+# Symlinks to textmap and text.enc
+TEXTMAP="$FONTDIR/textmap"
+TEXTENC="$FONTDIR/text.enc"
+
+if [ ! `pwd` = "$FONTDIR" ] ; then
+ echo "Changing into $FONTDIR directory.."
+ cd $FONTDIR
+ sleep 1
+else
+ sleep 1
+fi
+
+echo -n "Groff name for this font: "
+read FONTNAME
+sleep 1
+
+echo "Getting .afm.."
+getafm $FONT.pfb | gsnd - > $FONT.afm
+sleep 1
+
+echo "Creating $FONTNAME.."
+afmtodit -e $TEXTENC $FONTDIR/$FONT.afm $TEXTMAP $FONTNAME
+mv -i $FONTNAME $GROFF_FONTS
+sudo ln -s $GROFF_FONTS/$FONTNAME $GROFF_SITE_FONTDIR/$FONTNAME
+sleep 1
+
+echo "Linking $FONT in $GS_FONTDIR.."
+cd $GS_FONTDIR
+sudo ln -s $FONTDIR/$FONT.afm $FONT.afm
+sudo ln -s $FONTDIR/$FONT.pfb $FONT.pfb
+sleep 1
+
+# This next bit is Debian specific. If you're not running a
+# Debian system, replace it with whatever your distro requires
+# in order to register Type1 fonts.
+
+if [ !`pidof -x /usr/bin/dfontmgr` ] ; then
+ echo "I will now run dfontmgr so you can register the font."
+ exec sudo dfontmgr &
+else
+ echo "You may now register the font with dfontmgr."
+fi
+</pre>
+<hr>
+
+<!=====================================================================>
+
<a name="CODENOTES">
<h2><u>Some reflections on mom</u></h2>
</a>
@@ -183,6 +674,10 @@ Please include the word &quot;mom&quot; or &quot;groff&quot; in the
Subject: line of any message sent to my personal address, or you
risk the wrath of my implacable spam filters. :)
<p>
+If you want to visit <strong>mom</strong>'s homepage, you'll find
+it
+<a href="http://www.ncf.ca/~df191/mom.html">here</a>.
+<p>
<hr>
<a href="reserved.html#TOP">Next</a>&nbsp;&nbsp;
<a href="macrolist.html#TOP">Prev</a>&nbsp;&nbsp;
diff --git a/contrib/mom/momdoc/cover.html b/contrib/mom/momdoc/cover.html
index ecc26814..1a95b9c7 100644
--- a/contrib/mom/momdoc/cover.html
+++ b/contrib/mom/momdoc/cover.html
@@ -133,7 +133,7 @@ and
<p>
Similarly, if you request miscellaneous information (and have already given
<strong>mom</strong> the reference macro,
-<a href="docprocessing.html#MISC">MISC</a>,
+<a href="docprocessing.html#MISC">MISC</a>),
she sets it, by default, in a smaller point size in the bottom left
hand corner of the cover (or doc cover) page. The default point
size is dependent on
diff --git a/contrib/mom/momdoc/definitions.html b/contrib/mom/momdoc/definitions.html
index 1743ecdb..09e204f3 100644
--- a/contrib/mom/momdoc/definitions.html
+++ b/contrib/mom/momdoc/definitions.html
@@ -61,9 +61,11 @@ or concept you're not familiar with.
<li><a href="#TERMS_PS">Point Size</a>
<li><a href="#TERMS_QUAD">Quad</a>
<li><a href="#TERMS_RAG">Rag</a>
+ <li><a href="#TERMS_SHAPE">Shape</a>
<li><a href="#TERMS_SOLID">Solid/set solid</a>
<li><a href="#TERMS_TRACKKERNING">Track kerning/Line kerning</a>
<li><a href="#TERMS_UNBREAKABLESPACE">Unbreakable space</a>
+ <li><a href="#TERMS_WEIGHT">Weight</a>
<li><a href="#TERMS_WORDSPACE">Word space</a>
<li><a href="#TERMS_XHEIGHT">x-height</a>
</ul>
@@ -128,7 +130,7 @@ point text reverts to the left margin.
letter M at a given
<a href="#TERMS_PS">point size</a>
in a given
-<a name="#TERMS_FONT">font</a>.
+<a href="#TERMS_FONT">font</a>.
Since most Ms are designed square, an em is usually (but sometimes
erroneously) considered to be the same size as the current point
size (i.e. if the point size of the type is 12, one em equals 12
@@ -169,10 +171,16 @@ In groff, fixed width space is entered with
where &lt;space&gt; means "hit the spacebar on your keyboard."
<dt><a name="TERMS_FONT"><em>Font</em></a>
-<dd>The specific style of type within a
+<dd>The specific
+<a href="#TERMS_WEIGHT">weight</a>
+and
+<a href="#TERMS_SHAPE">shape</a>
+of type within a
<a href="#TERMS_FAMILY">family</a>,
-e.g. roman, italic. Groff understands four fonts within any given
-family: roman, italic, bold, and bold italic.
+e.g. light, medium, bold (which are weights), and roman, italic,
+condensed (which are shapes). By default, groff knows of four fonts
+within its default set of families: R (medium roman), I (medium
+italic), B (bold roman) and BI (bold italic).
<dt><a name="TERMS_FORCE"><em>Force justify
</em></a>
@@ -290,6 +298,29 @@ type that is
<a href="#TERMS_QUAD">quadded</a>
left.
+<dt><a name="TERMS_SHAPE"><em>Shape</em></a>
+<dd>The degree of slant and/or the width of characters.
+(Technically speaking, this is not a proper typesetting term;
+however, it may help clarify some concepts presented in these
+documents.)
+<p>
+Some typical shapes are:
+<ul>
+ <li>&quot;Roman&quot;, which has no slant, and has letterforms of
+ average width
+ <li>&quot;Italic&quot;, which is slanted, and has letterforms
+ of average width
+ <li>&quot;Condensed&quot;, which has no slant, but has
+ letterforms narrower than the average represented by Roman
+ <li>&quot;Condensed Italic&quot;, which is slanted, with letterforms narrower
+ than average
+</ul>
+The term
+<a href="#TERMS_FONT">font</a>,
+as it is used in these documents, refers to a combination of
+<a href="#TERMS_WEIGHT">weight</a>
+and shape.
+
<dt><a name="TERMS_SOLID"><em>Solid/set solid</em></a>
<dd>When no
<a href="#TERMS_LEADING">lead</a>
@@ -310,7 +341,7 @@ The correct term is letter spacing, but track kerning and line kerning
<a href="#TERMS_WORDSPACE">word space</a>,
however words separated by an unbreakable space will always be kept
together on the same line. Expands and contracts like word space.
-Useful for proper names, which one should, whenever possibly, avoid
+Useful for proper names, which one should, whenever possible, avoid
splitting onto two lines. In groff, unbreakable space is entered
with
<p>
@@ -320,6 +351,15 @@ with
(backslash followed by a tilde).
+<dt><a name="TERMS_WEIGHT"><em>Weight</em></a>
+<dd>The thickness of the strokes of letterforms. Medium and Book
+have average thicknesses and are the weights used for most of the
+text in books, magazines, newspapers, etc. Light has strokes
+slightly thinner than Medium or Book, but is still acceptable for
+most text. Semibold, Bold, Heavy and Black all have strokes of
+increasing thickness, making them suitable for heads, subheads,
+headlines and the like.
+
<dt><a name="TERMS_WORDSPACE"><em>Word space</em></a>
<dd>The amount of whitespace between words. When text is
<a href="#TERMS_JUST">justified</a>,
@@ -533,7 +573,7 @@ Because string arguments must be enclosed by double-quotes, you can't
use double-quotes as part of the string argument. If you need
double-quotes to be part of a string argument, use the
<a href="#TERMS_INLINES">inline escapes</a>
-\(lq</strong> and <strong>\(rq</strong> (leftquote and rightquote
+<strong>\(lq</strong> and <strong>\(rq</strong> (leftquote and rightquote
respectively) in place of the double-quote character (").
<dt><a name="TERMS_UNITOFMEASURE"><em>Unit of measure</em></a>
@@ -569,7 +609,8 @@ that set the size or measure of something MUST be given a unit of
measure. <strong>mom</strong>'s macros do not have default units
of measure. There are a couple of exceptions, the most notable of
which are <strong>PT_SIZE</strong> and <strong>LS</strong>. Both use
-<strong>*points</strong> as the default unit of measure, which means
+<a href="#TERMS_PICASPOINTS">*points</a>
+as the default unit of measure, which means
you don't have to append &quot;p&quot; to their argument.
<p>
You can enter decimal values for any unit of measure. Different units
diff --git a/contrib/mom/momdoc/docelement.html b/contrib/mom/momdoc/docelement.html
index 194e5e73..e2fffc74 100644
--- a/contrib/mom/momdoc/docelement.html
+++ b/contrib/mom/momdoc/docelement.html
@@ -2036,10 +2036,10 @@ oblige.
A small amount of vertical whitespace and a short horizontal rule
separate footnotes from the document body. The amount of whitespace
varies slightly from page to page depending on the number of lines
-in the footnotes. <strong>Mom</strong> tries for a nice balance
+in the footnotes. <strong>Mom</strong> tries for a nice balance
between too little whitespace and too much, but when push comes to
-shove, she'll opt for ample over cramped. The last lines of footnotes
-are always flush with the document's bottom margin.
+shove, she'll usually opt for ample over cramped. The last lines of
+footnotes are always flush with the document's bottom margin.
<p>
If <strong>mom</strong> sees that a portion of a footnote cannot
be fit on its page, she carries that portion over to the next
@@ -2075,6 +2075,18 @@ a page is always marked with a single star, so if readers see, say,
a dagger or double-dagger marking the first footnote entry, they'll
know the entry belongs to the previous page).
<p>
+Very exceptionally, two footnotes may have to be deferred (e.g. one
+occurs on the second to last line of a page, and another on the
+last line). In such a circumstance, <strong>mom</strong> does not
+add a blank after the second deferred footnote. If you'd like a
+blank line separating both deferred footnotes from any footnotes
+proper to the page the deferred ones were moved to, add the space
+manually with by putting a
+<a href="typesetting.html#SPACE">.SPACE</a>
+command at the end of the footnote text, before
+<strong>FOOTNOTE OFF</strong> (or <strong>FOOTNOTE X, QUIT,
+EXIT, etc...</strong>).
+<p>
Obviously, deferred footnotes aren't an issue if you request numbered
footnotes that increase incrementally throughout the whole document --
yet another convenience <strong>mom</strong> has thought of.
@@ -2270,6 +2282,20 @@ the rule, not lower it. A
<a href="definitions.html#TERMS_UNITOFMEASURE">unit of measure</a>
is required.
<p>
+<strong>Tip:</strong> If your
+<a href="definitions.html#TERMS_LEADING">leading</a>
+is 2
+<a href="definitions.html#TERMS_PICASPOINTS">points</a>
+or less (e.g your
+<a href="definitions.html#TERMS_PS">point size</a>
+is 10 and your linespacing is 10, 11, or 12, lowering
+<strong>mom</strong>'s default footnote rule adjustment will almost
+certainly give you nicer looking results than leaving the
+adjustment at the default. Furthermore, you can invoke
+<strong>FOOTNOTE_RULE_ADJ</strong> on any page (or in any column)
+in which footnotes appear, so that the placement of the footnote
+rule can be changed on-the-fly, should you wish to do so.
+<p>
<hr>
<!====================================================================>
diff --git a/contrib/mom/momdoc/docprocessing.html b/contrib/mom/momdoc/docprocessing.html
index 59fd91f0..96dfdd67 100644
--- a/contrib/mom/momdoc/docprocessing.html
+++ b/contrib/mom/momdoc/docprocessing.html
@@ -345,7 +345,7 @@ need to get <strong>mom</strong>'s document leading back on track.
<p>
For example, say you want to insert a picture into a document with
the special groff macro, <strong>PSPIC</strong> (see the
-<strong>grops</strong> man page for usage).
+<strong>groff_tmac</strong> man page for usage).
<p>
Pictures aren't usually conveniently sized in multiples of document
leading, which means that when you insert the picture, you disrupt
@@ -643,10 +643,11 @@ winner again.
The reference macros give <strong>mom</strong> the information
she needs to generate
-<a href="definitions.html#TERMS_DOCHEADER">docheaders</a>
+<a href="definitions.html#TERMS_DOCHEADER">docheaders</a>,
+<a href="definitions.html#TERMS_HEADER">page headers</a>,
and
-<a href="definitions.html#TERMS_HEADER">page headers</a>. They
-must go at the top of any file that uses <strong>mom</strong>'s
+<a href="cover.html#COVER_TOP">covers</a>.
+They must go at the top of any file that uses <strong>mom</strong>'s
document processing macros.
<p>
<a name="INDEX_REFERENCE">
@@ -767,7 +768,7 @@ and the title is most likely in caps, I recommend caps/lower case.
<a name="AUTHOR"></a>
Macro: <strong>AUTHOR</strong> <var>&quot;&lt;author string&gt;&quot; [ &quot;&lt;author2 string&gt;&quot; &quot;&lt;author3 string&gt;&quot; ... ]</var>
<br>
-<em>*Multiple arguments must be enclosed in double-quotes</em>
+<em>*Multiple arguments must all be enclosed in double-quotes</em>
<p>
Each author string can hold as many names as you like, e.g.
@@ -839,6 +840,8 @@ page-headers.
<p>
<a name="CHAPTER_TITLE"></a>
Macro: <strong>CHAPTER_TITLE</strong> <var>&quot;&lt;chapter title&gt;&quot;</var>
+<br>
+<em>*Argument must be enclosed in double-quotes</em>
<p>
If, either in addition to or instead of &quot;Chapter #&quot; appearing
@@ -861,7 +864,8 @@ top of the chapter, like this:
</pre>
In such a case, by default, only the chapter's title will appear in the
-page headers, not &quot;Chapter #&quot;.
+<a href="definitions.html#TERMS_HEADER">page headers</a>,
+not &quot;Chapter #&quot;.
<p>
If you omit <strong>CHAPTER</strong> when setting up your reference
macros, only the title will appear, both at the top of page one and in
@@ -1018,6 +1022,8 @@ either or both.
<p>
<a name="COPYRIGHT"></a>
Macro: <strong>COPYRIGHT</strong> <var>&quot;&lt;copyright info&gt;&quot;</var>
+<br>
+<em>*Argument must be enclosed in double-quotes</em>
<p>
The argument passed to <strong>COPYRIGHT</strong> is only used on
@@ -1037,6 +1043,8 @@ you.
<p>
<a name="MISC"></a>
Macro: <strong>MISC</strong> <var>&quot;&lt;argument 1&gt;&quot; [&quot;&lt;argument 2&gt;&quot; &quot;&lt;argument 3&gt;&quot; ...]</var>
+<br>
+<em>*Multliple arguments must all be enclosed in double-quotes</em>
<p>
The argument(s) passed to <strong>MISC</strong> are only used on
@@ -1068,6 +1076,8 @@ and the information would appear on the essay's cover page.
Macro: <strong>COVERTITLE</strong> <var>&quot;&lt;user defined cover page title&gt;&quot;</var>
<br>
Macro: <strong>DOC_COVERTITLE</strong> <var>&quot;&lt;user defined document cover page title&gt;&quot;</var>
+<br>
+<em>*Argument must be enclosed in double-quotes</em>
<p>
The argument passed to <strong>COVERTITLE</strong> or
@@ -1777,7 +1787,7 @@ like the way <strong>mom</strong> does things) and use
<strong>DOCHEADER OFF</strong> with its optional distance argument
to ensure that the body of your document starts where you want.
You can even insert a PostScript file (with <strong>.PSPIC</strong>;
-see the <strong>grops</strong> man page for usage).
+see the <strong>groff_tmac</strong> man page for usage).
<p>
<a name="DOCHEADER_CONTROL"><h3><u>How to change the look of docheaders: docheader control macros</u></h3></a>
diff --git a/contrib/mom/momdoc/goodies.html b/contrib/mom/momdoc/goodies.html
index 3da5872c..3723d8f9 100644
--- a/contrib/mom/momdoc/goodies.html
+++ b/contrib/mom/momdoc/goodies.html
@@ -928,6 +928,8 @@ rest she solves with macros that change the default behaviour of
<br>
<a href="#DROPCAP_FONT">DROPCAP_FONT</a>,
<br>
+<a href="#DROPCAP_COLOR">DROPCAP_COLOR</a>,
+<br>
<a href="#DROPCAP_ADJUST">DROPCAP_ADJUST</a>
<br>
and
diff --git a/contrib/mom/momdoc/inlines.html b/contrib/mom/momdoc/inlines.html
index 09dd04be..50e197b8 100644
--- a/contrib/mom/momdoc/inlines.html
+++ b/contrib/mom/momdoc/inlines.html
@@ -513,7 +513,7 @@ moves you 1.25 inches to the right (forwards) of the horizontal
position on the current
<a href="definitions.html#TERMS_OUTPUTLINE">output line</a>.
<strong>\h'&lt;distance&gt;'</strong> is exactly equivalent to
-<a href="#FWD"><strong>\*[FWD #&lt;unit&gt;]</strong></a>.
+<a href="#FWD"><strong>\*[FWD n&lt;unit&gt;]</strong></a>.
<p>
<pre>
\h'-1.25i'
@@ -521,7 +521,7 @@ position on the current
moves you 1.25 inches to the left (backwards).
<strong>\h'-&lt;distance&gt;'</strong> is exactly equivalent to
-<a href="#BCK"><strong>\*[BCK #&lt;unit&gt;]</strong></a>.
+<a href="#BCK"><strong>\*[BCK n&lt;unit&gt;]</strong></a>.
<p>
<!---INLINE_VERTICAL_GROFF--->
@@ -546,7 +546,7 @@ moves you (approx.) 2/3 of an
downward on the current
<a href="definitions.html#TERMS_OUTPUTLINE">output line</a>.
<strong>\v'&lt;distance&gt;'</strong> is exactly equivalent to
-<a href="#DOWN"><strong>\*[DOWN #&lt;unit&gt;]</strong></a>.
+<a href="#DOWN"><strong>\*[DOWN n&lt;unit&gt;]</strong></a>.
<p>
<pre>
\v'-.6m'
@@ -554,7 +554,7 @@ downward on the current
moves you (approx.) 2/3 of an em upward.
<strong>\v'&lt;-distance&gt;'</strong> is exactly equivalent to <a
-href="#UP"><strong>\*[UP #&lt;unit&gt;]</strong></a>.
+href="#UP"><strong>\*[UP n&lt;unit&gt;]</strong></a>.
<p>
<strong>IMPORTANT:</strong> The vertical motion of <strong>\v</strong>
affects ONLY type on the current
@@ -639,7 +639,7 @@ I tend not to use them. A firm believer in the &quot;right tool for
the job,&quot; I prefer a vector drawing program (in my case, tgif)
when I need to combine type with graphic elements (say, a complex
ruled form). Inserting the results into a document is easy enough
-with <strong>.PSPIC</strong> (consult the <strong>grops</strong>
+with <strong>.PSPIC</strong> (consult the <strong>groff_tmac</strong>
man page for information on this indispensable and easy-to-use macro).
<p>
diff --git a/contrib/mom/momdoc/intro.html b/contrib/mom/momdoc/intro.html
index 2b20150f..d3620c68 100644
--- a/contrib/mom/momdoc/intro.html
+++ b/contrib/mom/momdoc/intro.html
@@ -26,6 +26,8 @@
<br>
<a href="#INTRO_DOCUMENTATION">A note on mom's documentation</a>
<br>
+<a href="#CANONICAL">Canonical reference materials</a>
+<br>
<a href="#MACRO_ARGS">How to read macro arguments</a>
<h2><a name="INTRO_INTRO"><u>Who is mom meant for?</u></a></h2>
@@ -259,7 +261,9 @@ not about document processing. Even experts have odd lacunae in
their knowledge base. Therefore, whenever I suspect that a term
or procedure will cause head scratching, I offer an explanation.
And when explanations aren't enough, I offer examples.
-<a name="CANONICAL"></a>
+<br>
+
+<a name="CANONICAL"><h3><u>Canonical reference materials</u></h3></a>
<p>
The canonical reference materials for groff are
<strong>cstr54</strong> (a downloadable PostScript copy of which is
@@ -267,14 +271,15 @@ available
<a href="http://www.kohala.com/start/troff/">here</a>)
and the <strong>troff</strong> and <strong>groff_diff</strong>
manpages. Another excellent source of information (maybe the best)
-are the groff <strong>info</strong> pages, available by typing
+is the groff <strong>info</strong> pages, available by typing
<p>
<pre>
info groff
</pre>
at the command line (assuming you have <strong>info</strong>
-installed on your system).
+installed on your system). And for inputting special characters,
+see <strong>man groff_char.</strong>
<p>
I've tried to avoid reiterating the information contained in these
documents; however, in a few places, this has proved impossible.
diff --git a/contrib/mom/momdoc/letters.html b/contrib/mom/momdoc/letters.html
index bd925dca..b1aa13d2 100644
--- a/contrib/mom/momdoc/letters.html
+++ b/contrib/mom/momdoc/letters.html
@@ -210,9 +210,10 @@ which is the standard for North American business correspondence.
If you switch the order of <strong>.DATE</strong>,
<strong>.TO</strong> and/or <strong>.FROM</strong>,
<strong>mom</strong> sets all the headers flush left, with a gap of
-one linespace underneath. (The default left quad of any header can
-be changed by invoking the <strong>.RIGHT</strong> macro, on a line
-by itself, immediately before inputting the text of the header.)
+one linespace underneath each. (The default left quad of any header
+can be changed by invoking the <strong>.RIGHT</strong> macro, on
+a line by itself, immediately before inputting the text of the
+header.)
<p>
Following the headers, <strong>mom</strong> sets
<p>
diff --git a/contrib/mom/momdoc/macrolist.html b/contrib/mom/momdoc/macrolist.html
index a358d291..549d2750 100644
--- a/contrib/mom/momdoc/macrolist.html
+++ b/contrib/mom/momdoc/macrolist.html
@@ -205,9 +205,14 @@ sensibly.
</tr>
<tr>
<td><a href="typesetting.html#FONT">FT</a></td>
- <td><a href="inlines.html#INLINE_SIZE_MOM">\*[SIZE n]</a>
+ <td><a href="inlines.html#INLINE_SIZE_MOM">\*[SIZE n]</a></td>
<td><a href="typesetting.html#AUTOLEAD">AUTOLEAD</a></td>
</tr>
+<tr>
+ <td><a href="typesetting.html#FALLBACK_FONT">FALLBACK_FONT</a></td>
+ <td></td>
+ <td></td>
+</tr>
</table>
<a name="3"><h3 align="center">Font modifications (pseudo-italic, -bold, -condensed, -extended)</h3>
diff --git a/contrib/mom/momdoc/reserved.html b/contrib/mom/momdoc/reserved.html
index 88bc824c..99c80e6c 100644
--- a/contrib/mom/momdoc/reserved.html
+++ b/contrib/mom/momdoc/reserved.html
@@ -55,20 +55,21 @@ DO_T_MARGIN Margin at top of page; trap-invoked
Style
-----
-COLOR Change color of text to predefined value
-CONDENSE Set percentage of pseudo-condense (alias of
- CONDENSE_OR_EXTEND)
-EXTEND Set percentage of pseudo-extend (alias of
- CONDENSE_OR_EXTEND)
-FAMILY Family
-FT Font
-LL Line length
-LS Leading (.vs)
-NEWCOLOR Define a text color
-PT_SIZE Point size
-SETBOLDER Set degree of emboldening (pseudo-bold) in units
-SETSLANT Set degree of pseudo-italic
-XCOLOR Initialize a color from rgb.txt
+COLOR Change color of text to predefined value
+CONDENSE Set percentage of pseudo-condense (alias of
+ CONDENSE_OR_EXTEND)
+EXTEND Set percentage of pseudo-extend (alias of
+ CONDENSE_OR_EXTEND)
+FAMILY Family
+FT Font
+FALLBACK_FONT Font to use whenever FAMILY or FT errors occur
+LL Line length
+LS Leading (.vs)
+NEWCOLOR Define a text color
+PT_SIZE Point size
+SETBOLDER Set degree of emboldening (pseudo-bold) in units
+SETSLANT Set degree of pseudo-italic
+XCOLOR Initialize a color from rgb.txt
Autolead
--------
@@ -183,6 +184,7 @@ TYPESIZE Diverts SIZESPECS routine so it doesn't print
+++NUMBER REGISTERS+++
+#ABORT_FT_ERRORS Abort on FT errors? (toggle)
#ALD ALD value
#ARGS_TO_LIST Tells LIST whether LIST was invoked with a legal
arg; controls LIST OFF processing
@@ -231,6 +233,8 @@ c column mark
#INDENT_STYLE_RIGHT Indicates IR when #INDENT_ACTIVE=1 (toggle)
#INDENT_STYLE_TEMP Indicates IT when #INDENT_ACTIVE=1 (toggle)
#IX_WARN Toggles to 1 the first time IX is user-invoked
+#JUSTIFY In EW/RW, when BR_AT_LINE_KERN, whether to
+ break or break-spread preceding line (toggle)
#KERN Kern on? (toggle)
#LAST_TAB Last tab number set in multi-columns
#LEAD Leading (alias)
@@ -331,10 +335,11 @@ $FONT Font
$PAD_MARKER Character to mark off padding in PAD
$PAD_STRING Arg passed to PAD
$QUAD_VALUE Quad value (left, right, centre, justify)
-$QUOTE0 ``
-$QUOTE1 ''
+$QUOTE0 Open quotation marks
+$QUOTE1 Close quotation marks
$RESTORE_QUAD_VALUE Quad value for use in restoring L, R, C, J
(after tabs)
+$SAVED_STYLE Current style, if there is one (used in FAMILY)
$SEPARATOR&lt;n&gt; Separator for depth &lt;n&gt; in lists
$SS_VAR Holds + or - sentence space value
$ST&lt;#&gt;_FILL Always QUAD if QUAD passed to ST &lt;#&gt;
@@ -789,6 +794,10 @@ DO_COVER Formats and outputs covers
DO_DOC_COVER Formats and outputs doc covers
D0_QUOTE Outputs quotes with space adjustments before
and after
+DIVER_FN_1_PRE -+
+DIVER_FN_2_PRE | Manage footnotes called inside diversions
+ | QUOTE, BLOCKQUOTE and EPIGRAPH
+DIVER_FN_2_POST -+
DIVERT_FN_LEFTOVER Diverts excess fn stored in FN_OVERFLOW into
FOOTNOTE
DIVERT_FN_OVERFLOW Diverts excess fn stored in FN_OVERFLOW when
@@ -818,6 +827,12 @@ TRAPS Sets hdrftr traps; optionally adjusts #DOC_LEAD
to fill page to #B_MARGIN
TYPEWRITER Sets family (C), font (R) and point size (12)
for PRINTSTYLE TYPEWRITE
+VFP_CHECK Trap-sprung macro 1 legal baseline higher than
+ where FOOTER will be sprung; checks whether
+ there is, in fact, just enough room for
+ another line of running text to be added to
+ the page without jamming footnotes too close
+ to running text.
+++DIVERSIONS+++
@@ -836,6 +851,10 @@ TOC_ENTRIES TOC entries
+++NUMBER REGISTERS+++
+#1ST_FN_VP_ADJ An adjustment factor that ensures VFP
+ doesn't fall below what should be the
+ correct last printed line of running
+ text
#ADJ_DOC_LEAD Adjust DOC_LEAD? (toggle)
#ADJ_TOC_LEAD Adjust TOC_LEAD? (toggle)
#ARG_NUM Keeps track of number of args passed to a
@@ -891,9 +910,9 @@ TOC_ENTRIES TOC entries
#DATE_FIRST Was .DATE invoked as first letter
header after .START? (toggle)
dc "mark" register for document columns
-#DEFER_FN_IN_DIVER Register that tells FOOTNOTE whether to
- "move" or "defer" a fn collected inside
- a diversion
+#DIVER_FN Register that tells FOOTNOTE whether to
+ "move" or "defer" a footnote collected
+ inside a diversion
#DEFER_PAGINATION Tells COLLATE to restore pagination (from
RESTORE_PAGINATION
#DEPTH_1 Doc header depth with lead adjustment
@@ -901,6 +920,15 @@ dc "mark" register for document columns
#DEPTH_2 Doc header depth without lead adjustment
(#DOCHEADER_LINES * #DOC_LEAD)
#DEPTH_TO_B_MARGIN Page length minus #B_MARGIN
+#DIVERSIONS_HY_MARGIN A reasonable value for .hym applied to
+ QUOTE, BLOCKQUOTE and EPIGRAPH to
+ avoid excessive hyphenation if these are
+ set quad left
+#DIVERTED Set to 1 in DIVERT_FN_OVERFLOW; reset
+ subsequently in FOOTNOTES when called by
+ PROCESS_FN_LEFTOVER to 2 or 3 for use by
+ FOOTER to decide whether to in/decrease
+ #FN_DEPTH when outputting footnotes
#DOCHEADER_ADVANCE Distance from top-of-page to baseline of
docheader
#DOCHEADER_COLOR Colored docheader? (toggle)
@@ -1006,6 +1034,8 @@ dc "mark" register for document columns
#FN_COUNT Which fn marker to print; also to
tell mom to reserve space for and print
the rule above footnotes
+#FN_COUNT_AT_FOOTER The FN_COUNT after FOOTNOTES has been
+ output in FOOTER
#FN_COUNT_FOR_COLS Holds a separate footnote count for columns
(so they don't reset to 0 1 until page break)
#FN_DEFER Defer footnote to next page/column? (toggle)
@@ -1016,6 +1046,10 @@ dc "mark" register for document columns
#FN_DEPTH Depth of footnote diversion(s)
#FN_FOR_EPI Signals to epigraph that a footnote is being
processed
+#FN_GAP When there are footnotes on a page, the
+ difference between where FOOTER will be
+ sprung and the next legal baseline.
+ Used in VFP_CHECK.
#FN_LEAD Lead in footnotes after FN_AUTOLEAD is
applied
#FN_L_INDENT Left indent of INDENT LEFT in footnotes
@@ -1027,12 +1061,16 @@ dc "mark" register for document columns
(and fns) when numbers instead of
star/dagger is being used for footnootes
numbers
+#FN_OVERFLOW_TRAP_POS The register that sets the position of
+ trap FN_OVERFLOW_TRAP.
#FN_R_INDENT Right indent of INDENT RIGHT in footnotes
#FN_RULE_ADJ # of points to raise footnote separator from
its baseline
#FN_RULE_LENGTH Length of footnote separator rule
#FN_RULE Print fn rule? (toggle)
#FN_WAS_DEFERED Tells HEADER about a deferred footnote
+#FOOTER_DIFF In TRAPS, the difference between the
+ original #B_MARGIN and #VISUAL_B_MARGIN
#FOOTER_GAP Amount of space between end of text and
page #
#FOOTER_MARGIN Amount of space between page # and bottom
@@ -1043,7 +1081,21 @@ dc "mark" register for document columns
#FOOTERS_WERE_ON Were footers on? - used in FINIS and BLANKPAGE
(toggle)
#FOOTNOTE_COLOR Colored footnotes? (toggle)
+#FROM_DIVERT_FN Signals to FOOTNOTE, when run from
+ within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING
+ to the total area allowable for running text
+#FROM_FOOTER In col to col footnote processing, tells
+ FOOTNOTE that FOOTNOTES was output from
+ FOOTER.
+#FROM_HEADER In col to col footnote processing, tells
+ FOOTNOTE that FOOTNOTES was output from
+ HEADER.
#FULLSPACE_QUOTES Should we fullspace quotes? (toggle)
+#GET_DEPTH Signals to FOOTNOTE that it should
+ measure the depth of current footnotes
+ plus the most recently added one, except
+ where the footnote is to be deferred to
+ the next page or column
#GUTTER Width of gutter between columns
#HDRFTR_CENTER_CAPS CENTER part of header/footer in caps?
(toggle; default=off)
@@ -1100,14 +1152,18 @@ dc "mark" register for document columns
#MISC_NUM Number of MISC lines
#MISCS =#MISC_NUM in DO_COVER
#n%_AT_PAGENUM_SET Page # from n% when PAGENUMBER invoked
+#NEEDS_SPACE Instruct FOOTNOTE, when called by
+ PROCESS_FN_IN_DIVER, that if the footnote
+ had to be deferred, the VFP must be
+ raised by 1v (set in DIVER_FN_2_PRE)
#NEXT_AUTHOR Supplies correct digit to AUTHOR_&lt;#&gt;
when printing authors in doc header
#NEXT_MISC Incrementing counter for misc lines in
DO_COVER
-#NO_EXTRA_SPACE In FOOTNOTE, moves FOOTER trap down by
- 1 line (needed for special cases of
- deferred footnotes that have been collected
- inside a diversion
+#NO_BACK_UP Instructs FN_OVERFLOW_TRAP not to
+ subtract 1 line of footnote lead from
+ FN_OVERFLOW in a PREV_FN_DEFERRED
+ situation.
#NO_TRAP_RESET Should we reset page traps? (toggle)
#NUM_AUTHORS # of authors mod 2 to test if odd or even
# of authors
@@ -1120,6 +1176,14 @@ dc "mark" register for document columns
#TOTAL_FIELDS
#OK_PROCESS_LEAD Initial processing of TOC and endnote
leading is deferred until OK_PROCESS_LEAD=1
+#ORIGINAL_B_MARGIN The value for #B_MARGIN as set by the
+ macro B_MARGIN
+#ORIGINAL_DOC_LEAD The lead for PRINT_STYLE 1 as set in
+ PRINTSTYLE; required so that PRINT_STYLE 1
+ footnotes have an unadjusted lead of
+ 12 points
+#OVERFLOW Signals to FOOTNOTE that some of the
+ footnote text won't fit on the page
#PAGE_NUM_ADJ What to add to n% to get #PAGENUMBER
#PAGENUMBER The page number
#PAGENUM_STYLE_SET Did we set pagenumber style? (toggle)
@@ -1197,12 +1261,42 @@ dc "mark" register for document columns
processing $FIRST_DOC_TITLE
#RIGHT_CAP_HEIGHT Cap height of right string in
headers/footers
+#RULED Tells FOOTNOTE if a rule (or space has been
+ put above the first footnote on the page
+#SAVED_DIVER_FN_COUNT In the case of a footnote inside a
+ diversion that should be treated as a
+ "normal" footnote, FOOTNOTE needs to
+ distinguish between a "normal" deferred
+ footnote (always the 1st footnote on the
+ page) and one that only looks as if
+ it should be deferred, when, in fact,
+ it's an overflow; this register lets
+ FOOTNOTE know whether the diversion
+ footnote is, in fact, the first on the
+ page.
#SAVED_FN_COUNT #FN_COUNT+1 prior to +#FN_COUNT; used
in FOOTNOTES while gathering fns inside
diversions
#SAVED_FN_COUNT_FOR_COLS #FN_COUNT_FOR_COLS+1 prior to
+#FN_COUNT_FOR_COLS; used in FOOTNOTES
while gathering fns inside diversions
+#SAVED_FN_DEPTH_1 Footnote depth prior to adding footnote
+ diversion depth to FN_DEPTH; used when
+ footnote text will overflow
+#SAVED_FN_DEPTH_2 Footnote depth after to adding footnote
+ diversion depth to FN_DEPTH; used when
+ footnote text will overflow
+#SAVED_LEAD In FOOTER and DO_FOOTER, stores the
+ lead in effect prior to outputting
+ FOOTNOTES or performing either
+ PROCESS_FN_LEFTOVER or
+ PROCESS_FN_IN_DIVERSION; both the
+ diversion FOOTNOTES and the two macros
+ have, for PRINT_STYLE 2, an AUTOLEAD
+ call, which requires that an LS be
+ performed with the #SAVED_LEAD in
+ order to remove register #AUTO_LEAD or
+ #AUTO_LEAD_FACTOR.
#SH_LEAD_ADJUST #DOC_LEAD/8 (TYPESET) or /2 (TYPEWRITE)
(used for subhead spacing)
#SH_NUM Subhead number
@@ -1216,6 +1310,11 @@ dc "mark" register for document columns
for a while
#SPACE_REMAINING Space remaining to footer trap; used to
decide whether or not to defer a footnote
+#SR_ADJ_FACTOR An adjustment factor that compensates
+ for the fact that #SPACE_REMAINING
+ sometimes reports a fractionally larger
+ space than is actually available for
+ footnote text.
#START If 1, signals completion of START
#START_FOR_FOOTERS Toggle set in START; signals to
PRINT_HDRFTR that START has been invoked,
@@ -1271,6 +1370,15 @@ dc "mark" register for document columns
#VARIABLE_FOOTER_POS Wandering trap position for processing
footnotes and footers; pos depends on
footnotes
+#VISUAL_B_MARGIN Set in TRAPS, what \n(nl would report
+ on the last line of running text before
+ FOOTER is sprung.
+#VFP_DIFF #FN_DEPTH minus #SAVED_FN_DEPTH; the
+ number of footnote lines that will fit
+ on the page when there will be over, and
+ therefore the amount by which to raise
+ the VFP for footnotes with overflow after
+ the 1st footnote.
y Vertical position stored with mk in hdrftrs.
+++STRINGS+++
diff --git a/contrib/mom/momdoc/toc.html b/contrib/mom/momdoc/toc.html
index 43fae961..84394748 100644
--- a/contrib/mom/momdoc/toc.html
+++ b/contrib/mom/momdoc/toc.html
@@ -8,17 +8,24 @@
<!====================================================================>
-<h1><u>Table of Contents for mom, version 1.1.9</u></h1>
+<h1 align="center"><u>Table of Contents for mom, version 1.2</u></h1>
-The table of contents has grown quite large. Clicking on a
-link in Quick Table of Contents Navigation takes you to the appropriate
-section of the Table of Contents itself. If you want to go directly to
-the top of the full Table of Contents, click
-<a href="#TOC_PROP">here.</a>
+The table of contents has grown quite large. If you've been using
+<strong>mom</strong> for a while, you might prefer the
+<a href="macrolist.html#TOP"><strong>Quick Reference Guide</strong></a>.
+<p>
+If you're new to <strong>mom</strong>, click on any link in the
+<a href="#QUICK_TOC"><strong>Quick Table of Contents</strong></a>
+to go to the
+appropriate section of the <strong>Full Table of Contents</strong>.
+<p>
+Or click
+<a href="#TOC_PROP">here</a>
+to go directly to the <strong>Full Table of Contents</strong>.
<p>
<hr>
-<h2>Quick Table of Contents Navigation</h2>
+<a name="QUICK_TOC"><h2>Quick Table of Contents</h2></a>
<a href="#INTRO"><strong>INTRODUCTORY STUFF</strong></a>
<ul>
<li><a href="#WHAT">What is mom?</a>
@@ -59,7 +66,7 @@ the top of the full Table of Contents, click
<br>
<hr>
<a name="TOC_PROP"></a>
-<h2>The Table of Contents</h2>
+<h2>Full Table of Contents</h2>
<a name="INTRO"></a>
<a name="WHAT"></a>
<li><a href="intro.html#INTRO"><strong>1. WHAT IS MOM?</strong></a>
@@ -101,7 +108,7 @@ the top of the full Table of Contents, click
<li><a href="typesetting.html#INDEX_SETUP">4.2.1 Macro list</a>
</ul>
<a name="PARAM"></a>
- <li><a href="typesetting.html#BASIC_PARAMS"><strong>4.3 Basic Parameters</strong></a> -- family, font, point size, line space, line length, autolead
+ <li><a href="typesetting.html#BASIC_PARAMS"><strong>4.3 Basic Parameters</strong></a> -- family, font, fallback font, point size, line space, line length, autolead
<ul>
<li><a href="typesetting.html#INDEX_BASIC">4.3.1 Macro list</a>
</ul>
@@ -303,6 +310,10 @@ the top of the full Table of Contents, click
<li><a href="appendices.html#APPENDICES"><strong>7. APPENDICES</strong></a>
<ul>
<li><a href="appendices.html#MOREDOC">7.1 Further notes on this documentation</a>
+ <li><a href="appendices.html#FONTS">7.2 Adding PostScript fonts to groff</a>
+ <ul>
+ <li><a href="appendices.html#HOWTO">7.2.1 How to create a PostScript font for use with groff</a>
+ </ul>
<li><a href="appendices.html#CODENOTES">7.2 Some reflections on mom</a>
<li><a href="reserved.html#RESERVED">7.3 List of reserved words</a>
<li><a href="appendices.html#CONTACT">7.4 Contact the author</a>
diff --git a/contrib/mom/momdoc/typesetting.html b/contrib/mom/momdoc/typesetting.html
index 87777a1f..6c976f7a 100644
--- a/contrib/mom/momdoc/typesetting.html
+++ b/contrib/mom/momdoc/typesetting.html
@@ -110,8 +110,8 @@ the same thing.
<strong>Mom</strong>'s typesetting macros can be used as a standalone
package, independent of the
<a href="docprocessing.html#DOCPROCESSING">document processing macros</a>.
-With them, you can typeset on-the-fly. Document covers, your best
-friend's résumé, a poster for a lost dog -- none of these requires
+With them, you can typeset on-the-fly. Book covers, your best
+friend's résumé, a poster for a lost dog --none of these requires
structured document processing (page headers, paragraphs, heads,
footnotes, etc). What they do demand is precise control over every
element on the page. The typesetting macros give you that control.
@@ -581,6 +581,7 @@ for an explanation.
<ul>
<li><a href="#FAMILY">FAMILY</a> (type family)
<li><a href="#FONT">FONT</a> (font)
+ <li><a href="#FALLBACK_FONT">FALLBACK_FONT</a> (for invalid fonts)
<li><a href="#PS">PT_SIZE</a> (point size of type)
<li><a href="#LEADING">LS</a> (line spacing/leading)
<li><a href="#AUTOLEAD">AUTOLEAD</a> (automatic line spacing)
@@ -597,7 +598,8 @@ Macro: <strong>FAMILY</strong> <var>&lt;family&gt;</var>
Alias: <strong>FAM</strong>
<p>
-<strong>FAMILY</strong> takes one argument: the name of the type family
+<strong>FAMILY</strong> takes one argument: the name of the
+<a href="definitions.html#TERMS_FAMILY">family</a>
you want. Groff comes with a number of PostScript families, each
identified by a 1-, 2- or 3-letter mnemonic. The standard families
are:
@@ -605,29 +607,80 @@ are:
<tr><td width="15"><td><strong>A</strong><td>Avant Garde
<tr><td><td><strong>BM</strong> <td>Bookman
<tr><td><td><strong>H</strong><td>Helvetica
+<tr><td><td><strong>HN</strong><td>Helvetica Narrow
<tr><td><td><strong>N</strong><td>New Century Schoolbook
<tr><td><td><strong>P</strong><td>Palatino
<tr><td><td><strong>T</strong><td>Times Roman</td></tr>
+<tr><td><td><strong>ZCM</strong><td>Zapf Chancery</td></tr>
</table>
<p>
The argument you pass to <strong>FAMILY</strong> is the identifier at
-left above. For example, if you want Helvetica, enter
+left, above. For example, if you want Helvetica, enter
<p>
<pre>
.FAMILY H
</pre>
-<strong>NOTE:</strong> The <a href="#FONT">font macro</a>
-(<strong>FT</strong>) lets you to specify both the type family
+<strong>NOTE:</strong> The
+<a href="#FONT">font macro</a>
+(<strong>FT</strong>) lets you specify both the type family
and the desired font with a single macro. While this saves a few
keystrokes, I recommend using <strong>FAMILY</strong> for family,
and <strong>FT</strong> for font, except where doing so is genuinely
-inconvenient.
+inconvenient. <strong>ZCM</strong>, for example, only exists in one
+style: Italic (<strong>I</strong>). Therefore, <kbd>.FT ZCMI</kbd>
+makes more sense than setting the family to &quot;ZCM&quot;, then
+setting the font to &quot;I&quot;.
+<p>
+<a name="FAM_ADD_NOTE"></a>
+<strong>ADDITIONAL NOTE:</strong> As of <strong>mom, version
+1.1.9-a</strong>, if you are running a version of groff lower
+than 1.19.2, you <em>MUST</em> follow all <strong>FAMILY</strong>
+requests with a <strong>FT</strong> request, otherwise
+<strong>mom</strong> will set all type up to the next
+<strong>FT</strong> request in the
+<a href="#FALLBACK_FONT">fallback font</a>.
+<p>
+If you are running a version of groff greater than or equal
+to 1.19.2, when you invoke the <strong>FAMILY</strong> macro,
+<strong>mom</strong> &quot;remembers&quot; the font style (Roman,
+Italic, etc) currently in use (if the font style exists in the new
+family) and will continue to use the same font style in the new
+family. For example:
+<p>
+<pre>
+ .FAMILY BM \" Bookman family
+ .FT I \" Medium Italic
+ &lt;some text&gt; \" Bookman Medium Italic
+ .FAMILY H \" Helvetica family
+ &lt;more text&gt; \" Helvetica Medium Italic
+</pre>
+
+However, if the font style does not exist in the new family,
+<strong>mom</strong> will set all subsequent type in the
+<a href="#FALLBACK_FONT">fallback font</a>
+(by default, Courier Medium Roman) until she encounters a
+<a href="#FONT">.FT</a>
+request that's valid for the family. For example, assuming
+you don't have the font &quot;Medium Condensed Roman&quot;
+(<strong>mom</strong> extension &quot;<strong>CD</strong>&quot;)
+in the Helvetica family:
+<p>
+<pre>
+ .FAMILY UN \" Univers family
+ .FT CD \" Medium Condensed
+ &lt;some text&gt; \" Univers Medium Condensed
+ .FAMILY H \" Helvetica family
+ &lt;more text&gt; \" Courier Medium Roman!
+</pre>
+
+In the above example, you must follow <kbd>.FAMILY H</kbd> with a
+<strong>FT</strong> request that's valid for Helvetica.
<p>
<strong>Experts:</strong>
<br>
If you add other PostScript families to groff's /font/devps directory,
-be sure to follow the groff standard for naming families and fonts.
+I recommend following the groff standard for naming families and fonts.
For example, if you add the Garamond family, name the font files
<p>
<pre>
@@ -642,46 +695,172 @@ GARAMOND then becomes a legal family name you can pass to
G, or GD.) R, I, B, and BI after GARAMOND are the roman, italic,
bold and bold-italic fonts respectively.
<p>
+Please see the Appendices,
+<a href="appendices.html#FONTS">Adding PostScript fonts to groff</a>,
+for information on adding fonts and families to groff, as well as
+to see a list of the extensions <strong>mom</strong> provides to
+groff's basic <strong>R, I, B, BI</strong> styles.
+<p>
<!---FT--->
<hr width="66%" align="left">
<a name="FONT"><h3><u>Font</u></h3></a>
<br>
-Macro: <strong>FT</strong> <var>R | I | B | BI</var>
+Macro: <strong>FT</strong> <var>R | I | B | BI | &lt;any other valid font style&gt;</var>
<p>
-<strong>FT</strong> takes one of four possible arguments specifying the
-desired font:
+By default, groff permits <strong>FT</strong> to take one of four
+possible arguments specifying the desired font:
<table valign="baseline" summary="font">
-<tr><td width="15"><td><strong>R</strong><td> = <td>roman
-<tr><td><td><strong>I</strong><td> = <td>italic
-<tr><td><td><strong>B</strong><td> = <td>bold
-<tr><td><td><strong>BI</strong><td> = <td>bold-italic</td></tr>
+<tr><td width="15"><td><strong>R</strong><td> = <td>(Medium) Roman
+<tr><td><td><strong>I</strong><td> = <td>(Medium) Italic
+<tr><td><td><strong>B</strong><td> = <td>Bold (Roman)
+<tr><td><td><strong>BI</strong><td> = <td>Bold Italic</td></tr>
</table>
<p>
-For example, if your family is Helvetica, entering
+For example, if your
+<a href="definitions.html#TERMS_FAMILY">family</a>
+is Helvetica, entering
<p>
<pre>
.FT B
</pre>
-will give you the Helvetica bold font. If your family were
-Palatino, you'd get the Palatino bold font.
+will give you the Helvetica bold
+<a href="definitions.html#TERMS_FONT">font</a>.
+If your family were Palatino, you'd get the Palatino bold font.
<p>
-You can specify both family and font in the <strong>FT</strong> macro.
-As an example,
+(As of <strong>mom, version 1.1.9-a,</strong> the range of arguments
+that can be passed to <strong>FT</strong> has been considerably
+extended, allowing access to a greater variety of font
+<a href="definitions.html#TERMS_WEIGHT">weights</a>
+and
+<a href="definitions.html#TERMS_SHAPE">shapes</a>.
+Please see the
+<a href="#FONT_NOTE">NOTE</a>,
+below.)
+<p>
+How <strong>mom</strong> reacts to an invalid argument to
+<strong>FT</strong> depends on which version of groff you're using.
+If your groff version is greater than or equal to 1.19.2,
+<strong>mom</strong> will issue a warning and, depending on how
+you've set up the
+<a href="#FALLBACK_FONT">fallback font</a>,
+either continue processing using the fallback font, or abort
+(allowing you to correct the problem). If your groff version is less
+than 1.19.2, <strong>mom</strong> will silently continue processing,
+using either the fallback font or the font that was in effect prior
+to the invalid <strong>FT</strong> call.
+<p>
+<strong>FT</strong> will also accept, as an argument, a full
+family+font name. For example,
<p>
<pre>
.FT HB
</pre>
-sets the font to Helvetica bold. I strongly recommend keeping
-family and font separate.
+will set subsequent type in Helvetica Bold. However, I strongly
+recommend keeping family and font separate except where doing so is
+genuinely inconvenient.
<p>
-Fonts can also be changed inline. See
+For inline control of fonts, see
<a href="inlines.html#INLINE_FONTS_MOM">Inline Escapes, font control</a>.
<p>
+<a name="FONT_NOTE"></a>
+<strong>NOTE: Mom, versions 1.1.9-a</strong> and higher,
+considerably extends the range of arguments you can pass to
+<strong>FT</strong>, making it more convenient to add and access
+fonts of differing
+<a href="definitions.html#TERMS_WEIGHT">weights</a>
+and
+<a href="definitions.html#TERMS_SHAPE">shapes</a>
+within the same family. Have a look at the Appendices,
+<a href="appendices.html#STYLE_EXTENSIONS">Adding PostScript fonts to groff</a>,
+for a list of the weight/style arguments <strong>mom</strong>
+allows.
+<p>
+Be aware, though, that you must have the fonts, correctly
+installed and named, in order to use the arguments. (See
+<a href="appendices.html#HOWTO">How to create a PostScript font for use with groff</a>
+for how to add fonts to groff.) Please also read the
+<a href="#FAM_ADD_NOTE">ADDITIONAL NOTE</a>
+found in the description of the <strong>FAMILY</strong> macro.
+<p>
+
+<!---FALLBACK_FONT--->
+
+<hr width="66%" align="left">
+<a name="FALLBACK_FONT"><h3><u>Fallback font</u></h3></a>
+<br>
+Macro: <strong>FALLBACK_FONT</strong> <var>&lt;fallback font&gt; [ ABORT | WARN ] | ABORT | WARN</var>
+
+<p>
+In the event that you pass an invalid argument to
+<a href="#FONT">.FAMILY</a>
+(i.e. a non-existent family), <strong>mom</strong>, by default, uses
+the fallback font, Courier Medium Roman (CR), in order to continue
+processing your file.
+<p>
+If you'd prefer another fallback font, pass
+<strong>FALLBACK_FONT</strong> the <strong>full family+font name
+of the font you'd like</strong>. For example, if you'd rather the
+fallback font were Times Roman Medium Roman,
+
+<pre>
+ .FALLBACK_FONT TR
+</pre>
+<p>
+would do the trick.
+<p>
+Additionally, if your version of groff accepts accepts &quot;if
+F&quot; and &quot;if S&quot; (see
+<a href="#FAM_ADD_NOTE">above</a>),
+<strong>mom</strong> issues a warning whenever a
+<strong>font style</strong> set with
+<a href="#FONT">.FT</a>
+does not exist, either because you haven't registered the style
+(see
+<a href="appendices.html#REGISTER_STYLE">here</a>
+for instructions on registering styles), or because the font style
+does not exist in the current family set with
+<a href="#FAMILY">.FAMILY</a>.
+By default, <strong>mom</strong> then aborts, which allows you to
+correct the problem.
+<p>
+If you'd prefer that <strong>mom</strong> not abort on non-existent
+fonts, but rather continue processing using a fallback font,
+you can pass <strong>FALLBACK_FONT</strong> the argument
+<strong>WARN</strong>, either by itself, or in conjunction with your
+chosen fallback font.
+<p>
+<strong>Some examples of invoking FALLBACK_FONT:</strong>
+<br>
+<ul>
+ <li><kbd>.FALLBACK_FONT WARN</kbd>
+ <br>
+ <strong>mom</strong> will issue a warning whenever you try
+ to access a non-existent font but will continue processing
+ your file with the default fallback font, Courier Medium Roman.
+ <li><kbd>.FALLBACK_FONT TR WARN</kbd>
+ <br>
+ <strong>mom</strong> will issue a warning whenever you try
+ to access a non-existent font but will continue processing
+ your file with a fallback font of Times Roman Medium Roman;
+ additionally, &quot;TR&quot; will be the fallback font whenever
+ you try to access a <strong>family</strong> that does not exist.
+ <li><kbd>.FALLBACK_FONT TR ABORT</kbd>
+ <br>
+ <strong>mom</strong> will abort whenever you try to access a
+ non-existent font, and will use the fallback font
+ &quot;TR&quot; whenever you try to access a <strong>family</strong>
+ that does not exist.
+</ul>
+<p>
+If, for some reason, you want to revert to ABORT, just enter
+<kbd>.FALLBACK_FONT ABORT</kbd> and <strong>mom</strong> will once
+again abort on font errors.
+<p>
<!---PT_SIZE--->
@@ -885,17 +1064,22 @@ left margin, at the right margin, at both margins, or at neither margin
(centred).
<p>
These macros also determine whether or not
-<a href="definitions.html#TERMS_INPUTLINE">input lines</a> are joined and
-<a href="definitions.html#TERMS_FILLED">filled</a> during output.
+<a href="definitions.html#TERMS_INPUTLINE">input lines</a>
+are joined and
+<a href="definitions.html#TERMS_FILLED">filled</a>
+during output.
<p>
Additionally, macros that deal with how to break
-<a href="definitions.html#TERMS_OUTPUTLINE">output lines</a> are covered in this
-section, as is the
-<a href="definitions.html#TERMS_INLINES">inline escape</a> for joining output lines.
+<a href="definitions.html#TERMS_OUTPUTLINE">output lines</a>
+are covered in this section, as is the
+<a href="definitions.html#TERMS_INLINES">inline escape</a>
+for joining input lines.
<p>
You may encounter some words here that are unfamiliar. Refer to
-<a href="definitions.html#TERMS_TYPESETTING">Typesetting terms</a> and
-<a href="definitions.html#TERMS_GROFF">Groff terms</a> for an explanation.
+<a href="definitions.html#TERMS_TYPESETTING">Typesetting terms</a>
+and
+<a href="definitions.html#TERMS_GROFF">Groff terms</a>
+for an explanation.
<a name="INDEX_JUST"><h3><u>Justification, quad, fill, and break macro list</u></h3></a>
<p>
@@ -1720,20 +1904,30 @@ highly recommend previewing your work to assess the effect of
<p>
<p>
-<strong>IMPORTANT:</strong> <strong>RW</strong> affects all
+<strong>IMPORTANT:</strong> In versions prior to 1.1.9-a,
+<strong>RW</strong> affected all
<a href="definitions.html#TERMS_FONT">fonts</a>
in the
<a href="definitions.html#TERMS_FAMILY">family</a>
-current at the time it's invoked. It must be reset to zero to
-cancel its effect (<code>.RW 0</code>) on those fonts, or reinvoked
-(possibly with a different value) if you change family.
+current at the time it was invoked. As of 1.1.9-a, this behaviour
+has been changed. <strong>RW</strong> affects only the font
+current at the time it's invoked, and remains in effect for that
+font every time the font is called, hence must be reset to zero to
+cancel its effect (<code>.RW 0</code>) on that font.
<p>
<strong>NOTE:</strong> By default, <strong>RW</strong> does not deposit a
<a href="#BR">break</a>
-(<strong>BR</strong>) when it's invoked. If you want
+(<strong>BR</strong>) when it's invoked if you're in one of the
+<a href="definitions.html#TERMS_FILL">fill</a>
+modes (i.e.
+<a href="#QUAD">QUAD</a>
+<strong>L, R, C, J</strong> or
+<a href="#JUSTIFY">JUSTIFY</a>).
+If you want
<strong>RW</strong> to break at the ends of the previous
-<a href="definitions.html#TERMS_INPUTLINE">input lines</a>,
-you can tell <strong>mom</strong> that's what you want by invoking the
+<a href="definitions.html#TERMS_INPUTLINE">input lines</a>
+while you're in a fill mode, tell <strong>mom</strong>
+that's what you want by invoking the
<a href="#BR_AT_LINE_KERN">BR_AT_LINE_KERN</a>
toggle macro.
<p>
@@ -1766,14 +1960,31 @@ small decimal values when loosening lines. For example,
may be just enough to open up a line without the change in letter
spacing being obvious. I highly recommend previewing your work to
assess the effect of <strong>EW</strong>.
-
+<p>
+<strong>IMPORTANT:</strong> In versions prior to 1.1.9-a,
+<strong>EW</strong> affected all
+<a href="definitions.html#TERMS_FONT">fonts</a>
+in the
+<a href="definitions.html#TERMS_FAMILY">family</a>
+current at the time it was invoked. As of 1.1.9-a, this behaviour
+has been changed. <strong>EW</strong> affects only the font
+current at the time it's invoked, and remains in effect for that
+font every time the font is called, hence must be reset to zero to
+cancel its effect (<code>.EW 0</code>) on that font.
<p>
<strong>NOTE:</strong> By default, <strong>EW</strong> does not deposit a
<a href="#BR">break</a>
-(<strong>BR</strong>) when it's invoked. If you want
+(<strong>BR</strong>) when it's invoked if you're in one of the
+<a href="definitions.html#TERMS_FILL">fill</a>
+modes (i.e.
+<a href="#QUAD">QUAD</a>
+<strong>L, R, C, J</strong> or
+<a href="#JUSTIFY">JUSTIFY</a>).
+If you want
<strong>EW</strong> to break at the ends of the previous
-<a href="definitions.html#TERMS_INPUTLINE">input lines</a>,
-you can tell <strong>mom</strong> that's what you want by invoking the
+<a href="definitions.html#TERMS_INPUTLINE">input lines</a>
+while you're in a fill mode, tell <strong>mom</strong>
+that's what you want by invoking the
<a href="#BR_AT_LINE_KERN">BR_AT_LINE_KERN</a>
toggle macro.
<p>
@@ -1787,21 +1998,33 @@ Macro: <strong>BR_AT_LINE_KERN</strong> <var>toggle</var>
<br>
<p>
-By default, <strong>mom</strong> does not break
+By default, in
+<a href="definitions.html#TERMS_FILLED">fill</a>
+modes (i.e.
+<a href="#QUAD">QUAD</a>
+<strong>L, R, C, J</strong> or
+<a href="#JUSTIFY">JUSTIFY</a>)
+<strong>mom</strong> does not break
<a href="definitions.html#TERMS_INPUTLINE">input lines</a>
when you invoke <strong>RW</strong> or <strong>EW</strong>.
-If you'd like <strong>mom</strong> to break input lines prior
-to <strong>RW</strong> or <strong>EW</strong>, invoke
-<strong>BR_AT_INPUT_LINE</strong> without any argument. To
-disable the breaks, invoke <strong>BR_AT_INPUT_LINE</strong>
-with any argument (<strong>OFF, QUIT, Q, X</strong>...), like
-this
+If you'd like her to break input lines prior to <strong>RW</strong>
+or <strong>EW</strong>, invoke <strong>BR_AT_INPUT_LINE</strong>
+without any argument. To disable the breaks, invoke
+<strong>BR_AT_INPUT_LINE</strong> with any argument (<strong>OFF,
+QUIT, Q, X</strong>...), like this
<p>
<pre>
.BR_AT_LINE_KERN OFF
or
.BR_AT_LINE_KERN X
</pre>
+
+In <strong>QUAD L, R</strong> or <strong>C</strong>,
+<strong>mom</strong> simply breaks the line. In <strong>QUAD J</strong>
+(or <strong>JUSTIFY</strong>, which is the same thing), she breaks
+and
+<a href="definitions.html#TERMS_FORCE">force justifies</a>
+the line prior to <strong>EW</strong> or <strong>RW</strong>.
<br>
<!---KERN--->
diff --git a/contrib/mom/momdoc/using.html b/contrib/mom/momdoc/using.html
index de6a614e..744629ab 100644
--- a/contrib/mom/momdoc/using.html
+++ b/contrib/mom/momdoc/using.html
@@ -47,10 +47,10 @@ macro, explained below. After <strong>START</strong>,
<strong>mom</strong> determines the appearance of text following
the markup tags automatically, although you, the user, can easily
change how <strong>mom</strong> interprets the tags. This gives you
-nearly complete control over the look and feel of your documents.
-In addition, the typesetting macros, in combination with document
-processing, let you meet all sorts of typesetting needs that just
-can't be covered by &quot;one macro fits all&quot; markup tags.
+nearly complete control over document design. In addition, the
+typesetting macros, in combination with document processing, let you
+meet all sorts of typesetting needs that just can't be covered by
+&quot;one macro fits all&quot; markup tags.
<p>
<a name="USING_MACROS">
<h2><u>How to input mom's macros</u></h2>
diff --git a/contrib/mom/om.tmac b/contrib/mom/om.tmac
index 25e6cbf4..b445505e 100644
--- a/contrib/mom/om.tmac
+++ b/contrib/mom/om.tmac
@@ -23,26 +23,18 @@
.\"
.\"
.\"
-\# Version 1.1.9
-\# -------------
-\#
-.if (\n[.x]\n[.y] < 118) \
-. ab You need GNU troff version 1.18 or higher to run this version of mom.
-.if !\n[.g]=1 \
-. ab The mom macros require that you be running GNU troff.
-\#
-\# ====================================================================
+\# Version 1.2
+\# -----------
\#
\# Antoine de St-Exupéry asserted that elegance in engineering is
\# achieved not when there is nothing left to add, but when there is
\# nothing left to take away.
\#
-\# By those standards, mom is a Rube Goldberg contraption. She was created
-\# over the years while groff, and my understanding of it, changed and
-\# evolved. The routines for handling docheaders and epigraphs, in
-\# particular, are pretty Baroque. Since I added the SHIM macro, much
-\# of what they contain could probably be removed. However, I'm a
-\# firm believer in "if it ain't broke, don't fix it."
+\# By those standards, mom is a Rube Goldberg contraption. She was
+\# created over the years while groff, and my understanding of it,
+\# changed and evolved. However, I'm a firm believer in "if it
+\# ain't broke, don't fix it," so I'm leaving any major clean-up
+\# of redundancies and whatnot for a rainy day.
\#
\# Inasmuch as possible, macros that turn a feature on or off follow
\# a similar style. Invoking the macro without an argument turns
@@ -55,6 +47,46 @@
\#
\# ====================================================================
\#
+\# Check which version of groff is being run
+.if (\n[.x]\n[.y] < 118) \
+. ab You need GNU troff version 1.18 or higher to run this version of mom.
+\# Check that GNU troff is being run
+.if !\n[.g]=1 \
+. ab The mom macros require that you be running GNU troff.
+\# Add supplementary styles
+.sty \n[.fp] L \" Light Roman
+.sty \n[.fp] LI \" Light Italic
+.sty \n[.fp] LCD \" Light Condensed Roman
+.sty \n[.fp] LCDI \" Light Condensed Italic
+.sty \n[.fp] LEX \" Light Extended Roman
+.sty \n[.fp] LEXI \" Light Extended Italic
+.sty \n[.fp] CD \" Medium/Book Condensed Roman
+.sty \n[.fp] CDI \" Medium/Book Condensed Italic
+.sty \n[.fp] EX \" Medium/Book Extended Roman
+.sty \n[.fp] EXI \" Medium/Book Extended Italic
+.sty \n[.fp] DB \" DemiBold Roman
+.sty \n[.fp] DBI \" DemiBold Italic
+.sty \n[.fp] BCD \" Bold Condensed Roman
+.sty \n[.fp] BCDI \" Bold Condensed Italic
+.sty \n[.fp] BEX \" Bold Extended Roman
+.sty \n[.fp] BEXI \" Bold Extended Italic
+.sty \n[.fp] HV \" Heavy Roman
+.sty \n[.fp] HVI \" Heavy Italic
+.sty \n[.fp] HVCD \" Heavy Condensed Roman
+.sty \n[.fp] HVCDI \" Heavy Condensed Italic
+.sty \n[.fp] HVEX \" Heavy Extended Roman
+.sty \n[.fp] HVEXI \" Heavy Extended Italic
+.sty \n[.fp] BL \" Black Roman
+.sty \n[.fp] BLI \" Black Italic
+.sty \n[.fp] BLCD \" Black Condensed Roman
+.sty \n[.fp] BLCDI \" Black Condensed Italic
+.sty \n[.fp] BLEX \" Black Extended Roman
+.sty \n[.fp] BLEXI \" Black Extended Italic
+.sty \n[.fp] UBL \" Ultra-Black Roman
+.sty \n[.fp] UBLI \" Ultra-Black Italic
+\#
+\# ====================================================================
+\#
\# TYPESETTING MACROS, STRINGS, AND ALIASES
\# ========================================
\#
@@ -113,8 +145,7 @@
\#
\# warning: number register whatever not defined.
\#
-\# groff also warns about strings similarly tested for, and
-\# complains a lot about the use of right-braces.
+\# Groff also warns about strings similarly tested for
\#
\# The warn level, above, is high in order to shut off those
\# warnings. If you're futzing in this file and need more verbose
@@ -222,6 +253,7 @@
.MAC B_MARGIN END
. br
. nr #B_MARGIN (\\$1)
+. nr #ORIGINAL_B_MARGIN \\n[#B_MARGIN]
. nr #B_MARGIN_SET 1
. wh -\\n[#B_MARGIN]u DO_B_MARGIN
.END
@@ -264,9 +296,9 @@
\# *Argument:
\# <none>
\# *Function:
-\# Plants the top margin (set in .PAGE) at the top of each page.
+\# Plants the top margin at the top of each page.
\# *Notes:
-\# The trap is set in .PAGE
+\# The trap is set in .T_MARGIN or .PAGE
\#
.MAC DO_T_MARGIN END
. ev 1
@@ -281,9 +313,9 @@
\# *Argument:
\# <none>
\# *Function:
-\# Plants the bottom margin (set in .PAGE) at the bottom of each page.
+\# Plants the bottom margin at the bottom of each page.
\# *Notes:
-\# The trap is set in .PAGE.
+\# The trap is set in .B_MARGIN or .PAGE.
\#
.MAC DO_B_MARGIN END
. nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000
@@ -304,8 +336,20 @@
\# breaks to a new page.
\#
.MAC NEWPAGE END
+. br
. ie \\n[#B_MARGIN_SET]=1 \{\
-. DO_B_MARGIN
+. ie !\\n[#DOCS]=1 \{ .DO_B_MARGIN \}
+. el \{\
+. if \\n[#COLUMNS]=1 \{ .nr #COL_NUM \\n[#NUM_COLS] \}
+. ie !\\n[#FN_DEPTH] \{\
+. ch FN_OVERFLOW_TRAP
+. DO_B_MARGIN
+. wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
+. \}
+. el \{\
+. DO_B_MARGIN
+. \}
+. \}
. \}
. el \{\
. nr #T_MARGIN_LEAD_ADJ \\n[#LEAD]-12000
@@ -342,6 +386,46 @@
.END
\#
\#
+\# +++FAMILY AND FONT+++
+\#
+\# FALLBACK FONT
+\# -------------
+\# *Argument:
+\# <fallback font> [ ABORT | WARN ] | ABORT | WARN
+\# *Function:
+\# Sets register #ABORT_FT_ERRORS to 1, or defines a fallback font
+\# called "dummy" at font position 0.
+\# *Notes:
+\# Calls to non-existent families cause mom to continue processing
+\# files using the fallback font until a valid family is entered.
+\#
+\# Calls to non-existent fonts generate warnings. If ABORT is passed
+\# to FALLBACK_FONT, mom stops processing files after the warning.
+\# Otherwise, she continues to process files using the fallback font
+\# after the warning is issued. The default fallback font is CR; the
+\# default for font warnings is to abort.
+\#
+.MAC FALLBACK_FONT END
+. if \\n[#NUM_ARGS]=1 \{\
+. if '\\$1'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
+. if '\\$1'WARN' \{\
+. if r#ABORT_FT_ERRORS \{ .nr #ABORT_FT_ERRORS 0 \}
+. \}
+. if !'\\$1'ABORT' \{\
+. if !'\\$1'WARN' \{\
+. fp 0 dummy \\$1
+. \}
+. \}
+. \}
+. if \\n[#NUM_ARGS]=2 \{\
+. fp 0 dummy \\$1
+. if '\\$2'ABORT' \{ .nr #ABORT_FT_ERRORS 1 \}
+. if '\\$2'WARN' \{ .nr #ABORT_FT_ERRORS 0 \}
+. \}
+.END
+\#
+.FALLBACK_FONT CR ABORT
+\#
\# FAMILY
\# ------
\# *Argument:
@@ -353,15 +437,25 @@
.MAC FAMILY END
. if \\n[#PRINT_STYLE]=1 \{ .return \}
. if \\n[#IGNORE] \{ .return \}
+. if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
+. ds $SAVED_STYLE \\n[.sty]
+. \}
. ds $FAMILY \\$1
+. ft 0
. fam \\*[$FAMILY]
+. if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
+. ft \\*[$SAVED_STYLE]
+. if !F\\n[.fn] \{\
+. ft 0
+. \}
+. \}
.END
\#
\#
\# FONT
\# ----
\# *Argument:
-\# R | I | B | BI
+\# R | I | B | BI | <other style extension>
\# *Function:
\# Stores user supplied font in $FONT and sets .ft to $FONT.
\#
@@ -382,7 +476,29 @@
. return
. \}
. ds $FONT \\$1
+. ft 0
. ft \\*[$FONT]
+. if if (\\n[.x]\\n[.y]\\n[.Y] >= 1192) \{\
+. if '\\n[.sty]'' \{\
+. if !F\\n[.fn] \{\
+. if !S\\*[$FONT] \{\
+. tm1 "[mom]: Font style "\\*[$FONT]" at line \\n(.c has not been registered.
+. ie \\n[#ABORT_FT_ERRORS]=0 \{\
+. tm1 " Continuing to process using fallback font.
+. \}
+. el .ab Aborting.
+. \}
+. if \\n[.f]=0 \{\
+. tm1 "[mom]: Either font style "\\*[$FONT]" at line \\n(.c does not exist in family "\\n[.fam]",
+. tm1 " or family "\\n[.fam]" has not been installed in font/devps.
+. ie \\n[#ABORT_FT_ERRORS]=0 \{\
+. tm1 " Continuing to process using fallback font.
+. \}
+. el .ab Aborting.
+. \}
+. \}
+. \}
+. \}
.END
\#
\#
@@ -430,10 +546,10 @@
\# *Argument:
\# <leading between lines of text>
\# *Function:
-\# Turns off #AUTO_LEAD if it's on.
+\# Turns off #AUTOLEAD if it's on.
\# Sets .vs to user supplied value.
\# *Notes:
-\# Does not require unit of measure. LEAD automatically turns off AUTOLEAD.
+\# Does not require unit of measure. LS automatically turns off AUTOLEAD.
\#
.MAC LS END
. if \\n[#PRINT_STYLE]=1 \{ .return \}
@@ -716,20 +832,20 @@
\# subsequent output lines.
\#
.MAC RW END
-. if \\n[#BR_AT_LINE_KERN] \{ .br \}
-. tkf 1 1 -\\$1 1 -\\$1
-. tkf 2 1 -\\$1 1 -\\$1
-. tkf 3 1 -\\$1 1 -\\$1
-. tkf 4 1 -\\$1 1 -\\$1
+. if \\n[#BR_AT_LINE_KERN] \{\
+. ie \\n[#JUSTIFY]=1 \{ .brp \}
+. el \{ .br \}
+. \}
+. tkf \\n(.f 1 -\\$1 1 -\\$1
.END
\#
\#
.MAC EW END
-. if \\n[#BR_AT_LINE_KERN] \{ .br \}
-. tkf 1 1 \\$1 1 \\$1
-. tkf 2 1 \\$1 1 \\$1
-. tkf 3 1 \\$1 1 \\$1
-. tkf 4 1 \\$1 1 \\$1
+. if \\n[#BR_AT_LINE_KERN] \{\
+. ie \\n[#JUSTIFY]=1 \{ .brp \}
+. el \{ .br \}
+. \}
+. tkf \\n(.f 1 \\$1 1 \\$1
.END
\#
\#
@@ -764,10 +880,10 @@
\# to default, or permits the setting of various hyphenation
\# parameters.
\# *Notes:
-\# HY ON defaults to .hy 14, i.e. no hyphens after the
-\# first two or before the last two characters of a word, and
-\# no hyphenation of the last line prior to a trap (e.g.,
-\# at the bottom of a page).
+\# HY, by itself, defaults to .hy 14, i.e. no hyphens after the
+\# first two or before the last two characters of a word, and no
+\# hyphenation of the last line prior to a trap (e.g., at the
+\# bottom of a page).
\#
\# HY DEFAULT resets the hyphenation style to .hy 14 (see
\# above) if that behaviour is desired after changes have been
@@ -1019,7 +1135,7 @@
\# processed. The strings for open/close ($QUOTE<n>) are then
\# defined in the macro.
\#
-\# (Note to myself: ascii code for " is \N'34'.)
+\# (Note to myself: code for " is \N'34'.)
\#
.char " \\*[$QUOTE\\n[#OPEN_CLOSE]]\R'#OPEN_CLOSE (1-\\n[#OPEN_CLOSE])'
\#
@@ -1178,15 +1294,42 @@
. \}
' ce 0
' fi
-. if '\\*[$QUAD_VALUE]'L' \{ .ad l \}
-. if '\\*[$QUAD_VALUE]'LEFT' \{ .ad l \}
-. if '\\*[$QUAD_VALUE]'R' \{ .ad r \}
-. if '\\*[$QUAD_VALUE]'RIGHT' \{ .ad r \}
-. if '\\*[$QUAD_VALUE]'C' \{ .ad c \}
-. if '\\*[$QUAD_VALUE]'CENTER' \{ .ad c \}
-. if '\\*[$QUAD_VALUE]'CENTRE' \{ .ad c \}
-. if '\\*[$QUAD_VALUE]'J' \{ .ad b \}
-. if '\\*[$QUAD_VALUE]'JUSTIFY' \{ .ad b \}
+. if '\\*[$QUAD_VALUE]'L' \{\
+. nr #JUSTIFY 0
+. ad l
+. \}
+. if '\\*[$QUAD_VALUE]'LEFT' \{\
+. nr #JUSTIFY 0
+. ad l
+. \}
+. if '\\*[$QUAD_VALUE]'R' \{\
+. nr #JUSTIFY 0
+. ad r
+. \}
+. if '\\*[$QUAD_VALUE]'RIGHT' \{\
+. nr #JUSTIFY 0
+. ad r
+. \}
+. if '\\*[$QUAD_VALUE]'C' \{\
+. nr #JUSTIFY 0
+. ad c
+. \}
+. if '\\*[$QUAD_VALUE]'CENTER' \{\
+. nr #JUSTIFY 0
+. ad c
+. \}
+. if '\\*[$QUAD_VALUE]'CENTRE' \{\
+. nr #JUSTIFY 0
+. ad c
+. \}
+. if '\\*[$QUAD_VALUE]'J' \{\
+. nr #JUSTIFY 1
+. ad b
+. \}
+. if '\\*[$QUAD_VALUE]'JUSTIFY' \{\
+. nr #JUSTIFY 1
+. ad b
+. \}
. nr #PSEUDO_FILL 0
.END
\#
@@ -1538,7 +1681,7 @@
.ie \\n(.u=1 \{\
\c
\\*[\\$1]\c
-. \}
+.\}
.el \{ \\*[\\$1] \}
.END
\#
@@ -3218,10 +3361,14 @@ y\\R'#DESCENDER \\n[.cdp]'
. TYPEWRITER
. color 0
. ie '\\$2'SINGLESPACE' \{\
-. nr #SINGLE_SPACE 1
-. vs 12
+. nr #SINGLE_SPACE 1
+. vs 12
+. nr #ORIGINAL_DOC_LEAD \\n(.v
+. \}
+. el \{\
+. vs 24
+. nr #ORIGINAL_DOC_LEAD \\n(.v
. \}
-. el \{ .vs 24 \}
. QUAD L
. HY OFF
. SMARTQUOTES OFF
@@ -3273,8 +3420,7 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
\# Macros to control behaviour of PRINTSTYLE TYPEWRITE
\#
-\# First, a little utility macro I may actually get around to
-\# implementing throughout the whole file
+\# First, a little utility macro.
\#
.MAC TYPEWRITER END
. fam C
@@ -3881,9 +4027,9 @@ y\\R'#DESCENDER \\n[.cdp]'
\# The control macros for family, font, size, quad and color are here
\# grouped together. Each (e.g. _FAMILY or _FONT) tests for a calling
\# alias before performing the action(s) appropriate to the calling
-\# macro. Defaults for all these guys are set in DEFAULTS, and listed
-\# in the "Control Macros" section pertinent to the macro whose style
-\# is to be changed.
+\# macro. Defaults for all these guys are set in DEFAULTS, and
+\# listed in the "Control Macros" section of the documentation
+\# pertinent to the macro whose style is to be changed.
\#
.MAC _FAMILY END
. if '\\$0'AUTHOR_FAMILY' .ds $AUTHOR_FAM \\$1
@@ -4286,8 +4432,6 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. if !r#HDRFTR_RULE \{ .HDRFTR_RULE \}
. if !r#PAGE_NUM_SET \{ .PAGENUMBER 1 \}
-. ie \\n[#ADJ_DOC_LEAD]=1 \{ . \}
-. el \{ .DOC_LEAD_ADJUST \}
\# Read in number registers and strings for type parameters
. nr #DOC_L_MARGIN \\n[#L_MARGIN]
. nr #DOC_L_LENGTH \\n[#L_LENGTH]
@@ -4295,6 +4439,16 @@ y\\R'#DESCENDER \\n[.cdp]'
. ds $DOC_FAM \\*[$FAMILY]
. nr #DOC_PT_SIZE \\n[#PT_SIZE]
. nr #DOC_LEAD \\n[#LEAD]
+\# #SAVED_DOC_LEAD is set in COLLATE
+. if r#SAVED_DOC_LEAD \{\
+. if !\\n[#DOC_LEAD]=\\n[#SAVED_DOC_LEAD] \{ .nr #RERUN_TRAPS 1 \}
+. \}
+. ie \\n[#ADJ_DOC_LEAD]=1 \{ . \}
+. el \{\
+. if !\\n[#DOC_LEAD_ADJUST_OFF] \{\
+. DOC_LEAD_ADJUST
+. \}
+. \}
. ds $DOC_QUAD \\*[$QUAD_VALUE]
. ds $PP_FT \\*[$FONT]
\# Counters
@@ -4653,11 +4807,29 @@ y\\R'#DESCENDER \\n[.cdp]'
. ie \\n[#ADJ_DOC_LEAD]=1 \{ .DOC_LEAD_ADJUST \}
. el \{ . \}
. \}
-. if !\\n[#COLLATE] \{\
+\# This diversion is to get a value for #FN_AUTOLEAD
+. di NULL
+. ev NULL
+. if \\n[#PRINT_STYLE]=1 \{\
+. ps 12
+. ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
+. el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
+. \}
+. if \\n[#PRINT_STYLE]=2 \{\
+. PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
+. AUTOLEAD \\n[#FN_AUTOLEAD]
+. \}
+. nr #FN_LEAD \\n[#LEAD]
+. if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u \}
+. ev
+. di
+. ie !\\n[#COLLATE] \{\
. TRAPS
+. rr #DOC_LEAD_ADJUST_OFF
\# Endnote and toc leading
. nr #OK_PROCESS_LEAD 1
. nr #RESTORE_DOC_LEAD \\n(.v
+. nr #RESTORE_B_MARGIN \\n[#B_MARGIN]
. if \\n[#PRINT_STYLE]=1 \{\
. ie \\n[#SINGLE_SPACE] \{\
. ENDNOTE_LEAD 12 ADJUST
@@ -4676,6 +4848,14 @@ y\\R'#DESCENDER \\n[.cdp]'
. rm $ADJUST_TOC_LEAD
. \}
. DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
+. nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
+. \}
+. el \{\
+. if \\n[#COLLATE] \{\
+. if !\\n[#PRINT_STYLE]=1 \{\
+. if \\n[#RERUN_TRAPS] \{ .TRAPS \}
+. \}
+. \}
. \}
. if \\n[#PRINT_STYLE]=1 \{ .nr #IGNORE 1 \}
.END
@@ -5227,7 +5407,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. el .UNDERSCORE "\\*[$DOC_TYPE]
. \}
. \}
-. sp |\\n[#PAGE_LENGTH]u-\\n[#B_MARGIN]u
+. sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
. ie \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
@@ -5246,7 +5426,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. el \{ .PRINT \\*[$COPYRIGHT] \}
. \}
-. sp |\\n[#PAGE_LENGTH]u-\\n[#B_MARGIN]u
+. sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
. if \\n[#DOC_COVER_MISC]=1 \{\
. QUAD \\*[$DOC_COVER_MISC_QUAD]
. nr #MISCS \\n[#MISC_NUM]
@@ -5429,18 +5609,18 @@ y\\R'#DESCENDER \\n[.cdp]'
. el .UNDERSCORE "\\*[$DOC_TYPE]
. \}
. \}
-. sp |\\n[#PAGE_LENGTH]u-\\n[#B_MARGIN]u
-. ie \\n[#PRINT_STYLE]=1 \{\
-. TYPEWRITER
-. ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
-. el \{ .vs \\n[#DOC_LEAD]u/2u \}
-. \}
-. el \{\
-. FAMILY \\*[$COVER_COPYRIGHT_FAM]
-. FT \\*[$COVER_COPYRIGHT_FT]
-. AUTOLEAD 2
-. PT_SIZE \\*[$COVER_COPYRIGHT_PT_SIZE]
-. \}
+. sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
+. ie \\n[#PRINT_STYLE]=1 \{\
+. TYPEWRITER
+. ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
+. el \{ .vs \\n[#DOC_LEAD]u/2u \}
+. \}
+. el \{\
+. FAMILY \\*[$COVER_COPYRIGHT_FAM]
+. FT \\*[$COVER_COPYRIGHT_FT]
+. AUTOLEAD 2
+. PT_SIZE \\*[$COVER_COPYRIGHT_PT_SIZE]
+. \}
. if \\n[#COVER_COPYRIGHT]=1 \{\
. QUAD \\*[$COVER_COPYRIGHT_QUAD]
. ie \\n[#COVER_COPYRIGHT_COLOR]=1 \{\
@@ -5448,7 +5628,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. el \{ .PRINT \\*[$COPYRIGHT] \}
. \}
-. sp |\\n[#PAGE_LENGTH]u-\\n[#B_MARGIN]u
+. sp |\\n[#VISUAL_B_MARGIN]u+\\n[#DOC_LEAD]u
. if \\n[#COVER_MISC]=1 \{\
. QUAD \\*[$COVER_MISC_QUAD]
. nr #MISCS \\n[#MISC_NUM]
@@ -5517,22 +5697,6 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. DEFAULTS
-\# This diversion is to get a value for #FN_AUTOLEAD
-. di NULL
-. ev NULL
-. if \\n[#PRINT_STYLE]=1 \{\
-. ps 12
-. ie \\n[#SINGLE_SPACE]=1 \{ .vs \\n[#DOC_LEAD]u \}
-. el \{ .vs \\n[#DOC_LEAD]u/2u \}
-. \}
-. if \\n[#PRINT_STYLE]=2 \{\
-. PT_SIZE \\n[#DOC_PT_SIZE]u\\*[$FN_SIZE_CHANGE]
-. AUTOLEAD \\n[#FN_AUTOLEAD]
-. \}
-. nr #FN_LEAD \\n[#LEAD]
-. if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#DOC_LEAD]u \}
-. ev
-. di
\# Covers and doc covers
. if \\n[#DOC_COVERS]=1 \{\
. if \\n[#DOC_COVER]=1 \{\
@@ -5733,7 +5897,6 @@ y\\R'#DESCENDER \\n[.cdp]'
. el \{ .ALD \\n[#DOC_LEAD]u \}
. \}
. \}
-. if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. DEFAULT_DOCHEADER
@@ -5745,7 +5908,6 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
. \"in #DOCHEADER_DEPTH
. rm DOCHEADER_DIVERSION \" Removing the diversion macro
-. if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
. \}
. ev
. \}
@@ -5787,7 +5949,6 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
-. if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. CHAPTER_DOCHEADER
@@ -5799,7 +5960,6 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \" Storing the depth (height) of the diversion
. \" in #DOCHEADER_DEPTH
. rm DOCHEADER_DIVERSION \" Removing the diversion macro
-. if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
. \}
. ev
. \}
@@ -5865,7 +6025,6 @@ y\\R'#DESCENDER \\n[.cdp]'
. el \{ .ALD \\n[#DOC_LEAD]u \}
. UNDERSCORE2 "\\*[$DOC_TYPE]
. if \\n[#SINGLE_SPACE] \{ .ALD \\n[#DOC_LEAD]u \}
-. if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
. NAMED_DOCHEADER
@@ -5877,7 +6036,6 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #DOCHEADER_DEPTH \\n(dn-\\n[#DOCHEADER_LEAD] \"Storing the depth (height) of the diversion
. \"in #DOCHEADER_DEPTH
. rm DOCHEADER_DIVERSION \" Removing the diversion macro
-. if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
. \}
. ev
. \}
@@ -5898,6 +6056,8 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. \}
+. LS \\n[#DOC_LEAD]u
+. if \\n[#ADJ_DOC_LEAD]=1 \{ .SHIM \}
. QUAD \\*[$DOC_QUAD]
. CLEANUP_DEFAULTS
. nr #START_FOR_FOOTERS 1
@@ -6143,8 +6303,13 @@ y\\R'#DESCENDER \\n[.cdp]'
\# on #B_MARGIN.
\#
.MAC DOC_LEAD_ADJUST END
-. ie '\\$1'' \{ .nr #ADJ_DOC_LEAD 1 \}
-. el \{ .nr #ADJ_DOC_LEAD 0 \}
+. ie '\\$1'' \{\
+. nr #ADJ_DOC_LEAD 1
+. \}
+. el \{\
+. nr #ADJ_DOC_LEAD 0
+. nr #DOC_LEAD_ADJUST_OFF 1
+. \}
.END
\#
\#
@@ -6393,6 +6558,9 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
. \}
. di EPI_TEXT
+. nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
+. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
+. hy 14
. nr #EPI_ACTIVE 1
. \}
. el \{\
@@ -6445,7 +6613,9 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. AUTOLEAD \\n[#EPI_AUTOLEAD]
. QUAD \\*[$EPI_QUAD]
-. HY
+. nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
+. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
+. hy 14
. nr #EPI_LEAD \\n[#LEAD]
. nr #EPI_LEAD_DIFF \\n[#DOC_LEAD]-\\n[#EPI_LEAD]
. di EPI_TEXT
@@ -6476,6 +6646,14 @@ y\\R'#DESCENDER \\n[.cdp]'
. br
. di
. rr #IN_DIVER
+. if \\n[#RESET_FN_COUNTERS]=2 \{\
+. if !\\n[#FN_COUNT]=1 \{\
+. if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
+. DIVER_FN_2_POST
+. rr #RESET_FN_COUNTERS
+. \}
+. \}
+. \}
. nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
. nr #DONE_ONCE 0 1
. REMOVE_INDENT
@@ -6516,6 +6694,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. ALD \\n[#EPI_LEAD_DIFF]u+(\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
. \}
. \}
+. if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
. \}
. el \{\
. nr #EPI_LINES_TO_TRAP 0 1
@@ -6557,13 +6736,13 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. if \\n[#PRINT_STYLE]=2 \{\
-. SHIM
. if \\n[#EPI_WHITESPACE]<\\n[#DOC_LEAD] \{\
. ALD \\n[#EPI_WHITESPACE]u/2u
. \}
. if \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
. ALD (\\n[#EPI_WHITESPACE]u/2u)-\\n[#DOC_LEAD]u
. \}
+. SHIM
. \}
. \}
. el \{\
@@ -6593,7 +6772,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. el \{\
. nr #EPI_LINES_TO_END \\n[#EPI_LINES]-\\n[#EPI_LINES_TO_TRAP]
-. if \\n[#LOOP] \{. nr #EPI_LINES_TO_END +1 \}
+. if \\n[#LOOP] \{ .nr #EPI_LINES_TO_END +1 \}
. rr #LOOP
. nr #EPI_WHITESPACE (\\n[#EPI_LINES_TO_END]*\\n[#DOC_LEAD])-(\\n[#EPI_LINES_TO_END]*\\n[#EPI_LEAD])
. while \\n[#EPI_WHITESPACE]>\\n[#DOC_LEAD] \{\
@@ -6890,7 +7069,8 @@ y\\R'#DESCENDER \\n[.cdp]'
\# <none> | <anything>
\# *Function:
\# If invoked via the alias HDRFTR_RULE_INTERNAL in HDRFTR, prints a rule
-\# under the header/footer. Otherwise, turns HDRFTR_RULE on or off.
+\# under the header/over the footer. Otherwise, turns HDRFTR_RULE
+\# on or off.
\#
.MAC HDRFTR_RULE END \"To print rule under header/over footer.
. ie '\\$0'HDRFTR_RULE_INTERNAL' \{\
@@ -7298,7 +7478,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#HDRFTR_RULE] \{\
. HDRFTR_RULE_INTERNAL
. \}
-.br
+. br
.END
\#
\#
@@ -7456,7 +7636,11 @@ y\\R'#DESCENDER \\n[.cdp]'
\# comprehensible.
\#
.MAC HEADER END
-. PROCESS_FN_LEFTOVER
+. rr #FROM_FOOTER
+. nr #FROM_HEADER 1
+. nr #LAST_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]
+. if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
+. rr #RULED
. if \\n[#RESET_FN_NUMBER] \{ .nr #FN_NUMBER 0 1 \}
. po \\n[#DOC_L_MARGIN]u
. if \\n[#RECTO_VERSO] \{\
@@ -7567,6 +7751,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. el \{ .ns \}
. ns
. if \\n[#COLUMNS] \{\
+. nr #FN_COUNT_FOR_COLS 0 1
. nr #L_MARGIN \\n[#DOC_L_MARGIN]
. if \\n[#RECTO_VERSO] \{ .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u \}
. nr #COL_NUM 0 1
@@ -7596,18 +7781,16 @@ y\\R'#DESCENDER \\n[.cdp]'
. el \{ .nr #FN_NUMBER \\n[#FN_NUMBER] 1 \}
. rm FN_IN_DIVER
. \}
-. if \\n[#RESET_FN_COUNTERS]=2 \{\
-. rr #RESET_FN_COUNTERS
-. PROCESS_FN_IN_DIVER
-. nr #FN_COUNT 0 1
-. nr #FN_COUNT_FOR_COLS 0 1
-. rm FN_IN_DIVER
-. \}
. if \\n[#PRINT_STYLE]=1 \{\
. if \\n[#SLANT_ON] \{\
. if \\n[#UNDERLINE_SLANT] \{ .UNDERLINE \}
. \}
. \}
+. rr #FROM_HEADER
+. rr #DEFER_SPACE_ADDED
+. if !\\n[#FN_DEPTH] \{\
+. if r#DIVERTED \{ .rr #DIVERTED \}
+. \}
.END
\#
\# ====================================================================
@@ -7681,57 +7864,85 @@ y\\R'#DESCENDER \\n[.cdp]'
\#
.MAC FOOTER END
. ev PAGE_BOTTOM
-\# Removed this next bit; can't figure out why I needed it.
-\#. if \\n[#START]=1 \{\
-\#. bp
-\#. ev
-\#. rr #START
-\#. return
-\#. \}
+. nr #SAVED_LEAD \\n(.v
+\# I can't figure out why I thought I needed this next bit, but I'm
+\# leaving it in, commented out, in case I (re)discover what it was
+\# there for.
+\#
+\#.if \\n[#START]=1 \{\
+\#.bp
+\#.ev
+\#.rr #START
+\#.return
+\#.\}
+\#
. nr #L_MARGIN_DIFF \\n[#L_MARGIN]-\\n[#DOC_L_MARGIN]
. if !\\n[#FN_DEFER] \{\
. nr #DIVER_DEPTH 0
-. if \\n[#FN_COUNT] \{\
-. sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u)
+. if \\n[#FN_DEPTH] \{\
+\# #DIVERTED=2 doesn't seem to have a use anymore, but I'm leaving
+\# this in, commented out, in case I discover why I thought I needed
+\# it.
+\#
+\#.if \\n[#DIVERTED]=2 \{ .nr #FN_DEPTH -\\n[#VFP_DIFF] \}
+\#
+. if \\n[#DIVERTED]=3 \{ .nr #FN_DEPTH +\\n[#VFP_DIFF] \}
+. sp |\\n[#PAGE_LENGTH]u-(\\n[#B_MARGIN]u+\\n[#FN_DEPTH]u-\\n[#DOC_LEAD]u)
. po \\n[#DOC_L_MARGIN]u
. if \\n[#COLUMNS] \{\
. po \\n[#COL_\\n[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n(.o
+. nr #FROM_FOOTER 1
. \}
. nf
. FOOTNOTES
. rm FOOTNOTES
+. if \\n[#PRINT_STYLE]=1 \{ .vs \\n[#SAVED_LEAD]u \}
+. if \\n[#PRINT_STYLE]=2 \{ .LS \\n[#SAVED_LEAD]u \}
. if '\\n(.z'FN_OVERFLOW' \{\
. di
. nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
. \}
+. nr #FN_COUNT_AT_FOOTER \\n[#FN_COUNT]
. nr #FN_COUNT 0
-. if \\n[#COL_NEXT] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
+. if \\n[#COL_NEXT] \{\
+. ie !\\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #COL_NUM \\n-[#COL_NUM] \}
+. el \{ .nr #COL_NUM \\n[#NUM_COLS] 1 \}
+. \}
. \}
+. rr #DIVERTED
. \}
-. ie \\n[#COLUMNS] \{\
+. ie \\n[#COLUMNS]=1 \{\
. ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .DO_FOOTER \}
. el \{\
. ie \\n[#ENDNOTES] \{ .sp |\\n(ecu-\\n[#EN_LEAD]u \}
. el \{ .sp |\\n(dcu \}
. po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
. nr #L_MARGIN \\n(.o
-. PROCESS_FN_LEFTOVER
+\# #DIVERTED=2 doesn't seem to have a use anymore, but I'm leaving
+\# this in, commented out, in case I discover why I thought I needed
+\# it.
+\#
+\# Reverse the sense of #DIVERTED=2 (from above) if moving col to col
+\#.if \\n[#DIVERTED]=2 \{ .nr #FN_DEPTH +\\n[#VFP_DIFF] \}
+\#
+. if \\n[#FN_DEPTH] \{ .PROCESS_FN_LEFTOVER \}
+. LS \\n[#SAVED_LEAD]u
+. if \\n[#PREV_FN_DEFERRED] \{\
+. nr #PREV_FN_DEFERRED 2
+. \}
+. rr #RULED
. if !\\n[#EPIGRAPH] \{ .rr #COL_NEXT \}
. if !\\n[#QUOTE] \{ .rr #COL_NEXT \}
. if \\n[#RESET_FN_COUNTERS]=1 \{\
. rr #RESET_FN_COUNTERS
. PROCESS_FN_IN_DIVER
+. LS \\n[#SAVED_LEAD]u
. nr #FN_COUNT \\n[#FN_COUNT] 1
. nr #FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] 1
. rm FN_IN_DIVER
. \}
-. if \\n[#RESET_FN_COUNTERS]=2 \{\
-. rr #RESET_FN_COUNTERS
-. nr #FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS] 1
-. PROCESS_FN_IN_DIVER
-. rm FN_IN_DIVER
-. \}
+. rr #DEFER_SPACE_ADDED
. if \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
. if \\n[#QUOTE] \{\
. ie \\n[#TAB_ACTIVE] \{ .TAB \\n[#CURRENT_TAB] \}
@@ -7763,6 +7974,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. ev
. \}
. ns
+. rr #DIVERTED
. \}
. el \{ .DO_FOOTER \}
.END
@@ -7777,11 +7989,14 @@ y\\R'#DESCENDER \\n[.cdp]'
\# Resets CAPS and UNDERLINE if they were on.
\#
.MAC DO_FOOTER END
+\# Have to change position of FN_OVERFLOW_TRAP or it screws up the
+\# placement of page numbers (or footers). It's reset to its original
+\# position at the end of the macro.
+. ch FN_OVERFLOW_TRAP 20i
. ie (\\n[#FOOTER_MARGIN]+\\n(.v)>\\n[#B_MARGIN] \{\
. nr #SKIP_FOOTER 1
. \}
. el \{\
-. vs 12
. sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-1v
. mk y
. \}
@@ -7795,6 +8010,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. if \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
. \}
+. LS \\n[#SAVED_LEAD]u
. nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
. if \\n[#CAPS_ON] \{\
. nr #CAPS_WAS_ON 1
@@ -7824,6 +8040,8 @@ y\\R'#DESCENDER \\n[.cdp]'
. rr #UNDERLINE_WAS_ON
. \}
. ev
+. ch FN_OVERFLOW_TRAP -(\\n[#FN_OVERFLOW_TRAP_POS]u)
+. rr #SAVED_LEAD
. bp
. ev
.END
@@ -9063,7 +9281,9 @@ y\\R'#DESCENDER \\n[.cdp]'
. EOL
. \}
. QUAD \\*[$BQUOTE_QUAD]
-. HY
+. nr #DIVERSIONS_HY_MARGIN (p;\\n[.ps]u*2.75)/1000
+. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
+. hy 14
. \}
. nr #Q_TOP \\n(nl
. if \\n[#INDENT_FIRST_PARAS] \{\
@@ -9097,8 +9317,17 @@ y\\R'#DESCENDER \\n[.cdp]'
\# line. (This is to ensure the page remains bottom aligned).
\#
.MAC DO_QUOTE END
+. br
. di
. rr #IN_DIVER
+. if \\n[#RESET_FN_COUNTERS]=2 \{\
+. if !\\n[#FN_COUNT]=1 \{\
+. if ((\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS])+\\n[#DIVER_DEPTH])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
+. DIVER_FN_2_POST
+. rr #RESET_FN_COUNTERS
+. \}
+. \}
+. \}
. nr #SAVED_FN_NUMBER \\n[#FN_NUMBER]
. nr #DONE_ONCE 0 1
. REMOVE_INDENT
@@ -9146,6 +9375,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. \}
. \}
. \}
+. if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
. \}
. el \{\
. rr #Q_FITS
@@ -9441,6 +9671,7 @@ y\\R'#DESCENDER \\n[.cdp]'
. nr #HYPHEN_ADJ \\n[#CAP_HEIGHT]/12
. ds $HYPHEN \v'-\En[#HYPHEN_ADJ]u'-\v'\En[#HYPHEN_ADJ]u'
. PRINT \m[\\*[$PAGENUM_COLOR]]\\*[$HYPHEN]\|\\n[#PAGENUMBER]\|\\*[$HYPHEN]
+.br
.END
\#
\#
@@ -9537,6 +9768,14 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
\#
\# +++FOOTNOTES+++
\#
+\# Mom's footnote handling is baroque, to say the least. There are
+\# redundancies in a number of the macros involved, as well as some
+\# registers that probably don't get used anymore. The baggage is
+\# left in in case some new footnote oddity/challenge gets thrown
+\# my way.
+\#
+\# The macros are heavily commented.
+\#
\# FOOTNOTE AUTOLEAD
\# -----------------
\# *Arguments:
@@ -9682,129 +9921,79 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
\#
.MAC FOOTNOTE END
. ie '\\$1'' \{\
-. if \\n[#IN_DIVER]=1 \{\
-. nr #PAGE_POS \\n(nl+\\n(.d
-. nr #FOOTER_POS \\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]
-. nr #BMARG \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]
-. nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
-\# Enough room for 1 line of footnote
-. nr #RESERVED_SPACE \\n[#FN_LEAD]*2+\\n[#DOC_LEAD]
-\# A) Are we on the line where FOOTER will be sprung? If so, defer footnote.
-. if \\n[#PAGE_POS]+\\n[#SPACE_TO_FOOTER]=\\n[#FOOTER_POS] \{\
-. nr #DEFER_FN_IN_DIVER 1
-\# When a footnote in a diversion is the first footnote on the
-\# page, the above condition is always true. This test takes care
-\# of that. If it's a genuine deferred footnote in a diversion,
-\# we set #DEFER_FN_IN_DIVER to 1. Otherwise, we set it to 3.
-. if \\n[#RESERVED_SPACE]<\\n[#SPACE_TO_FOOTER] \{\
-. ie \\n[#SPACE_TO_FOOTER]-\\n[#RESERVED_SPACE]>\\n[#DOC_LEAD] \{\
-. nr #DEFER_FN_IN_DIVER 3 \" treat like a normal footnote
-. \}
-. el \{\
-. nr #DEFER_FN_IN_DIVER 1 \" defer this footnote; cond 1
-. \}
-. \}
-\# Sometimes, A) returns true even though we're below FOOTER. I
-\# can't track down why, and the behaviour occurs sporadically. I
-\# call it the "wonky factor." This *seems* to take care of it, but
-\# I might have to adjust FN_LEAD, below, to DOC_LEAD, or some other
-\# "wonky" value.
-. if \\n[#SPACE_TO_FOOTER]<\\n[#FN_LEAD] \{\
-. nr #PAGE_POS \\n[#PAGE_POS]+\\n[#SPACE_TO_FOOTER]
-. nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
-. if \\n[#PAGE_POS]+\\n[#SPACE_TO_FOOTER]=\\n[#FOOTER_POS] \{\
-. nr #DEFER_FN_IN_DIVER 2 \" move this footnote; cond 2
-. \}
-. \}
-. \}
-. if \\n[#PAGE_POS]>=\\n[#FOOTER_POS] \{ .nr #DEFER_FN_IN_DIVER 2 \}
-. if r#DEFER_FN_IN_DIVER \{\
-. \\n+[#DONE_ONCE]
-\# Condition 1:
+\# Begin processing footnotes that occur inside QUOTE, BLOCKQUOTE
+\# or EPIGRAPH.
+. if \\n[#IN_DIVER]=1 \{\
+. nr #PAGE_POS \\n(nl+\\n(.d+\\n[#DOC_LEAD]
+. nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS]-1)
+. nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
+\# Are we on a "defer" line? If so, defer the text of the footnote.
+. ie \\n[#SPACE_TO_FOOTER]=\\n[#DOC_LEAD]:\\n[#SPACE_TO_FOOTER]=0 \{\
+. nr #DIVER_FN 2 \" treat like a normal deferred footnote
+. \}
+. el \{\
+. nr #DIVER_FN 2 \" treat like a normal footnote
+. \}
+. if \\n[#PAGE_POS]>\\n[#FOOTER_POS] \{\
+. nr #DIVER_FN 1 \" move this footnote
+. \}
+\# Test for situation where, because a final line of QUOTE,
+\# BLOCKQUOTE or EPIGRAPH isn't yet adjusted at this point, the last
+\# word on the line may *seem* to belong to the final line of the
+\# page, but will, in fact, become the first word of the subsequent
+\# page. In such circumstances, we want the the footnote to be
+\# treated as a "moved" diversion footnote.
+. if \\n(.k>\\n(.l \{ .nr #DIVER_FN 1 \}
+. if r#DIVER_FN \{\
+. if !\\n[#DIVER_FN]=2 \{ .\\n+[#DONE_ONCE] \}
\# A footnote inside a diversion will become the 1st footnote on the
\# following page/column.
-. if \\n[#DEFER_FN_IN_DIVER]=2 \{\
-. nr #RESET_FN_COUNTERS 1
-. nr #COUNTERS_RESET 1
+. if \\n[#DIVER_FN]=1 \{ .DIVER_FN_1_PRE \}
+\# A footnote inside a diversion that should be treated like a
+\# normal footnote (including defers.)
+. if \\n[#DIVER_FN]=2 \{ .DIVER_FN_2_PRE \}
+. \}
+. nr #SAVED_FN_COUNT \\n[#FN_COUNT]+1
+. nr #SAVED_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]+1
+. \}
+\# End processing footnotes that occur inside QUOTE, BLOCKQUOTE or
+\# EPIGRAPH.
+\#
+\# Test for situation where, because a final line of running text
+\# isn't yet adjusted at this point, the last word on the line may
+\# *seem* to belong to the final line of the page, but will, in
+\# fact, become the first word of the subsequent page. In such
+\# circumstances, we want the the footnote marker in running text to
+\# be the correct one for the 1st footnote on a page.
+. if \\n(.k>\\n(.l \{\
+. if (\\n(nl+\\n[#DOC_LEAD])>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
. if \\n[#FN_MARKER_STYLE]=1 \{\
-. if \\n[#DONE_ONCE]=1 \{\
-. if \\n[#FN_COUNT]>0 \{ .nr #FN_COUNT 0 1 \}
-. if \\n[#COLUMNS]=1 \{\
-. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
-. nr #FN_COUNT_FOR_COLS 0 1
-. \}
-. \}
-. \}
+. nr #FN_COUNT_FOR_COLS 0 1
. \}
. if \\n[#FN_MARKER_STYLE]=2 \{\
-. if \\n[#DONE_ONCE]=1 \{\
-. if \\n[#RESET_FN_NUMBER]=1 \{\
-. ie \\n[#COLUMNS]=1 \{\
-. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
-. \}
-. el \{\
-. nr #FN_NUMBER 0 1
-. \}
-. \}
+. if \\n[#RESET_FN_NUMBER] \{\
+. nr #FN_NUMBER 0 1
+. nr #NOT_YET_ADJUSTED 1
. \}
. \}
. \}
-\# Condition 2:
-\# A footnote inside a diversion that has to be deferred to next
-\# page/column
-. if \\n[#DEFER_FN_IN_DIVER]=1 \{\
-. nr #RESET_FN_COUNTERS 2
-. nr #COUNTERS_RESET 1
-. if \\n[#FN_MARKER_STYLE]=1 \{\
-. if \\n[#DONE_ONCE]=1 \{\
-. if \\n[#FN_COUNT]=0 \{\
-. nr #ADD_DEFER_SPACE 1
-. nr #DONT_RULE_ME 1
-. nr #NO_EXTRA_SPACE 1
-. \}
-. if \\n[#FN_COUNT]>0 \{\
-. nr #FN_COUNT 0 1
-. nr #NO_EXTRA_SPACE 1
-. \}
-. if \\n[#COLUMNS]=1 \{\
-. if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{ .rr #ADD_DEFER_SPACE \}
-. \}
-. \}
-. \}
-. if \\n[#FN_MARKER_STYLE]=2 \{\
-. if \\n[#DONE_ONCE]=1 \{\
-. if \\n[#FN_COUNT]=0 \{\
-. nr #ADD_DEFER_SPACE 1
-. nr #DONT_RULE_ME 1
-. nr #NO_EXTRA_SPACE 1
-. \}
-. if \\n[#FN_COUNT]>0 \{\
-. nr #FN_COUNT 0 1
-. nr #NO_EXTRA_SPACE 1
-. \}
-. if \\n[#RESET_FN_NUMBER]=1 \{\
-. ie \\n[#COLUMNS]=1 \{\
-. if \\n[#FN_NUMBER]=0 \{\
-. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
-. \}
-. \}
-. el \{\
-. if \\n[#FN_NUMBER]=0 \{ .nr #FN_NUMBER 0 1 \}
-. \}
-. \}
-. \}
-. \}
+. \}
+. el \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. nr #FN_COUNT 0 1
. \}
-\# Condition 3:
-\# Treat like a normal footnote.
-. if \\n[#DEFER_FN_IN_DIVER]=3 \{\
-\#. \\n-[#DONE_ONCE]
+. if \\n[#FN_MARKER_STYLE]=2 \{\
+. if \\n[#RESET_FN_NUMBER] \{\
+. nr #FN_NUMBER 0 1
+. nr #NOT_YET_ADJUSTED 1
+. \}
. \}
. \}
-. nr #SAVED_FN_COUNT \\n[#FN_COUNT]+1
-. nr #SAVED_FN_COUNT_FOR_COLS \\n[#FN_COUNT_FOR_COLS]+1
+. \}
. \}
-\# End processing footnotes that occur inside diversions.
+\# Housekeeping
. if \\n[#FN_MARKERS] \{\
. if \\n[#CONDENSE] \{ \*[CONDX]\c \}
. if \\n[#EXTEND] \{ \*[EXTX]\c \}
@@ -9814,36 +10003,43 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. UNDERLINE OFF
. \}
. \}
-\# Add footnote markers to running text
+\# Add footnote markers to running text...
. if !\\n[#NO_FN_MARKER] \{\
-\# If .em TERMINATE has not been called
+\# ...but not if TERMINATE has not been called
. if !r#TERMINATE \{\
+\# Marker style star/dagger/double-dagger
. if \\n[#FN_MARKER_STYLE]=1 \{\
+\# Columnar docs either move col to col, or last col to next page.
+\# They require their own special FN_COUNT because regular FN_COUNT
+\# is used to figure out things like whether or not to put a rule
+\# above footnotes (in addition to keeping track of the footnote
+\# count in non-columnar docs).
. ie \\n[#COLUMNS]=1 \{\
-. if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU3]* \}
-. if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU3]\(dg \}
-. if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \*[BU3]\(dd \}
-. if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU3]** \}
-. if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU3]\(dg\(dg \}
-. if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \*[BU3]\(dd\(dd \}
-. if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU3]*** \}
-. if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
-. if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \*[BU3]\(dd\(dd\(dd \}
-. if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU3]**** \}
+. if \\n[#FN_COUNT_FOR_COLS]=0 \{ .PRINT \*[BU2]* \}
+. if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT \*[BU1]\(dg \}
+. if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dd \}
+. if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \*[BU2]** \}
+. if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT \*[BU1]\(dg\(dg \}
+. if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dd\(dd \}
+. if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \*[BU2]*** \}
+. if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg \}
+. if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dd\(dd\(dd \}
+. if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \*[BU2]**** \}
. \}
. el \{\
-. if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU3]* \}
-. if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU3]\(dg \}
-. if \\n[#FN_COUNT]=2 \{ .PRINT \*[BU3]\(dd \}
-. if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU3]** \}
-. if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU3]\(dg\(dg \}
-. if \\n[#FN_COUNT]=5 \{ .PRINT \*[BU3]\(dd\(dd \}
-. if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU3]*** \}
-. if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU3]\(dg\(dg\(dg \}
-. if \\n[#FN_COUNT]=8 \{ .PRINT \*[BU3]\(dd\(dd\(dd \}
-. if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU3]**** \}
+. if \\n[#FN_COUNT]=0 \{ .PRINT \*[BU2]* \}
+. if \\n[#FN_COUNT]=1 \{ .PRINT \*[BU1]\(dg \}
+. if \\n[#FN_COUNT]=2 \{ .PRINT \(dd \}
+. if \\n[#FN_COUNT]=3 \{ .PRINT \*[BU2]** \}
+. if \\n[#FN_COUNT]=4 \{ .PRINT \*[BU1]\(dg\(dg \}
+. if \\n[#FN_COUNT]=5 \{ .PRINT \(dd\(dd \}
+. if \\n[#FN_COUNT]=6 \{ .PRINT \*[BU2]*** \}
+. if \\n[#FN_COUNT]=7 \{ .PRINT \*[BU1]\(dg\(dg\(dg \}
+. if \\n[#FN_COUNT]=8 \{ .PRINT \(dd\(dd\(dd \}
+. if \\n[#FN_COUNT]=9 \{ .PRINT \*[BU2]**** \}
. \}
. \}
+\# Marker style superscript numbers
. if \\n[#FN_MARKER_STYLE]=2 \{\
. 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" \}
. if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n+[#FN_NUMBER]\*[SUPX]" \}
@@ -9851,11 +10047,27 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. \}
. \}
. \}
-. nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-(\\n(nl+1v)
+\# More housekeeping
+\#
+\# #SPACE_REMAINING is the space left between where we are
+\# on the page and the bottom margin. It's used to determine whether
+\# or not the footnote will overflow, and how many lines of
+\# footnotes will fit on the page if some have to overflow.
+. ie \\n[#DIVER_FN]=2 \{\
+. nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-(\\n[#PAGE_POS])
+. \}
+. el \{\
+. nr #SPACE_REMAINING (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n(nl
+. \}
+. if \\n[#FROM_DIVERT_FN]=1 \{\
+. nr #SPACE_REMAINING \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]
+. rr #FROM_DIVERT_FN
+. \}
. nr #PP_STYLE_PREV \\n[#PP_STYLE]
. nr #PP_STYLE 2
. if \\n[#INDENT_FIRST_PARAS] \{ .nr #INDENT_FIRSTS 1 \}
. INDENT_FIRST_PARAS
+\# Prepare FOOTNOTE to receive footnote text.
. ev FOOTNOTES
. ll \\n[#DOC_L_LENGTH]u
. ta \\n(.lu
@@ -9878,12 +10090,13 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. QUAD \\*[$FN_QUAD]
. if \\n[#PRINT_STYLE]=1 \{\
. TYPEWRITER
-. ie \\n[#SINGLE_SPACE] \{ .vs \\n[#DOC_LEAD]u \}
-. el \{ .vs \\n[#DOC_LEAD]u/2u \}
+. ie \\n[#SINGLE_SPACE] \{ .vs \\n[#ORIGINAL_DOC_LEAD]u \}
+. el \{ .vs \\n[#ORIGINAL_DOC_LEAD]u/2u \}
. QUAD LEFT
. HY OFF
. \}
. nr #FN_LEAD \\n[#LEAD]
+\# Begin diversion FOOTNOTES or FN_IN_DIVER
. ie r#COUNTERS_RESET \{\
. ie \\n[#DONE_ONCE]=1 \{\
. di FN_IN_DIVER
@@ -9903,57 +10116,91 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. TRAP
. \}
. if \\n[#EPIGRAPH] \{ .nr #FN_FOR_EPI 1 \}
+\# When a deferred footnote is also the 1st footnote on the page,
+\# and when the page it's output on also has footnotes, some
+\# whitespace is needed between the deferred footnote and the
+\# first footnote belonging to the output page so that there's
+\# no confusion when two stars (or two number 1s) appear in
+\# footnotes...
. if \\n[#FN_DEFER_SPACE] \{\
-\# Only do this if .em TERMINATE has not been called
+\# ...but only add the extra space if TERMINATE has not been called
. if !r#TERMINATE \{\
-. if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
-. if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
+\# ...and not if defer space has already been added
+. if !\\n[#DEFER_SPACE_ADDED] \{\
+\# ...and not if the footnote count the last time we checked for
+\# a defer situation inside a diversion is greater than 1.
+. if !\\n[#SAVED_DIVER_FN_COUNT]>1 \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{ .ALD 1v \}
+. if \\n[#RESET_FN_NUMBER] \{ .ALD 1v \}
+. nr #DEFER_SPACE_ADDED 1
+. \}
+. \}
. \}
. rr #FN_DEFER_SPACE
+. rr #SAVED_DIVER_FN_COUNT
. \}
-\# If #DONT_RULE_ME hasn't been set to 1, perform the subsequent clause
-. if !\\n[#DONT_RULE_ME]=1 \{\
-. if \\n+[#FN_COUNT]=1 \{\
+. if \\n[#DIVERTED]=3 \{\
+. if \\n[#FN_COUNT]>0 \{\
+\!.RLD 1v
+. \}
+. \}
+\# Add footnote rule (or, if no rule, some whitespace).
+\# N.B.- this line increments #FN_COUNT each and every time FOOTNOTE
+\# is run.
+. if \\n+[#FN_COUNT]=1 \{\
+\# If a footnote is called in a diversion, and the footnote has to
+\# be moved, don't put in the rule now (it's taken care of when
+\# FN_IN_DIVER is output into FOOTNOTE in PROCESS_FN_IN_DIVER).
+. if !\\n[#DONT_RULE_ME]=1 \{\
. if !\\n[#FN_DEPTH] \{\
. if \\n[#PRINT_STYLE]=1 \{ .ALD \\n[#DOC_LEAD]u \}
-. ie \\n[#FN_RULE] \{ .PRINT_FOOTNOTE_RULE \}
+. ie \\n[#FN_RULE]=1 \{ .PRINT_FOOTNOTE_RULE \}
. el \{ .ALD 1v \}
+. nr #RULED 1
. \}
. \}
. \}
. rr #DONT_RULE_ME
+\# Add footnote markers to footnote text...
. if \\n[#FN_MARKERS] \{\
. if !\\n[#NO_FN_MARKER] \{\
-\# If .em TERMINATE has not been called
+\# ...but not if TERMINATE has been called.
. if !r#TERMINATE \{\
. if \\n[#FN_MARKER_STYLE]=1 \{\
. ie \\n[#COLUMNS]=1 \{\
. \\n+[#FN_COUNT_FOR_COLS]
-. if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT *\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dg\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \(dd\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT **\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dg\(dg\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \(dd\(dd\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT ***\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=1 \{ .PRINT *\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=2 \{ .PRINT \(dg\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=3 \{ .PRINT \(dd\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=4 \{ .PRINT **\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=5 \{ .PRINT \(dg\(dg\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=6 \{ .PRINT \(dd\(dd\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=7 \{ .PRINT ***\c \}
. if \\n[#FN_COUNT_FOR_COLS]=8 \{ .PRINT \(dg\(dg\(dg\c \}
. if \\n[#FN_COUNT_FOR_COLS]=9 \{ .PRINT \(dd\(dd\(dd\c \}
-. if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT ****\c \}
+. if \\n[#FN_COUNT_FOR_COLS]=10 \{ .PRINT ****\c \}
. \}
. el \{\
-. if \\n[#FN_COUNT]=1 \{ .PRINT *\c \}
-. if \\n[#FN_COUNT]=2 \{ .PRINT \(dg\c \}
-. if \\n[#FN_COUNT]=3 \{ .PRINT \(dd\c \}
-. if \\n[#FN_COUNT]=4 \{ .PRINT **\c \}
-. if \\n[#FN_COUNT]=5 \{ .PRINT \(dg\(dg\c \}
-. if \\n[#FN_COUNT]=6 \{ .PRINT \(dd\(dd\c \}
-. if \\n[#FN_COUNT]=7 \{ .PRINT ***\c \}
+. if \\n[#FN_COUNT]=1 \{ .PRINT *\c \}
+. if \\n[#FN_COUNT]=2 \{ .PRINT \(dg\c \}
+. if \\n[#FN_COUNT]=3 \{ .PRINT \(dd\c \}
+. if \\n[#FN_COUNT]=4 \{ .PRINT **\c \}
+. if \\n[#FN_COUNT]=5 \{ .PRINT \(dg\(dg\c \}
+. if \\n[#FN_COUNT]=6 \{ .PRINT \(dd\(dd\c \}
+. if \\n[#FN_COUNT]=7 \{ .PRINT ***\c \}
. if \\n[#FN_COUNT]=8 \{ .PRINT \(dg\(dg\(dg\c \}
. if \\n[#FN_COUNT]=9 \{ .PRINT \(dd\(dd\(dd\c \}
-. if \\n[#FN_COUNT]=10 \{ .PRINT ****\c \}
+. if \\n[#FN_COUNT]=10 \{ .PRINT ****\c \}
. \}
. \}
. if \\n[#FN_MARKER_STYLE]=2 \{\
+. if \\n[#COLUMNS]=1 \{\
+. \\n+[#FN_COUNT_FOR_COLS]
+. \}
+. if \\n[#NOT_YET_ADJUSTED]=1 \{\
+. nr #FN_NUMBER 1 1
+. rr #NOT_YET_ADJUSTED
+. \}
. if \\n[#PRINT_STYLE]=1 \{ .PRINT "(\\n[#FN_NUMBER])\c" \}
. if \\n[#PRINT_STYLE]=2 \{ .PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\*[FU 2]\c" \}
. \}
@@ -9962,6 +10209,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. \}
. \}
. el \{\
+\# If INDENT arg passed to footnotes, calculate the indent...
. ie '\\$1'INDENT' \{\
. ev FOOTNOTES
. if '\\$2'L' \{ .in (\\$3) \}
@@ -9981,11 +10229,26 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. in \\n[#FN_BL_INDENT]u
. \}
. ev
+\# ...then re-run FOOTNOTE without an argument.
. FOOTNOTE
. \}
. el \{\
. br
+\# Add "defer space" if the previously diverted footnote was the
+\# 1st footnote proper to its page (i.e. it looks like a deferred
+\# footnote but its really an overflow).
+. if \\n[#DIVERTED] \{\
+. if \\n[#PREV_FN_DEFERRED]=1 \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{ .ALD \\n[#FN_LEAD]u \}
+. if \\n[#RESET_FN_NUMBER] \{ .ALD \\n[#FN_LEAD]u \}
+. nr #PREV_FN_DEFERRED 2
+. \}
+. \}
+\# Terminate FOOTNOTES or FN_IN_DIVER diversion
. di
+. HY_SET 1 \\n[#DIVERSIONS_HY_MARGIN]u (\\n[#PT_SIZE]u/1000u/8u)p
+. hy 14
+\# More housekeeping
\# Turn off indent possibly set by FOOTNOTE INDENT
. in 0
. if \\n[#PRINT_STYLE]=1 \{\
@@ -10000,119 +10263,487 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. nr #PP_STYLE \\n[#PP_STYLE_PREV]
. if !\\n[#INDENT_FIRSTS] \{ .INDENT_FIRST_PARAS OFF \}
. rr #INDENT_FIRSTS
+\# Calculate footnote depth, but not if #COUNTERS_RESET (created in
+\# DIVER_FN_1_PRE) to instruct FOOTNOTES to skip this step for now
+\# (it's taken care of when FN_IN_DIVER is output into FOOTNOTES in
+\# PROCESS_FN_IN_DIVER).
. ie r#COUNTERS_RESET \{\
. rr #COUNTERS_RESET
. \}
. el \{\
-. nr #FN_DEPTH +\\n[#DIVER_DEPTH]
-. if \\n[#FN_DEFER] \{\
-. nr #FN_DEFER_SPACE 1
-. rr #FN_DEFER
+. nr #GET_DEPTH 1
+\# If the footnote is the 1st on the page and it falls too close
+\# to the bottom margin, defer the footnote text to the next page...
+. if (\\n[#SPACE_REMAINING]-1)<=(\\n[#DOC_LEAD]) \{\
+\# ...but not if PROCESS_FN_LEFTOVER has set #PREV_FN_DEFERRED to 1
+. if !\\n[#PREV_FN_DEFERRED]=1 \{\
+. nr #FN_DEFER 1
+. nr #FN_DEPTH +\\n[#DIVER_DEPTH]
+. rr #GET_DEPTH
+\# This is required so that the defer space clause can distinguish
+\# a real #FN_COUNT=1 from one generated if footnotes is run inside
+\# QUOTE, BLOCKQUOTE or EPIGRAPH
+. if \\n[#DIVER_FN]=2 \{\
+. nr #SAVED_DIVER_FN_COUNT \\n[#FN_COUNT]
+. rr #DIVER_FN
+. \}
+. \}
. \}
-. if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
-. ie \\n[#SPACE_REMAINING]<(\\n[#LEAD]*2) \{ .nr #FN_DEFER 1 \}
-. el \{\
+\# Calculate the footnote depth.
+. if \\n[#GET_DEPTH]=1 \{\
+\# Save the previous footnote depth (for use when there will be
+\# some overflowed footnote text).
+. nr #SAVED_FN_DEPTH_1 \\n[#FN_DEPTH]
+\# Add the depth of the current footnote to any already existent
+\# footnotes.
+. nr #FN_DEPTH +\\n[#DIVER_DEPTH]
+\# Save the new depth
+. nr #SAVED_FN_DEPTH_2 \\n[#FN_DEPTH]
+\# Signal that defer space should be added when PROCESS_FN_LEFTOVER
+\# processes deferred footnotes.
+. if \\n[#FN_DEFER] \{\
+. if \\n[#FN_COUNT]=2 \{\
+. ie \\n[#COLUMNS] \{\
+. if !\\n[#FROM_FOOTER] \{\
+. if \\n[#FN_DEFER]=1 \{ .nr #FN_DEFER_SPACE 1 \}
+. if \\n[#FN_COUNT_FOR_COLS]>=1 \{ .rr #FN_DEFER_SPACE \}
+. if \\n[#FROM_HEADER] \{ .nr #FN_DEFER_SPACE 1 \}
+. \}
+. \}
+. el \{\
+. nr #FN_DEFER_SPACE 1
+. \}
+. \}
+. rr #FN_DEFER
+. \}
+\# If the depth of the whole footnote won't fit in the space
+\# between where we are on the page and the bottom margin, calculate
+\# how much of it will fit.
+. if \\n[#FN_DEPTH]>\\n[#SPACE_REMAINING] \{\
. nr #FN_LINES 0 1
-. while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<\\n[#SPACE_REMAINING] \{\
+. while (\\n+[#FN_LINES]*\\n[#FN_LEAD])<(\\n[#SPACE_REMAINING] \{\
. nr #FN_DEPTH (\\n[#FN_LINES]*\\n[#FN_LEAD])
. \}
+. nr #VFP_DIFF \\n[#FN_DEPTH]-\\n[#SAVED_FN_DEPTH_1]
+. nr #OVERFLOW 1
+\# Very occasionally, #VFP_DIFF, on a 1st footnote that isn't to
+\# be deferred, comes up with a depth equal to exactly 1 line
+\# of footnotes, i.e. enough room to print the rule and nothing
+\# else. The following tests for such a condition, and rather than
+\# attempting to treat the footnote as an overflow, it tells mom to
+\# treat it as a special kind of deferred footnote (#FN_DEFER 2).
+. if \\n[#SAVED_FN_DEPTH_1]=0 \{\
+. if \\n[#FN_DEPTH]=\\n[#FN_LEAD] \{\
+. nr #FN_DEFER 2
+. nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_2]
+. rr #OVERFLOW
+. \}
+. \}
+. \}
+\# Calculate VFP based on whether the footnote overflows, or is to
+\# be treated normally.
+. ie \\n[#OVERFLOW]=1 \{\
+. ie \\n[#FN_COUNT]=1 \{\
+. ie \\n[#RULED]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. ie \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. ie \\n[#FROM_FOOTER] \{\
+. ie \\n[#FN_COUNT_FOR_COLS]>1 \{\
+. nr #FN_DEPTH -\\n[#FN_DEPTH]
+. if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
+. if !\\n[#PREV_FN_DEFERRED]=1 \{\
+. nr #FN_DEPTH -\\n[#VFP_DIFF]
+. \}
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
+. if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
+. \}
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
+. \}
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH])
+. \}
+. \}
+. el \{ .nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]) \}
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
+. if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 3 \}
+. if !\\n[#PREV_FN_DEFERRED]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if !\\n[#FROM_FOOTER] \{\
+.
+. \}
+. \}
+. el \{\
+. nr #FN_DEPTH -\\n[#VFP_DIFF]
+. \}
+. \}
+. if \\n[#DIVERTED]=3 \{\
+. if !\\n[#PREV_FN_DEFERRED] \{\
+. if !\\n[#FROM_FOOTER] \{\
+. if \\n[#FN_COUNT]=1 \{\
+. if !\\n[#VFP_DIFF] \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. da FOOTNOTES
+\!.ALD \\n[#FN_LEAD]u
+. di
+. \}
+. if \\n[#RESET_FN_NUMBER] \{\
+. da FOOTNOTES
+\!.ALD \\n[#FN_LEAD]u
+. di
+. \}
+. \}
+. \}
+. \}
+. \}
+. \}
+. \}
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
+. nr #FN_DEPTH \\n[#SAVED_FN_DEPTH_1]+\\n[#VFP_DIFF]
+. \}
+. rr #OVERFLOW
+. rr #RULED
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
+. if \\n[#PREV_FN_DEFERRED]=1 \{\
+. if \\n[#DIVERTED] \{\
+. if !\\n[#FN_DEPTH]=\\n[#SAVED_FN_DEPTH_1] \{\
+. nr #FN_DEPTH +\\n[#FN_LEAD]
+. nr #VARIABLE_FOOTER_POS -\\n[#FN_LEAD]
+. rr #PREV_FN_DEFERRED
+. \}
+. \}
+. \}
+. if \\n[#FN_COUNT]>1 \{\
+. nr #NO_BACK_UP 1
+\# DIVERTED=2 doesn't seem to serve a purpose anymore, but I'm
+\# leaving it in, commented out, in case I discover why it was there in
+\# the first place. The rr #DIVERTED line seems to solve whatever
+\# problem DIVERTED=2 was designed to correct.
+\#
+\#.if \\n[#DIVERTED]=1 \{ .nr #DIVERTED 2 \}
+\#
+. rr #DIVERTED
+. rr #RULED
+. \}
. \}
. \}
-. nr #VARIABLE_FOOTER_POS -\\n[#DIVER_DEPTH]
-. if \\n[#FN_COUNT]=1 \{ .nr #VARIABLE_FOOTER_POS -1v \}
-. if r#NO_EXTRA_SPACE \{\
-. nr #VARIABLE_FOOTER_POS +1v
-. rr #NO_EXTRA_SPACE
+. \}
+. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+\# See VFP_CHECK for an explanation of the next lines.
+\# The trap has to be removed, prior to setting it, each time
+\# FOOTNOTE is run.
+. if \\n[#PRINT_STYLE]=2 \{\
+. ch VFP_CHECK
+. wh \\n[#VARIABLE_FOOTER_POS]u-\\n[#DOC_LEAD]u VFP_CHECK
+. \}
+\# If we have a footnote whose text has to be deferred to the next
+\# page, reset the FOOTER trap to its original location.
+. if \\n[#FN_DEFER] \{\
+. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
+. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+. \}
+. \}
+. nr #NO_FN_MARKER 0
+. \}
+.END
+\#
+\# Utility macros to manage footnotes that occur inside diversions
+\# ---------------------------------------------------------------
+\#
+\# There are some redundancies here; they're left in in case
+\# unforeseen footnote situations crop up in the future that might
+\# require manipulation of them.
+\#
+\# 1. Pre-footnote processing for footnotes in diversions
+\#
+\# a) A footnote inside a diversion will be moved entirely (marker
+\# in running text and text of footnote) to the next page/column.
+\#
+.MAC DIVER_FN_1_PRE END
+. nr #RESET_FN_COUNTERS 1
+. nr #COUNTERS_RESET 1
+. if \\n[#DONE_ONCE]=1 \{\
+. if \\n[#FN_DEFER] \{\
+. if \\n[#SAVED_DIVER_FN_COUNT]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_DEFER_SPACE 1 \}
+. \}
+. el \{\
+. nr #FN_DEFER_SPACE 1
. \}
+. \}
. \}
-. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
-. if (\\n(nl+1v)>(\\n[#PAGE_LENGTH]+\\n[#VARIABLE_FOOTER_POS]) \{\
-. ch FOOTER \\n(nlu+1v
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. if \\n[#FN_COUNT]>0 \{ .nr #FN_COUNT 0 1 \}
+. if \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. nr #FN_COUNT_FOR_COLS 0 1
+. \}
+. \}
. \}
-. if \\n[#FN_DEFER] \{\
-. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
-. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+. if \\n[#FN_MARKER_STYLE]=2 \{\
+. if \\n[#RESET_FN_NUMBER]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
+. \}
+. el \{\
+. nr #FN_NUMBER 0 1
+. \}
+. \}
. \}
. \}
-. nr #NO_FN_MARKER 0
+.END
+\#
+\# b) Treat as a normal footnote, including defers.
+\#
+.MAC DIVER_FN_2_PRE END
+. nr #RESET_FN_COUNTERS 2
+.END
+\#
+\# 2. Post-footnote processing for footnotes in diversions
+\#
+\# Even when a footnote inside a diversion is treated as
+\# "normal," some manipulation of registers is required.
+\#
+.MAC DIVER_FN_2_POST END
+. if \\n[#DONE_ONCE]=1 \{\
+. if \\n[#FN_MARKER_STYLE]=1 \{\
+. if \\n[#FN_COUNT]=0 \{\
+. nr #DONT_RULE_ME 1
+. \}
+. if \\n[#FN_COUNT]>0 \{\
+. nr #FN_COUNT 0 1
+. \}
+. if \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT_FOR_COLS 0 1 \}
+. if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. \}
+. \}
+. \}
+. if \\n[#FN_MARKER_STYLE]=2 \{\
+. if \\n[#FN_COUNT]=0 \{\
+. nr #DONT_RULE_ME 1
+. \}
+. if \\n[#FN_COUNT]>0 \{\
+. nr #FN_COUNT 0 1
+. \}
+. if \\n[#RESET_FN_NUMBER]=1 \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_NUMBER 0 1 \}
+. \}
+. el \{\
+. nr #FN_NUMBER 0 1
+. \}
+. \}
+. \}
+. \}
+.END
+\#
+\# The main macros that handle footnote processing.
+\# -----------------------------------------------
+\#
+\# Sometimes, #VARIABLE_FOOTER_POS sets FOOTER at a location so
+\# close to the next legal baseline that, visually, one has the
+\# impression another line of running text would fit on the page.
+\# VFP_CHECK is always set to the line just above the one where
+\# FOOTER will be sprung, and checks for this condition. If it
+\# exists, FOOTER is set one line lower on the page, thus squeezing
+\# in an extra line of running text. This is a judgment call on
+\# my part, but seems to work well. If there are problems (e.g.
+\# footnotes really do look jammed), the user should probably adjust
+\# FOOTNOTE_AUTOLEAD and/or FOOTNOTE_RULE_ADJ.
+\#
+.MAC VFP_CHECK END
+\# The trap also has to be removed each time VFP_CHECK is run
+. if \\n[#PRINT_STYLE]=2 \{\
+. ch VFP_CHECK
+. SIZESPECS
+. ie !\\n[#IN_DIVER] \{ .nr #PAGE_POS \\n(nl \}
+. el \{ .nr #PAGE_POS \\n(nl+\\n(.d+(\\n[#DOC_LEAD]) \}
+. nr #FOOTER_POS \\n[#PAGE_LENGTH]+(\\n[#VARIABLE_FOOTER_POS])
+. nr #SPACE_TO_FOOTER \\n[#FOOTER_POS]-\\n[#PAGE_POS]
+. nr #FN_GAP \\n[#SPACE_TO_FOOTER]%\\n[#DOC_LEAD]
+. if !\\n[#FN_GAP]<0 \{\
+. if \\n[#FN_GAP]<\\n[#DOC_LEAD] \{\
+. ie (\\n[#PAGE_POS]+(\\n[#FN_DEPTH]+\\n[#FN_GAP]))>(\\n[#VISUAL_B_MARGIN]) \{\
+. nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
+. \}
+. el \{\
+. ie \\n[#DOC_LEAD]-\\n[#FN_GAP]<\\n[#DESCENDER] \{\
+. nr #VARIABLE_FOOTER_POS +\\n[#DOC_LEAD]
+. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+. \}
+. el \{\
+. nr #VARIABLE_FOOTER_POS 0+\\n[#VARIABLE_FOOTER_POS]
+. \}
+. \}
+. \}
+. \}
. \}
.END
\#
\# FN_OVERFLOW_TRAP starts off "underneath" FOOTER, but is revealed as
-\# #VARIABLE_FOOTER_POSITION changes the position of FOOTER owing to the
-\# presence footnotes. FN_OVERFLOW_TRAP simply starts diversion FN_OVERFLOW
-\# to "catch" the overflow. The diversion is ended in FOOTER, after
-\# outputting FOOTNOTES (the diversion that holds footnotes).
+\# #VARIABLE_FOOTER_POSITION changes the position of FOOTER.
+\# FN_OVERFLOW_TRAP simply starts diversion FN_OVERFLOW
+\# to "catch" the overflow. The diversion is ended in FOOTER,
+\# immediately after FOOTER outputs the diversion, FOOTNOTES,
+\# before PROCESS_FN_LEFTOVER is run (either in HEADER, or in
+\# FOOTER if moving col to col).
\#
.MAC FN_OVERFLOW_TRAP END
. if \\n[#FN_COUNT] \{\
. di FN_OVERFLOW
-. \}
+. ie !\\n[#NO_BACK_UP]=1 \{\
+. if \\n[#PREV_FN_DEFERRED] \{\
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#FROM_FOOTER] \{\
+. if \\n[#PREV_FN_DEFERRED] \{\
+. if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+\# The following line used to serve some purpose, but as things
+\# stand now, it screws things up. I'm leaving it in, commented out,
+\# in case I \# discover why I thought it was needed.
+\#
+\#\!.RLD \\n[#FN_LEAD]u
+\#
+. rr #PREV_FN_DEFERRED
+. \}
+. \}
+. \}
+. if !\\n[#FROM_FOOTER] \{\
+. if !\\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. if !\\n[#LAST_FN_COUNT_FOR_COLS]>1 \{\
+\!.RLD \\n[#FN_LEAD]u
+. \}
+. \}
+. \}
+. \}
+. el \{\
+\!.RLD \\n[#FN_LEAD]u
+. \}
+. \}
+. \}
+. el \{\
+. rr #NO_BACK_UP
+. rr #PREV_FN_DEFERRED
+. \}
+. \}
+\# When #FROM_DIVERT_FN is 1, it signals to FOOTNOTE, when run from
+\# within DIVERT_FN_LEFTOVER, to set #SPACE_REMAINING to the total
+\# area allowable for running text.
+. nr #FROM_DIVERT_FN 1
.END
\#
-\# DIVERT_FN_OVERFLOW is started in PROCESS_FN_LEFTOVER, which is called
-\# at the top of HEADER, and in FOOTER if we're moving from one column
-\# to the next.
+\# PROCESS_FN_LEFTOVER is called at the top of HEADER, and in
+\# FOOTER if we're moving from one column to the next (i.e. after
+\# outputting FOOTNOTES). It checks for whether we have a "deferred
+\# footnote" situation, and resets counters and number registers
+\# accordingly. Lastly, if we have some footnote overflow, it calls
+\# DIVERT_FN_OVERFLOW.
\#
-.MAC DIVERT_FN_LEFTOVER END
-. nr #NO_FN_MARKER 1
-. nr #OVERFLOW 1
-. FOOTNOTE
-. nf
-. FN_OVERFLOW
-. FOOTNOTE OFF
-. rr #FN_OVERFLOW_DEPTH
-.END
+.MAC PROCESS_FN_LEFTOVER END
+. if \\n[#PREV_FN_DEFERRED]=2 \{\
+\# #FN_COUNT_FOR_COLS_AT_FOOTER used to have a purpose. I'm
+\# leaving it in, commented out, as a safeguard against
+\# (re)discovering why it was needed.
\#
-\# PROCESS_FN_LEFTOVER is called at the top of HEADER, and in FOOTER if
-\# we're moving from one column to the next. It checks for whether we
-\# have a "deferred footnote" situation, and resets counters and number
-\# registers accordingly. Lastly, if we have some footnote overflow, it
-\# calls DIVERT_FN_OVERFLOW.
+\#.if \\n[#FN_COUNT_FOR_COLS_AT_FOOTER]=0 \{ .rr #PREV_FN_DEFERRED \}
\#
-.MAC PROCESS_FN_LEFTOVER END
+. if \\n[#FN_COUNT_AT_FOOTER]>1 \{ .rr #PREV_FN_DEFERRED \}
+. \}
. if !\\n[#FN_DEFER] \{\
. nr #FN_COUNT 0 1
. nr #FN_DEPTH 0
. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
. \}
-. if \\n[#FN_DEFER] \{\
-. nr #VARIABLE_FOOTER_POS -(\\n[#FN_DEPTH]+\\n[#DOC_LEAD])
+. if r#FN_DEFER \{\
+. if \\n[#FN_DEFER]=1 \{\
+. nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
+. \}
+. if \\n[#FN_DEFER]=2 \{\
+. nr #FN_DEPTH 0
+. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
+. \}
. \}
. nr #SPACE_REMAINING 0
. ch FOOTER -\\n[#B_MARGIN]u
. if \\n[#FN_DEFER] \{\
. nr #NO_FN_MARKER 1
-. da FOOTNOTES
-. di
. FOOTNOTE
. nf
. FOOTNOTE OFF
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{\
+. if !\\n[#FROM_FOOTER] \{\
+. if \\n[#FN_COUNT_FOR_COLS]=1 \{ .nr #PREV_FN_DEFERRED 1 \}
+. \}
+. \}
+. \}
+. el \{ .nr #PREV_FN_DEFERRED 1 \}
. \}
. if !\\n[#FN_DEFER] \{\
. if \\n[#FN_OVERFLOW_DEPTH] \{\
-. DIVERT_FN_LEFTOVER
+. DIVERT_FN_LEFTOVER
. \}
. \}
-. nr #FN_COUNT 0 1
+. ie \\n[#COLUMNS]=1 \{\
+. if \\n[#COL_NUM]>1 \{\
+. if \\n[#COL_NUM]=\\n[#NUM_COLS] \{ .nr #FN_COUNT 0 1 \}
+. \}
+. \}
+. el \{ .nr #FN_COUNT 0 1 \}
+. if \\n[#DIVER_FN]=2 \{ .rr #DIVER_FN \}
.END
\#
-\# This is a special macro to deal with footnotes that are set inside
-\# diversions (QUOTE, BLOCKQUOTE and EPIGRAPH). It's called in HEADER and
-\# in FOOTER if we're moving from column to column, and comes after
-\# PROCESS_FOOTNOTE_LEFTOVER in those two macros.
+\# DIVERT_FN_LEFTOVER is called in PROCESS_FN_LEFTOVER (at
+\# the top of HEADER, and in FOOTER if we're moving from one column
+\# to the next).
+\#
+.MAC DIVERT_FN_LEFTOVER END
+. nr #NO_FN_MARKER 1
+. nr #DIVERTED 1
+. FOOTNOTE
+. nf
+. FN_OVERFLOW
+. FOOTNOTE OFF
+. if \\n[#PREV_FN_DEFERRED] \{\
+. nr #FN_DEPTH -\\n[#FN_LEAD]
+. nr #VARIABLE_FOOTER_POS +\\n[#FN_LEAD]
+. ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+. if \\n[#PREV_FN_DEFERRED]=2 \{\
+. nr #PREV_FN_DEFERRED 1
+. rr #DIVERTED
+. \}
+. \}
+. rr #FN_OVERFLOW_DEPTH
+.END
+\#
+\# This is a special macro to deal with footnotes that are set
+\# inside diversions (QUOTE, BLOCKQUOTE and EPIGRAPH). It's called
+\# in HEADER (and in FOOTER, if we're moving from column to column),
+\# and comes after PROCESS_FOOTNOTE_LEFTOVER in those two macros.
\#
.MAC PROCESS_FN_IN_DIVER END
. nr #SPACE_REMAINING 0
. ch FOOTER -\\n[#B_MARGIN]u
. nr #NO_FN_MARKER 1
-. rr #RESET_FN_COUNTERS
+. if !\\n[#RESET_FN_COUNTERS]=2 \{\
+. rr #RESET_FN_COUNTERS
+. \}
. FOOTNOTE
. nf
. FN_IN_DIVER
. FOOTNOTE OFF
-. if \\n[#ADD_DEFER_SPACE] \{ .nr #FN_DEFER_SPACE 1 \}
-. rr #ADD_DEFER_SPACE
+. rr #DIVER_FN
.END
\#
\# ====================================================================
@@ -11500,7 +12131,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. rr #STORED_R_INDENT
. rr #STORED_L_INDENT
. \}
-.\" Clean up after exiting last depth of list
+\# Clean up after exiting last depth of list
. nr #REMOVE 0 1
. while \\n+[#REMOVE]<=\\n[#TOTAL_LISTS] \{\
. rr #LIST_INDENT\\n[#REMOVE]
@@ -11610,6 +12241,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
\# End title collection for TOC
. LL \\n[#DOC_L_LENGTH]u
. QUAD $DOC_QUAD
+. nr #SAVED_DOC_LEAD \\n[#DOC_LEAD]
. LS \\n[#DOC_LEAD]u
\*[SLANTX]
\*[CONDX]
@@ -11693,6 +12325,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. ch DO_B_MARGIN
. ch HEADER
. ch FOOTER
+. ch FN_OVERFLOW_TRAP
\# Plant header trap
. wh 0 HEADER
. \}
@@ -11700,15 +12333,29 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. ie \\n[#ADJ_DOC_LEAD]=1 \{\
. nr #LINES_PER_PAGE 0 1
. nr #DOC_LEAD_ADJ 0 1
-. nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#B_MARGIN]-1v
+. nr #DEPTH_TO_B_MARGIN \\n[#PAGE_LENGTH]-\\n[#ORIGINAL_B_MARGIN]-1v
+\# Get the number of unadjusted lines that fit on the page; always a
+\# bit short of the bottom margin
. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
.
. \}
. nr #LINES_PER_PAGE -1
+\# Add machine units, 1 at a time, increasing the leading until the
+\# new leading fills the page properly
. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]+\\n+[#DOC_LEAD_ADJ]*\\n[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
.
. \}
. DOC_LEAD \\n[#DOC_LEAD]u+\\n[#DOC_LEAD_ADJ]u
+\# The "visual" bottom margin is what \n(nl would report on the
+\# last line before the FOOTER trap is sprung
+. nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD])
+\# Get the difference between #B_MARGIN and #VISUAL_B_MARGIN
+. nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
+\# Set #B_MARGIN to 1 machine unit lower on the page than #VISUAL_B_MARGIN
+. nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
+\# Set the FN_OVERFLOW_TRAP position
+. nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
+. if \\n[#PRINT_STYLE]=1 .nr #FN_OVERFLOW_TRAP_POS \\n[#ORIGINAL_B_MARGIN]u
. \}
\# ...or calculate new B_MARGIN based on # of lines (at #DOC_LEAD) that fit
\# on the page.
@@ -11718,7 +12365,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. while \\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n+[#LINES_PER_PAGE])<\\n[#DEPTH_TO_B_MARGIN] \{\
.
. \}
-. nr #B_MARGIN \\n[#PAGE_LENGTH]-(\\n[#T_MARGIN]+(\\n[#DOC_LEAD]*\\n[#LINES_PER_PAGE]))
+. nr #VISUAL_B_MARGIN \\n[#T_MARGIN]+(\\n[#LINES_PER_PAGE]*\\n[#DOC_LEAD]-1v)
+. nr #FOOTER_DIFF (\\n[#PAGE_LENGTH]-\\n[#B_MARGIN])-\\n[#VISUAL_B_MARGIN]
+. nr #B_MARGIN \\n[#B_MARGIN]+(\\n[#FOOTER_DIFF]-1)
+. nr #FN_OVERFLOW_TRAP_POS \\n[#B_MARGIN]u-\\n[#FN_LEAD]
. \}
\# Set footer and footnote overflow traps
. if !\\n[#NO_TRAP_RESET] \{\
@@ -11726,8 +12376,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
. nr #SPACE_REMAINING 0
. nr #FN_DEPTH 0
. nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]u
-. wh 12i FOOTER
-. wh -\\n[#B_MARGIN]u FN_OVERFLOW_TRAP
+. wh 20i FOOTER
+. wh -(\\n[#FN_OVERFLOW_TRAP_POS]u) FN_OVERFLOW_TRAP
. ch FOOTER -\\n[#B_MARGIN]u
. \}
.END
@@ -11809,14 +12459,24 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
\# output.
\#
.MAC TERMINATE END
-. if \\n[#FN_DEFER] \{\
+. ie \\n[#FN_DEPTH] \{\
+. ie \\n[#FN_DEFER] \{\
+. br
+. nr #TERMINATE 1
+. FOOTNOTE
+. nf
+. FOOTNOTE OFF
+. \}
+. el \{\
+. br
+. ch FN_OVERFLOW_TRAP
+. DO_B_MARGIN
+. \}
+. \}
+. el \{\
. br
-. nr #TERMINATE 1
-. da FOOTNOTES
-. di
-. FOOTNOTE
-. nf
-. FOOTNOTE OFF
+. ch FN_OVERFLOW_TRAP
+. DO_B_MARGIN
. \}
.END
\#