I am using tinytex, Windows 10, R Studio


and keep seeing the following error when I try to run a .Rmd file which contains \usepackage{pdflscape}

! LaTeX Error: File `pdflscape.sty' not found.

! Emergency stop.
<read *> 

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

Not only do I keep getting this error for pdflscape, but also for other packages the .Rmd file uses, such as pagecolor, titling, sectsty, fancyhdr.

I have tried

    text = "! LaTeX Error: File `pdflscape.sty' not found."

which gives the error

Warning message:
In parse_packages(...) :
  Failed to find a package that contains pdflscape.sty

Doing this


gives me the following

C:\Users\...........: TLPDB::from_file could not initialize from: https://mirror.ctan.org/systems/texlive/tlnet/tlpkg/texlive.tlpdb
C:\Users\...........: Maybe the repository setting should be changed.
C:\Users\...........: More info: https://tug.org/texlive/acquire.html

Which I can't really make sense of, except to blindly follow the answer to this question. Yet after typing

tinytex::install_tinytex(repository = 'http://mirrors.ibiblio.org/pub/mirrors/CTAN/')

into R and repeating all the above steps, and again doing this after typing in

tinytex::install_tinytex(repository = 'http://dante.ctan.org/tex-archive/')

I still get the same error as before. Any help?

  • can't really help with the R parts but the URL for tlmgr should normally be something like https://mirror.example.org/ctan/path/systems/texlive/tlnet (that is, ending in tlnet not in CTAN or tex-archive) Nov 25, 2021 at 16:48


Your Answer

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

Browse other questions tagged or ask your own question.