From e4e43bd9b12a3e37f0d3c2760ea7f867ba8273a7 Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Sat, 11 Apr 2020 20:05:43 +0200 Subject: Refactor KaTeX shortcode, remove whitespaces and fix font size --- layouts/shortcodes/katex.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'layouts/shortcodes/katex.html') diff --git a/layouts/shortcodes/katex.html b/layouts/shortcodes/katex.html index cc98a7d..e6b7564 100644 --- a/layouts/shortcodes/katex.html +++ b/layouts/shortcodes/katex.html @@ -1,13 +1,13 @@ -{{ if not (.Page.Scratch.Get "katex") }} +{{- if not (.Page.Scratch.Get "katex") -}} - + -{{ .Page.Scratch.Set "katex" true }} -{{ end }} +{{- .Page.Scratch.Set "katex" true -}} +{{- end -}} - - {{ if in .Params "display" }}\[{{ else }}\({{ end -}} - {{ $.Inner }} - {{- if in .Params "display" }}\]{{ else }}\){{ end }} + + {{- cond (in .Params "display") "\\[" "\\(" -}} + {{- trim .Inner "\n" -}} + {{- cond (in .Params "display") "\\]" "\\)" -}} -- cgit v1.2.3