ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] index entry with sorting and processor
@ 2024-08-25 18:33 Henning Hraban Ramm
  2024-09-27  4:02 ` [NTG-context] " Marcus Vinicius Mesquita
  0 siblings, 1 reply; 6+ messages in thread
From: Henning Hraban Ramm @ 2024-08-25 18:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi again,

the page number of register entries from a glossary should have a 
different color:

\defineprocessor[glossar][color=green]
\define[1]\GlIndex{\index[glossar->]{#1}}

This works, but I’d like to apply a macro to the text, and then I need 
to set the sort order:

\define[1]\GlIndex{\index[glossar->#1]{\Word{#1}}}

This also works, but I get separate index entries from
\index{Something}
and
\GlIndex{something}

Glossary entries may be lowercase, but in the index I’d like to 
normalize to uppercase initials. (The index command is part of a lemma 
setup.)

How can I combine the entries?

I also tried \setregisterentry but didn’t find out how to use a 
processor for the page number. In the wiki, the (generally working) 
processor option is undocumented, so if there’s another option, it’s 
also missing.
In the source, I found processors for entry & page, but not how to 
address the latter.

MWE:
"""
\defineprocessor[glossar][color=green]
\define[1]\GlIndex{\index[glossar->#1]{\Word{#1}}}

\starttext

\samplefile{ward}
\index{something}
\index{anything}
\page

\samplefile{tufte}
\GlIndex{something}
\GlIndex{anything}

\page
\placeindex
\stoptext

"""

Hraban
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-27 19:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-25 18:33 [NTG-context] index entry with sorting and processor Henning Hraban Ramm
2024-09-27  4:02 ` [NTG-context] " Marcus Vinicius Mesquita
2024-09-27 14:56   ` Bruce Horrocks
2024-09-27 15:09   ` Wolfgang Schuster
2024-09-27 17:55     ` Henning Hraban Ramm
2024-09-27 19:18       ` Marcus Vinicius Mesquita

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).