Possible Duplicate:
Automatically index acronyms

I am using glossaries package for acronyms (\usepackage[acronym]{glossaries}). I have a separate .tex file for a list of \newacronym{key}{label}{description} and for a list of \newglossaryentry{key}{name=,description=,type=}. I have used the necessary command for generating index such as \usepackage{makeidx}, \makeindex, \printindex.

I want all the list of acronyms to appear in the index. But i don't want to use the command \index{} in the document every time where i use \acs or \acf or \gls or etc, which also looks ugly full of commands. Can anybody help/suggest me how to generate index automatically every time i use the command of acronyms or glossary in the document without writing the command \index{}?

  • Probably this can inspire you: tex.stackexchange.com/a/62228/10898
    – azetina
    Jul 6 '12 at 14:58
  • Welcome to TeX.SX! Would you please be more specific about what should go in the index? Just the acronym or also its extended form? Each occurrence or just the first?
    – egreg
    Jul 6 '12 at 15:04
  • Lets say, we just put the abbreviation from the acronyms in the index.
    – Shyam
    Jul 6 '12 at 15:11
  • 2
    Related: Automatically index acronyms
    – cgnieder
    Jul 6 '12 at 15:14
  • 2
    @tohecz The linked question is about the acronym package, not glossaries.
    – egreg
    Jul 12 '12 at 14:39

Here's a first attempt:


  \expandafter\expandafter\expandafter\shyam@index@aux\csname glo@#1@index\endcsname\shyam@index

\newacronym[longplural={diagonal matrices}]{dm}{DM}{diagonal matrix}
\newacronym{idn}{IDN}{identification number}










However, more work could be needed in case you use other commands for calling acronyms in the text. Without a minimal example covering the needs it's difficult to say more.

  • I could really use a solution that works for the whole family of \gls macros (e.g. \gls, \glspl, \Gls, Glspl, etc.). Since I'm not a LaTeX guru (yet!), I do not understand your trick between the \makeatletter and \makeatother commands. Does your code work only for acronyms? Would it work for the \gls commands as well? Thanks in advance!
    – jvriesem
    Nov 19 '13 at 7:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.