Hugo Book - Introduction: https://hugo-book-demo.netlify.app/docs/getting-started/introduction/ - Create a Site: https://hugo-book-demo.netlify.app/docs/getting-started/create-a-site/ - Configuration: https://hugo-book-demo.netlify.app/docs/getting-started/configuration/ - Organisation: https://hugo-book-demo.netlify.app/docs/content/organisation/ - Pages: https://hugo-book-demo.netlify.app/docs/content/pages/ - Menus: https://hugo-book-demo.netlify.app/docs/content/menus/ - Blog: https://hugo-book-demo.netlify.app/docs/content/blog/ - Multi-Language: https://hugo-book-demo.netlify.app/docs/content/multilingual/ - Shortcodes: https://hugo-book-demo.netlify.app/docs/content/shortcodes/ - Asciinema: https://hugo-book-demo.netlify.app/docs/content/shortcodes/asciinema/ - Badges: https://hugo-book-demo.netlify.app/docs/content/shortcodes/badges/ - Buttons: https://hugo-book-demo.netlify.app/docs/content/shortcodes/buttons/ - Cards: https://hugo-book-demo.netlify.app/docs/content/shortcodes/cards/ - Columns: https://hugo-book-demo.netlify.app/docs/content/shortcodes/columns/ - Details: https://hugo-book-demo.netlify.app/docs/content/shortcodes/details/ - Hints: https://hugo-book-demo.netlify.app/docs/content/shortcodes/hints/ - Images: https://hugo-book-demo.netlify.app/docs/content/shortcodes/images/ - Mermaid: https://hugo-book-demo.netlify.app/docs/content/shortcodes/mermaid/ - Steps: https://hugo-book-demo.netlify.app/docs/content/shortcodes/steps/ - Tabs: https://hugo-book-demo.netlify.app/docs/content/shortcodes/tabs/ - KaTeX: https://hugo-book-demo.netlify.app/docs/content/shortcodes/katex/ - Styles: https://hugo-book-demo.netlify.app/docs/customization/styles/ - Inject Partials: https://hugo-book-demo.netlify.app/docs/customization/inject-partials/ # KaTeX Render math typesetting with [KaTeX](https://katex.org/). The library is loaded automatically on first use. {{< katex />}} ## Activation KaTeX is activated on the page by the first use of the shortcode or a `katex` code block. You can force activation with `{{}}`, then use delimiters anywhere on the page. ## Block Rendering Three equivalent ways to render display math: {{% columns %}} - **Shortcode** ```tpl {{}} f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {{< /katex */>}} ``` - **Code block** ```` ```katex f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi ``` ```` - **Dollar delimiters** ``` $$ f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi $$ ``` {{% /columns %}} Result: $$ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi $$ ## Inline Rendering | Syntax | Output | | -- | -- | | `{{}}\pi(x){{< /katex */>}}` | {{< katex >}}\pi(x){{< /katex >}} | | `\\( \pi(x) \\)` | \\( \pi(x) \\) | ## Configuration Override KaTeX options by creating `assets/katex.json`. For example, to enable `$...$` inline delimiters ```json { "delimiters": [ {"left": "$$", "right": "$$", "display": true}, {"left": "$", "right": "$", "display": false}, {"left": "\\(", "right": "\\)", "display": false}, {"left": "\\[", "right": "\\]", "display": true} ] } ``` See [KaTeX options](https://katex.org/docs/options.html) for all available settings.