slip_in_footnote: append a footnote

Description Usage Arguments Examples

View source: R/docx_footnotes.R

Description

append a new footnote into a paragraph of an rdocx object

Usage

1
slip_in_footnote(x, style = NULL, blocks, pos = "after")

Arguments

x

an rdocx object

style

text style to be used for the reference note

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, "after" or "before".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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_par("Hello ", style = "Normal") %>%
  slip_in_text("world", style = "strong") %>%
  slip_in_footnote(style = "reference_id", blocks = bl)

print(x, target = tempfile(fileext = ".docx"))

davidgohel/oxbase documentation built on Sept. 22, 2018, 10:35 p.m.