diff --git a/layouts/_default/_markup/render-codeblock-math.html b/layouts/_default/_markup/render-codeblock-math.html index 149a1ae188..831b9a2f6b 100644 --- a/layouts/_default/_markup/render-codeblock-math.html +++ b/layouts/_default/_markup/render-codeblock-math.html @@ -1,3 +1,16 @@ -
$$ +{{/* set default delimiters */}} +{{ $delimiter_left := "$$" }} +{{ $delimiter_right := "$$" }} + +{{/* override delimiters if set in config file */}} +{{ with $.Page.Site.Params.katex.options.delimiters }} + {{ range first 1 ( where . "display" true ) }} + {{ $delimiter_left = index . "left" }} + {{ $delimiter_right = index . "right" }} + {{ end }} +{{end}} + +{{/* output of equation */}} +
{{ $delimiter_left }} {{ .Inner | safeHTML }} -$$
+{{ $delimiter_right }}