The problem that I had is somehow the frame size of the animation changed hence the animation does not look so smooth. I manage to have the following example.
Code: Select all
\documentclass{beamer}
\usetheme{Singapore}
\usepackage{animate}
\usepackage{tikz}
\newcommand\background{}
\newcommand{\animationframe}{%
\begin{tikzpicture}
\background
\draw (0, 0) rectangle +(4, 2);
\end{tikzpicture}
}
\begin{document}
\begin{frame}
\frametitle{Simple Animation}
\begin{center}
\begin{animateinline}[controls]{12}
\animationframe
\newframe
\renewcommand\background{\draw (2,1) node{T};}
\animationframe
\end{animateinline}
\end{center}
\end{frame}
\end{document}
If I removed the \renewcommand{...} from the code then (of course) the frame are exactly the same and the bounding box is OK (but of course there is no T in the middle for the second frame anymore).
Strange enough, if I removed the \renewcommand{...} and put some brackets around the second \animationframe, i.e. {\animationframe} then the problem with the bounding box occurred again (see animation-2.pdf).
Any information regarding this matters will be very highly appreciated, in particular, if I misunderstood and misused the animate package for what I am trying to achieve.
Thank you very much.
Best regards
--
Thai Son Hoang