How to use \tableofcontents well? [duplicate]

I´m trying and trying and the results are bad.

Sometimes, \tableofcontents use red text, other point to a page that is incorrect. If a part is in page 3, the TOC point to page 2.

Are there any package that runs well?, or.. how can I use \tableofcontents with good results?

-------------- edited after Crhistopher comments -----

In this image you can see what I obtain and what I would like to obtain

Inm this code I view in TOC that 3 last items poit to page 4, when in reality they are in page 5.

\documentclass[12pt,a4paper]{article}
\usepackage[top=2.5cm, left=3.5cm, bottom=2.5cm, right=2.5cm]{geometry}  % Margenes de la normativa TFG

\usepackage{setspace} % para que no afecte el interlineado a las notas de pié de página
\usepackage{blindtext}  % para usar un texto-tipo de ejmplo Lore.... sin teclear a boleo, con \blindtext
\setstretch{1.5}

\usepackage{lipsum,blindtext}
\usepackage{hyperref}

\usepackage[x11names]{xcolor}  % otra opcion sería \usepackage{xcolor}
%\usepackage{xcolor}
\usepackage{mathpazo}       % Fuente MathPazo
\usepackage{datetime}       % paquete para configurar formato de fecha y hora
\settimeformat{ampmtime}
\renewcommand*{\noon}{\pmname}

% ----------------------  PSTRICKS ---------------
\usepackage{pstricks}
\usepackage{pst-node}

\begin{document}

\tableofcontents

\part{Introducción General}

\part{Esquema de Funcionamiento}
\blindtext

\section{Búsqueda Tabú (Tabu Search)}
\blindtext
\blindtext
\section{Algoritmos Genéticos}

\part{Ejemplos de Aplicaciones Simples}
\blindtext
\section{Búsqueda Tabú (Tabu Search)}
\blindtext
\blindtext
\section{Algoritmos Genéticos}

\part{Análisis de su funcionamiento}

\section{Búsqueda Tabú (Tabu Search)}

\section{Algoritmos Genéticos}

\end{document}


marked as duplicate by jub0bs, Heiko Oberdiek, Masroor, Adam Liter, JesseApr 26 '14 at 15:44

• Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Apr 26 '14 at 10:07
• Perhaps, there are missing \phantomsection statements. And the answer to your question whether there are any packages, that run well, is yes. – user31729 Apr 26 '14 at 10:08
• In addition to my first comment: The .tex file you provided in your dropbox is not working due to some \input statements for files not being available. – user31729 Apr 26 '14 at 12:36
• @christian-hupfer, what is phantomsection for? – Mika Ike Apr 26 '14 at 15:52
• If you set \setstretch{1.5} there is no wonder why you obtain such large vertical distances. – user31729 Apr 26 '14 at 17:03

\section[Section 1]{ Section 1 some Book}\labe{Sec-1}

\usepackage[pdftex=true,colorlinks=true,plainpages=true]{hyperref} %PDFLaTex