同じ環境に画像とアニメーションを含める

同じ環境に画像とアニメーションを含める

私の Beamer プレゼンテーションには、パッケージを使用してアニメーション化したい 3 つの画像と結合された PDF がありますanimate。設定は次のとおりです。3 つの画像は隣り合って並んでおり、3 番目の画像をアニメーションに置き換えます。つまり、最初のスライドでは 3 つの画像を隣り合わせにし、2 番目のスライドでは左の 2 つの画像をアニメーションの隣に配置します (つまり、アニメーションが 3 番目の画像を置き換えます)。

ここに写真があります:

ここに画像の説明を入力してください

私が試したことを示した MWE を以下に示します。

\documentclass[8pt]{beamer}

\usetheme{Luebeck}
\usefonttheme{serif}
\setbeamertemplate{itemize item}{\color{black} $\vcenter{\hbox{\tiny$\bullet$}}$} %style of item
\setbeamertemplate{footline}[frame number]{}
\setbeamertemplate{navigation symbols}{}

\usepackage{xcolor}
\usepackage{graphicx}
\setlength{\parskip}{0.75em}
\usepackage{animate}
\usepackage{tikzsymbols}

\begin{document}

\begin{frame}

\begin{figure}
    \centering
    \includegraphics<1->[width = 0.33\textwidth]{cont_lasso.pdf}
    \includegraphics<1->[width = 0.33\textwidth]{cont_ridge.pdf}
    \includegraphics<1>[width = 0.33\textwidth]{cont_enet.pdf}
    \animategraphics<2>[autoplay, loop, width = 0.33\textwidth]{30}{enet_ani_merged}{}{}
\end{figure}

The \textit{shape} of the penalty can give some idea of the type of shrinkage imposed on the model.
\begin{itemize}
    \item Sharp corners $\to$ sparsity! \Laughey[1.5][yellow][pink]
    \item Round corners $\to$ only shrinkage!
\end{itemize}

\end{frame}

\end{document}

3 つの画像のファイル名はcont_lasso.pdf、、cont_ridge.pdfでありcont_enet.pdf、アニメーションの結合された PDF の名前はですenet_ani_merged.pdf

編集

明確にするために、2 番目のスライドを開始するとアニメーションが自動的に再生されるようにしたいと思います。

いくつか実験してみたところ、問題はオーバーレイではなく、環境animategraphics内にコマンドを配置するfigureことが許可されていないことにあるようです。そこで、2 つのグラフィックとアニメーションを同じ環境に配置するにはどうすればよいのかを知りたいです。

答え1

コメントから外れますがleandriis、最終的な出力がどのようになるかを確認したい人のために、次のコードを記載します。noframenumberingフレーム番号が変更されないように追加する必要がありました。

\documentclass[8pt]{beamer}

\usetheme{Luebeck}
\usefonttheme{serif}
\setbeamertemplate{itemize item}{\color{black} $\vcenter{\hbox{\tiny$\bullet$}}$} %style of item
\setbeamertemplate{footline}[frame number]{}
\setbeamertemplate{navigation symbols}{}

\usepackage{xcolor}
\usepackage{graphicx}
\setlength{\parskip}{0.75em}
\usepackage{animate}
\usepackage{tikzsymbols}

\begin{document}

\begin{frame}{Contour plots}

\begin{figure}
    \centering
    \includegraphics[width = 0.33\textwidth]{cont_lasso.pdf}
    \includegraphics[width = 0.33\textwidth]{cont_ridge.pdf}
    \includegraphics[width = 0.33\textwidth]{cont_enet.pdf}
    %\animategraphics[autoplay, loop, width = 0.33\textwidth]{30}{enet_ani_merged}{}{}
\end{figure}

The \textit{shape} of the penalty can give some idea of the type of shrinkage imposed on the model.
\begin{itemize}
    \item Sharp corners $\to$ sparsity! \Laughey[1.5][yellow][pink]
    \item Round corners $\to$ only shrinkage!
\end{itemize}

\end{frame}

\begin{frame}[noframenumbering]{Contour plots}

\begin{figure}
    \centering
    \includegraphics[width = 0.33\textwidth]{cont_lasso.pdf}
    \includegraphics[width = 0.33\textwidth]{cont_ridge.pdf}
    %\includegraphics[width = 0.33\textwidth]{cont_enet.pdf}
    \animategraphics[autoplay, loop, width = 0.33\textwidth]{30}{enet_ani_merged}{}{}
\end{figure}

The \textit{shape} of the penalty can give some idea of the type of shrinkage imposed on the model.
\begin{itemize}
    \item Sharp corners $\to$ sparsity! \Laughey[1.5][yellow][pink]
    \item Round corners $\to$ only shrinkage!
\end{itemize}

\end{frame}

\end{document}

以下は出力のスクリーンショットです (PDF を画面記録する方法が見つからなかったため、右の図は動いているはずです)。

ここに画像の説明を入力してください

関連情報