tcolorbox is very useful to produce this kind of boxes. It includes a library (skins
) which among other features introduces command
shadow={<xshift>}{<yshift>}{<offset>}{<options>}
Adds a new shadow to the stack of shadows. This shadow is follows the
outline of the tcolorbox
but is shifted by and .
The value is a distance value from the frame outline. A
positive value shrinks the shadow and a negative
value enlarges the shadow. The shadow is filled along a TikZ path with
the given TikZ .
Next code is adapted (to a more beamer
style) from an example in tcolorbox's userguide.
\documentclass{beamer}
\usepackage[skins]{tcolorbox}
\tcbset{enhanced,colback=red!5!white,
colframe=red!75!black,fonttitle=\bfseries,bottomrule=0pt,leftrule=0pt,rightrule=0pt}
\begin{document}
\begin{frame}
\begin{tcolorbox}[title=My own shadow,
shadow={2mm}{-1mm}{0mm}{black!50!white}]
This is a tcolorbox.
\end{tcolorbox}
\par\bigskip
\begin{tcolorbox}[title=Another shadow,
shadow={-1mm}{-2mm}{0mm}{fill=blue,
opacity=0.5}]
This is a tcolorbox.
\end{tcolorbox}
\par\bigskip
\begin{tcolorbox}[title=Double shadow,
shadow={-1.5mm}{-1.5mm}{0mm}{fill=blue,
opacity=0.25},
shadow={1.5mm}{-1.5mm}{0mm}{fill=red,
opacity=0.25}]
This is a tcolorbox.
\end{tcolorbox}
\par\bigskip
\begin{tcolorbox}[title=Far shadow,
shadow={5.5mm}{-3.5mm}{2mm}{fill=black,
opacity=0.25}]
This is a tcolorbox.
\end{tcolorbox}
\end{frame}
\end{document}
