append fpar
append fpar (a formatted paragraph) in a placeholder
The function let you add a new formatted paragraph (fpar)
to an existing content in an exiisting shape, existing paragraphs
will be preserved.
ph_add_fpar( x, value, type = "body", id = 1, id_chr = NULL, ph_label = NULL, level = 1, par_default = TRUE )
x |
an rpptx object |
value |
fpar 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. |
ph_label |
label associated to the placeholder. Use column
|
level |
paragraph level |
par_default |
specify if the default paragraph formatting should be used. |
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.
bold_face <- shortcuts$fp_bold(font.size = 30)
bold_redface <- update(bold_face, color = "red")
fpar_ <- fpar(ftext("Hello ", prop = bold_face),
ftext("World", prop = bold_redface ),
ftext(", how are you?", prop = bold_face ) )
doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- ph_with(doc, "", location = ph_location(bg = "wheat", newlabel = "myph"))
doc <- ph_add_fpar(doc, value = fpar_, ph_label = "myph", level = 2)
print(doc, target = tempfile(fileext = ".pptx"))Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.