# matching braces from one case to another

How would you match the lines between two cases within the same equation environment? What I'm having is:

$$\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}$$


This is the current output:

Now I want to match the rows of the cases on the left with those on the right. I could do something ugly like adding \vspace, but is there a more elegant way of doing it?

• I think that \\q should be \\ (no q). – egreg Sep 10 '18 at 22:00
• @egreg yep that's a typo that I only spotted a bit too late... :( – Quang Thinh Ha Sep 10 '18 at 22:01

If you want <stuffB> to have the same height as <stuffA>, use \vphantom{<stuffA>}<stuffB>:

\documentclass{article}

\usepackage{mathtools,array}

\begin{document}

$$\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{document}

• You may want to suppress the whitespace padding on the sides of the array environments. That way, the tall curly braces will be typeset more snuggly to their respective array environments. – Mico Sep 10 '18 at 21:44

Here's a solution that uses two aligned environments, as well as (typographic) struts.

\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}
\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{document}