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?

\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?

\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

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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.

Just for the record - this would fix that :

\begin{array}{@{}r@{}c@{}c

& \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}