* [NTG-context] index entry with sorting and processor
@ 2024-08-25 18:33 Henning Hraban Ramm
0 siblings, 0 replies; only message 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] only message in thread
only message in thread, other threads:[~2024-08-25 18:35 UTC | newest]
Thread overview: (only message) (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
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).