saitejatirunagari Claude Opus 4.8 commited on
Commit
29baf71
·
1 Parent(s): e2b8b62

fix: Tectonic sanitizer regex must require uppercase after fa

Browse files

The fa-strip regex matched familydefault, fancyhf, fancyfoot (all begin
with fa), corrupting the preamble and causing a Missing begin-document
error (the next failure after the segfault was fixed). fontawesome icons
are fa + UPPERCASE, so the regex now requires an uppercase letter.
Regenerated the sanitized warmup asset; verified familydefault, fancyhf,
fancyfoot and begin-document survive while faPhone and fontawesome5 are
removed. Tests 11/11.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

assets/default_resume.tectonic.tex CHANGED
@@ -49,14 +49,14 @@
49
 
50
  % custom font: helvetica-style (tgheros substituted with helvet)
51
  \usepackage{helvet}
52
- \renewcommand*{\sfdefault}
53
  %% Only if the base font of the document is to be sans serif
54
  \usepackage[T1]{fontenc}
55
 
56
 
57
  \pagestyle{fancy}
58
- {} % clear all header and footer fields
59
- {}
60
  \renewcommand{\headrulewidth}{0pt}
61
  \renewcommand{\footrulewidth}{0pt}
62
 
 
49
 
50
  % custom font: helvetica-style (tgheros substituted with helvet)
51
  \usepackage{helvet}
52
+ \renewcommand*\familydefault{\sfdefault}
53
  %% Only if the base font of the document is to be sans serif
54
  \usepackage[T1]{fontenc}
55
 
56
 
57
  \pagestyle{fancy}
58
+ \fancyhf{} % clear all header and footer fields
59
+ \fancyfoot{}
60
  \renewcommand{\headrulewidth}{0pt}
61
  \renewcommand{\footrulewidth}{0pt}
62
 
src/latex_resume.py CHANGED
@@ -615,7 +615,13 @@ def ensure_compilable_document(src: str) -> str:
615
  # full TeXLive handles it; Tectonic crashes. We therefore strip the OTF/exotic-font
616
  # loaders from the COMPILED copy only. The downloadable `.tex` (report["tex"]) keeps
617
  # the full design so the user still gets icons + FiraMono in Overleaf.
618
- _FA_CMD_RE = re.compile(r"\\fa[A-Za-z]+\*?")
 
 
 
 
 
 
619
 
620
 
621
  def _sanitize_for_tectonic(src: str) -> str:
 
615
  # full TeXLive handles it; Tectonic crashes. We therefore strip the OTF/exotic-font
616
  # loaders from the COMPILED copy only. The downloadable `.tex` (report["tex"]) keeps
617
  # the full design so the user still gets icons + FiraMono in Overleaf.
618
+ #
619
+ # fontawesome icon commands are `\fa` + an UPPERCASE letter (camelCase): \faPhone,
620
+ # \faEnvelope, \faGlobe, \faRupeeSign. The uppercase requirement is CRITICAL so we
621
+ # DON'T also eat lowercase `\fa…` macros that the template needs —
622
+ # `\familydefault`, `\fancyhf`, `\fancyfoot` — which would corrupt the preamble and
623
+ # cause "Missing \begin{document}".
624
+ _FA_CMD_RE = re.compile(r"\\fa[A-Z][A-Za-z]*\*?")
625
 
626
 
627
  def _sanitize_for_tectonic(src: str) -> str: