修复使用 newtxtext、newtxmath 和 mathtools 时下划线标签的垂直间距错误

修复使用 newtxtext、newtxmath 和 mathtools 时下划线标签的垂直间距错误

喂食

\documentclass{article}
\pagestyle{empty}
\usepackage{newtxtext,newtxmath}
\usepackage{mathtools}
\begin{document}
For an arbitrary $n\in M^B$ we have $\varphi_M(\underbrace{\langle 0\rangle {}^{\circ}\dotsb{}^{\circ}\langle 0\rangle }_{n\ \text{times}}) = n$; hence, $\varphi_M$ is onto.
Since $\varphi_{\mathrm{Bool}}$ is also onto as an indentity, $\varphi$ is even an epimorphism (see reference so-and-so).
\end{document}

导致pdflatex

编译结果垂直间距不好

如你所见,括号 ⏟ 和括号标签之间的垂直间隙 "

答案1

在这里,我重新定义了\underbrace,但我建议给它自己起一个名字,如\altunderbrace(目前,原始定义保存在 中\svunderbrace)。我将括号本身向上移动2pt,并将括号标签向上移动一个3pt。不确定这样做是否会破坏其他任何东西。

\documentclass{article}
\pagestyle{empty}
\usepackage{newtxtext,newtxmath}
\usepackage{mathtools}
\let\svunderbrace\underbrace
\renewcommand\underbrace[1]{\setbox0=\hbox{$#1$}\dp0=\dimexpr\dp0-2pt\relax
  \setbox2=\hbox{$\svunderbrace{\copy0}$}\dp2=\dimexpr\dp2-3pt\relax
  \mathop{\copy2}\limits}
\begin{document}
For an arbitrary $n\in M^B$ we have $\varphi_M(\underbrace{\langle 0\rangle
  {}^{\circ}\dotsb{}^{\circ}\langle 0\rangle }_{n\ \text{times}}) = n$; 
  hence, $\varphi_M$ is onto.
Since $\varphi_{\mathrm{Bool}}$ is also onto as an indentity, $\varphi$ is even an epimorphism (see reference so-and-so).
\end{document}

在此处输入图片描述

相关内容