To replicate the issue you're reporting, it turns out to be necessary to load the enumitem
package in addition to the hyperref
(or nameref
) package. E.g., the following MWE
\documentclass{article}
\usepackage{enumitem}
\usepackage[colorlinks]{hyperref} % or: \usepackage{nameref}
\begin{document}
\begin{description}
\item[Category\label{desc:category}] blablabla
\item[Profile\label{desc:profile}] blabla
(\nameref{desc:category}) blabla
\end{description}
\end{document}
produces this output:
In short, it looks like you've come across a rather significant and quite unfortunate conflict between the enumitem
and hyperref
packages. (Christian Hupfer's answer, which was posted a couple of minutes earlier than mine, provides a more in-depth diagnosis of the nature of the conflict conflict.) Interestingly, the three answers to the query Reference name of description list item in LaTeX do not appear to fix the spacing issue.
Instead of using the enumitem
package, you might consider using the enumerate package. It doesn't offer quite as many bells and whistles as the enumitem
package does. However, depending on your formatting needs (about which you've revealed exactly zero so far...), the enumerate
package may offer all the functionality you really need.
If, however, you simply must use the enumitem
package, I suggest you not employ the basic-LaTeX \label
-\ref
mechanism inside description
environments. Instead, use the more general \hypertarget
-\hyperlink
mechanism of the hyperref
package.
\documentclass{article}
\usepackage{enumerate}
\usepackage[colorlinks]{hyperref}
\begin{document}
\begin{description}
\item[\hypertarget{desc:category}{Category}] blablabla
\item[\hypertarget{desc:profile}{Profile}] blabla
(\hyperlink{desc:category}{Category}) blabla
\end{description}
\end{document}
hyperref
and/ornameref
packages.\label
or of\nameref
introduces spurious spaces because the lines of the definition are not properly terminated with%
. But we can only tell for sure if you provide a complete small document showing everything from\documentclass
to\end{document}
.description
list item in LaTeX