Within the book.cls class, I redefined the \part section to customize the respective toc entry as follows:
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}{\noindent\fcolorbox{ocre}{black!5}{\protect\makebox[\linewidth-2\fboxsep]{\Large\sffamily\strut #1}}}%
\else%
...
The problem is that the \fcolorbox somehow does not go well with the created part bookmark in the pdf file. For instance, instead of parttitle, I am getting the following bookmark in the built pdf file:
push0 g 0 Gpop[-2]parttitleocreblack!5push0 g 0 Gpoptowidthheightdepthottheight-0.5 -widthheightdepthd- widthheightdepthheightted
I have been trying some \protect commands, without success so far. Would you be aware of a systematic way to correct this behavior. If not, I can still redefine the part titles directly in the pdf.


\numberlinebut a\hspace{1em}) and (I did not investigate more), presumably hyperref just filters out the\hspace{1em}which leaves the part number. Yes, I just tried with the memoir class and then even the parts do not get numbers in the bookmarks (memoiruses\partnumberline,\chapternumberline, ...) – Feb 24 '13 at 22:18\texorpdfstringcommand removes the automatic bookmark numbering. – pluton Feb 24 '13 at 22:30