latex-compile

Solid

Compile a LaTeX document and fix every error plus aesthetic issue (overfull/underfull boxes, widows, alignment, fonts) for a clean PDF and log. Use this instead of running pdflatex/latexmk manually — it avoids the latexmk stale-log trap and silent grep failures on binary log output, and it reformats rather than rewording.

AI & Automation 52 stars 4 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
57
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# latex-compile Compile a LaTeX document, fix all errors **and** all aesthetic issues so the PDF is clean and the log is empty — without ever altering content to make things fit. ## When to invoke After any edit to a .tex file. Also invoke before committing. ## Input The user may specify one or more files: `/latex-compile brief.tex workbook.tex`. Default: `workbook.tex`. Work from the project root (wherever CLAUDE.md lives). ## 1. Compile — always force a real pass, capture stdout **Critical: never trust the `.log` for warnings.** When `latexmk` decides targets are up-to-date it skips compilation and leaves a **stale** log that under-reports (or zeroes out) overfull warnings. Force a real `pdflatex` pass and capture its **stdout**: ``` pdflatex -interaction=nonstopmode <file> > /tmp/tex.txt 2>&1 ``` Run **twice** when cross-references, TOC, or forward `\ref`s changed (or a manual `\label` bibliography needs a second pass to resolve `\cite`). **Always use `grep -a`.** pdflatex embeds binary font-path bytes in its output, so plain `grep` treats the stream as binary and matches nothing. Every grep below uses `-a`. ## 2. Collect ALL issues from the fresh stdout ``` grep -anE "^! |LaTeX Error|[Uu]ndefined|Overfull|Underfull|multiply defined|Font (shape|Warning)|File .*not found" /tmp/tex.txt ``` **Case matters — this is the bug that lets `[?]`/`??` ship.** pdflatex writes `Undefined control sequence` (capital, a fatal error) but the broken-ref/cite *warnings* are lowerc...

Details

Author
Mexregkan
Repository
Mexregkan/claude-for-researchers
Created
3 months ago
Last Updated
1 weeks ago
Language
Shell
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category