# Use integral or sigma as delimiter?

I'm learning LaTeX as I go to write a proof, and I have this chunk of code:

\begin{align}
f(x) & = \displaystyle\sum\limits_{n=0}^{\infty}
\frac{(-1)^n(x^{2n})\left[1 \cdot 3 \cdot 5 \ldots \cdot (2n-1)\right]}
{\sqrt{2\pi}(2n)!}\\
\nonumber\\
f(x) & = \displaystyle\sum\limits_{n=0}^{\infty}
\frac{(-1)^n(x^{2n}) \displaystyle\prod\limits_{k=0}^{n-1}(2k-1)}
{\sqrt{2\pi}(2n)!}
\end{align}


The output is a very small sigma, which doesn't look very good. Is there any way I could use the sigma (or, in future problems, an integral) as a left delimiter to have it change size without using \huge?

• What do you mean by “a very small sigma”? It's the right size, don't worry; you probably shouldn't use \displaystyle and \limits for the product in the fraction numerator. – egreg Apr 9 '14 at 12:08
• Welcome to TeX.SX! Sorry for having forgotten to say it! – egreg Apr 9 '14 at 12:14

You seem to be thinking that the summation symbol should be scaled to cover all the material it applies to: it's not true. Word processing software may do it, but it's not the right thing to do, as it produces humongously big symbols that are just distracting.

It's better to keep the material not to grow vertically too much:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
f(x) & = \sum_{n=0}^{\infty}
\frac{(-1)^n(x^{2n})[1 \cdot 3 \cdot 5 \ldots \cdot (2n-1)]}
{\sqrt{2\pi}(2n)!}\\[2ex]
& = \sum_{n=0}^{\infty}
\frac{(-1)^n(x^{2n})}{\sqrt{2\pi}(2n)!}\prod_{k=0}^{n-1}(2k-1)
\end{align}

\end{document}


By convention, products have precedence over sums, so the second line of the display has an unambiguous reading.

If you really prefer the full fraction, then you should avoid stacking limits over and below the product symbol:

\begin{align}
f(x) & = \sum_{n=0}^{\infty}
\frac{(-1)^n(x^{2n})[1 \cdot 3 \cdot 5 \ldots \cdot (2n-1)]}
{\sqrt{2\pi}(2n)!}\\[2ex]
& = \sum_{n=0}^{\infty}
\frac{(-1)^n(x^{2n})\prod_{k=0}^{n-1}(2k-1)}
{\sqrt{2\pi}(2n)!}
\end{align}


If you really want to stack limits, don't use \displaystyle:

\begin{align}
f(x) & = \sum_{n=0}^{\infty}
\frac{(-1)^n(x^{2n})[1 \cdot 3 \cdot 5 \ldots \cdot (2n-1)]}
{\sqrt{2\pi}(2n)!}\\[2ex]
& = \sum_{n=0}^{\infty}
\frac{(-1)^n(x^{2n})\prod\limits_{k=0}^{n-1}(2k-1)}
{\sqrt{2\pi}(2n)!}
\end{align}


• Very nice! As another option, for double integral fans, you can collect operators on the left \sum{\prod{...}} to make it a little more obvious that the sum covers the product (right now only the upper limit of product hints it in the first case). It would decrease the dependence over the convention. Of course algorithmically thinking, it might be not so wise to code as such. – percusse Apr 9 '14 at 12:56

egreg explains why you probably shouldn't do this, and gives better practices.

If you want to do it anyway, one way is with package scalerel, and its \scaleleftright command. The syntax is \scaleleftright[max width]{left delimeter}{stuff}{right delimeter}.

\documentclass{amsart}
\usepackage{scalerel}

\begin{document}

\begin{align}
f(x) & = \sum_{n=0}^{\infty}
\frac{(-1)^n(x^{2n}) \displaystyle\prod\limits_{k=0}^{n-1}(2k-1)}
{\sqrt{2\pi}(2n)!} \\[2ex]
f(x) & = \scaleleftright{\sum_{n=0}^{\infty}}{
\frac{(-1)^n(x^{2n}) \displaystyle\prod\limits_{k=0}^{n-1}(2k-1)}
{\sqrt{2\pi}(2n)!}}{.}
\end{align}

\end{document}


• Now f(x) looks much too small. Also, I may be a traditionalist, but I would want the sum symbol (of whatever size) to have its center point in line with the fraction bar. – Dan Apr 9 '14 at 18:39
• @Dan: This is why you shouldn't do this. – Nick Matteo Apr 9 '14 at 21:30