main
HuangHai 3 weeks ago
parent 9d3f19a30a
commit 26a2c0eb6a

@ -0,0 +1,14 @@
import subprocess
def markdown_to_docx_with_pandoc(md_path, docx_path):
subprocess.run([
'pandoc',
'-s',
md_path,
'-o',
docx_path,
'--mathml'
], check=True)
# 使用示例
markdown_to_docx_with_pandoc('input.md', 'output.docx')

@ -0,0 +1,27 @@
# 数学公式示例
## 基础公式
这是一个行内公式示例:$E=mc^2$
## 复杂公式
块级公式示例:
$$\int_{-\infty}^\infty e^{-x^2} dx = \sqrt{\pi}$$
## 矩阵示例
$$\begin{pmatrix}
1 & 2 \\
3 & 4
\end{pmatrix}$$
## 方程组
$$
\begin{cases}
x + y = 5 \\
2x - y = 1
\end{cases}
$$

Binary file not shown.

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<title>LaTeX公式渲染示例</title>
<!-- 使用BootCDN提供的MathJax -->
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script id="MathJax-script" async src="https://cdn.bootcdn.net/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js"></script>
<style>
body {
font-family: "Microsoft YaHei", sans-serif;
@ -24,11 +24,16 @@
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
displayMath: [['$$', '$$'], ['\\[', '\\]']],
processEscapes: true
},
svg: {
fontCache: 'global',
font: 'STIX-Web'
font: 'STIX-Web',
scale: 1.1
},
startup: {
typeset: true
}
};
</script>

Loading…
Cancel
Save