如何在rmarkdown(bookdown)到docx的fig.cap中打断一行?

时间:2020-10-06 12:30:59

标签: r r-markdown docx bookdown

我想有一个图形标题,在它的正下方(下一行),还有另一段文字。我该怎么办?

我设法使用word_document输出格式:

---
title: "Untitled"
author: "Guilherme"
date: "10/6/2020"
output: word_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{r, fig.cap="Título da figura \\\n Fonte: Autor"}
plot(1:10,1:10)
```

enter image description here

但是它不适用于bookdown::word_document2

---
title: "test-report.Rmd"
author: "Guilherme"
date: "9 de maio de 2018"
output: 
  bookdown::word_document2:
    fig_caption: TRUE
    toc: TRUE
    toc_depth: 4
    number_sections: FALSE
---

```{r setup, include=FALSE}
library(knitr)
opts_chunk$set(
    fig.path = "graficos/",
    dpi = 100,
    comment = NA,
    warning = FALSE,
    cache = FALSE,
    echo = FALSE)
```

## Heading 2

And I have this next subsection

```{r, fig.cap="Título da figura \\\n Fonte: Autor"}
plot(1:10,1:10)
```

enter image description here

0 个答案:

没有答案