mitex-rs / mitex

LaTeX support for Typst, powered by Rust and WASM. https://mitex-rs.github.io/mitex/
https://mitex-rs.github.io/mitex/tools/underleaf.html
Apache License 2.0
239 stars 8 forks source link

Convenient Way to Convert all #mitex(...) and #mi("...") Excerpts in a Typst file to Typst Math? #168

Open davidleejy opened 1 month ago

davidleejy commented 1 month ago

Does anyone think it'd be neat to have a script that converts #mitex(...) and #mi("...") excerpts in a Typst file to their Typst math equivalents?

In pseudocode, a script like that might perform the following steps:

  1. Given a Typst file as input, traverse its content.
  2. During traversal, if a #mitex(...) and #mi("...") string were encountered, use "mitex-convert" to convert into Typst math.
  3. Replace string with newly obtained Typst math string.
  4. Repeat steps 2 and 3 until end of document is reached.
davidleejy commented 1 month ago

Just found out that the official Typst web editor platform provides a best-effort LaTeX code to Typst code converter.

Screenshot 2024-05-18 at 5 20 29 PM

Enivex commented 1 month ago

You can use mitex as a cli as well