1

I finally got the glossaries package to 'work'. Not sure if I have incorrect installation or if I'm doing something wrong in the code. I want two types of glossaries, symbols and abbreviations. I get a list generated but it only shows the first value of each typed used.

Only one glossary of each type in the list

\documentclass{IEEEtran}

\usepackage[nomain,acronym,xindy,toc,nopostdot]{glossaries}
\newglossary[slg]       {symbols}       {not}       {ntn}       {Symbols}
\newglossary[alg]       {abbreviations} {abb}       {abr}       {Abbreviations}
\makeglossaries

\newglossaryentry{LA}% label 
{% 
    type=abbreviations,% glossary type 
    name={LA},% 
    description={Los Angeles},% 
    sort={S}% 
}

\newglossaryentry{NY}% label 
{% 
    type=abbreviations,% glossary type 
    name={NY},% 
    description={New York City},% 
    sort={S}% 
}

\newglossaryentry{theta}% label 
{% 
    type=symbols,% glossary type 
    name={$\theta$},% 
    description={The angle of attack},% 
    sort={S}% 
}   
\newglossaryentry{alpha}% label 
{% 
    type=symbols,% glossary type 
    name={$\alpha$},% 
    description={The angle of measurements},% 
    sort={S}% 
}

\begin{document}

\printglossary[type=symbols, title={List of Symbols}]
\printglossary[type=abbreviations, title={List of Abbreviations}]


\section{Section One}

Here are my two abbreviations \gls{LA} and \gls{NY}.\\
Here are my two symbols \gls{alpha} and \gls{theta}.

\end{document}
1
  • 1
    Not using xindy will provide both entries, as well as \makenoidxglossaries and \printnoidxglossaries
    – user31729
    Aug 30, 2016 at 20:24

1 Answer 1

1

You've given all your entries the same sort value (S). This means that xindy can't differentiate between them and combines them. You can see this more clearly if you insert page breaks:

Here are my two abbreviations \gls{LA} and
\clearpage
\gls{NY}.

Here are my two symbols \gls{alpha} and
\clearpage
\gls{theta}.

image of glossaries

The entry for alpha has the locations 2 (corresponding to \gls{alpha}) and 3 (corresponding to \gls{theta}). Similarly the entry for LA has the locations 1 (corresponding to \gls{LA}) and 2 (corresponding to NY).

This is just the way that xindy treats entries with identical sort values, whereas makeindex will keep them separate although it's unable to sort them.

Is there any particular reason why you've used the same sort for all the entries? If you want an unsorted list, you're better off just using \makenoidxglossaries (instead of \makeglossaries) and \printnoidxglossary[sort=def,...] (or sort=use). If you want the entries sorted alphabetically, then just remove the sort key from the abbreviations (since the name provides a natural sort) and provide unique sort values for the symbols. For example:

\documentclass{IEEEtran}

\usepackage[nomain,acronym,xindy,toc,nopostdot]{glossaries}
\newglossary[slg]       {symbols}       {not}       {ntn}       {Symbols}
\newglossary[alg]       {abbreviations} {abb}       {abr}       {Abbreviations}
\makeglossaries

\newglossaryentry{LA}% label 
{% 
    type=abbreviations,% glossary type 
    name={LA},% 
    description={Los Angeles}% 
}

\newglossaryentry{NY}% label 
{% 
    type=abbreviations,% glossary type 
    name={NY},% 
    description={New York City}% 
}

\newglossaryentry{theta}% label 
{% 
    type=symbols,% glossary type 
    name={$\theta$},% 
    description={The angle of attack},% 
    sort={theta}% 
}   
\newglossaryentry{alpha}% label 
{% 
    type=symbols,% glossary type 
    name={$\alpha$},% 
    description={The angle of measurements},% 
    sort={alpha}% 
}

\begin{document}

\printglossary[type=symbols, title={List of Symbols}]
\printglossary[type=abbreviations, title={List of Abbreviations}]


\section{Section One}

Here are my two abbreviations \gls{LA} and \gls{NY}.

Here are my two symbols \gls{alpha} and \gls{theta}.

\end{document}

image of document

Incidentally, the glossaries-extra package provides the command \glsxtrnewsymbol when the symbols package option is used, which sets the sort field to the label instead of the name value. So the above can be changed to:

\documentclass{IEEEtran}

\usepackage[nomain,symbols,abbreviations,xindy]{glossaries-extra}

\makeglossaries

\setabbreviationstyle{short}

\newabbreviation{LA}{LA}{Los Angeles}
\newabbreviation{NY}{NY}{New York City}

\glsxtrnewsymbol[description={The angle of attack}]{theta}{$\theta$}
\glsxtrnewsymbol[description={The angle of measurement}]{alpha}{$\alpha$}

\begin{document}

\printsymbols[title={List of Symbols}]
\printabbreviations[title={List of Abbreviations}]


\section{Section One}

Here are my two abbreviations \gls{LA} and \gls{NY}.

Here are my two symbols \gls{alpha} and \gls{theta}.

\end{document}

which produces the same result.

1
  • Thanks a lot Nicola. The reason I was using 's' as sort is because I saw it used somewhere where I copied the entry-code. Thought it would stand for some Sorting-Method. I will go for the {glossaries-extra}.
    – Bjartmar
    Aug 31, 2016 at 10:44

You must log in to answer this question.

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