I would like to align a TikZ tree with another node by considering the tree as a whole like as if it was a node with anchors. For the moment I am only able to align the root node of the tree, not the whole tree itself. I use PGF 2.10.
The following picture shows what I have:
What I want is that the left node and the tree are horizontally aligned and the arrow goes from the east anchor of the left node to the west anchor of the tree, i.e. more or less the left child of the root node as shown here:
Please ignore the outer border on both images.
Do you know a way to achieve this?
My test code is given below. I compile it with xelatex
.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,calc,positioning,trees}
\usepackage[graphics,tightpage,active]{preview}
\PreviewEnvironment{tikzpicture}
\newlength{\imagewidth}
\newlength{\imagescale}
\begin{document}
\begin{tikzpicture}[
->, >=stealth', shorten >=1pt, semithick, node distance=1cm, level distance=7mm, level/.style={sibling distance=10mm/#1},
block/.style = {draw, rectangle, rounded corners, minimum height=1cm},
every node/.style={circle, draw, fill=none, anchor=north}
]
\node [block] (SOURCE DOCUMENT) {\parbox{2cm}{\centering source document}};
\node (SOURCE TREE)[right=of SOURCE DOCUMENT] {}
child { node {} }
child { node {}
child { node {} }
child { node {} }
};
\draw [->] (SOURCE DOCUMENT) edge (SOURCE TREE);
\end{tikzpicture}
\end{document}