3

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

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

This is the current output:enter image description here

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
3

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

enter image description here

\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} 
  • 1
    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
2

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

enter image description here

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.