General ⇒ Including other tex documents
Including other tex documents
I am trying to include other tex documents in a larger tex document (either with \include or \input). My problem is the the sub documents all have preambles (so that I can compile them), but having these prevents the larger main document from compiling correctly. Do I have to comment out the preambles before I include them into the main document or is there some other workaround.
Thanks in advance.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Including other tex documents
you cannot include those tex files together with their preambles. You have to comment them out. But if their settings are different compared to the preamble of the main document they may look differently at the end.
You could also consider to compile each tex file separately and include their pdf output using \includepdf of the pdfpages package.
Stefan
Re: Including other tex documents
Including other tex documents
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Including other tex documents
Best regards and welcome to the board
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10