[Tex/LaTex] glossaries package is printing all entries under acronyms

glossaries

I am trying to insert a glossary into a latex document using the glossaries package. I would like to separate out the list of acronyms from the list of definitions. My understanding is that this is normally achieved with two calls: i) one to \printglossary[type=\acronymtype] for the acronyms and ii) one to \printglossary for the definitions.

The issue I am running into is that the two aforementioned variations on calls to \printglossary both seem to produce the same thing — a list of all acronyms and all definitions combined. I illustrate below a minimum working example of the problem, in code and in output.

Code:

\documentclass{article}

\usepackage[nomain,xindy,acronym,toc]{glossaries}
\makeglossaries 

\newacronym{abc}{ABC}{Ay Bee See}
\newacronym{def}{DEF}{Dee Eee Eff}
\newacronym{ghi}{GHI}{Gee Hach Eye}

\newglossaryentry{onetwothree} 
{ 
name={One Two Three}, 
description={The quick brown fox jumped over the lazy dog}
}

\begin{document}
Here is some text

\gls{abc}, \gls{def}, \gls{ghi}, \gls{onetwothree}

\printglossary[type=\acronymtype]
\printglossary

\end{document}

Output:

Output

Note I made a call to makeglossaries <filename_without_extension> on the terminal before compiling the example code. What am I doing wrong?

Best Answer

The nomain package option suppresses the creation of the main (default) glossary. This means that there's only one glossary (the acronym glossary) which becomes the new default glossary, so \glsdefaulttype and \acronymtype expand to the same glossary label. Since \printglossary is equivalent to \printglossary[type=\glsdefaulttype] this means that \printglossary and \printglossary[type=\acronymtype] are displaying the same glossary (the acronym glossary).

Since you want two separate glossaries, remove the nomain package option.

Related Question