summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/examples/animations/inlinemovie.tex
blob: 5f1eff9d4bb10a72a1f5c20e84d738c32968bbeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
\documentclass{article}
\usepackage[inline]{asymptote}
%\usepackage{asymptote}
\usepackage{animate}
\begin{document}

Here is an inline PDF movie, generated with the commands
\begin{verbatim}
pdflatex inlinemovie
asy inlinemovie-*.asy
pdflatex inlinemovie
\end{verbatim}
or equivalently,
\begin{verbatim}
latexmk -pdf inlinemovie
\end{verbatim}

\begin{center}
\begin{asy}
import animate;
animation A=animation("movie1");
real h=2pi/10;

picture pic;
unitsize(pic,2cm);
for(int i=0; i < 10; ++i) {
  draw(pic,expi(i*h)--expi((i+1)*h));
  A.add(pic);
}
label(A.pdf("controls",delay=50,keep=!settings.inlinetex));
\end{asy}
%Uncomment the following line when not using the [inline] package option:
%\ASYanimategraphics[controls]{50}{movie1}{}{}
\end{center}

And here is another one, clickable but without the control panel:
\begin{center}
\begin{asy}
import animate;
animation A=animation("movie2");
real h=2pi/10;

picture pic;
unitsize(pic,2cm);
for(int i=0; i < 10; ++i) {
  draw(pic,expi(-i*h)--expi(-(i+1)*h),red);
  A.add(pic);
}
label(A.pdf(keep=!settings.inlinetex));
\end{asy}
%Uncomment the following line when not using the [inline] package option:
%\ASYanimategraphics[controls]{10}{movie2}{}{}
\end{center}

\end{document}