

\usepackage{beamerthemesplit}


\useinnertheme[shadow=true]{rounded}
\PassOptionsToPackage{height=0.8cm}{beamerouterthemesidebar}

% ..... THEME .....
\usetheme{Rochester}
\setbeamertemplate{blocks}[rounded][shadow=false]

% ..... COLORS .....
\definecolor{bluegreen}{rgb}{3, 166, 155}
\definecolor{pitchblack}{rgb}{0, 0, 0}
\definecolor{lightbeige}{rgb}{255, 251, 241}
\definecolor{mediumgray}{rgb}{211, 211, 211}
\definecolor{mycolor}{RGB}{8,232,222}
\definecolor{mycolor2}{RGB}{64,224,208}
\definecolor{mycolor3}{RGB}{0,107,90}
\definecolor{dark-green}{RGB}{0,100,0}
\definecolor{blumagenta}{RGB}{150,41,214}

% ..... COLOR SETTINGS .....
\setbeamercolor {structure}{fg=mycolor3}
\setbeamercolor{background canvas}{bg=white}
\setbeamercolor{title}{bg=mycolor2,fg=black}
\setbeamercolor{normal text}{fg=black}
\setbeamercolor{frametitle}{bg=mycolor2, fg=black}
\setbeamercolor*{palette primary}{bg=mycolor2}
\setbeamercolor*{palette secondary}{bg=mycolor2}



% ..... FONT SETTINGS .....
 \usepackage{gillius}
%\usepackage{fontspec}
%\setmainfont{Hoefler Text}
% shape=\scshape
\setbeamerfont*{frametitle}{family=\sffamily, size=\normalsize}
\setbeamerfont{title}{family=\sffamily}
\setbeamercolor{subsection in head/foot}{bg=mycolor2}




% ... FOOTLINE ..

% WORKING WELL
%\setbeamertemplate{footline}
%    {\begin{beamercolorbox}[sep=1ex]{author in head/foot}
%      \rlap{\textit{}}\hfill\llap{\insertframenumber}%
%      \end{beamercolorbox}%
%}

% LINE WITH NUMBER
%\newcommand{\footlinetext}{}
%\setbeamertemplate{footline}{
%\vskip5pt\color{mycolor}\rule{\textwidth}{0.0pt}\\ % horizontal line
%\vskip2pt
%\makebox[123mm]{\hspace{8.5mm}
%\color{black}\footlinetext
%\hfill \raisebox{1pt}
%\hfill \insertframenumber}
%\vskip4pt
%}


% GOOD: ONLY NUMBERS
%\setbeamertemplate{footline}{
%    \usebeamerfont{footline}%
%    \usebeamercolor[mycolor3]%{footline}%
%    \hspace{1em}%
%    \hfill \insertframenumber/%\inserttotalframenumber \hspace{1em}
%    \vspace{1em}
%}


\setbeamertemplate{footline}{%
\raisebox{5pt}{\makebox[\paperwidth]{\hfill\makebox[20pt]{\color{gray}
      \scriptsize\insertframenumber /\inserttotalframenumber \hspace{0.5cm} \vspace{1cm}}}}\hspace*{5pt}}
      





\setbeamertemplate{items}[square] 


\usepackage{graphicx}
\usepackage{amsmath}

\usepackage{cancel}

%------------------------------------------------------------------------------------------------------------------------
% USEPACKAGE.
%------------------------------------------------------------------------------------------------------------------------

\usepackage[english]{babel}
\usepackage{graphicx,psfrag,color,pst-grad}
\usepackage{latexsym}
\usepackage{psboxit,pstricks}
\usepackage{fancyhdr}
\usepackage{fancyvrb}

\usepackage{float}
\floatstyle{ruled}
\newfloat{program}{thp}{lop}
\floatname{program}{Codice}
\pdfpagewidth 8.5in
\pdfpageheight 11in

\usepackage{calc}
\usepackage{multicol}

\usepackage{listings}
\usepackage{color}
\usepackage{textcomp}
\usepackage{tcolorbox}
\usepackage{url}


%------------------------------------------------------------------------------------------------------------------------
% NEW COMMAND.
%------------------------------------------------------------------------------------------------------------------------

% \renewcommand{\boxed}[1]{\textcolor{\boxedcolor}}
  
  
\newcommand{\ptenm}[2]{#1\mbox{-E#2}}
\newcommand{\ptenp}[2]{#1\mbox{+E#2}}
\newcommand{\dlacc}{``}
\newcommand{\mye}{\`e }
\newcommand{\myer}{\'e }
\newcommand{\myu}{\`u }
\newcommand{\myur}{\'u }
\newcommand{\mya}{\`a }
\newcommand{\myo}{\`o }
\newcommand{\myod}{\'o }
\newcommand{\myi}{\`i }
\newcommand{\myid}{\'i }
\newcommand{\myesh}{\`e}
\newcommand{\myersh}{\'e}
\newcommand{\myush}{\`u}
\newcommand{\myursh}{\'u}
\newcommand{\myash}{\`a}
\newcommand{\myosh}{\`o}
\newcommand{\myodsh}{\'o}
\newcommand{\myish}{\`i}
\newcommand{\myidsh}{\'i}
\newcommand{\myse}{\mbox{ se }}
\newcommand{\mypo}{\mbox{ per ogni }}


\newcommand{\myra}{\rightarrow}

\newcommand{\myfl}{\mbox{fl}}
\newcommand{\smsp}{\vspace{0.2cm}}
\newcommand{\smhsp}{\hspace{0.2cm}}
\newcommand{\bighsp}{\hspace{0.5cm}}
\newcommand{\smnsp}{\vspace{-0.2cm}}
\newcommand{\smsmnsp}{\vspace{-0.4cm}}
\newcommand{\bignsp}{\vspace{-0.5cm}}
\newcommand{\sen}{\sin}
\newcommand{\thsp}{\vspace{0.1cm}}
\newcommand{\thnsp}{\vspace{-0.1cm}}
\newcommand{\Rset}{\mathbb{R}}
\newcommand{\bs}{\boldsymbol}
\newcommand{\mylbar}{|}
\newcommand{\myrbar}{|}
\newcommand{\nin}{\noindent}

\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{light-gray}{gray}{0.90}
\definecolor{floralwhite}{rgb}{1.0, 0.98, 0.94}
\definecolor{dkgreen}{rgb}{0,0.3,0}
\definecolor{seagreen}{rgb}{0.18,0.54,0.34}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\definecolor{teal}{rgb}{0,0.5,0.5}

\newcommand{\reds}{\color{red}}
\newcommand{\cyans}{\color{cyan}}
\newcommand{\blues}{\color{blue}}
\newcommand{\purples}{\color{purple}}
\newcommand{\greens}{\color{green}}
\newcommand{\blacks}{\color{black}}
\newcommand{\magentas}{\color{magenta}}
\newcommand{\mauves}{\color{mauve}}
\newcommand{\dkgreens}{\color{dkgreen}}
\newcommand{\teals}{\color{teal}}
\newcommand{\fns}{\footnotesize}



%\pagestyle{fancy}
%\headheight 35pt
%\rhead{}
%\chead{}
%\lhead{}
%\rfoot{}
%\cfoot{\thepage}
%\lfoot{}

\setbeamercolor{block title}{parent=date in head/foot,fg=white} % Titre des blocs comme les blocs du bas, droite
\setbeamercolor{block body}{bg=structure!15} % Couleur de fond des blocs
\setbeamercolor{uppercolgreen}{fg=white,bg=green!35}
\setbeamercolor{lowercolgreen}{fg=black,bg=green!20}
\setbeamercolor{lowercolblue}{fg=black,bg=blue!20}
\setbeamercolor{verdemio}{fg=black,bg=green}
\setbeamercolor{bgcolor}{fg=black,bg=yellow}
\setbeamercolor{rosso}{fg=black,bg=red}

\newcommand{\bl}{\begin{lstlisting}}
\newcommand{\el}{\end{lstlisting}}

\newcommand{\bc}{\begin{center}}
\newcommand{\ec}{\end{center}}

\newcommand{\bit}{\begin{itemize}}
\newcommand{\eit}{\end{itemize}}

\newcommand{\ben}{\begin{enumerate}}
\newcommand{\een}{\end{enumerate}}

\newcommand{\bea}{\begin{eqnarray}}
\newcommand{\eea}{\end{eqnarray}}


\newcommand{\bbcb}{\begin{beamercolorbox}{verdemio}}
\newcommand{\ebcb}{\end{beamercolorbox}}

\newcommand{\bbcbr}{\begin{beamercolorbox}{rosso}}
\newcommand{\ebcbr}{\end{beamercolorbox}}

\newcommand{\ma}{{\sc Matlab }}
\newcommand{\mass}{{\sc Matlab}}
\newcommand{\mo}{{\sc Matlab/Octave }}
\newcommand{\monb}{{\sc Matlab/Octave}}
\newcommand{\oc}{{\sc Octave }}
\newcommand{\ocnb}{{\sc Octave}}
\newtheorem{Esercizio1}{Esercizio 1}
\newtheorem{Esercizio2}{Esercizio 2}
\newcommand{\ntt}{\color{blue} \tt}

\newenvironment{bcb}
    {\begin{center} \begin{beamercolorbox}{verdemio}}
   { \end{beamercolorbox} \end{center}}
    


%------------------------------------------------------------------------------------------------------------------------
% NEW teorema.
%------------------------------------------------------------------------------------------------------------------------

%\newtheorem{theorem}{Theorem}[section]
%\newtheorem{lemma}[theorem]{Lemma}
%\newtheorem{proposition}[theorem]{Proposition}
%\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{remark}[theorem]{Remark}
%\newenvironment{proof}[1][Proof]{\begin{trivlist}
%\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
%\newenvironment{definition}[1][Definition:]{\begin{trivlist}
%\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
%\newenvironment{example}[1][Esempio]{\begin{trivlist}
%\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
%\newenvironment{remark}[1][Nota]{\begin{trivlist}
%\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}remark	
%\newenvironment{teorema}[1][]{\begin{trivlist}
%\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
%\newenvironment{definizione}[1][]{\begin{trivlist}
%\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\newtheorem{teorema}{Teorema}[section]
\newtheorem{corollario}{Corollario}[section]
\newtheorem{definizione}{Definizione}[section]
\newtheorem{dimostrazione}{Dimostrazione.}[section]
\newtheorem{nota}{Nota.}[section]
\newtheorem{metodo}{Metodo}[section]
\newtheorem{facoltativo}{Facoltativo.}[section]
\newtheorem{facoltativa}{Dimostrazione facoltativa.}[section]
\newtheorem{svolgimento}{Svolgimento.}[section]
\newtheorem{importante}{Importante.}[section]
\newtheorem{problema}{Problema.}[section]
\newtheorem{notazione}{Notazione.}[section]
\newtheorem{proposizione}{Proposizione.}[section]
\newtheorem{proposito}{Proposito.}[section]
\newtheorem{traccia}{Traccia.}[section]
\newtheorem{vuoto}{}
\newtheorem{esempio}{Esempio}[section]
\newtheorem{esercizio}{Esercizio}[section]
\newtheorem{eserciziocasa}{Esercizio per casa}[section]
\newtheorem{paper}{Paper}
%\newtheorem{mylemma}[theorem]{Lemma}
%\newtheorem{definizione}[definizione]{Definizione}

%------------------------------------------------------------------------------------------------------------------------
% NEW COMMAND.
%------------------------------------------------------------------------------------------------------------------------

\renewcommand{\figurename}{Figure}
%\newcommand{\qed}{\nobreak \ifvmode \relax \else
%     \ifdim\lastskip<1.5em \hskip-\lastskip
%    \hskip1.5em plus0em minus0.5em \fi \nobreak
% \vrule height0.75em width0.5em depth0.25em\fi}



%------------------------------------------------------------------------------------------------------------------------
% DEF.
%------------------------------------------------------------------------------------------------------------------------

\def\Q{{\mathbb Q}}
\def\P{{\mathbb P}}
\def\n{{\mathcal N}}
\def\R{\mathbb{R}}
\def\N{\mathbb{N}}
\def\Z{\mathbb{Z}}
\def\F{{\mathcal F}}
\newcommand{\LL}{\mathcal L}
\def\C{\mathbb{C}}
\def\K{\mathbb{K}}
\def\T{\mathbb{T}}
\def\qed{\vbox{\hrule height0.6pt\hbox{%
   \vrule height1.3ex width0.6pt\hskip0.8ex
   \vrule width0.6pt}\hrule height0.6pt
  }}





\lstset{
language=Matlab,                % the language of the code
basicstyle=\tiny,       % the size of the fonts that are used for the code
numbers=left,                   % where to put the line-numbers
numberstyle=\small,      % the size of the fonts that are used for the line-numbers
stepnumber=0,                   % the step between two line-numbers. If it's 1, each line
                                % will be numbered
numbersep=5pt,                  % how far the line-numbers are from the code
backgroundcolor=\color{gray!35},  % choose the background color. You must add \usepackage{color}
showspaces=false,               % show spaces adding particular underscores
showstringspaces=false,         % underline spaces within strings
showtabs=false,                 % show tabs within strings adding particular underscores
frame=false,                   % adds a frame around the code
tabsize=2,                      % sets default tabsize to 2 spaces
captionpos=b,                   % sets the caption-position to bottom
breaklines=true,                % sets automatic line breaking
breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace
title=\lstname,                 % show the filename of files included with \lstinputlisting;
                                % also try caption instead of title
escapeinside={\%*}{*)},         % if you want to add a comment within your code
morekeywords={*,...},            % if you want to add more keywords to the set
 identifierstyle=\ttfamily,
keywordstyle=\color[rgb]{0,0,1},
commentstyle=\color[rgb]{0.133,0.545,0.133},
stringstyle=\color[rgb]{0.627,0.126,0.941}
}


%=====================================================================
% EXTRA FEATURES.
%=====================================================================

\hfuzz=10pt
\def\qed{\hfill$\bigtriangleup$}
\def\n{\noindent}
\def\q{\quad}
\def\qq{\qquad}
\def\Bbb{\mathbb}
\def\R{{\Bbb R}}
\def\N{{\Bbb N}}
\def\Z{{\Bbb Z}}
\def\C{{\Bbb C}}
\def\Q{{\Bbb Q}}
\def\th{\vartheta}
\def\e{\varepsilon}
\def\ph{\varphi}
\def\Bbb{\mathbb}
\def\cu{\rightrightarrows}
\def\R{\Bbb R}
\def\proclaim{\begin{Theorem}}
\def\endproclaim{\end{Theorem}}
\def\bac{\backslash}
\def\dim{\demo{Dimostrazione} }
\def\N{\Bbb N}
\def\var{\varepsilon}
\def\succ{(a_n)_{n\in\N}}
\def\sucf{(f_n)_{n\in\N}}
\def\cu{\rightrightarrows}
\def\ov{\overline}
\def\demo{\bigskip}
\def\enddemo{\bigskip}
\def\intE{E\!\!\!{\raise2.8mm\hbox{$\scriptscriptstyle \circ$}}}
\newcommand{\displayfrac}[2]{\frac{\displaystyle #1}{\displaystyle #2}}
%\newtheorem{Theorem}{Teorema}
\newtheorem{Proposition}{Proposizione}
%\newtheorem{Definition}{Definizione}
%\newtheorem{Corollary}{Corollario}
\font\extgrass=cmbx10 scaled \magstep3
\font\medgrass=cmbx10 scaled \magstep2
\font\roman=cmr10 scaled \magstep1
\font\piccolo=cmr8
% \font\ciccio=cmbx14 scaled \magstep4


\setlength{\tabcolsep}{2.5pt}
\setbeamertemplate{navigation symbols}{} %no nav symbols

\tcbset{colback=gray!1!white,colframe=gray!25!gray}