Crate horrible_katex_hack

Source
Expand description

This crate is an example of using $\LaTeX$ math with rustdoc.

This demo abuses the #[doc(html_favicon_url = ..)] attribute to inject a KaTeX script into the generated documentation.

This way, it works both on docs.rs and with cargo doc without extra settings.

ยงUsage

Look at the source of lib.rs of this crate, and copy the doc attribute containing the <link> and <script> tags.

Then, write $`\frac 1 2 + 3`$ for inline math, which renders as $\frac 1 2 + 3$.

Or, write

```math
\int_{-\infty}^\infty f(x)\,dx
```

for display math, which renders as:

\int_{-\infty}^\infty f(x)\,dx