library(officer)
fp_bold <- fp_text_lite(bold = TRUE)
fp_refnote <- fp_text_lite(vertical.align = "superscript")
img.file <- file.path(R.home("doc"), "html", "logo.jpg")
bl <- block_list(
fpar(ftext("hello", fp_bold)),
fpar(
ftext("hello world", fp_bold),
external_img(src = img.file, height = 1.06, width = 1.39)
)
)
a_par <- fpar(
"this paragraph contains a note ",
run_footnote(x = bl, prop = fp_refnote),
"."
)
doc <- read_docx()
doc <- body_add_fpar(doc, value = a_par, style = "Normal")
print(doc, target = tempfile(fileext = ".docx"))
Run the code above in your browser using DataLab