I was wondering how I could get my captions to appear above my figures in R Markdown.
Here is a working example:
---
title: "Practical"
output:
pdf_document:
fig_caption: yes
latex_engine: xelatex
---
```{r fig1, echo=FALSE, fig.cap="\\label{fig:fig1}Caption"}
x <- 1:10
y <- 11:20
plot(x, y)
```
The question has been asked before here, but the code suggested does not seem to work for me.