Which Compiler Is Used for Cover Letters in AI Job Search
The AI Job Search repository uses xelatex to compile cover letters because the custom cover.cls class requires the fontspec package to load modern fonts like Lato and Raleway.
The MadsLorentzen/ai-job-search project automates job application workflows, including the generation of tailored cover letters through LaTeX templates. Understanding which compiler is used for cover letters in AI Job Search ensures your local environment matches the repository's build pipeline and avoids font-related compilation errors.
Why XeLaTeX Is Required for Cover Letters
The default cover letter template depends on cover.cls, a custom class file located at cover_letters/cover.cls. This class utilizes the fontspec package to embed system fonts (specifically Lato and Raleway), which mandates a Unicode-aware LaTeX engine. According to the source code analysis, xelatex is the designated compiler because it natively supports fontspec and modern font handling without requiring legacy font encodings.
Documentation in SETUP.md
The setup guide explicitly states the compiler requirement. In SETUP.md (section covering LaTeX dependencies), the documentation notes that "the cover letter compiles with xelatex because cover.cls requires fontspec" (line 53). This file serves as the primary reference for environment configuration and dependency installation.
The Cover Example Template
The minimal working example at cover_letters/cover_example.tex contains an inline comment confirming the build requirement: the file "must always compile with xelatex" (line 6). This template functions as the reference implementation and is used in continuous integration to validate the compilation pipeline.
How to Compile Cover Letters Locally
To generate PDF cover letters that match the repository's output, you must invoke xelatex with non-interactive flags suitable for automation.
Basic Compilation Command
From the repository root, execute:
cd cover_letters
xelatex -interaction=nonstopmode cover_example.tex
The -interaction=nonstopmode flag prevents the compiler from halting on minor warnings, ensuring unattended builds complete successfully. This command produces a single-page PDF that respects the font specifications defined in cover.cls.
Compiling Custom Cover Letters
For company-specific outputs generated by the application assistant:
cd cover_letters
xelatex -interaction=nonstopmode -halt-on-error cover_<company>_<role>.tex
The -halt-on-error option is recommended in CI environments to ensure that font loading failures or missing dependencies cause immediate build termination rather than incomplete PDF generation.
CI/CD Validation
The GitHub Actions workflow at .github/workflows/ci.yml enforces the compiler choice through automated smoke testing. Lines 154-157 execute xelatex against the example cover letter to verify that the template remains compilable after code changes:
- name: Compile cover letter example (xelatex)
run: |
cd cover_letters
xelatex -interaction=nonstopmode -halt-on-error cover_example.tex
This validation ensures that environment drift or font package updates do not break the cover letter generation pipeline.
Custom Templates vs. Stock Templates
While the stock template strictly requires xelatex, the architecture supports alternative compilers for user-defined templates. According to .claude/skills/job-application-assistant/06-cover-letter-templates.md, templates registered via the /add-template command may specify custom compile commands. However, the default implementation—which generates cover letters using the built-in cover.cls—always invokes xelatex to satisfy the fontspec dependency.
Summary
- XeLaTeX is required for all stock cover letters due to the
fontspecdependency incover_letters/cover.cls. - Documentation is explicit about this requirement in
SETUP.mdand inline comments withincover_letters/cover_example.tex. - CI pipelines validate compilation using
xelatexin.github/workflows/ci.ymlto ensure build integrity. - Local builds should mirror CI by using
xelatex -interaction=nonstopmodeto avoid font loading errors. - Custom templates may use alternative compilers, but the default workflow strictly enforces
xelatex.
Frequently Asked Questions
Can I use pdfLaTeX instead of XeLaTeX for cover letters?
No. The stock cover.cls file requires the fontspec package to load the Lato and Raleway font families, which is incompatible with pdfLaTeX. Attempting to compile with pdflatex will result in fatal errors regarding font encoding and package loading.
Where is the compiler requirement defined in the codebase?
The requirement appears in three critical locations: SETUP.md explains the technical dependency on fontspec, cover_letters/cover_example.tex contains a mandatory compilation comment, and .github/workflows/ci.yml enforces the requirement through automated smoke tests that execute xelatex against the example template.
Does the repository support LuaLaTeX for cover letters?
While fontspec technically functions with LuaLaTeX, the repository specifically configures, tests, and validates with xelatex. Using LuaLaTeX may produce valid output but is not verified in the continuous integration pipeline and may behave differently regarding font rendering.
How do I compile a cover letter if I modified the default template?
If you maintain a custom template that does not rely on fontspec, you can specify an alternative compiler during the build process. However, if your modifications still utilize cover_letters/cover.cls, you must continue using xelatex to ensure the modern font packages load correctly and the output matches the expected single-page format.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →