In writing my thesis, I have two Parts each of them composed by several Chapters. I use \input to include the different Chapters files. At the beginning of each Part I want to write an introductory section, and I want it to appear in TOC as Section i.1 and Section i.2. Now the naming and the page numbering works fine. However, hyperref link from TOC points to the previous Section with the same number. It is more clear with this MWE:
The main file is
\documentclass [a4paper,12 pt]{book}
\usepackage{hyperref}
\usepackage{lipsum}
\begin{document}
\frontmatter
\renewcommand\contentsname{Table of Contents}
\tableofcontents
\clearpage{\pagestyle{empty}\cleardoublepage}
\mainmatter
\input{File1}
\clearpage{\pagestyle{empty}\cleardoublepage}
%%%%-----------------------%
\phantomsection
\addcontentsline{toc}{part}{Title Part 1}
\input{File2}
\clearpage{\pagestyle{empty}\cleardoublepage}
\end{document}
File 1 is
\section{First section}
\lipsum
\section{Second section}
\lipsum
File 2 is
\thispagestyle{empty} \phantom{}
\vfill
\begin{center}
{\huge \scshape\bfseries Title Part I\\}
\end{center}
\vfill
\newpage
{\clearpage\phantomsection\renewcommand\thechapter{\rm S}
\setcounter{section}{0}
\label{sec:intro1}
\section{Section S1}
\lipsum}
% In the real file I have here many others Chapters and Sections.
{\clearpage\phantomsection\renewcommand\thechapter{\rm S}
\setcounter{section}{1}
\section{Section S2}
\label{sec:intro2}
\lipsum}
When now I compile, the clickable link of Section i1 points to First Section and Section i2 points to Second Section. How to have the links pointing to the right place?
12pt
; the fact that also12 pt
works in incidental. You can avoid the clumsy\clearpage\thispagestyle{empty}\cleardoublepage
by just loadingemptypage
.