I am using glossaries package with the acronym option \usepackage[acronym,toc,shortcuts]{glossaries}
. When my Index is generated, the acronyms are not listed alphabetically but rather as a "Symbol" entry within the index (image below). I am writing a thesis and have a separate list of Acronyms so this "Symbol" entry in the Index is rather useless for me. Is there a way that the acronyms can be sorted alphabetically in the Index just like the rest of the entries?
MWE:
\documentclass[11pt]{article}
\usepackage{makeidx}
\makeindex
\usepackage[acronym,toc,shortcuts]{glossaries}
\makeglossaries
\newacronym{cd}{CD}{compact disk}
\begin{document}
\noindent
First\index{first} use of \gls{cd}\\
subsequent\index{subsequent} use of \gls{cd}\index{\glsfirst{cd}}
\printglossaries
\printindex
\end{document}
Best Answer
The argument of
\index
doesn't get expanded when written to the.idx
file, somakeindex
is trying to sort\glsfirst{cd}
. Sincemakeindex
doesn't interpret TeX commands, it views this as a string starting with the backslash character, which is why the entry is considered a symbol. Here's a way of automatically indexing subsequent uses of the acronyms that expands the indexed term before writing it to the.idx
file:Assuming I have the
makeindex
headings flag set (viaheadings_flag 1
in a.ist
file) I get the following index:If you only want to index some subsequent entries rather than all of them, here's another approach that saves the index command with expanded argument in the
user1
field:The index now looks like: