# How to have a common height of subscripts when some got superscripts too?

I am writing a script and got a formula with inverses, and I noticed that the subscripts have a different heigth.

This is the minimal working example:

\documentclass{scrbook}
\begin{document}
$\underline{h_1 h_1^{} h_1^{-1}}$
\end{document}


after compiling this gives

The underline isn't really necessary but it makes it easier to see the difference, the -1 in the superscript is necessary, as only using 1 in the superscript gives the same heigth in the subscripts. I would like to have all subscripts on the same heigth. My only idea was with ^{}, but as the MWE shows it still gives a small difference. Is there another solution?

-
Use \usepackage{subdepth} –  Marco Daniel Apr 14 '13 at 9:33
@Marco Daniel I read the Documentation (at least I think it was the documentation), it seems like all subscripts are lowered, is there a way to make this only local ? –  Dominic Michaelis Apr 14 '13 at 9:48

If you don't want to use a package such as subdepth, say because you're looking to keep subscript depth adjustments "local", you need to be prepared to make adjustments to those subformulas that have subscripts but no superscripts. One such method would consist of using the TeX directive \vphantom to create "invisible" superscripts for those terms that currently do not have superscript terms. The argument of the \vphantom directive should be the largest superscript term that occurs in the overall formula.

\documentclass{scrbook}
\newcommand{\Q}{{\vphantom{-1}}} % use some "uncommon" letter for command name
\begin{document}
$\underline{h_1^\Q h_1^\Q h_1^{-1}}$
\end{document}


Just for completeness, here's how the formula looks if the subdepth package is employed (and no \vphantom superscript constructs are inserted); the main difference to the fully manual adjustment method explained earlier is that the superscripts and subscripts are all typeset "higher up".

\documentclass{scrbook}
\usepackage{subdepth}
\begin{document}
$\underline{h_1 h_1 h_1^{-1}}$
\end{document}

-

Depending on what you want to do, an alternative might be to use

\documentclass{article}
\usepackage{amsmath}
\newcommand{\myUp}[2]{#1\mspace{-2mu}{}^{#2}}
\begin{document}
$h_1 h_1^{-1} h_1{}^{-1} \myUp{h_1}{-1}$
\end{document}


giving

where the last example is provided to undo the far right shift partially.

-