katex-rs 0.1.0

A Rust implementation of KaTeX - Fast math typesetting for anywhere, more than just the web.
Documentation
katex-rs-0.1.0 has been yanked.

KaTeX-rs

Crates.io Documentation License: MIT

KaTeX-rs is a Rust implementation of KaTeX, providing fast mathematical typesetting capabilities, not limited to Javascript environments.

Project Introduction

KaTeX-rs is a working in progress Rust port of KaTeX (a fast mathematical typesetting library). It converts LaTeX mathematical expressions into HTML and MathML formats, supporting server-side rendering, command-line tools, and WebAssembly environments.

This project is based on KaTeX's commit 9fb63136e680715ad83c119366f6f697105d2c55.

  • Basic parsing and rendering
  • Unit and integration tests
  • Offline rendering tests
  • Compatible with no-std and wasm target
  • Fully consistent with KaTeX result

Feature Flags

  • cli: Enables command-line interface
  • wasm: Enables WebAssembly support
[dependencies]
katex-rs = { version = "0.1.0", features = ["cli", "wasm"] }

Testing

Unit tests

cargo nextest run --no-fail-fast

Screenshot tests

node tests/screenshotter/run.js

Compatibility

  • Rust: 1.70+
  • WebAssembly: Supports all modern browsers
  • KaTeX: Fully compatible with the original KaTeX JavaScript version

License

This project is licensed under the MIT License - see the LICENSE file for details.