0.0.5 • Published 4 months ago

tex-to-typst v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

tex-to-typst

tex-to-typst on npm MIT License CI

A utility for translating LaTeX math 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!

npm install tex-to-typst

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

Overview & Usage

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);
// 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.