Skip to content

Commit 882c27e

Browse files
committed
configure MathJax settings for improved inline and display math rendering
1 parent fb2bdce commit 882c27e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

_layouts/default.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
<title>{{ page.title }}</title>
77
<!-- <link rel="stylesheet" href="/css/style.css"> -->
88
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
9+
<script>
10+
MathJax = {
11+
tex: {
12+
inlineMath: [['$', '$'], ['\\(', '\\)']], // 行内公式定界符
13+
displayMath: [['$$', '$$'], ['\\[', '\\]']], // 独立公式定界符
14+
processEscapes: true, // 允许使用 \ 转义字符
15+
},
16+
options: {
17+
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre'], // 跳过这些标签
18+
}
19+
};
20+
</script>
921
</head>
1022

1123
<body>

0 commit comments

Comments
 (0)