You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
326 B

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')