Quarto Render Button

I’m having trouble with the Render button for Quarto Documents in RStudio. When I click Render, I get the following error in the Background Jobs tab (and the output is not created):

'C:/Program' is not recognized as an internal or external command, operable program or batch file.

I don’t fully understand what goes on in the background when I click Render. But from this error, I am guessing that RStudio is attempting to access a path in my Program Files directory, but it is not using quotations around the path (hence the failure at C:/Program).

A few other key pieces of information:

  • I have tried this with both HTML output and PDF output and have encountered the same issue. And for reference, I am trying this with a clean qmd file (with the same content that appears when you create a new Quarto Document in RStudio).
  • I am able to render the qmd file successfully using two other methods. I have successfully rendered the file by issuing commands in the Terminal tab of RStudio (quarto render "[file name].qmd"). I have also successfully rendered the file by running quarto::quarto_render in an R script.
  • I do not have the same problem with the Knit button for R Markdown. When I click Knit on an Rmd file, it successfully creates the output. And I can see in the Render tab of RStudio that quotations were used around file/folder paths:
"C:/Program Files/RStudio/bin/quarto/bin/tools/pandoc" +RTS -K512m -RTS sundries-20220714.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output sundries-20220714.tex --lua-filter "C:\Users\redacted\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\redacted\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\latex-div.lua" --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --variable "geometry:margin=1in" 
output file: sundries-20220714.knit.md

And some background details:

  • RStudio version: RStudio 2022.07.1+554 "Spotted Wakerobin" Release (7872775ebddc40635780ca1ed238934c3345c5de, 2022-07-22) for Windows
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36
  • Quarto version: 1.0.37
  • R version: 4.2.1
  • OS: Windows 11

Does anyone know how I can fix my issue with the Render button?

Thanks for your help.

1 Like

I had the same error earlier today after updating to the most recent version of RStudio. No idea what the cause is, but I found that changing the file name to something else (e.g. hello.qmd) allowed me to render as usual. Maybe give that a try?

1 Like

That worked! After removing spaces in the file name, I don't get the error.

Interesting. When I rendered via the command line, the spaces were fine, and (as expected, just like in R Markdown) the output replaced spaces with hyphens. But the Render button in RStudio seems to have issues with the spaces in the file name.

Thanks for your help!

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.