[Tex/LaTex] transpose and dot superscripts spacing

spacingsuperscripts

I would like that the transpose in the following has the same height in both examples, is there a possibility to make the transpose sign ignore the boxes above the charater?

\documentclass{article} 
\usepackage{amsmath} 
\begin{document} 

\newcommand{\vect}[1]{\mathbf{#1}}
\newcommand{\vA}{\vect{A}}
\newcommand{\dvect}[1]{\vect{\dot{#1}}}

\begin{align}
    {_\mathrm{K}}\dvect{\hat{\vA}}^\top \quad {_\mathrm{K}}\dvect{\vA}^\top \quad\quad {_\mathrm{K}}\vA^\top
\end{align}
\end{document}
    {_\mathrm{K}}\dvect{\vA}^\top \quad {_\mathrm{K}}\vA^\top
\end{align}
\end{document}

enter image description here

Best Answer

I suggest you create a dedicated macro called, say, \tran to act as the transpose operator. It's no problem to set it up in such a way that its height above the baseline is invariant to what characters may precede it.

If you want to use the \top symbol to denote the transpose, I would suggest you reduce its size via a \scriptscriptstyle directive.

Depending on the math font family you use, you want to fine-tune the spacing adjustments made before and after the transpose symbol.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\newcommand{\vect}[1]{\mathbf{#1}}
\newcommand{\vA}{\vect{A}}
\newcommand{\dvect}[1]{\vect{\dot{#1}}}

% "\tran": transpose operator
\newcommand\tran{\mkern-1mu{}_{}^{\scriptscriptstyle\top}\mkern-4mu}

\begin{document}
    \begin{align*}
    &{_\mathrm{K}}\dvect{\hat{\vA}}^\top \quad {_\mathrm{K}}\dvect{\vA}^\top \quad
     {_\mathrm{K}}\vA^\top \quad
     \Gamma^{\top}\Gamma \quad H^{\top}H \\
    &{_\mathrm{K}}\dvect{\hat{\vA}}\tran \quad
     {_\mathrm{K}}\dvect{\vA}\tran \quad
     {_\mathrm{K}}\vA\tran \quad
     \Gamma\tran \Gamma \quad H\tran H
     \end{align*}
\end{document}

Addendum: If you wanted to (a) raise the transpose symbol a bit more relative to the example code above and (b) shift it a bit more to the left (so that it's closer to the symbol that precedes, you might use the following version of the \tran macro:

\newcommand\tran{\mkern-2mu\raise1.25ex\hbox{$\scriptscriptstyle\top$}\mkern-3.5mu}

Relative to the version shown in the MWE, the symbol is shifted 1mu (equivalent to one third of a thin-space) more to the left, and it's also placed a bit higher up.