# Spacing for left indices

There are many packages for left super- and subscripts, but none of them seem to solve the central issue: The spacing between the left indices and the symbol often looks wrong. Most packages seem to use some variant of the idea of adding a \vphantom in front of the symbol, containing the symbol itself, to adjust the height of the indices. But \vphantom does not take care of the spacing around the indices. For instance, there is far too much room between the f and the a in the below code.

I know one can in principle fix this by hand by using space commands, but is there a more systematic solution? For instance, does there exist some TeX command that returns the value of the indentation of the right superscript? And can you use this to adjust the position of the left one? Or could one make an \indexphantom command such that \indexphantom{f}^a_b typesets the indices a and b with the same spacing as they would have had if there was an f?

\documentclass{article}

\begin{document}

$\vphantom{f}^a_b f$

\end{document}


• I can't reproduce your result. Here (Texlive 2020) it looks perfectly ok, in particular the a and the bare aligned. In your pic the ais a bit left of the b. Jul 20 '20 at 15:33
• @KeksDose Yes, sorry, I forgot to take a new screenshot when I changed the code from {}^a_b to \vphantom{f}^a_b. I will correct it in a moment. But it still does not look right. The a should be closer to the f. Jul 20 '20 at 15:37
• Jul 20 '20 at 15:42

Surely 😄😄 I'm killing a fly with a cannon using tensor or other packages, but there are further solutions to write easily your request like the picture. I think that the last solution it is more closest with over/subscript near f.

\documentclass[a4paper,12pt]{article}
\usepackage{tensor}
\begin{document}
$\tensor*[^{a}_b]{f}{}$
\end{document}


or with isotope package:

\documentclass[a4paper,12pt]{article}
\usepackage{isotope}

\begin{document}
$\isotope[a][b]{\,\textit{f}}$
\end{document}


\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}

\begin{document}
${}_{b}^{a}f$
\end{document}