I randomly started getting the error messages below while trying to run a RMarkdown document. I am on a Windows, so I deleted the TinyTex subfolder within the AppData folder and reran tinytex::install_tinytex()
. That installed but didn't fix the error messages, so I tried tinytex::reinstall_tinytex()
but that didn't help.
I know from the error messages I am missing LaTeX packages, so I tried running the code below but it will not run. I assume there is a greater problem at hand, and guidance would be greatly appreciated.
tinytex::parse_install(text = "! LaTeX Error: File `setspace.sty' not found.")
Error messages:
A new version of TeX Live has been released. If you need to install or update any LaTeX packages, you have to upgrade TinyTeX with tinytex::reinstall_tinytex(). If it fails to upgrade, you might be using a default random CTAN mirror that has not been fully synced to the main CTAN repository, and you need to wait for a few more days or use a CTAN mirror that is known to be up-to-date (see the "repository" argument on the help page ?tinytex::install_tinytex).
tlmgr.pl: Local TeX Live (2021) is older than remote repository (2022). Cross release updates are only supported with update-tlmgr-latest(.sh/.exe) --update See https://tug.org/texlive/upgrade.html for details. ! LaTeX Error: File `setspace.sty' not found.
! Emergency stop. <read *>
Error: LaTeX failed to compile markdown.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See markdown.log for more info. Execution halted
Two possibilities:
set your mirror to the historic version which still has 2021, e.g.
install vanilla texlive2022 from https://tug.org/texlive/
(I'd go with the second solution. If you use a complete texlive installation instead of tinytex, you'll never again have to deal with missing packages)