TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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'm using the following general outline in book class:





    % Glossary

    % Bibliography / References

But a lot of things comes wrong in the final PDF, among them:

  1. Appendices appear as childs of last section in the last chapter.
  2. Clicking on Nomenclature and References bookmarks sends to the wrong page.
  3. Despite these problems, the page numbers in TOC are right.


share|improve this question
Can you make a minimal working example? No one can compile what you have there. – TH. Sep 4 '10 at 20:15
up vote 9 down vote accepted

I guess you're using hyperref. If you would modify your question and extend your code to show a compilable minimal example, it would make helping easier.

Sectioning commands cause hyperref to create bookmarks. However, if you use starred sectioning commands like nomencl and \bibliography implicitely do (\chapter* or section*), and create the bookmarks by \addcontentsline, you have to set an anchor for hyperref. The needed command is \phantomsection. The anchor must fall onto the correct page, so use it after \cleardoublepage like this:


Do it similar each time you call \addcontentsline followed by a non-numbered chapter or section.

For the nesting issue, to put the bookmarks to the root level, frabjous provided the correct solution in his answer.

share|improve this answer

Another thing to try is the \bookmarksetup{startatroot} command from the bookmark package to make the next entry go back to the root rather than act as a child of the previous one. The package has some other options that might interest you. I agree that \phantomsection is the answer to the links going to the wrong page.

share|improve this answer
Is there a way to accept two answers? :-) Yours solved my problem of "nesting". Stefan's solved my problem of wrong link. – Hugo S Ferreira Sep 4 '10 at 21:46
@Hugo: perhaps post two separate questions next time ;-) if you have got two problems which might be different even if they were related. Btw. I will edit my answer to point to frabjous answer so that his solution to the nesting issue could be found easily. – Stefan Kottwitz Sep 5 '10 at 7:34

Something must have gone wrong in the class you are using. Under the appendix definition you should have this:


The code resets the chapter and section and subsection counters to represent an Appendix. What class are you using?

share|improve this answer

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.