davidgohel / ReporteRs

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

Level in parProperties not working / No second level bullet #188

Closed Jannickz closed 7 years ago

Jannickz commented 7 years ago

Hi,

I'm working on creating a paragraph that can have multi-levels of bullet points, but the level argument in parProperties() doesn't seem to work. No matter what number I assigned to it, the outcome only give me the first level bullet.

The following is my code:

ppt <- addParagraph( ppt , value = 'first line',
                     par.properties = parProperties(list.style = 'unordered', level = 1))
ppt <- addParagraph( ppt , value = 'second line',append=T,
                     par.properties = parProperties(list.style = 'unordered', level = 2))
ppt <- addParagraph( ppt , value = 'third line', append=T,
                     par.properties = parProperties(list.style = 'unordered', level = 2))

Many thanks!!! Jannick

davidgohel commented 7 years ago

Hi

par.properties is used only when value is a pot.

library(ReporteRs)
pptx.file = "presentation_example.pptx"

# Create a new document
ppt = pptx( title = "title" )
ppt = addSlide( ppt, slide.layout = "Two Content" )
ppt <- addParagraph( ppt , value = pot('first line'),
                     par.properties = parProperties(list.style = 'unordered', level = 1))
ppt <- addParagraph( ppt , value = pot('second line'),append=T,
                     par.properties = parProperties(list.style = 'unordered', level = 2))
ppt <- addParagraph( ppt , value = 'third line', append=T,
                     par.properties = parProperties(list.style = 'ordered', level = 4))
writeDoc( ppt, file = pptx.file )

I have updated the doc of addParagraph that was not mentioning it.