When I put more than nine objects on a slide, the newest objects default to vertical (this happens with text, not sure about plots or images). My company does have a habit of putting too much information on the slide, but they want to keep the same format, if at all possible. I wasn't sure if the ReporteRs package had an option to set the maximum number of objects or maybe this is an issue with one of the dependencies to run the package. I will attach a screenshot and the code. I created a blank document titled Presentation1.pptx and put that in my working directory.
Code:
library("ReporteRs")
pres <- pptx(template = "Presentation1.pptx")
pres <- addSlide(pres, slide.layout = 'Blank')
pres <- addParagraph(par.properties = parProperties(),
doc = pres, text.align = "left", value = pot("SOME TEXT",
textBold(color = "black", font.size = 36, font.family = "Arial")),
offx = 0.5, offy = 0, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 1),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 21, font.family = "Arial")),
offx = 0.25, offy = 1, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 1.5, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 2, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 1),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 21, font.family = "Arial")),
offx = 0.25, offy = 2.5, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 3, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 3.5, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 4, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 4.5, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Some Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 0.75, offy = 5, width = 0, height = 1)
pres <-addParagraph(par.properties = parProperties(list.style = "unordered", level = 2),
doc = pres, text.align = "left", value = pot("Copyright Text",
textBoldItalic(color = "black", font.size = 17, font.family = "Arial")),
offx = 3, offy = 7, width = 0, height = 1)
writeDoc(pres, file = "pres.pptx")
First, move to package
officer
if possible and read that page: https://davidgohel.github.io/officer/articles/powerpoint.html#append-text-sequentially-in-a-shape.In you script, you are using widths set to 0 and a new shape for each new paragraph.
text.align
is not an argument of addParagraph. So let' simplify: