### Bug description

I am trying to render a styled pandas dataframe (using `.style`, specifically `.background_gradient` to pdf. I'm running into an issue with the LaTex specifically. Per #1118, #1119, and #1457 I'm wrapping my styled table in `display(Latex())`. This has gotten be further along, but now I'm hitting what I believe is a LaTex syntax error:

```
compilation failed- error
Undefined control sequence.
l.214 0 & \background
                     -color#ffffd9 \color#000000 1 & \background-color#40b5c... 
```

Here is my `.qmd`:
````md

---
execute: 
  echo: false

format:
  pdf:
    fig-format: png
    margin-top: .5in
    margin-bottom: .75in
    margin-left: .75in
    margin-right: .75in
    documentclass: scrartcl
    include-in-header:
      text: |
        \usepackage{float}
        \floatplacement{table}{H}

jupyter: python3


---

```{python}
from IPython.display import display, Latex
import pandas as pd

df = pd.DataFrame([[1,2000],[3,4000]],columns=['Month','Count'])


def print_df(df):
  styled_df = df[['Month','Count']].style.format(
    precision=0,
    formatter={('Count'):"{:,.0f}"},
    escape=None

  ).background_gradient(axis=None, vmin=0, cmap="YlGnBu")

  return styled_df

display(Latex((print_df(df).to_latex())))

```

````

Running on MacOS 12.5, M1 Pro chip.

### `quarto check` Output

```bash

[✓] Checking Quarto installation......OK
      Version: 1.0.38
      Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.4 (Conda)
      Path: /Users/welty/opt/anaconda3/envs/quarto/bin/python
      Jupyter: 4.11.1
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
```

### `quarto tools check` Output

```bash
[✓] Inspecting tools

Tool         Status            Installed     Latest  
chromium     Not installed     ---           869685  
tinytex      Up to date        v2022.08      v2022.08
```


### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included 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] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
2022-08-12T18:45:35Z
jackwelty
bug third-party
closed
Undefined control sequence when rendering styled pandas table
https://github.com/quarto-dev/quarto-cli/issues/1851