Pandoc is a universal document converter developed in Haskell language, widely used as a writing tool (especially by scholars) and as a basis for publishing workflows. It was originally created by John MacFarlane, a philosophy professor at the University of California, Berkeley under GPLv2.

HTML fragment

pandoc MANUAL.txt -o example1.html

Standalone HTML file:

pandoc -s MANUAL.txt -o example2.html
pandoc -s --toc -c pandoc.css -A footer.html MANUAL.txt -o example3.html


pandoc -s MANUAL.txt -o example4.tex

From LaTeX to markdown

pandoc -s example4.tex -o example5.text


pandoc -s -t rst --toc MANUAL.txt -o example6.text

Rich text format (RTF)

pandoc -s MANUAL.txt -o example7.rtf

Beamer slide show

pandoc -t beamer SLIDES -o example8.pdf

DocBook XML

pandoc -s -t docbook MANUAL.txt -o example9.db

Man page

pandoc -s -t man -o example10.1


pandoc -s -t context MANUAL.txt -o example11.tex

Converting a web page to markdown

pandoc -s -r html -o example12.text

From markdown to PDF

pandoc MANUAL.txt --pdf-engine=xelatex -o example13.pdf

PDF with numbered sections and a custom LaTeX header

pandoc -N --template=mytemplate.tex --variable mainfont="Palatino" --variable sansfont="Helvetica" --variable monofont="Menlo" --variable fontsize=12pt --variable version=2.0 MANUAL.txt --pdf-engine=xelatex --toc -o example14.pdf

HTML slide shows

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

Syntax highlighting of delimited code blocks

pandoc code.text -s --highlight-style pygments -o example18a.html

pandoc code.text -s --highlight-style kate -o example18b.html

pandoc code.text -s --highlight-style monochrome -o example18c.html

pandoc code.text -s --highlight-style espresso -o example18d.html

pandoc code.text -s --highlight-style haddock -o example18e.html

pandoc code.text -s --highlight-style tango -o example18f.html

pandoc code.text -s --highlight-style zenburn -o example18g.html

GNU Texinfo, converted to info, HTML, and PDF formats

pandoc MANUAL.txt -s -o example19.texi

makeinfo --no-validate --force example19.texi -o

makeinfo --no-validate --force example19.texi --html -o example19

texi2pdf example19.texi  # produces example19.pdf

OpenDocument XML

pandoc MANUAL.txt -s -t opendocument -o example20.xml

ODT (OpenDocument Text, readable by OpenOffice)

pandoc MANUAL.txt -o example21.odt

MediaWiki markup

pandoc -s -t mediawiki --toc MANUAL.txt -o

EPUB ebook

pandoc MANUAL.txt -o MANUAL.epub

Markdown citations

pandoc -s --bibliography biblio.bib --filter pandoc-citeproc CITATIONS -o example24a.html

pandoc -s --bibliography biblio.json --filter pandoc-citeproc --csl chicago-fullnote-bibliography.csl CITATIONS -o example24b.html

pandoc -s --bibliography biblio.yaml --filter pandoc-citeproc --csl ieee.csl CITATIONS -t man -o example24c.1

Textile writer

pandoc -s MANUAL.txt -t textile -o example25.textile

Textile reader

pandoc -s example25.textile -f textile -t html -o example26.html


 pandoc -s MANUAL.txt -o


pandoc -s MANUAL.txt -t asciidoc -o example28.txt

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

MediaWiki to html5

pandoc -f mediawiki -t html5 -s -o example32.html

Custom writer

pandoc -t sample.lua example33.text -o example33.html

Docx with a reference docx

pandoc --reference-doc twocolumns.docx -o UsersGuide.docx MANUAL.txt

Docx to markdown, including math

pandoc -s example30.docx -t markdown -o

EPUB to plain text

pandoc MANUAL.epub -t plain -o example36.text