5
% Doesn't Work
\documentclass[tikz,border=2mm]{standalone} 

% Works
%\documentclass[border=2mm]{standalone} 

\usepackage{tikz} 
\usepackage{pgfplots} 
\pgfplotsset{compat=newest} 
\usepackage{animate} 

\begin{document} 

\begin{animateinline}[palindrome,controls]{12} 
\multiframe{10}{i=0+1}{% 
abc 
\begin{tikzpicture} % --> Removing the `tikzpicture` environment "removes" the error message.
\end{tikzpicture} 
} 
\end{animateinline} 

\end{document} 

  • I want to produce standalone diagrams, pgfplots package + standalone document class.
  • I also want the diagrams to be animated, animate package.
  • I get the error ! Missing \endgroup inserted.<inserted text>\endgroup\end{tikzpicture}}.
  • If I remove the tikz option from the document class then I do not get an error -- but if I have multiple diagrams then they are not on separate pages.
  • I switched to article document class for now.

Update

Inspired my AlexG's comment I tried this:

  • Removing tikz option from document class.
  • Inserting \newpage outside the animateline environments.
  • But, same error.

We can close the question -- I just wanted to make sure that it's not a stupid mistake on my side :).

\documentclass[border=2mm]{standalone} 

%\usepackage{tikz} 
\usepackage{pgfplots} 
\pgfplotsset{compat=newest} 
\usepackage{animate} 

\begin{document} 

\newpage
\begin{animateinline}[palindrome,controls]{12} 
\multiframe{10}{i=0+1}{% 
abc 
\begin{tikzpicture} 
\end{tikzpicture} 
} 
\end{animateinline} 

\newpage
\begin{animateinline}[palindrome,controls]{12} 
\multiframe{10}{i=0+1}{% 
abc 
\begin{tikzpicture} 
\end{tikzpicture} 
} 
\end{animateinline} 

\end{document} 
6
  • If you want an animated plot on a single standalone page, the tikz option doesn't make sense. It trims the papersize to the tikzpicture size and places \newpages between the tikzpictures, thus \newpages inside an animateinline environment. This cannot compile without error.
    – AlexG
    May 16, 2017 at 21:34
  • On the other hand, if you want to produce a multipage document with standalone tikzpictures by means of the tikz option, the animateinline environment must be removed.
    – AlexG
    May 16, 2017 at 21:39
  • @AlexG Thanks. I thought it is a problem of the standalone class. May 16, 2017 at 22:42
  • 1
    This isn't the first time the [tikz] option has caused problems. See tex.stackexchange.com/questions/277784/… May 17, 2017 at 1:44
  • @AlexG I updated the question -- but we can end it here. Thanks for the time to look into it. May 17, 2017 at 7:30

1 Answer 1

3

The error is caused by placing \newpage in a standalone class document, as this simple, non-compiling example shows (everything removed from the OP's code except "abc" and \newpage):

\documentclass[border=2mm]{standalone}

\begin{document}

\newpage
abc

\newpage
abc

\end{document}

Instead, \standaloneenv{...} or \begin{standalone}...\end{standalone} should be used to tell which content should be typeset onto individual pages:

\documentclass[border=2mm]{standalone} 

%\usepackage{tikz} 
\usepackage{pgfplots} 
\pgfplotsset{compat=newest} 
\usepackage{animate} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\standaloneenv{animateinline}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document} 

\begin{animateinline}[palindrome,controls]{12} 
  \multiframe{10}{i=0+1}{% 
    \Huge\fbox{abc: \i}
    \begin{tikzpicture} 
    \end{tikzpicture} 
  } 
\end{animateinline} 

\begin{animateinline}[palindrome,controls]{12} 
  \multiframe{10}{i=0+1}{% 
    \Huge\fbox{ijk: \i}
    \begin{tikzpicture} 
    \end{tikzpicture} 
  } 
\end{animateinline} 

\end{document}
4
  • It works! Any reason you commented %\usepackage{tikz} out? May 17, 2017 at 8:37
  • It was you ;), 2nd code box in the question.
    – AlexG
    May 17, 2017 at 8:39
  • Haha. No further questions my honor... May 17, 2017 at 8:41
  • 1
    BTW, placing "abc" into a standalone environment still produces the reported error. This is in fact a bug of the class.
    – AlexG
    May 17, 2017 at 8:43

You must log in to answer this question.

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