This is a follow-up question to PDF bookmark customization
How is it possible, to set in an report/scrreprt all chapters with bold bookmarks in the pdf bookmarks? I've found a discussion about it (in german: renewcommand chapter), however, the MWE from there is not compiling with pdflatex (TeX Live 2012)
\documentclass{scrbook}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage[pdftex]{hyperref}
\usepackage[pdftex,open=true]{bookmark}
\makeatletter
\renewcommand{\@chapter}{}
\let\@chapter\chapter
\renewcommand{\chapter}{%
\@ifstar {\@chapter}{\@dblarg\@chapter}%
}
\newcommand*{\@chapter}[2][]{%
\bookmarksetup{bold=true}%
\@chapter[#1]{#2}%
\bookmarksetup{bold=false}%
}
\makeatother
\begin{document}
\tableofcontents
\chapter{Einleitung}
\section{Test}
\blindtext
\chapter[Kurze Überschrift]{Lange Überschrift}
\section{foobar}
\blindtext
\end{document}
Best Answer
Option
addtohook
helps:Some remarks:
hyperref
andbookmark
.open
in\bookmarksetup
. This way\usepackage{bookmark}
do not need options (reducing option clash conflicts).