Render LaTeX preview
render_previewCompile LaTeX to PDF and update the live preview, using local TeX or a bundled WASM engine. Get compile status, engine, and preview URL to verify rendered pages.
Instructions
Compile the current project's LaTeX to a PDF locally and update the live preview. Uses the machine's TeX install when it has one, otherwise a bundled WASM TeX Live in a headless browser — so no local TeX is required. Returns compile success/errors, which engine and backend ran, the file count, and the local preview URL — open it to see the rendered pages. Call this after editing .tex files to see and verify the rendered result.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "render_preview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| engine | No | TeX engine. Defaults to xelatex. | |
| backend | No | Compiler backend. Default "auto": use the local TeX install (latexmk) when there is one — full package fidelity, output matching Overleaf — else the bundled WASM TeX Live. "system" forces the local one and errors if absent; "wasm" forces the bundled one. | |
| mainFile | No | Path to the main .tex file, relative to the project root. Auto-detected (by scanning for \documentclass) if omitted. | |
| shellEscape | No | Let the document run external programs (LaTeX shell-escape) — needed by \includesvg (Inkscape), minted (Pygments) and similar. Off by default: it lets a .tex execute shell commands, so enable it only for sources you trust. Has no effect on the wasm backend, which cannot run subprocesses at all. |