Pandoc 是由 John MacFarlane 开发的标记语言转换工具,可实现不同标记语言间的格式转换
pandoc安装
除了各个操作系统软件仓库之外可以使用 Haskell
平台安装
cabal update
cabal install pandoc
或安装包
sudo dpkg -i $DEB
用法
示例
- HTML fragment:
pandoc MANUAL.txt -o example1.html
- Standalone HTML file:
pandoc -s MANUAL.txt -o example2.html
- HTML with table of contents, CSS, and custom footer:
pandoc -s --toc -c pandoc.css -A footer.html MANUAL.txt -o example3.html
- LaTeX:
pandoc -s MANUAL.txt -o example4.tex
- From LaTeX to markdown:
pandoc -s example4.tex -o example5.text
- Man page:
pandoc -s -t man pandoc.1.md -o example10.1
- Converting a web page to markdown:
pandoc -s -r html http://www.gnu.org/software/make/ -o example12.text
- From markdown to PDF:
pandoc MANUAL.txt --pdf-engine=xelatex -o example13.pdf
- HTML slide shows: DZSlides演示框架幻灯片
pandoc -s --mathml -i -t dzslides SLIDES -o example16a.html pandoc -s --webtex -i -t slidy SLIDES -o example16b.html pandoc -s --mathjax -i -t revealjs SLIDES -o example16d.html
- TeX math in HTML:
pandoc math.text -s -o mathDefault.html pandoc math.text -s --mathml -o mathMathML.html pandoc math.text -s --webtex -o mathWebTeX.html pandoc math.text -s --mathjax -o mathMathJax.html pandoc math.text -s --katex -o mathKaTeX.html
- Word docx:
pandoc -s MANUAL.txt -o example29.docx
- LaTeX math to docx:
pandoc -s math.tex -o example30.docx
- DocBook to markdown:
pandoc -f docbook -t markdown -s howto.xml -o example31.text
- Docx with a reference docx:
pandoc --reference-doc twocolumns.docx -o UsersGuide.docx MANUAL.txt