![animate / TikZ: Как преобразовать результат foreach в анимированный PDF](https://rvso.com/image/400383/animate%20%2F%20TikZ%3A%20%D0%9A%D0%B0%D0%BA%20%D0%BF%D1%80%D0%B5%D0%BE%D0%B1%D1%80%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D1%8C%20%D1%80%D0%B5%D0%B7%D1%83%D0%BB%D1%8C%D1%82%D0%B0%D1%82%20foreach%20%D0%B2%20%D0%B0%D0%BD%D0%B8%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%BD%D1%8B%D0%B9%20PDF.png)
Я рисую кривую из списка координат и получаю 6 отдельных страниц.
Есть ли простой способ сделать это в виде анимированной картинки в PDF-файле с помощью пакета animate-package?
\documentclass[margin=5pt, tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{intersections}
\usepackage{amsmath, amssymb}
\begin{document}
\newcommand{\List}{}% reserve name
\let\List=\empty% create list
\def\Range{0,30,60,90,120,360}
\foreach \w in \Range{%%%%%%%%%%%%%%%
\pgfmathsetmacro\Winkel{\w} %
\begin{tikzpicture}[]
\coordinate[] (M) at (0,0);
\draw[] (M) circle[radius=3];
\draw[name path=kreis] (M) circle[radius=1.4];
\draw[name path=zeiger] (M) -- (90-\Winkel:3);
% Create List of Coordinates
\makeatletter
\path[name intersections={of=kreis and zeiger, name=S}] ;
\coordinate[label=left:$S_{\w}$] (S-\w) at (S-1);
\pgfmathsetmacro\temp{"(S-\w)"}%
\ifx\empty\List{} \xdef\List{\temp}%
\else \xdef\List{\List \temp}%
\fi
\makeatother
\draw[red] plot[mark=*] coordinates{\List};
\node[anchor=north west, text width=6 cm] at (-3,-3){List: \List};
\end{tikzpicture}
}%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
решение1
С советом от @AndéC я получаю
% sub.tex
\documentclass[margin=5pt, tikz]{standalone}
\usepackage{animate}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{intersections}
\usepackage{amsmath, amssymb}
\begin{document}
\newcommand{\List}{}% reserve name
\let\List=\empty% create list
\def\Range{0,30,60,90,120,360}
\foreach \w in \Range{%%%%%%%%%%%%%%%
\pgfmathsetmacro\Winkel{\w} %
\begin{tikzpicture}[]
\useasboundingbox (-4,-4) rectangle (4,4);
\coordinate[] (M) at (0,0);
\draw[] (M) circle[radius=3];
\draw[name path=kreis] (M) circle[radius=1.4];
\draw[name path=zeiger] (M) -- (90-\Winkel:3);
% Create List of Coordinates
\makeatletter
\path[name intersections={of=kreis and zeiger, name=S}] ;
\coordinate[label=left:$S_{\w}$] (S-\w) at (S-1);
\pgfmathsetmacro\temp{"(S-\w)"}%
\ifx\empty\List{} \xdef\List{\temp}%
\else \xdef\List{\List \temp}%
\fi
\makeatother
\draw[red] plot[mark=*] coordinates{\List};
\node[anchor=north west, text width=6 cm] at (-3,-3){List: \List};
\end{tikzpicture}
}%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
% arara: pdflatex
% arara: pdflatex
% main.tex
\documentclass[tikz]{standalone}
\usepackage{animate}
\begin{document}
\animategraphics[autoplay,loop,controls]{1}{sub}{}{}
\end{document}