ReporteRs (version 0.8.2)

addCodeBlock.pptx: Add a code block into a pptx object

Description

Add a code block into a pptx object.

Usage

# S3 method for pptx
addCodeBlock(doc, file, text, par.properties = parProperties(),
  text.properties = textProperties(color = "#A7947D"), append = FALSE, ...)

Arguments

doc

pptx object

file

file. Not used if text is provided.

text

character vector. The text to parse. Not used if file is provided.

par.properties

code block paragraph properties. An object of class parProperties

text.properties

code block text properties. An object of class textProperties

append

boolean default to FALSE. If TRUE, paragraphs will be appened in the current shape instead of beeing sent into a new shape. Paragraphs can only be appended on shape containing paragraphs (i.e. you can not add paragraphs after a FlexTable).

...

further arguments, not used.

Value

an object of class pptx.

See Also

pptx, addCodeBlock

Examples

Run this code
# NOT RUN {
#START_TAG_TEST
doc.filename = "addCodeBlock.pptx"

# set default font size to 24
options( "ReporteRs-fontsize" = 24 )

doc = pptx( title = "title" )

# add a slide with layout "Title and Content"
doc = addSlide( doc, slide.layout = "Title and Content" )

doc = addTitle( doc, "Title example 1" )
doc = addCodeBlock( doc, text = "ls -a\nwhich -a ls" )

# Write the object
writeDoc( doc, file = doc.filename )
#STOP_TAG_TEST
# }

Run the code above in your browser using DataCamp Workspace