diff --git a/DESCRIPTION b/DESCRIPTION index 8eb6cc17e..e716251b6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tinytex Type: Package Title: Helper Functions to Install and Maintain TeX Live, and Compile LaTeX Documents -Version: 0.30.1 +Version: 0.30.2 Authors@R: c( person("Yihui", "Xie", role = c("aut", "cre", "cph"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), person(family = "RStudio, PBC", role = "cph"), diff --git a/R/latex.R b/R/latex.R index 04b6da963..106f1673b 100644 --- a/R/latex.R +++ b/R/latex.R @@ -531,6 +531,7 @@ detect_files = function(text) { '.* (tikzlibrary[^ ]+?[.]code[.]tex).*', + ".* Loading '([^']+)' aborted!", ".*! LaTeX Error: File `([^']+)' not found.*", ".* file ['`]?([^' ]+)'? not found.*", '.*the language definition file ([^ ]+) .*', diff --git a/R/tlmgr.R b/R/tlmgr.R index dc8892e67..38f41a871 100644 --- a/R/tlmgr.R +++ b/R/tlmgr.R @@ -106,9 +106,14 @@ tlmgr_search = function(what, file = TRUE, all = FALSE, global = TRUE, word = FA tlmgr_install = function(pkgs = character(), usermode = FALSE, path = !usermode && os != 'windows', ...) { if (length(pkgs) == 0) return(invisible(0L)) + update_pkgs = function(...) tlmgr_update(..., usermode = usermode) + + # if any packages have been installed, update packages first + if (any(check_installed(pkgs))) update_pkgs() + res = tlmgr(c('install', pkgs), usermode, ...) - if (res != 0 || !check_installed(pkgs)) { - tlmgr_update(all = FALSE, usermode = usermode) + if (res != 0 || any(!check_installed(pkgs))) { + update_pkgs(all = FALSE) # update tlmgr itself since it might be outdated res = tlmgr(c('install', pkgs), usermode, ...) } if ('epstopdf' %in% pkgs && is_unix() && Sys.which('gs') == '') {