Steffen Wolfrum wrote:
Hi Hans,
sorry for contacting you off-list. But the publishing-house I am working for at the moment needs to know the answer to my "Index design" question today.
They have a series of books with a given index (register of keywords) designed as described below. This design was set in the past with 3B2, and now is the question: is it also possible to set it (in this strange way) with ConTeXt?
Please see my description below (hope gets it's clear):
Is it possible, in an index, not to have single letters as separators (here "a", "w") in a dedicated line, but instead only the first letter of the first entry with "a" or "w" set bold?
See this minimal example:
\setupoutput[pdftex]
\starttext \chapter{First Chapter} Some text...\index{word}
\section {First Section} Some text...\index{word} Some text...\index{another entry} Some text...\index{ansi} Some text...\index{another entry}
\page[yes] \completeindex
\stoptext
Here I would like to have only the first letter of the index entries "another" and "word" in the index to be set bold.
Y inofficial hook; remind me when the time is there that you need it because it needs to be hooked in somewhere else
\unprotect \def\dosetpageregisterentrya#1#2% {\edef\currententrylevel{1}% \global\let\c!entryb\relax \global\let\c!entryc\relax \gdef\c!entrya {\iffirstregisterentry\else\endgraf\fi % new \global\firstregisterpagetrue \hangindent1em\noindent\c!entryreference \dohandleregisterentry{\executeifdefined {\??id#1\c!deeptextcommand}\firstofoneargument{#2}}% \global\firstregisterentryfalse \global\firstsubentrytrue \global\firstsubsubentrytrue}} \def\HowUgly#1{\doHowUgly#1\relax} \def\doHowUgly#1#2\relax{\iffirstregisterentry{\bf#1}\else#1\fi#2} \setupregister[index][indicator=no,deeptextcommand=\HowUgly] \starttext \chapter{First Chapter} Some text...\index{word} \section {First Section} Some text...\index{word} Some text...\index{another entry} Some text...\index{ansi} Some text...\index{another entry} \page[yes] \completeindex \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------