Creating new commands for mathjax

In latex when defining a new command we can use

\newcommand{...}{...}

Is there a mathjax equivalent? Concretely, I’m trying to define the new command

\newcommand{\indep}{\perp \! \! \! \perp}

for mathjax. I tried adding

<script>
MathJax.config.tex['macros'] = {
    indep: "\\perp \\! \\! \\! \\perp",
};
if (typeof is_already_run == 'undefined') {
  is_already_run = true
  MathJax.startup.getComponents();
}
</script>

to the front and back template and while it works fine when I preview the card, the command appears as an error in the live preview for mathjax. Is there a way to fix this or perhaps a better solution? Thanks in advance!

Please see Mathjax macros in previewer

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.