# Why does hyperref refer to the wrong place when I define a new theorem?

I am writing a pdf textbook (using miktex & TexShop). The outline of the tex file is as below. Problem 2 refers to Problem 1. However, hyperref directs the reader to Thm 1. Is there a way for me to fix it? (The problems at the end of the section should be numbered from 1 and the problem section should not advance the section number.)

\documentclass{amsart}
\usepackage{hyperref}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{problem}[theorem]{Problem}
\begin{document}

\section{Logic}

\begin{theorem}\label{thm1} Blah \end{theorem}
\eject

\section*{Problems}\setcounter{theorem}{0}

\begin{problem}\label{prob1}
Prove $P \Rightarrow Q$
\end{problem}

\begin{problem}
Prove the inverse implication of Problem \ref{prob1}.
\end{problem}

\end{document}

• What's the reason for \newtheorem{problem}[theorem]{Problem}? Just do \newtheorem{problem}{Problem}[section]. Commented Sep 29, 2018 at 21:02

If the structure is always

\section{Title}

Text for the section

\clearpage

\section*{Problems}

Problems


then you can just define problem as numbered within sections.

\documentclass{amsart}
\usepackage{hyperref}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{problem}{Problem}[section]

\begin{document}

\section{Logic}

\begin{theorem}\label{thm1} Blah \end{theorem}

\clearpage

\section*{Problems}

\begin{problem}\label{prob1}
Prove $P \Rightarrow Q$
\end{problem}

\begin{problem}
Prove the inverse implication of Problem \ref{prob1}.
\end{problem}

\end{document}


Don't use \eject, but \clearpage.