6

In my poster, I added a background picture and make the blocks partially transparent, using the following code

\documentclass[final, 12pt]{beamer}
\usepackage[size=custom,width=120,height=120,scale=1.7,orientation=portrait]{beamerposter} 
\usepackage{ragged2e}
\usepackage{graphicx} 
\usepackage{lipsum} 
\usepackage{etoolbox}
\apptocmd{\frame}{\justifying}{}{}

\usebackgroundtemplate{\centering \includegraphics[width=\paperwidth, height=\paperheight]{Figure/LG_PKL.jpg}}
\addtobeamertemplate{block begin}{\pgfsetfillopacity{0.65}}{\pgfsetfillopacity{1}}
\addtobeamertemplate{block beamercolorbox begin}{\pgfsetfillopacity{0.65}}{\pgfsetfillopacity{1}}

\newenvironment<>{varblock}[2][\textwidth]{%
  \setlength{\textwidth}{#1}
  \begin{actionenv}#3%
    \def\insertblocktitle{#2}%
    \par%
    \usebeamertemplate{block begin}}
  {\par%
    \usebeamertemplate{block end}%
  \end{actionenv}}

\usecolortheme{rose}


\begin{document}
\begin{frame}

\begin{textblock}{}(0.55,0.05)
\begin{center}
\setlength{\textwidth}{113cm}
\begin{beamercolorbox}{block body}
gdsghfdhdfgh
\end{center}
\end{beamercolorbox}
\end{center}
\end{textblock}


\begin{textblock}{}(0.2,1.15)%
\begin{varblock}[35cm]{\textbf{1. Introduction}}
\justifying 
Space for discussion.
\end{varblock}
\end{textblock}

\end{document}

It works nice with block,but I need to make the beamercolorbox's also partially transparent.Can any one please help me?

1
  • 1
    Your example doesn't work! Please correct this. Commented May 13, 2012 at 10:16

2 Answers 2

7

Your example code has some errors and won't work. However, I could reprouce your problem with a simple modification to your sample code (I changed some settings to make my example simpler, but this is not relevant to the problem nor to the solution):

\documentclass[final, 12pt]{beamer}
\usepackage[size=custom,width=10,height=10,scale=.7,orientation=portrait]{beamerposter} 
\usepackage{graphicx} 
\usepackage{textpos} 

\usecolortheme{rose}

\usebackgroundtemplate{%
  \centering\includegraphics[width=\paperwidth, height=\paperheight]{ctanlion}}
\addtobeamertemplate{block begin}{\pgfsetfillopacity{0.65}}{\pgfsetfillopacity{1}}

\newenvironment<>{varblock}[2][\textwidth]{%
  \setlength{\textwidth}{#1}
  \begin{actionenv}#3%
    \def\insertblocktitle{#2}%
    \par%
    \usebeamertemplate{block begin}}
  {\par%
    \usebeamertemplate{block end}%
  \end{actionenv}}

\begin{document}

\begin{frame}
\begin{textblock}{}(0.55,0.05)
\setlength\textwidth{5cm}
\begin{beamercolorbox}[wd=5cm]{block body}
some test text\\
some test text
\end{beamercolorbox}
\end{textblock}

\vfill

\begin{textblock}{}(0.2,1.15)%
\begin{varblock}[5cm]{Introduction}
Space for discussion.
\end{varblock}
\end{textblock}
\end{frame}

\end{document}

The result shows that the beamercolobox color hides the background image:

enter image description here

To preven this problem, you can simply use \pgfsetfillopacity{0.65} inside the frame environment (or inside the textblock environment that holds the offending box if you want to keep the change local):

\documentclass[final, 12pt]{beamer}
\usepackage[size=custom,width=10,height=10,scale=.7,orientation=portrait]{beamerposter} 
\usepackage{graphicx} 
\usepackage{textpos} 

\usecolortheme{rose}

\usebackgroundtemplate{%
  \centering\includegraphics[width=\paperwidth, height=\paperheight]{ctanlion}}
\addtobeamertemplate{block begin}{\pgfsetfillopacity{0.65}}{\pgfsetfillopacity{1}}

\newenvironment<>{varblock}[2][\textwidth]{%
  \setlength{\textwidth}{#1}
  \begin{actionenv}#3%
    \def\insertblocktitle{#2}%
    \par%
    \usebeamertemplate{block begin}}
  {\par%
    \usebeamertemplate{block end}%
  \end{actionenv}}

\begin{document}

\begin{frame}
\pgfsetfillopacity{0.65}

\begin{textblock}{}(0.55,0.05)
\setlength\textwidth{5cm}
\begin{beamercolorbox}[wd=5cm]{block body}
some test text\\
some test text
\end{beamercolorbox}
\end{textblock}

\vfill

\begin{textblock}{}(0.2,1.15)%
\begin{varblock}[5cm]{Introduction}
Space for discussion.
\end{varblock}
\end{textblock}
\end{frame}

\end{document}

enter image description here

CTAN lion drawing by Duane Bibby.

4
  • Thank you so much......I am really grateful to you......
    – Mahzabin
    Commented May 14, 2012 at 1:27
  • @Gonzalo Medina: I tried your code but curiously they do not work for me, because both give opaque boxes, both for the beamercolorbox than for the varbox. Can you help me understand this?
    – simona
    Commented Sep 18, 2012 at 19:13
  • @simona Sure! But I will need to see a minimal version of your code. I think it would be best to open a fresh question. Follow-up questions like this are more than welcome! Please use the "Ask Question" link for your new question; there you can link to this question to provide the background. Don't forget to add the relevant code to the new question. Commented Sep 18, 2012 at 19:43
  • This is working for me, but the text is also partially transparent... I would prefer for readability to have the background semi-transparent, as it is, but the text with full opacity... Any idea?
    – user32804
    Commented Jun 26, 2013 at 1:45
0

You could use the tcolorbox inner theme. This will replace the normal beamer blocks with tcolorboxs and it also allows you to replace the default beamercolorbox.

Once both of them are based on tcolorboxs, it is easy to adjust the background opacity:

\documentclass{beamer}

\usebackgroundtemplate{\centering \includegraphics[width=\paperwidth, height=\paperheight]{example-grid-100x100bp}}
\usecolortheme{rose}

\useinnertheme{tcolorbox}
\makeatletter
\beamer@tcb@patchcolorbox
\makeatother
\tcbset{
  opacityback=0.6, 
  opacitybacktitle=0.6
}

\begin{document}
\begin{frame}

\begin{beamercolorbox}{block body}
gdsghfdhdfgh
\end{beamercolorbox}

\begin{block}{1. Introductio}
Space for discussion.
\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 .