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
Dear List,
If it is possible, I would also like to know how to use a processor
for the page number in the \setregisterentry command. If not, could it
be implemented?
Regards
Marcus Vinicius
On Sun, Aug 25, 2024 at 3:37 PM Henning Hraban Ramm
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 ___________________________________________________________________________________
-- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik)
On 27 Sep 2024, at 05:02, Marcus Vinicius Mesquita
wrote: If it is possible, I would also like to know how to use a processor for the page number in the \setregisterentry command. If not, could it be implemented?
Not for \setregisterentry, afaik, but there is \dosetfastregisterentry which allows the entry and page number styles to be controlled independently. usage: \dosetfastregisterentry{register}{entry}{key}{entry processor}{page processor} example: \defineregister [MyIndex] [style=tfb, alternative=A, n=1] \defineprocessor [myRed] [color=red] \defineprocessor [myGreen] [color=green] \starttext \placeMyIndex \page Text \dosetfastregisterentry{MyIndex}{plain}{}{}{} text \page Text \dosetfastregisterentry{MyIndex}{plain+green page}{}{}{myGreen} text \page Text \dosetfastregisterentry{MyIndex}{plain+red entry}{}{myRed}{myGreen} text \stoptext Regards, — Bruce Horrocks Hampshire, UK
Marcus Vinicius Mesquita schrieb am 27.09.2024 um 06:02:
Dear List,
If it is possible, I would also like to know how to use a processor for the page number in the \setregisterentry command. If not, could it be implemented?
Try the following example which tries to cover a few of the question asked by Hraban. When you uncomment the first part you notice a few processors are ignored when you use the same entry with and without formatting. %%%% begin example \defineprocessor [henning] [command=\Word] \defineprocessor [hraban] [color=red] \starttext % anything\setregisterentry[index][entries=anything] % % something\setregisterentry[index][entries=something] % % \page Anything\setregisterentry[index][keys=hraban->,entries=henning->anything] Something\setregisterentry[index][keys=hraban->,entries=henning->something] \page \placeindex \stoptext %%%% end example Wolfgang
Am 27.09.24 um 17:09 schrieb Wolfgang Schuster:
Try the following example which tries to cover a few of the question asked by Hraban. When you uncomment the first part you notice a few processors are ignored when you use the same entry with and without formatting.
Thank you, Wolfgang! I still didn’t manage to combine "Anything" and "\Word{anything}", they become separate entries that look the same. """ \defineprocessor [Titling] [command=\Word] \defineprocessor [Red] [color=red] \starttext anything\setregisterentry[index][entries=Anything] something\setregisterentry[index][entries=Something] \page Anything\setregisterentry[index][keys=Red->Anything,entries=Titling->anything] Something\setregisterentry[index][keys=Red->Something,entries=Titling->something] \page \placeindex \stoptext """ Hraban (WRT processors: I still need to process your other answers, bear with me…)
Thank you, Bruce and Wolfgang
I did not know the \dosetfastregisterentry command. And with the
example given by Wolfgang I was able to understand better the
\setregistryentry command.
Regards
Marcus Vinicius
On Fri, Sep 27, 2024 at 2:57 PM Henning Hraban Ramm
Am 27.09.24 um 17:09 schrieb Wolfgang Schuster:
Try the following example which tries to cover a few of the question asked by Hraban. When you uncomment the first part you notice a few processors are ignored when you use the same entry with and without formatting.
Thank you, Wolfgang!
I still didn’t manage to combine "Anything" and "\Word{anything}", they become separate entries that look the same.
""" \defineprocessor [Titling] [command=\Word] \defineprocessor [Red] [color=red]
\starttext
anything\setregisterentry[index][entries=Anything]
something\setregisterentry[index][entries=Something]
\page
Anything\setregisterentry[index][keys=Red->Anything,entries=Titling->anything]
Something\setregisterentry[index][keys=Red->Something,entries=Titling->something]
\page
\placeindex
\stoptext """
Hraban
(WRT processors: I still need to process your other answers, bear with me…)
___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o corpo nem seus membros, por ser descanso da alma, primavera do coração, distração do aflito, entretenimento do solitário, e viático do viajante. Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik)
participants (4)
-
Bruce Horrocks
-
Henning Hraban Ramm
-
Marcus Vinicius Mesquita
-
Wolfgang Schuster