davidgohel / ReporteRs

Note that ReporteRs has been removed from CRAN the 16th of July 2018 and is not maintained anymore. please migrate to officer.
244 stars 44 forks source link

change font.size in addTitle PPTX #156

Closed AntoineBrisacier closed 8 years ago

AntoineBrisacier commented 8 years ago

Hello David, I try to change font size of my title in a powerpoint slide using pot object. But I get the following error message : Error in .jcall(slide, "I", "addTitle", value) : method addTitle with signature ()I not found Called from: .jcall(slide, "I", "addTitle", value)_

Is there another way to proceed without changing the original template Regards Antoine

davidgohel commented 8 years ago

Hello Antoine,

Yes, there is another way, you will find below an solution using addParagraph.

KR, David

library(ggplot2)
library(magrittr)
library(ReporteRs)
gg <- ggplot(mtcars, aes(x = mpg, y = cyl, color = disp)) + geom_point()

pptx() %>%
  addSlide("Title and Content") %>%
  addParagraph(pot("pa pa pa pam", format = textBold(font.size = 20)), 
               par.properties = parProperties(), offx = 1, offy = .5, width = 11, height = 1 ) %>%
  addPlot(fun = print, x = gg, vector.graphic = TRUE, offx = 1, offy = 1.5, width = 6, height = 5) %>%
  writeDoc("antoine.pptx")