7

I'm writing the transpose of a matrix that is denoted by a bold capital letter. This looks fine when the matrix is denoted by B, but when the matrix is denoted by A, the transpose superscript is too far away from the letter A. Here is a MWE to show what I mean:

\documentclass{article}
\usepackage{amssymb}

\begin{document}
\newcommand\T{{\hspace{-2pt}\intercal}}
\[
\mathbf{A}^\intercal,
\mathbf{B}^\intercal,
\mathbf{A}^\T,
\mathbf{B}^\T
\]
\end{document}

The output is:

enter image description here

One way to deal with this is to use \hspace to move the transpose superscript a little bit to the left, but this does not look good for B (as shown in the MWE). I could define two different transpose commands, one of which I would use for the transpose of A, and one for the transpose of B. But is there no more elegant and more efficient way of dealing with this?

1 Answer 1

6

Do you need bold roman? bm would give bold math italic without any extra grouping and give tighter spacing:

enter image description here

\documentclass{article}
\usepackage{amssymb,bm}

\begin{document}
\newcommand\T{{\hspace{-2pt}\intercal}}
\[
A^\intercal,
B^\intercal,
A^\T,
B^\T
\]
\[
\mathbf{A}^\intercal,
\mathbf{B}^\intercal,
\mathbf{A}^\T,
\mathbf{B}^\T
\]
\[
\bm{A}^\intercal,
\bm{B}^\intercal,
\bm{A}^\T,
\bm{B}^\T
\]
\end{document}

So if you do want bold roman, then I think you need to change the input syntax slightly and add kerns for each letter on a case by case basis:

enter image description here

\newcommand\TT[1]{%
  \mathbf{#1}%
  \def\tmp{#1}%
  \def\tmpA{A}%
  \ifx\tmp\tmpA\mkern-5mu\fi
  ^\intercal}

used as in:

\[
\TT{A},
\TT{B}
\]
6
  • Thanks, that's a clever solution. But yes, I prefer to have bold roman, if possible.
    – yori
    Commented Apr 25, 2012 at 19:07
  • Ah, either I missed the second part of your answer, or you added it later. This looks like an acceptable solution. It'd be nice if this could be done automatically somehow, based on font measurements? I don't know enough about how TeX handles these things to do that though. Thanks!
    – yori
    Commented Apr 25, 2012 at 21:26
  • sorry I edited it in in response to your comment, I thought the system would alert you. perhaps not? teX has little information about the glyph shape so it doesn't really "know" an A is different from a B. the math fonts have a limited amount of italic correction information tuned for script adjustment, but it often needs manual tweaks for absolute best quality and \mathbf uses a font designed for text use mainly so has nothing special for superscript positioning Commented Apr 25, 2012 at 21:35
  • I see, so what I'm asking is conceptually impossible. Thanks very much for clearing that up!
    – yori
    Commented Apr 25, 2012 at 22:35
  • Okay, one more question: somehow your solution does not seem to work if used inside a figure caption. Latex says "Undefined control sequence". Why is that? MWE: \documentclass{article} \usepackage{amssymb} \begin{document} \newcommand\TT[1]{% \mathbf{#1}% \def\tmp{#1}% \def\tmpA{A}% \ifx\tmp\tmpA\mkern-5mu\fi ^\intercal} \begin{figure} \caption{$\TT{A}$.} \end{figure} \end{document}
    – yori
    Commented Apr 25, 2012 at 23:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .