Crate katexit[−][src]
Expand description
Insert KaTeX autorender script into rustdoc
Usage
#[cfg_attr(doc, katexit::katexit)]
/// We can write $\LaTeX$ expressions
///
/// Display style
/// -------------
///
/// $$
/// c = \\pm\\sqrt{a^2 + b^2}
/// $$
pub fn my_func() {}
How it works
#[katexit]
proc-macro inserts KaTeX autorender script as #[doc = "{script}"]
.
Since the markdown to HTML translator of rustdoc through the HTML partition embedded in markdown,
this will be passed as it is to the browser.
When you open the page generated by rustdoc, the autorender script starts rendering the
math expression enclosed by $
written in the document section
(i.e. this does not work offline).