-
Notifications
You must be signed in to change notification settings - Fork 391
Description
Bug description
I am attempting to use quarto render to render an R script using the Jypyter engine as described in the documentation and encountering some issues. See also related discussion.
- Quarto does not correctly auto-detect the Jupyter kernel for R. If no
jupyter: kerneloption is specified, it launches the python kernel but does not evaluate any code (cells are just passed through as markdown chunks). One has to specifyjupyter: irorjupyter: arkexplicitly for the R code cells to be evaluated. output: asisis not always correctly handled. For example, when used withkable(), the engine marks the cell output as "text/plain" rather than "asis", forcing it to be displayed verbatim and not as markdown. See this comment: Rendering R scripts using Jupyter kernels #12505 (comment)
Steps to reproduce
Render the following script using quarto render script.r
# %% [markdown]
# ---
# title: A test
# author: A reporter
# jupyter: ir
# ---
# %% [markdown]
# Sample markdown text
# %%
#| echo: false
1 + 1
# %%
#| echo: false
#| output: asis
knitr::kable(head(iris))
# %% [markdown]
# Some markdown
# %%
#| echo: false
#| fig-width: 4
#| fig-cap: A plot
ggplot2::ggplot(iris) + ggplot2::geom_point(ggplot2::aes(x = Sepal.Length, y = Sepal.Width, color = Species))Actual behavior
Following html output is rendered (notice that the table has been rendered verbatim)
Notes:
-
In the intermediate rendered markdown file, the second code cell output is wrapped in a backticks block, so it is passed verbatim instead of being interpreted as markdown. This is not the same behavior as when using a Quatro Notebook. Similarly, Quatro Notebook can detect and style
kable()output directly, which does not happen when using the Jupyter kernel -
When using
jupyter: ark, the figure in the code cell 3 is not sized correctly
Expected behavior
The same output as an equivalent qmd notebook, i.e.
Your environment
- OS: macOS 15.4
- Quarto CLI version 1.7.22
Quarto check output
Quarto check
Quarto 1.7.22
[✓] Checking environment information...
Quarto cache location: ~/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.6.3: OK
Dart Sass version 1.85.1: OK
Deno version 1.46.3: OK
Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.7.22
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /Library/TeX/texbin
Version: 2024
[✓] Checking Chrome Headless....................OK
Chrome: (not detected)
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.13.2
Path: /opt/homebrew/opt/[email protected]/bin/python3.13
Jupyter: 5.7.2
Kernels: ir, ark, python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK
Version: 4.4.2
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
knitr: 1.50
rmarkdown: 2.29
[✓] Checking Knitr engine render......OKInstalled Jupyter kernels (all kernels verified to work )
Available kernels:
ark ~/Library/Jupyter/kernels/ark
ir ~/Library/Jupyter/kernels/ir
python3 /usr/local/share/jupyter/kernels/python3