
Estou tendo um problema ao tentar conectar as bordas de alguns nós (estou fazendo isso no verso). Se eu escolher apenas um dos nós na parte superior e conectar as arestas aos nós que pretendo usar na parte inferior, não haverá problemas de compilação. Tento fazer isso com o outro nó na parte superior, conforme escrito no meu código, mas ele não compila. Acredito que exista uma maneira mais eficiente de fazer isso, mas não vejo nenhum erro no que tenho. Espero que alguém possa me ajudar com isso. Qualquer ajuda, muito apreciada.
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}
\let\oldemptyset\emptyset
\let\emptyset\varnothing
\begin{document}
\begin{tikzpicture}[every node/.style={circle,draw=black},scale=0.75,every
node/.append style={transform shape}]
\node(tre1)[circle,draw,scale=0.5]{
\begin{tikzpicture}
\node(one){1}
child{node{2}}
child{node{3}};
\end{tikzpicture}
};
\node(tre2)[circle,draw,scale=0.5] [right of=tre1,xshift=6.2cm]{
\begin{tikzpicture}
\node(tree2){1}
child{node{2}
child{node{3}}};
\end{tikzpicture}
};
\node at ($(tre1) + (-3.5,-4.5)$)[circle,draw,scale=0.65](tr1){
\begin{tikzpicture}
\node(one){1}
child{node{2}};
\node[xshift=1cm]{3};
\end{tikzpicture}
};
\node(tr2)[circle,draw,scale=0.65][right of=tr1,xshift=2.8cm]{
\begin{tikzpicture}
\node(one){1}
child{node{3}};
\node[right of=one]{2};
\end{tikzpicture}
};
\node(tr3)[circle,draw,scale=0.75][right of=tr2,xshift=2.25cm]{
\begin{tikzpicture}
\node(two){2}
child{node{3}};
\node[right of=one]{1};
\end{tikzpicture}
};
\node at ($(tre1) + (2,-13.5)$)(root)[circle,draw,scale=0.9]{
\begin{tikzpicture}
\node(one){1};
\node[below of=one](two){2};
\node[right of=one]{3};
\node[right of=two]{4};
\end{tikzpicture}
};
\path[thick](tre1.south)edge node[sloped,yshift=0.5em,draw=none,fill=none]{}
(tr1.north)
edge node[sloped,yshift=0.5em,draw=none,fill=none]{}(tr2.north)
\path[thick](tre2.south)edge node[sloped,yshift=0.5em,draw=none,fill=none]{}
(tr3.north)
\end{tikzpicture};
\end{document}
Responder1
Provavelmente ainda não é exatamente o que você deseja, mas evita aninhamentos tikzpicture
e pode ser uma base para obter o que deseja.
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{calc,shapes,fit,positioning}
\let\oldemptyset\emptyset
\let\emptyset\varnothing
\begin{document}
\begin{tikzpicture}[every node/.style={circle,draw=black},scale=0.75,every
node/.append style={transform shape}]
\begin{scope}[local bounding box=f1,scale=0.5]
\node(one1){1}
child{node{2}}
child{node{3}};
\end{scope}
\node[circle,draw,fit=(f1)](tre1){};
%
\begin{scope}[local bounding box=f2,scale=0.5]
\node[above right=0.1cm and 10cm of one1](tree2){1}
child{node{2}
child{node{3}}};
\end{scope}
\node(tre2)[circle,draw,fit=(f2)] {};
%
\begin{scope}[local bounding box=f3,scale=0.65]
\node at ($(one1) + (-3.5,-4.5)$) (one2){1}
child{node{2}};
\node[right=of one2]{3};
\end{scope}
\node [circle,draw,fit=(f3)](tr1){};
%
\begin{scope}[local bounding box=f4,scale=0.65]
\node[right=4cm of one2] (one3){1}
child{node{3}};
\node[right of=one3]{2};
\end{scope}
\node(tr2)[circle,draw,fit=(f4)]{};
%
\begin{scope}[local bounding box=f5,scale=0.75]
\node[right=3cm of one3] (two1){2}
child{node{3}};
\node[right=of two1]{1};
\end{scope}
\node(tr3)[circle,draw,fit=(f5)]{};
%
\begin{scope}[local bounding box=f6,scale=0.9]
\node at ($(one1) + (2,-13.5)$) (one4){1};
\node[below of=one4](two2){2};
\node[right of=one4]{3};
\node[right of=two2]{4};
\end{scope}
\node[circle,draw,fit=(f6)] (root){};
%
\path[thick](tre1.south)edge %node[sloped,yshift=0.5em,draw=none,fill=none]{}
(tr1.north) (tre1.south)
edge %node[sloped,yshift=0.5em,draw=none,fill=none]{}
(tr2.north);
\path[thick](tre2.south)edge %node[sloped,yshift=0.5em,draw=none,fill=none]{}
(tr3.north);
\end{tikzpicture}
\end{document}