Quarto not rendering embed-resources with quarto_render()

When I render a a qmd file using the arrow render button in the rstudio IDE it will create a self-contained html file , but when I tell it to render via another function, all of the images are stored in a subdirectory i.e. not self-contained.

Here is my yaml heading:

title: "`r params$dist` Dashboard DA Summary"
        theme: pulse
        embed-resources: true
editor: visual
toc: true
toc-location: left
    dist: '27661590000000'

and here is the rendering code chuck that I use to create documents that so far is not working to make have resources embedded

for(i in da.dists){
    dist <- list(dist =  i )
    dist.name <- mcoe_name(dist)
    # render("DashboardSummary.qmd",
    #        #   output_format = "all",
    # #       output_dir = "output",
    #        output_file = here("output" ,paste0("DashboardSummary", dist.name, ".html" ) ),
    #        params = dist,
    #        envir = new.env(parent = globalenv())
    # )
                  #   output_format = "all",
                  # output_dir = "output",
  #                execute_dir = "output",
                input = "DashboardSummary.qmd",

                  output_file = paste0("DashboardSummary", dist.name, ".html" ) ,
                  execute_params = dist,
                  #  envir = new.env(parent = globalenv())
#    file.rename(from = paste0("DashboardSummary", dist.name, ".html" ), 
#                to = here("output", paste0("DashboardSummary", dist.name, ".html" ))  )

Any suggestions on why the rendering behavior would be different and/or how to make it actually self-contained?
1 Like

Just to be sure, can you check the Quarto version used by both cases ?

  • In RStudio terminal, run quarto check install
  • quarto::quarto_version() and check quarto::quarto_path()

Options from your document YAML should be respected, but as embed-resources is quite new, maybe there is a version mismatched.


I can confirm the bug posted by @dobrowski .
My quarto check install yields

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

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


> quarto::quarto_version()
[1] ‘1.0.38’
> quarto::quarto_path()
[1] "/usr/local/bin/quarto"

Is the different path the source of the problem?

This is quite an old installation now, as the latest in Quarto 1.2 and next is 1.3 current pre-release and soon to be out.

Quarto bundles Pandoc in a version, and it bundles Pandoc 2.18

embed-resource is from Pandoc 2.19
and not so also not supported in Quarto before v1.1.x

1 Like

I updated quarto, now everything works like a charm :smile: Thanks @cderv !

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.