mathjax v2 to v3

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

View File

@@ -1066,90 +1066,80 @@ Uses function `my-org-headline-string-element'"
(setq org-html-doctype "html5")
(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-mathjax-options
'((path "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML")
;;(path "/js/MathJax-master/MathJax.js?config=TeX-AMS_HTML")
(scale "100")
(setq org-html-mathjax-options ;; variables used in `org-html-mathjax-template'
'((path "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js")
(scale "1.0")
(align "center")
(font "TeX")
(linebreaks "false")
(autonumber "AMS")
(overflow "overflow")
(tags "ams")
(indent "0em")
(multlinewidth "85%")
(tagindent ".8em")
(tagside "right"))) ;; #+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler
;; http://docs.mathjax.org/en/latest/input/tex/macros/
(setq org-html-mathjax-template "<script type=\"text/x-mathjax-config\">
MathJax.Ajax.config.path[\"Contrib\"] = \"https://cdn.mathjax.org/mathjax/contrib\";
MathJax.Hub.Register.StartupHook(\"TeX Jax Ready\",function () {
MathJax.Hub.Insert(MathJax.InputJax.TeX.Definitions.macros,{
cancel: [\"Extension\",\"cancel\"],
bcancel: [\"Extension\",\"cancel\"],
xcancel: [\"Extension\",\"cancel\"],
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,
linebreaks: { automatic: \"%LINEBREAKS\" },
font: \"%FONT\"},
NativeMML: {scale: %SCALE},
TeX: { equationNumbers: {autoNumber: \"%AUTONUMBER\"},
MultLineWidth: \"%MULTLINEWIDTH\",
TagSide: \"%TAGSIDE\",
TagIndent: \"%TAGINDENT\",
Macros: {
ti: [\"{_\\\\text{#1}}\",1],
ho: [\"{^\\\\text{#1}}\",1],
field: [\"\\\\mathbb{#1}\",1],
fC: \"{\\\\field{C}}\",
fN: \"{\\\\field{N}}\",
fR: \"{\\\\field{R}}\",
fQ: \"{\\\\field{Q}}\",
fI: \"{\\\\field{I}}\",
fZ: \"{\\\\field{Z}}\",
qed: \"{\\\\blacksquare}\",
T: \"{\\\\mathrm{T}}\",
dif: \"{\\\\,\\\\mathop{}\\\\!\\\\mathrm{d}}\",
norm: [\"{\\\\lVert{}#1\\\\rVert}\",1],
abs: [\"{\\\\lvert{}#1\\\\rvert}\",1],
corresponds: \"{{\\\\kern0em\\\\raise{.5ex}{\\\\Large\\\\hat{}}\\\\kern-.73em\\\\raise{-.2ex}{=}}\\\\ }\",
dt: [\"{\\\\overset{{\\\\large\\\\bf{}.}}{#1}}\",1],
ddt: [\"{\\\\overset{{\\\\large\\\\bf{}.\\\\hspace{-0.1ex}.}}{#1}}\",1],
Eval: [\"{\\\\left.#1\\\\phantom{\\\\Big|}\\\\!\\\\!\\\\right\\\\rvert_{#2}^{#3}}\",3],
tensor: [\"{\\\\mathbf{#1}}\",1],
tensorI: [\"{\\\\underline{\\\\mathbf{#1}}}\",1],
tensorII: [\"{\\\\underline{\\\\underline{\\\\mathbf{#1}}}}\",1],
tensorIII: [\"{\\\\underset{\\\\raise{.5ex}{\\\\Large\\\\tilde{\\\\small{}3}}}{\\\\mathbf{#1}}}\",1],
tensorIV: [\"{\\\\underset{\\\\raise{.5ex}{\\\\Large\\\\tilde{\\\\small{}4}}}{\\\\mathbf{#1}}}\",1],
tensori: [\"{\\\\overrightarrow{#1}}\",1],
tensorii: [\"{\\\\overleftrightarrow{#1}}\",1],
tensoriii: [\"{\\\\overrightarrow{\\\\overleftrightarrow{#1}}}\",1],
tensoriv: [\"{\\\\overleftrightarrow{\\\\overleftrightarrow{#1}}}\",1],
rank: \"{\\\\mathop{\\\\mathrm{rank}}}\",
tr: \"{\\\\mathop{\\\\mathrm{tr}}}\",
dev: \"{\\\\mathop{\\\\mathrm{dev}}}\",
var: \"{\\\\mathop{\\\\mathrm{var}}}\",
grad: \"{\\\\mathop{\\\\mathrm{grad}}}\",
divergence: \"{\\\\mathop{\\\\mathrm{div}}}\",
rot: \"{\\\\mathop{\\\\mathrm{rot}}}\",
diag: \"{\\\\mathop{\\\\mathrm{diag}}}\",
adjungate: \"{\\\\mathop{\\\\mathrm{adj}}}\",
EUR: \"{\\\\text{€}}\"
}
}
});
;; TODO: old config v2 to v3
;; variable ONLY in upper-case!
(setq org-html-mathjax-template "
<script>
MathJax = {
chtml: {
scale: %SCALE
},
svg: {
scale: %SCALE
},
tex: {
inlineMath: [['\\\\(', '\\\\)']],
tags: \"%TAGS\",
multlineWidth: \"%MULTLINEWIDTH\",
tagSide: \"$TAGSIDE\",
tagIndent: \"%TAGINDENT\",
macros: {
ti: [\"{_\\\\text{#1}}\",1],
ho: [\"{^\\\\text{#1}}\",1],
field: [\"\\\\mathbb{#1}\",1],
fC: \"{\\\\field{C}}\",
fN: \"{\\\\field{N}}\",
fR: \"{\\\\field{R}}\",
fQ: \"{\\\\field{Q}}\",
fI: \"{\\\\field{I}}\",
fZ: \"{\\\\field{Z}}\",
qed: \"{\\\\blacksquare}\",
T: \"{\\\\mathrm{T}}\",
dif: \"{\\\\,\\\\mathop{}\\\\!\\\\mathrm{d}}\",
norm: [\"{\\\\lVert{}#1\\\\rVert}\",1],
abs: [\"{\\\\lvert{}#1\\\\rvert}\",1],
corresponds: \"{{\\\\kern0em\\\\raise{.5ex}{\\\\Large\\\\hat{}}\\\\kern-.73em\\\\raise{-.2ex}{=}}\\\\ }\",
dt: [\"{\\\\overset{{\\\\large\\\\bf{}.}}{#1}}\",1],
ddt: [\"{\\\\overset{{\\\\large\\\\bf{}.\\\\hspace{-0.1ex}.}}{#1}}\",1],
Eval: [\"{\\\\left.#1\\\\phantom{\\\\Big|}\\\\!\\\\!\\\\right\\\\rvert_{#2}^{#3}}\",3],
tensor: [\"{\\\\mathbf{#1}}\",1],
tensorI: [\"{\\\\underline{\\\\mathbf{#1}}}\",1],
tensorII: [\"{\\\\underline{\\\\underline{\\\\mathbf{#1}}}}\",1],
tensorIII: [\"{\\\\underset{\\\\raise{.5ex}{\\\\Large\\\\tilde{\\\\small{}3}}}{\\\\mathbf{#1}}}\",1],
tensorIV: [\"{\\\\underset{\\\\raise{.5ex}{\\\\Large\\\\tilde{\\\\small{}4}}}{\\\\mathbf{#1}}}\",1],
tensori: [\"{\\\\overrightarrow{#1}}\",1],
tensorii: [\"{\\\\overleftrightarrow{#1}}\",1],
tensoriii: [\"{\\\\overrightarrow{\\\\overleftrightarrow{#1}}}\",1],
tensoriv: [\"{\\\\overleftrightarrow{\\\\overleftrightarrow{#1}}}\",1],
rank: \"{\\\\mathop{\\\\mathrm{rank}}}\",
tr: \"{\\\\mathop{\\\\mathrm{tr}}}\",
dev: \"{\\\\mathop{\\\\mathrm{dev}}}\",
var: \"{\\\\mathop{\\\\mathrm{var}}}\",
grad: \"{\\\\mathop{\\\\mathrm{grad}}}\",
divergence: \"{\\\\mathop{\\\\mathrm{div}}}\",
rot: \"{\\\\mathop{\\\\mathrm{rot}}}\",
diag: \"{\\\\mathop{\\\\mathrm{diag}}}\",
adjungate: \"{\\\\mathop{\\\\mathrm{adj}}}\",
EUR: \"{\\\\text{€}}\"
}
}
};
</script>
<script type=\"text/javascript\"
src=\"%PATH\"></script>")
<script type=\"text/javascript\" id=\"MathJax-script\" async
src=\"%PATH\"></script>
")
)
(use-package ox-latex