Skip to content

Commit d5b1432

Browse files
committed
feat: use mathjax
1 parent 666c00e commit d5b1432

File tree

3 files changed

+37
-4
lines changed

3 files changed

+37
-4
lines changed

docs/javascripts/mathjax.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
window.MathJax = {
2+
tex: {
3+
inlineMath: [["\\(", "\\)"], ["$", "$"]],
4+
displayMath: [["\\[", "\\]"], ["$$", "$$"]],
5+
processEscapes: true,
6+
processEnvironments: true
7+
},
8+
options: {
9+
ignoreHtmlClass: ".*|",
10+
processHtmlClass: "arithmatex"
11+
}
12+
};
13+
14+
document$.subscribe(() => {
15+
MathJax.startup.output.clearCache()
16+
MathJax.typesetClear()
17+
MathJax.texReset()
18+
MathJax.typesetPromise()
19+
})

docs/lc/1.md

+14
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ source: 第 1 场周赛 Q1
7070

7171
时间复杂度 $O(n)$,空间复杂度 $O(n)$。其中 $n$ 是数组 `nums` 的长度。
7272

73+
$$
74+
f[i] = \max\{f[i], f[j - 1] + mx \times (i - j + 1)\}
75+
$$
76+
77+
$$
78+
f[i][j] =
79+
\begin{cases}
80+
0 & i = 0 \textit{ or } j = 0 \\
81+
f[i - 1][j - 1] + 1 & str1[i - 1] = str2[j - 1] \\
82+
\max(f[i - 1][j], f[i][j - 1]) & str1[i - 1] \neq str2[j - 1]
83+
\end{cases}
84+
$$
85+
86+
7387
=== "Python3"
7488

7589
```python

mkdocs.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ markdown_extensions:
9595
- pymdownx.superfences
9696
- pymdownx.tabbed:
9797
alternate_style: true
98+
- pymdownx.arithmatex:
99+
generic: true
98100
- pymdownx.critic
99101
- pymdownx.caret
100102
- pymdownx.keys
@@ -108,13 +110,11 @@ markdown_extensions:
108110

109111

110112
extra_javascript:
111-
- javascripts/katex.js
112-
- https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.js
113-
- https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/contrib/auto-render.min.js
113+
- javascripts/mathjax.js
114+
- https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/npm/mathjax@3/es5/tex-mml-chtml.js
114115

115116
extra_css:
116117
- stylesheets/extra.css
117-
- https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.css
118118

119119
extra:
120120
generator: false

0 commit comments

Comments
 (0)