4

This question is essentially an extension of this question about how to place right braces around cases.

I want to have three equations, all aligned, but I want only the latter two of the equations to be grouped by a right brace. I've tried things like

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{aligned} \delta\psi&=i\beta\gamma^{5}\ . \delta\sigma&=2\beta\pi\ \delta\pi&=-2\beta\sigma \right\rbrace \end{aligned}

which obviously doesn't work, as the linked \left\. ... \right\rbrace can't work across the line break in the aligned environment.

Essentially, I want something like this

enter image description here

but the right brace only connecting the lower two equations.

Any help would be much appreciated!

LC400
  • 155
  • 3

2 Answers2

4

You can use nicematrix:

\documentclass{article}
\usepackage{amsmath}
\usepackage{nicematrix}

\begin{document}

[ \setlength{\arraycolsep}{0pt} \renewcommand{\arraystretch}{1.2} \begin{NiceArray}{r >{{}}c<{{}} l} \delta\psi &=& i\beta\gamma^{5} \ \delta\sigma &=& 2\beta\pi \ \delta\pi &=& -2\beta\sigma \CodeAfter\SubMatrix.{2-1}{3-3}} \end{NiceArray} ]

\end{document}

A couple LaTeX runs may be needed in order for the result to be final.

enter image description here

In this particular case, I find it more appealing to use left alignment for the first column: if you change the column specifications into

\begin{NiceArray}{l >{{}}c<{{}} l}

you get

enter image description here

What about text beside the brace? Here we need to better control the intercolumn spaces.

\documentclass{article}
\usepackage{amsmath}
\usepackage{nicematrix}

\begin{document}

[ \renewcommand{\arraystretch}{1.2} \begin{NiceArray}{ @{} l @{} >{{}}c<{{}} @{} l l @{} } \delta\psi &=& i\beta\gamma^{5} \ \delta\sigma &=& 2\beta\pi & \Block{2-1}{\text{whatever}}\ \delta\pi &=& -2\beta\sigma \CodeAfter\SubMatrix.{2-1}{3-3}} \end{NiceArray} ]

\end{document}

enter image description here

egreg
  • 1,121,712
  • Thank you! This is great, really neat, and exactly what I'm looking for. Just to add - say I wanted to add text to the right of the brace. How would I go about that? I'm not sure I fully understand the syntax of the nicematrix package – LC400 Nov 10 '21 at 10:05
  • 1
    @LC400 You want to add a block. I added the example. – egreg Nov 10 '21 at 10:13
2

You can hide the first row with a negative space (and compensate with a positive space elsewhere)

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

align\vspace{\baselineskip} [ \left. \begin{aligned} \noalign{\vspace{-\baselineskip}} \delta\psi&=i\beta\gamma^{5}\ \delta\sigma&=2\beta\pi\ \delta\pi&=-2\beta\sigma \end{aligned} \right\rbrace x ]

\end{document}

David Carlisle
  • 757,742