From MAILER-DAEMON Thu Feb 16 14:38:39 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ceRt0-0000lh-TU
	for mharc-groff-commit@gnu.org; Thu, 16 Feb 2017 14:38:38 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59270)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceRsy-0000ju-F1
	for groff-commit@gnu.org; Thu, 16 Feb 2017 14:38:37 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceRsw-00019a-Ub
	for groff-commit@gnu.org; Thu, 16 Feb 2017 14:38:36 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:50465)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceRsw-00019O-RK
	for groff-commit@gnu.org; Thu, 16 Feb 2017 14:38:34 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 132159)
	id 8945F20926; Thu, 16 Feb 2017 14:38:34 -0500 (EST)
To: groff-commit@gnu.org
Subject: =?utf-8?q?_=5Bgroff=5D_01/01=3A_-me=3A_Use_=5Cs=C2=B1n_after_a_v?=
	=?utf-8?q?ar=2E_string_instead_of_=5Cs0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
In-Reply-To: groff@gnu.org
References: <20170216193833.3041.35140@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: 98058a8a4b3a63d3cf96662ac48a9b543d657479
Auto-Submitted: auto-generated
Message-Id: <20170216193834.8945F20926@vcs0.savannah.gnu.org>
Date: Thu, 16 Feb 2017 14:38:34 -0500 (EST)
From: carsten.kunze@arcor.de (Carsten Kunze)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2017 19:38:37 -0000

carstenkunze pushed a commit to branch master
in repository groff.

commit 98058a8a4b3a63d3cf96662ac48a9b543d657479
Author: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date:   Thu Feb 16 20:36:22 2017 +0100

    -me: Use \s=C2=B1n after a var. string instead of \s0
   =20
    See https://savannah.gnu.org/bugs/?49915
---
 ChangeLog     | 10 ++++++++++
 tmac/e.tmac-u |  4 ++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index afab9e8..97ae122 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2017-02-16  Bjarni Ingi Gislason  <bjarniig@rhi.hi.is>
+
+	Use explicit \s=C2=B1n after a variable string instead of \s0
+
+	* tmac/e.tmac-u: Change \s0 to \s+3
+
+	See
+
+	https://savannah.gnu.org/bugs/?49915
+
 2016-12-29  Deri James  <deri@chuzzlewit.myzen.co.uk>
=20
 	Remove duplicate '-e' from gropdf manual.
diff --git a/tmac/e.tmac-u b/tmac/e.tmac-u
index 659fd87..07db128 100644
--- a/tmac/e.tmac-u
+++ b/tmac/e.tmac-u
@@ -1940,13 +1940,13 @@
 .\" GNU pic sets this register to 1, to indicate that \x should not be u=
sed.
 .@R 0x
 .ds { \v'-0.4m'\x'\\n(0x=3D0*-0.2m'\s-3
-.ds } \s0\v'0.4m'
+.ds } \s+3\v'0.4m'
 .\" for compatibility with traditional -me
 .\" (the first will work only in compatibility mode)
 .ds [ \*{
 .ds ] \*}
 .ds < \v'0.4m'\x'\\n(0x=3D0*0.2m'\s-3
-.ds > \s0\v'-0.4m'
+.ds > \s+3\v'-0.4m'
 .ds - \(em
 .\" Avoid warnings from groff -ww.
 .@S |0


From MAILER-DAEMON Thu Feb 16 14:44:27 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ceRyc-0003jO-UN
	for mharc-groff-commit@gnu.org; Thu, 16 Feb 2017 14:44:26 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33433)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceRya-0003j9-J7
	for groff-commit@gnu.org; Thu, 16 Feb 2017 14:44:26 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceRyY-0004Nc-O6
	for groff-commit@gnu.org; Thu, 16 Feb 2017 14:44:24 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:50507)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceRyY-0004NV-LI
	for groff-commit@gnu.org; Thu, 16 Feb 2017 14:44:22 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 132159)
	id 73BC920E7E; Thu, 16 Feb 2017 14:44:22 -0500 (EST)
To: groff-commit@gnu.org
Subject: =?utf-8?q?_=5Bgroff=5D_01/01=3A_-me=3A_Use_=5Cs=C2=B1n_after_a_v?=
	=?utf-8?q?ar=2E_string_instead_of_=5Cs0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
In-Reply-To: groff@gnu.org
References: <20170216194421.5399.40252@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: a2c9f9c28e9439bd2c1fb156840692b53a9a0d22
Auto-Submitted: auto-generated
Message-Id: <20170216194422.73BC920E7E@vcs0.savannah.gnu.org>
Date: Thu, 16 Feb 2017 14:44:22 -0500 (EST)
From: carsten.kunze@arcor.de (Carsten Kunze)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2017 19:44:26 -0000

carstenkunze pushed a commit to branch master
in repository groff.

commit a2c9f9c28e9439bd2c1fb156840692b53a9a0d22
Author: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date:   Thu Feb 16 20:42:44 2017 +0100

    -me: Use \s=C2=B1n after a var. string instead of \s0
   =20
    One line missed to be fixed in previous commit.
---
 tmac/e.tmac-u | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tmac/e.tmac-u b/tmac/e.tmac-u
index 07db128..8f9d775 100644
--- a/tmac/e.tmac-u
+++ b/tmac/e.tmac-u
@@ -1487,7 +1487,7 @@
 ..
 .
 .de sm			\" *** print in smaller font
-\s-1\\$1\\s0\\$2
+\s-1\\$1\\s+1\\$2
 ..
 .
 .de @F			\" --- change font (0 -> no change)


From MAILER-DAEMON Thu Feb 16 14:58:16 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ceSC0-0000oa-2a
	for mharc-groff-commit@gnu.org; Thu, 16 Feb 2017 14:58:16 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37582)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceSBx-0000nN-Vr
	for groff-commit@gnu.org; Thu, 16 Feb 2017 14:58:15 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceSBx-00021n-05
	for groff-commit@gnu.org; Thu, 16 Feb 2017 14:58:14 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:50627)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceSBw-00021j-T7
	for groff-commit@gnu.org; Thu, 16 Feb 2017 14:58:12 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 132159)
	id 8282B20C68; Thu, 16 Feb 2017 14:58:12 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: -me, -ms, -mm: Use backslash after '\{'
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
In-Reply-To: groff@gnu.org
References: <20170216195811.13061.82732@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: 25fee274ab0b1207640f59d9db5fea84b2a908c8
Auto-Submitted: auto-generated
Message-Id: <20170216195812.8282B20C68@vcs0.savannah.gnu.org>
Date: Thu, 16 Feb 2017 14:58:12 -0500 (EST)
From: carsten.kunze@arcor.de (Carsten Kunze)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2017 19:58:15 -0000

carstenkunze pushed a commit to branch master
in repository groff.

commit 25fee274ab0b1207640f59d9db5fea84b2a908c8
Author: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date:   Thu Feb 16 20:57:07 2017 +0100

    -me, -ms, -mm: Use backslash after '\{'
   =20
    See https://savannah.gnu.org/bugs/?49917
---
 ChangeLog         | 12 ++++++++++++
 contrib/mm/m.tmac |  4 ++--
 tmac/e.tmac-u     |  2 +-
 tmac/s.tmac       |  2 +-
 4 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 97ae122..86c05cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2017-02-16  Bjarni Ingi Gislason  <bjarniig@rhi.hi.is>
=20
+	Use the traditional (portable) method of using a backslash
+	after '\{'
+
+	* contrib/mm/m.tmac, tmac/e.tmac-u,
+	  tmac/s.tmac: Add '\' after "\{"
+
+	See
+
+	https://savannah.gnu.org/bugs/?49917
+
+2017-02-16  Bjarni Ingi Gislason  <bjarniig@rhi.hi.is>
+
 	Use explicit \s=C2=B1n after a variable string instead of \s0
=20
 	* tmac/e.tmac-u: Change \s0 to \s+3
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 0c54860..edbc78c 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -748,7 +748,7 @@ in=3D\\n[.i] fi=3D\\n[.u] .d=3D\\n[.d] nl=3D\\n[nl] p=
g=3D\\n[%]
 .vpt 0
 .DEVTAG-\\$1 \\$2
 .br
-.if r misc*ti \{
+.if r misc*ti \{\
 .	ti \\n[misc*ti]u
 .	rr misc*ti
 .	sp -1
@@ -2869,7 +2869,7 @@ in=3D\\n[.i] fi=3D\\n[.u] .d=3D\\n[.d] nl=3D\\n[nl]=
 pg=3D\\n[%]
 .\"-----------
 .\" called by end-of-text!
 .de ref@eot-print
-.\".if \\n[ref*flag] \{
+.\".if \\n[ref*flag] \{\
 .if d ref*mac \{\
 .	if \\n[D]>2 .tm Print references, called by eot
 .	nr ref*flag 0
diff --git a/tmac/e.tmac-u b/tmac/e.tmac-u
index 8f9d775..b1004f1 100644
--- a/tmac/e.tmac-u
+++ b/tmac/e.tmac-u
@@ -1819,7 +1819,7 @@
 .	tm Line \\n(c. -- Bad mode to .++
 .nr ?R 0
 .if \\n(_0>10 \
-.\{
+\{\
 .	nr ?R 1
 .	nr _0 -10
 .\}
diff --git a/tmac/s.tmac b/tmac/s.tmac
index fe25f6b..c78c8ef 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -1749,7 +1749,7 @@ along with this program. If not, see <http://www.gn=
u.org/licenses/>.
 .		sp \\n[DD]u
 .		ta \\*[eqn*tabs]
 .	\}
-.	el \{
+.	el \{\
 .\" must terminate empty equations in html and ps4html as they contain
 .\" the EQN-HTML-IMAGE-END suppression nodes
 .		if \\n[dl] .chop eqn*div


From MAILER-DAEMON Thu Feb 16 17:01:06 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ceU6s-0000k9-07
	for mharc-groff-commit@gnu.org; Thu, 16 Feb 2017 17:01:06 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41578)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceU6n-0000gQ-Gy
	for groff-commit@gnu.org; Thu, 16 Feb 2017 17:01:04 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceU6m-0001go-FL
	for groff-commit@gnu.org; Thu, 16 Feb 2017 17:01:01 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:51968)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceU6m-0001ge-Bh
	for groff-commit@gnu.org; Thu, 16 Feb 2017 17:01:00 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 132159)
	id E19BD25554; Thu, 16 Feb 2017 17:00:59 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: mdoc \*[Lq], \*[Rq]: map to \[lq], \[rq]
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Ingo Schwarze <schwarze@usta.de>
In-Reply-To: groff@gnu.org
References: <20170216220059.30231.91775@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: e553d384d06318fcbd5944a7167659681fd06e0f
Auto-Submitted: auto-generated
Message-Id: <20170216220059.E19BD25554@vcs0.savannah.gnu.org>
Date: Thu, 16 Feb 2017 17:00:59 -0500 (EST)
From: carsten.kunze@arcor.de (Carsten Kunze)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2017 22:01:04 -0000

carstenkunze pushed a commit to branch master
in repository groff.

commit e553d384d06318fcbd5944a7167659681fd06e0f
Author: Ingo Schwarze <schwarze@usta.de>
Date:   Thu Feb 16 22:58:53 2017 +0100

    mdoc \*[Lq], \*[Rq]: map to \[lq], \[rq]
   =20
    Map these strings equally for all terminal devices.
   =20
    See https://savannah.gnu.org/bugs/?43554
---
 ChangeLog        | 21 +++++++++++++++++++++
 tmac/doc-nroff-u |  6 ++----
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 86c05cf..eaaf03f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2017-02-16  Ingo Schwarze  <schwarze@usta.de>
+
+	mdoc \*[Lq], \*[Rq]: map to \[lq], \[rq] for all terminal
+	devices
+
+	* tmac/doc-nroff-u: .ds Lq \[lq], .ds Rq \[rq]
+
+	If you use \[lq] and \[rq] directly in your document, the
+	quotes already render nicely for all terminal devices:
+	as U+201C and U+201D for devutf8 and as ASCII 0x22 (") for
+	devascii and devlatin1.
+	So it is not quite clear why doc-nroff should avoid
+	\[lq] and \[rq] when resolving \[Lq] and \[Rq] for devascii
+	and devlatin1. Quite to the contrary, many people seem to
+	consider "``" and "''" ugly renderings because they look
+	unbalanced.
+
+	See
+
+	https://savannah.gnu.org/bugs/?43554
+
 2017-02-16  Bjarni Ingi Gislason  <bjarniig@rhi.hi.is>
=20
 	Use the traditional (portable) method of using a backslash
diff --git a/tmac/doc-nroff-u b/tmac/doc-nroff-u
index 8f5e0ca..3134cba 100644
--- a/tmac/doc-nroff-u
+++ b/tmac/doc-nroff-u
@@ -148,6 +148,8 @@
 .ds aa \[aa]
 .ds ga \[ga]
 .ds q \[dq]
+.ds Lq \[lq]
+.ds Rq \[rq]
 .ds Ne \[!=3D]
 .ds Le \[<=3D]
 .ds Ge \[>=3D]
@@ -162,15 +164,11 @@
 .\" character representations which are different from GNU troff's stand=
ard
 .\" forms.
 .ie '\*[.T]'utf8' \{\
-.  ds Rq \[rq]
-.  ds Lq \[lq]
 .  ds ua \[ua]
 .  ds Pi \[*p]
 .  ds If \[if]
 .\}
 .el \{\
-.  ds Rq ''
-.  ds Lq ``
 .  ds ua ^
 .  ds Pi pi
 .  ds If infinity


From MAILER-DAEMON Thu Feb 16 17:11:10 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ceUGb-0005oV-ST
	for mharc-groff-commit@gnu.org; Thu, 16 Feb 2017 17:11:09 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46179)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceUGa-0005nd-47
	for groff-commit@gnu.org; Thu, 16 Feb 2017 17:11:09 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceUGY-0001VQ-S8
	for groff-commit@gnu.org; Thu, 16 Feb 2017 17:11:08 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:52074)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <carsten.kunze@arcor.de>) id 1ceUGY-0001VI-OG
	for groff-commit@gnu.org; Thu, 16 Feb 2017 17:11:06 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 132159)
	id B0C98232B9; Thu, 16 Feb 2017 17:11:06 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: mdoc %T: use typographic quotes
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Ingo Schwarze <schwarze@usta.de>
In-Reply-To: groff@gnu.org
References: <20170216221106.2168.30572@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: a0fb862e7a12a28c05936c7e1d7a8fbf09a2fdec
Auto-Submitted: auto-generated
Message-Id: <20170216221106.B0C98232B9@vcs0.savannah.gnu.org>
Date: Thu, 16 Feb 2017 17:11:06 -0500 (EST)
From: carsten.kunze@arcor.de (Carsten Kunze)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Feb 2017 22:11:09 -0000

carstenkunze pushed a commit to branch master
in repository groff.

commit a0fb862e7a12a28c05936c7e1d7a8fbf09a2fdec
Author: Ingo Schwarze <schwarze@usta.de>
Date:   Thu Feb 16 23:09:43 2017 +0100

    mdoc %T: use typographic quotes
   =20
    See https://savannah.gnu.org/bugs/?43553
---
 ChangeLog       | 23 +++++++++++++++++++++++
 tmac/doc.tmac-u |  2 +-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index eaaf03f..e0263e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,28 @@
 2017-02-16  Ingo Schwarze  <schwarze@usta.de>
=20
+	mdoc %T: use typographic quotes
+
+	* tmac/doc.tmac-u: Changed \*[q] to \*[Lq] and \*[Rq]
+
+	Citing Anthony J. Bentley:
+
+	The below patch causes -mdoc to generate typographic quotes
+	around a %T (reference title) instead of straight quotes.
+
+	I also submitted similar diffs to mandoc and heirloom troff
+	(which haven't been committed yet).  It would be nice for
+	the major implementations not to differ here, and the change
+	is trivial.=20
+
+	It's worth noting that groff's refer(1) already uses typographic
+	quotes around %T with my -ms documents.
+
+	https://savannah.gnu.org/bugs/?43553
+	http://comments.gmane.org/gmane.comp.tools.mdocml.devel/723=20
+	https://github.com/n-t-roff/heirloom-doctools/pull/6
+
+2017-02-16  Ingo Schwarze  <schwarze@usta.de>
+
 	mdoc \*[Lq], \*[Rq]: map to \[lq], \[rq] for all terminal
 	devices
=20
diff --git a/tmac/doc.tmac-u b/tmac/doc.tmac-u
index 93d5248..8f9f90f 100644
--- a/tmac/doc.tmac-u
+++ b/tmac/doc.tmac-u
@@ -5245,7 +5245,7 @@
 .    unformat doc-reference-title-name-for-book
 .    chop doc-reference-title-name-for-book
 .    ie ((\n[doc-journal-count] =3D=3D 1) : (\n[doc-book-count] =3D=3D 1=
)) \{\
-.      nop \)\*[q]\)\*[doc-reference-title-name-for-book]\)\*[q]\c
+.      nop \)\*[Lq]\)\*[doc-reference-title-name-for-book]\)\*[Rq]\c
 .      doc-finish-reference \n[doc-reference-title-count]
 .    \}
 .    el \{\


From MAILER-DAEMON Fri Feb 17 22:42:15 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cevuZ-0005QE-CL
	for mharc-groff-commit@gnu.org; Fri, 17 Feb 2017 22:42:15 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58801)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1cevuW-0005Ow-IO
	for groff-commit@gnu.org; Fri, 17 Feb 2017 22:42:13 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1cevuV-00062h-Hr
	for groff-commit@gnu.org; Fri, 17 Feb 2017 22:42:12 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:56856)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <cjwatson@debian.org>) id 1cevuV-00062W-Ea
	for groff-commit@gnu.org; Fri, 17 Feb 2017 22:42:11 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 67502)
	id C52ED2517C; Fri, 17 Feb 2017 22:42:10 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: Appease "groff -wmac" when using eqn or pic
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Colin Watson <cjwatson@debian.org>
In-Reply-To: groff@gnu.org
References: <20170218034210.24716.49032@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: 4b3e5417d53d16ac41ccf6a835840ecde1f97a83
Auto-Submitted: auto-generated
Message-Id: <20170218034210.C52ED2517C@vcs0.savannah.gnu.org>
Date: Fri, 17 Feb 2017 22:42:10 -0500 (EST)
From: cjwatson@debian.org (Colin Watson)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 18 Feb 2017 03:42:13 -0000

cjwatson pushed a commit to branch master
in repository groff.

commit 4b3e5417d53d16ac41ccf6a835840ecde1f97a83
Author: Colin Watson <cjwatson@debian.org>
Date:   Sat Feb 18 03:39:36 2017 +0000

    Appease "groff -wmac" when using eqn or pic
   =20
    * src/preproc/eqn/main.cpp: Define EQ and EN if they are not already
    defined, to appease "groff -wmac".
    * src/preproc/pic/main.cpp: Likewise for PS and PE.
   =20
    Fixes: http://bugs.debian.org/495713
---
 ChangeLog                | 8 ++++++++
 src/preproc/eqn/main.cpp | 2 ++
 src/preproc/pic/main.cpp | 4 ++++
 3 files changed, 14 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e0263e6..861f8d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-02-18  Colin Watson  <cjwatson@debian.org>
+
+	* src/preproc/eqn/main.cpp: Define EQ and EN if they are not already
+	defined, to appease "groff -wmac".
+	* src/preproc/pic/main.cpp: Likewise for PS and PE.
+
+	Fixes: http://bugs.debian.org/495713
+
 2017-02-16  Ingo Schwarze  <schwarze@usta.de>
=20
 	mdoc %T: use typographic quotes
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index 44a8a9d..95e418b 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -377,6 +377,8 @@ int main(int argc, char **argv)
     }
   init_table(device);
   init_char_table();
+  printf(".if !dEQ .ds EQ\n"
+	 ".if !dEN .ds EN\n");
   if (output_format =3D=3D troff) {
     printf(".if !'\\*(.T'%s' "
 	   ".if !'\\*(.T'html' "	// the html device uses `-Tps' to render
diff --git a/src/preproc/pic/main.cpp b/src/preproc/pic/main.cpp
index 0a8efa1..3bf7d5f 100644
--- a/src/preproc/pic/main.cpp
+++ b/src/preproc/pic/main.cpp
@@ -619,7 +619,11 @@ int main(int argc, char **argv)
     out =3D make_fig_output();
   else
 #endif
+  {
     out =3D make_troff_output();
+    printf(".if !dPS .ds PS\n"
+	   ".if !dPE .ds PE\n");
+  }
 #ifdef FIG_SUPPORT
   if (whole_file_flag) {
     if (optind >=3D argc)


From MAILER-DAEMON Thu Feb 23 17:08:16 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ch1Yd-0005gk-TR
	for mharc-groff-commit@gnu.org; Thu, 23 Feb 2017 17:08:16 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39602)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bertrand.garrigues@laposte.net>) id 1ch1Yb-0005ec-0T
	for groff-commit@gnu.org; Thu, 23 Feb 2017 17:08:14 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bertrand.garrigues@laposte.net>) id 1ch1YZ-0003cS-30
	for groff-commit@gnu.org; Thu, 23 Feb 2017 17:08:12 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:33844)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bertrand.garrigues@laposte.net>) id 1ch1YY-0003cM-V7
	for groff-commit@gnu.org; Thu, 23 Feb 2017 17:08:11 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 132203)
	id C76E9250CC; Thu, 23 Feb 2017 17:08:10 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: * bootstrap: update with latest version from gnulib.
	* gnulib: update the git submodule with latest version (commit
	4084b3a1094372b960ce4a97634e08f4538c8bdd from gnulib).
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Bertrand Garrigues <bertrand.garrigues@laposte.net>
In-Reply-To: groff@gnu.org
References: <20170223220809.31305.37062@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: 70c3b9e27d76277e723f93334d2c912c2905d4eb
Auto-Submitted: auto-generated
Message-Id: <20170223220810.C76E9250CC@vcs0.savannah.gnu.org>
Date: Thu, 23 Feb 2017 17:08:10 -0500 (EST)
From: bertrand.garrigues@laposte.net (Bertrand Garrigues)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Feb 2017 22:08:15 -0000

bgarrigues pushed a commit to branch master
in repository groff.

commit 70c3b9e27d76277e723f93334d2c912c2905d4eb
Author: Bertrand Garrigues <bertrand.garrigues@laposte.net>
Date:   Thu Feb 23 22:52:31 2017 +0100

    * bootstrap: update with latest version from gnulib.
    * gnulib: update the git submodule with latest version (commit
    4084b3a1094372b960ce4a97634e08f4538c8bdd from gnulib).
---
 ChangeLog |  6 +++++
 bootstrap | 83 ++++++++++++++++++++++++++++++++++++++++++---------------=
------
 gnulib    |  2 +-
 3 files changed, 63 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 861f8d8..c22453a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-02-23  Bertrand Garrigues  <bertrand.garrigues@laposte.net>
+
+	* bootstrap: update with latest version from gnulib.
+	* gnulib: update the git submodule with latest version (commit
+	4084b3a1094372b960ce4a97634e08f4538c8bdd from gnulib).
+
 2017-02-18  Colin Watson  <cjwatson@debian.org>
=20
 	* src/preproc/eqn/main.cpp: Define EQ and EN if they are not already
diff --git a/bootstrap b/bootstrap
index ce90bc4..932ff85 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=3D2013-12-05.23; # UTC
+scriptversion=3D2017-01-09.19; # UTC
=20
 # Bootstrap this package from checked-out sources.
=20
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
=20
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -42,6 +42,9 @@ export LC_ALL
=20
 local_gl_dir=3Dgl
=20
+# Honor $PERL, but work even if there is none.
+PERL=3D"${PERL-perl}"
+
 me=3D$0
=20
 usage() {
@@ -210,7 +213,17 @@ bootstrap_sync=3Dfalse
 use_git=3Dtrue
=20
 check_exists() {
-  ($1 --version </dev/null) >/dev/null 2>&1
+  if test "$1" =3D "--verbose"; then
+    ($2 --version </dev/null) >/dev/null 2>&1
+    if test $? -ge 126; then
+      # If not found, run with diagnostics as one may be
+      # presented with env variables to set to find the right version
+      ($2 --version </dev/null)
+    fi
+  else
+    ($1 --version </dev/null) >/dev/null 2>&1
+  fi
+
   test $? -lt 126
 }
=20
@@ -405,28 +418,30 @@ sort_ver() { # sort -V is not generally available
   done
 }
=20
-get_version() {
-  app=3D$1
+get_version_sed=3D'
+# Move version to start of line.
+s/.*[v ]\([0-9]\)/\1/
+
+# Skip lines that do not start with version.
+/^[0-9]/!d
=20
-  $app --version >/dev/null 2>&1 || return 1
+# Remove characters after the version.
+s/[^.a-z0-9-].*//
=20
-  $app --version 2>&1 |
-  sed -n '# Move version to start of line.
-          s/.*[v ]\([0-9]\)/\1/
+# The first component must be digits only.
+s/^\([0-9]*\)[a-z-].*/\1/
=20
-          # Skip lines that do not start with version.
-          /^[0-9]/!d
+#the following essentially does s/5.005/5.5/
+s/\.0*\([1-9]\)/.\1/g
+p
+q'
=20
-          # Remove characters after the version.
-          s/[^.a-z0-9-].*//
+get_version() {
+  app=3D$1
=20
-          # The first component must be digits only.
-          s/^\([0-9]*\)[a-z-].*/\1/
+  $app --version >/dev/null 2>&1 || { $app --version; return 1; }
=20
-          #the following essentially does s/5.005/5.5/
-          s/\.0*\([1-9]\)/.\1/g
-          p
-          q'
+  $app --version 2>&1 | sed -n "$get_version_sed"
 }
=20
 check_versions() {
@@ -446,6 +461,7 @@ check_versions() {
     test "$appvar" =3D TAR && appvar=3DAMTAR
     case $appvar in
         GZIP) ;; # Do not use $GZIP:  it contains gzip options.
+        PERL::*) ;; # Keep perl modules as-is
         *) eval "app=3D\${$appvar-$app}" ;;
     esac
=20
@@ -463,11 +479,22 @@ check_versions() {
           ret=3D1
           continue
         } ;;
+      # Another check is for perl modules.  These can be written as
+      # e.g. perl::XML::XPath in case of XML::XPath module, etc.
+      perl::*)
+        # Extract module name
+        app=3D"${app#perl::}"
+        if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
+          warn_ "Error: perl module '$app' not found"
+          ret=3D1
+        fi
+        continue
+        ;;
     esac
     if [ "$req_ver" =3D "-" ]; then
       # Merely require app to exist; not all prereq apps are well-behave=
d
       # so we have to rely on $? rather than get_version.
-      if ! check_exists $app; then
+      if ! check_exists --verbose $app; then
         warn_ "Error: '$app' not found"
         ret=3D1
       fi
@@ -598,8 +625,8 @@ case ${GNULIB_SRCDIR--} in
   # Note that $use_git is necessarily true in this case.
   if git_modules_config submodule.gnulib.url >/dev/null; then
     echo "$0: getting gnulib files..."
-    git submodule init || exit $?
-    git submodule update || exit $?
+    git submodule init -- "$gnulib_path" || exit $?
+    git submodule update -- "$gnulib_path" || exit $?
=20
   elif [ ! -d "$gnulib_path" ]; then
     echo "$0: getting gnulib files..."
@@ -628,13 +655,14 @@ case ${GNULIB_SRCDIR--} in
       # This fallback allows at least git 1.5.5.
       if test -f "$gnulib_path"/gnulib-tool; then
         # Since file already exists, assume submodule init already compl=
ete.
-        git submodule update || exit $?
+        git submodule update -- "$gnulib_path" || exit $?
       else
         # Older git can't clone into an empty directory.
         rmdir "$gnulib_path" 2>/dev/null
         git clone --reference "$GNULIB_SRCDIR" \
           "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
-          && git submodule init && git submodule update \
+          && git submodule init -- "$gnulib_path" \
+          && git submodule update -- "$gnulib_path" \
           || exit $?
       fi
     fi
@@ -762,7 +790,7 @@ symlink_to_dir()
       # Leave any existing symlink alone, if it already points to the so=
urce,
       # so that broken build tools that care about symlink times
       # aren't confused into doing unnecessary builds.  Conversely, if t=
he
-      # existing symlink's time stamp is older than the source, make it =
afresh,
+      # existing symlink's timestamp is older than the source, make it a=
fresh,
       # so that broken tools aren't confused into skipping needed builds=
.  See
       # <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.h=
tml>.
       test -h "$dst" &&
@@ -889,7 +917,8 @@ if test $use_libtool =3D 1; then
   esac
 fi
 echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
-$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
+$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
+  || die "gnulib-tool failed"
=20
 for file in $gnulib_files; do
   symlink_to_dir "$GNULIB_SRCDIR" $file \
@@ -994,6 +1023,6 @@ echo "$0: done.  Now you can run './configure'."
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion=3D"
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff --git a/gnulib b/gnulib
index 5cb1039..4084b3a 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 5cb103952a80692015109260f296779c4ae049a4
+Subproject commit 4084b3a1094372b960ce4a97634e08f4538c8bdd


From MAILER-DAEMON Sun Feb 26 22:10:38 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ciBhu-00015A-0X
	for mharc-groff-commit@gnu.org; Sun, 26 Feb 2017 22:10:38 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41154)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBhs-00014z-2x
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:10:37 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBhq-0001bY-Qs
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:10:36 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:37038)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBhq-0001bR-NF
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:10:34 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 71277)
	id 600322600F; Sun, 26 Feb 2017 22:10:34 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: Update copyright.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Peter Schaffter <peter@schaffter.ca>
In-Reply-To: groff@gnu.org
References: <20170227031033.21755.86267@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: e21a2d6a40f6fc5741ab80201c1b6c1d31a136d2
Auto-Submitted: auto-generated
Message-Id: <20170227031034.600322600F@vcs0.savannah.gnu.org>
Date: Sun, 26 Feb 2017 22:10:34 -0500 (EST)
From: peter@schaffter.ca (Peter Schaffter)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Feb 2017 03:10:37 -0000

PTPi pushed a commit to branch master
in repository groff.

commit e21a2d6a40f6fc5741ab80201c1b6c1d31a136d2
Author: Peter Schaffter <peter@schaffter.ca>
Date:   Sun Feb 26 22:08:19 2017 -0500

    Update copyright.
---
 contrib/mom/BUGS            | 6 ++++--
 contrib/mom/NEWS            | 9 ++++++++-
 contrib/mom/TODO            | 2 +-
 contrib/mom/copyright       | 2 +-
 contrib/mom/groff_mom.7.man | 2 +-
 5 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/contrib/mom/BUGS b/contrib/mom/BUGS
index ca3c71b..d5de747 100644
--- a/contrib/mom/BUGS
+++ b/contrib/mom/BUGS
@@ -1,5 +1,5 @@
     -*- text -*-
-    Copyright 2004-2016  Free Software Foundation, Inc.
+    Copyright 2004-2017  Free Software Foundation, Inc.
=20
     Copying and distribution of this file, with or without modification,
     are permitted in any medium without royalty provided the copyright
@@ -16,7 +16,6 @@ suggestions, or contact me directly at:
=20
 If writing me directly, please include the word "groff" or "mom" in
 the Subject line or you risk my spam filters nuking your message.
-Also, please--no html email.  That, too, gets nuked.
=20
 --Peter Schaffter
=20
@@ -24,6 +23,9 @@ Also, please--no html email.  That, too, gets nuked.
=20
 Version 2.1-b
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+Toggling of pagination broken.
+---Fixed---
+
 HEADERS_AND_FOOTERS printing footer at top of second page instead of
 printing header unless FOOTER_ON_FIRST_PAGE is called.
 ---Fixed---
diff --git a/contrib/mom/NEWS b/contrib/mom/NEWS
index 5640cf9..c3bac34 100644
--- a/contrib/mom/NEWS
+++ b/contrib/mom/NEWS
@@ -1,10 +1,17 @@
     -*- text -*-
-    Copyright (C) 2004-2016  Free Software Foundation, Inc.
+    Copyright (C) 2004-2017  Free Software Foundation, Inc.
=20
     Copying and distribution of this file, with or without modification,
     are permitted in any medium without royalty provided the copyright
     notice and this notice are preserved.
=20
+Release 2.2
+-----------
+Addition of flex-spacing (flexible vertical whitespace).  Fixes and
+improvements to positioning of floats, images, and pre-processor
+material.  Addition of TARGET (PDF target) argument to floats,
+images, and pre-processor material.  Improvements to autolabelling.
+
 Release 2.1-b
 -------------
 Fix to handling of kern units.  Updated copyright info.
diff --git a/contrib/mom/TODO b/contrib/mom/TODO
index dce632b..7b07252 100644
--- a/contrib/mom/TODO
+++ b/contrib/mom/TODO
@@ -1,5 +1,5 @@
     -*- txt -*-
-    Copyright 2004-2016  Free Software Foundation, Inc.
+    Copyright 2004-2017  Free Software Foundation, Inc.
=20
     Copying and distribution of this file, with or without modification,
     are permitted in any medium without royalty provided the copyright
diff --git a/contrib/mom/copyright b/contrib/mom/copyright
index 2583724..16e18bb 100644
--- a/contrib/mom/copyright
+++ b/contrib/mom/copyright
@@ -9,7 +9,7 @@ K1L 6X6
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
 The groff macro file om.tmac and the html documentation pertaining to
-it are Copyright (C) 2004-2016 Peter Schaffter.
+it are Copyright (C) 2004-2017 Peter Schaffter.
=20
 om.tmac is issued under the GNU General Public License, a full copy of
 which can be had at
diff --git a/contrib/mom/groff_mom.7.man b/contrib/mom/groff_mom.7.man
index 9280f4d..05b7a26 100644
--- a/contrib/mom/groff_mom.7.man
+++ b/contrib/mom/groff_mom.7.man
@@ -14,7 +14,7 @@ groff_mom \- groff `mom' macros, `mom' is a `roff' lang=
uage, part of `groff'
 .\" --------------------------------------------------------------------
 .
 .de co
-Copyright \[co] 2002-2016 Free Software Foundation, Inc.
+Copyright \[co] 2002-2017 Free Software Foundation, Inc.
=20
 This file is part of groff, a free software project.
=20


From MAILER-DAEMON Sun Feb 26 22:19:01 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ciBq1-0002q1-R2
	for mharc-groff-commit@gnu.org; Sun, 26 Feb 2017 22:19:01 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42366)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBpp-0002pq-5a
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:19:00 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBpe-0003vc-C3
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:18:49 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:37098)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBpe-0003vW-3h
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:18:38 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 71277)
	id E2A252600F; Sun, 26 Feb 2017 22:18:37 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: Version 2.2 release.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Peter Schaffter <peter@schaffter.ca>
In-Reply-To: groff@gnu.org
References: <20170227031837.24643.51397@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: 3a4907891fe75d93857166344d525e7f1c9c791e
Auto-Submitted: auto-generated
Message-Id: <20170227031837.E2A252600F@vcs0.savannah.gnu.org>
Date: Sun, 26 Feb 2017 22:18:37 -0500 (EST)
From: peter@schaffter.ca (Peter Schaffter)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Feb 2017 03:19:00 -0000

PTPi pushed a commit to branch master
in repository groff.

commit 3a4907891fe75d93857166344d525e7f1c9c791e
Author: Peter Schaffter <peter@schaffter.ca>
Date:   Sun Feb 26 22:17:52 2017 -0500

    Version 2.2 release.
---
 contrib/mom/om.tmac-u | 2297 ++++++++++++++++++++++++++++++++-----------=
------
 1 file changed, 1488 insertions(+), 809 deletions(-)

diff --git a/contrib/mom/om.tmac-u b/contrib/mom/om.tmac-u
index b1f4e8f..d26433d 100644
--- a/contrib/mom/om.tmac-u
+++ b/contrib/mom/om.tmac-u
@@ -2,7 +2,7 @@
 .ig
 Mom -- a typesetting/document-processing macro set for groff.
=20
-Copyright (C) 2002-2016  Free Software Foundation, Inc.
+Copyright (C) 2002-2017  Free Software Foundation, Inc.
  Written by Peter Schaffter <peter@schaffter.ca>
  PDF integration contributed by Deri James <deri.james@chuzzlewit.co.uk>
=20
@@ -21,9 +21,9 @@ for more details.
 You should have received a copy of the GNU General Public License
 along with this program. If not, see <http://www.gnu.org/licenses/>.
=20
-Version 2.1-b_1
----------------
-Antoine de St-Exup=EF=BF=BDry asserted that elegance in engineering is
+Version 2.2
+-----------
+Antoine de St-Exup=C3=A9ry asserted that elegance in engineering is
 achieved not when there is nothing left to add, but when there is
 nothing left to take away.
=20
@@ -440,26 +440,26 @@ end
 \#   breaks to a new page.
 \#
 .MAC NEWPAGE END
-.    nr #NEWPAGE 1
-.    ie \\n[#NO_BREAK] \{\
-'       br
-.       rr #NO_BREAK
-.    \}
-.    el .br
+.    if !\\n[defer] .nr #NEWPAGE 1
 .    nr @TOP 1
-.    ie \\n[#B_MARGIN_SET]=3D1 \{\
-.       ie !\\n[#DOCS]=3D1 .DO_B_MARGIN
-.       el \{\
-.          if \\n[#COLUMNS]=3D1 .nr #COL_NUM \\n[#NUM_COLS]
-.          ie !\\n[#FN_DEPTH] \{\
-.             ch FN_OVERFLOW_TRAP
-.             FOOTER
-.             wh -\\n[#FN_OVERFLOW_TRAP_POS]u FN_OVERFLOW_TRAP
-.          \}
-.          el .FOOTER
+.    ie !\\n[#DOCS]=3D1 \
+.       if \\n[#B_MARGIN_SET]=3D1 .DO_B_MARGIN
+.    el \{\
+.       if \\n[#COLUMNS]=3D1 .nr #COL_NUM \\n[#NUM_COLS]
+.       if !\\n[#FN_DEPTH] \{\
+.          ch FN_OVERFLOW_TRAP
+.          nr #RESET_FN_OVERFLOW_TRAP 1
 .       \}
 .    \}
-.    el 'bp
+.    if dPDF.EXPORT \
+.       if \\n[#FLEX_ACTIVE] \
+.          if !\\n[#NO_FLEX] \
+.             tm .ds pre-newpage-\\n% \\n%@\\n[#COL_NUM]
+.    bp
+.    if \\n[#RESET_FN_OVERFLOW_TRAP] \{\
+.       wh -\\n[#FN_OVERFLOW_TRAP_POS]u FN_OVERFLOW_TRAP
+.       rr #RESET_FN_OVERFLOW_TRAP_POS
+.   \}
 .END
 \#
 \# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
@@ -1042,7 +1042,6 @@ end
 \#   Requires a unit of measure.
 \#
 .MAC ALD END
-.    br
 .    if '\\$0'ALD' \{\
 .       nr #ALD (u;\\$1)
 .       sp \\n[#ALD]u
@@ -1737,11 +1736,11 @@ end
 \#
 .MAC TN END
 .    nr #TN 1
-.    TRAP OFF
+.    vpt 0
 .    sp -1v
 .    nr #NEXT_TAB \\n[#CURRENT_TAB]+1
 .    TAB\\n[#NEXT_TAB]
-.    TRAP
+.    vpt
 .END
 \#
 \# An inline escape to accomplish the same thing.  Preferable, since
@@ -1892,16 +1891,16 @@ end
 .ds TITLE_TYPE_2  AUTHOR
 .ds TITLE_TYPE_3  CHAPTER
 .ds TITLE_TYPE_4  CHAPTER_TITLE
-.ds TITLE_TYPE_12 COPYRIGHT
 .ds TITLE_TYPE_5  COVERTITLE
-.ds TITLE_TYPE_14 COVER_TITLE
 .ds TITLE_TYPE_6  DOCTITLE
 .ds TITLE_TYPE_7  DOCTYPE
 .ds TITLE_TYPE_8  DOC_COVERTITLE
-.ds TITLE_TYPE_13 DOC_COVER_TITLE
-.ds TITLE_TYPE_11 MISC
 .ds TITLE_TYPE_9  SUBTITLE
 .ds TITLE_TYPE_10 TITLE
+.ds TITLE_TYPE_11 MISC
+.ds TITLE_TYPE_12 COPYRIGHT
+.ds TITLE_TYPE_13 DOC_COVER_TITLE
+.ds TITLE_TYPE_14 COVER_TITLE
 \#
 \# UNDERLINE
 \# ---------
@@ -2054,7 +2053,6 @@ end
 .    \}
 .    nr #TEXT_WIDTH \w'\\$1'
 .    ie \\n[.u]=3D1 \{\
-.       nop \~
 \Z'\\$1'\
 \Z'\D't \\n[#UNDERSCORE_WEIGHT]''\
 \v'\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
@@ -2064,7 +2062,6 @@ end
 .       nop
 .    \}
 .    el \{\
-.       nop \ \"
 \Z'\\$1'\
 \Z'\D't \\n[#UNDERSCORE_WEIGHT]''\
 \v'\\*[$UNDERSCORE_GAP]+\\n[#UNDERSCORE_WEIGHT_ADJ]u'\
@@ -2621,9 +2618,13 @@ end
 .    nr #DC_LINES +1
 .    if \\n[#DC_LINES]v>\\n[.t] \{\
 .       nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1
-.       tm1 "[mom]: Dropcap at line \\n[.c] does not fit on page \\n[pgn=
um].
-.       tm1 "       Shifting paragraph to page \\n+[pgnum].
-.       bp
+.       if \\n[#COLUMNS]=3D1 .ds col-num ", column \\n[#COL_NUM]
+.       tm1 \
+"[mom]: Dropcap at line \\n[.c] does not fit on page \\n[pgnum]\\*[col-n=
um].
+.       tm1 \
+"       Shifting paragraph to next page or column.
+.       ie \\n[#COLUMNS] .COL_NEXT
+.       el .NEWPAGE
 .    \}
 .    ie \\n[#DC_COLOR]=3D1 \{\
 .       ie !'\\$3'' \{\
@@ -2898,9 +2899,8 @@ end
 .    ds $RL_WEIGHT \\$1
 .    ds $RL_INDENT \\$2
 .    ds $RL_DEPTH  \\$3
-.    ie !'\\$4'' \{\
+.    ie !'\\$4'' \
 .       ds $RL_COLOR  \\$4
-.    \}
 .    el .ds $RL_COLOR \\*[default]
 .    nr #SAVED_WEIGHT     \\n[#RULE_WEIGHT]
 .    nr #SAVED_WEIGHT_ADJ \\n[#RULE_WEIGHT_ADJ]
@@ -2936,7 +2936,7 @@ end
 \# BOXES - DBX
 \# -----------
 \# *Arguments:
-\#   <rule weight | SOLID> <indent> <length> <depth> [ <color> ]
+\#   <rule weight> | SOLID> <indent> <length> <depth> [ <color> ]
 \# *Function:
 \#   Draws described box.
 \# *Notes:
@@ -3029,7 +3029,7 @@ end
 \# ELLIPSES - DCL
 \# --------------
 \# *Arguments:
-\#   <rule weight | SOLID> <indent> <width> <depth> [ <color> ]
+\#   <rule weight> | SOLID> <indent> <width> <depth> [ <color> ]
 \# *Function:
 \#   Draws described ellipses.
 \# *Notes:
@@ -3541,6 +3541,7 @@ end
 .    rr #INDENT_LEFT_ACTIVE
 .    rr #INDENT_RIGHT_ACTIVE
 .    rr #INDENT_BOTH_ACTIVE
+.    rr #INDENT_ACTIVE
 .    if \\n[#INDENT_STYLE_RIGHT] \{\
 .       ie \\n[#TAB_ACTIVE] .TAB\\n[#CURRENT_TAB]
 .       el \{\
@@ -3604,7 +3605,6 @@ end
 .       rr #INDENT_STYLE_RIGHT
 .       rr #INDENT_STYLE_BOTH
 .    \}
-.    rr #INDENT_ACTIVE
 .END
 \#
 \# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
@@ -3900,7 +3900,8 @@ end
 \# *Arguments:
 \#   <none> | <anything>
 \# *Function:
-\#   Converts text to smallcaps, or, if OFF, reverts to normal caps/lc.
+\#   Converts text to smallcaps, or, if <anything>, reverts to normal
+\#   caps/lc.
 \# *Notes:
 \#   SMALLCAPS has no inline escape eqiv. to \*[UC].
 \#
@@ -3913,7 +3914,7 @@ end
 .       nr #SMALLCAPS_ON 1
 .       nr #LOOP 0 1
 .       while \\n+[#LOOP]<=3D58 \{\
-.       char \\*[$c\\n[#LOOP]] \
+.          char \\*[$c\\n[#LOOP]] \
 \Z'\s[\\n[sc*size]u+\\n[sc*extend-factor]u]\H'-\\n[sc*extend-factor]u'\
 \\*[$C\\n[#LOOP]]'\
 \h'\\n[sc*wt-adj-factor]u'\\*[$C\\n[#LOOP]]\s[0]
@@ -4220,15 +4221,16 @@ y\R'#DESCENDER \\n[.cdp]'
 .       nr #LOOP 9       \" loop count
 .       while \\n+[#HD_LEVEL]<=3D\\n[#LOOP] \{\
 .           HEADING_STYLE \\n[#HD_LEVEL] \
-            FONT   B \
+            FONT  B  \
             SIZE  +0 \
-            QUAD   L \
-            COLOR  black
+            QUAD  L  \
+            NEEDS 1v \
+            COLOR black
 .\"  Set up default style for nine levels of TOC headings
 .           TOC_ENTRY_STYLE \\n[#HD_LEVEL] \
-            FONT   R \
+            FONT  R  \
             SIZE  +0 \
-            COLOR  black
+            COLOR black
 .       \}
 .\" Set up decreasing sizes for headings levels 1 - 3, starting at +3
 .       nr #HD_LEVEL 0 1 \" loop step
@@ -5124,9 +5126,8 @@ y\R'#DESCENDER \\n[.cdp]'
 .       if '\\$1'R' .QUAD-ERROR \\$0
 .       if '\\$1'C' .QUAD-ERROR \\$0
 .    \}
-.    if '\\$0'DOC_QUAD' \{\
+.    if '\\$0'DOC_QUAD' \
 .       if !\\n[#DOCS] .DOC_MACRO_ERROR \\$0
-.    \}
 .    ds PARAM       QUAD
 .    ds ELEMENT     \\$0
 .    if '\\$0'COPYRIGHT_QUAD' \
@@ -5152,6 +5153,7 @@ y\R'#DESCENDER \\n[.cdp]'
 .END
 \#
 .MAC ASSIGN_ELEMENT END
+.    rm $\\*[ELEMENT] \" Clear this first
 .\" HDRFTR_<POSITION>_<PARAMETER> need special handling.
 .    ds hdrftr \\*[FROM_ALIAS]
 .    substring hdrftr 0 5
@@ -5494,22 +5496,23 @@ SMALLCAPS takes precedence.
 .ds STYLE_TYPE_22 FOOTER_CENTER
 .ds STYLE_TYPE_23 FOOTER_CENTRE
 .ds STYLE_TYPE_24 FOOTER_RIGHT
-.ds STYLE_TYPE_25 HEADER_LEFT
-.ds STYLE_TYPE_26 HEADER_CENTER
-.ds STYLE_TYPE_27 HEADER_CENTRE
-.ds STYLE_TYPE_28 HEADER_RIGHT
-.ds STYLE_TYPE_29 LEAD
-.ds STYLE_TYPE_30 LINENUMBER
-.ds STYLE_TYPE_31 MISC
-.ds STYLE_TYPE_32 QUOTE
-.ds STYLE_TYPE_33 PAGENUMBER
-.ds STYLE_TYPE_34 SUBTITLE
-.ds STYLE_TYPE_35 TITLE
-.ds STYLE_TYPE_36 TOC_HEADER
+.ds STYLE_TYPE_25 FOOTNOTE
+.ds STYLE_TYPE_26 HEADER_LEFT
+.ds STYLE_TYPE_27 HEADER_CENTER
+.ds STYLE_TYPE_28 HEADER_CENTRE
+.ds STYLE_TYPE_29 HEADER_RIGHT
+.ds STYLE_TYPE_30 LEAD
+.ds STYLE_TYPE_31 LINENUMBER
+.ds STYLE_TYPE_32 MISC
+.ds STYLE_TYPE_33 QUOTE
+.ds STYLE_TYPE_34 PAGENUMBER
+.ds STYLE_TYPE_35 SUBTITLE
+.ds STYLE_TYPE_36 TITLE
+.ds STYLE_TYPE_37 TOC_HEADER
 .
 .
 .nr #LOOP 0 1
-.while \n+[#LOOP]<=3D36 \{\
+.while \n+[#LOOP]<=3D37 \{\
 . ALIAS \*[STYLE_TYPE_\n[#LOOP]]_STYLE           _STYLE
 . ALIAS COVER_\*[STYLE_TYPE_\n[#LOOP]]_STYLE     _STYLE
 . ALIAS DOC_COVER_\*[STYLE_TYPE_\n[#LOOP]]_STYLE _STYLE
@@ -5638,11 +5641,14 @@ SMALLCAPS takes precedence.
 .          el .if !r #T_MARGIN .T_MARGIN 6P
 .       \}
 .    \}
-.    if !r #T_MARGIN          .T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_=
GAP]
-.    if !r #DOCHEADER_ADVANCE .nr #DOCHEADER_ADVANCE \\n[#T_MARGIN]
-.    if !r #FOOTER_MARGIN     .FOOTER_MARGIN 3P
-.    if !r #FOOTER_GAP        .FOOTER_GAP 3P
-.    if !r #B_MARGIN          .B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER=
_GAP]u
+.    if !r #T_MARGIN \
+.       T_MARGIN \\n[#HEADER_MARGIN]+\\n[#HEADER_GAP]
+.    if !r #DOCHEADER_ADVANCE \
+.       nr #DOCHEADER_ADVANCE \\n[#T_MARGIN]
+.    if !r #FOOTER_MARGIN .FOOTER_MARGIN 3P
+.    if !r #FOOTER_GAP    .FOOTER_GAP 3P
+.    if !r #B_MARGIN \
+.       B_MARGIN \\n[#FOOTER_MARGIN]u+\\n[#FOOTER_GAP]u
 .    if !r #HEADER_RULE_GAP .HEADER_RULE_GAP 4p
 .    if !r #FOOTER_RULE_GAP .FOOTER_RULE_GAP 4p
 .    if !r #HDRFTR_RULE     .HDRFTR_RULE
@@ -5662,17 +5668,18 @@ SMALLCAPS takes precedence.
 .    if \\n[#ENDNOTES]     .nr #DOC_PT_SIZE \\n[#EN_PS]
 .    if \\n[#BIBLIOGRAPHY] .nr #DOC_PT_SIZE \\n[#BIB_PS]
 .\"
-.    nr #DOC_LEAD     \\n[.v]
-.    nr #DOC@LEAD     \\n[#DOC_LEAD]
+.    nr #DOC_LEAD \\n[.v]
+.    nr #DOC@LEAD \\n[#DOC_LEAD]
 .    if \\n[#AUTO_LEAD] .nr #DOC_AUTOLEAD \\n[#AUTOLEAD_VALUE]
 .\" #SAVED_DOC_LEAD is set in COLLATE
 .    if \\n[#SAVED_DOC_LEAD] \{\
 .       if \
-(\\n[#TOC]=3D0):\
-(\\n[#LIST_OF_FIGURES]=3D0):\
-(\\n[#LIST_OF_TABLES]=3D0):\
+(\\n[#TOC]=3D0)&\
+(\\n[#LIST_OF_FIGURES]=3D0)&\
+(\\n[#LIST_OF_TABLES]=3D0)&\
 (\\n[#LIST_OF_EQUATIONS]=3D0) \
-.          if !\\n[#DOC_LEAD]=3D\\n[#SAVED_DOC_LEAD] .nr #RERUN_TRAPS 1
+.          ie !\\n[#DOC_LEAD]=3D\\n[#SAVED_DOC_LEAD] .nr #RERUN_TRAPS 1
+.          el .nr #SKIP_TRAPS 1
 .    \}
 .    ie \\n[#ADJ_DOC_LEAD]=3D1 .
 .    el \
@@ -5692,7 +5699,10 @@ SMALLCAPS takes precedence.
 .    nr #FN_COUNT_FOR_COLS 0 1
 .    nr #DONE_ONCE         0 1
 .\" Enable shimming if user hasn't turned it off
-.    if \\n[#NO_SHIM]=3D2    .rr #NO_SHIM
+.   if \\n[#NO_SHIM]=3D2 \{\
+.      rr #NO_SHIM
+.      nr #NO_FLEX 1
+.   \}
 .\" General style defaults for both PRINTSTYLEs
 .    nr #PP_STYLE 1
 .    PARA_INDENT \\n[#PP_INDENT]u
@@ -5749,19 +5759,19 @@ SMALLCAPS takes precedence.
 .          el .ENDNOTE_NUMBERS_ALIGN RIGHT 4
 .       \}
 .    \}
-.    if !r #EN_LN_GAP         .ENDNOTE_LINENUMBER_GAP 1m
-.    if !r #EN_ALLOWS_HEADERS .ENDNOTES_ALLOWS_HEADERS
-.    if !d $BIB_PN_STYLE      .BIBLIOGRAPHY_PAGENUM_STYLE digit
-.    if !d $BIB_FAM           .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM]
-.    if !d $BIB_FT            .BIBLIOGRAPHY_FONT R
-.    if !d $BIB_QUAD          .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD]
-.    if !d $BIB_STRING        .BIBLIOGRAPHY_STRING "Bibliography"
-.    if !d $BIB_STRING_FAM    .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FAM]
-.    if !d $BIB_STRING_QUAD   .BIBLIOGRAPHY_STRING_QUAD CENTER
-.    if !d $TOC_HEADER_STRING .TOC_HEADER_STRING "Contents"
-.    if !d $TOC_HEADER_QUAD   .TOC_HEADER_QUAD LEFT
-.    if !d $TOC_PN_STYLE      .TOC_PAGENUM_STYLE roman
-.    if !r #TOC_PN_PADDING    .TOC_PADDING 3
+.    if !r #EN_LN_GAP            .ENDNOTE_LINENUMBER_GAP 1m
+.    if !r #EN_ALLOWS_HEADERS    .ENDNOTES_ALLOWS_HEADERS
+.    if !d $BIB_PN_STYLE         .BIBLIOGRAPHY_PAGENUM_STYLE digit
+.    if !d $BIB_FAM              .BIBLIOGRAPHY_FAMILY \\*[$DOC_FAM]
+.    if !d $BIB_FT               .BIBLIOGRAPHY_FONT R
+.    if !d $BIB_QUAD             .BIBLIOGRAPHY_QUAD \\*[$DOC_QUAD]
+.    if !d $BIB_STRING           .BIBLIOGRAPHY_STRING "Bibliography"
+.    if !d $BIB_STRING_FAM       .BIBLIOGRAPHY_STRING_FAMILY \\*[$BIB_FA=
M]
+.    if !d $BIB_STRING_QUAD      .BIBLIOGRAPHY_STRING_QUAD CENTER
+.    if !d $TOC_HEADER_STRING    .TOC_HEADER_STRING "Contents"
+.    if !d $TOC_HEADER_QUAD      .TOC_HEADER_QUAD LEFT
+.    if !d $TOC_PN_STYLE         .TOC_PAGENUM_STYLE roman
+.    if !r #TOC_PN_PADDING       .TOC_PADDING 3
 .\" Line numbering
 .    if !r #LN_GUTTER      .nr #LN_GUTTER 2
 .    if !r #Q_LN_GUTTER    .nr #Q_LN_GUTTER 2
@@ -5853,8 +5863,8 @@ SMALLCAPS takes precedence.
 .       if !r #FN_RULE_LENGTH .FOOTNOTE_RULE_LENGTH 2i
 .\" +Endnotes
 .       if !r #EN_PP_INDENT .ENDNOTE_PARA_INDENT \\n[#PP_INDENT]
-.       if !r #EN_STRING_UNDERLINE .nr #EN_STRING_UNDERLINE 2
 .       if !r #EN_STRING_CAPS .ENDNOTES_HEADER_CAPS
+.       if !r #EN_STRING_UNDERLINE .nr #EN_STRING_UNDERLINE 2
 .\" +Footnotes
 .       if !r #FN_RULE_ADJ .FOOTNOTE_RULE_ADJ 6p
 .\" +Slant stuff
@@ -6230,61 +6240,55 @@ SMALLCAPS takes precedence.
 .       nr #AUTO_LEAD 1
 .       nr #AUTOLEAD_VALUE  \\n[#SAVED_AUTOLEAD_VALUE]
 .    \}
-.    ie !\\n[#COLLATE] \{\
-.\" DOC_LEAD adjusted (or not) here
-.       TRAPS
-.       if \\n[#REMOVE_ADJ] .DOC_LEAD \\n[#DOC_LEAD]u-\\n[#DOC_LEAD_ADJ]=
u
-.       if (\\n[#FOOTER_MARGIN]+\\n[.v]>=3D\\n[#B_MARGIN]) \{\
-.          tm1 "[mom]: Your chosen bottom margin for running text is too=
 close to the footer margin.
-.          tm1 "       No footers or bottom-of-page page numbers will be=
 printed.
-.          tm1 "       Please reset B_MARGIN or FOOTER_MARGIN to allow e=
nough space.
-.          tm1 "       If no footers or bottom-of-page page numbers are =
required,
-.          tm1 "       invoke .FOOTER_MARGIN 0 before .START
-.          nr #SKIP_FOOTER 1
-.       \}
+.    if !\\n[#SKIP_TRAPS] .TRAPS
+.    rr #SKIP_TRAPS
+.    if \\n[#REMOVE_ADJ] .DOC_LEAD \\n[#DOC_LEAD]u-\\n[#DOC_LEAD_ADJ]u
+.    if (\\n[#FOOTER_MARGIN]+\\n[.v]>=3D\\n[#B_MARGIN]) \{\
+.       tm1 "[mom]: Your chosen bottom margin for running text is too cl=
ose to the footer margin.
+.       tm1 "       No footers or bottom-of-page page numbers will be pr=
inted.
+.       tm1 "       Please reset B_MARGIN or FOOTER_MARGIN to allow enou=
gh space.
+.       tm1 "       If no footers or bottom-of-page page numbers are req=
uired,
+.       tm1 "       invoke .FOOTER_MARGIN 0 before .START
+.       nr #SKIP_FOOTER 1
+.    \}
 .\" Endnote, bibliography 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]=3D1 \{\
-.          ie \\n[#SINGLE_SPACE] \{\
-.             ENDNOTE_LEAD      12 ADJUST
-.             BIBLIOGRAPHY_LEAD 12 ADJUST
-.          \}
-.          el \{\
-.             ie \\n[#EN_SINGLESPACE] .ENDNOTE_LEAD 12 ADJUST
-.             el .ENDNOTE_LEAD 24 ADJUST
-.             ie \\n[#BIB_SINGLESPACE] .BIBLIOGRAPHY_LEAD 12 ADJUST
-.             el .BIBLIOGRAPHY_LEAD 24 ADJUST
-.          \}
+.    nr #OK_PROCESS_LEAD 1
+.    nr #RESTORE_DOC_LEAD \\n[.v]
+.    nr #RESTORE_B_MARGIN \\n[#B_MARGIN]
+.    if \\n[#PRINT_STYLE]=3D1 \{\
+.       ie \\n[#SINGLE_SPACE] \{\
+.          ENDNOTE_LEAD      12 ADJUST
+.          BIBLIOGRAPHY_LEAD 12 ADJUST
 .       \}
-.       if \\n[#PRINT_STYLE]=3D2 \{\
-.          ie !d $EN_LEAD  .ENDNOTE_LEAD \\n[#UNADJUSTED_DOC_LEAD]u ADJU=
ST
-.          el .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD]
-.          ie !d $BIB_LEAD .BIBLIOGRAPHY_LEAD \\n[#UNADJUSTED_DOC_LEAD]u=
 ADJUST
-.          el .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD]
-.          ie !d $TOC_LEAD .TOC_LEAD \\n[#UNADJUSTED_DOC_LEAD]u \\*[$ADJ=
UST_TOC_LEAD]
-.          el .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD]
-.       \}
-.       ie !d $BIB_SPACE .BIBLIOGRAPHY_SPACING 0
 .       el \{\
-.          if \\n[#DEFER_BIB_SPACING]=3D1 \{\
-.             BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE]
-.             rr #DEFER_BIB_SPACING
-.          \}
+.          ie \\n[#EN_SINGLESPACE] .ENDNOTE_LEAD 12 ADJUST
+.          el .ENDNOTE_LEAD 24 ADJUST
+.          ie \\n[#BIB_SINGLESPACE] .BIBLIOGRAPHY_LEAD 12 ADJUST
+.          el .BIBLIOGRAPHY_LEAD 24 ADJUST
 .       \}
-.       nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
-.       nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
-.       vs \\n[#DOC_LEAD]u
 .    \}
+.    if \\n[#PRINT_STYLE]=3D2 \{\
+.       ie !d $EN_LEAD  .ENDNOTE_LEAD \\n[#UNADJUSTED_DOC_LEAD]u ADJUST
+.       el .ENDNOTE_LEAD \\*[$EN_LEAD] \\*[$ADJUST_EN_LEAD]
+.       ie !d $BIB_LEAD .BIBLIOGRAPHY_LEAD \\n[#UNADJUSTED_DOC_LEAD]u AD=
JUST
+.       el .BIBLIOGRAPHY_LEAD \\*[$BIB_LEAD] \\*[$ADJUST_BIB_LEAD]
+.       ie !d $TOC_LEAD .TOC_LEAD \\n[#UNADJUSTED_DOC_LEAD]u \\*[$ADJUST=
_TOC_LEAD]
+.       el .TOC_LEAD \\*[$TOC_LEAD] \\*[$ADJUST_TOC_LEAD]
+.    \}
+.    ie !d $BIB_SPACE .BIBLIOGRAPHY_SPACING 0
 .    el \{\
-.       if \\n[#COLLATE] \{\
-.          if !\\n[#PRINT_STYLE]=3D1 \{\
-.             if \\n[#RERUN_TRAPS] \{\
-.                TRAPS
-.                rr #RERUN_TRAPS
-.             \}
-.          \}
+.       if \\n[#DEFER_BIB_SPACING]=3D1 \{\
+.          BIBLIOGRAPHY_SPACING \\*[$BIB_SPACE]
+.          rr #DEFER_BIB_SPACING
+.       \}
+.    \}
+.    nr #DOC_LEAD \\n[#RESTORE_DOC_LEAD]u
+.    nr #B_MARGIN \\n[#RESTORE_B_MARGIN]
+.    vs \\n[#DOC_LEAD]u
+.    if !\\n[#PRINT_STYLE]=3D1 \{\
+.       if \\n[#RERUN_TRAPS] \{\
+.          TRAPS
+.          rr #RERUN_TRAPS
 .       \}
 .    \}
 .\" Set default heading and toc-entry family if not done already
@@ -6431,6 +6435,31 @@ SMALLCAPS takes precedence.
 .    SMALLCAPS off
 .    CAPS off
 .END
+.
+.ALIAS DO_TITLE    DO_TITLE_OR_AUTHOR
+.ALIAS DO_SUBTITLE DO_TITLE_OR_AUTHOR
+.ALIAS DO_AUTHORS  DO_TITLE_OR_AUTHOR
+\#
+.MAC DO_CHAPTER END
+.    fam \\*[$\\*[DOC_]COVER_CHAPTER_FAM]
+.    ft     \\*[$\\*[DOC_]COVER_CHAPTER_FT]
+.    ps \\n[#DOC_PT_SIZE]u\\*[$\\*[DOC_]COVER_CHAPTER_SIZE_CHANGE]
+.    if \\n[#\\*[DOC_]COVER_CHAPTER_COLOR]=3D1 \
+.       gcolor \\*[$\\*[DOC_]COVER_CHAPTER_COLOR]
+.    if \\n[#\\*[DOC_]COVER_CHAPTER_CAPS]=3D1 .CAPS
+.    if \\n[#\\*[DOC_]COVER_CHAPTER_SMALLCAPS]=3D1 .SMALLCAPS
+.    ie \\n[#\\*[DOC_]COVER_CHAPTER_UNDERLINE] \{\
+.       ds $TITLE_TYPE \\*[$COVER_TYPE]CHAPTER
+.       ie \\n[#\\*[DOC_]COVER_CHAPTER_UNDERLINE]=3D2 \
+.          UNDERSCORE2 \\*[$\\*[DOC_]COVER_CHAPTER_UNDERLINE_GAP] \
+\\*[$\\*[DOC_]COVER_CHAPTER_RULE_GAP] "\\*[$CHAPTER_STRING] \\*[$CHAPTER=
]"
+.       el .UNDERSCORE "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
+.    \}
+.    el .PRINT "\\*[$CHAPTER_STRING] \\*[$CHAPTER]"
+.    gcolor
+.    SMALLCAPS off
+.    CAPS off
+.END
 \#
 \# Spacing adjustments for (doc)cover and docheader elements
 \#
@@ -6554,18 +6583,17 @@ SMALLCAPS takes precedence.
 .       if \\n[#PRINT_STYLE]=3D2 \
 .          if \\n[#DOCHEADER_COLOR]=3D1 \
 .             gcolor \\*[$DOCHEADER_COLOR]
-.       ie !'\\*[$CHAPTER_TITLE_1]'' \{\
+.       if !'\\*[$CHAPTER_TITLE_1]'' \{\
 .          ds $PRFX CHAPTER_
 .          nr #DOCHEADER 1
 .          DO_TITLE
 .          rr #DOCHEADER
 .          rm $PRFX
 .       \}
-.       el .DO_TITLE
 .    \}
 .\" Chapter string, possibly with a chapter title
 .    el \{\
-.       if \\n[#PRINT_STYLE]=3D2 \
+.       if \\n[#PRINT_STYLE]=3D2 \{\
 .          if \\n[#DOCHEADER_COLOR]=3D1 \
 .             gcolor \\*[$DOCHEADER_COLOR]
 .          if \\n[#CHAPTER_COLOR]=3D1 \
@@ -6916,20 +6944,20 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .ALIAS DOC_COVER_IMAGE COVER_IMAGE
 \#
 .MAC DO_COVER_IMAGE END
-. ll \\n[#PAGE_WIDTH]u
-. po 0
-. vs 0
-. sp |0i
-. if \\n[\\*[DOC_]COVER_IMG_Y]   .sp \\n[\\*[DOC_]COVER_IMG_Y]u
-. if \\n[\\*[DOC_]COVER_IMG_X]   .in \\n[\\*[DOC_]COVER_IMG_X]u
-. if \\n[\\*[DOC_]COVER_IMG_IND] .in \\n[\\*[DOC_]COVER_IMG_IND]u
-. if \\n[.u]=3D1 .nf
-. nop \X'pdf: pdfpic \\*[\\*[DOC_]COVER_IMG_FILE] -L \
+.    ll \\n[#PAGE_WIDTH]u
+.    po 0
+.    vs 0
+.    sp |0i
+.    if \\n[\\*[DOC_]COVER_IMG_Y]   .sp \\n[\\*[DOC_]COVER_IMG_Y]u
+.    if \\n[\\*[DOC_]COVER_IMG_X]   .in \\n[\\*[DOC_]COVER_IMG_X]u
+.    if \\n[\\*[DOC_]COVER_IMG_IND] .in \\n[\\*[DOC_]COVER_IMG_IND]u
+.    if \\n[.u]=3D1 .nf
+.    nop \X'pdf: pdfpic \\*[\\*[DOC_]COVER_IMG_FILE] -L \
 \\n[\\*[DOC_]COVER_IMG_W]z \\n[\\*[DOC_]COVER_IMG_H]z'
-. in
-. vs
-. po
-. ll
+.    in
+.    vs
+.    po
+.    ll
 .END
 .
 .ALIAS DO_DOC_COVER_IMAGE DO_COVER_IMAGE
@@ -7526,9 +7554,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 \#
 .MAC START END
 .    nr #DOCS 1
-.    if \\n[TOC.RELOCATE]=3D=3D2 \{\
+.    if \\n[TOC.RELOCATE]=3D=3D2 \
 .       if !\\n[TOC_BH] .TOC_BEFORE_HERE
-.    \}
 .    if !n .nop \X'ps: exec 0 setlinejoin'\X'ps: exec 0 setlinecap'
 .    if !\\n[#PRINT_STYLE] \{\
 .       PRINTSTYLE TYPEWRITE
@@ -7569,12 +7596,10 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .    nr @L_MARGIN \\n[#DOC_L_MARGIN]
 .    nr @R_MARGIN \\n[#DOC_R_MARGIN]
 .\" Covers and doc covers
-.    if \\n[#DOC_COVERS]=3D1 \{\
+.    if \\n[#DOC_COVERS]=3D1 \
 .       if \\n[#DOC_COVER]=3D1 .DO_DOC_COVER
-.    \}
-.    if \\n[#COVERS]=3D1 \{\
+.    if \\n[#COVERS]=3D1 \
 .       if \\n[#COVER]=3D1 .DO_COVER
-.    \}
 .    nr PDFHREF.VIEW.LEADING \\n[PDFHREF.VIEW.LEADING.T]
 .    if !\\n[#TOC] .RV_HARD_SET_MARGINS
 .    if \\n[#COLUMNS] .COLUMNS \\n[#NUM_COLS] \\n[#GUTTER]u
@@ -7670,7 +7695,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 .       ie r#ADVANCE_FROM_TOP \{\
 .          br
 .          sp |\\n[#ADVANCE_FROM_TOP]u-1v
-.          if \\n[#ADJ_DOC_LEAD]=3D1 .SHIM
+.          if \\n[#ADJ_DOC_LEAD]=3D1 \
+.             if !\\n[#DOCHEADER_NO_SHIM] .SHIM_1
 .       \}
 .       el \{\
 .          br
@@ -7779,7 +7805,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 .       if \\n[#SINGLE_SPACE]=3D1 .sp
 .    if \\n[#ADJ_DOC_LEAD]=3D1 \
 .       if \\n[#ADVANCE_FROM_TOP]=3D0 \
-.          if \\n[#DOC_HEADER]=3D1 .SHIM
+.          if \\n[#DOC_HEADER]=3D1 \
+.             if !\\n[#DOCHEADER_NO_SHIM] .SHIM_1
 .    mk dc
 .    FAMILY \\*[$DOC_FAM]
 .    QUAD \\*[$DOC_QUAD]
@@ -7797,6 +7824,23 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM=
] \\$\\n[#\\*[DOC_]COVERTITLE_
 .    \}
 .    nr PDFHREF.VIEW.LEADING \\n[PDFHREF.VIEW.LEADING.H]
 .    vpt
+.    if !r flex .nr flex 1
+.    nr flex-spaces 0
+.\" If one-page, don't flex.
+.    if !dPDF.EXPORT \{\
+.       if \\n[#FLEX_ACTIVE] \{\
+.          if !\\n[#NO_FLEX] \{\
+.             if d pre-toc-\\n%@\\n[#COL_NUM] \
+.                nr #NO_FLEX 1
+.             if d pre-list-\\n%@\\n[#COL_NUM] \
+.                nr #NO_FLEX 1
+.             if d page-\\n%@\\n[#COL_NUM] \
+.                nr #NO_FLEX 1
+.             if '\\*[last-page]'\\n%@\\n[#COL_NUM]' \
+.                nr #NO_FLEX 1
+.          \}
+.       \}
+.    \}
 .END
 \#
 .MAC RR_ADVANCE_FROM_TOP END
@@ -7813,6 +7857,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 .    rr #NEXT_AUTHOR
 .    rr #NEXT_MISC
 .    wh \\n[nl]u+1u RR_ADVANCE_FROM_TOP
+.    rr #DOCHEADER_NO_SHIM
 .END
 \#
 \# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
@@ -7822,7 +7867,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 \# DOCUMENT HEADER
 \# ---------------
 \# *Argument:
-\#   <none> | <anything> [distance to advance from top of page]
+\#   <none> | <anything> [distance to advance from top of page] [NO_SHIM=
]
 \# *Function:
 \#   Turns printing of document header on or off.  If a second
 \#   numeric argument with units of measure is given, advances that
@@ -7834,10 +7879,15 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 \#   (with a unit of measure).
 \#
 .MAC DOCHEADER END
-.    ie '\\$1'' .nr #DOC_HEADER 1
-.    el \{\
-.       if !'\\$2'' .nr #ADVANCE_FROM_TOP (\\$2)
+.    if \\n[#NUM_ARGS]=3D0 .nr #DOC_HEADER 1
+.    if \\n[#NUM_ARGS]=3D1 \{\
+.       ie '\\$1'NO_SHIM' .nr #DOCHEADER_NO_SHIM 1
+.       el .nr #DOC_HEADER 0
+.    \}
+.    if \\n[#NUM_ARGS]>1 \{\
 .       nr #DOC_HEADER 0
+.       if \B'\\$2' .nr #ADVANCE_FROM_TOP \\$2
+.       if '\\$3'NO_SHIM' .nr #DOCHEADER_NO_SHIM 1
 .    \}
 .END
 \#
@@ -7988,10 +8038,10 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .    nr #RESET_TRAPS 1
 .    if !\\n[#ADJ_DOC_LEAD] .nr #REMOVE_ADJ 1
 .    if !'\\$0'DOC_LEAD' \{\
-.       if '\\$0'EN_LEAD' .nr #DOC_LEAD \\n[#EN_LEAD]
+.       if '\\$0'EN_LEAD'  .nr #DOC_LEAD \\n[#EN_LEAD]
 .       if '\\$0'BIB_LEAD' .nr #DOC_LEAD \\n[#BIB_LEAD]
 .       if '\\$0'TOC_LEAD' .nr #DOC_LEAD \\n[#TOC_LEAD]
-.       if '\\$2'ADJUST' .TRAPS
+.       if '\\$2'ADJUST'   .TRAPS
 .       rr #RESET_TRAPS
 .    \}
 .END
@@ -8039,28 +8089,146 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_N=
UM] \\$\\n[#\\*[DOC_]COVERTITLE_
 \# And a macro to disable SHIM
 \#
 .MAC NO_SHIM END
-.    ie '\\$1'' .nr #NO_SHIM 1
-.    el .rr #NO_SHIM
+.    ie '\\$1'' \{\
+.       nr #NO_SHIM 1
+.       nr #FLEX_ACTIVE 1
+.    \}
+.    el \{\
+.       rr #NO_SHIM
+.       rr #SHIM
+.       rr #FLEX_ACTIVE 1
+.   \}
 .END
 \#
 .nr #NO_SHIM 2 \" Restored to 1 in DEFAULTS.
 \#
 .MAC SHIM END
-.    ie \\n[#NO_SHIM] .return
-.    el \{\
-.       nr #VALID_BASELINE \\n[#T_MARGIN]-\\n[#DOC_LEAD] \\n[#DOC_LEAD]
-.       if !r#CURRENT_V_POS .nr #CURRENT_V_POS \\n[.d]
-.       ie \\n[#ADVANCE_FROM_TOP] \{\
-.          ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
-.             while \\n-[#VALID_BASELINE]>\\n[#CURRENT_V_POS] .
-.             nr #VALID_BASELINE +\\n[#DOC_LEAD]
-.             nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
-.          \}
-.          el .PROCESS_SHIM
+.    if \\n[#NO_SHIM] \
+.       if !'\\$0'SHIM_1' .return
+.    if !\\n[#NO_FLEX] \{\
+.       if !'\\$0'SHIM_1' \{\
+.          tm1 "[mom]:=20
+SHIM, line \\n[.c], is incompatible with flex-spacing, which is enabled.
+.          tm1 "      =20
+Flex-spacing must be disabled with NO_FLEX before using SHIM.
+.          ab [mom]: Aborting '\\n[.F]', line \\n[.c].
+.       \}
+.    \}
+.    nr #VALID_BASELINE \\n[#T_MARGIN]-\\n[#DOC_LEAD] \\n[#DOC_LEAD]
+.    if !r#CURRENT_V_POS .nr #CURRENT_V_POS \\n[.d]
+.    ie \\n[#ADVANCE_FROM_TOP] \{\
+.       ie \\n[#CURRENT_V_POS]<(\\n[#T_MARGIN]-1v) \{\
+.          while \\n-[#VALID_BASELINE]>\\n[#CURRENT_V_POS] .
+.          nr #VALID_BASELINE +\\n[#DOC_LEAD]
+.          nr #SHIM \\n[#VALID_BASELINE]-\\n[#CURRENT_V_POS]
 .       \}
 .       el .PROCESS_SHIM
-.       if !\\n[#CALCULATE_ONLY] 'sp \\n[#SHIM]u
-.       rr #CURRENT_V_POS
+.    \}
+.    el .PROCESS_SHIM
+.    if !\\n[#CALCULATE_ONLY] 'sp \\n[#SHIM]u
+.    rr #CURRENT_V_POS
+.END
+\#
+.ALIAS SHIM_1 SHIM
+\#
+\# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+\#
+\# +++FLEX SPACING+++
+\#
+\# INSERT FLEX SPACE
+\# -----------------
+\# *Arguments:
+\#   FORCE
+\# *Function:
+\#   Inserts flexible whitespace ("flex-space").
+\# *Notes:
+\#   FORCE restores flex-spacing if an .ns is preventing it.
+\#   Useful in conjunction with deferred floated material that
+\#   plants an .ns after outputting the last deferred float.
+\#
+.MAC FLEX END
+.    if !\\n[#NO_SHIM] \{\
+.       if \\n[#NO_FLEX] \{\
+.          tm1 "[mom]: \
+FLEX, line \\n[.c], is incompatible with shimming, which is presently en=
abled.
+.          tm1 "       \
+Shimming must be disabled with NO_SHIM before using FLEX.
+.          ab   [mom]: Aborting '\\n[.F]', line \\n[.c].
+.       \}
+.    \}
+.    if '\\$1'FORCE' \{\
+.       nr flex:force 1
+.       return
+.    \}
+.    if !\\n[#NO_FLEX] \{\
+.       if !\\n[.ns] \{\
+.          if !\\n[.t]<=3D\\n[.v] \{\
+.             nr flex-spaces +1
+.             if dflex-space:\\n[flex]@\\n[#COL_NUM] \{\
+.                sp \\*[flex-space:\\n[flex]@\\n[#COL_NUM]]
+.             \}
+.          \}
+.       \}
+.    \}
+.END
+\#
+.MAC NO_FLEX END
+.    rr flexed
+.    ie '\\$1'' \{\
+.       nr #NO_FLEX 1
+.       if \\n[#FLEX_ACTIVE] .rr #FLEX_ACTIVE
+.    \}
+.    el .rr #NO_FLEX
+.END
+\#
+\# CALCULATE FLEX SPACES
+\# ---------------------
+\# *Function:
+\#   Derives flex-space size by dividing the space remaining before
+\#   FOOTER by the number of times FLEX was used on the page/col.
+\# *Notes:
+\#   .h is reliable for determining space remaining, but can't be used
+\#   for columns because it can't be zeroed from one col to the
+\#   next.  Workaround is to use nl for columns and compensate for
+\#   .br's, .sp's, and .ne's.  Here be dragons.
+\#
+.MAC CALCULATE_FLEX END
+.    nr flex:target-pos \\n[.p]+\\n[#VARIABLE_FOOTER_POS]-1
+.    nr flex:current-pos \\n[.h]-\\n[.v]
+.    if \\n[#COLUMNS] \{\
+.       ie \\n[.trunc] \
+.          nr flex:current-pos \\n[nl]-\\n[.v]-(\\n[.trunc]-1)
+.       el .nr flex:current-pos \\n[nl]-\\n[.v]
+.       if '\\n[.ev]'tbl*end' \{\
+.          nr flex:current-pos \\n[nl]-(\\n[.trunc]-1)
+.          if \\n[tbl*boxed] .nr flex:current-pos -.65v
+.       \}
+.       ie \\n[nl-from-heading] \{\
+.          nr flex:current-pos \\n[nl-from-heading]-\\n[.v]
+.          rr nl-from-heading
+.       \}
+.       el \{\
+.          if !\\n[.pe] \{\
+.             if \\n[nl]=3D(\\n[.p]+(\\n[#VARIABLE_FOOTER_POS]-1)) \
+.                nr flex-spaces -1
+.          \}
+.       \}
+.    \}
+.    nr flex:space-remaining \
+        \\n[flex:target-pos]-\\n[flex:current-pos]
+.    if \\n[flex-spaces] \{\
+.       nr flex-space:\\n[flex]@\\n[#COL_NUM] \
+           \\n[flex:space-remaining]/\\n[flex-spaces]
+.       if dPDF.EXPORT \{\
+.          tm .ds flex-space:\\n[flex]@\\n[#COL_NUM] \
+              \\n[flex-space:\\n[flex]@\\n[#COL_NUM]]u
+.\" For debugging: catch edge-cases that result in negative
+.\" flex-spacing and don't apply flex to the page/column.
+.          if \\n[flex-space:\\n[flex]@\\n[#COL_NUM]]<0 \{\
+.             tm .ds flex-space:\\n[flex]@\\n[#COL_NUM] 0
+.             tm .ds Negative flex space \\n%@\\n[#COL_NUM] (\\n[flex-sp=
ace:\\n[flex]@\\n[#COL_NUM]])
+.          \}
+.       \}
 .    \}
 .END
 \#
@@ -8740,9 +8908,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 .    if '\\*[POSITION]'L' .ds POSITION LEFT
 .    if '\\*[POSITION]'C' .ds POSITION CENTER
 .    if '\\*[POSITION]'R' .ds POSITION RIGHT
-.    if \\n[#HDRFTR_\\*[POSITION]_CAPS]=3D1 \{\
+.    if \\n[#HDRFTR_\\*[POSITION]_CAPS]=3D1 \
 .       CAPS_SMALLCAPS_WARNING \\*[POSITION]
-.    \}
 .    ie '\\$1'' .nr #HDRFTR_\\*[POSITION]_SMALLCAPS 1
 .    el \
 .       nr #HDRFTR_\\*[POSITION]_SMALLCAPS 0
@@ -8779,7 +8946,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 .       ds $HDRFTR_CENTER_OLD \\*[$HDRFTR_CENTER]
 .       ds $HDRFTR_CENTER_NEW \\$1
 .    \}
-.    ds $HDRFTR_CENTER \\$1
+.    ie '\\$1'TOC' .ds $TOC_HDRFTR_CENTER \\$2
+.    el .ds $HDRFTR_CENTER \\$1
 .END
 \#
 \# HDRFTR CENTER CAPS AND SMALLCAPS
@@ -8793,9 +8961,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 \#   Default is on.
 \#
 .MAC HDRFTR_CENTER_SMALLCAPS END
-.    if \\n[#HDRFTR_CENTER_SMALLCAPS]=3D1 \{\
+.    if \\n[#HDRFTR_CENTER_SMALLCAPS]=3D1 \
 .       CAPS_SMALLCAPS_WARNING CENTER
-.    \}
 .    ie '\\$1'' .nr #HDRFTR_CENTER_SMALLCAPS 1
 .    el \
 .       nr #HDRFTR_CENTER_SMALLCAPS 0
@@ -8875,9 +9042,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 \#   Default is on.
 \#
 .MAC HDRFTR_RIGHT_SMALLCAPS END
-.    if \\n[#HDRFTR_RIGHT_SMALLCAPS]=3D1 \{\
+.    if \\n[#HDRFTR_RIGHT_SMALLCAPS]=3D1 \
 .       CAPS_SMALLCAPS_WARNING RIGHT
-.    \}
 .    ie '\\$1'' .nr #HDRFTR_RIGHT_SMALLCAPS 1
 .    el \
 .       nr #HDRFTR_RIGHT_SMALLCAPS 0
@@ -9458,9 +9624,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 .       ie \\n[#HDRFTR_COLOR]=3D1 \m[\\*[$HDRFTR_COLOR]]
 .       el \m[black]
 .    \}
-.    if \\n[#HDRFTR_RULE] \{\
+.    if \\n[#HDRFTR_RULE] \
 .       HDRFTR_RULE_INTERNAL
-.    \}
 .END
 \#
 \# +++HEADERS+++
@@ -9513,19 +9678,17 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 \# *Arguments:
 \#   <none>
 \# *Function:
-\#   Prints header appropriate to DOC_TYPE, PRINTSTYLE, and COPYSTYLE.
-\# *Notes:
-\#   In order to convert the title string to caps in the header
-\#   (in the event that the user enters .TITLE in caps/lc), I've
-\#   used quad left, quad centre, and quad right to arrange the
-\#   three bits of the header, rather than .tl.  This allows the
-\#   use of the CAPS macro.  The downside is that I have to add
-\#   \\v'-(\\n[#LEAD]u*<n>) in order for -Tlatin1 output to align
-\#   the header/footer strings on the baseline.  The console output
-\#   still isn't brilliant, but at least it's comprehensible.
+\#   Resets margin notes, processes footnote and margin note
+\#   leftover, takes care of recto-verso, prepares for columns after
+\#   first, determines whether to flex-space the page,,outputs
+\#   deferred floats, and does some tbl magic.  If headers are
+\#   enabled, prints header appropriate to DOC_TYPE, PRINTSTYLE, and
+\#   COPYSTYLE.
 \#
 .MAC HEADER END
 .    vpt 0
+.    nr flex-spaces 0
+.    nr flex +1
 .    if \\n[#NEW_DOC_PT_SIZE] .nr #DOC_PT_SIZE \\n[#NEW_DOC_PT_SIZE]
 .    rr #NEW_DOC_PT_SIZE
 .    if \\n[#RESET_TRAPS] \{\
@@ -9541,6 +9704,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 .    if \\n[#FN_DEPTH] .PROCESS_FN_LEFTOVER
 .    rr #RULED
 .    if \\n[#RESET_FN_NUMBER] .nr #FN_NUMBER 0 1
+.    if !\\n[#DIVERTED] .rr #PREV_FN_DEFERRED
 .    po \\n[#DOC_L_MARGIN]u
 .    if \\n[#RECTO_VERSO] \{\
 .       if !\\n[#TOC_RV_SWITCH]=3D2 \{\
@@ -9586,9 +9750,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 .    sp -1v
 .    ie \\n[#HEADERS_ON] .PRINT_HDRFTR
 .    el \{\
-.       if \\n[#PAGE_NUM_V_POS]=3D1 \{\
+.       if \\n[#PAGE_NUM_V_POS]=3D1 \
 .          if \\n[#PAGINATE] .PRINT_PAGE_NUMBER
-.       \}
 .    \}
 .    sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
 .    if \\n[#PRINT_STYLE]=3D1 \{\
@@ -9717,12 +9880,36 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .    ch RR_@TOP
 .    ie \\n[tbl*have-header] .rr @TOP
 .    el .wh \\n[nl]u+1u RR_@TOP
+.    if \\n[#FLEX_ACTIVE] \{\
+.       if \\n[#RESTORE_FLEX] \{\
+.          rr #NO_FLEX
+.          rr #RESTORE_FLEX
+.       \}
+.       if \\n[#RESTORE_COL_FLEX] \{\
+.          rr #NO_FLEX
+.          rr #RESTORE_COL_FLEX
+.       \}
+.    \}
+.\"  Don't flex the last page/col, or the page/col before a COLLATE,
+.\"  NEWPAGE, COL_NEXT, or BLANKPAGE.
+.    if !dPDF.EXPORT \{\
+.       if \\n[#FLEX_ACTIVE] \
+.          if !\\n[#NO_FLEX] \
+.             nr #RESTORE_FLEX 1
+.       if '\\*[last-page]'\\n%@\\n[#COL_NUM]' \
+.          if !\\n[#NO_FLEX] .nr #NO_FLEX 1
+.       if '\\*[pre-collate-\\n%]'\\n%@\\n[#COL_NUM]' \
+.          if !\\n[#NO_FLEX] .nr #NO_FLEX 1
+.       if '\\*[pre-newpage-\\n%]'\\n%@\\n[#COL_NUM]' \
+.          if !\\n[#NO_FLEX] .nr #NO_FLEX 1
+.       if d page-\\n%@\\n[#COL_NUM] .nr #NO_FLEX 1
+.    \}
 .    ie \\n[defer] .PROCESS_FLOATS
 .    el \{\
 .       if \\n[tbl*have-caption] \{\
 .          RESTORE_SPACE
-.          ie \\n[#MLA] .sp \n[tbl*label-lead-diff]u
-.          el .sp \n[tbl*caption-lead-diff]u
+.          ie \\n[#MLA] .sp \\n[tbl*label-lead-diff]u
+.          el .sp \\n[tbl*caption-lead-diff]u
 .       \}
 .    \}
 .\" So tables without TH that don't fit don't overprint first row
@@ -9732,7 +9919,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM]=
 \\$\\n[#\\*[DOC_]COVERTITLE_
 .       nop \&
 .       vpt
 .       rr \\n[tbl*no-header]
-.       SHIM
+.       SHIM_1
 .    \}
 .    el .vpt
 .    if \\n[#NEWPAGE] .rr #NEWPAGE
@@ -9740,10 +9927,12 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .       tbl*print-header
 .       rr tbl*interrupted
 .      \}
-.    el .tbl@top-hook
+.    el .if !r tbl*no-top-hook .tbl@top-hook
+.    rr tbl*no-top-hook
 .    if \\n[#QUOTE]=3D1 \
 .       if '\\*[$Q_QUAD]'LEFT' .po \\n[#Q_OFFSET]u
 .    if \\n[#QUOTE]=3D2 .po \\n[#BQ_OFFSET]u
+.    if r flex:force .rr flex:force
 .END
 \#
 \# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
@@ -9807,13 +9996,16 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 \# *Arguments:
 \#   <none>
 \# *Function:
-\#   Places footer at bottom of page if #FOOTERS=3D1, otherwise
-\#   places page number at bottom of page (if #PAGINATE=3D1).
-\#   Page numbers are in arabic or roman according to COPYSTYLE.
-\#   DRAFT starts the document at page 1 regardless of PAGENUMBER.
-\#   FINAL respects PAGENUMBER.
+\#   Gathers strings for flex-spacing, processes margin notes and
+\#   footnotes, prepares for move to next column or page.  Places
+\#   footer at bottom of page if #FOOTERS=3D1, otherwise places page
+\#   number at bottom of page (if #PAGINATE=3D1).  Page numbers are
+\#   in arabic or roman according to COPYSTYLE.  DRAFT starts the
+\#   document at page 1 regardless of PAGENUMBER.  FINAL respects
+\#   PAGENUMBER.
 \#
 .MAC FOOTER END
+.    CALCULATE_FLEX
 .    if \\n[#DOING_COVERTEXT] \{\
 .       tm1 "[mom]: COVERTEXT exceeds cover page depth.
 .       ab   [mom]: Aborting '\\n[.F]'.
@@ -9822,7 +10014,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM=
] \\$\\n[#\\*[DOC_]COVERTITLE_
 .    rr #LB_4_HD
 .    rr #QUOTE_4_HD
 .    nr #SAVED_LEAD \\n[.v]
-.    ev PAGE_TRANSITION
+.    if !r pg-trans .nr pg-trans 0 1
+.    ev PAGE_TRANSITION\\n+[pg-trans]
 .    pdfmarksuspend
 .    ie !n .nop \X'ps: exec decornone'
 .    el .ul 0
@@ -9867,14 +10060,15 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_N=
UM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .             nr #FROM_FOOTER 1
 .          \}
 .          nf
+.          ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
 .          FOOTNOTES
 .          rm FOOTNOTES
-.          if d RUNON_FOOTNOTES    .rm RUNON_FOOTNOTES
+.          if d RUNON_FOOTNOTES   .rm RUNON_FOOTNOTES
 .          if \\n[#PRINT_STYLE]=3D1 .vs \\n[#SAVED_LEAD]u
 .          if \\n[#PRINT_STYLE]=3D2 .LS \\n[#SAVED_LEAD]u
 .          if '\\n[.z]'FN_OVERFLOW' \{\
-.              di
-.              nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
+.             di
+.             nr #FN_OVERFLOW_DEPTH \\n[#DIVER_DEPTH]
 .          \}
 .          nr #FN_COUNT_AT_FOOTER \\n[#FN_COUNT]
 .          nr #FN_COUNT 0
@@ -9887,7 +10081,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NUM=
] \\$\\n[#\\*[DOC_]COVERTITLE_
 .    \}
 .    nr @TOP 1
 .    ie \\n[#COLUMNS]=3D1 \{\
-.       ie \\n[#COL_NUM]=3D\\n[#NUM_COLS] .DO_FOOTER
+.       ie (\\n[#COL_NUM]=3D\\n[#NUM_COLS]):(\\n[#NEWPAGE]=3D1) .DO_FOOT=
ER
 .       el \{\
 .          ie (\\n[#ENDNOTES]=3D1):(\\n[#BIBLIOGRAPHY]=3D1) \{\
 .             if \\n[#ENDNOTES] .sp |\\n[ec]u-\\n[#EN_LEAD]u
@@ -9895,9 +10089,32 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .          \}
 .          el \{\
 .            vs \\n[#SAVED_LEAD]u
-.            sp |\\n[dc]u
+.            rt \\n[dc]u
+.            nr flex-spaces 0
+.          \}
+.          if d page-\\n%@\\n[#COL_NUM] \{\
+.             rr #NO_FLEX
+.             rr #RESTORE_COL_FLEX
 .          \}
 .          po \\n[#COL_\\n+[#COL_NUM]_L_MARGIN]u
+.          if !dPDF.EXPORT \{\
+.             if \\n[#FLEX_ACTIVE] \{\
+.                if !\\n[#NO_FLEX] \{\
+.                   if '\\*[last-page]'\\n%@\\n[#COL_NUM]' \
+.                       nr #NO_FLEX 1
+.                   if '\\*[pre-collate]'\\n%@\\n[#COL_NUM]' \
+.                       nr #NO_FLEX 1
+.                   if '\\*[pre-newpage-\\n%]'\\n%@\\n[#COL_NUM]' \{\
+.                      nr #NO_FLEX 1
+.                      nr #RESTORE_FLEX 1
+.                   \}
+.                   if d page-\\n%@\\n[#COL_NUM] \{\
+.                      nr #NO_FLEX 1
+.                      nr #RESTORE_COL_FLEX 1
+.                   \}
+.                \}
+.             \}
+.          \}
 .          nr #L_MARGIN \\n[.o]
 .          if \\n[#FN_DEPTH] .PROCESS_FN_LEFTOVER
 .          vs \\n[#SAVED_LEAD]u
@@ -9949,6 +10166,12 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .                po \\n[#EPI_OFFSET]u
 .             \}
 .          \}
+.          ie \\n[tbl*interrupted] \{\
+.             tbl*print-header
+.             rr tbl*interrupted
+.            \}
+.          el .if !r tbl*no-top-hook .tbl@top-hook
+.          rr tbl*no-top-hook
 .          ie \\n[#EPIGRAPH] \{\
 .             ie !\\n[#EPI_ACTIVE] \{\
 .                ns
@@ -9973,9 +10196,10 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .          nop \&
 .          vpt
 .          rr \\n[tbl*no-header]
-.          SHIM
+.          SHIM_1
 .       \}
 .       el .vpt
+.       if '\\n[.ev]'caption' .rs
 .       if \\n[tbl*interrupted] .tbl*print-header
 .       rr tbl*interrupted
 .    \}
@@ -10013,9 +10237,6 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .END
 \#
 .MAC PRINT_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.
 .    if r #SAVED_FOOTER_POS .ch FOOTER \\n[#SAVED_FOOTER_POS]u
 .    rr #SAVED_FOOTER_POS
 .    vpt 0
@@ -10025,7 +10246,6 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .       sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u
 .    el \
 .       sp |\\n[#PAGE_LENGTH]u-\\n[#FOOTER_MARGIN]u-\\n[#FOOTER_ADJ]u
-.    mk y
 .    UNDERLINE OFF
 .    po \\n[#DOC_L_MARGIN]u
 .    ll \\n[#DOC_L_LENGTH]u
@@ -10033,7 +10253,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .    if \\n[#PRINT_STYLE]=3D1 .TYPEWRITER
 .    if \\n[#PRINT_STYLE]=3D2 \{\
 .       fam  \\*[$HDRFTR_FAM]
-.       ft      R
+.       ft   R
 .       ps \\n[#DOC_PT_SIZE]u\\*[$HDRFTR_SIZE_CHANGE]
 .    \}
 .    nr #HDRFTR_PT_SIZE \\n[#PT_SIZE]
@@ -10187,6 +10407,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 \#   If PARAHEAD given, HEADING must come after PP.
 \#
 .MAC HEADING END
+.    br
 .    if !\B'\\$1' \{\
 .       tm1 "[mom]: The first argument to \\$0 must be a numeric heading=
 level.
 .       ab   [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
@@ -10212,18 +10433,18 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_=
NUM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .      \}
 .    \}
 .\" Spacing
-.    if \\n[#Q_LEAD_DIFF_CHECK] .sp -1v
-.    br
+.    if \\n[#Q_LEAD_DIFF_CHECK] .sp -1
+.    if \\n[.t]<\\n[.v] .nr nl-from-heading \\n[nl]
 .    ie !\\n[#PARAHEAD] \{\
 .       if !\\n[@TOP] \{\
 .          nr #HEAD 1
-.          mk \" .ne adds 1u so mark vertical position
-.          ie \\n[#HEAD_\\n[#LEVEL]_SPACE_AFTER] .ne \\n[#NUM_ARGS]+2
-.          el .ne \\n[#NUM_ARGS]+1
-.          rt
-.          vpt 0
-.          ie !\\n[#START] \
+.          ie !\\n[#START] \{\
+.             nr #HEADING_NEEDS \\n[#NUM_ARGS]v+\\*[$HEAD_\\n[#LEVEL]_NE=
EDS]+1v
+.             if \\n[#HEAD_\\n[#LEVEL]_SPACE_AFTER] .nr #HEADING_NEEDS +=
1v
+.             if \\n[.t]<\\n[#HEADING_NEEDS] .sp \\n[.t]u
+.             vpt 0
 .             if !\\n[#SPACE_ADDED] .if !\\n[#LINEBREAK] .sp
+.          \}
 .          el \{\
 .             ie !\\n[#PP] .rr #START
 .             el .sp
@@ -10233,8 +10454,17 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_N=
UM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .       \}
 .       if \\n[#PP_SPACE] \
 .          if \\n[#QUOTE_4_HD] .sp .5v
-.       if !\\n[#SPACE_ADDED] .SHIM
-.       if \\n[#SPACE_ADDED] .rr #SPACE_ADDED
+.       ie !\\n[#SPACE_ADDED] \{\
+.          if !\\n[.ns] \{\
+.             ie !\\n[#NO_SHIM] \
+.                if !\\n[#HEAD_\\n[#LEVEL]_NO_SHIM] .SHIM
+.             el \{\
+.                if !\\n[#NO_FLEX] \
+.                   if !\\n[#HEAD_\\n[#LEVEL]_NO_FLEX] .FLEX=20
+.             \}
+.          \}
+.       \}
+.       el .rr #SPACE_ADDED
 .       vpt
 .    \}
 .    el \{\
@@ -10570,9 +10800,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .       \}
 .       if !\\n[#HD_NUM_INDENT] .nr #HD_NUM_INDENT \w'\\*[$HD_NUM]'
 .    \}
-.    if !\\n[#PARAHEAD] \{\
+.    if !\\n[#PARAHEAD] \
 .       if \\n[#HEAD_\\n[#LEVEL]_SPACE_AFTER] .sp
-.    \}
 .    if \\n[#CAPS_OFF] \{\
 .       CAPS OFF
 .       rr #CAPS_OFF
@@ -10605,6 +10834,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .       sp -1
 .    \}
 .    vpt
+.    rr nl-from-heading
 .END
 \#
 \# HEADING_STYLE
@@ -10670,7 +10900,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .             tm1 "[mom]: The UNDERSCORE argument to \\$0 requires a rul=
e gap.
 .             ab   [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
 .          \}
-.          ds $HEAD_\\n[#LEVEL]_UL_GAP    \\$1
+.          ds $HEAD_\\n[#LEVEL]_UL_GAP \\$1
 .          shift
 .       \}
 .       if '\\$1'NO_UNDERSCORE' \{\
@@ -10690,7 +10920,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .             tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires a ru=
le gap.
 .             ab   [mom]: Aborting '\\n[.F]' at \\$0, line \\n[.c].
 .          \}
-.          ds $HEAD_\\n[#LEVEL]_UL2_GAP_1  \\$1
+.          ds $HEAD_\\n[#LEVEL]_UL2_GAP_1 \\$1
 .          shift
 .          if '\\$1'' \{\
 .             tm1 "[mom]: The UNDERSCORE2 argument to \\$0 requires an i=
nter-rule gap.
@@ -10778,6 +11008,27 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_N=
UM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .          nr #FROM_STYLE_\\n[#LEVEL] 1
 .          shift
 .       \}
+.       if '\\$1'NEEDS' \{\
+.          shift
+.          ds $HEAD_\\n[#LEVEL]_NEEDS \\$1
+.          shift
+.       \}
+.       if '\\$1'SHIM' \{\
+.          rr #HEAD_\\n[#LEVEL]_NO_SHIM
+.          shift
+.       \}
+.       if '\\$1'NO_SHIM' \{\
+.          nr #HEAD_\\n[#LEVEL]_NO_SHIM 1
+.          shift
+.       \}
+.       if '\\$1'FLEX' \{\
+.          rr #HEAD_\\n[#LEVEL]_NO_FLEX
+.          shift
+.       \}
+.       if '\\$1'NO_FLEX' \{\
+.          nr #HEAD_\\n[#LEVEL]_NO_FLEX 1
+.          shift
+.       \}
 .    \}
 .    rr #LEVEL
 .    if d$TOC .rm $TOC
@@ -11120,9 +11371,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 \#   PRINTSTYLE TYPEWRITE without SINGLESPACE.
 \#
 .MAC PARA_SPACE END
-.    ie '\\$1'' \{\
+.    ie '\\$1'' \
 .       nr #PP_SPACE 1
-.    \}
 .    el \{\
 .       ie \B'\\$1' \{\
 .          nr #PP_SPACE 1
@@ -11145,16 +11395,12 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_=
NUM] \\$\\n[#\\*[DOC_]COVERTITLE_
 \#   PP_STYLE 1 =3D regular paras; 2 =3D blockquotes, epigraphs
 \#
 .MAC PP END
-.    br
 .    if \\n[#COVERTEXT_PP] \{\
 .       ie \\n[#INDENT_ACTIVE] .ti \\n[#INDENT]u+\\n[#PP_INDENT]u
 .       el .ti \\n[#PP_INDENT]u
 .       return
 .    \}
-.    if \\n[defer-pp-ind-reset] \{\
-.       sp -1
-.       rr defer-pp-ind-reset
-.    \}
+.    br
 .    if \\n[#DOC_TYPE]=3D4 \{\
 .       if !'\\n[.z]'' .di
 .       nr #TOTAL_FIELDS \\n[#FIELD]
@@ -11196,9 +11442,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .          ie \\n[#ENDNOTE] .vs \\n[#EN_LEAD]u
 .          el .vs \\n[#DOC_LEAD]u
 .          QUAD \\*[$DOC_QUAD]
-.          if \\n[#SLANT_ON] \{\
+.          if \\n[#SLANT_ON] \
 .             if \\n[#UNDERLINE_SLANT] .UNDERLINE
-.          \}
 .          if '\\*[$PP_FT]'I' \
 .             if \\n[#ITALIC_MEANS_ITALIC] .FT I
 .       \}
@@ -11243,7 +11488,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .       el \{\
 .          if \\n[#PP_SPACE] \{\
 .             ie \\n[#END_QUOTE] \{\
-.                ie !'\\*[$PP_SPACE_AMOUNT]'' .ALD \\*[$PP_SPACE_AMOUNT]
+.                ie !'\\*[$PP_SPACE_AMOUNT]'' .sp \\*[$PP_SPACE_AMOUNT]
 .                el .sp
 .                rr #END_QUOTE
 .                nr #NO_SPACE 1
@@ -11251,8 +11496,15 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_N=
UM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .             \}
 .             el \{\
 .                if \\n[#NO_SPACE]=3D1 .rr #NO_SPACE
+.                if \\n[post-float] \{\
+.                   if (\\n[.t]-1)<\\*[$PP_SPACE_AMOUNT] \{\
+.                      ie \\n[#COLS] .COL_NEXT
+.                      el .NEWPAGE
+.                   \}
+.                   rr post-float
+.                \}
 .                if !\\n[nl]=3D\\n[#BASELINE_MARK] \{\
-.                   ie !'\\*[$PP_SPACE_AMOUNT]'' .ALD \\*[$PP_SPACE_AMOU=
NT]
+.                   ie !'\\*[$PP_SPACE_AMOUNT]'' .sp \\*[$PP_SPACE_AMOUN=
T]
 .                   el .sp
 .                   rr #BASELINE_MARK
 .                \}
@@ -11786,8 +12038,8 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .    REMOVE_INDENT
 .    ev
 .    nr #Q_LEAD_DIFF \\n[#LEAD]-\\n[#\\*[BQ]_LEAD_REAL]
-.    if !'\\n[.z]'FLOAT*DIV' \{\
-.       if !\\n[#NO_SHIM] \{\
+.    if !\\n[#NO_SHIM] \{\
+.       if !'\\n[.z]'FLOAT*DIV' \{\
 .          br
 .          nr #CALCULATE_ONLY 1
 .          nr #CURRENT_V_POS \\n[nl]+\\n[#Q_DEPTH]
@@ -11820,20 +12072,22 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_=
NUM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .          \}
 .       \}
 .       el \{\
-.          ie \\n[#Q_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
-.             ie ((\\n[#TRAP_DISTANCE]-1)-\\n[#Q_DEPTH])<\\n[#DOC_LEAD] =
\{\
-.                ie !\\n[in-cutaround] .Q_NOFIT
-.                el .Q_FITS
-.             \}
-.             el \{\
-.                ie (\\n[#TRAP_DISTANCE]-\\n[#DOC_LEAD])<\\n[#DOC_LEAD] =
.Q_NOFIT
-.                el \{\
-.                   ie (\\n[#Q_DEPTH]+\\n[.v])=3D(\\n[#TRAP_DISTANCE]-1)=
 .Q_NOFIT
+.          if !\\n[nl]=3D\\n[#PAGE_TOP] \{\
+.             ie \\n[#Q_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
+.                ie ((\\n[#TRAP_DISTANCE]-1)-\\n[#Q_DEPTH])<\\n[#DOC_LEA=
D] \{\
+.                   ie !\\n[in-cutaround] .Q_NOFIT
 .                   el .Q_FITS
 .                \}
+.                el \{\
+.                   ie (\\n[#TRAP_DISTANCE]-\\n[#DOC_LEAD])<\\n[#DOC_LEA=
D] .Q_NOFIT
+.                   el \{\
+.                      ie (\\n[#Q_DEPTH]+\\n[.v])=3D(\\n[#TRAP_DISTANCE]=
-1) .Q_NOFIT
+.                      el .Q_FITS
+.                   \}
+.                \}
 .             \}
+.             el .Q_NOFIT
 .          \}
-.          el .Q_NOFIT
 .       \}
 .       if \\n[#LINEBREAK] \{\
 .          vpt 0
@@ -11875,12 +12129,15 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_=
NUM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .       el .in +\\*[$\\*[BQ]_OFFSET_VALUE]
 .    \}
 .    ie \\n[#START]=3D1 \{\
-.       ie !\\n[#Q_LEAD_DIFF]<0 .ALD \\n[#Q_SPACE_EQ]u
+.       ie !\\n[#Q_LEAD_DIFF]<0 \
+.          if !\\n[#NO_SHIM] .sp \\n[#Q_SPACE_EQ]u
 .       el .RLD 0-\\n[#Q_LEAD_DIFF]u
 .    \}
 .    el \{\
 .       if \\n[#PRINT_STYLE]=3D2 \
-.          ALD \\n[#Q_SPACE_EQ]u+(\\n[#Q_LEAD_DIFF]u/2u)
+.          ie !\\n[#NO_SHIM] \
+.             sp \\n[#Q_SPACE_EQ]u+(\\n[#Q_LEAD_DIFF]u/2u)
+.          el .if !\\n[#NO_FLEX] .FLEX
 .    \}
 .    if \\n[#QUOTE]=3D1 \{\
 .       if !'\\*[$Q_SPACE_ADJUST]'' .sp +\\*[$Q_SPACE_ADJUST]
@@ -11911,61 +12168,71 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_=
NUM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .          rr reset-ll
 .       \}
 .    \}
-.    if \\n[#NO_SHIM]=3D1 \{\
-.       nr #RESTORE_NO_SHIM 1
-.       rr #NO_SHIM
-.    \}
-.if !'\\n[.z]'FLOAT*DIV' \{\
-.    if \\n[#PRINT_STYLE]=3D1 \
-.       if !\\n[.v]=3D\\n[#DOC_LEAD] .SHIM
-.    if \\n[#PRINT_STYLE]=3D2 \{\
-.       ie \\n[#START] \{\
-.          ie \\n[#PP_SPACE] .
-.          el \{\
-.             ALD \\n[#DOC_LEAD]u
-.             SHIM
+.    if !'\\n[.z]'FLOAT*DIV' \{\
+.       if \\n[#PRINT_STYLE]=3D1 \
+.          if !\\n[.v]=3D\\n[#DOC_LEAD] \{\
+.             ie !\\n[#NO_SHIM] .SHIM
+.             el \
+.                if !\\n[#NO_FLEX] .FLEX
 .          \}
-.       \}
-.       el \{\
-.          ie \\n[#HEAD]=3D1 \{\
-.             ALD \\n[#DOC_LEAD]u
-.             SHIM
+.       if \\n[#PRINT_STYLE]=3D2 \{\
+.          ie \\n[#START] \{\
+.             ie \\n[#PP_SPACE] .
+.             el \{\
+.                sp \\n[#DOC_LEAD]u
+.                ie !\\n[#NO_SHIM] .SHIM
+.                el \
+.                   if !\\n[#NO_FLEX] .FLEX
+.             \}
 .          \}
 .          el \{\
-.             ie \\n[#FULLSPACE_QUOTES] \{\
-.                ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u
-.                el !'\\n[.z]'FLOAT*DIV' .ALD \\n[#DOC_LEAD]u
+.             ie \\n[#HEAD]=3D1 \{\
+.                sp \\n[#DOC_LEAD]u
+.                ie !\\n[#NO_SHIM] .SHIM
+.                el \
+.                   if !\\n[#NO_FLEX] .FLEX
 .             \}
-.             el \
-.                if !'\\n[.z]'FLOAT*DIV' .ALD \\n[#DOC_LEAD]u/2u
-.             ie \\n[#Q_FITS] \{\
-.                ie (\\n[#Q_TOP]=3D\\n[#PAGE_TOP]):(\\n[@TOP]=3D1) \{\
-.                   if \\n[has-label] .sp \\n[#DOC_LEAD]u/2u
-.                   if !'\\n[.z]'FLOAT*DIV' \{\
-.                      nr #Q_AT_TOP 1
-.                      nr #DELAY_SHIM 1
+.             el \{\
+.                ie \\n[#FULLSPACE_QUOTES] \{\
+.                   ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u
+.                   el !'\\n[.z]'FLOAT*DIV' .ALD \\n[#DOC_LEAD]u
+.                \}
+.                el \
+.                   if !'\\n[.z]'FLOAT*DIV' .ALD \\n[#DOC_LEAD]u/2u
+.                ie \\n[#Q_FITS] \{\
+.                   ie (\\n[#Q_TOP]=3D\\n[#PAGE_TOP]):(\\n[@TOP]=3D1) \{=
\
+.                      if \\n[has-label] .sp \\n[#DOC_LEAD]u/2u
+.                      if !'\\n[.z]'FLOAT*DIV' \{\
+.                         nr #Q_AT_TOP 1
+.                         nr #DELAY_SHIM 1
+.                      \}
+.                   \}
+.                   el \{\
+.                      ie !\\n[#NO_SHIM] .SHIM
+.                      el \
+.                         if !\\n[#NO_FLEX] .FLEX
 .                   \}
 .                \}
-.                el .SHIM
-.             \}
-.             el \{\
-.                SHIM
+.                el \{\
+.                   if !\\n[#NO_SHIM] .SHIM
+.                   el \
+.                      if !\\n[#NO_FLEX] .FLEX
 .\" Make sure that Q_LEAD_DIFF is not added to the first line of
 .\" normal text at the top of any page following output of a quote
 .\" whose last line falls on B_MARGIN of the previous page.
-.                if \\n[#Q_LEAD_DIFF] \{\
-.                   if \\n[nl]=3D(\\n[#T_MARGIN]-\\n[#DOC_LEAD]+\\n[#Q_L=
EAD_DIFF]) \{\
-.                      PRINT \&
-.                      br
-.                      sp -1v-\\n[#Q_LEAD_DIFF]u
-.                      nr #Q_LEAD_DIFF_CHECK 1
+.                   if \\n[#Q_LEAD_DIFF] \{\
+.                      if \\n[nl]=3D(\\n[#T_MARGIN]-\\n[#DOC_LEAD]+\\n[#=
Q_LEAD_DIFF]) \{\
+.                         PRINT \&
+.                         br
+.                         sp -1v-\\n[#Q_LEAD_DIFF]u
+.                         nr #Q_LEAD_DIFF_CHECK 1
+.                      \}
 .                   \}
 .                \}
 .             \}
 .          \}
 .       \}
 .    \}
-.\}
 .    if \\n[#RESTORE_NO_SHIM] .nr #NO_SHIM 1
 .    rr #Q_SPACE_EQ
 .    if \\n[#LINENUMBERS]=3D2 \{\
@@ -12004,7 +12271,9 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .    ie !\\n[#ENDNOTE] .QUAD \\*[$DOC_QUAD]
 .    el .QUAD \\*[EN_QUAD]
 .    if r #DELAY_SHIM \{\
-.       SHIM
+.       ie !\\n[#NO_SHIM] .SHIM
+.       el \
+.          if !\\n[#NO_FLEX] .FLEX
 .       rr #DELAY_SHIM
 .    \}
 .    if \\n[#PRINT_STYLE]=3D1 \
@@ -12052,12 +12321,12 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_=
NUM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .          \}
 .       \}
 .       if \\n[#DIVER_FN]=3D2 .rr #DIVER_FN
+.       if !\\n[#NO_FLEX] .FLEX
 .    \}
 .    rm $QUOTE_TYPE
 .END
 \#
 .MAC Q_NOFIT END
-.if r foo .ab
 .    rr #Q_FITS
 .    if \\n[#QUOTE]=3D1 \{\
 .       ds $QUOTE_TYPE Q
@@ -12074,8 +12343,9 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 \\n[#DOC_LEAD]+(\\n[#DOC_LEAD]/4)\
 +\\n[#\\*[QUOTE_TYPE]_LEAD] \{\
 .          tm1 "[mom]: Insufficient room for caption and at least one li=
ne of \\*[quote-type]
-.          tm1 "       on page \\n[%] (line \\n[.c]).  Moving quote to n=
ext page.
-.          NEWPAGE
+.          tm1 "       on page \\n[%] (line \\n[.c]).  Moving quote to n=
ext page or column.
+.          ie \\n[#COLUMNS] .COL_NEXT
+.          el .NEWPAGE
 .       \}
 .    \}
 .    ie r#HEAD \
@@ -12084,11 +12354,11 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_=
NUM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .       if \\n[#Q_DEPTH]=3D0 \
 .          if \\n[.ns] .rs
 .       ie \\n[#FULLSPACE_QUOTES] \{\
-.          ie \\n[#ENDNOTE] .ALD \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u
-.          el .ALD \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u
+.          ie \\n[#ENDNOTE] .sp \\n[#EN_LEAD]u+\\n[#Q_LEAD_DIFF]u
+.          el .sp \\n[#DOC_LEAD]u+\\n[#Q_LEAD_DIFF]u
 .       \}
 .       el \{\
-.          ALD \\n[#DOC_LEAD]u
+.          sp \\n[#DOC_LEAD]u
 .          if \\n[@TOP] .rs
 .       \}
 .       ie \\n[#Q_LEAD_REAL] \
@@ -12097,9 +12367,11 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_N=
UM] \\$\\n[#\\*[DOC_]COVERTITLE_
 .       while \\n+[#Q_PARTIAL_DEPTH]<(\\n[#TRAP_DISTANCE]-1) \{\
 .
 .       \}
-.       ie \\n[#Q_LEAD_REAL] \
-.          nr #Q_PARTIAL_DEPTH -\\n[#Q_LEAD_REAL]
-.       el .nr #Q_PARTIAL_DEPTH -\\n[#BQ_LEAD_REAL]
+.       if !\\n[#Q_LEAD_REAL]=3D\\n[#DOC_LEAD] \{\
+.          ie \\n[#Q_LEAD_REAL] \
+.             nr #Q_PARTIAL_DEPTH -\\n[#Q_LEAD_REAL]
+.          el .nr #Q_PARTIAL_DEPTH -\\n[#BQ_LEAD_REAL]
+.       \}
 .       nr #Q_SPACE_EQ \
 (\\n[#TRAP_DISTANCE]-1)-\\n[#Q_PARTIAL_DEPTH]+(\\n[#Q_LEAD_DIFF]u/2u)
 .       if \\n[#FN_COUNT]>0 .nr #Q_SPACE_EQ (\\n[#Q_SPACE_EQ] / 2u)
@@ -12133,6 +12405,7 @@ $\\*[DOC_]COVERTITLE_\\n+[#\\*[DOC_]COVERTITLE_NU=
M] \\$\\n[#\\*[DOC_]COVERTITLE_
 .    ie '\\$1'' .nr #PAGINATE 1
 .    el \{\
 .      nr #PAGINATE 0
+.      rr #PAGE_NUM_V_POS
 .    \}
 .    if \\n[#HF_OFF]=3D1 \{\
 .       rr #PAGINATION_STATE
@@ -12605,6 +12878,19 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    el .rm $FN_SPACE
 .END
 \#
+\# FOOTNOTE FIRST LINE INDENT
+\# --------------------------
+\# *Arguments:
+\#   <indent>
+\# *Function:
+\#   Indents first line of footnotes.
+\# *Notes:
+\#   Default is no indent.
+\#
+.MAC FOOTNOTE_INDENT END
+. nr #FN_INDENT \\$1
+.END
+\#
 \# RUN ON FOOTNOTES
 \# ----------------
 \# *Arguments:
@@ -12951,9 +13237,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .\" FN_IN_DIVER is output into FOOTNOTE in PROCESS_FN_IN_DIVER).
 .          if !\\n[#DONT_RULE_ME]=3D1 \{\
 .             if !\\n[#FN_DEPTH] \{\
-.                if \\n[#PRINT_STYLE]=3D1 \{\
+.                if \\n[#PRINT_STYLE]=3D1 \
 .                   if !\\n[#RUN_ON] .sp \\n[#DOC_LEAD]u
-.                \}
 .                ie \\n[#FN_RULE]=3D1 \{\
 .                   if !\\n[#RUN_ON] \{\
 .                      if \\n[#SINGLE_SPACE] .sp \\n[#DOC_LEAD]u
@@ -12971,9 +13256,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       SS 0
 .\" Add footnote markers to footnote text...
 .       ie \\n[#FN_MARKERS] \{\
-.          if !'\\*[$FN_SPACE]'' \{\
+.          if !'\\*[$FN_SPACE]'' \
 .             if \\n[#FN_COUNT]>0 .ALD \\*[$FN_SPACE]
-.          \}
 .          if !\\n[#NO_FN_MARKER] \{\
 .\" ...but not if TERMINATE has been called.
 .             if !r#TERMINATE \{\
@@ -12984,36 +13268,35 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .                if \\n[#FN_MARKER_STYLE]=3D1 \{\
 .                   ie \\n[#COLUMNS]=3D1 \{\
 .                      \\n+[#FN_COUNT_FOR_COLS]
-.                      if \\n[#FN_COUNT_FOR_COLS]=3D1 .PRINT *\c
-.                      if \\n[#FN_COUNT_FOR_COLS]=3D2 .PRINT \[dg]\c
-.                      if \\n[#FN_COUNT_FOR_COLS]=3D3 .PRINT \[dd]\c
-.                      if \\n[#FN_COUNT_FOR_COLS]=3D4 .PRINT **\c
-.                      if \\n[#FN_COUNT_FOR_COLS]=3D5 .PRINT \[dg]\[dg]\=
c
-.                      if \\n[#FN_COUNT_FOR_COLS]=3D6 .PRINT \[dd]\[dd]\=
c
-.                      if \\n[#FN_COUNT_FOR_COLS]=3D7 .PRINT ***\c
-.                      if \\n[#FN_COUNT_FOR_COLS]=3D8 .PRINT \[dg]\[dg]\=
[dg]\c
-.                      if \\n[#FN_COUNT_FOR_COLS]=3D9 .PRINT \[dd]\[dd]\=
[dd]\c
-.                      if \\n[#FN_COUNT_FOR_COLS]=3D10 .PRINT ****\c
+.                      if \\n[#FN_COUNT_FOR_COLS]=3D1 .PRINT \h'0+\\n[#F=
N_INDENT]u'*\c
+.                      if \\n[#FN_COUNT_FOR_COLS]=3D2 .PRINT \h'0+\\n[#F=
N_INDENT]u'\[dg]\c
+.                      if \\n[#FN_COUNT_FOR_COLS]=3D3 .PRINT \h'0+\\n[#F=
N_INDENT]u'\[dd]\c
+.                      if \\n[#FN_COUNT_FOR_COLS]=3D4 .PRINT \h'0+\\n[#F=
N_INDENT]u'**\c
+.                      if \\n[#FN_COUNT_FOR_COLS]=3D5 .PRINT \h'0+\\n[#F=
N_INDENT]u'\[dg]\[dg]\c
+.                      if \\n[#FN_COUNT_FOR_COLS]=3D6 .PRINT \h'0+\\n[#F=
N_INDENT]u'\[dd]\[dd]\c
+.                      if \\n[#FN_COUNT_FOR_COLS]=3D7 .PRINT \h'0+\\n[#F=
N_INDENT]u'***\c
+.                      if \\n[#FN_COUNT_FOR_COLS]=3D8 .PRINT \h'0+\\n[#F=
N_INDENT]u'\[dg]\[dg]\[dg]\c
+.                      if \\n[#FN_COUNT_FOR_COLS]=3D9 .PRINT \h'0+\\n[#F=
N_INDENT]u'\[dd]\[dd]\[dd]\c
+.                      if \\n[#FN_COUNT_FOR_COLS]=3D10 .PRINT \h'0+\\n[#=
FN_INDENT]u'****\c
 .                   \}
 .                   el \{\
-.                      if \\n[#FN_COUNT]=3D1 .PRINT *\c
-.                      if \\n[#FN_COUNT]=3D2 .PRINT \[dg]\c
-.                      if \\n[#FN_COUNT]=3D3 .PRINT \[dd]\c
-.                      if \\n[#FN_COUNT]=3D4 .PRINT **\c
-.                      if \\n[#FN_COUNT]=3D5 .PRINT \[dg]\[dg]\c
-.                      if \\n[#FN_COUNT]=3D6 .PRINT \[dd]\[dd]\c
-.                      if \\n[#FN_COUNT]=3D7 .PRINT ***\c
-.                      if \\n[#FN_COUNT]=3D8 .PRINT \[dg]\[dg]\[dg]\c
-.                      if \\n[#FN_COUNT]=3D9 .PRINT \[dd]\[dd]\[dd]\c
-.                      if \\n[#FN_COUNT]=3D10 .PRINT ****\c
+.                      if \\n[#FN_COUNT]=3D1 .PRINT \h'0+\\n[#FN_INDENT]=
u'*\c
+.                      if \\n[#FN_COUNT]=3D2 .PRINT \h'0+\\n[#FN_INDENT]=
u'\[dg]\c
+.                      if \\n[#FN_COUNT]=3D3 .PRINT \h'0+\\n[#FN_INDENT]=
u'\[dd]\c
+.                      if \\n[#FN_COUNT]=3D4 .PRINT \h'0+\\n[#FN_INDENT]=
u'**\c
+.                      if \\n[#FN_COUNT]=3D5 .PRINT \h'0+\\n[#FN_INDENT]=
u'\[dg]\[dg]\c
+.                      if \\n[#FN_COUNT]=3D6 .PRINT \h'0+\\n[#FN_INDENT]=
u'\[dd]\[dd]\c
+.                      if \\n[#FN_COUNT]=3D7 .PRINT \h'0+\\n[#FN_INDENT]=
u'***\c
+.                      if \\n[#FN_COUNT]=3D8 .PRINT \h'0+\\n[#FN_INDENT]=
u'\[dg]\[dg]\[dg]\c
+.                      if \\n[#FN_COUNT]=3D9 .PRINT \h'0+\\n[#FN_INDENT]=
u'\[dd]\[dd]\[dd]\c
+.                      if \\n[#FN_COUNT]=3D10 .PRINT \h'0+\\n[#FN_INDENT=
]u'****\c
 .                   \}
 .                \}
 .                if \\n[#FN_MARKER_STYLE]=3D2 \{\
 .                   ds $FN_NUMBER \\n[#FN_NUMBER]
 .                   length #FN_NUMBER_LENGTH \\*[$FN_NUMBER]
-.                   if \\n[#COLUMNS]=3D1 \{\
+.                   if \\n[#COLUMNS]=3D1 \
 .                      \\n+[#FN_COUNT_FOR_COLS]
-.                   \}
 .                   if \\n[#NOT_YET_ADJUSTED]=3D1 \{\
 .                      nr #FN_NUMBER 1 1
 .                      rr #NOT_YET_ADJUSTED
@@ -13021,24 +13304,24 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .                   if \\n[#PRINT_STYLE]=3D1 \{\
 .                      ie \\n[#NO_SUPERSCRIPT] \{\
 .                         ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACE=
HOLDERS] \
-.                            PRINT "\0(\\n[#FN_NUMBER])\|\c"
+.                            PRINT "\h'0+\\n[#FN_INDENT]u'\0(\\n[#FN_NUM=
BER])\|\c"
 .                         el \
-.                            PRINT "(\\n[#FN_NUMBER])\|\c"
+.                            PRINT "\h'0+\\n[#FN_INDENT]u'(\\n[#FN_NUMBE=
R])\|\c"
 .                      \}
 .                      el \{\
 .                         ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACE=
HOLDERS] \
 .                            PRINT \
-"\s-2\v'-\\n[.v]u/5u'\0\\n[#FN_NUMBER]\|\v'+\\n[.v]u/5u'\s+2\|\c"
+"\h'0+\\n[#FN_INDENT]u'\s-2\v'-\\n[.v]u/5u'\0\\n[#FN_NUMBER]\|\v'+\\n[.v=
]u/5u'\s+2\|\c"
 .                         el \
 .                            PRINT \
-"\s-2\v'-\\n[.v]u/5u'\\n[#FN_NUMBER]\|\v'+\\n[.v]u/5u'\s+2\|\c"
+"\h'0+\\n[#FN_INDENT]u'\s-2\v'-\\n[.v]u/5u'\\n[#FN_NUMBER]\|\v'+\\n[.v]u=
/5u'\s+2\|\c"
 .                      \}
 .                   \}
 .                   if \\n[#PRINT_STYLE]=3D2 \{\
 .                      ie \\n[#FN_NUMBER_LENGTH]<\\n[#FN_NUMBER_PLACEHOL=
DERS] \
-.                         PRINT "\*[SUP]\0\\n[#FN_NUMBER]\*[SUPX]\*[FU 3=
]\c"
+.                         PRINT "\h'0+\\n[#FN_INDENT]u'\*[SUP]\0\\n[#FN_=
NUMBER]\*[SUPX]\*[FU 3]\c"
 .                      el \
-.                         PRINT "\*[SUP]\\n[#FN_NUMBER]\*[SUPX]\*[FU 3]\=
c"
+.                         PRINT "\h'0+\\n[#FN_INDENT]u'\*[SUP]\\n[#FN_NU=
MBER]\*[SUPX]\*[FU 3]\c"
 .                   \}
 .                \}
 .             \}
@@ -13053,11 +13336,11 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .             \}
 .             if \\n[#REF]=3D1 \{\
 .                if !\\n[#RUN_ON]=3D1 \{\
-\!.                 ti +\\n[#REF_FN_INDENT]u
+\!.                 ti +\\n[#REF_FN_INDENT]uu
 .                \}
 .             \}
 .             ie \\n[#FN_LN_BRACKETS]=3D1 \{\
-.                ds $FN_LINENUMBER \v'-.085m'\\*[$FN_OPEN_BRACKET]\v'.08=
5m'
+.                ds $FN_LINENUMBER \h'0+\\n[#FN_INDENT]u'\v'-.085m'\\*[$=
FN_OPEN_BRACKET]\v'.085m'
 .                ie \\n[#FN_MARK_2]=3D\\n[#FN_MARK] \
 .                   as $FN_LINENUMBER \
 \\n[#FN_MARK]\v'-.085m'\\*[$FN_CLOSE_BRACKET]\v'.085m'\h'.25m'
@@ -13071,14 +13354,13 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .                   ds $FN_LINENUMBER \\n[#FN_MARK]\\*[$FN_LN_SEP]
 .                el \
 .                   ds $FN_LINENUMBER \
-\\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\\*[$FN_LN_SEP]
+\h'0+\\n[#FN_INDENT]u'\\n[#FN_MARK]\v'-.1m'-\v'.1m'\\n[#FN_MARK_2]\\*[$F=
N_LN_SEP]
 .                \}
 .             \}
-.             if !\\n[#NO_FN_MARKER] \
-.                PRINT \\*[$FN_LINENUMBER]\c
-.             rm $FN_LINENUMBER
-.             nr #FN_MARK 0
-.          \}
+.          if !\\n[#NO_FN_MARKER] \
+.             PRINT \\*[$FN_LINENUMBER]\c
+.          rm $FN_LINENUMBER
+.          nr #FN_MARK 0
 .       \}
 .    \}
 .    el \{\
@@ -13280,9 +13562,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .                         nr #VARIABLE_FOOTER_POS -\\n[#VFP_DIFF]
 .                         if \\n[#DIVERTED]=3D1 .nr #DIVERTED 3
 .                         if !\\n[#PREV_FN_DEFERRED]=3D1 \{\
-.                            ie \\n[#COLUMNS]=3D1 \{\
+.                            ie \\n[#COLUMNS]=3D1 \
 .                               if !\\n[#FROM_FOOTER] .
-.                            \}
 .                            el .nr #FN_DEPTH -\\n[#VFP_DIFF]
 .                         \}
 .                         if \\n[#DIVERTED]=3D3 \{\
@@ -13466,7 +13747,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .\" 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
+.    nr #FROM_DIVERT_FN 1
 .END
 \#
 \# PROCESS_FN_LEFTOVER is called at the top of HEADER, and in
@@ -13485,7 +13766,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
 .    \}
 .    el \{\
-.       if \\n[#FN_DEFER]=3D1 .nr #VARIABLE_FOOTER_POS -\\n[#FN_DEPTH]
+.       if \\n[#FN_DEFER]=3D1 .nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
 .       if \\n[#FN_DEFER]=3D2 \{\
 .          nr #FN_DEPTH 0
 .          nr #VARIABLE_FOOTER_POS 0-\\n[#B_MARGIN]
@@ -13495,14 +13776,16 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    ch FOOTER -\\n[#B_MARGIN]u
 .    if \\n[#FN_DEFER] \{\
 .       nr #NO_FN_MARKER 1
+.       rn FOOTNOTES DEFERRED-FOOTNOTE
+.       nr #FN_DEPTH 0
 .       FOOTNOTE
 .       nf
+.       DEFERRED-FOOTNOTE
 .       FOOTNOTE OFF
 .       ie \\n[#COLUMNS]=3D1 \{\
 .          if \\n[#COL_NUM]=3D\\n[#NUM_COLS] \{\
-.             if !\\n[#FROM_FOOTER] \{\
+.             if !\\n[#FROM_FOOTER] \
 .                if \\n[#FN_COUNT_FOR_COLS]=3D1 .nr #PREV_FN_DEFERRED 1
-.             \}
 .          \}
 .       \}
 .       el .nr #PREV_FN_DEFERRED 1
@@ -14077,9 +14360,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .             if '\\*[$EN_TITLE_QUAD]'RIGHT'  .RIGHT
 \!.           vpt 0
 .             sp -.25v
-.             ie \\n[#EN_TITLE_UNDERLINE] \{\
+.             ie \\n[#EN_TITLE_UNDERLINE] \
 .                UNDERSCORE "\\*[$EN_TITLE]"
-.             \}
 .             el \{\
 .                ie \\n[#PRINT_STYLE]=3D1 \
 .                   UNDERSCORE "\\*[$EN_TITLE]"
@@ -14283,8 +14565,6 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       NUMBER_LINES RESUME
 .       nr #LINENUMBERS 1
 .    \}
-.
-.    PRINT_FOOTER
 .    rr #ENDNOTES
 .END
 \#
@@ -14401,9 +14681,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       if \\n[#\\*[EN-OR-BIB]_STRING_SMALLCAPS] .SMALLCAPS
 .       ie \\n[#\\*[EN-OR-BIB]_STRING_UNDERLINE] \{\
 .          if \\n[#PRINT_STYLE]=3D2 .ds $TITLE_TYPE \\*[EN-OR-BIB]_STRIN=
G
-.          ie \\n[#PRINT_STYLE]=3D1 \{\
+.          ie \\n[#PRINT_STYLE]=3D1 \
 .             UNDERSCORE2 3p 2p "\\*[$\\*[EN-OR-BIB]_STRING]"
-.          \}
 .          el \{\
 .             ie \\n[#\\*[EN-OR-BIB]_STRING_UNDERLINE]=3D2 \
 .                UNDERSCORE2 \\*[$\\*[EN-OR-BIB]_UNDERLINE_GAP] \\*[$\\*=
[EN-OR-BIB]_RULE_GAP] "\\*[$\\*[EN-OR-BIB]_STRING]"
@@ -14452,25 +14731,15 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    if '\\$0'BIBLIOGRAPHY_LEAD' .ds $SECTION BIB
 .    if '\\$0'ENDNOTE_LEAD' .ds $SECTION EN
 .    if '\\$0'TOC_LEAD' .ds $SECTION TOC
-.    ds $\\*[$SECTION]_LEAD \\$1
-.    ds $ADJUST_\\*[$SECTION]_LEAD \\$2
-.    if !\\n[#OK_PROCESS_LEAD] .return
-.    nr #\\*[$SECTION]_LEAD (p;\\$1)
 .    rr #ADJ_\\*[$SECTION]_LEAD
-.    als \\*[$SECTION]_LEAD DOC_LEAD
+.    ds $\\*[$SECTION]_LEAD \\$1
+.    rm $ADJUST_\\*[$SECTION]_LEAD
 .    if '\\$2'ADJUST' \{\
-.       nr #ORIG_DOC_LEAD \\n[#UNADJUSTED_DOC_LEAD]
-.       nr #RESTORE_ADJ_DOC_LEAD \\n[#ADJ_DOC_LEAD]
-.       nr #ADJ_DOC_LEAD 1
 .       nr #ADJ_\\*[$SECTION]_LEAD 1
-.       nr #NO_TRAP_RESET 1
-.       \\*[$SECTION]_LEAD \\n[#\\*[$SECTION]_LEAD]u ADJUST
-.       nr #\\*[$SECTION]_LEAD \\n[#DOC_LEAD]
-.       DOC_LEAD \\n[#ORIG_DOC_LEAD]u
-.       rr #NO_TRAP_RESET
-.       nr #ADJ_DOC_LEAD \\n[#RESTORE_ADJ_DOC_LEAD]
-.       rr #ORIG_DOC_LEAD
+.       ds $ADJUST_\\*[$SECTION]_LEAD ADJUST
 .    \}
+.    if !\\n[#OK_PROCESS_LEAD] .return
+.    nr #\\*[$SECTION]_LEAD (p;\\$1)
 .END
 .
 .ALIAS BIBLIOGRAPHY_LEAD _LEAD
@@ -14598,9 +14867,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .MAC BIBLIOGRAPHY_TYPE END
 .    ie '\\$1'LIST' \{\
 .       nr #BIB_LIST 1
-.       ie '\\$2'' \{\
+.       ie '\\$2'' \
 .          if '\\*[$BIB_LIST_SEPARATOR]'' .ds $BIB_LIST_SEPARATOR .
-.       \}
 .       el .ds $BIB_LIST_SEPARATOR \\$2
 .       ie '\\$3'' .ds $BIB_LIST_PREFIX
 .       el .ds $BIB_LIST_PREFIX \\$3
@@ -14681,6 +14949,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       chop BIB
 .       BIB
 .    \}
+.    rr #BIBLIOGRAPHY
 .END
 \#
 \# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
@@ -14783,10 +15052,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \!.        ps \\n[#TOC_PS]u
 .       \}
 \!.     TAB 102
-\!.     PRINT \\*[LEADER]
+\!.     PRINT \fR\\*[LEADER]\f[]
 \!.     TN
 .       if \\n[#PRINT_STYLE]=3D2 \{\
-\!.        ps \\*[$TOC_PN_SIZE_CHANGE]u
+\!.        ps \\*[$TOC_PN_SIZE_CHANGE]
 .       \}
 \!.     PRINT \\n[#TOC_ENTRY_PN]
 \!.     TQ
@@ -15099,10 +15368,31 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    if !'\\$1'' .ds $TOC_AUTHORS \\$1
 .END
 \#
-\# TABLE OF CONTENTS
-\# -----------------
+\# TABLE OF CONTENTS PAGE SETUP
+\# ----------------------------
 \# *Arguments:
-\#   none
+\#   <none> | <anything>
+\# *Function:
+\#   Some changes to the TOC layout (e.g. margins and page headers)
+\#   are not covered by the TOC and endnotes control macros.  This
+\#   macro permits access to any and all page setup macros not so
+\#   covered.
+\# *Notes
+\#   Wraps a diversion that ends when the macro is invoked with an
+\#   argument.  The contained formatting macros must be preceded by
+\#   '\!'.  The diversion is output before START in TOC.
+\#
+.MAC TOC_PAGE_SETTINGS END
+.    nr #TOC_PAGE_PARAMS 1
+.    ie '\\$1'' \
+.       di TOC_PAGE_PARAMS
+.    el .di
+.END
+\#
+\# TABLE OF CONTENTS
+\# -----------------
+\# *Arguments:
+\#   none
 \# *Function:
 \#   Takes care of the administrivia of setting up the TOC as if
 \#   it's a collated doc, then outputs the formatted TOC_ENTRIES
@@ -15112,6 +15402,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    ie (\\n[@TOP]=3D0)&(\\n[.t]<=3D\\n[.v]) \
 '       br \" When last line of text is on or near b-margin.
 .    el .br \" All other cases
+.    if dPDF.EXPORT \
+.       if \\n[#FLEX_ACTIVE] \
+.          if !\\n[#NO_FLEX] \
+.             tm .ds pre-toc-\\n%@\\n[#COL_NUM] 1
 .    if \\n[#TOC_RV_SWITCH]=3D1 .nr #TOC_RV_SWITCH 2
 .    char \[leader] " .
 .    LEADER_CHARACTER \[leader]
@@ -15153,7 +15447,6 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       TRAPS
 .       nr #IGNORE 1
 .    \}
-.    if \\n[#PRINT_STYLE]=3D2 .vs \\n[#TOC_LEAD]u
 .    if \\n[#FINIS] \{\
 .       if \\n[#FOOTERS_WERE_ON] .FOOTERS  \" Finally, turn footers on i=
f they were on
 .       rr #FOOTERS_WERE_ON
@@ -15172,25 +15465,28 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    ie \\n[#TOC_HEADER_V_POS] \
 .      DOCHEADER OFF \\n[#TOC_HEADER_V_POS]u-\\n[#DOC_LEAD]u=20
 .    el .DOCHEADER OFF \\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
-.    if (\\n[#PRINT_STYLE]=3D1)&(\\n[#SINGLE_SPACE]=3D1) \{\
+.    if (\\n[#PRINT_STYLE]=3D1)&(\\n[#SINGLE_SPACE]=3D1) \
 .       DOCHEADER OFF \\n[#T_MARGIN]u-(\\n[#DOC_LEAD]u*2u)
-.    \}
 .    if !r #TOC_START_PAGENUM .nr #TOC_START_PAGENUM 1
 .       PAGENUMBER \\n[#TOC_START_PAGENUM]
 .    if \\n[#LINENUMBERS]=3D2 .nr #LINENUMBERS 3
-.    L_MARGIN   \\n[#DOC_L_MARGIN]u
-.    LL         \\n[#DOC_L_LENGTH]u
-.    HEADER_FAMILY \\*[$TOC_FAM]
+.    L_MARGIN \\n[#DOC_L_MARGIN]u
+.    LL       \\n[#DOC_L_LENGTH]u
 .    HEADER_CENTER "\\*[$TOC_HEADER_STRING]
 .    if \\n[#SLANT_ON] .nop \\*[SLANTX]
 .    PAGENUM_STYLE \\*[$TOC_PN_STYLE]
 .    PAGENUM_FAMILY \\*[$TOC_PN_FAM]
+.    if r #TOC_PAGE_PARAMS .TOC_PAGE_PARAMS
+.    ie \\n[#ADJ_TOC_LEAD] \{\
+.       DOC_LEAD \\*[$TOC_LEAD] ADJUST
+.    el .DOC_LEAD \\*[$TOC_LEAD]
+.    \}
 .    START
 .    PDF_BOOKMARK 1 \\*[$TOC_HEADER_STRING]
 .    if \\n[#PRINT_STYLE]=3D1 .TYPEWRITER
 .    if \\n[#PRINT_STYLE]=3D2 \{\
-.       FAMILY  \\*[$TOC_HEADER_FAM]
-.       FT      \\*[$TOC_HEADER_FT]
+.       FAMILY \\*[$TOC_HEADER_FAM]
+.       FT     \\*[$TOC_HEADER_FT]
 .       ps \\n[#TOC_PS]u\\*[$TOC_HEADER_SIZE_CHANGE]
 .       if \\n[#TOC_HEADER_COLOR]=3D1 \
 .          gcolor \\*[$TOC_HEADER_COLOR]
@@ -15198,9 +15494,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    QUAD \\*[$TOC_HEADER_QUAD]
 .    if \\n[#TOC_STRING_CAPS] .CAPS
 .    if \\n[#TOC_STRING_SMALLCAPS] .SMALLCAPS
-.    if \\n[#PRINT_STYLE]=3D1 \{\
+.    if \\n[#PRINT_STYLE]=3D1 \
 .       UNDERSCORE 3p "\\*[$TOC_HEADER_STRING]"
-.    \}
 .    if \\n[#PRINT_STYLE]=3D2 \{\
 .       ie \\n[#TOC_HEADER_UNDERLINE] \{\
 .          ds $TITLE_TYPE TOC_HEADER
@@ -15287,12 +15582,20 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .MAC COL_NEXT END
 .    if \\n[#COLUMNS] \{\
 .       nr #COL_NEXT 1
+.       vpt 0
+.       if !'\\$1'internal' \
+.          if dPDF.EXPORT \
+.             if \\n[#FLEX_ACTIVE] \
+.                if !\\n[#NO_FLEX] \
+.                   if \\n[#COL_NUM]>1 \
+.                      tm .ds page-\\n%@\\n[#COL_NUM] 1
 .       ie '\\$0'COL_NEXT' .br
 .       el \{\
 .          brp
 .          RLD 1v
 .       \}
-.       ie \\n[#COL_NUM]=3D\\n[#NUM_COLS] .bp
+.       vpt
+.       ie \\n[#COL_NUM]=3D\\n[#NUM_COLS] .NEWPAGE
 .       el .FOOTER
 .    \}
 .END
@@ -15351,30 +15654,36 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    \}
 .    el .ds $LIST_ARG_1 \\$1
 .    if !r#DEPTH \{\
-.       nr #STORED_HL_INDENT \\n[#HL_INDENT]
-.       nr #STORED_T_INDENT  \\n[#T_INDENT]
+.       if \\n[#INDENT_ACTIVE] \{\
+.          nr #STORED_HL_INDENT \\n[#HL_INDENT]
+.          nr #STORED_T_INDENT  \\n[#T_INDENT]
+.          if \\n[#INDENT_LEFT_ACTIVE] \
+.             nr #STORED_L_INDENT \\n[#L_INDENT]
+.          if \\n[#INDENT_RIGHT_ACTIVE] \
+.             nr #STORED_R_INDENT \\n[#R_INDENT]
+.          if \\n[#INDENT_BOTH_ACTIVE] \{\
+.             nr #STORED_BL_INDENT \\n[#BL_INDENT]
+.             nr #STORED_BR_INDENT \\n[#BR_INDENT]
+.          \}
+.       \}
 .       nr #CURRENT_L_LENGTH \\n[.l]
 .       nr #DEPTH 0 1
 .       if \\n[#INDENT_ACTIVE]=3D1 \{\
-.          if \\n[#INDENT_LEFT_ACTIVE]=3D1 \{\
-.             nr #STORED_L_INDENT \\n[#L_INDENT]
+.          if \\n[#INDENT_LEFT_ACTIVE]=3D1 \
 .             nr #RESTORE_PREV_INDENT 1
-.          \}
 .          if \\n[#INDENT_BOTH_ACTIVE]=3D1 \{\
-.             nr #STORED_BL_INDENT \\n[#BL_INDENT]
-.             nr #STORED_BR_INDENT \\n[#BR_INDENT]
 .             IBX
 .             nr #ORIG_L_LENGTH \\n[.l]
 .             IB
 .             nr #RESTORE_PREV_INDENT 2
 .          \}
 .          if \\n[#INDENT_RIGHT_ACTIVE]=3D1 \{\
-.             nr #STORED_R_INDENT \\n[#R_INDENT]
 .             IRX
 .             nr #ORIG_L_LENGTH \\n[.l]
 .             IR
 .             nr #RESTORE_PREV_INDENT 3
-.             if \\n[#INDENT_LEFT_ACTIVE]=3D1 .nr #RESTORE_PREV_INDENT 4
+.             if \\n[#INDENT_LEFT_ACTIVE]=3D1 \
+.                nr #RESTORE_PREV_INDENT 4
 .          \}
 .       \}
 .    \}
@@ -15438,9 +15747,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          if \\n[#NUM_ARGS]>=3D2 \{\
 .             ie '\\$2'NONE' .ds $SEPARATOR\\n[#DEPTH]
 .             el .ds $SEPARATOR\\n[#DEPTH] \\$2
-.             if \\n[#NUM_ARGS]=3D3 \{\
+.             if \\n[#NUM_ARGS]=3D3 \
 .                ds $PREFIX\\n[#DEPTH] \\$3
-.             \}
 .          \}
 .       \}
 .       if '\\*[$1ST_LETTER]'R' \{\
@@ -15464,6 +15772,13 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          ds $SEPARATOR\\n[#DEPTH]
 .          ds $PREFIX\\n[#DEPTH]
 .       \}
+.       if '\\*[$LIST_ARG_1]'PLAIN' \{\
+.          nr #ARGS_TO_LIST 1
+.          ds $ENUMERATOR\\n+[#DEPTH]
+.          ds $ENUMERATOR_TYPE\\n[#DEPTH] plain
+.          ds $SEPARATOR\\n[#DEPTH]
+.          ds $PREFIX\\n[#DEPTH]
+.       \}
 .       if \\n[#NUM_ARGS]=3D1 \{\
 .          if !r#ARGS_TO_LIST \{\
 .             ie \\n[#DEPTH]=3D1 \{\
@@ -15541,6 +15856,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \#   receive the text of an item.
 \#
 .MAC ITEM END
+.    if '\\*[$ENUMERATOR_TYPE\\n[#DEPTH]]'plain' .nop=20
 .    if !r#DEPTH .return
 .    if \\n[#LINENUMBERS]=3D1 \{\
 .       NUMBER_LINES OFF
@@ -15945,25 +16261,20 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .   IQ CLEAR
 .   nr #HL_INDENT \\n[#STORED_HL_INDENT]
 .   nr #T_INDENT  \\n[#STORED_T_INDENT]
+.   nr #L_INDENT  \\n[#STORED_L_INDENT]
+.   nr #R_INDENT \\n[#STORED_R_INDENT]
+.   nr #BL_INDENT \\n[#STORED_BL_INDENT]
+.   nr #BR_INDENT \\n[#STORED_BR_INDENT]
 .   rr #STORED_HL_INDENT
-.   if \\n[#RESTORE_PREV_INDENT]=3D1 \{\
-.      nr #L_INDENT  \\n[#STORED_L_INDENT]
+.   if \\n[#RESTORE_PREV_INDENT]=3D1 \
 .      IL
-.      rr #STORED_L_INDENT
-.   \}
 .   if \\n[#RESTORE_PREV_INDENT]=3D2 \{\
-.      nr #BL_INDENT \\n[#STORED_BL_INDENT]
-.      nr #BR_INDENT \\n[#STORED_BR_INDENT]
 .      ll \\n[#ORIG_L_LENGTH]u
 .      IB
-.      rr #STORED_BL_INDENT
-.      rr #STORED_BR_INDENT
 .   \}
 .   if \\n[#RESTORE_PREV_INDENT]=3D3 \{\
-.      nr #R_INDENT \\n[#STORED_R_INDENT]
 .      ll \\n[#ORIG_L_LENGTH]u
 .      IR
-.      rr #STORED_R_INDENT
 .   \}
 .   if \\n[#RESTORE_PREV_INDENT]=3D4 \{\
 .      nr #R_INDENT \\n[#STORED_R_INDENT]
@@ -15971,8 +16282,6 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .      ll \\n[#ORIG_L_LENGTH]u
 .      IR
 .      IL
-.      rr #STORED_R_INDENT
-.      rr #STORED_L_INDENT
 .   \}
 .\" Clean up after exiting last depth of list
 .   nr #REMOVE 0 1
@@ -15984,6 +16293,11 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .      rm $ENUMERATOR_TYPE\\n[#REMOVE]
 .      rr #PAD_LIST_DIGITS\\n[#REMOVE]
 .   \}
+.   rr #STORED_L_INDENT
+.   rr #STORED_BL_INDENT
+.   rr #STORED_BR_INDENT
+.   rr #STORED_R_INDENT
+.   rr #STORED_R_INDENT
 .   rr #REMOVE
 .   rr #TOTAL_LISTS
 .   rr #QUIT
@@ -16035,6 +16349,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \#   N.B.--the START macro must be used after every COLLATE
 \#
 .MAC COLLATE END
+.    if dPDF.EXPORT .tm .ds pre-collate-\\n% \\n%@\\n[#COL_NUM]
 .    if \\n[defer] .bp
 .    if \\n[#FORCE_RECTO] \
 .       if o .BLANKPAGE 1 DIVIDER
@@ -16060,9 +16375,9 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    nr #PRE_COLLATE 1
 .    nr #POST_TOP 1
 .    nr #HEAD_1_NUM 0 1
-.    nr eqn*label-width     (\\n[eqn*label-num] >? \\n[eqn*label-width])
-.    nr fig*label-width     (\\n[fig*label-width] >? \\n[fig*label-width=
])
-.    nr tbl*label-width     (\\n[tbl*label-num] >? \\n[tbl*label-width])
+.    nr eqn*label-width (\\n[eqn*label-num] >? \\n[eqn*label-width])
+.    nr fig*label-width (\\n[fig*label-width] >? \\n[fig*label-width])
+.    nr tbl*label-width (\\n[tbl*label-num] >? \\n[tbl*label-width])
 .    if \\n[eqn*label-with-chapter]=3D1     .nr eqn*label-num 0 1
 .    if \\n[float*label-with-chapter]=3D1   .nr fig*label-num 0 1
 .    if \\n[pdf-img*label-with-chapter]=3D1 .nr fig*label-num 0 1
@@ -16096,7 +16411,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .      rs
 .      nop \&
 .    \}
-.    if '\\n[.ev]'PAGE_TRANSITION' .ev
+.    if '\\n[.ev]'P+AGE_TRANSITION\\n[pg-trans]' .ev
 .    if \\n[#DEFER_PAGINATION] .PAGINATE
 .    if !'\\*[$RESTORE_PAGENUM_STYLE]'' \{\
 .       PAGENUM_STYLE \\*[$RESTORE_PAGENUM_STYLE]
@@ -16140,6 +16455,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    nr #LOOP 0 1
 .    while \\n+[#LOOP]<=3D\\n[@LEVEL] \
 .       rr #TOC_HEAD_\\n[#LOOP]_INDENT_SET 1
+.    if \\n[#FLEX_ACTIVE] .rr #NO_FLEX
 .END
 \#
 \# NUMBER_LINES
@@ -16393,6 +16709,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 ..
 \#
 .MAC PROCESS_FLOATS END
+.    if \\n[#TAB_ACTIVE] \{\
+.       nr #RESTORE_TAB 1
+.       TQ
+.    \}
 .    if (\\n[float*defer]>0):(\\n[defer]=3D0) \{\
 .       if !\\n[tbl*no-top-hook] .tbl@top-hook
 .       rr tbl*no-top-hook
@@ -16404,7 +16724,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       rs
 .       nop \&
 .       sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
-.       if '\\*[float*type:1]'boxed-tbl' \{\
+.       if '\\*[float*type:\\n[defer]]'boxed-tbl' \{\
 .          ch RR_@TOP
 .          if (\\n[.t] >=3D 1)&(\\n[float-depth:1] > \\n[.t]) \
 .             tbl*float-warning
@@ -16415,9 +16735,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       \}
 .       if \\n[float*pic] \{\
 .          if (\\n[pic*have-caption]=3D1)&(\\n[pic*caption-after-label]=3D=
0) \{\
-.             ie \\n[#COLUMNS] \{\
+.             ie \\n[#COLUMNS] \
 .                sp |\\n[dc]u-.5v
-.             \}
 .             el \
 .                sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u-.5v
 .          \}
@@ -16430,6 +16749,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .             sp |\\n[dc]u
 .          el \
 .             sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
+.          if \\n[pdf-img:frame] \{\
+.             sp -(\\*[pdf-img:frame-weight]p*2u)
+.             rr pdf-img:frame
+.          \}
 .       \}
 .       nr defer-count \\n[defer]
 .       nr loop-count  0 1
@@ -16440,9 +16763,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          vpt
 .          ch RR_@TOP
 .          rr @TOP
-.          if \\n[pdf-img*have-caption] \{\
+.          if \\n[pdf-img*have-caption] \
 .             if !\\n[pdf-img*caption-after-label] .sp -.5v
-.          \}
 .          rr pdf-img*have-caption
 .          rr pic*have-caption
 .          if '\\*[float*type:\\n[loop-count]]'table' \{\
@@ -16463,6 +16785,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .             rr tbl*no-top-hook
 .             output-float
 .          \}
+.          if !\\n[loop-count]=3D\\n[defer-count] .rr flexed
 .       \}
 .       rm FLOAT*DIV:\\n[loop-count]
 .       rr float-depth:\\n[loop-count]
@@ -16480,9 +16803,21 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       rr float*defer
 .       ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
 .       ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
+.       if \\n[.t]<\\n[.v] .bp
 .       ev
-.       SHIM
-.       if \\n[#SHIM]>(\\n[#DOC_LEAD]-(\\n[#DOC_LEAD]/4)) 'sp -\\n[#DOC_=
LEAD]u
+.       ie !\\n[#NO_SHIM] .SHIM
+.       el \{\
+.          if !\\n[#NO_FLEX] \
+.             if !\\n[flexed] .FLEX=20
+.       \}
+.       if !\\n[#NO_SHIM] \
+.          if \\n[#SHIM]>(\\n[#DOC_LEAD]-(\\n[#DOC_LEAD]/4)) \
+'             sp -\\n[#DOC_LEAD]u
+.       ie !\\n[flex:force] .ns
+.       el \{\
+.          rr flex:force
+.          if !\\n[#NO_FLEX] .FLEX
+.       \}
 .       nr tbl*have-header 0
 .       rr loop-count
 .       rr defer-count
@@ -16499,24 +16834,33 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    rr float*eqn
 .    rr float*tbl
 .    rr float*pic
+.    if \\n[#RESTORE_TAB] \{\
+.       TAB \\n[#CURRENT_TAB]
+.       rr #RESTORE_TAB
+.    \}
 .END
 \#
 .MAC output-float END
 .    vpt 0
-.    nop \&
-.    sp -1
+.    if \\n[.ns] \{\
+.       rs
+.       nop \&
+.       sp -1
+.    \}
 .    if \\n[no-top-space] \{\
 .       ie !\\n[#COLUMNS] \{\
-.          sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
+.          sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u+.5
 .          ns
 .       \}
 .       el .sp |\\n[dc]u
 .       if \\n[float*tbl] \{\
 .          rs
-.          if \\n[tbl*caption-top-lead-diff] \{\
+.          ie \\n[tbl*caption-top-lead-diff] \{\
 .             sp \\n[tbl*caption-top-lead-diff]u
 .             rr tbl*caption-top-lead-diff
 .          \}
+.          el \
+.             if '\\*[float*type:\\n[float*defer]]'boxed-tbl' .sp 2p
 .       \}
 .    \}
 .    if \\n[float*pic] \{\
@@ -16532,6 +16876,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    if \\n[q-float] \
 .       if !\\n[has-caption] .sp \\n[#Q_LEAD_DIFF]u
 .    ns
+.    vpt
 .    FLOAT*DIV:\\n[loop-count]
 .    if \\n[no-top-space] \{\
 .       rs
@@ -16542,19 +16887,21 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    if \\n[#COLUMNS] \
 .       if !'\\*[pic*space-adj]'' .sp -\\*[pic*space-adj]
 .    rm pic*space-adj
-.    if \\n[D-float:\\n[loop-count]] \{\
-.       sp \
--\\n[float-depth:\\n[loop-count]]u+\\n[D-float:\\n[loop-count]]u+\\n[#DO=
C_LEAD]u
+.    if \\n[D-float:\\n[loop-count]] \
 .       rr D-float:\\n[loop-count]
-.    \}
-.    if (\\n[float*tbl]=3D0)&(\\n[float*pic]=3D0)&\
+.    if !\\n[.t]<=3D(\\n[#DOC_LEAD]/2) \{\
+.       if (\\n[float*tbl]=3D0)&(\\n[float*pic]=3D0)&\
 (\\n[float*eqn]=3D0):(\\n[q-float]=3D1) \
-.       sp \\n[#DOC_LEAD]u/2u
-.    if !\\n[float*no-shim] \
-.       if !\\n[q-float] .SHIM
+.          sp \\n[#DOC_LEAD]u/2u
+.       if !\\n[@no-shim] \
+.          if !\\n[q-float] \
+.             if !\\n[#NO_SHIM] .SHIM
+.    \}
 .    rr float*tbl
 .    rr float*pic
 .    rr float*eqn
+.    rr D-float
+.    rr @no-shim
 .    rr q-float
 .    rm B_QUOTE
 .    rm P_QUOTE
@@ -16574,20 +16921,6 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \#   a new page immediately.
 \#
 .MAC FLOAT END
-.\"  Case where upcoming .br breaks to a new page, causing a defered flo=
at
-.\"  to be output by HEADER and the defer register to be cleared.
-.    nr pagenum \\n%+\\n[#PAGE_NUM_ADJ]
-.    br
-.\" Clear .ns when a single line of running text precededs float
-.\" at the top of the page.
-.    if \\n[nl]=3D\\n[#PAGE_TOP] \{\
-.       vpt 0
-.       sp -1v
-.       sp
-.       ch RR_@TOP
-.       rr @TOP
-.       vpt
-.    \}
 .    if \\n[#NUM_ARGS]>0 \{\
 .       nr loop-count 0 1
 .       nr loop-counter \\n[#NUM_ARGS]
@@ -16606,35 +16939,114 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .             shift
 .          \}
 .          if '\\$1'NO_SHIM' \{\
-.             nr float*no-shim 1
+.             nr @no-shim 1
+.             shift
+.          \}
+.          if '\\$1'NO_FLEX' \{\
+.             nr @no-flex 1
+.             shift 1
+.          \}
+.          if '\\$1'TARGET' \{\
 .             shift
+.             ds float*target "\\$1
+.             shift 1
 .          \}
 .       \}
 .    \}
+.    ie \\n[float*started] .rr float*started
+.    el \{\
+.       while !'\\$1'' .shift \\$1
+.       nr float*started 1
+.    \}
 .    ie '\\$1'' \{\
+.\" Harmonize floats treated as defers and floats proper to the top
+.\" of the next page between passes when flex is enabled.
+.\"
+.\" Without this, floats near the bottom of the page may be deferred
+.\" on the first pass, but when flex-spacing moves the line just
+.\" before the float to the bottom of the page, the upcoming .br
+.\" causes the float to be proper to the next page instead of
+.\" deferred to it.
+.       nr floatnum +1
+.       ie !\\n[#NO_FLEX] \{\
+.\" Only on 2nd pass
+.          if !dPDF.EXPORT \{\
+.             ie d float\\n[floatnum]:no-defer .br
+.             el \{\
+.\" .v in the following is arbitrary.  Groff rounds down decimal
+.\" fractions so flex-spacing may be slightly short.  Since there
+.\" are no conditions under which a .t-1 (bottom margin) < .v
+.\" on the 1st pass doesn't cause a float to be deferred, all floats
+.\" on the second pass that meet the condition are also, correctly,
+.\" deferred.
+.                if (\\n[.t]-1)<\\n[.v] \
+.                   if !\\n[@TOP] .nr no-break 1
+.             \}
+.          \}
+.\" Only on 1st pass
+.          ie !\\n[no-break] \{\
+.             ds pre-float:page@col \\n%@\\n[#COL_NUM]
+.             br
+.             ds post-float:page@col \\n%@\\n[#COL_NUM]
+.             if dPDF.EXPORT \{\
+.                if !'\\*[pre-float:page@col]'\\*[post-float:page@col]' =
\
+.                   tm .ds float\\n[floatnum]:no-defer 1
+.             \}
+.          \}
+.          el .rr no-break
+.       \}
+.       el .br
+.       if \\n[nl]=3D\\n[#PAGE_TOP] \
+.          RESTORE_SPACE
+.       ds ev-pre-float \\n[.ev]
 .       ev FLOAT
-.       evc 0
-.       nf
+.       evc \\*[ev-pre-float]
 .       di FLOAT*DIV
+.       if !'\\*[float*target]'' .PDF_TARGET "\\*[float*target]
+.       rm float*target
+.       nf
 .    \}
 .    el \{\
 .       br
+.\" So @no-shim persists if float output with output-float
+.       if r @no-shim .nr float*no-shim 1
 .       di
-.       if \\n[float*table] \
-.          if !\\n[tbl*have-header] .ev
-.       ev
+.       ie \\n[float*tbl] \
+.          if !\\n[tbl*have-header] .ev 0
+.       el .ev 0
 .       if \\n[tbl*boxed] \{\
+.          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
+.          ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_LEA=
D]u
 .          ie !\\n[#MLA] \{\
-.             ie (\\n[tbl@label]=3D1):(\\n[tbl@source]=3D1) .nr dn -.65v
+.             ie (\\n[tbl@label]=3D1):(\\n[tbl@source]=3D1):(\\n[tbl*aut=
olabel]=3D1) .nr dn -.65v
 .             el .nr dn +.65v
 .          \}
-.          el \{\
+.          el \
 .             if !\\n[tbl@source] .nr dn -1.65v
-.          \}
 .       \}
-.       if (\\n[dn]>\\n[.t]):(\\n[D-float]>\\n[.t]) \{\
-.          ie \\n[@TOP] \
+.       if (\\n[dn]>\\n[.t]):(\\n[D-float]>\\n[.t]):(\\n[defer]>0) \{\
+.          if (\\n[dn]+(\\n[.v]*2)>(\\n[.p]-\\n[#TOP_MARGIN]-\\n[#DOC_LE=
AD]-\\n[#B_MARGIN])) \{\
+.             tm1 "[mom]: Floated element exceeds page depth.
+.             ab   [mom]: Aborting '\\n[.F]' at line \\n[.c].
+.          \}
+.\" Save depth of diversion here.  The .da zeroes it.
+.          nr dn-save \\n[dn]
+.          if !\\n[@no-flex] \{\
+.             da FLOAT*DIV
+\!.           FLEX
+\!.           nr flexed 1
+.             da
+.          \}
+.          nr dn \\n[dn-save]
+.          rr dn-save
+.          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+.          ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
+.          ev 0
+.          ie \\n[@TOP] \{\
+.             br
 .             if \\n[tbl*boxed] .rs
+.             rr tbl*boxed
+.          \}
 .          el \{\
 .             if !\\n[defer] .nr defer 0 1
 .             rn FLOAT*DIV FLOAT*DIV:\\n+[defer]
@@ -16655,21 +17067,33 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .                if \\n[defer]=3D1 .nr no-top-space 1
 .                ds float*type:\\n[defer] eqn
 .             \}
-.             if \\n[float*pic] \{\
+.             if \\n[float*pic] \
 .                ds float*type:\\n[defer] pic
-.             \}
-.             if \\n[float*img] \{\
+.             if \\n[float*img] \
 .                ds float*type:\\n[defer] img
-.             \}
 .             if \\n[D-float] .nr D-float:\\n[defer] \\n[D-float]
 .             nr float-depth:\\n[defer] \\n[dn]
 .             if \\n[#FORCE] \{\
-.                bp
+.                ie \\n[#COLUMNS] .COL_NEXT
+.                el .NEWPAGE
 .                rr #FORCE
 .             \}
+.             if r tbl*boxed .rr tbl*boxed
+.             br
 .             return \" output div after header
 .          \}
 .       \}
+.       nr dn-save \\n[dn]
+.       if !\\n[@no-flex] \{\
+.          da FLOAT*DIV
+\!.        FLEX
+\!.        nr flexed 1
+.          da
+.       \}
+.       nr dn \\n[dn-save]
+.       rr dn-save
+.       ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+.       ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
 .       if !'\\*[float-adj]'' .sp \\*[float-adj]
 .       if \\n[.u] .nr fill 1
 .       if \\n[@TOP] \{\
@@ -16680,28 +17104,52 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          if (\\n[#MLA]=3D1)&(\\n[tbl@source]=3D0) \
 .             chop FLOAT*DIV
 .          if \\n[nl]=3D\\n[#PAGE_TOP] \{\
-.             if \\n[tbl*have-caption] \{\
+.             ie \\n[tbl*have-caption] \{\
 .                ie !\\n[#MLA] .sp \\n[tbl*caption-lead-diff]u
 .                el \{\
 .                   ch RR_@TOP
 .                   sp \\n[tbl*label-lead-diff]u-.5v
 .                \}
 .             \}
+.             el \{\
+.                ev protect
+.                evc FLOAT
+.                nf
+.                RESTORE_SPACE
+.                ie \\n[tbl*boxed] .sp |\\n[#PAGE_TOP]u+.25v+2p
+.                el .sp |\\n[#PAGE_TOP]u-.25v
+.             \}
+.          \}
+.       \}
+.       if \\n[float*img] \
+.          if \\n[pdf-img:frame] .sp -(\\*[pdf-img:frame-weight]p*2u)
+.       if !'\\n[.ev]'protect' \{\
+.          ev protect
+.          evc FLOAT
+.          nf
+.       \}
+.       if \\n[float*tbl] \{\
+.          if \\n[tbl*boxed] \{\
+.             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
+.             ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_=
LEAD]u
 .          \}
 .       \}
-.       ev protect
-.       evc FLOAT
-.       nf
 .       FLOAT*DIV
 .       ev
 .       if \\n[float*tbl] \{\
 .          ie \\n[tbl*boxed] \{\
-.             if \\n[dn]=3D\\n[bx-tbl-depth] .sp .35v
-.             if \\n[tbl*plain-boxed] .sp .5v
 .             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
 .             ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
-.             rr tbl*boxed
-.             rr bx-tbl-depth
+.             ie \\n[nl]>(\\n[.p]+\\n[#VARIABLE_FOOTER_POS]) \{\
+.                ie \\n[#COLUMNS] .COL_NEXT
+.                el .NEWPAGE
+.             \}
+.             el \{\
+.                if \\n[dn]=3D\\n[bx-tbl-depth] .sp .35v
+.                if \\n[tbl*plain-boxed] .sp .5v
+.                rr tbl*boxed
+.                rr bx-tbl-depth
+.             \}
 .          \}
 .          el \{\
 .             if '\\*[tbl*label]'' \
@@ -16717,8 +17165,17 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          rm tbl*label
 .          rm tbl*source
 .       \}
-.       if \\n[D-float] \
-.          sp -\\n[dn]u+\\n[#DOC_LEAD]u+\\n[D-float]u
+.       if \\n[D-float] \{\
+.          ie \\n[dn]=3D0 .sp \\n[D-float]u+\\n[#DOC_LEAD]u
+.          el \
+.             if \\n[dn]<\\n[D-float] \
+.                sp \\n[D-float]u+\\n[#DOC_LEAD]u-\\n[dn]u
+.\" Flex won't grab .h of D-floats without a dummy text line.
+.          vpt 0
+.          nop \&
+.          sp -1
+.          vpt 1
+.       \}
 .       if \\n[fill] \{\
 .          fi
 .          rr fill
@@ -16726,14 +17183,25 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       rm FLOAT*DIV
 .       if !'\\*[float-adj]'' \
 .          if !\\n[no-adjust] .sp -\\*[float-adj]
-.       if !\\n[float*no-shim] .SHIM
+.       if !\\n[#NO_SHIM] \
+.          if !\\n[@no-shim] .SHIM
 .       rm float-adj
 .       rm no-adjust
 .       rr D-float
-.       rr float*no-shim
+.       rr @no-shim
+.       rr @no-flex
 .       rr #FORCE
 .       rm P_QUOTE
 .       rm B_QUOTE
+.       if \\n[float*img] .rr float*img
+.       if \\n[float*pic] .rr float*pic
+.       if \\n[float*eqn] .rr float*eqn
+.       rr float*target
+.       rm float*target
+.       if \\n[#NO_SHIM] \
+.          if !\\n[#NO_FLEX] .nr post-float 1
+.       ev \\*[ev-pre-float]
+.       rm ev-pre-float
 .    \}
 .END
 \#
@@ -16744,7 +17212,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \# *Function:
 \#   Sets header/footer/footnotes/etc... traps.
 \#
-\#   Calculates the number of lines that actually fit on a
+\#   TRAPS calculates the number of lines that actually fit on a
 \#   page based on #B_MARGIN and resets page bottom trap to coincide
 \#   with the depth of that number of lines, or, if #ADJ_DOC_LEAD=3D1,
 \#   adjusts #DOC_LEAD so that the last line of text on a page falls
@@ -16765,7 +17233,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .END
 \#
 .MAC TRAPS END
-.    if !\\n[#UNADJUSTED_DOC_LEAD]  .nr #UNADJUSTED_DOC_LEAD \\n[#DOC@LE=
AD]
+.    if !\\n[#UNADJUSTED_DOC_LEAD] .nr #UNADJUSTED_DOC_LEAD \\n[#DOC@LEA=
D]
 .\" Remove all header/footer traps
 .    if !\\n[#NO_TRAP_RESET] \{\
 .       ch DO_T_MARGIN
@@ -16884,10 +17352,11 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .END
 \#
 \# This .em (for all DOC_TYPEs, except 4 [LETTER]) ensures that
-\# deferred footnotes that happen on the 2nd to last page get
-\# output.
+\# deferred footnotes and floats that happen on the 2nd to last page
+\# get output, and the last page/col isn't flexed.
 \#
 .MAC TERMINATE END
+.    if dPDF.EXPORT .tm .ds last-page \\n%@\\n[#COL_NUM]
 .    ie \\n[#FN_DEPTH] \{\
 .       ie \\n[#FN_DEFER] \{\
 .          br
@@ -16907,6 +17376,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       ch FN_OVERFLOW_TRAP
 .       FOOTER
 .    \}
+.    if \\n[defer] \
+'       bp
 .END
 \#
 \# END MACRO FOR LETTERS
@@ -17303,6 +17774,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .ALIAS  ENDNOTES_HEADER_CENTRE ENDNOTES_HDRFTR_CENTER
 .
 .ALIAS  FOOTER_CENTER           HDRFTR_CENTER
+.ALIAS  TOC_PAGEFOOTER_CENTER   HDRFTR_CENTER
+.ALIAS  TOC_PAGEFOOTER_CENTRE   HDRFTR_CENTER
 .ALIAS  FOOTER_CENTER_CAPS      _HDRFTR_CAPS
 .ALIAS  FOOTER_CENTER_PAD       HDRFTR_CENTER_PAD
 .ALIAS  FOOTER_CENTER_SMALLCAPS _HDRFTR_SMALLCAPS
@@ -17323,6 +17796,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .ALIAS  FOOTER_VERSO            HDRFTR_VERSO
 .
 .ALIAS  HEADER_CENTER           HDRFTR_CENTER
+.ALIAS  TOC_PAGEHEADER_CENTER   HDRFTR_CENTER
+.ALIAS  TOC_PAGEHEADER_CENTRE   HDRFTR_CENTER
 .ALIAS  HEADER_CENTER_CAPS      _HDRFTR_CAPS
 .ALIAS  HEADER_CENTER_PAD       HDRFTR_CENTER_PAD
 .ALIAS  HEADER_CENTER_SMALLCAPS _HDRFTR_SMALLCAPS
@@ -17623,9 +18098,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    \}
 .    if '\\n[\\*[label-type]*\\*[spec-type]-quad-on-ll]'' \
 .       nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
-.    if '\\*[spec-type]'caption' \{\
+.    if '\\*[spec-type]'caption' \
 .       nr default-left 1
-.    \}
 .END
 \#
 .MAC set-inline-specs END
@@ -17641,10 +18115,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .MAC SET_QUAD END
 .    ds label-type \\$0
 .    substring label-type 0 2
-.    if '\\*[label-type]'PDF'  .ds label-type pdf-img
-.    if '\\*[label-type]'TBL'  .ds label-type tbl
-.    if '\\*[label-type]'PIC'  .ds label-type pic
-.    if '\\*[label-type]'EQN'  .ds label-type eqn
+.    if '\\*[label-type]'PDF'   .ds label-type pdf-img
+.    if '\\*[label-type]'TBL'   .ds label-type tbl
+.    if '\\*[label-type]'PIC'   .ds label-type pic
+.    if '\\*[label-type]'EQN'   .ds label-type eqn
 .    ds spec-type \\$0
 .    substring spec-type -6 -10
 .    if '\\*[spec-type]'PTION' .ds spec-type caption
@@ -17717,8 +18191,12 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       if !\\n[tbl*\\*[spec-type]-quad-on-ll] \{\
 .          ie \\n[tbl*center] \{\
 .             ie '\\*[spec-type]'label' \{\
-.                ll \\n[ll-pre-tbl]u-\\n[TW]u/2u+\\n[TW]u
-\!.                in \\n[ll-pre-tbl]u-\\n[TW]u/2u
+.\" Differentiate between a tbl label and a float label
+.                ie !'\\*[ev-current]'FLOAT' \{\
+.                   ll \\n[ll-pre-tbl]u-\\n[TW]u/2u+\\n[TW]u
+\!.                 in \\n[ll-pre-tbl]u-\\n[TW]u/2u
+.                \}
+.                el .sp -1
 .             \}
 .             el \{\
 .                ll \\n[TW]u
@@ -17865,6 +18343,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .                 get-label-type
 .                 ds \\*[label-type]*\\*[spec-type]-quad \\$1
 .                 substring \\*[label-type]*\\*[spec-type]-quad 0 0
+.                 if '\\$2'ON_LL' \
+.                    nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
 .             \}
 .          \}
 .          el \{\
@@ -17872,12 +18352,11 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .             substring \\*[label-type]*\\*[spec-type]-quad 0 0
 .             if \\n[\\*[label-type]*\\*[spec-type]-quad-on-ll] \
 .                rr \\*[label-type]*\\*[spec-type]-quad-on-ll=20
+.             if '\\$2'ON_LL' \
+.                nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
 .          \}
-.          shift
-.          if '\\$1'ON_LL' \{\
-.             nr \\*[label-type]*\\*[spec-type]-quad-on-ll 1
-.             shift
-.          \}
+.          ie '\\$2'ON_LL' .shift 2
+.          el  .shift
 .       \}
 .       if '\\$1'COLOR' \{\
 .          shift
@@ -17980,13 +18459,25 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \#   can only take one double-quoted text string.
 \#
 \# These strings allow users to create labels of the form
-\# 'Fig. \*[chapter].\*[label]', e.g. 'Fig. 1.1'
+\# 'Fig. \*[chapter].\*[fig-label]', e.g. 'Fig. 1.1'
+\#
+.ds chapter   \\n[#CH_NUM]
+.ds fig-label \\n+[fig*label-num]
+.ds tbl-label \\n+[tbl*label-num]
+.ds eqn-label \\n+[eqn*label-num]
 \#
-.ds chapter \\n[#CH_NUM]
-.ds label \\n+[lists*target]
 \#
 .MAC LABEL END
 .    br
+.    if \\n[.ns] \{\
+.       vpt 0
+.       rs
+.       nop \&
+.       sp -1
+.       vpt
+.    \}
+.    if r chop-space .sp -1
+.    rr chop-space
 .    if \\n[#QUOTE] .nr q-float 1
 .    if '\\$0'CAPTION' \{\
 .       ds labelcap caption
@@ -18017,6 +18508,9 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          \}
 .       \}
 .    \}
+.    if \\n[D-float] \
+.       if \\n[.d]>\\n[D-float] \
+.          sp \\n[.d]u-\\n[D-float]u
 .    rr has-\\*[labelcap]
 .    nr has-\\*[labelcap] 1
 .    rr @bottom
@@ -18040,8 +18534,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          el \
 .            if '\\n[.z]'FLOAT*DIV' .sp \\n[#DOC_LEAD]u/4u
 .       \}
-.       el \
+.       el \{\
 .          sp \\n[#DOC_LEAD]u/4u
+.          rr @bottom
+.       \}
 .    \}
 \!.  if \\\\n[deferred-float] \{\
 .       if !\\n[#QUOTE] .sp -(\\n[#DOC_LEAD]u/4u)
@@ -18055,6 +18551,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    ie '\\*[labelcap]'label' \{\
 .       if \\n[to-list] \{\
 .\" Strip prefix from label if list-type is being autolabelled
+.\" Becomes $LIST_LABEL
 .          if '\\*[$LIST_OF]'FIGURES' \
 .             if r fig*label-num .STRIP_PRFX_SFFX "\\*[$FLOATING_LABEL]"
 .          if '\\*[$LIST_OF]'TABLES' \
@@ -18062,7 +18559,6 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          if '\\*[$LIST_OF]'EQUATIONS' \
 .             if r eqn*label-num .STRIP_PRFX_SFFX "\\*[$FLOATING_LABEL]"
 .       \}
-.\"
 .       ds $FLOATING_LABEL \
 \F[\\\\*[floating*label-family]]\
 \f[\\\\*[floating*label-font]]\
@@ -18071,9 +18567,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \\*[$FLOATING_LABEL]
 .    \}
 .    el \{\
-.       if !\\n[deferred-float] \{\
+.       if !\\n[deferred-float] \
 .          sp \\n[floating*caption-lead-diff]u
-.       \}
 .       if !'\\*[floating*caption-space]'' \
 .          sp \\*[floating*caption-space]
 .       while !'\\$1'' \{\
@@ -18099,11 +18594,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \s[\\\\*[floating*caption-size-change]]\
 \m[\\\\*[floating*caption-color]]\
 \\*[$FLOATING_CAPTION]
-.       if !'\\*[$LIST_LABEL]'' \
-.          as $LIST_LABEL .\0
 .       if '\\*[$LIST_CAPTION]'' \
 .          ds $LIST_CAPTION \\*[$FLOATING_CAPTION]
-.       as $LIST_LABEL \\*[$LIST_CAPTION]
 .    \}
 .    if !'\\*[$FLOATING_LABEL]'' \{\
 .       sp \\n[floating*label-lead-diff]u
@@ -18150,7 +18642,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          ds labelcap caption
 .       \}
 .       ie '\\*[$LIST_LABEL]'' .TO_\\*[$LIST_OF] "\\*[$FLOATING_LABEL]
-.       el .TO_\\*[$LIST_OF] "\\*[$LIST_LABEL]
+.       el .TO_\\*[$LIST_OF] "\\*[$LIST_LABEL]" "\\*[$LIST_CAPTION]
 .       rr to-list
 .       nr loop-counter 0 1
 .       nr loop-count 2
@@ -18212,9 +18704,9 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    if !\\n[#MLA] \{\
 .       nr \\*[type]*caption-after-label 1
 .       if '\\$1'ALL' \{\
-.          if '\\$1'IMG' .nr pdf-img*caption-after-label 1
-.          if '\\$1'TBL' .nr tbl*caption-after-label 1
-.          if '\\$1'PIC' .nr pic*caption-after-label 1
+.          nr pdf-img*caption-after-label 1
+.          nr tbl*caption-after-label 1
+.          nr pic*caption-after-label 1
 .       \}
 .       if !'\\$2'' \{\
 .          ie !'\\$1'ALL' .rr \\*[type]*caption-after-label
@@ -18242,6 +18734,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    if '\\$0'AUTOLABEL_IMAGES'    .ds label-type pdf-img
 .    if '\\$0'AUTOLABEL_PIC'       .ds label-type pic
 .    if '\\$0'AUTOLABEL_TABLES'    .ds label-type tbl
+.    if '\\$0'AUTOLABEL_IMAGES'    .nr fig*autolabel 1
 .    if !'\\$1'' \{\
 .       ds \\*[label-type]-label-args \\$1
 .       substring \\*[label-type]-label-args -1 -3
@@ -18271,6 +18764,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       if '\\$1'PREFIX_CHAPTER' \{\
 .          nr \\*[label-type]*label-with-chapter 1
 .          shift 1
+.          if \B'\\$1' \{\
+.             nr #CH_NUM \\$1
+.             shift
+.          \}
 .       \}
 .    \}
 .    if '\\*[\\*[label-type]*label-prfx]'' \{\
@@ -18324,6 +18821,26 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .ALIAS AUTOLABEL_PIC       AUTOLABEL
 .ALIAS AUTOLABEL_TABLES    AUTOLABEL
 \#
+\# SET AUTOLABEL NUMBER
+\# --------------------
+\# *Argument:
+\#   FIG | TBL | PIC | EQN <n>
+\# *Function:
+\#   Sets the autolabel number for the corresponding label type.
+\# *Notes:
+\#   Used to set autolabel number when manual labelling of floats
+\#   (in conjunction with TO_LIST) disrupts auto-incrementing.
+\#  =20
+.MAC SET_AUTOLABEL END
+.    rm labelnum-type
+.    if '\\$1'FIG' .ds labelnum-type fig
+.    if '\\$1'TBL' .ds labelnum-type tbl
+.    if '\\$1'PIC' .ds labelnum-type pic
+.    if '\\$1'EQN' .ds labelnum-type eqn
+.    nr labelnum \\$2-1
+.    nr \\*[labelnum-type]*label-num \\n[labelnum] 1
+.END
+\#
 \# MLA STYLE
 \# ---------
 \# *Argument:
@@ -18341,9 +18858,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       nr pic*caption-after-label 1
 .       rr tbl*caption-after-label
 .    \}
-.    el \{\
+.    el \
 .       rr #MLA
-.    \}
 .END
 \#
 .MAC mla@error END
@@ -18358,7 +18874,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \#   LIST_OF_FIGURES
 \#   LIST_OF_TABLES
 \# *Arguments:
-\#   TITLE_STRING <string> START_PAGENUM <pagenumber>
+\#   [ TITLE_STRING <string> ] [ START_PAGENUM <pagenumber> ]
 \# *Function:
 \#   Generates lists-of based on calling alias.
 \# *Notes:
@@ -18368,6 +18884,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \#
 .MAC LISTS_OF END
 .    ds $LIST_TYPE \\$0
+.    nr #LISTS 1
 .    substring $LIST_TYPE -1 -4
 .    if '\\*[$LIST_TYPE]'URES' \{\
 .       ds $LIST_TYPE FIGURES
@@ -18394,6 +18911,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          shift 2
 .       \}
 .    \}
+.    if dPDF.EXPORT \
+.       if \\n[#FLEX_ACTIVE] \
+.          if !\\n[#NO_FLEX] \
+.             tm .ds pre-list-\\n%@\\n[#COL_NUM] 1
 .    char \[leader] " .
 .    LEADER_CHARACTER \[leader]
 .    if \\n[#LINENUMBERS]=3D1 \{\
@@ -18510,7 +19031,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       if \\n[\\*[list-type]*label-width]<100  .nr label-width 2
 .       if \\n[\\*[list-type]*label-width]<10   .nr label-width 1
 .\" Calculate width of label-num tab
-.       nr label-width \w'\0'*(\\n[chapno-width]+\\n[label-width])+\w'.'
+.       nr label-width \w'\0'*(\\n[chapno-width]+\\n[label-width])
 .    \}
 .    if \\n[#SLANT_ON] .nop \\*[SLANTX]
 .    if \\n[#COLUMNS]=3D1 .nr #COLUMNS 0
@@ -18524,6 +19045,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       nr #LINENUMBERS 1
 .       nn 1
 .    \}
+.    rr #LISTS
 .    pdfsync
 .END
 .\"
@@ -18751,19 +19273,17 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       ds list-type eqn
 .       da LIST_OF_EQN
 \!.       nr #LISTS_PN_PADDING \\\\n[#EQN_PN_PADDING]
-.       nr label-width \s[\\n[#LISTS_PS]u]\w'\\$1'\s[0]
 .    \}
 .    if '\\$0'TO_FIGURES' \{\
 .       ds list-type fig
+.       ds label-type fig
 .       da LIST_OF_FIG
 \!.       nr #LISTS_PN_PADDING \\\\n[#FIG_PN_PADDING]
-.       nr label-width \s[\\n[#LISTS_PS]u]\w'\\$1'\s[0]
 .    \}
 .    if '\\$0'TO_TABLES' \{\
 .       ds list-type tbl
 .       da LIST_OF_TBL
 \!.       nr #LISTS_PN_PADDING \\\\n[#TBL_PN_PADDING]
-.       nr label-width \s[\\n[#LISTS_PS]u]\w'\\$1'\s[0]
 .    \}
 .    br
 .    nr #LISTS_ENTRY_PN \\n%+\\n[#PAGE_NUM_ADJ]
@@ -18782,7 +19302,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \!.  PAD_MARKER ^
 \!.  vpt 0
 \!.  PAD \
-"\\*[ST100]\h'\\n[label-width]u'\\*[ST100X]\\*[ST101]\h'\w'\\$2'u'\\*[ST=
101X]\\\\*[$LISTS_PN\\*[_TYPEWRITE]]" \
+"\\*[ST100]\h'\\\\n[label-width]u'\\*[ST100X]\0\0\\*[ST101]\h'\w'\\$2'u'=
\\*[ST101X]\\\\*[$LISTS_PN\\*[_TYPEWRITE]]" \
 "\\*[PDFBOOKMARK.NAME]"
 \!.  PAD_MARKER #
 \!.  EOL
@@ -18801,14 +19321,16 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \!.  TAB 100
 \!.  PDF_LINK \\*[list-type]:\\n[lists*target] "\\$1"
 \!.  TN
+\!.  vpt 0
 \!.  PDF_LINK \\*[list-type]:\\n[lists*target] "\\$2"
 \!.  TN
-\!.  PRINT \\*[LEADER]
+\!.  vpt 0
+\!.  PRINT \fR\\*[LEADER]\f[]
 \!.  TN
 .    if \\n[#PRINT_STYLE]=3D2 \{\
 \!.     FAMILY  \\\\*[$LISTS_PN_FAM]
 \!.     FT      \\\\*[$LISTS_PN_FT]
-\!.     ps \\\\*[$LISTS_PN_SIZE_CHANGE]u
+\!.     ps \\\\*[$LISTS_PN_SIZE_CHANGE]
 .    \}
 \!.  PRINT \\n[#LISTS_ENTRY_PN]
 \!.  TQ
@@ -18830,20 +19352,19 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .ds T&
 \#
 .MAC TS END
-.    di NULL \" Set rule weight for boxed tables
-\D't 500'
-.    di
 .    br
-.    if !\\n[@TOP] \
-.       if \\n[.t]=3D1 .sp \\n[.t]u
+.    ie \\n[@TOP] \
+.       RESTORE_SPACE
+.    el .if \\n[.t]=3D1 .sp \\n[.t]u
 .    rr tbl*have-header
 .    rr float*tbl
+.    rr tbl*boxed
 .    if '\\n[.z]'FLOAT*DIV' .nr float*tbl 1
 .    if !'\\n[.z]'FLOAT*DIV' \{\
 .       if \\n[.t]=3D1 \{\
 .          if !\\n[@TOP] \{\
-.             if \\n[#COL_NUM]=3D\\n[#NUM_COLS] \
-.                NEWPAGE
+.             ie \\n[#COLUMNS] .COL_NEXT internal
+.             el .NEWPAGE
 .          \}
 .       \}
 .    \}
@@ -18874,6 +19395,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          nr tbl*no-shim 1
 .          shift
 .       \}
+.       if '\\$1'NO_FLEX' \{\
+.          nr tbl*no-flex 1
+.          shift
+.       \}
 .       if '\\$1'ADJUST' \{\
 .          ds tbl*space-adj \\$2
 .          shift 2
@@ -18893,6 +19418,11 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          ds label-type tbl
 .          shift 2
 .       \}
+.       if '\\$1'TARGET' \{\
+.          ds target "\\$2
+.          PDF_TARGET "\\*[target]
+.          shift 2
+.       \}
 .    \}
 .    if \\n[tbl*boxed]=3D1 \{\
 .       if (\\n[tbl*have-label]=3D0)&(\\n[tbl*have-caption]=3D0)&\
@@ -18911,15 +19441,12 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    \}
 .    ie \\n[@TOP] \{\
 .       if !'\\n[.z]'FLOAT*DIV' \{\
-.          vpt 0
-.          rr @TOP
-.          ch RR_@TOP
-.          rs
-.          nop \&
+.          RESTORE_SPACE
+.          nr @TOP 1
 .          if \\n[#COLUMNS] \
 .             if !'\\*[tbl*space-adj]'' \
 .                sp \\*[tbl*space-adj]-1v
-.          nr tbl*boxed 2
+.          if \\n[tbl*boxed] .nr tbl*boxed 2
 .          vpt
 .       \}
 .    \}
@@ -18928,15 +19455,23 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    if !\\n[#MLA] \{\
 .      if (\\n[tbl*have-caption]=3D0):(\\n[tbl*caption-after-label]=3D1)=
 \{\
 .         ie !'\\n[.z]'FLOAT*DIV' \{\
-.            sp .5v
-.            if \\n[tbl*boxed] .sp .25v
+.            ie !\\n[tbl*boxed]=3D2 \{\
+.               if \\n[tbl*have-header] .nr tbl*restore-header 1
+.               if !\\n[@TOP] .sp .5v
+.               if \\n[tbl*boxed] .sp .25v
+.               if \\n[tbl*restore-header]=3D1 .nr tbl*have-header 1
+.            \}
+.            el \{\
+.               if !\\n[tbl*boxed] .ns
+.               sp .25v
+.            \}
 .         \}
-.         el .sp 1n
+.         el .sp .25v
 .      \}
 .    \}
-.    if '\\n[.z]'FLOAT*DIV' \{\
+.    if '\\n[.z]'FLOAT*DIV' \
 .       if \\n[defer]>0 .sp .5v
-.    \}
+.    if \\n[@TOP] .rr @TOP
 .    ds ev-current   \\n[.ev]
 .    nr ll-pre-tbl   \\n[.l]
 .    nr lead-pre-tbl \\n[.v]
@@ -18967,20 +19502,32 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       di
 .       ev
 .       PDF_TARGET tbl:\\n+[lists*target]
+.       if \\n[#MLA] .if !\\n[tbl*have-caption] \
+.          mla@error label caption \\n[.F] \\$0 \\n[.c]
 .       if !'\\n[.z]'FLOAT*DIV' \{\
 .          ie !\\n[tbl*boxed] \{\
 .             nr th*needs (u;\\n[dn]+\\n[tbl*needs]v)
 .             if \\n[th*needs]>\\n[.t] \{\
-.                ne \\n[dn]u+\\n[tbl*needs]
+.                if dPDF.EXPORT \
+.                   if \\n[#FLEX_ACTIVE] \
+.                      if !\\n[#NO_FLEX] \
+.                         tm .ds pre-newpage-\\n% \\n%@\\n[#COL_NUM]
+.                ne \\n[dn]u+\\n[tbl*needs]v
 .                nr tbl@needs 1
 .             \}
 .          \}
 .          el \{\
 .             nr th*needs (u;\\n[dn]+2p+\\n[tbl*needs]v)
 .             if \\n[th*needs]>\\n[.t] \{\
-.                ne \\n[dn]u+2p+\\n[tbl*needs]
 .                if \\n[#COLUMNS] \
-.                   if !\\n[#COL_NUM]=3D\\n[#NUM_COLS] .nr tbl*no-top-ho=
ok 1
+.                   if !\\n[#COL_NUM]=3D\\n[#NUM_COLS] \
+.                      nr tbl*no-top-hook 1
+.                nr tbl*no-print-header 1
+.                if dPDF.EXPORT \
+.                   if \\n[#FLEX_ACTIVE] \
+.                      if !\\n[#NO_FLEX] \
+.                         tm .ds pre-newpage-\\n% \\n%@\\n[#COL_NUM]
+.                ne \\n[dn]u+\\n[tbl*needs]v
 .                nr tbl@needs 1
 .             \}
 .          \}
@@ -18997,7 +19544,6 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .             rr tbl@needs
 .          \}
 .          if \\n[tbl*have-caption] .TBL*CAPTION
-.          tbl*print-header
 .       \}
 .       el \{\
 .          nr tbl*header-ht \\n[dn]
@@ -19041,37 +19587,54 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    nh
 .    nf
 .    rr tbl*no-header
-.    if !'\\n[.z]'FLOAT*DIV' \{\
-.       ie \\n[.t]<(\\n[.v]+(\\n[.v]/2u)) \{\
-.          if \\n[tbl*have-label] \{\
-.          rm tbl*header-div
-.          nr tbl*no-top-hook 1
-.          nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
-.          tm1 "[mom]: '\\n[.F]', macro \\$0, line \\n[.c]:
-.          tm1 "        Insufficient room for label, caption, and/or sou=
rce after
-.          tm1 "        table on page \\n[pgnum].  Omitting, but continu=
ing to process.
-.          NEWPAGE
-.          nr tbl*skip-source 1
-.          nr tbl*skip-label 1
-.          ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
-.       \}
-.       \}
-.       el \{\
-.          if \\n[pre-tbl-vfp] \{\
-.            ch FOOTER 0+\\n[pre-tbl-vfp]u
-.            ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
-.            rr pre-tbl-vfp
-.          \}
-.       \}
-.    \}
 .    if !'\\$1'' \{\
 .       if '\\$1'SOURCE' \{\
 .          nr tbl*have-source 1
 .          shift
 .       \}
 .    \}
+.    if !'\\n[.z]'FLOAT*DIV' \{\
+.       ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+.       ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
+.       if \\n[.t]<(\\n[.v]/2u) \{\
+.          ie (\\n[tbl*have-label]=3D1):\
+(\\n[tbl*caption-after-label]=3D1):\
+(\\n[tbl*have-source]=3D1):\
+(\\n[tbl*autolabel]=3D1) \{\
+.             rm tbl*header-div
+.             nr tbl*no-top-hook 1
+.             ie \\n[tbl*autolabel] \
+.                if \\n[#MLA] \
+.                   if !\\n[tbl*have-source] .
+.             el \{\
+.                nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
+.                if \\n[#COLUMNS]=3D1 .ds col-num ", column \\n[#COL_NUM=
]
+.                tm1 "[mom]: '\\n[.F]', macro \\$0, line \\n[.c]:
+.                tm1 "        Insufficient room for label, caption, and/=
or source after
+.                tm1 "        table on page \\n[pgnum]\\*[col-num].  Omi=
tting, but continuing to process table.
+.             \}
+.             nr tbl*skip-source 1
+.             nr tbl*skip-label 1
+.             rr tbl*have-caption
+.             ie \\n[#COLUMNS] \
+.                COL_NEXT internal
+.             el .NEWPAGE
+.          \}
+.          el \{\
+.\" Don't print tbl-header at top of next page or column if tbl
+.\" finishes without room for further input at bottom of page
+.             rm tbl*header-div
+.             nr tbl*no-print-header 1
+.             ie \\n[#COLUMNS] \
+.                COL_NEXT internal
+.             el .NEWPAGE
+.          \}
+.       \}
+.    \}
 .    if !\\n[#MLA] \{\
-.       if (\\n[tbl*have-label]=3D1):(\\n[tbl*autolabel]=3D1):(\\n[tbl*c=
aption-after-label]=3D1) \{\
+.       if (\\n[tbl*have-label]=3D1):\
+(\\n[tbl*autolabel]=3D1):\
+(\\n[tbl*caption-after-label]=3D1) \{\
 .          ev label
 .          evc tbl*end
 .          ie \\n[#PRINT_STYLE]=3D1 .TYPEWRITER
@@ -19093,11 +19656,14 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .                ie !\\n[tbl*caption-after-label] .nop \
 \\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]
 .                el \{\
-.                   nop \\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num=
]\\*[tbl*label-sffx]\|
+.                   nop \
+\\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]\|
 .                   tbl*caption-style
 .                   vs \\n[.ps]u+\\n[tbl*caption-autolead]u
+.                   ds tbl*caption-old \\*[tbl*caption]
 .                   ds tbl*caption " \\*[tbl*caption]
 .                   nop \\*[tbl*caption]
+.                   ds tbl*caption \\*[tbl*caption-old]
 .                \}
 .             \}
 .             el \{\
@@ -19112,30 +19678,39 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .                   \}
 .                \}
 .             \}
-.             if \\n[tbl*autolabel] \
-.                ds tbl*label \\*[chapno]\\n[tbl*label-num]
-.             br
+.            br
 .          \}
 .          di
 .          ev
 .          nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
 .          ie !'\\n[.z]'FLOAT*DIV' \{\
-.             ie \\n[dn]>\\n[.t] \{\
+.             rr tbl*have-header
+.             rr tbl*have-caption
+.             ie (\\n[dn]-\\n[.v])>\\n[.t] \{\
+.                if \\n[#COLUMNS]=3D1 .ds col-num ", column \\n[#COL_NUM=
]
 .                tm1 "[mom]: '\\n[.F]', macro \\$0, line \\n[.c]:
 .                tm1 "        Insufficient room for label, caption, and/=
or source after
-.                tm1 "        table on page \\n[pgnum].  Omitting, but c=
ontinuing to process.
+.                tm1 "        table on page \\n[pgnum]\\*[col-num].  Omi=
tting, but continuing to process.
+.                ie \\n[#COLUMNS] \
+.                   COL_NEXT internal
+.                el .NEWPAGE
 .                if d tbl*header-div .rm tbl*header-div
 .                rr tbl*caption-top-lead-diff
 .                rr tbl*have-header
 .                nr tbl*skip-source 1
 .                nr tbl*skip-label 1
-.                NEWPAGE
 .             \}
 .             el .print-label
 .          \}
 .          el .print-label
 .       \}
 .    \}
+.    if \\n[tbl*autolabel] \{\
+.       ds tbl*label \\*[chapno]\\n[tbl*label-num]
+.       if dLABEL.REFS \
+.          tm .ds \\*[target] \\*[chapno]\\n[tbl*label-num]
+.       rm target
+.    \}
 .    if !'\\*[tbl*caption-short]'' .ds short -short
 .    ie !'\\*[tbl*label]'' \
 .       TO_TABLES "\\*[tbl*label]" "\\*[tbl*caption\\*[short]]"
@@ -19183,169 +19758,212 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    \}
 .    ev
 .    if !\\n[tbl*plain] \{\
-.       ie \\n[tbl*plain-boxed] .sp 1
-.       el .sp .5v
+.       if !\\n[tbl*no-print-header] \{\
+.          ie \\n[tbl*plain-boxed] \{\
+.             ie \\n[#MLA] .if !\\n[tbl*have-source] .sp .5
+.             el .sp
+.          \}
+.          el \
+.             if !\\n[tbl*have-source] .sp .5
+.          if '\\n[.z]'FLOAT*DIV' .nr chop-space 1
+.       \}
 .    \}
 .    ll \\n[ll-pre-tbl]u
+.    if (\\n[nl]=3D\\n[dc]):(\\n[nl]=3D\\n[#PAGE_TOP]) .ns
 .    if !'\\*[tbl*space-adj]'' .sp -\\*[tbl*space-adj]u
-.    if !\\n[tbl*no-shim] .SHIM
+.    if \\n[#MLA] \
+.       sp .5v
+.    ie !\\n[tbl*no-shim] \{\
+.       ie !\\n[#NO_SHIM] \
+.          if !'\\n[.z]'FLOAT*DIV' .SHIM
+.       el \
+.          if !\\n[tbl*no-flex] \
+.             if !\\n[#NO_FLEX] \
+.                if !'\\n[.z]'FLOAT*DIV' .FLEX
+.    \}
+.    el \
+.       if !\\n[tbl*no-flex] \
+.          if !\\n[#NO_FLEX] \
+.             if !'\\n[.z]'FLOAT*DIV' .FLEX
 .    TBL*CLEANUP
 .END
 \#
 \# Utility macros for tbl
 \#
 .MAC TBL*CAPTION END
-.    if \\n[tbl*have-caption] \{\
-.       vs \\n[.ps]u+\\n[tbl*caption-autolead]u
-.       nr tbl*caption-lead-diff \\n[lead-pre-tbl]-\\n[.v]
-.       nr tbl*caption-top-lead-diff \\n[tbl*caption-lead-diff]
-.       ie !\\n[#MLA] \{\
-.          if !\\n[tbl*caption-after-label] \{\
-.             ie !'\\n[.z]'FLOAT*DIV' \{\
-.                ie (\\n[nl]=3D\\n[#PAGE_TOP]):(\\n[nl]=3D\\n[dc]) \{\
-.                   ie \\n[#COLUMNS] .sp |\\n[dc]u
-.                   el .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
-.                   sp \\n[tbl*caption-lead-diff]u
-.                \}
-.                el .sp .5v
-.             \}
-.             el .sp .5v
+.    ev caption
+.    evc \\*[ev-current]
+.    vs \\n[.ps]u+\\n[tbl*caption-autolead]u
+.    nr caption-lead \\n[.v]
+.    nr tbl*caption-lead-diff \\n[lead-pre-tbl]-\\n[.v]
+.    nr tbl*caption-top-lead-diff \\n[tbl*caption-lead-diff]
+.    ie !\\n[#MLA] \{\
+.       if !\\n[tbl*caption-after-label] \{\
+.          ie !'\\n[.z]'FLOAT*DIV' \{\
+.             ie (\\n[nl]=3D\\n[#PAGE_TOP]):(\\n[nl]=3D\\n[dc]) \{\
+.                ie \\n[#COLUMNS] .sp |\\n[dc]u
+.                el .sp |\\n[#T_MARGIN]u-\\n[#DOC_LEAD]u
+.                sp \\n[tbl*caption-lead-diff]u
+                \}
+.             el .sp \\n[#DOC_LEAD]u/2u
 .          \}
-.          ev caption
-.          evc \\*[ev-current]
-.          nh
+.          el .sp \\n[#DOC_LEAD]u/2u
 .       \}
-.       el \{\
-.          if !\\n[tbl*autolabel] \{\
-.             ie !\\n[tbl*have-label] \
-.                mla@error caption label \\n[.F] \\$0 \\n[.c]
-.             el .ev label
-.          \}
+.       nh
+.    \}
+.    el \{\
+.       if !\\n[tbl*autolabel] \{\
+.          ie !\\n[tbl*have-label] \
+.             mla@error caption label \\n[.F] \\$0 \\n[.c]
+.          el .ev label
 .       \}
-.       ie \\n[#PRINT_STYLE]=3D1 .nr tmp-ind 2m
-.       el .nr tmp-ind 1.25m
-.       ie \\n[#PRINT_STYLE]=3D1 .TYPEWRITER
-.       el \{\
-.          if !\\n[#MLA] \{\
-.             tbl*caption-style
-.             nr lead-current \\n[.v]
-.          \}
+.    \}
+.    ie \\n[#PRINT_STYLE]=3D1 .nr tmp-ind 2m
+.    el .nr tmp-ind 1.25m
+.    ie \\n[#PRINT_STYLE]=3D1 .TYPEWRITER
+.    el \{\
+.       if !\\n[#MLA] \{\
+.          tbl*caption-style
+.          nr lead-current \\n[.v]
 .       \}
-.       ie !\\n[#MLA] \{\
-.          ie !\\n[tbl*caption-after-label] \{\
-.             di tbl*caption-div
-\!.           in -\\n[ind-pre-tbl]u
-.             TBL*SET_CAPTION_QUAD \\*[tbl*caption-quad]
-.             nop \\*[tbl*caption]
-.             br
-.             di
-.             if !'\\n[.z]'FLOAT*DIV' \{\
-.                nr caption-needs 2
-.                if (\\n[dn]+(\\n[#DOC_LEAD]*(\\n[tbl*needs]*2)))>\\n[.t=
] \{\
-.                   nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1
-.                   ie \\n[#COL_NUM]=3D\\n[#NUM_COLS] \{\
-.                      tm1 "[mom]: Table with caption at line \\n[.c] do=
es not fit on page \\n[pgnum].
-.                      tm1 "       Shifting table to page \\n+[pgnum].
-.                      rr tbl*no-header
-.                      NEWPAGE
-.                   \}
-.                   el \{\
-.                      sp \\n[.t]u
-.                      sp |\\n[#PAGE_TOP]u+\\n[tbl*caption-lead-diff]u
-.                   \}
+.    \}
+.    ie !\\n[#MLA] \{\
+.       ie !\\n[tbl*caption-after-label] \{\
+.          di tbl*caption-div
+\!.        in -\\n[ind-pre-tbl]u
+.          TBL*SET_CAPTION_QUAD \\*[tbl*caption-quad]
+.          nop \\*[tbl*caption]
+.          br
+.          di
+.          evc 0
+.          if !'\\n[.z]'FLOAT*DIV' \{\
+.             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
+.             ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_=
LEAD]u
+.             nr caption-needs 2
+.             ie \\n[tbl*boxed] .nr tbl*lead \\n[.v]+3n
+.             el .nr tbl*lead \\n[.v]
+.             if \
+(\\n[dn]+(\\n[tbl*lead]*(\\n[tbl*needs]+1)))>=3D\\n[.t] \{\
+.                nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
+.                if \\n[#COLUMNS]=3D1 .ds col-num ", column \\n[#COL_NUM=
]
+.                tm1 \
+"[mom]: Table with caption at line \\n[.c] \
+does not fit on page \\n[pgnum]\\*[col-num].
+.                   tm1 \
+"       Shifting table to next page or column.
+.                ie (\\n[#COLUMNS]=3D1)&(\\n[#COL_NUM]=3D\\n[#NUM_COLS])=
 \{\
+.                   rr tbl*no-header
+.                   NEWPAGE
 .                \}
-.             \}
-.             if \\n[.u] .nr fill 1
-.             nf
-.             if \\n[.ns] .RESTORE_SPACE
-.             tbl*caption-div
-.             if \\n[#PRINT_STYLE]=3D1 .sp .5v
-.             if !'\\*[tbl*caption-space]'' \
-.                sp \\*[tbl*caption-space]
-.             if \\n[tbl*caption-lead-diff-adj] \{\
-.                sp -\\n[tbl*caption-lead-diff]u
-.                rr tbl*label-lead-diff-adj
-.             \}
-.             if \\n[fill] .fi
-.             rr fill
-.          \}
-.          el \{\
-.             if (\\n[tbl*have-label]=3D0) \{\
-.                if !\\n[tbl*autolabel] \{\
-.                   tm1 "[mom]: CAPTION_AFTER_LABEL enabled, but no labe=
l given
-.                   tm1 "       for table at line \\n[.c].
-.                   tm1 "       Skipping caption but continuing to proce=
ss.
+.                el \{\
+.                   nr tbl*no-top-hook -1
+.                   sp \\n[.t]u
+.                   ie \\n[#COLUMNS] \
+.                      sp |\\n[dc]u+\\n[tbl*caption-lead-diff]u
+.                   el .sp |\\n[#PAGE_TOP]u+\\n[tbl*caption-lead-diff]u
 .                \}
 .             \}
+.             ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+.             ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
 .          \}
+.          if \\n[.u] .nr fill 1
+.          nf
+.          if \\n[.ns] .RESTORE_SPACE
+.          tbl*caption-div
+.          if \\n[#PRINT_STYLE]=3D1 .sp .5v
+.          if !'\\*[tbl*caption-space]'' \
+.             sp \\*[tbl*caption-space]
+.          if \\n[tbl*caption-lead-diff-adj] \{\
+.             sp -\\n[tbl*caption-lead-diff]u
+.             rr tbl*label-lead-diff-adj
+.          \}
+.          if \\n[fill] .fi
+.          rr fill
 .       \}
 .       el \{\
-.          if (\\n[tbl*have-label]=3D1):(\\n[tbl*autolabel]=3D1) \{\
-.             ie !\\n[tbl*have-caption] \
-.                mla@error label caption \\n[.F] \\$0 \\n[.c]
-.             el \{\
-.                ie !'\\n[.z]'FLOAT*DIV' \{\
-.                   ie (\\n[nl]=3D\\n[#PAGE_TOP]):(\\n[nl]=3D\\n[dc]) \{=
\
-.                      ie !\\n[#COLUMNS] .sp |\\n[#PAGE_TOP]u+\\n[tbl*ca=
ption-lead-diff]u
-.                      el .sp |\\n[dc]u+\\n[tbl*caption-lead-diff]u
-.                   \}
-.                   el .sp .5v
-.                \}
-.                el .sp .5v
-.             \}
-.             ev label
-.             evc \\*[ev-current]
-.             nh
-.             ie \\n[#PRINT_STYLE]=3D1 .TYPEWRITER
-.             el \{\
-.                tbl*label-style
-.                vs \\n[.ps]u+\\n[tbl*label-autolead]u
-.                nr tbl*label-lead-diff \\n[lead-pre-tbl]-\\n[.v]
-.             \}
-.             if \\n[tbl*label-with-chapter] \
-.                ds chapno \\n[#CH_NUM].
-.             TBL*SET_LABEL_QUAD \\*[tbl*label-quad]
-.             di tbl*mla-label-caption
-.             ie '\\*[tbl*label-quad]'L' \{\
-\!.              in -\\n[ind-pre-tbl]u
-\!.              in \\n[tmp-ind]u
-\!.              ti -\\n[tmp-ind]u
+.          if (\\n[tbl*have-label]=3D0) \{\
+.             if !\\n[tbl*autolabel] \{\
+.                tm1 "[mom]: CAPTION_AFTER_LABEL enabled, but no label g=
iven
+.                tm1 "       for table at line \\n[.c].
+.                tm1 "       Skipping caption but continuing to process.
 .             \}
-.             el \{\
-.                if \\n[tbl*label-quad-on-ll] \{\
-.                   if '\\n[tbl*label-quad]'L' \
-\!.                 in
+.          \}
+.       \}
+.    \}
+.    el \{\
+.       if (\\n[tbl*have-label]=3D1):(\\n[tbl*autolabel]=3D1) \{\
+.          ie !\\n[tbl*have-caption] \
+.             mla@error label caption \\n[.F] \\$0 \\n[.c]
+.          el \{\
+.             ie !'\\n[.z]'FLOAT*DIV' \{\
+.                ie (\\n[nl]=3D\\n[#PAGE_TOP]):(\\n[nl]=3D\\n[dc]) \{\
+.                   ie !\\n[#COLUMNS] \
+.                      sp |\\n[#PAGE_TOP]u+\\n[tbl*caption-lead-diff]u
+.                   el .sp |\\n[dc]u+\\n[tbl*caption-lead-diff]u
 .                \}
+.                el .sp .5v
 .             \}
-.             ie \\n[tbl*autolabel] \
-.                nop \
-\\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]
-.             el .if !'\\*[tbl*label]'' .nop \\*[tbl*label]
-.             if \\n[tbl*autolabel] \
-.                ds tbl*label \\*[chapno]\\n[tbl*label-num]
-.             br
-.             di
+.             el .sp .5v
 .          \}
-.          da tbl*mla-label-caption
+.          ev label
+.          evc \\*[ev-current]
+.          nh
 .          ie \\n[#PRINT_STYLE]=3D1 .TYPEWRITER
-.          el .tbl*caption-style
-.          if '\\*[tbl*caption-quad]'L' \{\
+.          el \{\
+.             tbl*label-style
+.             vs \\n[.ps]u+\\n[tbl*label-autolead]u
+.             nr tbl*label-lead-diff \\n[lead-pre-tbl]-\\n[.v]
+.          \}
+.          if \\n[tbl*label-with-chapter] \
+.             ds chapno \\n[#CH_NUM].
+.          TBL*SET_LABEL_QUAD \\*[tbl*label-quad]
+.          di tbl*mla-label-caption
+.          ie '\\*[tbl*label-quad]'L' \{\
+\!.           in -\\n[ind-pre-tbl]u
+\!.           in \\n[tmp-ind]u
 \!.           ti -\\n[tmp-ind]u
-\!.           fi
 .          \}
-.          nop \\*[tbl*caption]
+.          el \{\
+.             if \\n[tbl*label-quad-on-ll] \{\
+.                if '\\n[tbl*label-quad]'L' \
+\!.              in
+.             \}
+.          \}
+.          ie \\n[tbl*autolabel] \
+.             nop \
+\\*[tbl*label-prfx]\\*[chapno]\\n+[tbl*label-num]\\*[tbl*label-sffx]
+.          el .if !'\\*[tbl*label]'' .nop \\*[tbl*label]
+.          if \\n[tbl*autolabel] \
+.             ds tbl*label \\*[chapno]\\n[tbl*label-num]
 .          br
-\!.        in
-.          da
+.          di
+.       \}
+.       da tbl*mla-label-caption
+.       ie \\n[#PRINT_STYLE]=3D1 .TYPEWRITER
+.       el .tbl*caption-style
+.       if '\\*[tbl*caption-quad]'L' \{\
+\!.        ti -\\n[tmp-ind]u
+\!.        fi
 .       \}
+.       nop \\*[tbl*caption]
+.       br
+\!.     in
+.       da
 .       if !'\\n[.z]'FLOAT*DIV' \{\
+.          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
+.          ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_LEA=
D]u
 .          ie \\n[#MLA] .nr caption-needs 3
 .          el .nr caption-needs 2
-.          if (\\n[dn]+(\\n[#DOC_LEAD]*(\\n[tbl*needs]+\\n[caption-needs=
])))>\\n[.t] \{\
-.             nr pgnum \\n%+\\n[#PAGE_NUM_ADJ] 1
-.             ie \\n[#COL_NUM]=3D\\n[#NUM_COLS] \{\
-.                tm1 "[mom]: Table with caption at line \\n[.c] does not=
 fit on page \\n[pgnum].
-.                tm1 "       Shifting table to page \\n+[pgnum].
+.          if \
+(\\n[dn]+(\\n[#DOC_LEAD]*\\n[tbl*needs])+(\\n[caption-needs]*\\n[caption=
-lead]))>\\n[.t] \{\
+.             nr pgnum \\n%+\\n[#PAGE_NUM_ADJ]
+.             if \\n[#COLUMNS] .ds col-num ", column \\n[#COL_NUM]
+.             tm1 \
+"[mom]: Table with caption at line \\n[.c] \
+does not fit on page \\n[pgnum]\\*[col-num].
+.             tm1 \
+"       Shifting table to next column or page.
+.             ie (\\n[#COLUMNS]=3D1)&(\\n[#COL_NUM]=3D\\n[#NUM_COLS]) \{=
\
 .                rr tbl*no-header
 .                if \\n[defer] .nr skip-th-warning 1
 .                NEWPAGE
@@ -19353,15 +19971,22 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .             el \{\
 .                nr tbl*no-top-hook 1
 .                sp \\n[.t]u
-.                if (\\n[tbl*caption-after-label]=3D1):(\\n[tbl*plain]) =
\
+.                if (\\n[tbl*caption-after-label]=3D1):(\\n[tbl*plain]=3D=
1) \
 .                   sp 1n-2p
 .             \}
 .          \}
+.          ch FOOTER \\n[#VARIABLE_FOOTER_POS]u
+.          ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u
 .       \}
 .       nf
 .       if (\\n[nl]=3D\\n[#PAGE_TOP]):(\\n[nl]=3D\\n[dc]) \
 .          nr tbl*label-lead-diff-adj 1
 .       ie (\\n[.t]>1)&(\\n[@TOP]=3D0) \{\
+.          if !\\n[#NO_FLEX] \{\
+.             NO_FLEX
+.             nr #RESTORE_FLEX 1
+.          \}
+.          if \\n[.ns] .rs
 .          sp \\n[tbl*label-lead-diff]u
 .       \}
 .       el \{\
@@ -19372,32 +19997,37 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .             el .sp .5v
 .       \}
 .       tbl*mla-label-caption
-.       ie \\n[#PRINT_STYLE]=3D1 .sp .5v
-.       el .sp .5n
-.       if \\n[tbl*label-lead-diff-adj] \{\
-.          sp -\\n[tbl*label-lead-diff]u
-.          rr tbl*label-lead-diff-adj
-.       \}
-.       br
-.       if !'\\*[tbl*caption-space]'' .sp \\*[tbl*caption-space]
 .    \}
-.    if !'\\n[.ev]'0' .ev
+.    ie \\n[#PRINT_STYLE]=3D1 .sp .5v
+.    el .sp .5n
+.    if \\n[tbl*label-lead-diff-adj] \{\
+.       sp -\\n[tbl*label-lead-diff]u
+.       rr tbl*label-lead-diff-adj
+.    \}
+.    br
+.    if !'\\*[tbl*caption-space]'' .sp \\*[tbl*caption-space]
+\!.  if \\\\n[float*tbl] .ev FLOAT
+.    ev \\*[ev-current]
 .END
 \#
 .MAC TBL*CLEANUP END
+.    if !'\\n[.ev]'\\*[ev-current]' .ev \\*[ev-current]
 .    if !'\\n[.z]'FLOAT*DIV' \{\
 .       rr tbl*center
 .       rm tbl*header-div
 .       rr tbl*caption-top-lead-diff
 .    \}
 .    rr tbl*have-header
+.    rr tbl*no-print-header
 .    if !'\\n[.z]'FLOAT*DIV' \{\
 .       rr tbl*have-caption
 .       rr tbl*have-label
 .    \}
+.    rr tbl*skip-label
+.    rr tbl*skip-source
 .    rr tbl*label-warning
 .    rr tbl*no-shim
-.    rr tbl*skip-source
+.    rr tbl*no-flex
 .    if !'\\n[.z]'FLOAT*DIV' \{\
 .       rm short
 .       rm tbl*caption
@@ -19410,31 +20040,36 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    rr tbl*have-label
 .    rr tbl*plain
 .    if '\\*[tbl*label-sffx-tmp]'.' .ds tbl*label-sffx .
+.    if \\n[#RESTORE_FLEX] \{\
+.       NO_FLEX off
+.       rr #RESTORE_FLEX
+.    \}
 .END
 \#
 .MAC print-label END
 .    if \\n[.u] .nr fill 1
 .    nf
-.    if !\\n[tbl*skip-label] \{\
+.    if !\\n[tbl*skip-label] \
 .       tbl*label-div
-.    \}
 .    if \\n[fill] .fi
 .    rr fill
 .END
 \#
 .MAC tbl@top-hook END
 .    if \\n[tbl*have-header] \{\
-.       nf
-.       rr @TOP
-.       ch RR_@TOP
-.       ev top-hook
-.       evc 0
-.       rs
-.       nop \&
-.       ie !\\n[tbl*boxed] .sp -1
-.       el .sp -1n
-.       tbl*print-header
-.       ev
+.       if !r tbl*no-print-header \{\
+.          nf
+.          rr @TOP
+.          ch RR_@TOP
+.          ev top-hook
+.          evc 0
+.          rs
+.          nop \&
+.          ie !\\n[tbl*boxed] .sp -1
+.          el .sp -1n
+.          tbl*print-header
+.          ev
+.       \}
 .    \}
 .END
 \#
@@ -19444,7 +20079,9 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       nr fill 1
 .    \}
 .    if \\n[#COL_NUM]>1 \
-.       sp 2p
+.       if !\\n[tbl*have-caption] \
+.          if (\\n[@TOP]=3D1):(\\n[nl]=3D\\n[dc]) \
+.             sp 2p
 .    ie d tbl*header-div:\\n[loop-count] \
 .       tbl*header-div:\\n[loop-count]
 .    el .tbl*header-div
@@ -19452,14 +20089,12 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       if \\n[tbl*center] .ce 1000
 .    mk #T
 .    if !'\\n[.z]'FLOAT*DIV' \{\
-.       nr pre-tbl-vfp 0+\\n[#VARIABLE_FOOTER_POS]
 .       ch FOOTER \\n[#VARIABLE_FOOTER_POS]u+\\n[#DOC_LEAD]u
 .       ch FN_OVERFLOW_TRAP -\\n[#FN_OVERFLOW_TRAP_POS]u+\\n[#DOC_LEAD]u
 .    \}
 .END
 \#
 .MAC tbl@bottom-hook END
-.       if \\n[.ns] .rs
 .       rr #DIVERTED
 .       rr @TOP
 .       ch RR_@TOP
@@ -19534,10 +20169,6 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .                ds eqn*space-adj \\$2
 .                shift 2
 .             \}
-.             if '\\$1'NO_SHIM' \{\
-.                nr eqn*no-shim 1
-.                shift 1
-.             \}
 .             if '\\$1'LABEL' \{\
 .                ds eqn*label \\$2
 .                ds label-type eqn
@@ -19555,6 +20186,19 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .                ds eqn*caption-short \\$2
 .                shift 2
 .             \}
+.             if '\\$1'TARGET' \{\
+.                ds target "\\$2
+.                PDF_TARGET "\\*[target]
+.                shift 2
+.             \}
+.             if '\\$1'NO_SHIM' \{\
+.                nr @no-shim 1
+.                shift 1
+.             \}
+.             if '\\$1'NO_FLEX' \{\
+.                nr eqn*no-flex
+.                shift
+.             \}
 .          \}
 .       \}
 .       if '\\*[eqn*shift-label]'' .ds eqn*shift-label 0
@@ -19588,7 +20232,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .END
 \#
 .MAC EN END
-.    if !'\\n(.z'eqn*div' \{\
+.    if !'\\n[.z]'eqn*div' \{\
 .       @error mismatched EN
 .       return
 .    \}
@@ -19776,12 +20420,25 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       if !\\n[continued] \{\
 .          sp \\*[DD]
 .          if !'\\*[eqn*space-adj]'' .sp -\\*[eqn*space-adj]u
-.          if !'\\n[.z]'FLOAT*DIV' \{\
-.             if !\\n[eqn*no-shim] .SHIM
+.          ie !\\n[eqn*no-shim] \{\
+.             ie !\\n[#NO_SHIM] \
+.                if !'\\n[.z]'FLOAT*DIV' .SHIM
+.             el \
+.                if !\\n[eqn*no-flex] \
+.                   if !\\n[#NO_FLEX] \
+.                      if !'\\n[.z]'FLOAT*DIV' .FLEX
 .          \}
+.          el \
+.             if !\\n[eqn*no-flex] \
+.                if !\\n[#NO_FLEX] \
+.                   if !'\\n[.z]'FLOAT*DIV' .FLEX
 .          if !'\\*[eqn*caption-short]'' .ds short -short
-.          if \\n[eqn*autolabel] \
+.          if \\n[eqn*autolabel] \{\
 .             ds eqn*label \\*[chapno]\\n[eqn*label-num]
+.                if dLABEL.REFS \
+.                   tm .ds \\*[target] \\*[chapno]\\n[eqn*label-num]
+.                rm target
+.          \}
 .          ie !'\\*[eqn*label]'' \
 .             TO_EQUATIONS "\\*[eqn*label]" "\\*[eqn*caption\\*[short]]"
 .          el .TO_EQUATIONS "\\*[eqn*caption\\*[short]]"
@@ -19812,17 +20469,17 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .MAC ADD_CAPTION END
 .    ie \\n[.t]<\\n[.v] \{\
 .       if !'\\n[.z]'FLOAT*DIV' \{\
-.          if \\n[#COL_NUM]=3D\\n[#NUM_COLS] \{\
-.             tm1 "[mom]: '\\n[.F]', macro EQ, line \\n[eqn-linenum]: In=
sufficient room for
-.             tm1 "        equation caption on page \\n[pgnum].
-.             tm1 "        Skipping caption, but continuing to process.
-.             if !\\n[@TOP] \{\
-.                if \\n[#COL_NUM]=3D\\n[#NUM_COLS] \
-.                   NEWPAGE
-.             \}
-.             rr eqn-linenum
-.             rr pgnum
+.          if \\n[#COLUMNS]=3D1 .ds col-num ", column \\n[#COL_NUM]
+.          tm1 "[mom]: '\\n[.F]', macro EQ, line \\n[eqn-linenum]:
+.          tm1 "       Insufficient room for equation caption on page \\=
n[pgnum]\\*[col-num].
+.          tm1 "       Skipping caption but continuing to process.
+.          if !\\n[@TOP] \{\
+.             ie \\n[#COLUMNS] \
+.                COL_NEXT internal
+.             el .NEWPAGE
 .          \}
+.          rr eqn-linenum
+.          rr pgnum
 .       \}
 .    \}
 .    el \{\
@@ -19948,19 +20605,15 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          el .ds pic*scale-width \\$2
 .       \}
 .    \}
-. \" This is a bit confusing. pic is decorated with 2 args (width
-. \" and height), which are read during pre-processing but have to be
-. \" ignored when parsing args during main processing.  We shift pic's
-. \" args out of the way, then pop them off the arg stack because
-. \" they're not needed during macro processing.
+.\" This is a bit confusing. pic is decorated with 2 args (width
+.\" and height), which are read during pre-processing but have to be
+.\" ignored when parsing args during main processing.  We shift pic's
+.\" args out of the way, then pop them off the arg stack because
+.\" they're not needed during macro processing.
 .    while \B'\\$1' .shift
 .    nr loop-counter \\n[#NUM_ARGS]
 .    nr loop-count 0 1
 .    while \\n+[loop-count]<=3D\\n[loop-counter] \{\
-.       if '\\$1'NO_SHIM' \{\
-.          nr float*no-shim 1
-.          shift 1
-.       \}
 .       if '\\$1'LEFT' \{\
 .          nr pic*left 1
 .          shift 1
@@ -19980,6 +20633,19 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .          ds label-type pic
 .          shift 2
 .       \}
+.       if '\\$1'TARGET' \{\
+.          ds target "\\$2
+.          PDF_TARGET "\\*[target]
+.          shift 2
+.       \}
+.       if '\\$1'NO_SHIM' \{\
+.          nr @no-shim 1
+.          shift 1
+.       \}
+.       if '\\$1'NO_FLEX' \{\
+.          nr @no-flex 1
+.          shift 1
+.       \}
 .    \}
 .    ds pic*label-sffx-tmp \\*[pic*label-sffx]
 .    substring pic*label-sffx-tmp -1
@@ -20028,12 +20694,10 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .MAC PE END
 .    di
 .    nr pic*div-width \\n[dl]
-.    if \\n[@TOP] \{\
+.    if \\n[@TOP] \
 .       RESTORE_SPACE
-.    \}
 .    sp \\n[lead-pre-pic]u/2u
 .    if (\\n[pic*have-caption]=3D1)&(\\n[pic*caption-after-label]=3D0) \=
{\
-.       sp .5v
 .       ev caption
 .       evc \\*[ev-current]
 .       nh
@@ -20079,12 +20743,15 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .       sp \\n[lead-pre-label]u-\\n[.v]u
 .       if !'\\*[pic*label-space]'' .sp \\*[pic*label-space]
 .       if \\n[#PRINT_STYLE]=3D1 .sp .5v
-.       ie \\n[pic*autolabel] \
-.         nop \
+.       ie \\n[pic*autolabel] \{\
+.          nop \
 \\*[pic*label-prfx]\\*[chapno]\\n+[fig*label-num]\\*[pic*label-sffx]\|
-.       el .if !'\\*[pic*label]'' .nop \\*[pic*label]
-.       if \\n[pic*autolabel] \
 .          ds pic*label \\*[chapno]\\n[fig*label-num]
+.          if dLABEL.REFS \
+.             tm .ds \\*[target] \\*[chapno]\\n[fig*label-num]
+.          rm target
+.       \}
+.       el .if !'\\*[pic*label]'' .nop \\*[pic*label]
 .       fam
 .       ft
 .       ps
@@ -20250,9 +20917,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 \#
 .MAC HYPHENATE_REFS END
 .    ie '\\$1'' .nr #REF_HY 1
-.    el \{\
+.    el \
 .       if r #REF_HY .rr #REF_HY
-.    \}
 .END
 \#
 \# The remainder of the definitions in this section are modified
@@ -20455,9 +21121,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .de ref*add-A
 .ds eval*[A \\*([A
 .substring eval*[A -1
-.if '\\*[eval*[A]'.' \{\
+.if '\\*[eval*[A]'.' \
 .   if !'\\*[$REF_STYLE]'NOTE' .chop [A
-.\}
 .\" Per MLA, NOTE should not use idem, therefore if %i contains other th=
an
 .\" idem (eg. ed., trans.), transpose it to after author's name
 .ie '\\*[$REF_STYLE]'NOTE' \{\
@@ -20537,9 +21202,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 ..
 \# %T Title of a chapter or article
 .de ref*add-T2
-.ie '\\*[$REF_STYLE]'NOTE' \{\
+.ie '\\*[$REF_STYLE]'NOTE' \
 .   ref*field T , \[lq] "" \[rq]
-.\}
 .el \{\
 .   ie '\\*([A'' \{\
 .      ref*field T . \[lq] "" \[rq]
@@ -20699,9 +21363,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 ..
 \# %V Volume (of a journal, or series of books); for journals, %N may be=
 preferable
 .de ref*add-V
-.if \\n[ref*type]=3D1 \{\
+.if \\n[ref*type]=3D1 \
 .   ref*field V
-.\}
 .if \\n[ref*type]=3D2 \{\
 .   ie '\\*[$REF_STYLE]'NOTE' .ref*field V , "vol. "
 .   el \{\
@@ -20721,9 +21384,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 ..
 \# %S Series (books or journals)
 .de ref*add-S
-.if \\n[ref*type]=3D1 \{\
+.if \\n[ref*type]=3D1 \
 .   ref*field S
-.\}
 .if \\n[ref*type]=3D2 \{\
 .   ie '\\*[$REF_STYLE]'NOTE' \{\
 .      ie \\n([T .ref*field S
@@ -20753,9 +21415,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .      ref*field C
 .      rr [d
 .   \}
-.   el \{\
+.   el \
 .      ref*field C "" \*[FU 2](
-.   \}
 .   if \\n([T .nr ref*suppress-period \\n([T
 .\}
 .el \{\
@@ -20789,9 +21450,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .   ie '\\*[$REF_STYLE]'NOTE' .ref*field D ,
 .   el .ref*field D . " "
 .\}
-.if \\n[ref*type]=3D1 \{\
+.if \\n[ref*type]=3D1 \
 .   ref*field D "" "(" ")"
-.\}
 .if \\n[ref*type]=3D2 \{\
 .   ie '\\*[$REF_STYLE]'NOTE' .ref*field D , "" )
 .   el .ref*field D ,
@@ -20807,9 +21467,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .         substring eval*[D 0 -4
 .         ie '\\*[eval*[D]'1' .ds kern \*[BU3]
 .         el .ds kern \*[BU2]
-.         ie \\n[#PRINT_STYLE]=3D2 \{\
+.         ie \\n[#PRINT_STYLE]=3D2 \
 .           if '\\*[$REF_STYLE]'NOTE' .ref*field D "" (\\*[kern] )
-.         \}
 .         el .ref*field D
 .      \}
 .      rm eval*[D
@@ -20852,9 +21511,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .substring initial*cap 0 0
 .ds [O*string \\*([O
 .substring [O*string 1
-.if '\\*[$REF_STYLE]'BIBLIO' \{\
+.if '\\*[$REF_STYLE]'BIBLIO' \
 .   ds [O \E*[UC]\\*[initial*cap]\E*[LC]\\*[[O*string]
-.\}
 .ie '\\*[$REF_STYLE]'NOTE' .ref*field O ,
 .el \{\
 .   if \\n([O=3D1 .chop [O
@@ -21040,9 +21698,8 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    \}
 .    nr #ARGS  0 1
 .    nr #COUNT 9
-.    while \\n+[#ARGS]<=3D\\n[#COUNT] \{\
+.    while \\n+[#ARGS]<=3D\\n[#COUNT] \
 .      ds $MN-arg\\n[#ARGS] @
-.    \}
 .    nr #FLAG 0 1
 .    nr #COUNT \\n[#NUM_ARGS]
 .    while \\n+[#FLAG]<=3D\\n[#COUNT] \{\
@@ -21170,18 +21827,16 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .    nr MN-right-width (n;\\$2)
 .    nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
 .    if \\n[#COLUMNS]=3D1 \{\
-.      if !\\n[#NUM_COLS]=3D1 \{\
+.      if !\\n[#NUM_COLS]=3D1 \
 .        nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + =
\\n[MN-sep])
-.      \}
 .    \}
 .  \}
 .  el \{\
 .    nr MN-right-width \\n[MN-left-width]
 .    nr MN-right-start (\\n[.o] + \\n[.l] + \\n[MN-sep])
 .    if \\n[#COLUMNS]=3D1 \{\
-.      if !\\n[#NUM_COLS]=3D1 \{\
+.      if !\\n[#NUM_COLS]=3D1 \
 .        nr MN-right-start (\\n[#COL_2_L_MARGIN] + \\n[#COL_L_LENGTH] + =
\\n[MN-sep])
-.      \}
 .    \}
 .  \}
 .  ie \A'\\$4' \{\
@@ -21373,7 +22028,7 @@ E\\R'#CAP_HEIGHT \\n[.cht]'
 .            sp -(1v+\\n[#SHIM]u)
 .            rm MN-div-\\*[l-r]-\\n[MN-curr]
 .            tm1 "[mom]: \
-No room to start \\*[MN-pos] margin note #\\n[MN-curr] on page \\n[#P] o=
n page \\n[#P].
+No room to start \\*[MN-pos] margin note #\\n[MN-curr] on page \\n[#P].
 .            tm1 "      Ignoring margin note.
 .            rr MN-shifted
 .         \}
@@ -21472,9 +22127,8 @@ No room to start \\*[MN-pos] margin note #\\n[MN-=
curr] on page \\n[#P] on page \
 .          \}
 .       \}
 .    \}
-.    if !\\n[PDFHREF_COLOR_SET]=3D1 \{\
+.    if !\\n[PDFHREF_COLOR_SET]=3D1 \
 .       nr PDFHREF_COLOR_SET 1
-.    \}
 .END
 \#
 \# AUTO_RELOCATE_TOC
@@ -21534,7 +22188,7 @@ No room to start \\*[MN-pos] margin note #\\n[MN-=
curr] on page \\n[#P] on page \
 .       nr PDF_LEV (\\n[LEVEL_REQ]*\\n[#PDF_BOOKMARKS_OPEN])
 .       ie '\\*[.T]'ps' \{\
 .           if !'\\*[PDF_NM]'' \{\
-.              pdfhref M -N\\*[PDF_NM2] -- \\*[PDF_TX]
+.              pdfhref M -N \\*[PDF_NM2] -- \\*[PDF_TX]
 .              if !dpdf:href.map .tm gropdf-info:href \\*[PDF_NM2] \\*[P=
DF_TX]
 .           \}
 .           pdfbookmark \\n[PDF_LEV] \\*[PDF_TX]
@@ -21705,7 +22359,8 @@ No room to start \\*[MN-pos] margin note #\\n[MN-=
curr] on page \\n[#P] on page \
 \# *Arguments:
 \#   [ -L -| -R | -C | -I <indent> ] \
 \#     <image file> <width> <height> \
-\#     [ SCALE <factor> ] [ ADJUST +|-<vertical shift> ]
+\#     [ SCALE <factor> ] [ ADJUST +|-<vertical shift> ] [ TARGET <pdf t=
arget> ] \
+\#     [ NO_SHIM ]
 \# *Function:
 \#   Allows embedding of PDF images with the same arguments as PSPIC
 \#   plus SCALE and ADJUST options.
@@ -21713,7 +22368,6 @@ No room to start \\*[MN-pos] margin note #\\n[MN-=
curr] on page \\n[#P] on page \
 \#   <image file> <width> <height> are required.
 \#
 .MAC PDF_IMAGE END
-.    rr float*img
 .    if !'\\n[.z]'FLOAT*DIV' \{\
 .       nr pdf-img:float 1
 .       FLOAT
@@ -21782,8 +22436,20 @@ No room to start \\*[MN-pos] margin note #\\n[MN=
-curr] on page \\n[#P] on page \
 .          ds label-type pdf-img
 .          shift 2
 .       \}
+.       if '\\$1'TARGET' \{\
+.          ds target "\\$2
+.          PDF_TARGET "\\*[target]
+.          shift 2
+.       \}
 .       if '\\$1'NO_SHIM' \{\
-.          nr float*no-shim 1
+.          if !'\\n[.z]'FLOAT*DIV' .nr pdf-image*no-shim 1
+.          nr @no-shim 1
+.          shift 1
+.       \}
+.       if '\\$1'NO_FLEX' \{\
+.          if !'\\n[.z]'FLOAT*DIV' .nr pdf-image*no-flex 1
+.          nr @no-flex 1
+.          shift 1
 .       \}
 .    \}
 .    if !'\\*[pdf-img*label-sffx]'' \{\
@@ -21795,9 +22461,8 @@ No room to start \\*[MN-pos] margin note #\\n[MN-=
curr] on page \\n[#P] on page \
 .    PDF_TARGET fig:\\n+[lists*target]
 .    if '\\*[pdf-img:pos]'-C' \
 .       nr pdf-img:ind (\\n[.ll]-\\n[ind-pre-img]-\\n[pdf-img:width])/2
-.    if '\\*[pdf-img:pos]'-R' \{\
+.    if '\\*[pdf-img:pos]'-R' \
 .       nr pdf-img:ind \\n[.ll]-\\n[pdf-img:width]-\\n[ind-pre-img]
-.    \}
 .    di PDF*IMAGE
 .    if \\n[@TOP] \{\
 .       ch RR_@TOP
@@ -21886,23 +22551,28 @@ No room to start \\*[MN-pos] margin note #\\n[M=
N-curr] on page \\n[#P] on page \
 .       PDF_IMG*SET_LABEL_QUAD \\*[pdf-img*label-quad]
 .       sp \\n[lead-pre-label]u-\\n[.v]u
 .       if !'\\*[pdf-img*label-space]'' .sp \\*[pdf-img*label-space]
-.       ie \\n[pdf-img*autolabel] \
+.       ie \\n[pdf-img*autolabel] \{\
 .          nop \
 \\*[pdf-img*label-prfx]\\*[chapno]\\n+[fig*label-num]\\*[pdf-img*label-s=
ffx]\|
-.       el .if !'\\*[pdf-img*label]'' .nop \\*[pdf-img*label]
-.       if \\n[pdf-img*autolabel] \
 .          ds pdf-img*label \\*[chapno]\\n[fig*label-num]
+.          if dLABEL.REFS \
+.             tm .ds \\*[target] \\*[chapno]\\n[fig*label-num]
+.          rm target
+.       \}
+.       el .if !'\\*[pdf-img*label]'' .nop \\*[pdf-img*label]
 .       fam
 .       ft
 .       ps
 .       gcolor
 .       if !'\\*[pdf-img*caption]'' \{\
 .          if \\n[pdf-img*caption-after-label] \{\
+.             ds pdf-img*caption-old \\*[pdf-img*caption]
 .             ds pdf-img*caption " \\*[pdf-img*caption]
 .             nop \\*[pdf-img*caption-specs]\\*[pdf-img*caption]\\*[reve=
rt-specs]
+.             ds pdf-img*caption \\*[pdf-img*caption-old]
 .          \}
 .       \}
-.       sp .5v
+.       br
 .       ev
 .       in 0
 .    \}
@@ -21929,6 +22599,13 @@ No room to start \\*[MN-pos] margin note #\\n[MN=
-curr] on page \\n[#P] on page \
 .    ie !'\\*[pdf-img*label]'' \
 .       TO_FIGURES "\\*[pdf-img*label]" "\\*[pdf-img*caption\\*[short]]"
 .    el .TO_FIGURES "\\*[pdf-img*caption\\*[short]]"
+.    if !\\n[pdf-img:float] \{\
+.       ie !\\n[#NO_SHIM] \
+.          if !\\n[pdf-img*no-shim] .SHIM
+.       el \
+.          if !\\n[#NO_FLEX] \
+.             if !\\n[pdf-img*no-flex] .FLEX
+.    \}
 .    PDF_IMAGE_CLEAN=20
 .END
 \#
@@ -21996,9 +22673,11 @@ No room to start \\*[MN-pos] margin note #\\n[MN=
-curr] on page \\n[#P] on page \
 .    rr pdf-img:depth
 .    rr pdf-img:float
 .    rr pdf-img:float
-.    rr pdf-img:frame
+.    if !\\n[pdf-img:frame] \
+.       rr pdf-img:frame
 .    rr pdf-img:ind
 .    rr pdf-img:no-shim
+.    rr pdf-img:no-flex
 .    rr pdf-img:scale
 .\" Cutarounds not yet implemented
 .    if !\\n[defer] \


From MAILER-DAEMON Sun Feb 26 22:22:45 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ciBtd-0003Qh-Iz
	for mharc-groff-commit@gnu.org; Sun, 26 Feb 2017 22:22:45 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42884)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBtZ-0003MD-OO
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:22:44 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBtX-0005AB-2M
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:22:41 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:37141)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBtW-0005A7-UE
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:22:38 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 71277)
	id CB7602600F; Sun, 26 Feb 2017 22:22:38 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: Updates for 2.2 release.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Peter Schaffter <peter@schaffter.ca>
In-Reply-To: groff@gnu.org
References: <20170227032238.26430.38598@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: 6c486109c07cae1b8efe375b0774c72e5b9f881e
Auto-Submitted: auto-generated
Message-Id: <20170227032238.CB7602600F@vcs0.savannah.gnu.org>
Date: Sun, 26 Feb 2017 22:22:38 -0500 (EST)
From: peter@schaffter.ca (Peter Schaffter)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Feb 2017 03:22:44 -0000

PTPi pushed a commit to branch master
in repository groff.

commit 6c486109c07cae1b8efe375b0774c72e5b9f881e
Author: Peter Schaffter <peter@schaffter.ca>
Date:   Sun Feb 26 22:22:00 2017 -0500

    Updates for 2.2 release.
---
 contrib/mom/examples/README-fr.txt       |  2 +-
 contrib/mom/examples/README.txt          |  2 +-
 contrib/mom/examples/elvis_syntax        |  2 +-
 contrib/mom/examples/elvis_syntax.new    |  2 +-
 contrib/mom/examples/letter.mom          |  2 +-
 contrib/mom/examples/mom-pdf.mom         | 78 +++++++++++++++-----------=
------
 contrib/mom/examples/mom.vim             |  2 +-
 contrib/mom/examples/mon_premier_doc.mom | 12 +++--
 contrib/mom/examples/sample_docs.mom     |  4 +-
 contrib/mom/examples/typesetting.mom     | 24 +++++-----
 10 files changed, 63 insertions(+), 67 deletions(-)

diff --git a/contrib/mom/examples/README-fr.txt b/contrib/mom/examples/RE=
ADME-fr.txt
index 893c9fa..af013fe 100644
--- a/contrib/mom/examples/README-fr.txt
+++ b/contrib/mom/examples/README-fr.txt
@@ -1,5 +1,5 @@
      -*- mode: text; coding: utf-8; -*-
-    Copyright (C) 2014-2016  Free Software Foundation, Inc.
+    Copyright (C) 2014-2017  Free Software Foundation, Inc.
=20
     Copying and distribution of this file, with or without modification,
     are permitted in any medium without royalty provided the copyright
diff --git a/contrib/mom/examples/README.txt b/contrib/mom/examples/READM=
E.txt
index 0e41e0c..b73f052 100644
--- a/contrib/mom/examples/README.txt
+++ b/contrib/mom/examples/README.txt
@@ -1,5 +1,5 @@
      -*- text -*-
-    Copyright (C) 2004-2016  Free Software Foundation, Inc.
+    Copyright (C) 2004-2017  Free Software Foundation, Inc.
=20
     Copying and distribution of this file, with or without modification,
     are permitted in any medium without royalty provided the copyright
diff --git a/contrib/mom/examples/elvis_syntax b/contrib/mom/examples/elv=
is_syntax
index e8d033e..906f889 100644
--- a/contrib/mom/examples/elvis_syntax
+++ b/contrib/mom/examples/elvis_syntax
@@ -1,4 +1,4 @@
-" Copyright (C) 2004-2016 Free Software Foundation, Inc.
+" Copyright (C) 2004-2017 Free Software Foundation, Inc.
 "
 " Copying and distribution of this file, with or without modification,
 " are permitted in any medium without royalty provided the copyright
diff --git a/contrib/mom/examples/elvis_syntax.new b/contrib/mom/examples=
/elvis_syntax.new
index 3410b0b..a371c5c 100644
--- a/contrib/mom/examples/elvis_syntax.new
+++ b/contrib/mom/examples/elvis_syntax.new
@@ -1,4 +1,4 @@
-" Copyright (C) 2004-2016  Free Software Foundation, Inc.
+" Copyright (C) 2004-2017  Free Software Foundation, Inc.
 "
 " Copying and distribution of this file, with or without modification,
 " are permitted in any medium without royalty provided the copyright
diff --git a/contrib/mom/examples/letter.mom b/contrib/mom/examples/lette=
r.mom
index 83dfe51..407b2d6 100644
--- a/contrib/mom/examples/letter.mom
+++ b/contrib/mom/examples/letter.mom
@@ -1,6 +1,6 @@
 .\" -*- mode: troff; coding: utf-8; -*-
 .
-\# Copyright (C) 2004-2016  Free Software Foundation, Inc.
+\# Copyright (C) 2004-2017  Free Software Foundation, Inc.
 \#
 \# Copying and distribution of this file, with or without modification,
 \# are permitted in any medium without royalty provided the copyright
diff --git a/contrib/mom/examples/mom-pdf.mom b/contrib/mom/examples/mom-=
pdf.mom
index a9467d3..328b1b4 100644
--- a/contrib/mom/examples/mom-pdf.mom
+++ b/contrib/mom/examples/mom-pdf.mom
@@ -1,5 +1,5 @@
 .\" -*- nroff -*-
-.\" Copyright (C) 2012-2016  Free Software Foundation, Inc.
+.\" Copyright (C) 2012-2017  Free Software Foundation, Inc.
 .\"
 .\" This file is part of mom, which is part of groff, a free software
 .\" project.
@@ -15,7 +15,7 @@
 .\" Reference macros (metadata)
 .TITLE     "Producing PDFs" "with groff and mom"
 .PDF_TITLE "\*[$TITLE]
-.COPYRIGHT "20\*[BU3]1\*[BU2]5 Free Software Foundation
+.COPYRIGHT "20\*[BU3]1\*[BU2]5, 20\*[BU3]1\*[BU2]7 Free Software Foundat=
ion
 .AUTHOR "Deri James" "\*[UP .5p]and" "Peter Schaffter"
 .\" Cover author style
 .COVER_AUTHOR_STYLE \
@@ -58,6 +58,7 @@ You should have received a copy of the GNU
 General Public License along with this program.
 If not, see:
 .SP .25v
+.PDF_LINK_COLOR 0.0 0.3 0.9
 .PDF_WWW_LINK http://www.gnu.org/licenses/
 .IQ CLEAR
 .HY
@@ -119,16 +120,12 @@ If not, see:
 .ds cod  \E*[CODE]\&\E*[COND]
 .ds codx \E*[CONDX]\E*[CODE off]\&
 .\" Paragraph spacing
-.de PP2
-. ALD .3v
-. PP
-..
+.PARA_SPACE .3v
 .\" Wrapper around QUOTE
 .de COD
 . QUOTE
 . nop \*[COND]\\$*\*[CONDX]
 . QUOTE OFF
-. sp -\\n[#SHIM]u
 ..
 .\" Note box
 .de BOX-NOTE
@@ -142,10 +139,12 @@ If not, see:
 .SPACE_TOC_ITEMS
 .AUTO_RELOCATE_TOC
 .TOC_ENTRY_STYLE 2 FONT I
-.TOC_LEAD 14
+.TOC_LEAD 14.5 ADJUST
+.TOC_PADDING 1
 .\"
 .DOCHEADER_ADVANCE 5c \" Begin docheader this distance down from top of =
page
 .\"
+.NO_SHIM
 .START
 .\"
 .SP .5c
@@ -161,7 +160,7 @@ or to remote web pages
 .PDF_LINK external PREFIX ( SUFFIX ), "external links"
 and the generation of a clickable document outline that appears in
 the Contents panel of most PDF viewers.
-.PP2
+.PP
 .RW .01
 Using \[groff] and \[mom] to produce PDF documents results in the
 automatic generation of clickable document outlines (discussed
@@ -195,7 +194,7 @@ One reason to prefer using the native PDF driver (via=
 \[pdfmom] or
   "paper and page setup macros"
 do not require a corresponding \[-P-p<papersize>] flag on the
 command line.
-.PP2
+.PP
 There are other minor differences between the methods, discussed
 .PDF_LINK pdf-diff SUFFIX . "here"
 .RW 0
@@ -205,7 +204,6 @@ Often, but not always, links in the body of a PDF doc=
ument point
 to headings elsewhere in the same document.  Creating these links
 is a simple process.  First, identify the places to link to
 ("destinations"), then link to them from any place in the document.
-.NO_SHIM
 .HEADING 2 NAMED naming "Creating destination points at headings"
 .PP
 The first step in creating links to a heading is to give the
@@ -219,12 +217,11 @@ would, in addition to printing the head in the body=
 of the document,
 identify the introduction by the unique id, "intro"\*[BU6].  This
 id, or name, can then be used to create links to the introduction
 from any part of the document.
-.PP2
+.PP
 Furthermore, \*[cod]NAMED\|<id>\*[codx] stores the text of the
 heading for use later on when linking to it (see
 .PDF_LINK internal SUFFIX ). +
 If headings are being numbered, the heading number is prepended.
-.NO_SHIM off
 .HEADING 2 NAMED target  "Creating destination points at arbitrary locat=
ions"
 .PP
 Any part of a document can be a link destination, not just headings.
@@ -243,7 +240,7 @@ Internal links are clickable text areas that allow yo=
u to jump to
 named destinations within a document.  (See
 .PDF_LINK external "here"
 for a description of external links.)
-.PP2
+.PP
 Internal links are created with the macro \*[cod]PDF_LINK\*[codx],
 which takes the form
 .COD "\&.PDF_LINK <id> [PREFIX <text>] [SUFFIX <text>] \
@@ -253,23 +250,23 @@ the document (see
 .PDF_LINK naming +
 and
 .PDF_LINK target SUFFIX ). +
-.PP2
+.PP
 \*[cod]PREFIX\|<text>\*[codx] and \*[cod]SUFFIX\|<text>\*[codx], both or
 either of which are optional, are printed around the clickable area
 but do not form part of the link itself.
-.PP2
+.PP
 \*[cod]<hotlink text>\*[codx] is the text that should be clickable,
 identifiable in the PDF document by the colour assigned to links
 (see
 .PDF_LINK colour SUFFIX ). +
 .PDF_TARGET expando
-.PP2
+.PP
 If the hotlink text ends in \*[cod]\[dq]*\[dq]\*[codx]\*[BU9],
 the asterisk is replaced by the text of the destination
 point, assuming it's a heading.  If the hotlink text ends in
 \*[cod]\[dq]+\[dq]\*[codx]\*[BU9], the replacement text is surrounded
 by quotes.
-.PP2
+.PP
 Using our
 .PDF_LINK intro-ex SUFFIX , "HEADING example"
 .RW .1
@@ -284,7 +281,7 @@ In the text, the link would look like this:
 External links are clickable text areas whose destination is a
 URL.  Clicking on them causes a browser window to pop up with the
 destination address.
-.PP2
+.PP
 The format of the macro to create external links is similar to the
 one for creating internal links:
 .COD "\&.PDF_WWW_LINK <url> [PREFIX <text>] [SUFFIX <text>] [\[dq]<hotli=
nk text>\[dq]]"
@@ -293,7 +290,7 @@ one for creating internal links:
 exactly the same meaning, as does \*[cod]<hotlink text>\*[codx],
 which furthermore accepts the same expandos, \*[cod]\[dq]+\[dq]\*[codx] =
and
 \*[cod]\[dq]*\[dq]\*[codx].
-.PP2
+.PP
 .RW .1
 If no hotlink text is given, then \*[cod]<url>\*[codx] is
 used as the text.  If hotlink text is given and ends in
@@ -331,7 +328,7 @@ both lead to mom using
 .PDF_LINK colour red
 .PDF_LINK_COLOR
 links.
-.PP2
+.PP
 The default colour can be restored by calling
 \*[cod]PDF_LINK_COLOR\*[codx] with no parameter.
 .FLOAT
@@ -345,24 +342,24 @@ be processed with
 \[oq]\[pdfmom]\~\[-Tps]\[cq].
 .IBQ
 .FLOAT off
-.NO_SHIM off
+.SP .5v
 .HEADING 1 NAMED outline "The PDF Outline"
 .PP
 Most PDF viewers provide a panel that displays a document's outline,
 similar to a table of contents.  Clicking on an entry navigates
 directly to the appropriate place in the document.
-.PP2
+.PP
 Mom generates PDF outlines the same way she populates
 her own table of contents: by intercepting calls to the
 \*[cod]HEADING\*[codx] macro, as well as to the various title
 and chapter macros used in namimg documents, and allocating each a
 hierarchic level.
-.PP2
+.PP
 Covers, titles/chapters, and the table of contents are all
 assigned to level 1\*[BU5].  Subsequent headings are assigned to
 n\*[UP 1p]+\*[DOWN 1p]\*[BU4]1, where n is the level given to
 \*[cod]HEADING\*[codx].
-.PP2
+.PP
 .RW .22
 The PDF outline can sensibly recover from skipped or omitted heading
 levels; the printed table of contents cannot.  Users are therefore
@@ -376,13 +373,13 @@ visible in the PDF outline.  Closed \%levels have a=
t least one level
 beneath them that is not visible unless the closed link is clicked.
 It is common for only the first two levels to be open so the outline
 doesn't look cluttered.
-.PP2
+.PP
 To establish which levels should be open by default when a document
 loads, use
 .COD "\&.PDF_BOOKMARKS_OPEN n
 where \*[cod]n\*[codx] is a number specifying at which level all
 subsequent ones should be closed.
-.PP2
+.PP
 If, at any point in the document, you specify
 .COD "\&.PDF_BOOKMARKS_OPEN NO  \e\[dq] or any other text argument
 then all subsequent bookmarks will be closed until
@@ -396,6 +393,7 @@ Mom's default is to collect entries, so if the comman=
d is placed at
 the start of a document, it \%disables entry collection completely.
 Elsewhere, it suspends collection until you re-enable it with
 .COD "\&.PDF_BOOKMARKS  \e\[dq] i.e. with no parameter
+.SP -1
 .HEADING 2 NAMED pdf:title "The PDF window title"
 .PP
 While not strictly part of the PDF outline, the title of a document
@@ -413,7 +411,7 @@ can remove the window title by issuing
 .COD ".PDF_TITLE \[dq]\[dq] \e\[dq] ie. with a blank argument
 .IBQ
 .FLOAT off
-.NO_SHIM
+.SP .5v
 .HEADING 1 NAMED toc "Tables of Contents"
 .RLD .5v
 .HEADING 2 NAMED toc:gen "Generating a Table of Contents=20
@@ -429,7 +427,7 @@ SUFFIX ). "mom documentation"
 When the file is processed and loaded in a viewer, entries in the
 Table of Contents will be clickable links.
 .RW 0
-.PP2
+.PP
 Whichever link colour is active at the end of the document, prior to
 \*[cod]TOC\*[codx], will be used for the \%Table of Contents
 links.
@@ -440,11 +438,11 @@ file, the Table of Contents is printed at the end o=
f the document.
 When this is not desirable, the PostScript output from \[groff]
 must be processed with \[psselect] in order to place the TOC in the
 preferred location.
-.PP2
+.PP
 When using mom and \[groff]'s native pdf device (via \[pdfmom] or
 \[groff] \[-Tpdf]), positioning of the Table of Contents can be done
 within the source file.
-.PP2
+.PP
 The command to control the placement of the TOC is
 .COD "\&.AUTO_RELOCATE_TOC [<position>]
 where the optional \*[cod]<position>\*[codx] can be one of these
@@ -469,16 +467,13 @@ AFTER_COVER\*[SIZE]
 It is normally not necessary to supply a keyword, since
 \*[cod]AUTO_RELOCATE_TOC\*[codx] places the TOC after the DOC_COVER,
 if there is one, or the first COVER when no DOC_COVER is present.
-.NO_SHIM off
 In rare instances where it is desirable to place the TOC somewhere
 else in the document, there are two low-level commands,
-.SP .5v
-\*[FWD 6p]\*[cod].TOC_BEFORE_HERE\*[codx]
+\*[cod].TOC_BEFORE_HERE\*[codx]
 \ \*[SIZE -.5]and\*[SIZE]\ \"
 \*[cod].TOC_AFTER_HERE\*[codx]
-.SP .5v
 which place the TOC either before or after the current page.
-.PP2
+.PP
 These last two commands have a small catch: although the TOC will
 appear where specified, the \%"Contents" entry in the PDF outline,
 which observes a hierarchy of levels, will assign the TOC to
@@ -495,7 +490,6 @@ for creating PDF files with \[groff]: the original me=
thod, ie.
 passing the \[-Tps] and \[-mpdfmark] options to \[groff] (or using
 \[pdfroff], which does this for you); or the newer \[-Tpdf], which
 produces PDF files natively.
-.NO_SHIM
 .HEADING 2 NAMED fwd:ref "The problem of forward references"
 .PP
 .EW .2
@@ -511,7 +505,7 @@ with one of the expandos,
 Mom doesn't know what text to put in the expando because it has not
 yet been defined.  This means that \[groff] must be run multiple
 times to find the unknown text.
-.PP2
+.PP
 .EW .2
 The program \[pdfroff] exists to handle these multiple runs, but it
 imposes some limitations on the PDF features available with \[mom].
@@ -522,7 +516,7 @@ imposes some limitations on the PDF features availabl=
e with \[mom].
 preferred, trouble-free way to generate PDF documents from a mom
 source file.  Like \[pdfroff], it is a frontend to \[groff] and
 accepts all the same options (see \[man]\~\[groff]).
-.PP2
+.PP
 .EW .2
 Called as-is, \[pdfmom] accepts all the same options as \[groff],
 and requires no additional flags.  PDF generation is performed by
@@ -536,7 +530,7 @@ The resulting PDF is produced from PostScript output =
fed into
 .COD "pdfmom -Tps [pdfroff opts [groff opts]] doc.mom > doc.pdf
 For either invocation, it is not necessary to add \[-mom] or
 \[-mpdfmark], as these are implied.
-.PP2
+.PP
 If Encapsulated PostScript or plain PostScript images have been
 embedded in a document with
 .PDF_WWW_LINK http://www.schaffter.ca/mom/momdoc/images.html#pspic SUFFI=
X , \
@@ -615,7 +609,7 @@ underlining (eg of italics)
 .ITEM
 generally produces larger files; these can be reduced by piping
 the output through \[ps2pdf]\*[B]
-.RLD .5v
+.RLD .25v
 .FLOAT
 .QUAD LEFT
 .BR_AT_LINE_KERN
@@ -627,10 +621,10 @@ through \[ps2pdf] lose some of
 .EW 0
 their metadata, notably the window title set with
 \*[cod]PDF_TITLE\*[codx].
+.SP .75
 .FLOAT off
 .ITEM
 is newer code with less testing\c
 .EL
 .LIST OFF
-.IQ CLEAR
 .TOC
diff --git a/contrib/mom/examples/mom.vim b/contrib/mom/examples/mom.vim
index e36039a..1922def 100644
--- a/contrib/mom/examples/mom.vim
+++ b/contrib/mom/examples/mom.vim
@@ -1,4 +1,4 @@
-" Copyright (C) 2012-2016  Free Software Foundation, Inc.
+" Copyright (C) 2012-2017  Free Software Foundation, Inc.
 "
 " Copying and distribution of this file, with or without modification,
 " are permitted in any medium without royalty provided the copyright
diff --git a/contrib/mom/examples/mon_premier_doc.mom b/contrib/mom/examp=
les/mon_premier_doc.mom
index 4fad7c0..c5702d1 100644
--- a/contrib/mom/examples/mon_premier_doc.mom
+++ b/contrib/mom/examples/mon_premier_doc.mom
@@ -1,5 +1,5 @@
 .\" -*- mode: troff; coding: utf-8; -*-
-\# Copyright (C) 2015-2016  Free Software Foundation, Inc.
+\# Copyright (C) 2015-2017  Free Software Foundation, Inc.
 \#
 \# Copying and distribution of this file, with or without modification,
 \# are permitted in any medium without royalty provided the copyright
@@ -10,21 +10,24 @@
 \#=20
 .TITLE "Mon Premier Document"
 .AUTHOR "Cic=C3=A9ron"
+
 .DOCTYPE    DEFAULT
 .PRINTSTYLE TYPESET
+.
 .PAPER      A4
 .DOC_COVERTITLE "Mon Premier Document"
-.DOC_COVER DOC_COVERTITLE
-.COVER TITLE AUTHOR
+.DOC_COVER DOC_COVERTITLE AUTHOR
+.COVER TITLE
 .ATTRIBUTE_STRING "par"
 .TOC_HEADER_STRING "Table des mati=C3=A8res"
 .AUTO_RELOCATE_TOC
 .HEADING_STYLE 1 NUMBER
 .HEADING_STYLE 2 NUMBER
-.INDENT_FIRST_PARAS
+.NO_SHIM
 .START
 \#
 .HEADING 1 "Les diff=C3=A9rentes versions"
+.PP
 Voir =C3=A9galement le chapitre sur=20
 .PDF_LINK evolution "les =C3=A9volutions"
 possibles.
@@ -70,7 +73,6 @@ Praesent egestas leo in pede. Praesent blandit odio eu =
enim.
 Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum
 primis in faucibus orci luctus et ultrices posuere cubilia Curae;
 Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum.
-Maecenas adipiscing ante non diam sodales hendrerit.
 \#
 .HEADING 2 "La version moderne"
 .PP
diff --git a/contrib/mom/examples/sample_docs.mom b/contrib/mom/examples/=
sample_docs.mom
index 073b534..79ff594 100644
--- a/contrib/mom/examples/sample_docs.mom
+++ b/contrib/mom/examples/sample_docs.mom
@@ -1,4 +1,4 @@
-\# Copyright (C) 2004-2016  Free Software Foundation, Inc.
+\# Copyright (C) 2004-2017  Free Software Foundation, Inc.
 \#
 \# Copying and distribution of this file, with or without modification,
 \# are permitted in any medium without royalty provided the copyright
@@ -36,7 +36,7 @@
 \# Title, subtitle and copyright for the document cover.
 \#
 .TITLE DOC_COVER \
-  "Sample mom Documents"
+  "Sample mom documents"
 .SUBTITLE DOC_COVER \
   "Three types of mom documents" \
   "assembled and collated" \
diff --git a/contrib/mom/examples/typesetting.mom b/contrib/mom/examples/=
typesetting.mom
index fbac609..56ccd37 100644
--- a/contrib/mom/examples/typesetting.mom
+++ b/contrib/mom/examples/typesetting.mom
@@ -1,4 +1,4 @@
-\# Copyright 2004-2016  Free Software Foundation, Inc.
+\# Copyright 2004-2017  Free Software Foundation, Inc.
 \#
 \# Copying and distribution of this file, with or without modification,
 \# are permitted in any medium without royalty provided the copyright
@@ -80,27 +80,27 @@ and multi-columns"
 \#
 .TAB 1                 \" Notice that this tab gets set line-for-line
 \*[IT]Peelee Island    \" Set italic
-\*[PREV]Gew=EF=BF=BDrztraminer \" Revert to former font (roman)
+\*[PREV]Gew=C3=BCrztraminer \" Revert to former font (roman)
 2000
 (Canada)
 .MCR           \" Return to top of column
 .TAB 2         \" Call tab 2; in multi-column mode, don't use .TN
-Jaune p=EF=BF=BDle.
+Jaune p=C3=A2le.
 .MCR
 .TB 3          \" Notice that from here on, we use the alias TB instead =
of TAB
-Frais, fruit=EF=BF=BD, ci\%tronn=EF=BF=BD, ar=EF=BF=BDmes fortes de lich=
ee et de fruits
+Frais, fruit=C3=A9, ci\%tronn=C3=A9, ar=C3=B4mes fortes de lichee et de =
fruits
 tropicaux.
 .MCR
 .TB 4
-Doux, fruit=EF=BF=BD, bien =EF=BF=BDquilibr=EF=BF=BD avec une bonne acid=
it=EF=BF=BD.
+Doux, fruit=C3=A9, bien =C3=A9quilibr=C3=A9 avec une bonne acidit=C3=A9.
 .MCR
 .TB 5
-Bon ap=EF=BF=BDro.  Servir avec des plats
+Bon ap=C3=A9ro.  Servir avec des plats
 .RW .1         \" Reduce Whitespace between letters to tighten this line
 indiens ou \%chinois.
 .RW 0          \" Back to normal spacing between letters
 .BR
-Excellent rapport qualit=EF=BF=BD/prix.
+Excellent rapport qualit=C3=A9/prix.
 .MCX 8p        \" Multi-column mode off; advance an extra 8 points
 .MCO           \" Re-invoke multi-columns for next wine description
 .TB 1
@@ -110,11 +110,11 @@ Excellent rapport qualit
 (Uraguay)
 .MCR
 .TB 2
-Rubis fonc=EF=BF=BD, vio\%lac=EF=BF=BDe, presque opaque.
+Rubis fonc=C3=A9, vio\%lac=C3=A9e, presque opaque.
 .MCR
 .TB 3
-Belles ar=EF=BF=BDmes de fruits fonc=EF=BF=BDs (prunes, cerises noires, =
cassis).
-Odeurs tertiares de cuir, c=EF=BF=BDdre, violets, eucalyptus, avec une t=
race
+Belles ar=C3=B4mes de fruits fonc=C3=A9s (prunes, cerises noires, cassis=
).
+Odeurs tertiares de cuir, c=C3=A8dre, violets, eucalyptus, avec une trac=
e
 exotique de Band-Aid*\*[BU 12].
 \#
 \# The \*[BU 12], above, pulls the period back so that it falls
@@ -123,11 +123,11 @@ exotique de Band-Aid*\*[BU 12].
 \#
 .MCR
 .TB 4
-Tr=EF=BF=BDs rond, tannins m=EF=BF=BDres et velout=EF=BF=BDs, avec un lo=
ng finis fruit=EF=BF=BD et
+Tr=C3=A8s rond, tannins m=C3=BBres et velout=C3=A9s, avec un long finis =
fruit=C3=A9 et
 doucement alcoolique.
 .MCR
 .TB 5
-Superbe\|!  Une aubaine =EF=BF=BD ne pas manquer.  Pr=EF=BF=BDt =EF=BF=BD=
 boire maintenant.
+Superbe\|!  Une aubaine =C3=A0 ne pas manquer.  Pr=C3=AAt =C3=A0 boire m=
aintenant.
 .MCX 1v  \" Multi-columns off; advance an extra linespace
 \#
 \# Now, an example of a hanging indent.  This is excessively fussy


From MAILER-DAEMON Sun Feb 26 22:24:01 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ciBur-0003VY-Bv
	for mharc-groff-commit@gnu.org; Sun, 26 Feb 2017 22:24:01 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43054)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBue-0003V1-40
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:23:59 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBuR-0005VE-Qo
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:23:48 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:37148)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBuR-0005V5-G1
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:23:35 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 71277)
	id 686FA2600F; Sun, 26 Feb 2017 22:23:35 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: Version 2.2 updates.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Peter Schaffter <peter@schaffter.ca>
In-Reply-To: groff@gnu.org
References: <20170227032334.26858.92818@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: 777ca69fd0bddd9293d436be82f1874981284ff1
Auto-Submitted: auto-generated
Message-Id: <20170227032335.686FA2600F@vcs0.savannah.gnu.org>
Date: Sun, 26 Feb 2017 22:23:34 -0500 (EST)
From: peter@schaffter.ca (Peter Schaffter)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Feb 2017 03:23:59 -0000

PTPi pushed a commit to branch master
in repository groff.

commit 777ca69fd0bddd9293d436be82f1874981284ff1
Author: Peter Schaffter <peter@schaffter.ca>
Date:   Sun Feb 26 22:23:06 2017 -0500

    Version 2.2 updates.
---
 contrib/mom/momdoc/appendices.html         |  18 +-
 contrib/mom/momdoc/color.html              |   4 +-
 contrib/mom/momdoc/cover.html              |   2 +-
 contrib/mom/momdoc/definitions.html        |  36 ++-
 contrib/mom/momdoc/docelement.html         | 285 +++++++---------
 contrib/mom/momdoc/docprocessing.html      | 476 ++++++++++++++++++-----=
----
 contrib/mom/momdoc/goodies.html            |  51 ++-
 contrib/mom/momdoc/graphical.html          |   2 +-
 contrib/mom/momdoc/headfootpage.html       |  33 +-
 contrib/mom/momdoc/images.html             | 500 ++++++++++++++++++++++-=
------
 contrib/mom/momdoc/inlines.html            |   2 +-
 contrib/mom/momdoc/intro.html              |   8 +-
 contrib/mom/momdoc/letters.html            |   2 +-
 contrib/mom/momdoc/macrolist.html          | 145 ++++++---
 contrib/mom/momdoc/rectoverso.html         |   2 +-
 contrib/mom/momdoc/refer.html              |   8 +-
 contrib/mom/momdoc/reserved.html           |   2 +-
 contrib/mom/momdoc/stylesheet.css          |   4 +-
 contrib/mom/momdoc/tables-of-contents.html |  60 +++-
 contrib/mom/momdoc/toc.html                |  24 +-
 contrib/mom/momdoc/typesetting.html        |  12 +-
 contrib/mom/momdoc/using.html              |  14 +-
 contrib/mom/momdoc/version-2.html          |  20 +-
 23 files changed, 1163 insertions(+), 547 deletions(-)

diff --git a/contrib/mom/momdoc/appendices.html b/contrib/mom/momdoc/appe=
ndices.html
index d3cc529..dc8e566 100644
--- a/contrib/mom/momdoc/appendices.html
+++ b/contrib/mom/momdoc/appendices.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016  Free Software Foundation, Inc.
+Copyright (C) 2004-2017  Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -832,15 +832,13 @@ helpful to everyone, groff newbies and old hands al=
ike.
=20
 <p>
 Mom&#8217;s macro file, om.tmac, uses long names, aliases, and a
-host of other groff goodies that have become part of the whole
-groff picture under the unflagging guidance of groff&#8217;s
-current maintainer, Werner Lemberg.  The function of nearly
-every macro, number register and string can be infered simply
-from its name.  The file is heavily commented.  A consistent, if
-idiosyncratic, indenting style is used as well, significantly
-improving readability.  Anyone wanting to futz around with
-mom&#8217;s macros should be able to do so with a minimum of head
-scratching.
+host of other groff goodies that have become part of the whole groff
+picture.  The function of nearly every macro, number register and
+string can be infered simply from its name.  The file is heavily
+commented.  A consistent, if idiosyncratic, indenting style is used
+as well, significantly improving readability.  Anyone wanting to
+futz around with mom&#8217;s macros should be able to do so with a
+minimum of head scratching.
 </p>
=20
 <div class=3D"box-tip">
diff --git a/contrib/mom/momdoc/color.html b/contrib/mom/momdoc/color.htm=
l
index d268118..381517e 100644
--- a/contrib/mom/momdoc/color.html
+++ b/contrib/mom/momdoc/color.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016  Free Software Foundation, Inc.
+Copyright (C) 2004-2017  Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -222,7 +222,7 @@ could enter one of the following:
   .NEWCOLOR YELLOW #FFFF00         \"or ##FFFFFFFF0000 or "1 1 0"
   .NEWCOLOR YELLOW RGB #FFFF00     \"or ##FFFFFFFF0000 or "1 1 0"
   .NEWCOLOR YELLOW CYM #00FF00     \"or ##0000FFFF0000 or "0 1 0"
-  .NEWCOLOR YELLOW CYMK #00FF0000  \"or ##0000FFFF00000000 or "1 1 0"
+  .NEWCOLOR YELLOW CYMK #00FF0000  \"or ##0000FFFF00000000 or "0 0 1 0"
 </span>
 After you've told mom about a colour, you can then get her to set
 text in that colour either with the
diff --git a/contrib/mom/momdoc/cover.html b/contrib/mom/momdoc/cover.htm=
l
index d2700f4..c58684c 100644
--- a/contrib/mom/momdoc/cover.html
+++ b/contrib/mom/momdoc/cover.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016  Free Software Foundation, Inc.
+Copyright (C) 2004-2017  Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
diff --git a/contrib/mom/momdoc/definitions.html b/contrib/mom/momdoc/def=
initions.html
index 6811a85..806d69b 100644
--- a/contrib/mom/momdoc/definitions.html
+++ b/contrib/mom/momdoc/definitions.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016  Free Software Foundation, Inc.
+Copyright (C) 2004-2017  Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -110,6 +110,7 @@ or concept you&#8217;re not familiar with.
         <a href=3D"#numericargument">Numeric argument</a><br/>
         <a href=3D"#outputline">Output line</a><br/>
         <a href=3D"#primitives">Primitives</a><br/>
+        <a href=3D"#preprocessor">Pre-processor</a><br/>
         <a href=3D"#stringargument">String Argument</a><br/>
         <a href=3D"#unitofmeasure">Unit of measure</a><br/>
         <a href=3D"#zerowidthcharacter">Zero-width character</a><br/>
@@ -123,10 +124,12 @@ or concept you&#8217;re not familiar with.
     <tr><th class=3D"definitions">Mom terms</th></tr>
     <tr>
       <td>
+        <a href=3D"#baseline-grid">Baseline grid</a><br/>
         <a href=3D"#blockquote">Blockquote</a><br/>
         <a href=3D"#controlmacro">Control macro</a><br/>
         <a href=3D"#docheader">Docheader</a><br/>
         <a href=3D"#epigraph">Epigraph</a><br/>
+        <a href=3D"#float">Float</a><br/>
         <a href=3D"#footer">Footer</a><br/>
         <a href=3D"#head">Head</a><br/>
         <a href=3D"#header">Header</a><br/>
@@ -698,6 +701,17 @@ or concept you&#8217;re not familiar with.
   A line of text as it appears in output copy.
   </dd>
  =20
+  <dt id=3D"preprocessor">Pre-processor</dt>
+  <dd>
+  Pre-processors are used by groff to generate tables (tbl),
+  diagrams (pic), and equations (eqn).  These pre-processors are
+  fully supported by mom.  In addition, the &#8220;refer&#8221;
+  pre-processor is used to generate bibliographies and lists of
+  cited works.  The PDF_IMAGE macro, which allows insertion of
+  graphics into a document, is not strictly a pre-processor but
+  behaves similarly to tbl, pic, and eqn.
+  </dd>
+ =20
   <dt id=3D"primitives">Primitives</dt>
   <dd>
   The lowercase instructions, introduced with a period, that groff
@@ -828,13 +842,13 @@ or concept you&#8217;re not familiar with.
=20
 <h3 id=3D"mom-terms" class=3D"docs">Mom terms</h3>
 <dl>
-  <dt id=3D"blockquote">Blockquote</dt>
+  <dt id=3D"baseline-grid">Baseline grid</dt>
   <dd>
-  Cited material other than
-  <a href=3D"#quote">quotes</a>.
-  Typically set at a smaller point size than paragraph text,
-  indented from the left and right margins.  Blockquotes are
-  <a href=3D"#filled">filled</a>.
+  Virtual guide lines spaced according to the
+  <a href=3D"#leading">leading</a>
+  established for running text.  Adherence to the grid ensures that
+  text fills the page completely to the bottom margin.  Uncorrected
+  deviations from the grid result in bottom margins that fall short.
   </dd>
  =20
   <dt id=3D"controlmacro">Control macro</dt>
@@ -859,6 +873,14 @@ or concept you&#8217;re not familiar with.
   a chapter, story, or other document.
   </dd>
  =20
+  <dt id=3D"float">Float</dt>
+  <dd>
+  A float is material intended to be kept together as a block.
+  Floated material that fits on a page in position is output on that
+  page.  Floats that do not fit in position are deferred to the top
+  of the next page.
+  </dd>
+ =20
   <dt id=3D"footer">Footer/page footer</dt>
   <dd>
   Document information (frequently author and title) output in
diff --git a/contrib/mom/momdoc/docelement.html b/contrib/mom/momdoc/doce=
lement.html
index a33a4dd..8ee3054 100644
--- a/contrib/mom/momdoc/docelement.html
+++ b/contrib/mom/momdoc/docelement.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -660,23 +660,6 @@ her to do so, use the control macro
 <a href=3D"typesetting.html#printstyle">PRINTSTYLE TYPEWRITE</a>.)
 </p>
=20
-<div class=3D"box-tip">
-<p class=3D"tip">
-<span class=3D"tip">Tip:</span>
-If you want to add less than a full linespace between
-paragraphs, you may give the amount of space you&#8217;d like as an
-argument to
-<kbd>.PARA_SPACE</kbd>.=20
-</span>
-Introducing a paragraph with <kbd>.PP2</kbd> will add a space equal
-to one-quarter of the prevailing linespace before the start of the
-paragraph.  Initial paragraphs, ie those at the start of a document,
-or after a heading or
-<a href=3D"#linebreak-intro">linebreak</a>,
-should still be introduced with
-<kbd>.PP</kbd>.
-</div>
-
 <p>
 Note that mom does not provide widow or orphan control for
 paragraphs (ie even if only one line of a paragraph fits at the
@@ -688,37 +671,16 @@ page&mdash;to a new page, which is not what you wan=
t.
 </p>
=20
 <div class=3D"box-tip">
-<p class=3D"tip-top">
+<p class=3D"tip">
 <span class=3D"tip">Tip:</span>
-The last thing you want while you&#8217;re writing and editing
-drafts of a document (particularly stories and chapters) is a
-text file cluttered up with <kbd>.PP</kbd>&#8217;s. The visual
-interruption in the flow of text is a serious obstacle to creativity
-and critiquing.
-</p>
-
-<p>
-I use the tab key on my keyboard to indent paragraphs by four spaces
-when I'm writing, producing a text file that looks pretty much like
-what you see on a printed page.  When it comes time to format and
-print the file, I run it through a sed script that (amongst other
-things) converts the intial four spaces into <kbd>.PP</kbd> (plus a
-new line) and pipes the output to groff for processing and printing.
-</p>
-
-<p class=3D"tip-bottom">
-Another solution would be to insert a blank line between paragraphs
-of your text files.  The blank lines can then be sedded out at
-print time, as above (<kbd>.PP</kbd> plus a newline), or, more
-conveniently, you could use the <kbd>.blm</kbd>
-<a href=3D"definitions.html#primitives">primitive</a>
-(blank line macro) to tell groff (and mom) that blank lines should
-be interpreted as PP&#8217;s.
+If you would prefer not to clutter up your files with
+<kbd>.PP</kbd>s, you can use groff&#8217;s &#8220;blank line
+macro&#8221; to instruct groff to interpret blank lines as
+<kbd>.PP</kbd>&#8217;s, like this:
 <br/>
 <span class=3D"pre-in-pp">
   .blm PP
 </span>
-tells groff that blank lines are really the macro PP.
 </p>
 </div>
=20
@@ -908,20 +870,23 @@ and
=20
 <p>
 If you wish to change the leading of regular text paragraphs only,
-invoke <kbd>.LS</kbd> immediately after <kbd>.PP</kbd> in every
+invoke <kbd>.LS</kbd> immediately after <kbd>.PP</kbd> in any
 paragraph whose leading you wish to change.
 </p>
=20
 <div class=3D"box-tip">
 <p class=3D"tip">
 <span class=3D"note">Warning:</span>
-It is extremely unwise to change a paragraph&#8217;s leading with LS as
-it will, in all cases, screw up mom&#8217;s ability to balance
-the bottom margin of pages.  Should you absolutely need to change
-paragraph leading with LS, and subsequently want mom to get back on
-the right leading track, use the
+Changing a paragraph&#8217;s leading will almost certaininly screw
+up mom&#8217;s ability to balance the bottom margin of pages.
+Should you absolutely require a change of paragraph&#8217;s leading and
+need to get mom back on track leading-wise afterwards, use the
 <a href=3D"docprocessing.html#shim">SHIM</a>
-macro.
+or
+<a href=3D"docprocessing.html#shim">FLEX</a>
+macro, depending on which
+<a href=3D"docprocessing.html#vertical-whitespace-management">vertical w=
hitespace management</a>
+strategy you are using.
 </p>
 </div>
=20
@@ -1079,6 +1044,15 @@ paragraphs
 </span>
 </p>
=20
+<p style=3D"margin-top: -1em" >
+If
+<a href=3D"docprocessing.html#flex-vs-shim">flex-spacing</a>
+is enabled, additional flexible vertical whitespace can be inserted
+between spaced paragraphs with the
+<a href=3D"docprocessing.html#flex">FLEX</a>
+macro.
+</p>
+
 <p>
 PARA_SPACE is not recommended for use with PRINTSTYLE TYPEWRITE
 unless you give PRINTSTYLE the <kbd>SINGLESPACE</kbd> option.
@@ -1262,25 +1236,26 @@ each heading.
=20
 <p>
 If, however, you disrupt the regular placement of text on
-mom&#8217;s baseline grid, HEADING adds as much whitespace to the
-blank line as is necessary to get things back on track.  The extra
-whitespace is always less than the current leading and therefore
-usually doesn't draw attention to itself.  This, along with a
-similar strategy for whitespace around quotes and blockquotes, is
-what allows mom to balance the bottom margins of pages effectively.
-The manual,
-<a href=3D"http://www.schaffter.ca/mom/pdf/mom-pdf.pdf"><span class=3D"b=
ook-title">Producing PDFs with groff and mom</span></a>,
-demonstrates this well: the inter-paragraph spacing is 1/3 of the
-leading, yet mom is able to produce a document with good page-rhythm
-and evenly balanced bottom margins.
+mom&#8217;s
+<a href=3D"definitions.html#baseline-grid">baseline grid</a>,
+HEADING adds extra whitespace to the blank line according to the
+<a href=3D"docprocessing.html#vertical-whitespace-management">vertical w=
hitespace management</a>
+strategy in effect.  This, along with a similar strategy for
+whitespace around quotes, blockquotes, and
+<a href=3D"definitions.html#float">floated</a>
+and
+<a href=3D"definitions.html#preprocessor">pre-processor material</a>
+is what allows mom to balance the bottom
+margins of pages effectively.
 </p>
=20
 <p>
-It occasionally happens that the extra whitespace becomes noticeable,
-typically when the amount of whitespace approaches the value of the
-current leading.  The result looks like two blank lines instead of
-one.  When this happens, a simple but effective fix is to reduce the
-space before the heading by backing up one line, either with
+It occasionally happens that the extra whitespace becomes
+noticeable.  This typically occurs when the amount of whitespace
+adjustment approaches the value of the current leading.  The result
+looks like two blank lines instead of one.  When this happens, a
+simple but effective fix is to reduce the space before the heading
+by backing up one line, either with
 <br/>
 <span class=3D"pre-in-pp">
   .SPACE -1v
@@ -1291,30 +1266,21 @@ or
   .RLD -1v
 </span>
 This results in slightly less whitespace than normal, but the
-difference is usually not apparent.
-</p>
-
-<p class=3D"tip-bottom">
-If you&#8217;d prefer that mom not add flexible whitespace to
-headings, invoke the macro
+difference is usually not apparent.  Alternatively, you may pass the
+<kbd>NO_SHIM</kbd> or <kbd>NO_FLEX</kbd> argument to
+<a href=3D"#heading-style">HEADING_STYLE</a>
+to prevent shimming or flex-spacing of any particlar heading level
+either globally or selectively.  If shimming/flex-spacing is
+disabled selectively with
 <br/>
 <span class=3D"pre-in-pp">
-  .NO_SHIM
+  .HEADING_STYLE &lt;n&gt; NO_SHIM | NO_FLEX
 </span>
-either in the style sheet section of your document (ie after
-PRINTSTYLE but before START), which will globally disable whitespace
-adjustment not only before headings, but around quotes and
-blockquotes as well, or on a per-instance basis.  <kbd>.NO_SHIM</kbd>
-is disabled by issuing
+it can be re-enabled for the heading level with
 <br/>
 <span class=3D"pre-in-pp">
-  .NO_SHIM OFF
+  .HEADING_STYLE &lt;n&gt; SHIM | FLEX
 </span>
-Please note that <kbd>.NO_SHIM</kbd> also disables mom&#8217;s
-automatic shimming around quotes, blockquotes, after PDF images and
-floats, and
-<a href=3D"docprocessing.html#shim">SHIM</a>
-macro itself.
 </p>
 </div>
=20
@@ -1361,7 +1327,9 @@ which may be given in any order:
   SMALLCAPS | NO_SMALLCAPS \
   BASELINE_ADJUST &lt;amount to raise heading from the baseline&gt; \
   SPACE_AFTER | NO_SPACE_AFTER \
-  NUMBER | NO_NUMBER
+  NUMBER | NO_NUMBER \
+  NO_SHIM | SHIM \
+  NO_FLEX | FLEX
 </span>
 </p>
=20
@@ -1434,6 +1402,15 @@ number to numbered headings and Table of Contents =
entries,
 <a href=3D"#prefix-chapter-number">PREFIX_CHAPTER_NUMBER</a>.
 </p>
=20
+<p class=3D"defaults" style=3D"margin-bottom: 1em">
+<kbd>SHIM</kbd> is not necessary if shimming is enabled
+globally, which it is by default; it exists to re-enable
+shimming for the heading level if you have previously passed
+HEADING_STYLE&nbsp;<kbd>&lt;n&gt;</kbd> a <kbd>NO_SHIM</kbd>
+argument.  The <kbd>FLEX</kbd> and <kbd>NO_FLEX</kbd> arguments work
+the same way if flex-spacing is enabled.
+</p>
+
 <p class=3D"defaults" style=3D"padding-bottom: .5em">
 The argument list is long, so you may want to break it into
 several lines by using the backslash character (<kbd>\</kbd>).
@@ -2032,63 +2009,30 @@ This behaviour can be changed with the control ma=
cro
 If your quote (or blockquote) leading differs from the document
 leading, mom attempts to observe the same rules for vertical
 whitespace outlined above; however, she will also insert a small,
-flexible amount of extra whitespace around the quotes to make sure
-the whitespace is equal, top and bottom.  Since she does this
-on a quote by quote basis, rather than by figuring out how much
-extra whitespace is needed to adjust <i>all</i> quotes on a page,
-the spacing around multiple quotes on the same page will differ
-slightly, although each will be balanced between lines of normal
-<a href=3D"definitions.html#running">running text</a>,
-top and bottom.  (The inability to scan an entire page and insert
-equalized whitespace at marked places is a limitation of groff,
-which, by and large, processes text on a line-per-line basis.)
-</p>
-
-<h4 id=3D"no-shim" class=3D"docs">Disable shimming of quotes and blockqu=
otes</h4>
-
-<p>
-If you don&#8217;t want the behaviour described above (ie you
-don&#8217;t want mom shimming quotes and blockquotes), issue the
-macro
-<br/>
-<span class=3D"pre-in-pp">
-  .NO_SHIM
-</span>
-in the style sheet section of your document (ie after PRINTSTYLE but
-before START), which will disable shimming globally, or on a
-per-instance basis prior to <kbd>.QUOTE</kbd> or <kbd>.BLOCKQUOTE</kbd>.
-</p>
-
-<p>
-If you set the leading of
-<a href=3D"#quote-autolead">quotes</a>
-or
-<a href=3D"#blockquote-autolead">blockquotes</a>
-to a value other than the one used in paragraphs, mom will apply
-shimming <i>after</i> the quote, whether or not <kbd>.NO_SHIM</kbd>
-is enabled.  This is the only way mom can guarantee that the
-difference in leading will not result in uneven bottom margins.
+flexible amount of extra whitespace
+(<a href=3D"docprocessing.html#shim-vs-flex">shim or flex-spacing</a>)
+around the quotes to make sure the whitespace is equal, top and
+bottom.  When shimming is enabled, this may result in multiple
+quotes or blockquotes on the same page being spaced slightly
+differently.
 </p>
=20
-<p>
-If you&#8217;ve disabled shimming of quotes and blockquotes with
-<kbd>.NO_SHIM</kbd> and you want mom to return to her default
-behaviour in this matter, invoke <kbd>.NO_SHIM&nbsp;OFF</kbd> (or
-<kbd>QUIT, END, X</kbd>, etc).
-</p>
-
-<p>
-Please note that <kbd>NO_SHIM</kbd> disables shimming before
-headings, and the
-<a href=3D"docprocessing.html#shim">SHIM</a>
-macro itself.
-</p>
+<h4 id=3D"no-shim" class=3D"docs">Disable shimming/flex-spacing of quote=
s and blockquotes</h4>
=20
 <p class=3D"tip-bottom">
-If you don&#8217;t provide mom with a QUOTE_AUTOLEAD, quotes are
-leaded at the default for normal running text, meaning that multiple
-quotes on the same page are all spaced identically.
+If you don&#8217;t want the behaviour
+described above (ie you don&#8217;t want mom putting additional shim
+or flex-spacing around quotes and
+blockquotes), put <kbd>.NO_SHIM</kbd> or/and <kbd>.NO_FLEX</kbd>
+in the style sheet section of your document (ie after PRINTSTYLE
+but before START), which will disable shimming or/and flex-spacing
+globally for all tags, or disable shimming/flex-spacing
+on a per-instance basis prior to <kbd>.QUOTE</kbd> or
+<kbd>.BLOCKQUOTE</kbd>, re-enabling it after the terminating
+<kbd>.QUOTE&nbsp;OFF</kbd> or <kbd>.BLOCKQUOTE&nbsp;OFF</kbd> with
+<kbd>.NO_SHIM&nbsp;OFF</kbd> or <kbd>.NO_FLEX&nbsp;OFF</kbd>.
 </p>
+
 </div>
=20
 <h3 id=3D"float-quote" class=3D"docs">Keeping QUOTEs and BLOCKQUOTEs tog=
ether as a block</h3>
@@ -2563,11 +2507,17 @@ The correct order for changing the escape charact=
er inside
   .ESC_CHAR .
   .CODE OFF
 </span>
+Be aware that changing the escape character prevents subsequent
+macros, which require that the backslash be the escape character,
+from functioning correctly.  Therefore, do not introduce any macros
+into your CODE block without first restoring the escape character to
+its default.
 </p>
=20
 <p>
 Alternatively, you can enter the backslash character as
-<kbd>\e</kbd>, which tells groff to print a literal backslash.
+<kbd>\e</kbd> or <kbd>\\</kbd> (two backslashes), which tells groff
+to print a literal backslash.
 </p>
=20
 <div class=3D"box-tip">
@@ -2605,13 +2555,15 @@ in conjunction with CODE, like this:
   .QUOTE
   .CODE
   $ echo "Hello, world" | sed -e 's/Hello,/Goodbye, cruel/'
-  .CODE OFF
   .QUOTE OFF
 </span>
 QUOTE takes care of breaking both the text and the code, as well as
 indenting the code and offsetting it from
 <a href=3D"definitions.html#running">running text</a>
-with vertical whitespace.
+with vertical whitespace.  Notice that <kbd>.CODE</kbd>, above, has
+no corresponding <kbd>.CODE OFF</kbd>.  <kbd>.CODE</kbd> inside a QUOTE
+does not require a terminating <kbd>.CODE&nbsp;OFF</kbd>, which risks
+introducing unwanted vertical whitespace.
 </p>
 </div>
=20
@@ -2637,8 +2589,9 @@ for short snippets, as in the following example.
=20
 <p>
 <kbd>\*[CODE]</kbd> does not permit changing the escape character,
-so <kbd>\e</kbd> must be used.  Furthermore, if your code starts
-with a period, you must enter it as &#8220;<kbd>\&.</kbd>&#8221;.
+so <kbd>\e</kbd> or a doubled backslash must be used.  Furthermore,
+if your code starts with a period, you must enter it as
+&#8220;<kbd>\&.</kbd>&#8221;.
 <br/>
 <span class=3D"pre-in-pp">
   Registers are created with the \*[CODE]\&.nr\*[CODE OFF] request.
@@ -2654,7 +2607,8 @@ with the parameters of
 <a href=3D"definitions.html#running">running text</a>,
 you must terminate the block with &#8220;<kbd>\c</kbd>&#8221; and
 enter the punctuation at the beginning of the next input line.  If
-the punctuation mark is a period, you must precede it with
+the punctuation mark is a period or an apostrophe, you must precede
+it with
 &#8220;<kbd>\&amp;</kbd>&#8221;.
 <br/>
 <span class=3D"pre-in-pp">
@@ -2665,8 +2619,9 @@ the punctuation mark is a period, you must precede =
it with
   \&.  As this demonstrates...
 </span>
 Use of <kbd>\*[CODE]</kbd> inline does not require the
-<kbd>\c</kbd>, however periods after <kbd>\*[CODE&nbsp;OFF]</kbd>
-still need to be introduced with <kbd>\&</kbd>, as in this example:
+<kbd>\c</kbd>, however periods and apostrophes after
+<kbd>\*[CODE&nbsp;OFF]</kbd> still need to be introduced with
+<kbd>\&</kbd>, as in this example:
 <br/>
 <span class=3D"pre-in-pp">
   ...append the unit of measure \*[CODE]p\*[CODE&nbsp;OFF]\&. New senten=
ce...
@@ -2815,8 +2770,8 @@ Macro: <b>LIST</b> <kbd class=3D"macro-args">[ BULL=
ET | DASH | DIGIT | ALPHA | alp
=20
 <p>
 Invoked by itself (ie with no argument), LIST
-initializes a list (with bullets as the default enumerator).
-Afterwards, each block of input text preceded by
+initializes a list with bullets as the default enumerator.
+Afterward,s each block of input text preceded by
 <kbd><a href=3D"#item">.ITEM</a></kbd>,
 on a line by itself, is treated as a list item.
 </p>
@@ -3343,11 +3298,11 @@ When you turn line-numbering on, mom, by default
=20
 <p>
 Mom expects that
-<kbd><a href=3D"#quote">QUOTE</a></kbd>s
+<a href=3D"#quote">QUOTE</a>s
 and
-<kbd><a href=3D"#blockquote">BLOCKQUOTE</a></kbd>s
-will not be line-numbered, however control macros
-are provided to enable line numbering for either.
+<a href=3D"#blockquote">BLOCKQUOTE</a>s
+will not be line-numbered, however control macros are provided to
+enable line numbering for either.
 See
 <a href=3D"#number-quote-lines">Line numbering control macros for quotes=
 and blockquotes</a>.
 </p>
@@ -3809,15 +3764,24 @@ assured mom is happy to oblige.
=20
 <p>
 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. Mom tries for a nice balance between too little
+separate footnotes from the document body.  When
+<a href=3D"docprocessing.html#flex-vs-shim">shimming</a>
+is enabled, the amount of whitespace
+may vary slightly from page to page depending on the number of lines
+in the footnotes.  Mom tries for a nice balance between too little
 whitespace and too much, but when push comes to shove, she&#8217;ll
 usually opt for ample over cramped.  The last lines of footnotes are
 always flush with the document&#8217;s bottom margin.
 </p>
=20
 <p>
+When=20
+<a href=3D"docprocessing.html#flex-vs-shim">flex-spacing</a>
+is enabled, the distance between the last line of text and the
+first footnote is always the same.
+</p>
+
+<p>
 If mom sees that a portion of a footnote cannot be fit on its page,
 she carries that portion over to the next page.  If an entire
 footnote can&#8217;t be fit on its page (ie  FOOTNOTE has been
@@ -4710,9 +4674,8 @@ is removed.
 </p>
=20
 <p>
-By default, mom starts the endnotes page with a bold,
-centred, double-underscored head, &#8220;ENDNOTES&#8221;.
-Subsequently, for each section in a
+By default, mom starts the endnotes page with a bold, centred head,
+&#8220;ENDNOTES&#8221;.  Subsequently, for each section in a
 <a href=3D"rectoverso.html#collate-intro">collated</a>
 document (eg chapters in a book), she identifies the section in bold
 type, flush left and underscored, followed by one-half linespace.
@@ -5584,9 +5547,9 @@ this way.
 </p>
=20
 <p>
-Mom&#8217;s default is to double-underscore the title with 1/2-point
-rules placed 2 points apart and 2 points below the baseline of the
-title.
+By default, mom double-underscores the title if your
+<a href=3D"docprocessing.html#printstyle">PRINTSTYLE</a>
+is <kbd>TYPEWRITE</kbd>.
 </p>
=20
 <!-- -ENDNOTES_HEADER_CAPS- -->
diff --git a/contrib/mom/momdoc/docprocessing.html b/contrib/mom/momdoc/d=
ocprocessing.html
index 89b21b4..c6d48b2 100644
--- a/contrib/mom/momdoc/docprocessing.html
+++ b/contrib/mom/momdoc/docprocessing.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -40,23 +40,14 @@ FDL in the main directory of the groff source package=
.
=20
 <h1 class=3D"docs">Document processing with mom</h1>
=20
-<div style=3D"text-align: center;">
-<ul class=3D"no-enumerator" style=3D"margin-left: -2.5em;">
-  <li><a href=3D"#defaults">Document defaults</a></li>
-  <li><a href=3D"#leading-note">Important note on leading/spacing and bo=
ttom margins</a></li>
-  <li><a href=3D"#shim">The SHIM macro</a></li>
-</ul>
-</div>
-
-<div class=3D"rule-medium"><hr/></div>
-
 <h2 id=3D"toc-doc-processing" class=3D"docs" style=3D"text-align: center=
;">Table of contents</h2>
=20
 <div id=3D"docprocessing-mini-toc" style=3D"font-size: 90%; line-height:=
 150%; margin-top: .5em;">
 <div class=3D"mini-toc-col-1" style=3D"margin-left: 0;">
-<h3 class=3D"toc toc-docproc-header" style=3D"margin-top: 1em;"><a class=
=3D"header-link" href=3D"#docprocessing-intro">Introduction</a></h3>
-<h3 class=3D"toc toc-docproc-header" style=3D"margin-top: .5em;"><a
-class=3D"header-link" href=3D"#setup">Preliminary document setup</a></h3=
>
+<h3 class=3D"toc toc-docproc-header" style=3D"margin-top: 1em;"><a class=
=3D"header-link" href=3D"#docprocessing-intro">Introduction to document p=
rocessing</a></h3>
+<h3 class=3D"toc toc-docproc-header" style=3D"margin-top: .5em;"><a clas=
s=3D"header-link" href=3D"#defaults">Document defaults</a></h3>
+<h3 class=3D"toc toc-docproc-header" style=3D"margin-top: .5em;"><a clas=
s=3D"header-link" href=3D"#vertical-whitespace-management">Vertical white=
space management</a></h3>
+<h3 class=3D"toc toc-docproc-header" style=3D"margin-top: .5em;"><a clas=
s=3D"header-link" href=3D"#setup">Preliminary document setup</a></h3>
 <ul class=3D"toc-docproc" style=3D"margin-top: .5em;">
   <li><a href=3D"#docprocessing-tut"><b>Tutorial &ndash; Setting up a mo=
m document</b></a></li>
   <li><a href=3D"#reference-macros"><b>The reference macros (metadata)</=
b></a>
@@ -147,8 +138,8 @@ class=3D"header-link" href=3D"#setup">Preliminary doc=
ument setup</a></h3>
     </ul></li>
   </ul></li>
 </ul>
+<h3 class=3D"toc toc-docproc-header"><a class=3D"header-link" href=3D"#t=
erminating">Terminating a document</a></h3>
 </div>
-<h3 style=3D"margin-top: -.5em; text-align: center; text-transform: uppe=
rcase; font-size: 95%;"><a class=3D"header-link" href=3D"#terminating">Te=
rminating a document</a></h3>
 </div>
=20
 <div class=3D"rule-short" style=3D"margin-top: -1.75em"><br/><hr/></div>
@@ -221,68 +212,143 @@ documentation, so just in case:
=20
 <!-- =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -->
=20
-<h2 id=3D"leading-note" class=3D"docs">Important note on leading/spacing=
 and bottom margins</h2>
+<h2 id=3D"vertical-whitespace-management" class=3D"macro-group">Vertical=
 whitespace management</h2>
+
+<ul style=3D"margin-left: -.5em;">
+  <li><a href=3D"#shim">Macro: SHIM</a></li>
+  <li><a href=3D"#no-shim">Macro: NO_SHIM</a></li>
+  <li><a href=3D"#flex">Macro: FLEX</a></li>
+  <li><a href=3D"#no-flex">Macro: NO_FLEX</a></li>
+</ul>
+
=20
 <p>
 Mom takes evenly-aligned bottom margins in
 <a href=3D"definitions.html#running">running text</a>
-very seriously.  Only under a very few (exceptional) circumstances
+very seriously.  Only under a very few, exceptional circumstances
 will she allow a bottom margin to &#8220;hang&#8221; (ie to fall
 short).
 </p>
=20
 <p>
-In order to ensure even bottom margins, mom uses the
-&#8220;base&#8221; document
+Mom offers two modes of operation for ensuring flush bottom margins:
+shimming and flex-spacing.  Shimming means that mom nudges the
+next line after a significant break in running text back onto the
+<a href=3D"definitions.html#baseline-grid">baseline grid</a>
+(eg, after the insertion of a graphic).  Flex-spacing means that any
+vertical whitespace remaining between the end of running text and
+the bottom margin is distributed equally at logical points on the
+page.
+</p>
+
+<p>
+Mom uses the
 <a href=3D"definitions.html#leading">leading</a>
-in effect <i>at the start of running text on each page</i> (ie
-the leading used in paragraphs) to calculate the spacing of every
-document element.  Prior to invoking
+of running text (the &#8220;document leading&#8221;) that&#8217;s in eff=
ect
+<i>at the start of running text on each page</i>
+to establish the grid and space document elements such as heads or
+blockquotes so that they adhere to it.  (Prior to invoking
 <a href=3D"#start">START</a>,
-this is set with the
+the document leading is set with the
 <a href=3D"typesetting.html#macros-typesetting">typesetting macro</a>
 <a href=3D"typesetting.html#leading">LS</a>,
 afterwards with the document
 <a href=3D"definitions.html#controlmacro">control macro</a>
-<a href=3D"#doc-lead">DOC_LEAD</a>.
+<a href=3D"#doc-lead">DOC_LEAD</a>.)
 </p>
=20
 <p>
-Because mom relies so heavily on the base document
-leading, any change to the leading or spacing on a page will almost
-certainly have undesirable consequences on that page&#8217;s bottom marg=
in
-unless the change is fully compensated for elsewhere on the page.
+What this means is that documents whose paragraphs are not separated
+by whitepace and which do not contain graphics or
+<a href=3D"definitions.html#pre-processor">pre-processor material</a>
+will fill the page completely to the bottom margin.
+However, if your paragraphs are spaced, or if there are any leading
+changes on a page, or if graphics or pre-processor material are
+inserted, it&#8217;s very likely the bottom margins will hang
+unless shimming or flex-spacing is enabled.
 </p>
=20
+<h3 id=3D"shim-vs-flex" class=3D"docs">Shimming <span style=3D"text-tran=
sform: none">vs.</span> flex-spacing</h3>
+
 <p>
-In other words, if you add a few points of space somewhere on a page,
-you must subtract the same number of points somewhere else on that
-same page, and vice versa.
+<b>Shimming</b> is mom's default mode of operation.  She applies it
+automatically before headings, around quotes and blockquotes, and
+beneath
+<a href=3D"definitions.html#float">floats</a>
+and
+<a href=3D"definitions.html#preprocessor">pre-processor material</a>.
+In addition, the
+<a href=3D"#shim">SHIM</a>
+macro can be inserted into a document to make sure that the
+text following falls on the baseline grid.
 </p>
=20
 <p>
-If it&#8217;s a question of adding or subtracting full
-line spaces between or within document elements, you
-can do so by using the &#8220;<kbd>v</kbd>&#8221; <a
-href=3D"definitions.html#unitofmeasure">unit of measure</a> with
-whatever spacing macro you choose &mdash;
-<a href=3D"typesetting.html#ald">ALD</a>,
-<a href=3D"typesetting.html#rld">RLD</a>,
-<a href=3D"typesetting.html#space">SPACE</a>
-&mdash; and mom won&#8217;t object.  &#8220;<kbd>v</kbd>&#8221; means
-&#8220;the current leading&#8221;, so she isn&#8217;t confused by it.  A=
nd
-since &#8220;<kbd>v</kbd>&#8221; accepts decimal fractions, you can add/=
subtract
-half linespaces and quarter linespaces with &#8220;<kbd>v</kbd>&#8221; a=
s well,
-<i>provided you compensate for the fractional linespace somewhere
-else on the page</i>.
+This mode of operation works well in documents whose paragraphs are
+not spaced.  Deviations from the baseline grid, usually
+caused by floats or pre-processor material, are corrected
+immediately.  If the shimming results in slightly unbalanced
+whitespace around them, it can easily be remedied by passing the
+<kbd>ADJUST</kbd> argument to the appropriate macro.
+</p>
+
+<p>
+If you do not want mom shimming automatically,
+<a href=3D"#no-shim">NO_SHIM</a>
+turns shimming off globally and suppresses the SHIM macro.  If you
+want to disable shimming only for a particular float or
+pre-processor, the <kbd>NO_SHIM</kbd> argument may be given to the
+appropriate macro.
+</p>
+
+<p>
+<b>Flex-spacing</b> kicks in automatically whenever you turn shimming
+off.  In other words, if you want a document flex-spaced,
+<kbd>.NO_SHIM</kbd> is how you achieve it.  If, in addition to not
+shimming, you don&#8217;t want mom flex-spacing either,
+<a href=3D"#no-flex">NO_FLEX</a>
+lets you disable it, too.
+</p>
+
+<p>
+Flex-spacing differs from shimming in that mom doesn&#8217;t
+correct deviations from the baseline grid.  Rather, she distributes
+whitespace left at the bottom of the page equally in appropriate
+places.  Like shimming, flex-spacing is automatically applied
+before heads, after floats and pre-processor material, and around
+quotes and blockquotes.  Like shimming, flex-spacing can be
+disabled for individual floats or pre-processor material with the
+<kbd>NO_FLEX</kbd> flag.
 </p>
=20
 <p>
-If all this seems like too much work, mom provides a special macro
-to get you out of trouble if you&#8217;ve played around with leading
-and/or spacing.  The macro is called SHIM (like those little pieces
-of wood carpenters use to get their work even, level and snug), and
-it&#8217;s described below.
+In addition, you can use the
+<a href=3D"#flex">FLEX</a>
+macro to insert flex-spacing yourself into the document, which you
+will almost certainly want to do if your paragraphs are spaced.
+This is because paragraphs are not flex-spaced.  Typographically,
+the ideal for spaced paragraphs is that the space between them
+remain constant.  Paradoxically, the only way to achieve flush
+bottom margins, or to correct excessive flex-spacing before a
+heading, is by adding flex-space between paragraphs.  This requires
+human judgment, and mom does not presume to decide for you.
+</p>
+
+<p>
+Shimming and flex-spacing are mutually exclusive.  If the one is
+active, the other isn&#8217;t unless you have disabled both.  This means
+that you cannot use the FLEX macro when shimming is enabled, or the
+SHIM macro when flex-spacing is enabled.  Mom will issue a warning
+if you do.
+</p>
+
+<p>
+The choice of whether to use shimming or flex-spacing depends on
+whether or not your paragraphs are spaced.  In a document with
+indented, non-spaced paragraphs, shimming and flex-spacing produce
+nearly the same result, with shimming winning by an aesthetic hair.
+In documents with spaced paragraphs, flex-spacing is the only way to
+achieve flush bottom margins.
 </p>
=20
 <!-- -SHIM- -->
@@ -296,116 +362,198 @@ Macro: <b>SHIM</b>
 </div>
=20
 <p>
-SHIM doesn&#8217;t take any argument.  Use it whenever you&#8217;ve play=
ed
-around with the
-<a href=3D"definitions.html#leading">leading</a>
-or spacing on a page and you need to get mom&#8217;s document
-leading back on track.
+When shimming is enabled, which it is by default, the SHIM macro
+allows you to nudge the line following it back onto the baseline
+grid.  In documents with non-spaced paragraphs, this prevents
+the bottom margins from hanging.
 </p>
=20
+<p style=3D"margin-bottom: -1em">
+Mom herself automatically applies shimming
+</p>
+<ul>
+  <li><i>before</i> headings</li>
+  <li><i>around</i> quotes and blockquotes</li>
+  <li><i>after</i> PDF images, tables, pic diagrams, equations, and floa=
ts</li>
+</ul>
+
 <p>
-For example, say you want to insert an image into a document with
-<a href=3D"images.html#pspic">PSPIC</a>.
-Images and graphics aren&#8217;t usually conveniently sized in
-multiples of the document leading, which means that when you insert
-the picture, you disrupt mom&#8217;s ordered placement of baselines
-on the page.  This will certainly result in a bottom margin that
-doesn&#8217;t match the bottom margins of your document&#8217;s
-other pages.
+You may sometimes find the amount of space generated by
+<kbd>SHIM</kbd> looks too big, whether inserted manually into a
+document or as a result of automatic shimming.
+The situation occurs when the amount of shimming applied
+comes close to the leading currently in effect, making it seem as if
+there&#8217;s one linespace too much whitespace.
 </p>
=20
 <p>
-The solution is to insert SHIM after the image, like this:
-<br/>
-<span class=3D"pre-in-pp">
-  &lt;text&gt;
-  .PSPIC &lt;args&gt;
-  .SHIM
-  &lt;text&gt;
-</span>
+The solution is simply to add <kbd>.SPACE&nbsp;-1v</kbd> or
+<kbd>.RLD&nbsp;1v</kbd> to the document immediately after
+<kbd>.SHIM</kbd>.  (Both <kbd>.SPACE&nbsp;-1v</kbd> and
+<kbd>.RLD&nbsp;1v</kbd> back up by one linespace.)
 </p>
=20
+<div class=3D"macro-id-overline">
+<h3 id=3D"no-shim" class=3D"macro-id">NO_SHIM</h3>
+</div>
+
+<div class=3D"box-macro-args">
+Macro: <b>NO_SHIM</b> <kbd class=3D"macro-args">&lt;none&gt; | &lt;anyth=
ing&gt;
+</div>
+
 <p>
-SHIM instructs mom to insert as much or a little space after the
-picture as is needed to ensure that the baseline of the next
-<a href=3D"definitions.html#outputline">output line</a>
-falls where mom would have put it had you not disrupted the normal
-flow of output lines with the picture.
+NO_SHIM, without an argument, disables automatic shimming,
+suppresses the SHIM macro, and enables flex-spacing.
 </p>
=20
 <p>
-And say, on previewing the above example, you find the image
-doesn&#8217;t centre nicely between the lines of text, you can
-adjust the image position by using
-<a href=3D"typesetting.html#ald">ALD</a>
-or
-<a href=3D"typesetting.html#rld">RLD</a>
-before PSPIC.  To demonstrate,
-<br/>
-<span class=3D"pre-in-pp">
-  &lt;text&gt;
-  .RLD 3p
-  .PSPIC &lt;args&gt;
-  .SHIM
-  &lt;text&gt;
-</span>
-which raises the image slightly and thereby balances the whitespace arou=
nd it.
+NO_SHIM with any argument (eg <b>OFF, QUIT, END, X</b>, etc)
+re-enables shimming if it has been disabled and disables
+flex-spacing.
 </p>
=20
+<!-- -FLEX- -->
+
+<div class=3D"macro-id-overline">
+<h3 id=3D"flex" class=3D"macro-id">FLEX</h3>
+</div>
+
+<div class=3D"box-macro-args">
+Macro: <b>FLEX</b> <kbd class=3D"macro-args">[ FORCE ]</kbd>
+</div>
+
 <p>
-You may sometimes find the amount of space generated by
-<kbd>SHIM</kbd> looks too big, whether inserted manually into a
-document or as a result of automatic shimming (see immediately
-below).  The situation occurs when the amount of shimming applied
-comes close to the leading currently in effect, making it seem as if
-there&#8217;s one linespace too much whitespace.  The solution is
-simply to add <kbd>.SPACE&nbsp;-1v</kbd> or <kbd>.RLD&nbsp;1v</kbd>
-to the document immediately after <kbd>.SHIM</kbd>.  (Both
-<kbd>.SPACE&nbsp;-1v</kbd> and <kbd>.RLD&nbsp;1v</kbd> back up
-by one linespace.)
+When flex-spacing is enabled, the FLEX macro inserts flexible
+vertical whitespace into a document.  The amount of flex-space is
+determined from any extra whitespace at the bottom of a page divided
+by the number of flex points on the same page.
 </p>
-<h4 id=3D"automatic-shimming" class=3D"docs">Automatic shimming of headi=
ngs, quotes, blockquotes, PDF images, and floats</h4>
=20
 <p style=3D"margin-bottom: -1em">
-By default, mom automatically applies shimming
+If flex-spacing is enabled, mom herself automatically applies
+flex-spacing
 </p>
-<ul>
+<ul style=3D"margin-bottom: -.5em">
   <li><i>before</i> headings</li>
   <li><i>around</i> quotes and blockquotes</li>
-  <li><i>after</i> PDF images, floats, and tables</li>
+  <li><i>after</i> PDF images, tables, pic diagrams, equations, and floa=
ts</li>
 </ul>
=20
 <p>
-In documents where paragraphs are not spaced, automatic shimming is
-almost always desirable.  In documents where paragraphs are spaced
-by an amount less than the document leading, or which have numerous
-graphics, headings, and quotes, you may want to disable shimming,
-either globally or on a tag-by-tag basis.
+Near the bottom of some pages, you may find that
+<a href=3D"definitions.html#float">floated</a>
+or
+<a href=3D"definitions.html#preprocessor">pre-proccesor material</a>,
+including images, or a single line of text afterward, is not flush
+with the bottom margin.  This is a result of mom flex-spacing
+<i>after</i> such material but not before.  The solution to is
+insert <kbd>.FLEX</kbd> immediately beforehand.
 </p>
=20
-<p id=3D"disable-shim">
-<span style=3D"font-weight: bold; font-style: italic; font-size: 95%">To=
 disable
-automatic shimming</span>, invoke the macro, <kbd>.NO_SHIM</kbd>,
-either in the style sheet section of your document (ie after
-<a href=3D"#printstyle">PRINTSTYLE</a>
-and before
-<a href=3D"#start">START</a>),
-or just before
-<a href=3D"docelement.html#heading">HEADING</a>,
-<a href=3D"docelement.html#quote">QUOTE</a>,
-<a href=3D"docelement.html#blockquote">BLOCKQUOTE</a>,
-<a href=3D"images.html#pdf-image">PDF_IMAGE</a>
-<a href=3D"images.html#float">FLOAT</a>.
+<p>
+There are some instances where mom inhibits flex-spacing, notably
+after outputting deferred floats and pre-processor material.
+Introducing FLEX by itself in these instances&mdash;say, before a head
+or paragraph&mdash;will not have any effect; you must pass FLEX the
+<kbd>FORCE</kbd> argument.
+</p>
+
+<div class=3D"box-tip">
+<p class=3D"tip">
+<span class=3D"important">Important note on flex-spacing policy:</span><=
br/>
+Mom disables flex-spacing on
+</p>
+<ul style=3D"margin-top: -1em; margin-bottom: -.5em">
+  <li>the last page or column of a document, before the Table of Content=
s,
+      Endnotes, Bibliography, and/or any &#8220;Lists of...&#8221;
+  </li>
+  <li>the page preceding a
+      <a href=3D"rectoverso.html#collate">COLLATE</a>
+  </li>
+  <li>the page preceding a
+      <a href=3D"typesetting.html#NEWPAGE">NEWPAGE</a>
+      or
+      <a href=3D"headfootpage.html#blankpage">BLANKPAGE</a>
+  </li>
+  <li>the column preceding a
+      <a href=3D"#col-next">COL_NEXT</a>
+      or
+      <a href=3D"#col-break">COL_BREAK</a>
+  </li>
+</ul>
+
+<p>
+If this is not what you want, insert
+<a href=3D"#no-flex"><kbd>.NO_FLEX&nbsp;OFF</kbd></a>
+before the first flex-space point on the affected page or in the
+affected column.
+</p>
+
+<p>
+Flex-spacing is also disabled for any page or column where
+insufficient room at or near the bottom causes a
+<a href=3D"docelement.html#heading">HEADING</a>
 or
-<a href=3D"images.html#ts">TS</a>.
+<a href=3D"images.html#tbl">table</a>
+to be moved to the top of the next page.  These situations cannot
+be harmonized with flex-spacing except by adjusting your layout
+to prevent them.  You may try re-enabling flex-spacing for the
+page (<kbd>.NO_FLEX&nbsp;OFF</kbd>) and manually inserting
+flex-spaces at appropriate points, but the original whitespace is
+usually large enough that re-distributing it merely changes
+one layout gaffe into another.
 </p>
=20
 <p>
-Note that <kbd>.NO_SHIM</kbd> also disables the SHIM macro itself.
+Very occasionally you may notice that a document element (spaced
+paragraph, floated material, pre-processor material, or a PDF image)
+near the bottom of page has also caused mom to disable flex-spacing
+for that page.  This occurs when the document element following it
+is a
+<a href=3D"docelement.html#pp-space">spaced paragraph</a>.
 </p>
=20
-<p>To re-enable automatic shimming and the SHIM macro itself, use
-<kbd>.NO_SHIM OFF</kbd> (or <kbd>QUIT, END, X</kbd>, etc).
+<p>
+It is typographically acceptable for there to be space between
+insertions in running text (eg an image) and the bottom margin when
+the next page begins with a paragraph.  If you&#8217;d like to
+nudge the insertion a little closer to the bottom margin&mdash;not
+all the way; that isn&#8217;t possible without pushing it to the
+next page and disrupting subsequent flex-spacing&mdash;insert a
+small amount of space beforehand with
+<a href=3D"typesetting.html#sp">SP</a>.
+Do not, in these cases, use the <kbd>ADJUST</kbd>
+argument (for example to
+<a href=3D"images.html#pdf-image">PDF_IMAGE</a>.)
+</p>
+
+<p class=3D"tip-bottom">
+In the case of a spaced paragraph itself near the bottom of the page
+causing a break, re-enabling flex-spacing
+(<kbd>.NO_FLEX&nbsp;OFF</kbd>) at an appropriate place in your input
+file will resolve the issue, provided there is at least one
+flex-point on the page.  If not, add one or more.
+</p>
+</div>
+
+<div class=3D"macro-id-overline">
+<h3 id=3D"no-flex" class=3D"macro-id">NO_FLEX</h3>
+</div>
+
+<div class=3D"box-macro-args">
+Macro: <b>NO_FLEX</b> <kbd class=3D"macro-args">&lt;none&gt; | &lt;anyth=
ing&gt;</kbd>
+</div>
+
+<p>
+NO_FLEX, without an argument, disables automatic flex-spacing
+and suppresses the FLEX macro.  If, in addition to NO_FLEX, NO_SHIM
+has also been given, your document will be neither flex-spaced nor
+shimmed.
+</p>
+
+<p>
+NO_FLEX with any argument (eg <b>OFF, QUIT, END, X</b>, etc)
+re-enables flex-spacing if it has been disabled.
 </p>
=20
 <div class=3D"rule-short"><hr/></div>
@@ -566,8 +714,8 @@ and tag, but who&#8217;s ever satisfied with defaults=
?  Use any of
 the
 <a href=3D"typesetting.html#macros-typesetting">typesetting macros</a>
 here to change mom&#8217;s document defaults (paper size, margins,
-family, point size, line space, rag, etc), or use any of the
-document processing
+family, point size, line space, rag, etc), or any of the document
+processing
 <a href=3D"definitions.html#controlmacro">control macros</a>.
 This is the style-sheet section of a document, and
 must come after the
@@ -1566,7 +1714,7 @@ of a
 <a href=3D"#reference-macros">reference macro</a>,
 <kbd><a href=3D"#chapter">CHAPTER</a></kbd>).
 If you give the chapter a title with
-<a href=3D"#chapter-title">CHAPTER TITLE</a>,
+<a href=3D"#chapter-title">CHAPTER_TITLE</a>,
 mom prints &#8220;Chapter &lt;n&gt;&#8221; and the
 title underneath.  If you omit the
 <a href=3D"#chapter">CHAPTER</a>
@@ -2309,14 +2457,10 @@ in the
 given to any of the
 <a href=3D"docprocessing.html#reference-macros">reference macros</a>,
 nor in the string arguments given to
-<a href=3D"docelement.html#head">HEAD</a>,
-<a href=3D"docelement.html#subhead">SUBHEAD</a>
-or
-<a href=3D"docelement.html#parahead">PARAHEAD</a>.
+<a href=3D"docelement.html#heading">HEADING</a>.
 Use, rather, the
 <a href=3D"definitions.html#controlmacro">control macros</a>
-mom provides to automatically colourize these
-elements.
+mom provides to automatically colourize these elements.
 </p>
 </div>
=20
@@ -2428,7 +2572,7 @@ for an explanation of how to disable this default b=
ehaviour.
 </div>
=20
 <div class=3D"box-macro-args">
-Macro: <b>DOCHEADER</b> <kbd class=3D"macro-args">&lt;toggle&gt; [ dista=
nce to advance from top of page ]</kbd>
+Macro: <b>DOCHEADER</b> <kbd class=3D"macro-args">&lt;toggle&gt; [ dista=
nce to advance from top of page ] [ NO_SHIM ]</kbd>
 </div>
=20
 <p class=3D"requires">
@@ -2480,7 +2624,7 @@ using mom&#8217;s typesetting macros.  It is recomm=
ended that if you
 do create a custom docheader, you make
 <a href=3D"docprocessing.html#shim"><kbd>.SHIM</kbd></a>
 the last macro before the first item of your document (for
-example, <kbd>.PP</kbd> or <kbd>.HEADING 1</kbd>.  PP...)
+example, <kbd>PP</kbd> or <kbd>HEADING&nbsp;1</kbd>.
 </p>
=20
 <div class=3D"box-tip">
@@ -2488,15 +2632,14 @@ example, <kbd>.PP</kbd> or <kbd>.HEADING 1</kbd>.=
  PP...)
 <span class=3D"note">Note:</span>
 You may have tried <kbd>DOCHEAHER&nbsp;OFF</kbd> with a distance argumen=
t
 and discovered that mom will not budge the starting position of the docu=
ment
-from its default location.  This is byproduct of
+from her chosen default location.  This is byproduct of
 <a href=3D"#shim">shimming</a>,
-which is enabled by default.  If you encounter the problem and you
-want shimming to remain the default, simply disable it (with
-<a href=3D"#disable-shim">NO_SHIM</a>
-immediately prior to
-<a href=3D"#start">START</a>
-and re-enable it immediately afterwards with
-<a href=3D"#disable-shim">NO_SHIM OFF</a>.
+which mom always applies before the first line of running text after
+the docheader, regardless of which
+<a href=3D"#vertical-whitespace-management">vertical whitespace manageme=
nt</a>
+strategy is in effect.  If you encounter the problem, pass
+<kbd>DOCHEADER&nbsp;OFF&nbsp;&lt;distance&gt;</kbd>
+the additional final argument, <kbd>NO_SHIM</kbd>.
 </p>
 </div>
=20
@@ -3027,17 +3170,33 @@ or remove space after the docheader, there is no =
need to invoke
 <div class=3D"box-tip">
 <p class=3D"tip">
 <span class=3D"note">Note:</span>
-If you add or subtract space after the docheader, e.g. with
+If you do add or subtract space after the docheader, e.g. with
 <a href=3D"typesetting.html#ald">ALD</a>
 or
 <a href=3D"typesetting.html#SP">SP</a>,
 and your
 <a href=3D"definitions.html#unitofmeasure">unit of measure</a>
-is something other than &#8220;<kbd>v</kbd>&#8221;, be sure to follow th=
e spacing
-command with
-<a href=3D"docprocessing.html#shim"><kbd>.SHIM</kbd></a>
-unless shimming has been disabled with
-<a href=3D"#disable-shim">NO_SHIM</a>.
+is something other than a multiple of &#8220;<kbd>v</kbd>&#8221;, be
+sure to follow the spacing command with
+<a href=3D"docprocessing.html#shim">SHIM</a>
+before entering <kbd>.COL_MARK</kbd> unless shimming has been
+disabled with
+<a href=3D"#no-shim">NO_SHIM</a>.
+If your document is being flex-spaced, do not use
+<a href=3D"docprocessing.html#flex">FLEX</a>.
+Rather, disable flex-spacing with temporarily with
+<br/>
+<span class=3D"pre-in-pp">
+  .NO_FLEX
+  .NO_SHIM off
+  .SHIM
+  .COL_MARK
+</span>
+and re-enable it afterwards with
+<span class=3D"pre-in-pp">
+  .NO_SHIM
+  .NO_FLEX off
+</span>
 </p>
 </div>
=20
@@ -3259,8 +3418,8 @@ the tops of pages after the first.)
                a document will almost certainly result in a
                bottom margin that doesn&#8217;t align with the
                bottom margin of subsequent pages.  You&#8217;ll
-               need to use the SHIM macro to get mom back on
-               track when you&#8217;re ready to return to the
+               need to use the SHIM or FLEX macro to get mom back
+               on track when you&#8217;re ready to return to the
                document&#8217;s default leading.
=20
   <a id=3D"autolead" style=3D"margin-top: -1em">AUTOLEAD</a>   &bull;Inv=
oked before START, sets the overall document
@@ -3387,7 +3546,12 @@ Since adding space in this way is almost sure to d=
isrupt mom&#8217;s
 ability to guarantee perfectly flush bottom margins, I highly
 recommend using the
 <a href=3D"docprocessing.html#shim">SHIM</a>
-macro immediately after ADD_SPACE.
+or
+<a href=3D"docprocessing.html#flex">FLEX</a>
+macro immediately after ADD_SPACE, which will add the space plus
+whatever correction is required by the
+<a href=3D"docprocessing.html#vertical-whitespace-management">vertical w=
hitespace management</a>
+strategy in effect.
 </p>
=20
 <!-- *** -->
diff --git a/contrib/mom/momdoc/goodies.html b/contrib/mom/momdoc/goodies=
.html
index 055a58f..81154e8 100644
--- a/contrib/mom/momdoc/goodies.html
+++ b/contrib/mom/momdoc/goodies.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -619,6 +619,15 @@ character to whatever the argument is.  ESC_CHAR wit=
h no argument
 restores the escape character to the backslash.
 </p>
=20
+<div class=3D"box-tip">
+<p class=3D"tip">
+<span class=3D"important">Important:</span>
+Changing the escape character prevents macros, which require that
+the backslash be the escape character, from functioning correctly.
+Do not introduce any subsequent macros without first restoring the
+escape character to its default.
+</p>
+</div>
=20
 <div class=3D"box-tip">
 <p class=3D"tip">
@@ -713,6 +722,22 @@ UNDERSCORE.  If you need to underscore several lines=
 of type, use
 </p>
 </div>
=20
+<div class=3D"box-tip">
+<p class=3D"tip">
+<span class=3D"note">Additional note:</span>
+In
+<a href=3D"definitions.html#filled">nofill modes</a>,
+UNDERSCORE causes a break before and after, meaning the underscored
+word or phrase will appear as a separate line in your output.  If
+you wish to embed an underscored word or phrase into non-filled
+text, temporarily change to the corresponding fill mode with
+<a href=3D"typesetting.html#quad">QUAD</a>
+and insert breaks manually with
+<a href=3D"typesetting.html#br">BR</a>
+as appropriate, reverting to the original nofill mode afterwards.
+</p>
+</div>
+
 <h3 id=3D"underscore-weight" class=3D"docs">Controlling the weight of un=
derscores</h3>
 <p>
 The weight (thickness) of underscores may be controlled with the
@@ -828,6 +853,22 @@ the macro
 (q.v).
 </p>
=20
+<div class=3D"box-tip">
+<p class=3D"tip">
+<span class=3D"note">Note:</span>
+In
+<a href=3D"definitions.html#filled">nofill modes</a>,
+UNDERSCORE2 causes a break before and after, meaning the double-undersco=
red
+word or phrase will appear as a separate line in your output.  If
+you wish to embed a double-underscored word or phrase into non-filled
+text, temporarily change to the corresponding fill mode with
+<a href=3D"typesetting.html#quad">QUAD</a>
+and insert breaks manually with
+<a href=3D"typesetting.html#br">BR</a>
+as appropriate, reverting to the original nofill mode afterwards.
+</p>
+</div>
+
 <!-- -UNDERLINE- -->=20
 <div class=3D"macro-id-overline">
 <h3 id=3D"underline" class=3D"macro-id">Underline</h3>
@@ -839,10 +880,10 @@ Macro: <b>UNDERLINE</b> <kbd class=3D"macro-args">t=
oggle</kbd>
=20
 <p>
 The distinction between underscoring and underlining is that
-underscoring is suitable for occasional effects (a word here, a word
-there), whereas underlining underlines whole passages of type.
-Furthermore, you cannot colorize underlining, and there&#8217;s a
-special macro,
+underscoring is suitable for occasional effects (a word here,
+a phrase there), whereas underlining underlines whole passages
+of type.  Furthermore, you cannot colorize underlining, and
+there&#8217;s a special macro,
 <a href=3D"#underline-specs">UNDERLINE_SPECS</a>,
 to control the weight and distance from the baseline of the
 underline.  Lastly, files that use UNDERLINE must be processed with
diff --git a/contrib/mom/momdoc/graphical.html b/contrib/mom/momdoc/graph=
ical.html
index 494f3d4..8d29ba1 100644
--- a/contrib/mom/momdoc/graphical.html
+++ b/contrib/mom/momdoc/graphical.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
diff --git a/contrib/mom/momdoc/headfootpage.html b/contrib/mom/momdoc/he=
adfootpage.html
index 76c9258..2ef2bf4 100644
--- a/contrib/mom/momdoc/headfootpage.html
+++ b/contrib/mom/momdoc/headfootpage.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -383,7 +383,7 @@ there&#8217;s no need to turn headers off first.
 </p>
 </div>
=20
-<p>
+<p style=3D"margin-top: -.5em">
 If you need both headers and footers, there&#8217;s a special macro,
 <a href=3D"#headers-and-footers">HEADERS_AND_FOOTERS</a>,
 that allows you to set it up.
@@ -1318,9 +1318,6 @@ but if you want a different gap, say, 2 centimetres=
, do
 <span class=3D"pre-in-pp">
   .HEADER_GAP 2c
 </span>
-</p>
-
-<p>
 If your document uses
 <a href=3D"definitions.html#footer">footers</a>,
 replace HEADER_, above, with FOOTER_.  The argument to FOOTER_GAP
@@ -1357,6 +1354,32 @@ the number and the first line of running text with=
 HEADER_GAP.
 </p>
 </div>
=20
+<div id=3D"gap-note" class=3D"box-tip">
+<p class=3D"tip-top">
+<span class=3D"note">Additional note:</span>
+HEADER_GAP and FOOTER_GAP may only be used once, at the start of a
+document.  In
+<a href=3D"rectoverso.html#collate">collated documents</a>,
+this means that HEADER_GAP or FOOTER_GAP cannot be used to change
+the gaps once they have been set.  The same applies to the Table of
+Contents, Endnotes, Bibliographies, and Lists of...&nbsp;.
+</p>
+
+<p class=3D"tip-bottom">
+In the event that you need to change the header or footer gap after
+the start of a document, you must do so with
+<a href=3D"typesetting.html#t-margin">T_MARGIN</a>
+or
+<a href=3D"typesetting.html#b-margin">B_MARGIN</a>,
+which raise or lower the top and bottom margins of
+<a href=3D"definitions.html#running">running text</a>
+but do not affect the placement headers and footers.
+(See
+<a href=3D"tables-of-contents.html#toc-page-settings-example">here</a>
+for a demonstration.)
+</p>
+</div>
+
 <!-- -HDRFTR_SEPARATOR- -->
=20
 <h4 id=3D"hdrftr-separator" class=3D"docs">4. Header/footer separator ru=
le</h4>
diff --git a/contrib/mom/momdoc/images.html b/contrib/mom/momdoc/images.h=
tml
index 8beeb68..54c7ee3 100644
--- a/contrib/mom/momdoc/images.html
+++ b/contrib/mom/momdoc/images.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -84,6 +84,7 @@ FDL in the main directory of the groff source package.
   <li><a href=3D"#captions-and-labels">Captions and labels</a>
     <ul>
       <li><a href=3D"#autolabel">AUTOLABEL</a></li>
+      <li><a href=3D"#set-autolabel">SET_AUTOLABEL</a></li>
       <li><a href=3D"#caption-after-label">CAPTION_AFTER_LABEL</a></li>
       <li><a href=3D"#captions-labels-sources">CAPTIONS / LABELS / SOURC=
ES</a>&mdash;set style parameters for each</li>
       <li><a href=3D"#mla">MLA</a></li>
@@ -185,13 +186,13 @@ Macro: <b>PDF_IMAGE</b> <kbd class=3D"macro-args">[=
 -L | -C | -R | -I &lt;indent&g
 <br/>
 &lt;image-file.pdf&gt; &lt;width&gt; &lt;height&gt; [ SCALE &lt;factor&g=
t; ] \
 <br/>
-[ ADJUST +|-&lt;vertical adjustment&gt; ] [ NO_SHIM ] \
+[ ADJUST +|-&lt;vertical adjustment&gt; ] [ NO_SHIM ] [ NO_FLEX ] \
 <br/>
 [ FRAME ] \
 <br/>
 [ CAPTION "&lt;caption&gt;" ] [ SHORT_CAPTION "&lt;short caption&gt;" ] =
\
 <br/>
-[ LABEL "&lt;label&gt;" ]</kbd>
+[ LABEL "&lt;label&gt;" ] [ TARGET "&lt;name&gt;" ]</kbd>
 </div>
 <p class=3D"requires">
 &bull;&nbsp;<span style=3D"font-style: normal">
@@ -293,18 +294,31 @@ measure is required.
=20
 <p>
 <kbd>NO_SHIM</kbd> instructs mom not to apply
-<a href=3D"docprocessing.html#shim">shimming</a>
-after the image, which she does by default.  Shimming ensures that
-running text after the image falls properly on the page&#8217;s baseline
-grid, but usually results in slightly unequal spacing above and
-below, which must be corrected with the <kbd>ADJUST</kbd> argument.
-Mom&#8217;s default shimming is generally a good idea since it ensures
-properly aligned bottom margins for running text, however if you
-have several images on the page, there may be visible differences in
-the spacing beneath images.  <kbd>NO_SHIM</kbd> corrects the
-problem, but will result in running text that does not completely
-fill the page unless shimming is applied manually elsewhere on the
-same page.
+<a href=3D"docprocessing.html#shim-vs-flex">shimming</a>
+after an image, which she will do automatically when shimming is
+enabled, which it is by default.  Shimming ensures that running text
+after the image falls properly on the page&#8217;s
+<a href=3D"definitions.html#baseline-grid">baseline grid</a>,
+but can result in slightly unequal spacing above and below
+(correctible with the <kbd>ADJUST</kbd> argument).
+<kbd>NO_SHIM</kbd> is useful when you have several images on the
+page and there are visible differences in the spacing beneath them
+as a result of shimming.  To ensure a flush bottom margin, the last
+image on the page should be shimmed, ie should not be given the
+<kbd>NO_SHIM</kbd> argument.
+</p>
+
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'NO_F=
LEX'</h5>
+
+<p>
+<kbd>NO_FLEX</kbd> instructs mom not to apply
+<a href=3D"docprocessing.html#shim-vs-flex">flex-spacing</a>
+after an image, which she will do automatically when flex-spacing is
+enabled. <kbd>NO_FLEX</kbd> is useful when you have several images
+on the page and you want to distribute excess vertical
+whitespace on the page amongst other flex-spacing points on the
+page.  If there are no others, the final image should be
+flex-spaced, ie not given the <kbd>NO_FLEX</kbd> argument.
 </p>
=20
 <h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'FRAM=
E'</h5>
@@ -346,6 +360,36 @@ an auto-labelling facility for images (see
 which, if enabled, overrides the <kbd>LABEL</kbd> argument.
 </p>
=20
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'TARG=
ET'</h5>
+
+<p>
+<kbd>TARGET</kbd> followed by a unique name surrounded by
+double-quotes creates a PDF target for the image so that it may be
+linked to from other places in the file (with PDF_LINK; see
+<a href=3D"version-2.html#mom-pdf">Producing PDFs with groff and mom</a>=
).
+</p>
+
+<p>
+When
+<a href=3D"#autolabel">autolabelling</a>
+is enabled and the document is processed with
+<a href=3D"using.html#pdfmom" style=3D"font-weight: bold">pdfmom</a>,
+the target name can be used to generate the target&#8217;s label
+number in running text if it is entered as a groff string, ie of the
+form <kbd>\*[name]</kbd>.  For example, if you create a target named
+&#8220;foo&#8221; for a pdf image whose autolabel number would be 3,
+entering
+<br/>
+<span class=3D"pre-in-pp">
+  See
+  .PDF_LINK foo "Figure \*[foo]"
+</span>
+anywhere in running text would result in a pdf link that reads
+&#8220;Figure 3&#8221;.  If chapter numbers are being prefixed to
+labels, the same string in, say, chapter 5 would produce the pdf
+link &#8220;Figure 5.3&#8221;.
+</p>
+
 <p>
 Remember that mom files with embedded PDF images must be processed
 with
@@ -493,14 +537,18 @@ correct optical centering.
 </p>
=20
 <p>
-Additionally, non-floated EPS images inserted into
-<a href=3D"definitions.html#running">running text</a>
-will almost certainly disrupt the baseline placement of running
-text.  In order to get mom back on track after inserting a
-non-floated <kbd>.PSPIC</kbd> image, I strongly recommend using the
+Additionally, non-floated EPS images
+will almost certainly disrupt the baseline placement of
+<a href=3D"definitions.html#running">running text</a>.
+In order to get mom back on track after inserting a non-floated
+<kbd>.PSPIC</kbd> image, insert the
 <a href=3D"docprocessing.html#shim">SHIM</a>
-macro so that the bottom margin of running text falls where it
-should.
+or
+<a href=3D"docprocessing.html#flex">FLEX</a>
+macro afterwards, depending on the
+<a href=3D"docprocessing.html#vertical-whitespace-management">vertical w=
hitespace management</a>
+strategy in effect, so that the bottom margin of running text falls
+where it should.
 </p>
=20
 <p>
@@ -555,9 +603,10 @@ previous page without interruption.
=20
 <p>
 In the case of a float that doesn&#8217;t fit being followed by
-one that does, the second is output in position and the first is
-deferred.  In the case of two or more that don&#8217;t fit, they are
-output in order on the next page.
+one that does, both are deferred and output one after the other.
+Note that this represents a change from versions 2.1-b_1 and earlier
+where the second float was output in position and the first was
+deferred.
 </p>
=20
 <p>
@@ -600,12 +649,13 @@ not
 Floats begin on the baseline immediately below the running text
 preceding them.  No additional whitespace surrounds them, above or
 below.  Running text below a float is, however,
-<a href=3D"docprocessing.html#shim">shimmed</a>,
-unless shimming has been disabled with <kbd>.NO_SHIM</kbd> or the
-<kbd>NO_SHIM</kbd> argument is given to <kbd>FLOAT</kbd>.  Shimming
-generally results in a small amount of extra whitespace after the
-float, which can be equalized with the whitespace beforehand using
-the <kbd>ADJUST</kbd> argument to FLOAT.
+<a href=3D"docprocessing.html#shim">shimmed</a>
+or
+<a href=3D"docprocessing.html#flex">flex-spaced</a>,
+depending on the
+<a href=3D"docprocessing.html#vertical-whitespace-management">vertical w=
hitespace management</a>
+strategy in effect.  This behaviour can be disabled for individual
+floats with <kbd>NO_SHIM</kbd> or <kbd>NO_FLEX</kbd>.
 </p>
=20
 <p>
@@ -623,7 +673,7 @@ or
 </div>
=20
 <div class=3D"box-macro-args">
-Macro: <b>FLOAT</b> <kbd class=3D"macro-args">[ ADJUST +|-&lt;amount&gt;=
 ] [ FORCE ] [ SPAN ] [ NO_SHIM] | &lt;anything&gt;</kbd>
+Macro: <b>FLOAT</b> <kbd class=3D"macro-args">[ ADJUST +|-&lt;amount&gt;=
 ] [ FORCE ] [ SPAN ] [ NO_SHIM] [ NO_FLEX ] | TARGET "&lt;name&gt;" | &l=
t;anything&gt;</kbd>
 </div>
=20
 <div class=3D"box-tip">
@@ -647,10 +697,11 @@ the space allotted to it</i> by the specified amoun=
t.
 <a href=3D"definitions.html#unitofmeasure">unit of measure</a>
 appended.  <kbd>ADJUST</kbd> gives you precise control over
 the vertical centering of floats, allowing you to compensate for
-unequal spacing that may result of from the automatic shimming of
-floats (or the absence thereof).  See
-<a href=3D"docprocessing.html#shim">SHIM</a>
-for a discussion of automatic shimming.
+unequal spacing that may result of from the automatic
+<a href=3D"docprocessing.html#shim">shimming</a>
+or
+<a href=3D"docprocessing.html#flex">flex-spacing</a>
+floats.
 </p>
=20
 <p>
@@ -675,22 +726,59 @@ a warning should this occur.  Unboxed tables, on th=
e other hand, are
 acceptable within floats that are given the <kbd>SPAN</kbd> argument.
 </p>
=20
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'NO_S=
HIM'</h5>
+
 <p>
 <kbd>NO_SHIM</kbd> instructs mom not to apply
-<a href=3D"docprocessing.html#shim">shimming</a>
-after the float, which she does by default.  Shimming ensures that
-running text after the float falls properly on the page&#8217;s baseline
-grid, but usually results in slightly unequal spacing above and
-below, which must be corrected with the <kbd>ADJUST</kbd> argument.
-Mom&#8217;s default shimming is generally a good idea since it ensures
-properly aligned bottom margins for running text, however if you
-have several floats on the page, there may be visible differences in
-the spacing beneath them.  <kbd>NO_SHIM</kbd> corrects the
-problem, but will result in running text that does not completely
-fill the page unless shimming is applied manually elsewhere on the
-same page.
+<a href=3D"docprocessing.html#shim-vs-flex">shimming</a>
+after a float, which she will do automatically when shimming is
+enabled, which it is by default.  Shimming ensures that running text
+after the float falls properly on the page&#8217;s
+<a href=3D"definitions.html#baseline-grid">baseline grid</a>,
+but can result in slightly unequal spacing above and below
+(correctible with the <kbd>ADJUST</kbd> argument).
+<kbd>NO_SHIM</kbd> is useful when you have several floats on the
+page and there are visible differences in the spacing beneath them
+as a result of shimming.  To ensure a flush bottom margin, the last
+float on the page should be shimmed, ie should not be given the
+<kbd>NO_SHIM</kbd> argument.
 </p>
=20
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'NO_F=
LEX'</h5>
+
+<p>
+<kbd>NO_FLEX</kbd> instructs mom not to apply
+<a href=3D"docprocessing.html#shim-vs-flex">flex-spacing</a>
+after a float, which she will do automatically when flex-spacing is
+enabled. <kbd>NO_FLEX</kbd> is useful when you have several floats
+on the page and you want to distribute excess vertical
+whitespace on the page amongst other flex-spacing points on the
+page.  If there are no others, the final float should be
+flex-spaced, ie not given the <kbd>NO_FLEX</kbd> argument.
+</p>
+
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'TARG=
ET'</h5>
+
+<p>
+<kbd>TARGET</kbd> followed by a unique name surrounded by
+double-quotes creates a PDF target for the float so that it may be
+linked to from other places in the file (with PDF_LINK; see
+<a href=3D"version-2.html#mom-pdf">Producing PDFs with groff and mom</a>=
).
+</p>
+
+<p>
+Floats cannot be autolabelled, so unlike pdf images and
+pre-processor material, the target name cannot be used as a string
+to generate the target&#8217;s label number in running text.  Label
+numbers for floats must be entered explicitly running text, however
+they may be entered symbolically in the argument to
+<a href=3D"#label">LABEL</a>.
+See
+<a href=3D"#reserved-label-strings">Reserved variables for
+labels</a>.
+</p>
+
+
 <div class=3D"box-tip">
 <p class=3D"tip-top">
 <span class=3D"note">Note:</span>
@@ -724,8 +812,7 @@ Labelling and captioning of tables (<b>tbl</b>), equa=
tions
 are handled by the macros that initiate them, regardless of whether
 they&#8217;re wrapped inside a float.  However, since a float may
 contain any valid input, it is sometimes necessary to add a label
-and/or caption to the float itself when it is not being used to
-contain preprocessor input.
+and/or caption to the float itself.
 </p>
=20
 <div class=3D"box-tip">
@@ -785,18 +872,22 @@ If a float has a caption at the top, the caption is=
 whitespaced
 an additional 1/4 linespace below the caption.  If the float has
 no corresponding label at the bottom, the float observes the
 bottom-spacing rules for all floats, namely that no extra space is
-added except whatever
+added other than
 <a href=3D"docprocessing.html#shim">shimming</a>
-is necessary to restore proper baseline alignment.
+or
+<a href=3D"docprocessing.html#shim-vs-flex">flex-spacing</a>,
+depending on the
+<a href=3D"docprocessing.html#vertical-whitespace-management">vertical w=
hitespace management</a>
+in effect.
 </p>
=20
 <p>
 If a float has a label at the bottom but no caption at the top, the
 float begins exactly where started, i.e. with no extra whitespace
 between running text and the float.  The label (and attached
-caption, if any) are whitespaced 1/4 linespace below the float, with
-an additional 1/4 linespace underneath <i>plus</i> whatever shimming is
-needed to restore proper baseline alignment.
+caption, if any) are whitespaced 1/4 linespace below the float,
+with an additional 1/4 linespace underneath <i>plus</i> shimming or
+flex-spacing.
 </p>
=20
 <p>
@@ -847,11 +938,12 @@ before ending the float:
 <h3  id=3D"reserved-label-strings" class=3D"docs" style=3D"text-transfor=
m: none">Reserved variables for labels</h3>
=20
 <p>
-Mom reserves two variables you may use when entering label text
-after the <kbd>LABEL</kbd> argument.
-<kbd>\*[chapter]</kbd> holds the current chapter or major section
-number.  <kbd>\*[label]</kbd> increments the label number by one
-and is initially set to zero after each invocation of
+Mom reserves strings you may use when entering label text after
+the <kbd>LABEL</kbd> argument. <kbd>\*[chapter]</kbd> holds the
+current chapter or major section number. <kbd>\*[fig-label]</kbd>,
+<kbd>\*[tbl-label]</kbd>, and <kbd>\*[eqn-label]</kbd>
+increment the label number of the appropriate label type by one,
+and are initially set to zero after each invocation of
 <a href=3D"docprocessing.html#start">START</a>
 when the
 <a href=3D"docprocessing.html#doctype">DOCTYPE</a>
@@ -859,18 +951,20 @@ is <kbd>CHAPTER</kbd>.  Thus, in every chapter requ=
iring numbered
 float labels, you can enter
 <br/>
 <span class=3D"pre-in-pp">
-  .LABEL "Fig. \*[chapter].\*[label].
+  .LABEL "Fig. \*[chapter].\*[fig-label]. TO_LIST FIGURES
 </span>
-which, assuming the third labelled float of Chapter 2 will produce
-<kbd>Fig. 2.3.</kbd>
+which, assuming the third autolabelled float of Chapter 2, will
+produce <kbd>Fig. 2.3.</kbd>
 </p>
=20
 <p>
 If your <b>DOCTYPE</b> is <kbd>DEFAULT</kbd> or <kbd>NAMED</kbd>,
-you must reset <kbd>\*[label]</kbd> by entering
+you must reset <kbd>\*[&lt;type&gt;-label]</kbd> after each
+<a href=3D"docprocessing.html#collate">COLLATE</a>
+by entering
 <br/>
 <span class=3D"pre-in-pp">
-  .AUTOLABEL &lt;list type&gt;
+  .AUTOLABEL_&lt;list type&gt;
 </span>
 before <kbd>.START</kbd>.
 </p>
@@ -878,7 +972,7 @@ before <kbd>.START</kbd>.
 <p>
 If
 <a href=3D"#autolabel">autolabelling</a>
-is enabled, e.g. <kbd>.AUTOLABEL_IMAGES</kbd> (List
+is enabled, eg <kbd>.AUTOLABEL_IMAGES</kbd> (List
 of Figures) or <kbd>.AUTOLABEL_PIC</kbd> (also List of Figures),
 the prefix is stripped from the label when it appears in
 the List.  Thus, if you have invoked <kbd>.AUTOLABEL_PIC</kbd>,
@@ -905,7 +999,7 @@ label&#8221;.
 If you&#8217;d like a caption attached to the label, pass
 <kbd>LABEL</kbd> the optional argument <kbd>CAPTION</kbd> followed
 by the text of the caption as a single string surrounded by
-double-quotes: <br/>
+double-quotes:
 <br/>
 <span class=3D"pre-in-pp">
   .FLOAT
@@ -1158,14 +1252,22 @@ Unboxed tables inside floats may span multiple pa=
ges provided the
 <span class=3D"note">Note:</span>
 The vertical spacing around unfloated tables may appear slightly
 unequal, especially if there are several tables on the page.  This
-is a result of
+is a result of the
 <a href=3D"docprocessing.html#shim">shimming</a>
-that mom applies automatically after each table.  You may
-disable shimming with <kbd>.NO_SHIM</kbd>, or by giving the
-<kbd>NO_SHIM</kbd> argument to <kbd>.TS</kbd>.  In either case, you
-will still likely want to adjust the spacing around with table with
-the <kbd>AJUST</kbd> argument to <kbd>.TS</kbd>.  Tables inside
-floats should be adjusted with the <kbd>ADJUST</kbd> argument to
+or
+<a href=3D"docprocessing.html#flex">flex-spacing</a>
+that mom applies automatically after each table, depending on which
+<a href=3D"docprocessing.html#vertical-whitespace-management">vertical w=
hitespace management</a>
+is in effect.  You may
+disable shimming or flex-spacing with
+<a href=3D"docprocessing.html#no-shim">NO_SHIM</a>
+or
+<a href=3D"docprocessing.html#no-flex">NO_FLEX</a>,
+or by passing the <kbd>NO_SHIM</kbd> or <kbd>NO_FLEX</kbd> argument
+to <kbd>.TS</kbd>.  In either case, you will still likely want to
+adjust the spacing around with table with the <kbd>AJUST</kbd>
+argument to <kbd>.TS</kbd>.  Tables inside floats should be adjusted
+with the <kbd>ADJUST</kbd> argument to
 <a href=3D"#float">FLOAT</a>,
 not the <kbd>ADJUST</kbd> argument to <kbd>.TS</kbd>.
 </p>
@@ -1196,11 +1298,15 @@ required)
 <kbd class=3D"macro-args"><br/>
 &nbsp;&nbsp;[ NO_SHIM ]
 <br/>
+&nbsp;&nbsp;[ NO_FLEX ]
+<br/>
 &nbsp;&nbsp;[ CAPTION "&lt;caption&gt;" ]
 <br/>
 &nbsp;&nbsp;[ SHORT_CAPTION "&lt;short caption&gt;" ]
 <br/>
 &nbsp;&nbsp;[ LABEL "&lt;label&gt;" ]
+<br/>
+&nbsp;&nbsp;[ TARGET "&lt;name&gt;" ]
 </kbd>
 <br/>
 Macro: <a href=3D"#th"><b>TH</b></a> <kbd class=3D"macro-args">(optional=
, only if .TS H)</kbd>
@@ -1384,19 +1490,33 @@ measure is required.
=20
 <p>
 <kbd>NO_SHIM</kbd> instructs mom not to apply
-<a href=3D"docprocessing.html#shim">shimming</a>
-after the image, which she does by default.  Shimming ensures that
-running text after the image falls properly on the page&#8217;s baseline
-grid, but usually results in slightly unequal spacing above and
-below, which must be corrected with the <kbd>ADJUST</kbd> argument.
-Mom&#8217;s default shimming is generally a good idea since it ensures
-properly aligned bottom margins for running text, however if you
-have several images on the page, there may be visible differences in
-the spacing beneath images.  <kbd>NO_SHIM</kbd> corrects the
-problem, but will result in running text that does not completely
-fill the page unless shimming is applied manually elsewhere on the
-same page.
+<a href=3D"docprocessing.html#shim-vs-flex">shimming</a>
+after a table, which she will do automatically when shimming is
+enabled, which it is by default.  Shimming ensures that running text
+after the table falls properly on the page&#8217;s
+<a href=3D"definitions.html#baseline-grid">baseline grid</a>,
+but can result in slightly unequal spacing above and below
+(correctible with the <kbd>ADJUST</kbd> argument).
+<kbd>NO_SHIM</kbd> is useful when you have several tables on the
+page and there are visible differences in the spacing beneath them
+as a result of shimming.  To ensure a flush bottom margin, the last
+table on the page should be shimmed, ie should not be given the
+<kbd>NO_SHIM</kbd> argument.
 </p>
+
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'NO_F=
LEX'</h5>
+
+<p>
+<kbd>NO_FLEX</kbd> instructs mom not to apply
+<a href=3D"docprocessing.html#shim-vs-flex">flex-spacing</a>
+after a table, which she will do automatically when flex-spacing is
+enabled. <kbd>NO_FLEX</kbd> is useful when you have several tables
+on the page and you want to distribute excess vertical
+whitespace on the page amongst other flex-spacing points on the
+page.  If there are no others, the final table should be
+flex-spaced, ie not given the <kbd>NO_FLEX</kbd> argument.
+</p>
+
 <h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'CAPT=
ION'</h5>
=20
 <p>
@@ -1435,6 +1555,36 @@ an auto-labelling facility for tables (see
 which, if enabled, overrides the <kbd>LABEL</kbd> argument.
 </p>
=20
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'TARG=
ET'</h5>
+
+<p>
+<kbd>TARGET</kbd> followed by a unique name surrounded by
+double-quotes creates a PDF target for the table so that it may be
+linked to from other places in the file (with PDF_LINK; see
+<a href=3D"version-2.html#mom-pdf">Producing PDFs with groff and mom</a>=
).
+</p>
+
+<p>
+When
+<a href=3D"#autolabel">autolabelling</a>
+is enabled and the document is processed with
+<a href=3D"using.html#pdfmom" style=3D"font-weight: bold">pdfmom</a>,
+the target name can be used to generate the target&#8217;s label
+number in running text if it is entered as a groff string, ie of
+the form <kbd>\*[name]</kbd>.  For example, if you create a target
+called &#8220;foo&#8221; for a table whose autolabel number would be
+3, entering
+<br/>
+<span class=3D"pre-in-pp">
+  See
+  .PDF_LINK foo "Table \*[foo]"
+</span>
+anywhere in running text would result in a pdf link that reads
+&#8220;Table 3&#8221;.  If chapter numbers are being prefixed to
+labels, the same string in, say, chapter 5 would produce the pdf
+link &#8220;Table 5.3&#8221;. =20
+</p>
+
 <div class=3D"macro-id-overline">
 <h4 id=3D"th" class=3D"docs" style=3D"font-size: 100%; margin-top: .5em"=
>The .TH macro</h4>
 </div>
@@ -1555,12 +1705,16 @@ required)
 <kbd class=3D"macro-args"><br/>
 &nbsp;&nbsp;[ NO_SHIM ]
 <br/>
+&nbsp;&nbsp;[ NO_FLEX ]
+<br/>
 &nbsp;&nbsp;[ CAPTION "&lt;caption&gt;" ]
 <br/>
 &nbsp;&nbsp;[ SHORT_CAPTION "&lt;short caption&gt;" ]
 <br/>
 &nbsp;&nbsp;[ LABEL "&lt;label&gt;" ]
 </kbd>
+&nbsp;&nbsp;[ TARGET "&lt;name&gt;" ]
+</kbd>
 <br/>
 Macro: <b>PE</b> <span style=3D"font-size: 95%">(no arguments; ends
 the <b>pic</b> block)</span>
@@ -1606,18 +1760,31 @@ measure is required.
=20
 <p>
 <kbd>NO_SHIM</kbd> instructs mom not to apply
-<a href=3D"docprocessing.html#shim">shimming</a>
-after the diagram, which she does by default.  Shimming ensures that
-running text after the diagram falls properly on the page&#8217;s baseli=
ne
-grid, but usually results in slightly unequal spacing above and
-below, which must be corrected with the <kbd>ADJUST</kbd> argument.
-Mom&#8217;s default shimming is generally a good idea since it ensures
-properly aligned bottom margins for running text, however if you
-have several diagrams on the page, there may be visible differences in
-the spacing beneath them.  <kbd>NO_SHIM</kbd> corrects the
-problem, but will result in running text that does not completely
-fill the page unless shimming is applied manually elsewhere on the
-same page.
+<a href=3D"docprocessing.html#shim-vs-flex">shimming</a>
+after a <b>pic</b> diagrame, which she will do automatically when
+shimming is enabled, which it is by default.  Shimming ensures that
+running text after the diagrame falls properly on the page&#8217;s
+<a href=3D"definitions.html#baseline-grid">baseline grid</a>,
+but can result in slightly unequal spacing above and below
+(correctible with the <kbd>ADJUST</kbd> argument).
+<kbd>NO_SHIM</kbd> is useful when you have several diagrams on the
+page and there are visible differences in the spacing beneath them
+as a result of shimming.  To ensure a flush bottom margin, the last
+diagram on the page should be shimmed, ie should not be given the
+<kbd>NO_SHIM</kbd> argument.
+</p>
+
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'NO_F=
LEX'</h5>
+
+<p>
+<kbd>NO_FLEX</kbd> instructs mom not to apply
+<a href=3D"docprocessing.html#shim-vs-flex">flex-spacing</a>
+after a <b>pic</b> diagram, which she will do automatically when
+flex-spacing is enabled. <kbd>NO_FLEX</kbd> is useful when you
+have several diagrams on the page and you want to distribute excess
+vertical whitespace on the page amongst other flex-spacing points
+on the page.  If there are no others, the final diagram should be
+flex-spaced, ie not given the <kbd>NO_FLEX</kbd> argument.
 </p>
=20
 <h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'CAPT=
ION'</h5>
@@ -1651,6 +1818,36 @@ an auto-labelling facility for diagrams (see
 which, if enabled, overrides the <kbd>LABEL</kbd> argument.
 </p>
=20
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'TARG=
ET'</h5>
+
+<p>
+<kbd>TARGET</kbd> followed by a unique name surrounded by
+double-quotes creates a PDF target for the diagram so that it may be
+linked to from other places in the file (with PDF_LINK; see
+<a href=3D"version-2.html#mom-pdf">Producing PDFs with groff and mom</a>=
).
+</p>
+
+<p>
+When
+<a href=3D"#autolabel">autolabelling</a>
+is enabled and the document is processed with
+<a href=3D"using.html#pdfmom" style=3D"font-weight: bold">pdfmom</a>,
+the target name can be used to generate the target&#8217;s label
+number in running text if it is entered as a groff string, ie of
+the form <kbd>\*[name]</kbd>.  For example, if you create a target
+called &#8220;foo&#8221; for a diagram whose autolabel number would
+be 3, entering
+<br/>
+<span class=3D"pre-in-pp">
+  See
+  .PDF_LINK foo "Figure \*[foo]"
+</span>
+anywhere in running text would result in a pdf link that reads
+&#8220;Figure 3&#8221;.  If chapter numbers are being prefixed to
+labels, the same string in, say, chapter 5 would produce the pdf
+link &#8220;Figure 5.3&#8221;.
+</p>
+
 <!---PIC_TEXT_STYLE--->
=20
 <div class=3D"macro-id-overline">
@@ -1738,6 +1935,10 @@ required)
 required)
 </span>
 <kbd class=3D"macro-args"><br/>
+&nbsp;&nbsp;[ NO_SHIM ]
+<br/>
+&nbsp;&nbsp;[ NO_FLEX ]
+<br/>
 &nbsp;&nbsp;[ CAPTION "&lt;caption&gt;" ]
 <br/>
 &nbsp;&nbsp;[ LABEL "&lt;label&gt;" ]
@@ -1746,6 +1947,8 @@ required)
 <br/>
 &nbsp;&nbsp;[ SHORT_CAPTION "&lt;short caption&gt;" ]
 <br/>
+&nbsp;&nbsp;[ TARGET "&lt;name&gt;" ]
+<br/>
 Macro: <a href=3D"#en"><b>EN</b></a> <kbd class=3D"macro-args"> [ CONTIN=
UED | CONT | ... ]</kbd>
 </div>
=20
@@ -1804,18 +2007,31 @@ measure is required.
=20
 <p>
 <kbd>NO_SHIM</kbd> instructs mom not to apply
-<a href=3D"docprocessing.html#shim">shimming</a>
-after the equation, which she does by default.  Shimming ensures that
-running text after the equation falls properly on the page&#8217;s basel=
ine
-grid, but usually results in slightly unequal spacing above and
-below, which must be corrected with the <kbd>ADJUST</kbd> argument.
-Mom&#8217;s default shimming is generally a good idea since it ensures
-properly aligned bottom margins for running text, however if you
-have several equations on the page, there may be visible differences in
-the spacing beneath them.  <kbd>NO_SHIM</kbd> corrects the
-problem, but will result in running text that does not completely
-fill the page unless shimming is applied manually elsewhere on the
-same page.
+<a href=3D"docprocessing.html#shim-vs-flex">shimming</a>
+after an equation, which she will do automatically when shimming is
+enabled, which it is by default.  Shimming ensures that running text
+after the equation falls properly on the page&#8217;s
+<a href=3D"definitions.html#baseline-grid">baseline grid</a>,
+but can result in slightly unequal spacing above and
+below (correctible with the <kbd>ADJUST</kbd> argument).
+<kbd>NO_SHIM</kbd> is useful when you have several equations on the
+page and there are visible differences in the spacing beneath them
+as a result of shimming.  To ensure a flush bottom margin, the last
+equation on the page should be shimmed, ie should not be given the
+<kbd>NO_SHIM</kbd> argument.
+</p>
+
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'NO_F=
LEX'</h5>
+
+<p>
+<kbd>NO_FLEX</kbd> instructs mom not to apply
+<a href=3D"docprocessing.html#shim-vs-flex">flex-spacing</a>
+after an equation, which she will do automatically when flex-spacing
+is enabled. <kbd>NO_FLEX</kbd> is useful when you have several
+equations on the page and you want to distribute excess vertical
+whitespace on the page amongst other flex-spacing points on
+the page.  If there are no others, the final equation should be
+flex-spaced, ie not given the <kbd>NO_FLEX</kbd> argument.
 </p>
=20
 </p>
@@ -1858,6 +2074,37 @@ with the last line.  Assuming a three-line equatio=
n,
 one line, thus centering it vertically on the equation.
 </p>
=20
+<h5 class=3D"docs" style=3D"margin-top: 1em; text-transform: none">'TARG=
ET'</h5>
+
+<p>
+<kbd>TARGET</kbd> followed by a unique name surrounded by
+double-quotes creates a PDF target for the equation so that it may
+be linked to from other places in the file (with PDF_LINK; see
+<a href=3D"version-2.html#mom-pdf">Producing PDFs with groff and mom</a>=
).
+</p>
+
+<p>
+When
+<a href=3D"#autolabel">autolabelling</a>
+is enabled and the document is processed with
+<a href=3D"using.html#pdfmom" style=3D"font-weight: bold">pdfmom</a>,
+the target name can be used to generate the target&#8217;s label
+number in running text if it is entered as a groff string, ie of
+the form <kbd>\*[name]</kbd>.  For example, if you create a target
+called &#8220;foo&#8221; for an equation whose autolabel number
+would be 3, entering
+<br/>
+<span class=3D"pre-in-pp">
+  See
+  .PDF_LINK foo "Equation \*[foo]"
+</span>
+anywhere in running text would result in a pdf link that reads
+&#8220;Equation 3&#8221;.  If chapter numbers are being prefixed to
+labels, the same string in, say, chapter 5 would produce the pdf
+link &#8220;Equation 5.3&#8221;.
+</p>
+
+
 <div class=3D"macro-id-overline" style=3D"margin-top: .5em">
 <h4 id=3D"en" class=3D"docs" style=3D"font-size: 100%; margin-top: .5em"=
>The .EN macro</h4>
 </div>
@@ -2063,8 +2310,37 @@ is <i>not</i> reset automatically.  To reset it, i=
nvoke
 <a href=3D"docprocessing.html#collate">COLLATE</a>.
 </div>
=20
+<div id=3D"set-autolabel" class=3D"box-macro-args" style=3D"margin-top: =
.5em">
+Macro: <b>SET_AUTOLABEL</b> <kbd class=3D"macro-args">FIG | TBL | PIC | =
EQN &lt;n&gt;</kbd>
+</div>
+
+<p>
+You may sometimes need to set or reset the autolabel number for a
+particular type of pre-processor or for PDF images.  This is likely
+to occur if you are using
+<a href=3D"#float">FLOAT</a>
+in conjunction with the <kbd>TO_LIST</kbd> argument.
+</p>
+
 <p>
-Prefixed chapter numbers=20
+For example, if your document has Figures (PDF images, pic diagrams)
+and you want your tables to be labelled as Figures as well, you have
+to wrap the tables inside a float and label the float manually as
+&#8220;Fig.&nbsp;n&#8221;, sending it to the List of Figures with
+<kbd>TO_LIST FIGURES</kbd>.
+</p>
+
+<p>
+Mom does not autolabel floats or assign them automatically
+to a list, so she doesn&#8217;t know you&#8217;ve interrupted the
+auto-incrementing label numbers.  Use SET_AUTOLABEL get her back on
+track.  The number you give as an argument after telling her which
+kind of label number to set is the one you want to appear next.
+<br/>
+<span class=3D"pre-in-pp">
+  .SET_AUTOLABEL FIG 6
+</span>
+means the next autolabelled Figure will be &#8220;Fig. 6.&#8221;
 </p>
=20
 <div class=3D"macro-id-overline">
@@ -2471,6 +2747,8 @@ Arguments:
 <br/>
 &nbsp;&nbsp;TITLE_QUAD LEFT | CENTER | RIGHT \
 <br/>
+&nbsp;&nbsp;TOC_HEADER_UNDERSCORE default =3D none
+<br/>
 &nbsp;&nbsp;TITLE_COLOR &lt;color&gt; \
 <br/>
 &nbsp;&nbsp;PN_FAMILY &lt;family&gt; \
diff --git a/contrib/mom/momdoc/inlines.html b/contrib/mom/momdoc/inlines=
.html
index 0bc5723..f8d93b1 100644
--- a/contrib/mom/momdoc/inlines.html
+++ b/contrib/mom/momdoc/inlines.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
diff --git a/contrib/mom/momdoc/intro.html b/contrib/mom/momdoc/intro.htm=
l
index 1632fef..11d20b9 100644
--- a/contrib/mom/momdoc/intro.html
+++ b/contrib/mom/momdoc/intro.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -70,8 +70,8 @@ PostScript (.ps).  She&#8217;s aimed at three kinds of =
users:
       not-always-typographically-intuitive
       <a href=3D"definitions.html#primitives">primitives</a>;
   </li>
-  <li>Non-technical writers who need to format their work easily,
-      with a minimum of clutter;
+  <li>Writers who need to format their work easily, with a
+      minimum of clutter;
   </li>
   <li>Newcomers to groff, typesetting, or document processing
       who need a well-documented macro set to get them started.
@@ -293,7 +293,7 @@ aren&#8217;t enough, I offer examples.
 The canonical reference materials for groff are
 <strong>cstr54</strong> (a downloadable PostScript copy of which
 is available
-<a href=3D"http://www.kohala.com/start/troff/">here</a>)
+<a href=3D"http://www.kohala.com/start/troff/cstr54.ps">here</a>)
 and the <strong>troff</strong> and <strong>groff_diff</strong>
 manpages.  The most complete and up-to-date source of information is
 the groff info pages, available by typing <kbd>info groff</kbd> at
diff --git a/contrib/mom/momdoc/letters.html b/contrib/mom/momdoc/letters=
.html
index 572ac46..0531534 100644
--- a/contrib/mom/momdoc/letters.html
+++ b/contrib/mom/momdoc/letters.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
diff --git a/contrib/mom/momdoc/macrolist.html b/contrib/mom/momdoc/macro=
list.html
index f48cf11..721acb6 100644
--- a/contrib/mom/momdoc/macrolist.html
+++ b/contrib/mom/momdoc/macrolist.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -77,14 +77,15 @@ elsewhere in the documentation.
   <li><a href=3D"#qr-19">Reference macros (metadata)</a></li>
   <li><a href=3D"#qr-20">Document type and initial defaults</a></li>
   <li><a href=3D"#qr-23">TYPEWRITE control macros</a></li>
+  <li><a href=3D"#qr-57">Vertical whitespace management</a></li>
   <li><a href=3D"#qr-47">Document and section cover (title) pages</a></l=
i>
   <li><a href=3D"#qr-22">Set documents in columns</a></li>
   <li><a href=3D"#qr-21">Line numbering</a></li>
   <li><a href=3D"#qr-24">Initiate document processing</a></li>
-  <li><a href=3D"#qr-42">Global print style changes after START</a></li>
 </ul>
 </div>
 <ul style=3D"margin-top: 1.75em; margin-left: 0; padding-left: 0; list-s=
tyle-type: none;">
+  <li><a href=3D"#qr-42">Global print style changes after START</a></li>
   <li><a href=3D"#qr-43">Managing a document&#8217;s first-page header<b=
r/><span style=3D"margin-left: 1.25em;">(the &#8220;docheader&#8221;)</sp=
an></a></li>
   <li><a href=3D"#qr-25">Epigraphs</a></li>
   <li><a href=3D"#qr-26">Headings</a></li>
@@ -121,7 +122,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-1" class=3D"quick-ref" colspan=3D"2" >+++ Paper size, margi=
ns, line length</th>
+<th id=3D"qr-1" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"typesetting.html#page-setup-intro">+++ Paper size, margins, l=
ine length</a></th>
 </tr>
 <tr>
 <td><a href=3D"typesetting.html#paper">PAPER</a></td><td>-- set common p=
aper sizes (letter, A4, etc)</td>
@@ -153,7 +155,8 @@ elsewhere in the documentation.
 </table>
=20
 <table class=3D"quick-ref">
-<tr><th id=3D"qr-2" class=3D"quick-ref" colspan=3D"2">+++ Family, font, =
point size</th></tr>
+<tr><th id=3D"qr-2" class=3D"quick-ref" colspan=3D"2">
+<a href=3D"typesetting.html#basic-params-intro">+++ Family, font, point =
size</a></th></tr>
 <tr>
 <td><a href=3D"typesetting.html#family">FAMILY</a></td><td>-- set the fa=
mily of type</td>
 </tr>
@@ -173,7 +176,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-3" class=3D"quick-ref" colspan=3D"2" >+++ Font modification=
s</th>
+<th id=3D"qr-3" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"typesetting.html#modifications-intro">+++ Font modifications<=
/a></th>
 </tr>
 <tr><td style=3D"padding-left: 0;">Pseudo italic</td></tr>
 <tr>
@@ -231,7 +235,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-5" class=3D"quick-ref" colspan=3D"2" >+++ Justification, qu=
ad direction, line-by-line setting, breaking lines</th>
+<th id=3D"qr-5" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"typesetting.html#justification-intro">+++ Justification, quad=
 direction, line-by-line setting, breaking lines</a></th>
 </tr>
 <tr>
 <td><a href=3D"typesetting.html#justify">JUSTIFY</a></td><td>-- justify =
text to both margins</td>
@@ -315,7 +320,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-9" class=3D"quick-ref" colspan=3D"2" >+++ Horizontal and ve=
rtical movements, columnar setting</th>
+<th id=3D"qr-9" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"typesetting.html#aldrld-intro">+++ Horizontal and vertical mo=
vements, columnar setting</a></th>
 </tr>
 <tr>
 <td><a href=3D"typesetting.html#ald">ALD</a></td><td>-- move downards on=
 the page</td>
@@ -351,7 +357,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-10" class=3D"quick-ref" colspan=3D"2" >+++ Indents</th>
+<th id=3D"qr-10" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"typesetting.html#indents-intro">+++ Indents</a></th>
 </tr>
 <tr>
 <td><a href=3D"typesetting.html#il">IL</a></td><td>-- set and turn on a =
left indent</td>
@@ -384,7 +391,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-11" class=3D"quick-ref" colspan=3D"2" >+++ Tabs</th>
+<th id=3D"qr-11" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"typesetting.html#tabs-intro">+++ Tabs</a></th>
 </tr>
 <tr>
 <td><a href=3D"typesetting.html#tab-set">TAB_SET</a></td><td>-- set up a=
 typesetting tab</td>
@@ -450,7 +458,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-14" class=3D"quick-ref" colspan=3D"2" >+++ Nested lists</th=
>
+<th id=3D"qr-14" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#list-intro">+++ Nested lists</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#list">LIST</a></td><td>-- begin a list</t=
d>
@@ -471,7 +480,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-15" class=3D"quick-ref" colspan=3D"2" >+++ Colour</th>
+<th id=3D"qr-15" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"color.html#color-intro">+++ Colour</a></th>
 </tr>
 <tr>
 <td><a href=3D"color.html#newcolor">NEWCOLOR</a></td><td>-- initialize (=
define) a colour</td>
@@ -571,7 +581,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-18" class=3D"quick-ref" colspan=3D"2" >+++ Graphical object=
s and images</th>
+<th id=3D"qr-18" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"graphical.html#intro-graphical">+++ Graphical objects and ima=
ges</a></th>
 </tr>
 <tr>
 <td><a href=3D"graphical.html#drh">DRH</a></td><td>-- draw a horizontal =
rule</td>
@@ -600,7 +611,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-19" class=3D"quick-ref" colspan=3D"2" >+++ Reference macros=
</th>
+<th id=3D"qr-19" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docprocessing.html#reference-macros">+++ Reference macros</a>=
</th>
 </tr>
 <tr>
 <td><a href=3D"docprocessing.html#title">TITLE</a></td><td>-- document t=
itle</td>
@@ -654,7 +666,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-20" class=3D"quick-ref" colspan=3D"2" >+++ General document=
 formatting directives</th>
+<th id=3D"qr-20" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docprocessing.html#docstyle-macros">+++ General document form=
atting directives</a></th>
 </tr>
 <tr>
 <td><a href=3D"docprocessing.html#doctype">DOCTYPE</a></td><td>-- genera=
l document type</td>
@@ -669,7 +682,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-21" class=3D"quick-ref" colspan=3D"2" >+++ Line numbering</=
th>
+<th id=3D"qr-21" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#number-lines-intro">+++ Line numbering</a></t=
h>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#number-lines">NUMBER_LINES</a></td><td>--=
 automatic line numbering on/off</td>
@@ -687,7 +701,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-22" class=3D"quick-ref" colspan=3D"2" >+++ Set documents in=
 columns</th>
+<th id=3D"qr-22" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docprocessing.html#columns-intro">+++ Set documents in column=
s</a></th>
 </tr>
 <tr>
 <td><a href=3D"docprocessing.html#columns">COLUMNS</a></td>
@@ -723,7 +738,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-24" class=3D"quick-ref" colspan=3D"2" >+++ Initiate documen=
t processing</th>
+<th id=3D"qr-24" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docprocessing.html#start-macro">+++ Initiate document process=
ing</a></th>
 </tr>
 <tr>
 <td><a href=3D"docprocessing.html#start">START</a></td><td>-- begin docu=
ment processing</td>
@@ -732,7 +748,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-25" class=3D"quick-ref" colspan=3D"2" >+++ Epigraphs</th>
+<th id=3D"qr-25" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#epigraph-intro">+++ Epigraphs</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#epigraph">EPIGRAPH</a></td><td>-- set an =
epigraph underneath the docheader</td>
@@ -744,7 +761,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-26" class=3D"quick-ref" colspan=3D"2" >+++ HEADINGS</th>
+<th id=3D"qr-26" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#heading-intro">+++ HEADINGS</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#heading">HEADING</a></td><td>-- hierarchi=
cal headings</td>
@@ -760,7 +778,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-30" class=3D"quick-ref" colspan=3D"2" >+++ Paragraphs</th>
+<th id=3D"qr-30" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#pp-intro">+++ Paragraphs</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#pp">PP</a></td><td>-- set a paragraph</td=
>
@@ -784,7 +803,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-31" class=3D"quick-ref" colspan=3D"2" >+++ Quotes (line for=
 line verbatim quotes)</th>
+<th id=3D"qr-31" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#quote-intro">+++ Quotes (line for line verbat=
im quotes)</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#quote">QUOTE</a></td><td>-- set quoted te=
xt line for line </td>
@@ -799,7 +819,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-32" class=3D"quick-ref" colspan=3D"2" >+++ Blockquotes (cit=
ed passages of text)</th>
+<th id=3D"qr-32" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#blockquote-intro">+++ Blockquotes (cited pass=
ages of text)</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#blockquote">BLOCKQUOTE</a></td><td>-- set=
 longer passages of cited text</td>
@@ -814,7 +835,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-49" class=3D"quick-ref" colspan=3D"2" >+++Floats </th>
+<th id=3D"qr-49" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"images.html#floats-intro">+++ Floats</a></th>
 </tr>
 <tr>
 <td style=3D"vertical-align: top"><a href=3D"images.html#float">FLOAT</a=
></td><td>-- keep blocks of input together, output on next page
@@ -825,7 +847,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-53" class=3D"quick-ref" colspan=3D"2" >+++Images and graphi=
cs </th>
+<th id=3D"qr-53" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"images.html#images-intro">+++ Images and graphics</a></th>
 </tr>
 <tr>
 <td style=3D"vertical-align: top"><a href=3D"images.html#pdf">PDF_IMAGE<=
/a></td><td>-- inserting pdf images
@@ -840,7 +863,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-51" class=3D"quick-ref" colspan=3D"2" >+++eqn support </th>
+<th id=3D"qr-51" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"images.html#eqn">+++ eqn support</a></th>
 </tr>
 <tr>
 <td><a href=3D"images.html#eq-en">EQ</a></td><td>-- begin an eqn block</=
td>
@@ -852,7 +876,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-52" class=3D"quick-ref" colspan=3D"2" >+++pic support </th>
+<th id=3D"qr-52" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"images.html#pic">+++ pic support</a></th>
 </tr>
 <tr>
 <td><a href=3D"images.html#ps-pe">PS</a></td><td>-- begin a pic block</t=
d>
@@ -867,7 +892,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-50" class=3D"quick-ref" colspan=3D"2" >+++tbl support</th>
+<th id=3D"qr-50" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"images.html#tbl">+++ tbl support</a></th>
 </tr>
 <tr>
 <td><a href=3D"images.html#ts-te">TS</a></td><td>-- begin a tbl block</t=
d>
@@ -882,12 +908,16 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-54" class=3D"quick-ref" colspan=3D"2" >+++ Captions and lab=
els</th>
+<th id=3D"qr-54" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"images.html#captions-and-labels">+++ Captions and labels</a><=
/th>
 </tr>
 <tr>
 <td><a href=3D"images.html#autolabel">AUTOLABEL</a></td><td>-- auto-labe=
l figures, tables, equations</td>
 </tr>
 <tr>
+<td><a href=3D"images.html#set-autolabel">SET_AUTOLABEL</a></td><td>-- s=
et or reset autolabel numbers</td>
+</tr>
+<tr>
 <td><a href=3D"images.html#caption-after-label">CAPTION_AFTER_LABEL</a><=
/td><td>-- place captions after labels</td>
 </tr>
 <tr>
@@ -912,7 +942,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-55" class=3D"quick-ref" colspan=3D"2" >+++Lists of Figures,=
 Tables, and Equations</th>
+<th id=3D"qr-55" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"images.html#lists-of">+++ Lists of Figures, Tables, and Equat=
ions</a></th>
 </tr>
 <tr>
 <td><a href=3D"images.html#lists-macros">LIST_OF_FIGURES</a></td><td>-- =
generate a List of Figures</td>
@@ -930,7 +961,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-33" class=3D"quick-ref" colspan=3D"2" >+++ Code snippets</t=
h>
+<th id=3D"qr-33" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#code-intro">+++ Code snippets</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#code">CODE</a></td><td>-- set a code snip=
pet</td>
@@ -948,7 +980,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-34" class=3D"quick-ref" colspan=3D"2" >+++ Author linebreak=
s (section breaks)</th>
+<th id=3D"qr-34" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#linebreak-intro">+++ Author linebreaks (secti=
on breaks)</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#linebreak">LINEBREAK</a></td><td>-- inser=
t an author linebreak (section break)</td>
@@ -966,7 +999,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-35" class=3D"quick-ref" colspan=3D"2" >+++ Document termina=
tion string</th>
+<th id=3D"qr-35" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#finis-intro">+++ Document termination string<=
/a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#finis">FINIS</a></td><td>-- insert a docu=
ment termination string</td>
@@ -987,7 +1021,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-36" class=3D"quick-ref" colspan=3D"2" >+++ Footnotes</th>
+<th id=3D"qr-36" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#footnote-intro">+++ Footnotes</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#footnote">FOOTNOTE</a></td><td>-- set a f=
ootnote</td>
@@ -1021,7 +1056,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-37" class=3D"quick-ref" colspan=3D"2" >+++ Endnotes</th>
+<th id=3D"qr-37" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#endnote-intro">+++ Endnotes</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#endnote">ENDNOTE</a></td><td>-- set an en=
dnote</td>
@@ -1062,7 +1098,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-38" class=3D"quick-ref" colspan=3D"2" >+++ Margin notes</th=
>
+<th id=3D"qr-38" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docelement.html#margin-notes-intro">+++ Margin notes</a></th>
 </tr>
 <tr>
 <td><a href=3D"docelement.html#mn-init">MN_INIT</a></td><td>-- initializ=
e margin notes</td>
@@ -1074,7 +1111,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-39" class=3D"quick-ref" colspan=3D"2" >+++ Bibliographic re=
ferences</th>
+<th id=3D"qr-39" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"refer.html#intro-ref">+++ Bibliographic references</a></th>
 </tr>
 <tr>
 <td><a href=3D"refer.html#ref">REF</a></td><td>-- begin a reference</td>
@@ -1119,7 +1157,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-40" class=3D"quick-ref" colspan=3D"2" >+++ Tables of conten=
ts</th>
+<th id=3D"qr-40" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"tables-of-contents.html#toc-intro">+++ Tables of contents</a>=
</th>
 </tr>
 <tr>
 <td><a href=3D"tables-of-contents.html#toc">TOC</a></td><td>-- output a =
table of contents</td>
@@ -1155,7 +1194,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-41" class=3D"quick-ref" colspan=3D"2" >+++ Letter (correspo=
ndence) macros</th>
+<th id=3D"qr-41" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"letters.html#letters-intro">+++ Letter (correspondence) macro=
s</a></th>
 </tr>
 <tr>
 <td><a href=3D"letters.html#date">DATE</a></td><td>-- letter&#8217;s dat=
e</td>
@@ -1185,7 +1225,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-42" class=3D"quick-ref" colspan=3D"2" >+++ Changing global =
print style parameters after START</th>
+<th id=3D"qr-42" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docprocessing.html#style-after-start">+++ Changing global pri=
nt style parameters after START</a></th>
 </tr>
 <tr>
 <td><a href=3D"docprocessing.html#doc-left-margin">DOC_LEFT_MARGIN</a></=
td><td>-- left margin of everything on the page</td>
@@ -1224,7 +1265,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-44" class=3D"quick-ref" colspan=3D"2" >+++ Managing page he=
aders and footers</th>
+<th id=3D"qr-44" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"headfootpage.html#headfoot-management">+++ Managing page head=
ers and footers</a></th>
 </tr>
 <tr>
 <td><a href=3D"headfootpage.html#headers">HEADERS</a></td><td>-- page he=
aders on/off</td>
@@ -1264,7 +1306,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-45" class=3D"quick-ref" colspan=3D"2" >+++ Recto/verso page=
 headers and footers</th>
+<th id=3D"qr-45" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"rectoverso.html#rectoverso-intro">+++ Recto/verso page header=
s and footers</a></th>
 </tr>
 <tr>
 <td><a href=3D"rectoverso.html#recto-verso">RECTO_VERSO</a></td><td>-- r=
ecto/verso headers and/or footers on/off</td>
@@ -1291,7 +1334,8 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-46" class=3D"quick-ref" colspan=3D"2" >+++ Pagination</th>
+<th id=3D"qr-46" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"headfootpage.html#pagination-intro">+++ Pagination</a></th>
 </tr>
 <tr>
 <td><a href=3D"headfootpage.html#paginate">PAGINATE</a></td><td>-- pagin=
ation on/off</td>
@@ -1315,7 +1359,22 @@ elsewhere in the documentation.
=20
 <table class=3D"quick-ref">
 <tr>
-<th id=3D"qr-47" class=3D"quick-ref" colspan=3D"2" >+++ Document and sec=
tion cover (title) pages</th>
+<th id=3D"qr-57" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"docprocessing.html#vertical-whitespace-management">+++ Vertic=
al whitespace management</a></th>
+</tr>
+<tr>
+<td><a href=3D"docprocessing.html#shim">SHIM</a></td><td>-- align to the=
 baseline grid</td>
+</tr>
+<tr>
+<td><a href=3D"docprocessing.html#flex">FLEX</a></td><td>-- insert flexi=
ble whitespace</td>
+</tr>
+</table>
+
+
+<table class=3D"quick-ref">
+<tr>
+<th id=3D"qr-47" class=3D"quick-ref" colspan=3D"2" >
+<a href=3D"cover.html#cover-intro">+++ Document and section cover (title=
) pages</a></th>
 </tr>
 <tr>
 <td><a href=3D"cover.html#cover">COVER</a></td><td>-- information to inc=
lude in a section cover</td>
diff --git a/contrib/mom/momdoc/rectoverso.html b/contrib/mom/momdoc/rect=
overso.html
index 025684b..49bfeb3 100644
--- a/contrib/mom/momdoc/rectoverso.html
+++ b/contrib/mom/momdoc/rectoverso.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
diff --git a/contrib/mom/momdoc/refer.html b/contrib/mom/momdoc/refer.htm=
l
index 486c82b..ef90caf 100644
--- a/contrib/mom/momdoc/refer.html
+++ b/contrib/mom/momdoc/refer.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -2070,9 +2070,9 @@ in this way.
 </p>
=20
 <p>
-Mom&#8217;s default is to double-underscore the title with 1/2-point
-rules placed 2 points apart and 2 points below the baseline of the
-title.
+By default, mom double-underscores the title if your
+<a href=3D"docprocessing.html#printstyle">PRINTSTYLE</a>
+is <kbd>TYPEWRITE</kbd>.
 </p>
=20
 <!-- -BIBLIO_STRING_CAPS- -->
diff --git a/contrib/mom/momdoc/reserved.html b/contrib/mom/momdoc/reserv=
ed.html
index 096d960..91df415 100644
--- a/contrib/mom/momdoc/reserved.html
+++ b/contrib/mom/momdoc/reserved.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
diff --git a/contrib/mom/momdoc/stylesheet.css b/contrib/mom/momdoc/style=
sheet.css
index 6a2a71f..7791bf0 100644
--- a/contrib/mom/momdoc/stylesheet.css
+++ b/contrib/mom/momdoc/stylesheet.css
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2016  Free Software Foundation, Inc. */
+/* Copyright (C) 2004-2017  Free Software Foundation, Inc. */
 /* This file is part of mom, which is part of groff, a free software */
 /* project. */
=20
@@ -545,7 +545,7 @@ kbd
 {
   font-family: "Lucida Console",monospace ;
   font-weight: bold ;
-  font-size: 95% ;
+  font-size: 98% ;
 }
 kbd.macro-args
 {
diff --git a/contrib/mom/momdoc/tables-of-contents.html b/contrib/mom/mom=
doc/tables-of-contents.html
index a40510a..0f872e1 100644
--- a/contrib/mom/momdoc/tables-of-contents.html
+++ b/contrib/mom/momdoc/tables-of-contents.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -124,7 +124,7 @@ the rest of the document is.  Lastly, if
 printing is enabled, the table of contents respects it.  This
 sometimes leads to tables of contents that begin with the wrong
 margins, but the margins can be corrected either by outputting a
-<a href=3D"#blank-page">BLANKPAGE</a>
+<a href=3D"headfootpage.html#blank-pages">BLANKPAGE</a>
 or by using the control macro
 <a href=3D"#toc-rv-switch">TOC_RV_SWITCH</a>.
 </p>
@@ -380,6 +380,7 @@ themselves (overall family, headers/footers, paginati=
on, etc).
     <li><a href=3D"#toc-padding">Establish the number of placeholders to=
 leave for page reference numbers</a></li>
     <li><a href=3D"#toc-rv-switch">Switch tables of contents page margin=
s</a></li>
   </ul></li>
+  <li><a href=3D"#toc-more">I still need more!</a></li>
 </ol>
 </div>
=20
@@ -1098,7 +1099,60 @@ page when you want an odd, or vice versa.
=20
 <p>
 The same result can be accomplished by outputting a
-<a href=3D"#blank-page">BLANKPAGE</a>.
+<a href=3D"headfootpage.html#blank-pages">BLANKPAGE</a>.
+</p>
+
+<h4 id=3D"toc-more" class=3D"docs" style=3D"margin-top: -.5em;">6. I sti=
ll need more!</h4>
+
+<p>
+If there is some aspect of Table of Contents formatting for which
+no TOC control macros are provided, mom has a special
+<a href=3D"definitions.html#toggle">toggle macro</a>
+to help out: TOC_PAGE_SETTINGS.
+</p>
+
+<p>
+TOC_PAGE_SETTINGS allows you to enter extra formatting changes for
+the Table of Contents as if it were simply another collated section
+or chapter of a document.  Because it&#8217;s a toggle macro,
+invoking it by itself begins collecting your formatting directives,
+and invoking it with any argument (<b>OFF, QUIT, END</b>...) stops
+the collection.
+</p>
+
+<p>
+TOC_PAGE_SETTINGS is special in that the formatting commands
+contained within it must be preceded by <kbd>\!</kbd> (that&#8217;s
+backslash-exclamation point).
+</p>
+
+<p id=3D"toc-page-settings-example">
+For example, say you want to redesign the default page headers for
+the Tables of Contents so that it only contains the document title
+on the left and &#8220;Contents&#8221; in italics on the right, and
+furthermore adjust the footer margin and footer gap, this is how
+you&#8217;d do it:
+<br/>
+<span class=3D"pre-in-pp">
+  .TOC_PAGE_SETTINGS
+  \!.HEADER_RECTO L "^\E*[$TITLE]#\*[IT]Contents\*[PREV]^"
+  \!.FOOTER_MARGIN 3P
+  \!.B_MARGIN 6P+3p
+  .TOC_PAGE_SETTINGS END
+</span>
+(For an explanation of why the example uses <kbd>.B_MARGIN</kbd> to
+set/change the footer gap, see
+<a href=3D"headfootpage.html#gap-note">here</a>.)
+</p>
+
+<p>
+TOC_PAGE_SETTINGS can be put in the stylesheet section of a document
+(ie after
+<a href=3D"docprocessing.html#printstyle">PRINTSTYLE</a>
+and before
+<a href=3D"docprocessing.html#start">START</a>)
+or invoked just before
+<a href=3D"#toc">TOC</a>.
 </p>
=20
 <div class=3D"rule-long"><hr/></div>
diff --git a/contrib/mom/momdoc/toc.html b/contrib/mom/momdoc/toc.html
index c7cc754..b83e8ff 100644
--- a/contrib/mom/momdoc/toc.html
+++ b/contrib/mom/momdoc/toc.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -20,7 +20,7 @@ FDL in the main directory of the groff source package.
=20
 <head>
   <meta http-equiv=3D"content-type" content=3D"text/html;charset=3Dutf-8=
"/>
-  <title>Mom, version 2.1-b -- Table of Contents</title>
+  <title>Mom, version 2.2 -- Table of Contents</title>
   <link rel=3D"stylesheet" type=3D"text/css" href=3D"stylesheet.css" />
 </head>
=20
@@ -31,7 +31,7 @@ FDL in the main directory of the groff source package.
 <div class=3D"page">
=20
   <div class=3D"version">
-    mom, version 2.1-b
+    mom, version 2.2
   </div>
=20
 <h1 class=3D"toc" style=3D"margin-top: 9px;">Table of Contents</h1>
@@ -95,6 +95,7 @@ FDL in the main directory of the groff source package.
     <ul class=3D"toc" style=3D"margin-left: 3em;">
       <li><a href=3D"#doc-proc">Introduction to document processing</a><=
/li>
       <li><a href=3D"#doc-defaults">Document defaults</a></li>
+      <li><a href=3D"#vert-ws">Vertical whitespace management</a></li>
       <li><a href=3D"#prelim">Preliminary document setup</a></li>
       <li><a href=3D"#typemacdoc">Behaviour of the typesetting macros du=
ring document processing</a></li>
       <li><a href=3D"#tags">The document element tags</a> &ndash; headin=
gs, paragraphs, quotes, footnotes, etc.</li>
@@ -264,9 +265,10 @@ FDL in the main directory of the groff source packag=
e.
   <ul class=3D"toc">
     <li><a href=3D"docprocessing.html#docprocessing-intro">5.1 Introduct=
ion to document processing</a></li>
     <li><a id=3D"doc-defaults" href=3D"docprocessing.html#defaults">5.2 =
Document defaults</a> &ndash; papersize, margins, etc.
-      <ul>
-        <li><a href=3D"docprocessing.html#leading-note">5.2.1 Important =
note on leading/spacing and bottom margins</a></li>
-        <li><a href=3D"docprocessing.html#shim">5.2.1 The SHIM macro</a>=
 &ndash; flexible spacer to keep document leading back on track</li>
+      <li><a id=3D"vert-ws" href=3D"docprocessing.html#vertical-whitespa=
ce-management">5.3 Vertical whitespace management</a>
+        <ul>
+        <li><a id=3D"typemacdoc" href=3D"docprocessing.html#shim">5.3.1 =
SHIM</a></li>
+        <li><a href=3D"docprocessing.html#flex">5.3.2 FLEX</a>
       </ul></li>
     <li><a id=3D"prelim" href=3D"docprocessing.html#setup" class=3D"high=
light">5.3 PRELIMINARY DOCUMENT SETUP</a>
       <ul>
@@ -311,20 +313,14 @@ FDL in the main directory of the groff source packa=
ge.
               </ul></li>
             <li><a href=3D"docprocessing.html#doc-lead-adjust">5.3.7.2  =
DOC_LEAD_ADJUST</a> &ndash; adjust document
                 <a href=3D"definitions.html#leading">leading</a>
-                to fill pages
-            <ul class=3D"fourth-level">
-              <li>&ndash; <a href=3D"docprocessing.html#shim">5.3.6.7.1 =
SHIM</a> &ndash; flexible spacer to keep document leading back on track</=
li>
-            </ul></li>
-        </ul></li>
+                to fill pages</li>
+            </ul>
       <li><a href=3D"docprocessing.html#style-after-start">5.3.8 Changin=
g basic type and formatting parameters <span style=3D"font-style: italic"=
>after</span> START</a>
         <ul>
           <li><a id=3D"typemacdoc" href=3D"docprocessing.html#behaviour"=
>5.3.8.1 Behaviour of the typesetting macros during document processing</=
a></li>
           <li><a href=3D"docprocessing.html#intro-doc-param">5.3.8.2 Pos=
t-START global style-change macros</a>
-          <ul class=3D"fourth-level">
-            <li>&ndash; <a href=3D"docprocessing.html#index-doc-param">M=
acro list</a></li>
           </ul></li>
         </ul></li>
-      </ul></li>
       <li><a id=3D"tags" class=3D"highlight" href=3D"docelement.html#top=
">5.4 THE DOCUMENT ELEMENT TAGS</a>
         <ul>
           <li><a href=3D"docelement.html#docelement-intro">5.4.1 Introdu=
ction to the document element tags</a>
diff --git a/contrib/mom/momdoc/typesetting.html b/contrib/mom/momdoc/typ=
esetting.html
index 7fdb1be..7f5c9d4 100644
--- a/contrib/mom/momdoc/typesetting.html
+++ b/contrib/mom/momdoc/typesetting.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -3020,11 +3020,11 @@ fonts rather than relying on mom's pseudo version=
.
 </p>
=20
 <p>
-To achieve a reasonable facsimile of designer-cut small fonts, mom
-needs to know the percentage of regular caps at a given point size
-by which to reduce the small caps.  To make adjustments for the
-difference in weight and width of the smaller caps, she also needs
-to know by how much to embolden (&#8220;fatten&#8221;) the
+To achieve a reasonable facsimile of designer-cut smallcaps fonts,
+mom needs to know the percentage of regular caps at a given point
+size by which to reduce the small caps.  To make adjustments for
+the difference in weight and width of the smaller caps, she also
+needs to know by how much to embolden (&#8220;fatten&#8221;) the
 smallcaps, and by how much to increase their width.
 </p>
=20
diff --git a/contrib/mom/momdoc/using.html b/contrib/mom/momdoc/using.htm=
l
index 2973e06..630fc51 100644
--- a/contrib/mom/momdoc/using.html
+++ b/contrib/mom/momdoc/using.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -286,12 +286,12 @@ metadata, notably the document window title set wit=
h PDF_TITLE.
=20
 <p>
 Most PDF viewers have a &#8220;Watch File&#8221; option, which
-automaticaly updates a displayed document whenever there's a change.
-This is useful when preparing documents that require judgment calls.
-I recommend creating a keymapping in your text editor that both
-saves the mom file and processes it with <strong>pdfmom</strong>.
-The displayed PDF then automatically reflects whatever changes you
-save to the mom file.
+automaticaly updates a displayed document whenever there&#8217;s
+a change.  This is useful when preparing documents that require
+judgment calls.  I recommend creating a keymapping in your
+text editor that both saves the mom file and processes it with
+<strong>pdfmom</strong>.  The displayed PDF then automatically
+reflects whatever changes you save to the mom file.
 </p>
=20
 <div class=3D"rule-long"><hr/></div>
diff --git a/contrib/mom/momdoc/version-2.html b/contrib/mom/momdoc/versi=
on-2.html
index 8681b7b..7c566bf 100644
--- a/contrib/mom/momdoc/version-2.html
+++ b/contrib/mom/momdoc/version-2.html
@@ -2,7 +2,7 @@
 <!--
 This file is part of groff, the GNU roff type-setting system.
=20
-Copyright (C) 2004-2016 Free Software Foundation, Inc.
+Copyright (C) 2004-2017 Free Software Foundation, Inc.
 Written by Peter Schaffter (peter@schaffter.ca).
=20
 Permission is granted to copy, distribute and/or modify this document
@@ -367,6 +367,24 @@ The following changes have been made:
   elements on them does</li>
 </ul>
=20
+<h2 id=3D"v2.1-changes" class=3D"docs">3. Version 2.2 changes</h2>
+
+<p>
+Version 2.2 adds these features:
+</p>
+<ul style=3D"margin-top: -.5em; width: 90%">
+  <li>flex-spacing, an alternative to mom&#8217;s default shimming
+  policy; flex-spacing balances vertical whitespace on the page by
+  distributing any excess equally at sensible points so that running
+  text always fills the page to the bottom margin (see
+  <a href=3D"docprocessing.html#vertical-whitespace-management">
+    vertical whitespace management</a>
+  </li>
+  <li>improvements to auto-labelling, such that it is now possible
+  to link symbollically to auto-labelled preprocessor material and
+  PDF images</li>
+</ul>
+
 <h2 id=3D"pdfmom" class=3D"docs">4. pdfmom</h2>
=20
 <p>


From MAILER-DAEMON Sun Feb 26 22:29:07 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ciBzn-0005MP-PV
	for mharc-groff-commit@gnu.org; Sun, 26 Feb 2017 22:29:07 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43942)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBzg-0005LX-Gn
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:29:05 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBzb-0007Ea-QI
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:29:00 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:37170)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciBzb-0007EN-K3
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:28:55 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 71277)
	id 1BA4A262DE; Sun, 26 Feb 2017 22:28:55 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: Tidy up formatting, couple of spelling/grammar changes.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Peter Schaffter <peter@schaffter.ca>
In-Reply-To: groff@gnu.org
References: <20170227032854.29055.34918@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: ecefdb1884d5edc5ddfb173990687c99a40cef56
Auto-Submitted: auto-generated
Message-Id: <20170227032855.1BA4A262DE@vcs0.savannah.gnu.org>
Date: Sun, 26 Feb 2017 22:28:54 -0500 (EST)
From: peter@schaffter.ca (Peter Schaffter)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Feb 2017 03:29:05 -0000

PTPi pushed a commit to branch master
in repository groff.

commit ecefdb1884d5edc5ddfb173990687c99a40cef56
Author: Peter Schaffter <peter@schaffter.ca>
Date:   Sun Feb 26 22:28:07 2017 -0500

    Tidy up formatting, couple of spelling/grammar changes.
---
 doc/automake.mom | 883 ++++++++++++++++++++++++++++++-------------------=
------
 1 file changed, 484 insertions(+), 399 deletions(-)

diff --git a/doc/automake.mom b/doc/automake.mom
index 1ed18ee..c67e5db 100644
--- a/doc/automake.mom
+++ b/doc/automake.mom
@@ -1,4 +1,4 @@
-.\" Copyright =C2=A92014 Free Software Foundation
+.\" Copyright =C2=A92014, 2017 Free Software Foundation
 .\" 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 .\"
 .\" Permission is hereby granted, free of charge, to any person
@@ -26,75 +26,96 @@
 .\" .WS controls word spacing
 .\"  Hanging punctuation and hyphens are inserted manually
 .\"
-.TITLE "Using Automake in the Groff project"
-.AUTHOR "Bertrand Garrigues"
-.DOCTYPE    DEFAULT
-.PRINTSTYLE TYPESET
+.TITLE     "Using Automake in the Groff project"
+.AUTHOR    "Bertrand Garrigues"
+.COPYRIGHT "2014, 2017 Free Software Foundation"
+.COVER     TITLE AUTHOR DOCTYPE COPYRIGHT
+.
 .PAPER      LETTER
-.COPYRIGHT "Free Software Foundation 2014"
-.DOC_COVERTITLE "Using Automake in the Groff project"
-.DOC_COVER DOC_COVERTITLE
-.COVER TITLE AUTHOR DOCTYPE COPYRIGHT
-
+.PRINTSTYLE TYPESET
+.
 .HEADING_STYLE 1 NUMBER
 .HEADING_STYLE 2 NUMBER
 .HEADING_STYLE 3 NUMBER
 .HEADING_STYLE 4 NUMBER
-
+.
+.QUOTE_INDENT 2m
+.CODE_FONT CB
+.
 \# Table of contents
 .TOC_PADDING 2
 .SPACE_TOC_ITEMS
 .AUTO_RELOCATE_TOC
 .TOC_ENTRY_STYLE 2 FONT I
 .TOC_LEAD 14
-
-.QUOTE_INDENT 1m
+.
+.NO_SHIM \" Flex-spaced
+.
 .START
-
-.PP
-This is a quick overview of how to use `automake' in the groff project,
-and is intended to help the developers and contributors to find their wa=
y
-when they have to make some changes to the sources files or to the data =
that are installed.
-If you need more details on `automake',
-here are some reading suggestions:
+.
+.PP
+This is a quick overview of how to use `automake' in the groff
+project, and is intended to help the developers and contributors
+find their way when they have to make changes to the sources files
+or to the data that are installed.  If you need more details on
+`automake', here are some reading suggestions:
+.
+.LEFT
+.SP 3p
+.
 .LIST
+.SHIFT_LIST 1m
 .ITEM
-the Automake Manual:
-.BR
-.PDF_WWW_LINK http://www.gnu.org/software/automake/manual/automake.html.
+The Automake Manual:
+\*[FWD 1m]\c
+.PDF_WWW_LINK https://www.gnu.org/software/automake/manual/automake.html
+.SP 3p
 .ITEM
 A book by John Calcote, with good practical examples:
-.BR
+\*[FWD 1m]\c
 .PDF_WWW_LINK http://fsmsh.com/2753
+.SP 3p
 .ITEM
 This site, by Diego Petteno, with good practical examples too:
-.BR
+\*[FWD 1m]\c
 .PDF_WWW_LINK https://autotools.io/index.html
 .LIST OFF
-
-
+.
+.JUSTIFY
+.HY DEFAULT
+.
 .HEADING 1 "Overview, the initial build"
-
+.
 .HEADING 2 "First build"
-
+.
 .PP
-Groff integrates the `gnulib' and uses its `bootstrap' script.
-When compiling from the git repository, you should first invoke this scr=
ipt:
+Groff integrates the `gnulib' and uses its `bootstrap' script.  When
+compiling from the git repository, you should first invoke this
+script:
 .QUOTE
 .CODE
 $ ./bootstrap
-.CODE OFF
 .QUOTE OFF
 This will:
+.
+.QUAD LEFT
+.HY OFF
+.
 .LIST
+.SHIFT_LIST 1m
 .ITEM
+.SP 3p
 Clone the gnulib repository as a git submodule in 'gnulib',
 add the needed gnulib sources files in `lib',=20
 add the needed gnulib m4 macros in `gnulib_m4'.
+.SP 3p
 .ITEM
-Invoke autoreconf that will call all the `GNU autotools' (`aclocal', `au=
toheader', `autoconf', `automake')
-in the right order for creating the following files:
+Invoke autoreconf that will call all the `GNU autotools' (`aclocal',
+`autoheader', `autoconf', `automake') in the right order for
+creating the following files:
 .LIST DASH
+.SHIFT_LIST .5m
+.SP 3p
 .ITEM
 INSTALL (a symlink to gnulib's INSTALL file)
 .ITEM
@@ -109,429 +130,471 @@ build-aux/ (that contains all the helper scripts)
 configure
 .ITEM
 src/include/config.hin
+.LIST BACK
 .LIST OFF
-.LIST OFF
-
-Note that aclocal.m4 is generated and the groff m4 macros are included v=
ia the acinclude.m4 file.
-
+.
+.SP 3p
+.JUSTIFY
+.HY DEFAULT
+.
+.WS +2
+.EW .5
+Note that aclocal.m4 is generated and the groff m4 macros are
+included via the acinclude.m4 file.
+.WS DEFAULT
+.EW 0
+.
 .PP =20
-At this point you can invoke the `configure' script and call `make' to b=
uild the groff project.
-You can do it in the source tree:
+At this point you can invoke the `configure' script and call `make'
+to build the groff project.  You can do it in the source tree:
 .QUOTE
 .CODE
 $ ./configure
 $ make
-.CODE OFF
 .QUOTE OFF
-You can also build groff in an out of source build tree,
-which is cleaner:
+You can also build groff in an out-of-source build tree, which is
+cleaner:
 .QUOTE
 .CODE
 $ mkdir build
 $ cd build
 $ ../configure
 $ make
-.CODE OFF
 .QUOTE OFF
-Note that parallel build is also supported and make can be invoked with =
the -j option,
-which will greatly speed up the build.
-
+Note that parallel build is also supported and `make' can be invoked
+with the -j option, which will greatly speed up the build.
+.
 .HEADING 2 "Automake in the autotools process"
-
-.PP
-Automake's main job is to generate a Makefile.in file
-(this file is maintained manually on projects using only autoconf).
-The main file processed by `automake' is the Makefile.am file,
-which eventually generates a Makefile.
-The (simplified) process is:
+.
+.PP
+Automake's main job is to generate a Makefile.in file (this file is
+maintained manually on projects using only autoconf).  The main file
+processed by `automake' is the Makefile.am file, which eventually
+generates a Makefile.  The (simplified) process is:
+.
+.SP 3p
+.QUAD LEFT
+.HY OFF
+.
 .LIST
+.SHIFT_LIST 1m
 .ITEM
-`aclocal' generates the `aclocal.m4' file from `configure.ac' and the us=
er-defined macros in `acinclude.m4'.
+`aclocal' generates the `aclocal.m4' file from `configure.ac' and
+the user-defined macros in `acinclude.m4'.
 .ITEM
 `autoheader' generates config.h.in.
 .ITEM
 `autoconf' generates the `configure' script from `aclocal.m4' and `confi=
gure.ac'
 .ITEM
-`automake' generates Makefile.in from Makefile.am and the `configure.ac'=
 file.
-It also generates some helper scripts, on the groff project they are loc=
ated in build-aux.
+`automake' generates Makefile.in from Makefile.am and the
+`configure.ac' file.  It also generates some helper scripts, on the
+groff project they are located in build-aux.
 .ITEM
 `configure' generates `config.status'
 .ITEM
 `config.status' generates the Makefile and config.h.
 .LIST OFF
-Finally, `autoreconf' is the program that can be used to call these vari=
ous tools in the correct order.
-
-.PP
-.PP
-Automake defines a set of special variables that are used to generate va=
rious build rules in the final Makefile.
-Note however that if Automake's pre-defined rules are not enough,
-you still have the possibility to add handwritten standard `make' rules =
in a Makefile.am:
-these rules will be copied verbatim in the Makefile.in and then in the f=
inal Makefile.
-
+.
+.SP 3p
+.JUSTIFY
+.HY DEFAULT
+.
+.WS -2
+.RW .16
+Finally, `autoreconf' is the program that can be used to call these
+various tools in the correct order.
+.RW 0
+.WS DEFAULT
+.
+.PP
+Automake defines a set of special variables that are used to
+generate various build rules in the final Makefile.  Note however
+that if Automake's pre-defined rules are not enough, you still have
+the possibility of adding handwritten standard `make' rules in a
+Makefile.am; these rules will be copied verbatim in the Makefile.in
+and then in the final Makefile.
+.
 .HEADING 2 "Modification of autotools files"
-
+.
 .PP
 Previously, when groff used `autoconf' only and not `automake',
-you had to invoke manually the autotools,
-depending on what you modified.
-For example, to change the file `aclocal.m4', you had to run the shell c=
ommand 'aclocal -I m4';
-to recreate the files `configure' and `Makefile',
-you had to use the command 'autoreconf -I m4'.
-
+you had to invoke manually the autotools, depending on what you
+modified.  For example, to change the file `aclocal.m4', you had
+to run the shell command 'aclocal -I m4'; to recreate the files
+`configure' and `Makefile', you had to use the command 'autoreconf
+- I m4'.
 .PP
 Now, as groff uses `automake', you don't need to run `autoreconf'.
-If you make some changes in Makefile.am or configure.ac,
-all the files that need to be updated will be regenerated when you execu=
te `make'.
-
+If you make some changes in Makefile.am or configure.ac, all the
+files that need to be updated will be regenerated when you execute
+`make'.
+.
 .HEADING 1 "Building a program"
-
+.
 .HEADING 2 "A program and its source files"
-
+.
 .PP
-Generally speaking, when using `automake'=20
-you will have to write a Makefile.am file and use the variable \*[CODE]b=
in_PROGRAMS\*[CODE OFF]
-to declare a program that should be built,=20
-and then list the sources of this program in a variable
-that starts with the name of your program and ends with \*[CODE]_SOURCES=
\*[CODE OFF] .
-In the groff project we have only 1 top-level Makefile.am that includes =
several .am files.
-
+Generally speaking, when using `automake' you will have to write a
+Makefile.am file and use the variable \*[CODE]bin_PROGRAMS\*[CODE OFF]
+to declare a program that should be built, and then list the
+sources of this program in a variable that starts with the name of
+your program and ends with \*[CODE]_SOURCES\*[CODE OFF]\&.  In the
+groff project we have only 1 top-level Makefile.am that includes
+several .am files.
 .PP
 Take for example the build of grolbp, in src/devices/grolbp/grolbp.am.=20
 The file starts with:
-.QUOTE
+.QUOTE ADJUST -4p
 .CODE
 bin_PROGRAMS +=3D grolbp
-.CODE OFF
 .QUOTE OFF
-This says that a program named `grolbp' is added to the list of the prog=
rams that should be built.=20
-Note that \*[CODE]bin_PROGRAMS\*[CODE OFF]
-is initialized to an empty string in the top-level Makefile.am,=20
-which includes grolbp.am.=20
-We will see later why we don't write directly
-.BR
-\*[CODE]bin_PROGRAMS =3D grolbp\*[CODE OFF] in a Makefile.am in the grol=
bp directory.
-
+This says that a program named `grolbp' is added to the list of the
+programs that should be built.  Note that \*[CODE]bin_PROGRAMS\*[CODE OF=
F]
+is initialized to an empty string in the top-level Makefile.am,
+which includes grolbp.am.  (We will see later why we don't write
+directly
+\*[CODE]bin_PROGRAMS\~=3D\~grolbp\*[CODE OFF] in a Makefile.am in the
+grolbp directory.)
+.PP
 Then, we list the sources of grolbp like this:
-.QUOTE
+.QUOTE ADJUST -4p
+.IL 1m
+.HI 1m
 .CODE
-.ESC_CHAR %
-grolbp_SOURCES =3D \
-  src/devices/grolbp/lbp.cpp \
-  src/devices/grolbp/lbp.h \
-  src/devices/grolbp/charset.h
-.ESC_CHAR \
-.CODE OFF
+grolbp_SOURCES =3D \\
+src/devices/grolbp/lbp.cpp \\
+src/devices/grolbp/lbp.h \\
+src/devices/grolbp/charset.h
 .QUOTE OFF
-As you added `grolbp' to \*[CODE]bin_PROGRAMS \*[CODE OFF]
-you need to define the sources of grolbp in the variable \*[CODE]grolbp_=
SOURCES\*[CODE OFF] .
-If you write in another file \*[CODE]bin_PROGRAMS +=3D foo\*[CODE OFF],
-you will list the sources of `foo'
-in \*[CODE]foo_SOURCES\*[CODE OFF] .
-
-.PP
-With these two statements,=20
-the resulting generated Makefile will contain everything that is needed =
to=20
-build, clean, install and uninstall the `grolbp' binary
-when invoking the adequate make command.
-Also, the source files listed in \*[CODE]grolbp_SOURCES\*[CODE OFF]
-will automatically be included in the distribution tarball.=20
-That is why the headers are also listed in \*[CODE]grolbp_SOURCES\*[CODE=
 OFF]:=20
-it is not necessary to add them in order to correctly build `grolbp',
-but this way the headers will be distributed.
-
-.PP
-Note that:
+.ILQ
+As you added `grolbp' to \*[CODE]bin_PROGRAMS\*[CODE OFF],
+you need to define the sources of grolbp in the variable
+\*[CODE]grolbp_SOURCES\*[CODE OFF]\&.  If you write in another file
+\*[CODE]bin_PROGRAMS +=3D foo\*[CODE OFF] you will list the sources
+of `foo' in \*[CODE]foo_SOURCES\*[CODE OFF]\&.
+.PP
+With these two statements, the resulting generated Makefile
+will contain everything that is needed to build, clean,
+install and uninstall the `grolbp' binary when invoking the
+adequate `make' command.  Also, the source files listed in
+\*[CODE]grolbp_SOURCES\*[CODE OFF] will automatically be included in
+the distribution tarball.  That is why the headers are also listed
+in \*[CODE]grolbp_SOURCES\*[CODE OFF]: it is not necessary to add
+them in order to correctly build `grolbp', but this way the headers
+will be distributed.  Note that:
+.
+.SP 3p
+.QUAD LEFT
+.HY OFF
+.
 .LIST
+.SHIFT_LIST 1m
 .ITEM
 The path to the files are relative to the top-level directory.
 .ITEM
 The binaries are generated in the top-level build directory.
 .ITEM
-The .o files are generated in the directory where the source files are l=
ocated,
-or, in the case of an out-of-source build tree,
-in a directory that is the replication of the source tree directory.
-For example if you built groff in a `build' directory,
-lbp.o (object file from src/devices/grolbp/lbp.cpp) will be located in
+The .o files are generated in the directory where the source files
+are located, or, in the case of an out-of-source build tree, in a
+directory that is the replication of the source tree directory.
+For example if you built groff in a `build' directory, lbp.o
+(object file from src/devices/grolbp/lbp.cpp) will be located in
 build/src/devices/grolbp/lbp.o.
 .LIST OFF
-We will also see later the reasons, this is due to the non-recursive mak=
e design.
-
+.
+.SP 3p
+.JUSTIFY
+.HY DEFAULT
+.
+We will also see later the reasons; this is due to the non-recursive
+make design.
+.
 .HEADING 2 "Linking against a library"
-
+.
 .PP
 To list which libraries grolbp needs to link against, we just write:
 .QUOTE
+.IL
+.HI
 .CODE
-.ESC_CHAR %
-grolbp_LDADD =3D $(LIBM) \
-  libdriver.a \
-  libgroff.a \
-  lib/libgnu.a
-.ESC_CHAR \
-.CODE OFF
+grolbp_LDADD =3D $(LIBM) \\
+libdriver.a \\
+libgroff.a \\
+lib/libgnu.a
 .QUOTE OFF
-Again, we use the variable \*[CODE]grolbp_LDADD\*[CODE OFF] because we a=
dded a program named `grolbp'.
-This will also automatically set build dependencies between `grolbp' and=
 the libraries it needs:
-`libdriver.a' and `libgroff.a',
-that are convenience libraries built within the groff project,
-will be compiled before grolbp.
-
+.ILQ
+Again, we use the variable \*[CODE]grolbp_LDADD\*[CODE OFF] because
+we added a program named `grolbp'.  This will also automatically
+set build dependencies between `grolbp' and the libraries it needs:
+`libdriver.a' and `libgroff.a', that are convenience libraries built
+within the groff project, will be compiled before grolbp.
+.
 .HEADING 2 "Preprocessor flags"
-
-.PP
-Preprocessor flags that are common to all the binaries are listed in
-the variable \*[CODE]AM_CPPFLAGS\*[CODE OFF] in the top-level Makefile.a=
m.
-If a `foo' binary needs specific preprocessor flags,
-use \*[CODE]foo_CPPFLAGS\*[CODE OFF],
-for example, in src/devices/xditview/xditview.am,
-extra flags are needed to build gxditview and are added like this:
+.
+.PP
+Preprocessor flags that are common to all the binaries are listed
+in the variable \*[CODE]AM_CPPFLAGS\*[CODE OFF] in the top-level
+Makefile.am.  If a `foo' binary needs specific preprocessor
+flags, use \*[CODE]foo_CPPFLAGS\*[CODE OFF], for example, in
+src/devices/xditview/xditview.am, extra flags are needed to build
+gxditview and are added like this:
 .QUOTE
+.IL
+.HI
 .CODE
-.ESC_CHAR %
-gxditview_CPPFLAGS =3D $(AM_CPPFLAGS) $(X_CFLAGS) -Dlint \
-  -I$(top_builddir)/src/devices/xditview
-.ESC_CHAR \
-.CODE OFF
+gxditview_CPPFLAGS =3D $(AM_CPPFLAGS) $(X_CFLAGS) -Dlint \\
+-I$(top_builddir)/src/devices/xditview
 .QUOTE OFF
+.ILQ
 .PP
 The use of specific CPPFLAGS changes the name of the generated objects:
 the .o object files are prefixed with the name of the program.
 For example, the .o file corresponding to src/devices/xditview/device.c
 will be src/devices/xditview/gxditview-device.o.
-
+.
 .HEADING 2 "Cleaning"
-
-.PP
-You don't need to write rules to clean the programs listed in \*[CODE]bi=
n_PROGRAMS\*[CODE OFF],
-`automake' will write them for you.
-However, some programs might have generated sources that should be clean=
ed.
-In this case, you have mainly two special variables to list extra files =
that should be cleaned:
+.
+.PP
+You don't need to write rules to clean the programs listed in
+\*[CODE]bin_PROGRAMS\*[CODE OFF], `automake' will write them for
+you.  However, some programs might have generated sources that
+should be cleaned.  In this case, you have mainly two special
+variables to list extra files that should be cleaned:
+.
+.SP 3p
+.QUAD LEFT
+.HY OFF
+.
 .LIST
+.SHIFT_LIST 1m
 .ITEM
-\*[CODE]MOSTLYCLEANFILES\*[CODE OFF] for files that should be cleaned by=
 `make mostlyclean'
+\*[CODE]MOSTLYCLEANFILES\*[CODE OFF] for files that should be
+cleaned by `make mostlyclean'
 .ITEM
-\*[CODE]CLEANFILES\*[CODE OFF ] for files that should be cleaned by `mak=
e clean'
+\*[CODE]CLEANFILES\*[CODE OFF ] for files that should be cleaned by
+`make clean'
 .LIST OFF
-
-.PP
-There is also the possibility to write custom rules,
-we will see that later.
-
+.
+.JUSTIFY
+.HY DEFAULT
+.SP 3p
+.
+There is also the possibility of writing custom rules.  We will see
+that later.
+.
 .HEADING 2 "Dependencies"
-
-.PP
-We have already seen that when linking against a convenience library,
-the dependencies are already created by `automake'.
-However, some dependencies still need to be manually added,
-for example when a source file includes a generated header.
-In this case, the easiest way is to add a plain-make dependency.
-For example, src/roff/groff/groff.cpp includes defs.h,
-which is a generated header.
-We just add in src/roff/groff/groff.am:
+.
+.PP
+We have already seen that when linking against a convenience
+library, the dependencies are already created by `automake'.
+However, some dependencies still need to be manually added, for
+example when a source file includes a generated header.  In this
+case, the easiest way is to add a plain-make dependency.  For
+example, src/roff/groff/groff.cpp includes defs.h, which is a
+generated header.  We just add in src/roff/groff/groff.am:
 .QUOTE
 .CODE
 src/roff/groff/groff.$(OBJEXT): defs.h
-.CODE OFF
 .QUOTE OFF
-
+.
 .HEADING 2 "Scripts"
-
-.PP
-A part from \*[CODE]bin_PROGRAMS\*[CODE OFF],
-there is another similar special variable for scripts:
-\*[CODE]bin_SCRIPTS\*[CODE OFF] .
-The scripts listed in this variable will automatically be built
-(of course you have to provide your custom rule to build the script),
-installed and uninstalled when invoking 'make', 'make install' and 'make=
 uninstall'.
-The main difference is that unlike the programs listed in \*[CODE]bin_PR=
OGRAMS\*[CODE OFF],
-the scripts will not be cleaned by default.
-They are not distributed by default either.
-In the groff project, \*[CODE]bin_SCRIPTS\*[CODE OFF] are cleaned becaus=
e they are added to
-\*[CODE]MOSTLYCLEANFILES\*[CODE OFF] in the top-level Makefile.am.
-
-.PP
-A simple example are the gropdf and pdfmom scripts in src/devices/gropdf=
/gropdf.am:
+.
+.PP
+Apart from \*[CODE]bin_PROGRAMS\*[CODE OFF], there is another
+similar special variable for scripts:  \*[CODE]bin_SCRIPTS\*[CODE OFF]\&=
.
+The scripts listed in this variable will automatically be
+built (of course you have to provide your custom rule to build the
+script), installed and uninstalled when invoking 'make', 'make
+install' and 'make uninstall'.  The main difference is that unlike
+the programs listed in \*[CODE]bin_PROGRAMS\*[CODE OFF], the scripts
+will not be cleaned by default.  They are not distributed by default
+either.  In the groff project, \*[CODE]bin_SCRIPTS\*[CODE OFF] are
+cleaned because they are added to \*[CODE]MOSTLYCLEANFILES\*[CODE OFF]
+in the top-level Makefile.am.
+.PP
+A simple example are the gropdf and pdfmom scripts in
+src/devices/gropdf/gropdf.am:
+.CODE_SIZE 84
+.QUOTE_INDENT 1
 .QUOTE
 .CODE
-.ESC_CHAR %
 bin_SCRIPTS +=3D gropdf pdfmom
   [...]
 gropdf: $(gropdf_dir)/gropdf.pl $(SH_DEPS_SED_SCRIPT)
         rm -f $@
-        sed -f $(SH_DEPS_SED_SCRIPT) \
-            -e "s|[@]VERSION[@]|$(VERSION)|" \
-            -e "s|[@]PERL[@]|$(PERL)|" \
-            -e "s|[@]GROFF_FONT_DIR[@]|$(fontpath)|" \
+        sed -f $(SH_DEPS_SED_SCRIPT) \\
+            -e "s|[@]VERSION[@]|$(VERSION)|" \\
+            -e "s|[@]PERL[@]|$(PERL)|" \\
+            -e "s|[@]GROFF_FONT_DIR[@]|$(fontpath)|" \\
             -e "s|[@]RT_SEP[@]|$(RT_SEP)|" $(gropdf_dir)/gropdf.pl >$@
         chmod +x $@
=20
 pdfmom: $(gropdf_dir)/pdfmom.pl $(SH_DEPS_SED_SCRIPT)
         rm -f $@
-        sed -f $(SH_DEPS_SED_SCRIPT) \
-            -e "s|[@]VERSION[@]|$(VERSION)|" \
+        sed -f $(SH_DEPS_SED_SCRIPT) \\
+            -e "s|[@]VERSION[@]|$(VERSION)|" \\
             -e "s|[@]PERL[@]|$(PERL)|" $(gropdf_dir)/pdfmom.pl >$@
         chmod +x $@
-.ESC_CHAR \
-.CODE OFF
 .QUOTE OFF
-
-Note that in this example the '@' symbol is protected by square brackets=
 to prevent
-the substitution of the variable by `automake'.=20
-
+.QUOTE_INDENT 2m
+.CODE_SIZE 100
+Note that in this example the '@' symbol is protected by square
+brackets to prevent the substitution of the variable by `automake'.
+.
 .HEADING 1 "Non-recursive make schema"
-
+.
 .PP
-There are two possibilities to organize the Makefile.am of a large proje=
ct,
-using a recusive or a non-recursive `make'.
-
+There are two possibilities for organizing the Makefile.am of a
+large project, using a recusive or a non-recursive `make'.
+.
 .HEADING 2 "1st possibility: make recursion"
-
+.
 .PP
-A top level Makefile.am includes other Makefile.am,
-using the \*[CODE]SUBDIRS\*[CODE OFF] directive,
-and the Makefile.am of each sub-directory lists the programs that should=
 be built.
-If we had
+A top level Makefile.am includes another Makefile.am, using the
+\*[CODE]SUBDIRS\*[CODE OFF] directive, and the Makefile.am of each
+sub-directory lists the programs that should be built.  If we had
 chosen this type of organization, we would have a Makefile.am in
-src/devices/grolbp and in each directory that contain sources to build
-a program (tbl, eqn, troff etc ...). We would write in the top-level
-Makefile.am:
+src/devices/grolbp and in each directory that contain sources to
+build a program (tbl, eqn, troff etc ...).  We would write in the
+top-level Makefile.am:
 .QUOTE
+.IL
+.HI
 .CODE
-.ESC_CHAR %
-SUBDIRS =3D src/devices/grolbp \
-  ... (and all the dir that build a program or a script)
-.ESC_CHAR \
-.CODE OFF
+SUBDIRS =3D src/devices/grolbp \\
+\&... (and all the dir that build a program or a script)
 .QUOTE OFF
-and in src/devices/grolbp, we would have a file Makefile.am that contain=
s:
+and in src/devices/grolbp, we would have a file Makefile.am that
+contains:
 .QUOTE
 .CODE
 bin_PROGRAMS =3D grolbp
 grolbp_SOURCES =3D lbp.cpp lbp.h charset.h
-.CODE OFF
 .QUOTE OFF
 .PP
-Only `grolbp' is affected to the variable \*[CODE]bin_PROGRAMS\*[CODE OF=
F] .
-It would be the same in, say, src/roff/troff:=20
-you would have a Makefile.am with \*[CODE]bin_PROGRAMS =3D troff\*[CODE =
OFF] .
-We would have 1 generated Makefile per Makefile.am file:=20
-in the build tree you will have the top-level Makefile,=20
-grolbp's Makefile in src/devices/grolbp,
-troff's Makefile in src/roff/troff, and so on.=20
-When calling `make' to build everything,
-make will be recursively called in all the directories that have a Makef=
ile.=20
-Thus, the paths are logically relative to the directory that contains th=
e Makefile.am.
-
-.PP
-This approach has the disadvantage of making dependencies harder to solv=
e:=20
-each Makefile does not know the targets of the other Makfiles.
-It also makes the build slower.
-
+Only `grolbp' is affected to the variable \*[CODE]bin_PROGRAMS\*[CODE OF=
F]\&.
+It would be the same in, say, src/roff/troff: you would have a Makefile.=
am
+with \*[CODE]bin_PROGRAMS =3D troff\*[CODE OFF]\&.  We would have
+one generated Makefile per Makefile.am file: in the build tree
+you will have the top-level Makefile, grolbp's Makefile in
+src/devices/grolbp, troff's Makefile in src/roff/troff, and so on.
+When calling `make' to build everything, `make' will be recursively
+called in all the directories that have a Makefile.  Thus, the
+paths are logically relative to the directory that contains the
+Makefile.am.
+.PP
+This approach has the disadvantage of making dependencies harder
+to resolve: each Makefile does not know the targets of the other
+Makfiles.  It also makes the build slower.
+.
 .HEADING 2 "Non-recursive make used by the Groff project"
-
-.PP
-The second possibility, that was chosen on groff project,=20
-is to use a non-recursive make schema.=20
-It is described in paragraph 7.3 of the Automake manual ("An Alternative=
 Approach to Subdirectories"),
-based on the following parper from Peter Miller: Recursive Make Consider=
ed
-Harmful
-.PDF_WWW_LINK http://miller.emu.id.au/pmiller/books/rmch/
-
+.
+.PP
+The second possibility, which was chosen for the groff project, is to us=
e
+a non-recursive make schema.  It is described in paragraph 7.3 of
+the Automake manual ("An Alternative Approach to Subdirectories"),
+based on the following paper from Peter Miller:
+.PDF_WWW_LINK http://miller.emu.id.au/pmiller/books/rmch/ \
+  SUFFIX . "\*[IT]Recursive Make Considered Harmful\*[PREV]"
+.PP
+The idea is to have a single Makefile that contains all the rules.
+That is why we have only a single Makefile.am in the top-level
+directory which includes all the .am files that define rules
+to build the various programs.  The inclusion is done with the
+\*[CODE]include\*[CODE OFF] directive, not \*[CODE]SUBDIRS\*[CODE OFF]\&=
.
+Using 'include' is like copying the contents of the included
+file into the top-level Makefile.am, and will not generate other
+Makefile.
 .PP
-The idea is to have a single Makefile that contains all the rules.=20
-That is why we have only a single Makefile.am in the top-level directory
-which includes all the .am files that define rules to build the various =
programs.
-The inclusion is done with the \*[CODE]include\*[CODE OFF] directive, no=
t \*[CODE]SUBDIRS\*[CODE OFF] .
-Using 'include' is like copying the content of the included file into th=
e top-level Makefile.am,
-and will not generate other Makefile.
 We first say in this top-level Makefile.am:
 .QUOTE
 .CODE=20
-  bin_PROGAMS =3D=20
-.CODE OFF
+bin_PROGAMS =3D=20
 .QUOTE OFF
-and then all the .am files that define a program to be built
-(e.g. src/devices/grolbp/grolbp.am, src/roff/troff/troff.am, and so on)
-overload this variable,=20
-so that at the end, all the programs that should be built are listed in =
this \*[CODE]bin_PROGRAMS\*[CODE OFF] variable.
-This is the reason why all the paths in the various .am files are relati=
ve to the top-level directory:
-at the end we will have only one Makefile in the top-level directory of =
the build tree.
-
-.PP
-As the resulting single Makefile knows all the targets,
-the dependencies are easier to manage.
-The build is also faster, particularly when compiling a single file:
-make is called once only and the file will be instantly rebuilt,
-while on a recursive make system, make will have to be invoked in all th=
e sub-directories.
-
-.PP
-Note also that in order to make `gnulib' work with this non-recursive sc=
hema,
-the `non-recursive-gnulib-prefix-hack' configuration should be selected =
in bootstrap.conf.
-
+and then all the .am files that define a program to be built (e.g.
+src/devices/grolbp/grolbp.am, src/roff/troff/troff.am, and so on)
+overload this variable, so that at the end, all the programs that
+should be built are listed in this \*[CODE]bin_PROGRAMS\*[CODE OFF]
+variable.  This is the reason why all the paths in the various .am
+files are relative to the top-level directory: at the end we will
+have only one Makefile in the top-level directory of the build tree.
+.PP
+As the resulting single Makefile knows all the targets, the
+dependencies are easier to manage.  The build is also faster,
+particularly when compiling a single file: `make' is called once only
+and the file will be instantly rebuilt, while on a recursive make
+system, `make' will have to be invoked in all the sub-directories.
+.PP
+Note also that in order to make `gnulib' work with this
+non-recursive schema, the `non-recursive-gnulib-prefix-hack'
+configuration should be selected in bootstrap.conf.
+.
 .HEADING 1 "Installing data"
-
-.PP
-Variables that end with \*[CODE]_DATA\*[CODE OFF] are special variables =
used to list files that should be installed in a particular location.
-The prefix of the variables should refer to another previously defined v=
ariable that ends with a `dir' suffix.
-This varibale that ends with `dir' defines where the files should be ins=
talled.
-
+.
+.PP
+Variables that end with \*[CODE]_DATA\*[CODE OFF] are special
+variables used to list files that should be installed in a
+particular location.  The prefix of the variables should refer to
+another previously defined variable that ends with a `dir' suffix.
+This varibale that ends with `dir' defines where the files should be
+installed.
+.
 .HEADING 2 "A simple case"
-
+.
 .PP
 For example, in font/devX100/devX100.am, we can see this:
-
 .QUOTE
 .CODE
 if !WITHOUT_X11
 devX100fontdir =3D $(fontdir)/devX100
 devX100font_DATA =3D $(DEVX100FONTS)
 endif
-
+.SP
 EXTRA_DIST +=3D $(DEVX100FONTS)
-.CODE OFF
 .QUOTE OFF
-\*[CODE]DEVX100FONTS\*[CODE OFF] is just a list font files,
-defined at the begining of devX100.am.
-\*[CODE]fontdir\*[CODE OFF] is where all the font directories are instal=
led,
-it is defined in the top-level Makefile.am.
-The conditional \*[CODE]if !WITHOUT_X11\*[CODE OFF]
-is used to prevent the installation of these files if X11 is not availab=
le.
-
+.WS -4
+\*[CODE]DEVX100FONTS\*[CODE OFF] is just a list of font files,
+defined at the begining of devX100.am.  \*[CODE]fontdir\*[CODE OFF]
+is where all the font directories are installed, it is defined
+in the top-level Makefile.am.  The conditional
+\*[CODE]if\~!WITHOUT_X11\*[CODE OFF]
+is used to prevent the installation of
+these files if X11 is not available.
+.WS DEFAULT
+.PP
 We first define where we wants to install the devX100 fonts with:
-
 .QUOTE
 .CODE
 devX100fontdir =3D $(fontdir)/devX100
-.CODE OFF
 .QUOTE OFF
-Because we declared a variable ending with `dir',
-we are allowed to define \*[CODE]devX100font_DATA\*[CODE OFF]
-(you remove the `dir' suffix and add \*[CODE]_DATA\*[CODE OFF]).
-Note that wildcards are not supported in the special variable that end w=
ith \*[CODE]_DATA\*[CODE OFF].
-
-.PP
-With these two lines, `make install' will install the files listed in  \=
*[CODE]DEVX100FONTS \*[CODE OFF]
-and `make uninstall' will uninstall them.
-\*[CODE]devX100fontdir\*[CODE OFF] will be automatically created if miss=
ing during the installation process,
-but not removed during the uninstall.
-The complete  \*[CODE]fontdir \*[CODE OFF] is removed by a custom uninst=
all rule
+Because we declared a variable ending with `dir', we are allowed
+to define \*[CODE]devX100font_DATA\*[CODE OFF] (you remove the
+`dir' suffix and add \*[CODE]_DATA\*[CODE OFF]).  Note that
+wildcards are not supported in the special variable that end with
+\*[CODE]_DATA\*[CODE OFF]\&.
+.PP
+With these two lines, `make install' will install the files
+listed in \*[CODE]DEVX100FONTS\*[CODE OFF] and `make uninstall'
+will uninstall them.  \*[CODE]devX100fontdir\*[CODE OFF] will be
+automatically created if missing during the installation
+process, but not removed during the uninstall.  The complete
+\*[CODE]fontdir\*[CODE OFF] is removed by a custom uninstall rule
 (uninstall_groffdirs in Makefile.am).
-
 .PP
-Because the files listed in  \*[CODE]devX100font_DATA \*[CODE OFF] are n=
ot distributed by default,
-we explicitely added them to the \*[CODE]EXTRA_DIST\*[CODE OFF] variable=
,
-which lists all the files that should be distributed and that are not ta=
ken into account by the default automake rules.
+Because the files listed in \*[CODE]devX100font_DATA\*[CODE OFF]
+are not distributed by default, we explicitely added them to the
+\*[CODE]EXTRA_DIST\*[CODE OFF] variable, which lists all the files
+that should be distributed and that are not taken into account by
+the default automake rules.
 .QUOTE
 .CODE
   EXTRA_DIST +=3D $(DEVX100FONTS)
-.CODE OFF
 .QUOTE OFF
-Another possibility would have being to add a `dist' prefix to the \*[CO=
DE]devX100font_DATA\*[CODE OFF] variable,
-in this case the use of \*[CODE]EXTRA_DIST\*[CODE OFF] is useless
-(except of course if
-.BR
-\*[CODE]WITHOUT_X11\*[CODE OFF] is true,
-in this case we don't install the files but we still have to distribute =
them):
+Another possibility would have been to add a `dist' prefix to the
+\*[CODE]devX100font_DATA\*[CODE OFF] variable, in this case the use
+of \*[CODE]EXTRA_DIST\*[CODE OFF] is useless (except of course if
+\*[CODE]WITHOUT_X11\*[CODE OFF] is true, in this case we don't
+install the files but we still have to distribute them):
 .QUOTE
 .CODE
 if !WITHOUT_X11
@@ -540,136 +603,158 @@ dist_devX100font_DATA =3D $(DEVX100FONTS)
 else
 EXTRA_DIST +=3D $(DEVX100FONTS)
 endif
-.CODE OFF
 .QUOTE OFF
-
+.
 .HEADING 2 "Dealing with generated files"
-
-.PP
-In the previous example, all the font files that must be installed were =
already present in the source tree.
-But in some cases, you need to generate the files you intend to install.
-In this case, the files should be installed but not distributed.
-A simple way to deal with this is to add a `nodist' prefix to your \*[CO=
DE]xxx_DATA\*[CODE OFF] variable.
-
-.PP
-For example in font/devps/devps.am, we have a list of font files already=
 present in the source tree,=20
-defined by \*[CODE]DEVPSFONTFILES\*[CODE OFF],
-and another list of font files that are generated,
-listed in the variable \*[CODE]DEVPSFONTFILES_GENERATED\*[CODE OFF] .
-They should all by installed in a `devps' directory under the fontdir.
-Thus the following three lines, where we use the `dist' and `nodist' pre=
fixes:
+.
+.PP
+In the previous example, all the font files that must be installed
+were already present in the source tree.  But in some cases,
+you need to generate the files you intend to install.  In this
+case, the files should be installed but not distributed.  A
+simple way to deal with this is to add a `nodist' prefix to your
+\*[CODE]xxx_DATA\*[CODE OFF] variable.
+.PP
+For example in font/devps/devps.am, we have a list of
+font files already present in the source tree, defined
+by \*[CODE]DEVPSFONTFILES\*[CODE OFF], and another list
+of font files that are generated, listed in the variable
+\*[CODE]DEVPSFONTFILES_GENERATED\*[CODE OFF]\&.  They should all
+by installed in a `devps' directory under the fontdir.  Thus
+the following three lines, where we use the `dist' and `nodist'
+prefixes:
 .QUOTE
 .CODE
 devpsfontdir =3D $(fontdir)/devps
 dist_devpsfont_DATA =3D $(DEVPSFONTFILES)=20
 nodist_devpsfont_DATA =3D $(DEVPSFONTFILES_GENERATED)
-.CODE OFF
 .QUOTE OFF
-
 The generated files are not cleaned by default, thus we add:
 .QUOTE
 .CODE
 MOSTLYCLEANFILES +=3D $(DEVPSFONTFILES_GENERATED)
-.CODE OFF
 .QUOTE OFF
-
+.
 .HEADING 1 "Extending Automake's rules"
-
+.
 .HEADING 2 "Local clean rules"
-
-.PP
-In most of the cases, the files that need to be cleaned are automaticall=
y determined by `automake',
-or were added to the \*[CODE]MOSTCLEANFILES\*[CODE OFF] or \*[CODE]CLEAN=
FILES\*[CODE OFF] variables.
-However, you might need to define a specific rule to clean some files th=
at were not added to any list.
-Automake defines a set of targets to extend the clean targets with your =
own rules:
-clean-local, mostlyclean-local, distclean-local or maintainerclean-local=
.
-An example of such extension exists in font/devpdf/devpdf.am:
-because some fonts are not explicitely listed in a \*[CODE]xxx_DATA\*[CO=
DE OFF] variable but generated by a custom rule,
-we define an extra rule to extend the `mostlyclean' target:
+.
+.PP
+In most of the cases, the files that need to be cleaned are
+automatically determined by `automake', or were added to the
+\*[CODE]MOSTCLEANFILES\*[CODE OFF] or \*[CODE]CLEANFILES\*[CODE OFF]
+variables.  However, you might need to define a specific rule
+to clean some files that were not added to any list.  Automake
+defines a set of targets to extend the clean targets with your
+own rules: clean-local, mostlyclean-local, distclean-local or
+maintainerclean-local.  An example of such extension exists in
+font/devpdf/devpdf.am: because some fonts are not explicitely listed
+in a \*[CODE]xxx_DATA\*[CODE OFF] variable but generated by a custom
+rule, we define an extra rule to extend the `mostlyclean' target:
+.CODE_SIZE 92
 .QUOTE
 .CODE
-.ESC_CHAR %
 mostlyclean-local: mostlyclean_devpdf_extra
 mostlyclean_devpdf_extra:
         @echo Cleaning font/devpdf
-        rm -rf $(top_builddir)/font/devpdf/enc \
+        rm -rf $(top_builddir)/font/devpdf/enc \\
           $(top_builddir)/font/devpdf/map;
-        if test -d $(top_builddir)/font/devpdf; then \
-          for f in $(GROFF_FONT_FILES); do \
-            rm -f $(top_builddir)/font/devpdf/$$f; \
-          done; \
+        if test -d $(top_builddir)/font/devpdf; then \\
+          for f in $(GROFF_FONT_FILES); do \\
+            rm -f $(top_builddir)/font/devpdf/$$f; \\
+          done; \\
         fi
-.ESC_CHAR \
-.CODE OFF
 .QUOTE OFF
-
+.
+.NO_FLEX OFF \" Prevent upcoming NEWPAGE from disabling flex-spacing.
 .HEADING 2 "Local install/uninstall rules and hooks"
-
-.PP
-Similarly to the clean rules, there are extensions to install and uninst=
all rules.
-They come with two flavous, local rules and hooks.
+.
+.PP
+Similarly to the clean rules, there are extensions to install and
+uninstall rules.  They come with two flavous, local rules and hooks.
+.
+.SP 3p
+.QUAD LEFT
+.HY OFF
+.
 .LIST
+.SHIFT_LIST 1m
 .ITEM
-There are 2 rules to extend install commands:
-`install-exec-local' for binaries and  `install-data-local' for data.
+There are 2 rules to extend install commands: `install-exec-local'
+for binaries and `install-data-local' for data.
 .ITEM
 There is 1 uninstall local rule: `uninstall-local'.
 .LIST OFF
-There are no garantee on the order of execution of these local rules.
-An example of local rule is the installation of GXditview.ad and GXditvi=
ew-color.ad files in=20
-src/devices/xditview/xditview.am:
-if theses files are already installed, the old files are first saved.
-Also, the final file that is installed is stripped from its .ad suffix.
-Thus the usage of a custom rules rather than the definition of a \*[CODE=
]xxx_DATA\*[CODE OFF] variable:
+.
+.SP 3p
+.JUSTIFY
+.HY DEFAULT
+.
+There are no garantees on the order of execution of these local
+rules.  An example of local rule is the installation of GXditview.ad
+and GXditview-color.ad files in src/devices/xditview/xditview.am: if
+theses files are already installed, the old files are first saved.
+Also, the final file that is installed is stripped from its .ad
+suffix.  Thus the usage of a custom rule rather than the definition
+of a \*[CODE]xxx_DATA\*[CODE OFF] variable:
+.FLEX
 .QUOTE
 .CODE
-.ESC_CHAR %
 # Custom installation of GXditview.ad and GXditview-color.ad
 install-data-local: install_xditview
 uninstall-local: uninstall_xditview
-
+.SP
 [...]
 install_xditview: $(xditview_srcdir)/GXditview.ad
-        -test -d $(DESTDIR)$(appresdir) \
+        -test -d $(DESTDIR)$(appresdir) \\
           || $(mkinstalldirs) $(DESTDIR)$(appresdir)
-        if test -f $(DESTDIR)$(appresdir)/GXditview; then \
-          mv $(DESTDIR)$(appresdir)/GXditview \
-            $(DESTDIR)$(appresdir)/GXditview.old; \
+        if test -f $(DESTDIR)$(appresdir)/GXditview; then \\
+          mv $(DESTDIR)$(appresdir)/GXditview \\
+            $(DESTDIR)$(appresdir)/GXditview.old; \\
         fi
         [...]
-        $(INSTALL_DATA) $(xditview_srcdir)/GXditview.ad \
+        $(INSTALL_DATA) $(xditview_srcdir)/GXditview.ad \\
           $(DESTDIR)$(appresdir)/GXditview
-.ESC_CHAR \
-.CODE OFF
 .QUOTE OFF
-
+.NEWPAGE
 .PP
-Hooks, on the other hand, are garanteed to be executed after all the sta=
ndard targets have been executed.
+Hooks, on the other hand, are garanteed to be executed after all the
+standard targets have been executed.
+.BR
+.SP 3p
+.QUAD LEFT
+.HY OFF
+.
 .LIST
+.SHIFT_LIST 1m
+.SP 3p
 .ITEM
-There are 2 install hooks: `install-exec-hook' and `install-data-hook'.
+There are 2 install hooks: `install-exec-hook' and
+`install-data-hook'.
 .ITEM
 There is 1 uninstall hook: `unintall-hook'
 .LIST OFF
-
-.PP
-An example of hook is the `uninstall_groffdirs' rule in the top-level Ma=
kefile.am.
-This hook is used to remove all the directories specific to groff introd=
uced by the installation process.
-Obviously it could not be a local extension of `uninstall' because the o=
rder of execution is not guaranteed.
+.
+.SP 3p
+.JUSTIFY
+.HY DEFAULT
+.
+.PP
+An example of hook is the `uninstall_groffdirs' rule in the
+top-level Makefile.am.  This hook is used to remove all the
+directories specific to groff introduced by the installation
+process.  Obviously it could not be a local extension of `uninstall'
+because the order of execution is not guaranteed.
 .QUOTE
 .CODE
-.ESC_CHAR %
 # directories specific to groff
 uninstall-hook: uninstall_groffdirs
 uninstall_groffdirs:
-        if test -d $(DESTDIR)$(datasubdir); then \
-          rm -rf $(DESTDIR)$(fontdir); \
-          rm -rf $(DESTDIR)$(oldfontdir); \
-          rmdir $(DESTDIR)$(datasubdir); \
+        if test -d $(DESTDIR)$(datasubdir); then \\
+          rm -rf $(DESTDIR)$(fontdir); \\
+          rm -rf $(DESTDIR)$(oldfontdir); \\
+          rmdir $(DESTDIR)$(datasubdir); \\
         fi
         [...]
-.ESC_CHAR \
-.CODE OFF
 .QUOTE OFF
-.TOC_RV_SWITCH
 .TOC


From MAILER-DAEMON Sun Feb 26 22:31:12 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ciC1o-0005u8-8D
	for mharc-groff-commit@gnu.org; Sun, 26 Feb 2017 22:31:12 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44425)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciC1m-0005s7-2Z
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:31:11 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciC1l-0007vb-4i
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:31:10 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:37209)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciC1l-0007vW-1V
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:31:09 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 71277)
	id E0B6C262DE; Sun, 26 Feb 2017 22:31:08 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: Clarify nl and .ne .
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Peter Schaffter <peter@schaffter.ca>
In-Reply-To: groff@gnu.org
References: <20170227033108.30429.29971@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: 48de7e420599ea280969d1873aee5e88f223fecd
Auto-Submitted: auto-generated
Message-Id: <20170227033108.E0B6C262DE@vcs0.savannah.gnu.org>
Date: Sun, 26 Feb 2017 22:31:08 -0500 (EST)
From: peter@schaffter.ca (Peter Schaffter)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Feb 2017 03:31:11 -0000

PTPi pushed a commit to branch master
in repository groff.

commit 48de7e420599ea280969d1873aee5e88f223fecd
Author: Peter Schaffter <peter@schaffter.ca>
Date:   Sun Feb 26 22:30:37 2017 -0500

    Clarify nl and .ne .
---
 doc/groff.texi | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index b0e41dc..314315d 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -12572,12 +12572,12 @@ sense to use it outside of trap macros.
 @cindex @code{ne} request, and the @code{.trunc} register
 @cindex truncated vertical space register (@code{.trunc})
 A read-only register containing the amount of vertical space truncated
-by the most recently sprung vertical position trap, or, if the trap was
-sprung by an @code{ne} request, minus the amount of vertical motion
-produced by the @code{ne} request.  In other words, at the point a trap
-is sprung, it represents the difference of what the vertical position
-would have been but for the trap, and what the vertical position
-actually is.
+from an @code{sp} request by the most recently sprung vertical
+position trap, or, if the trap was sprung by an @code{ne} request,
+minus the amount of vertical motion produced by the @code{ne}
+request.  In other words, at the point a trap is sprung, it
+represents the difference of what the vertical position would have
+been but for the trap, and what the vertical position actually is.
=20
 Since the @code{.trunc} register is only set by traps it doesn't make
 much sense to use it outside of trap macros.
@@ -12954,9 +12954,9 @@ as register @code{nl}.
 @cindex mark, high-water, register (@code{.h})
 @cindex position of lowest text line (@code{.h})
 @cindex text line, position of lowest (@code{.h})
-The @dfn{high-water mark} on the current page.  It corresponds to the
-text baseline of the lowest line on the page.  This is a read-only
-register.
+The @dfn{high-water mark} on the current page or in the current
+diversion.  It corresponds to the text baseline of the lowest line
+on the page.  This is a read-only register.
=20
 @Example
 .tm .h=3D=3D\n[.h], nl=3D=3D\n[nl]


From MAILER-DAEMON Sun Feb 26 22:33:34 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ciC46-0006LW-IQ
	for mharc-groff-commit@gnu.org; Sun, 26 Feb 2017 22:33:34 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44836)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciC45-0006LO-4P
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:33:33 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciC43-000091-Vr
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:33:33 -0500
Received: from vcs0.savannah.gnu.org ([208.118.235.201]:37235)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <peter@schaffter.ca>) id 1ciC43-00008t-T2
	for groff-commit@gnu.org; Sun, 26 Feb 2017 22:33:31 -0500
Received: by vcs0.savannah.gnu.org (Postfix, from userid 71277)
	id A451726056; Sun, 26 Feb 2017 22:33:31 -0500 (EST)
To: groff-commit@gnu.org
Subject: [groff] 01/01: Update to accommodate flex-spacing and forward
	autolabel refs.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Reply-To: Peter Schaffter <peter@schaffter.ca>
In-Reply-To: groff@gnu.org
References: <20170227033331.32013.95212@vcs0.savannah.gnu.org>
X-Git-Repo: groff
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Rev: b93476ce7e9219132b5d768c270b4286a5e6ad3e
Auto-Submitted: auto-generated
Message-Id: <20170227033331.A451726056@vcs0.savannah.gnu.org>
Date: Sun, 26 Feb 2017 22:33:31 -0500 (EST)
From: peter@schaffter.ca (Peter Schaffter)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 208.118.235.201
X-BeenThere: groff-commit@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <groff-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/groff-commit/>
List-Post: <mailto:groff-commit@gnu.org>
List-Help: <mailto:groff-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/groff-commit>,
	<mailto:groff-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Feb 2017 03:33:34 -0000

PTPi pushed a commit to branch master
in repository groff.

commit b93476ce7e9219132b5d768c270b4286a5e6ad3e
Author: Peter Schaffter <peter@schaffter.ca>
Date:   Sun Feb 26 22:32:21 2017 -0500

    Update to accommodate flex-spacing and forward autolabel refs.
---
 src/devices/gropdf/pdfmom.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/devices/gropdf/pdfmom.pl b/src/devices/gropdf/pdfmom.pl
index eacf026..a4f250c 100644
--- a/src/devices/gropdf/pdfmom.pl
+++ b/src/devices/gropdf/pdfmom.pl
@@ -123,11 +123,11 @@ if ($readstdin)
=20
 if ($dev eq 'pdf')
 {
-    system("groff -Tpdf -dPDF.EXPORT=3D1 -mom -z $preconv $cmdstring 2>&=
1 | grep \"^\\.ds\" | groff -Tpdf -mom - $preconv $cmdstring");
+    system("groff -Tpdf -dLABEL.REFS=3D1 -mom -z $preconv $cmdstring 2>&=
1 | grep '^\. *ds' | groff -Tpdf -dPDF.EXPORT=3D1 -dLABEL.REFS=3D1 -mom -=
z - $preconv $cmdstring 2>&1 | grep '^\. *ds' | groff -Tpdf -mom $preconv=
 - $cmdstring");
 }
 elsif ($dev eq 'ps')
 {
-    system("pdfroff -mpdfmark -mom --no-toc $cmdstring");
+    system("groff -Tpdf -dLABEL.REFS=3D1 -mom -z $preconv $cmdstring 2>&=
1 | grep '^\. *ds' | pdfroff -mpdfmark -mom --no-toc - $preconv $cmdstrin=
g");
 }
 elsif ($dev eq '-z') # pseudo dev - just compile for warnings
 {


