| name | latex-compile |
| description | Compile a LaTeX .tex file into a PDF using a Docker sandbox. This is a fully deterministic operation — no LLM is involved. Takes texContent as input, runs xelatex (or pdflatex fallback) inside a sandboxed Docker container, and returns the compiled PDF as base64 along with the compilation log. Use when you need to compile a .tex file to PDF, either after template filling or after user edits.
|
LaTeX Compile
This skill is fully deterministic — it runs a LaTeX compiler inside a
Docker container and returns the result. No LLM reasoning is needed.
Prerequisites
The Docker image resumeagent-latex must be available locally:
docker pull ghcr.io/applyu-ai/resumeagent-latex:latest
docker tag ghcr.io/applyu-ai/resumeagent-latex:latest resumeagent-latex
cd sandbox && docker build -t resumeagent-latex .
Behavior
- Write the
.tex content to a temporary directory.
- Run a Docker container (
resumeagent-latex) with security constraints
(no network, read-only root, memory/CPU limits).
- Inside the container:
xelatex (preferred, for CJK support) or
pdflatex (fallback) compiles the document twice (for cross-references).
- If compilation succeeds: return the PDF as base64 + compilation log.
- If compilation fails: return the error log for debugging.
- Optionally generate a DOCX via
pdf2docx (best-effort).
Error Handling
When compilation fails, the log contains the error location:
! LaTeX Error: ...
l.42 \resumeSubheading{...
Common fixes:
- Missing
} → check for unbalanced braces
- Undefined control sequence → check command spelling
- Missing
\item → ensure itemize/enumerate has at least one \item
- File not found → check
\input or \include paths
The agent should read the error log, identify the issue, fix the .tex
source, and retry compilation (up to 2 retries).