\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{uniudtesi}[2003/02/06  Redefines maketitle for University of Udine Thesis and changes oddsidemargin and evensidemargins for easier thesis binding; needs graphics file polloPallido; written by Gianluca Gorni]
\RequirePackage{ifthen}
\RequirePackage{graphicx}

\newcommand{\@facolta}{Facolt\`a di Scienze Matematiche,
    Fisiche e Naturali}
\newcommand{\@corsodilaurea}{?}
\newcommand{\@titolo}{Senza Titolo}
\newcommand{\@annoaccademico}{?}
\newcommand{\@relatore}{?}
\newcommand{\@correlatore}{?}
\newcommand{\@laureando}{?}
\newcommand{\@laureanda}{?}
\newcommand{\@dedica}{?}

\newcommand{\facolta}[1]{%
  \renewcommand{\@facolta}{#1}}
\newcommand{\corsodilaurea}[1]{%
  \renewcommand{\@corsodilaurea}{#1}}
\newcommand{\titolo}[1]{%
  \renewcommand{\@titolo}{\uppercase{#1}}}
\newcommand{\annoaccademico}[1]{%
  \renewcommand{\@annoaccademico}{#1}}
\newcommand{\relatore}[2][Prof.]{%
  \renewcommand{\@relatore}{#1 \uppercase{#2}}}
\newcommand{\correlatore}[2][Prof.]{%
  \renewcommand{\@correlatore}{#1 \uppercase{#2}}}
\newcommand{\laureando}[1]{%
  \renewcommand{\@laureando}{\uppercase{#1}}}
\newcommand{\laureanda}[1]{%
  \renewcommand{\@laureanda}{\uppercase{#1}}}
\newcommand{\dedica}[1]{%
  \renewcommand{\@dedica}{#1}}

\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}%
  \cleardoublepage}}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %                                   %
    %  Formattazione dell'intestazione  %
    %  della tesi                       %
    %                                   %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\renewcommand\maketitle{\begin{titlepage}
  \begin{sffamily}
  \begin{center}
    \vbox to0pt{%
    \vbox to\textheight{\vfil
    \includegraphics[width=\textwidth]{polloPallido}%
    \vfil}\vss}
  \end{center}
  \begin{center}
  \begin{Large}
    \uppercase{Universit\`a degli Studi di Udine}
    \end{Large}\\
  \rule{9cm}{.4pt}\\
  \smallskip
  \begin{large}
  \uppercase{\@facolta}\\
  \medskip
  Corso di Laurea in \@corsodilaurea\\
  \bigskip\vfill
  \begin{Large} Tesi di Laurea\end{Large}\\
  \bigskip
  \bigskip
  {\setlength{\baselineskip}{1.5\baselineskip}
  \vfil
    \begin{Huge}
      \@titolo
    \end{Huge}\\
  }
  \bigskip\vfill
  \begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}l}
    Relatore:&\ifthenelse{\equal{\@laureanda}{?}}%
      {Laureando:}{Laureanda:}\\
    \@relatore&\ifthenelse{\equal{\@laureanda}{?}}%
      {\@laureando}{\@laureanda}%
    \ifthenelse{\equal{\@correlatore}{?}}{}%
    {\\ \\ Correlatore:&\\ \@correlatore&}
  \end{tabular*}\\
  \vfill
  \rule{9cm}{.4pt}\\
  \medskip
  \uppercase{Anno Accademico \@annoaccademico}\\
  \end{large}
  \end{center}
\end{sffamily}
\clearemptydoublepage
\ifthenelse{\equal{\@dedica}{?}}{}{%
\pagestyle{empty}
  \null\vfil
  \begin{Large}
  \begin{flushright}
    \@dedica
  \end{flushright}
  \end{Large}
  \vfil\vfil\clearemptydoublepage}
\end{titlepage}}

         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
         %  Per facilitare la rilegatura della tesi %
         %  si cambiano qui i valori dei margini    %
         %  della pagina                            %
         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ifthenelse{\boolean{@twoside}}%
  {\setlength{\oddsidemargin}{1.00in}%
   \setlength{\evensidemargin}{-0.15in}}%
  {\setlength{\oddsidemargin}{1.00in}%
   \setlength{\evensidemargin}{1.00in}}

\endinput