TikZ-PGF Diagrams Nodes – Overlapping Nodes in TikZ

diagramsnodestikz-chainstikz-pgf

I used to make a chain diagram in tikz, like described in the manual p. 59 ff, but in contrast to the manual, my nodes are overlapping. I tried to use the "node distance" option but i doesn't seem to work. Below is the minimal working example (writeLatex.com):

\documentclass[12pt]{scrartcl}

\usepackage{tikz}

\begin{document}

\begin{figure}[tb]
    \begin{center}
    \begin{tikzpicture}[
            % copy to preamble to use it everywhere \tikzset{node/.style...}
            node/.style={
                % shape
                rectangle,
                rounded corners=1mm,
                minimum size=6mm,
                %border
                thick,
                draw,
            },
            dummy/.style={
                % shape
                rectangle,
                rounded corners=1mm,
                minimum size=6mm,
                %border
                thick,
            },
            node distance=10mm
            ]
            \node(wadl)[node]{WADL-Datei};
            \node(xsd1)[node,below left of=wadl]{XSD-Datei};
            \node(...)[dummy,below of=wadl]{\ldots};
            \node(xsd3)[node,below right of=wadl]{XSD-Datei};
            \node(test)[node,right of=wadl]{test};

            \path(wadl) edge[->] (test);
        \end{tikzpicture}   
    \end{center}
    \caption{Codegeneratorsystem}
    \label{fig:codegeneratorsystem}
\end{figure}

\end{document}

enter image description here

Best Answer

To have the nodes properly positionated relative to other nodes, you have to include the positioning tikz library. and change the syntax of your relative positioning from below of=node to below = of node, i.e., the equal sign comes before the of keyword.

This way:

\usetikzlibrary{positioning}

\begin{figure}[tb]
    \begin{center}
    \begin{tikzpicture}[
            % copy to preamble to use it everywhere \tikzset{node/.style...}
            node/.style={
                % shape
                rectangle,
                rounded corners=1mm,
                minimum size=6mm,
                %border
                thick,
                draw,
            },
            dummy/.style={
                % shape
                rectangle,
                rounded corners=1mm,
                minimum size=6mm,
                %border
                thick,
            },
            node distance=10mm
            ]
            \node(wadl)[node]{WADL-Datei};
            \node(xsd1)[node,below left=of wadl]{XSD-Datei};
            \node(...)[dummy,below= of wadl]{\ldots};
            \node(xsd3)[node,below right=of wadl]{XSD-Datei};
            \node(test)[node,right=of wadl]{test};

            \path(wadl) edge[->] (test);
        \end{tikzpicture}   
    \end{center}
    \caption{Codegeneratorsystem}
    \label{fig:codegeneratorsystem}
\end{figure}

Which produces this result:

Result