I need to reduce the space between a caption and figure in my RMarkdown PDF document. I am using bookdown
. Following the example here, I tried setting the length above and below the caption using the Latex command \setlength{}
, but to no avail. MWE:
---
output:
pdf_document: bookdown::pdf_document2
header-includes:
- \usepackage{floatrow}
- \floatsetup{capposition=top}
- \floatplacement{figure}{H}
- \captionsetup{position=above, aboveskip=0pt, belowskip=0pt}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Including Plots
\setlength{\abovecaptionskip}{-25pt plus 2pt minus 2pt}
\setlength{\belowcaptionskip}{-25pt plus 2pt minus 2pt}
```{r pressure, echo=FALSE, fig.cap = "Caption"}
plot(pressure)
```
Which yields:
Is there another way to get around this spacing issue?