\synctex=1
\documentclass[a4paper,11pt,svgnames]{book}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{thesis}
\usepackage{calc}
\usepackage{float}
\usepackage{acronym}
\usepackage{siunitx}
\usepackage{eurosym}
\usepackage[titletoc]{appendix}
% \setlength{\marginparwidth}{2cm}
% \setlength{\voffset}{-0.25in}
\setlength{\parskip}{0.1in}
% \usepackage{draftwatermark}
% \SetWatermarkScale{4}
\usepackage{subfig}
\usepackage{listings}
\usepackage{courier}
\usepackage{enumitem}
% \usepackage{indentfirst}
\lstset{
    basicstyle=\footnotesize\ttfamily,
    numbers=none,               % Ort der Zeilennummern
    numberstyle=\tiny,          % Stil der Zeilennummern
    % stepnumber=2,               % Abstand zwischen den Zeilennummern
    numbersep=5pt,              % Abstand der Nummern zum Text
    tabsize=2,                  % Groesse von Tabs
    extendedchars=true,         %
    breaklines=true,            % Zeilen werden Umgebrochen
    % keywordstyle=\color{red},
    frame=single,         
    % keywordstyle=[1]\textbf,    % Stil der Keywords
    % keywordstyle=[2]\textbf,    %
    % keywordstyle=[3]\textbf,    %
    % keywordstyle=[4]\textbf,   \sqrt{\sqrt{}} %
    % stringstyle=\color{white}\ttfamily, % Farbe der String
    showspaces=false,           % Leerzeichen anzeigen ?
    showtabs=false,             % Tabs anzeigen ?
    belowcaptionskip=12pt,
    xleftmargin=2em, 
    xrightmargin=4pt,
    % backgroundcolor=\color{lightgray},
    showstringspaces=false,      % Leerzeichen in Strings anzeigen ?  
    aboveskip=5pt,
    belowskip=10pt
 }
 
 \lstloadlanguages{% Check Dokumentation for further languages ...
    % [Visual]Basic
    % Pascal
    % C
    % C++
    % XML
    % HP
    Java
 }
 
% \usepackage{xcolor}
\usepackage[usenames,dvipsnames,table]{xcolor}
\colorlet{punct}{red!60!black}
\definecolor{background}{HTML}{FFFFFF}
\definecolor{delim}{RGB}{20,105,176}
\colorlet{numb}{magenta!60!black}
\lstdefinelanguage{json}{
    basicstyle=\scriptsize\ttfamily,
    numbers=none,
    numberstyle=\scriptsize,
    stepnumber=1,
    numbersep=4pt,
    showstringspaces=false,
    breaklines=true,
    frame=lrtb,
    backgroundcolor=\color{background},
    literate=
     *{0}{{{\color{numb}0}}}{1}
      {1}{{{\color{numb}1}}}{1}
      {2}{{{\color{numb}2}}}{1}
      {3}{{{\color{numb}3}}}{1}
      {4}{{{\color{numb}4}}}{1}
      {5}{{{\color{numb}5}}}{1}
      {6}{{{\color{numb}6}}}{1}
      {7}{{{\color{numb}7}}}{1}
      {8}{{{\color{numb}8}}}{1}
      {9}{{{\color{numb}9}}}{1}
      {:}{{{\color{punct}{:}}}}{1}
      {,}{{{\color{punct}{,}}}}{1}
      {\{}{{{\color{delim}{\{}}}}{1}
      {\}}{{{\color{delim}{\}}}}}{1}
      {[}{{{\color{delim}{[}}}}{1}
      {]}{{{\color{delim}{]}}}}{1},
}
% \DeclareCaptionFont{blue}{\color{blue}} 
% \captionsetup[lstlisting]{singlelinecheck=false, labelfont={blue}, textfont={blue}}
\usepackage{caption}
% \DeclareCaptionFont{white}{\color{white}}
% \DeclareCaptionFormat{listing}{\colorbox[HTML]{6DBAFF}{\parbox{\textwidth}{\hspace{5pt}#1#2#3}}}
\DeclareCaptionFont{white}{\color{white}}
\captionsetup[lstlisting]{singlelinecheck=false, margin=0pt, box=colorbox, boxcolor=gray, font={color=white, bf, footnotesize}}
% \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth-20pt}{#1#2#3}}\vspace{0.01cm}}
% \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
\usepackage{url}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{verbatim}
\usepackage[section]{placeins}
\usepackage{listings}
% \usepackage[spanish]{babel}
% \usepackage[T1]{fontenc}
% \usepackage[usenames,dvipsnames,table]{xcolor}
% \bibliographystyle{unsrt}
\newcommand{\authorname}{NOMBRE DEL AUTOR}
\newcommand{\tfgtitle}{FULL TITLE OF THE THESIS}
\newcommand{\tfgtitlees}{TÍTULO COMPLETO DEL TFG}
\newcommand{\supervisor}{TUTOR}
\newcommand{\fecha}{Junio 2018}
\usepackage[pdftex,
    pdfauthor={\authorname},
    pdftitle={\tfgtitle},
    pdfsubject={Bachelor Final Project},
    pdfkeywords={GSI},
    pdfproducer={PDFTex},
    colorlinks=true,linkcolor=black,citecolor=black,urlcolor=black,hypertexnames=false]{hyperref}
% \usepackage{longtable}
\setcounter{secnumdepth}{3}
\usepackage{framed}
% lstlisting
\usepackage{listings}
\lstdefinelanguage{JavaScript}{
    keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break},
    keywordstyle=\color{blue}\bfseries,
    ndkeywords={class, export, boolean, throw, implements, import, this},
    ndkeywordstyle=\color{darkgray}\bfseries,
    identifierstyle=\color{black},
    sensitive=false,
    comment=[l]{//},
    morecomment=[s]{/*}{*/},
    commentstyle=\color{purple}\ttfamily,
    stringstyle=\color{red}\ttfamily,
    morestring=[b]',
    morestring=[b]"
}
\lstdefinelanguage{yaml}{
  keywords={true, false, null, y, n},
  keywordstyle=\color{darkgray}\bfseries,
  sensitive=false,
  comment=[l]{\#},
  morecomment=[s]{/*}{*/},
  commentstyle=\color{purple}\ttfamily,
  stringstyle=\color{red}\ttfamily,
  moredelim=[l][\color{orange}]{\&},
  moredelim=[l][\color{magenta}]{*},
  % moredelim=**[il][\color{black}\mdseries{:}\color{black}]{:},   % switch to value style at :
  morestring=[b]',
  morestring=[b]",
  literate =    {---}{{\llap{\color{cyan}\mdseries-{-}-}}}3
                {>}{{\textcolor{red}\textgreater}}1     
                {|}{{\textcolor{red}\textbar}}1 
                {\ -\ }{{\mdseries\ -\ }}3,
}
\definecolor{darkblue}{rgb}{0.0,0.0,0.6}
\lstdefinestyle{listXML}{
    language=XML, basicstyle=\ttfamily\diny, extendedchars=true,  belowcaptionskip=5pt,xleftmargin=0.4em, xrightmargin=0.3em, numbers=none, frame=single, breaklines=true, breakatwhitespace=true, breakindent=0pt, emph={}, emphstyle=\color{red}, basicstyle=\small\ttfamily, columns=fullflexible, showstringspaces=false, commentstyle=\color{gray}\upshape,
    morestring=[b]",
    morecomment=[s]{<?}{?>},
    morecomment=[s][\color{orange}]{<!--}{-->},
    keywordstyle=\color{cyan},
    stringstyle=\color{black},
    tagstyle=\color{darkblue},
    morekeywords={xmlns,version,type}
}
\lstdefinestyle{mono}{
    framesep=8px,
    extendedchars=true,
    basicstyle=\ttfamily,
    showstringspaces=false,
    showspaces=false,
    tabsize=2,
    breaklines=true,
    showtabs=false,
    xleftmargin=8pt,
    xrightmargin=8pt
}
\lstdefinestyle{commands}{
    framesep=8px,
    extendedchars=true,
    basicstyle=\ttfamily,
    showstringspaces=false,
    showspaces=false,
    tabsize=2,
    breaklines=true,
    showtabs=false,
    xleftmargin=8pt,
    xrightmargin=8pt
}
\lstdefinestyle{consola}{
    basicstyle=\scriptsize\ttfamily,
    backgroundcolor=\color{white},
    frame=lrtb,
    numbers=none,
    xleftmargin=4pt,
    xrightmargin=4pt
}
% Allows to change the color of chapter headers
\definecolor{chapterdetails}{HTML}{00a9e0}
% \usepackage[sf,bf]{titlesec}
% \titleformat{\chapter}[display]
%   {\normalfont\Large\sffamily\raggedleft}
%   {\vspace{5cm}\MakeUppercase{\chaptertitlename}%
%     \rlap{ \resizebox{!}{1.5cm}{\thechapter} \color{chapterdetails}\rule{5cm}{1.5cm}}}
%   {10pt}{\Huge}[{\color{chapterdetails}\titlerule[0.8mm] }]
% \titlespacing*{\chapter}{0pt}{30pt}{20pt}
\usepackage[sf,bf]{titlesec}
\titleformat{\chapter}[display]
  {\normalfont\Large\sffamily\raggedleft}
  {\vspace{5cm}\MakeUppercase{\chaptertitlename}%
    \rlap{ \resizebox{!}{1.5cm}{\thechapter} \color{chapterdetails}\rule{5cm}{1.5cm}}}
  {10pt}{\Huge}[{\color{chapterdetails}\titlerule[0.8mm] }]
\titlespacing*{\chapter}{0pt}{30pt}{20pt}
\titlespacing*{\section}{0pt}{20pt}{10pt}
% \titleformat{\section}{\large\sffamily\bfseries}{\thesection}{1em}{}
\newenvironment{chapterintro}
{% This is the begin code
\large\it
}
{% This is the end code
}
% Tick symbols
% \newcommand{\tickYes}{\checkmark}
% \newcommand{\tickNo}{\hspace{1pt}\ding{55}}
\usepackage{pifont} % http://ctan.org/pkg/pifont
\newcommand{\tickYes}{\ding{51}}
\newcommand{\tickNo}{\ding{55}}
% Fancy header
\usepackage{fancyhdr}
% Fancy chapter cover style
% Fancy box
\usepackage{fancybox} 
\setlength{\fboxrule}{1pt} 
\setlength{\fboxsep}{10pt} 
\setlength{\shadowsize}{3pt}
% Sky color definition
% Portada
\usepackage{eso-pic,graphicx}
% \usepackage{tikz}
% \usepackage[top=0cm, bottom=0cm, outer=0cm, inner=0cm]{geometry}
\begin{document}
\newcommand\litem[1]{\item{\bfseries #1 }}
\renewcommand{\arraystretch}{1.5} % Makes tables less crammed
\newcommand\headcell[1]{
  \multicolumn{1}{|c|}{\cellcolor{DodgerBlue}\bfseries\sffamily\textcolor{white}{#1}}
}
% Cuadros por tablas
% \renewcommand{\listtablename}{Tables Index}
% \renewcommand{\tablename}{Table} 
% \renewcommand{•}{•}*{\lstlistingname}{List of X}
% Acronyms Definition
\acrodef{gsi}[GSI]{Grupo de Sistemas Inteligentes}
\pagenumbering{gobble}
\include{0-preamble}
\pagenumbering{Roman}
\include{A-resumen}
\include{B-abstract}
\include{C-agradecimientos}
% \include{D-acknowledgement} % Not to include
\include{E-contents}
% Header style
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RO]{\sffamily \slshape \rightmark}
\fancyhead[LE]{\sffamily \slshape \leftmark}
% \renewcommand{\footrulewidth}{0.4pt} % grosor de la línea del pie
\fancyfoot[OR,EL]{\rmfamily \thepage} % texto derecha del pie
\pagenumbering{arabic}
\include{1-introduction}
\include{2-enablingtechnologies}
\include{3-requirements}
\include{4-architecture}
\include{5-case-study}
\include{6-conclusions}
\cleardoublepage
\pagenumbering{roman}
\appendix
\begin{appendices}
    \include{7-impact}
    \include{8-budget}
\end{appendices}
\cleardoublepage
\phantomsection
\nocite{*}
\addcontentsline{toc}{chapter}{Bibliography}   % ieeetr
\bibliographystyle{plain}{
    \small
    \bibliography{biblio/ref}
}
\end{document}