2023-10-09 17:42:51 +02:00
|
|
|
{{- $page := .page }}
|
2024-04-03 23:30:51 +02:00
|
|
|
{{- $location := .location }}
|
|
|
|
{{- if eq $location "footer" }}
|
|
|
|
{{- with $page }}
|
2024-09-11 20:22:53 +02:00
|
|
|
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
|
2024-04-03 23:30:51 +02:00
|
|
|
{{- $init := "{}" }}
|
|
|
|
{{- if isset .Params "mathjaxinitialize" }}
|
|
|
|
{{- $init = .Params.mathJaxInitialize }}
|
|
|
|
{{- else if isset .Site.Params "mathjaxinitialize" }}
|
|
|
|
{{- $init = .Site.Params.mathJaxInitialize }}
|
|
|
|
{{- end }}
|
2023-10-09 17:42:51 +02:00
|
|
|
<script>
|
2025-02-23 17:06:23 +01:00
|
|
|
window.MathJax = Object.assign( window.MathJax || {}, {
|
|
|
|
tex: {
|
|
|
|
inlineMath: [['\\(', '\\)'], ['$', '$']], // inline
|
|
|
|
displayMath: [['\\[', '\\]'], ['$$', '$$']], // block
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
enableMenu: false // avoid translation hassle for context menu
|
|
|
|
}
|
|
|
|
}, JSON.parse({{ $init }}) );
|
2023-10-09 17:42:51 +02:00
|
|
|
</script>
|
2024-04-03 23:30:51 +02:00
|
|
|
{{- if and (isset .Params "custommathjaxurl") .Params.customMathJaxURL }}
|
2023-10-09 17:42:51 +02:00
|
|
|
<script id="MathJax-script" async src="{{ .Params.customMathJaxURL }}"></script>
|
2024-04-03 23:30:51 +02:00
|
|
|
{{- else if and (isset .Site.Params "custommathjaxurl") .Site.Params.customMathJaxURL }}
|
2023-10-09 17:42:51 +02:00
|
|
|
<script id="MathJax-script" async src="{{ .Site.Params.customMathJaxURL }}"></script>
|
2024-04-03 23:30:51 +02:00
|
|
|
{{- else }}
|
2025-02-23 17:06:23 +01:00
|
|
|
{{- with resources.Get "/js/mathjax/tex-mml-chtml.js" }}
|
|
|
|
<script id="MathJax-script" async src="{{ .RelPermalink }}{{ $assetBusting }}"></script>
|
|
|
|
{{- end }}
|
|
|
|
{{- range resources.Match "/js/mathjax/**" }}
|
|
|
|
{{- /* the following code causes Hugo to generate our file in public */}}
|
|
|
|
{{- $url := .RelPermalink }}
|
|
|
|
{{- end }}
|
2024-04-03 23:30:51 +02:00
|
|
|
{{- end }}
|
2023-10-09 17:42:51 +02:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|