Since the page numbering restarts at \mainmatter
, you need to keep the main matter in separate files from the \frontmatter
(and avoid \backmatter
). Your master file uses \includeonly
to select which book to print. Here the first book is in test5.tex
and the second is in test6.tex
.
There was a slight problem in that the first book ended on an odd page, so the extra page before the chapter wound up in the second book.
\documentclass{book}
\makeatletter
\newcommand{\skipextrapage}{\if@twoside
\ifodd\value{page}\else\stepcounter{page}\fi
\fi}
\makeatother
\includeonly{test6}% select one at a time
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\include{test5}
\skipextrapage
\include{test6}
\end{document}
where test5.tex
contains
\chapter{First Chapter Book1}
First book starts on \thepage
and test6.tex
contains
\chapter{First Chapter Book 2}
Second book starts on \thepage
So how do you want the chapters numbered and the table of contents divided (easiest would be to make each book a part
and possibly redefine \partname
)?
