Add Tsu theme
This commit is contained in:
36
themes/hexo-theme-Tsu/layout/_partials/mathjax.ejs
Normal file
36
themes/hexo-theme-Tsu/layout/_partials/mathjax.ejs
Normal file
@@ -0,0 +1,36 @@
|
||||
<!-- MathJax配置,可通过单美元符号书写行内公式等 -->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
"HTML-CSS": {
|
||||
preferredFont: "TeX",
|
||||
availableFonts: ["STIX","TeX"],
|
||||
linebreaks: { automatic:true },
|
||||
EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)
|
||||
},
|
||||
tex2jax: {
|
||||
inlineMath: [ ["$", "$"], ["\\(","\\)"] ],
|
||||
processEscapes: true,
|
||||
ignoreClass: "tex2jax_ignore|dno",
|
||||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
|
||||
},
|
||||
TeX: {
|
||||
equationNumbers: { autoNumber: "AMS" },
|
||||
noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } },
|
||||
Macros: { href: "{}" }
|
||||
},
|
||||
messageStyle: "none"
|
||||
});
|
||||
</script>
|
||||
<!-- 给MathJax元素添加has-jax class -->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Queue(function() {
|
||||
var all = MathJax.Hub.getAllJax(), i;
|
||||
for(i=0; i < all.length; i += 1) {
|
||||
all[i].SourceElement().parentNode.className += ' has-jax';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<!-- 通过连接CDN加载MathJax的js代码 -->
|
||||
<script type="text/javascript" async
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
|
||||
</script>
|
Reference in New Issue
Block a user