2
\documentclass{article}

\usepackage{hyperref}

\usepackage{glossaries}

\newglossaryentry{solve}{name={solve},description={to find an answer}}

\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.

9
  • What do you want to achieve? I can't understand your intention. Feb 24, 2013 at 16:25
  • 1
    @MarcoDaniel I think that "solution" should link to the "solve" glossary entry.
    – lockstep
    Feb 24, 2013 at 16:26
  • 2
    @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>.
    – Sensei
    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

1 Answer 1

6

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

\newglossaryentry{solve}{name={solve},description={to find an answer},user1={solution}}

\begin{document}

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

\printglossaries

\end{document}
3
  • I think glslink is the correct answer. Your solution doesn't allow an alternative text. Feb 24, 2013 at 16:45
  • 3
    @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.
    – lockstep
    Feb 24, 2013 at 16:50
  • More than 6 now... I think...
    – cfr
    Apr 25, 2015 at 3:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.