views:

960

answers:

2

I am attempting to use overlays with figures to save myself from creating a different image for each slide. The overlay works with any text I include, but not with the figures. For example:

\setbeamercovered{dynamic}
\begin{figure}\resizebox{10.0cm}{!}{
  \includegraphics{problem-a.pdf}
  Test A
  \pause
  \includegraphics{problem-b.pdf}
  Test B
  \pause
  \includegraphics{problem-c.pdf}
  Test C
}\end{figure}

Results in the text "Test B" and "Test C" being shaded on the first slide, but the figures corresponding to "problem-b" and "problem-c" are not shaded.

A: 

I've done something similar doing the following:

\begin{figure}
                \includegraphics<1->{problem-a.pdf}
                \onslide<1->{Test A}                    
                \includegraphics<2->{problem-b.pdf}
                \onslide<1->{Test B}
                \includegraphics<3->{problem-c.pdf}
                \onslide<1->{Test C}
\end{figure}

Maybe its useful to you

xavivars
+1  A: 

For anyone that stumbles upon this, the best thing I've found so far is to use tikz and setup a custom transparency mode:

\gdef\transparent@value{100}
\newcommand{\getbeamertrans}{
    \transparent@value/100
}
\newcommand{\set@transparent}[1]{\gdef\transparent@value{#1}}
\def\opaquenessCustom#1{%
\only<1->{%
  \beamer@actions{%
    \set@transparent{#1}%
    \expandafter\xdef\csname beamer@oldcolorhook%
    \the\beamer@coveringdepth\endcsname{\beamer@colorhook}%
    \expandafter\xdef\csname beamer@oldpgfextension%
    \the\beamer@coveringdepth\endcsname{\beamer@pgfextension}%
    {\globalcolorstrue\colorlet{beamer@freeze\the\beamer@coveringdepth}{bg}}%
    \xdef\beamer@colorhook{!#1!beamer@freeze%
      \the\beamer@coveringdepth\beamer@colorhook}%
    \gdef\beamer@pgfextension{!#1opaque}%
    \color{.}%
  }%
  {%
    \set@transparent{100}%
    \xdef\beamer@colorhook{\csname beamer@oldcolorhook%
      \the\beamer@coveringdepth\endcsname}%
    \xdef\beamer@pgfextension{\csname beamer@oldpgfextension%
      \the\beamer@coveringdepth\endcsname}%
    \color{.}%
  }}%
}%
\define@key{beamer@mixin}{transparent}[15]{%
    \def\beamer@uncoverbeforeactions{\ignorespaces\opaquenessCustom{#1}}%
    \def\beamer@uncoverafteractions{\ignorespaces\opaquenessCustom{#1}}%
}
\newcommand{\BeamerGraphic}[1]{%
    \begin{tikzpicture}%
     {\node[opacity=\getbeamertrans] {\includegraphics{#1}};}%
    \end{tikzpicture}%
}
Compholio