groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 17/53: tmac/e.tmac: Slightly refactor footnote numbering.


From: G. Branden Robinson
Subject: [groff] 17/53: tmac/e.tmac: Slightly refactor footnote numbering.
Date: Tue, 14 Dec 2021 01:21:50 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 1647270eb6ee995b2944117940827707fbc772cb
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Dec 10 15:06:45 2021 +1100

    tmac/e.tmac: Slightly refactor footnote numbering.
    
    * tmac/e.tmac: Slightly refactor footnote numbering.
    
      ()f): Tighten code style and end string definition with comment.
    
      (+c, initialization): Drop unused auto-incrementation of footnote
      number register `$f`.  Add new string `_*` to use when
      (re-)initializing `*` outside of a footnote diversion, and interpolate
      the footnote number register instead of a literal.
---
 ChangeLog   |  9 +++++++++
 tmac/e.tmac | 14 +++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 945d1a1..6d72490 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2021-12-08  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * tmac/e.tmac: Slightly refactor footnote numbering.
+       ()f): Tighten code style and end string definition with comment.
+       (+c, initialization): Drop unused auto-incrementation of
+       footnote number register `$f`.  Add new string `_*` to use when
+       {re-}initializing `*` outside of a footnote diversion, and
+       interpolate the footnote number register instead of a literal.
+
+2021-12-08  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * tmac/tests/e_footnote-marks-work.sh: Add unit test.
        * tmac/tmac.am (tmac_TESTS): Run test.
 
diff --git a/tmac/e.tmac b/tmac/e.tmac
index d8856df..e3eaf4e 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -1618,9 +1618,8 @@
 .de )f                 \" *** end footnote
 .ie "\\n(.z"|f" \
 \{\
-.      if \\n* \
-.              nr $f +1
-.      ds * \\*{\\n($f\\*}\k*
+.      if \\n* .nr $f +1
+.      ds * \\*{\\n($f\\*}\k*\"
 .      nr * 0
 .      in 0
 .      da
@@ -1832,8 +1831,8 @@
 .      ep
 .\}
 .nr ?C 1
-.nr $f 1 1
-.ds * \\*{1\\*}\k*
+.nr $f 1
+.ds * \\*(_*\"
 .if \\n(?R \
 .      pn 1
 .bp
@@ -2055,8 +2054,9 @@
 .nr $l \n(.lu                  \" line length
 .nr _L \n(.lu                  \" line length of page
 .nr $c 1                       \" current column number
-.nr $f 1 1                     \" footnote number
-.ds * \*{1\*}\k*\"             \" footnote "name"
+.nr $f 1                       \" footnote number
+.ds _* \\*{\\n($f\\*}\k*\"
+.ds * \*(_*\"                  \" footnote "name"
 .nr $d 1                       \" delayed text number
 .ds _# [\\n($d]\"
 .ds # \*(_#\"                  \" delayed text "name"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]