# Array in MHL Latex

• Jun 10th 2013, 06:53 PM
zhandele
Array in MHL Latex
I tried to create a 7x5 matrix in MHL latex. I wrote this code, but I keep getting an "invalid equation" error. I really don't know what I did wrong. Can anybody point out my mistake? Thanks.

\begin{array}{cc}1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\ 0&0&0&1&0\\0&0&0&0&1\\0&0&0&0&0\\0&0&0&0&0\end{arr ay}

$\begin{array}{cc}1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\ 0&0&0&1&0\\0&0&0&0&1\\0&0&0&0&0\\end{array}" alt="\begin{array}{cc}1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\ 0&0&0&1&0\\0&0&0&0&1\\0&0&0&0&0\\end{array}" />
• Jun 10th 2013, 07:49 PM
topsquark
Re: Array in MHL Latex
There are some small changes I made. First off I've never liked the "array" command...I prefer "matrix." Second, I moved the "tex" command to be sandwiched between the "font" and "color." I don't see any actual color there so maybe something else needs to be done. Third, there was a \\end. I removed the extra \.

$$\begin{matrix}1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\0&0 &0&1&0\\0&0&0&0&1\\0&0&0&0&0\\0&0&0&0&0\end{matrix }$$

[TEX]\begin{matrix}1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\0&0 &0&1&0\\0&0&0&0&1\\0&0&0&0&0\end{matrix}[/TEX]

gives

$\begin{matrix}1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\0&0 &0&1&0\\0&0&0&0&1\\0&0&0&0&0\\0&0&0&0&0\end{matrix }$

$\begin{matrix}1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\0&0 &0&1&0\\0&0&0&0&1\\0&0&0&0&0\end{matrix}"$ $ alt="\begin{array}{cc}1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\ 0&0&0&1&0\\0&0&0&0&1\\0&0&0&0&0\\end{array}"" alt=" alt="\begin{array}{cc}1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\ 0&0&0&1&0\\0&0&0&0&1\\0&0&0&0&0\\end{array}"" />

I don't know what "alt = " is supposed to do. Sorry!

-Dan
• Jun 11th 2013, 02:10 AM
emakarov
Re: Array in MHL Latex
Matrix:

$\begin{matrix}1&0&0&0&0\\0&1&0&0&0\\0&0&1&0&0\\0&0 &0&1&0\\0&0&0&0&1\\0&0&0&0&0\\0&0&0&0&0\end{matrix }$

Array:

$\begin{array}{ccccc}1&0&0&0&0\\ 0&1&0&0&0\\ 0&0&1&0&0\\ 0&0&0&1&0\\ 0&0&0&0&1\\ 0&0&0&0&0 \end{array}$

Insert spaces at least every 50 characters, but avoid newlines in math formulas.
• Jun 11th 2013, 07:25 AM
zhandele
Re: Array in MHL Latex
So that's it! You have to include {ccccc} in the array command for five columns! Maybe that should be explained in our pdf handout. Many thanks.