cases
在同一环境中,如何匹配两条线equation
?我遇到的情况是:
\begin{equation}
\begin{rcases}
\sum_{I=1}^{NP} K_h (x - x_I; x) \Delta x_I &= 1 \\
\sum_{I=1}^{NP} \left(\frac{x - x_I}{h}\right) K_h (x - x_I; x) \Delta x_I &= 0 \\
&\;\;\vdots \notag \\q
\sum_{I=1}^{NP} \left(\frac{x - x_I}{h}\right)^n K_h (x - x_I; x) \Delta x_I &= 0
\end{rcases} =
\begin{cases}
M_0 (x) &= 1 \\
M_1 (x) &= 1 \\
&\;\;\vdots \notag \\
M_n (x) &= 1 \\
\end{cases}
\end{equation}
现在我想将左侧的案例行与右侧的案例行进行匹配。我可以做一些丑陋的事情,比如添加\vspace
,但有没有更优雅的方式来做到这一点?
答案1
如果希望<stuffB>
与 具有相同的高度<stuffA>
,请使用\vphantom{<stuffA>}<stuffB>
:
\documentclass{article}
\usepackage{mathtools,array}
\begin{document}
\begin{equation}
\left. \begin{array}{>{\displaystyle}r}
\sum_{I = 1}^{NP} K_h (x - x_I; x) \Delta x_I = 1 \\
\sum_{I = 1}^{NP} \Bigl( \frac{x - x_I}{h} \Bigr) K_h (x - x_I; x) \Delta x_I = 0 \\
\vdotswithin{=}\phantom{0} \\
\sum_{I = 1}^{NP} \Bigl(\frac{x - x_I}{h} \Bigr)^n K_h (x - x_I; x) \Delta x_I = 0
\end{array} \right\}
=
\left\{\begin{array}{>{\displaystyle}r}
\vphantom{\sum_{I = 1}^{NP}} M_0 (x) = 1 \\
\vphantom{\sum_{I = 1}^{NP}} M_1 (x) = 1 \\
\vdotswithin{=}\phantom{1} \\
\vphantom{\sum_{I = 1}^{NP}} M_n (x) = 1
\end{array}\right.
\end{equation}
\end{document}
答案2
aligned
这是一个使用两种环境以及(印刷)支柱的解决方案。
\documentclass{article}
\usepackage{mathtools} % for \vdotswithin macro
\usepackage{mleftright} \mleftright % tighter spacing around large parentheses
\newcommand\tallstrut{\vphantom{\sum_{I=1}^{NP}}} % define a tall typographic strut
\begin{document}
\begin{equation}
\left.
\begin{aligned}
\sum_{I=1}^{NP} K_h (x - x_I; x) \Delta x_I &= 1 \\
\sum_{I=1}^{NP} \left(\frac{x - x_I}{h}\right) K_h (x - x_I; x) \Delta x_I &= 0 \\
&\vdotswithin{=} \\
q\sum_{I=1}^{NP} \left(\frac{x - x_I}{h}\right)^{\!n} K_h (x - x_I; x) \Delta x_I &= 0
\end{aligned}
\right\}
=
\left\{
\begin{aligned}
M_0 (x) &= 1 \tallstrut \\
M_1 (x) &= 1 \tallstrut \\
&\vdotswithin{=} \\
M_n (x) &= 1 \tallstrut
\end{aligned}
\right.
\end{equation}
\end{document}