%%
%% cv.cls
%%
%% Quelques macros pour simplifier la redaction d'un CV
%%
%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{cv}
\RequirePackage{array}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions
\LoadClass[a4paper]{article}

%%
%% \marges{lageur_du_texte}{hauteur_du_texte}{marge_gauche}{marge_haut}
%%
\newcommand{\marges}[4]{
  \setlength{\textwidth}{#1}
  \setlength{\textheight}{#2}
  \setlength{\oddsidemargin}{#3}
    \addtolength{\oddsidemargin}{-2.5cm}
  \setlength{\topmargin}{#4}
    \addtolength{\topmargin}{-2.5cm}
  \setlength{\headheight}{0cm}
  \setlength{\headsep}{0cm}

  \newlength{\cvitwl}
    \setlength{\cvitwl}{3.2cm}
  \newlength{\cvitwr}
    \setlength{\cvitwr}{\textwidth}
      \addtolength{\cvitwr}{-1\cvitwl}
      \addtolength{\cvitwr}{-2\tabcolsep}

  \pagestyle{empty}
  \setlength{\parindent}{0cm}
}

%%
%% \header{Nom_prenom}{...}
%%
\newcommand{\header}[2]{
  \textbf{\Large #1} \\
  #2
}

%%
%% \cvtitle{...}
%%
\newcommand{\cvtitle}[1]{
  \vspace{1.5cm}

  \begin{center}
  \textsf{\textbf{\huge #1}}
  \end{center}
  \vspace{1.5cm}

}

%%
%% \cvsectiontitle{Titre_de_la_section}
%%
\newcommand{\cvsectiontitle}[1]{
  \textsf{\textbf{\Large #1}}
  \medskip

}

%%
%% \begin{cvsection}{Titre_de_la_section}
%% \cvitem{...}{...}
%% ...
%% \end{cvsection}
%%
\newenvironment{cvsection}[1]
{ \cvsectiontitle{#1}
  \begin{tabular}{@{}>{\raggedright}p{\cvitwl}p{\cvitwr}@{}}}
{ \end{tabular}
  \medskip
%
}

%%
%% \cvitem{Libellé}{...}
%%
\newcommand{\cvitem}[2]{
  \textit{#1} & #2 \vspace{1mm}\\
}

%%
%% \cvitemst{Libellé}{...}
%%
\newcommand{\cvitemst}[2]{
  \textit{#1} & #2\\
}

\newcommand{\tabitem}[2]{
  \textit{#1}\par #2
  \medskip

}
