4

Is there any possibility to include a list of figures in my Rmd-Document? Right now my yaml-header looks like this, but I have no clue of how to include a list of figures. The \figureslift doesn't seem to work.

---
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
---

And in the body file I thought about something like this to produce a list of figures.

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

See figure @ref(fig:figure1)

\listoffigures

Lenn
  • 1,283
  • 7
  • 20

1 Answers1

6

In principle you could add lof: yes to your YAML header. However, according to the pandoc manual, these parameters are only supported for the LaTeX and ConTeXt backends. Consequently, this would work for bookdown::pdf_document2, which uses LaTeX, but not for bookdown::html_docuemnt2.

There is a request in pandoc's issue tracker to add LoF/LoT/... support for other backends as well. However, it seems nobody has taken that (rather complex) task up.

Ralf Stubner
  • 26,263
  • 3
  • 40
  • 75