有时本地jekyll渲染的结果与github page的显示结果不同,可能是markdown解析器有些差别(有时间再去确定)

latex公式显示

Kramdown默认使用Mathjax渲染latex公式,其实只是将latex公式解析为html语句,例如:

Equation Latex html
$$\begin{equation} \begin{aligned} y=\frac{\sin(x)}{x} \end{aligned} \end{equation}$$
 
  $$\begin{equation}
\begin{aligned}
y=\frac{\sin(x)}{x}
\end{aligned}
\end{equation}$$

  <script type="math/tex; mode=display" id="MathJax-Element-1"\>
\begin{equation}
\begin{aligned}
y=\frac{\sin(x)}{x}
\end{aligned}
\end{equation}</script>

只是这样,并不能显示公式,还需要在待显示latex公式之前加入

  <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
  <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

也可以加入到default.html中,对全部文件都有效

源码显示

  <pre><code>
  source code to be shown
  </code></pre>