[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Labeling matrix columns in LaTeX

Posted on 2007-08-01
5
Medium Priority
?
11,092 Views
Last Modified: 2013-12-02
I display a matrix in LaTeX with the following code:

\left(
\begin{array}{ccc}
   1 & 1 & 1 \\
   0 & 1 & 2
\end{array}
\right)

I want to give a name for the columns, e.g. the first one would be u vector.
How can these labels put above the columns without messing up the parentheses around the matrix?
0
Comment
Question by:pallosp
  • 3
  • 2
5 Comments
 
LVL 53

Expert Comment

by:Infinity08
ID: 19608031
With my limited knowledge of LaTeX, something like this comes close (but isn't perfect) :

  \begin{array}{rcccl}
    & u vector & v vector & w vector &  \\
    \left.\begin{array}{c} \\ \\ \\ \end{array}\right(
                      & \begin{array}{c} a \\ d \\ g \end{array}
                      & \begin{array}{c} b \\ e \\ h \end{array}
                      & \begin{array}{c} c \\ f \\ i \end{array}
                      & \left)\begin{array}{c} \\ \\ \\ \end{array}\right.
  \end{array}

There's probably an easier solution heh
0
 
LVL 9

Author Comment

by:pallosp
ID: 19608091
The layout produced by your code is correct, but there is too much space between the columns if the labels consist of one character, for instance \vec{u} is written above the first column.
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 19608188
I know it's not perfect, and I've got a suspicion that there's an easier way of doing what you want - but I don't know it :)

You'll have to wait for a real LaTeX expert heh.
0
 
LVL 53

Accepted Solution

by:
Infinity08 earned 1000 total points
ID: 19608317
>> but there is too much space between the columns

Just for the record - this would fix that :

  \begin{array}{@{}r@{}c@{}c@{}c@{}l@{}}
    & \vec{u} & \vec{v} & \vec{w} &  \\
    \left.\begin{array}{c} \\ \\ \\ \end{array}\right(
                    & \begin{array}{c} a \\ d \\ g \end{array}
                    & \begin{array}{c} b \\ e \\ h \end{array}
                          & \begin{array}{c} c \\ f \\ i \end{array}
                          & \left)\begin{array}{c} \\ \\ \\ \end{array}\right.
  \end{array}
0
 
LVL 9

Author Comment

by:pallosp
ID: 19608481
Perfect appearance, thank you!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ability to automatically add page numbers to a layout is one of the many easy, convenient features InDesign has to offer. There are many reasons why you would want to automatically generate page numbers in your next project, so whether it’s a ma…
Article by: Nicole
This is a research brief on the potential colonization of humans on Mars.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Suggested Courses

865 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question