Error when Rendering Quarto Document to pdf (Won't install xelatex)

I have used the basic function of RMarkdown before but am now delving into the world of Quarto. When I put together a document I was able to render it as an html but when I tried to render as a pdf it gave me this error...

processing file: FLOURISH_mailer.qmd
                                                                                                           
output file: FLOURISH_mailer.knit.md

pandoc 
  to: latex
  output-file: FLOURISH_mailer.tex
  standalone: true
  pdf-engine: xelatex
  variables:
    graphics: true
    tables: true
  default-image-extension: pdf
  
metadata
  documentclass: scrartcl
  classoption:
    - DIV=11
    - numbers=noendperiod
  papersize: letter
  header-includes:
    - '\KOMAoption{captions}{tableheading}'
  block-headings: true
  title: FLOURISH Data Summary
  editor: visual
  
running xelatex - 1
command xelatex not found, attempting install
finding package for xelatex
> 1 package to install
> installing xelatex (1 of 1)
ERROR: tlmgr returned a non zero status code
The system cannot find the path specified.

When I run the quarto list tools command in the terminal it shows tinytex as being up to data and v2303.05 being installed. My R version is 4.3.0 and my Rstudio version is 2023.03.1 Build 446.

I have also run tinytex::install_tinytex() and uninstalled tinytex and reinstalled it with the addition of the --update-path command.

It seems like maybe R is confused in finding the file path to some of the tinytex material but I am unsure of how to remedy it. Many of the other forums online related to similar problems have seemed pretty inconclusive so hoping that maybe there is another solution out there!

You show us the output of the quarto processing.
What do you specify as input? Exactly the output statements?

Does it compile with

pdf-engine: pdflatex

? Because maybe you do not need specific xelatex functionality.

See also e.g. https://github.com/quarto-dev/quarto-cli/issues/909

Thanks for the reply @HanOostdijk .

To get the error above my header was...

 ---
title: "FLOURISH Data Summary"
format: pdf
editor: visual
---

when I replace format: pdf with pdf-engine: pdflatex it gives an output but in html instead of pdf?
Here is the output:

 processing file: FLOURISH_mailer.qmd
1/7                 
2/7 [Setup]         
3/7                 
4/7 [Soil M graph]  
5/7                 
6/7 [Soil Tempgraph]
7/7                 
output file: FLOURISH_mailer.knit.md

pandoc 
  to: html
  output-file: FLOURISH_mailer.html
  standalone: true
  section-divs: true
  html-math-method: mathjax
  wrap: none
  default-image-extension: png
  pdf-engine: pdflatex
  
metadata
  document-css: false
  link-citations: true
  date-format: long
  lang: en
  title: FLOURISH Data Summary
  editor: visual
  
Output created: FLOURISH_mailer.html

I also tried running tinytex::uninstall_tinytex() and then reinstalling the larger tinytex bundle with tinytex::install_tinytex(bundle = "TinyTeX-2") hoping that with more packages it would get rid of the problem but it still resulted in the original error when ran with format: pdf

I know there are workarounds but was just trying to figure out why the default rendering wasn't working.

In the https://quarto.org/docs/reference/formats/pdf.html I see a separate format and pdf-engine option.
So I would expect something like

---
title: "My Document"
format: 
  pdf: 
    pdf-engine: pdflatex
---

Is this what you did? If you did not specify the format pdf I can imagine (but I am not sure) that html would be the default.