# tex-to-typst

> Translate tex math code to typst

Latest version **0.0.22** (published 2026-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install tex-to-typst
pnpm add tex-to-typst
yarn add tex-to-typst
bun add tex-to-typst
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.22 |
| Published | 2026-08-27 |
| First published | 2023-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 4 |
| Unpacked size | 99.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 33 |
| Author | Rowan Cockett |
| Maintainers | rowanc1, fwkoch |
| Keywords | Typst, LaTeX |

## Links

- npm: https://www.npmjs.com/package/tex-to-typst
- Repository: https://github.com/continuous-foundation/tex-to-typst
- Issues: https://github.com/continuous-foundation/tex-to-typst/issues
- npm.io page: https://npm.io/package/tex-to-typst

## Dependencies (4)

- [unified](https://npm.io/package/unified.md) ^10.1.2
- [@unified-latex/unified-latex](https://npm.io/package/@unified-latex/unified-latex.md) ^1.4.0
- [@unified-latex/unified-latex-util-parse](https://npm.io/package/@unified-latex/unified-latex-util-parse.md) ^1.4.0
- [@unified-latex/unified-latex-util-arguments](https://npm.io/package/@unified-latex/unified-latex-util-arguments.md) ^1.4.0

## Recent versions

- 0.0.22 (latest) — 2026-08-27
- 0.0.21 — 2026-07-17
- 0.0.20 — 2026-06-01
- 0.0.19 — 2025-11-09
- 0.0.18 — 2025-10-10
- 0.0.17 — 2025-10-09
- 0.0.16 — 2025-05-15
- 0.0.15 — 2025-01-23
- 0.0.14 — 2025-01-10
- 0.0.13 — 2025-01-06
- 0.0.12 — 2024-12-17
- 0.0.11 — 2024-12-17
- 0.0.10 — 2024-12-17
- 0.0.9 — 2024-11-04
- 0.0.8 — 2024-10-30
- … 8 more at https://npm.io/package/tex-to-typst/versions

## README

# tex-to-typst

[![tex-to-typst on npm](https://img.shields.io/npm/v/tex-to-typst.svg)](https://www.npmjs.com/package/tex-to-typst)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/continuous-foundation/tex-to-typst/blob/main/LICENSE)
![CI](https://github.com/continuous-foundation/tex-to-typst/workflows/CI/badge.svg)

A utility for translating LaTeX math to typst.

**[Try the live demo →](https://continuous-foundation.github.io/tex-to-typst/)**

> **Note**: The library is in alpha, it will likely not work for the majority of math at the moment! More updates to come soon!

```shell
npm install tex-to-typst
```

The library uses `@unified-latex` for the LaTeX parsing.

## Overview & Usage

```ts
import { texToTypst } from 'tex-to-typst';

const typst = texToTypst(
  '\\frac{1}{4} \\sum_{i=1}^4 \\mathbf{P}_i^\\top \\sqrt{v} \\mathbf{\\Sigma}^{-1} \\sqrt{v} \\mathbf{P}_i \\mathbf{j} = \\mathbf{D}^\\top v \\phi',
);

console.log(typst.value);
// frac(1, 4) sum_(i = 1)^4 bold(P)_i^top sqrt(v) bold(Sigma)^(-1) sqrt(v) bold(P)_i bold(j) = bold(D)^top v phi
```

## Included Utilities

- `texToTypst` - translates tex markup to an equivalent typst string

---

This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).

---

<p style="text-align: center; color: #aaa; padding-top: 50px">
  Made with love by
  <a href="https://continuous.foundation" target="_blank" style="color: #aaa">
    Continuous Science Foundation <img src="https://cdn.curvenote.com/static/site/csf/icon.svg" style="height: 1em" />
  </a>
</p>

---
_Source: https://npm.io/package/tex-to-typst · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
