2

I'm attempting to adjust the font size of figure captions rendered below a map/chart in PowerPoint (PPT).

The examples below have been produced using chunk options such as r world_map, fig.cap="[A LINK](./PATH/TO/*.html)" and r car_chart, fig.cap="[ANOTHER LINK](./PATH/TO/*.html)" respectively.

Slide with map and caption

library(tmap)

data("World")

m <- tm_shape(World, group = "World") +
        tm_borders()
m

slide with map and caption

Slide with chart and caption

library(ggplot2)

data("cars")

p <- ggplot(cars, aes(x = speed, y = dist)) +
    geom_point()
p

slide with chart and caption

Solutions have been provided by @MartinSchmelzer for html and Word outputs, namely CSS syntax and edits to the Word template.
The CSS approach is not supported for PPT outputs, and editing the PPT template (*.potx) is not an option either because, unlike Word, PPT does not explicitly support figure captions. The figure caption in PowerPoint is simply a text box placed next to a figure and grouped with it.

Given this, I looked for alternative solutions in the OfficeR package by @DavidGohel. The example provided in the documentation uses a simple print command to add text below a chart. In PPT, this would render in the next slide, not below the chart.
This OfficeR tutorial refers to "Picture with Caption" as a two columns slide (alike the PPT template), not as a text rendered below the map/chart.

As yet, neither I found a solution to format fig.cap in PPT, nor I found another option to render a string of text below an chart/map in PPT. Does anyone know hoe to address this?

IvanP
  • 129
  • 8
  • figure caption is not a real concept with powerpoint, you can use https://ardata-fr.github.io/officeverse/officer-for-powerpoint.html#single-paragraph – David Gohel Apr 21 '21 at 09:17
  • Hi @DavidGohel! Yes, I figured that PPT doesn't have such a feature. Would you be able to provide a workable example to add and format a string of text *below* a chart/image using `officeR`, `officeverse`, `officedown` or any other of yours? That would be very much appreciated! – IvanP Apr 21 '21 at 09:35
  • The link I provided contains an example of formatted string. You have to choose a location that fit your need on the slide with ph_location_type or another ph_location as demo here: https://ardata-fr.github.io/officeverse/officer-for-powerpoint.html#content-location – David Gohel Apr 21 '21 at 09:54

0 Answers0