%\documentclass[twoside,12pt]{report}

\documentclass[12pt, a4paper, twoside]{book}


\usepackage{amsmath}

\usepackage{fancybox}

\usepackage{fancyhdr}


%\pagestyle{fancyplain}

%\renewcommand{\chaptermark}[1]{\markboth{#1}{}}

%\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}

%\renewcommand{\subsectionmark}[1]{\markright{#1}}

%\lhead[\fancyplain{}{\bfseries\ \thepage}]{\fancyplain{}{\bfseries\
%\rightmark}}

%\rhead[\fancyplain{}{\bfseries\ \leftmark}]{\fancyplain{}{\bfseries\
%\thepage}}
%\cfoot{}



\usepackage[english]{babel}

\usepackage{amsfonts}

\usepackage{verbatim}

\usepackage{multicol}

\usepackage{epsfig}

\usepackage{alltt}

\usepackage{makeidx}

%\usepackage{graphicx}

%\usepackage{amstex}

%\usepackage{amsmath}


\input{prologo}

%\sloppy

\begin{document}

  \newcommand{\oddpage}{\newpage{\pagestyle{empty}\cleardoublepage}}

  \include{titolo}

  \cleardoublepage
  \pagestyle{headings}
  \pagenumbering{roman}
  \setcounter{tocdepth}{7}

  \tableofcontents
  \listoffigures
  \listoftables

  \newpage

% aggiunte per sintesi

  \pagestyle{plain}
  \include{Sintesi}

  \oddpage
% fine aggiunte per sintesi


  \thispagestyle{empty}
  \include{abstract}

  \oddpage
  \pagestyle{plain}
  \pagenumbering{arabic}
  \setcounter{page}{1}
  \include{intro}
  %
  %
  %
  %
  \oddpage
  \pagestyle{fancy}
  %\newcommand{\bnf}{:\,:\,=}
  % with this we ensure that the chapter and section
  % headings are in lowercase.
  \renewcommand{\chaptermark}[1]{\markboth{#1}{}}
  \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}

  \fancyhf{} % delete current setting for header and footer
  \fancyhead[LE,RO]{\bfseries\thepage}
  \fancyhead[LO]{\bfseries\rightmark}
  \fancyhead[RE]{\bfseries\leftmark}

  \renewcommand{\headrulewidth}{0.5pt}
  \renewcommand{\footrulewidth}{0pt}
  \addtolength{\headheight}{0.5pt} % make space for the rule

  \fancypagestyle{plain}{%
     \fancyhead{}        % get rid of headers on plain pages
     \renewcommand{\headrulewidth}{0pt} % and the line
  }


  \oddpage
  \pagestyle{fancy}
  \include{cap1}
  \oddpage
  \pagestyle{fancy}
  \include{cap2bis}
  \oddpage
  \pagestyle{fancy}
  \include{cap2}
  \oddpage
  \pagestyle{fancy}
  \include{cap3}
  \oddpage
  \pagestyle{fancy}
  \include{cap4}
  \oddpage
  \pagestyle{fancy}
  \include{cap5}
  \oddpage
  \pagestyle{fancy}
  \include{conclusioni}

  \appendix


%\include{app_glosI3}
%\include{app1}
%\include{app2}
%\include{app3}
  \oddpage
  \pagestyle{fancy}
  \include{exampleMomis}
  \oddpage
  \pagestyle{fancy}
  \include{appodli3}
  \oddpage
  \pagestyle{fancy}
  \include{links}
%\include{appXMLQL}


\bibliographystyle{unsrt}
\bibliography{tuttoAlain}
\addcontentsline{toc}{chapter}{Bibliography}




\end{document}
