latex-compile

Compile TeX projects using Tectonic with fallback to TeX Live or MacTeX.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/AarnavBaddam/skills --skill latex-compile-aarnavbaddam
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: latex-compile
Source: https://github.com/AarnavBaddam/skills/tree/main/latex-compile
Command: npx skills add https://github.com/AarnavBaddam/skills --skill latex-compile-aarnavbaddam

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Compiling LaTeX documents often fails due to missing toolchains, wrong engines, or projects that need features like bibliographies and shell-escape. This Skill automates compiler detection and selection so a .tex file builds correctly without manual toolchain configuration. ## Core Features & Use Cases - Automatic Compiler Selection: Tries bundled Tectonic for simple projects and falls back to detected TeX Live or MacTeX when the project needs bibliography, shell-escape, index/glossary, or specific engines. - Flexible Build Options: Supports explicit compiler choice (tectonic or texlive), engine selection such as xelatex, custom output directories, and JSON output for scripting. - Smart Project Handling: Honors a leading % !TEX root = ... directive, uses latexmk for TeX Live builds when available, and enables SyncTeX with -synctex=1. - Use Case: You receive a research paper project with a .bib bibliography. Run the compile script on main.tex and it automatically routes to TeX Live with latexmk instead of failing under Tectonic. ## Quick Start Ask the AI to compile your main.tex file into a PDF, optionally specifying the xelatex engine or a custom output directory.

Frequently Asked Questions about latex-compile

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compile a LaTeX document to PDF from the command line?

Run the compile script with the absolute path to your main .tex file, and it automatically selects a compiler. Simple projects build with Tectonic, while complex ones fall back to TeX Live or MacTeX.

Tectonic vs TeX Live for building LaTeX projects?

Tectonic works well for simple self-contained documents and is tried first in auto mode. TeX Live or MacTeX is required when the project uses bibliographies, shell-escape, indexes, glossaries, or explicit non-Tectonic engines.

Can I compile LaTeX with xelatex instead of pdflatex?

Yes, pass the --engine xelatex option to the compile script to force a specific engine. This routes the build through the TeX Live toolchain rather than Tectonic.

Why does my LaTeX compilation fail with bibliography errors?

Bibliography projects need multiple passes with tools like biber or bibtex, which Tectonic-style single-pass builds may not handle. The auto mode detects bibliography usage and falls back to TeX Live with latexmk.

What happens if no TeX distribution is installed?

The script does not install TeX itself. If neither Tectonic nor a usable TeX Live or MacTeX installation is found, it stops and routes to the latex-doctor or texlive-runtime-installer skills.