Skip to content

Commit e3fe434

Browse files
committed
add Katex dependency, also a new article
1 parent 5223fd1 commit e3fe434

File tree

11 files changed

+541
-3
lines changed

11 files changed

+541
-3
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,7 @@ next-env.d.ts
5151
Agents.md
5252

5353
# Environment variables
54-
.env
54+
.env
55+
56+
# VS code
57+
.vscode
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: 常用Markdown语法
3+
date: 2025-09-20 14:25:39
4+
---
5+
6+
## 基础标题+字体样式
7+
8+
`# 一级标题`
9+
10+
`## 二级标题`
11+
12+
以此类推
13+
14+
**加粗字体** `**加粗字体**`
15+
16+
_斜体字体_ `*斜体字体*`
17+
18+
**_斜体加粗_** `***斜体加粗***`
19+
20+
~~删除线~~ `~~删除线~~`
21+
22+
<mark>荧光笔</mark> `<mark>荧光笔</mark>`
23+
24+
&ensp;&ensp;&ensp;
25+
26+
`半&ensp;角&ensp;空&ensp;格`
27+
28+
&emsp;&emsp;&emsp;
29+
30+
`全&emsp;角&emsp;空&emsp;格`
31+
32+
## 无序、有序列表
33+
34+
- 无序列表1&emsp;`* 无序列表1`
35+
- 无序列表2&emsp;`* 无序列表2`
36+
- 无序列表3&emsp;`* 无序列表3`
37+
- 无序列表4&emsp;`* 无序列表4`
38+
39+
1. 有序列表1&emsp;`1. 有序列表1`
40+
2. 有序列表2&emsp;`2. 有序列表2`
41+
3. 有序列表3&emsp;`3. 有序列表3`
42+
4. 有序列表4&emsp;`4. 有序列表4`
43+
44+
## 建表
45+
46+
| 表头 | 左对齐 | 居中 | 右对齐 |
47+
| ------ | :----- | :----: | -----: |
48+
| 单元格 | 单元格 | 单元格 | 单元格 |
49+
| 单元格 | 单元格 | 单元格 | 单元格 |
50+
51+
```
52+
| 表头 | 左对齐 | 居中 | 右对齐 |
53+
| - | :- | :-: | -: |
54+
| 单元格 | 单元格 | 单元格 | 单元格 |
55+
| 单元格 | 单元格 | 单元格 | 单元格 |
56+
```
57+
58+
## 超链接
59+
60+
`[想要显示的链接名](目标网址)`
61+
62+
**示例**
63+
64+
[点这里下载Anaconda](https://www.anaconda.com/download)
65+
66+
`[点这里下载Anaconda](https://www.anaconda.com/download)`
67+
68+
## 图片
69+
70+
`![测试图片](./你的图片.jpg "自定义鼠标悬停显示名")`
71+
72+
**示例**
73+
74+
![测试图片](/CommonUsedMarkdown.assets/testpic1.jpg "autumn")
75+
76+
`![测试图片](./CommonUsedMarkdown.assets/testpic1.jpg "autumn")`
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: 个人常用字符
3+
date: 2025-09-20 14:25:39
4+
---
5+
6+
## 希腊字母
7+
8+
| 效果 | 指令 | 效果 | 指令 |
9+
| :--------: | :--------: | :-------: | :-------: |
10+
| $\alpha$ | `\alpha` | $\sigma$ | `\sigma` |
11+
| $\beta$ | `\beta` | $\tau$ | `\tau` |
12+
| $\gamma$ | `\gamma` | $\Gamma$ | `\Gamma` |
13+
| $\delta$ | `\delta` | $\Delta$ | `\Delta` |
14+
| $\epsilon$ | `\epsilon` | $\psi$ | `\psi` |
15+
| $\zeta$ | `\zeta` | $\omega$ | `\omega` |
16+
| $\eta$ | `\eta` | $\Omega$ | `\Omega` |
17+
| $\theta$ | `\theta` | $\Theta$ | `\Theta` |
18+
| $\lambda$ | `\lambda` | $\phi$ | `\phi` |
19+
| $\mu$ | `\mu` | $\varphi$ | `\varphi` |
20+
| $\pi$ | `\pi` | $\xi$ | `\xi` |
21+
| $\rho$ | `\rho` | | |
22+
23+
## 箭头
24+
25+
| 样例 | 指令 | 样例 | 指令 |
26+
| :---------------: | :---------------: | :------------------: | :------------------: |
27+
| $\leftarrow$ | `\leftarrow` | $\Leftarrow$ | `\Leftarrow` |
28+
| $\rightarrow$ | `\rightarrow` | $\Rightarrow$ | `\Rightarrow` |
29+
| $\leftrightarrow$ | `\leftrightarrow` | $\Leftrightarrow$ | `\Leftrightarrow` |
30+
| $\uparrow$ | `\uparrow` | $\mapsto$ | `\mapsto` |
31+
| $\downarrow$ | `\downarrow` | $\rightleftharpoons$ | `\rightleftharpoons` |
32+
33+
## 运算符
34+
35+
| 样例 | 指令 | 样例 | 指令 |
36+
| :------: | :------: | :-------: | :-------: |
37+
| $\times$ | `\times` | $\wedge$ | `\wedge` |
38+
| $\div$ | `\div` | $\vee$ | `\vee` |
39+
| $\cap$ | `\cap` | $\oplus$ | `\oplus` |
40+
| $\cup$ | `\cup` | $\otimes$ | `\otimes` |
41+
| $\cdot$ | `\cdot` | $\cdots$ | `\cdots` |
42+
43+
## 关系符
44+
45+
| 样例 | 指令 | 样例 | 指令 |
46+
| :-----: | :-----: | :---------: | :---------: |
47+
| $\neq$ | `\neq` | $\subset$ | `\subset` |
48+
| $\leq$ | `\leq` | $\subseteq$ | `\subseteq` |
49+
| $\geq$ | `\geq` | $\approx$ | `\approx` |
50+
| $\ll$ | `\ll` | $\equiv$ | `\equiv` |
51+
| $\gg$ | `\gg` | $\cong$ | `\cong` |
52+
| $\prec$ | `\prec` | $\parallel$ | `\parallel` |
53+
| $\succ$ | `\succ` | $\perp$ | `\perp` |
54+
| $\in$ | `\in` | $\notin$ | `\notin` |
55+
56+
## 无穷、偏分、证明
57+
58+
| 样例 | 指令 | 样例 | 指令 |
59+
| :-----------: | :-----------: | :----------: | :--------: |
60+
| $\infty$ | `\infty` | $\exists$ | `\exists` |
61+
| $\partial$ | `\partial` | $\neg$ | `\neg` |
62+
| $\varnothing$ | `\varnothing` | $\because$ | `\because` |
63+
| | $\therefore$ | `\therefore` |
64+
65+
## 上标、下标
66+
67+
| 样例 | 指令 | 样例 | 指令 |
68+
| :-----------------------: | :-----------------------: | :------------------------: | :------------------------: |
69+
| $\bar{a}$ | `\bar{a}` | | |
70+
| $\hat{a}$ | `\hat{a}` | | |
71+
| $\widehat{abc}$ | `\widehat{abc}` | | |
72+
| $\tilde{a}$ | `\tilde{a}` | $\utilde{a}$ | `\utilde{a}` |
73+
| $\widetilde{abc}$ | `\widetilde{abc}` | | |
74+
| $\vec{A}$ | `\vec{A}` | | |
75+
| $\overline{AB}$ | `\overline{AB}` | $\underline{AB}$ | `\underline{AB}` |
76+
| $\overleftarrow{AB}$ | `\overleftarrow{AB}` | $\underleftarrow{AB}$ | `\underleftarrow{AB}` |
77+
| $\overleftrightarrow{AB}$ | `\overleftrightarrow{AB}` | $\underleftrightarrow{AB}$ | `\underleftrightarrow{AB}` |
78+
| $\overleftharpoon{AB}$ | `\overleftharpoon{AB}` | | |
79+
| $\overgroup{AB}$ | `\overgroup{AB}` | $\undergroup{AB}$ | `\undergroup{AB}` |
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: 数学公式语法
3+
date: 2025-09-20 14:25:39
4+
---
5+
6+
## 矩阵、行列式
7+
8+
$$
9+
\left(\begin{matrix}
10+
a & b \\
11+
c & d
12+
\end{matrix}\right)
13+
$$
14+
15+
```latex
16+
$$
17+
\left(\begin{matrix}
18+
a & b \\
19+
c & d
20+
\end{matrix}\right)
21+
$$
22+
```
23+
24+
$$
25+
\left|\begin{matrix}
26+
a & b \\
27+
c & d
28+
\end{matrix}\right|
29+
$$
30+
31+
```latex
32+
$$
33+
\left|\begin{matrix}
34+
a & b \\
35+
c & d
36+
\end{matrix}\right|
37+
$$
38+
```
39+
40+
$$
41+
\left(\begin{matrix}
42+
1 & 2 & \cdots & n \\
43+
2 & 3 & \cdots & n+1 \\
44+
\vdots & \vdots & \ddots & n^2 - 1\\
45+
n & n+1 & \cdots & n^2
46+
\end{matrix}\right)
47+
$$
48+
49+
```latex
50+
$$
51+
\left(\begin{matrix}
52+
1 & 2 & \cdots & n \\
53+
2 & 3 & \cdots & n+1 \\
54+
\vdots & \vdots & \ddots & n^2 - 1\\
55+
n & n+1 & \cdots & n^2
56+
\end{matrix}\right)
57+
$$
58+
```
59+
60+
## 维持等号缩进
61+
62+
$$
63+
\begin{aligned}
64+
f(X|\theta) &= f(x_1,x_2,\cdots,x_n|\theta)\\
65+
&= f(x_1|\theta) \cdot f(x_2|\theta) \cdots f(x_n|\theta)\\
66+
&= \prod_{i=1}^n \frac{1}{x_i !} e^{-\theta}\theta^{x_i}\\
67+
&= \left(\prod_{i=1}^n \frac{1}{x_i !}\right) e^{-n \theta}\theta^{\sum_{i=1}^n x_i}
68+
\end{aligned}
69+
$$
70+
71+
```latex
72+
$$
73+
\begin{aligned}
74+
f(X|\theta) &= f(x_1,x_2,\cdots,x_n|\theta)\\
75+
&= f(x_1|\theta) \cdot f(x_2|\theta) \cdots f(x_n|\theta)\\
76+
&= \prod_{i=1}^n \frac{1}{x_i !} e^{-\theta}\theta^{x_i}\\
77+
&= \left(\prod_{i=1}^n \frac{1}{x_i !}\right) e^{-n \theta}\theta^{\sum_{i=1}^n x_i}
78+
\end{aligned}
79+
$$
80+
```
81+
82+
## 分段函数的表示(与Latex有差异)
83+
84+
因为不能用`\equation`和各种`\cases`,所以需要变通一下
85+
86+
$$
87+
f(x,\theta) = \left\{ \begin{array}{ll}
88+
\dfrac{1}{x\sqrt{2\pi \theta}} e^{-\frac{1}{2\theta} [\log(x)]^2} &,\text{ $x>0$} \\
89+
0 &,\text{ otherwise}
90+
\end{array} \right.
91+
$$
92+
93+
```latex
94+
$$
95+
f(x,\theta) = \left\{ \begin{array}{ll}
96+
\dfrac{1}{x\sqrt{2\pi \theta}} e^{-\frac{1}{2\theta} [\log(x)]^2} &,\text{ $x>0$} \\
97+
0 &,\text{ otherwise}
98+
\end{array} \right.
99+
$$
100+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: 常用Katex语法
3+
date: 2025-09-20 14:25:39
4+
---
5+
6+
Katex 与 Latex 有些许的不同,稍作整理以便自己查阅
7+
8+
在2个`$`之间增加指令,就可以实现行间数学模式,与正文不冲突
9+
10+
在2个`$$`之间增加指令,将公式居中显示的单独模块

app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import localFont from "next/font/local";
33
import { RootProvider } from "fumadocs-ui/provider";
44
import Script from "next/script";
55
import "./globals.css";
6+
import "katex/dist/katex.min.css";
67
import { ThemeProvider } from "@/app/components/ThemeProvider";
78
import { SpeedInsights } from "@vercel/speed-insights/next";
89

next.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
import { createMDX } from "fumadocs-mdx/next";
33
import createNextIntlPlugin from "next-intl/plugin";
44

5-
const withMDX = createMDX();
5+
const withMDX = createMDX({
6+
configPath: "source.config.ts",
7+
});
8+
69
const withNextIntl = createNextIntlPlugin("./i18n.ts");
710

811
/** @type {import('next').NextConfig} */

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@
6161
"eslint": "^9.35.0",
6262
"eslint-config-next": "^15.5.3",
6363
"husky": "^9.1.7",
64+
"katex": "^0.16.22",
6465
"lint-staged": "^16.1.6",
6566
"postcss": "^8.5.6",
6667
"prettier": "3.6.2",
68+
"rehype-katex": "^7.0.1",
69+
"remark-math": "^6.0.0",
6770
"tailwindcss": "^4.1.13",
6871
"tw-animate-css": "^1.3.8",
6972
"typescript": "^5.6.3"

0 commit comments

Comments
 (0)