5

I tried to solve the follwing problem for a while but couldn't find a solution yet. I would like to align two \rbraces vertically. This code

\begin{align}
  L = &\left. \text{short eq} \right\rbrace &&\text{description 1} \\
      &\left. \begin{aligned}
                \text{very long equation}\\
                \text{over multiple lines}
              \end{aligned}
       \right\rbrace &&\text{description 2}
\end{align} 

produces

enter image description here

However, I would like to adjust the braces that they are below each other

enter image description here

I hope someone can help me here. Thank you!

1
  • 1
    Welcome to TeX.SE!
    – Mico
    Feb 28 '19 at 18:12
3

Something like this?

enter image description here

\documentclass{article} 
\usepackage{amsmath} % for 'align' environment and '\text' macro
\newlength\mylen     % create a "length" variable
\settowidth\mylen{very long equation} % calculate default width of '\mybox'
\newcommand\mybox[2][\mylen]{\parbox{#1}{\raggedright #2}}

\begin{document}
\begin{align}
L = &\left.\mybox{short eq}\right\rbrace &&
     \text{description 1} \\
    &\left.\mybox{very long equation over multiple lines}\right\rbrace &&
     \text{description 2}
\end{align} 
\end{document}
3
  • Thank you, this looks already a lot better! Is it also possible to have a similar style of the braces? So far, the larger one is wider than the smaller one.
    – jani
    Feb 28 '19 at 18:28
  • @jani - The \right\rbrace is designed to increase in size both vertically and horizontally as the material to its left "grows". You have two cases of \right\rbrace: In the first, the material to the left occupies only one row, but in the second the material is two rows tall. The only sane way to make the two curly braces equally wide is to make them equally tall as well. (Well, one could "squish" a two-row curly brace into the height of just a "normal-height" curly brace, but the result would be even worse!) Do ask yourself: Do you really need those ugly curly braces to begin with?
    – Mico
    Feb 28 '19 at 20:28
  • The reason why they have different width is clear. I just thought there might be another way to define them. I agree that the curly braces are far from looking perfect but I need them for a better understanding in this case. Thanks again!
    – jani
    Mar 1 '19 at 7:08
2

How about something like this?

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

\begin{equation}
\begin{alignedat}{4}
 L = & \text{short eq } && \left. \text{ }  \right\rbrace  && \qquad \text{description 1} \\
     &\begin{aligned}
         &\text{22244 very long equation 5555}\\
         &\text{over multiple lines }
      \end{aligned} && \left. 
      \begin{aligned}
           \text{ }\\
           \text{ }
      \end{aligned}  \right\rbrace && \qquad \text{description 2}
\end{alignedat}
\end{equation}

\end{document}

It looks like this enter image description here

All the lines are treated as one equation. I borrowed the idea from the following post.

vertical alignment of multiline equations

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.