# Package conflict : hyperref, glossaries, and keyfloat

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*}

\usepackage{glossaries}
\makenoidxglossaries
%\setglossarystyle{tree}
\newglossary*{ppl}{People}

\usepackage{hyperref} % #2

\author{AUTHOR}

\title{TITLE}

\begin{document}

\maketitle

Do you know \gls{smith-j}?

\printnoidxglossaries % #3

\end{document}


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

• Maybe worth pointing the patch must come just before \printnoidxglossary. Apr 5 at 10:30