# Is there a possibility to colorize the pdf bookmarks in the sidebar of acrobat reader

I want to colorize my bookmarks in this way. Is there any chance to do this with the hyperref package? Thanks.

• Yes, it is possible, using bookmark package – user31729 Nov 15 '15 at 21:23

One way is to use the \bookmark command and its color= option. However, hyperref adds automatically bookmarks unless the tocdepth is smaller than -1, so using \bookmark would double the entries.

Setting tocdepth to -2 temporarilywill disable this, use\bookmarkthen with a destination and use the the relevant sectioning command then (or whatever should be bookmarked),after that set thetocdepth to another value again to provided the automatically generated bookmarks.

\documentclass{book}

\usepackage{xcolor}

\usepackage[bookmarksopen=true]{hyperref}
\usepackage{bookmark}

\begin{document}
\tableofcontents
\setcounter{tocdepth}{-2}
\bookmark[level=0,dest=chap:here,color=blue]{A chapter}

\chapter{A chapter}\hypertarget{chap:here}{}
\setcounter{tocdepth}{2}
\section{Another level}

\end{document}

• thanks. how can i change the color of a specific bookmark (e.g. make all chapters blue or only bibliography red)? – Jaska Nov 15 '15 at 21:47
• @Jaska: Use color=red for example and the bookmarkdefinestyle command -- please look into the bookmark manual. – user31729 Nov 15 '15 at 21:48

Inserting this in your preamble works fine:

\usepackage{bookmark}
\bookmarkdefinestyle{TheStyleOfTheBookmark0}{color=blue} % Farbe Bookmark Chapter
\bookmarkdefinestyle{TheStyleOfTheBookmark1}{color=green} % Farbe Bookmark Section
\bookmarkdefinestyle{TheStyleOfTheBookmark2}{color=red} % Farbe Bookmark Subsection
\bookmarkdefinestyle{TheStyleOfTheBookmark3}{color=black} % Farbe Bookmark Subsubsection
`