Sum and limits/nolimits commands in LaTeX display and inline modes

The command \limits sets an equation and sub/superscript to appear in the display style and \nolimits sets them to be inline.

Using limits and nolimits in display style

\begin{align}
\sum_{ k=1 }^n k^2 = \frac{ n(n+1)(2n+1) }{ 6 } \\
\sum\limits_{ k=1 }^n k^2 = \frac{ n(n+1)(2n+1) }{ 6 } \\
\sum\nolimits_{ k=1 }^n k^2 = \frac{ n(n+1)(2n+1) }{ 6 }
\end{align}
output

The last equation in the above example shows that the command nolimits forces an equation to be in inline mode. But limits has no effect in display mode.

Using limits and nolimits in inline style

$\sum_{ k=1 }^n k^2 = \frac{ n(n+1)(2n+1) }{ 6 }$ \\\\
$\sum\limits_{ k=1 }^n k^2 = \frac{ n(n+1)(2n+1) }{ 6 }$ \\\\
$\sum\nolimits_{ k=1 }^n k^2 = \frac{ n(n+1)(2n+1) }{ 6 }$
output

The command limits makes an equation be in display mode.

Comments

Powered by Markdown