2

The current behavior when using \underbrace is the following (Tex inserts whitespace to avoid streching the text underneath the underbrace beneith the neighboring symbols): enter image description here

The behavior I want instead is the following: enter image description here

How can this be achieved?

EDIT: The code I used for this image is as follows

Y_{2,2}(\theta,\varphi) - Y_{2,-2}(\theta,\varphi) = \dfrac{2i}{\sqrt{4\pi}}\sqrt{\dfrac{15}{8}} \underbrace{\sin^2\theta\sin(2\varphi)}_{=\frac{1}{2}\sin^2\theta\sin\varphi\cos\varphi={\frac{1}{2}d_{xy}/C_{xy}}}
  • Hi! It would be nice if you provided the code you used to generate the top image so that we don't have to type it all out for you. You'll get your answer more quickly that way! :) – Au101 Nov 21 '16 at 00:44
  • ok, sure. Done! :) – Simon Fromme Nov 21 '16 at 00:48
  • 4
    Thanks! :) While you were doing that, I found this, does it help you? http://tex.stackexchange.com/questions/46308/oversized-underbraces-label-causes-unwanted-spacing – Au101 Nov 21 '16 at 00:49
  • Isn't it Υ (Upsilon) rather than Y? – Bernard Nov 21 '16 at 01:10
  • @Bernard I thought so too at first, but then I assumed it was probably the font, especially as it's an italic upper-case letter – Au101 Nov 21 '16 at 01:12
  • Yet the curved upper part… Anyway, I'm probably too pernickety, and that is not the main problem. – Bernard Nov 21 '16 at 01:16
  • The only embarrassing thing is that I didn't notice in time that the double angle relation is wrong and should be \sin(2\varphi)=2\sin\varphi\cos\varphi instead. It's an Y, the display is due to the font... – Simon Fromme Nov 21 '16 at 01:34

2 Answers2

4

Is this what you want? Using \mathclap from the mathtools package:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}

\[
  Y_{2, 2}(\theta, \varphi) - Y_{2, -2}(\theta, \varphi) =
  \frac{2i}{\sqrt{4\pi}} \sqrt{\dfrac{15}{8}}
  \underbrace{\sin^{2}\theta \sin(2\varphi)}_{\mathclap{= \frac{1}{2}
    \sin^{2}\theta \sin\varphi \cos\varphi = \frac{1}{2}d_{xy}/C_{xy}}}
\]

\end{document}

enter image description here

Au101
  • 10,278
  • Thanks! Yes mathtools seems to provide some really helpful macros. Didn't know about this before. – Simon Fromme Nov 21 '16 at 01:00
  • @SimonFromme Good good :) Glad to be of help. Hope you don't mind, but I've marked this question as duplicate to keep the site nice and tidy – Au101 Nov 21 '16 at 01:01
4

Use \mathclapfrom mathtools (needless to load amsmath in this case), and possibly \substack:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\[ \Upsilon_{2,2}(\theta,\varphi) - \Upsilon_{2,-2}(\theta,\varphi) = \dfrac{2i}{\sqrt{4\pi}}\sqrt{\dfrac{15}{8}} \underbrace{\sin^2\theta\sin(2\varphi)}_{\mathclap{=\frac{1}{2}\sin^2\theta\sin\varphi\cos\varphi = {\frac{1}{2}d_{xy}/C_{xy}}}} \]

\vspace{4ex}
\[ \Upsilon_{2,2}(\theta,\varphi) - \Upsilon_{2,-2}(\theta,\varphi) = \dfrac{2i}{\sqrt{4\pi}}\sqrt{\dfrac{15}{8}} \underbrace{\sin^2\theta\sin(2\varphi)}_{\substack{\mathclap{=\frac{1}{2}\sin^2\theta\sin\varphi \cos\varphi}\\=\frac{1}{2}d_{xy}/C_{xy}}} \]

\end{document} 

enter image description here

Bernard
  • 271,350