22 releases

0.4.5 Nov 22, 2022
0.4.4 May 7, 2022
0.4.3 Jan 13, 2022
0.4.2 Nov 1, 2021
0.2.1 Feb 7, 2020

#78 in Math

Download history 660/week @ 2022-10-12 1077/week @ 2022-10-19 437/week @ 2022-10-26 1732/week @ 2022-11-02 592/week @ 2022-11-09 817/week @ 2022-11-16 507/week @ 2022-11-23 536/week @ 2022-11-30 640/week @ 2022-12-07 1115/week @ 2022-12-14 333/week @ 2022-12-21 577/week @ 2022-12-28 462/week @ 2023-01-04 444/week @ 2023-01-11 231/week @ 2023-01-18 270/week @ 2023-01-25

1,542 downloads per month
Used in 14 crates (11 directly)

MIT/Apache

345KB
695 lines

katex-rs

Build Status Latest Version Rust Documentation

This crate offers Rust bindings to KaTeX. This allows you to render LaTeX equations to HTML.

Documentation

https://docs.rs/katex

Usage

Add this to your Cargo.toml:

[dependencies]
katex = "0.4"

This crate offers the following features:

  • quick-js: Enable by default. Use quick-js as the JS backend.
  • duktape: Use duktape as the JS backend. You need to disable the default features to enable this backend.
  • wasm-js: Use wasm-bindgen and js-sys as the JS backend. You need to disable the default features to enable this backend.

Examples

let html = katex::render("E = mc^2").unwrap();

let opts = katex::Opts::builder().display_mode(true).build().unwrap();
let html_in_display_mode = katex::render_with_opts("E = mc^2", &opts).unwrap();

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1–2.6MB
~54K SLoC