I found a lots of questions asking how to add a superscript to a variable defined with a superscript but none for how to do it the other way around.
My macro is \newcommand{\trsp}[1]{#1^T}
and I want to apply it to e.g. \trsp{M^{-1}}
.
How do I avoid a Double Superscript error ?
\trsp
as{#1}^T
but that has some consequences on spacing in all cases. So alternative is to explicitly test or have a separate command for teh transposed inverse