# False extra page numbers in the glossary

I do not understand why I am getting an extra page number "2" in the glossary below. The term appears only on Page 1 but not on Page 2. How can I get rid of this false reference?

Here is the MWE

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[xindy]{glossaries}
\makeglossaries

\begin{document}

\newglossaryentry{t}{name={term},
description={description of the term}}

\newpage

\printglossaries

\end{document}


I compiled the code with pdflatex + makeglossaries + pdflatex The output looks like this

Page 1:

Page 2:

Page 3: ( Note the false reference to Page 2 )

Also note that the indexonlyfirst option of the glossaries package is neither relevant to this problem nor solves it.

• Welcome! Define your glossary entries before \begin{document}. Also, \glsaddall adds all glossary entries. Hence, those entries are added on that page, despite the claim there asserting otherwise. – cfr Feb 25 '17 at 4:18
• @cfr Thanks. After leaving out \glsaddall, the extra page references disappeared. – Anvita Feb 26 '17 at 10:02

\glsaddall

\glsaddallunused