Since there's no working solution to my prior question, I tried to just place a citation exactly under a figure. This works until the figure experiences an automatic page-break. Then, the citation is placed where I meant to place the figure, but the figure itself appears on the next page and both get separated. Does anyone know the remedy?
Here is my code and a screenshot:
---
title: "Test"
output:
pdf_document: default
references:
- id: hawking_thermodynamics_1983
author:
- family: Hawking
given: S. W.
- family: Page
given: Don. N.
publisher: Communications in Mathematical Physics
title: Thermodynamics of Black Holes in Anti-de Sitter Space.
volume: 87
type: article-journal
issued:
year: 1983
header-includes:
- \usepackage{lipsum} # just used for producing example text in document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Headline
\lipsum[1-5]
\begin{figure}[h]
\centering
\includegraphics[width=10cm]{example.png}
\caption{Example figure}\label{fig1}
\end{figure}
[source: @hawking_thermodynamics_1983]
\lipsum[1-4]
## Bibliography
EDIT: This is for a *.bib version:
@article{hawking_thermodynamics_1983,
title = {Thermodynamics of black holes in anti-de Sitter space},
volume = {87},
pages = {577--588},
number = {4},
journaltitle = {Communications in Mathematical Physics},
author = {Hawking, S. W. and Page, Don N.},
date = {1983-12},
}