Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/curvenote/tex-to-typst
Translate LaTeX or TeX math markup to typst
https://github.com/curvenote/tex-to-typst
converter latex typst
Last synced: 2 months ago
JSON representation
Translate LaTeX or TeX math markup to typst
- Host: GitHub
- URL: https://github.com/curvenote/tex-to-typst
- Owner: curvenote
- License: mit
- Created: 2023-07-10T19:14:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-09T14:32:30.000Z (5 months ago)
- Last Synced: 2024-08-09T18:28:36.746Z (5 months ago)
- Topics: converter, latex, typst
- Language: TypeScript
- Homepage:
- Size: 451 KB
- Stars: 14
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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/curvenote/tex-to-typst/blob/main/LICENSE)
![CI](https://github.com/curvenote/tex-to-typst/workflows/CI/badge.svg)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!
```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).
---
Made with love by
Curvenote