選擇多線方程式中的哪些行分配數字

選擇多線方程式中的哪些行分配數字

如果我做:

\begin{align}
    a = b \\
    b = c \\
    c = d \\
\end{align}

輸出將類似:

(1)        a = b
(2)        b = c
(3)        c = d

如果我用 algin* 代替。不會枚舉任何行。

有沒有辦法獲得以下輸出?

           a = b
           b = c
(1)        c = d

答案1

您可以mathtools只列舉您引用的方程,而不是選擇要列舉的行。

\documentclass{article} 

\usepackage{mathtools}

\mathtoolsset{showonlyrefs}

\begin{document}

\begin{align}
  a = b \\
  b = c \label{eq:unused} \\
  c = d \label{eq:used} % Only this row will be enumerated as it's the
                        % only row that is referenced to.
\end{align}
\eqref{eq:used}

\end{document}

相關內容