Text FormattingConsecutive page numbers

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
KrisSienicki
Posts: 2
Joined: Fri May 10, 2013 11:17 am

Consecutive page numbers

Post by KrisSienicki »

Hi, my question is trivial but I am new and learning. I just created a multi-authored book with 13 chapters. In PDF of the book page numbers are consecutive as in the book should be. My question is: how to prepare PDF for each chapter (separately) but with page numbers as exactly in the book. Thanks. Cheers, Kris.

Recommended reading 2024:

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

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

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Consecutive page numbers

Post by cgnieder »

Hi KrisSienicki,

Welcome to the LaTeX community!

LaTeX provides a mechanism for this: \include and \includeonly. It works like this. If you have a book, say, you create a main file main.tex (or whatever) and a tex for each chapter, introduction.tex, chapter1.tex, ... or whatever you like.

The main-file now looks something like

Code: Select all

\documentclass{scrbook}
\usepackage[T1]{fontenc}
other packages ...
custom definitions...
\begin{document}
\frontmatter
\include{introduction}
\mainmatter
\include{chapter1}
\include{chapter2}
...
\backmatter
\include{appendix}
\end{document}
Now when you're working on the file chapter7.tex for example and you don't want to compile the whole document to see changes but still want the page-numbering and the references right you add to the preamble

Code: Select all

\includeonly{chapter7}
without changing the main file. If you now compile the document only chapter7.tex will be included but the page-numbering and the references still should be as if you included all files.

Regards
site moderator & package author
KrisSienicki
Posts: 2
Joined: Fri May 10, 2013 11:17 am

Re: Consecutive page numbers

Post by KrisSienicki »

Hi Clemens, thank you very much. Will try on Monday. Have a nice weekend.
Cheers, Kris
Post Reply