%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Classe utilisée pour des nouvelles, romans, etc.
% Auteur : Fred <neryel@rolys.org>
% Vous pouvez modifier et redistribuer ce fichier sous les conditions
% de la GNU General Public License.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Bibliothèques
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NeedsTeXFormat{LaTeX2e}[1998/12/01]
\ProvidesClass{livre}[03/03/05 v0.1 Package facilitant la création
d'une présentation adaptée à une nouvelle ou à un roman]

\LoadClass[10pt,openany]{book}
\RequirePackage{ifthen}
\RequirePackage{fancyhdr}
\RequirePackage[francais]{babel}
\RequirePackage[T1]{fontenc}
\RequirePackage{geometry}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Mise en page 
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Affichage en A4 avec marges raisonnables
\geometry{verbose, a4paper} 
% En-tetes
\pagestyle{fancyplain} 
%En-tete gauche [paire]{impaire}
\lhead[\fancyplain{}{\rm\thepage}]{\fancyplain{}{}}
%En-tete droite
\rhead[\fancyplain{}{}]{\fancyplain{}{\rm\thepage}}
%En-tete centre
\chead[\fancyplain{}{\sl \@title}]
{\fancyplain{}{\sl {\@title}}}
%Pied de page
\cfoot{\fancyplain{}{}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% (re)définition de commandes
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Ligne horizontale
\newcommand{\HRule}{\rule{\linewidth}{1mm}}

\newcommand{\subtitleval}{}
\newcommand{\subtitle}[1]
{\renewcommand{\subtitleval}{#1}}

\newcommand{\fromval}{}
\newcommand{\from}[1]
{\renewcommand{\fromval}{#1}}

% Séparateur de paragaphes
\newcommand{\separateur}{
  \paragraph{}
  \begin{center}
    *****
  \end{center}
  \paragraph{}
}

% Titre
\renewcommand{\maketitle}{
  \thispagestyle{empty}
  \vspace*{\stretch{1}}
  \HRule
  \begin{flushright}
    {\large \@author \\[5mm]}
    {\Huge \@title   \\[5mm]}
    {\huge \subtitleval   \\[5mm]}
    {\large \fromval \\[5mm]}
  \end{flushright}
  
  \HRule

  \vspace*{\stretch{2}}

                                
                                %\vspace*{\stretch{1}}
  
                                %\vspace*{\stretch{1}}
                                %\HRule
                                %\begin{center}
                                %  Texte en bas
                                %\end{center}
}
\newpage
