English
日本語
中文
本质的研究 关于
Jekyll MathJax guide
创建: 2018-05-21
修改: 2023-10-23

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.

本质的研究
苏东琪 Su,Dongqi
链接
我的Github主页 该网站的源代码
x20.Site
该网页使用 x20.Site 制作
简介
我的个人研究和随想。不定期地更新『自然语言处理』和『程序内容生成』相关的内容。