\begin{equation}\label{eq:f_formulation}
\left\{
\begin{alignedat}{3}
\E(u,z) &= \int_I(u_N,z)_{L^2(\Gamma_N)}+ \int_I(u_V,z)&\\
&\text{for all } z \in W_{,0D} \text{ with } z(T)=0\\
\tr u &= u_D \text{ on } \Sigma_D &
\end{alignedat}
\right.
\end{equation}
An equivalent variational version is finding $u=u_0 + E u_D$, $u_0 \in W_{,0D}$ with
\begin{equation}
\left \{
\begin{alignedat}{3}\label{eq:f_formulation_variational}
\E(u_0,z) &= -\E(E u_D,z) + \int_I(u_N,z)_{L^2(\Gamma_N)}+ \int_I(u_V,z)&\\
\text{for all } z \in W_{,0D} \text{ with } z(T)=0\\
\tr u_0 &= 0 \text{ on } \Sigma_D &
\end{alignedat}
\right.
\end{equation}
结果:
我希望第二个等式在对齐方面看起来与第一个等式一样:第二行的末尾应与第一行的末尾匹配。两个等号仍然对齐。有什么提示可以实现这一点吗?
谢谢!
答案1
您可以将条件排版为贴在左侧的零宽度框。
\documentclass{article}
\usepackage{amsmath}
\newcommand{\E}{\mathcal{E}}
\DeclareMathOperator{\tr}{tr}
\begin{document}
\begin{equation}\label{eq:f_formulation}
\left\{
\begin{alignedat}{2}
\E(u,z) &= \int_I(u_N,z)_{L^2(\Gamma_N)}+ \int_I(u_V,z)&&\\
&&&\makebox[0pt][r]{for all $z \in W_{,0D}$ with $z(T)=0$}\\
\tr u &= u_D \text{ on } \Sigma_D &
\end{alignedat}
\right.
\end{equation}
\end{document}
另一方面,我认为没有必要寻找不相关对象的对齐。
\documentclass{article}
\usepackage{amsmath}
\newcommand{\E}{\mathcal{E}}
\DeclareMathOperator{\tr}{tr}
\begin{document}
\begin{equation}\label{eq:f_formulation}
\left\{
\begin{aligned}
& \E(u,z) = \int_I(u_N,z)_{L^2(\Gamma_N)}+ \int_I(u_V,z) \\
& \qquad\text{for all $z \in W_{,0D}$ with $z(T)=0$} \\[1ex]
& \tr u = u_D \text{ on } \Sigma_D
\end{aligned}
\right.
\end{equation}
\end{document}
或者,如果您希望条件与顶部方程右对齐,
\documentclass{article}
\usepackage{amsmath}
\newcommand{\E}{\mathcal{E}}
\DeclareMathOperator{\tr}{tr}
\begin{document}
\begin{equation}\label{eq:f_formulation}
\left\{
\begin{alignedat}{2}
&\E(u,z) = \int_I(u_N,z)_{L^2(\Gamma_N)}+ \int_I(u_V,z) \\
&&\makebox[0pt][r]{for all $z \in W_{,0D}$ with $z(T)=0$} \\[1ex]
&\tr u = u_D \text{ on } \Sigma_D
\end{alignedat}
\right.
\end{equation}
\end{document}