我有{amsmath}
,{amssymb}
包裹。代碼 :
\begin{subequations}
\begin{align}
u_0(x) = \frac{x} {y (x-b)^2 + z} , \qquad \qquad \qquad \qquad \\
u_1(x) = \frac{-2 (m + n + k)}{y (x-b)^2 + z} + \frac{a+b+c+d+e+f+g+h+j+k+l+m+n+ .... (let us make it so long) }{x+y+z} .
\end{align}
\end{subequations}
出色地,關鍵在於其中一個子方程式與另一個子方程式相比太長了。
我需要的是;
(1) 將所有子方程式置中(不使用\qquad
或\quad
)。
(2) 將所有子方程式左對齊(不使用\qquad
或\quad
)。
另外,我需要標記每個方程,例如(a,b)
(自動而不是手動標記)。
嘗試使用{gathered}
,{alignat}
和{aligned}
具有不同上下文的環境。但是,在我看來,他們並沒有提供我所擁有的所有條件。任何正確的方式將受到高度讚賞!
答案1
對於環境,align
您需要新增 & 符號,它確定方程式的對齊位置(通常為等號)。以下是方程式標記的兩種情況。看看,是否是您所追求的:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{subequations}
\begin{align}
u_0(x) & = \frac{x} {y (x-b)^2 + z} , \label{eq:1a} \\
u_1(x) & = \frac{-2 (m + n + k)}{y (x-b)^2 + z} . \label{eq:1b}
\end{align}
\end{subequations}
or
\begin{align}
u_0(x) & = \frac{x} {y (x-b)^2 + z} , \label{eq:a}\tag{a} \\
u_1(x) & = \frac{-2 (m + n + k)}{y (x-b)^2 + z} . \label{eq:b}\tag{b}
\end{align}
See \eqref{eq:1a} and \eqref{eq:1b} or \eqref{eq:a} and \eqref{eq:b} \dots\\[1em]
\textbf{Addendum}: with environment 'gather` equations are centered:
\begin{gather}
u_0(x) = \frac{x} {y (x-b)^2 + z} , \label{eq:c}\tag{c} \\
u_1(x) = \frac{-2 (m + n + k)}{y (x-b)^2 + z} . \label{eq:d}\tag{d}
\end{gather}
\end{document}