Internationalization R knitr Figured Signature

I want to create a latex document with knitr, but it does not allow me to change the shape label in my language. Code:

```{r rstudio, echo = FALSE,  fig.cap = "RStudio IDE", fig.margin = T}
plot(pressure)
```

This generates:

enter image description here

However, I want the caption to read Figura: (portuguese) instead of a picture :. I added a variable lang: pt-brthat corrects when I call it with \@ref(fig:rstudio), but does not fix the picture label.

  • How to change label label in Rmarkdown?
+1
source share
1 answer

In fact, you can include LaTeX code directly in the Rmd file to change the settings.

, , "" "", \figurename \contentsname. , \renewcommand :

\renewcommand{\figurename}{Fig.}
\renewcommand{\contentsname}{Table of Contents}

" " ( ), LaTeX article, book report:

  • \abstractname [only article, report]:
  • \appendixname:
  • \bibname [only book, report]:
  • \chaptername [only book, report]: Chapter
  • \contentsname:
  • \figurename:
  • \indexname:
  • \listfigurename:
  • \listtablename:
  • \partname:
  • \refname [only article]:
  • \tablename:

MWE :

---
output:
  pdf_document: default
---
\renewcommand{\figurename}{YOUR LABEL}
\renewcommand{\tablename}{TABLE LABEL}

```{r Table, echo =FALSE}
knitr::kable(iris[1:5,], caption = "A table")
```

```{r pressure, echo=FALSE, fig.cap="Test Caption"}
plot(pressure)
```

bookdown RMarkdown knitr. , , .

0

All Articles