# Boxed Matrix entries

• November 27th 2009, 06:16 PM
Fibon
Boxed Matrix entries
Hello, I was wondering if some knows how to put a box around all the 4 entries marked with * in the 3x3 matrix below:

\begin{pmatrix}
a* & b* & c\\
d* & e* & f
\end{pmatrix}

I am trying to put one box around all 4 entries, and not 4 separate boxes around each of the entries. Thank you in advance.
• November 28th 2009, 01:22 AM
Opalg
Quote:

Originally Posted by Fibon
Hello, I was wondering if some knows how to put a box around all the 4 entries marked with * in the 3x3 matrix below:

\begin{pmatrix}
a* & b* & c\\
d* & e* & f
\end{pmatrix}

I am trying to put one box around all 4 entries, and not 4 separate boxes around each of the entries. Thank you in advance.

The easiest way would be like this:

$\begin{pmatrix}
\boxed{\begin{array}{cc}a* & b*\\
d* & e*\end{array}}&\begin{array}{c}c \\ f\end{array}
\end{pmatrix}$

(\begin{pmatrix} \boxed{\begin{array}{cc}a* & b*\\ d* & e*\end{array}}&\begin{array}{c}c \\ f\end{array} \end{pmatrix}).

If you don't like the spacing in that, then you can refine it by using an array instead of a pmatrix:

$\left(\begin{array}{c@{\hspace{1pt}}c@{}}
\boxed{\begin{array}{cc}a* & b*\\
d* & e*\end{array}}&\begin{array}{c}c \\ f\end{array}
\end{array}\right)$

(\left(\begin{array}{c@{\hspace{1pt}}c@{}} \boxed{\begin{array}{cc}a* & b*\\ d* & e*\end{array}}&\begin{array}{c}c \\ f\end{array} \end{array}\right)).
• November 28th 2009, 03:07 AM
Fibon
Thank you very much for the help, I now solved my problem partially, and I was wondering if you may have any further suggestions.

For the entries marked with *, I use the \cellcolor command in combination from the package \usepackage[table,svgnames]{xcolor} (I am coloring the entries a,b and d green and yellow) but this leaves a white space on the inside of the box and the coloured entries, and i was wondering if you know any solution to get rid of this white space.

I'm sorry for all the trouble, I have never used boxes in Latex before and unfortunately cannot find any documentation on this anywhere else.