# Simple newline in equation [duplicate]

This question already has an answer here:

I'm trying to line-break in the middle of a series of defined matrices. The code looks like:

$$I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, Y = \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix}, \\ Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}, H = \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, S = \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.$$


However the matrices appear all in one line.

## marked as duplicate by jub0bs, Claudio Fiandrino, Heiko Oberdiek, Thomas F. Sturm, ArTourterApr 3 '14 at 12:51

• Use gather or align instead of equation. Side note: are you sure you want to use \imath here? Why not just i? – jub0bs Apr 3 '14 at 11:50
• Thanks! It seems like \begin{split} was a good fix for this. Also I used \imath because I will potentially use many different i's in my paper, so I want to stylize them so that readers can differentiate. – user3358302 Apr 3 '14 at 11:54
• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Apr 3 '14 at 12:15

To elaborate on Argos suggestion. In this case I'd use

\begin{gather*}
I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad
X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad
Y = \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix}, \\
Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}, \quad
H = \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \quad
S = \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.
\end{gather*}


no numbering and better space

Alignment and a single number

\begin{gather}
\begin{aligned}
I &= \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},
& % seperation
X &= \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix},
&
Y &= \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix},
\\
Z &= \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},
&
H &= \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix},
&
S &= \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.
\end{aligned}
\end{gather}


Please see the amsmath manual for for details

The two examples will look like this:

• Thanks, this works too! However in this case there is absolutely no numbering which isn't ideal either. So far the {split} method works so I think I'll use that – user3358302 Apr 3 '14 at 11:59
• That is not a good idea as split can only handle one alignment row, I'll make an update – daleif Apr 3 '14 at 12:04

Try using align from the AMS-math package for multi-line equations, it's a lot easier.

\begin{align}
I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix},
X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix},
Y = \begin{pmatrix} 0 & \imath \\ -\imath & 0 \end{pmatrix}, \\
Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},
H = \frac{1}{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix},
S = \begin{pmatrix} 1 & 0 \\ 0 & \imath \end{pmatrix}.
\end{align}


• This would be helpful, however each new-line in the align enviornment is enumerated. so each line of these matricies would be denoted (1) and (2) on the far right. – user3358302 Apr 3 '14 at 11:50
• See my follow up to Argos suggestion – daleif Apr 3 '14 at 11:53