Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
MathJax not processing latex environments

I am writing a blog post on blogspot. Here is my MathJax configuration in the theme's html file.

<script defer='defer' id='MathJax-script' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js' type='text/javascript'/>
<script>
window.MathJax = {
  tex: {
    loader: {load: [&#39;[tex]/ams&#39;]},
    inlineMath: [ [&#39;$&#39;,&#39;$&#39;],[&#39;\\(&#39;,&#39;\\)&#39;] ],
    displayMath: [ [&#39;$$&#39;,&#39;$$&#39;], [&#39;\\[&#39;,&#39;\\]&#39;] ],
    processEscapes: true,      
    processEnvironments: true, 
    processRefs: true,
    packages: {
        &#39;[+]&#39;: [&#39;ams&#39;]
    },
  },
};
</script>

And here is my attempt at using the amsmath align environment.

...
By linearity of expectation 

\begin{align}
    \mathbb{E}[I_r] & \leq  |I_{r-1}|+\sum_{u\in \overline{I_{r-1}}\setminus \{v_{r-1}\}}{\mathbb{E}[X_{u,r}]}+1\\
        & \leq |I_{r-1}| + c_2k(|\overline{I_{r-1}}|-1)|I_{r-1}|/n^2+1\\
        & \leq |I_{r-1}|\cdot(1+c_2k/n) + 1\\
\end{align}
...

However, when previewing my page, it just renders the text literally, without MathJax processing. How can I fix this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This works perfectly. Hope it works for you.

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <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-chtml.js">
    </script>
</head>

<body>

    <div class="math">
        \begin{align}
        \mathbb{E}[I_r] & \leq |I_{r-1}|+\sum_{u\in \overline{I_{r-1}}\setminus \{v_{r-1}\}}{\mathbb{E}[X_{u,r}]}+1\\
        & \leq |I_{r-1}| + c_2k(|\overline{I_{r-1}}|-1)|I_{r-1}|/n^2+1\\
        & \leq |I_{r-1}|\cdot(1+c_2k/n) + 1\\
        \end{align}
    </div>

</body>

<script>
const
    math = document.querySelector('.math')

MathJax.typeset();
</script>

</html>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!