I have a LaTeX document which contains the following:
\tableofcontents
\chapter{Chapter One}
\part{Part One}
...
\part{Final Part}
\chapter{Final Part Chapters}
\chapter{Chapter not Part of Part}
When I compile this to a PDF with hyperref, the last chapter is included as part of the final part in my bookmarks. (I'm including hyperref as shown below.)
\usepackage[xetex,breaklinks,a4paper]{hyperref}
What I would like to know is how to explicitly end the part before the final chapter, so that hyperref promotes this bookmark to top level when the PDF is created.
Any help would be appreciated.
By default, your LaTeX document has Chapter name (Chapter 1, Chapter 2, etc.) for each chapter. If you want to remove such chapter name from your document, then you can use titlesec package and define the titleformat in order to hide the chapter title.
Setting hyperlinks in LaTeX is easy with the hyperref package. Link to any website or add your email address to any document. Adding clickable links to LaTeX documents is very straightforward, you only have to add the hyperref package to your preamble.
How Do You Hyperlink in Latex? You can add a hyperlink into your LaTeX article using the command \usepackage{hyperref} and then including the command \href{YOUR URL}{TEXT FOR YOUR HYPERLINK}.
Links to a web address or email can added to a LaTeX file using the \url command to display the actual link or \href to use a hidden link and show a word/sentence instead. There are two commands in the example that generate a link in the final document: \href{http://www.overleaf.com}{Something Linky}
Heiko Oberdiek's bookmark package (an improvement on his work in hyperref) allows you do to this with its \bookmarksetup
command.
\documentclass{book} \usepackage{bookmark,hyperref} \begin{document} \tableofcontents \chapter{Chapter One} \part{Part One} \part{Final Part} \chapter{Final Part Chapters} \bookmarksetup{startatroot}% this is it \addtocontents{toc}{\bigskip}% perhaps as well \chapter{Chapter not Part of Part} \end{document}
The \bigskip
parts adds a little space in the printed table of contents to visually separate the final chapter from the preceding "part".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With