Pandoc is an extension to MarkDown providing support for a number of document formats.


This is an extremely powerful and easy-to-use tool and well worth looking at.

Create Standalone HTML Document

   $ pandoc --output test.html --standalone --toc test.mdml
   $ man pandoc # for more information

Creating a PDF Document

Earlier versions of Pandoc included markdown2pdf that is no longer needed as Pandoc now includes the ability to create PDFs.

This is the old markdown2pdf usage:

   $ markdown2pdf --output test.pdf test.mdml
   $ man markdown2pdf # for more information

The same with later versions of Pandoc (e.g.

   $ pandoc --toc --output test.pdf

Pandoc requires pdflatex to create PDFs. In Debian 8 (Jessie) installing the texlive package should install all required dependencies. If not, you could also consider installing packages such as texlive-lang-all, texlive-lang-english and texlive-latex-extra.

-- Frank Dean - 2 Aug 2016

Creating an ebook

Page Breaks

You can use inline \LaTeX (LaTeX) to create page breaks. Newpage forces a new page. Pagebreak encourages a page break.



  1. Package inputenc Error: Unicode char—(inputenc) not set up for use with LaTeX

    Additionally, the error message suggests Try running pandoc with --latex-engine=xelatex – Which should fix the issue. E.g.

        $ pandoc --latex-engine=xelatex --output --toc test.pdf

-- Frank Dean - 1 Oct 2017


Related Topics: MarkDown, LaTeX

-- Frank Dean - 10 Aug 2009