Exclude entry from glossary?

I am using the LaTeX glossary package. I have it \gls{foo}

in my document, but I do not want an entry for "foo" to appear in the glossary. How can I keep the worker (ie, expanding) \gls{foo}

in the body of my document, but exclude the entry for "foo" from the glossary?

EDIT: I want to use \gls{foo}

to mean "as used here," foo "has its own specific meaning in this document." In some cases, however, I ended up with "foo" whose definition is too obvious or difficult to articulate in the glossary.

So, I want to \gls{foo}

expand as usual, but I don't want the "foo" entry to appear in the glossary.

Hopefully this adds a little more information on what I am trying to accomplish. It can be an overuse of glossaries, but it's helpful for me to make sure I always use the same words and correct words when writing technical documents.

+2


a source to share


3 answers


If you are using a package glossaries

you can create an "ignored" glossary like



\documentclass{article}

\usepackage{glossaries}
\newglossary[glignoredl]{ignored}{glignored}{glignoredin}{Ignored Glossary}
\makeglossaries

\newglossaryentry{foofoo}{name={FOOFOO},description={foofoo stuff}}
\newglossaryentry{foo}{name={FOO},type={ignored},description={no good description}}
\newglossaryentry{bar}{name={BAR},description={bar of stuff}}

\begin{document}

Here is a \gls{foo} that is also a \gls{bar}, but of course it also a \gls{foofoo}.
Why not consider buying a \gls{foo}?

\printglossary
% \printglossary[type={ignored}]

\end{document}

      

+2


a source


I have no idea why you want to do this, but the following should work:



\let\oldgls\gls% store the original meaning of \gls in a new command named \oldgls
\let\gls\relax$ make \gls do nothing
Some text with \gls{foo} no links to the glossary, 
and no ``foo'' entry in the glossary.
\let\gls\oldgls% restore the original meaning of \gls
Some more text with \gls{bar} that links to the glossary,
and with a ``bar'' entry in the glossary.

      

+2


a source


This can be done by adding terms to a special dictionary common

. This is actually a built-in feature of the package glossaries

, and even pointed to by the package author . From the example given:

\documentclass{article}

\usepackage{glossaries}
\newignoredglossary{common}
\makeglossaries

\newglossaryentry{sample}{name={sample},description={an example}}
\newglossaryentry{commonex}{type=common,name={common term}}

\begin{document}
\gls{sample}. \gls{commonex}.
\printglossaries
\end{document}

      

Pay attention to the use of the command \newignoredglossary

.

0


a source







All Articles