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}
\usetikzlibrary{shadows}
\newmdenv[tikzsetting={fill=green!20,drop shadow},
roundcorner=10pt ]{myshadowbox}
\begin{document}
\begin{myshadowbox}
\lipsum[2]
\end{myshadowbox}
\end{document}
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 includeopacity=1
with the shadow options that makes it more easier to see that it is there. – Peter Grill Feb 2 '12 at 17:07\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:16clip
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 keysettings
. At the moment I can create any example. Tomorrow I have LateX to build such one. – Marco Daniel Feb 2 '12 at 21:53