Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

this is a follow up question to How to make partially transparent beamercolorbox

The question is that I would like to have a transparent beamercolorbox, but a not transparent text. What should I do? I also do not like the darker line on the top of the beamercolorbox. I am also open to other possibilities. the following is a minimal example of the offending slide:

\documentclass[xcolor=usenames,dvipsnames]{beamer}

\colorlet{color1}{PineGreen}

 \mode<presentation>
{
\usetheme{default}
\usecolortheme{lily}
\usefonttheme{professionalfonts}
\setbeamercolor{alert}{fg=red!80!black}
\setbeamercolor{text1}{fg=color1!80!black}
\setbeamercolor{text2}{fg=black}
\setbeamercolor{structure}{fg=color1!80!black}
\setbeamercolor{frametitle}{fg=red!80!black}
\setbeamercolor{box1}{fg=black,bg=Dandelion}
\setbeamercolor{box2}{fg=black,bg=SeaGreen}
\setbeamercolor{box3}{fg=black,bg=Aquamarine}

\setbeamerfont{frametitle}{series=\bfseries}
\setbeamertemplate{frametitle}
{
  \begin{flushright}
    \insertframetitle\par
  \end{flushright}
}
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{figures/PNG/ripple.png}}
\setbeamercovered{transparent}
\setbeamerfont{title}{size=\Large,series=\bfseries,shape=\itshape,family=  \rmfamily}
\setbeamercolor{title}{fg=red!80!black}
}

\usepackage[english]{babel}
\usepackage{aas_macros}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}


\begin{document}

\begin{frame}
\frametitle{slide title}
\pgfsetfillopacity{0.35}
\begin{columns}
\column{0.5\textwidth}
\pgfsetfillopacity{0.35}
  \begin{beamercolorbox}[shadow=false,rounded=true]{box2}
    {\usebeamercolor[fg]{text2} \bf T1}
    \begin{itemize}
    \item element
    \item element
    \item element
    \item element
    \item element
    \end{itemize}
  \end{beamercolorbox}
\column{0.5\textwidth}
  \begin{beamercolorbox}[shadow=false,rounded=true]{box3}
    {\usebeamercolor[fg]{text2} \bf T2}
    \begin{itemize}
    \item element
    \item element
    \item element
    \item element
    \end{itemize}
  \end{beamercolorbox}
\end{columns}  
\begin{beamercolorbox}[shadow=false,rounded=true]{box1}
  \begin{itemize}
  \item element
  \item element
  \end{itemize}
\end{beamercolorbox}
\end{frame}

\end{document}
share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

Given the way the color boxes are built, the only approach I have found for the moment is to redefine \beamerboxesrounded, as implemente in beamerbaseboxes.sty to use \pgfsetfillopacity with the desired value controlled with \opacitylevel; the code below shows this redefinition (lines with changes are signaled with %NEW):

\documentclass[xcolor=usenames,dvipsnames]{beamer}

\colorlet{color1}{PineGreen}

 \mode<presentation>
{
\usetheme{default}
\usecolortheme{lily}
\usefonttheme{professionalfonts}
\setbeamercolor{alert}{fg=red!80!black}
\setbeamercolor{text1}{fg=color1!80!black}
\setbeamercolor{text2}{fg=black}
\setbeamercolor{structure}{fg=color1!80!black}
\setbeamercolor{frametitle}{fg=red!80!black}
\setbeamercolor{box1}{fg=black,bg=Dandelion}
\setbeamercolor{box2}{fg=black,bg=SeaGreen}
\setbeamercolor{box3}{fg=black,bg=Aquamarine}

\setbeamerfont{frametitle}{series=\bfseries}
\setbeamertemplate{frametitle}
{
  \begin{flushright}
    \insertframetitle\par
  \end{flushright}
}
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{b}}
\setbeamercovered{transparent}
\setbeamerfont{title}{size=\Large,series=\bfseries,shape=\itshape,family=  \rmfamily}
\setbeamercolor{title}{fg=red!80!black}
}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}

\newcommand\opacitylevel{0.35}% change here the opacity level

\makeatletter
\renewcommand\beamerboxesrounded[2][]{%
  \global\let\beamer@firstlineitemizeunskip=\relax%
  \vbox\bgroup%
  \setkeys{beamerboxes}{upper=block title,lower=block body,width=\textwidth,shadow=false}%
  \setkeys{beamerboxes}{#1}%
  {%
    \usebeamercolor{\bmb@lower}%
    \globalcolorstrue%
    \colorlet{lower.bg}{bg}%
  }%
  {%
    \usebeamercolor{\bmb@upper}%
    \globalcolorstrue%
    \colorlet{upper.bg}{bg}%
  }%
  %
  % Typeset head
  %
  \vskip4bp
  \setbox\bmb@box=\hbox{%
    \begin{minipage}[b]{\bmb@width}%
      \usebeamercolor[fg]{\bmb@upper}%
      #2%
    \end{minipage}}%
  \ifdim\wd\bmb@box=0pt%
    \setbox\bmb@box=\hbox{}%
    \ht\bmb@box=1.5pt%
    \bmb@prevheight=-4.5pt%
  \else%
    \wd\bmb@box=\bmb@width%
    \bmb@temp=\dp\bmb@box%
    \ifdim\bmb@temp<1.5pt%
      \bmb@temp=1.5pt%
    \fi%
    \setbox\bmb@box=\hbox{\raise\bmb@temp\hbox{\box\bmb@box}}%
    \dp\bmb@box=0pt%
    \bmb@prevheight=\ht\bmb@box%
  \fi%
  \bmb@temp=\bmb@width%
  \bmb@dima=\bmb@temp\advance\bmb@dima by2.2bp%
  \bmb@dimb=\bmb@temp\advance\bmb@dimb by4bp%
  \hbox{%
    \begin{pgfpicture}{0bp}{+-\ht\bmb@box}{0bp}{+-\ht\bmb@box}
      \ifdim\wd\bmb@box=0pt%
        \color{lower.bg}%
      \else%
        \color{upper.bg}%
      \fi%
      \pgfsetfillopacity{\opacitylevel}%NEW
      \pgfpathqmoveto{-4bp}{-1bp}
      \pgfpathqcurveto{-4bp}{1.2bp}{-2.2bp}{3bp}{0bp}{3bp}
      \pgfpathlineto{\pgfpoint{\bmb@temp}{3bp}}
      \pgfpathcurveto%
      {\pgfpoint{\bmb@dima}{3bp}}%
      {\pgfpoint{\bmb@dimb}{1.2bp}}%
      {\pgfpoint{\bmb@dimb}{-1bp}}%
      \bmb@dima=-\ht\bmb@box%
      \advance\bmb@dima by1pt%NEW
      \pgfpathlineto{\pgfpoint{\bmb@dimb}{\bmb@dima}}
      \pgfpathlineto{\pgfpoint{-4bp}{\bmb@dima}}
      \pgfusepath{fill}
    \end{pgfpicture}%
    \copy\bmb@box%
  }%
  \nointerlineskip%
  \vskip-1pt%
  \ifdim\wd\bmb@box=0pt%
  \else%
  \hbox{%
    \begin{pgfpicture}{0pt}{0pt}{\bmb@width}{6pt}
      \bmb@dima=\bmb@width%
      \advance\bmb@dima by8bp%
      \pgfpathrectangle{\pgfpoint{-4bp}{-1bp}}{\pgfpoint{\bmb@dima}{8bp}}
      \pgfusepath{clip}
      {\pgftransformshift{\pgfpoint{-4bp}{0bp}}\pgftext[left,base]{\pgfuseshading{bmb@transition}}}%
    \end{pgfpicture}%
  }%
  \nointerlineskip%
  \vskip-0.5pt%
  \fi%
  \ifbmb@shadow%
    \setbox\bmb@boxshadow=\hbox{\pgfuseshading{bmb@shadow}}%
    \setbox\bmb@boxshadowball=\hbox{\pgfuseshading{bmb@shadowball}}%
    \setbox\bmb@boxshadowballlarge=\hbox{\pgfuseshading{bmb@shadowballlarge}}%
  \fi%
  \setbox\bmb@colorbox=\hbox{{\pgfpicturetrue\pgfsetfillopacity{\opacitylevel}\pgfsetcolor{lower.bg}}}%NEW
  \setbox\bmb@box=\hbox\bgroup\begin{minipage}[b]{\bmb@width}%
    \vskip2pt%
    \usebeamercolor[fg]{\bmb@lower}%
    \colorlet{beamerstructure}{upper.bg}%
    \colorlet{structure}{upper.bg}%
    %\color{.}%
  }

\makeatother

\begin{document}

\begin{frame}
\frametitle{slide title}
\begin{columns}
\column{0.5\textwidth}
  \begin{beamercolorbox}[shadow=false,rounded=true]{box2}
    {\usebeamercolor[fg]{text2} \bf T1}
    \begin{itemize}
    \item element
    \item element
    \item element
    \item element
    \item element
    \end{itemize}
  \end{beamercolorbox}
\column{0.5\textwidth}
  \begin{beamercolorbox}[shadow=false,rounded=true]{box3}
    {\usebeamercolor[fg]{text2} \bf T2}
    \begin{itemize}
    \item element
    \item element
    \item element
    \item element
    \end{itemize}
  \end{beamercolorbox}
\end{columns}  
\begin{beamercolorbox}[shadow=false,rounded=true]{box1}
  \begin{itemize}
  \item element
  \item element
  \end{itemize}
\end{beamercolorbox}
\end{frame}

\end{document}

enter image description here

For the background template I used the CTAN lion by Duane Bibby.

share|improve this answer
    
I tried to compile your code, but it hangs at: /usr/share/texmf-texlive/tex/latex/hyperref/nameref.sty (/usr/share/texmf-texlive/tex/latex/oberdiek/refcount.sty)) (./test4.out) (./test4.out) (/usr/share/texmf-texlive/tex/latex/translator/translator-theorem-dictionary-En glish.dict) (./test4.nav) (/usr/share/texmf-texlive/tex/latex/amsfonts/umsa.fd) (/usr/share/texmf-texlive/tex/latex/amsfonts/umsb.fd) <b.png, id=10, 351.3125pt x 312.16624pt> <use b.png> [1{/var/lib/texmf/fonts/ma p/pdftex/updmap/pdftex.map} <./b.png (PNG copy)>]) * –  simona Oct 10 '12 at 14:30
    
@simona you have to use one of your own images instead of the placeholder b, so replace b in \includegraphics[width=\paperwidth,height=\paperheight]{b}with the name (and path) of one of your actual images; seeing your initial code, I guess you should use figures/PNG/ripple.png. –  Gonzalo Medina Oct 10 '12 at 16:26
    
yes, I used my own image. I also tried to remove the background image and it is hanging anyway –  simona Oct 10 '12 at 16:46
    
@simona Are you processing the exact code I posted? If not, please process the exact (i,e., with absolutely no change, except for the image file name). Do the error persists? –  Gonzalo Medina Oct 10 '12 at 17:11
    
@simona any progress with the document or are you still having problems? –  Gonzalo Medina Oct 10 '12 at 23:58
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.