2

I need your help to obtain the grey bars in this matrix:

enter image description here

Mico
  • 506,678
user154138
  • 41
  • 2

1 Answers1

3

I suggest you load the xcolor and colortbl packages and use the \rowcolor and \columncolor macros with suitable color (or grayness) choices. (I use the pre-defined color called "lightgray" below; your preferences may lean to other colors or shades of gray.)

enter image description here

\documentclass{article}
\usepackage[table]{xcolor} % load 'colortbl' package in background
\begin{document}
\[
\left( \begin{array}{cc >{\columncolor{lightgray}}c cc}
   a & b & c & d & e \\
   \rowcolor{lightgray}f & g & h & i & j\\
   k & l & m & n & o
   \end{array}\right)
\]
\end{document}

If the cell where the horizontal and vertical bars intersect needs to be a bit darker, you could insert the directive \cellcolor[gray]{.6} at the start of the cell.

Mico
  • 506,678