I know, there are similar questions around, but I couldn't find a solution to what I want. E.g. here, all acronyms in the document are set to the index. I think, indexing should be done manually so that every index reference shows just 1 or 2 pages in the document. If the work of a glossary is done, I think this list should also appear in the index. This way, using the index will guide the lector at least to the short glossary explanation.

In detail: I am using imakeidx and glossaries. When I write \gls{} somewhere to set an entry in the main glossary, I don't want an index link to this place, but to the page where the glossary entry is written. Therefore the command \newglossaryentry{glo:AD}{name=Active Directory, description={Active Directory is an...}} should somehow automatically contain an \index{name} resp. \index{Active Directory}.

When I think, the appearance in the text is important enough, I will add manually \gls{glo:AD}\index{Active Directory} and obtain an index entry with two referenced page numbers.

2 Answers 2


Quick solution

Here is a shorter solution, it struggles with the issue that it writes the first occurence text to the glossary.


It redefines the first display of the term to include a call to index using the \defglsdisplayfirst command and restricts this change to the acronym glossary. Right now the issue with this is that #1 is already defined to long term (acronym), but for normal glossary entries it should be just fine.

A workarround might be to redefine the new acronym command to set the description differently. But in the long run it would be nice to simply have access to the label in the \defglsdisplay(first) command to access the other keys as needed. I wrote a feature request to nicola.

From Nicloas response to the feature request: If one uses \glslabel one can access all the other information. Thus for acronyms use \index{\glsWhatKeyDoYouWantForTheIndex{\glslabel}} instead.

Primitive solution

I had a similar problem and deduce the awnser from that. I redefine the glossary command to call index as some of the awnsers in the related questions suggest, however the call to ìndex`is only made when its the first use.

 \newacronym{gpu}{GPU}{graphics processing unit}    
    \ifglsused{#1}{ %
  First use \gls{gpu}-computing\\
  subsequent \gls{gpu}-computing and \gls{gpu}


I only covered the \gls-command, and did not check for the glossary the entries are in, this could cause trouble if you have multipleglossaries.

Indexing the entries inside printglossary

By using a custom style for printglossary one can add the index commands.

 \newglossaryentry{gpu}{name=graphics processing unit, description={bla blup}}    

% \defglsdisplayfirst[acronym]{#1#4\index{#1}}
       ##3\glspostdescription\space ##5}%
    \glstarget{##2}{\strut}##4\glspostdescription\space ##6.}%
  First use \gls{gpu}-computing
    \printglossary[type=main, style=myList]

Simply go to your texmf tree, take a look at the style you want to use, and copy its definitions of \glossaryentryfield and \glossarysubentryfield out. create your own style be writing (place the index call at a reasonable point, otherwise you could use patch \appendto):

  • I think @LaRiFaRi wants index items to point to the entry in the glossary and not to the entry in the document... Aug 11, 2013 at 8:57
  • @karlkoeller: i will wait for LaRiFaRi to respond to this. But that is not so hard either. He has to define his own glossary-style (simply copy inherit an existing one and overwrite the display witht the display wiht an additional \index). If you need an example let me know.
    – ted
    Aug 11, 2013 at 9:05
  • Hello, thank you @ted but @karlkoeller is right. I want to index the glossary entrys. Even if appearing in multiple glossaries. I think something like \newglossaryentry{#1}{name=#2, description={#3\index{#2}}} would work. I would be glad to see an example on this.
    – LaRiFaRi
    Aug 11, 2013 at 9:42
  • 1
    @LaRiFaRi: Take a look at the last solution. It should do as you asked. It does not take your approach but I think in the end it does not matter to mcuh where you redefine, the \newglossaryentry or the style.
    – ted
    Aug 11, 2013 at 10:28
  • 1
    @LaRiFaRi: thanks for the brace fix, I edited in the new part
    – ted
    Aug 11, 2013 at 10:58

Ok, after struggling with this myself I came up with the following short solution. It does require minimum hacking but requires you to use \mygls{ABBRV} when you want the index generated.

\providecommand{\myglsindextext}[1]{\glsentrydesc{#1} (\glsentrytext{#1})}



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .