环境
为了使用方便, pandoc安装好之后把他的安装路径添加到环境变量里面, 添加好之后用下面的方法测试
pandoc -v
markdown转换为docx
最简单的例子
pandoc -s test.md -o test.docx
此时转化结果为默认样式,难以符合我们的要求,可以通过自定义样式使其更加美观:
pandoc -s test.md --reference-doc reference.docx -o test.docx
也可以将
reference.docx
放到%userprofile%/AppData/Roaming/pandoc
文件夹, 就可以省略--reference-doc reference.docx
markdown转换为pdf
pandoc -s test.md --pdf-engine=xelatex -o test.pdf --number-sections --template pm-template.latex
参考链接:https://segmentfault.com/a/1190000004887280#articleHeader0