tags:

views:

88

answers:

3

im trying to get these to appear in the same line without any success, my coding is

\begin{equation}
P^+=\[ \left( \begin{array}{ccc}
1 & 0\\
0 & 0\end{array} \right)\]
P^-=\[ \left( \begin{array}{ccc}
0 & 0\\
0 & 1\end{array} \right)\]
\end{equation}

any hints or suggestions would be welcome

+2  A: 

Get rid of all the \[ and \], and add some space between them:

\begin{equation}
P^+= \left( \begin{array}{ccc}
1 & 0\\
0 & 0\end{array} \right)\qquad
P^-= \left( \begin{array}{ccc}
0 & 0\\
0 & 1\end{array} \right)
\end{equation}
Rob Hyndman
A: 

this is great

thanks rob!

cal
You should accept Rob's answer if it works: click on the tick outline on the left, under the O and downarrow.
Charles Stewart
Please accept Rob's answer if you find it useful.
Leonardo Herrera
+1  A: 

With the AMS-LaTeX package, you can accomplish this task more conveniently with the align and pmatrix environments:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
P^+ &= \begin{pmatrix}
    1 & 0 \\
    0 & 0
\end{pmatrix}
&
P^- &= \begin{pmatrix}
    0 & 0 \\
    0 & 1
\end{pmatrix}
\end{align}
\end{document}
las3rjock