Skip to content

Commit ebf01ef

Browse files
committed
latex - Teach error detection about new fontspec log error for missing font
This way they are correctly detected an installed.
1 parent 295111c commit ebf01ef

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

news/changelog-1.6.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ All changes included in 1.6:
3030
- `latex-auto-install: false` now correctly opt out any missing hyphenation packages detection and installation. Only a warning will be thrown if any detected in the log.
3131
- For default behavior (`latex-auto-install: true`), detection is still happening and missing packages are installed automatically. If it fails, Quarto does not fail anymore as PDF rendering as succeeded already. Only a warning will be thrown to log the installation failure.
3232
- Log message about hyphenation package missing for `chinese` or `chinese-hans` languages are now ignored.
33+
- ([#10655](https://github.com/quarto-dev/quarto-cli/issues/10655)): Missing fonts from fontspec error are correctly detected and looked for to be installed.
3334

3435
## Projects
3536

src/command/render/latexmk/parse-error.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ const packageMatchers = [
241241
regex: /.*Unable to find TFM file "([^"]+)".*/g,
242242
filter: formatFontFilter,
243243
},
244-
244+
{
245+
regex:
246+
/.*! Package fontspec Error:\s+\(fontspec\)\s+The font "([^"]+)" cannot be\s+\(fontspec\)\s+found;+/g,
247+
filter: formatFontFilter,
248+
},
245249
{ regex: /.* File `(.+eps-converted-to.pdf)'.*/g, filter: estoPdfFilter },
246250
{ regex: /.*xdvipdfmx:fatal: pdf_ref_obj.*/g, filter: estoPdfFilter },
247251

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
format:
3+
pdf:
4+
fontfamily: libertinus
5+
_quarto:
6+
tests:
7+
pdf: default
8+
---
9+
10+
```{r}
11+
#| include: false
12+
13+
# Remove font that is supposed to be installed automatically
14+
if (tinytex::check_installed("libertinus-fonts")) {
15+
tinytex::tlmgr_remove("libertinus-fonts")
16+
}
17+
```
18+
19+
Quarto LaTeX engine should correctly detect the missing font package and install it to render the PDF.

0 commit comments

Comments
 (0)