LaTeX to PDF Compiler API avatar

LaTeX to PDF Compiler API

Pricing

from $1.00 / 1,000 results

Go to Apify Store
LaTeX to PDF Compiler API

LaTeX to PDF Compiler API

Compile LaTeX to PDF via API. Send LaTeX source (or a zip of a multi-file project), get back a rendered PDF. Powered by Tectonic — no TeX installation needed. Works as an MCP tool for AI agents.

Pricing

from $1.00 / 1,000 results

Rating

0.0

(0)

Developer

Josef Bednář

Josef Bednář

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a month ago

Last modified

Share

Compile LaTeX to PDF via a simple API call — no TeX installation, no Docker setup, no 2 GB TeX Live download. Send LaTeX source (or a zip with a full multi-file project) and get back a rendered PDF. Runs Tectonic, a modern XeTeX-based engine, with common packages pre-cached for fast compiles.

Works great as a building block in automation pipelines (invoices, reports, resumes, certificates) and as an MCP tool for AI agents — LLMs write LaTeX well, and this actor turns that LaTeX into an actual PDF.

Features

  • Plain LaTeX in, PDF out — paste source or point to a zip of a full project
  • Multi-file projects — images, chapters, .bib files via filesZipUrl
  • Modern engine — Tectonic (XeTeX core): UTF-8 native, auto-fetches missing packages
  • Fast — common packages (amsmath, geometry, hyperref, booktabs…) are pre-cached
  • Safe — shell-escape is disabled; each compile runs in an isolated container
  • Failure logs — on error you get the compiler log tail to fix your document

Input

FieldTypeDescription
texSourcestringLaTeX document source
filesZipUrlstringURL of a zip with a multi-file project (overrides texSource)
mainFilestringEntry .tex file, default main.tex
timeoutSecsintegerCompile timeout, default 120

Output

The PDF is stored as output.pdf in the run's key-value store. The dataset record gives you the direct download URL:

{
"status": "SUCCESS",
"pdfUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/output.pdf",
"sizeBytes": 24817,
"compileTimeMs": 1843
}

Usage from code

curl -s "https://api.apify.com/v2/acts/josefbednar~latex-to-pdf-api/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
-X POST -H 'Content-Type: application/json' \
-d '{"texSource": "\\documentclass{article}\\begin{document}Hello PDF\\end{document}"}'

FAQ

Which LaTeX engine is this? Tectonic, built on XeTeX. It handles modern LaTeX, UTF-8, and system-font-free documents. Most documents that compile with pdflatex/xelatex work unchanged.

Can I compile a whole thesis/project? Yes — zip the project folder, host the zip anywhere reachable, pass filesZipUrl and set mainFile to your entry file.

Is BibTeX supported? Tectonic runs the full compile loop including bibliography processing for most standard setups (biblatex with the default backend works; classic bibtex workflows may need a pre-generated .bbl in the zip).

Why did my compile fail? Check the logTail in the output record or the full compile-log.txt in the key-value store — it contains the standard LaTeX error output.