I have two different animations, made with TikZ and the animate
package, that I want to include in a beamer
presentation. When I had the code inside of my presentation's .tex
file everything worked fine, then I tried to move the animation code into separate files and include them with \input
, and it stops working.
Here's the especially weird thing: If I include only one of the animations and comment out the other, the code works. When I include both animations I get an error about
Missing \endgroup inserted
or
Something's wrong: perhaps a missing \item?
depending on whether I comment out the first or second \input
. Any advice would be most appreciated. Below is a piece of the code just to give you an idea of what I'm doing (my complete preamble is included, just in case one of the other packages is what's causing issues).
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage{mathrsfs}
\usepackage[absolute,overlay]{textpos}
\mode<presentation>
{
\usetheme{Singapore}
\usecolortheme{seahorse}
\setbeamercovered{transparent}
}
\usepackage{tikz}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{color}
\usepackage{animate} % Animations
\usepackage{fp} % Fixed point calculations
\usepackage{ifthen}
\usepgflibrary{arrows}
\usetikzlibrary{decorations.markings, arrows, decorations.pathmorphing,
backgrounds, positioning, fit, shapes.geometric}
\newcounter{frame}
\setcounter{frame}{0}
\begin{document}
\begin{frame}[fragile]{Animation 1}
\begin{center}
\input{animations/anim1.tex}
\end{center}
\end{frame}
\begin{frame}[fragile]{Animation 2}
\begin{center}
\input{animations/anim2.tex}
\end{center}
\end{frame}
\end{document}
anim1.tex and anim2.tex are identical:
\begin{animateinline}[autoplay, loop, controls, poster=first]{15}
\whiledo{\theframe < 179}{
\begin{tikzpicture}
\draw (-3, -3) rectangle (3, 3);
\filldraw (\theframe : 2cm) circle (0.05cm);
\end{tikzpicture}
\stepcounter{frame}
\ifthenelse{\theframe < 179}{
\newframe
}{
\end{animateinline}
}
}
I'm very much a newbie with the animate
package, so perhaps someone who's more knowledgeable will easily recognize what's wrong, but this is very frustrating right now.
Any help would be most appreciated.
anim1.tex
andanim2.tex
.frame
counter defined?frame
.