[Tex/LaTex] How to create multiple glossary entries for the same definition

glossaries

When I have many glossary words that describe the same, how do I neatly put these into the glossary?
Ideally, something like:

\newglossaryentry{digest, hash, hash code} {
name=digest, description={The output of a hash function).}
}

producing

   digest, hash or hash code The output of a hash function.

is what I'm looking for, and I can't seem to find this anywhere.

Best Answer

I'd define one entry (say, digest) in the usual way and then use \gls{digest} in the description field of the alternative entries. See section 8 of the glossaries manual for details.

\documentclass{article}

\usepackage[nonumberlist]{glossaries}
\makeglossaries

\newglossaryentry{digest}{name={digest (\textmd{also} hash, hash code)},%
    text=digest,description={The output of a hash function}}

\newglossaryentry{hash}
    {name=hash,description={\emph{See} \gls{digest}}}

\newglossaryentry{hash code}
    {name={hash code},description={\emph{See} \gls{digest}}}

\begin{document}

\null\vfill% just for the example

Some text about \gls{digest}.

Some text about \gls{hash}.

Some text about \gls{hash code}.

\printglossaries

\end{document}

enter image description here

Related Question