[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #61022] [ms] documention neglects to mention FP macro
From: |
Keith Marshall |
Subject: |
[bug #61022] [ms] documention neglects to mention FP macro |
Date: |
Mon, 20 Sep 2021 04:26:56 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:92.0) Gecko/20100101 Firefox/92.0 |
Follow-up Comment #5, bug #61022 (project groff):
Hi Branden,
On [bug #61157 ticket #61157], you added an incidental comment:
> ... I intended to document FS-MARK but found myself confused with respect to
use cases. I'll follow up with you about that elsewhere since it's off-topic
for this ticket.
to which I replied that it would be appropriate to discuss it here.
The use-case, which I had identified at the time when I proposed the FS-MARK
callback hook, arose out of difficulties I was experiencing when trying to
create pdfhref links between footnote markers in body text, and the footnote
itself; it is basically an adaptation of the sample technique I illustrated in
comment #3, with a document-local redefinition of FS-MARK replacing my
original pdf:fn.mark macro, and obviating the need to redefine @FS:
.ds * \c
.de FS-MARK
.\" Macro to replace original duty performed by "\**"; invoked by
.\" callback from FS, BEFORE recording of the associated text within
.\" the footnote diversion is commenced.
.\"
.ie \\n[.$] \{\
. pdfhref L -D pdf:fn\\$1 -- \*{\\$1\*}
. pdfhref M -N pdf:fn\\$1r
. \}
.\"
.\" Reference to this undocumented s.tmac counter is unfortunate, but
.\" I don't see an alternative, when "\**" no longer updates it; maybe
.\" s.tmac could expose a more suitable (documented) alias.
.\"
.el .\\$0 \\n+[fn*text-num]
..
.de FP
.\" Override s.tmac's (undocumented) footnote output hook; this emulates
.\" the default output style for \n[FF] == 3 footnotes, with the footnote
.\" number formatted as a pdfhref link back to the position at which the
.\" footnote marker appears, within the document text.
.\"
.@LP
.ds pdf:fn.tag \s'-1.5p'\\$1.\s'+1.5p'
.nr pdf:fn.tag.width (u;\\n[\\n[.ev]:PI]*2)
.pdfhref M -N pdf:fn\\$1
.in +\\n[pdf:fn.tag.width]u
.ti -\\n[pdf:fn.tag.width]u
.nr pdf:fn.tag.width -\\w'\\*[pdf:fn.tag]'u
.pdfhref L -D pdf:fn\\$1r -A \\h'\\n[pdf:fn.tag.width]u'\c -- \\*[pdf:fn.tag]
..
I've since discovered that I _can_ achieve the same effect, by redefining the
"*" string, without requiring the FS-MARK callback hook, but the redefinition
is messy, and far from intuitive, so I believe the callback is still
justified. If it helps, I've attached a tentative manpage patch, to document
it.
You may note that a reference to the (undocumented) ms internal register,
fn*-ext-num is still present in the above sample code; I'm still exploring
possibilities for avoiding that.
(file #51946)
_______________________________________________________
Additional Item Attachment:
File name: ms-fs-mark-manpage.patch Size:0 KB
<https://file.savannah.gnu.org/file/ms-fs-mark-manpage.patch?file_id=51946>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?61022>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #61022] [ms] documention neglects to mention FP macro,
Keith Marshall <=