交叉引用无法正常工作

交叉引用无法正常工作
 \documentclass[notitlepage, 12pt]{amsart}
 \usepackage{amsthm, amsmath, amsaddr, amssymb, graphicx, dsfont,}
 \usepackage[dvipsnames]{xcolor}
 \usepackage[
colorlinks=true,
linkcolor=Blue,
citecolor=Brown]{hyperref}
\renewcommand{\baselinestretch}{1.2}
\usepackage{natbib}
\usepackage{caption}

\raggedbottom

 \newtheorem{theorem}{Theorem}
 \newtheorem{lemma}{Lemma}
 \newtheorem{proposition}{Proposition}
 \newtheorem{corollary}{Corollary}
 \newtheorem{definition}{Definition}
 \newtheorem{example}{Example}
 \newtheorem{remark}{Remark}
 \newtheorem{assumption}{Assumption}

 \usepackage{geometry}
 \geometry{
body={6.5in, 9.0in},
left=1.25in,
right=1.25in,
top=1.25in,
bottom=1.25in
}

%\usepackage{footmisc}
%\setlength{\footnotesep}{0.4cm} %footnote spacing

 \DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator{\ima}{Im}
\newcommand{\namedthm}[2]{\theoremstyle{plain}
\newtheorem*{thm#1}{Theorem #1}\begin{thm#1}#2\end{thm#1}}

\usepackage{float}

\title[Test]{Test}\thanks{Test}

\author[A]{A}\address{University of LaTeX}

 \author[B]{B}\address{University of LaTeX} 

\date{\today}

 \begin{document}


 \maketitle 


 \begin{abstract}
 Test

\end{abstract}

\pagenumbering{alpha}


\thispagestyle{empty}

\clearpage


\pagenumbering{arabic}

\setcounter{page}{1}

\section{Introduction}

Test

\section{General Results}\label{General}\bigskip

 \begin{theorem}
 \begin{itemize}
  \item[(i)] a. 
  \item[(ii)] b.
  \item[(iii)] c.
 \item[(iv)] d.
\item[(v)] e. 
\end{itemize}
\label{main}
 \end{theorem}\bigskip

Theorem \ref{main}.\bigskip

\end{document}

在生成的 PDF 中,当单击“定理 1”中的“1”时,它会跳转到标题页,而不是定理 1 所在的位置。我该如何解决这个问题?谢谢!

答案1

最好hyperref在最后一个包中使用,并且你保留了\label\ref在同一个页面中,我稍微修改了你的MWE

\documentclass[notitlepage, 12pt]{amsart}
 \usepackage{amsthm, amsmath, amsaddr, amssymb, graphicx, dsfont,}
 \usepackage[dvipsnames]{xcolor}
\renewcommand{\baselinestretch}{1.2}
\usepackage{natbib}
\usepackage{caption}

\raggedbottom

 \newtheorem{theorem}{Theorem}
 \newtheorem{lemma}{Lemma}
 \newtheorem{proposition}{Proposition}
 \newtheorem{corollary}{Corollary}
 \newtheorem{definition}{Definition}
 \newtheorem{example}{Example}
 \newtheorem{remark}{Remark}
 \newtheorem{assumption}{Assumption}

 \usepackage{geometry}
 \geometry{
body={6.5in, 9.0in},
left=1.25in,
right=1.25in,
top=1.25in,
bottom=1.25in
}

 \usepackage[
colorlinks=true,
linkcolor=Blue,
citecolor=Brown]{hyperref}

 \DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator{\ima}{Im}
\newcommand{\namedthm}[2]{\theoremstyle{plain}
\newtheorem*{thm#1}{Theorem #1}\begin{thm#1}#2\end{thm#1}}

\usepackage{float}

\title[Test]{Test}\thanks{Test}

\author[A]{A}\address{University of LaTeX}

 \author[B]{B}\address{University of LaTeX} 

\date{\today}

 \begin{document}


 \maketitle 


 \begin{abstract}
 Test

\end{abstract}

\clearpage


\pagenumbering{arabic}

\setcounter{page}{1}

\section{Introduction}

Test

\section{General Results}\label{General}\bigskip

 \begin{theorem}\label{main}
 \begin{itemize}
  \item[(i)] a. 
  \item[(ii)] b.
  \item[(iii)] c.
 \item[(iv)] d.
\item[(v)] e. 
\end{itemize}
 \end{theorem}\bigskip

Theorem \ref{main}.\bigskip

\clearpage

Test for hyperlink \ref{main}
\end{document}

相关内容