I have created a custom fancyvrb command via \CustomVerbatimCommand{\afun}{Verb}{}
to use for writing programming language functions, say \afun|object.method.blah|
, etc.
I would like to automatically build an index of all mentions of function names.
I know I could try to do that with ordinary LaTeX commands, e.g. with something like:
\newcommand{\afun}[1]{\texttt{#1}\index{#1@\texttt{#1}}}
That will create an index entry with a function name.
Is there any way to achieve that, but with custom verbatim commands of fancyvrb?