mdbook-katex 0.2.4

mdBook preprocessor rendering LaTex equations to HTML.
mdbook-katex-0.2.4 is not a library.

A Rust preprocessor for mdBook rendering LaTex equations to HTML. It allows for very fast page loading, compared to rendering equations in the browser.

This preprocessor uses the Katex crate; see this page for the list of supported Latex functions.


Install the crate

cargo install mdbook-katex

Add the preprocessor to your book.toml file


Use $ and $$ delimiters for inline / display equations within your .md files. Use \$ for a regular dollar symbol.

# Chapter 1

Here is an inline example, $ \pi(\theta) $, 

an equation,

$$ \nabla f(x) \in \mathbb{R}^n, $$

and a regular \$ symbol.


Macros must be defined in a .txt file, according to the following pattern

\R:{\mathbb{R}^{#1 \times #2}}

Then, specify the macros location in your book.toml

macros = "path/to/macros.txt"

You can now use these macros in your .md files

# Chapter 1

$$ \grad f(x) \in \R{n}{p} $$