3

I made this simple code to try to print a glossary, but it doesn't works. The strange things is that the code is just like the one on the Overleaf website:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[margin=1in,letterpaper]{geometry}
\usepackage{cite} 
\usepackage[final]{hyperref}

\usepackage[acronym, toc]{glossaries}
\makeglossaries
\input{glossario.tex}

\begin{document}

\section{Glossario}
\parindent=0em

\printglossary

\end{document}

And this is my glossario.tex file:

    \newglossaryentry{latex}
{
    name=latex,
    description={Is a mark up language specially suited for scientific documents}
}

\newglossaryentry{maths}
{
    name=mathematics,
    description={Mathematics is what mathematicians do}
}

\newglossaryentry{formula}
{
    name=formula,
    description={A mathematical expression}
}

\newacronym{gcd}{GCD}{Greatest Common Divisor}

\newacronym{lcm}{LCM}{Least Common Multiple}
2
  • 4
    Only the items that are used in the document are shown. If you don't use any items then nothing is shown. If you add, for example, \gls{gcd} after \begin{document} it should work. Maybe you need to clear the cache in Overleaf (there should be a button somewhere) to make it work.
    – Marijn
    Commented Mar 25, 2019 at 18:01
  • 1
    The following link describes how to clear the cache on Overleaf: overleaf.com/learn/how-to/Clearing_the_cache
    – Skillmon
    Commented Mar 25, 2019 at 19:24

2 Answers 2

3
  • Do not place your main tex file in a folder. Make sure your project is on root directory.
  • Clear the cache like mentioned by @craymichael
  • Use your Glossary or Acronym at least on time: \gls{latex}, \acrshort{gcd}, \acrlong{gcd}, etc.
1
  • "main tex file not in a folder" did it for me. This took me 2 days
    – xXx
    Commented Apr 19, 2023 at 7:48
2

To resolve this issue, in general, assuming a clean compile, add \glsaddall before \printglossary. This adds all glossary entries and all should be printed.

If this does not resolve the issue in Overleaf, try clearing the cache by clicking the Logs and output files button next to Recompile and then click the trash can. See instructions here.

You must log in to answer this question.

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