Use this workflow to make math render cleanly in Jekyll.
1) Update _config.yml
kramdown.math_engine: katexkramdown.math_engine_opts: {}mathjax: false2) Update Gemfile
gem "kramdown-math-katex"gem "duktape"3) Add KaTeX CSS
_includes/head/custom.html (or append if it exists).<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" crossorigin="anonymous">
4) Rebuild
bundle install, then bundle exec jekyll serve.kramdown.math_engine: mathjax and mathjax: true.kramdown-math-katex if you do not prebuild locally.$a_t \sim \mathcal{N}(\mu(s_t), \sigma^2 I)$$$
\text{Attn}(Q,K,V) = \text{softmax}\left(\frac{QK^\top}{\sqrt{d}}\right)V
$$
align/align*; prefer aligned inside $$ ... $$ if needed.