From a2c937df3d02753ea9f041c062a5aba9afa9b16d Mon Sep 17 00:00:00 2001 From: krahets Date: Mon, 17 Jul 2023 18:54:07 +0800 Subject: [PATCH] build --- javascripts/katex.js | 10 ++++++++++ javascripts/mathjax.js | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 javascripts/katex.js create mode 100644 javascripts/mathjax.js diff --git a/javascripts/katex.js b/javascripts/katex.js new file mode 100644 index 000000000..0946ce0a8 --- /dev/null +++ b/javascripts/katex.js @@ -0,0 +1,10 @@ +document$.subscribe(({ body }) => { + renderMathInElement(body, { + delimiters: [ + { left: "$$", right: "$$", display: true }, + { left: "$", right: "$", display: false }, + { left: "\\(", right: "\\)", display: false }, + { left: "\\[", right: "\\]", display: true }, + ], + }); +}); diff --git a/javascripts/mathjax.js b/javascripts/mathjax.js new file mode 100644 index 000000000..117b04607 --- /dev/null +++ b/javascripts/mathjax.js @@ -0,0 +1,16 @@ +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true, + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex", + }, +}; + +document$.subscribe(() => { + MathJax.typesetPromise(); +});