katex

Crates.iokatex
lib.rskatex
version0.4.6
sourcesrc
created_at2020-02-01 20:11:53.037146
updated_at2023-02-05 10:44:22.36818
descriptionRust bindings to KaTeX
homepage
repositoryhttps://github.com/xu-cheng/katex-rs
max_upload_size
id204004
size363,196
Cheng XU (xu-cheng)

documentation

https://docs.rs/katex

README

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.
Commit count: 144

cargo fmt