我想对齐这些方程。我认为它们没有完全对齐。我的代码:
\begin{align}
\mathbb{E}_{2}[S_{3}](HH) = p S_{3}(HHH) + (1-p) S_{3}(HHT) \label{eqn1}\\
\mathbb{E}_{2}[S_{3}](HT) = p S_{3}(HTH) + (1-p) S_{3}(HTT) \label{eqn2}\\
\mathbb{E}_{2}[S_{3}](TH) = p S_{3}(THH) + (1-p) S_{3}(THT) \label{eqn3}\\
\mathbb{E}_{2}[S_{3}](TT) = p S_{3}(TTH) + (1-p) S_{3}(TTT) \label{eqn4}.
\end{align}
答案1
这里有 3 个选项:
align
与周围的对齐一致=
。左右对齐
=
以及左对齐+
。围绕
=
和进行对齐+
,并使用术语中心对齐(使用\eqmakebox[<tag>]
来自eqparbox
)。
\documentclass{article}
\usepackage{amsmath,amssymb,eqparbox}
\begin{document}
\begin{align}
\mathbb{E}_2[S_3](HH) &= p S_3(HHH) + (1 - p) S_3(HHT) \\
\mathbb{E}_2[S_3](HT) &= p S_3(HTH) + (1 - p) S_3(HTT) \\
\mathbb{E}_2[S_3](TH) &= p S_3(THH) + (1 - p) S_3(THT) \\
\mathbb{E}_2[S_3](TT) &= p S_3(TTH) + (1 - p) S_3(TTT)
\end{align}
\begin{alignat}{2}
\mathbb{E}_2[S_3](HH) &= p S_3(HHH) &&+ (1 - p) S_3(HHT) \\
\mathbb{E}_2[S_3](HT) &= p S_3(HTH) &&+ (1 - p) S_3(HTT) \\
\mathbb{E}_2[S_3](TH) &= p S_3(THH) &&+ (1 - p) S_3(THT) \\
\mathbb{E}_2[S_3](TT) &= p S_3(TTH) &&+ (1 - p) S_3(TTT)
\end{alignat}
\begin{align}
\eqmakebox[LHS]{$\mathbb{E}_2[S_3](HH)$} &= \eqmakebox[pS]{$p S_3(HHH)$} + \eqmakebox[1-pS]{$(1 - p) S_3(HHT)$} \\
\eqmakebox[LHS]{$\mathbb{E}_2[S_3](HT)$} &= \eqmakebox[pS]{$p S_3(HTH)$} + \eqmakebox[1-pS]{$(1 - p) S_3(HTT)$} \\
\eqmakebox[LHS]{$\mathbb{E}_2[S_3](TH)$} &= \eqmakebox[pS]{$p S_3(THH)$} + \eqmakebox[1-pS]{$(1 - p) S_3(THT)$} \\
\eqmakebox[LHS]{$\mathbb{E}_2[S_3](TT)$} &= \eqmakebox[pS]{$p S_3(TTH)$} + \eqmakebox[1-pS]{$(1 - p) S_3(TTT)$}
\end{align}
\end{document}