Jona Engel
Jona Engel

Reputation: 369

Elegant way to tell `pandoc` to produce `.tex` without a preamble so they can be _included_ with latex?

I am writing a text in markdown to pipe into pandoc to produce html and tex files. This works great for single files and linked html files. Now I want to build a single pdf of the multiple tex files using a main file which calls the tex files with \include{foo}. Which fails with each .tex file having a full preamble.

How would I tell pandoc to produce a includable tex-file? Or am I on the wrong track? If so, how can I stich together a pdf from several markdown files?

PS I am here because of this

Upvotes: 1

Views: 994

Answers (2)

You don't need "includable" documents, there are several latex class and packages which allow you to include documents with full preambles, e.g. docmute:

\documentclass{article}
\usepackage{docmute}

\begin{document}

test

\include{document} % document with full preamble

\end{document}

(or have a look at some of these https://www.ctan.org/recommendations/combine )


Or if you already have the pdf files of the individual documents, you can stitch them together using the pdfpages package.

Upvotes: 2

Jona Engel
Jona Engel

Reputation: 369

I just realized I still had the -s option in my pandoc command. With out it, pandoc produce just the text body and everything works. Bonus: In fact, want to use \input{foo} to be able to carry label over several latex files.

Upvotes: 1

Related Questions