I have problem with running my .rnw (I am running Sweave) files in RStudio due to this error message:
Writing to file test.tex
Processing code chunks with options ...
You can now run (pdf)latex on 'test.tex'
Running pdflatex.exe on test.tex...failed
Error running C:/PROGRA~1/MiKTeX/miktex/bin/x64/pdflatex.exe (exit code -1073740791)
I have default instalation of MiKTeX and from what I see in my PC I downloaded version 21.2. I have been checking for updates and there aren't any new ones. I use freshly reinstaled Windows 10 as OS with freshly instaled R, RStudio and MiKTeX. So there should not be any interferance with another MiKTeX version.
When I check path to my MiKTeX in RStudio with this code:
Sys.which("pdflatex")
then I get this response:
pdflatex
"C:\\PROGRA~1\\MiKTeX\\miktex\\bin\\x64\\pdflatex.exe"
I have also tried enabling shell escape commands in Tools/Global Options but this did not work also. I have no idea what could be wrong here. Do you have any idea how to fix this issue?
Thank you for your time and effort.