academic-latex
2
总安装量
2
周安装量
#71060
全站排名
安装命令
npx skills add https://github.com/prismer-ai/prismer --skill academic-latex
Agent 安装分布
openclaw
2
antigravity
2
claude-code
2
github-copilot
2
codex
2
kiro-cli
2
Skill 文档
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
.texcontent 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
| Engine | Use when |
|---|---|
pdflatex |
Default. Fast. Standard ASCII/Latin documents. |
xelatex |
Unicode text, system fonts, CJK characters. |
lualatex |
Lua 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
| Endpoint | Method | Body | Response |
|---|---|---|---|
/compile |
POST | {"content": "<tex>", "engine": "pdflatex|xelatex|lualatex"} |
PDF binary (200) or error JSON (4xx) |
/preview |
POST | {"content": "<tex>"} |
PDF binary |
/templates |
GET | â | JSON list of templates and engines |
/health |
GET | â | JSON health status |
Error Handling
- HTTP 400+: compilation failed. Response body is JSON with
errorandlogfields. - 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
- Write
.texcontent (inline or from user input) - Save to
/tmp/or/workspace/projects/<name>/ - Compile via API or CLI
- Save PDF to
/workspace/output/ - 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.).