为什么我不能将一个alignat
环境嵌套在另一个align
环境中?
\begin{equation}
\label{eq:115}
\left\{
\begin{aligned}
\begin{alignat*}{2}
&U(x,y,z,t)=\int\frac{x'-x}{r^3}[& &(x'-x)u(x',y',z',t)\\
& &+&(y'-y)v(x',y',z',t)\\
& &+&(z'-z)w(x',y',z',t)]d\omega',
\end{alignat*}\\
V(x,y,z,t)=.....,\quad W(x,y,z,t)=..... .
\end{aligned}
\right.
\end{equation}
以下内容可以编译,但是第二条方程式的第一个“+”号与第一个方程式的虚线“+”号不太对齐:
\begin{equation}
\begin{dcases}
\label{eq:115}
{\begin{aligned}
U(x,y,z,t)=\int\frac{x'-x}{r^3}[&\phantom{+}(x'-x)u(x',y',z',t)\\
&+(y'-y)v(x',y',z',t)\\
&+(z'-z)w(x',y',z',t)]d\omega',
\end{aligned}}\\
V(x,y,z,t)=\ldots\ldots,\quad W(x,y,z,t)=\ldots\ldots
\end{dcases}
\end{equation}
谢谢
答案1
最简单的解决方法是进行第二次尝试,但不要只使用\phantom{+}
,而是用空组包围加号以强制正确的间距:
\begin{equation}
\begin{dcases}
\label{eq:115}
{\begin{aligned}
U(x,y,z,t)=\int\frac{x'-x}{r^3}[&\phantom{{}+{}}(x'-x)u(x',y',z',t)\\
&+(y'-y)v(x',y',z',t)\\
&+(z'-z)w(x',y',z',t)]d\omega',
\end{aligned}}\\
V(x,y,z,t)=\ldots\ldots,\quad W(x,y,z,t)=\ldots\ldots
\end{dcases}
\end{equation}
对于您的第一次尝试,alignat*
并不意味着要嵌入。相反,alignedat
(由)定义mathtools
是合适的。但您仍然需要在加号周围添加空组,在本例中,是在&符号之间的两个空组:
\begin{equation}
\label{eq:115}
\left\{
\begin{aligned}
\begin{alignedat}{2}
&U(x,y,z,t)=\int\frac{x'-x}{r^3}[& &(x'-x)u(x',y',z',t)\\
& &{}+{}&(y'-y)v(x',y',z',t)\\
& &{}+{}&(z'-z)w(x',y',z',t)]d\omega',
\end{alignedat}\\
V(x,y,z,t)=.....,\quad W(x,y,z,t)=..... .
\end{aligned}
\right.
\end{equation}
我也不确定你为什么不使用cases
,但这是一个小问题。
答案2
如果您想对齐括号,这样做就可以了。
\documentclass{article}
\usepackage{mathtools}
\usepackage[T1]{fontenc}
\begin{document}
\begin{equation}
\begin{dcases}
\label{eq:115}
\begin{split}
U(x,y,z,t)=\int\frac{x'-x}{r^3}[\hphantom{{}+{}} &(x'-x)u(x',y',z',t)\\[-2\jot]
{}+{}&(y'-y)v(x',y',z',t)\\
{}+{}&(z'-z)w(x',y',z',t)]d\omega',
\end{split}\\
V(x,y,z,t)=\ldots\ldots,\quad W(x,y,z,t)=\ldots\ldots
\end{dcases}
\end{equation}
\end{document}
\hphantom{{}+{}}
如果愿意的话,您可能希望删除。
答案3
关于如何排版公式的一些想法。
代码
\documentclass{article}
\usepackage{mathtools} % loads amsmath
\begin{document}
\begin{align}
U(x,y,z,t) & = \int\frac{x'-x}{r^3} (x',y',z',t)
\bigl[ (x'-x)u + (y'-y)v + (z'-z)w \bigr] d\omega' \\
V(x,y,z,t) & = \ldots \\
W(x,y,z,t) & = \ldots
\end{align}
\begin{equation}\left\{\begin{aligned}
U(x,y,z,t) & = \int\frac{x'-x}{r^3} (x',y',z',t)
\bigl[ (x'-x)u + (y'-y)v + (z'-z)w \bigr] d\omega' \\
V(x,y,z,t) & = \ldots \\
W(x,y,z,t) & = \ldots
\end{aligned}\right.\end{equation}
\begin{equation}\left\{\begin{gathered}
\begin{multlined}
U(x,y,z,t) = \int\frac{x'-x}{r^3} \\
\bigl[ (x'-x)u(x',y',z',t) + (y'-y)v(x',y',z',t) + (z'-z)w(x',y',z',t) \bigr] \\
d\omega'
\end{multlined} \\
V(x,y,z,t) = \ldots \hfill\\
W(x,y,z,t) = \ldots \hfill
\end{gathered}\right.\end{equation}
\end{document}