+\usepackage{ifpdf} % part of the hyperref bundle
+\ifpdf % if pdflatex is used
+
+% XeTeX with Hebrew does not like this bookmark code
+% so it is in the conditional.
+% The pages of the TOC is numbered roman
+% and a pdf-bookmark for the TOC is added
+\let\myTOC\tableofcontents
+\renewcommand\tableofcontents{%
+ \frontmatter
+ \pdfbookmark[1]{\contentsname}{}
+ \myTOC
+ \mainmatter }
+
+\fi % end if pdflatex is used
+