Fix the auto rendering issue of Mathjax with LaTex
Recently, I build my own About website with blog posts based on al-folio. However, I
find the Kramdown cannot render the conventional LaTex math code, like
inline math $ $
or \( \)
and display math
$$ $$
and \[ \]
.
The default setting of the kramdown renders the inline and display
math with $$ $$
, which is different with LaTex and
markdown. Mathjax
Docs gives the solution to add the single dollar configuration. You
only need to add below codes to _includes/mathjax.html
:
1 |
|
Then you can use the inline math $ $
and display math
$$ $$
in your posts.
Then you can use LaTex code to render your post.
Here is an example: 1
$$R_{i t}=\beta_{i}^{\prime} \lambda_{t}+\alpha_{i t}, \quad i=1,2, \cdots, N$$
\[ R_{i t}=\beta_{i}^{\prime} \lambda_{t}+\alpha_{i t}, \quad i=1,2, \cdots, N \]
Here is another example of inline math
$R_{i t}=\beta_{i}^{\prime} \lambda_{t}+\alpha_{i t}, \quad i=1,2, \cdots, N$.
It will be rendered as \(R_{i t}=\beta_{i}^{\prime} \lambda_{t}+\alpha_{i t}, \quad i=1,2, \cdots, N\).