# Options for tikzcd

I like to pass options for a specific column (or row) in a tikzcd diagram. The obvious choice column x/.style=... does not work. I think the problem is connected with the hierarchy of styles.

## Code:

\documentclass{article}
\usepackage{tikz}

\begin{document}
Does not work:
\begin{tikzcd}[column 2/.style=red]
8 & 1 \\
3 & 5  \\
4 & 9  \\
\end{tikzcd}
Does work:
\begin{tikzpicture}[column 2/.style=red]
\matrix [matrix of nodes]
{
8 & 1 \\
3 & 5  \\
4 & 9  \\
};
\end{tikzpicture}
\end{document}


• every matrix/.append style={/tikz/column 2/.style=red} might already do it. Dec 5, 2014 at 16:09

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}
\emph{Does} work:
\begin{tikzcd}[/tikz/column 2/.style=red]
8 & 1 \\
3 & 5  \\
4 & 9  \\
\end{tikzcd}
\end{document}


We need to specify the full path of the /tikz/column 2 style because options passed to {tikzcd} are executed in the path /tikz/commutative diagrams. The code in your questions creates a style /tikz/commutative diagrams/column 2.