동일한 태그를 가진 다른 방정식으로 인해 잘못된 참조가 발생합니다.

Nov 22 2020

나는 언급 한 방정식을 참조하고 싶다는 점을 제외 하고는 이 질문 과 매우 유사한 것을 얻고 싶습니다. 다음은 최소한의 예입니다.

\documentclass[12pt]{article}
\usepackage[hidelinks]{hyperref}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}

\begin{document}
\section*{Chapter A}
\begin{equation}\label{star1}\tag{$\star$}
    a^2 + b^2 = c^2
\end{equation}
The main equation of this chapter is the Pythagorean theorem, \eqref{star1}.

\pagebreak

\section*{Chapter B}
\begin{equation}\label{star2}\tag{$\star$}
    i^2 = -1
\end{equation}
The main equation of this chapter is the definition of the imaginary unit, \eqref{star2}.
\end{document}

문제는 \eqref{star2}피타고라스 를 가리키는 것입니다. 나는 또한 관련성이 있다고 확신하는이 경고를 얻습니다.destination with the same identifier (name{equation.0.1}) has been already used, duplicate ignored <to be read again>

미리 감사드립니다.

답변

3 egreg Nov 22 2020 at 22:43

패키지 hyperref는 마지막에로드해야합니다. 몇 개의 패키지 만로드하면되고 MWE에있는 패키지는로드되지 않습니다.

그러나 이것은 문제를 해결하지 못합니다. 문제는 경합 상태입니다. equation관련 카운터를 사용 하여 단계를 수행 한 다음 이전 \tag에 스캔 한 경우 이전 값으로 재설정 \end{equation}하지만 너무 늦었고 hyperref이미 앵커를 제공했습니다.

태그가 똑같다는 것은 문제가되지 않습니다. 비록 그것이 독자를 혼란스럽게 할 수 있기 때문에 조심해야합니다.

사용하면 equation*문제가 해결됩니다.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[hidelinks]{hyperref}

\begin{document}

\section*{Chapter A}
\begin{equation*}\label{star1}\tag{$\star$}
    a^2 + b^2 = c^2
\end{equation*}
The main equation of this chapter is the Pythagorean theorem, \eqref{star1}.

\pagebreak

\section*{Chapter B}
\begin{equation*}\label{star2}\tag{$\star$}
    i^2 = -1
\end{equation*}
The main equation of this chapter is the definition of the imaginary unit, \eqref{star2}.
\end{document}