8

I am using the oubraces package to get overlapping over/underbraces in an equation. My equation is in the following MWE:

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{oubraces}
\begin{document}

\begin{equation}
\overunderbraces{&&\br{1}{\text{Diagonal in $k$-space}}&&\br{3}{\text{Diagonal in $x$-space}}}{i\hbar\frac{d\psi_n(x)}{dt}&=&-\frac{\hbar^2}{2m}\frac{\partial^2\psi_n(x)}{\partial x^2}&+&\frac{1}{2}m\omega^2x^2\psi_n(x)&+&f(x,t)\psi_n(x)}{&&\br{3}{\text{Diagonal in Hermite-Gauss basis}}&&\br{1}{\text{Diagonal in $x$-space}}}
\end{equation}

\end{document}

which produces this:

enter image description here

The fractions are compressed to smaller than the usual display math font size. How do I restore the full sized fonts?

  • 1
    Try \dfrac instead of \frac. – CarLaTeX Oct 19 at 5:19
  • Worked perfectly, thanks! (I'd give you the reputation boost for a correct answer, but I can't since it's just a comment?) – user502382 Oct 19 at 5:23
  • I'll add an answer, thanks. – CarLaTeX Oct 19 at 5:29
8

Just use \dfrac instead of \frac

If you like, you could add some \rules for increasing the vertical spacing.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{oubraces}

\begin{document}
Without \verb|\rule|:
\begin{equation}
\overunderbraces{&&\br{1}{\text{Diagonal in $k$-space}}&&\br{3}{\text{Diagonal in $x$-space}}}{i\hbar\dfrac{d\psi_n(x)}{dt}&=&-\dfrac{\hbar^2}{2m}\dfrac{\partial^2\psi_n(x)}{\partial x^2}&+&\dfrac{1}{2}m\omega^2x^2\psi_n(x)&+&f(x,t)\psi_n(x)}{&&\br{3}{\text{Diagonal in Hermite-Gauss basis}}&&\br{1}{\text{Diagonal in $x$-space}}}
\end{equation}
With \verb|\rule|:
\begin{equation}
\overunderbraces{&&\br{1}{\text{Diagonal in $k$-space}}&&\br{3}{\text{Diagonal in $x$-space}}}{i\hbar\dfrac{d\psi_n(x)}{dt}&=&\rule[-10pt]{0pt}{30pt}-\dfrac{\hbar^2}{2m}\dfrac{\partial^2\psi_n(x)}{\partial x^2}&+&\dfrac{1}{2}m\omega^2x^2\psi_n(x)&+&f(x,t)\psi_n(x)}{&&\br{3}{\text{\rule{0pt}{7pt}Diagonal in Hermite-Gauss basis}}&&\br{1}{\text{Diagonal in $x$-space}}}
\end{equation}

\end{document}

enter image description here

  • Short answer deserves a +1! – manooooh Oct 19 at 5:45
  • @manooooh Thank you, lol! – CarLaTeX Oct 19 at 5:47
5

You can patch \overunderbraces to use \displaystyle for the main formula when in a display environment (equation, align and so on), checking for \if@display that's provided by amsmath.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{oubraces}
\usepackage{etoolbox}

\makeatletter
\patchcmd{\overunderbraces}
  {&\hfil$}
  {&\hfil$\if@display\displaystyle\fi}
  {}{}
\patchcmd{\overunderbraces}
  {&\hfil${}}
  {&\hfil$\if@display\displaystyle\fi{}}
  {}{}
\makeatother


\begin{document}

\begin{equation}
\overunderbraces{%
  &&\br{1}{\text{Diagonal in $k$-space}}%
  &&\br{3}{\text{Diagonal in $x$-space}}%
}{%
  i\hbar\frac{d\psi_n(x)}{dt}%
  &=%
  &-\frac{\hbar^2}{2m}\frac{\partial^2\psi_n(x)}{\partial x^2}%
  &+%
  &\frac{1}{2}m\omega^2x^2\psi_n(x)
  &+
  &f(x,t)\psi_n(x)%
}{%
  &&\br{3}{\text{Diagonal in Hermite-Gauss basis}}%
  &&\br{1}{\text{Diagonal in $x$-space}}%
}
\end{equation}

\end{document}

Note that I used {-} after the & in order to fix the spacing.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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