# How often do you refer to Glossary Entries

I like to make a glossary for my work. For that I have a little stylistic question: Do you link to the glossary entries every time, when a word listed in a glossary appears or just at the first time of the chapter / section / paragraph / ... ? Because in MS Word I had not such problems ^^

Example:

\glslink{bla}{apples} and \glslink{bla}{apples} and \glslink{bla}{apples}

or:

\glslink{bla}{apples} and apples and apples

Which is the better one? Because doing it for every word there would be really annoying.

Thank you ^^

• Why not using \gls{apples} instead of \glslink{...} directly?
– user31729
Dec 29, 2018 at 18:43
• If I remember correctly, glossaries can be configured to link only the first occurence and then use the non-linked entry
– user31729
Dec 29, 2018 at 18:49
• Because in german there are more cases: for example: Der Apfel, die Äpfel, den Äpfeln usw. Dec 29, 2018 at 18:55
• I know German ;-) \glsplural is your friend, as well as you could add storage keys like \glsgenitiv and \glsdativ and \glsakkusativ for such issues
– user31729
Dec 29, 2018 at 18:57
• mh I really think glslink is the easier way ^^ Dec 29, 2018 at 21:01

It depends on the document, whether you are predominantly using commands like \gls (which I usually do) or commands like \glslink (as in your question), and if you are using a sophisticated text editor that can be configured to insert commands through key-mappings or similar to reduce typing.

If you have a document that's like a reference book or user manual, where most readers dip in and out rather than reading from start to finish, then they may start mid-chapter if they've looked something up from the index (or used the PDF viewer's search function). In which case, they may miss the first link if you are only hyperlinking once per chapter or on first use only. If you hide the links, then they are less intrusive but are still available to help the drop-in reader who may be unfamiliar with the terms.

If you are using commands like \gls (rather than providing the link text with \glslink or \glsdisp), then this can help consistency. For example, in English some compound words are hyphenated and some aren't. I can't always remember, but if I'm using \gls then I only need to look it up when I'm defining the entry not every time I use it. Similarly, if the term requires some special formatting.

For example, both the bib2gls user manual and the accompanying introductory guide have a lot of hyperlinks resulting from \gls (or similar), but they both use:

\usepackage[hidelinks]{hyperref}


so they don't stand out.

If you are using \glslink a lot due to declension, then I recommend adding keys as per Christian's answer. If you do only want the occasional hyperlink, instead of indexing only the first use, another possibility is to switch off the hyperlinks by default and only enable them for specific use cases. For example:

\documentclass{article}

\usepackage{glossaries-extra}

\newglossaryentry{sample}{name={sample},description={an example}}

\begin{document}

\printunsrtglossary % requires glossaries-extra.sty
\end{document}


The + modifier acts like a shortcut for the hyper=true option and works for all the \gls and \glstext type of commands, as well as the commands created by \glsaddkey. (The opposite is the * modifier which applies hyper=false.)

There is no rule whether the entry should be linked or not. Depending on the setup of hyperref etc, links with colored borders may be tedious to read, so just link the first occurence only or use colorlinks as an option to hyperref.

Depending also on the position within the text, it may be convenient to have a link any time you encounter an entry in order to able to jump to the glossary. If unsure, link any occurrence.

Here is a way without explicit \glslink entries, configuring with \glslinkpostsetkeys whether the entry has been used so far.

This way, \glspl and \gls etc. can be used in various ways. If \setkeys{glslink}{hyper=false} is enabled, the link is disabled. In order to enable the first usage with linking, the \glsentrycurrcount macro is evaluated and hyper=false set, see code below.

If any occurence shall be linked, remove the redefinition of \glslinkpostkeys or say hyper=true there.

As a special use case, I have defined the genitiv and genitivplural keys to be applied with German language.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{glossaries}

\usepackage{blindtext}

\makeglossaries

\glsenableentrycount

% Either remove this macro redefinition completely or say hyper=true if any occurence shall be linked.
\ifnum\glsentrycurrcount{\glslabel}>1% Did we use it more than once?
\fi
}

% Defining keys with a lovely mix of English and German words ;-)

%empty on purpose since German genitive construction is irregular
}{%
}{%
\Glsentrygenitiv%
}{%
\glsgenitiv%
}{%
\Glsgenitiv%
}{%
\GLSgenitiv%
}

% empty on purpose since German genitive construction is irregular
}{%
}{
\Glsentrygenitivplural%
}{%
\glsgenitivplural%
}{%
\Glsgenitivplural%
}{%
\GLSgenitivplural%
}

\newglossaryentry{apple}{%
name=Apfel,
plural=Äpfel,
genitiv=Apfels,
genitivplural={{Ä}pfel},
description={Apple}
}

\begin{document}

Der \Gls{apple} war reif. Das Aussehen des \glsgenitiv{apple} entsprach nicht meinen Vorstellungen.

Die \glspl{apple} waren reif. Das Aussehen der \GLSgenitivplural{apple} ließ zu Wünschen übrig, daher kaufte ich die \glspl{apple} nicht.

But again in upper case:\GLS{apple} and here in usual German writting: \Gls{apple}

\end{document}