CGO_ENABLED=0LICENSE=BSD-3-Clausemacros: LPPL-1.3cfonts: OFL-1.1Tested onamd64arm64go-tex is a pure-Go TeX effort. Its engine is a faithful re-implementation of TeX, and on top of it it loads and runs the genuine LaTeX classes: \documentclass{article}, {report} and {book} execute the real, embedded .cls files (LPPL, verbatim) — not an emulation. They also run in the browser through js/wasm, with no server.
out, _ := engine.New().Run(`\def\twice#1{#1#1}\message{\twice{\twice A}}`)
// out == "AAAA"The engine is a faithful re-implementation of TeX — the category-code mouth and gullet, a scaled-point stomach with Knuth–Plass line breaking and a cost-based page builder, \halign tables, math, OpenType fonts, and PDF/SVG output. The class files are embedded and the resolver needs no filesystem, so the real classes also run in the browser — genuine LaTeX class rendering client-side, with no TeXLive and no server.
article, report and book load and run the genuine embedded LaTeX .cls files — numbered title, dotted TOC, numbered sections and chapters, figure and table captions, lists, math.
Category-code mouth and gullet, a scaled-point stomach with Knuth–Plass line breaking, a cost-based page builder that keeps TeX’s page_total and page_depth apart — the depth of a page’s last line is capped at \maxdepth and not charged against the goal, so a page that fills to exactly \textheight is accepted — and \halign tables.
\halign entries run live as tex.web §785-791 does, \leaders, \cleaders and \xleaders are real primitives, and \c@page is a real count register. geometry keeps its default body and restores the preamble layout with \restoregeometry; a4, eso-pic shipout pictures, setspace in floats and footnotes, titlesec, manyfoot, algorithm2e, tocdepth, comment, xstring and \DeclareUnicodeCharacter are handled, and elsarticle front matter and acmart’s Biolinum and Inconsolata faces are set.
\fontsize reads any TeX unit and a class’s restated \normalsize becomes the body size; \PassOptionsToClass expands its options; authblk authors accumulate; \setcounter{page} and \pagenumbering change the printed folio; and align places a \tag that cannot fit on its own line, as amsmath does, with \text keeping its spaces (go-tex/math v0.51.0). Over 140 corpus papers, Σ|page deviation| from the reference fell from 258 to 219 and exact pagination rose from 29 to 42 (v0.288.0 to v0.299.0; v0.300.0 is not measured yet).
tabularray tblr, longtblr and talltblr are set, with the rowhead rows repeated and a “Continued on next page” foot on every page of a split table; titlesec’s explicit option passes the title as #1; elsarticle 5p is two columns under a spanning title block. Over 140 corpus papers, Σ|page deviation| went from 245 to 239 (engine v0.301.0 to v0.303.0).
Weighted by how many corpus papers call them, 93.5% of the latex.ltx kernel’s command use is accepted by the engine (engine v0.307.0; the package scope counts only the names a package defines itself); how it is counted, and what it does not claim.
Math via go-tex/math (vector output); OpenType fonts with a built-in default font, kerning and ligatures — runs with no assets, and a full family (roman, bold, italic, slanted, typewriter, sans) when one is given. The size ladder is the class’s own table to the point, not a whole-point approximation of it: all ten of \tiny…\Huge match tectonic, including the three that are not whole numbers (\Large 14.4, \LARGE 17.28, \huge 20.74), and an [11pt] class sets its body at the 10.95 its \@xipt states. Kerning comes from every GPOS lookup rather than the first that covers a pair: \hbox{AV} in Libertinus at 10pt is 12.35pt, XeTeX’s own figure, where stopping at the first lookup gave 13.47.
Embedded-subset-font PDF with selectable text, and self-contained SVG pages carrying a source map for click-to-line.
A self-contained js/wasm build renders real LaTeX classes client-side — no TeXLive, no server.
A .tex is a program, and the playground runs whatever you paste. A document compiled by the engine cannot run a process, cannot write a file, cannot read one outside the search roots (TeX Live’s openin_any=p, with GOTEX_READ_ANY=1 as a named opt-out), and cannot exhaust memory or run forever: one paragraph is capped at 200 000 nodes.
A byte-exact conformance ratchet plus a whole-document prose check against a real LaTeX engine (tectonic): on the 121 of 154 papers whose reference carries a bibliography the check can read, the median |r−1| is 1.69%, with 86 within ±5% and 101 within ±10% (measure fid, label elevenpt-trt, at engine v0.271.0). The other 33 are named, not hidden in the denominator: 32 references without a bibliography and one unreadable. This sentence used to quote the whole 154 for a check that runs on 121, and a statistic the tool does not print — a hidden denominator of exactly the kind this project files defects about, and the figure is now the one fid reports, at the version it was reported for (go-tex.github.io#220). Pagination lands on the reference exactly for 47 of the 154, with a total absolute deviation of 272 pages and a signed bias of −12 — down from +50, because the page builder no longer fires a page the moment its height passes \vsize: TeX fires it when the excess beats what the page’s own glue can shrink away (engine#693). The 272 is the open figure, tracked as engine#695. It is also the wrong number to read some work by: it counts PAGES, so a change that moves glyphs inside a line — a kern, a heading set at 14.4pt instead of 14 — costs a page only when it tips one. Making the size ladder exact changed 124 of the 154 renders and moved this figure by zero (engine#716), and giving running heads their marks changed 6 renders at identical page counts — visible only to a per-page hash, and worth 27 of the 128 papers with a reference getting the head they had been missing (engine#426, engine#729). That one took four fixes, three of them correct and insufficient: a one-line stub that discarded \mark’s argument sat one layer below all three, and what found it was a test asking not whether the layer was right but whether the node arrived.
The engine loads and runs the standard base classes — article, report, book and amsart as real embedded files — and any resolvable .cls/.sty runs as real TeX macros. Heavy drawing (tikz/pgf) is gated and still in bring-up, biblatex is partly supported, PDF figures need the pdfrender module, and floats typeset inline unless placement is enabled. Every supported feature — and every remaining gap — is listed in the capability reference.
The pure-Go TeX engine: a faithful mouth and gullet, a scaled-point stomach with Knuth–Plass line breaking and a cost-based page builder that keeps page_total and page_depth apart, \halign tables, e-TeX, math, OpenType fonts, PDF and SVG output, and the real embedded LaTeX classes (article, report, book, amsart), native and js/wasm.
Pure-Go TeX math-mode typesetter to self-contained SVG, through the OpenType MATH table: fractions, radicals, matrices, big operators with limits, stretchy delimiters, scripts. Ships STIX Two Math; wasm-ready.
Pure-Go TeX font metric (.tfm) reader. Scaled dimensions and \fontdimen parameters are bit-identical to TeX: 7816 values checked against tectonic 0.17.0, to the scaled point.
Pure-Go (CGO=0) rasteriser for PDF figures. Plugs into the engine's RasterizePDF seam so \includegraphics{fig.pdf} renders pixels instead of a framed placeholder. A separate module, to keep the engine and wasm core free of a heavy dependency.
On-demand TeX support-tree fetcher for machines with no TeX distribution. Redistributes nothing: it fetches pinned, SHA-256-verified upstream macro source into a user cache and supplies Tree.Resolve to the engine. Never fetches speculatively.
Pure-Go (CGO=0) processor for a subset of LaTeX documents: macro expansion, structure and math to semantic HTML rather than to a page. Where the engine typesets, this one reads — a foundation for full LaTeX on the HTML path.
The documentation site (MkDocs Material + mike), versioned, at /docs/. The capability reference — every supported feature and every remaining gap, class by class and package by package — is published by THIS site, at /capabilities/: a project Pages site wins /docs/ over an organisation site's directory of the same name, which is why it is not there. Source →
Logos and icons for the organization.
Pure Go, CGO_ENABLED=0, native and in the browser. Safe on untrusted input: a compiled document cannot run a process, write a file, or read one outside the search roots.