%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Time-stamp: "2001-04-21 17:11:30 calvanes"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Simple style file for D2I Technical Reports
%%% Created by Diego Calvanese <calvanese@dis.uniroma1.it>
%%% Derived from interdata.sty by Luca Cabibbo <cabibbo@dia.uniroma3.it>
%%%         and dwq.sty by Diego Calvanese <calvanese@dis.uniroma1.it>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% NOTE: uses package lastpage
%%% If package lastpage is not available you can delete the line in this file
%%% where it is imported. In this case you will have to provide manually the
%%% number of the last page.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% USAGE:
%%%
%%%   \documentclass[11pt]{article}
%%%   \usepackage{d2i}
%%%
%%% Available commands are
%%%
%%%   \ddiMaketitle : generates titlepage in D2I format
%%%
%%% The following commands can be used to define the values in the titlepage
%%% (the default values are the ones used below):
%%%
%%%   \ddiTitle{}
%%%   \ddiAuthor{}
%%%   \ddiContactAuthor{}
%%%   \ddiTema{}
%%%   \ddiType{}
%%%   \ddiCode{}
%%%   \ddiDate{\oggi}
%%%   \ddiPages{\pageref{LastPage}}
%%%   \ddiMainUnit{}
%%%   \ddiUnits{}
%%%   \ddiAbstract{}
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\filename{d2i.sty}
\def\fileversion{1.0}
\def\filedate{2001/01/30}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{d2i}[\filedate\space\fileversion\space LaTeX2e package]
\typeout{Package: `\filename' (D2I Technical Reports) \fileversion\space
 <\filedate> }
\RequirePackage{lastpage}
%%\AtBeginDocument{\ddiMaketitle} % we do it explicitly, if we need it

%% margini
\textwidth 160mm
\textheight 245mm
\oddsidemargin 0mm
\topmargin -20mm

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Options
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\ddiTitle}[1]{\def\@ddiTitle{#1}\title{#1}}
\newcommand{\ddiAuthor}[1]{\def\@ddiAuthor{#1}%
 \author{\parbox{160mm}{\centering #1}}}
\newcommand{\ddiContactAuthor}[1]{\def\@ddiContactAuthor{#1}}
\newcommand{\ddiTheme}[1]{\def\@ddiTheme{#1}}
\newcommand{\ddiType}[1]{\def\@ddiType{#1}}
\newcommand{\ddiCode}[1]{\def\@ddiCode{#1}}
\newcommand{\ddiDate}[1]{\def\@ddiDate{#1}\date{#1}}
\newcommand{\ddiPages}[1]{\def\@ddiPages{#1}}
\newcommand{\ddiMainUnit}[1]{\def\@ddiMainUnit{#1}}
\newcommand{\ddiUnits}[1]{\def\@ddiUnits{#1}}
\newcommand{\ddiAbstract}[1]{\def\ddiMakeabstract{#1}}

\def\oggi{\number\day\space 
 \ifcase\month\or gennaio\or febbraio\or marzo\or aprile\or maggio\or giugno\or
 luglio\or agosto\or settembre\or ottobre\or novembre\or dicembre\fi
 \space \number\year}

\ddiTitle{}
\ddiAuthor{}
\ddiContactAuthor{}
\ddiTheme{}
\ddiType{}
\ddiCode{}
\ddiDate{\oggi}
\ddiPages{\pageref{LastPage}}
\ddiMainUnit{}
\ddiUnits{}
\ddiAbstract{}

\newcommand{\ddiMaketitle}{ %
  \bibliographystyle{plain}
  %% title page
  \thispagestyle{empty}
  \begin{center}
    \hrule
    \vspace{6mm}
    {\huge{\sc D2I}}\\[1mm]
    {\small \bf Integrazione, Warehousing e Mining di sorgenti eterogenee}\\
    {\small \em
      Programma di ricerca (cofinanziato dal MURST, esercizio 2000)}
    \vspace{6mm}
    \hrule

    \vspace{4mm}

    \setlength{\unitlength}{1mm}
    \begin{picture}(120,50)(0,0)
      \put(60,22){\makebox(0,0)[b]{\parbox{120mm}{
            \Large\bf\begin{center}\@ddiTitle\end{center}
            }}} 
      \put(60,14){\makebox(0,0){\parbox{160mm}{
         \sc\begin{center}\@ddiAuthor\end{center}}}}
      \put(5,0){{\bf\@ddiCode}}
      \put(115,0){\makebox(0,0)[br]{\bf\@ddiDate}}
    \end{picture}\par
  \end{center}
  
  \vspace*{2mm} 

  \begin{center}{\bf Sommario}\end{center} 
  \ddiMakeabstract

  \vspace*{5mm}\vfill
  {\renewcommand{\arraystretch}{1.25}
  \noindent 
  \begin{tabular}{|p{40mm}|p{110mm}|}
    \hline\hline 
    {\bf Tema}                 & \@ddiTheme\\ \hline
    {\bf Codice}               & \@ddiCode\\ \hline
    {\bf Data}                 & \@ddiDate\\ \hline
    {\bf Tipo di prodotto}     & \@ddiType\\ \hline
    {\bf Numero di pagine}     & \@ddiPages\\ \hline
    {\bf Unit\`a responsabile} & \@ddiMainUnit\\ \hline
    {\bf Unit\`a coinvolte}    & \@ddiUnits\\ \hline
    %% {\bf Autori}               &
    %%  \parbox[t]{110mm}{\@ddiAuthor} \vspace*{0pt}\\ \hline
    {\bf Autore da contattare} &
      \parbox[t]{110mm}{\@ddiContactAuthor} \vspace*{3pt} \\
    \hline\hline 
  \end{tabular}}
  \newpage
  \pagenumbering{arabic} % semplicemente resetta il numero di pagina 
}


