Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
2  
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

2 Answers 2

up vote 7 down vote accepted

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} 
share|improve this answer

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

enter image description here

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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