我试图将等号和大于号对齐,但似乎无法正确对齐(见附图)。我怎样才能正确对齐它们?我已在下面附上我的代码行。
\begin{equation}
\begin{aligned}
E\big[\widehat{V}_i^{j_1...j_i}|X_i^{j_1...j_i}\big] = E\Bigg[max\Bigg\{h_i(X_i^{j_1...j_i}),\frac{1}{b}\sum_{j=1}^{b} \widehat{V}_{i+1}^{j_1...j_ij}\Bigg\}|X_i^{j_1...j_i}\Bigg] \\
\geq max\Bigg\{h_i(X_i^{j_1...j_i}),E\Bigg[\frac{1}{b}\sum_{j=1}^{b} \widehat{V}_{i+1}^{j_1...j_ij}|X_i^{j_1...j_i}\Bigg]\Bigg\} \\
= max\Big\{h_i(X_i^{j_1...j_i}),E\big[\widehat{V}_{i+1}^{j_1...j_ij}|X_i^{j_1...j_i}\big]\Big\} \\
\geq max\Big\{h_i(X_i^{j_1...j_i}),E\big[V_{i+1}\big(X_{i+1}^{j_1...j_i1}\big)|X_i^{j_1...j_i}\big]\Big\} \\
= V_i\big(X_i^{j_1...j_i}\big).
\end{aligned}
\end{equation}
答案1
除了&
在五个地方提供对齐点之外,您还应该 (a)\max
用 代替\max
和 (b) 使用大|
符号(写成\bigm\vert
和\biggm\vert
)。请将所有 替换为...
。\dots
我还建议您使用直立的 E 字母来表示期望运算符。请写\bigl(
和\bigr)
等,而不仅仅是\big(
和\big)
;这样,LaTeX 可以优化打开和关闭“栅栏”符号周围的间距。最后但并非最不重要的是,不要将栅栏符号写得太大;例如,不要写\Biggl[
什么时候\biggl[
也一样好——或者可以说,甚至更好!
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\E}{E}
\begin{document}
\begin{equation}
\begin{aligned}
\E\bigl[\,\widehat{V}_i^{j_1\dots j_i}\bigm\vert X_i^{j_1\dots j_i}\bigr]
&= \E\biggl[\max\biggl\{h_i(X_i^{j_1\dots j_i}),\frac{1}{b}\sum_{j=1}^{b}
\widehat{V}_{i+1}^{j_1\dots j_ij}\biggr\} \biggm\vert X_i^{j_1\dots j_i}\biggr] \\
&\ge \max\biggl\{h_i(X_i^{j_1\dots j_i}),\E\biggl[\frac{1}{b}\sum_{j=1}^{b}
\widehat{V}_{i+1}^{j_1\dots j_ij}\biggm\vert X_i^{j_1\dots j_i}\biggr]\biggr\} \\
&= \max\bigl\{h_i(X_i^{j_1\dots j_i}),\E\bigl[\,\widehat{V}_{i+1}^{j_1\dots j_ij}
\bigm\vert X_i^{j_1\dots j_i}\bigr]\bigr\} \\
&\ge \max\bigl\{h_i(X_i^{j_1\dots j_i}),
\E\bigl[\,V_{i+1}\bigl(X_{i+1}^{j_1\dots j_i1}\bigr)
\bigm\vert X_i^{j_1\dots j_i}\bigr] \bigr\} \\
&= V_i\bigl(X_i^{j_1\dots j_i}\bigr)\,.
\end{aligned}
\end{equation}
\end{document}
答案2
您忘记了 & 符号......max
可能是运算符\max
:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\begin{aligned}
E\big[\widehat{V}_i^{j_1...j_i}|X_i^{j_1...j_i}\big]
& = E\Bigg[\max\Bigg\{h_i(X_i^{j_1...j_i}),\frac{1}{b}\sum_{j=1}^{b}
\widehat{V}_{i+1}^{j_1...j_ij}\Bigg\}|X_i^{j_1...j_i}\Bigg] \\
& \geq \max\Bigg\{h_i(X_i^{j_1...j_i}),E\Bigg[\frac{1}{b}\sum_{j=1}^{b}
\widehat{V}_{i+1}^{j_1...j_ij}|X_i^{j_1...j_i}\Bigg]\Bigg\} \\
& = \max\Big\{h_i(X_i^{j_1...j_i}),E
\big[\widehat{V}_{i+1}^{j_1...j_ij}|X_i^{j_1...j_i}\big]\Big\} \\
& \geq \max\Big\{h_i(X_i^{j_1...j_i}),E
\big[V_{i+1}\big(X_{i+1}^{j_1...j_i1}\big)|X_i^{j_1...j_i}\big]\Big\} \\
& = V_i\big(X_i^{j_1...j_i}\big).
\end{aligned}
\end{equation}
\end{document}
答案3
另一个解决方案是使用\DeclarePairedDelimiter
及其变体,来自mathtools
:这允许我们声明\E
和\Set
命令,该命令可以采用 中选择的可选参数,\big, \Big, \bigg, \Bigg
它隐式地在分隔符周围添加了一对\bigl ... \bigr
、 等。或者,有一个星号版本,它添加了一对\left ... \right
。此外,垂直线被转换为\given
命令,该命令的大小会根据分隔符的大小进行调整。请注意,在前两行中,我使用了较小的分隔符,我认为这更方便。
\documentclass{article}
\usepackage[utf8]{inputenc}%
\usepackage{mathtools}
\providecommand\given{}
\DeclarePairedDelimiterXPP\E[1]{\mathrm E}[]{}{%
\renewcommand\given{\nonscript\:\delimsize\vert\nonscript\:\mathopen{}}
#1}
\DeclarePairedDelimiterX\Set[1]\{\}{%
\renewcommand\given{\nonscript\:\delimsize\vert\nonscript\:\mathopen{}}
#1}
\begin{document}
\begin{equation}
\begin{aligned}
\E[\big]{\widehat{V}_i^{j_1...j_i}\given X_i^{j_1...j_i}} & = \E[\bigg]{\max\Set[\bigg]{\{h_i(X_i^{j_1...j_i}),\frac{1}{b}\sum_{j=1}^{b} \widehat{V}_{i+1}^{j_1...j_ij}}\given X_i^{j_1...j_i}} \\
& \geq \max\Set[\bigg]{h_i(X_i^{j_1...j_i}), \E[\bigg]{\frac{1}{b}\sum_{j=1}^{b} \widehat{V}_{i+1}^{j_1...j_ij}\given X_i^{j_1...j_i}}} \\
& = \max\Set[\Big]{h_i(X_i^{j_1...j_i}),\E[\big]{\widehat{V}_{i+1}^{j_1...j_ij}\given X_i^{j_1...j_i}}} \\
& \geq \max\Set[\Big]{h_i(X_i^{j_1...j_i}),\E[\big]{V_{i+1}\bigl(X_{i+1}^{j_1...j_i1}\bigr)\given X_i^{j_1...j_i}}} \\
& = V_i\bigl(X_i^{j_1...j_i}\bigr).
\end{aligned}
\end{equation}
\end{document}