I've recently delved into template partials for PDFs (Latex). When having a template partial for `before-body.tex` and the yaml parameter `code-block-bg` set, the `Shaded` environment is not renewed, as in the `\renewenvironment` is not called.

I've manually added this block into my `before-body`-template and fixed the issue.

```latex
\ifdefined\Shaded
  \renewenvironment{Shaded}{
    \begin{tcolorbox}[colback={shadecolor}, boxrule=0pt, frame hidden, enhanced, breakable]
  }{
    \end{tcolorbox}
  }
\fi
```
(this only works when `code-bloc-bg` is set and needs to be removed when the parameter is not used)

I think it would be nice to either mention something in the documentation or implement something for the quarto-cli
dragonstyle
2023-02-21T09:38:57Z
joelvonrotz
needs-repro
closed
before-body.tex requires renewal of Shaded-environment (PDF)
https://github.com/quarto-dev/quarto-cli/issues/4445