1

Background

In ConTeXt, you can use

\defineregister [first]
\setupregister[first]
  [indicator=no,
  expansion=no]
\defineregister [second]
\setupregister[second]
 [indicator=no]
\defineregister [third]
\setupregister[third]
  [indicator=no]
\defineprocessor [relevant] [color=blue]


\starttext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  \placefirst  \page \placesecond \page \placethird \page
  Text before.
  Text \first {foo} \first{relevant->bar 1+asdf} \first{baz}text.
  Text after.
\stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

to create an individually styled index entry with a first-level and a second-level entry (example taken from contextgarden wiki with a few modifications). This produces

output #1

Problem

For the design of my index it is necessary that the subentries have a different style than the main entries (in this example they should be blue, in my book the should be slanted while the main entries have a normal font style). So I tried to apply the processor only to the subentry with

\first{bar 1+relevant->asdf}

which led to

output #2

My expected outcome was a blue "asdf" and a black "bar".

Question

Is there a way to apply processors only to subentries in an index or is there another mechanism which yields my expected result?

  • Welcome to TeX.SX – jjdb May 3 '17 at 7:56
  • I'm not quite sure which guidline I have violated. Would you care to explain so that I can improve my post? – meliade May 3 '17 at 9:28
  • Sorry, the Welcome message is thought to be 1. a polite greeting to new users, and 2. a link to a first introduction to new users. As far as I can see, you have not violated any guideline - so don't worry. I just put this post, as it is good practice. Sometimes when this is forgotten weird conversations take place in the comments. So this was just to provide you some guidelines for using this site. Sorry for confusing you. – jjdb May 3 '17 at 9:38
  • Ah, thank you. I didn't know that. So thank you. :) – meliade May 4 '17 at 6:50
1

Unfortunately, there is no way to access the register typesetting on the macro level because it is implemented in Lua. A simple workaround exists though. You simple declare the parent right next to the child an leave the rest of the syntax as-is.

\defineregister[first]

\setupregister
  [first]
  [
    indicator=no,
    expansion=no,
  ]

\defineprocessor
  [relevant]
  [color=blue]

\starttext
\placefirst

Text with labels\first{bar 1}\first{relevant->bar 1+asdf}
\stoptext

enter image description here

  • That's a good idea, but unfortunately it results in printing a page reference after the first level entry - which would be a mistake in the case of my index. I tried to correct that with another processor, but I have no idea how to hide the pagenumber, only how to style it. Do you have any suggestions by chance? – meliade May 4 '17 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.