2

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}}

The \gls{t} appears on this page.

\newpage

No glossary words on this page.

\glsaddall
\printglossaries

\end{document}

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

Page 1:

Page 1 contains the term

Page 2:

Page 2 contains no terms

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

The glossary has an extra link to Page 2

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

2
  • 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, 2017 at 4:18
  • @cfr Thanks. After leaving out \glsaddall, the extra page references disappeared.
    – Anvita
    Feb 26, 2017 at 10:02

1 Answer 1

4
\glsaddall

Adds also the occurrence in the glossary itselfs One possible change could be

\glsaddallunused

You must log in to answer this question.

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