I have a couple of terms in a summation in which both have subscripts. The subscript in the first term is smaller than in the second. How do I ensure that they are the same size?

Example equation below:

P_{i,j}^{(k + 1)} = \sum\limits_{t = 1}^n a_{it}P_{tj}^{(k)}
  • 1
    I do not agree with you. Subscripts are the same size, but their position (depth) differ. Try P_{i,j}^{(k + 1)} = \sum\limits_{t = 1}^n a_{it}^{}P_{tj}^{(k)} if it gives what you looking for. – Zarko May 8 '16 at 1:30
  • Welcome to TeX.SE! @Zarko - The OP may have used the term "size", when applied to the letters in the subscript position, to denote both vertical offset and font size. – Mico May 8 '16 at 1:53
  • @Zarko - a_{it}^{} (your suggestion) and a_{it}^{\mathstrut} (my recommendation) produce outcomes that are close but fully identical. – Mico May 8 '16 at 13:07
  • @Mico, I prefer shorter code if it is sensible and possible. I have filling, that about how to write indices here on TeX.SE regularly appears question about position of subscript (even me ask one ...), so I think about open discussion about this on meta.TeX . I still looking around, if some TeX guru/expert improve package subdepth ... which after than will better solve this issues. – Zarko May 8 '16 at 13:49

(A remark up front: TeX renders the subscript terms in the equation you've provided using the same font size throughout. I'm therefore assuming that when you take about the "size" of the subscripts, you are referring to their vertical offsets relative to the baseline.)

The exact placement of the subscript term in a formula depends importantly on (a) whether or not a superscript term is present as well and (b) the height and depth of the superscript term (if present). In the following screenshot,

enter image description here

produced by $a_{it} a_{it}^{} a_{it}^{\mathstrut}$, the first a_{it} term has no superscript companion, the second features an "empty" superscript -- more precisely, an "empty math atom" superscript -- and the third features a full-size "math strut" superscript. A "math strut" is an invisible object that has the height and depth of a parenthesis, (, but no width (making it invisible).

For your overall formula, you should write a_{it}^{\mathstrut} to assure that the subscript is at the vertical position as that in the subsequent P_{tj}^{(k)} term.

enter image description here

$a_{it} a_{it}^{} a_{it}^{\mathstrut}$

$P_{i,j}^{(k + 1)} = \sum\limits_{t = 1}^n a_{it}^{\mathstrut}P_{tj}^{(k)}$

$\displaystyle P_{i,j}^{(k + 1)} = \sum\limits_{t = 1}^n a_{it}^{\mathstrut}P_{tj}^{(k)}$
  • Thanks. This improved the appearance of the rendered sum a lot. – Selena May 8 '16 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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