0

In the code below if I uncomment either of #1 or #2 or #3 it compiles, otherwise not. Why

\documentclass[12pt]{article}
\usepackage{keyfloat} % #1

\usepackage{filecontents}
\begin{filecontents*}{\jobname.glo}

\newglossaryentry{smith-j}
{
 type=ppl,
 name={Smith, J},
 text={J. Smith},
 description={}
}

\end{filecontents*}
%\addbibresource{\jobname.bib}

\usepackage{glossaries}
\makenoidxglossaries
%\setglossarystyle{tree}
\newglossary*{ppl}{People}
\loadglsentries[ppl]{\jobname.glo}

\usepackage{hyperref} % #2

\author{AUTHOR}

\title{TITLE}

\begin{document}

\maketitle

Do you know \gls{smith-j}?

\printnoidxglossaries % #3

\end{document}

1 Answer 1

3

hyperref loads the nameref package. nameref patches a number of commands to be able to store their "title" in a label. Beside others \nameref patches \descriptionlabel and with it you can e.g. reference and link a description item:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{description}
  \item[blub\label{desc:a}] a word
\end{description}

\nameref{desc:a}
\end{document}

To get the title nameref uses a package named gettitlestring. The keyfloat package passes to gettitlestring the expand option:

 \PassOptionsToPackage{expand}{gettitlestring}

This options makes gettitlestring more powerfull but also more fragile. And now you get errors from the code that glossaries adds to the description labels. It would be possible to teach gettitlestring about glossaries, but as you probably don't need the label titles the easiest is to revert the nameref definition:

\makeatletter\let\descriptionlabel\NRorg@descriptionlabel\makeatother
\printnoidxglossaries 
1
  • Maybe worth pointing the patch must come just before \printnoidxglossary.
    – Erwann
    Apr 5 at 10:30

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.