# Error when combining a chain and matrix with TikZ

I am getting started with TikZ and would like to create complex flow chart. To get used to the package, I want to start simple. However, I already fail at making a simple chain in combination with a matrix.

The code shown in the minial example below throws the error: no shape named chain-2 is known. Why is that? Where is my error?

\documentclass{article}

\usepackage{tikz}                       %% Create drawings in LaTeX
\usetikzlibrary{matrix,shapes,arrows,positioning,chains}

\begin{document}

\tikzstyle{block} = [rectangle, fill=blue!20, minimum height=3em, minimum width=6em, font=\footnotesize]

\begin{tikzpicture}
\matrix[row sep=1mm, column sep=2 mm] {
% Central row:
\node (p1)          []      {.};                    &
\node (stoffVor)    [block] {Stoffvorbereitung};    &
\node (p2)          []      {.};                    &
\node (haupt)       [block] {Hauptanlage};          &
\node (stoffNach)   [block] {Stoffnachbereitung};\\
};

\begin{scope}[start chain]
\chainin (p1);
\chainin (stoffvor);
\chainin (p2);
\end{scope}
\end{tikzpicture}

\end{document}

-

You have a typo:

\begin{scope}[start chain]
\chainin (p1);
\chainin (stoffVor);
\chainin (p2);
\end{scope}


stoffVor has lowercase v in your example. The code is case sensitive and the error messaging is not always accurately redirecting to the actual error (I just wonder why?). If you get an error message, it is a good idea to check also the line before.

Happy TikZ-ing! :)

-
Oh my god, embarrassing ;). Thanks! –  Ingo Oct 8 '11 at 10:59
Don't worry, happens to the best, too ;) –  Count Zero Oct 8 '11 at 11:00