Render a document to PDF
render_documentCompiles a document you wrote — LaTeX, Typst or Markdown — to a PDF, files it in this account's own storage, and returns a link the user can open (it lasts about six days).
latex is real TeX (Tectonic, XeTeX underneath): journal and conference classes such as IEEEtran, acmart and elsarticle set the page as they would on the author's machine, and BibTeX bibliographies are built. The source is the main .tex; put the rest of the project — chapters, a refs.bib, a .cls — in files, and images either as base64 in files or as assets URLs. Shell escape is off, so minted does not run (use listings); biber is not available (use BibTeX). The first compile of a rarely used package can take a minute while it is fetched.
typst is a complete Typst document; packages from Typst Universe (#import "@preview/…") work. markdown is set in a clean report style, with LaTeX maths in $…$ and $$…$$.
If the source does not compile, the compiler's own message comes back — for LaTeX, the line that failed: fix the source and call again.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"format": "<format>",
"source": "<source>"
},
"name": "render_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | A file name for the PDF, without extension, e.g. 'thesis-chapter-2'. Optional. | |
| files | No | LaTeX only: the rest of the project beside the main file. Each {path, text} for a .tex, .bib, .cls or .sty, or {path, base64} for an image or other binary file. Paths are relative, as the source refers to them, e.g. chapters/intro.tex or figures/plot.png. | |
| assets | No | Files the source refers to by relative path, fetched before compiling (latex or typst). Each {url, path}: a public https URL and the path the source uses, e.g. {"url": "https://example.org/plot.png", "path": "figures/plot.png"}. | |
| format | Yes | latex, typst or markdown. | |
| source | Yes | The whole document, as text — for latex, the main .tex file. |