body_add_blocks

0th

Percentile

add a list of blocks into a document

add a list of blocks produced by block_list into into an rdocx object

Usage
body_add_blocks(x, blocks, pos = "after")
Arguments
x

an rdocx object

blocks

set of blocks to be used as footnote content returned by function block_list.

pos

where to add the new element relative to the cursor, one of "after", "before", "on".

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

img.file <- file.path( R.home("doc"), "html", "logo.jpg" )
bl <- block_list(
  fpar(ftext("hello", shortcuts$fp_bold())),
  fpar(
    ftext("hello", shortcuts$fp_bold()),
    stext(" world", "strong"),
    external_img(src = img.file, height = 1.06, width = 1.39)
  )
)

x <- read_docx() %>%
  body_add_blocks( blocks = bl ) %>%
  print(target = tempfile(fileext = ".docx"))
# }
Documentation reproduced from package officer, version 0.3.5, License: GPL-3

Community examples

Looks like there are no examples yet.