[Tex/LaTex] Mathjax inline mode not rendering

mathjax

In wordpress, I appended the Mathjax CDN to my header file. The inline equations do not render while the display-mode equations seem fine. An example:

enter image description here

I have experience with Mathjax on another CMS (Drupal) and never had such a problem, or even on Math.SE . The reason I do not post it on the wordpress forum is because I did not install any plugin, so this has nothing to do with wordpress I guess.

Does anyone know why this is happening? For completeness, I appended the following script before the </head>

<script type="text/javascript"
   src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

Best Answer

You can enable the $ … $-style inline mode by inserting the following code into the <head> section of your HTML before MathJax is being loaded. This way, you can invent new delimiters, too.

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      processEscapes: true
    }
  });
</script>
    
<script type="text/javascript"
        src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

Remember that after enabling this, you have to escape 'normal' dollar signs with \$.

A more detailed description can be found in the MathJax documentation. It also describes why the single dollar delimiters are disabled by default:

Note that the single dollar signs are not enabled by default because they are used too frequently in normal text, so if you want to use them for math delimiters, you must specify them explicitly.

In MathJax v3, the configuration API changed. You now create a global MathJax object:

<script type="text/x-mathjax-config">
  MathJax = {
    tex: {
      inlineMath: [['$', '$'], ["\\(", "\\)"]],
      processEscapes: true,
    }
  }
</script>
Related Question