### Bug description

I am trying to create a report, which should also have List of Figures. However, I am unable to add the plots created by ggplot2 package in the list of figures. In the rendered report, I can see there is a List of Tables and a List of Figures, but the List of Figures is empty. Even though I have created a plot, and added label and caption to that plot, the list remains empty. A minimal example is as follows:
YAML Head
```
---
title: "mtcars"
format:
  pdf:
    documentclass: scrreprt
    fig-align: center
    fig-width: 6
    fig-height: 5
    fig-pos: 'h'
    fig-cap-location: bottom
    tbl-cap-location: top
    pdf-engine: lualatex
    keep-tex: true
    linestretch: 1.5
    toc: true
    toc-depth: 2
    toc-title: Contents
    lof: true
    lot: true
    number-sections: true
    number-depth: 6
    colorlinks: true
    callout-appearance: simple
    callout-icon: true
execute: 
  echo: false
  message: false
  warning: false
editor: visual
---
```
Code for Plot
```
{r plot}
#|label: fig-mtcars
#|fig-cap: "A Sample Plot"
library(ggplot2)
ggplot(mtcars, aes(cyl,mpg)) + ggtitle("MPG vs CYL") + geom_point() 
```
I have also tried to add the caption manually inside ggplot, using the code below.
```
{r plot}
#|label: fig-mtcars
#|fig-cap: "A Sample Plot"
library(ggplot2)
ggplot(mtcars, aes(cyl,mpg)) + ggtitle("MPG vs CYL") + geom_point() + labs(caption = "Sample Caption")
```
But when I render, the List of Figures remains empty. In the expected output, I should have this plot in the List of Figures. I am using the latest daily build version of RStudio (2022.12.0 - preview +298) and the Quarto version is 1.2.253. The OS is Windows 10.

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
2022-11-01T06:06:49Z
bhattmaulik
bug
closed
I am unable to add a plot in the List of Figures in PDF output
https://github.com/quarto-dev/quarto-cli/issues/3128