1
votes

I want to test whether the animation works in pdf output from .Rmd file (see the figure below). I have installed the FFmpeg with brew install ffmpeg --with-libvpx on my Mac OS and sudo tlmgr install animate typed in terminal indicates that the animate package is already available for my Tex (tlmgr install: package already present: animate). However, the command listed below seems not work yet,although it works fine if I replace pdf_document with html_document. What might be the problem for this? I have pasted the error information in the final section (I have referred to a related question here: Plot animation in knitr rmarkdown).

---
title: "Example"
author: ""
header-includes:
   - \usepackage{animate}
output:
  pdf_document
---

```{r,fig.show='animate', out.width = ''}
for(i in 1:10) plot(rnorm(10))
 ```

---

output file: test.knit.md

! Missing number, treated as zero. \relax l.133 ...les/figure-latex/unnamed-chunk-1-}{1}{10}

pandoc: Error producing PDF Error: pandoc document conversion failed with error 43 Execution halted

a figure demo

1

1 Answers

1
votes

PDF doesn't support animations, except MOV apparently. The first couple of google results for 'PDF gif support' are informative, including this stackoverflow question: Is it possible to embed animated GIFs in PDFs?