Pandoc - Universal document converter

Pandoc is a command-line tool that can be used to convert files from one format to another.


It is commonly used for converting files written in Markdown, a lightweight markup language, into other formats such as PDF, HTML, and Word documents. Pandoc can also be used to convert files in other formats, such as HTML, LaTeX, and PowerPoint, into Markdown.

Pandoc can also be used to convert files that include embedded images or other media, and it can be customized using templates and command-line options. Additionally, Pandoc can be used to produce output in multiple formats at once, making it a versatile tool for converting and publishing content in different formats.

The basic conversion works as follows:

1pandoc MANUAL.txt -o manual.tex

In many cases, Pandoc is able to infer the involved file formats from the file extension.

However, more advanced conversions can be done, such as this "PDF with numbered sections and a custom LaTeX header" (from the documentation):

1pandoc -N --variable "geometry=margin=1.2in" --variable mainfont="Palatino" --variable sansfont="Helvetica" --variable monofont="Menlo" --variable fontsize=12pt --variable version=2.0 MANUAL.txt --include-in-header fancyheaders.tex --pdf-engine=xelatex --toc -o example14.pdf

Pandoc is written in Haskell.


References