diff --git a/.Rbuildignore b/.Rbuildignore index 07d4f195e..67e0de967 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,3 +6,4 @@ ^TinyTeX.*\.zip$ ^\.github$ ^cran-comments\.md$ +^\.vscode$ diff --git a/.github/workflows/required-latex-pkgs.yaml b/.github/workflows/required-latex-pkgs.yaml index 1739f1e60..8f8ff1b00 100644 --- a/.github/workflows/required-latex-pkgs.yaml +++ b/.github/workflows/required-latex-pkgs.yaml @@ -3,10 +3,6 @@ on: branches: [main] paths-ignore: - '.github/workflows/build.yaml' - pull_request: - branches: [main] - paths-ignore: - - '.github/workflows/build.yaml' name: check required LateX packages @@ -41,7 +37,7 @@ jobs: run: Rscript tools/test-packages.R - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v7 with: title: Update the list of LaTeX packages body: New results by running `tools/test-packages.R`. diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..7c9f5559c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "[r]": { + "editor.formatOnSave": false, + } +} \ No newline at end of file diff --git a/R/latex.R b/R/latex.R index 621e9f19c..bd019318b 100644 --- a/R/latex.R +++ b/R/latex.R @@ -590,6 +590,10 @@ regex_errors = function() { # L3 programming layer mismatch (#424) '^File: ([^ ]+) \\d{4,}-\\d{2}-\\d{2} .*$' ), + babel = c( + # babel language definition files + ".*! Package babel Error: Unknown option [`']([^'`]+)'.*" + ), style = c( # missing .sty or commands ".* Loading '([^']+)' aborted!", @@ -619,6 +623,8 @@ detect_files = function(text) { if (p == r$l3backend) return( if (length(grep('^! Undefined control sequence', text)) > 0) tail(v, 1) ) + # babel language definition files + if (p %in% r$babel) return(paste0(v, '.ldf')) # these are some known filenames for (i in c('epstopdf', grep('[.]', names(r), value = TRUE))) { if (p %in% r[[i]]) return(i) diff --git a/tests/test-cran/test-latex.R b/tests/test-cran/test-latex.R index 9bfe3e193..036e91472 100644 --- a/tests/test-cran/test-latex.R +++ b/tests/test-cran/test-latex.R @@ -12,6 +12,7 @@ assert('detect_files() can detect filenames from LaTeX log', { (detect_files("! LaTeX Error: File `framed.sty' not found.") %==% 'framed.sty') (detect_files("/usr/local/bin/mktexpk: line 123: mf: command not found") %==% 'mf') (detect_files("or the language definition file ngerman.ldf was not found") %==% 'ngerman.ldf') + (detect_files("! Package babel Error: Unknown option 'english'.") %==% 'english.ldf') (detect_files("!pdfTeX error: pdflatex (file 8r.enc): cannot open encoding file for reading") %==% '8r.enc') (detect_files("! CTeX fontset `fandol' is unavailable in current mode") %==% 'fandol') (detect_files('Package widetext error: Install the flushend package which is a part of sttools') %==% 'flushend.sty')