Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

\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.

share|improve this question

marked as duplicate by Jubobs, Claudio Fiandrino, Heiko Oberdiek, Thomas F. Sturm, ArTourter Apr 3 at 12:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

2 Answers 2

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

share|improve this answer
    
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 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 at 12:04
    
Thanks a lot, the spacing in this is better too :) –  user3358302 Apr 3 at 12:18

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

share|improve this answer
    
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 at 11:50
    
See my follow up to Argos suggestion –  daleif Apr 3 at 11:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.