• Home
  • About
    • Lihao photo

      Lihao

      这是一个风格简单的博客,主要是写一些学习、工作中的心得或者笔记。希望在叙述的过程中,让自己能理清思绪,有所收获。也可作为一个网络笔记本吧,便于日后查看。

    • Learn More
    • Twitter
    • Facebook
    • Instagram
    • Github
    • Steam
  • Posts
    • All Posts
    • All Tags
  • Projects

MathJax Example

10 Aug 2015

Reading time ~1 minute

MathJax is a simple way of including Tex/LaTex/MathML based mathematics in HTML webpages. To get up and running you need to include the MathJax script in the header of your github pages page, and then write some maths. For LaTex, there are two delimiters you need to know about, one for block or displayed mathematics \[ ... \], and the other for inline mathematics \( ... \).

Usage

To enable MathJax support be sure Kramdown is your Markdown flavor of choice and MathJax is set to true in your _config.yml file.

markdown: kramdown
mathjax: true
Here is an example MathJax inline rendering \\( 1/x^{2} \\), and here is a block rendering: 
\\[ \frac{1}{n^{2}} \\]

Here is an example MathJax inline rendering \( 1/x^{2} \), and here is a block rendering: \[ \frac{1}{n^{2}} \]

The only thing to look out for is the escaping of the backslash when using markdown, so the delimiters become \\[ ... \\] and \\( ... \\) for inline and block maths respectively.



markdownmathjaxexampletestjekyll Share Tweet +1

打赏一个呗

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码支持
扫码打赏,你说多少就多少
支付宝
微信

打开手机扫一扫,即可进行打赏哦