mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 08:36:25 +00:00
fix(latex): brace bracket-leading bullets, document escapes, pin pdftotext encoding
Three findings from the 2026-08-19 review (F9, F31, F34):
- F9: every placeholder bullet written as \item [text] let LaTeX parse
the bracketed text as the item's optional label, rendering it clipped
off the left page edge and absent from the PDF text layer ("Achievement"
appeared 9 times in cv/main_example.tex and 0 times in the extraction,
with a clean compile and green CI). Bullets are now braced as
\item {[text]} in the example CV and in the template
06-cover-letter-templates.md teaches, and CI's stock PDF assertions
additionally require "Achievement" to survive pdftotext.
- F31: 05-cv-templates.md gains a "LaTeX Special Characters" section and
06's is completed beyond \_ and \&. The load-bearing case is an
unescaped % in a quantified achievement bullet: it starts a LaTeX
comment and silently deletes the rest of the line from the PDF.
- F34: the documented ATS extraction commands (apply.md,
05-cv-templates.md, CLAUDE.md) now carry -enc UTF-8. Xpdf-based
pdftotext builds default to Latin-1 output, so a correct non-ASCII CV
failed the replacement-character parseability check.
framework_version: 05-cv-templates.md 1.4.1 -> 1.4.2,
06-cover-letter-templates.md 1.0.1 -> 1.0.2. All three pinned by the new
tests/test_latex_guidance.py (9 tests; suite now 261).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
40022dd8b9
commit
b2545d5121
@@ -1,5 +1,5 @@
|
||||
---
|
||||
framework_version: 1.4.1
|
||||
framework_version: 1.4.2
|
||||
---
|
||||
|
||||
# CV Templates and Tailoring Guide
|
||||
@@ -211,6 +211,27 @@ Wherever the CV names a verifiable artifact - a public project, a hackathon entr
|
||||
- End with: "More references are available upon request."
|
||||
- **Do not attach reference letters** - employers typically contact references directly
|
||||
|
||||
### LaTeX Special Characters (important)
|
||||
|
||||
Postings and profile data arrive as plain text; the CV is LaTeX. Escape these wherever they land in body text - company names, achievement bullets, skill lists:
|
||||
|
||||
| Character | Write | Typical trigger |
|
||||
|---|---|---|
|
||||
| `&` | `\&` | company names: Bang \& Olufsen, Brüel \& Kjær, H\&M |
|
||||
| `%` | `\%` | quantified achievements: "cut latency by 40\%" |
|
||||
| `$` | `\$` | salary and cost figures |
|
||||
| `#` | `\#` | "ranked \#1", C\# |
|
||||
| `_` | `\_` | file names, code identifiers |
|
||||
| `~` | `\textasciitilde{}` | URLs, "approx. 5 years" tildes |
|
||||
| `^` | `\textasciicircum{}` | version strings, math |
|
||||
|
||||
Two failure modes deserve special care:
|
||||
|
||||
- **`%` fails silently.** An unescaped `%` starts a LaTeX comment: the compile succeeds with zero errors, and everything after the `%` on that line vanishes from the PDF. `Cut inference latency by 40% and saved DKK 2M annually` renders as "Cut inference latency by 40" - the bullet keeps its impressive-looking fragment and loses the actual result. Quantified achievement bullets are exactly where the guidance steers you ("use numbers where possible"), so check every `%` in every bullet before compiling.
|
||||
- **`&` fails loudly** inside `\cventry` (alignment-tab errors, `Missing } inserted`). The compile loop catches it, but escape employer names up front rather than debugging the compile.
|
||||
|
||||
Related trap: a bullet whose text begins with a literal `[` must be braced - `\item {[text]}` - or LaTeX parses the bracketed text as `\item`'s optional label and renders it clipped off the left page edge with a clean compile. The example CV's placeholder bullets are braced for exactly this reason.
|
||||
|
||||
## Compile-and-Inspect Loop (MANDATORY)
|
||||
|
||||
After writing the CV and before presenting to the user, always compile and visually inspect the PDF. Iterate until the layout is clean. Workflow:
|
||||
@@ -246,10 +267,10 @@ Restore the highest-relevance item that was previously cut — a CV that ends mi
|
||||
Most employers run CVs through an ATS before a human sees them, and the ATS reads the PDF's embedded **text layer**, not the rendered page. A CV can pass visual inspection and still extract as garbage. After the layout passes the compile-and-inspect loop, verify the text layer:
|
||||
|
||||
```bash
|
||||
cd cv && pdftotext -layout main_<company>_<role>.pdf main_<company>_<role>.txt
|
||||
cd cv && pdftotext -layout -enc UTF-8 main_<company>_<role>.pdf main_<company>_<role>.txt
|
||||
```
|
||||
|
||||
`pdftotext` comes from [poppler](https://poppler.freedesktop.org/), not the TeX distribution - it is an **optional** dependency. If it is not installed, skip the mechanical check with a warning and rely on the visual PDF read for keyword coverage.
|
||||
`pdftotext` comes from [poppler](https://poppler.freedesktop.org/), not the TeX distribution - it is an **optional** dependency. The `-enc UTF-8` flag is not optional: Xpdf-based `pdftotext` builds default to Latin-1 output, which makes every non-ASCII character in a perfectly good CV read back as a replacement character and fail the parseability check below for no real reason. If it is not installed, skip the mechanical check with a warning and rely on the visual PDF read for keyword coverage.
|
||||
|
||||
What to check in the extraction:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user