22

22Equations and MathJax

22.1

Loading MathJax

MathJax is very easy to load and is surprisingly easy to use — it surprised me anyway.

MathJax is loaded from a CDN link in a <scrip> element in the <head>, just like jQuery.

Loading MathJax html
<html lang="en">                              <!-- Declare language -->
    <head>                                    <!-- Start of head section -->
        <meta charset="utf-8">                <!-- Use unicode char set-->

<!-- **************************************************************************
     HEAD SCRIPT AREA
     ***********************************************************************-->
       <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
       <script src="21-global/05-js/jquery.waypoints.min.js"></script>
       <script src="21-global/05-js/hyphenator.js"></script>
       <script src="21-global/05-js/lightbox.js"></script>
       <script src="21-global/05-js/run_prettify.js?autoload=true&lang=css"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML"async></script>
       <script src="11-resources/05-js/script.js"></script>
       <script src="01-pages/99-00-typicals/05-local-js/99-00-scroll.js"></script>

<!-- **************************************************************************
     HEAD CSS LOAD
     ***********************************************************************-->
       <link rel="stylesheet" type="text/css" href="21-global/03-fonts/ps-fonts.css">
       <link rel="stylesheet" type="text/css" href="21-global/01-css/normalise.css">
       <link rel="stylesheet" type="text/css" href="21-global/01-css/lightbox.css">
       <link rel="stylesheet" type="text/css" href="11-resources/01-css/grid.css">
       <link rel="stylesheet" type="text/css" href="11-resources/01-css/style.css">
<!-- **************************************************************************
     TITLE
     ***********************************************************************-->
        <title>Website template typicals | PracticalSeries: Web Development</title>
    </head>
Code 22.1   Loading MathJax

The async attribute just means the code executes as soon as it is available, I’ve included this because that is what MathJax wants me to do, see here.



End flourish image