6

I don't know how to word this, but I want that 1..n effect where you can tell that there are boxes behind the top one and it is assumed that they are all the same. Perhaps this picture will help (I'm sorry but I couldn't find a better picture online, just pretend the DVDs are tikz boxes).

enter image description here

Just to clarify, what I what is that top right hand corner effect where you can tell there are, in this case, DVDs behind the current DVD

Can someone provide a minimal tikz code to achieve this affect?

3
  • 2
    For two or three copies you can use copy shadow and double copy shadow options otherwise you just put filled rectangles inside a \foreach loop.
    – percusse
    Jan 19 '13 at 22:09
  • The question should maybe be rephrased. I thought of TeX boxes containing tikzpictures that should be stacked … Jan 20 '13 at 0:17
  • A similar question: Overlapping fills. Jan 20 '13 at 9:45
11

Less than four copies

As mentioned in comment, for fewer than four copies you can use the copy shadow or double copy shadow options available in the shadows library.

Code

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows}

\begin{document}
\begin{tikzpicture}
\fill [draw, ultra thick, fill=white,rounded corners, double copy shadow={ultra thick, shadow xshift=0.5cm, shadow yshift=0.5cm}] (0,0) rectangle +(-4,6);
\end{tikzpicture}
\end{document}

Output

enter image description here

For at least four copies

You can use a \foreach loop. Improve this.

\documentclass[tikz]{standalone}
%\documentclass{article}
%\usepackage{tikz}
\usetikzlibrary{shadows}

\begin{document}
\begin{tikzpicture}
\foreach \x in {0,...,3}% 
    \fill [draw, ultra thick, fill=white,rounded corners] (-\x/2,-\x/2) rectangle +(-4,6);
\end{tikzpicture}

\end{document}

Output

enter image description here

Edit

I replaced 1,2,3,4 in the \foreach loop as suggested by Peter Grill.

1
  • I'd replace the 1,2,3,4 with 1,...,4 as then it is easier to modify. Jan 20 '13 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.