Pandoc: minimal headers for LaTeX output

A bit of searching for latex on the pandoc site shows

http://johnmacfarlane.net/pandoc/README.html#creating-a-pdf

Production of a PDF requires that a LaTeX engine be installed (see --latex-engine, below), and assumes that the following LaTeX packages are available: amssymb, amsmath, ifxetex, ifluatex, listings (if the --listings option is used), fancyvrb, longtable, url, graphicx, hyperref, ulem, babel (if the lang variable is set), fontspec (if xelatex or lualatex is used as the LaTeX engine), xltxtra and xunicode (if xelatex is used).


First of all, since you seem to use pandoc to generate a .tex-file – which as Gareth commented, needs the additional option -s or --standalone if you want a fully compileable file instead of a snippet that you could \include yourself in another TeX-file – it would be your choice afterwards to run xelatex instead of pdflatex.

However, if you want to obtain a pdf directly (e.g. via pandoc -t somefile.pdf ...), then indeed you can choose xelatex (or lualatex) instead of the default pdflatex via --latex-engine=pdflatex|lualatex|xelatex. Note that in this case, the -s switch is implicitly active and doesn't need to be specified (though it doesn't harm).

(note that in pandoc 2.0 and higher, the command-line argument --latex-engine has changed to --pdf-engine.)