1

I'm using a rather complex template of our university and I'd like to use and print the glossary as well.

Now I've created an extra file to manage the glossary entries (tex/0_1_glossary.tex) and to test it I just used one of the two sample entries.

Glossary related settings I have in my document:

\usepackage[toc,xindy]{glossaries}
\makeglossaries
\loadglsentries{tex/0_1_glossary.tex}

\begin{document}

\input{tex/0_1_glossary.tex}
\input{tex/1_introduction}

\setglossarystyle{long}
\printglossaries
\addcontentsline{toc}{chapter}{Glossary}

\end{document}

The tex/0_1_glossary.tex

\newglossaryentry{sample}
{
    name={sample},
    description={This is the description for the sample entry in the glossary.}
}

\newglossaryentry{unused}
{
    name={unused},
    description={This is the description for the unused sample entry in the glossary.}
}

In the tex/1_introduction:

Here's a \gls{sample} glossary entry.

The glossary is mentioned in the Contents but nothing is printed. How do I print the glossary just before the Contents?

If relevant I'm using Texmaker 4.3.

edit:

I've tried to follow this answer and feel like I should be doing everything right. The glossary is listed in the table of contents but my sample description and a link to where it's used is never printed in the pdf.

apoc
  • 273
  • Quite similar to the bibliography, you have to run a helper program, in this case makeglossaries <basenameWithoutFileEnding>. You could run the further underlying program (xindy) yourself, but i can never remember the syntax. – Johannes_B Mar 03 '15 at 15:42
  • You are printing the entry in the toc by hand (btw, the entry will have the last page of the glosary), it has nothing to do with the creation of the glossary. – Johannes_B Mar 03 '15 at 15:43

1 Answers1

2

Sometimes a comment is just not enough.

General advice: Start with a simpified version. Test it, does it work? Nice. Implement it in the template of your university..

Save the following example under the name apocGlossariesTestFile.tex

\documentclass{article} 
\usepackage[toc,xindy]{glossaries}
\makeglossaries
\newglossaryentry{sample}
{
    name={sample},
    description={This is the description for the
    sample entry in the glossary.}
}

\newglossaryentry{unused}
{
    name={unused},
    description={This is the description for
        the unused sample entry in the
    glossary.}
}

\setglossarystyle{long}
\begin{document}
\tableofcontents

\rule{.6\textwidth}{.4pt}\par
Here's a \gls{sample} glossary entry.
\printglossaries

\end{document}

Now run latexmk apocGlossariesTestFile
makeglossaries apocGlossariesTestFile
and latexmk -pdf apocGlossariesTestFile.

Johannes_B
  • 24,235
  • 10
  • 93
  • 248