# drop shadow framed environment using mdframed & tikz

I'm attempting to make a drop shadow environment using mdframed and tikz. So far, I have (perhaps naively) tried

\newmdenv[tikzsetting={fill=green!20,drop shadow}]{myshadowbox}


I know that shadow-boxes can be made using fancybox and ntheorem with PSTricks, but I'm particularly interested in seeing a solution using mdframed and tikz.

The MWE below produces a framed environment, and with the rounded corners you can see a shadow has been drawn (in the bottom right corner, look carefully!), but I can't seem to move it- I've tried passing options to drop shadow such as shadow xshift=-5ex but with no success.

So, how can I add and customize a drop shadow when using a newmdenv?

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}

\begin{document}

\lipsum[2]

\end{document}

-
The shadow is there, just hard to see. I was sure the solution was to add shadow={shadow xshift=1.0ex, shadow yshift=-0.2em} to make the shadow more obvious but that does not appear to be sufficient. If you include opacity=1 with the shadow options that makes it more easier to see that it is there. –  Peter Grill Feb 2 '12 at 17:07
This seems produce a shadow but I feel you should be able to do better: \newmdenv[ tikzsetting={ fill=green!20, drop shadow={ shadow xshift=1.0ex, shadow yshift=-0.5em, fill=black!50, opacity=1, every shadow } }, roundcorner=10pt, outerlinewidth=3.0pt ]{myshadowbox} –  Peter Grill Feb 2 '12 at 17:16
@PeterGrill Agreed! Yes, you'll see in my screen shot, the shadow is there ,but it's not very pronounced :) –  cmhughes Feb 2 '12 at 17:23
@cmhughes: I use the function clip to get the correct width of the frame. This was the easiest way to handle three lines. I provided the command \mdfcreateextratikz (not documented yet) which can be redefined inside the key settings. At the moment I can create any example. Tomorrow I have LateX to build such one. –  Marco Daniel Feb 2 '12 at 21:53
@MarcoDaniel Ok, great! Thanks for the explanation! Glad I didn't miss anything in the documentation (which is excellent) :) Thanks for such a great package –  cmhughes Feb 2 '12 at 22:16

Completely EDIT 2012-03-04:

I uploaded the new version 1.3 to CTAN. At the moment the files are available at github.

This version provides a key named shadow. This allows to draw a shadow. The shadow can be manipulated by the new keys shadowsize and shadowcolor

If you use framemethod=tikz it is important to load the TikZ library shadows.

mdframed can do the job but I don't want to load any libraries.

For the methods TikZ and PSTricks I defined a style mdfshadow by tikzset / newpsstyle. For more settings manipulate this key.

Based of the new modification I created the following example:

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{lipsum}
\newmdenv[tikzsetting={fill=green!20},

\begin{document}

\lipsum[2]
\lipsum[3]
\lipsum
\end{document}


The result is:

An other example is provided in file mdframed-example-pstricks.pdf which uses pstricks and frametitle:

\documentclass{article}
\usepackage{xcolor}
\usepackage[framemethod=pstricks]{mdframed}
\usepackage{lipsum}

\newmdenv[%
linewidth=8pt,
frametitlerule=true,
roundcorner=10pt,

\begin{document}

I guess \usetikzlibrary{shadows} is supposed to be there just once, not twice? –  Tom Bombadil Feb 4 '12 at 13:07