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.

I recently upgraded from texlive2011 to texlive2012. The transition was relatively smooth, but today, I found one problem. In my beamer slides, under texlive2011 distribution, the following construct with \pause to display two figures sequentially in two pages worked. In other words, under texlive2011, the first page showed only the first figure and the shaded subtitle "(b) Error" of the second figure, but not the second figure itself, and the the second page showed both figures. But under the new texlive2012 distribution, when the first page shows both figures, and only the subtitle "(b) Error" is shown with the specified transparency. Then, the second page shows the darkened subtitle. I am wondering why the behavior of \pause changed. Any suggestions would be highly appreciated.

Here is the actual latex construct I used (png files provided by mwe package):

\documentclass{beamer}
\usepackage{color,graphicx,subfigure}
\usepackage{mwe}

\mode<presentation>
{
\usetheme{Madrid} % this is the best so far.
}
\setbeamercovered{transparent=10}

\begin{document}
\begin{frame}
\frametitle{Pause Test}
\begin{figure}
\centering
\renewcommand{\thesubfigure}{(a)}
\subfigure[Original]{\includegraphics[width=0.45\textwidth]{example-image-a.png}}
\pause
\renewcommand{\thesubfigure}{(b)}
\subfigure[Error]{\includegraphics[width=0.45\textwidth]{example-image-b.png}}
\end{figure}
\end{frame}

\end{document}
share|improve this question
5  
Please add a complete, minimal document (MWE) illustrating the problem; I ask you for this MWE since I was unable to reproduce the undesired behaviour using the code snippet you provided. –  Gonzalo Medina Dec 10 '12 at 23:37
    
I'll post the actual latex constructs. Please use any two png files when you try out. –  BoundaryValueProblems Dec 11 '12 at 8:51
1  
I see exactly the same result when compiling the document with TeX Live 2009, 2010, 2011 and 2012. The transparency can be applied to text, not to the PNG file, AFAIK. –  egreg Dec 11 '12 at 9:10
    
Hi, egreg. Thanks for your comments. That means that the pause behavior under texlive 2012 is the correct one, and that under texlive 2011 was anomaly?? –  BoundaryValueProblems Dec 11 '12 at 18:20
    
According to beameruserguide: "Unfortunately, pgf does not support real transparency yet. Instead, transparency is created by mixing the color of the object you want to show with the current background color"... "The transparency effect will automatically apply to all colors, except for the colors in images." Therefore it would be surprising if it worked in TeX Live 2011, as @egreg has indicated. (Note: prefix a username with an @ to help them to see your comment replies.) –  cyberSingularity Dec 11 '12 at 18:54
add comment

2 Answers

I'm sorry, but I made a mistake when I posted my question. When I ran my simple file under texlive2011, the file did not have the following line:

\setbeamercovered{transparent=10}

But when I tested the file under texlive2012, I inserted the above line. That made the difference. After removing that line, the pdf file created under texlive2012 exactly behaves as that under texlive2011. What I learned this time is that regardless texlive2011 or texlive2012, that line specifying transparency with \pause does not work as expected. I also found that

\visible<2->{\renewcommand{\thesubfigure}{(b)}
             \subfigure[Error]{\includegraphics[width=0.45\textwidth]{example-image-b.png}}}

does the sequential display but the transparent subtitle is ignored even with the above transparency line. On the other hand,

\uncover<2->{\renewcommand{\thesubfigure}{(b)}
             \subfigure[Error]{\includegraphics[width=0.45\textwidth]{example-image-b.png}}}

just does the same as \pause (i.e., two figures show up simultaneously at page 1 with shaded subtitle "(b) Error").

Anyways, thanks a lot, egreg and cyberSingularity, for pointing out the transparency issue with pgf! I hope that this transparency issue will be resolved soon.

share|improve this answer
add comment

Now that we understand that the \pause functionality has not changed, I have interpreted the question as "How can I get \pause to make images transparent too?"

And for that, I have one possible workaround. I am not sure how robust it is, but essentially I have attempted to replace the pgf transparent mechanism with the version in the transparent package (which probably requires the pdftex engine):

\documentclass{beamer}
\usepackage{color,graphicx,subfigure}
\usepackage{mwe}

\mode<presentation>
{
\usetheme{Madrid} % this is the best so far.
}
\setbeamercovered{transparent=50}
%0 means “totally transparent” and 100 means “totally opaque.”

\pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>}% based on comment by Martin Heller on http://tex.stackexchange.com/questions/16061/includegraphics-pdf-color-problem; force Adobe Reader to use the RGB rendering model for pages with transparency. Without this, the colours look different (and wrong) on pages with transparency.

%%% replace pgf transparency with Heiko's transparent package
\usepackage{transparent}
% but patch it to take a percentage instead of a value between 0 and 1
\let\opaquepercent\transparent
\usepackage{etoolbox}
\makeatletter
\patchcmd{\opaquepercent}{\dimen@=#1\p@\relax}{\dimen@=0.01\dimexpr#1\p@\relax\relax}{}{\errmessage{patching failed}}

% redefine \opaqueness in \beamer@startcovered
\def\beamer@startcovered{%
  \beamer@smuggle{%
  \global\advance\beamer@coveringdepth by 1\relax%
  \beamer@actions{\pgfsys@begininvisible\aftergroup\beamer@@spacingcover}{%
     \pgfsys@endinvisible\aftergroup\beamer@@spacingcover%
     }%
  \def\opaqueness<##1>##2{%
    \only<##1>{%
      \beamer@actions{%
        \opaquepercent{##2}%
      }%
      {%
      }}}%
  \ifnum\beamer@slideinframe<\beamer@minimum%ok, at beginning
  {%
    \beamer@saveanother%
    \advance\beamer@minimum by-\beamer@slideinframe%
    \beamer@slideinframe=\beamer@minimum%
    \beamer@uncoverbeforeactions%
    \beamer@restoreanother%
  }%
  \else%
  {%
    \beamer@saveanother%
    \advance\beamer@slideinframe by-\beamer@minimum%
    \beamer@uncoverafteractions%
    \beamer@restoreanother%
  }%
  \fi%
  \beamer@do%
  }%
}
%%% end transparent patch

\begin{document}
\begin{frame}
\frametitle{Pause Test}
\begin{figure}
\centering
\renewcommand{\thesubfigure}{(a)}
\subfigure[Original]{\includegraphics[width=0.45\textwidth]{example-image-a.png}}
\pause
\renewcommand{\thesubfigure}{(b)}
\subfigure[Error]{\includegraphics[width=0.45\textwidth]{example-image-b.png}}
\end{figure}
\end{frame}

\begin{frame}
\frametitle{Uncover Test}
\begin{figure}
\centering
\renewcommand{\thesubfigure}{(a)}
\subfigure[Original]{\includegraphics[width=0.25\textwidth]{example-image-a.png}}
\uncover<2-3>{%
\renewcommand{\thesubfigure}{(b)}
\subfigure[Error]{\includegraphics[width=0.25\textwidth]{example-image-b.png}}
}%
\uncover<2>{%
\renewcommand{\thesubfigure}{(c)}
\subfigure[Test]{\includegraphics[width=0.25\textwidth]{example-image-a.png}}
}%
\end{figure}
\end{frame}

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

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.