5

I would like to use double superscripts with parentheses but the result is not what I want it to be. I have

\documentclass[a4paper,pdftex]{article}
\usepackage{mathtools}

\begin{document}

$\textbf{A}^{{-1}^T}$

\end{document}

This puts the 'T' slightly above the '-1', as expected.

Now, if I put parentheses from 'A' to '-1', like

$(\textbf{A}^{-1})^{T}$

the 'T' is on the same height as '-1', which is not what I want. I would like it to be slightly above '-1' again, but I can't figure out how to put parenthesise and keep the 'T' as a double exponent. I hope the question was clear.

PS: How can I show the Tex result right away below the code?

  • 1
    To show the output you need to post an image, once you have enough rep to post image. But more importantly please always post complete examples that people can run to see the problem (eg \fat is not defined by default) – David Carlisle Nov 2 '15 at 14:33
  • 1
    If I had to choose, I'd prefer the T to be level with the –1: the parentheses take care of the meaning. – egreg Nov 2 '15 at 14:40
7

enter image description here

As it is it is just a superscript on the ) so unaffected by the inner superscript. If you enclose the term in {} then it is a superscript on the whole term and so affected by its height:

\def\fat#1{#1}

$(\fat{A}^{-1})^{T}$

${(\fat{A}^{-1})}^{T}$

\bye

To compare with the suggestion in comments to use {)} that does raise it a bit but doesn't take account of the inner term as can be seen by using an inner term with more height:

\def\fat#1{#1}

$({\fat{A}^{-1}}^2)^{T}$

${({\fat{A}^{-1}}^2)}^{T}$

$({\fat{A}^{-1}}^2{)}^{T}$

\bye

Note the middle T is the highest

enter image description here

  • You wrote, "As [T] is just a superscript on the ` )` [it is] unaffected by the inner superscript. If you enclose the term in {} then [T] is a superscript on the whole term and so affected by its height." If this were right, then there should be no difference in the heights of T in (a)^{T}, {(a)}^{T}, and (a{)}^{T}, as the material in parentheses is identical in all three cases. However, T is clearly set higher in 2nd and 3rd cases. Instead, I would have said that it matters for the vertical position of T if the atom that precedes it is of type "math-close" or "math-ord". – Mico Nov 2 '15 at 15:45
  • Is it my eyes or the vertical position of ) compared with -1is different in each case? – Sigur Nov 2 '15 at 15:51
  • 1
    @Sigur your eyes (or random pixel artefacts in the image) – David Carlisle Nov 2 '15 at 15:53
  • @Mico well what I wrote is right but not the whole truth, )^T is just using the bracket as base, and {...}^T uses the whole term as base. Other things such as math class of the base, and fontdimens and stuff also affect the final position. – David Carlisle Nov 2 '15 at 15:55
  • @Mico I updated my answer with a comparison of the two suggestions. – David Carlisle Nov 2 '15 at 16:01
5

A simple solution: Encase the closing round parenthesis, ), in a pair of curly braces: {)}. Doing so changes the status of the parenthesis from "math-close" to "math-ordinary", which influences the height of the subsequent T superscript.

enter image description here

\documentclass{article}
\begin{document}
$(\mathbf{A}^{\!-1})^{T}$
vs.\ 
$(\mathbf{A}^{\!-1}{)}^{T}$  % ")" is encased in curly braces
\end{document}

Note that I've inserted \! (negative thinspace) ahead of -1 in order to "snug up" the minus symbol to the term \mathbf{A}.

Addendum: If the material inside the round parentheses is taller than what's in the example you gave, e.g., if it's something like A^{b^c}, the vertical position of the trailing T superscript will be affected by whether you write the full expression as {(a^{b^c})}^T or as (a^{b^c}{)}^T. Specifically, the T superscript will be placed higher up in the former case.

  • Doesn't this break \left and \right if one wanted to use that? – CompuChip Nov 2 '15 at 22:24
  • @CompuChip - I'm afraid I don't understand your question/comment. My answer was focused on the OP's question and code, which -- to the best of my knowledge -- didn't feature \left or \right statements. – Mico Nov 2 '15 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.