3

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

\begin{equation}
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{equation}

However the matrices appear all in one line.

  • 1
    Use gather or align instead of equation. Side note: are you sure you want to use \imath here? Why not just i? – jub0bs Apr 03 '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 03 '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}. –  Apr 03 '14 at 12:15

2 Answers2

4

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:

enter image description here

daleif
  • 54,450
  • 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 03 '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 03 '14 at 12:04
0

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}

enter image description here

Argo
  • 1,724