Markdown snippet for Hugo post
The solutions are mainly derived from Yihui’s JS library.
Code
By using:
` ` `r
a <- 1 + 1
...
` ` `
produces:
a = 1 + 1
...
MathJax
Solution:
- Add
math-code.js
. tostatic/js/
. - Add the following lines to
layouts/partials/footer_section.html
.
<!-- 加入MathJax, 用于Markdown中输入数学公式 -->
<!-- 如:`$x^2 + y^2 = z^2$` -->
{{ if and (not .Params.disable_mathjax) (or (in (string .Content) "\\") (in (string .Content) "$")) }}
<script async src="//mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
{{ end }}
By using:
`$x^2 + y^2 = z^2$`
produces:
$x^2 + y^2 = z^2$
Footnote
Solution: add fix-footnote.js
. to static/js/
.
By using:
bla ...
^[This is a footnote.]
bla ...
^[This is another footnote.]
produces:
bla … ^[This is a footnote.]
bla … ^[This is another footnote.]