[Tex/LaTex] printglossaries, makeglossaries: (0 entries accepted, 0 rejected)

glossaries

I'm trying to create a glossary for my document but am having trouble getting it to show up.

The last three lines of my document are:

\newpage
\printglossaries
\end{document}

I've also got:

\makeglossaries

before

\begin{document}

I tried running:

makeindex -l -s report.ist -o report.gls report.glo

And also:

makeglossaries report.glo

Both times, the output was:

This is makeindex, version 2.15 [TeX Live 2013] (kpathsea + Thai support).
Scanning style file ./report.ist.............................done (29 attributes redefined, 0 ignored).
Scanning input file report.glo...done (0 entries accepted, 0 rejected).
Nothing written in report.gls.
Transcript written in report.ilg.

I tried following this tutorial. I also looked at the beginners guide, which actually shows \printglossary as the command. I tried both, neither worked. The acronyms I have defined in the document are behaving as expected, I just don't see a glossary at the end of my report documenting them. Can you give me any pointers?

Best Answer

Without a minimal working example (MWE) this is just guesswork, but as you mentioned that you have defined acronyms and they are behaving as expected, I suspect you have used the acronym package option, like this:

\usepackage[acronym]{glossaries}

This creates two glossaries. The default main glossary and the acronym glossary. In this case, any acronyms defined using \newacronym will be assigned to the acronym glossary (unless you explicitly change the glossary type). Any entries defined using \newglossaryentry (without designating a type) will automatically be assigned to the main glossary.

Each glossary has its own associated file used to store information for makeindex (or xindy) to process. The file used for the main glossary has the extension .glo. The file used for the acronym glossary has the extension .acn.

Scanning input file report.glo...done (0 entries accepted, 0 rejected).

This message from makeindex indicates that the .glo file is empty. This means that you haven't referenced any entries in the main glossary. If you have defined and referenced acronyms in your document, then they are in another file, and that's the file that needs to be processed by makeindex. The easiest way to ensure that all files are processed is to use makeglossaries without specifying an extension:

makeglossaries report

You wrote that you tried

makeglossaries report.glo

which tells makeglossaries to only process the .glo file and ignore any other glossary files.

Here's a MWE:

\documentclass{article}

\usepackage[acronym]{glossaries}

\makeglossaries

\newacronym{abc}{ABC}{a contrived acronym}

\begin{document}

\gls{abc}

\printglossaries

\end{document}

If this file is called test.tex, then pdflatex test will create (amongst other files) test.glo (which is empty) and test.acn (which has one line). Now, makeglossaries test will create a file called test.acr and will complain that test.glo is empty. The next time you run pdflatex test, \printglossaries will input test.acr and the list of acronyms will be displayed.

If you don't intend to use the main glossary, then I recommend you suppress its creation using the nomain package option. This will prevent the creation of an unnecessary file and will stop makeglossaries from complaining about the empty .glo file.

Related Question