1

My question is similar to Using \clearpage breaks \hyperref bookmarks; I have the same problem using KomaScript: I use \addtokomafont{section}{\clearpage} to make sections start on a new page.

When using the hyperref package, the section bookmarks point to the end of the previous section instead of the start of the new one.

\documentclass{scrartcl}
\usepackage{hyperref}
\hypersetup{bookmarksnumbered=true}
\usepackage{bookmark}

\addtokomafont{section}{\clearpage}

\begin{document}
\section{First}
Some text    
\section{Second}
More Text    
\end{document}
Markus Nißl
  • 267
  • 1
  • 6

2 Answers2

3
\documentclass{scrartcl}
\usepackage{hyperref}
\hypersetup{bookmarksnumbered=true}
\usepackage{bookmark}

\let\Section\section
\renewcommand\section{\clearpage\Section}

\begin{document}
    \section{First}
    Some text    
    \section{Second}
    More Text    
\end{document}    
  • This solution works as well, like \addtokomafont{section}{\clearpage\phantomsection}. Which one is the better approach? – Markus Nißl Dec 20 '17 at 16:50
  • you should use \addkomafont only for _ font_ setting and not for anything else ... –  Dec 20 '17 at 18:24
1

You could use \addtokomafont{section}{\clearpage\phantomsection} instead. The \phantomsection command is nessesary for hyperref to get correct bookmarks/pages.

So your code gets:

\documentclass{scrartcl}
\usepackage{hyperref}
\hypersetup{bookmarksnumbered=true}
\usepackage{bookmark}

\addtokomafont{section}{\clearpage\phantomsection}

\begin{document}
\section{First}
Some text    
\section{Second}
More Text    
\end{document}
Bobyandbob
  • 4,899