TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


share|improve this question

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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
up vote 7 down vote accepted

I suppose this is what you want:

enter image description here

Here is the exact code:


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:

  & \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}

enter image description here

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.

share|improve this answer
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:

\usepackage{lipsum} % just for the example





The second example shows the problem with the simple smashing.

enter image description here

share|improve this answer

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:

enter image description here


  • 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.



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

% Tweak these as necessary

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

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


share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.