I am using rmarkdown to generate both HTML and pdf file. In my .Rmd file, I included a GIF like this:
![](www/script.gif)
When I knit the to HTML it works fine.
rmarkdown::render(documentation_file, encoding="UTF-8")
However, when I try to knit to PDF using
rmarkdown::render(documentation_file, rmarkdown::pdf_document(latex_engine = "xelatex"), encoding="UTF-8")
I have the following problem:
! LaTeX Error: Unknown graphics extension: .gif.
I do not mind to lose the animation of the gif, a static version of it is perfectly fine.
Is there any easy way to include/convert on the fly the GIF to my PDF document?