# Textual subscript in math mode

I want to put some short words in certain subscripts when I am in math mode, for example:

$W_{total} = \sum{W_i}$


but I think LaTeX understands this as the product of t, o, t, a and l.

Is in any case this way the right way, or is there any other one?

By the way, I have tried

$W_{\text{total}}$


but it is not fine for me. (A bit ugly) Forget that.

• Could you elaborate why you find it ugly. Jan 23, 2011 at 16:59
• @Caramdir bah, I made a mistake. Forget that Jan 23, 2011 at 21:31

$$W_\textrm{total} = \sum_i W_i$$

To make it prettier I'd suggest to think about the use of variables and indices in your work. For example, you could reserve W (without index) for the total which is the sum of w_i (lowercase w). This way you can avoid long subscripts.
• As this is a LaTeX question, stick with $...$ rather than $$...$$. Also, I'd recommend W_{\textrm{total}} with braces around the subscript text. Jan 23, 2011 at 18:01
• Thank you for your answer; your suggestion about subscripts was useful too :) By the way, is there any difference between \textrm and \text? Jan 23, 2011 at 21:34
• @Juan Yes, \textrm make the text whatever is defined as the serifed text font. \text respects the local text environment. So \sffamily $W_\text{total}$ will give you a sans serifed subscript, while \sffamily $W_\textrm{total}$ will still give you a serifed subscript. Jan 23, 2011 at 21:44