9

I was given a Latex project as template and I decided to add a glossary on it, however, \printglossary is not working. I can add and use different entries so I guess that the glossary creation is not the problem.

I am using Overleaf and if I try a completely new project with only the glossary (code bellow) \printglossary works fine.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[acronym, toc]{glossaries}

\makeglossaries
\input{Bibliocosas/glossary.tex}

\begin{document}

\tableofcontents

\section{First Section}

The \Gls{latex} typesetting markup language is specially suitable for documents that include \gls{maths}. \Glspl{formula} are rendered properly an easily once one gets used to the commands.


\clearpage

\section{Second Section}

\vspace{5mm}

Given a set of numbers, there are elementary methods to compute its \acrlong{gcd}, which is abbreviated \acrshort{gcd}. This process is similar to that used for the \acrfull{lcm}.


\clearpage

\printglossary

\clearpage

\printglossary[type=\acronymtype]

\end{document}

I am using chapters intead of sections in the given project, is that the the cause of the problem?

anmarlea
  • 370
  • 1
  • 3
  • 11
  • 1
    Can you make a [mre] that does not rely on external files we don't have access to? – samcarter_is_at_topanswers.xyz Apr 02 '21 at 20:28
  • Oh, sorry, I had not noticed that in this example I was including the glossary entries in an external file: I was using the project provided as [example](https://www.overleaf.com/learn/latex/glossaries#Show_the_glossary_in_the_table_of_contents) in Overleaf. At the end of the section you can see "Open an example of the glossaries package in Overleaf", that is the project I was using for testing. Anyway, with `\printnoidxglossaries` seems to be working. – anmarlea Apr 03 '21 at 12:56

3 Answers3

9

Using \makenoidxglossaries and \printnoidxglossaries seems to apparently solve the problem.

I thought that I had already tried them but I guess I was wrong. However, I still don't know why the previous code does not work in the given project.

anmarlea
  • 370
  • 1
  • 3
  • 11
  • 2
    Glad I found this after 2 hours of testing, offline my glossary and acronyms lists compiled, but not in Overleaf. Your answer ensured they did compile in Overleaf! Also, `\printnoidxglossary[type=\acronymtype,title=Acronyms]` and `\printnoidxglossary[title=Glossary]` allowed me to give a separate title to each list. (Instead of making the two lists with one command). – a.t. Oct 02 '21 at 12:01
  • This formulation does not cut it with Tex Live 2022. Assuming you simply replaced the commands recommended by Overleaf by these you mention. – Luís de Sousa Jun 06 '23 at 15:44
7

As for me, I had the same issue but I fixed it by using glossaries-extra package after glossaries package using.

\usepackage[automake]{glossaries-extra}

Then clearing the cache.

SunlayGGX
  • 81
  • 1
  • 2
3

I had this issue with Overleaf. The problem was that I uploaded the project as a zip and Overleaf created an additional nested directory in the root with the name of my project. Everything worked but not glossaries.

To solve this I just moved all files to the root directory by dragging each of it.

mazy
  • 652
  • 1
  • 10
  • 18