knitr/rmarkdown/Latex: How to cross-reference figures and tables?

You can use the output format bookdown::pdf_document2 instead of pdf_document, and the syntax for referencing a figure is \@ref(fig:chunk-label); see the documentation for details: https://bookdown.org/yihui/bookdown/figures.html

Leave a Comment