0

我正在尝试突出显示一组单词,例如word1word2使用 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)
4

1 回答 1

0

You have to set the highlight color with argument shading.color:

color1 <- fp_text(shading.color = "yellow")
于 2019-02-13T07:50:09.407 回答