For my lecture notes, I have a big tex file containing \include
commands (one for each chapter).
Is there a way to typeset in one go :
- the whole file: i.e. all the files appearing in the includeonly (below : chapter 2 and 3),
- and on the other hand, create a separate pdf file for each file appearing in
includeonly
(here one pdf with just chapter 2, and one pdf with chapter 3).
MWE main file :
\documentclass{scrbook}
\includeonly{
% file1,
file2,
file3
}
\begin{document}
\include{file1.tex}
\include{file2.tex}
\include{file3.tex}
\end{document}
file1.tex
\chapter{Chapter 1}
ABCDE
file2.tex
\chapter{Chapter 2}
ABCDE
file3.tex
\chapter{Chapter 3}
ABCDE
file2.tex
starts withchapter 1
).