Let us assume that in all fonts you are using the transpose operator ⊤ has form similar to the Latin letter T in Computer Modern. How on earth do I move ⊤ to the left, and, if necessary, down, automatically? On the one hand, ⊤ could be moved slightly to the left in $W^{\top}T^{\top}M^{\top}$, but not too much. On the other hand, the vertical and horizontal spacing between the letter and the following ⊤ in $A^{\top} L^{\top} u^{\top} w^{\top}$ is horribly large:

transposing different symbols

In other words, I need a universal macro, say, \transpose{stuff} that would automatically take care of placing the down tack symbol as a right superscript of stuff but not wasting space. Of course, "universal" is not well-defined; we just want that the macro does the right job for as many fonts and letters as possible. (An aside: the known mitigation attempt uses fixed horizontal length -1\mu and no vertical space change. This is not good enough for me.)

My attempts to do horizontal and vertical spacing at the same time with LaTeX3 have no visible effect. In my example below, tl_case does not work as I expect, e.g., \transpose{u} is the same as u^{\top} (which should not be the case):

\tl_set:Nn \l_tl_lastTokenOfList {\tl_item:nn {#1} {-1}}
  #1^{\tl_case:NnTF \l_tl_lastTokenOfList
       { {A}{\mkern-3mu\top}
  • 1
    The problem is that while it could be kerned substantially left as a superscript, that is not the case as a subscript. I am not sure that different kerning is normal/possible for sub versus superscripts. In cases like this, I tend to define an alternate version, \def\alttop{\!\top} and then manually employ it where appropriate. Jun 6, 2016 at 13:15
  • I have used \transpose{A} and then in the definition of \trankspose I used xstring (I think) to test the end of the string and adjust those combinations that needed adjustment.
    – daleif
    Jun 6, 2016 at 13:16
  • @Mico please reopen this question, IMO that the question is not the same and my proposed solution is definitely not the same
    – daleif
    Jun 6, 2016 at 13:27
  • @daleif - Done.
    – Mico
    Jun 6, 2016 at 13:27
  • 1
    @StevenB.Segletes diffferent kerns are possible: compare $P_0$ $P^0$ where a subscript on P is tucked in but a superscript not. Jun 8, 2016 at 8:35

1 Answer 1


Here is my take on it, the idea is to use xstring to look at the last character in the input and then adjust accordingly. The positive thing here is of course that we can adjust this from the preamble. Of course things like \big) is not something that can be catched with this method.


% Caveat \transpose{ A } is not allowed as we cannot see the A at the
% end because of the trailing space
  % define more if needed


enter image description here


You must log in to answer this question.