2

From this discussion (What is the best symbol for vector/matrix transpose?) I like to use \intercal for matrix/vector tranpose symbol. However, when subscripts get involved it gets ugly:

MWE:

\documentclass[11pt]{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{newpxtext} 

\begin{document}

$$\mathbf{X}_1^\intercal\mathbf{X}_1 \qquad \mathbf{X}_1^2\mathbf{X}_2^2 $$

\end{document}

enter image description here

As you can see the subscripts are moved down due to the transpose symbol. Any thoughts on how to make this look more visually appealing?

bdeonovic
  • 1,342
  • I just saw this discussion which talks about this very topic: https://groups.google.com/forum/#!topic/comp.text.tex/wrEfpgjYQ08 – bdeonovic Oct 07 '14 at 02:07
  • The subscript is moved down due to the transpose symbol but equally to the "2" in the second example. Or do you see any typographical difference here, which I can't spot? Please read this post! For future posts: you should reduce your MWE as much as possible. I had to install newpxtext just to see that it is not needed at all. Just as a hint. – LaRiFaRi Oct 07 '14 at 05:57
  • Sorry, I use the newpxtext font and I wasn't sure if the font impacted how noticeable the lowering of the subscript was. – bdeonovic Oct 07 '14 at 12:52
  • No problem. I was just giving advice for future MWEs. Does my solution work for you? If yes, please accept it as answer. If not, please clarify more what your problem is. Thanks. – LaRiFaRi Oct 07 '14 at 13:11

1 Answers1

4

I would do like the following:

% arara: pdflatex

\documentclass{article}
\usepackage{amssymb}
\let\oldvec\vec
\renewcommand*{\vec}[1]{\mathbf{#1}}

\begin{document}    
    \[\vec{X}_1^\intercal\vec{X}_1^{\vphantom{\intercal}} \qquad \vec{X}_1^2\vec{X}_2^2\]   
\end{document}

enter image description here


Update:

The OP asked for a solution without \vphantom{}. The other way around would be to raise the subscript up to the level of other subscripts. In this case, the \intercal would be colliding. You could the superscript up which would look bad in combination with no-subscript versions. Therefore, you will have to shift it to the right. Please see my example below for a possible solution. You can use my macro or you do a manual kerning for every case.

% arara: pdflatex

\documentclass{article}
\usepackage{amssymb}
\usepackage{mathtools}
\let\oldvec\vec
\renewcommand*{\vec}[1]{\mathbf{#1}}
\newcommand*{\myIntercal}[1]{_{#1}{}^{\mkern-4mu\intercal}}
\newcommand{\test}[1]{$\vec{X}^\intercal\vec{X}\myIntercal{#1}\vec{X}_{#1}\vec{x}^\intercal\vec{x}\myIntercal{#1}\vec{x}_{#1}$\par}

\begin{document}    
    \test{1}\test{2}\test{3}\test{4}\test{5}\test{l}\test{m}\test{1000}
\end{document}

enter image description here

LaRiFaRi
  • 43,807