22

I use the code

\usebackgroundtemplate{
    \centering
        \includegraphics[width=0.5\paperwidth,height=0.5\paperheight]{image.png}
}

to get a background image in a Beamer/Latex presentation. However, blocks, for example, are not transparent (they have white background so that the image can't bee seen). The same is true for the title on the titlepage.

How can I set the blocks/titles such that they are transparent?

2
  • 3
    Can you please provide a minimal working example?
    – Thorsten
    May 17, 2011 at 14:04
  • @Floarian: powerdot can do that. If you also can use this presentation class I'll give you an example.
    – user2478
    May 17, 2011 at 19:37

2 Answers 2

21

You could specify the opacity of your blocks using \addtobeamertemplate:

 \addtobeamertemplate{block begin}{\pgfsetfillopacity{0.5}}{\pgfsetfillopacity{1}}
 \addtobeamertemplate{block alerted begin}{\pgfsetfillopacity{0.5}}{\pgfsetfillopacity{1}}
 \addtobeamertemplate{block example begin}{\pgfsetfillopacity{0.5}}{\pgfsetfillopacity{1}}

It doesn't work well if you use block shadows though.

Example:

\documentclass[compress]{beamer}
\usecolortheme{rose}

\usebackgroundtemplate{\centering
        \includegraphics[width=\paperwidth,height=\paperheight]{image.png}}

\addtobeamertemplate{block begin}{\pgfsetfillopacity{0.5}}{\pgfsetfillopacity{1}}
\addtobeamertemplate{block alerted begin}{\pgfsetfillopacity{0.5}}{\pgfsetfillopacity{1}}
\addtobeamertemplate{block example begin}{\pgfsetfillopacity{0.5}}{\pgfsetfillopacity{1}}

\begin{document}

  \begin{frame}{}
    \begin{theorem}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. 
    \end{theorem}

  \begin{alertblock}{Alert!!!}
Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
  \end{alertblock}

  \begin{exampleblock}{Example}
Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros.
  \end{exampleblock}
  \end{frame}
\end{document}

1
  • This solution has no effect with TeX Live 2015. Nov 5, 2017 at 18:27
11

Blocks and titles are transparent by default in Beamer, so you must be using a theme that gives them both a background. You can restore the default transparent behaviour using

\setbeamertemplate{title page}[default]
\setbeamercolor{title}{bg=}

for the title and

\setbeamertemplate{blocks}[default]
\setbeamercolor{block title}{bg=}
\setbeamercolor{block body}{bg=}

for blocks.

Here is a full example:

\documentclass{beamer}

\usebackgroundtemplate{
    \centering\includegraphics[width=\paperwidth,height=\paperheight]{image}
}

\usetheme{Madrid} % Sample theme with coloured title and blocks

% Reset title background to default
\setbeamertemplate{title page}[default]
\setbeamercolor{title}{bg=}

% Reset block background to default
\setbeamertemplate{blocks}[default]
\setbeamercolor{block title}{bg=}
\setbeamercolor{block body}{bg=}

\title{The title}

\begin{document}

\frame{\titlepage}

\begin{frame}{Test frame}
  \begin{block}{Block title}
    Inside the block
  \end{block}
\end{frame}

\end{document}
1

You must log in to answer this question.

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