It is a bug in animate
. The macro \@anim@@sanitize
is executed several times, one for each token in the list .:;?!/"'*+,->=<$&@][)(^_
|~`, and each time it does
\global\let\@anim@leftbrace=\{\global\let\{=\@anim@lbr
The first time, \@anim@leftbrace
saves the meaning of \{
, but the second time it just saves the meaning of \@anim@lbr
. Later, \@anim@endsanitize
does \global\let\{=\@anim@leftbrace
, restoring the wrong value.
The same happens for \\
, \}
and \%
.
You can cure the bug by doing the loop in a different way:
\documentclass{article}
\usepackage{amsmath}
\usepackage{animate}
\makeatletter
\def\@anim@@sanitize#1\@nil{%
\@tfor\next:=#1\do{%
\expandafter\xdef\csname @anim@\number\expandafter`\next\endcsname{%
\the\catcode\expandafter`\next
}%
\global\catcode\expandafter`\next=12
}
\global\catcode`\#=12
\global\let\@anim@newline=\\\global\let\\=\@anim@bksl
\global\let\@anim@leftbrace=\{\global\let\{=\@anim@lbr
\global\let\@anim@rightbrace=\}\global\let\}=\@anim@rbr
\global\let\@anim@percent=\%\global\let\%=\@anim@per
}
\def\@anim@@endsanitize#1\@nil{%
\@tfor\next:=#1\do{%
\global\catcode\expandafter`\next=\csname @anim@\number\expandafter`\next\endcsname
}
\global\let\%=\@anim@percent%
\global\let\}=\@anim@rightbrace%
\global\let\{=\@anim@leftbrace%
\global\let\\=\@anim@newline%
\global\catcode`\#=6%
}
\makeatother
\begin{document}
\animategraphics[scale=0.5]{6}{whatever}{}{}
\[\left\{\begin{array}{l}y=2x\\y=x+1\end{array}\right.\]
\end{document}
This should be brought to the attention of the package maintainer as soon as possible.
UPDATE
As of version 2014/08/06
of animate
, the problem has been fixed along with the other bug noted in comments.
2014/08/06
ofanimate
, the problem seems to be solved.