MakeIndex, Nomenclature, Glossaries and Acronyms ⇒ The contents of a macro in an index
-
- Posts: 4
- Joined: Sat Jul 13, 2024 10:19 am
The contents of a macro 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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
The contents of a macro in an index
welcome to the forum!
When I use a macro within an \index command, it is interpreted and its contents are printed in the index. What are you doing, exactly? Perhaps post a

Stefan
-
- Posts: 4
- Joined: Sat Jul 13, 2024 10:19 am
The contents of a macro in an index
THANKS
-
- Posts: 4
- Joined: Sat Jul 13, 2024 10:19 am
The contents of a macro in an index
\newcommand{\foo}{bar}
\index{\foo}
In my idx file :
\indexentry{\foo}{56}
I would have liked to read \indexentry{bar}{56}
-
- Posts: 4
- Joined: Sat Jul 13, 2024 10:19 am
The contents of a macro in an index
\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