1

I am aware that this question seems a bit strange, but is there a way to compile and insert a document from within another document?

Let me explain exactly what I mean by this: I want to insert pages from another document into a document to show and comment on them. However, it would be important to me that this "embedded document" is compiled at the same time as the main document and does not have to already exist. I am aware that otherwise I could simply use the \includepdf command from pdfpages.

Sam
  • 2,958
  • You can use \immediate\write18 to execute a command, e.g compile another document, see: https://tex.stackexchange.com/questions/20444/what-are-immediate-write18-and-how-does-one-use-them – DG' Jun 04 '20 at 21:03
  • Are you also aware also of \input or \include to include child parts and packages to use complete documents as this child parts (i.e., docmute or standalone)? – Fran Jun 05 '20 at 07:21
  • I was aware of using \input to include a .tex file. I always use this to keep my code rather clean. So for example one .tex file for each section of the document. And in the "main" .tex file I would input them all and compile. But I wasn't aware that you could also include real documents with their own class and \begin{document}. This is great! – Sam Jun 06 '20 at 09:00
  • Just to be sure: Is this also possible with, for example, the article class or is it a standalone thing only? – Sam Jun 06 '20 at 09:02

0 Answers0