I am trying to use latex to write the below. The code I have makes the underbrace contained in the square root so the square root symbol is larger, but I want it like it is in the bottom picture. This is what I have:

enter image description here

This is what I want:

enter image description here

Here is my code:

$ \sqrt{\underbrace{\overline{xx\cdots x}}_{2n}-
        \underbrace{\overline{yy\cdots y}}_{n}}=
  \underbrace{\overline{zz\cdots z}}_{n}$

marked as duplicate by Werner, Stefan Pinnow, Svend Tveskæg, egreg equations May 10 '16 at 21:41

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.

  • Welcome to TeX.SE! Please post the code you've tried so far. – Mico May 10 '16 at 20:39

Encasing the argument of \sqrt macro in a \smash[b]{...} macro gets the stated job done.

In addition, I think it's important to make sure that the three underbraces are all at the same depth. This may achieved by inserting \vphantom{y} in the xx and zz groups.

For the finishing touch, I'd extend the square root's horizontal bar ever so slightly before \overline{xx...x} and beyond \overline{yy...y}, and I'd place empty "math atoms" around the - and = symbols to improve the horizontal spacing. (For some reason, the presence of the \underbraces interferes with the normal spacing around objects of type mathbin (-) and mathrel (=).)

enter image description here

\usepackage{amsmath} % for '\smash[b]' macro
\setlength\textwidth{2in} % just for this example
some text before \dots  % filler text
   \underbrace{\overline{\vphantom{y}xx\cdots x}}_{2n}
   \underbrace{\overline{yy\cdots y}}_{n}}\,}
   \underbrace{\overline{\vphantom{y}zz\cdots z}}_{n}
some text after \dots  % filler text
  • Hmmm... I don't understand how you could vote to "keep open" this question when it's clearly a duplicate. You're using the same technique in this answer as you in the suggested duplicate (answer). Just an observation... – Werner May 10 '16 at 21:31
  • @Werner - I think this question has not one but two issues that need to be solved. First, there's the stated issue about the depth of the surd. The unstated but nevertheless also interesting issue is the equalizing the depths of the three underbraces. – Mico May 10 '16 at 21:35

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