# How to ignore the underbrace{}{} in a square root? [duplicate]

I want to keep the size of the square root unchanged without putting the underbrace outside

\sqrt{\underbrace{=A}{B}}

-

## marked as duplicate by Mico, cmhughes, Guido, barbara beeton, JubobsMay 8 '14 at 21:31

Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Christian Hupfer May 8 '14 at 17:22
Try \sqrt{\vphantom{B}\smash{\underbrace{=A}{B}}}. – Werner May 8 '14 at 17:30
Thanks Werner, it did work. @Hupfter obviously not relevant! – user39158 May 8 '14 at 17:52
@user39158: A MWE is never irrelevant ;-) – Christian Hupfer May 8 '14 at 17:57

I suppose this is what you want:

Here is the exact code:

\sqrt{\smash[b]{{\underbrace{B}_{=A}}}}


However the square root symbol is wider than if there were no underbrace if the "B" part is too small. In such case one has to do some (limited) manual adjustment because the square root symbol must not be too close from the underbrace. All this is illustrated with the following code:

  \begin{align*}
& \sqrt{\smash[b]{{\underbrace{B + C + D}_{=A}}}}\qquad \sqrt{B + C + D}\4ex] & \sqrt{B}\qquad \sqrt{\mskip-6mu \smash[b]{{\underbrace{B}_{=A}}}\mskip-6mu} \end{align*}  Moreover, as pointed by @egreg, smashing can cause a problem with vertical spacing with the following text, so one should add, as he did in his answer, a \vphantom of the unsmashed square root, hence the creation of macro in order to make typing less painful — and the code clearer. - In the image provided, the \sqrt symbol sure looks bigger than it needs to be with just the B (without the underbrace). – Peter Grill May 8 '14 at 17:53 The line below the one with the smashed box will be too near. – egreg May 8 '14 at 18:00 @egreg: I supposed it was used in a display formula, in which case it may be unimportant. But you're — strictly speaking onze should add a \vphantom. – Bernard May 8 '14 at 18:19 @petergrill: actually it does look bigger because what's over the underbrace is too small. The underbrace seems to have a minimal size, so that in such a case, one has to do some manual adjustment. – Bernard May 8 '14 at 18:24 As you see from my example, it is important. – egreg May 8 '14 at 18:25 Smashing the radicand is not sufficient. Here's a working version: \documentclass{article} \usepackage{amsmath} \usepackage{lipsum} % just for the example \newcommand{\smashedsqrt}[2][]{% \vphantom{#2}% \sqrt[#1]{\smash[b]{#2}}% } \begin{document} \lipsum*[3] \[ \smashedsqrt{\underbrace{B}_{=A}}
\lipsum*[3]
$\sqrt{\smash[b]{\underbrace{B}_{=A}}}$
\lipsum[3]

\end{document}


The second example shows the problem with the simple smashing.

-

Here is an adaptation of Typesetting 144...4 with "n times" under the 4's is easy, but what about \sqrt{144...4}?, and note that the size of the \sqrt symbol is not affected by the underbrace:

## Note:

• This does require two runs. First one to determine the locations, and the second to do the drawing.

• The \tikzmark is from Adding a large brace next to a body of text.

• As this is a tikz solution, all the inherent drawing capabilities are available - shown here is just the color of the brace and the text, but many more options are available.

## Code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{lipsum}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathreplacing}

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

% Tweak these as necessary
\newcommand*{\BraceAmplitude}{0.25em}%
\newcommand*{\VerticalOffset}{0.4ex}%
\newcommand*{\HorizontalOffset}{0.12em}%
\newcommand*{\SquareBraceVOffset}{-0.4ex}%

\newcommand*{\InsertUnderBrace}[4][]{%
\begin{tikzpicture}[overlay,remember picture]
\draw [decoration={brace,amplitude=\BraceAmplitude},decorate, thick,draw=blue,text=black,#1]
($(#3)+(\HorizontalOffset,-\VerticalOffset)$) --
($(#2)+(-\HorizontalOffset,-\VerticalOffset)$)
node [below=\VerticalOffset, midway] {#4};
\end{tikzpicture}%
}%

\newcommand*{\InsertUnderSquareBrace}[4][]{%
\begin{tikzpicture}[overlay,remember picture]
\draw [text=black,line width=0.7pt, #1]
($(#3)+(\HorizontalOffset,\VerticalOffset+\SquareBraceVOffset)$) --
($(#3)+(\HorizontalOffset,-\VerticalOffset+\SquareBraceVOffset)$) --
($(#2)+(-\HorizontalOffset,-\VerticalOffset+\SquareBraceVOffset)$)
node [below, midway] {#4} --
($(#2)+(-\HorizontalOffset,\VerticalOffset+\SquareBraceVOffset)$);
\end{tikzpicture}%
}%

\begin{document}
\lipsum[1]
$\sqrt{\tikzmark{StartBraceA}B\tikzmark{EndBraceA}\,} \hspace*{4.0em} \sqrt{\tikzmark{StartBraceB}B\tikzmark{EndBraceB}\,}$
\InsertUnderBrace[draw=red,text=blue]{StartBraceA}{EndBraceA}{$=A$}
\InsertUnderSquareBrace[draw=red,text=blue]{StartBraceB}{EndBraceB}{$=A$}

\lipsum[2]
\end{document}

-