Exporting animation created with animate package











up vote
16
down vote

favorite
7













  • Consider the following minimal working example.

  • It's great to have an animation in pdf format.

  • But sometimes it would be good to be able to export it into an animated gif or something else (swf, video file, svg?).

  • How do I achieve this?

  • Note: I often have animations together with pgfplots.




documentclass{article}

usepackage{animate}

usepackage[active,tightpage]{preview}
PreviewEnvironment{animateinline}

begin{document}

begin{center}
fboxsep1mm
begin{animateinline}[autoplay,loop]{2}
a
newframe
b
newframe
c
end{animateinline}
end{center}

end{document}


Remark



The animation is not visible in all PDF viewers. It surely works with a current Adobe Reader.










share|improve this question




















  • 1




    See my answer that can produce many output format in one click.
    – kiss my armpit
    Oct 12 '13 at 15:14






  • 1




    New possibilities. See below.
    – AlexG
    Nov 30 at 11:29










  • @AlexG Great, thanks for letting me know.
    – Dr. Manuel Kuehner
    Nov 30 at 16:18















up vote
16
down vote

favorite
7













  • Consider the following minimal working example.

  • It's great to have an animation in pdf format.

  • But sometimes it would be good to be able to export it into an animated gif or something else (swf, video file, svg?).

  • How do I achieve this?

  • Note: I often have animations together with pgfplots.




documentclass{article}

usepackage{animate}

usepackage[active,tightpage]{preview}
PreviewEnvironment{animateinline}

begin{document}

begin{center}
fboxsep1mm
begin{animateinline}[autoplay,loop]{2}
a
newframe
b
newframe
c
end{animateinline}
end{center}

end{document}


Remark



The animation is not visible in all PDF viewers. It surely works with a current Adobe Reader.










share|improve this question




















  • 1




    See my answer that can produce many output format in one click.
    – kiss my armpit
    Oct 12 '13 at 15:14






  • 1




    New possibilities. See below.
    – AlexG
    Nov 30 at 11:29










  • @AlexG Great, thanks for letting me know.
    – Dr. Manuel Kuehner
    Nov 30 at 16:18













up vote
16
down vote

favorite
7









up vote
16
down vote

favorite
7






7






  • Consider the following minimal working example.

  • It's great to have an animation in pdf format.

  • But sometimes it would be good to be able to export it into an animated gif or something else (swf, video file, svg?).

  • How do I achieve this?

  • Note: I often have animations together with pgfplots.




documentclass{article}

usepackage{animate}

usepackage[active,tightpage]{preview}
PreviewEnvironment{animateinline}

begin{document}

begin{center}
fboxsep1mm
begin{animateinline}[autoplay,loop]{2}
a
newframe
b
newframe
c
end{animateinline}
end{center}

end{document}


Remark



The animation is not visible in all PDF viewers. It surely works with a current Adobe Reader.










share|improve this question
















  • Consider the following minimal working example.

  • It's great to have an animation in pdf format.

  • But sometimes it would be good to be able to export it into an animated gif or something else (swf, video file, svg?).

  • How do I achieve this?

  • Note: I often have animations together with pgfplots.




documentclass{article}

usepackage{animate}

usepackage[active,tightpage]{preview}
PreviewEnvironment{animateinline}

begin{document}

begin{center}
fboxsep1mm
begin{animateinline}[autoplay,loop]{2}
a
newframe
b
newframe
c
end{animateinline}
end{center}

end{document}


Remark



The animation is not visible in all PDF viewers. It surely works with a current Adobe Reader.







animate






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 30 at 17:55

























asked Oct 6 '13 at 14:28









Dr. Manuel Kuehner

8,89132766




8,89132766








  • 1




    See my answer that can produce many output format in one click.
    – kiss my armpit
    Oct 12 '13 at 15:14






  • 1




    New possibilities. See below.
    – AlexG
    Nov 30 at 11:29










  • @AlexG Great, thanks for letting me know.
    – Dr. Manuel Kuehner
    Nov 30 at 16:18














  • 1




    See my answer that can produce many output format in one click.
    – kiss my armpit
    Oct 12 '13 at 15:14






  • 1




    New possibilities. See below.
    – AlexG
    Nov 30 at 11:29










  • @AlexG Great, thanks for letting me know.
    – Dr. Manuel Kuehner
    Nov 30 at 16:18








1




1




See my answer that can produce many output format in one click.
– kiss my armpit
Oct 12 '13 at 15:14




See my answer that can produce many output format in one click.
– kiss my armpit
Oct 12 '13 at 15:14




1




1




New possibilities. See below.
– AlexG
Nov 30 at 11:29




New possibilities. See below.
– AlexG
Nov 30 at 11:29












@AlexG Great, thanks for letting me know.
– Dr. Manuel Kuehner
Nov 30 at 16:18




@AlexG Great, thanks for letting me know.
– Dr. Manuel Kuehner
Nov 30 at 16:18










1 Answer
1






active

oldest

votes

















up vote
15
down vote



accepted
+50










1 Animated SVG (animate [2018/11/20])




  • suitable for inclusion in Web pages (or viewed standalone, also on mobile devices)

  • freely scalable (vectorial graphics)

  • relies on M. Gieseking's dvisvgm output driver/utility (available in TeXLive and MikTeX)






  • compile with



    latex myAnim.tex % or lualatex --output-format=dvi or xelatex --no-pdf
    dvisvgm --exact --no-fonts myAnim.dvi % or myAnim.xdv




    documentclass[dvisvgm,12pt]{article}
    usepackage{animate}
    pagestyle{empty}

    begin{document}Huge
    begin{center}

    begin{animateinline}[controls,buttonsize=0.5em,autoplay,loop]{2}
    multiframe{10}{i=0+1}{
    framebox[1em]{i}
    }
    newframe
    framebox[1em]{A}
    newframe
    framebox[1em]{B}
    newframe
    framebox[1em]{C}
    newframe
    framebox[1em]{D}
    newframe
    framebox[1em]{E}
    newframe
    framebox[1em]{F}
    end{animateinline}

    end{center}
    end{document}



  • embed into HTML with the <object> tag



    <object type="image/svg+xml" data="myAnim.svg">
    <!-- fallback & search engine indexing -->
    <img src="myAnim.svg" />
    </object>


  • The Chromium Web browser and those derived from it (Chrome, Opera, ...) have by far the best rendering performance, as can be tested with the Lorenz attractor example.



2 Export to multipage PDF (animate [2018/08/22])



As of version [2018/08/22], animate has the package option export, to be used together with the standalone document class, as in:



documentclass[export]{standalone}
usepackage{animate}


or



documentclass{standalone}
usepackage[export]{animate}


Animation frames are output as individual pages of a multipage document, suitable for conversion to other file formats, such as animated GIF, using external programs, such as convert from ImageMagick.org:



convert -density 300 -delay 4 -loop 0 -alpha remove multipage.pdf animated.gif


creates an animated GIF at 100/4=25 frames per second.






share|improve this answer























  • Thanks! Is was hoping for a way that doesn't include changing the internal code of the animate package.
    – Dr. Manuel Kuehner
    Oct 8 '13 at 20:55






  • 1




    I might add some code to animate in the future that detects whether preview was loaded and which then takes the necessary actions.
    – AlexG
    Oct 16 '13 at 11:45






  • 1




    @Dr.ManuelKuehner, thank you for your kind comments!!
    – AlexG
    Mar 13 at 21:14






  • 1




    @Dr.ManuelKuehner : I updated my answer.
    – AlexG
    Aug 24 at 9:17






  • 2




    Great! I only can upvote once sadly. I will upvote some other of your answers.
    – Dr. Manuel Kuehner
    Aug 24 at 15:28











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f136666%2fexporting-animation-created-with-animate-package%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
15
down vote



accepted
+50










1 Animated SVG (animate [2018/11/20])




  • suitable for inclusion in Web pages (or viewed standalone, also on mobile devices)

  • freely scalable (vectorial graphics)

  • relies on M. Gieseking's dvisvgm output driver/utility (available in TeXLive and MikTeX)






  • compile with



    latex myAnim.tex % or lualatex --output-format=dvi or xelatex --no-pdf
    dvisvgm --exact --no-fonts myAnim.dvi % or myAnim.xdv




    documentclass[dvisvgm,12pt]{article}
    usepackage{animate}
    pagestyle{empty}

    begin{document}Huge
    begin{center}

    begin{animateinline}[controls,buttonsize=0.5em,autoplay,loop]{2}
    multiframe{10}{i=0+1}{
    framebox[1em]{i}
    }
    newframe
    framebox[1em]{A}
    newframe
    framebox[1em]{B}
    newframe
    framebox[1em]{C}
    newframe
    framebox[1em]{D}
    newframe
    framebox[1em]{E}
    newframe
    framebox[1em]{F}
    end{animateinline}

    end{center}
    end{document}



  • embed into HTML with the <object> tag



    <object type="image/svg+xml" data="myAnim.svg">
    <!-- fallback & search engine indexing -->
    <img src="myAnim.svg" />
    </object>


  • The Chromium Web browser and those derived from it (Chrome, Opera, ...) have by far the best rendering performance, as can be tested with the Lorenz attractor example.



2 Export to multipage PDF (animate [2018/08/22])



As of version [2018/08/22], animate has the package option export, to be used together with the standalone document class, as in:



documentclass[export]{standalone}
usepackage{animate}


or



documentclass{standalone}
usepackage[export]{animate}


Animation frames are output as individual pages of a multipage document, suitable for conversion to other file formats, such as animated GIF, using external programs, such as convert from ImageMagick.org:



convert -density 300 -delay 4 -loop 0 -alpha remove multipage.pdf animated.gif


creates an animated GIF at 100/4=25 frames per second.






share|improve this answer























  • Thanks! Is was hoping for a way that doesn't include changing the internal code of the animate package.
    – Dr. Manuel Kuehner
    Oct 8 '13 at 20:55






  • 1




    I might add some code to animate in the future that detects whether preview was loaded and which then takes the necessary actions.
    – AlexG
    Oct 16 '13 at 11:45






  • 1




    @Dr.ManuelKuehner, thank you for your kind comments!!
    – AlexG
    Mar 13 at 21:14






  • 1




    @Dr.ManuelKuehner : I updated my answer.
    – AlexG
    Aug 24 at 9:17






  • 2




    Great! I only can upvote once sadly. I will upvote some other of your answers.
    – Dr. Manuel Kuehner
    Aug 24 at 15:28















up vote
15
down vote



accepted
+50










1 Animated SVG (animate [2018/11/20])




  • suitable for inclusion in Web pages (or viewed standalone, also on mobile devices)

  • freely scalable (vectorial graphics)

  • relies on M. Gieseking's dvisvgm output driver/utility (available in TeXLive and MikTeX)






  • compile with



    latex myAnim.tex % or lualatex --output-format=dvi or xelatex --no-pdf
    dvisvgm --exact --no-fonts myAnim.dvi % or myAnim.xdv




    documentclass[dvisvgm,12pt]{article}
    usepackage{animate}
    pagestyle{empty}

    begin{document}Huge
    begin{center}

    begin{animateinline}[controls,buttonsize=0.5em,autoplay,loop]{2}
    multiframe{10}{i=0+1}{
    framebox[1em]{i}
    }
    newframe
    framebox[1em]{A}
    newframe
    framebox[1em]{B}
    newframe
    framebox[1em]{C}
    newframe
    framebox[1em]{D}
    newframe
    framebox[1em]{E}
    newframe
    framebox[1em]{F}
    end{animateinline}

    end{center}
    end{document}



  • embed into HTML with the <object> tag



    <object type="image/svg+xml" data="myAnim.svg">
    <!-- fallback & search engine indexing -->
    <img src="myAnim.svg" />
    </object>


  • The Chromium Web browser and those derived from it (Chrome, Opera, ...) have by far the best rendering performance, as can be tested with the Lorenz attractor example.



2 Export to multipage PDF (animate [2018/08/22])



As of version [2018/08/22], animate has the package option export, to be used together with the standalone document class, as in:



documentclass[export]{standalone}
usepackage{animate}


or



documentclass{standalone}
usepackage[export]{animate}


Animation frames are output as individual pages of a multipage document, suitable for conversion to other file formats, such as animated GIF, using external programs, such as convert from ImageMagick.org:



convert -density 300 -delay 4 -loop 0 -alpha remove multipage.pdf animated.gif


creates an animated GIF at 100/4=25 frames per second.






share|improve this answer























  • Thanks! Is was hoping for a way that doesn't include changing the internal code of the animate package.
    – Dr. Manuel Kuehner
    Oct 8 '13 at 20:55






  • 1




    I might add some code to animate in the future that detects whether preview was loaded and which then takes the necessary actions.
    – AlexG
    Oct 16 '13 at 11:45






  • 1




    @Dr.ManuelKuehner, thank you for your kind comments!!
    – AlexG
    Mar 13 at 21:14






  • 1




    @Dr.ManuelKuehner : I updated my answer.
    – AlexG
    Aug 24 at 9:17






  • 2




    Great! I only can upvote once sadly. I will upvote some other of your answers.
    – Dr. Manuel Kuehner
    Aug 24 at 15:28













up vote
15
down vote



accepted
+50







up vote
15
down vote



accepted
+50




+50




1 Animated SVG (animate [2018/11/20])




  • suitable for inclusion in Web pages (or viewed standalone, also on mobile devices)

  • freely scalable (vectorial graphics)

  • relies on M. Gieseking's dvisvgm output driver/utility (available in TeXLive and MikTeX)






  • compile with



    latex myAnim.tex % or lualatex --output-format=dvi or xelatex --no-pdf
    dvisvgm --exact --no-fonts myAnim.dvi % or myAnim.xdv




    documentclass[dvisvgm,12pt]{article}
    usepackage{animate}
    pagestyle{empty}

    begin{document}Huge
    begin{center}

    begin{animateinline}[controls,buttonsize=0.5em,autoplay,loop]{2}
    multiframe{10}{i=0+1}{
    framebox[1em]{i}
    }
    newframe
    framebox[1em]{A}
    newframe
    framebox[1em]{B}
    newframe
    framebox[1em]{C}
    newframe
    framebox[1em]{D}
    newframe
    framebox[1em]{E}
    newframe
    framebox[1em]{F}
    end{animateinline}

    end{center}
    end{document}



  • embed into HTML with the <object> tag



    <object type="image/svg+xml" data="myAnim.svg">
    <!-- fallback & search engine indexing -->
    <img src="myAnim.svg" />
    </object>


  • The Chromium Web browser and those derived from it (Chrome, Opera, ...) have by far the best rendering performance, as can be tested with the Lorenz attractor example.



2 Export to multipage PDF (animate [2018/08/22])



As of version [2018/08/22], animate has the package option export, to be used together with the standalone document class, as in:



documentclass[export]{standalone}
usepackage{animate}


or



documentclass{standalone}
usepackage[export]{animate}


Animation frames are output as individual pages of a multipage document, suitable for conversion to other file formats, such as animated GIF, using external programs, such as convert from ImageMagick.org:



convert -density 300 -delay 4 -loop 0 -alpha remove multipage.pdf animated.gif


creates an animated GIF at 100/4=25 frames per second.






share|improve this answer














1 Animated SVG (animate [2018/11/20])




  • suitable for inclusion in Web pages (or viewed standalone, also on mobile devices)

  • freely scalable (vectorial graphics)

  • relies on M. Gieseking's dvisvgm output driver/utility (available in TeXLive and MikTeX)






  • compile with



    latex myAnim.tex % or lualatex --output-format=dvi or xelatex --no-pdf
    dvisvgm --exact --no-fonts myAnim.dvi % or myAnim.xdv




    documentclass[dvisvgm,12pt]{article}
    usepackage{animate}
    pagestyle{empty}

    begin{document}Huge
    begin{center}

    begin{animateinline}[controls,buttonsize=0.5em,autoplay,loop]{2}
    multiframe{10}{i=0+1}{
    framebox[1em]{i}
    }
    newframe
    framebox[1em]{A}
    newframe
    framebox[1em]{B}
    newframe
    framebox[1em]{C}
    newframe
    framebox[1em]{D}
    newframe
    framebox[1em]{E}
    newframe
    framebox[1em]{F}
    end{animateinline}

    end{center}
    end{document}



  • embed into HTML with the <object> tag



    <object type="image/svg+xml" data="myAnim.svg">
    <!-- fallback & search engine indexing -->
    <img src="myAnim.svg" />
    </object>


  • The Chromium Web browser and those derived from it (Chrome, Opera, ...) have by far the best rendering performance, as can be tested with the Lorenz attractor example.



2 Export to multipage PDF (animate [2018/08/22])



As of version [2018/08/22], animate has the package option export, to be used together with the standalone document class, as in:



documentclass[export]{standalone}
usepackage{animate}


or



documentclass{standalone}
usepackage[export]{animate}


Animation frames are output as individual pages of a multipage document, suitable for conversion to other file formats, such as animated GIF, using external programs, such as convert from ImageMagick.org:



convert -density 300 -delay 4 -loop 0 -alpha remove multipage.pdf animated.gif


creates an animated GIF at 100/4=25 frames per second.







share|improve this answer














share|improve this answer



share|improve this answer








edited 2 days ago

























answered Oct 8 '13 at 7:10









AlexG

31.8k477141




31.8k477141












  • Thanks! Is was hoping for a way that doesn't include changing the internal code of the animate package.
    – Dr. Manuel Kuehner
    Oct 8 '13 at 20:55






  • 1




    I might add some code to animate in the future that detects whether preview was loaded and which then takes the necessary actions.
    – AlexG
    Oct 16 '13 at 11:45






  • 1




    @Dr.ManuelKuehner, thank you for your kind comments!!
    – AlexG
    Mar 13 at 21:14






  • 1




    @Dr.ManuelKuehner : I updated my answer.
    – AlexG
    Aug 24 at 9:17






  • 2




    Great! I only can upvote once sadly. I will upvote some other of your answers.
    – Dr. Manuel Kuehner
    Aug 24 at 15:28


















  • Thanks! Is was hoping for a way that doesn't include changing the internal code of the animate package.
    – Dr. Manuel Kuehner
    Oct 8 '13 at 20:55






  • 1




    I might add some code to animate in the future that detects whether preview was loaded and which then takes the necessary actions.
    – AlexG
    Oct 16 '13 at 11:45






  • 1




    @Dr.ManuelKuehner, thank you for your kind comments!!
    – AlexG
    Mar 13 at 21:14






  • 1




    @Dr.ManuelKuehner : I updated my answer.
    – AlexG
    Aug 24 at 9:17






  • 2




    Great! I only can upvote once sadly. I will upvote some other of your answers.
    – Dr. Manuel Kuehner
    Aug 24 at 15:28
















Thanks! Is was hoping for a way that doesn't include changing the internal code of the animate package.
– Dr. Manuel Kuehner
Oct 8 '13 at 20:55




Thanks! Is was hoping for a way that doesn't include changing the internal code of the animate package.
– Dr. Manuel Kuehner
Oct 8 '13 at 20:55




1




1




I might add some code to animate in the future that detects whether preview was loaded and which then takes the necessary actions.
– AlexG
Oct 16 '13 at 11:45




I might add some code to animate in the future that detects whether preview was loaded and which then takes the necessary actions.
– AlexG
Oct 16 '13 at 11:45




1




1




@Dr.ManuelKuehner, thank you for your kind comments!!
– AlexG
Mar 13 at 21:14




@Dr.ManuelKuehner, thank you for your kind comments!!
– AlexG
Mar 13 at 21:14




1




1




@Dr.ManuelKuehner : I updated my answer.
– AlexG
Aug 24 at 9:17




@Dr.ManuelKuehner : I updated my answer.
– AlexG
Aug 24 at 9:17




2




2




Great! I only can upvote once sadly. I will upvote some other of your answers.
– Dr. Manuel Kuehner
Aug 24 at 15:28




Great! I only can upvote once sadly. I will upvote some other of your answers.
– Dr. Manuel Kuehner
Aug 24 at 15:28


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f136666%2fexporting-animation-created-with-animate-package%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?