# Using \displaystyle in Equation environment

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.

-
 \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

## migrated from stackoverflow.comJul 18 '12 at 11:16

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

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{align}
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}}
\end{align}
\end{document}


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.

-
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