Key Facts
- ✓ Tylax parses LaTeX into an AST using mitex-parser.
- ✓ It supports full document structure, complex math, and experimental TikZ to CeTZ conversion.
- ✓ The tool runs in the browser via WASM.
- ✓ It is written in Rust.
Quick Summary
A new tool named Tylax has been developed to convert documents from LaTeX to Typst. The author created this solution because existing regex-based scripts were too fragile, particularly when dealing with nested environments.
Tylax operates by parsing LaTeX into an Abstract Syntax Tree (AST) using mitex-parser, which ensures a more robust conversion process. It supports the full document structure, complex mathematical formulas, and includes experimental support for converting TikZ graphics to CeTZ. The tool is written in Rust and runs directly in the browser via WASM, offering a web-based demo for immediate use.
The Need for Robust Conversion
Converting documents between different typesetting systems has historically been a challenge. The author of Tylax identified a specific gap in existing tools while attempting to migrate personal papers from LaTeX to Typst.
Previous solutions often relied on regular expressions (regex) to parse and convert code. While effective for simple cases, these scripts frequently failed when encountering complex, nested structures common in technical documents. This fragility prompted the development of a more structural approach.
By utilizing a proper parser to build an AST, Tylax can understand the hierarchy and context of the source code. This allows for accurate conversion of complex elements that would otherwise break simpler scripts.
Core Capabilities
Tylax offers a comprehensive set of features designed to handle the complexities of academic and technical documents. It goes beyond simple math snippets to support the full document structure.
Key capabilities include:
- Full Document Structure: It processes complete documents, not just isolated equations.
- Complex Math Support: It handles advanced mathematical notation, such as matrices and integrals.
- Graphics Conversion: It includes experimental support for converting TikZ graphics to CeTZ.
The tool is built using the Rust programming language, known for its performance and safety. Furthermore, it runs entirely in the browser via WebAssembly (WASM), allowing users to convert documents locally without needing a backend server.
Availability and Access
The project is open source and publicly available. The source code has been published to a repository hosted on GitHub, allowing developers to inspect the code, contribute, or run the tool locally.
For users who wish to test the functionality immediately, a live web demo is hosted at convert.silkyai.cn. This web interface allows users to paste LaTeX code and see the resulting Typst output in real-time.
The author has also invited the community to ask questions regarding the project, indicating an active interest in feedback and user engagement.




