是否有可能在我的 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/