When created a LaTeX document, using automated bookmarking from hyperref, the pdf bookmarks aren't in a proper tree structure. It only increases bookmarks tree depth never decreasing it.
Should be like:
Part I
=Section 1
==Subsection 1.1
==Subsection 1.2
=Section 2
==Subsection 2.1
Part II
=Section 1
==Subsection 1.1
and now its:
Part I
=Section 1
==Subsection 1.1
==Subsection 1.2
==Section 2
===Subsection 2.1
===Part II
====Section 1
=====Subsection 1.1
thus making everything linked to Part I as a root of the tree, instead of each part being a different root.
Any reason why it could be like this? and how to deal with it?
Ok, after reading alot of documentation I found that to solve the problem, bookmark package with its \bookmarksetup{startatroot} command should be used. And indeed it works.