To install, place both files in the .cargo
directory next to your Cargo.toml
file.
<project-dir>
├ .cargo/
│ ├ config.toml
│ └ katex.html
├ src/
│ └ ...
└ Cargo.toml
[build] | |
rustdocflags = ["--html-in-header", ".cargo/katex.html"] |
<link | |
rel="stylesheet" | |
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" | |
integrity="sha384-GvrOXuhMATgEsSwCs4smul74iXGOixntILdUW9XmUC6+HX0sLNAK3q71HotJqlAn" | |
crossorigin="anonymous" | |
/> | |
<script | |
defer | |
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" | |
integrity="sha384-cpW21h6RZv/phavutF+AuVYrr+dA8xD9zs6FwLpaCct6O9ctzYFfFr4dgmgccOTx" | |
crossorigin="anonymous" | |
></script> | |
<script | |
defer | |
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" | |
integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" | |
crossorigin="anonymous" | |
></script> | |
<script> | |
document.addEventListener("DOMContentLoaded", () => { | |
const roots = document.querySelectorAll("div.docblock, div.docblock-short"); | |
for (const root of roots) { | |
renderMathInElement(root, { | |
delimiters: [ | |
{ left: "$$", right: "$$", display: true }, | |
{ left: "$", right: "$", display: false }, | |
], | |
strict: true, | |
}); | |
} | |
}); | |
</script> |