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 Answers2

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}

Werner
  • 603,163
bzklrm
  • 331
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}
Tom
  • 770
  • 3
    I think he wants semi transparency like for example in this example http://tex.stackexchange.com/questions/17204/drawing-polyhedra-using-tikz-with-semi-transparent-and-shading-effect at least that is what I would want... – jonalv Jun 15 '11 at 10:22