2

Having a long figure caption in an Rmarkdown file is causing the footnote numbering to skip a number:


---
title: "Untitled"
output: pdf_document
date: "2023-02-27"
---


```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

This is a sentence with a footnote \footnote{Footnote 1}.

```{r fig1, echo=FALSE, warning=FALSE, message=FALSE,out.width="50%", fig.cap="This is a long figure caption. This is a long figure caption. This is a long figure caption. This is a long figure caption. \\protect\\footnotemark"}

plot(mtcars$mpg)
```

\footnotetext{Footnote 2}

This is a sentence with a third footnote \footnote{Footnote 3}.

This causes it to skip footnote 2:

Rmarkdown output displaying a skipped footnote number

Bottom of Rmarkdown file displaying a skipped footnote number

This does not happen with shorter figure captions. Is this a bug, or is there a way around this?

missgwolf
  • 356
  • 1
  • 11
  • 1
    I filed an issue with Rstudio/Rmarkdown (https://github.com/rstudio/rmarkdown/issues/2456) and it appears to be a known limitation with LaTeX, not an issue with Rmarkdown. There is currently no resolution. – missgwolf Mar 17 '23 at 23:33

0 Answers0