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}

2 Answers 2

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.

0
0

If you use the tcolorbox inner theme, you can decide if or if not you'd like this color shading between the title and body:

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

\useinnertheme[rounded,shadow,shaded=false]{tcolorbox}

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

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .