latex-pdf
Installation
SKILL.md
LaTeX PDF Generator
Generate professional PDF documents by writing a Python script that constructs LaTeX source strings and compiles them to PDF using Tectonic. No TeX distribution installation required — Tectonic auto-downloads packages on first use.
Approach
- Python script builds LaTeX content as a string using f-strings/concatenation
- Write the string to a
.texfile - Compile with
tectonic <file>.tex→ produces.pdfin the same directory
This approach is preferred over HTML-to-PDF or JS-based PDF libraries because LaTeX produces typographically superior output with precise control over layout, tables, math, headers/footers, and page breaks.
When NOT to use LaTeX:
- Presentations / slide decks — LaTeX produces ugly, hard-to-brand slides. Use the
image-from-htmlskill instead (HTML/CSS slides → Chrome headless → PNG → PDF). HTML gives pixel-perfect brand control that LaTeX can't match. - Branded marketing materials — posters, social graphics, flyers. Use
image-from-htmlfor exact brand guideline matching.
When to use LaTeX:
- Reports, invoices, CVs, academic papers, data-heavy documents with tables and statistics — anything that benefits from precise typographic control over text-heavy content.