# Hyperref warning when using amsthm and enumerate

hyperref gives the warning that something has been referenced but it doesn't exist. When I use the enumerate (or an itemize) list, I get the warning. Here is the minimal working example (MWE):

\documentclass{scrartcl}
\usepackage{amsthm}
\usepackage{hyperref}
\newtheorem{Bem}{Bemerkung}
\begin{document}
\begin{Bem}
\label{Bemelm}
\begin{enumerate}
\item
\end{enumerate}
\end{Bem}
\ref{Bemelm}
\end{document}


When I use cleveref or just don't use hyperref it gives no warning.

LaTeX is in a funny state if you start one list environment immediately inside another, hyperref ends up referencing an internal label that it never actually uses.

\documentclass{scrartcl}
\usepackage{amsthm}
\usepackage{hyperref}
\newtheorem{Bem}{Bemerkung}
\begin{document}
\begin{Bem}
\mbox{}\label{Bemelm}
\begin{enumerate}
\item
\end{enumerate}
\end{Bem}
\ref{Bemelm}
\end{document}


Makes the error go away but also changes the layout. If you want the original layout, I'd need to look harder:-)

• look harder ;-) – Marco Daniel Apr 23 '13 at 16:46
• \phantomsection instead of the \mbox{} seems to work. – Ulrike Fischer Jul 3 '19 at 22:22