Unable to Make a PDF from R Markdown

I just installed MikTex and am trying to make a PDF from R Markdown. I just wanted to test it out, so I made a new markdown and tried to knit but I'm getting an error message saying:
! Sorry, but C:\PROGRA~1\MiKTeX\miktex\bin\x64\pdflatex.exe did not succeed.

! The log file hopefully contains the information to get MiKTeX going again:

! C:\Users\peyto\AppData\Local\MiKTeX\miktex\log\pdflatex.log

Error: LaTeX failed to compile MyFirstRMarkdown.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See MyFirstRMarkdown.log for more info.
Execution halted

I read that having multiple downloads of MikTex may cause this problem, so I checked and I do have it installed multiple times. I tried to uninstall it so I would only have one, but it says "MikTex Console is already running". I then went to task manager to see if it was running since I wasn't aware of it being open anywhere. It had it running in the background so I killed it. Now, it continues to say it's already running which means I'm unable to uninstall it.
I'm not even sure if that is the solution to my original problem of not being able to create a PDF. Really, all I need is to create a PDF from R markdown, but I've gotten super lost now. Any help is super appreciated.

I don't know about this specific MikTeX issue, but if you are not bound to MikTeX I would advise to install TinyTeX distribution using the tinytex R :package:

This is know to work well with Rmarkdown.

Is this something doable for you instead of debugging MikTeX ?

You would need to uninstall MikTeX, restart your computer and install TinyTeX

I finally got it to delete by going to the file location and deleting all the files. I think I'll try TinyTeX now because that was such a hassle. Thank you!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.