Skip to content
Permalink
Browse files

add mathjax

  • Loading branch information
Peng Zhao
Peng Zhao committed Mar 5, 2019
1 parent cbb4865 commit a12898e8a6cbdab31234ee9d128f57239008c7a6
@@ -287,3 +287,6 @@ ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]
enable = true
title = "最新博客"
subtitle = "新闻,动向,教程。更多博客请点击右上角的“博客”。"

[blackfriday]
smartypants = false
@@ -64,4 +64,6 @@
<meta property="og:url" content="{{ .URL }}/" />
<meta property="og:image" content="{{ .Site.Params.logo }}" />

{{ partial "mathjax.html" . }}

</head>
@@ -0,0 +1,35 @@
<script type="text/javascript"
async
src="https://cdn.bootcss.com/mathjax/2.7.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
displayMath: [['$$','$$'], ['\[\[','\]\]']],
processEscapes: true,
processEnvironments: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
TeX: { equationNumbers: { autoNumber: "AMS" },
extensions: ["AMSmath.js", "AMSsymbols.js"] }
}
});

MathJax.Hub.Queue(function() {
// Fix <code> tags after MathJax finishes running. This is a
// hack to overcome a shortcoming of Markdown. Discussion at
// https://github.com/mojombo/jekyll/issues/199
var all = MathJax.Hub.getAllJax(), i;
for(i = 0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
</script>

<style>
code.has-jax {
font: inherit;
font-size: 100%;
background: inherit;
border: inherit;
color: #515151;
}
</style>

0 comments on commit a12898e

Please sign in to comment.
You can’t perform that action at this time.