Crate mdbook_typst_math

Crate mdbook_typst_math 

Source
Expand description

mdbook-typst-math - An mdbook preprocessor to render math using Typst

This crate provides a preprocessor for mdbook that converts LaTeX-style math blocks into SVG images rendered by Typst.

§Usage

Add the preprocessor to your book.toml:

[preprocessor.typst-math]

§Configuration

The preprocessor supports the following configuration options:

  • preamble: Typst code to prepend to all math blocks
  • inline_preamble: Typst code to prepend to inline math blocks
  • display_preamble: Typst code to prepend to display math blocks
  • fonts: List of font directories to load
  • cache: Directory for caching downloaded packages
  • color_mode: Color mode for SVG output (auto or static)
  • code_tag: Language tag for code blocks to render as Typst (default: typst,render)
  • enable_math: Enable rendering of math blocks (default: true)
  • enable_code: Enable rendering of Typst code blocks (default: true)

Structs§

TypstProcessor
The main preprocessor that converts math blocks to Typst-rendered SVGs.
TypstProcessorOptions
Options that control how Typst renders math blocks.

Enums§

ColorMode
Color mode for SVG output.