2

I am including multiple PDFs in a main latex document (on Overleaf). However, the bookmarks of these included PDFs do not carry over to the main PDF. I can see bookmarks in the included pdfs, but I include that they do not carry over to the main pdf.

Here is the command I am using to include the pdf. \includepdf[pages=-,pagecommand={}]{Chapters/chapter1.pdf}. Please let me know what I can do to get bookmarks for all the chapters I include as PDFs in my main PDF.

Chapter1.pdf bookmarks looks like this:

1. Introduction
2. Background
3. Related work
4. Methodology
  4.1 Method1
  4.2 Method2
5. Results

main.pdf bookmarks look like this

1. Introduction
  1.1 subsection 1
  1.2 subsection 2
Chapter 1
Chapter 2
Chapter 3 

I want main.pdf bookmarks to be like this:

1. Introduction
   1.1 subsection 1
   1.2 subsection 2
2. Chapter 1
 2.1 Introduction
 2.2. Background
 2.3. Related work
 2.4. Methodology
   2.4.1 Method1
   2.4.2 Method2
 2.5. Results
3. Chapter 2
.
.
.
4
  • 1
    You should probably explain what you meain by bookmarks. Usially these are generated from the table of contents of the document. It is possible to add stuff to the main toc from \includepdf via another option (see the pdfpages manual) but the process is manual.
    – daleif
    Commented Jan 31 at 8:30
  • see newpax package which can at least copy the destinations not sure it can automatically generate links to them in the outline of the comined pdf Commented Jan 31 at 11:27
  • @DavidCarlisle newpax doesn't store or import the outline. But the destination names can be accessed and if you have a toc-file of the imported pdf you can read it in, see e.g. tex.stackexchange.com/a/695715/2388 Commented Jan 31 at 13:18
  • @daleif yes! I am trying to form a table of contents for the included pdfs. I can manually add each chapter and subchapters using \includepdf[pages=-, addtotoc={1, section, 2, Introduction, bookmark_label}]{{Chapters/chapter1.pdf}. Is there an automated way? `
    – tarun14110
    Commented Feb 1 at 2:10

0

You must log in to answer this question.

Browse other questions tagged .