%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                       Classe ortolocv.cls                            %
%                       Tanguy Ortolo, nov. 2006                       %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%                          Identification                              %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ortolocv}[2006/11/06]


%                             Options                                  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareOption{noaddress}{\def\theaddress{}}
\DeclareOption{notelephone}{\def\thetelephone{}}
\ProcessOptions


%                           Basé sur...                                %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\LoadClassWithOptions{article}
\RequirePackage[top=2cm, bottom=2cm, left=3cm, right=3cm]{geometry}
\RequirePackage{graphicx}
%\RequirePackage{desclist}
\RequirePackage{titlesec}
 \titleformat{\section}{\normalfont\large\bfseries}{\thesection}{1em}{}[\titlerule]

\pagestyle{empty}


%                        Paramètres réglables                          %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newlength{\cvlistindent}
\setlength{\cvlistindent}{3cm}


%                       Paramètres utilisateur                         %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand*{\name}[1]{\def\thename{#1 \\}}
\newcommand*{\address}[1]{\providecommand\theaddress{#1 \\[.5em]}}
\newcommand*{\telephone}[1]{\providecommand\thetelephone{#1 \\}}

\newcommand*{\mobile}[1]{\def\themobile{Mobile: #1 \\}}
 \def\themobile{}

\newcommand*{\email}[1]{\def\theemail{#1 \\}}
 \def\theemail{}

\newcommand*{\website}[1]{\def\thewebsite{#1 \\}}
 \def\thewebsite{}

\newcommand*{\birth}[1]{\def\thebirth{#1 \\[.5em]}}
 \def\thebirth{}

\newcommand*{\nationality}[1]{\def\thenationality{#1 \\}}
 \def\thenationality{}

\newcommand*{\photo}[1]
{
 \def\thephoto%
 {%
  \parbox{10em}{\hfill\includegraphics[height=10em]{#1}}%
 }
}
 \def\thephoto{}

\renewcommand*{\title}[1]{\def\thetitle{\vspace*{2em}\centerline{\LARGE\bfseries #1}}}
 \def\thetitle{}


%                    Commandes et environnements                       %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{cv}[1]
{
 \newpage
 \setcounter{page}{0}
}
{}

\newcommand{\head}
{
 \noindent
 \begin{minipage}{11cm}
 \begin{minipage}[t]{5.9cm}
  \thename
  \theaddress
  \thebirth
  \thenationality
 \end{minipage}
 \begin{minipage}[t]{5cm}
  \thetelephone
  \themobile
  \textsf{\theemail}
  \thewebsite
 \end{minipage}
 \end{minipage}
 \hfill
 \thephoto
 \par \thetitle
}

%\newenvironment{cvlist}
%{\begin{desclist}{\bfseries}{\normalfont}[\hspace{\cvlistindent}]}
%{\end{desclist}}

% Pompé sur desclist.sty, et modifié un peu.
\newenvironment{cvlist}
{
 \list{}
 {
  \setlength{\leftmargin}{\cvlistindent}
  \itemsep0pt
  \advance\leftmargin\labelsep
  \labelwidth=\leftmargin
  \itemindent\z@
  \def\makelabel##1{\hspace\labelsep\normalfont\bfseries ##1\hfil}
 }
}
{\endlist}
