
He usado una sombra de doble copia (deesta respuesta) para agregar varios rectángulos a un nodo. Ahora me gustaría envolver ese nodo y varios otros con un nodo de ajuste, pero parece que el nodo de ajuste no incluye las sombras.
Por ejemplo:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows,positioning,calc,fit}
\tikzset{multiple/.style = {double copy shadow={shadow xshift=1ex,shadow
yshift=-1.5ex,draw=black!30},fill=white,draw=black,thick,minimum height = 1cm,minimum
width=2cm},
ordinary/.style = {rectangle,draw,thick,minimum height = 1cm,minimum width=2cm}}
\begin{document}
\begin{tikzpicture}
\node [ordinary] at (0,0) (a) {Some};
\node [multiple,below=3cm of a] (b) {Text};
\draw[-latex] (a) -- coordinate (ab) (b);
\draw (ab) -- ++(0.7,-0.5)coordinate[pos=.3](ab1) coordinate[pos=.6](ab2);
\draw[-latex] (ab1) -- ($(b.north west)!(ab1)!(b.north east)$);
\draw[-latex] (ab2) -- ($(b.north west)!(ab2)!(b.north east)$);
\node [fit=(a)(b),draw,rectangle] {};
\end{tikzpicture}
\end{document}
Esto resulta con:
¿Es posible cambiar el código para incluirlos?
Respuesta1
Si se conoce el aumento de ocupación debido a las sombras, es posible definir un fit shadow
estilo con aumento x|y sep
para incluir sombras.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows,positioning,calc,fit}
\tikzset{%
multiple/.style = {%
double copy shadow={%
shadow xshift=1ex,
shadow yshift=-1.5ex,
draw=black!30},
fill=white,
draw=black,
thick,
minimum height = 1cm,
minimum width=2cm},
ordinary/.style = {%
rectangle,
draw,
thick,
minimum height = 1cm,
minimum width=2cm},
fit shadow/.style = {%
fit = #1,
inner xsep=2ex+.3333em,
inner ysep=3ex+.3333em}
}
\begin{document}
\begin{tikzpicture}
\node [ordinary] at (0,0) (a) {Some};
\node [multiple, below=3cm of a] (b) {Text};
\draw[-latex] (a) -- coordinate (ab) (b);
\draw (ab) -- ++(0.7,-0.5)coordinate[pos=.3](ab1) coordinate[pos=.6](ab2);
\draw[-latex] (ab1) -- ($(b.north west)!(ab1)!(b.north east)$);
\draw[-latex] (ab2) -- ($(b.north west)!(ab2)!(b.north east)$);
\node [fit shadow=(a)(b), draw, rectangle] {};
\end{tikzpicture}
\end{document}
Como alternativa, también es posible incluir la esquina sombreada deseada en fit
la lista:
\node [fit={(a)([shift={(2ex,-3ex)}]b.south east)}, draw, rectangle] {};