Skip to content

"Running juice failed" when rendering gt tables to Typst format on Windows #14202

@ThomasFaria

Description

@ThomasFaria

Bug description

When rendering a Quarto document containing gt tables to the Typst format on Windows, the render fails (I mean it works but the formating is not as expected) with the error (E) Running juice failed with exit code: 1, preceded by a Windows command error: 'C:\Program' n'est pas reconnu en tant que commande interne ou externe, un programme exécutable ou un fichier de commandes.

This error does not occur on Linux with identical code and configuration. The issue appears to be related to improper path quoting when Quarto invokes the juice to inline CSS styles.

Steps to reproduce

---
title: "Reproducible Quarto Document"
format: typst
---

```{python}
from great_tables import GT, style, loc
import polars as pl

# Create sample data
data = pl.DataFrame({
    "name": ["Alice", "Bob", "Charlie", "Diana", "Eve"],
    "score": [95, 67, 88, 72, 91],
    "grade": ["A", "D", "B", "C", "A"],
    "points": [450, 320, 410, 350, 440]
})

# Create styled table
(
    GT(data)
    .tab_header(
        title="Student Performance Report",
        subtitle="Final Semester Results"
    )
    .tab_style(
        style=style.fill(color="#E8F4F8"),
        locations=loc.body(columns="score")
    )
    .tab_style(
        style=[
            style.fill(color="#FFE6E6"),
            style.text(weight="bold")
        ],
        locations=loc.body(columns="points", rows=pl.col("points") > 400)
    )
    .tab_style(
        style=style.text(style="italic", color="#666666"),
        locations=loc.body(columns="grade")
    )
    .cols_label(
        name="Student Name",
        score="Final Score",
        grade="Letter Grade",
        points="Total Points"
    )
)

Actual behavior

Rendering runs but leading to bad formated table with:

'C:\Program' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
(E) Running juice failed with exit code: 1

The error message suggests that the path C:\Program Files\... is being incorrectly parsed as C:\Program followed by separate arguments, indicating a path quoting issue.

Expected behavior

The document should render a well formatted table as it does on Linux systems.

Your environment

No response

Quarto check output

Quarto 1.8.26
[>] Checking environment information...
Quarto cache location: C:\Users\tfaria\AppData\Local\quarto
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.6.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.3.1: OK
Typst version 0.13.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.8.26
Path: C:\Program Files\Quarto\bin
CodePage: unknown

[>] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)

[>] Checking LaTeX....................OK
Tex: (not detected)

[>] Checking Chrome Headless....................OK
Chrome: (not detected)

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

[>] Checking Python 3 installation....OK
Version: 3.11.0
Path: C:/Program Files/Python311/python.exe
Jupyter: 5.9.1
Kernels: python3

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

[>] Checking R installation...........OK
Version: 4.5.0
Path: C:/PROGRA1/R/R-451.0
LibPaths:
- C:/Users/**/AppData/Local/R/cache/R/renv/sandbox/windows/R-4.5/x86_64-w64-mingw32/9bc714e4
knitr: 1.50
rmarkdown: 2.29

[>] Checking Knitr engine render......OK

Metadata

Metadata

Labels

bugSomething isn't workingluaIssues related to the lua codebase, filter chain, etctypstwindows

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions