4

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: enter image description here

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
4

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}}
\quad
  \frac{1}{l_e^{1} l_e^{\smash{-}1} l_e^{} l_e^{\smash{-}1}}
\quad
  \frac{1}{l_e^{1\mathstrut} l_e^{-1\mathstrut} l_e^{\mathstrut} l_e^{-1\mathstrut}}
\end{equation*}

\end{document}

enter image description here

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
2

One possibility is

enter image description here

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.