I want to use the glossaries package and I want to be able to reference descritpion list items by their name. For the latter problem, I found a solution (Reference name of description list item in LaTeX , the accepted answer). This works fine. It is also no problem to incorporate glossary-entries into the text, however when printing the list of glossaries, this leads to an error.
My solution by now:
\documentclass{article}
\usepackage{hyperref}
%%%
% Macro for description
\makeatletter
\let\orgdescriptionlabel\descriptionlabel
\renewcommand*{\descriptionlabel}[1]{%
\let\orglabel\label
\let\label\@gobble
\phantomsection
\edef\@currentlabel{#1}%
%\edef\@currentlabelname{#1}%
\let\label\orglabel
\orgdescriptionlabel{#1}%
}
\makeatother
\usepackage[toc,automake]{glossaries}
\makeglossaries
\newacronym{KG}{KG}{Knowledge Graph}
\begin{document}
\begin{description}
\item[(A1)\label{desc:A1}] Test
\end{description}
As can be seen in \ref{desc:A1} a \gls{KG} is...
\printglossary[type=\acronymtype]
\end{document}
This works when either commenting out \printglossary[type=\acronymtype] or everything between makeatletter and makeatother.
The error message is:
Undefined control sequence.
\gls@start@measuring ...else \let \gls@org@target
\glstarget \let \gls@org@l...
l.5 \setentrycounter[]{page}\glsnumberformat{1}}}
As I am not an expert on Latex, I would appreciate any help. I am open for all solutions enabling to achieve a combination of labels on items and the glossaries, they need not to be based on this code.