Search code examples
rwindows-10latexrstudiopdflatex

RStudio error in windows: Running pdflatex.exe on file_name.tex.. (exit code -1073740791)


I am using Rstudio in windows 10. I am triying to create a pdf from a .tex file. However, when I compile the PDF, the following error appears:

Running pdflatex.exe on file_name.tex...failed Error running C:/Users/user_name/AppData/Local/Programs/MiKTeX/miktex/bin/x64/pdflatex.exe (exit code -1073740791)

I am using a native installation of R, Rstudio and MikTeX. Not an envioronment with anaconda or similar.


Solution

  • If you are using RStudio, have you tried tinytex instead of MikTeX? In the Tools Menu>Global Options>Sweave, tick "use tinytex for compiling .tex files". Then install tinytex package. After installing tinytex package, write in console "tinytex::install_tinytex()". This will install the latex compiler tinytex. Try compiling your tex file using it.