%% start of file `template.tex'.
%% Copyright 2006-2010 Xavier Danaux (xdanaux@gmail.com).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.

\documentclass[10pt,a4paper,final]{moderncv}
% moderncv themes
\moderncvtheme[orange]{classic}                 % optional argument are 'blue' (default), 'orange', 'red', 'green', 'grey' and 'roman' (for roman fonts, instead of sans serif fonts)

%\moderncvtheme[green]{classic}                % idem

% character encoding
\usepackage[utf8]{inputenc}                   % replace by the encoding you are using

% adjust the page margins
\usepackage[scale=0.7]{geometry}
%\setlength{\hintscolumnwidth}{3cm}						% if you want to change the width of the column with the dates
%\AtBeginDocument{\setlength{\maketitlenamewidth}{6cm}}  % only for the classic theme, if you want to change the width of your name placeholder (to leave more space for your address details
%\AtBeginDocument{\recomputelengths}                     % required when changes are made to page layout lengths

% personal data
\firstname{}
\familyname{}
\title{Liste de publications}
%\mobile{mobile (optional)}                    % optional
%\phone{phone (optional)}                      % optional
%\fax{fax (optional)}                          % optional
%\email{gabriel.scherer@gmail.com} %optional

%\address{\href{http://prl.ccs.neu.edu/}{PRL}, Northeastern University, Boston}
% \address{\href{http://gallium.inria.fr}{Gallium} team}{INRIA Paris-Rocquencourt}
%\address{6, rue Georges Saché}{75014, Paris, France}  % optional, remove the line if not wanted
%\extrainfo{\homepagesymbol \href{http://www.ccs.neu.edu/home/gasche/}{www.ccs.neu.edu/home/gasche/}}
%\photo[64pt]{Gabriel_Scherer.jpg}                         % '64pt' is the height the picture must be resized to and 'picture' is the name of the picture file; optional, remove the line if not wanted
%\quote{Some quote (optional)}                 % optional, remove the line if not wanted

% chronological order bibliography using biblatex
% dashed=false:
%   http://tex.stackexchange.com/questions/49140/get-full-name-twice-in-bibliography
\usepackage[backend=biber,sorting=ydmdnt,bibstyle=authortitle,url=false,dashed=false]{biblatex}

\usepackage{sort_year_month}


% http://tex.stackexchange.com/questions/48400/biblatex-make-title-hyperlink-to-dois-url-or-isbn
\newbibmacro{string+url}[1]{%
  \iffieldundef{url}{%
    #1%
  }{%
    \href{\thefield{url}}{\color{blue}{#1}}%
  }%
}
% \DeclareFieldFormat{title}{\usebibmacro{string+url}{\mkbibemph{#1}}}
\DeclareFieldFormat[article,inproceedings]{title}%
    {\usebibmacro{string+url}{\mkbibquote{#1}}}

% http://tex.stackexchange.com/questions/12806/guidelines-for-customizing-biblatex-styles
\AtEveryBibitem{\ifentrytype{inproceedings}{\clearfield{year}}}

% http://tex.stackexchange.com/questions/10682/suppress-in-biblatex
\renewbibmacro{in:}{}

\DeclareNameAlias{sortname}{first-last}

% use moderncv-style spacing for reference items
% ( from http://tex.stackexchange.com/a/123818 )
\defbibenvironment{bibliography}
  {\list
     {\iffieldequals{year}{\bibyear}
        {}
        {\printfield{year}%
         \savefield{year}{\bibyear}}}
     {\setlength{\topsep}{0pt}% layout parameters based on moderncvstyleclassic.sty
      \setlength{\labelwidth}{\hintscolumnwidth}%
      \setlength{\labelsep}{\separatorcolumnwidth}%
      \setlength{\itemsep}{\bibitemsep}%
      \leftmargin\labelwidth%
      \advance\leftmargin\labelsep}%
      \sloppy\clubpenalty4000\widowpenalty4000}
  {\endlist}
  {\item}
\addbibresource{publications.bib}
\addbibresource{workshop_talks.bib}

\usepackage{changepage}% adjustwidth
\newenvironment{abstract}{Abstract:\begin{adjustwidth}{.5cm}{}}{\end{adjustwidth}}

% bibliography with mutiple entries
%\usepackage{multibib}
%\newcites{book,misc}{{Books},{Others}}

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

\begin{document}
\maketitle

% override href to use blue links in the body
% (using hypersetup itself disturbs the links in the header)
\let\Href\href
\renewcommand{\href}[2]{\Href{#1}{\color{blue}{#2}}}

\nocite{*}
\printbibliography[title=Articles journal,%
  type=article]
\printbibliography[title=Articles de conférence,%
  type=inproceedings,notkeyword=workshop]
\printbibliography[title=Workshops avec peer-review,%
  type=inproceedings,keyword=workshop]

\end{document}
