I'm importing some pdf files, to my document.




These are book chapters, with their own formatting - it's a reason, why I can't use \section there.

I don't want to have any table of contents in my document, just the chapters names in the bookmarks area together with the numbering. How to do this?


Using the hyperref package, your code should work to produce the bookmarks. Alternatively, the smaller bookmark package provides the same interface for just PDF bookmarks. Remember that you need to compile your document at least twice in order for the PDF bookmarks to be accurate.

\usepackage{pdfpages}% http://ctan.org/pkg/pdfpages
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
%\usepackage{bookmark}% http://ctan.org/pkg/bookmark
% file.pdf contains 8 pages of \lipsum[1-40] in article document class
\pdfbookmark{1 First}{r01}

\pdfbookmark{2 Second}{r02}

\pdfbookmark{3 Third}{r03}

\pdfbookmark{4 Fourth}{r04}


enter image description here

|improve this answer|||||
  • Adding bookmarks to the document works fine, but this is not the question. The question is, how to automatically number the bookmarks, as opposed to your example, where you put the numbers by hand. – Pawel Oct 14 '11 at 16:53
  • Do you have access to the .aux file that produced r0?.pdf? Even more desirable, do you have access to the LaTeX code that produced r0?.pdf? – Werner Oct 14 '11 at 16:54
  • Unfortunately, no. r0?.pdfs were exported from MS Word. – Pawel Oct 14 '11 at 19:25
  • Well, unfortunately you'll need some way to process the source in order to extract this information. Word documents are binary and LaTeX would not be able to extract the contents nor know which components represent a chapter or just plain text. You could convert the source from Word to (La)TeX using Word2TeX. Of course, this heavily depends on the contents of the Word for it to be effective. – Werner Oct 14 '11 at 19:29
  • I don't care about sections etc inside imported pdfs, I just put them as they are and add bookmarks to have a quick access to them. Therefore, includepdf + pdfbookmarks are quite enough - except the fact, that they don't automatically add bookmarks numbers. Will I have to type the numbers by hand? I wish there is more elegant solution. – Pawel Oct 14 '11 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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