Crate katex_doc [] [src]

Utilizing the html injection feature of rustdoc, we can enable the use of $\KaTeX$ in documentation!

For inline math, use $`1+1`$, which renders as $1+1$.

For display math, use:

f(x) = \int_{-\infty}^\infty
  \hat f(\xi)\,e^{2 \pi i \xi x}

(example taken from, which renders as:

f(x) = \int_{-\infty}^\infty
  \hat f(\xi)\,e^{2 \pi i \xi x}

To enable this on, you should be able to just add the following to your Cargo.toml:

rustdoc-args = [

If that doesn't work for other crates, download katex.html from this repository, then put it at the root of your repository, include it in your publish, then replace the reference to with your crate.