diff options
author | Samuel W. Flint <swflint@flintfam.org> | 2020-06-26 18:20:56 +0300 |
---|---|---|
committer | Samuel W. Flint <swflint@flintfam.org> | 2020-06-26 18:20:56 +0300 |
commit | 7f6469e42eefa860405a9d26d9329ac7475f7da8 (patch) | |
tree | 2f1559af918bbe22ab6e816d3a1b815a9b98773c | |
parent | 1f38d5a0ad45716b09ed120a7988a06af57ea24f (diff) |
Add option to enable use of MathJax for rendering of mathematics
-rw-r--r-- | layouts/partials/header_includes.html | 6 | ||||
-rw-r--r-- | static/js/mathjax-config.js | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/layouts/partials/header_includes.html b/layouts/partials/header_includes.html index 1a07429..3aa5418 100644 --- a/layouts/partials/header_includes.html +++ b/layouts/partials/header_includes.html @@ -2,6 +2,12 @@ <link rel="shortcut icon" href="{{ . }}" /> {{ end }} + {{- if .Site.Params.mathjax }} + <script src="/js/mathjax-config.js" defer></script> + <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> + <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + {{- end }} + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" integrity="sha256-l85OmPOjvil/SOvVt3HnSSjzF1TUMyT9eV0c2BzEGzU=" crossorigin="anonymous" /> <link rel="stylesheet" href="{{ "fontawesome/css/all.min.css" | absURL }}" /> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Slab|Ruda" /> diff --git a/static/js/mathjax-config.js b/static/js/mathjax-config.js new file mode 100644 index 0000000..73d5627 --- /dev/null +++ b/static/js/mathjax-config.js @@ -0,0 +1,9 @@ +window.MathJax = { + tex: { + tags: "ams", + inlineMath: [['$', '$'], ['\\(', '\\)']] + }, + svg: { + fontCache: 'global' + } +}; |