mylloon.fr/static/js/libs/katex.js

27 lines
583 B
JavaScript
Raw Normal View History

2023-04-24 16:18:54 +02:00
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",
})
)[Symbol.iterator]()) {
macros[`\\${item[0]}`] = `\\${item[1]}`;
}
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
],
throwOnError: false,
macros,
});
});