[Tex/LaTex] How to have a common height of subscripts when some got superscripts too

subscripts

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

enter image description here

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?

Best Answer

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.

enter image description here

\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".

enter image description here

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