%% STILE DELLE INTESTAZIONI %%

\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}} % aggiungi \thechapter.\ per anche il numero capitolo
%\renewcommand{\sectionmark}[1]{\markright{#1}} % titoli di sezione
\fancyhf{}
\fancyhead[RE,RO]{\small\thepage}
\fancyhead[LE,LO]{\small\em\leftmark} % \leftmark = 2.TitoloCapitolo, \rightmark = TitoloSezione
%\fancyhead[LO]{\small\em\rightmark}  % LO = Left Odd, RO = Right Odd, LE = Left Even, RE = Right Even
\fancypagestyle{plain}{ % titolo di sezione e simili
	\fancyhf{} % remove everything
	\renewcommand{\headrulewidth}{0pt} % remove lines as well
	\renewcommand{\footrulewidth}{0pt}
}

%% Stile dei titoli di capitolo %%
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 0.7ex \hfill \kern \z@}
\def\@makechapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        %\thickhrulefill
        \par\nobreak \vspace{3\p@}
        {\huge \bfseries \sffamily \strut \thechapter.\ #1}\par\nobreak
        \interlinepenalty\@M
        \hrule
        \vspace*{10\p@}%
    \vskip 30\p@
  }}

\def\@makeschapterhead#1{%
  \vspace*{10\p@}%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        %\thickhrulefill
        \par\nobreak \vspace{3\p@}
        {\huge \bfseries \sffamily \strut #1}\par\nobreak
        \interlinepenalty\@M
        \hrule
        \vspace*{10\p@}%
    \vskip 30\p@
  }}