I need your help to obtain the grey bars in this matrix:
Asked
Active
Viewed 435 times
2
Mico
- 506,678
user154138
- 41
- 2
-
Hello Mico, How I can obtain the the grey bar? – user154138 Feb 17 '18 at 18:17
-
Look also at this answer of mine: https://tex.stackexchange.com/a/415864/101651. – CarLaTeX Feb 17 '18 at 21:35
1 Answers
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.)
\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

