Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

From trying to construct the formula by hand, I had come up with the following:

\sigma^2 = \frac{\sum_{i=1}^{n}(x_i - \mu)^2} {n}

Now this looks fairly correct, however the _i=1 and ^n do not show above and below, rather above and right as you would expect it:

enter image description here

I cannot find an example or reference to find the correct one. What should be used?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

If you want the \sum operator to have the limits i=1 and n to be displayed above/below it, you need to add a \displaystyle in front of it:

\sigma^2 = \frac{\displaystyle\sum_{i=1}^{n}(x_i - \mu)^2} {n}

Displaystyle formula

share|improve this answer
1  
... or \limits just after \sum, e.g., \sum\limits –  Gonzalo Medina Aug 27 '11 at 23:03
add comment

The following is an excerpt from Section 2.4.4 Sums, products, unions, integrals, etc. from Mathematics into Type by Ellen Swanson:

2.4.4a Sums and products

In text, the subscripts and superscripts usually follow the symbols, while in display they are normally printed above and below.

enter image description here

In the past some publishers used to place subscripts and superscripts to the right of sums and products both in text and display to avoid extra typesetting costs. Aesthetically it is preferable to set them in display as shown above, and with modern computer typesetting systems it is no more expensive. In text, though, beware of expressions like

enter image description here

where the prime has some specific meaning, and moving the N to the side may cause confusion.

For unions and intersections, the treatment is similar to that for sums and products.

For integrals:

When a single integral is used, the subscripts and superscripts always follow the symbol. For multiple integrals used in display, the subscripts and superscripts may be centered above and below them.

In your particular case, you have three options if the formula is to appear displayed:

  1. To leave the formula as it is.
  2. To use \displaystyle\sum which will place the indices above and below and will also increase the size of the summation sign.
  3. To use \sum\limits which will also place the indices above and below but without increasing the size of the summation sign.

The following code illustrates these options:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[ \sigma^2 = \frac{\sum_{i=1}^{n}(x_i - \mu)^2} {n} \]

\[ \sigma^2 = \frac{\displaystyle\sum_{i=1}^{n}(x_i - \mu)^2} {n} \]

\[ \sigma^2 = \frac{\sum\limits_{i=1}^{n}(x_i - \mu)^2} {n} \]

\end{document}

enter image description here

If the formula is to appear in text, then it would be preferable to use something like the following:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

text text text text text text text text  text text text text  text text text text  text text text text 
$\sigma^2 = (1/n)\sum_{i=1}^{n}(x_i - \mu)^2$ text text text text text text text text  text text text text  text text text text  text text text text 

\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

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.