diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/droit-fr/droit-fr.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/droit-fr/droit-fr.bbx | 177 |
1 files changed, 140 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/latex/droit-fr/droit-fr.bbx b/Master/texmf-dist/tex/latex/droit-fr/droit-fr.bbx index 254c7ce8fb6..9541860ecd3 100644 --- a/Master/texmf-dist/tex/latex/droit-fr/droit-fr.bbx +++ b/Master/texmf-dist/tex/latex/droit-fr/droit-fr.bbx @@ -1,14 +1,97 @@ -\ProvidesFile{droit-fr.bbx}[2014/01/30 v0.4 style droit francais] +%% Copyright 2010-2015 Yves de Saint-Pern +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Yves de Saint-Pern. + +\ProvidesFile{droit-fr.bbx}[2015/10/02 v1.1 style droit francais] \RequireBibliographyStyle{verbose-ibid} \RequireBiber[3] +%%%%%%%%%%%%%%%%%%%%%% +% OPTIONS DE PACKAGE % +%%%%%%%%%%%%%%%%%%%%%% + +% style du champ auteur: auteurs secondaires inversés ou non ? +\DeclareBibliographyOption{revertauthors}[false]{% + \ifstrequal{#1}{true} + {\DeclareNameAlias{sortname}{last-first}} + {\DeclareNameAlias{sortname}{last-first/first-last}}} + +% style de chaque nom d'une entrée de la bibliographie +\DeclareBibliographyOption{namestyle}[parens]{% + \ifcsdef{bbx@opt@namestyle@#1} + {\csuse{bbx@opt@namestyle@#1}} + {\PackageError{biblatex} + {Invalid option 'namestyle=#1'} + {Valid values are 'parens', 'parensprefix', 'plain'}}} + +\def\bbx@opt@namestyle@parens{% + \renewbibmacro*{name:last-first}{\usebibmacro*{name:last-first:parens}}} + +\def\bbx@opt@namestyle@parensprefix{% + \renewbibmacro*{name:last-first}{\usebibmacro*{name:last-first:parensprefix}}} + +\def\bbx@opt@namestyle@plain{% + \renewbibmacro*{name:last-first}{\usebibmacro*{name:last-first:plain}}} + +% formatage des noms de famille indexés ? +\newcommand{\mkbibindexnamelast}{} +\DeclareBibliographyOption{indexnameformat}[true]{% + \ifstrequal{#1}{true}% + {\renewcommand{\mkbibindexnamelast}{\mkbibnamelast}}% + {\renewcommand{\mkbibindexnamelast}{}}} + +% gestion des prénoms dont l'abréviation doit être formée de 2 ou 3 lettres et non d'une seule: +% - ceux commençant par un digramme (2 consonnes formant un son): Ch, Th, Ph +% - ceux commençant par une consonne ou un digramme, puis l ou r: Cl, Chr, Fr, etc. +% le code ci-dessous s'applique aux prénoms des champs author et editor. +% il protège chacune de ces abréviations par la substitution suivante effectuée a la volée: +% "Malaurie, Philippe" => "Malaurie, {\relax{}Ph}ilippe" +\DeclareBibliographyOption{smartinitials}[true]{% + \ifstrequal{#1}{true}% +{\DeclareStyleSourcemap{% + \maps[datatype=bibtex]{% + \map{% + % champ author + \step[fieldsource=author,% + match={\regexp{\b(Chr|Ch|Th|Ph|[B-DF-HJ-NP-TV-XZ](l|r))(\S*,)}},% + replace={\regexp{\{$1\}$3}}]% protection noms de famille si format "prénom nom" + \step[fieldsource=author,% + match={\regexp{([^,]\s)\b(Chr|Ch|Th|Ph|[B-DF-HJ-NP-TV-XZ](l|r))}},% + replace={\regexp{$1\{$2\}}}]% protection noms de famille si format "nom, prénom" + \step[fieldsource=author,% + match={\regexp{\b(Chr|Ch|Th|Ph|[B-DF-HJ-NP-TV-XZ](l|r))([^\}])}},% + replace={\regexp{\{\\relax\{\}$1\}$3}}]% insertion \relax dans les prénoms trouvés + % champ editor + \step[fieldsource=editor,% + match={\regexp{\b(Chr|Ch|Th|Ph|[B-DF-HJ-NP-TV-XZ](l|r))(\S*,)}},% + replace={\regexp{\{$1\}$3}}]% protection noms de famille si format "prénom nom" + \step[fieldsource=editor,% + match={\regexp{([^,]\s)\b(Chr|Ch|Th|Ph|[B-DF-HJ-NP-TV-XZ](l|r))}},% + replace={\regexp{$1\{$2\}}}]% protection noms de famille si format "nom, prénom" + \step[fieldsource=editor,% + match={\regexp{\b(Chr|Ch|Th|Ph|[B-DF-HJ-NP-TV-XZ](l|r))([^\}])}},% + replace={\regexp{\{\\relax\{\}$1\}$3}}]% insertion \relax dans les prénoms trouvés +}}}% +} +{}} + % l'editor ne remplace pas un champ author laissé vide. % il reste imprimé à sa place (généralement après le title). -\ExecuteBibliographyOptions{useeditor=false} +\ExecuteBibliographyOptions{useeditor=false,sorting=nyt} -% classement par nom, année titre (voir plus bas pour customisation du tri nytx) -\ExecuteBibliographyOptions{sorting=nyt} +% options locales par défaut +\ExecuteBibliographyOptions{revertauthors=false,namestyle=parens,indexnameformat=true,smartinitials=true} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % REDEFINITIONS/AJOUT DE MOTS-CLES % @@ -113,67 +196,88 @@ {\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}% \usebibmacro{name:andothers}} -% modification pour obtenir "NOM, (Prénom particule)" pour les auteurs dans la bibliographie. -\renewbibmacro*{name:last-first}[4]{% - \ifuseprefix - {\usebibmacro{name:delim}{#3#1}% - \ifblank{#3}{}{% - \mkbibnameprefix{\MakeCapital{#3}\isdot}% - \ifpunctmark{'}{}{\addhighpenspace}}% - \mkbibnamelast{#1\isdot}% - \ifblank{#4}{}{\addlowpenspace\mkbibnameaffix{#4}\isdot}% - \ifblank{#2}{}{\addlowpenspace\mkbibparens{\mkbibnamefirst{#2}\isdot}}} - {\usebibmacro{name:delim}{#1}% - \mkbibnamelast{#1}\isdot - \ifblank{#4}{}{\addlowpenspace\mkbibnameaffix{#4}\isdot}% - \ifblank{#2#3}{}{}% - \ifblank{#2}{}{% - \ifblank{#3} - {\addlowpenspace\mkbibparens{\mkbibnamefirst{#2}\isdot}}% - {\addlowpenspace\mkbibparens{\mkbibnamefirst{#2}\addlowpenspace\mkbibnameprefix{#3}\isdot}}}}} +% correspond à la macro "name:last-first" de biblatex.def +% NOM, Prénom particule +\newbibmacro*{name:last-first:plain}[4]{% + \usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \mkbibnamelast{#1}\isdot + \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}% + \ifblank{#2#3}{}{\revsdnamepunct}% + \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{#2}\isdot}% + \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}} + +% NOM (Prénom particule) +\newbibmacro*{name:last-first:parens}[4]{% + \usebibmacro{name:delim}{#1}% + \mkbibnamelast{#1}\isdot + \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}% + \ifblank{#2#3}{}{\bibnamedelimd\mkbibparens{% + \ifblank{#2}{}{\mkbibnamefirst{#2}\isdot}% + \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}} + } +} + +% NOM (particule), Prénom +\newbibmacro*{name:last-first:parensprefix}[4]{% + \usebibmacro{name:delim}{#1}% + \usebibmacro{name:hook}{#1}% + \mkbibnamelast{#1}\isdot + \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}% + \ifblank{#3}{}{\bibnamedelimd\mkbibparens{\mkbibnameprefix{#3}\isdot}} + \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamefirst{#2}\isdot}} % affichage du prénom en initiales, suivi du nom pour les autres champs (editor, translator, etc). \DeclareNameFormat{first-last}{% \usebibmacro{name:first-last}{#1}{#4}{#5}{#7} \usebibmacro{name:andothers}} - % caractère de séparation entre plusieurs entrées référencées dans "related" \renewcommand*{\relateddelim}{\addsemicolon\addspace} % modification du champ "related" pour les commentaires d'arrêt -\newbibmacro*{related:default}[1]{% +\renewbibmacro*{related:default}[1]{% \entrydata{#1}{\usedriver{}{commentary}}} +%%%%%%%%% +% INDEX % +%%%%%%%%% + % indexation des auteurs seulement \renewbibmacro*{bibindex}{% \ifbibindex {\indexnames{labelname}} {}} +% indexation des auteurs seulement +\renewbibmacro*{citeindex}{% + \ifciteindex + {\indexnames{labelname}} + {}} + +% formatage des noms indexés \renewcommand*{\mkbibindexname}[4]{% \ifuseprefix {\ifblank{#3}{}{#3 }% \@firstofone #1% remove spurious braces - \ifblank{#4}{}{ #4}% - \ifblank{#2}{}{, #2}% \actualoperator \ifblank{#3}{}{\MakeCapital{#3} }% #1% \ifblank{#4}{}{ #4}% \ifblank{#2}{}{, #2}} {\@firstofone #1% remove spurious braces - \ifblank{#4}{}{ #4}% ajouté - \ifblank{#2#3}{}{,}% ajouté - \ifblank{#2}{}{ #2}% ajouté - \ifblank{#3}{}{ #3} % ajouté - \actualoperator % ajouté - \textsc{#1}% + \actualoperator % ajouté + \mkbibindexnamelast{#1}% \ifblank{#4}{}{ #4}% \ifblank{#2#3}{}{,}% \ifblank{#2}{}{ #2}% \ifblank{#3}{}{ #3}}} + +%%%%%%%%%%%%%%%%%% +% SCHEMAS DE TRI % +%%%%%%%%%%%%%%%%%% + % schéma de tri destiné à la jurisprudence: institution, date de décision \DeclareSortingScheme{iymd}{ \sort{ @@ -227,10 +331,6 @@ } } -%TODO: abrévations de prénoms -% digrammes (deux consonnes pour un seul son): Ch, Gh, Ph, Th -% consonne ou digramme suivi de L ou R: - %%%%%%%%%%% % DRIVERS % @@ -349,7 +449,10 @@ \newunit\newblock \usebibmacro{pageref}% \setunit{\addsemicolon\addspace}\newblock - \usebibmacro{related}% + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% \usebibmacro{finentry}} % cas de jurisprudence anglaise |