mirror of https://github.com/lxndrblz/anatole.git

lxndrblz
07.03.2025 36d5001e105228bf6bbcfb7a33c12bd7bebf2268
style: prettier format all files
2 files modified
13 ■■■■ changed files
exampleSite/content/english/post/math-typesetting.md 5 ●●●●● patch | view | raw | blame | history
layouts/partials/head.html 8 ●●●● patch | view | raw | blame | history
exampleSite/content/english/post/math-typesetting.md
@@ -6,6 +6,7 @@
---
For math typesetting in a Hugo project, you can leverage hugo's internal [\(\KaTeX\)](https://katex.org/) rendering engine.
<!--more-->
If you want to use mathematical or chemical equations in your site, enable the [Goldmark passthrough extension](https://gohugo.io/render-hooks/passthrough/) and define delimiters for block and inline formulae in your config file:
@@ -32,13 +33,13 @@
Block math:
$$
\tag*{(1)} \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots}}}
\tag*{(1)} \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots}}}
$$
Chemical equations:
\[
\tag*{(2)} \ce{Zn^2+  <=>[+ 2OH-][+ 2H+]  $\underset{\text{amphoteric hydroxide}}{\ce{Zn(OH)2 v}}$  <=>[+ 2OH-][+ 2H+]  $\underset{\text{tetrahydroxozincate}}{\ce{[Zn(OH)4]^2-}}$}
\tag\*{(2)} \ce{Zn^2+ <=>[+ 2OH-][+ 2H+] $\underset{\text{amphoteric hydroxide}}{\ce{Zn(OH)2 v}}$ <=>[+ 2OH-][+ 2H+] $\underset{\text{tetrahydroxozincate}}{\ce{[Zn(OH)4]^2-}}$}
\]
**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html)
layouts/partials/head.html
@@ -231,6 +231,7 @@
  <!-- Schema.org-->
  {{ partial "schema.html" . }}
  <!-- KaTeX-->
  {{ $noop := .WordCount }}
  {{ if .Page.Store.Get "hasMath" }}
@@ -241,7 +242,12 @@
      {{ else with.Value -}}
        {{ with resources.Copy (printf "css/katex%s.css" (cond hugo.IsProduction ".min" "")) . }}
          {{ $secureCSS := . | resources.Fingerprint "sha512" -}}
<link rel="stylesheet" href="{{- .RelPermalink -}}" integrity="{{- $secureCSS.Data.Integrity -}}" crossorigin="anonymous">
          <link
            rel="stylesheet"
            href="{{- .RelPermalink -}}"
            integrity="{{- $secureCSS.Data.Integrity -}}"
            crossorigin="anonymous"
          />
        {{ end -}}
      {{ end -}}
    {{ end -}}