%% Biblatex %%
\usepackage[language=french,autopunct=true,%
  citestyle=verbose-trad2,
   strict,% diminue les risques d'ambiguité dans les citations
   citepages=omit,% n'imprime le total de pages d'un élément cité que si rien n'est spécifiée dans l'argument optionnel de la commande de citation
   idemtracker=false,% remplacer le nom de l'auteur par "idem" dans la deuxième citation consécutive d'oeuvres du même auteur?
   loccittracker=true,%
   opcittracker=true,%
   pagetracker=true,% suivre si un élément cité est le premier sur la page? voir aussi la redéfinition de la macro 'cite'
   ibidpage=true,% distinguer les citations qui ont le même argument optionnel?
  bibstyle=reading,entryhead=false,entrykey=false,annotation=false,abstract=false,library=false,file=false]%
{biblatex}%

% Réglages de bibliographie
\renewcommand*{\newunitpunct}{\addcomma\space}     % séparateur de champs
\renewcommand*{\labelnamepunct}{\addcolon\space}
\DeclareNameAlias{sortname}{last-first}            % Nom, prénom
\DeclareNameAlias{default}{last-first}             % Nom, prénom

%Réglages linguistiques
\DefineBibliographyStrings{french}{%
  pages = {pp\adddot},
  abstract = {\emph{R\'esum\'e}},
  in = {in},
  byeditor = {(dir.)},
  ibidem=idem
}

% On a besoin de cette modification pour que la première citation en note de bas de page
% ne soit pas une forme abrégée
\renewbibmacro*{cite}{%
  \usebibmacro{cite:citepages}%
  \global\togglefalse{cbx:fullcite}%
  \global\togglefalse{cbx:loccit}%
  \bibhypertarget{cite\the\value{instcount}}{%
    \ifciteseen
      {\iffieldundef{shorthand}
        {\iffirstonpage% NEW
           {\usebibmacro{cite:name}% NEW
            \usebibmacro{cite:title}}% NEW
           {\ifciteibid
              {\usebibmacro{cite:ibid}}
              {\ifthenelse{\ifciteidem\AND\NOT\boolean{cbx:noidem}}
                 {\usebibmacro{cite:idem}}
                 {\usebibmacro{cite:name}}%
               \usebibmacro{cite:title}}%
%       \usebibmacro{cite:save}}% DELETED
        \usebibmacro{cite:save}}}% NEW
         {\usebibmacro{cite:shorthand}}}
      {\usebibmacro{cite:full}%
       \usebibmacro{cite:save}}}}

% format du "in"
\renewbibmacro*{in:}{%
  \printtext{%
    \bibstring{in}}%
    \addspace}
    
% gestion du titre de la revue
\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addcomma\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}%
  \setunit{\addcomma\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}
% gestion du numéro de volume
\renewbibmacro*{volume+number+eid}{%
  \iffieldundef{volume}
  {}
  {\printtext{vol.\addspace}%_
  \printfield{volume}%
  \setunit*{\adddot}%
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}}
% gestion de la date
\renewbibmacro*{issue+date}{%
  \printtext{%
    \iffieldundef{issue}
      {\usebibmacro{date}}
      {\printfield{issue}%
       \setunit*{\addspace}%
       \usebibmacro{date}}}%
  \newunit}

% Format des "inbook"
\DeclareFieldFormat[inbook]{chapter}{\mkbibquote{#1\isdot}}
\DeclareFieldFormat[inbook]{title}{\mkbibemph{#1}}
% \DeclareDataInheritance{mvbook,book}{inbook,bookinbook}{
% \inherit{author}{author}
% \inherit{bookauthor}{bookauthor}
% }

\renewbibmacro*{byeditor}{%
  \ifnameundef{editor}
    {}
    {\printnames[byeditor]{editor}%
     \setunit{\addspace}%
     \usebibmacro{bytypestrg}{editor}{editor}%
     \newunit}%
  \usebibmacro{byeditorx}}

\newbibmacro*{bybookauthor/byeditor}{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\usebibmacro{byeditor}%
     \setunit{\addspace:\addspace}}
    {\ifnameundef{bookauthor}
      {}
      {\printnames{bookauthor}%
      \setunit{\addspace:\addspace}}}%     
  }
    
\renewbibmacro*{cite:title}{% 
\printtext[bibhyperlink]{% 
\ifsingletitle{}{\printfield[citetitle]{labeltitle}}% 
\setunit{\nametitledelim}% 
\bibstring[\mkibid]{opcit}}} 
    
\DeclareBibliographyDriver{inbook}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author}%
  \setunit{\labelnamepunct}\newblock
  \printfield{chapter}%
  \newunit\newblock
  \usebibmacro{in:}%
  \usebibmacro{bybookauthor/byeditor}%
  \newblock
  \usebibmacro{maintitle+title}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \setunit{\bibpagespunct}%
  \printfield{pages}%
  \usebibmacro{finentry}}


%Réglages des citations
\renewcommand*{\mkibid}{\emph}