[animate.sty] simple example

View: New views
5 Messages — Rating Filter:   Alert me  

[animate.sty] simple example

by Patrick Drechsler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I just discovered the new version of animate.sty[1]. Has anybody used
this successfully with beamer and tikz?

If so, could you be so kind to share a very minimal usage example?

Regards

Patrick

Footnotes:
[1] http://tug.ctan.org/tex-archive/macros/latex/contrib/animate/

--
Admiration, n. Our polite recognition of another's resemblance to
ourselves.                                    -- Ambrose Bierce


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Latex-beamer-users mailing list
Latex-beamer-users@...
https://lists.sourceforge.net/lists/listinfo/latex-beamer-users

Re: [animate.sty] simple example

by Kjell Magne Fauske :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Feb 9, 2008 8:42 PM, Patrick Drechsler <patrick@...> wrote:

> Hi,
>
> I just discovered the new version of animate.sty[1]. Has anybody used
> this successfully with beamer and tikz?
>
> If so, could you be so kind to share a very minimal usage example?
>
> Regards
>
> Patrick
>

You can find an example by Brian S. Marks here:
http://www.fauskes.net/pgftikzexamples/animated-distributions/

The example uses animateinline environment. For most uses I find it
more convenient to generate the animation as a standalone PDF where
each page is a frame in the animation. Here is a simple example:

setanim.tex
-----------------

\documentclass{beamer}
\usepackage{tikz}

%%%<
\usepackage{verbatim}
\usepackage[active,floats,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}%
%%%>

\begin{document}
\def\boundb{(-2,2) rectangle (4,-2)}
\foreach \xb in {0,0.1,...,2.1}{
    \def\setA{(0,0) circle (1)}
    \def\setB{(\xb,0) circle (1)}

    \begin{tikzpicture}
    \draw \boundb;
    % intersection
    \begin{scope}
    \clip \setA;
    \fill[black!20] \setB;
    \end{scope}
     \begin{scope}[even odd rule]% first circle without the second
        \clip \setB \boundb;
        \fill[red!20] \setA;
     \end{scope}
    \begin{scope}[even odd rule]% first circle without the second
        \clip \setA \boundb;
        \fill[blue!20] \setB;
     \end{scope}
    \draw \setA;
    \draw \setB;
    \node at (-1,0) [left] {$A$};
    \node at (\xb+1,0) [right] {$B$};

    \node at (4,2) [below left] {$A\cap B$};

    \end{tikzpicture}
}
\end{document}

-------
The above code creates a simple animation. Note the use of the
preview[1] package to crop the pages. To include the animation in a
Beamer presentation I use the following code:

[1] http://www.ctan.org/tex-archive/help/Catalogue/entries/preview.html

------

\documentclass{beamer}
\usepackage{animate}
\usepackage{tikz}
\begin{document}

\begin{frame}
\frametitle{Sets}
\begin{center}
\animategraphics[palindrome]{12}{setanim}{}{}
\end{center}
\end{frame}
\end{document}

--------

Note that I use pdflatex to create the above files.

Hope this helps!

- Kjell Magne Fauske

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Latex-beamer-users mailing list
Latex-beamer-users@...
https://lists.sourceforge.net/lists/listinfo/latex-beamer-users

Re: [animate.sty] simple example

by Herbert Voss-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Patrick Drechsler schrieb:

> I just discovered the new version of animate.sty[1]. Has anybody used
> this successfully with beamer and tikz?
>
> If so, could you be so kind to share a very minimal usage example?
>

sometimes it is easier using the transduration feature of
beamer.

http://perce.de/temp/Demo.pdf

use the fullscreen mode (Ctrl-L) and then hit enter and wait
and look ...

The source:
http://perce.de/temp/Demo.tex


Herbert

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Latex-beamer-users mailing list
Latex-beamer-users@...
https://lists.sourceforge.net/lists/listinfo/latex-beamer-users

Re: [animate.sty] simple example

by Patrick Drechsler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

"Kjell Magne Fauske" <kjellmf@...> writes:

> On Feb 9, 2008 8:42 PM, Patrick Drechsler <patrick@...> wrote:
>> I just discovered the new version of animate.sty[1]. Has anybody used
>> this successfully with beamer and tikz?

> You can find an example by Brian S. Marks here:
> http://www.fauskes.net/pgftikzexamples/animated-distributions/
>
> The example uses animateinline environment. For most uses I find it
> more convenient to generate the animation as a standalone PDF where
> each page is a frame in the animation. Here is a simple example:

[snipped nice example for creating animation]

> The above code creates a simple animation. Note the use of the
> preview[1] package to crop the pages.

[snipped nice example for including animation]

Thank you very much for sharing this code, Kjell!

This is what I was looking for!

Cheers,

Patrick
--
Die wahren Lebenskünstler sind bereits glücklich, wenn sie nicht
unglücklich sind. (Jean Anouilh)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Latex-beamer-users mailing list
Latex-beamer-users@...
https://lists.sourceforge.net/lists/listinfo/latex-beamer-users

Re: [animate.sty] simple example

by Patrick Drechsler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Herbert Voss <Herbert.Voss@...> writes:

> Patrick Drechsler schrieb:
>
>> I just discovered the new version of animate.sty[1]. Has anybody used
>> this successfully with beamer and tikz?
>>
>> If so, could you be so kind to share a very minimal usage example?
>>

> sometimes it is easier using the transduration feature of
> beamer.
> http://perce.de/temp/Demo.tex

,----
| \begin{pspicture}(-0.5,-5)(15,5)
| \newpsstyle{ball}{fillstyle=ccslope,slopebegin=white,slopeend=blue,slopecenter={0.6 0.6}}
| \def\nFrames{20}
|   \psaxes[linewidth=0.5pt]{->}(0,0)(0,-5)(15,5)
|   \transduration<2-20>{0.2}%
`----

Cool! Thanks for pointing out these feature!

I would have never thought about using this feature for an animation.

Cheers,

Patrick
--
The shortest unit of time in the universe is the New York Second,
defined as the period of time between the traffic lights turning green
and the cab behind you honking. (Terry Pratchett 'Lords and Ladies')

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Latex-beamer-users mailing list
Latex-beamer-users@...
https://lists.sourceforge.net/lists/listinfo/latex-beamer-users