I'm trying to extend the indexing of newfangle literate code chunks.

I'm: \usepackage{index}

so that I can have multiple indexes; but the \index{} command seems to
literally interpret the first parameter, so that
\index{\chunkname}
indexes "\chunkname" instead of the name.

I've tried all kinds of use of \expandafter and other tricks with
secondary macros, like this:

\def\ch...@index#1{%
  \...@index[chunks]{#1}%
}%
\def\Chunk#1{%
  \lstset{title={\newfanglecaption},name=#1}%
  \global\edef\...@chunkname{\lst@intname}%
  \expandafter\ch...@index{\lst@chunkname}%
}%

But even then I get the literal text "\...@chunkname" as the indexed item.

The only thing that "nearly" works is if I pass #1 within \Chunk, but
then I get other text too, which I want to chop off.

Any clues on how to make the index package take an expression?

Sam

Reply via email to