In TikZ I have a styled node, in this case a matrix with an addition separation space and a dashed border. Left and right of this matrix I want to align additional nodes with the north dashed border.
Currently I place the node left of a certain node inside the matrix and use a yshift to align the box manually. This works, however I am curious if there is a way to align with the style information.
My MWE:
\begin{tikzpicture}
% Tikz Styles
\tikzset{
item/.style={
draw,
rectangle,
font=\sffamily\scriptsize, align=center,
inner sep=3pt
},
board/.style={
draw,
dashed,
inner sep=3mm,
matrix of nodes
},
inBoard/.style={
item,
solid,
sharp corners,
minimum height=0.8cm,
font=\sffamily\scriptsize\bfseries,
fill=hgrau,
thick
},
outerBox/.style={
item,
solid,
font=\sffamily\scriptsize\bfseries
}
}
% Elements
\matrix(Board)[board] {
\node[label](dashedBoxLabel)[]{Dashed Styled Box};
\node[inBoard] (InBox)
[draw=none,
below of=dashedBoxLabel,
node distance=1.8cm,
minimum height=12mm,
minimum width=4cm]{In box};\\
};
\node[outerBox] (OtherBox)
[left of=dashedBoxLabel,
yshift=-1.6cm,
node distance=4cm,
draw=none,
fill=hgrau,
minimum width = 3cm,
minimum height=6cm]{Other Box};
\end{tikzpicture}