I tried to compile a pdf in rmarkdon but the error shows hyperref-langpatches.def file not found. However, I can generate the pdf using the .tex file generated during the process.

  • the file is rather new. Perhaps you need to update a file name data base somewhere. Which tex system is used by rmarkdown? Feb 14, 2021 at 8:44
  • I use MacTex. Do you have any idea which file should be updated. Thanks!
    – Ziwen Zu
    Feb 14, 2021 at 19:21
  • sorry I have no idea. Try to find some log-files so that you can check what rmarkdown is using, and if it is different to the other tex system you are using. Feb 14, 2021 at 19:28

1 Answer 1


I just had the exact same error message while knitting an RMarkdown document.

Running tinytex::reinstall_tinytex() in the R Console solved the problem for me. It is recommended in the troubleshooting page of the R package tinytex().

I hope it works for you too!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.