我正在使用 .Rmd 文档并渲染为 html_document。我的表格的前缀为“Table”,但是,我希望它是我的母语。就像在 pdf_document 中一样,我想将报告的语言设置为葡萄牙语,如下所示:
---
title: "Code"
author: "Guilherme"
date: "May 9, 2017"
lang: "pt-br"
output:
html_document: default
---
有办法做到这一点吗?
最佳答案
如果我编织:
---
title: "Code"
author: "Guilherme"
date: "May 9, 2017"
lang: "pt-br"
output:
bookdown::html_document2
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r cars}
library(knitr)
kable(mtcars[1:5,2:3], caption = "Azul")
```
在同一目录中包含一个名为 _bookdown.yml
的文件,其中包含以下内容:
language:
label:
fig: "Figura "
tab: "Tabela "
它正确地生成标签,正如 @Sébastian 在评论中建议的那样
关于r - 如何通过 r markdown html 在 html 文档中设置语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43871475/