I am drawing a database icon that is made of two cylinder shapes using TikZ. When I add a shadow, the shadows of the two cylinders overlap, and the shadow becomes darker in the overlapping area. The somewhat-MWE below illustrates the problem.
I have tried using transparency groups both within the definition of \dbicon and around the invocation of \dbicon. No luck. What am I doing wrong?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{shadows}
\newcommand{\dbpart}[1]{
\node[drop shadow,draw, cylinder, shape aspect=1.5, inner sep=0.3333em,
rotate=90, minimum width=1cm, minimum height=0.45cm] (cyl) at (0,#1) {};
}
\newcommand{\dbicon}{
\begin{tikzpicture}
\dbpart{0cm}%
\dbpart{0.4cm}%
\end{tikzpicture}
}
\begin{document}
\begin{tikzpicture}
\node[inner sep=0pt] {
\dbicon
};
\end{tikzpicture}
\end{document}


\newcommandwas not necessary, I have moved it out. – nickpapior Feb 06 '12 at 14:01dbpartinvisible outside where it's used, that's the reason for the nesting. – krlmlr Feb 06 '12 at 14:03!in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the!to turn it into an image again. – Tobi Feb 06 '12 at 14:04