GeneralCollecting all chapters into one file

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
zryw
Posts: 5
Joined: Sun Mar 20, 2011 1:58 pm

Collecting all chapters into one file

Post by zryw »

Another beginner problem:

My document consist of few individual chapters. Right now i have every chapter in single file, because I need quick access to fix minor bugs. After that I'd like to compile and check that chapter only, so in every file I have in first line
\include{preambule}, which is just standard preambule with nothing .

Now i need to gather all chapters in one document and yet tried by making stapling file:

Code: Select all

\include{preambule}

\begin{document}
\include{first}
\include{second}
...
\end{document}
but coudn't make it work, because of double \include{preambule} definition (one in chapter and one in collective file). Is there any way to solve that issue?
Last edited by zryw on Sat Mar 26, 2011 12:31 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Collecting all chapters into one file

Post by localghost »

Drop the preambles in the files that contain the chapters and try an other approach of splitting your document.

Code: Select all

\documentclass[11pt,a4paper]{report}
\input{preamble}

% comment temporarily the files that are not to be processed
\includeonly{%
  first,
%  second
}

\begin{document}
  \include{first}
  \include{second}
\end{document}
The example above would only include the first chapter. I recommend to do some basic reading [1]. This will help you with the LaTeX basics.

[1] View topic: LaTeX Resources for Beginners


Thorsten
Post Reply