How to Space Displayed Mathematical Equations

In a displayed mathematical equation with more than one component, how much space should be placed between the components?

Here are the guidelines I use, with examples in LaTeX. Recall that a \quad is approximately the width of a capital M and \qquad is twice the width of a \quad.

Case 1. Equation with Qualifying Expression

An equation or other mathematical construct is separated from a qualifying expression by a \quad. Examples:

\notag     |a_{ii}| \ge \displaystyle\sum_{j\ne i} |a_{ij}|, \quad i=1\colon n.

\notag       fl(x\mathbin{\mathrm{op}}y) = (x\mathbin{\mathrm{op}} y)(1+\delta), \quad |\delta|\le u,       \quad \mathbin{\mathrm{op}} =+,-,*,/.

\notag    y' = t^2+y^2, \quad 0\le t\le 1, \quad y(0)=0.

When the qualifying expression is a prepositional phrase it is given standard sentence spacing. Examples:

\notag \min_x c^Tx \quad \mathrm{subject~to~} Ax=b,~ x\ge 0.

\notag   \|J(v)-J(w)\| \le \theta_L \|v-w\| \quad   \mathrm{for~all~} v,w \in \mathbb{R}^n.

The first example was typed as (using the equation* environment provided by the amsmath package)

\min_x c^Tx \quad \text{subject to $Ax=b$, $x\ge 0$}.

Here, the qualifying phrase is placed inside a \text command, which jumps out of math mode and formats its argument as regular text, with the usual interword spacing in effect, and we re-enter math mode for the conditions. This is better than writing

\min_x c^Tx \quad \text{subject to} ~Ax=b, ~x\ge 0.

with hard spaces. Note that \text is a command from the amsmath package, and it is similar to the LaTeX command \mbox and the TeX command \hbox, both of which work equally well here.

Case 2. Equation with Conjunction

When an equation contains a conjunction such as and or or, the conjunction has a \quad on each side. Examples:

\notag      x = 1 \quad \mathrm{or} \quad x = 2.

\notag      a = \displaystyle\sum_{j=1}^n c_j v_j \quad \mathrm{where} \quad      c_j = \langle a,~ u_j\rangle~\mathrm{for}~j=1,2,\dots,n.

In the second example, one might argue for a \quad before the qualifying “for”, on the basis of case 1, but it I prefer the word spacing. This example was typed as

     a = \sum_{j=1}^n c_j v_j \quad \text{where} \quad
     \text{$c_j = \langle a, u_j\rangle$ for $j=1,2,\dots,n$}.

Case 3. Multiple Equations

Two or more equations are separated by a \qquad. Examples:

\notag  A = e_1^{}e_3^T, \qquad  B = e_1^{}e_4^T, \qquad  C = e_2^{}e_3^T, \qquad  D = e_2^{}e_4^T

\notag \begin{aligned}     AXA &= A,  \qquad  & XAX    &= X,\\  (AX)^* &= AX, \qquad  & (XA)^* &= XA. \end{aligned}


It is important to emphasize that one might diverge from following these (or any other) guidelines, for a variety of reasons. With a complicated display, or if a narrow text width is in use (as with a two-column format), horizontal space may be at a premium so one may need to reduce the spacing. And the guidelines do not cover every possible situation.


My guidelines are the same ones that were used in typesetting the Princeton Companion to Applied Mathematics, and I am grateful to Sam Clark (T&T Productions), copy editor and typesetter of the Companion, for discussions about them. Cases 1 and 3 are recommended in my Handbook of Writing for the Mathematical Sciences (2017).

The SIAM Style Guide (link to PDF) prefers a \qquad in Case 1 and \quad in Case 3 with three or more equations. The AMS Style Guide (link to PDF) has the same guidelines as SIAM. Both SIAM and the AMS allow an author to use just a \quad between an equation an a qualifying expression.

In the TeXbook (1986, p. 166), Knuth advocates using a \qquad between an equation and a qualifying expression.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s