与 \underbrace 结合使用时正确定位右侧上标

与 \underbrace 结合使用时正确定位右侧上标

我有一个术语,它右侧需要下括号和转置符号作为上标。有三个选项\underbrace可以按什么顺序对命令及其相应的下标和上标进行编码。不幸的是,所有可能的组合都无法产生正确的印刷结果。有关详细信息,请参阅 MWE:

在此处输入图片描述

\documentclass{minimal}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath,amssymb}
\usepackage[utf8]{inputenc}

\newcommand{\Tr}{\ensuremath{\mathsf{T}}}

\begin{document}

Correct spacing without \verb!\underbrace!:
\begin{equation}
( a - b )^{\Tr}
\end{equation}

With \verb!\underbrace! and correct positioning of the \verb!\Tr!-symbol, but
actually the brace is supposed to embrace the inner term only:
\begin{equation}
\underbrace{( a - b )^{\Tr}}_{{} = c}
\end{equation}

The \verb!\underbrace! includes the correct part of the term, but the
\verb!\Tr!-symbol is now misplaced above the term
\begin{equation}
\underbrace{( a - b )}_{{} = c}^{\Tr}
\end{equation}

With an additional pair of \verb!{}! the result is nearly correct, but the
\verb!\Tr!-symbol is placed too high in comparison without any
\verb!\underbrace!:
\begin{equation}
{\underbrace{( a - b )}_{{} = c}}^{\Tr}
\end{equation}

The latter is visually disturbing if there is a mixed sequence of terms
with and without \verb!\underbrace! and varying height of the
\verb!\Tr!-symbol:
\begin{equation}
( a - b )^{\Tr} {\underbrace{( c - d )}_{{} = c}}^{\Tr} ( e - f )^{\Tr}
\end{equation}

\end{document}

答案1

{}在前面放置一个空白,例如{}^{\Tr}

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath,amssymb}
\usepackage[utf8]{inputenc}

\newcommand{\Tr}{\mathsf{T}}

\begin{document}

\begin{equation}
( a - b )^{\Tr} {\underbrace{( c - d )}_{= c}}{}^{\Tr} ( e - f )^{\Tr}
\end{equation}

\end{document}

在此处输入图片描述

答案2

我建议您使用\cramped软件包提供的宏mathtools来完成这项工作。左侧项没有下括号,其转置信号位于所需高度。中间项将转置符号置于略高的位置。使用 (\cramped如右侧所示)可实现您的目标。

在此处输入图片描述

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern,mathtools}
\newcommand{\Tr}{\mathsf{T}}
\begin{document}
\[
( a - b )^{\Tr} \text{ vs }
{\underbrace{( a - b )}_{{} = c}}^{\Tr} \text{ vs }
\cramped{\underbrace{( a - b )}_{{} = c}}^{\Tr}
\]
\end{document}

相关内容