On Saturday 06 April 2002 01:08, Daniel Pittman wrote:
> As part of the cookbook that I am working on, I have a fair bit of
> information available as part of the typesetting process that I
> would like to use to create automatic index (register)[1] entries.
>
> So, given that I have these various bits of information available,
> I would like to write information to the index automatically,
> placing items for the dish in an alphabetical index, indexing by
> some major ingredients or ingredient types and the like.
>
> I tried \index{\Category+\RecipeTitle}, which didn't work -- the
> indexing blew up because '\RecipeTitle' and '\Category' were
> unknown control sequences.
>
> Looking through 'core-reg.tex' didn't shed much light on it -- the
> few things that looked like they might work were, unfortunately,
> prone to exactly the same failure cases.
>
> The only way I could find that actually worked was, in a minimal
> example:
>
> \def\MyTitle{Mango Bread} \def\MyCategory{Bread}
> \edef\LocalDoIndex{\noexpand\index{\MyCategory+\MyTitle}}
> \LocalDoIndex
>
The eplain.tex indexing macros + makeindex work well enough for
me to make money as an indexer :-) It may be possible to extract
them from plain.tex and input them into a Context run. (The entire
eplain.tex file has at least one incompatablity with Context, hence
I suggest a subset of it.)
> I can obviously pretty that up a little by wrapping it into a
> 'ExpandedIndex' macro or such that will do the expansion, etc, and
> write the final index note.
>
> Is there a better way of achieving this result, though?
>
>
> Finally, as a note on improving the documentation of ConTeXt, it
> would be extremely helpful to include an entry in the manual index
> that would direct people to 'registers' when they looked for
> 'index'. That would have saved me some headache when I first went
> looking for them. :)
>
> Daniel
>
> Footnotes:
> [1] I use the English "index" name, not the (to me, at least) next
> to unknown "register" naming that the ConTeXt manual uses.
In your case, instead of using e.g., \Category perhaps the indexing
could be wrapped up in a macro that put the value of \Category in the
indexing command. Can you use something like \the\Category?
Yes, an index is an index and a register is something that holds a
number, in my English at least. Perhaps Hans Hagen will accomodate
your request in the next update of his amazing manual. It is, after
all, much more readable even in translation than ``The TeXBook'' :-)
--
John Culleton, [EMAIL PROTECTED]
Able Indexers and Typesetters
http://wexfordpress.com
<------------------------------------>
This Linux system at 9:13am up 24 days 22 hrs 27 mins