# Mathjax is not working

**URL:** <https://discourse.gohugo.io/t/mathjax-is-not-working/11627>\
**Category:** support\
**Tags:** typesetting\
**Created:** [April 20, 2018, 8:55am UTC](https://discourse.gohugo.io/t/mathjax-is-not-working/11627 "2018-04-20T08:55:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sai\_chaithanya](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/sai_chaithanya/32/5773_2.png) [@sai\_chaithanya](https://discourse.gohugo.io/u/sai_chaithanya)\
**Post date:** [April 20, 2018, 8:55am UTC](https://discourse.gohugo.io/t/mathjax-is-not-working/11627/1 "2018-04-20T08:55:56Z")

</div>

I used Mathjax to render Equations on my hugo blog. All of a sudden Mathjax is not working. It renders equations on local environment but not rendering in actual website i am using Gitlab pages as hosting environment

```
<script type="text/javascript" async
  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
  MathJax.Hub.Config({
  tex2jax: {
    inlineMath: [['$','$'], ['\\(','\\)']],
    displayMath: [['$$','$$']],
    processEscapes: true,
    processEnvironments: true,
    skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
    TeX: { equationNumbers: { autoNumber: "AMS" },
         extensions: ["AMSmath.js", "AMSsymbols.js"] }
  }
  });
  MathJax.Hub.Queue(function() {
    // Fix <code> tags after MathJax finishes running. This is a
    // hack to overcome a shortcoming of Markdown. Discussion at
    // https://github.com/mojombo/jekyll/issues/199
    var all = MathJax.Hub.getAllJax(), i;
    for(i = 0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';
    }
  });

  MathJax.Hub.Config({
  // Autonumbering by mathjax
  TeX: { equationNumbers: { autoNumber: "AMS" } }
  });
</script> 

```

This is my mathjax support partial

I have included this in header custom

```
<header>

  <!--
  Syntax highlighting - defaults to atom light theme.
  List here: https://github.com/isagalaev/highlight.js/tree/master/src/styles
  -->
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-light.min.css">
  <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>
  {{ partial "mathjax_support.html" .}}
  <nav>
    <ul>
      {{ $title := lower .Title }}
      {{ $section := lower .Section }}
      <li class="pull-left {{ if .IsHome }}current{{ end }}">
        <a href="{{ .Site.BaseURL }}">/home/{{ lower .Site.Title}}</a>
      </li>
      {{ range .Site.Menus.main }}
      {{ $name := lower .Name }}
      <li class="pull-left {{ if eq $name $title }}current{{ else if eq $section $name }}current{{ else if eq $title (pluralize $name) }}current{{ end }}">
        <a href="{{ .URL }}">~/{{ lower .Name }}</a>
      </li>
      {{end}}

      {{ range .Site.Menus.feed }}
      {{ $name := lower .Name}}
      <li class="pull-right">
        <a href="{{ .URL }}">~/{{ lower .Name}}</a>
      </li>
      {{end}}

    </ul>
  </nav>
</header>

```

link to website post in which mathjax is used [Blog post](https://iitkgp.men/post/2018/03/29/finite-element-method---1/)

link to repository of Hugo [Hugo repository](https://gitlab.com/chaithanya1996/kgp_aero_repo)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Jura](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jura/32/13581_2.png) [@Jura](https://discourse.gohugo.io/u/Jura)\
**Post date:** [April 20, 2018, 11:03am UTC](https://discourse.gohugo.io/t/mathjax-is-not-working/11627/2 "2018-04-20T11:03:04Z")

</div>

I see that you also use Cloudflare’s Rocket loader feature on your live website. That feature changes how JavaScript files execute on your website. Have you tried disabling that feature to see whether that fixes MathJax?

Here’s more information about Rocket Loader:

> **[What does Rocket Loader do?](https://support.cloudflare.com/hc/en-us/articles/200168056-What-does-Rocket-Loader-do-)**
>
> Rocket Loader prioritises your website's content (text, images, fonts etc) by deferring the loading of all of your JavaScript until after rendering. On pages with JavaScript, this results in a much...

  

> **[How can I have Rocket Loader ignore specific JavaScripts?](https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode-)**
>
> You can have Rocket Loader ignore individual scripts by adding the data-cfasync="false" attribute to the relevant script tag, for example:      

---

<div class="post-metadata">

**Author:** ![sai\_chaithanya](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/sai_chaithanya/32/5773_2.png) [@sai\_chaithanya](https://discourse.gohugo.io/u/sai_chaithanya)\
**Post date:** [April 20, 2018, 11:17pm UTC](https://discourse.gohugo.io/t/mathjax-is-not-working/11627/3 "2018-04-20T23:17:08Z")

</div>

Thank you that is indeed the problem.

---

<div class="post-metadata">

**Author:** ![David1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/david1/32/7113_2.png) [@David1](https://discourse.gohugo.io/u/David1)\
**Post date:** [October 23, 2018, 8:56am UTC](https://discourse.gohugo.io/t/mathjax-is-not-working/11627/4 "2018-10-23T08:56:11Z")

</div>

Anyone have a good way of using a local MathJax (for offline use for example). Hugo server complains about the number of files, likely the fonts in MathJax not sure.

---

<div class="post-metadata">

**Author:** ![David1](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/david1/32/7113_2.png) [@David1](https://discourse.gohugo.io/u/David1)\
**Post date:** [October 23, 2018, 8:58am UTC](https://discourse.gohugo.io/t/mathjax-is-not-working/11627/5 "2018-10-23T08:58:18Z")

</div>

Actually, sounds like Hugo Pipes might be the way here.
