如何解决为什么 Rmarkdown 的 officedown 不输出格式化文本?
我是使用 Rmarkdown 和官员/officedown 的新手,所以也许有一个简单的解决方法,但我不知所措。我正在尝试使用 officedown/officer 为报告创建 Word 文档,以便我可以更好地控制文本等的外观。我一直用自己的代码得到奇怪的结果,所以基本上只是从 https://ardata-fr.github.io/officeverse/formatting-properties.html 复制/粘贴一个非常简单的示例(第 7.1 节中的示例)。下面是我输入到 Rmarkdown 的代码(在需要的地方添加了适当的 --- 和 ``` {r})。再往下是我收到的结果减去我不关心的典型警告。”
title: "Untitled"
author: "author"
date: "7/21/2021"
output: officedown::rdocx_document
knitr::opts_chunk$set(echo = TRUE)
library("officedown")
library("officer")
library("dplyr")
properties1 <- fp_text(color = "#006699",bold = TRUE,font.size = 50)
properties2 <- fp_text(color = "#C32900",font.size = 50)
ftext1 <- ftext("hello ",properties1)
ftext2 <- ftext("World",properties2)
paragraph <- fpar(ftext1,ftext2)
read_docx() %>%
body_add_fpar(paragraph) %>% print()
以下是我在word文档中收到的输出,不是示例中格式正确的文本。这与我使用自己的代码时得到的非常相似。
知道如何使它看起来正确吗?谢谢!
## rdocx document with 2 element(s)
##
## * styles:
## normal heading 1 heading 2
## "paragraph" "paragraph" "paragraph"
## heading 3 Default Paragraph Font normal Table
## "paragraph" "character" "table"
## No List strong centered
## "numbering" "character" "paragraph"
## table_template Light List Accent 2 Titre 1 Car
## "table" "table" "character"
## Titre 2 Car Titre 3 Car Image Caption
## "character" "character" "paragraph"
## Table Caption Table Professional toc 1
## "paragraph" "table" "paragraph"
## toc 2 Balloon Text Texte de bulles Car
## "paragraph" "paragraph" "character"
## reference_id graphic title table title
## "character" "paragraph" "paragraph"
##
## * Content at cursor location:
## level num_id text style_name content_type
## 1 NA NA hello World NA paragraph
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。