Render LaTeX preview
render_previewCompile LaTeX to PDF and update live preview locally. Uses local TeX or bundled WASM, returns compile status and preview URL.
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.
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. |