Welcome to my World!

Math Typesetting

Guide to enabling and using KaTeX in the Stack theme

The Stack theme supports rendering mathematical notation using KaTeX.

Enabling KaTeX

Per-page basis

To enable KaTeX for a specific post, include math: true in the post’s frontmatter:

1
2
3
4
---
title: "My Math Post"
math: true
---

Globally

To enable KaTeX for all posts, set article.math to true in your site configuration (params.yaml or params.toml):

1
2
article:
    math: true

Examples

Inline Math

You can include math inline by wrapping the expression in single dollar signs $.

For example: $ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $ renders as $ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $

Block Math

For larger equations, use double dollar signs $$ to create a math block.

$$ \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } $$

More Complex Formula

$$ f(a) = \frac{1}{2\pi i} \oint_\gamma \frac{f(z)}{z-a} dz $$

Note: For a full list of supported TeX functions, refer to the KaTeX documentation.

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy