mathjax v2 to v3

This commit is contained in:
2023-03-26 20:57:54 +02:00
parent 6253368410
commit a075f93c3e

View File

@@ -1066,47 +1066,36 @@ Uses function `my-org-headline-string-element'"
(setq org-html-doctype "html5") (setq org-html-doctype "html5")
(setq org-html-html5-fancy t) (setq org-html-html5-fancy t)
(setq org-html-validation-link nil) ;; remove the "Validate" link at the bottom of the page (setq org-html-validation-link nil) ;; remove the "Validate" link at the bottom of the page
(setq org-html-mathjax-options (setq org-html-mathjax-options ;; variables used in `org-html-mathjax-template'
'((path "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML") '((path "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js")
;;(path "/js/MathJax-master/MathJax.js?config=TeX-AMS_HTML") (scale "1.0")
(scale "100")
(align "center") (align "center")
(font "TeX") (font "TeX")
(linebreaks "false") (overflow "overflow")
(autonumber "AMS") (tags "ams")
(indent "0em") (indent "0em")
(multlinewidth "85%") (multlinewidth "85%")
(tagindent ".8em") (tagindent ".8em")
(tagside "right"))) ;; #+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler (tagside "right"))) ;; #+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler
;; http://docs.mathjax.org/en/latest/input/tex/macros/ ;; http://docs.mathjax.org/en/latest/input/tex/macros/
(setq org-html-mathjax-template "<script type=\"text/x-mathjax-config\"> ;; TODO: old config v2 to v3
MathJax.Ajax.config.path[\"Contrib\"] = \"https://cdn.mathjax.org/mathjax/contrib\"; ;; variable ONLY in upper-case!
MathJax.Hub.Register.StartupHook(\"TeX Jax Ready\",function () { (setq org-html-mathjax-template "
MathJax.Hub.Insert(MathJax.InputJax.TeX.Definitions.macros,{ <script>
cancel: [\"Extension\",\"cancel\"], MathJax = {
bcancel: [\"Extension\",\"cancel\"], chtml: {
xcancel: [\"Extension\",\"cancel\"], scale: %SCALE
cancelto: [\"Extension\",\"cancel\"]
});
});
MathJax.Hub.Config({
extensions: [\"[Contrib]/siunitx/siunitx.js\"],
displayAlign: \"%ALIGN\",
displayIndent: \"%INDENT\",
\"HTML-CSS\": { scale: %SCALE,
linebreaks: { automatic: \"%LINEBREAKS\" },
webFont: \"%FONT\"
}, },
SVG: {scale: %SCALE, svg: {
linebreaks: { automatic: \"%LINEBREAKS\" }, scale: %SCALE
font: \"%FONT\"}, },
NativeMML: {scale: %SCALE}, tex: {
TeX: { equationNumbers: {autoNumber: \"%AUTONUMBER\"}, inlineMath: [['\\\\(', '\\\\)']],
MultLineWidth: \"%MULTLINEWIDTH\", tags: \"%TAGS\",
TagSide: \"%TAGSIDE\", multlineWidth: \"%MULTLINEWIDTH\",
TagIndent: \"%TAGINDENT\", tagSide: \"$TAGSIDE\",
Macros: { tagIndent: \"%TAGINDENT\",
macros: {
ti: [\"{_\\\\text{#1}}\",1], ti: [\"{_\\\\text{#1}}\",1],
ho: [\"{^\\\\text{#1}}\",1], ho: [\"{^\\\\text{#1}}\",1],
field: [\"\\\\mathbb{#1}\",1], field: [\"\\\\mathbb{#1}\",1],
@@ -1146,10 +1135,11 @@ Uses function `my-org-headline-string-element'"
EUR: \"{\\\\text{€}}\" EUR: \"{\\\\text{€}}\"
} }
} }
}); };
</script> </script>
<script type=\"text/javascript\" <script type=\"text/javascript\" id=\"MathJax-script\" async
src=\"%PATH\"></script>") src=\"%PATH\"></script>
")
) )
(use-package ox-latex (use-package ox-latex