[Tex/LaTex] Having sub/super scripts on the side for \sum

subscriptssuperscripts

When writing \sum_{n=1}^\infty, the subscript and superscript will appear below and above the big Sigma symbol:
enter image description here

Though when writing \Sigma_{n=1}^\infty, they will appear on the sides:
enter image description here

I would like to use the \sum symbol, but having the sub/super script to appear on the side, just like with \Sigma. How do I achieve that? Due to space efficiency.

Best Answer

You can achieve this by using either \nolimits or \textstyle:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
Here is a sum:
\[\sum\nolimits_{i=1}^{n}X_i.\]

Here is another sum:
\[{\textstyle\sum}_{i=1}^{n}X_i.\]
\end{document}

enter image description here