Latex Compiler
Documentslatex-compilerLatex Compiler is an Agent Skill for documents published in the Prismer-AI/Prismer repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Compile LaTeX documents to PDF using pdflatex, xelatex, or lualatex with template support. Use when the user asks to compile .tex files, build a LaTeX document, generate PDF from LaTeX, or typeset an academic paper.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/Prismer-AI/Prismer/blob/HEAD/skills/latex-compiler/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/latex-compiler, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
latex-compiler
Compile LaTeX documents to PDF directly from the workspace. Supports multiple engines, bibliography processing, and starter templates.
Description
This skill wraps the container's LaTeX server (port 8080) which provides pdflatex, xelatex, and lualatex compilation. It supports bibliography processing via biber, multi-pass compilation for cross-references, and includes starter templates for common document types.
Usage Examples
- "Compile this LaTeX document to PDF"
- "Preview the PDF output of my paper"
- "What LaTeX templates are available?"
- "Give me the IEEE template"
- "Compile this with xelatex for Chinese support"
Process
- Choose template — Use
latex_templatesto see available templates, thenlatex_get_templateto get starter content - Write LaTeX — Edit the source document
- Compile — Use
latex_compileto generate the PDF (saved in container). If compilation fails, check theerrorsfield in the response for line numbers and fix LaTeX syntax issues before recompiling - Preview — Use
latex_previewto get an inline base64 PDF for display
Tools
latex_compile
Compile LaTeX source to PDF. The PDF is saved inside the container.
Parameters:
content(string, required): Full LaTeX source codefilename(string, optional): Output filename stem (default:document)engine(string, optional):pdflatex|xelatex|lualatex(default:pdflatex)bibliography(string, optional): BibTeX/BibLaTeX content (triggers biber)runs(number, optional): Compilation passes (default: 2 for cross-references)
Returns: { success, pdf_path, log, errors, warnings, compile_id }
Example:
{ "content": "\\documentclass{article}\\begin{document}Hello\\end{document}", "engine": "pdflatex" }
latex_preview
Compile LaTeX source and return the PDF as base64 for inline preview.
Parameters:
content(string, required): Full LaTeX source codefilename(string, optional): Output filename stem (default:document)engine(string, optional):pdflatex|xelatex|lualatex(default:pdflatex)bibliography(string, optional): BibTeX/BibLaTeX content (triggers biber)
Returns: { success, pdf_base64, pdf_path, log, errors, warnings, compile_id }
Example:
{ "content": "\\documentclass{article}\\begin{document}Hello\\end{document}" }
latex_templates
List available LaTeX templates and supported engines.
Parameters: None
Returns: { templates: string[], engines: string[] }
latex_get_template
Get the LaTeX source of a starter template.
Parameters:
name(string, required): Template name —article,article-zh,beamer,ieee
Returns: { name, content }
Example:
{ "name": "ieee" }
Notes
- Chinese documents (
article-zh) requirexelatexorlualatexengine - Compilation timeout is 120 seconds per run
- Multi-pass compilation (default 2 runs) resolves cross-references and TOC
- If
bibliographyis provided, biber runs automatically between passes - PDFs are saved to
/home/user/output/reports/inside the container