# MathJax renders in local server but not when published?

**URL:** <https://discourse.gohugo.io/t/mathjax-renders-in-local-server-but-not-when-published/48113>\
**Category:** support\
**Created:** [February 5, 2024, 3:17am UTC](https://discourse.gohugo.io/t/mathjax-renders-in-local-server-but-not-when-published/48113 "2024-02-05T03:17:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oqolarte](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/oqolarte/32/21236_2.png) [@oqolarte](https://discourse.gohugo.io/u/oqolarte)\
**Post date:** [February 5, 2024, 3:17am UTC](https://discourse.gohugo.io/t/mathjax-renders-in-local-server-but-not-when-published/48113/1 "2024-02-05T03:17:42Z")

</div>

(EDIT before even posting: as a new user, I’m limited to one media and one link.)

As of v0.122.0, Math Typesetting is now possible in Hugo. I tried incorporating some maths in my blog.

During live preview (`hugo server`), Math formulae are rendered as intended by MathJax/Katex (I tried both), but when published, they aren’t. Screenshot below:

Live, math not rendered:  
 ![math-no](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/5/a/5a3f790d1031fe0ac612018c72842daabc65c443.png)

Not sure why this is happening. In Step 3 of “Mathematics in markdown” documentation, to “conditionally call the partial template”, I put mine in `layouts/partial/head.html` instead of in `layouts/_default/baseof.html`. This is the only deviation I made, as far as I know.

Repo of my site can be found here: [GitHub - oqolarte/oblong: back-up files of oblong blog](https://github.com/oqolarte/oblong)

Could this be a hosting issue and/or something else outside of Hugo?

Thanks in advance for any help; and thanks to the developers for adding Math Typesetting to Hugo!

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 5, 2024, 3:36am UTC](https://discourse.gohugo.io/t/mathjax-renders-in-local-server-but-not-when-published/48113/2 "2024-02-05T03:36:22Z")

</div>

Use your browser’s dev tools to troubleshoot.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/c/1/c191b2d6f2a695f7cb5bab3dfd7732166b378364.png)

This isn’t a Hugo thing.

---

<div class="post-metadata">

**Author:** ![oqolarte](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/oqolarte/32/21236_2.png) [@oqolarte](https://discourse.gohugo.io/u/oqolarte)\
**Post date:** [February 5, 2024, 10:51am UTC](https://discourse.gohugo.io/t/mathjax-renders-in-local-server-but-not-when-published/48113/3 "2024-02-05T10:51:21Z")

</div>

Thanks for the input!

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [February 7, 2024, 10:52am UTC](https://discourse.gohugo.io/t/mathjax-renders-in-local-server-but-not-when-published/48113/4 "2024-02-07T10:52:16Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
