Skip to content

Commit

Permalink
mathjax support
Browse files Browse the repository at this point in the history
  • Loading branch information
AstatineAi committed Mar 6, 2024
1 parent d44a725 commit 1350d09
Showing 3 changed files with 27 additions and 3 deletions.
19 changes: 19 additions & 0 deletions lecture_note/docs/javascripts/mathjax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};

document$.subscribe(() => {
MathJax.startup.output.clearCache()
MathJax.typesetClear()
MathJax.texReset()
MathJax.typesetPromise()
})
6 changes: 3 additions & 3 deletions lecture_note/docs/pintos/proj1.md
Original file line number Diff line number Diff line change
@@ -285,23 +285,23 @@ nice 只来自外界传入 / 从 parent thread 继承, 修改后更新优先级
### 计算 priority
$$
priority = PRI_MAX - \dfrac{1}{4} recent_cpu - 2 \cdot nice
priority = PRI\_MAX - \dfrac{1}{4} recent\_cpu - 2 \cdot nice
$$
需要控制范围不超过 `PRI_MIN` 到 `PRI_MAX`.
### 计算 recent_cpu
$$
recent_cpu = \dfrac{2 \cdot load_avg}{2 \cdot load_avg + 1} \cdor recent_cpu + nice
recent\_cpu = \dfrac{2 \cdot load\_avg}{2 \cdot load\_avg + 1} \cdot recent\_cpu + nice
$$
### 计算 load_avg
`load_avg` 是全局的, 不是某个线程的属性.
$$
load_avg = \dfrac{59}{60} load_avg + \dfrac{1}{60} ready_thread
load\_avg = \dfrac{59}{60} load\_avg + \dfrac{1}{60} ready\_thread
$$
$ready_thread$ 代表正在运行/就绪的线程数量.
5 changes: 5 additions & 0 deletions lecture_note/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -43,6 +43,11 @@ markdown_extensions:
- pymdownx.arithmatex:
generic: true

extra_javascript:
- javascripts/mathjax.js
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

nav:
- 首页: 'index.md'
- 课程笔记:

0 comments on commit 1350d09

Please sign in to comment.