Files test.py def f(x): return x test.md ~~~{ #lst:test .py include="test.py" caption=`test.py` } ~~~ header.tex \usepackage{minted} \definecolor{bg}{rgb}{0.85, 0.85. 0.85} \setminted{breaklines=true, bgcolor=bg, breakanywhere} Compilation I’m compiling with: pandoc -s -F pandoc-crossref -L include-code-files.lua -L minted.lua -H header.tex --from markdown --to latex test.md -o test.tex latexmk --shell-escape -pdflatex test.tex I get an error upon compilation, because pandoc-crossref defines its own header include which gets overwritten by my -H header.tex. This link provides more information. I tried the solution proposed by @lierdakil in the link provided but get an error: ! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. l.97 $ for(header-includes)$ ? So I’m at a bit of a loss regarding what to do here, Any pointers welcome. Thanks -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgPTeNSdJ7FDbc9tmw8ax06K7n_uGxvB-mCn2fvBzdD%3DUg%40mail.gmail.com.