ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: mf <massifr@fastwebnet.it>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: more register questions!
Date: Thu, 2 May 2024 17:55:17 +0200	[thread overview]
Message-ID: <c97c9035-2629-433a-8da6-5204489cff49@fastwebnet.it> (raw)
In-Reply-To: <32427de6-2bd9-48c7-a15a-2832d8db6515@uni-bonn.de>


Il 02/05/24 17:01, Thomas A. Schmitz ha scritto:
> 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)?
> 

I did something like that, with a processor that added a "n" after the 
occurrence page number.

Since you typeset XML, maybe you can detect that an index (register) 
reference happens inside a note from the DOM element you are typesetting.

Then you use a command like this:

\index[NoteProcessor->sortkey]{index term}

where NoteProcessor is defined like this:

\defineprocessor[NoteProcessor][right={\itx n}]

In this case I'm adding a smaller "n" to the right of the page number of 
the occurrence.

Adding the \high style is not difficult:

\defineprocessor[NoteProcessor][right=\high{n}]

but replacing a fixed "n" with the footnote number is quite challenging.

The second argument of \defineprocessor has a "command=\...##1" option 
that could be exploited, but I don't know exactly what gets passed to 
that custom command as ##1; maybe the page number of the occurrence.

In that case, I'd look for a way to store the association between that 
occurrence and the footnote number, and retrieve that in the custom command.

Massi
___________________________________________________________________________________
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	other threads:[~2024-05-02 16:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02 15:01 [NTG-context] " Thomas A. Schmitz
2024-05-02 15:55 ` mf [this message]
2024-05-03 20:24   ` [NTG-context] " Thomas A. Schmitz
2024-05-03 20:36     ` Henning Hraban Ramm
2024-05-03 10:18 ` Wolfgang Schuster
2024-05-03 21:12   ` Thomas A. Schmitz
2024-05-08  2:22   ` Rik Kabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c97c9035-2629-433a-8da6-5204489cff49@fastwebnet.it \
    --to=massifr@fastwebnet.it \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).