
\uselanguage{italian}
\languagepath{italian}
\deftranslation[to=italian]{Example}{Esempio.}
%\deftranslation[to=italian]{theorem}{teorema}

\usepackage{beamerthemesplit}

\usetheme{Rochester}
\usecolortheme{beaver}

\usepackage{graphicx}
\usepackage{amsmath}

\usepackage{cancel}

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

\usepackage[italian]{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}



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

%\renewcommand{\boxed}[1]{\textcolor{\boxedcolor}}
  
  
\newcommand{\ptenm}[2]{#1\mbox{-E#2}}
\newcommand{\ptenp}[2]{#1\mbox{+E#2}}
\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{\sgn}{\mbox{sgn}}

\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{\hugensp}{\vspace{-0.7cm}}
\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}
\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{\fns}{\footnotesize}

\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.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}

%\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}


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

%\newtheorem{theorem}{Theorem}[section]
%\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition} % AGGIUNTO 231218
%\newtheorem{corollary}[theorem]{Corollary}
% \newtheorem{remark}[theorem]{Nota}
%\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{commento}{Commento}[section]
\newtheorem{pseudocodice}{Pseudocodice}[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{osservazione}{Osservazione.}[section]
\newtheorem{vuoto}{}[section]
\newtheorem{esempio}{Esempio}[section]
\newtheorem{esercizio}{Esercizio}[section]
\newtheorem{eserciziocasa}{Esercizio per casa}[section]
%\newtheorem{mylemma}[theorem]{Lemma}
%\newtheorem{definizione}[definizione]{Definizione}

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

\renewcommand{\figurename}{Figura}

%\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}


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

%\newtheorem{vuoto_green}{}

\newenvironment<>{vuoto_green}[1][]{%
  \setbeamercolor{block title example}{fg=white,bg=green!75!black}%
  \begin{example}#2[#1]}{\end{example}}
  
\newenvironment<>{vuoto_green2}[1][]{%
  \setbeamercolor{block title example}{fg=white,bg=green!70!black}%
  \begin{pseudocodice}#2[#1]}{\end{pseudocodice}}
  
  
%------------------------------------------------------------------------------------------------------------------------
% 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