anki/ts/mathjax/index.ts
Henrik Giesel 3b8aa97396
Use same config for editor and reviewer Mathjax (#1865)
* Remove custom config and use tex-chtml-full for editor Mathjax

* Add mathjax package in /ts

* Share mathjax config between tex-svg and tex-chtml

* Use "[+]" in Mathjax config again

* Remove mention of MathJaxReady

* Satisfy eslint
2022-05-13 13:23:35 +10:00

32 lines
783 B
TypeScript

// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
/// <reference types="./mathjax-types" />
const packages = ["noerrors", "mathtools", "mhchem"];
function packagesForLoading(packages: string[]): string[] {
return packages.map((value: string): string => `[tex]/${value}`);
}
window.MathJax = {
tex: {
displayMath: [["\\[", "\\]"]],
processEscapes: false,
processEnvironments: false,
processRefs: false,
packages: {
"[+]": packages,
},
},
loader: {
load: packagesForLoading(packages),
paths: {
mathjax: "/_anki/js/vendor/mathjax",
},
},
startup: {
typeset: false,
},
};