I have the following code:
\usepackage{hyperref}
\newtheorem{thm}{Theorem}
\begin{thm} \label{mythm}
\begin{enumerate}
\item
\end{enumerate}
\end{thm}
\ref{mythm}
The ref prints the right number. However, when I click on it, it will lead me to a wrong page (basically, to the beginning of the document). pdflatex also has some warning. If I add $ $ between \begin{thm}
and \begin{enumerate}
, the problem disappears, but now, the enumeration starts a new line. Is there any way to fix this?
Best Answer
You can use the
\phantomsection
command fromhyperref
:Another option would be to use the ntheorem package instead of
amsthm
: