However, how do I cross-reference a image I inserted in a Rmd? e.g. with ![Caption](/path/to/file)
I tried adding a labe like this ![Caption](/path/to/file){#label} but it does not recognise it if I try to cross-reference it in text like this \@ref(label)
Trick is to have (#fig:label) in the caption, as explained in the book.
You could use knitr::include_graphics to be sure it works for all format. (PDF, HTML, ...) or maybe the markdown syntax will work too
---
title: 'Title'
output:
bookdown::html_document2:
keep_md: true
---
```{r foo, fig.cap = "a figure"}
knitr::include_graphics("plot.png")
```
This is a figure \@ref(fig:foo)
![(#fig:bar) Caption](plot.png)
This is another figure \@ref(fig:bar)