Skip to content

Commit bc1f8bd

Browse files
committed
feat: add mathematical formulas example article and update categories for existing blog posts
1 parent b5fa9a1 commit bc1f8bd

File tree

10 files changed

+124
-36
lines changed

10 files changed

+124
-36
lines changed

docs/CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,4 +905,14 @@
905905
### Fix
906906

907907
- 修复了分类页面中展开动画的样式
908-
- 修复了分类页面中 `post` 缺失的过渡效果
908+
- 修复了分类页面中 `post` 缺失的过渡效果
909+
910+
## [3.1.4] - 2025-5-31
911+
912+
### Chore
913+
914+
- 新增一篇数学公式示例文章
915+
916+
### Fix
917+
918+
- 修复了数学公式的渲染问题(先前缺少了必要的 CSS 文件)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"dayjs": "^1.11.13",
2929
"dotenv": "^16.5.0",
3030
"js-yaml": "^4.1.0",
31+
"katex": "^0.16.22",
3132
"marked": "^14.1.4",
3233
"mdast": "^3.0.0",
3334
"mdast-util-to-string": "^4.0.0",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Header.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import "../styles/global.scss";
3+
import "/node_modules/katex/dist/katex.min.css";
34
import type { HeaderProps } from "@interfaces/data";
45
56
const canonicalURL = new URL(Astro.url.pathname, Astro.site);

src/content/blog/adding-comment-systems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: A comprehensive guide on how to integrate the Waline comment system
44
pubDate: 04 15 2025
55
image: /image/image4.jpg
66
categories:
7-
- tech
7+
- Documentation
88
tags:
99
- Frosti
1010
- Comments

src/content/blog/frosti-mdx.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ description: Using MDX in Frosti to enrich article content with more components
44
pubDate: 07 12 2024
55
image: /image/image2.jpg
66
categories:
7-
- tech
7+
- Documentation
8+
- Examples
89
tags:
910
- Frosti
1011
- Blog

src/content/blog/markdown-style-guide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ description: "Here is a sample of some basic Markdown syntax that can be used wh
44
pubDate: "Jul 01 2024"
55
image: /image/image3.png
66
categories:
7-
- tech
7+
- Documentation
8+
- Examples
89
tags:
910
- Makrdown
1011
badge: Pin
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Testing Mathematical Formulas in Markdown
3+
description: A demonstration of various mathematical formulas rendered using LaTeX within Markdown.
4+
pubDate: May 31 2025
5+
categories:
6+
- Documentation
7+
- Examples
8+
tags:
9+
- Markdown
10+
- LaTeX
11+
- Mathematics
12+
badge: LaTeX
13+
---
14+
15+
This document serves as a test for rendering mathematical formulas in Markdown using `$$` delimiters.
16+
17+
## Basic Algebra
18+
19+
Let's start with some fundamental algebraic expressions.
20+
21+
The quadratic formula is given by:
22+
$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$$
23+
24+
A simple linear equation:
25+
$$y = mx + c$$
26+
27+
Expansion of a binomial square:
28+
$$(a+b)^2 = a^2 + 2ab + b^2$$
29+
30+
---
31+
32+
## Calculus
33+
34+
Here are some common expressions from calculus.
35+
36+
The limit definition of a derivative:
37+
$$f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}$$
38+
39+
A definite integral:
40+
$$\int_{a}^{b} f(x) dx$$
41+
42+
The Taylor series expansion of $e^x$ around $x=0$:
43+
$$e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots$$
44+
45+
---
46+
47+
## Trigonometry
48+
49+
Some basic trigonometric identities.
50+
51+
Pythagorean identity:
52+
$$\sin^2\theta + \cos^2\theta = 1$$
53+
54+
Angle addition formula for sine:
55+
$$\sin(\alpha + \beta) = \sin\alpha\cos\beta + \cos\alpha\sin\beta$$
56+
57+
Euler's formula:
58+
$$e^{i\theta} = \cos\theta + i\sin\theta$$
59+
60+
---
61+
62+
## Statistics and Probability
63+
64+
Formulas commonly used in statistics and probability.
65+
66+
The formula for the mean ($\mu$) of a set of $n$ numbers $x_1, x_2, \ldots, x_n$:
67+
$$\mu = \frac{1}{n} \sum_{i=1}^{n} x_i$$
68+
69+
The probability density function of a normal distribution:
70+
$$f(x | \mu, \sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}$$
71+
72+
Bayes' theorem:
73+
$$P(A|B) = \frac{P(B|A)P(A)}{P(B)}$$
74+
75+
---
76+
77+
## Linear Algebra
78+
79+
Examples from linear algebra.
80+
81+
A 2x2 matrix:
82+
$$A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$$
83+
84+
The determinant of a 2x2 matrix:
85+
$$\det(A) = ad - bc$$
86+
87+
Matrix multiplication of two matrices A and B:
88+
$$C = AB$$
89+
90+
---
91+
92+
## Physics
93+
94+
A couple of well-known physics equations.
95+
96+
Einstein's mass-energy equivalence:
97+
$$E = mc^2$$
98+
99+
Newton's second law of motion:
100+
$$F = ma$$
101+
102+
This should provide a good test of how various mathematical formulas are rendered.

src/content/blog/under-the-sacred-hall.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/content/blog/using-mdx.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Lorem ipsum dolor sit amet"
44
pubDate: "Jul 02 2022"
55
image: /image/image1.jpg
66
categories:
7-
- tech
7+
- Documentation
88
badge: Pin
99
---
1010

0 commit comments

Comments
 (0)