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 have an equation in eqnarray environment. The equation has a sum notation with subscript and superscript. The problem is that the subscript and superscript appear on sideways of the sum notation which looks pretty ugly. I came to know about \displaystyle but it can be used only with inline equation.

How can I use such a command with the equation or eqnarray environment.

share|improve this question

migrated from stackoverflow.com Jul 18 '12 at 11:16

This question came from our site for professional and enthusiast programmers.

\align doesn't work either. Just consider it an equation having only a sum notation with subscript and superscript. Both the scripts are appearing on the lower and upper right sides of the sum notation. – user846400 Jul 17 '12 at 19:57
Actually, I want to place the \sum within a fraction but I don't like the way that it appears when compiled i.e. the N above it and the i = 1 below it appear as plain superscripts and subscripts respectively but I want them to be directly above and below the "sum of" sign on the top and bottom of the fraction. Normally, if you use \displaymath, then this works fine but I need the equation to be correctly numbered so I need to use it within the \equation environment. – user846400 Jul 17 '12 at 20:04

It may just be that you're using the environment incorrectly. This might be what you're after:

enter image description here

\usepackage{amsmath}% http://ctan.org/pkg/amsmath
  r    &= \sum_{i=k}^n\binom{n}{i}\binom{m-n}{n-i} \\
  f(x) &= \frac{\sum_{i=k}^n\binom{n}{i}\binom{m-n}{n-i}}{\binom{m}{n}} \\
  g(x) &= \frac{\displaystyle\sum_{i=k}^n\binom{n}{i}\binom{m-n}{n-i}}{\binom{m}{n}}

amsmath provides the align (numbered) environment, as well as \binom. Numerator and denominator of fractions in display math mode are normally converted to \textstyle. Therefore, it requires a verbatim switch to \displaystyle if needed.

share|improve this answer
Yes. This is what I want. I have sum in the denominator. However, if I use \displaystyle as above, I do get the sum in right form, but I get some extra spacing before and after the equation. – user846400 Jul 18 '12 at 7:25
@user846400 eqnarray requires two & symbols: left hand side & = & right hand side. But it's better not to use eqnarray at all, favoring amsmath environments. – egreg Jul 18 '12 at 11:21

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.