[Tex/LaTex] Centered set of equations with single numbering

alignequationsnumbering

If I want a set of centered equations, \begin{gather} \end{gather} does the job:

\begin{gather}
  i^2 = j^2 = k^2 = -1\\
  ij = -ji = k
\end{gather}

enter image description here

If I want a set of equations with single numbering, \begin{split} \end{split} does the job:

\begin{align}
  \begin{split}
    i^2 = j^2 = k^2 = -1\\
    ij = -ji = k
  \end{split}
\end{align}

enter image description here

However combining the two doesn't work: I get the same result as above (non centered) if I do

\begin{gather}
  \begin{split}
    i^2 = j^2 = k^2 = -1\\
    ij = -ji = k
  \end{split}
\end{gather}

How do I fix that? Thanks in advance.

Best Answer

The gathered environment has been designed for this purpose.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  \begin{gathered}
    i^2 = j^2 = k^2 = -1\\
    ij = -ji = k
  \end{gathered}
\end{equation}
\end{document}

enter image description here

Related Question