以下文档显示了该问题:
\documentclass{scrreprt}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{hyperref}
\newtheorem{thm}{Theorem}[chapter]
\begin{document}
\chapter{first chapter}
The reference to theorem \ref{thm:structureunoriented1} is correctly displayed (2.1 in this case) but points to the last page of the document with {\ttfamily warning (pdf backend): unreferenced destination with name 'thm.2.1'} during compilation.
\newpage
\chapter{second chapter}
\begin{thm}\label{thm:structureunoriented1}
%% \phantom{x} % Uncommenting this line prevents the problem
\begin{enumerate}[(i)]
\item This is the part 1 of the theorem I want to refer to.
\item This is the part 2 of the theorem I want to refer to.
\end{enumerate}
\end{thm}
\newpage
\chapter{third chapter}
This is where I land when klicking on the reference.
\end{document}
我不确定谁是罪魁祸首,但其中一个包hyperref
是enumerate
,对吧?有办法避免这个问题吗?毕竟\phantom
不是很优雅。在工作后放置标签\end{enumerate}
,但随后我落在了定理的底部。