2

I don't know how to achieve the following:

  • On page 1 I have an image A and a block with text. Here, Image A shows some flowchart (as png) and the block should be covered (grayed out).

  • On the second page, there is another image B, with some other parts of the flow chart. Here, also the text-block should still be grayed out.

  • Then, on the third page, the image B should be grayed out and the block becomes uncovered now.

Here is an example code

\documentclass[professionalfont, 10pt,aspectratio=169]{beamer}
\usetheme{Berlin}
%\useoutertheme{Berlin}

\begin{document}
    \begin{frame}
    Image A
    \begin{block}{here covered}
        content...
    \end{block}
\end{frame}

\begin{frame}
Image B
\begin{block}{covered}
    content...
\end{block}
\end{frame}

\begin{frame}
Image B (covered)
\begin{block}{uncovered}
    content...
\end{block}
\end{frame}
\end{document}

I tried s.th. with \beamerdefaultoverlayspecification{<*>} and \uncover<> but that does not seem to work.

Any ideas?

EDIT: I use this frame code:

\begin{frame}{Machine Learning: Supervised Learning}
 \begin{figure}
    \vspace{1em}
    \begin{center}
        \uncover<1->{
    \centering
    \only<1>{\includegraphics[width=0.6\textwidth]{pic/int1.pdf}}
    \only<2>{\includegraphics[width=0.6\textwidth]{pic/int2.pdf}}
    \only<3>{\includegraphics[width=0.6\textwidth]{pic/int3.pdf}}
    \only<4>{\includegraphics[width=0.6\textwidth]{pic/int4.pdf}}
    \only<5>{\includegraphics[width=0.6\textwidth]{pic/int5.pdf}}
    \only<6>{\includegraphics[width=0.6\textwidth]{pic/int9.pdf}}}
    \caption{Supervised learning: classification vs. regression.}
 \vspace{-1em}
\end{center}
\end{figure}    
\uncover<6>{\begin{block}{Supervised Learning}
    Learning a function $\underline{y} = \underline{g}(\underline{x}) + \epsilon$ 
    from  \textit{inputs} $\underline{x}=[x^1\ ... \ x^d]^T \in \mathbb{R}^d$  to \textit{outputs} $\underline{y}$  from a \textit{data set} $\mathcal{D}=\{(\underline{x}^i, \underline{y}^i)\}_{i=1}^n$.
\end{block}}
\end{frame}

Problem 1: the images (all equal size) are at slightly different positions in each frame

Problem 2: On page (6) I want the block text to become uncovered and the last image (int5.pdf) to be covered, s.th. like this (better would be if the caption is also grayed out):

enter image description here

2
  • Welcome to TeX.SE!
    – Zarko
    Oct 13, 2021 at 11:34
  • You change your question complete ...,
    – Zarko
    Oct 13, 2021 at 13:40

1 Answer 1

4

It seems beamer does not know how to dim pictures, so the \setbeamercovered specifications won't apply. One alternative is to put your figure in a tikz node with some specified opacity value.

\documentclass[professionalfont, 10pt,aspectratio=169]{beamer}
\usetheme{Berlin}
\usepackage{tikz}
\begin{document}
\begin{frame}{Machine Learning: Supervised Learning}
    \begin{figure}
    \vspace{1em}
    \begin{center}
    \only<1>{\includegraphics[height=3cm]{example-image-a}}%
    \only<2>{\includegraphics[height=3cm]{example-image-b}}%
    \only<3>{\includegraphics[height=3cm]{example-image-c}}%
    \only<4>{\includegraphics[height=3cm]{example-image}}%
    \only<5>{\includegraphics[height=3cm]{example-image-golden}}%
    \only<6>{\tikz{\node[inner sep=0,opacity=0.15]{\includegraphics[height=3cm]{example-grid-100x100pt}};}}
    \caption{Supervised learning: classification vs. regression.}
\vspace{-1em}
\end{center}
\end{figure}
\uncover<6>{\begin{block}{Supervised Learning}
    Learning a function $\underline{y} = \underline{g}(\underline{x}) + \epsilon$ 
    from  \textit{inputs} $\underline{x}=[x^1\ ... \ x^d]^T \in \mathbb{R}^d$  to \textit{outputs} $\underline{y}$  from a \textit{data set} $\mathcal{D}=\{(\underline{x}^i, \underline{y}^i)\}_{i=1}^n$.
\end{block}}
\end{frame}
\end{document}

enter image description here

3
  • wow! thanks for your help!! Oct 13, 2021 at 15:52
  • If you like my answer and it was helpful, please consider upvoting (by clicking on the arrows next to the score) and/or marking it as the accepted answer (by clicking on the checkmark ✓).
    – erik
    Oct 13, 2021 at 15:56
  • @erik \setbeamercovered specifications won't apply, so it should be removed from your code
    – Black Mild
    Mar 14, 2022 at 7:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .