1

I was inspired by a talk by SamCarter and tried the following to get a blurred background effect.

I have just copied the code from her. But it doesn't seem to work. Am I missing something?

\documentclass{beamer}
\usetheme{Warsaw}

\useinnertheme{tcolorbox}

\begin{document}


\begin{frame}
{\tcbset{
enhanced, remember,
frame hidden, interior hidden,
underlay={
\begin{tcbclipframe}
\begin{scope}[inner sep=0pt,
remember picture,overlay]
\fill[white] (current page.south west)
rectangle (current page.north east);
% blurred version of background image
\node[opacity=0.9] at (current page.center)
{\includegraphics[width=\paperwidth]
{/home/vrgovinda/goloka-pictures/3-realms_2.jpg}};%
\end{scope}
\end{tcbclipframe}
}}}

\begin{block}{block title}
    Hare Krishna
\end{block}


\end{frame}
\end{document}

I have the relevant beamerinnerthemetcolorbox.sty in my texmf folder.

This is the result:

https://imgur.com/s66Jx8p.png

1 Answer 1

1

Beamer has a very unfortunate syntax which allows \begin{frame}, \begin{frame}{frametitle} and \begin{frame}{frametitle}{framesubtitle}. To do this, it tests if the next character after \begin{frame} is a { and then assumes that this will be the start of the frametitle.

Compare the result of these two frames:

\documentclass{beamer}

\begin{document}

\begin{frame}
{test}
\end{frame}

\begin{frame}

{test}
\end{frame}
\end{document}

So in your specific code, the {\tcbset...} is being interpreted as the frametitle and the modifications never reach the block which is in the frame body and not in the title.

Replace the second example-image-duck with a blurred version of your background image in the code below:

\documentclass{beamer}
\usetheme{Warsaw}

\useinnertheme{tcolorbox}

\begin{document}

\begingroup
  \setbeamercolor{block title}{fg=black}
  \setbeamerfont{block title}{series=\bfseries}
  \setbeamertemplate{background canvas}{%
    \begin{tikzpicture}[inner sep=0pt,remember picture,overlay]
      \node at (current page.center) {\includegraphics[width=\paperwidth]{example-image-duck}};
    \end{tikzpicture}
  }
\begin{frame}

\tcbset{
  enhanced,
  remember,
  frame hidden,
  interior hidden,
  underlay={
    \begin{tcbclipframe}
      \begin{scope}[inner sep=0pt, remember picture,overlay] 
        \fill[white] (current page.south west) rectangle (current page.north east);
        % blurred version of background image
        \node[opacity=0.9] at (current page.center) {\includegraphics[width=\paperwidth]{example-image-duck}};
      \end{scope}
    \end{tcbclipframe}
  }
}

\begin{block}{block title}
    text
\end{block}
\end{frame}
\endgroup

\end{document}

enter image description here

9
  • What change have you made? I have also used the same code from your github page.
    – vrgovinda
    Commented Mar 6 at 22:40
  • @vrgovinda I just added some explanations. The most important bit is to not wrap it into {...} and in particular not to have the {...} in the very first line of the frame or it will end up in the frametitle. Commented Mar 6 at 22:44
  • Thanks for that explanation. So do I have to write \begingroup ... \endgroup for each figure that I want to have as background? Why not to just locally define them just before a frame environment using \setbeamertemplate{background canvas}
    – vrgovinda
    Commented Mar 6 at 23:04
  • @vrgovinda You're welcome! Have fun with the blurred boxes! Commented Mar 6 at 23:17
  • A very nice addition to beamer indeed! Thanks a lot Sam.
    – vrgovinda
    Commented Mar 6 at 23:19

You must log in to answer this question.

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