& in underbrace in aligned

21 views
Skip to first unread message

Andrew Murdza

unread,
Aug 19, 2025, 4:46:16 PMAug 19
to MathJax Users
Is there a way to use & in underbrace in aligned?

Davide Cervone

unread,
Aug 21, 2025, 8:33:51 AMAug 21
to mathja...@googlegroups.com
You could handle this situation in a similar way to what I suggested for your question about classes, but in this case, you would set up an underbrace of the correct width for the row and use \rlap to draw it under the actual row.  Something like

\newcommand{\rowUnderbrace}[1]{\rowUnderbraceParts#1\endparts#1}
\def\rowUnderbraceParts#1&#2\endparts{\rlap{\underbrace{\phantom{#1#2}}}}

will make

\begin{aligned}
\rowUnderbrace{a&=b+c}\\
&=c+d\\
\end{aligned}

show an underbrace under the first row.

Of course, you may want to have a label under the underbrace, and you could add that as an additional argument.  It would be nice to be able to make that an optional argument, and that is possible with a little more work.

\newcommand{\rowUnderbrace}[2][\arg{}]{\rowUnderbraceParts#1\arg_\parts#2\endparts#2}
\def\rowUnderbraceParts#1\arg#2#3\parts#4&#5\endparts{\rlap{\underbrace{\phantom{#4#5}}#2{#1}}}

adds an extra optional argument that will provide a label under the brace

\begin{aligned}
\rowUnderbrace[\text{a label}]{a&=b+c}\\
&=c+d\\
\end{aligned}

I will leave you to plumb the depths of these definitions to see how they work.

Davide


On Aug 19, 2025, at 4:46 PM, Andrew Murdza <andrew...@gmail.com> wrote:

Is there a way to use & in underbrace in aligned?

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mathjax-users/fc4b7fea-225a-4f03-8759-00f49a0ae9bfn%40googlegroups.com.

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages