Fork me on GitHub

Installing & Configurating MathJax


Make sure you have both the MathJax configuration and script. Put this in your <head> tag:

<script type="text/x-mathjax-config">
    // <![CDATA[
        TeX: {extensions: ["AMSmath.js", "AMSsymbols.js"]},     
        extensions: ["tex2jax.js"],
        jax: ["input/TeX", "output/HTML-CSS"],
        showProcessingMessages : false,
        messageStyle : "none" ,    
        showMathMenu: false ,
        tex2jax: {
            processEnvironments: true,
            inlineMath: [ ['$','$'], ["\(","\)"] ],
            displayMath: [ ['$$','$$'], ["\[","\]"] ],
            preview : "none",
            processEscapes: true
        "HTML-CSS": { linebreaks: { automatic:true, width: "latex-container"} }
    // ]]>
<script type="text/javascript" src=""></script>

LaTeX2HTML5 Installation

  1. Simply download the JS and CSS files and include them on your MathJax enabled website:
         <link rel="stylesheet" href="latex2html5.min.css"> 
         <script type="text/javascript" src="latex2html5.min.js"></script> 
  2. If you want the same font as the rendered examples:
    <link rel="stylesheet" href="" type="text/css">
  3. You have three options for parsing the $\LaTeX$:
    1. You can put $\LaTeX$ inside of the current page within a script tag with the type set to "tex/latex":
                  <script type="tex/latex">
                      ... LaTeX here ...
                  <script type="text/javascript">
    2. or you can read a .tex file from somewhere else, which is nice for editing .tex files:
                  <latex src="path/to/my/latex.tex">
                  <script type="text/javascript">
    3. or you can write it from scratch!
        MathJax.Hub.Register.StartupHook("End",function () {
            $('[type="tex/latex"]').each(function (i, el) {
                var $el = $(el);
                var TEX = new LaTeX2HTML5.TeX({
                    tagName: 'section',
                    className: 'latex-container',
                    latex: $el.text()

Powered by MathJax

Dan Lynch © LaTeX2HTML5 2014