23 releases

0.4.6 Feb 5, 2023
0.4.5 Nov 22, 2022
0.4.4 May 7, 2022
0.4.3 Jan 13, 2022
0.2.1 Feb 7, 2020

#488 in Math

Download history 546/week @ 2024-07-22 551/week @ 2024-07-29 409/week @ 2024-08-05 397/week @ 2024-08-12 472/week @ 2024-08-19 618/week @ 2024-08-26 489/week @ 2024-09-02 494/week @ 2024-09-09 457/week @ 2024-09-16 687/week @ 2024-09-23 719/week @ 2024-09-30 550/week @ 2024-10-07 590/week @ 2024-10-14 531/week @ 2024-10-21 440/week @ 2024-10-28 466/week @ 2024-11-04

2,097 downloads per month
Used in 15 crates (13 directly)

MIT/Apache

345KB
696 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();

See Also

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

~4–5MB
~126K SLoC