我已经尝试过从标记中设置MS Word文档的样式,但我似乎没有把它写出来。我做错了什么?下面是代码
---
title: "Test Document"
author: "Moses Otieno"
date: "05/04/2021"
output:
word_document:
reference_docx: referent-doc.docx
---
```{r setup, include=FALSE}knitr::opts_chunk$set(echo =真)
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
## Test
This is the test生成的文档https://www.dropbox.com/scl/fi/mieqkcvy22eeighdjaby3/Test.docx?dl=0&rlkey=8wyrci2cg0ijyxbfdw5ks1znh
发布于 2021-04-21 16:51:24
在项目的YAML部分,您必须将referent.docx更改为"referent-doc.docx",并用引号(“”)括起来:
output:
word_document:
reference_docx: "referent-doc.docx"
# quoted with quotation marks, and here located in the same folder注意:你需要从一个由reference_doc生成的.docx文件开始(例如,使用knit按钮),以便将一些标题、文本、无花果和表格放入一个.docx中。然后从Microsoft Word中编辑样式、边距等,并将其保存到.docx文件中。
https://stackoverflow.com/questions/66946568
复制相似问题