如何在降价促销中更改人物的标题?

and*_*har 5 markdown latex r pandoc

我目前正在用德语写一份小报告。因此,我希望将图形标题从图1更改为Abbildung 1,依此类推。

---
title: "Untitled"
author: "me"
date: '`r format(Sys.time(), "%d %B, %Y")`'
output:
  pdf_document: default
---


```{r iris, fig.cap='Iris sepal lengths'}
hist(iris$Sepal.Length)
```
Run Code Online (Sandbox Code Playgroud)

问题:如何在R Markdown中更改默认的图形标题(不确定是否真的如此调用)?

Mic*_*per 6

如果您使用英语以外的任何语言写作,您可以使用langYAML 选项更改输出 pdf 的语言选项。这将覆盖所有标题、标签、目录等。

---
output: pdf_document
lang: de
---

```{r iris, fig.cap='Iris sepal lengths'}
hist(iris$Sepal.Length)
```
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

其他语言选项包括fr(法语)、it(意大利语)等。有关更多详细信息,请参阅http://pandoc.org/MANUAL.html#language-variables


Rom*_*rik 4

按照此问题的示例,您可以定义自己的tex文件,在其中可以更改图形标题默认值。

标头.tex:

\usepackage{caption}
\captionsetup[figure]{name=Abbildung}
Run Code Online (Sandbox Code Playgroud)

这是主要的 .Rmd 文件:

---
title: "Untitled"
author: "me"
date: '`r format(Sys.time(), "%d %B, %Y")`'
output: 
  pdf_document:
    includes:
      in_header: header.tex
---


```{r iris, fig.cap='Iris sepal lengths'}
hist(iris$Sepal.Length)
```
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述