Skip to content

embed shortcode requires knitr engine cells to have echo: true (at cell level) #13735

@mcanouil

Description

@mcanouil

I have:

  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide

Bug description

It appears one cannot set echo: false at code cell level and embed the corresponding cell.

Steps to reproduce

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

{{< embed cell.qmd#plot >}}
---
engine: knitr
---

```{r}
#| label: plot
#| echo: false
plot(1)
```

Actual behavior

Rendering qmd embeds
[1/1] cell.qmd
ℹ R version 4.5.2 (2025-10-31)
! Config '~/.Rprofile' was loaded!


processing file: cell.qmd
1/3       
2/3 [plot]
3/3       
output file: cell.knit.md

ERROR: The cell plot does not exist in notebook

Stack trace:
    at file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/core/jupyter/jupyter-embed.ts:446:15
    at Array.map (<anonymous>)
    at notebookMarkdown (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/core/jupyter/jupyter-embed.ts:443:36)
    at eventLoopTick (ext:core/01_core.js:179:7)
    at async replaceNotebookPlaceholders (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/core/jupyter/jupyter-embed.ts:326:26)
    at async renderPandoc (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/command/render/render.ts:118:26)
    at async Object.onRender (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/command/render/render-files.ts:731:30)
    at async renderFileInternal (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/command/render/render-files.ts:693:9)
    at async renderFiles (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/command/render/render-files.ts:331:9)
    at async render (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/command/render/render-shared.ts:106:18)
    at async renderForPreview (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/command/preview/preview.ts:422:24)
    at async render (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/command/preview/preview.ts:169:22)
    at async preview (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/command/preview/preview.ts:186:18)
    at async Command.actionHandler (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/command/preview/cmd.ts:424:7)
    at async Command.execute (https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1948:7)
    at async Command.parseCommand (https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1780:14)
    at async quarto (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/quarto.ts:193:5)
    at async file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/quarto.ts:225:5
    at async file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/core/main.ts:45:14
    at async mainRunner (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/core/main.ts:47:5)
    at async file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/quarto.ts:215:3

Expected behavior

The embedding should work similarly to setting echo: false at document level.

---
engine: knitr
execute:
  echo: false
---

```{r}
#| label: plot
plot(1)
```

Your environment

  • VSCode
  • Latest macOS

Quarto check output

Quarto 99.9.9
[✓] Checking environment information...
      Quarto cache location: /Users/mcanouil/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.87.0: OK
      NOTE: Deno version 2.4.5 does not strictly match 2.3.1 and strict checking is enabled. Please use 2.3.1.
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: 20d67b97dceb83c1d69034bf24bf47616100cc8d
      Path: /Users/mcanouil/Projects/quarto-dev/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: v2025.11
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/mcanouil/Library/TinyTeX/bin/universal-darwin
      Version: 2025

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
      Source: QUARTO_CHROMIUM

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

[✓] Checking Python 3 installation....OK
      Version: 3.14.0
      Path: /Users/mcanouil/Projects/quarto-dev/quarto-playground/.venv/bin/python
      Jupyter: 5.9.1
      Kernels: uv, julia-1.12, python3

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

(/) Checking R installation...........ℹ R version 4.5.2 (2025-10-31)
! Config '~/.Rprofile' was loaded!
[✓] Checking R installation...........OK
      Version: 4.5.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/mcanouil/Projects/quarto-dev/quarto-playground/renv/library/macos/R-4.5/aarch64-apple-darwin20
        - /Users/mcanouil/Library/Caches/org.R-project.R/R/renv/sandbox/macos/R-4.5/aarch64-apple-darwin20/4cd76b74
      knitr: 1.50
      rmarkdown: 2.30

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions