I wish to create tikzpicture environments inside a node of another tikzpicture. The problem I encouter is that styles are inherited by the inner tikzpicture. How can I screen of the inner tikzpicture form the outer one? Or is this impossible?
The following minimal example illustrates the problem:
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
% wanted: square centered on line
\begin{tikzpicture}
\draw (0,0) -- (0,1);
\node[fill] at (0,.5) {};
\end{tikzpicture}
% got: square to the right of line
\begin{tikzpicture}[red]
\node[fill] (O) {};
\node[right=of O] {% <- this 'right of' is inherited; how to avoid?
\begin{tikzpicture}
\draw (0,0) -- (0,1);
\node[fill] at (0,.5) {};
\end{tikzpicture}
};
\end{tikzpicture}
\end{document}
right of
is not inherited but it'sright= of
Make a try withright of= O