In Guide > Authoring > Figures > LaTeX figures > [Environments](https://quarto.org/docs/authoring/figures.html#environments), the following code is provided:

````qmd
---
title: "Sidenotes"
format:
  pdf:
    include-in-header: 
      text: |
        \usepackage{mdframed}
---

![Elephant](elephant.png){fig-env="mdframed"}
````

However, running this on my system produces a `\caption outside float` error. This is the generated log file: [test.log](https://github.com/quarto-dev/quarto-cli/files/11717821/test.log).

---
Quarto v1.3.361 on VS Code
macOS Ventura
MacTeX 2023
cscheid
2023-06-12T04:41:59Z
dense-set
enhancement crossref latex
v1.4
open
[documentation, bug] Provided code for LaTeX mdframe not working
https://github.com/quarto-dev/quarto-cli/issues/5886