Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

1 Answer 1

up vote 2 down vote accepted

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! :)

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.