texform
The missing foundation for LaTeX formula processing.
TeXForm parses, edits, and transforms LaTeX math, built on a structured knowledge base of 530+ command and environment specifications across 7 LaTeX packages, validated against MathJax, KaTeX, and XeTeX.
This crate is the public TeXForm facade — the only crate with a stability guarantee. It exposes the full API surface: a parse-only Parser, an editable Document tree, a profile-based TransformEngine, canonical serialization, and validate_argspec.
Quick start
use ;
// Normalize a formula into a canonical form chosen by profile.
let engine = builder.profile.build?;
let result = engine.normalize?;
assert_eq!;
// Parse, inspect diagnostics, and serialize back to LaTeX.
let parser = builder.build?;
let parsed = parser.parse;
if let Some = parsed.document
Profiles select the normalization target: Authoring (polished author-facing output), Faithful (same rendered formula, macros expanded), Corpus (training-data normalization), and Equiv (formula equivalence comparison).
Stability
texform follows semantic versioning and is the only public entry point. The texform-* crates it depends on are internal implementation details — they are published only because crates.io requires it, and their APIs may change in any release. Do not depend on them directly.
Links
- GitHub repository — full README, examples, and contribution guide
- API documentation
- Architecture overview
- Playground — try TeXForm in the browser
License
Apache-2.0.