---
**PyTeXMK** (Python TeX Make) is an automated LaTeX build tool written in Python, inspired by `latexmk`. It intelligently determines the number of compilation passes based on auxiliary file changes, with Rich-colored terminal output and automatic bibliography/index toolchain orchestration — making the LaTeX build workflow a one-shot command.
---
## ✨ Features
### Core Compilation
- 🚀 **Multi-engine support**: XeLaTeX, PdfLaTeX, LuaLaTeX — switch freely via CLI flags or magic comments
- 🔁 **Smart multi-pass detection**: Automatically diffs `.aux`/`.out` file contents and parses Rerun warnings in logs, ensuring cross-references, hyperref bookmarks, and page counts converge stably
- 📋 **Structured compile-detection report**: After each pass, outputs a 6-dimension status report (bibliography, index, TOC, cross-references, bookmark file, log rerun), clearly showing which dimensions are stable and what's expected next
### Bibliography & Index
- 📚 **Bibliography**: Auto-orchestrate bibtex / biblatex (biber) / thebibliography
- 📑 **Index & glossary**: glossaries (incl. glossaries-extra + bib2gls + biber), nomencl, makeidx — auto-selects xindy or makeindex backend
- 🔮 **Magic comments**: Customize compilation behavior via `% !TEX` comments (engine, main file, output dir, auxiliary dir)
### Helper Tools
- 🧹 **Smart cleanup**: Multiple clean modes for precise auxiliary file removal by directory scope or file suffix
- 🔍 **Log parsing**: Auto-parse LaTeX logs on failure to locate error positions
- 📝 **LaTeXDiff**: Diff two LaTeX files, producing a PDF with revision marks
- 🖼 **PDF repair & preview**: Auto-repair corrupted PDFs; open default viewer after compilation
### Configuration & Extensibility
- 🌍 **Internationalization**: Multi-language UI support (default: Chinese)
- ⚙️ **Two-level config**: User-level and project-level `.pytexmkrc`, every parameter is customizable
- 🧩 **Multi-subproject management**: Manage and compile multiple independent subprojects under one root directory
- 🪲 **Version check**: Automatic update notifications
---
## 📸 Preview