# How to align superscripts?

I have an expression like

$$\eta^{[\alpha\beta}_{\phantom{\alpha\beta}\rho}h^{\sigma]}A^\rho$$


and I would like that all the indices alpha, beta, sigma and rho appear on a same line. If someone have a suggestion it will be great!

-
Welcome! Do you want those [] to be rendered? What do they mean? Please do not use  but  as the first is deprecated since years. – LaRiFaRi Mar 17 at 11:17
Without those brackets, $\eta^{\alpha\beta}_{\rho}h^{\sigma}A^\rho$ should be just fine. If it isn't, you will have to show us an MWE please! – LaRiFaRi Mar 17 at 11:19
Hmmm... I can't really parse this expression --- can't really see what it "means" mathematically. Is the $h$ multiplying $\alpha\beta$ and has a pre-subindex $\rrho$ and exponent $\sigma$? or is $\sigma$ with two left-subindex multiplying $\alpha\beta$? I suggest a rewrite ;-) – Rmano Mar 17 at 12:00

What you need is \hphantom instead of just a \phantom:

\documentclass{article}
\begin{document}
$\eta^{[\alpha\beta}_{\hphantom{\alpha\beta}\rho}h^{\sigma]}A^\rho$
\end{document}


-

If the \phantom term is omitted, the superscript terms will be aligned correctly without further ado. The following screenshot shows (a) your original expression, (b) a first alternative that features the subscript \rho term far from \eta, and (c) a second alternative where the \rho subscript is placed closer to \eta.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin {align*}
\eta^{[\alpha\beta}_{\phantom{\alpha\beta}\rho}h^{\sigma]}A^\rho\\
{\eta^{[\alpha\beta}}_{\mkern-8mu\rho} \, h^{\sigma]} A^\rho\\
\eta^{[\alpha\beta}_{\rho} h^{\sigma]} \! A^\rho
\end{align*}
\end{document}

-

It is not ideal, but you could add a \mystrut to every base and embrace {} the base. EDITED to address barbara's concern by making the strut a custom \mystrut that does not go below the baseline.

\documentclass{scrreprt}
\def\mystrut{\rule{0pt}{\the\ht\strutbox}}
\begin{document}
${\mystrut\eta}^{[\alpha\beta}_{\phantom{\alpha\beta}\rho} {\mystrut h}^{\sigma]}{\mystrut A}^\rho$
\end{document}


-
the subscripted \rho is lower; that's not really desirable. – barbara beeton Mar 17 at 12:22
@barbarabeeton addressed with a custom upward-only \mystrut. – Steven B. Segletes Mar 17 at 14:02

In this particular construction, you can set the sub-script to \eta as separate sub-script to {} (nothing). The combination of the super- and sub-script is causing a vertical shift of the scripts:

\documentclass{article}

\begin{document}

$\eta^{[\alpha\beta} \!\! {}_\rho \, h^{\sigma]} A^\rho$

\end{document}


I've added some horizontal spacing to simulate the [dis]association of the \rho sub-script with \eta [h], but that's up to personal preference.

-