4

The title and the body of the block have different background colors that have a smooth transition. I would like to get rid of that and have a well defined line there. How do I go about doing that?

After searching, the closest I could find it this thread but it is not clear what he's asking and am not sure if the solutions are the best way to go for putting them in the theme file.

Thanks.

MWE:

\documentclass{beamer}
\usecolortheme{rose}
\setbeamertemplate{blocks}[rounded][shadow=true]

\begin{document}
\begin{frame}
  \begin{block}{Title}
  Block stuff.
  \end{block}
\end{frame}
\end{document}
7

\beamerboxesrounded uses the bmb@transition shading to add color between the title and the body parts of blocks. Here's the original definition (found in the file beamerbaseboxes.sty):

\pgfdeclareverticalshading[lower.bg,upper.bg]{bmb@transition}{200cm}{%
  color(0pt)=(lower.bg); color(2pt)=(lower.bg); color(4pt)=(upper.bg)}

To have a solid color, instead of a shading, you can use the same color for all three components of the shading; something along these lines:

\documentclass{beamer}
\usecolortheme{rose}
\setbeamertemplate{blocks}[rounded][shadow=true]

\colorlet{separation rule}{structure!40}

\makeatletter
\pgfdeclareverticalshading[lower.bg,upper.bg]{bmb@transition}{200cm}{%
  color(0pt)=(separation rule); color(2pt)=(separation rule); color(4pt)=(separation rule)}
\makeatother

\begin{document}
\begin{frame}
  \begin{block}{Title}
  Block stuff.
  \end{block}
\end{frame}
\end{document}

enter image description here

Of course, use the color that best suits your needs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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