Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\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.

share|improve this question
    
What do you want to achieve? I can't understand your intention. –  Marco Daniel Feb 24 '13 at 16:25
1  
@MarcoDaniel I think that "solution" should link to the "solve" glossary entry. –  lockstep Feb 24 '13 at 16:26
2  
@aiao: It seems you are looking for \glslink{foo}{solution} –  Marco Daniel Feb 24 '13 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 '13 at 0:10
    
@Sensei I think what you mean is a custom glossary style. Here, I think should help. –  aiao Apr 6 '13 at 8:34
show 4 more comments

1 Answer

up vote 3 down vote accepted

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}
share|improve this answer
    
I think glslink is the correct answer. Your solution doesn't allow an alternative text. –  Marco Daniel Feb 24 '13 at 16:45
2  
@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 '13 at 16:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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