diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/oscola/oscola.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/oscola/oscola.bbx | 192 |
1 files changed, 141 insertions, 51 deletions
diff --git a/Master/texmf-dist/tex/latex/oscola/oscola.bbx b/Master/texmf-dist/tex/latex/oscola/oscola.bbx index 5c6d352c388..19056563b86 100644 --- a/Master/texmf-dist/tex/latex/oscola/oscola.bbx +++ b/Master/texmf-dist/tex/latex/oscola/oscola.bbx @@ -1,6 +1,6 @@ % Legal Style Citations using OSCOLA -% Copyright Paul Stanley 2014 -% This work consists of oscola.bbx, english-oscola.lbx, oscola.lbx +% Copyright Paul Stanley 2014-2017 +% This work consists of oscola.bbx, english-oscola.lbx, british-oscola.lbx, oscola.cbx % and oscola.ist. % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -13,13 +13,13 @@ % This work has the LPPL maintenance status 'maintained'. % The current maintainer of this work is Paul Stanley (pstanley@essexcourt.net) -\ProvidesFile{oscola.bbx}[2014/05/22 v1.4 Biblatex bibliography style for OSCOLA standard] +\ProvidesFile{oscola.bbx}[2017/03/15 v1.5 Biblatex bibliography style for OSCOLA standard] \RequireBibliographyStyle{authortitle} \RequireBiber[3] -\DeclareBibliographyOption{caseshorthands}[false]{ +\DeclareBibliographyOption{caseshorthands}[false]{% \ifstrequal{#1}{italic} {\DeclareFieldFormat[jurisdiction]{shorthand}{\textit{##1}}} {}} @@ -29,28 +29,49 @@ \ifstrequal{#1}{uc} {\global\toggletrue{bbx@capibid}} {\togglefalse{bbx@capibid}}} - + +\newtoggle{bbx@ecliuse}\newtoggle{bbx@eclionly} +\DeclareBibliographyOption{ecli}[add]{% + \ifstrequal{#1}{no} + {\global\togglefalse{bbx@ecliuse}\global\togglefalse{bbx@eclionly}} + {\global\toggletrue{bbx@ecliuse} + \ifstrequal{#1}{only} + {\global\toggletrue{bbx@eclionly}} + {}}} + +\newcommand{\bbx@juriscitationindexlist}{} +\listadd{\bbx@juriscitationindexlist}{{eu}{eujuriscitation:index}} +\listadd{\bbx@juriscitationindexlist}{{echr}{echrjuriscitation}} +\listadd{\bbx@juriscitationindexlist}{{int}{intjuriscitation}} +\listadd{\bbx@juriscitationindexlist}{{ca}{canjuriscitation}} +\listadd{\bbx@juriscitationindexlist}{{us}{usjuriscitation}} +\newcommand{\bbx@defaultjuriscitationindex}{enjuriscitation} + \newtoggle{bbx@shortindex} \DeclareBibliographyOption{shortindex}[true]{% - \settoggle{bbx@shortindex}{#1}} + \toggletrue{bbx@shortindex}% + \renewcommand{\bbx@juriscitationindexlist}{}% + \listadd{\bbx@juriscitationindexlist}{{eu}{eujuriscitation:index:short}}% + \renewcommand{\bbx@defaultjuriscitationindex}{juriscitation:index:short}} % We ensure that there will always be a trash index \AtEndPreamble{% \@ifpackageloaded{imakeidx}{\makeindex[name=trash]} - {\@ifpackageloaded{index}{\newindex{trash}{tdx}{tnd}{Miscellaneous}} - {\@ifpackageloaded{multind}{\PackageWarning{biblatex-oscola}{Multind is incompatible with biblatex-oscola. Use imakeidx or index}} - {\iftoggle{blx@citeindex} + {\@ifclassloaded{memoir}{\PackageWarning{biblatex-oscola}{To use indexing with OSCOLA and the memoir class, you need to load imakeidx.}} + {\@ifpackageloaded{index}{\newindex{trash}{tdx}{tnd}{Miscellaneous}} + {\@ifpackageloaded{multind}{\PackageWarning{biblatex-oscola}{Multind is incompatible with biblatex-oscola. Use imakeidx or index}} + {\iftoggle{blx@citeindex} {\PackageWarning{biblatex-oscola} - {You need to load imakeidx or index. Indexing will probably fail:}}{}}}}} + {You need to load imakeidx or index. Indexing will probably fail:}}{}}}}}} % The bibliography and citation styles use different forms of name \AtBeginBibliography{% - \toggletrue{blx@firstinits}% - \DeclareNameAlias{default}{last-first}% - \DeclareNameAlias{editor}{last-first}} + \toggletrue{abx@bool@giveninits}% + \DeclareNameAlias{default}{family-given}% + \DeclareNameAlias{editor}{given-family}} -\renewbibmacro*{name:last-first}[4]{% +\renewbibmacro*{name:family-given}[4]{% \ifuseprefix {\usebibmacro{name:delim}{#3#1}% \usebibmacro{name:hook}{#3#1}% @@ -59,18 +80,18 @@ {\mkbibnameprefix{\MakeCapital{#3}}\isdot} {\mkbibnameprefix{#3}\isdot}% \ifpunctmark{'}{}{\bibnamedelimc}}% - \mkbibnamelast{#1}\isdot - \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}% - \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{#2}\isdot}} + \mkbibnamefamily{#1}\isdot + \ifblank{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}% + \ifblank{#2}{}{\bibnamedelimd\mkbibnamegiven{#2}\isdot}} {\usebibmacro{name:delim}{#1}% \usebibmacro{name:hook}{#1}% - \mkbibnamelast{#1}\isdot - \ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}% + \mkbibnamefamily{#1}\isdot + \ifblank{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}% \ifblank{#2#3}{}{}% - \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{#2}\isdot}% + \ifblank{#2}{}{\bibnamedelimd\mkbibnamegiven{#2}\isdot}% \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}}} -\DeclareNameAlias{sortname}{last-first} +\DeclareNameAlias{sortname}{family-given} % This deals with initials: we need to format them without dots % and close together: HLA not H.L.A. or H. L. A. or H L A @@ -142,6 +163,7 @@ % Language Mapping \DeclareLanguageMapping{english}{english-oscola} +\DeclareLanguageMapping{british}{british-oscola} % Various aliases \DeclareBibliographyAlias{inproceedings}{book} @@ -158,8 +180,6 @@ \DeclareBibliographyAlias{mvcollection}{book} \DeclareBibliographyAlias{supcollection}{inbook} - - % This deals with suppression of the postnote delimiter after brackets. It % should be refactored to use a toggle rather than a counter @@ -414,6 +434,7 @@ \DeclareFieldFormat[legislation]{title}{#1} \DeclareFieldFormat[legal]{title}{#1} \DeclareFieldFormat{untitle}{#1} +\DeclareFieldFormat{verba}{#1} \DeclareListFormat[jurisdiction]{extracites}{% \extracitedelim #1} @@ -818,7 +839,7 @@ \DeclareBibliographyDriver{thesis}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% - \printnames{author}% + \usebibmacro{author}% \setunit{\addcomma\space}% \newblock \printfield{title}% @@ -1219,6 +1240,19 @@ \usebibmacro{court-note}% } +\newbibmacro{eujuriscitation:index:short}{% + \iftoggle{bbx@numcite} + {\iffieldundef{userb}{}{\printfield{userb}\newunit} + \printfield{number}} + {\usebibmacro{title}% + \newunit + \iffieldundef{userb} + {} + {\printtext{\mkbibparens{\printfield{userb}}\newunit}}% + \printtext{\mkbibparens{\usebibmacro{euparenthetical}}}}% + \newunit% + \usebibmacro{court-note}} + \newbibmacro{eujuriscitation:index}{% \iftoggle{bbx@numcite} {\iffieldundef{userb}{}{\printfield{userb}\newunit} @@ -1267,20 +1301,39 @@ \printfield{number}} \newbibmacro*{eu:reportinfo}{% + \iftoggle{bbx@eclionly} + {\iffieldundef{verba} + {\usebibmacro{eu:osreport}}% + {\printfield{verba}}} + {\usebibmacro{eu:osreport}}} + + +\newbibmacro*{eu:osreport}{% + \iftoggle{bbx@ecliuse} + {\iffieldundef{verba} + {} + {\printfield{verba}% + \setunit{\addcomma\space}}}% + {}% \iffieldundef{journaltitle}% {\usebibmacro{eu:unreported}}% {\usebibmacro{eu:year+vol+report}}} \newbibmacro*{eu:unreported}{% - \ifboolexpr{( test {\iflistundef{institution}} - and test {\iffieldundef{date}} - and test {\iffieldundef{year}} )} - {} - {\ifboolexpr{( test {\iffieldundef{date}} and test {\iffieldundef{year}} )} - {\mkbibparens{\printlist[jurisdiction]{institution}}} - {\bbx@unsetpostnotedelim\iflistundef{institution}% - {\mkbibparens{\usebibmacro{date}}}% - {\printtext{\bibopenparen\printlist[jurisdiction]{institution}\addcomma\space}\usebibmacro{date}\bibcloseparen}}}} + \iffieldundef{verba} + {\ifboolexpr{( test {\iflistundef{institution}} + and test {\iffieldundef{date}} + and test {\iffieldundef{year}} )} + {}% + {\ifboolexpr{( test {\iffieldundef{date}} and test {\iffieldundef{year}} )} + {\mkbibparens{\printlist[jurisdiction]{institution}}} + {\bbx@unsetpostnotedelim\iflistundef{institution}% + {\mkbibparens{\usebibmacro{date}}}% + {\printtext{\bibopenparen% + \printlist[jurisdiction]{institution}\addcomma\space}\usebibmacro{date}\bibcloseparen}}}} + {\iftoggle{bbx@ecliuse} + {} + {\printfield{verba}}}} \newbibmacro*{eu:year+vol+report}{% \iffieldequals{journaltitle}{\ecrreporttitle}% @@ -1449,19 +1502,34 @@ {\printfield[casenotetitle]{title}}}} {\usebibmacro{title}}} -\newbibmacro{juriscitation}{% - \ifkeyword{eu}% - {\usebibmacro{eujuriscitation}}% EU Case - {\ifkeyword{echr}% - {\usebibmacro{echrjuriscitation}}% ECHR Case - {\ifkeyword{int}% - {\usebibmacro{intjuriscitation}}% PIL Case - {\ifkeyword{ca}% - {\usebibmacro{canjuriscitation}}% Canadian Case - {\ifkeyword{us} - {\usebibmacro{usjuriscitation}}% US Case - {\usebibmacro{enjuriscitation}}}}}}}% Default +\newcommand{\csusebibmacro}[1]{% + \edef\bbx@tempcsname{% + \noexpand\usebibmacro{#1}}% + \bbx@tempcsname} + +\newtoggle{bbx@juriscitedone} +\newcommand{\bbx@juriscitationlist}{} +\listadd{\bbx@juriscitationlist}{{eu}{eujuriscitation}} +\listadd{\bbx@juriscitationlist}{{echr}{echrjuriscitation}} +\listadd{\bbx@juriscitationlist}{{int}{intjuriscitation}} +\listadd{\bbx@juriscitationlist}{{ca}{canjuriscitation}} +\listadd{\bbx@juriscitationlist}{{us}{usjuriscitation}} + +\global\edef\bbx@defaultjuriscitation{enjuriscitation} + +\newbibmacro{juriscitation}{% + \togglefalse{bbx@juriscitedone}% + \renewcommand{\do}[1]{% + \edef\@tempa{\noexpand\ifkeyword{\expandafter\@firstoftwo ##1}}% + \edef\@tempb{\expandafter\@secondoftwo ##1}% + \@tempa + {\toggletrue{bbx@juriscitedone}\csusebibmacro{\@tempb}} + {}}% + \dolistloop{\bbx@juriscitationlist}% + \iftoggle{bbx@juriscitedone} + {} + {\csusebibmacro{\bbx@defaultjuriscitation}}} \newbibmacro{juriscitation:index}{% \savefield{indextitle}{\bbx@tempa}% @@ -1482,6 +1550,26 @@ {\usebibmacro{usjuriscitation}} {\usebibmacro{enjuriscitation}}}}}}} +\renewbibmacro{juriscitation:index}{% + \togglefalse{bbx@juriscitedone}% + \renewcommand{\do}[1]{% + \edef\@tempa{\noexpand\ifkeyword{\expandafter\@firstoftwo ##1}}% + \edef\@tempb{\expandafter\@secondoftwo ##1}% + \@tempa + {\toggletrue{bbx@juriscitedone}\csusebibmacro{\@tempb}} + {}}% + \dolistloop{\bbx@juriscitationindexlist}% + \iftoggle{bbx@juriscitedone} + {} + {\csusebibmacro{\bbx@defaultjuriscitationindex}}} + +\newbibmacro{juriscitation:index:short}{% + \printfield{title}% + \setunit*{\addspace}% + \iffieldundef{year} + {} + {\printtext{\mkbibparens{\printfield{year}}}}} + \newbibmacro*{jurisdictionpages}{% \iffieldequals{entrysubtype}{\subtypenewsp}% {} @@ -1672,7 +1760,7 @@ \renewbibmacro*{postnote}{% \ifboolexpr {test {\iffieldundef{postnote}} or test {\iftoggle{cbx@postnoteprinted}}}% - {\midsentence} + {}%<--- this used to read \midsentence {\ifboolexpr{test {\ifnumequal{\value{bbx@suppresspostnotedelim}}{1}}} {\setunit{\addspace}% \bbx@resetpostnotedelim} @@ -2881,11 +2969,11 @@ \field{sortkey} } \sort{ - \name{sortname} - \name{author} - \name{editor} - \name{translator} - \list{institution} + \field{sortname} + \field{author} + \field{editor} + \field{translator} + \field{institution} \field{sorttitle} \field{title} \field{booktitle} @@ -2993,6 +3081,8 @@ fieldtarget=institution] \step[fieldsource=additionalreports, fieldtarget=listb] + \step[fieldsource=ecli, + fieldtarget=verba] } \map[overwrite=false]{ \pertype{legal} |