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.
Loading…
Reference in new issue