mylloon.fr/static/js/libs/katex.js
Mylloon 9fa3f83a02
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending
resolve some weird issues
2023-12-10 23:40:16 +01:00

28 lines
620 B
JavaScript

window.addEventListener("load", () => {
const macros = {};
for (const item of new Map(
Object.entries({
N: "mathbb{N}",
R: "mathbb{R}",
Z: "mathbb{Z}",
O: "Theta",
ra: "rightarrow",
la: "leftarrow",
RA: "Rightarrow",
LA: "Leftarrow",
u: "mu",
})
)[Symbol.iterator]()) {
macros[`\\${item[0]}`] = `\\${item[1]}`;
}
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
],
throwOnError: false,
macros,
output: "mathml",
});
});