知乎专栏 |
从已存在文件制作模版
pandoc -o template.docx --print-default-data-file reference.docx pandoc -o template.pptx --print-default-data-file reference.pptx
输出文件
pandoc -f markdown -t docx --reference-doc=template.docx -o test.docx test.md pandoc -f markdown -t pptx --reference-doc=template.pptx -o test.pptx test.md
早起 office 使用 dotx 和 potx
pandoc -o template.dotx --print-default-data-file reference.docx pandoc -o template.potx --print-default-data-file reference.pptx
输出文件
pandoc -f markdown -t docx --reference-doc=template.dotx -o test.docx test.md pandoc -f markdown -t pptx --reference-doc=template.potx -o test.pptx test.md
目录参数 --toc
目录深度 --toc-depth=3
pandoc -f markdown -t docx --reference-doc=template.dotx --toc --toc-depth=3 -o test.docx test.md
设置目录标题
pandoc input.md -o output.docx --toc -M toc-title="目录" title="SSS"
参考文献
pandoc --citeproc --number-sections \ --csl gb-t-7714-2015-numeric-bilingual-no-uppercase-no-url-doi.csl \ --bibliography ref.bib -M reference-section-title="参考文献" \ -M link-citations=true --reference-doc=ref.docx -s input.md -o main.docx
方案一
neo@netkiller neo % pandoc -f markdown -t docx --reference-doc=../template/template.dotx --toc --toc-depth=3 -M toc-title="目录" -M title="文档标题" -o test.docx test.md
方案二,向 markdown 文件中添加声明
--- title: 'This is the title: it contains a colon' author: - Author One - Author Two keywords: [nothing, nothingness] abstract: | This is the abstract. It consists of two paragraphs. ---