cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <h1>Loading the latest release from cdnjs (and others)</h1>

<p>The MathJax CDN provides a "latest" URL which gets updated with each release. While it's not good practice to do so, many community members have grown accustomed to it.
</p>
<p>CDNJS does not provide such a URL. However, it provides an API to check which is the latest version that's hosted on CDNJS. So you can easily build a script to load the latest version from cdnjs. </p>

<p>Some math:  $$f:X \to Y $$ 
</p>

<p>Similarly, you could combine <code>https://api.github.com/repos/mathjax/mathjax/releases/latest</code> with <a href="https://rawgit.com">cdn.rawgit.com</a> or <code>https://api.jsdelivr.com/v1/jsdelivr/libraries?name=mathjax&lastversion=*</code> with <a href="https://jsdelivr.com">jsdelivr.com</a></p>
            
          
!
            
              // helper: insert MathJax script tage using CDNJS and 
var insertMathJax = function(version) {
  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.async = true;
  script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/' + version + '/MathJax.js?config=TeX-AMS_CHTML-full';
  document.getElementsByTagName('head')[0].appendChild(script);
}

// Look up latest version on CDNJS and insertMathJax
// NOTE you probably want to store the result as a cookie or via localStorage
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
  if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
    insertMathJax(JSON.parse(xmlHttp.responseText).version);
}
xmlHttp.open('GET', 'https://api.cdnjs.com/libraries/mathjax?fields=version', true); 
xmlHttp.send(null);


            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console