r - bookdown to html_document2 中的数字列表

标签 r reference r-markdown pandoc bookdown

是否有可能在我的 Rmd 文档中包含数字列表?
现在我的 yaml-header 看起来像这样,但我不知道如何包含数字列表。\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
---

在正文文件中,我想到了这样的事情来生成数字列表。
{r figure1, fig.cap="Sine Plot", fig.align='center'}
x = seq(1,10, by = 0.1)
y = sin(x)
plot(x, y, main = "title")


见图@ref(fig:figure1)

\listoffigures

最佳答案

原则上您可以添加 lof: yes到您的 YAML header 。然而,根据pandoc manual ,这些参数仅支持 LaTeX 和 ConTeXt 后端。因此,这适用于 bookdown::pdf_document2 ,它使用 LaTeX,但不适用于 bookdown::html_docuemnt2 .

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

关于r - bookdown to html_document2 中的数字列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58934424/

相关文章:

python - 在 Rstudio 中安装 Python 模块

c++ - 为什么非常量引用参数可以绑定(bind)到临时对象?

html - "Undefined"RMarkdown 选项卡集中包含选项卡?

css - R Markdown : nice way to show a long text in a html table

r - 从 `sf` 对象中提取没有几何形状的数据,例如 `sp@data`

r - 在 R 中生成一个弹出框

rust - 难以管理引用和取消引用的组合

在函数外部更改静态变量的值

error-handling - 仅在 rmarkdown 中运行 rchunk 时,stargazer 错误 "length of NULL cannot be changed"

R Oracle 通过 DBI::dbDriver ("Oracle"连接)抛出错误