glossaries alternative text

\documentclass{article}

\usepackage{hyperref}

\usepackage{glossaries}

\makeglossary
\begin{document}

You can \gls{solve} an equation if a
solution          % HERE
exists

\printglossaries

\end{document}


I need to link "solution" to \gls{solve} despite different spelling.

I assumed \gls[<alternate text>]{<label>} exist but it does not.

• What do you want to achieve? I can't understand your intention. Feb 24, 2013 at 16:25
• @MarcoDaniel I think that "solution" should link to the "solve" glossary entry. Feb 24, 2013 at 16:26
• @aiao: It seems you are looking for \glslink{foo}{solution} Feb 24, 2013 at 16:38
• I know this is not popular to do follow ups in the same question but how do I expand this? How can I define a new command (like \gls but for instance \glscustom) but it displays a custom combination of the attributes in the glossaryentry - without breaking the functionality of the original commands? e.g. Output looks like: <Name> <user1> <description>. Apr 6, 2013 at 0:10
• @Sensei I think what you mean is a custom glossary style. Here, I think should help.
– aiao
Apr 6, 2013 at 8:34

You could either use \glslink{solve}{solution} as pointed out by Marco Daniel or, if there are several instances of "solution" in your document, define a \glsnoun macro which points to \glsuseri and add user1={solution} to the glossary entry's definition -- see section 4.1 of the manual for details.

\documentclass{article}

\usepackage{hyperref}

\usepackage{glossaries}
\makeglossary

\let\glsnoun\glsuseri

\begin{document}

You can \gls{solve} an equation if a \glsnoun{solve} exists.

\printglossaries

\end{document}

• I think glslink is the correct answer. Your solution doesn't allow an alternative text. Feb 24, 2013 at 16:45
• @MarcoDaniel My solution seems the proper approch for "fixed" alternative variants which occur several times. Also note that up to six user-defined variants can be provided. Feb 24, 2013 at 16:50
• More than 6 now... I think...
– cfr
Apr 25, 2015 at 3:56