Take the 2-minute tour ×
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.

I'm using the following general outline in book class:

\mainmatter
    \include{introduction}

    \part{...}
        \include{chapter1}
        ...

    \part{...}
        ...
        \include{conclusions}

\addcontentsline{toc}{part}{\appendixtocname}
\appendixpage
\appendix
    \include{...}

\backmatter
    % Glossary
    \cleardoublepage
    \addcontentsline{toc}{chapter}{Nomenclature}
    \markboth{Nomenclature}{Nomenclature}
    \makenomenclature
    \input{nomenclature}
    \printnomenclature[4.5cm]

    % Bibliography / References
    \cleardoublepage
    \addcontentsline{toc}{chapter}{References}
    \bibliographystyle{amsalpha}
    \renewcommand{\bibname}{References}
    \bibliography{thesis}

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.

Help?

share|improve this question
1  
Can you make a minimal working example? No one can compile what you have there. –  TH. Sep 4 '10 at 20:15
add comment

3 Answers

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:

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{References}
\bibliographystyle{amsalpha}
\renewcommand{\bibname}{References}
\bibliography{thesis}

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
add comment

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
1  
@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
add comment

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

\renewcommand\appendix{\par
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \gdef\@chapapp{\appendixname}%
  \gdef\thechapter{\@Alph\c@chapter}
  \renewcommand{\chaptertitlename}{\appendixstring}

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

share|improve this answer
add comment

Your Answer

 
discard

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.