# Automatically assigning abbreviations to an index in ConTeXt

I'm using ConTeXt to provide layout for my thesis across many files comprising the project.

I would like to automatically generate an index based on keywords and abbreviations with minimal hinting by me. I suspect the

\setupsynonyms[abbreviation][command=\index]

command has the ability to add abbreviations to the index automatically, but I haven't found an invocation that actually works.

Is there a command for ConTeXt that provides either level of automatic index generation?

-

Slightly tricky. You need to use synonymcommand to set up the command that is used when the short form of the synonym is called. You also need to expand the argument of synoyncommand. Here is an example

\setupsynonyms[abbreviation][synonymcommand=\indexedentry]

\def\indexedentry#1{#1\expanded{\index{#1}}}

\abbreviation {AMS} {American Mathematics Association}

\starttext
\AMS\ is an abbreviation for \infull{AMS}

\subject {Index}
\placeindex[criterium=all]
\stoptext

-
I ran your code in ConTeXt and unfortunately the AMS reference did not show up in the index. (Tested both in my main document and by copy/pasting your code directly into a clean one.) (this is my first "oops" comment here, how do I make this comment more useful? I'm running the latest minimals as of yesterday.) – Brian Ballsun-Stanton May 13 '11 at 12:24
@Brian: I tested with a week old MkiV. I'll test again with the latest beta – Aditya May 13 '11 at 13:54
To be fair, I've gotten an odd color error that suggests that I'm not doing things right. I'll reverify my setup tomorrow. – Brian Ballsun-Stanton May 13 '11 at 14:23
@Brian: Are you using MkII or MkIV? If you want help with debugging when something goes wrong, it is better to ask the question on the context mailing list. – Aditya May 14 '11 at 0:49
I think I'm using MkIV but I've got a suspicion that MkII snuck in there. – Brian Ballsun-Stanton May 14 '11 at 0:51