diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index c7e3654882..21b4d550a3 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -1,10 +1,12 @@
-{{ $needKaTeX := or .Site.Params.katex.enable .Params.math .Params.chem (.Page.Store.Get "hasKaTeX") (.Page.Store.Get "hasmhchem") -}}
-{{ $needmhchem := or .Site.Params.katex.mhchem.enable .Params.chem (.Page.Store.Get "hasmhchem") -}}
+{{ $needKaTeX := or .Site.Params.katex.enable .Params.math .Params.chem -}}
+{{ $needmhchem := or .Site.Params.katex.mhchem.enable .Params.chem -}}
{{ $needmermaid := .Site.Params.mermaid.enable -}}
{{ if ge hugo.Version "0.93.0" -}}
{{ with .Site.Params.mermaid }}
{{ $needmermaid = true }}
{{ end }}
+ {{ $needKaTeX = or $needKaTeX (.Page.Store.Get "hasKaTeX") (.Page.Store.Get "hasmhchem") -}}
+ {{ $needmhchem = or $needmhchem (.Page.Store.Get "hasmhchem") -}}
{{ $needmermaid = or $needmermaid (.Page.Store.Get "hasmermaid") -}}
{{ else -}}
{{ if or $needKaTeX $needmhchem $needmermaid -}}
diff --git a/userguide/config.yaml b/userguide/config.yaml
index 25df4bff58..86d400b81b 100644
--- a/userguide/config.yaml
+++ b/userguide/config.yaml
@@ -111,11 +111,6 @@ params:
theme: default
svg_image_url: https://www.plantuml.com/plantuml/svg/
svg: false
- katex:
- enable: true
- html_dom_element: document.body
- mhchem:
- enable: true
print:
disable_toc: false
markmap: