English
中文
日本語
本质的研究
Jekyll MathJax guide

Highlight code snippets

An example of code snippets in Jekyll:

def print_hello_world():
    # print "hello world!" in terminal
    print('hello world!')

Display math equations using MathJax

An example of math equations in Jekyll (MathJax):

$$ y(x_i) = f(x_i) + \epsilon(x_i) \tag{definition} $$

MathJax can be imported externally inside the header of /_layouts/x.html to allow posts that use x.html as layout template to display math equations as follow:

<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        jax: ["input/TeX","output/HTML-CSS"],
        displayAlign: "left",
        displayIndent: "5em"
    });
</script>
<script 
    src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" 
    type="text/javascript">
</script>

If you use the default Jekyll theme minima, you can also download the default post.html from minima and add MathJax to it. This blog's repo provides a working example of Jekyll default theme (Minima) with MathJax installed.

本质的研究
Dongqi Su, 苏东琪
链接
Github Linkedin
该网站
使用 sudoki.SiteMaker 制作