Is it possible to use a TikZ matrix along a chain?

The nodes on the chains are named as (chainname-#) but this naming scheme is not provided to the matrix (seems like a bug). So the safest way is to name your matrix nodes on the chain explicitly.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,chains,matrix}
\begin{document}
\begin{tikzpicture}[start chain]
  \node [on chain] {XYZ};
  \node [on chain] {123};
  \node [on chain,matrix of nodes]  (chain-3) {    A \\    B \\    C \\  };
  \node [on chain] {$\alpha\beta\gamma$};
\end{tikzpicture}
\end{document}

enter image description here


I ran into the same issue, and I worked around it by putting the matrix inside a nested tikzpicture i.e.

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{positioning,chains}

\begin{document}

\begin{tikzpicture}[start chain]
  \node [on chain] {XYZ};

  \node [on chain] {
    \begin{tikzpicture}
      \matrix
      {
        \node {A}; \\
        \node {B}; \\
        \node {C}; \\
      };
    \end{tikzpicture}
  };
  \node [on chain] {123};
\end{tikzpicture}

\end{document}