如何在 r markdown 和 bookdown 中的图形标题下方创建图形注释

Yab*_* Da 2 r r-markdown bookdown

我正在努力在r markdown和中的图形标题下方创建图形注释bookdown。我想要的图形注释如下所示。这个数字来自(Greenstone and Hanna 2014). 我的图实际上是一个 r情节。注释的长度应与图形宽度相同,并自动断线。有任何想法吗???

在此处输入图片说明

use*_*330 5

如果您使用的是通过 LaTeX(例如pdf_bookpdf_document)的格式,这是可能的。我不知道是否有办法用 HTML 输出来做到这一点。(但这会移动数字吗?也许数字下方的纯文本就足够了)。这个想法是输入 LaTeX 代码以自己开始和结束图形,并将注释包含在该块中。这是一个基于标准pdf_document示例的示例。

---
title: "Untitled"
output: 
  pdf_document
---

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

## Including Plots

You can also embed plots, for example:  Figure \ref{fig:pressure}.
```{=latex}
\begin{figure}[t]
```
```{r pressure, echo=FALSE}
plot(pressure)
```
```{=latex}
\caption{Air quality monitors across India. \label{fig:pressure}}
\textit{Notes:} Dots denote cities with monitoring stations
under India's National Ambient Air Monitoring Programme
(NAAMP).  Geographical data are drawn from MIT's Geodata
Repository.
\end{figure}
```

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
Run Code Online (Sandbox Code Playgroud)