13

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)

1
  • 5
    +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
    Commented Jul 27, 2010 at 10:48

2 Answers 2

16

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.

2
  • 1
    Should've checked CTAN myself ;-) +1
    – David Z
    Commented Jul 27, 2010 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. Commented Jul 27, 2010 at 19:09
0

You could write $x{}^2_4{}^6_8$. (Note the additional curly braces before the first superscript and subscript.) This still does not take into account the dimensions of the symbol $x$, but at least vertical alignment is consistent.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .