2

I have the following code that works in Beamer (first time using animateinline btw) and would like to add to a pdf text, but when I transition to report, it throws errors:

Missing \endcsnmame inserted, Missing number, treated as zero, Illegal unit of measure (pt inserted), Extra }, or forgotten /endgroup, etc.

Any thoughts, or can I not use animations in report?

\documentclass{article}
\usepackage{animate}
\begin{document}
\begin{frame}
\begin{animateinline}[autoplay,loop,controls]{1} 
  \multiframe{24}{i=2+1}{\parbox{\textwidth}{
\includegraphics[width=.5\textwidth]{MomDistZ/listMD\i}
\includegraphics[width=.5\textwidth]{BandsZ/ListBand\i}
\\
\includegraphics[width=.33\textwidth]{SingPairAmpZ/ListPairAmp\i}
\includegraphics[width=.33\textwidth]{TripDnPairAmpZ/ListTripDn\i}
\includegraphics[width=.33\textwidth]{TripUpPairAmpZ/ListTripUp\i}  
}}
\end{animateinline}
\end{frame}
\end{document}

Thank you for your help.

2
  • Welcome to TeX.Stackexchange! Apr 19, 2018 at 23:43
  • Thank you, I've been a viewer for quite some time, but have found answers before I needed to ask. Thank you for your quick reply.
    – Sureau
    Apr 20, 2018 at 17:40

2 Answers 2

3

Two problems:

  • the graphicx package is missing

  • the frame environment is not defined in article class

(You're images were slightly too big and caused overfull boxes)

\documentclass{article}
\usepackage{graphicx}
\usepackage{animate}
\begin{document}
%\begin{frame}
\begin{animateinline}[autoplay,loop,controls]{1}%
    \multiframe{24}{i=2+1}{%
      \parbox{.95\textwidth}{%
        \includegraphics[width=.5\linewidth]{example-image}%
            \includegraphics[width=.5\linewidth]{example-image}%

            \includegraphics[width=.33\linewidth]{example-image}%
            \includegraphics[width=.33\linewidth]{example-image}%
            \includegraphics[width=.33\linewidth]{example-image}%
        }%
    }%
\end{animateinline}%
%\end{frame}
\end{document}

enter image description here

4
  • 1
    You could also keep the frame(s) and use the beamerarticle package.
    – erik
    Apr 20, 2018 at 0:32
  • @erik Please feel free to post an answer with this idea! Apr 20, 2018 at 0:35
  • Thank you for your quick replies, it was indeed that I forgot graphicx. I left the frames because it worked in Beamer as written. My dissertation is long and I often ensure new content works before adding to my long text. It takes longer than usual to build. This is likely due to latex screaming at me about underfull hbox badness. I used \textwidth because one example I incorporated used it and never changed what works. But I think I get why it's wrong. Should I use \linewidth on singular images too?
    – Sureau
    Apr 20, 2018 at 17:46
  • @Sureau Unless for special situations (e.g. inside itemizations) it does not make much difference. I myself usually use \textwidth Apr 20, 2018 at 18:53
2

In addition to adding the graphicx package, as pointed out by @samcarter, you could keep the frames and use the beamerarticle package.

\documentclass{article}
\usepackage{graphicx}
\usepackage{beamerarticle}
\usepackage{animate}
\begin{document}
\begin{frame}
\begin{animateinline}[autoplay,loop,controls]{1}%
    \multiframe{24}{i=2+1}{%
      \parbox{.95\textwidth}{%
        \includegraphics[width=.5\linewidth]{example-image}%
            \includegraphics[width=.5\linewidth]{example-image}%

            \includegraphics[width=.33\linewidth]{example-image}%
            \includegraphics[width=.33\linewidth]{example-image}%
            \includegraphics[width=.33\linewidth]{example-image}%
        }%
    }%
\end{animateinline}%
\end{frame}
\end{document}

enter image description here

4
  • Interesting. Does beamerarticle simply neutralise the frame environments?
    – AlexG
    Apr 20, 2018 at 6:43
  • 1
    @AlexG It appears to translate the frame environment into something like \noindent\textbf{‹frametitle›}\par. Other elements are also translated, such as block and alertblock environments. There is also an article-specific overlay specification, which allows you to add to the article what you would otherwise explain during a presentation with \only<article>{}.
    – erik
    Apr 20, 2018 at 13:43
  • Thank you for your quick replies, but this is for a dissertation and I'm using a report template. The issue was resolved by samcarter in that in my minimal example I forgot the graphicx package. The frames were still included in my example above because it worked in Beamer. But thank you again for your help.
    – Sureau
    Apr 20, 2018 at 17:42
  • @Sureau You're welcome. For future reference, the beamerarticle package works with the report documentclass as well.
    – erik
    Apr 20, 2018 at 20:42

You must log in to answer this question.

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