Any idea why my glossaries are not showing?
%--- Long usepackage list, it got included to check for possible conflicts ----
\documentclass[11pt,a4paper,oneside,openright]{report}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage[dvips]{graphicx}
\usepackage{tabularx}
\usepackage{subfigure}
\usepackage{afterpage}
\usepackage{amsmath,amssymb}
\usepackage{rotating}
\usepackage{fancyhdr}
\usepackage[scriptsize]{caption}
\usepackage[toc,section=chapter,acronym,automake]{glossaries}
\usepackage{color}
\usepackage{cancel}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{url}
\usepackage{pdfpages}
\usepackage{makecell}
\usepackage{romannum}
\makeglossaries
\glstoctrue
\loadglsentries{glossario}
\begin{document}
\pagenumbering{arabic}
\tableofcontents
\listoffigures
\listoftables
%---- List of chapters to include ----
\printglossaries
% ---- Bibliography ----
\appendix
% ---- Appendices includes ----
\end{document}
They were showing just fine, I worked on the document for a few days and I must have not realized they weren't showing anymore. The \gls{} and \acr{} are working but no glossary page get printed.
I'm using Texmaker, my settings are:
- Quick compile: PdfLaTeX + Bib(la)tex + PdfLaTeX (x2) + Display Pdf
- Commands: PdfLaTeX: LateX_folder\miktex\bin\pdflatex -synctex=1 -interaction=nonstopmode %.tex
I tried every suggestion I could find, now I'm afraid some package is conflicting with the glossaries.
Best Answer
First check your document build is correct with a simple document:
If the file is called
myDoc.tex
then the document build is:The first LaTeX call doesn't display the glossaries but writes the files needed to generate them.
The
makeglossaries
call uses themakeglossaries
Perl script which runsmakeindex
orxindy
on the appropriate files. In this case it runsmakeindex
twice because there are two glossaries (the defaultmain
glossary, which is always created unlessnomain
is used, and theacronym
glossary, which is created by theacronym
package option).The second LaTeX call reads the files created by
makeindex
which contain the code to typeset the glossaries.The third LaTeX call ensures that the table of contents is up to date.
You have some unnecessary code in your example:
This is automatically implemented by the
toc
package option. The glossaries don't show in the table of contents until the third LaTeX call.This isn't needed as it's the default with any class file that defines
\chapter
(which is the case withreport
).This option tells the
glossaries
package to use TeX's shell escape to runmakeindex
orxindy
. TeX can be run with the shell escape completely disabled (in which caseautomake
won't work), with the shell escape in restricted mode (automake
will only work for trusted applications, so it works formakeindex
but not forxindy
) or with the shell escape fully enabled (a security risk, but allowsautomake
to work withxindy
).If you have a build process that runs
makeglossaries
(ormakeglossaries-lite
, or explicitlymakeindex
/xindy
) then you don't needautomake
.It's best to load
glossaries
last (unless another required package indicates otherwise). It's one of the few exceptions to the general rule thathyperref
should be loaded last. Your example doesn't usehyperref
so it may not be so much of a problem if other packages are loaded afterglossaries
.Unrelated to
glossaries
, but you've informedgraphicx
that you're using the DVI format but you've stated that your build process uses pdfLaTeX. With modern TeX distributions you shouldn't need to tell packages which LaTeX format you're using but, where you do, it should actually match whereas this conflicts.If the above example works fine for you, then your build process is working correctly, which means the problem is somewhere in the document code. The next step is to add the other packages to see if they cause a conflict:
This document compiles fine for me. If it doesn't work for you then add
at the start which will show the version numbers of all the loaded packages at the end of the
.log
file. Compare these with the latest version on CTAN. It's possible that you might have a old version that's causing a problem.If this second example works fine for you, then it's possible there's a problem with one or more of the entry definitions in your
glossario.tex
file. So the next step is to check the transcript files created bymakeindex
. These have the extensions.glg
(for themain
glossary) and.alg
(for theacronym
glossary). Are there any error messages in these files?My example document was called
test.tex
, so the first transcript file istest.glg
and contains:The second transcript file is
test.alg
and contains:The key line in both case is the one that contains
(2 entries accepted, 0 rejected)
. If any entries have been rejected, then you have a problem with yourglossario.tex
file, in which case change the above example document so that the\newglossaryentry
and\newacronym
definitions are replaced with one of the\newglossaryentry
and\newacronym
definitions from yourglossario.tex
file, and replace the corresponding\gls{sample}
and\gls{ex}
.Here are some possible things that might be wrong (but this is just guesswork without knowing what's actually in that file):
\usepackage[utf8]{inputenc}
(but not a problem with XeLaTeX/LuaLaTeX).sort
field (which is obtained fromname
if omitted) contains code that's interfering with the mechanism used to escapemakeindex
's special characters.The first is the most common problem of the two.
If the example document still works with this modification, try each term defined in
glossario.tex
until you find one that fails. If none of them fail, then the problem may lie in the way you are referencing the terms. Since you haven't provided an example of how you're using\gls
(or similar commands), this is again just guesswork. You have to hack down to pinpoint the problem.Possible problems:
\gls
(or similar commands) anywhere in your document. (The transcript file will show0 entries accepted, 0 rejected
.)\gls
(or similar) has been used in some context that's interfering with the indexing.The first is the most commonly encountered cause.