TransWikia.com

Gather multiple equations with curly bracket

TeX - LaTeX Asked by Amos Egel on April 1, 2021

I have two equations, both of which hold under the same condition (x<5):

begin{align}
f(x) &= sum_{n} a^i_j Psi_n(x) &text{for } x < 5
 g(x) &= sum_{n} b^i_j Phi_n(x) &text{for } x < 5
end{align} 

That code results in this output:

enter image description here

Now, what I would like to do is to gather both equations with a curly bracket and this way write the condition only once. I tried this:

begin{align}
left.
begin{array}{rl}
f(x) &= sum_{n} a^i_j Psi_n(x)
 g(x) &= sum_{n} b^i_j Phi_n(x)
end{array}
right} &text{ for } x < 5
end{align}

Which results in the following output:

enter image description here

However, this doesn’t look good to me: The equations are now too close to each other and the alignment of the left hand side with the equation marks is not convincing.

Do you have a hint how I can resolve that issue?

2 Answers

documentclass{article}
usepackage{mathtools}
begin{document}
begin{equation}
  begin{rcases}
    begin{aligned}
      f(x) &= sum_{n} a^i_j Psi_n(x) 
      g(x) &= sum_{n} b^i_j Phi_n(x)
    end{aligned}
  end{rcases} x < 5
end{equation}
end{document}

enter image description here

Correct answer by leandriis on April 1, 2021

Another easy solution with empheq enables two equation numbers:

documentclass{article}
usepackage{empheq} 

begin{document}

begin{spreadlines}{1.5ex}
begin{empheq}[right=empheqrbracetext{ for } x < 5]{align}
f(x) &= sum_{n} a^i_j Psi_n(x) 
 g(x) &= sum_{n} b^i_j Phi_n(x)
end{empheq}
end{spreadlines}

end{document} 

enter image description here

Answered by Bernard on April 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP