Controlling Operator Sizes And Limit Positions In Latex Formulas
Controlling Operator Sizes in LaTeX Formulas
When writing complex mathematical expressions in LaTeX, it is often necessary to control the size of operators like sums, integrals, and products to ensure they are displayed appropriately relative to the terms they are operating on. LaTeX provides several commands to enlarge operators and fine-tune their appearance.
Using \displaystyle to Force Large Operators
One of the most useful commands for controlling operator size is \displaystyle. This command forces the operator to render in a larger "display style" size, which is the same size used for displayed equations set on separate lines. Compare the sizes of the summation symbol \(\sum\) in the following inline and display equations:
\(\sum_{i=1}^n i^2\) \qquad vs. \qquad
\(\displaystyle\sum_{i=1}^n i^2\)
As you can see, \(\displaystyle\) makes the \(\sum\) much taller and visibly distinct from the limits above and below. This helps differentiate operators from adjacent terms and improves readability.
Adjusting Limits with the \limits and \nolimits Commands
LaTeX has defaults about whether to display limits above and below operators like \(\sum\), \(\prod\), \(\lim\), and \(\int\). However, sometimes overrides are helpful. The commands \limits and \nolimits provide manual control.
\(\displaystyle\sum_{i=1}^n\) vs.
\(\displaystyle\sum\limits_{i=1}^n\)
\limits always forces the limits above and below. \nolimits does the opposite, ensuring no limits.
Managing Line Breaks After Operators with \allowbreak
Long formulas containing enlarged operators will often have line breaks that disrupt the visual grouping of the operator with its terms. Placing \allowbreak right after the operator symbol tells LaTeX it is okay to add a line break if needed to prevent overflowing margins or exceeding column widths:
\(\displaystyle\allowbreak\sum_{veryveryverylonglimit}^{evenlongerlimit} terms\)
Positioning Limits Relative to Operators
The placement of limits relative to a large operator symbol has a major impact on how easy the formula is to parse visually. LaTeX has options to override the defaults to achieve better layouts.
Understanding Default Limit Positions
By default, LaTeX renders most operator limits above and below if there is sufficient vertical space. Exceptions are \(\lim\), which places limits to the right, and \(\int\), which has only a lower limit by default. Multi-level operators like \(\prod\) can accommodate stacked limits.
Forcing Limits Above and Below with \overset and \underset
The commands \overset and \underset give precise control for setting limits explicitly above or below operators and other symbols, independently of LaTeX's defaults:
\(\overset{up}{op}\) \qquad
\(\underset{down}{op}\)
Combined usage allows splitting upper and lower limits:
\(\displaystyle\sum\overset{top}{limits}\underset{bottom}{limits}{terms}\)
Stacking Limits with the stackedlimits Package
When both upper and lower limits on tall operators get overly long, readability suffers. The \usepackage{stackedlimits} option enables stacking one limit atop the other to compactify the height:
\(\displaystyle\sum\limits^{\lim\limits_{up}}_{\lim\limits_{down}} terms\)
Sizing and Spacing Parentheses
Delimiters like parentheses, brackets, and braces often need size adjustments to match visually balanced formulas. LaTeX gives semantic commands for specifying delimiter sizes.
Changing Sizes with \big, \Big, \bigg, and \Bigg
Standard commands for increasing delimiter sizes in four progressively larger steps are:
- \big - slightly taller size
- \Big - double default size
- \bigg - triple default size
- \Bigg - quadruple default size
For example, resizing parentheses:
\((\, \big( \, \Big( \, \bigg( \, \Bigg( \)
Adding Space After Opening with \left and \right
The optional \left and \right commands also increase delimiter size, but more importantly add the right amount of space after opening delimiters for better visual containment:
\(\left(\frac{a}{b}\right)\) vs. \((\frac{a}{b})\)
Example Formulas Showcasing Limit Control
This section provides full multi-line formulas demonstrating concepts covered in this article.
Fraction with Stacked Numerator and Denominator Limits
\(\displaystyle
\frac{\overset{\lim\limits_{x\to\infty}}{top}}{\underset{\lim\limits_{x\to 0}}{bottom}}
\)
Integral with Side-Set Differential Limit
\(\displaystyle
\int\limits_{\mathrlap{\,\lim\limits_{a}}}^{\overset{\lim\limits_{b}}{\top}}
\)
Matrix with Limits Above and Below
\(\displaystyle
\pmatrix{\overset{\text{up limit}}{a}&b\\c&\underset{\text{low limit}}{d}}
\)