I'd like to reduce the vertical space between the arrow and the symbol above it in the \xrightarrow command.
Of course, "hard-coding" a value leads to unfortunate results:
\documentclass{article}
\usepackage{mathtools}
\newcommand\myxrightarrow[1]{
\xrightarrow{\raisebox{-.5ex}[0pt][0pt]{\ensuremath{\scriptstyle#1}}}
}
\begin{document}
\(A \myxrightarrow{\theta} B\)
\(A \myxrightarrow{\theta_D'} B\)
\end{document}
gives
where the "D" is on the arrow line.
How can I adaptatively reduce this spacing?
I have read the documentation of the calc package and tried various formulas using heightof, but none was satisfactory (to say the least…).
This question is related to, but not solved by, https://tex.stackexchange.com/a/231918/34551.



\arrowfill"? I couldn't find anything documenting the various types of "\arrowfill" unfortunately. – Clément Dec 07 '23 at 23:10\fontdimen22, etc. – wipet Dec 08 '23 at 12:20amsmath.sty. I'm sure you will understand it as soon as you read the source. – egreg Dec 08 '23 at 17:01