In a software diagram, I'd like to be able to represent multiple instances of an object by two rectangles with one of them slightly shifted. I recently learned about the pic style so I'm using it with two nodes to achieve what I want.
The following example does work, but I'd like to know if I can do the same without using the fill=white. My hack kind of assumes the entire picture background is white and that may not always hold. I'd like to be able to crop the unwanted picture part out.
\documentclass[crop,border=3pt]{standalone}
\usepackage{pgf,tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[
every node/.style={font=\sffamily\small},
block/.style={
rectangle, draw, align=center, minimum width=2cm,
minimum height=1.4cm, font=\sffamily\small
},
multinode/.pic={
\node [block] at (0.1,0.1) {};
\node [block, \tikzpictextoptions, fill=white] at (0,0) {\tikzpictext};% <-- FILL WHITE
}
]
\node [block] (STG) at (2,5) {single\\instance};
\pic [pic text={multi\\instance}] at (5,5) {multinode};
\end{tikzpicture}
\end{document}
The following images show first one version with the fill white hack, and then one version without it.





shadows, thank you for that! – Daniel Jun 26 '16 at 21:42