Builds LaTeX documents using latexmk with live preview and dependency tracking. Use when setting up builds, live preview, or troubleshooting compilation.
This skill is limited to using the following tools:
references/advanced-patterns.mdreferences/common-commands.mdreferences/configuration.mdreferences/multi-file-projects.mdreferences/troubleshooting.mdWhen to use this skill:
Industry standard build tool:
latexmk -pdf document.tex
# Result: document.pdf created
latexmk -pvc -pdf document.tex
# What happens:
# - Compiles document initially
# - Watches for file changes
# - Auto-recompiles when files change
# - Auto-reloads PDF in Skim viewer
Stop watching: Press Ctrl+C
# Build once
latexmk -pdf document.tex
# Live preview (watch mode)
latexmk -pvc -pdf document.tex
# Build with SyncTeX
latexmk -pdf -synctex=1 document.tex
# Clean artifacts
latexmk -c # Keep PDF
latexmk -C # Remove PDF too
# Force rebuild
latexmk -gg -pdf document.tex
# Non-interactive (for CI)
latexmk -pdf -interaction=nonstopmode document.tex
which latexmklatexmk -pdf document.tex-synctex=1 flaglatexmk -pvc -pdf document.texlatexmk -c removes artifactsFor detailed information, see:
Official Docs: Run man latexmk or latexmk -help for complete reference
See Also:
latex/setup skill for installing LaTeX and configuring environmentlatex/tables skill for creating tables with tabularray