LaTeX Troubleshooting MathJax.js Load Error on PF Website

  • Thread starter Thread starter KenJackson
  • Start date Start date
  • Tags Tags
    latex mathjax
Click For Summary
SUMMARY

The MathJax.js load error on the PF website was caused by a local configuration issue where the URL cdnjs.cloudflare.com was redirected to 127.0.0.1 in the /etc/hosts file. This redirection prevented the script from loading, resulting in LaTeX not rendering properly. After removing the entry from /etc/hosts, the MathJax script loaded successfully, and LaTeX rendered as expected. Users experiencing similar issues should check their local host configurations for any erroneous entries.

PREREQUISITES
  • Understanding of JavaScript libraries, specifically MathJax 2.7.4
  • Familiarity with web development and script loading
  • Basic knowledge of network troubleshooting using curl
  • Experience with modifying the /etc/hosts file on Unix-based systems
NEXT STEPS
  • Investigate the functionality of MathJax 2.7.4 for rendering LaTeX in web applications
  • Learn how to use curl for network troubleshooting and diagnosing script loading issues
  • Explore best practices for managing local host configurations in Unix-based systems
  • Research common issues with CDN services and how to resolve them
USEFUL FOR

Web developers, system administrators, and anyone troubleshooting JavaScript loading issues or managing local network configurations.

KenJackson
Messages
63
Reaction score
10
The web pages at PF include this script, which won't load, so latex is not rendered:
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js

When I try to fetch it with curl, I get an error:
"Failed to connect to cdnjs.cloudfare.com port 443: Connection refused"

Am I the only one? Is latex being rendered for anyone right now? If it is, why can you access the script, but I can't?
 
Physics news on Phys.org
The .js is loading fine for me, and Latex is rendering properly.
 
Works perfectly here.
 
Solved the problem. It was only on my PCs.

Over the years, I've been annoyed by various online ads, some that even seem to get through adblock plus. So I find the offending URL and define it to 127.0.0.1 in /etc/hosts. As it turned out, cdnjs.cloudflare.com must have hosted an annoying ad at some point because I had it in /etc/hosts.

I removed it and now everything is fine.
 
  • Like
Likes Greg Bernhardt and Tom.G

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 17 ·
Replies
17
Views
5K
Replies
2
Views
2K