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",
|
2024-04-01 18:11:46 +02:00
|
|
|
u: "mu",
|
2024-10-03 13:06:56 +02:00
|
|
|
Tau: "mathrm{T}",
|
2024-10-08 13:21:30 +02:00
|
|
|
lb: "textlbrackdbl",
|
|
|
|
rb: "textrbrackdbl",
|
2023-04-24 16:18:54 +02:00
|
|
|
})
|
|
|
|
)[Symbol.iterator]()) {
|
2024-04-01 18:11:46 +02:00
|
|
|
const bs = "\\";
|
|
|
|
macros[`${bs}${item[0]}`] = `${bs}${item[1]}`;
|
2023-04-24 16:18:54 +02:00
|
|
|
}
|
|
|
|
|
2024-04-01 18:11:46 +02:00
|
|
|
const attribute = "data-math-style";
|
|
|
|
for (const element of document.querySelectorAll(`span[${attribute}]`)) {
|
|
|
|
katex.render(element.textContent, element, {
|
|
|
|
throwOnError: false,
|
|
|
|
displayMode: element.getAttribute(attribute) === "display",
|
|
|
|
macros: macros,
|
|
|
|
});
|
|
|
|
}
|
2023-04-24 16:18:54 +02:00
|
|
|
});
|