I want to use nodes inside a single path, in order that I might position one relative to another using the ++(x,y)
notation.
However, a scope that I want to use to style the nodes only styles the path (and therefore appears to do nothing, as the path is 'invisible').
Adding the scope inside the path (around the nodes) doesn't work.
So, is there anyway to apply a scope to nodes inside a path?
Many thanks for any help.
Example:
\documentclass{article}
\usepackage{tikz}
\tikzset{
every node/.style = {
shape = rectangle,
minimum height = 20mm,
minimum width = 20mm,
line width = .5mm},
mystyle/.style = {draw = red!50!black!50}
}
\begin{document}
\begin{tikzpicture}
% These two nodes have the correct style,
% but I have to specify the style for every node
% (I'll have around 100 nodes in total, hence the
% desire to use a scope for the style).
\path (0,6)
node(nodeOne) [mystyle] {Node One}
++(5,0) node(nodeTwo) [mystyle] {Node Two};
% These two nodes are in the ``mystyle'' scope,
% but the style is not applied to the nodes
% as they reside inside a path.
\begin{scope}[mystyle]
\path (0,0)
node(nodeThree) {Node Three}
++(5,0) node(nodeFour) {Node Four};
\end{scope}
\end{tikzpicture}
\end{document}
draw
option to any of node 3 or 4 and you can see that it is adopted.