Skip to content

Commit e96be31

Browse files
committed
fix #465: remove .*: and :.* from font filenames
1 parent 1a5329d commit e96be31

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-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.56.1
4+
Version: 0.56.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

+1
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ detect_files = function(text) {
625625
}
626626
if (p == r$fd) v = tolower(v) # LGRcmr.fd -> lgrcmr.fd
627627
if (!(p %in% r$font)) return(v)
628+
v = gsub('^.*?:|:.*$', '', v) # https://github.com/rstudio/tinytex/issues/465
628629
if (p == r$font[1]) paste0(v, '.sty') else font_ext(v)
629630
})))
630631
}

tests/test-cran/test-latex.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
library(testit)
22

33
assert('detect_files() can detect filenames from LaTeX log', {
4-
# Fonts are tested in test-tlmgr.R also
4+
# Fonts are also tested in test-tlmgr.R
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'))
88
(detect_files('(fontspec) The font "LibertinusSerif-Regular" cannot be') %==% font_ext('LibertinusSerif-Regular'))
9+
(detect_files('! Font \\JY3/mc/m/n/10=file:HaranoAjiMincho-Regular.otf:-kern;jfm=ujis at 9.24713pt not loadable: metric data not found or bad.') %==% 'HaranoAjiMincho-Regular.otf')
910

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

0 commit comments

Comments
 (0)