1

I'm trying to use the animate package, but when I insert an animation into beamer using the animategraphics command, the result is horribly off-center. This occurs even if I use \begin{center}\end{center} commands.

Here's some stripped-down code to illustrate the problem. I used colors so that the off-centeredness is clearly visible.

Here's the "master" file:

\documentclass{beamer}[16:9]
\usepackage{animate}
\begin{document}
{\setbeamercolor{background canvas}{bg=blue}
\begin{frame}
\animategraphics[]{1}{animate-test-frames}{0}{0}
\end{frame}
} % end setbeamercolor
\end{document}

And here's the animate-test-frames.tex file to go with it:

\documentclass{beamer}[16:9]
\begin{document}
{\setbeamercolor{background canvas}{bg=red}
\begin{frame}
\end{frame}
} % end setbeamercolor
\end{document}

This produces the following output:

enter image description here

It seems like there should be a simple way to fix this. Any ideas?

Thanks!

1
  • 2
    Your graphic is too large. You should either scale it or set the margins to zero. Jan 26 '20 at 15:08
0

A similar result would be obtained with \includegraphics[page=1]{animate-test-frames}. The PDF with animation frames is too wide to be inserted as normal slide content.

Use a combination of \usebackgroundtemplate{...} and an empty plain \frame{} that is put in a group ({...}) in order to insert a slide-filling animation. The plain option should be set in case the presentation makes use of a theme, as in this example:

\documentclass[aspectratio=169]{beamer}

\usetheme{Warsaw}
\usepackage{graphicx}
\usepackage{animate}

\begin{document}

\begin{frame}{First frame}
\end{frame}

{
\usebackgroundtemplate{\animategraphics[autoplay]{1}{animate-test-frames}{}{}}
\frame[plain]{}
}% end of \usebackgroundtemplate

\begin{frame}{Last frame}
\end{frame}

\end{document}

Note that the correct way for setting a 16:9 aspect ratio for beamer is aspectratio=169, put as document class option. Thus, the animation frames are made with this code:

\documentclass[aspectratio=169]{beamer}
\begin{document}
{\setbeamercolor{background canvas}{bg=red}
\begin{frame}
\end{frame}
} % end setbeamercolor
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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