On Fri, 23 Mar 2012 21:57:04 +1100
Malte Stien <[email protected]> wrote:

> Hi all,
> 
> Is it possible to format indexed words in a particular style within
> the text more or less automatically. For example, if I write
> 
>   There are some \index[ducks] in the zoo.
> 
> ...I would like the term "ducks" to appear in small-capitals to
> indicate the that term can be found in the index. Ideally, I'd like
> to do that without explicit manual formatting. Is that possible?
> 
> Thank you,
> Malte.

Your example above would not print the word "ducks" at all.


I commonly use:
\def\Index#1{\index{#1}#1}

There are some \Index{ducks} in the zoo.


In ConTeXt, text to be typeset typically appears within {}.
Of course, you can then modify the definition to format the text as you
wish:
\def\Index#1{\index{#1}\sc #1}

I'm sure that there is a more clever way.

Note that the \index{} command appears *before* the word, not after.
Otherwise, the word might get placed at the end of a page and the index
point to the following page. I believe that the \index{} command takes
care to avoid the opposite case.

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

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to