# 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:

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



(example taken from https://khan.github.io/KaTeX/), which renders as:

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


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

[package.metadata.docs.rs]
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 katex-doc-ver.si.on with your crate.