I answered this question before here:
I know that this is an old question, but I have not seen any answers to this effect: Essentially, if you are using markdown and pandoc to convert your file to pdf, in your yaml data at the top of the page, you can include something like this:
---
header-includes:
- \usepackage{pdfpages}
output: pdf_document
---
\includepdf{/path/to/pdf/document.pdf}
# Section
Blah blah
## Section
Blah blah
Since pandoc using latex to convert all of your documents, the header-includes section calls the pdfpages package. Then when you include \includepdf{/path/to/pdf/document.pdf} it will insert whatever is include in that document. Furthermore, you can include multiple pdf files this way.
As a fun bonus, and this is only because I often use markdown, if you would like to include files other than markdown, for instance latex files. I have modified this answer somewhat. Say that you have a markdown file markdown1.md:
---
title: Something meaning full
author: Talking head
---
And two addtional latex file document1, that looks like this:
\section{Section}
Profundity.
\subsection{Section}
Razor's edge.
And another, document2.tex, that looks like this:
\section{Section
Glah
\subsection{Section}
Balh Balh
Assuming that you want to include document1.tex and document2.tex into markdown1.md, you would just do this to markdown1.md
title: Something meaning full
author: Talking head
---
\input{/path/to/document1}
\input{/path/to/document2}
Run pandoc over it, e.g.
in terminal pandoc markdown1.md -o markdown1.pdf
tex4ht. trymk4ht oolatex filename.tex. The generated ODT file can be converted to DOCX using LIbreOffice or Word. – michal.h21 Apr 04 '17 at 13:38docx? I've downloaded you MWE, and the files are included, at least the parts that pandoc can interpret. As an experiment, include in every file as first line something likeThis is \verb"filename".(replacing of coursefilenamewith the respective filename). In the generated docx I find traces of the subfiles. But apparently commands like\lipsumand tikz code is beyond the abilities of pandoc. – gernot Apr 10 '17 at 10:16