# How to separate subscript and superscript in LaTeX?

I have a variable with a subscript describer P_{\rm 1S} I'd like to square it.

First a style question: is (P_{\rm 1S})^2 or P_{\rm 1S}^2 better? The programming part of the problem is that the latter aligns the superscript vertically above the subscript, I would like the power to be aligned further to the right distinct from the variable and its descriptors. Is there a simple way to do this?

## migrated from stackoverflow.comOct 21 '13 at 21:40

This question came from our site for professional and enthusiast programmers.

• in this case, the answer given is good. but there are also situations (tensor notation, i believe) where a string of scripts must be "separated", as x^a{}_b{}^c. (please take this as a model, not an actual case.) – barbara beeton Oct 21 '13 at 22:34
• At any rate, don't use \rm, use \text{} – Sean Allred Oct 21 '13 at 22:38
• Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner Oct 22 '13 at 2:03

## 1 Answer

Instead of $(P_{\rm 1S})^2$ (which is the most precise) you can also write ${P_{\rm 1S}}^2$ (which should be also clear). However, as it is mentioned by egreg, P_\mathrm{1S} is better than P_{\rm 1S}, as \rm is obsolete in LaTeX2epsilon.

• Also P_\mathrm{1S}, please. – egreg Oct 21 '13 at 22:26