# glossaries: including an entry without page location

In the glossaries package, \glssee{label}{aaa,bbb,ccc,ddd} will cross-reference entries, but it doesn't include the referenced entry if it is not otherwise included in the glossary. (e.g. there will be missing links).

The package provides the \glsadd command to include a glossary entry without generating a link or other text on the page, so one could add the missing entries like so

\glsadd{entry1}\glsadd{entry2}\glsadd{entry3}
\printglossaries


But this will add the page number to the numberlist (the page before the glossary). I suppose \glsadd was primarily meant for referencing page ranges with its optional argument.

There is the nonumberlist package option, but is it really necessary to drop an entire feature just to do away with a few irrelevant page numbers?

For example, can \glsadd be redefined in a way that doesn't add the page number to the numberlist?

(It's very predictable, so if one knows that page 192 is not necessary, one could manually remove the extra \setentrycounter[]{page}\glsnumberformat{192}\delimN strings from the .gls file when adding the final polish to the document, but I wonder if that hack can be avoided.)

-
If you have multiple lists nomenclature, glossaries, acronyms etc and you want to have page numbers removed for some of them, just modify the style of the list or create a new one that doesn't uses the page variable –  Martin H Apr 18 '11 at 13:24

Define a new command \gslgobblenumber that will gobble its argument, and redefine \glsadd so that it will write \glsgobblenumber instead of \glsnumberformat into the .glo file.

\documentclass{article}

\usepackage{glossaries}
\makeglossaries

\makeatletter

\newcommand*{\glsgobblenumber}[1]{}
% \renewcommand*{\glsgobblenumber}[1]{#1}% uncomment for testing

\glsdoifexists{#2}%
{%
%     \def\@glsnumberformat{glsnumberformat}% DELETED
\def\@glsnumberformat{glsgobblenumber}% NEW
\edef\@gls@counter{\csname glo@#2@counter\endcsname}%
\@gls@saveentrycounter
\@do@wrglossary{#2}%
}%
}
\makeatother

\newglossaryentry{oesophagus}{name=\oe sophagus,
description={canal from mouth to stomach}}
\newglossaryentry{electrolyte}{name=electrolyte,
description={solution able to conduct electric current}}

\begin{document}

\printglossaries

\end{document}

-

An alternative solution is to specify the nonumberlist option for the glossary entries that are only cross-referenced:

\documentclass{article}

\usepackage{glossaries}

\makeglossaries

\newglossaryentry{first}{name={First}, description={First Term}, nonumberlist}

\newglossaryentry{second}{name={Second}, description={Second Term}, see=first}

\begin{document}

\noindent
\gls{second}

\printglossary

\end{document}


The output is:

-