Skip to content

Commit e4fb333

Browse files
committed
Support backtick and single quotes like in tinytex
1 parent f6c4151 commit e4fb333

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ const packageMatchers = [
248248
return `${match}.sty`;
249249
},
250250
},
251-
{ regex: /.* File `(.+eps-converted-to.pdf)'.*/g, filter: estoPdfFilter },
251+
{ regex: /.* File [`'](.+eps-converted-to.pdf)'.*/g, filter: estoPdfFilter },
252252
{ regex: /.*xdvipdfmx:fatal: pdf_ref_obj.*/g, filter: estoPdfFilter },
253253

254254
{
@@ -280,14 +280,14 @@ const packageMatchers = [
280280
},
281281
},
282282
{ regex: /.* Loading '([^']+)' aborted!.*/g },
283-
{ regex: /.*! LaTeX Error: File `([^']+)' not found.*/g },
283+
{ regex: /.*! LaTeX Error: File [`']([^']+)' not found.*/g },
284284
{ regex: /.* [fF]ile ['`]?([^' ]+)'? not found.*/g },
285285
{ regex: /.*the language definition file ([^\s]*).*/g },
286286
{ regex: /.* \\(file ([^)]+)\\): cannot open .*/g },
287-
{ regex: /.*file `([^']+)' .*is missing.*/g },
288-
{ regex: /.*! CTeX fontset `([^']+)' is unavailable.*/g },
287+
{ regex: /.*file [`']([^']+)' .*is missing.*/g },
288+
{ regex: /.*! CTeX fontset [`']([^']+)' is unavailable.*/g },
289289
{ regex: /.*: ([^:]+): command not found.*/g },
290-
{ regex: /.*! I can't find file `([^']+)'.*/g },
290+
{ regex: /.*! I can't find file [`']([^']+)'.*/g },
291291
];
292292

293293
function fontSearchTerm(font: string): string {

tests/unit/latexmk/parse-error.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ unitTest("Detect missing files with `findMissingFontsAndPackages`", async () =>
3333
assertFound('(fontspec) The font "LibertinusSerif-Regular" cannot be', fontSearchTerm("LibertinusSerif-Regular"));
3434
assertFound('! 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");
3535
assertFound("! LaTeX Error: File `framed.sty' not found.", "framed.sty");
36+
assertFound("! LaTeX Error: File 'framed.sty' not found.", "framed.sty");
3637
assertFound("/usr/local/bin/mktexpk: line 123: mf: command not found", "mf");
3738
assertFound("or the language definition file ngerman.ldf was not found", "ngerman.ldf");
3839
assertFound(`Package babel Error: Unknown option 'ngerman'. Either you misspelled it
@@ -43,10 +44,12 @@ unitTest("Detect missing files with `findMissingFontsAndPackages`", async () =>
4344
(babel) to the babel package options.`, "ngerman.ldf")
4445
assertFound("!pdfTeX error: pdflatex (file 8r.enc): cannot open encoding file for reading", "8r.enc");
4546
assertFound("! CTeX fontset `fandol' is unavailable in current mode", "fandol");
47+
assertFound("! CTeX fontset 'fandol' is unavailable in current mode", "fandol");
4648
assertFound('Package widetext error: Install the flushend package which is a part of sttools', "flushend.sty");
4749
assertFound('! Package isodate.sty Error: Package file substr.sty not found.', "substr.sty");
4850
assertFound("! Package fontenc Error: Encoding file `t2aenc.def' not found.", "t2aenc.def");
4951
assertFound("! I can't find file `hyph-de-1901.ec.tex'.", "hyph-de-1901.ec.tex");
52+
assertFound("! I can't find file 'hyph-de-1901.ec.tex'.", "hyph-de-1901.ec.tex");
5053
assertFound("luaotfload-features.lua:835: module 'lua-uni-normalize' not found:", "lua-uni-algos.lua");
5154
assertFound("! LuaTeX-ja error: File 'jfm-zh_CN.lua' not found.", "jfm-zh_CN.lua");
5255

@@ -55,12 +58,14 @@ unitTest("Detect missing files with `findMissingFontsAndPackages`", async () =>
5558
assertFound('xdvipdfmx:fatal: Unable to find TFM file "rsfs10"', fontSearchTerm("rsfs10"));
5659
assertFound("Package biblatex Info: ... file 'trad-abbrv.bbx' not found", "trad-abbrv.bbx");
5760
assertFound("! Package pdftex.def Error: File `logo-mdpi-eps-converted-to.pdf' not found", "epstopdf");
61+
assertFound("! Package pdftex.def Error: File 'logo-mdpi-eps-converted-to.pdf' not found", "epstopdf");
5862
assertFound("! xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object.", "epstopdf");
5963
assertFound(
6064
"! Package tikz Error: I did not find the tikz library 'hobby'. This error message was issued because the library or one of its sublibraries could not be found, probably because of a misspelling. Processed options: \"library={hobby}\". The possibly misspelled library name is \"hobby\". The library name should be one of the following (or you misspelled it): named tikzlibraryhobby.code.tex",
6165
"tikzlibraryhobby.code.tex"
6266
);
6367
assertFound("support file `supp-pdf.mkii' (supp-pdf.tex) is missing", "supp-pdf.mkii");
68+
assertFound("support file 'supp-pdf.mkii' (supp-pdf.tex) is missing", "supp-pdf.mkii");
6469
assertFound("! Package pdfx Error: No color profile sRGB_IEC61966-2-1_black_scaled.icc found", "colorprofiles.sty");
6570
assertFound("No file LGRcmr.fd. ! LaTeX Error: This NFSS system isn't set up properly.", "lgrcmr.fd");
6671
},{

0 commit comments

Comments
 (0)