From 113bb52bdbc861e23a6b3ccce69395be2ab1199f Mon Sep 17 00:00:00 2001 From: Atri Bhattacharya Date: Fri, 15 Mar 2024 04:58:45 +0530 Subject: [PATCH] fix: Ensure correct package name for public fonts. Use re.search, not re.match, to get the correct package name for fonts in the 'public' dir. re.match only searches for a match at the beginning of the string, which is _never_ where the '/public/.*/' pattern appears. --- src/tartex/_latex.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tartex/_latex.py b/src/tartex/_latex.py index 61f338a..8f3831a 100644 --- a/src/tartex/_latex.py +++ b/src/tartex/_latex.py @@ -22,7 +22,7 @@ INPUT_RE = re.compile(r"^INPUT") INPUT_STY = re.compile(r"^INPUT\s.*.(cls|def|sty)") INPUT_FONTS = re.compile(r"^INPUT\s.*.(pfb|tfm)") -FONT_PUBLIC = re.compile(r"\/public\/.*\/") +FONT_PUBLIC = re.compile(r"/public/.*/") def run_latexmk(filename, mode, compdir): @@ -102,7 +102,9 @@ def fls_input_files(fls_fileobj, lof_excl, skip_files, *, sty_files=False): p = Path(line.split()[-1]) if p.is_absolute(): try: - fontdir = FONT_PUBLIC.match(str(p)).split("/")[2] + fontdir = ( + FONT_PUBLIC.search(str(p)).group(0).split("/")[2] + ) except AttributeError: fontdir = p.parent.name pkgs["System"].add(fontdir)