I have encountered several bibliographic style difficulties since using authoryear-ext
.
My first problem is following the use of innamebeforetitle-true
which allows the inversion of the editor and the title. Although practical, it changes the format by putting the first and last name when I would like "Author (I.) dir." I read in the documentation that the format used was that in:editor (+ others)
but I don't know how to change it.
Second problem: I would like to put a dot at the end of the title (article title, proceedings, etc.). I can't do it for proceedings and inproceedings.
Third problem: I would like to put the collection and the collection number in parenthesis at the end. I got there but in the case of inproceedings the information appeared twice.
Thank you,
\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{french}
\usepackage{csquotes}
\usepackage{xpatch} %permet de bidouiller plus en profondeur le code pour la bibliographie
\usepackage[%
backend=biber,
style=ext-authoryear,
maxbibnames=999,
maxcitenames=2,
maxsortnames=2,
uniquename=false,
uniquelist=false,
giveninits,
mincrossrefs=1,
mergedate=false, %enleve le tiret
dashed=false,
introcite=plain,
autolang=langname,
innamebeforetitle=true, %inversion byeditor et titre
articlein=false, %enleve le in des articles
]{biblatex}
%Etiquette, gras, avec deux points.
\DeclareFieldFormat{bbx@introcite}{\mkbibbold{#1}}
\renewcommand*{\introcitepunct}{\mkbibbold{\addcolon\space}}
%permet de mettre en minustile les styles de citation
\DefineBibliographyExtras{french}{\restorecommand\mkbibnamefamily}
\AtEveryCitekey{\renewcommand*{\mkbibnamefamily}[1]{#1}}
\DeclareDelimAlias{finalnamedelim}{multinamedelim} %harmonise les étiquettes et les noms
\renewcommand*{\newunitpunct}{\addcomma\space} %met une virgule à la place de tous les segments
%tri
\DeclareNameAlias{byeditor}{sortname}
\DeclareNameAlias{sortname}{family-given}
\renewcommand*{\revsdnamepunct}{\addspace} %enleve ponctuation entre prénom et nom.
\renewbibmacro*{name:family-given}[4]{%
\ifuseprefix
{\usebibmacro{name:delim}{#3#1}%
\usebibmacro{name:hook}{#3#1}%
\ifdefvoid{#3}{}{%
\ifcapital
{\mkbibnameprefix{\MakeCapital{#3}}\isdot}
{\mkbibnameprefix{#3}\isdot}%
\ifprefchar{}{\bibnamedelimc}}%
\mkbibnamefamily{#1}\isdot
\ifboolexpe{%
test {\ifdefvoid{#2}}
and
test {\ifdefvoid{#4}}}
{}
{\bibnamedelimd\bibopenparen}%
\ifdefvoid{#2}{}{\mkbibnamegiven{#2}\isdot}%
\ifdefvoid{#4}{}{\ifdefvoid{#2}{}{\bibnamedelimd}\mkbibnamesuffix{#4}\isdot}%
\ifboolexpe{%
test {\ifdefvoid{#2}}
and
test {\ifdefvoid{#4}}}
{}
{\bibcloseparen}}
{\usebibmacro{name:delim}{#1}%
\usebibmacro{name:hook}{#1}%
\mkbibnamefamily{#1}\isdot
\ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}%
\ifboolexpe{%
test {\ifdefvoid{#2}}
and
test {\ifdefvoid{#3}}}
{}
{\revsdnamepunct\bibopenparen}%
\ifdefvoid{#2}{}{\mkbibnamegiven{#2}\isdot}%
\ifdefvoid{#3}{}{\ifdefvoid{#2}{}{\bibnamedelimd}\mkbibnameprefix{#3}\isdot}%
\ifboolexpe{%
test {\ifdefvoid{#2}}
and
test {\ifdefvoid{#3}}}
{}
{\bibcloseparen}}}
\renewbibmacro*{name:andothers}{% Based on name:andothers from biblatex.def
\ifboolexpr{
test {\ifnumequal{\value{listcount}}{\value{liststop}}}
and
test \ifmorenames
}
{\ifnumgreater{\value{liststop}}{1}
{\finalandcomma}
{}%
\andothersdelim\bibstring[\emph]{andothers}}
{}}
\DeclareFieldFormat{origdate}{\mkbibbrackets{#1}}
\renewbibmacro*{cite:labeldate+extradate}{%
\iffieldundef{labelyear}
{}
{\printtext[bibhyperref]{%
\printorigdate
\setunit*{\addspace}%
\printlabeldateextra}}}
\DeclareDelimFormat[bib]{nametitledelim}{\space\textendash\space} %limite entre nom et titre
\DeclareDelimFormat{editortypedelim}{\addspace} %ponctuation pour dir. et prénom
%met en italique les titres
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,unpublished]
{title}{#1}
\DeclareFieldFormat[thesis]{title}{\mkbibitalic{#1}}
%gere la commande in
\renewbibmacro{in:}{%
\ifentrytype{inproceedings,incollection}
{}
{\printtext{\bibstring{in}\intitlepunct}}}
%rajoute la date à la fin
\renewbibmacro*{issue+date}{%
\printfield{issue}%
\setunit{\addcomma\space}%
\printdate%
\newunit}
%rajoute une virgule à la place des deux points
\renewbibmacro*{publisher+location+date}{%
\printlist{location}%
\setunit*{\addcomma\space}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
%rajoute des virgule au lieu des deux points
\newbibmacro*{institution+location+date}{%
\printlist{location}%
\setunit*{\addcomma\space}%
\printlist{institution}%
\setunit*{\addcomma\space}
}
%enleve les parenthèses pour les dates et les lieux de colloque
\renewbibmacro*{event+venue+date}{%
\iffieldundef{eventtitle}
{}
{\bibstring{presentedat}%
\printfield{eventtitle}}%
\ifboolexpr{
test {\iffieldundef{venue}}
and
test {\iffieldundef{eventyear}}
}
{}
{\setunit*{\addspace}%
\printfield{venue}%
\setunit*{\addcomma\space}%
\printeventdate}%
\newunit
}
%permet de modifier citation
\DeclareFieldFormat{postnote}{\mknormrange{#1}}
\DefineBibliographyStrings{french}{%
byeditor = {\iffieldequalstr{keywords}{source}
{Établit\space par}%
{dir\adddotspace\smartof}},
in = {\textit{in}},
editor = {dir\adddot},%
editors = {dir\adddot},%
byeditor = {dir\adddot},
mathesis = {Mém\adddotspace de master\addcomma},
phdthesis = {Thèse de doct\adddot\space\addcomma},
}
%% Pour avoir collaboration après l'auteur pour namea et enleve année supplémentaire
\makeatletter
\renewbibmacro*{author}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{author}%
\setunit{\addcomma\space}%
\usebibmacro{bbx:savehash}%
\usebibmacro{authorstrg}%
\ifnameundef{namea}
{}
{\setunit{\addcomma\space}%
\global\undef\bbx@lasthash%
\usebibmacro{authorstrg}%
\setunit{\addspace}%
\usebibmacro{bynameastrg}%
\setunit{\addspace}%
\printnames{namea}}}}
{\global\undef\bbx@lasthash}}
\newbibmacro*{bynameastrg}{%
\iffieldundef{nameatype}
{}
{\usebibmacro{bytypestrg}{namea}{editor}}}
\makeatother
%enlève la virugule avant dir. et permet d'enlever aussi la parenthèse et l'année supplémentaire
\makeatletter
\renewbibmacro*{bbx:editor}[1]{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{editor}%
% \setunit{\addcomma\space}% DELETED
\setunit{\addspace}% ADDED
\usebibmacro{bbx:savehash}}%
% \usebibmacro{#1}% DELETED
\printtext{\usebibmacro{#1}}% ADDED
\clearname{editor}}
{\global\undef\bbx@lasthash}}
\makeatother
%met entre parenthèse la collection et le numéro dans la même parenthèse
\renewbibmacro*{series+number}{%
\iffieldundef{series}
{}
{\printtext[parens]{%
\printtext{}%
\printfield{series}%
\setunit*{\space}%
\printfield{number}%
\printtext{}}%
}} %%% il y a un point en enleveant \nopunct.
%permet de mettre collection à la fin en rajouter une virgule avant.
\newcommand*\patchseries[1]{%
\xpatchbibdriver{#1}
{\usebibmacro{series+number}}
{}
{}
{\typeout{Warning: Failed to remove series+number from driver #1.}}
\xpatchbibdriver{#1}
{\usebibmacro{related}}
{\usebibmacro{related}%
\setunit{\addcomma\addspace}%
\usebibmacro{series+number}
\setunit{\addspace}}
{}
{\typeout{Warning: Failed to add series+number to driver #1.}}}
%permet de patcher pour les
\patchseries{book}
\patchseries{collection}\patchseries{incollection}
\patchseries{proceedings}
\patchseries{inproceedings}
\DeclareFieldFormat[article,inbook,inproceedings,incollection,Proceedings,report]
{pages}{\mkpageprefix[bookpagination]{#1}}
%permet de mettre un point à la fin du titre
\xpatchbibdriver{article}
{\usebibmacro{title}%
\newunit}
{\usebibmacro{title}%
\printunit{\adddot\space}}
{}
{}
%permet de mettre un point à la fin du titre
\xpatchbibdriver{thesis}
{\usebibmacro{title}%
\newunit}
{\usebibmacro{title}%
\printunit{\adddotspace}}
{}
{}
%permet de mettre un point à la fin du titre
\xpatchbibdriver{report}
{\usebibmacro{title}%
\newunit}
{\usebibmacro{title}%
\printunit{\adddotspace}}
{}
{}
%permet de mettre un point à la fin du titre
\xpatchbibdriver{book}
{\usebibmacro{maintitle+title}%
\newunit}
{\usebibmacro{maintitle+title}%
\printunit{\adddotspace}}
{}
{}
%%% permet de mettre un point pour les booktitles
\renewbibmacro*{maintitle+booktitle}{%
\usebibmacro{booktitle}%
\printunit{\adddot\space} %rajoute un point à la fin du titre du bouquin dans inprooceedings
}
%%%% permet de mettre un point pour les booktitles
%\renewbibmacro*{maintitle+booktitle}{%
% \usebibmacro{maintitle}%
% \printunit{\adddot\space} %rajoute un point à la fin du titre du bouquin dans inprooceedings
%}
\renewcommand*{\jourvoldelim}{\addcomma\space}
\begin{filecontents}{\jobname.bib}
@Inproceedings{Inproceedings2,
author = {de Vangelis, {\relax Cl}aire-Annie},
title = {Title},
booktitle = {Book 2},
year = {2000},
pages = {320-335},
crossref = {book2},
}
@Proceedings{book2,
author = {Hélène Henri},
title = {Book 2},
year = {2000},
pagetotal = {400},
editor = {Henri Point},
address = {Lieu},
publisher = {Publisher},
evendate = {1990-10},
series = {Serie},
number = {1},
venue = {Actes du colloque},
}
@Book{bookcollab,
title = {Title},
publisher = {Publisher},
year = {1999},
editor = {Michel Jean},
pagetotal = {680},
address = {Lieu},
number = {12},
series = {Serie},
namea = {Martin, Jean-Claude},
nameatype = {collaborator},
timestamp = {2019-06-15},
}
@Proceedings{proceedings1,
title = {Title},
year = {1990},
editor = {Michel René},
publisher = {Publisher},
address = {Lieu},
pagetotal = {294},
series = {Serie},
Number = {1},
venue = {Actes de la table-ronde},
eventdate = {1989-03-11},
}
@Phdthesis{these2013,
author = {Jean Martin},
title = {Title},
school = {Université},
year = {2013},
address = {Lieu},
institution = {Institution},
pagetotal = {721},
}
@TechReport{rapport1990,
author = {Jean Claude},
institution = {Institution},
pagetotal = {20},
title = {Title},
year = {1990},
type = {Rapport de fouille},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}