append paragraph
append a new empty paragraph in a placeholder. The function let you add a new empty paragraph to an existing content in an exiisting shape, existing paragraphs will be preserved.
ph_add_par(x, type = "body", id = 1, id_chr = NULL, level = 1, ph_label = NULL)
x |
an rpptx object |
type |
placeholder type |
id |
placeholder index (integer) for a duplicated type. This is to be used when a placeholder
type is not unique in the layout of the current slide, e.g. two placeholders with type 'body'. To
add onto the first, use |
id_chr |
deprecated. |
level |
paragraph level |
ph_label |
label associated to the placeholder. Use column
|
If your goal is to add formatted text in a new shape, use ph_with
with a block_list instead of this function.
This function will be deprecated in a next release because it is not
efficient and make users write complex code. Use instead fpar() to build
formatted paragraphs.
fileout <- tempfile(fileext = ".pptx")
default_text <- fp_text(font.size = 0, bold = TRUE, color = "red")
doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- ph_with(doc, "A text", location = ph_location_type(type = "body"))
doc <- ph_add_par(doc, level = 2)
doc <- ph_add_text(doc, str = "and another, ", style = default_text )
doc <- ph_add_par(doc, level = 3)
doc <- ph_add_text(doc, str = "and another!",
style = update(default_text, color = "blue"))
print(doc, target = fileout)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.