# Installation

Install TeXForm from pip, npm, or cargo, and verify it works in Python, JavaScript, or Rust.

https://texform.dev/docs/installation

TeXForm ships the same Rust core through three package registries. Install it for your language, then run the verification snippet to confirm the native module loaded.

**Python**

```bash
pip install texform
```

The package is a compiled extension distributed as prebuilt wheels and requires Python 3.10 or newer. Bundled `.pyi` type stubs and a `py.typed` marker give you full type checking and editor completion with no separate stubs package.

```python
import texform

engine = texform.TransformEngine(profile="corpus")
print(engine.normalize(r"a \over b"))
```

```text
\frac { a } { b }
```

**JavaScript**

```bash
npm install texform
```

The package is powered by WebAssembly, with TypeScript declarations bundled — no separate `@types` package. It ships two entry points for loading the `.wasm` module, and choosing the right one is the most common pitfall with a WASM package: `texform/node` targets Node.js, and `texform/bundler` targets browser-oriented bundlers such as Vite or webpack 5. The bare `texform` import resolves to the Node entry under Node.js and the bundler entry under a bundler, so most projects can import `texform` directly; force a specific entry only when the automatic resolution picks the wrong one.

The bundler entry initializes the WebAssembly module at module load time, which needs a bundler that supports top-level `await` and `.wasm` assets. [JavaScript and WebAssembly](https://texform.dev/docs/javascript-and-wasm) walks through both entry points, the bundler configuration they expect, and the handle lifecycle.

```js
import { TransformEngine } from 'texform/node';

const engine = new TransformEngine({ profile: 'corpus' });
console.log(engine.normalize('a \\over b'));
```

```text
\frac { a } { b }
```

**Rust**

```bash
cargo add texform
```

The `texform` facade crate is the only public, stability-guaranteed entry point. It depends on internal `texform-*` crates that are published only because crates.io requires it; their APIs may change in any release, so do not depend on them directly.

```rust
use texform::{Profile, TransformEngine};

let engine = TransformEngine::builder().profile(Profile::Corpus).build()?;
let result = engine.normalize(r"a \over b")?;
assert_eq!(result, r"\frac { a } { b }");
```

Once the verification snippet runs, continue to the [Quick start](https://texform.dev/docs/quick-start) for the full normalize-and-inspect path.

## Command-line tool [#command-line-tool]

The `texform` command serves shell scripts and tools that call TeXForm across a process boundary. It ships with the Python package; install it as a standalone tool, or run it once with `uvx texform`:

```bash
uv tool install texform    # or: pipx install texform
texform normalize --profile corpus 'a \over b'
```

```text
\frac { a } { b }
```

With a Rust toolchain, `cargo install texform-cli` builds the same tool as a native binary. [Command line](https://texform.dev/docs/command-line) covers every command, the JSON output, and the `texform serve` protocol.

## Next steps [#next-steps]

- [Quick start](https://texform.dev/docs/quick-start) — Normalize a formula, switch profiles, and open the document tree underneath.

- [JavaScript and WebAssembly](https://texform.dev/docs/javascript-and-wasm) — Entry points, bundler setup, and the handle lifecycle for the npm package.

- [Playground](https://texform.dev/docs/playground) — Try profiles and diagnostics in the browser before you install anything.

