Code: Select all
\begin{equation}
M = \left[ \begin{array}{c|ccc}
A & 0 & 0 & 0 \\
\hline 0 & B & 0 & 0 \\
0 & 0 & C & 0 \\
0 & 0 & 0 & D \\
\end{array} \right]
\end{equation}
Code: Select all
\begin{equation}
M = \left[ \begin{array}{c|ccc}
A & 0 & 0 & 0 \\
\hline 0 & B & 0 & 0 \\
0 & 0 & C & 0 \\
0 & 0 & 0 & D \\
\end{array} \right]
\end{equation}
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Code: Select all
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[dvipsnames,table]{xcolor}
\begin{document}
\begin{equation}
\arrayrulecolor{gray!50}
M = \left[
\begin{array}{c|ccc}
A & 0 & 0 & 0 \\
\hline 0 & B & 0 & 0 \\
0 & 0 & C & 0 \\
0 & 0 & 0 & D \\
\end{array}
\right]
\end{equation}
\end{document}
Just habit. Drop it if you want. For details about this option see the xcolor manual.Cham wrote:[…] But why the option "dvipsnames"? […]
It's a percentage value. For details about color specification see the xcolor manual.Cham wrote:[…] And what is the range of the gray color parameter ? I thought that it was from 0 to 255, but it gives an error if above 200.
A percentage ? It should then give an error if the value is higher than 100%. I don't get any error until 201.localghost wrote: It's a percentage value.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis