askill
academic-latex

academic-latexSafety 90Repository

Compile LaTeX documents to PDF using the container's TeX Live installation. Supports pdflatex, xelatex, and lualatex engines.

657 stars
13.1k downloads
Updated 2/5/2026

Package Files

Loading files...
SKILL.md

Academic LaTeX — Compile LaTeX to PDF

Overview

This skill lets you compile LaTeX documents into PDFs using the container's full TeX Live 2023 installation. Three engines are available: pdflatex (fastest), xelatex (Unicode/system fonts), and lualatex (Lua scripting).

When To Use

  • User asks to compile LaTeX, create a PDF, or typeset a document
  • User provides .tex content or asks you to write LaTeX
  • User needs academic paper templates (IEEE, ACM, article, beamer)

Compile via REST API

The LaTeX server runs at http://localhost:8080.

Basic compile

# Write LaTeX to a file
cat > /tmp/doc.tex << 'TEX'
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
TEX

# Compile via API — output is raw PDF bytes
curl -sf -X POST http://localhost:8080/compile \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg tex "$(cat /tmp/doc.tex)" '{content: $tex, engine: "pdflatex"}')" \
  -o /workspace/output/document.pdf

Engine selection

EngineUse when
pdflatexDefault. Fast. Standard ASCII/Latin documents.
xelatexUnicode text, system fonts, CJK characters.
lualatexLua scripting, advanced typography.
# Chinese document — use xelatex
curl -sf -X POST http://localhost:8080/compile \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg tex "$(cat /tmp/doc.tex)" '{content: $tex, engine: "xelatex"}')" \
  -o /workspace/output/document.pdf

Quick preview (lower quality, faster)

curl -sf -X POST http://localhost:8080/preview \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg tex "$(cat /tmp/doc.tex)" '{content: $tex}')" \
  -o /workspace/output/preview.pdf

List available templates

curl -sf http://localhost:8080/templates | jq .
# → {"templates": ["article", "article-zh", "beamer", "ieee"], "engines": [...]}

Health check

curl -sf http://localhost:8080/health | jq .

Compile via CLI (alternative)

For multi-file projects or BibTeX workflows, use CLI directly:

cd /workspace/projects/my-paper
pdflatex -interaction=nonstopmode main.tex
bibtex main
pdflatex -interaction=nonstopmode main.tex
pdflatex -interaction=nonstopmode main.tex
cp main.pdf /workspace/output/

API Reference

EndpointMethodBodyResponse
/compilePOST{"content": "<tex>", "engine": "pdflatex|xelatex|lualatex"}PDF binary (200) or error JSON (4xx)
/previewPOST{"content": "<tex>"}PDF binary
/templatesGETJSON list of templates and engines
/healthGETJSON health status

Error Handling

  • HTTP 400+: compilation failed. Response body is JSON with error and log fields.
  • Read the LaTeX log to identify missing packages or syntax errors.
  • All standard TeX Live packages are pre-installed.
  • For missing packages, check: kpsewhich <package>.sty

Workflow

  1. Write .tex content (inline or from user input)
  2. Save to /tmp/ or /workspace/projects/<name>/
  3. Compile via API or CLI
  4. Save PDF to /workspace/output/
  5. Report the output path to the user

Tips

  • Always save PDFs to /workspace/output/ for persistence and web UI access.
  • For multi-file projects, use CLI compilation instead of the API.
  • BibTeX/Biber are available for bibliography management.
  • Pandoc 3.1 is available for format conversion (Markdown → LaTeX, etc.).

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

92/100Analyzed 2/13/2026

An exceptionally well-structured skill for LaTeX compilation. It provides clear triggers, robust copy-pasteable commands (handling JSON safely with jq), and covers both API and CLI methods. While highly specific to a containerized environment, the documentation quality is outstanding.

90
95
65
95
95

Metadata

Licenseunknown
Version-
Updated2/5/2026
PublisherPrismer-AI

Tags

apici-cdgithub-actions