[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 03/03: [ms]: Render footnote markers better in nroff.
From: |
G. Branden Robinson |
Subject: |
[groff] 03/03: [ms]: Render footnote markers better in nroff. |
Date: |
Fri, 30 Apr 2021 10:37:09 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit caeede07cd2e6e10134385cca194c52342f46972
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat May 1 00:13:38 2021 +1000
[ms]: Render footnote markers better in nroff.
* tmac/s.tmac: Implement alternative rendering for automatic footnote
numbers in nroff mode, inspired by Heirloom Doctools ms; since
superscripting is not univerally available on terminals, surround
number with square brackets instead.
(fn@init): New macro finishes initializing footnote module, setting up
aliases to par@sup-{start,end} strings in troff mode and otherwise
defining fn@sup-{start,end} as brackets. Define * string here, using
new strings.
(par): Call fn@init after par@sup-{start,end} are defined, and prior
to other footnote integration material.
(par*fp!0): Migrate from par@sup-{start,end} to fn@sup-{start,end}.
* doc/groff.texi (ms Document Control Settings) <FF>:
* doc/ms.ms (Footnotes) <FF>:
* tmac/groff_ms.7.man (Usage/Footnotes) <FF>: Document it.
Fixes <https://savannah.gnu.org/bugs/?60228>.
---
ChangeLog | 21 +++++++++++++++++++++
doc/groff.texi | 6 ++++--
doc/ms.ms | 12 ++++++++++--
tmac/groff_ms.7.man | 12 ++++++++++--
tmac/s.tmac | 12 ++++++++++--
5 files changed, 55 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a838c00..c482619 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
2021-04-30 G. Branden Robinson <g.branden.robinson@gmail.com>
+ * tmac/s.tmac: Implement alternative rendering for automatic
+ footnote numbers in nroff mode, inspired by Heirloom Doctools
+ ms; since superscripting is not univerally available on
+ terminals, surround number with square brackets instead.
+ (fn@init): New macro finishes initializing footnote module,
+ setting up aliases to par@sup-{start,end} strings in troff mode
+ and otherwise defining fn@sup-{start,end} as brackets. Define *
+ string here, using new strings.
+ (par): Call fn@init after par@sup-{start,end} are defined, and
+ prior to other footnote integration material.
+ (par*fp!0): Migrate from par@sup-{start,end} to
+ fn@sup-{start,end}.
+
+ * doc/groff.texi (ms Document Control Settings) <FF>:
+ * doc/ms.ms (Footnotes) <FF>:
+ * tmac/groff_ms.7.man (Usage/Footnotes) <FF>: Document it.
+
+ Fixes <https://savannah.gnu.org/bugs/?60228>.
+
+2021-04-30 G. Branden Robinson <g.branden.robinson@gmail.com>
+
* test-groff.in: Stop passing the built groff executable -b and
-ww options by default. This reverses a change from 2017. Dave
Kemper has convincingly argued that there's no way to override
diff --git a/doc/groff.texi b/doc/groff.texi
index 9a0d6cf..e827634 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -2757,8 +2757,10 @@ and those for which the @code{FS} request is given a
marker argument, at
the bottom of a column or page. This is a Berkeley extension.
@table @code
@item 0
-Indent the footnote paragraph and set the marker as a superscript
-(default).
+Set an automatic number as a superscript (on typesetter devices) or
+surrounded by square brackets (on terminals). The footnote paragraph is
+indented if there is an @code{FS} argument or an automatic number. This
+is the default.
@item 1
Like @code{0}, but set the marker as regular text and follow an
diff --git a/doc/ms.ms b/doc/ms.ms
index 5243bc6..875cdce 100644
--- a/doc/ms.ms
+++ b/doc/ms.ms
@@ -2107,8 +2107,16 @@ lf(CR) lx .
\f[CB]FF\f[] value Description
_
0 T{
-Indent the footnote paragraph and set the marker as a superscript
-(default).
+Set an automatic number as a superscript
+(on typesetter devices)
+or surrounded by square brackets
+(on terminals).
+.
+The footnote paragraph is indented if there is an
+.CW .FS
+argument or an automatic number.
+.
+This is the default.
T}
1 T{
Like
diff --git a/tmac/groff_ms.7.man b/tmac/groff_ms.7.man
index e1e8b0a..7aab8e2 100644
--- a/tmac/groff_ms.7.man
+++ b/tmac/groff_ms.7.man
@@ -1247,8 +1247,16 @@ at the bottom of a column or page as follows.
.RS
.TP
0
-Indent the footnote paragraph and set the marker as a superscript
-(default).
+Set an automatic number as a superscript
+(on typesetter devices)
+or surrounded by square brackets
+(on terminals).
+.
+The footnote paragraph is indented if there is an
+.B .FS
+argument or an automatic number.
+.
+This is the default.
.
.
.TP
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 2b84212..01f92e6 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -687,8 +687,15 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.ev
.nr fn*text-num 0 1
.nr fn*note-num 0 1
-.ds * \E*[par@sup-start]\En+[fn*text-num]\E*[par@sup-end]
.nr fn*open 0
+.\" Handle initialition tasks deferred until par module is set up.
+.de fn@init
+.ie t .als fn@sup-start par@sup-start
+.el .ds fn@sup-start [
+.ie t .als fn@sup-end par@sup-end
+.el .ds fn@sup-end ]
+.ds * \E*[fn@sup-start]\En+[fn*text-num]\E*[fn@sup-end]
+..
.\" normal FS
.de @FS
.ie \\n[.$] .fn*do-FS "\\$1" no
@@ -1555,6 +1562,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.ds par@sub-end \v'+.1m\s0-.3m'
.als > par@sub-end
.\" footnote paragraphs
+.fn@init
.\" FR is the ratio of footnote (horizontal) length to the line length
.ds FR 11/12
.\" FF is the footnote format
@@ -1572,7 +1580,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
..
.de par*fp!0
.@PP
-\&\\*[par@sup-start]\\$1\\*[par@sup-end]\ \c
+\&\\*[fn@sup-start]\\$1\\*[fn@sup-end]\ \c
..
.de par*fp!0-no
.@PP
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 03/03: [ms]: Render footnote markers better in nroff.,
G. Branden Robinson <=