Render a pptx using R Markdown with a header and a figure output in a single slide

I'm trying to render a powerpoint presentation using r markdown. Everything works fine, however, I can't seem to generate a slide with header + a figure output (e.g. either a ggplot chart or kable output) + some texts.

I have tried the following, but the generated powerpoint seems to be separating the header into a separate slides:


:::::::::::::: {.columns}
::: {.column}

### Some header

```{r dpi = 200, context="server"}

# Some ggplot output
(<< Excluded the closing r chunk as I'm getting some formatting issues here.)

:::
::: {.column}
Some additional texts to be displayed in the slides
:::
::::::::::::::

Does anyone have a solution to this? I've tried to format the slide master powerpoint template (reduce font size etc...) but it still doesn't seem to work.

Hello,

I used with great success the ReporteRs package. It can read a preformatted Master PPTX file and add pages/content/text/tables/charts to it. However the package is now discontinued due to Java dependency and replaced with a new package, which you can try as well. Or install the old ReporteRs package, I can only recommend it

I wish the R community had more mature PPTX support <- still the defacto standard in business reporting

Try taking a look at some of the gists and code in this thread. None of the ones directly in the thread have images, per se, but they all work with headers and two columns of output which, presumably, could include a figure on one of the sides:

Thanks for your suggestion. However, I would prefer to stick not generating pptx slides via r markdown instead of using the ReporteRs package.

Thanks for the link! Managed to figure out a way to get my desired layout in pptx.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.