0

I created separate Tex files for each chapter. I see each one with page numbers starting from 1 to the end of the chapter. How can I create a start page to list all chapters and display a continuous numbering with different headers for every chapter? I have no idea how to link them. It's easier to process them separately if the book has about 300 pages. I thank you in advance for any possible solution.

moewe
  • 175,683
  • 1
    It would be appreciated if you could provide us with a MWE. How did you combine those chapter files into one book? – alchemist Mar 03 '23 at 20:34
  • No. They are separate Tex files and separate PDF files for each chapter. I don't have a combined file for all chapters. The images (figures) are also in images folder. – Dhirgham Murran Mar 03 '23 at 21:13
  • 1
    You can use \setcounter{page}{X} to manually set the page number to X. I guess, it is a bit tricky to come up with an automatic solution, though. – Jasper Habicht Mar 03 '23 at 21:14
  • What about the hyperlinks to the chapters? Can you show me how to create hyperlinks or bookmarks to chapters which upon clicked it will display the chapter pages in sequence. Thank you. – Dhirgham Murran Mar 03 '23 at 21:18
  • Does this help you? It is difficult to help you if you don't clearly say what you want to do and what setup you have. – Jasper Habicht Mar 03 '23 at 21:31
  • If I create one PDF file in illustrator, I can see all bookmarks of the pages listed in the book. I already did that without a problem as I am efficient in Acrobat and illustrator. What I need to do is to use LaTex to create the book, which is easy for me to stack all pages in one Tex file. However, as it has 300 pages, the processing to see the output PDF is time consuming and quite slow on my laptop. What I already did is separating each chapter (of about 10 pages) in one Tex file. I am expecting somehow with your help is to create a main.tex file that can open chapters as external files. – Dhirgham Murran Mar 04 '23 at 02:51
  • 1
    I would use \include and \includeonly, but only print one chapter at a time. You still need the \includes to create aux files. – John Kormylo Mar 04 '23 at 05:08

2 Answers2

2

If you use master TeX file, which controls all chapters as subfile, then the page count comes by auto, e.g.,

\documentclass{book}

\begin{document} \frontmatter \include{prelims} \mainmatter \include{ch01} \include{ch02} ... \end{document}

Or if you keep chapters as separate application file, then please try with

\setcounter{page}{...x...}%should give the starting page number here

Note, as you are not providing any MWE, I've used the standard class file as example.

MadyYuvi
  • 13,693
0

I just figured it out through some research. But, the problem is that it doesn't display continuous counter when loading two PDF files. The files are beautifully loaded in sequence. Although I used \setcounter page it still started the second PDF file with page (1) to page (6). So practically every consequent PDF file starts page number (1). So, how can I make the second file counter at (15)?

Here's my code:

\documentclass{book}
\usepackage[margin=1in]{geometry}
\usepackage{tabularx}
\usepackage{ragged2e}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{array}
\usepackage{xcolor}
\usepackage{pdfpages}
\usepackage[
  pdfpagelabels=true,
  pdftitle={New Methods in Perspective Drawing},
  pdfauthor={Dhirgham Murran},
]{hyperref}
\usepackage{bookmark}

\setlength\parskip{8pt} \setlength\parindent{12pt}

\usepackage{url}

\begin{document}

\pagenumbering{roman} \setcounter{page}{1} \includepdf[pages=1-14]{contents.pdf}

\pagenumbering{roman} \setcounter{page}{15} \includepdf[pages=1-6]{chapter-1.pdf}

\end{document}

Leucippus
  • 1,636
  • 1
    Is this an answer to your question? If not, please Edit your question and add this information to it. Only solutions to the relevant problems should be posted as answers. – Jasper Habicht Mar 04 '23 at 19:47
  • I don't know whether this relates to your question, but you cannot use LaTeX to retroactively edit the page numbers in already compiled PDF files. You need to edit the page number in the .tex file that produces these PDF. – Jasper Habicht Mar 04 '23 at 20:05
  • I wanted to reduce the compiling time to process a book of 300 pages by splitting it to many Tex files. This way I can edit those files faster. But I couldn't find a way to combine them with sequential page numbers. So the only way I could do it is by setcounter page numbers on every Tex file. The PDF is compiled with different starting page numbers. I was expecting someone to give me a solution to combine the Tex files with continuous page numbers into a final PDF file, but none of the answers above solved the problem, except my answer. – Dhirgham Murran Mar 06 '23 at 13:18