diff options
author | Karl Berry <karl@freefriends.org> | 2019-02-18 23:00:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-02-18 23:00:12 +0000 |
commit | 38be0a44ee9d2d9158e4fbc11cf492dbe2f68abe (patch) | |
tree | 61def877562c6db28c4370b42be5b1cba35af5b3 /Master/texmf-dist/tex/latex/biblatex-oxref/oxref.bbx | |
parent | 9f39ddd0d3a11b7172e79c4c22f952c611492bc5 (diff) |
biblatex-oxref (19feb19)
git-svn-id: svn://tug.org/texlive/trunk@50053 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-oxref/oxref.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-oxref/oxref.bbx | 170 |
1 files changed, 96 insertions, 74 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-oxref/oxref.bbx b/Master/texmf-dist/tex/latex/biblatex-oxref/oxref.bbx index acfede01a6d..9e1bb4ab6e0 100644 --- a/Master/texmf-dist/tex/latex/biblatex-oxref/oxref.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-oxref/oxref.bbx @@ -13,7 +13,7 @@ %% See: http://www.latex-project.org/lppl.txt %% ---------------------------------------------------------------- %% -\def\Version{2018/03/03 v0.12} +\def\Version{2019/02/15 v1.0} \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesFile{oxref.bbx} [\Version\space Base settings for bibliography styles inspired by the Oxford Guide to Style] @@ -235,10 +235,12 @@ \usebibmacro{name:andothers}} \xpatchbibmacro{name:given-family}% {\bibnamedelimd\mkbibnamesuffix{#4}}% - {\ifnumeral{#4}{}{\addcomma}\bibnamedelimd\mkbibnamesuffix{#4}}{}{} + {\ifnumeral{#4}{}{\addcomma}\bibnamedelimd\mkbibnamesuffix{#4}}% +{}{\wlog{WARNING: biblatex-oxref failed to patch name:given-family}} \xpatchbibmacro{name:family-given}% {\bibnamedelimd\mkbibnamesuffix{#4}}% - {\ifnumeral{#4}{}{\addcomma}\bibnamedelimd\mkbibnamesuffix{#4}}{}{} + {\ifnumeral{#4}{}{\addcomma}\bibnamedelimd\mkbibnamesuffix{#4}}% +{}{\wlog{WARNING: biblatex-oxref failed to patch name:family-given}} \DeclareFieldFormat{nameaddon}{\mkbibbrackets{#1}} \DeclareFieldFormat{namevariant}{\mkbibparens{\bibstring{equals}\space #1}} \newcounter{namepairs} @@ -500,7 +502,8 @@ {\global\undef\bbx@lasthash}} \xpatchbibmacro{translatorstrg}% {\bibstring}% - {\bibstring[\mkbibparens]}{}{}% + {\bibstring[\mkbibparens]}% +{}{\wlog{WARNING: biblatex-oxref failed to patch translatorstrg}}% \xpatchbibmacro{translator+othersstrg}% {\bibstring}% {\bibstring[\mkbibparens]}{}{}% @@ -574,14 +577,17 @@ \def\num@two{#2}% \StrLen{\num@one}[\num@one@len]% \StrLen{\num@two}[\num@two@len]% - \IfEq{\num@one@len}{\num@two@len}% - {\StrCompare{\num@one}{\num@two}[\Result]% + \ifboolexpr{ + test {\ifnumequal{\num@one@len}{\num@two@len}} + and + test {\ifnumless{\num@one}{\num@two}} + }{% + \StrCompare{\num@one}{\num@two}[\Result]% \ifnum\num@two@len>3% - \IfStrEq{\Result}{2}{\def\Result{1}}{}% + \IfStrEq{\Result}{2}{\def\Result{1}}{}% \fi - \StrGobbleLeft{0\num@two}{\Result}}% - {\num@two}% -} + \StrGobbleLeft{0\num@two}{\Result}% + }{\num@two}} \patchcmd{\mkdaterangefull}{% \csuse{mkbibdate#1}{#2endyear}{#2endmonth}{#2endday}% }{% @@ -676,11 +682,10 @@ \def\currentfield{eventdate}% \iffieldannotation{inferred}{\mkbibbrackets{#1}}{#1}% \undef\currentfield} -\xpatchfieldformat{edition}{% - #1\isdot -}{% - \ifbibstring{#1}{\bibstring{#1}}{#1\isdot}% -}{}{} +\xpatchfieldformat{edition}% + {#1\isdot}% + {\ifbibstring{#1}{\bibstring{#1}}{#1\isdot}}% +{}{\wlog{WARNING: biblatex-oxref failed to patch edition}} \DeclareFieldFormat{pages}{% \iffieldundef{bookpagination}% {\mkcomprange{#1}}% @@ -774,13 +779,16 @@ \DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1} \xpatchbibmacro{url+urldate}% {\setunit*{\addspace}}% - {\setunit*{\addcomma\addspace}}{}{} + {\setunit*{\addcomma\addspace}}% +{}{\wlog{WARNING: biblatex-oxref failed to patch url+urldate}} \xpatchfieldformat{doi}% {\mkbibacro{DOI}}% - {\printtext{doi}}{}{} + {\printtext{doi}}% +{}{\wlog{WARNING: biblatex-oxref failed to patch doi}} \xpatchbibmacro{doi+eprint+url}% {\printfield{doi}}% - {\setunit{\addperiod\space}\printfield{doi}}{}{} + {\setunit{\addperiod\space}\printfield{doi}}% +{}{\wlog{WARNING: biblatex-oxref failed to patch doi+eprint+url}} \renewbibmacro*{addendum+pubstate}{% \ifboolexpr{ @@ -1931,11 +1939,12 @@ reference,mvreference,inreference]{volume}{% \printfield{number}}} \renewbibmacro*{institution+location+date}{% \ifboolexpr{ - test {\iffieldundef{type}} - and - test {\iffieldundef{series}} - and - test {\iffieldundef{number}} + ( test {\iffieldundef{number}} + or + not test {\iffieldundef{type}} + or + not test {\iffieldundef{series}} + ) and test {\iflistundef{institution}} and @@ -1984,7 +1993,7 @@ reference,mvreference,inreference]{volume}{% }{% \togglefalse{blx@ox@altthesis}% \ifstrequal{#1}{out}{}{% - \PackageError{oxref} + \PackageError{biblatex-oxref} {Invalid option 'bookseries=#1'} {Valid values are 'in', 'out', and 'plain'.}}}}} \newbibmacro*{type+institution+location+date}{% @@ -2112,7 +2121,7 @@ reference,mvreference,inreference]{volume}{% \usebibmacro{institution+location+date}% }{% \usebibmacro{type+institution+location+date}% -}{}{} +}{}{\wlog{WARNING: biblatex-oxref failed to patch thesis}} \DeclareFieldFormat[booklet]{title}{% \def\currentfield{title}% \iffieldannotation{descriptor}{#1}{% @@ -2547,7 +2556,7 @@ reference,mvreference,inreference]{volume}{% \usebibmacro{finentry}} \DeclareBibliographyAlias{image}{performance} \DeclareBibliographyAlias{artwork}{performance} -\renewbibmacro*{event+venue+location+date}{% +\newbibmacro*{event+venue+location+date}{% \printfield{eventtitle}% \newunit \printfield{eventtitleaddon}% @@ -2905,7 +2914,7 @@ reference,mvreference,inreference]{volume}{% \setunit{\addspace}% \printfield{pages}}} \newbibmacro{pcitenote}{% - \iffieldundef{userc}{}{% parreporter + \iffieldundef{parreporter}{}{% \setunit{\addcomma\space}% \iffieldundef{postnote}{}{% \printfield{postnote}% @@ -2974,22 +2983,32 @@ reference,mvreference,inreference]{volume}{% \docsvlist{eu,echr,int,ca,us}% \iftoggle{bbx@juriscitedone}{}{\usebibmacro{enjuriscitation}}% } +\newtoggle{bbx@commissiondecision} \newbibmacro*{eujuriscitation}{% - \iflistcontains{institution}{\commission}{}{% + \ifboolexpr{ + test {\iflistcontains{institution}{\commission}} + or + test {\iflistcontains{institution}{\Commission}} + }{% + \toggletrue{bbx@commissiondecision}% + }{% + \togglefalse{bbx@commissiondecision}}% + \iftoggle{bbx@commissiondecision}{}{% \usebibmacro{eucasenumber}}% \usebibmacro{title}% \setunit{\addspace}% - \iflistcontains{institution}{\commission}{% + \iftoggle{bbx@commissiondecision}{% \usebibmacro{eucommissiondecision}}{}% \setunit{\addspace}% \usebibmacro{eu:reportinfo}% - \iflistcontains{institution}{\commission}{% + \iftoggle{bbx@commissiondecision}{% \setunit{\addcomma\space}% }{% \setunit{\addspace}}% + \usebibmacro{altreportdetails}% \usebibmacro{court-note}% } -\newbibmacro{eucasenumber}{% +\newbibmacro{eucasetype}{% \iffieldundef{type}{% \ifboolexpr{ test {\IfSubStr{\thefield{number}}{,}} @@ -3003,19 +3022,33 @@ reference,mvreference,inreference]{volume}{% \bibstring{eucase}}% }{% \printfield{type}}% +} +\newbibmacro{eucasenumber}{% + \usebibmacro{eucasetype}% \setunit{\addnbspace}% \printfield{number}% \setunit{\addspace}} \newbibmacro{eucommissiondecision}{% - \iffieldundef{userb}{}{% - \printfield[parens]{userb}}% - \setunit{\addspace}% - \iffieldundef{number}{}{% - \iffieldundef{type}{% - \setunit{\addspace\bibstring{commissiondecision}\addspace}% - }{% - \setunit{\addspace\printfield{type}\addspace}}% - \printfield{number}}} + \iffieldundef{userb}{% + \iffieldundef{number}{}{% + \printtext[parens]{% + \usebibmacro{eucasetype}% + \setunit{\addnbspace}% + \printfield{number}}}% + }{% + \printtext[parens]{% + \usebibmacro{eucasetype}% + \setunit{\addnbspace}% + \printfield{userb}}% + \setunit{\addspace}% + \iffieldundef{number}{}{% + \iffieldundef{type}{% + \setunit{\addspace\bibstring{commissiondecision}\addspace}% + }{% + \setunit{\addspace\printfield{type}\addspace}}% + \printfield{number}}% + }% +} \newbibmacro*{eu:reportinfo}{% \iftoggle{bbx@eclionly}{% \iffieldundef{verba}{% @@ -3269,7 +3302,7 @@ reference,mvreference,inreference]{volume}{% \usebibmacro{court-note}} \newbibmacro{altreportdetails}{% \restorefield{prenote}{\postnotesecond}% - \iffieldundef{userc}{}{% parreporter + \iffieldundef{parreporter}{}{% \usebibmacro{journaldate}[par]% \setunit{\addspace}\newblock \usebibmacro{altreportvolume}% @@ -3283,26 +3316,17 @@ reference,mvreference,inreference]{volume}{% \setunit{\addcomma\space}% \printfield[postnote]{prenote}}}} \newbibmacro*{altreportvolume}{% - \iffieldundef{userb}{% parvolume - \printfield{volume}% - }{% - \printfield{userb}}} + \iffieldundef{parvolume}{}{% + \printfield{parvolume}}} \newbibmacro*{altjournaltitle}{% - \iffieldundef{userc}{% parreporter - \printfield{journaltitle}% - \setunit{\addspace}% - }{ - \printfield{userc}}} + \iffieldundef{parreporter}{}{ + \printfield{parreporter}}} \newbibmacro*{altseries}{% - \iffieldundef{userd}{% parseries - \printfield{series}% - }{% - \printfield{userd}}} + \iffieldundef{parseries}{}{% + \printfield{parseries}}} \newbibmacro*{altjurisdictionpages}{% - \iffieldundef{usere}{% parpages - \usebibmacro{jurisdictionpages}% - }{% - \printfield{usere}}}% + \iffieldundef{parpages}{}{% + \printfield{parpages}}}% \newcommand*{\subtypecourtrules}{procedure-rule} \DeclareBibliographyDriver{legislation}{% @@ -3705,14 +3729,14 @@ reference,mvreference,inreference]{volume}{% }{% \setunit{\relatedtypepunct}\newblock \iftoggle{bbx:related} -}{}{} +}{}{\wlog{WARNING: biblatex-oxref failed to patch booklet}} \xpatchbibdriver{misc}{% \newunit\newblock \iftoggle{bbx:related} }{% \setunit{\relatedtypepunct}\newblock \iftoggle{bbx:related} -}{}{} +}{}{\wlog{WARNING: biblatex-oxref failed to patch misc}} \DeclareBibliographyOption{relationpunct}[semicolon]{% \ifcsdef{add#1}{% \ifstrequal{#1}{space}{% @@ -3763,7 +3787,7 @@ reference,mvreference,inreference]{volume}{% \setunit{\addspace}}{}% \iffieldequalstr{relatedtype}{multivolume}{% \setunit{\addcomma\space}}{}% - }}{}{} +}}{}{\wlog{WARNING: biblatex-oxref failed to append to begrelated}} \newbibmacro*{rellanguage}{% \def\do##1{% @@ -4071,14 +4095,6 @@ reference,mvreference,inreference]{volume}{% \pertype{jurisdiction} \step[fieldsource=reporter, fieldtarget=journaltitle] - \step[fieldsource=parvolume, - fieldtarget=userb] - \step[fieldsource=parreporter, - fieldtarget=userc] - \step[fieldsource=parseries, - fieldtarget=userd] - \step[fieldsource=parpages, - fieldtarget=usere] \step[fieldsource=court, fieldtarget=institution] \step[fieldsource=additionalreports, @@ -4126,16 +4142,16 @@ reference,mvreference,inreference]{volume}{% \step [fieldsource=shorttitle, match=\regexp{(\D)\.}, replace=\regexp{$1}] - \step[fieldsource=userc, + \step[fieldsource=parreporter, match=\regexp{(\d)\.(\d)}, replace=\regexp{$1.$2}] - \step[fieldsource=userc, + \step[fieldsource=parreporter, match=\regexp{(\D)\.(\d)}, replace=\regexp{$1 $2}] - \step[fieldsource=userc, + \step[fieldsource=parreporter, match=\regexp{\.(\D)}, replace=\regexp{$1}] - \step [fieldsource=userc, + \step [fieldsource=parreporter, match=\regexp{(\D)\.}, replace=\regexp{$1}] \step[fieldsource=journaltitle, @@ -4211,8 +4227,14 @@ reference,mvreference,inreference]{volume}{% match=\regexp{(\D)\.}, replace=\regexp{$1}] } + \map[overwrite=false]{ + \step[fieldsource=casenumber, final] + \step[notfield=number, fieldsource=casenumber, fieldtarget=number] + \step[fieldsource=casenumber, fieldtarget=userb] + } }% } + \DeclareSortingTemplate{nty}{ \sort{ \field{presort} @@ -4330,6 +4352,6 @@ reference,mvreference,inreference]{volume}{% [proceedings,report,artwork,audio,image,music,movie,performance,video,% manuscript,unpublished,review]{useeditor=false} %% -%% Copyright (C) 2016–2018 Alex Ball +%% Copyright (C) 2016–2019 Alex Ball %% %% End of file `oxref.bbx'. |