260

What is the best or most popular symbol for vector/matrix transpose? I have used simply ^T, for example $c^T x$. I think it is ugly, mainly because it is a little too big compared with vector variables usually denoted by lower-case characters. Can you suggest a better one?

Chang
  • 9,528
  • 2
    Why does it look ugly? Too big? Too high? Too what? – Werner Oct 05 '11 at 22:16
  • 18
    That's exactly what I use! :) – egreg Oct 05 '11 at 22:18
  • Perhaps it is too big. I usually use lower-case characters to denote vectors. With the upper-case ^T, it looks quite ugly. But, I don't like the lower-case ^t. – Chang Oct 05 '11 at 22:20
  • 38
    I use M^\top. (For orthocomplements of vector spaces, I similarly use V^\bot.) Using T or t as a superscript is problematic in disciplines where they are modestly likely to occur as an actual variable, especially one which might occur in an exponent. I choose \top and \bot because they are more obviously abstract symbols, and not variables. – Niel de Beaudrap Oct 05 '11 at 22:21
  • 1
    @Chang: If "too big" is a problem, what about $c^T=c^{\scriptscriptstyle T}$. You can define a macro \newcommand{\transpose}[1]{\ensuremath{#1^{\scriptscriptstyle T}}} and use \transpose{c}. But, size isn't everything... – Werner Oct 05 '11 at 22:25
  • 2
    (Incidentally, while I am opinionated on this subject, the very fact that it is strongly subject to opinion makes it a somewhat questionable topic for a StackExchange site...) – Niel de Beaudrap Oct 05 '11 at 22:25
  • @NieldeBeaudrap I understand that there is no absolutely correct "answer" for this type of questions. If I am interested in other people's choice or taste, where should I ask? community wiki? – Chang Oct 05 '11 at 22:34
  • @Caramdir I revised the question a little. Well, because I asked about the most popular choice, wouldn't I be asking a fact, although it would be very hard to answer? – Chang Oct 05 '11 at 22:38
  • @Chang: Perhaps ask on chat? Alternatively, you can fish for ideas by searching online (as a matter of opinionated notation, no doubt people have been writing about it since at least 1995), or fish for ideas by checking out DeTeXify or the Comprehensive LaTeX symbol list. As for popularity being a fact, well... it's not exactly a fact of solid character. – Niel de Beaudrap Oct 05 '11 at 22:40
  • In most cases, I just use a prime : A'. Except if you already use this for derivation, I would advice for this minimalist symbol. – M. Toya Jul 16 '12 at 16:48

12 Answers12

204

It's always difficult to answer questions for "the best" or "most popular". As is mentioned, these are typically opinions. But you did say that your objection was the fact that the "T" symbol was too big. Therefore, I would recommend the \intercal symbol to produce a "T" which isn't so big. Also, writing the vectors and matrices in bold seems, in my opinion, to make it look a little better. Try the following code:

\documentclass{article}
\usepackage{amsmath,amsfonts,amssymb}
\begin{document}
$\mathbf{A}^\intercal$\\
$\mathbf{c}^\intercal \mathbf{x}$\\
$c^T x$\\
$\mathbf{M}^\top$
\end{document}

Screenshot from example above

DJP
  • 12,451
  • 29
    It is better to use \mathbf rather than \textbf – Aditya Jul 16 '12 at 21:11
  • 9
    An even better to defin a new command in sense of logical markup, i.e. use \vec and define \newcommand{\mtrx}[1]{\mathbf{#1}} – Tobi Aug 13 '13 at 22:32
  • 23
    And even even better to use \bm instead of \mathbf. 'Cause, you know, you never know what stupidly exotic symbol you might one day use as a matrix or vector to impress your supervisor, colleague, or yourself ;) (and in fact, \mathbf can't even handle Greek letters which aren't that exotic after all). – Christian Jan 05 '14 at 01:29
  • 5
    This advice was great. To use \bm, just add the bm package to the preamble of the document. – jespestana Nov 12 '15 at 13:25
  • I can't see any improvement by using \bm or \mathbf – skan Dec 13 '15 at 16:14
  • 14
    How do I remember this symbol? Why is it called \intercal? – Chris Chudzicki May 26 '16 at 12:58
  • 2
    I don't know. This post has some information. For example, it is short for "intercalate" which is to put things into a list. It's not resolved satisfactorily. – DJP May 27 '16 at 19:02
  • 6
    The intercalate character is a binary operator. Using it to mean transpose seams to misuse what the character is meant for. – Tim Kuipers Nov 08 '17 at 10:49
  • 4
    It sounds like you're saying there can only be one use for a symbol but that's not true. For example, \circ is listed as a binary operation, but it's also used as in 5^{\circ} to represent 5 degrees. Likewise, \times is listed as a binary operation but it's also used as R^{\times} to indicate the multiplicative group of units of ring R. – DJP Nov 08 '17 at 21:39
  • @skan : For ordinary letters (or uppercase Greek letters), there should be no difference. But try it with a matrix called \alpha. – Toby Bartels Jan 08 '20 at 22:00
  • For any future onlookers, there is a package called physics which, for some reason, mainly implements nice mathematical shortcuts. To that effect, vectors in bold can be written simply as \vb, and while the documentation is short it covers a lot of nice shortcuts to this nice output. \vb is much easier than \mathbf every time. – Kraigolas Feb 06 '20 at 06:01
  • 1
    I sometimes use newpxmath which has a transpose symbol in it. Without that font, I now use \mathop\intercal to raise the glyph a little bit. I also do \mkern-0.5mu for tighter spacing. – Max Xiong Jun 07 '20 at 19:07
  • @MaxXiong What is the command in newpxmath? thanks. – Matemáticos Chibchas Feb 25 '23 at 22:50
  • 1
    @MatemáticosChibchas \transp – Max Xiong Feb 26 '23 at 06:03
85

The Comprehensive LaTeX Symbol List says the following:

Some people use a superscripted \intercal for matrix transpose: A^\intercal. (See the May 2009 comp.text.tex thread, "raising math symbols", for suggestions about altering the height of the superscript.) \top, T, and \mathsf{T} are other popular choices.

Chang
  • 9,528
  • Thanks a lot! The book I am currently citing a formula from uses exactly what latex produces with \mathbf{w}^\top for a transposed vector. So I am going to go with this variant... (\intercal would be the second choice, but T and mathsf{T} look ugly in my opinion) – Philip Daubmeier Jun 06 '12 at 15:12
  • I agree with those who suggest \intercal It looks like the traditional T for transpose, but at the same time it is not confused with the exponents. I am using it in my Tex-files. –  Oct 04 '13 at 16:45
58

In order to give some reference:

(DIN) EN ISO 80000-2:2013 writes it like the following.

% arara: lualatex

\documentclass{article}
\usepackage{mathtools}
\usepackage{unicode-math}
\setmathfont{XITS Math}
\newcommand*{\matr}[1]{\mathbfit{#1}}
\newcommand*{\tran}{^{\mkern-1.5mu\mathsf{T}}}
\newcommand*{\conj}[1]{\overline{#1}}
\newcommand*{\hermconj}{^{\mathsf{H}}}

\begin{document}
\[\matr{A}\tran\]   

\[\matr{A}\hermconj\coloneqq(\conj{\matr{A}})\tran\]
\end{document}

The good part here is that the 'big' T visually fits to the H of the same size which might be used for the Hermitian conjugate matrix.

enter image description here

LaRiFaRi
  • 43,807
45

I prefer A^\mathsf{T} which looks clean and is the right size.

In my opinion, the serifs in A^T distracting, the T is set too low in A^\intercal, the T in A^\top is too thin and too big, and A^* implies the presence of complex numbers.

In any case, it's always good to use a macro in case you change your mind later.

amcnabb
  • 715
33

The symbol \intercal is quite a nice symbol for transpose, but it is placed a little low. Therefore the example defines \transpose to use a \intercal, which is shifted to the baseline. The symbol size adapts to the current math style.

\documentclass{article}
\usepackage{amssymb}

\makeatletter
\newcommand*{\transpose}{%
  {\mathpalette\@transpose{}}%
}
\newcommand*{\@transpose}[2]{%
  % #1: math style
  % #2: unused
  \raisebox{\depth}{$\m@th#1\intercal$}%
}
\makeatother

\newcommand*{\test}[1]{%
  \[
    \mathbf{M}^{#1}
    \;
    \scriptstyle \mathbf{M}^{#1}
    \;
    \scriptscriptstyle \mathbf{M}^{#1}
  \]
}

\begin{document}
  \test{\transpose}
  \test{\intercal}
  \test{\mathsf{T}}
  \test{\top}
\end{document}

Result

Heiko Oberdiek
  • 271,626
23

enter image description here

\documentclass{article}
\usepackage{amssymb,amsmath}
\usepackage{relsize}
\begin[document}
$A^T\ A^{\mathsmaller T}$
\end{document}
Werner
  • 603,163
bop
  • 369
17

Personally I often use the conjugate transpose instead. For real matrices this concept coincides with the transpose, for matrices over the complex field the conjugate is usually what you want anyway. The conjugate transpose of a matrix A is denote A^*.

Roelof Spijker
  • 17,663
  • 5
  • 55
  • 63
15

I use the pre-exponent t in upright shape, either with mathtools package, based on the code: \prescript{\mathrm t}{}{A}, or using the \ltrans command from leftidx package. Here is a code that tries to take into account different situations, which involve different math kerning, nested transpose, and so on. I define a \transp command, with an optional argument, the math kerning (defaults to -3mu) between the t prescript and the ‘prescripted’ expression that follows.

\documentclass[12pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools}

\newcommand*{\transp}[2][-3mu]{\ensuremath{\mskip1mu\prescript{\smash{\mathrm t\mkern#1}}{}{\mathstrut#2}}}%

\begin{document}

Matrix transposition has the following properties :
  \begin{align*}
\transp{(\mskip-1mu AB)} & = \transp{B}\transp{A} \\
\transp{(\transp{A})} & = A \\
\transp{(\mathrm N + \mathrm P)} & = \transp[0mu]{\mathrm N} +\transp[0mu]{\mathrm P}
\end{align*}

\end{document}

A rendering of the above LaTeX code

APerson
  • 101
  • 4
Bernard
  • 461
  • 3
    Could you give a complete MWE? – Sean Allred Oct 05 '13 at 04:39
  • It is the first time I see the transpose as a presuperscript. Did you see it before. It is an interesting idea though to separate exponentiation and transposition (which commute for matrices). – alfC Dec 31 '13 at 23:33
  • 4
    @alfC: It's a traditional notation in French mathematical typography. Not the only one: there's also t or T as superscripts, but always in upright shape. – Bernard Oct 07 '14 at 11:51
  • @Sean Alfred: I had forgotten to add a full example. This is done now, and the code has been modified. – Bernard Oct 07 '14 at 12:59
8

Conjugate transpose is in physics often denoted by ^\dagger because of its association with adjoint operators.

Werner
  • 603,163
Sunday
  • 81
6

There are some good suggestions regarding which symbol to use, it is a good idea to define your own macros for indicating matrices, vectors, and transpose, so that you can write:

\MAT A \VEC b^\TRANSPOSE

This will make it easy to change the notation in the future, if you ever need to do so. In addition, the source is more readable than \mathbf A \mathbf b^\intercal etc.

Aditya
  • 62,301
5

maybe you could use $\mathbf{C}^{^\mathrm{T}}$ to raise it a smaller transpose Tit produces this

Xrobot
  • 153
3

A^{\tau} looks best for me. I tried others but T was still too big.

percusse
  • 157,807
bop
  • 369