
autoref
/ 패키지 ref
의 명령에 버그가 있습니다 hyperref
. 열거/항목화 외에 아무것도 없으면 정리에 대한 링크가 작동하지 않습니다. 정리 대신 문서의 시작 부분으로 이동합니다. 이 문제를 어떻게 해결할 수 있나요?
이상한 동작도 있습니다. 패키지를 가져오지 않으면 모두 올바르게 작동합니다 amsthm
.
최소한의 예: 링크는 t-2
제대로 작동하지만 t-1
그렇지 않습니다. \usepackage{amdthm}
모든 작품을 올바르게 제거했다면
\documentclass{article}
\usepackage{hyperref}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
\label{t-1}
\begin{enumerate}
\item a
\item b
\end{enumerate}
\end{theorem}
\begin{theorem}
\label{t-2} Text
\begin{enumerate}
\item a
\item b
\end{enumerate}
\end{theorem}
Reference to \ref{t-1}
Reference to \ref{t-2}
\end{document}
답변1
패키지를 찾았습니다 cleveref
. 추가 코드 없이 문제가 해결되었습니다. 제 생각엔 최적의 솔루션인 것 같아요