diff --git a/exampleSite/content/en/shortcodes/katex.md b/exampleSite/content/en/shortcodes/katex.md
index d9d7392..0fd8458 100644
--- a/exampleSite/content/en/shortcodes/katex.md
+++ b/exampleSite/content/en/shortcodes/katex.md
@@ -26,7 +26,7 @@ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
{{< /columns >}}
-KaTeX can also be used inline, for example {{< katex >}}\pi(x){{< /katex >}} or used with a `display` setting. for example `display: block`:
+KaTeX can also be used inline, for example {{< katex >}}\pi(x){{< /katex >}} or used with the `display` parameter (e.g. `display: block`):
diff --git a/layouts/shortcodes/katex.html b/layouts/shortcodes/katex.html
index 0f1f66a..3ab6b2f 100644
--- a/layouts/shortcodes/katex.html
+++ b/layouts/shortcodes/katex.html
@@ -1,12 +1,14 @@
+
{{ if not (.Page.Scratch.Get "katex") }}
-
+
+ />
+
{{ .Page.Scratch.Set "katex" true }}
{{ end }}
-
+
{{ cond (in .Params "display") "\\[" "\\(" -}}
diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html
index 0d5faba..7133016 100644
--- a/layouts/shortcodes/mermaid.html
+++ b/layouts/shortcodes/mermaid.html
@@ -1,8 +1,10 @@
+
{{ if not (.Page.Scratch.Get "mermaid") }}
-
+
+
{{ .Page.Scratch.Set "mermaid" true }}
{{ end }}
-
+