diff options
| author | aethrvmn <me@aethrvmn.gr> | 2025-09-20 22:27:35 +0000 |
|---|---|---|
| committer | aethrvmn <me@aethrvmn.gr> | 2025-09-20 22:27:35 +0000 |
| commit | 9b5f3fad7068298265dbbc8a65077f7917a090a5 (patch) | |
| tree | 0905b29eb7c03d6bc6e16dd1ebcd1ec9b6b83320 /themes/hugo-book/exampleSite/content.en/docs/shortcodes/katex.md | |
| parent | super simple setup guide (diff) | |
updated hugo-book theme
Diffstat (limited to 'themes/hugo-book/exampleSite/content.en/docs/shortcodes/katex.md')
| -rw-r--r-- | themes/hugo-book/exampleSite/content.en/docs/shortcodes/katex.md | 67 |
1 files changed, 60 insertions, 7 deletions
diff --git a/themes/hugo-book/exampleSite/content.en/docs/shortcodes/katex.md b/themes/hugo-book/exampleSite/content.en/docs/shortcodes/katex.md index 3ef143c..00e1940 100644 --- a/themes/hugo-book/exampleSite/content.en/docs/shortcodes/katex.md +++ b/themes/hugo-book/exampleSite/content.en/docs/shortcodes/katex.md @@ -5,7 +5,21 @@ title: KaTeX KaTeX shortcode let you render math typesetting in markdown document. See [KaTeX](https://katex.org/) -## Example +{{% hint info %}} +**Override KaTeX initialization config** +To override the [initialization config](https://katex.org/docs/options.html) for KaTeX, +create a `katex.json` file in your `assets` folder! +{{% /hint %}} + +# Example +{{< katex />}} + + +## Activation +KaTeX is activated on the page by first use of the shortcode or render block. you can force activation with empty `{{</* katex /*/>}}` and use delimiters defined in configuration in `assets/katex.json`. + +## Rendering as block + {{% columns %}} ```latex @@ -14,18 +28,57 @@ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {{< /katex */>}} ``` +````latex +```katex +f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi +``` +```` + +````latex +$$ +f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi +$$ +```` + <---> {{< katex display=true >}} f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {{< /katex >}} -{{% /columns %}} +--- + +```katex +f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi +``` -## Display Mode Example +--- -Here is some inline example: {{< katex >}}\pi(x){{< /katex >}}, rendered in the same line. And below is `display` example, having `display: block` -{{< katex display=true >}} +$$ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi -{{< /katex >}} -Text continues here. +$$ + +{{% /columns %}} + +## Rendering inline +When KaTeX is active on the page it is possible to write inline expressions. + +| Code | Output | +| -- | -- | +| `{{</* katex >}}\pi(x){{< /katex */>}}` | {{< katex >}}\pi(x){{< /katex >}} | +| `\\( \pi(x) \\)` | \\( \pi(x) \\) | + +## Configuration +KaTeX configuration could be adjusted by editing `assets/katex.json` file. For example to enabled inline delimiters `$..$` put content below into the file. + +```json +{ + "delimiters": [ + {"left": "$$", "right": "$$", "display": true}, + {"left": "$", "right": "$", "display": false}, + {"left": "\\(", "right": "\\)", "display": false}, + {"left": "\\[", "right": "\\]", "display": true} + ] +} +``` + |
