Center ppt slide title

275 views Asked by At

Using ReporteRs package we can create power point presenation from R code. I tried to create a power point slide having a centered title.

Here the basic code I am using to create the slide:

library( ReporteRs )
mydoc = pptx( ) # try adding argument: template = 'template.pptx' here
mydoc = addSlide( mydoc, "Title and Content" )
mydoc = addTitle( mydoc, "This is a title" )
writeDoc( mydoc, "pp_simple_example.pptx" )

This creates a slide with title positioned at the left. Unfortunately addTitle don't expose any argument to format text or change its position. I looked also in the package options :

 options()[grep('ReporteRs',names(options()))] 

but without success.

1

There are 1 answers

0
agstudy On

One solution is to use a predefined template (as commented below my question) To create a template:

  1. Create a presentation
  2. Choose a template where the text is centered. You can add a dummy slide with text and choose one from the predefined themes ( Design tab)
  3. Don't forget to remove the slide. and save the presentation as basic_template.ppx

Now in the R code to use this template :

mydoc = pptx( template='basic_template.pptx') ## give the whole path here