diff --git a/docs/mathjax.config.js b/docs/mathjax.config.js new file mode 100644 index 0000000000000000000000000000000000000000..14555b5815c854167f0daad81e0997e544df136b --- /dev/null +++ b/docs/mathjax.config.js @@ -0,0 +1,12 @@ +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex" + } +}; \ No newline at end of file diff --git a/mkdocs-en.yml b/mkdocs-en.yml index 5cad5860716be6448d923c2e654c7d9f050b7156..0278e599d7a86672a748abd9c4e16bcf28a9d469 100644 --- a/mkdocs-en.yml +++ b/mkdocs-en.yml @@ -10,12 +10,15 @@ theme: language: 'en' use_directory_urls: false extra_javascript: - - ../javascripts/mathjax/MathJax.js?config=TeX-AMS_CHTML + - ../javascripts/mathjax.config.js + - ../javascripts/mathjax/tex-mml-chtml.js - ../javascripts/matomo-tracking.js markdown_extensions: - mdx_math - footnotes - codehilite + - pymdownx.arithmatex: + generic: true nav: - Presentation of Cassiopée: - index.md diff --git a/mkdocs-fr.yml b/mkdocs-fr.yml index f7ac501cdb461fe721c935b2d0bef37a3807face..6b0870d906c13445c9d7697e7fcbde9f79fe2039 100644 --- a/mkdocs-fr.yml +++ b/mkdocs-fr.yml @@ -10,12 +10,15 @@ theme: language: 'fr' use_directory_urls: false extra_javascript: - - ../javascripts/mathjax/MathJax.js?config=TeX-AMS_CHTML + - ../javascripts/mathjax.config.js + - ../javascripts/mathjax/tex-mml-chtml.js - ../javascripts/matomo-tracking.js markdown_extensions: - mdx_math - footnotes - codehilite + - pymdownx.arithmatex: + generic: true nav: - Présentation de Cassiopée: - index.md diff --git a/package-lock.json b/package-lock.json index 07c9e6b817a4a8cf688f7aeec0d33c2b860a1269..16fb374d223243cff5ba827b1638699a1c0e4bb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13146,9 +13146,9 @@ "integrity": "sha1-mnHEh0chjrylHlGmbaaCA4zct78=" }, "mathjax": { - "version": "2.7.8", - "resolved": "https://registry.npmjs.org/mathjax/-/mathjax-2.7.8.tgz", - "integrity": "sha512-n4xZJ+cw7o01YOSVhxxjyOmibqBPCi+XTDof4siq78QWMx7Fxjzgb/mxMUEElMzTDodMV7ENIMsjREOSldOQPw==" + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/mathjax/-/mathjax-3.0.5.tgz", + "integrity": "sha512-9M7VulhltkD8sIebWutK/VfAD+m+6BIFqfpjDh9Pz/etoKUtjO6UMnOhUcDmNl6iApE8C9xrUmaMyNZkZAlrMw==" }, "md5-file": { "version": "5.0.0", diff --git a/package.json b/package.json index efc799d437d90c3de0fffc24d551b20bfd3443ac..4659066354f7753cbdd92324ea8bb72e252df356 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "he": "^1.2.0", "jalhyd": "file:../jalhyd", "material-design-icons": "^3.0.1", - "mathjax": "^2.7.8", + "mathjax": "^3.0.5", "mermaid": "^8.7.0", "ngx-konami": "^1.7.1", "ngx-markdown": "^10.1.1", diff --git a/scripts/mkdocs-postprocess.js b/scripts/mkdocs-postprocess.js index fcb2b04ebea7069e0faf455aaa3f91c2abf2e5bb..5e4cc9e6f5928d304fbfe4d81b7a506a393b2eb3 100644 --- a/scripts/mkdocs-postprocess.js +++ b/scripts/mkdocs-postprocess.js @@ -16,10 +16,9 @@ fs.emptyDirSync(destPath); fs.ensureDirSync(destPathMJ + "/fonts/HTML-CSS/TeX/", { recursive: true }); // copy required files only -fs.copySync("node_modules/mathjax/MathJax.js", destPathMJ + "/MathJax.js"); -fs.copySync("node_modules/mathjax/config", destPathMJ + "/config"); -fs.copySync("node_modules/mathjax/jax", destPathMJ + "/jax"); -fs.copySync("node_modules/mathjax/fonts/HTML-CSS/TeX/woff", destPathMJ + "/fonts/HTML-CSS/TeX/woff"); -fs.copySync("node_modules/mathjax/fonts/HTML-CSS/TeX/otf", destPathMJ + "/fonts/HTML-CSS/TeX/otf"); +fs.copySync("node_modules/mathjax/es5/tex-mml-chtml.js", destPathMJ + "/tex-mml-chtml.js"); +fs.copySync("node_modules/mathjax/es5/output/chtml/fonts", destPathMJ + "/output/chtml/fonts"); + +fs.copySync("docs/mathjax.config.js", destPath + "/mathjax.config.js"); fs.copySync("docs/matomo-tracking.js", destPath + "/matomo-tracking.js");