{{- $attributes := partial "docs/text/mapper" (dict "attributes" (cond .IsNamedParams .Params dict) "merge" (dict "class" "book-katex" ) ) -}} {{- if .Inner -}} {{- if .Get "display" -}}
{{ printf "\\[ %s \\]" .Inner }}
{{- else -}} {{ printf "\\( %s \\)" .Inner }} {{- end -}} {{- end -}} {{- if not (.Page.Store.Get "katex") -}} {{- /* Include katex only first time */ -}} {{- /* remove whitespaces */ -}} {{- with resources.Get "katex.json" | minify -}} {{- end -}} {{- .Page.Store.Set "katex" true -}} {{- end -}}