0

Trying to create pdf page using Quarto document in Rstudio with TinyTeX. I can get an HTML page but not pdf. When I try to render a pdf I get an error, "The system cannot find the path specified."

Suggestions for how to fix this, appreciated.

The steps I follow are below:

I open a new Quarto document in RStudio with the following entered in the "New Quarto Document" window:

  • Title: TEST
  • Author: Person
  • HTML selected
  • Engine: Knitr
  • Editor: Use visual markdown editor selected

I select "Render" an get a HTML document. All is fine

If I change "format: html" to "format: pdf" in the YAML and then select render I get the following error:

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.

I get the same error if I open a new Quarto document and select PDF instead of HTML.

In Rstudio, tinytex package is installed. All my packages are up to date. Running R version - 4.2.3 , RStudio version - 2023.03.0 Build 386, Windows 10

TinyTeX folder is located on my computer in C:\Users\XXXXX\AppData\Roaming\TinyTeX

On my computer there is a folder, C:\Users\XXXXX\AppData\Roaming\TinyTex\texmf-dist\tex\xelatex and the file xelatex.exe in C:\Users\XXXXX\AppData\Roaming\TinyTeX\bin\windows

There are several files with "tlmgr" in the filename on my computer including tlmgr.bat in C:\Users\XXXXX\AppData\Roaming\TinyTeX\bin\windows

In my path is listed "C:\Users\XXXXX\AppData\Roaming\TinyTeX\bin\windows"

ThackeryW
  • 23
  • 4
  • Please check this [issue](https://github.com/jupyter/nbconvert/issues/799) – Quinten Mar 31 '23 at 15:01
  • Foremost run `tinytex::install_tinytex()`, then check your libraries' path with `.libPaths()`, if your **/path/to/tinytex** is not in `.libPaths()`, then you need to install tinytex in your library path or add **/path/to/tinytex** to your `.libPaths()`. Also, you can use `tinytex::is_tinytex()` to see you've installed tinytex or not. – Reza Esmaeelzade Mar 31 '23 at 15:25
  • Thanks for your response; I could not get it to work. I did install tinytex as indicated; tinytex::is_tinytex() returns "TRUE". In RStudio Console, .libPaths() returns "C:/Users/XXXXX/AppData/Local/R/win-library/4.2" "C:/Program Files/R/R-4.2.3/library" so tinytex is NOT in my library path. I added an environmental variable Variable name = R_LIBS_USER, Variable value = C:\Users\XXXXX\AppData\Roaming\TinyTeX. Now, .libPaths() returns "C:/Users/bflet/AppData/Roaming/TinyTeX" "C:/Program Files/R/R-4.2.3/library". I still get the same error. – ThackeryW Apr 06 '23 at 03:44
  • Ok, I got it to work. I had to "separately" install Quarto (odd that I was able to render html without doing that?). I removed the environmental variable I had created and it also worked fine. Thanks again for your assistance. – ThackeryW Apr 06 '23 at 03:59

0 Answers0