Bug Tracker 
ID | 311🔗 |
---|---|
Date: | 2025-10-10 12:11:35 |
Last update: | 2025-10-10 12:50:31 |
Status | Open Sign in if you want to bump this report. |
Category | glossaries |
Version | 4.57 |
Summary | False positive "no \printglossaries" warning |
Sign in to subscribe to notifications about this report.
Description
Using the trick described in [TeX.SX Link] causes glossaries wrongfully think there is no\printglossaries
. MWE:
\documentclass{article} \usepackage{glossaries} \makeglossaries \newglossaryentry{sample}{name={sample},description= {an example}} \AtEndDocument{\printglossaries} \begin{document} \gls{sample}, \gls[format=textbf]{sample}. \end{document}Warning message:
demo.tex: warning: : No \printglossary or \printglossaries found. (Remove \makeglossaries if you don't want any glossaries.) This document will not have a glossary.
MWE
Download (240B)
\documentclass{article} \usepackage{glossaries} \makeglossaries \newglossaryentry{sample}{name={sample},description= {an example}} \AtEndDocument{\printglossaries} \begin{document} \gls{sample}, \gls[format=textbf]{sample}. \end{document}
Evaluation
Adding \ShowHook{enddocument}
before \begin{document}
produces the following in the transcript:
-> The hook 'enddocument': > Code chunks: > glossaries -> \@gls@doautomake \ifdef \@gls@deffile {\closeout \@gls@deff ile }{}\warn@nomakeglossaries \warn@noprintglossary \glswritefiles > glossary-hypernav -> \gls@hypergrouprerun > Document-level (top-level) code (executed last): > -> \printglossaries > Extra code for next invocation: > --- > Rules: > --- > Execution order: > glossaries, glossary-hypernav.Because
\printglossaries
is identified as a document-level command, it's executed last, which means that it's always executed after the code that checks if it has been used. This happens regardless of when you add \printglossaries
to the hook (for example, even if you add it before the glossaries package is loaded).
I think that in this case you will have to just suppress the warning with the nowarn
package option.
Comments
0 comments.
Add Comment
Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=311