LaTeX How to create a labelled matrix in LaTeX?

  • Thread starter Thread starter rwinston
  • Start date Start date
  • Tags Tags
    Latex Matrix
AI Thread Summary
Creating a labeled matrix in LaTeX can be achieved using the `bordermatrix` command from plain TeX, which allows for the inclusion of row and column labels. An example provided demonstrates how to format a matrix with labels for both rows and columns, using parentheses instead of braces. For those seeking more flexibility, the `kbordermatrix` package is recommended as it offers additional options, including the ability to customize delimiters. This approach effectively meets the need for a labeled matrix format in LaTeX.
rwinston
Messages
36
Reaction score
0
Hi

does anybody know how to create a labelled matrix in LaTeX? By which I mean something like this:
a b
a [ 1 0 ]
b [ 0 1 ]

Where the inner elements are within the braces, but there are tabular label elements for the rows and columns (a and b). Cant get it too look right!

Cheers
 
Physics news on Phys.org
Hi rwinston,

If you don't mind parenthesis instead of braces you can use bordermatrix from plain TeX:

<br /> \bordermatrix{&amp;a_1&amp;a_2&amp; a_3 \cr<br /> b_1 &amp; 1 &amp; 2 &amp; 3 \cr<br /> b_2 &amp; 2 &amp; 3 &amp; 4 \cr<br /> b_3 &amp; 3 &amp; 4 &amp; 5 \cr}<br />


<br /> \bordermatrix{&amp;a_1&amp;a_2\cr<br /> b_1 &amp; 1 &amp; 2 \cr<br /> b_2 &amp; 2 &amp; 3 \cr}<br />


<br /> \bordermatrix{&amp;a_1&amp;a_2 \cr<br /> b_1 &amp; 1 &amp; 2 \cr<br /> b_2 &amp; 2 &amp; 3 \cr<br /> b_3 &amp; 3 &amp; 4 \cr}<br />

There is also a newer kbordermatrix package that you can use that gives more options (such as being able to change the delimiters).
 
Thanks! Thats exactly what I need!
 

Similar threads

Replies
1
Views
2K
Replies
3
Views
2K
Replies
11
Views
5K
Replies
5
Views
18K
Replies
7
Views
3K
Replies
3
Views
2K
Replies
1
Views
5K
Back
Top