Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda