tex2typst-rs
A Rust library that converts TeX code to Typst code.
Aim of this project
There exist some other libraries that convert LaTeX (especially LaTeX math) to other languages. However, the result may not be visually pleasing or easy to read. This project aims to convert LaTeX to idiomatic Typst code, which can be very easily read and edited.
For comparison, for this LaTeX input:
\overrightarrow =(3-x-y) \overrightarrow +x \overrightarrow +(y-2) \overrightarrow
mitex
gives the output:
arrow(P M )= \(3 - x - y \) arrow(P A )+ x arrow(P B )+ \(y - 2 \) arrow(P C )
tex2typst-rs
gives the output:
arrow(P M) =(3 - x - y) arrow(P A) + x arrow(P B) +(y - 2) arrow(P C)
Usage
See the documentation for more details.
use tex2typst;
use text_and_tex2typst;
Output:
hat(f)(xi) = int_(- infty)^infty f(x) e^(- i 2 pi xi x) d x, quad forall xi in RR
some text and some formula: $1/2$
Acknowledgements
Took inspiration from tex2typst.