# Horizontally misalligned sub-/superscripts in fractions when using 'minus' sign

I am combining sub- and superscripts in the denominator of a fraction. I get ill behaviour when the exponent is preceded with a minus sign:

I would expect the sub- and superscript of the first two elements be aligned. I do understand the different alignment of the third element, when the superscript is absent. However, the misalignment cannot be rescued by the usage of \vphantom.

Here's the minimal example:

\documentclass{minimal}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
\frac{1}{l_e^{1} l_e^{-1} l_e l_e^{\vphantom{3}-1}}
\end{equation*}

\end{document}


Any help is highly appreciated. Thank you very much for your time.

• Add empty superscripts where missing: l_e^{}l_e^{-1}. The \vphantom serves no purpose. – egreg Mar 4 '16 at 13:16
• Unfortunately the main issue with the first two elements l_e^{1} l_e^{-1}. There's already a superscript present. – somehow.different Mar 4 '16 at 13:40

The minus sign has the same height and depth of the +, which has depth, so this pushes down the subscript a bit more than if only 1 is in it. For this reason, your \vphantom{3} does nothing.

Solution: use proper phantoms or smash the minus.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
\frac{1}{l_e^{\vphantom{-}1} l_e^{-1} l_e^{\vphantom{-}} l_e^{-1}}
\frac{1}{l_e^{1} l_e^{\smash{-}1} l_e^{} l_e^{\smash{-}1}}
\frac{1}{l_e^{1\mathstrut} l_e^{-1\mathstrut} l_e^{\mathstrut} l_e^{-1\mathstrut}}
\end{equation*}

\end{document}


As you see, the \mathstrut device has its drawbacks.

• Aligning subscripts when superscripts are involved is something of a black art. ;-) – egreg Mar 4 '16 at 14:03
• Thank you. The \smash version works nicely. However, I don't get your explanation completely. As you write - and + have finite depth. Shouldn't this push the subscript ever lower? I saw the opposite behaviour. – somehow.different Mar 4 '16 at 14:11
• @somehow.different The rules for subscript and superscript placement are really complicated. Also the fact TeX uses cramped style in denominators has a role in this affair. – egreg Mar 4 '16 at 14:18

One possibility is

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
\frac{1}{l_e^{\mathstrut{1}} l_e^{\mathstrut{-1}} l_e l_e^{\mathstrut{1}}}
\end{equation*}

\end{document}