0

I am having trouble with bookmarks. The hierarchy is not correct. It is giving me something like below. How can I get it corrected?

Acknowledgement
Chapter 1
    Chapter 2
    Chapter 3
Chapter 4
References
Appendix 1

Just to explain a bit more. I am using a style .cls file for my dissertation. In the style file the package are loaded in the following order:

\RequirePackage{amsmath,amsthm,amssymb}     % AMS math, AMS theorem, AMS fonts
\RequirePackage{array}
\RequirePackage{setspace}                   % line spacing
\RequirePackage[vcentering,dvips,a4paper]{geometry} % help with margins
\RequirePackage{color}
\RequirePackage[round]{natbib}                     % this package allows you to link your references
\RequirePackage[dvips,plainpages=false,pdfpagelabels=true,breaklinks=true]{hyperref} % for pdf bookmarks
\RequirePackage[anythingbreaks]{breakurl}
\RequirePackage[all]{hypcap}
\RequirePackage{breakcites}
\RequirePackage{nomencl}

In my main .tex file the packages are loaded in the following order:

\usepackage{float}                      % figure floats
\usepackage{graphicx}                   % graphics package
\graphicspath{ {figures/}{figures/eps/}{figures/pdf/} }% specify the path where figures are located
\usepackage{ifpdf}
\ifpdf
  \usepackage{epstopdf}       % converts eps files to pdf
\fi
\usepackage{ifthen}
\usepackage{fancyhdr}                   % fancy headers and footers
\usepackage{url}                        % nicely format url breaks
\usepackage[inactive]{srcltx}           % necessary to use forward and inverse searching in DVI
\usepackage{relsize}                    % font sizing hierarchy
\usepackage{booktabs}                   % professional looking tables
\usepackage[labelfont={bf}]{caption,subfig} % nice sub figures
\usepackage{mathrsfs}                   % additional math scripts
\usepackage[Bjarne]{fncychap}   % creats fancier chapter titles

Then comes the rest of the main .tex document which imports the chapters of the dissertation:

\begin{document}
    \pagenumbering{alph} % this is needed to clear certain issues with the hyperref package
    %
    %\makeApprovalPage % make the approval page - this is the page that needs to be signed & returned to the thesis/dissertation consultant
    %\makeETDApprovalPage % make the Electronic Thesis & Dissertation page - this page is kept with the electronic copy
    %
    \addToPDFBookmarks{0}{Front Matter}{rootNode} % create a root node named "Front Matter" in the pdf bookmarks
    \addToPDFBookmarks{1}{Title}{a} % add a pdf bookmark to the title page
    \makeTitlePage % make the title page. Make sure you properly set the \docType
    %
    \pagenumbering{roman}
    \setcounter{page}{2}
    %
    \makeCopyrightPage % make the copyright page
    %
    \addToPDFBookmarks{1}{Dedication}{b} % add a pdf bookmark to the dedication page
    \include{front-matter/dedication} % include the dedication
    %
    \addToPDFBookmarks{1}{Acknowledgements}{c} % add a pdf bookmark to the acknowledgements page
    \include{front-matter/acknowledgements} % include the acknowledgements
    %
    \addToPDFBookmarks{1}{Quote}{d} % add a pdf bookmark to the quotation page
    \include{front-matter/quote} % include a quote
    %
    \addToPDFBookmarks{1}{Abstract}{e} % add a pdf bookmark to the abstract page
    \include{front-matter/abstract} % your abstract
    %
    \addToPDFBookmarks{0}{Table of Contents}{f}
    \tableofcontents % generate a table of contents
    %
    \addToTOC{List of Tables} % this will add the list of tables to the Table of Contents (TOC)
    \listoftables % generate a list of tables
    %
    \addToTOC{List of Figures} % this will add the list of figures to the Table of Contents (TOC)
    \listoffigures % generate a list of figures
    %
    \addToPDFBookmarks{0}{Nomenclature}{g} % OPTIONAL
    \makenomenclature % OPTIONAL
    \printnomenclature[1.25in] % OPTIONAL
    %
    \newpage
    \pagenumbering{arabic}
    \setcounter{page}{1}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % INCLUDE THE CHAPTERS STARTING WITH THE NOMENCLATURE IF PRESENT
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \include{front-matter/nomenclature} % OPTIONAL
    \include{chapters/chapter-1}
    \include{chapters/chapter-2}
    \include{chapters/chapter-3}
    \include{chapters/chapter-4}
    \include{chapters/chapter-5}
    \include{chapters/chapter-6}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % BIBLIOGRAPHY
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        \makeBibliographyPage % make the bibliography title page - can be edited in ut-thesis-template.tex
        \bibliographystyle{agsm} % bibliography style - recommend using apalike-doi as it hyperlinks DOIs
        \bibliography{references/references-dissertation,references/chapter_5} % references.bib included in the references directory
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % APPENDIX - OPTIONAL - COMMENT IF NOT NEEDED
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \makeAppendixPage   % make the appendix title page - can be edited in ut-thesis-template.tex
    \appendix
    \include{back-matter/appendix-1}
    \include{back-matter/appendix-2}
    %\include{back-matter/appendix-3}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % A VITA IS REQUIRED
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \addToTOC{Vita}
    \include{back-matter/vita}
\end{document}
Kevin Bell
  • 163
  • 1
  • 8
  • 1
    In order for people to help, they will probably need a fully compilable minimal example. What you are posting here is not compilable on its own. There is document class for example. Plus your minimal code is using packages and constructions that obviously have nothing to do with the problem at hand – daleif Jul 17 '15 at 12:23
  • The reason for providing the packages is that apparently this issue has something to do with the order of packages loaded. – Kevin Bell Jul 17 '15 at 12:29
  • 2
    Then it is a vital lesson on your part to test and see which affect the MWE and which does not. I don;t see any of the stuff in the second box affecting the bookmarks. Also you are not providing something we can just copy and test without adding or changing anything. Thus you are much less likely to get any help – daleif Jul 17 '15 at 12:50
  • 2
    A 'general' rule is to load hyperref as the last package, unless cleveref or glossaries is used. –  Jul 17 '15 at 13:02
  • I don't know the macros \addToPDFBookmarks etc. Where are they from? –  Jul 17 '15 at 13:03
  • \newcommand {\addToPDFBookmarks}[3] { \cleardoublepage \phantomsection \pdfbookmark[#1]{#2}{#3} } % macro that adds a bookmark to the PDF file without including it in the table of contents – Kevin Bell Jul 17 '15 at 13:25
  • Got it fixed by moving all my package loading process to the style file and loading hyperref as the last one. Thanks for the tip @ChristianHupfer . – Kevin Bell Jul 17 '15 at 14:02

0 Answers0