My issue concerns numbering within subsections using the hyperref package. I have found that referencing equations prints the right number but goes to the wrong location when clicked. I found that this could be fixed by adding the option
hypertexnames = false
when loading hyperref. But I am wondering why this issue should exist in the first place (and if adding "hypertexnames = false", which I do not understand, might create other issues)?
Example below, with references going to the wrong location when clicked. It should go to "Second Equation" but instead goes to "First equation".
This example can be fixed by loading \usepackage[hypertexnames = false]{hyperref} instead of \usepackage{hyperref}.
\documentclass{article}
\usepackage{amsmath}
\numberwithin{equation}{subsection}
\usepackage{hyperref}
\title{Equation numbering troubleshooting}
\author{Author}
\date{September 2022}
\begin{document}
\maketitle
\section{}
\subsection{}
\begin{equation}
First equation
\end{equation}
\newpage
\subsection{}
\begin{equation}\label{equation}
Second equation
\end{equation}
Equation \eqref{equation}. Equation \ref{equation}.
\end{document}