Search found 4 matches

by finou314159
Mon Jul 15, 2024 7:01 pm
Forum: MakeIndex, Nomenclature, Glossaries and Acronyms
Topic: The contents of a macro in an index
Replies: 4
Views: 31146

The contents of a macro in an index

I found a way to do this :

\newcommand{\foo}[1]
{
\newcommand{\fooo}{\index{#1}}

\fooo
}

\foo{YES}

This way I force the expansion of the command. This allows me to use a variable #1 in my index and retrieve its value in the idx file
by finou314159
Mon Jul 15, 2024 3:06 pm
Forum: MakeIndex, Nomenclature, Glossaries and Acronyms
Topic: The contents of a macro in an index
Replies: 4
Views: 31146

The contents of a macro in an index

An example :

\newcommand{\foo}{bar}

\index{\foo}

In my idx file :

\indexentry{\foo}{56}

I would have liked to read \indexentry{bar}{56}
by finou314159
Mon Jul 15, 2024 3:03 pm
Forum: MakeIndex, Nomenclature, Glossaries and Acronyms
Topic: The contents of a macro in an index
Replies: 4
Views: 31146

The contents of a macro in an index

Yes, this is definitely a misuse on my part. I want to use the idx file to retrieve the page number in a python script. However in the idx file, the macro newcommand \foo is coded \foo and not its content. I understand that it is not possible for the idx file to include the content of my macro ...
by finou314159
Sat Jul 13, 2024 10:25 am
Forum: MakeIndex, Nomenclature, Glossaries and Acronyms
Topic: The contents of a macro in an index
Replies: 4
Views: 31146

The contents of a macro in an index

I need to write the contents of a macro \number in an index.
I use multiple indexes with the index package. When I consult the adx file, \number is not interpreted and remains \number. Is it possible to have the contents of the macro \number in the index rather than its name ?

THANKS

Fabrice