### Bug description

When setting the `fig-env` or `fig-pos` in the `_quarto.yml`, there is a peculiar bug where it errors if you include single images inside of custom divs. I will show some tests which reproduce the error from the default book project in VSCode when using "New Project --> Book". 

I have started doing all of my figures inside of their own divs. This makes writing much longer figure captions much easier, and spellcheck actually looks at them inside of VSCode rather than when they are inside of the `[]` of a regular markdown image.

The below project renders OK, including a number of subfigures.


## Renders OK

```yaml
project:
  type: book

book:
  title: "testing"
  author: "Norah Jones"
  date: "23/05/2023"
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd

bibliography: references.bib

format:
  pdf:
    documentclass: scrreprt
    fig-pos: bp
```

```md
# Introduction

This is a book created from markdown and executable code.

See @knuth84 for additional discussion of literate programming.


::: {#fig-test layout-ncol="2"}

![](cover.png){#fig-logo1}

![](cover.png){#fig-logo2}

Some logos.
:::

```

## Doesn't Render

If I leave the YAML the same but change it to just a single figure inside of the div then this fails to render: 

```md
# Introduction

This is a book created from markdown and executable code.

See @knuth84 for additional discussion of literate programming.


::: {#fig-test}

![](cover.png)


Some logos.
:::

```

```
compilation failed- error
LaTeX Error: Not in outer par mode.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.215 \begin{figure}[bp]
```

The actual `.tex` lines that are problematic look like this, and from what I can find googling around it doesn't like setting a floating environment inside an already floating environment.

```tex
\begin{figure}

{\centering 

\begin{figure}[bp]

{\centering \includegraphics{cover.png}

}

\end{figure}

}
```

I have a solution that works if I set it up as follows:

```md
::: {#fig-test layout-ncol="1"}

![](cover.png)

Some logos.
:::
```

I found that it was mentioned in the docs about setting environments inside of divs can be unstable in latex. I propose that that the global `fig-env` or `fig-pos` might instead affect the div figure rather than what is contained within?

I figure that this might also be a bit of an esoteric use, but I the ability to better write longer captions I think is crucial as opposed to the `![]()` markdown syntax, so potentially even a different way to include images in the div.

# System specs:
I have tested on both my windows 11 and MacOS 13.2 machines.

#### Quarto Check:
```md
quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.353
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.11 (Conda)
      Path: /usr/local/Caskroom/miniconda/base/envs/mn-test/bin/python
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with conda install jupyter

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/brady/git/phd/thesis/renv/library/R-4.2/x86_64-apple-darwin17.0
        - /Library/Frameworks/R.framework/Versions/4.2/Resources/library
      knitr: 1.39
      rmarkdown: 2.14

[✓] Checking Knitr engine render......OK
```





### 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.
- [X] Please provide the output of `quarto check` so we know which version of quarto and its dependencies you're running.
cscheid
2023-05-23T09:20:12Z
BradyAJohnston
bug crossref
v1.4
open
Error with `fig-pos` and Single Images in Divs
https://github.com/quarto-dev/quarto-cli/issues/5637