Skip to content

Commit

Permalink
Use user-defined delimiters for GLFM math blocks
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
  • Loading branch information
stephanlachnit authored and chalin committed Oct 8, 2022
1 parent 135671d commit 17b85bb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions layouts/_default/_markup/render-codeblock-math.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
<p>$$
{{/* 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 */}}
<p>{{ $delimiter_left }}
{{ .Inner | safeHTML }}
$$</p>
{{ $delimiter_right }}</p>

0 comments on commit 17b85bb

Please sign in to comment.