# TeXForm > TeXForm parses, edits and normalizes LaTeX math using a knowledge base of command specifications. Open source, with packages for Python, JavaScript and Rust. TeXForm is open source (Apache-2.0). One Rust core backs packages for Python, JavaScript (WebAssembly, browser or Node.js) and Rust with the same API. - Install: `pip install texform`, `npm install texform`, or `cargo add texform`. The `texform` command-line tool ships with the Python package (`uv tool install texform`, or run once with `uvx texform`) and as the `texform-cli` crate (`cargo install texform-cli`). - Normalize with a `TransformEngine` and a profile. The four profiles form a ladder: `authoring` keeps the author's stylistic choices, `faithful` expands convenience macros while preserving rendering, `corpus` produces complete canonical forms for training labels, and `equiv` normalizes aggressively for equivalence checks and deduplication. - Start with Quick start, then Transforms for profiles and rules, and the API reference for your language. - Every page has a Markdown version: append `.md` to its URL (`/index.md` for the home page). `llms-full.txt` concatenates the documentation and API reference. ## Get started - [Documentation overview](https://texform.dev/docs.md): TeXForm parses, edits, and transforms LaTeX math from a command knowledge base, with one Rust core behind identical APIs in Rust, Python, and JavaScript. - [Installation](https://texform.dev/docs/installation.md): Install TeXForm from pip, npm, or cargo, and verify it works in Python, JavaScript, or Rust. - [Quick start](https://texform.dev/docs/quick-start.md): Normalize your first formula, pick a profile, and look at the document tree underneath — in 10 minutes. - [Playground](https://texform.dev/docs/playground.md): Try TeXForm in the browser: compare profiles, read parse diagnostics, and inspect the tree without installing anything. - [JavaScript and WebAssembly](https://texform.dev/docs/javascript-and-wasm.md): Pick the right texform entry point for Node or a bundler, configure top-level await and .wasm assets, and manage handle lifetimes. - [Command line](https://texform.dev/docs/command-line.md): Install the texform command to normalize, parse, and tokenize formulas from the shell, look up knowledge-base records, and serve the normalizer protocol. - [Docs for AI tools](https://texform.dev/docs/ai-tools.md): Give coding assistants and agents the TeXForm docs as Markdown: a .md version of every page, plus llms.txt and llms-full.txt at the site root. ## Concepts - [What TeXForm is](https://texform.dev/docs/what-is-texform.md): TeXForm parses, edits, and normalizes LaTeX math against a command knowledge base. What it does, what it leaves to renderers and CAS tools. - [How TeXForm compares](https://texform.dev/docs/comparison.md): TeXForm next to LaTeX parsers, normalization scripts, renderers, and CAS tools: a feature matrix for the tools that overlap with it, and when to use which. - [Pipeline](https://texform.dev/docs/pipeline.md): How a LaTeX formula travels through TeXForm, from source text through the parser and the document tree to its four exits. - [Parsing](https://texform.dev/docs/parsing.md): Why TeXForm parses LaTeX against a knowledge base, which packages it loads by default, and what a parse result can contain. - [Reading argspecs](https://texform.dev/docs/argspec.md): The notation TeXForm uses to describe LaTeX command and environment argument signatures, with one real command per parameter kind. - [Transforms](https://texform.dev/docs/transforms.md): How TeXForm normalizes a formula: pick a profile, run the phase loop to a fixed point, read the report, and switch phases off per run. - [Serialization](https://texform.dev/docs/serialization.md): How TeXForm turns a Document back into LaTeX text, tokens, or a structured snapshot, with a text idempotency guarantee and configurable style. - [Glossary](https://texform.dev/docs/glossary.md): TeXForm terminology in one place: profile, rule level, fidelity, SyntaxNode, Document, parse config, overlay, phase, and the contracts behind them. ## Guides - [Normalize a corpus](https://texform.dev/docs/normalize-a-corpus.md): Run one reused transform engine over a dataset, skipping bad formulas and aggregating rule statistics. - [Clean OCR/MER output](https://texform.dev/docs/clean-ocr-mer-output.md): Classify math-recognition output by diagnostics into repairable and discardable buckets, then normalize the survivors. - [Handle parse errors](https://texform.dev/docs/handle-parse-errors.md): Dispatch on the three parse-result states, read diagnostics and spans, and choose strict or lenient parsing. - [Edit a document](https://texform.dev/docs/edit-a-document.md): Traverse a Document, build replacement nodes, and write the edited tree back to LaTeX. - [Analyze formula structure at scale](https://texform.dev/docs/analyze-structure.md): Export documents as node and argument tables with to_columnar() to count commands, argument forms, and depth across a corpus. - [Configure output style](https://texform.dev/docs/configure-output-style.md): Choose spaced or compact LaTeX output in the libraries, after normalization, and on the command line. - [Inject custom commands](https://texform.dev/docs/inject-custom-commands.md): Write an argspec, validate it, and register a custom command so the parser reads its arguments correctly. - [Compare formulas](https://texform.dev/docs/compare-formulas.md): Use equiv-profile normalization for cheap spelling comparison, and a CAS for true mathematical equivalence. - [Disable a rewrite rule](https://texform.dev/docs/disable-a-rule.md): Turn off a single rewrite rule by key when a profile normalizes more than you want, and see what disabling does and does not change. - [Use TeXForm with MathJax or KaTeX](https://texform.dev/docs/use-with-a-renderer.md): Normalize LaTeX so a plain MathJax or KaTeX deployment can render it, expanding physics macros that vanilla renderers do not know. - [Troubleshooting](https://texform.dev/docs/troubleshooting.md): Fix common TeXForm failures: WASM loading, ConfigError on config shapes, mismatched knowledge bases, incomplete trees, and package conflicts. ## Project - [Changelog](https://texform.dev/docs/changelog.md): Notable user-visible changes in each TeXForm release, covering the Rust, Python, and JavaScript channels. - [Stability and versioning](https://texform.dev/docs/stability-and-versioning.md): What the stability guarantee covers, lockstep versioning across Rust, Python, and JavaScript, and what 0.x means. - [Performance and correctness](https://texform.dev/docs/performance-and-correctness.md): How TeXForm checks parser and transform correctness, reference throughput and startup measurements for each binding, and how to measure on your own input. ## API Reference - [API Reference](https://texform.dev/api.md): Use TeXForm from Rust, Python, or JavaScript. Three bindings, one Rust core. - [Python API](https://texform.dev/api/python.md): Python conventions, the exception hierarchy, and a map of the texform module. - [Python: Parser](https://texform.dev/api/python/parser.md): Construct a Parser, parse LaTeX, configure strictness, and inspect the knowledge base. - [Python: KnowledgeBase](https://texform.dev/api/python/knowledge-base.md): Share immutable knowledge across parsers, transform engines, and documents. - [Python: Document](https://texform.dev/api/python/document.md): Construct, query, edit, and serialize the editable TeXForm document tree. - [Python: Node](https://texform.dev/api/python/node.md): Navigate the document tree and read node content through read-only Node handles. - [Python: TransformEngine](https://texform.dev/api/python/transform-engine.md): Normalize formulas with a profile, tune the pipeline, and read the transform report. - [Python: serialize](https://texform.dev/api/python/serialize.md): Render a SyntaxNode to LaTeX text, and the output style options. - [Python: validate_argspec](https://texform.dev/api/python/validate-argspec.md): Validate an argspec string and inspect the parsed argument slots. - [Python: Utilities](https://texform.dev/api/python/utilities.md): List knowledge packages, count formula targets, and the exception classes. - [JavaScript API](https://texform.dev/api/js.md): JavaScript conventions, WASM loading, the error hierarchy, and a map of the texform module. - [JavaScript: Parser](https://texform.dev/api/js/parser.md): Construct a Parser, parse LaTeX, configure strictness, and inspect the knowledge base. - [JavaScript: KnowledgeBase](https://texform.dev/api/js/knowledge-base.md): Share immutable knowledge across parsers, transform engines, and documents. - [JavaScript: Document](https://texform.dev/api/js/document.md): Construct, query, edit, and serialize the editable TeXForm document tree. - [JavaScript: Node](https://texform.dev/api/js/node.md): Navigate the document tree and read node content through read-only Node handles. - [JavaScript: TransformEngine](https://texform.dev/api/js/transform-engine.md): Normalize formulas with a profile, tune the pipeline, and read the transform report. - [JavaScript: serialize](https://texform.dev/api/js/serialize.md): Render a SyntaxNode to LaTeX text, and the output style options. - [JavaScript: validateArgspec](https://texform.dev/api/js/validate-argspec.md): Validate an argspec string and inspect the parsed argument slots. - [JavaScript: Utilities](https://texform.dev/api/js/utilities.md): List knowledge packages and the error classes. ## LaTeX Math Reference - [LaTeX Math Reference](https://texform.dev/latex.md): Look up any LaTeX math command, environment, or symbol: what it renders, which package defines it, and whether MathJax, KaTeX, and XeTeX support it. - [Commands](https://texform.dev/latex/commands.md): Browse LaTeX commands by topic, name, package, and renderer support. The Markdown index lists all 507 commands, each linking to its own page. - [Environments](https://texform.dev/latex/environments.md): Browse LaTeX environments by topic, name, package, and renderer support. The Markdown index lists all 35 environments, each linking to its own page. - [Symbols](https://texform.dev/latex/symbols.md): Browse LaTeX symbols by topic, name, package, and Unicode character. The Markdown index lists all 666 symbols, each linking to its own page. - [Packages](https://texform.dev/latex/packages.md): The knowledge packages TeXForm reads, each with the commands, environments, and symbols it defines. The Markdown index lists all 8 packages, each linking to its own page. - [Topics](https://texform.dev/latex/topics.md): 28 topics group every LaTeX math command, environment, and symbol by what it does, whichever package defines it. The Markdown index lists all 28 topics, each linking to its own page. - [Renderer support](https://texform.dev/latex/renderers.md): Per-package coverage and high-frequency gaps for MathJax, KaTeX, and XeTeX, with the status legend and how statuses are determined. ## Rewrite Rules - [Rewrite Rules](https://texform.dev/rules.md): 154 rewrite rules with declarative rewrite patterns and render-validated examples. The Markdown index lists every rule with its level and fidelity, each linking to its own page. ## Optional - [Architecture](https://texform.dev/docs/architecture.md): Crate layout, the stability boundary, the processing pipeline, three tree representations, and how the bindings work. - [The knowledge base](https://texform.dev/docs/knowledge-base.md): What the four kinds of knowledge-base record contain, where entries come from, how rendering validates them, and how to report a wrong argspec. - [Renderer validation](https://texform.dev/docs/renderer-validation.md): How TeXForm derives full, partial, and none renderer support: case generation, the three engines tested, and why partial happens. - [Argspec design](https://texform.dev/docs/argspec-design.md): Why TeXForm describes command signatures with an xparse-style notation, what it extends, and which signatures it cannot express. - [Rules and the transform contract](https://texform.dev/docs/rule-contract.md): The rule metadata model, fixed-point scheduling, the eliminated-forms contract, and how to read rule source. - [Landing page](https://texform.dev/index.md): A text version of the home page and its figures. The complete documentation and API reference as one file: https://texform.dev/llms-full.txt