Matrix Row & Column Labels in Latex

Click For Summary

Discussion Overview

The discussion centers around creating a 5 x 5 matrix in LaTeX with specific labeling requirements. Participants explore how to position row labels on the right side of the matrix and how to include additional text to the right of the matrix. The conversation includes various approaches and suggestions for formatting matrices in LaTeX.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Homework-related

Main Points Raised

  • One participant expresses difficulty in labeling rows and columns in a 5 x 5 matrix, specifically wanting row labels on the right side.
  • Another suggests using PGF/TikZ for more complex matrix formatting, though it may be considered overkill for the task.
  • A participant provides a method to include text alongside the matrix using \mbox{the text you need}.
  • One proposed solution is to create a 6x6 matrix, using the first row for column labels and the last column for row labels.
  • A participant shares examples of a 2x2 matrix with both right-aligned and left-aligned row labels, discussing the use of the array environment and noting limitations of the tabular environment in the forum context.
  • Another participant inquires about automatically numbering matrices as equations, seeking further assistance.

Areas of Agreement / Disagreement

Participants present multiple approaches and suggestions, indicating that there is no single agreed-upon method for achieving the desired matrix formatting. The discussion remains open with various competing views on how to best label the matrix.

Contextual Notes

Some methods suggested may depend on specific LaTeX packages or environments that could affect their applicability. There are also unresolved questions regarding automatic numbering of matrices.

Moonshine
Messages
31
Reaction score
0
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.
 
Physics news on Phys.org
This might be overkill, but you could use http://en.wikipedia.org/wiki/PGF/TikZ" .
 
Last edited by a moderator:
"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} \]
 
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.
 
Dear D.H may be you could help me?
Could you say how I could automatically numerate matrices as equations. Beforehand thank you.
 
A 2x2 matrix with column labels on top and row labels on the right:

\begin{array}{cc|l}<br /> \text{Col 1} &amp; \text{Col 2} &amp; \\<br /> \hline<br /> 1 &amp; 2 &amp; \text{Row 1} \\<br /> 3 &amp; 4 &amp; \text{Row 2}<br /> \end{array}

Versus on the left:

\begin{array}{l|cc}<br /> &amp; \text{Col 1} &amp; \text{Col 2} \\<br /> \hline<br /> \text{Row 1} &amp; 1 &amp; 2 \\<br /> \text{Row 2} &amp; 3 &amp; 4<br /> \end{array}

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

Similar threads

  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
5K