Bug Tracker RSS feed

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

Return to Search Results

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

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account. All guest comments have to be manually checked before they appear on the page. There are too many bots trying to spam the site to allow unauthenticated users to post without verification.

Comment:


You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

Ordered list:
[ol]
[li]first item[/li]
[li]second item[/li]
[/ol]

Unordered list:
[ul]
[li]first item[/li]
[li]second item[/li]
[/ul]

You can use the Preview button to review your message formatting before submitting.

Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=311

Return to Search Results