We can create horizontal braces with commands \overbrace and \underbrace.
When we want to create alternate braces, we can do like this:
$$\rlap{$\overbrace{\phantom{a+b}}$}a+\underbrace{b+c}$$
But if I want to create more braces, or if the formula inside is very long, this method will quickly becomes complicated. Are there any better ways to do this?
Also, when the text in the brace is too long, there will be space around the bracketed text:
$$a+\underbrace{b}_\text{Lorem ipsum dolor sit amet}+c$$
which is quite ugly.
If I want to eliminate the spaces or let it make new lines automatically, what should I do?
Providing better methods and introducing new packages are both appreciated.
\[…\]preferable to$$? – Werner Feb 11 '23 at 16:35