TeX Core is a cross-platform LaTeX renderer: a C engine that turns self-contained LaTeX source — a single file or a single block — into an immutable, platform-neutral render tree with fully resolved layout, plus idiomatic bindings for Swift, Kotlin Multiplatform, and ECMAScript/TypeScript. One release gives every platform the same parsing, layout, metrics, and canonical dump behavior.
TeX Core deliberately stops at the render tree. It does not rasterize, load font files, or draw. Consumers map the tree onto their platform's native rendering technology:
- Web — MathML from the tree's semantic view, or SVG/Canvas from its geometric view.
- Swift / Apple —
NSAttributedStringtext attachments, Core Text, or custom views. - Kotlin / Android / JVM — spans, custom views, Compose layouts, or Java2D.
TeX Core is the rendering companion to Markdown Core: the formula spans its formula extension captures are exactly the inputs TeX Core renders. The two projects remain independently consumable.
Pre-release; the infrastructure phases (1–10) of the setup plan and
milestone M1 (math core) are complete; M2 (math environments) is
underway.
The C
engine, its render-tree contract (schemaVersion 5), the Swift, Kotlin
Multiplatform, and ES/WASM bindings, the fail-closed CI quality gates, and
the release workflows are all in place. Document.compile covers ordinary
text atoms with explicit spacing in document mode and, in the math modes,
classed math atoms — the ASCII math characters plus the M1 symbol-command
set (Greek letters, binary operators, relations, arrows, letter-like and
delimiter symbols) — with braced groups, superscripts and subscripts set
at TeX's script sizes per Appendix G, fractions and binomials (\frac,
\dfrac, \tfrac, \binom family) built by Appendix G rule 15, and
variable-size delimiters (\left/\right, the \big family) grown
through the Computer Modern size faces into piece assemblies per rule 19,
radicals (\sqrt with the optional LaTeX index) per rule 11, and big
operators and function names (\sum/\int/\sin/\lim with
display limits per rule 13a and \limits/\nolimits), and math
accents (\hat through \vec, wide variants) per rule 12, and the
style switches and \text (\mathrm through \mathtt over the
bold/italic/calligraphic/double-struck/sans/typewriter faces), laid out
with TeX's inter-atom spacing over embedded Computer Modern metrics,
with byte-identical canonical dumps on every platform. That completes
the M1 math-core surface. M2 (math environments) has begun: the
\begin/\end alignment environments cover the matrix family
(matrix through Vmatrix), cases, and smallmatrix, each over
its amsmath geometry — strut row floors and zeroed interline glue for
the array-based environments, natural rows under real glue for
smallmatrix, centered or left-aligned columns at their definition's
gaps, the
stack \vcenter-ed on the math axis, fences grown per rule 19. The
remaining M2–M4 surface (aligned, extensibles, text galley, domain
notations) lands before 1.0.0. Nothing usable is published yet.
Build and test the C core:
make build && make test # or: cmake --preset default && ctest --preset correctness| Platform | Coordinate | Entry point |
|---|---|---|
| C | tex-core (CMake/pkg-config; GitHub Release archives) |
tex_core_document_compile |
| Swift | SwiftPM https://github.com/nouprax/tex-core, product TexCore |
Document.compile |
| Kotlin Multiplatform | com.nouprax:kotlin-tex-core (Maven Central) |
Document.compile |
| ECMAScript / WASM | @nouprax/es-tex-core (npm) |
Document.compile |
All packages release the same version from the same protected vX.Y.Z tag.
The ES package is ESM-only:
import { Document } from "@nouprax/es-tex-core";
const tree = Document.compile("E = mc^2", { mode: "mathInline" });
if (!tree.dump().startsWith("render-tree 5\n")) {
throw new Error("unexpected render-tree schema");
}Capability grows along a fixed major-version ladder:
- 1.0.0 — Full LaTeX rendering of self-contained input. A single file or single block renders completely; mathematics, chemistry, physics, biology, and other domain notations are subsets of that one LaTeX surface. The programmable TeX layer (user macros), reference resolution, package/module loading, multi-file input, and page breaking are deliberately out — output is one continuous galley.
- 2.0.0 — Incremental rendering. Markdown-core-v2-style sessions: mutate
the input and receive the updated render tree as fast as possible, with
immutable structurally-shared snapshots, deltas, snapshot-owned source
range resolution, and damage-proportional commit cost. The planned
session/resolver/cache contract is recorded in
docs/specs/incremental-editing.md. - 3.0.0 — Full TeXbook support. The programmable TeX layer, modules, multi-file projects, references, and page building: a product-ready core for a TeX project editor.
docs/specs/2026-07-20-repo-setup.md— the normative setup plan: positioning, naming family, architecture, package requirements, and the phased task breakdown.docs/repository-setup-template.md— the normative CI/release/control-plane contract, imported from markdown-core.docs/specs/render-tree.md— the canonical render-tree schema contract (schemaVersion 5), withdocs/specs/render-tree-dump.mdas its deterministic textual form andspecs/render-tree/as the executable cross-platform conformance corpus.docs/specs/incremental-editing.md— the planned2.0.0session, source-range resolver, cache ownership, and damage-proportional cost contract.docs/specs/c-naming.md— C naming conventions for the engine and its test tree.
BSD-2-Clause, copyright Nouprax.