TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a set of pdf files (without the latex source) which I merged into a larger pdf file. Each individual pdf file is an article with sections. I created a set of bookmarks for the larger pdf which point to each of the sections in each of the constituent smaller pdf files using the bookmarks package.

\bookmark[level=2,page=6,view={FitH 842}]{<Section>}
\bookmark[level=3,page=6,view={FitH \calc{\paperheight-\topmargin-8in} null}]{<Subsection1>}
\bookmark[level=3,page=8,view={FitH \calc{\paperheight-\topmargin-7in} null}]{<Subsection2>}
\bookmark[level=3,page=11,view={FitH \calc{\paperheight-\topmargin-2in} null}]{<Subsection3>}
\bookmark[level=3,page=13,view={FitH \calc{\paperheight-\topmargin-7in} null}]{<Subsection4>}

Unfortunately I could not use these bookmarks to create the ToC. To create the ToC I did the following

\addcontentsline{toc}{chapter}{<Chaptername N>}
\includepdf[pages=-,linktodoc=false]{<file N>.pdf}
\addcontentsline{toc}{chapter}{<Chaptername N+1>}
\includepdf[pages=-,linktodoc=false]{<file N+1>.pdf}

The issue I am facing now is that the contents of the ToC are being added (prepended) to the bookmarks data containing the the bookmarks I had manually added.

My question is: How can I keep the ToC contents from being added to the bookmarks?

More info:

The ToC data comes before the bookmarks data (the bookmark commands refer to page numbers of the fully merged pdf file). The file structure is as follows:

<ToC data>
\bookmarks ...
  • I need to add the bookmarks because I cannot add the sections of each individual pdf file to the ToC (since I do not have the LaTeX sources)

  • The reason I want a separate contents page at the very beginning is because some lightweight pdf readers (such as the google chrome's native pdf reader) do not utilize bookmarks)

This is a continuation of the question I had previously asked at How do I use LaTeX to create table of contents (chapter headings, subsections etc) for a set of pdf files which I am merging into a single large pdf?

share|improve this question
up vote 5 down vote accepted

You can select to which depth the sectioning commands (part, chapter, section, subsection, etc.) are added as PDF bookmarks using the depth package option. To complete remove them choose the value -2 or lower (-1 is for parts, 0 for chapters, ...).

The following example shows the usage. Here only the manually added bookmark is added:

\bookmark[level=2,page=2,view={FitH 842}]{Section}
share|improve this answer
Works perfectly. Thanks a ton. I need to read the documentation for the packages more carefully. – latexnewbie Mar 9 '11 at 2:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.