Skip to content
Back to search

latex-document-skill

SkillWorks with Claude CodeGitHub

Universal LaTeX document skill: create, compile, and convert any document to professional PDF with PNG previews. Supports resumes, reports, cover letters, invoices, academic papers, theses/dissertations, academic CVs, presentations (Beamer), scientific posters, formal letters, exams/quizzes, books, cheat sheets, reference cards, exam formula sheets, fillable PDF forms (hyperref form fields), conditional content (etoolbox toggles), mail merge from CSV/JSON (Jinja2 templates), version diffing (latexdiff), charts (pgfplots + matplotlib), tables (booktabs + CSV import), images (TikZ), Mermaid diagrams, AI-generated images, watermarks, landscape pages, bibliography/citations (BibTeX/biblatex), multi-language/CJK (auto XeLaTeX), algorithms/pseudocode, colored boxes (tcolorbox), SI units (siunitx), Pandoc format conversion (Markdown/DOCX/HTML ↔ LaTeX), and PDF-to-LaTeX conversion of handwritten or printed documents (math, business, legal, general). Compile script supports pdflatex, xelatex, lualatex with auto-detection, latexmk backend, texfot log filtering, PDF/A output, and verbosity control (--verbose/--quiet). Empirically optimized scaling: single agent 1-10 pages, split 11-20, batch-7 pipeline 21+. Use when user asks to: (1) create a resume/CV/cover letter, (2) write a LaTeX document, (3) create PDF with tables/charts/images, (4) compile a .tex file, (5) make a report/invoice/presentation, (6) anything involving LaTeX or pdflatex, (7) convert/OCR a PDF to LaTeX, (8) convert handwritten notes, (9) create charts/graphs/diagrams, (10) create slides, (11) write a thesis or dissertation, (12) create an academic CV, (13) create a poster, (14) create an exam/quiz, (15) create a book, (16) convert between document formats (Markdown, DOCX, HTML to/from LaTeX), (17) generate Mermaid diagrams for LaTeX, (18) create a formal business letter, (19) create a cheat sheet or reference card, (20) create an exam formula sheet or crib sheet, (21) condense lecture notes/PDFs into a cheat sheet, (22) create a fillable PDF form with text fields/checkboxes/dropdowns, (23) create a document with conditional content/toggles (show/hide sections), (24) generate batch/mail-merge documents from CSV/JSON data, (25) create a version diff PDF (latexdiff) highlighting changes between documents, (26) create a homework or assignment submission with problems and solutions, (27) create a lab report with data tables, graphs, and error analysis, (28) encrypt or password-protect a PDF, (29) merge multiple PDFs into one, (30) optimize/compress a PDF for web or email, (31) lint or check a LaTeX document for common issues, (32) count words in a LaTeX document, (33) analyze document statistics (figures, tables, citations), (34) fetch BibTeX from a DOI, (35) convert a Graphviz .dot file to PDF/PNG, (36) convert a PlantUML .puml file to PDF/PNG, (37) create a one-pager/fact sheet/executive summary, (38) create a datasheet or product specification sheet, (39) extract pages from a PDF (page ranges, odd/even), (40) check LaTeX package availability before compiling, (41) analyze citations and cross-reference with .bib files, (42) debug LaTeX compilation errors, (43) make a document accessible (PDF/A, tagged PDF), (44) create lecture notes or course handouts, (45) fill an existing PDF form (fillable fields or non-fillable with annotations), (46) extract text or tables from a PDF (pdfplumber, pypdf), (47) OCR a scanned PDF to text (pytesseract), (48) create a PDF programmatically with reportlab (Canvas, Platypus), (49) rotate or crop PDF pages (pypdf), (50) add a watermark to an existing PDF, (51) extract metadata from a PDF (title, author, subject).

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/ndpvt-web/latex-document-skill with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/ndpvt-web/latex-document-skill'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ndpvt-web--latex-document-skill/badge.svg)](/listings/ndpvt-web--latex-document-skill)

HTML

<a href="/listings/ndpvt-web--latex-document-skill"><img src="/api/listings/ndpvt-web--latex-document-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

# Install as a Claude Code skill
cp -r latex-document ~/.claude/skills/

# Or run full dependency setup
bash setup.sh            # Installs: TeX Live, Poppler, ImageMagick, Pandoc, Python deps
bash setup.sh --check    # Verify everything is installed

**System dependencies** (auto-installed by `setup.sh` on Debian/macOS/Fedora/Alpine/Arch): - **TeX Live** -- pdflatex, xelatex, lualatex, biber, makeindex, makeglossaries - **Poppler** -- `pdftoppm` for PNG previews, `pdfinfo` for page counts - **ImageMagick** -- `mogrify` for image resizing, `identify` for dimensions - **Pandoc** -- format conversion engine - **Python 3** + `matplotlib`, `numpy`, `pandas` - **qpdf** -- PDF encryption, merging, optimization, page extraction

**Optional:** - **Node.js 18+** -- for Mermaid diagram conversion - **Java** -- for PlantUML rendering - **Graphviz** -- for `.dot` diagram rendering - **chktex** -- for LaTeX linting - **latexdiff** -- for version diffing

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 416 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. ---
  2. name: latex-document-skill
  3. description: >
  4. Universal LaTeX document skill: create, compile, and convert any document to
  5. professional PDF with PNG previews. Supports resumes, reports, cover letters,
  6. invoices, academic papers, theses/dissertations, academic CVs, presentations
  7. (Beamer), scientific posters, formal letters, exams/quizzes, books,
  8. cheat sheets, reference cards, exam formula sheets,
  9. fillable PDF forms (hyperref form fields), conditional content (etoolbox toggles),
  10. mail merge from CSV/JSON (Jinja2 templates), version diffing (latexdiff),
  11. charts (pgfplots + matplotlib), tables (booktabs + CSV import), images (TikZ),
  12. Mermaid diagrams, AI-generated images, watermarks, landscape pages,
  13. bibliography/citations (BibTeX/biblatex), multi-language/CJK (auto XeLaTeX),
  14. algorithms/pseudocode, colored boxes (tcolorbox), SI units (siunitx),
  15. Pandoc format conversion (Markdown/DOCX/HTML ↔ LaTeX),
  16. and PDF-to-LaTeX conversion of handwritten or printed documents (math, business,
  17. legal, general). Compile script supports pdflatex, xelatex, lualatex with
  18. auto-detection, latexmk backend, texfot log filtering, PDF/A output, and
  19. verbosity control (--verbose/--quiet). Empirically optimized scaling: single agent 1-10 pages, split
  20. 11-20, batch-7 pipeline 21+. Use when user asks to: (1) create a resume/CV/cover
  21. letter, (2) write a LaTeX document, (3) create PDF with tables/charts/images,
  22. (4) compile a .tex file, (5) make a report/invoice/presentation, (6) anything
  23. involving LaTeX or pdflatex, (7) convert/OCR a PDF to LaTeX, (8) convert
  24. handwritten notes, (9) create charts/graphs/diagrams, (10) create slides,
  25. (11) write a thesis or dissertation, (12) create an academic CV, (13) create
  26. a poster, (14) create an exam/quiz, (15) create a book, (16) convert between
  27. document formats (Markdown, DOCX, HTML to/from LaTeX), (17) generate Mermaid
  28. diagrams for LaTeX, (18) create a formal business letter, (19) create a cheat
  29. sheet or reference card, (20) create an exam formula sheet or crib sheet,
  30. (21) condense lecture notes/PDFs into a cheat sheet,
  31. (22) create a fillable PDF form with text fields/checkboxes/dropdowns,
  32. (23) create a document with conditional content/toggles (show/hide sections),
  33. (24) generate batch/mail-merge documents from CSV/JSON data,
  34. (25) create a version diff PDF (latexdiff) highlighting changes between documents,
  35. (26) create a homework or assignment submission with problems and solutions,
  36. (27) create a lab report with data tables, graphs, and error analysis,
  37. (28) encrypt or password-protect a PDF,
  38. (29) merge multiple PDFs into one,
  39. (30) optimize/compress a PDF for web or email,
  40. (31) lint or check a LaTeX document for common issues,
  41. (32) count words in a LaTeX document,
  42. (33) analyze document statistics (figures, tables, citations),
  43. (34) fetch BibTeX from a DOI,
  44. (35) convert a Graphviz .dot file to PDF/PNG,
  45. (36) convert a PlantUML .puml file to PDF/PNG,
  46. (37) create a one-pager/fact sheet/executive summary,
  47. (38) create a datasheet or product specification sheet,
  48. (39) extract pages from a PDF (page ranges, odd/even),
  49. (40) check LaTeX package availability before compiling,
  50. (41) analyze citations and cross-reference with .bib files,
  51. (42) debug LaTeX compilation errors,
  52. (43) make a document accessible (PDF/A, tagged PDF),
  53. (44) create lecture notes or course handouts,
  54. (45) fill an existing PDF form (fillable fields or non-fillable with annotations),
  55. (46) extract text or tables from a PDF (pdfplumber, pypdf),
  56. (47) OCR a scanned PDF to text (pytesseract),
  57. (48) create a PDF programmatically with reportlab (Canvas, Platypus),
  58. (49) rotate or crop PDF pages (pypdf),
  59. (50) add a watermark to an existing PDF,
  60. (51) extract metadata from a PDF (title, author, subject).
  61. ---
  62. # LaTeX Document Skill
  63. Create any LaTeX document, compile to PDF, and generate PNG previews. Convert PDFs of any type to LaTeX.
  64. ## Workflow: Create Documents
  65. 1. Determine document type (resume, report, letter, invoice, article, thesis, academic CV, presentation, poster, exam, book, cheat sheet)
  66. 2. **If the target is an IEEE journal / Transactions / IEEE two-column paper:** Read [references/ieee-journal-twocolumn-guide.md](references/ieee-journal-twocolumn-guide.md) before choosing a template. Start from `examples/ieee-twocolumn-sample.tex` for a working IEEEtran baseline and use `examples/ieee-twocolumn.png` / `examples/ieee-twocolumn-p1.png` / `examples/ieee-twocolumn-p2.png` as visual references.
  67. 3. **If poster:** Run the poster sub-workflow (see [Poster Sub-Workflow](#poster-sub-workflow) below), then skip to step 5.
  68. 4. **If cheat sheet / reference card:** Run the cheat sheet sub-workflow (see [Cheat Sheet / Reference Card Sub-Workflow](#cheat-sheet--reference-card-sub-workflow) below), then skip to step 5.
  69. 5. **Ask the user which enrichment elements they want** (use AskUserQuestion tool with multiSelect). Offer relevant options based on document type:
  70. - **AI-generated images** -- custom illustrations, diagrams, photos (uses generate-image skill)
  71. - **Charts/graphs** -- bar, line, pie, scatter, heatmap (pgfplots or matplotlib)
  72. - **Flowcharts/diagrams** -- process flows, architecture, decision trees (TikZ or Mermaid)
  73. - **Citations/bibliography** -- academic references, footnotes, works cited (BibTeX/biblatex)
  74. - **Tables with data** -- comparison matrices, financial data, statistics (booktabs)
  75. - **Watermarks** -- DRAFT, CONFIDENTIAL, or company logo background
  76. - Skip this step for simple documents (cover letters, invoices) or when the user has already specified exactly what they want.
  77. 6. Copy the appropriate template from `assets/templates/` or write from scratch
  78. 7. Customize content based on user requirements
  79. 8. Generate external assets based on user's element choices:
  80. - AI images: `python3 <skill_path>/../generate-image/scripts/generate_image.py "prompt" --output ./outputs/figure.png`
  81. - matplotlib charts: `python3 <skill_path>/scripts/generate_chart.py <type> --data '<json>' --output chart.png`
  82. - Mermaid diagrams: `bash <skill_path>/scripts/mermaid_to_image.sh diagram.mmd output.png`
  83. 9. **For documents 5+ pages:** Review the [Long-Form Document Anti-Patterns](#long-form-document-anti-patterns-must-read-for-reports-theses-books) section and run the Content Generation Checklist before compiling. Key rules: prefer prose over bullets, include global list compaction, escape `<`/`>` in text mode, vary section formats, limit `\newpage`, size images at 0.75-0.85 textwidth.
  84. 10. Compile with `scripts/compile_latex.sh` (auto-detects XeLaTeX for CJK/RTL, glossaries, bibliography)
  85. 11. Show PNG preview to user, deliver PDF
  86. ### Poster Sub-Workflow
  87. When the user requests a poster: read [references/poster-design-guide.md](references/poster-design-guide.md) for the complete workflow including conference size presets (NeurIPS/ICML/CVPR/ICLR dimensions), layout archetypes (Traditional/BetterPoster/Visual-Heavy), color schemes, and typography standards. Use `poster.tex` (portrait) or `poster-landscape.tex` (landscape). Ask the user for conference/orientation, layout style, and color scheme using AskUserQuestion, then proceed to step 5.
  88. ### Cheat Sheet / Reference Card Sub-Workflow
  89. When the user requests a cheat sheet, reference card, or formula sheet:
  90. 1. Read [references/cheatsheet-guide.md](references/cheatsheet-guide.md) for the complete workflow including template selection, content budgets, typography rules, and the PDF-to-cheatsheet pipeline.
  91. 2. Select template: `cheatsheet.tex` (general, 3-col landscape), `cheatsheet-exam.tex` (exam formula, 2-col portrait), or `cheatsheet-code.tex` (programming, 4-col landscape).
  92. 3. Follow the guide's workflow steps, then return to main workflow step 5.
  93. ## Workflow: Mail Merge (Batch Personalized Documents)
  94. Generate N personalized documents from a LaTeX template + CSV/JSON data source using `scripts/mail_merge.py`. Template syntax: `{{variable}}` for simple substitution, Jinja2 (`<< >>`, `<% %>`) for conditionals/loops. See `assets/templates/mail-merge-letter.tex` for an example. Full guide: [references/interactive-features.md](references/interactive-features.md).
  95. ## Workflow: Version Diffing (latexdiff)
  96. Generate highlighted change-tracked PDFs using `scripts/latex_diff.sh`. Supports file-to-file diff, git revision diff, multi-file flatten, and custom markup styles. Full guide: [references/interactive-features.md](references/interactive-features.md).
  97. ## Workflow: Convert Document Formats
  98. Convert between Markdown, DOCX, HTML, and LaTeX using `scripts/convert_document.sh`. Full guide: [references/format-conversion.md](references/format-conversion.md).
  99. ## Workflow: Convert PDF to LaTeX
  100. Convert existing PDFs (handwritten notes, printed reports, legal docs) to LaTeX. Full pipeline: [references/pdf-conversion.md](references/pdf-conversion.md).
  101. **Quick steps**: Split PDF into page images (`scripts/pdf_to_images.sh`), select a conversion profile, create shared preamble, apply scaling strategy, validate with `scripts/validate_latex.py`, concatenate, compile.
  102. **Scaling strategy**: 1-10 pages = single agent; 11-20 pages = split in half (2 agents); 21+ pages = batch-7 pipeline (ceil(N/7) agents with `run_in_background: true`).
  103. **Conversion profiles** (in `references/profiles/`): `math-notes.md` (equations, theorems -- has beautiful mode), `business-document.md` (reports, memos), `legal-document.md` (contracts, statutes), `general-notes.md` (handwritten, mixed content).
  104. ## Workflow: Fill PDF Forms
  105. Fill existing PDF forms -- both fillable (with form fields) and non-fillable (image-based). Full guide: [references/pdf-operations.md](references/pdf-operations.md).
  106. **Step 1: Check form type:**
  107. ```bash
  108. python3 <skill_path>/scripts/pdf_check_form.py form.pdf
  109. ```
  110. **If fillable** (has form fields):
  111. ```bash
  112. # Extract field metadata
  113. python3 <skill_path>/scripts/pdf_extract_fields.py form.pdf field_info.json
  114. # Create field_values.json with values for each field, then fill
  115. python3 <skill_path>/scripts/pdf_fill_form.py form.pdf field_values.json output.pdf
  116. ```
  117. **If non-fillable** (no form fields):
  118. ```bash
  119. # Convert to images for visual analysis
  120. bash <skill_path>/scripts/pdf_to_images.sh form.pdf ./tmp/pages
  121. # Visually identify fields, create fields.json with bounding boxes
  122. # Validate bounding boxes (+ optional validation image)
  123. python3 <skill_path>/scripts/pdf_validate_boxes.py fields.json --image page_1.png --output validation.png --page 1
  124. # Fill with text annotations
  125. python3 <skill_path>/scripts/pdf_fill_annotations.py form.pdf fields.json output.pdf
  126. ```
  127. ## Workflow: Advanced PDF Operations
  128. For text/table extraction (pdfplumber), OCR (pytesseract), programmatic PDF creation (reportlab), watermarking, page rotation/cropping, metadata extraction, JavaScript libraries (pdf-lib, pdfjs-dist), and batch processing, see [references/pdf-operations.md](references/pdf-operations.md).
  129. ## Compile Script
  130. ```bash
  131. # Basic compile (auto-detects engine)
  132. bash <skill_path>/scripts/compile_latex.sh document.tex
  133. # Compile + generate PNG previews
  134. bash <skill_path>/scripts/compile_latex.sh document.tex --preview
  135. # Compile + PNG in specific directory
  136. bash <skill_path>/scripts/compile_latex.sh document.tex --preview --preview-dir ./outputs
  137. # Force a specific engine
  138. bash <skill_path>/scripts/compile_latex.sh document.tex --engine xelatex
  139. bash <skill_path>/scripts/compile_latex.sh document.tex --engine lualatex
  140. # Use latexmk for automatic multi-pass (recommended for complex documents)
  141. bash <skill_path>/scripts/compile_latex.sh document.tex --use-latexmk --preview
  142. # PDF/A output for thesis submissions and archival compliance
  143. bash <skill_path>/scripts/compile_latex.sh document.tex --pdfa
  144. # Verbose output for debugging compilation issues
  145. bash <skill_path>/scripts/compile_latex.sh document.tex --verbose
  146. # Quiet mode for batch/CI jobs (only errors shown)
  147. bash <skill_path>/scripts/compile_latex.sh document.tex --quiet
  148. # Clean auxiliary files only (no compilation)
  149. bash <skill_path>/scripts/compile_latex.sh document.tex --clean
  150. ```
  151. ### Compilation Flags
  152. | Flag | Description |
  153. |---|---|
  154. | `--preview` | Generate PNG previews of each page after compilation |
  155. | `--preview-dir DIR` | Directory for PNG output (default: same as .tex file) |
  156. | `--engine ENGINE` | Force engine: `pdflatex`, `xelatex`, or `lualatex` |
  157. | `--use-latexmk` | Use `latexmk` as compilation backend (auto multi-pass, bibliography, index) |
  158. | `--verbose` | Show full compilation output (all engine logs) |
  159. | `--quiet` | Suppress all non-error output |
  160. | `--clean` | Remove auxiliary files (.aux, .log, .bbl, .fdb_latexmk, etc.) and exit |
  161. | `--pdfa` | Produce PDF/A-2b compliant output (auto-injects `pdfx` package) |
  162. | `--auto-fix` | Auto-fix common compilation errors (float placement, encoding) |
  163. ### Compilation Backends
  164. **Manual multi-pass (default):** Runs the engine multiple times with bibliography/index/glossary passes as needed. This is the traditional approach and works without `latexmk` installed.
  165. **latexmk (`--use-latexmk`):** Uses `latexmk` for automatic dependency-driven compilation. Recommended for complex documents with bibliographies, indexes, glossaries, or cross-references -- latexmk determines the correct number of passes automatically. Requires `latexmk` (included with TeX Live).
  166. ### Log Filtering (texfot)
  167. When `texfot` is installed (included with TeX Live), compilation output is automatically filtered to show only relevant warnings and errors, suppressing noisy package loading messages. This applies in the default verbosity mode. Use `--verbose` to see unfiltered output, or `--quiet` to suppress all non-error output.
  168. **Engine auto-detection**: If the .tex file uses `fontspec`, `xeCJK`, or `polyglossia`, the script automatically uses `xelatex`. If it uses `luacode` or `luatextra`, it uses `lualatex`. Otherwise defaults to `pdflatex`. Override with `--engine`.
  169. The script auto-installs `texlive` (including `texlive-science`, `texlive-xetex`, `texlive-luatex`, `biber`) and `poppler-utils` if missing. It auto-detects `\bibliography{}` (runs bibtex), `\addbibresource{}` (runs biber), `\makeindex` (runs makeindex), `\makeglossaries` (runs makeglossaries), runs the correct number of passes, generates PNG previews with `pdftoppm`, and cleans auxiliary files.
  170. ## Script & Tool Reference
  171. For PDF utilities (encrypt, merge, optimize, extract pages, pdf-to-images), LaTeX quality tools (lint, word count, analysis, package check, citations), compilation auto-fix, bibliography fetching, and diagram scripts (Mermaid, Graphviz, PlantUML), see [references/script-tools.md](references/script-tools.md).
  172. ## Templates
  173. Copy from `assets/templates/` and customize.
  174. ### Resume Templates (5 ATS-Compatible Options)
  175. Select based on experience level, industry, and ATS requirements. See [references/resume-ats-guide.md](references/resume-ats-guide.md) for full ATS guidance.
  176. | Template | Best For | Key Feature | ATS Score |
  177. |---|---|---|---|
  178. | **`resume-classic-ats.tex`** | Finance, law, government, any ATS portal | Zero graphics, plain text only, maximum parse safety | 10/10 |
  179. | **`resume-modern-professional.tex`** | Tech, corporate, general professional | Subtle color accents, clean design, good ATS + human appeal | 9/10 |
  180. | **`resume-executive.tex`** | VP, Director, C-suite (5-15+ years) | Two-page, executive summary, board roles, P&L focus | 9/10 |
  181. | **`resume-technical.tex`** | Software, data, engineering roles | Skills-first hybrid, projects section, tech stack emphasis | 9/10 |
  182. | **`resume-entry-level.tex`** | New graduates, career starters | Education-first, one page, coursework, activities | 9/10 |
  183. All 5 templates follow ATS rules: single-column, no graphics/images, no tables for layout, standard section headings, contact info in body (not header/footer).
  184. ### STEM Student Templates
  185. - **`homework.tex`** -- Homework/assignment submission template (`article` class, 11pt) with toggle-able solutions (`\showsolutionstrue`/`\showsolutionsfalse`), custom problem/solution environments, honor code section, `fancyhdr` headers, `amsmath`+`amssymb`+`amsthm` math, `listings` code highlighting (Python, Java, C++, Matlab styles), `enumitem` for (a), (b), (c) sub-parts, `hyperref`. Customization via `\coursename`, `\assignmentnumber`, `\studentname`, `\studentid`, `\duedate`. Example problems: calculus, proof by induction, Python coding, matrix algebra, kinematics, Java OOP.
  186. - **`lab-report.tex`** -- STEM lab report template (`article` class, 11pt) with `siunitx` for uncertainties and SI units, `pgfplots` for data visualization, `booktabs` for professional tables, `amsmath` for equations, `fancyhdr` headers, `caption`+`subcaption` for figures. Structured sections: abstract, theory, procedure, data/results (with uncertainty tables), analysis (pgfplots graphs), discussion (error analysis), conclusion, references, appendix. Example: pendulum period measurement with error propagation.
  187. ### Other Templates
  188. - **`lecture-notes.tex`** -- Beautiful lecture notes (`scrartcl` KOMA-Script class) with Palatino font, `microtype` typography, color-coded `tcolorbox` theorem environments (blue theorems, green definitions, orange examples, purple remarks), TikZ graph theory diagram styles and macros (`\CompleteGraph`, `\CycleGraph`, `\PathGraph`), styled section headings with `titlesec`, `fancyhdr` headers, `hyperref` + `cleveref` navigation. Ideal for converting handwritten math/science notes to beautiful PDFs. Includes graph theory custom commands (`\V`, `\E`, `\deg`, `\chr`). Used by the math-notes conversion profile in beautiful mode.
  189. - **`thesis.tex`** -- Thesis/dissertation (`book` class) with title page, declaration, abstract, acknowledgments, TOC, list of figures/tables, chapters, appendices, bibliography. Front matter uses roman numerals, main matter uses arabic. Includes theorem environments.
  190. - **`academic-cv.tex`** -- Multi-page academic CV with publications (journal/conference/preprint sections), grants and funding, teaching, advising (current/graduated students), awards, professional service, invited talks. ORCID and Google Scholar links.
  191. - **`book.tex`** -- Full book (`book` class) with half-title, title page, copyright page, dedication, preface, acknowledgments, TOC, list of figures/tables, parts, chapters, appendix, bibliography, index. Custom chapter headings, epigraphs, fancyhdr, microtype.
  192. - **`poster.tex`** -- Conference poster (`tikzposter` class, A0 portrait) with 2-column layout, QR code, 5 color schemes, tikzfigure charts, tables, coloredbox highlights. Includes commented **#BetterPoster** layout variant (central billboard + sidebars). Portrait is standard for most conferences. See poster design guide for conference size presets.
  193. - **`poster-landscape.tex`** -- Landscape conference poster (`tikzposter` class, A0 landscape) with 3-column (30/40/30) layout, QR code, tech purple color scheme. For CS/ML conferences (NeurIPS, ICML, CVPR, ICLR). Includes commented `\geometry{}` presets for CVPR/NeurIPS custom sizes.
  194. - **`cheatsheet.tex`** -- General reference card (`extarticle` class, landscape A4, 7pt base font) with 3-column `multicols` layout, `tcolorbox` colored section boxes, tight spacing. For command references, concept summaries, quick-reference guides. Supports front+back printing.
  195. - **`cheatsheet-exam.tex`** -- Exam formula sheet (`extarticle` class, portrait A4, 6pt base font) with 2-column layout, maximum content density, black-and-white printer-safe. For university exam "allowed cheat sheets" with formulas, theorems, definitions. Optimized for single-sided printing.
  196. - **`cheatsheet-code.tex`** -- Programming reference card (`extarticle` class, landscape A4, 7pt base font) with 4-column layout, `minted` syntax highlighting, monospace font emphasis. For language syntax, API reference, CLI commands, keyboard shortcuts.
  197. - **`letter.tex`** -- Formal business letter with colored letterhead bar, TikZ logo placeholder, company info, recipient block, date, subject line, signature. Professional corporate appearance.
  198. - **`exam.tex`** -- Exam/quiz (`exam` class) with grading table, multiple question types (multiple choice, true/false, fill-in-blank, matching, short answer, essay), point values, solution toggle via `\printanswers`.
  199. - **`report.tex`** -- Business report with TOC, headers/footers, data tables, bar chart (pgfplots), process flowchart (TikZ), recommendations
  200. - **`cover-letter.tex`** -- Professional cover letter with sender/recipient blocks
  201. - **`invoice.tex`** -- Invoice with company header, line items table, subtotal/tax/total
  202. - **`academic-paper.tex`** -- Research paper with abstract, sections, bibliography, figures. Includes example `.bib` file (`references.bib`) for BibTeX citations.
  203. - **`examples/ieee-twocolumn-sample.tex`** -- IEEE Transactions / journal example using `\documentclass[journal,10pt]{IEEEtran}` with abstract, keywords, single-column figure, single-column table, full-width table, and numeric bibliography. Use with [references/ieee-journal-twocolumn-guide.md](references/ieee-journal-twocolumn-guide.md). Preview PNGs: `examples/ieee-twocolumn.png`, `examples/ieee-twocolumn-p1.png`, `examples/ieee-twocolumn-p2.png`.
  204. - **`presentation.tex`** -- Beamer presentation with title slide, content frames, columns
  205. - **`fillable-form.tex`** -- Fillable PDF form (`article` class) with hyperref form fields: text inputs, checkboxes, radio buttons, dropdowns, push buttons. Two-column layout with `tabularx`. Custom `\FormField`, `\FormCheck`, `\FormDropdown` helper commands. Requires Adobe Reader for full form support (browser PDF viewers have limited form capabilities).
  206. - **`conditional-document.tex`** -- Configurable document (`article` class) with etoolbox toggle system: show/hide TOC, appendix, watermark, draft mode, confidential marking, abstract. Template variables via `\providecommand` (title, author, org, version). Three visual profiles (corporate, academic, minimal). Supports command-line variable passing for CI/CD.
  207. - **`mail-merge-letter.tex`** -- Mail merge letter template with `{{variable}}` placeholders for use with `scripts/mail_merge.py`. Company-branded letterhead, recipient address block, body text with data-driven personalization. Pair with CSV/JSON data source.
  208. - **`resume.tex`** -- Legacy resume template (has photo area and tables -- not ATS-optimized)
  209. Usage:
  210. ```bash
  211. cp <skill_path>/assets/templates/resume-classic-ats.tex ./outputs/my_resume.tex
  212. # Edit content, then compile
  213. bash <skill_path>/scripts/compile_latex.sh ./outputs/my_resume.tex --preview --preview-dir ./outputs
  214. ```
  215. ## Document Type Selection
  216. | User Request | Template | Document Class |
  217. |---|---|---|
  218. | Resume, CV (ATS-safe) | `resume-classic-ats.tex` | `article` |
  219. | Resume (modern look) | `resume-modern-professional.tex` | `article` |
  220. | Resume (senior/executive) | `resume-executive.tex` | `article` |
  221. | Resume (technical/engineering) | `resume-technical.tex` | `article` |
  222. | Resume (new graduate) | `resume-entry-level.tex` | `article` |
  223. | Homework, assignment, problem set | `homework.tex` | `article` |
  224. | Lab report, experiment writeup | `lab-report.tex` | `article` |
  225. | Lecture notes, math notes (beautiful) | `lecture-notes.tex` | `scrartcl` |
  226. | Thesis, dissertation | `thesis.tex` | `book` |
  227. | Academic CV (publications, grants) | `academic-cv.tex` | `article` |
  228. | Report, analysis | `report.tex` | `article` |
  229. | Cover letter | `cover-letter.tex` | `article` |
  230. | Invoice | `invoice.tex` | `article` |
  231. | Academic paper | `academic-paper.tex` + `references.bib` | `article` |
  232. | IEEE journal, IEEE Transactions, IEEE two-column paper | `examples/ieee-twocolumn-sample.tex` + [ieee-journal-twocolumn-guide.md](references/ieee-journal-twocolumn-guide.md) | `IEEEtran` |
  233. | Book | `book.tex` | `book` |
  234. | Scientific poster (portrait) | `poster.tex` | `tikzposter` |
  235. | Scientific poster (landscape) | `poster-landscape.tex` | `tikzposter` |
  236. | Cheat sheet, reference card | `cheatsheet.tex` | `extarticle` |
  237. | Exam formula sheet, crib sheet | `cheatsheet-exam.tex` | `extarticle` |
  238. | Programming reference card | `cheatsheet-code.tex` | `extarticle` |
  239. | Formal business letter | `letter.tex` | `article` |
  240. | Exam, quiz, test | `exam.tex` | `exam` |
  241. | Slides, presentation | `presentation.tex` | `beamer` |
  242. | Fillable PDF form | `fillable-form.tex` | `article` |
  243. | Conditional/configurable document | `conditional-document.tex` | `article` |
  244. | Mail merge, batch letters | `mail-merge-letter.tex` + `scripts/mail_merge.py` | `article` |
  245. | **Version diff (latexdiff)** | Use `scripts/latex_diff.sh` + see [interactive-features.md](references/interactive-features.md) | varies |
  246. | **Convert PDF to LaTeX** | Select profile + see [pdf-conversion.md](references/pdf-conversion.md) | varies |
  247. | **Convert formats** | Use `scripts/convert_document.sh` + see [format-conversion.md](references/format-conversion.md) | varies |
  248. | **Mail merge from CSV/JSON** | Use `scripts/mail_merge.py` + see [interactive-features.md](references/interactive-features.md) | varies |
  249. ## Key LaTeX Patterns
  250. ### Escaping Special Characters
  251. Always escape: `%` → `\%`, `$` → `\$`, `&` → `\&`, `#` → `\#`, `_` → `\_`
  252. **Angle brackets in text mode:** `<` and `>` are NOT valid in LaTeX text mode with T1 encoding. They render as inverted question marks (¡ or ¿). Always use math mode or text commands:
  253. - `<5%` → `$<$5\%` or `\textless 5\%`
  254. - `>50` → `$>$50` or `\textgreater 50`
  255. - `<$300` → `$<$\$300`
  256. - `>=` → `$\geq$`, `<=` → `$\leq$`
  257. This is one of the most common silent errors in generated LaTeX — the document compiles without errors but the PDF shows garbage characters.
  258. Date ranges use en-dash: `2019--2025` (double hyphen).
  259. ### Standard Preamble
  260. ```latex
  261. \documentclass[11pt,a4paper]{article}
  262. \usepackage[utf8]{inputenc}
  263. \usepackage[T1]{fontenc}
  264. \usepackage{geometry}
  265. \usepackage{hyperref}
  266. \usepackage{xcolor}
  267. \usepackage{graphicx}
  268. \usepackage{tabularx}
  269. \usepackage{colortbl}
  270. \usepackage{enumitem}
  271. \usepackage{titlesec}
  272. ```
  273. ### Code Patterns (load as needed)
  274. For ready-to-use LaTeX code snippets (tables, charts, flowcharts, bibliography, watermarks, landscape pages, multi-language, images, Mermaid diagrams, matplotlib charts, CSV tables, AI images, fillable forms, conditional content, mail merge, version diff), read [references/code-patterns.md](references/code-patterns.md).
  275. ## Visual Elements in Reports
  276. When creating reports, use the enrichment elements the user selected in step 4. For the quick reference table of visual element tools (charts, flowcharts, AI images, tables, timelines) and sizing guidelines, see [references/advanced-features.md](references/advanced-features.md). Use `\begin{figure}[H]` (from `float` package) to prevent figures from floating. Size TikZ diagrams with `width=0.8\textwidth` or smaller.
  277. ## Reference Guides (load as needed)
  278. When uncertain about LaTeX patterns, compilation issues, or document quality, consult this table and load relevant files.
  279. | Topic | File | When to Read |
  280. |---|---|---|
  281. | Long-Form Best Practices | [long-form-best-practices.md](references/long-form-best-practices.md) | **MUST READ for 5+ page documents**: 9 anti-patterns, report preamble, content generation checklist |
  282. | Code Patterns (LaTeX snippets) | [code-patterns.md](references/code-patterns.md) | Ready-to-use LaTeX code: tables, charts, flowcharts, bibliography, watermarks, landscape, multi-lang, images, forms, mail merge, diffs |
  283. | Script & Tool Reference | [script-tools.md](references/script-tools.md) | PDF utilities (encrypt, merge, optimize, extract), LaTeX quality tools (lint, wordcount, analysis), compilation auto-fix, bibliography, diagrams |
  284. | Bibliography/Citations | [bibliography-guide.md](references/bibliography-guide.md) | BibTeX/biblatex, citation styles, .bib format |
  285. | Advanced Features & Visual Elements | [advanced-features.md](references/advanced-features.md) | Watermarks, landscape, multi-lang, code, algorithms, tcolorbox, siunitx, advanced charts, AI images, visual elements reference table |
  286. | Mermaid Diagrams | [mermaid-diagrams.md](references/mermaid-diagrams.md) | Flowcharts, sequence, class, ER, Gantt, pie, mindmap |
  287. | Python Charts (matplotlib) | [python-charts.md](references/python-charts.md) | Bar, line, scatter, pie, heatmap, box, histogram, area, radar |
  288. | Format Conversion (Pandoc) | [format-conversion.md](references/format-conversion.md) | Markdown/DOCX/HTML to/from LaTeX |
  289. | Tables and Images | [tables-and-images.md](references/tables-and-images.md) | Colored rows, multi-row/column, booktabs, long tables, images, TikZ |
  290. | Charts and Graphs (pgfplots) | [charts-and-graphs.md](references/charts-and-graphs.md) | Line plots, bar charts, scatter plots, pie charts in pgfplots |
  291. | IEEE Journal Two-Column Typography | [ieee-journal-twocolumn-guide.md](references/ieee-journal-twocolumn-guide.md) | IEEEtran journal layout, float rules, XeLaTeX vs. pdfLaTeX, bibliography, Markdown-to-IEEE workflow, sample PNGs in `examples/ieee-twocolumn*.png` |
  292. | LaTeX Packages | [packages.md](references/packages.md) | Common packages reference |
  293. | Poster Design Guide | [poster-design-guide.md](references/poster-design-guide.md) | Conference size presets, typography, color schemes, layout archetypes, content guidelines |
  294. | Resume ATS Guide | [resume-ats-guide.md](references/resume-ats-guide.md) | ATS rules, LaTeX pitfalls, keywords |
  295. | PDF-to-LaTeX Pipeline | [pdf-conversion.md](references/pdf-conversion.md) | Full conversion pipeline, scaling strategy, worker agents, validation |
  296. | Interactive Features | [interactive-features.md](references/interactive-features.md) | Fillable PDF forms, conditional content, mail merge from CSV/JSON, latexdiff version tracking |
  297. | Cheat Sheet Design | [cheatsheet-guide.md](references/cheatsheet-guide.md) | Template selection, typography, density optimization, PDF-to-cheatsheet pipeline |
  298. | PDF-to-Cheatsheet Prompts | [pdf-extraction-prompts.md](references/pdf-extraction-prompts.md) | LLM prompts for extraction stages: structure analysis, subject-specific extraction, compression, formatting |
  299. | Visual Packages (TikZ) | [visual-packages.md](references/visual-packages.md) | 24 installed TikZ/visualization packages with working examples |
  300. | Graphviz & PlantUML | [graphviz-plantuml.md](references/graphviz-plantuml.md) | .dot to PDF/PNG, .puml to PDF/PNG, LaTeX integration |
  301. | Debugging & Errors | [debugging-guide.md](references/debugging-guide.md) | Reading LaTeX errors, 20 common errors, .log analysis, silent failures |
  302. | Accessibility & PDF/A | [accessibility-guide.md](references/accessibility-guide.md) | PDF/A for thesis, PDF/UA for screen readers, tagged PDFs, alt text |
  303. | Beamer Presentations | [beamer-guide.md](references/beamer-guide.md) | Themes, overlays/animations, code slides, handouts, presenter notes |
  304. | Font Selection | [font-guide.md](references/font-guide.md) | Font families, fontspec, mathematical fonts, fontawesome5, microtype, CJK |
  305. | Collaboration & CI/CD | [collaboration-guide.md](references/collaboration-guide.md) | Git for LaTeX, GitHub Actions, Docker, multi-author workflows |
  306. | PDF Operations | [pdf-operations.md](references/pdf-operations.md) | Form filling (fillable + non-fillable), text/table extraction (pdfplumber), OCR (pytesseract), programmatic PDF creation (reportlab), watermarking, rotation/cropping, metadata, JavaScript (pdf-lib, pdfjs-dist), batch processing, performance tips |
  307. ## Critical Notes and Common Mistakes
  308. ### Compile & Output
  309. - Run compile script from the directory containing the .tex file, or use absolute paths
  310. - Place output .tex files in `./outputs/` for user visibility
  311. - After compilation, read the PNG preview files to show the user how the document looks
  312. - PNG previews require `poppler-utils` (auto-installed by script)
  313. ### Package Dependency Errors (MUST READ)
  314. These cause `Undefined control sequence` -- always include the required package:
  315. | If you use... | You MUST include | Error without it |
  316. |---|---|---|
  317. | `\rowcolor{}` | `\usepackage{colortbl}` | Undefined control sequence `\rowcolor` |
  318. | `\url{}` in .bib with natbib | `\usepackage{url}` | Undefined control sequence `\url` |
  319. | `\checkmark` | `\usepackage{amssymb}` | Undefined control sequence `\checkmark` |
  320. | `\begin{figure}[H]` | `\usepackage{float}` | Unknown float option `H` |
  321. | `\rowcolors{}{}{}` | `\usepackage[table]{xcolor}` or `\usepackage{colortbl}` | Undefined control sequence |
  322. ### hyperref Package
  323. - `hyperref` is fine for normal documents (most templates use it).
  324. - Only avoid it in **PDF-to-LaTeX converted documents** with theorem environments, where it causes `\set@color` errors.
  325. ### Compilation Environment
  326. - If texlive is not installed, the compile script auto-installs it. Do NOT run multiple compile commands in parallel before texlive is installed -- they will all try to install simultaneously, causing dpkg lock contention. Install once first or run compiles sequentially.
  327. - The compile script uses `-interaction=nonstopmode` (not `-halt-on-error`) to ensure PDFs are produced even with warnings. This is intentional -- many documents produce warnings on first pass that resolve on subsequent passes.
  328. - **latexmk** and **texfot** are included with TeX Live. The setup script (`setup.sh`) verifies their availability. latexmk is used when `--use-latexmk` is passed; texfot is used automatically when available (default verbosity mode).
  329. - A `.chktexrc` configuration file is included at the skill root to suppress common false positives when linting generated LaTeX documents. The `latex_lint.sh` script uses it automatically.
  330. ## Long-Form Document Anti-Patterns
  331. For documents 5+ pages (reports, theses, books), read [references/long-form-best-practices.md](references/long-form-best-practices.md) for 9 critical anti-patterns, the report preamble best practices, and the content generation checklist. **This is MUST-READ material before generating any long document.**
README.md · README · 770 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <p align="center">
  2. <img src="assets/capy-professor.png" alt="Professor Capybara — your LaTeX document expert" width="400"/>
  3. </p>
  4. <h1 align="center">LaTeX Document Skill</h1>
  5. <p align="center">
  6. <img src="https://img.shields.io/badge/installs-10K%2B-brightgreen?style=for-the-badge&logo=github&logoColor=white" alt="10K+ Installs"/>
  7. &nbsp;
  8. <a href="https://happycapy.ai/?via=gh"><img src="https://img.shields.io/badge/Made%20by-HappyCapy%20AI-orange?style=for-the-badge" alt="Made by HappyCapy AI"/></a>
  9. </p>
  10. <p align="center">
  11. <strong>The capybara sat down at the typewriter. When it stood up, there was a thesis.</strong>
  12. </p>
  13. <p align="center">
  14. <em>Turn handwritten notes, scanned textbooks, and raw data into publication-ready LaTeX -- without knowing a single LaTeX command.</em>
  15. </p>
  16. <p align="center">
  17. 27 templates &middot; 27 automation scripts &middot; 26 reference guides &middot; 4 OCR profiles &middot; 217 tests &middot; 0 LaTeX commands required
  18. </p>
  19. ---
  20. ## The 10-Second Pitch
  21. You describe a document in plain English. This skill produces a compiled PDF.
  22. - An 80-page handwritten math PDF becomes color-coded lecture notes with proper equations and TikZ diagrams.
  23. - A 162-page textbook becomes a 2-page cheat sheet.
  24. - A CSV becomes nine chart types.
  25. - A one-line prompt becomes a thesis, a resume, a conference poster, or a 37-page book with drop caps.
  26. No LaTeX knowledge required. The capybara handles the semicolons.
  27. ---
  28. ## What Can It Actually Do?
  29. *(Spoiler: more than most humans with a PhD in LaTeX.)*
  30. | You say... | What happens under the hood |
  31. |---|---|
  32. | "Create my resume" | Selects from 5 ATS-optimized templates, compiles with `pdflatex`, generates PDF + PNG preview |
  33. | "Convert my 80-page handwritten math notes into beautiful LaTeX" | `pdf_to_images.sh` renders at 200 DPI -> batch-7 parallel OCR agents -> `math-notes.md` profile generates colored `tcolorbox` theorems (blue), definitions (green), examples (orange) -> `compile_latex.sh` runs multi-pass pdflatex -> polished PDF with proper equations, proofs, and TikZ diagrams |
  34. | "Turn this 162-page scan into a 2-page cheat sheet" | `pdf_to_images.sh` splits PDF -> vision OCR per page -> extracts key content -> symbol substitution -> telegram-style compression -> fits into `cheatsheet.tex` with 3-column landscape 7pt layout |
  35. | "Build a quarterly report with charts" | `generate_chart.py` creates bar/line/pie charts from JSON/CSV -> `csv_to_latex.py` converts data into `booktabs` tables -> Mermaid/TikZ flowcharts compiled inline -> all embedded in `report.tex` with TOC |
  36. | "Generate 9 charts from my sales CSV" | `generate_chart.py` reads CSV -> outputs bar, line, scatter, pie, heatmap, box, histogram, area, radar charts -> multi-series, legends, colorblind-safe Tol palette |
  37. | "Convert my old PDF to LaTeX" | Pages split at 200 DPI -> parallel OCR agents -> clean `.tex` with profile-tuned formatting -> 0 errors per 7-page batch (validated on 115-page PDF) |
  38. | "Send personalized letters to 500 candidates" | `mail_merge.py` loads template + CSV -> Jinja2 rendering -> 4 parallel `pdflatex` workers -> `qpdf --pages` merge into single PDF |
  39. | "What changed between v1 and v2 of my thesis?" | `latex_diff.sh` runs `latexdiff` -> highlighted change-tracked PDF with additions in blue, deletions in red |
  40. | "Make a NeurIPS poster" | Interactive: asks orientation -> layout -> color scheme -> generates A0 `tikzposter` with correct dimensions and QR codes |
  41. | "Create a calculus final exam with answer key" | `exam` class with `\printanswers` toggle, grading table, 6 question types (MCQ, T/F, fill-blank, matching, short, essay) |
  42. | "Fetch BibTeX for these DOIs" | `fetch_bibtex.sh` hits `doi.org` with `Accept: application/x-bibtex` header -> appends to `.bib` -> cross-refs every `\cite{}` key |
  43. | "Password-protect this report" | `pdf_encrypt.sh` applies AES-256 with print/modify restrictions |
  44. | "Fill this PDF form with my data" | Detects fillable fields -> validates -> fills text, checkbox, radio, choice fields -> completed PDF |
  45. | "Fill this non-fillable PDF application" | Renders pages -> visual analysis to identify fields -> bounding box validation -> FreeText annotations at precise positions |
  46. | "Check if my paper is ready to submit" | Verifies packages -> cross-refs citations -> counts figures/tables/equations -> runs chktex for style issues |
  47. ---
  48. <p align="center">
  49. <img src="assets/capy-wizard.png" alt="Wizard Capybara transforming handwritten notes into typeset documents" width="400"/>
  50. </p>
  51. <p align="center"><em>Handwritten chaos in, publication-ready PDF out. It's not magic. It's 27 shell scripts.</em></p>
  52. ---
  53. ## Template Gallery -- 27 Templates
  54. Every template has been compiled, tested, and verified to produce zero errors. The capybara is a perfectionist.
  55. ### Resumes -- 5 ATS-Optimized + 1 Legacy
  56. All 5 modern templates designed to pass Applicant Tracking Systems (no columns, no tables for layout, no graphics in header, machine-readable text):
  57. | Template | Target Role | Key Design Choices |
  58. |---|---|---|
  59. | `resume-classic-ats.tex` | Finance, law, government | Single-column, minimal styling, maximum parsability |
  60. | `resume-modern-professional.tex` | Tech, corporate | Clean sections, subtle color accents |
  61. | `resume-executive.tex` | VP / Director / C-suite | Multi-page, executive summary section |
  62. | `resume-technical.tex` | Software, data, engineering | Skills matrix, project highlights |
  63. | `resume-entry-level.tex` | New graduates | Education-first, coursework, activities |
  64. | `resume.tex` (legacy) | Regions requiring photos | Photo area -- **not** ATS-compatible |
  65. | | | | |
  66. |---|---|---|---|
  67. | ![Classic ATS](examples/resume-classic-ats.png) | ![Modern Professional](examples/resume-modern-professional.png) | ![Executive p1](examples/resume-executive-p1.png) | ![Executive p2](examples/resume-executive-p2.png) |
  68. | Classic ATS | Modern Professional | Executive (p1) | Executive (p2) |
  69. | ![Technical](examples/resume-technical.png) | ![Entry-Level](examples/resume-entry-level.png) | | |
  70. | Technical | Entry-Level | | |
  71. ---
  72. ### Academic Documents
  73. #### Thesis / Dissertation -- Full book-class, 38+ pages
  74. Palatino fonts, `microtype`, `mathtools`, `cleveref`. Front matter (title, declaration, abstract, acknowledgments, TOC), multiple chapters, appendices, bibliography with `biblatex`/biber. `\geometry{bindingoffset=1.5cm}` for professional printing.
  75. | | | | |
  76. |---|---|---|---|
  77. | ![p1](examples/thesis-p1.png) | ![p2](examples/thesis-p2.png) | ![p3](examples/thesis-p3.png) | ![p4](examples/thesis-p4.png) |
  78. | Title Page | Table of Contents | Literature Review | TikZ Diagram |
  79. | ![p5](examples/thesis-p5.png) | ![p6](examples/thesis-p6.png) | ![p7](examples/thesis-p7.png) | ![p8](examples/thesis-p8.png) |
  80. | Results | Charts | Chapter Content | Bibliography |
  81. #### Academic Paper -- 11 pages, arXiv-compatible
  82. Times fonts, colorblind-safe Tol palette, multi-author affiliations via `authblk`, `siunitx` for consistent units, algorithm environments, theorem/proof. `\pdfoutput=1` for arXiv submission.
  83. | | | | |
  84. |---|---|---|---|
  85. | ![p1](examples/academic-paper-p1.png) | ![p2](examples/academic-paper-p2.png) | ![p3](examples/academic-paper-p3.png) | ![p4](examples/academic-paper-p4.png) |
  86. | Title & Abstract | Tables + Charts | Ablation Study | References |
  87. #### Lecture Notes (Beautiful Mode) -- Color-coded theorem environments
  88. `lecture-notes.tex`: Palatino fonts, `tcolorbox` with semantic colors -- blue theorems, green definitions, orange examples, purple remarks. TikZ graph theory macros, custom math operators (`\E`, `\Var`, `\Cov`).
  89. | | | | |
  90. |---|---|---|---|
  91. | ![p1](examples/lecture-notes-p1.png) | ![p2](examples/lecture-notes-p2.png) | ![p3](examples/lecture-notes-p3.png) | ![p4](examples/lecture-notes-p4.png) |
  92. | ![p5](examples/lecture-notes-p5.png) | ![p6](examples/lecture-notes-p6.png) | ![p7](examples/lecture-notes-p7.png) | ![p8](examples/lecture-notes-p8.png) |
  93. #### Academic CV -- Multi-page with publications, grants, teaching
  94. Numbered publications ([J1], [C1], [W1]), grants with dollar amounts, student advising (current + graduated), professional service, invited talks. ORCID and Google Scholar links.
  95. | | | | |
  96. |---|---|---|---|
  97. | ![p1](examples/academic-cv-p1.png) | ![p2](examples/academic-cv-p2.png) | ![p3](examples/academic-cv-p3.png) | ![p4](examples/academic-cv-p4.png) |
  98. #### Homework / Assignment -- Solution toggle
  99. Custom `problem`/`solution` environments, code listings (Python, Java, C++, Matlab), honor code section. Toggle solutions globally with `\showsolutionstrue`/`\showsolutionsfalse`.
  100. #### Lab Report -- STEM lab writeups
  101. `siunitx` for uncertainties and SI units, `pgfplots` for data with error bars, structured sections: abstract -> theory -> procedure -> data -> analysis -> discussion -> conclusion.
  102. ---
  103. ### Scientific Posters -- `tikzposter` class
  104. Interactive workflow asks: conference -> orientation -> layout -> color scheme.
  105. | Layout | Usage | Description |
  106. |---|---|---|
  107. | Traditional Column | ~70% of posters | 2-column (portrait) or 3-column (landscape) |
  108. | #BetterPoster | ~10% (growing) | Central billboard with ONE key finding at 60-80pt |
  109. | Visual-Heavy | ~15% | Large central figure consuming 40-50% of space |
  110. Conference presets: NeurIPS, ICML, CVPR, ICLR (main + workshop sizes).
  111. | Portrait A0 | Landscape A0 |
  112. |---|---|
  113. | ![Portrait](examples/poster.png) | ![Landscape](examples/poster-landscape.png) |
  114. ---
  115. ### Book -- Full-Length Publishing Template
  116. `book` class, 37+ pages. Palatino fonts, `lettrine` drop caps, `imakeidx` for indexing. Structure: half-title -> full title -> copyright page (ISBN slot) -> dedication -> preface -> acknowledgments -> TOC -> parts -> chapters with epigraphs -> appendices -> bibliography -> index -> colophon.
  117. | | | | | |
  118. |---|---|---|---|---|
  119. | ![p1](examples/book-p1.png) | ![p2](examples/book-p2.png) | ![p3](examples/book-p3.png) | ![p4](examples/book-p4.png) | ![p5](examples/book-p5.png) |
  120. | Half Title | Full Title | Copyright | TOC | Preface |
  121. | ![p6](examples/book-p6.png) | ![p7](examples/book-p7.png) | ![p8](examples/book-p8.png) | ![p9](examples/book-p9.png) | ![p10](examples/book-p10.png) |
  122. | Acknowledgments | Part I | Ch 1: Drop Caps | Definitions & Theorems | Notation & Summary |
  123. ---
  124. ### Exam / Quiz -- `exam` class
  125. 6 question types (multiple choice, true/false, fill-in-blank, matching, short answer, essay). Point values per question, `\gradetable[h][questions]` for grading grid. `\printanswers` / `\noprintanswers` toggles solution visibility.
  126. | | | | | | |
  127. |---|---|---|---|---|---|
  128. | ![p1](examples/exam-p1.png) | ![p2](examples/exam-p2.png) | ![p3](examples/exam-p3.png) | ![p4](examples/exam-p4.png) | ![p5](examples/exam-p5.png) | ![p6](examples/exam-p6.png) |
  129. ---
  130. ### Cheat Sheets -- 3 Variants
  131. | Template | Columns | Font | Orientation |
  132. |---|---|---|---|
  133. | `cheatsheet.tex` | 3 | 7pt | Landscape |
  134. | `cheatsheet-exam.tex` | 2 | 6pt | Portrait |
  135. | `cheatsheet-code.tex` | 4 | 7pt | Landscape |
  136. **Example: Algebraic Geometry (162 pages -> 2 pages)**
  137. | | |
  138. |---|---|
  139. | ![Cheatsheet p1](examples/cheatsheet-p1.png) | ![Cheatsheet p2](examples/cheatsheet-p2.png) |
  140. | Page 1 -- Affine/Projective Space, Varieties, Morphisms | Page 2 -- Sheaves, Schemes, Cohomology, Key Examples |
  141. ---
  142. ### Interactive / Dynamic Templates
  143. | Template | What It Does |
  144. |---|---|
  145. | `fillable-form.tex` | PDF form fields: text inputs, checkboxes, radio buttons, dropdowns, push buttons (via `hyperref`) |
  146. | `conditional-document.tex` | 12 `etoolbox` toggles (showTOC, isDraft, isConfidential...), 3 visual profiles, CLI-overridable |
  147. | `mail-merge-letter.tex` | Template for `mail_merge.py` -- `{{name}}` placeholders |
  148. ---
  149. ### Business Documents
  150. | | | |
  151. |---|---|---|
  152. | ![Letter](examples/letter.png) | ![Cover Letter](examples/cover-letter.png) | ![Invoice](examples/invoice.png) |
  153. | `letter.tex` -- Business letter | `cover-letter.tex` -- Job application | `invoice.tex` -- Professional invoice |
  154. ---
  155. ### Presentation (`presentation.tex`) -- Beamer 16:9
  156. Custom theme, widescreen aspect ratio, title/section/content/two-column/code/image/thank-you frame types.
  157. | | | | | |
  158. |---|---|---|---|---|
  159. | ![p1](examples/presentation-p1.png) | ![p2](examples/presentation-p2.png) | ![p3](examples/presentation-p3.png) | ![p4](examples/presentation-p4.png) | ![p5](examples/presentation-p5.png) |
  160. | ![p6](examples/presentation-p6.png) | ![p7](examples/presentation-p7.png) | ![p8](examples/presentation-p8.png) | ![p9](examples/presentation-p9.png) | ![p10](examples/presentation-p10.png) |
  161. ---
  162. ### Report (`report.tex`)
  163. Executive summary, findings, recommendations with TOC, pgfplots bar charts, TikZ flowcharts, colored data tables.
  164. | | | | |
  165. |---|---|---|---|
  166. | ![p1](examples/report-p1.png) | ![p2](examples/report-p2.png) | ![p3](examples/report-p3.png) | ![p4](examples/report-p4.png) |
  167. ---
  168. ## Killer Features
  169. *(The things that make this more than "just another template repo.")*
  170. ### 1. Smart Compilation Engine (`compile_latex.sh` -- 525 lines)
  171. Not a wrapper around `pdflatex`. It is an intelligent build system that reads your document and makes decisions. Think of it as a capybara that learned to read `.tex` files.
  172. **Auto-detection logic:**
  173. ```
  174. Document contains \usepackage{fontspec} or \usepackage{xeCJK} -> xelatex
  175. Document contains \usepackage{luacode} or \directlua -> lualatex
  176. Otherwise -> pdflatex
  177. Document contains \bibliography{} -> bibtex
  178. Document contains \addbibresource{} -> biber
  179. Document contains \makeindex -> runs makeindex
  180. Document contains \makeglossaries -> runs makeglossaries
  181. ```
  182. **Multi-pass compilation:** Runs the engine up to 3 times, checking for "Rerun to get cross-references right" each pass. Bibtex/biber runs between passes 1 and 2.
  183. **Auto-fix mode** (`--auto-fix`):
  184. | What it fixes | How |
  185. |---|---|
  186. | Naked `\begin{figure}` without placement | Injects `[htbp]` -- the #1 LaTeX beginner complaint |
  187. | Naked `\begin{table}` without placement | Same `[htbp]` injection |
  188. | Overfull hbox warnings | Adds `\usepackage{microtype}` to preamble |
  189. **Error translation** -- parses `.log` and translates into actionable English:
  190. | Raw LaTeX Error | What the script tells you |
  191. |---|---|
  192. | `Missing $ inserted` | "Math symbol used outside `$...$` -- wrap it in dollar signs" |
  193. | `Undefined control sequence \xyz` | "Unknown command `\xyz` -- check spelling or add the right `\usepackage`" |
  194. | `Too many }'s` | "Extra closing brace -- count your `{` and `}` pairs" |
  195. | `File 'foo.sty' not found` | "Missing package `foo` -- install with `tlmgr install foo`" |
  196. **Preview generation:** After compilation, runs `pdftoppm -png -r 200` on the output PDF and resizes to <=2000px.
  197. ```bash
  198. bash scripts/compile_latex.sh document.tex --preview --auto-fix
  199. ```
  200. ---
  201. ### 2. PDF-to-LaTeX Reconstruction (Vision OCR Pipeline)
  202. Convert **any PDF** -- scanned textbook, handwritten notes, printed report -- into compilable LaTeX. The capybara reads your handwriting better than your professor does.
  203. **Pipeline:**
  204. 1. `pdf_to_images.sh` renders pages at 200 DPI using `pdftoppm`, zero-pads filenames, resizes to <=2000px for API limits
  205. 2. Vision model reads each page image
  206. 3. Generates `.tex` with profile-appropriate formatting
  207. **Scaling strategy** (empirically validated on 115-page handwritten math notes):
  208. | PDF Size | Strategy | Expected Errors |
  209. |---|---|---|
  210. | 1-10 pages | Single agent processes all pages | 0-2 minor errors |
  211. | 11-20 pages | Split into 2 batches of ~10 | Near-zero per batch |
  212. | 21+ pages | Batch-7 pipeline with parallel agents | 0 errors per 7-page batch |
  213. **4 conversion profiles** (in `references/profiles/`):
  214. | Profile | Tuned For |
  215. |---|---|
  216. | `math-notes.md` | Equations, theorems, proofs. "Beautiful mode" uses colored `tcolorbox` environments |
  217. | `business-document.md` | Reports, financials, tables, bullet lists |
  218. | `legal-document.md` | Numbered paragraphs, statutory references, legal citation formatting |
  219. | `general-notes.md` | Handwritten notes, mixed media, letters |
  220. ---
  221. ### 3. PDF-to-Cheat Sheet Pipeline
  222. Condense entire textbooks into 2-page reference cards. Because the night before the exam, you need density, not decoration.
  223. | Template | Layout | Font Size | Columns | Best For |
  224. |---|---|---|---|---|
  225. | `cheatsheet.tex` | Landscape A4 | 7pt | 3 | Course reference, concept summaries |
  226. | `cheatsheet-exam.tex` | Portrait A4 | 6pt | 2 | Exam formula sheets (B&W-safe) |
  227. | `cheatsheet-code.tex` | Landscape A4 | 7pt | 4 | Programming references, CLI commands |
  228. **Density techniques:**
  229. - Symbol substitution (for all -> "for all", there exists -> "there exists")
  230. - Horizontal formula stacking with `\quad` separators
  231. - Telegram-style text (articles and filler words stripped)
  232. - Content prioritization: formulas 60-70% -> procedures 15-20% -> constants 10-15% -> definitions 5-10%
  233. - Compile-and-verify loop to fit exact page budget
  234. ---
  235. ### 4. Mail Merge (`mail_merge.py` -- 574 lines)
  236. Generate N personalized documents from one template + one data source. HR departments have hired worse interns.
  237. ```bash
  238. python3 scripts/mail_merge.py template.tex contacts.csv \
  239. --output-dir ./letters --workers 4 --merge --merge-name all_letters.pdf
  240. ```
  241. **Two templating modes:**
  242. | Mode | Syntax | Features |
  243. |---|---|---|
  244. | **Simple** (default) | `{{first_name}}`, `{{company}}` | Auto-escapes `&`, `%`, `$`, `#`, `_`, `{`, `}`, `~`, `^`, `\` for LaTeX safety |
  245. | **Jinja2** (`--jinja2`) | `<< first_name >>`, `<% if ... %>` | Conditionals, loops, filters. `|escape_latex` filter available |
  246. **Technical details:**
  247. - Data sources: CSV, JSON, JSONL
  248. - Uses `concurrent.futures.ProcessPoolExecutor` for parallel compilation
  249. - Each document compiled independently (crash isolation)
  250. - Final merge via `qpdf --pages` or `pdfunite`
  251. - Custom naming: `--name-field last_name --prefix "offer_letter"` -> `offer_letter_Smith.pdf`
  252. ---
  253. ### 5. Version Diffing (`latex_diff.sh` -- 409 lines)
  254. A full-featured `latexdiff` wrapper with git integration. Track every comma your advisor changed at 2 AM.
  255. ```bash
  256. # Compare two files directly
  257. bash scripts/latex_diff.sh paper_v1.tex paper_v2.tex --compile --preview
  258. # Compare against a git commit
  259. bash scripts/latex_diff.sh paper.tex --git-rev HEAD~3 --compile
  260. # Compare between two git tags
  261. bash scripts/latex_diff.sh paper.tex --git-rev v1.0 --compile --type CULINECHBAR
  262. # Multi-file document with \input/\include
  263. bash scripts/latex_diff.sh old/main.tex new/main.tex --flatten --compile
  264. ```
  265. **8 markup types:**
  266. | Type | Visual Effect |
  267. |---|---|
  268. | `UNDERLINE` (default) | Additions underlined in blue, deletions struck through in red |
  269. | `CTRADITIONAL` | Additions in blue text, deletions in red with strikethrough |
  270. | `CFONT` | Additions in sans-serif blue, deletions in tiny red |
  271. | `CHANGEBAR` | Change bars in margin only, no inline markup |
  272. | `CCHANGEBAR` | Change bars + color changes |
  273. | `CULINECHBAR` | Underline + change bars (most comprehensive) |
  274. | `FONTSTRIKE` | Font change + strikethrough |
  275. | `INVISIBLE` | No visible markup (for testing) |
  276. **Git integration:** Extracts old version via `git show <rev>:<path>`, diffs against current working copy. Supports `HEAD~1`, `v1.0`, branch names.
  277. **Custom colors:** `--color-add "green!70!black" --color-del "red!80!black"` injects override commands.
  278. ---
  279. ### 6. BibTeX Auto-Fetch (`fetch_bibtex.sh` -- 251 lines)
  280. Download BibTeX entries from DOIs or arXiv IDs with zero manual work. No more copy-pasting from Google Scholar like an animal.
  281. ```bash
  282. # From DOI
  283. bash scripts/fetch_bibtex.sh 10.1038/nature12373
  284. # From arXiv
  285. bash scripts/fetch_bibtex.sh 2301.07041
  286. # Multiple at once, append to existing .bib
  287. bash scripts/fetch_bibtex.sh 10.1145/3290605.3300608 1906.08237 \
  288. --append --output references.bib
  289. ```
  290. Auto-detects identifier type: `10.xxxx/...` -> DOI, `YYMM.NNNNN` -> arXiv. Strips `arXiv:` prefix if present.
  291. ---
  292. ## Visual Elements
  293. ### Charts & Graphs (`generate_chart.py` -- 459 lines)
  294. 9 chart types from JSON or CSV data, output as PNG or PDF:
  295. ```bash
  296. python3 scripts/generate_chart.py bar \
  297. --data '{"x":["Q1","Q2","Q3","Q4"],"y":[120,150,180,210]}' \
  298. --output chart.png --title "Revenue" --style ggplot --figsize 10 6
  299. ```
  300. | Chart Type | Multi-Series | Notes |
  301. |---|---|---|
  302. | `bar` | Yes (grouped) | Horizontal with `--horizontal` |
  303. | `line` | Yes | Markers, grid |
  304. | `scatter` | Yes | |
  305. | `pie` | No | Autopct, explode slices |
  306. | `heatmap` | No | Annotated cells, custom colormap |
  307. | `box` | Yes | Statistical distribution |
  308. | `histogram` | Yes | Custom bins |
  309. | `area` | Yes | Stacked with alpha |
  310. | `radar` | Yes | Spider/star chart |
  311. **Inline charts** can also be created directly in LaTeX using `pgfplots`.
  312. ### Tables (`csv_to_latex.py` -- 364 lines)
  313. ```bash
  314. python3 scripts/csv_to_latex.py data.csv --style booktabs --alternating-rows \
  315. --caption "Experimental Results" --label tab:results --max-rows 50
  316. ```
  317. | Style | Look |
  318. |---|---|
  319. | `booktabs` | Professional -- `\toprule`, `\midrule`, `\bottomrule` |
  320. | `grid` | Full borders on all cells |
  321. | `simple` | Horizontal rules only |
  322. | `plain` | No rules at all |
  323. Auto-detects column alignment (right-aligns numeric columns). Handles LaTeX special character escaping.
  324. ### Diagrams -- 4 Rendering Pipelines
  325. | Tool | Script | Input | Output | Batch Mode |
  326. |---|---|---|---|---|
  327. | **TikZ** | (compiled inline) | `.tex` | PDF | -- |
  328. | **Mermaid** | `mermaid_to_image.sh` | `.mmd` | PNG/PDF | No |
  329. | **Graphviz** | `graphviz_to_pdf.sh` | `.dot` | PDF/PNG | Yes (whole directory) |
  330. | **PlantUML** | `plantuml_to_pdf.sh` | `.puml` | PDF/PNG/SVG | Yes (whole directory) |
  331. **Graphviz** supports 6 layout engines: `dot` (hierarchical), `neato` (spring model), `circo` (circular), `fdp` (force-directed), `twopi` (radial), `sfdp` (scalable force-directed).
  332. **Mermaid** uses `npx @mermaid-js/mermaid-cli` with Puppeteer. Themes: `default`, `dark`, `forest`, `neutral`.
  333. **PlantUML** auto-downloads `plantuml.jar` if not installed. Requires Java.
  334. ---
  335. ## Format Conversion (`convert_document.sh` -- 316 lines)
  336. Pandoc wrapper with auto-detection of input/output formats from file extensions:
  337. ```
  338. Markdown <-> LaTeX <-> DOCX <-> HTML <-> PDF
  339. ```
  340. ```bash
  341. # Markdown to LaTeX
  342. bash scripts/convert_document.sh notes.md notes.tex --standalone --toc
  343. # DOCX to LaTeX with bibliography
  344. bash scripts/convert_document.sh manuscript.docx manuscript.tex --bibliography refs.bib --csl ieee.csl
  345. # LaTeX to PDF (uses lualatex if available for Unicode)
  346. bash scripts/convert_document.sh paper.tex paper.pdf
  347. ```
  348. ---
  349. ## PDF Utilities
  350. All 4 scripts use `qpdf` (auto-installed if missing):
  351. | Script | What It Does | Key Flags |
  352. |---|---|---|
  353. | `pdf_encrypt.sh` | AES-256 password protection | `--restrict-print`, `--restrict-copy`, `--restrict-modify`, `--owner-password` |
  354. | `pdf_merge.sh` | Combine 2+ PDFs into one | `--output combined.pdf` |
  355. | `pdf_optimize.sh` | Compress + linearize for web | `--linearize`, `--compress-streams=y`, `--recompress-flate` |
  356. | `pdf_extract_pages.sh` | Extract page ranges | `--pages 1-10`, `--pages odd`, `--pages even`, `--pages last:3` |
  357. ```bash
  358. # Encrypt with restrictions
  359. bash scripts/pdf_encrypt.sh report.pdf --user-password secret --restrict-print --restrict-modify
  360. # Merge chapters into book
  361. bash scripts/pdf_merge.sh ch1.pdf ch2.pdf ch3.pdf --output book.pdf
  362. # Compress for email (shows % reduction)
  363. bash scripts/pdf_optimize.sh large.pdf --output small.pdf
  364. # Extract appendix
  365. bash scripts/pdf_extract_pages.sh thesis.pdf --pages last:3 --output appendix.pdf
  366. ```
  367. ---
  368. ## LaTeX Quality & Analysis Tools
  369. | Script | Lines | What It Does |
  370. |---|---|---|
  371. | `latex_lint.sh` | 173 | Run `chktex` with colored output. `--strict` treats warnings as errors |
  372. | `latex_wordcount.sh` | 149 | Word count via `detex`. `--detailed` adds figures/tables/equations count |
  373. | `latex_analyze.sh` | 216 | Missing labels, unreferenced `\label{}`, TODO/FIXME detection, double spaces |
  374. | `latex_package_check.sh` | 265 | Pre-flight `\usepackage` verification via `kpsewhich`. `--install` auto-installs |
  375. | `latex_citation_extract.sh` | 342 | Citation analysis, cross-refs against `.bib`, `--format json` for programmatic use |
  376. | `fetch_bibtex.sh` | 251 | DOI/arXiv -> BibTeX entries, `--append` mode |
  377. | `validate_latex.py` | 426 | 6-check syntax validator for batch files |
  378. ---
  379. ## Multi-Language Support
  380. | Language Family | Package | Auto-Selected Engine |
  381. |---|---|---|
  382. | European (French, German, Spanish...) | `babel` | pdfLaTeX |
  383. | CJK (Chinese, Japanese, Korean) | `xeCJK` | XeLaTeX |
  384. | RTL (Arabic, Hebrew, Farsi) | `polyglossia` | XeLaTeX |
  385. | Cyrillic (Russian, Ukrainian) | `babel` or `polyglossia` | pdfLaTeX or XeLaTeX |
  386. ---
  387. <p align="center">
  388. <img src="assets/capy-printer.png" alt="Steampunk Printer Capybara operating a printing press" width="400"/>
  389. </p>
  390. <p align="center"><em>Behind every great PDF is a capybara who figured out the correct number of pdflatex passes.</em></p>
  391. ---
  392. ## Installation
  393. ```bash
  394. # Install as a Claude Code skill
  395. cp -r latex-document ~/.claude/skills/
  396. # Or run full dependency setup
  397. bash setup.sh # Installs: TeX Live, Poppler, ImageMagick, Pandoc, Python deps
  398. bash setup.sh --check # Verify everything is installed
  399. ```
  400. **System dependencies** (auto-installed by `setup.sh` on Debian/macOS/Fedora/Alpine/Arch):
  401. - **TeX Live** -- pdflatex, xelatex, lualatex, biber, makeindex, makeglossaries
  402. - **Poppler** -- `pdftoppm` for PNG previews, `pdfinfo` for page counts
  403. - **ImageMagick** -- `mogrify` for image resizing, `identify` for dimensions
  404. - **Pandoc** -- format conversion engine
  405. - **Python 3** + `matplotlib`, `numpy`, `pandas`
  406. - **qpdf** -- PDF encryption, merging, optimization, page extraction
  407. **Optional:**
  408. - **Node.js 18+** -- for Mermaid diagram conversion
  409. - **Java** -- for PlantUML rendering
  410. - **Graphviz** -- for `.dot` diagram rendering
  411. - **chktex** -- for LaTeX linting
  412. - **latexdiff** -- for version diffing
  413. ---
  414. ## Reference Documentation
  415. 25 reference guides in `references/`:
  416. <details>
  417. <summary>Full index (click to expand)</summary>
  418. | Guide | Covers |
  419. |---|---|
  420. | `resume-ats-guide.md` | ATS parsing rules, keyword optimization, formatting do's and don'ts |
  421. | `poster-design-guide.md` | Conference presets, #BetterPoster layout, typography at poster scale |
  422. | `bibliography-guide.md` | BibTeX vs biblatex, `\cite` variants, CSL styles |
  423. | `advanced-features.md` | Watermarks, landscape sections, multi-language, algorithms, siunitx |
  424. | `charts-and-graphs.md` | pgfplots patterns (line, bar, scatter, pie, 3D) |
  425. | `python-charts.md` | matplotlib via `generate_chart.py` -- all 9 types, CSV input |
  426. | `mermaid-diagrams.md` | Flowcharts, sequence, class, ER, Gantt, pie, mindmap |
  427. | `format-conversion.md` | Pandoc pipeline, custom templates, bibliography integration |
  428. | `pdf-conversion.md` | Full PDF-to-LaTeX pipeline, batch processing, profiles |
  429. | `tables-and-images.md` | Colored rows, multi-row/column, booktabs, subfigures |
  430. | `interactive-features.md` | Forms, conditional content, mail merge, diffing |
  431. | `packages.md` | Common LaTeX package reference |
  432. | `visual-packages.md` | 24 TikZ/visualization packages with examples |
  433. | `graphviz-plantuml.md` | Graphviz & PlantUML workflows and examples |
  434. | `pdf-extraction-prompts.md` | LLM prompts for PDF-to-cheatsheet conversion |
  435. | `cheatsheet-guide.md` | Density optimization, compression techniques |
  436. | `debugging-guide.md` | 20 common errors explained, .log file reading |
  437. | `accessibility-guide.md` | PDF/A, PDF/UA, tagged PDFs, WCAG compliance |
  438. | `beamer-guide.md` | Themes, overlays, code slides, handout mode |
  439. | `font-guide.md` | Font families, fontspec, fontawesome5 icons |
  440. | `collaboration-guide.md` | Git workflows, GitHub Actions, Docker, CI/CD for LaTeX |
  441. | `long-form-best-practices.md` | 9 anti-patterns for 5+ page documents, quality checklist |
  442. | `code-patterns.md` | 16 ready-to-use LaTeX snippets |
  443. | `pdf-operations.md` | Advanced PDF ops: form filling, text extraction, OCR, watermark |
  444. | `script-tools.md` | PDF utilities, quality tools, compilation helpers |
  445. | `profiles/` | 4 OCR conversion profiles (math, business, legal, general) |
  446. </details>
  447. ---
  448. ## Testing
  449. 217 tests covering all 27 scripts, 0 failures:
  450. ```bash
  451. # Run all tests
  452. bash tests/run_all_tests.sh
  453. # Run individual suites
  454. python -m pytest tests/test_python_scripts.py -v # 83 tests
  455. python -m pytest tests/test_pdf_forms.py -v # 18 tests
  456. bash tests/test_compile_latex.sh # 36 tests
  457. bash tests/test_pdf_utils.sh # 33 tests
  458. bash tests/test_analysis_tools.sh # 47 tests
  459. bash tests/test_templates.sh # All 27 templates compiled
  460. ```
  461. Tests found and fixed 2 real bugs in `compile_latex.sh`:
  462. 1. Engine detection matched `%\usepackage{fontspec}` in comments -- now filters commented lines
  463. 2. Float auto-fix regex failed when `\begin{figure}` was at end of line -- now uses two-pass approach
  464. ---
  465. ## Project Structure
  466. ```
  467. latex-document/
  468. ├── SKILL.md # Skill definition (329 lines)
  469. ├── README.md # You are here
  470. ├── setup.sh # One-click installer
  471. ├── requirements.txt # Python: matplotlib, numpy, pandas
  472. │
  473. ├── assets/
  474. │ ├── capy-professor.png # The professor capybara (you saw him up top)
  475. │ ├── capy-wizard.png # The wizard capybara (OCR sorcery)
  476. │ ├── capy-printer.png # The printer capybara (steampunk vibes)
  477. │ └── templates/ # 27 production-tested .tex templates
  478. │ ├── resume-*.tex (x6)
  479. │ ├── thesis.tex, academic-paper.tex, academic-cv.tex
  480. │ ├── lecture-notes.tex, homework.tex, lab-report.tex
  481. │ ├── book.tex, poster.tex, poster-landscape.tex
  482. │ ├── exam.tex, cheatsheet*.tex (x3)
  483. │ ├── fillable-form.tex, conditional-document.tex, mail-merge-letter.tex
  484. │ ├── letter.tex, cover-letter.tex, invoice.tex
  485. │ ├── report.tex, presentation.tex
  486. │ └── references.bib
  487. │
  488. ├── scripts/ # 27 automation scripts (8,700+ lines)
  489. │ ├── compile_latex.sh (525) # .tex -> PDF + PNG
  490. │ ├── mail_merge.py (574) # Template + data -> N PDFs
  491. │ ├── generate_chart.py (459) # 9 chart types (matplotlib)
  492. │ ├── validate_latex.py (426) # 6-check syntax validator
  493. │ ├── latex_diff.sh (409) # latexdiff + git integration
  494. │ ├── csv_to_latex.py (364) # CSV -> LaTeX tables
  495. │ ├── plantuml_to_pdf.sh (362) # .puml -> PDF/PNG/SVG
  496. │ ├── latex_citation_extract.sh (342) # Citation analysis
  497. │ ├── convert_document.sh (316) # Pandoc format conversion
  498. │ ├── latex_package_check.sh (265) # Pre-flight package checker
  499. │ ├── fetch_bibtex.sh (251) # DOI/arXiv -> BibTeX
  500. │ ├── graphviz_to_pdf.sh (250) # .dot -> PDF/PNG
  501. │ ├── pdf_extract_pages.sh (247) # Page extraction
  502. │ ├── install_deps.sh (237) # Cross-platform deps
  503. │ ├── pdf_validate_boxes.py (235) # Bounding box validation
  504. │ ├── pdf_extract_fields.py (228) # Form field metadata
  505. │ ├── pdf_fill_form.py (223) # Fill fillable forms
  506. │ ├── latex_analyze.sh (216) # Document statistics
  507. │ ├── pdf_encrypt.sh (215) # AES-256 encryption
  508. │ ├── pdf_fill_annotations.py (214) # Fill non-fillable forms
  509. │ ├── mermaid_to_image.sh (178) # .mmd -> PNG/PDF
  510. │ ├── latex_lint.sh (173) # chktex wrapper
  511. │ ├── pdf_optimize.sh (157) # Compress + linearize
  512. │ ├── latex_wordcount.sh (149) # Word count
  513. │ ├── pdf_to_images.sh (144) # PDF -> page images
  514. │ ├── pdf_merge.sh (136) # Merge PDFs
  515. │ └── pdf_check_form.py (106) # Detect form fields
  516. │
  517. ├── references/ # 26 deep-dive guides
  518. │ ├── *.md (x26)
  519. │ └── profiles/ (x4) # OCR profiles
  520. │
  521. ├── tests/ # 217 tests, 0 failures
  522. │ ├── test_python_scripts.py (1224)
  523. │ ├── test_compile_latex.sh (844)
  524. │ ├── test_analysis_tools.sh (1093)
  525. │ ├── test_pdf_utils.sh (834)
  526. │ ├── test_pdf_forms.py (300)
  527. │ ├── test_templates.sh (276)
  528. │ ├── run_all_tests.sh (191)
  529. │ └── fixtures/
  530. │
  531. └── examples/ # 78 PNG previews
  532. ```
  533. ---
  534. ## Star History
  535. <p align="center">
  536. <a href="https://star-history.com/#ndpvt-web/latex-document-skill&Date">
  537. <img src="https://api.star-history.com/svg?repos=ndpvt-web/latex-document-skill&type=Date" alt="Star History Chart" width="600"/>
  538. </a>
  539. </p>
  540. ---
  541. ## Sponsor
  542. <p align="center">
  543. <a href="https://happycapy.ai">
  544. <img src="assets/happycapy-logo.png" alt="HappyCapy — The Agent-Native Computer" width="300"/>
  545. </a>
  546. </p>
  547. <p align="center">
  548. <a href="https://happycapy.ai">
  549. <img src="assets/happycapy-capy.png" alt="HappyCapy Interface — where this skill was born" width="500"/>
  550. </a>
  551. </p>
  552. <p align="center">
  553. <strong>This project is proudly sponsored by <a href="https://happycapy.ai">HappyCapy</a></strong>
  554. </p>
  555. [HappyCapy](https://happycapy.ai) provided **free access to their platform**, full **Claude Code API credits**, and **Anthropic Claude Opus 4.6** -- the model that built every template, wrote every script, and generated every capybara image in this repository.
  556. Without HappyCapy, this skill would still be a half-baked idea on a sticky note. Instead, it's 27 templates, 27 scripts, 217 passing tests, and three capybara mascots with better fashion sense than most academics.
  557. **What is HappyCapy?** The agent-native computer for developers. No local setup, no security risks, no "works on my machine" excuses. Launch Claude Code in your browser and start building. It's the platform where capybaras and code live in harmony.
  558. <p align="center">
  559. <a href="https://happycapy.ai"><strong>Try HappyCapy for free</strong></a>
  560. </p>
  561. ---
  562. ## License
  563. MIT
  564. ---
  565. ## Keywords
  566. > *For the search engines, the LLMs, and the curious humans who find things by typing random words into the void*
  567. LaTeX template, LaTeX automation, AI document generation, Claude Code skill, PDF creation tool, LaTeX PDF generator, academic document template, professional document automation, resume LaTeX template ATS, thesis template LaTeX, invoice generator LaTeX, report generator LaTeX, OCR to LaTeX, handwritten notes to PDF, PDF to LaTeX converter, cheat sheet generator, mail merge LaTeX, BibTeX auto fetch, LaTeX diff tool, version control LaTeX, arXiv paper template, NeurIPS poster template, conference poster LaTeX, exam template LaTeX, lecture notes LaTeX, book template LaTeX, Beamer presentation template, LaTeX compilation script, LaTeX error fixer, smart LaTeX compiler, chart generator matplotlib, CSV to LaTeX table, Mermaid diagram LaTeX, Graphviz LaTeX, PlantUML LaTeX, PDF encryption tool, PDF merge tool, PDF compression, fillable PDF form, LaTeX linting, LaTeX word count, document format conversion, Pandoc LaTeX, multi-language LaTeX, CJK LaTeX, RTL LaTeX, capybara LaTeX, AI typesetting, automated document creation, universal document skill, Claude Code plugin, AI coding assistant skill, LLM document generation, generative AI documents, GPT LaTeX alternative, AI-powered typesetting, best LaTeX skill, free LaTeX templates, open source LaTeX automation

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.