Overview

API Reference

Use TeXForm from Rust, Python, or JavaScript. Three bindings, one Rust core.

The same Rust core sits behind all three bindings, so the parser, document model, transform engine, and serializer behave identically across languages. The Python and JavaScript references below are generated from the binding comments; the Rust API lives on docs.rs.

  • Python — the texform package: Parser, Document, Node, TransformEngine, and serialization.
  • JavaScript — the texform npm package for Node and the browser.
  • Rust — the core crate shared by all bindings.

Naming across bindings#

Only the surface naming differs. Python uses snake_case for methods, arguments, and option keys (to_latex, has_errors, reject_unknown); JavaScript uses the camelCase equivalents (toLatex, hasErrors, rejectUnknown). Enum values stay snake_case in both (for example, "spaced" and "compact"). Structured data crosses the boundary as plain dicts and objects rather than wrapper classes, while Document and Node are live handles into the Rust tree in both bindings.

Start with the overview page for your language: it states the conventions, the error hierarchy, and a map of every exported symbol. To install a binding first, see Installation. For how the bindings wrap one core without copying trees across the language boundary, see Architecture.