Emily
Emily

Reputation: 46

R knit to PDF not working properly with errors

I am trying to knit a document to pdf. I can knit to HTML just fine, but the pdf never works. Things I have tried:

tlmgr conf auxtrees add "C:/PROGRA~1/R/R-4.0.3/share/texmf"
Error in system2("tlmgr", args, ...) : 
  'CreateProcess' failed to run 'C:\Users\XXX XXX\AppData\Roaming\TinyTeX\bin\win32\tlmgr.bat info --list --only-installed --data name'
Error in system2("tlmgr", args, ...) : 
  'CreateProcess' failed to run 'C:\Users\XXX XXX\AppData\Roaming\TinyTeX\bin\win32\tlmgr.bat info --list --only-installed --data name'
Error in system2("tlmgr", args, ...) : 
  'CreateProcess' failed to run 'C:\Users\XXX XXX\AppData\Roaming\TinyTeX\bin\win32\tlmgr.bat update --all --self'
Calls: <Anonymous> ... latexmk_emu -> run_engine -> system2_quiet -> tlmgr_update
In addition: Warning message:
In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
  'CreateProcess' failed to run 'C:\Users\XXX XXX\AppData\Roaming\TinyTeX\bin\win32\pdflatex.exe -halt-on-error -interaction=batchmode "Document.tex"'
Execution halted

I'm at a loss at this point and nothing I have found online has worked.

Metadata sections:

Without xelatex

---
title: "A Document"
output: pdf_document
---
Error in system2("tlmgr", args, ...) : 
  'CreateProcess' failed to run 'C:\Users\XXX XXX\AppData\Roaming\TinyTeX\bin\win32\tlmgr.bat update --all --self'
Calls: <Anonymous> ... latexmk_emu -> run_engine -> system2_quiet -> tlmgr_update
In addition: Warning message:
In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
  'CreateProcess' failed to run 'C:\Users\XXX XXX\AppData\Roaming\TinyTeX\bin\win32\pdflatex.exe -halt-on-error -interaction=batchmode "Document.tex"'
Execution halted

With xelatex

---
title: "A Document"
output:
   pdf_document:
     latex_engine: xelatex
---
Error in system2("tlmgr", args, ...) : 
  'CreateProcess' failed to run 'C:\Users\XXX XXX\AppData\Roaming\TinyTeX\bin\win32\tlmgr.bat update --all --self'
Calls: <Anonymous> ... latexmk_emu -> run_engine -> system2_quiet -> tlmgr_update
In addition: Warning message:
In system2(..., stdout = if (use_file_stdout()) f1 else FALSE, stderr = f2) :
  'CreateProcess' failed to run 'C:\Users\XXX XXX\AppData\Roaming\TinyTeX\bin\win32\xelatex.exe -halt-on-error -interaction=batchmode "xelatex.tex"'
Execution halted

Upvotes: 1

Views: 9068

Answers (1)

Emily
Emily

Reputation: 46

The issue was with my file path having a space in it. I went to a different user on my computer which didn't have any spaces and the file converted to a PDF just fine.

Upvotes: 2

Related Questions