Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

enter image description here

\documentclass[final]{beamer}

\mode<presentation>{\usetheme{Berlin}}

\usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}

%From http://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.

enter image description here

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.

share|improve this question
    
Hi Jörg. A tip: if you directly copy and paste urls in your question automatically the title will appear. –  Claudio Fiandrino Mar 6 '13 at 17:04
    
@ClaudioFiandrino I know, I made the link to "here" on purpose. –  Jörg Mar 6 '13 at 17:07
    
Usually it is more clear to see the title of the question, that's why my edit. But if you prefer the other choice feel free to re-edit the question :) –  Claudio Fiandrino Mar 6 '13 at 19:35
add comment

1 Answer

up vote 2 down vote accepted

I stumbled in a similar problem and solved it with the tcolorbox package. Here is the code:

\documentclass[final]{beamer}
\usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}     
\usepackage{tcolorbox}                                 %
\tcbuselibrary{skins}                                  %  preamble 
\usepackage{tikz}                                      %
\usetikzlibrary{shadows,shadings}                      %

\tikzset{myshadow/.style={                             % custom shadow with tikz
         opacity=.85,
         shadow xshift=0.15,
         shadow yshift=-0.15,
         shade,
         shading=axis,
         shading angle=230}
         } 
\tcbset{                                               % set a custom tcolorbox  
        skin=enhanced,                                 % enables use of shadows
        frame style={fill=gray,drop shadow={myshadow}}, % sets the frame color and the shadow properties
        bottom=7mm,                                    % distance between the body text and the bottom frame
        top=14mm,                                      % distance between the body text and the top frame
        boxrule=0mm,                                   % frame width
        bottomtitle=5mm,                               % distance between the title text and the bottom title frame               
        toptitle=5mm,                                  % distance between the title text and the top title frame
        lefttitle=1cm                                  % title text left margin
}  
\begin{document}
\begin{frame}  
\begin{columns}
\begin{column}{.3\textwidth}
\begin{tcolorbox}[title=\large Fontsizes]
 \centering
  {\tiny tiny}\par
  {\scriptsize scriptsize}\par
  {\footnotesize footnotesize}\par
  {\normalsize normalsize}\par
\end{tcolorbox}
\end{column}
\end{columns}
\end{frame}
\end{document}

the result is this:
enter image description here
for comparison:
enter image description here

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.

share|improve this answer
    
That's what I want and works fine with beamerposter. Thanks! –  Jörg Mar 29 '13 at 14:23
    
You're welcome. Be sure to check the tcolorbox documentation because it has a whole lot of customizations you may find interesting –  dcmst Mar 29 '13 at 17:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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