oubraces 包中的常规字体

oubraces 包中的常规字体

我正在使用 oubraces 包来获取方程式中重叠的上括号/下括号。我的方程式如下 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}

结果是:

在此处输入图片描述

分数被压缩到比通常显示的数学字体大小还小。如何恢复全尺寸字体?

答案1

只需使用\dfrac即可\frac

如果您愿意,可以添加一些\rules 来增加垂直间距。

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

在此处输入图片描述

答案2

您可以在显示环境中(,等等)修补\overunderbraces要使用的主要公式,并检查 是否提供了该公式。\displaystyleequationalign\if@displayamsmath

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

请注意,我{-}在之后使用了&为了修复间距。

在此处输入图片描述

相关内容