katex.html 635 B

12345678910111213141516171819
  1. <!-- prettier-ignore-start -->
  2. {{ if not (.Page.Scratch.Get "katex") }}
  3. <!-- Include katex only first time -->
  4. <link
  5. rel="stylesheet"
  6. href="{{ index (index .Site.Data.assets "katex.css") "src" | relURL }}"
  7. />
  8. <script defer src="{{ index (index .Site.Data.assets "katex.js") "src" | relURL }}"></script>
  9. {{ .Page.Scratch.Set "katex" true }}
  10. {{ end }}
  11. <!-- prettier-ignore-end -->
  12. <span class="gdoc-katex {{ with .Get "class" }}{{ . }}{{ end }}">
  13. {{ cond (in .Params "display") "\\[" "\\(" -}}
  14. {{- trim .Inner "\n" -}}
  15. {{- cond (in .Params "display") "\\]" "\\)" -}}
  16. </span>
  17. {{- /* Drop trailing newlines */ -}}