最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - MathJax not rendering with custom delimiters or script configs - Stack Overflow

programmeradmin5浏览0评论

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="@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.

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.

Share Improve this question edited Jan 20 at 16:01 swain-mote-further asked Jan 20 at 15:56 swain-mote-furtherswain-mote-further 311 silver badge1 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 1

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

发布评论

评论列表(0)

  1. 暂无评论