Hello Wolfgang and all,

I have been trying to extend this to handle endnotes. So far, I have not succeeded; the number is always that of the last endnote.

I could possibly increment a counter for each endnote processed, but that seems a hack.

--
Rik

On 2024-05-03 06:18, Wolfgang Schuster wrote:
Thomas A. Schmitz schrieb am 02.05.2024 um 17:01:
Hi,

making wonderful progress on my registers and translating from xml. There is one thing I can't figure out (and I or some other good soul may have asked in the past...). Is it possible to mark occurrences in footnotes? Ideally, the entry in the register would look like

p. 100\high{20}

to show that the term occurs in note 20 on p. 100. But if that's asking too much, I would be content with applying a processor (say, italic) to these register entries. From the looks of the tuc file, Context doesn't appear to "know" that a register entry is within a footnote. But Hans never ceases to amaze me, so maybe there is a way (short of applying special markup to these notes in the source)?

You can play with the following example, the main point use to use the \setregisterentry command and pass the footnote counter with the third (optional) argument.

\def\IndexPageCommand#1%
  {#1\doifsomething
     {\currentregisterpageuserdata{footnote}}
     {\high{\currentregisterpageuserdata{footnote}}}}

\setupregister[index][pagecommand=\IndexPageCommand]

\starttext

\dorecurse{200}
{\samplefile{lorem}\expanded{\setregisterentry[index][entries=\recurselevel]}% \samplefile{lorem}\footnote{xxx\expanded{\setregisterentry[index][entries=\recurselevel][footnote={\rawcountervalue[footnote]}]}}%
   \samplefile{lorem}}

\page \placeindex

\stoptext

Wolfgang

___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to