window.MathJax = {
  loader: {
    load: ["input/tex-full", "output/chtml"]
  },
  tex: {
    processEscapes: true,
    processEnvironments: true
  },
  options: {
    ignoreHtmlClass: ".*|",
    processHtmlClass: "arithmatex"
  }
};

document$.subscribe(() => {
  MathJax.typesetPromise?.(
    document.querySelectorAll(".arithmatex")
  ).catch((error) => console.error(error));
});
