From 60d7b526ae306ea95a9eb26ccd450872193ac108 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sat, 26 Aug 2023 12:22:26 +0000 Subject: [PATCH] feat: add math typesetting example --- content/post/math-typesetting/index.md | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 content/post/math-typesetting/index.md diff --git a/content/post/math-typesetting/index.md b/content/post/math-typesetting/index.md new file mode 100644 index 0000000..d206914 --- /dev/null +++ b/content/post/math-typesetting/index.md @@ -0,0 +1,40 @@ +--- +title: Math Typesetting +description: Math typesetting using KaTeX +date: 2023-08-24 00:00:00+0000 +math: true +--- + +Stack has built-in support for math typesetting using [KaTeX](https://katex.org/). + +**It's not enabled by default side-wide,** but you can enable it for individual posts by adding `math: true` to the front matter. Or you can enable it side-wide by adding `math = true` to the `params.article` section in `config.toml`. + +## Inline math + +This is an inline mathematical expression: $\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…$ + +```markdown +$\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…$ +``` + +## Block math + +$$ + \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } +$$ + +```markdown +$$ + \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } +$$ +``` + +$$ + f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi +$$ + +```markdown +$$ + f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi +$$ +``` \ No newline at end of file