swain-mote-further
swain-mote-further

Reputation: 31

MathJax not rendering with custom delimiters or script configs

I am trying to get alternative math delimiters and other configurations to work in MathJax version 3. I am following the guide here to use the script config, i.e.

<script>
    MathJax = {
        tex: {
            inlineMath: [['$', '$'], ['\\(', '\\)']]
        },
        svg: {
          fontCache: 'global'
       }
    };
</script>
<script type="text/javascript" id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-svg.js"></script>

Despite this, I cannot get the MathJax code to render properly using dollar signs inline, although I can get the \\( and \\) to render fine. When I use inspection on the web browser, I can see that the HTML class is noted as span class="math math-inline" when using the dollar signs but class="MathJax CtxtMenu_Attached_0" when I use \\( and \\).

So, it looks like it's detecting the dollar signs as math, but not using the correct classes?

For background, the website has a Rust backend, using Tera for HTML templating, and pulldown_cmark for Markdown to HTML conversion.

I've looked through the latest documentation, and followed the latest advice. I am expecting the configuration above to allow using dollar signs for inline math.

Upvotes: 2

Views: 29

Answers (1)

swain-mote-further
swain-mote-further

Reputation: 31

This was actually a problem with pulldown_cmark, I believe, using incorrect class names for the version of MathJax.

Upvotes: 1

Related Questions