Change font color of a column in a matrix
If you want to automate this process for an entire column, then you need to have access to the column specification. This is not possible via amsmath
's *matrix
environments. Instead, use array
and insert \color{red}
in front of every entry using the >{<prefix>}
specification:
\documentclass{article}
\usepackage{amsmath,array,xcolor}
\begin{document}
$
A = \begin{bmatrix}
a & b & c & d \\
a & b & c & d \\
a & b & c & d \\
a & b & c & d
\end{bmatrix} \qquad
\left[\begin{array}{@{} >{\color{red}}c c >{\color{red}}c c @{}}
a & b & c & d \\
a & b & c & d \\
a & b & c & d \\
a & b & c & d
\end{array}\right] = A
$
\end{document}
A Little bit easier!
\documentclass[a4paper,11pt]{article}
\usepackage{amsmath}
\usepackage{color}
\begin{document}
\[
A =
\def\b{b}
\def\d{d}
\def\a{\color{red}a}
\def\c{\color{red}c}
\begin{bmatrix}
\a & \b & \c & \d \\
\a & \b & \c & \d \\
\a & \b & \c & \d \\
\a & \b & \c & \d \\
\end{bmatrix}
\]
\end{document}