bookdown 中的图表列表到 html_document2

Len*_*enn 4 r reference pandoc r-markdown bookdown

是否有可能在我的 Rmd 文件中包含图表列表?现在我的 yaml 标头看起来像这样,但我不知道如何包含数字列表。似乎\figureslift不起作用。

---
title: ""
author: ""
output:
  bookdown::html_document2:
    #css: styles.css
    fig_caption: yes
    theme: flatly
    toc: yes
    toc_depth: 1
bibliography: lib.bib
link-citations: yes
figurelist: yes
---
Run Code Online (Sandbox Code Playgroud)

在正文文件中,我想到了类似的方法来生成一个数字列表。

{r figure1, fig.cap="Sine Plot", fig.align='center'}
x = seq(1,10, by = 0.1)
y = sin(x)
plot(x, y, main = "title")

Run Code Online (Sandbox Code Playgroud)

参见图@ref(fig:figure1)

\数字列表

Ral*_*ner 6

原则上您可以添加lof: yes到 YAML 标头中。但是,根据pandoc 手册,这些参数仅支持 LaTeX 和 ConTeXt 后端。因此,这适用于bookdown::pdf_document2使用 LaTeX 的 ,但不适用于bookdown::html_docuemnt2.

pandoc 的问题跟踪器中请求添加对其他后端的 LoF/LoT/...支持然而,似乎没有人承担这项(相当复杂的)任务。