gbranden pushed a commit to branch master
in repository groff.
commit d92181a4244007a773517df3459be208db6ca1fa
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Apr 15 20:39:50 2024 -0500
tmac/an.tmac: Use more idiomatic *roff logic.
Also don't introduce an unnecessary register.
Annotate a future direction.
---
ChangeLog | 8 ++++++++
tmac/an.tmac | 8 +++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index acbb91812..2d5553bfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-04-15 G. Branden Robinson <[email protected]>
+
+ * tmac/an.tmac: Fix computation of bookmark level. If this
+ register's value is specified on the command line, don't clobber
+ it. Adjust logic for assigning tag to the bookmark to the
+ {possibly adjusted} base level accordingly. Based on a patch by
+ Deri James.
+
2024-04-05 G. Branden Robinson <[email protected]>
[troff]: Retire "el" warning category.
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 46934fd62..3f6a295e9 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -212,7 +212,7 @@
.
.\" Customize this at the command line to, for example, group multiple
.\" man pages within a collection or containing document.
-.nr an*bookmark-base-level \n[an*bookmark-base-level]+0
+.nr an*bookmark-base-level +0
.
.\" Write a bookmark/anchor/link target $2 at hierarchical depth $1.
.de an*bookmark
@@ -229,9 +229,11 @@
.ds an*bookmark*ps \" empty
.ds an*bookmark*utf8 \" empty
.
+.\" TODO: Construct a hierarchical tag name for (sub)section headings
+.\" based on the page identifier (and for subsections, the parent
+.\" section).
.de an*bookmark*pdf
-.nr an:lev \\n[an*bookmark-base-level]+1
-. ie (\\$1 = \\n[an:lev]) \
+. ie ((\\$1 - \\n[an*bookmark-base-level]) = 1) \
. pdfbookmark -T "\\$2" \\$1 \\$2
. el \
. pdfbookmark \\$1 \\$2
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit