Skip to content

Commit

Permalink
Fix math formula display
Browse files Browse the repository at this point in the history
  • Loading branch information
StandardL committed Mar 21, 2024
1 parent b25694d commit 7d29689
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pwa:
paginate: 10

# ------------ The following options are not recommended to be modified ------------------

markdown: kramdown
kramdown:
syntax_highlighter: rouge
syntax_highlighter_opts: # Rouge Options › https://github.com/jneen/rouge#full-options
Expand Down
30 changes: 30 additions & 0 deletions _includes/mathjax_support.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
equationNumbers: {
autoNumber: "AMS"
}
},
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true,
"HTML-CSS": { fonts: ["TeX"] }
}
});
MathJax.Hub.Register.MessageHook("Math Processing Error",function (message) {
alert("Math Processing Error: "+message[1]);
});
MathJax.Hub.Register.MessageHook("TeX Jax - parse error",function (message) {
alert("Math Processing Error: "+message[1]);
});
</script>
<!-- <script type="text/javascript" src="path-to-MathJax/MathJax.js?config=TeX-AMS_HTML">
</script> -->
<script
type="text/javascript"
async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"
></script>
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<html lang="{{ site.alt_lang | default: site.lang }}"{{ prefer_mode }}>

{% include head.html %}
{% include mathjax_support.html %}

<body data-spy="scroll" data-target="#toc" data-topbar-visible="true">

Expand Down

0 comments on commit 7d29689

Please sign in to comment.