Closed shirdekel closed 3 months ago
First thing, let's clarify the context here.
This is knitr repo and knitr is not responsible for PPTX output. It will only produce Markdown based on the cells results.
Your example is also using Quarto here which could behave differently, and add a layer of processing after knitr.
This is the Markdown content which is produced by knitr in Quarto context.
---
title: "Minimal example"
format: pptx
keep-md: true
---
::: {.cell}
:::
::: {.cell}
::: {.cell-output-display}
![](test_files/figure-pptx/unnamed-chunk-2-1.gif)
:::
:::
::: {.cell}
::: {.cell-output-display}
![](test.mp4)
:::
:::
it looks fine to me.
but not in powerpoint (the default gif output shows up as a static photo and the mp4 comes out with "The picture can't be displayed").
Gif is displaying correctly for me in the output.
Regarding Video, it is currently not supported by Pandoc itself:
So you'll need to add video manually in the PPTX file.
I also tried setting the gif chunk to fig.show: 'animate' and animation.hook: 'gifski'
This is also working on my side with latest versions of the tools.
---
title: "Minimal example"
format: pptx
keep-md: true
---
```{r}
#| fig-show: animate
#| animation-hook: gifski
library(ggplot2)
library(gganimate)
p <- ggplot(airquality, aes(Day, Temp)) +
geom_line(size = 2, colour = "steelblue") +
transition_states(Month, 4, 1) +
shadow_mark(size = 1, colour = "grey")
## As GIF
p
So it does not seem there is any issue except the unsupported PPTX feature from Pandoc.
I have the following
qmd
file, which renders fine in html (both animation formats work), but not in powerpoint (the default gif output shows up as a static photo and the mp4 comes out with "The picture can't be displayed"). As a word doc, the GIF works, and the mp4 doesn't. I also tried setting the gif chunk tofig.show: 'animate'
andanimation.hook: 'gifski'
, and the mp4 chunk toffmpeg.format: 'mp4'
.By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.