I know that I can use the -H
or --include-in-header
commands to include a custom preamble in the generated output. The problem is now that Pandoc includes my preamble but puts another preamble in front of it:
\documentclass{article}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifxetex
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\else
\ifluatex
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\else
\usepackage[utf8]{inputenc}
\fi
\fi
\ifxetex
\usepackage[setpagesize=false, % page size defined by xetex
unicode=false, % unicode breaks when used with xetex
xetex]{hyperref}
\else
\usepackage[unicode=true]{hyperref}
\fi
\hypersetup{breaklinks=true, pdfborder={0 0 0}}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\setcounter{secnumdepth}{0}
[... my preamble ...]
I know that this is the default LaTeX preamble (default.latex
) that Pandoc loads from its templates
folder. The same thing happens when I'm using --include-after-body
with \end{document}
.
This is the command I'm using:
pandoc -o output.tex input.txt --include-before-body=header.tex --include-after-body=footer.tex