I'm still new to latex. I've been having a problem with building a matrix and I have no idea what I'm doing (or what I'm doing wrong), so be gentle please 🙂
\begin{matrix}
5 & 6 & 7 \\
4 & P & 0 \\
3 & 2 & 1
\end{matrix}
This is the code for building the matrix and I keep getting error:
Misplaced alignment tab character & 5 &
...
Can anyone shine some light please?
Best Answer
The
matrix
macro is defined as part of the basic LaTeX distribution, but you're probably after theamsmath
implementation of it:The older (TeX)
\matrix
equivalent actually looks like this:Note that
\matrix
is a macro taking a single argument, and not an environment.