I've installed TinyTeX and am now trying to knit the generic "Untitled.Rmd" file to PDF,

> install.packages("tinytex")
> tinytex::install_tinytex()

> options(tinytex.verbose = TRUE)
> rmarkdown::render("Untitled.Rmd", output_format = "pdf_document")

which returns this error message:

tlmgr search --file --global "/grffile.sty"
! LaTeX Error: File `grffile.sty' not found.

! Emergency stop.
<read *>

Error: Failed to compile Untitled.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See Untitled.log for more info.
In addition: Warning message:
In parse_packages(logfile, quiet = c(TRUE, FALSE, FALSE)) :
  Failed to find a package that contains grffile.sty

I've tried installing the package but that didn't seem to help.

> tinytex::tlmgr_install("grffile")

Has anyone else had this issue? I've so far been able to reproduce this error on both Windows and MacOS, when a second LaTeX distribution is not present.


I just ran into the same problem with pdflatex. Package grffile was updated several days ago, on 2019-11-08. The changelog reveals the cause:

Recent changes in LaTeX and specifically the release LaTeX2e <2019-10-01> patch level 2 mean that most of the facilities of grffile are not needed, also the changes mean that some of the original patches made by this package no longer work.

This package is now a legacy package that by default just loads the standard graphicx package.

The LaTeX package rollback feature is enabled so that \usepackage{grffile}[=v1] may be used to access version 1(.18) of the package if that is needed.`

I removed all references to grffile from my documents and they compile fine now.

  • Thank you! And for anyone looking for a fix in the rmarkdown package, please see the top comment. – Victor Kong Nov 11 at 18:44

Add this at the top of the .rmd file

options(tinytex.verbose = TRUE)
  • 3
    I did this but it actually didn't change the error message. – Victor Kong Nov 9 at 5:00
  • 1
    This is plainly useless and this answer should get downvoted. – alexlomba87 Nov 10 at 9:41

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.