3

Question

I defined the command \glsquotation as:

\newcommand{\glsquotation}[1]{
    \paragraph{\gls{#1}:} \glsdesc*{#1}.
}

The command takes the label of a glossary entry and prints the name of the glossary entry and its description. The name should be linked to the glossary and the description shouldn't.

It works fine for the first entry but every entry after the first one doesn't link to the glossary. I made links blue so you can see it from this screenshot:

Furthermore, links the descriptions of glossary entries contain, are lost. For example, "Objekts" and "Subjekts" in the definition of "Authentizität", and "unautorisiert" in the definition of "integer" should be linked to different glossary entries. They are linked correctly in the glossary itself.


Example Document

I cut my document down content-wise as much as possible without breaking any reference dependencies and removed all other command definitions.

\documentclass[a4paper,11pt]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[a4paper, total={6in, 10in}]{geometry}
\usepackage{booktabs}
\usepackage[colorlinks]{hyperref}
\usepackage[acronym,toc]{glossaries}

\title{UTF-8's Example Document}
\author{UTF-8}

\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=blue,
    urlcolor=black,
    pdftitle={\@title},
    pdfauthor={\@author},
    bookmarks=true
}

\newcommand{\glsquotation}[1]{
    \paragraph{\gls{#1}:} \glsdesc*{#1}.
}


\makeglossaries

\newglossaryentry{Objekt}
{
    name=Objekt,
    plural=Objekte,
    description={Siehe \gls{Datenobjekt}},
}

\newglossaryentry{Datenobjekt}
{
    name=Datenobjekt,
    plural=Datenobjekte,
    description={Repräsentiert Informationen},
}

\newglossaryentry{Subjekt}
{
    name=Subjekt,
    plural=Subjekte,
    description={Benutzer eines Systems oder Objekt, das im Auftrag von Benutzern im System aktiv sein kann (z.B. Prozess, Server, Prozedur)},
}

\newglossaryentry{Autorisierung}
{
    name=Autorisierung,
    plural=Autorisierungen,
    description={Besitzt ein \gls{Subjekt} die Berechtigung, auf ein \gls{Objekt} zuzugreifen, so nennt man das Subjekt für diesen Datenzugriff autorisiert},
}

\newglossaryentry{Authentizitaet}
{
    name=Authentizität,
    plural=Authentizitäten,
    description={Echtheit und Glaubwürdigkeit eines \glslink{Objekt}{Objekts} bzw. \glslink{Subjekt}{Subjekts}, die anhand seiner Identität und seiner charakteristischen Eigenschaften überprüfbar ist},
}

\newglossaryentry{vertraulich}
{
    name=vertraulich,
    description={System ermöglicht keine \glslink{Autorisierung}{unautorisierte} Informationsgewinnung},
}

\newglossaryentry{integer}
{
    name=integer,
    description={Subjekten ist es nicht möglich, Daten \glslink{Autorisierung}{unautorisiert} und unbemerkt zu manipulieren},
}

\newglossaryentry{verfuegbar}
{
    name=verfügbar,
    description={Authentifizierte und \glslink{Autorisierung}{autorisierte} \glspl{Subjekt} werden in der Wahrnehmung ihrer Berechtigungen nicht \glslink{Autorisierung}{unautorisiert} beeinträchtigt},
}

\begin{document}
\maketitle
\tableofcontents

\chapter{Chapter}
\section{Section}
\glsquotation{Authentizitaet}\\

Das klassische Schutzziel-Trio besteht aus Vertraulichkeit, Integrität, und Verfügbarkeit:

\glsquotation{vertraulich}
\glsquotation{integer}
\glsquotation{verfuegbar}


\glsaddallunused
\printglossaries

\end{document}

I wrote this script to build it (but you obviously can't use the cleaning option without the cleaning script):

# Builds the document specified by 'documentname'.
# Call with option '-c' or '--clean' to clean the top-levl directory before building.

#!/bin/bash

# CONFIGURATION
documentname="ENTER WHAT YOU CALLED THE FILE HERE (WITHOUT FILE EXTENSION)"
# END OF CONFUGURATION

if [ $1 == "-c" ] || [ $1 == "--clean" ]; then
    ./clean.sh
fi


pdflatex "$documentname.tex"
makeglossaries "$documentname"
pdflatex "$documentname.tex"
pdflatex "$documentname.tex"
makeindex -s "$documentname.ist" -o "$documentname.gls" "$documentname.glo"
pdflatex "$documentname.tex"
echo finished
sleep 2
  • Please provide a complete small document, starting with \documentclass and ending with \end{document} that illustrates your problem. Without this information, it is hard/impossible to analyze the problem. – gernot Oct 29 '16 at 21:17
  • @gernot Thanks. I wasn't sure whether I should do that or that's just spamming the question with superfluous code. – UTF-8 Oct 30 '16 at 9:34
  • looks like a bug to me. The first starred \glsdesc* affects the following. It works if you add a group: {\glsdesc*{#1}}. Make a bug report. – Ulrike Fischer Oct 30 '16 at 12:32
  • @UlrikeFischer Thanks. I made a bug report for the glossaries package and will report back whether the people maintaining that package recognize it as a bug or not. – UTF-8 Oct 30 '16 at 18:47
3

It's not a bug. It's caused by nested links, which the glossaries manual warns against. Your descriptions include \gls and \glslink, which conflicts with \glsdesc.

From the end of the Defining Glossary Entries section:

Avoid using any of the \gls-like or \glstext-like commands within the text, first, short or long keys (or their plural equivalent) or any other key that you plan to access through those commands. (For example, the symbol key if you intend to use \glssymbol.) Otherwise you end up with nested links, which can cause complications and they won’t work with the case-changing commands. You can use them within the value of keys that won’t be accessed through those commands. For example, the description key if you don’t use \glsdesc.

In this context, there's no reason to use \glsdesc*. Just use \glsentrydesc:

\newcommand{\glsquotation}[1]{
        \paragraph{\gls{#1}:} \glsentrydesc{#1}.
}

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.