typesetting / pure-rust
ratex
An ultra-fast, self-contained, pure-Rust TeX engine and typesetting toolchain. Built from scratch to serve as a high-performance drop-in replacement for pdflatex, xelatex, lualatex, and texmk.
pdflatex, xelatex, and lualatex out of the box with zero configuration. On macOS and Windows, the installer includes an option (enabled by default) to also replace latexmk with texmk for seamless integration with TeXstudio and VS Code LaTeX Workshop.
Installers & Packages
v0.2.0 Downloads
Native macOS installer package. Double-click to install into /usr/local/bin with automatic PATH setup.
Native Windows setup wizard. Installs executables, adds ratex to PATH, and configures TeXstudio / VS Code compatibility.
Native package installer for Intel-based Macs.
Available directly on the Arch User Repository (AUR):
yay -S ratex-bin
Native Debian package for Ubuntu, Debian, Linux Mint, and Pop!_OS.
Native RPM package for Fedora, RHEL, CentOS, Rocky Linux, and openSUSE.
Complete standalone distribution archive with one-click installer for any Linux system.
Compile from source with Cargo:
cargo build --release
Key Architecture
Design Highlights⚡ Sub-10ms Incremental Builds
Built-in cryptographic auxiliary state tracking and dependency graph converge cross-references and bibliography passes in 0.8–8.2 ms, compared to 40–60 ms in TeX Live.
🌐 WebAssembly & C API (libtex)
Compile LaTeX documents in-memory from browser runtimes, Node.js, or C/C++ applications via tex.wasm and libtex without touching disk or spawning external processes.
🎨 Native SVG & Vector Graphics
Directly embed \includegraphics{figure.svg} with pure-Rust in-memory rasterization into PDF XObjects—no Inkscape, Ghostscript, or shell escape needed.
🔍 SyncTeX & Built-in latexdiff
Automatic .synctex.gz generation enabled by default for instant editor jump-to-source, plus token-level visual revision diffing with ratex latexdiff.
📦 100% Self-Contained
Embeds all essential formats, packages, math symbols, and CJK fonts, plus bundles a complete 67,000+ file TeX Live tree in share/tex-suite/. Zero external dependencies required.
🛡️ Pure Rust Safety
Written entirely in pure Rust with strict bounds checking. Eliminates the buffer overflows, memory corruption bugs, and runaway pointers of legacy C TeX engines.
Performance Highlights
Tested on 3,000 real-world arXiv papers| Workload | ratex (Rust) | TeX Live (pdflatex / latexmk) | Advantage |
|---|---|---|---|
| Incremental Rebuild (Warm) | 0.8 – 8.2 ms | 40 – 60 ms | 10× – 70× faster ⚡ |
| Short Papers (1–3 pages) Cold | 11 – 13 ms | 39 – 41 ms | 3.1× – 3.6× faster ⚡ |
| Full 3,000-Paper Corpus Throughput | 89 papers / min | 53 papers / min | 1.7× faster ⚡ |
| Visual Document Parity | 96.39% mean fidelity | Baseline (100%) | Publication-grade match |
How to Use & Editor Setup
CLI & IDEs1. Terminal / CLI
texmk paper.tex
# Output PDF into a custom folder (e.g. build/)
texmk -output-directory=build paper.tex
# Direct single-pass compile (drop-in pdflatex replacement)
pdflatex paper.tex
# Clean intermediate auxiliary files
texmk -c
2. TeXstudio Setup
No configuration required! Default "Compile" (F5) works immediately.
# Manual configuration:
1. Go to: Options → Configure TeXstudio → Build
2. Set Default Compiler to:
texmk -pdf -interaction=nonstopmode %.tex3. Press F5 to build your document in milliseconds!
3. VS Code (LaTeX Workshop) Setup
"latex-workshop.latex.tools": [
{
"name": "ratex",
"command": "texmk",
"args": ["-pdf", "-interaction=nonstopmode", "%DOC%"]
}
],
"latex-workshop.latex.recipes": [
{ "name": "ratex", "tools": ["ratex"] }
]