I'm very familiar with how symbols display differently in inline mode (with $ ... $
) vs. how display math shows them (with \[ ... \]
or $$ ... $$
). Two examples would be with limits
$\lim_{n\rightarrow \infty}f(x)$
vs.
\[ \lim_{n\rightarrow \infty}f(x) \]
and with sums
$\sum_{n=1}^{x} n^2$
vs.
\[ \sum_{n=1}^{x} n^2 \]
My Question is:
How do you display these things in inline mode (with all the nice inline formatting) as if they were in display mode ?
The inverse — how to display things in display mode as if they were in inline mode — is also of interest.
Best Answer
There are two separate aspects to your question, which can be addressed separately:
How to control the size of the integral, sum and product symbols
How to control the placement of the limits of integration, summation, and multiplication, namely side-set or above/below.
Default settings
The default settings, with the
amsmath
package loaded, areInline math
sumlimits
andintlimits
options ofamsmath
do not affect the placement of limits in inline math.Display math
Large symbol size. See Tables 72 through 83 in the Comprehensive LaTeX Symbol List for the names of these 'large' or, more precisely, Variable-sized Math Operators;
For
\int
-type symbols, the limits are side-set unlessamsmath
was loaded with the optionintlimits
.The integral symbols are treated separately presumably because they are generally taller than the other variable-sized symbols.
For
\sum
,\prod
,\coprod
, etc the limits are set above and below the operator, except when theamsmath
was loaded with the optionnosumlimits
.The
sumlimits
andnosumlimits
options and the\limits
and\nolimits
commands affect the appearance not only of sum-type symbols but of\prod
,\coprod
,\bigcup
and\bigcap
, etc. as well.Custom settings
To control the size of the symbol, one writes before the command generating the symbol
\textstyle
for small symbols;\displaystyle
for large symbols; .\textstyle
and\displaystyle
may also affect the behavior of subsequent commands in the current math-mode environment, as observed by @HaraldHancheOlsen.To control the placement of the limits, one writes after the command generating the symbol
\nolimits
for side-set limits;\limits
for limits set above and below.These possibilities are illustrated in the table below:
The table was produced by the following code:
Personal comments
Finally, some personal views on the (ab)uses of the
\limits
and\displaystyle
commands when in inline math mode:\limits
command when in inline math mode. Otherwise, one is virtually assured of wrecking the appearance of the paragraph where the formula appears.\sum_i
or\prod_j
are usually just fine. You may even be able to get away with omitting thei
andj
indices of summation/multiplication.\displaystyle
command (to force the creation of large symbols) while in inline math mode is an even worse idea than using\limits
.