
假設我在論文中寫了一個方程式並對其進行了編號:
y = a + bx (1)
然後,在本文後面,我想透過展示相同的方程式來提醒讀者具有相同的方程式編號。
當然,我可以重複這個方程,但是 LaTeX 給了它一個新的方程編號:
y = a + bx (2)
如何強制 LaTeX 使用原始方程式編號?
答案1
使用\label
,\ref
機制;一旦你\label
導出了方程,你就可以使用\ref
內部\tag
來檢索數字:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}\label{eq:test}
a = b + c.
\end{equation}
\begin{equation}
a = b + c. \tag{\ref{eq:test}}
\end{equation}
\end{document}
作為尼爾·德·博德拉普在他的評論中提到,避免讀者對方程式編號感到困惑的一種方法是在重複方程式的標籤中添加「重新訪問」:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}\label{eq:test}
a = b + c.
\end{equation}
\begin{equation}
a = b + c. \tag{\ref{eq:test} revisited}
\end{equation}
\end{document}
小補充:在重複數字時使用equation*
in 代替,以便 LaTeX 知道它不應該使用新數字。equation
這可以避免在使用例如hyperref
包時出現警告。因此:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}\label{eq:test}
a = b + c.
\end{equation}
\begin{equation*}
a = b + c. \tag{\ref{eq:test} revisited}
\end{equation*}
\end{document}