4

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.

1 Answer 1

4

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:-)

2
  • 6
    look harder ;-) Apr 23, 2013 at 16:46
  • \phantomsection instead of the \mbox{} seems to work. Jul 3, 2019 at 22:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .