
私は二重コピーシャドウ(この答え) を使用して、ノードに複数の四角形を追加します。次に、そのノードと他のいくつかのノードをフィット ノードでラップしたいのですが、フィット ノードには影が含まれていないようです。
例えば:
\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}
結果は次のようになります:
それらを含めるようにコードを変更することは可能ですか?
答え1
影による占有率の増加がわかっている場合は、影を含めるようにfit shadow
増加したスタイルを定義することができます。x|y sep
\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}
代わりに、必要な影のコーナーをfit
リストに含めることもできます。
\node [fit={(a)([shift={(2ex,-3ex)}]b.south east)}, draw, rectangle] {};