mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 00:26:26 +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
@@ -254,12 +254,12 @@ Do not proceed to Step 6 until both PDFs pass inspection.
|
||||
|
||||
An ATS parser reads the PDF's embedded **text layer**, not the rendered page — a CV that passed visual inspection can still extract as garbage (icon glyphs where the contact details should be, scrambled reading order in multi-column layouts). This step verifies what a parser actually sees. It applies to the **CV only**; cover letters rarely go through keyword screening.
|
||||
|
||||
**Availability check:** run `pdftotext -v`. `pdftotext` (poppler) is an optional dependency, not part of TeX distributions. If it is missing, print a one-line warning that the mechanical parse check is skipped, do the keyword-coverage check (item 3 below) against your visual Read of the PDF instead, and note the degraded mode in the Step 6 report. Same graceful-skip pattern as the salary lookup.
|
||||
**Availability check:** run `pdftotext -v`. `pdftotext` (poppler) is an optional dependency, not part of TeX distributions. If it is missing, print a one-line warning that the mechanical parse check is skipped, do the keyword-coverage check (item 3 below) against your visual Read of the PDF instead, and note the degraded mode in the Step 6 report. Same graceful-skip pattern as the salary lookup. Keep the `-enc UTF-8` flag: Xpdf-based builds default to Latin-1 output, and without it a correct non-ASCII CV fails the replacement-character check below.
|
||||
|
||||
**1. Extract 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
|
||||
```
|
||||
|
||||
Read the `.txt` file.
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
framework_version: 1.0.1
|
||||
framework_version: 1.0.2
|
||||
---
|
||||
|
||||
# Cover Letter Templates and Tailoring Guide
|
||||
@@ -92,9 +92,9 @@ The font wrapper is mandatory — if you just move `\begin{itemize}` outside `\l
|
||||
|
||||
{\raggedright\fontspec[Path = OpenFonts/fonts/raleway/]{Raleway-Medium}\fontsize{11pt}{13pt}\selectfont
|
||||
\begin{itemize}
|
||||
\item [Concrete achievement/skill 1]
|
||||
\item [Concrete achievement/skill 2]
|
||||
\item [Concrete achievement/skill 3]
|
||||
\item {[Concrete achievement/skill 1]}
|
||||
\item {[Concrete achievement/skill 2]}
|
||||
\item {[Concrete achievement/skill 3]}
|
||||
\end{itemize}\par}
|
||||
|
||||
\lettercontent{[Connection to company - why this role, why this company specifically]}
|
||||
@@ -146,10 +146,14 @@ The font wrapper is mandatory — if you just move `\begin{itemize}` outside `\l
|
||||
- 3-5 bullets is ideal
|
||||
- Start each bullet with bold label or action verb
|
||||
- Use `\textbf{Label:}` for category-style bullets
|
||||
- A bullet whose text begins with a literal `[` must be braced: `\item {[text]}`. Unbraced, LaTeX parses `[text]` as `\item`'s optional label and renders it off the left page edge, missing from the PDF text layer entirely
|
||||
|
||||
### LaTeX Special Characters
|
||||
- Underscore: `\_`
|
||||
- Ampersand: `\&`
|
||||
Escape these wherever they appear in body text:
|
||||
- Ampersand: `\&` (company names: Brüel \& Kjær, H\&M) - unescaped, the compile fails loudly
|
||||
- Percent: `\%` ("grew revenue 30\%") - unescaped, it does **not** fail: everything after the `%` on that line is silently eaten as a LaTeX comment
|
||||
- Dollar: `\$`, hash: `\#`, underscore: `\_`
|
||||
- Tilde: `\textasciitilde{}`, caret: `\textasciicircum{}`, backslash: `\textbackslash{}`
|
||||
|
||||
### Non-English Cover Letters
|
||||
- Same template structure, just write content in the posting's language
|
||||
|
||||
Reference in New Issue
Block a user