ph_add_par

0th

Percentile

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.

Usage
ph_add_par(x, type = "body", id = 1, id_chr = NULL, level = 1,
  ph_label = NULL)
Arguments
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 = 1 and id = 2 for the second one. Values can be read from slide_summary.

id_chr

deprecated.

level

paragraph level

ph_label

label associated to the placeholder. Use column ph_label of result returned by slide_summary.

Usage

If your goal is to add formatted text in a new shape, use ph_with with a block_list instead of this function.

Aliases
  • ph_add_par
Examples
# NOT RUN {
library(magrittr)

fileout <- tempfile(fileext = ".pptx")
default_text <- fp_text(font.size = 0, bold = TRUE, color = "red")

doc <- read_pptx() %>%
  add_slide(layout = "Title and Content", master = "Office Theme") %>%
  ph_with("A text", location = ph_location_type(type = "body")) %>%
  ph_add_par(level = 2) %>%
  ph_add_text(str = "and another, ", style = default_text ) %>%
  ph_add_par(level = 3) %>%
  ph_add_text(str = "and another!",
              style = update(default_text, color = "blue"))

print(doc, target = fileout)
# }
Documentation reproduced from package officer, version 0.3.6, License: GPL-3

Community examples

Looks like there are no examples yet.