Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
^TinyTeX.*\.zip$
^\.github$
^cran-comments\.md$
^\.vscode$
6 changes: 1 addition & 5 deletions .github/workflows/required-latex-pkgs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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`.
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"[r]": {
"editor.formatOnSave": false,
}
}
6 changes: 6 additions & 0 deletions R/latex.R
Original file line number Diff line number Diff line change
Expand Up @@ -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!",
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/test-cran/test-latex.R
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down