From this question I have used
\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage}
to ensure that sections start on their own page. However when using the hyperref
package this results in the section bookmarks pointing to the end of the previous section instead of the start of the new one.
Here is a MWE:
\documentclass{article}
\usepackage[pdftex]{hyperref} % Generate PDF links and bookmarks.
\hypersetup{
bookmarks=true,
bookmarksnumbered=true
}
\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage}
\begin{document}
\section{First}
Some text
\section{Second}
More Text
\end{document}
If you use Adobe Reader or Preview on OSX and use the bookmarks you will notice that the second bookmark will be on the first page at the end of the previous section and not on the second page where the second section starts.
How can I fix this?
Best Answer
Switch the load order of
hyperref
andtitlesec
:From the
hyperref
documentation (section 2 Implicit behavior):Packages that can be loaded after is given in Which packages should be loaded after hyperref instead of before?