TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to be able to place multiple sub and superscripts (in maths mode) on an element without having them expand vertically. That is, so that in the output of ${x^2_4}^6_8$, the 2 and 6 were aligned, as were the 4 and 8 (obviously, I'd expect to do this with a macro rather than the super- and subscript commands). As a bonus, it'd be nice to be able to control whether or not this appeared like $x^{26}_{48}$ or $x^{2\phantom{4}6}_{\phantom{2}4\phantom{6}8}$. And it would be nice to truly be able to do this incrementally, so that each subscript or superscript could be added without having to know all the previous ones (useful for adding stuff via macros). Simply writing $x^2_4{}^6_8$ wouldn't work as the latter super and subscripts wouldn't know the difference between x and X and ∏.

(see also non-kludgey left subscripts)

share|improve this question
+1 this would be really useful for writing tensors in Einstein notation. I've thought about trying to figure out a way but never got around to it, so I'll be interested to see what answers come up. – David Z Jul 27 '10 at 10:48
up vote 13 down vote accepted

My answer to the linked question on "non-kludgy left index" also works here. Use the tensor package. The \tensor form leaves phantom spaces, while the \tensor* form compresses everything.

share|improve this answer
Should've checked CTAN myself ;-) +1 – David Z Jul 27 '10 at 18:40
It is a bit hard to find. (Which keywords would one search for?) I came across the package a short while back by accident when I was looking for some way to typeset nuclides. – Willie Wong Jul 27 '10 at 19:09
This looks just right! Thanks. – Loop Space Jul 29 '10 at 10:48

Your Answer


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.