Skip to main content Link Menu Expand (external link) Document Search Copy Copied

MathJax Configuration

  1. Create or extend _includes/head_custom.html with:

    {% assign math = page.math | default: layout.math | default: site.math %}
    
    {% case math %}
      {% when "mathjax" %}
        {% include mathjax.html %}
    {% endcase %}
    
  2. Copy the following files to your website source repo:

For the source file _includes/mathjax.html from just-the-docs, we have updated the incorrectly set path from src="/just-the-docs/assets/js/mathjax-script-type.js" to the repositry root src="/assets/js/mathjax-script-type.js".

  1. To make MathJax available on all your web pages, add to _config.yml:

    math: mathjax
    

    To restrict MathJax to pages that use it, add to the front matter either:

    math: mathjax
    

    or:

    layout: mathjax
    

    You can add a preamble of MathJax definitions of new commands and environments in _layouts/mathjax.html. It extends the default layout.

MathJax options

You can customise MathJax by adding further options in _includes/mathjax.html.

You can customise Just the Docs sites to support MathJax, as explained in the configuration suggestions. Pages then render LATEX code in kramdown math blocks using MathJax.

For example:

ϕ(x,y)=ϕ(i=1nxiei,j=1nyjej)=i=1nj=1nxiyjϕ(ei,ej)=(x1,,xn)(ϕ(e1,e1)ϕ(e1,en)ϕ(en,e1)ϕ(en,en))(y1yn)

To see the LATEX source of the formula, right-click anywhere on it.