main
HuangHai 4 weeks ago
parent 912ae64b1b
commit 9d3f19a30a

@ -3,22 +3,11 @@
<head>
<meta charset="UTF-8">
<title>LaTeX公式渲染示例</title>
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
displayMath: [['$$', '$$'], ['\\[', '\\]']],
processEscapes: true
},
svg: {
fontCache: 'global'
}
};
</script>
<script src="./js/tex-mml-chtml.js" id="MathJax-script"></script>
<!-- 使用BootCDN提供的MathJax -->
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<style>
body {
font-family: Arial, sans-serif;
font-family: "Microsoft YaHei", sans-serif;
line-height: 1.6;
margin: 20px;
}
@ -29,12 +18,17 @@
margin: 10px 0;
border: 1px dashed #ccc;
}
</style>
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
processEscapes: true
},
svg: {
fontCache: 'global',
font: 'STIX-Web'
}
};
</script>

@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MathJax Examples</title>
<script src="https://cdn.bootcdn.net/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js"></script>
<style>
body {
font-family: mathjax-tex, sans-serif;
line-height: 1.6;
margin: 20px;
}
h1 {
text-align: center;
margin-bottom: 30px;
}
.formula {
margin: 20px 0;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
background: #f9f9f9;
}
</style>
</head>
<body>
<h1>MathJax Examples</h1>
<div class="formula">
<h2>1. 行内公式</h2>
<p>这个是行内公式的例子:\( a^2 + b^2 = c^2 \)。</p>
</div>
<div class="formula">
<h2>2. 块级公式</h2>
<p>这是一个块级公式的例子:</p>
$$ E = mc^2 $$
</div>
<div class="formula">
<h2>3. 分数和根号</h2>
<p>分数公式:\( \frac{a}{b} \)。</p>
<p>根号公式:\( \sqrt{a^2 + b^2} \)。</p>
<p>复合公式:块级形式:</p>
$$
\frac{\sqrt{x^2 + y^2}}{a + b}
$$
</div>
<div class="formula">
<h2>4. 矩阵</h2>
<p>这是一个矩阵的例子:</p>
$$
\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{bmatrix}
$$
</div>
<div class="formula">
<h2>5. 积分和求和</h2>
<p>积分公式:</p>
$$
\int_{a}^{b} x^2 \, dx
$$
<p>求和公式:</p>
$$
\sum_{n=1}^{\infty} \frac{1}{n^2}
$$
</div>
<div class="formula">
<h2>6. 上下标</h2>
<p>这是一个上下标的例子:</p>
$$
E = mc^2 \quad \text{和} \quad x_i^2 + y_j^2
$$
</div>
<div class="formula">
<h2>7. 对齐公式</h2>
<p>这是一个对齐公式的例子:</p>
$$
\begin{align}
a^2 + b^2 &= c^2 \\
x^2 + y^2 &= z^2
\end{align}
$$
</div>
<div class="formula">
<h2>8. 极限</h2>
<p>极限公式:</p>
$$
\lim_{x \to \infty} \frac{1}{x} = 0
$$
</div>
<div class="formula">
<h2>9. 多行公式</h2>
<p>这是一个多行公式的例子:</p>
$$
\begin{aligned}
f(x) &= x^2 + 2x + 1 \\
&= (x + 1)^2
\end{aligned}
$$
</div>
<div class="formula">
<h2>10. 几何符号</h2>
<p>这是一个几何符号的例子:</p>
$$
\angle ABC \quad \triangle ABC \quad \overrightarrow{AB} \quad \overline{AB}
$$
</div>
<div class="formula">
<h2>11. 逻辑符号</h2>
<p>这是一些逻辑符号的例子:</p>
$$
\forall x \in \mathbb{R}, \; \exists y \; \text{使得} \; x + y = 0
$$
$$
P \implies Q \quad P \iff Q
$$
</div>
<div class="formula">
<h2>12. 集合</h2>
<p>这是一些集合公式的例子:</p>
$$
A \cup B \quad A \cap B \quad A \setminus B \quad A \subseteq B
$$
</div>
</body>
</html>
Loading…
Cancel
Save