%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% One big LaTeX template designed to make letters :
%%     \documentclass[a4paper,12pt,sans]{moderncv}
%%     \usepackage[french]{naereenlettre}
%% with moderncv 2013/04/29 v1.5.1
%% and compiled to PDF with pdfTeX, Version 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian)
%%
%% by Lilian Besson, (C) 2015 - v1.6 (2015/11/22)
%% http://lbesson.bitbucket.org/
%% mailto:Lilian.BESSON[@]ens-cachan[.]fr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Permission is granted to freely use, copy, and distribute
%% without restriction. Permission is also granted to distribute
%% modified versions and incorporate into your own macro packages
%% if a brief acknowledgement is given.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{naereenlettre}[2015/11/22 v1.6 Naereen Letter Package]
\message{<Naereen Letter LaTeX2e Package. Ask to naereen(@)crans(.)org for any problem.>}

%\LoadClassWithOptions{moderncv}
% Last version of moderncv is there
% http://www.ctan.org/tex-archive/macros/latex2e/contrib/moderncv
% Begin with \documentclass[11pt,a4paper,roman]{moderncv}

% moderncv themes
\moderncvtheme{casual}
% style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'

\moderncvcolor{purple}
% optional argument are 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'roman' (for roman fonts, instead of sans serif fonts)

%% Fonts
% to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
\renewcommand{\familydefault}{\rmdefault}
%\renewcommand{\familydefault}{\sfdefault}
%\renewcommand{\familydefault}{\rm}

%\nopagenumbers{}
% uncomment to suppress automatic page numbering for CVs longer than one page

% =============================================================================
% additionnal packages
\RequirePackageWithOptions{babel}
%\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lmodern} % http://ctan.org/pkg/lm
\usepackage{etoolbox} % http://ctan.org/pkg/etoolbox
\usepackage[T1]{fontenc}

\usepackage{fixltx2e} % LaTeX patches, \textsubscript
\usepackage{cmap} % fix search and cut-and-paste in Acrobat

\usepackage{microtype}
% % To disable ligatures
% \DisableLigatures{encoding = *, family = *}

\usepackage{makeidx}
\usepackage[babel=true]{csquotes}

\usepackage{ifthen}
\usepackage{ifpdf}
\usepackage{url}

%% AMS maths and others
\usepackage{amsmath}
%\usepackage[tbtags]{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
%% \usepackage{enumerate,amssymb}
\usepackage{amssymb}

%% FIXME (bottom margin has to be big, that's ugly)
%% \usepackage[scale=0.70]{geometry}
\usepackage[scale=0.78, top=50pt, bottom=130pt]{geometry}
% adjust the page margins
%\geometry{top=longueur, bottom=longueur, left=longueur, right=longueur}

% if you want to change the width of the column with the dates
\setlength{\hintscolumnwidth}{3.2cm}

\usepackage{color}

% Hyperlinks
%\usepackage{hyperref}
%\hypersetup{pdftoolbar=false,pdfmenubar=false,colorlinks,breaklinks,urlcolor=linkcolour, linkcolor=linkcolour}

% Change the color of href links
\definecolor{linkcolour}{HTML}{9800FF}
\newcommand{\uref}[2]{\textcolor{linkcolour}{\href{#1}{#2}}}

% =============================================================================
% personal data
	\title{Lettre de motivation}

%% NEW: a small hack.
%% If Using French
\@ifpackagewith{babel}{french}{
	%% Extra stuff to do if naereencv was loaded with the French option
	\frenchspacing{}
    \newcommand{\personalstatus}[0]{Élève stagiaire normalien à l'ENS Cachan, professeur agrégé en mathématiques}
    \newcommand{\prefixadress}[0]{Adresse~:~~}
	\title{Lettre de motivation}
	%% To print the CV, it is better to remove the lfoot, the lhead, and switch chead to lhead
		%%	\lfoot{\tiny{Compilé avec \uref{http://perso.crans.org/besson/bin/pdflatex}{mon script PDF\LaTeX{}} et efficacement compressé avec \uref{http://perso.crans.org/besson/bin/PDFCompress}{mon script PDFCompress}.}}
		%%	\newcommand{\addfancyhdrfr}[0]{
		%%		\lhead{\tiny{\uref{https://bitbucket.org/lbesson/cv/commits/all}{Version du \today}}}
		%%		\chead{\uref{http://perso.crans.org/besson/cv.fr.pdf}{\textit{Curriculum Vit\ae{}}}}
		%%		\rhead{\uref{http://perso.crans.org/besson/}{Lilian Besson}}
		%%	}
		%%	\addfancyhdrfr{}
	%% Else
}{
	%% Extra stuff to do otherwise (English option or none)
    \newcommand{\personalstatus}[0]{Normalien student et ENS Cachan, professor ``agrégé'' in Mathematics}
    \newcommand{\prefixadress}[0]{Adress:~~}
	\title{Cover letter}
		%%	\lfoot{\tiny{Compiled with \uref{http://perso.crans.org/besson/bin/pdflatex}{my PDF\LaTeX{} wrapper script} and efficiently compressed with \uref{http://perso.crans.org/besson/bin/PDFCompress}{my PDFCompress script}.}}
		%%	\newcommand{\addfancyhdren}[0]{
		%%		\lhead{\tiny{\uref{https://bitbucket.org/lbesson/cv/commits/all}{Last modified: \today}}}
		%%		\chead{\uref{http://perso.crans.org/besson/cv.en.pdf}{\textit{Résumé}}}
		%%		\rhead{\uref{http://perso.crans.org/besson/}{Lilian Besson}}
		%%	}
		%%	\addfancyhdrfr{}
%% EndIf
}
%%% \name{Lilian}{Besson (VIE \#56214)}
	\name{Lilian}{Besson}

    \address{\emph{\personalstatus}\newline}{\prefixadress\href{https://www.openstreetmap.org/?mlat=48.79075&mlon=2.32833\#map=19/48.79075/2.32833}{Studio G.532 -- $62$,~rue~Camille~Desmoulins}}{$94230$~Cachan, France}

%	\phone[fixed]{+2~(345)~678~901}
%	\phone[fax]{+3~(456)~789~012}
	\phone[mobile]{+33~6~28~41~22~57}

%%	\homepage{lbesson.bitbucket.org}
%%	\homepage{perso.crans.org/besson}
%%	\homepage{www.dptinfo.ens-cachan.fr/~lbesson//}
	\homepage{perso.crans.org/besson}

%%  \email{Lilian.BESSON＠ens-cachan.fr} %% ＠ or @
    \email{Lilian.BESSON@ens-cachan.fr} %% ＠ or @
    % \email{Lilian.Besson at ens-cachan dot fr}

%%	\photo[64pt][0.4pt]{LilianBesson}
%	\photo[64pt]{LilianBesson}

%%  \social[twitter]{naereen}
%%  \social[linkedin]{lilian.besson}
    \social[github]{Naereen}
%%  \social[facebook]{naereencorp.lbesson} % FIXME
%%  \social[bitbucket]{lbesson} % FIXME

\extrainfo{%
%%  { \facebooksymbol }
%%      \href{https://www.facebook.com/naereencorp.lbesson}{On Facebook ?}
  { \bitbucketsymbol }
    \href{https://bitbucket.org/lbesson/}{bitbucket.org/lbesson}
}

% =============================================================================
\makeatletter
% to show numerical labels in the bibliography; only useful if you make citations in your Abstract
% \renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}

% A \justified command to force left AND right justification
\newcommand{\justified}{%
  \rightskip\z@skip%
  \leftskip\z@skip}

% https://tex.stackexchange.com/questions/162441/add-a-second-website-in-moderncv-banking
	%\makeatletter
\newcommand*{\homepageA}[1]{\def\@homepageA{#1}}
\newcommand*{\homepageB}[1]{\def\@homepageB{#1}}
\patchcmd{\maketitle}% <cmd>
  {\ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}}% <search>
  {\ifthenelse{\isundefined{\@homepageA}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepageA}}}%
   \ifthenelse{\isundefined{\@homepageB}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepageB}}}}% <replace>
  {}{}% <success><failure>

\makeatother

	\homepageA{perso.crans.org/besson}
	%% \homepageB{lbesson.bitbucket.org}

% =============================================================================
