13

I am having an issue with glossaries producing the warning when used with the memoir class

Package glossaries Warning: overriding `theglossary' environment on input line 4761.

A minimum working example is:

\documentclass{memoir}
\let\printglossary\relax
\usepackage{glossaries}
\makeglossaries
\begin{document}
Hello World
\printglossary
\end{document}

The \let\printglossary\relax covers the warning Package glossaries Warning: Overriding \printglossary on input line 4536, however this approach will not work for the theglossary warning. I realise that this warning is not an error and could just be ignored but I would rather prefer to work out a way of suppressing it. Thanks

1
  • \let\theglossary\relax might do
    – egreg
    Mar 3, 2014 at 17:43

3 Answers 3

12

With the same style as for \printglossary, you can use

\documentclass{memoir}

\let\printglossary\relax
\let\theglossary\relax
\let\endtheglossary\relax

\usepackage{glossaries}
\makeglossaries
\begin{document}
Hello World
\printglossary
\end{document}

I wouldn't silence off all warnings by glossaries. With silence you can override the relevant messages by

\documentclass{memoir}

\usepackage{silence}
\WarningFilter{glossaries}{Overriding \printglossary}
\WarningFilter{glossaries}{Overriding `theglossary'}

\usepackage{glossaries}
\makeglossaries
\begin{document}
Hello World
\printglossary
\end{document}
3
  • thanks I had tried \let\theglossary\relax but had not realised the need for the \let\endtheglossary\relax line too
    – Tom Brien
    Mar 3, 2014 at 18:10
  • The second warningFilter requires a capital O for the 'overriding' to correctly suppress the warning. I.e. it should read `` \WarningFilter{glossaries}{overriding `theglossary'}``
    – Beavis
    Apr 16, 2022 at 13:21
  • 1
    @Beavis Indeed it changed! Thanks.
    – egreg
    Apr 16, 2022 at 13:21
16

Update to glossaries version 4.04 and use the noredefwarn package option:

\documentclass{memoir}

\usepackage[noredefwarn]{glossaries}

\makeglossaries

\begin{document}

Hello World

\printglossary

\end{document}

glossaries also has a nowarn option that suppresses warnings, but if something unexpected happens it's best to switch the warnings back on.

Edit: glossaries-extra enables this option by default:

\documentclass{memoir}

\usepackage{glossaries-extra}

\makeglossaries

\begin{document}

Hello World

\printglossary

\end{document}
8

You can use the package silence.

Issue \WarningsOff* before loading glossaries and \WarningsOn after it.

MWE:

\documentclass{memoir}
\usepackage{silence}
\WarningsOff*
\usepackage{glossaries}
\WarningsOn
\makeglossaries
\begin{document}
Hello World
\printglossary
\end{document} 

In this way those warnings are gone and all the rest of them in the document are still there.

You must log in to answer this question.

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