Getting two matrices in one row

im trying to make them appear on the same line without any success, my coding

\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 tips or suggestions would be welcome.

+3
source share
2 answers

Get rid of everyone \[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}
+6
source

With AMS-LaTeX, you can perform this task more conveniently with environments alignand pmatrix:

\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}
+4
source

Source: https://habr.com/ru/post/1726609/


All Articles