I want to create rounded blocks with shadows in beamerposter
. The MWE does that, but in an ugly way: the bottom corners of the header are rounded and have a shadow, and the top corners of the text block have corners and a shadow. For a pleasing design the two should be better integrated.
\documentclass[final]{beamer}
\mode<presentation>{\usetheme{Berlin}}
\usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}
%From https://tex.stackexchange.com/questions/47264/beamer-round-blocks-without-fading
% \setbeamertemplate{blocks}[rounded][shadow=true]
% \makeatletter
% \pgfdeclareverticalshading[lower.bg,upper.bg]{bmb@transition}{200cm}{%
% color(0pt)=(lower.bg); color(4pt)=(lower.bg); color(4pt)=(upper.bg)}
% \makeatother
\setbeamertemplate{block begin}{
\vskip.75ex
\begin{beamercolorbox}[rounded=true,shadow=true,leftskip=1cm,colsep*=.75ex]{block title}%
\usebeamerfont*{block title}\insertblocktitle
\end{beamercolorbox}%
{\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%
\usebeamerfont{block body}%
\begin{beamercolorbox}[rounded=true,shadow=true,colsep*=.75ex,sep=.75ex,vmode]{block body}%
\ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
}
\setbeamertemplate{block end}{
\end{beamercolorbox}
}
\begin{document}
\begin{frame}
\begin{columns}
\begin{column}{.3\textwidth}
\vfill
\begin{block}{\large Fontsizes}
\centering
{\tiny tiny}\par
{\scriptsize scriptsize}\par
{\footnotesize footnotesize}\par
{\normalsize normalsize}\par
\end{block}
\vfill
\end{column}
\end{columns}
\end{frame}
\end{document}
The commented code in the MWE is taken from the answer to: Beamer round blocks without fading. And I uncomment it and comment the template blog begin, I get what I want, but loose the cleverer spacing of other template.
So my question is basically: how do I get the nice corners and shadows from the second picture into the first?
Disclaimer: My question is very similar to Rounded and shadow for block, but as there has not been an MWE added since Sep 2012 I post a new question.
Best Answer
I stumbled in a similar problem and solved it with the
tcolorbox
package. Here is the code:the result is this:
for comparison:
I tried to explain everything in the code. If you want all the tcolorboxes to be like this, just put the
\tcbset
code in the preamble, otherwise start a group just before the tcolorboxes you want to customize in that way.The only thing that doesn't really look the same is the shadow (my shadow isn't blurred), but with some tweaks and the
shadows.blur
tikzlibrary it should be possible to obtain the exact same result.