将Rmarkdown中的水平规则的样式更改为Microsoft Word

时间:2018-05-10 08:20:10

标签: r r-markdown

使用***在Rmarkdown文档中包含水平规则时,使用.docx输出,规则是黑色实线。

我想知道如何自动更改所有水平规则的水平规则(颜色,虚线等)的样式,类似于如何通过调整Microsoft Word中的“样式”来更改字体样式({{3 }})。

1 个答案:

答案 0 :(得分:1)

我不确定如何直接完成此操作。

对于某种有点hacky的解决方法,您可以自定义您目前使用的具有底部边框的标题级别的样式。

在这个例子中,我在my_style.docx中为Heading 8自定义了一个红色条纹底边框。

.Rmd文件:

---
output: 
  word_document:
    reference_docx: my_style.docx
---

Here is a horizontal line

***

Here is a level 8 heading which has a style in my_style.docx with a bottom border

######## 

呈现Word文档:

enter image description here

用于选择样式更改的Word样式窗口选项:

enter image description here

相关问题