![使用 \raisebox 更改嵌套下划线](https://linux22.com/image/418867/%E4%BD%BF%E7%94%A8%20%5Craisebox%20%E6%9B%B4%E6%94%B9%E5%B5%8C%E5%A5%97%E4%B8%8B%E5%88%92%E7%BA%BF.png)
这是我上一个问题的后续如何在下划线内提高下划线?我确实找到了解决方案。我的问题是,我如何预测我输入的值\raisebox
来调整下划线的高度?目前,我完全靠眼睛来做,并在 PDF 查看器中放大查看结果。总体目标是让较长的下划线“槽”始终具有相同的高度。
这是我的 MWE 及其输出。
\documentclass{article}
\usepackage{xparse}
\NewDocumentCommand{\slot}{ s O{} }{%
\IfBooleanTF {#1} % check for *
{% * doesn't print a filled slot.
%\,\smash{\makebox[1.5em]{\ensuremath{#2}}}\,
{\,\makebox[2.0em]{\ensuremath{#2}}\,}
}%
{% Print a filled slot by default, a la Thorne and Blandford.
%\,\underline{\smash{\makebox[1.5em]{\ensuremath{#2}}}}\,
%\,\underline{\makebox[2.0em]{\ensuremath{#2}}}\,
\,\underline{\makebox[2.0em]{\ensuremath{\raisebox{0.5pt}{\ensuremath{#2}}}}}\,
}%
}%
%\newcommand*{\smallslot}{\,\underline{\smash{\makebox[0.04em]{\ensuremath{~}}}}\,}
%\newcommand*{\smallslot}{\,\underline{\makebox[0.80em]{\ensuremath{}}}\,}
%\newcommand*{\smallslot}{\,\underline{\makebox[0.50em]{\ensuremath{}}}\,}
\newcommand*{\smallslot}{\raisebox{2.3pt}{(\,\underline{\makebox[0.53em]{\ensuremath{}}}\,)}}
\begin{document}
\[
\mathbf{a}(\slot) \quad
\mathbf{a}(\slot[\raisebox{0.5pt}{\ensuremath{\mathbf{b}}}]) \quad
\mathbf{a}(\slot[\mathbf{b}\smallslot]) \quad
\mathbf{a}(\slot[\mathbf{b}\smallslot])
\]
\[
\mathbf{T}(\slot,\slot) \quad
%\mathbf{T}(\slot[\raisebox{0.5pt}{\ensuremath{\mathbf{b}}}],\slot) \quad
\mathbf{T}(\slot[\mathbf{b}],\slot) \quad
\mathbf{T}(\slot[\mathbf{b}\smallslot],\slot) \quad
%\mathbf{T}(\slot[\mathbf{b}\smallslot]\slot)
\]
\end{document}