6

I don't think the following equation looks good because of the existence of the \underbrace.

\documentclass[preview,border=12pt,varwidth]{standalone}
\usepackage{amsmath}
\begin{document}
\[
12\left(\underbrace{y^2 +2y\left(-\frac{2}{3}\right) +\left(-\frac{2}{3}\right)^2}_{\left[y+\left(-\frac{2}{3}\right)\right]^2} -\left(-\frac{2}{3}\right)^2 +\frac{4}{5}\right) = 0
\]
\end{document}

enter image description here

Is there another style to make an \underbrace in big braces look elegant? I want to pull the underbrace out of the braces.

1 Answers1

8

Instead of using \left( and \right) to auto-size the outermost set of parentheses, you could use \biggl( and \biggr):

enter image description here

(Aside: See the postings Why the control sequences \bigl, \biggl, \bigr or \biggr, as I can always use \big or \bigg? and Difference between \big[ and \bigl[ for a discussion of the differences between \Bigg( and \Biggl(.)

I would recommend, actually, using \Biggl[ (while adding \, immediately afterwards) and \Biggr] to provide a bit more -- but not too much... -- visual prominence as well as variety to the outer fences:

enter image description here

The default LaTeX/amsmath style for underbraces frankly looks quite boring to me. If you have access to the mtpro2 package, you could use its macro \undercbrace to generate a curly underbrace. Cautions: (i) The font used by this package is Times Roman, which may or may not be to your liking. (ii) The mtpro2 package isn't free of charge; however, its "lite" subset, which is all that's needed to use the \undercbrace macro, can be obtained without (financial) charge.

enter image description here

\documentclass[preview,border=12pt,varwidth]{standalone}
\usepackage{amsmath}
\usepackage[lite]{mtpro2}
\begin{document}
\[
12\Biggl[\,\undercbrace{y^2 +2y\left(-\frac{2}{3}\right) +\left(-\frac{2}{3}\right)^2}_{\left[y+\left(-\frac{2}{3}\right)\right]^2}{} -\left(-\frac{2}{3}\right)^2 +\frac{4}{5}\Biggr] = 0
\]
\end{document}

Addendum: The immediately preceding example is intended mainly to demonstrate the shape of the "curly" underbrace. Thus, the only changes, relative to the code used in the second example, were in loading the mtpro2 package and using \undercbrace instead of \underbrace.

If you're serious about using the mtpro2 package, I would recommend making a few additional changes to the code. Chief among them are these: (i) load the mleftright package and execute \mleftright in the preamble to eliminate the extra horizontal whitespace that's otherwise inserted by \left and \right; (ii) don't insert a thinspace after \Biggl[; and (iii) insert a negative thinspace (\!) after the undercbrace material.

enter image description here

\documentclass[preview,border=12pt,varwidth]{standalone}
\usepackage{amsmath}
\usepackage{mleftright}\mleftright
\usepackage[lite]{mtpro2}
\begin{document}
\[
12\Biggl[ \undercbrace{y^2 +2y\left(-\frac{2}{3}\right) 
  +\left(-\frac{2}{3}\right)^2}_{
   \left[y+\left(-\frac{2}{3}\right)\right]^2} \! {}
  -\left(-\frac{2}{3}\right)^2 +\frac{4}{5}\Biggr] = 0
\]
\end{document}
Mico
  • 506,678
  • Is it necessary to add \, right before the \Biggr] to preserve the symmetric spaces? I don't like asymmetric properties. – kiss my armpit Nov 10 '13 at 07:55
  • @Marienplatz - I don't think it's necessary to do so from a purely aesthetic point of view; your sensibilities, though, may differ from mine... The reason why I inserted a thinspace after \Biggl[ was to keep the bottom "hook" of the square bracket from touching the underbrace. – Mico Nov 10 '13 at 08:00
  • The space between [ and the y seems to be a bit too much. The brace also interferes with the space at the end before the minus sign. I’d rather use the original brace … – Qrrbrbirlbel Nov 10 '13 at 11:01
  • @Qrrbrbirlbel - The example using \undercbrace was intended to demonstrate the interesting shape of the "curly" underbrace, and left the other settings, relative to the middle example, unchanged. I'll post a fourth example with the layout optimized for the capabilities of the mtpro2 package. – Mico Nov 10 '13 at 11:12
  • not sure why, but with the mtpro2 brace (and times font) the notation below the brace is noticeably farther below the main expression. the extra space surely isn't needed. – barbara beeton Nov 10 '13 at 13:18
  • What's the difference between \Biggl[ and \Bigg[? – Chris Chudzicki Nov 10 '13 at 14:31
  • @mrc - May I suggest you repost your comment as a full new question? That way, more people will get to see it and to provide answers. Thanks. – Mico Nov 10 '13 at 16:46
  • @Mico I would, but I think I was being lazy before: http://tex.stackexchange.com/questions/19480/why-the-control-sequences-bigl-biggl-bigr-or-biggr-as-i-can-always-use-b . . . – Chris Chudzicki Nov 10 '13 at 17:03