在对齐环境中正确对齐案例

在对齐环境中正确对齐案例

我正在使用rcases内部环境align,并希望等号对齐。我该如何实现?

以下是我当前的 tex 代码

\begin{align}
\begin{split}
&\boldsymbol{d}^{\left( 0\right)}   = 0 \\
&\boldsymbol{\phi}^{\left( 0\right)}   = \boldsymbol{\phi}^k \\
&\begin{rcases}
\boldsymbol{d}^{\left( m\right)}   = \beta_m \boldsymbol{D}\boldsymbol{\phi}^{\left(m-1\right)} + \left( 1 - \beta_m \right) \boldsymbol{d}^{\left( m-1\right)} \\
\boldsymbol{\phi}^{\left( m\right)}  = \boldsymbol{\phi}^{\left( 0\right)} + a_m \mathcal{P} \left( \boldsymbol{f} - \boldsymbol{C} \phi^{\left( m-1\right)} - \boldsymbol{d}^{\left( m\right)} - V\frac{3\boldsymbol{\phi}_n^{\left( m-1\right)}-4\boldsymbol{\phi}_{n-1}+\boldsymbol{\phi}_{n-2}}{2\Delta t}\right)
\end{rcases}   m =1,2,\dots, 5  \\
&\boldsymbol{\phi}^{k+1}  = \boldsymbol{\phi}^{\left( 5\right)}
\end{split}
\end{align}

以下是对齐不太好的结果:

未正确对齐

答案1

它很丑,但能完成工作。它打破了rcases环境内容,因此可以在等号周围添加对齐点。这本身就会导致一些问题,必须通过非标准使用={}&而不是&=以及添加 来\mkern-5mu撤消rcases水平填充来解决。

然而,除此之外,还\vphantom必须添加一个魔法来使得aligned等式左边的与等式rcases右边的具有相同的垂直间距。

已编辑,采纳 Mico 的建议,删除多余的\left...\right语法,并使用该bm包。

\documentclass{article}
\usepackage{amsmath,mathtools,bm}
\usepackage[margin=2.5cm]{geometry}
\begin{document}
\begin{equation}
\begin{split}
\bm{d}^{(0)}   ={}& 0 \\
\bm{\phi}^{( 0)}   ={}& \bm{\phi}^k \\
\begin{aligned}
\bm{d}^{(m)} ={}\\
\bm{\phi}^{(m)} ={}\vphantom{\Bigl(}
\end{aligned}
&
\mkern-5mu\begin{rcases}
   \beta_m \bm{D}\bm{\phi}^{(m-1)} + ( 1 - \beta_m) \bm{d}^{( m-1)} \\
 \bm{\phi}^{(0)} + a_m \mathcal{P} \Bigl( \bm{f} - \bm{C} \phi^{(m-1)} - \bm{d}^{(m)} - V\frac{3\bm{\phi}_n^{(m-1)}-4\bm{\phi}_{n-1}+\bm{\phi}_{n-2}}{2\Delta t}\Bigr)
\end{rcases}   m =1,2,\dots, 5  
\\
\bm{\phi}^{k+1}  ={}& \bm{\phi}^{(5)}
\end{split}
\end{equation}
\end{document}

在此处输入图片描述

原始答案(用于比较)

\documentclass{article}
\usepackage{amsmath,mathtools}
\usepackage[margin=2.5cm]{geometry}
\begin{document}
\begin{align}
\begin{split}
\boldsymbol{d}^{\left( 0\right)}   ={}& 0 \\
\boldsymbol{\phi}^{\left( 0\right)}   ={}& \boldsymbol{\phi}^k \\
\begin{aligned}
\boldsymbol{d}^{\left( m\right)} ={}\\
\boldsymbol{\phi}^{\left( m\right)} ={}\vphantom{\left(\textstyle\frac{x_{n-1}^{(}}{}\right)}
\end{aligned}
&
\mkern-5mu\begin{rcases}
   \beta_m \boldsymbol{D}\boldsymbol{\phi}^{\left(m-1\right)} + \left( 1 - \beta_m \right) \boldsymbol{d}^{\left( m-1\right)} \\
 \boldsymbol{\phi}^{\left( 0\right)} + a_m \mathcal{P} \left( \boldsymbol{f} - \boldsymbol{C} \phi^{\left( m-1\right)} - \boldsymbol{d}^{\left( m\right)} - V\frac{3\boldsymbol{\phi}_n^{\left( m-1\right)}-4\boldsymbol{\phi}_{n-1}+\boldsymbol{\phi}_{n-2}}{2\Delta t}\right)
\end{rcases}   m =1,2,\dots, 5  
\\
\boldsymbol{\phi}^{k+1}  ={}& \boldsymbol{\phi}^{\left( 5\right)}
\end{split}
\end{align}
\end{document}

在此处输入图片描述

答案2

我认为使用rcases环境会让事情在视觉上过于突出。我建议在环境中m=1,\dots,5使用单一环境。alignedequation

哦,一定要删除\leftand\right语句:它们除了使代码混乱之外没有任何作用。

在此处输入图片描述

\documentclass{article}
\usepackage{mathtools,bm}
\usepackage[letterpaper,margin=1in]{geometry} % set page parameters appropriately
\begin{document}
\begin{equation}
\begin{aligned}
\bm{d}^{(0)}    &= 0 \\
\bm{\phi}^{(0)} &= \bm{\phi}^k \\
\bm{d}^{(m)}    &= \beta_m \bm{D}\bm{\phi}^{(m-1)} + ( 1 - \beta_m ) \bm{d}^{(m-1)},\ 
   m=1,\dots,5 \\
\bm{\phi}^{(m)} &= \bm{\phi}^{(0)} + a_m \mathcal{P} 
  \biggl( \bm{f} - \bm{C} \phi^{(m-1)} - \bm{d}^{(m)} 
  - V\,\frac{3\bm{\phi}_n^{(m-1)}-4\bm{\phi}_{n-1}
  +\bm{\phi}_{n-2}}{2\Delta t}\biggr),\ m=1,\dots,5\\
\bm{\phi}^{k+1} &= \bm{\phi}^{(5)}
\end{aligned}
\end{equation}
\end{document}

相关内容