diff options
| author | Jieiku | 2022-05-31 02:09:53 -0700 |
|---|---|---|
| committer | Jieiku | 2022-05-31 02:09:53 -0700 |
| commit | 103ff01d0ece0f3c0112b48015750300d907d8fa (patch) | |
| tree | 7cec3a018042c6795af96903f91322779d295491 /content/overview-math.md | |
| parent | ec161233068f6f634d81e07de94f64d7fcedc951 (diff) | |
| download | abridge-103ff01d0ece0f3c0112b48015750300d907d8fa.tar.gz abridge-103ff01d0ece0f3c0112b48015750300d907d8fa.tar.bz2 abridge-103ff01d0ece0f3c0112b48015750300d907d8fa.zip | |
Improve Shortcodes, example content, page scores, fonts
Diffstat (limited to 'content/overview-math.md')
| -rw-r--r-- | content/overview-math.md | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/content/overview-math.md b/content/overview-math.md index d8f50da..a759cac 100644 --- a/content/overview-math.md +++ b/content/overview-math.md @@ -4,31 +4,35 @@ date = 2021-05-05 updated = 2022-01-01 [taxonomies] categories = ["Features"] -tags = ["KaTeX", "Mathematics"] +tags = ["shortcodes","Mathematics"] [extra] math = true +math_auto_render = true +++ -You can use [$\KaTeX$](https://katex.org) to render mathematical notations. +You can use [KaTeX](https://katex.org) to render mathematical notations. You can enable the $\KaTeX$ support globally, per-section or per-page basis. <!-- more --> ## Enable Globally To enable the $\KaTeX$ support globally, add `math = true` under `[extra]` of the `config.toml` -at your site root. Now every section and page of your site will load the KaTeX [autorender extension](https://katex.org/docs/autorender.html). +at your site root. Now the katex shortcode will be rendered, you can also add `math_auto_render = true` +and every section and page of your site will load the KaTeX [autorender extension](https://katex.org/docs/autorender.html). ```toml [extra] math = true +math_auto_render = true ``` ## Per-section Basis -To enable the $\KaTeX$ support in a particular section, add `math = true` under `[extra]` in the `[SECTION_NAME]/_index.md`. Now every page under this section will load the KaTeX -[autorender extension](https://katex.org/docs/autorender.html). +To enable the $\KaTeX$ support in a particular section, add `math = true` under `[extra]` in the `[SECTION_NAME]/_index.md`. +Now the katex shortcode will be rendered, you can also add `math_auto_render = true` +and the section of your site will load the KaTeX [autorender extension](https://katex.org/docs/autorender.html). -```md +```toml +++ [extra] math = true @@ -38,12 +42,14 @@ math = true ## Per-page Basis To enable the $\KaTeX$ support in a particular page, add `math = true` under `[extra]` in the page's -frontmatter. Now this page will load the $\KaTeX$ [autorender extension](https://katex.org/docs/autorender.html). +frontmatter. Now the katex shortcode will be rendered, you can also add `math_auto_render = true` +and the page of your site will load the KaTeX [autorender extension](https://katex.org/docs/autorender.html). -```markdown +```toml +++ [extra] math = true +math_auto_render = true +++ ``` @@ -60,26 +66,38 @@ Mathematics and `$$...$$` for block Mathematics. This is the most beautiful equation I've ever seen: +### Usage +```rs +{%/* katex(block=false) */%} e^{i\pi}+1=0 {%/* end */%} ``` -$e^{i\pi}+1=0$ +### Output +```html +{% katex(block=false) %} e^{i\pi}+1=0 {% end %} ``` -$e^{i\pi}+1=0$ +{% katex(block=false) %} e^{i\pi}+1=0 {% end %} ### Block Mathematics Some Mathematics in display mode is fair enough: +### Usage +```rs +{%/* katex(block=true) */%} \int_0^1 x^2 dx {%/* end */%} ``` -$$ -\int_0^1 x^2 dx -$$ +### Output +```html +{% katex(block=true) %} \int_0^1 x^2 dx {% end %} +``` +{% katex(block=true) %} \int_0^1 x^2 dx {% end %} + +### Auto Render Inline Example +``` +$ e^{i\pi}+1=0 $ ``` -$$ -\int_0^1 x^2 dx -$$ -### Another Example +$ e^{i\pi}+1=0 $ +### Auto Render Block Example ``` $$ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi |
