In the following tikz diagram of a nested lattice, all the nodes with embedded line diagrams outside of the the one at the top (Z1, Z3, Z4) are being oddly rendered. The diagrams within all nodes are the same. Why is this so?
\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{backgrounds}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\tikzset{
A-node/.style={
draw,fill=white,label={[fill=lightgray,inner sep=3pt,rounded
corners=2pt]90:#1},inner sep=5pt,rounded corners=20pt
},
B-node/.style={
draw,fill=white,inner sep=3pt,rounded corners=20pt
},
O-node/.style={
fill=white,draw,align=left,font=\normalsize,
inner sep=2.5pt,rounded corners=1pt
},
G-edge/.style={every path/.style={draw=black,line width=0.5}},
}
%nodes
\node [A-node={$Z_{1}, Z_{3}, Z_{4}$}] (0,0) (top{\input{Z1Z3Z4.tex}};
\node [A-node={$Z_{2}$},below left=20mm and 20mm of top] (Z2) {\input{Z1Z3Z4.tex}};
\path let \p1 = (Z2.south) in node [O-node,yshift=-9pt] at (\x1,\y1) {1};
\node [A-node={$Z_{5}$},below right=20mm and 20mm of top] (Z5) {\input{Z1Z3Z4.tex}};
\path let \p1 = (Z5.south) in node [O-node,yshift=-9pt] at (\x1,\y1) {2};
\node [B-node, below=60mm of top] (unnamed) {\input{Z1Z3Z4.tex}};
\path let \p1 = (unnamed.south) in node [O-node,yshift=-9pt] at (\x1,\y1) {5, 6, 7, 9, 10};
\node [A-node={$Z_{6}$}, below=17mm of unnamed] (Z6) {\input{Z1Z3Z4.tex}};
\path let \p1 = (Z6.south) in node [O-node,yshift=-9pt] at (\x1,\y1) {0, 3, 4, 8, 11};
%edges
\begin{scope}[on background layer]
\draw [G-edge,shorten <=-10,shorten >=-10] (top) --(Z2);
\draw [G-edge,shorten <=-10,shorten >=-10] (top) --(Z5);
\draw [G-edge,shorten <=-10,shorten >=-10] (Z2) --(unnamed);
\draw [G-edge,shorten <=-10,shorten >=-10] (Z5) --(unnamed);
\draw [G-edge,shorten <=-10,shorten >=-10] (unnamed) --(Z6);
\end{scope}
\end{tikzpicture}
\end{document}
The input file code for the nested lattice Z1Z3Z4:
\resizebox{3.5cm}{3.5cm}{
\begin{tikzpicture}
\tikzset{
B-node/.style={
shape=circle,fill=black,draw=black,draw,minimum size=8mm,line width=1.5
},
W-node/.style={
shape=circle,fill=white,draw=black,draw,minimum size=8mm,line width=1.5
},
G-edge/.style={every path/.style={draw=gray},line width=1.5}
}
%nodes
%top
\node[B-node={$S_{8}$}] at (0,0) (superium) {};
%1st row
\node[B-node={$S_{1}$}, below left=20mm and 20mm of superium] (S1) {};
\node[W-node={$S_{2}$},right=20mm of S1] (S2) {};
\node[W-node={$S_{3}$},right=20mm of S2] (S3) {};
\node[W-node={$S_{5}$},right=20mm of S3] (S5) {};
\node[B-node={$S_{4}$},right=20mm of S5] (S4) {};
%second row
\node[W-node={$S_{7}$}, below left=20mm and 20mm of S1] (S7) {};
%third row
\node[W-node] at (S7 -| S1) (r3e1) {};
\node[W-node] at (S7 -| S2) (r3e2) {};
\node[W-node] at (S7 -| S3) (r3e3) {};
\node[W-node] at (S7 -| S5) (r3e4) {};
%fourth row
\node[W-node={$S_{6}$}, below left=30mm and 30mm of S7] (S6) {};
\node[W-node,below=20mm of r3e1] (r4e1) {}; {};
\node[W-node,below right= 20mm and 10mm of r3e2] (r4e2) {};
\node[W-node,below=20mm of r3e4] (r4e3) {};
\node[W-node,right=20mm of r4e3] (r4e4) {};
%fifth row
\node[W-node,below left=20mm and 20mm of r4e2] (r5e1) {};
\node[B-node] (r5e2) at (S3 |- r5e1) {};
\node[W-node,left=6mm of r5e2] (r5e3) {};
\node[W-node,below left= 20mm and 20mm of r4e4] (r5e4) {};
%sixth row
\node[W-node,below left=20mm and 20mm of r5e4] (r6e3) {};
\node[W-node] (r6e2) at (S1|-r6e3) {};
\node[W-node, below right=30mm and 30mm of S6] (r6e1) {};
%seventh row
\node[W-node,below right=10mm and 10mm of r6e1] (r7e1) {};
\node[W-node,below left=10mm and 10mm of r6e3] (r7e2) {};
%null set
\node[W-node,below left=20mm and 20mm of r7e2] (null) {};
%edges
\begin{scope}[on background layer]
\draw[G-edge] (superium)--(S1);
\draw[G-edge] (superium)--(S2);
\draw[G-edge] (superium)--(S3);
\draw[G-edge] (superium)--(S5);
\draw[G-edge] (superium)--(S4);
\draw[G-edge] (S1)--(S7);
\draw[G-edge] (S1)--(r3e1);
\draw[G-edge] (S1)--(r4e2);
\draw[G-edge] (S1)--(r5e3);
\draw[G-edge] (S2)--(r3e1);
\draw[G-edge] (S2)--(r3e2);
\draw[G-edge] (S2)--(r3e4);
\draw[G-edge] (S3)--(r3e2);
\draw[G-edge] (S3)--(r4e2);
\draw[G-edge] (S3)--(r3e3);
\draw[G-edge] (S5)--(r3e3);
\draw[G-edge] (S5)--(r3e4);
\draw[G-edge] (S4)--(r5e3);
\draw[G-edge] (S4)--(r4e4);
\draw[G-edge] (S7)--(S6);
\draw[G-edge] (S7)--(r4e1);
\draw[G-edge] (r3e1)--(r4e1);
\draw[G-edge] (r3e1)--(r5e1);
\draw[G-edge] (r3e2)--(r5e1);
\draw[G-edge] (r3e2)--(r4e3);
\draw[G-edge] (r3e3)--(r4e3);
\draw[G-edge] (r3e3)--(r5e2);
\draw[G-edge] (r3e4)--(r4e3);
\draw[G-edge] (r3e4)--(r4e4);
\draw[G-edge] (S6)--(r6e1);
\draw[G-edge] (r4e1)--(r6e1);
\draw[G-edge] (r4e1)--(r6e2);
\draw[G-edge] (r4e2)--(r5e1);
\draw[G-edge] (r4e2)--(r5e2);
\draw[G-edge] (r4e3)--(r5e4);
\draw[G-edge] (r4e4)--(r5e4);
\draw[G-edge] (r5e1)--(r6e2);
\draw[G-edge] (r5e1)--(r6e3);
\draw[G-edge] (r5e2)--(r6e3);
\draw[G-edge] (r5e3)--(r6e3);
\draw[G-edge] (r5e4)--(r6e3);
\draw[G-edge] (r6e1)--(r7e1);
\draw[G-edge] (r6e2)--(r7e1);
\draw[G-edge] (r6e2)--(r7e2);
\draw[G-edge] (r6e3)--(r7e2);
\draw[G-edge] (r7e2)--(null);
\draw[G-edge] (r7e1)--(null);
\end{scope}
\end{tikzpicture}
}
Z1Z3Z4.texin a standalone document, compile it and then use\includegraphics[width=3.5cm]{Z1Z3Z4}in the nodes of the main tikzpicture. – Feb 24 '18 at 16:45tikzpictures is unsupported. Even if it works, you shouldn't do it as it may break at any time. Sometimes, you can use apic, though a box is more efficient if you're repeating exactly the same picture multiple times. – cfr Feb 24 '18 at 23:13