[Tex/LaTex] How to use glossaries-package without need to print out the Glossary

beamerglossaries

I know that it doesn't make much sense to create a glossary and then not want to use it. I print the glossary in my main document. But now I have a presentation with beamer slides, where I just copy equations from the main document. In the equations, most variables are glossary entries. But it makes no sense for me to print a glossary in my presentation. Then I get all those warnings that an entry has been referenced but does not exist, which is very annoying. Is there any way to get around this?

\documentclass{beamer}
\usepackage{lmodern}
\usepackage{glossaries}

\newglossaryentry{bp}{%type=symbols, In the original there are 2 different types of glossaries
name={\ensuremath{BP}},sort=bp,description={Basispreis einer Option}}
\makeglossaries
\begin{document}

\frame{\gls{bp} has to give the output \ensuremath{BP}.}

%\printglossaries
\end{document}

Best Answer

The warnings are coming from the hyperlinks that are being created to targets that are not created. So put this in the preamble:

\glsdisablehyper

You still get these warnings.

Package glossaries Warning: \makeglossaries hasn't been used,
the glossaries will not be updated.

Package glossaries Warning: No \printglossary or \printglossaries
found. This document will not have a glossary.

So just silence them with this option:

\usepackage[nowarn]{glossaries}

I think that covers it!