Skip to main content

Display_style_in_math_mode

This article explains how to manually adjust the style of mathematical typesetting—but first, let's quickly review the obvious differences between inline and display mathematics.

Mathematical typesetting contained within paragraph text needs to occupy less space than the same mathematics typeset outside paragraph text as independent, display-style material. To see this in practice, let's explain that the equation f(x)=∑ni=0ai1+x may diverge or converge, depending on the value of x.

Occasionally, you might want to change the default style used for typesetting a piece of mathematics. For example, you might want to change inline mathematics like f(x)=11+x and include it in a paragraph but typeset it in display style: f(x)=11+x, even though it has a significant impact on line spacing.

The TeX engine provides several commands that can be used to override the default typesetting style for mathematical work.

\textstyle: Style applied to mathematical typesetting within paragraphs

\displaystyle: Style applied to the typesetting of mathematics itself.

\scriptstyle: Style applied to subscripts or superscripts

\scriptscriptstyle: Style applied to second-order subscripts or superscripts

\[
a_0+{1\over a_1+
{1\over a_2+
{1 \over a_3 +
{1 \over a_4}}}}
\]

The default typesetting style can be modified by using the \displaystyle command:

\[
a_0+{1\over\displaystyle a_1+
{1\over\displaystyle a_2+
{1 \over\displaystyle a_3 +
{1 \over\displaystyle a_4}}}}
\]

Here's another example showing the effects of \textstyle, \scriptstyle, and \scriptscriptstyle.

\[
\begin{eqnarray*}
f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\textstyle f(x) = \textstyle \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\scriptstyle f(x) = \scriptstyle \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\scriptscriptstyle f(x) = \scriptscriptstyle \sum_{i=0}^{n} \frac{a_i}{1+x}
\end{eqnarray*}
\]

Here's an example you can open in Overleaf:

\documentclass{article}
\usepackage{amsmath}
\title{Exploring math display styles}
\author{Overleaf team}
\begin{document}
\maketitle
Depending on the value of \(x\) the equation \( f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \) may diverge or converge.

\[ f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \]

\vspace{1cm}

Inline maths elements can be set with a different style: \(f(x) = \displaystyle \frac{1}{1+x}\). The same is true for display math material:

\begin{eqnarray*}
f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\textstyle f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\scriptstyle f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \\
\scriptscriptstyle f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x}
\end{eqnarray*}
\end{document}