bug-groff
[Top][All Lists]
Advanced

[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: Thu, 12 Aug 2021 12:27:46 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0

Follow-up Comment #3, bug #61022 (project groff):

[comment #2 comment #2:]
> To achieve a viable mechanism for implementing the forward footnote links, I
think we need to a) redefine "\**" as "\c", and b) provide a hook within "FS",
(which then *cannot* be separated from the mark location), to manage the
counter, and plant the mark as a pdfhref link.  For the reverse link, we would
need a complementary hook within what is currently "FP", (whether that name is
retained, or some alternative is substituted).
To illustrate my point, here's a document-local change, which I have added to
my working copy of pdfmark.ms:

.\" Redefine the FS macro (from s.tmac) to facilitate the placement of
.\" footnote reference marks, with each serving as a pdfhref link to the
.\" associated footnote itself.
.\"
.\" FIXME: This may be a candidate for inclusion in spdf.tmac; (note that,
.\" when defining it before the first page has begun, we must refer to the
.\" s.tmac internal name, "@FS", rather than to FS itself; better still,
.\" rather than any redefinition of @FS, would be a hook in the s.tmac
.\" implementation itself, to which pdf:fn.mark could be attached).
.\"
.rn * pdf:*
.rn @FS pdf:fn.record
.ds * \c
.de pdf:fn.mark
.\" Macro to replace original duty performed by "\**"; must be invoked
.\" at point of footnote mark placement, e.g. by 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 @FS
.\" Replacement for default FS payload implementation; handles footnote
.\" mark placement, as specified above, before recording the content of
.\" the footnote itself.
.\"
.pdf:fn.mark
.pdf:fn.record
..
.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]
..

Note that, to successfully inject the necessary pdfhref requests, at
appropriate locations, I need to redefine "@FS" and "FP", neither of which is
formally documented, in addition to "\**", which is.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61022>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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