\documentclass[12pt,a4paper,spanish,twoside]{book}
%\documentclass[10pt,a4paper,landscape]{report}
\usepackage[spanish]{babel}
%\usepackage[cp850]{inputenc}            %Para que los caracteres especiales los coja de MS-DOS
\usepackage[ansinew]{inputenc}           %Para que los caracteres especiales los coja de Windows
\usepackage{amsmath}
\usepackage{graphicx}             %Para poner gr{\'a}ficos Postcript
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphics}
\usepackage{indentfirst}
\usepackage{enumerate}
\usepackage{fancyhdr}
\usepackage{fancybox}
\usepackage{lastpage}
\usepackage{color}
\usepackage{amsbsy}
\usepackage{theorem}
\usepackage{listings}
\usepackage{titlesec}
%\usepackage{titletoc}

% lo siguiente solo usarlo cuando compilo directamente en pdflatex
% si lo uso compilando en latex el {\'\i}ndice no lo hace bien
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=black, urlcolor=black, citecolor=black}
\hypersetup{bookmarksopen=false, bookmarksnumbered=true} \hypersetup{pdfstartview=FitH}

\setlength{\parskip}{5pt plus 2pt minus 1pt}

\input{Definiciones.tex}

\begin{document}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % presentaci{\'o}n

    \input{Portada.tex}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % visto bueno

    \input{VistoBueno.tex}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % agradecimientos y dedicatoria

    \input{AgradecimientosDedicatoria.tex}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % esta orden es para que no aparezca CAPITULO (n{\'u}mero que sea) junto al t{\'\i}tulo del cap{\'\i}tulo
    % y m{\'a}s cosas

    \frontmatter

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % {\'\i}ndice

    %\renewcommand{\baselinestretch}{1.25}

    \pagenumbering{Roman} \setcounter{page}{1}

    \rhead[]{} \lhead[]{} \cfoot{}

    \tableofcontents
    \clearpage{\thispagestyle{empty}}

    \listoffigures
    \clearpage{\thispagestyle{empty}}

    \listoftables
    \clearpage{\thispagestyle{empty}}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % introducci{\'o}n

    \input{Estilo2.tex}

    \setcounter{chapter}{0}
    \chapter{Introducci{\'o}n}
    \input{Introduccion.tex}
    \clearpage{\thispagestyle{empty}}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % esta orden es para que aparezca de nuevo con el t{\'\i}tulo CAPITULO (n{\'u}mero que sea)

    \mainmatter

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \pagenumbering{arabic} \setcounter{page}{1}

    \input{Estilo1.tex}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Parte1

    \part{Este es el título de la primera parte}

        \chapter{Capítulo 1 de la primera parte}
        \input{texto.tex}
        \clearpage{\thispagestyle{empty}}

        \chapter{Capítulo 2 de la primera parte}
        \input{texto.tex}
        \clearpage{\thispagestyle{empty}}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Parte2

    \part{Este es el título de la segunda parte}

        \chapter{Capítulo 1 de la segunda parte}
        \input{texto.tex}
        \clearpage{\thispagestyle{empty}}

        \chapter{Capítulo 2 de la segunda parte}
        \input{texto.tex}
        \clearpage{\thispagestyle{empty}}


    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Parte3

    \part{Ap{\'e}ndice}

    \appendix

    \rhead[]{Ap{\'e}ndice} \lhead[Ap{\'e}ndice]{}


    \chapter{Programita en MatLab}
    \input{apendice.tex}
    \clearpage{\thispagestyle{empty}}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % bibliograf{\'\i}a

    \input{Estilo2.tex}

    \input{Bibliografia.tex}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}
