This commit is contained in:
Sören Weber 2024-04-21 23:47:36 +02:00
parent 1934f80347
commit 16053f5181
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 9 additions and 3 deletions

View file

@ -361,7 +361,7 @@ link.errorlevel = "warning"
# values for the HTML `target` attribute of the `a` element are allowed. The # 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 # default value opens external links in a separate browser tab. If you want
# to open those links in the same tab, use "_self". # to open those links in the same tab, use "_self".
externalLinkTarget = "_blank" externalLinkTarget = "_self"
# Generate link URLs the Hugo way. # Generate link URLs the Hugo way.
# Default: false # Default: false

View file

@ -5,8 +5,6 @@ title = "Math"
The `math` shortcode generates beautiful formatted math and chemical formulae using the [MathJax](https://mathjax.org/) library. 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" >}} {{< 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)$$ $$\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 >}} {{< /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. 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">}} {{< tabs groupid="shortcode-parameter">}}
{{% tab title="codefence" %}} {{% 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 disableMathJax = false
{{< /multiconfig >}} {{< /multiconfig >}}
See the [example](#passthrough) on how it makes using math really easy.
## Examples ## Examples
### Inline Math ### 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 ### 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 ````md
$$\left| $$\left|
\begin{array}{cc} \begin{array}{cc}