# Change glossary entry to show (name) (see ___ , if exists) (description)

I would like to alter the glossary style to be able to show each entry as: (name) (see _, if exists) (description) (page#)

\documentclass{article}
\usepackage{datatool}
\usepackage{glossaries}
\makeglossaries
\makeindex

\newglossaryentry{random variable}
{
name={random variable},
description={a variable which can take on multiple values}
}
\newglossaryentry{sample space}
{
name={sample space},
description={a set of values that a random variable
can take},
see={random variable}
}

\begin{document}
Something about \gls{random variable} and \gls{sample space}
\printglossary
\end{document}


The output is then:

I'd really like to have the "see random variable" before the description.

-
Welcome to TeX.sx! It would be useful if you augmented your question by a Minimal Working Example (a minimal but complete running document) showing what packages etc. as well as the issue about which you are asking – Peter Jansson Jan 19 '13 at 21:34
Not sure about your intent, but might it not serve to simply nest \gls{random variable} within sample space's definition (if possible)? Indeed, a simple parenthetical list preceding your definition answers the mail - description = {(\gls*{random variable}, \gls*{sample}) a set of values that a \gls*{random variable} can take}, and appears to obviate the whole "See" thing. Again...if possible. – commonhare Jan 20 '13 at 4:20
Actually @commonhare, the downside to your suggestion is that I get page numbers for the cross-references, which is something I don't want to have. I simply want page numbers to refer to where the \gls call was used in the main text. The one way I can accomplish this is to abandon using \gls altogether for cross-references, simply doing "see \textit{random variable}" in the description. Feels kind of hacky though, so I was wondering if there'd be a better option. Thanks! – east Jan 20 '13 at 13:17
I erroneously supposed \gls* suppressed citing as well as linking. Just imagine: the package authors thought of all this! Anyway, somewhere within the package is the code that orders the description and cross-ref list. I looked, but is opaque to me. Certain that someone here can identify it though... – commonhare Jan 20 '13 at 23:36

You can use \glshyperlink to cross-reference a term without indexing it. (The hyperlink will only occur if you use the hyperref package.) So you could do:

\documentclass{article}
\usepackage{datatool}
\usepackage{glossaries}
\makeglossaries
\makeindex

\newglossaryentry{random variable}
{
name={random variable},
description={a variable which can take on multiple values}
}
\newglossaryentry{sample space}
{
name={sample space},
description={(see \glshyperlink{random variable}) a set of values that a random variable
can take}
}

\begin{document}
Something about \gls{random variable} and \gls{sample space}
\printglossary
\end{document}


Result:

The see key essentially works as a special location, in a similar manner to \index{sample space|see{random variable}}, so value of the see key isn't easy to access.

-