Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to create a labelled matrix in LaTeX?

  1. May 28, 2008 #1
    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
     
  2. jcsd
  3. May 28, 2008 #2

    alphysicist

    User Avatar
    Homework Helper

    Hi rwinston,

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

    [tex]
    \bordermatrix{&a_1&a_2& a_3 \cr
    b_1 & 1 & 2 & 3 \cr
    b_2 & 2 & 3 & 4 \cr
    b_3 & 3 & 4 & 5 \cr}
    [/tex]


    [tex]
    \bordermatrix{&a_1&a_2\cr
    b_1 & 1 & 2 \cr
    b_2 & 2 & 3 \cr}
    [/tex]


    [tex]
    \bordermatrix{&a_1&a_2 \cr
    b_1 & 1 & 2 \cr
    b_2 & 2 & 3 \cr
    b_3 & 3 & 4 \cr}
    [/tex]

    There is also a newer kbordermatrix package that you can use that gives more options (such as being able to change the delimiters).
     
  4. Jun 10, 2008 #3
    Thanks! Thats exactly what I need!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: How to create a labelled matrix in LaTeX?
Loading...