slip_in_text
From officer v0.3.15
by David Gohel
append text
append text into a paragraph of an rdocx object
Usage
slip_in_text(x, str, style = NULL, pos = "after", hyperlink = NULL)
Arguments
- x
an rdocx object
- str
text
- style
text style
- pos
where to add the new element relative to the cursor, "after" or "before".
- hyperlink
turn the text into an external hyperlink
Examples
# NOT RUN {
library(magrittr)
x <- read_docx() %>%
body_add_par("Hello ", style = "Normal") %>%
slip_in_text("world", style = "strong") %>%
slip_in_text("Message is", style = "strong", pos = "before") %>%
slip_in_text("with a link", style = "strong",
pos = "after", hyperlink = "https://davidgohel.github.io/officer/")
print(x, target = tempfile(fileext = ".docx"))
# }
Community examples
Looks like there are no examples yet.