Matrix Row & Column Labels in Latex

  • LaTeX
  • Thread starter Moonshine
  • Start date
  • #1
32
0

Main Question or Discussion Point

Hello, I'm new to Latex and I'm having some problems creating a 5 x 5 matrix. I need to label each column 1 through 5 and I need to label each row 1 through 5. I need the row labels to be on the right side. I've found a couple of links online, but they only show how to label rows on the left side of the matrix.

Also, I need to write some text to the right of the matrix.

I'm new to all of this so any help would be greatly appreciated.
 

Answers and Replies

  • #2
230
0
This might be overkill, but you could use http://en.wikipedia.org/wiki/PGF/TikZ" [Broken].
 
Last edited by a moderator:
  • #3
7
0
"Also, I need to write some text to the right of the matrix. "
If you need to write text anywhere in the matrices use \mbox{the text you need}
for example
\[ \left( \begin{array}{cc}
a & b \\
c & d \end{array} \right),\mbox{the text you need} \]
 
  • #4
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
682
One obvious solution is to make your matrix a 6x6 matrix, with the first row containing the column labels and the last column in each row containing the row labels.
 
  • #5
7
0
Dear D.H may be you could help me?
Could you say how I could automatically numerate matrices as equations. Beforehand thank you.
 
  • #6
D H
Staff Emeritus
Science Advisor
Insights Author
15,393
682
A 2x2 matrix with column labels on top and row labels on the right:

[tex]\begin{array}{cc|l}
\text{Col 1} & \text{Col 2} & \\
\hline
1 & 2 & \text{Row 1} \\
3 & 4 & \text{Row 2}
\end{array}[/tex]

Versus on the left:

[tex]\begin{array}{l|cc}
& \text{Col 1} & \text{Col 2} \\
\hline
\text{Row 1} & 1 & 2 \\
\text{Row 2} & 3 & 4
\end{array}[/tex]

The tabular environment is also an option. (The tabular environment does not work in this forum; the LaTeX here is aimed at mathematics only.)
 

Related Threads for: Matrix Row & Column Labels in Latex

Replies
2
Views
4K
Replies
11
Views
3K
Replies
1
Views
19K
Replies
2
Views
4K
Replies
1
Views
3K
Replies
16
Views
4K
Top