Math & SciencePutting headings in matrices

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
MadEgg
Posts: 5
Joined: Wed Feb 04, 2009 4:13 pm

Putting headings in matrices

Post by MadEgg »

Hi all

I want to put a matrix in my LaTeX document, but I want to label each row and each column AND put brackets around the contents of the matrix. Something like this:

Code: Select all

       col1  col2
row1 /  a     b  \
row2 \  c     d  /
Here row1, row2, col1 and col2 indicate the titles/captions of each row and column.

I tried making a 3x3 matrix but I cannot see how I would get the brackets spanning multiple rows of the matrix. Is there any way to go about this?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Putting headings in matrices

Post by localghost »

Some other topics might help you [1,2]. Perhaps the "Math mode" document has some more solutions.

[1] View topic: Matrix row and column numbers
[2] View topic: type outside the borders of matrix


Best regards
Thorsten¹
MadEgg
Posts: 5
Joined: Wed Feb 04, 2009 4:13 pm

Re: Putting headings in matrices

Post by MadEgg »

Right, I tried searching but did not find anything. The first link provides an example doing just what I want, although the code is quite long for something not that complex. Let's see if I can store this somewhere where I can find it again when I need it.

Thanks for the help!
Post Reply