有没有办法在
officedown::rocx_document
中使用德语单词“Table”和“Figure”?
就像在 YAML lang: de
中的正常 word_document
来自 rmarkdown
一样吗?这在这里不起作用。
这是我的 YAML:
---
date: "`r Sys.Date()`"
author: "Your Name"
title: "officedown template"
output:
officedown::rdocx_document:
mapstyles:
Normal: ['First Paragraph']
---
不知道 lang 选项,但您可以像这样在 YAML 中设置用于图形和表格标题的
prefix
。 (注:还有几个选项。参见?officedown::rdocx_document
)
---
date: "`r Sys.Date()`"
author: "Your Name"
title: "officedown template"
output:
officedown::rdocx_document:
tables:
caption:
pre: 'Tabelle'
plots:
caption:
pre: 'Abbildung'
topcaption: true
---
```{r setup, include=FALSE}
library(officedown)
library(ggplot2)
```
## Figure
```{r fig.cap="economics plot", fig.id = "tsplot", fig.cap.style = "Image Caption"}
ggplot(economics, aes(date, unemploy / pop)) +
geom_line() +
theme_minimal()
```
## Table
```{r tab.cap="economics table", tab.id = "mytab", tab.cap.style = "Table Caption"}
head(economics)
```