%%%%%% BIBLATEX-SWISS-LEGAL-GENERAL : CITATIONS %%%%%%% % Copyright 2012 Adrien Vion % % 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 Adrien Vion. %%%%%%%%%% PREAMBULE / REGLES GENERALES %%%%%%%%%% % IntitulŽ \ProvidesFile{biblatex-swiss-legal-general.cbx}[2012/04/25 v1.01 alpha] % OPTIONS \ExecuteBibliographyOptions{% singletitle=true,% %singletitle=true,% abbreviate=true,% date=long,% abrjournal=true,% backend=biber,% uniquename=full,% %uniquelist=true,% maxcitenames=4,% %idemtracker=true,% } \DeclareLanguageMapping{french}{biblatex-swiss-legal-fr} % FORMATAGE DES DONNƒES % Jurisprudence => revues abrŽgŽes \DeclareFieldFormat[customb]{volume}{#1} \DeclareFieldFormat[customb]{pages}{#1} % Formatage des postnotes sensible au champ pagination \DeclareFieldFormat[]{postnote}{% \iffieldundef{pagination}% {% \ifnumeral{#1}% {\pno~#1}% {% \ifnumerals{#1}% {\ppno~#1}% {#1}% }% }% {% \iffieldequalstr{pagination}{page}% {}% {% \iffieldequalstr{pagination}{num}% {% \ifnumeral{#1}% {\no~#1}% {% \ifnumerals{#1}% {\nos~#1}% {#1}% }% }% {#1}% }% }% } % Mention "n¡" automatique s'il n'y a que des chiffres dans les commentaires. % => S'il on veut N ou NN ˆ la place, c'est ici qu'il faut le modifier. \DeclareFieldFormat[customa]{postnote}{\ifnumeral{#1}{\no #1}{\ifnumerals{#1}{\nos #1}{#1}}} % Crossref \DeclareDataInheritance{jurisdiction}{customb}{% } \DeclareDataInheritance{commentary}{customa}{% \noinherit{crossref}% } % Ibid \newbibmacro{ibid}{% \iffieldequalstr{entrytype}{customb}% {\bibstring{lastruling}}% {\iffieldequalstr{entrytype}{jurisdiction}% {\bibstring{lastruling}}% {\emph{\bibcpstring{ibidem}}}% }% } % MACROS PAR TYPE D'ENTRƒE % GŽnŽral \newbibmacro{citationgeneral}{% \ifciteibid% {\usebibmacro{ibid}}% {% \printnames{labelname}% \ifsingletitle% {}% {\addcomma\addspace% \iffieldundef{shorttitle}% {\printfield{title}}% {\printfield{shorttitle}}% }% }% } % Source online \newbibmacro{online}{% \ifciteibid% {\usebibmacro{ibid}}% {% \ifnameundef{labelname}% {}% {\printnames{labelname}\addcomma\addspace}% \iffieldundef{shorttitle}% {\printfield{title}}% {\printfield{shorttitle}}% }% } % Jurisprudence \newbibmacro{jurisdiction}{% \ifciteibid% {\usebibmacro{ibid}}% {% \printfield{usera}% \iffieldundef{userb}% {}% {\newunit\printfield{userb}}% \iffieldundef{userc}% {}% {\newunit\printfield{userc}}% \iffieldundef{userd}% {}% {\newunit\printfield{userd}}% \iffieldequalstr{usera}{ATF}% <= La date ne s'imprime que s'il ne s'agit pas d'un ATF. {}% {\iffieldundef{origyear}% {}% {\addspace\mkbibparens{\printfield{origday}\adddot\printfield{origmonth}\adddot\printfield{origyear}}}% }% \iftoggle{bbx:jstitles}% <= Option pour activer / dŽsactiver la mention du titre dans les citations d'arrts {\iffieldundef{title}% {}% {\newunit% \printfield{title}}% }% {}% \iflistundef{language}% {}% {\addspace\mkbibbrackets{\printlist{language}}}% \iffieldundef{usere}% {} {\addcomma\addspace\bibsstring{recital}\addspace\printfield{usere}% \iffieldundef{userf} {} {\addspace\mkbibparens{\printfield{userf}}} }% \iffieldequalstr{howpublished}{publ} {\newunit}% {\newblock}% \iffieldbibstring{howpublished}% {\bibsstring{\thefield{howpublished}}}% Dans les citations, on va toujours utiliser le string abrŽgŽ. {\printfield{howpublished}}% \newunit% \iffieldbibstring{journaltitle} {% aa) s'il existe un string pour le nom de la revue \bibsstring{\thefield{journaltitle}}% }% {% bb) s'il n'existe pas de string pour le nom de la revue \printfield{journaltitle}% }% \newunit% \usebibmacro{date}% \newunit% \printfield{volume}% \newunit% \iffieldundef{number}% {}% {\bibsstring{number}\addnbthinspace\printfield{number}}% \newunit% \printfield{pages}% }% }% % Commentaires \DeclareFieldFormat{part}{% \ifnumeral{#1}% {\bibsstring{article}~#1}% {\ifnumerals{#1}% {\bibsstring{articles}~#1}% {#1}% }% } \DeclareFieldFormat{type}{% \ifbibstring{#1}{\bibsstring{#1}}{#1}% } \newbibmacro{styleA}{% Format "BK-Kramer, 1 CO, n¡ ...." \ifciteibid% {\usebibmacro{ibid}}% {% \iffieldbibstring{series}% {\bibsstring{\thefield{series}}}% {\printfield{series}}% \printtext{-}% \printnames{labelname}% \newblock% \printfield{type}% \newunit% \printfield{part}% \newunit% \printfield{titleaddon}% }% } \newbibmacro{styleB}{% \ifciteibid% {\usebibmacro{ibid}}% {% \iffieldbibstring{series}% {\bibsstring{\thefield{series}}\printtext{-}}% {\iffieldundef{series}% {}% {\printfield{series}\printtext{-}}% }% \iffieldundef{titleaddon}% {}% {\printfield{titleaddon}\addspace}% \iffieldundef{volume}% {}% {\thefield{volume}}% \newblock% \printnames{labelname}% \addcomma\addspace% \printfield{type}% \newunit% \printfield{part}% }% } \newbibmacro{styleC}{% \ifciteibid% {\usebibmacro{ibid}}% {% \printnames{author}% \newblock% \usebibmacro{printin}% \iffieldbibstring{series}% {\biblstring{\thefield{series}}}% {\printfield{series}}% \newblock% \printfield{type}% \newunit% \printfield{part}% \newunit% \printfield{titleaddon}% }% } \newbibmacro{commentary}{% {\ifnum\blx@commentarystyle=\z@% Si on a choisi le style A (par dŽfaut, c'est le cas) \usebibmacro{styleA}% \else% Dans les autres cas \ifnum\blx@commentarystyle=\@ne% Si on a choisi l'option halfdash \usebibmacro{styleB}% Alors un tiret demi-cadratin est imprimŽ \else% Dans les autres cas = on a choisi l'option comma \usebibmacro{styleC}% une virgule et une espace sont imprimŽes \fi% \fi}% } % MACROS DE CITATION \newbibmacro*{cite}% {% \iffieldequalstr{entrytype}{customa}% {\usebibmacro{commentary}}% {\iffieldequalstr{entrytype}{customb}% {\usebibmacro{jurisdiction}}% {\iffieldequalstr{entrytype}{jurisdiction}% {\usebibmacro{jurisdiction}}% {\iffieldequalstr{entrytype}{online}% {\usebibmacro{online}}% {\usebibmacro{citationgeneral}}% }% }% }% }% % COMMANDES DE CITATION \DeclareCiteCommand{\footcite}[\mkbibfootnote]% {\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}}% {\multicitedelim}% {\usebibmacro{postnote}}% \DeclareCiteCommand{\textcite}[]% {\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}}% {\multicitedelim}% {\usebibmacro{postnote}}% \DeclareCiteCommand{\cite}[]% {\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}}% {\multicitedelim}% {\usebibmacro{postnote}}% \DeclareCiteCommand{\parencite}[\mkbibparens]% {\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}}% {\multicitedelim}% {\usebibmacro{postnote}}% % COMMANDES SPECIFIQUES POUR LES CITATIONS DE JURISPRUDENCE % Commandes pour l'utilisateur \usepackage{xargs} \newcommandx{\jdcite}[5][1,2,3,4]{% \ifdef{\jurisdiction@prenote}% {\renewcommand{\jurisdiction@prenote}{#1}}% Actualisation de la commande \jurisdiction@prenote avec le contenu du champ #1 {\newcommand{\jurisdiction@prenote}{#1}}% \ifdef{\jurisdiction@recital}% {\renewcommand{\jurisdiction@recital}{#3}}% Actualisation de la commande \jurisdiction@recital avec le contenu du champ #3 {\newcommand{\jurisdiction@recital}{#3}}% \ifdef{\jurisdiction@page}% {\renewcommand{\jurisdiction@page}{#4}}% Actualisation de la commande \jurisdiction@page avec le contenu du champ #4 {\newcommand{\jurisdiction@page}{#4}}% \jurisdiction@cite% [#1]% [#2]% {#5}% } % Interface avec biblatex \DeclareCiteCommand{\jurisdiction@cite}[]% {% PRECODE \usebibmacro{prenote}% \ifcsempty{jurisdiction@prenote}% test pour savoir s'il y a quelque chose dans le champ optionnel prenote. {\bibsentence}% s'il n'y a rien, le bibstring (p. ex. Arrt prŽcitŽ) suivant est capitalisŽ {\midsentence}% s'il y a quelque chose, le bibstring suivant commence par une minuscule }% {% LOOPCODE \usebibmacro{citeindex}% \iffieldequalstr{entrytype}{jurisdiction}% test pour tre sur qu'on est dans une fiche @jurisdiction {\usebibmacro{jurisdiction@details}}% si c'est bien le cas, on utilise le macro jurisdiction@details {% <= Un message d'erreur appara”t si on est pas dans une fiche @jurisdiction \PackageError{biblatex-swiss-legal}{Use the \protect\jdcite\space command \MessageBreak ONLY for 'jurisdiction' entry types!}{Replace the entrykey by an \MessageBreak entrykey corresponding to a 'jurisdiction' entry.}% }% }% {\multicitedelim}% SEPCODE {\usebibmacro{postnote}}% POSTCODE \DeclareMultiCiteCommand{\jurisdiction@cites}{\jurisdiction@cite}{\multicitedelim} %% Macro dŽtaillŽe \newbibmacro{jurisdiction@details}{% \ifciteibid% Test pour savoir si l'arrt vient d'tre citŽ {\ifcsempty{jurisdiction@recital}% Si oui, on se demande si un numŽro de considŽrant a ŽtŽ dŽfini {\usebibmacro{ibid}}% Si a n'est pas le cas, le bibstring lastruling uniqument s'imprime {\usebibmacro{ibid}\addcomma\addspace\bibsstring{recital}\addspace\jurisdiction@recital% Sinon, impression du bibstring + considŽrant + Žv. page. \ifcsempty{jurisdiction@page}% {}% {\addspace\mkbibparens{\jurisdiction@page}}% }% }% {% \printfield{usera}% \iffieldundef{userb}% {}% {\newunit\printfield{userb}}% \iffieldundef{userc}% {}% {\newunit\printfield{userc}}% \iffieldundef{userd}% {}% {\newunit\printfield{userd}}% \iffieldequalstr{usera}{ATF}% <= La date ne s'imprime que s'il ne s'agit pas d'un ATF. {}% {\iffieldundef{origyear}% {}% {\addspace\mkbibparens{\printfield{origday}\adddot\printfield{origmonth}\adddot\printfield{origyear}}}% }% \iftoggle{bbx:jstitles}% <= Option pour activer / dŽsactiver la mention du titre dans les citations d'arrts {\iffieldundef{title}% {}% {\newunit% \printfield{title}}% }% {}% \iflistundef{language}% {}% {\addspace\mkbibbrackets{\printlist{language}}}% \ifcsempty{jurisdiction@recital}% {}% {% \addcomma\addspace\bibsstring{recital}\addspace\jurisdiction@recital% \ifcsempty{jurisdiction@page}% {}% {\addspace\mkbibparens{\jurisdiction@page}}% }% \iffieldequalstr{howpublished}{publ} {\newunit}% {\newblock}% \iffieldbibstring{howpublished}% {\bibsstring{\thefield{howpublished}}}% Dans les citations, on va toujours utiliser le string abrŽgŽ. {\printfield{howpublished}}% \newunit% \iffieldbibstring{journaltitle} {% aa) s'il existe un string pour le nom de la revue \bibsstring{\thefield{journaltitle}}% }% {% bb) s'il n'existe pas de string pour le nom de la revue \printfield{journaltitle}% }% \newunit% \usebibmacro{date}% \newunit% \printfield{volume}% \newunit% \iffieldundef{number}% {}% {\bibsstring{number}\addnbthinspace\printfield{number}}% \newunit% \printfield{pages}% }% } %% INDEXATION AUTOMATIQUE DE LA JURISPRUDENCE (expŽrimental) % \iftoggle{bbx:jurisdictionindex}% {% \makeindex{jurisdiction}% \AtEveryCitekey{% \iffieldequalstr{entrytype}{jurisdiction}% {\index{jurisdiction}{[\thefield{origyear}-\thefield{origmonth}-\thefield{origday}] \thefield{usera}\addspace\thefield{userb}\addspace\thefield{userc}\addspace\thefield{userd}}}% {% \iffieldequalstr{entrytype}{customb}% {\index{jurisdiction}{[\thefield{origyear}-\thefield{origmonth}-\thefield{origday}] \thefield{usera}\addspace\thefield{userb}\addspace\thefield{userc}\addspace\thefield{userd}!-- consid.\addspace\thefield{usere}}}% {}% }% }% }% {}% \endinput