Skip to content

Commit

Permalink
Correctly detect new fontspec error for missing font
Browse files Browse the repository at this point in the history
closes #448
  • Loading branch information
cderv committed Sep 2, 2024
1 parent 481e61f commit c032320
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: tinytex
Type: Package
Title: Helper Functions to Install and Maintain TeX Live, and Compile LaTeX Documents
Version: 0.52.1
Version: 0.52.2
Authors@R: c(
person("Yihui", "Xie", role = c("aut", "cre", "cph"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
person(given = "Posit Software, PBC", role = c("cph", "fnd")),
Expand Down
4 changes: 3 additions & 1 deletion R/latex.R
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ regex_errors = function() {
# ! I can't find file `hyph-de-1901.ec.tex'.
# ! Package pdfx Error: No color profile sRGB_IEC61966-2-1_black_scaled.icc found
# No file LGRcmr.fd. ! LaTeX Error: This NFSS system isn't set up properly.
# (fontspec) The font "LibertinusSerif-Regular" cannot be
list(
font = c(
# error messages about missing fonts (don't move the first item below, as
Expand All @@ -569,7 +570,8 @@ regex_errors = function() {
".*! Font [^=]+=([^ ]+).+ not loadable.*",
'.*! .*The font "([^"]+)" cannot be found.*',
'.*!.+ error:.+\\(file ([^)]+)\\): .*',
'.*Unable to find TFM file "([^"]+)".*'
'.*Unable to find TFM file "([^"]+)".*',
'.*\\(fontspec\\)\\s+The font "([^"]+)" cannot be.*'
),
fd = c(
# font definition files
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 @@ -5,6 +5,7 @@ assert('detect_files() can detect filenames from LaTeX log', {
(detect_files("! Font U/psy/m/n/10=psyr at 10.0pt not loadable: Metric (TFM) file not found") %==% font_ext("psyr"))
(detect_files('! The font "FandolSong-Regular" cannot be found.') %==% font_ext("FandolSong-Regular"))
(detect_files('!pdfTeX error: /usr/local/bin/pdflatex (file tcrm0700): Font tcrm0700 at 600 not found') %==% font_ext('tcrm0700'))
(detect_files('(fontspec) The font "LibertinusSerif-Regular" cannot be') %==% font_ext('LibertinusSerif-Regular'))

(length(detect_files("asdf qwer")) == 0)
(detect_files("! LaTeX Error: File `framed.sty' not found.") %==% 'framed.sty')
Expand Down

0 comments on commit c032320

Please sign in to comment.