Hi,

in the example below I’m using a custom highlighting macro in titles.

Now I don’t want this highlighting in the ToC or in bookmarks (in my real world 
example the changes affect bookmarks, not in the MWE).

I know I can use the list= and bookmark= keys of \startchapter, but since the 
text is always the same for all, I’d like to check within the \SPECIAL macro if 
we’re within the chapter title or within a list or bookmarks.

In preparing the MWE and this message I found a solution with the *chapter 
system mode.

Wanted to share anyway ;)

Hraban


\define[1]\SPECIAL{\doifmodeelse{*chapter}{{\bf #1}}{#1}}

\setupinteraction[state=start]
\placebookmarks[chapter,title]


\starttext

\startchapter[title={This \SPECIAL{and} That}]

\input knuth

\stopchapter


\startchapter[title={Something \SPECIAL{Other}}]

\input tufte

\stopchapter

\completecontent[criterium=all]

\stoptext

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to