【问题标题】:List of figures in bookdown to html_document2bookdown 到 html_document2 中的数字列表
【发布时间】:2019-11-19 12:42:43
【问题描述】:

有没有可能在我的 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)

\数字列表

【问题讨论】:

  • 您能否制作一个minimal reproducible example,同时显示您如何包含您的数据?
  • 我试图添加一个最小的例子:) 它实际上只是在 R 中生成图,引用它们,然后最后创建一个数字列表

标签: r reference r-markdown pandoc bookdown


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多