<script type= "text/javascript">
    if (!document.getElementById('mathjaxscript_pelican_#%@#$@#')) {{
        var mathjaxscript = document.createElement('script');
        mathjaxscript.id = 'mathjaxscript_pelican_#%@#$@#';
        mathjaxscript.type = 'text/javascript';
        mathjaxscript.src = {source};
        mathjaxscript[(window.opera ? "innerHTML" : "text")] =
            "MathJax.Hub.Config({{" +
            "    config: ['MMLorHTML.js']," +
            "    TeX: {{ extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: {{ autoNumber: 'AMS' }} }}," +
            "    jax: ['input/TeX','input/MathML','output/HTML-CSS']," +
            "    extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," +
            "    displayAlign: '{align}'," +
            "    displayIndent: '{indent}'," +
            "    showMathMenu: {show_menu}," +
            "    tex2jax: {{ " +
            "        inlineMath: [ ['$','$'] ], " +
            "        displayMath: [ ['$$','$$'] ]," +
            "        processEscapes: {process_escapes}," +
            "        preview: '{latex_preview}'," +
            "    }}, " +
            "    'HTML-CSS': {{ " +
            "        styles: {{ '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {{color: '{color} ! important'}} }}" +
            "    }} " +
            "}}); ";
        (document.body || document.getElementsByTagName('head')[0]).appendChild(mathjaxscript);
    }}
</script>
