Untie Documentation
Untie parses TeX or Typst math into one language-neutral IR and lays that IR out with a host-supplied OpenType MATH font. The result is a UI-independent display list of filled…
These docs describe the public API at library version 0.2.1 and layout
revision 1. They focus on the behavior a host or code assistant can rely on
when integrating Untie; they are not a TeX or Typst language tutorial.
Start Here
- Getting started shows the complete
LoadMathFont->NewRenderer->Render-> draw flow, with the lower-level engine path documented separately. - Core concepts and ownership explains the pipeline, the lifetime of each value, and the inline/display boundary.
- Rendering the display list defines coordinates, items, lines, tags, hits, overflow, bounds, drawing helpers, and optional SVG/PNG output.
Integration Guides
- MyGo integration provides the bounded adapter for MyGo Markdown math, direct UI elements, theme-role drawing, and existing-box drawing.
- Fonts and fallback covers the required math face, optional text face, ordered fallbacks, face IDs, and font identity.
- Parsing, diagnostics, and recovery covers TeX and Typst input, source ranges, diagnostics, links, and recoverable output.
- Errors and resource limits describes fatal layout errors, parse-time recovery, and configurable limits.
- Canonical IR and
Engine.LayoutFormulaContextis for hosts that inspect or cache the language-neutral formula tree. - Concurrency, lifecycle, and caching describes safe reuse, cancellation, package-level caching, and ownership under concurrency.
- Accessibility text explains
Alt.Text,Alt.Speech, fallback markers, and how accessibility errors differ from layout errors.
Compatibility and Verification
- Supported TeX summarizes the tested TeX math subset and its explicit exclusions.
- Supported Typst summarizes the restricted Typst math frontend and its explicit exclusions.
- API stability tiers separates the host API, advanced IR types, and diagnostic serialization.
- Release process records versioning, module tags, and the automated GitHub release gate.
- Security policy explains supported versions and private vulnerability reporting.
- Compatibility and verification summarizes the tracked corpora and reviewed coverage.
- Performance explains the benchmark workload, cache strategies, and allocation metrics.
- Migrating to 0.2 maps the removed low-level font and drawing conveniences to the current host facade, render helpers, and output adapters.
encode/svgemits deterministic standalone SVG through the same framework-neutral drawing protocol.encode/rasterrenders a display box to a deterministic antialiased RGBA image or PNG without cgo or a UI dependency.
Recommended Reading Paths
For a normal application:
For an editor or document application:
- Parsing, diagnostics, and recovery
- Concurrency, lifecycle, and caching
- Accessibility text
- The supported-syntax page for the active input dialect
For a host that stores or transforms formula trees:
Scope
Untie does not provide a document engine, font discovery, system keyboard
layout, DOM, network access, or semantic TeX/Typst execution. The host owns
those concerns. Untie's contract ends at a validated Box, its accessibility
text, and its source metadata.
The bundled examples/mygo application demonstrates direct
formula elements in a native editor.
For MyGo integration, use contrib/mygo. It can
render a formula directly as a ui.Element, bind Markdown math, or draw an
existing Untie box.