Documentation
¶
Overview ¶
Command gotex-wasm compiles the engine to GOOS=js/wasm and exposes LaTeX compilation to JavaScript, so an editor like loom can render LaTeX to SVG *directly in the browser* — no server round-trip, no microVM, no TeX Live. This is the capability TeX Live can never have: client-side live preview.
It registers two globals:
gotexToSVG(source [, {size, margin}])
→ { pages: [svgString, …] }
| { error, errorLine?, errorCol?, errorMessage? }
gotexVersion() → a short identifier string
On failure `error` is always a human string; when the failure has a source location it also carries errorLine (1-based), errorCol (0-based) and errorMessage so the editor can point at the exact spot. Each rendered page's SVG groups glyphs under <g data-l="N"> (N = source line) for click-to-source and jump-to-line navigation.
The built-in font is embedded, so it runs with no assets. \input and \font from disk are unavailable in the browser sandbox (no filesystem); a document's text is compiled with the built-in font unless it selects one another way.