I would like to draw a brace under part of a mathematical expression. I can do it using the command \braceB defined as follows:
\documentclass[parskip]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{positioning}
% Brace under an expression:
% #1: text of the expression
% #2: comment
\newcommand{\braceB}[3]{\begin{tikzpicture}
\node(expr){#1};\
\draw[decorate, decoration={brace,amplitude=2mm,mirror,raise=-1mm}] (expr.south west) -- (expr.south east);
\node[below=1mm of expr] (textnode) {\mbox{#2}};
\end{tikzpicture}}
\begin{document}
$1+2+\braceB{3+4}{Text under 3+4}+5+6$
\end{document}
My problem with this option is that:
- the text above the brace (3+4) is not aligned with the rest of the mathematical expression (1+2+ and +5+6);
- the length of the text under the brace "pushes" the rest of the expression left or right. More precisely, there are horizontal spaces between "1+2+" and "3" and between "4" and "+5+6" that I would like to remove.
Do you know how to solve these two problems?

\usepackage{mathtools}and$1+2+\underbrace{3+4}_{\mathclap{\text{Text under 3+4}}}+5+6$, see Oversized \underbrace's label causes unwanted spacing. – dexteritas Nov 29 '21 at 19:07