Skip to content

Commit c032320

Browse files
committed
Correctly detect new fontspec error for missing font
closes #448
1 parent 481e61f commit c032320

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: tinytex
22
Type: Package
33
Title: Helper Functions to Install and Maintain TeX Live, and Compile LaTeX Documents
4-
Version: 0.52.1
4+
Version: 0.52.2
55
Authors@R: c(
66
person("Yihui", "Xie", role = c("aut", "cre", "cph"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666")),
77
person(given = "Posit Software, PBC", role = c("cph", "fnd")),

R/latex.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ regex_errors = function() {
561561
# ! I can't find file `hyph-de-1901.ec.tex'.
562562
# ! Package pdfx Error: No color profile sRGB_IEC61966-2-1_black_scaled.icc found
563563
# No file LGRcmr.fd. ! LaTeX Error: This NFSS system isn't set up properly.
564+
# (fontspec) The font "LibertinusSerif-Regular" cannot be
564565
list(
565566
font = c(
566567
# error messages about missing fonts (don't move the first item below, as
@@ -569,7 +570,8 @@ regex_errors = function() {
569570
".*! Font [^=]+=([^ ]+).+ not loadable.*",
570571
'.*! .*The font "([^"]+)" cannot be found.*',
571572
'.*!.+ error:.+\\(file ([^)]+)\\): .*',
572-
'.*Unable to find TFM file "([^"]+)".*'
573+
'.*Unable to find TFM file "([^"]+)".*',
574+
'.*\\(fontspec\\)\\s+The font "([^"]+)" cannot be.*'
573575
),
574576
fd = c(
575577
# font definition files

tests/test-cran/test-latex.R

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ assert('detect_files() can detect filenames from LaTeX log', {
55
(detect_files("! Font U/psy/m/n/10=psyr at 10.0pt not loadable: Metric (TFM) file not found") %==% font_ext("psyr"))
66
(detect_files('! The font "FandolSong-Regular" cannot be found.') %==% font_ext("FandolSong-Regular"))
77
(detect_files('!pdfTeX error: /usr/local/bin/pdflatex (file tcrm0700): Font tcrm0700 at 600 not found') %==% font_ext('tcrm0700'))
8+
(detect_files('(fontspec) The font "LibertinusSerif-Regular" cannot be') %==% font_ext('LibertinusSerif-Regular'))
89

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

0 commit comments

Comments
 (0)