我正在尝试突出显示一组单词,例如word1
,word2
使用 R 中的官员包从导入的 word 文档中突出显示。我现在在设置单词的文本属性后被卡住了。我如何让官员突出显示颜色中的单词?
我已经使用read_docx(filename)
. 我还使用fp_text()
and设置了文本属性ftext()
。
my_doc <- read_docx(file.path(filepath,myfile))
color1 <- fp_text(color = "blue", font.size = 10, bold = FALSE,
italic = FALSE, underlined = FALSE, font.family = "Arial",
vertical.align = "baseline", shading.color = "transparent")
ftext("word1", color1)
color2 <- fp_text(color = "red", font.size = 10, bold = FALSE,
italic = FALSE, underlined = FALSE, font.family = "Arial",
vertical.align = "baseline", shading.color = "transparent")
ftext("word2", color1)