Trying to make a tree where each child is a set of nodes that can be created separately and then linked somehow in to different positions in a tree.
Lets say I have a group of nodes and edges such as
\node (1) at (0,1) {1};
\node (2) at (0,2) {2};
\draw(->, bend left=90, dotted) (1.north) -- (2.north);
I have looked at trees and it seems that each child can only be one node. I would like to be able to use, for example, the three above commands and treat them as one child (and have the relative coordinates kept within a child). Perhaps it is possible to do this with a macro(?) although I can't find any examples/literature on it.
For example, something like the following:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node {root}
child {\node (1) at (0,0) {A}; \node (1) at (0,0) {B}};
child {\node (1) at (0,0) {C}; \node (1) at (0,0) {D}
child {\node (1) at (0,0) {C};}
child {\node (1) at (0,0) {D};}
};
\end{tikzpicture}
\end{document}
\documentclass
and loading the necessary packages. As it stands your final example does not produce a valid tree: for examplenode
should be used instead of\node
except at the root.pics
(pgfmanual, section 18) but I'm not sure about their use intrees
.