Project: MetalLB (Orchestration & Management / Service Proxy)
File: math.en.md

+++ description = "Beautiful math and chemical formulae" title = "Math" +++ The `math` shortcode generates beautiful formatted math and chemical formulae using the library. {{< math align="center" >}} $$\left( \sum{k=1}^n ak bk \right)^2 \leq \left( \sum{k=1}^n ak^2 \right) \left( \sum{k=1}^n b_k^2 \right)$$ {{< /math >}} {{% notice note %}} This only works in modern browsers. {{% /notice %}} While the examples are using shortcodes with named parameter it is recommended to use codefences instead. This is because more and more other software supports Math codefences (eg. GitHub) and so your markdown becomes more portable. You are free to also call this shortcode from your own partials. {{< tabs groupid="shortcode-parameter">}} {{% tab title="codefence" %}} ````md ```math { align="center" } $$\left( \sum{k=1}^n ak bk \right)^2 \leq \left( \sum{k=1}^n ak^2 \right) \left( \sum{k=1}^n b_k^2 \right)$$ ``` ```` {{% /tab %}} {{% tab title="shortcode" %}} ````go {{</ math align="center" />}} $$\left( \sum{k=1}^n ak bk \right)^2 \leq \left( \sum{k=1}^n ak^2 \right) \left( \sum{k=1}^n b_k^2 \right)$$ {{</ /math />}} ```` {{% /tab %}} {{% tab title="partial" %}} ````go {{ partial "shortcodes/math.html" (dict "page" . "content" "$$left( \sum{k=1}^n ak bk \right)^2 \leq \left( \sum{k=1}^n ak^2 \right) \left( \sum{k=1}^n b_k^2 \right)$$" "align" "center" )}} ```` {{% /tab %}} {{< /tabs >}} | Name | Default | Notes | |--||-| | align | `center` | Allowed values are `left`, `center` or `right`. | | **&lt;content&gt;** | &lt;empty&gt; | Your formulae. | MathJax is configured with default settings. You can customize MathJax's default settings for all of your files thru a JSON object in your `hugo.toml` or override these settings per page thru your pages frontmatter. The JSON object of your `hugo.toml` / frontmatter is forwarded into MathJax's configuration object. See for all allowed settings. {{< multiconfig file=hugo >}} [params] mathJaxInitialize = "{ \"chtml\": { \"displayAlign\": \"left\" } }" {{< /multiconfig >}} {{< multiconfig fm=true >}} mathJaxInitialize = "{ \"chtml\": { \"displayAlign\": \"left\" } }" {{< /multiconfig >}} ````md Inline math is generated if you use a single `$` as a delimiter around your formulae: {{</ math />}}$\sqrt{3}${{</ /math />}} ```` Inline math is generated if you use a single `$` as a delimiter around your formulae: {{< math >}}$\sqrt{3}${{< /math >}} ````md If you delimit your formulae by two consecutive `$$` it generates a new block. {{</ math align="right" />}} $$\left( \sum{k=1}^n ak bk \right)^2 \leq \left( \sum{k=1}^n ak^2 \right) \left( \sum{k=1}^n b_k^2 \right)$$ {{</ /math />}} ```` If you delimit your formulae by two consecutive `$$` it generates a new block. {{< math align="right" >}} $$\left( \sum{k=1}^n ak bk \right)^2 \leq \left( \sum{k=1}^n ak^2 \right) \left( \sum{k=1}^n b_k^2 \right)$$ {{< /math >}} You can also use codefences. ````md ```math $$\left( \sum{k=1}^n ak bk \right)^2 \leq \left( \sum{k=1}^n ak^2 \right) \left( \sum{k=1}^n b_k^2 \right)$$ ``` ```` ````math $$\left( \sum{k=1}^n ak bk \right)^2 \leq \left( \sum{k=1}^n ak^2 \right) \left( \sum{k=1}^n b_k^2 \right)$$ ```` ````md {{</ math />}} $$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$ {{</ /math />}} ````` {{< math >}} $$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$ {{< /math >}}