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.

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

3 Answers 3

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.

3
  • Aligning subscripts when superscripts are involved is something of a black art. ;-)
    – egreg
    Commented Mar 4, 2016 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. Commented Mar 4, 2016 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
    Commented Mar 4, 2016 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}
0

This is an old question, but I figured I'd add an alternative. As @egreg mentions in the comments, the rules for subscript and superscript placement are complicated. To bypass the "cramped" style in the denominator, you can add \textstyle, even though intuition tells us the denominator should already be in \textstyle. To even out the subscripts, add an empty exponent.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
  \frac{1}{\textstyle l_e^{1} l_e^{-1} l^{}_e l_e^{-1}}
\end{equation*}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .