[Tex/LaTex] The \prescript command from the mathtools package gives incorrect alignment

mathtoolssubscriptssuperscripts

The spacing I'm getting with the \prescript command from the mathtools package seems wrong. Here is a MWE:

\documentclass{article}
\usepackage{amsmath,mathtools}
\begin{document}
$\prescript{14}{2}{\mathbf{C}}^{5+}_{2}$
\end{document}

which produces this (red line added to make difference clearer):

enter image description here

I suspect it's just a problem with the command itself – if so, is there a known fix? If not, what should I be doing differently? (Of course, regardless of whose fault it is, one solution is just to use a different package for this purpose.)

Best Answer

A concise solution in this instance is presented via the tensor package:

enter image description here

$\tensor*[^{14}_2]{\mathbf{C}}{^{5+}_2}$

Not sure about the extent of your usage, but the following also corrects this in your specific case:

enter image description here

\documentclass{article}
\usepackage{mathtools,leftidx}% http://ctan.org/pkg/{mathtools,leftidx}
\begin{document}
$\prescript{14\phantom{+}}{2}{\mathbf{C}}^{5+}_{2}$ \quad
$\leftidx{^{14\vphantom{+}}_2}{\mathbf{C}}{^{5+}_2}$ \quad
$\vphantom{\mathbf{C}}^{14\vphantom{+}}_{\phantom{14}\mathllap{2}}\mathbf{C}^{5+}_2$
\end{document}

The leftidx package provides \leftidx{<left>}{<base>}{<right>} prints <base> with a left index <left> and right index <right>. However, it also suffers from the same problem by default. The alternative is to set <base> twice, first only as a \vphantom. The use of \vphantom{+} is to also improve the adjustment vertically. Horizontal alignment for the left index is achieved via \phantom{14}\mathllap{2}.

Related Question