From 16053f5181f5165f94104a7c7b16b2acc94fcc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sun, 21 Apr 2024 23:47:36 +0200 Subject: [PATCH] docs: math #832 --- exampleSite/config/_default/params.toml | 2 +- exampleSite/content/shortcodes/math.en.md | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 9a025728be..448e15b47e 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -361,7 +361,7 @@ link.errorlevel = "warning" # values for the HTML `target` attribute of the `a` element are allowed. The # default value opens external links in a separate browser tab. If you want # to open those links in the same tab, use "_self". -externalLinkTarget = "_blank" +externalLinkTarget = "_self" # Generate link URLs the Hugo way. # Default: false diff --git a/exampleSite/content/shortcodes/math.en.md b/exampleSite/content/shortcodes/math.en.md index 731f73b00d..adb6d88b38 100644 --- a/exampleSite/content/shortcodes/math.en.md +++ b/exampleSite/content/shortcodes/math.en.md @@ -5,8 +5,6 @@ title = "Math" The `math` shortcode generates beautiful formatted math and chemical formulae using the [MathJax](https://mathjax.org/) library. -Math is also [usable without enclosing it](https://gohugo.io/content-management/mathematics) in a shortcode or codefence but [requires configuration](#passthrough-configuration) by you. - {{< math align="center" >}} $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$ {{< /math >}} @@ -17,6 +15,8 @@ While the examples are using shortcodes with named parameter it is recommended t You are free to also call this shortcode from your own partials. +Math is also usable without enclosing it in a shortcode or codefence but [requires configuration](#passthrough-configuration) by you. In this case no parameter from the below table are available. + {{< tabs groupid="shortcode-parameter">}} {{% tab title="codefence" %}} @@ -111,6 +111,8 @@ In this case you have to tell the theme that your page contains math by setting disableMathJax = false {{< /multiconfig >}} +See the [example](#passthrough) on how it makes using math really easy. + ## Examples ### Inline Math @@ -153,6 +155,10 @@ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \ ### Passthrough +This works for block as well as inline math but is only available if you are using the [passthrough configuration](#passthrough-configuration). + +With passthrough configuration you can just drop your math without enclosing shortcodes or codefences but no settings from the [parameter table](#parameter) are available. + ````md $$\left| \begin{array}{cc}